"use strict";const a=require("./hooks-Eb94kuDd.cjs"),e=require("./Text-DW5FpCk9.cjs"),m=require("./jsx-runtime-nZSsnGb7.cjs"),o=require("react"),S=require("./Editable-C-z-stcD.cjs"),u=require("./css-D3NdC2sx.cjs");require("./types-C0tUDfsz.cjs");const _=t=>{const{listen:i}=e.useContext(),[g,l]=o.useState([]);return o.useEffect(()=>i(({next:[r]})=>l(r??[])),[i,l]),m.jsxRuntimeExports.jsx(S.Text,{...t,children:g.join(" ")})},d=({onDrag:t,triggers:i=[["MouseLeft"],["MouseRight"]],bound:g,loose:l=!1})=>{const r=o.useRef(null),E=o.useRef(u.Au.ZERO),M=o.useCallback(s=>{const n=u.Au.construct(s);if(r.current===null)return;const{triggers:c}=r.current;t({box:u.Eu.construct(E.current,n),cursor:n,triggers:c,stage:"during"})},[t]),f=o.useCallback(s=>{const{stage:n,cursor:c}=s;n==="start"?(t({box:u.Eu.construct(c),...s}),window.addEventListener("mousemove",M),r.current=s,E.current=c):n==="end"&&r.current!=null&&(t({box:u.Eu.construct(E.current,c),...s}),window.removeEventListener("mousemove",M),r.current=null,E.current=u.Au.ZERO)},[t]);a.use({triggers:i,callback:f,region:g,loose:l})},R=Object.freeze(Object.defineProperty({__proto__:null,ALPHANUMERIC_KEYS:e.ALPHANUMERIC_KEYS,ALPHANUMERIC_KEYS_SET:e.ALPHANUMERIC_KEYS_SET,KEYS:e.KEYS,MOUSE_KEYS:e.MOUSE_KEYS,MOUSE_LEFT_NUMBER:e.MOUSE_LEFT_NUMBER,MOUSE_MIDDLE_NUMBER:e.MOUSE_MIDDLE_NUMBER,MOUSE_RIGHT_NUMBER:e.MOUSE_RIGHT_NUMBER,Provider:e.Provider,Status:_,Text:e.Text,compareModeConfigs:e.compareModeConfigs,determineMode:e.determineMode,diff:e.diff,eventKey:e.eventKey,filter:e.filter,flattenConfig:e.flattenConfig,isAlphanumericKey:e.isAlphanumericKey,keyZ:e.keyZ,keyboardKey:e.keyboardKey,match:e.match,matchCallback:e.matchCallback,mouseKey:e.mouseKey,mouseKeyZ:e.mouseKeyZ,purge:e.purge,purgeMouse:e.purgeMouse,toSymbols:e.toSymbols,triggerZ:e.triggerZ,use:a.use,useContext:e.useContext,useDrag:d,useFlattenedMemoConfig:e.useFlattenedMemoConfig,useHeld:a.useHeld,useHeldRef:a.useHeldRef},Symbol.toStringTag,{value:"Module"}));exports.external=R;exports.useDrag=d;
