@zsviczian/excalidraw 0.18.0-56 → 0.18.0-57

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.
@@ -12959,7 +12959,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
12959
12959
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
12960
12960
 
12961
12961
  "use strict";
12962
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ destroyObsidianUtils: () => (/* binding */ destroyObsidianUtils),\n/* harmony export */ getAreaLimit: () => (/* binding */ getAreaLimit),\n/* harmony export */ getDesktopUIMode: () => (/* binding */ getDesktopUIMode),\n/* harmony export */ getHostPlugin: () => (/* binding */ getHostPlugin),\n/* harmony export */ getObsidianDeviceInfo: () => (/* binding */ getObsidianDeviceInfo),\n/* harmony export */ getWidthHeightLimit: () => (/* binding */ getWidthHeightLimit),\n/* harmony export */ hostPlugin: () => (/* binding */ hostPlugin),\n/* harmony export */ initializeObsidianUtils: () => (/* binding */ initializeObsidianUtils)\n/* harmony export */ });\nlet ObsidianDevice = null; //zsviczian, my dirty little secrets. These are hacks I am not proud of...\n\nlet hostPlugin = null;\nfunction destroyObsidianUtils() {\n hostPlugin = null;\n}\nfunction initializeObsidianUtils() {\n //@ts-ignore\n hostPlugin = app.plugins.plugins[\"obsidian-excalidraw-plugin\"];\n}\nfunction getHostPlugin() {\n if (!hostPlugin) {\n initializeObsidianUtils();\n }\n\n return hostPlugin;\n}\nconst getObsidianDeviceInfo = () => {\n if (ObsidianDevice) {\n return ObsidianDevice;\n } //@ts-ignore\n\n\n const obsidianPlugin = app.plugins.plugins[\"obsidian-excalidraw-plugin\"];\n\n if (!obsidianPlugin) {\n return null;\n }\n\n return ObsidianDevice = Object.assign({}, obsidianPlugin.getObsidianDevice());\n};\nconst getDesktopUIMode = () => {\n //@ts-ignore\n const obsidianPlugin = app.plugins.plugins[\"obsidian-excalidraw-plugin\"];\n\n if (!obsidianPlugin) {\n return \"tray\";\n }\n\n const desktopUIMode = obsidianPlugin.settings.desktopUIMode;\n return [\"tray\", \"full\", \"compact\"].includes(desktopUIMode) ? desktopUIMode : \"tray\";\n};\nfunction getAreaLimit() {\n var _a;\n\n return (_a = getHostPlugin().excalidrawConfig.areaLimit) !== null && _a !== void 0 ? _a : 16777216;\n}\nfunction getWidthHeightLimit() {\n var _a;\n\n return (_a = getHostPlugin().excalidrawConfig.widthHeightLimit) !== null && _a !== void 0 ? _a : 32767;\n}\n\n//# sourceURL=webpack://ExcalidrawLib/../common/src/commonObsidianUtils.ts?");
12962
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ destroyObsidianUtils: () => (/* binding */ destroyObsidianUtils),\n/* harmony export */ getAreaLimit: () => (/* binding */ getAreaLimit),\n/* harmony export */ getDesktopUIMode: () => (/* binding */ getDesktopUIMode),\n/* harmony export */ getHighlightColor: () => (/* binding */ getHighlightColor),\n/* harmony export */ getHostPlugin: () => (/* binding */ getHostPlugin),\n/* harmony export */ getObsidianDeviceInfo: () => (/* binding */ getObsidianDeviceInfo),\n/* harmony export */ getWidthHeightLimit: () => (/* binding */ getWidthHeightLimit),\n/* harmony export */ hostPlugin: () => (/* binding */ hostPlugin),\n/* harmony export */ initializeObsidianUtils: () => (/* binding */ initializeObsidianUtils)\n/* harmony export */ });\nlet ObsidianDevice = null; //zsviczian, my dirty little secrets. These are hacks I am not proud of...\n\nlet hostPlugin = null;\nfunction destroyObsidianUtils() {\n hostPlugin = null;\n}\nfunction initializeObsidianUtils() {\n //@ts-ignore\n hostPlugin = app.plugins.plugins[\"obsidian-excalidraw-plugin\"];\n}\nfunction getHostPlugin() {\n if (!hostPlugin) {\n initializeObsidianUtils();\n }\n\n return hostPlugin;\n}\nconst getObsidianDeviceInfo = () => {\n if (ObsidianDevice) {\n return ObsidianDevice;\n } //@ts-ignore\n\n\n const obsidianPlugin = app.plugins.plugins[\"obsidian-excalidraw-plugin\"];\n\n if (!obsidianPlugin) {\n return null;\n }\n\n return ObsidianDevice = Object.assign({}, obsidianPlugin.getObsidianDevice());\n};\nconst getDesktopUIMode = () => {\n //@ts-ignore\n const obsidianPlugin = app.plugins.plugins[\"obsidian-excalidraw-plugin\"];\n\n if (!obsidianPlugin) {\n return \"tray\";\n }\n\n const desktopUIMode = obsidianPlugin.settings.desktopUIMode;\n return [\"tray\", \"full\", \"compact\"].includes(desktopUIMode) ? desktopUIMode : \"tray\";\n};\nfunction getAreaLimit() {\n var _a;\n\n return (_a = getHostPlugin().excalidrawConfig.areaLimit) !== null && _a !== void 0 ? _a : 16777216;\n}\nfunction getWidthHeightLimit() {\n var _a;\n\n return (_a = getHostPlugin().excalidrawConfig.widthHeightLimit) !== null && _a !== void 0 ? _a : 32767;\n}\nfunction getHighlightColor(color, sceneBgColor, opacity = 1) {\n var _a;\n\n return (_a = getHostPlugin().getHighlightColor(color, sceneBgColor, opacity)) !== null && _a !== void 0 ? _a : `rgba(0,118,255,${opacity})`;\n}\n\n//# sourceURL=webpack://ExcalidrawLib/../common/src/commonObsidianUtils.ts?");
12963
12963
 
12964
12964
  /***/ }),
12965
12965
 
@@ -13014,7 +13014,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
13014
13014
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
13015
13015
 
13016
13016
  "use strict";
13017
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ACTIVE_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.ACTIVE_THRESHOLD),\n/* harmony export */ ALLOWED_PASTE_MIME_TYPES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.ALLOWED_PASTE_MIME_TYPES),\n/* harmony export */ APP_NAME: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.APP_NAME),\n/* harmony export */ ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO),\n/* harmony export */ ARROW_LABEL_WIDTH_FRACTION: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.ARROW_LABEL_WIDTH_FRACTION),\n/* harmony export */ ARROW_TYPE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.ARROW_TYPE),\n/* harmony export */ BIND_MODE_TIMEOUT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.BIND_MODE_TIMEOUT),\n/* harmony export */ BOUND_TEXT_PADDING: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.BOUND_TEXT_PADDING),\n/* harmony export */ BinaryHeap: () => (/* reexport safe */ _binary_heap__WEBPACK_IMPORTED_MODULE_0__.BinaryHeap),\n/* harmony export */ CANVAS_ONLY_ACTIONS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.CANVAS_ONLY_ACTIONS),\n/* harmony export */ CANVAS_PALETTE_SHADE_INDEXES: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.CANVAS_PALETTE_SHADE_INDEXES),\n/* harmony export */ CANVAS_SEARCH_TAB: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.CANVAS_SEARCH_TAB),\n/* harmony export */ CJK_HAND_DRAWN_FALLBACK_FONT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.CJK_HAND_DRAWN_FALLBACK_FONT),\n/* harmony export */ CLASSES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.CLASSES),\n/* harmony export */ CODES: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_5__.CODES),\n/* harmony export */ COLORS_PER_ROW: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.COLORS_PER_ROW),\n/* harmony export */ COLOR_CHARCOAL_BLACK: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.COLOR_CHARCOAL_BLACK),\n/* harmony export */ COLOR_NAMES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.COLOR_NAMES),\n/* harmony export */ COLOR_OUTLINE_CONTRAST_THRESHOLD: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.COLOR_OUTLINE_CONTRAST_THRESHOLD),\n/* harmony export */ COLOR_PALETTE: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.COLOR_PALETTE),\n/* harmony export */ COLOR_VOICE_CALL: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.COLOR_VOICE_CALL),\n/* harmony export */ COLOR_WHITE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.COLOR_WHITE),\n/* harmony export */ CURSOR_TYPE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.CURSOR_TYPE),\n/* harmony export */ DEFAULT_ADAPTIVE_RADIUS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_ADAPTIVE_RADIUS),\n/* harmony export */ DEFAULT_CANVAS_BACKGROUND_PICKS: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_CANVAS_BACKGROUND_PICKS),\n/* harmony export */ DEFAULT_CHART_COLOR_INDEX: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_CHART_COLOR_INDEX),\n/* harmony export */ DEFAULT_COLLISION_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_COLLISION_THRESHOLD),\n/* harmony export */ DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX),\n/* harmony export */ DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE),\n/* harmony export */ DEFAULT_ELEMENT_BACKGROUND_PICKS: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_ELEMENT_BACKGROUND_PICKS),\n/* harmony export */ DEFAULT_ELEMENT_PROPS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_ELEMENT_PROPS),\n/* harmony export */ DEFAULT_ELEMENT_STROKE_COLOR_INDEX: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_ELEMENT_STROKE_COLOR_INDEX),\n/* harmony export */ DEFAULT_ELEMENT_STROKE_COLOR_PALETTE: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_ELEMENT_STROKE_COLOR_PALETTE),\n/* harmony export */ DEFAULT_ELEMENT_STROKE_PICKS: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_ELEMENT_STROKE_PICKS),\n/* harmony export */ DEFAULT_EXPORT_PADDING: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_EXPORT_PADDING),\n/* harmony export */ DEFAULT_FILENAME: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_FILENAME),\n/* harmony export */ DEFAULT_FONT_FAMILY: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_FONT_FAMILY),\n/* harmony export */ DEFAULT_FONT_SIZE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_FONT_SIZE),\n/* harmony export */ DEFAULT_GRID_SIZE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_GRID_SIZE),\n/* harmony export */ DEFAULT_GRID_STEP: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_GRID_STEP),\n/* harmony export */ DEFAULT_LASER_COLOR: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_LASER_COLOR),\n/* harmony export */ DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT),\n/* harmony export */ DEFAULT_PROPORTIONAL_RADIUS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_PROPORTIONAL_RADIUS),\n/* harmony export */ DEFAULT_REDUCED_GLOBAL_ALPHA: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_REDUCED_GLOBAL_ALPHA),\n/* harmony export */ DEFAULT_SIDEBAR: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_SIDEBAR),\n/* harmony export */ DEFAULT_TEXT_ALIGN: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_TEXT_ALIGN),\n/* harmony export */ DEFAULT_TRANSFORM_HANDLE_SPACING: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_TRANSFORM_HANDLE_SPACING),\n/* harmony export */ DEFAULT_UI_OPTIONS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_UI_OPTIONS),\n/* harmony export */ DEFAULT_VERSION: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_VERSION),\n/* harmony export */ DEFAULT_VERTICAL_ALIGN: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_VERTICAL_ALIGN),\n/* harmony export */ DOUBLE_TAP_POSITION_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DOUBLE_TAP_POSITION_THRESHOLD),\n/* harmony export */ DRAGGING_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DRAGGING_THRESHOLD),\n/* harmony export */ EDITOR_LS_KEYS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.EDITOR_LS_KEYS),\n/* harmony export */ ELEMENTS_PALETTE_SHADE_INDEXES: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.ELEMENTS_PALETTE_SHADE_INDEXES),\n/* harmony export */ ELEMENT_LINK_KEY: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.ELEMENT_LINK_KEY),\n/* harmony export */ ELEMENT_READY_TO_ERASE_OPACITY: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.ELEMENT_READY_TO_ERASE_OPACITY),\n/* harmony export */ ELEMENT_SHIFT_TRANSLATE_AMOUNT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.ELEMENT_SHIFT_TRANSLATE_AMOUNT),\n/* harmony export */ ELEMENT_TRANSLATE_AMOUNT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.ELEMENT_TRANSLATE_AMOUNT),\n/* harmony export */ ENCRYPTION_KEY_BITS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.ENCRYPTION_KEY_BITS),\n/* harmony export */ ENV: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.ENV),\n/* harmony export */ EPSILON: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.EPSILON),\n/* harmony export */ EVENT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.EVENT),\n/* harmony export */ EXPORT_DATA_TYPES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.EXPORT_DATA_TYPES),\n/* harmony export */ EXPORT_IMAGE_TYPES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.EXPORT_IMAGE_TYPES),\n/* harmony export */ EXPORT_SCALES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.EXPORT_SCALES),\n/* harmony export */ Emitter: () => (/* reexport safe */ _emitter__WEBPACK_IMPORTED_MODULE_11__.Emitter),\n/* harmony export */ FONT_FAMILY: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.FONT_FAMILY),\n/* harmony export */ FONT_FAMILY_FALLBACKS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.FONT_FAMILY_FALLBACKS),\n/* harmony export */ FONT_FAMILY_GENERIC_FALLBACKS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.FONT_FAMILY_GENERIC_FALLBACKS),\n/* harmony export */ FONT_METADATA: () => (/* reexport safe */ _font_metadata__WEBPACK_IMPORTED_MODULE_3__.FONT_METADATA),\n/* harmony export */ FRAME_STYLE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE),\n/* harmony export */ GOOGLE_FONTS_RANGES: () => (/* reexport safe */ _font_metadata__WEBPACK_IMPORTED_MODULE_3__.GOOGLE_FONTS_RANGES),\n/* harmony export */ HYPERLINK_TOOLTIP_DELAY: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.HYPERLINK_TOOLTIP_DELAY),\n/* harmony export */ IDLE_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.IDLE_THRESHOLD),\n/* harmony export */ IMAGE_MIME_TYPES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.IMAGE_MIME_TYPES),\n/* harmony export */ IMAGE_RENDER_TIMEOUT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.IMAGE_RENDER_TIMEOUT),\n/* harmony export */ KEYS: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_5__.KEYS),\n/* harmony export */ KeyCodeMap: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_5__.KeyCodeMap),\n/* harmony export */ LIBRARY_DISABLED_TYPES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.LIBRARY_DISABLED_TYPES),\n/* harmony export */ LIBRARY_SIDEBAR_TAB: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.LIBRARY_SIDEBAR_TAB),\n/* harmony export */ LINE_CONFIRM_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.LINE_CONFIRM_THRESHOLD),\n/* harmony export */ LINE_POLYGON_POINT_MERGE_DISTANCE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.LINE_POLYGON_POINT_MERGE_DISTANCE),\n/* harmony export */ LOCAL_FONT_PROTOCOL: () => (/* reexport safe */ _font_metadata__WEBPACK_IMPORTED_MODULE_3__.LOCAL_FONT_PROTOCOL),\n/* harmony export */ MAX_ALLOWED_FILE_BYTES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.MAX_ALLOWED_FILE_BYTES),\n/* harmony export */ MAX_CUSTOM_COLORS_USED_IN_CANVAS: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.MAX_CUSTOM_COLORS_USED_IN_CANVAS),\n/* harmony export */ MAX_DECIMALS_FOR_SVG_EXPORT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.MAX_DECIMALS_FOR_SVG_EXPORT),\n/* harmony export */ MAX_ZOOM: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.MAX_ZOOM),\n/* harmony export */ MIME_TYPES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.MIME_TYPES),\n/* harmony export */ MINIMUM_ARROW_SIZE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.MINIMUM_ARROW_SIZE),\n/* harmony export */ MIN_FONT_SIZE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.MIN_FONT_SIZE),\n/* harmony export */ MIN_WIDTH_OR_HEIGHT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.MIN_WIDTH_OR_HEIGHT),\n/* harmony export */ MIN_ZOOM: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.MIN_ZOOM),\n/* harmony export */ MOBILE_ACTION_BUTTON_BG: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.MOBILE_ACTION_BUTTON_BG),\n/* harmony export */ MONOSPACE_GENERIC_FONT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.MONOSPACE_GENERIC_FONT),\n/* harmony export */ MQ_MAX_HEIGHT_LANDSCAPE: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.MQ_MAX_HEIGHT_LANDSCAPE),\n/* harmony export */ MQ_MAX_MOBILE: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.MQ_MAX_MOBILE),\n/* harmony export */ MQ_MAX_TABLET: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.MQ_MAX_TABLET),\n/* harmony export */ MQ_MAX_WIDTH_LANDSCAPE: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.MQ_MAX_WIDTH_LANDSCAPE),\n/* harmony export */ MQ_MIN_TABLET: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.MQ_MIN_TABLET),\n/* harmony export */ MQ_MIN_WIDTH_DESKTOP: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.MQ_MIN_WIDTH_DESKTOP),\n/* harmony export */ MQ_RIGHT_SIDEBAR_MIN_WIDTH: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.MQ_RIGHT_SIDEBAR_MIN_WIDTH),\n/* harmony export */ ORIG_ID: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.ORIG_ID),\n/* harmony export */ POINTER_BUTTON: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.POINTER_BUTTON),\n/* harmony export */ POINTER_EVENTS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.POINTER_EVENTS),\n/* harmony export */ PRECEDING_ELEMENT_KEY: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.PRECEDING_ELEMENT_KEY),\n/* harmony export */ PromisePool: () => (/* reexport safe */ _promise_pool__WEBPACK_IMPORTED_MODULE_7__.PromisePool),\n/* harmony export */ Queue: () => (/* reexport safe */ _queue__WEBPACK_IMPORTED_MODULE_4__.Queue),\n/* harmony export */ ROUGHNESS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.ROUGHNESS),\n/* harmony export */ ROUNDNESS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.ROUNDNESS),\n/* harmony export */ SANS_SERIF_GENERIC_FONT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.SANS_SERIF_GENERIC_FONT),\n/* harmony export */ SCROLL_TIMEOUT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.SCROLL_TIMEOUT),\n/* harmony export */ SHIFT_LOCKING_ANGLE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.SHIFT_LOCKING_ANGLE),\n/* harmony export */ SIDE_RESIZING_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.SIDE_RESIZING_THRESHOLD),\n/* harmony export */ STATS_PANELS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.STATS_PANELS),\n/* harmony export */ STRING_MIME_TYPES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.STRING_MIME_TYPES),\n/* harmony export */ STROKE_WIDTH: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.STROKE_WIDTH),\n/* harmony export */ SVG_DOCUMENT_PREAMBLE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.SVG_DOCUMENT_PREAMBLE),\n/* harmony export */ SVG_NS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.SVG_NS),\n/* harmony export */ TAP_TWICE_TIMEOUT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.TAP_TWICE_TIMEOUT),\n/* harmony export */ TEXT_ALIGN: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.TEXT_ALIGN),\n/* harmony export */ TEXT_AUTOWRAP_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.TEXT_AUTOWRAP_THRESHOLD),\n/* harmony export */ TEXT_TO_CENTER_SNAP_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.TEXT_TO_CENTER_SNAP_THRESHOLD),\n/* harmony export */ THEME: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.THEME),\n/* harmony export */ THEME_FILTER: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.THEME_FILTER),\n/* harmony export */ TITLE_TIMEOUT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.TITLE_TIMEOUT),\n/* harmony export */ TOOL_TYPE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.TOOL_TYPE),\n/* harmony export */ TOUCH_CTX_MENU_TIMEOUT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.TOUCH_CTX_MENU_TIMEOUT),\n/* harmony export */ URL_HASH_KEYS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.URL_HASH_KEYS),\n/* harmony export */ URL_QUERY_KEYS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.URL_QUERY_KEYS),\n/* harmony export */ UserIdleState: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.UserIdleState),\n/* harmony export */ VERSIONS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.VERSIONS),\n/* harmony export */ VERSION_TIMEOUT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.VERSION_TIMEOUT),\n/* harmony export */ VERTICAL_ALIGN: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.VERTICAL_ALIGN),\n/* harmony export */ WINDOWS_EMOJI_FALLBACK_FONT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.WINDOWS_EMOJI_FALLBACK_FONT),\n/* harmony export */ YOUTUBE_STATES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.YOUTUBE_STATES),\n/* harmony export */ ZOOM_STEP: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.ZOOM_STEP),\n/* harmony export */ addEventListener: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.addEventListener),\n/* harmony export */ allowFullScreen: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.allowFullScreen),\n/* harmony export */ arrayToList: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.arrayToList),\n/* harmony export */ arrayToMap: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.arrayToMap),\n/* harmony export */ arrayToMapWithIndex: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.arrayToMapWithIndex),\n/* harmony export */ arrayToObject: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.arrayToObject),\n/* harmony export */ assertNever: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.assertNever),\n/* harmony export */ bytesToHexString: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.bytesToHexString),\n/* harmony export */ capitalizeString: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.capitalizeString),\n/* harmony export */ castArray: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.castArray),\n/* harmony export */ chunk: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.chunk),\n/* harmony export */ cloneJSON: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.cloneJSON),\n/* harmony export */ composeEventHandlers: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.composeEventHandlers),\n/* harmony export */ createUserAgentDescriptor: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.createUserAgentDescriptor),\n/* harmony export */ debounce: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.debounce),\n/* harmony export */ debugClear: () => (/* reexport safe */ _visualdebug__WEBPACK_IMPORTED_MODULE_12__.debugClear),\n/* harmony export */ debugCloseFrame: () => (/* reexport safe */ _visualdebug__WEBPACK_IMPORTED_MODULE_12__.debugCloseFrame),\n/* harmony export */ debugDrawBounds: () => (/* reexport safe */ _visualdebug__WEBPACK_IMPORTED_MODULE_12__.debugDrawBounds),\n/* harmony export */ debugDrawCubicBezier: () => (/* reexport safe */ _visualdebug__WEBPACK_IMPORTED_MODULE_12__.debugDrawCubicBezier),\n/* harmony export */ debugDrawLine: () => (/* reexport safe */ _visualdebug__WEBPACK_IMPORTED_MODULE_12__.debugDrawLine),\n/* harmony export */ debugDrawPoint: () => (/* reexport safe */ _visualdebug__WEBPACK_IMPORTED_MODULE_12__.debugDrawPoint),\n/* harmony export */ debugDrawPoints: () => (/* reexport safe */ _visualdebug__WEBPACK_IMPORTED_MODULE_12__.debugDrawPoints),\n/* harmony export */ deriveStylesPanelMode: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.deriveStylesPanelMode),\n/* harmony export */ destroyObsidianUtils: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.destroyObsidianUtils),\n/* harmony export */ distance: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.distance),\n/* harmony export */ easeOut: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.easeOut),\n/* harmony export */ easeToValuesRAF: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.easeToValuesRAF),\n/* harmony export */ escapeDoubleQuotes: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.escapeDoubleQuotes),\n/* harmony export */ exitFullScreen: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.exitFullScreen),\n/* harmony export */ findIndex: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.findIndex),\n/* harmony export */ findLastIndex: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.findLastIndex),\n/* harmony export */ focusNearestParent: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.focusNearestParent),\n/* harmony export */ getAllColorsSpecificShade: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.getAllColorsSpecificShade),\n/* harmony export */ getAreaLimit: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.getAreaLimit),\n/* harmony export */ getDateTime: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.getDateTime),\n/* harmony export */ getDesktopUIMode: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.getDesktopUIMode),\n/* harmony export */ getExportSource: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.getExportSource),\n/* harmony export */ getFeatureFlag: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.getFeatureFlag),\n/* harmony export */ getFontFamilyFallbacks: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.getFontFamilyFallbacks),\n/* harmony export */ getFontFamilyString: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.getFontFamilyString),\n/* harmony export */ getFontString: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.getFontString),\n/* harmony export */ getFormFactor: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.getFormFactor),\n/* harmony export */ getFrame: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.getFrame),\n/* harmony export */ getGenericFontFamilyFallback: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.getGenericFontFamilyFallback),\n/* harmony export */ getGlobalCSSVariable: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.getGlobalCSSVariable),\n/* harmony export */ getGridPoint: () => (/* reexport safe */ _points__WEBPACK_IMPORTED_MODULE_6__.getGridPoint),\n/* harmony export */ getHostPlugin: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.getHostPlugin),\n/* harmony export */ getLineHeight: () => (/* reexport safe */ _font_metadata__WEBPACK_IMPORTED_MODULE_3__.getLineHeight),\n/* harmony export */ getNearestScrollableContainer: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.getNearestScrollableContainer),\n/* harmony export */ getObsidianDeviceInfo: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.getObsidianDeviceInfo),\n/* harmony export */ getSizeFromPoints: () => (/* reexport safe */ _points__WEBPACK_IMPORTED_MODULE_6__.getSizeFromPoints),\n/* harmony export */ getSpecificColorShades: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.getSpecificColorShades),\n/* harmony export */ getSvgPathFromStroke: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.getSvgPathFromStroke),\n/* harmony export */ getUpdatedTimestamp: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.getUpdatedTimestamp),\n/* harmony export */ getVersion: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.getVersion),\n/* harmony export */ getVerticalOffset: () => (/* reexport safe */ _font_metadata__WEBPACK_IMPORTED_MODULE_3__.getVerticalOffset),\n/* harmony export */ getWidthHeightLimit: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.getWidthHeightLimit),\n/* harmony export */ hostPlugin: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.hostPlugin),\n/* harmony export */ initializeObsidianUtils: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.initializeObsidianUtils),\n/* harmony export */ invariant: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.invariant),\n/* harmony export */ isAndroid: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isAndroid),\n/* harmony export */ isAnyTrue: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isAnyTrue),\n/* harmony export */ isArrowKey: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_5__.isArrowKey),\n/* harmony export */ isBrave: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isBrave),\n/* harmony export */ isChrome: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isChrome),\n/* harmony export */ isDarwin: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isDarwin),\n/* harmony export */ isDevEnv: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isDevEnv),\n/* harmony export */ isFirefox: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isFirefox),\n/* harmony export */ isFullScreen: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isFullScreen),\n/* harmony export */ isIOS: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isIOS),\n/* harmony export */ isInputLike: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isInputLike),\n/* harmony export */ isInteractive: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isInteractive),\n/* harmony export */ isLatinChar: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_5__.isLatinChar),\n/* harmony export */ isLocalLink: () => (/* reexport safe */ _url__WEBPACK_IMPORTED_MODULE_9__.isLocalLink),\n/* harmony export */ isMemberOf: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isMemberOf),\n/* harmony export */ isMobileBreakpoint: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isMobileBreakpoint),\n/* harmony export */ isPrimitive: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isPrimitive),\n/* harmony export */ isProdEnv: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isProdEnv),\n/* harmony export */ isPromiseLike: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isPromiseLike),\n/* harmony export */ isRTL: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isRTL),\n/* harmony export */ isReadonlyArray: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isReadonlyArray),\n/* harmony export */ isRunningInIframe: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isRunningInIframe),\n/* harmony export */ isSafari: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isSafari),\n/* harmony export */ isSelectionLikeTool: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isSelectionLikeTool),\n/* harmony export */ isServerEnv: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isServerEnv),\n/* harmony export */ isShallowEqual: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isShallowEqual),\n/* harmony export */ isTabletBreakpoint: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isTabletBreakpoint),\n/* harmony export */ isTestEnv: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isTestEnv),\n/* harmony export */ isToolIcon: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isToolIcon),\n/* harmony export */ isTransparent: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isTransparent),\n/* harmony export */ isWindows: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isWindows),\n/* harmony export */ isWritableElement: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isWritableElement),\n/* harmony export */ loadDesktopUIModePreference: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.loadDesktopUIModePreference),\n/* harmony export */ mapFind: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.mapFind),\n/* harmony export */ matchKey: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_5__.matchKey),\n/* harmony export */ memoize: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.memoize),\n/* harmony export */ muteFSAbortError: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.muteFSAbortError),\n/* harmony export */ nFormatter: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.nFormatter),\n/* harmony export */ nextAnimationFrame: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.nextAnimationFrame),\n/* harmony export */ normalizeEOL: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.normalizeEOL),\n/* harmony export */ normalizeLink: () => (/* reexport safe */ _url__WEBPACK_IMPORTED_MODULE_9__.normalizeLink),\n/* harmony export */ obsidianId: () => (/* reexport safe */ _random__WEBPACK_IMPORTED_MODULE_8__.obsidianId),\n/* harmony export */ preventUnload: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.preventUnload),\n/* harmony export */ promiseTry: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.promiseTry),\n/* harmony export */ queryFocusableElements: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.queryFocusableElements),\n/* harmony export */ randomId: () => (/* reexport safe */ _random__WEBPACK_IMPORTED_MODULE_8__.randomId),\n/* harmony export */ randomInteger: () => (/* reexport safe */ _random__WEBPACK_IMPORTED_MODULE_8__.randomInteger),\n/* harmony export */ reduceToCommonValue: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.reduceToCommonValue),\n/* harmony export */ removeSelection: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.removeSelection),\n/* harmony export */ rescalePoints: () => (/* reexport safe */ _points__WEBPACK_IMPORTED_MODULE_6__.rescalePoints),\n/* harmony export */ reseed: () => (/* reexport safe */ _random__WEBPACK_IMPORTED_MODULE_8__.reseed),\n/* harmony export */ resolvablePromise: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.resolvablePromise),\n/* harmony export */ rgbToHex: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.rgbToHex),\n/* harmony export */ safelyParseJSON: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.safelyParseJSON),\n/* harmony export */ sceneCoordsToViewportCoords: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.sceneCoordsToViewportCoords),\n/* harmony export */ selectNode: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.selectNode),\n/* harmony export */ setDateTimeForTests: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.setDateTimeForTests),\n/* harmony export */ setDesktopUIMode: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.setDesktopUIMode),\n/* harmony export */ setFeatureFlag: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.setFeatureFlag),\n/* harmony export */ shouldMaintainAspectRatio: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_5__.shouldMaintainAspectRatio),\n/* harmony export */ shouldResizeFromCenter: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_5__.shouldResizeFromCenter),\n/* harmony export */ shouldRotateWithDiscreteAngle: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_5__.shouldRotateWithDiscreteAngle),\n/* harmony export */ sizeOf: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.sizeOf),\n/* harmony export */ supportsEmoji: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.supportsEmoji),\n/* harmony export */ supportsResizeObserver: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.supportsResizeObserver),\n/* harmony export */ throttleRAF: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.throttleRAF),\n/* harmony export */ toArray: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.toArray),\n/* harmony export */ toBrandedType: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.toBrandedType),\n/* harmony export */ toIterable: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.toIterable),\n/* harmony export */ toValidURL: () => (/* reexport safe */ _url__WEBPACK_IMPORTED_MODULE_9__.toValidURL),\n/* harmony export */ tupleToCoors: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.tupleToCoors),\n/* harmony export */ updateActiveTool: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.updateActiveTool),\n/* harmony export */ updateObject: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.updateObject),\n/* harmony export */ updateStable: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.updateStable),\n/* harmony export */ viewportCoordsToSceneCoords: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.viewportCoordsToSceneCoords),\n/* harmony export */ wrapEvent: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.wrapEvent)\n/* harmony export */ });\n/* harmony import */ var _binary_heap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./binary-heap */ \"../common/src/binary-heap.ts\");\n/* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./colors */ \"../common/src/colors.ts\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./constants */ \"../common/src/constants.ts\");\n/* harmony import */ var _font_metadata__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./font-metadata */ \"../common/src/font-metadata.ts\");\n/* harmony import */ var _queue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./queue */ \"../common/src/queue.ts\");\n/* harmony import */ var _keys__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./keys */ \"../common/src/keys.ts\");\n/* harmony import */ var _points__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./points */ \"../common/src/points.ts\");\n/* harmony import */ var _promise_pool__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./promise-pool */ \"../common/src/promise-pool.ts\");\n/* harmony import */ var _random__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./random */ \"../common/src/random.ts\");\n/* harmony import */ var _url__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./url */ \"../common/src/url.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./utils */ \"../common/src/utils.ts\");\n/* harmony import */ var _emitter__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./emitter */ \"../common/src/emitter.ts\");\n/* harmony import */ var _visualdebug__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./visualdebug */ \"../common/src/visualdebug.ts\");\n/* harmony import */ var _editorInterface__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./editorInterface */ \"../common/src/editorInterface.ts\");\n/* harmony import */ var _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./commonObsidianUtils */ \"../common/src/commonObsidianUtils.ts\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://ExcalidrawLib/../common/src/index.ts?");
13017
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ACTIVE_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.ACTIVE_THRESHOLD),\n/* harmony export */ ALLOWED_PASTE_MIME_TYPES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.ALLOWED_PASTE_MIME_TYPES),\n/* harmony export */ APP_NAME: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.APP_NAME),\n/* harmony export */ ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO),\n/* harmony export */ ARROW_LABEL_WIDTH_FRACTION: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.ARROW_LABEL_WIDTH_FRACTION),\n/* harmony export */ ARROW_TYPE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.ARROW_TYPE),\n/* harmony export */ BIND_MODE_TIMEOUT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.BIND_MODE_TIMEOUT),\n/* harmony export */ BOUND_TEXT_PADDING: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.BOUND_TEXT_PADDING),\n/* harmony export */ BinaryHeap: () => (/* reexport safe */ _binary_heap__WEBPACK_IMPORTED_MODULE_0__.BinaryHeap),\n/* harmony export */ CANVAS_ONLY_ACTIONS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.CANVAS_ONLY_ACTIONS),\n/* harmony export */ CANVAS_PALETTE_SHADE_INDEXES: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.CANVAS_PALETTE_SHADE_INDEXES),\n/* harmony export */ CANVAS_SEARCH_TAB: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.CANVAS_SEARCH_TAB),\n/* harmony export */ CJK_HAND_DRAWN_FALLBACK_FONT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.CJK_HAND_DRAWN_FALLBACK_FONT),\n/* harmony export */ CLASSES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.CLASSES),\n/* harmony export */ CODES: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_5__.CODES),\n/* harmony export */ COLORS_PER_ROW: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.COLORS_PER_ROW),\n/* harmony export */ COLOR_CHARCOAL_BLACK: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.COLOR_CHARCOAL_BLACK),\n/* harmony export */ COLOR_NAMES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.COLOR_NAMES),\n/* harmony export */ COLOR_OUTLINE_CONTRAST_THRESHOLD: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.COLOR_OUTLINE_CONTRAST_THRESHOLD),\n/* harmony export */ COLOR_PALETTE: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.COLOR_PALETTE),\n/* harmony export */ COLOR_VOICE_CALL: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.COLOR_VOICE_CALL),\n/* harmony export */ COLOR_WHITE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.COLOR_WHITE),\n/* harmony export */ CURSOR_TYPE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.CURSOR_TYPE),\n/* harmony export */ DEFAULT_ADAPTIVE_RADIUS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_ADAPTIVE_RADIUS),\n/* harmony export */ DEFAULT_CANVAS_BACKGROUND_PICKS: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_CANVAS_BACKGROUND_PICKS),\n/* harmony export */ DEFAULT_CHART_COLOR_INDEX: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_CHART_COLOR_INDEX),\n/* harmony export */ DEFAULT_COLLISION_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_COLLISION_THRESHOLD),\n/* harmony export */ DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX),\n/* harmony export */ DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE),\n/* harmony export */ DEFAULT_ELEMENT_BACKGROUND_PICKS: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_ELEMENT_BACKGROUND_PICKS),\n/* harmony export */ DEFAULT_ELEMENT_PROPS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_ELEMENT_PROPS),\n/* harmony export */ DEFAULT_ELEMENT_STROKE_COLOR_INDEX: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_ELEMENT_STROKE_COLOR_INDEX),\n/* harmony export */ DEFAULT_ELEMENT_STROKE_COLOR_PALETTE: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_ELEMENT_STROKE_COLOR_PALETTE),\n/* harmony export */ DEFAULT_ELEMENT_STROKE_PICKS: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_ELEMENT_STROKE_PICKS),\n/* harmony export */ DEFAULT_EXPORT_PADDING: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_EXPORT_PADDING),\n/* harmony export */ DEFAULT_FILENAME: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_FILENAME),\n/* harmony export */ DEFAULT_FONT_FAMILY: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_FONT_FAMILY),\n/* harmony export */ DEFAULT_FONT_SIZE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_FONT_SIZE),\n/* harmony export */ DEFAULT_GRID_SIZE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_GRID_SIZE),\n/* harmony export */ DEFAULT_GRID_STEP: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_GRID_STEP),\n/* harmony export */ DEFAULT_LASER_COLOR: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_LASER_COLOR),\n/* harmony export */ DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT),\n/* harmony export */ DEFAULT_PROPORTIONAL_RADIUS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_PROPORTIONAL_RADIUS),\n/* harmony export */ DEFAULT_REDUCED_GLOBAL_ALPHA: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_REDUCED_GLOBAL_ALPHA),\n/* harmony export */ DEFAULT_SIDEBAR: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_SIDEBAR),\n/* harmony export */ DEFAULT_TEXT_ALIGN: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_TEXT_ALIGN),\n/* harmony export */ DEFAULT_TRANSFORM_HANDLE_SPACING: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_TRANSFORM_HANDLE_SPACING),\n/* harmony export */ DEFAULT_UI_OPTIONS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_UI_OPTIONS),\n/* harmony export */ DEFAULT_VERSION: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_VERSION),\n/* harmony export */ DEFAULT_VERTICAL_ALIGN: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_VERTICAL_ALIGN),\n/* harmony export */ DOUBLE_TAP_POSITION_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DOUBLE_TAP_POSITION_THRESHOLD),\n/* harmony export */ DRAGGING_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.DRAGGING_THRESHOLD),\n/* harmony export */ EDITOR_LS_KEYS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.EDITOR_LS_KEYS),\n/* harmony export */ ELEMENTS_PALETTE_SHADE_INDEXES: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.ELEMENTS_PALETTE_SHADE_INDEXES),\n/* harmony export */ ELEMENT_LINK_KEY: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.ELEMENT_LINK_KEY),\n/* harmony export */ ELEMENT_READY_TO_ERASE_OPACITY: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.ELEMENT_READY_TO_ERASE_OPACITY),\n/* harmony export */ ELEMENT_SHIFT_TRANSLATE_AMOUNT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.ELEMENT_SHIFT_TRANSLATE_AMOUNT),\n/* harmony export */ ELEMENT_TRANSLATE_AMOUNT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.ELEMENT_TRANSLATE_AMOUNT),\n/* harmony export */ ENCRYPTION_KEY_BITS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.ENCRYPTION_KEY_BITS),\n/* harmony export */ ENV: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.ENV),\n/* harmony export */ EPSILON: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.EPSILON),\n/* harmony export */ EVENT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.EVENT),\n/* harmony export */ EXPORT_DATA_TYPES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.EXPORT_DATA_TYPES),\n/* harmony export */ EXPORT_IMAGE_TYPES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.EXPORT_IMAGE_TYPES),\n/* harmony export */ EXPORT_SCALES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.EXPORT_SCALES),\n/* harmony export */ Emitter: () => (/* reexport safe */ _emitter__WEBPACK_IMPORTED_MODULE_11__.Emitter),\n/* harmony export */ FONT_FAMILY: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.FONT_FAMILY),\n/* harmony export */ FONT_FAMILY_FALLBACKS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.FONT_FAMILY_FALLBACKS),\n/* harmony export */ FONT_FAMILY_GENERIC_FALLBACKS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.FONT_FAMILY_GENERIC_FALLBACKS),\n/* harmony export */ FONT_METADATA: () => (/* reexport safe */ _font_metadata__WEBPACK_IMPORTED_MODULE_3__.FONT_METADATA),\n/* harmony export */ FRAME_STYLE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE),\n/* harmony export */ GOOGLE_FONTS_RANGES: () => (/* reexport safe */ _font_metadata__WEBPACK_IMPORTED_MODULE_3__.GOOGLE_FONTS_RANGES),\n/* harmony export */ HYPERLINK_TOOLTIP_DELAY: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.HYPERLINK_TOOLTIP_DELAY),\n/* harmony export */ IDLE_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.IDLE_THRESHOLD),\n/* harmony export */ IMAGE_MIME_TYPES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.IMAGE_MIME_TYPES),\n/* harmony export */ IMAGE_RENDER_TIMEOUT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.IMAGE_RENDER_TIMEOUT),\n/* harmony export */ KEYS: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_5__.KEYS),\n/* harmony export */ KeyCodeMap: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_5__.KeyCodeMap),\n/* harmony export */ LIBRARY_DISABLED_TYPES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.LIBRARY_DISABLED_TYPES),\n/* harmony export */ LIBRARY_SIDEBAR_TAB: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.LIBRARY_SIDEBAR_TAB),\n/* harmony export */ LINE_CONFIRM_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.LINE_CONFIRM_THRESHOLD),\n/* harmony export */ LINE_POLYGON_POINT_MERGE_DISTANCE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.LINE_POLYGON_POINT_MERGE_DISTANCE),\n/* harmony export */ LOCAL_FONT_PROTOCOL: () => (/* reexport safe */ _font_metadata__WEBPACK_IMPORTED_MODULE_3__.LOCAL_FONT_PROTOCOL),\n/* harmony export */ MAX_ALLOWED_FILE_BYTES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.MAX_ALLOWED_FILE_BYTES),\n/* harmony export */ MAX_CUSTOM_COLORS_USED_IN_CANVAS: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.MAX_CUSTOM_COLORS_USED_IN_CANVAS),\n/* harmony export */ MAX_DECIMALS_FOR_SVG_EXPORT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.MAX_DECIMALS_FOR_SVG_EXPORT),\n/* harmony export */ MAX_ZOOM: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.MAX_ZOOM),\n/* harmony export */ MIME_TYPES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.MIME_TYPES),\n/* harmony export */ MINIMUM_ARROW_SIZE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.MINIMUM_ARROW_SIZE),\n/* harmony export */ MIN_FONT_SIZE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.MIN_FONT_SIZE),\n/* harmony export */ MIN_WIDTH_OR_HEIGHT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.MIN_WIDTH_OR_HEIGHT),\n/* harmony export */ MIN_ZOOM: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.MIN_ZOOM),\n/* harmony export */ MOBILE_ACTION_BUTTON_BG: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.MOBILE_ACTION_BUTTON_BG),\n/* harmony export */ MONOSPACE_GENERIC_FONT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.MONOSPACE_GENERIC_FONT),\n/* harmony export */ MQ_MAX_HEIGHT_LANDSCAPE: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.MQ_MAX_HEIGHT_LANDSCAPE),\n/* harmony export */ MQ_MAX_MOBILE: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.MQ_MAX_MOBILE),\n/* harmony export */ MQ_MAX_TABLET: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.MQ_MAX_TABLET),\n/* harmony export */ MQ_MAX_WIDTH_LANDSCAPE: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.MQ_MAX_WIDTH_LANDSCAPE),\n/* harmony export */ MQ_MIN_TABLET: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.MQ_MIN_TABLET),\n/* harmony export */ MQ_MIN_WIDTH_DESKTOP: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.MQ_MIN_WIDTH_DESKTOP),\n/* harmony export */ MQ_RIGHT_SIDEBAR_MIN_WIDTH: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.MQ_RIGHT_SIDEBAR_MIN_WIDTH),\n/* harmony export */ ORIG_ID: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.ORIG_ID),\n/* harmony export */ POINTER_BUTTON: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.POINTER_BUTTON),\n/* harmony export */ POINTER_EVENTS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.POINTER_EVENTS),\n/* harmony export */ PRECEDING_ELEMENT_KEY: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.PRECEDING_ELEMENT_KEY),\n/* harmony export */ PromisePool: () => (/* reexport safe */ _promise_pool__WEBPACK_IMPORTED_MODULE_7__.PromisePool),\n/* harmony export */ Queue: () => (/* reexport safe */ _queue__WEBPACK_IMPORTED_MODULE_4__.Queue),\n/* harmony export */ ROUGHNESS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.ROUGHNESS),\n/* harmony export */ ROUNDNESS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.ROUNDNESS),\n/* harmony export */ SANS_SERIF_GENERIC_FONT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.SANS_SERIF_GENERIC_FONT),\n/* harmony export */ SCROLL_TIMEOUT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.SCROLL_TIMEOUT),\n/* harmony export */ SHIFT_LOCKING_ANGLE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.SHIFT_LOCKING_ANGLE),\n/* harmony export */ SIDE_RESIZING_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.SIDE_RESIZING_THRESHOLD),\n/* harmony export */ STATS_PANELS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.STATS_PANELS),\n/* harmony export */ STRING_MIME_TYPES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.STRING_MIME_TYPES),\n/* harmony export */ STROKE_WIDTH: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.STROKE_WIDTH),\n/* harmony export */ SVG_DOCUMENT_PREAMBLE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.SVG_DOCUMENT_PREAMBLE),\n/* harmony export */ SVG_NS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.SVG_NS),\n/* harmony export */ TAP_TWICE_TIMEOUT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.TAP_TWICE_TIMEOUT),\n/* harmony export */ TEXT_ALIGN: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.TEXT_ALIGN),\n/* harmony export */ TEXT_AUTOWRAP_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.TEXT_AUTOWRAP_THRESHOLD),\n/* harmony export */ TEXT_TO_CENTER_SNAP_THRESHOLD: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.TEXT_TO_CENTER_SNAP_THRESHOLD),\n/* harmony export */ THEME: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.THEME),\n/* harmony export */ THEME_FILTER: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.THEME_FILTER),\n/* harmony export */ TITLE_TIMEOUT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.TITLE_TIMEOUT),\n/* harmony export */ TOOL_TYPE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.TOOL_TYPE),\n/* harmony export */ TOUCH_CTX_MENU_TIMEOUT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.TOUCH_CTX_MENU_TIMEOUT),\n/* harmony export */ URL_HASH_KEYS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.URL_HASH_KEYS),\n/* harmony export */ URL_QUERY_KEYS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.URL_QUERY_KEYS),\n/* harmony export */ UserIdleState: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.UserIdleState),\n/* harmony export */ VERSIONS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.VERSIONS),\n/* harmony export */ VERSION_TIMEOUT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.VERSION_TIMEOUT),\n/* harmony export */ VERTICAL_ALIGN: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.VERTICAL_ALIGN),\n/* harmony export */ WINDOWS_EMOJI_FALLBACK_FONT: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.WINDOWS_EMOJI_FALLBACK_FONT),\n/* harmony export */ YOUTUBE_STATES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.YOUTUBE_STATES),\n/* harmony export */ ZOOM_STEP: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.ZOOM_STEP),\n/* harmony export */ addEventListener: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.addEventListener),\n/* harmony export */ allowFullScreen: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.allowFullScreen),\n/* harmony export */ arrayToList: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.arrayToList),\n/* harmony export */ arrayToMap: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.arrayToMap),\n/* harmony export */ arrayToMapWithIndex: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.arrayToMapWithIndex),\n/* harmony export */ arrayToObject: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.arrayToObject),\n/* harmony export */ assertNever: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.assertNever),\n/* harmony export */ bytesToHexString: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.bytesToHexString),\n/* harmony export */ capitalizeString: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.capitalizeString),\n/* harmony export */ castArray: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.castArray),\n/* harmony export */ chunk: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.chunk),\n/* harmony export */ cloneJSON: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.cloneJSON),\n/* harmony export */ composeEventHandlers: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.composeEventHandlers),\n/* harmony export */ createUserAgentDescriptor: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.createUserAgentDescriptor),\n/* harmony export */ debounce: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.debounce),\n/* harmony export */ debugClear: () => (/* reexport safe */ _visualdebug__WEBPACK_IMPORTED_MODULE_12__.debugClear),\n/* harmony export */ debugCloseFrame: () => (/* reexport safe */ _visualdebug__WEBPACK_IMPORTED_MODULE_12__.debugCloseFrame),\n/* harmony export */ debugDrawBounds: () => (/* reexport safe */ _visualdebug__WEBPACK_IMPORTED_MODULE_12__.debugDrawBounds),\n/* harmony export */ debugDrawCubicBezier: () => (/* reexport safe */ _visualdebug__WEBPACK_IMPORTED_MODULE_12__.debugDrawCubicBezier),\n/* harmony export */ debugDrawLine: () => (/* reexport safe */ _visualdebug__WEBPACK_IMPORTED_MODULE_12__.debugDrawLine),\n/* harmony export */ debugDrawPoint: () => (/* reexport safe */ _visualdebug__WEBPACK_IMPORTED_MODULE_12__.debugDrawPoint),\n/* harmony export */ debugDrawPoints: () => (/* reexport safe */ _visualdebug__WEBPACK_IMPORTED_MODULE_12__.debugDrawPoints),\n/* harmony export */ deriveStylesPanelMode: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.deriveStylesPanelMode),\n/* harmony export */ destroyObsidianUtils: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.destroyObsidianUtils),\n/* harmony export */ distance: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.distance),\n/* harmony export */ easeOut: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.easeOut),\n/* harmony export */ easeToValuesRAF: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.easeToValuesRAF),\n/* harmony export */ escapeDoubleQuotes: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.escapeDoubleQuotes),\n/* harmony export */ exitFullScreen: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.exitFullScreen),\n/* harmony export */ findIndex: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.findIndex),\n/* harmony export */ findLastIndex: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.findLastIndex),\n/* harmony export */ focusNearestParent: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.focusNearestParent),\n/* harmony export */ getAllColorsSpecificShade: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.getAllColorsSpecificShade),\n/* harmony export */ getAreaLimit: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.getAreaLimit),\n/* harmony export */ getDateTime: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.getDateTime),\n/* harmony export */ getDesktopUIMode: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.getDesktopUIMode),\n/* harmony export */ getExportSource: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.getExportSource),\n/* harmony export */ getFeatureFlag: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.getFeatureFlag),\n/* harmony export */ getFontFamilyFallbacks: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.getFontFamilyFallbacks),\n/* harmony export */ getFontFamilyString: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.getFontFamilyString),\n/* harmony export */ getFontString: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.getFontString),\n/* harmony export */ getFormFactor: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.getFormFactor),\n/* harmony export */ getFrame: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.getFrame),\n/* harmony export */ getGenericFontFamilyFallback: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.getGenericFontFamilyFallback),\n/* harmony export */ getGlobalCSSVariable: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.getGlobalCSSVariable),\n/* harmony export */ getGridPoint: () => (/* reexport safe */ _points__WEBPACK_IMPORTED_MODULE_6__.getGridPoint),\n/* harmony export */ getHighlightColor: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.getHighlightColor),\n/* harmony export */ getHostPlugin: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.getHostPlugin),\n/* harmony export */ getLineHeight: () => (/* reexport safe */ _font_metadata__WEBPACK_IMPORTED_MODULE_3__.getLineHeight),\n/* harmony export */ getNearestScrollableContainer: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.getNearestScrollableContainer),\n/* harmony export */ getObsidianDeviceInfo: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.getObsidianDeviceInfo),\n/* harmony export */ getSizeFromPoints: () => (/* reexport safe */ _points__WEBPACK_IMPORTED_MODULE_6__.getSizeFromPoints),\n/* harmony export */ getSpecificColorShades: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.getSpecificColorShades),\n/* harmony export */ getSvgPathFromStroke: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.getSvgPathFromStroke),\n/* harmony export */ getUpdatedTimestamp: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.getUpdatedTimestamp),\n/* harmony export */ getVersion: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.getVersion),\n/* harmony export */ getVerticalOffset: () => (/* reexport safe */ _font_metadata__WEBPACK_IMPORTED_MODULE_3__.getVerticalOffset),\n/* harmony export */ getWidthHeightLimit: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.getWidthHeightLimit),\n/* harmony export */ hostPlugin: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.hostPlugin),\n/* harmony export */ initializeObsidianUtils: () => (/* reexport safe */ _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__.initializeObsidianUtils),\n/* harmony export */ invariant: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.invariant),\n/* harmony export */ isAndroid: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isAndroid),\n/* harmony export */ isAnyTrue: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isAnyTrue),\n/* harmony export */ isArrowKey: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_5__.isArrowKey),\n/* harmony export */ isBrave: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isBrave),\n/* harmony export */ isChrome: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isChrome),\n/* harmony export */ isDarwin: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isDarwin),\n/* harmony export */ isDevEnv: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isDevEnv),\n/* harmony export */ isFirefox: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isFirefox),\n/* harmony export */ isFullScreen: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isFullScreen),\n/* harmony export */ isIOS: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isIOS),\n/* harmony export */ isInputLike: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isInputLike),\n/* harmony export */ isInteractive: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isInteractive),\n/* harmony export */ isLatinChar: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_5__.isLatinChar),\n/* harmony export */ isLocalLink: () => (/* reexport safe */ _url__WEBPACK_IMPORTED_MODULE_9__.isLocalLink),\n/* harmony export */ isMemberOf: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isMemberOf),\n/* harmony export */ isMobileBreakpoint: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isMobileBreakpoint),\n/* harmony export */ isPrimitive: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isPrimitive),\n/* harmony export */ isProdEnv: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isProdEnv),\n/* harmony export */ isPromiseLike: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isPromiseLike),\n/* harmony export */ isRTL: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isRTL),\n/* harmony export */ isReadonlyArray: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isReadonlyArray),\n/* harmony export */ isRunningInIframe: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isRunningInIframe),\n/* harmony export */ isSafari: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isSafari),\n/* harmony export */ isSelectionLikeTool: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isSelectionLikeTool),\n/* harmony export */ isServerEnv: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isServerEnv),\n/* harmony export */ isShallowEqual: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isShallowEqual),\n/* harmony export */ isTabletBreakpoint: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isTabletBreakpoint),\n/* harmony export */ isTestEnv: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isTestEnv),\n/* harmony export */ isToolIcon: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isToolIcon),\n/* harmony export */ isTransparent: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isTransparent),\n/* harmony export */ isWindows: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.isWindows),\n/* harmony export */ isWritableElement: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.isWritableElement),\n/* harmony export */ loadDesktopUIModePreference: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.loadDesktopUIModePreference),\n/* harmony export */ mapFind: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.mapFind),\n/* harmony export */ matchKey: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_5__.matchKey),\n/* harmony export */ memoize: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.memoize),\n/* harmony export */ muteFSAbortError: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.muteFSAbortError),\n/* harmony export */ nFormatter: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.nFormatter),\n/* harmony export */ nextAnimationFrame: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.nextAnimationFrame),\n/* harmony export */ normalizeEOL: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.normalizeEOL),\n/* harmony export */ normalizeLink: () => (/* reexport safe */ _url__WEBPACK_IMPORTED_MODULE_9__.normalizeLink),\n/* harmony export */ obsidianId: () => (/* reexport safe */ _random__WEBPACK_IMPORTED_MODULE_8__.obsidianId),\n/* harmony export */ preventUnload: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.preventUnload),\n/* harmony export */ promiseTry: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.promiseTry),\n/* harmony export */ queryFocusableElements: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.queryFocusableElements),\n/* harmony export */ randomId: () => (/* reexport safe */ _random__WEBPACK_IMPORTED_MODULE_8__.randomId),\n/* harmony export */ randomInteger: () => (/* reexport safe */ _random__WEBPACK_IMPORTED_MODULE_8__.randomInteger),\n/* harmony export */ reduceToCommonValue: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.reduceToCommonValue),\n/* harmony export */ removeSelection: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.removeSelection),\n/* harmony export */ rescalePoints: () => (/* reexport safe */ _points__WEBPACK_IMPORTED_MODULE_6__.rescalePoints),\n/* harmony export */ reseed: () => (/* reexport safe */ _random__WEBPACK_IMPORTED_MODULE_8__.reseed),\n/* harmony export */ resolvablePromise: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.resolvablePromise),\n/* harmony export */ rgbToHex: () => (/* reexport safe */ _colors__WEBPACK_IMPORTED_MODULE_1__.rgbToHex),\n/* harmony export */ safelyParseJSON: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.safelyParseJSON),\n/* harmony export */ sceneCoordsToViewportCoords: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.sceneCoordsToViewportCoords),\n/* harmony export */ selectNode: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.selectNode),\n/* harmony export */ setDateTimeForTests: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.setDateTimeForTests),\n/* harmony export */ setDesktopUIMode: () => (/* reexport safe */ _editorInterface__WEBPACK_IMPORTED_MODULE_13__.setDesktopUIMode),\n/* harmony export */ setFeatureFlag: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.setFeatureFlag),\n/* harmony export */ shouldMaintainAspectRatio: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_5__.shouldMaintainAspectRatio),\n/* harmony export */ shouldResizeFromCenter: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_5__.shouldResizeFromCenter),\n/* harmony export */ shouldRotateWithDiscreteAngle: () => (/* reexport safe */ _keys__WEBPACK_IMPORTED_MODULE_5__.shouldRotateWithDiscreteAngle),\n/* harmony export */ sizeOf: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.sizeOf),\n/* harmony export */ supportsEmoji: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.supportsEmoji),\n/* harmony export */ supportsResizeObserver: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.supportsResizeObserver),\n/* harmony export */ throttleRAF: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.throttleRAF),\n/* harmony export */ toArray: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.toArray),\n/* harmony export */ toBrandedType: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.toBrandedType),\n/* harmony export */ toIterable: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.toIterable),\n/* harmony export */ toValidURL: () => (/* reexport safe */ _url__WEBPACK_IMPORTED_MODULE_9__.toValidURL),\n/* harmony export */ tupleToCoors: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.tupleToCoors),\n/* harmony export */ updateActiveTool: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.updateActiveTool),\n/* harmony export */ updateObject: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.updateObject),\n/* harmony export */ updateStable: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.updateStable),\n/* harmony export */ viewportCoordsToSceneCoords: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.viewportCoordsToSceneCoords),\n/* harmony export */ wrapEvent: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_10__.wrapEvent)\n/* harmony export */ });\n/* harmony import */ var _binary_heap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./binary-heap */ \"../common/src/binary-heap.ts\");\n/* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./colors */ \"../common/src/colors.ts\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./constants */ \"../common/src/constants.ts\");\n/* harmony import */ var _font_metadata__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./font-metadata */ \"../common/src/font-metadata.ts\");\n/* harmony import */ var _queue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./queue */ \"../common/src/queue.ts\");\n/* harmony import */ var _keys__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./keys */ \"../common/src/keys.ts\");\n/* harmony import */ var _points__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./points */ \"../common/src/points.ts\");\n/* harmony import */ var _promise_pool__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./promise-pool */ \"../common/src/promise-pool.ts\");\n/* harmony import */ var _random__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./random */ \"../common/src/random.ts\");\n/* harmony import */ var _url__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./url */ \"../common/src/url.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./utils */ \"../common/src/utils.ts\");\n/* harmony import */ var _emitter__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./emitter */ \"../common/src/emitter.ts\");\n/* harmony import */ var _visualdebug__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./visualdebug */ \"../common/src/visualdebug.ts\");\n/* harmony import */ var _editorInterface__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./editorInterface */ \"../common/src/editorInterface.ts\");\n/* harmony import */ var _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./commonObsidianUtils */ \"../common/src/commonObsidianUtils.ts\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://ExcalidrawLib/../common/src/index.ts?");
13018
13018
 
13019
13019
  /***/ }),
13020
13020
 
@@ -13421,7 +13421,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
13421
13421
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
13422
13422
 
13423
13423
  "use strict";
13424
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DEFAULT_LINK_SIZE: () => (/* binding */ DEFAULT_LINK_SIZE),\n/* harmony export */ IMAGE_INVERT_FILTER: () => (/* binding */ IMAGE_INVERT_FILTER),\n/* harmony export */ elementWithCanvasCache: () => (/* binding */ elementWithCanvasCache),\n/* harmony export */ generateFreeDrawShape: () => (/* binding */ generateFreeDrawShape),\n/* harmony export */ getFreeDrawPath2D: () => (/* binding */ getFreeDrawPath2D),\n/* harmony export */ getFreeDrawSvgPath: () => (/* binding */ getFreeDrawSvgPath),\n/* harmony export */ getFreedrawOutlineAsSegments: () => (/* binding */ getFreedrawOutlineAsSegments),\n/* harmony export */ getFreedrawOutlinePoints: () => (/* binding */ getFreedrawOutlinePoints),\n/* harmony export */ getRenderOpacity: () => (/* binding */ getRenderOpacity),\n/* harmony export */ pathsCache: () => (/* binding */ pathsCache),\n/* harmony export */ renderElement: () => (/* binding */ renderElement),\n/* harmony export */ renderSelectionElement: () => (/* binding */ renderSelectionElement)\n/* harmony export */ });\n/* harmony import */ var roughjs_bin_rough__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! roughjs/bin/rough */ \"../../node_modules/roughjs/bin/rough.js\");\n/* harmony import */ var perfect_freehand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! perfect-freehand */ \"../../node_modules/perfect-freehand/dist/esm/index.js\");\n/* harmony import */ var _excalidraw_math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @excalidraw/math */ \"../math/src/index.ts\");\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n/* harmony import */ var _bounds__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./bounds */ \"../element/src/bounds.ts\");\n/* harmony import */ var _cropElement__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./cropElement */ \"../element/src/cropElement.ts\");\n/* harmony import */ var _linearElementEditor__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./linearElementEditor */ \"../element/src/linearElementEditor.ts\");\n/* harmony import */ var _textElement__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./textElement */ \"../element/src/textElement.ts\");\n/* harmony import */ var _textMeasurements__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./textMeasurements */ \"../element/src/textMeasurements.ts\");\n/* harmony import */ var _typeChecks__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @excalidraw/element/typeChecks */ \"../element/src/typeChecks.ts\");\n/* harmony import */ var _frame__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./frame */ \"../element/src/frame.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils */ \"../element/src/utils.ts\");\n/* harmony import */ var _shape__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./shape */ \"../element/src/shape.ts\");\n/* harmony import */ var _easingFunctions__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./easingFunctions */ \"../element/src/easingFunctions.ts\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n // using a stronger invert (100% vs our regular 93%) and saturate\n// as a temp hack to make images in dark theme look closer to original\n// color scheme (it's still not quite there and the colors look slightly\n// desatured, alas...)\n\nconst IMAGE_INVERT_FILTER = \"invert(100%) hue-rotate(180deg) saturate(1.25)\";\n\nconst isPendingImageElement = (element, renderConfig) => (0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isInitializedImageElement)(element) && !renderConfig.imageCache.has(element.fileId);\n\nconst shouldResetImageFilter = (element, renderConfig, appState) => {\n var _a;\n\n return appState.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.THEME.DARK && (0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isInitializedImageElement)(element) && !isPendingImageElement(element, renderConfig) && ((_a = renderConfig.imageCache.get(element.fileId)) === null || _a === void 0 ? void 0 : _a.mimeType) !== _excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.MIME_TYPES.svg;\n};\n\nconst getCanvasPadding = element => {\n switch (element.type) {\n case \"freedraw\":\n return element.strokeWidth * 12;\n\n case \"text\":\n return element.fontSize / 2;\n\n case \"arrow\":\n if (element.endArrowhead || element.endArrowhead) {\n return 40;\n }\n\n return 20;\n\n default:\n return 20;\n }\n};\n\nconst getRenderOpacity = (element, containingFrame, elementsPendingErasure, pendingNodes, globalAlpha = 1) => {\n var _a; // multiplying frame opacity with element opacity to combine them\n // (e.g. frame 50% and element 50% opacity should result in 25% opacity)\n\n\n let opacity = ((_a = containingFrame === null || containingFrame === void 0 ? void 0 : containingFrame.opacity) !== null && _a !== void 0 ? _a : 100) * element.opacity / 10000 * globalAlpha; // if pending erasure, multiply again to combine further\n // (so that erasing always results in lower opacity than original)\n\n if (elementsPendingErasure.has(element.id) || pendingNodes && pendingNodes.some(node => node.id === element.id) || containingFrame && elementsPendingErasure.has(containingFrame.id)) {\n opacity *= _excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.ELEMENT_READY_TO_ERASE_OPACITY / 100;\n }\n\n return opacity;\n};\n\nconst cappedElementCanvasSize = (element, elementsMap, zoom) => {\n // these limits are ballpark, they depend on specific browsers and device.\n // We've chosen lower limits to be safe. We might want to change these limits\n // based on browser/device type, if we get reports of low quality rendering\n // on zoom.\n //\n // ~ safari mobile canvas area limit\n const AREA_LIMIT = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.getAreaLimit)(); //zsviczian\n // ~ safari width/height limit based on developer.mozilla.org.\n\n const WIDTH_HEIGHT_LIMIT = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.getWidthHeightLimit)(); //zsviczian\n\n const padding = getCanvasPadding(element);\n const [x1, y1, x2, y2] = (0,_bounds__WEBPACK_IMPORTED_MODULE_4__.getElementAbsoluteCoords)(element, elementsMap);\n const elementWidth = (0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isLinearElement)(element) || (0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isFreeDrawElement)(element) ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.distance)(x1, x2) : element.width;\n const elementHeight = (0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isLinearElement)(element) || (0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isFreeDrawElement)(element) ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.distance)(y1, y2) : element.height;\n let width = elementWidth * window.devicePixelRatio + padding * 2;\n let height = elementHeight * window.devicePixelRatio + padding * 2;\n let scale = zoom.value; // rescale to ensure width and height is within limits\n\n if (width * scale > WIDTH_HEIGHT_LIMIT || height * scale > WIDTH_HEIGHT_LIMIT) {\n scale = Math.min(WIDTH_HEIGHT_LIMIT / width, WIDTH_HEIGHT_LIMIT / height);\n } // rescale to ensure canvas area is within limits\n\n\n if (width * height * scale * scale > AREA_LIMIT) {\n scale = Math.sqrt(AREA_LIMIT / (width * height));\n }\n\n width = Math.floor(width * scale);\n height = Math.floor(height * scale);\n return {\n width,\n height,\n scale\n };\n};\n\nconst generateElementCanvas = (element, elementsMap, zoom, renderConfig, appState) => {\n var _a, _b;\n\n const canvas = document.createElement(\"canvas\");\n const context = canvas.getContext(\"2d\");\n const padding = getCanvasPadding(element);\n const {\n width,\n height,\n scale\n } = cappedElementCanvasSize(element, elementsMap, zoom);\n\n if (!width || !height) {\n return null;\n }\n\n canvas.width = width;\n canvas.height = height;\n let canvasOffsetX = -100;\n let canvasOffsetY = 0;\n\n if ((0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isLinearElement)(element) || (0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isFreeDrawElement)(element)) {\n const [x1, y1] = (0,_bounds__WEBPACK_IMPORTED_MODULE_4__.getElementAbsoluteCoords)(element, elementsMap);\n canvasOffsetX = element.x > x1 ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.distance)(element.x, x1) * window.devicePixelRatio * scale : 0;\n canvasOffsetY = element.y > y1 ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.distance)(element.y, y1) * window.devicePixelRatio * scale : 0;\n context.translate(canvasOffsetX, canvasOffsetY);\n }\n\n context.save();\n context.translate(padding * scale, padding * scale);\n context.scale(window.devicePixelRatio * scale, window.devicePixelRatio * scale);\n const rc = roughjs_bin_rough__WEBPACK_IMPORTED_MODULE_0__[\"default\"].canvas(canvas); // in dark theme, revert the image color filter\n\n if (shouldResetImageFilter(element, renderConfig, appState)) {\n context.filter = IMAGE_INVERT_FILTER;\n }\n\n drawElementOnCanvas(element, rc, context, renderConfig);\n context.restore();\n const boundTextElement = (0,_textElement__WEBPACK_IMPORTED_MODULE_7__.getBoundTextElement)(element, elementsMap);\n const boundTextCanvas = document.createElement(\"canvas\");\n const boundTextCanvasContext = boundTextCanvas.getContext(\"2d\");\n\n if ((0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isArrowElement)(element) && boundTextElement) {\n const [x1, y1, x2, y2] = (0,_bounds__WEBPACK_IMPORTED_MODULE_4__.getElementAbsoluteCoords)(element, elementsMap); // Take max dimensions of arrow canvas so that when canvas is rotated\n // the arrow doesn't get clipped\n\n const maxDim = Math.max((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.distance)(x1, x2), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.distance)(y1, y2));\n boundTextCanvas.width = maxDim * window.devicePixelRatio * scale + padding * scale * 10;\n boundTextCanvas.height = maxDim * window.devicePixelRatio * scale + padding * scale * 10;\n boundTextCanvasContext.translate(boundTextCanvas.width / 2, boundTextCanvas.height / 2);\n boundTextCanvasContext.rotate(element.angle);\n boundTextCanvasContext.drawImage(canvas, -canvas.width / 2, -canvas.height / 2, canvas.width, canvas.height);\n const [,,,, boundTextCx, boundTextCy] = (0,_bounds__WEBPACK_IMPORTED_MODULE_4__.getElementAbsoluteCoords)(boundTextElement, elementsMap);\n boundTextCanvasContext.rotate(-element.angle);\n const offsetX = (boundTextCanvas.width - canvas.width) / 2;\n const offsetY = (boundTextCanvas.height - canvas.height) / 2;\n const shiftX = boundTextCanvas.width / 2 - (boundTextCx - x1) * window.devicePixelRatio * scale - offsetX - padding * scale;\n const shiftY = boundTextCanvas.height / 2 - (boundTextCy - y1) * window.devicePixelRatio * scale - offsetY - padding * scale;\n boundTextCanvasContext.translate(-shiftX, -shiftY); // Clear the bound text area\n\n boundTextCanvasContext.clearRect(-(boundTextElement.width / 2 + _excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.BOUND_TEXT_PADDING) * window.devicePixelRatio * scale, -(boundTextElement.height / 2 + _excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.BOUND_TEXT_PADDING) * window.devicePixelRatio * scale, (boundTextElement.width + _excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.BOUND_TEXT_PADDING * 2) * window.devicePixelRatio * scale, (boundTextElement.height + _excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.BOUND_TEXT_PADDING * 2) * window.devicePixelRatio * scale);\n }\n\n return {\n element,\n canvas,\n theme: appState.theme,\n scale,\n zoomValue: zoom.value,\n canvasOffsetX,\n canvasOffsetY,\n boundTextElementVersion: ((_a = (0,_textElement__WEBPACK_IMPORTED_MODULE_7__.getBoundTextElement)(element, elementsMap)) === null || _a === void 0 ? void 0 : _a.version) || null,\n containingFrameOpacity: ((_b = (0,_frame__WEBPACK_IMPORTED_MODULE_10__.getContainingFrame)(element, elementsMap)) === null || _b === void 0 ? void 0 : _b.opacity) || 100,\n boundTextCanvas,\n angle: element.angle,\n imageCrop: (0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isImageElement)(element) ? element.crop : null\n };\n};\n\nconst DEFAULT_LINK_SIZE = 14;\nconst IMAGE_PLACEHOLDER_IMG = typeof document !== \"undefined\" ? document.createElement(\"img\") : {\n src: \"\"\n}; // mock image element outside of browser\n\nIMAGE_PLACEHOLDER_IMG.src = `data:${_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.MIME_TYPES.svg},${encodeURIComponent(`<svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"fas\" data-icon=\"image\" class=\"svg-inline--fa fa-image fa-w-16\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path fill=\"#888\" d=\"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z\"></path></svg>`)}`;\nconst IMAGE_ERROR_PLACEHOLDER_IMG = typeof document !== \"undefined\" ? document.createElement(\"img\") : {\n src: \"\"\n}; // mock image element outside of browser\n\nIMAGE_ERROR_PLACEHOLDER_IMG.src = `data:${_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.MIME_TYPES.svg},${encodeURIComponent(`<svg viewBox=\"0 0 668 668\" xmlns=\"http://www.w3.org/2000/svg\" xml:space=\"preserve\" style=\"fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2\"><path d=\"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48ZM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56ZM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48Z\" style=\"fill:#888;fill-rule:nonzero\" transform=\"matrix(.81709 0 0 .81709 124.825 145.825)\"/><path d=\"M256 8C119.034 8 8 119.033 8 256c0 136.967 111.034 248 248 248s248-111.034 248-248S392.967 8 256 8Zm130.108 117.892c65.448 65.448 70 165.481 20.677 235.637L150.47 105.216c70.204-49.356 170.226-44.735 235.638 20.676ZM125.892 386.108c-65.448-65.448-70-165.481-20.677-235.637L361.53 406.784c-70.203 49.356-170.226 44.736-235.638-20.676Z\" style=\"fill:#888;fill-rule:nonzero\" transform=\"matrix(.30366 0 0 .30366 506.822 60.065)\"/></svg>`)}`;\n\nconst drawImagePlaceholder = (element, context) => {\n context.fillStyle = \"#E7E7E7\";\n context.fillRect(0, 0, element.width, element.height);\n const imageMinWidthOrHeight = Math.min(element.width, element.height);\n const size = Math.min(imageMinWidthOrHeight, Math.min(imageMinWidthOrHeight * 0.4, 100));\n context.drawImage(element.status === \"error\" ? IMAGE_ERROR_PLACEHOLDER_IMG : IMAGE_PLACEHOLDER_IMG, element.width / 2 - size / 2, element.height / 2 - size / 2, size, size);\n};\n\nconst drawElementOnCanvas = (element, rc, context, renderConfig) => {\n var _a, _b, _c, _d;\n\n switch (element.type) {\n case \"rectangle\":\n case \"iframe\":\n case \"embeddable\":\n case \"diamond\":\n case \"ellipse\":\n {\n context.lineJoin = \"round\";\n context.lineCap = \"round\";\n rc.draw(_shape__WEBPACK_IMPORTED_MODULE_12__.ShapeCache.get(element));\n break;\n }\n\n case \"arrow\":\n case \"line\":\n {\n context.lineJoin = \"round\";\n context.lineCap = \"round\";\n _shape__WEBPACK_IMPORTED_MODULE_12__.ShapeCache.get(element).forEach(shape => {\n rc.draw(shape);\n });\n break;\n }\n\n case \"freedraw\":\n {\n // Draw directly to canvas\n context.save();\n context.fillStyle = element.strokeColor;\n const path = getFreeDrawPath2D(element);\n const fillShape = _shape__WEBPACK_IMPORTED_MODULE_12__.ShapeCache.get(element);\n\n if (fillShape) {\n rc.draw(fillShape);\n } //zsviczian\n\n\n if ((_b = (_a = element.customData) === null || _a === void 0 ? void 0 : _a.strokeOptions) === null || _b === void 0 ? void 0 : _b.hasOutline) {\n context.lineWidth = element.strokeWidth * ((_c = element.customData.strokeOptions.outlineWidth) !== null && _c !== void 0 ? _c : 1);\n context.strokeStyle = element.strokeColor;\n context.stroke(path);\n context.fillStyle = element.backgroundColor;\n } else {\n context.fillStyle = element.strokeColor;\n }\n\n context.fill(path);\n context.restore();\n break;\n }\n\n case \"image\":\n {\n const img = (0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isInitializedImageElement)(element) ? (_d = renderConfig.imageCache.get(element.fileId)) === null || _d === void 0 ? void 0 : _d.image : undefined;\n\n if (img != null && !(img instanceof Promise)) {\n if (element.roundness && context.roundRect) {\n context.beginPath();\n context.roundRect(0, 0, element.width, element.height, (0,_utils__WEBPACK_IMPORTED_MODULE_11__.getCornerRadius)(Math.min(element.width, element.height), element));\n context.clip();\n }\n\n const {\n x,\n y,\n width,\n height\n } = element.crop ? element.crop : {\n x: 0,\n y: 0,\n width: img.naturalWidth,\n height: img.naturalHeight\n };\n context.drawImage(img, x, y, width, height, 0\n /* hardcoded for the selection box*/\n , 0, element.width, element.height);\n } else {\n drawImagePlaceholder(element, context);\n }\n\n break;\n }\n\n default:\n {\n if ((0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isTextElement)(element)) {\n const rtl = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.isRTL)(element.text);\n const shouldTemporarilyAttach = rtl && !context.canvas.isConnected;\n\n if (shouldTemporarilyAttach) {\n // to correctly render RTL text mixed with LTR, we have to append it\n // to the DOM\n document.body.appendChild(context.canvas);\n }\n\n context.canvas.setAttribute(\"dir\", rtl ? \"rtl\" : \"ltr\");\n context.save();\n context.font = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.getFontString)(element);\n context.fillStyle = element.strokeColor;\n context.textAlign = element.textAlign; // Canvas does not support multiline text by default\n\n const lines = element.text.replace(/\\r\\n?/g, \"\\n\").split(\"\\n\");\n const horizontalOffset = element.textAlign === \"center\" ? element.width / 2 : element.textAlign === \"right\" ? element.width : 0;\n const lineHeightPx = (0,_textMeasurements__WEBPACK_IMPORTED_MODULE_8__.getLineHeightInPx)(element.fontSize, element.lineHeight);\n const verticalOffset = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.getVerticalOffset)(element.fontFamily, element.fontSize, lineHeightPx);\n\n for (let index = 0; index < lines.length; index++) {\n context.fillText(lines[index], horizontalOffset, index * lineHeightPx + verticalOffset);\n }\n\n context.restore();\n\n if (shouldTemporarilyAttach) {\n context.canvas.remove();\n }\n } else {\n throw new Error(`Unimplemented type ${element.type}`);\n }\n }\n }\n};\n\nconst elementWithCanvasCache = new WeakMap();\n\nconst generateElementWithCanvas = (element, elementsMap, renderConfig, appState) => {\n var _a;\n\n const zoom = renderConfig ? appState.zoom : {\n value: 1\n };\n const prevElementWithCanvas = elementWithCanvasCache.get(element);\n const shouldRegenerateBecauseZoom = prevElementWithCanvas && prevElementWithCanvas.zoomValue !== zoom.value && !(appState === null || appState === void 0 ? void 0 : appState.shouldCacheIgnoreZoom);\n const boundTextElement = (0,_textElement__WEBPACK_IMPORTED_MODULE_7__.getBoundTextElement)(element, elementsMap);\n const boundTextElementVersion = (boundTextElement === null || boundTextElement === void 0 ? void 0 : boundTextElement.version) || null;\n const imageCrop = (0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isImageElement)(element) ? element.crop : null;\n const containingFrameOpacity = ((_a = (0,_frame__WEBPACK_IMPORTED_MODULE_10__.getContainingFrame)(element, elementsMap)) === null || _a === void 0 ? void 0 : _a.opacity) || 100;\n\n if (!prevElementWithCanvas || shouldRegenerateBecauseZoom || prevElementWithCanvas.theme !== appState.theme || prevElementWithCanvas.boundTextElementVersion !== boundTextElementVersion || prevElementWithCanvas.imageCrop !== imageCrop || prevElementWithCanvas.containingFrameOpacity !== containingFrameOpacity || // since we rotate the canvas when copying from cached canvas, we don't\n // regenerate the cached canvas. But we need to in case of labels which are\n // cached alongside the arrow, and we want the labels to remain unrotated\n // with respect to the arrow.\n (0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isArrowElement)(element) && boundTextElement && element.angle !== prevElementWithCanvas.angle) {\n const elementWithCanvas = generateElementCanvas(element, elementsMap, zoom, renderConfig, appState);\n\n if (!elementWithCanvas) {\n return null;\n }\n\n elementWithCanvasCache.set(element, elementWithCanvas);\n return elementWithCanvas;\n }\n\n return prevElementWithCanvas;\n};\n\nconst drawElementFromCanvas = (elementWithCanvas, context, renderConfig, appState, allElementsMap) => {\n const element = elementWithCanvas.element;\n const padding = getCanvasPadding(element);\n const zoom = elementWithCanvas.scale;\n const [x1, y1, x2, y2] = (0,_bounds__WEBPACK_IMPORTED_MODULE_4__.getElementAbsoluteCoords)(element, allElementsMap);\n const cx = ((x1 + x2) / 2 + appState.scrollX) * window.devicePixelRatio;\n const cy = ((y1 + y2) / 2 + appState.scrollY) * window.devicePixelRatio;\n context.save();\n context.scale(1 / window.devicePixelRatio, 1 / window.devicePixelRatio);\n const boundTextElement = (0,_textElement__WEBPACK_IMPORTED_MODULE_7__.getBoundTextElement)(element, allElementsMap);\n\n if ((0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isArrowElement)(element) && boundTextElement) {\n const offsetX = (elementWithCanvas.boundTextCanvas.width - elementWithCanvas.canvas.width) / 2;\n const offsetY = (elementWithCanvas.boundTextCanvas.height - elementWithCanvas.canvas.height) / 2;\n context.translate(cx, cy);\n context.drawImage(elementWithCanvas.boundTextCanvas, -(x2 - x1) / 2 * window.devicePixelRatio - offsetX / zoom - padding, -(y2 - y1) / 2 * window.devicePixelRatio - offsetY / zoom - padding, elementWithCanvas.boundTextCanvas.width / zoom, elementWithCanvas.boundTextCanvas.height / zoom);\n } else {\n // we translate context to element center so that rotation and scale\n // originates from the element center\n context.translate(cx, cy);\n context.rotate(element.angle);\n\n if (\"scale\" in elementWithCanvas.element && !isPendingImageElement(element, renderConfig) && !(0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isIframeLikeElement)(element) //zsviczian\n ) {\n context.scale(elementWithCanvas.element.scale[0], elementWithCanvas.element.scale[1]);\n } // revert afterwards we don't have account for it during drawing\n\n\n context.translate(-cx, -cy);\n context.drawImage(elementWithCanvas.canvas, (x1 + appState.scrollX) * window.devicePixelRatio - padding * elementWithCanvas.scale / elementWithCanvas.scale, (y1 + appState.scrollY) * window.devicePixelRatio - padding * elementWithCanvas.scale / elementWithCanvas.scale, elementWithCanvas.canvas.width / elementWithCanvas.scale, elementWithCanvas.canvas.height / elementWithCanvas.scale);\n\n if (false) {}\n }\n\n context.restore(); // Clear the nested element we appended to the DOM\n};\n\nconst renderSelectionElement = (element, context, appState, selectionColor) => {\n var _a;\n\n context.save();\n context.translate(element.x + appState.scrollX, element.y + appState.scrollY);\n context.fillStyle = (_a = appState.gridColor.Bold) !== null && _a !== void 0 ? _a : \"rgba(0, 0, 200, 0.04)\"; //zsviczian\n // render from 0.5px offset to get 1px wide line\n // https://stackoverflow.com/questions/7530593/html5-canvas-and-line-width/7531540#7531540\n // TODO can be be improved by offseting to the negative when user selects\n // from right to left\n\n const offset = 0.5 / appState.zoom.value;\n context.fillRect(offset, offset, element.width, element.height);\n context.lineWidth = 1 / appState.zoom.value;\n context.strokeStyle = selectionColor;\n context.strokeRect(offset, offset, element.width, element.height);\n context.restore();\n};\nconst renderElement = (element, elementsMap, allElementsMap, rc, context, renderConfig, appState) => {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;\n\n const reduceAlphaForSelection = ((_a = appState.openDialog) === null || _a === void 0 ? void 0 : _a.name) === \"elementLinkSelector\" && !appState.selectedElementIds[element.id] && !appState.hoveredElementIds[element.id];\n context.globalAlpha = getRenderOpacity(element, (0,_frame__WEBPACK_IMPORTED_MODULE_10__.getContainingFrame)(element, elementsMap), renderConfig.elementsPendingErasure, renderConfig.pendingFlowchartNodes, reduceAlphaForSelection ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_REDUCED_GLOBAL_ALPHA : 1);\n\n switch (element.type) {\n case \"magicframe\":\n case \"frame\":\n {\n if ( //zsviczian\n appState.frameRendering.enabled && appState.frameRendering.outline && !(!appState.frameRendering.markerEnabled && element.frameRole === \"marker\")) {\n context.save();\n context.translate(element.x + appState.scrollX, element.y + appState.scrollY);\n context.fillStyle = (_f = (_d = (_c = (_b = element.customData) === null || _b === void 0 ? void 0 : _b.frameColor) === null || _c === void 0 ? void 0 : _c.fill) !== null && _d !== void 0 ? _d : (_e = appState === null || appState === void 0 ? void 0 : appState.frameColor) === null || _e === void 0 ? void 0 : _e.fill) !== null && _f !== void 0 ? _f : \"rgba(0, 0, 200, 0.04)\"; //zsviczian\n\n context.lineWidth = _excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.FRAME_STYLE.strokeWidth / appState.zoom.value;\n context.strokeStyle = (_l = (_j = (_h = (_g = element.customData) === null || _g === void 0 ? void 0 : _g.frameColor) === null || _h === void 0 ? void 0 : _h.stroke) !== null && _j !== void 0 ? _j : (_k = appState === null || appState === void 0 ? void 0 : appState.frameColor) === null || _k === void 0 ? void 0 : _k.stroke) !== null && _l !== void 0 ? _l : _excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.FRAME_STYLE.strokeColor; //zsviczian\n // TODO change later to only affect AI frames\n\n if ((0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isMagicFrameElement)(element)) {\n context.strokeStyle = appState.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.THEME.LIGHT ? \"#7affd7\" : \"#1d8264\";\n } //zsviczian\n\n\n if (element.frameRole === \"marker\") {\n const dash = 8 / appState.zoom.value;\n const gap = 6 / appState.zoom.value;\n context.setLineDash([dash, gap]);\n }\n\n if (_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.FRAME_STYLE.radius && context.roundRect && element.frameRole !== \"marker\") {\n //zsviczian\n context.beginPath();\n context.roundRect(0, 0, element.width, element.height, _excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.FRAME_STYLE.radius / appState.zoom.value);\n context.stroke();\n context.closePath();\n } else {\n context.strokeRect(0, 0, element.width, element.height);\n }\n\n context.restore();\n }\n\n break;\n }\n\n case \"freedraw\":\n {\n // TODO investigate if we can do this in situ. Right now we need to call\n // beforehand because math helpers (such as getElementAbsoluteCoords)\n // rely on existing shapes\n _shape__WEBPACK_IMPORTED_MODULE_12__.ShapeCache.generateElementShape(element, null);\n\n if (renderConfig.isExporting) {\n const [x1, y1, x2, y2] = (0,_bounds__WEBPACK_IMPORTED_MODULE_4__.getElementAbsoluteCoords)(element, elementsMap);\n const cx = (x1 + x2) / 2 + appState.scrollX;\n const cy = (y1 + y2) / 2 + appState.scrollY;\n const shiftX = (x2 - x1) / 2 - (element.x - x1);\n const shiftY = (y2 - y1) / 2 - (element.y - y1);\n context.save();\n context.translate(cx, cy);\n context.rotate(element.angle);\n context.translate(-shiftX, -shiftY);\n drawElementOnCanvas(element, rc, context, renderConfig);\n context.restore();\n } else {\n const elementWithCanvas = generateElementWithCanvas(element, allElementsMap, renderConfig, appState);\n\n if (!elementWithCanvas) {\n return;\n }\n\n drawElementFromCanvas(elementWithCanvas, context, renderConfig, appState, allElementsMap);\n }\n\n break;\n }\n\n case \"rectangle\":\n case \"diamond\":\n case \"ellipse\":\n case \"line\":\n case \"arrow\":\n case \"image\":\n case \"text\":\n case \"iframe\":\n case \"embeddable\":\n {\n // TODO investigate if we can do this in situ. Right now we need to call\n // beforehand because math helpers (such as getElementAbsoluteCoords)\n // rely on existing shapes\n _shape__WEBPACK_IMPORTED_MODULE_12__.ShapeCache.generateElementShape(element, renderConfig);\n\n if (renderConfig.isExporting) {\n const [x1, y1, x2, y2] = (0,_bounds__WEBPACK_IMPORTED_MODULE_4__.getElementAbsoluteCoords)(element, elementsMap);\n const cx = (x1 + x2) / 2 + appState.scrollX;\n const cy = (y1 + y2) / 2 + appState.scrollY;\n let shiftX = (x2 - x1) / 2 - (element.x - x1);\n let shiftY = (y2 - y1) / 2 - (element.y - y1);\n\n if ((0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isTextElement)(element)) {\n const container = (0,_textElement__WEBPACK_IMPORTED_MODULE_7__.getContainerElement)(element, elementsMap);\n\n if ((0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isArrowElement)(container)) {\n const boundTextCoords = _linearElementEditor__WEBPACK_IMPORTED_MODULE_6__.LinearElementEditor.getBoundTextElementPosition(container, element, elementsMap);\n shiftX = (x2 - x1) / 2 - (boundTextCoords.x - x1);\n shiftY = (y2 - y1) / 2 - (boundTextCoords.y - y1);\n }\n }\n\n context.save();\n context.translate(cx, cy);\n\n if (shouldResetImageFilter(element, renderConfig, appState)) {\n context.filter = \"none\";\n }\n\n const boundTextElement = (0,_textElement__WEBPACK_IMPORTED_MODULE_7__.getBoundTextElement)(element, elementsMap);\n\n if ((0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isArrowElement)(element) && boundTextElement) {\n const tempCanvas = document.createElement(\"canvas\");\n const tempCanvasContext = tempCanvas.getContext(\"2d\"); // Take max dimensions of arrow canvas so that when canvas is rotated\n // the arrow doesn't get clipped\n\n const maxDim = Math.max((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.distance)(x1, x2), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.distance)(y1, y2));\n const padding = getCanvasPadding(element);\n tempCanvas.width = maxDim * appState.exportScale + padding * 10 * appState.exportScale;\n tempCanvas.height = maxDim * appState.exportScale + padding * 10 * appState.exportScale;\n tempCanvasContext.translate(tempCanvas.width / 2, tempCanvas.height / 2);\n tempCanvasContext.scale(appState.exportScale, appState.exportScale); // Shift the canvas to left most point of the arrow\n\n shiftX = element.width / 2 - (element.x - x1);\n shiftY = element.height / 2 - (element.y - y1);\n tempCanvasContext.rotate(element.angle);\n const tempRc = roughjs_bin_rough__WEBPACK_IMPORTED_MODULE_0__[\"default\"].canvas(tempCanvas);\n tempCanvasContext.translate(-shiftX, -shiftY);\n drawElementOnCanvas(element, tempRc, tempCanvasContext, renderConfig);\n tempCanvasContext.translate(shiftX, shiftY);\n tempCanvasContext.rotate(-element.angle); // Shift the canvas to center of bound text\n\n const [,,,, boundTextCx, boundTextCy] = (0,_bounds__WEBPACK_IMPORTED_MODULE_4__.getElementAbsoluteCoords)(boundTextElement, elementsMap);\n const boundTextShiftX = (x1 + x2) / 2 - boundTextCx;\n const boundTextShiftY = (y1 + y2) / 2 - boundTextCy;\n tempCanvasContext.translate(-boundTextShiftX, -boundTextShiftY); // Clear the bound text area\n\n tempCanvasContext.clearRect(-boundTextElement.width / 2, -boundTextElement.height / 2, boundTextElement.width, boundTextElement.height);\n context.scale(1 / appState.exportScale, 1 / appState.exportScale);\n context.drawImage(tempCanvas, -tempCanvas.width / 2, -tempCanvas.height / 2, tempCanvas.width, tempCanvas.height);\n } else {\n context.rotate(element.angle);\n\n if (element.type === \"image\") {\n // note: scale must be applied *after* rotating\n context.scale(element.scale[0], element.scale[1]);\n }\n\n context.translate(-shiftX, -shiftY);\n drawElementOnCanvas(element, rc, context, renderConfig);\n }\n\n context.restore(); // not exporting → optimized rendering (cache & render from element\n // canvases)\n } else {\n const elementWithCanvas = generateElementWithCanvas(element, allElementsMap, renderConfig, appState);\n\n if (!elementWithCanvas) {\n return;\n }\n\n const currentImageSmoothingStatus = context.imageSmoothingEnabled;\n\n if ( // do not disable smoothing during zoom as blurry shapes look better\n // on low resolution (while still zooming in) than sharp ones\n !(appState === null || appState === void 0 ? void 0 : appState.shouldCacheIgnoreZoom) && ( // angle is 0 -> always disable smoothing\n !element.angle || // or check if angle is a right angle in which case we can still\n // disable smoothing without adversely affecting the result\n // We need less-than comparison because of FP artihmetic\n (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_2__.isRightAngleRads)(element.angle))) {\n // Disabling smoothing makes output much sharper, especially for\n // text. Unless for non-right angles, where the aliasing is really\n // terrible on Chromium.\n //\n // Note that `context.imageSmoothingQuality=\"high\"` has almost\n // zero effect.\n //\n context.imageSmoothingEnabled = false;\n }\n\n if (element.id === appState.croppingElementId && (0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isImageElement)(elementWithCanvas.element) && elementWithCanvas.element.crop !== null) {\n context.save();\n context.globalAlpha = 0.1;\n const uncroppedElementCanvas = generateElementCanvas((0,_cropElement__WEBPACK_IMPORTED_MODULE_5__.getUncroppedImageElement)(elementWithCanvas.element, elementsMap), allElementsMap, appState.zoom, renderConfig, appState);\n\n if (uncroppedElementCanvas) {\n drawElementFromCanvas(uncroppedElementCanvas, context, renderConfig, appState, allElementsMap);\n }\n\n context.restore();\n }\n\n drawElementFromCanvas(elementWithCanvas, context, renderConfig, appState, allElementsMap); // reset\n\n context.imageSmoothingEnabled = currentImageSmoothingStatus;\n }\n\n break;\n }\n\n default:\n {\n // @ts-ignore\n throw new Error(`Unimplemented type ${element.type}`);\n }\n }\n\n context.globalAlpha = 1;\n};\nconst pathsCache = new WeakMap([]);\nfunction generateFreeDrawShape(element) {\n const svgPathData = getFreeDrawSvgPath(element);\n const path = new Path2D(svgPathData);\n pathsCache.set(element, path);\n return path;\n}\nfunction getFreeDrawPath2D(element) {\n return pathsCache.get(element);\n}\nfunction getFreeDrawSvgPath(element) {\n return getSvgPathFromStroke(getFreedrawOutlinePoints(element));\n}\nfunction getFreedrawOutlineAsSegments(element, points, elementsMap) {\n const bounds = (0,_bounds__WEBPACK_IMPORTED_MODULE_4__.getElementBounds)(Object.assign(Object.assign({}, element), {\n angle: 0\n }), elementsMap);\n const center = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_2__.pointFrom)((bounds[0] + bounds[2]) / 2, (bounds[1] + bounds[3]) / 2);\n (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.invariant)(points.length >= 2, \"Freepath outline must have at least 2 points\");\n return points.slice(2).reduce((acc, curr) => {\n acc.push((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_2__.lineSegment)(acc[acc.length - 1][1], (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_2__.pointRotateRads)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_2__.pointFrom)(curr[0] + element.x, curr[1] + element.y), center, element.angle)));\n return acc;\n }, [(0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_2__.lineSegment)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_2__.pointRotateRads)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_2__.pointFrom)(points[0][0] + element.x, points[0][1] + element.y), center, element.angle), (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_2__.pointRotateRads)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_2__.pointFrom)(points[1][0] + element.x, points[1][1] + element.y), center, element.angle))]);\n}\nfunction getFreedrawOutlinePoints(element) {\n var _a, _b, _c, _d, _e, _f, _g, _h; // If input points are empty (should they ever be?) return a dot\n\n\n const inputPoints = element.simulatePressure ? element.points : element.points.length ? element.points.map(([x, y], i) => [x, y, element.pressures[i]]) : [[0, 0, 0.5]]; // Consider changing the options for simulated pressure vs real pressure\n\n const customOptions = (_b = (_a = element.customData) === null || _a === void 0 ? void 0 : _a.strokeOptions) === null || _b === void 0 ? void 0 : _b.options; //zsviczian\n\n const options = customOptions //zsviczian\n ? Object.assign(Object.assign(Object.assign(Object.assign({}, customOptions), {\n simulatePressure: (_c = customOptions.simulatePressure) !== null && _c !== void 0 ? _c : element.simulatePressure,\n size: element.strokeWidth * 4.25,\n last: true,\n easing: (_d = _easingFunctions__WEBPACK_IMPORTED_MODULE_13__[\"default\"][customOptions.easing]) !== null && _d !== void 0 ? _d : t => t\n }), ((_e = customOptions.start) === null || _e === void 0 ? void 0 : _e.easing) ? {\n start: Object.assign(Object.assign({}, customOptions.start), {\n easing: (_f = _easingFunctions__WEBPACK_IMPORTED_MODULE_13__[\"default\"][customOptions.start.easing]) !== null && _f !== void 0 ? _f : t => t\n })\n } : {\n start: customOptions.start\n }), ((_g = customOptions.end) === null || _g === void 0 ? void 0 : _g.easing) ? {\n end: Object.assign(Object.assign({}, customOptions.end), {\n easing: (_h = _easingFunctions__WEBPACK_IMPORTED_MODULE_13__[\"default\"][customOptions.end.easing]) !== null && _h !== void 0 ? _h : t => t\n })\n } : {\n end: customOptions.end\n }) : {\n simulatePressure: element.simulatePressure,\n size: element.strokeWidth * 4.25,\n thinning: 0.6,\n smoothing: 0.5,\n streamline: 0.5,\n easing: _easingFunctions__WEBPACK_IMPORTED_MODULE_13__[\"default\"].easeOutSine,\n last: true\n };\n return (0,perfect_freehand__WEBPACK_IMPORTED_MODULE_1__.getStroke)(inputPoints, options);\n}\n\nfunction med(A, B) {\n return [(A[0] + B[0]) / 2, (A[1] + B[1]) / 2];\n} // Trim SVG path data so number are each two decimal points. This\n// improves SVG exports, and prevents rendering errors on points\n// with long decimals.\n\n\nconst TO_FIXED_PRECISION = /(\\s?[A-Z]?,?-?[0-9]*\\.[0-9]{0,2})(([0-9]|e|-)*)/g;\n\nfunction getSvgPathFromStroke(points) {\n if (!points.length) {\n return \"\";\n }\n\n const max = points.length - 1;\n return points.reduce((acc, point, i, arr) => {\n if (i === max) {\n acc.push(point, med(point, arr[0]), \"L\", arr[0], \"Z\");\n } else {\n acc.push(point, med(point, arr[i + 1]));\n }\n\n return acc;\n }, [\"M\", points[0], \"Q\"]).join(\" \").replace(TO_FIXED_PRECISION, \"$1\");\n}\n\n//# sourceURL=webpack://ExcalidrawLib/../element/src/renderElement.ts?");
13424
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DEFAULT_LINK_SIZE: () => (/* binding */ DEFAULT_LINK_SIZE),\n/* harmony export */ IMAGE_INVERT_FILTER: () => (/* binding */ IMAGE_INVERT_FILTER),\n/* harmony export */ elementWithCanvasCache: () => (/* binding */ elementWithCanvasCache),\n/* harmony export */ generateFreeDrawShape: () => (/* binding */ generateFreeDrawShape),\n/* harmony export */ getFreeDrawPath2D: () => (/* binding */ getFreeDrawPath2D),\n/* harmony export */ getFreeDrawSvgPath: () => (/* binding */ getFreeDrawSvgPath),\n/* harmony export */ getFreedrawOutlineAsSegments: () => (/* binding */ getFreedrawOutlineAsSegments),\n/* harmony export */ getFreedrawOutlinePoints: () => (/* binding */ getFreedrawOutlinePoints),\n/* harmony export */ getRenderOpacity: () => (/* binding */ getRenderOpacity),\n/* harmony export */ pathsCache: () => (/* binding */ pathsCache),\n/* harmony export */ renderElement: () => (/* binding */ renderElement),\n/* harmony export */ renderSelectionElement: () => (/* binding */ renderSelectionElement)\n/* harmony export */ });\n/* harmony import */ var roughjs_bin_rough__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! roughjs/bin/rough */ \"../../node_modules/roughjs/bin/rough.js\");\n/* harmony import */ var perfect_freehand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! perfect-freehand */ \"../../node_modules/perfect-freehand/dist/esm/index.js\");\n/* harmony import */ var _excalidraw_math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @excalidraw/math */ \"../math/src/index.ts\");\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n/* harmony import */ var _bounds__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./bounds */ \"../element/src/bounds.ts\");\n/* harmony import */ var _cropElement__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./cropElement */ \"../element/src/cropElement.ts\");\n/* harmony import */ var _linearElementEditor__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./linearElementEditor */ \"../element/src/linearElementEditor.ts\");\n/* harmony import */ var _textElement__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./textElement */ \"../element/src/textElement.ts\");\n/* harmony import */ var _textMeasurements__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./textMeasurements */ \"../element/src/textMeasurements.ts\");\n/* harmony import */ var _typeChecks__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @excalidraw/element/typeChecks */ \"../element/src/typeChecks.ts\");\n/* harmony import */ var _frame__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./frame */ \"../element/src/frame.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils */ \"../element/src/utils.ts\");\n/* harmony import */ var _shape__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./shape */ \"../element/src/shape.ts\");\n/* harmony import */ var _easingFunctions__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./easingFunctions */ \"../element/src/easingFunctions.ts\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n // using a stronger invert (100% vs our regular 93%) and saturate\n// as a temp hack to make images in dark theme look closer to original\n// color scheme (it's still not quite there and the colors look slightly\n// desatured, alas...)\n\nconst IMAGE_INVERT_FILTER = \"invert(100%) hue-rotate(180deg) saturate(1.25)\";\n\nconst isPendingImageElement = (element, renderConfig) => (0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isInitializedImageElement)(element) && !renderConfig.imageCache.has(element.fileId);\n\nconst shouldResetImageFilter = (element, renderConfig, appState) => {\n var _a;\n\n return appState.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.THEME.DARK && (0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isInitializedImageElement)(element) && !isPendingImageElement(element, renderConfig) && ((_a = renderConfig.imageCache.get(element.fileId)) === null || _a === void 0 ? void 0 : _a.mimeType) !== _excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.MIME_TYPES.svg;\n};\n\nconst getCanvasPadding = element => {\n switch (element.type) {\n case \"freedraw\":\n return element.strokeWidth * 12;\n\n case \"text\":\n return element.fontSize / 2;\n\n case \"arrow\":\n if (element.endArrowhead || element.endArrowhead) {\n return 40;\n }\n\n return 20;\n\n default:\n return 20;\n }\n};\n\nconst getRenderOpacity = (element, containingFrame, elementsPendingErasure, pendingNodes, globalAlpha = 1) => {\n var _a; // multiplying frame opacity with element opacity to combine them\n // (e.g. frame 50% and element 50% opacity should result in 25% opacity)\n\n\n let opacity = ((_a = containingFrame === null || containingFrame === void 0 ? void 0 : containingFrame.opacity) !== null && _a !== void 0 ? _a : 100) * element.opacity / 10000 * globalAlpha; // if pending erasure, multiply again to combine further\n // (so that erasing always results in lower opacity than original)\n\n if (elementsPendingErasure.has(element.id) || pendingNodes && pendingNodes.some(node => node.id === element.id) || containingFrame && elementsPendingErasure.has(containingFrame.id)) {\n opacity *= _excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.ELEMENT_READY_TO_ERASE_OPACITY / 100;\n }\n\n return opacity;\n};\n\nconst cappedElementCanvasSize = (element, elementsMap, zoom) => {\n // these limits are ballpark, they depend on specific browsers and device.\n // We've chosen lower limits to be safe. We might want to change these limits\n // based on browser/device type, if we get reports of low quality rendering\n // on zoom.\n //\n // ~ safari mobile canvas area limit\n const AREA_LIMIT = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.getAreaLimit)(); //zsviczian\n // ~ safari width/height limit based on developer.mozilla.org.\n\n const WIDTH_HEIGHT_LIMIT = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.getWidthHeightLimit)(); //zsviczian\n\n const padding = getCanvasPadding(element);\n const [x1, y1, x2, y2] = (0,_bounds__WEBPACK_IMPORTED_MODULE_4__.getElementAbsoluteCoords)(element, elementsMap);\n const elementWidth = (0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isLinearElement)(element) || (0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isFreeDrawElement)(element) ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.distance)(x1, x2) : element.width;\n const elementHeight = (0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isLinearElement)(element) || (0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isFreeDrawElement)(element) ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.distance)(y1, y2) : element.height;\n let width = elementWidth * window.devicePixelRatio + padding * 2;\n let height = elementHeight * window.devicePixelRatio + padding * 2;\n let scale = zoom.value; // rescale to ensure width and height is within limits\n\n if (width * scale > WIDTH_HEIGHT_LIMIT || height * scale > WIDTH_HEIGHT_LIMIT) {\n scale = Math.min(WIDTH_HEIGHT_LIMIT / width, WIDTH_HEIGHT_LIMIT / height);\n } // rescale to ensure canvas area is within limits\n\n\n if (width * height * scale * scale > AREA_LIMIT) {\n scale = Math.sqrt(AREA_LIMIT / (width * height));\n }\n\n width = Math.floor(width * scale);\n height = Math.floor(height * scale);\n return {\n width,\n height,\n scale\n };\n};\n\nconst generateElementCanvas = (element, elementsMap, zoom, renderConfig, appState) => {\n var _a, _b;\n\n const canvas = document.createElement(\"canvas\");\n const context = canvas.getContext(\"2d\");\n const padding = getCanvasPadding(element);\n const {\n width,\n height,\n scale\n } = cappedElementCanvasSize(element, elementsMap, zoom);\n\n if (!width || !height) {\n return null;\n }\n\n canvas.width = width;\n canvas.height = height;\n let canvasOffsetX = -100;\n let canvasOffsetY = 0;\n\n if ((0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isLinearElement)(element) || (0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isFreeDrawElement)(element)) {\n const [x1, y1] = (0,_bounds__WEBPACK_IMPORTED_MODULE_4__.getElementAbsoluteCoords)(element, elementsMap);\n canvasOffsetX = element.x > x1 ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.distance)(element.x, x1) * window.devicePixelRatio * scale : 0;\n canvasOffsetY = element.y > y1 ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.distance)(element.y, y1) * window.devicePixelRatio * scale : 0;\n context.translate(canvasOffsetX, canvasOffsetY);\n }\n\n context.save();\n context.translate(padding * scale, padding * scale);\n context.scale(window.devicePixelRatio * scale, window.devicePixelRatio * scale);\n const rc = roughjs_bin_rough__WEBPACK_IMPORTED_MODULE_0__[\"default\"].canvas(canvas); // in dark theme, revert the image color filter\n\n if (shouldResetImageFilter(element, renderConfig, appState)) {\n context.filter = IMAGE_INVERT_FILTER;\n }\n\n drawElementOnCanvas(element, rc, context, renderConfig);\n context.restore();\n const boundTextElement = (0,_textElement__WEBPACK_IMPORTED_MODULE_7__.getBoundTextElement)(element, elementsMap);\n const boundTextCanvas = document.createElement(\"canvas\");\n const boundTextCanvasContext = boundTextCanvas.getContext(\"2d\");\n\n if ((0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isArrowElement)(element) && boundTextElement) {\n const [x1, y1, x2, y2] = (0,_bounds__WEBPACK_IMPORTED_MODULE_4__.getElementAbsoluteCoords)(element, elementsMap); // Take max dimensions of arrow canvas so that when canvas is rotated\n // the arrow doesn't get clipped\n\n const maxDim = Math.max((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.distance)(x1, x2), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.distance)(y1, y2));\n boundTextCanvas.width = maxDim * window.devicePixelRatio * scale + padding * scale * 10;\n boundTextCanvas.height = maxDim * window.devicePixelRatio * scale + padding * scale * 10;\n boundTextCanvasContext.translate(boundTextCanvas.width / 2, boundTextCanvas.height / 2);\n boundTextCanvasContext.rotate(element.angle);\n boundTextCanvasContext.drawImage(canvas, -canvas.width / 2, -canvas.height / 2, canvas.width, canvas.height);\n const [,,,, boundTextCx, boundTextCy] = (0,_bounds__WEBPACK_IMPORTED_MODULE_4__.getElementAbsoluteCoords)(boundTextElement, elementsMap);\n boundTextCanvasContext.rotate(-element.angle);\n const offsetX = (boundTextCanvas.width - canvas.width) / 2;\n const offsetY = (boundTextCanvas.height - canvas.height) / 2;\n const shiftX = boundTextCanvas.width / 2 - (boundTextCx - x1) * window.devicePixelRatio * scale - offsetX - padding * scale;\n const shiftY = boundTextCanvas.height / 2 - (boundTextCy - y1) * window.devicePixelRatio * scale - offsetY - padding * scale;\n boundTextCanvasContext.translate(-shiftX, -shiftY); // Clear the bound text area\n\n boundTextCanvasContext.clearRect(-(boundTextElement.width / 2 + _excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.BOUND_TEXT_PADDING) * window.devicePixelRatio * scale, -(boundTextElement.height / 2 + _excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.BOUND_TEXT_PADDING) * window.devicePixelRatio * scale, (boundTextElement.width + _excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.BOUND_TEXT_PADDING * 2) * window.devicePixelRatio * scale, (boundTextElement.height + _excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.BOUND_TEXT_PADDING * 2) * window.devicePixelRatio * scale);\n }\n\n return {\n element,\n canvas,\n theme: appState.theme,\n scale,\n zoomValue: zoom.value,\n canvasOffsetX,\n canvasOffsetY,\n boundTextElementVersion: ((_a = (0,_textElement__WEBPACK_IMPORTED_MODULE_7__.getBoundTextElement)(element, elementsMap)) === null || _a === void 0 ? void 0 : _a.version) || null,\n containingFrameOpacity: ((_b = (0,_frame__WEBPACK_IMPORTED_MODULE_10__.getContainingFrame)(element, elementsMap)) === null || _b === void 0 ? void 0 : _b.opacity) || 100,\n boundTextCanvas,\n angle: element.angle,\n imageCrop: (0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isImageElement)(element) ? element.crop : null\n };\n};\n\nconst DEFAULT_LINK_SIZE = 14;\nconst IMAGE_PLACEHOLDER_IMG = typeof document !== \"undefined\" ? document.createElement(\"img\") : {\n src: \"\"\n}; // mock image element outside of browser\n\nIMAGE_PLACEHOLDER_IMG.src = `data:${_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.MIME_TYPES.svg},${encodeURIComponent(`<svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"fas\" data-icon=\"image\" class=\"svg-inline--fa fa-image fa-w-16\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path fill=\"#888\" d=\"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z\"></path></svg>`)}`;\nconst IMAGE_ERROR_PLACEHOLDER_IMG = typeof document !== \"undefined\" ? document.createElement(\"img\") : {\n src: \"\"\n}; // mock image element outside of browser\n\nIMAGE_ERROR_PLACEHOLDER_IMG.src = `data:${_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.MIME_TYPES.svg},${encodeURIComponent(`<svg viewBox=\"0 0 668 668\" xmlns=\"http://www.w3.org/2000/svg\" xml:space=\"preserve\" style=\"fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2\"><path d=\"M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48ZM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56ZM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48Z\" style=\"fill:#888;fill-rule:nonzero\" transform=\"matrix(.81709 0 0 .81709 124.825 145.825)\"/><path d=\"M256 8C119.034 8 8 119.033 8 256c0 136.967 111.034 248 248 248s248-111.034 248-248S392.967 8 256 8Zm130.108 117.892c65.448 65.448 70 165.481 20.677 235.637L150.47 105.216c70.204-49.356 170.226-44.735 235.638 20.676ZM125.892 386.108c-65.448-65.448-70-165.481-20.677-235.637L361.53 406.784c-70.203 49.356-170.226 44.736-235.638-20.676Z\" style=\"fill:#888;fill-rule:nonzero\" transform=\"matrix(.30366 0 0 .30366 506.822 60.065)\"/></svg>`)}`;\n\nconst drawImagePlaceholder = (element, context) => {\n context.fillStyle = \"#E7E7E7\";\n context.fillRect(0, 0, element.width, element.height);\n const imageMinWidthOrHeight = Math.min(element.width, element.height);\n const size = Math.min(imageMinWidthOrHeight, Math.min(imageMinWidthOrHeight * 0.4, 100));\n context.drawImage(element.status === \"error\" ? IMAGE_ERROR_PLACEHOLDER_IMG : IMAGE_PLACEHOLDER_IMG, element.width / 2 - size / 2, element.height / 2 - size / 2, size, size);\n};\n\nconst drawElementOnCanvas = (element, rc, context, renderConfig) => {\n var _a, _b, _c, _d;\n\n switch (element.type) {\n case \"rectangle\":\n case \"iframe\":\n case \"embeddable\":\n case \"diamond\":\n case \"ellipse\":\n {\n context.lineJoin = \"round\";\n context.lineCap = \"round\";\n rc.draw(_shape__WEBPACK_IMPORTED_MODULE_12__.ShapeCache.get(element));\n break;\n }\n\n case \"arrow\":\n case \"line\":\n {\n context.lineJoin = \"round\";\n context.lineCap = \"round\";\n _shape__WEBPACK_IMPORTED_MODULE_12__.ShapeCache.get(element).forEach(shape => {\n rc.draw(shape);\n });\n break;\n }\n\n case \"freedraw\":\n {\n // Draw directly to canvas\n context.save();\n context.fillStyle = element.strokeColor;\n const path = getFreeDrawPath2D(element);\n const fillShape = _shape__WEBPACK_IMPORTED_MODULE_12__.ShapeCache.get(element);\n\n if (fillShape) {\n rc.draw(fillShape);\n } //zsviczian\n\n\n if ((_b = (_a = element.customData) === null || _a === void 0 ? void 0 : _a.strokeOptions) === null || _b === void 0 ? void 0 : _b.hasOutline) {\n context.lineWidth = element.strokeWidth * ((_c = element.customData.strokeOptions.outlineWidth) !== null && _c !== void 0 ? _c : 1);\n context.strokeStyle = element.strokeColor;\n context.stroke(path);\n context.fillStyle = element.backgroundColor;\n } else {\n context.fillStyle = element.strokeColor;\n }\n\n context.fill(path);\n context.restore();\n break;\n }\n\n case \"image\":\n {\n const img = (0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isInitializedImageElement)(element) ? (_d = renderConfig.imageCache.get(element.fileId)) === null || _d === void 0 ? void 0 : _d.image : undefined;\n\n if (img != null && !(img instanceof Promise)) {\n if (element.roundness && context.roundRect) {\n context.beginPath();\n context.roundRect(0, 0, element.width, element.height, (0,_utils__WEBPACK_IMPORTED_MODULE_11__.getCornerRadius)(Math.min(element.width, element.height), element));\n context.clip();\n }\n\n const {\n x,\n y,\n width,\n height\n } = element.crop ? element.crop : {\n x: 0,\n y: 0,\n width: img.naturalWidth,\n height: img.naturalHeight\n };\n context.drawImage(img, x, y, width, height, 0\n /* hardcoded for the selection box*/\n , 0, element.width, element.height);\n } else {\n drawImagePlaceholder(element, context);\n }\n\n break;\n }\n\n default:\n {\n if ((0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isTextElement)(element)) {\n const rtl = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.isRTL)(element.text);\n const shouldTemporarilyAttach = rtl && !context.canvas.isConnected;\n\n if (shouldTemporarilyAttach) {\n // to correctly render RTL text mixed with LTR, we have to append it\n // to the DOM\n document.body.appendChild(context.canvas);\n }\n\n context.canvas.setAttribute(\"dir\", rtl ? \"rtl\" : \"ltr\");\n context.save();\n context.font = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.getFontString)(element);\n context.fillStyle = element.strokeColor;\n context.textAlign = element.textAlign; // Canvas does not support multiline text by default\n\n const lines = element.text.replace(/\\r\\n?/g, \"\\n\").split(\"\\n\");\n const horizontalOffset = element.textAlign === \"center\" ? element.width / 2 : element.textAlign === \"right\" ? element.width : 0;\n const lineHeightPx = (0,_textMeasurements__WEBPACK_IMPORTED_MODULE_8__.getLineHeightInPx)(element.fontSize, element.lineHeight);\n const verticalOffset = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.getVerticalOffset)(element.fontFamily, element.fontSize, lineHeightPx);\n\n for (let index = 0; index < lines.length; index++) {\n context.fillText(lines[index], horizontalOffset, index * lineHeightPx + verticalOffset);\n }\n\n context.restore();\n\n if (shouldTemporarilyAttach) {\n context.canvas.remove();\n }\n } else {\n throw new Error(`Unimplemented type ${element.type}`);\n }\n }\n }\n};\n\nconst elementWithCanvasCache = new WeakMap();\n\nconst generateElementWithCanvas = (element, elementsMap, renderConfig, appState) => {\n var _a;\n\n const zoom = renderConfig ? appState.zoom : {\n value: 1\n };\n const prevElementWithCanvas = elementWithCanvasCache.get(element);\n const shouldRegenerateBecauseZoom = prevElementWithCanvas && prevElementWithCanvas.zoomValue !== zoom.value && !(appState === null || appState === void 0 ? void 0 : appState.shouldCacheIgnoreZoom);\n const boundTextElement = (0,_textElement__WEBPACK_IMPORTED_MODULE_7__.getBoundTextElement)(element, elementsMap);\n const boundTextElementVersion = (boundTextElement === null || boundTextElement === void 0 ? void 0 : boundTextElement.version) || null;\n const imageCrop = (0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isImageElement)(element) ? element.crop : null;\n const containingFrameOpacity = ((_a = (0,_frame__WEBPACK_IMPORTED_MODULE_10__.getContainingFrame)(element, elementsMap)) === null || _a === void 0 ? void 0 : _a.opacity) || 100;\n\n if (!prevElementWithCanvas || shouldRegenerateBecauseZoom || prevElementWithCanvas.theme !== appState.theme || prevElementWithCanvas.boundTextElementVersion !== boundTextElementVersion || prevElementWithCanvas.imageCrop !== imageCrop || prevElementWithCanvas.containingFrameOpacity !== containingFrameOpacity || // since we rotate the canvas when copying from cached canvas, we don't\n // regenerate the cached canvas. But we need to in case of labels which are\n // cached alongside the arrow, and we want the labels to remain unrotated\n // with respect to the arrow.\n (0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isArrowElement)(element) && boundTextElement && element.angle !== prevElementWithCanvas.angle) {\n const elementWithCanvas = generateElementCanvas(element, elementsMap, zoom, renderConfig, appState);\n\n if (!elementWithCanvas) {\n return null;\n }\n\n elementWithCanvasCache.set(element, elementWithCanvas);\n return elementWithCanvas;\n }\n\n return prevElementWithCanvas;\n};\n\nconst drawElementFromCanvas = (elementWithCanvas, context, renderConfig, appState, allElementsMap) => {\n const element = elementWithCanvas.element;\n const padding = getCanvasPadding(element);\n const zoom = elementWithCanvas.scale;\n const [x1, y1, x2, y2] = (0,_bounds__WEBPACK_IMPORTED_MODULE_4__.getElementAbsoluteCoords)(element, allElementsMap);\n const cx = ((x1 + x2) / 2 + appState.scrollX) * window.devicePixelRatio;\n const cy = ((y1 + y2) / 2 + appState.scrollY) * window.devicePixelRatio;\n context.save();\n context.scale(1 / window.devicePixelRatio, 1 / window.devicePixelRatio);\n const boundTextElement = (0,_textElement__WEBPACK_IMPORTED_MODULE_7__.getBoundTextElement)(element, allElementsMap);\n\n if ((0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isArrowElement)(element) && boundTextElement) {\n const offsetX = (elementWithCanvas.boundTextCanvas.width - elementWithCanvas.canvas.width) / 2;\n const offsetY = (elementWithCanvas.boundTextCanvas.height - elementWithCanvas.canvas.height) / 2;\n context.translate(cx, cy);\n context.drawImage(elementWithCanvas.boundTextCanvas, -(x2 - x1) / 2 * window.devicePixelRatio - offsetX / zoom - padding, -(y2 - y1) / 2 * window.devicePixelRatio - offsetY / zoom - padding, elementWithCanvas.boundTextCanvas.width / zoom, elementWithCanvas.boundTextCanvas.height / zoom);\n } else {\n // we translate context to element center so that rotation and scale\n // originates from the element center\n context.translate(cx, cy);\n context.rotate(element.angle);\n\n if (\"scale\" in elementWithCanvas.element && !isPendingImageElement(element, renderConfig) && !(0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isIframeLikeElement)(element) //zsviczian\n ) {\n context.scale(elementWithCanvas.element.scale[0], elementWithCanvas.element.scale[1]);\n } // revert afterwards we don't have account for it during drawing\n\n\n context.translate(-cx, -cy);\n context.drawImage(elementWithCanvas.canvas, (x1 + appState.scrollX) * window.devicePixelRatio - padding * elementWithCanvas.scale / elementWithCanvas.scale, (y1 + appState.scrollY) * window.devicePixelRatio - padding * elementWithCanvas.scale / elementWithCanvas.scale, elementWithCanvas.canvas.width / elementWithCanvas.scale, elementWithCanvas.canvas.height / elementWithCanvas.scale);\n\n if (false) {}\n }\n\n context.restore(); // Clear the nested element we appended to the DOM\n};\n\nconst renderSelectionElement = (element, context, appState, selectionColor) => {\n context.save();\n context.translate(element.x + appState.scrollX, element.y + appState.scrollY);\n context.fillStyle = \"rgba(0, 0, 200, 0.04)\"; // render from 0.5px offset to get 1px wide line\n // https://stackoverflow.com/questions/7530593/html5-canvas-and-line-width/7531540#7531540\n // TODO can be be improved by offseting to the negative when user selects\n // from right to left\n\n const offset = 0.5 / appState.zoom.value;\n context.fillRect(offset, offset, element.width, element.height);\n context.lineWidth = 1.5 / appState.zoom.value; //zsviczian changed from 1 to 1.5\n\n context.strokeStyle = selectionColor;\n context.strokeRect(offset, offset, element.width, element.height);\n context.restore();\n};\nconst renderElement = (element, elementsMap, allElementsMap, rc, context, renderConfig, appState) => {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;\n\n const reduceAlphaForSelection = ((_a = appState.openDialog) === null || _a === void 0 ? void 0 : _a.name) === \"elementLinkSelector\" && !appState.selectedElementIds[element.id] && !appState.hoveredElementIds[element.id];\n context.globalAlpha = getRenderOpacity(element, (0,_frame__WEBPACK_IMPORTED_MODULE_10__.getContainingFrame)(element, elementsMap), renderConfig.elementsPendingErasure, renderConfig.pendingFlowchartNodes, reduceAlphaForSelection ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.DEFAULT_REDUCED_GLOBAL_ALPHA : 1);\n\n switch (element.type) {\n case \"magicframe\":\n case \"frame\":\n {\n if ( //zsviczian\n appState.frameRendering.enabled && appState.frameRendering.outline && !(!appState.frameRendering.markerEnabled && element.frameRole === \"marker\")) {\n context.save();\n context.translate(element.x + appState.scrollX, element.y + appState.scrollY);\n context.fillStyle = (_f = (_d = (_c = (_b = element.customData) === null || _b === void 0 ? void 0 : _b.frameColor) === null || _c === void 0 ? void 0 : _c.fill) !== null && _d !== void 0 ? _d : (_e = appState === null || appState === void 0 ? void 0 : appState.frameColor) === null || _e === void 0 ? void 0 : _e.fill) !== null && _f !== void 0 ? _f : \"rgba(0, 0, 200, 0.04)\"; //zsviczian\n\n context.lineWidth = _excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.FRAME_STYLE.strokeWidth / appState.zoom.value;\n context.strokeStyle = (_l = (_j = (_h = (_g = element.customData) === null || _g === void 0 ? void 0 : _g.frameColor) === null || _h === void 0 ? void 0 : _h.stroke) !== null && _j !== void 0 ? _j : (_k = appState === null || appState === void 0 ? void 0 : appState.frameColor) === null || _k === void 0 ? void 0 : _k.stroke) !== null && _l !== void 0 ? _l : _excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.FRAME_STYLE.strokeColor; //zsviczian\n // TODO change later to only affect AI frames\n\n if ((0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isMagicFrameElement)(element)) {\n context.strokeStyle = appState.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.THEME.LIGHT ? \"#7affd7\" : \"#1d8264\";\n } //zsviczian\n\n\n if (element.frameRole === \"marker\") {\n const dash = 8 / appState.zoom.value;\n const gap = 6 / appState.zoom.value;\n context.setLineDash([dash, gap]);\n }\n\n if (_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.FRAME_STYLE.radius && context.roundRect && element.frameRole !== \"marker\") {\n //zsviczian\n context.beginPath();\n context.roundRect(0, 0, element.width, element.height, _excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.FRAME_STYLE.radius / appState.zoom.value);\n context.stroke();\n context.closePath();\n } else {\n context.strokeRect(0, 0, element.width, element.height);\n }\n\n context.restore();\n }\n\n break;\n }\n\n case \"freedraw\":\n {\n // TODO investigate if we can do this in situ. Right now we need to call\n // beforehand because math helpers (such as getElementAbsoluteCoords)\n // rely on existing shapes\n _shape__WEBPACK_IMPORTED_MODULE_12__.ShapeCache.generateElementShape(element, null);\n\n if (renderConfig.isExporting) {\n const [x1, y1, x2, y2] = (0,_bounds__WEBPACK_IMPORTED_MODULE_4__.getElementAbsoluteCoords)(element, elementsMap);\n const cx = (x1 + x2) / 2 + appState.scrollX;\n const cy = (y1 + y2) / 2 + appState.scrollY;\n const shiftX = (x2 - x1) / 2 - (element.x - x1);\n const shiftY = (y2 - y1) / 2 - (element.y - y1);\n context.save();\n context.translate(cx, cy);\n context.rotate(element.angle);\n context.translate(-shiftX, -shiftY);\n drawElementOnCanvas(element, rc, context, renderConfig);\n context.restore();\n } else {\n const elementWithCanvas = generateElementWithCanvas(element, allElementsMap, renderConfig, appState);\n\n if (!elementWithCanvas) {\n return;\n }\n\n drawElementFromCanvas(elementWithCanvas, context, renderConfig, appState, allElementsMap);\n }\n\n break;\n }\n\n case \"rectangle\":\n case \"diamond\":\n case \"ellipse\":\n case \"line\":\n case \"arrow\":\n case \"image\":\n case \"text\":\n case \"iframe\":\n case \"embeddable\":\n {\n // TODO investigate if we can do this in situ. Right now we need to call\n // beforehand because math helpers (such as getElementAbsoluteCoords)\n // rely on existing shapes\n _shape__WEBPACK_IMPORTED_MODULE_12__.ShapeCache.generateElementShape(element, renderConfig);\n\n if (renderConfig.isExporting) {\n const [x1, y1, x2, y2] = (0,_bounds__WEBPACK_IMPORTED_MODULE_4__.getElementAbsoluteCoords)(element, elementsMap);\n const cx = (x1 + x2) / 2 + appState.scrollX;\n const cy = (y1 + y2) / 2 + appState.scrollY;\n let shiftX = (x2 - x1) / 2 - (element.x - x1);\n let shiftY = (y2 - y1) / 2 - (element.y - y1);\n\n if ((0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isTextElement)(element)) {\n const container = (0,_textElement__WEBPACK_IMPORTED_MODULE_7__.getContainerElement)(element, elementsMap);\n\n if ((0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isArrowElement)(container)) {\n const boundTextCoords = _linearElementEditor__WEBPACK_IMPORTED_MODULE_6__.LinearElementEditor.getBoundTextElementPosition(container, element, elementsMap);\n shiftX = (x2 - x1) / 2 - (boundTextCoords.x - x1);\n shiftY = (y2 - y1) / 2 - (boundTextCoords.y - y1);\n }\n }\n\n context.save();\n context.translate(cx, cy);\n\n if (shouldResetImageFilter(element, renderConfig, appState)) {\n context.filter = \"none\";\n }\n\n const boundTextElement = (0,_textElement__WEBPACK_IMPORTED_MODULE_7__.getBoundTextElement)(element, elementsMap);\n\n if ((0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isArrowElement)(element) && boundTextElement) {\n const tempCanvas = document.createElement(\"canvas\");\n const tempCanvasContext = tempCanvas.getContext(\"2d\"); // Take max dimensions of arrow canvas so that when canvas is rotated\n // the arrow doesn't get clipped\n\n const maxDim = Math.max((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.distance)(x1, x2), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.distance)(y1, y2));\n const padding = getCanvasPadding(element);\n tempCanvas.width = maxDim * appState.exportScale + padding * 10 * appState.exportScale;\n tempCanvas.height = maxDim * appState.exportScale + padding * 10 * appState.exportScale;\n tempCanvasContext.translate(tempCanvas.width / 2, tempCanvas.height / 2);\n tempCanvasContext.scale(appState.exportScale, appState.exportScale); // Shift the canvas to left most point of the arrow\n\n shiftX = element.width / 2 - (element.x - x1);\n shiftY = element.height / 2 - (element.y - y1);\n tempCanvasContext.rotate(element.angle);\n const tempRc = roughjs_bin_rough__WEBPACK_IMPORTED_MODULE_0__[\"default\"].canvas(tempCanvas);\n tempCanvasContext.translate(-shiftX, -shiftY);\n drawElementOnCanvas(element, tempRc, tempCanvasContext, renderConfig);\n tempCanvasContext.translate(shiftX, shiftY);\n tempCanvasContext.rotate(-element.angle); // Shift the canvas to center of bound text\n\n const [,,,, boundTextCx, boundTextCy] = (0,_bounds__WEBPACK_IMPORTED_MODULE_4__.getElementAbsoluteCoords)(boundTextElement, elementsMap);\n const boundTextShiftX = (x1 + x2) / 2 - boundTextCx;\n const boundTextShiftY = (y1 + y2) / 2 - boundTextCy;\n tempCanvasContext.translate(-boundTextShiftX, -boundTextShiftY); // Clear the bound text area\n\n tempCanvasContext.clearRect(-boundTextElement.width / 2, -boundTextElement.height / 2, boundTextElement.width, boundTextElement.height);\n context.scale(1 / appState.exportScale, 1 / appState.exportScale);\n context.drawImage(tempCanvas, -tempCanvas.width / 2, -tempCanvas.height / 2, tempCanvas.width, tempCanvas.height);\n } else {\n context.rotate(element.angle);\n\n if (element.type === \"image\") {\n // note: scale must be applied *after* rotating\n context.scale(element.scale[0], element.scale[1]);\n }\n\n context.translate(-shiftX, -shiftY);\n drawElementOnCanvas(element, rc, context, renderConfig);\n }\n\n context.restore(); // not exporting → optimized rendering (cache & render from element\n // canvases)\n } else {\n const elementWithCanvas = generateElementWithCanvas(element, allElementsMap, renderConfig, appState);\n\n if (!elementWithCanvas) {\n return;\n }\n\n const currentImageSmoothingStatus = context.imageSmoothingEnabled;\n\n if ( // do not disable smoothing during zoom as blurry shapes look better\n // on low resolution (while still zooming in) than sharp ones\n !(appState === null || appState === void 0 ? void 0 : appState.shouldCacheIgnoreZoom) && ( // angle is 0 -> always disable smoothing\n !element.angle || // or check if angle is a right angle in which case we can still\n // disable smoothing without adversely affecting the result\n // We need less-than comparison because of FP artihmetic\n (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_2__.isRightAngleRads)(element.angle))) {\n // Disabling smoothing makes output much sharper, especially for\n // text. Unless for non-right angles, where the aliasing is really\n // terrible on Chromium.\n //\n // Note that `context.imageSmoothingQuality=\"high\"` has almost\n // zero effect.\n //\n context.imageSmoothingEnabled = false;\n }\n\n if (element.id === appState.croppingElementId && (0,_typeChecks__WEBPACK_IMPORTED_MODULE_9__.isImageElement)(elementWithCanvas.element) && elementWithCanvas.element.crop !== null) {\n context.save();\n context.globalAlpha = 0.1;\n const uncroppedElementCanvas = generateElementCanvas((0,_cropElement__WEBPACK_IMPORTED_MODULE_5__.getUncroppedImageElement)(elementWithCanvas.element, elementsMap), allElementsMap, appState.zoom, renderConfig, appState);\n\n if (uncroppedElementCanvas) {\n drawElementFromCanvas(uncroppedElementCanvas, context, renderConfig, appState, allElementsMap);\n }\n\n context.restore();\n }\n\n drawElementFromCanvas(elementWithCanvas, context, renderConfig, appState, allElementsMap); // reset\n\n context.imageSmoothingEnabled = currentImageSmoothingStatus;\n }\n\n break;\n }\n\n default:\n {\n // @ts-ignore\n throw new Error(`Unimplemented type ${element.type}`);\n }\n }\n\n context.globalAlpha = 1;\n};\nconst pathsCache = new WeakMap([]);\nfunction generateFreeDrawShape(element) {\n const svgPathData = getFreeDrawSvgPath(element);\n const path = new Path2D(svgPathData);\n pathsCache.set(element, path);\n return path;\n}\nfunction getFreeDrawPath2D(element) {\n return pathsCache.get(element);\n}\nfunction getFreeDrawSvgPath(element) {\n return getSvgPathFromStroke(getFreedrawOutlinePoints(element));\n}\nfunction getFreedrawOutlineAsSegments(element, points, elementsMap) {\n const bounds = (0,_bounds__WEBPACK_IMPORTED_MODULE_4__.getElementBounds)(Object.assign(Object.assign({}, element), {\n angle: 0\n }), elementsMap);\n const center = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_2__.pointFrom)((bounds[0] + bounds[2]) / 2, (bounds[1] + bounds[3]) / 2);\n (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.invariant)(points.length >= 2, \"Freepath outline must have at least 2 points\");\n return points.slice(2).reduce((acc, curr) => {\n acc.push((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_2__.lineSegment)(acc[acc.length - 1][1], (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_2__.pointRotateRads)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_2__.pointFrom)(curr[0] + element.x, curr[1] + element.y), center, element.angle)));\n return acc;\n }, [(0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_2__.lineSegment)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_2__.pointRotateRads)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_2__.pointFrom)(points[0][0] + element.x, points[0][1] + element.y), center, element.angle), (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_2__.pointRotateRads)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_2__.pointFrom)(points[1][0] + element.x, points[1][1] + element.y), center, element.angle))]);\n}\nfunction getFreedrawOutlinePoints(element) {\n var _a, _b, _c, _d, _e, _f, _g, _h; // If input points are empty (should they ever be?) return a dot\n\n\n const inputPoints = element.simulatePressure ? element.points : element.points.length ? element.points.map(([x, y], i) => [x, y, element.pressures[i]]) : [[0, 0, 0.5]]; // Consider changing the options for simulated pressure vs real pressure\n\n const customOptions = (_b = (_a = element.customData) === null || _a === void 0 ? void 0 : _a.strokeOptions) === null || _b === void 0 ? void 0 : _b.options; //zsviczian\n\n const options = customOptions //zsviczian\n ? Object.assign(Object.assign(Object.assign(Object.assign({}, customOptions), {\n simulatePressure: (_c = customOptions.simulatePressure) !== null && _c !== void 0 ? _c : element.simulatePressure,\n size: element.strokeWidth * 4.25,\n last: true,\n easing: (_d = _easingFunctions__WEBPACK_IMPORTED_MODULE_13__[\"default\"][customOptions.easing]) !== null && _d !== void 0 ? _d : t => t\n }), ((_e = customOptions.start) === null || _e === void 0 ? void 0 : _e.easing) ? {\n start: Object.assign(Object.assign({}, customOptions.start), {\n easing: (_f = _easingFunctions__WEBPACK_IMPORTED_MODULE_13__[\"default\"][customOptions.start.easing]) !== null && _f !== void 0 ? _f : t => t\n })\n } : {\n start: customOptions.start\n }), ((_g = customOptions.end) === null || _g === void 0 ? void 0 : _g.easing) ? {\n end: Object.assign(Object.assign({}, customOptions.end), {\n easing: (_h = _easingFunctions__WEBPACK_IMPORTED_MODULE_13__[\"default\"][customOptions.end.easing]) !== null && _h !== void 0 ? _h : t => t\n })\n } : {\n end: customOptions.end\n }) : {\n simulatePressure: element.simulatePressure,\n size: element.strokeWidth * 4.25,\n thinning: 0.6,\n smoothing: 0.5,\n streamline: 0.5,\n easing: _easingFunctions__WEBPACK_IMPORTED_MODULE_13__[\"default\"].easeOutSine,\n last: true\n };\n return (0,perfect_freehand__WEBPACK_IMPORTED_MODULE_1__.getStroke)(inputPoints, options);\n}\n\nfunction med(A, B) {\n return [(A[0] + B[0]) / 2, (A[1] + B[1]) / 2];\n} // Trim SVG path data so number are each two decimal points. This\n// improves SVG exports, and prevents rendering errors on points\n// with long decimals.\n\n\nconst TO_FIXED_PRECISION = /(\\s?[A-Z]?,?-?[0-9]*\\.[0-9]{0,2})(([0-9]|e|-)*)/g;\n\nfunction getSvgPathFromStroke(points) {\n if (!points.length) {\n return \"\";\n }\n\n const max = points.length - 1;\n return points.reduce((acc, point, i, arr) => {\n if (i === max) {\n acc.push(point, med(point, arr[0]), \"L\", arr[0], \"Z\");\n } else {\n acc.push(point, med(point, arr[i + 1]));\n }\n\n return acc;\n }, [\"M\", points[0], \"Q\"]).join(\" \").replace(TO_FIXED_PRECISION, \"$1\");\n}\n\n//# sourceURL=webpack://ExcalidrawLib/../element/src/renderElement.ts?");
13425
13425
 
13426
13426
  /***/ }),
13427
13427
 
@@ -16479,7 +16479,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
16479
16479
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
16480
16480
 
16481
16481
  "use strict";
16482
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ INTERACTIVE_SCENE_ANIMATION_KEY: () => (/* binding */ INTERACTIVE_SCENE_ANIMATION_KEY),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n/* harmony import */ var _excalidraw_excalidraw_renderer_animation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @excalidraw/excalidraw/renderer/animation */ \"./renderer/animation.ts\");\n/* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../i18n */ \"./i18n.ts\");\n/* harmony import */ var _renderer_interactiveScene__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../renderer/interactiveScene */ \"./renderer/interactiveScene.ts\");\n\n\n\n\n\nconst INTERACTIVE_SCENE_ANIMATION_KEY = \"animateInteractiveScene\";\n\nconst InteractiveCanvas = props => {\n const isComponentMounted = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false);\n const rendererParams = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {\n var _a;\n\n if (!isComponentMounted.current) {\n isComponentMounted.current = true;\n return;\n }\n\n const remotePointerButton = new Map();\n const remotePointerViewportCoords = new Map();\n const remoteSelectedElementIds = new Map();\n const remotePointerUsernames = new Map();\n const remotePointerUserStates = new Map();\n props.appState.collaborators.forEach((user, socketId) => {\n if (user.selectedElementIds) {\n for (const id of Object.keys(user.selectedElementIds)) {\n if (!remoteSelectedElementIds.has(id)) {\n remoteSelectedElementIds.set(id, []);\n }\n\n remoteSelectedElementIds.get(id).push(socketId);\n }\n }\n\n if (!user.pointer || user.pointer.renderCursor === false) {\n return;\n }\n\n if (user.username) {\n remotePointerUsernames.set(socketId, user.username);\n }\n\n if (user.userState) {\n remotePointerUserStates.set(socketId, user.userState);\n }\n\n remotePointerViewportCoords.set(socketId, (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_1__.sceneCoordsToViewportCoords)({\n sceneX: user.pointer.x,\n sceneY: user.pointer.y\n }, props.appState));\n remotePointerButton.set(socketId, user.button);\n });\n const selectionColor = ((_a = props.containerRef) === null || _a === void 0 ? void 0 : _a.current) && getComputedStyle(props.containerRef.current).getPropertyValue(\"--color-selection\") || \"#6965db\";\n rendererParams.current = {\n app: props.app,\n canvas: props.canvas,\n elementsMap: props.elementsMap,\n visibleElements: props.visibleElements,\n selectedElements: props.selectedElements,\n allElementsMap: props.allElementsMap,\n scale: window.devicePixelRatio,\n appState: props.appState,\n renderConfig: {\n remotePointerViewportCoords,\n remotePointerButton,\n remoteSelectedElementIds,\n remotePointerUsernames,\n remotePointerUserStates,\n selectionColor,\n renderScrollbars: props.renderScrollbars,\n // NOTE not memoized on so we don't rerender on cursor move\n lastViewportPosition: props.app.lastViewportPosition\n },\n editorInterface: props.editorInterface,\n callback: props.renderInteractiveSceneCallback,\n animationState: {\n bindingHighlight: undefined\n },\n deltaTime: 0\n };\n\n if (!_excalidraw_excalidraw_renderer_animation__WEBPACK_IMPORTED_MODULE_2__.AnimationController.running(INTERACTIVE_SCENE_ANIMATION_KEY)) {\n _excalidraw_excalidraw_renderer_animation__WEBPACK_IMPORTED_MODULE_2__.AnimationController.start(INTERACTIVE_SCENE_ANIMATION_KEY, ({\n deltaTime,\n state\n }) => {\n const nextAnimationState = (0,_renderer_interactiveScene__WEBPACK_IMPORTED_MODULE_4__.renderInteractiveScene)(Object.assign(Object.assign({}, rendererParams.current), {\n deltaTime,\n animationState: state\n })).animationState;\n\n if (nextAnimationState) {\n for (const key in nextAnimationState) {\n if (nextAnimationState[key] !== undefined) {\n return nextAnimationState;\n }\n }\n }\n\n return undefined;\n });\n }\n });\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"canvas\", {\n className: \"excalidraw__canvas interactive\",\n style: {\n width: props.appState.width,\n height: props.appState.height,\n cursor: props.appState.viewModeEnabled ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_1__.CURSOR_TYPE.GRAB : _excalidraw_common__WEBPACK_IMPORTED_MODULE_1__.CURSOR_TYPE.AUTO\n },\n width: props.appState.width * props.scale,\n height: props.appState.height * props.scale,\n ref: props.handleCanvasRef,\n onContextMenu: props.onContextMenu,\n onPointerMove: props.onPointerMove,\n onPointerUp: props.onPointerUp,\n onPointerCancel: props.onPointerCancel,\n onTouchMove: props.onTouchMove,\n onPointerDown: props.onPointerDown,\n onDoubleClick: props.onDoubleClick\n }, (0,_i18n__WEBPACK_IMPORTED_MODULE_3__.t)(\"labels.drawingCanvas\"));\n};\n\nconst getRelevantAppStateProps = appState => ({\n zoom: appState.zoom,\n scrollX: appState.scrollX,\n scrollY: appState.scrollY,\n width: appState.width,\n height: appState.height,\n viewModeEnabled: appState.viewModeEnabled,\n openDialog: appState.openDialog,\n editingGroupId: appState.editingGroupId,\n selectedElementIds: appState.selectedElementIds,\n frameToHighlight: appState.frameToHighlight,\n offsetLeft: appState.offsetLeft,\n offsetTop: appState.offsetTop,\n theme: appState.theme,\n selectionElement: appState.selectionElement,\n selectedGroupIds: appState.selectedGroupIds,\n selectedLinearElement: appState.selectedLinearElement,\n multiElement: appState.multiElement,\n newElement: appState.newElement,\n isBindingEnabled: appState.isBindingEnabled,\n suggestedBinding: appState.suggestedBinding,\n isRotating: appState.isRotating,\n elementsToHighlight: appState.elementsToHighlight,\n collaborators: appState.collaborators,\n activeEmbeddable: appState.activeEmbeddable,\n snapLines: appState.snapLines,\n zenModeEnabled: appState.zenModeEnabled,\n editingTextElement: appState.editingTextElement,\n gridColor: appState.gridColor,\n gridDirection: appState.gridDirection,\n highlightSearchResult: appState.highlightSearchResult,\n isCropping: appState.isCropping,\n croppingElementId: appState.croppingElementId,\n searchMatches: appState.searchMatches,\n activeLockedId: appState.activeLockedId,\n hoveredElementIds: appState.hoveredElementIds,\n frameRendering: appState.frameRendering,\n frameColor: appState.frameColor,\n shouldCacheIgnoreZoom: appState.shouldCacheIgnoreZoom,\n exportScale: appState.exportScale\n});\n\nconst areEqual = (prevProps, nextProps) => {\n // This could be further optimised if needed, as we don't have to render interactive canvas on each scene mutation\n if (prevProps.selectionNonce !== nextProps.selectionNonce || prevProps.sceneNonce !== nextProps.sceneNonce || prevProps.scale !== nextProps.scale || // we need to memoize on elementsMap because they may have renewed\n // even if sceneNonce didn't change (e.g. we filter elements out based\n // on appState)\n prevProps.elementsMap !== nextProps.elementsMap || prevProps.visibleElements !== nextProps.visibleElements || prevProps.selectedElements !== nextProps.selectedElements || prevProps.renderScrollbars !== nextProps.renderScrollbars) {\n return false;\n } // Comparing the interactive appState for changes in case of some edge cases\n\n\n return (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_1__.isShallowEqual)( // asserting AppState because we're being passed the whole AppState\n // but resolve to only the InteractiveCanvas-relevant props\n getRelevantAppStateProps(prevProps.appState), getRelevantAppStateProps(nextProps.appState));\n};\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().memo(InteractiveCanvas, areEqual));\n\n//# sourceURL=webpack://ExcalidrawLib/./components/canvases/InteractiveCanvas.tsx?");
16482
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ INTERACTIVE_SCENE_ANIMATION_KEY: () => (/* binding */ INTERACTIVE_SCENE_ANIMATION_KEY),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n/* harmony import */ var _excalidraw_excalidraw_renderer_animation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @excalidraw/excalidraw/renderer/animation */ \"./renderer/animation.ts\");\n/* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../i18n */ \"./i18n.ts\");\n/* harmony import */ var _renderer_interactiveScene__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../renderer/interactiveScene */ \"./renderer/interactiveScene.ts\");\n\n\n\n\n\nconst INTERACTIVE_SCENE_ANIMATION_KEY = \"animateInteractiveScene\";\n\nconst InteractiveCanvas = props => {\n const isComponentMounted = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(false);\n const rendererParams = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {\n var _a;\n\n if (!isComponentMounted.current) {\n isComponentMounted.current = true;\n return;\n }\n\n const remotePointerButton = new Map();\n const remotePointerViewportCoords = new Map();\n const remoteSelectedElementIds = new Map();\n const remotePointerUsernames = new Map();\n const remotePointerUserStates = new Map();\n props.appState.collaborators.forEach((user, socketId) => {\n if (user.selectedElementIds) {\n for (const id of Object.keys(user.selectedElementIds)) {\n if (!remoteSelectedElementIds.has(id)) {\n remoteSelectedElementIds.set(id, []);\n }\n\n remoteSelectedElementIds.get(id).push(socketId);\n }\n }\n\n if (!user.pointer || user.pointer.renderCursor === false) {\n return;\n }\n\n if (user.username) {\n remotePointerUsernames.set(socketId, user.username);\n }\n\n if (user.userState) {\n remotePointerUserStates.set(socketId, user.userState);\n }\n\n remotePointerViewportCoords.set(socketId, (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_1__.sceneCoordsToViewportCoords)({\n sceneX: user.pointer.x,\n sceneY: user.pointer.y\n }, props.appState));\n remotePointerButton.set(socketId, user.button);\n });\n const selectionColor = ((_a = props.containerRef) === null || _a === void 0 ? void 0 : _a.current) && getComputedStyle(props.containerRef.current).getPropertyValue(\"--color-selection\") || \"#6965db\";\n rendererParams.current = {\n app: props.app,\n canvas: props.canvas,\n elementsMap: props.elementsMap,\n visibleElements: props.visibleElements,\n selectedElements: props.selectedElements,\n allElementsMap: props.allElementsMap,\n scale: window.devicePixelRatio,\n appState: props.appState,\n renderConfig: {\n remotePointerViewportCoords,\n remotePointerButton,\n remoteSelectedElementIds,\n remotePointerUsernames,\n remotePointerUserStates,\n selectionColor,\n renderScrollbars: props.renderScrollbars,\n // NOTE not memoized on so we don't rerender on cursor move\n lastViewportPosition: props.app.lastViewportPosition\n },\n editorInterface: props.editorInterface,\n callback: props.renderInteractiveSceneCallback,\n animationState: {\n bindingHighlight: undefined\n },\n deltaTime: 0\n };\n\n if (!_excalidraw_excalidraw_renderer_animation__WEBPACK_IMPORTED_MODULE_2__.AnimationController.running(INTERACTIVE_SCENE_ANIMATION_KEY)) {\n _excalidraw_excalidraw_renderer_animation__WEBPACK_IMPORTED_MODULE_2__.AnimationController.start(INTERACTIVE_SCENE_ANIMATION_KEY, ({\n deltaTime,\n state\n }) => {\n const nextAnimationState = (0,_renderer_interactiveScene__WEBPACK_IMPORTED_MODULE_4__.renderInteractiveScene)(Object.assign(Object.assign({}, rendererParams.current), {\n deltaTime,\n animationState: state\n })).animationState;\n\n if (nextAnimationState) {\n for (const key in nextAnimationState) {\n if (nextAnimationState[key] !== undefined) {\n return nextAnimationState;\n }\n }\n }\n\n return undefined;\n });\n }\n });\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"canvas\", {\n className: \"excalidraw__canvas interactive\",\n style: {\n width: props.appState.width,\n height: props.appState.height,\n cursor: props.appState.viewModeEnabled ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_1__.CURSOR_TYPE.GRAB : _excalidraw_common__WEBPACK_IMPORTED_MODULE_1__.CURSOR_TYPE.AUTO\n },\n width: props.appState.width * props.scale,\n height: props.appState.height * props.scale,\n ref: props.handleCanvasRef,\n onContextMenu: props.onContextMenu,\n onPointerMove: props.onPointerMove,\n onPointerUp: props.onPointerUp,\n onPointerCancel: props.onPointerCancel,\n onTouchMove: props.onTouchMove,\n onPointerDown: props.onPointerDown,\n onDoubleClick: props.onDoubleClick\n }, (0,_i18n__WEBPACK_IMPORTED_MODULE_3__.t)(\"labels.drawingCanvas\"));\n};\n\nconst getRelevantAppStateProps = appState => ({\n zoom: appState.zoom,\n scrollX: appState.scrollX,\n scrollY: appState.scrollY,\n width: appState.width,\n height: appState.height,\n viewModeEnabled: appState.viewModeEnabled,\n openDialog: appState.openDialog,\n editingGroupId: appState.editingGroupId,\n selectedElementIds: appState.selectedElementIds,\n frameToHighlight: appState.frameToHighlight,\n offsetLeft: appState.offsetLeft,\n offsetTop: appState.offsetTop,\n theme: appState.theme,\n selectionElement: appState.selectionElement,\n selectedGroupIds: appState.selectedGroupIds,\n selectedLinearElement: appState.selectedLinearElement,\n multiElement: appState.multiElement,\n newElement: appState.newElement,\n isBindingEnabled: appState.isBindingEnabled,\n suggestedBinding: appState.suggestedBinding,\n isRotating: appState.isRotating,\n elementsToHighlight: appState.elementsToHighlight,\n collaborators: appState.collaborators,\n activeEmbeddable: appState.activeEmbeddable,\n snapLines: appState.snapLines,\n zenModeEnabled: appState.zenModeEnabled,\n editingTextElement: appState.editingTextElement,\n viewBackgroundColor: appState.viewBackgroundColor,\n gridColor: appState.gridColor,\n gridDirection: appState.gridDirection,\n highlightSearchResult: appState.highlightSearchResult,\n isCropping: appState.isCropping,\n croppingElementId: appState.croppingElementId,\n searchMatches: appState.searchMatches,\n activeLockedId: appState.activeLockedId,\n hoveredElementIds: appState.hoveredElementIds,\n frameRendering: appState.frameRendering,\n frameColor: appState.frameColor,\n shouldCacheIgnoreZoom: appState.shouldCacheIgnoreZoom,\n exportScale: appState.exportScale\n});\n\nconst areEqual = (prevProps, nextProps) => {\n // This could be further optimised if needed, as we don't have to render interactive canvas on each scene mutation\n if (prevProps.selectionNonce !== nextProps.selectionNonce || prevProps.sceneNonce !== nextProps.sceneNonce || prevProps.scale !== nextProps.scale || // we need to memoize on elementsMap because they may have renewed\n // even if sceneNonce didn't change (e.g. we filter elements out based\n // on appState)\n prevProps.elementsMap !== nextProps.elementsMap || prevProps.visibleElements !== nextProps.visibleElements || prevProps.selectedElements !== nextProps.selectedElements || prevProps.renderScrollbars !== nextProps.renderScrollbars) {\n return false;\n } // Comparing the interactive appState for changes in case of some edge cases\n\n\n return (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_1__.isShallowEqual)( // asserting AppState because we're being passed the whole AppState\n // but resolve to only the InteractiveCanvas-relevant props\n getRelevantAppStateProps(prevProps.appState), getRelevantAppStateProps(nextProps.appState));\n};\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().memo(InteractiveCanvas, areEqual));\n\n//# sourceURL=webpack://ExcalidrawLib/./components/canvases/InteractiveCanvas.tsx?");
16483
16483
 
16484
16484
  /***/ }),
16485
16485
 
@@ -20757,7 +20757,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
20757
20757
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
20758
20758
 
20759
20759
  "use strict";
20760
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ renderInteractiveScene: () => (/* binding */ renderInteractiveScene)\n/* harmony export */ });\n/* harmony import */ var _excalidraw_math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @excalidraw/math */ \"../math/src/index.ts\");\n/* harmony import */ var open_color__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! open-color */ \"../../node_modules/open-color/open-color.json\");\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n/* harmony import */ var _excalidraw_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @excalidraw/element */ \"../element/src/index.ts\");\n/* harmony import */ var _renderer_renderSnaps__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../renderer/renderSnaps */ \"./renderer/renderSnaps.ts\");\n/* harmony import */ var _renderer_roundRect__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../renderer/roundRect */ \"./renderer/roundRect.ts\");\n/* harmony import */ var _scene_scrollbars__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../scene/scrollbars */ \"./scene/scrollbars.ts\");\n/* harmony import */ var _clients__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../clients */ \"./clients.ts\");\n/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./helpers */ \"./renderer/helpers.ts\");\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst renderElbowArrowMidPointHighlight = (context, appState) => {\n (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.invariant)(appState.selectedLinearElement, \"selectedLinearElement is null\");\n const {\n segmentMidPointHoveredCoords\n } = appState.selectedLinearElement;\n (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.invariant)(segmentMidPointHoveredCoords, \"midPointCoords is null\");\n context.save();\n context.translate(appState.scrollX, appState.scrollY);\n highlightPoint(segmentMidPointHoveredCoords, context, appState);\n context.restore();\n};\n\nconst renderLinearElementPointHighlight = (context, appState, elementsMap) => {\n var _a, _b, _c;\n\n const {\n elementId,\n hoverPointIndex\n } = appState.selectedLinearElement;\n\n if (((_a = appState.selectedLinearElement) === null || _a === void 0 ? void 0 : _a.isEditing) && ((_c = (_b = appState.selectedLinearElement) === null || _b === void 0 ? void 0 : _b.selectedPointsIndices) === null || _c === void 0 ? void 0 : _c.includes(hoverPointIndex))) {\n return;\n }\n\n const element = _excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.LinearElementEditor.getElement(elementId, elementsMap);\n\n if (!element) {\n return;\n }\n\n const point = _excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.LinearElementEditor.getPointAtIndexGlobalCoordinates(element, hoverPointIndex, elementsMap);\n context.save();\n context.translate(appState.scrollX, appState.scrollY);\n highlightPoint(point, context, appState);\n context.restore();\n};\n\nconst highlightPoint = (point, context, appState) => {\n context.fillStyle = \"rgba(105, 101, 219, 0.4)\";\n (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.fillCircle)(context, point[0], point[1], _excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.LinearElementEditor.POINT_HANDLE_SIZE / appState.zoom.value, false);\n};\n\nconst renderSingleLinearPoint = (context, appState, point, radius, isSelected, isPhantomPoint, isOverlappingPoint) => {\n var _a;\n\n context.strokeStyle = \"#5e5ad8\";\n context.setLineDash([]);\n context.fillStyle = \"rgba(255, 255, 255, 0.9)\";\n\n if (isSelected) {\n context.fillStyle = \"rgba(134, 131, 226, 0.9)\";\n } else if (isPhantomPoint) {\n context.fillStyle = \"rgba(177, 151, 252, 0.7)\";\n }\n\n (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.fillCircle)(context, point[0], point[1], (isOverlappingPoint ? radius * (((_a = appState.selectedLinearElement) === null || _a === void 0 ? void 0 : _a.isEditing) ? 1.5 : 2) : radius) / appState.zoom.value, !isPhantomPoint, !isOverlappingPoint || isSelected);\n};\n\nconst renderBindingHighlightForBindableElement_simple = (context, element, elementsMap, appState, highlightedColor) => {\n const enclosingFrame = element.frameId && elementsMap.get(element.frameId);\n\n if (enclosingFrame && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isFrameLikeElement)(enclosingFrame)) {\n context.translate(enclosingFrame.x + appState.scrollX, enclosingFrame.y + appState.scrollY);\n context.fillStyle = highlightedColor !== null && highlightedColor !== void 0 ? highlightedColor : \"rgba(0,0,0,.05)\"; //zsviczian\n\n context.beginPath();\n\n if (_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.radius && context.roundRect) {\n context.roundRect(-1, -1, enclosingFrame.width + 1, enclosingFrame.height + 1, _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.radius / appState.zoom.value);\n } else {\n context.rect(-1, -1, enclosingFrame.width + 1, enclosingFrame.height + 1);\n }\n\n context.clip();\n context.translate(-(enclosingFrame.x + appState.scrollX), -(enclosingFrame.y + appState.scrollY));\n }\n\n switch (element.type) {\n case \"magicframe\":\n case \"frame\":\n context.save();\n context.strokeStyle = highlightedColor !== null && highlightedColor !== void 0 ? highlightedColor : \"rgba(0,0,0,.05)\"; //zsviczian\n\n context.translate(element.x + appState.scrollX, element.y + appState.scrollY);\n context.lineWidth = _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.strokeWidth / appState.zoom.value;\n context.strokeStyle = appState.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.THEME.DARK ? `rgba(3, 93, 161, 1)` : `rgba(106, 189, 252, 1)`;\n\n if (_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.radius && context.roundRect) {\n context.beginPath();\n context.roundRect(0, 0, element.width, element.height, _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.radius / appState.zoom.value);\n context.stroke();\n context.closePath();\n } else {\n context.strokeRect(0, 0, element.width, element.height);\n }\n\n context.restore();\n break;\n\n default:\n context.save();\n const center = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.elementCenterPoint)(element, elementsMap);\n context.translate(center[0], center[1]);\n context.rotate(element.angle);\n context.translate(-center[0], -center[1]);\n context.translate(element.x, element.y);\n context.lineWidth = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_0__.clamp)(1.75, element.strokeWidth, 4) / Math.max(0.25, appState.zoom.value);\n context.strokeStyle = appState.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.THEME.DARK ? `rgba(3, 93, 161, 1)` : `rgba(106, 189, 252, 1)`;\n\n switch (element.type) {\n case \"ellipse\":\n context.beginPath();\n context.ellipse(element.width / 2, element.height / 2, element.width / 2, element.height / 2, 0, 0, 2 * Math.PI);\n context.closePath();\n context.stroke();\n break;\n\n case \"diamond\":\n {\n const [segments, curves] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.deconstructDiamondElement)(element); // Draw each line segment individually\n\n segments.forEach(segment => {\n context.beginPath();\n context.moveTo(segment[0][0] - element.x, segment[0][1] - element.y);\n context.lineTo(segment[1][0] - element.x, segment[1][1] - element.y);\n context.stroke();\n }); // Draw each curve individually (for rounded corners)\n\n curves.forEach(curve => {\n const [start, control1, control2, end] = curve;\n context.beginPath();\n context.moveTo(start[0] - element.x, start[1] - element.y);\n context.bezierCurveTo(control1[0] - element.x, control1[1] - element.y, control2[0] - element.x, control2[1] - element.y, end[0] - element.x, end[1] - element.y);\n context.stroke();\n });\n }\n break;\n\n default:\n {\n const [segments, curves] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.deconstructRectanguloidElement)(element); // Draw each line segment individually\n\n segments.forEach(segment => {\n context.beginPath();\n context.moveTo(segment[0][0] - element.x, segment[0][1] - element.y);\n context.lineTo(segment[1][0] - element.x, segment[1][1] - element.y);\n context.stroke();\n }); // Draw each curve individually (for rounded corners)\n\n curves.forEach(curve => {\n const [start, control1, control2, end] = curve;\n context.beginPath();\n context.moveTo(start[0] - element.x, start[1] - element.y);\n context.bezierCurveTo(control1[0] - element.x, control1[1] - element.y, control2[0] - element.x, control2[1] - element.y, end[0] - element.x, end[1] - element.y);\n context.stroke();\n });\n }\n break;\n }\n\n context.restore();\n break;\n }\n};\n\nconst renderBindingHighlightForBindableElement_complex = (app, context, element, allElementsMap, appState, deltaTime, highlightedColor, //zsviczian\nstate) => {\n var _a, _b, _c;\n\n const countdownInProgress = app.state.bindMode === \"orbit\" && app.bindModeHandler !== null;\n const remainingTime = _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.BIND_MODE_TIMEOUT - ((_a = state === null || state === void 0 ? void 0 : state.runtime) !== null && _a !== void 0 ? _a : countdownInProgress ? 0 : _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.BIND_MODE_TIMEOUT);\n const opacity = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_0__.clamp)(1 / _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.BIND_MODE_TIMEOUT * remainingTime, 0.0001, 1);\n const offset = element.strokeWidth / 2;\n const enclosingFrame = element.frameId && allElementsMap.get(element.frameId);\n\n if (enclosingFrame && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isFrameLikeElement)(enclosingFrame)) {\n context.translate(enclosingFrame.x + appState.scrollX, enclosingFrame.y + appState.scrollY);\n context.beginPath();\n\n if (_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.radius && context.roundRect) {\n context.roundRect(-1, -1, enclosingFrame.width + 1, enclosingFrame.height + 1, _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.radius / appState.zoom.value);\n } else {\n context.rect(-1, -1, enclosingFrame.width + 1, enclosingFrame.height + 1);\n }\n\n context.clip();\n context.translate(-(enclosingFrame.x + appState.scrollX), -(enclosingFrame.y + appState.scrollY));\n }\n\n switch (element.type) {\n case \"magicframe\":\n case \"frame\":\n context.save();\n context.translate(element.x + appState.scrollX, element.y + appState.scrollY);\n context.lineWidth = _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.strokeWidth / appState.zoom.value;\n context.strokeStyle = appState.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.THEME.DARK ? `rgba(3, 93, 161, ${opacity})` : `rgba(106, 189, 252, ${opacity})`;\n\n if (_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.radius && context.roundRect) {\n context.beginPath();\n context.roundRect(0, 0, element.width, element.height, _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.radius / appState.zoom.value);\n context.stroke();\n context.closePath();\n } else {\n context.strokeRect(0, 0, element.width, element.height);\n }\n\n context.restore();\n break;\n\n default:\n context.save();\n const center = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.elementCenterPoint)(element, allElementsMap);\n const cx = center[0] + appState.scrollX;\n const cy = center[1] + appState.scrollY;\n context.translate(cx, cy);\n context.rotate(element.angle);\n context.translate(-cx, -cy);\n context.translate(element.x + appState.scrollX - offset, element.y + appState.scrollY - offset);\n context.lineWidth = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_0__.clamp)(2.5, element.strokeWidth * 1.75, 4) / Math.max(0.25, appState.zoom.value);\n context.strokeStyle = appState.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.THEME.DARK ? `rgba(3, 93, 161, ${opacity / 2})` : `rgba(106, 189, 252, ${opacity / 2})`;\n\n switch (element.type) {\n case \"ellipse\":\n context.beginPath();\n context.ellipse((element.width + offset * 2) / 2, (element.height + offset * 2) / 2, (element.width + offset * 2) / 2, (element.height + offset * 2) / 2, 0, 0, 2 * Math.PI);\n context.closePath();\n context.stroke();\n break;\n\n case \"diamond\":\n {\n const [segments, curves] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.deconstructDiamondElement)(element, offset); // Draw each line segment individually\n\n segments.forEach(segment => {\n context.beginPath();\n context.moveTo(segment[0][0] - element.x + offset, segment[0][1] - element.y + offset);\n context.lineTo(segment[1][0] - element.x + offset, segment[1][1] - element.y + offset);\n context.stroke();\n }); // Draw each curve individually (for rounded corners)\n\n curves.forEach(curve => {\n const [start, control1, control2, end] = curve;\n context.beginPath();\n context.moveTo(start[0] - element.x + offset, start[1] - element.y + offset);\n context.bezierCurveTo(control1[0] - element.x + offset, control1[1] - element.y + offset, control2[0] - element.x + offset, control2[1] - element.y + offset, end[0] - element.x + offset, end[1] - element.y + offset);\n context.stroke();\n });\n }\n break;\n\n default:\n {\n const [segments, curves] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.deconstructRectanguloidElement)(element, offset); // Draw each line segment individually\n\n segments.forEach(segment => {\n context.beginPath();\n context.moveTo(segment[0][0] - element.x + offset, segment[0][1] - element.y + offset);\n context.lineTo(segment[1][0] - element.x + offset, segment[1][1] - element.y + offset);\n context.stroke();\n }); // Draw each curve individually (for rounded corners)\n\n curves.forEach(curve => {\n const [start, control1, control2, end] = curve;\n context.beginPath();\n context.moveTo(start[0] - element.x + offset, start[1] - element.y + offset);\n context.bezierCurveTo(control1[0] - element.x + offset, control1[1] - element.y + offset, control2[0] - element.x + offset, control2[1] - element.y + offset, end[0] - element.x + offset, end[1] - element.y + offset);\n context.stroke();\n });\n }\n break;\n }\n\n context.restore();\n break;\n } // Middle indicator is not rendered after it expired\n\n\n if (!countdownInProgress || ((_b = state === null || state === void 0 ? void 0 : state.runtime) !== null && _b !== void 0 ? _b : 0) > _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.BIND_MODE_TIMEOUT) {\n return;\n }\n\n const radius = 0.5 * (Math.min(element.width, element.height) / 2); // Draw center snap area\n\n if (!(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isFrameLikeElement)(element)) {\n context.save();\n context.translate(element.x + appState.scrollX, element.y + appState.scrollY);\n const PROGRESS_RATIO = 1 / _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.BIND_MODE_TIMEOUT * remainingTime;\n context.strokeStyle = \"rgba(0, 0, 0, 0.2)\";\n context.lineWidth = 1 / appState.zoom.value;\n context.setLineDash([4 / appState.zoom.value, 4 / appState.zoom.value]);\n context.lineDashOffset = -PROGRESS_RATIO * 10 / appState.zoom.value;\n context.beginPath();\n context.ellipse(element.width / 2, element.height / 2, radius, radius, 0, 0, 2 * Math.PI);\n context.stroke(); // context.strokeStyle = \"transparent\";\n\n context.fillStyle = highlightedColor !== null && highlightedColor !== void 0 ? highlightedColor : \"rgba(128,128,128,.1)\"; //zsviczian \"rgba(0, 0, 0, 0.04)\";\n\n context.beginPath();\n context.ellipse(element.width / 2, element.height / 2, radius * (1 - opacity), radius * (1 - opacity), 0, 0, 2 * Math.PI);\n context.fill();\n context.restore();\n }\n\n return {\n runtime: ((_c = state === null || state === void 0 ? void 0 : state.runtime) !== null && _c !== void 0 ? _c : 0) + deltaTime\n };\n};\n\nconst renderBindingHighlightForBindableElement = (app, context, element, allElementsMap, appState, deltaTime, highlightedColor, //zsviczian\nstate) => {\n if ((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.getFeatureFlag)(\"COMPLEX_BINDINGS\")) {\n return renderBindingHighlightForBindableElement_complex(app, context, element, allElementsMap, appState, deltaTime, highlightedColor, //zsviczian\n state);\n }\n\n context.save();\n context.translate(appState.scrollX, appState.scrollY);\n renderBindingHighlightForBindableElement_simple(context, element, allElementsMap, appState, highlightedColor);\n context.restore();\n};\n\nconst renderSelectionBorder = (context, appState, elementProperties) => {\n var _a;\n\n const {\n angle,\n x1,\n y1,\n x2,\n y2,\n selectionColors,\n cx,\n cy,\n dashed,\n activeEmbeddable\n } = elementProperties;\n const elementWidth = x2 - x1;\n const elementHeight = y2 - y1;\n const padding = (_a = elementProperties.padding) !== null && _a !== void 0 ? _a : _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_TRANSFORM_HANDLE_SPACING * 2;\n const linePadding = padding / appState.zoom.value;\n const lineWidth = 8 / appState.zoom.value;\n const spaceWidth = 4 / appState.zoom.value;\n context.save();\n context.translate(appState.scrollX, appState.scrollY);\n const thick = activeEmbeddable || appState.highlightSearchResult; //zsviczian\n\n context.lineWidth = (thick ? 4 : 1) / appState.zoom.value; //zsviczian\n\n const count = selectionColors.length;\n\n for (let index = 0; index < count; ++index) {\n context.strokeStyle = selectionColors[index];\n\n if (dashed) {\n context.setLineDash([lineWidth, spaceWidth + (lineWidth + spaceWidth) * (count - 1)]);\n }\n\n context.lineDashOffset = (lineWidth + spaceWidth) * index;\n (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.strokeRectWithRotation_simple)(context, x1 - linePadding, y1 - linePadding, elementWidth + linePadding * 2, elementHeight + linePadding * 2, cx, cy, angle);\n }\n\n context.restore();\n};\n\nconst renderFrameHighlight = (context, appState, frame, elementsMap) => {\n const [x1, y1, x2, y2] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.getElementAbsoluteCoords)(frame, elementsMap);\n const width = x2 - x1;\n const height = y2 - y1;\n context.strokeStyle = \"rgb(0,118,255)\";\n context.lineWidth = _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.strokeWidth / appState.zoom.value;\n context.save();\n context.translate(appState.scrollX, appState.scrollY);\n (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.strokeRectWithRotation_simple)(context, x1, y1, width, height, x1 + width / 2, y1 + height / 2, frame.angle, false, _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.radius / appState.zoom.value);\n context.restore();\n};\n\nconst renderElementsBoxHighlight = (context, appState, elements, config) => {\n var _a;\n\n const {\n colors = [(_a = appState.gridColor.Bold) !== null && _a !== void 0 ? _a : \"rgb(0,118,255)\"],\n dashed = false\n } = config || {}; //zsviczian\n\n const individualElements = elements.filter(element => element.groupIds.length === 0);\n const elementsInGroups = elements.filter(element => element.groupIds.length > 0);\n\n const getSelectionFromElements = elements => {\n const [x1, y1, x2, y2] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.getCommonBounds)(elements);\n return {\n angle: 0,\n x1,\n x2,\n y1,\n y2,\n selectionColors: colors,\n dashed,\n cx: x1 + (x2 - x1) / 2,\n cy: y1 + (y2 - y1) / 2,\n activeEmbeddable: false\n };\n };\n\n const getSelectionForGroupId = groupId => {\n const groupElements = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.getElementsInGroup)(elements, groupId);\n return getSelectionFromElements(groupElements);\n };\n\n Object.entries((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.selectGroupsFromGivenElements)(elementsInGroups, appState)).filter(([id, isSelected]) => isSelected).map(([id, isSelected]) => id).map(groupId => getSelectionForGroupId(groupId)).concat(individualElements.map(element => getSelectionFromElements([element]))).forEach(selection => renderSelectionBorder(context, appState, selection));\n};\n\nconst renderLinearPointHandles = (context, appState, element, elementsMap) => {\n var _a, _b;\n\n if (!appState.selectedLinearElement) {\n return;\n }\n\n context.save();\n context.translate(appState.scrollX, appState.scrollY);\n context.lineWidth = 1 / appState.zoom.value;\n const points = _excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.LinearElementEditor.getPointsGlobalCoordinates(element, elementsMap);\n const {\n POINT_HANDLE_SIZE\n } = _excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.LinearElementEditor;\n const radius = ((_a = appState.selectedLinearElement) === null || _a === void 0 ? void 0 : _a.isEditing) ? POINT_HANDLE_SIZE : POINT_HANDLE_SIZE / 2;\n\n const _isElbowArrow = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isElbowArrow)(element);\n\n const _isLineElement = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isLineElement)(element);\n\n points.forEach((point, idx) => {\n var _a, _b, _c, _d, _e, _f;\n\n if (_isElbowArrow && idx !== 0 && idx !== points.length - 1) {\n return;\n }\n\n const isOverlappingPoint = idx > 0 && (idx !== points.length - 1 || !_isLineElement || !element.polygon) && (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_0__.pointsEqual)(point, idx === points.length - 1 ? points[0] : points[idx - 1], 2 / appState.zoom.value);\n let isSelected = !!((_a = appState.selectedLinearElement) === null || _a === void 0 ? void 0 : _a.isEditing) && !!((_c = (_b = appState.selectedLinearElement) === null || _b === void 0 ? void 0 : _b.selectedPointsIndices) === null || _c === void 0 ? void 0 : _c.includes(idx)); // when element is a polygon, highlight the last point as well if first\n // point is selected since they overlap and the last point tends to be\n // rendered on top\n\n if (_isLineElement && element.polygon && !isSelected && idx === element.points.length - 1 && !!((_d = appState.selectedLinearElement) === null || _d === void 0 ? void 0 : _d.isEditing) && !!((_f = (_e = appState.selectedLinearElement) === null || _e === void 0 ? void 0 : _e.selectedPointsIndices) === null || _f === void 0 ? void 0 : _f.includes(0))) {\n isSelected = true;\n }\n\n renderSingleLinearPoint(context, appState, point, radius, isSelected, false, isOverlappingPoint);\n }); // Rendering segment mid points\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isElbowArrow)(element)) {\n const fixedSegments = ((_b = element.fixedSegments) === null || _b === void 0 ? void 0 : _b.map(segment => segment.index)) || [];\n points.slice(0, -1).forEach((p, idx) => {\n if (!_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.LinearElementEditor.isSegmentTooShort(element, points[idx + 1], points[idx], idx, appState.zoom)) {\n renderSingleLinearPoint(context, appState, (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_0__.pointFrom)((p[0] + points[idx + 1][0]) / 2, (p[1] + points[idx + 1][1]) / 2), POINT_HANDLE_SIZE / 2, false, !fixedSegments.includes(idx + 1), false);\n }\n });\n } else {\n const midPoints = _excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.LinearElementEditor.getEditorMidPoints(element, elementsMap, appState).filter((midPoint, idx, midPoints) => midPoint !== null && !((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isElbowArrow)(element) && (idx === 0 || idx === midPoints.length - 1)));\n midPoints.forEach(segmentMidPoint => {\n var _a;\n\n if (((_a = appState.selectedLinearElement) === null || _a === void 0 ? void 0 : _a.isEditing) || points.length === 2) {\n renderSingleLinearPoint(context, appState, segmentMidPoint, POINT_HANDLE_SIZE / 2, false, true, false);\n }\n });\n }\n\n context.restore();\n};\n\nconst renderTransformHandles = (context, renderConfig, appState, transformHandles, angle) => {\n Object.keys(transformHandles).forEach(key => {\n const transformHandle = transformHandles[key];\n\n if (transformHandle !== undefined) {\n const [x, y, width, height] = transformHandle;\n context.save();\n context.lineWidth = 1 / appState.zoom.value;\n\n if (renderConfig.selectionColor) {\n context.strokeStyle = renderConfig.selectionColor;\n }\n\n if (key === \"rotation\") {\n (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.fillCircle)(context, x + width / 2, y + height / 2, width / 2, true); // prefer round corners if roundRect API is available\n } else if (context.roundRect) {\n context.beginPath();\n context.roundRect(x, y, width, height, 2 / appState.zoom.value);\n context.fill();\n context.stroke();\n } else {\n (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.strokeRectWithRotation_simple)(context, x, y, width, height, x + width / 2, y + height / 2, angle, true);\n }\n\n context.restore();\n }\n });\n};\n\nconst renderCropHandles = (context, renderConfig, appState, croppingElement, elementsMap) => {\n const [x1, y1,,, cx, cy] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.getElementAbsoluteCoords)(croppingElement, elementsMap);\n const LINE_WIDTH = 3;\n const LINE_LENGTH = 20;\n const ZOOMED_LINE_WIDTH = LINE_WIDTH / appState.zoom.value;\n const ZOOMED_HALF_LINE_WIDTH = ZOOMED_LINE_WIDTH / 2;\n const HALF_WIDTH = cx - x1 + ZOOMED_LINE_WIDTH;\n const HALF_HEIGHT = cy - y1 + ZOOMED_LINE_WIDTH;\n const HORIZONTAL_LINE_LENGTH = Math.min(LINE_LENGTH / appState.zoom.value, HALF_WIDTH);\n const VERTICAL_LINE_LENGTH = Math.min(LINE_LENGTH / appState.zoom.value, HALF_HEIGHT);\n context.save();\n context.fillStyle = renderConfig.selectionColor;\n context.strokeStyle = renderConfig.selectionColor;\n context.lineWidth = ZOOMED_LINE_WIDTH;\n const handles = [[// x, y\n [-HALF_WIDTH, -HALF_HEIGHT], // horizontal line: first start and to\n [0, ZOOMED_HALF_LINE_WIDTH], [HORIZONTAL_LINE_LENGTH, ZOOMED_HALF_LINE_WIDTH], // vertical line: second start and to\n [ZOOMED_HALF_LINE_WIDTH, 0], [ZOOMED_HALF_LINE_WIDTH, VERTICAL_LINE_LENGTH]], [[HALF_WIDTH - ZOOMED_HALF_LINE_WIDTH, -HALF_HEIGHT], [ZOOMED_HALF_LINE_WIDTH, ZOOMED_HALF_LINE_WIDTH], [-HORIZONTAL_LINE_LENGTH + ZOOMED_HALF_LINE_WIDTH, ZOOMED_HALF_LINE_WIDTH], [0, 0], [0, VERTICAL_LINE_LENGTH]], [[-HALF_WIDTH, HALF_HEIGHT], [0, -ZOOMED_HALF_LINE_WIDTH], [HORIZONTAL_LINE_LENGTH, -ZOOMED_HALF_LINE_WIDTH], [ZOOMED_HALF_LINE_WIDTH, 0], [ZOOMED_HALF_LINE_WIDTH, -VERTICAL_LINE_LENGTH]], [[HALF_WIDTH - ZOOMED_HALF_LINE_WIDTH, HALF_HEIGHT], [ZOOMED_HALF_LINE_WIDTH, -ZOOMED_HALF_LINE_WIDTH], [-HORIZONTAL_LINE_LENGTH + ZOOMED_HALF_LINE_WIDTH, -ZOOMED_HALF_LINE_WIDTH], [0, 0], [0, -VERTICAL_LINE_LENGTH]]];\n handles.forEach(handle => {\n const [[x, y], [x1s, y1s], [x1t, y1t], [x2s, y2s], [x2t, y2t]] = handle;\n context.save();\n context.translate(cx, cy);\n context.rotate(croppingElement.angle);\n context.beginPath();\n context.moveTo(x + x1s, y + y1s);\n context.lineTo(x + x1t, y + y1t);\n context.stroke();\n context.beginPath();\n context.moveTo(x + x2s, y + y2s);\n context.lineTo(x + x2t, y + y2t);\n context.stroke();\n context.restore();\n });\n context.restore();\n};\n\nconst renderTextBox = (text, context, appState, selectionColor) => {\n context.save();\n const padding = _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_TRANSFORM_HANDLE_SPACING * 2 / appState.zoom.value;\n const width = text.width + padding * 2;\n const height = text.height + padding * 2;\n const cx = text.x + width / 2;\n const cy = text.y + height / 2;\n const shiftX = -(width / 2 + padding);\n const shiftY = -(height / 2 + padding);\n context.translate(cx + appState.scrollX, cy + appState.scrollY);\n context.rotate(text.angle);\n context.lineWidth = 1 / appState.zoom.value;\n context.strokeStyle = selectionColor;\n context.strokeRect(shiftX, shiftY, width, height);\n context.restore();\n};\n\nconst _renderInteractiveScene = ({\n app,\n canvas,\n elementsMap,\n visibleElements,\n selectedElements,\n allElementsMap,\n scale,\n appState,\n renderConfig,\n editorInterface,\n animationState,\n deltaTime\n}) => {\n var _a, _b, _c, _d, _e;\n\n if (canvas === null) {\n return {\n atLeastOneVisibleElement: false,\n elementsMap\n };\n }\n\n const [normalizedWidth, normalizedHeight] = (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.getNormalizedCanvasDimensions)(canvas, scale);\n let nextAnimationState = animationState;\n const context = (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.bootstrapCanvas)({\n canvas,\n scale,\n normalizedWidth,\n normalizedHeight\n }); // Apply zoom\n\n context.save();\n context.scale(appState.zoom.value, appState.zoom.value);\n let editingLinearElement = undefined;\n visibleElements.forEach(element => {\n var _a; // Getting the element using LinearElementEditor during collab mismatches version - being one head of visible elements due to\n // ShapeCache returns empty hence making sure that we get the\n // correct element from visible elements\n\n\n if (((_a = appState.selectedLinearElement) === null || _a === void 0 ? void 0 : _a.isEditing) && appState.selectedLinearElement.elementId === element.id) {\n if (element) {\n editingLinearElement = element;\n }\n }\n });\n\n if (editingLinearElement) {\n renderLinearPointHandles(context, appState, editingLinearElement, elementsMap);\n } // Paint selection element\n\n\n if (appState.selectionElement && !appState.isCropping) {\n try {\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.renderSelectionElement)(appState.selectionElement, context, appState, renderConfig.selectionColor);\n } catch (error) {\n console.error(error);\n }\n }\n\n if (appState.editingTextElement && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isTextElement)(appState.editingTextElement)) {\n const textElement = allElementsMap.get(appState.editingTextElement.id);\n\n if (textElement && !textElement.autoResize) {\n renderTextBox(textElement, context, appState, renderConfig.selectionColor);\n }\n }\n\n if (appState.isBindingEnabled && appState.suggestedBinding) {\n nextAnimationState = Object.assign(Object.assign({}, animationState), {\n bindingHighlight: renderBindingHighlightForBindableElement(app, context, appState.suggestedBinding, allElementsMap, appState, deltaTime, appState.gridColor.Bold, //zsviczian\n animationState === null || animationState === void 0 ? void 0 : animationState.bindingHighlight)\n });\n } else {\n nextAnimationState = Object.assign(Object.assign({}, animationState), {\n bindingHighlight: undefined\n });\n }\n\n if (appState.frameToHighlight) {\n renderFrameHighlight(context, appState, appState.frameToHighlight, elementsMap);\n }\n\n if (appState.elementsToHighlight) {\n renderElementsBoxHighlight(context, appState, appState.elementsToHighlight);\n }\n\n if (appState.activeLockedId) {\n const element = allElementsMap.get(appState.activeLockedId);\n const elements = element ? [element] : (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.getElementsInGroup)(allElementsMap, appState.activeLockedId);\n renderElementsBoxHighlight(context, appState, elements, {\n colors: [\"#ced4da\"],\n dashed: true\n });\n }\n\n const isFrameSelected = selectedElements.some(element => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isFrameLikeElement)(element)); // Getting the element using LinearElementEditor during collab mismatches version - being one head of visible elements due to\n // ShapeCache returns empty hence making sure that we get the\n // correct element from visible elements\n\n if (selectedElements.length === 1 && ((_a = appState.selectedLinearElement) === null || _a === void 0 ? void 0 : _a.isEditing) && appState.selectedLinearElement.elementId === selectedElements[0].id) {\n renderLinearPointHandles(context, appState, selectedElements[0], elementsMap);\n } // Arrows have a different highlight behavior when\n // they are the only selected element\n\n\n if (appState.selectedLinearElement) {\n const editor = appState.selectedLinearElement;\n const firstSelectedLinear = selectedElements.find(el => el.id === editor.elementId);\n\n if (!appState.selectedLinearElement.isDragging) {\n if (editor.segmentMidPointHoveredCoords) {\n renderElbowArrowMidPointHighlight(context, appState);\n } else if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isElbowArrow)(firstSelectedLinear) ? editor.hoverPointIndex === 0 || editor.hoverPointIndex === firstSelectedLinear.points.length - 1 : editor.hoverPointIndex >= 0) {\n renderLinearElementPointHighlight(context, appState, elementsMap);\n }\n }\n } // Paint selected elements\n\n\n if (!appState.multiElement && !appState.newElement && !((_b = appState.selectedLinearElement) === null || _b === void 0 ? void 0 : _b.isEditing)) {\n const showBoundingBox = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.hasBoundingBox)(selectedElements, appState, editorInterface);\n const isSingleLinearElementSelected = selectedElements.length === 1 && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isLinearElement)(selectedElements[0]); // render selected linear element points\n\n if (isSingleLinearElementSelected && ((_c = appState.selectedLinearElement) === null || _c === void 0 ? void 0 : _c.elementId) === selectedElements[0].id && !selectedElements[0].locked) {\n renderLinearPointHandles(context, appState, selectedElements[0], elementsMap);\n }\n\n const selectionColor = renderConfig.selectionColor || open_color__WEBPACK_IMPORTED_MODULE_1__.black;\n\n if (showBoundingBox) {\n // Optimisation for finding quickly relevant element ids\n const locallySelectedIds = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.arrayToMap)(selectedElements);\n const selections = [];\n\n for (const element of elementsMap.values()) {\n const selectionColors = [];\n const remoteClients = renderConfig.remoteSelectedElementIds.get(element.id);\n\n if (!( // Elbow arrow elements cannot be selected when bound on either end\n isSingleLinearElementSelected && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isElbowArrow)(element) && (element.startBinding || element.endBinding))) {\n // local user\n if (locallySelectedIds.has(element.id) && !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isSelectedViaGroup)(appState, element)) {\n selectionColors.push(selectionColor);\n } // remote users\n\n\n if (remoteClients) {\n selectionColors.push(...remoteClients.map(socketId => {\n const background = (0,_clients__WEBPACK_IMPORTED_MODULE_7__.getClientColor)(socketId, appState.collaborators.get(socketId));\n return background;\n }));\n }\n }\n\n if (selectionColors.length) {\n const [x1, y1, x2, y2, cx, cy] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.getElementAbsoluteCoords)(element, elementsMap, true);\n selections.push({\n angle: element.angle,\n x1,\n y1,\n x2,\n y2,\n selectionColors: element.locked ? [\"#ced4da\"] : selectionColors,\n dashed: !!remoteClients || element.locked,\n cx,\n cy,\n activeEmbeddable: ((_d = appState.activeEmbeddable) === null || _d === void 0 ? void 0 : _d.element) === element && appState.activeEmbeddable.state === \"active\",\n padding: element.id === appState.croppingElementId || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isImageElement)(element) ? 0 : undefined\n });\n }\n }\n\n const addSelectionForGroupId = groupId => {\n const groupElements = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.getElementsInGroup)(elementsMap, groupId);\n const [x1, y1, x2, y2] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.getCommonBounds)(groupElements);\n selections.push({\n angle: 0,\n x1,\n x2,\n y1,\n y2,\n selectionColors: groupElements.some(el => el.locked) ? [\"#ced4da\"] : [open_color__WEBPACK_IMPORTED_MODULE_1__.black],\n dashed: true,\n cx: x1 + (x2 - x1) / 2,\n cy: y1 + (y2 - y1) / 2,\n activeEmbeddable: false\n });\n };\n\n for (const groupId of (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.getSelectedGroupIds)(appState)) {\n // TODO: support multiplayer selected group IDs\n addSelectionForGroupId(groupId);\n }\n\n if (appState.editingGroupId) {\n addSelectionForGroupId(appState.editingGroupId);\n }\n\n selections.forEach(selection => renderSelectionBorder(context, appState, selection));\n } // Paint resize transformHandles\n\n\n context.save();\n context.translate(appState.scrollX, appState.scrollY);\n\n if (selectedElements.length === 1) {\n context.fillStyle = open_color__WEBPACK_IMPORTED_MODULE_1__.white;\n const transformHandles = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.getTransformHandles)(selectedElements[0], appState.zoom, elementsMap, \"mouse\", // when we render we don't know which pointer type so use mouse,\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.getOmitSidesForEditorInterface)(editorInterface));\n\n if (!appState.viewModeEnabled && showBoundingBox && // do not show transform handles when text is being edited\n !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isTextElement)(appState.editingTextElement) && // do not show transform handles when image is being cropped\n !appState.croppingElementId) {\n renderTransformHandles(context, renderConfig, appState, transformHandles, selectedElements[0].angle);\n }\n\n if (appState.croppingElementId && !appState.isCropping) {\n const croppingElement = elementsMap.get(appState.croppingElementId);\n\n if (croppingElement && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isImageElement)(croppingElement)) {\n renderCropHandles(context, renderConfig, appState, croppingElement, elementsMap);\n }\n }\n } else if (selectedElements.length > 1 && !appState.isRotating && !selectedElements.some(el => el.locked)) {\n const dashedLinePadding = _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_TRANSFORM_HANDLE_SPACING * 2 / appState.zoom.value;\n context.fillStyle = open_color__WEBPACK_IMPORTED_MODULE_1__.white;\n const [x1, y1, x2, y2] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.getCommonBounds)(selectedElements, elementsMap);\n const initialLineDash = context.getLineDash();\n context.setLineDash([2 / appState.zoom.value]);\n const lineWidth = context.lineWidth;\n context.lineWidth = 1 / appState.zoom.value;\n context.strokeStyle = selectionColor;\n (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.strokeRectWithRotation_simple)(context, x1 - dashedLinePadding, y1 - dashedLinePadding, x2 - x1 + dashedLinePadding * 2, y2 - y1 + dashedLinePadding * 2, (x1 + x2) / 2, (y1 + y2) / 2, 0);\n context.lineWidth = lineWidth;\n context.setLineDash(initialLineDash);\n const transformHandles = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.getTransformHandlesFromCoords)([x1, y1, x2, y2, (x1 + x2) / 2, (y1 + y2) / 2], 0, appState.zoom, \"mouse\", isFrameSelected ? Object.assign(Object.assign({}, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.getOmitSidesForEditorInterface)(editorInterface)), {\n rotation: true\n }) : (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.getOmitSidesForEditorInterface)(editorInterface));\n\n if (selectedElements.some(element => !element.locked)) {\n renderTransformHandles(context, renderConfig, appState, transformHandles, 0);\n }\n }\n\n context.restore();\n }\n\n (_e = appState.searchMatches) === null || _e === void 0 ? void 0 : _e.matches.forEach(({\n id,\n focus,\n matchedLines\n }) => {\n const element = elementsMap.get(id);\n\n if (element) {\n const [elementX1, elementY1,,, cx, cy] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.getElementAbsoluteCoords)(element, elementsMap, true);\n context.save();\n\n if (appState.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.THEME.LIGHT) {\n if (focus) {\n context.fillStyle = \"rgba(255, 124, 0, 0.4)\";\n } else {\n context.fillStyle = \"rgba(255, 226, 0, 0.4)\";\n }\n } else if (focus) {\n context.fillStyle = \"rgba(229, 82, 0, 0.4)\";\n } else {\n context.fillStyle = \"rgba(99, 52, 0, 0.4)\";\n }\n\n const zoomFactor = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isFrameLikeElement)(element) ? appState.zoom.value : 1;\n context.translate(appState.scrollX, appState.scrollY);\n context.translate(cx, cy);\n context.rotate(element.angle);\n matchedLines.forEach(matchedLine => {\n (matchedLine.showOnCanvas || focus) && context.fillRect(elementX1 + matchedLine.offsetX / zoomFactor - cx, elementY1 + matchedLine.offsetY / zoomFactor - cy, matchedLine.width / zoomFactor, matchedLine.height / zoomFactor);\n });\n context.restore();\n }\n });\n (0,_renderer_renderSnaps__WEBPACK_IMPORTED_MODULE_4__.renderSnaps)(context, appState);\n context.restore();\n (0,_clients__WEBPACK_IMPORTED_MODULE_7__.renderRemoteCursors)({\n context,\n renderConfig,\n appState,\n normalizedWidth,\n normalizedHeight\n }); // Paint scrollbars\n\n let scrollBars;\n\n if (renderConfig.renderScrollbars) {\n scrollBars = (0,_scene_scrollbars__WEBPACK_IMPORTED_MODULE_6__.getScrollBars)(elementsMap, normalizedWidth, normalizedHeight, appState);\n context.save();\n context.fillStyle = _scene_scrollbars__WEBPACK_IMPORTED_MODULE_6__.SCROLLBAR_COLOR;\n context.strokeStyle = \"rgba(255,255,255,0.8)\";\n [scrollBars.horizontal, scrollBars.vertical].forEach(scrollBar => {\n if (scrollBar) {\n (0,_renderer_roundRect__WEBPACK_IMPORTED_MODULE_5__.roundRect)(context, scrollBar.x, scrollBar.y, scrollBar.width, scrollBar.height, _scene_scrollbars__WEBPACK_IMPORTED_MODULE_6__.SCROLLBAR_WIDTH / 2);\n }\n });\n context.restore();\n }\n\n return {\n scrollBars,\n atLeastOneVisibleElement: visibleElements.length > 0,\n elementsMap,\n animationState: nextAnimationState\n };\n};\n/**\r\n * Interactive scene is the ui-canvas where we render bounding boxes, selections\r\n * and other ui stuff.\r\n */\n\n\nconst renderInteractiveScene = renderConfig => {\n const ret = _renderInteractiveScene(renderConfig);\n\n renderConfig.callback(ret);\n return ret;\n};\n\n//# sourceURL=webpack://ExcalidrawLib/./renderer/interactiveScene.ts?");
20760
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ renderInteractiveScene: () => (/* binding */ renderInteractiveScene)\n/* harmony export */ });\n/* harmony import */ var _excalidraw_math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @excalidraw/math */ \"../math/src/index.ts\");\n/* harmony import */ var open_color__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! open-color */ \"../../node_modules/open-color/open-color.json\");\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n/* harmony import */ var _excalidraw_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @excalidraw/element */ \"../element/src/index.ts\");\n/* harmony import */ var _renderer_renderSnaps__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../renderer/renderSnaps */ \"./renderer/renderSnaps.ts\");\n/* harmony import */ var _renderer_roundRect__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../renderer/roundRect */ \"./renderer/roundRect.ts\");\n/* harmony import */ var _scene_scrollbars__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../scene/scrollbars */ \"./scene/scrollbars.ts\");\n/* harmony import */ var _clients__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../clients */ \"./clients.ts\");\n/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./helpers */ \"./renderer/helpers.ts\");\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst renderElbowArrowMidPointHighlight = (context, appState) => {\n (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.invariant)(appState.selectedLinearElement, \"selectedLinearElement is null\");\n const {\n segmentMidPointHoveredCoords\n } = appState.selectedLinearElement;\n (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.invariant)(segmentMidPointHoveredCoords, \"midPointCoords is null\");\n context.save();\n context.translate(appState.scrollX, appState.scrollY);\n highlightPoint(segmentMidPointHoveredCoords, context, appState);\n context.restore();\n};\n\nconst renderLinearElementPointHighlight = (context, appState, elementsMap) => {\n var _a, _b, _c;\n\n const {\n elementId,\n hoverPointIndex\n } = appState.selectedLinearElement;\n\n if (((_a = appState.selectedLinearElement) === null || _a === void 0 ? void 0 : _a.isEditing) && ((_c = (_b = appState.selectedLinearElement) === null || _b === void 0 ? void 0 : _b.selectedPointsIndices) === null || _c === void 0 ? void 0 : _c.includes(hoverPointIndex))) {\n return;\n }\n\n const element = _excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.LinearElementEditor.getElement(elementId, elementsMap);\n\n if (!element) {\n return;\n }\n\n const point = _excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.LinearElementEditor.getPointAtIndexGlobalCoordinates(element, hoverPointIndex, elementsMap);\n context.save();\n context.translate(appState.scrollX, appState.scrollY);\n highlightPoint(point, context, appState);\n context.restore();\n};\n\nconst highlightPoint = (point, context, appState) => {\n context.fillStyle = \"rgba(105, 101, 219, 0.4)\";\n (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.fillCircle)(context, point[0], point[1], _excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.LinearElementEditor.POINT_HANDLE_SIZE / appState.zoom.value, false);\n};\n\nconst renderSingleLinearPoint = (context, appState, point, radius, isSelected, isPhantomPoint, isOverlappingPoint) => {\n var _a;\n\n context.strokeStyle = \"#5e5ad8\";\n context.setLineDash([]);\n context.fillStyle = \"rgba(255, 255, 255, 0.9)\";\n\n if (isSelected) {\n context.fillStyle = \"rgba(134, 131, 226, 0.9)\";\n } else if (isPhantomPoint) {\n context.fillStyle = \"rgba(177, 151, 252, 0.7)\";\n }\n\n (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.fillCircle)(context, point[0], point[1], (isOverlappingPoint ? radius * (((_a = appState.selectedLinearElement) === null || _a === void 0 ? void 0 : _a.isEditing) ? 1.5 : 2) : radius) / appState.zoom.value, !isPhantomPoint, !isOverlappingPoint || isSelected);\n};\n\nconst renderBindingHighlightForBindableElement_simple = (context, element, elementsMap, appState) => {\n var _a, _b, _c;\n\n const enclosingFrame = element.frameId && elementsMap.get(element.frameId);\n\n if (enclosingFrame && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isFrameLikeElement)(enclosingFrame)) {\n context.translate(enclosingFrame.x, enclosingFrame.y);\n const highlightColor = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.getHighlightColor)((_c = (_b = (_a = enclosingFrame.customData) === null || _a === void 0 ? void 0 : _a.frameColor) === null || _b === void 0 ? void 0 : _b.stroke) !== null && _c !== void 0 ? _c : appState.frameColor.stroke, appState.viewBackgroundColor); //zsviczian\n\n context.fillStyle = highlightColor !== null && highlightColor !== void 0 ? highlightColor : \"rgba(0,0,0,.05)\"; //zsviczian\n\n context.beginPath();\n\n if (_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.radius && context.roundRect) {\n context.roundRect(-1, -1, enclosingFrame.width + 1, enclosingFrame.height + 1, _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.radius / appState.zoom.value);\n } else {\n context.rect(-1, -1, enclosingFrame.width + 1, enclosingFrame.height + 1);\n }\n\n context.clip();\n context.translate(-enclosingFrame.x, -enclosingFrame.y);\n }\n\n switch (element.type) {\n case \"magicframe\":\n case \"frame\":\n context.save();\n const highlightColor = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.getHighlightColor)(appState.frameColor.stroke, appState.viewBackgroundColor); //zsviczian\n\n context.translate(element.x, element.y);\n context.lineWidth = _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.strokeWidth / appState.zoom.value;\n context.strokeStyle = highlightColor !== null && highlightColor !== void 0 ? highlightColor : appState.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.THEME.DARK ? `rgba(3, 93, 161, 1)` : `rgba(106, 189, 252, 1)`;\n\n if (_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.radius && context.roundRect) {\n context.beginPath();\n context.roundRect(0, 0, element.width, element.height, _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.radius / appState.zoom.value);\n context.stroke();\n context.closePath();\n } else {\n context.strokeRect(0, 0, element.width, element.height);\n }\n\n context.restore();\n break;\n\n default:\n context.save();\n const highlightColor2 = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.getHighlightColor)((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isTextElement)(element) ? appState.viewBackgroundColor : element.strokeColor, appState.viewBackgroundColor); //zsviczian\n\n const center = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.elementCenterPoint)(element, elementsMap);\n context.translate(center[0], center[1]);\n context.rotate(element.angle);\n context.translate(-center[0], -center[1]);\n context.translate(element.x, element.y);\n context.lineWidth = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_0__.clamp)(1.75, element.strokeWidth, 10) / //zsviczian was max was 4\n Math.max(0.25, appState.zoom.value);\n context.strokeStyle = highlightColor2 !== null && highlightColor2 !== void 0 ? highlightColor2 : appState.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.THEME.DARK ? `rgba(3, 93, 161, 1)` : `rgba(106, 189, 252, 1)`;\n\n switch (element.type) {\n case \"ellipse\":\n context.beginPath();\n context.ellipse(element.width / 2, element.height / 2, element.width / 2, element.height / 2, 0, 0, 2 * Math.PI);\n context.closePath();\n context.stroke();\n break;\n\n case \"diamond\":\n {\n const [segments, curves] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.deconstructDiamondElement)(element); // Draw each line segment individually\n\n segments.forEach(segment => {\n context.beginPath();\n context.moveTo(segment[0][0] - element.x, segment[0][1] - element.y);\n context.lineTo(segment[1][0] - element.x, segment[1][1] - element.y);\n context.stroke();\n }); // Draw each curve individually (for rounded corners)\n\n curves.forEach(curve => {\n const [start, control1, control2, end] = curve;\n context.beginPath();\n context.moveTo(start[0] - element.x, start[1] - element.y);\n context.bezierCurveTo(control1[0] - element.x, control1[1] - element.y, control2[0] - element.x, control2[1] - element.y, end[0] - element.x, end[1] - element.y);\n context.stroke();\n });\n }\n break;\n\n default:\n {\n const [segments, curves] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.deconstructRectanguloidElement)(element); // Draw each line segment individually\n\n segments.forEach(segment => {\n context.beginPath();\n context.moveTo(segment[0][0] - element.x, segment[0][1] - element.y);\n context.lineTo(segment[1][0] - element.x, segment[1][1] - element.y);\n context.stroke();\n }); // Draw each curve individually (for rounded corners)\n\n curves.forEach(curve => {\n const [start, control1, control2, end] = curve;\n context.beginPath();\n context.moveTo(start[0] - element.x, start[1] - element.y);\n context.bezierCurveTo(control1[0] - element.x, control1[1] - element.y, control2[0] - element.x, control2[1] - element.y, end[0] - element.x, end[1] - element.y);\n context.stroke();\n });\n }\n break;\n }\n\n context.restore();\n break;\n }\n};\n\nconst renderBindingHighlightForBindableElement_complex = (app, context, element, allElementsMap, appState, deltaTime, state) => {\n var _a, _b, _c, _d, _e, _f;\n\n const countdownInProgress = app.state.bindMode === \"orbit\" && app.bindModeHandler !== null;\n const remainingTime = _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.BIND_MODE_TIMEOUT - ((_a = state === null || state === void 0 ? void 0 : state.runtime) !== null && _a !== void 0 ? _a : countdownInProgress ? 0 : _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.BIND_MODE_TIMEOUT);\n const opacity = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_0__.clamp)(1 / _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.BIND_MODE_TIMEOUT * remainingTime, 0.0001, 1);\n const offset = element.strokeWidth / 2;\n const enclosingFrame = element.frameId && allElementsMap.get(element.frameId);\n\n if (enclosingFrame && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isFrameLikeElement)(enclosingFrame)) {\n context.translate(enclosingFrame.x, enclosingFrame.y);\n context.beginPath();\n\n if (_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.radius && context.roundRect) {\n context.roundRect(-1, -1, enclosingFrame.width + 1, enclosingFrame.height + 1, _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.radius / appState.zoom.value);\n } else {\n context.rect(-1, -1, enclosingFrame.width + 1, enclosingFrame.height + 1);\n }\n\n context.clip();\n context.translate(-enclosingFrame.x, -enclosingFrame.y);\n }\n\n switch (element.type) {\n case \"magicframe\":\n case \"frame\":\n context.save();\n context.translate(element.x, element.y);\n const highlightColor = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.getHighlightColor)((_d = (_c = (_b = element.customData) === null || _b === void 0 ? void 0 : _b.frameColor) === null || _c === void 0 ? void 0 : _c.stroke) !== null && _d !== void 0 ? _d : appState.frameColor.stroke, appState.viewBackgroundColor, opacity); //zsviczian\n\n context.lineWidth = _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.strokeWidth / appState.zoom.value;\n context.strokeStyle = highlightColor !== null && highlightColor !== void 0 ? highlightColor : appState.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.THEME.DARK ? `rgba(3, 93, 161, ${opacity})` : `rgba(106, 189, 252, ${opacity})`;\n\n if (_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.radius && context.roundRect) {\n context.beginPath();\n context.roundRect(0, 0, element.width, element.height, _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.radius / appState.zoom.value);\n context.stroke();\n context.closePath();\n } else {\n context.strokeRect(0, 0, element.width, element.height);\n }\n\n context.restore();\n break;\n\n default:\n context.save();\n const center = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.elementCenterPoint)(element, allElementsMap);\n const cx = center[0] + appState.scrollX;\n const cy = center[1] + appState.scrollY;\n context.translate(cx, cy);\n context.rotate(element.angle);\n context.translate(-cx, -cy);\n context.translate(element.x + appState.scrollX - offset, element.y + appState.scrollY - offset);\n const highlightColor2 = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.getHighlightColor)((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isTextElement)(element) ? appState.viewBackgroundColor : element.strokeColor, appState.viewBackgroundColor, opacity / 2); //zsviczian\n\n context.lineWidth = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_0__.clamp)(2.5, element.strokeWidth * 1.75, 10) / //zsviczian max was 4\n Math.max(0.25, appState.zoom.value);\n context.strokeStyle = highlightColor2 !== null && highlightColor2 !== void 0 ? highlightColor2 : appState.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.THEME.DARK ? `rgba(3, 93, 161, ${opacity / 2})` : `rgba(106, 189, 252, ${opacity / 2})`;\n\n switch (element.type) {\n case \"ellipse\":\n context.beginPath();\n context.ellipse((element.width + offset * 2) / 2, (element.height + offset * 2) / 2, (element.width + offset * 2) / 2, (element.height + offset * 2) / 2, 0, 0, 2 * Math.PI);\n context.closePath();\n context.stroke();\n break;\n\n case \"diamond\":\n {\n const [segments, curves] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.deconstructDiamondElement)(element, offset); // Draw each line segment individually\n\n segments.forEach(segment => {\n context.beginPath();\n context.moveTo(segment[0][0] - element.x + offset, segment[0][1] - element.y + offset);\n context.lineTo(segment[1][0] - element.x + offset, segment[1][1] - element.y + offset);\n context.stroke();\n }); // Draw each curve individually (for rounded corners)\n\n curves.forEach(curve => {\n const [start, control1, control2, end] = curve;\n context.beginPath();\n context.moveTo(start[0] - element.x + offset, start[1] - element.y + offset);\n context.bezierCurveTo(control1[0] - element.x + offset, control1[1] - element.y + offset, control2[0] - element.x + offset, control2[1] - element.y + offset, end[0] - element.x + offset, end[1] - element.y + offset);\n context.stroke();\n });\n }\n break;\n\n default:\n {\n const [segments, curves] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.deconstructRectanguloidElement)(element, offset); // Draw each line segment individually\n\n segments.forEach(segment => {\n context.beginPath();\n context.moveTo(segment[0][0] - element.x + offset, segment[0][1] - element.y + offset);\n context.lineTo(segment[1][0] - element.x + offset, segment[1][1] - element.y + offset);\n context.stroke();\n }); // Draw each curve individually (for rounded corners)\n\n curves.forEach(curve => {\n const [start, control1, control2, end] = curve;\n context.beginPath();\n context.moveTo(start[0] - element.x + offset, start[1] - element.y + offset);\n context.bezierCurveTo(control1[0] - element.x + offset, control1[1] - element.y + offset, control2[0] - element.x + offset, control2[1] - element.y + offset, end[0] - element.x + offset, end[1] - element.y + offset);\n context.stroke();\n });\n }\n break;\n }\n\n context.restore();\n break;\n } // Middle indicator is not rendered after it expired\n\n\n if (!countdownInProgress || ((_e = state === null || state === void 0 ? void 0 : state.runtime) !== null && _e !== void 0 ? _e : 0) > _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.BIND_MODE_TIMEOUT) {\n return;\n }\n\n const radius = 0.5 * (Math.min(element.width, element.height) / 2); // Draw center snap area\n\n if (!(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isFrameLikeElement)(element)) {\n context.save();\n context.translate(element.x + appState.scrollX, element.y + appState.scrollY);\n const PROGRESS_RATIO = 1 / _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.BIND_MODE_TIMEOUT * remainingTime;\n context.strokeStyle = \"rgba(0, 0, 0, 0.2)\";\n context.lineWidth = 1 / appState.zoom.value;\n context.setLineDash([4 / appState.zoom.value, 4 / appState.zoom.value]);\n context.lineDashOffset = -PROGRESS_RATIO * 10 / appState.zoom.value;\n context.beginPath();\n context.ellipse(element.width / 2, element.height / 2, radius, radius, 0, 0, 2 * Math.PI);\n context.stroke();\n const highlightColor = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.getHighlightColor)((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isTextElement)(element) ? appState.viewBackgroundColor : element.strokeColor, appState.viewBackgroundColor); //zsviczian\n // context.strokeStyle = \"transparent\";\n\n context.fillStyle = highlightColor !== null && highlightColor !== void 0 ? highlightColor : \"rgba(128,128,128,.1)\"; //zsviczian \"rgba(0, 0, 0, 0.04)\";\n\n context.beginPath();\n context.ellipse(element.width / 2, element.height / 2, radius * (1 - opacity), radius * (1 - opacity), 0, 0, 2 * Math.PI);\n context.fill();\n context.restore();\n }\n\n return {\n runtime: ((_f = state === null || state === void 0 ? void 0 : state.runtime) !== null && _f !== void 0 ? _f : 0) + deltaTime\n };\n};\n\nconst renderBindingHighlightForBindableElement = (app, context, element, allElementsMap, appState, deltaTime, state) => {\n if ((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.getFeatureFlag)(\"COMPLEX_BINDINGS\")) {\n return renderBindingHighlightForBindableElement_complex(app, context, element, allElementsMap, appState, deltaTime, state);\n }\n\n context.save();\n context.translate(appState.scrollX, appState.scrollY);\n renderBindingHighlightForBindableElement_simple(context, element, allElementsMap, appState);\n context.restore();\n};\n\nconst renderSelectionBorder = (context, appState, elementProperties) => {\n var _a;\n\n const {\n angle,\n x1,\n y1,\n x2,\n y2,\n selectionColors,\n cx,\n cy,\n dashed,\n activeEmbeddable\n } = elementProperties;\n const elementWidth = x2 - x1;\n const elementHeight = y2 - y1;\n const padding = (_a = elementProperties.padding) !== null && _a !== void 0 ? _a : _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_TRANSFORM_HANDLE_SPACING * 2;\n const linePadding = padding / appState.zoom.value;\n const lineWidth = 8 / appState.zoom.value;\n const spaceWidth = 4 / appState.zoom.value;\n context.save();\n context.translate(appState.scrollX, appState.scrollY);\n const thick = activeEmbeddable || appState.highlightSearchResult; //zsviczian\n\n context.lineWidth = (thick ? 4 : 1.5) / appState.zoom.value; //zsviczian was 1 / appState.zoom.value;\n\n const count = selectionColors.length;\n\n for (let index = 0; index < count; ++index) {\n context.strokeStyle = selectionColors[index];\n\n if (dashed) {\n context.setLineDash([lineWidth, spaceWidth + (lineWidth + spaceWidth) * (count - 1)]);\n }\n\n context.lineDashOffset = (lineWidth + spaceWidth) * index;\n (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.strokeRectWithRotation_simple)(context, x1 - linePadding, y1 - linePadding, elementWidth + linePadding * 2, elementHeight + linePadding * 2, cx, cy, angle);\n }\n\n context.restore();\n};\n\nconst renderFrameHighlight = (context, appState, frame, elementsMap) => {\n const [x1, y1, x2, y2] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.getElementAbsoluteCoords)(frame, elementsMap);\n const width = x2 - x1;\n const height = y2 - y1;\n context.strokeStyle = \"rgb(0,118,255)\";\n context.lineWidth = _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.strokeWidth / appState.zoom.value;\n context.save();\n context.translate(appState.scrollX, appState.scrollY);\n (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.strokeRectWithRotation_simple)(context, x1, y1, width, height, x1 + width / 2, y1 + height / 2, frame.angle, false, _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.FRAME_STYLE.radius / appState.zoom.value);\n context.restore();\n};\n\nconst renderElementsBoxHighlight = (context, appState, elements, config) => {\n const highlightColor = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.getHighlightColor)(appState.viewBackgroundColor, appState.viewBackgroundColor); //zsviczian\n\n const {\n colors = [highlightColor],\n dashed = false\n } = config || {}; //zsviczian\n\n const individualElements = elements.filter(element => element.groupIds.length === 0);\n const elementsInGroups = elements.filter(element => element.groupIds.length > 0);\n\n const getSelectionFromElements = elements => {\n const [x1, y1, x2, y2] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.getCommonBounds)(elements);\n return {\n angle: 0,\n x1,\n x2,\n y1,\n y2,\n selectionColors: colors,\n dashed,\n cx: x1 + (x2 - x1) / 2,\n cy: y1 + (y2 - y1) / 2,\n activeEmbeddable: false\n };\n };\n\n const getSelectionForGroupId = groupId => {\n const groupElements = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.getElementsInGroup)(elements, groupId);\n return getSelectionFromElements(groupElements);\n };\n\n Object.entries((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.selectGroupsFromGivenElements)(elementsInGroups, appState)).filter(([id, isSelected]) => isSelected).map(([id, isSelected]) => id).map(groupId => getSelectionForGroupId(groupId)).concat(individualElements.map(element => getSelectionFromElements([element]))).forEach(selection => renderSelectionBorder(context, appState, selection));\n};\n\nconst renderLinearPointHandles = (context, appState, element, elementsMap) => {\n var _a, _b;\n\n if (!appState.selectedLinearElement) {\n return;\n }\n\n context.save();\n context.translate(appState.scrollX, appState.scrollY);\n context.lineWidth = 1 / appState.zoom.value;\n const points = _excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.LinearElementEditor.getPointsGlobalCoordinates(element, elementsMap);\n const {\n POINT_HANDLE_SIZE\n } = _excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.LinearElementEditor;\n const radius = ((_a = appState.selectedLinearElement) === null || _a === void 0 ? void 0 : _a.isEditing) ? POINT_HANDLE_SIZE : POINT_HANDLE_SIZE / 2;\n\n const _isElbowArrow = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isElbowArrow)(element);\n\n const _isLineElement = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isLineElement)(element);\n\n points.forEach((point, idx) => {\n var _a, _b, _c, _d, _e, _f;\n\n if (_isElbowArrow && idx !== 0 && idx !== points.length - 1) {\n return;\n }\n\n const isOverlappingPoint = idx > 0 && (idx !== points.length - 1 || !_isLineElement || !element.polygon) && (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_0__.pointsEqual)(point, idx === points.length - 1 ? points[0] : points[idx - 1], 2 / appState.zoom.value);\n let isSelected = !!((_a = appState.selectedLinearElement) === null || _a === void 0 ? void 0 : _a.isEditing) && !!((_c = (_b = appState.selectedLinearElement) === null || _b === void 0 ? void 0 : _b.selectedPointsIndices) === null || _c === void 0 ? void 0 : _c.includes(idx)); // when element is a polygon, highlight the last point as well if first\n // point is selected since they overlap and the last point tends to be\n // rendered on top\n\n if (_isLineElement && element.polygon && !isSelected && idx === element.points.length - 1 && !!((_d = appState.selectedLinearElement) === null || _d === void 0 ? void 0 : _d.isEditing) && !!((_f = (_e = appState.selectedLinearElement) === null || _e === void 0 ? void 0 : _e.selectedPointsIndices) === null || _f === void 0 ? void 0 : _f.includes(0))) {\n isSelected = true;\n }\n\n renderSingleLinearPoint(context, appState, point, radius, isSelected, false, isOverlappingPoint);\n }); // Rendering segment mid points\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isElbowArrow)(element)) {\n const fixedSegments = ((_b = element.fixedSegments) === null || _b === void 0 ? void 0 : _b.map(segment => segment.index)) || [];\n points.slice(0, -1).forEach((p, idx) => {\n if (!_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.LinearElementEditor.isSegmentTooShort(element, points[idx + 1], points[idx], idx, appState.zoom)) {\n renderSingleLinearPoint(context, appState, (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_0__.pointFrom)((p[0] + points[idx + 1][0]) / 2, (p[1] + points[idx + 1][1]) / 2), POINT_HANDLE_SIZE / 2, false, !fixedSegments.includes(idx + 1), false);\n }\n });\n } else {\n const midPoints = _excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.LinearElementEditor.getEditorMidPoints(element, elementsMap, appState).filter((midPoint, idx, midPoints) => midPoint !== null && !((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isElbowArrow)(element) && (idx === 0 || idx === midPoints.length - 1)));\n midPoints.forEach(segmentMidPoint => {\n var _a;\n\n if (((_a = appState.selectedLinearElement) === null || _a === void 0 ? void 0 : _a.isEditing) || points.length === 2) {\n renderSingleLinearPoint(context, appState, segmentMidPoint, POINT_HANDLE_SIZE / 2, false, true, false);\n }\n });\n }\n\n context.restore();\n};\n\nconst renderTransformHandles = (context, renderConfig, appState, transformHandles, angle) => {\n Object.keys(transformHandles).forEach(key => {\n const transformHandle = transformHandles[key];\n\n if (transformHandle !== undefined) {\n const [x, y, width, height] = transformHandle;\n context.save();\n context.lineWidth = 1.5 / appState.zoom.value; //zsviczian changed from 1 to 1.5\n\n if (renderConfig.selectionColor) {\n context.strokeStyle = renderConfig.selectionColor;\n }\n\n if (key === \"rotation\") {\n (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.fillCircle)(context, x + width / 2, y + height / 2, width / 2, true); // prefer round corners if roundRect API is available\n } else if (context.roundRect) {\n context.beginPath();\n context.roundRect(x, y, width, height, 2 / appState.zoom.value);\n context.fill();\n context.stroke();\n } else {\n (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.strokeRectWithRotation_simple)(context, x, y, width, height, x + width / 2, y + height / 2, angle, true);\n }\n\n context.restore();\n }\n });\n};\n\nconst renderCropHandles = (context, renderConfig, appState, croppingElement, elementsMap) => {\n const [x1, y1,,, cx, cy] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.getElementAbsoluteCoords)(croppingElement, elementsMap);\n const LINE_WIDTH = 3;\n const LINE_LENGTH = 20;\n const ZOOMED_LINE_WIDTH = LINE_WIDTH / appState.zoom.value;\n const ZOOMED_HALF_LINE_WIDTH = ZOOMED_LINE_WIDTH / 2;\n const HALF_WIDTH = cx - x1 + ZOOMED_LINE_WIDTH;\n const HALF_HEIGHT = cy - y1 + ZOOMED_LINE_WIDTH;\n const HORIZONTAL_LINE_LENGTH = Math.min(LINE_LENGTH / appState.zoom.value, HALF_WIDTH);\n const VERTICAL_LINE_LENGTH = Math.min(LINE_LENGTH / appState.zoom.value, HALF_HEIGHT);\n context.save();\n context.fillStyle = renderConfig.selectionColor;\n context.strokeStyle = renderConfig.selectionColor;\n context.lineWidth = ZOOMED_LINE_WIDTH;\n const handles = [[// x, y\n [-HALF_WIDTH, -HALF_HEIGHT], // horizontal line: first start and to\n [0, ZOOMED_HALF_LINE_WIDTH], [HORIZONTAL_LINE_LENGTH, ZOOMED_HALF_LINE_WIDTH], // vertical line: second start and to\n [ZOOMED_HALF_LINE_WIDTH, 0], [ZOOMED_HALF_LINE_WIDTH, VERTICAL_LINE_LENGTH]], [[HALF_WIDTH - ZOOMED_HALF_LINE_WIDTH, -HALF_HEIGHT], [ZOOMED_HALF_LINE_WIDTH, ZOOMED_HALF_LINE_WIDTH], [-HORIZONTAL_LINE_LENGTH + ZOOMED_HALF_LINE_WIDTH, ZOOMED_HALF_LINE_WIDTH], [0, 0], [0, VERTICAL_LINE_LENGTH]], [[-HALF_WIDTH, HALF_HEIGHT], [0, -ZOOMED_HALF_LINE_WIDTH], [HORIZONTAL_LINE_LENGTH, -ZOOMED_HALF_LINE_WIDTH], [ZOOMED_HALF_LINE_WIDTH, 0], [ZOOMED_HALF_LINE_WIDTH, -VERTICAL_LINE_LENGTH]], [[HALF_WIDTH - ZOOMED_HALF_LINE_WIDTH, HALF_HEIGHT], [ZOOMED_HALF_LINE_WIDTH, -ZOOMED_HALF_LINE_WIDTH], [-HORIZONTAL_LINE_LENGTH + ZOOMED_HALF_LINE_WIDTH, -ZOOMED_HALF_LINE_WIDTH], [0, 0], [0, -VERTICAL_LINE_LENGTH]]];\n handles.forEach(handle => {\n const [[x, y], [x1s, y1s], [x1t, y1t], [x2s, y2s], [x2t, y2t]] = handle;\n context.save();\n context.translate(cx, cy);\n context.rotate(croppingElement.angle);\n context.beginPath();\n context.moveTo(x + x1s, y + y1s);\n context.lineTo(x + x1t, y + y1t);\n context.stroke();\n context.beginPath();\n context.moveTo(x + x2s, y + y2s);\n context.lineTo(x + x2t, y + y2t);\n context.stroke();\n context.restore();\n });\n context.restore();\n};\n\nconst renderTextBox = (text, context, appState, selectionColor) => {\n context.save();\n const padding = _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_TRANSFORM_HANDLE_SPACING * 2 / appState.zoom.value;\n const width = text.width + padding * 2;\n const height = text.height + padding * 2;\n const cx = text.x + width / 2;\n const cy = text.y + height / 2;\n const shiftX = -(width / 2 + padding);\n const shiftY = -(height / 2 + padding);\n context.translate(cx + appState.scrollX, cy + appState.scrollY);\n context.rotate(text.angle);\n context.lineWidth = 1.5 / appState.zoom.value; //zsviczian changed from 1 to 1.5\n\n context.strokeStyle = selectionColor;\n context.strokeRect(shiftX, shiftY, width, height);\n context.restore();\n};\n\nconst _renderInteractiveScene = ({\n app,\n canvas,\n elementsMap,\n visibleElements,\n selectedElements,\n allElementsMap,\n scale,\n appState,\n renderConfig,\n editorInterface,\n animationState,\n deltaTime\n}) => {\n var _a, _b, _c, _d, _e;\n\n if (canvas === null) {\n return {\n atLeastOneVisibleElement: false,\n elementsMap\n };\n }\n\n const [normalizedWidth, normalizedHeight] = (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.getNormalizedCanvasDimensions)(canvas, scale);\n let nextAnimationState = animationState;\n const context = (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.bootstrapCanvas)({\n canvas,\n scale,\n normalizedWidth,\n normalizedHeight\n }); // Apply zoom\n\n context.save();\n context.scale(appState.zoom.value, appState.zoom.value);\n let editingLinearElement = undefined;\n visibleElements.forEach(element => {\n var _a; // Getting the element using LinearElementEditor during collab mismatches version - being one head of visible elements due to\n // ShapeCache returns empty hence making sure that we get the\n // correct element from visible elements\n\n\n if (((_a = appState.selectedLinearElement) === null || _a === void 0 ? void 0 : _a.isEditing) && appState.selectedLinearElement.elementId === element.id) {\n if (element) {\n editingLinearElement = element;\n }\n }\n });\n\n if (editingLinearElement) {\n renderLinearPointHandles(context, appState, editingLinearElement, elementsMap);\n } // Paint selection element\n\n\n if (appState.selectionElement && !appState.isCropping) {\n try {\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.renderSelectionElement)(appState.selectionElement, context, appState, renderConfig.selectionColor);\n } catch (error) {\n console.error(error);\n }\n }\n\n if (appState.editingTextElement && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isTextElement)(appState.editingTextElement)) {\n const textElement = allElementsMap.get(appState.editingTextElement.id);\n\n if (textElement && !textElement.autoResize) {\n renderTextBox(textElement, context, appState, renderConfig.selectionColor);\n }\n }\n\n if (appState.isBindingEnabled && appState.suggestedBinding) {\n nextAnimationState = Object.assign(Object.assign({}, animationState), {\n bindingHighlight: renderBindingHighlightForBindableElement(app, context, appState.suggestedBinding, allElementsMap, appState, deltaTime, animationState === null || animationState === void 0 ? void 0 : animationState.bindingHighlight)\n });\n } else {\n nextAnimationState = Object.assign(Object.assign({}, animationState), {\n bindingHighlight: undefined\n });\n }\n\n if (appState.frameToHighlight) {\n renderFrameHighlight(context, appState, appState.frameToHighlight, elementsMap);\n }\n\n if (appState.elementsToHighlight) {\n renderElementsBoxHighlight(context, appState, appState.elementsToHighlight);\n }\n\n if (appState.activeLockedId) {\n const element = allElementsMap.get(appState.activeLockedId);\n const elements = element ? [element] : (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.getElementsInGroup)(allElementsMap, appState.activeLockedId);\n renderElementsBoxHighlight(context, appState, elements, {\n colors: [\"#ced4da\"],\n dashed: true\n });\n }\n\n const isFrameSelected = selectedElements.some(element => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isFrameLikeElement)(element)); // Getting the element using LinearElementEditor during collab mismatches version - being one head of visible elements due to\n // ShapeCache returns empty hence making sure that we get the\n // correct element from visible elements\n\n if (selectedElements.length === 1 && ((_a = appState.selectedLinearElement) === null || _a === void 0 ? void 0 : _a.isEditing) && appState.selectedLinearElement.elementId === selectedElements[0].id) {\n renderLinearPointHandles(context, appState, selectedElements[0], elementsMap);\n } // Arrows have a different highlight behavior when\n // they are the only selected element\n\n\n if (appState.selectedLinearElement) {\n const editor = appState.selectedLinearElement;\n const firstSelectedLinear = selectedElements.find(el => el.id === editor.elementId);\n\n if (!appState.selectedLinearElement.isDragging) {\n if (editor.segmentMidPointHoveredCoords) {\n renderElbowArrowMidPointHighlight(context, appState);\n } else if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isElbowArrow)(firstSelectedLinear) ? editor.hoverPointIndex === 0 || editor.hoverPointIndex === firstSelectedLinear.points.length - 1 : editor.hoverPointIndex >= 0) {\n renderLinearElementPointHighlight(context, appState, elementsMap);\n }\n }\n } // Paint selected elements\n\n\n if (!appState.multiElement && !appState.newElement && !((_b = appState.selectedLinearElement) === null || _b === void 0 ? void 0 : _b.isEditing)) {\n const showBoundingBox = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.hasBoundingBox)(selectedElements, appState, editorInterface);\n const isSingleLinearElementSelected = selectedElements.length === 1 && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isLinearElement)(selectedElements[0]); // render selected linear element points\n\n if (isSingleLinearElementSelected && ((_c = appState.selectedLinearElement) === null || _c === void 0 ? void 0 : _c.elementId) === selectedElements[0].id && !selectedElements[0].locked) {\n renderLinearPointHandles(context, appState, selectedElements[0], elementsMap);\n }\n\n const selectionColor = renderConfig.selectionColor || open_color__WEBPACK_IMPORTED_MODULE_1__.black;\n\n if (showBoundingBox) {\n // Optimisation for finding quickly relevant element ids\n const locallySelectedIds = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.arrayToMap)(selectedElements);\n const selections = [];\n\n for (const element of elementsMap.values()) {\n const selectionColors = [];\n const remoteClients = renderConfig.remoteSelectedElementIds.get(element.id);\n\n if (!( // Elbow arrow elements cannot be selected when bound on either end\n isSingleLinearElementSelected && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isElbowArrow)(element) && (element.startBinding || element.endBinding))) {\n // local user\n if (locallySelectedIds.has(element.id) && !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isSelectedViaGroup)(appState, element)) {\n selectionColors.push(selectionColor);\n } // remote users\n\n\n if (remoteClients) {\n selectionColors.push(...remoteClients.map(socketId => {\n const background = (0,_clients__WEBPACK_IMPORTED_MODULE_7__.getClientColor)(socketId, appState.collaborators.get(socketId));\n return background;\n }));\n }\n }\n\n if (selectionColors.length) {\n const [x1, y1, x2, y2, cx, cy] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.getElementAbsoluteCoords)(element, elementsMap, true);\n selections.push({\n angle: element.angle,\n x1,\n y1,\n x2,\n y2,\n selectionColors: element.locked ? [\"#ced4da\"] : selectionColors,\n dashed: !!remoteClients || element.locked,\n cx,\n cy,\n activeEmbeddable: ((_d = appState.activeEmbeddable) === null || _d === void 0 ? void 0 : _d.element) === element && appState.activeEmbeddable.state === \"active\",\n padding: element.id === appState.croppingElementId || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isImageElement)(element) ? 0 : undefined\n });\n }\n }\n\n const addSelectionForGroupId = groupId => {\n const groupElements = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.getElementsInGroup)(elementsMap, groupId);\n const [x1, y1, x2, y2] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.getCommonBounds)(groupElements);\n selections.push({\n angle: 0,\n x1,\n x2,\n y1,\n y2,\n selectionColors: groupElements.some(el => el.locked) ? [\"#ced4da\"] : [open_color__WEBPACK_IMPORTED_MODULE_1__.black],\n dashed: true,\n cx: x1 + (x2 - x1) / 2,\n cy: y1 + (y2 - y1) / 2,\n activeEmbeddable: false\n });\n };\n\n for (const groupId of (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.getSelectedGroupIds)(appState)) {\n // TODO: support multiplayer selected group IDs\n addSelectionForGroupId(groupId);\n }\n\n if (appState.editingGroupId) {\n addSelectionForGroupId(appState.editingGroupId);\n }\n\n selections.forEach(selection => renderSelectionBorder(context, appState, selection));\n } // Paint resize transformHandles\n\n\n context.save();\n context.translate(appState.scrollX, appState.scrollY);\n\n if (selectedElements.length === 1) {\n context.fillStyle = open_color__WEBPACK_IMPORTED_MODULE_1__.white;\n const transformHandles = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.getTransformHandles)(selectedElements[0], appState.zoom, elementsMap, \"mouse\", // when we render we don't know which pointer type so use mouse,\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.getOmitSidesForEditorInterface)(editorInterface));\n\n if (!appState.viewModeEnabled && showBoundingBox && // do not show transform handles when text is being edited\n !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isTextElement)(appState.editingTextElement) && // do not show transform handles when image is being cropped\n !appState.croppingElementId) {\n renderTransformHandles(context, renderConfig, appState, transformHandles, selectedElements[0].angle);\n }\n\n if (appState.croppingElementId && !appState.isCropping) {\n const croppingElement = elementsMap.get(appState.croppingElementId);\n\n if (croppingElement && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isImageElement)(croppingElement)) {\n renderCropHandles(context, renderConfig, appState, croppingElement, elementsMap);\n }\n }\n } else if (selectedElements.length > 1 && !appState.isRotating && !selectedElements.some(el => el.locked)) {\n const dashedLinePadding = _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_TRANSFORM_HANDLE_SPACING * 2 / appState.zoom.value;\n context.fillStyle = open_color__WEBPACK_IMPORTED_MODULE_1__.white;\n const [x1, y1, x2, y2] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.getCommonBounds)(selectedElements, elementsMap);\n const initialLineDash = context.getLineDash();\n context.setLineDash([2 / appState.zoom.value]);\n const lineWidth = context.lineWidth;\n context.lineWidth = 1 / appState.zoom.value;\n context.strokeStyle = selectionColor;\n (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.strokeRectWithRotation_simple)(context, x1 - dashedLinePadding, y1 - dashedLinePadding, x2 - x1 + dashedLinePadding * 2, y2 - y1 + dashedLinePadding * 2, (x1 + x2) / 2, (y1 + y2) / 2, 0);\n context.lineWidth = lineWidth;\n context.setLineDash(initialLineDash);\n const transformHandles = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.getTransformHandlesFromCoords)([x1, y1, x2, y2, (x1 + x2) / 2, (y1 + y2) / 2], 0, appState.zoom, \"mouse\", isFrameSelected ? Object.assign(Object.assign({}, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.getOmitSidesForEditorInterface)(editorInterface)), {\n rotation: true\n }) : (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.getOmitSidesForEditorInterface)(editorInterface));\n\n if (selectedElements.some(element => !element.locked)) {\n renderTransformHandles(context, renderConfig, appState, transformHandles, 0);\n }\n }\n\n context.restore();\n }\n\n (_e = appState.searchMatches) === null || _e === void 0 ? void 0 : _e.matches.forEach(({\n id,\n focus,\n matchedLines\n }) => {\n const element = elementsMap.get(id);\n\n if (element) {\n const [elementX1, elementY1,,, cx, cy] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.getElementAbsoluteCoords)(element, elementsMap, true);\n context.save();\n\n if (appState.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.THEME.LIGHT) {\n if (focus) {\n context.fillStyle = \"rgba(255, 124, 0, 0.4)\";\n } else {\n context.fillStyle = \"rgba(255, 226, 0, 0.4)\";\n }\n } else if (focus) {\n context.fillStyle = \"rgba(229, 82, 0, 0.4)\";\n } else {\n context.fillStyle = \"rgba(99, 52, 0, 0.4)\";\n }\n\n const zoomFactor = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.isFrameLikeElement)(element) ? appState.zoom.value : 1;\n context.translate(appState.scrollX, appState.scrollY);\n context.translate(cx, cy);\n context.rotate(element.angle);\n matchedLines.forEach(matchedLine => {\n (matchedLine.showOnCanvas || focus) && context.fillRect(elementX1 + matchedLine.offsetX / zoomFactor - cx, elementY1 + matchedLine.offsetY / zoomFactor - cy, matchedLine.width / zoomFactor, matchedLine.height / zoomFactor);\n });\n context.restore();\n }\n });\n (0,_renderer_renderSnaps__WEBPACK_IMPORTED_MODULE_4__.renderSnaps)(context, appState);\n context.restore();\n (0,_clients__WEBPACK_IMPORTED_MODULE_7__.renderRemoteCursors)({\n context,\n renderConfig,\n appState,\n normalizedWidth,\n normalizedHeight\n }); // Paint scrollbars\n\n let scrollBars;\n\n if (renderConfig.renderScrollbars) {\n scrollBars = (0,_scene_scrollbars__WEBPACK_IMPORTED_MODULE_6__.getScrollBars)(elementsMap, normalizedWidth, normalizedHeight, appState);\n context.save();\n context.fillStyle = _scene_scrollbars__WEBPACK_IMPORTED_MODULE_6__.SCROLLBAR_COLOR;\n context.strokeStyle = \"rgba(255,255,255,0.8)\";\n [scrollBars.horizontal, scrollBars.vertical].forEach(scrollBar => {\n if (scrollBar) {\n (0,_renderer_roundRect__WEBPACK_IMPORTED_MODULE_5__.roundRect)(context, scrollBar.x, scrollBar.y, scrollBar.width, scrollBar.height, _scene_scrollbars__WEBPACK_IMPORTED_MODULE_6__.SCROLLBAR_WIDTH / 2);\n }\n });\n context.restore();\n }\n\n return {\n scrollBars,\n atLeastOneVisibleElement: visibleElements.length > 0,\n elementsMap,\n animationState: nextAnimationState\n };\n};\n/**\r\n * Interactive scene is the ui-canvas where we render bounding boxes, selections\r\n * and other ui stuff.\r\n */\n\n\nconst renderInteractiveScene = renderConfig => {\n renderConfig.renderConfig.selectionColor = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.getHighlightColor)(renderConfig.appState.viewBackgroundColor, renderConfig.appState.viewBackgroundColor); //zsviczian\n\n const ret = _renderInteractiveScene(renderConfig);\n\n renderConfig.callback(ret);\n return ret;\n};\n\n//# sourceURL=webpack://ExcalidrawLib/./renderer/interactiveScene.ts?");
20761
20761
 
20762
20762
  /***/ }),
20763
20763