@fuadnafiz98/grab 0.2.0 → 0.2.1-dev.f743698
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/{copy-content-CGMz3X7m.d.cts → copy-content-CAzUtmEY.d.cts} +1 -1
- package/dist/{copy-content-DDha1TvA.d.ts → copy-content-DQZZQZP6.d.ts} +1 -1
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +1 -1
- package/dist/core-Dx-eCTty.cjs +11 -0
- package/dist/core-ejEPoULf.js +11 -0
- package/dist/{execute-context-menu-action-Cjt3m1zR.js → execute-context-menu-action-BaXLXj6l.js} +1 -1
- package/dist/{execute-context-menu-action-CHfKH94T.cjs → execute-context-menu-action-CsZOSfln.cjs} +1 -1
- package/dist/{freeze-updates-Cvj-Y46C.cjs → freeze-updates-DBBSRtAF.cjs} +1 -1
- package/dist/{freeze-updates-CoA5HhEe.js → freeze-updates-DECkfxYt.js} +1 -1
- package/dist/{index-WLhSTqMb.d.ts → index-DPeQbi7w.d.ts} +1 -1
- package/dist/{index-Bqe1Iy_L.d.cts → index-DjJuQ7ZY.d.cts} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.global.js +17 -17
- package/dist/index.js +1 -1
- package/dist/{open-file-MqN8EESZ.cjs → open-file-BZAuEuL8.cjs} +1 -1
- package/dist/{open-file-BdrH-ydl.js → open-file-TcYkvyZR.js} +1 -1
- package/dist/primitives.cjs +1 -1
- package/dist/primitives.d.cts +1 -1
- package/dist/primitives.d.ts +1 -1
- package/dist/primitives.js +1 -1
- package/dist/renderer-9XnixT6M.js +11 -0
- package/dist/renderer-BbKJqNUq.cjs +11 -0
- package/dist/styles.css +1 -1
- package/package.json +2 -2
- package/dist/core-B9cncLB3.js +0 -11
- package/dist/core-CHBxid03.cjs +0 -11
- package/dist/renderer-D731RAfV.cjs +0 -11
- package/dist/renderer-DQuiIBL5.js +0 -11
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2025 Aiden Bai
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
import{$ as e,B as t,C as n,K as r,M as i,Q as a,S as o,U as s,W as c,X as l,Y as u,Z as d,b as f,et as p,f as m,g as h,h as g,i as _,it as v,j as ee,m as y,nt as b,ot as te,p as ne,q as x,r as re,rt as S,t as ie,v as C,w,x as ae,y as T,z as E}from"./execute-context-menu-action-BaXLXj6l.js";import{$ as oe,A as se,B as ce,C as le,Ct as D,D as O,Dt as ue,E as de,Et as k,F as A,G as fe,Gt as pe,H as j,I as me,J as M,Jt as N,Kt as P,Lt as he,Mt as ge,N as _e,O as ve,P as F,R as ye,S as be,St as I,T as xe,Tt as Se,V as Ce,X as we,Xt as L,Y as Te,Z as Ee,_ as De,_n as Oe,a as ke,b as Ae,c as je,d as Me,f as Ne,g as Pe,gn as R,h as Fe,ht as Ie,i as Le,it as Re,j as ze,jt as Be,k as Ve,l as z,ln as He,lt as Ue,m as We,nt as Ge,o as Ke,p as qe,qt as Je,r as Ye,rt as B,s as Xe,sn as Ze,st as Qe,t as $e,u as et,v as tt,vn as nt,w as rt,wt as it,x as at,y as ot,z as st}from"./freeze-updates-DECkfxYt.js";import{c as ct,d as lt,f as ut,i as dt,l as ft,n as pt,o as mt,p as ht,r as gt,t as _t}from"./open-file-TcYkvyZR.js";var vt=`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
|
|
10
|
+
@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-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-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia: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, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--spacing:4px;--font-weight-medium:500;--font-weight-semibold:600;--radius-sm:4px;--ease-out:cubic-bezier(0, 0, .2, 1);--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);--ease-drawer:cubic-bezier(.32, .72, 0, 1);--ease-spring:cubic-bezier(.34, 1.56, .64, 1)}}@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{.a11y-hitbox{position:relative}.a11y-hitbox:before{content:"";pointer-events:auto;width:100%;min-width:24px;height:100%;min-height:24px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.-top-1{top:calc(var(--spacing) * -1)}.top-0{top:calc(var(--spacing) * 0)}.top-full{top:100%}.-right-1{right:calc(var(--spacing) * -1)}.right-full{right:100%}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing) * 0)}.left-full{left:100%}.z-1{z-index:1}.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\\.5{margin:calc(var(--spacing) * -.5)}.m-0{margin:calc(var(--spacing) * 0)}.-mx-2{margin-inline:calc(var(--spacing) * -2)}.-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{margin-right:calc(var(--spacing) * 1)}.mr-1\\.5{margin-right:calc(var(--spacing) * 1.5)}.mr-2\\.5{margin-right:calc(var(--spacing) * 2.5)}.mb-1\\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2\\.5{margin-bottom:calc(var(--spacing) * 2.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)}.line-clamp-5{-webkit-line-clamp:5;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.list-item{display:list-item}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.h-2\\.5{height:calc(var(--spacing) * 2.5)}.h-5{height:calc(var(--spacing) * 5)}.h-\\[17px\\]{height:17px}.h-fit{height:fit-content}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-4{min-height: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-2\\.5{min-width:calc(var(--spacing) * 2.5)}.min-w-\\[100px\\]{min-width:100px}.min-w-\\[150px\\]{min-width:150px}.flex-1{flex:1}.flex-shrink,.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.-rotate-90{rotate:-90deg}.rotate-0{rotate:0deg}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.interactive-scale{transition:transform .4s cubic-bezier(.34,1.56,.64,1)}@media (hover:hover) and (pointer:fine){.interactive-scale:hover{transform:scale(1.05)}}.interactive-scale:active{transition:transform 60ms cubic-bezier(0,0,.2,1);transform:scale(.96)}.press-scale{transition:transform .4s cubic-bezier(.34,1.56,.64,1)}.press-scale:active{transition:transform 60ms cubic-bezier(0,0,.2,1);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,)}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.\\[scrollbar-width\\:thin\\]{scrollbar-width:thin}.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}.flex-wrap{flex-wrap:wrap}.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{gap:calc(var(--spacing) * 0)}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.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-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded-\\[13px\\]{border-radius:13px}.rounded-\\[14px\\]{border-radius:14px}.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-\\[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-t{border-top-style:var(--tw-border-style);border-top-width:1px}.\\[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-\\[var\\(--rg-border-button\\)\\]{border-color:var(--rg-border-button)}.border-\\[var\\(--rg-border-subtle\\)\\]{border-color:var(--rg-border-subtle)}.border-t-\\[var\\(--rg-border-subtle\\)\\]{border-top-color:var(--rg-border-subtle)}.bg-\\[var\\(--rg-error-bg\\)\\]{background-color:var(--rg-error-bg)}.bg-\\[var\\(--rg-panel-bg\\)\\]{background-color:var(--rg-panel-bg)}.bg-\\[var\\(--rg-submit-bg\\)\\]{background-color:var(--rg-submit-bg)}.bg-\\[var\\(--rg-surface-hover\\)\\]{background-color:var(--rg-surface-hover)}.bg-\\[var\\(--rg-text-primary\\)\\]{background-color:var(--rg-text-primary)}.bg-transparent{background-color:#0000}.p-0{padding:calc(var(--spacing) * 0)}.px-0\\.5{padding-inline:calc(var(--spacing) * .5)}.px-0\\.25{padding-inline:calc(var(--spacing) * .25)}.px-1{padding-inline:calc(var(--spacing) * 1)}.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)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pb-1\\.5{padding-bottom:calc(var(--spacing) * 1.5)}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-\\[8px\\]{font-size:8px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.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)}.leading-none{--tw-leading:1;line-height:1}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.wrap-break-word{overflow-wrap:break-word}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.text-\\[var\\(--rg-error-text\\)\\]{color:var(--rg-error-text)}.text-\\[var\\(--rg-panel-bg\\)\\]{color:var(--rg-panel-bg)}.text-\\[var\\(--rg-submit-fg\\)\\]{color:var(--rg-submit-fg)}.text-\\[var\\(--rg-text-primary\\)\\]{color:var(--rg-text-primary)}.text-\\[var\\(--rg-text-primary-85\\)\\]{color:var(--rg-text-primary-85)}.text-\\[var\\(--rg-text-secondary\\)\\]{color:var(--rg-text-secondary)}.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-50{opacity:.5}.opacity-60{opacity:.6}.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)}.\\[box-shadow\\:var\\(--rg-shadow\\)\\]{box-shadow:var(--rg-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\\:var\\(--rg-drop-shadow\\)\\]{filter:var(--rg-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,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.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\\]{transition-property:grid-template-columns;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[grid-template-rows\\]{transition-property:grid-template-rows;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-\\[padding\\,border-radius\\,transform\\]{transition-property:padding,border-radius,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[top\\,left\\,width\\,height\\,opacity\\,border-radius\\]{transition-property:top,left,width,height,opacity,border-radius;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[transform\\,color\\]{transition-property:transform,color;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))}.delay-\\[80ms\\]{transition-delay:80ms}.duration-60{--tw-duration:60ms;transition-duration:60ms}.duration-75{--tw-duration:75ms;transition-duration:75ms}.duration-100{--tw-duration:.1s;transition-duration:.1s}.duration-120{--tw-duration:.12s;transition-duration:.12s}.duration-140{--tw-duration:.14s;transition-duration:.14s}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-180{--tw-duration:.18s;transition-duration:.18s}.duration-220{--tw-duration:.22s;transition-duration:.22s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-400{--tw-duration:.4s;transition-duration:.4s}.ease-\\[cubic-bezier\\(0\\,0\\,0\\.2\\,1\\)\\]{--tw-ease:cubic-bezier(0,0,.2,1);transition-timing-function:cubic-bezier(0,0,.2,1)}.ease-drawer{--tw-ease:var(--ease-drawer);transition-timing-function:var(--ease-drawer)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.ease-spring{--tw-ease:var(--ease-spring);transition-timing-function:var(--ease-spring)}.will-change-\\[opacity\\,transform\\]{will-change:opacity,transform}.will-change-transform{will-change: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}@media (hover:hover){.group-hover\\:text-\\[var\\(--rg-text-primary\\)\\]:is(:where(.group):hover *){color:var(--rg-text-primary)}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}.hover\\:bg-\\[var\\(--rg-error-bg-hover\\)\\]:hover{background-color:var(--rg-error-bg-hover)}.hover\\:bg-\\[var\\(--rg-surface-active\\)\\]:hover{background-color:var(--rg-surface-active)}.hover\\:bg-\\[var\\(--rg-surface-hover\\)\\]:hover{background-color:var(--rg-surface-hover)}.hover\\:text-\\[var\\(--rg-text-primary\\)\\]:hover{color:var(--rg-text-primary)}}.focus\\:opacity-100:focus{opacity:1}.disabled\\:cursor-default:disabled{cursor:default}.disabled\\:opacity-40:disabled{opacity:.4}}:host{all:initial;direction:ltr}:host,[data-rg-theme=dark]{--rg-panel-bg:#161616;--rg-text-primary:#fff;--rg-text-secondary:#a7a7a7;--rg-surface-hover:#ffffff1a;--rg-surface-active:#ffffff26;--rg-border-subtle:#ffffff1a;--rg-border-button:#fff3;--rg-submit-bg:#fff;--rg-submit-fg:#161616;--rg-error-text:#f87171;--rg-error-bg:#3d1515;--rg-error-bg-hover:#4d1f1f;--rg-shadow:0 2px 8px #00000014;--rg-drop-shadow:drop-shadow(0px 2px 8px #00000014);--rg-shimmer-from:#a1a1aa;--rg-shimmer-to:#d4d4d8;--rg-text-primary-85:#ffffffd9}@media (prefers-color-scheme:dark){:host:not([data-rg-theme]){--rg-panel-bg:#fff;--rg-text-primary:#171717;--rg-text-secondary:#737373;--rg-surface-hover:#0000000d;--rg-surface-active:#00000014;--rg-border-subtle:#00000014;--rg-border-button:#00000026;--rg-submit-bg:#171717;--rg-submit-fg:#fff;--rg-error-text:#dc2626;--rg-error-bg:#fee2e2;--rg-error-bg-hover:#fecaca;--rg-shadow:0 2px 12px #0000001a;--rg-drop-shadow:drop-shadow(0px 2px 12px #0000001a);--rg-shimmer-from:#71717a;--rg-shimmer-to:#a1a1aa;--rg-text-primary-85:#171717d9}}:host([data-rg-theme=light]),[data-rg-theme=light]{--rg-panel-bg:#fff;--rg-text-primary:#171717;--rg-text-secondary:#737373;--rg-surface-hover:#0000000d;--rg-surface-active:#00000014;--rg-border-subtle:#00000014;--rg-border-button:#00000026;--rg-submit-bg:#171717;--rg-submit-fg:#fff;--rg-error-text:#dc2626;--rg-error-bg:#fee2e2;--rg-error-bg-hover:#fecaca;--rg-shadow:0 2px 12px #0000001a;--rg-drop-shadow:drop-shadow(0px 2px 12px #0000001a);--rg-shimmer-from:#71717a;--rg-shimmer-to:#a1a1aa;--rg-text-primary-85:#171717d9}@media (prefers-reduced-motion:reduce){:host,:host *,:host :before,:host :after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}:host :focus{box-shadow:none!important;outline:none!important}@keyframes shake{0%,to{translate:0}15%,45%{translate:calc(-3px * var(--rg-shake-x,1)) calc(-3px * var(--rg-shake-y,0))}30%,60%{translate:calc(3px * var(--rg-shake-x,1)) calc(3px * var(--rg-shake-y,0))}75%{translate:calc(-2px * var(--rg-shake-x,1)) calc(-2px * var(--rg-shake-y,0))}90%{translate:calc(2px * var(--rg-shake-x,1)) calc(2px * var(--rg-shake-y,0))}}@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{background:linear-gradient(90deg, var(--rg-shimmer-from) 0%, var(--rg-shimmer-to) 25%, var(--rg-shimmer-from) 50%, var(--rg-shimmer-to) 75%, var(--rg-shimmer-from) 100%);color:#0000;background-size:200% 100%;-webkit-background-clip:text;background-clip:text;animation:2.5s linear infinite shimmer}.animate-shake,.animate-shake-vertical{will-change:translate;animation:.3s ease-out shake}@keyframes tooltip-fade-in{0%{opacity:0;transform:scale(.97)}to{opacity:1;transform:scale(1)}}.animate-tooltip-fade-in{will-change:transform, opacity;animation:.1s ease-out tooltip-fade-in}.animate-shake-vertical{--rg-shake-x:0;--rg-shake-y:1}@supports (-webkit-touch-callout:none){textarea[data-react-grab-input]{font-size:16px}}@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-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{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}`;const V=Symbol(`store-raw`),yt=Symbol(`store-node`),H=Symbol(`store-has`),bt=Symbol(`store-self`);function xt(e){let t=e[E];if(!t&&(Object.defineProperty(e,E,{value:t=new Proxy(e,Ot)}),!Array.isArray(e))){let n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let i=0,a=n.length;i<a;i++){let a=n[i];r[a].get&&Object.defineProperty(e,a,{enumerable:r[a].enumerable,get:r[a].get.bind(t)})}}return t}function St(e){let t;return typeof e==`object`&&!!e&&(e[E]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function Ct(e,t=new Set){let n,r,i,a;if(n=e!=null&&e[V])return n;if(!St(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let n=0,a=e.length;n<a;n++)i=e[n],(r=Ct(i,t))!==i&&(e[n]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);let n=Object.keys(e),o=Object.getOwnPropertyDescriptors(e);for(let s=0,c=n.length;s<c;s++)a=n[s],!o[a].get&&(i=e[a],(r=Ct(i,t))!==i&&(e[a]=r))}return e}function wt(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function U(e,t,n){if(e[t])return e[t];let[r,i]=d(n,{equals:!1,internal:!0});return r.$=i,e[t]=r}function Tt(e,t){let n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===E||t===yt?n:(delete n.value,delete n.writable,n.get=()=>e[E][t],n)}function Et(e){a()&&U(wt(e,yt),bt)()}function Dt(e){return Et(e),Reflect.ownKeys(e)}const Ot={get(e,n,r){if(n===V)return e;if(n===E)return r;if(n===t)return Et(e),r;let i=wt(e,yt),o=i[n],s=o?o():e[n];if(n===yt||n===H||n===`__proto__`)return s;if(!o){let t=Object.getOwnPropertyDescriptor(e,n);a()&&(typeof s!=`function`||e.hasOwnProperty(n))&&!(t&&t.get)&&(s=U(i,n,s)())}return St(s)?xt(s):s},has(e,n){return n===V||n===E||n===t||n===yt||n===H||n===`__proto__`?!0:(a()&&U(wt(e,H),n)(),n in e)},set(){return!0},deleteProperty(){return!0},ownKeys:Dt,getOwnPropertyDescriptor:Tt};function kt(e,t,n,r=!1){if(!r&&e[t]===n)return;let i=e[t],a=e.length;n===void 0?(delete e[t],e[H]&&e[H][t]&&i!==void 0&&e[H][t].$()):(e[t]=n,e[H]&&e[H][t]&&i===void 0&&e[H][t].$());let o=wt(e,yt),s;if((s=U(o,t,i))&&s.$(()=>n),Array.isArray(e)&&e.length!==a){for(let t=e.length;t<a;t++)(s=o[t])&&s.$();(s=U(o,`length`,a))&&s.$(e.length)}(s=o[bt])&&s.$()}function At(e,t){let n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];kt(e,i,t[i])}}function jt(e,t){if(typeof t==`function`&&(t=t(e)),t=Ct(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){let r=t[n];e[n]!==r&&kt(e,n,r)}kt(e,`length`,r)}else At(e,t)}function Mt(e,t,n=[]){let r,i=e;if(t.length>1){r=t.shift();let a=typeof r,o=Array.isArray(e);if(Array.isArray(r)){for(let i=0;i<r.length;i++)Mt(e,[r[i]].concat(t),n);return}else if(o&&a===`function`){for(let i=0;i<e.length;i++)r(e[i],i)&&Mt(e,[i].concat(t),n);return}else if(o&&a===`object`){let{from:i=0,to:a=e.length-1,by:o=1}=r;for(let r=i;r<=a;r+=o)Mt(e,[r].concat(t),n);return}else if(t.length>1){Mt(e[r],t,[r].concat(n));return}i=e[r],n=[r].concat(n)}let a=t[0];typeof a==`function`&&(a=a(i,n),a===i)||r===void 0&&a==null||(a=Ct(a),r===void 0||St(i)&&St(a)&&!Array.isArray(a)?At(i,a):kt(e,r,a))}function Nt(...[e,t]){let n=Ct(e||{}),r=Array.isArray(n),i=xt(n);function a(...e){s(()=>{r&&e.length===1?jt(n,e[0]):Mt(n,e)})}return[i,a]}const Pt=new WeakMap,Ft={get(e,t){if(t===V)return e;let n=e[t],r;return St(n)?Pt.get(n)||(Pt.set(n,r=new Proxy(n,Ft)),r):n},set(e,t,n){return kt(e,t,Ct(n)),!0},deleteProperty(e,t){return kt(e,t,void 0,!0),!0}};function It(e){return t=>{if(St(t)){let n;(n=Pt.get(t))||Pt.set(t,n=new Proxy(t,Ft)),e(n)}return t}}const W=e=>({x:e.x+e.width/2,y:e.y+e.height/2}),Lt=e=>{let t=0,n=e.previousElementSibling;for(;n;)t+=1,n=n.previousElementSibling;return t},G=new WeakMap,K=e=>{if(e.anchorElement.isConnected)return e.anchorElement;let t=e.anchorElement.tagName,n=Ie(e.anchorParentFiber);if(Qe(n)){let r=n.stateNode;if(!k(r)||!r.isConnected)return null;let i=r.children[e.anchorIndexInParent];return i&&i.tagName===t?i:null}return Rt(n,t)},Rt=(e,t)=>{let n=e.child;for(;n;){if(Qe(n)){let e=n.stateNode;if(k(e)&&e.isConnected&&e.tagName===t)return e}else if(n.child){n=n.child;continue}for(;n!==e&&!n.sibling;)if(n=n.return,!n)return null;if(n===e)return null;n=n.sibling}return null},zt=(e,t)=>{let n=e;for(let e of t){let t=(e.isShadowChild?n.shadowRoot?.children:n.children)?.[e.childIndex];if(!t)return null;n=t}return n},Bt=e=>{let t=[],n=e,r=Ue(n);for(;n&&!r;){let e=n.parentElement;if(e)t.unshift({childIndex:Lt(n),isShadowChild:!1}),n=e;else{let e=n.getRootNode();if(!Ge(e))break;t.unshift({childIndex:Lt(n),isShadowChild:!0}),n=e.host}r=Ue(n)}let i=r?.return;return!n||!i?null:{anchorElement:n,anchorParentFiber:i,anchorIndexInParent:Lt(n),domPath:t,targetTagName:e.tagName}},Vt=(e,t)=>e.anchorElement.isConnected&&e.anchorIndexInParent===Lt(e.anchorElement)&&zt(e.anchorElement,e.domPath)===t,q=e=>{if(!e.isConnected)return;let t=G.get(e);if(t&&Vt(t,e))return;let n=Bt(e);n&&G.set(e,n)},Ht=e=>{if(e.isConnected)return e;let t=G.get(e);if(!t)return null;let n=K(t);if(!n)return null;let r=zt(n,t.domPath);return r&&r.isConnected&&r.tagName===t.targetTagName?r:null},Ut=e=>{let t=Ht(e)??e;return q(t),t},Wt=e=>{for(let t=0;t<e.frozenElements.length;t+=1)e.frozenElements[t]=Ut(e.frozenElements[t]);e.frozenElement=e.frozenElement&&Ut(e.frozenElement),e.detectedElement=e.detectedElement&&Ut(e.detectedElement),e.contextMenuElement=e.contextMenuElement&&Ut(e.contextMenuElement);for(let t of e.labelInstances)if(t.element&&=Ut(t.element),t.elements)for(let e=0;e<t.elements.length;e+=1)t.elements[e]=Ut(t.elements[e]);for(let t of e.grabbedBoxes)t.element&&=Ut(t.element)},Gt=e=>({selectionInteractionLockDepth:0,wasActivatedByToggle:!1,pendingCommentMode:!1,keyHoldDuration:e.keyHoldDuration,dragStart:{x:N,y:N},copyStart:{x:N,y:N},copyOffsetFromCenterX:0,detectedElement:null,frozenElement:null,frozenElements:[],frozenDragRect:null,lastGrabbedElement:null,selectionFilePath:null,selectionLineNumber:null,inputText:``,grabbedBoxes:[],labelInstances:[],isTouchMode:!1,activationTimestamp:null,previouslyFocusedElement:null,contextMenuPosition:null,contextMenuElement:null,contextMenuClickOffset:null}),Kt=e=>{let[t,n]=Nt(Gt(e)),[r,i]=d({x:N,y:N}),[a,o]=d(0),[c,l]=d({state:`idle`}),u=e=>{n(It(t=>{e(t),t.frozenElement=t.frozenElements.length>0?t.frozenElements[0]:null,t.frozenDragRect=null;for(let e of t.frozenElements)q(e)}))},f=()=>{u(e=>{e.frozenElements=[]})},p=e=>{l(t=>t.state===`active`?{...t,phase:e}:t)},m={startHold:e=>{e!==void 0&&n(`keyHoldDuration`,e),l({state:`holding`,startedAt:Date.now()})},releaseHold:()=>{c().state===`holding`&&l({state:`idle`})},activate:()=>{s(()=>{l({state:`active`,phase:`hovering`,isPromptMode:!1,isPendingDismiss:!1}),n(`activationTimestamp`,Date.now()),n(`previouslyFocusedElement`,document.activeElement)})},deactivate:()=>{s(()=>{l({state:`idle`}),n(It(e=>{e.wasActivatedByToggle=!1,e.pendingCommentMode=!1,e.inputText=``,e.frozenElement=null,e.frozenElements=[],e.frozenDragRect=null,e.activationTimestamp=null,e.previouslyFocusedElement=null,e.contextMenuPosition=null,e.contextMenuElement=null,e.contextMenuClickOffset=null,e.isTouchMode&&(e.detectedElement=null)}))})},toggle:()=>{t.activationTimestamp===null?(n(`wasActivatedByToggle`,!0),m.activate()):m.deactivate()},freeze:()=>{if(c().state===`active`){let e=t.frozenElement??t.detectedElement;e&&(q(e),n(`frozenElement`,e)),p(`frozen`)}},unfreeze:()=>{c().state===`active`&&s(()=>{n(It(e=>{e.frozenElement=null,e.frozenElements=[],e.frozenDragRect=null})),p(`hovering`)})},startDrag:(e,t)=>{c().state===`active`&&s(()=>{t||f(),n(`dragStart`,{x:e.x+window.scrollX,y:e.y+window.scrollY}),p(`dragging-select`)})},startDragReposition:()=>{let e=c();e.state===`active`&&e.phase===`dragging-select`&&p(`dragging-reposition`)},stopDragReposition:()=>{let e=c();e.state===`active`&&e.phase===`dragging-reposition`&&p(`dragging-select`)},shiftDragStart:e=>{let t=c();t.state===`active`&&t.phase===`dragging-reposition`&&n(`dragStart`,t=>({x:t.x+e.x,y:t.y+e.y}))},endDrag:()=>{let e=c();e.state===`active`&&(e.phase===`dragging-select`||e.phase===`dragging-reposition`)&&s(()=>{n(`dragStart`,{x:N,y:N}),p(`justDragged`)})},cancelDrag:()=>{let e=c();e.state===`active`&&(e.phase===`dragging-select`||e.phase===`dragging-reposition`)&&s(()=>{n(`dragStart`,{x:N,y:N}),p(`hovering`)})},finishJustDragged:()=>{let e=c();e.state===`active`&&e.phase===`justDragged`&&p(`hovering`)},startCopy:()=>{let e=c().state===`active`;l({state:`copying`,startedAt:Date.now(),wasActive:e})},completeCopy:()=>{let e=c(),t=e.state===`copying`?e.wasActive:!1;l({state:`justCopied`,copiedAt:Date.now(),wasActive:t})},finishJustCopied:()=>{let e=c();e.state===`justCopied`&&(e.wasActive&&!t.wasActivatedByToggle?s(()=>{f(),l({state:`active`,phase:`hovering`,isPromptMode:!1,isPendingDismiss:!1})}):m.deactivate())},enterPromptMode:(e,t)=>{let{x:r}=W(B(t));q(t),s(()=>{n(`copyStart`,e),n(`copyOffsetFromCenterX`,e.x-r),i(e),n(`frozenElement`,t),n(`wasActivatedByToggle`,!0),c().state===`active`?l(e=>e.state===`active`?{...e,isPromptMode:!0,phase:`frozen`}:e):(l({state:`active`,phase:`frozen`,isPromptMode:!0,isPendingDismiss:!1}),n(`activationTimestamp`,Date.now()),n(`previouslyFocusedElement`,document.activeElement))})},exitPromptMode:()=>{l(e=>e.state===`active`?{...e,isPromptMode:!1,isPendingDismiss:!1}:e)},setInputText:e=>{n(`inputText`,e)},clearInputText:()=>{n(`inputText`,``)},setPendingDismiss:e=>{l(t=>t.state===`active`?{...t,isPendingDismiss:e}:t)},setPointer:e=>{i(t=>t.x===e.x&&t.y===e.y?t:e)},setDetectedElement:e=>{e&&q(e),n(`detectedElement`,e)},setFrozenElement:e=>{u(t=>{t.frozenElements=[e]})},setFrozenElements:e=>{u(t=>{t.frozenElements=e})},toggleFrozenElement:e=>{u(t=>{let n=t.frozenElements.indexOf(e);n>=0?t.frozenElements.splice(n,1):t.frozenElements.push(e)})},addFrozenElements:e=>{u(t=>{for(let n of e)t.frozenElements.includes(n)||t.frozenElements.push(n)})},setFrozenDragRect:e=>{n(`frozenDragRect`,e)},relinkLiveElements:()=>{n(It(Wt))},setCopyStart:(e,t)=>{let{x:r}=W(B(t));n(`copyStart`,e),n(`copyOffsetFromCenterX`,e.x-r)},setLastGrabbed:e=>{n(`lastGrabbedElement`,e)},setWasActivatedByToggle:e=>{n(`wasActivatedByToggle`,e)},setPendingCommentMode:e=>{n(`pendingCommentMode`,e)},setTouchMode:e=>{n(`isTouchMode`,e)},incrementSelectionInteractionLockDepth:()=>{n(`selectionInteractionLockDepth`,e=>e+1)},decrementSelectionInteractionLockDepth:()=>{n(`selectionInteractionLockDepth`,e=>Math.max(0,e-1))},setSelectionSource:(e,t)=>{s(()=>{n(`selectionFilePath`,e),n(`selectionLineNumber`,t)})},incrementViewportVersion:()=>{o(e=>e+1)},addGrabbedBox:e=>{e.element&&q(e.element),n(`grabbedBoxes`,t=>[...t,e])},removeGrabbedBox:e=>{n(`grabbedBoxes`,t=>t.filter(t=>t.id!==e))},clearGrabbedBoxes:()=>{n(`grabbedBoxes`,[])},addLabelInstance:e=>{e.element&&q(e.element);for(let t of e.elements??[])q(t);n(`labelInstances`,t=>[...t,e])},updateLabelInstance:(e,r,i)=>{let a=t.labelInstances.findIndex(t=>t.id===e);a!==-1&&s(()=>{n(`labelInstances`,a,`status`,r),i===void 0?r!==`error`&&n(`labelInstances`,a,`errorMessage`,void 0):n(`labelInstances`,a,`errorMessage`,i)})},removeLabelInstance:e=>{n(`labelInstances`,t=>t.filter(t=>t.id!==e))},clearLabelInstances:()=>{n(`labelInstances`,[])},showContextMenu:(e,t)=>{let{x:r,y:i}=W(B(t));q(t),s(()=>{n(`contextMenuPosition`,e),n(`contextMenuElement`,t),n(`contextMenuClickOffset`,{x:e.x-r,y:e.y-i})})},hideContextMenu:()=>{s(()=>{n(`contextMenuPosition`,null),n(`contextMenuElement`,null),n(`contextMenuClickOffset`,null)})},updateContextMenuPosition:()=>{let e=t.contextMenuElement,r=t.contextMenuClickOffset;if(!e||!r||!w(e))return;let{x:i,y:a}=W(B(e));n(`contextMenuPosition`,{x:i+r.x,y:a+r.y})}};return{store:t,actions:m,pointer:r,viewportVersion:a,current:c}},qt=e=>{if(!document.body)return;let t=document.querySelectorAll(`[${f}]`);for(let n of t)n!==e&&n.parentNode!==e&&(n.shadowRoot||n.remove());document.body.appendChild(e)},Jt=e=>{if(document.body)return qt(e),()=>{};let t=()=>{document.removeEventListener(`DOMContentLoaded`,t),qt(e)};return document.addEventListener(`DOMContentLoaded`,t,{once:!0}),()=>document.removeEventListener(`DOMContentLoaded`,t)},Yt=e=>{let t=window.setTimeout(()=>{qt(e)},P),n=new MutationObserver(()=>{e.parentNode!==document.body&&qt(e)});return n.observe(document.documentElement,{childList:!0}),()=>{window.clearTimeout(t),n.disconnect()}},Xt=e=>{let t=document.querySelectorAll(`[${f}]`);for(let e of t){let t=e.shadowRoot?.querySelector(`[${f}]`);if(t instanceof HTMLDivElement)return{root:t,host:e,cancelPendingAttachment:Yt(e)};e.remove()}let n=document.createElement(`div`);n.setAttribute(f,`true`),ce(n),n.style.zIndex=String(nt),n.style.position=`fixed`,n.style.inset=`0`,n.style.pointerEvents=`none`,n.style.contain=`strict`;let r=n.attachShadow({mode:`open`}),i=document.createElement(`style`),a=Ce();a&&(i.nonce=a),i.textContent=e??``,r.appendChild(i);let o=document.createElement(`div`);o.setAttribute(f,`true`),r.appendChild(o);let s=Jt(n),c=Yt(n);return{root:o,host:n,cancelPendingAttachment:()=>{s(),c()}}},Zt=e=>{let[t,n]=d(void 0),i=0;return r(b(e,e=>{let t=++i;if(!e){n(void 0);return}let r=gt(e)??void 0;n(r),dt(e).then(e=>{i===t&&n(e??r)}).catch(()=>{i===t&&n(r)})})),[t,n]},Qt=/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:\s*[,/]\s*([\d.]+%?))?\s*\)$/,$t=e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,`0`),en=(e,t,n,r=1)=>{let i=$t(e),a=$t(t),o=$t(n);return r>=1?`#${i}${a}${o}`:`#${i}${a}${o}${$t(r*255)}`},tn=e=>{if(!e.startsWith(`#`))return null;let t=e.slice(1);if(t.length!==6&&t.length!==8)return null;let n=parseInt(t.slice(0,2),16),r=parseInt(t.slice(2,4),16),i=parseInt(t.slice(4,6),16),a=t.length===8?parseInt(t.slice(6,8),16)/255:1;return!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)?null:{red:n,green:r,blue:i,alpha:a}},nn=e=>{let t=e.match(Qt);if(!t)return null;let n=1;if(t[4]!==void 0){let e=t[4];n=e.endsWith(`%`)?Number(e.slice(0,-1))/100:Number(e)}return en(Number(t[1]),Number(t[2]),Number(t[3]),n)},rn=/^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,an=e=>{let t=e.match(rn);if(!t)return null;let n=t[1];return n.length===3?`#${n[0]}${n[0]}${n[1]}${n[1]}${n[2]}${n[2]}`:n.length===4?`#${n[0]}${n[0]}${n[1]}${n[1]}${n[2]}${n[2]}${n[3]}${n[3]}`:`#${n}`},on=`rgba(0, 0, 0, 0)`,sn=`#00000000`,cn=/^oklch\(\s*([+-]?\d*\.?\d+%?)\s+([+-]?\d*\.?\d+%?)\s+([+-]?\d*\.?\d+)(deg|grad|rad|turn)?(?:\s*\/\s*([+-]?\d*\.?\d+%?))?\s*\)$/i,ln=180/Math.PI,un=(e,t)=>e.endsWith(`%`)?Number(e.slice(0,-1))/100*t:Number(e),dn=(e,t)=>{let n=Number(e);return t===`grad`?n*.9:t===`rad`?n*ln:t===`turn`?n*360:n},fn=e=>{let t=Math.max(0,Math.min(1,e));return(t<=.0031308?t*12.92:1.055*t**(1/2.4)-.055)*255},pn=e=>{let t=e.match(cn);if(!t)return null;let n=un(t[1],1),r=un(t[2],.4),i=dn(t[3],t[4])*Math.PI/180,a=t[5]===void 0?1:un(t[5],1);if(![n,r,i,a].every(Number.isFinite))return null;let o=r*Math.cos(i),s=r*Math.sin(i),c=n+.3963377774*o+.2158037573*s,l=n-.1055613458*o-.0638541728*s,u=n-.0894841775*o-1.291485548*s,d=c**3,f=l**3,p=u**3,m=4.0767416621*d-3.3077115913*f+.2309699292*p,h=-1.2684380046*d+2.6097574011*f-.3413193965*p,g=-.0041960863*d-.7034186147*f+1.707614701*p;return en(fn(m),fn(h),fn(g),Math.max(0,Math.min(1,a)))};let mn=null;const hn=()=>mn||(typeof document>`u`?null:(mn=document.createElement(`canvas`).getContext(`2d`,{willReadFrequently:!0}),mn)),J=(e,t)=>{e.clearRect(0,0,1,1),e.fillStyle=t,e.fillRect(0,0,1,1);let n=e.getImageData(0,0,1,1).data;return n[3]===0?sn:en(n[0],n[1],n[2],n[3]/255)},gn=e=>{let t=e.trim();if(!t)return null;if(t.toLowerCase()===`transparent`)return sn;let n=an(t);if(n)return n;let r=pn(t);if(r)return r;let i=hn();if(!i)return null;i.fillStyle=on,i.fillStyle=t;let a=i.fillStyle;return typeof a==`string`?a.toLowerCase()===on?t.toLowerCase().replace(/\s+/g,``)===`rgba(0,0,0,0)`?sn:null:a.startsWith(`#`)&&a.length===7?a:a.startsWith(`rgb`)?nn(a):J(i,t):null},_n=[`data-theme`,`data-mode`,`data-color-scheme`,`data-bs-theme`,`data-mui-color-scheme`,`data-mantine-color-scheme`],vn=[{attribute:`data-dark`,theme:`dark`},{attribute:`data-light`,theme:`light`}],yn=(e,t,n)=>{let[r,i,a]=[e,t,n].map(e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return .2126*r+.7152*i+.0722*a},bn=(e,t=0)=>{let n=gn(e),r=n?tn(n):null;return!r||r.alpha<=t?null:yn(r.red,r.green,r.blue)},xn=e=>{let t=bn(e);return t===null?null:t<.18?`dark`:`light`},Sn=e=>xn(getComputedStyle(e).backgroundColor),Cn=()=>{let e=bn(getComputedStyle(document.documentElement).color,L);return e===null?null:e>.6?`dark`:null},wn=()=>{let e=document.createElement(`div`);e.style.cssText=`position:fixed;width:0;height:0;background-color:Canvas!important`,document.documentElement.appendChild(e);let t=xn(getComputedStyle(e).backgroundColor);return e.remove(),t},Tn=e=>{let t=e.toLowerCase();return t===`dark`?`dark`:t===`light`?`light`:null},En=e=>{let t=e.style.colorScheme||getComputedStyle(e).colorScheme;return t?t.trim().toLowerCase().split(/\s+/):[]},Dn=e=>{let t=En(e),n=t.includes(`dark`);return n===t.includes(`light`)?null:n?`dark`:`light`},On=e=>{if(e.classList.contains(`dark`))return`dark`;if(e.classList.contains(`light`))return`light`;for(let t of _n){let n=e.getAttribute(t);if(!n)continue;let r=Tn(n);if(r)return r}for(let{attribute:t,theme:n}of vn)if(e.hasAttribute(t))return n;return null},kn=(e,t)=>{for(let n of e){if(!n)continue;let e=t(n);if(e)return e}return null},An=()=>{let e=[document.documentElement,document.body],t=[document.body,document.documentElement];return kn(e,On)??kn(e,Dn)??kn(t,Sn)??Cn()??wn()??`light`},Y=e=>e===`dark`?`light`:`dark`,jn=()=>{let e=[];for(let t of[document.documentElement,document.body]){if(!t)continue;e.push(t.className);for(let n of _n)e.push(t.getAttribute(n)??``);for(let{attribute:n}of vn)e.push(t.hasAttribute(n)?`1`:``);let n=t.style;e.push(n.colorScheme,n.backgroundColor,n.color);for(let t=0;t<n.length;t++){let r=n[t];r.startsWith(`--`)&&e.push(`${r}:${n.getPropertyValue(r)}`)}}return e.join(`|`)},Mn={attributes:!0,attributeFilter:[`class`,`style`,..._n,...vn.map(({attribute:e})=>e)]},Nn=(e,t)=>{let n=null,r=null,i=null,a=i=>{if(i===r&&n!==null)return getComputedStyle(document.body??document.documentElement).backgroundColor,n;r=i;let a=Y(An());return a!==n&&(n=a,e.setAttribute(`data-rg-theme`,a),t?.(a)),a},o=()=>a(jn()),s=()=>{i!==null&&(Ve(i),i=null)},c=()=>{i===null&&(i=se(()=>{i=null,o()}))},l=o(),u=()=>{let e=jn();if(e===r){c();return}s(),a(e)},d=new MutationObserver(u);d.observe(document.documentElement,Mn);let f=null;document.body?d.observe(document.body,Mn):(f=new MutationObserver((e,t)=>{document.body&&(t.disconnect(),f=null,d.observe(document.body,Mn),u())}),f.observe(document.documentElement,{childList:!0}));let p=()=>{r=null,c()},m=window.matchMedia(`(prefers-color-scheme: dark)`);return m.addEventListener(`change`,p),{theme:l,cleanup:()=>{f?.disconnect(),d.disconnect(),m.removeEventListener(`change`,p),s()}}},X=()=>{},Pn=()=>({activate:X,deactivate:X,toggle:X,comment:X,isActive:()=>!1,isEnabled:()=>!1,setEnabled:X,getToolbarState:()=>null,setToolbarState:X,onToolbarStateChange:()=>X,reset:X,dispose:X,copyElement:()=>Promise.resolve(!1),getSource:()=>Promise.resolve(null),getStackContext:()=>Promise.resolve(``),getState:()=>({isActive:!1,isDragging:!1,isCopying:!1,isPromptMode:!1,isSelectionBoxVisible:!1,isDragBoxVisible:!1,targetElement:null,dragBounds:null,grabbedBoxes:[],labelInstances:[],selectionFilePath:null,toolbarState:null}),setOptions:X,registerPlugin:X,unregisterPlugin:X,getPlugins:()=>[],getDisplayName:()=>null}),Fn=()=>{let e=new AbortController;return{signal:e.signal,abort:()=>e.abort(),addWindowListener:(t,n,r={})=>{window.addEventListener(t,n,{...r,signal:e.signal})},addDocumentListener:(t,n,r={})=>{document.addEventListener(t,n,{...r,signal:e.signal})}}},In=(e,t=`Unknown error`)=>e instanceof Error&&e.message?e.message:t,Ln=e=>e instanceof Error?e:Error(String(e)),Rn=Symbol(`aborted-promise-result`),zn=async(e,t)=>{if(!t)return e;if(t.aborted)return Rn;let n=()=>{},r=new Promise(e=>{n=()=>e(Rn)});t.addEventListener(`abort`,n,{once:!0});try{return await Promise.race([e,r])}finally{t.removeEventListener(`abort`,n)}},Bn={status:`cancelled`},Vn=e=>({functionName:e.functionName,fileName:e.fileName,lineNumber:e.lineNumber,columnNumber:e.columnNumber,isServer:e.isServer,isSymbolicated:e.isSymbolicated}),Hn=async(e,t)=>{let n=await ct(e,{maxLines:t});return{tagName:j(e),componentName:n.componentName??n.source?.componentName??void 0,content:`[${n.referenceContext}]`,source:n.source,stackContext:n.stackContext,frames:n.stack.map(Vn)}},Un=async(e,t)=>{let n=[...new Set(e)],r=await Promise.all(n.map(e=>Hn(e,t)));return r.length>0?{content:r.map(e=>e.content).join(`
|
|
11
|
+
`),entries:r}:null},Wn=(e,t,n)=>{if(e?.entries)return t===e.content?e.entries:e.entries.length===1?[{...e.entries[0],content:t,commentText:n}]:e.entries.map(e=>({...e,commentText:n}))},Gn=async(e,t,n,r)=>{if(e.signal?.aborted||await zn(t.onBeforeCopy(n),e.signal)===Rn)return Bn;let i=!1,a=!1,o=``;try{let s=await zn(e.getContent?Promise.resolve(e.getContent(n)).then(e=>({content:e})):Un(n,e.maxContextLines),e.signal);if(s===Rn)return Bn;let c=s?.content;if(c?.trim()){let l=await zn(t.transformCopyContent(c,n),e.signal);if(l===Rn)return Bn;o=r?`${r}\n${l}`:l,o.trim()&&(a=!0,i=ve(o,{componentName:e.componentName,entries:Wn(s,o,r)}))}}catch(n){if(!a&&e.signal?.aborted)return Bn;t.onCopyError(Ln(n))}return!a&&e.signal?.aborted?Bn:(i&&t.onCopySuccess(n,o,{prompt:r}),t.onAfterCopy(n,i),{status:i?`succeeded`:`failed`})},Kn=e=>{let t=[],n=e;for(;n;){t.unshift(n);let e=n.getRootNode();if(Ge(e)){n=e.host;continue}if(!st(e))break;n=D(e.defaultView)}return t},qn=(e,t)=>{if(e===t)return 0;let n=Kn(e),r=Kn(t),i=Math.min(n.length,r.length);for(let e=0;e<i;e+=1){let t=n[e],i=r[e];if(t===i)continue;let a=t.compareDocumentPosition(i);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0}return n.length-r.length},Jn=e=>e.sort(qn),Yn=e=>Number.isFinite(e.x)&&Number.isFinite(e.y)&&Number.isFinite(e.width)&&Number.isFinite(e.height)&&e.width>0&&e.height>0,Xn=(e,t)=>e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y,Zn=(e,t,n,r)=>{let i=[...e].filter(e=>!r.has(e)),a=i.filter(e=>e.tagName===`TR`),o=0;for(let t=0;t<i.length&&o<64;t+=1){let n=ye(i[t]);!n||n.tagName!==`TR`||e.has(n)||(o+=1,e.add(n),i.push(n),a.push(n))}let s=s=>{if(!s||e.has(s)||r.has(s)||o>=64)return;o+=1;let c=n.get(s);c||(c=B(s),n.set(s,c)),!(!Yn(c)||!Xn(c,t))&&(e.add(s),i.push(s),s.tagName===`TR`&&a.push(s))},c=e=>{if(!(e.length>32))for(let t of e){if(o>=64)return;s(t)}};for(let e=0;e<a.length&&o<64;e+=1){let t=a[e];s(t.previousElementSibling),s(t.nextElementSibling)}for(let e=0;e<i.length&&o<64;e+=1){let t=i[e];if(de(t))continue;let n=t.parentElement?.children.length??0;(t.tagName===`TR`||n<=32)&&(s(t.previousElementSibling),s(t.nextElementSibling)),c(t.children),t.shadowRoot&&c(t.shadowRoot.children)}},Qn=(e,t)=>{if(e.width<=0||e.height<=0)return[];let n=Math.max(1,Math.round(window.innerWidth)),r=Math.max(1,Math.round(window.innerHeight)),i=e.x,a=e.y,o=e.x+e.width,s=e.y+e.height,c=i+e.width/2,l=a+e.height/2,u=T(Math.ceil(e.width/32),3,20),d=T(Math.ceil(e.height/32),3,20),f=u*d,p=f>100?Math.sqrt(100/f):1,m=T(Math.floor(u*p),3,20),h=T(Math.floor(d*p),3,20),g=new Set,_=[],v=(e,t)=>{let i=T(Math.round(e),0,n-1),a=T(Math.round(t),0,r-1),o=a*n+i;g.has(o)||(g.add(o),_.push(i,a))};v(t.x,t.y),v(i+1,a+1),v(o-1,a+1),v(i+1,s-1),v(o-1,s-1),v(c,a+1),v(c,s-1),v(i+1,l),v(o-1,l),v(c,l);for(let t=0;t<m;t+=1){let n=i+(t+.5)/m*e.width;for(let t=0;t<h;t+=1)v(n,a+(t+.5)/h*e.height)}return _},$n=(e,t,n)=>{let r=e.x,i=e.y,a=e.x+e.width,o=e.y+e.height,s=new Set,c=new Map,l=new Map,u=new Set,d=new Set,f=new Set,p=Qn(e,t),m=e=>{let t=l.get(e);if(t!==void 0)return t;let r=n(e);return l.set(e,r),r};tt();try{for(let e=0;e<p.length;e+=2){let t=Ae(p[e],p[e+1]);for(let n of t){if(n.tagName===`CANVAS`){if(d.has(n))continue;if(u.has(n)){s.add(n);continue}u.add(n);let t=n;if(e===0)try{t=We(n,p[e],p[e+1])}catch{}let r=qe(n,t);if(r.length>0||t!==n){d.add(n);for(let e of r)s.add(e);t!==n&&s.add(t);continue}}s.add(n)}let n=!1;for(let r of t){let t=r;if(e===0&&!n){let n=ot(r,p[e],p[e+1]);n&&m(n)&&(s.add(n),n!==r&&f.add(r),t=n)}if(m(t)){if(!n){n=!0;continue}f.add(t)}}}}finally{De()}for(let e of d)s.delete(e);Zn(s,e,c,d);let h=[],g=null,_=1/0,v=1/0,ee=window.innerWidth,y=window.innerHeight,b=ee>0&&y>0,te=ee*R,ne=y*R;for(let e of s){if(it(e)&&O(e)||de(e)||!A(e)||!m(e))continue;let n=c.get(e)??B(e);if(!Yn(n))continue;let s=n.x,l=n.y,u=s+n.width,d=l+n.height;if(b&&n.width>=te&&n.height>=ne&&Math.min(ee,u)-Math.max(0,s)>=te&&Math.min(y,d)-Math.max(0,l)>=ne)continue;let p=Math.max(0,Math.min(a,u)-Math.max(r,s)),x=Math.max(0,Math.min(o,d)-Math.max(i,l)),re=n.width*n.height;if(p<=0||x<=0||re<=0)continue;let S=at(e),ie=0,C=0,w=1/0;if(S)for(let e of S){let n=e.x,s=e.y,c=n+e.width,l=s+e.height,u=Math.max(0,Math.min(a,c)-Math.max(r,n)),d=Math.max(0,Math.min(o,l)-Math.max(i,s));ie+=u*d,C+=e.width*e.height;let f=Math.max(n-t.x,0,t.x-c),p=Math.max(s-t.y,0,t.y-l),m=f*f+p*p;w=Math.min(w,m)}else{ie=p*x;let e=Math.max(s-t.x,0,t.x-u),n=Math.max(l-t.y,0,t.y-d);w=e*e+n*n}if(ie<=0)continue;let ae=S&&!f.has(e)?C:re;if(ie/ae>=.75){h.push(e);continue}(w<_||w===_&&re<v)&&(g=e,_=w,v=re)}return h.length>0?Jn(h):g?[g]:[]},er=e=>{let t=new Set(e),n=[];for(let r=e.length-1;r>=0;--r){let i=e[r];if(!t.has(i))continue;let a=i,o=ye(a),s=!1;for(;o;){let e=a.getRootNode();if(t.has(o)&&Ge(e)&&e.host===o)t.delete(o);else if(t.has(o)){s=!0;break}a=o,o=ye(a)}s||n.push(i)}return n.reverse()},tr=(e,t,n)=>er($n(e,t,n)),nr=(e,t)=>e.width<=0?0:T((t.x-e.x)/e.width,0,1),rr=()=>{Re(),be(),et(),C()},ir=e=>({borderRadius:`0px`,height:e.height,width:e.width,x:e.pageX-window.scrollX,y:e.pageY-window.scrollY}),ar=e=>({pageX:e.x+window.scrollX,pageY:e.y+window.scrollY,width:e.width,height:e.height}),or=e=>({borderRadius:`0px`,height:e.height,width:e.width,x:e.x,y:e.y}),sr=(e,t,n)=>{let r=(e,t,n,r)=>{let i=[],a=e,o=0;for(;a&&i.length<n&&o<100;)r(a)&&i.push(a),a=t(a),o+=1;return i},i=r(ye(e),ye,6,t);i.reverse();let a=i.map((e,t)=>({element:e,depth:t,isLast:!0})),o=i.length,s=r(e.previousElementSibling,e=>e.previousElementSibling,7,n),c=r(e.nextElementSibling,e=>e.nextElementSibling,7,n),l=Math.min(s.length,Math.max(3,7-c.length)),u=Math.min(c.length,7-l),d=[...s.slice(0,l).reverse(),e,...c.slice(0,u)],f=r(e.firstElementChild,e=>e.nextElementSibling,6,t),p=d.length-1,m=f.length-1;return d.forEach((t,n)=>{a.push({element:t,depth:o,isLast:n===p}),t===e&&f.forEach((e,t)=>{a.push({element:e,depth:o+1,isLast:t===m})})}),a},cr=e=>e.namespaceURI===`http://www.w3.org/2000/svg`&&e.tagName!==`svg`,lr=e=>{let t=e.getBoundingClientRect();return t.width>=16||t.height>=16},ur=(e,t)=>t(e)&&!cr(e)&&lr(e),dr=e=>e===`edit`?ge:e,fr=new Set([`c`,`C`,`с`,`С`,`ȼ`,`Ȼ`,`ↄ`,`Ↄ`,`ᴄ`,`ᶜ`,`ⱼ`,`ⅽ`,`Ⅽ`,`ç`,`Ç`,`ć`,`Ć`,`č`,`Č`,`ĉ`,`Ĉ`,`ċ`,`Ċ`]),pr=(e,t)=>t===`KeyC`?!0:!e||e.length!==1?!1:fr.has(e),mr=(e,t)=>{if(!e||!t)return!1;let n=e.toLowerCase();return t===`Space`?n===`space`||n===` `:t.startsWith(`Key`)?t.slice(3).toLowerCase()===n:t.startsWith(`Digit`)?t.slice(5)===n:!1},hr={meta:`metaKey`,cmd:`metaKey`,command:`metaKey`,win:`metaKey`,windows:`metaKey`,ctrl:`ctrlKey`,control:`ctrlKey`,shift:`shiftKey`,alt:`altKey`,option:`altKey`,opt:`altKey`},gr=e=>{let t=e.split(`+`).map(e=>e.trim().toLowerCase()),n={metaKey:!1,ctrlKey:!1,shiftKey:!1,altKey:!1,key:null};for(let e of t){let t=hr[e];t?n[t]=!0:n.key=e}return n},_r=e=>{if(typeof e==`function`)return t=>{try{return e(t)}catch{return!1}};let t=gr(e),n=t.key;return e=>{if(n===null){let n=t.metaKey?e.metaKey||e.key===`Meta`:!0,r=t.ctrlKey?e.ctrlKey||e.key===`Control`:!0,i=t.shiftKey?e.shiftKey||e.key===`Shift`:!0,a=t.altKey?e.altKey||e.key===`Alt`:!0,o=n&&r&&i&&a,s=[t.metaKey,t.ctrlKey,t.shiftKey,t.altKey].filter(Boolean).length,c=[e.metaKey||e.key===`Meta`,e.ctrlKey||e.key===`Control`,e.shiftKey||e.key===`Shift`,e.altKey||e.key===`Alt`].filter(Boolean).length;return o&&c>=s}let r=e.key?.toLowerCase()===n||mr(n,e.code),i=t.metaKey||t.ctrlKey||t.shiftKey||t.altKey?(t.metaKey?e.metaKey:!0)&&(t.ctrlKey?e.ctrlKey:!0)&&(t.shiftKey?e.shiftKey:!0)&&(t.altKey?e.altKey:!0):!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey;return r&&i}},vr=e=>!e||typeof e==`function`?{metaKey:h(),ctrlKey:!h(),shiftKey:!1,altKey:!1,key:null}:gr(e),yr=(e,t)=>{if(t.activationKey)return _r(t.activationKey)(e);let n=(h()?e.metaKey:e.ctrlKey)&&!e.shiftKey&&!e.altKey;return!!(e.key&&n&&pr(e.key,e.code))},br=(e,t,n)=>{z(e instanceof M?e:new M(t,n,e))},xr=(e,t,n)=>{try{if(n.onOpenFile(e,t))return;_t(e,t,n.transformOpenFileUrl).catch(n=>{br(n,e,t)})}catch(n){br(n,e,t)}},Sr=e=>{if(e.length===0)return{x:0,y:0,width:0,height:0};if(e.length===1)return e[0];let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let a of e)t=Math.min(t,a.x),n=Math.min(n,a.y),r=Math.max(r,a.x+a.width),i=Math.max(i,a.y+a.height);return{x:t,y:n,width:r-t,height:i-n}},Cr={enabled:!0,hue:0,selectionBox:{enabled:!0},dragBox:{enabled:!0},grabbedBoxes:{enabled:!0},elementLabel:{enabled:!0},toolbar:{enabled:!0}},wr=(e,t)=>({enabled:t.enabled??e.enabled,hue:t.hue??e.hue,selectionBox:{enabled:t.selectionBox?.enabled??e.selectionBox.enabled},dragBox:{enabled:t.dragBox?.enabled??e.dragBox.enabled},grabbedBoxes:{enabled:t.grabbedBoxes?.enabled??e.grabbedBoxes.enabled},elementLabel:{enabled:t.elementLabel?.enabled??e.elementLabel.enabled},toolbar:{enabled:t.toolbar?.enabled??e.toolbar.enabled}}),Tr={activationMode:`toggle`,keyHoldDuration:100,allowActivationInsideInput:!0,activationKey:void 0,getContent:void 0,maxContextLines:3,freezeReactUpdates:!0},Er=(t={})=>{let n=new Map,r=[],i={},a=!1,[o,s]=Nt({theme:Cr,options:{...Tr,...t},actions:[]}),c=e=>{let n=Cr,r={...Tr,...t},i=[];for(let{config:t}of e)if(t.theme&&(n=wr(n,t.theme)),t.options&&(r={...r,...t.options}),t.actions)for(let e of t.actions)i.push(e);return{theme:n,options:r,actions:i}},l=e=>{s(`theme`,e.theme),s(`options`,{...e.options,...i}),s(`actions`,e.actions)},u=()=>{l(c(r))},d=(e,t)=>{i[e]=t,s(`options`,e,()=>t)},f=[`activationMode`,`keyHoldDuration`,`allowActivationInsideInput`,`activationKey`,`getContent`,`maxContextLines`,`freezeReactUpdates`],p=e=>{if(!a)for(let t of f)e[t]!==void 0&&d(t,e[t])},m=({plugin:e,config:t})=>{try{let n=t.cleanup?.();Promise.resolve(n).catch(t=>{z(new Te(e.name,t))})}catch(t){z(new Te(e.name,t))}},h=(e,t)=>{let n;try{n=e.setup?.(t,re)??{};let r=n.cleanup?.bind(n);return{...n,cleanup:r,theme:e.theme?n.theme?wr(wr(Cr,e.theme),n.theme):e.theme:n.theme,options:e.options?{...e.options,...n.options}:n.options,actions:e.actions?[...e.actions,...n.actions??[]]:n.actions,hooks:e.hooks?{...e.hooks,...n.hooks}:n.hooks}}catch(t){throw n&&m({plugin:e,config:n}),new Ee(e.name,t)}},g=(e,t)=>{if(a)return;let i={plugin:e,config:h(e,t)},o=n.get(e.name),s=new Map(n);s.set(e.name,i);let u;try{u=c(s.values())}catch(t){throw m(i),new Ee(e.name,t)}n.set(e.name,i),r=Array.from(n.values()),l(u),o&&m(o)},_=e=>{if(a)return;let t=n.get(e);t&&(n.delete(e),r=Array.from(n.values()),m(t),u())},v=()=>{if(a)return;a=!0;let e=r;n.clear(),r=[],e.forEach(m),u()},ee=()=>r.map(({plugin:e})=>e.name),y=(e,...t)=>{for(let{plugin:n,config:i}of r){let r=i.hooks?.[e];if(r)try{let i=r(...t);i&&Promise.resolve(i).catch(t=>{z(new we(n.name,String(e),t))})}catch(t){z(new we(n.name,String(e),t))}}},b=(e,...t)=>{let n=!1;for(let{plugin:i,config:a}of r){let r=a.hooks?.[e];if(r)try{r(...t)===!0&&(n=!0)}catch(t){z(new we(i.name,String(e),t))}}return n},te=async(e,...t)=>{for(let{plugin:n,config:i}of r){let r=i.hooks?.[e];if(r)try{await r(...t)}catch(t){z(new we(n.name,String(e),t))}}},ne=async(e,t,...n)=>{let i=t;for(let{plugin:t,config:a}of r){let r=a.hooks?.[e];if(r)try{i=await r(i,...n)}catch(n){z(new we(t.name,String(e),n))}}return i},x=(e,t,...n)=>{let i=t;for(let{plugin:t,config:a}of r){let r=a.hooks?.[e];if(r)try{i=r(i,...n)}catch(n){z(new we(t.name,String(e),n))}}return i},re={onActivate:()=>y(`onActivate`),onDeactivate:()=>y(`onDeactivate`),onElementHover:e=>y(`onElementHover`,e),onElementSelect:e=>{let t=!1,n=[];for(let{plugin:i,config:a}of r){let r=a.hooks?.onElementSelect;if(r)try{let a=r(e);if(a){if(t=!0,a===!0)continue;n.push(a.catch(e=>(z(new we(i.name,`onElementSelect`,e)),!1)))}}catch(e){z(new we(i.name,`onElementSelect`,e))}}let i=n.length>0?Promise.all(n).then(e=>e.every(Boolean)):void 0;return{wasIntercepted:t,pendingResult:i}},onDragStart:(e,t)=>y(`onDragStart`,e,t),onDragEnd:(e,t)=>y(`onDragEnd`,e,t),onBeforeCopy:async e=>te(`onBeforeCopy`,e),transformCopyContent:async(e,t)=>ne(`transformCopyContent`,e,t),onAfterCopy:(e,t)=>y(`onAfterCopy`,e,t),onCopySuccess:(e,t,n)=>y(`onCopySuccess`,e,t,n),onCopyError:e=>y(`onCopyError`,e),onStateChange:e=>y(`onStateChange`,e),onPromptModeChange:(e,t)=>y(`onPromptModeChange`,e,t),onSelectionBox:(e,t,n)=>y(`onSelectionBox`,e,t,n),onDragBox:(e,t)=>y(`onDragBox`,e,t),onGrabbedBox:(e,t)=>y(`onGrabbedBox`,e,t),onElementLabel:(e,t,n)=>y(`onElementLabel`,e,t,n),onContextMenu:(e,t)=>y(`onContextMenu`,e,t),onOpenFile:(e,t)=>b(`onOpenFile`,e,t),transformHtmlContent:async(e,t)=>ne(`transformHtmlContent`,e,t),transformAgentContext:async(e,t)=>ne(`transformAgentContext`,e,t),transformActionContext:e=>x(`transformActionContext`,e),transformOpenFileUrl:(e,t,n)=>x(`transformOpenFileUrl`,e,t,n)};return e()&&S(v),{register:g,unregister:_,getPluginNames:ee,setOptions:p,dispose:v,store:o,hooks:re}},Dr=e=>{let t=e.bounds.x+e.bounds.width/2,n=e.bounds.width/2,r=e.mouseX===void 0?void 0:e.mouseX-t;return{id:y(`label`),bounds:e.bounds,boundsMultiple:e.boundsMultiple,tagName:e.tagName,componentName:e.componentName,status:e.status,createdAt:Date.now(),element:e.element,elements:e.elements,mouseX:e.mouseX,mouseXOffsetFromCenter:r,mouseXOffsetRatio:r!==void 0&&n>0?r/n:void 0,hideArrow:e.hideArrow}},Or=(e,t,n)=>{let r=new Map,i=e=>{let t=r.get(e);t!==void 0&&(window.clearTimeout(t),r.delete(e))},a=()=>{for(let e of r.values())window.clearTimeout(e);r.clear()},o=()=>{a(),e.clearLabelInstances(),n?.()},s=t=>{i(t);let n=window.setTimeout(()=>{e.updateLabelInstance(t,`fading`);let n=window.setTimeout(()=>{r.delete(t),e.removeLabelInstance(t)},125);r.set(t,n)},he);r.set(t,n)};return{createInstance:(t,n,r,i,a)=>{o();let s=Dr({bounds:t,tagName:n,componentName:r,status:i,element:a?.element,mouseX:a?.mouseX,elements:a?.elements,boundsMultiple:a?.boundsMultiple,hideArrow:a?.hideArrow});return e.addLabelInstance(s),s.id},createPerElementInstances:(t,n)=>{o();let r=[];for(let i of t){let t=Dr({bounds:B(i.element),tagName:i.tagName,componentName:i.componentName,status:n,element:i.element,mouseX:i.mouseX});e.addLabelInstance(t),r.push(t.id)}return r},updateAfterCopy:(t,n,r)=>{n?(e.updateLabelInstance(t,`copied`),s(t)):(i(t),e.updateLabelInstance(t,`error`,r||`Unknown error`))},markRetrying:t=>{i(t),e.updateLabelInstance(t,`copying`)},dismissInstance:t=>{i(t),e.removeLabelInstance(t)},cancelAllFades:a,clearAll:o,handleHoverChange:(n,r)=>{let a=t().find(e=>e.id===n);if(a){if(r){i(n),a.status===`fading`&&e.updateLabelInstance(n,`copied`);return}(a.status===`copied`||a.status===`fading`)&&s(n)}}}},kr=e=>{let t=window.innerWidth,n=window.innerHeight,r=Math.max(0,e.x),i=Math.min(t,e.x+e.width),a=Math.max(0,e.y),o=Math.min(n,e.y+e.height);return{x:(r+i)/2,y:(a+o)/2}},Ar=(e,t,n)=>{let r=[],i=(t,r)=>{let i=at(t),a=n(t);if(i){for(let e of i)if(e.x<window.innerWidth&&e.x+e.width>0&&e.y<window.innerHeight&&e.y+e.height>0){a=e;break}}let o=kr(a),s=Ne(o.x,o.y).filter(e),c=s.indexOf(t);return c===-1?null:s[c+r]??null},a=e=>{let t=i(e,1);return t&&(r.push(e),r.length>50&&(r=r.slice(-50))),t},o=e=>{if(r.length>0){let e=r.pop();if(w(e))return e}return i(e,-1)},s=(e,n)=>{let i=e=>n?e.nextElementSibling:e.previousElementSibling,a=i(e);for(;a;){if(t(a))return r=[],a;a=i(a)}return null};return{findNext:(e,t)=>{switch(e){case`ArrowUp`:return a(t);case`ArrowDown`:return o(t);case`ArrowRight`:return s(t,!0);case`ArrowLeft`:return s(t,!1);default:return null}},clearHistory:()=>{r=[]}}},jr=()=>{let e=new WeakSet,t=Object.getOwnPropertyDescriptor(KeyboardEvent.prototype,`key`),n=!1;if(t?.get&&!t.get.__reactGrabPatched){n=!0;let r=t.get,i=function(){return e.has(this)?``:r.call(this)};i.__reactGrabPatched=!0,Object.defineProperty(KeyboardEvent.prototype,`key`,{get:i,configurable:!0})}return{claimedEvents:e,originalKeyDescriptor:t,restore:()=>{n&&t&&Object.defineProperty(KeyboardEvent.prototype,`key`,t)}}},Mr=(e,t)=>({top:t<25,bottom:t>window.innerHeight-25,left:e<25,right:e>window.innerWidth-25}),Nr=(e,t,n)=>{let r=null,i=()=>{if(!t()){a();return}let o=e(),s=Mr(o.x,o.y),c=0,l=0;s.top&&(l-=10),s.bottom&&(l+=10),s.left&&(c-=10),s.right&&(c+=10);let u=!1;if(c!==0||l!==0){let e=window.scrollX,t=window.scrollY;window.scrollBy({behavior:`instant`,left:c,top:l});let r=window.scrollX-e,i=window.scrollY-t;u=r!==0||i!==0,u&&n?.({x:r,y:i})}r=u?se(i):null},a=()=>{r!==null&&(Ve(r),r=null)};return{start:i,stop:a,isActive:()=>r!==null}},Pr=()=>{let e=globalThis;return!!(e.chrome?.runtime?.id||e.browser?.runtime?.id)},Fr=e=>{try{let t=`0.2.1-dev.f743698`,n=`data:image/svg+xml;base64,${btoa(`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 294 294"><path fill="#ff40e0" d="M145 47c25-20 50-27 67-17 16 9 23 30 20 60 0 2-1 5-1 7l-2 13h-1l-12-4c-8-3-17-5-25-6l-17-3c-10-1-20-1-29-1-10 0-20 0-29 1-6 8-11 16-16 24-5 9-9 17-13 26 4 9 8 18 13 26s10 16 16 24l11 14c5 7 11 13 18 19l10 8s-1 0 0 0l-11 9c-17 14-35 22-49 22-6 0-13-2-18-5-16-9-23-30-20-59 1-3 1-5 1-8-30-12-48-29-48-50 0-18 14-35 41-47 2-1 5-2 7-3 0-2 0-5-1-7-3-30 4-51 20-60 18-10 42-3 68 17M71 201c-1 2-1 4-1 5-2 24 3 41 13 47h1c11 7 30 1 51-15-10-9-18-18-26-29-13-1-26-4-38-8m9-38c-3 9-5 17-7 26 8 2 17 4 25 6-3-5-6-10-9-16-3-5-6-10-9-16m-19-53c-2 1-3 1-5 2-21 10-34 23-34 35 0 13 14 27 39 37 3-12 7-25 12-37-5-12-9-24-12-37m37-10c-8 1-17 3-25 6 2 8 4 16 7 25 3-5 6-11 9-16zm-3-61c-4-1-8 0-12 2-10 7-15 24-13 47 0 2 0 3 1 5 12-4 25-6 38-8 8-10 16-20 26-29-15-11-29-17-40-17m111 2c-4-2-8-3-12-2-11 0-25 5-40 17 10 9 19 19 26 29 13 2 26 4 39 8v-5c3-23-2-40-13-47m-61 23c-7 6-13 13-19 19h37c-6-6-12-13-18-19"/><mask id="a"><path fill="#fff" d="m235 85-133 27 28 133 133-27Z"/></mask><path fill="#ff40e0" d="m137 130 76 11c8 1 9 11 3 15l-28 16-4 32c-1 8-10 10-14 4l-41-66c-3-6 1-13 8-12" mask="url(#a)"/></svg>`)}`;console.log(`%cReact Grab${` v${t}`}%c\nhttps://react-grab.com`,`background: #330039; color: #ffffff; border: 1px solid #d75fcb; padding: 4px 4px 4px 24px; border-radius: 4px; background-image: url("${n}"); background-size: 16px 16px; background-repeat: no-repeat; background-position: 4px center; display: inline-block; margin-bottom: 4px;`,``),e&&navigator.onLine&&!Pr()&&fetch(`https://www.react-grab.com/api/version?source=browser&v=${t}&t=${Date.now()}`,{referrerPolicy:`origin`,keepalive:!0,priority:`low`,cache:`no-store`}).then(e=>e.text()).then(e=>{e&&e!==t&&console.warn(`[React Grab] v${t} is outdated (latest: v${e}). Run \`npx grab@latest upgrade\` to upgrade.`)}).catch(()=>null)}catch{}},Z=e=>typeof e==`object`&&!!e,Ir=e=>{if(!Z(e))return null;let t={};return typeof e.enabled==`boolean`&&(t.enabled=e.enabled),(e.activationMode===`toggle`||e.activationMode===`hold`)&&(t.activationMode=e.activationMode),typeof e.keyHoldDuration==`number`&&Number.isFinite(e.keyHoldDuration)&&(t.keyHoldDuration=e.keyHoldDuration),typeof e.allowActivationInsideInput==`boolean`&&(t.allowActivationInsideInput=e.allowActivationInsideInput),typeof e.activationKey==`string`&&(t.activationKey=e.activationKey),typeof e.maxContextLines==`number`&&Number.isFinite(e.maxContextLines)&&(t.maxContextLines=e.maxContextLines),typeof e.freezeReactUpdates==`boolean`&&(t.freezeReactUpdates=e.freezeReactUpdates),typeof e.telemetry==`boolean`&&(t.telemetry=e.telemetry),Object.keys(t).length===0?null:t},Lr=()=>{if(typeof window>`u`)return null;try{let e=(document.currentScript instanceof HTMLScriptElement?document.currentScript:null)?.getAttribute(`data-options`);return e?Ir(JSON.parse(e)):null}catch{return null}},Rr=e=>e===`Enter`||e===`NumpadEnter`,zr=(e,t)=>e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height,Br=e=>{let[t,n]=d(!1);return v(()=>{let t=F(t=>n(e(t))),r=()=>n(!1);window.addEventListener(`keydown`,t,{capture:!0}),window.addEventListener(`keyup`,t,{capture:!0}),window.addEventListener(`blur`,r),S(()=>{window.removeEventListener(`keydown`,t,{capture:!0}),window.removeEventListener(`keyup`,t,{capture:!0}),window.removeEventListener(`blur`,r)})}),t},Vr={name:`copy`,actions:[{id:`copy`,label:`Copy`,shortcut:`C`,showInToolbarMenu:!0,onAction:e=>{e.copy?.()}}]},Hr={name:`comment`,actions:[{id:`comment`,label:`Comment`,shortcut:`Enter`,showInToolbarMenu:!0,onAction:e=>{e.enterPromptMode?.()}}]},Ur={name:`open`,actions:[{id:`open`,label:`Open`,shortcut:`O`,enabled:e=>!!e.filePath,onAction:e=>{e.filePath&&(xr(e.filePath,e.lineNumber,e.hooks),e.hideContextMenu(),e.cleanup())}}]},Wr={name:`fork-comment-history`,setup:e=>({hooks:{onCopySuccess:(t,n,r)=>{let i=r.prompt?.trim();if(!i||t.length===0)return;let a=t[0],o=e.getDisplayName(a)??void 0,s=t.map(e=>{try{return ht(ut(e))}catch{return``}});_({content:n,tagName:j(a)??`div`,componentName:o,elementsCount:t.length,elementSelectors:s,commentText:i,timestamp:Date.now()})}}})},Gr=e=>{let t=e.left+e.width/2,n=e.top+e.height/2,r=n,i=window.innerHeight-n,a=t,o=window.innerWidth-t,s=Math.min(r,i,a,o);return s===r?`top`:s===a?`left`:s===o?`right`:`bottom`},Kr=()=>{let e=!1;return{arm:()=>{e=!0},clear:()=>{e=!1},consume:()=>e?(e=!1,!0):!1}},qr=()=>{let[e,t]=d(!1),[n,r]=d(null),i=Kr(),a=()=>{let e=n();return w(e)?e:null},o=()=>{r(null),i.clear(),t(!1)};return{selectedElement:a,isPendingDismiss:e,select:(e,n)=>{r(e),t(!1),n?.shouldPromptBeforeMouseHandoff?i.arm():i.clear()},clear:o,consumeMouseHandoff:()=>i.consume()&&a()!==null,showDismissPrompt:()=>a()?e()?!1:(t(!0),!0):(o(),!1),takeSelection:e=>{let t=a()??(w(e)?e:null);return o(),t}}},Jr=e=>{z(new oe(`Toolbar state change subscriber failed`,e))},Yr=(e,t)=>{for(let n of e)try{Promise.resolve(n(t)).catch(Jr)}catch(e){Jr(e)}},Q=(e,t)=>{try{e()}catch(e){t.push(e)}},Xr=e=>{let t=new Map,n=new Map,r=new Map,i=new Map,a=(e,a)=>{let c=r.get(e);c&&(r.delete(e),Q(()=>c.disconnect(),a));for(let t of[...r.keys()])`host`in t&&t.ownerDocument===e&&o(t,a);for(let t of[...i.keys()])t.ownerDocument===e&&s(t,a);let l=n.get(e);n.delete(e),l&&Q(l,a);let u=t.get(e);t.delete(e),u&&Q(u,a)},o=(e,t)=>{let n=r.get(e);if(n){r.delete(e),Q(()=>n.disconnect(),t);for(let n of e.querySelectorAll(`*`))c(n,t)}},s=(e,t)=>{let n=i.get(e);n&&(i.delete(e),Q(()=>n.abortController.abort(),t),Q(()=>e.removeAttribute(He),t),n.document&&a(n.document,t))},c=(e,t)=>{it(e)&&s(e,t),e.shadowRoot&&o(e.shadowRoot,t)},l=(e,t)=>{for(let n of e.querySelectorAll(`*`))c(n,t);c(e,t)},u=n=>{t.has(n)||(t.set(n,e(n)),d(n),h(n))},d=e=>{let r=e.defaultView?.Element.prototype;if(!r)return;let i=r.attachShadow,a=new Proxy(i,{apply:(n,r,i)=>{let a=Reflect.apply(n,r,i);return a.mode===`open`&&r.isConnected&&t.has(e)&&h(a),a}});r.attachShadow=a,n.set(e,()=>{r.attachShadow===a&&(r.attachShadow=i)})},f=e=>{if(i.has(e))return;let t={abortController:new AbortController,document:null};i.set(e,t);let n=()=>{let n=[],r=O(e);if(t.document&&t.document!==r&&a(t.document,n),t.document=r,!r){e.removeAttribute(He),Fe(n,`Cleaning up replaced frame document failed`);return}e.setAttribute(He,``),u(r),Fe(n,`Cleaning up replaced frame document failed`)};e.addEventListener(`load`,n,{signal:t.abortController.signal}),n()},p=e=>{xe(e)||(it(e)&&f(e),e.shadowRoot&&h(e.shadowRoot))},m=e=>{if(p(e),!xe(e))for(let t of e.querySelectorAll(`*`))p(t)},h=e=>{if(r.has(e))return;let t=`defaultView`in e?e.defaultView:e.ownerDocument.defaultView;if(!t)return;let n=new t.MutationObserver(e=>{let t=[];for(let n of e){for(let e of n.removedNodes)k(e)&&l(e,t);for(let e of n.addedNodes)k(e)&&m(e)}Fe(t,`Cleaning up removed frame documents failed`)});r.set(e,n),n.observe(e,{childList:!0,subtree:!0});for(let t of e.querySelectorAll(`*`))p(t)};return u(document),()=>{let e=[];for(let t of[...i.keys()])s(t,e);for(let[t,n]of r)r.delete(t),Q(()=>n.disconnect(),e);for(let[t,r]of n)n.delete(t),Q(r,e);for(let[n,r]of t)t.delete(n),r&&Q(r,e);Fe(e,`Cleaning up same-origin frame documents failed`)}},Zr=(e,t)=>{window.dispatchEvent(t),t.defaultPrevented&&(e.preventDefault(),e.stopImmediatePropagation())},Qr=(e,t,n)=>({bubbles:!0,cancelable:!0,composed:!0,clientX:t,clientY:n,screenX:e.screenX,screenY:e.screenY,button:e.button,buttons:e.buttons,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey}),$r=e=>{let t=I(e.view,e.clientX,e.clientY);Zr(e,new PointerEvent(e.type,{...Qr(e,t.x,t.y),pointerId:e.pointerId,pointerType:e.pointerType,isPrimary:e.isPrimary,pressure:e.pressure,tangentialPressure:e.tangentialPressure,tiltX:e.tiltX,tiltY:e.tiltY,twist:e.twist,width:e.width,height:e.height}))},ei=e=>{let t=I(e.view,e.clientX,e.clientY);Zr(e,new MouseEvent(e.type,Qr(e,t.x,t.y)))},ti=e=>{Zr(e,new KeyboardEvent(e.type,{bubbles:!0,cancelable:!0,composed:!0,key:e.key,code:e.code,location:e.location,repeat:e.repeat,isComposing:e.isComposing,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey}))},ni=e=>Xr(t=>{if(t===document)return;let n=t.defaultView;if(!n)return;let r=new AbortController,i=je(t),a=ke(t),o={capture:!0,signal:r.signal},s=t=>{e.shouldForwardInteraction()&&$r(t)},c=t=>{e.shouldForwardInteraction()&&ei(t)},l=t=>{(e.shouldForwardInteraction()||e.shouldForwardKeyboardEvent(t))&&ti(t)},u=n=>{e.shouldForwardInteraction()&&e.shouldForwardViewportEvent(t)&&window.dispatchEvent(new Event(n.type))};return n.addEventListener(`pointermove`,s,o),n.addEventListener(`pointerdown`,s,o),n.addEventListener(`pointerup`,s,o),n.addEventListener(`pointercancel`,s,o),n.addEventListener(`contextmenu`,c,o),n.addEventListener(`click`,c,o),n.addEventListener(`keydown`,l,o),n.addEventListener(`keyup`,l,o),n.addEventListener(`keypress`,l,o),n.addEventListener(`scroll`,u,o),n.addEventListener(`resize`,u,o),()=>{r.abort();let e=[];for(let t of[i,a])try{t()}catch(t){e.push(t)}Fe(e,`Cleaning up frame event forwarding failed`)}}),ri=(e,t)=>{let n=t.ownerDocument;for(;n;){if(n===e)return!0;n=D(n.defaultView)?.ownerDocument??null}return!1};let ii=null;const ai=new Map,oi=()=>typeof window>`u`?ii:window.__REACT_GRAB__??ii??null,si=e=>{if(ii=e,typeof window<`u`&&(e?window.__REACT_GRAB__=e:delete window.__REACT_GRAB__),e)for(let[t,n]of ai){ai.delete(t);try{e.registerPlugin(n)}catch(e){z(e instanceof Ee?e:new Ee(t,e))}}},ci=e=>{ii===e&&(ii=null),typeof window<`u`&&window.__REACT_GRAB__===e&&delete window.__REACT_GRAB__},li=e=>{let t=oi();if(t){t.registerPlugin(e);return}ai.set(e.name,e)},ui=e=>{let t=oi();if(t){t.unregisterPlugin(e);return}ai.delete(e)},di=async(e,t={})=>(await Promise.allSettled(e.map(e=>pt(e,t)))).map(e=>e.status===`fulfilled`?e.value:``),fi=[Vr,Hr,Ur,Wr],pi={status:`cancelled`};let mi=!1;const hi=e=>{if(typeof window>`u`)return Pn();let t={enabled:!0,activationMode:`toggle`,keyHoldDuration:100,allowActivationInsideInput:!0,...Lr(),...e};if(t.enabled===!1||mi)return Pn();mi=!0,me(t.container??null),Fr(t.telemetry!==!1);let{enabled:a,telemetry:s,container:_,...v}=t;return l(e=>{let t=!1,a=new AbortController,s=null,l,_=new Set,C=Er(v),{store:T,actions:E,pointer:D,viewportVersion:O,current:k}=Kt({keyHoldDuration:C.store.options.keyHoldDuration??100}),A=x(()=>k().state===`holding`),M=x(()=>k().state===`active`),N=x(()=>{let e=k();return e.state===`active`&&e.phase===`frozen`}),P=x(()=>{let e=k();return e.state===`active`&&(e.phase===`dragging-select`||e.phase===`dragging-reposition`)}),ve=x(()=>{if(!P())return!1;let e=Math.abs(D().x+window.scrollX-T.dragStart.x),t=Math.abs(D().y+window.scrollY-T.dragStart.y);return e>2||t>2}),ye=x(()=>{let e=k();return e.state===`active`&&e.phase===`dragging-reposition`}),be=x(()=>{let e=k();return e.state===`active`&&e.phase===`justDragged`}),I=x(()=>k().state===`copying`),xe=x(()=>T.selectionInteractionLockDepth>0),we=x(()=>k().state===`justCopied`),L=x(()=>{let e=k();return e.state===`active`&&!!e.isPromptMode}),Te=x(()=>T.pendingCommentMode||L()),Ee=x(()=>{let e=k();return e.state===`active`&&!!e.isPromptMode&&!!e.isPendingDismiss}),De=new Map,ke=(e,t)=>{De.has(e)||De.set(e,document.body.style[e]),document.body.style[e]=t},Ae=e=>{let t=De.get(e);t!==void 0&&(document.body.style[e]=t,De.delete(e))};r(b(M,(e,t)=>{e&&!t?(Ye(D().x,D().y),ke(`touchAction`,`none`)):!e&&t&&(Le(),Ae(`touchAction`))}));let je=m(),[R,Ie]=d(je?!je.collapsed:!0),[Re,He]=d(0),[Ue,We]=d(0),[Ge,qe]=d(je),[Qe,tt]=d(!1),nt=Br(e=>e.shiftKey),[it,at]=d(null),[ot,st]=d(null),ct=x(()=>T.contextMenuPosition!==null),ut=x(()=>ct()||it()!==null),pt,ht=null,_t=new WeakMap,V=qr(),yt=()=>!R()||L()||xe()||ct()||V.isPendingDismiss(),H=()=>{Bt(!1),_t=new WeakMap},bt=e=>{let t=Ge()??m(),n={edge:t?.edge??`bottom`,ratio:t?.ratio??.5,collapsed:t?.collapsed??!1,enabled:t?.enabled??!0,defaultAction:t?.defaultAction??`copy`,...e};ne(n),qe(n),Yr(_,n)},xt=()=>{K.timerId!==null&&(clearTimeout(K.timerId),K.timerId=null)},St=()=>{K.copyWaiting=!1,K.holdTimerFired=!1,K.startTimestamp=null};r(()=>{if(k().state!==`holding`){xt();return}K.startTimestamp=Date.now(),K.timerId=window.setTimeout(()=>{if(K.timerId=null,K.copyWaiting){K.holdTimerFired=!0;return}E.activate()},T.keyHoldDuration),S(xt)}),r(()=>{let e=k();if(e.state!==`active`||e.phase!==`justDragged`)return;let t=setTimeout(()=>{E.finishJustDragged()},he);S(()=>clearTimeout(t))}),r(()=>{if(k().state!==`justCopied`)return;let e=setTimeout(()=>{E.finishJustCopied()},he);S(()=>clearTimeout(e))}),r(b(A,(e,t=!1)=>{!t||e||!M()||(C.store.options.activationMode!==`hold`&&E.setWasActivatedByToggle(!0),C.hooks.onActivate())}));let Ct=(e,t,n)=>{E.setCopyStart({x:t,y:n},e),E.clearInputText()},wt=()=>{let e=T.frozenElement||Y();e&&E.enterPromptMode({x:D().x,y:D().y},e)},U={lastDetectionTimestamp:0,pendingDetectionScheduledAt:0,latestPointerX:0,latestPointerY:0},Tt=null,Et={x:0,y:0},Dt=0,Ot=0,[kt,At]=d(null),[jt,Mt]=d(0),Nt=()=>{Tt!==null&&(clearTimeout(Tt),Tt=null)},Pt=e=>{At({x:Et.x,y:Et.y}),Dt=e},Ft=(e,t)=>{if(!ve())return;Et.x=e,Et.y=t;let n=performance.now(),r=n-Dt,i=Ot>=16;if(Dt===0||!i&&r>=100){Nt(),Pt(n);return}Nt(),Tt=window.setTimeout(()=>{ve()&&Pt(performance.now()),Tt=null},i?32:Math.min(32,100-r))},It=(e,t,n)=>(Nt(),tr(e,{x:t,y:n},rt)),Lt=()=>{Nt(),Dt=0,Ot=0,At(null),lr()},G=null,K={timerId:null,startTimestamp:null,copyWaiting:!1,holdTimerFired:!1},Rt=null,[zt,Bt]=d(!1),Vt=0,q=!1,Ht=null,Ut=()=>{q=!0,Ht!==null&&window.clearTimeout(Ht),Ht=window.setTimeout(()=>{q=!1,Ht=null},he)},Wt=()=>{Ht!==null&&(window.clearTimeout(Ht),Ht=null),q=!1},Gt=0,qt=null,Jt=null,Yt=!1,[Qt,$t]=d(!1),[en,tn]=d(null),[nn,rn]=d(null),[an,on]=Zt(nn),sn=x(()=>Te()?Be:Qt()?en():M()?ge:null),cn=e=>ur(e,rt),ln=Ar(rt,cn,B),un=Nr(D,()=>P(),e=>{if(ye()){if(E.shiftDragStart(e),Rt){Rt={x:Rt.x+e.x,y:Rt.y+e.y};return}let{pageX:t,pageY:n}=Yn(D().x,D().y);Rt={x:t,y:n}}}),dn=x(()=>M()&&!I()),fn=new Map,pn=(e,t)=>{let n=y(`grabbed`),r={id:n,bounds:e,createdAt:Date.now(),element:t};E.addGrabbedBox(r),C.hooks.onGrabbedBox(e,t);let i=window.setTimeout(()=>{fn.delete(n),E.removeGrabbedBox(n)},he+125);fn.set(n,i)},mn=async e=>{let n=await Promise.all(e.map(async e=>{let t=await ft(e),n=t?.componentName??null,r=t?.filePath,i=t?.lineNumber??void 0,a=t?.columnNumber??void 0;n||=gt(e);let o=Se(e)?e.innerText?.slice(0,100):void 0;return{tagName:j(e),id:e.id||void 0,className:e.getAttribute(`class`)||void 0,textContent:o,componentName:n??void 0,filePath:r,lineNumber:i,columnNumber:a}}));t||window.dispatchEvent(new CustomEvent(`react-grab:element-selected`,{detail:{elements:n}}))},hn=new Map,J=Or(E,()=>T.labelInstances,()=>hn.clear()),gn=e=>{for(let t of e)T.labelInstances.find(e=>e.id===t)?.status===`copying`&&(hn.delete(t),J.dismissInstance(t))},_n=()=>{a.abort()},vn=()=>(a.signal.aborted&&!t&&(a=new AbortController),a.signal),yn=()=>(_n(),vn()),bn=()=>{_n(),s=null,gn(T.labelInstances.filter(e=>e.status===`copying`).map(e=>e.id))},xn=async(e,t,n)=>{let r,i;try{if(r=await e(n),r.status===`cancelled`)return r;r.status===`failed`&&(i=`Failed to copy`)}catch(e){if(n.aborted)return pi;r={status:`failed`},i=In(e,`Action failed`)}if(t)for(let e of t)J.updateAfterCopy(e,r.status===`succeeded`,i);return r},Sn=(e,t,n,r)=>{if(e){for(let e of n)hn.delete(e);return}let i={operation:t,siblingIds:new Set(n),shouldDeactivateAfter:r};for(let e of n)hn.set(e,i)},Cn=async(e,t,n,r=yn())=>{if(r.aborted)return!1;Wt(),k().state!==`copying`&&E.startCopy();let i=await xn(e,t,r);if(i.status===`cancelled`)return!1;let a=i.status===`succeeded`;return t&&Sn(a,e,t,!!n),k().state===`copying`?(a&&E.completeCopy(),n?Z():a?(E.activate(),Ut()):(E.activate(),E.unfreeze()),!0):!0},wn=e=>{let t=hn.get(e);if(!t)return;let n=[...t.siblingIds];for(let e of n)J.markRetrying(e),hn.delete(e);Cn(t.operation,n,t.shouldDeactivateAfter).then(e=>{e||gn(n)})},Tn=e=>{hn.get(e)?.siblingIds.delete(e),hn.delete(e),J.dismissInstance(e)},En=(e,t,n,r)=>{let i=e[0],a=r??(i?gt(i):null),o=i?j(i):null,s=a??o??void 0;return Gn({getContent:C.store.options.getContent,componentName:s,maxContextLines:C.store.options.maxContextLines,signal:t},C.hooks,e,n)},Dn=async(e,t,n,r=vn())=>{if(e.length===0||r.aborted)return pi;let i=[],a=[];for(let t of e){let{wasIntercepted:e,pendingResult:n}=C.hooks.onElementSelect(t);e||i.push(t),n&&a.push(n),C.store.theme.grabbedBoxes.enabled&&pn(B(t),t)}if(await ze(),r.aborted)return pi;let o;if(i.length>0&&(o=await En(i,r,t,n),o.status===`cancelled`))return o;if(a.length>0){let e=await zn(Promise.all(a),r);if(e===Rn)return o?.status===`succeeded`?o:pi;if(!e.every(Boolean))throw new fe}return r.aborted&&!o?pi:(mn(e).catch(e=>{z(new oe(`Element selection notification failed`,e))}),o??{status:`succeeded`})},On=e=>{let n=yn(),r={},i=!1;s=r,dt(e.primaryElement).then(async t=>{if(n.aborted||s!==r){gn(e.labelInstanceIds);return}s=null,i=!0,await Cn(n=>Dn(e.targetElements,e.extraPrompt,t??void 0,n),e.labelInstanceIds.length>0?e.labelInstanceIds:null,e.shouldDeactivateAfter,n)?e.onComplete?.():gn(e.labelInstanceIds)}).catch(a=>{if(n.aborted){gn(e.labelInstanceIds);return}if(t||!i&&s!==r)return;z(new oe(`Copy operation failed`,a));let o=In(a,`Action failed`);for(let t of e.labelInstanceIds)J.updateAfterCopy(t,!1,o);e.labelInstanceIds.length>0&&Sn(!1,t=>dt(e.primaryElement).then(n=>t.aborted?pi:Dn(e.targetElements,e.extraPrompt,n??void 0,t)),e.labelInstanceIds,!!e.shouldDeactivateAfter),k().state===`copying`&&(e.shouldDeactivateAfter?Z():(E.activate(),E.unfreeze()))}).finally(()=>{s===r&&(s=null)})},kn=e=>{let{element:t,cursorX:n,selectedElements:r,extraPrompt:i,shouldDeactivateAfter:a,onComplete:o,dragRect:s}=e,c=r??[t],l=s??T.frozenDragRect,u=c.length>1,d=!u&&t===Vn()?Jn():void 0,f=l&&u?ir(l):d??B(t),p=u?f.x+f.width/2:n,m=j(t);Wt(),E.startCopy();let h=m?J.createInstance(f,m,void 0,`copying`,{element:t,mouseX:p,elements:r}):null;On({primaryElement:t,targetElements:c,labelInstanceIds:h?[h]:[],extraPrompt:i,shouldDeactivateAfter:a,onComplete:o})},An=e=>{let{elements:t,labelEntries:n,shouldDeactivateAfter:r,onComplete:i}=e,a=t[0];Wt(),E.startCopy(),On({primaryElement:a,targetElements:t,labelInstanceIds:J.createPerElementInstances(n,`copying`),shouldDeactivateAfter:r,onComplete:i})},Y=x(()=>{if(O(),!dn()||ve()||xe()||V.isPendingDismiss())return null;let e=T.detectedElement;return w(e)?e:null}),jn=x(()=>T.frozenElement||(N()?null:Y())),Mn=x(()=>!M()||L()||zt()||I()||ut()||V.isPendingDismiss()?null:nt()?N()?jn():Y()??T.frozenElement:V.selectedElement()),X=x(()=>{let e=Mn();return e?sr(e,rt,cn):[]}),Pn=x(()=>{let e=Mn();return e?Math.max(0,X().findIndex(t=>t.element===e)):0}),Ln=x(()=>Mn()!==null);r(()=>{if(!T.detectedElement)return;let e=1,t=setInterval(()=>{if(w(T.detectedElement)||E.relinkLiveElements(),!w(T.detectedElement)){if(e>0){--e;return}Ri()}},100);S(()=>clearInterval(t))}),r(b(jn,e=>{if(qt!==null&&(clearTimeout(qt),qt=null),!e){rn(null);return}qt=window.setTimeout(()=>{qt=null,rn(e)},100)})),S(()=>{qt!==null&&(clearTimeout(qt),qt=null)}),r(()=>{let e=T.frozenElements;S(Xe(e))}),r(b(M,e=>{e&&C.store.options.freezeReactUpdates&&S($e())}));let Bn=()=>{if(T.isTouchMode&&P()){let e=T.detectedElement;return!w(e)||de(e)?void 0:e}let e=jn();if(!(!e||de(e)))return e},Vn=x(()=>Bn()),Hn=()=>Vn()?T.isTouchMode&&P()?dn():dn()&&!ve():!1,Un=p(()=>T.frozenElements,e=>x(()=>(O(),B(e)))),Wn=x(()=>{let e=T.frozenElements;if(e.length===0)return[];let t=T.frozenDragRect;return t&&e.length>1?[ir(t)]:Un().map(e=>e())}),Kn=x(()=>{if(!zt()||T.pendingCommentMode||Qt())return null;let e=T.detectedElement;return!w(e)||de(e)||T.frozenElements.includes(e)?null:e}),qn=x(()=>{O();let e=Kn();if(e)return B(e)}),Jn=x(()=>{O();let e=T.frozenElements;if(e.length>0){let t=Wn();if(e.length===1){let e=t[0];if(e)return e}let n=T.frozenDragRect;return n?t[0]??ir(n):or(Sr(t))}let t=Vn();if(t)return B(t)}),Yn=(e,t)=>({pageX:e+window.scrollX,pageY:t+window.scrollY}),Xn=(e,t)=>{let{pageX:n,pageY:r}=Yn(e,t);return{x:Math.abs(n-T.dragStart.x),y:Math.abs(r-T.dragStart.y)}},Zn=(e,t)=>{let{pageX:n,pageY:r}=Yn(e,t),i=Math.min(T.dragStart.x,n),a=Math.min(T.dragStart.y,r),o=Math.abs(n-T.dragStart.x),s=Math.abs(r-T.dragStart.y);return{x:i-window.scrollX,y:a-window.scrollY,width:o,height:s}},Qn=e=>e.code===`Space`||e.key===` `,$n=()=>{if(!P())return;E.startDragReposition();let{pageX:e,pageY:t}=Yn(D().x,D().y);Rt={x:e,y:t}},er=()=>{E.stopDragReposition(),Rt=null},cr=x(()=>{if(O(),ve())return or(Zn(D().x,D().y))}),lr=x(()=>{if(jt(),!ve())return[];let e=kt();if(!e)return[];let t=Zn(e.x,e.y),n=performance.now(),r=tr(t,e,rt);return Ot=performance.now()-n,r}),fr=x(()=>(O(),lr().map(e=>B(e)))),mr=x(()=>{let e=fr();if(e.length>0)return e;let t=qn();return t?[...Wn(),t]:Wn()}),hr=p(()=>T.frozenElements,e=>{let t=j(e)||`element`,n=gt(e)??void 0;return{read:x(()=>{if(O(),!w(e))return null;let r=B(e),i=_t.get(e);return{tagName:t,componentName:n,bounds:r,mouseX:i===void 0?void 0:r.x+r.width*i}})}}),gr=x(()=>{if(L()||T.frozenElements.length<2)return[];let e=[];for(let t of hr())t.read()!==null&&e.push(t);return e}),br=x(()=>{if(L())return null;let e=Kn();return e?(O(),{tagName:j(e)||`element`,componentName:gt(e)??void 0,bounds:B(e),mouseX:D().x}):null}),Cr=x(()=>{if(I()||L()){O();let e=T.frozenElement||Y();return e?{x:W(B(e)).x+T.copyOffsetFromCenterX,y:T.copyStart.y}:{x:T.copyStart.x,y:T.copyStart.y}}return{x:D().x,y:D().y}}),wr=x(()=>{if(!zt()||T.frozenElements.length!==1)return;O();let e=T.frozenElements[0];if(!w(e))return;let t=_t.get(e);if(t===void 0)return;let n=B(e);return n.x+n.width*t});r(b(()=>[Y(),T.lastGrabbedElement],([e,t])=>{t&&e&&t!==e&&E.setLastGrabbed(null),e&&C.hooks.onElementHover(e)})),r(b(()=>Y(),e=>{let t=++Gt,n=()=>{Gt===t&&E.setSelectionSource(null,null)};if(!e){n();return}ft(e).then(e=>{if(Gt===t){if(!e){n();return}E.setSelectionSource(e.filePath,e.lineNumber)}}).catch(()=>{Gt===t&&E.setSelectionSource(null,null)})}));let Tr=x(()=>T.grabbedBoxes.map(e=>({id:e.id,bounds:e.bounds,createdAt:e.createdAt}))),Dr=x(()=>T.labelInstances.map(e=>({id:e.id,status:e.status,tagName:e.tagName,componentName:e.componentName,createdAt:e.createdAt})));r(b(x(()=>{let e=M(),t=P(),n=I(),r=L(),i=Y(),a=cr(),o=C.store.theme.enabled,s=C.store.theme.selectionBox.enabled,c=C.store.theme.dragBox.enabled,l=ve(),u=jn(),d=we();return{isActive:e,isDragging:t,isCopying:n,isPromptMode:r,isSelectionBoxVisible:!!(o&&s&&e&&!n&&!d&&!t&&u!=null),isDragBoxVisible:!!(o&&c&&e&&!n&&l),targetElement:i,dragBounds:a?{x:a.x,y:a.y,width:a.width,height:a.height}:null,grabbedBoxes:[...Tr()],labelInstances:[...Dr()],selectionFilePath:T.selectionFilePath,toolbarState:Ge()}}),e=>{C.hooks.onStateChange(e)})),r(b(()=>{let e=L();return{inputMode:e,position:e?D():te(D),target:e?Y():te(Y)}},({inputMode:e,position:t,target:n})=>{C.hooks.onPromptModeChange(e,{x:t.x,y:t.y,targetElement:n})})),r(b(()=>[ia(),Jn(),Y()],([e,t,n])=>{C.hooks.onSelectionBox(!!e,t??null,n)})),r(b(()=>[ma(),cr()],([e,t])=>{C.hooks.onDragBox(!!e,t??null)})),r(b(()=>{let e=ga();return[e,ha(),e?Cr():te(Cr),e?Y():te(Y),T.selectionFilePath,T.selectionLineNumber]},([e,t,n,r,i,a])=>{C.hooks.onElementLabel(e,t,{x:n.x,y:n.y,content:``,element:r??void 0,tagName:r&&j(r)||void 0,filePath:i??void 0,lineNumber:a??void 0})}));let kr=null,Pr=e=>{if(e){if(!kr){kr=document.createElement(`style`),kr.setAttribute(`data-react-grab-cursor`,``);let e=Ce();e&&(kr.nonce=e),ce(kr),document.head.appendChild(kr)}kr.textContent=`* { cursor: ${e} !important; }`}else kr&&=(kr.remove(),null)};r(b(()=>[M(),I(),L()],([e,t,n])=>{Pr(t?`progress`:e&&!n?`crosshair`:null)}));let Fr=()=>{let e=A();E.activate(),e||C.hooks.onActivate()},Z=()=>{bn(),Yt=!1;let e=P(),t=T.previouslyFocusedElement;er(),E.deactivate(),Aa(),H(),bi(),V.clear(),$t(!1),tn(null),e&&(Ae(`userSelect`),Lt()),G&&window.clearTimeout(G),un.stop(),Se(t)&&t!==document.body&&t!==document.activeElement&&w(t)&&t.focus({preventScroll:!0}),C.hooks.onDeactivate()},Ir=()=>{A()&&E.releaseHold(),M()||I()?Z():bn(),Wt()},Lr=()=>{E.setWasActivatedByToggle(!0),Fr()},Vr=()=>{let e=[...T.frozenElements],t=T.frozenElement||Y(),n=L()?T.inputText.trim():``;if(!t){Z();return}let r=e.length>0?e:[t],i=r.map(e=>B(e))[0],{x:a,y:o}=W(i),s=a+T.copyOffsetFromCenterX;E.setPointer({x:a,y:o}),E.exitPromptMode(),E.clearInputText(),Yt&&(E.setPendingCommentMode(!0),E.setWasActivatedByToggle(!1)),kn({element:t,cursorX:s,selectedElements:r,extraPrompt:n||void 0,shouldDeactivateAfter:!Yt})},Hr=()=>{if(L()){if(Ee()){E.clearInputText(),Z();return}E.setPendingDismiss(!0),We(e=>e+1)}},Ur=()=>{if(V.isPendingDismiss()){Ci();return}E.clearInputText(),Z()},Wr=()=>{E.setPendingDismiss(!1)},Kr=()=>{Jt=null,$t(!1),E.setPendingCommentMode(!1),tn(null)},Jr=e=>{Jt=e,tn(e),$t(!0)},Xr=e=>{let t=T.frozenElement||Y();if(!t)return!1;let n={x:D().x,y:D().y},r=C.store.actions.find(t=>t.id===e);return r?(E.clearInputText(),E.exitPromptMode(),Kr(),ie(r,ki(t,n))||$r(t,n),!0):(E.clearInputText(),E.exitPromptMode(),Kr(),$r(t,n),!0)},Zr=e=>{if(I()){Z();return}if(M()){if(sn()!==e){if(Yt=e===Be,L()){if(Xr(e))return;Z();return}E.setPendingCommentMode(!1),Jr(e);return}Z();return}R()&&(Yt=e===Be,Jr(e),Lr())},Qr=(e,t,n)=>{Kr(),E.clearInputText(),E.enterPromptMode({x:t,y:n},e)},$r=(e,t)=>{H(),ja(),E.showContextMenu(t,e),bi(),C.hooks.onContextMenu(e,t)},ei=(e,t)=>{let n=Jt;if(Jt=null,tn(null),!n)return;let r=C.store.actions.find(e=>e.id===n);if(!r){$r(e,t);return}ie(r,ki(e,t))||$r(e,t)},ti=()=>{if(R()){if(M()&&Te()){Z();return}E.setPendingCommentMode(!0),Yt=!0,M()||Lr()}},ii=(e,t,n)=>{let r=n&&zt()&&!P()&&!T.pendingCommentMode&&!Qt();if(yt()||N()&&!r)return;if(E.setPointer({x:e,y:t}),U.latestPointerX=e,U.latestPointerY=t,r){let n=Me(e,t);n!==T.detectedElement&&E.setDetectedElement(n);return}let i=performance.now(),a=U.pendingDetectionScheduledAt>0&&i-U.pendingDetectionScheduledAt<200;if(!ve()&&!a){U.pendingDetectionScheduledAt=i;let e=Math.max(0,32-(i-U.lastDetectionTimestamp));setTimeout(()=>{if(yt()||N()||ve()){U.pendingDetectionScheduledAt=0;return}T.detectedElement&&!w(T.detectedElement)&&(E.relinkLiveElements(),et()),U.lastDetectionTimestamp=performance.now();let e=Me(U.latestPointerX,U.latestPointerY);e!==T.detectedElement&&E.setDetectedElement(e),U.pendingDetectionScheduledAt=0},e)}if(P()){if(ye()){let{pageX:n,pageY:r}=Yn(e,t);Rt&&E.shiftDragStart({x:n-Rt.x,y:r-Rt.y}),Rt={x:n,y:r}}Ft(e,t);let n=Mr(e,t),r=n.top||n.bottom||n.left||n.right;r&&!un.isActive()?un.start():!r&&un.isActive()&&un.stop()}},ai=(e,t,n)=>{if(!dn()||xe())return!1;!n&&zt()&&H();let r=V.selectedElement()!==null;return E.startDrag({x:e,y:t},n||r),E.setPointer({x:e,y:t}),ke(`userSelect`,`none`),C.hooks.onDragStart(e+window.scrollX,t+window.scrollY),!0},oi=(e,t)=>{let n=T.frozenElements.includes(e),r=T.frozenElements.length===0;if(!n){let n=nr(B(e),t);_t.set(e,n),r&&on(gt(e)??void 0)}E.toggleFrozenElement(e),et();let i=T.frozenElements.includes(e);if(i||_t.delete(e),T.frozenElements.length===0){H(),E.unfreeze();return}Ke(T.frozenElements),Bt(!0),E.setPointer(t),E.setLastGrabbed(i?e:T.frozenElements[T.frozenElements.length-1]),E.freeze(),bi()},si=()=>{let e=T.frozenElements.filter(w),t=e.map(e=>{let t=j(e)||`element`,n=gt(e)??void 0,r=_t.get(e),i=B(e);return{element:e,tagName:t,componentName:n,mouseX:r===void 0?i.x+i.width/2:i.x+i.width*r}});if(H(),e.length===0){E.unfreeze();return}if(e.length===1){kn({element:e[0],cursorX:t[0].mouseX,selectedElements:e,shouldDeactivateAfter:T.wasActivatedByToggle});return}An({elements:e,labelEntries:t,shouldDeactivateAfter:T.wasActivatedByToggle})},li=(e,t,n,r)=>{if(t.length===0)return;let i=r&&!T.pendingCommentMode&&!Qt();if(i&&E.addFrozenElements(t),Ke(i?T.frozenElements:t),C.hooks.onDragEnd(t,e),i){let e=t[t.length-1];Bt(!0),et(),E.setPointer(W(B(e))),E.setLastGrabbed(e),E.freeze(),bi();return}let a=t[0],o=W(B(a));E.setPointer(o),E.setFrozenElements(t);let s=ar(e);if(E.setFrozenDragRect(s),E.freeze(),E.setLastGrabbed(a),T.pendingCommentMode){Qr(a,o.x,o.y);return}if(Qt()){$t(!1),Jt?ei(a,o):$r(a,o);return}let c=T.wasActivatedByToggle&&!n;kn({element:a,cursorX:o.x,selectedElements:t,shouldDeactivateAfter:c,dragRect:s})},ui=e=>{for(let t of T.frozenElements)if(w(t)&&zr(e,B(t)))return t;return null},di=(e,t,n,r)=>{let i=w(T.frozenElement)?T.frozenElement:null,a=V.selectedElement(),o=()=>Ne(e,t).find(rt)??null;if(r&&!T.pendingCommentMode&&!Qt()){let n=o();n!==null&&oi(n,{x:e,y:t});return}let s=o()??(w(T.detectedElement)?T.detectedElement:null),c=a??s??i;if(!c)return;let l,u,d=s===null&&i===c,f=a===c;if(d)l=D().x,u=D().y;else if(f){let e=W(B(c));l=e.x,u=e.y}else l=e,u=t;if(T.pendingCommentMode){Qr(c,l,u),V.clear();return}if(Qt()){$t(!1);let{wasIntercepted:e}=C.hooks.onElementSelect(c);if(e)return;V.clear(),Ke([c]),E.setFrozenElement(c);let t={x:l,y:u};E.setPointer(t),E.freeze(),Jt?ei(c,t):$r(c,t);return}let p=T.wasActivatedByToggle&&!n;E.setLastGrabbed(c),kn({element:c,cursorX:l,shouldDeactivateAfter:p}),V.clear()},hi=()=>{P()&&(er(),Lt(),E.cancelDrag(),un.stop(),Ae(`userSelect`),Ri())},gi=(e,t,n,r)=>{if(!P())return;let i=Xn(e,t),a=i.x>2||i.y>2,o=a?Zn(e,t):null,s=o?It(o,e,t):[];Lt(),a?E.endDrag():E.cancelDrag(),er(),un.stop(),Ae(`userSelect`),o?li(o,s,n,r):di(e,t,n,r)},$=Fn(),_i=ni({shouldForwardInteraction:()=>M()||A()||P()||xe(),shouldForwardKeyboardEvent:e=>yr(e,C.store.options),shouldForwardViewportEvent:e=>{let t=T.frozenElement??Y();return t&&ri(e,t)?!0:T.frozenElements.some(t=>ri(e,t))}}),vi=jr(),yi=e=>{let t;try{t=vi.originalKeyDescriptor?.get?vi.originalKeyDescriptor.get.call(e):e.key}catch{return!1}let n=t===`Enter`||Rr(e.code),r=M()||A();return n&&r&&!L()&&!V.isPendingDismiss()&&!T.wasActivatedByToggle?g(e,`data-react-grab-input`)?!1:(vi.claimedEvents.add(e),e.preventDefault(),e.stopImmediatePropagation(),!0):!1};$.addDocumentListener(`keydown`,F(yi),{capture:!0}),$.addDocumentListener(`keyup`,F(yi),{capture:!0}),$.addDocumentListener(`keypress`,F(yi),{capture:!0});let bi=()=>{ln.clearHistory(),V.clear()},xi=(e,t=!1)=>{E.setFrozenElement(e),E.freeze(),V.select(e,{shouldPromptBeforeMouseHandoff:t});let n=W(B(e));E.setPointer(n),T.contextMenuPosition!==null&&E.showContextMenu(n,e)},Si=()=>{V.showDismissPrompt()&&We(e=>e+1)},Ci=()=>{V.clear(),E.unfreeze(),bi()},wi=()=>{let e=V.takeSelection(T.frozenElement);if(!e){Ci();return}let t=W(B(e));bi(),E.setLastGrabbed(e),kn({element:e,cursorX:t.x,shouldDeactivateAfter:T.wasActivatedByToggle})},Ti=e=>ue.has(e.key)?e.key:e.key===`Tab`?e.shiftKey?`ArrowLeft`:`ArrowRight`:null,Ei=(e,t={})=>{if(!M()||L()||zt()||V.isPendingDismiss()&&!t.allowPendingKeyboardSelection)return!1;let n=Ti(e);if(!n||ut())return!1;let r=jn(),i=!r;if(!r){let e=_e()?.getBoundingClientRect();r=e?Me(e.left+e.width/2,e.top+e.height/2):Me(window.innerWidth/2,window.innerHeight/2)}if(!r)return!1;let a=n===`ArrowUp`||n===`ArrowDown`,o=ln.findNext(n,r);if(!o&&!a&&!i)return!1;let s=o??r;return e.preventDefault(),e.stopPropagation(),xi(s,!0),!0},Di=e=>e.metaKey||e.ctrlKey||e.altKey||e.repeat||n(e)||!M()||I()||xe()||ut()?null:T.frozenElement||Y(),Oi=e=>{let t=Di(e);if(!t)return null;let n=re(C.store.actions,e);return n?{element:t,action:n}:null},ki=(e,t)=>{let n=B(e);return Ta({element:e,filePath:T.selectionFilePath??void 0,lineNumber:T.selectionLineNumber??void 0,tagName:j(e)||void 0,componentName:an(),position:t,shouldDeferHideContextMenu:!1,performWithFeedbackOptions:{fallbackBounds:n,fallbackSelectionBounds:[n],position:t}})},Ai=e=>{let t=Oi(e);if(!t)return!1;let{element:n,action:r}=t;return L()?Xr(r.id)?(e.preventDefault(),e.stopImmediatePropagation(),!0):!1:ie(r,ki(n,{x:D().x,y:D().y}))?(e.preventDefault(),e.stopImmediatePropagation(),!0):!1},ji=()=>{let e=T.selectionFilePath,t=T.selectionLineNumber;e&&xr(e,t??void 0,C.hooks)},Mi=e=>e.key?.toLowerCase()!==`o`||!M()||!(e.metaKey||e.ctrlKey)||!T.selectionFilePath?!1:(e.preventDefault(),e.stopPropagation(),ji(),!0),Ni=e=>{if(!M()||I()||T.contextMenuPosition!==null)return!1;let t=e.key===`F10`&&e.shiftKey,n=e.key===`ContextMenu`;if(!t&&!n)return!1;let r=T.frozenElements,i=r.length>1,a=(i?r[0]:null)||T.frozenElement||Y();if(!a)return!1;e.preventDefault(),e.stopPropagation();let o=W(B(a));return i?Ke(r):(Ke([a]),E.setFrozenElement(a)),E.setPointer(o),E.freeze(),$r(a,o),!0},Pi=x(()=>X().map(e=>({tagName:j(e.element)||`element`,componentName:gt(e.element)??void 0,depth:e.depth,isLast:e.isLast}))),Fi=x(()=>({items:Pi(),activeIndex:Pn()})),Ii=e=>{if(!(!C.store.options.allowActivationInsideInput&&n(e))&&!(!yr(e,C.store.options)&&((e.metaKey||e.ctrlKey)&&!pe.includes(e.key)&&!Rr(e.code)&&(M()&&!T.wasActivatedByToggle?Z():A()&&(xt(),St(),E.releaseHold())),!Rr(e.code)||!A()))){if((M()||A())&&!L()&&(e.preventDefault(),Rr(e.code)&&e.stopImmediatePropagation()),M()){if(T.wasActivatedByToggle&&C.store.options.activationMode!==`hold`||e.repeat)return;G!==null&&window.clearTimeout(G),G=window.setTimeout(()=>{Z()},200);return}if(A()&&e.repeat){if(K.copyWaiting){let e=K.holdTimerFired;St(),e&&E.activate()}return}if(!(I()||we())&&!A()){let t=C.store.options.keyHoldDuration??100;n(e)?ae(e)?t+=600:t+=400:o()&&(t+=600),St(),E.startHold(t)}}},Li=e=>{if(!V.isPendingDismiss())return!1;if(Rr(e.code))return!0;let t=ue.has(e.key),n=Oi(e)!==null;return!t&&!n?!1:t?Ei(e,{allowPendingKeyboardSelection:!0}):Ai(e)?(bi(),!0):!1};$.addWindowListener(`keydown`,F(e=>{if(Ti(e)&&n(e)||Li(e))return;if(yi(e),!R()){yr(e,C.store.options)&&!e.repeat&&He(e=>e+1);return}let t=Rr(e.code)&&A()&&!L(),r=g(e,Ze);if(L()&&yr(e,C.store.options)&&!e.repeat&&!r){e.preventDefault(),e.stopPropagation(),Hr();return}if(e.key===`Escape`&&I()){Z();return}if(e.key===`Escape`&&ut()){it()!==null&&Aa();return}let i=g(e,`data-react-grab-ignore-events`)&&!t;if(L()||i)return L()&&!r&&Ai(e)||(e.key===`Escape`&&(L()?Hr():T.wasActivatedByToggle&&Z()),i&&ue.has(e.key)&&Ei(e)),void 0;if(P()&&Qn(e)){e.repeat||$n(),e.preventDefault(),e.stopPropagation();return}if(e.key===`Escape`&&(A()||T.wasActivatedByToggle)){Z();return}M()&&!pe.includes(e.key)&&e.preventDefault();let a=Date.now()-Vt<200;Ei(e)||Mi(e)||Ni(e)||Ai(e)||a||Ii(e)}),{capture:!0}),$.addWindowListener(`keyup`,F(e=>{if(yi(e))return;if(Qn(e)&&ye()&&(er(),e.preventDefault(),e.stopPropagation()),e.key===`Shift`&&zt()){P()&&hi(),si();return}if(g(e,`data-react-grab-ignore-events`))return;let t=vr(C.store.options.activationKey),r=t.metaKey||t.ctrlKey?h()?!e.metaKey:!e.ctrlKey:t.shiftKey&&!e.shiftKey||t.altKey&&!e.altKey,i=C.store.options.activationKey?_r(C.store.options.activationKey)(e):pr(e.key,e.code);if(we()||q){(i||r)&&(Wt(),Z());return}if(!A()&&!M()||L())return;let a=!!C.store.options.activationKey,o=C.store.options.activationMode===`hold`,s=P();if(M()){let e=ct();if(r){if(T.wasActivatedByToggle&&C.store.options.activationMode!==`hold`||e)return;Z()}else if(o&&i){if(G!==null&&(window.clearTimeout(G),G=null),e||s)return;Z()}else !a&&i&&G!==null&&(window.clearTimeout(G),G=null);return}if(i||r){if(T.wasActivatedByToggle&&C.store.options.activationMode!==`hold`)return;if(A()||K.holdTimerFired&&r){xt();let t=(K.startTimestamp?Date.now()-K.startTimestamp:0)>=200,r=K.holdTimerFired&&t&&(C.store.options.allowActivationInsideInput||!n(e));St(),r?E.activate():E.releaseHold()}else Z()}}),{capture:!0}),$.addDocumentListener(`copy`,()=>{A()&&(K.copyWaiting=!0)}),$.addWindowListener(`keypress`,F(yi),{capture:!0}),$.addWindowListener(`pointermove`,F(e=>{if(!e.isPrimary)return;let t=e.pointerType===`touch`;if(E.setTouchMode(t),!g(e,`data-react-grab-ignore-events`)&&!yt()&&!(t&&!A()&&!M())){if((t?A():M())&&!L()&&N()&&!e.shiftKey&&!zt()){if(V.consumeMouseHandoff()){Si();return}E.unfreeze(),bi()}ii(e.clientX,e.clientY,e.shiftKey)}}),{passive:!0,capture:!0}),$.addWindowListener(`pointerdown`,F(e=>{if(e.button===0&&e.isPrimary&&(E.setTouchMode(e.pointerType===`touch`),!(!P()&&g(e,`data-react-grab-ignore-events`))&&!ct())){if(L()){let t=Jn();t&&e.clientX>=t.x&&e.clientX<=t.x+t.width&&e.clientY>=t.y&&e.clientY<=t.y+t.height?Vr():Hr();return}if(V.isPendingDismiss()){e.preventDefault(),e.stopImmediatePropagation();return}if(xe()){e.preventDefault(),e.stopImmediatePropagation();return}if(ai(e.clientX,e.clientY,e.shiftKey)){if(e.pointerId!==void 0)try{document.documentElement.setPointerCapture(e.pointerId)}catch{}e.preventDefault(),e.stopImmediatePropagation()}}}),{capture:!0}),$.addWindowListener(`pointerup`,F(e=>{if(e.button!==0||!e.isPrimary||g(e,`data-react-grab-ignore-events`)||ct())return;let t=dn()||xe()||P(),n=e.metaKey||e.ctrlKey;gi(e.clientX,e.clientY,n,e.shiftKey),t&&(e.preventDefault(),e.stopImmediatePropagation())}),{capture:!0}),$.addWindowListener(`contextmenu`,F(e=>{if(!dn()||I()||L())return;let t=g(e,`data-react-grab-ignore-events`),n={x:e.clientX,y:e.clientY},r=t&&T.frozenElements.length>1?ui(n):null,i=V.isPendingDismiss();if(t&&!r&&!i&&!Ln())return;if(ct()){e.preventDefault();return}e.preventDefault(),e.stopPropagation();let a=r??Me(e.clientX,e.clientY);if(!a)return;let o=T.frozenElements;o.length>1&&o.includes(a)?Ke(o):(Ke([a]),E.setFrozenElement(a)),E.setPointer(n),E.freeze(),$r(a,n)}),{capture:!0}),$.addWindowListener(`pointercancel`,F(e=>{e.isPrimary&&hi()}),{capture:!0}),$.addWindowListener(`click`,F(e=>{g(e,`data-react-grab-ignore-events`)||ct()||(dn()||be())&&(e.preventDefault(),e.stopImmediatePropagation(),T.wasActivatedByToggle&&!L()&&!e.shiftKey&&(A()?E.setWasActivatedByToggle(!1):Z()))}),{capture:!0}),$.addDocumentListener(`visibilitychange`,()=>{if(document.hidden){E.clearGrabbedBoxes();let e=T.activationTimestamp;M()&&!L()&&e!==null&&Date.now()-e>500&&Z()}}),$.addWindowListener(`blur`,()=>{hi(),A()&&(xt(),E.releaseHold(),St()),H()}),$.addWindowListener(`focus`,()=>{Vt=Date.now()}),$.addWindowListener(`focusin`,e=>{g(e,f)&&e.stopPropagation()},{capture:!0});let Ri=()=>{if(!(T.isTouchMode&&!A()&&!M())&&!yt()&&!N()&&!P()&&T.frozenElements.length===0){let e=Me(D().x,D().y);E.setDetectedElement(e)}},zi=null,Bi=null,Vi=null,Hi=()=>{rr(),Pe(),Ri(),Mt(e=>e+1),E.incrementViewportVersion(),E.updateContextMenuPosition()},Ui=()=>{rr(),Vi===null&&(Vi=se(()=>{Vi=null,Hi()}))},Wi=()=>{le(),Hi()};$.addWindowListener(`scroll`,Ui,{capture:!0,passive:!0});let Gi=window.innerWidth,Ki=window.innerHeight;$.addWindowListener(`resize`,()=>{let e=window.innerWidth,t=window.innerHeight;if(Gi>0&&Ki>0){let n=e/Gi,r=t/Ki,i=Math.abs(n-r)<Oe,a=Math.abs(n-1)>Oe;i&&a&&E.setPointer({x:D().x*n,y:D().y*r})}Gi=e,Ki=t,Wi()});let qi=window.visualViewport;if(qi){let{signal:e}=$;qi.addEventListener(`resize`,Wi,{signal:e}),qi.addEventListener(`scroll`,Ui,{signal:e})}let Ji=()=>{Bi===null&&(Bi=se(()=>{Bi=null,E.incrementViewportVersion()}))};r(()=>{if(C.store.theme.enabled&&(M()||I()||T.labelInstances.length>0||T.grabbedBoxes.length>0)){if(zi!==null)return;zi=window.setInterval(()=>{E.relinkLiveElements(),Ji()},100);return}zi!==null&&(window.clearInterval(zi),zi=null),Bi!==null&&(Ve(Bi),Bi=null)}),S(()=>{zi!==null&&window.clearInterval(zi),Bi!==null&&Ve(Bi),Vi!==null&&Ve(Vi)}),$.addDocumentListener(`copy`,F(e=>{L()||g(e,`data-react-grab-ignore-events`)||dn()&&e.preventDefault()}),{capture:!0}),S(()=>{let e=[];Q(_i,e),Q(()=>$.abort(),e),Nt(),G&&window.clearTimeout(G),Q(Wt,e),ht&&Q(ht,e),ht=null,fn.forEach(e=>window.clearTimeout(e)),fn.clear(),Q(J.cancelAllFades,e),hn.clear(),Q(un.stop,e),Q(Le,e),Q(()=>Ae(`userSelect`),e),Q(()=>Ae(`touchAction`),e),Q(()=>Pr(null),e),Q(vi.restore,e),Q(()=>me(null),e),Fe(e,`Disposing React Grab failed`)});let{root:Yi,host:Xi,cancelPendingAttachment:Zi}=Xt(vt);S(Zi),S(Nn(Xi).cleanup);let Qi=x(()=>C.store.theme.enabled),$i=x(()=>C.store.theme.selectionBox.enabled),ea=x(()=>C.store.theme.elementLabel.enabled),ta=x(()=>C.store.theme.dragBox.enabled),na=x(()=>we()||Qe()&&!N()),ra=x(()=>fr().length>0),ia=x(()=>!Qi()||!$i()||na()?!1:ra()?!0:Hn()),aa=x(()=>{let e=Vn();if(e)return j(e)||void 0}),oa=x(()=>!Qi()||ct()||!ea()||na()?!1:Hn()),sa=new Map,ca=e=>{let t=e.elements?.filter(w)??[],n=e.element,r=null;t.length>0?r=t.map(B):n&&w(n)&&(r=[B(n)]);let i=e.bounds,a=e.boundsMultiple;r&&(i=r.length>1?or(Sr(r)):r[0],e.boundsMultiple!==void 0&&(a=e.boundsMultiple.length>1&&e.boundsMultiple.length===e.elements?.length?r:[i]));let o=sa.get(e.id),s=o?.boundsMultiple,c=s===a||s!==void 0&&a!==void 0&&s.length===a.length&&s.every((e,t)=>e.x===a[t].x&&e.y===a[t].y&&e.width===a[t].width&&e.height===a[t].height);if(o&&o.status===e.status&&o.errorMessage===e.errorMessage&&o.bounds.x===i.x&&o.bounds.y===i.y&&o.bounds.width===i.width&&o.bounds.height===i.height&&c)return o;let l=i.x+i.width/2,u=i.width/2,d;d=e.mouseXOffsetRatio!==void 0&&u>0?l+e.mouseXOffsetRatio*u:e.mouseXOffsetFromCenter===void 0?e.mouseX??l:l+e.mouseXOffsetFromCenter;let f={...e,bounds:i,boundsMultiple:a,mouseX:d};return sa.set(e.id,f),f},la=x(()=>{if(!Qi()||!C.store.theme.grabbedBoxes.enabled)return[];O();let e=new Set(T.labelInstances.map(e=>e.id));for(let t of sa.keys())e.has(t)||sa.delete(t);return T.labelInstances.map(ca)}),ua=x(()=>new Map(la().map(e=>[e.id,e]))),da=new Map,fa=x(()=>{let e=la(),t=new Set(e.map(e=>e.id));for(let e of da.keys())t.has(e)||da.delete(e);return e.map(e=>{let t=da.get(e.id);if(t)return t;let n=e.id,r={read:()=>ua().get(n)??null};return da.set(n,r),r})}),pa=x(()=>!Qi()||!C.store.theme.grabbedBoxes.enabled?[]:(O(),T.grabbedBoxes.map(e=>w(e.element)?{...e,bounds:B(e.element)}:e))),ma=x(()=>Qi()&&ta()&&dn()&&ve()),ha=x(()=>I()?`processing`:`hover`),ga=x(()=>{if(!Qi())return!1;let e=ea(),t=L(),n=I(),r=dn(),i=P(),a=!!jn(),o=Qe(),s=N();return!e||t||o&&!s?!1:n?!0:r&&!i&&a}),_a=x(()=>{O();let e=T.contextMenuElement;return e?B(e):null}),va=x(()=>(O(),T.contextMenuPosition)),ya=x(()=>{let e=T.contextMenuElement;if(!e)return;let t=T.frozenElements.length;return t>1?`${t} elements`:j(e)||void 0}),[ba]=Zt(()=>T.frozenElements.length>1?null:T.contextMenuElement),[xa]=u(()=>T.contextMenuElement,async e=>e?ft(e):null),Sa=async e=>{E.incrementSelectionInteractionLockDepth();try{return await e()}finally{E.decrementSelectionInteractionLockDepth()}},Ca=(e,t,n,r,i)=>async a=>{await Sa(async()=>{let o=i?.fallbackBounds??null,s=i?.fallbackSelectionBounds??[],c=i?.position??T.contextMenuPosition??D(),l=Wn(),u=_a()??o,d=t.length>1,f=d?or(Sr(l)):u,p=T.wasActivatedByToggle,m;if(m=d?l:u?[u]:s,E.hideContextMenu(),f){let i=d?f.x+f.width/2:c.x,o=J.createInstance(f,n||`element`,r,`copying`,{element:e,mouseX:i,elements:d?t:void 0,boundsMultiple:m}),s=!1,l;try{s=await a(),s||(l=`Failed to copy`)}catch(e){l=In(e,`Action failed`)}J.updateAfterCopy(o,s,l)}else try{await a()}catch(e){z(new oe(`Action failed without feedback bounds`,e))}p?Z():E.unfreeze()})},wa=()=>{setTimeout(()=>{E.hideContextMenu()},0)},Ta=e=>{let{element:t,filePath:n,lineNumber:r,tagName:i,componentName:a,position:o,performWithFeedbackOptions:s,shouldDeferHideContextMenu:c,onBeforeCopy:l,onBeforePrompt:u,customEnterPromptMode:d}=e,f=T.frozenElements.length>0?T.frozenElements:[t],p=c?wa:E.hideContextMenu,m={element:t,elements:f,filePath:n,lineNumber:r,componentName:a,tagName:i,enterPromptMode:d??(()=>{J.clearAll(),Kr(),u?.(),Ct(t,o.x,o.y),E.setPointer({x:o.x,y:o.y}),E.setFrozenElement(t),wt(),M()||Fr(),p()}),copy:()=>{Kr(),l?.(),kn({element:t,cursorX:o.x,selectedElements:f.length>1?f:void 0,shouldDeactivateAfter:T.wasActivatedByToggle}),p()},hooks:{transformHtmlContent:C.hooks.transformHtmlContent,onOpenFile:C.hooks.onOpenFile,transformOpenFileUrl:C.hooks.transformOpenFileUrl},performWithFeedback:Ca(t,f,i,a,s),hideContextMenu:p,cleanup:()=>{T.wasActivatedByToggle?Z():E.unfreeze()}},h=C.hooks.transformActionContext(m);return{...m,...h}},Ea=x(()=>{let e=T.contextMenuElement;if(!e)return;let t=xa(),n=T.contextMenuPosition??D();return Ta({element:e,filePath:t?.filePath,lineNumber:t?.lineNumber??void 0,tagName:ya(),componentName:ba(),position:n,shouldDeferHideContextMenu:!0,onBeforeCopy:()=>{V.clear()},customEnterPromptMode:()=>{J.clearAll(),Kr(),E.clearInputText(),E.enterPromptMode(n,e),wa()}})}),Da=()=>{setTimeout(()=>{E.hideContextMenu(),Z()},0)},Oa=()=>{if(!pt)return null;let e=pt.getBoundingClientRect(),t=Gr(e);return t===`left`||t===`right`?{x:t===`left`?e.right:e.left,y:e.top+e.height/2,edge:t}:{x:e.left+e.width/2,y:t===`top`?e.bottom:e.top,edge:t}},ka=(e,t)=>{let n=null,r=()=>{let i=e();i&&t(i),n=se(r)};return r(),()=>{n!==null&&(Ve(n),n=null)}};r(()=>{if(!Ln())return;let e=ka(Oa,st);S(()=>{e(),st(null)})});let Aa=()=>{ht?.(),ht=null,at(null)},ja=()=>{E.hideContextMenu(),Aa()},Ma=()=>{it()===null?(E.hideContextMenu(),ht?.(),ht=ka(Oa,at)):Aa()},Na=e=>{bt({defaultAction:e}),Qt()&&Jr(e)},Pa=e=>{let t=T.labelInstances.find(t=>t.id===e);if(!t?.element||!w(t.element))return;let n=t.element,r=W(B(n)),i={x:t.mouseX??r.x,y:r.y},a=t.elements&&t.elements.length>0?t.elements.filter(e=>w(e)):[n];setTimeout(()=>{Aa(),M()||(E.setWasActivatedByToggle(!0),Fr()),E.setPointer(i),E.setFrozenElements(a),a.length>1&&t.bounds&&E.setFrozenDragRect(ar(t.bounds)),E.freeze(),E.showContextMenu(i,n)},0)};r(()=>{let e=C.store.theme.hue;e===0?Yi.style.filter=``:Yi.style.filter=`hue-rotate(${e}deg)`}),C.store.theme.enabled&&import(`./renderer-9XnixT6M.js`).then(({ReactGrabRenderer:e})=>{t||(l=i(()=>c(e,{get selectionVisible(){return ia()},get selectionBounds(){return Jn()},get selectionBoundsMultiple(){return mr()},get selectionShouldSnap(){return T.frozenElements.length>0||fr().length>0},get selectionElementsCount(){return T.frozenElements.length},get frozenLabelEntryAccessors(){return gr()},get pendingShiftPreviewEntry(){return br()??void 0},get selectionFilePath(){return T.selectionFilePath??void 0},get selectionTagName(){return aa()},get selectionComponentName(){return an()},get selectionLabelVisible(){return oa()},selectionLabelStatus:`idle`,get hierarchyState(){return Fi()},get hierarchyMenuPosition(){return ot()},get labelInstances(){return la()},get labelInstanceAccessors(){return fa()},get dragVisible(){return ma()},get dragBounds(){return cr()},get grabbedBoxes(){return pa()},get mouseX(){return ee(()=>T.frozenElements.length>1)()?void 0:wr()??Cr().x},get isFrozen(){return N()||M()||Qe()},get inputValue(){return T.inputText},get isPromptMode(){return L()},onShowContextMenuInstance:Pa,onRetryInstance:wn,onAcknowledgeErrorInstance:Tn,get onLabelInstanceHoverChange(){return J.handleHoverChange},get onInputChange(){return E.setInputText},onInputSubmit:()=>void Vr(),get selectionLabelShakeCount(){return Ue()},onConfirmDismiss:Ur,onOpenSelectionFile:ji,get discardPrompt(){return ee(()=>!!V.isPendingDismiss())()?{isKeyboardSelection:!0,onConfirm:Ur,onCopy:wi}:Ee()?{onConfirm:Ur,onCancel:Wr}:void 0},get toolbarVisible(){return C.store.theme.toolbar.enabled},get isActive(){return M()},onActivateAction:Zr,get activeActionId(){return sn()},get enabled(){return R()},get shakeCount(){return Re()},onToolbarStateChange:e=>{qe(e),e.enabled!==R()&&(Ie(e.enabled),e.enabled||(Ir(),ja())),Yr(_,e)},onSubscribeToToolbarStateChanges:e=>(_.add(e),()=>{_.delete(e)}),onToolbarSelectHoverChange:tt,onToolbarRef:e=>{pt=e},get contextMenuPosition(){return va()},get contextMenuBounds(){return _a()},get contextMenuTagName(){return ya()},get contextMenuComponentName(){return ba()},get contextMenuHasFilePath(){return!!xa()?.filePath},get actions(){return C.store.actions},get actionContext(){return Ea()},onContextMenuDismiss:Da,onContextMenuHide:wa,get toolbarMenuPosition(){return it()},get toolbarMenuActions(){return C.store.actions.filter(e=>e.showInToolbarMenu===!0)},get defaultActionId(){return Ge()?.defaultAction??`copy`},onSetDefaultAction:Na,onToggleToolbarMenu:Ma,onToolbarMenuDismiss:Aa}),Yi))}).catch(e=>{console.warn(`[react-grab] Failed to load renderer:`,e)});let Fa={activate:()=>{E.setPendingCommentMode(!1),!M()&&R()&&Lr()},deactivate:()=>{M()||I()?Z():bn()},toggle:()=>{M()||I()?Z():R()&&Lr()},comment:ti,isActive:()=>M(),isEnabled:()=>R(),setEnabled:e=>{e!==R()&&(Ie(e),bt({enabled:e,collapsed:!e}),e||(Ir(),ja()))},getToolbarState:()=>Ge()??m(),setToolbarState:e=>{let t=Ge()??m(),n=e.collapsed??t?.collapsed??!1,r=e.defaultAction??t?.defaultAction??`copy`,i={edge:e.edge??t?.edge??`bottom`,ratio:e.ratio??t?.ratio??.5,collapsed:n,enabled:e.enabled??!n,defaultAction:dr(r)};ne(i),qe(i),i.enabled!==R()&&(Ie(i.enabled),i.enabled||(Ir(),ja())),Yr(_,i)},onToolbarStateChange:e=>(_.add(e),()=>{_.delete(e)}),reset:()=>{Ir(),ja(),E.clearGrabbedBoxes(),J.clearAll(),E.setSelectionSource(null,null)},dispose:()=>{if(t)return;let n=[];t=!0,mi=!1,Q(bn,n),Q(J.clearAll,n),l&&Q(l,n),l=void 0,ht&&Q(ht,n),ht=null,_.clear(),Q(e,n),Q(()=>ci(Fa),n),Fe(n,`Disposing React Grab failed`)},copyElement:async e=>{let t=Array.isArray(e)?e:[e];return t.length===0?!1:(await En(t,vn())).status===`succeeded`},getSource:async e=>{let t=await ft(e);return t?{filePath:t.filePath,lineNumber:t.lineNumber,columnNumber:t.columnNumber??null,componentName:t.componentName}:null},getStackContext:e=>mt(e,{maxLines:C.store.options.maxContextLines}),getState:()=>({isActive:M(),isDragging:P(),isCopying:I(),isPromptMode:L(),isSelectionBoxVisible:!!ia(),isDragBoxVisible:!!ma(),targetElement:Y(),dragBounds:cr()??null,grabbedBoxes:[...Tr()],labelInstances:[...Dr()],selectionFilePath:T.selectionFilePath,toolbarState:Ge()}),setOptions:e=>{C.setOptions(e)},registerPlugin:e=>{C.register(e,Fa)},unregisterPlugin:e=>{C.unregister(e)},getPlugins:()=>C.getPluginNames(),getDisplayName:gt};for(let e of fi)C.register(e,Fa);return queueMicrotask(()=>{if(t)return;let e=Ge();if(!e)return;let n=dr(e.defaultAction??`copy`);n!==e.defaultAction&&bt({defaultAction:n})}),setTimeout(()=>{lt(!0)},Je),Fa})};export{si as a,Hr as c,li as i,Cr as l,di as n,ui as o,oi as r,Ur as s,hi as t};
|
package/dist/{execute-context-menu-action-Cjt3m1zR.js → execute-context-menu-action-BaXLXj6l.js}
RENAMED
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
import{H as e,Mt as t,N as n,Tt as r,U as i,W as a,at as o,hn as s,l as c}from"./freeze-updates-CoA5HhEe.js";const l={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return u(this.context.count)},getNextContextId(){return u(this.context.count++)}};function u(e){let t=String(e),n=t.length-1;return l.context.id+(n?String.fromCharCode(96+n):``)+t}function d(e){l.context=e}const f=(e,t)=>e===t,p=Symbol(`solid-proxy`),m=typeof Proxy==`function`,h=Symbol(`solid-track`),g={equals:f};let _=ge;const v={owned:null,cleanups:null,context:null,owner:null},y={};var b=null;let x=null,S=null,C=null,w=null,T=0;function E(e,t){let n=S,r=b,i=e.length===0,a=t===void 0?r:t,o=i?v:{owned:null,cleanups:null,context:a?a.context:null,owner:a},s=i?e:()=>e(()=>N(()=>V(o)));b=o,S=null;try{return z(s,!0)}finally{S=n,b=r}}function D(e,t){t=t?Object.assign({},g,t):g;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0};return[fe.bind(n),e=>(typeof e==`function`&&(e=x&&x.running&&x.sources.has(n)?e(n.tValue):e(n.value)),pe(n,e))]}function ee(e,t,n){I(L(e,t,!0,1))}function O(e,t,n){I(L(e,t,!1,1))}function k(e,t,n){_=_e;let r=L(e,t,!1,1),i=F&&ue(F);i&&(r.suspense=i),(!n||!n.render)&&(r.user=!0),w?w.push(r):I(r)}function A(e,t,n){n=n?Object.assign({},g,n):g;let r=L(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,I(r),fe.bind(r)}function te(e){return e&&typeof e==`object`&&`then`in e}function j(e,t,n){let r,i,a;typeof t==`function`?(r=e,i=t,a=n||{}):(r=!0,i=e,a=t||{});let o=null,s=y,c=null,u=!1,d=!1,f=`initialValue`in a,p=typeof r==`function`&&A(r),m=new Set,[h,g]=(a.storage||D)(a.initialValue),[_,v]=D(void 0),[C,w]=D(void 0,{equals:!1}),[T,E]=D(f?`ready`:`unresolved`);l.context&&(c=l.getNextContextId(),a.ssrLoadFrom===`initial`?s=a.initialValue:l.load&&l.has(c)&&(s=l.load(c)));function O(e,t,n,r){return o===e&&(o=null,r!==void 0&&(f=!0),(e===s||t===s)&&a.onHydrated&&queueMicrotask(()=>a.onHydrated(r,{value:t})),s=y,x&&e&&u?(x.promises.delete(e),u=!1,z(()=>{x.running=!0,k(t,n)},!1)):k(t,n)),t}function k(e,t){z(()=>{t===void 0&&g(()=>e),E(t===void 0?f?`ready`:`unresolved`:`errored`),v(t);for(let e of m.keys())e.decrement();m.clear()},!1)}function j(){let e=F&&ue(F),t=h(),n=_();if(n!==void 0&&!o)throw n;return S&&!S.user&&e&&ee(()=>{C(),o&&(e.resolved&&x&&u?x.promises.add(o):m.has(e)||(e.increment(),m.add(e)))}),t}function M(e=!0){if(e!==!1&&d)return;d=!1;let t=p?p():r;if(u=x&&x.running,t==null||t===!1){O(o,N(h));return}x&&o&&x.promises.delete(o);let n,a=s===y?N(()=>{try{return i(t,{value:h(),refetching:e})}catch(e){n=e}}):s;if(n!==void 0){O(o,void 0,H(n),t);return}else if(!te(a))return O(o,a,void 0,t),a;return o=a,`v`in a?(a.s===1?O(o,a.v,void 0,t):O(o,void 0,H(a.v),t),a):(d=!0,queueMicrotask(()=>d=!1),z(()=>{E(f?`refreshing`:`pending`),w()},!1),a.then(e=>O(a,e,void 0,t),e=>O(a,void 0,H(e),t)))}Object.defineProperties(j,{state:{get:()=>T()},error:{get:()=>_()},loading:{get(){let e=T();return e===`pending`||e===`refreshing`}},latest:{get(){if(!f)return j();let e=_();if(e&&!o)throw e;return h()}}});let ne=b;return p?ee(()=>(ne=b,M(!1))):M(!1),[j,{refetch:e=>oe(ne,()=>M(e)),mutate:g}]}function M(e){return z(e,!1)}function N(e){if(S===null)return e();let t=S;S=null;try{return e()}finally{S=t}}function ne(e,t,n){let r=Array.isArray(e),i,a=n&&n.defer;return n=>{let o;if(r){o=Array(e.length);for(let t=0;t<e.length;t++)o[t]=e[t]()}else o=e();if(a)return a=!1,n;let s=N(()=>t(o,i,n));return i=o,s}}function re(e){k(()=>N(e))}function P(e){return b===null||(b.cleanups===null?b.cleanups=[e]:b.cleanups.push(e)),e}function ie(){return S}function ae(){return b}function oe(e,t){let n=b,r=S;b=e,S=null;try{return z(t,!0)}catch(e){U(e)}finally{b=n,S=r}}const[se,ce]=D(!1);function le(e,t){let n=Symbol(`context`);return{id:n,Provider:xe(n),defaultValue:e}}function ue(e){let t;return b&&b.context&&(t=b.context[e.id])!==void 0?t:e.defaultValue}function de(e){let t=A(e),n=A(()=>be(t()));return n.toArray=()=>{let e=n();return Array.isArray(e)?e:e==null?[]:[e]},n}let F;function fe(){let e=x&&x.running;if(this.sources&&(e?this.tState:this.state))if((e?this.tState:this.state)===1)I(this);else{let e=C;C=null,z(()=>B(this),!1),C=e}if(S){let e=this.observers?this.observers.length:0;S.sources?(S.sources.push(this),S.sourceSlots.push(e)):(S.sources=[this],S.sourceSlots=[e]),this.observers?(this.observers.push(S),this.observerSlots.push(S.sources.length-1)):(this.observers=[S],this.observerSlots=[S.sources.length-1])}return e&&x.sources.has(this)?this.tValue:this.value}function pe(e,t,n){let r=x&&x.running&&x.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(x){let r=x.running;(r||!n&&x.sources.has(e))&&(x.sources.add(e),e.tValue=t),r||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&z(()=>{for(let t=0;t<e.observers.length;t+=1){let n=e.observers[t],r=x&&x.running;r&&x.disposed.has(n)||((r?!n.tState:!n.state)&&(n.pure?C.push(n):w.push(n),n.observers&&ve(n)),r?n.tState=1:n.state=1)}if(C.length>1e6)throw C=[],Error()},!1)}return t}function I(e){if(!e.fn)return;V(e);let t=T;me(e,x&&x.running&&x.sources.has(e)?e.tValue:e.value,t),x&&!x.running&&x.sources.has(e)&&queueMicrotask(()=>{z(()=>{x&&(x.running=!0),S=b=e,me(e,e.tValue,t),S=b=null},!1)})}function me(e,t,n){let r,i=b,a=S;S=b=e;try{r=e.fn(t)}catch(t){return e.pure&&(x&&x.running?(e.tState=1,e.tOwned&&e.tOwned.forEach(V),e.tOwned=void 0):(e.state=1,e.owned&&e.owned.forEach(V),e.owned=null)),e.updatedAt=n+1,U(t)}finally{S=a,b=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&`observers`in e?pe(e,r,!0):x&&x.running&&e.pure?(x.sources.has(e)||(e.value=r),x.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function L(e,t,n,r=1,i){let a={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:b,context:b?b.context:null,pure:n};return x&&x.running&&(a.state=0,a.tState=r),b===null||b!==v&&(x&&x.running&&b.pure?b.tOwned?b.tOwned.push(a):b.tOwned=[a]:b.owned?b.owned.push(a):b.owned=[a]),a}function R(e){let t=x&&x.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===2)return B(e);if(e.suspense&&N(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<T);){if(t&&x.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let t=e,i=n[r+1];for(;(t=t.owner)&&t!==i;)if(x.disposed.has(t))return}if((t?e.tState:e.state)===1)I(e);else if((t?e.tState:e.state)===2){let t=C;C=null,z(()=>B(e,n[0]),!1),C=t}}}function z(e,t){if(C)return e();let n=!1;t||(C=[]),w?n=!0:w=[],T++;try{let t=e();return he(n),t}catch(e){n||(w=null),C=null,U(e)}}function he(e){if(C&&=(ge(C),null),e)return;let t;if(x){if(!x.promises.size&&!x.queue.size){let e=x.sources,n=x.disposed;w.push.apply(w,x.effects),t=x.resolve;for(let e of w)`tState`in e&&(e.state=e.tState),delete e.tState;x=null,z(()=>{for(let e of n)V(e);for(let t of e){if(t.value=t.tValue,t.owned)for(let e=0,n=t.owned.length;e<n;e++)V(t.owned[e]);t.tOwned&&(t.owned=t.tOwned),delete t.tValue,delete t.tOwned,t.tState=0}ce(!1)},!1)}else if(x.running){x.running=!1,x.effects.push.apply(x.effects,w),w=null,ce(!0);return}}let n=w;w=null,n.length&&z(()=>_(n),!1),t&&t()}function ge(e){for(let t=0;t<e.length;t++)R(e[t])}function _e(e){let t,n=0;for(t=0;t<e.length;t++){let r=e[t];r.user?e[n++]=r:R(r)}if(l.context){if(l.count){l.effects||=[],l.effects.push(...e.slice(0,n));return}d()}for(l.effects&&(l.done||!l.count)&&(e=[...l.effects,...e],n+=l.effects.length,delete l.effects),t=0;t<n;t++)R(e[t])}function B(e,t){let n=x&&x.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){let i=e.sources[r];if(i.sources){let e=n?i.tState:i.state;e===1?i!==t&&(!i.updatedAt||i.updatedAt<T)&&R(i):e===2&&B(i,t)}}}function ve(e){let t=x&&x.running;for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=2:r.state=2,r.pure?C.push(r):w.push(r),r.observers&&ve(r))}}function V(e){let t;if(e.sources)for(;e.sources.length;){let t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){let e=r.pop(),i=t.observerSlots.pop();n<r.length&&(e.sourceSlots[i]=n,r[n]=e,t.observerSlots[n]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)V(e.tOwned[t]);delete e.tOwned}if(x&&x.running&&e.pure)ye(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)V(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}x&&x.running?e.tState=0:e.state=0}function ye(e,t){if(t||(e.tState=0,x.disposed.add(e)),e.owned)for(let t=0;t<e.owned.length;t++)ye(e.owned[t])}function H(e){return e instanceof Error?e:Error(typeof e==`string`?e:`Unknown error`,{cause:e})}function U(e,t=b){throw H(e)}function be(e){if(typeof e==`function`&&!e.length)return be(e());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++){let r=be(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function xe(e,t){return function(t){let n;return O(()=>n=N(()=>(b.context={...b.context,[e]:t.value},de(()=>t.children))),void 0),n}}const Se=Symbol(`fallback`);function Ce(e){for(let t=0;t<e.length;t++)e[t]()}function we(e,t,n={}){let r=[],i=[],a=[],o=0,s=t.length>1?[]:null;return P(()=>Ce(a)),()=>{let c=e()||[],l=c.length,u,d;return c[h],N(()=>{let e,t,p,m,h,g,_,v,y;if(l===0)o!==0&&(Ce(a),a=[],r=[],i=[],o=0,s&&=[]),n.fallback&&(r=[Se],i[0]=E(e=>(a[0]=e,n.fallback())),o=1);else if(o===0){for(i=Array(l),d=0;d<l;d++)r[d]=c[d],i[d]=E(f);o=l}else{for(p=Array(l),m=Array(l),s&&(h=Array(l)),g=0,_=Math.min(o,l);g<_&&r[g]===c[g];g++);for(_=o-1,v=l-1;_>=g&&v>=g&&r[_]===c[v];_--,v--)p[v]=i[_],m[v]=a[_],s&&(h[v]=s[_]);for(e=new Map,t=Array(v+1),d=v;d>=g;d--)y=c[d],u=e.get(y),t[d]=u===void 0?-1:u,e.set(y,d);for(u=g;u<=_;u++)y=r[u],d=e.get(y),d!==void 0&&d!==-1?(p[d]=i[u],m[d]=a[u],s&&(h[d]=s[u]),d=t[d],e.set(y,d)):a[u]();for(d=g;d<l;d++)d in p?(i[d]=p[d],a[d]=m[d],s&&(s[d]=h[d],s[d](d))):i[d]=E(f);i=i.slice(0,o=l),r=c.slice(0)}return i});function f(e){if(a[d]=e,s){let[e,n]=D(d);return s[d]=n,t(c[d],e)}return t(c[d])}}}function Te(e,t){return N(()=>e(t||{}))}function W(){return!0}const Ee={get(e,t,n){return t===p?n:e.get(t)},has(e,t){return t===p?!0:e.has(t)},set:W,deleteProperty:W,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:W,deleteProperty:W}},ownKeys(e){return e.keys()}};function De(e){return(e=typeof e==`function`?e():e)?e:{}}function Oe(){for(let e=0,t=this.length;e<t;++e){let t=this[e]();if(t!==void 0)return t}}function ke(...e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];t||=!!r&&p in r,e[n]=typeof r==`function`?(t=!0,A(r)):r}if(m&&t)return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){let r=De(e[n])[t];if(r!==void 0)return r}},has(t){for(let n=e.length-1;n>=0;n--)if(t in De(e[n]))return!0;return!1},keys(){let t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(De(e[n])));return[...new Set(t)]}},Ee);let n={},r=Object.create(null);for(let t=e.length-1;t>=0;t--){let i=e[t];if(!i)continue;let a=Object.getOwnPropertyNames(i);for(let e=a.length-1;e>=0;e--){let t=a[e];if(t===`__proto__`||t===`constructor`)continue;let o=Object.getOwnPropertyDescriptor(i,t);if(!r[t])r[t]=o.get?{enumerable:!0,configurable:!0,get:Oe.bind(n[t]=[o.get.bind(i)])}:o.value===void 0?void 0:o;else{let e=n[t];e&&(o.get?e.push(o.get.bind(i)):o.value!==void 0&&e.push(()=>o.value))}}}let i={},a=Object.keys(r);for(let e=a.length-1;e>=0;e--){let t=a[e],n=r[t];n&&n.get?Object.defineProperty(i,t,n):i[t]=n?n.value:void 0}return i}function Ae(e,...t){let n=t.length;if(m&&p in e){let r=n>1?t.flat():t[0],i=t.map(t=>new Proxy({get(n){return t.includes(n)?e[n]:void 0},has(n){return t.includes(n)&&n in e},keys(){return t.filter(t=>t in e)}},Ee));return i.push(new Proxy({get(t){return r.includes(t)?void 0:e[t]},has(t){return r.includes(t)?!1:t in e},keys(){return Object.keys(e).filter(e=>!r.includes(e))}},Ee)),i}let r=[];for(let e=0;e<=n;e++)r[e]={};for(let i of Object.getOwnPropertyNames(e)){let a=n;for(let e=0;e<t.length;e++)if(t[e].includes(i)){a=e;break}let o=Object.getOwnPropertyDescriptor(e,i);!o.get&&!o.set&&o.enumerable&&o.writable&&o.configurable?r[a][i]=o.value:Object.defineProperty(r[a],i,o)}return r}const je=e=>`Stale read from <${e}>.`;function Me(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return A(we(()=>e.each,e.children,t||void 0))}function Ne(e){let t=e.keyed,n=A(()=>e.when,void 0,void 0),r=t?n:A(n,void 0,{equals:(e,t)=>!e==!t});return A(()=>{let i=r();if(i){let a=e.children;return typeof a==`function`&&a.length>0?N(()=>a(t?i:()=>{if(!N(r))throw je(`Show`);return n()})):a}return e.fallback},void 0,void 0)}const Pe=new Set([`className`,`value`,`readOnly`,`noValidate`,`formNoValidate`,`isMap`,`noModule`,`playsInline`,`adAuctionHeaders`,`allowFullscreen`,`browsingTopics`,`defaultChecked`,`defaultMuted`,`defaultSelected`,`disablePictureInPicture`,`disableRemotePlayback`,`preservesPitch`,`shadowRootClonable`,`shadowRootCustomElementRegistry`,`shadowRootDelegatesFocus`,`shadowRootSerializable`,`sharedStorageWritable`,...`allowfullscreen.async.alpha.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.hidden.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.adauctionheaders.browsingtopics.credentialless.defaultchecked.defaultmuted.defaultselected.defer.disablepictureinpicture.disableremoteplayback.preservespitch.shadowrootclonable.shadowrootcustomelementregistry.shadowrootdelegatesfocus.shadowrootserializable.sharedstoragewritable`.split(`.`)]),Fe=new Set([`innerHTML`,`textContent`,`innerText`,`children`]),Ie=Object.assign(Object.create(null),{className:`class`,htmlFor:`for`}),Le=Object.assign(Object.create(null),{class:`className`,novalidate:{$:`noValidate`,FORM:1},formnovalidate:{$:`formNoValidate`,BUTTON:1,INPUT:1},ismap:{$:`isMap`,IMG:1},nomodule:{$:`noModule`,SCRIPT:1},playsinline:{$:`playsInline`,VIDEO:1},readonly:{$:`readOnly`,INPUT:1,TEXTAREA:1},adauctionheaders:{$:`adAuctionHeaders`,IFRAME:1},allowfullscreen:{$:`allowFullscreen`,IFRAME:1},browsingtopics:{$:`browsingTopics`,IMG:1},defaultchecked:{$:`defaultChecked`,INPUT:1},defaultmuted:{$:`defaultMuted`,AUDIO:1,VIDEO:1},defaultselected:{$:`defaultSelected`,OPTION:1},disablepictureinpicture:{$:`disablePictureInPicture`,VIDEO:1},disableremoteplayback:{$:`disableRemotePlayback`,AUDIO:1,VIDEO:1},preservespitch:{$:`preservesPitch`,AUDIO:1,VIDEO:1},shadowrootclonable:{$:`shadowRootClonable`,TEMPLATE:1},shadowrootdelegatesfocus:{$:`shadowRootDelegatesFocus`,TEMPLATE:1},shadowrootserializable:{$:`shadowRootSerializable`,TEMPLATE:1},sharedstoragewritable:{$:`sharedStorageWritable`,IFRAME:1,IMG:1}});function Re(e,t){let n=Le[e];return typeof n==`object`?n[t]?n.$:void 0:n}const ze=new Set([`beforeinput`,`click`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`]),Be={xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`},Ve=e=>A(()=>e());function He(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,c=t[i-1].nextSibling,l=null;for(;o<i||s<a;){if(t[o]===n[s]){o++,s++;continue}for(;t[i-1]===n[a-1];)i--,a--;if(i===o){let t=a<r?s?n[s-1].nextSibling:n[a-s]:c;for(;s<a;)e.insertBefore(n[s++],t)}else if(a===s)for(;o<i;)(!l||!l.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){let r=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],r),t[i]=n[a]}else{if(!l){l=new Map;let e=s;for(;e<a;)l.set(n[e],e++)}let r=l.get(t[o]);if(r!=null)if(s<r&&r<a){let c=o,u=1,d;for(;++c<i&&c<a&&!((d=l.get(t[c]))==null||d!==r+u);)u++;if(u>r-s){let i=t[o];for(;s<r;)e.insertBefore(n[s++],i)}else e.replaceChild(n[s++],t[o++])}else o++;else t[o++].remove()}}}const Ue=`_$DX_DELEGATE`;function We(e,t,n,r={}){let i;return E(r=>{i=r,t===document?e():K(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=``}}function Ge(e,t,n,r){let i,a=()=>{let t=r?document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`template`):document.createElement(`template`);return t.innerHTML=e,n?t.content.firstChild.firstChild:r?t.firstChild:t.content.firstChild},o=t?()=>N(()=>document.importNode(i||=a(),!0)):()=>(i||=a()).cloneNode(!0);return o.cloneNode=o,o}function Ke(e,t=window.document){let n=t[Ue]||(t[Ue]=new Set);for(let r=0,i=e.length;r<i;r++){let i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,ot))}}function G(e,t,n){q(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function qe(e,t,n,r){q(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function Je(e,t,n){q(e)||(n?e.setAttribute(t,``):e.removeAttribute(t))}function Ye(e,t){q(e)||(t==null?e.removeAttribute(`class`):e.className=t)}function Xe(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){let r=n[0];e.addEventListener(t,n[0]=t=>r.call(e,n[1],t))}else e.addEventListener(t,n,typeof n!=`function`&&n)}function Ze(e,t,n={}){let r=Object.keys(t||{}),i=Object.keys(n),a,o;for(a=0,o=i.length;a<o;a++){let r=i[a];!r||r===`undefined`||t[r]||(it(e,r,!1),delete n[r])}for(a=0,o=r.length;a<o;a++){let i=r[a],o=!!t[i];!i||i===`undefined`||n[i]===o||!o||(it(e,i,!0),n[i]=o)}return n}function Qe(e,t,n){if(!t)return n?G(e,`style`):t;let r=e.style;if(typeof t==`string`)return r.cssText=t;typeof n==`string`&&(r.cssText=n=void 0),n||={},t||={};let i,a;for(a in n)t[a]??r.removeProperty(a),delete n[a];for(a in t)i=t[a],i!==n[a]&&(r.setProperty(a,i),n[a]=i);return n}function $e(e,t,n){n==null?e.style.removeProperty(t):e.style.setProperty(t,n)}function et(e,t={},n,r){let i={};return r||O(()=>i.children=J(e,t.children,i.children)),O(()=>typeof t.ref==`function`&&tt(t.ref,e)),O(()=>nt(e,t,n,!0,i,!0)),i}function tt(e,t,n){return N(()=>e(t,n))}function K(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!=`function`)return J(e,t,r,n);O(r=>J(e,t(),r,n),r)}function nt(e,t,n,r,i={},a=!1){t||={};for(let r in i)if(!(r in t)){if(r===`children`)continue;i[r]=at(e,r,null,i[r],n,a,t)}for(let o in t){if(o===`children`){r||J(e,t.children);continue}let s=t[o];i[o]=at(e,o,s,i[o],n,a,t)}}function q(e){return!!l.context&&!l.done&&(!e||e.isConnected)}function rt(e){return e.toLowerCase().replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function it(e,t,n){let r=t.trim().split(/\s+/);for(let t=0,i=r.length;t<i;t++)e.classList.toggle(r[t],n)}function at(e,t,n,r,i,a,o){let s,c,l,u,d;if(t===`style`)return Qe(e,n,r);if(t===`classList`)return Ze(e,n,r);if(n===r)return r;if(t===`ref`)a||n(e);else if(t.slice(0,3)===`on:`){let i=t.slice(3);r&&e.removeEventListener(i,r,typeof r!=`function`&&r),n&&e.addEventListener(i,n,typeof n!=`function`&&n)}else if(t.slice(0,10)===`oncapture:`){let i=t.slice(10);r&&e.removeEventListener(i,r,!0),n&&e.addEventListener(i,n,!0)}else if(t.slice(0,2)===`on`){let i=t.slice(2).toLowerCase(),a=ze.has(i);if(!a&&r){let t=Array.isArray(r)?r[0]:r;e.removeEventListener(i,t)}(a||n)&&(Xe(e,i,n,a),a&&Ke([i]))}else if(t.slice(0,5)===`attr:`)G(e,t.slice(5),n);else if(t.slice(0,5)===`bool:`)Je(e,t.slice(5),n);else if((d=t.slice(0,5)===`prop:`)||(l=Fe.has(t))||!i&&((u=Re(t,e.tagName))||(c=Pe.has(t)))||(s=e.nodeName.includes(`-`)||`is`in o)){if(d)t=t.slice(5),c=!0;else if(q(e))return n;t===`class`||t===`className`?Ye(e,n):s&&!c&&!l?e[rt(t)]=n:e[u||t]=n}else{let r=i&&t.indexOf(`:`)>-1&&Be[t.split(`:`)[0]];r?qe(e,r,t,n):G(e,Ie[t]||t,n)}return n}function ot(e){if(l.registry&&l.events&&l.events.find(([t,n])=>n===e))return;let t=e.target,n=`$$${e.type}`,r=e.target,i=e.currentTarget,a=t=>Object.defineProperty(e,`target`,{configurable:!0,value:t}),o=()=>{let r=t[n];if(r&&!t.disabled){let i=t[`${n}Data`];if(i===void 0?r.call(t,e):r.call(t,i,e),e.cancelBubble)return}return t.host&&typeof t.host!=`string`&&!t.host._$host&&t.contains(e.target)&&a(t.host),!0},s=()=>{for(;o()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,`currentTarget`,{configurable:!0,get(){return t||document}}),l.registry&&!l.done&&(l.done=_$HY.done=!0),e.composedPath){let n=e.composedPath();a(n[0]);for(let e=0;e<n.length-2&&(t=n[e],o());e++){if(t._$host){t=t._$host,s();break}if(t.parentNode===i)break}}else s();a(r)}function J(e,t,n,r,i){let a=q(e);if(a){!n&&(n=[...e.childNodes]);let t=[];for(let e=0;e<n.length;e++){let r=n[e];r.nodeType===8&&r.data.slice(0,2)===`!$`?r.remove():t.push(r)}n=t}for(;typeof n==`function`;)n=n();if(t===n)return n;let o=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o===`string`||o===`number`){if(a||o===`number`&&(t=t.toString(),t===n))return n;if(s){let i=n[0];i&&i.nodeType===3?i.data!==t&&(i.data=t):i=document.createTextNode(t),n=Y(e,n,r,i)}else n=n!==``&&typeof n==`string`?e.firstChild.data=t:e.textContent=t}else if(t==null||o===`boolean`){if(a)return n;n=Y(e,n,r)}else if(o===`function`)return O(()=>{let i=t();for(;typeof i==`function`;)i=i();n=J(e,i,n,r)}),()=>n;else if(Array.isArray(t)){let o=[],c=n&&Array.isArray(n);if(st(o,t,n,i))return O(()=>n=J(e,o,n,r,!0)),()=>n;if(a){if(!o.length)return n;if(r===void 0)return n=[...e.childNodes];let t=o[0];if(t.parentNode!==e)return n;let i=[t];for(;(t=t.nextSibling)!==r;)i.push(t);return n=i}if(o.length===0){if(n=Y(e,n,r),s)return n}else c?n.length===0?ct(e,o,r):He(e,n,o):(n&&Y(e),ct(e,o));n=o}else if(t.nodeType){if(a&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=Y(e,n,r,t);Y(e,n,null,t)}else n==null||n===``||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}return n}function st(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let o=t[a],s=n&&n[e.length],c;if(!(o==null||o===!0||o===!1))if((c=typeof o)==`object`&&o.nodeType)e.push(o);else if(Array.isArray(o))i=st(e,o,s)||i;else if(c===`function`)if(r){for(;typeof o==`function`;)o=o();i=st(e,Array.isArray(o)?o:[o],Array.isArray(s)?s:[s])||i}else e.push(o),i=!0;else{let t=String(o);s&&s.nodeType===3&&s.data===t?e.push(s):e.push(document.createTextNode(t))}}return i}function ct(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function Y(e,t,n,r){if(n===void 0)return e.textContent=``;let i=r||document.createTextNode(``);if(t.length){let r=!1;for(let a=t.length-1;a>=0;a--){let o=t[a];if(i!==o){let t=o.parentNode===e;!r&&!a?t?e.replaceChild(i,o):e.insertBefore(i,n):t&&o.remove()}else r=!0}}else e.insertBefore(i,n);return[i]}function lt(e,t=!1,n=void 0){return t?document.createElementNS(`http://www.w3.org/2000/svg`,e):document.createElement(e,{is:n})}function ut(e){let{useShadow:t}=e,n=document.createTextNode(``),r=()=>e.mount||document.body,i=ae(),a,o=!!l.context;return k(()=>{o&&(ae().user=o=!1),a||=oe(i,()=>A(()=>e.children));let s=r();if(s instanceof HTMLHeadElement){let[e,t]=D(!1);E(t=>K(s,()=>e()?t():a(),null)),P(()=>t(!0))}else{let r=lt(e.isSVG?`g`:`div`,e.isSVG),i=t&&r.attachShadow?r.attachShadow({mode:`open`}):r;Object.defineProperty(r,`_$host`,{get(){return n.parentNode},configurable:!0}),K(i,a),s.appendChild(r),e.ref&&e.ref(r),P(()=>s.removeChild(r))}},void 0,{render:!o}),n}const dt=e=>{if(!e)return!1;let t=o(e);return t?t.isConnected():!!(e.isConnected||e.ownerDocument?.contains(e))},ft=[`input`,`textarea`,`select`,`searchbox`,`slider`,`spinbutton`,`menuitem`,`menuitemcheckbox`,`menuitemradio`,`option`,`radio`,`textbox`,`combobox`],pt=e=>{if(e.composed){let t=e.composedPath()[0];if(t instanceof HTMLElement)return t}else if(e.target instanceof HTMLElement)return e.target},mt=t=>{if(document.designMode===`on`)return!0;let n=pt(t);if(!n)return!1;if(n.isContentEditable)return!0;let r=e(n);return ft.some(e=>e===r||e===n.role)},ht=e=>{let t=e.target;if(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement){let e=t.selectionStart??0;return(t.selectionEnd??0)-e>0}return!1},gt=()=>{let e=window.getSelection();return e?e.toString().length>0:!1},_t=`data-react-grab`,vt=(e,t,n)=>Math.max(t,Math.min(e,n)),X={width:0,height:0,offsetLeft:0,offsetTop:0};let yt=null,bt=-1/0;const xt=()=>{bt=-1/0},St=e=>{if(e){let t=e.getBoundingClientRect();X.width=t.width,X.height=t.height,X.offsetLeft=t.left,X.offsetTop=t.top;return}let t=window.visualViewport;X.width=t?.width??window.innerWidth,X.height=t?.height??window.innerHeight,X.offsetLeft=t?.offsetLeft??0,X.offsetTop=t?.offsetTop??0},Ct=()=>{let e=n(),t=performance.now();return(e!==yt||t-bt>=16)&&(yt=e,bt=t,St(e)),{width:X.width,height:X.height,offsetLeft:X.offsetLeft,offsetTop:X.offsetTop}};let Z=null;const wt=()=>{if(typeof navigator>`u`||!(`userAgentData`in navigator))return null;let e=navigator.userAgentData;if(typeof e!=`object`||!e||!(`platform`in e))return null;let t=e.platform;return typeof t==`string`?t:null},Tt=()=>{if(Z===null){if(typeof navigator>`u`)return Z=!1,Z;let e=navigator.platform??wt()??navigator.userAgent;Z=/Mac|iPhone|iPad|iPod/i.test(e)}return Z},Et=(e,t)=>{try{return e.composedPath().some(e=>r(e)&&e.hasAttribute(t))}catch{return!1}},Q=e=>`${e}-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,Dt=`react-grab-toolbar-state`,Ot=()=>{try{let e=localStorage.getItem(Dt);if(!e)return null;let n=JSON.parse(e);if(typeof n!=`object`||!n)return null;let r=n,i=typeof r.collapsed==`boolean`?r.collapsed:!1;return{edge:r.edge===`top`||r.edge===`bottom`||r.edge===`left`||r.edge===`right`?r.edge:`bottom`,ratio:typeof r.ratio==`number`?r.ratio:s,collapsed:i,enabled:!i,defaultAction:typeof r.defaultAction==`string`?r.defaultAction:t}}catch(e){console.warn(`[react-grab] Failed to load toolbar state from localStorage:`,e)}return null},kt=e=>{try{localStorage.setItem(Dt,JSON.stringify(e))}catch(e){console.warn(`[react-grab] Failed to save toolbar state to localStorage:`,e)}},At=`react-grab-comment-items`,jt=60*1e3,Mt=60*jt,Nt=24*Mt,Pt=new Set;let $=null;const Ft=e=>{if(typeof e.content!=`string`||typeof e.commentText!=`string`||typeof e.tagName!=`string`||typeof e.timestamp!=`number`||!Number.isFinite(e.timestamp))return null;let t=typeof e.componentName==`string`?e.componentName:typeof e.elementName==`string`?e.elementName:void 0;return{id:typeof e.id==`string`?e.id:Q(`comment`),content:e.content,tagName:e.tagName,componentName:t,elementsCount:typeof e.elementsCount==`number`&&Number.isFinite(e.elementsCount)?Math.max(1,Math.floor(e.elementsCount)):1,elementSelectors:Array.isArray(e.elementSelectors)?e.elementSelectors.filter(e=>typeof e==`string`):[],commentText:e.commentText,timestamp:e.timestamp}},It=()=>{if(typeof window>`u`)return[];try{let e=sessionStorage.getItem(At);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.map(e=>Ft(e)).filter(e=>e!==null).slice(0,50):[]}catch{return[]}},Lt=()=>($??=It(),$),Rt=e=>{let t=e;for(;t.length>0;){let e=JSON.stringify(t);if(new Blob([e]).size<=524288)return t;t=t.slice(0,-1)}return[]},zt=e=>{$=Rt(e);try{sessionStorage.setItem(At,JSON.stringify($))}catch{}for(let e of Pt)e($);return $},Bt=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),Vt=()=>[...Lt()],Ht=e=>{let t=Lt().filter(t=>t.commentText!==e.commentText||!Bt(t.elementSelectors,e.elementSelectors));return zt([{...e,id:Q(`comment`)},...t].slice(0,50))},Ut=e=>zt(Lt().filter(t=>t.id!==e)),Wt=()=>zt([]),Gt=e=>(Pt.add(e),()=>{Pt.delete(e)}),Kt=e=>e.key===`Enter`,qt=e=>e.metaKey||e.ctrlKey,Jt=(e,t,n={})=>{if(!t.key)return null;if(Kt(t))return e.find(e=>e.shortcut===`Enter`)??null;if(t.repeat)return null;let r=t.key.toLowerCase();return qt(t)?n.includeModifierShortcuts===!0?e.find(e=>e.shortcut!==void 0&&e.shortcut!==`Enter`&&e.shortcutModifier!==!1&&r===e.shortcut.toLowerCase())??null:null:e.find(e=>e.shortcut!==void 0&&e.shortcutModifier===!1&&r===e.shortcut.toLowerCase())??null},Yt=e=>e??!0,Xt=(e,t)=>{if(typeof e.enabled==`function`){if(!t)return!1;try{return e.enabled(t)}catch(t){return c(new i(e.id,t)),!1}}return Yt(e.enabled)},Zt=(e,t)=>{if(!Xt(e,t))return!1;try{let n=e.onAction(t);n&&n.catch(t=>{c(new a(e.id,t))})}catch(t){c(new a(e.id,t))}return!0};export{ae as $,K as A,h as B,mt as C,Ze as D,Xe as E,et as F,le as G,Ne as H,Qe as I,O as J,k as K,Ge as L,We as M,G as N,Ye as O,$e as P,ie as Q,tt as R,gt as S,ut as T,M as U,Me as V,Te as W,E as X,j as Y,D as Z,Ct as _,Wt as a,Ae as at,_t as b,Gt as c,jt as d,we as et,Ot as f,Tt as g,Et as h,Ht as i,re as it,Ve as j,Ke as k,Nt as l,Q as m,Xt as n,ne as nt,Vt as o,N as ot,kt as p,A as q,Jt as r,P as rt,Ut as s,ue as st,Zt as t,ke as tt,Mt as u,xt as v,dt as w,ht as x,vt as y,p as z};
|
|
9
|
+
import{H as e,Mt as t,N as n,Tt as r,U as i,W as a,at as o,hn as s,l as c}from"./freeze-updates-DECkfxYt.js";const l={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return u(this.context.count)},getNextContextId(){return u(this.context.count++)}};function u(e){let t=String(e),n=t.length-1;return l.context.id+(n?String.fromCharCode(96+n):``)+t}function d(e){l.context=e}const f=(e,t)=>e===t,p=Symbol(`solid-proxy`),m=typeof Proxy==`function`,h=Symbol(`solid-track`),g={equals:f};let _=ge;const v={owned:null,cleanups:null,context:null,owner:null},y={};var b=null;let x=null,S=null,C=null,w=null,T=0;function E(e,t){let n=S,r=b,i=e.length===0,a=t===void 0?r:t,o=i?v:{owned:null,cleanups:null,context:a?a.context:null,owner:a},s=i?e:()=>e(()=>N(()=>V(o)));b=o,S=null;try{return z(s,!0)}finally{S=n,b=r}}function D(e,t){t=t?Object.assign({},g,t):g;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0};return[fe.bind(n),e=>(typeof e==`function`&&(e=x&&x.running&&x.sources.has(n)?e(n.tValue):e(n.value)),pe(n,e))]}function ee(e,t,n){I(L(e,t,!0,1))}function O(e,t,n){I(L(e,t,!1,1))}function k(e,t,n){_=_e;let r=L(e,t,!1,1),i=F&&ue(F);i&&(r.suspense=i),(!n||!n.render)&&(r.user=!0),w?w.push(r):I(r)}function A(e,t,n){n=n?Object.assign({},g,n):g;let r=L(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,I(r),fe.bind(r)}function te(e){return e&&typeof e==`object`&&`then`in e}function j(e,t,n){let r,i,a;typeof t==`function`?(r=e,i=t,a=n||{}):(r=!0,i=e,a=t||{});let o=null,s=y,c=null,u=!1,d=!1,f=`initialValue`in a,p=typeof r==`function`&&A(r),m=new Set,[h,g]=(a.storage||D)(a.initialValue),[_,v]=D(void 0),[C,w]=D(void 0,{equals:!1}),[T,E]=D(f?`ready`:`unresolved`);l.context&&(c=l.getNextContextId(),a.ssrLoadFrom===`initial`?s=a.initialValue:l.load&&l.has(c)&&(s=l.load(c)));function O(e,t,n,r){return o===e&&(o=null,r!==void 0&&(f=!0),(e===s||t===s)&&a.onHydrated&&queueMicrotask(()=>a.onHydrated(r,{value:t})),s=y,x&&e&&u?(x.promises.delete(e),u=!1,z(()=>{x.running=!0,k(t,n)},!1)):k(t,n)),t}function k(e,t){z(()=>{t===void 0&&g(()=>e),E(t===void 0?f?`ready`:`unresolved`:`errored`),v(t);for(let e of m.keys())e.decrement();m.clear()},!1)}function j(){let e=F&&ue(F),t=h(),n=_();if(n!==void 0&&!o)throw n;return S&&!S.user&&e&&ee(()=>{C(),o&&(e.resolved&&x&&u?x.promises.add(o):m.has(e)||(e.increment(),m.add(e)))}),t}function M(e=!0){if(e!==!1&&d)return;d=!1;let t=p?p():r;if(u=x&&x.running,t==null||t===!1){O(o,N(h));return}x&&o&&x.promises.delete(o);let n,a=s===y?N(()=>{try{return i(t,{value:h(),refetching:e})}catch(e){n=e}}):s;if(n!==void 0){O(o,void 0,H(n),t);return}else if(!te(a))return O(o,a,void 0,t),a;return o=a,`v`in a?(a.s===1?O(o,a.v,void 0,t):O(o,void 0,H(a.v),t),a):(d=!0,queueMicrotask(()=>d=!1),z(()=>{E(f?`refreshing`:`pending`),w()},!1),a.then(e=>O(a,e,void 0,t),e=>O(a,void 0,H(e),t)))}Object.defineProperties(j,{state:{get:()=>T()},error:{get:()=>_()},loading:{get(){let e=T();return e===`pending`||e===`refreshing`}},latest:{get(){if(!f)return j();let e=_();if(e&&!o)throw e;return h()}}});let ne=b;return p?ee(()=>(ne=b,M(!1))):M(!1),[j,{refetch:e=>oe(ne,()=>M(e)),mutate:g}]}function M(e){return z(e,!1)}function N(e){if(S===null)return e();let t=S;S=null;try{return e()}finally{S=t}}function ne(e,t,n){let r=Array.isArray(e),i,a=n&&n.defer;return n=>{let o;if(r){o=Array(e.length);for(let t=0;t<e.length;t++)o[t]=e[t]()}else o=e();if(a)return a=!1,n;let s=N(()=>t(o,i,n));return i=o,s}}function re(e){k(()=>N(e))}function P(e){return b===null||(b.cleanups===null?b.cleanups=[e]:b.cleanups.push(e)),e}function ie(){return S}function ae(){return b}function oe(e,t){let n=b,r=S;b=e,S=null;try{return z(t,!0)}catch(e){U(e)}finally{b=n,S=r}}const[se,ce]=D(!1);function le(e,t){let n=Symbol(`context`);return{id:n,Provider:xe(n),defaultValue:e}}function ue(e){let t;return b&&b.context&&(t=b.context[e.id])!==void 0?t:e.defaultValue}function de(e){let t=A(e),n=A(()=>be(t()));return n.toArray=()=>{let e=n();return Array.isArray(e)?e:e==null?[]:[e]},n}let F;function fe(){let e=x&&x.running;if(this.sources&&(e?this.tState:this.state))if((e?this.tState:this.state)===1)I(this);else{let e=C;C=null,z(()=>B(this),!1),C=e}if(S){let e=this.observers?this.observers.length:0;S.sources?(S.sources.push(this),S.sourceSlots.push(e)):(S.sources=[this],S.sourceSlots=[e]),this.observers?(this.observers.push(S),this.observerSlots.push(S.sources.length-1)):(this.observers=[S],this.observerSlots=[S.sources.length-1])}return e&&x.sources.has(this)?this.tValue:this.value}function pe(e,t,n){let r=x&&x.running&&x.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(x){let r=x.running;(r||!n&&x.sources.has(e))&&(x.sources.add(e),e.tValue=t),r||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&z(()=>{for(let t=0;t<e.observers.length;t+=1){let n=e.observers[t],r=x&&x.running;r&&x.disposed.has(n)||((r?!n.tState:!n.state)&&(n.pure?C.push(n):w.push(n),n.observers&&ve(n)),r?n.tState=1:n.state=1)}if(C.length>1e6)throw C=[],Error()},!1)}return t}function I(e){if(!e.fn)return;V(e);let t=T;me(e,x&&x.running&&x.sources.has(e)?e.tValue:e.value,t),x&&!x.running&&x.sources.has(e)&&queueMicrotask(()=>{z(()=>{x&&(x.running=!0),S=b=e,me(e,e.tValue,t),S=b=null},!1)})}function me(e,t,n){let r,i=b,a=S;S=b=e;try{r=e.fn(t)}catch(t){return e.pure&&(x&&x.running?(e.tState=1,e.tOwned&&e.tOwned.forEach(V),e.tOwned=void 0):(e.state=1,e.owned&&e.owned.forEach(V),e.owned=null)),e.updatedAt=n+1,U(t)}finally{S=a,b=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&`observers`in e?pe(e,r,!0):x&&x.running&&e.pure?(x.sources.has(e)||(e.value=r),x.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function L(e,t,n,r=1,i){let a={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:b,context:b?b.context:null,pure:n};return x&&x.running&&(a.state=0,a.tState=r),b===null||b!==v&&(x&&x.running&&b.pure?b.tOwned?b.tOwned.push(a):b.tOwned=[a]:b.owned?b.owned.push(a):b.owned=[a]),a}function R(e){let t=x&&x.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===2)return B(e);if(e.suspense&&N(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<T);){if(t&&x.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let t=e,i=n[r+1];for(;(t=t.owner)&&t!==i;)if(x.disposed.has(t))return}if((t?e.tState:e.state)===1)I(e);else if((t?e.tState:e.state)===2){let t=C;C=null,z(()=>B(e,n[0]),!1),C=t}}}function z(e,t){if(C)return e();let n=!1;t||(C=[]),w?n=!0:w=[],T++;try{let t=e();return he(n),t}catch(e){n||(w=null),C=null,U(e)}}function he(e){if(C&&=(ge(C),null),e)return;let t;if(x){if(!x.promises.size&&!x.queue.size){let e=x.sources,n=x.disposed;w.push.apply(w,x.effects),t=x.resolve;for(let e of w)`tState`in e&&(e.state=e.tState),delete e.tState;x=null,z(()=>{for(let e of n)V(e);for(let t of e){if(t.value=t.tValue,t.owned)for(let e=0,n=t.owned.length;e<n;e++)V(t.owned[e]);t.tOwned&&(t.owned=t.tOwned),delete t.tValue,delete t.tOwned,t.tState=0}ce(!1)},!1)}else if(x.running){x.running=!1,x.effects.push.apply(x.effects,w),w=null,ce(!0);return}}let n=w;w=null,n.length&&z(()=>_(n),!1),t&&t()}function ge(e){for(let t=0;t<e.length;t++)R(e[t])}function _e(e){let t,n=0;for(t=0;t<e.length;t++){let r=e[t];r.user?e[n++]=r:R(r)}if(l.context){if(l.count){l.effects||=[],l.effects.push(...e.slice(0,n));return}d()}for(l.effects&&(l.done||!l.count)&&(e=[...l.effects,...e],n+=l.effects.length,delete l.effects),t=0;t<n;t++)R(e[t])}function B(e,t){let n=x&&x.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){let i=e.sources[r];if(i.sources){let e=n?i.tState:i.state;e===1?i!==t&&(!i.updatedAt||i.updatedAt<T)&&R(i):e===2&&B(i,t)}}}function ve(e){let t=x&&x.running;for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=2:r.state=2,r.pure?C.push(r):w.push(r),r.observers&&ve(r))}}function V(e){let t;if(e.sources)for(;e.sources.length;){let t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){let e=r.pop(),i=t.observerSlots.pop();n<r.length&&(e.sourceSlots[i]=n,r[n]=e,t.observerSlots[n]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)V(e.tOwned[t]);delete e.tOwned}if(x&&x.running&&e.pure)ye(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)V(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}x&&x.running?e.tState=0:e.state=0}function ye(e,t){if(t||(e.tState=0,x.disposed.add(e)),e.owned)for(let t=0;t<e.owned.length;t++)ye(e.owned[t])}function H(e){return e instanceof Error?e:Error(typeof e==`string`?e:`Unknown error`,{cause:e})}function U(e,t=b){throw H(e)}function be(e){if(typeof e==`function`&&!e.length)return be(e());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++){let r=be(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function xe(e,t){return function(t){let n;return O(()=>n=N(()=>(b.context={...b.context,[e]:t.value},de(()=>t.children))),void 0),n}}const Se=Symbol(`fallback`);function Ce(e){for(let t=0;t<e.length;t++)e[t]()}function we(e,t,n={}){let r=[],i=[],a=[],o=0,s=t.length>1?[]:null;return P(()=>Ce(a)),()=>{let c=e()||[],l=c.length,u,d;return c[h],N(()=>{let e,t,p,m,h,g,_,v,y;if(l===0)o!==0&&(Ce(a),a=[],r=[],i=[],o=0,s&&=[]),n.fallback&&(r=[Se],i[0]=E(e=>(a[0]=e,n.fallback())),o=1);else if(o===0){for(i=Array(l),d=0;d<l;d++)r[d]=c[d],i[d]=E(f);o=l}else{for(p=Array(l),m=Array(l),s&&(h=Array(l)),g=0,_=Math.min(o,l);g<_&&r[g]===c[g];g++);for(_=o-1,v=l-1;_>=g&&v>=g&&r[_]===c[v];_--,v--)p[v]=i[_],m[v]=a[_],s&&(h[v]=s[_]);for(e=new Map,t=Array(v+1),d=v;d>=g;d--)y=c[d],u=e.get(y),t[d]=u===void 0?-1:u,e.set(y,d);for(u=g;u<=_;u++)y=r[u],d=e.get(y),d!==void 0&&d!==-1?(p[d]=i[u],m[d]=a[u],s&&(h[d]=s[u]),d=t[d],e.set(y,d)):a[u]();for(d=g;d<l;d++)d in p?(i[d]=p[d],a[d]=m[d],s&&(s[d]=h[d],s[d](d))):i[d]=E(f);i=i.slice(0,o=l),r=c.slice(0)}return i});function f(e){if(a[d]=e,s){let[e,n]=D(d);return s[d]=n,t(c[d],e)}return t(c[d])}}}function Te(e,t){return N(()=>e(t||{}))}function W(){return!0}const Ee={get(e,t,n){return t===p?n:e.get(t)},has(e,t){return t===p?!0:e.has(t)},set:W,deleteProperty:W,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:W,deleteProperty:W}},ownKeys(e){return e.keys()}};function De(e){return(e=typeof e==`function`?e():e)?e:{}}function Oe(){for(let e=0,t=this.length;e<t;++e){let t=this[e]();if(t!==void 0)return t}}function ke(...e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];t||=!!r&&p in r,e[n]=typeof r==`function`?(t=!0,A(r)):r}if(m&&t)return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){let r=De(e[n])[t];if(r!==void 0)return r}},has(t){for(let n=e.length-1;n>=0;n--)if(t in De(e[n]))return!0;return!1},keys(){let t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(De(e[n])));return[...new Set(t)]}},Ee);let n={},r=Object.create(null);for(let t=e.length-1;t>=0;t--){let i=e[t];if(!i)continue;let a=Object.getOwnPropertyNames(i);for(let e=a.length-1;e>=0;e--){let t=a[e];if(t===`__proto__`||t===`constructor`)continue;let o=Object.getOwnPropertyDescriptor(i,t);if(!r[t])r[t]=o.get?{enumerable:!0,configurable:!0,get:Oe.bind(n[t]=[o.get.bind(i)])}:o.value===void 0?void 0:o;else{let e=n[t];e&&(o.get?e.push(o.get.bind(i)):o.value!==void 0&&e.push(()=>o.value))}}}let i={},a=Object.keys(r);for(let e=a.length-1;e>=0;e--){let t=a[e],n=r[t];n&&n.get?Object.defineProperty(i,t,n):i[t]=n?n.value:void 0}return i}function Ae(e,...t){let n=t.length;if(m&&p in e){let r=n>1?t.flat():t[0],i=t.map(t=>new Proxy({get(n){return t.includes(n)?e[n]:void 0},has(n){return t.includes(n)&&n in e},keys(){return t.filter(t=>t in e)}},Ee));return i.push(new Proxy({get(t){return r.includes(t)?void 0:e[t]},has(t){return r.includes(t)?!1:t in e},keys(){return Object.keys(e).filter(e=>!r.includes(e))}},Ee)),i}let r=[];for(let e=0;e<=n;e++)r[e]={};for(let i of Object.getOwnPropertyNames(e)){let a=n;for(let e=0;e<t.length;e++)if(t[e].includes(i)){a=e;break}let o=Object.getOwnPropertyDescriptor(e,i);!o.get&&!o.set&&o.enumerable&&o.writable&&o.configurable?r[a][i]=o.value:Object.defineProperty(r[a],i,o)}return r}const je=e=>`Stale read from <${e}>.`;function Me(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return A(we(()=>e.each,e.children,t||void 0))}function Ne(e){let t=e.keyed,n=A(()=>e.when,void 0,void 0),r=t?n:A(n,void 0,{equals:(e,t)=>!e==!t});return A(()=>{let i=r();if(i){let a=e.children;return typeof a==`function`&&a.length>0?N(()=>a(t?i:()=>{if(!N(r))throw je(`Show`);return n()})):a}return e.fallback},void 0,void 0)}const Pe=new Set([`className`,`value`,`readOnly`,`noValidate`,`formNoValidate`,`isMap`,`noModule`,`playsInline`,`adAuctionHeaders`,`allowFullscreen`,`browsingTopics`,`defaultChecked`,`defaultMuted`,`defaultSelected`,`disablePictureInPicture`,`disableRemotePlayback`,`preservesPitch`,`shadowRootClonable`,`shadowRootCustomElementRegistry`,`shadowRootDelegatesFocus`,`shadowRootSerializable`,`sharedStorageWritable`,...`allowfullscreen.async.alpha.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.hidden.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.adauctionheaders.browsingtopics.credentialless.defaultchecked.defaultmuted.defaultselected.defer.disablepictureinpicture.disableremoteplayback.preservespitch.shadowrootclonable.shadowrootcustomelementregistry.shadowrootdelegatesfocus.shadowrootserializable.sharedstoragewritable`.split(`.`)]),Fe=new Set([`innerHTML`,`textContent`,`innerText`,`children`]),Ie=Object.assign(Object.create(null),{className:`class`,htmlFor:`for`}),Le=Object.assign(Object.create(null),{class:`className`,novalidate:{$:`noValidate`,FORM:1},formnovalidate:{$:`formNoValidate`,BUTTON:1,INPUT:1},ismap:{$:`isMap`,IMG:1},nomodule:{$:`noModule`,SCRIPT:1},playsinline:{$:`playsInline`,VIDEO:1},readonly:{$:`readOnly`,INPUT:1,TEXTAREA:1},adauctionheaders:{$:`adAuctionHeaders`,IFRAME:1},allowfullscreen:{$:`allowFullscreen`,IFRAME:1},browsingtopics:{$:`browsingTopics`,IMG:1},defaultchecked:{$:`defaultChecked`,INPUT:1},defaultmuted:{$:`defaultMuted`,AUDIO:1,VIDEO:1},defaultselected:{$:`defaultSelected`,OPTION:1},disablepictureinpicture:{$:`disablePictureInPicture`,VIDEO:1},disableremoteplayback:{$:`disableRemotePlayback`,AUDIO:1,VIDEO:1},preservespitch:{$:`preservesPitch`,AUDIO:1,VIDEO:1},shadowrootclonable:{$:`shadowRootClonable`,TEMPLATE:1},shadowrootdelegatesfocus:{$:`shadowRootDelegatesFocus`,TEMPLATE:1},shadowrootserializable:{$:`shadowRootSerializable`,TEMPLATE:1},sharedstoragewritable:{$:`sharedStorageWritable`,IFRAME:1,IMG:1}});function Re(e,t){let n=Le[e];return typeof n==`object`?n[t]?n.$:void 0:n}const ze=new Set([`beforeinput`,`click`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`]),Be={xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`},Ve=e=>A(()=>e());function He(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,c=t[i-1].nextSibling,l=null;for(;o<i||s<a;){if(t[o]===n[s]){o++,s++;continue}for(;t[i-1]===n[a-1];)i--,a--;if(i===o){let t=a<r?s?n[s-1].nextSibling:n[a-s]:c;for(;s<a;)e.insertBefore(n[s++],t)}else if(a===s)for(;o<i;)(!l||!l.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){let r=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],r),t[i]=n[a]}else{if(!l){l=new Map;let e=s;for(;e<a;)l.set(n[e],e++)}let r=l.get(t[o]);if(r!=null)if(s<r&&r<a){let c=o,u=1,d;for(;++c<i&&c<a&&!((d=l.get(t[c]))==null||d!==r+u);)u++;if(u>r-s){let i=t[o];for(;s<r;)e.insertBefore(n[s++],i)}else e.replaceChild(n[s++],t[o++])}else o++;else t[o++].remove()}}}const Ue=`_$DX_DELEGATE`;function We(e,t,n,r={}){let i;return E(r=>{i=r,t===document?e():K(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=``}}function Ge(e,t,n,r){let i,a=()=>{let t=r?document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`template`):document.createElement(`template`);return t.innerHTML=e,n?t.content.firstChild.firstChild:r?t.firstChild:t.content.firstChild},o=t?()=>N(()=>document.importNode(i||=a(),!0)):()=>(i||=a()).cloneNode(!0);return o.cloneNode=o,o}function Ke(e,t=window.document){let n=t[Ue]||(t[Ue]=new Set);for(let r=0,i=e.length;r<i;r++){let i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,ot))}}function G(e,t,n){q(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function qe(e,t,n,r){q(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function Je(e,t,n){q(e)||(n?e.setAttribute(t,``):e.removeAttribute(t))}function Ye(e,t){q(e)||(t==null?e.removeAttribute(`class`):e.className=t)}function Xe(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){let r=n[0];e.addEventListener(t,n[0]=t=>r.call(e,n[1],t))}else e.addEventListener(t,n,typeof n!=`function`&&n)}function Ze(e,t,n={}){let r=Object.keys(t||{}),i=Object.keys(n),a,o;for(a=0,o=i.length;a<o;a++){let r=i[a];!r||r===`undefined`||t[r]||(it(e,r,!1),delete n[r])}for(a=0,o=r.length;a<o;a++){let i=r[a],o=!!t[i];!i||i===`undefined`||n[i]===o||!o||(it(e,i,!0),n[i]=o)}return n}function Qe(e,t,n){if(!t)return n?G(e,`style`):t;let r=e.style;if(typeof t==`string`)return r.cssText=t;typeof n==`string`&&(r.cssText=n=void 0),n||={},t||={};let i,a;for(a in n)t[a]??r.removeProperty(a),delete n[a];for(a in t)i=t[a],i!==n[a]&&(r.setProperty(a,i),n[a]=i);return n}function $e(e,t,n){n==null?e.style.removeProperty(t):e.style.setProperty(t,n)}function et(e,t={},n,r){let i={};return r||O(()=>i.children=J(e,t.children,i.children)),O(()=>typeof t.ref==`function`&&tt(t.ref,e)),O(()=>nt(e,t,n,!0,i,!0)),i}function tt(e,t,n){return N(()=>e(t,n))}function K(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!=`function`)return J(e,t,r,n);O(r=>J(e,t(),r,n),r)}function nt(e,t,n,r,i={},a=!1){t||={};for(let r in i)if(!(r in t)){if(r===`children`)continue;i[r]=at(e,r,null,i[r],n,a,t)}for(let o in t){if(o===`children`){r||J(e,t.children);continue}let s=t[o];i[o]=at(e,o,s,i[o],n,a,t)}}function q(e){return!!l.context&&!l.done&&(!e||e.isConnected)}function rt(e){return e.toLowerCase().replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function it(e,t,n){let r=t.trim().split(/\s+/);for(let t=0,i=r.length;t<i;t++)e.classList.toggle(r[t],n)}function at(e,t,n,r,i,a,o){let s,c,l,u,d;if(t===`style`)return Qe(e,n,r);if(t===`classList`)return Ze(e,n,r);if(n===r)return r;if(t===`ref`)a||n(e);else if(t.slice(0,3)===`on:`){let i=t.slice(3);r&&e.removeEventListener(i,r,typeof r!=`function`&&r),n&&e.addEventListener(i,n,typeof n!=`function`&&n)}else if(t.slice(0,10)===`oncapture:`){let i=t.slice(10);r&&e.removeEventListener(i,r,!0),n&&e.addEventListener(i,n,!0)}else if(t.slice(0,2)===`on`){let i=t.slice(2).toLowerCase(),a=ze.has(i);if(!a&&r){let t=Array.isArray(r)?r[0]:r;e.removeEventListener(i,t)}(a||n)&&(Xe(e,i,n,a),a&&Ke([i]))}else if(t.slice(0,5)===`attr:`)G(e,t.slice(5),n);else if(t.slice(0,5)===`bool:`)Je(e,t.slice(5),n);else if((d=t.slice(0,5)===`prop:`)||(l=Fe.has(t))||!i&&((u=Re(t,e.tagName))||(c=Pe.has(t)))||(s=e.nodeName.includes(`-`)||`is`in o)){if(d)t=t.slice(5),c=!0;else if(q(e))return n;t===`class`||t===`className`?Ye(e,n):s&&!c&&!l?e[rt(t)]=n:e[u||t]=n}else{let r=i&&t.indexOf(`:`)>-1&&Be[t.split(`:`)[0]];r?qe(e,r,t,n):G(e,Ie[t]||t,n)}return n}function ot(e){if(l.registry&&l.events&&l.events.find(([t,n])=>n===e))return;let t=e.target,n=`$$${e.type}`,r=e.target,i=e.currentTarget,a=t=>Object.defineProperty(e,`target`,{configurable:!0,value:t}),o=()=>{let r=t[n];if(r&&!t.disabled){let i=t[`${n}Data`];if(i===void 0?r.call(t,e):r.call(t,i,e),e.cancelBubble)return}return t.host&&typeof t.host!=`string`&&!t.host._$host&&t.contains(e.target)&&a(t.host),!0},s=()=>{for(;o()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,`currentTarget`,{configurable:!0,get(){return t||document}}),l.registry&&!l.done&&(l.done=_$HY.done=!0),e.composedPath){let n=e.composedPath();a(n[0]);for(let e=0;e<n.length-2&&(t=n[e],o());e++){if(t._$host){t=t._$host,s();break}if(t.parentNode===i)break}}else s();a(r)}function J(e,t,n,r,i){let a=q(e);if(a){!n&&(n=[...e.childNodes]);let t=[];for(let e=0;e<n.length;e++){let r=n[e];r.nodeType===8&&r.data.slice(0,2)===`!$`?r.remove():t.push(r)}n=t}for(;typeof n==`function`;)n=n();if(t===n)return n;let o=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o===`string`||o===`number`){if(a||o===`number`&&(t=t.toString(),t===n))return n;if(s){let i=n[0];i&&i.nodeType===3?i.data!==t&&(i.data=t):i=document.createTextNode(t),n=Y(e,n,r,i)}else n=n!==``&&typeof n==`string`?e.firstChild.data=t:e.textContent=t}else if(t==null||o===`boolean`){if(a)return n;n=Y(e,n,r)}else if(o===`function`)return O(()=>{let i=t();for(;typeof i==`function`;)i=i();n=J(e,i,n,r)}),()=>n;else if(Array.isArray(t)){let o=[],c=n&&Array.isArray(n);if(st(o,t,n,i))return O(()=>n=J(e,o,n,r,!0)),()=>n;if(a){if(!o.length)return n;if(r===void 0)return n=[...e.childNodes];let t=o[0];if(t.parentNode!==e)return n;let i=[t];for(;(t=t.nextSibling)!==r;)i.push(t);return n=i}if(o.length===0){if(n=Y(e,n,r),s)return n}else c?n.length===0?ct(e,o,r):He(e,n,o):(n&&Y(e),ct(e,o));n=o}else if(t.nodeType){if(a&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=Y(e,n,r,t);Y(e,n,null,t)}else n==null||n===``||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}return n}function st(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let o=t[a],s=n&&n[e.length],c;if(!(o==null||o===!0||o===!1))if((c=typeof o)==`object`&&o.nodeType)e.push(o);else if(Array.isArray(o))i=st(e,o,s)||i;else if(c===`function`)if(r){for(;typeof o==`function`;)o=o();i=st(e,Array.isArray(o)?o:[o],Array.isArray(s)?s:[s])||i}else e.push(o),i=!0;else{let t=String(o);s&&s.nodeType===3&&s.data===t?e.push(s):e.push(document.createTextNode(t))}}return i}function ct(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function Y(e,t,n,r){if(n===void 0)return e.textContent=``;let i=r||document.createTextNode(``);if(t.length){let r=!1;for(let a=t.length-1;a>=0;a--){let o=t[a];if(i!==o){let t=o.parentNode===e;!r&&!a?t?e.replaceChild(i,o):e.insertBefore(i,n):t&&o.remove()}else r=!0}}else e.insertBefore(i,n);return[i]}function lt(e,t=!1,n=void 0){return t?document.createElementNS(`http://www.w3.org/2000/svg`,e):document.createElement(e,{is:n})}function ut(e){let{useShadow:t}=e,n=document.createTextNode(``),r=()=>e.mount||document.body,i=ae(),a,o=!!l.context;return k(()=>{o&&(ae().user=o=!1),a||=oe(i,()=>A(()=>e.children));let s=r();if(s instanceof HTMLHeadElement){let[e,t]=D(!1);E(t=>K(s,()=>e()?t():a(),null)),P(()=>t(!0))}else{let r=lt(e.isSVG?`g`:`div`,e.isSVG),i=t&&r.attachShadow?r.attachShadow({mode:`open`}):r;Object.defineProperty(r,`_$host`,{get(){return n.parentNode},configurable:!0}),K(i,a),s.appendChild(r),e.ref&&e.ref(r),P(()=>s.removeChild(r))}},void 0,{render:!o}),n}const dt=e=>{if(!e)return!1;let t=o(e);return t?t.isConnected():!!(e.isConnected||e.ownerDocument?.contains(e))},ft=[`input`,`textarea`,`select`,`searchbox`,`slider`,`spinbutton`,`menuitem`,`menuitemcheckbox`,`menuitemradio`,`option`,`radio`,`textbox`,`combobox`],pt=e=>{if(e.composed){let t=e.composedPath()[0];if(t instanceof HTMLElement)return t}else if(e.target instanceof HTMLElement)return e.target},mt=t=>{if(document.designMode===`on`)return!0;let n=pt(t);if(!n)return!1;if(n.isContentEditable)return!0;let r=e(n);return ft.some(e=>e===r||e===n.role)},ht=e=>{let t=e.target;if(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement){let e=t.selectionStart??0;return(t.selectionEnd??0)-e>0}return!1},gt=()=>{let e=window.getSelection();return e?e.toString().length>0:!1},_t=`data-react-grab`,vt=(e,t,n)=>Math.max(t,Math.min(e,n)),X={width:0,height:0,offsetLeft:0,offsetTop:0};let yt=null,bt=-1/0;const xt=()=>{bt=-1/0},St=e=>{if(e){let t=e.getBoundingClientRect();X.width=t.width,X.height=t.height,X.offsetLeft=t.left,X.offsetTop=t.top;return}let t=window.visualViewport;X.width=t?.width??window.innerWidth,X.height=t?.height??window.innerHeight,X.offsetLeft=t?.offsetLeft??0,X.offsetTop=t?.offsetTop??0},Ct=()=>{let e=n(),t=performance.now();return(e!==yt||t-bt>=16)&&(yt=e,bt=t,St(e)),{width:X.width,height:X.height,offsetLeft:X.offsetLeft,offsetTop:X.offsetTop}};let Z=null;const wt=()=>{if(typeof navigator>`u`||!(`userAgentData`in navigator))return null;let e=navigator.userAgentData;if(typeof e!=`object`||!e||!(`platform`in e))return null;let t=e.platform;return typeof t==`string`?t:null},Tt=()=>{if(Z===null){if(typeof navigator>`u`)return Z=!1,Z;let e=navigator.platform??wt()??navigator.userAgent;Z=/Mac|iPhone|iPad|iPod/i.test(e)}return Z},Et=(e,t)=>{try{return e.composedPath().some(e=>r(e)&&e.hasAttribute(t))}catch{return!1}},Q=e=>`${e}-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,Dt=`react-grab-toolbar-state`,Ot=()=>{try{let e=localStorage.getItem(Dt);if(!e)return null;let n=JSON.parse(e);if(typeof n!=`object`||!n)return null;let r=n,i=typeof r.collapsed==`boolean`?r.collapsed:!1;return{edge:r.edge===`top`||r.edge===`bottom`||r.edge===`left`||r.edge===`right`?r.edge:`bottom`,ratio:typeof r.ratio==`number`?r.ratio:s,collapsed:i,enabled:!i,defaultAction:typeof r.defaultAction==`string`?r.defaultAction:t}}catch(e){console.warn(`[react-grab] Failed to load toolbar state from localStorage:`,e)}return null},kt=e=>{try{localStorage.setItem(Dt,JSON.stringify(e))}catch(e){console.warn(`[react-grab] Failed to save toolbar state to localStorage:`,e)}},At=`react-grab-comment-items`,jt=60*1e3,Mt=60*jt,Nt=24*Mt,Pt=new Set;let $=null;const Ft=e=>{if(typeof e.content!=`string`||typeof e.commentText!=`string`||typeof e.tagName!=`string`||typeof e.timestamp!=`number`||!Number.isFinite(e.timestamp))return null;let t=typeof e.componentName==`string`?e.componentName:typeof e.elementName==`string`?e.elementName:void 0;return{id:typeof e.id==`string`?e.id:Q(`comment`),content:e.content,tagName:e.tagName,componentName:t,elementsCount:typeof e.elementsCount==`number`&&Number.isFinite(e.elementsCount)?Math.max(1,Math.floor(e.elementsCount)):1,elementSelectors:Array.isArray(e.elementSelectors)?e.elementSelectors.filter(e=>typeof e==`string`):[],commentText:e.commentText,timestamp:e.timestamp}},It=()=>{if(typeof window>`u`)return[];try{let e=sessionStorage.getItem(At);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.map(e=>Ft(e)).filter(e=>e!==null).slice(0,50):[]}catch{return[]}},Lt=()=>($??=It(),$),Rt=e=>{let t=e;for(;t.length>0;){let e=JSON.stringify(t);if(new Blob([e]).size<=524288)return t;t=t.slice(0,-1)}return[]},zt=e=>{$=Rt(e);try{sessionStorage.setItem(At,JSON.stringify($))}catch{}for(let e of Pt)e($);return $},Bt=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),Vt=()=>[...Lt()],Ht=e=>{let t=Lt().filter(t=>t.commentText!==e.commentText||!Bt(t.elementSelectors,e.elementSelectors));return zt([{...e,id:Q(`comment`)},...t].slice(0,50))},Ut=e=>zt(Lt().filter(t=>t.id!==e)),Wt=()=>zt([]),Gt=e=>(Pt.add(e),()=>{Pt.delete(e)}),Kt=e=>e.key===`Enter`,qt=e=>e.metaKey||e.ctrlKey,Jt=(e,t,n={})=>{if(!t.key)return null;if(Kt(t))return e.find(e=>e.shortcut===`Enter`)??null;if(t.repeat)return null;let r=t.key.toLowerCase();return qt(t)?n.includeModifierShortcuts===!0?e.find(e=>e.shortcut!==void 0&&e.shortcut!==`Enter`&&e.shortcutModifier!==!1&&r===e.shortcut.toLowerCase())??null:null:e.find(e=>e.shortcut!==void 0&&e.shortcutModifier===!1&&r===e.shortcut.toLowerCase())??null},Yt=e=>e??!0,Xt=(e,t)=>{if(typeof e.enabled==`function`){if(!t)return!1;try{return e.enabled(t)}catch(t){return c(new i(e.id,t)),!1}}return Yt(e.enabled)},Zt=(e,t)=>{if(!Xt(e,t))return!1;try{let n=e.onAction(t);n&&n.catch(t=>{c(new a(e.id,t))})}catch(t){c(new a(e.id,t))}return!0};export{ae as $,K as A,h as B,mt as C,Ze as D,Xe as E,et as F,le as G,Ne as H,Qe as I,O as J,k as K,Ge as L,We as M,G as N,Ye as O,$e as P,ie as Q,tt as R,gt as S,ut as T,M as U,Me as V,Te as W,E as X,j as Y,D as Z,Ct as _,Wt as a,Ae as at,_t as b,Gt as c,jt as d,we as et,Ot as f,Tt as g,Et as h,Ht as i,re as it,Ve as j,Ke as k,Nt as l,Q as m,Xt as n,ne as nt,Vt as o,N as ot,kt as p,A as q,Jt as r,P as rt,Ut as s,ue as st,Zt as t,ke as tt,Mt as u,xt as v,dt as w,ht as x,vt as y,p as z};
|
package/dist/{execute-context-menu-action-CHfKH94T.cjs → execute-context-menu-action-CsZOSfln.cjs}
RENAMED
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
const e=require(`./freeze-updates-Cvj-Y46C.cjs`),t=Symbol(`error`);function n(e){return e instanceof Error?e:Error(typeof e==`string`?e:`Unknown error`,{cause:e})}function r(e,i=a){let o=i&&i.context&&i.context[t],s=n(e);if(!o)throw s;try{for(let e of o)e(s)}catch(e){r(e,i&&i.owner||null)}}const i={context:null,owner:null,owned:null,cleanups:null};let a=null;function o(){let e={owner:a,context:a?a.context:null,owned:null,cleanups:null};return a&&(a.owned?a.owned.push(e):a.owned=[e]),e}function s(e,t){let n=a,o=t===void 0?n:t,s=e.length===0?i:{context:o?o.context:null,owner:o,owned:null,cleanups:null};a=s;let c;try{c=e(e.length===0?()=>{}:()=>h(s))}catch(e){r(e)}finally{a=n}return c}function c(e,t){return[()=>e,t=>e=typeof t==`function`?t(e):t]}function l(e,t){a=o();try{e(t)}catch(e){r(e)}finally{a=a.owner}}const u=l;function d(e,t){}function f(e,t){a=o();let n;try{n=e(t)}catch(e){r(e)}finally{a=a.owner}return()=>n}function p(e){return e()}const m=p;function ee(e,t,n={}){let r=Array.isArray(e),i=n.defer;return()=>{if(i)return;let n;if(r){n=[];for(let t=0;t<e.length;t++)n.push(e[t]())}else n=e();return t(n)}}function te(e){}function ne(e){return a&&(a.cleanups?a.cleanups.push(e):a.cleanups=[e]),e}function h(e){if(e.owned){for(let t=0;t<e.owned.length;t++)h(e.owned[t]);e.owned=null}if(e.cleanups){for(let t=0;t<e.cleanups.length;t++)e.cleanups[t]();e.cleanups=null}}function g(e){let t=Symbol(`context`);return{id:t,Provider:ae(t),defaultValue:e}}function _(e){return a&&a.context&&a.context[e.id]!==void 0?a.context[e.id]:e.defaultValue}function re(){return a}function ie(e){let t=f(()=>v(e()));return t.toArray=()=>{let e=t();return Array.isArray(e)?e:e==null?[]:[e]},t}function v(e){if(typeof e==`function`&&!e.length)return v(e());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++){let r=v(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function ae(e){return function(t){return f(()=>(a.context={...a.context,[e]:t.value},ie(()=>t.children)))}}function oe(e,t,n={}){let r=e(),i=[];if(r&&r.length)for(let e=0,n=r.length;e<n;e++)i.push(t(r[e],()=>e));else n.fallback&&(i=[n.fallback()]);return()=>i}const y={context:void 0,getContextId(){if(!this.context)throw Error(`getContextId cannot be used under non-hydrating context`);return b(this.context.count)},getNextContextId(){if(!this.context)throw Error(`getNextContextId cannot be used under non-hydrating context`);return b(this.context.count++)}};function b(e){let t=String(e),n=t.length-1;return y.context.id+(n?String.fromCharCode(96+n):``)+t}function x(e){y.context=e}function se(){return y.context?{...y.context,id:y.getNextContextId(),count:0}:void 0}function ce(e,t){if(y.context&&!y.context.noHydrate){let n=y.context;x(se());let r=e(t||{});return x(n),r}return e(t||{})}function le(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`function`&&(r=r()),r){let n=Object.getOwnPropertyDescriptors(r);for(let r in n)r in t||Object.defineProperty(t,r,{enumerable:!0,get(){for(let t=e.length-1;t>=0;t--){let n,i=e[t];if(typeof i==`function`&&(i=i()),n=(i||{})[r],n!==void 0)return n}}})}}return t}function ue(e,...t){let n=Object.getOwnPropertyDescriptors(e),r=e=>{let t={};for(let r=0;r<e.length;r++){let i=e[r];n[i]&&(Object.defineProperty(t,i,n[i]),delete n[i])}return t};return t.map(r).concat(r(Object.keys(n)))}function de(e,t){let n=e.each||[],r=n.length,i=e.children;if(r){let e=Array(r);for(let a=0;a<r;a++)e[a]=t(i,n[a],a);return e}return e.fallback}function fe(e){return de(e,(e,t,n)=>e(t,()=>n))}function pe(e){let t;return e.when?typeof(t=e.children)==`function`?t(e.keyed?e.when:()=>e.when):t:e.fallback||``}const me=g();let S=null;function he(e,t,r={}){typeof t!=`function`&&(r=t||{},t=e,e=!0);let i=new Set,a=y.getNextContextId(),o={},s=r.storage?r.storage(r.initialValue)[0]():r.initialValue,c,l;if(y.context.async&&r.ssrLoadFrom!==`initial`&&(o=y.context.resources[a]||(y.context.resources[a]={}),o.ref))return!o.data&&!o.ref[0]._loading&&!o.ref[0].error&&o.ref[1].refetch(),o.ref;let u=()=>{if(l)throw l;let e=r.ssrLoadFrom!==`initial`&&y.context.async&&`data`in y.context.resources[a];if(!e&&S&&S.push(a),!e&&d._loading){let e=_(me);e&&(e.resources.set(a,d),i.add(e))}return e},d=()=>u()?y.context.resources[a].data:s,f=()=>(u(),d._loading);d._loading=!1,d.error=void 0,d.state=`initialValue`in r?`ready`:`unresolved`,Object.defineProperties(d,{latest:{get(){return d()}},loading:{get(){return f()}}});function p(){let o=y.context;if(!o.async)return d._loading=!!(typeof e==`function`?e():e);if(o.resources&&a in o.resources&&`data`in o.resources[a]){s=o.resources[a].data;return}let u;try{if(S=[],u=typeof e==`function`?e():e,S.length)return}finally{S=null}if(!c){if(u==null||u===!1)return;c=t(u,{value:s})}return typeof c==`object`&&c&&`then`in c?(d._loading=!0,d.state=`pending`,c=c.then(e=>(d._loading=!1,d.state=`ready`,o.resources[a].data=e,c=null,C(i),e)).catch(e=>{throw d._loading=!1,d.state=`errored`,d.error=l=n(e),c=null,C(i),l}),o.serialize&&o.serialize(a,c,r.deferStream),c):(o.resources[a].data=c,o.serialize&&o.serialize(a,c),c=null,o.resources[a].data)}r.ssrLoadFrom!==`initial`&&p();let m=[d,{refetch:p,mutate:e=>s=e}];return c&&(o.ref=m),m}function ge(e){for(let t of e.resources.values())if(t._loading)return!1;return!0}function C(e){for(let t of e)ge(t)&&(t.completed(),e.delete(t))}const _e=new Set([`className`,`value`,`readOnly`,`noValidate`,`formNoValidate`,`isMap`,`noModule`,`playsInline`,`adAuctionHeaders`,`allowFullscreen`,`browsingTopics`,`defaultChecked`,`defaultMuted`,`defaultSelected`,`disablePictureInPicture`,`disableRemotePlayback`,`preservesPitch`,`shadowRootClonable`,`shadowRootCustomElementRegistry`,`shadowRootDelegatesFocus`,`shadowRootSerializable`,`sharedStorageWritable`,...`allowfullscreen.async.alpha.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.hidden.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.adauctionheaders.browsingtopics.credentialless.defaultchecked.defaultmuted.defaultselected.defer.disablepictureinpicture.disableremoteplayback.preservespitch.shadowrootclonable.shadowrootcustomelementregistry.shadowrootdelegatesfocus.shadowrootserializable.sharedstoragewritable`.split(`.`)]),ve=new Set([`innerHTML`,`textContent`,`innerText`,`children`]),ye=Object.assign(Object.create(null),{className:`class`,htmlFor:`for`}),be=Object.assign(Object.create(null),{class:`className`,novalidate:{$:`noValidate`,FORM:1},formnovalidate:{$:`formNoValidate`,BUTTON:1,INPUT:1},ismap:{$:`isMap`,IMG:1},nomodule:{$:`noModule`,SCRIPT:1},playsinline:{$:`playsInline`,VIDEO:1},readonly:{$:`readOnly`,INPUT:1,TEXTAREA:1},adauctionheaders:{$:`adAuctionHeaders`,IFRAME:1},allowfullscreen:{$:`allowFullscreen`,IFRAME:1},browsingtopics:{$:`browsingTopics`,IMG:1},defaultchecked:{$:`defaultChecked`,INPUT:1},defaultmuted:{$:`defaultMuted`,AUDIO:1,VIDEO:1},defaultselected:{$:`defaultSelected`,OPTION:1},disablepictureinpicture:{$:`disablePictureInPicture`,VIDEO:1},disableremoteplayback:{$:`disableRemotePlayback`,AUDIO:1,VIDEO:1},preservespitch:{$:`preservesPitch`,AUDIO:1,VIDEO:1},shadowrootclonable:{$:`shadowRootClonable`,TEMPLATE:1},shadowrootdelegatesfocus:{$:`shadowRootDelegatesFocus`,TEMPLATE:1},shadowrootserializable:{$:`shadowRootSerializable`,TEMPLATE:1},sharedstoragewritable:{$:`sharedStorageWritable`,IFRAME:1,IMG:1}});function xe(e,t){let n=be[e];return typeof n==`object`?n[t]?n.$:void 0:n}const Se=new Set([`beforeinput`,`click`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`]),Ce={xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`},we=e=>f(()=>e());function Te(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,c=t[i-1].nextSibling,l=null;for(;o<i||s<a;){if(t[o]===n[s]){o++,s++;continue}for(;t[i-1]===n[a-1];)i--,a--;if(i===o){let t=a<r?s?n[s-1].nextSibling:n[a-s]:c;for(;s<a;)e.insertBefore(n[s++],t)}else if(a===s)for(;o<i;)(!l||!l.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){let r=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],r),t[i]=n[a]}else{if(!l){l=new Map;let e=s;for(;e<a;)l.set(n[e],e++)}let r=l.get(t[o]);if(r!=null)if(s<r&&r<a){let c=o,u=1,d;for(;++c<i&&c<a&&!((d=l.get(t[c]))==null||d!==r+u);)u++;if(u>r-s){let i=t[o];for(;s<r;)e.insertBefore(n[s++],i)}else e.replaceChild(n[s++],t[o++])}else o++;else t[o++].remove()}}}const w=`_$DX_DELEGATE`;function Ee(e,t,n,r={}){let i;return s(r=>{i=r,t===document?e():M(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=``}}function De(e,t,n,r){let i,a=()=>{let t=r?document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`template`):document.createElement(`template`);return t.innerHTML=e,n?t.content.firstChild.firstChild:r?t.firstChild:t.content.firstChild},o=t?()=>m(()=>document.importNode(i||=a(),!0)):()=>(i||=a()).cloneNode(!0);return o.cloneNode=o,o}function T(e,t=window.document){let n=t[w]||(t[w]=new Set);for(let r=0,i=e.length;r<i;r++){let i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,Pe))}}function E(e,t,n){N(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function Oe(e,t,n,r){N(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function ke(e,t,n){N(e)||(n?e.setAttribute(t,``):e.removeAttribute(t))}function D(e,t){N(e)||(t==null?e.removeAttribute(`class`):e.className=t)}function O(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){let r=n[0];e.addEventListener(t,n[0]=t=>r.call(e,n[1],t))}else e.addEventListener(t,n,typeof n!=`function`&&n)}function k(e,t,n={}){let r=Object.keys(t||{}),i=Object.keys(n),a,o;for(a=0,o=i.length;a<o;a++){let r=i[a];!r||r===`undefined`||t[r]||(P(e,r,!1),delete n[r])}for(a=0,o=r.length;a<o;a++){let i=r[a],o=!!t[i];!i||i===`undefined`||n[i]===o||!o||(P(e,i,!0),n[i]=o)}return n}function A(e,t,n){if(!t)return n?E(e,`style`):t;let r=e.style;if(typeof t==`string`)return r.cssText=t;typeof n==`string`&&(r.cssText=n=void 0),n||={},t||={};let i,a;for(a in n)t[a]??r.removeProperty(a),delete n[a];for(a in t)i=t[a],i!==n[a]&&(r.setProperty(a,i),n[a]=i);return n}function Ae(e,t,n){n==null?e.style.removeProperty(t):e.style.setProperty(t,n)}function je(e,t={},n,r){let i={};return r||u(()=>i.children=I(e,t.children,i.children)),u(()=>typeof t.ref==`function`&&j(t.ref,e)),u(()=>Me(e,t,n,!0,i,!0)),i}function j(e,t,n){return m(()=>e(t,n))}function M(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!=`function`)return I(e,t,r,n);u(r=>I(e,t(),r,n),r)}function Me(e,t,n,r,i={},a=!1){t||={};for(let r in i)if(!(r in t)){if(r===`children`)continue;i[r]=F(e,r,null,i[r],n,a,t)}for(let o in t){if(o===`children`){r||I(e,t.children);continue}let s=t[o];i[o]=F(e,o,s,i[o],n,a,t)}}function N(e){return!!y.context&&!y.done&&(!e||e.isConnected)}function Ne(e){return e.toLowerCase().replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function P(e,t,n){let r=t.trim().split(/\s+/);for(let t=0,i=r.length;t<i;t++)e.classList.toggle(r[t],n)}function F(e,t,n,r,i,a,o){let s,c,l,u,d;if(t===`style`)return A(e,n,r);if(t===`classList`)return k(e,n,r);if(n===r)return r;if(t===`ref`)a||n(e);else if(t.slice(0,3)===`on:`){let i=t.slice(3);r&&e.removeEventListener(i,r,typeof r!=`function`&&r),n&&e.addEventListener(i,n,typeof n!=`function`&&n)}else if(t.slice(0,10)===`oncapture:`){let i=t.slice(10);r&&e.removeEventListener(i,r,!0),n&&e.addEventListener(i,n,!0)}else if(t.slice(0,2)===`on`){let i=t.slice(2).toLowerCase(),a=Se.has(i);if(!a&&r){let t=Array.isArray(r)?r[0]:r;e.removeEventListener(i,t)}(a||n)&&(O(e,i,n,a),a&&T([i]))}else if(t.slice(0,5)===`attr:`)E(e,t.slice(5),n);else if(t.slice(0,5)===`bool:`)ke(e,t.slice(5),n);else if((d=t.slice(0,5)===`prop:`)||(l=ve.has(t))||!i&&((u=xe(t,e.tagName))||(c=_e.has(t)))||(s=e.nodeName.includes(`-`)||`is`in o)){if(d)t=t.slice(5),c=!0;else if(N(e))return n;t===`class`||t===`className`?D(e,n):s&&!c&&!l?e[Ne(t)]=n:e[u||t]=n}else{let r=i&&t.indexOf(`:`)>-1&&Ce[t.split(`:`)[0]];r?Oe(e,r,t,n):E(e,ye[t]||t,n)}return n}function Pe(e){if(y.registry&&y.events&&y.events.find(([t,n])=>n===e))return;let t=e.target,n=`$$${e.type}`,r=e.target,i=e.currentTarget,a=t=>Object.defineProperty(e,`target`,{configurable:!0,value:t}),o=()=>{let r=t[n];if(r&&!t.disabled){let i=t[`${n}Data`];if(i===void 0?r.call(t,e):r.call(t,i,e),e.cancelBubble)return}return t.host&&typeof t.host!=`string`&&!t.host._$host&&t.contains(e.target)&&a(t.host),!0},s=()=>{for(;o()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,`currentTarget`,{configurable:!0,get(){return t||document}}),y.registry&&!y.done&&(y.done=_$HY.done=!0),e.composedPath){let n=e.composedPath();a(n[0]);for(let e=0;e<n.length-2&&(t=n[e],o());e++){if(t._$host){t=t._$host,s();break}if(t.parentNode===i)break}}else s();a(r)}function I(e,t,n,r,i){let a=N(e);if(a){!n&&(n=[...e.childNodes]);let t=[];for(let e=0;e<n.length;e++){let r=n[e];r.nodeType===8&&r.data.slice(0,2)===`!$`?r.remove():t.push(r)}n=t}for(;typeof n==`function`;)n=n();if(t===n)return n;let o=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o===`string`||o===`number`){if(a||o===`number`&&(t=t.toString(),t===n))return n;if(s){let i=n[0];i&&i.nodeType===3?i.data!==t&&(i.data=t):i=document.createTextNode(t),n=z(e,n,r,i)}else n=n!==``&&typeof n==`string`?e.firstChild.data=t:e.textContent=t}else if(t==null||o===`boolean`){if(a)return n;n=z(e,n,r)}else if(o===`function`)return u(()=>{let i=t();for(;typeof i==`function`;)i=i();n=I(e,i,n,r)}),()=>n;else if(Array.isArray(t)){let o=[],c=n&&Array.isArray(n);if(L(o,t,n,i))return u(()=>n=I(e,o,n,r,!0)),()=>n;if(a){if(!o.length)return n;if(r===void 0)return n=[...e.childNodes];let t=o[0];if(t.parentNode!==e)return n;let i=[t];for(;(t=t.nextSibling)!==r;)i.push(t);return n=i}if(o.length===0){if(n=z(e,n,r),s)return n}else c?n.length===0?R(e,o,r):Te(e,n,o):(n&&z(e),R(e,o));n=o}else if(t.nodeType){if(a&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=z(e,n,r,t);z(e,n,null,t)}else n==null||n===``||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}return n}function L(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let o=t[a],s=n&&n[e.length],c;if(!(o==null||o===!0||o===!1))if((c=typeof o)==`object`&&o.nodeType)e.push(o);else if(Array.isArray(o))i=L(e,o,s)||i;else if(c===`function`)if(r){for(;typeof o==`function`;)o=o();i=L(e,Array.isArray(o)?o:[o],Array.isArray(s)?s:[s])||i}else e.push(o),i=!0;else{let t=String(o);s&&s.nodeType===3&&s.data===t?e.push(s):e.push(document.createTextNode(t))}}return i}function R(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function z(e,t,n,r){if(n===void 0)return e.textContent=``;let i=r||document.createTextNode(``);if(t.length){let r=!1;for(let a=t.length-1;a>=0;a--){let o=t[a];if(i!==o){let t=o.parentNode===e;!r&&!a?t?e.replaceChild(i,o):e.insertBefore(i,n):t&&o.remove()}else r=!0}}else e.insertBefore(i,n);return[i]}function Fe(e){let{useShadow:t}=e,n=document.createTextNode(``);return y.context,n}const Ie=t=>{if(!t)return!1;let n=e.at(t);return n?n.isConnected():!!(t.isConnected||t.ownerDocument?.contains(t))},Le=[`input`,`textarea`,`select`,`searchbox`,`slider`,`spinbutton`,`menuitem`,`menuitemcheckbox`,`menuitemradio`,`option`,`radio`,`textbox`,`combobox`],Re=e=>{if(e.composed){let t=e.composedPath()[0];if(t instanceof HTMLElement)return t}else if(e.target instanceof HTMLElement)return e.target},ze=t=>{if(document.designMode===`on`)return!0;let n=Re(t);if(!n)return!1;if(n.isContentEditable)return!0;let r=e.H(n);return Le.some(e=>e===r||e===n.role)},Be=e=>{let t=e.target;if(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement){let e=t.selectionStart??0;return(t.selectionEnd??0)-e>0}return!1},Ve=()=>{let e=window.getSelection();return e?e.toString().length>0:!1},He=(e,t,n)=>Math.max(t,Math.min(e,n)),B={width:0,height:0,offsetLeft:0,offsetTop:0};let V=null,H=-1/0;const Ue=()=>{H=-1/0},We=e=>{if(e){let t=e.getBoundingClientRect();B.width=t.width,B.height=t.height,B.offsetLeft=t.left,B.offsetTop=t.top;return}let t=window.visualViewport;B.width=t?.width??window.innerWidth,B.height=t?.height??window.innerHeight,B.offsetLeft=t?.offsetLeft??0,B.offsetTop=t?.offsetTop??0},Ge=()=>{let t=e.N(),n=performance.now();return(t!==V||n-H>=16)&&(V=t,H=n,We(t)),{width:B.width,height:B.height,offsetLeft:B.offsetLeft,offsetTop:B.offsetTop}};let U=null;const Ke=()=>{if(typeof navigator>`u`||!(`userAgentData`in navigator))return null;let e=navigator.userAgentData;if(typeof e!=`object`||!e||!(`platform`in e))return null;let t=e.platform;return typeof t==`string`?t:null},qe=()=>{if(U===null){if(typeof navigator>`u`)return U=!1,U;let e=navigator.platform??Ke()??navigator.userAgent;U=/Mac|iPhone|iPad|iPod/i.test(e)}return U},Je=(t,n)=>{try{return t.composedPath().some(t=>e.Tt(t)&&t.hasAttribute(n))}catch{return!1}},W=e=>`${e}-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,G=`react-grab-toolbar-state`,Ye=()=>{try{let t=localStorage.getItem(G);if(!t)return null;let n=JSON.parse(t);if(typeof n!=`object`||!n)return null;let r=n,i=typeof r.collapsed==`boolean`?r.collapsed:!1;return{edge:r.edge===`top`||r.edge===`bottom`||r.edge===`left`||r.edge===`right`?r.edge:`bottom`,ratio:typeof r.ratio==`number`?r.ratio:e.hn,collapsed:i,enabled:!i,defaultAction:typeof r.defaultAction==`string`?r.defaultAction:e.Mt}}catch(e){console.warn(`[react-grab] Failed to load toolbar state from localStorage:`,e)}return null},Xe=e=>{try{localStorage.setItem(G,JSON.stringify(e))}catch(e){console.warn(`[react-grab] Failed to save toolbar state to localStorage:`,e)}},K=`react-grab-comment-items`,q=60*1e3,J=60*q;24*J;const Y=new Set;let X=null;const Ze=e=>{if(typeof e.content!=`string`||typeof e.commentText!=`string`||typeof e.tagName!=`string`||typeof e.timestamp!=`number`||!Number.isFinite(e.timestamp))return null;let t=typeof e.componentName==`string`?e.componentName:typeof e.elementName==`string`?e.elementName:void 0;return{id:typeof e.id==`string`?e.id:W(`comment`),content:e.content,tagName:e.tagName,componentName:t,elementsCount:typeof e.elementsCount==`number`&&Number.isFinite(e.elementsCount)?Math.max(1,Math.floor(e.elementsCount)):1,elementSelectors:Array.isArray(e.elementSelectors)?e.elementSelectors.filter(e=>typeof e==`string`):[],commentText:e.commentText,timestamp:e.timestamp}},Qe=()=>{if(typeof window>`u`)return[];try{let e=sessionStorage.getItem(K);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.map(e=>Ze(e)).filter(e=>e!==null).slice(0,50):[]}catch{return[]}},Z=()=>(X??=Qe(),X),$e=e=>{let t=e;for(;t.length>0;){let e=JSON.stringify(t);if(new Blob([e]).size<=524288)return t;t=t.slice(0,-1)}return[]},Q=e=>{X=$e(e);try{sessionStorage.setItem(K,JSON.stringify(X))}catch{}for(let e of Y)e(X);return X},et=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),tt=()=>[...Z()],nt=e=>{let t=Z().filter(t=>t.commentText!==e.commentText||!et(t.elementSelectors,e.elementSelectors));return Q([{...e,id:W(`comment`)},...t].slice(0,50))},rt=e=>Q(Z().filter(t=>t.id!==e)),it=()=>Q([]),at=e=>(Y.add(e),()=>{Y.delete(e)}),ot=e=>e.key===`Enter`,st=e=>e.metaKey||e.ctrlKey,ct=(e,t,n={})=>{if(!t.key)return null;if(ot(t))return e.find(e=>e.shortcut===`Enter`)??null;if(t.repeat)return null;let r=t.key.toLowerCase();return st(t)?n.includeModifierShortcuts===!0?e.find(e=>e.shortcut!==void 0&&e.shortcut!==`Enter`&&e.shortcutModifier!==!1&&r===e.shortcut.toLowerCase())??null:null:e.find(e=>e.shortcut!==void 0&&e.shortcutModifier===!1&&r===e.shortcut.toLowerCase())??null},lt=e=>e??!0,$=(t,n)=>{if(typeof t.enabled==`function`){if(!n)return!1;try{return t.enabled(n)}catch(n){return e.l(new e.U(t.id,n)),!1}}return lt(t.enabled)},ut=(t,n)=>{if(!$(t,n))return!1;try{let r=t.onAction(n);r&&r.catch(n=>{e.l(new e.W(t.id,n))})}catch(n){e.l(new e.W(t.id,n))}return!0};Object.defineProperty(exports,`$`,{enumerable:!0,get:function(){return ee}}),Object.defineProperty(exports,`A`,{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,`B`,{enumerable:!0,get:function(){return pe}}),Object.defineProperty(exports,`C`,{enumerable:!0,get:function(){return ze}}),Object.defineProperty(exports,`D`,{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,`E`,{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,`F`,{enumerable:!0,get:function(){return je}}),Object.defineProperty(exports,`G`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`H`,{enumerable:!0,get:function(){return ce}}),Object.defineProperty(exports,`I`,{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,`J`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`K`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`L`,{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,`M`,{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(exports,`N`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`O`,{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,`P`,{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(exports,`Q`,{enumerable:!0,get:function(){return le}}),Object.defineProperty(exports,`R`,{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,`S`,{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(exports,`T`,{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(exports,`U`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`V`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`W`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`X`,{enumerable:!0,get:function(){return re}}),Object.defineProperty(exports,`Y`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`Z`,{enumerable:!0,get:function(){return oe}}),Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return Ge}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return it}}),Object.defineProperty(exports,`b`,{enumerable:!0,get:function(){return`data-react-grab`}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return at}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,`et`,{enumerable:!0,get:function(){return ne}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return qe}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return Je}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return nt}}),Object.defineProperty(exports,`it`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`j`,{enumerable:!0,get:function(){return we}}),Object.defineProperty(exports,`k`,{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return 864e5}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,`nt`,{enumerable:!0,get:function(){return ue}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return tt}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return Xe}}),Object.defineProperty(exports,`q`,{enumerable:!0,get:function(){return he}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return ct}}),Object.defineProperty(exports,`rt`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return rt}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return ut}}),Object.defineProperty(exports,`tt`,{enumerable:!0,get:function(){return te}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return Ue}}),Object.defineProperty(exports,`w`,{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,`x`,{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return He}}),Object.defineProperty(exports,`z`,{enumerable:!0,get:function(){return fe}});
|
|
9
|
+
const e=require(`./freeze-updates-DBBSRtAF.cjs`),t=Symbol(`error`);function n(e){return e instanceof Error?e:Error(typeof e==`string`?e:`Unknown error`,{cause:e})}function r(e,i=a){let o=i&&i.context&&i.context[t],s=n(e);if(!o)throw s;try{for(let e of o)e(s)}catch(e){r(e,i&&i.owner||null)}}const i={context:null,owner:null,owned:null,cleanups:null};let a=null;function o(){let e={owner:a,context:a?a.context:null,owned:null,cleanups:null};return a&&(a.owned?a.owned.push(e):a.owned=[e]),e}function s(e,t){let n=a,o=t===void 0?n:t,s=e.length===0?i:{context:o?o.context:null,owner:o,owned:null,cleanups:null};a=s;let c;try{c=e(e.length===0?()=>{}:()=>h(s))}catch(e){r(e)}finally{a=n}return c}function c(e,t){return[()=>e,t=>e=typeof t==`function`?t(e):t]}function l(e,t){a=o();try{e(t)}catch(e){r(e)}finally{a=a.owner}}const u=l;function d(e,t){}function f(e,t){a=o();let n;try{n=e(t)}catch(e){r(e)}finally{a=a.owner}return()=>n}function p(e){return e()}const m=p;function ee(e,t,n={}){let r=Array.isArray(e),i=n.defer;return()=>{if(i)return;let n;if(r){n=[];for(let t=0;t<e.length;t++)n.push(e[t]())}else n=e();return t(n)}}function te(e){}function ne(e){return a&&(a.cleanups?a.cleanups.push(e):a.cleanups=[e]),e}function h(e){if(e.owned){for(let t=0;t<e.owned.length;t++)h(e.owned[t]);e.owned=null}if(e.cleanups){for(let t=0;t<e.cleanups.length;t++)e.cleanups[t]();e.cleanups=null}}function g(e){let t=Symbol(`context`);return{id:t,Provider:ae(t),defaultValue:e}}function _(e){return a&&a.context&&a.context[e.id]!==void 0?a.context[e.id]:e.defaultValue}function re(){return a}function ie(e){let t=f(()=>v(e()));return t.toArray=()=>{let e=t();return Array.isArray(e)?e:e==null?[]:[e]},t}function v(e){if(typeof e==`function`&&!e.length)return v(e());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++){let r=v(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function ae(e){return function(t){return f(()=>(a.context={...a.context,[e]:t.value},ie(()=>t.children)))}}function oe(e,t,n={}){let r=e(),i=[];if(r&&r.length)for(let e=0,n=r.length;e<n;e++)i.push(t(r[e],()=>e));else n.fallback&&(i=[n.fallback()]);return()=>i}const y={context:void 0,getContextId(){if(!this.context)throw Error(`getContextId cannot be used under non-hydrating context`);return b(this.context.count)},getNextContextId(){if(!this.context)throw Error(`getNextContextId cannot be used under non-hydrating context`);return b(this.context.count++)}};function b(e){let t=String(e),n=t.length-1;return y.context.id+(n?String.fromCharCode(96+n):``)+t}function x(e){y.context=e}function se(){return y.context?{...y.context,id:y.getNextContextId(),count:0}:void 0}function ce(e,t){if(y.context&&!y.context.noHydrate){let n=y.context;x(se());let r=e(t||{});return x(n),r}return e(t||{})}function le(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`function`&&(r=r()),r){let n=Object.getOwnPropertyDescriptors(r);for(let r in n)r in t||Object.defineProperty(t,r,{enumerable:!0,get(){for(let t=e.length-1;t>=0;t--){let n,i=e[t];if(typeof i==`function`&&(i=i()),n=(i||{})[r],n!==void 0)return n}}})}}return t}function ue(e,...t){let n=Object.getOwnPropertyDescriptors(e),r=e=>{let t={};for(let r=0;r<e.length;r++){let i=e[r];n[i]&&(Object.defineProperty(t,i,n[i]),delete n[i])}return t};return t.map(r).concat(r(Object.keys(n)))}function de(e,t){let n=e.each||[],r=n.length,i=e.children;if(r){let e=Array(r);for(let a=0;a<r;a++)e[a]=t(i,n[a],a);return e}return e.fallback}function fe(e){return de(e,(e,t,n)=>e(t,()=>n))}function pe(e){let t;return e.when?typeof(t=e.children)==`function`?t(e.keyed?e.when:()=>e.when):t:e.fallback||``}const me=g();let S=null;function he(e,t,r={}){typeof t!=`function`&&(r=t||{},t=e,e=!0);let i=new Set,a=y.getNextContextId(),o={},s=r.storage?r.storage(r.initialValue)[0]():r.initialValue,c,l;if(y.context.async&&r.ssrLoadFrom!==`initial`&&(o=y.context.resources[a]||(y.context.resources[a]={}),o.ref))return!o.data&&!o.ref[0]._loading&&!o.ref[0].error&&o.ref[1].refetch(),o.ref;let u=()=>{if(l)throw l;let e=r.ssrLoadFrom!==`initial`&&y.context.async&&`data`in y.context.resources[a];if(!e&&S&&S.push(a),!e&&d._loading){let e=_(me);e&&(e.resources.set(a,d),i.add(e))}return e},d=()=>u()?y.context.resources[a].data:s,f=()=>(u(),d._loading);d._loading=!1,d.error=void 0,d.state=`initialValue`in r?`ready`:`unresolved`,Object.defineProperties(d,{latest:{get(){return d()}},loading:{get(){return f()}}});function p(){let o=y.context;if(!o.async)return d._loading=!!(typeof e==`function`?e():e);if(o.resources&&a in o.resources&&`data`in o.resources[a]){s=o.resources[a].data;return}let u;try{if(S=[],u=typeof e==`function`?e():e,S.length)return}finally{S=null}if(!c){if(u==null||u===!1)return;c=t(u,{value:s})}return typeof c==`object`&&c&&`then`in c?(d._loading=!0,d.state=`pending`,c=c.then(e=>(d._loading=!1,d.state=`ready`,o.resources[a].data=e,c=null,C(i),e)).catch(e=>{throw d._loading=!1,d.state=`errored`,d.error=l=n(e),c=null,C(i),l}),o.serialize&&o.serialize(a,c,r.deferStream),c):(o.resources[a].data=c,o.serialize&&o.serialize(a,c),c=null,o.resources[a].data)}r.ssrLoadFrom!==`initial`&&p();let m=[d,{refetch:p,mutate:e=>s=e}];return c&&(o.ref=m),m}function ge(e){for(let t of e.resources.values())if(t._loading)return!1;return!0}function C(e){for(let t of e)ge(t)&&(t.completed(),e.delete(t))}const _e=new Set([`className`,`value`,`readOnly`,`noValidate`,`formNoValidate`,`isMap`,`noModule`,`playsInline`,`adAuctionHeaders`,`allowFullscreen`,`browsingTopics`,`defaultChecked`,`defaultMuted`,`defaultSelected`,`disablePictureInPicture`,`disableRemotePlayback`,`preservesPitch`,`shadowRootClonable`,`shadowRootCustomElementRegistry`,`shadowRootDelegatesFocus`,`shadowRootSerializable`,`sharedStorageWritable`,...`allowfullscreen.async.alpha.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.hidden.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.adauctionheaders.browsingtopics.credentialless.defaultchecked.defaultmuted.defaultselected.defer.disablepictureinpicture.disableremoteplayback.preservespitch.shadowrootclonable.shadowrootcustomelementregistry.shadowrootdelegatesfocus.shadowrootserializable.sharedstoragewritable`.split(`.`)]),ve=new Set([`innerHTML`,`textContent`,`innerText`,`children`]),ye=Object.assign(Object.create(null),{className:`class`,htmlFor:`for`}),be=Object.assign(Object.create(null),{class:`className`,novalidate:{$:`noValidate`,FORM:1},formnovalidate:{$:`formNoValidate`,BUTTON:1,INPUT:1},ismap:{$:`isMap`,IMG:1},nomodule:{$:`noModule`,SCRIPT:1},playsinline:{$:`playsInline`,VIDEO:1},readonly:{$:`readOnly`,INPUT:1,TEXTAREA:1},adauctionheaders:{$:`adAuctionHeaders`,IFRAME:1},allowfullscreen:{$:`allowFullscreen`,IFRAME:1},browsingtopics:{$:`browsingTopics`,IMG:1},defaultchecked:{$:`defaultChecked`,INPUT:1},defaultmuted:{$:`defaultMuted`,AUDIO:1,VIDEO:1},defaultselected:{$:`defaultSelected`,OPTION:1},disablepictureinpicture:{$:`disablePictureInPicture`,VIDEO:1},disableremoteplayback:{$:`disableRemotePlayback`,AUDIO:1,VIDEO:1},preservespitch:{$:`preservesPitch`,AUDIO:1,VIDEO:1},shadowrootclonable:{$:`shadowRootClonable`,TEMPLATE:1},shadowrootdelegatesfocus:{$:`shadowRootDelegatesFocus`,TEMPLATE:1},shadowrootserializable:{$:`shadowRootSerializable`,TEMPLATE:1},sharedstoragewritable:{$:`sharedStorageWritable`,IFRAME:1,IMG:1}});function xe(e,t){let n=be[e];return typeof n==`object`?n[t]?n.$:void 0:n}const Se=new Set([`beforeinput`,`click`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`]),Ce={xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`},we=e=>f(()=>e());function Te(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,c=t[i-1].nextSibling,l=null;for(;o<i||s<a;){if(t[o]===n[s]){o++,s++;continue}for(;t[i-1]===n[a-1];)i--,a--;if(i===o){let t=a<r?s?n[s-1].nextSibling:n[a-s]:c;for(;s<a;)e.insertBefore(n[s++],t)}else if(a===s)for(;o<i;)(!l||!l.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){let r=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],r),t[i]=n[a]}else{if(!l){l=new Map;let e=s;for(;e<a;)l.set(n[e],e++)}let r=l.get(t[o]);if(r!=null)if(s<r&&r<a){let c=o,u=1,d;for(;++c<i&&c<a&&!((d=l.get(t[c]))==null||d!==r+u);)u++;if(u>r-s){let i=t[o];for(;s<r;)e.insertBefore(n[s++],i)}else e.replaceChild(n[s++],t[o++])}else o++;else t[o++].remove()}}}const w=`_$DX_DELEGATE`;function Ee(e,t,n,r={}){let i;return s(r=>{i=r,t===document?e():M(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=``}}function De(e,t,n,r){let i,a=()=>{let t=r?document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`template`):document.createElement(`template`);return t.innerHTML=e,n?t.content.firstChild.firstChild:r?t.firstChild:t.content.firstChild},o=t?()=>m(()=>document.importNode(i||=a(),!0)):()=>(i||=a()).cloneNode(!0);return o.cloneNode=o,o}function T(e,t=window.document){let n=t[w]||(t[w]=new Set);for(let r=0,i=e.length;r<i;r++){let i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,Pe))}}function E(e,t,n){N(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function Oe(e,t,n,r){N(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function ke(e,t,n){N(e)||(n?e.setAttribute(t,``):e.removeAttribute(t))}function D(e,t){N(e)||(t==null?e.removeAttribute(`class`):e.className=t)}function O(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){let r=n[0];e.addEventListener(t,n[0]=t=>r.call(e,n[1],t))}else e.addEventListener(t,n,typeof n!=`function`&&n)}function k(e,t,n={}){let r=Object.keys(t||{}),i=Object.keys(n),a,o;for(a=0,o=i.length;a<o;a++){let r=i[a];!r||r===`undefined`||t[r]||(P(e,r,!1),delete n[r])}for(a=0,o=r.length;a<o;a++){let i=r[a],o=!!t[i];!i||i===`undefined`||n[i]===o||!o||(P(e,i,!0),n[i]=o)}return n}function A(e,t,n){if(!t)return n?E(e,`style`):t;let r=e.style;if(typeof t==`string`)return r.cssText=t;typeof n==`string`&&(r.cssText=n=void 0),n||={},t||={};let i,a;for(a in n)t[a]??r.removeProperty(a),delete n[a];for(a in t)i=t[a],i!==n[a]&&(r.setProperty(a,i),n[a]=i);return n}function Ae(e,t,n){n==null?e.style.removeProperty(t):e.style.setProperty(t,n)}function je(e,t={},n,r){let i={};return r||u(()=>i.children=I(e,t.children,i.children)),u(()=>typeof t.ref==`function`&&j(t.ref,e)),u(()=>Me(e,t,n,!0,i,!0)),i}function j(e,t,n){return m(()=>e(t,n))}function M(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!=`function`)return I(e,t,r,n);u(r=>I(e,t(),r,n),r)}function Me(e,t,n,r,i={},a=!1){t||={};for(let r in i)if(!(r in t)){if(r===`children`)continue;i[r]=F(e,r,null,i[r],n,a,t)}for(let o in t){if(o===`children`){r||I(e,t.children);continue}let s=t[o];i[o]=F(e,o,s,i[o],n,a,t)}}function N(e){return!!y.context&&!y.done&&(!e||e.isConnected)}function Ne(e){return e.toLowerCase().replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function P(e,t,n){let r=t.trim().split(/\s+/);for(let t=0,i=r.length;t<i;t++)e.classList.toggle(r[t],n)}function F(e,t,n,r,i,a,o){let s,c,l,u,d;if(t===`style`)return A(e,n,r);if(t===`classList`)return k(e,n,r);if(n===r)return r;if(t===`ref`)a||n(e);else if(t.slice(0,3)===`on:`){let i=t.slice(3);r&&e.removeEventListener(i,r,typeof r!=`function`&&r),n&&e.addEventListener(i,n,typeof n!=`function`&&n)}else if(t.slice(0,10)===`oncapture:`){let i=t.slice(10);r&&e.removeEventListener(i,r,!0),n&&e.addEventListener(i,n,!0)}else if(t.slice(0,2)===`on`){let i=t.slice(2).toLowerCase(),a=Se.has(i);if(!a&&r){let t=Array.isArray(r)?r[0]:r;e.removeEventListener(i,t)}(a||n)&&(O(e,i,n,a),a&&T([i]))}else if(t.slice(0,5)===`attr:`)E(e,t.slice(5),n);else if(t.slice(0,5)===`bool:`)ke(e,t.slice(5),n);else if((d=t.slice(0,5)===`prop:`)||(l=ve.has(t))||!i&&((u=xe(t,e.tagName))||(c=_e.has(t)))||(s=e.nodeName.includes(`-`)||`is`in o)){if(d)t=t.slice(5),c=!0;else if(N(e))return n;t===`class`||t===`className`?D(e,n):s&&!c&&!l?e[Ne(t)]=n:e[u||t]=n}else{let r=i&&t.indexOf(`:`)>-1&&Ce[t.split(`:`)[0]];r?Oe(e,r,t,n):E(e,ye[t]||t,n)}return n}function Pe(e){if(y.registry&&y.events&&y.events.find(([t,n])=>n===e))return;let t=e.target,n=`$$${e.type}`,r=e.target,i=e.currentTarget,a=t=>Object.defineProperty(e,`target`,{configurable:!0,value:t}),o=()=>{let r=t[n];if(r&&!t.disabled){let i=t[`${n}Data`];if(i===void 0?r.call(t,e):r.call(t,i,e),e.cancelBubble)return}return t.host&&typeof t.host!=`string`&&!t.host._$host&&t.contains(e.target)&&a(t.host),!0},s=()=>{for(;o()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,`currentTarget`,{configurable:!0,get(){return t||document}}),y.registry&&!y.done&&(y.done=_$HY.done=!0),e.composedPath){let n=e.composedPath();a(n[0]);for(let e=0;e<n.length-2&&(t=n[e],o());e++){if(t._$host){t=t._$host,s();break}if(t.parentNode===i)break}}else s();a(r)}function I(e,t,n,r,i){let a=N(e);if(a){!n&&(n=[...e.childNodes]);let t=[];for(let e=0;e<n.length;e++){let r=n[e];r.nodeType===8&&r.data.slice(0,2)===`!$`?r.remove():t.push(r)}n=t}for(;typeof n==`function`;)n=n();if(t===n)return n;let o=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o===`string`||o===`number`){if(a||o===`number`&&(t=t.toString(),t===n))return n;if(s){let i=n[0];i&&i.nodeType===3?i.data!==t&&(i.data=t):i=document.createTextNode(t),n=z(e,n,r,i)}else n=n!==``&&typeof n==`string`?e.firstChild.data=t:e.textContent=t}else if(t==null||o===`boolean`){if(a)return n;n=z(e,n,r)}else if(o===`function`)return u(()=>{let i=t();for(;typeof i==`function`;)i=i();n=I(e,i,n,r)}),()=>n;else if(Array.isArray(t)){let o=[],c=n&&Array.isArray(n);if(L(o,t,n,i))return u(()=>n=I(e,o,n,r,!0)),()=>n;if(a){if(!o.length)return n;if(r===void 0)return n=[...e.childNodes];let t=o[0];if(t.parentNode!==e)return n;let i=[t];for(;(t=t.nextSibling)!==r;)i.push(t);return n=i}if(o.length===0){if(n=z(e,n,r),s)return n}else c?n.length===0?R(e,o,r):Te(e,n,o):(n&&z(e),R(e,o));n=o}else if(t.nodeType){if(a&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=z(e,n,r,t);z(e,n,null,t)}else n==null||n===``||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}return n}function L(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let o=t[a],s=n&&n[e.length],c;if(!(o==null||o===!0||o===!1))if((c=typeof o)==`object`&&o.nodeType)e.push(o);else if(Array.isArray(o))i=L(e,o,s)||i;else if(c===`function`)if(r){for(;typeof o==`function`;)o=o();i=L(e,Array.isArray(o)?o:[o],Array.isArray(s)?s:[s])||i}else e.push(o),i=!0;else{let t=String(o);s&&s.nodeType===3&&s.data===t?e.push(s):e.push(document.createTextNode(t))}}return i}function R(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function z(e,t,n,r){if(n===void 0)return e.textContent=``;let i=r||document.createTextNode(``);if(t.length){let r=!1;for(let a=t.length-1;a>=0;a--){let o=t[a];if(i!==o){let t=o.parentNode===e;!r&&!a?t?e.replaceChild(i,o):e.insertBefore(i,n):t&&o.remove()}else r=!0}}else e.insertBefore(i,n);return[i]}function Fe(e){let{useShadow:t}=e,n=document.createTextNode(``);return y.context,n}const Ie=t=>{if(!t)return!1;let n=e.at(t);return n?n.isConnected():!!(t.isConnected||t.ownerDocument?.contains(t))},Le=[`input`,`textarea`,`select`,`searchbox`,`slider`,`spinbutton`,`menuitem`,`menuitemcheckbox`,`menuitemradio`,`option`,`radio`,`textbox`,`combobox`],Re=e=>{if(e.composed){let t=e.composedPath()[0];if(t instanceof HTMLElement)return t}else if(e.target instanceof HTMLElement)return e.target},ze=t=>{if(document.designMode===`on`)return!0;let n=Re(t);if(!n)return!1;if(n.isContentEditable)return!0;let r=e.H(n);return Le.some(e=>e===r||e===n.role)},Be=e=>{let t=e.target;if(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement){let e=t.selectionStart??0;return(t.selectionEnd??0)-e>0}return!1},Ve=()=>{let e=window.getSelection();return e?e.toString().length>0:!1},He=(e,t,n)=>Math.max(t,Math.min(e,n)),B={width:0,height:0,offsetLeft:0,offsetTop:0};let V=null,H=-1/0;const Ue=()=>{H=-1/0},We=e=>{if(e){let t=e.getBoundingClientRect();B.width=t.width,B.height=t.height,B.offsetLeft=t.left,B.offsetTop=t.top;return}let t=window.visualViewport;B.width=t?.width??window.innerWidth,B.height=t?.height??window.innerHeight,B.offsetLeft=t?.offsetLeft??0,B.offsetTop=t?.offsetTop??0},Ge=()=>{let t=e.N(),n=performance.now();return(t!==V||n-H>=16)&&(V=t,H=n,We(t)),{width:B.width,height:B.height,offsetLeft:B.offsetLeft,offsetTop:B.offsetTop}};let U=null;const Ke=()=>{if(typeof navigator>`u`||!(`userAgentData`in navigator))return null;let e=navigator.userAgentData;if(typeof e!=`object`||!e||!(`platform`in e))return null;let t=e.platform;return typeof t==`string`?t:null},qe=()=>{if(U===null){if(typeof navigator>`u`)return U=!1,U;let e=navigator.platform??Ke()??navigator.userAgent;U=/Mac|iPhone|iPad|iPod/i.test(e)}return U},Je=(t,n)=>{try{return t.composedPath().some(t=>e.Tt(t)&&t.hasAttribute(n))}catch{return!1}},W=e=>`${e}-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,G=`react-grab-toolbar-state`,Ye=()=>{try{let t=localStorage.getItem(G);if(!t)return null;let n=JSON.parse(t);if(typeof n!=`object`||!n)return null;let r=n,i=typeof r.collapsed==`boolean`?r.collapsed:!1;return{edge:r.edge===`top`||r.edge===`bottom`||r.edge===`left`||r.edge===`right`?r.edge:`bottom`,ratio:typeof r.ratio==`number`?r.ratio:e.hn,collapsed:i,enabled:!i,defaultAction:typeof r.defaultAction==`string`?r.defaultAction:e.Mt}}catch(e){console.warn(`[react-grab] Failed to load toolbar state from localStorage:`,e)}return null},Xe=e=>{try{localStorage.setItem(G,JSON.stringify(e))}catch(e){console.warn(`[react-grab] Failed to save toolbar state to localStorage:`,e)}},K=`react-grab-comment-items`,q=60*1e3,J=60*q;24*J;const Y=new Set;let X=null;const Ze=e=>{if(typeof e.content!=`string`||typeof e.commentText!=`string`||typeof e.tagName!=`string`||typeof e.timestamp!=`number`||!Number.isFinite(e.timestamp))return null;let t=typeof e.componentName==`string`?e.componentName:typeof e.elementName==`string`?e.elementName:void 0;return{id:typeof e.id==`string`?e.id:W(`comment`),content:e.content,tagName:e.tagName,componentName:t,elementsCount:typeof e.elementsCount==`number`&&Number.isFinite(e.elementsCount)?Math.max(1,Math.floor(e.elementsCount)):1,elementSelectors:Array.isArray(e.elementSelectors)?e.elementSelectors.filter(e=>typeof e==`string`):[],commentText:e.commentText,timestamp:e.timestamp}},Qe=()=>{if(typeof window>`u`)return[];try{let e=sessionStorage.getItem(K);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t.map(e=>Ze(e)).filter(e=>e!==null).slice(0,50):[]}catch{return[]}},Z=()=>(X??=Qe(),X),$e=e=>{let t=e;for(;t.length>0;){let e=JSON.stringify(t);if(new Blob([e]).size<=524288)return t;t=t.slice(0,-1)}return[]},Q=e=>{X=$e(e);try{sessionStorage.setItem(K,JSON.stringify(X))}catch{}for(let e of Y)e(X);return X},et=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),tt=()=>[...Z()],nt=e=>{let t=Z().filter(t=>t.commentText!==e.commentText||!et(t.elementSelectors,e.elementSelectors));return Q([{...e,id:W(`comment`)},...t].slice(0,50))},rt=e=>Q(Z().filter(t=>t.id!==e)),it=()=>Q([]),at=e=>(Y.add(e),()=>{Y.delete(e)}),ot=e=>e.key===`Enter`,st=e=>e.metaKey||e.ctrlKey,ct=(e,t,n={})=>{if(!t.key)return null;if(ot(t))return e.find(e=>e.shortcut===`Enter`)??null;if(t.repeat)return null;let r=t.key.toLowerCase();return st(t)?n.includeModifierShortcuts===!0?e.find(e=>e.shortcut!==void 0&&e.shortcut!==`Enter`&&e.shortcutModifier!==!1&&r===e.shortcut.toLowerCase())??null:null:e.find(e=>e.shortcut!==void 0&&e.shortcutModifier===!1&&r===e.shortcut.toLowerCase())??null},lt=e=>e??!0,$=(t,n)=>{if(typeof t.enabled==`function`){if(!n)return!1;try{return t.enabled(n)}catch(n){return e.l(new e.U(t.id,n)),!1}}return lt(t.enabled)},ut=(t,n)=>{if(!$(t,n))return!1;try{let r=t.onAction(n);r&&r.catch(n=>{e.l(new e.W(t.id,n))})}catch(n){e.l(new e.W(t.id,n))}return!0};Object.defineProperty(exports,`$`,{enumerable:!0,get:function(){return ee}}),Object.defineProperty(exports,`A`,{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,`B`,{enumerable:!0,get:function(){return pe}}),Object.defineProperty(exports,`C`,{enumerable:!0,get:function(){return ze}}),Object.defineProperty(exports,`D`,{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,`E`,{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,`F`,{enumerable:!0,get:function(){return je}}),Object.defineProperty(exports,`G`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`H`,{enumerable:!0,get:function(){return ce}}),Object.defineProperty(exports,`I`,{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,`J`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`K`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`L`,{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,`M`,{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(exports,`N`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`O`,{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,`P`,{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(exports,`Q`,{enumerable:!0,get:function(){return le}}),Object.defineProperty(exports,`R`,{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,`S`,{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(exports,`T`,{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(exports,`U`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`V`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`W`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`X`,{enumerable:!0,get:function(){return re}}),Object.defineProperty(exports,`Y`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`Z`,{enumerable:!0,get:function(){return oe}}),Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return Ge}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return it}}),Object.defineProperty(exports,`b`,{enumerable:!0,get:function(){return`data-react-grab`}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return at}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,`et`,{enumerable:!0,get:function(){return ne}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return qe}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return Je}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return nt}}),Object.defineProperty(exports,`it`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`j`,{enumerable:!0,get:function(){return we}}),Object.defineProperty(exports,`k`,{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return 864e5}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,`nt`,{enumerable:!0,get:function(){return ue}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return tt}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return Xe}}),Object.defineProperty(exports,`q`,{enumerable:!0,get:function(){return he}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return ct}}),Object.defineProperty(exports,`rt`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return rt}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return ut}}),Object.defineProperty(exports,`tt`,{enumerable:!0,get:function(){return te}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return Ue}}),Object.defineProperty(exports,`w`,{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,`x`,{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return He}}),Object.defineProperty(exports,`z`,{enumerable:!0,get:function(){return fe}});
|