"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var src_exports = {};
__export(src_exports, {
  Arc2d: () => import_Arc2d.Arc2d,
  BaseBoxShapeTool: () => import_BaseBoxShapeTool.BaseBoxShapeTool,
  BaseBoxShapeUtil: () => import_BaseBoxShapeUtil.BaseBoxShapeUtil,
  BindingUtil: () => import_BindingUtil.BindingUtil,
  BoundsSnaps: () => import_BoundsSnaps.BoundsSnaps,
  Box: () => import_Box.Box,
  Circle2d: () => import_Circle2d.Circle2d,
  ClickManager: () => import_ClickManager.ClickManager,
  ContainerProvider: () => import_useContainer.ContainerProvider,
  CubicBezier2d: () => import_CubicBezier2d.CubicBezier2d,
  CubicSpline2d: () => import_CubicSpline2d.CubicSpline2d,
  DEFAULT_ANIMATION_OPTIONS: () => import_constants.DEFAULT_ANIMATION_OPTIONS,
  DEFAULT_CAMERA_OPTIONS: () => import_constants.DEFAULT_CAMERA_OPTIONS,
  DefaultBackground: () => import_DefaultBackground.DefaultBackground,
  DefaultBrush: () => import_DefaultBrush.DefaultBrush,
  DefaultCanvas: () => import_DefaultCanvas.DefaultCanvas,
  DefaultCollaboratorHint: () => import_DefaultCollaboratorHint.DefaultCollaboratorHint,
  DefaultCursor: () => import_DefaultCursor.DefaultCursor,
  DefaultErrorFallback: () => import_DefaultErrorFallback.DefaultErrorFallback,
  DefaultGrid: () => import_DefaultGrid.DefaultGrid,
  DefaultHandle: () => import_DefaultHandle.DefaultHandle,
  DefaultHandles: () => import_DefaultHandles.DefaultHandles,
  DefaultScribble: () => import_DefaultScribble.DefaultScribble,
  DefaultSelectionBackground: () => import_DefaultSelectionBackground.DefaultSelectionBackground,
  DefaultSelectionForeground: () => import_DefaultSelectionForeground.DefaultSelectionForeground,
  DefaultShapeIndicator: () => import_DefaultShapeIndicator.DefaultShapeIndicator,
  DefaultShapeIndicators: () => import_DefaultShapeIndicators.DefaultShapeIndicators,
  DefaultSnapIndicator: () => import_DefaultSnapIndictor.DefaultSnapIndicator,
  DefaultSpinner: () => import_DefaultSpinner.DefaultSpinner,
  DefaultSvgDefs: () => import_DefaultSvgDefs.DefaultSvgDefs,
  EASINGS: () => import_easings.EASINGS,
  EMPTY_ARRAY: () => import_state.EMPTY_ARRAY,
  EVENT_NAME_MAP: () => import_event_types.EVENT_NAME_MAP,
  Edge2d: () => import_Edge2d.Edge2d,
  EdgeScrollManager: () => import_EdgeScrollManager.EdgeScrollManager,
  Editor: () => import_Editor.Editor,
  EditorContext: () => import_useEditor.EditorContext,
  EffectScheduler: () => import_state.EffectScheduler,
  Ellipse2d: () => import_Ellipse2d.Ellipse2d,
  ErrorBoundary: () => import_ErrorBoundary.ErrorBoundary,
  ErrorScreen: () => import_TldrawEditor.ErrorScreen,
  Geometry2d: () => import_Geometry2d.Geometry2d,
  Group2d: () => import_Group2d.Group2d,
  GroupShapeUtil: () => import_GroupShapeUtil.GroupShapeUtil,
  HALF_PI: () => import_utils2.HALF_PI,
  HTMLContainer: () => import_HTMLContainer.HTMLContainer,
  HandleSnaps: () => import_HandleSnaps.HandleSnaps,
  HistoryManager: () => import_HistoryManager.HistoryManager,
  LicenseManager: () => import_LicenseManager.LicenseManager,
  LoadingScreen: () => import_TldrawEditor.LoadingScreen,
  Mat: () => import_Mat.Mat,
  MenuClickCapture: () => import_MenuClickCapture.MenuClickCapture,
  OptionalErrorBoundary: () => import_ErrorBoundary.OptionalErrorBoundary,
  PI: () => import_utils2.PI,
  PI2: () => import_utils2.PI2,
  Point2d: () => import_Point2d.Point2d,
  Polygon2d: () => import_Polygon2d.Polygon2d,
  Polyline2d: () => import_Polyline2d.Polyline2d,
  ROTATE_CORNER_TO_SELECTION_CORNER: () => import_Box.ROTATE_CORNER_TO_SELECTION_CORNER,
  ReadonlySharedStyleMap: () => import_SharedStylesMap.ReadonlySharedStyleMap,
  Rectangle2d: () => import_Rectangle2d.Rectangle2d,
  SIDES: () => import_constants.SIDES,
  SIN: () => import_utils2.SIN,
  SVGContainer: () => import_SVGContainer.SVGContainer,
  ScribbleManager: () => import_ScribbleManager.ScribbleManager,
  ShapeUtil: () => import_ShapeUtil.ShapeUtil,
  SharedStyleMap: () => import_SharedStylesMap.SharedStyleMap,
  SnapManager: () => import_SnapManager.SnapManager,
  Stadium2d: () => import_Stadium2d.Stadium2d,
  StateNode: () => import_StateNode.StateNode,
  TAB_ID: () => import_TLSessionStateSnapshot.TAB_ID,
  TextManager: () => import_TextManager.TextManager,
  TldrawEditor: () => import_TldrawEditor.TldrawEditor,
  USER_COLORS: () => import_TLUserPreferences.USER_COLORS,
  UserPreferencesManager: () => import_UserPreferencesManager.UserPreferencesManager,
  Vec: () => import_Vec.Vec,
  angleDistance: () => import_utils2.angleDistance,
  applyRotationToSnapshotShapes: () => import_rotation.applyRotationToSnapshotShapes,
  approximately: () => import_utils2.approximately,
  areAnglesCompatible: () => import_utils2.areAnglesCompatible,
  atom: () => import_state.atom,
  average: () => import_utils2.average,
  canonicalizeRotation: () => import_utils2.canonicalizeRotation,
  centerOfCircleFromThreePoints: () => import_utils2.centerOfCircleFromThreePoints,
  clamp: () => import_utils2.clamp,
  clampRadians: () => import_utils2.clampRadians,
  clockwiseAngleDist: () => import_utils2.clockwiseAngleDist,
  computed: () => import_state.computed,
  coreShapes: () => import_defaultShapes.coreShapes,
  counterClockwiseAngleDist: () => import_utils2.counterClockwiseAngleDist,
  createDeepLinkString: () => import_deepLinks.createDeepLinkString,
  createSessionStateSnapshotSignal: () => import_TLSessionStateSnapshot.createSessionStateSnapshotSignal,
  createTLSchemaFromUtils: () => import_createTLStore.createTLSchemaFromUtils,
  createTLStore: () => import_createTLStore.createTLStore,
  createTLUser: () => import_createTLUser.createTLUser,
  dataUrlToFile: () => import_assets.dataUrlToFile,
  debugEnableLicensing: () => debugEnableLicensing,
  debugFlags: () => import_debug_flags.debugFlags,
  defaultTldrawOptions: () => import_options.defaultTldrawOptions,
  defaultUserPreferences: () => import_TLUserPreferences.defaultUserPreferences,
  degreesToRadians: () => import_utils2.degreesToRadians,
  extractSessionStateFromLegacySnapshot: () => import_TLSessionStateSnapshot.extractSessionStateFromLegacySnapshot,
  featureFlags: () => import_debug_flags.featureFlags,
  getArcMeasure: () => import_utils2.getArcMeasure,
  getCursor: () => import_useCursor.getCursor,
  getDefaultCdnBaseUrl: () => import_assets.getDefaultCdnBaseUrl,
  getFreshUserPreferences: () => import_TLUserPreferences.getFreshUserPreferences,
  getIncrementedName: () => import_getIncrementedName.getIncrementedName,
  getPerfectDashProps: () => import_getPerfectDashProps.getPerfectDashProps,
  getPointInArcT: () => import_utils2.getPointInArcT,
  getPointOnCircle: () => import_utils2.getPointOnCircle,
  getPointerInfo: () => import_getPointerInfo.getPointerInfo,
  getPointsOnArc: () => import_utils2.getPointsOnArc,
  getPolygonVertices: () => import_utils2.getPolygonVertices,
  getRotationSnapshot: () => import_rotation.getRotationSnapshot,
  getSnapshot: () => import_TLEditorSnapshot.getSnapshot,
  getSvgPathFromPoints: () => import_getSvgPathFromPoints.getSvgPathFromPoints,
  getUserPreferences: () => import_TLUserPreferences.getUserPreferences,
  hardReset: () => import_hardReset.hardReset,
  hardResetEditor: () => import_hardResetEditor.hardResetEditor,
  inlineBase64AssetStore: () => import_createTLStore.inlineBase64AssetStore,
  intersectCircleCircle: () => import_intersect.intersectCircleCircle,
  intersectCirclePolygon: () => import_intersect.intersectCirclePolygon,
  intersectCirclePolyline: () => import_intersect.intersectCirclePolyline,
  intersectLineSegmentCircle: () => import_intersect.intersectLineSegmentCircle,
  intersectLineSegmentLineSegment: () => import_intersect.intersectLineSegmentLineSegment,
  intersectLineSegmentPolygon: () => import_intersect.intersectLineSegmentPolygon,
  intersectLineSegmentPolyline: () => import_intersect.intersectLineSegmentPolyline,
  intersectPolygonBounds: () => import_intersect.intersectPolygonBounds,
  intersectPolygonPolygon: () => import_intersect.intersectPolygonPolygon,
  isAccelKey: () => import_keyboard.isAccelKey,
  isSafeFloat: () => import_utils2.isSafeFloat,
  linesIntersect: () => import_intersect.linesIntersect,
  loadSessionStateSnapshotIntoStore: () => import_TLSessionStateSnapshot.loadSessionStateSnapshotIntoStore,
  loadSnapshot: () => import_TLEditorSnapshot.loadSnapshot,
  loopToHtmlElement: () => import_dom.loopToHtmlElement,
  maybeSnapToGrid: () => import_Pointing.maybeSnapToGrid,
  normalizeWheel: () => import_normalizeWheel.normalizeWheel,
  openWindow: () => import_window_open.openWindow,
  parseDeepLinkString: () => import_deepLinks.parseDeepLinkString,
  perimeterOfEllipse: () => import_utils2.perimeterOfEllipse,
  pointInPolygon: () => import_utils2.pointInPolygon,
  polygonIntersectsPolyline: () => import_intersect.polygonIntersectsPolyline,
  polygonsIntersect: () => import_intersect.polygonsIntersect,
  precise: () => import_utils2.precise,
  preventDefault: () => import_dom.preventDefault,
  radiansToDegrees: () => import_utils2.radiansToDegrees,
  rangeIntersection: () => import_utils2.rangeIntersection,
  react: () => import_state.react,
  refreshPage: () => import_refreshPage.refreshPage,
  releasePointerCapture: () => import_dom.releasePointerCapture,
  resizeBox: () => import_resizeBox.resizeBox,
  rotateSelectionHandle: () => import_Box.rotateSelectionHandle,
  runtime: () => import_runtime.runtime,
  sanitizeId: () => import_useSafeId.sanitizeId,
  setPointerCapture: () => import_dom.setPointerCapture,
  setRuntimeOverrides: () => import_runtime.setRuntimeOverrides,
  setUserPreferences: () => import_TLUserPreferences.setUserPreferences,
  shortAngleDist: () => import_utils2.shortAngleDist,
  snapAngle: () => import_utils2.snapAngle,
  stopEventPropagation: () => import_dom.stopEventPropagation,
  suffixSafeId: () => import_useSafeId.suffixSafeId,
  tlenv: () => import_environment.tlenv,
  tlmenus: () => import_menus.tlmenus,
  tltime: () => import_time.tltime,
  toDomPrecision: () => import_utils2.toDomPrecision,
  toFixed: () => import_utils2.toFixed,
  toPrecision: () => import_utils2.toPrecision,
  track: () => import_state_react.track,
  transact: () => import_state.transact,
  transaction: () => import_state.transaction,
  uniq: () => import_uniq.uniq,
  useAtom: () => import_state_react.useAtom,
  useComputed: () => import_state_react.useComputed,
  useContainer: () => import_useContainer.useContainer,
  useContainerIfExists: () => import_useContainer.useContainerIfExists,
  useDelaySvgExport: () => import_SvgExportContext.useDelaySvgExport,
  useEditor: () => import_useEditor.useEditor,
  useEditorComponents: () => import_useEditorComponents.useEditorComponents,
  useEvent: () => import_useEvent.useEvent,
  useGlobalMenuIsOpen: () => import_useGlobalMenuIsOpen.useGlobalMenuIsOpen,
  useIsCropping: () => import_useIsCropping.useIsCropping,
  useIsDarkMode: () => import_useIsDarkMode.useIsDarkMode,
  useIsEditing: () => import_useIsEditing.useIsEditing,
  useLocalStore: () => import_useLocalStore.useLocalStore,
  useMaybeEditor: () => import_useEditor.useMaybeEditor,
  useOnMount: () => import_TldrawEditor.useOnMount,
  usePassThroughWheelEvents: () => import_usePassThroughWheelEvents.usePassThroughWheelEvents,
  usePeerIds: () => import_usePeerIds.usePeerIds,
  usePresence: () => import_usePresence.usePresence,
  useQuickReactor: () => import_state_react.useQuickReactor,
  useReactor: () => import_state_react.useReactor,
  useRefState: () => import_useRefState.useRefState,
  useSelectionEvents: () => import_useSelectionEvents.useSelectionEvents,
  useShallowArrayIdentity: () => import_useIdentity.useShallowArrayIdentity,
  useShallowObjectIdentity: () => import_useIdentity.useShallowObjectIdentity,
  useSharedSafeId: () => import_useSafeId.useSharedSafeId,
  useStateTracking: () => import_state_react.useStateTracking,
  useSvgExportContext: () => import_SvgExportContext.useSvgExportContext,
  useTLSchemaFromUtils: () => import_useTLStore.useTLSchemaFromUtils,
  useTLStore: () => import_useTLStore.useTLStore,
  useTldrawUser: () => import_createTLUser.useTldrawUser,
  useTransform: () => import_useTransform.useTransform,
  useUniqueSafeId: () => import_useSafeId.useUniqueSafeId,
  useValue: () => import_state_react.useValue,
  userTypeValidator: () => import_TLUserPreferences.userTypeValidator,
  whyAmIRunning: () => import_state.whyAmIRunning
});
module.exports = __toCommonJS(src_exports);
var import_utils = require("@tldraw/utils");
var import_at = require("core-js/stable/array/at.js");
var import_flat_map = require("core-js/stable/array/flat-map.js");
var import_flat = require("core-js/stable/array/flat.js");
var import_at2 = require("core-js/stable/string/at.js");
var import_replace_all = require("core-js/stable/string/replace-all.js");
var import_state = require("@tldraw/state");
var import_state_react = require("@tldraw/state-react");
__reExport(src_exports, require("@tldraw/store"), module.exports);
__reExport(src_exports, require("@tldraw/tlschema"), module.exports);
__reExport(src_exports, require("@tldraw/utils"), module.exports);
__reExport(src_exports, require("@tldraw/validate"), module.exports);
var import_TldrawEditor = require("./lib/TldrawEditor");
var import_ErrorBoundary = require("./lib/components/ErrorBoundary");
var import_HTMLContainer = require("./lib/components/HTMLContainer");
var import_MenuClickCapture = require("./lib/components/MenuClickCapture");
var import_SVGContainer = require("./lib/components/SVGContainer");
var import_DefaultBackground = require("./lib/components/default-components/DefaultBackground");
var import_DefaultBrush = require("./lib/components/default-components/DefaultBrush");
var import_DefaultCanvas = require("./lib/components/default-components/DefaultCanvas");
var import_DefaultCollaboratorHint = require("./lib/components/default-components/DefaultCollaboratorHint");
var import_DefaultCursor = require("./lib/components/default-components/DefaultCursor");
var import_DefaultErrorFallback = require("./lib/components/default-components/DefaultErrorFallback");
var import_DefaultGrid = require("./lib/components/default-components/DefaultGrid");
var import_DefaultHandle = require("./lib/components/default-components/DefaultHandle");
var import_DefaultHandles = require("./lib/components/default-components/DefaultHandles");
var import_DefaultScribble = require("./lib/components/default-components/DefaultScribble");
var import_DefaultSelectionBackground = require("./lib/components/default-components/DefaultSelectionBackground");
var import_DefaultSelectionForeground = require("./lib/components/default-components/DefaultSelectionForeground");
var import_DefaultShapeIndicator = require("./lib/components/default-components/DefaultShapeIndicator");
var import_DefaultShapeIndicators = require("./lib/components/default-components/DefaultShapeIndicators");
var import_DefaultSnapIndictor = require("./lib/components/default-components/DefaultSnapIndictor");
var import_DefaultSpinner = require("./lib/components/default-components/DefaultSpinner");
var import_DefaultSvgDefs = require("./lib/components/default-components/DefaultSvgDefs");
var import_TLEditorSnapshot = require("./lib/config/TLEditorSnapshot");
var import_TLSessionStateSnapshot = require("./lib/config/TLSessionStateSnapshot");
var import_TLUserPreferences = require("./lib/config/TLUserPreferences");
var import_createTLStore = require("./lib/config/createTLStore");
var import_createTLUser = require("./lib/config/createTLUser");
var import_defaultShapes = require("./lib/config/defaultShapes");
var import_constants = require("./lib/constants");
var import_Editor = require("./lib/editor/Editor");
var import_BindingUtil = require("./lib/editor/bindings/BindingUtil");
var import_ClickManager = require("./lib/editor/managers/ClickManager");
var import_EdgeScrollManager = require("./lib/editor/managers/EdgeScrollManager");
var import_HistoryManager = require("./lib/editor/managers/HistoryManager");
var import_ScribbleManager = require("./lib/editor/managers/ScribbleManager");
var import_BoundsSnaps = require("./lib/editor/managers/SnapManager/BoundsSnaps");
var import_HandleSnaps = require("./lib/editor/managers/SnapManager/HandleSnaps");
var import_SnapManager = require("./lib/editor/managers/SnapManager/SnapManager");
var import_TextManager = require("./lib/editor/managers/TextManager");
var import_UserPreferencesManager = require("./lib/editor/managers/UserPreferencesManager");
var import_BaseBoxShapeUtil = require("./lib/editor/shapes/BaseBoxShapeUtil");
var import_ShapeUtil = require("./lib/editor/shapes/ShapeUtil");
var import_GroupShapeUtil = require("./lib/editor/shapes/group/GroupShapeUtil");
var import_getPerfectDashProps = require("./lib/editor/shapes/shared/getPerfectDashProps");
var import_resizeBox = require("./lib/editor/shapes/shared/resizeBox");
var import_BaseBoxShapeTool = require("./lib/editor/tools/BaseBoxShapeTool/BaseBoxShapeTool");
var import_Pointing = require("./lib/editor/tools/BaseBoxShapeTool/children/Pointing");
var import_StateNode = require("./lib/editor/tools/StateNode");
var import_SvgExportContext = require("./lib/editor/types/SvgExportContext");
var import_event_types = require("./lib/editor/types/event-types");
var import_environment = require("./lib/globals/environment");
var import_menus = require("./lib/globals/menus");
var import_time = require("./lib/globals/time");
var import_useContainer = require("./lib/hooks/useContainer");
var import_useCursor = require("./lib/hooks/useCursor");
var import_useEditor = require("./lib/hooks/useEditor");
var import_useEditorComponents = require("./lib/hooks/useEditorComponents");
var import_useEvent = require("./lib/hooks/useEvent");
var import_useGlobalMenuIsOpen = require("./lib/hooks/useGlobalMenuIsOpen");
var import_useIdentity = require("./lib/hooks/useIdentity");
var import_useIsCropping = require("./lib/hooks/useIsCropping");
var import_useIsDarkMode = require("./lib/hooks/useIsDarkMode");
var import_useIsEditing = require("./lib/hooks/useIsEditing");
var import_useLocalStore = require("./lib/hooks/useLocalStore");
var import_usePassThroughWheelEvents = require("./lib/hooks/usePassThroughWheelEvents");
var import_usePeerIds = require("./lib/hooks/usePeerIds");
var import_usePresence = require("./lib/hooks/usePresence");
var import_useRefState = require("./lib/hooks/useRefState");
var import_useSafeId = require("./lib/hooks/useSafeId");
var import_useSelectionEvents = require("./lib/hooks/useSelectionEvents");
var import_useTLStore = require("./lib/hooks/useTLStore");
var import_useTransform = require("./lib/hooks/useTransform");
var import_LicenseManager = require("./lib/license/LicenseManager");
var import_options = require("./lib/options");
var import_Box = require("./lib/primitives/Box");
var import_Mat = require("./lib/primitives/Mat");
var import_Vec = require("./lib/primitives/Vec");
var import_easings = require("./lib/primitives/easings");
var import_Arc2d = require("./lib/primitives/geometry/Arc2d");
var import_Circle2d = require("./lib/primitives/geometry/Circle2d");
var import_CubicBezier2d = require("./lib/primitives/geometry/CubicBezier2d");
var import_CubicSpline2d = require("./lib/primitives/geometry/CubicSpline2d");
var import_Edge2d = require("./lib/primitives/geometry/Edge2d");
var import_Ellipse2d = require("./lib/primitives/geometry/Ellipse2d");
var import_Geometry2d = require("./lib/primitives/geometry/Geometry2d");
var import_Group2d = require("./lib/primitives/geometry/Group2d");
var import_Point2d = require("./lib/primitives/geometry/Point2d");
var import_Polygon2d = require("./lib/primitives/geometry/Polygon2d");
var import_Polyline2d = require("./lib/primitives/geometry/Polyline2d");
var import_Rectangle2d = require("./lib/primitives/geometry/Rectangle2d");
var import_Stadium2d = require("./lib/primitives/geometry/Stadium2d");
var import_intersect = require("./lib/primitives/intersect");
var import_utils2 = require("./lib/primitives/utils");
var import_SharedStylesMap = require("./lib/utils/SharedStylesMap");
var import_assets = require("./lib/utils/assets");
var import_debug_flags = require("./lib/utils/debug-flags");
var import_deepLinks = require("./lib/utils/deepLinks");
var import_dom = require("./lib/utils/dom");
var import_getIncrementedName = require("./lib/utils/getIncrementedName");
var import_getPointerInfo = require("./lib/utils/getPointerInfo");
var import_getSvgPathFromPoints = require("./lib/utils/getSvgPathFromPoints");
var import_hardResetEditor = require("./lib/utils/hardResetEditor");
var import_keyboard = require("./lib/utils/keyboard");
var import_normalizeWheel = require("./lib/utils/normalizeWheel");
var import_refreshPage = require("./lib/utils/refreshPage");
var import_rotation = require("./lib/utils/rotation");
var import_runtime = require("./lib/utils/runtime");
var import_hardReset = require("./lib/utils/sync/hardReset");
var import_uniq = require("./lib/utils/uniq");
var import_window_open = require("./lib/utils/window-open");
function debugEnableLicensing() {
  return;
}
(0, import_utils.registerTldrawLibraryVersion)(
  "@tldraw/editor",
  "3.5.0-canary.824a9e4c2af5",
  "cjs"
);
//# sourceMappingURL=index.js.map
