@zsviczian/excalidraw 0.18.0-50 → 0.18.0-52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/excalidraw.development.js +15 -15
- package/dist/excalidraw.production.min.js +1 -1
- package/dist/styles.development.css +11 -1
- package/dist/styles.production.css +2 -2
- package/package.json +1 -1
- package/types/common/src/editorInterface.d.ts +2 -2
- package/types/excalidraw/components/App.d.ts +1 -0
- package/types/excalidraw/components/FilledButton.d.ts +1 -1
- package/types/excalidraw/components/LinkButton.d.ts +4 -0
- package/types/excalidraw/components/icons.d.ts +4 -0
- package/types/excalidraw/hooks/useOutsideClick.d.ts +3 -1
- package/types/excalidraw/types.d.ts +1 -0
|
@@ -8363,7 +8363,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
8363
8363
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
8364
8364
|
|
|
8365
8365
|
"use strict";
|
|
8366
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n\n\nlet FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM, isTTY=true;\nif (typeof process !== 'undefined') {\n\t({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = ({\"MODE\":\"development\",\"VITE_APP_BACKEND_V2_GET_URL\":\"https://json-dev.excalidraw.com/api/v2/\",\"VITE_APP_BACKEND_V2_POST_URL\":\"https://json-dev.excalidraw.com/api/v2/post/\",\"VITE_APP_LIBRARY_URL\":\"https://libraries.excalidraw.com\",\"VITE_APP_LIBRARY_BACKEND\":\"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries\",\"VITE_APP_WS_SERVER_URL\":\"http://localhost:3002\",\"VITE_APP_PLUS_LP\":\"https://plus.excalidraw.com\",\"VITE_APP_PLUS_APP\":\"http://localhost:3000\",\"VITE_APP_AI_BACKEND\":\"http://localhost:3015\",\"VITE_APP_FIREBASE_CONFIG\":\"{\\\"apiKey\\\":\\\"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8\\\",\\\"authDomain\\\":\\\"excalidraw-oss-dev.firebaseapp.com\\\",\\\"projectId\\\":\\\"excalidraw-oss-dev\\\",\\\"storageBucket\\\":\\\"excalidraw-oss-dev.appspot.com\\\",\\\"messagingSenderId\\\":\\\"664559512677\\\",\\\"appId\\\":\\\"1:664559512677:web:a385181f2928d328a7aa8c\\\"}\",\"VITE_APP_DEV_DISABLE_LIVE_RELOAD\":\"\",\"VITE_APP_ENABLE_TRACKING\":\"true\",\"FAST_REFRESH\":\"false\",\"VITE_APP_PORT\":\"3000\",\"VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX\":\"\",\"VITE_APP_COLLAPSE_OVERLAY\":\"true\",\"VITE_APP_ENABLE_ESLINT\":\"true\",\"VITE_APP_ENABLE_PWA\":\"false\",\"VITE_APP_PLUS_EXPORT_PUBLIC_KEY\":\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\\nHQIDAQAB\",\"VITE_APP_DISABLE_PREVENT_UNLOAD\":\"\",\"VITE_PKG_NAME\":\"@zsviczian/excalidraw\",\"VITE_PKG_VERSION\":\"0.18.0-
|
|
8366
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n\n\nlet FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM, isTTY=true;\nif (typeof process !== 'undefined') {\n\t({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = ({\"MODE\":\"development\",\"VITE_APP_BACKEND_V2_GET_URL\":\"https://json-dev.excalidraw.com/api/v2/\",\"VITE_APP_BACKEND_V2_POST_URL\":\"https://json-dev.excalidraw.com/api/v2/post/\",\"VITE_APP_LIBRARY_URL\":\"https://libraries.excalidraw.com\",\"VITE_APP_LIBRARY_BACKEND\":\"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries\",\"VITE_APP_WS_SERVER_URL\":\"http://localhost:3002\",\"VITE_APP_PLUS_LP\":\"https://plus.excalidraw.com\",\"VITE_APP_PLUS_APP\":\"http://localhost:3000\",\"VITE_APP_AI_BACKEND\":\"http://localhost:3015\",\"VITE_APP_FIREBASE_CONFIG\":\"{\\\"apiKey\\\":\\\"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8\\\",\\\"authDomain\\\":\\\"excalidraw-oss-dev.firebaseapp.com\\\",\\\"projectId\\\":\\\"excalidraw-oss-dev\\\",\\\"storageBucket\\\":\\\"excalidraw-oss-dev.appspot.com\\\",\\\"messagingSenderId\\\":\\\"664559512677\\\",\\\"appId\\\":\\\"1:664559512677:web:a385181f2928d328a7aa8c\\\"}\",\"VITE_APP_DEV_DISABLE_LIVE_RELOAD\":\"\",\"VITE_APP_ENABLE_TRACKING\":\"true\",\"FAST_REFRESH\":\"false\",\"VITE_APP_PORT\":\"3000\",\"VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX\":\"\",\"VITE_APP_COLLAPSE_OVERLAY\":\"true\",\"VITE_APP_ENABLE_ESLINT\":\"true\",\"VITE_APP_ENABLE_PWA\":\"false\",\"VITE_APP_PLUS_EXPORT_PUBLIC_KEY\":\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\\nHQIDAQAB\",\"VITE_APP_DISABLE_PREVENT_UNLOAD\":\"\",\"VITE_PKG_NAME\":\"@zsviczian/excalidraw\",\"VITE_PKG_VERSION\":\"0.18.0-51\",\"VITE_IS_EXCALIDRAW_NPM_PACKAGE\":true}) || 0);\n\tisTTY = process.stdout && process.stdout.isTTY;\n}\n\nconst $ = {\n\tenabled: !NODE_DISABLE_COLORS && NO_COLOR == null && TERM !== 'dumb' && (\n\t\tFORCE_COLOR != null && FORCE_COLOR !== '0' || isTTY\n\t),\n\n\t// modifiers\n\treset: init(0, 0),\n\tbold: init(1, 22),\n\tdim: init(2, 22),\n\titalic: init(3, 23),\n\tunderline: init(4, 24),\n\tinverse: init(7, 27),\n\thidden: init(8, 28),\n\tstrikethrough: init(9, 29),\n\n\t// colors\n\tblack: init(30, 39),\n\tred: init(31, 39),\n\tgreen: init(32, 39),\n\tyellow: init(33, 39),\n\tblue: init(34, 39),\n\tmagenta: init(35, 39),\n\tcyan: init(36, 39),\n\twhite: init(37, 39),\n\tgray: init(90, 39),\n\tgrey: init(90, 39),\n\n\t// background colors\n\tbgBlack: init(40, 49),\n\tbgRed: init(41, 49),\n\tbgGreen: init(42, 49),\n\tbgYellow: init(43, 49),\n\tbgBlue: init(44, 49),\n\tbgMagenta: init(45, 49),\n\tbgCyan: init(46, 49),\n\tbgWhite: init(47, 49)\n};\n\nfunction run(arr, str) {\n\tlet i=0, tmp, beg='', end='';\n\tfor (; i < arr.length; i++) {\n\t\ttmp = arr[i];\n\t\tbeg += tmp.open;\n\t\tend += tmp.close;\n\t\tif (!!~str.indexOf(tmp.close)) {\n\t\t\tstr = str.replace(tmp.rgx, tmp.close + tmp.open);\n\t\t}\n\t}\n\treturn beg + str + end;\n}\n\nfunction chain(has, keys) {\n\tlet ctx = { has, keys };\n\n\tctx.reset = $.reset.bind(ctx);\n\tctx.bold = $.bold.bind(ctx);\n\tctx.dim = $.dim.bind(ctx);\n\tctx.italic = $.italic.bind(ctx);\n\tctx.underline = $.underline.bind(ctx);\n\tctx.inverse = $.inverse.bind(ctx);\n\tctx.hidden = $.hidden.bind(ctx);\n\tctx.strikethrough = $.strikethrough.bind(ctx);\n\n\tctx.black = $.black.bind(ctx);\n\tctx.red = $.red.bind(ctx);\n\tctx.green = $.green.bind(ctx);\n\tctx.yellow = $.yellow.bind(ctx);\n\tctx.blue = $.blue.bind(ctx);\n\tctx.magenta = $.magenta.bind(ctx);\n\tctx.cyan = $.cyan.bind(ctx);\n\tctx.white = $.white.bind(ctx);\n\tctx.gray = $.gray.bind(ctx);\n\tctx.grey = $.grey.bind(ctx);\n\n\tctx.bgBlack = $.bgBlack.bind(ctx);\n\tctx.bgRed = $.bgRed.bind(ctx);\n\tctx.bgGreen = $.bgGreen.bind(ctx);\n\tctx.bgYellow = $.bgYellow.bind(ctx);\n\tctx.bgBlue = $.bgBlue.bind(ctx);\n\tctx.bgMagenta = $.bgMagenta.bind(ctx);\n\tctx.bgCyan = $.bgCyan.bind(ctx);\n\tctx.bgWhite = $.bgWhite.bind(ctx);\n\n\treturn ctx;\n}\n\nfunction init(open, close) {\n\tlet blk = {\n\t\topen: `\\x1b[${open}m`,\n\t\tclose: `\\x1b[${close}m`,\n\t\trgx: new RegExp(`\\\\x1b\\\\[${close}m`, 'g')\n\t};\n\treturn function (txt) {\n\t\tif (this !== void 0 && this.has !== void 0) {\n\t\t\t!!~this.has.indexOf(open) || (this.has.push(open),this.keys.push(blk));\n\t\t\treturn txt === void 0 ? this : $.enabled ? run(this.keys, txt+'') : txt+'';\n\t\t}\n\t\treturn txt === void 0 ? chain([open], [blk]) : $.enabled ? run([blk], txt+'') : txt+'';\n\t};\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ($);\n\n\n//# sourceURL=webpack://ExcalidrawLib/../../node_modules/kleur/index.mjs?");
|
|
8367
8367
|
|
|
8368
8368
|
/***/ }),
|
|
8369
8369
|
|
|
@@ -11978,7 +11978,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
11978
11978
|
\**********************************************************************/
|
|
11979
11979
|
/***/ ((module, exports, __webpack_require__) => {
|
|
11980
11980
|
|
|
11981
|
-
eval("/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\tlet m;\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\t// eslint-disable-next-line no-return-assign\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)) && parseInt(m[1], 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = ({\"MODE\":\"development\",\"VITE_APP_BACKEND_V2_GET_URL\":\"https://json-dev.excalidraw.com/api/v2/\",\"VITE_APP_BACKEND_V2_POST_URL\":\"https://json-dev.excalidraw.com/api/v2/post/\",\"VITE_APP_LIBRARY_URL\":\"https://libraries.excalidraw.com\",\"VITE_APP_LIBRARY_BACKEND\":\"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries\",\"VITE_APP_WS_SERVER_URL\":\"http://localhost:3002\",\"VITE_APP_PLUS_LP\":\"https://plus.excalidraw.com\",\"VITE_APP_PLUS_APP\":\"http://localhost:3000\",\"VITE_APP_AI_BACKEND\":\"http://localhost:3015\",\"VITE_APP_FIREBASE_CONFIG\":\"{\\\"apiKey\\\":\\\"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8\\\",\\\"authDomain\\\":\\\"excalidraw-oss-dev.firebaseapp.com\\\",\\\"projectId\\\":\\\"excalidraw-oss-dev\\\",\\\"storageBucket\\\":\\\"excalidraw-oss-dev.appspot.com\\\",\\\"messagingSenderId\\\":\\\"664559512677\\\",\\\"appId\\\":\\\"1:664559512677:web:a385181f2928d328a7aa8c\\\"}\",\"VITE_APP_DEV_DISABLE_LIVE_RELOAD\":\"\",\"VITE_APP_ENABLE_TRACKING\":\"true\",\"FAST_REFRESH\":\"false\",\"VITE_APP_PORT\":\"3000\",\"VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX\":\"\",\"VITE_APP_COLLAPSE_OVERLAY\":\"true\",\"VITE_APP_ENABLE_ESLINT\":\"true\",\"VITE_APP_ENABLE_PWA\":\"false\",\"VITE_APP_PLUS_EXPORT_PUBLIC_KEY\":\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\\nHQIDAQAB\",\"VITE_APP_DISABLE_PREVENT_UNLOAD\":\"\",\"VITE_PKG_NAME\":\"@zsviczian/excalidraw\",\"VITE_PKG_VERSION\":\"0.18.0-
|
|
11981
|
+
eval("/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\tlet m;\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\t// eslint-disable-next-line no-return-assign\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)) && parseInt(m[1], 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = ({\"MODE\":\"development\",\"VITE_APP_BACKEND_V2_GET_URL\":\"https://json-dev.excalidraw.com/api/v2/\",\"VITE_APP_BACKEND_V2_POST_URL\":\"https://json-dev.excalidraw.com/api/v2/post/\",\"VITE_APP_LIBRARY_URL\":\"https://libraries.excalidraw.com\",\"VITE_APP_LIBRARY_BACKEND\":\"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries\",\"VITE_APP_WS_SERVER_URL\":\"http://localhost:3002\",\"VITE_APP_PLUS_LP\":\"https://plus.excalidraw.com\",\"VITE_APP_PLUS_APP\":\"http://localhost:3000\",\"VITE_APP_AI_BACKEND\":\"http://localhost:3015\",\"VITE_APP_FIREBASE_CONFIG\":\"{\\\"apiKey\\\":\\\"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8\\\",\\\"authDomain\\\":\\\"excalidraw-oss-dev.firebaseapp.com\\\",\\\"projectId\\\":\\\"excalidraw-oss-dev\\\",\\\"storageBucket\\\":\\\"excalidraw-oss-dev.appspot.com\\\",\\\"messagingSenderId\\\":\\\"664559512677\\\",\\\"appId\\\":\\\"1:664559512677:web:a385181f2928d328a7aa8c\\\"}\",\"VITE_APP_DEV_DISABLE_LIVE_RELOAD\":\"\",\"VITE_APP_ENABLE_TRACKING\":\"true\",\"FAST_REFRESH\":\"false\",\"VITE_APP_PORT\":\"3000\",\"VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX\":\"\",\"VITE_APP_COLLAPSE_OVERLAY\":\"true\",\"VITE_APP_ENABLE_ESLINT\":\"true\",\"VITE_APP_ENABLE_PWA\":\"false\",\"VITE_APP_PLUS_EXPORT_PUBLIC_KEY\":\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\\nHQIDAQAB\",\"VITE_APP_DISABLE_PREVENT_UNLOAD\":\"\",\"VITE_PKG_NAME\":\"@zsviczian/excalidraw\",\"VITE_PKG_VERSION\":\"0.18.0-51\",\"VITE_IS_EXCALIDRAW_NPM_PACKAGE\":true}).DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = __webpack_require__(/*! ./common */ \"../../node_modules/micromark/node_modules/debug/src/common.js\")(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n\n\n//# sourceURL=webpack://ExcalidrawLib/../../node_modules/micromark/node_modules/debug/src/browser.js?");
|
|
11982
11982
|
|
|
11983
11983
|
/***/ }),
|
|
11984
11984
|
|
|
@@ -12981,7 +12981,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
12981
12981
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
12982
12982
|
|
|
12983
12983
|
"use strict";
|
|
12984
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ MQ_MAX_HEIGHT_LANDSCAPE: () => (/* binding */ MQ_MAX_HEIGHT_LANDSCAPE),\n/* harmony export */ MQ_MAX_MOBILE: () => (/* binding */ MQ_MAX_MOBILE),\n/* harmony export */ MQ_MAX_TABLET: () => (/* binding */ MQ_MAX_TABLET),\n/* harmony export */ MQ_MAX_WIDTH_LANDSCAPE: () => (/* binding */ MQ_MAX_WIDTH_LANDSCAPE),\n/* harmony export */ MQ_MIN_TABLET: () => (/* binding */ MQ_MIN_TABLET),\n/* harmony export */ MQ_MIN_WIDTH_DESKTOP: () => (/* binding */ MQ_MIN_WIDTH_DESKTOP),\n/* harmony export */ MQ_RIGHT_SIDEBAR_MIN_WIDTH: () => (/* binding */ MQ_RIGHT_SIDEBAR_MIN_WIDTH),\n/* harmony export */ createUserAgentDescriptor: () => (/* binding */ createUserAgentDescriptor),\n/* harmony export */ deriveStylesPanelMode: () => (/* binding */ deriveStylesPanelMode),\n/* harmony export */ getFormFactor: () => (/* binding */ getFormFactor),\n/* harmony export */ isAndroid: () => (/* binding */ isAndroid),\n/* harmony export */ isBrave: () => (/* binding */ isBrave),\n/* harmony export */ isChrome: () => (/* binding */ isChrome),\n/* harmony export */ isDarwin: () => (/* binding */ isDarwin),\n/* harmony export */ isFirefox: () => (/* binding */ isFirefox),\n/* harmony export */ isIOS: () => (/* binding */ isIOS),\n/* harmony export */ isMobileBreakpoint: () => (/* binding */ isMobileBreakpoint),\n/* harmony export */ isSafari: () => (/* binding */ isSafari),\n/* harmony export */ isTabletBreakpoint: () => (/* binding */ isTabletBreakpoint),\n/* harmony export */ isWindows: () => (/* binding */ isWindows),\n/* harmony export */ loadDesktopUIModePreference: () => (/* binding */ loadDesktopUIModePreference),\n/* harmony export */ setDesktopUIMode: () => (/* binding */ setDesktopUIMode)\n/* harmony export */ });\n/* harmony import */ var _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./commonObsidianUtils */ \"../common/src/commonObsidianUtils.ts\");\n // storage key\n\nconst DESKTOP_UI_MODE_STORAGE_KEY = \"excalidraw.desktopUIMode\"; // breakpoints\n// mobile: up to 699px\n\nconst MQ_MAX_MOBILE = 599;\nconst MQ_MAX_WIDTH_LANDSCAPE = 1000;\nconst MQ_MAX_HEIGHT_LANDSCAPE = 500; // tablets\n\nconst MQ_MIN_TABLET = MQ_MAX_MOBILE + 1; // lower bound (excludes phones)\n\nconst MQ_MAX_TABLET = 1400; // upper bound (excludes laptops/desktops)\n// desktop/laptop\n\nconst MQ_MIN_WIDTH_DESKTOP = 1440; // sidebar\n\nconst MQ_RIGHT_SIDEBAR_MIN_WIDTH = 800; //zsviczian was 1229;\n// -----------------------------------------------------------------------------\n// user agent detections\n\nconst isDarwin = /Mac|iPod|iPhone|iPad/.test(navigator.platform);\nconst isWindows = /^Win/.test(navigator.platform);\nconst isAndroid = /\\b(android)\\b/i.test(navigator.userAgent);\nconst isFirefox = typeof window !== \"undefined\" && \"netscape\" in window && navigator.userAgent.indexOf(\"rv:\") > 1 && navigator.userAgent.indexOf(\"Gecko\") > 1;\nconst isChrome = navigator.userAgent.indexOf(\"Chrome\") !== -1;\nconst isSafari = !isChrome && navigator.userAgent.indexOf(\"Safari\") !== -1;\nconst isIOS = /iPad|iPhone/i.test(navigator.platform) || // iPadOS 13+\nnavigator.userAgent.includes(\"Mac\") && \"ontouchend\" in document; // keeping function so it can be mocked in test\n\nconst isBrave = () => {\n var _a, _b;\n\n return ((_b = (_a = navigator.brave) === null || _a === void 0 ? void 0 : _a.isBrave) === null || _b === void 0 ? void 0 : _b.name) === \"isBrave\";\n}; // export const isMobile =\n// isIOS ||\n// /android|webos|ipod|blackberry|iemobile|opera mini/i.test(\n// navigator.userAgent,\n// ) ||\n// /android|ios|ipod|blackberry|windows phone/i.test(navigator.platform);\n// utilities\n\nconst isMobileBreakpoint = (width, height) => {\n return width !== 0 && ( //zsviczian changing tabs in Obsidian causes MobileMenu to be rendered\n width <= MQ_MAX_MOBILE || height < MQ_MAX_HEIGHT_LANDSCAPE && width < MQ_MAX_WIDTH_LANDSCAPE);\n};\nconst isTabletBreakpoint = (editorWidth, editorHeight) => {\n var _a;\n\n if ((_a = (0,_commonObsidianUtils__WEBPACK_IMPORTED_MODULE_0__.getObsidianDeviceInfo)()) === null || _a === void 0 ? void 0 : _a.isDesktop) {\n //zsviczian\n if ((0,_commonObsidianUtils__WEBPACK_IMPORTED_MODULE_0__.getDesktopUIMode)() === \"compact\") {\n return true;\n }\n\n return false;\n }\n\n const minSide = Math.min(editorWidth, editorHeight);\n const maxSide = Math.max(editorWidth, editorHeight);\n return editorWidth !== 0 && //zsviczian changing tabs in Obsidian causes MobileMenu to be rendered\n minSide >= MQ_MIN_TABLET && maxSide <= MQ_MAX_TABLET;\n};\n\nconst isMobileOrTablet = () => {\n //zsviczian\n const device = (0,_commonObsidianUtils__WEBPACK_IMPORTED_MODULE_0__.getObsidianDeviceInfo)();\n\n if (device) {\n return device.isMobile || device.isTablet;\n }\n\n const ua = navigator.userAgent || \"\";\n const platform = navigator.platform || \"\";\n const uaData = navigator.userAgentData; // --- 1) chromium: prefer ua client hints -------------------------------\n\n if (uaData) {\n const plat = (uaData.platform || \"\").toLowerCase();\n const isDesktopOS = plat === \"windows\" || plat === \"macos\" || plat === \"linux\" || plat === \"chrome os\";\n\n if (uaData.mobile === true) {\n return true;\n }\n\n if (uaData.mobile === false && plat === \"android\") {\n const looksTouchTablet = (matchMedia === null || matchMedia === void 0 ? void 0 : matchMedia(\"(hover: none)\").matches) && (matchMedia === null || matchMedia === void 0 ? void 0 : matchMedia(\"(pointer: coarse)\").matches);\n return looksTouchTablet;\n }\n\n if (isDesktopOS) {\n return false;\n }\n } // --- 2) ios (includes ipad) --------------------------------------------\n\n\n if (isIOS) {\n return true;\n } // --- 3) android legacy ua fallback -------------------------------------\n\n\n if (isAndroid) {\n const isAndroidPhone = /Mobile/i.test(ua);\n const isAndroidTablet = !isAndroidPhone;\n\n if (isAndroidPhone || isAndroidTablet) {\n const looksTouchTablet = (matchMedia === null || matchMedia === void 0 ? void 0 : matchMedia(\"(hover: none)\").matches) && (matchMedia === null || matchMedia === void 0 ? void 0 : matchMedia(\"(pointer: coarse)\").matches);\n return looksTouchTablet;\n }\n } // --- 4) last resort desktop exclusion ----------------------------------\n\n\n const looksDesktopPlatform = /Win|Linux|CrOS|Mac/.test(platform) || /Windows NT|X11|CrOS|Macintosh/.test(ua);\n\n if (looksDesktopPlatform) {\n return false;\n }\n\n return false;\n};\n\nconst getFormFactor = (editorWidth, editorHeight) => {\n if (isMobileBreakpoint(editorWidth, editorHeight)) {\n return \"phone\";\n }\n\n if (isTabletBreakpoint(editorWidth, editorHeight)) {\n return \"tablet\";\n }\n\n return \"desktop\";\n};\nconst deriveStylesPanelMode = editorInterface => {\n if (editorInterface.formFactor === \"phone\") {\n return \"mobile\";\n }\n\n if (editorInterface.formFactor === \"tablet\") {\n return editorInterface.preferTrayMode ? \"tray\" : \"compact\"; //zsviczian\n }\n\n return editorInterface.desktopUIMode;\n};\nconst createUserAgentDescriptor = userAgentString => {\n const normalizedUA = userAgentString !== null && userAgentString !== void 0 ? userAgentString : \"\";\n let platform = \"unknown\";\n\n if (isIOS) {\n platform = \"ios\";\n } else if (isAndroid) {\n platform = \"android\";\n } else if (normalizedUA) {\n platform = \"other\";\n }\n\n return {\n isMobileDevice: isMobileOrTablet(),\n platform\n };\n};\nconst loadDesktopUIModePreference = () => {\n return (0,_commonObsidianUtils__WEBPACK_IMPORTED_MODULE_0__.getDesktopUIMode)(); //zsviczian\n\n if (typeof window === \"undefined\") {\n return null;\n }\n\n try {\n const stored = window.localStorage.getItem(DESKTOP_UI_MODE_STORAGE_KEY);\n\n if (stored === \"compact\" || stored === \"full\" || stored === \"tray\") {\n //zsviczian\n return stored;\n }\n } catch (error) {// ignore storage access issues (e.g., Safari private mode)\n }\n\n return null;\n};\n\nconst persistDesktopUIMode = mode => {\n if (typeof window === \"undefined\") {\n return;\n }\n\n try {\n window.localStorage.setItem(DESKTOP_UI_MODE_STORAGE_KEY, mode);\n } catch (error) {// ignore storage access issues (e.g., Safari private mode)\n }\n};\n\nconst setDesktopUIMode = mode => {\n if (mode !== \"compact\" && mode !== \"full\" && mode !== \"tray\") {\n //zsviczian\n return;\n }\n\n persistDesktopUIMode(mode);\n return mode;\n};\n\n//# sourceURL=webpack://ExcalidrawLib/../common/src/editorInterface.ts?");
|
|
12984
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ MQ_MAX_HEIGHT_LANDSCAPE: () => (/* binding */ MQ_MAX_HEIGHT_LANDSCAPE),\n/* harmony export */ MQ_MAX_MOBILE: () => (/* binding */ MQ_MAX_MOBILE),\n/* harmony export */ MQ_MAX_TABLET: () => (/* binding */ MQ_MAX_TABLET),\n/* harmony export */ MQ_MAX_WIDTH_LANDSCAPE: () => (/* binding */ MQ_MAX_WIDTH_LANDSCAPE),\n/* harmony export */ MQ_MIN_TABLET: () => (/* binding */ MQ_MIN_TABLET),\n/* harmony export */ MQ_MIN_WIDTH_DESKTOP: () => (/* binding */ MQ_MIN_WIDTH_DESKTOP),\n/* harmony export */ MQ_RIGHT_SIDEBAR_MIN_WIDTH: () => (/* binding */ MQ_RIGHT_SIDEBAR_MIN_WIDTH),\n/* harmony export */ createUserAgentDescriptor: () => (/* binding */ createUserAgentDescriptor),\n/* harmony export */ deriveStylesPanelMode: () => (/* binding */ deriveStylesPanelMode),\n/* harmony export */ getFormFactor: () => (/* binding */ getFormFactor),\n/* harmony export */ isAndroid: () => (/* binding */ isAndroid),\n/* harmony export */ isBrave: () => (/* binding */ isBrave),\n/* harmony export */ isChrome: () => (/* binding */ isChrome),\n/* harmony export */ isDarwin: () => (/* binding */ isDarwin),\n/* harmony export */ isFirefox: () => (/* binding */ isFirefox),\n/* harmony export */ isIOS: () => (/* binding */ isIOS),\n/* harmony export */ isMobileBreakpoint: () => (/* binding */ isMobileBreakpoint),\n/* harmony export */ isSafari: () => (/* binding */ isSafari),\n/* harmony export */ isTabletBreakpoint: () => (/* binding */ isTabletBreakpoint),\n/* harmony export */ isWindows: () => (/* binding */ isWindows),\n/* harmony export */ loadDesktopUIModePreference: () => (/* binding */ loadDesktopUIModePreference),\n/* harmony export */ setDesktopUIMode: () => (/* binding */ setDesktopUIMode)\n/* harmony export */ });\n/* harmony import */ var _commonObsidianUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./commonObsidianUtils */ \"../common/src/commonObsidianUtils.ts\");\n // storage key\n\nconst DESKTOP_UI_MODE_STORAGE_KEY = \"excalidraw.desktopUIMode\"; // breakpoints\n// mobile: up to 699px\n\nconst MQ_MAX_MOBILE = 599;\nconst MQ_MAX_WIDTH_LANDSCAPE = 1000;\nconst MQ_MAX_HEIGHT_LANDSCAPE = 500; // tablets\n\nconst MQ_MIN_TABLET = MQ_MAX_MOBILE + 1; // lower bound (excludes phones)\n\nconst MQ_MAX_TABLET = 1400; // upper bound (excludes laptops/desktops)\n// desktop/laptop\n\nconst MQ_MIN_WIDTH_DESKTOP = 1440; // sidebar\n\nconst MQ_RIGHT_SIDEBAR_MIN_WIDTH = 800; //zsviczian was 1229;\n// -----------------------------------------------------------------------------\n// user agent detections\n\nconst isDarwin = /Mac|iPod|iPhone|iPad/.test(navigator.platform);\nconst isWindows = /^Win/.test(navigator.platform);\nconst isAndroid = /\\b(android)\\b/i.test(navigator.userAgent);\nconst isFirefox = typeof window !== \"undefined\" && \"netscape\" in window && navigator.userAgent.indexOf(\"rv:\") > 1 && navigator.userAgent.indexOf(\"Gecko\") > 1;\nconst isChrome = navigator.userAgent.indexOf(\"Chrome\") !== -1;\nconst isSafari = !isChrome && navigator.userAgent.indexOf(\"Safari\") !== -1;\nconst isIOS = /iPad|iPhone/i.test(navigator.platform) || // iPadOS 13+\nnavigator.userAgent.includes(\"Mac\") && \"ontouchend\" in document; // keeping function so it can be mocked in test\n\nconst isBrave = () => {\n var _a, _b;\n\n return ((_b = (_a = navigator.brave) === null || _a === void 0 ? void 0 : _a.isBrave) === null || _b === void 0 ? void 0 : _b.name) === \"isBrave\";\n}; // export const isMobile =\n// isIOS ||\n// /android|webos|ipod|blackberry|iemobile|opera mini/i.test(\n// navigator.userAgent,\n// ) ||\n// /android|ios|ipod|blackberry|windows phone/i.test(navigator.platform);\n// utilities\n\nconst isMobileBreakpoint = (width, height, allowMobile) => {\n return width !== 0 && allowMobile && ( //zsviczian changing tabs in Obsidian causes MobileMenu to be rendered\n width <= MQ_MAX_MOBILE || height < MQ_MAX_HEIGHT_LANDSCAPE && width < MQ_MAX_WIDTH_LANDSCAPE);\n};\nconst isTabletBreakpoint = (editorWidth, editorHeight) => {\n var _a;\n\n if ((_a = (0,_commonObsidianUtils__WEBPACK_IMPORTED_MODULE_0__.getObsidianDeviceInfo)()) === null || _a === void 0 ? void 0 : _a.isDesktop) {\n //zsviczian\n if ((0,_commonObsidianUtils__WEBPACK_IMPORTED_MODULE_0__.getDesktopUIMode)() === \"compact\") {\n return true;\n }\n\n return false;\n }\n\n const minSide = Math.min(editorWidth, editorHeight);\n const maxSide = Math.max(editorWidth, editorHeight);\n return editorWidth !== 0 && //zsviczian changing tabs in Obsidian causes MobileMenu to be rendered\n minSide >= MQ_MIN_TABLET && maxSide <= MQ_MAX_TABLET;\n};\n\nconst isMobileOrTablet = () => {\n //zsviczian\n const device = (0,_commonObsidianUtils__WEBPACK_IMPORTED_MODULE_0__.getObsidianDeviceInfo)();\n\n if (device) {\n return device.isMobile || device.isTablet;\n }\n\n const ua = navigator.userAgent || \"\";\n const platform = navigator.platform || \"\";\n const uaData = navigator.userAgentData; // --- 1) chromium: prefer ua client hints -------------------------------\n\n if (uaData) {\n const plat = (uaData.platform || \"\").toLowerCase();\n const isDesktopOS = plat === \"windows\" || plat === \"macos\" || plat === \"linux\" || plat === \"chrome os\";\n\n if (uaData.mobile === true) {\n return true;\n }\n\n if (uaData.mobile === false && plat === \"android\") {\n const looksTouchTablet = (matchMedia === null || matchMedia === void 0 ? void 0 : matchMedia(\"(hover: none)\").matches) && (matchMedia === null || matchMedia === void 0 ? void 0 : matchMedia(\"(pointer: coarse)\").matches);\n return looksTouchTablet;\n }\n\n if (isDesktopOS) {\n return false;\n }\n } // --- 2) ios (includes ipad) --------------------------------------------\n\n\n if (isIOS) {\n return true;\n } // --- 3) android legacy ua fallback -------------------------------------\n\n\n if (isAndroid) {\n const isAndroidPhone = /Mobile/i.test(ua);\n const isAndroidTablet = !isAndroidPhone;\n\n if (isAndroidPhone || isAndroidTablet) {\n const looksTouchTablet = (matchMedia === null || matchMedia === void 0 ? void 0 : matchMedia(\"(hover: none)\").matches) && (matchMedia === null || matchMedia === void 0 ? void 0 : matchMedia(\"(pointer: coarse)\").matches);\n return looksTouchTablet;\n }\n } // --- 4) last resort desktop exclusion ----------------------------------\n\n\n const looksDesktopPlatform = /Win|Linux|CrOS|Mac/.test(platform) || /Windows NT|X11|CrOS|Macintosh/.test(ua);\n\n if (looksDesktopPlatform) {\n return false;\n }\n\n return false;\n};\n\nconst getFormFactor = (editorWidth, editorHeight, allowMobile) => {\n if (isMobileBreakpoint(editorWidth, editorHeight, allowMobile)) {\n //zsviczian\n return \"phone\";\n }\n\n if (isTabletBreakpoint(editorWidth, editorHeight)) {\n return \"tablet\";\n }\n\n return \"desktop\";\n};\nconst deriveStylesPanelMode = editorInterface => {\n if (editorInterface.formFactor === \"phone\") {\n return \"mobile\";\n }\n\n if (editorInterface.formFactor === \"tablet\") {\n return editorInterface.preferTrayMode ? \"tray\" : \"compact\"; //zsviczian\n }\n\n return editorInterface.desktopUIMode;\n};\nconst createUserAgentDescriptor = userAgentString => {\n const normalizedUA = userAgentString !== null && userAgentString !== void 0 ? userAgentString : \"\";\n let platform = \"unknown\";\n\n if (isIOS) {\n platform = \"ios\";\n } else if (isAndroid) {\n platform = \"android\";\n } else if (normalizedUA) {\n platform = \"other\";\n }\n\n return {\n isMobileDevice: isMobileOrTablet(),\n platform\n };\n};\nconst loadDesktopUIModePreference = () => {\n return (0,_commonObsidianUtils__WEBPACK_IMPORTED_MODULE_0__.getDesktopUIMode)(); //zsviczian\n\n if (typeof window === \"undefined\") {\n return null;\n }\n\n try {\n const stored = window.localStorage.getItem(DESKTOP_UI_MODE_STORAGE_KEY);\n\n if (stored === \"compact\" || stored === \"full\" || stored === \"tray\") {\n //zsviczian\n return stored;\n }\n } catch (error) {// ignore storage access issues (e.g., Safari private mode)\n }\n\n return null;\n};\n\nconst persistDesktopUIMode = mode => {\n if (typeof window === \"undefined\") {\n return;\n }\n\n try {\n window.localStorage.setItem(DESKTOP_UI_MODE_STORAGE_KEY, mode);\n } catch (error) {// ignore storage access issues (e.g., Safari private mode)\n }\n};\n\nconst setDesktopUIMode = mode => {\n if (mode !== \"compact\" && mode !== \"full\" && mode !== \"tray\") {\n //zsviczian\n return;\n }\n\n persistDesktopUIMode(mode);\n return mode;\n};\n\n//# sourceURL=webpack://ExcalidrawLib/../common/src/editorInterface.ts?");
|
|
12985
12985
|
|
|
12986
12986
|
/***/ }),
|
|
12987
12987
|
|
|
@@ -13091,7 +13091,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
13091
13091
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
13092
13092
|
|
|
13093
13093
|
"use strict";
|
|
13094
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ addEventListener: () => (/* binding */ addEventListener),\n/* harmony export */ allowFullScreen: () => (/* binding */ allowFullScreen),\n/* harmony export */ arrayToList: () => (/* binding */ arrayToList),\n/* harmony export */ arrayToMap: () => (/* binding */ arrayToMap),\n/* harmony export */ arrayToMapWithIndex: () => (/* binding */ arrayToMapWithIndex),\n/* harmony export */ arrayToObject: () => (/* binding */ arrayToObject),\n/* harmony export */ assertNever: () => (/* binding */ assertNever),\n/* harmony export */ bytesToHexString: () => (/* binding */ bytesToHexString),\n/* harmony export */ capitalizeString: () => (/* binding */ capitalizeString),\n/* harmony export */ castArray: () => (/* binding */ castArray),\n/* harmony export */ chunk: () => (/* binding */ chunk),\n/* harmony export */ cloneJSON: () => (/* binding */ cloneJSON),\n/* harmony export */ composeEventHandlers: () => (/* binding */ composeEventHandlers),\n/* harmony export */ debounce: () => (/* binding */ debounce),\n/* harmony export */ distance: () => (/* binding */ distance),\n/* harmony export */ easeOut: () => (/* binding */ easeOut),\n/* harmony export */ easeToValuesRAF: () => (/* binding */ easeToValuesRAF),\n/* harmony export */ escapeDoubleQuotes: () => (/* binding */ escapeDoubleQuotes),\n/* harmony export */ exitFullScreen: () => (/* binding */ exitFullScreen),\n/* harmony export */ findIndex: () => (/* binding */ findIndex),\n/* harmony export */ findLastIndex: () => (/* binding */ findLastIndex),\n/* harmony export */ focusNearestParent: () => (/* binding */ focusNearestParent),\n/* harmony export */ getDateTime: () => (/* binding */ getDateTime),\n/* harmony export */ getFontFamilyString: () => (/* binding */ getFontFamilyString),\n/* harmony export */ getFontString: () => (/* binding */ getFontString),\n/* harmony export */ getFrame: () => (/* binding */ getFrame),\n/* harmony export */ getGlobalCSSVariable: () => (/* binding */ getGlobalCSSVariable),\n/* harmony export */ getNearestScrollableContainer: () => (/* binding */ getNearestScrollableContainer),\n/* harmony export */ getSvgPathFromStroke: () => (/* binding */ getSvgPathFromStroke),\n/* harmony export */ getUpdatedTimestamp: () => (/* binding */ getUpdatedTimestamp),\n/* harmony export */ getVersion: () => (/* binding */ getVersion),\n/* harmony export */ invariant: () => (/* binding */ invariant),\n/* harmony export */ isAnyTrue: () => (/* binding */ isAnyTrue),\n/* harmony export */ isBindingFallthroughEnabled: () => (/* binding */ isBindingFallthroughEnabled),\n/* harmony export */ isDevEnv: () => (/* binding */ isDevEnv),\n/* harmony export */ isFullScreen: () => (/* binding */ isFullScreen),\n/* harmony export */ isInputLike: () => (/* binding */ isInputLike),\n/* harmony export */ isInteractive: () => (/* binding */ isInteractive),\n/* harmony export */ isMemberOf: () => (/* binding */ isMemberOf),\n/* harmony export */ isPrimitive: () => (/* binding */ isPrimitive),\n/* harmony export */ isProdEnv: () => (/* binding */ isProdEnv),\n/* harmony export */ isPromiseLike: () => (/* binding */ isPromiseLike),\n/* harmony export */ isRTL: () => (/* binding */ isRTL),\n/* harmony export */ isReadonlyArray: () => (/* binding */ isReadonlyArray),\n/* harmony export */ isRunningInIframe: () => (/* binding */ isRunningInIframe),\n/* harmony export */ isServerEnv: () => (/* binding */ isServerEnv),\n/* harmony export */ isShallowEqual: () => (/* binding */ isShallowEqual),\n/* harmony export */ isTestEnv: () => (/* binding */ isTestEnv),\n/* harmony export */ isToolIcon: () => (/* binding */ isToolIcon),\n/* harmony export */ isTransparent: () => (/* binding */ isTransparent),\n/* harmony export */ isWritableElement: () => (/* binding */ isWritableElement),\n/* harmony export */ mapFind: () => (/* binding */ mapFind),\n/* harmony export */ memoize: () => (/* binding */ memoize),\n/* harmony export */ muteFSAbortError: () => (/* binding */ muteFSAbortError),\n/* harmony export */ nFormatter: () => (/* binding */ nFormatter),\n/* harmony export */ nextAnimationFrame: () => (/* binding */ nextAnimationFrame),\n/* harmony export */ normalizeEOL: () => (/* binding */ normalizeEOL),\n/* harmony export */ preventUnload: () => (/* binding */ preventUnload),\n/* harmony export */ promiseTry: () => (/* binding */ promiseTry),\n/* harmony export */ queryFocusableElements: () => (/* binding */ queryFocusableElements),\n/* harmony export */ reduceToCommonValue: () => (/* binding */ reduceToCommonValue),\n/* harmony export */ removeSelection: () => (/* binding */ removeSelection),\n/* harmony export */ resolvablePromise: () => (/* binding */ resolvablePromise),\n/* harmony export */ safelyParseJSON: () => (/* binding */ safelyParseJSON),\n/* harmony export */ sceneCoordsToViewportCoords: () => (/* binding */ sceneCoordsToViewportCoords),\n/* harmony export */ selectNode: () => (/* binding */ selectNode),\n/* harmony export */ setDateTimeForTests: () => (/* binding */ setDateTimeForTests),\n/* harmony export */ sizeOf: () => (/* binding */ sizeOf),\n/* harmony export */ supportsEmoji: () => (/* binding */ supportsEmoji),\n/* harmony export */ throttleRAF: () => (/* binding */ throttleRAF),\n/* harmony export */ toArray: () => (/* binding */ toArray),\n/* harmony export */ toBrandedType: () => (/* binding */ toBrandedType),\n/* harmony export */ toIterable: () => (/* binding */ toIterable),\n/* harmony export */ tupleToCoors: () => (/* binding */ tupleToCoors),\n/* harmony export */ updateActiveTool: () => (/* binding */ updateActiveTool),\n/* harmony export */ updateObject: () => (/* binding */ updateObject),\n/* harmony export */ updateStable: () => (/* binding */ updateStable),\n/* harmony export */ viewportCoordsToSceneCoords: () => (/* binding */ viewportCoordsToSceneCoords),\n/* harmony export */ wrapEvent: () => (/* binding */ wrapEvent)\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 _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\n\n\nlet mockDateTime = null;\nconst setDateTimeForTests = dateTime => {\n mockDateTime = dateTime;\n};\nconst getDateTime = () => {\n if (mockDateTime) {\n return mockDateTime;\n }\n\n const date = new Date();\n const year = date.getFullYear();\n const month = `${date.getMonth() + 1}`.padStart(2, \"0\");\n const day = `${date.getDate()}`.padStart(2, \"0\");\n const hr = `${date.getHours()}`.padStart(2, \"0\");\n const min = `${date.getMinutes()}`.padStart(2, \"0\");\n return `${year}-${month}-${day}-${hr}${min}`;\n};\nconst capitalizeString = str => str.charAt(0).toUpperCase() + str.slice(1);\nconst isToolIcon = target => target instanceof HTMLElement && target.className.includes(\"ToolIcon\");\nconst isInputLike = target => target instanceof HTMLElement && target.dataset.type === \"wysiwyg\" || target instanceof HTMLBRElement || // newline in wysiwyg\ntarget instanceof HTMLInputElement || target instanceof HTMLTextAreaElement || target instanceof HTMLSelectElement;\nconst isInteractive = target => {\n return isInputLike(target) || target instanceof Element && !!target.closest(\"label, button\");\n};\nconst isWritableElement = target => target instanceof HTMLElement && target.dataset.type === \"wysiwyg\" || target instanceof HTMLBRElement || // newline in wysiwyg\ntarget instanceof HTMLTextAreaElement || target instanceof HTMLInputElement && (target.type === \"text\" || target.type === \"number\" || target.type === \"password\" || target.type === \"search\");\nconst getFontFamilyString = ({\n fontFamily\n}) => {\n for (const [fontFamilyString, id] of Object.entries(_constants__WEBPACK_IMPORTED_MODULE_2__.FONT_FAMILY)) {\n if (id === fontFamily) {\n return `${fontFamilyString}${(0,_constants__WEBPACK_IMPORTED_MODULE_2__.getFontFamilyFallbacks)(id).map(x => `, ${x}`).join(\"\")}`;\n }\n }\n\n return _constants__WEBPACK_IMPORTED_MODULE_2__.WINDOWS_EMOJI_FALLBACK_FONT;\n};\n/** returns fontSize+fontFamily string for assignment to DOM elements */\n\nconst getFontString = ({\n fontSize,\n fontFamily\n}) => {\n return `${fontSize}px ${getFontFamilyString({\n fontFamily\n })}`;\n};\n/** executes callback in the frame that's after the current one */\n\nconst nextAnimationFrame = async cb => {\n requestAnimationFrame(() => requestAnimationFrame(cb));\n};\nconst debounce = (fn, timeout) => {\n let handle = 0;\n let lastArgs = null;\n\n const ret = (...args) => {\n lastArgs = args;\n clearTimeout(handle);\n handle = window.setTimeout(() => {\n lastArgs = null;\n fn(...args);\n }, timeout);\n };\n\n ret.flush = () => {\n clearTimeout(handle);\n\n if (lastArgs) {\n const _lastArgs = lastArgs;\n lastArgs = null;\n fn(..._lastArgs);\n }\n };\n\n ret.cancel = () => {\n lastArgs = null;\n clearTimeout(handle);\n };\n\n return ret;\n}; // throttle callback to execute once per animation frame\n\nconst throttleRAF = (fn, opts) => {\n let timerId = null;\n let lastArgs = null;\n let lastArgsTrailing = null;\n\n const scheduleFunc = args => {\n timerId = window.requestAnimationFrame(() => {\n timerId = null;\n fn(...args);\n lastArgs = null;\n\n if (lastArgsTrailing) {\n lastArgs = lastArgsTrailing;\n lastArgsTrailing = null;\n scheduleFunc(lastArgs);\n }\n });\n };\n\n const ret = (...args) => {\n if (isTestEnv()) {\n fn(...args);\n return;\n }\n\n lastArgs = args;\n\n if (timerId === null) {\n scheduleFunc(lastArgs);\n } else if (opts === null || opts === void 0 ? void 0 : opts.trailing) {\n lastArgsTrailing = args;\n }\n };\n\n ret.flush = () => {\n if (timerId !== null) {\n cancelAnimationFrame(timerId);\n timerId = null;\n }\n\n if (lastArgs) {\n fn(...(lastArgsTrailing || lastArgs));\n lastArgs = lastArgsTrailing = null;\n }\n };\n\n ret.cancel = () => {\n lastArgs = lastArgsTrailing = null;\n\n if (timerId !== null) {\n cancelAnimationFrame(timerId);\n timerId = null;\n }\n };\n\n return ret;\n};\n/**\r\n * Exponential ease-out method\r\n *\r\n * @param {number} k - The value to be tweened.\r\n * @returns {number} The tweened value.\r\n */\n\nconst easeOut = k => {\n return 1 - Math.pow(1 - k, 4);\n};\n\nconst easeOutInterpolate = (from, to, progress) => {\n return (to - from) * easeOut(progress) + from;\n};\n/**\r\n * Animates values from `fromValues` to `toValues` using the requestAnimationFrame API.\r\n * Executes the `onStep` callback on each step with the interpolated values.\r\n * Returns a function that can be called to cancel the animation.\r\n *\r\n * @example\r\n * // Example usage:\r\n * const fromValues = { x: 0, y: 0 };\r\n * const toValues = { x: 100, y: 200 };\r\n * const onStep = ({x, y}) => {\r\n * setState(x, y)\r\n * };\r\n * const onCancel = () => {\r\n * console.log(\"Animation canceled\");\r\n * };\r\n *\r\n * const cancelAnimation = easeToValuesRAF({\r\n * fromValues,\r\n * toValues,\r\n * onStep,\r\n * onCancel,\r\n * });\r\n *\r\n * // To cancel the animation:\r\n * cancelAnimation();\r\n */\n\n\nconst easeToValuesRAF = ({\n fromValues,\n toValues,\n onStep,\n duration = 250,\n interpolateValue,\n onStart,\n onEnd,\n onCancel\n}) => {\n let canceled = false;\n let frameId = 0;\n let startTime;\n\n function step(timestamp) {\n if (canceled) {\n return;\n }\n\n if (startTime === undefined) {\n startTime = timestamp;\n onStart === null || onStart === void 0 ? void 0 : onStart();\n }\n\n const elapsed = Math.min(timestamp - startTime, duration);\n const factor = easeOut(elapsed / duration);\n const newValues = {};\n Object.keys(fromValues).forEach(key => {\n const _key = key;\n const result = (toValues[_key] - fromValues[_key]) * factor + fromValues[_key];\n newValues[_key] = result;\n });\n onStep(newValues);\n\n if (elapsed < duration) {\n const progress = elapsed / duration;\n const newValues = {};\n Object.keys(fromValues).forEach(key => {\n const _key = key;\n const startValue = fromValues[_key];\n const endValue = toValues[_key];\n let result;\n result = interpolateValue ? interpolateValue(startValue, endValue, progress, _key) : easeOutInterpolate(startValue, endValue, progress);\n\n if (result == null) {\n result = easeOutInterpolate(startValue, endValue, progress);\n }\n\n newValues[_key] = result;\n });\n onStep(newValues);\n frameId = window.requestAnimationFrame(step);\n } else {\n onStep(toValues);\n onEnd === null || onEnd === void 0 ? void 0 : onEnd();\n }\n }\n\n frameId = window.requestAnimationFrame(step);\n return () => {\n onCancel === null || onCancel === void 0 ? void 0 : onCancel();\n canceled = true;\n window.cancelAnimationFrame(frameId);\n };\n}; // https://github.com/lodash/lodash/blob/es/chunk.js\n\nconst chunk = (array, size) => {\n if (!array.length || size < 1) {\n return [];\n }\n\n let index = 0;\n let resIndex = 0;\n const result = Array(Math.ceil(array.length / size));\n\n while (index < array.length) {\n result[resIndex++] = array.slice(index, index += size);\n }\n\n return result;\n};\nconst selectNode = node => {\n const selection = window.getSelection();\n\n if (selection) {\n const range = document.createRange();\n range.selectNodeContents(node);\n selection.removeAllRanges();\n selection.addRange(range);\n }\n};\nconst removeSelection = () => {\n const selection = window.getSelection();\n\n if (selection) {\n selection.removeAllRanges();\n }\n};\nconst distance = (x, y) => Math.abs(x - y);\nconst updateActiveTool = (appState, data) => {\n var _a, _b, _c;\n\n if (data.type === \"custom\") {\n return Object.assign(Object.assign({}, appState.activeTool), {\n type: \"custom\",\n customType: data.customType,\n locked: (_a = data.locked) !== null && _a !== void 0 ? _a : appState.activeTool.locked\n });\n }\n\n return Object.assign(Object.assign({}, appState.activeTool), {\n lastActiveTool: data.lastActiveToolBeforeEraser === undefined ? appState.activeTool.lastActiveTool : data.lastActiveToolBeforeEraser,\n type: data.type,\n customType: null,\n locked: (_b = data.locked) !== null && _b !== void 0 ? _b : appState.activeTool.locked,\n fromSelection: (_c = data.fromSelection) !== null && _c !== void 0 ? _c : false\n });\n};\nconst isFullScreen = () => {\n var _a;\n\n return ((_a = document.fullscreenElement) === null || _a === void 0 ? void 0 : _a.nodeName) === \"HTML\";\n};\nconst allowFullScreen = () => document.documentElement.requestFullscreen();\nconst exitFullScreen = () => document.exitFullscreen();\nconst viewportCoordsToSceneCoords = ({\n clientX,\n clientY\n}, {\n zoom,\n offsetLeft,\n offsetTop,\n scrollX,\n scrollY\n}) => {\n const x = (clientX - offsetLeft) / zoom.value - scrollX;\n const y = (clientY - offsetTop) / zoom.value - scrollY;\n return {\n x,\n y\n };\n};\nconst sceneCoordsToViewportCoords = ({\n sceneX,\n sceneY\n}, {\n zoom,\n offsetLeft,\n offsetTop,\n scrollX,\n scrollY\n}) => {\n const x = (sceneX + scrollX) * zoom.value + offsetLeft;\n const y = (sceneY + scrollY) * zoom.value + offsetTop;\n return {\n x,\n y\n };\n};\nconst getGlobalCSSVariable = name => getComputedStyle(document.documentElement).getPropertyValue(`--${name}`);\nconst RS_LTR_CHARS = \"A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02B8\\u0300-\\u0590\\u0800-\\u1FFF\" + \"\\u2C00-\\uFB1C\\uFDFE-\\uFE6F\\uFEFD-\\uFFFF\";\nconst RS_RTL_CHARS = \"\\u0591-\\u07FF\\uFB1D-\\uFDFD\\uFE70-\\uFEFC\";\nconst RE_RTL_CHECK = new RegExp(`^[^${RS_LTR_CHARS}]*[${RS_RTL_CHARS}]`);\n/**\r\n * Checks whether first directional character is RTL. Meaning whether it starts\r\n * with RTL characters, or indeterminate (numbers etc.) characters followed by\r\n * RTL.\r\n * See https://github.com/excalidraw/excalidraw/pull/1722#discussion_r436340171\r\n */\n\nconst isRTL = text => RE_RTL_CHECK.test(text);\nconst tupleToCoors = xyTuple => {\n const [x, y] = xyTuple;\n return {\n x,\n y\n };\n};\n/** use as a rejectionHandler to mute filesystem Abort errors */\n\nconst muteFSAbortError = error => {\n if ((error === null || error === void 0 ? void 0 : error.name) === \"AbortError\") {\n console.warn(error);\n return;\n }\n\n throw error;\n};\nconst findIndex = (array, cb, fromIndex = 0) => {\n if (fromIndex < 0) {\n fromIndex = array.length + fromIndex;\n }\n\n fromIndex = Math.min(array.length, Math.max(fromIndex, 0));\n let index = fromIndex - 1;\n\n while (++index < array.length) {\n if (cb(array[index], index, array)) {\n return index;\n }\n }\n\n return -1;\n};\nconst findLastIndex = (array, cb, fromIndex = array.length - 1) => {\n if (fromIndex < 0) {\n fromIndex = array.length + fromIndex;\n }\n\n fromIndex = Math.min(array.length - 1, Math.max(fromIndex, 0));\n let index = fromIndex + 1;\n\n while (--index > -1) {\n if (cb(array[index], index, array)) {\n return index;\n }\n }\n\n return -1;\n};\n/** returns the first non-null mapped value */\n\nconst mapFind = (collection, iteratee) => {\n for (let idx = 0; idx < collection.length; idx++) {\n const result = iteratee(collection[idx], idx);\n\n if (result != null) {\n return result;\n }\n }\n\n return undefined;\n};\nconst isTransparent = color => {\n const isRGBTransparent = color.length === 5 && color.substr(4, 1) === \"0\";\n const isRRGGBBTransparent = color.length === 9 && color.substr(7, 2) === \"00\";\n return isRGBTransparent || isRRGGBBTransparent || color === _colors__WEBPACK_IMPORTED_MODULE_1__.COLOR_PALETTE.transparent;\n};\nconst isBindingFallthroughEnabled = el => el.fillStyle !== \"solid\" || isTransparent(el.backgroundColor);\nconst resolvablePromise = () => {\n let resolve;\n let reject;\n const promise = new Promise((_resolve, _reject) => {\n resolve = _resolve;\n reject = _reject;\n });\n promise.resolve = resolve;\n promise.reject = reject;\n return promise;\n}; //https://stackoverflow.com/a/9462382/8418\n\nconst nFormatter = (num, digits) => {\n const si = [{\n value: 1,\n symbol: \"b\"\n }, {\n value: 1e3,\n symbol: \"k\"\n }, {\n value: 1e6,\n symbol: \"M\"\n }, {\n value: 1e9,\n symbol: \"G\"\n }];\n const rx = /\\.0+$|(\\.[0-9]*[1-9])0+$/;\n let index;\n\n for (index = si.length - 1; index > 0; index--) {\n if (num >= si[index].value) {\n break;\n }\n }\n\n return (num / si[index].value).toFixed(digits).replace(rx, \"$1\") + si[index].symbol;\n};\nconst getVersion = () => {\n var _a;\n\n return ((_a = document.querySelector('meta[name=\"version\"]')) === null || _a === void 0 ? void 0 : _a.content) || _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_VERSION;\n}; // Adapted from https://github.com/Modernizr/Modernizr/blob/master/feature-detects/emoji.js\n\nconst supportsEmoji = () => {\n const canvas = document.createElement(\"canvas\");\n const ctx = canvas.getContext(\"2d\");\n\n if (!ctx) {\n return false;\n }\n\n const offset = 12;\n ctx.fillStyle = \"#f00\";\n ctx.textBaseline = \"top\";\n ctx.font = \"32px Arial\"; // Modernizr used 🐨, but it is sort of supported on Windows 7.\n // Luckily 😀 isn't supported.\n\n ctx.fillText(\"😀\", 0, 0);\n return ctx.getImageData(offset, offset, 1, 1).data[0] !== 0;\n};\nconst getNearestScrollableContainer = element => {\n let parent = element.parentElement;\n\n while (parent) {\n if (parent === document.body) {\n return document;\n }\n\n const {\n overflowY\n } = window.getComputedStyle(parent);\n const hasScrollableContent = parent.scrollHeight > parent.clientHeight;\n\n if (hasScrollableContent && (overflowY === \"auto\" || overflowY === \"scroll\" || overflowY === \"overlay\")) {\n return parent;\n }\n\n parent = parent.parentElement;\n }\n\n return document;\n};\nconst focusNearestParent = element => {\n let parent = element.parentElement;\n\n while (parent) {\n if (parent.tabIndex > -1) {\n parent.focus();\n return;\n }\n\n parent = parent.parentElement;\n }\n};\nconst preventUnload = event => {\n event.preventDefault(); // NOTE: modern browsers no longer allow showing a custom message here\n\n event.returnValue = \"\";\n};\nconst bytesToHexString = bytes => {\n return Array.from(bytes).map(byte => `0${byte.toString(16)}`.slice(-2)).join(\"\");\n};\nconst getUpdatedTimestamp = () => isTestEnv() ? 1 : Date.now();\n/**\r\n * Transforms array of objects containing `id` attribute,\r\n * or array of ids (strings), into a Map, keyd by `id`.\r\n */\n\nconst arrayToMap = items => {\n if (items instanceof Map) {\n return items;\n }\n\n return items.reduce((acc, element) => {\n acc.set(typeof element === \"string\" ? element : element.id, element);\n return acc;\n }, new Map());\n};\nconst arrayToMapWithIndex = elements => elements.reduce((acc, element, idx) => {\n acc.set(element.id, [element, idx]);\n return acc;\n}, new Map());\n/**\r\n * Transform array into an object, use only when array order is irrelevant.\r\n */\n\nconst arrayToObject = (array, groupBy) => array.reduce((acc, value, idx) => {\n acc[groupBy ? groupBy(value) : idx] = value;\n return acc;\n}, {});\n/**\r\n * Creates a circular doubly linked list by adding `prev` and `next` props to the existing array nodes.\r\n */\n\nconst arrayToList = array => array.reduce((acc, curr, index) => {\n const node = Object.assign(Object.assign({}, curr), {\n prev: null,\n next: null\n }); // no-op for first item, we don't want circular references on a single item\n\n if (index !== 0) {\n const prevNode = acc[index - 1];\n node.prev = prevNode;\n prevNode.next = node;\n\n if (index === array.length - 1) {\n // make the references circular and connect head & tail\n const firstNode = acc[0];\n node.next = firstNode;\n firstNode.prev = node;\n }\n }\n\n acc.push(node);\n return acc;\n}, []);\n/**\r\n * Converts a readonly array or map into an iterable.\r\n * Useful for avoiding entry allocations when iterating object / map on each iteration.\r\n */\n\nconst toIterable = values => {\n return Array.isArray(values) ? values : values.values();\n};\n/**\r\n * Converts a readonly array or map into an array.\r\n */\n\nconst toArray = values => {\n return Array.isArray(values) ? values : Array.from(toIterable(values));\n};\nconst isTestEnv = () => \"development\" === _constants__WEBPACK_IMPORTED_MODULE_2__.ENV.TEST;\nconst isDevEnv = () => \"development\" === _constants__WEBPACK_IMPORTED_MODULE_2__.ENV.DEVELOPMENT;\nconst isProdEnv = () => \"development\" === _constants__WEBPACK_IMPORTED_MODULE_2__.ENV.PRODUCTION;\nconst isServerEnv = () => {\n var _a;\n\n return typeof process !== \"undefined\" && !!((_a = process === null || process === void 0 ? void 0 : ({\"MODE\":\"development\",\"VITE_APP_BACKEND_V2_GET_URL\":\"https://json-dev.excalidraw.com/api/v2/\",\"VITE_APP_BACKEND_V2_POST_URL\":\"https://json-dev.excalidraw.com/api/v2/post/\",\"VITE_APP_LIBRARY_URL\":\"https://libraries.excalidraw.com\",\"VITE_APP_LIBRARY_BACKEND\":\"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries\",\"VITE_APP_WS_SERVER_URL\":\"http://localhost:3002\",\"VITE_APP_PLUS_LP\":\"https://plus.excalidraw.com\",\"VITE_APP_PLUS_APP\":\"http://localhost:3000\",\"VITE_APP_AI_BACKEND\":\"http://localhost:3015\",\"VITE_APP_FIREBASE_CONFIG\":\"{\\\"apiKey\\\":\\\"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8\\\",\\\"authDomain\\\":\\\"excalidraw-oss-dev.firebaseapp.com\\\",\\\"projectId\\\":\\\"excalidraw-oss-dev\\\",\\\"storageBucket\\\":\\\"excalidraw-oss-dev.appspot.com\\\",\\\"messagingSenderId\\\":\\\"664559512677\\\",\\\"appId\\\":\\\"1:664559512677:web:a385181f2928d328a7aa8c\\\"}\",\"VITE_APP_DEV_DISABLE_LIVE_RELOAD\":\"\",\"VITE_APP_ENABLE_TRACKING\":\"true\",\"FAST_REFRESH\":\"false\",\"VITE_APP_PORT\":\"3000\",\"VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX\":\"\",\"VITE_APP_COLLAPSE_OVERLAY\":\"true\",\"VITE_APP_ENABLE_ESLINT\":\"true\",\"VITE_APP_ENABLE_PWA\":\"false\",\"VITE_APP_PLUS_EXPORT_PUBLIC_KEY\":\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\\nHQIDAQAB\",\"VITE_APP_DISABLE_PREVENT_UNLOAD\":\"\",\"VITE_PKG_NAME\":\"@zsviczian/excalidraw\",\"VITE_PKG_VERSION\":\"0.18.0-50\",\"VITE_IS_EXCALIDRAW_NPM_PACKAGE\":true})) === null || _a === void 0 ? void 0 : _a.NODE_ENV);\n};\nconst wrapEvent = (name, nativeEvent) => {\n return new CustomEvent(name, {\n detail: {\n nativeEvent\n },\n cancelable: true\n });\n};\nconst updateObject = (obj, updates) => {\n let didChange = false;\n\n for (const key in updates) {\n const value = updates[key];\n\n if (typeof value !== \"undefined\") {\n if (obj[key] === value && ( // if object, always update because its attrs could have changed\n typeof value !== \"object\" || value === null)) {\n continue;\n }\n\n didChange = true;\n }\n }\n\n if (!didChange) {\n return obj;\n }\n\n return Object.assign(Object.assign({}, obj), updates);\n};\nconst isPrimitive = val => {\n const type = typeof val;\n return val == null || type !== \"object\" && type !== \"function\";\n};\nconst getFrame = () => {\n try {\n return window.self === window.top ? \"top\" : \"iframe\";\n } catch (error) {\n return \"iframe\";\n }\n};\nconst isRunningInIframe = () => getFrame() === \"iframe\";\nconst isPromiseLike = value => {\n return !!value && typeof value === \"object\" && \"then\" in value && \"catch\" in value && \"finally\" in value;\n};\nconst queryFocusableElements = container => {\n const focusableElements = container === null || container === void 0 ? void 0 : container.querySelectorAll(\"button, a, input, select, textarea, div[tabindex], label[tabindex]\");\n return focusableElements ? Array.from(focusableElements).filter(element => element.tabIndex > -1 && !element.disabled) : [];\n};\n/** use as a fallback after identity check (for perf reasons) */\n\nconst _defaultIsShallowComparatorFallback = (a, b) => {\n // consider two empty arrays equal\n if (Array.isArray(a) && Array.isArray(b) && a.length === 0 && b.length === 0) {\n return true;\n }\n\n return a === b;\n};\n/**\r\n * Returns whether object/array is shallow equal.\r\n * Considers empty object/arrays as equal (whether top-level or second-level).\r\n */\n\n\nconst isShallowEqual = (objA, objB, comparators, debug = false) => {\n const aKeys = Object.keys(objA);\n const bKeys = Object.keys(objB);\n\n if (aKeys.length !== bKeys.length) {\n if (debug) {\n console.warn(`%cisShallowEqual: objects don't have same properties ->`, \"color: #8B4000\", objA, objB);\n }\n\n return false;\n }\n\n if (comparators && Array.isArray(comparators)) {\n for (const key of comparators) {\n const ret = objA[key] === objB[key] || _defaultIsShallowComparatorFallback(objA[key], objB[key]);\n\n if (!ret) {\n if (debug) {\n console.warn(`%cisShallowEqual: ${key} not equal ->`, \"color: #8B4000\", objA[key], objB[key]);\n }\n\n return false;\n }\n }\n\n return true;\n }\n\n return aKeys.every(key => {\n const comparator = comparators === null || comparators === void 0 ? void 0 : comparators[key];\n const ret = comparator ? comparator(objA[key], objB[key]) : objA[key] === objB[key] || _defaultIsShallowComparatorFallback(objA[key], objB[key]);\n\n if (!ret && debug) {\n console.warn(`%cisShallowEqual: ${key} not equal ->`, \"color: #8B4000\", objA[key], objB[key]);\n }\n\n return ret;\n });\n}; // taken from Radix UI\n// https://github.com/radix-ui/primitives/blob/main/packages/core/primitive/src/primitive.tsx\n\nconst composeEventHandlers = (originalEventHandler, ourEventHandler, {\n checkForDefaultPrevented = true\n} = {}) => {\n return function handleEvent(event) {\n originalEventHandler === null || originalEventHandler === void 0 ? void 0 : originalEventHandler(event);\n\n if (!checkForDefaultPrevented || !(event === null || event === void 0 ? void 0 : event.defaultPrevented)) {\n return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event);\n }\n };\n};\n/**\r\n * supply `null` as message if non-never value is valid, you just need to\r\n * typecheck against it\r\n */\n\nconst assertNever = (value, message, softAssert) => {\n if (!message) {\n return value;\n }\n\n if (softAssert) {\n console.error(message);\n return value;\n }\n\n throw new Error(message);\n};\nfunction invariant(condition, message) {\n if (!condition) {\n throw new Error(message);\n }\n}\n/**\r\n * Memoizes on values of `opts` object (strict equality).\r\n */\n\nconst memoize = func => {\n let lastArgs;\n let lastResult;\n\n const ret = function (opts) {\n const currentArgs = Object.entries(opts);\n\n if (lastArgs) {\n let argsAreEqual = true;\n\n for (const [key, value] of currentArgs) {\n if (lastArgs.get(key) !== value) {\n argsAreEqual = false;\n break;\n }\n }\n\n if (argsAreEqual) {\n return lastResult;\n }\n }\n\n const result = func(opts);\n lastArgs = new Map(currentArgs);\n lastResult = result;\n return result;\n };\n\n ret.clear = () => {\n lastArgs = undefined;\n lastResult = undefined;\n };\n\n return ret;\n};\n/** Checks if value is inside given collection. Useful for type-safety. */\n\nconst isMemberOf = (\n/** Set/Map/Array/Object */\ncollection,\n/** value to look for */\nvalue) => {\n return collection instanceof Set || collection instanceof Map ? collection.has(value) : \"includes\" in collection ? collection.includes(value) : collection.hasOwnProperty(value);\n};\nconst cloneJSON = obj => JSON.parse(JSON.stringify(obj));\nconst updateStable = (prevValue, nextValue) => {\n if (isShallowEqual(prevValue, nextValue)) {\n return prevValue;\n }\n\n return nextValue;\n}; // implem\n\nfunction addEventListener(\n/**\r\n * allows for falsy values so you don't have to type check when adding\r\n * event listeners to optional elements\r\n */\ntarget, type, listener, options) {\n var _a;\n\n if (!target) {\n return () => {};\n }\n\n (_a = target === null || target === void 0 ? void 0 : target.addEventListener) === null || _a === void 0 ? void 0 : _a.call(target, type, listener, options);\n return () => {\n var _a;\n\n (_a = target === null || target === void 0 ? void 0 : target.removeEventListener) === null || _a === void 0 ? void 0 : _a.call(target, type, listener, options);\n };\n}\nfunction getSvgPathFromStroke(points, closed = true) {\n const len = points.length;\n\n if (len < 4) {\n return ``;\n }\n\n let a = points[0];\n let b = points[1];\n const c = points[2];\n let result = `M${a[0].toFixed(2)},${a[1].toFixed(2)} Q${b[0].toFixed(2)},${b[1].toFixed(2)} ${(0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_0__.average)(b[0], c[0]).toFixed(2)},${(0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_0__.average)(b[1], c[1]).toFixed(2)} T`;\n\n for (let i = 2, max = len - 1; i < max; i++) {\n a = points[i];\n b = points[i + 1];\n result += `${(0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_0__.average)(a[0], b[0]).toFixed(2)},${(0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_0__.average)(a[1], b[1]).toFixed(2)} `;\n }\n\n if (closed) {\n result += \"Z\";\n }\n\n return result;\n}\nconst normalizeEOL = str => {\n return str.replace(/\\r?\\n|\\r/g, \"\\n\");\n};\n/**\r\n * Makes type into a branded type, ensuring that value is assignable to\r\n * the base ubranded type. Optionally you can explicitly supply current value\r\n * type to combine both (useful for composite branded types. Make sure you\r\n * compose branded types which are not composite themselves.)\r\n */\n\nconst toBrandedType = value => {\n return value;\n}; // -----------------------------------------------------------------------------\n// Promise.try, adapted from https://github.com/sindresorhus/p-try\n\nconst promiseTry = async (fn, ...args) => {\n return new Promise(resolve => {\n resolve(fn(...args));\n });\n};\nconst isAnyTrue = (...args) => Math.max(...args.map(arg => arg ? 1 : 0)) > 0;\nconst safelyParseJSON = json => {\n try {\n return JSON.parse(json);\n } catch (_a) {\n return null;\n }\n};\n/**\r\n * use when you need to render unsafe string as HTML attribute, but MAKE SURE\r\n * the attribute is double-quoted when constructing the HTML string\r\n */\n\nconst escapeDoubleQuotes = str => {\n return str.replace(/\"/g, \""\");\n};\nconst castArray = value => Array.isArray(value) ? value : [value];\n/** hack for Array.isArray type guard not working with readonly value[] */\n\nconst isReadonlyArray = value => {\n return Array.isArray(value);\n};\nconst sizeOf = value => {\n return isReadonlyArray(value) ? value.length : value instanceof Map || value instanceof Set ? value.size : Object.keys(value).length;\n};\nconst reduceToCommonValue = (collection, getValue) => {\n if (sizeOf(collection) === 0) {\n return null;\n }\n\n const valueExtractor = getValue || (item => item);\n\n let commonValue = null;\n\n for (const item of collection) {\n const value = valueExtractor(item);\n\n if ((commonValue === null || commonValue === value) && value != null) {\n commonValue = value;\n } else {\n return null;\n }\n }\n\n return commonValue;\n};\n\n//# sourceURL=webpack://ExcalidrawLib/../common/src/utils.ts?");
|
|
13094
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ addEventListener: () => (/* binding */ addEventListener),\n/* harmony export */ allowFullScreen: () => (/* binding */ allowFullScreen),\n/* harmony export */ arrayToList: () => (/* binding */ arrayToList),\n/* harmony export */ arrayToMap: () => (/* binding */ arrayToMap),\n/* harmony export */ arrayToMapWithIndex: () => (/* binding */ arrayToMapWithIndex),\n/* harmony export */ arrayToObject: () => (/* binding */ arrayToObject),\n/* harmony export */ assertNever: () => (/* binding */ assertNever),\n/* harmony export */ bytesToHexString: () => (/* binding */ bytesToHexString),\n/* harmony export */ capitalizeString: () => (/* binding */ capitalizeString),\n/* harmony export */ castArray: () => (/* binding */ castArray),\n/* harmony export */ chunk: () => (/* binding */ chunk),\n/* harmony export */ cloneJSON: () => (/* binding */ cloneJSON),\n/* harmony export */ composeEventHandlers: () => (/* binding */ composeEventHandlers),\n/* harmony export */ debounce: () => (/* binding */ debounce),\n/* harmony export */ distance: () => (/* binding */ distance),\n/* harmony export */ easeOut: () => (/* binding */ easeOut),\n/* harmony export */ easeToValuesRAF: () => (/* binding */ easeToValuesRAF),\n/* harmony export */ escapeDoubleQuotes: () => (/* binding */ escapeDoubleQuotes),\n/* harmony export */ exitFullScreen: () => (/* binding */ exitFullScreen),\n/* harmony export */ findIndex: () => (/* binding */ findIndex),\n/* harmony export */ findLastIndex: () => (/* binding */ findLastIndex),\n/* harmony export */ focusNearestParent: () => (/* binding */ focusNearestParent),\n/* harmony export */ getDateTime: () => (/* binding */ getDateTime),\n/* harmony export */ getFontFamilyString: () => (/* binding */ getFontFamilyString),\n/* harmony export */ getFontString: () => (/* binding */ getFontString),\n/* harmony export */ getFrame: () => (/* binding */ getFrame),\n/* harmony export */ getGlobalCSSVariable: () => (/* binding */ getGlobalCSSVariable),\n/* harmony export */ getNearestScrollableContainer: () => (/* binding */ getNearestScrollableContainer),\n/* harmony export */ getSvgPathFromStroke: () => (/* binding */ getSvgPathFromStroke),\n/* harmony export */ getUpdatedTimestamp: () => (/* binding */ getUpdatedTimestamp),\n/* harmony export */ getVersion: () => (/* binding */ getVersion),\n/* harmony export */ invariant: () => (/* binding */ invariant),\n/* harmony export */ isAnyTrue: () => (/* binding */ isAnyTrue),\n/* harmony export */ isBindingFallthroughEnabled: () => (/* binding */ isBindingFallthroughEnabled),\n/* harmony export */ isDevEnv: () => (/* binding */ isDevEnv),\n/* harmony export */ isFullScreen: () => (/* binding */ isFullScreen),\n/* harmony export */ isInputLike: () => (/* binding */ isInputLike),\n/* harmony export */ isInteractive: () => (/* binding */ isInteractive),\n/* harmony export */ isMemberOf: () => (/* binding */ isMemberOf),\n/* harmony export */ isPrimitive: () => (/* binding */ isPrimitive),\n/* harmony export */ isProdEnv: () => (/* binding */ isProdEnv),\n/* harmony export */ isPromiseLike: () => (/* binding */ isPromiseLike),\n/* harmony export */ isRTL: () => (/* binding */ isRTL),\n/* harmony export */ isReadonlyArray: () => (/* binding */ isReadonlyArray),\n/* harmony export */ isRunningInIframe: () => (/* binding */ isRunningInIframe),\n/* harmony export */ isServerEnv: () => (/* binding */ isServerEnv),\n/* harmony export */ isShallowEqual: () => (/* binding */ isShallowEqual),\n/* harmony export */ isTestEnv: () => (/* binding */ isTestEnv),\n/* harmony export */ isToolIcon: () => (/* binding */ isToolIcon),\n/* harmony export */ isTransparent: () => (/* binding */ isTransparent),\n/* harmony export */ isWritableElement: () => (/* binding */ isWritableElement),\n/* harmony export */ mapFind: () => (/* binding */ mapFind),\n/* harmony export */ memoize: () => (/* binding */ memoize),\n/* harmony export */ muteFSAbortError: () => (/* binding */ muteFSAbortError),\n/* harmony export */ nFormatter: () => (/* binding */ nFormatter),\n/* harmony export */ nextAnimationFrame: () => (/* binding */ nextAnimationFrame),\n/* harmony export */ normalizeEOL: () => (/* binding */ normalizeEOL),\n/* harmony export */ preventUnload: () => (/* binding */ preventUnload),\n/* harmony export */ promiseTry: () => (/* binding */ promiseTry),\n/* harmony export */ queryFocusableElements: () => (/* binding */ queryFocusableElements),\n/* harmony export */ reduceToCommonValue: () => (/* binding */ reduceToCommonValue),\n/* harmony export */ removeSelection: () => (/* binding */ removeSelection),\n/* harmony export */ resolvablePromise: () => (/* binding */ resolvablePromise),\n/* harmony export */ safelyParseJSON: () => (/* binding */ safelyParseJSON),\n/* harmony export */ sceneCoordsToViewportCoords: () => (/* binding */ sceneCoordsToViewportCoords),\n/* harmony export */ selectNode: () => (/* binding */ selectNode),\n/* harmony export */ setDateTimeForTests: () => (/* binding */ setDateTimeForTests),\n/* harmony export */ sizeOf: () => (/* binding */ sizeOf),\n/* harmony export */ supportsEmoji: () => (/* binding */ supportsEmoji),\n/* harmony export */ throttleRAF: () => (/* binding */ throttleRAF),\n/* harmony export */ toArray: () => (/* binding */ toArray),\n/* harmony export */ toBrandedType: () => (/* binding */ toBrandedType),\n/* harmony export */ toIterable: () => (/* binding */ toIterable),\n/* harmony export */ tupleToCoors: () => (/* binding */ tupleToCoors),\n/* harmony export */ updateActiveTool: () => (/* binding */ updateActiveTool),\n/* harmony export */ updateObject: () => (/* binding */ updateObject),\n/* harmony export */ updateStable: () => (/* binding */ updateStable),\n/* harmony export */ viewportCoordsToSceneCoords: () => (/* binding */ viewportCoordsToSceneCoords),\n/* harmony export */ wrapEvent: () => (/* binding */ wrapEvent)\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 _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\n\n\nlet mockDateTime = null;\nconst setDateTimeForTests = dateTime => {\n mockDateTime = dateTime;\n};\nconst getDateTime = () => {\n if (mockDateTime) {\n return mockDateTime;\n }\n\n const date = new Date();\n const year = date.getFullYear();\n const month = `${date.getMonth() + 1}`.padStart(2, \"0\");\n const day = `${date.getDate()}`.padStart(2, \"0\");\n const hr = `${date.getHours()}`.padStart(2, \"0\");\n const min = `${date.getMinutes()}`.padStart(2, \"0\");\n return `${year}-${month}-${day}-${hr}${min}`;\n};\nconst capitalizeString = str => str.charAt(0).toUpperCase() + str.slice(1);\nconst isToolIcon = target => target instanceof HTMLElement && target.className.includes(\"ToolIcon\");\nconst isInputLike = target => target instanceof HTMLElement && target.dataset.type === \"wysiwyg\" || target instanceof HTMLBRElement || // newline in wysiwyg\ntarget instanceof HTMLInputElement || target instanceof HTMLTextAreaElement || target instanceof HTMLSelectElement;\nconst isInteractive = target => {\n return isInputLike(target) || target instanceof Element && !!target.closest(\"label, button\");\n};\nconst isWritableElement = target => target instanceof HTMLElement && target.dataset.type === \"wysiwyg\" || target instanceof HTMLBRElement || // newline in wysiwyg\ntarget instanceof HTMLTextAreaElement || target instanceof HTMLInputElement && (target.type === \"text\" || target.type === \"number\" || target.type === \"password\" || target.type === \"search\");\nconst getFontFamilyString = ({\n fontFamily\n}) => {\n for (const [fontFamilyString, id] of Object.entries(_constants__WEBPACK_IMPORTED_MODULE_2__.FONT_FAMILY)) {\n if (id === fontFamily) {\n return `${fontFamilyString}${(0,_constants__WEBPACK_IMPORTED_MODULE_2__.getFontFamilyFallbacks)(id).map(x => `, ${x}`).join(\"\")}`;\n }\n }\n\n return _constants__WEBPACK_IMPORTED_MODULE_2__.WINDOWS_EMOJI_FALLBACK_FONT;\n};\n/** returns fontSize+fontFamily string for assignment to DOM elements */\n\nconst getFontString = ({\n fontSize,\n fontFamily\n}) => {\n return `${fontSize}px ${getFontFamilyString({\n fontFamily\n })}`;\n};\n/** executes callback in the frame that's after the current one */\n\nconst nextAnimationFrame = async cb => {\n requestAnimationFrame(() => requestAnimationFrame(cb));\n};\nconst debounce = (fn, timeout) => {\n let handle = 0;\n let lastArgs = null;\n\n const ret = (...args) => {\n lastArgs = args;\n clearTimeout(handle);\n handle = window.setTimeout(() => {\n lastArgs = null;\n fn(...args);\n }, timeout);\n };\n\n ret.flush = () => {\n clearTimeout(handle);\n\n if (lastArgs) {\n const _lastArgs = lastArgs;\n lastArgs = null;\n fn(..._lastArgs);\n }\n };\n\n ret.cancel = () => {\n lastArgs = null;\n clearTimeout(handle);\n };\n\n return ret;\n}; // throttle callback to execute once per animation frame\n\nconst throttleRAF = (fn, opts) => {\n let timerId = null;\n let lastArgs = null;\n let lastArgsTrailing = null;\n\n const scheduleFunc = args => {\n timerId = window.requestAnimationFrame(() => {\n timerId = null;\n fn(...args);\n lastArgs = null;\n\n if (lastArgsTrailing) {\n lastArgs = lastArgsTrailing;\n lastArgsTrailing = null;\n scheduleFunc(lastArgs);\n }\n });\n };\n\n const ret = (...args) => {\n if (isTestEnv()) {\n fn(...args);\n return;\n }\n\n lastArgs = args;\n\n if (timerId === null) {\n scheduleFunc(lastArgs);\n } else if (opts === null || opts === void 0 ? void 0 : opts.trailing) {\n lastArgsTrailing = args;\n }\n };\n\n ret.flush = () => {\n if (timerId !== null) {\n cancelAnimationFrame(timerId);\n timerId = null;\n }\n\n if (lastArgs) {\n fn(...(lastArgsTrailing || lastArgs));\n lastArgs = lastArgsTrailing = null;\n }\n };\n\n ret.cancel = () => {\n lastArgs = lastArgsTrailing = null;\n\n if (timerId !== null) {\n cancelAnimationFrame(timerId);\n timerId = null;\n }\n };\n\n return ret;\n};\n/**\r\n * Exponential ease-out method\r\n *\r\n * @param {number} k - The value to be tweened.\r\n * @returns {number} The tweened value.\r\n */\n\nconst easeOut = k => {\n return 1 - Math.pow(1 - k, 4);\n};\n\nconst easeOutInterpolate = (from, to, progress) => {\n return (to - from) * easeOut(progress) + from;\n};\n/**\r\n * Animates values from `fromValues` to `toValues` using the requestAnimationFrame API.\r\n * Executes the `onStep` callback on each step with the interpolated values.\r\n * Returns a function that can be called to cancel the animation.\r\n *\r\n * @example\r\n * // Example usage:\r\n * const fromValues = { x: 0, y: 0 };\r\n * const toValues = { x: 100, y: 200 };\r\n * const onStep = ({x, y}) => {\r\n * setState(x, y)\r\n * };\r\n * const onCancel = () => {\r\n * console.log(\"Animation canceled\");\r\n * };\r\n *\r\n * const cancelAnimation = easeToValuesRAF({\r\n * fromValues,\r\n * toValues,\r\n * onStep,\r\n * onCancel,\r\n * });\r\n *\r\n * // To cancel the animation:\r\n * cancelAnimation();\r\n */\n\n\nconst easeToValuesRAF = ({\n fromValues,\n toValues,\n onStep,\n duration = 250,\n interpolateValue,\n onStart,\n onEnd,\n onCancel\n}) => {\n let canceled = false;\n let frameId = 0;\n let startTime;\n\n function step(timestamp) {\n if (canceled) {\n return;\n }\n\n if (startTime === undefined) {\n startTime = timestamp;\n onStart === null || onStart === void 0 ? void 0 : onStart();\n }\n\n const elapsed = Math.min(timestamp - startTime, duration);\n const factor = easeOut(elapsed / duration);\n const newValues = {};\n Object.keys(fromValues).forEach(key => {\n const _key = key;\n const result = (toValues[_key] - fromValues[_key]) * factor + fromValues[_key];\n newValues[_key] = result;\n });\n onStep(newValues);\n\n if (elapsed < duration) {\n const progress = elapsed / duration;\n const newValues = {};\n Object.keys(fromValues).forEach(key => {\n const _key = key;\n const startValue = fromValues[_key];\n const endValue = toValues[_key];\n let result;\n result = interpolateValue ? interpolateValue(startValue, endValue, progress, _key) : easeOutInterpolate(startValue, endValue, progress);\n\n if (result == null) {\n result = easeOutInterpolate(startValue, endValue, progress);\n }\n\n newValues[_key] = result;\n });\n onStep(newValues);\n frameId = window.requestAnimationFrame(step);\n } else {\n onStep(toValues);\n onEnd === null || onEnd === void 0 ? void 0 : onEnd();\n }\n }\n\n frameId = window.requestAnimationFrame(step);\n return () => {\n onCancel === null || onCancel === void 0 ? void 0 : onCancel();\n canceled = true;\n window.cancelAnimationFrame(frameId);\n };\n}; // https://github.com/lodash/lodash/blob/es/chunk.js\n\nconst chunk = (array, size) => {\n if (!array.length || size < 1) {\n return [];\n }\n\n let index = 0;\n let resIndex = 0;\n const result = Array(Math.ceil(array.length / size));\n\n while (index < array.length) {\n result[resIndex++] = array.slice(index, index += size);\n }\n\n return result;\n};\nconst selectNode = node => {\n const selection = window.getSelection();\n\n if (selection) {\n const range = document.createRange();\n range.selectNodeContents(node);\n selection.removeAllRanges();\n selection.addRange(range);\n }\n};\nconst removeSelection = () => {\n const selection = window.getSelection();\n\n if (selection) {\n selection.removeAllRanges();\n }\n};\nconst distance = (x, y) => Math.abs(x - y);\nconst updateActiveTool = (appState, data) => {\n var _a, _b, _c;\n\n if (data.type === \"custom\") {\n return Object.assign(Object.assign({}, appState.activeTool), {\n type: \"custom\",\n customType: data.customType,\n locked: (_a = data.locked) !== null && _a !== void 0 ? _a : appState.activeTool.locked\n });\n }\n\n return Object.assign(Object.assign({}, appState.activeTool), {\n lastActiveTool: data.lastActiveToolBeforeEraser === undefined ? appState.activeTool.lastActiveTool : data.lastActiveToolBeforeEraser,\n type: data.type,\n customType: null,\n locked: (_b = data.locked) !== null && _b !== void 0 ? _b : appState.activeTool.locked,\n fromSelection: (_c = data.fromSelection) !== null && _c !== void 0 ? _c : false\n });\n};\nconst isFullScreen = () => {\n var _a;\n\n return ((_a = document.fullscreenElement) === null || _a === void 0 ? void 0 : _a.nodeName) === \"HTML\";\n};\nconst allowFullScreen = () => document.documentElement.requestFullscreen();\nconst exitFullScreen = () => document.exitFullscreen();\nconst viewportCoordsToSceneCoords = ({\n clientX,\n clientY\n}, {\n zoom,\n offsetLeft,\n offsetTop,\n scrollX,\n scrollY\n}) => {\n const x = (clientX - offsetLeft) / zoom.value - scrollX;\n const y = (clientY - offsetTop) / zoom.value - scrollY;\n return {\n x,\n y\n };\n};\nconst sceneCoordsToViewportCoords = ({\n sceneX,\n sceneY\n}, {\n zoom,\n offsetLeft,\n offsetTop,\n scrollX,\n scrollY\n}) => {\n const x = (sceneX + scrollX) * zoom.value + offsetLeft;\n const y = (sceneY + scrollY) * zoom.value + offsetTop;\n return {\n x,\n y\n };\n};\nconst getGlobalCSSVariable = name => getComputedStyle(document.documentElement).getPropertyValue(`--${name}`);\nconst RS_LTR_CHARS = \"A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02B8\\u0300-\\u0590\\u0800-\\u1FFF\" + \"\\u2C00-\\uFB1C\\uFDFE-\\uFE6F\\uFEFD-\\uFFFF\";\nconst RS_RTL_CHARS = \"\\u0591-\\u07FF\\uFB1D-\\uFDFD\\uFE70-\\uFEFC\";\nconst RE_RTL_CHECK = new RegExp(`^[^${RS_LTR_CHARS}]*[${RS_RTL_CHARS}]`);\n/**\r\n * Checks whether first directional character is RTL. Meaning whether it starts\r\n * with RTL characters, or indeterminate (numbers etc.) characters followed by\r\n * RTL.\r\n * See https://github.com/excalidraw/excalidraw/pull/1722#discussion_r436340171\r\n */\n\nconst isRTL = text => RE_RTL_CHECK.test(text);\nconst tupleToCoors = xyTuple => {\n const [x, y] = xyTuple;\n return {\n x,\n y\n };\n};\n/** use as a rejectionHandler to mute filesystem Abort errors */\n\nconst muteFSAbortError = error => {\n if ((error === null || error === void 0 ? void 0 : error.name) === \"AbortError\") {\n console.warn(error);\n return;\n }\n\n throw error;\n};\nconst findIndex = (array, cb, fromIndex = 0) => {\n if (fromIndex < 0) {\n fromIndex = array.length + fromIndex;\n }\n\n fromIndex = Math.min(array.length, Math.max(fromIndex, 0));\n let index = fromIndex - 1;\n\n while (++index < array.length) {\n if (cb(array[index], index, array)) {\n return index;\n }\n }\n\n return -1;\n};\nconst findLastIndex = (array, cb, fromIndex = array.length - 1) => {\n if (fromIndex < 0) {\n fromIndex = array.length + fromIndex;\n }\n\n fromIndex = Math.min(array.length - 1, Math.max(fromIndex, 0));\n let index = fromIndex + 1;\n\n while (--index > -1) {\n if (cb(array[index], index, array)) {\n return index;\n }\n }\n\n return -1;\n};\n/** returns the first non-null mapped value */\n\nconst mapFind = (collection, iteratee) => {\n for (let idx = 0; idx < collection.length; idx++) {\n const result = iteratee(collection[idx], idx);\n\n if (result != null) {\n return result;\n }\n }\n\n return undefined;\n};\nconst isTransparent = color => {\n const isRGBTransparent = color.length === 5 && color.substr(4, 1) === \"0\";\n const isRRGGBBTransparent = color.length === 9 && color.substr(7, 2) === \"00\";\n return isRGBTransparent || isRRGGBBTransparent || color === _colors__WEBPACK_IMPORTED_MODULE_1__.COLOR_PALETTE.transparent;\n};\nconst isBindingFallthroughEnabled = el => el.fillStyle !== \"solid\" || isTransparent(el.backgroundColor);\nconst resolvablePromise = () => {\n let resolve;\n let reject;\n const promise = new Promise((_resolve, _reject) => {\n resolve = _resolve;\n reject = _reject;\n });\n promise.resolve = resolve;\n promise.reject = reject;\n return promise;\n}; //https://stackoverflow.com/a/9462382/8418\n\nconst nFormatter = (num, digits) => {\n const si = [{\n value: 1,\n symbol: \"b\"\n }, {\n value: 1e3,\n symbol: \"k\"\n }, {\n value: 1e6,\n symbol: \"M\"\n }, {\n value: 1e9,\n symbol: \"G\"\n }];\n const rx = /\\.0+$|(\\.[0-9]*[1-9])0+$/;\n let index;\n\n for (index = si.length - 1; index > 0; index--) {\n if (num >= si[index].value) {\n break;\n }\n }\n\n return (num / si[index].value).toFixed(digits).replace(rx, \"$1\") + si[index].symbol;\n};\nconst getVersion = () => {\n var _a;\n\n return ((_a = document.querySelector('meta[name=\"version\"]')) === null || _a === void 0 ? void 0 : _a.content) || _constants__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_VERSION;\n}; // Adapted from https://github.com/Modernizr/Modernizr/blob/master/feature-detects/emoji.js\n\nconst supportsEmoji = () => {\n const canvas = document.createElement(\"canvas\");\n const ctx = canvas.getContext(\"2d\");\n\n if (!ctx) {\n return false;\n }\n\n const offset = 12;\n ctx.fillStyle = \"#f00\";\n ctx.textBaseline = \"top\";\n ctx.font = \"32px Arial\"; // Modernizr used 🐨, but it is sort of supported on Windows 7.\n // Luckily 😀 isn't supported.\n\n ctx.fillText(\"😀\", 0, 0);\n return ctx.getImageData(offset, offset, 1, 1).data[0] !== 0;\n};\nconst getNearestScrollableContainer = element => {\n let parent = element.parentElement;\n\n while (parent) {\n if (parent === document.body) {\n return document;\n }\n\n const {\n overflowY\n } = window.getComputedStyle(parent);\n const hasScrollableContent = parent.scrollHeight > parent.clientHeight;\n\n if (hasScrollableContent && (overflowY === \"auto\" || overflowY === \"scroll\" || overflowY === \"overlay\")) {\n return parent;\n }\n\n parent = parent.parentElement;\n }\n\n return document;\n};\nconst focusNearestParent = element => {\n let parent = element.parentElement;\n\n while (parent) {\n if (parent.tabIndex > -1) {\n parent.focus();\n return;\n }\n\n parent = parent.parentElement;\n }\n};\nconst preventUnload = event => {\n event.preventDefault(); // NOTE: modern browsers no longer allow showing a custom message here\n\n event.returnValue = \"\";\n};\nconst bytesToHexString = bytes => {\n return Array.from(bytes).map(byte => `0${byte.toString(16)}`.slice(-2)).join(\"\");\n};\nconst getUpdatedTimestamp = () => isTestEnv() ? 1 : Date.now();\n/**\r\n * Transforms array of objects containing `id` attribute,\r\n * or array of ids (strings), into a Map, keyd by `id`.\r\n */\n\nconst arrayToMap = items => {\n if (items instanceof Map) {\n return items;\n }\n\n return items.reduce((acc, element) => {\n acc.set(typeof element === \"string\" ? element : element.id, element);\n return acc;\n }, new Map());\n};\nconst arrayToMapWithIndex = elements => elements.reduce((acc, element, idx) => {\n acc.set(element.id, [element, idx]);\n return acc;\n}, new Map());\n/**\r\n * Transform array into an object, use only when array order is irrelevant.\r\n */\n\nconst arrayToObject = (array, groupBy) => array.reduce((acc, value, idx) => {\n acc[groupBy ? groupBy(value) : idx] = value;\n return acc;\n}, {});\n/**\r\n * Creates a circular doubly linked list by adding `prev` and `next` props to the existing array nodes.\r\n */\n\nconst arrayToList = array => array.reduce((acc, curr, index) => {\n const node = Object.assign(Object.assign({}, curr), {\n prev: null,\n next: null\n }); // no-op for first item, we don't want circular references on a single item\n\n if (index !== 0) {\n const prevNode = acc[index - 1];\n node.prev = prevNode;\n prevNode.next = node;\n\n if (index === array.length - 1) {\n // make the references circular and connect head & tail\n const firstNode = acc[0];\n node.next = firstNode;\n firstNode.prev = node;\n }\n }\n\n acc.push(node);\n return acc;\n}, []);\n/**\r\n * Converts a readonly array or map into an iterable.\r\n * Useful for avoiding entry allocations when iterating object / map on each iteration.\r\n */\n\nconst toIterable = values => {\n return Array.isArray(values) ? values : values.values();\n};\n/**\r\n * Converts a readonly array or map into an array.\r\n */\n\nconst toArray = values => {\n return Array.isArray(values) ? values : Array.from(toIterable(values));\n};\nconst isTestEnv = () => \"development\" === _constants__WEBPACK_IMPORTED_MODULE_2__.ENV.TEST;\nconst isDevEnv = () => \"development\" === _constants__WEBPACK_IMPORTED_MODULE_2__.ENV.DEVELOPMENT;\nconst isProdEnv = () => \"development\" === _constants__WEBPACK_IMPORTED_MODULE_2__.ENV.PRODUCTION;\nconst isServerEnv = () => {\n var _a;\n\n return typeof process !== \"undefined\" && !!((_a = process === null || process === void 0 ? void 0 : ({\"MODE\":\"development\",\"VITE_APP_BACKEND_V2_GET_URL\":\"https://json-dev.excalidraw.com/api/v2/\",\"VITE_APP_BACKEND_V2_POST_URL\":\"https://json-dev.excalidraw.com/api/v2/post/\",\"VITE_APP_LIBRARY_URL\":\"https://libraries.excalidraw.com\",\"VITE_APP_LIBRARY_BACKEND\":\"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries\",\"VITE_APP_WS_SERVER_URL\":\"http://localhost:3002\",\"VITE_APP_PLUS_LP\":\"https://plus.excalidraw.com\",\"VITE_APP_PLUS_APP\":\"http://localhost:3000\",\"VITE_APP_AI_BACKEND\":\"http://localhost:3015\",\"VITE_APP_FIREBASE_CONFIG\":\"{\\\"apiKey\\\":\\\"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8\\\",\\\"authDomain\\\":\\\"excalidraw-oss-dev.firebaseapp.com\\\",\\\"projectId\\\":\\\"excalidraw-oss-dev\\\",\\\"storageBucket\\\":\\\"excalidraw-oss-dev.appspot.com\\\",\\\"messagingSenderId\\\":\\\"664559512677\\\",\\\"appId\\\":\\\"1:664559512677:web:a385181f2928d328a7aa8c\\\"}\",\"VITE_APP_DEV_DISABLE_LIVE_RELOAD\":\"\",\"VITE_APP_ENABLE_TRACKING\":\"true\",\"FAST_REFRESH\":\"false\",\"VITE_APP_PORT\":\"3000\",\"VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX\":\"\",\"VITE_APP_COLLAPSE_OVERLAY\":\"true\",\"VITE_APP_ENABLE_ESLINT\":\"true\",\"VITE_APP_ENABLE_PWA\":\"false\",\"VITE_APP_PLUS_EXPORT_PUBLIC_KEY\":\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\\nHQIDAQAB\",\"VITE_APP_DISABLE_PREVENT_UNLOAD\":\"\",\"VITE_PKG_NAME\":\"@zsviczian/excalidraw\",\"VITE_PKG_VERSION\":\"0.18.0-51\",\"VITE_IS_EXCALIDRAW_NPM_PACKAGE\":true})) === null || _a === void 0 ? void 0 : _a.NODE_ENV);\n};\nconst wrapEvent = (name, nativeEvent) => {\n return new CustomEvent(name, {\n detail: {\n nativeEvent\n },\n cancelable: true\n });\n};\nconst updateObject = (obj, updates) => {\n let didChange = false;\n\n for (const key in updates) {\n const value = updates[key];\n\n if (typeof value !== \"undefined\") {\n if (obj[key] === value && ( // if object, always update because its attrs could have changed\n typeof value !== \"object\" || value === null)) {\n continue;\n }\n\n didChange = true;\n }\n }\n\n if (!didChange) {\n return obj;\n }\n\n return Object.assign(Object.assign({}, obj), updates);\n};\nconst isPrimitive = val => {\n const type = typeof val;\n return val == null || type !== \"object\" && type !== \"function\";\n};\nconst getFrame = () => {\n try {\n return window.self === window.top ? \"top\" : \"iframe\";\n } catch (error) {\n return \"iframe\";\n }\n};\nconst isRunningInIframe = () => getFrame() === \"iframe\";\nconst isPromiseLike = value => {\n return !!value && typeof value === \"object\" && \"then\" in value && \"catch\" in value && \"finally\" in value;\n};\nconst queryFocusableElements = container => {\n const focusableElements = container === null || container === void 0 ? void 0 : container.querySelectorAll(\"button, a, input, select, textarea, div[tabindex], label[tabindex]\");\n return focusableElements ? Array.from(focusableElements).filter(element => element.tabIndex > -1 && !element.disabled) : [];\n};\n/** use as a fallback after identity check (for perf reasons) */\n\nconst _defaultIsShallowComparatorFallback = (a, b) => {\n // consider two empty arrays equal\n if (Array.isArray(a) && Array.isArray(b) && a.length === 0 && b.length === 0) {\n return true;\n }\n\n return a === b;\n};\n/**\r\n * Returns whether object/array is shallow equal.\r\n * Considers empty object/arrays as equal (whether top-level or second-level).\r\n */\n\n\nconst isShallowEqual = (objA, objB, comparators, debug = false) => {\n const aKeys = Object.keys(objA);\n const bKeys = Object.keys(objB);\n\n if (aKeys.length !== bKeys.length) {\n if (debug) {\n console.warn(`%cisShallowEqual: objects don't have same properties ->`, \"color: #8B4000\", objA, objB);\n }\n\n return false;\n }\n\n if (comparators && Array.isArray(comparators)) {\n for (const key of comparators) {\n const ret = objA[key] === objB[key] || _defaultIsShallowComparatorFallback(objA[key], objB[key]);\n\n if (!ret) {\n if (debug) {\n console.warn(`%cisShallowEqual: ${key} not equal ->`, \"color: #8B4000\", objA[key], objB[key]);\n }\n\n return false;\n }\n }\n\n return true;\n }\n\n return aKeys.every(key => {\n const comparator = comparators === null || comparators === void 0 ? void 0 : comparators[key];\n const ret = comparator ? comparator(objA[key], objB[key]) : objA[key] === objB[key] || _defaultIsShallowComparatorFallback(objA[key], objB[key]);\n\n if (!ret && debug) {\n console.warn(`%cisShallowEqual: ${key} not equal ->`, \"color: #8B4000\", objA[key], objB[key]);\n }\n\n return ret;\n });\n}; // taken from Radix UI\n// https://github.com/radix-ui/primitives/blob/main/packages/core/primitive/src/primitive.tsx\n\nconst composeEventHandlers = (originalEventHandler, ourEventHandler, {\n checkForDefaultPrevented = true\n} = {}) => {\n return function handleEvent(event) {\n originalEventHandler === null || originalEventHandler === void 0 ? void 0 : originalEventHandler(event);\n\n if (!checkForDefaultPrevented || !(event === null || event === void 0 ? void 0 : event.defaultPrevented)) {\n return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event);\n }\n };\n};\n/**\r\n * supply `null` as message if non-never value is valid, you just need to\r\n * typecheck against it\r\n */\n\nconst assertNever = (value, message, softAssert) => {\n if (!message) {\n return value;\n }\n\n if (softAssert) {\n console.error(message);\n return value;\n }\n\n throw new Error(message);\n};\nfunction invariant(condition, message) {\n if (!condition) {\n throw new Error(message);\n }\n}\n/**\r\n * Memoizes on values of `opts` object (strict equality).\r\n */\n\nconst memoize = func => {\n let lastArgs;\n let lastResult;\n\n const ret = function (opts) {\n const currentArgs = Object.entries(opts);\n\n if (lastArgs) {\n let argsAreEqual = true;\n\n for (const [key, value] of currentArgs) {\n if (lastArgs.get(key) !== value) {\n argsAreEqual = false;\n break;\n }\n }\n\n if (argsAreEqual) {\n return lastResult;\n }\n }\n\n const result = func(opts);\n lastArgs = new Map(currentArgs);\n lastResult = result;\n return result;\n };\n\n ret.clear = () => {\n lastArgs = undefined;\n lastResult = undefined;\n };\n\n return ret;\n};\n/** Checks if value is inside given collection. Useful for type-safety. */\n\nconst isMemberOf = (\n/** Set/Map/Array/Object */\ncollection,\n/** value to look for */\nvalue) => {\n return collection instanceof Set || collection instanceof Map ? collection.has(value) : \"includes\" in collection ? collection.includes(value) : collection.hasOwnProperty(value);\n};\nconst cloneJSON = obj => JSON.parse(JSON.stringify(obj));\nconst updateStable = (prevValue, nextValue) => {\n if (isShallowEqual(prevValue, nextValue)) {\n return prevValue;\n }\n\n return nextValue;\n}; // implem\n\nfunction addEventListener(\n/**\r\n * allows for falsy values so you don't have to type check when adding\r\n * event listeners to optional elements\r\n */\ntarget, type, listener, options) {\n var _a;\n\n if (!target) {\n return () => {};\n }\n\n (_a = target === null || target === void 0 ? void 0 : target.addEventListener) === null || _a === void 0 ? void 0 : _a.call(target, type, listener, options);\n return () => {\n var _a;\n\n (_a = target === null || target === void 0 ? void 0 : target.removeEventListener) === null || _a === void 0 ? void 0 : _a.call(target, type, listener, options);\n };\n}\nfunction getSvgPathFromStroke(points, closed = true) {\n const len = points.length;\n\n if (len < 4) {\n return ``;\n }\n\n let a = points[0];\n let b = points[1];\n const c = points[2];\n let result = `M${a[0].toFixed(2)},${a[1].toFixed(2)} Q${b[0].toFixed(2)},${b[1].toFixed(2)} ${(0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_0__.average)(b[0], c[0]).toFixed(2)},${(0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_0__.average)(b[1], c[1]).toFixed(2)} T`;\n\n for (let i = 2, max = len - 1; i < max; i++) {\n a = points[i];\n b = points[i + 1];\n result += `${(0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_0__.average)(a[0], b[0]).toFixed(2)},${(0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_0__.average)(a[1], b[1]).toFixed(2)} `;\n }\n\n if (closed) {\n result += \"Z\";\n }\n\n return result;\n}\nconst normalizeEOL = str => {\n return str.replace(/\\r?\\n|\\r/g, \"\\n\");\n};\n/**\r\n * Makes type into a branded type, ensuring that value is assignable to\r\n * the base ubranded type. Optionally you can explicitly supply current value\r\n * type to combine both (useful for composite branded types. Make sure you\r\n * compose branded types which are not composite themselves.)\r\n */\n\nconst toBrandedType = value => {\n return value;\n}; // -----------------------------------------------------------------------------\n// Promise.try, adapted from https://github.com/sindresorhus/p-try\n\nconst promiseTry = async (fn, ...args) => {\n return new Promise(resolve => {\n resolve(fn(...args));\n });\n};\nconst isAnyTrue = (...args) => Math.max(...args.map(arg => arg ? 1 : 0)) > 0;\nconst safelyParseJSON = json => {\n try {\n return JSON.parse(json);\n } catch (_a) {\n return null;\n }\n};\n/**\r\n * use when you need to render unsafe string as HTML attribute, but MAKE SURE\r\n * the attribute is double-quoted when constructing the HTML string\r\n */\n\nconst escapeDoubleQuotes = str => {\n return str.replace(/\"/g, \""\");\n};\nconst castArray = value => Array.isArray(value) ? value : [value];\n/** hack for Array.isArray type guard not working with readonly value[] */\n\nconst isReadonlyArray = value => {\n return Array.isArray(value);\n};\nconst sizeOf = value => {\n return isReadonlyArray(value) ? value.length : value instanceof Map || value instanceof Set ? value.size : Object.keys(value).length;\n};\nconst reduceToCommonValue = (collection, getValue) => {\n if (sizeOf(collection) === 0) {\n return null;\n }\n\n const valueExtractor = getValue || (item => item);\n\n let commonValue = null;\n\n for (const item of collection) {\n const value = valueExtractor(item);\n\n if ((commonValue === null || commonValue === value) && value != null) {\n commonValue = value;\n } else {\n return null;\n }\n }\n\n return commonValue;\n};\n\n//# sourceURL=webpack://ExcalidrawLib/../common/src/utils.ts?");
|
|
13095
13095
|
|
|
13096
13096
|
/***/ }),
|
|
13097
13097
|
|
|
@@ -14235,7 +14235,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
14235
14235
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
14236
14236
|
|
|
14237
14237
|
"use strict";
|
|
14238
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ trackEvent: () => (/* binding */ trackEvent)\n/* harmony export */ });\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n// place here categories that you want to track. We want to track just a\n // small subset of categories at a given time.\n\nconst ALLOWED_CATEGORIES_TO_TRACK = new Set([\"command_palette\", \"export\"]);\nconst trackEvent = (category, action, label, value) => {\n try {\n if (typeof window === \"undefined\" || ({\"MODE\":\"development\",\"VITE_APP_BACKEND_V2_GET_URL\":\"https://json-dev.excalidraw.com/api/v2/\",\"VITE_APP_BACKEND_V2_POST_URL\":\"https://json-dev.excalidraw.com/api/v2/post/\",\"VITE_APP_LIBRARY_URL\":\"https://libraries.excalidraw.com\",\"VITE_APP_LIBRARY_BACKEND\":\"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries\",\"VITE_APP_WS_SERVER_URL\":\"http://localhost:3002\",\"VITE_APP_PLUS_LP\":\"https://plus.excalidraw.com\",\"VITE_APP_PLUS_APP\":\"http://localhost:3000\",\"VITE_APP_AI_BACKEND\":\"http://localhost:3015\",\"VITE_APP_FIREBASE_CONFIG\":\"{\\\"apiKey\\\":\\\"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8\\\",\\\"authDomain\\\":\\\"excalidraw-oss-dev.firebaseapp.com\\\",\\\"projectId\\\":\\\"excalidraw-oss-dev\\\",\\\"storageBucket\\\":\\\"excalidraw-oss-dev.appspot.com\\\",\\\"messagingSenderId\\\":\\\"664559512677\\\",\\\"appId\\\":\\\"1:664559512677:web:a385181f2928d328a7aa8c\\\"}\",\"VITE_APP_DEV_DISABLE_LIVE_RELOAD\":\"\",\"VITE_APP_ENABLE_TRACKING\":\"true\",\"FAST_REFRESH\":\"false\",\"VITE_APP_PORT\":\"3000\",\"VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX\":\"\",\"VITE_APP_COLLAPSE_OVERLAY\":\"true\",\"VITE_APP_ENABLE_ESLINT\":\"true\",\"VITE_APP_ENABLE_PWA\":\"false\",\"VITE_APP_PLUS_EXPORT_PUBLIC_KEY\":\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\\nHQIDAQAB\",\"VITE_APP_DISABLE_PREVENT_UNLOAD\":\"\",\"VITE_PKG_NAME\":\"@zsviczian/excalidraw\",\"VITE_PKG_VERSION\":\"0.18.0-
|
|
14238
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ trackEvent: () => (/* binding */ trackEvent)\n/* harmony export */ });\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n// place here categories that you want to track. We want to track just a\n // small subset of categories at a given time.\n\nconst ALLOWED_CATEGORIES_TO_TRACK = new Set([\"command_palette\", \"export\"]);\nconst trackEvent = (category, action, label, value) => {\n try {\n if (typeof window === \"undefined\" || ({\"MODE\":\"development\",\"VITE_APP_BACKEND_V2_GET_URL\":\"https://json-dev.excalidraw.com/api/v2/\",\"VITE_APP_BACKEND_V2_POST_URL\":\"https://json-dev.excalidraw.com/api/v2/post/\",\"VITE_APP_LIBRARY_URL\":\"https://libraries.excalidraw.com\",\"VITE_APP_LIBRARY_BACKEND\":\"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries\",\"VITE_APP_WS_SERVER_URL\":\"http://localhost:3002\",\"VITE_APP_PLUS_LP\":\"https://plus.excalidraw.com\",\"VITE_APP_PLUS_APP\":\"http://localhost:3000\",\"VITE_APP_AI_BACKEND\":\"http://localhost:3015\",\"VITE_APP_FIREBASE_CONFIG\":\"{\\\"apiKey\\\":\\\"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8\\\",\\\"authDomain\\\":\\\"excalidraw-oss-dev.firebaseapp.com\\\",\\\"projectId\\\":\\\"excalidraw-oss-dev\\\",\\\"storageBucket\\\":\\\"excalidraw-oss-dev.appspot.com\\\",\\\"messagingSenderId\\\":\\\"664559512677\\\",\\\"appId\\\":\\\"1:664559512677:web:a385181f2928d328a7aa8c\\\"}\",\"VITE_APP_DEV_DISABLE_LIVE_RELOAD\":\"\",\"VITE_APP_ENABLE_TRACKING\":\"true\",\"FAST_REFRESH\":\"false\",\"VITE_APP_PORT\":\"3000\",\"VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX\":\"\",\"VITE_APP_COLLAPSE_OVERLAY\":\"true\",\"VITE_APP_ENABLE_ESLINT\":\"true\",\"VITE_APP_ENABLE_PWA\":\"false\",\"VITE_APP_PLUS_EXPORT_PUBLIC_KEY\":\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\\nHQIDAQAB\",\"VITE_APP_DISABLE_PREVENT_UNLOAD\":\"\",\"VITE_PKG_NAME\":\"@zsviczian/excalidraw\",\"VITE_PKG_VERSION\":\"0.18.0-51\",\"VITE_IS_EXCALIDRAW_NPM_PACKAGE\":true}).VITE_WORKER_ID || \"true\" !== \"true\") {\n return;\n }\n\n if (!ALLOWED_CATEGORIES_TO_TRACK.has(category)) {\n return;\n }\n\n if ((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.isDevEnv)()) {\n // comment out to debug in dev\n return;\n }\n\n if (true) {\n console.info(\"trackEvent\", {\n category,\n action,\n label,\n value\n });\n }\n\n if (window.sa_event) {\n window.sa_event(action, {\n category,\n label,\n value\n });\n }\n } catch (error) {\n console.error(\"error during analytics\", error);\n }\n};\n\n//# sourceURL=webpack://ExcalidrawLib/./analytics.ts?");
|
|
14239
14239
|
|
|
14240
14240
|
/***/ }),
|
|
14241
14241
|
|
|
@@ -14345,7 +14345,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
14345
14345
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
14346
14346
|
|
|
14347
14347
|
"use strict";
|
|
14348
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ExcalidrawContainerContext: () => (/* binding */ ExcalidrawContainerContext),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */ useApp: () => (/* binding */ useApp),\n/* harmony export */ useAppProps: () => (/* binding */ useAppProps),\n/* harmony export */ useEditorInterface: () => (/* binding */ useEditorInterface),\n/* harmony export */ useExcalidrawActionManager: () => (/* binding */ useExcalidrawActionManager),\n/* harmony export */ useExcalidrawAppState: () => (/* binding */ useExcalidrawAppState),\n/* harmony export */ useExcalidrawContainer: () => (/* binding */ useExcalidrawContainer),\n/* harmony export */ useExcalidrawElements: () => (/* binding */ useExcalidrawElements),\n/* harmony export */ useExcalidrawSetAppState: () => (/* binding */ useExcalidrawSetAppState),\n/* harmony export */ useStylesPanelMode: () => (/* binding */ useStylesPanelMode)\n/* harmony export */ });\n/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ \"../../node_modules/clsx/dist/clsx.m.js\");\n/* harmony import */ var lodash_throttle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash.throttle */ \"../../node_modules/lodash.throttle/index.js\");\n/* harmony import */ var lodash_throttle__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_throttle__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-dom */ \"react-dom\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var roughjs_bin_rough__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! roughjs/bin/rough */ \"../../node_modules/roughjs/bin/rough.js\");\n/* harmony import */ var nanoid__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(/*! nanoid */ \"./node_modules/nanoid/index.browser.js\");\n/* harmony import */ var _excalidraw_math__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @excalidraw/math */ \"../math/src/index.ts\");\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n/* harmony import */ var _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @excalidraw/element */ \"../element/src/index.ts\");\n/* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../actions */ \"./actions/index.ts\");\n/* harmony import */ var _actions_actionBoundText__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../actions/actionBoundText */ \"./actions/actionBoundText.tsx\");\n/* harmony import */ var _actions_actionCanvas__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../actions/actionCanvas */ \"./actions/actionCanvas.tsx\");\n/* harmony import */ var _actions_actionClipboard__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../actions/actionClipboard */ \"./actions/actionClipboard.tsx\");\n/* harmony import */ var _actions_actionElementLink__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../actions/actionElementLink */ \"./actions/actionElementLink.ts\");\n/* harmony import */ var _actions_actionElementLock__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../actions/actionElementLock */ \"./actions/actionElementLock.ts\");\n/* harmony import */ var _actions_actionFrame__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../actions/actionFrame */ \"./actions/actionFrame.ts\");\n/* harmony import */ var _actions_actionHistory__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../actions/actionHistory */ \"./actions/actionHistory.tsx\");\n/* harmony import */ var _actions_actionTextAutoResize__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../actions/actionTextAutoResize */ \"./actions/actionTextAutoResize.ts\");\n/* harmony import */ var _actions_actionToggleViewMode__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../actions/actionToggleViewMode */ \"./actions/actionToggleViewMode.tsx\");\n/* harmony import */ var _actions_manager__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../actions/manager */ \"./actions/manager.tsx\");\n/* harmony import */ var _actions_register__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../actions/register */ \"./actions/register.ts\");\n/* harmony import */ var _actions_shortcuts__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../actions/shortcuts */ \"./actions/shortcuts.ts\");\n/* harmony import */ var _analytics__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../analytics */ \"./analytics.ts\");\n/* harmony import */ var _animation_frame_handler__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../animation-frame-handler */ \"./animation-frame-handler.ts\");\n/* harmony import */ var _appState__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../appState */ \"./appState.ts\");\n/* harmony import */ var _clipboard__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../clipboard */ \"./clipboard.ts\");\n/* harmony import */ var _data__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../data */ \"./data/index.ts\");\n/* harmony import */ var _data_library__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../data/library */ \"./data/library.ts\");\n/* harmony import */ var _data_restore__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../data/restore */ \"./data/restore.ts\");\n/* harmony import */ var _gesture__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../gesture */ \"./gesture.ts\");\n/* harmony import */ var _history__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../history */ \"./history.ts\");\n/* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../i18n */ \"./i18n.ts\");\n/* harmony import */ var _scene__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../scene */ \"./scene/index.ts\");\n/* harmony import */ var _scene_zoom__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../scene/zoom */ \"./scene/zoom.ts\");\n/* harmony import */ var _data_blob__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../data/blob */ \"./data/blob.ts\");\n/* harmony import */ var _data_filesystem__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../data/filesystem */ \"./data/filesystem.ts\");\n/* harmony import */ var _components_hyperlink_Hyperlink__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../components/hyperlink/Hyperlink */ \"./components/hyperlink/Hyperlink.tsx\");\n/* harmony import */ var _fonts__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../fonts */ \"./fonts/index.ts\");\n/* harmony import */ var _editor_jotai__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ../editor-jotai */ \"./editor-jotai.ts\");\n/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ../errors */ \"./errors.ts\");\n/* harmony import */ var _snapping__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ../snapping */ \"./snapping.ts\");\n/* harmony import */ var _data_transform__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ../data/transform */ \"./data/transform.ts\");\n/* harmony import */ var _scene_Renderer__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ../scene/Renderer */ \"./scene/Renderer.ts\");\n/* harmony import */ var _cursor__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ../cursor */ \"./cursor.ts\");\n/* harmony import */ var _components_ElementCanvasButtons__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ../components/ElementCanvasButtons */ \"./components/ElementCanvasButtons.tsx\");\n/* harmony import */ var _laser_trails__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ../laser-trails */ \"./laser-trails.ts\");\n/* harmony import */ var _reactUtils__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ../reactUtils */ \"./reactUtils.ts\");\n/* harmony import */ var _wysiwyg_textWysiwyg__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ../wysiwyg/textWysiwyg */ \"./wysiwyg/textWysiwyg.tsx\");\n/* harmony import */ var _scene_scrollbars__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ../scene/scrollbars */ \"./scene/scrollbars.ts\");\n/* harmony import */ var _mermaid__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ../mermaid */ \"./mermaid.ts\");\n/* harmony import */ var _lasso__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ../lasso */ \"./lasso/index.ts\");\n/* harmony import */ var _eraser__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ../eraser */ \"./eraser/index.ts\");\n/* harmony import */ var _shortcut__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ../shortcut */ \"./shortcut.ts\");\n/* harmony import */ var _ConvertElementTypePopup__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./ConvertElementTypePopup */ \"./components/ConvertElementTypePopup.tsx\");\n/* harmony import */ var _ActiveConfirmDialog__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./ActiveConfirmDialog */ \"./components/ActiveConfirmDialog.tsx\");\n/* harmony import */ var _BraveMeasureTextError__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./BraveMeasureTextError */ \"./components/BraveMeasureTextError.tsx\");\n/* harmony import */ var _ContextMenu__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./ContextMenu */ \"./components/ContextMenu.tsx\");\n/* harmony import */ var _EyeDropper__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./EyeDropper */ \"./components/EyeDropper.tsx\");\n/* harmony import */ var _FollowMode_FollowMode__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./FollowMode/FollowMode */ \"./components/FollowMode/FollowMode.tsx\");\n/* harmony import */ var _LayerUI__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./LayerUI */ \"./components/LayerUI.tsx\");\n/* harmony import */ var _MagicButton__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./MagicButton */ \"./components/MagicButton.tsx\");\n/* harmony import */ var _SVGLayer__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./SVGLayer */ \"./components/SVGLayer.tsx\");\n/* harmony import */ var _SearchMenu__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./SearchMenu */ \"./components/SearchMenu.tsx\");\n/* harmony import */ var _Sidebar_Sidebar__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./Sidebar/Sidebar */ \"./components/Sidebar/Sidebar.tsx\");\n/* harmony import */ var _canvases__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ./canvases */ \"./components/canvases/index.tsx\");\n/* harmony import */ var _canvases_NewElementCanvas__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ./canvases/NewElementCanvas */ \"./components/canvases/NewElementCanvas.tsx\");\n/* harmony import */ var _hyperlink_helpers__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(/*! ./hyperlink/helpers */ \"./components/hyperlink/helpers.ts\");\n/* harmony import */ var _icons__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(/*! ./icons */ \"./components/icons.tsx\");\n/* harmony import */ var _Toast__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(/*! ./Toast */ \"./components/Toast.tsx\");\n/* harmony import */ var _shapes__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(/*! ./shapes */ \"./components/shapes.tsx\");\n/* harmony import */ var _UnlockPopup__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(/*! ./UnlockPopup */ \"./components/UnlockPopup.tsx\");\n/* harmony import */ var _obsidianUtils__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(/*! ../obsidianUtils */ \"./obsidianUtils.ts\");\n/* harmony import */ var _Tooltip__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(/*! ./Tooltip */ \"./components/Tooltip.tsx\");\n/* harmony import */ var _actions_actionProperties__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(/*! ../actions/actionProperties */ \"./actions/actionProperties.tsx\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst AppContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createContext(null);\nconst AppPropsContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createContext(null);\nconst editorInterfaceContextInitialValue = {\n formFactor: \"desktop\",\n desktopUIMode: \"full\",\n userAgent: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.createUserAgentDescriptor)(typeof navigator !== \"undefined\" ? navigator.userAgent : \"\"),\n isTouchScreen: false,\n preferTrayMode: false,\n canFitSidebar: false,\n isLandscape: true\n};\nconst EditorInterfaceContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createContext(editorInterfaceContextInitialValue);\nEditorInterfaceContext.displayName = \"EditorInterfaceContext\";\nconst ExcalidrawContainerContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createContext({\n container: null,\n id: null\n});\nExcalidrawContainerContext.displayName = \"ExcalidrawContainerContext\";\nconst ExcalidrawElementsContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createContext([]);\nExcalidrawElementsContext.displayName = \"ExcalidrawElementsContext\";\nconst ExcalidrawAppStateContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createContext(Object.assign(Object.assign({}, (0,_appState__WEBPACK_IMPORTED_MODULE_23__.getDefaultAppState)()), {\n width: 0,\n height: 0,\n offsetLeft: 0,\n offsetTop: 0\n}));\nExcalidrawAppStateContext.displayName = \"ExcalidrawAppStateContext\";\nconst ExcalidrawSetAppStateContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createContext(() => {\n console.warn(\"Uninitialized ExcalidrawSetAppStateContext context!\");\n});\nExcalidrawSetAppStateContext.displayName = \"ExcalidrawSetAppStateContext\";\nconst ExcalidrawActionManagerContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createContext(null);\nExcalidrawActionManagerContext.displayName = \"ExcalidrawActionManagerContext\";\nconst useApp = () => (0,react__WEBPACK_IMPORTED_MODULE_2__.useContext)(AppContext);\nconst useAppProps = () => (0,react__WEBPACK_IMPORTED_MODULE_2__.useContext)(AppPropsContext);\nconst useEditorInterface = () => (0,react__WEBPACK_IMPORTED_MODULE_2__.useContext)(EditorInterfaceContext);\nconst useStylesPanelMode = () => (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.deriveStylesPanelMode)(useEditorInterface());\nconst useExcalidrawContainer = () => (0,react__WEBPACK_IMPORTED_MODULE_2__.useContext)(ExcalidrawContainerContext);\nconst useExcalidrawElements = () => (0,react__WEBPACK_IMPORTED_MODULE_2__.useContext)(ExcalidrawElementsContext);\nconst useExcalidrawAppState = () => (0,react__WEBPACK_IMPORTED_MODULE_2__.useContext)(ExcalidrawAppStateContext);\nconst useExcalidrawSetAppState = () => (0,react__WEBPACK_IMPORTED_MODULE_2__.useContext)(ExcalidrawSetAppStateContext);\nconst useExcalidrawActionManager = () => (0,react__WEBPACK_IMPORTED_MODULE_2__.useContext)(ExcalidrawActionManagerContext);\nlet didTapTwice = false;\nlet tappedTwiceTimer = 0;\nlet firstTapPosition = null;\nlet isHoldingSpace = false;\nlet isPanning = false;\nlet isDraggingScrollBar = false;\nlet currentScrollBars = {\n horizontal: null,\n vertical: null\n};\nlet touchTimeout = 0;\nlet invalidateContextMenu = false;\n/**\r\n * Map of youtube embed video states\r\n */\n\nconst YOUTUBE_VIDEO_STATES = new Map();\nlet IS_PLAIN_PASTE = false;\nlet IS_PLAIN_PASTE_TIMER = 0;\nlet PLAIN_PASTE_TOAST_SHOWN = false;\nlet lastPointerUp = null;\nconst gesture = {\n pointers: new Map(),\n lastCenter: null,\n initialDistance: null,\n initialScale: null\n};\n\nclass App extends (react__WEBPACK_IMPORTED_MODULE_2___default().Component) {\n constructor(props) {\n super(props);\n this.interactiveCanvas = null;\n this.unmounted = false;\n this.editorInterface = editorInterfaceContextInitialValue;\n this.stylesPanelMode = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.deriveStylesPanelMode)(editorInterfaceContextInitialValue);\n this.excalidrawContainerRef = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createRef();\n this.shouldRenderAllEmbeddables = false; //zsviczian\n\n this.files = {};\n this.imageCache = new Map();\n this.iFrameRefs = new Map();\n /**\r\n * Indicates whether the embeddable's url has been validated for rendering.\r\n * If value not set, indicates that the validation is pending.\r\n * Initially or on url change the flag is not reset so that we can guarantee\r\n * the validation came from a trusted source (the editor).\r\n **/\n\n this.embedsValidationStatus = new Map();\n /** embeds that have been inserted to DOM (as a perf optim, we don't want to\r\n * insert to DOM before user initially scrolls to them) */\n\n this.initializedEmbeds = new Set();\n\n this.handleToastClose = () => {\n this.setToast(null);\n };\n\n this.elementsPendingErasure = new Set();\n this.flowChartCreator = new _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.FlowChartCreator();\n this.flowChartNavigator = new _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.FlowChartNavigator();\n this.lastPointerDownEvent = null;\n this.lastPointerUpEvent = null;\n this.lastPointerMoveEvent = null;\n this.lastPointerMoveCoords = null;\n this.lastViewportPosition = {\n x: 0,\n y: 0\n };\n this.allowMobileMode = true; //zsviczian\n\n this.animationFrameHandler = new _animation_frame_handler__WEBPACK_IMPORTED_MODULE_22__.AnimationFrameHandler();\n this.laserTrails = new _laser_trails__WEBPACK_IMPORTED_MODULE_44__.LaserTrails(this.animationFrameHandler, this);\n this.eraserTrail = new _eraser__WEBPACK_IMPORTED_MODULE_50__.EraserTrail(this.animationFrameHandler, this);\n this.lassoTrail = new _lasso__WEBPACK_IMPORTED_MODULE_49__.LassoTrail(this.animationFrameHandler, this);\n this.onChangeEmitter = new _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.Emitter();\n this.onPointerDownEmitter = new _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.Emitter();\n this.onPointerUpEmitter = new _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.Emitter();\n this.onUserFollowEmitter = new _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.Emitter();\n this.onScrollChangeEmitter = new _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.Emitter();\n this.missingPointerEventCleanupEmitter = new _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.Emitter();\n this.onRemoveEventListenersEmitter = new _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.Emitter();\n\n this.updateEditorAtom = (atom, ...args) => {\n const result = _editor_jotai__WEBPACK_IMPORTED_MODULE_37__.editorJotaiStore.set(atom, ...args);\n this.triggerRender();\n return result;\n };\n /**\r\n * Returns gridSize taking into account `gridModeEnabled`.\r\n * If disabled, returns null.\r\n */\n\n\n this.getEffectiveGridSize = () => {\n return (0,_snapping__WEBPACK_IMPORTED_MODULE_39__.isGridModeEnabled)(this) ? this.state.gridSize : null;\n };\n\n this.updateEmbedValidationStatus = (element, status) => {\n this.embedsValidationStatus.set(element.id, status);\n _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.ShapeCache.delete(element);\n };\n\n this.updateEmbeddables = () => {\n const iframeLikes = new Set();\n let updated = false;\n this.scene.getNonDeletedElements().filter(element => {\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isEmbeddableElement)(element)) {\n iframeLikes.add(element.id);\n\n if (!this.embedsValidationStatus.has(element.id)) {\n updated = true;\n const validated = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.embeddableURLValidator)(element.link, this.props.validateEmbeddable);\n this.updateEmbedValidationStatus(element, validated);\n }\n } else if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isIframeElement)(element)) {\n iframeLikes.add(element.id);\n }\n\n return false;\n });\n\n if (updated) {\n this.scene.triggerUpdate();\n } // GC\n\n\n this.iFrameRefs.forEach((ref, id) => {\n if (!iframeLikes.has(id)) {\n this.iFrameRefs.delete(id);\n }\n });\n };\n\n this.getFrameNameDOMId = frameElement => {\n return `${this.id}-frame-name-${frameElement.id}`;\n };\n\n this.frameNameBoundsCache = {\n get: frameElement => {\n let bounds = this.frameNameBoundsCache._cache.get(frameElement.id);\n\n if (!bounds || bounds.zoom !== this.state.zoom.value || bounds.versionNonce !== frameElement.versionNonce) {\n const frameNameDiv = document.getElementById(this.getFrameNameDOMId(frameElement));\n\n if (frameNameDiv) {\n const box = frameNameDiv.getBoundingClientRect();\n const boxSceneTopLeft = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)({\n clientX: box.x,\n clientY: box.y\n }, this.state);\n const boxSceneBottomRight = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)({\n clientX: box.right,\n clientY: box.bottom\n }, this.state);\n bounds = {\n x: boxSceneTopLeft.x,\n y: boxSceneTopLeft.y,\n width: boxSceneBottomRight.x - boxSceneTopLeft.x,\n height: boxSceneBottomRight.y - boxSceneTopLeft.y,\n angle: 0,\n zoom: this.state.zoom.value,\n versionNonce: frameElement.versionNonce\n };\n\n this.frameNameBoundsCache._cache.set(frameElement.id, bounds);\n\n return bounds;\n }\n\n return null;\n }\n\n return bounds;\n },\n\n /**\r\n * @private\r\n */\n _cache: new Map()\n };\n\n this.resetEditingFrame = frame => {\n var _a;\n\n if (frame) {\n this.scene.mutateElement(frame, {\n name: ((_a = frame.name) === null || _a === void 0 ? void 0 : _a.trim()) || null\n });\n }\n\n this.setState({\n editingFrame: null\n });\n };\n\n this.renderFrameNames = () => {\n var _a;\n\n if (!this.state.frameRendering.enabled || !this.state.frameRendering.name) {\n if (this.state.editingFrame) {\n this.resetEditingFrame(null);\n }\n\n return null;\n }\n\n const isDarkTheme = this.state.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.THEME.DARK; //zsviczian\n\n const nonDeletedFramesLikes = this.state.frameRendering.markerName && this.state.frameRendering.markerEnabled ? this.scene.getNonDeletedFramesLikes() : this.scene.getNonDeletedFramesLikes().filter(f => f.frameRole !== \"marker\");\n const focusedSearchMatch = nonDeletedFramesLikes.length > 0 ? ((_a = this.state.searchMatches) === null || _a === void 0 ? void 0 : _a.focusedId) && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isFrameLikeElement)(this.scene.getElement(this.state.searchMatches.focusedId)) ? this.state.searchMatches.matches.find(sm => sm.focus) : null : null;\n return nonDeletedFramesLikes.map(f => {\n var _a, _b;\n\n if (!(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElementInViewport)(f, this.canvas.width / window.devicePixelRatio, this.canvas.height / window.devicePixelRatio, {\n offsetLeft: this.state.offsetLeft,\n offsetTop: this.state.offsetTop,\n scrollX: this.state.scrollX,\n scrollY: this.state.scrollY,\n zoom: this.state.zoom\n }, this.scene.getNonDeletedElementsMap())) {\n if (this.state.editingFrame === f.id) {\n this.resetEditingFrame(f);\n } // if frame not visible, don't render its name\n\n\n return null;\n }\n\n const {\n x: x1,\n y: y1\n } = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.sceneCoordsToViewportCoords)({\n sceneX: f.x,\n sceneY: f.y\n }, this.state);\n const FRAME_NAME_EDIT_PADDING = 6;\n let frameNameJSX;\n const frameName = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getFrameLikeTitle)(f);\n\n if (f.id === this.state.editingFrame) {\n const frameNameInEdit = frameName;\n frameNameJSX = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"input\", {\n autoFocus: true,\n value: frameNameInEdit,\n onChange: e => {\n this.scene.mutateElement(f, {\n name: e.target.value\n });\n },\n onFocus: e => e.target.select(),\n onBlur: () => this.resetEditingFrame(f),\n onKeyDown: event => {\n // for some inexplicable reason, `onBlur` triggered on ESC\n // does not reset `state.editingFrame` despite being called,\n // and we need to reset it here as well\n if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.ESCAPE || event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.ENTER) {\n this.resetEditingFrame(f);\n }\n },\n style: {\n background: this.state.viewBackgroundColor,\n filter: isDarkTheme ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.THEME_FILTER : \"none\",\n zIndex: 2,\n border: \"none\",\n display: \"block\",\n padding: `${FRAME_NAME_EDIT_PADDING}px`,\n borderRadius: 4,\n boxShadow: \"inset 0 0 0 2px var(--color-on-primary-container)\",\n fontFamily: \"Assistant\",\n fontSize: `${_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.FRAME_STYLE.nameFontSize}px`,\n transform: `translate(-${FRAME_NAME_EDIT_PADDING}px, ${FRAME_NAME_EDIT_PADDING}px)`,\n color: \"var(--color-gray-80)\",\n overflow: \"hidden\",\n maxWidth: `${(0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_70__.getExcalidrawContentEl)().clientWidth - x1 - FRAME_NAME_EDIT_PADDING //zsviczian was document.body\n }px`\n },\n size: frameNameInEdit.length + 1 || 1,\n dir: \"auto\",\n autoComplete: \"off\",\n autoCapitalize: \"off\",\n autoCorrect: \"off\"\n });\n } else {\n frameNameJSX = frameName;\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n id: this.getFrameNameDOMId(f),\n key: f.id,\n style: {\n position: \"absolute\",\n // Positioning from bottom so that we don't to either\n // calculate text height or adjust using transform (which)\n // messes up input position when editing the frame name.\n // This makes the positioning deterministic and we can calculate\n // the same position when rendering to canvas / svg.\n bottom: `${this.state.height + _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.FRAME_STYLE.nameOffsetY - y1 + this.state.offsetTop}px`,\n left: `${x1 - this.state.offsetLeft}px`,\n zIndex: 2,\n fontSize: _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.FRAME_STYLE.nameFontSize,\n color: (_b = (_a = this.state.frameColor) === null || _a === void 0 ? void 0 : _a.nameColor) !== null && _b !== void 0 ? _b : isDarkTheme //zsviczian\n ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.FRAME_STYLE.nameColorDarkTheme : _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.FRAME_STYLE.nameColorLightTheme,\n lineHeight: _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.FRAME_STYLE.nameLineHeight,\n width: \"max-content\",\n maxWidth: (focusedSearchMatch === null || focusedSearchMatch === void 0 ? void 0 : focusedSearchMatch.id) === f.id && (focusedSearchMatch === null || focusedSearchMatch === void 0 ? void 0 : focusedSearchMatch.focus) ? \"none\" : `${f.width * this.state.zoom.value}px`,\n overflow: f.id === this.state.editingFrame ? \"visible\" : \"hidden\",\n whiteSpace: \"nowrap\",\n textOverflow: \"ellipsis\",\n cursor: _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.MOVE,\n pointerEvents: this.state.viewModeEnabled ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.POINTER_EVENTS.disabled : _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.POINTER_EVENTS.enabled\n },\n onPointerDown: event => this.handleCanvasPointerDown(event),\n onWheel: event => this.handleWheel(event),\n onContextMenu: this.handleCanvasContextMenu,\n onDoubleClick: () => {\n this.setState({\n editingFrame: f.id\n });\n }\n }, frameNameJSX);\n });\n };\n\n this.focusContainer = () => {\n var _a;\n\n (_a = this.excalidrawContainerRef.current) === null || _a === void 0 ? void 0 : _a.focus();\n };\n\n this.getSceneElementsIncludingDeleted = () => {\n return this.scene.getElementsIncludingDeleted();\n };\n\n this.getSceneElementsMapIncludingDeleted = () => {\n return this.scene.getElementsMapIncludingDeleted();\n };\n\n this.getSceneElements = () => {\n return this.scene.getNonDeletedElements();\n };\n\n this.onInsertElements = elements => {\n this.addElementsFromPasteOrLibrary({\n elements,\n position: \"center\",\n files: null\n });\n };\n\n this.onExportImage = async (type, elements, opts) => {\n (0,_analytics__WEBPACK_IMPORTED_MODULE_21__.trackEvent)(\"export\", type, \"ui\");\n const fileHandle = await (0,_data__WEBPACK_IMPORTED_MODULE_25__.exportCanvas)(type, elements, this.state, this.files, {\n exportBackground: this.state.exportBackground,\n name: this.getName(),\n viewBackgroundColor: this.state.viewBackgroundColor,\n exportingFrame: opts.exportingFrame\n }).catch(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.muteFSAbortError).catch(error => {\n console.error(error);\n this.setState({\n errorMessage: error.message\n });\n });\n\n if (this.state.exportEmbedScene && fileHandle && (0,_data_blob__WEBPACK_IMPORTED_MODULE_33__.isImageFileHandle)(fileHandle)) {\n this.setState({\n fileHandle\n });\n }\n };\n\n this.magicGenerations = new Map();\n\n this.updateMagicGeneration = ({\n frameElement,\n data\n }) => {\n if (data.status === \"pending\") {\n // We don't wanna persist pending state to storage. It should be in-app\n // state only.\n // Thus reset so that we prefer local cache (if there was some\n // generationData set previously)\n this.scene.mutateElement(frameElement, {\n customData: {\n generationData: undefined\n }\n }, {\n informMutation: false,\n isDragging: false\n });\n } else {\n this.scene.mutateElement(frameElement, {\n customData: {\n generationData: data\n }\n }, {\n informMutation: false,\n isDragging: false\n });\n }\n\n this.magicGenerations.set(frameElement.id, data);\n this.triggerRender();\n };\n\n this.plugins = {};\n\n this.onMagicframeToolSelect = () => {\n const selectedElements = this.scene.getSelectedElements({\n selectedElementIds: this.state.selectedElementIds\n });\n\n if (selectedElements.length === 0) {\n this.setActiveTool({\n type: _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.TOOL_TYPE.magicframe\n });\n (0,_analytics__WEBPACK_IMPORTED_MODULE_21__.trackEvent)(\"ai\", \"tool-select (empty-selection)\", \"d2c\");\n } else {\n const selectedMagicFrame = selectedElements.length === 1 && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isMagicFrameElement)(selectedElements[0]) && selectedElements[0]; // case: user selected elements containing frame-like(s) or are frame\n // members, we don't want to wrap into another magicframe\n // (unless the only selected element is a magic frame which we reuse)\n\n if (!selectedMagicFrame && selectedElements.some(el => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isFrameLikeElement)(el) || el.frameId)) {\n this.setActiveTool({\n type: _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.TOOL_TYPE.magicframe\n });\n return;\n }\n\n (0,_analytics__WEBPACK_IMPORTED_MODULE_21__.trackEvent)(\"ai\", \"tool-select (existing selection)\", \"d2c\");\n let frame;\n\n if (selectedMagicFrame) {\n // a single magicframe already selected -> use it\n frame = selectedMagicFrame;\n } else {\n // selected elements aren't wrapped in magic frame yet -> wrap now\n const [minX, minY, maxX, maxY] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getCommonBounds)(selectedElements);\n const padding = 50;\n frame = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newMagicFrameElement)(Object.assign(Object.assign({}, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.FRAME_STYLE), {\n x: minX - padding,\n y: minY - padding,\n width: maxX - minX + padding * 2,\n height: maxY - minY + padding * 2,\n opacity: 100,\n locked: false\n }));\n this.scene.insertElement(frame);\n\n for (const child of selectedElements) {\n this.scene.mutateElement(child, {\n frameId: frame.id\n });\n }\n\n this.setState({\n selectedElementIds: {\n [frame.id]: true\n }\n });\n }\n\n this.onMagicFrameGenerate(frame, \"upstream\");\n }\n };\n\n this.openEyeDropper = ({\n type\n }) => {\n this.updateEditorAtom(_EyeDropper__WEBPACK_IMPORTED_MODULE_56__.activeEyeDropperAtom, {\n swapPreviewOnAlt: true,\n colorPickerType: type === \"stroke\" ? \"elementStroke\" : \"elementBackground\",\n onSelect: (color, event) => {\n const shouldUpdateStrokeColor = type === \"background\" && event.altKey || type === \"stroke\" && !event.altKey;\n const selectedElements = this.scene.getSelectedElements(this.state);\n\n if (!selectedElements.length || this.state.activeTool.type !== \"selection\") {\n if (shouldUpdateStrokeColor) {\n this.syncActionResult({\n appState: Object.assign(Object.assign({}, this.state), {\n currentItemStrokeColor: color\n }),\n captureUpdate: _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.CaptureUpdateAction.IMMEDIATELY\n });\n } else {\n this.syncActionResult({\n appState: Object.assign(Object.assign({}, this.state), {\n currentItemBackgroundColor: color\n }),\n captureUpdate: _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.CaptureUpdateAction.IMMEDIATELY\n });\n }\n } else {\n this.updateScene({\n elements: this.scene.getElementsIncludingDeleted().map(el => {\n if (this.state.selectedElementIds[el.id]) {\n return (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newElementWith)(el, {\n [shouldUpdateStrokeColor ? \"strokeColor\" : \"backgroundColor\"]: color\n });\n }\n\n return el;\n }),\n captureUpdate: _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.CaptureUpdateAction.IMMEDIATELY\n });\n }\n },\n keepOpenOnAlt: false\n });\n };\n\n this.dismissLinearEditor = () => {\n setTimeout(() => {\n var _a;\n\n if ((_a = this.state.selectedLinearElement) === null || _a === void 0 ? void 0 : _a.isEditing) {\n this.setState({\n selectedLinearElement: Object.assign(Object.assign({}, this.state.selectedLinearElement), {\n isEditing: false\n })\n });\n }\n });\n };\n\n this.syncActionResult = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(actionResult => {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n\n if (this.unmounted || actionResult === false) {\n return;\n }\n\n this.store.scheduleAction(actionResult.captureUpdate);\n let didUpdate = false;\n let editingTextElement = null;\n\n if (actionResult.elements) {\n this.scene.replaceAllElements(actionResult.elements);\n didUpdate = true;\n }\n\n if (actionResult.files) {\n this.addMissingFiles(actionResult.files, actionResult.replaceFiles);\n this.addNewImagesToImageCache();\n }\n\n if (actionResult.appState || editingTextElement || this.state.contextMenu) {\n let viewModeEnabled = ((_a = actionResult === null || actionResult === void 0 ? void 0 : actionResult.appState) === null || _a === void 0 ? void 0 : _a.viewModeEnabled) || false;\n let zenModeEnabled = ((_b = actionResult === null || actionResult === void 0 ? void 0 : actionResult.appState) === null || _b === void 0 ? void 0 : _b.zenModeEnabled) || false;\n const theme = ((_c = actionResult === null || actionResult === void 0 ? void 0 : actionResult.appState) === null || _c === void 0 ? void 0 : _c.theme) || this.props.theme || _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.THEME.LIGHT;\n const name = (_e = (_d = actionResult === null || actionResult === void 0 ? void 0 : actionResult.appState) === null || _d === void 0 ? void 0 : _d.name) !== null && _e !== void 0 ? _e : this.state.name;\n const errorMessage = (_g = (_f = actionResult === null || actionResult === void 0 ? void 0 : actionResult.appState) === null || _f === void 0 ? void 0 : _f.errorMessage) !== null && _g !== void 0 ? _g : this.state.errorMessage;\n\n if (typeof this.props.viewModeEnabled !== \"undefined\") {\n viewModeEnabled = this.props.viewModeEnabled;\n }\n\n if (typeof this.props.zenModeEnabled !== \"undefined\") {\n zenModeEnabled = this.props.zenModeEnabled;\n }\n\n editingTextElement = ((_h = actionResult.appState) === null || _h === void 0 ? void 0 : _h.editingTextElement) || null; // make sure editingTextElement points to latest element reference\n\n if (actionResult.elements && editingTextElement) {\n actionResult.elements.forEach(element => {\n if ((editingTextElement === null || editingTextElement === void 0 ? void 0 : editingTextElement.id) === element.id && editingTextElement !== element && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isNonDeletedElement)(element) && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isTextElement)(element)) {\n editingTextElement = element;\n }\n });\n }\n\n if (editingTextElement === null || editingTextElement === void 0 ? void 0 : editingTextElement.isDeleted) {\n editingTextElement = null;\n }\n\n this.setState(prevAppState => {\n const actionAppState = actionResult.appState || {};\n return Object.assign(Object.assign(Object.assign({}, prevAppState), actionAppState), {\n // NOTE this will prevent opening context menu using an action\n // or programmatically from the host, so it will need to be\n // rewritten later\n contextMenu: null,\n editingTextElement,\n viewModeEnabled,\n zenModeEnabled,\n theme,\n name,\n errorMessage\n });\n });\n didUpdate = true;\n }\n\n if (!didUpdate) {\n this.scene.triggerUpdate();\n }\n }); // Lifecycle\n\n this.onBlur = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(() => {\n isHoldingSpace = false;\n this.setState({\n isBindingEnabled: true\n });\n });\n\n this.onUnload = () => {\n this.onBlur();\n };\n\n this.disableEvent = event => {\n event.preventDefault();\n };\n\n this.resetHistory = () => {\n this.history.clear();\n };\n\n this.resetStore = () => {\n this.store.clear();\n };\n /**\r\n * Resets scene & history.\r\n * ! Do not use to clear scene user action !\r\n */\n\n\n this.resetScene = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(opts => {\n this.scene.replaceAllElements([]);\n this.setState(state => Object.assign(Object.assign({}, (0,_appState__WEBPACK_IMPORTED_MODULE_23__.getDefaultAppState)()), {\n isLoading: (opts === null || opts === void 0 ? void 0 : opts.resetLoadingState) ? false : state.isLoading,\n theme: this.state.theme\n }));\n this.resetStore();\n this.resetHistory();\n });\n\n this.initializeScene = async () => {\n var _a;\n\n if (\"launchQueue\" in window && \"LaunchParams\" in window) {\n window.launchQueue.setConsumer(async launchParams => {\n if (!launchParams.files.length) {\n return;\n }\n\n const fileHandle = launchParams.files[0];\n const blob = await fileHandle.getFile();\n this.loadFileToCanvas(new File([blob], blob.name || \"\", {\n type: blob.type\n }), fileHandle);\n });\n }\n\n if (this.props.theme) {\n this.setState({\n theme: this.props.theme\n });\n }\n\n if (!this.state.isLoading) {\n this.setState({\n isLoading: true\n });\n }\n\n let initialData = null;\n\n try {\n if (typeof this.props.initialData === \"function\") {\n initialData = (await this.props.initialData()) || null;\n } else {\n initialData = (await this.props.initialData) || null;\n }\n\n if (initialData === null || initialData === void 0 ? void 0 : initialData.libraryItems) {\n this.library.updateLibrary({\n libraryItems: initialData.libraryItems,\n merge: true\n }).catch(error => {\n console.error(error);\n });\n }\n } catch (error) {\n console.error(error);\n initialData = {\n appState: {\n errorMessage: error.message || \"Encountered an error during importing or restoring scene data\"\n }\n };\n }\n\n const scene = (0,_data_restore__WEBPACK_IMPORTED_MODULE_27__.restore)(initialData, null, null, {\n repairBindings: true,\n deleteInvisibleElements: true\n });\n const activeTool = scene.appState.activeTool;\n\n if (!scene.appState.preferredSelectionTool.initialized) {\n scene.appState.preferredSelectionTool = {\n type: this.editorInterface.formFactor === \"phone\" ? \"lasso\" : \"selection\",\n initialized: true\n };\n }\n\n scene.appState = Object.assign(Object.assign({}, scene.appState), {\n theme: this.props.theme || scene.appState.theme,\n // we're falling back to current (pre-init) state when deciding\n // whether to open the library, to handle a case where we\n // update the state outside of initialData (e.g. when loading the app\n // with a library install link, which should auto-open the library)\n openSidebar: ((_a = scene.appState) === null || _a === void 0 ? void 0 : _a.openSidebar) || this.state.openSidebar,\n activeTool: activeTool.type === \"image\" || activeTool.type === \"lasso\" || activeTool.type === \"selection\" ? Object.assign(Object.assign({}, activeTool), {\n type: scene.appState.preferredSelectionTool.type\n }) : scene.appState.activeTool,\n isLoading: false,\n toast: this.state.toast\n });\n\n if (initialData === null || initialData === void 0 ? void 0 : initialData.scrollToContent) {\n scene.appState = Object.assign(Object.assign({}, scene.appState), (0,_scene__WEBPACK_IMPORTED_MODULE_31__.calculateScrollCenter)(scene.elements, Object.assign(Object.assign({}, scene.appState), {\n width: this.state.width,\n height: this.state.height,\n offsetTop: this.state.offsetTop,\n offsetLeft: this.state.offsetLeft\n })));\n }\n\n this.resetStore();\n this.resetHistory();\n this.syncActionResult(Object.assign(Object.assign({}, scene), {\n captureUpdate: _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.CaptureUpdateAction.NEVER\n })); // clear the shape and image cache so that any images in initialData\n // can be loaded fresh\n\n this.clearImageShapeCache(); // manually loading the font faces seems faster even in browsers that do fire the loadingdone event\n\n this.fonts.loadSceneFonts().then(fontFaces => {\n this.fonts.onLoaded(fontFaces);\n });\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElementLink)(window.location.href)) {\n this.scrollToContent(window.location.href, {\n animate: false\n });\n }\n };\n\n this.getFormFactor = (editorWidth, editorHeight) => {\n var _a;\n\n return (_a = this.props.UIOptions.formFactor) !== null && _a !== void 0 ? _a : (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getFormFactor)(editorWidth, editorHeight);\n };\n\n this.refreshEditorInterface = preferTrayMode => {\n var _a, _b;\n\n const container = this.excalidrawContainerRef.current;\n\n if (!container) {\n return;\n }\n\n const {\n width: editorWidth,\n height: editorHeight\n } = container.getBoundingClientRect();\n const storedDesktopUIMode = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.loadDesktopUIModePreference)();\n const userAgentDescriptor = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.createUserAgentDescriptor)(typeof navigator !== \"undefined\" ? navigator.userAgent : \"\"); // allow host app to control formFactor and desktopUIMode via props\n\n const sidebarBreakpoint = this.props.UIOptions.dockedSidebarBreakpoint != null ? this.props.UIOptions.dockedSidebarBreakpoint : _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.MQ_RIGHT_SIDEBAR_MIN_WIDTH;\n const nextEditorInterface = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateObject)(this.editorInterface, {\n desktopUIMode: preferTrayMode ? \"tray\" : //zsviczian\n (_b = (_a = this.props.UIOptions.desktopUIMode) !== null && _a !== void 0 ? _a : storedDesktopUIMode) !== null && _b !== void 0 ? _b : this.editorInterface.desktopUIMode,\n formFactor: this.getFormFactor(editorWidth, editorHeight),\n userAgent: userAgentDescriptor,\n canFitSidebar: editorWidth > sidebarBreakpoint,\n isLandscape: editorWidth > editorHeight,\n preferTrayMode: preferTrayMode !== null && preferTrayMode !== void 0 ? preferTrayMode : this.editorInterface.preferTrayMode //zsviczian\n\n });\n this.editorInterface = nextEditorInterface;\n this.reconcileStylesPanelMode(nextEditorInterface);\n };\n\n this.reconcileStylesPanelMode = nextEditorInterface => {\n const nextStylesPanelMode = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.deriveStylesPanelMode)(nextEditorInterface);\n\n if (nextStylesPanelMode === this.stylesPanelMode) {\n return;\n }\n\n const prevStylesPanelMode = this.stylesPanelMode;\n this.stylesPanelMode = nextStylesPanelMode;\n\n if (prevStylesPanelMode !== \"full\" && nextStylesPanelMode === \"full\" || prevStylesPanelMode !== \"tray\" && nextStylesPanelMode === \"tray\" //zsviczian\n ) {\n this.setState(prevState => ({\n preferredSelectionTool: {\n type: \"selection\",\n initialized: true\n }\n }));\n }\n };\n /** TO BE USED LATER */\n\n\n this.setDesktopUIMode = mode => {\n const nextMode = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.setDesktopUIMode)(mode);\n this.editorInterface = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateObject)(this.editorInterface, {\n desktopUIMode: nextMode\n });\n this.reconcileStylesPanelMode(this.editorInterface);\n }; //zsviczian\n\n\n this.isTouchScreen = () => {\n return this.editorInterface.isTouchScreen;\n }; //zsviczian\n\n\n this.setTrayModeEnabled = enabled => {\n const container = this.excalidrawContainerRef.current;\n\n if (!container) {\n return;\n }\n\n if (this.editorInterface.formFactor === \"phone\") {\n enabled = false;\n }\n\n if (this.editorInterface.preferTrayMode === enabled && this.editorInterface.desktopUIMode === \"tray\") {\n return;\n }\n\n this.refreshEditorInterface(enabled);\n this.triggerRender();\n (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.setDesktopUIMode)(this.editorInterface.desktopUIMode);\n }; //zsviczian\n\n\n this.isTrayModeEnabled = () => {\n return this.editorInterface.preferTrayMode;\n };\n\n this.onResize = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(() => {\n this.scene.getElementsIncludingDeleted().forEach(element => _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.ShapeCache.delete(element));\n this.refreshEditorInterface();\n this.updateDOMRect();\n this.setState({});\n });\n /** generally invoked only if fullscreen was invoked programmatically */\n\n this.onFullscreenChange = () => {\n var _a;\n\n if ( // points to the iframe element we fullscreened\n !document.fullscreenElement && ((_a = this.state.activeEmbeddable) === null || _a === void 0 ? void 0 : _a.state) === \"active\") {\n this.setState({\n activeEmbeddable: null\n });\n }\n };\n\n this.renderInteractiveSceneCallback = ({\n atLeastOneVisibleElement,\n scrollBars,\n elementsMap\n }) => {\n if (!document.querySelector(\".excalidraw\")) {\n return;\n } //zsviczian - address issue when moving excalidraw to a new window/document\n\n\n if (scrollBars) {\n currentScrollBars = scrollBars;\n }\n\n const scrolledOutside = // hide when editing text\n this.state.editingTextElement ? false : !atLeastOneVisibleElement && elementsMap.size > 0;\n\n if (this.state.scrolledOutside !== scrolledOutside) {\n this.setState({\n scrolledOutside\n });\n }\n\n this.scheduleImageRefresh();\n };\n\n this.onScroll = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.debounce)(() => {\n const {\n offsetTop,\n offsetLeft\n } = this.getCanvasOffsets();\n this.setState(state => {\n if (state.offsetLeft === offsetLeft && state.offsetTop === offsetTop) {\n return null;\n }\n\n return {\n offsetTop,\n offsetLeft\n };\n });\n }, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.SCROLL_TIMEOUT); // Copy/paste\n\n this.onCut = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(event => {\n var _a;\n\n const isExcalidrawActive = (_a = this.excalidrawContainerRef.current) === null || _a === void 0 ? void 0 : _a.contains(document.activeElement);\n\n if (!isExcalidrawActive || (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isWritableElement)(event.target)) {\n return;\n }\n\n this.actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_8__.actionCut, \"keyboard\", event);\n event.preventDefault();\n event.stopPropagation();\n });\n this.onCopy = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(event => {\n var _a;\n\n const isExcalidrawActive = (_a = this.excalidrawContainerRef.current) === null || _a === void 0 ? void 0 : _a.contains(document.activeElement);\n\n if (!isExcalidrawActive || (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isWritableElement)(event.target)) {\n return;\n }\n\n this.actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_8__.actionCopy, \"keyboard\", event);\n event.preventDefault();\n event.stopPropagation();\n });\n\n this.onTouchStart = event => {\n // fix for Apple Pencil Scribble (do not prevent for other devices)\n if (_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isIOS) {\n event.preventDefault();\n }\n\n if (!didTapTwice) {\n didTapTwice = true;\n\n if (event.touches.length === 1) {\n firstTapPosition = {\n x: event.touches[0].clientX,\n y: event.touches[0].clientY\n };\n }\n\n clearTimeout(tappedTwiceTimer);\n tappedTwiceTimer = window.setTimeout(App.resetTapTwice, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.TAP_TWICE_TIMEOUT);\n return;\n } // insert text only if we tapped twice with a single finger at approximately the same position\n // event.touches.length === 1 will also prevent inserting text when user's zooming\n\n\n if (didTapTwice && event.touches.length === 1 && firstTapPosition) {\n const touch = event.touches[0];\n const distance = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointDistance)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(touch.clientX, touch.clientY), (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(firstTapPosition.x, firstTapPosition.y)); // only create text if the second tap is within the threshold of the first tap\n // this prevents accidental text creation during dragging/selection\n\n if (distance <= _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.DOUBLE_TAP_POSITION_THRESHOLD) {\n // end lasso trail and deselect elements just in case\n this.lassoTrail.endPath();\n this.deselectElements(); // @ts-ignore\n\n this.handleCanvasDoubleClick({\n clientX: touch.clientX,\n clientY: touch.clientY\n });\n }\n\n didTapTwice = false;\n clearTimeout(tappedTwiceTimer);\n }\n\n if (event.touches.length === 2) {\n this.setState({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)({}, this.state),\n activeEmbeddable: null\n });\n }\n };\n\n this.onTouchEnd = event => {\n this.resetContextMenuTimer();\n\n if (event.touches.length > 0) {\n this.setState({\n previousSelectedElementIds: {},\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)(this.state.previousSelectedElementIds, this.state)\n });\n } else {\n gesture.pointers.clear();\n }\n };\n\n this.pasteFromClipboard = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(async event => {\n var _a;\n\n const isPlainPaste = !!IS_PLAIN_PASTE; // #686\n\n const target = document.activeElement;\n const isExcalidrawActive = (_a = this.excalidrawContainerRef.current) === null || _a === void 0 ? void 0 : _a.contains(target);\n\n if (event && !isExcalidrawActive) {\n return;\n }\n\n const elementUnderCursor = document.elementFromPoint(this.lastViewportPosition.x, this.lastViewportPosition.y);\n\n if (event && (!(elementUnderCursor instanceof HTMLCanvasElement) || (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isWritableElement)(target))) {\n return;\n } // must be called in the same frame (thus before any awaits) as the paste\n // event else some browsers (FF...) will clear the clipboardData\n // (something something security)\n\n\n const dataTransferList = await (0,_clipboard__WEBPACK_IMPORTED_MODULE_24__.parseDataTransferEvent)(event);\n const filesList = dataTransferList.getFiles();\n const data = await (0,_clipboard__WEBPACK_IMPORTED_MODULE_24__.parseClipboard)(dataTransferList, isPlainPaste);\n\n if (this.props.onPaste) {\n try {\n if ((await this.props.onPaste(data, event)) === false) {\n return;\n }\n } catch (error) {\n console.error(error);\n }\n }\n\n await this.insertClipboardContent(data, filesList, isPlainPaste);\n this.setActiveTool({\n type: this.state.preferredSelectionTool.type\n }, true);\n event === null || event === void 0 ? void 0 : event.preventDefault();\n });\n\n this.addElementsFromPasteOrLibrary = opts => {\n var _a, _b;\n\n const elements = (0,_data_restore__WEBPACK_IMPORTED_MODULE_27__.restoreElements)(opts.elements, null, {\n deleteInvisibleElements: true\n });\n const [minX, minY, maxX, maxY] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getCommonBounds)(elements);\n const elementsCenterX = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.distance)(minX, maxX) / 2;\n const elementsCenterY = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.distance)(minY, maxY) / 2;\n const clientX = typeof opts.position === \"object\" ? opts.position.clientX : opts.position === \"cursor\" ? this.lastViewportPosition.x : this.state.width / 2 + this.state.offsetLeft;\n const clientY = typeof opts.position === \"object\" ? opts.position.clientY : opts.position === \"cursor\" ? this.lastViewportPosition.y : this.state.height / 2 + this.state.offsetTop;\n const {\n x,\n y\n } = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)({\n clientX,\n clientY\n }, this.state);\n const dx = x - elementsCenterX;\n const dy = y - elementsCenterY;\n const [gridX, gridY] = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(dx, dy, this.getEffectiveGridSize());\n const {\n duplicatedElements\n } = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.duplicateElements)({\n type: \"everything\",\n elements: elements.map(element => {\n return (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newElementWith)(element, {\n x: element.x + gridX - minX,\n y: element.y + gridY - minY\n });\n }),\n randomizeSeed: !opts.retainSeed\n });\n const prevElements = this.scene.getElementsIncludingDeleted();\n let nextElements = [...prevElements, ...duplicatedElements];\n const mappedNewSceneElements = (_b = (_a = this.props).onDuplicate) === null || _b === void 0 ? void 0 : _b.call(_a, nextElements, prevElements);\n nextElements = mappedNewSceneElements || nextElements;\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.syncMovedIndices)(nextElements, (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.arrayToMap)(duplicatedElements));\n const topLayerFrame = this.getTopLayerFrameAtSceneCoords({\n x,\n y\n });\n\n if (topLayerFrame) {\n const eligibleElements = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.filterElementsEligibleAsFrameChildren)(duplicatedElements, topLayerFrame);\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.addElementsToFrame)(nextElements, eligibleElements, topLayerFrame, this.state);\n }\n\n this.scene.replaceAllElements(nextElements);\n duplicatedElements.forEach(newElement => {\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isTextElement)(newElement) && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isBoundToContainer)(newElement)) {\n const container = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getContainerElement)(newElement, this.scene.getElementsMapIncludingDeleted());\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.redrawTextBoundingBox)(newElement, container, this.scene);\n }\n }); // paste event may not fire FontFace loadingdone event in Safari, hence loading font faces manually\n\n if (true) {\n //zsviczian - isSafari\n _fonts__WEBPACK_IMPORTED_MODULE_36__.Fonts.loadElementsFonts(duplicatedElements).then(fontFaces => {\n this.fonts.onLoaded(fontFaces);\n });\n }\n\n if (opts.files) {\n this.addMissingFiles(opts.files);\n }\n\n const nextElementsToSelect = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.excludeElementsInFramesFromSelection)(duplicatedElements);\n this.store.scheduleCapture();\n this.setState(Object.assign(Object.assign(Object.assign({}, this.state), {\n // keep sidebar (presumably the library) open if it's docked and\n // can fit.\n //\n // Note, we should close the sidebar only if we're dropping items\n // from library, not when pasting from clipboard. Alas.\n openSidebar: this.state.openSidebar && this.editorInterface.canFitSidebar && _editor_jotai__WEBPACK_IMPORTED_MODULE_37__.editorJotaiStore.get(_Sidebar_Sidebar__WEBPACK_IMPORTED_MODULE_62__.isSidebarDockedAtom) ? this.state.openSidebar : null\n }), (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.selectGroupsForSelectedElements)({\n editingGroupId: null,\n selectedElementIds: nextElementsToSelect.reduce((acc, element) => {\n if (!(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isBoundToContainer)(element)) {\n acc[element.id] = true;\n }\n\n return acc;\n }, {})\n }, this.scene.getNonDeletedElements(), this.state, this)), () => {\n if (opts.files) {\n this.addNewImagesToImageCache();\n }\n });\n this.setActiveTool({\n type: this.state.preferredSelectionTool.type\n }, true);\n\n if (opts.fitToContent) {\n this.scrollToContent(duplicatedElements, {\n fitToContent: true,\n canvasOffsets: this.getEditorUIOffsets()\n });\n }\n };\n\n this.setAppState = (state, callback) => {\n this.setState(state, callback);\n };\n\n this.removePointer = event => {\n if (touchTimeout) {\n this.resetContextMenuTimer();\n }\n\n gesture.pointers.delete(event.pointerId);\n };\n\n this.toggleLock = (source = \"ui\") => {\n if (!this.state.activeTool.locked) {\n (0,_analytics__WEBPACK_IMPORTED_MODULE_21__.trackEvent)(\"toolbar\", \"toggleLock\", `${source} (${this.editorInterface.formFactor === \"phone\" ? \"mobile\" : \"desktop\"})`);\n }\n\n this.setState(prevState => {\n return {\n activeTool: Object.assign(Object.assign(Object.assign({}, prevState.activeTool), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateActiveTool)(this.state, prevState.activeTool.locked ? {\n type: this.state.preferredSelectionTool.type\n } : prevState.activeTool)), {\n locked: !prevState.activeTool.locked\n })\n };\n });\n };\n\n this.updateFrameRendering = opts => {\n this.setState(prevState => {\n var _a, _b, _c, _d, _e, _f;\n\n const next = typeof opts === \"function\" ? opts(prevState.frameRendering) : opts;\n return {\n frameRendering: {\n enabled: (_a = next === null || next === void 0 ? void 0 : next.enabled) !== null && _a !== void 0 ? _a : prevState.frameRendering.enabled,\n clip: (_b = next === null || next === void 0 ? void 0 : next.clip) !== null && _b !== void 0 ? _b : prevState.frameRendering.clip,\n name: (_c = next === null || next === void 0 ? void 0 : next.name) !== null && _c !== void 0 ? _c : prevState.frameRendering.name,\n outline: (_d = next === null || next === void 0 ? void 0 : next.outline) !== null && _d !== void 0 ? _d : prevState.frameRendering.outline,\n //zsviczian\n markerName: (_e = next === null || next === void 0 ? void 0 : next.markerName) !== null && _e !== void 0 ? _e : prevState.frameRendering.markerName,\n markerEnabled: (_f = next === null || next === void 0 ? void 0 : next.markerEnabled) !== null && _f !== void 0 ? _f : prevState.frameRendering.markerEnabled\n }\n };\n });\n };\n\n this.togglePenMode = force => {\n this.setState(prevState => {\n return {\n penMode: force !== null && force !== void 0 ? force : !prevState.penMode,\n penDetected: true\n };\n });\n };\n\n this.onHandToolToggle = () => {\n //zsviczian added timeout because button won't select otherwise\n setTimeout(() => this.actionManager.executeAction(_actions_actionCanvas__WEBPACK_IMPORTED_MODULE_10__.actionToggleHandTool));\n };\n /**\r\n * Zooms on canvas viewport center\r\n */\n\n\n this.zoomCanvas = (\n /**\r\n * Decimal fraction, auto-clamped between MIN_ZOOM and MAX_ZOOM.\r\n * 1 = 100% zoom, 2 = 200% zoom, 0.5 = 50% zoom\r\n */\n value) => {\n this.setState(Object.assign({}, (0,_scene_zoom__WEBPACK_IMPORTED_MODULE_32__.getStateForZoom)({\n viewportX: this.state.width / 2 + this.state.offsetLeft,\n viewportY: this.state.height / 2 + this.state.offsetTop,\n nextZoom: (0,_scene__WEBPACK_IMPORTED_MODULE_31__.getNormalizedZoom)(value)\n }, this.state)));\n };\n\n this.cancelInProgressAnimation = null;\n\n this.scrollToContent = (\n /**\r\n * target to scroll to\r\n *\r\n * - string - id of element or group, or url containing elementLink\r\n * - ExcalidrawElement | ExcalidrawElement[] - element(s) objects\r\n */\n target = this.scene.getNonDeletedElements(), opts) => {\n var _a, _b, _c, _d;\n\n if (typeof target === \"string\") {\n let id;\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElementLink)(target)) {\n id = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.parseElementLinkFromURL)(target);\n } else {\n id = target;\n }\n\n if (id) {\n const elements = this.scene.getElementsFromId(id);\n\n if (elements === null || elements === void 0 ? void 0 : elements.length) {\n this.scrollToContent(elements, {\n fitToContent: (_a = opts === null || opts === void 0 ? void 0 : opts.fitToContent) !== null && _a !== void 0 ? _a : true,\n animate: (_b = opts === null || opts === void 0 ? void 0 : opts.animate) !== null && _b !== void 0 ? _b : true\n });\n } else if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElementLink)(target)) {\n this.setState({\n toast: {\n message: (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"elementLink.notFound\"),\n duration: 3000,\n closable: true\n }\n });\n }\n }\n\n return;\n }\n\n (_c = this.cancelInProgressAnimation) === null || _c === void 0 ? void 0 : _c.call(this); // convert provided target into ExcalidrawElement[] if necessary\n\n const targetElements = Array.isArray(target) ? target : [target];\n let zoom = this.state.zoom;\n let scrollX = this.state.scrollX;\n let scrollY = this.state.scrollY;\n\n if ((opts === null || opts === void 0 ? void 0 : opts.fitToContent) || (opts === null || opts === void 0 ? void 0 : opts.fitToViewport)) {\n const {\n appState\n } = (0,_actions_actionCanvas__WEBPACK_IMPORTED_MODULE_10__.zoomToFit)({\n canvasOffsets: opts.canvasOffsets,\n targetElements,\n appState: this.state,\n fitToViewport: !!(opts === null || opts === void 0 ? void 0 : opts.fitToViewport),\n viewportZoomFactor: opts === null || opts === void 0 ? void 0 : opts.viewportZoomFactor,\n minZoom: opts === null || opts === void 0 ? void 0 : opts.minZoom,\n maxZoom: opts === null || opts === void 0 ? void 0 : opts.maxZoom\n });\n zoom = appState.zoom;\n scrollX = appState.scrollX;\n scrollY = appState.scrollY;\n } else {\n // compute only the viewport location, without any zoom adjustment\n const scroll = (0,_scene__WEBPACK_IMPORTED_MODULE_31__.calculateScrollCenter)(targetElements, this.state);\n scrollX = scroll.scrollX;\n scrollY = scroll.scrollY;\n } // when animating, we use RequestAnimationFrame to prevent the animation\n // from slowing down other processes\n\n\n if (opts === null || opts === void 0 ? void 0 : opts.animate) {\n const origScrollX = this.state.scrollX;\n const origScrollY = this.state.scrollY;\n const origZoom = this.state.zoom.value;\n const cancel = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.easeToValuesRAF)({\n fromValues: {\n scrollX: origScrollX,\n scrollY: origScrollY,\n zoom: origZoom\n },\n toValues: {\n scrollX,\n scrollY,\n zoom: zoom.value\n },\n interpolateValue: (from, to, progress, key) => {\n // for zoom, use different easing\n if (key === \"zoom\") {\n return from * Math.pow(to / from, (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.easeOut)(progress));\n } // handle using default\n\n\n return undefined;\n },\n onStep: ({\n scrollX,\n scrollY,\n zoom\n }) => {\n this.setState({\n scrollX,\n scrollY,\n zoom: {\n value: zoom\n }\n });\n },\n onStart: () => {\n this.setState({\n shouldCacheIgnoreZoom: true\n });\n },\n onEnd: () => {\n this.setState({\n shouldCacheIgnoreZoom: false\n });\n },\n onCancel: () => {\n this.setState({\n shouldCacheIgnoreZoom: false\n });\n },\n duration: (_d = opts === null || opts === void 0 ? void 0 : opts.duration) !== null && _d !== void 0 ? _d : 500\n });\n\n this.cancelInProgressAnimation = () => {\n cancel();\n this.cancelInProgressAnimation = null;\n };\n } else {\n this.setState({\n scrollX,\n scrollY,\n zoom\n });\n }\n };\n\n this.maybeUnfollowRemoteUser = () => {\n if (this.state.userToFollow) {\n this.setState({\n userToFollow: null\n });\n }\n };\n /** use when changing scrollX/scrollY/zoom based on user interaction */\n\n\n this.translateCanvas = state => {\n var _a;\n\n (_a = this.cancelInProgressAnimation) === null || _a === void 0 ? void 0 : _a.call(this);\n this.maybeUnfollowRemoteUser();\n this.setState(state);\n }; //zsviczian\n\n\n this.setForceRenderAllEmbeddables = force => {\n this.shouldRenderAllEmbeddables = force;\n\n if (force) {\n this.setState({});\n }\n }; //zsviczian\n\n\n this.zoomToFit = (target = this.scene.getNonDeletedElements(), maxZoom, //null will zoom to max based on viewport\n margin = 0.03) => {\n if (typeof maxZoom === \"undefined\") {\n //zsviczian\n maxZoom = (0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_70__.getMaxZoom)();\n }\n\n if (!target) {\n target = this.scene.getNonDeletedElements();\n }\n\n if (target.length === 0) {\n maxZoom = 1;\n }\n\n this.setState((0,_actions_actionCanvas__WEBPACK_IMPORTED_MODULE_10__.zoomToFitElements)(target, this.state, false, this, maxZoom, margin).appState);\n }; //zsviczian\n\n\n this.getColorAtScenePoint = ({\n sceneX,\n sceneY\n }) => {\n if (!this.canvas) {\n console.error(\"Canvas not available\");\n return null;\n }\n\n const {\n x,\n y\n } = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.sceneCoordsToViewportCoords)({\n sceneX,\n sceneY\n }, this.state);\n const context = this.canvas.getContext(\"2d\");\n\n if (!context) {\n console.error(\"2D context not available\");\n return null;\n } // Get pixel data directly from the given scene coordinates\n\n\n const pixelData = context.getImageData(x, y, 1, 1).data;\n const [r, g, b, a] = pixelData; // Check for transparency\n\n if (a === 0) {\n return this.state.theme === \"light\" ? \"rgba(255,255,255,1)\" : \"rgba(0,0,0,1)\";\n } // Return the color in rgba format\n\n\n return `rgba(${r}, ${g}, ${b}, ${a / 255})`;\n }; //zsviczian\n\n\n this.startLineEditor = (el, selectedPointsIndices = null) => {\n if (!el || !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLinearElement)(el)) {\n return;\n } // First select the element\n\n\n this.setState({\n selectedElementIds: {\n [el.id]: true\n }\n }, () => {\n // Then set up the editor\n const linearElementEditor = new _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor(el, this.scene.getNonDeletedElementsMap());\n this.setState({\n selectedLinearElement: Object.assign(Object.assign({}, linearElementEditor), {\n isEditing: true,\n selectedPointsIndices\n })\n });\n });\n }; //zsviczian\n\n\n this.updateContainerSize = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(containers => {\n containers.forEach(element => {\n // Get absolute coordinates for the bottom-right corner\n const [x1, y1, x2, y2] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getResizedElementAbsoluteCoords)(element, element.width, element.height, true); // Get rotated pointer position at bottom-right corner\n\n const [pointerX, pointerY] = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointRotateRads)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(x2, y2), (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)((x1 + x2) / 2, (y1 + y2) / 2), element.angle);\n const {\n nextWidth,\n nextHeight\n } = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getNextSingleWidthAndHeightFromPointer)(element, element, \"se\", pointerX, pointerY);\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.resizeSingleElement)(nextWidth, nextHeight, element, element, this.scene.getElementsMapIncludingDeleted(), this.scene, \"se\", {\n shouldMaintainAspectRatio: true,\n shouldResizeFromCenter: false\n });\n });\n });\n\n this.setToast = toast => {\n this.setState({\n toast\n });\n };\n\n this.restoreFileFromShare = async () => {\n try {\n const webShareTargetCache = await caches.open(\"web-share-target\");\n const response = await webShareTargetCache.match(\"shared-file\");\n\n if (response) {\n const blob = await response.blob();\n const file = new File([blob], blob.name || \"\", {\n type: blob.type\n });\n this.loadFileToCanvas(file, null);\n await webShareTargetCache.delete(\"shared-file\");\n window.history.replaceState(null, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.APP_NAME, window.location.pathname);\n }\n } catch (error) {\n this.setState({\n errorMessage: error.message\n });\n }\n };\n /**\r\n * adds supplied files to existing files in the appState.\r\n * NOTE if file already exists in editor state, the file data is not updated\r\n * */\n\n\n this.addFiles = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(files => {\n const {\n addedFiles\n } = this.addMissingFiles(files, undefined, true); //zsviczian\n\n this.clearImageShapeCache(addedFiles);\n this.scene.triggerUpdate();\n this.addNewImagesToImageCache();\n }); //zsviczian\n\n this.debounceClearHighlightSearchResults = false;\n\n this.selectElements = (elements, highlightSearchResult = false) => {\n //zsviczian\n if (highlightSearchResult) {\n this.debounceClearHighlightSearchResults = true;\n setTimeout(() => {\n this.debounceClearHighlightSearchResults = false;\n }, 500);\n }\n\n this.updateScene({\n appState: Object.assign(Object.assign({}, this.state), {\n editingGroupId: null,\n selectedElementIds: elements.reduce((map, element) => {\n map[element.id] = true;\n return map;\n }, {}),\n highlightSearchResult\n }),\n captureUpdate: _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.CaptureUpdateAction.NEVER,\n forceFlushSync: true\n });\n }; //zsviczian\n\n\n this.bringToFront = elements => {\n this.selectElements(elements);\n this.updateScene(_actions__WEBPACK_IMPORTED_MODULE_8__.actionBringToFront.perform(this.scene.getNonDeletedElements(), this.state));\n }; //zsviczian\n\n\n this.bringForward = elements => {\n this.selectElements(elements);\n this.updateScene(_actions__WEBPACK_IMPORTED_MODULE_8__.actionBringForward.perform(this.scene.getNonDeletedElements(), this.state, undefined, this));\n }; //zsviczian\n\n\n this.sendToBack = elements => {\n this.selectElements(elements);\n this.updateScene(_actions__WEBPACK_IMPORTED_MODULE_8__.actionSendToBack.perform(this.scene.getNonDeletedElements(), this.state));\n }; //zsviczian\n\n\n this.sendBackward = elements => {\n this.selectElements(elements);\n this.updateScene(_actions__WEBPACK_IMPORTED_MODULE_8__.actionSendBackward.perform(this.scene.getNonDeletedElements(), this.state, undefined, this));\n };\n\n this.addMissingFiles = (files, replace = false, force = false) => {\n var _a;\n\n const nextFiles = replace ? {} : Object.assign({}, this.files);\n const addedFiles = {};\n\n const _files = Array.isArray(files) ? files : Object.values(files);\n\n for (const fileData of _files) {\n if (!force && nextFiles[fileData.id]) {\n //zsviczian\n continue;\n }\n\n addedFiles[fileData.id] = fileData;\n nextFiles[fileData.id] = fileData;\n\n if (fileData.mimeType === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.MIME_TYPES.svg) {\n try {\n const restoredDataURL = (0,_data_blob__WEBPACK_IMPORTED_MODULE_33__.getDataURL_sync)((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.normalizeSVG)((0,_data_blob__WEBPACK_IMPORTED_MODULE_33__.dataURLToString)(fileData.dataURL)), _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.MIME_TYPES.svg);\n\n if (fileData.dataURL !== restoredDataURL) {\n // bump version so persistence layer can update the store\n fileData.version = ((_a = fileData.version) !== null && _a !== void 0 ? _a : 1) + 1;\n fileData.dataURL = restoredDataURL;\n }\n } catch (error) {\n console.error(error);\n }\n }\n }\n\n this.files = nextFiles;\n return {\n addedFiles\n };\n };\n\n this.updateScene = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(sceneData => {\n const {\n elements,\n appState,\n collaborators,\n captureUpdate\n } = sceneData;\n\n if (captureUpdate) {\n const nextElements = elements ? elements : undefined;\n const observedAppState = appState ? (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getObservedAppState)(Object.assign(Object.assign({}, this.store.snapshot.appState), appState)) : undefined;\n this.store.scheduleMicroAction({\n action: captureUpdate,\n elements: nextElements,\n appState: observedAppState\n });\n } //zsviczian forceFlushSync is set to true in ExcalidrawView.updateScene.\n //without this e.g. text search did not select the elements\n\n\n if (sceneData.forceFlushSync === true) {\n (0,react_dom__WEBPACK_IMPORTED_MODULE_3__.flushSync)(() => {\n if (appState) {\n this.setState(appState);\n }\n });\n } else if (appState) {\n this.setState(appState);\n }\n\n if (elements) {\n this.scene.replaceAllElements(elements);\n }\n\n if (collaborators) {\n this.setState({\n collaborators\n });\n }\n });\n\n this.applyDeltas = (deltas, options) => {\n // squash all deltas together, starting with a fresh new delta instance\n const aggregatedDelta = _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.StoreDelta.squash(...deltas); // create new instance of elements map & appState, so we don't accidentaly mutate existing ones\n\n const nextAppState = Object.assign({}, this.state);\n const nextElements = new Map(this.scene.getElementsMapIncludingDeleted());\n return _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.StoreDelta.applyTo(aggregatedDelta, nextElements, nextAppState, options);\n };\n\n this.mutateElement = (element, updates, informMutation = true) => {\n return this.scene.mutateElement(element, updates, {\n informMutation,\n isDragging: false\n });\n };\n\n this.triggerRender = (\n /** force always re-renders canvas even if no change */\n force) => {\n if (force === true) {\n this.scene.triggerUpdate();\n } else {\n this.setState({});\n }\n };\n /**\r\n * @returns whether the menu was toggled on or off\r\n */\n\n\n this.toggleSidebar = ({\n name,\n tab,\n force\n }) => {\n var _a, _b;\n\n let nextName;\n\n if (force === undefined) {\n nextName = ((_a = this.state.openSidebar) === null || _a === void 0 ? void 0 : _a.name) === name && ((_b = this.state.openSidebar) === null || _b === void 0 ? void 0 : _b.tab) === tab ? null : name;\n } else {\n nextName = force ? name : null;\n }\n\n const nextState = nextName ? {\n name: nextName\n } : null;\n\n if (nextState && tab) {\n nextState.tab = tab;\n }\n\n this.setState({\n openSidebar: nextState\n });\n return !!nextName;\n };\n\n this.updateCurrentCursorPosition = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(event => {\n this.lastViewportPosition.x = event.clientX;\n this.lastViewportPosition.y = event.clientY;\n });\n\n this.getEditorUIOffsets = () => {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;\n\n const toolbarBottom = ((_e = (_d = (_c = (_b = (_a = this.excalidrawContainerRef) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.querySelector(\".App-toolbar\")) === null || _c === void 0 ? void 0 : _c.getBoundingClientRect()) === null || _d === void 0 ? void 0 : _d.bottom) !== null && _e !== void 0 ? _e : 0) - this.state.offsetTop;\n const sidebarRect = (_h = (_g = (_f = this.excalidrawContainerRef) === null || _f === void 0 ? void 0 : _f.current) === null || _g === void 0 ? void 0 : _g.querySelector(\".sidebar\")) === null || _h === void 0 ? void 0 : _h.getBoundingClientRect();\n const propertiesPanelRect = (_l = (_k = (_j = this.excalidrawContainerRef) === null || _j === void 0 ? void 0 : _j.current) === null || _k === void 0 ? void 0 : _k.querySelector(\".App-menu__left\")) === null || _l === void 0 ? void 0 : _l.getBoundingClientRect();\n const PADDING = 16;\n\n const adjustRectValueForOffset = ( //zsviczian https://github.com/excalidraw/excalidraw/issues/8561\n value, fallback) => (value !== null && value !== void 0 ? value : fallback + this.state.offsetLeft) - this.state.offsetLeft;\n\n return (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.getLanguage)().rtl ? {\n top: toolbarBottom + PADDING,\n right: Math.max(this.state.width - adjustRectValueForOffset( //zsivczian\n propertiesPanelRect === null || propertiesPanelRect === void 0 ? void 0 : propertiesPanelRect.left, this.state.width), 0) + PADDING,\n bottom: PADDING,\n //zsivczian\n left: Math.max(adjustRectValueForOffset(sidebarRect === null || sidebarRect === void 0 ? void 0 : sidebarRect.right, 0), 0) + PADDING\n } : {\n top: toolbarBottom + PADDING,\n right: Math.max(this.state.width - adjustRectValueForOffset(sidebarRect === null || sidebarRect === void 0 ? void 0 : sidebarRect.left, this.state.width) + //zsivczian\n PADDING, 0),\n bottom: PADDING,\n //zsivczian\n left: Math.max(adjustRectValueForOffset(propertiesPanelRect === null || propertiesPanelRect === void 0 ? void 0 : propertiesPanelRect.right, 0), 0) + PADDING\n };\n }; // Input handling\n\n\n this.onKeyDown = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(event => {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n\n if (this.state.activeTool.type === \"selection\" && this.state.resizingElement && (event.shiftKey || event.altKey)) {\n event.stopPropagation(); //zsviczian shift fires repeatedly causing slowdown when resizing sticky notes\n\n return;\n } // normalize `event.key` when CapsLock is pressed #2372\n\n\n if (\"Proxy\" in window && (!event.shiftKey && /^[A-Z]$/.test(event.key) || event.shiftKey && /^[a-z]$/.test(event.key))) {\n event = new Proxy(event, {\n get(ev, prop) {\n const value = ev[prop];\n\n if (typeof value === \"function\") {\n // fix for Proxies hijacking `this`\n return value.bind(ev);\n }\n\n return prop === \"key\" ? // CapsLock inverts capitalization based on ShiftKey, so invert\n // it back\n event.shiftKey ? ev.key.toUpperCase() : ev.key.toLowerCase() : value;\n }\n\n });\n }\n\n if (!(0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isInputLike)(event.target)) {\n if ((event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.ESCAPE || event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.ENTER) && this.state.croppingElementId) {\n this.finishImageCropping();\n return;\n }\n\n const selectedElements = (0,_scene__WEBPACK_IMPORTED_MODULE_31__.getSelectedElements)(this.scene.getNonDeletedElementsMap(), this.state);\n\n if (selectedElements.length === 1 && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isImageElement)(selectedElements[0]) && event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.ENTER) {\n this.startImageCropping(selectedElements[0]);\n return;\n } // Shape switching\n\n\n if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.ESCAPE) {\n this.updateEditorAtom(_ConvertElementTypePopup__WEBPACK_IMPORTED_MODULE_52__.convertElementTypePopupAtom, null);\n } else if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.TAB && (document.activeElement === ((_a = this.excalidrawContainerRef) === null || _a === void 0 ? void 0 : _a.current) || ((_b = document.activeElement) === null || _b === void 0 ? void 0 : _b.classList.contains(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CLASSES.CONVERT_ELEMENT_TYPE_POPUP)))) {\n event.preventDefault();\n const conversionType = (0,_ConvertElementTypePopup__WEBPACK_IMPORTED_MODULE_52__.getConversionTypeFromElements)(selectedElements);\n\n if (((_c = _editor_jotai__WEBPACK_IMPORTED_MODULE_37__.editorJotaiStore.get(_ConvertElementTypePopup__WEBPACK_IMPORTED_MODULE_52__.convertElementTypePopupAtom)) === null || _c === void 0 ? void 0 : _c.type) === \"panel\") {\n if ((0,_ConvertElementTypePopup__WEBPACK_IMPORTED_MODULE_52__.convertElementTypes)(this, {\n conversionType,\n direction: event.shiftKey ? \"left\" : \"right\"\n })) {\n this.store.scheduleCapture();\n }\n }\n\n if (conversionType) {\n this.updateEditorAtom(_ConvertElementTypePopup__WEBPACK_IMPORTED_MODULE_52__.convertElementTypePopupAtom, {\n type: \"panel\"\n });\n }\n }\n\n if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.ESCAPE && this.flowChartCreator.isCreatingChart) {\n this.flowChartCreator.clear();\n this.triggerRender(true);\n return;\n }\n\n const arrowKeyPressed = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isArrowKey)(event.key);\n\n if (event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] && arrowKeyPressed && !event.shiftKey) {\n event.preventDefault();\n const selectedElements = (0,_scene__WEBPACK_IMPORTED_MODULE_31__.getSelectedElements)(this.scene.getNonDeletedElementsMap(), this.state);\n\n if (selectedElements.length === 1 && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isFlowchartNodeElement)(selectedElements[0])) {\n this.flowChartCreator.createNodes(selectedElements[0], this.state, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getLinkDirectionFromKey)(event.key), this.scene);\n }\n\n if (((_d = this.flowChartCreator.pendingNodes) === null || _d === void 0 ? void 0 : _d.length) && !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElementCompletelyInViewport)(this.flowChartCreator.pendingNodes, this.canvas.width / window.devicePixelRatio, this.canvas.height / window.devicePixelRatio, {\n offsetLeft: this.state.offsetLeft,\n offsetTop: this.state.offsetTop,\n scrollX: this.state.scrollX,\n scrollY: this.state.scrollY,\n zoom: this.state.zoom\n }, this.scene.getNonDeletedElementsMap(), this.getEditorUIOffsets())) {\n this.scrollToContent(this.flowChartCreator.pendingNodes, {\n animate: true,\n duration: 300,\n fitToContent: true,\n canvasOffsets: this.getEditorUIOffsets()\n });\n }\n\n return;\n }\n\n if (event.altKey) {\n const selectedElements = (0,_scene__WEBPACK_IMPORTED_MODULE_31__.getSelectedElements)(this.scene.getNonDeletedElementsMap(), this.state);\n\n if (selectedElements.length === 1 && arrowKeyPressed) {\n event.preventDefault();\n const nextId = this.flowChartNavigator.exploreByDirection(selectedElements[0], this.scene.getNonDeletedElementsMap(), (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getLinkDirectionFromKey)(event.key));\n\n if (nextId) {\n this.setState(prevState => ({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)({\n [nextId]: true\n }, prevState)\n }));\n const nextNode = this.scene.getNonDeletedElementsMap().get(nextId);\n\n if (nextNode && !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElementCompletelyInViewport)([nextNode], this.canvas.width / window.devicePixelRatio, this.canvas.height / window.devicePixelRatio, {\n offsetLeft: this.state.offsetLeft,\n offsetTop: this.state.offsetTop,\n scrollX: this.state.scrollX,\n scrollY: this.state.scrollY,\n zoom: this.state.zoom\n }, this.scene.getNonDeletedElementsMap(), this.getEditorUIOffsets())) {\n this.scrollToContent(nextNode, {\n animate: true,\n duration: 300,\n canvasOffsets: this.getEditorUIOffsets()\n });\n }\n }\n\n return;\n }\n }\n }\n\n if (event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] && event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.P && !event.shiftKey && !event.altKey) {\n this.setToast({\n message: (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"commandPalette.shortcutHint\", {\n shortcut: (0,_actions_shortcuts__WEBPACK_IMPORTED_MODULE_20__.getShortcutFromShortcutName)(\"commandPalette\")\n })\n });\n event.preventDefault();\n return;\n }\n\n if (event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] && event.key.toLowerCase() === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.V) {\n IS_PLAIN_PASTE = event.shiftKey;\n clearTimeout(IS_PLAIN_PASTE_TIMER); // reset (100ms to be safe that we it runs after the ensuing\n // paste event). Though, technically unnecessary to reset since we\n // (re)set the flag before each paste event.\n\n IS_PLAIN_PASTE_TIMER = window.setTimeout(() => {\n IS_PLAIN_PASTE = false;\n }, 100);\n } // prevent browser zoom in input fields\n\n\n if (event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] && (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isWritableElement)(event.target)) {\n if (event.code === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CODES.MINUS || event.code === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CODES.EQUAL) {\n event.preventDefault();\n return;\n }\n } // bail if\n\n\n if ( // inside an input\n (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isWritableElement)(event.target) && // unless pressing escape (finalize action)\n event.key !== _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.ESCAPE || // or unless using arrows (to move between buttons)\n (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isArrowKey)(event.key) && (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isInputLike)(event.target)) {\n return;\n } //mfuria #329. open context menu with 'm' if not editing text and container focused\n\n\n if ((0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_70__.isPanWithRightMouseEnabled)() && event.key.toLowerCase() === 'm' && !this.state.editingTextElement && // don't trigger when typing in inputs\n !(0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isInputLike)(event.target) && ( // ensure focus is within excalidraw container\n (_f = (_e = this.excalidrawContainerRef) === null || _e === void 0 ? void 0 : _e.current) === null || _f === void 0 ? void 0 : _f.contains(document.activeElement))) {\n // open context menu at current cursor position\n const container = this.excalidrawContainerRef.current;\n const {\n top: offsetTop,\n left: offsetLeft\n } = container.getBoundingClientRect();\n const left = this.lastViewportPosition.x - offsetLeft;\n const top = this.lastViewportPosition.y - offsetTop;\n const {\n x,\n y\n } = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)({\n clientX: this.lastViewportPosition.x,\n clientY: this.lastViewportPosition.y\n }, this.state);\n const element = this.getElementAtPosition(x, y, {\n preferSelected: true,\n includeLockedElements: true\n });\n const selectedElements = this.scene.getSelectedElements(this.state);\n const isHittingCommonBoundBox = this.isHittingCommonBoundingBoxOfSelectedElements({\n x,\n y\n }, selectedElements);\n const type = element || isHittingCommonBoundBox ? 'element' : 'canvas';\n this.setState({\n contextMenu: {\n top,\n left,\n items: this.getContextMenuItems(type)\n }\n });\n event.preventDefault();\n return;\n }\n\n if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.QUESTION_MARK) {\n this.setState({\n openDialog: {\n name: \"help\"\n }\n });\n return;\n } else if (event.key.toLowerCase() === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.E && event.shiftKey && event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD]) {\n event.preventDefault();\n this.setState({\n openDialog: {\n name: \"imageExport\"\n }\n });\n return;\n }\n\n if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.PAGE_UP || event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.PAGE_DOWN) {\n let offset = (event.shiftKey ? this.state.width : this.state.height) / this.state.zoom.value;\n\n if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.PAGE_DOWN) {\n offset = -offset;\n }\n\n if (event.shiftKey) {\n this.translateCanvas(state => ({\n scrollX: state.scrollX + offset\n }));\n } else {\n this.translateCanvas(state => ({\n scrollY: state.scrollY + offset\n }));\n }\n }\n\n if (((_g = this.state.openDialog) === null || _g === void 0 ? void 0 : _g.name) === \"elementLinkSelector\") {\n return;\n }\n\n if (this.actionManager.handleKeyDown(event)) {\n return;\n }\n\n if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.K && !event.altKey && !event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD]) {\n if ((0,_appState__WEBPACK_IMPORTED_MODULE_23__.isLaserPointerActive)(this.state)) {\n this.setActiveTool({\n type: \"selection\"\n });\n } else {\n this.setActiveTool({\n type: \"laser\"\n });\n }\n\n return;\n }\n\n if (this.state.viewModeEnabled) {\n //revert to hand in case a key is pressed (K is handled above)\n if (event.key !== _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.K) {\n this.setActiveTool({\n type: \"selection\"\n });\n }\n\n return;\n }\n\n if (event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] && this.state.isBindingEnabled) {\n this.setState({\n isBindingEnabled: false\n });\n }\n\n if ((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isArrowKey)(event.key)) {\n let selectedElements = this.scene.getSelectedElements({\n selectedElementIds: this.state.selectedElementIds,\n includeBoundTextElement: true,\n includeElementsInFrames: true\n });\n const elbowArrow = selectedElements.find(_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow);\n const arrowIdsToRemove = new Set();\n selectedElements.filter(_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow).filter(arrow => {\n const startElementNotInSelection = arrow.startBinding && !selectedElements.some(el => {\n var _a;\n\n return el.id === ((_a = arrow.startBinding) === null || _a === void 0 ? void 0 : _a.elementId);\n });\n const endElementNotInSelection = arrow.endBinding && !selectedElements.some(el => {\n var _a;\n\n return el.id === ((_a = arrow.endBinding) === null || _a === void 0 ? void 0 : _a.elementId);\n });\n return startElementNotInSelection || endElementNotInSelection;\n }).forEach(arrow => arrowIdsToRemove.add(arrow.id));\n selectedElements = selectedElements.filter(el => !arrowIdsToRemove.has(el.id));\n const step = this.getEffectiveGridSize() && (event.shiftKey ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.ELEMENT_TRANSLATE_AMOUNT : this.getEffectiveGridSize()) || (event.shiftKey ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.ELEMENT_SHIFT_TRANSLATE_AMOUNT : _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.ELEMENT_TRANSLATE_AMOUNT);\n let offsetX = 0;\n let offsetY = 0;\n\n if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.ARROW_LEFT) {\n offsetX = -step;\n } else if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.ARROW_RIGHT) {\n offsetX = step;\n } else if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.ARROW_UP) {\n offsetY = -step;\n } else if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.ARROW_DOWN) {\n offsetY = step;\n }\n\n selectedElements.forEach(element => {\n this.scene.mutateElement(element, {\n x: element.x + offsetX,\n y: element.y + offsetY\n }, {\n informMutation: false,\n isDragging: false\n });\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.updateBoundElements)(element, this.scene, {\n simultaneouslyUpdated: selectedElements\n });\n });\n this.setState({\n suggestedBindings: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getSuggestedBindingsForArrows)(selectedElements.filter(element => element.id !== (elbowArrow === null || elbowArrow === void 0 ? void 0 : elbowArrow.id) || step !== 0), this.scene.getNonDeletedElementsMap(), this.state.zoom)\n });\n this.scene.triggerUpdate();\n event.preventDefault();\n } else if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.ENTER) {\n const selectedElements = this.scene.getSelectedElements(this.state);\n\n if (selectedElements.length === 1) {\n const selectedElement = selectedElements[0];\n\n if (event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLineElement)(selectedElement)) {\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLinearElement)(selectedElement)) {\n if (!((_h = this.state.selectedLinearElement) === null || _h === void 0 ? void 0 : _h.isEditing) || this.state.selectedLinearElement.elementId !== selectedElement.id) {\n this.store.scheduleCapture();\n\n if (!(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(selectedElement)) {\n this.actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_8__.actionToggleLinearEditor);\n }\n }\n }\n } else if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isTextElement)(selectedElement) || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isValidTextContainer)(selectedElement)) {\n let container;\n\n if (!(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isTextElement)(selectedElement)) {\n container = selectedElement;\n }\n\n const midPoint = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getContainerCenter)(selectedElement, this.state, this.scene.getNonDeletedElementsMap());\n const sceneX = midPoint.x;\n const sceneY = midPoint.y;\n this.startTextEditing({\n sceneX,\n sceneY,\n container\n });\n event.preventDefault();\n return;\n } else if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isFrameLikeElement)(selectedElement)) {\n this.setState({\n editingFrame: selectedElement.id\n });\n } else if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isEmbeddableElement)(selectedElement)) {\n //zsviczian\n this.setState({\n activeEmbeddable: {\n element: selectedElement,\n state: \"active\"\n }\n });\n }\n }\n } else if (!event.ctrlKey && !event.altKey && !event.metaKey && !this.state.newElement && !this.state.selectionElement && !this.state.selectedElementsAreBeingDragged) {\n const shape = (0,_shapes__WEBPACK_IMPORTED_MODULE_68__.findShapeByKey)(event.key, this);\n\n if (shape) {\n if (this.state.activeTool.type !== shape) {\n (0,_analytics__WEBPACK_IMPORTED_MODULE_21__.trackEvent)(\"toolbar\", shape, `keyboard (${this.editorInterface.formFactor === \"phone\" ? \"mobile\" : \"desktop\"})`);\n }\n\n if (shape === \"arrow\" && this.state.activeTool.type === \"arrow\") {\n this.setState(prevState => ({\n currentItemArrowType: prevState.currentItemArrowType === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.ARROW_TYPE.sharp ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.ARROW_TYPE.round : prevState.currentItemArrowType === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.ARROW_TYPE.round ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.ARROW_TYPE.elbow : _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.ARROW_TYPE.sharp\n }));\n }\n\n this.setActiveTool({\n type: shape\n });\n event.stopPropagation();\n } else if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.Q) {\n this.toggleLock(\"keyboard\");\n event.stopPropagation();\n }\n }\n\n if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.SPACE && gesture.pointers.size === 0) {\n isHoldingSpace = true;\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.GRAB);\n event.preventDefault();\n }\n\n if ((event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.G || event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.S) && !event.altKey && !event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD]) {\n const selectedElements = this.scene.getSelectedElements(this.state);\n\n if (this.state.activeTool.type === \"selection\" && !selectedElements.length) {\n return;\n }\n\n if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.G && ((0,_scene__WEBPACK_IMPORTED_MODULE_31__.hasBackground)(this.state.activeTool.type) || selectedElements.some(element => (0,_scene__WEBPACK_IMPORTED_MODULE_31__.hasBackground)(element.type)))) {\n this.setState({\n openPopup: \"elementBackground\"\n });\n event.stopPropagation();\n }\n\n if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.S) {\n this.setState({\n openPopup: \"elementStroke\"\n });\n event.stopPropagation();\n }\n }\n\n if (!event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] && event.shiftKey && event.key.toLowerCase() === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.F) {\n const selectedElements = this.scene.getSelectedElements(this.state);\n\n if (this.state.activeTool.type === \"selection\" && !selectedElements.length) {\n return;\n }\n\n if (this.state.activeTool.type === \"text\" || selectedElements.find(element => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isTextElement)(element) || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getBoundTextElement)(element, this.scene.getNonDeletedElementsMap()))) {\n event.preventDefault();\n this.setState({\n openPopup: \"fontFamily\"\n });\n }\n }\n\n if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.K && !event.altKey && !event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD]) {\n if (this.state.activeTool.type === \"laser\") {\n this.setActiveTool({\n type: this.state.preferredSelectionTool.type\n });\n } else {\n this.setActiveTool({\n type: \"laser\"\n });\n }\n\n return;\n }\n\n if (event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] && (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.BACKSPACE || event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.DELETE)) {\n this.updateEditorAtom(_ActiveConfirmDialog__WEBPACK_IMPORTED_MODULE_53__.activeConfirmDialogAtom, \"clearCanvas\");\n } // eye dropper\n // -----------------------------------------------------------------------\n\n\n const lowerCased = event.key.toLocaleLowerCase();\n const isPickingStroke = lowerCased === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.S && event.shiftKey;\n const isPickingBackground = event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.I || lowerCased === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.G && event.shiftKey;\n\n if (isPickingStroke || isPickingBackground) {\n this.openEyeDropper({\n type: isPickingStroke ? \"stroke\" : \"background\"\n });\n } // -----------------------------------------------------------------------\n\n });\n this.onKeyUp = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(event => {\n var _a, _b, _c, _d, _e;\n\n if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.SPACE) {\n if (this.state.viewModeEnabled || ((_a = this.state.openDialog) === null || _a === void 0 ? void 0 : _a.name) === \"elementLinkSelector\") {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.GRAB);\n } else if (this.state.activeTool.type === \"selection\" || this.state.activeTool.type === \"lasso\") {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.resetCursor)(this.interactiveCanvas);\n } else {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursorForShape)(this.interactiveCanvas, this.state);\n this.setState({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)({}, this.state),\n selectedGroupIds: {},\n editingGroupId: null,\n activeEmbeddable: null\n });\n }\n\n isHoldingSpace = false;\n }\n\n if (!event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] && !this.state.isBindingEnabled) {\n this.setState({\n isBindingEnabled: true\n });\n }\n\n if ((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isArrowKey)(event.key)) {\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.bindOrUnbindLinearElements)(this.scene.getSelectedElements(this.state).filter(_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLinearElement), (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isBindingEnabled)(this.state), (_c = (_b = this.state.selectedLinearElement) === null || _b === void 0 ? void 0 : _b.selectedPointsIndices) !== null && _c !== void 0 ? _c : [], this.scene, this.state.zoom);\n this.setState({\n suggestedBindings: []\n });\n }\n\n if (!event.altKey) {\n if (this.flowChartNavigator.isExploring) {\n this.flowChartNavigator.clear();\n this.syncActionResult({\n captureUpdate: _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.CaptureUpdateAction.IMMEDIATELY\n });\n }\n }\n\n if (!event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD]) {\n if (this.flowChartCreator.isCreatingChart) {\n if ((_d = this.flowChartCreator.pendingNodes) === null || _d === void 0 ? void 0 : _d.length) {\n this.scene.insertElements(this.flowChartCreator.pendingNodes);\n }\n\n const firstNode = (_e = this.flowChartCreator.pendingNodes) === null || _e === void 0 ? void 0 : _e[0];\n\n if (firstNode) {\n this.setState(prevState => ({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)({\n [firstNode.id]: true\n }, prevState)\n }));\n\n if (!(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElementCompletelyInViewport)([firstNode], this.canvas.width / window.devicePixelRatio, this.canvas.height / window.devicePixelRatio, {\n offsetLeft: this.state.offsetLeft,\n offsetTop: this.state.offsetTop,\n scrollX: this.state.scrollX,\n scrollY: this.state.scrollY,\n zoom: this.state.zoom\n }, this.scene.getNonDeletedElementsMap(), this.getEditorUIOffsets())) {\n this.scrollToContent(firstNode, {\n animate: true,\n duration: 300,\n canvasOffsets: this.getEditorUIOffsets()\n });\n }\n }\n\n this.flowChartCreator.clear();\n this.syncActionResult({\n captureUpdate: _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.CaptureUpdateAction.IMMEDIATELY\n });\n }\n }\n }); // We purposely widen the `tool` type so this helper can be called with\n // any tool without having to type check it\n\n this.isToolSupported = tool => {\n var _a;\n\n return ((_a = this.props.UIOptions.tools) === null || _a === void 0 ? void 0 : _a[tool]) !== false;\n };\n\n this.setActiveTool = (tool, keepSelection = false) => {\n if (!this.isToolSupported(tool.type)) {\n console.warn(`\"${tool.type}\" tool is disabled via \"UIOptions.canvasActions.tools.${tool.type}\"`);\n return;\n }\n\n const nextActiveTool = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateActiveTool)(this.state, tool);\n\n if (nextActiveTool.type === \"hand\") {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.GRAB);\n } else if (!isHoldingSpace) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursorForShape)(this.interactiveCanvas, Object.assign(Object.assign({}, this.state), {\n activeTool: nextActiveTool\n }));\n }\n\n if ((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isToolIcon)(document.activeElement)) {\n this.focusContainer();\n }\n\n if (!(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLinearElementType)(nextActiveTool.type)) {\n this.setState({\n suggestedBindings: []\n });\n }\n\n if (nextActiveTool.type === \"image\") {\n this.onImageToolbarButtonClick();\n }\n\n setTimeout(() => {\n this.setState(prevState => {\n const commonResets = {\n snapLines: prevState.snapLines.length ? [] : prevState.snapLines,\n originSnapOffset: null,\n activeEmbeddable: null\n };\n\n if (nextActiveTool.type === \"freedraw\") {\n this.store.scheduleCapture();\n }\n\n if (nextActiveTool.type === \"lasso\") {\n return Object.assign(Object.assign(Object.assign(Object.assign({}, prevState), {\n activeTool: nextActiveTool\n }), keepSelection ? {} : {\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)({}, prevState),\n selectedGroupIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)({}, prevState),\n editingGroupId: null,\n multiElement: null\n }), commonResets);\n } else if (nextActiveTool.type !== \"selection\") {\n return Object.assign(Object.assign(Object.assign({}, prevState), {\n activeTool: nextActiveTool,\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)(nextActiveTool.type === \"mermaid\" //zsviczian\n ? this.state.selectedElementIds : {}, prevState),\n selectedGroupIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)({}, prevState),\n editingGroupId: null,\n multiElement: null\n }), commonResets);\n }\n\n return Object.assign(Object.assign(Object.assign({}, prevState), {\n activeTool: nextActiveTool\n }), commonResets);\n });\n }); //zsviczian added timeout because button won't select otherwise\n };\n\n this.setOpenDialog = dialogType => {\n this.setState({\n openDialog: dialogType\n });\n };\n\n this.setCursor = cursor => {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, cursor);\n };\n\n this.resetCursor = () => {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.resetCursor)(this.interactiveCanvas);\n };\n /**\r\n * returns whether user is making a gesture with >= 2 fingers (points)\r\n * on o touch screen (not on a trackpad). Currently only relates to Darwin\r\n * (iOS/iPadOS,MacOS), but may work on other devices in the future if\r\n * GestureEvent is standardized.\r\n */\n\n\n this.isTouchScreenMultiTouchGesture = () => {\n // we don't want to deselect when using trackpad, and multi-point gestures\n // only work on touch screens, so checking for >= pointers means we're on a\n // touchscreen\n return gesture.pointers.size >= 2;\n };\n\n this.getName = () => {\n return this.state.name || this.props.name || `${(0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"labels.untitled\")}-${(0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getDateTime)()}`;\n }; // fires only on Safari\n\n\n this.onGestureStart = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(event => {\n //zsviczian - start\n // If an embeddable is active and the pinch starts over it, let it handle the gesture.\n if ((0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_70__.shouldDisableZoom)(this.state)) {\n gesture.initialScale = null;\n return;\n }\n\n event.preventDefault(); // we only want to deselect on touch screens because user may have selected\n // elements by mistake while zooming\n\n if (this.isTouchScreenMultiTouchGesture()) {\n this.setState({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)({}, this.state),\n activeEmbeddable: null\n });\n }\n\n gesture.initialScale = this.state.zoom.value;\n }); // fires only on Safari\n\n this.onGestureChange = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(event => {\n //zsviczian\n if (!gesture.initialScale) {\n return;\n }\n\n event.preventDefault(); // onGestureChange only has zoom factor but not the center.\n // If we're on iPad or iPhone, then we recognize multi-touch and will\n // zoom in at the right location in the touchmove handler\n // (handleCanvasPointerMove).\n //\n // On Macbook trackpad, we don't have those events so will zoom in at the\n // current location instead.\n //\n // As such, bail from this handler on touch devices.\n\n if (this.isTouchScreenMultiTouchGesture()) {\n return;\n }\n\n const initialScale = gesture.initialScale;\n\n if (initialScale) {\n this.setState(state => Object.assign({}, (0,_scene_zoom__WEBPACK_IMPORTED_MODULE_32__.getStateForZoom)({\n viewportX: this.lastViewportPosition.x,\n viewportY: this.lastViewportPosition.y,\n nextZoom: (0,_scene__WEBPACK_IMPORTED_MODULE_31__.getNormalizedZoom)(initialScale * event.scale)\n }, state)));\n }\n }); // fires only on Safari\n\n this.onGestureEnd = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(event => {\n event.preventDefault(); // reselect elements only on touch screens (see onGestureStart)\n\n if (this.isTouchScreenMultiTouchGesture()) {\n this.setState({\n previousSelectedElementIds: {},\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)(this.state.previousSelectedElementIds, this.state)\n });\n }\n\n gesture.initialScale = null;\n });\n\n this.startTextEditing = ({\n sceneX,\n sceneY,\n insertAtParentCenter = true,\n container,\n autoEdit = true\n }) => {\n var _a;\n\n let shouldBindToContainer = false;\n let parentCenterPosition = insertAtParentCenter && this.getTextWysiwygSnappedToCenterPosition(sceneX, sceneY, this.state, container);\n\n if (container && parentCenterPosition) {\n const boundTextElementToContainer = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getBoundTextElement)(container, this.scene.getNonDeletedElementsMap());\n\n if (!boundTextElementToContainer) {\n shouldBindToContainer = true;\n }\n }\n\n let existingTextElement = null;\n const selectedElements = this.scene.getSelectedElements(this.state);\n\n if (selectedElements.length === 1) {\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isTextElement)(selectedElements[0])) {\n existingTextElement = selectedElements[0];\n } else if (container) {\n existingTextElement = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getBoundTextElement)(selectedElements[0], this.scene.getNonDeletedElementsMap());\n } else {\n existingTextElement = this.getTextElementAtPosition(sceneX, sceneY);\n }\n } else {\n existingTextElement = this.getTextElementAtPosition(sceneX, sceneY);\n }\n\n const fontFamily = (existingTextElement === null || existingTextElement === void 0 ? void 0 : existingTextElement.fontFamily) || this.state.currentItemFontFamily;\n const lineHeight = (existingTextElement === null || existingTextElement === void 0 ? void 0 : existingTextElement.lineHeight) || (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getLineHeight)(fontFamily);\n const fontSize = (0,_actions_actionProperties__WEBPACK_IMPORTED_MODULE_72__.getFontSize)(this.state.currentItemFontSize, this.state.zoom.value); //zsviczian\n\n if (!existingTextElement && shouldBindToContainer && container && !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isArrowElement)(container)) {\n const fontString = {\n fontSize,\n fontFamily\n };\n const minWidth = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getApproxMinLineWidth)((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getFontString)(fontString), lineHeight);\n const minHeight = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getApproxMinLineHeight)(fontSize, lineHeight);\n const newHeight = Math.max(container.height, minHeight);\n const newWidth = Math.max(container.width, minWidth);\n this.scene.mutateElement(container, {\n height: newHeight,\n width: newWidth\n });\n sceneX = container.x + newWidth / 2;\n sceneY = container.y + newHeight / 2;\n\n if (parentCenterPosition) {\n parentCenterPosition = this.getTextWysiwygSnappedToCenterPosition(sceneX, sceneY, this.state, container);\n }\n }\n\n const topLayerFrame = this.getTopLayerFrameAtSceneCoords({\n x: sceneX,\n y: sceneY\n });\n const element = existingTextElement || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newTextElement)({\n x: parentCenterPosition ? parentCenterPosition.elementCenterX : sceneX,\n y: parentCenterPosition ? parentCenterPosition.elementCenterY : sceneY,\n strokeColor: this.state.currentItemStrokeColor,\n backgroundColor: this.state.currentItemBackgroundColor,\n fillStyle: this.state.currentItemFillStyle,\n strokeWidth: this.state.currentItemStrokeWidth,\n strokeStyle: this.state.currentItemStrokeStyle,\n roughness: this.state.currentItemRoughness,\n opacity: this.state.currentItemOpacity,\n text: \"\",\n rawText: \"\",\n fontSize,\n fontFamily,\n textAlign: parentCenterPosition ? \"center\" : this.state.currentItemTextAlign,\n verticalAlign: parentCenterPosition ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.VERTICAL_ALIGN.MIDDLE : _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.DEFAULT_VERTICAL_ALIGN,\n containerId: shouldBindToContainer ? container === null || container === void 0 ? void 0 : container.id : undefined,\n groupIds: (_a = container === null || container === void 0 ? void 0 : container.groupIds) !== null && _a !== void 0 ? _a : [],\n lineHeight,\n angle: container ? (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isArrowElement)(container) ? 0 : container.angle : 0,\n frameId: topLayerFrame ? topLayerFrame.id : null\n });\n\n if (!existingTextElement && shouldBindToContainer && container) {\n this.scene.mutateElement(container, {\n boundElements: (container.boundElements || []).concat({\n type: \"text\",\n id: element.id\n })\n });\n }\n\n this.setState({\n editingTextElement: element\n });\n\n if (!existingTextElement) {\n if (container && shouldBindToContainer) {\n const containerIndex = this.scene.getElementIndex(container.id);\n this.scene.insertElementAtIndex(element, containerIndex + 1);\n } else {\n this.scene.insertElement(element);\n }\n }\n\n if (autoEdit || existingTextElement || container) {\n this.handleTextWysiwyg(element, {\n isExistingElement: !!existingTextElement\n });\n } else {\n this.setState({\n newElement: element,\n multiElement: null\n });\n }\n };\n\n this.debounceDoubleClickTimestamp = 0; //zsviczian\n\n this.startImageCropping = image => {\n this.store.scheduleCapture();\n this.setState({\n croppingElementId: image.id\n });\n };\n\n this.finishImageCropping = () => {\n if (this.state.croppingElementId) {\n this.store.scheduleCapture();\n this.setState({\n croppingElementId: null\n });\n }\n };\n\n this.handleCanvasDoubleClick = event => {\n var _a, _b, _c, _d; // case: double-clicking with arrow/line tool selected would both create\n // text and enter multiElement mode\n\n\n if (this.state.multiElement) {\n return;\n }\n\n if ( //zsviczian - double click eraser\n this.state.penMode && (0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_70__.allowDoubleTapEraser)() && ((_a = this.lastPointerDownEvent) === null || _a === void 0 ? void 0 : _a.pointerType) === \"touch\" && this.state.activeTool.type !== \"selection\") {\n const now = Date.now();\n\n if (now - this.debounceDoubleClickTimestamp < 200) {\n //handleCanvasDoubleClick click fires twice in case of touch.\n //Once from the onTouchStart event handler, once from the double click event handler\n return;\n }\n\n this.debounceDoubleClickTimestamp = now;\n this.updateScene(_actions_actionCanvas__WEBPACK_IMPORTED_MODULE_10__.actionToggleEraserTool.perform([], this.state, null, this));\n return;\n } // zsviczian - end\n // we should only be able to double click when mode is selection\n\n\n if (this.state.activeTool.type !== this.state.preferredSelectionTool.type) {\n return;\n }\n\n const selectedElements = this.scene.getSelectedElements(this.state);\n let {\n x: sceneX,\n y: sceneY\n } = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)(event, this.state);\n\n if (selectedElements.length === 1 && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLinearElement)(selectedElements[0])) {\n const selectedLinearElement = selectedElements[0];\n\n if ((event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isSimpleArrow)(selectedLinearElement) || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLineElement)(selectedLinearElement)) && (!((_b = this.state.selectedLinearElement) === null || _b === void 0 ? void 0 : _b.isEditing) || this.state.selectedLinearElement.elementId !== selectedLinearElement.id)) {\n // Use the proper action to ensure immediate history capture\n this.actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_8__.actionToggleLinearEditor);\n return;\n } else if (this.state.selectedLinearElement && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(selectedElements[0])) {\n const hitCoords = _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.getSegmentMidpointHitCoords(this.state.selectedLinearElement, {\n x: sceneX,\n y: sceneY\n }, this.state, this.scene.getNonDeletedElementsMap());\n const midPoint = hitCoords ? _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.getSegmentMidPointIndex(this.state.selectedLinearElement, this.state, hitCoords, this.scene.getNonDeletedElementsMap()) : -1;\n\n if (midPoint && midPoint > -1) {\n this.store.scheduleCapture();\n _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.deleteFixedSegment(selectedElements[0], this.scene, midPoint);\n const nextCoords = _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.getSegmentMidpointHitCoords(Object.assign(Object.assign({}, this.state.selectedLinearElement), {\n segmentMidPointHoveredCoords: null\n }), {\n x: sceneX,\n y: sceneY\n }, this.state, this.scene.getNonDeletedElementsMap());\n const nextIndex = nextCoords ? _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.getSegmentMidPointIndex(this.state.selectedLinearElement, this.state, nextCoords, this.scene.getNonDeletedElementsMap()) : null;\n this.setState({\n selectedLinearElement: Object.assign(Object.assign({}, this.state.selectedLinearElement), {\n pointerDownState: Object.assign(Object.assign({}, this.state.selectedLinearElement.pointerDownState), {\n segmentMidpoint: {\n index: nextIndex,\n value: hitCoords,\n added: false\n }\n }),\n segmentMidPointHoveredCoords: nextCoords\n })\n });\n return;\n }\n } else if (((_c = this.state.selectedLinearElement) === null || _c === void 0 ? void 0 : _c.isEditing) && this.state.selectedLinearElement.elementId === selectedLinearElement.id && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLineElement)(selectedLinearElement)) {\n return;\n }\n }\n\n if (selectedElements.length === 1 && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isImageElement)(selectedElements[0])) {\n this.startImageCropping(selectedElements[0]);\n return;\n }\n\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.resetCursor)(this.interactiveCanvas);\n const selectedGroupIds = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getSelectedGroupIds)(this.state);\n\n if (selectedGroupIds.length > 0) {\n const hitElement = this.getElementAtPosition(sceneX, sceneY);\n const selectedGroupId = hitElement && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getSelectedGroupIdForElement)(hitElement, this.state.selectedGroupIds);\n\n if (selectedGroupId) {\n this.store.scheduleCapture();\n this.setState(prevState => Object.assign(Object.assign({}, prevState), (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.selectGroupsForSelectedElements)({\n editingGroupId: selectedGroupId,\n selectedElementIds: {\n [hitElement.id]: true\n }\n }, this.scene.getNonDeletedElements(), prevState, this)));\n return;\n }\n }\n\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.resetCursor)(this.interactiveCanvas);\n\n if (!event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] && !this.state.viewModeEnabled) {\n const hitElement = this.getElementAtPosition(sceneX, sceneY);\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isIframeLikeElement)(hitElement)) {\n this.setState({\n activeEmbeddable: {\n element: hitElement,\n state: \"active\"\n }\n });\n return;\n } // shouldn't edit/create text when inside line editor (often false positive)\n\n\n if (!((_d = this.state.selectedLinearElement) === null || _d === void 0 ? void 0 : _d.isEditing)) {\n const container = this.getTextBindableContainerAtPosition(sceneX, sceneY);\n\n if (container) {\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.hasBoundTextElement)(container) || !(0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isTransparent)(container.backgroundColor) || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.hitElementItself)({\n point: (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(sceneX, sceneY),\n element: container,\n elementsMap: this.scene.getNonDeletedElementsMap(),\n threshold: this.getElementHitThreshold(container)\n })) {\n const midPoint = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getContainerCenter)(container, this.state, this.scene.getNonDeletedElementsMap());\n sceneX = midPoint.x;\n sceneY = midPoint.y;\n }\n } //zsviczian Disable double click text create, but allow double click edit\n\n\n if ((0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_70__.disableDoubleClickTextEditing)()) {\n let existingTextElement = null;\n const selectedElements = this.scene.getSelectedElements(this.state);\n\n if (selectedElements.length === 1) {\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isTextElement)(selectedElements[0])) {\n existingTextElement = selectedElements[0];\n } else if (container) {\n existingTextElement = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getBoundTextElement)(selectedElements[0], this.scene.getNonDeletedElementsMap());\n } else {\n existingTextElement = this.getTextElementAtPosition(sceneX, sceneY);\n }\n } else {\n existingTextElement = this.getTextElementAtPosition(sceneX, sceneY);\n }\n\n if (!existingTextElement) {\n return;\n }\n }\n\n this.startTextEditing({\n sceneX,\n sceneY,\n insertAtParentCenter: !event.altKey,\n container\n });\n }\n }\n };\n\n this.getElementLinkAtPosition = (scenePointer, hitElementMightBeLocked) => {\n if (hitElementMightBeLocked && hitElementMightBeLocked.locked) {\n return undefined;\n }\n\n const elements = this.scene.getNonDeletedElements();\n let hitElementIndex = -1;\n\n for (let index = elements.length - 1; index >= 0; index--) {\n const element = elements[index];\n\n if (hitElementMightBeLocked && element.id === hitElementMightBeLocked.id) {\n hitElementIndex = index;\n }\n\n if (element.link && index >= hitElementIndex && (0,_hyperlink_helpers__WEBPACK_IMPORTED_MODULE_65__.isPointHittingLink)(element, this.scene.getNonDeletedElementsMap(), this.state, (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(scenePointer.x, scenePointer.y), this.editorInterface.formFactor === \"phone\")) {\n return element;\n }\n }\n };\n\n this.redirectToLink = (event, isTouchScreen) => {\n const draggedDistance = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointDistance)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(this.lastPointerDownEvent.clientX, this.lastPointerDownEvent.clientY), (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(this.lastPointerUpEvent.clientX, this.lastPointerUpEvent.clientY));\n\n if (!this.hitLinkElement || draggedDistance > _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.DRAGGING_THRESHOLD) {\n return;\n }\n\n const lastPointerDownCoords = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)(this.lastPointerDownEvent, this.state);\n const elementsMap = this.scene.getNonDeletedElementsMap();\n const lastPointerDownHittingLinkIcon = (0,_hyperlink_helpers__WEBPACK_IMPORTED_MODULE_65__.isPointHittingLink)(this.hitLinkElement, elementsMap, this.state, (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(lastPointerDownCoords.x, lastPointerDownCoords.y), this.editorInterface.formFactor === \"phone\");\n const lastPointerUpCoords = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)(this.lastPointerUpEvent, this.state);\n const lastPointerUpHittingLinkIcon = (0,_hyperlink_helpers__WEBPACK_IMPORTED_MODULE_65__.isPointHittingLink)(this.hitLinkElement, elementsMap, this.state, (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(lastPointerUpCoords.x, lastPointerUpCoords.y), this.editorInterface.formFactor === \"phone\");\n\n if (lastPointerDownHittingLinkIcon && lastPointerUpHittingLinkIcon) {\n (0,_components_hyperlink_Hyperlink__WEBPACK_IMPORTED_MODULE_35__.hideHyperlinkToolip)();\n let url = this.hitLinkElement.link;\n\n if (url) {\n url = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.normalizeLink)(url);\n let customEvent;\n\n if (this.props.onLinkOpen) {\n customEvent = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.wrapEvent)(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.EXCALIDRAW_LINK, event.nativeEvent);\n this.props.onLinkOpen(Object.assign(Object.assign({}, this.hitLinkElement), {\n link: url\n }), customEvent);\n }\n\n if (!(customEvent === null || customEvent === void 0 ? void 0 : customEvent.defaultPrevented)) {\n const target = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isLocalLink)(url) ? \"_self\" : \"_blank\";\n const newWindow = window.open(undefined, target); // https://mathiasbynens.github.io/rel-noopener/\n\n if (newWindow) {\n newWindow.opener = null;\n newWindow.location = url;\n }\n }\n }\n }\n };\n\n this.getTopLayerFrameAtSceneCoords = sceneCoords => {\n const elementsMap = this.scene.getNonDeletedElementsMap();\n const frames = this.scene.getNonDeletedFramesLikes().filter(frame => !frame.locked && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isCursorInFrame)(sceneCoords, frame, elementsMap) && frame.frameRole !== \"marker\");\n return frames.length ? frames[frames.length - 1] : null;\n };\n\n this.handleCanvasPointerMove = event => {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j;\n\n this.savePointer(event.clientX, event.clientY, this.state.cursorButton);\n this.lastPointerMoveEvent = event.nativeEvent;\n\n if (gesture.pointers.has(event.pointerId)) {\n gesture.pointers.set(event.pointerId, {\n x: event.clientX,\n y: event.clientY\n });\n }\n\n const initialScale = gesture.initialScale;\n\n if (gesture.pointers.size === 2 && gesture.lastCenter && initialScale && gesture.initialDistance) {\n const center = (0,_gesture__WEBPACK_IMPORTED_MODULE_28__.getCenter)(gesture.pointers);\n const deltaX = center.x - gesture.lastCenter.x;\n const deltaY = center.y - gesture.lastCenter.y;\n gesture.lastCenter = center;\n const distance = (0,_gesture__WEBPACK_IMPORTED_MODULE_28__.getDistance)(Array.from(gesture.pointers.values()));\n const scaleFactor = !this.state.allowPinchZoom && //zsviczian\n this.state.activeTool.type === \"freedraw\" && this.state.penMode ? 1 : distance / gesture.initialDistance;\n const nextZoom = scaleFactor ? (0,_scene__WEBPACK_IMPORTED_MODULE_31__.getNormalizedZoom)(initialScale * scaleFactor) : this.state.zoom.value;\n this.setState(state => {\n const zoomState = (0,_scene_zoom__WEBPACK_IMPORTED_MODULE_32__.getStateForZoom)({\n viewportX: center.x,\n viewportY: center.y,\n nextZoom\n }, state);\n this.translateCanvas({\n zoom: zoomState.zoom,\n // 2x multiplier is just a magic number that makes this work correctly\n // on touchscreen devices (note: if we get report that panning is slower/faster\n // than actual movement, consider swapping with devicePixelRatio)\n scrollX: zoomState.scrollX + 2 * (deltaX / nextZoom),\n scrollY: zoomState.scrollY + 2 * (deltaY / nextZoom),\n shouldCacheIgnoreZoom: true\n });\n });\n this.resetShouldCacheIgnoreZoomDebounced();\n } else {\n gesture.lastCenter = gesture.initialDistance = gesture.initialScale = null;\n }\n\n if (isHoldingSpace || isPanning || isDraggingScrollBar || (0,_appState__WEBPACK_IMPORTED_MODULE_23__.isHandToolActive)(this.state)) {\n return;\n }\n\n const isPointerOverScrollBars = (0,_scene_scrollbars__WEBPACK_IMPORTED_MODULE_47__.isOverScrollBars)(currentScrollBars, event.clientX - this.state.offsetLeft, event.clientY - this.state.offsetTop);\n const isOverScrollBar = isPointerOverScrollBars.isOverEither;\n const isPenFreedraw = this.state.activeTool.type === \"freedraw\" && event.pointerType === \"pen\"; //zsviczian\n\n if (!this.state.newElement && !this.state.selectionElement && !this.state.selectedElementsAreBeingDragged && !this.state.multiElement) {\n if (isOverScrollBar) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.resetCursor)(this.interactiveCanvas);\n } else if (isPenFreedraw && this.interactiveCanvas && (0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_70__.hideFreedrawPenmodeCursor)()) {\n //zsviczian https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/1659\n this.interactiveCanvas.style.cursor = \"none\";\n } else {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursorForShape)(this.interactiveCanvas, this.state);\n }\n }\n\n const scenePointer = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)(event, this.state);\n const {\n x: scenePointerX,\n y: scenePointerY\n } = scenePointer;\n\n if (!this.state.newElement && (0,_snapping__WEBPACK_IMPORTED_MODULE_39__.isActiveToolNonLinearSnappable)(this.state.activeTool.type)) {\n const {\n originOffset,\n snapLines\n } = (0,_snapping__WEBPACK_IMPORTED_MODULE_39__.getSnapLinesAtPointer)(this.scene.getNonDeletedElements(), this, {\n x: scenePointerX,\n y: scenePointerY\n }, event, this.scene.getNonDeletedElementsMap());\n this.setState(prevState => {\n const nextSnapLines = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateStable)(prevState.snapLines, snapLines);\n const nextOriginOffset = prevState.originSnapOffset ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateStable)(prevState.originSnapOffset, originOffset) : originOffset;\n\n if (prevState.snapLines === nextSnapLines && prevState.originSnapOffset === nextOriginOffset) {\n return null;\n }\n\n return {\n snapLines: nextSnapLines,\n originSnapOffset: nextOriginOffset\n };\n });\n } else if (!this.state.newElement && !this.state.selectedElementsAreBeingDragged && !this.state.selectionElement) {\n this.setState(prevState => {\n if (prevState.snapLines.length) {\n return {\n snapLines: []\n };\n }\n\n return null;\n });\n }\n\n if (((_a = this.state.selectedLinearElement) === null || _a === void 0 ? void 0 : _a.isEditing) && !this.state.selectedLinearElement.isDragging) {\n const editingLinearElement = _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.handlePointerMove(event, scenePointerX, scenePointerY, this);\n const linearElement = editingLinearElement ? this.scene.getElement(editingLinearElement.elementId) : null;\n\n if (editingLinearElement && editingLinearElement !== this.state.selectedLinearElement) {\n // Since we are reading from previous state which is not possible with\n // automatic batching in React 18 hence using flush sync to synchronously\n // update the state. Check https://github.com/excalidraw/excalidraw/pull/5508 for more details.\n (0,react_dom__WEBPACK_IMPORTED_MODULE_3__.flushSync)(() => {\n this.setState({\n selectedLinearElement: editingLinearElement\n });\n });\n }\n\n if ((editingLinearElement === null || editingLinearElement === void 0 ? void 0 : editingLinearElement.lastUncommittedPoint) != null && linearElement && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isBindingElementType)(linearElement.type)) {\n this.maybeSuggestBindingAtCursor(scenePointer, editingLinearElement.elbowed);\n } else if (this.state.suggestedBindings.length) {\n this.setState({\n suggestedBindings: []\n });\n }\n }\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isBindingElementType)(this.state.activeTool.type)) {\n // Hovering with a selected tool or creating new linear element via click\n // and point\n const {\n newElement\n } = this.state;\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isBindingElement)(newElement, false)) {\n this.setState({\n suggestedBindings: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.maybeSuggestBindingsForLinearElementAtCoords)(newElement, [scenePointer], this.scene, this.state.zoom, this.state.startBoundElement)\n });\n } else {\n this.maybeSuggestBindingAtCursor(scenePointer, false);\n }\n }\n\n if (this.state.multiElement) {\n const {\n multiElement\n } = this.state;\n const {\n x: rx,\n y: ry\n } = multiElement;\n const {\n points,\n lastCommittedPoint\n } = multiElement;\n const lastPoint = points[points.length - 1];\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursorForShape)(this.interactiveCanvas, this.state);\n\n if (lastPoint === lastCommittedPoint) {\n // if we haven't yet created a temp point and we're beyond commit-zone\n // threshold, add a point\n if ((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointDistance)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(scenePointerX - rx, scenePointerY - ry), lastPoint) >= _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.LINE_CONFIRM_THRESHOLD) {\n this.scene.mutateElement(multiElement, {\n points: [...points, (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(scenePointerX - rx, scenePointerY - ry)]\n }, {\n informMutation: false,\n isDragging: false\n });\n } else {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.POINTER); // in this branch, we're inside the commit zone, and no uncommitted\n // point exists. Thus do nothing (don't add/remove points).\n }\n } else if (points.length > 2 && lastCommittedPoint && (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointDistance)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(scenePointerX - rx, scenePointerY - ry), lastCommittedPoint) < _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.LINE_CONFIRM_THRESHOLD) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.POINTER);\n this.scene.mutateElement(multiElement, {\n points: points.slice(0, -1)\n }, {\n informMutation: false,\n isDragging: false\n });\n } else {\n const [gridX, gridY] = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(scenePointerX, scenePointerY, event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(multiElement) ? null : this.getEffectiveGridSize());\n const [lastCommittedX, lastCommittedY] = (_b = multiElement === null || multiElement === void 0 ? void 0 : multiElement.lastCommittedPoint) !== null && _b !== void 0 ? _b : [0, 0];\n let dxFromLastCommitted = gridX - rx - lastCommittedX;\n let dyFromLastCommitted = gridY - ry - lastCommittedY;\n\n if ((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.shouldRotateWithDiscreteAngle)(event)) {\n ({\n width: dxFromLastCommitted,\n height: dyFromLastCommitted\n } = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getLockedLinearCursorAlignSize)( // actual coordinate of the last committed point\n lastCommittedX + rx, lastCommittedY + ry, // cursor-grid coordinate\n gridX, gridY));\n }\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isPathALoop)(points, this.state.zoom.value)) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.POINTER);\n } // update last uncommitted point\n\n\n this.scene.mutateElement(multiElement, {\n points: [...points.slice(0, -1), (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(lastCommittedX + dxFromLastCommitted, lastCommittedY + dyFromLastCommitted)]\n }, {\n isDragging: true,\n informMutation: false\n }); // in this path, we're mutating multiElement to reflect\n // how it will be after adding pointer position as the next point\n // trigger update here so that new element canvas renders again to reflect this\n\n this.triggerRender(false);\n }\n\n return;\n }\n\n const hasDeselectedButton = Boolean(event.buttons);\n\n if (hasDeselectedButton || this.state.activeTool.type !== \"selection\" && this.state.activeTool.type !== \"lasso\" && this.state.activeTool.type !== \"text\" && this.state.activeTool.type !== \"eraser\") {\n return;\n }\n\n const elements = this.scene.getNonDeletedElements();\n const selectedElements = this.scene.getSelectedElements(this.state);\n\n if (selectedElements.length === 1 && !isOverScrollBar && !((_c = this.state.selectedLinearElement) === null || _c === void 0 ? void 0 : _c.isEditing)) {\n // for linear elements, we'd like to prioritize point dragging over edge resizing\n // therefore, we update and check hovered point index first\n if (this.state.selectedLinearElement) {\n this.handleHoverSelectedLinearElement(this.state.selectedLinearElement, scenePointerX, scenePointerY);\n }\n\n if ((!this.state.selectedLinearElement || this.state.selectedLinearElement.hoverPointIndex === -1) && ((_d = this.state.openDialog) === null || _d === void 0 ? void 0 : _d.name) !== \"elementLinkSelector\" && !(selectedElements.length === 1 && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(selectedElements[0])) && // HACK: Disable transform handles for linear elements on mobile until a\n // better way of showing them is found\n !((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLinearElement)(selectedElements[0]) && (this.editorInterface.userAgent.isMobileDevice || selectedElements[0].points.length === 2))) {\n const elementWithTransformHandleType = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getElementWithTransformHandleType)(elements, this.state, scenePointerX, scenePointerY, this.state.zoom, event.pointerType, this.scene.getNonDeletedElementsMap(), this.editorInterface);\n\n if (elementWithTransformHandleType && elementWithTransformHandleType.transformHandleType) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getCursorForResizingElement)(elementWithTransformHandleType));\n return;\n }\n }\n } else if (selectedElements.length > 1 && !isOverScrollBar && ((_e = this.state.openDialog) === null || _e === void 0 ? void 0 : _e.name) !== \"elementLinkSelector\") {\n const transformHandleType = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getTransformHandleTypeFromCoords)((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getCommonBounds)(selectedElements), scenePointerX, scenePointerY, this.state.zoom, event.pointerType, this.editorInterface);\n\n if (transformHandleType) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getCursorForResizingElement)({\n transformHandleType\n }));\n return;\n }\n }\n\n const hitElementMightBeLocked = this.getElementAtPosition(scenePointerX, scenePointerY, {\n preferSelected: true,\n includeLockedElements: true\n });\n let hitElement = null;\n\n if (hitElementMightBeLocked && hitElementMightBeLocked.locked) {\n hitElement = null;\n } else {\n hitElement = hitElementMightBeLocked;\n }\n\n this.hitLinkElement = this.getElementLinkAtPosition(scenePointer, hitElementMightBeLocked);\n\n if ((0,_appState__WEBPACK_IMPORTED_MODULE_23__.isEraserActive)(this.state)) {\n return;\n }\n\n if (this.hitLinkElement && !this.state.selectedElementIds[this.hitLinkElement.id]) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.POINTER);\n (0,_components_hyperlink_Hyperlink__WEBPACK_IMPORTED_MODULE_35__.showHyperlinkTooltip)(this.hitLinkElement, this.state, this.scene.getNonDeletedElementsMap());\n\n if (this.props.onLinkHover) {\n this.props.onLinkHover(this.hitLinkElement, event);\n } //zsviczian\n\n } else {\n (0,_components_hyperlink_Hyperlink__WEBPACK_IMPORTED_MODULE_35__.hideHyperlinkToolip)();\n\n if (hitElement && (hitElement.link || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isEmbeddableElement)(hitElement)) && this.state.selectedElementIds[hitElement.id] && !this.state.contextMenu && !this.state.showHyperlinkPopup) {\n this.setState({\n showHyperlinkPopup: \"info\"\n });\n } else if (this.state.activeTool.type === \"text\") {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isTextElement)(hitElement) ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.TEXT : _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.CROSSHAIR);\n } else if (this.state.viewModeEnabled) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.GRAB);\n } else if (((_f = this.state.openDialog) === null || _f === void 0 ? void 0 : _f.name) === \"elementLinkSelector\") {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.AUTO);\n } else if (isOverScrollBar) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.AUTO);\n } else if ( // if using cmd/ctrl, we're not dragging\n !event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD]) {\n if ((hitElement || this.isHittingCommonBoundingBoxOfSelectedElements(scenePointer, selectedElements)) && !(hitElement === null || hitElement === void 0 ? void 0 : hitElement.locked)) {\n if (hitElement && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isIframeLikeElement)(hitElement) && this.isIframeLikeElementCenter(hitElement, event, scenePointerX, scenePointerY)) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.POINTER);\n this.setState({\n activeEmbeddable: {\n element: hitElement,\n state: \"hover\"\n }\n });\n } else if (!hitElement || // Ebow arrows can only be moved when unconnected\n !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(hitElement) || !(hitElement.startBinding || hitElement.endBinding)) {\n if (this.state.activeTool.type !== \"lasso\" || selectedElements.length > 0) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.MOVE);\n }\n\n if (((_g = this.state.activeEmbeddable) === null || _g === void 0 ? void 0 : _g.state) === \"hover\") {\n this.setState({\n activeEmbeddable: null\n });\n }\n }\n }\n } else {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.AUTO);\n }\n\n if (this.state.selectedLinearElement) {\n this.handleHoverSelectedLinearElement(this.state.selectedLinearElement, scenePointerX, scenePointerY);\n }\n }\n\n if (((_h = this.state.openDialog) === null || _h === void 0 ? void 0 : _h.name) === \"elementLinkSelector\" && hitElement) {\n this.setState(prevState => {\n return {\n hoveredElementIds: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateStable)(prevState.hoveredElementIds, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.selectGroupsForSelectedElements)({\n editingGroupId: prevState.editingGroupId,\n selectedElementIds: {\n [hitElement.id]: true\n }\n }, this.scene.getNonDeletedElements(), prevState, this).selectedElementIds)\n };\n });\n } else if (((_j = this.state.openDialog) === null || _j === void 0 ? void 0 : _j.name) === \"elementLinkSelector\" && !hitElement) {\n this.setState(prevState => ({\n hoveredElementIds: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateStable)(prevState.hoveredElementIds, {})\n }));\n }\n };\n\n this.handleEraser = (event, scenePointer) => {\n const elementsToErase = this.eraserTrail.addPointToPath(scenePointer.x, scenePointer.y, event.altKey);\n this.elementsPendingErasure = new Set(elementsToErase);\n this.triggerRender();\n }; // set touch moving for mobile context menu\n\n\n this.handleTouchMove = event => {\n this.resetContextMenuTimer(); //zsviczian\n };\n\n this.handleCanvasPointerDown = event => {\n var _a, _b, _c, _d, _e; //mfuria #329. Right-click pan support when enabled via host plugin setting\n\n\n if ((0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_70__.isPanWithRightMouseEnabled)() && event.pointerType === \"mouse\" && event.button === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.POINTER_BUTTON.SECONDARY && !this.state.editingTextElement) {\n // prevent native context menu\n const onContextMenu = e => {\n e.preventDefault();\n };\n\n window.addEventListener('contextmenu', onContextMenu, {\n once: true\n }); // Start right-click panning\n\n this.startRightClickPanning(event);\n return;\n } //zsviczian - begin\n\n\n const isInsideEmbeddableContainer = !!((_b = (_a = event.target) === null || _a === void 0 ? void 0 : _a.closest) === null || _b === void 0 ? void 0 : _b.call(_a, \".excalidraw__embeddable-container\"));\n\n if (!isInsideEmbeddableContainer) {\n this.focusContainer();\n } //zsviczian - end\n\n\n const target = event.target; // capture subsequent pointer events to the canvas\n // this makes other elements non-interactive until pointer up\n\n if (target.setPointerCapture) {\n target.setPointerCapture(event.pointerId);\n }\n\n this.maybeCleanupAfterMissingPointerUp(event.nativeEvent);\n this.maybeUnfollowRemoteUser();\n\n if (this.state.searchMatches) {\n this.setState(state => {\n return {\n searchMatches: state.searchMatches && {\n focusedId: null,\n matches: state.searchMatches.matches.map(searchMatch => Object.assign(Object.assign({}, searchMatch), {\n focus: false\n }))\n }\n };\n });\n this.updateEditorAtom(_SearchMenu__WEBPACK_IMPORTED_MODULE_61__.searchItemInFocusAtom, null);\n }\n\n if (_editor_jotai__WEBPACK_IMPORTED_MODULE_37__.editorJotaiStore.get(_ConvertElementTypePopup__WEBPACK_IMPORTED_MODULE_52__.convertElementTypePopupAtom)) {\n this.updateEditorAtom(_ConvertElementTypePopup__WEBPACK_IMPORTED_MODULE_52__.convertElementTypePopupAtom, null);\n } // since contextMenu options are potentially evaluated on each render,\n // and an contextMenu action may depend on selection state, we must\n // close the contextMenu before we update the selection on pointerDown\n // (e.g. resetting selection)\n\n\n if (this.state.contextMenu) {\n this.setState({\n contextMenu: null\n });\n }\n\n if (this.state.snapLines) {\n this.setAppState({\n snapLines: []\n });\n }\n\n if (this.state.openPopup) {\n this.setState({\n openPopup: null\n });\n }\n\n this.updateGestureOnPointerDown(event); // if dragging element is freedraw and another pointerdown event occurs\n // a second finger is on the screen\n // discard the freedraw element if it is very short because it is likely\n // just a spike, otherwise finalize the freedraw element when the second\n // finger is lifted\n\n if (event.pointerType === \"touch\" && this.state.newElement && this.state.newElement.type === \"freedraw\") {\n const element = this.state.newElement;\n this.updateScene(Object.assign(Object.assign({}, element.points.length < 10 ? {\n elements: this.scene.getElementsIncludingDeleted().filter(el => el.id !== element.id)\n } : {}), {\n appState: {\n newElement: null,\n editingTextElement: null,\n startBoundElement: null,\n suggestedBindings: [],\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)(Object.keys(this.state.selectedElementIds).filter(key => key !== element.id).reduce((obj, key) => {\n obj[key] = this.state.selectedElementIds[key];\n return obj;\n }, {}), this.state)\n },\n captureUpdate: ((_c = this.state.openDialog) === null || _c === void 0 ? void 0 : _c.name) === \"elementLinkSelector\" ? _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.CaptureUpdateAction.EVENTUALLY : _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.CaptureUpdateAction.NEVER\n }));\n return;\n } // remove any active selection when we start to interact with canvas\n // (mainly, we care about removing selection outside the component which\n // would prevent our copy handling otherwise)\n\n\n const selection = document.getSelection();\n\n if (selection === null || selection === void 0 ? void 0 : selection.anchorNode) {\n selection.removeAllRanges();\n }\n\n this.maybeOpenContextMenuAfterPointerDownOnTouchDevices(event); //fires only once, if pen is detected, penMode is enabled\n //the user can disable this by toggling the penMode button\n\n if (!this.state.penDetected && event.pointerType === \"pen\") {\n this.setState(prevState => {\n return {\n penMode: true,\n penDetected: true\n };\n });\n }\n\n if (!this.editorInterface.isTouchScreen && [\"pen\", \"touch\"].includes(event.pointerType)) {\n this.editorInterface = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateObject)(this.editorInterface, {\n isTouchScreen: true\n });\n }\n\n if (isPanning) {\n return;\n }\n\n this.lastPointerDownEvent = event; // we must exit before we set `cursorButton` state and `savePointer`\n // else it will send pointer state & laser pointer events in collab when\n // panning\n\n /*if (this.handleCanvasPanUsingWheelOrSpaceDrag(event)) {\r\n return;\r\n }*/\n //zsviczian this broke on pointer down in onPointerUpdate\n\n this.setState({\n lastPointerDownWith: event.pointerType,\n cursorButton: \"down\"\n });\n this.savePointer(event.clientX, event.clientY, \"down\");\n\n if (this.handleCanvasPanUsingWheelOrSpaceDrag(event)) {\n return;\n } //zsviczian moved it here, because else pointer down in onPointerUpdate did not work\n\n\n if (event.button === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.POINTER_BUTTON.ERASER && this.state.activeTool.type !== _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.TOOL_TYPE.eraser) {\n this.setState({\n activeTool: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateActiveTool)(this.state, {\n type: _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.TOOL_TYPE.eraser,\n lastActiveToolBeforeEraser: this.state.activeTool\n })\n }, () => {\n this.handleCanvasPointerDown(event);\n\n const onPointerUp = () => {\n unsubPointerUp();\n unsubCleanup === null || unsubCleanup === void 0 ? void 0 : unsubCleanup();\n\n if ((0,_appState__WEBPACK_IMPORTED_MODULE_23__.isEraserActive)(this.state)) {\n this.setState({\n activeTool: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateActiveTool)(this.state, Object.assign(Object.assign({}, this.state.activeTool.lastActiveTool || {\n type: _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.TOOL_TYPE.selection\n }), {\n lastActiveToolBeforeEraser: null\n }))\n });\n }\n };\n\n const unsubPointerUp = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(window, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_UP, onPointerUp, {\n once: true\n });\n let unsubCleanup; // subscribe inside rAF lest it'd be triggered on the same pointerdown\n // if we start erasing while coming from blurred document since\n // we cleanup pointer events on focus\n\n requestAnimationFrame(() => {\n unsubCleanup = this.missingPointerEventCleanupEmitter.once(onPointerUp);\n });\n });\n return;\n } // only handle left mouse button or touch\n\n\n if (event.button !== _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.POINTER_BUTTON.MAIN && event.button !== _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.POINTER_BUTTON.TOUCH && event.button !== _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.POINTER_BUTTON.ERASER) {\n return;\n } // don't select while panning\n\n\n if (gesture.pointers.size > 1) {\n return;\n } // State for the duration of a pointer interaction, which starts with a\n // pointerDown event, ends with a pointerUp event (or another pointerDown)\n\n\n const pointerDownState = this.initialPointerDownState(event);\n this.setState({\n selectedElementsAreBeingDragged: false\n });\n\n if (this.handleDraggingScrollBar(event, pointerDownState)) {\n return;\n }\n\n this.clearSelectionIfNotUsingSelection();\n this.updateBindingEnabledOnPointerMove(event);\n\n if (this.handleSelectionOnPointerDown(event, pointerDownState)) {\n return;\n }\n\n const allowOnPointerDown = !this.state.penMode || event.pointerType !== \"touch\" || this.state.activeTool.type === \"selection\" || this.state.activeTool.type === \"lasso\" || this.state.activeTool.type === \"text\" || this.state.activeTool.type === \"image\";\n\n if (!allowOnPointerDown) {\n return;\n }\n\n if (this.state.activeTool.type === \"lasso\") {\n const hitSelectedElement = pointerDownState.hit.element && this.isASelectedElement(pointerDownState.hit.element);\n\n if (!pointerDownState.hit.hasHitCommonBoundingBoxOfSelectedElements && !pointerDownState.resize.handleType && !hitSelectedElement) {\n this.lassoTrail.startPath(pointerDownState.origin.x, pointerDownState.origin.y, event.shiftKey); // block dragging after lasso selection on PCs until the next pointer down\n // (on mobile or tablet, we want to allow user to drag immediately)\n\n pointerDownState.drag.blockDragging = this.editorInterface.formFactor === \"desktop\";\n } // only for mobile or tablet, if we hit an element, select it immediately like normal selection\n\n\n if (this.editorInterface.formFactor !== \"desktop\" && pointerDownState.hit.element && !hitSelectedElement) {\n this.setState(prevState => {\n const nextSelectedElementIds = Object.assign(Object.assign({}, prevState.selectedElementIds), {\n [pointerDownState.hit.element.id]: true\n });\n const previouslySelectedElements = [];\n Object.keys(prevState.selectedElementIds).forEach(id => {\n const element = this.scene.getElement(id);\n element && previouslySelectedElements.push(element);\n });\n const hitElement = pointerDownState.hit.element; // if hitElement is frame-like, deselect all of its elements\n // if they are selected\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isFrameLikeElement)(hitElement)) {\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getFrameChildren)(previouslySelectedElements, hitElement.id).forEach(element => {\n delete nextSelectedElementIds[element.id];\n });\n } else if (hitElement.frameId) {\n // if hitElement is in a frame and its frame has been selected\n // disable selection for the given element\n if (nextSelectedElementIds[hitElement.frameId]) {\n delete nextSelectedElementIds[hitElement.id];\n }\n } else {\n // hitElement is neither a frame nor an element in a frame\n // but since hitElement could be in a group with some frames\n // this means selecting hitElement will have the frames selected as well\n // because we want to keep the invariant:\n // - frames and their elements are not selected at the same time\n // we deselect elements in those frames that were previously selected\n const groupIds = hitElement.groupIds;\n const framesInGroups = new Set(groupIds.flatMap(gid => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getElementsInGroup)(this.scene.getNonDeletedElements(), gid)).filter(element => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isFrameLikeElement)(element)).map(frame => frame.id));\n\n if (framesInGroups.size > 0) {\n previouslySelectedElements.forEach(element => {\n if (element.frameId && framesInGroups.has(element.frameId)) {\n // deselect element and groups containing the element\n delete nextSelectedElementIds[element.id];\n element.groupIds.flatMap(gid => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getElementsInGroup)(this.scene.getNonDeletedElements(), gid)).forEach(element => {\n delete nextSelectedElementIds[element.id];\n });\n }\n });\n }\n }\n\n return Object.assign(Object.assign({}, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.selectGroupsForSelectedElements)({\n editingGroupId: prevState.editingGroupId,\n selectedElementIds: nextSelectedElementIds\n }, this.scene.getNonDeletedElements(), prevState, this)), {\n showHyperlinkPopup: hitElement.link || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isEmbeddableElement)(hitElement) ? \"info\" : false\n });\n });\n pointerDownState.hit.wasAddedToSelection = true;\n }\n } else if (this.state.activeTool.type === \"text\") {\n this.handleTextOnPointerDown(event, pointerDownState);\n } else if (this.state.activeTool.type === \"arrow\" || this.state.activeTool.type === \"line\") {\n this.handleLinearElementOnPointerDown(event, this.state.activeTool.type, pointerDownState);\n } else if (this.state.activeTool.type === \"freedraw\") {\n this.handleFreeDrawElementOnPointerDown(event, this.state.activeTool.type, pointerDownState);\n } else if (this.state.activeTool.type === \"custom\") {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursorForShape)(this.interactiveCanvas, this.state);\n } else if (this.state.activeTool.type === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.TOOL_TYPE.frame || this.state.activeTool.type === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.TOOL_TYPE.magicframe) {\n this.createFrameElementOnPointerDown(pointerDownState, this.state.activeTool.type);\n } else if (this.state.activeTool.type === \"laser\") {\n this.laserTrails.startPath(pointerDownState.lastCoords.x, pointerDownState.lastCoords.y);\n } else if (this.state.activeTool.type !== \"eraser\" && this.state.activeTool.type !== \"hand\" && this.state.activeTool.type !== \"mermaid\" && //zsviczian\n this.state.activeTool.type !== \"image\") {\n this.createGenericElementOnPointerDown(this.state.activeTool.type, pointerDownState);\n }\n\n (_e = (_d = this.props) === null || _d === void 0 ? void 0 : _d.onPointerDown) === null || _e === void 0 ? void 0 : _e.call(_d, this.state.activeTool, pointerDownState);\n this.onPointerDownEmitter.trigger(this.state.activeTool, pointerDownState, event);\n\n if (this.state.activeTool.type === \"eraser\") {\n this.eraserTrail.startPath(pointerDownState.lastCoords.x, pointerDownState.lastCoords.y);\n }\n\n const onPointerMove = this.onPointerMoveFromPointerDownHandler(pointerDownState);\n const onPointerUp = this.onPointerUpFromPointerDownHandler(pointerDownState);\n const onKeyDown = this.onKeyDownFromPointerDownHandler(pointerDownState);\n const onKeyUp = this.onKeyUpFromPointerDownHandler(pointerDownState);\n this.missingPointerEventCleanupEmitter.once(_event => onPointerUp(_event || event.nativeEvent));\n\n if (!this.state.viewModeEnabled || this.state.activeTool.type === \"laser\") {\n window.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_MOVE, onPointerMove);\n window.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_UP, onPointerUp);\n window.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.KEYDOWN, onKeyDown);\n window.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.KEYUP, onKeyUp);\n pointerDownState.eventListeners.onMove = onPointerMove;\n pointerDownState.eventListeners.onUp = onPointerUp;\n pointerDownState.eventListeners.onKeyUp = onKeyUp;\n pointerDownState.eventListeners.onKeyDown = onKeyDown;\n }\n };\n\n this.handleCanvasPointerUp = event => {\n var _a, _b;\n\n this.removePointer(event);\n this.lastPointerUpEvent = event;\n const scenePointer = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)({\n clientX: event.clientX,\n clientY: event.clientY\n }, this.state);\n const clicklength = event.timeStamp - ((_b = (_a = this.lastPointerDownEvent) === null || _a === void 0 ? void 0 : _a.timeStamp) !== null && _b !== void 0 ? _b : 0);\n\n if (this.editorInterface.formFactor === \"phone\" && clicklength < 300) {\n const hitElement = this.getElementAtPosition(scenePointer.x, scenePointer.y);\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isIframeLikeElement)(hitElement) && this.isIframeLikeElementCenter(hitElement, event, scenePointer.x, scenePointer.y)) {\n this.handleEmbeddableCenterClick(hitElement);\n return;\n }\n }\n\n if (this.editorInterface.isTouchScreen) {\n const hitElement = this.getElementAtPosition(scenePointer.x, scenePointer.y, {\n includeLockedElements: true\n });\n this.hitLinkElement = this.getElementLinkAtPosition(scenePointer, hitElement);\n }\n\n if (this.hitLinkElement && !this.state.selectedElementIds[this.hitLinkElement.id]) {\n if (clicklength < 300 && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isIframeLikeElement)(this.hitLinkElement) && !(0,_hyperlink_helpers__WEBPACK_IMPORTED_MODULE_65__.isPointHittingLinkIcon)(this.hitLinkElement, this.scene.getNonDeletedElementsMap(), this.state, (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(scenePointer.x, scenePointer.y))) {\n this.handleEmbeddableCenterClick(this.hitLinkElement);\n } else {\n this.redirectToLink(event, this.editorInterface.isTouchScreen);\n }\n } else if (this.state.viewModeEnabled) {\n this.setState({\n activeEmbeddable: null,\n selectedElementIds: {}\n });\n }\n };\n\n this.maybeOpenContextMenuAfterPointerDownOnTouchDevices = event => {\n if ((0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_70__.isContextMenuDisabled)()) {\n return;\n } // deal with opening context menu on touch devices\n\n\n if (event.pointerType === \"touch\") {\n invalidateContextMenu = false;\n\n if (touchTimeout) {\n // If there's already a touchTimeout, this means that there's another\n // touch down and we are doing another touch, so we shouldn't open the\n // context menu.\n invalidateContextMenu = true;\n } else {\n // open the context menu with the first touch's clientX and clientY\n // if the touch is not moving\n touchTimeout = window.setTimeout(() => {\n touchTimeout = 0;\n\n if (!invalidateContextMenu && !this.state.isResizing) {\n //zsviczian - avoid context menu during resizing on Mobiles\n this.handleCanvasContextMenu(event);\n }\n }, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.TOUCH_CTX_MENU_TIMEOUT);\n }\n }\n };\n\n this.resetContextMenuTimer = () => {\n clearTimeout(touchTimeout);\n touchTimeout = 0;\n invalidateContextMenu = false;\n };\n /**\r\n * pointerup may not fire in certian cases (user tabs away...), so in order\r\n * to properly cleanup pointerdown state, we need to fire any hanging\r\n * pointerup handlers manually\r\n */\n\n\n this.maybeCleanupAfterMissingPointerUp = event => {\n lastPointerUp === null || lastPointerUp === void 0 ? void 0 : lastPointerUp();\n this.missingPointerEventCleanupEmitter.trigger(event).clear();\n }; // Returns whether the event is a panning\n\n\n this.handleCanvasPanUsingWheelOrSpaceDrag = event => {\n if (!(gesture.pointers.size <= 1 && (event.button === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.POINTER_BUTTON.WHEEL || event.button === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.POINTER_BUTTON.MAIN && isHoldingSpace || (0,_appState__WEBPACK_IMPORTED_MODULE_23__.isHandToolActive)(this.state) || //zsviczian\n (0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_70__.isTouchInPenMode)(this.state, event) || //!isLaserPointerActive added by zsviczian (but don't remember why....)\n this.state.viewModeEnabled && !(0,_appState__WEBPACK_IMPORTED_MODULE_23__.isLaserPointerActive)(this.state)))) {\n return false;\n }\n\n isPanning = true; // due to event.preventDefault below, container wouldn't get focus\n // automatically\n\n this.focusContainer(); // preventing defualt while text editing messes with cursor/focus\n\n if (!this.state.editingTextElement) {\n // necessary to prevent browser from scrolling the page if excalidraw\n // not full-page #4489\n //\n // as such, the above is broken when panning canvas while in wysiwyg\n event.preventDefault();\n }\n\n let nextPastePrevented = false;\n const isLinux = typeof window === undefined ? false : /Linux/.test(window.navigator.platform);\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.GRABBING);\n let {\n clientX: lastX,\n clientY: lastY\n } = event;\n const onPointerMove = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdatesThrottled)(event => {\n const deltaX = lastX - event.clientX;\n const deltaY = lastY - event.clientY;\n lastX = event.clientX;\n lastY = event.clientY;\n /*\r\n * Prevent paste event if we move while middle clicking on Linux.\r\n * See issue #1383.\r\n */\n\n if (isLinux && !nextPastePrevented && (Math.abs(deltaX) > 1 || Math.abs(deltaY) > 1)) {\n nextPastePrevented = true;\n /* Prevent the next paste event */\n\n const preventNextPaste = event => {\n document.body.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.PASTE, preventNextPaste);\n event.stopPropagation();\n };\n /*\r\n * Reenable next paste in case of disabled middle click paste for\r\n * any reason:\r\n * - right click paste\r\n * - empty clipboard\r\n */\n\n\n const enableNextPaste = () => {\n setTimeout(() => {\n document.body.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.PASTE, preventNextPaste);\n window.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_UP, enableNextPaste);\n }, 100);\n };\n\n document.body.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.PASTE, preventNextPaste);\n window.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_UP, enableNextPaste);\n }\n\n this.translateCanvas({\n scrollX: this.state.scrollX - deltaX / this.state.zoom.value,\n scrollY: this.state.scrollY - deltaY / this.state.zoom.value\n });\n });\n const teardown = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(lastPointerUp = () => {\n lastPointerUp = null;\n isPanning = false;\n\n if (!isHoldingSpace) {\n if (this.state.viewModeEnabled) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.GRAB);\n } else {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursorForShape)(this.interactiveCanvas, this.state);\n }\n }\n\n this.setState({\n cursorButton: \"up\"\n });\n this.savePointer(event.clientX, event.clientY, \"up\");\n window.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_MOVE, onPointerMove);\n window.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_UP, teardown);\n window.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.BLUR, teardown);\n onPointerMove.flush();\n });\n window.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.BLUR, teardown);\n window.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_MOVE, onPointerMove, {\n passive: true\n });\n window.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_UP, teardown);\n return true;\n };\n\n this.clearSelectionIfNotUsingSelection = () => {\n if (this.state.activeTool.type !== \"selection\" && this.state.activeTool.type !== \"lasso\") {\n this.setState({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)({}, this.state),\n selectedGroupIds: {},\n editingGroupId: null,\n activeEmbeddable: null\n });\n }\n };\n /**\r\n * @returns whether the pointer event has been completely handled\r\n */\n\n\n this.handleSelectionOnPointerDown = (event, pointerDownState) => {\n var _a, _b, _c, _d, _e;\n\n if (this.state.activeTool.type === \"selection\" || this.state.activeTool.type === \"lasso\") {\n const elements = this.scene.getNonDeletedElements();\n const elementsMap = this.scene.getNonDeletedElementsMap();\n const selectedElements = this.scene.getSelectedElements(this.state);\n\n if (selectedElements.length === 1 && !((_a = this.state.selectedLinearElement) === null || _a === void 0 ? void 0 : _a.isEditing) && !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(selectedElements[0]) && !((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLinearElement)(selectedElements[0]) && (this.editorInterface.userAgent.isMobileDevice || selectedElements[0].points.length === 2)) && !(this.state.selectedLinearElement && this.state.selectedLinearElement.hoverPointIndex !== -1)) {\n const elementWithTransformHandleType = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getElementWithTransformHandleType)(elements, this.state, pointerDownState.origin.x, pointerDownState.origin.y, this.state.zoom, event.pointerType, this.scene.getNonDeletedElementsMap(), this.editorInterface);\n\n if (elementWithTransformHandleType != null) {\n if (elementWithTransformHandleType.transformHandleType === \"rotation\") {\n this.setState({\n resizingElement: elementWithTransformHandleType.element\n });\n pointerDownState.resize.handleType = elementWithTransformHandleType.transformHandleType;\n } else if (this.state.croppingElementId) {\n pointerDownState.resize.handleType = elementWithTransformHandleType.transformHandleType;\n } else {\n this.setState({\n resizingElement: elementWithTransformHandleType.element\n });\n pointerDownState.resize.handleType = elementWithTransformHandleType.transformHandleType;\n }\n }\n } else if (selectedElements.length > 1) {\n pointerDownState.resize.handleType = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getTransformHandleTypeFromCoords)((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getCommonBounds)(selectedElements), pointerDownState.origin.x, pointerDownState.origin.y, this.state.zoom, event.pointerType, this.editorInterface);\n }\n\n if (pointerDownState.resize.handleType) {\n pointerDownState.resize.isResizing = true;\n pointerDownState.resize.offset = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.tupleToCoors)((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getResizeOffsetXY)(pointerDownState.resize.handleType, selectedElements, elementsMap, pointerDownState.origin.x, pointerDownState.origin.y));\n\n if (selectedElements.length === 1 && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLinearElement)(selectedElements[0]) && selectedElements[0].points.length === 2) {\n pointerDownState.resize.arrowDirection = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getResizeArrowDirection)(pointerDownState.resize.handleType, selectedElements[0]);\n }\n } else {\n if (this.state.selectedLinearElement) {\n const linearElementEditor = this.state.selectedLinearElement;\n const ret = _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.handlePointerDown(event, this, this.store, pointerDownState.origin, linearElementEditor, this.scene);\n\n if (ret.hitElement) {\n pointerDownState.hit.element = ret.hitElement;\n }\n\n if (ret.linearElementEditor) {\n this.setState({\n selectedLinearElement: ret.linearElementEditor\n });\n }\n\n if (ret.didAddPoint) {\n return true;\n }\n }\n\n const allHitElements = this.getElementsAtPosition(pointerDownState.origin.x, pointerDownState.origin.y, {\n includeLockedElements: true\n });\n const unlockedHitElements = allHitElements.filter(e => !e.locked); // Cannot set preferSelected in getElementAtPosition as we do in pointer move; consider:\n // A & B: both unlocked, A selected, B on top, A & B overlaps in some way\n // we want to select B when clicking on the overlapping area\n\n const hitElementMightBeLocked = this.getElementAtPosition(pointerDownState.origin.x, pointerDownState.origin.y, {\n allHitElements\n });\n\n if (!hitElementMightBeLocked || hitElementMightBeLocked.id !== this.state.activeLockedId) {\n this.setState({\n activeLockedId: null\n });\n }\n\n const isUnlockedHitElSelected = unlockedHitElements.some(el => this.state.selectedElementIds[el.id]); //zsviczian\n // Prioritize unlocked elements over locked ones\n\n if (!isUnlockedHitElSelected && unlockedHitElements.length > 0) {\n //zsviczian https://github.com/excalidraw/excalidraw/pull/9582\n // If there are unlocked elements, use the topmost one\n pointerDownState.hit.element = unlockedHitElements[unlockedHitElements.length - 1];\n } else if (hitElementMightBeLocked && hitElementMightBeLocked.locked && !isUnlockedHitElSelected //zsviczian\n ) {\n pointerDownState.hit.element = null;\n } else {\n // hitElement may already be set above, so check first\n pointerDownState.hit.element = (_b = pointerDownState.hit.element) !== null && _b !== void 0 ? _b : this.getElementAtPosition(pointerDownState.origin.x, pointerDownState.origin.y);\n }\n\n this.hitLinkElement = this.getElementLinkAtPosition(pointerDownState.origin, hitElementMightBeLocked);\n\n if (this.hitLinkElement) {\n return true;\n }\n\n if (this.state.croppingElementId && ((_c = pointerDownState.hit.element) === null || _c === void 0 ? void 0 : _c.id) !== this.state.croppingElementId) {\n this.finishImageCropping();\n }\n\n if (pointerDownState.hit.element) {\n // Early return if pointer is hitting link icon\n const hitLinkElement = this.getElementLinkAtPosition({\n x: pointerDownState.origin.x,\n y: pointerDownState.origin.y\n }, pointerDownState.hit.element);\n\n if (hitLinkElement) {\n return false;\n }\n } // For overlapped elements one position may hit\n // multiple elements\n\n\n pointerDownState.hit.allHitElements = unlockedHitElements;\n const hitElement = pointerDownState.hit.element;\n const someHitElementIsSelected = pointerDownState.hit.allHitElements.some(element => this.isASelectedElement(element));\n\n if ((hitElement === null || !someHitElementIsSelected) && !event.shiftKey && !pointerDownState.hit.hasHitCommonBoundingBoxOfSelectedElements) {\n this.clearSelection(hitElement);\n }\n\n if ((_d = this.state.selectedLinearElement) === null || _d === void 0 ? void 0 : _d.isEditing) {\n this.setState({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)({\n [this.state.selectedLinearElement.elementId]: true\n }, this.state)\n }); // If we click on something\n } else if (hitElement != null) {\n // == deep selection ==\n // on CMD/CTRL, drill down to hit element regardless of groups etc.\n if (event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD]) {\n if (event.altKey) {\n // ctrl + alt means we're lasso selecting - start lasso trail and switch to lasso tool\n // Close any open dialogs that might interfere with lasso selection\n if (((_e = this.state.openDialog) === null || _e === void 0 ? void 0 : _e.name) === \"elementLinkSelector\") {\n this.setOpenDialog(null);\n }\n\n this.lassoTrail.startPath(pointerDownState.origin.x, pointerDownState.origin.y, event.shiftKey);\n this.setActiveTool({\n type: \"lasso\",\n fromSelection: true\n });\n return false;\n }\n\n if (!this.state.selectedElementIds[hitElement.id]) {\n pointerDownState.hit.wasAddedToSelection = true;\n }\n\n this.setState(prevState => Object.assign(Object.assign({}, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.editGroupForSelectedElement)(prevState, hitElement)), {\n previousSelectedElementIds: this.state.selectedElementIds\n })); // mark as not completely handled so as to allow dragging etc.\n\n return false;\n } // deselect if item is selected\n // if shift is not clicked, this will always return true\n // otherwise, it will trigger selection based on current\n // state of the box\n\n\n if (!this.state.selectedElementIds[hitElement.id]) {\n // if we are currently editing a group, exiting editing mode and deselect the group.\n if (this.state.editingGroupId && !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElementInGroup)(hitElement, this.state.editingGroupId)) {\n this.setState({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)({}, this.state),\n selectedGroupIds: {},\n editingGroupId: null,\n activeEmbeddable: null\n });\n } // Add hit element to selection. At this point if we're not holding\n // SHIFT the previously selected element(s) were deselected above\n // (make sure you use setState updater to use latest state)\n // With shift-selection, we want to make sure that frames and their containing\n // elements are not selected at the same time.\n\n\n if (!someHitElementIsSelected && !pointerDownState.hit.hasHitCommonBoundingBoxOfSelectedElements) {\n this.setState(prevState => {\n var _a;\n\n let nextSelectedElementIds = Object.assign(Object.assign({}, prevState.selectedElementIds), {\n [hitElement.id]: true\n });\n const previouslySelectedElements = [];\n Object.keys(prevState.selectedElementIds).forEach(id => {\n const element = this.scene.getElement(id);\n element && previouslySelectedElements.push(element);\n }); // if hitElement is frame-like, deselect all of its elements\n // if they are selected\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isFrameLikeElement)(hitElement)) {\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getFrameChildren)(previouslySelectedElements, hitElement.id).forEach(element => {\n delete nextSelectedElementIds[element.id];\n });\n } else if (hitElement.frameId) {\n // if hitElement is in a frame and its frame has been selected\n // disable selection for the given element\n if (nextSelectedElementIds[hitElement.frameId]) {\n delete nextSelectedElementIds[hitElement.id];\n }\n } else {\n // hitElement is neither a frame nor an element in a frame\n // but since hitElement could be in a group with some frames\n // this means selecting hitElement will have the frames selected as well\n // because we want to keep the invariant:\n // - frames and their elements are not selected at the same time\n // we deselect elements in those frames that were previously selected\n const groupIds = hitElement.groupIds;\n const framesInGroups = new Set(groupIds.flatMap(gid => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getElementsInGroup)(this.scene.getNonDeletedElements(), gid)).filter(element => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isFrameLikeElement)(element)).map(frame => frame.id));\n\n if (framesInGroups.size > 0) {\n previouslySelectedElements.forEach(element => {\n if (element.frameId && framesInGroups.has(element.frameId)) {\n // deselect element and groups containing the element\n delete nextSelectedElementIds[element.id];\n element.groupIds.flatMap(gid => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getElementsInGroup)(this.scene.getNonDeletedElements(), gid)).forEach(element => {\n delete nextSelectedElementIds[element.id];\n });\n }\n });\n }\n } // Finally, in shape selection mode, we'd like to\n // keep only one shape or group selected at a time.\n // This means, if the hitElement is a different shape or group\n // than the previously selected ones, we deselect the previous ones\n // and select the hitElement\n\n\n if (((_a = prevState.openDialog) === null || _a === void 0 ? void 0 : _a.name) === \"elementLinkSelector\") {\n if (!hitElement.groupIds.some(gid => prevState.selectedGroupIds[gid])) {\n nextSelectedElementIds = {\n [hitElement.id]: true\n };\n }\n }\n\n return Object.assign(Object.assign({}, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.selectGroupsForSelectedElements)({\n editingGroupId: prevState.editingGroupId,\n selectedElementIds: nextSelectedElementIds\n }, this.scene.getNonDeletedElements(), prevState, this)), {\n showHyperlinkPopup: hitElement.link || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isEmbeddableElement)(hitElement) ? \"info\" : false\n });\n });\n pointerDownState.hit.wasAddedToSelection = true;\n }\n }\n }\n\n this.setState({\n previousSelectedElementIds: this.state.selectedElementIds\n });\n }\n }\n\n return false;\n };\n\n this.handleTextOnPointerDown = (event, pointerDownState) => {\n // if we're currently still editing text, clicking outside\n // should only finalize it, not create another (irrespective\n // of state.activeTool.locked)\n if (this.state.editingTextElement) {\n return;\n }\n\n let sceneX = pointerDownState.origin.x;\n let sceneY = pointerDownState.origin.y;\n const element = this.getElementAtPosition(sceneX, sceneY, {\n includeBoundTextElement: true\n }); // FIXME\n\n let container = this.getTextBindableContainerAtPosition(sceneX, sceneY);\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.hasBoundTextElement)(element)) {\n container = element;\n sceneX = element.x + element.width / 2;\n sceneY = element.y + element.height / 2;\n }\n\n this.startTextEditing({\n sceneX,\n sceneY,\n insertAtParentCenter: !event.altKey,\n container,\n autoEdit: false\n });\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.resetCursor)(this.interactiveCanvas);\n\n if (!this.state.activeTool.locked) {\n this.setState({\n activeTool: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateActiveTool)(this.state, {\n type: this.state.preferredSelectionTool.type\n })\n });\n }\n };\n\n this.handleFreeDrawElementOnPointerDown = (event, elementType, pointerDownState) => {\n // Begin a mark capture. This does not have to update state yet.\n const [gridX, gridY] = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(pointerDownState.origin.x, pointerDownState.origin.y, null);\n const topLayerFrame = this.getTopLayerFrameAtSceneCoords({\n x: gridX,\n y: gridY\n });\n const strokeOptions = this.state.currentStrokeOptions; //zsviczian\n\n const simulatePressure = (strokeOptions === null || strokeOptions === void 0 ? void 0 : strokeOptions.constantPressure //zsviczian\n ) ? false : event.pressure === 0.5;\n const element = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newFreeDrawElement)(Object.assign(Object.assign({\n type: elementType,\n x: gridX,\n y: gridY,\n strokeColor: this.state.currentItemStrokeColor,\n backgroundColor: this.state.currentItemBackgroundColor,\n fillStyle: this.state.currentItemFillStyle,\n strokeWidth: this.state.currentItemStrokeWidth,\n strokeStyle: this.state.currentItemStrokeStyle,\n roughness: this.state.currentItemRoughness,\n opacity: this.state.currentItemOpacity,\n roundness: null,\n simulatePressure,\n locked: false\n }, strokeOptions //zsviczian\n ? {\n customData: {\n strokeOptions\n }\n } : {}), {\n frameId: topLayerFrame ? topLayerFrame.id : null,\n points: [(0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(0, 0)],\n pressures: simulatePressure ? [] : [(strokeOptions === null || strokeOptions === void 0 ? void 0 : strokeOptions.constantPressure) ? 1 : event.pressure]\n })); //zsviczian\n\n if (strokeOptions === null || strokeOptions === void 0 ? void 0 : strokeOptions.highlighter) {\n this.scene.insertElement(element, 0);\n } else {\n this.scene.insertElement(element);\n }\n\n this.setState(prevState => {\n const nextSelectedElementIds = Object.assign({}, prevState.selectedElementIds);\n delete nextSelectedElementIds[element.id];\n return {\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)(nextSelectedElementIds, prevState)\n };\n });\n const boundElement = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getHoveredElementForBinding)(pointerDownState.origin, this.scene.getNonDeletedElements(), this.scene.getNonDeletedElementsMap(), this.state.zoom);\n this.setState({\n newElement: element,\n startBoundElement: boundElement,\n suggestedBindings: []\n });\n };\n\n this.insertIframeElement = ({\n sceneX,\n sceneY,\n width,\n height\n }) => {\n var _a;\n\n const [gridX, gridY] = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(sceneX, sceneY, ((_a = this.lastPointerDownEvent) === null || _a === void 0 ? void 0 : _a[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD]) ? null : this.getEffectiveGridSize());\n const element = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newIframeElement)({\n type: \"iframe\",\n x: gridX,\n y: gridY,\n strokeColor: \"transparent\",\n backgroundColor: \"transparent\",\n fillStyle: this.state.currentItemFillStyle,\n strokeWidth: this.state.currentItemStrokeWidth,\n strokeStyle: this.state.currentItemStrokeStyle,\n roughness: this.state.currentItemRoughness,\n roundness: this.getCurrentItemRoundness(\"iframe\"),\n opacity: this.state.currentItemOpacity,\n locked: false,\n width,\n height\n });\n this.scene.insertElement(element);\n return element;\n }; //create rectangle element with youtube top left on nearest grid point width / hight 640/360\n\n\n this.insertEmbeddableElement = ({\n sceneX,\n sceneY,\n link\n }) => {\n var _a;\n\n const [gridX, gridY] = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(sceneX, sceneY, ((_a = this.lastPointerDownEvent) === null || _a === void 0 ? void 0 : _a[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD]) ? null : this.getEffectiveGridSize());\n const embedLink = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getEmbedLink)(link);\n\n if (!embedLink) {\n return;\n }\n\n if (embedLink.error instanceof URIError) {\n this.setToast({\n message: (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"toast.unrecognizedLinkFormat\"),\n closable: true\n });\n }\n\n const element = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newEmbeddableElement)({\n type: \"embeddable\",\n x: gridX,\n y: gridY,\n strokeColor: \"transparent\",\n backgroundColor: \"transparent\",\n fillStyle: this.state.currentItemFillStyle,\n strokeWidth: this.state.currentItemStrokeWidth,\n strokeStyle: this.state.currentItemStrokeStyle,\n roughness: this.state.currentItemRoughness,\n roundness: this.getCurrentItemRoundness(\"embeddable\"),\n opacity: this.state.currentItemOpacity,\n locked: false,\n width: embedLink.intrinsicSize.w,\n height: embedLink.intrinsicSize.h,\n link\n });\n this.scene.insertElement(element);\n return element;\n };\n\n this.newImagePlaceholder = ({\n sceneX,\n sceneY,\n addToFrameUnderCursor = true\n }) => {\n var _a;\n\n const [gridX, gridY] = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(sceneX, sceneY, ((_a = this.lastPointerDownEvent) === null || _a === void 0 ? void 0 : _a[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD]) ? null : this.getEffectiveGridSize());\n const topLayerFrame = addToFrameUnderCursor ? this.getTopLayerFrameAtSceneCoords({\n x: gridX,\n y: gridY\n }) : null;\n const placeholderSize = 100 / this.state.zoom.value;\n return (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newImageElement)({\n type: \"image\",\n strokeColor: this.state.currentItemStrokeColor,\n backgroundColor: this.state.currentItemBackgroundColor,\n fillStyle: this.state.currentItemFillStyle,\n strokeWidth: this.state.currentItemStrokeWidth,\n strokeStyle: this.state.currentItemStrokeStyle,\n roughness: this.state.currentItemRoughness,\n roundness: null,\n opacity: this.state.currentItemOpacity,\n locked: false,\n frameId: topLayerFrame ? topLayerFrame.id : null,\n x: gridX - placeholderSize / 2,\n y: gridY - placeholderSize / 2,\n width: placeholderSize,\n height: placeholderSize\n });\n };\n\n this.handleLinearElementOnPointerDown = (event, elementType, pointerDownState) => {\n if (this.state.multiElement) {\n const {\n multiElement\n } = this.state; // finalize if completing a loop\n\n if (multiElement.type === \"line\" && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isPathALoop)(multiElement.points, this.state.zoom.value)) {\n this.scene.mutateElement(multiElement, {\n lastCommittedPoint: multiElement.points[multiElement.points.length - 1]\n });\n this.actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_8__.actionFinalize);\n return;\n } // Elbow arrows cannot be created by putting down points\n // only the start and end points can be defined\n\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(multiElement) && multiElement.points.length > 1) {\n this.scene.mutateElement(multiElement, {\n lastCommittedPoint: multiElement.points[multiElement.points.length - 1]\n });\n this.actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_8__.actionFinalize);\n return;\n }\n\n const {\n x: rx,\n y: ry,\n lastCommittedPoint\n } = multiElement; // clicking inside commit zone → finalize arrow\n\n if (multiElement.points.length > 1 && lastCommittedPoint && (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointDistance)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(pointerDownState.origin.x - rx, pointerDownState.origin.y - ry), lastCommittedPoint) < _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.LINE_CONFIRM_THRESHOLD) {\n this.actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_8__.actionFinalize);\n return;\n }\n\n this.setState(prevState => ({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)(Object.assign(Object.assign({}, prevState.selectedElementIds), {\n [multiElement.id]: true\n }), prevState)\n })); // clicking outside commit zone → update reference for last committed\n // point\n\n this.scene.mutateElement(multiElement, {\n lastCommittedPoint: multiElement.points[multiElement.points.length - 1]\n });\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.POINTER);\n } else {\n const [gridX, gridY] = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(pointerDownState.origin.x, pointerDownState.origin.y, event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] ? null : this.getEffectiveGridSize());\n const topLayerFrame = this.getTopLayerFrameAtSceneCoords({\n x: gridX,\n y: gridY\n });\n /* If arrow is pre-arrowheads, it will have undefined for both start and end arrowheads.\r\n If so, we want it to be null for start and \"arrow\" for end. If the linear item is not\r\n an arrow, we want it to be null for both. Otherwise, we want it to use the\r\n values from appState. */\n\n const {\n currentItemStartArrowhead,\n currentItemEndArrowhead\n } = this.state;\n const [startArrowhead, endArrowhead] = elementType === \"arrow\" ? [currentItemStartArrowhead, currentItemEndArrowhead] : [null, null];\n const element = elementType === \"arrow\" ? (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newArrowElement)({\n type: elementType,\n x: gridX,\n y: gridY,\n strokeColor: this.state.currentItemStrokeColor,\n backgroundColor: this.state.currentItemBackgroundColor,\n fillStyle: this.state.currentItemFillStyle,\n strokeWidth: this.state.currentItemStrokeWidth,\n strokeStyle: this.state.currentItemStrokeStyle,\n roughness: this.state.currentItemRoughness,\n opacity: this.state.currentItemOpacity,\n roundness: this.state.currentItemArrowType === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.ARROW_TYPE.round ? {\n type: _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.ROUNDNESS.PROPORTIONAL_RADIUS\n } : // note, roundness doesn't have any effect for elbow arrows,\n // but it's best to set it to null as well\n null,\n startArrowhead,\n endArrowhead,\n locked: false,\n frameId: topLayerFrame ? topLayerFrame.id : null,\n elbowed: this.state.currentItemArrowType === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.ARROW_TYPE.elbow,\n fixedSegments: this.state.currentItemArrowType === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.ARROW_TYPE.elbow ? [] : null\n }) : (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newLinearElement)({\n type: elementType,\n x: gridX,\n y: gridY,\n strokeColor: this.state.currentItemStrokeColor,\n backgroundColor: this.state.currentItemBackgroundColor,\n fillStyle: this.state.currentItemFillStyle,\n strokeWidth: this.state.currentItemStrokeWidth,\n strokeStyle: this.state.currentItemStrokeStyle,\n roughness: this.state.currentItemRoughness,\n opacity: this.state.currentItemOpacity,\n roundness: this.state.currentItemRoundness === \"round\" ? {\n type: _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.ROUNDNESS.PROPORTIONAL_RADIUS\n } : null,\n locked: false,\n frameId: topLayerFrame ? topLayerFrame.id : null\n });\n this.setState(prevState => {\n const nextSelectedElementIds = Object.assign({}, prevState.selectedElementIds);\n delete nextSelectedElementIds[element.id];\n return {\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)(nextSelectedElementIds, prevState)\n };\n });\n this.scene.mutateElement(element, {\n points: [...element.points, (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(0, 0)]\n });\n const boundElement = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getHoveredElementForBinding)(pointerDownState.origin, this.scene.getNonDeletedElements(), this.scene.getNonDeletedElementsMap(), this.state.zoom, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(element), (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(element));\n this.scene.insertElement(element);\n this.setState({\n newElement: element,\n startBoundElement: boundElement,\n suggestedBindings: []\n });\n }\n };\n\n this.createGenericElementOnPointerDown = (elementType, pointerDownState) => {\n var _a;\n\n const [gridX, gridY] = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(pointerDownState.origin.x, pointerDownState.origin.y, ((_a = this.lastPointerDownEvent) === null || _a === void 0 ? void 0 : _a[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD]) ? null : this.getEffectiveGridSize());\n const topLayerFrame = this.getTopLayerFrameAtSceneCoords({\n x: gridX,\n y: gridY\n });\n const baseElementAttributes = {\n x: gridX,\n y: gridY,\n strokeColor: this.state.currentItemStrokeColor,\n backgroundColor: this.state.currentItemBackgroundColor,\n fillStyle: this.state.currentItemFillStyle,\n strokeWidth: this.state.currentItemStrokeWidth,\n strokeStyle: this.state.currentItemStrokeStyle,\n roughness: this.state.currentItemRoughness,\n opacity: this.state.currentItemOpacity,\n roundness: this.getCurrentItemRoundness(elementType),\n locked: false,\n frameId: topLayerFrame ? topLayerFrame.id : null\n };\n let element;\n\n if (elementType === \"embeddable\") {\n element = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newEmbeddableElement)(Object.assign({\n type: \"embeddable\"\n }, baseElementAttributes));\n } else {\n element = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newElement)(Object.assign({\n type: elementType\n }, baseElementAttributes));\n }\n\n if (element.type === \"selection\") {\n this.setState({\n selectionElement: element\n });\n } else {\n this.scene.insertElement(element);\n this.setState({\n multiElement: null,\n newElement: element\n });\n }\n };\n\n this.createFrameElementOnPointerDown = (pointerDownState, type) => {\n var _a;\n\n const [gridX, gridY] = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(pointerDownState.origin.x, pointerDownState.origin.y, ((_a = this.lastPointerDownEvent) === null || _a === void 0 ? void 0 : _a[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD]) ? null : this.getEffectiveGridSize());\n const constructorOpts = Object.assign(Object.assign(Object.assign({\n x: gridX,\n y: gridY,\n opacity: this.state.currentItemOpacity,\n locked: false\n }, type === \"frame\" && this.state.currentItemFrameRole ? {\n frameRole: this.state.currentItemFrameRole\n } : {}), _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.FRAME_STYLE), this.state.frameColor ? {\n //zsviczian\n customData: {\n frameColor: this.state.frameColor\n }\n } : {});\n const frame = type === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.TOOL_TYPE.magicframe ? (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newMagicFrameElement)(constructorOpts) : (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newFrameElement)(constructorOpts, this.scene.getNonDeletedElements()); //zsviczian\n\n this.scene.insertElement(frame);\n this.setState({\n multiElement: null,\n newElement: frame\n });\n };\n\n this.restoreReadyToEraseElements = () => {\n this.elementsPendingErasure = new Set();\n this.triggerRender();\n };\n\n this.eraseElements = () => {\n let didChange = false;\n const elements = this.scene.getElementsIncludingDeleted().map(ele => {\n if (this.elementsPendingErasure.has(ele.id) || ele.frameId && this.elementsPendingErasure.has(ele.frameId) || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isBoundToContainer)(ele) && this.elementsPendingErasure.has(ele.containerId)) {\n didChange = true;\n return (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newElementWith)(ele, {\n isDeleted: true\n });\n }\n\n return ele;\n });\n this.elementsPendingErasure = new Set();\n\n if (didChange) {\n this.store.scheduleCapture();\n this.scene.replaceAllElements(elements);\n }\n };\n\n this.initializeImage = async (placeholderImageElement, imageFile) => {\n var _a, _b, _c; // at this point this should be guaranteed image file, but we do this check\n // to satisfy TS down the line\n\n\n if (!(0,_data_blob__WEBPACK_IMPORTED_MODULE_33__.isSupportedImageFile)(imageFile)) {\n throw new Error((0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"errors.unsupportedFileType\"));\n }\n\n const mimeType = imageFile.type;\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, \"wait\");\n\n if (mimeType === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.MIME_TYPES.svg) {\n try {\n imageFile = (0,_data_blob__WEBPACK_IMPORTED_MODULE_33__.SVGStringToFile)((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.normalizeSVG)(await imageFile.text()), imageFile.name);\n } catch (error) {\n console.warn(error);\n throw new Error((0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"errors.svgImageInsertError\"));\n }\n } // generate image id (by default the file digest) before any\n // resizing/compression takes place to keep it more portable\n\n\n const fileId = await (((_b = (_a = this.props).generateIdForFile) === null || _b === void 0 ? void 0 : _b.call(_a, imageFile)) || (0,_data_blob__WEBPACK_IMPORTED_MODULE_33__.generateIdFromFile)(imageFile));\n\n if (!fileId) {\n console.warn(\"Couldn't generate file id or the supplied `generateIdForFile` didn't resolve to one.\");\n throw new Error((0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"errors.imageInsertError\"));\n }\n\n const existingFileData = this.files[fileId];\n\n if (!(existingFileData === null || existingFileData === void 0 ? void 0 : existingFileData.dataURL)) {\n try {\n imageFile = await (0,_data_blob__WEBPACK_IMPORTED_MODULE_33__.resizeImageFile)(imageFile, {\n maxWidthOrHeight: _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT\n });\n } catch (error) {\n console.error(\"Error trying to resizing image file on insertion\", error);\n }\n\n if (imageFile.size > _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.MAX_ALLOWED_FILE_BYTES) {\n throw new Error((0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"errors.fileTooBig\", {\n maxSize: `${Math.trunc(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.MAX_ALLOWED_FILE_BYTES / 1024 / 1024)}MB`\n }));\n }\n }\n\n const dataURL = ((_c = this.files[fileId]) === null || _c === void 0 ? void 0 : _c.dataURL) || (await (0,_data_blob__WEBPACK_IMPORTED_MODULE_33__.getDataURL)(imageFile));\n return new Promise(async (resolve, reject) => {\n var _a, _b;\n\n try {\n let initializedImageElement = this.getLatestInitializedImageElement(placeholderImageElement, fileId);\n this.addMissingFiles([{\n mimeType,\n id: fileId,\n dataURL,\n created: Date.now(),\n lastRetrieved: Date.now(),\n //@ts-ignore\n name: (imageFile === null || imageFile === void 0 ? void 0 : imageFile.name) && imageFile.name !== \"image.png\" ? imageFile.name : undefined // zsviczian\n\n }]);\n\n if (!this.imageCache.get(fileId)) {\n this.addNewImagesToImageCache();\n const {\n erroredFiles\n } = await this.updateImageCache([initializedImageElement]);\n\n if (erroredFiles.size) {\n throw new Error(\"Image cache update resulted with an error.\");\n }\n }\n\n const imageHTML = await ((_a = this.imageCache.get(fileId)) === null || _a === void 0 ? void 0 : _a.image);\n\n if (imageHTML && ((_b = this.state.newElement) === null || _b === void 0 ? void 0 : _b.id) !== initializedImageElement.id) {\n initializedImageElement = this.getLatestInitializedImageElement(placeholderImageElement, fileId);\n const naturalDimensions = this.getImageNaturalDimensions(initializedImageElement, imageHTML); // no need to create a new instance anymore, just assign the natural dimensions\n\n Object.assign(initializedImageElement, naturalDimensions);\n }\n\n resolve(initializedImageElement);\n } catch (error) {\n console.error(error);\n reject(new Error((0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"errors.imageInsertError\")));\n }\n });\n };\n /**\r\n * use during async image initialization,\r\n * when the placeholder image could have been modified in the meantime,\r\n * and when you don't want to loose those modifications\r\n */\n\n\n this.getLatestInitializedImageElement = (imagePlaceholder, fileId) => {\n var _a;\n\n const latestImageElement = (_a = this.scene.getElement(imagePlaceholder.id)) !== null && _a !== void 0 ? _a : imagePlaceholder;\n return (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newElementWith)(latestImageElement, {\n fileId\n });\n };\n\n this.onImageToolbarButtonClick = async () => {\n try {\n const clientX = this.state.width / 2 + this.state.offsetLeft;\n const clientY = this.state.height / 2 + this.state.offsetTop;\n const {\n x,\n y\n } = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)({\n clientX,\n clientY\n }, this.state);\n const imageFiles = await (0,_data_filesystem__WEBPACK_IMPORTED_MODULE_34__.fileOpen)({\n description: \"Image\",\n extensions: Object.keys(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.IMAGE_MIME_TYPES),\n multiple: true\n });\n this.insertImages(imageFiles, x, y);\n } catch (error) {\n if (error.name !== \"AbortError\") {\n console.error(error);\n } else {\n console.warn(error);\n }\n\n this.setState({\n newElement: null,\n activeTool: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateActiveTool)(this.state, {\n type: this.state.preferredSelectionTool.type\n })\n }, () => {\n this.actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_8__.actionFinalize);\n });\n }\n };\n\n this.getImageNaturalDimensions = (imageElement, imageHTML) => {\n const minHeight = Math.max(this.state.height - 120, 160); // max 65% of canvas height, clamped to <300px, vh - 120px>\n\n const maxHeight = Math.min(minHeight, Math.floor(this.state.height * 0.5) / this.state.zoom.value);\n const height = Math.min(imageHTML.naturalHeight, maxHeight);\n const width = height * (imageHTML.naturalWidth / imageHTML.naturalHeight); // add current imageElement width/height to account for previous centering\n // of the placeholder image\n\n const x = imageElement.x + imageElement.width / 2 - width / 2;\n const y = imageElement.y + imageElement.height / 2 - height / 2;\n return {\n x,\n y,\n width,\n height,\n crop: null\n };\n };\n /** updates image cache, refreshing updated elements and/or setting status\r\n to error for images that fail during <img> element creation */\n\n\n this.updateImageCache = async (elements, files = this.files) => {\n const {\n updatedFiles,\n erroredFiles\n } = await (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.updateImageCache)({\n imageCache: this.imageCache,\n fileIds: elements.map(element => element.fileId),\n files\n });\n\n if (erroredFiles.size) {\n this.store.scheduleAction(_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.CaptureUpdateAction.NEVER);\n this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().map(element => {\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isInitializedImageElement)(element) && erroredFiles.has(element.fileId)) {\n return (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newElementWith)(element, {\n status: \"error\"\n });\n }\n\n return element;\n }));\n }\n\n return {\n updatedFiles,\n erroredFiles\n };\n };\n /** adds new images to imageCache and re-renders if needed */\n\n\n this.addNewImagesToImageCache = async (imageElements = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getInitializedImageElements)(this.scene.getNonDeletedElements()), files = this.files) => {\n const uncachedImageElements = imageElements.filter(element => !element.isDeleted && !this.imageCache.has(element.fileId));\n\n if (uncachedImageElements.length) {\n const {\n updatedFiles\n } = await this.updateImageCache(uncachedImageElements, files);\n\n if (updatedFiles.size) {\n for (const element of uncachedImageElements) {\n if (updatedFiles.has(element.fileId)) {\n _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.ShapeCache.delete(element);\n }\n }\n }\n\n if (updatedFiles.size) {\n this.scene.triggerUpdate();\n }\n }\n };\n /** generally you should use `addNewImagesToImageCache()` directly if you need\r\n * to render new images. This is just a failsafe */\n\n\n this.scheduleImageRefresh = lodash_throttle__WEBPACK_IMPORTED_MODULE_1___default()(() => {\n this.addNewImagesToImageCache();\n }, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.IMAGE_RENDER_TIMEOUT);\n\n this.updateBindingEnabledOnPointerMove = event => {\n const shouldEnableBinding = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.shouldEnableBindingForPointerEvent)(event);\n\n if (this.state.isBindingEnabled !== shouldEnableBinding) {\n this.setState({\n isBindingEnabled: shouldEnableBinding\n });\n }\n };\n\n this.maybeSuggestBindingAtCursor = (pointerCoords, considerAll) => {\n const hoveredBindableElement = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getHoveredElementForBinding)(pointerCoords, this.scene.getNonDeletedElements(), this.scene.getNonDeletedElementsMap(), this.state.zoom, false, considerAll);\n this.setState({\n suggestedBindings: hoveredBindableElement != null ? [hoveredBindableElement] : []\n });\n };\n\n this.handleInteractiveCanvasRef = canvas => {\n var _a, _b; // canvas is null when unmounting\n\n\n if (canvas !== null) {\n this.interactiveCanvas = canvas; // -----------------------------------------------------------------------\n // NOTE wheel, touchstart, touchend events must be registered outside\n // of react because react binds them them passively (so we can't prevent\n // default on them)\n\n this.interactiveCanvas.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.TOUCH_START, this.onTouchStart, {\n passive: false\n });\n this.interactiveCanvas.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.TOUCH_END, this.onTouchEnd); // -----------------------------------------------------------------------\n } else {\n (_a = this.interactiveCanvas) === null || _a === void 0 ? void 0 : _a.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.TOUCH_START, this.onTouchStart);\n (_b = this.interactiveCanvas) === null || _b === void 0 ? void 0 : _b.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.TOUCH_END, this.onTouchEnd);\n }\n };\n\n this.insertImages = async (imageFiles, sceneX, sceneY) => {\n const gridPadding = 50 / this.state.zoom.value; // Create, position, and insert placeholders\n\n const placeholders = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.positionElementsOnGrid)(imageFiles.map(() => this.newImagePlaceholder({\n sceneX,\n sceneY\n })), sceneX, sceneY, gridPadding);\n placeholders.forEach(el => this.scene.insertElement(el)); // Create, position, insert and select initialized (replacing placeholders)\n\n const initialized = await Promise.all(placeholders.map(async (placeholder, i) => {\n try {\n return await this.initializeImage(placeholder, await (0,_data_blob__WEBPACK_IMPORTED_MODULE_33__.normalizeFile)(imageFiles[i]));\n } catch (error) {\n this.setState({\n errorMessage: error.message || (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"errors.imageInsertError\")\n });\n return (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newElementWith)(placeholder, {\n isDeleted: true\n });\n }\n }));\n const initializedMap = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.arrayToMap)(initialized);\n const positioned = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.positionElementsOnGrid)(initialized.filter(el => !el.isDeleted), sceneX, sceneY, gridPadding);\n const positionedMap = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.arrayToMap)(positioned);\n const nextElements = this.scene.getElementsIncludingDeleted().map(el => {\n var _a, _b;\n\n return (_b = (_a = positionedMap.get(el.id)) !== null && _a !== void 0 ? _a : initializedMap.get(el.id)) !== null && _b !== void 0 ? _b : el;\n });\n this.updateScene({\n appState: {\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)(Object.fromEntries(positioned.map(el => [el.id, true])), this.state)\n },\n elements: nextElements,\n captureUpdate: _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.CaptureUpdateAction.IMMEDIATELY\n });\n this.setState({}, () => {\n // actionFinalize after all state values have been updated\n this.actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_8__.actionFinalize);\n });\n };\n\n this.handleAppOnDrop = async event => {\n var _a;\n\n if (this.props.onDrop) {\n //zsviczian\n try {\n if ((await this.props.onDrop(event)) === false) {\n return;\n }\n } catch (e) {\n console.error(e);\n }\n }\n\n const {\n x: sceneX,\n y: sceneY\n } = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)(event, this.state);\n const dataTransferList = await (0,_clipboard__WEBPACK_IMPORTED_MODULE_24__.parseDataTransferEvent)(event); // must be retrieved first, in the same frame\n\n const fileItems = dataTransferList.getFiles();\n\n if (fileItems.length === 1) {\n const {\n file,\n fileHandle\n } = fileItems[0];\n\n if (file && (file.type === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.MIME_TYPES.png || file.type === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.MIME_TYPES.svg)) {\n try {\n const scene = await (0,_data__WEBPACK_IMPORTED_MODULE_25__.loadFromBlob)(file, this.state, this.scene.getElementsIncludingDeleted(), fileHandle);\n this.syncActionResult(Object.assign(Object.assign({}, scene), {\n appState: Object.assign(Object.assign({}, scene.appState || this.state), {\n isLoading: false\n }),\n replaceFiles: true,\n captureUpdate: _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.CaptureUpdateAction.IMMEDIATELY\n }));\n return;\n } catch (error) {\n if (error.name !== \"EncodingError\") {\n throw new Error((0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"alerts.couldNotLoadInvalidFile\"));\n } // if EncodingError, fall through to insert as regular image\n\n }\n }\n }\n\n const imageFiles = fileItems.map(data => data.file).filter(file => (0,_data_blob__WEBPACK_IMPORTED_MODULE_33__.isSupportedImageFile)(file));\n\n if (imageFiles.length > 0 && this.isToolSupported(\"image\")) {\n return this.insertImages(imageFiles, sceneX, sceneY);\n }\n\n const excalidrawLibrary_ids = dataTransferList.getData(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.MIME_TYPES.excalidrawlibIds);\n const excalidrawLibrary_data = dataTransferList.getData(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.MIME_TYPES.excalidrawlib);\n\n if (excalidrawLibrary_ids || excalidrawLibrary_data) {\n try {\n let libraryItems = null;\n\n if (excalidrawLibrary_ids) {\n const {\n itemIds\n } = JSON.parse(excalidrawLibrary_ids);\n const allLibraryItems = await this.library.getLatestLibrary();\n libraryItems = allLibraryItems.filter(item => itemIds.includes(item.id)); // legacy library dataTransfer format\n } else if (excalidrawLibrary_data) {\n libraryItems = (0,_data_blob__WEBPACK_IMPORTED_MODULE_33__.parseLibraryJSON)(excalidrawLibrary_data);\n }\n\n if (libraryItems === null || libraryItems === void 0 ? void 0 : libraryItems.length) {\n libraryItems = libraryItems.map(item => Object.assign(Object.assign({}, item), {\n // #6465\n elements: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.duplicateElements)({\n type: \"everything\",\n elements: item.elements,\n randomizeSeed: true\n }).duplicatedElements\n }));\n this.addElementsFromPasteOrLibrary({\n elements: (0,_data_library__WEBPACK_IMPORTED_MODULE_26__.distributeLibraryItemsOnSquareGrid)(libraryItems),\n position: event,\n files: null\n });\n }\n } catch (error) {\n this.setState({\n errorMessage: error.message\n });\n }\n\n return;\n }\n\n if (fileItems.length > 0) {\n const {\n file,\n fileHandle\n } = fileItems[0];\n\n if (file) {\n // Attempt to parse an excalidraw/excalidrawlib file\n await this.loadFileToCanvas(file, fileHandle);\n }\n }\n\n const textItem = dataTransferList.findByType(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.MIME_TYPES.text);\n\n if (textItem) {\n const text = textItem.value;\n\n if (text && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.embeddableURLValidator)(text, this.props.validateEmbeddable) && (/^(http|https):\\/\\/[^\\s/$.?#].[^\\s]*$/.test(text) || ((_a = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getEmbedLink)(text)) === null || _a === void 0 ? void 0 : _a.type) === \"video\")) {\n const embeddable = this.insertEmbeddableElement({\n sceneX,\n sceneY,\n link: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.normalizeLink)(text)\n });\n\n if (embeddable) {\n this.store.scheduleCapture();\n this.setState({\n selectedElementIds: {\n [embeddable.id]: true\n }\n });\n }\n }\n }\n };\n\n this.loadFileToCanvas = async (file, fileHandle) => {\n file = await (0,_data_blob__WEBPACK_IMPORTED_MODULE_33__.normalizeFile)(file);\n\n try {\n const elements = this.scene.getElementsIncludingDeleted();\n let ret;\n\n try {\n ret = await (0,_data_blob__WEBPACK_IMPORTED_MODULE_33__.loadSceneOrLibraryFromBlob)(file, this.state, elements, fileHandle);\n } catch (error) {\n const imageSceneDataError = error instanceof _errors__WEBPACK_IMPORTED_MODULE_38__.ImageSceneDataError;\n\n if (imageSceneDataError && error.code === \"IMAGE_NOT_CONTAINS_SCENE_DATA\" && !this.isToolSupported(\"image\")) {\n this.setState({\n isLoading: false,\n errorMessage: (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"errors.imageToolNotSupported\")\n });\n return;\n }\n\n const errorMessage = imageSceneDataError ? (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"alerts.cannotRestoreFromImage\") : (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"alerts.couldNotLoadInvalidFile\");\n this.setState({\n isLoading: false,\n errorMessage\n });\n }\n\n if (!ret) {\n return;\n }\n\n if (ret.type === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.MIME_TYPES.excalidraw) {\n // restore the fractional indices by mutating elements\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.syncInvalidIndices)(elements.concat(ret.data.elements)); // don't capture and only update the store snapshot for old elements,\n // otherwise we would end up with duplicated fractional indices on undo\n\n this.store.scheduleMicroAction({\n action: _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.CaptureUpdateAction.NEVER,\n elements,\n appState: undefined\n });\n this.setState({\n isLoading: true\n });\n this.syncActionResult(Object.assign(Object.assign({}, ret.data), {\n appState: Object.assign(Object.assign({}, ret.data.appState || this.state), {\n isLoading: false\n }),\n replaceFiles: true,\n captureUpdate: _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.CaptureUpdateAction.IMMEDIATELY\n }));\n } else if (ret.type === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.MIME_TYPES.excalidrawlib) {\n await this.library.updateLibrary({\n libraryItems: file,\n merge: true,\n openLibraryMenu: true\n }).catch(error => {\n console.error(error);\n this.setState({\n errorMessage: (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"errors.importLibraryError\")\n });\n });\n }\n } catch (error) {\n this.setState({\n isLoading: false,\n errorMessage: error.message\n });\n }\n };\n\n this.handleCanvasContextMenu = event => {\n event.preventDefault();\n\n if (this.state.disableContextMenu) {\n //zsviczian\n return;\n } //mfuria #329. if right-click pan is enabled, we suppress opening our custom menu too.\n\n\n if ((0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_70__.isPanWithRightMouseEnabled)()) {\n return;\n }\n\n if ((\"pointerType\" in event.nativeEvent && event.nativeEvent.pointerType === \"touch\" || \"pointerType\" in event.nativeEvent && event.nativeEvent.pointerType === \"pen\" && // always allow if user uses a pen secondary button\n event.button !== _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.POINTER_BUTTON.SECONDARY) && this.state.activeTool.type !== this.state.preferredSelectionTool.type) {\n return;\n }\n\n const {\n x,\n y\n } = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)(event, this.state);\n const element = this.getElementAtPosition(x, y, {\n preferSelected: true,\n includeLockedElements: true\n });\n const selectedElements = this.scene.getSelectedElements(this.state);\n const isHittingCommonBoundBox = this.isHittingCommonBoundingBoxOfSelectedElements({\n x,\n y\n }, selectedElements);\n const type = element || isHittingCommonBoundBox ? \"element\" : \"canvas\";\n const container = this.excalidrawContainerRef.current;\n const {\n top: offsetTop,\n left: offsetLeft\n } = container.getBoundingClientRect();\n const left = event.clientX - offsetLeft;\n const top = event.clientY - offsetTop;\n (0,_analytics__WEBPACK_IMPORTED_MODULE_21__.trackEvent)(\"contextMenu\", \"openContextMenu\", type);\n this.setState(Object.assign(Object.assign({}, element && !this.state.selectedElementIds[element.id] ? Object.assign(Object.assign(Object.assign({}, this.state), (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.selectGroupsForSelectedElements)({\n editingGroupId: this.state.editingGroupId,\n selectedElementIds: {\n [element.id]: true\n }\n }, this.scene.getNonDeletedElements(), this.state, this)), {\n selectedLinearElement: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLinearElement)(element) ? new _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor(element, this.scene.getNonDeletedElementsMap()) : null\n }) : this.state), {\n showHyperlinkPopup: false\n }), () => {\n this.setState({\n contextMenu: {\n top,\n left,\n items: this.getContextMenuItems(type)\n }\n });\n });\n };\n\n this.maybeDragNewGenericElement = (pointerDownState, event, informMutation = true) => {\n var _a, _b, _c, _d, _e;\n\n const selectionElement = this.state.selectionElement;\n const pointerCoords = pointerDownState.lastCoords;\n\n if (selectionElement && this.state.activeTool.type !== \"eraser\") {\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.dragNewElement)({\n newElement: selectionElement,\n elementType: this.state.activeTool.type,\n originX: pointerDownState.origin.x,\n originY: pointerDownState.origin.y,\n x: pointerCoords.x,\n y: pointerCoords.y,\n width: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.distance)(pointerDownState.origin.x, pointerCoords.x),\n height: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.distance)(pointerDownState.origin.y, pointerCoords.y),\n shouldMaintainAspectRatio: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.shouldMaintainAspectRatio)(event),\n shouldResizeFromCenter: false,\n scene: this.scene,\n zoom: this.state.zoom.value,\n informMutation: false\n });\n return;\n }\n\n const newElement = this.state.newElement;\n\n if (!newElement) {\n return;\n }\n\n let [gridX, gridY] = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(pointerCoords.x, pointerCoords.y, event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] ? null : this.getEffectiveGridSize());\n const image = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isInitializedImageElement)(newElement) && ((_a = this.imageCache.get(newElement.fileId)) === null || _a === void 0 ? void 0 : _a.image);\n const aspectRatio = image && !(image instanceof Promise) ? image.width / image.height : null;\n this.maybeCacheReferenceSnapPoints(event, [newElement]);\n const {\n snapOffset,\n snapLines\n } = (0,_snapping__WEBPACK_IMPORTED_MODULE_39__.snapNewElement)(newElement, this, event, {\n x: pointerDownState.originInGrid.x + ((_c = (_b = this.state.originSnapOffset) === null || _b === void 0 ? void 0 : _b.x) !== null && _c !== void 0 ? _c : 0),\n y: pointerDownState.originInGrid.y + ((_e = (_d = this.state.originSnapOffset) === null || _d === void 0 ? void 0 : _d.y) !== null && _e !== void 0 ? _e : 0)\n }, {\n x: gridX - pointerDownState.originInGrid.x,\n y: gridY - pointerDownState.originInGrid.y\n }, this.scene.getNonDeletedElementsMap());\n gridX += snapOffset.x;\n gridY += snapOffset.y;\n this.setState({\n snapLines\n });\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.dragNewElement)({\n newElement,\n elementType: this.state.activeTool.type,\n originX: pointerDownState.originInGrid.x,\n originY: pointerDownState.originInGrid.y,\n x: gridX,\n y: gridY,\n width: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.distance)(pointerDownState.originInGrid.x, gridX),\n height: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.distance)(pointerDownState.originInGrid.y, gridY),\n shouldMaintainAspectRatio: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isImageElement)(newElement) ? !(0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.shouldMaintainAspectRatio)(event) : (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.shouldMaintainAspectRatio)(event),\n shouldResizeFromCenter: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.shouldResizeFromCenter)(event),\n zoom: this.state.zoom.value,\n scene: this.scene,\n widthAspectRatio: aspectRatio,\n originOffset: this.state.originSnapOffset,\n informMutation\n });\n this.setState({\n newElement\n }); // highlight elements that are to be added to frames on frames creation\n\n if (this.state.activeTool.type === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.TOOL_TYPE.frame || this.state.activeTool.type === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.TOOL_TYPE.magicframe) {\n this.setState({\n elementsToHighlight: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getElementsInResizingFrame)(this.scene.getNonDeletedElements(), newElement, this.state, this.scene.getNonDeletedElementsMap())\n });\n }\n };\n\n this.maybeHandleCrop = (pointerDownState, event) => {\n var _a; // to crop, we must already be in the cropping mode, where croppingElement has been set\n\n\n if (!this.state.croppingElementId) {\n return false;\n }\n\n const transformHandleType = pointerDownState.resize.handleType;\n const pointerCoords = pointerDownState.lastCoords;\n const [x, y] = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(pointerCoords.x - pointerDownState.resize.offset.x, pointerCoords.y - pointerDownState.resize.offset.y, event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] ? null : this.getEffectiveGridSize());\n const croppingElement = this.scene.getNonDeletedElementsMap().get(this.state.croppingElementId);\n\n if (transformHandleType && croppingElement && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isImageElement)(croppingElement)) {\n const croppingAtStateStart = pointerDownState.originalElements.get(croppingElement.id);\n const image = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isInitializedImageElement)(croppingElement) && ((_a = this.imageCache.get(croppingElement.fileId)) === null || _a === void 0 ? void 0 : _a.image);\n\n if (croppingAtStateStart && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isImageElement)(croppingAtStateStart) && image && !(image instanceof Promise)) {\n const [gridX, gridY] = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(pointerCoords.x, pointerCoords.y, event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] ? null : this.getEffectiveGridSize());\n const dragOffset = {\n x: gridX - pointerDownState.originInGrid.x,\n y: gridY - pointerDownState.originInGrid.y\n };\n this.maybeCacheReferenceSnapPoints(event, [croppingElement]);\n const {\n snapOffset,\n snapLines\n } = (0,_snapping__WEBPACK_IMPORTED_MODULE_39__.snapResizingElements)([croppingElement], [croppingAtStateStart], this, event, dragOffset, transformHandleType);\n this.scene.mutateElement(croppingElement, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.cropElement)(croppingElement, this.scene.getNonDeletedElementsMap(), transformHandleType, image.naturalWidth, image.naturalHeight, x + snapOffset.x, y + snapOffset.y, event.shiftKey ? croppingAtStateStart.width / croppingAtStateStart.height : undefined));\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.updateBoundElements)(croppingElement, this.scene, {\n newSize: {\n width: croppingElement.width,\n height: croppingElement.height\n }\n });\n this.setState({\n isCropping: transformHandleType && transformHandleType !== \"rotation\",\n snapLines\n });\n }\n\n return true;\n }\n\n return false;\n };\n\n this.maybeHandleResize = (pointerDownState, event) => {\n const selectedElements = this.scene.getSelectedElements(this.state);\n const selectedFrames = selectedElements.filter(element => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isFrameLikeElement)(element));\n const transformHandleType = pointerDownState.resize.handleType;\n\n if ( // Frames cannot be rotated.\n selectedFrames.length > 0 && transformHandleType === \"rotation\" || // Elbow arrows cannot be transformed (resized or rotated).\n selectedElements.length === 1 && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(selectedElements[0]) || // Do not resize when in crop mode\n this.state.croppingElementId) {\n return false;\n }\n\n this.setState({\n // TODO: rename this state field to \"isScaling\" to distinguish\n // it from the generic \"isResizing\" which includes scaling and\n // rotating\n isResizing: transformHandleType && transformHandleType !== \"rotation\",\n isRotating: transformHandleType === \"rotation\",\n activeEmbeddable: null\n });\n const pointerCoords = pointerDownState.lastCoords;\n let [resizeX, resizeY] = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(pointerCoords.x - pointerDownState.resize.offset.x, pointerCoords.y - pointerDownState.resize.offset.y, event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] ? null : this.getEffectiveGridSize());\n const frameElementsOffsetsMap = new Map();\n selectedFrames.forEach(frame => {\n const elementsInFrame = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getFrameChildren)(this.scene.getNonDeletedElements(), frame.id);\n elementsInFrame.forEach(element => {\n frameElementsOffsetsMap.set(frame.id + element.id, {\n x: element.x - frame.x,\n y: element.y - frame.y\n });\n });\n }); // check needed for avoiding flickering when a key gets pressed\n // during dragging\n\n if (!this.state.selectedElementsAreBeingDragged) {\n const [gridX, gridY] = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(pointerCoords.x, pointerCoords.y, event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] ? null : this.getEffectiveGridSize());\n const dragOffset = {\n x: gridX - pointerDownState.originInGrid.x,\n y: gridY - pointerDownState.originInGrid.y\n };\n const originalElements = [...pointerDownState.originalElements.values()];\n this.maybeCacheReferenceSnapPoints(event, selectedElements);\n const {\n snapOffset,\n snapLines\n } = (0,_snapping__WEBPACK_IMPORTED_MODULE_39__.snapResizingElements)(selectedElements, (0,_scene__WEBPACK_IMPORTED_MODULE_31__.getSelectedElements)(originalElements, this.state), this, event, dragOffset, transformHandleType);\n resizeX += snapOffset.x;\n resizeY += snapOffset.y;\n this.setState({\n snapLines\n });\n }\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.transformElements)(pointerDownState.originalElements, transformHandleType, selectedElements, this.scene, (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.shouldRotateWithDiscreteAngle)(event), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.shouldResizeFromCenter)(event), selectedElements.some(element => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isImageElement)(element)) ? !(0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.shouldMaintainAspectRatio)(event) : (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.shouldMaintainAspectRatio)(event), resizeX, resizeY, pointerDownState.resize.center.x, pointerDownState.resize.center.y)) {\n const suggestedBindings = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getSuggestedBindingsForArrows)(selectedElements, this.scene.getNonDeletedElementsMap(), this.state.zoom);\n const elementsToHighlight = new Set();\n selectedFrames.forEach(frame => {\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getElementsInResizingFrame)(this.scene.getNonDeletedElements(), frame, this.state, this.scene.getNonDeletedElementsMap()).forEach(element => elementsToHighlight.add(element));\n });\n this.setState({\n elementsToHighlight: [...elementsToHighlight],\n suggestedBindings\n });\n return true;\n }\n\n return false;\n };\n\n this.getContextMenuItems = type => {\n const options = [];\n options.push(_actions__WEBPACK_IMPORTED_MODULE_8__.actionCopyAsPng, _actions__WEBPACK_IMPORTED_MODULE_8__.actionCopyAsSvg); // canvas contextMenu\n // -------------------------------------------------------------------------\n\n if (type === \"canvas\") {\n if (this.state.viewModeEnabled) {\n return [...options, _actions__WEBPACK_IMPORTED_MODULE_8__.actionToggleGridMode, _actions__WEBPACK_IMPORTED_MODULE_8__.actionToggleZenMode, _actions_actionToggleViewMode__WEBPACK_IMPORTED_MODULE_17__.actionToggleViewMode, _actions__WEBPACK_IMPORTED_MODULE_8__.actionToggleStats, _actions_actionCanvas__WEBPACK_IMPORTED_MODULE_10__.actionToggleLaserPointer];\n }\n\n return [_actions_actionClipboard__WEBPACK_IMPORTED_MODULE_11__.actionPaste, _ContextMenu__WEBPACK_IMPORTED_MODULE_55__.CONTEXT_MENU_SEPARATOR, _actions__WEBPACK_IMPORTED_MODULE_8__.actionCopyAsPng, _actions__WEBPACK_IMPORTED_MODULE_8__.actionCopyAsSvg, _actions__WEBPACK_IMPORTED_MODULE_8__.copyText, _ContextMenu__WEBPACK_IMPORTED_MODULE_55__.CONTEXT_MENU_SEPARATOR, _actions__WEBPACK_IMPORTED_MODULE_8__.actionSelectAll, _actions_actionElementLock__WEBPACK_IMPORTED_MODULE_13__.actionUnlockAllElements, _ContextMenu__WEBPACK_IMPORTED_MODULE_55__.CONTEXT_MENU_SEPARATOR, _actions__WEBPACK_IMPORTED_MODULE_8__.actionToggleGridMode, _actions__WEBPACK_IMPORTED_MODULE_8__.actionToggleObjectsSnapMode, _actions__WEBPACK_IMPORTED_MODULE_8__.actionToggleZenMode, _actions_actionToggleViewMode__WEBPACK_IMPORTED_MODULE_17__.actionToggleViewMode, _actions__WEBPACK_IMPORTED_MODULE_8__.actionToggleStats];\n } // element contextMenu\n // -------------------------------------------------------------------------\n\n\n options.push(_actions__WEBPACK_IMPORTED_MODULE_8__.copyText);\n\n if (this.state.viewModeEnabled) {\n return [_actions__WEBPACK_IMPORTED_MODULE_8__.actionCopy, ...options];\n }\n\n const zIndexActions = this.editorInterface.formFactor === \"desktop\" ? [_ContextMenu__WEBPACK_IMPORTED_MODULE_55__.CONTEXT_MENU_SEPARATOR, _actions__WEBPACK_IMPORTED_MODULE_8__.actionSendBackward, _actions__WEBPACK_IMPORTED_MODULE_8__.actionBringForward, _actions__WEBPACK_IMPORTED_MODULE_8__.actionSendToBack, _actions__WEBPACK_IMPORTED_MODULE_8__.actionBringToFront] : [];\n return [_ContextMenu__WEBPACK_IMPORTED_MODULE_55__.CONTEXT_MENU_SEPARATOR, _actions__WEBPACK_IMPORTED_MODULE_8__.actionCut, _actions__WEBPACK_IMPORTED_MODULE_8__.actionCopy, _actions_actionClipboard__WEBPACK_IMPORTED_MODULE_11__.actionPaste, _ContextMenu__WEBPACK_IMPORTED_MODULE_55__.CONTEXT_MENU_SEPARATOR, _actions_actionFrame__WEBPACK_IMPORTED_MODULE_14__.actionSelectAllElementsInFrame, _actions_actionFrame__WEBPACK_IMPORTED_MODULE_14__.actionRemoveAllElementsFromFrame, _actions_actionFrame__WEBPACK_IMPORTED_MODULE_14__.actionWrapSelectionInFrame, _ContextMenu__WEBPACK_IMPORTED_MODULE_55__.CONTEXT_MENU_SEPARATOR, _actions__WEBPACK_IMPORTED_MODULE_8__.actionToggleCropEditor, _ContextMenu__WEBPACK_IMPORTED_MODULE_55__.CONTEXT_MENU_SEPARATOR, ...options, _ContextMenu__WEBPACK_IMPORTED_MODULE_55__.CONTEXT_MENU_SEPARATOR, _actions__WEBPACK_IMPORTED_MODULE_8__.actionCopyStyles, _actions__WEBPACK_IMPORTED_MODULE_8__.actionPasteStyles, _ContextMenu__WEBPACK_IMPORTED_MODULE_55__.CONTEXT_MENU_SEPARATOR, _actions__WEBPACK_IMPORTED_MODULE_8__.actionGroup, _actions_actionTextAutoResize__WEBPACK_IMPORTED_MODULE_16__.actionTextAutoResize, _actions__WEBPACK_IMPORTED_MODULE_8__.actionUnbindText, _actions__WEBPACK_IMPORTED_MODULE_8__.actionBindText, _actions_actionBoundText__WEBPACK_IMPORTED_MODULE_9__.actionWrapTextInContainer, _actions__WEBPACK_IMPORTED_MODULE_8__.actionUngroup, _ContextMenu__WEBPACK_IMPORTED_MODULE_55__.CONTEXT_MENU_SEPARATOR, _actions__WEBPACK_IMPORTED_MODULE_8__.actionAddToLibrary, ...zIndexActions, _ContextMenu__WEBPACK_IMPORTED_MODULE_55__.CONTEXT_MENU_SEPARATOR, _actions__WEBPACK_IMPORTED_MODULE_8__.actionFlipHorizontal, _actions__WEBPACK_IMPORTED_MODULE_8__.actionFlipVertical, _ContextMenu__WEBPACK_IMPORTED_MODULE_55__.CONTEXT_MENU_SEPARATOR, _actions__WEBPACK_IMPORTED_MODULE_8__.actionToggleLinearEditor, _ContextMenu__WEBPACK_IMPORTED_MODULE_55__.CONTEXT_MENU_SEPARATOR, _actions__WEBPACK_IMPORTED_MODULE_8__.actionLink, _actions_actionElementLink__WEBPACK_IMPORTED_MODULE_12__.actionCopyElementLink, _ContextMenu__WEBPACK_IMPORTED_MODULE_55__.CONTEXT_MENU_SEPARATOR, _actions__WEBPACK_IMPORTED_MODULE_8__.actionDuplicateSelection, _actions__WEBPACK_IMPORTED_MODULE_8__.actionToggleElementLock, _ContextMenu__WEBPACK_IMPORTED_MODULE_55__.CONTEXT_MENU_SEPARATOR, _actions__WEBPACK_IMPORTED_MODULE_8__.actionDeleteSelected];\n };\n\n this.handleWheel = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(event => {\n var _a, _b, _c, _d; // if not scrolling on canvas/wysiwyg, ignore\n //zsviczian - begin\n\n\n const path = (_b = (_a = event).composedPath) === null || _b === void 0 ? void 0 : _b.call(_a);\n const isOnExcalidrawCanvas = (path === null || path === void 0 ? void 0 : path.some(n => {\n var _a;\n\n return n instanceof HTMLCanvasElement && ((_a = n.classList) === null || _a === void 0 ? void 0 : _a.contains(\"excalidraw__canvas\"));\n })) || ((_d = (_c = event.target) === null || _c === void 0 ? void 0 : _c.closest) === null || _d === void 0 ? void 0 : _d.call(_c, \"canvas.excalidraw__canvas\")) != null; //zsviczian - end\n\n if (!(isOnExcalidrawCanvas || //zsviczian\n event.target instanceof HTMLTextAreaElement || event.target instanceof HTMLIFrameElement)) {\n // prevent zooming the browser (but allow scrolling DOM)\n if (event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD]) {\n event.preventDefault();\n }\n\n return;\n }\n\n event.preventDefault();\n\n if (isPanning) {\n return;\n }\n\n const {\n deltaX,\n deltaY\n } = event; // note that event.ctrlKey is necessary to handle pinch zooming\n\n if ( //zsviczian\n (event.metaKey || event.ctrlKey) && !this.state.allowWheelZoom || !(event.metaKey || event.ctrlKey) && this.state.allowWheelZoom) {\n const sign = Math.sign(deltaY);\n const MAX_STEP = (0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_70__.getZoomStep)() * 100;\n const absDelta = Math.abs(deltaY);\n let delta = deltaY;\n\n if (absDelta > MAX_STEP) {\n delta = MAX_STEP * sign;\n }\n\n let newZoom = this.state.zoom.value - delta / 100; // increase zoom steps the more zoomed-in we are (applies to >100% only)\n\n newZoom += Math.log10(Math.max(1, this.state.zoom.value)) * -sign * // reduced amplification for small deltas (small movements on a trackpad)\n Math.min(1, absDelta / 20);\n this.translateCanvas(state => Object.assign(Object.assign({}, (0,_scene_zoom__WEBPACK_IMPORTED_MODULE_32__.getStateForZoom)({\n viewportX: this.lastViewportPosition.x,\n viewportY: this.lastViewportPosition.y,\n nextZoom: (0,_scene__WEBPACK_IMPORTED_MODULE_31__.getNormalizedZoom)(newZoom)\n }, state)), {\n shouldCacheIgnoreZoom: true\n }));\n this.resetShouldCacheIgnoreZoomDebounced();\n return;\n } // scroll horizontally when shift pressed\n\n\n if (event.shiftKey) {\n this.translateCanvas(({\n zoom,\n scrollX\n }) => ({\n // on Mac, shift+wheel tends to result in deltaX\n scrollX: scrollX - (deltaY || deltaX) / zoom.value\n }));\n return;\n }\n\n this.translateCanvas(({\n zoom,\n scrollX,\n scrollY\n }) => ({\n scrollX: scrollX - deltaX / zoom.value,\n scrollY: scrollY - deltaY / zoom.value\n }));\n });\n\n this.savePointer = (x, y, button) => {\n var _a, _b;\n\n if (!x || !y) {\n return;\n }\n\n const {\n x: sceneX,\n y: sceneY\n } = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)({\n clientX: x,\n clientY: y\n }, this.state);\n\n if (isNaN(sceneX) || isNaN(sceneY)) {// sometimes the pointer goes off screen\n }\n\n const pointer = {\n x: sceneX,\n y: sceneY,\n tool: this.state.activeTool.type === \"laser\" ? \"laser\" : \"pointer\"\n };\n (_b = (_a = this.props).onPointerUpdate) === null || _b === void 0 ? void 0 : _b.call(_a, {\n pointer,\n button,\n pointersMap: gesture.pointers\n });\n };\n\n this.resetShouldCacheIgnoreZoomDebounced = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.debounce)(() => {\n if (!this.unmounted) {\n this.setState({\n shouldCacheIgnoreZoom: false\n });\n }\n }, 300);\n\n this.updateDOMRect = cb => {\n var _a;\n\n if ((_a = this.excalidrawContainerRef) === null || _a === void 0 ? void 0 : _a.current) {\n const excalidrawContainer = this.excalidrawContainerRef.current;\n const {\n width,\n height,\n left: offsetLeft,\n top: offsetTop\n } = excalidrawContainer.getBoundingClientRect();\n const {\n width: currentWidth,\n height: currentHeight,\n offsetTop: currentOffsetTop,\n offsetLeft: currentOffsetLeft\n } = this.state;\n\n if (width === currentWidth && height === currentHeight && offsetLeft === currentOffsetLeft && offsetTop === currentOffsetTop) {\n if (cb) {\n cb();\n }\n\n return;\n } //zsviczian\n\n\n if (width === 0 || height === 0) {\n if (cb) {\n cb();\n }\n\n return;\n }\n\n this.setState({\n width,\n height,\n offsetLeft,\n offsetTop\n }, () => {\n cb && cb();\n });\n }\n };\n\n this.refresh = () => {\n this.setState(Object.assign({}, this.getCanvasOffsets()));\n };\n\n const defaultAppState = (0,_appState__WEBPACK_IMPORTED_MODULE_23__.getDefaultAppState)();\n const {\n excalidrawAPI,\n viewModeEnabled = false,\n zenModeEnabled = false,\n gridModeEnabled = false,\n objectsSnapModeEnabled = false,\n theme = defaultAppState.theme,\n initState,\n //zsviczian\n name = `${(0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"labels.untitled\")}-${(0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getDateTime)()}`\n } = props;\n this.state = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, defaultAppState), {\n theme,\n isLoading: true\n }), this.getCanvasOffsets()), {\n viewModeEnabled,\n zenModeEnabled,\n objectsSnapModeEnabled,\n gridModeEnabled: gridModeEnabled !== null && gridModeEnabled !== void 0 ? gridModeEnabled : defaultAppState.gridModeEnabled,\n name,\n width: window.innerWidth,\n height: window.innerHeight\n }), initState !== null && initState !== void 0 ? initState : {});\n this.refreshEditorInterface();\n this.stylesPanelMode = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.deriveStylesPanelMode)(this.editorInterface);\n this.id = (0,nanoid__WEBPACK_IMPORTED_MODULE_73__.nanoid)();\n (0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_70__.initializeObsidianUtils)();\n this.library = new _data_library__WEBPACK_IMPORTED_MODULE_26__[\"default\"](this);\n this.actionManager = new _actions_manager__WEBPACK_IMPORTED_MODULE_18__.ActionManager(this.syncActionResult, () => this.state, () => this.scene.getElementsIncludingDeleted(), this);\n this.scene = new _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.Scene();\n this.canvas = document.createElement(\"canvas\");\n this.rc = roughjs_bin_rough__WEBPACK_IMPORTED_MODULE_4__[\"default\"].canvas(this.canvas);\n this.renderer = new _scene_Renderer__WEBPACK_IMPORTED_MODULE_41__.Renderer(this.scene);\n this.visibleElements = [];\n this.store = new _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.Store(this);\n this.history = new _history__WEBPACK_IMPORTED_MODULE_29__.History(this.store);\n\n if (excalidrawAPI) {\n const api = {\n updateScene: this.updateScene,\n applyDeltas: this.applyDeltas,\n mutateElement: this.mutateElement,\n updateLibrary: this.library.updateLibrary,\n addFiles: this.addFiles,\n resetScene: this.resetScene,\n getSceneElementsIncludingDeleted: this.getSceneElementsIncludingDeleted,\n getSceneElementsMapIncludingDeleted: this.getSceneElementsMapIncludingDeleted,\n history: {\n clear: this.resetHistory\n },\n scrollToContent: this.scrollToContent,\n setForceRenderAllEmbeddables: this.setForceRenderAllEmbeddables,\n zoomToFit: this.zoomToFit,\n refreshEditorInterface: this.refreshEditorInterface,\n setTrayModeEnabled: this.setTrayModeEnabled,\n setDesktopUIMode: this.setDesktopUIMode,\n isTouchScreen: this.isTouchScreen,\n isTrayModeEnabled: this.isTrayModeEnabled,\n getColorAtScenePoint: this.getColorAtScenePoint,\n startLineEditor: this.startLineEditor,\n getSceneElements: this.getSceneElements,\n getAppState: () => this.state,\n getFiles: () => this.files,\n getName: this.getName,\n registerAction: action => {\n this.actionManager.registerAction(action);\n },\n refresh: this.refresh,\n setToast: this.setToast,\n updateContainerSize: this.updateContainerSize,\n id: this.id,\n selectElements: this.selectElements,\n sendBackward: this.sendBackward,\n bringForward: this.bringForward,\n sendToBack: this.sendToBack,\n bringToFront: this.bringToFront,\n setActiveTool: this.setActiveTool,\n setCursor: this.setCursor,\n resetCursor: this.resetCursor,\n getEditorInterface: () => this.editorInterface,\n updateFrameRendering: this.updateFrameRendering,\n toggleSidebar: this.toggleSidebar,\n getHTMLIFrameElement: id => this.getHTMLIFrameElement(id),\n onChange: cb => this.onChangeEmitter.on(cb),\n onIncrement: cb => this.store.onStoreIncrementEmitter.on(cb),\n onPointerDown: cb => this.onPointerDownEmitter.on(cb),\n onPointerUp: cb => this.onPointerUpEmitter.on(cb),\n onScrollChange: cb => this.onScrollChangeEmitter.on(cb),\n onUserFollow: cb => this.onUserFollowEmitter.on(cb)\n };\n\n if (typeof excalidrawAPI === \"function\") {\n excalidrawAPI(api);\n } else {\n console.error(\"excalidrawAPI should be a function!\");\n }\n }\n\n this.excalidrawContainerValue = {\n container: this.excalidrawContainerRef.current,\n id: this.id\n };\n this.fonts = new _fonts__WEBPACK_IMPORTED_MODULE_36__.Fonts(this.scene);\n this.history = new _history__WEBPACK_IMPORTED_MODULE_29__.History(this.store);\n this.actionManager.registerAll(_actions_register__WEBPACK_IMPORTED_MODULE_19__.actions);\n this.actionManager.registerAction((0,_actions_actionHistory__WEBPACK_IMPORTED_MODULE_15__.createUndoAction)(this.history));\n this.actionManager.registerAction((0,_actions_actionHistory__WEBPACK_IMPORTED_MODULE_15__.createRedoAction)(this.history));\n }\n\n onWindowMessage(event) {\n if (event.origin !== \"https://player.vimeo.com\" && event.origin !== \"https://www.youtube.com\") {\n return;\n }\n\n let data = null;\n\n try {\n data = JSON.parse(event.data);\n } catch (e) {}\n\n if (!data) {\n return;\n }\n\n switch (event.origin) {\n case \"https://player.vimeo.com\":\n //Allowing for multiple instances of Excalidraw running in the window\n if (data.method === \"paused\") {\n let source = null;\n const iframes = document.body.querySelectorAll(\"iframe.excalidraw__embeddable\");\n\n if (!iframes) {\n break;\n }\n\n for (const iframe of iframes) {\n if (iframe.contentWindow === event.source) {\n source = iframe.contentWindow;\n }\n }\n\n source === null || source === void 0 ? void 0 : source.postMessage(JSON.stringify({\n method: data.value ? \"play\" : \"pause\",\n value: true\n }), \"*\");\n }\n\n break;\n\n case \"https://www.youtube.com\":\n if (data.event === \"infoDelivery\" && data.info && data.id && typeof data.info.playerState === \"number\") {\n const id = data.id;\n const playerState = data.info.playerState;\n\n if (Object.values(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.YOUTUBE_STATES).includes(playerState)) {\n YOUTUBE_VIDEO_STATES.set(id, playerState);\n }\n }\n\n break;\n }\n }\n\n cacheEmbeddableRef(element, ref) {\n if (ref) {\n this.iFrameRefs.set(element.id, ref);\n }\n }\n\n getHTMLIFrameElement(element) {\n //zsviczian\n if (typeof element === \"string\") {\n return this.iFrameRefs.get(element);\n }\n\n return this.iFrameRefs.get(element.id);\n }\n\n handleEmbeddableCenterClick(element) {\n var _a, _b, _c, _d;\n\n if (((_a = this.state.activeEmbeddable) === null || _a === void 0 ? void 0 : _a.element) === element && ((_b = this.state.activeEmbeddable) === null || _b === void 0 ? void 0 : _b.state) === \"active\") {\n return;\n } // The delay serves two purposes\n // 1. To prevent first click propagating to iframe on mobile,\n // else the click will immediately start and stop the video\n // 2. If the user double clicks the frame center to activate it\n // without the delay youtube will immediately open the video\n // in fullscreen mode\n\n\n setTimeout(() => {\n this.setState({\n activeEmbeddable: {\n element,\n state: \"active\"\n },\n selectedElementIds: {\n [element.id]: true\n },\n newElement: null,\n selectionElement: null\n });\n }, 100);\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isIframeElement)(element)) {\n return;\n }\n\n const iframe = this.getHTMLIFrameElement(element);\n\n if (!(iframe === null || iframe === void 0 ? void 0 : iframe.contentWindow)) {\n return;\n }\n\n if (iframe.src.includes(\"youtube\")) {\n const state = YOUTUBE_VIDEO_STATES.get(element.id);\n\n if (!state) {\n YOUTUBE_VIDEO_STATES.set(element.id, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.YOUTUBE_STATES.UNSTARTED);\n iframe.contentWindow.postMessage(JSON.stringify({\n event: \"listening\",\n id: element.id\n }), \"*\");\n }\n\n switch (state) {\n case _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.YOUTUBE_STATES.PLAYING:\n case _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.YOUTUBE_STATES.BUFFERING:\n (_c = iframe.contentWindow) === null || _c === void 0 ? void 0 : _c.postMessage(JSON.stringify({\n event: \"command\",\n func: \"pauseVideo\",\n args: \"\"\n }), \"*\");\n break;\n\n default:\n (_d = iframe.contentWindow) === null || _d === void 0 ? void 0 : _d.postMessage(JSON.stringify({\n event: \"command\",\n func: \"playVideo\",\n args: \"\"\n }), \"*\");\n }\n }\n\n if (iframe.src.includes(\"player.vimeo.com\")) {\n iframe.contentWindow.postMessage(JSON.stringify({\n method: \"paused\" //video play/pause in onWindowMessage handler\n\n }), \"*\");\n }\n }\n\n isIframeLikeElementCenter(el, event, sceneX, sceneY) {\n var _a, _b;\n\n return el && !event.altKey && !event.shiftKey && !event.metaKey && !event.ctrlKey && (((_a = this.state.activeEmbeddable) === null || _a === void 0 ? void 0 : _a.element) !== el || ((_b = this.state.activeEmbeddable) === null || _b === void 0 ? void 0 : _b.state) === \"hover\" || !this.state.activeEmbeddable) && sceneX >= el.x + el.width / 3 && sceneX <= el.x + 2 * el.width / 3 && sceneY >= el.y + el.height / 3 && sceneY <= el.y + 2 * el.height / 3;\n }\n\n renderEmbeddables() {\n const scale = this.state.zoom.value;\n const normalizedWidth = this.state.width;\n const normalizedHeight = this.state.height;\n const embeddableElements = this.scene.getNonDeletedElements().filter(el => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isEmbeddableElement)(el) && this.embedsValidationStatus.get(el.id) === true || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isIframeElement)(el));\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, embeddableElements.map(el => {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;\n\n const {\n x,\n y\n } = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.sceneCoordsToViewportCoords)({\n sceneX: el.x,\n sceneY: el.y\n }, this.state); //zsviczian - shouldRenderAllEmbeddables\n\n const isVisible = this.shouldRenderAllEmbeddables || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElementInViewport)(el, normalizedWidth, normalizedHeight, this.state, this.scene.getNonDeletedElementsMap());\n const hasBeenInitialized = this.initializedEmbeds.has(el.id);\n\n if (isVisible && !hasBeenInitialized) {\n this.initializedEmbeds.add(el.id);\n }\n\n const shouldRender = isVisible || hasBeenInitialized;\n\n if (!shouldRender) {\n return null;\n }\n\n let src;\n const embedLink = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getEmbedLink)((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.toValidURL)(el.link || \"\")); //zsviczian\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isIframeElement)(el)) {\n src = null;\n const data = ((_b = (_a = el.customData) === null || _a === void 0 ? void 0 : _a.generationData) !== null && _b !== void 0 ? _b : this.magicGenerations.get(el.id)) || {\n status: \"error\",\n message: \"No generation data\",\n code: \"ERR_NO_GENERATION_DATA\"\n };\n\n if (data.status === \"done\") {\n const html = data.html;\n src = {\n intrinsicSize: {\n w: el.width,\n h: el.height\n },\n type: \"document\",\n srcdoc: () => {\n return html;\n }\n };\n } else if (data.status === \"pending\") {\n src = {\n intrinsicSize: {\n w: el.width,\n h: el.height\n },\n type: \"document\",\n srcdoc: () => {\n return (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.createSrcDoc)(`\n <style>\n html, body {\n width: 100%;\n height: 100%;\n color: ${this.state.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.THEME.DARK ? \"white\" : \"black\"};\n }\n body {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n gap: 1rem;\n }\n\n .Spinner {\n display: flex;\n align-items: center;\n justify-content: center;\n margin-left: auto;\n margin-right: auto;\n }\n\n .Spinner svg {\n animation: rotate 1.6s linear infinite;\n transform-origin: center center;\n width: 40px;\n height: 40px;\n }\n\n .Spinner circle {\n stroke: currentColor;\n animation: dash 1.6s linear 0s infinite;\n stroke-linecap: round;\n }\n\n @keyframes rotate {\n 100% {\n transform: rotate(360deg);\n }\n }\n\n @keyframes dash {\n 0% {\n stroke-dasharray: 1, 300;\n stroke-dashoffset: 0;\n }\n 50% {\n stroke-dasharray: 150, 300;\n stroke-dashoffset: -200;\n }\n 100% {\n stroke-dasharray: 1, 300;\n stroke-dashoffset: -280;\n }\n }\n </style>\n <div class=\"Spinner\">\n <svg\n viewBox=\"0 0 100 100\"\n >\n <circle\n cx=\"50\"\n cy=\"50\"\n r=\"46\"\n stroke-width=\"8\"\n fill=\"none\"\n stroke-miter-limit=\"10\"\n />\n </svg>\n </div>\n <div>Generating...</div>\n `);\n }\n };\n } else {\n let message;\n\n if (data.code === \"ERR_GENERATION_INTERRUPTED\") {\n message = \"Generation was interrupted...\";\n } else {\n message = data.message || \"Generation failed\";\n }\n\n src = {\n intrinsicSize: {\n w: el.width,\n h: el.height\n },\n type: \"document\",\n srcdoc: () => {\n return (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.createSrcDoc)(`\n <style>\n html, body {\n height: 100%;\n }\n body {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n color: ${_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.COLOR_PALETTE.red[3]};\n }\n h1, h3 {\n margin-top: 0;\n margin-bottom: 0.5rem;\n }\n </style>\n <h1>Error!</h1>\n <h3>${message}</h3>\n `);\n }\n };\n }\n } else {\n src = embedLink; //zsviczian getEmbedLink(toValidURL(el.link || \"\"));\n }\n\n const isActive = ((_c = this.state.activeEmbeddable) === null || _c === void 0 ? void 0 : _c.element) === el && ((_d = this.state.activeEmbeddable) === null || _d === void 0 ? void 0 : _d.state) === \"active\";\n const isHovered = ((_e = this.state.activeEmbeddable) === null || _e === void 0 ? void 0 : _e.element) === el && ((_f = this.state.activeEmbeddable) === null || _f === void 0 ? void 0 : _f.state) === \"hover\";\n const isWebview = //zsviczian\n !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isIframeElement)(el) && this.props.renderWebview && (embedLink === null || embedLink === void 0 ? void 0 : embedLink.type) !== \"document\" && !((_h = (_g = embedLink === null || embedLink === void 0 ? void 0 : embedLink.link) === null || _g === void 0 ? void 0 : _g.startsWith) === null || _h === void 0 ? void 0 : _h.call(_g, \"https://player.vimeo.com\")); // Modify the scale based on el.scale property\n\n const [xScale, yScale] = (_j = el.scale) !== null && _j !== void 0 ? _j : [1, 1]; //zsviczian\n\n const scaledTransform = `scale(${scale * xScale}, ${scale * yScale})`;\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n key: el.id,\n className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"excalidraw__embeddable-container\", {\n \"is-hovered\": isHovered\n }),\n style: {\n transform: isVisible ? `translate(${x - this.state.offsetLeft}px, ${y - this.state.offsetTop}px) ${scaledTransform}` : \"none\",\n display: isVisible ? \"block\" : \"none\",\n opacity: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getRenderOpacity)(el, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getContainingFrame)(el, this.scene.getNonDeletedElementsMap()), this.elementsPendingErasure, null, ((_k = this.state.openDialog) === null || _k === void 0 ? void 0 : _k.name) === \"elementLinkSelector\" ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.DEFAULT_REDUCED_GLOBAL_ALPHA : 1),\n [\"--embeddable-radius\"]: `${(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getCornerRadius)(Math.min(el.width, el.height), el) / xScale //zsviczian\n }px`\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n //this is a hack that addresses isse with embedded excalidraw.com embeddable\n //https://github.com/excalidraw/excalidraw/pull/6691#issuecomment-1607383938\n\n /*ref={(ref) => {\r\n if (!this.excalidrawContainerRef.current) {\r\n return;\r\n }\r\n const container = this.excalidrawContainerRef.current;\r\n const sh = container.scrollHeight;\r\n const ch = container.clientHeight;\r\n if (sh !== ch) {\r\n container.style.height = `${sh}px`;\r\n setTimeout(() => {\r\n container.style.height = `100%`;\r\n });\r\n }\r\n }}*/\n className: \"excalidraw__embeddable-container__inner\",\n style: {\n width: isVisible ? `${el.width / xScale}px` : 0,\n height: isVisible ? `${el.height / yScale}px` : 0,\n transform: isVisible ? `rotate(${el.angle}rad)` : \"none\",\n pointerEvents: isActive ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.POINTER_EVENTS.enabled : _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.POINTER_EVENTS.disabled\n }\n }, isHovered && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"excalidraw__embeddable-hint\"\n }, (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"buttons.embeddableInteractionButton\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"excalidraw__embeddable__outer\",\n style: {\n padding: `${el.strokeWidth / (4 * el.scale[0])}px` //zsviczian MDEmbeddable round border cutoff issue\n\n }\n }, (_o = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isEmbeddableElement)(el) ? (_m = (_l = this.props).renderEmbeddable) === null || _m === void 0 ? void 0 : _m.call(_l, el, this.state) //zsviczian\n : null) !== null && _o !== void 0 ? _o : isWebview ?\n /*#__PURE__*/\n //zsviczian\n react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"webview\", {\n ref: ref => this.cacheEmbeddableRef(el, ref),\n className: \"excalidraw__embeddable\",\n src: (embedLink === null || embedLink === void 0 ? void 0 : embedLink.type) === \"generic\" || (embedLink === null || embedLink === void 0 ? void 0 : embedLink.type) === \"video\" ? embedLink.link : \"\",\n title: \"Excalidraw Embedded Content\",\n allowFullScreen: true\n }) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"iframe\", {\n ref: ref => this.cacheEmbeddableRef(el, ref),\n className: \"excalidraw__embeddable\",\n srcDoc: (src === null || src === void 0 ? void 0 : src.type) === \"document\" ? src.srcdoc(this.state.theme) : undefined,\n src: (src === null || src === void 0 ? void 0 : src.type) !== \"document\" ? (_p = src === null || src === void 0 ? void 0 : src.link) !== null && _p !== void 0 ? _p : \"\" : undefined,\n // https://stackoverflow.com/q/18470015\n // scrolling=\"no\" //zsviczian\n referrerPolicy: \"no-referrer-when-downgrade\",\n title: \"Excalidraw Embedded Content\",\n allow: \"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\",\n allowFullScreen: true,\n sandbox: `${((_q = src === null || src === void 0 ? void 0 : src.sandbox) === null || _q === void 0 ? void 0 : _q.allowSameOrigin) ? \"allow-same-origin\" : \"\"} allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation allow-downloads`\n }))));\n }));\n }\n\n toggleOverscrollBehavior(event) {\n // when pointer inside editor, disable overscroll behavior to prevent\n // panning to trigger history back/forward on MacOS Chrome\n document.documentElement.style.overscrollBehaviorX = event.type === \"pointerenter\" ? \"none\" : \"auto\";\n }\n\n render() {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;\n\n const selectedElements = this.scene.getSelectedElements(this.state);\n const {\n renderTopRightUI,\n renderTopLeftUI,\n renderCustomStats\n } = this.props;\n const sceneNonce = this.scene.getSceneNonce();\n const {\n elementsMap,\n visibleElements\n } = this.renderer.getRenderableElements({\n sceneNonce,\n zoom: this.state.zoom,\n offsetLeft: this.state.offsetLeft,\n offsetTop: this.state.offsetTop,\n scrollX: this.state.scrollX,\n scrollY: this.state.scrollY,\n height: this.state.height,\n width: this.state.width,\n editingTextElement: this.state.editingTextElement,\n newElementId: (_a = this.state.newElement) === null || _a === void 0 ? void 0 : _a.id\n });\n this.visibleElements = visibleElements;\n const allElementsMap = this.scene.getNonDeletedElementsMap();\n const shouldBlockPointerEvents = // default back to `--ui-pointerEvents` flow if setPointerCapture\n // not supported\n \"setPointerCapture\" in HTMLElement.prototype ? false : this.state.selectionElement || this.state.newElement || this.state.selectedElementsAreBeingDragged || this.state.resizingElement || this.state.activeTool.type === \"laser\" && // technically we can just test on this once we make it more safe\n this.state.cursorButton === \"down\";\n const firstSelectedElement = selectedElements[0]; //zsviczian\n\n const isHighlighter = (_d = (_c = (_b = this.state.newElement) === null || _b === void 0 ? void 0 : _b.customData) === null || _c === void 0 ? void 0 : _c.strokeOptions) === null || _d === void 0 ? void 0 : _d.highlighter;\n const showShapeSwitchPanel = ((_e = _editor_jotai__WEBPACK_IMPORTED_MODULE_37__.editorJotaiStore.get(_ConvertElementTypePopup__WEBPACK_IMPORTED_MODULE_52__.convertElementTypePopupAtom)) === null || _e === void 0 ? void 0 : _e.type) === \"panel\";\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"excalidraw excalidraw-container\", {\n \"excalidraw--view-mode\": this.state.viewModeEnabled || ((_f = this.state.openDialog) === null || _f === void 0 ? void 0 : _f.name) === \"elementLinkSelector\",\n \"excalidraw--mobile\": this.editorInterface.formFactor === \"phone\",\n \"excalidraw--tray\": !(this.state.viewModeEnabled || this.state.zenModeEnabled) && this.editorInterface.formFactor !== \"phone\" && this.editorInterface.preferTrayMode //zsviczian\n\n }),\n style: Object.assign(Object.assign({\n //zsviczian\n [\"--ui-pointerEvents\"]: shouldBlockPointerEvents ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.POINTER_EVENTS.disabled : _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.POINTER_EVENTS.enabled\n }, this.state.dynamicStyle || {}), {\n [\"--right-sidebar-width\"]: \"302px\"\n }),\n ref: this.excalidrawContainerRef,\n onDrop: this.handleAppOnDrop,\n tabIndex: 0,\n onKeyDown: this.props.handleKeyboardGlobally ? undefined : this.onKeyDown,\n onPointerEnter: this.toggleOverscrollBehavior,\n onPointerLeave: this.toggleOverscrollBehavior\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(AppContext.Provider, {\n value: this\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(AppPropsContext.Provider, {\n value: this.props\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(ExcalidrawContainerContext.Provider, {\n value: this.excalidrawContainerValue\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(EditorInterfaceContext.Provider, {\n value: this.editorInterface\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(ExcalidrawSetAppStateContext.Provider, {\n value: this.setAppState\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(ExcalidrawAppStateContext.Provider, {\n value: this.state\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(ExcalidrawElementsContext.Provider, {\n value: this.scene.getNonDeletedElements()\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(ExcalidrawActionManagerContext.Provider, {\n value: this.actionManager\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_LayerUI__WEBPACK_IMPORTED_MODULE_58__[\"default\"], {\n canvas: this.canvas,\n appState: this.state,\n files: this.files,\n setAppState: this.setAppState,\n actionManager: this.actionManager,\n elements: this.scene.getNonDeletedElements(),\n onLockToggle: this.toggleLock,\n onPenModeToggle: this.togglePenMode,\n onHandToolToggle: this.onHandToolToggle,\n langCode: (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.getLanguage)().code,\n renderTopLeftUI: renderTopLeftUI,\n renderTopRightUI: renderTopRightUI,\n renderCustomStats: renderCustomStats,\n showExitZenModeBtn: typeof ((_g = this.props) === null || _g === void 0 ? void 0 : _g.zenModeEnabled) === \"undefined\" && this.state.zenModeEnabled,\n UIOptions: this.props.UIOptions,\n onExportImage: this.onExportImage,\n renderWelcomeScreen: !this.state.isLoading && this.state.showWelcomeScreen && this.state.activeTool.type === this.state.preferredSelectionTool.type && !this.state.zenModeEnabled && !this.scene.getElementsIncludingDeleted().length,\n app: this,\n isCollaborating: this.props.isCollaborating,\n generateLinkForSelection: this.props.generateLinkForSelection\n }, this.props.children), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"excalidraw-textEditorContainer\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"excalidraw-contextMenuContainer\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"excalidraw-eye-dropper-container\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_SVGLayer__WEBPACK_IMPORTED_MODULE_60__.SVGLayer, {\n trails: [this.laserTrails, this.lassoTrail, this.eraserTrail]\n }), selectedElements.length === 1 && ((_h = this.state.openDialog) === null || _h === void 0 ? void 0 : _h.name) !== \"elementLinkSelector\" && this.state.showHyperlinkPopup && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_components_hyperlink_Hyperlink__WEBPACK_IMPORTED_MODULE_35__.Hyperlink, {\n key: firstSelectedElement.id,\n element: firstSelectedElement,\n scene: this.scene,\n setAppState: this.setAppState,\n onLinkOpen: this.props.onLinkOpen,\n setToast: this.setToast,\n updateEmbedValidationStatus: this.updateEmbedValidationStatus\n }), this.props.aiEnabled !== false && selectedElements.length === 1 && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isMagicFrameElement)(firstSelectedElement) && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_components_ElementCanvasButtons__WEBPACK_IMPORTED_MODULE_43__.ElementCanvasButtons, {\n element: firstSelectedElement,\n elementsMap: elementsMap\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_MagicButton__WEBPACK_IMPORTED_MODULE_59__.ElementCanvasButton, {\n title: (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"labels.convertToCode\"),\n icon: _icons__WEBPACK_IMPORTED_MODULE_66__.MagicIcon,\n checked: false,\n onChange: () => this.onMagicFrameGenerate(firstSelectedElement, \"button\")\n })), selectedElements.length === 1 && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isIframeElement)(firstSelectedElement) && ((_k = (_j = firstSelectedElement.customData) === null || _j === void 0 ? void 0 : _j.generationData) === null || _k === void 0 ? void 0 : _k.status) === \"done\" && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_components_ElementCanvasButtons__WEBPACK_IMPORTED_MODULE_43__.ElementCanvasButtons, {\n element: firstSelectedElement,\n elementsMap: elementsMap\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_MagicButton__WEBPACK_IMPORTED_MODULE_59__.ElementCanvasButton, {\n title: (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"labels.copySource\"),\n icon: _icons__WEBPACK_IMPORTED_MODULE_66__.copyIcon,\n checked: false,\n onChange: () => this.onIframeSrcCopy(firstSelectedElement)\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_MagicButton__WEBPACK_IMPORTED_MODULE_59__.ElementCanvasButton, {\n title: \"Enter fullscreen\",\n icon: _icons__WEBPACK_IMPORTED_MODULE_66__.fullscreenIcon,\n checked: false,\n onChange: () => {\n const iframe = this.getHTMLIFrameElement(firstSelectedElement);\n\n if (iframe) {\n try {\n iframe.requestFullscreen();\n this.setState({\n activeEmbeddable: {\n element: firstSelectedElement,\n state: \"active\"\n },\n selectedElementIds: {\n [firstSelectedElement.id]: true\n },\n newElement: null,\n selectionElement: null\n });\n } catch (err) {\n console.warn(err);\n this.setState({\n errorMessage: \"Couldn't enter fullscreen\"\n });\n }\n }\n }\n })), this.state.toast !== null && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_Toast__WEBPACK_IMPORTED_MODULE_67__.Toast, {\n message: this.state.toast.message,\n onClose: this.handleToastClose,\n duration: this.state.toast.duration,\n closable: this.state.toast.closable\n }), this.state.contextMenu && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_ContextMenu__WEBPACK_IMPORTED_MODULE_55__.ContextMenu, {\n items: this.state.contextMenu.items,\n top: this.state.contextMenu.top,\n left: this.state.contextMenu.left,\n actionManager: this.actionManager,\n onClose: callback => {\n this.setState({\n contextMenu: null\n }, () => {\n this.focusContainer();\n callback === null || callback === void 0 ? void 0 : callback();\n });\n }\n }), this.state.newElement && isHighlighter &&\n /*#__PURE__*/\n //zsviczian\n react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_canvases_NewElementCanvas__WEBPACK_IMPORTED_MODULE_64__[\"default\"], {\n appState: this.state,\n scale: window.devicePixelRatio,\n rc: this.rc,\n elementsMap: elementsMap,\n allElementsMap: allElementsMap,\n renderConfig: {\n imageCache: this.imageCache,\n isExporting: false,\n renderGrid: false,\n canvasBackgroundColor: this.state.viewBackgroundColor,\n embedsValidationStatus: this.embedsValidationStatus,\n elementsPendingErasure: this.elementsPendingErasure,\n pendingFlowchartNodes: null,\n isHighlighterPenDrawing: isHighlighter //zsviczian\n\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_canvases__WEBPACK_IMPORTED_MODULE_63__.StaticCanvas, {\n canvas: this.canvas,\n rc: this.rc,\n elementsMap: elementsMap,\n allElementsMap: allElementsMap,\n visibleElements: visibleElements,\n sceneNonce: sceneNonce,\n selectionNonce: (_l = this.state.selectionElement) === null || _l === void 0 ? void 0 : _l.versionNonce,\n scale: window.devicePixelRatio,\n appState: this.state,\n renderConfig: {\n imageCache: this.imageCache,\n isExporting: false,\n renderGrid: (0,_snapping__WEBPACK_IMPORTED_MODULE_39__.isGridModeEnabled)(this),\n canvasBackgroundColor: this.state.viewBackgroundColor,\n embedsValidationStatus: this.embedsValidationStatus,\n elementsPendingErasure: this.elementsPendingErasure,\n pendingFlowchartNodes: this.flowChartCreator.pendingNodes,\n isHighlighterPenDrawing: isHighlighter //zsviczian\n\n }\n }), this.state.newElement && !isHighlighter &&\n /*#__PURE__*/\n //zsviczian\n react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_canvases_NewElementCanvas__WEBPACK_IMPORTED_MODULE_64__[\"default\"], {\n appState: this.state,\n scale: window.devicePixelRatio,\n rc: this.rc,\n elementsMap: elementsMap,\n allElementsMap: allElementsMap,\n renderConfig: {\n imageCache: this.imageCache,\n isExporting: false,\n renderGrid: false,\n canvasBackgroundColor: this.state.viewBackgroundColor,\n embedsValidationStatus: this.embedsValidationStatus,\n elementsPendingErasure: this.elementsPendingErasure,\n pendingFlowchartNodes: null,\n isHighlighterPenDrawing: isHighlighter //zsviczian\n\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_canvases__WEBPACK_IMPORTED_MODULE_63__.InteractiveCanvas, {\n containerRef: this.excalidrawContainerRef,\n canvas: this.interactiveCanvas,\n elementsMap: elementsMap,\n visibleElements: visibleElements,\n allElementsMap: allElementsMap,\n selectedElements: selectedElements,\n sceneNonce: sceneNonce,\n selectionNonce: (_m = this.state.selectionElement) === null || _m === void 0 ? void 0 : _m.versionNonce,\n scale: window.devicePixelRatio,\n appState: this.state,\n renderScrollbars: this.props.renderScrollbars === true,\n editorInterface: this.editorInterface,\n renderInteractiveSceneCallback: this.renderInteractiveSceneCallback,\n handleCanvasRef: this.handleInteractiveCanvasRef,\n onContextMenu: this.handleCanvasContextMenu,\n onPointerMove: this.handleCanvasPointerMove,\n onPointerUp: this.handleCanvasPointerUp,\n onPointerCancel: this.removePointer,\n onTouchMove: this.handleTouchMove,\n onPointerDown: this.handleCanvasPointerDown,\n onDoubleClick: this.handleCanvasDoubleClick\n }), this.state.userToFollow && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_FollowMode_FollowMode__WEBPACK_IMPORTED_MODULE_57__[\"default\"], {\n width: this.state.width,\n height: this.state.height,\n userToFollow: this.state.userToFollow,\n onDisconnect: this.maybeUnfollowRemoteUser\n }), this.renderFrameNames(), ((_o = this.state.activeEmbeddable) === null || _o === void 0 ? void 0 : _o.state) === \"active\" && ( //zsviczian\n (_q = (_p = this.props).renderEmbeddableMenu) === null || _q === void 0 ? void 0 : _q.call(_p, this.state)), this.state.activeLockedId && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_UnlockPopup__WEBPACK_IMPORTED_MODULE_69__[\"default\"], {\n app: this,\n activeLockedId: this.state.activeLockedId\n }), showShapeSwitchPanel && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_ConvertElementTypePopup__WEBPACK_IMPORTED_MODULE_52__[\"default\"], {\n app: this\n })), this.renderEmbeddables()))))))));\n }\n\n setPlugins(plugins) {\n Object.assign(this.plugins, plugins);\n }\n\n async onMagicFrameGenerate(magicFrame, source) {\n var _a;\n\n const generateDiagramToCode = (_a = this.plugins.diagramToCode) === null || _a === void 0 ? void 0 : _a.generate;\n\n if (!generateDiagramToCode) {\n this.setState({\n errorMessage: \"No diagram to code plugin found\"\n });\n return;\n }\n\n const magicFrameChildren = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getElementsOverlappingFrame)(this.scene.getNonDeletedElements(), magicFrame).filter(el => !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isMagicFrameElement)(el));\n\n if (!magicFrameChildren.length) {\n if (source === \"button\") {\n this.setState({\n errorMessage: \"Cannot generate from an empty frame\"\n });\n (0,_analytics__WEBPACK_IMPORTED_MODULE_21__.trackEvent)(\"ai\", \"generate (no-children)\", \"d2c\");\n } else {\n this.setActiveTool({\n type: \"magicframe\"\n });\n }\n\n return;\n }\n\n const frameElement = this.insertIframeElement({\n sceneX: magicFrame.x + magicFrame.width + 30,\n sceneY: magicFrame.y,\n width: magicFrame.width,\n height: magicFrame.height\n });\n\n if (!frameElement) {\n return;\n }\n\n this.updateMagicGeneration({\n frameElement,\n data: {\n status: \"pending\"\n }\n });\n this.setState({\n selectedElementIds: {\n [frameElement.id]: true\n }\n });\n (0,_analytics__WEBPACK_IMPORTED_MODULE_21__.trackEvent)(\"ai\", \"generate (start)\", \"d2c\");\n\n try {\n const {\n html\n } = await generateDiagramToCode({\n frame: magicFrame,\n children: magicFrameChildren\n });\n (0,_analytics__WEBPACK_IMPORTED_MODULE_21__.trackEvent)(\"ai\", \"generate (success)\", \"d2c\");\n\n if (!html.trim()) {\n this.updateMagicGeneration({\n frameElement,\n data: {\n status: \"error\",\n code: \"ERR_OAI\",\n message: \"Nothing genereated :(\"\n }\n });\n return;\n }\n\n const parsedHtml = html.includes(\"<!DOCTYPE html>\") && html.includes(\"</html>\") ? html.slice(html.indexOf(\"<!DOCTYPE html>\"), html.indexOf(\"</html>\") + \"</html>\".length) : html;\n this.updateMagicGeneration({\n frameElement,\n data: {\n status: \"done\",\n html: parsedHtml\n }\n });\n } catch (error) {\n (0,_analytics__WEBPACK_IMPORTED_MODULE_21__.trackEvent)(\"ai\", \"generate (failed)\", \"d2c\");\n this.updateMagicGeneration({\n frameElement,\n data: {\n status: \"error\",\n code: \"ERR_OAI\",\n message: error.message || \"Unknown error during generation\"\n }\n });\n }\n }\n\n onIframeSrcCopy(element) {\n var _a, _b;\n\n if (((_b = (_a = element.customData) === null || _a === void 0 ? void 0 : _a.generationData) === null || _b === void 0 ? void 0 : _b.status) === \"done\") {\n (0,_clipboard__WEBPACK_IMPORTED_MODULE_24__.copyTextToSystemClipboard)(element.customData.generationData.html);\n this.setToast({\n message: \"copied to clipboard\",\n closable: false,\n duration: 1500\n });\n }\n }\n\n clearImageShapeCache(filesMap) {\n const files = filesMap !== null && filesMap !== void 0 ? filesMap : this.files;\n this.scene.getNonDeletedElements().forEach(element => {\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isInitializedImageElement)(element) && files[element.fileId]) {\n this.imageCache.delete(element.fileId);\n _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.ShapeCache.delete(element);\n }\n });\n }\n\n async componentDidMount() {\n var _a;\n\n this.unmounted = false;\n this.excalidrawContainerValue.container = this.excalidrawContainerRef.current; //zsviczian disabling this code\n\n /*\r\n if (false && (isTestEnv() || isDevEnv())) {\r\n const setState = this.setState.bind(this);\r\n Object.defineProperties(window.h, {\r\n state: {\r\n configurable: true,\r\n get: () => {\r\n return this.state;\r\n },\r\n },\r\n setState: {\r\n configurable: true,\r\n value: (...args: Parameters<typeof setState>) => {\r\n return this.setState(...args);\r\n },\r\n },\r\n app: {\r\n configurable: true,\r\n value: this,\r\n },\r\n history: {\r\n configurable: true,\r\n value: this.history,\r\n },\r\n store: {\r\n configurable: true,\r\n value: this.store,\r\n },\r\n fonts: {\r\n configurable: true,\r\n value: this.fonts,\r\n },\r\n });\r\n }*/\n\n this.store.onDurableIncrementEmitter.on(increment => {\n this.history.record(increment.delta);\n });\n const {\n onIncrement\n } = this.props; // per. optimmisation, only subscribe if there is the `onIncrement` prop registered, to avoid unnecessary computation\n\n if (onIncrement) {\n this.store.onStoreIncrementEmitter.on(increment => {\n onIncrement(increment);\n });\n }\n\n this.scene.onUpdate(this.triggerRender);\n this.addEventListeners();\n\n if (this.props.autoFocus && this.excalidrawContainerRef.current) {\n this.focusContainer();\n }\n\n if (_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.supportsResizeObserver && this.excalidrawContainerRef.current) {\n this.resizeObserver = new ResizeObserver(() => {\n this.refreshEditorInterface();\n this.updateDOMRect();\n });\n (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.observe(this.excalidrawContainerRef.current);\n }\n\n const searchParams = new URLSearchParams(window.location.search.slice(1));\n\n if (searchParams.has(\"web-share-target\")) {\n // Obtain a file that was shared via the Web Share Target API.\n this.restoreFileFromShare();\n } else {\n this.updateDOMRect(this.initializeScene);\n } // note that this check seems to always pass in localhost\n\n\n if ((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isBrave)() && !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isMeasureTextSupported)()) {\n this.setState({\n errorMessage: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_BraveMeasureTextError__WEBPACK_IMPORTED_MODULE_54__[\"default\"], null)\n });\n }\n }\n\n componentWillUnmount() {\n var _a, _b;\n\n (_a = window.launchQueue) === null || _a === void 0 ? void 0 : _a.setConsumer(() => {});\n this.renderer.destroy();\n this.scene.destroy();\n this.scene = new _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.Scene();\n this.fonts = new _fonts__WEBPACK_IMPORTED_MODULE_36__.Fonts(this.scene);\n this.renderer = new _scene_Renderer__WEBPACK_IMPORTED_MODULE_41__.Renderer(this.scene);\n this.files = {};\n this.imageCache.clear();\n (_b = this.resizeObserver) === null || _b === void 0 ? void 0 : _b.disconnect();\n this.unmounted = true;\n this.removeEventListeners();\n this.library.destroy();\n this.laserTrails.stop();\n this.eraserTrail.stop();\n this.onChangeEmitter.clear();\n this.store.onStoreIncrementEmitter.clear();\n this.store.onDurableIncrementEmitter.clear();\n _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.ShapeCache.destroy();\n _snapping__WEBPACK_IMPORTED_MODULE_39__.SnapCache.destroy();\n clearTimeout(touchTimeout);\n _scene__WEBPACK_IMPORTED_MODULE_31__.isSomeElementSelected.clearCache();\n _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.selectGroupsForSelectedElements.clearCache();\n touchTimeout = 0;\n document.documentElement.style.overscrollBehaviorX = \"\";\n document.body.removeChild((0,_Tooltip__WEBPACK_IMPORTED_MODULE_71__.getTooltipDiv)()); //clearRenderCache(); //zsviczian\n\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.clearEraserCanvasCache)(); //zsviczian\n\n this.interactiveCanvas = null; //zsviczian\n\n this.iFrameRefs.clear(); //zsviczian\n //@ts-ignore\n\n this.iFrameRefs = null; //zsviczian\n\n this.embedsValidationStatus.clear(); //zsviczian\n //@ts-ignore\n\n this.embedsValidationStatus = null; //zsviczian\n\n this.initializedEmbeds.clear(); //zsviczian\n //@ts-ignore\n\n this.initializedEmbeds = null; //zsviczian\n\n this.elementsPendingErasure.clear(); //zsviczian\n //@ts-ignore\n\n this.elementsPendingErasure = null; //zsviczian\n\n this.lastPointerDownEvent = null; //zsviczian\n\n this.lastPointerUpEvent = null; //zsviczian\n\n this.lastPointerMoveEvent = null; //zsviczian\n //@ts-ignore\n\n this.actionManager.app = null; //zsviczian\n\n this.actionManager.actions = {}; //zsviczian\n\n this.history.clear(); //zsviczian\n\n this.store.clear(); //zsviczian\n //@ts-ignore\n\n this.store = null; //zsviczian\n //@ts-ignore\n\n this.library = null; //zsviczian\n //@ts-ignore\n\n this.canvas = null; //zsviczian\n //@ts-ignore\n\n this.rc = null; //zsviczian\n //@ts-ignore\n\n this.excalidrawContainerRef.current = undefined; //zsviczian\n\n this.nearestScrollableContainer = undefined; //zsviczian\n\n this.excalidrawContainerValue = {\n container: null,\n id: \"unknown\"\n }; //zsviczian\n //@ts-ignore\n // this.laserTrails.terminate(); //zsviczian\n // this.eraserTrail.terminate(); //zsviczian\n\n /*\r\n Object.keys(this).forEach((key) => {\r\n //@ts-ignore\r\n delete this[key];\r\n });*/\n }\n\n removeEventListeners() {\n this.onRemoveEventListenersEmitter.trigger();\n }\n\n addEventListeners() {\n // remove first as we can add event listeners multiple times\n this.removeEventListeners(); // -------------------------------------------------------------------------\n // view+edit mode listeners\n // -------------------------------------------------------------------------\n\n if (this.props.handleKeyboardGlobally) {\n this.onRemoveEventListenersEmitter.once((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(document, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.KEYDOWN, this.onKeyDown, false));\n }\n\n this.onRemoveEventListenersEmitter.once((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(this.excalidrawContainerRef.current, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.WHEEL, this.handleWheel, {\n passive: false\n }), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(window, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.MESSAGE, this.onWindowMessage, false), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(document, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_UP, this.removePointer, {\n passive: false\n }), // #3553\n (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(document, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.COPY, this.onCopy, {\n passive: false\n }), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(document, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.KEYUP, this.onKeyUp, {\n passive: true\n }), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(window, \"focus\", () => this.triggerRender(true), {\n passive: true\n }), //zsviczian\n (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(document, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_MOVE, this.updateCurrentCursorPosition, {\n passive: false\n }), // rerender text elements on font load to fix #637 && #1553\n // zsviczian In Obsidian this is not needed as I manage font load separately\n (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(document.fonts, \"loadingdone\", event => {\n const fontFaces = event.fontfaces;\n this.fonts.onLoaded(fontFaces);\n }, {\n passive: false\n }), // Safari-only desktop pinch zoom\n (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(document, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.GESTURE_START, this.onGestureStart, false), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(document, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.GESTURE_CHANGE, this.onGestureChange, false), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(document, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.GESTURE_END, this.onGestureEnd, false), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(window, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.FOCUS, () => {\n this.maybeCleanupAfterMissingPointerUp(null); // browsers (chrome?) tend to free up memory a lot, which results\n // in canvas context being cleared. Thus re-render on focus.\n\n this.triggerRender(true);\n }, {\n passive: false\n }));\n\n if (this.state.viewModeEnabled) {\n return;\n } // -------------------------------------------------------------------------\n // edit-mode listeners only\n // -------------------------------------------------------------------------\n\n\n this.onRemoveEventListenersEmitter.once((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(document, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.FULLSCREENCHANGE, this.onFullscreenChange, {\n passive: false\n }), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(document, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.PASTE, this.pasteFromClipboard, {\n passive: false\n }), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(document, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.CUT, this.onCut, {\n passive: false\n }), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(window, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.RESIZE, this.onResize, false), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(window, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.UNLOAD, this.onUnload, false), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(window, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.BLUR, this.onBlur, false),\n /*addEventListener( //zsviczian (duplicate)\r\n this.excalidrawContainerRef.current,\r\n EVENT.WHEEL,\r\n this.handleWheel,\r\n { passive: false },\r\n ),*/\n (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(this.excalidrawContainerRef.current, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.DRAG_OVER, this.disableEvent, false), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(this.excalidrawContainerRef.current, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.DROP, this.disableEvent, false));\n\n if (this.props.detectScroll) {\n this.onRemoveEventListenersEmitter.once((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getNearestScrollableContainer)(this.excalidrawContainerRef.current), _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.SCROLL, this.onScroll, {\n passive: false\n }));\n }\n }\n\n componentDidUpdate(prevProps, prevState) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;\n\n this.updateEmbeddables();\n const elements = this.scene.getElementsIncludingDeleted();\n const elementsMap = this.scene.getElementsMapIncludingDeleted();\n\n if (!this.state.showWelcomeScreen && !elements.length) {\n this.setState({\n showWelcomeScreen: true\n });\n }\n\n const hasFollowedPersonLeft = prevState.userToFollow && !this.state.collaborators.has(prevState.userToFollow.socketId);\n\n if (hasFollowedPersonLeft) {\n this.maybeUnfollowRemoteUser();\n }\n\n if (prevState.zoom.value !== this.state.zoom.value || prevState.scrollX !== this.state.scrollX || prevState.scrollY !== this.state.scrollY) {\n (_b = (_a = this.props) === null || _a === void 0 ? void 0 : _a.onScrollChange) === null || _b === void 0 ? void 0 : _b.call(_a, this.state.scrollX, this.state.scrollY, this.state.zoom);\n this.onScrollChangeEmitter.trigger(this.state.scrollX, this.state.scrollY, this.state.zoom);\n }\n\n if (prevState.userToFollow !== this.state.userToFollow) {\n if (prevState.userToFollow) {\n this.onUserFollowEmitter.trigger({\n userToFollow: prevState.userToFollow,\n action: \"UNFOLLOW\"\n });\n }\n\n if (this.state.userToFollow) {\n this.onUserFollowEmitter.trigger({\n userToFollow: this.state.userToFollow,\n action: \"FOLLOW\"\n });\n }\n } // zsviczian\n\n\n if (this.state.highlightSearchResult && !this.debounceClearHighlightSearchResults && prevState.selectedElementIds !== this.state.selectedElementIds) {\n this.setState({\n highlightSearchResult: false\n });\n }\n\n if (Object.keys(this.state.selectedElementIds).length && (0,_appState__WEBPACK_IMPORTED_MODULE_23__.isEraserActive)(this.state)) {\n this.setState({\n activeTool: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateActiveTool)(this.state, {\n type: \"selection\"\n })\n });\n }\n\n if (this.state.activeTool.type === \"eraser\" && prevState.theme !== this.state.theme) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setEraserCursor)(this.interactiveCanvas, this.state.theme);\n } // Hide hyperlink popup if shown when element type is not selection\n\n\n if (prevState.activeTool.type === \"selection\" && this.state.activeTool.type !== \"selection\" && this.state.showHyperlinkPopup) {\n this.setState({\n showHyperlinkPopup: false\n });\n }\n\n if (prevProps.langCode !== this.props.langCode) {\n this.updateLanguage();\n }\n\n if ((0,_appState__WEBPACK_IMPORTED_MODULE_23__.isEraserActive)(prevState) && !(0,_appState__WEBPACK_IMPORTED_MODULE_23__.isEraserActive)(this.state)) {\n this.eraserTrail.endPath();\n }\n\n if (prevProps.viewModeEnabled !== this.props.viewModeEnabled) {\n this.setState({\n viewModeEnabled: !!this.props.viewModeEnabled\n });\n }\n\n if (prevState.viewModeEnabled !== this.state.viewModeEnabled) {\n this.addEventListeners();\n this.deselectElements();\n } // cleanup\n\n\n if ((((_c = prevState.openDialog) === null || _c === void 0 ? void 0 : _c.name) === \"elementLinkSelector\" || ((_d = this.state.openDialog) === null || _d === void 0 ? void 0 : _d.name) === \"elementLinkSelector\") && ((_e = prevState.openDialog) === null || _e === void 0 ? void 0 : _e.name) !== ((_f = this.state.openDialog) === null || _f === void 0 ? void 0 : _f.name)) {\n this.deselectElements();\n this.setState({\n hoveredElementIds: {}\n });\n }\n\n if (prevProps.zenModeEnabled !== this.props.zenModeEnabled) {\n this.setState({\n zenModeEnabled: !!this.props.zenModeEnabled\n });\n }\n\n if (prevProps.theme !== this.props.theme && this.props.theme) {\n this.setState({\n theme: this.props.theme\n });\n }\n\n (_g = this.excalidrawContainerRef.current) === null || _g === void 0 ? void 0 : _g.classList.toggle(\"theme--dark\", this.state.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.THEME.DARK);\n\n if (((_h = this.state.selectedLinearElement) === null || _h === void 0 ? void 0 : _h.isEditing) && !this.state.selectedElementIds[this.state.selectedLinearElement.elementId]) {\n // defer so that the scheduleCapture flag isn't reset via current update\n setTimeout(() => {\n var _a; // execute only if the condition still holds when the deferred callback\n // executes (it can be scheduled multiple times depending on how\n // many times the component renders)\n\n\n ((_a = this.state.selectedLinearElement) === null || _a === void 0 ? void 0 : _a.isEditing) && this.actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_8__.actionFinalize);\n });\n } // failsafe in case the state is being updated in incorrect order resulting\n // in the editingTextElement being now a deleted element\n\n\n if ((_j = this.state.editingTextElement) === null || _j === void 0 ? void 0 : _j.isDeleted) {\n this.setState({\n editingTextElement: null\n });\n }\n\n if (this.state.selectedLinearElement && !this.state.selectedElementIds[this.state.selectedLinearElement.elementId]) {\n // To make sure `selectedLinearElement` is in sync with `selectedElementIds`, however this shouldn't be needed once\n // we have a single API to update `selectedElementIds`\n this.setState({\n selectedLinearElement: null\n });\n }\n\n this.store.commit(elementsMap, this.state); // Do not notify consumers if we're still loading the scene. Among other\n // potential issues, this fixes a case where the tab isn't focused during\n // init, which would trigger onChange with empty elements, which would then\n // override whatever is in localStorage currently.\n\n if (!this.state.isLoading) {\n (_l = (_k = this.props).onChange) === null || _l === void 0 ? void 0 : _l.call(_k, elements, this.state, this.files);\n this.onChangeEmitter.trigger(elements, this.state, this.files);\n }\n }\n\n static resetTapTwice() {\n didTapTwice = false;\n firstTapPosition = null;\n } // TODO: Cover with tests\n\n\n async insertClipboardContent(data, dataTransferFiles, isPlainPaste) {\n const {\n x: sceneX,\n y: sceneY\n } = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)({\n clientX: this.lastViewportPosition.x,\n clientY: this.lastViewportPosition.y\n }, this.state); // ------------------- Error -------------------\n\n if (data.errorMessage) {\n this.setState({\n errorMessage: data.errorMessage\n });\n return;\n } // ------------------- Mixed content with no files -------------------\n\n\n if (dataTransferFiles.length === 0 && !isPlainPaste && data.mixedContent) {\n await this.addElementsFromMixedContentPaste(data.mixedContent, {\n isPlainPaste,\n sceneX,\n sceneY\n });\n return;\n } // ------------------- Spreadsheet -------------------\n\n\n if (data.spreadsheet && !isPlainPaste) {\n this.setState({\n pasteDialog: {\n data: data.spreadsheet,\n shown: true\n }\n });\n return;\n } // ------------------- Images or SVG code -------------------\n\n\n const imageFiles = dataTransferFiles.map(data => data.file);\n\n if (imageFiles.length === 0 && data.text && !isPlainPaste) {\n const trimmedText = data.text.trim();\n\n if (trimmedText.startsWith(\"<svg\") && trimmedText.endsWith(\"</svg>\")) {\n // ignore SVG validation/normalization which will be done during image\n // initialization\n imageFiles.push((0,_data_blob__WEBPACK_IMPORTED_MODULE_33__.SVGStringToFile)(trimmedText));\n }\n }\n\n if (imageFiles.length > 0) {\n if (this.isToolSupported(\"image\")) {\n await this.insertImages(imageFiles, sceneX, sceneY);\n } else {\n this.setState({\n errorMessage: (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"errors.imageToolNotSupported\")\n });\n }\n\n return;\n } // ------------------- Elements -------------------\n\n\n if (data.elements) {\n const elements = data.programmaticAPI ? (0,_data_transform__WEBPACK_IMPORTED_MODULE_40__.convertToExcalidrawElements)(data.elements) : data.elements; // TODO: remove formatting from elements if isPlainPaste\n\n this.addElementsFromPasteOrLibrary({\n elements,\n files: data.files || null,\n position: this.editorInterface.formFactor === \"desktop\" ? \"cursor\" : \"center\",\n retainSeed: isPlainPaste\n });\n return;\n } // ------------------- Only textual stuff remaining -------------------\n\n\n if (!data.text) {\n return;\n } // ------------------- Successful Mermaid -------------------\n\n\n if (!isPlainPaste && (0,_mermaid__WEBPACK_IMPORTED_MODULE_48__.isMaybeMermaidDefinition)(data.text)) {\n const api = await Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! @zsviczian/mermaid-to-excalidraw */ \"../../node_modules/@zsviczian/mermaid-to-excalidraw/dist/index.js\"));\n\n try {\n const {\n elements: skeletonElements,\n files\n } = await api.parseMermaidToExcalidraw(data.text);\n const elements = (0,_data_transform__WEBPACK_IMPORTED_MODULE_40__.convertToExcalidrawElements)(skeletonElements, {\n regenerateIds: true\n });\n this.addElementsFromPasteOrLibrary({\n elements,\n files,\n position: this.editorInterface.formFactor === \"desktop\" ? \"cursor\" : \"center\"\n });\n return;\n } catch (err) {\n console.warn(`parsing pasted text as mermaid definition failed: ${err.message}`);\n }\n } // ------------------- Pure embeddable URLs -------------------\n\n\n const nonEmptyLines = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.normalizeEOL)(data.text).split(/\\n+/).map(s => s.trim()).filter(Boolean);\n const embbeddableUrls = nonEmptyLines.map(str => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.maybeParseEmbedSrc)(str)).filter(string => {\n var _a;\n\n return (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.embeddableURLValidator)(string, this.props.validateEmbeddable) && (/^(http|https):\\/\\/[^\\s/$.?#].[^\\s]*$/.test(string) || ((_a = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getEmbedLink)(string)) === null || _a === void 0 ? void 0 : _a.type) === \"video\");\n });\n\n if (!isPlainPaste && embbeddableUrls.length > 0 && embbeddableUrls.length === nonEmptyLines.length) {\n const embeddables = [];\n\n for (const url of embbeddableUrls) {\n const prevEmbeddable = embeddables[embeddables.length - 1];\n const embeddable = this.insertEmbeddableElement({\n sceneX: prevEmbeddable ? prevEmbeddable.x + prevEmbeddable.width + 20 : sceneX,\n sceneY,\n link: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.normalizeLink)(url)\n });\n\n if (embeddable) {\n embeddables.push(embeddable);\n }\n }\n\n if (embeddables.length) {\n this.store.scheduleCapture();\n this.setState({\n selectedElementIds: Object.fromEntries(embeddables.map(embeddable => [embeddable.id, true]))\n });\n }\n\n return;\n } // ------------------- Text -------------------\n\n\n this.addTextFromPaste(data.text, isPlainPaste);\n } // TODO rewrite this to paste both text & images at the same time if\n // pasted data contains both\n\n\n async addElementsFromMixedContentPaste(mixedContent, {\n isPlainPaste,\n sceneX,\n sceneY\n }) {\n if (!isPlainPaste && mixedContent.some(node => node.type === \"imageUrl\") && this.isToolSupported(\"image\")) {\n const imageURLs = mixedContent.filter(node => node.type === \"imageUrl\").map(node => node.value);\n const responses = await Promise.all(imageURLs.map(async url => {\n try {\n return {\n file: await (0,_data_blob__WEBPACK_IMPORTED_MODULE_33__.ImageURLToFile)(url)\n };\n } catch (error) {\n let errorMessage = error.message;\n\n if (error.cause === \"FETCH_ERROR\") {\n errorMessage = (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"errors.failedToFetchImage\");\n } else if (error.cause === \"UNSUPPORTED\") {\n errorMessage = (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"errors.unsupportedFileType\");\n }\n\n return {\n errorMessage\n };\n }\n }));\n const imageFiles = responses.filter(response => !!response.file).map(response => response.file);\n await this.insertImages(imageFiles, sceneX, sceneY);\n const error = responses.find(response => !!response.errorMessage);\n\n if (error && error.errorMessage) {\n this.setState({\n errorMessage: error.errorMessage\n });\n }\n } else {\n const textNodes = mixedContent.filter(node => node.type === \"text\");\n\n if (textNodes.length) {\n this.addTextFromPaste(textNodes.map(node => node.value).join(\"\\n\\n\"), isPlainPaste);\n }\n }\n }\n\n addTextFromPaste(text, isPlainPaste = false) {\n const {\n x,\n y\n } = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)({\n clientX: this.lastViewportPosition.x,\n clientY: this.lastViewportPosition.y\n }, this.state);\n const textElementProps = {\n x,\n y,\n strokeColor: this.state.currentItemStrokeColor,\n backgroundColor: this.state.currentItemBackgroundColor,\n fillStyle: this.state.currentItemFillStyle,\n strokeWidth: this.state.currentItemStrokeWidth,\n strokeStyle: this.state.currentItemStrokeStyle,\n roundness: null,\n roughness: this.state.currentItemRoughness,\n opacity: this.state.currentItemOpacity,\n text,\n rawText: text,\n fontSize: (0,_actions_actionProperties__WEBPACK_IMPORTED_MODULE_72__.getFontSize)(this.state.currentItemFontSize, this.state.zoom.value),\n fontFamily: this.state.currentItemFontFamily,\n textAlign: _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.DEFAULT_TEXT_ALIGN,\n verticalAlign: _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.DEFAULT_VERTICAL_ALIGN,\n locked: false\n };\n const fontString = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getFontString)({\n fontSize: textElementProps.fontSize,\n fontFamily: textElementProps.fontFamily\n });\n const lineHeight = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getLineHeight)(textElementProps.fontFamily);\n const [x1,, x2] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getVisibleSceneBounds)(this.state); // long texts should not go beyond 800 pixels in width nor should it go below 200 px\n\n const maxTextWidth = Math.max(Math.min((x2 - x1) * 0.5, 800), 200);\n const LINE_GAP = 10;\n let currentY = y;\n const lines = isPlainPaste ? [text] : text.split(\"\\n\");\n const textElements = lines.reduce((acc, line, idx) => {\n var _a;\n\n const originalText = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.normalizeText)(line).trim();\n\n if (originalText.length) {\n const topLayerFrame = this.getTopLayerFrameAtSceneCoords({\n x,\n y: currentY\n });\n let metrics = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.measureText)(originalText, fontString, lineHeight);\n const isTextUnwrapped = metrics.width > maxTextWidth;\n const text = isTextUnwrapped ? (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.wrapText)(originalText, fontString, maxTextWidth) : originalText;\n metrics = isTextUnwrapped ? (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.measureText)(text, fontString, lineHeight) : metrics;\n const startX = x - metrics.width / 2;\n const startY = currentY - metrics.height / 2;\n const element = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newTextElement)(Object.assign(Object.assign({}, textElementProps), {\n x: startX,\n y: startY,\n text,\n rawText: originalText,\n //zsviczian\n originalText,\n lineHeight,\n autoResize: !isTextUnwrapped,\n frameId: topLayerFrame ? topLayerFrame.id : null\n }));\n acc.push(element);\n currentY += element.height + LINE_GAP;\n } else {\n const prevLine = (_a = lines[idx - 1]) === null || _a === void 0 ? void 0 : _a.trim(); // add paragraph only if previous line was not empty, IOW don't add\n // more than one empty line\n\n if (prevLine) {\n currentY += (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getLineHeightInPx)(textElementProps.fontSize, lineHeight) + LINE_GAP;\n }\n }\n\n return acc;\n }, []);\n\n if (textElements.length === 0) {\n return;\n }\n\n this.scene.insertElements(textElements);\n this.store.scheduleCapture();\n this.setState({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)(Object.fromEntries(textElements.map(el => [el.id, true])), this.state)\n });\n\n if (!isPlainPaste && textElements.length > 1 && PLAIN_PASTE_TOAST_SHOWN === false && this.editorInterface.formFactor !== \"phone\") {\n this.setToast({\n message: (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"toast.pasteAsSingleElement\", {\n shortcut: (0,_shortcut__WEBPACK_IMPORTED_MODULE_51__.getShortcutKey)(\"CtrlOrCmd+Shift+V\")\n }),\n duration: 5000\n });\n PLAIN_PASTE_TOAST_SHOWN = true;\n }\n }\n\n handleTextWysiwyg(element, {\n isExistingElement = false\n }) {\n const elementsMap = this.scene.getElementsMapIncludingDeleted();\n\n const updateElement = (nextOriginalText, isDeleted, rawText, //zsviczian\n link) => {\n this.scene.replaceAllElements([// Not sure why we include deleted elements as well hence using deleted elements map\n ...this.scene.getElementsIncludingDeleted().map(_element => {\n if (_element.id === element.id && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isTextElement)(_element)) {\n return (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newElementWith)(_element, Object.assign({\n originalText: nextOriginalText,\n rawText: rawText !== null && rawText !== void 0 ? rawText : nextOriginalText,\n //zsviczian\n link,\n isDeleted: isDeleted !== null && isDeleted !== void 0 ? isDeleted : _element.isDeleted\n }, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.refreshTextDimensions)(_element, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getContainerElement)(_element, elementsMap), elementsMap, nextOriginalText)));\n }\n\n return _element;\n })]);\n }; //zsviczian\n\n\n if (this.props.onBeforeTextEdit) {\n const text = this.props.onBeforeTextEdit(element, isExistingElement);\n\n if (text && text !== element.originalText) {\n this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted().map(_element => {\n if (_element.id === element.id && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isTextElement)(_element)) {\n //changing the value of element so this gets edited by textWysiwyg\n element = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newElementWith)(_element, Object.assign({\n originalText: text,\n rawText: text,\n isDeleted: false\n }, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.refreshTextDimensions)(_element, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getContainerElement)(_element, elementsMap), elementsMap, text)));\n return element;\n }\n\n return _element;\n })]);\n }\n }\n\n (0,_wysiwyg_textWysiwyg__WEBPACK_IMPORTED_MODULE_46__.textWysiwyg)({\n id: element.id,\n canvas: this.canvas,\n getViewportCoords: (x, y) => {\n const {\n x: viewportX,\n y: viewportY\n } = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.sceneCoordsToViewportCoords)({\n sceneX: x,\n sceneY: y\n }, this.state);\n return [viewportX - this.state.offsetLeft, viewportY - this.state.offsetTop];\n },\n onChange: (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(nextOriginalText => {\n updateElement(nextOriginalText, false);\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isNonDeletedElement)(element)) {\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.updateBoundElements)(element, this.scene);\n }\n }),\n onSubmit: (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(({\n viaKeyboard,\n nextOriginalText\n }) => {\n var _a;\n\n const isDeleted = !nextOriginalText.trim(); //zsviczian insert start\n\n const rawText = nextOriginalText; //should this be originalText??\n\n let link = undefined;\n\n if (this.props.onBeforeTextSubmit) {\n const _element = this.scene.getElementsIncludingDeleted().find(el => el.id === element.id && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isTextElement)(el));\n\n if (_element) {\n const dismensionsData = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.refreshTextDimensions)(_element, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getContainerElement)(_element, elementsMap), elementsMap, nextOriginalText);\n const {\n updatedNextOriginalText,\n nextLink\n } = this.props.onBeforeTextSubmit(element, (_a = dismensionsData === null || dismensionsData === void 0 ? void 0 : dismensionsData.text) !== null && _a !== void 0 ? _a : nextOriginalText, //should never be undefined\n nextOriginalText, isDeleted);\n nextOriginalText = updatedNextOriginalText !== null && updatedNextOriginalText !== void 0 ? updatedNextOriginalText : nextOriginalText;\n link = nextLink;\n }\n } //zsviczian insert end\n\n\n updateElement(nextOriginalText, isDeleted, rawText, link); //zsviczian (added rawText, link, text)\n // select the created text element only if submitting via keyboard\n // (when submitting via click it should act as signal to deselect)\n\n if (!isDeleted && viaKeyboard) {\n const elementIdToSelect = element.containerId ? element.containerId : element.id; // needed to ensure state is updated before \"finalize\" action\n // that's invoked on keyboard-submit as well\n // TODO either move this into finalize as well, or handle all state\n // updates in one place, skipping finalize action\n\n (0,react_dom__WEBPACK_IMPORTED_MODULE_3__.flushSync)(() => {\n this.setState(prevState => ({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)(Object.assign(Object.assign({}, prevState.selectedElementIds), {\n [elementIdToSelect]: true\n }), prevState)\n }));\n });\n }\n\n if (isDeleted) {\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.fixBindingsAfterDeletion)(this.scene.getNonDeletedElements(), [element]);\n }\n\n if (!isDeleted || isExistingElement) {\n this.store.scheduleCapture();\n }\n\n (0,react_dom__WEBPACK_IMPORTED_MODULE_3__.flushSync)(() => {\n this.setState({\n newElement: null,\n editingTextElement: null\n });\n });\n\n if (this.state.activeTool.locked) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursorForShape)(this.interactiveCanvas, this.state);\n }\n\n this.focusContainer();\n }),\n element,\n excalidrawContainer: this.excalidrawContainerRef.current,\n app: this,\n // when text is selected, it's hard (at least on iOS) to re-position the\n // caret (i.e. deselect). There's not much use for always selecting\n // the text on edit anyway (and users can select-all from contextmenu\n // if needed)\n autoSelect: !this.editorInterface.isTouchScreen\n }); // deselect all other elements when inserting text\n\n this.deselectElements(); // do an initial update to re-initialize element position since we were\n // modifying element's x/y for sake of editor (case: syncing to remote)\n\n updateElement(element.originalText, false);\n }\n\n deselectElements() {\n this.setState({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)({}, this.state),\n selectedGroupIds: {},\n editingGroupId: null,\n activeEmbeddable: null\n });\n }\n\n getTextElementAtPosition(x, y) {\n const element = this.getElementAtPosition(x, y, {\n includeBoundTextElement: true\n });\n\n if (element && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isTextElement)(element) && !element.isDeleted) {\n return element;\n }\n\n return null;\n } // NOTE: Hot path for hit testing, so avoid unnecessary computations\n\n\n getElementAtPosition(x, y, opts) {\n let allHitElements = [];\n\n if (opts && \"allHitElements\" in opts) {\n allHitElements = (opts === null || opts === void 0 ? void 0 : opts.allHitElements) || [];\n } else {\n allHitElements = this.getElementsAtPosition(x, y, {\n includeBoundTextElement: opts === null || opts === void 0 ? void 0 : opts.includeBoundTextElement,\n includeLockedElements: opts === null || opts === void 0 ? void 0 : opts.includeLockedElements\n });\n }\n\n if (allHitElements.length > 1) {\n if (opts === null || opts === void 0 ? void 0 : opts.preferSelected) {\n for (let index = allHitElements.length - 1; index > -1; index--) {\n if (this.state.selectedElementIds[allHitElements[index].id]) {\n return allHitElements[index];\n }\n }\n }\n\n const elementWithHighestZIndex = allHitElements[allHitElements.length - 1]; // If we're hitting element with highest z-index only on its bounding box\n // while also hitting other element figure, the latter should be considered.\n\n return (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.hitElementItself)({\n point: (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(x, y),\n element: elementWithHighestZIndex,\n // when overlapping, we would like to be more precise\n // this also avoids the need to update past tests\n threshold: this.getElementHitThreshold(elementWithHighestZIndex) / 2,\n elementsMap: this.scene.getNonDeletedElementsMap(),\n frameNameBound: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isFrameLikeElement)(elementWithHighestZIndex) ? this.frameNameBoundsCache.get(elementWithHighestZIndex) : null\n }) ? elementWithHighestZIndex : allHitElements[allHitElements.length - 2];\n }\n\n if (allHitElements.length === 1) {\n return allHitElements[0];\n }\n\n return null;\n } // NOTE: Hot path for hit testing, so avoid unnecessary computations\n\n\n getElementsAtPosition(x, y, opts) {\n const iframeLikes = [];\n const elementsMap = this.scene.getNonDeletedElementsMap();\n const elements = ((opts === null || opts === void 0 ? void 0 : opts.includeBoundTextElement) && (opts === null || opts === void 0 ? void 0 : opts.includeLockedElements) ? this.scene.getNonDeletedElements() : this.scene.getNonDeletedElements().filter(element => ((opts === null || opts === void 0 ? void 0 : opts.includeLockedElements) || !element.locked) && ((opts === null || opts === void 0 ? void 0 : opts.includeBoundTextElement) || !((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isTextElement)(element) && element.containerId)))).filter(el => this.hitElement(x, y, el)).filter(element => {\n // hitting a frame's element from outside the frame is not considered a hit\n const containingFrame = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getContainingFrame)(element, elementsMap);\n return containingFrame && this.state.frameRendering.enabled && this.state.frameRendering.clip ? (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isCursorInFrame)({\n x,\n y\n }, containingFrame, elementsMap) : true;\n }).filter(el => {\n // The parameter elements comes ordered from lower z-index to higher.\n // We want to preserve that order on the returned array.\n // Exception being embeddables which should be on top of everything else in\n // terms of hit testing.\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isIframeElement)(el)) {\n iframeLikes.push(el);\n return false;\n }\n\n return true;\n }).concat(iframeLikes);\n return elements;\n }\n\n getElementHitThreshold(element) {\n return Math.max(element.strokeWidth / 2 + 0.1, // NOTE: Here be dragons. Do not go under the 0.63 multiplier unless you're\n // willing to test extensively. The hit testing starts to become unreliable\n // due to FP imprecision under 0.63 in high zoom levels.\n 0.85 * (_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.DEFAULT_COLLISION_THRESHOLD / this.state.zoom.value));\n }\n\n hitElement(x, y, element, considerBoundingBox = true) {\n // if the element is selected, then hit test is done against its bounding box\n if (considerBoundingBox && this.state.selectedElementIds[element.id] && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.hasBoundingBox)([element], this.state, this.editorInterface)) {\n // if hitting the bounding box, return early\n // but if not, we should check for other cases as well (e.g. frame name)\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.hitElementBoundingBox)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(x, y), element, this.scene.getNonDeletedElementsMap(), this.getElementHitThreshold(element))) {\n return true;\n }\n } // take bound text element into consideration for hit collision as well\n\n\n const hitBoundTextOfElement = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.hitElementBoundText)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(x, y), element, this.scene.getNonDeletedElementsMap());\n\n if (hitBoundTextOfElement) {\n return true;\n }\n\n return (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.hitElementItself)({\n point: (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(x, y),\n element,\n threshold: this.getElementHitThreshold(element),\n elementsMap: this.scene.getNonDeletedElementsMap(),\n frameNameBound: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isFrameLikeElement)(element) ? this.frameNameBoundsCache.get(element) : null\n });\n }\n\n getTextBindableContainerAtPosition(x, y) {\n const elements = this.scene.getNonDeletedElements();\n const selectedElements = this.scene.getSelectedElements(this.state);\n\n if (selectedElements.length === 1) {\n return (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isTextBindableContainer)(selectedElements[0], false) ? selectedElements[0] : null;\n }\n\n let hitElement = null; // We need to do hit testing from front (end of the array) to back (beginning of the array)\n\n for (let index = elements.length - 1; index >= 0; --index) {\n if (elements[index].isDeleted) {\n continue;\n }\n\n const [x1, y1, x2, y2] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getElementAbsoluteCoords)(elements[index], this.scene.getNonDeletedElementsMap());\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isArrowElement)(elements[index]) && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.hitElementItself)({\n point: (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(x, y),\n element: elements[index],\n elementsMap: this.scene.getNonDeletedElementsMap(),\n threshold: this.getElementHitThreshold(elements[index])\n })) {\n hitElement = elements[index];\n break;\n } else if (x1 < x && x < x2 && y1 < y && y < y2) {\n hitElement = elements[index];\n break;\n }\n }\n\n return (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isTextBindableContainer)(hitElement, false) ? hitElement : null;\n }\n\n handleHoverSelectedLinearElement(linearElementEditor, scenePointerX, scenePointerY) {\n const elementsMap = this.scene.getNonDeletedElementsMap();\n const element = _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.getElement(linearElementEditor.elementId, elementsMap);\n\n if (!element) {\n return;\n }\n\n if (this.state.selectedLinearElement) {\n let hoverPointIndex = -1;\n let segmentMidPointHoveredCoords = null;\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.hitElementItself)({\n point: (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(scenePointerX, scenePointerY),\n element,\n elementsMap,\n threshold: this.getElementHitThreshold(element)\n })) {\n hoverPointIndex = _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.getPointIndexUnderCursor(element, elementsMap, this.state.zoom, scenePointerX, scenePointerY);\n segmentMidPointHoveredCoords = _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.getSegmentMidpointHitCoords(linearElementEditor, {\n x: scenePointerX,\n y: scenePointerY\n }, this.state, this.scene.getNonDeletedElementsMap());\n const isHoveringAPointHandle = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(element) ? hoverPointIndex === 0 || hoverPointIndex === element.points.length - 1 : hoverPointIndex >= 0;\n\n if (isHoveringAPointHandle || segmentMidPointHoveredCoords) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.POINTER);\n } else if (this.hitElement(scenePointerX, scenePointerY, element)) {\n if ( // Ebow arrows can only be moved when unconnected\n !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(element) || !(element.startBinding || element.endBinding)) {\n if (this.state.activeTool.type !== \"lasso\" || Object.keys(this.state.selectedElementIds).length > 0) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.MOVE);\n }\n }\n }\n } else if (this.hitElement(scenePointerX, scenePointerY, element)) {\n if ( // Ebow arrows can only be moved when unconnected\n !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(element) || !(element.startBinding || element.endBinding)) {\n if (this.state.activeTool.type !== \"lasso\" || Object.keys(this.state.selectedElementIds).length > 0) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.MOVE);\n }\n }\n }\n\n if (this.state.selectedLinearElement.hoverPointIndex !== hoverPointIndex) {\n this.setState({\n selectedLinearElement: Object.assign(Object.assign({}, this.state.selectedLinearElement), {\n hoverPointIndex\n })\n });\n }\n\n if (!_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.arePointsEqual(this.state.selectedLinearElement.segmentMidPointHoveredCoords, segmentMidPointHoveredCoords)) {\n this.setState({\n selectedLinearElement: Object.assign(Object.assign({}, this.state.selectedLinearElement), {\n segmentMidPointHoveredCoords\n })\n });\n }\n } else {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.AUTO);\n }\n } //mfuria #329. start right-click panning\n\n\n startRightClickPanning(event) {\n // Set up right-click panning similar to hand tool\n isPanning = true;\n this.focusContainer();\n\n if (!this.state.editingTextElement) {\n event.preventDefault();\n }\n\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.GRABBING);\n let {\n clientX: lastX,\n clientY: lastY\n } = event;\n const onPointerMove = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdatesThrottled)(event => {\n const deltaX = lastX - event.clientX;\n const deltaY = lastY - event.clientY;\n lastX = event.clientX;\n lastY = event.clientY;\n this.translateCanvas({\n scrollX: this.state.scrollX - deltaX / this.state.zoom.value,\n scrollY: this.state.scrollY - deltaY / this.state.zoom.value\n });\n });\n const teardown = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(() => {\n isPanning = false;\n\n if (this.state.viewModeEnabled) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.GRAB);\n } else {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursorForShape)(this.interactiveCanvas, this.state);\n }\n\n this.setState({\n cursorButton: \"up\"\n });\n this.savePointer(event.clientX, event.clientY, \"up\");\n window.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_MOVE, onPointerMove);\n window.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_UP, teardown);\n window.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.BLUR, teardown);\n onPointerMove.flush();\n });\n window.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.BLUR, teardown);\n window.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_MOVE, onPointerMove, {\n passive: true\n });\n window.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_UP, teardown);\n }\n\n updateGestureOnPointerDown(event) {\n gesture.pointers.set(event.pointerId, {\n x: event.clientX,\n y: event.clientY\n });\n\n if (gesture.pointers.size === 2) {\n if ((0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_70__.shouldDisableZoom)(this.state)) {\n //zsviczian\n gesture.initialDistance = null;\n } else {\n gesture.lastCenter = (0,_gesture__WEBPACK_IMPORTED_MODULE_28__.getCenter)(gesture.pointers);\n gesture.initialScale = this.state.zoom.value;\n gesture.initialDistance = (0,_gesture__WEBPACK_IMPORTED_MODULE_28__.getDistance)(Array.from(gesture.pointers.values()));\n }\n }\n }\n\n initialPointerDownState(event) {\n const origin = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)(event, this.state);\n const selectedElements = this.scene.getSelectedElements(this.state);\n const [minX, minY, maxX, maxY] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getCommonBounds)(selectedElements);\n const isElbowArrowOnly = selectedElements.findIndex(_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow) === 0;\n return {\n origin,\n withCmdOrCtrl: event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD],\n originInGrid: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.tupleToCoors)((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(origin.x, origin.y, event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] || isElbowArrowOnly ? null : this.getEffectiveGridSize())),\n scrollbars: (0,_scene_scrollbars__WEBPACK_IMPORTED_MODULE_47__.isOverScrollBars)(currentScrollBars, event.clientX - this.state.offsetLeft, event.clientY - this.state.offsetTop),\n // we need to duplicate because we'll be updating this state\n lastCoords: Object.assign({}, origin),\n originalElements: this.scene.getNonDeletedElements().reduce((acc, element) => {\n acc.set(element.id, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.deepCopyElement)(element));\n return acc;\n }, new Map()),\n resize: {\n handleType: false,\n isResizing: false,\n offset: {\n x: 0,\n y: 0\n },\n arrowDirection: \"origin\",\n center: {\n x: (maxX + minX) / 2,\n y: (maxY + minY) / 2\n }\n },\n hit: {\n element: null,\n allHitElements: [],\n wasAddedToSelection: false,\n hasBeenDuplicated: false,\n hasHitCommonBoundingBoxOfSelectedElements: this.isHittingCommonBoundingBoxOfSelectedElements(origin, selectedElements)\n },\n drag: {\n hasOccurred: false,\n offset: null,\n origin: Object.assign({}, origin),\n blockDragging: false\n },\n eventListeners: {\n onMove: null,\n onUp: null,\n onKeyUp: null,\n onKeyDown: null\n },\n boxSelection: {\n hasOccurred: false\n }\n };\n } // Returns whether the event is a dragging a scrollbar\n\n\n handleDraggingScrollBar(event, pointerDownState) {\n if (!(pointerDownState.scrollbars.isOverEither && !this.state.multiElement)) {\n return false;\n }\n\n isDraggingScrollBar = true;\n pointerDownState.lastCoords.x = event.clientX;\n pointerDownState.lastCoords.y = event.clientY;\n const onPointerMove = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdatesThrottled)(event => {\n const target = event.target;\n\n if (!(target instanceof HTMLElement)) {\n return;\n }\n\n this.handlePointerMoveOverScrollbars(event, pointerDownState);\n });\n const onPointerUp = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(() => {\n lastPointerUp = null;\n isDraggingScrollBar = false;\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursorForShape)(this.interactiveCanvas, this.state);\n this.setState({\n cursorButton: \"up\"\n });\n this.savePointer(event.clientX, event.clientY, \"up\");\n window.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_MOVE, onPointerMove);\n window.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_UP, onPointerUp);\n onPointerMove.flush();\n });\n lastPointerUp = onPointerUp;\n window.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_MOVE, onPointerMove);\n window.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_UP, onPointerUp);\n return true;\n }\n\n isASelectedElement(hitElement) {\n return hitElement != null && this.state.selectedElementIds[hitElement.id];\n }\n\n isHittingCommonBoundingBoxOfSelectedElements(point, selectedElements) {\n if (selectedElements.length < 2) {\n return false;\n } // How many pixels off the shape boundary we still consider a hit\n\n\n const threshold = Math.max(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.DEFAULT_COLLISION_THRESHOLD / this.state.zoom.value, 1);\n const [x1, y1, x2, y2] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getCommonBounds)(selectedElements);\n return point.x > x1 - threshold && point.x < x2 + threshold && point.y > y1 - threshold && point.y < y2 + threshold;\n }\n\n getCurrentItemRoundness(elementType) {\n return this.state.currentItemRoundness === \"round\" ? {\n type: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isUsingAdaptiveRadius)(elementType) ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.ROUNDNESS.ADAPTIVE_RADIUS : _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.ROUNDNESS.PROPORTIONAL_RADIUS\n } : null;\n }\n\n maybeCacheReferenceSnapPoints(event, selectedElements, recomputeAnyways = false) {\n if ((0,_snapping__WEBPACK_IMPORTED_MODULE_39__.isSnappingEnabled)({\n event,\n app: this,\n selectedElements\n }) && (recomputeAnyways || !_snapping__WEBPACK_IMPORTED_MODULE_39__.SnapCache.getReferenceSnapPoints())) {\n _snapping__WEBPACK_IMPORTED_MODULE_39__.SnapCache.setReferenceSnapPoints((0,_snapping__WEBPACK_IMPORTED_MODULE_39__.getReferenceSnapPoints)(this.scene.getNonDeletedElements(), selectedElements, this.state, this.scene.getNonDeletedElementsMap()));\n }\n }\n\n maybeCacheVisibleGaps(event, selectedElements, recomputeAnyways = false) {\n if ((0,_snapping__WEBPACK_IMPORTED_MODULE_39__.isSnappingEnabled)({\n event,\n app: this,\n selectedElements\n }) && (recomputeAnyways || !_snapping__WEBPACK_IMPORTED_MODULE_39__.SnapCache.getVisibleGaps())) {\n _snapping__WEBPACK_IMPORTED_MODULE_39__.SnapCache.setVisibleGaps((0,_snapping__WEBPACK_IMPORTED_MODULE_39__.getVisibleGaps)(this.scene.getNonDeletedElements(), selectedElements, this.state, this.scene.getNonDeletedElementsMap()));\n }\n }\n\n onKeyDownFromPointerDownHandler(pointerDownState) {\n return (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(event => {\n if (this.maybeHandleResize(pointerDownState, event)) {\n return;\n }\n\n this.maybeDragNewGenericElement(pointerDownState, event);\n });\n }\n\n onKeyUpFromPointerDownHandler(pointerDownState) {\n return (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(event => {\n // Prevents focus from escaping excalidraw tab\n event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.ALT && event.preventDefault();\n\n if (this.maybeHandleResize(pointerDownState, event)) {\n return;\n }\n\n this.maybeDragNewGenericElement(pointerDownState, event);\n });\n }\n\n onPointerMoveFromPointerDownHandler(pointerDownState) {\n return (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdatesThrottled)(event => {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j; //To avoid pointerMove canceling the selection of locked elements on mobile //zsviczian\n\n\n if (Boolean(this.state.contextMenu) || ((_a = this.state.openDialog) === null || _a === void 0 ? void 0 : _a.name) === \"elementLinkSelector\") {\n return;\n }\n\n const pointerCoords = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)(event, this.state);\n\n if (this.state.activeLockedId) {\n this.setState({\n activeLockedId: null\n });\n }\n\n if (this.state.selectedLinearElement && this.state.selectedLinearElement.elbowed && this.state.selectedLinearElement.pointerDownState.segmentMidpoint.index) {\n const [gridX, gridY] = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(pointerCoords.x, pointerCoords.y, event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] ? null : this.getEffectiveGridSize());\n let index = this.state.selectedLinearElement.pointerDownState.segmentMidpoint.index;\n\n if (index < 0) {\n const nextCoords = _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.getSegmentMidpointHitCoords(Object.assign(Object.assign({}, this.state.selectedLinearElement), {\n segmentMidPointHoveredCoords: null\n }), {\n x: gridX,\n y: gridY\n }, this.state, this.scene.getNonDeletedElementsMap());\n index = nextCoords ? _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.getSegmentMidPointIndex(this.state.selectedLinearElement, this.state, nextCoords, this.scene.getNonDeletedElementsMap()) : -1;\n }\n\n const ret = _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.moveFixedSegment(this.state.selectedLinearElement, index, gridX, gridY, this.scene);\n this.setState({\n selectedLinearElement: Object.assign(Object.assign({}, this.state.selectedLinearElement), {\n segmentMidPointHoveredCoords: ret.segmentMidPointHoveredCoords,\n pointerDownState: ret.pointerDownState\n })\n });\n return;\n }\n\n const lastPointerCoords = (_b = this.lastPointerMoveCoords) !== null && _b !== void 0 ? _b : pointerDownState.origin;\n this.lastPointerMoveCoords = pointerCoords; // We need to initialize dragOffsetXY only after we've updated\n // `state.selectedElementIds` on pointerDown. Doing it here in pointerMove\n // event handler should hopefully ensure we're already working with\n // the updated state.\n\n if (pointerDownState.drag.offset === null) {\n pointerDownState.drag.offset = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.tupleToCoors)((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getDragOffsetXY)(this.scene.getSelectedElements(this.state), pointerDownState.origin.x, pointerDownState.origin.y));\n }\n\n const target = event.target;\n\n if (!(target instanceof HTMLElement)) {\n return;\n }\n\n if (this.handlePointerMoveOverScrollbars(event, pointerDownState)) {\n return;\n }\n\n if ((0,_appState__WEBPACK_IMPORTED_MODULE_23__.isEraserActive)(this.state)) {\n this.handleEraser(event, pointerCoords);\n return;\n }\n\n if (this.state.activeTool.type === \"laser\") {\n this.laserTrails.addPointToPath(pointerCoords.x, pointerCoords.y);\n }\n\n const [gridX, gridY] = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(pointerCoords.x, pointerCoords.y, event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()); // for arrows/lines, don't start dragging until a given threshold\n // to ensure we don't create a 2-point arrow by mistake when\n // user clicks mouse in a way that it moves a tiny bit (thus\n // triggering pointermove)\n\n if (!pointerDownState.drag.hasOccurred && (this.state.activeTool.type === \"arrow\" || this.state.activeTool.type === \"line\")) {\n if ((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointDistance)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(pointerCoords.x, pointerCoords.y), (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(pointerDownState.origin.x, pointerDownState.origin.y)) * this.state.zoom.value < _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.MINIMUM_ARROW_SIZE) {\n return;\n }\n }\n\n if (pointerDownState.resize.isResizing) {\n pointerDownState.lastCoords.x = pointerCoords.x;\n pointerDownState.lastCoords.y = pointerCoords.y;\n\n if (this.maybeHandleCrop(pointerDownState, event)) {\n return true;\n }\n\n if (this.maybeHandleResize(pointerDownState, event)) {\n return true;\n }\n }\n\n const elementsMap = this.scene.getNonDeletedElementsMap();\n\n if (this.state.selectedLinearElement) {\n const linearElementEditor = this.state.selectedLinearElement;\n\n if (_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.shouldAddMidpoint(this.state.selectedLinearElement, pointerCoords, this.state, elementsMap)) {\n const ret = _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.addMidpoint(this.state.selectedLinearElement, pointerCoords, this, !event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD], this.scene);\n\n if (!ret) {\n return;\n } // Since we are reading from previous state which is not possible with\n // automatic batching in React 18 hence using flush sync to synchronously\n // update the state. Check https://github.com/excalidraw/excalidraw/pull/5508 for more details.\n\n\n (0,react_dom__WEBPACK_IMPORTED_MODULE_3__.flushSync)(() => {\n if (this.state.selectedLinearElement) {\n this.setState({\n selectedLinearElement: Object.assign(Object.assign({}, this.state.selectedLinearElement), {\n pointerDownState: ret.pointerDownState,\n selectedPointsIndices: ret.selectedPointsIndices,\n segmentMidPointHoveredCoords: null\n })\n });\n }\n });\n return;\n } else if (linearElementEditor.pointerDownState.segmentMidpoint.value !== null && !linearElementEditor.pointerDownState.segmentMidpoint.added) {\n return;\n }\n\n const newState = _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.handlePointDragging(event, this, pointerCoords.x, pointerCoords.y, linearElementEditor);\n\n if (newState) {\n pointerDownState.lastCoords.x = pointerCoords.x;\n pointerDownState.lastCoords.y = pointerCoords.y;\n pointerDownState.drag.hasOccurred = true;\n this.setState(newState);\n return;\n }\n }\n\n const hasHitASelectedElement = pointerDownState.hit.allHitElements.some(element => this.isASelectedElement(element));\n const isSelectingPointsInLineEditor = ((_c = this.state.selectedLinearElement) === null || _c === void 0 ? void 0 : _c.isEditing) && event.shiftKey && this.state.selectedLinearElement.elementId === ((_d = pointerDownState.hit.element) === null || _d === void 0 ? void 0 : _d.id);\n\n if ((hasHitASelectedElement || pointerDownState.hit.hasHitCommonBoundingBoxOfSelectedElements) && !isSelectingPointsInLineEditor && !pointerDownState.drag.blockDragging) {\n const selectedElements = this.scene.getSelectedElements(this.state);\n\n if (selectedElements.length > 0 && selectedElements.every(element => element.locked)) {\n return;\n }\n\n const selectedElementsHasAFrame = selectedElements.find(e => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isFrameLikeElement)(e));\n const topLayerFrame = this.getTopLayerFrameAtSceneCoords(pointerCoords);\n const frameToHighlight = topLayerFrame && !selectedElementsHasAFrame ? topLayerFrame : null; // Only update the state if there is a difference\n\n if (this.state.frameToHighlight !== frameToHighlight) {\n (0,react_dom__WEBPACK_IMPORTED_MODULE_3__.flushSync)(() => {\n this.setState({\n frameToHighlight\n });\n });\n } // Marking that click was used for dragging to check\n // if elements should be deselected on pointerup\n\n\n pointerDownState.drag.hasOccurred = true; // prevent immediate dragging during lasso selection to avoid element displacement\n // only allow dragging if we're not in the middle of lasso selection\n // (on mobile, allow dragging if we hit an element)\n\n if (this.state.activeTool.type === \"lasso\" && this.lassoTrail.hasCurrentTrail && !(this.editorInterface.formFactor !== \"desktop\" && pointerDownState.hit.element) && !this.state.activeTool.fromSelection) {\n return;\n } // Clear lasso trail when starting to drag selected elements with lasso tool\n // Only clear if we're actually dragging (not during lasso selection)\n\n\n if (this.state.activeTool.type === \"lasso\" && selectedElements.length > 0 && pointerDownState.drag.hasOccurred && !this.state.activeTool.fromSelection) {\n this.lassoTrail.endPath();\n } // prevent dragging even if we're no longer holding cmd/ctrl otherwise\n // it would have weird results (stuff jumping all over the screen)\n // Checking for editingTextElement to avoid jump while editing on mobile #6503\n\n\n if (selectedElements.length > 0 && !pointerDownState.withCmdOrCtrl && !this.state.editingTextElement && ((_e = this.state.activeEmbeddable) === null || _e === void 0 ? void 0 : _e.state) !== \"active\") {\n const dragOffset = {\n x: pointerCoords.x - pointerDownState.drag.origin.x,\n y: pointerCoords.y - pointerDownState.drag.origin.y\n };\n const originalElements = [...pointerDownState.originalElements.values()]; // We only drag in one direction if shift is pressed\n\n const lockDirection = event.shiftKey;\n\n if (lockDirection) {\n const distanceX = Math.abs(dragOffset.x);\n const distanceY = Math.abs(dragOffset.y);\n const lockX = lockDirection && distanceX < distanceY;\n const lockY = lockDirection && distanceX > distanceY;\n\n if (lockX) {\n dragOffset.x = 0;\n }\n\n if (lockY) {\n dragOffset.y = 0;\n }\n } // #region move crop region\n\n\n if (this.state.croppingElementId) {\n const croppingElement = this.scene.getNonDeletedElementsMap().get(this.state.croppingElementId);\n\n if (croppingElement && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isImageElement)(croppingElement) && croppingElement.crop !== null && pointerDownState.hit.element === croppingElement) {\n const crop = croppingElement.crop;\n const image = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isInitializedImageElement)(croppingElement) && ((_f = this.imageCache.get(croppingElement.fileId)) === null || _f === void 0 ? void 0 : _f.image);\n\n if (image && !(image instanceof Promise)) {\n const instantDragOffset = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.vectorScale)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.vector)(pointerCoords.x - lastPointerCoords.x, pointerCoords.y - lastPointerCoords.y), Math.max(this.state.zoom.value, 2));\n const [x1, y1, x2, y2, cx, cy] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getElementAbsoluteCoords)(croppingElement, elementsMap);\n const topLeft = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.vectorFromPoint)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointRotateRads)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(x1, y1), (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(cx, cy), croppingElement.angle));\n const topRight = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.vectorFromPoint)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointRotateRads)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(x2, y1), (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(cx, cy), croppingElement.angle));\n const bottomLeft = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.vectorFromPoint)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointRotateRads)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(x1, y2), (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(cx, cy), croppingElement.angle));\n const topEdge = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.vectorNormalize)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.vectorSubtract)(topRight, topLeft));\n const leftEdge = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.vectorNormalize)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.vectorSubtract)(bottomLeft, topLeft)); // project instantDrafOffset onto leftEdge and topEdge to decompose\n\n const offsetVector = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.vector)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.vectorDot)(instantDragOffset, topEdge), (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.vectorDot)(instantDragOffset, leftEdge));\n const nextCrop = Object.assign(Object.assign({}, crop), {\n x: (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.clamp)(crop.x - offsetVector[0] * Math.sign(croppingElement.scale[0]), 0, image.naturalWidth - crop.width),\n y: (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.clamp)(crop.y - offsetVector[1] * Math.sign(croppingElement.scale[1]), 0, image.naturalHeight - crop.height)\n });\n this.scene.mutateElement(croppingElement, {\n crop: nextCrop\n });\n return;\n }\n }\n } // Snap cache *must* be synchronously popuplated before initial drag,\n // otherwise the first drag even will not snap, causing a jump before\n // it snaps to its position if previously snapped already.\n\n\n this.maybeCacheVisibleGaps(event, selectedElements);\n this.maybeCacheReferenceSnapPoints(event, selectedElements);\n const {\n snapOffset,\n snapLines\n } = (0,_snapping__WEBPACK_IMPORTED_MODULE_39__.snapDraggedElements)(originalElements, dragOffset, this, event, this.scene.getNonDeletedElementsMap());\n this.setState({\n snapLines\n }); // when we're editing the name of a frame, we want the user to be\n // able to select and interact with the text input\n\n if (!this.state.editingFrame) {\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.dragSelectedElements)(pointerDownState, selectedElements, dragOffset, this.scene, snapOffset, event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] ? null : this.getEffectiveGridSize());\n }\n\n this.setState({\n selectedElementsAreBeingDragged: true,\n // element is being dragged and selectionElement that was created on pointer down\n // should be removed\n selectionElement: null\n });\n\n if (selectedElements.length !== 1 || !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(selectedElements[0])) {\n this.setState({\n suggestedBindings: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getSuggestedBindingsForArrows)(selectedElements, this.scene.getNonDeletedElementsMap(), this.state.zoom)\n });\n } // We duplicate the selected element if alt is pressed on pointer move\n\n\n if (event.altKey && !pointerDownState.hit.hasBeenDuplicated) {\n // Move the currently selected elements to the top of the z index stack, and\n // put the duplicates where the selected elements used to be.\n // (the origin point where the dragging started)\n pointerDownState.hit.hasBeenDuplicated = true;\n const elements = this.scene.getElementsIncludingDeleted();\n const hitElement = pointerDownState.hit.element;\n const selectedElements = this.scene.getSelectedElements({\n selectedElementIds: this.state.selectedElementIds,\n includeBoundTextElement: true,\n includeElementsInFrames: true\n });\n\n if (hitElement && // hit element may not end up being selected\n // if we're alt-dragging a common bounding box\n // over the hit element\n pointerDownState.hit.wasAddedToSelection && !selectedElements.find(el => el.id === hitElement.id)) {\n selectedElements.push(hitElement);\n }\n\n const idsOfElementsToDuplicate = new Map(selectedElements.map(el => [el.id, el]));\n const {\n duplicatedElements,\n duplicateElementsMap,\n elementsWithDuplicates,\n origIdToDuplicateId\n } = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.duplicateElements)({\n type: \"in-place\",\n elements,\n appState: this.state,\n randomizeSeed: true,\n idsOfElementsToDuplicate,\n overrides: ({\n duplicateElement,\n origElement\n }) => {\n var _a;\n\n return {\n // reset to the original element's frameId (unless we've\n // duplicated alongside a frame in which case we need to\n // keep the duplicate frame's id) so that the element\n // frame membership is refreshed on pointerup\n // NOTE this is a hacky solution and should be done\n // differently\n frameId: (_a = duplicateElement.frameId) !== null && _a !== void 0 ? _a : origElement.frameId,\n seed: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.randomInteger)()\n };\n }\n });\n duplicatedElements.forEach(element => {\n pointerDownState.originalElements.set(element.id, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.deepCopyElement)(element));\n });\n const mappedClonedElements = elementsWithDuplicates.map(el => {\n if (idsOfElementsToDuplicate.has(el.id)) {\n const origEl = pointerDownState.originalElements.get(el.id);\n\n if (origEl) {\n return (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newElementWith)(el, {\n x: origEl.x,\n y: origEl.y\n });\n }\n }\n\n return el;\n });\n const mappedNewSceneElements = (_h = (_g = this.props).onDuplicate) === null || _h === void 0 ? void 0 : _h.call(_g, mappedClonedElements, elements);\n const elementsWithIndices = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.syncMovedIndices)(mappedNewSceneElements || mappedClonedElements, (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.arrayToMap)(duplicatedElements)); // we need to update synchronously so as to keep pointerDownState,\n // appState, and scene elements in sync\n\n (0,react_dom__WEBPACK_IMPORTED_MODULE_3__.flushSync)(() => {\n // swap hit element with the duplicated one\n if (pointerDownState.hit.element) {\n const cloneId = origIdToDuplicateId.get(pointerDownState.hit.element.id);\n const clonedElement = cloneId && duplicateElementsMap.get(cloneId);\n pointerDownState.hit.element = clonedElement || null;\n } // swap hit elements with the duplicated ones\n\n\n pointerDownState.hit.allHitElements = pointerDownState.hit.allHitElements.reduce((acc, origHitElement) => {\n const cloneId = origIdToDuplicateId.get(origHitElement.id);\n const clonedElement = cloneId && duplicateElementsMap.get(cloneId);\n\n if (clonedElement) {\n acc.push(clonedElement);\n }\n\n return acc;\n }, []); // update drag origin to the position at which we started\n // the duplication so that the drag offset is correct\n\n pointerDownState.drag.origin = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)(event, this.state); // switch selected elements to the duplicated ones\n\n this.setState(prevState => Object.assign({}, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getSelectionStateForElements)(duplicatedElements, this.scene.getNonDeletedElements(), prevState)));\n this.scene.replaceAllElements(elementsWithIndices);\n this.maybeCacheVisibleGaps(event, selectedElements, true);\n this.maybeCacheReferenceSnapPoints(event, selectedElements, true);\n });\n }\n\n return;\n }\n }\n\n if (this.state.selectionElement) {\n pointerDownState.lastCoords.x = pointerCoords.x;\n pointerDownState.lastCoords.y = pointerCoords.y;\n\n if (event.altKey) {\n this.setActiveTool({\n type: \"lasso\",\n fromSelection: true\n }, event.shiftKey);\n this.lassoTrail.startPath(pointerDownState.origin.x, pointerDownState.origin.y, event.shiftKey);\n this.setAppState({\n selectionElement: null\n });\n return;\n }\n\n this.maybeDragNewGenericElement(pointerDownState, event);\n } else if (this.state.activeTool.type === \"lasso\") {\n if (!event.altKey && this.state.activeTool.fromSelection) {\n this.setActiveTool({\n type: \"selection\"\n });\n this.createGenericElementOnPointerDown(\"selection\", pointerDownState);\n pointerDownState.lastCoords.x = pointerCoords.x;\n pointerDownState.lastCoords.y = pointerCoords.y;\n this.maybeDragNewGenericElement(pointerDownState, event);\n this.lassoTrail.endPath();\n } else {\n this.lassoTrail.addPointToPath(pointerCoords.x, pointerCoords.y, event.shiftKey);\n }\n } else {\n // It is very important to read this.state within each move event,\n // otherwise we would read a stale one!\n const newElement = this.state.newElement;\n\n if (!newElement) {\n return;\n }\n\n if (newElement.type === \"freedraw\") {\n const points = newElement.points;\n const dx = pointerCoords.x - newElement.x;\n const dy = pointerCoords.y - newElement.y;\n const lastPoint = points.length > 0 && points[points.length - 1];\n const discardPoint = lastPoint && lastPoint[0] === dx && lastPoint[1] === dy;\n\n if (!discardPoint) {\n const strokeOptions = this.state.currentStrokeOptions; //zsviczian\n\n const pressures = newElement.simulatePressure ? newElement.pressures : [//zsviczian\n ...newElement.pressures, (strokeOptions === null || strokeOptions === void 0 ? void 0 : strokeOptions.constantPressure) ? 1 : event.pressure];\n this.scene.mutateElement(newElement, {\n points: [...points, (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(dx, dy)],\n pressures\n }, {\n informMutation: false,\n isDragging: false\n });\n this.setState({\n newElement\n });\n }\n } else if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLinearElement)(newElement)) {\n pointerDownState.drag.hasOccurred = true;\n const points = newElement.points;\n let dx = gridX - newElement.x;\n let dy = gridY - newElement.y;\n\n if ((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.shouldRotateWithDiscreteAngle)(event) && points.length === 2) {\n ({\n width: dx,\n height: dy\n } = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getLockedLinearCursorAlignSize)(newElement.x, newElement.y, pointerCoords.x, pointerCoords.y));\n }\n\n if (points.length === 1) {\n this.scene.mutateElement(newElement, {\n points: [...points, (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(dx, dy)]\n }, {\n informMutation: false,\n isDragging: false\n });\n } else if (points.length === 2 || points.length > 1 && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(newElement)) {\n this.scene.mutateElement(newElement, {\n points: [...points.slice(0, -1), (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(dx, dy)]\n }, {\n isDragging: true,\n informMutation: false\n });\n }\n\n this.setState({\n newElement\n });\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isBindingElement)(newElement, false)) {\n // When creating a linear element by dragging\n this.setState({\n suggestedBindings: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.maybeSuggestBindingsForLinearElementAtCoords)(newElement, [pointerCoords], this.scene, this.state.zoom, this.state.startBoundElement)\n });\n }\n } else {\n pointerDownState.lastCoords.x = pointerCoords.x;\n pointerDownState.lastCoords.y = pointerCoords.y;\n this.maybeDragNewGenericElement(pointerDownState, event, false);\n }\n }\n\n if (this.state.activeTool.type === \"selection\") {\n pointerDownState.boxSelection.hasOccurred = true;\n const elements = this.scene.getNonDeletedElements(); // box-select line editor points\n\n if ((_j = this.state.selectedLinearElement) === null || _j === void 0 ? void 0 : _j.isEditing) {\n _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.handleBoxSelection(event, this.state, this.setState.bind(this), this.scene.getNonDeletedElementsMap()); // regular box-select\n } else {\n let shouldReuseSelection = true;\n\n if (!event.shiftKey && (0,_scene__WEBPACK_IMPORTED_MODULE_31__.isSomeElementSelected)(elements, this.state)) {\n if (pointerDownState.withCmdOrCtrl && pointerDownState.hit.element) {\n this.setState(prevState => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.selectGroupsForSelectedElements)(Object.assign(Object.assign({}, prevState), {\n selectedElementIds: {\n [pointerDownState.hit.element.id]: true\n }\n }), this.scene.getNonDeletedElements(), prevState, this));\n } else {\n shouldReuseSelection = false;\n }\n }\n\n const elementsWithinSelection = this.state.selectionElement ? (0,_scene__WEBPACK_IMPORTED_MODULE_31__.getElementsWithinSelection)(elements, this.state.selectionElement, this.scene.getNonDeletedElementsMap(), false) : [];\n this.setState(prevState => {\n const nextSelectedElementIds = Object.assign(Object.assign({}, shouldReuseSelection && prevState.selectedElementIds), elementsWithinSelection.reduce((acc, element) => {\n acc[element.id] = true;\n return acc;\n }, {}));\n\n if (pointerDownState.hit.element) {\n // if using ctrl/cmd, select the hitElement only if we\n // haven't box-selected anything else\n if (!elementsWithinSelection.length) {\n nextSelectedElementIds[pointerDownState.hit.element.id] = true;\n } else {\n delete nextSelectedElementIds[pointerDownState.hit.element.id];\n }\n }\n\n prevState = !shouldReuseSelection ? Object.assign(Object.assign({}, prevState), {\n selectedGroupIds: {},\n editingGroupId: null\n }) : prevState;\n return Object.assign(Object.assign({}, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.selectGroupsForSelectedElements)({\n editingGroupId: prevState.editingGroupId,\n selectedElementIds: nextSelectedElementIds\n }, this.scene.getNonDeletedElements(), prevState, this)), {\n // select linear element only when we haven't box-selected anything else\n selectedLinearElement: elementsWithinSelection.length === 1 && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLinearElement)(elementsWithinSelection[0]) ? new _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor(elementsWithinSelection[0], this.scene.getNonDeletedElementsMap()) : null,\n showHyperlinkPopup: elementsWithinSelection.length === 1 && (elementsWithinSelection[0].link || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isEmbeddableElement)(elementsWithinSelection[0])) ? \"info\" : false\n });\n });\n }\n }\n });\n } // Returns whether the pointer move happened over either scrollbar\n\n\n handlePointerMoveOverScrollbars(event, pointerDownState) {\n var _a, _b;\n\n if (pointerDownState.scrollbars.isOverHorizontal) {\n const x = event.clientX;\n const dx = x - pointerDownState.lastCoords.x;\n this.translateCanvas({\n scrollX: this.state.scrollX - dx * (((_a = currentScrollBars.horizontal) === null || _a === void 0 ? void 0 : _a.deltaMultiplier) || 1) / this.state.zoom.value\n });\n pointerDownState.lastCoords.x = x;\n return true;\n }\n\n if (pointerDownState.scrollbars.isOverVertical) {\n const y = event.clientY;\n const dy = y - pointerDownState.lastCoords.y;\n this.translateCanvas({\n scrollY: this.state.scrollY - dy * (((_b = currentScrollBars.vertical) === null || _b === void 0 ? void 0 : _b.deltaMultiplier) || 1) / this.state.zoom.value\n });\n pointerDownState.lastCoords.y = y;\n return true;\n }\n\n return false;\n }\n\n onPointerUpFromPointerDownHandler(pointerDownState) {\n return (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(childEvent => {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;\n\n this.removePointer(childEvent);\n pointerDownState.drag.blockDragging = false;\n\n if (pointerDownState.eventListeners.onMove) {\n pointerDownState.eventListeners.onMove.flush();\n }\n\n const {\n newElement,\n resizingElement,\n croppingElementId,\n multiElement,\n activeTool,\n isResizing,\n isRotating,\n isCropping\n } = this.state;\n this.setState(prevState => ({\n isResizing: false,\n isRotating: false,\n isCropping: false,\n resizingElement: null,\n selectionElement: null,\n frameToHighlight: null,\n elementsToHighlight: null,\n cursorButton: \"up\",\n snapLines: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateStable)(prevState.snapLines, []),\n originSnapOffset: null\n })); // just in case, tool changes mid drag, always clean up\n\n this.lassoTrail.endPath();\n this.lastPointerMoveCoords = null;\n _snapping__WEBPACK_IMPORTED_MODULE_39__.SnapCache.setReferenceSnapPoints(null);\n _snapping__WEBPACK_IMPORTED_MODULE_39__.SnapCache.setVisibleGaps(null);\n this.savePointer(childEvent.clientX, childEvent.clientY, \"up\"); // if current elements are still selected\n // and the pointer is just over a locked element\n // do not allow activeLockedId to be set\n\n const hitElements = pointerDownState.hit.allHitElements;\n const sceneCoords = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)({\n clientX: childEvent.clientX,\n clientY: childEvent.clientY\n }, this.state);\n\n if (this.state.activeTool.type === \"selection\" && !pointerDownState.boxSelection.hasOccurred && !pointerDownState.resize.isResizing && !hitElements.some(el => this.state.selectedElementIds[el.id])) {\n const hitLockedElement = this.getElementAtPosition(sceneCoords.x, sceneCoords.y, {\n includeLockedElements: true\n });\n this.store.scheduleCapture();\n\n if (hitLockedElement === null || hitLockedElement === void 0 ? void 0 : hitLockedElement.locked) {\n this.setState({\n activeLockedId: hitLockedElement.groupIds.length > 0 ? hitLockedElement.groupIds.at(-1) || \"\" : hitLockedElement.id\n });\n } else {\n this.setState({\n activeLockedId: null\n });\n }\n } else {\n this.setState({\n activeLockedId: null\n });\n }\n\n this.setState({\n selectedElementsAreBeingDragged: false\n });\n const elementsMap = this.scene.getNonDeletedElementsMap();\n\n if (pointerDownState.drag.hasOccurred && ((_b = (_a = pointerDownState.hit) === null || _a === void 0 ? void 0 : _a.element) === null || _b === void 0 ? void 0 : _b.id)) {\n const element = elementsMap.get(pointerDownState.hit.element.id);\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isBindableElement)(element)) {\n // Renormalize elbow arrows when they are changed via indirect move\n (_c = element.boundElements) === null || _c === void 0 ? void 0 : _c.filter(e => e.type === \"arrow\").map(e => elementsMap.get(e.id)).filter(e => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(e)).forEach(e => {\n !!e && this.scene.mutateElement(e, {});\n });\n }\n } // Handle end of dragging a point of a linear element, might close a loop\n // and sets binding element\n\n\n if ((_d = this.state.selectedLinearElement) === null || _d === void 0 ? void 0 : _d.isEditing) {\n if (!pointerDownState.boxSelection.hasOccurred && ((_f = (_e = pointerDownState.hit) === null || _e === void 0 ? void 0 : _e.element) === null || _f === void 0 ? void 0 : _f.id) !== this.state.selectedLinearElement.elementId) {\n this.actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_8__.actionFinalize);\n } else {\n const editingLinearElement = _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.handlePointerUp(childEvent, this.state.selectedLinearElement, this.state, this.scene);\n\n if (editingLinearElement !== this.state.selectedLinearElement) {\n this.setState({\n selectedLinearElement: editingLinearElement,\n suggestedBindings: []\n });\n }\n }\n } else if (this.state.selectedLinearElement) {\n // Normalize elbow arrow points, remove close parallel segments\n if (this.state.selectedLinearElement.elbowed) {\n const element = _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.getElement(this.state.selectedLinearElement.elementId, this.scene.getNonDeletedElementsMap());\n\n if (element) {\n this.scene.mutateElement(element, {});\n }\n }\n\n if (((_h = (_g = pointerDownState.hit) === null || _g === void 0 ? void 0 : _g.element) === null || _h === void 0 ? void 0 : _h.id) !== this.state.selectedLinearElement.elementId) {\n const selectedELements = this.scene.getSelectedElements(this.state); // set selectedLinearElement to null if there is more than one element selected since we don't want to show linear element handles\n\n if (selectedELements.length > 1) {\n this.setState({\n selectedLinearElement: null\n });\n }\n } else if (this.state.selectedLinearElement.isDragging) {\n this.actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_8__.actionFinalize, \"ui\", {\n event: childEvent,\n sceneCoords\n });\n }\n }\n\n this.missingPointerEventCleanupEmitter.clear();\n window.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_MOVE, pointerDownState.eventListeners.onMove);\n window.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_UP, pointerDownState.eventListeners.onUp);\n window.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.KEYDOWN, pointerDownState.eventListeners.onKeyDown);\n window.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.KEYUP, pointerDownState.eventListeners.onKeyUp);\n (_k = (_j = this.props) === null || _j === void 0 ? void 0 : _j.onPointerUp) === null || _k === void 0 ? void 0 : _k.call(_j, activeTool, pointerDownState);\n this.onPointerUpEmitter.trigger(this.state.activeTool, pointerDownState, childEvent);\n\n if ((newElement === null || newElement === void 0 ? void 0 : newElement.type) === \"freedraw\") {\n const pointerCoords = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)(childEvent, this.state);\n const points = newElement.points;\n let dx = pointerCoords.x - newElement.x;\n let dy = pointerCoords.y - newElement.y; // Allows dots to avoid being flagged as infinitely small\n\n if (dx === points[0][0] && dy === points[0][1]) {\n dy += 0.0001;\n dx += 0.0001;\n }\n\n const pressures = newElement.simulatePressure ? [] : [...newElement.pressures, childEvent.pressure];\n this.scene.mutateElement(newElement, {\n points: [...points, (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(dx, dy)],\n pressures,\n lastCommittedPoint: (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(dx, dy)\n });\n this.actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_8__.actionFinalize);\n return;\n }\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLinearElement)(newElement)) {\n if (newElement.points.length > 1) {\n this.store.scheduleCapture();\n }\n\n const pointerCoords = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)(childEvent, this.state);\n const dragDistance = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointDistance)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(pointerCoords.x, pointerCoords.y), (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(pointerDownState.origin.x, pointerDownState.origin.y)) * this.state.zoom.value;\n\n if ((!pointerDownState.drag.hasOccurred || dragDistance < _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.MINIMUM_ARROW_SIZE) && newElement && !multiElement) {\n if (this.editorInterface.isTouchScreen && newElement.points.length > 1) {\n //zsviczian\n const FIXED_DELTA_X = Math.min(this.state.width * 0.7 / this.state.zoom.value, 100);\n this.scene.mutateElement(newElement, {\n x: newElement.x - FIXED_DELTA_X / 2,\n points: [(0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(0, 0), (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(FIXED_DELTA_X, 0)]\n }, {\n informMutation: false,\n isDragging: false\n });\n this.actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_8__.actionFinalize);\n } else {\n const dx = pointerCoords.x - newElement.x;\n const dy = pointerCoords.y - newElement.y;\n this.scene.mutateElement(newElement, {\n points: [...newElement.points, (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(dx, dy)]\n }, {\n informMutation: false,\n isDragging: false\n });\n this.setState({\n multiElement: newElement,\n newElement\n });\n }\n } else if (pointerDownState.drag.hasOccurred && !multiElement) {\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isBindingEnabled)(this.state) && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isBindingElement)(newElement, false)) {\n this.actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_8__.actionFinalize, \"ui\", {\n event: childEvent,\n sceneCoords\n });\n }\n\n this.setState({\n suggestedBindings: [],\n startBoundElement: null\n });\n\n if (!activeTool.locked) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.resetCursor)(this.interactiveCanvas);\n this.setState(prevState => ({\n newElement: null,\n activeTool: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateActiveTool)(this.state, {\n type: this.state.preferredSelectionTool.type\n }),\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)(Object.assign(Object.assign({}, prevState.selectedElementIds), {\n [newElement.id]: true\n }), prevState),\n selectedLinearElement: new _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor(newElement, this.scene.getNonDeletedElementsMap())\n }));\n } else {\n this.setState(prevState => ({\n newElement: null\n }));\n } // so that the scene gets rendered again to display the newly drawn linear as well\n\n\n this.scene.triggerUpdate();\n }\n\n return;\n }\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isTextElement)(newElement)) {\n const minWidth = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getMinTextElementWidth)((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getFontString)({\n fontSize: newElement.fontSize,\n fontFamily: newElement.fontFamily\n }), newElement.lineHeight);\n\n if (newElement.width < minWidth) {\n this.scene.mutateElement(newElement, {\n autoResize: true\n });\n }\n\n this.resetCursor();\n this.handleTextWysiwyg(newElement, {\n isExistingElement: true\n });\n }\n\n if (activeTool.type !== \"selection\" && newElement && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isInvisiblySmallElement)(newElement)) {\n // remove invisible element which was added in onPointerDown\n // update the store snapshot, so that invisible elements are not captured by the store\n this.updateScene({\n elements: this.scene.getElementsIncludingDeleted().filter(el => el.id !== newElement.id),\n appState: {\n newElement: null\n },\n captureUpdate: _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.CaptureUpdateAction.NEVER\n });\n return;\n }\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isFrameLikeElement)(newElement)) {\n const elementsInsideFrame = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getElementsInNewFrame)(this.scene.getElementsIncludingDeleted(), newElement, this.scene.getNonDeletedElementsMap());\n this.scene.replaceAllElements((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.addElementsToFrame)(this.scene.getElementsMapIncludingDeleted(), elementsInsideFrame, newElement, this.state));\n }\n\n if (newElement) {\n this.scene.mutateElement(newElement, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getNormalizedDimensions)(newElement), {\n informMutation: false,\n isDragging: false\n }); // the above does not guarantee the scene to be rendered again, hence the trigger below\n\n this.scene.triggerUpdate();\n }\n\n if (pointerDownState.drag.hasOccurred) {\n const sceneCoords = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)(childEvent, this.state); // when editing the points of a linear element, we check if the\n // linear element still is in the frame afterwards\n // if not, the linear element will be removed from its frame (if any)\n\n if (this.state.selectedLinearElement && this.state.selectedLinearElement.isDragging) {\n const linearElement = this.scene.getElement(this.state.selectedLinearElement.elementId);\n\n if (linearElement === null || linearElement === void 0 ? void 0 : linearElement.frameId) {\n const frame = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getContainingFrame)(linearElement, elementsMap);\n\n if (frame && linearElement) {\n if (!(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.elementOverlapsWithFrame)(linearElement, frame, this.scene.getNonDeletedElementsMap())) {\n // remove the linear element from all groups\n // before removing it from the frame as well\n this.scene.mutateElement(linearElement, {\n groupIds: []\n });\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.removeElementsFromFrame)([linearElement], this.scene.getNonDeletedElementsMap());\n this.scene.triggerUpdate();\n }\n }\n }\n } else {\n // update the relationships between selected elements and frames\n const topLayerFrame = this.getTopLayerFrameAtSceneCoords(sceneCoords);\n const selectedElements = this.scene.getSelectedElements(this.state);\n let nextElements = this.scene.getElementsMapIncludingDeleted();\n\n const updateGroupIdsAfterEditingGroup = elements => {\n if (elements.length > 0) {\n for (const element of elements) {\n const index = element.groupIds.indexOf(this.state.editingGroupId);\n this.scene.mutateElement(element, {\n groupIds: element.groupIds.slice(0, index)\n }, {\n informMutation: false,\n isDragging: false\n });\n }\n\n nextElements.forEach(element => {\n if (element.groupIds.length && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getElementsInGroup)(nextElements, element.groupIds[element.groupIds.length - 1]).length < 2) {\n this.scene.mutateElement(element, {\n groupIds: []\n }, {\n informMutation: false,\n isDragging: false\n });\n }\n });\n this.setState({\n editingGroupId: null\n });\n }\n };\n\n if (topLayerFrame && !this.state.selectedElementIds[topLayerFrame.id]) {\n const elementsToAdd = selectedElements.filter(element => element.frameId !== topLayerFrame.id && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElementInFrame)(element, nextElements, this.state));\n\n if (this.state.editingGroupId) {\n updateGroupIdsAfterEditingGroup(elementsToAdd);\n }\n\n nextElements = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.addElementsToFrame)(nextElements, elementsToAdd, topLayerFrame, this.state);\n } else if (!topLayerFrame) {\n if (this.state.editingGroupId) {\n const elementsToRemove = selectedElements.filter(element => element.frameId && !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElementInFrame)(element, nextElements, this.state));\n updateGroupIdsAfterEditingGroup(elementsToRemove);\n }\n }\n\n nextElements = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.updateFrameMembershipOfSelectedElements)(nextElements, this.state, this);\n this.scene.replaceAllElements(nextElements);\n }\n }\n\n if (resizingElement) {\n this.store.scheduleCapture();\n }\n\n if (resizingElement && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isInvisiblySmallElement)(resizingElement)) {\n // update the store snapshot, so that invisible elements are not captured by the store\n this.updateScene({\n elements: this.scene.getElementsIncludingDeleted().filter(el => el.id !== resizingElement.id),\n captureUpdate: _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.CaptureUpdateAction.NEVER\n });\n } // handle frame membership for resizing frames and/or selected elements\n\n\n if (pointerDownState.resize.isResizing) {\n let nextElements = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.updateFrameMembershipOfSelectedElements)(this.scene.getElementsIncludingDeleted(), this.state, this);\n const selectedFrames = this.scene.getSelectedElements(this.state).filter(element => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isFrameLikeElement)(element));\n\n for (const frame of selectedFrames) {\n nextElements = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.replaceAllElementsInFrame)(nextElements, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getElementsInResizingFrame)(this.scene.getElementsIncludingDeleted(), frame, this.state, elementsMap), frame, this);\n }\n\n this.scene.replaceAllElements(nextElements);\n } // Code below handles selection when element(s) weren't\n // drag or added to selection on pointer down phase.\n\n\n const hitElement = pointerDownState.hit.element;\n\n if (((_l = this.state.selectedLinearElement) === null || _l === void 0 ? void 0 : _l.elementId) !== (hitElement === null || hitElement === void 0 ? void 0 : hitElement.id) && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLinearElement)(hitElement)) {\n const selectedElements = this.scene.getSelectedElements(this.state); // set selectedLinearElement when no other element selected except\n // the one we've hit\n\n if (selectedElements.length === 1) {\n this.setState({\n selectedLinearElement: new _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor(hitElement, this.scene.getNonDeletedElementsMap())\n });\n }\n } // click outside the cropping region to exit\n\n\n if ( // not in the cropping mode at all\n !croppingElementId || // in the cropping mode\n croppingElementId && ( // not cropping and no hit element\n !hitElement && !isCropping || // hitting something else\n hitElement && hitElement.id !== croppingElementId)) {\n this.finishImageCropping();\n }\n\n const pointerStart = this.lastPointerDownEvent;\n const pointerEnd = this.lastPointerUpEvent || this.lastPointerMoveEvent;\n\n if ((0,_appState__WEBPACK_IMPORTED_MODULE_23__.isEraserActive)(this.state) && pointerStart && pointerEnd) {\n this.eraserTrail.endPath();\n const draggedDistance = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointDistance)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(pointerStart.clientX, pointerStart.clientY), (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(pointerEnd.clientX, pointerEnd.clientY));\n\n if (draggedDistance === 0) {\n const scenePointer = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)({\n clientX: pointerEnd.clientX,\n clientY: pointerEnd.clientY\n }, this.state);\n const hitElements = this.getElementsAtPosition(scenePointer.x, scenePointer.y);\n hitElements.forEach(hitElement => this.elementsPendingErasure.add(hitElement.id));\n }\n\n this.eraseElements();\n return;\n } else if (this.elementsPendingErasure.size) {\n this.restoreReadyToEraseElements();\n }\n\n if (hitElement && !pointerDownState.drag.hasOccurred && !pointerDownState.hit.wasAddedToSelection && ( // if we're editing a line, pointerup shouldn't switch selection if\n // box selected\n !((_m = this.state.selectedLinearElement) === null || _m === void 0 ? void 0 : _m.isEditing) || !pointerDownState.boxSelection.hasOccurred) && // hitElement can be set when alt + ctrl to toggle lasso and we will\n // just respect the selected elements from lasso instead\n this.state.activeTool.type !== \"lasso\") {\n // when inside line editor, shift selects points instead\n if (childEvent.shiftKey && !((_o = this.state.selectedLinearElement) === null || _o === void 0 ? void 0 : _o.isEditing)) {\n if (this.state.selectedElementIds[hitElement.id]) {\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isSelectedViaGroup)(this.state, hitElement)) {\n this.setState(_prevState => {\n const nextSelectedElementIds = Object.assign({}, _prevState.selectedElementIds); // We want to unselect all groups hitElement is part of\n // as well as all elements that are part of the groups\n // hitElement is part of\n\n for (const groupedElement of hitElement.groupIds.flatMap(groupId => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getElementsInGroup)(this.scene.getNonDeletedElements(), groupId))) {\n delete nextSelectedElementIds[groupedElement.id];\n }\n\n return {\n selectedGroupIds: Object.assign(Object.assign({}, _prevState.selectedElementIds), hitElement.groupIds.map(gId => ({\n [gId]: false\n })).reduce((prev, acc) => Object.assign(Object.assign({}, prev), acc), {})),\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)(nextSelectedElementIds, _prevState)\n };\n }); // if not dragging a linear element point (outside editor)\n } else if (!((_p = this.state.selectedLinearElement) === null || _p === void 0 ? void 0 : _p.isDragging)) {\n // remove element from selection while\n // keeping prev elements selected\n this.setState(prevState => {\n const newSelectedElementIds = Object.assign({}, prevState.selectedElementIds);\n delete newSelectedElementIds[hitElement.id];\n const newSelectedElements = (0,_scene__WEBPACK_IMPORTED_MODULE_31__.getSelectedElements)(this.scene.getNonDeletedElements(), {\n selectedElementIds: newSelectedElementIds\n });\n return Object.assign(Object.assign({}, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.selectGroupsForSelectedElements)({\n editingGroupId: prevState.editingGroupId,\n selectedElementIds: newSelectedElementIds\n }, this.scene.getNonDeletedElements(), prevState, this)), {\n // set selectedLinearElement only if thats the only element selected\n selectedLinearElement: newSelectedElements.length === 1 && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLinearElement)(newSelectedElements[0]) ? new _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor(newSelectedElements[0], this.scene.getNonDeletedElementsMap()) : prevState.selectedLinearElement\n });\n });\n }\n } else if (hitElement.frameId && this.state.selectedElementIds[hitElement.frameId]) {\n // when hitElement is part of a selected frame, deselect the frame\n // to avoid frame and containing elements selected simultaneously\n this.setState(prevState => {\n var _a, _b;\n\n const nextSelectedElementIds = Object.assign(Object.assign({}, prevState.selectedElementIds), {\n [hitElement.id]: true\n }); // deselect the frame\n\n delete nextSelectedElementIds[hitElement.frameId]; // deselect groups containing the frame\n\n ((_b = (_a = this.scene.getElement(hitElement.frameId)) === null || _a === void 0 ? void 0 : _a.groupIds) !== null && _b !== void 0 ? _b : []).flatMap(gid => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getElementsInGroup)(this.scene.getNonDeletedElements(), gid)).forEach(element => {\n delete nextSelectedElementIds[element.id];\n });\n return Object.assign(Object.assign({}, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.selectGroupsForSelectedElements)({\n editingGroupId: prevState.editingGroupId,\n selectedElementIds: nextSelectedElementIds\n }, this.scene.getNonDeletedElements(), prevState, this)), {\n showHyperlinkPopup: hitElement.link || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isEmbeddableElement)(hitElement) ? \"info\" : false\n });\n });\n } else {\n // add element to selection while keeping prev elements selected\n this.setState(_prevState => ({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)(Object.assign(Object.assign({}, _prevState.selectedElementIds), {\n [hitElement.id]: true\n }), _prevState)\n }));\n }\n } else {\n this.setState(prevState => {\n var _a;\n\n return Object.assign(Object.assign({}, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.selectGroupsForSelectedElements)({\n editingGroupId: prevState.editingGroupId,\n selectedElementIds: {\n [hitElement.id]: true\n }\n }, this.scene.getNonDeletedElements(), prevState, this)), {\n selectedLinearElement: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLinearElement)(hitElement) && // Don't set `selectedLinearElement` if its same as the hitElement, this is mainly to prevent resetting the `hoverPointIndex` to -1.\n // Future we should update the API to take care of setting the correct `hoverPointIndex` when initialized\n ((_a = prevState.selectedLinearElement) === null || _a === void 0 ? void 0 : _a.elementId) !== hitElement.id ? new _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor(hitElement, this.scene.getNonDeletedElementsMap()) : prevState.selectedLinearElement\n });\n });\n }\n }\n\n if ( // do not clear selection if lasso is active\n this.state.activeTool.type !== \"lasso\" && // not elbow midpoint dragged\n !(hitElement && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(hitElement)) && // not dragged\n !pointerDownState.drag.hasOccurred && // not resized\n !this.state.isResizing && ( // only hitting the bounding box of the previous hit element\n hitElement && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.hitElementBoundingBoxOnly)({\n point: (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(pointerDownState.origin.x, pointerDownState.origin.y),\n element: hitElement,\n elementsMap,\n threshold: this.getElementHitThreshold(hitElement),\n frameNameBound: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isFrameLikeElement)(hitElement) ? this.frameNameBoundsCache.get(hitElement) : null\n }, elementsMap) || !hitElement && pointerDownState.hit.hasHitCommonBoundingBoxOfSelectedElements)) {\n if ((_q = this.state.selectedLinearElement) === null || _q === void 0 ? void 0 : _q.isEditing) {\n // Exit editing mode but keep the element selected\n this.actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_8__.actionToggleLinearEditor);\n } else {\n // Deselect selected elements\n this.setState({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)({}, this.state),\n selectedGroupIds: {},\n editingGroupId: null,\n activeEmbeddable: null\n });\n } // reset cursor\n\n\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.AUTO);\n return;\n }\n\n if (!activeTool.locked && activeTool.type !== \"freedraw\" && newElement) {\n this.setState(prevState => ({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)(Object.assign(Object.assign({}, prevState.selectedElementIds), {\n [newElement.id]: true\n }), prevState),\n showHyperlinkPopup: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isEmbeddableElement)(newElement) && !newElement.link ? \"editor\" : prevState.showHyperlinkPopup\n }));\n }\n\n if (activeTool.type !== \"selection\" || (0,_scene__WEBPACK_IMPORTED_MODULE_31__.isSomeElementSelected)(this.scene.getNonDeletedElements(), this.state) || !(0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isShallowEqual)(this.state.previousSelectedElementIds, this.state.selectedElementIds)) {\n this.store.scheduleCapture();\n }\n\n if (pointerDownState.drag.hasOccurred && !this.state.selectedLinearElement || isResizing || isRotating || isCropping) {\n // We only allow binding via linear elements, specifically via dragging\n // the endpoints (\"start\" or \"end\").\n const linearElements = this.scene.getSelectedElements(this.state).filter(_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLinearElement);\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.bindOrUnbindLinearElements)(linearElements, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isBindingEnabled)(this.state), (_s = (_r = this.state.selectedLinearElement) === null || _r === void 0 ? void 0 : _r.selectedPointsIndices) !== null && _s !== void 0 ? _s : [], this.scene, this.state.zoom);\n }\n\n if (activeTool.type === \"laser\") {\n this.laserTrails.endPath();\n return;\n }\n\n if (!activeTool.locked && activeTool.type !== \"freedraw\" && (activeTool.type !== \"lasso\" || // if lasso is turned on but from selection => reset to selection\n activeTool.type === \"lasso\" && activeTool.fromSelection)) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.resetCursor)(this.interactiveCanvas);\n this.setState({\n newElement: null,\n suggestedBindings: [],\n activeTool: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateActiveTool)(this.state, {\n type: this.state.preferredSelectionTool.type\n })\n });\n } else {\n this.setState({\n newElement: null,\n suggestedBindings: []\n });\n }\n\n if (hitElement && this.lastPointerUpEvent && this.lastPointerDownEvent && this.lastPointerUpEvent.timeStamp - this.lastPointerDownEvent.timeStamp < 300 && gesture.pointers.size <= 1 && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isIframeLikeElement)(hitElement) && this.isIframeLikeElementCenter(hitElement, this.lastPointerUpEvent, pointerDownState.origin.x, pointerDownState.origin.y)) {\n this.handleEmbeddableCenterClick(hitElement);\n }\n });\n } //zsviczian - published on API\n\n\n setSelection(elements) {\n const selectedElementIds = {};\n const selectedGroupIds = {};\n elements.forEach(ele => {\n if (ele.groupIds.length) {\n selectedElementIds[ele.id] = true;\n ele.groupIds.forEach(id => {\n selectedGroupIds[id] = true;\n });\n } // exclude bound text elements as we don't mark them as selected when\n // container is selected unless in group\n else if (!(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isBoundToContainer)(ele)) {\n selectedElementIds[ele.id] = true;\n }\n });\n this.setState({\n previousSelectedElementIds: this.state.selectedElementIds,\n selectedElementIds,\n selectedGroupIds\n });\n }\n\n clearSelection(hitElement) {\n this.setState(prevState => ({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)({}, prevState),\n activeEmbeddable: null,\n selectedGroupIds: {},\n // Continue editing the same group if the user selected a different\n // element from it\n editingGroupId: prevState.editingGroupId && hitElement != null && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElementInGroup)(hitElement, prevState.editingGroupId) ? prevState.editingGroupId : null\n }));\n this.setState({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)({}, this.state),\n activeEmbeddable: null,\n previousSelectedElementIds: this.state.selectedElementIds\n });\n }\n\n getTextWysiwygSnappedToCenterPosition(x, y, appState, container) {\n if (container) {\n let elementCenterX = container.x + container.width / 2;\n let elementCenterY = container.y + container.height / 2;\n const elementCenter = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getContainerCenter)(container, appState, this.scene.getNonDeletedElementsMap());\n\n if (elementCenter) {\n elementCenterX = elementCenter.x;\n elementCenterY = elementCenter.y;\n }\n\n const distanceToCenter = Math.hypot(x - elementCenterX, y - elementCenterY);\n const isSnappedToCenter = distanceToCenter < _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.TEXT_TO_CENTER_SNAP_THRESHOLD;\n\n if (isSnappedToCenter) {\n const {\n x: viewportX,\n y: viewportY\n } = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.sceneCoordsToViewportCoords)({\n sceneX: elementCenterX,\n sceneY: elementCenterY\n }, appState);\n return {\n viewportX,\n viewportY,\n elementCenterX,\n elementCenterY\n };\n }\n }\n }\n\n getCanvasOffsets() {\n var _a;\n\n if ((_a = this.excalidrawContainerRef) === null || _a === void 0 ? void 0 : _a.current) {\n const excalidrawContainer = this.excalidrawContainerRef.current;\n const {\n left,\n top\n } = excalidrawContainer.getBoundingClientRect();\n return {\n offsetLeft: left,\n offsetTop: top\n };\n }\n\n return {\n offsetLeft: 0,\n offsetTop: 0\n };\n }\n\n async updateLanguage() {\n const currentLang = _i18n__WEBPACK_IMPORTED_MODULE_30__.languages.find(lang => lang.code === this.props.langCode) || _i18n__WEBPACK_IMPORTED_MODULE_30__.defaultLang;\n await (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.setLanguage)(currentLang);\n this.setAppState({});\n }\n\n} // -----------------------------------------------------------------------------\n// TEST HOOKS\n// -----------------------------------------------------------------------------\n\n/* //zsviczian - I get a type error on h, but anyway I don't need this test hook\r\ndeclare global {\r\n interface Window {\r\n h: {\r\n scene: Scene;\r\n elements: readonly ExcalidrawElement[];\r\n state: AppState;\r\n setState: React.Component<any, AppState>[\"setState\"];\r\n app: InstanceType<typeof App>;\r\n history: History;\r\n store: Store;\r\n };\r\n }\r\n}\r\n\r\nexport const createTestHook = () => {\r\n if (isTestEnv() || isDevEnv()) {\r\n window.h = window.h || ({} as Window[\"h\"]);\r\n\r\n Object.defineProperties(window.h, {\r\n elements: {\r\n configurable: true,\r\n get() {\r\n return this.app?.scene.getElementsIncludingDeleted();\r\n },\r\n set(elements: ExcalidrawElement[]) {\r\n return this.app?.scene.replaceAllElements(\r\n syncInvalidIndices(elements),\r\n );\r\n },\r\n },\r\n scene: {\r\n configurable: true,\r\n get() {\r\n return this.app?.scene;\r\n },\r\n },\r\n });\r\n }\r\n};\r\n\r\ncreateTestHook();*/\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (App);\n\n//# sourceURL=webpack://ExcalidrawLib/./components/App.tsx?");
|
|
14348
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ExcalidrawContainerContext: () => (/* binding */ ExcalidrawContainerContext),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */ useApp: () => (/* binding */ useApp),\n/* harmony export */ useAppProps: () => (/* binding */ useAppProps),\n/* harmony export */ useEditorInterface: () => (/* binding */ useEditorInterface),\n/* harmony export */ useExcalidrawActionManager: () => (/* binding */ useExcalidrawActionManager),\n/* harmony export */ useExcalidrawAppState: () => (/* binding */ useExcalidrawAppState),\n/* harmony export */ useExcalidrawContainer: () => (/* binding */ useExcalidrawContainer),\n/* harmony export */ useExcalidrawElements: () => (/* binding */ useExcalidrawElements),\n/* harmony export */ useExcalidrawSetAppState: () => (/* binding */ useExcalidrawSetAppState),\n/* harmony export */ useStylesPanelMode: () => (/* binding */ useStylesPanelMode)\n/* harmony export */ });\n/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ \"../../node_modules/clsx/dist/clsx.m.js\");\n/* harmony import */ var lodash_throttle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash.throttle */ \"../../node_modules/lodash.throttle/index.js\");\n/* harmony import */ var lodash_throttle__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_throttle__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-dom */ \"react-dom\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var roughjs_bin_rough__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! roughjs/bin/rough */ \"../../node_modules/roughjs/bin/rough.js\");\n/* harmony import */ var nanoid__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(/*! nanoid */ \"./node_modules/nanoid/index.browser.js\");\n/* harmony import */ var _excalidraw_math__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @excalidraw/math */ \"../math/src/index.ts\");\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n/* harmony import */ var _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @excalidraw/element */ \"../element/src/index.ts\");\n/* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../actions */ \"./actions/index.ts\");\n/* harmony import */ var _actions_actionBoundText__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../actions/actionBoundText */ \"./actions/actionBoundText.tsx\");\n/* harmony import */ var _actions_actionCanvas__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../actions/actionCanvas */ \"./actions/actionCanvas.tsx\");\n/* harmony import */ var _actions_actionClipboard__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../actions/actionClipboard */ \"./actions/actionClipboard.tsx\");\n/* harmony import */ var _actions_actionElementLink__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../actions/actionElementLink */ \"./actions/actionElementLink.ts\");\n/* harmony import */ var _actions_actionElementLock__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../actions/actionElementLock */ \"./actions/actionElementLock.ts\");\n/* harmony import */ var _actions_actionFrame__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../actions/actionFrame */ \"./actions/actionFrame.ts\");\n/* harmony import */ var _actions_actionHistory__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../actions/actionHistory */ \"./actions/actionHistory.tsx\");\n/* harmony import */ var _actions_actionTextAutoResize__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../actions/actionTextAutoResize */ \"./actions/actionTextAutoResize.ts\");\n/* harmony import */ var _actions_actionToggleViewMode__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../actions/actionToggleViewMode */ \"./actions/actionToggleViewMode.tsx\");\n/* harmony import */ var _actions_manager__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../actions/manager */ \"./actions/manager.tsx\");\n/* harmony import */ var _actions_register__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../actions/register */ \"./actions/register.ts\");\n/* harmony import */ var _actions_shortcuts__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../actions/shortcuts */ \"./actions/shortcuts.ts\");\n/* harmony import */ var _analytics__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../analytics */ \"./analytics.ts\");\n/* harmony import */ var _animation_frame_handler__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../animation-frame-handler */ \"./animation-frame-handler.ts\");\n/* harmony import */ var _appState__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../appState */ \"./appState.ts\");\n/* harmony import */ var _clipboard__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../clipboard */ \"./clipboard.ts\");\n/* harmony import */ var _data__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../data */ \"./data/index.ts\");\n/* harmony import */ var _data_library__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../data/library */ \"./data/library.ts\");\n/* harmony import */ var _data_restore__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../data/restore */ \"./data/restore.ts\");\n/* harmony import */ var _gesture__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../gesture */ \"./gesture.ts\");\n/* harmony import */ var _history__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../history */ \"./history.ts\");\n/* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../i18n */ \"./i18n.ts\");\n/* harmony import */ var _scene__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../scene */ \"./scene/index.ts\");\n/* harmony import */ var _scene_zoom__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../scene/zoom */ \"./scene/zoom.ts\");\n/* harmony import */ var _data_blob__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../data/blob */ \"./data/blob.ts\");\n/* harmony import */ var _data_filesystem__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../data/filesystem */ \"./data/filesystem.ts\");\n/* harmony import */ var _components_hyperlink_Hyperlink__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../components/hyperlink/Hyperlink */ \"./components/hyperlink/Hyperlink.tsx\");\n/* harmony import */ var _fonts__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../fonts */ \"./fonts/index.ts\");\n/* harmony import */ var _editor_jotai__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ../editor-jotai */ \"./editor-jotai.ts\");\n/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ../errors */ \"./errors.ts\");\n/* harmony import */ var _snapping__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ../snapping */ \"./snapping.ts\");\n/* harmony import */ var _data_transform__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ../data/transform */ \"./data/transform.ts\");\n/* harmony import */ var _scene_Renderer__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ../scene/Renderer */ \"./scene/Renderer.ts\");\n/* harmony import */ var _cursor__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ../cursor */ \"./cursor.ts\");\n/* harmony import */ var _components_ElementCanvasButtons__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ../components/ElementCanvasButtons */ \"./components/ElementCanvasButtons.tsx\");\n/* harmony import */ var _laser_trails__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ../laser-trails */ \"./laser-trails.ts\");\n/* harmony import */ var _reactUtils__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ../reactUtils */ \"./reactUtils.ts\");\n/* harmony import */ var _wysiwyg_textWysiwyg__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ../wysiwyg/textWysiwyg */ \"./wysiwyg/textWysiwyg.tsx\");\n/* harmony import */ var _scene_scrollbars__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ../scene/scrollbars */ \"./scene/scrollbars.ts\");\n/* harmony import */ var _mermaid__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ../mermaid */ \"./mermaid.ts\");\n/* harmony import */ var _lasso__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ../lasso */ \"./lasso/index.ts\");\n/* harmony import */ var _eraser__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ../eraser */ \"./eraser/index.ts\");\n/* harmony import */ var _shortcut__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ../shortcut */ \"./shortcut.ts\");\n/* harmony import */ var _ConvertElementTypePopup__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./ConvertElementTypePopup */ \"./components/ConvertElementTypePopup.tsx\");\n/* harmony import */ var _ActiveConfirmDialog__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./ActiveConfirmDialog */ \"./components/ActiveConfirmDialog.tsx\");\n/* harmony import */ var _BraveMeasureTextError__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./BraveMeasureTextError */ \"./components/BraveMeasureTextError.tsx\");\n/* harmony import */ var _ContextMenu__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./ContextMenu */ \"./components/ContextMenu.tsx\");\n/* harmony import */ var _EyeDropper__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./EyeDropper */ \"./components/EyeDropper.tsx\");\n/* harmony import */ var _FollowMode_FollowMode__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./FollowMode/FollowMode */ \"./components/FollowMode/FollowMode.tsx\");\n/* harmony import */ var _LayerUI__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./LayerUI */ \"./components/LayerUI.tsx\");\n/* harmony import */ var _MagicButton__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./MagicButton */ \"./components/MagicButton.tsx\");\n/* harmony import */ var _SVGLayer__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./SVGLayer */ \"./components/SVGLayer.tsx\");\n/* harmony import */ var _SearchMenu__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./SearchMenu */ \"./components/SearchMenu.tsx\");\n/* harmony import */ var _Sidebar_Sidebar__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./Sidebar/Sidebar */ \"./components/Sidebar/Sidebar.tsx\");\n/* harmony import */ var _canvases__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ./canvases */ \"./components/canvases/index.tsx\");\n/* harmony import */ var _canvases_NewElementCanvas__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ./canvases/NewElementCanvas */ \"./components/canvases/NewElementCanvas.tsx\");\n/* harmony import */ var _hyperlink_helpers__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(/*! ./hyperlink/helpers */ \"./components/hyperlink/helpers.ts\");\n/* harmony import */ var _icons__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(/*! ./icons */ \"./components/icons.tsx\");\n/* harmony import */ var _Toast__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(/*! ./Toast */ \"./components/Toast.tsx\");\n/* harmony import */ var _shapes__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(/*! ./shapes */ \"./components/shapes.tsx\");\n/* harmony import */ var _UnlockPopup__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(/*! ./UnlockPopup */ \"./components/UnlockPopup.tsx\");\n/* harmony import */ var _obsidianUtils__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(/*! ../obsidianUtils */ \"./obsidianUtils.ts\");\n/* harmony import */ var _Tooltip__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(/*! ./Tooltip */ \"./components/Tooltip.tsx\");\n/* harmony import */ var _actions_actionProperties__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(/*! ../actions/actionProperties */ \"./actions/actionProperties.tsx\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst AppContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createContext(null);\nconst AppPropsContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createContext(null);\nconst editorInterfaceContextInitialValue = {\n formFactor: \"desktop\",\n desktopUIMode: \"full\",\n userAgent: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.createUserAgentDescriptor)(typeof navigator !== \"undefined\" ? navigator.userAgent : \"\"),\n isTouchScreen: false,\n preferTrayMode: false,\n canFitSidebar: false,\n isLandscape: true\n};\nconst EditorInterfaceContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createContext(editorInterfaceContextInitialValue);\nEditorInterfaceContext.displayName = \"EditorInterfaceContext\";\nconst ExcalidrawContainerContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createContext({\n container: null,\n id: null\n});\nExcalidrawContainerContext.displayName = \"ExcalidrawContainerContext\";\nconst ExcalidrawElementsContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createContext([]);\nExcalidrawElementsContext.displayName = \"ExcalidrawElementsContext\";\nconst ExcalidrawAppStateContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createContext(Object.assign(Object.assign({}, (0,_appState__WEBPACK_IMPORTED_MODULE_23__.getDefaultAppState)()), {\n width: 0,\n height: 0,\n offsetLeft: 0,\n offsetTop: 0\n}));\nExcalidrawAppStateContext.displayName = \"ExcalidrawAppStateContext\";\nconst ExcalidrawSetAppStateContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createContext(() => {\n console.warn(\"Uninitialized ExcalidrawSetAppStateContext context!\");\n});\nExcalidrawSetAppStateContext.displayName = \"ExcalidrawSetAppStateContext\";\nconst ExcalidrawActionManagerContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createContext(null);\nExcalidrawActionManagerContext.displayName = \"ExcalidrawActionManagerContext\";\nconst useApp = () => (0,react__WEBPACK_IMPORTED_MODULE_2__.useContext)(AppContext);\nconst useAppProps = () => (0,react__WEBPACK_IMPORTED_MODULE_2__.useContext)(AppPropsContext);\nconst useEditorInterface = () => (0,react__WEBPACK_IMPORTED_MODULE_2__.useContext)(EditorInterfaceContext);\nconst useStylesPanelMode = () => (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.deriveStylesPanelMode)(useEditorInterface());\nconst useExcalidrawContainer = () => (0,react__WEBPACK_IMPORTED_MODULE_2__.useContext)(ExcalidrawContainerContext);\nconst useExcalidrawElements = () => (0,react__WEBPACK_IMPORTED_MODULE_2__.useContext)(ExcalidrawElementsContext);\nconst useExcalidrawAppState = () => (0,react__WEBPACK_IMPORTED_MODULE_2__.useContext)(ExcalidrawAppStateContext);\nconst useExcalidrawSetAppState = () => (0,react__WEBPACK_IMPORTED_MODULE_2__.useContext)(ExcalidrawSetAppStateContext);\nconst useExcalidrawActionManager = () => (0,react__WEBPACK_IMPORTED_MODULE_2__.useContext)(ExcalidrawActionManagerContext);\nlet didTapTwice = false;\nlet tappedTwiceTimer = 0;\nlet firstTapPosition = null;\nlet isHoldingSpace = false;\nlet isPanning = false;\nlet isDraggingScrollBar = false;\nlet currentScrollBars = {\n horizontal: null,\n vertical: null\n};\nlet touchTimeout = 0;\nlet invalidateContextMenu = false;\n/**\r\n * Map of youtube embed video states\r\n */\n\nconst YOUTUBE_VIDEO_STATES = new Map();\nlet IS_PLAIN_PASTE = false;\nlet IS_PLAIN_PASTE_TIMER = 0;\nlet PLAIN_PASTE_TOAST_SHOWN = false;\nlet lastPointerUp = null;\nconst gesture = {\n pointers: new Map(),\n lastCenter: null,\n initialDistance: null,\n initialScale: null\n};\n\nclass App extends (react__WEBPACK_IMPORTED_MODULE_2___default().Component) {\n constructor(props) {\n super(props);\n this.interactiveCanvas = null;\n this.unmounted = false;\n this.editorInterface = editorInterfaceContextInitialValue;\n this.stylesPanelMode = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.deriveStylesPanelMode)(editorInterfaceContextInitialValue);\n this.excalidrawContainerRef = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createRef();\n this.shouldRenderAllEmbeddables = false; //zsviczian\n\n this.files = {};\n this.imageCache = new Map();\n this.iFrameRefs = new Map();\n /**\r\n * Indicates whether the embeddable's url has been validated for rendering.\r\n * If value not set, indicates that the validation is pending.\r\n * Initially or on url change the flag is not reset so that we can guarantee\r\n * the validation came from a trusted source (the editor).\r\n **/\n\n this.embedsValidationStatus = new Map();\n /** embeds that have been inserted to DOM (as a perf optim, we don't want to\r\n * insert to DOM before user initially scrolls to them) */\n\n this.initializedEmbeds = new Set();\n\n this.handleToastClose = () => {\n this.setToast(null);\n };\n\n this.elementsPendingErasure = new Set();\n this.flowChartCreator = new _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.FlowChartCreator();\n this.flowChartNavigator = new _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.FlowChartNavigator();\n this.lastPointerDownEvent = null;\n this.lastPointerUpEvent = null;\n this.lastPointerMoveEvent = null;\n this.lastPointerMoveCoords = null;\n this.lastViewportPosition = {\n x: 0,\n y: 0\n };\n this.allowMobileMode = true; //zsviczian\n\n this.animationFrameHandler = new _animation_frame_handler__WEBPACK_IMPORTED_MODULE_22__.AnimationFrameHandler();\n this.laserTrails = new _laser_trails__WEBPACK_IMPORTED_MODULE_44__.LaserTrails(this.animationFrameHandler, this);\n this.eraserTrail = new _eraser__WEBPACK_IMPORTED_MODULE_50__.EraserTrail(this.animationFrameHandler, this);\n this.lassoTrail = new _lasso__WEBPACK_IMPORTED_MODULE_49__.LassoTrail(this.animationFrameHandler, this);\n this.onChangeEmitter = new _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.Emitter();\n this.onPointerDownEmitter = new _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.Emitter();\n this.onPointerUpEmitter = new _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.Emitter();\n this.onUserFollowEmitter = new _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.Emitter();\n this.onScrollChangeEmitter = new _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.Emitter();\n this.missingPointerEventCleanupEmitter = new _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.Emitter();\n this.onRemoveEventListenersEmitter = new _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.Emitter();\n\n this.updateEditorAtom = (atom, ...args) => {\n const result = _editor_jotai__WEBPACK_IMPORTED_MODULE_37__.editorJotaiStore.set(atom, ...args);\n this.triggerRender();\n return result;\n };\n /**\r\n * Returns gridSize taking into account `gridModeEnabled`.\r\n * If disabled, returns null.\r\n */\n\n\n this.getEffectiveGridSize = () => {\n return (0,_snapping__WEBPACK_IMPORTED_MODULE_39__.isGridModeEnabled)(this) ? this.state.gridSize : null;\n };\n\n this.updateEmbedValidationStatus = (element, status) => {\n this.embedsValidationStatus.set(element.id, status);\n _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.ShapeCache.delete(element);\n };\n\n this.updateEmbeddables = () => {\n const iframeLikes = new Set();\n let updated = false;\n this.scene.getNonDeletedElements().filter(element => {\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isEmbeddableElement)(element)) {\n iframeLikes.add(element.id);\n\n if (!this.embedsValidationStatus.has(element.id)) {\n updated = true;\n const validated = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.embeddableURLValidator)(element.link, this.props.validateEmbeddable);\n this.updateEmbedValidationStatus(element, validated);\n }\n } else if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isIframeElement)(element)) {\n iframeLikes.add(element.id);\n }\n\n return false;\n });\n\n if (updated) {\n this.scene.triggerUpdate();\n } // GC\n\n\n this.iFrameRefs.forEach((ref, id) => {\n if (!iframeLikes.has(id)) {\n this.iFrameRefs.delete(id);\n }\n });\n };\n\n this.getFrameNameDOMId = frameElement => {\n return `${this.id}-frame-name-${frameElement.id}`;\n };\n\n this.frameNameBoundsCache = {\n get: frameElement => {\n let bounds = this.frameNameBoundsCache._cache.get(frameElement.id);\n\n if (!bounds || bounds.zoom !== this.state.zoom.value || bounds.versionNonce !== frameElement.versionNonce) {\n const frameNameDiv = document.getElementById(this.getFrameNameDOMId(frameElement));\n\n if (frameNameDiv) {\n const box = frameNameDiv.getBoundingClientRect();\n const boxSceneTopLeft = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)({\n clientX: box.x,\n clientY: box.y\n }, this.state);\n const boxSceneBottomRight = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)({\n clientX: box.right,\n clientY: box.bottom\n }, this.state);\n bounds = {\n x: boxSceneTopLeft.x,\n y: boxSceneTopLeft.y,\n width: boxSceneBottomRight.x - boxSceneTopLeft.x,\n height: boxSceneBottomRight.y - boxSceneTopLeft.y,\n angle: 0,\n zoom: this.state.zoom.value,\n versionNonce: frameElement.versionNonce\n };\n\n this.frameNameBoundsCache._cache.set(frameElement.id, bounds);\n\n return bounds;\n }\n\n return null;\n }\n\n return bounds;\n },\n\n /**\r\n * @private\r\n */\n _cache: new Map()\n };\n\n this.resetEditingFrame = frame => {\n var _a;\n\n if (frame) {\n this.scene.mutateElement(frame, {\n name: ((_a = frame.name) === null || _a === void 0 ? void 0 : _a.trim()) || null\n });\n }\n\n this.setState({\n editingFrame: null\n });\n };\n\n this.renderFrameNames = () => {\n var _a;\n\n if (!this.state.frameRendering.enabled || !this.state.frameRendering.name) {\n if (this.state.editingFrame) {\n this.resetEditingFrame(null);\n }\n\n return null;\n }\n\n const isDarkTheme = this.state.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.THEME.DARK; //zsviczian\n\n const nonDeletedFramesLikes = this.state.frameRendering.markerName && this.state.frameRendering.markerEnabled ? this.scene.getNonDeletedFramesLikes() : this.scene.getNonDeletedFramesLikes().filter(f => f.frameRole !== \"marker\");\n const focusedSearchMatch = nonDeletedFramesLikes.length > 0 ? ((_a = this.state.searchMatches) === null || _a === void 0 ? void 0 : _a.focusedId) && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isFrameLikeElement)(this.scene.getElement(this.state.searchMatches.focusedId)) ? this.state.searchMatches.matches.find(sm => sm.focus) : null : null;\n return nonDeletedFramesLikes.map(f => {\n var _a, _b;\n\n if (!(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElementInViewport)(f, this.canvas.width / window.devicePixelRatio, this.canvas.height / window.devicePixelRatio, {\n offsetLeft: this.state.offsetLeft,\n offsetTop: this.state.offsetTop,\n scrollX: this.state.scrollX,\n scrollY: this.state.scrollY,\n zoom: this.state.zoom\n }, this.scene.getNonDeletedElementsMap())) {\n if (this.state.editingFrame === f.id) {\n this.resetEditingFrame(f);\n } // if frame not visible, don't render its name\n\n\n return null;\n }\n\n const {\n x: x1,\n y: y1\n } = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.sceneCoordsToViewportCoords)({\n sceneX: f.x,\n sceneY: f.y\n }, this.state);\n const FRAME_NAME_EDIT_PADDING = 6;\n let frameNameJSX;\n const frameName = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getFrameLikeTitle)(f);\n\n if (f.id === this.state.editingFrame) {\n const frameNameInEdit = frameName;\n frameNameJSX = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"input\", {\n autoFocus: true,\n value: frameNameInEdit,\n onChange: e => {\n this.scene.mutateElement(f, {\n name: e.target.value\n });\n },\n onFocus: e => e.target.select(),\n onBlur: () => this.resetEditingFrame(f),\n onKeyDown: event => {\n // for some inexplicable reason, `onBlur` triggered on ESC\n // does not reset `state.editingFrame` despite being called,\n // and we need to reset it here as well\n if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.ESCAPE || event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.ENTER) {\n this.resetEditingFrame(f);\n }\n },\n style: {\n background: this.state.viewBackgroundColor,\n filter: isDarkTheme ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.THEME_FILTER : \"none\",\n zIndex: 2,\n border: \"none\",\n display: \"block\",\n padding: `${FRAME_NAME_EDIT_PADDING}px`,\n borderRadius: 4,\n boxShadow: \"inset 0 0 0 2px var(--color-on-primary-container)\",\n fontFamily: \"Assistant\",\n fontSize: `${_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.FRAME_STYLE.nameFontSize}px`,\n transform: `translate(-${FRAME_NAME_EDIT_PADDING}px, ${FRAME_NAME_EDIT_PADDING}px)`,\n color: \"var(--color-gray-80)\",\n overflow: \"hidden\",\n maxWidth: `${(0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_70__.getExcalidrawContentEl)().clientWidth - x1 - FRAME_NAME_EDIT_PADDING //zsviczian was document.body\n }px`\n },\n size: frameNameInEdit.length + 1 || 1,\n dir: \"auto\",\n autoComplete: \"off\",\n autoCapitalize: \"off\",\n autoCorrect: \"off\"\n });\n } else {\n frameNameJSX = frameName;\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n id: this.getFrameNameDOMId(f),\n key: f.id,\n style: {\n position: \"absolute\",\n // Positioning from bottom so that we don't to either\n // calculate text height or adjust using transform (which)\n // messes up input position when editing the frame name.\n // This makes the positioning deterministic and we can calculate\n // the same position when rendering to canvas / svg.\n bottom: `${this.state.height + _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.FRAME_STYLE.nameOffsetY - y1 + this.state.offsetTop}px`,\n left: `${x1 - this.state.offsetLeft}px`,\n zIndex: 2,\n fontSize: _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.FRAME_STYLE.nameFontSize,\n color: (_b = (_a = this.state.frameColor) === null || _a === void 0 ? void 0 : _a.nameColor) !== null && _b !== void 0 ? _b : isDarkTheme //zsviczian\n ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.FRAME_STYLE.nameColorDarkTheme : _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.FRAME_STYLE.nameColorLightTheme,\n lineHeight: _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.FRAME_STYLE.nameLineHeight,\n width: \"max-content\",\n maxWidth: (focusedSearchMatch === null || focusedSearchMatch === void 0 ? void 0 : focusedSearchMatch.id) === f.id && (focusedSearchMatch === null || focusedSearchMatch === void 0 ? void 0 : focusedSearchMatch.focus) ? \"none\" : `${f.width * this.state.zoom.value}px`,\n overflow: f.id === this.state.editingFrame ? \"visible\" : \"hidden\",\n whiteSpace: \"nowrap\",\n textOverflow: \"ellipsis\",\n cursor: _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.MOVE,\n pointerEvents: this.state.viewModeEnabled ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.POINTER_EVENTS.disabled : _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.POINTER_EVENTS.enabled\n },\n onPointerDown: event => this.handleCanvasPointerDown(event),\n onWheel: event => this.handleWheel(event),\n onContextMenu: this.handleCanvasContextMenu,\n onDoubleClick: () => {\n this.setState({\n editingFrame: f.id\n });\n }\n }, frameNameJSX);\n });\n };\n\n this.focusContainer = () => {\n var _a;\n\n (_a = this.excalidrawContainerRef.current) === null || _a === void 0 ? void 0 : _a.focus();\n };\n\n this.getSceneElementsIncludingDeleted = () => {\n return this.scene.getElementsIncludingDeleted();\n };\n\n this.getSceneElementsMapIncludingDeleted = () => {\n return this.scene.getElementsMapIncludingDeleted();\n };\n\n this.getSceneElements = () => {\n return this.scene.getNonDeletedElements();\n };\n\n this.onInsertElements = elements => {\n this.addElementsFromPasteOrLibrary({\n elements,\n position: \"center\",\n files: null\n });\n };\n\n this.onExportImage = async (type, elements, opts) => {\n (0,_analytics__WEBPACK_IMPORTED_MODULE_21__.trackEvent)(\"export\", type, \"ui\");\n const fileHandle = await (0,_data__WEBPACK_IMPORTED_MODULE_25__.exportCanvas)(type, elements, this.state, this.files, {\n exportBackground: this.state.exportBackground,\n name: this.getName(),\n viewBackgroundColor: this.state.viewBackgroundColor,\n exportingFrame: opts.exportingFrame\n }).catch(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.muteFSAbortError).catch(error => {\n console.error(error);\n this.setState({\n errorMessage: error.message\n });\n });\n\n if (this.state.exportEmbedScene && fileHandle && (0,_data_blob__WEBPACK_IMPORTED_MODULE_33__.isImageFileHandle)(fileHandle)) {\n this.setState({\n fileHandle\n });\n }\n };\n\n this.magicGenerations = new Map();\n\n this.updateMagicGeneration = ({\n frameElement,\n data\n }) => {\n if (data.status === \"pending\") {\n // We don't wanna persist pending state to storage. It should be in-app\n // state only.\n // Thus reset so that we prefer local cache (if there was some\n // generationData set previously)\n this.scene.mutateElement(frameElement, {\n customData: {\n generationData: undefined\n }\n }, {\n informMutation: false,\n isDragging: false\n });\n } else {\n this.scene.mutateElement(frameElement, {\n customData: {\n generationData: data\n }\n }, {\n informMutation: false,\n isDragging: false\n });\n }\n\n this.magicGenerations.set(frameElement.id, data);\n this.triggerRender();\n };\n\n this.plugins = {};\n\n this.onMagicframeToolSelect = () => {\n const selectedElements = this.scene.getSelectedElements({\n selectedElementIds: this.state.selectedElementIds\n });\n\n if (selectedElements.length === 0) {\n this.setActiveTool({\n type: _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.TOOL_TYPE.magicframe\n });\n (0,_analytics__WEBPACK_IMPORTED_MODULE_21__.trackEvent)(\"ai\", \"tool-select (empty-selection)\", \"d2c\");\n } else {\n const selectedMagicFrame = selectedElements.length === 1 && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isMagicFrameElement)(selectedElements[0]) && selectedElements[0]; // case: user selected elements containing frame-like(s) or are frame\n // members, we don't want to wrap into another magicframe\n // (unless the only selected element is a magic frame which we reuse)\n\n if (!selectedMagicFrame && selectedElements.some(el => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isFrameLikeElement)(el) || el.frameId)) {\n this.setActiveTool({\n type: _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.TOOL_TYPE.magicframe\n });\n return;\n }\n\n (0,_analytics__WEBPACK_IMPORTED_MODULE_21__.trackEvent)(\"ai\", \"tool-select (existing selection)\", \"d2c\");\n let frame;\n\n if (selectedMagicFrame) {\n // a single magicframe already selected -> use it\n frame = selectedMagicFrame;\n } else {\n // selected elements aren't wrapped in magic frame yet -> wrap now\n const [minX, minY, maxX, maxY] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getCommonBounds)(selectedElements);\n const padding = 50;\n frame = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newMagicFrameElement)(Object.assign(Object.assign({}, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.FRAME_STYLE), {\n x: minX - padding,\n y: minY - padding,\n width: maxX - minX + padding * 2,\n height: maxY - minY + padding * 2,\n opacity: 100,\n locked: false\n }));\n this.scene.insertElement(frame);\n\n for (const child of selectedElements) {\n this.scene.mutateElement(child, {\n frameId: frame.id\n });\n }\n\n this.setState({\n selectedElementIds: {\n [frame.id]: true\n }\n });\n }\n\n this.onMagicFrameGenerate(frame, \"upstream\");\n }\n };\n\n this.openEyeDropper = ({\n type\n }) => {\n this.updateEditorAtom(_EyeDropper__WEBPACK_IMPORTED_MODULE_56__.activeEyeDropperAtom, {\n swapPreviewOnAlt: true,\n colorPickerType: type === \"stroke\" ? \"elementStroke\" : \"elementBackground\",\n onSelect: (color, event) => {\n const shouldUpdateStrokeColor = type === \"background\" && event.altKey || type === \"stroke\" && !event.altKey;\n const selectedElements = this.scene.getSelectedElements(this.state);\n\n if (!selectedElements.length || this.state.activeTool.type !== \"selection\") {\n if (shouldUpdateStrokeColor) {\n this.syncActionResult({\n appState: Object.assign(Object.assign({}, this.state), {\n currentItemStrokeColor: color\n }),\n captureUpdate: _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.CaptureUpdateAction.IMMEDIATELY\n });\n } else {\n this.syncActionResult({\n appState: Object.assign(Object.assign({}, this.state), {\n currentItemBackgroundColor: color\n }),\n captureUpdate: _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.CaptureUpdateAction.IMMEDIATELY\n });\n }\n } else {\n this.updateScene({\n elements: this.scene.getElementsIncludingDeleted().map(el => {\n if (this.state.selectedElementIds[el.id]) {\n return (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newElementWith)(el, {\n [shouldUpdateStrokeColor ? \"strokeColor\" : \"backgroundColor\"]: color\n });\n }\n\n return el;\n }),\n captureUpdate: _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.CaptureUpdateAction.IMMEDIATELY\n });\n }\n },\n keepOpenOnAlt: false\n });\n };\n\n this.dismissLinearEditor = () => {\n setTimeout(() => {\n var _a;\n\n if ((_a = this.state.selectedLinearElement) === null || _a === void 0 ? void 0 : _a.isEditing) {\n this.setState({\n selectedLinearElement: Object.assign(Object.assign({}, this.state.selectedLinearElement), {\n isEditing: false\n })\n });\n }\n });\n };\n\n this.syncActionResult = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(actionResult => {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n\n if (this.unmounted || actionResult === false) {\n return;\n }\n\n this.store.scheduleAction(actionResult.captureUpdate);\n let didUpdate = false;\n let editingTextElement = null;\n\n if (actionResult.elements) {\n this.scene.replaceAllElements(actionResult.elements);\n didUpdate = true;\n }\n\n if (actionResult.files) {\n this.addMissingFiles(actionResult.files, actionResult.replaceFiles);\n this.addNewImagesToImageCache();\n }\n\n if (actionResult.appState || editingTextElement || this.state.contextMenu) {\n let viewModeEnabled = ((_a = actionResult === null || actionResult === void 0 ? void 0 : actionResult.appState) === null || _a === void 0 ? void 0 : _a.viewModeEnabled) || false;\n let zenModeEnabled = ((_b = actionResult === null || actionResult === void 0 ? void 0 : actionResult.appState) === null || _b === void 0 ? void 0 : _b.zenModeEnabled) || false;\n const theme = ((_c = actionResult === null || actionResult === void 0 ? void 0 : actionResult.appState) === null || _c === void 0 ? void 0 : _c.theme) || this.props.theme || _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.THEME.LIGHT;\n const name = (_e = (_d = actionResult === null || actionResult === void 0 ? void 0 : actionResult.appState) === null || _d === void 0 ? void 0 : _d.name) !== null && _e !== void 0 ? _e : this.state.name;\n const errorMessage = (_g = (_f = actionResult === null || actionResult === void 0 ? void 0 : actionResult.appState) === null || _f === void 0 ? void 0 : _f.errorMessage) !== null && _g !== void 0 ? _g : this.state.errorMessage;\n\n if (typeof this.props.viewModeEnabled !== \"undefined\") {\n viewModeEnabled = this.props.viewModeEnabled;\n }\n\n if (typeof this.props.zenModeEnabled !== \"undefined\") {\n zenModeEnabled = this.props.zenModeEnabled;\n }\n\n editingTextElement = ((_h = actionResult.appState) === null || _h === void 0 ? void 0 : _h.editingTextElement) || null; // make sure editingTextElement points to latest element reference\n\n if (actionResult.elements && editingTextElement) {\n actionResult.elements.forEach(element => {\n if ((editingTextElement === null || editingTextElement === void 0 ? void 0 : editingTextElement.id) === element.id && editingTextElement !== element && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isNonDeletedElement)(element) && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isTextElement)(element)) {\n editingTextElement = element;\n }\n });\n }\n\n if (editingTextElement === null || editingTextElement === void 0 ? void 0 : editingTextElement.isDeleted) {\n editingTextElement = null;\n }\n\n this.setState(prevAppState => {\n const actionAppState = actionResult.appState || {};\n return Object.assign(Object.assign(Object.assign({}, prevAppState), actionAppState), {\n // NOTE this will prevent opening context menu using an action\n // or programmatically from the host, so it will need to be\n // rewritten later\n contextMenu: null,\n editingTextElement,\n viewModeEnabled,\n zenModeEnabled,\n theme,\n name,\n errorMessage\n });\n });\n didUpdate = true;\n }\n\n if (!didUpdate) {\n this.scene.triggerUpdate();\n }\n }); // Lifecycle\n\n this.onBlur = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(() => {\n isHoldingSpace = false;\n this.setState({\n isBindingEnabled: true\n });\n });\n\n this.onUnload = () => {\n this.onBlur();\n };\n\n this.disableEvent = event => {\n event.preventDefault();\n };\n\n this.resetHistory = () => {\n this.history.clear();\n };\n\n this.resetStore = () => {\n this.store.clear();\n };\n /**\r\n * Resets scene & history.\r\n * ! Do not use to clear scene user action !\r\n */\n\n\n this.resetScene = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(opts => {\n this.scene.replaceAllElements([]);\n this.setState(state => Object.assign(Object.assign({}, (0,_appState__WEBPACK_IMPORTED_MODULE_23__.getDefaultAppState)()), {\n isLoading: (opts === null || opts === void 0 ? void 0 : opts.resetLoadingState) ? false : state.isLoading,\n theme: this.state.theme\n }));\n this.resetStore();\n this.resetHistory();\n });\n\n this.initializeScene = async () => {\n var _a;\n\n if (\"launchQueue\" in window && \"LaunchParams\" in window) {\n window.launchQueue.setConsumer(async launchParams => {\n if (!launchParams.files.length) {\n return;\n }\n\n const fileHandle = launchParams.files[0];\n const blob = await fileHandle.getFile();\n this.loadFileToCanvas(new File([blob], blob.name || \"\", {\n type: blob.type\n }), fileHandle);\n });\n }\n\n if (this.props.theme) {\n this.setState({\n theme: this.props.theme\n });\n }\n\n if (!this.state.isLoading) {\n this.setState({\n isLoading: true\n });\n }\n\n let initialData = null;\n\n try {\n if (typeof this.props.initialData === \"function\") {\n initialData = (await this.props.initialData()) || null;\n } else {\n initialData = (await this.props.initialData) || null;\n }\n\n if (initialData === null || initialData === void 0 ? void 0 : initialData.libraryItems) {\n this.library.updateLibrary({\n libraryItems: initialData.libraryItems,\n merge: true\n }).catch(error => {\n console.error(error);\n });\n }\n } catch (error) {\n console.error(error);\n initialData = {\n appState: {\n errorMessage: error.message || \"Encountered an error during importing or restoring scene data\"\n }\n };\n }\n\n const scene = (0,_data_restore__WEBPACK_IMPORTED_MODULE_27__.restore)(initialData, null, null, {\n repairBindings: true,\n deleteInvisibleElements: true\n });\n const activeTool = scene.appState.activeTool;\n\n if (!scene.appState.preferredSelectionTool.initialized) {\n scene.appState.preferredSelectionTool = {\n type: this.editorInterface.formFactor === \"phone\" ? \"lasso\" : \"selection\",\n initialized: true\n };\n }\n\n scene.appState = Object.assign(Object.assign({}, scene.appState), {\n theme: this.props.theme || scene.appState.theme,\n // we're falling back to current (pre-init) state when deciding\n // whether to open the library, to handle a case where we\n // update the state outside of initialData (e.g. when loading the app\n // with a library install link, which should auto-open the library)\n openSidebar: ((_a = scene.appState) === null || _a === void 0 ? void 0 : _a.openSidebar) || this.state.openSidebar,\n activeTool: activeTool.type === \"image\" || activeTool.type === \"lasso\" || activeTool.type === \"selection\" ? Object.assign(Object.assign({}, activeTool), {\n type: scene.appState.preferredSelectionTool.type\n }) : scene.appState.activeTool,\n isLoading: false,\n toast: this.state.toast\n });\n\n if (initialData === null || initialData === void 0 ? void 0 : initialData.scrollToContent) {\n scene.appState = Object.assign(Object.assign({}, scene.appState), (0,_scene__WEBPACK_IMPORTED_MODULE_31__.calculateScrollCenter)(scene.elements, Object.assign(Object.assign({}, scene.appState), {\n width: this.state.width,\n height: this.state.height,\n offsetTop: this.state.offsetTop,\n offsetLeft: this.state.offsetLeft\n })));\n }\n\n this.resetStore();\n this.resetHistory();\n this.syncActionResult(Object.assign(Object.assign({}, scene), {\n captureUpdate: _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.CaptureUpdateAction.NEVER\n })); // clear the shape and image cache so that any images in initialData\n // can be loaded fresh\n\n this.clearImageShapeCache(); // manually loading the font faces seems faster even in browsers that do fire the loadingdone event\n\n this.fonts.loadSceneFonts().then(fontFaces => {\n this.fonts.onLoaded(fontFaces);\n });\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElementLink)(window.location.href)) {\n this.scrollToContent(window.location.href, {\n animate: false\n });\n }\n };\n\n this.getFormFactor = (editorWidth, editorHeight) => {\n var _a;\n\n if (this.props.UIOptions.formFactor === \"phone\" && !this.allowMobileMode) {\n return (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getFormFactor)(editorWidth, editorHeight, this.allowMobileMode); //zsviczian\n }\n\n return (_a = this.props.UIOptions.formFactor) !== null && _a !== void 0 ? _a : (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getFormFactor)(editorWidth, editorHeight, this.allowMobileMode) //zsviczian\n ;\n };\n\n this.refreshEditorInterface = preferTrayMode => {\n var _a, _b;\n\n const container = this.excalidrawContainerRef.current;\n\n if (!container) {\n return;\n }\n\n const {\n width: editorWidth,\n height: editorHeight\n } = container.getBoundingClientRect();\n const storedDesktopUIMode = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.loadDesktopUIModePreference)();\n const userAgentDescriptor = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.createUserAgentDescriptor)(typeof navigator !== \"undefined\" ? navigator.userAgent : \"\"); // allow host app to control formFactor and desktopUIMode via props\n\n const sidebarBreakpoint = this.props.UIOptions.dockedSidebarBreakpoint != null ? this.props.UIOptions.dockedSidebarBreakpoint : _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.MQ_RIGHT_SIDEBAR_MIN_WIDTH;\n const nextEditorInterface = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateObject)(this.editorInterface, {\n desktopUIMode: preferTrayMode ? \"tray\" : //zsviczian\n (_b = (_a = this.props.UIOptions.desktopUIMode) !== null && _a !== void 0 ? _a : storedDesktopUIMode) !== null && _b !== void 0 ? _b : this.editorInterface.desktopUIMode,\n formFactor: this.getFormFactor(editorWidth, editorHeight),\n userAgent: userAgentDescriptor,\n canFitSidebar: editorWidth > sidebarBreakpoint,\n isLandscape: editorWidth > editorHeight,\n preferTrayMode: preferTrayMode !== null && preferTrayMode !== void 0 ? preferTrayMode : this.editorInterface.preferTrayMode //zsviczian\n\n });\n this.editorInterface = nextEditorInterface;\n this.reconcileStylesPanelMode(nextEditorInterface);\n };\n\n this.reconcileStylesPanelMode = nextEditorInterface => {\n const nextStylesPanelMode = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.deriveStylesPanelMode)(nextEditorInterface);\n\n if (nextStylesPanelMode === this.stylesPanelMode) {\n return;\n }\n\n const prevStylesPanelMode = this.stylesPanelMode;\n this.stylesPanelMode = nextStylesPanelMode;\n\n if (prevStylesPanelMode !== \"full\" && nextStylesPanelMode === \"full\" || prevStylesPanelMode !== \"tray\" && nextStylesPanelMode === \"tray\" //zsviczian\n ) {\n this.setState(prevState => ({\n preferredSelectionTool: {\n type: \"selection\",\n initialized: true\n }\n }));\n }\n };\n /** TO BE USED LATER */\n\n\n this.setDesktopUIMode = mode => {\n const nextMode = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.setDesktopUIMode)(mode);\n this.editorInterface = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateObject)(this.editorInterface, {\n desktopUIMode: nextMode\n });\n this.reconcileStylesPanelMode(this.editorInterface);\n }; //zsviczian\n\n\n this.isTouchScreen = () => {\n return this.editorInterface.isTouchScreen;\n }; //zsviczian\n\n\n this.setTrayModeEnabled = enabled => {\n const container = this.excalidrawContainerRef.current;\n\n if (!container) {\n return;\n }\n\n if (this.editorInterface.formFactor === \"phone\") {\n enabled = false;\n }\n\n if (this.editorInterface.preferTrayMode === enabled && this.editorInterface.desktopUIMode === \"tray\") {\n return;\n }\n\n this.refreshEditorInterface(enabled);\n this.triggerRender();\n (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.setDesktopUIMode)(this.editorInterface.desktopUIMode);\n }; //zsviczian\n\n\n this.isTrayModeEnabled = () => {\n return this.editorInterface.preferTrayMode;\n };\n\n this.onResize = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(() => {\n this.scene.getElementsIncludingDeleted().forEach(element => _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.ShapeCache.delete(element));\n this.refreshEditorInterface();\n this.updateDOMRect();\n this.setState({});\n });\n /** generally invoked only if fullscreen was invoked programmatically */\n\n this.onFullscreenChange = () => {\n var _a;\n\n if ( // points to the iframe element we fullscreened\n !document.fullscreenElement && ((_a = this.state.activeEmbeddable) === null || _a === void 0 ? void 0 : _a.state) === \"active\") {\n this.setState({\n activeEmbeddable: null\n });\n }\n };\n\n this.renderInteractiveSceneCallback = ({\n atLeastOneVisibleElement,\n scrollBars,\n elementsMap\n }) => {\n if (!document.querySelector(\".excalidraw\")) {\n return;\n } //zsviczian - address issue when moving excalidraw to a new window/document\n\n\n if (scrollBars) {\n currentScrollBars = scrollBars;\n }\n\n const scrolledOutside = // hide when editing text\n this.state.editingTextElement ? false : !atLeastOneVisibleElement && elementsMap.size > 0;\n\n if (this.state.scrolledOutside !== scrolledOutside) {\n this.setState({\n scrolledOutside\n });\n }\n\n this.scheduleImageRefresh();\n };\n\n this.onScroll = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.debounce)(() => {\n const {\n offsetTop,\n offsetLeft\n } = this.getCanvasOffsets();\n this.setState(state => {\n if (state.offsetLeft === offsetLeft && state.offsetTop === offsetTop) {\n return null;\n }\n\n return {\n offsetTop,\n offsetLeft\n };\n });\n }, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.SCROLL_TIMEOUT); // Copy/paste\n\n this.onCut = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(event => {\n var _a;\n\n const isExcalidrawActive = (_a = this.excalidrawContainerRef.current) === null || _a === void 0 ? void 0 : _a.contains(document.activeElement);\n\n if (!isExcalidrawActive || (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isWritableElement)(event.target)) {\n return;\n }\n\n this.actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_8__.actionCut, \"keyboard\", event);\n event.preventDefault();\n event.stopPropagation();\n });\n this.onCopy = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(event => {\n var _a;\n\n const isExcalidrawActive = (_a = this.excalidrawContainerRef.current) === null || _a === void 0 ? void 0 : _a.contains(document.activeElement);\n\n if (!isExcalidrawActive || (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isWritableElement)(event.target)) {\n return;\n }\n\n this.actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_8__.actionCopy, \"keyboard\", event);\n event.preventDefault();\n event.stopPropagation();\n });\n\n this.onTouchStart = event => {\n // fix for Apple Pencil Scribble (do not prevent for other devices)\n if (_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isIOS) {\n event.preventDefault();\n }\n\n if (!didTapTwice) {\n didTapTwice = true;\n\n if (event.touches.length === 1) {\n firstTapPosition = {\n x: event.touches[0].clientX,\n y: event.touches[0].clientY\n };\n }\n\n clearTimeout(tappedTwiceTimer);\n tappedTwiceTimer = window.setTimeout(App.resetTapTwice, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.TAP_TWICE_TIMEOUT);\n return;\n } // insert text only if we tapped twice with a single finger at approximately the same position\n // event.touches.length === 1 will also prevent inserting text when user's zooming\n\n\n if (didTapTwice && event.touches.length === 1 && firstTapPosition) {\n const touch = event.touches[0];\n const distance = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointDistance)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(touch.clientX, touch.clientY), (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(firstTapPosition.x, firstTapPosition.y)); // only create text if the second tap is within the threshold of the first tap\n // this prevents accidental text creation during dragging/selection\n\n if (distance <= _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.DOUBLE_TAP_POSITION_THRESHOLD) {\n // end lasso trail and deselect elements just in case\n this.lassoTrail.endPath();\n this.deselectElements(); // @ts-ignore\n\n this.handleCanvasDoubleClick({\n clientX: touch.clientX,\n clientY: touch.clientY\n });\n }\n\n didTapTwice = false;\n clearTimeout(tappedTwiceTimer);\n }\n\n if (event.touches.length === 2) {\n this.setState({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)({}, this.state),\n activeEmbeddable: null\n });\n }\n };\n\n this.onTouchEnd = event => {\n this.resetContextMenuTimer();\n\n if (event.touches.length > 0) {\n this.setState({\n previousSelectedElementIds: {},\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)(this.state.previousSelectedElementIds, this.state)\n });\n } else {\n gesture.pointers.clear();\n }\n };\n\n this.pasteFromClipboard = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(async event => {\n var _a;\n\n const isPlainPaste = !!IS_PLAIN_PASTE; // #686\n\n const target = document.activeElement;\n const isExcalidrawActive = (_a = this.excalidrawContainerRef.current) === null || _a === void 0 ? void 0 : _a.contains(target);\n\n if (event && !isExcalidrawActive) {\n return;\n }\n\n const elementUnderCursor = document.elementFromPoint(this.lastViewportPosition.x, this.lastViewportPosition.y);\n\n if (event && (!(elementUnderCursor instanceof HTMLCanvasElement) || (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isWritableElement)(target))) {\n return;\n } // must be called in the same frame (thus before any awaits) as the paste\n // event else some browsers (FF...) will clear the clipboardData\n // (something something security)\n\n\n const dataTransferList = await (0,_clipboard__WEBPACK_IMPORTED_MODULE_24__.parseDataTransferEvent)(event);\n const filesList = dataTransferList.getFiles();\n const data = await (0,_clipboard__WEBPACK_IMPORTED_MODULE_24__.parseClipboard)(dataTransferList, isPlainPaste);\n\n if (this.props.onPaste) {\n try {\n if ((await this.props.onPaste(data, event)) === false) {\n return;\n }\n } catch (error) {\n console.error(error);\n }\n }\n\n await this.insertClipboardContent(data, filesList, isPlainPaste);\n this.setActiveTool({\n type: this.state.preferredSelectionTool.type\n }, true);\n event === null || event === void 0 ? void 0 : event.preventDefault();\n });\n\n this.addElementsFromPasteOrLibrary = opts => {\n var _a, _b;\n\n const elements = (0,_data_restore__WEBPACK_IMPORTED_MODULE_27__.restoreElements)(opts.elements, null, {\n deleteInvisibleElements: true\n });\n const [minX, minY, maxX, maxY] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getCommonBounds)(elements);\n const elementsCenterX = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.distance)(minX, maxX) / 2;\n const elementsCenterY = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.distance)(minY, maxY) / 2;\n const clientX = typeof opts.position === \"object\" ? opts.position.clientX : opts.position === \"cursor\" ? this.lastViewportPosition.x : this.state.width / 2 + this.state.offsetLeft;\n const clientY = typeof opts.position === \"object\" ? opts.position.clientY : opts.position === \"cursor\" ? this.lastViewportPosition.y : this.state.height / 2 + this.state.offsetTop;\n const {\n x,\n y\n } = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)({\n clientX,\n clientY\n }, this.state);\n const dx = x - elementsCenterX;\n const dy = y - elementsCenterY;\n const [gridX, gridY] = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(dx, dy, this.getEffectiveGridSize());\n const {\n duplicatedElements\n } = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.duplicateElements)({\n type: \"everything\",\n elements: elements.map(element => {\n return (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newElementWith)(element, {\n x: element.x + gridX - minX,\n y: element.y + gridY - minY\n });\n }),\n randomizeSeed: !opts.retainSeed\n });\n const prevElements = this.scene.getElementsIncludingDeleted();\n let nextElements = [...prevElements, ...duplicatedElements];\n const mappedNewSceneElements = (_b = (_a = this.props).onDuplicate) === null || _b === void 0 ? void 0 : _b.call(_a, nextElements, prevElements);\n nextElements = mappedNewSceneElements || nextElements;\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.syncMovedIndices)(nextElements, (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.arrayToMap)(duplicatedElements));\n const topLayerFrame = this.getTopLayerFrameAtSceneCoords({\n x,\n y\n });\n\n if (topLayerFrame) {\n const eligibleElements = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.filterElementsEligibleAsFrameChildren)(duplicatedElements, topLayerFrame);\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.addElementsToFrame)(nextElements, eligibleElements, topLayerFrame, this.state);\n }\n\n this.scene.replaceAllElements(nextElements);\n duplicatedElements.forEach(newElement => {\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isTextElement)(newElement) && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isBoundToContainer)(newElement)) {\n const container = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getContainerElement)(newElement, this.scene.getElementsMapIncludingDeleted());\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.redrawTextBoundingBox)(newElement, container, this.scene);\n }\n }); // paste event may not fire FontFace loadingdone event in Safari, hence loading font faces manually\n\n if (true) {\n //zsviczian - isSafari\n _fonts__WEBPACK_IMPORTED_MODULE_36__.Fonts.loadElementsFonts(duplicatedElements).then(fontFaces => {\n this.fonts.onLoaded(fontFaces);\n });\n }\n\n if (opts.files) {\n this.addMissingFiles(opts.files);\n }\n\n const nextElementsToSelect = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.excludeElementsInFramesFromSelection)(duplicatedElements);\n this.store.scheduleCapture();\n this.setState(Object.assign(Object.assign(Object.assign({}, this.state), {\n // keep sidebar (presumably the library) open if it's docked and\n // can fit.\n //\n // Note, we should close the sidebar only if we're dropping items\n // from library, not when pasting from clipboard. Alas.\n openSidebar: this.state.openSidebar && this.editorInterface.canFitSidebar && _editor_jotai__WEBPACK_IMPORTED_MODULE_37__.editorJotaiStore.get(_Sidebar_Sidebar__WEBPACK_IMPORTED_MODULE_62__.isSidebarDockedAtom) ? this.state.openSidebar : null\n }), (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.selectGroupsForSelectedElements)({\n editingGroupId: null,\n selectedElementIds: nextElementsToSelect.reduce((acc, element) => {\n if (!(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isBoundToContainer)(element)) {\n acc[element.id] = true;\n }\n\n return acc;\n }, {})\n }, this.scene.getNonDeletedElements(), this.state, this)), () => {\n if (opts.files) {\n this.addNewImagesToImageCache();\n }\n });\n this.setActiveTool({\n type: this.state.preferredSelectionTool.type\n }, true);\n\n if (opts.fitToContent) {\n this.scrollToContent(duplicatedElements, {\n fitToContent: true,\n canvasOffsets: this.getEditorUIOffsets()\n });\n }\n };\n\n this.setAppState = (state, callback) => {\n this.setState(state, callback);\n };\n\n this.removePointer = event => {\n if (touchTimeout) {\n this.resetContextMenuTimer();\n }\n\n gesture.pointers.delete(event.pointerId);\n };\n\n this.toggleLock = (source = \"ui\") => {\n if (!this.state.activeTool.locked) {\n (0,_analytics__WEBPACK_IMPORTED_MODULE_21__.trackEvent)(\"toolbar\", \"toggleLock\", `${source} (${this.editorInterface.formFactor === \"phone\" ? \"mobile\" : \"desktop\"})`);\n }\n\n this.setState(prevState => {\n return {\n activeTool: Object.assign(Object.assign(Object.assign({}, prevState.activeTool), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateActiveTool)(this.state, prevState.activeTool.locked ? {\n type: this.state.preferredSelectionTool.type\n } : prevState.activeTool)), {\n locked: !prevState.activeTool.locked\n })\n };\n });\n };\n\n this.updateFrameRendering = opts => {\n this.setState(prevState => {\n var _a, _b, _c, _d, _e, _f;\n\n const next = typeof opts === \"function\" ? opts(prevState.frameRendering) : opts;\n return {\n frameRendering: {\n enabled: (_a = next === null || next === void 0 ? void 0 : next.enabled) !== null && _a !== void 0 ? _a : prevState.frameRendering.enabled,\n clip: (_b = next === null || next === void 0 ? void 0 : next.clip) !== null && _b !== void 0 ? _b : prevState.frameRendering.clip,\n name: (_c = next === null || next === void 0 ? void 0 : next.name) !== null && _c !== void 0 ? _c : prevState.frameRendering.name,\n outline: (_d = next === null || next === void 0 ? void 0 : next.outline) !== null && _d !== void 0 ? _d : prevState.frameRendering.outline,\n //zsviczian\n markerName: (_e = next === null || next === void 0 ? void 0 : next.markerName) !== null && _e !== void 0 ? _e : prevState.frameRendering.markerName,\n markerEnabled: (_f = next === null || next === void 0 ? void 0 : next.markerEnabled) !== null && _f !== void 0 ? _f : prevState.frameRendering.markerEnabled\n }\n };\n });\n };\n\n this.togglePenMode = force => {\n this.setState(prevState => {\n return {\n penMode: force !== null && force !== void 0 ? force : !prevState.penMode,\n penDetected: true\n };\n });\n };\n\n this.onHandToolToggle = () => {\n //zsviczian added timeout because button won't select otherwise\n setTimeout(() => this.actionManager.executeAction(_actions_actionCanvas__WEBPACK_IMPORTED_MODULE_10__.actionToggleHandTool));\n };\n /**\r\n * Zooms on canvas viewport center\r\n */\n\n\n this.zoomCanvas = (\n /**\r\n * Decimal fraction, auto-clamped between MIN_ZOOM and MAX_ZOOM.\r\n * 1 = 100% zoom, 2 = 200% zoom, 0.5 = 50% zoom\r\n */\n value) => {\n this.setState(Object.assign({}, (0,_scene_zoom__WEBPACK_IMPORTED_MODULE_32__.getStateForZoom)({\n viewportX: this.state.width / 2 + this.state.offsetLeft,\n viewportY: this.state.height / 2 + this.state.offsetTop,\n nextZoom: (0,_scene__WEBPACK_IMPORTED_MODULE_31__.getNormalizedZoom)(value)\n }, this.state)));\n };\n\n this.cancelInProgressAnimation = null;\n\n this.scrollToContent = (\n /**\r\n * target to scroll to\r\n *\r\n * - string - id of element or group, or url containing elementLink\r\n * - ExcalidrawElement | ExcalidrawElement[] - element(s) objects\r\n */\n target = this.scene.getNonDeletedElements(), opts) => {\n var _a, _b, _c, _d;\n\n if (typeof target === \"string\") {\n let id;\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElementLink)(target)) {\n id = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.parseElementLinkFromURL)(target);\n } else {\n id = target;\n }\n\n if (id) {\n const elements = this.scene.getElementsFromId(id);\n\n if (elements === null || elements === void 0 ? void 0 : elements.length) {\n this.scrollToContent(elements, {\n fitToContent: (_a = opts === null || opts === void 0 ? void 0 : opts.fitToContent) !== null && _a !== void 0 ? _a : true,\n animate: (_b = opts === null || opts === void 0 ? void 0 : opts.animate) !== null && _b !== void 0 ? _b : true\n });\n } else if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElementLink)(target)) {\n this.setState({\n toast: {\n message: (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"elementLink.notFound\"),\n duration: 3000,\n closable: true\n }\n });\n }\n }\n\n return;\n }\n\n (_c = this.cancelInProgressAnimation) === null || _c === void 0 ? void 0 : _c.call(this); // convert provided target into ExcalidrawElement[] if necessary\n\n const targetElements = Array.isArray(target) ? target : [target];\n let zoom = this.state.zoom;\n let scrollX = this.state.scrollX;\n let scrollY = this.state.scrollY;\n\n if ((opts === null || opts === void 0 ? void 0 : opts.fitToContent) || (opts === null || opts === void 0 ? void 0 : opts.fitToViewport)) {\n const {\n appState\n } = (0,_actions_actionCanvas__WEBPACK_IMPORTED_MODULE_10__.zoomToFit)({\n canvasOffsets: opts.canvasOffsets,\n targetElements,\n appState: this.state,\n fitToViewport: !!(opts === null || opts === void 0 ? void 0 : opts.fitToViewport),\n viewportZoomFactor: opts === null || opts === void 0 ? void 0 : opts.viewportZoomFactor,\n minZoom: opts === null || opts === void 0 ? void 0 : opts.minZoom,\n maxZoom: opts === null || opts === void 0 ? void 0 : opts.maxZoom\n });\n zoom = appState.zoom;\n scrollX = appState.scrollX;\n scrollY = appState.scrollY;\n } else {\n // compute only the viewport location, without any zoom adjustment\n const scroll = (0,_scene__WEBPACK_IMPORTED_MODULE_31__.calculateScrollCenter)(targetElements, this.state);\n scrollX = scroll.scrollX;\n scrollY = scroll.scrollY;\n } // when animating, we use RequestAnimationFrame to prevent the animation\n // from slowing down other processes\n\n\n if (opts === null || opts === void 0 ? void 0 : opts.animate) {\n const origScrollX = this.state.scrollX;\n const origScrollY = this.state.scrollY;\n const origZoom = this.state.zoom.value;\n const cancel = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.easeToValuesRAF)({\n fromValues: {\n scrollX: origScrollX,\n scrollY: origScrollY,\n zoom: origZoom\n },\n toValues: {\n scrollX,\n scrollY,\n zoom: zoom.value\n },\n interpolateValue: (from, to, progress, key) => {\n // for zoom, use different easing\n if (key === \"zoom\") {\n return from * Math.pow(to / from, (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.easeOut)(progress));\n } // handle using default\n\n\n return undefined;\n },\n onStep: ({\n scrollX,\n scrollY,\n zoom\n }) => {\n this.setState({\n scrollX,\n scrollY,\n zoom: {\n value: zoom\n }\n });\n },\n onStart: () => {\n this.setState({\n shouldCacheIgnoreZoom: true\n });\n },\n onEnd: () => {\n this.setState({\n shouldCacheIgnoreZoom: false\n });\n },\n onCancel: () => {\n this.setState({\n shouldCacheIgnoreZoom: false\n });\n },\n duration: (_d = opts === null || opts === void 0 ? void 0 : opts.duration) !== null && _d !== void 0 ? _d : 500\n });\n\n this.cancelInProgressAnimation = () => {\n cancel();\n this.cancelInProgressAnimation = null;\n };\n } else {\n this.setState({\n scrollX,\n scrollY,\n zoom\n });\n }\n };\n\n this.maybeUnfollowRemoteUser = () => {\n if (this.state.userToFollow) {\n this.setState({\n userToFollow: null\n });\n }\n };\n /** use when changing scrollX/scrollY/zoom based on user interaction */\n\n\n this.translateCanvas = state => {\n var _a;\n\n (_a = this.cancelInProgressAnimation) === null || _a === void 0 ? void 0 : _a.call(this);\n this.maybeUnfollowRemoteUser();\n this.setState(state);\n }; //zsviczian\n\n\n this.setForceRenderAllEmbeddables = force => {\n this.shouldRenderAllEmbeddables = force;\n\n if (force) {\n this.setState({});\n }\n }; //zsviczian\n\n\n this.zoomToFit = (target = this.scene.getNonDeletedElements(), maxZoom, //null will zoom to max based on viewport\n margin = 0.03) => {\n if (typeof maxZoom === \"undefined\") {\n //zsviczian\n maxZoom = (0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_70__.getMaxZoom)();\n }\n\n if (!target) {\n target = this.scene.getNonDeletedElements();\n }\n\n if (target.length === 0) {\n maxZoom = 1;\n }\n\n this.setState((0,_actions_actionCanvas__WEBPACK_IMPORTED_MODULE_10__.zoomToFitElements)(target, this.state, false, this, maxZoom, margin).appState);\n }; //zsviczian\n\n\n this.getColorAtScenePoint = ({\n sceneX,\n sceneY\n }) => {\n if (!this.canvas) {\n console.error(\"Canvas not available\");\n return null;\n }\n\n const {\n x,\n y\n } = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.sceneCoordsToViewportCoords)({\n sceneX,\n sceneY\n }, this.state);\n const context = this.canvas.getContext(\"2d\");\n\n if (!context) {\n console.error(\"2D context not available\");\n return null;\n } // Get pixel data directly from the given scene coordinates\n\n\n const pixelData = context.getImageData(x, y, 1, 1).data;\n const [r, g, b, a] = pixelData; // Check for transparency\n\n if (a === 0) {\n return this.state.theme === \"light\" ? \"rgba(255,255,255,1)\" : \"rgba(0,0,0,1)\";\n } // Return the color in rgba format\n\n\n return `rgba(${r}, ${g}, ${b}, ${a / 255})`;\n }; //zsviczian\n\n\n this.startLineEditor = (el, selectedPointsIndices = null) => {\n if (!el || !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLinearElement)(el)) {\n return;\n } // First select the element\n\n\n this.setState({\n selectedElementIds: {\n [el.id]: true\n }\n }, () => {\n // Then set up the editor\n const linearElementEditor = new _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor(el, this.scene.getNonDeletedElementsMap());\n this.setState({\n selectedLinearElement: Object.assign(Object.assign({}, linearElementEditor), {\n isEditing: true,\n selectedPointsIndices\n })\n });\n });\n }; //zsviczian\n\n\n this.updateContainerSize = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(containers => {\n containers.forEach(element => {\n // Get absolute coordinates for the bottom-right corner\n const [x1, y1, x2, y2] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getResizedElementAbsoluteCoords)(element, element.width, element.height, true); // Get rotated pointer position at bottom-right corner\n\n const [pointerX, pointerY] = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointRotateRads)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(x2, y2), (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)((x1 + x2) / 2, (y1 + y2) / 2), element.angle);\n const {\n nextWidth,\n nextHeight\n } = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getNextSingleWidthAndHeightFromPointer)(element, element, \"se\", pointerX, pointerY);\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.resizeSingleElement)(nextWidth, nextHeight, element, element, this.scene.getElementsMapIncludingDeleted(), this.scene, \"se\", {\n shouldMaintainAspectRatio: true,\n shouldResizeFromCenter: false\n });\n });\n });\n\n this.setToast = toast => {\n this.setState({\n toast\n });\n };\n\n this.restoreFileFromShare = async () => {\n try {\n const webShareTargetCache = await caches.open(\"web-share-target\");\n const response = await webShareTargetCache.match(\"shared-file\");\n\n if (response) {\n const blob = await response.blob();\n const file = new File([blob], blob.name || \"\", {\n type: blob.type\n });\n this.loadFileToCanvas(file, null);\n await webShareTargetCache.delete(\"shared-file\");\n window.history.replaceState(null, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.APP_NAME, window.location.pathname);\n }\n } catch (error) {\n this.setState({\n errorMessage: error.message\n });\n }\n };\n /**\r\n * adds supplied files to existing files in the appState.\r\n * NOTE if file already exists in editor state, the file data is not updated\r\n * */\n\n\n this.addFiles = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(files => {\n const {\n addedFiles\n } = this.addMissingFiles(files, undefined, true); //zsviczian\n\n this.clearImageShapeCache(addedFiles);\n this.scene.triggerUpdate();\n this.addNewImagesToImageCache();\n }); //zsviczian https://github.com/zsviczian/excalibrain/issues/9\n\n this.setMobileModeAllowed = allow => {\n this.allowMobileMode = allow;\n this.refreshEditorInterface();\n this.triggerRender();\n (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.setDesktopUIMode)(this.editorInterface.desktopUIMode);\n }; //zsviczian\n\n\n this.debounceClearHighlightSearchResults = false;\n\n this.selectElements = (elements, highlightSearchResult = false) => {\n //zsviczian\n if (highlightSearchResult) {\n this.debounceClearHighlightSearchResults = true;\n setTimeout(() => {\n this.debounceClearHighlightSearchResults = false;\n }, 500);\n }\n\n this.updateScene({\n appState: Object.assign(Object.assign({}, this.state), {\n editingGroupId: null,\n selectedElementIds: elements.reduce((map, element) => {\n map[element.id] = true;\n return map;\n }, {}),\n highlightSearchResult\n }),\n captureUpdate: _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.CaptureUpdateAction.NEVER,\n forceFlushSync: true\n });\n }; //zsviczian\n\n\n this.bringToFront = elements => {\n this.selectElements(elements);\n this.updateScene(_actions__WEBPACK_IMPORTED_MODULE_8__.actionBringToFront.perform(this.scene.getNonDeletedElements(), this.state));\n }; //zsviczian\n\n\n this.bringForward = elements => {\n this.selectElements(elements);\n this.updateScene(_actions__WEBPACK_IMPORTED_MODULE_8__.actionBringForward.perform(this.scene.getNonDeletedElements(), this.state, undefined, this));\n }; //zsviczian\n\n\n this.sendToBack = elements => {\n this.selectElements(elements);\n this.updateScene(_actions__WEBPACK_IMPORTED_MODULE_8__.actionSendToBack.perform(this.scene.getNonDeletedElements(), this.state));\n }; //zsviczian\n\n\n this.sendBackward = elements => {\n this.selectElements(elements);\n this.updateScene(_actions__WEBPACK_IMPORTED_MODULE_8__.actionSendBackward.perform(this.scene.getNonDeletedElements(), this.state, undefined, this));\n };\n\n this.addMissingFiles = (files, replace = false, force = false) => {\n var _a;\n\n const nextFiles = replace ? {} : Object.assign({}, this.files);\n const addedFiles = {};\n\n const _files = Array.isArray(files) ? files : Object.values(files);\n\n for (const fileData of _files) {\n if (!force && nextFiles[fileData.id]) {\n //zsviczian\n continue;\n }\n\n addedFiles[fileData.id] = fileData;\n nextFiles[fileData.id] = fileData;\n\n if (fileData.mimeType === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.MIME_TYPES.svg) {\n try {\n const restoredDataURL = (0,_data_blob__WEBPACK_IMPORTED_MODULE_33__.getDataURL_sync)((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.normalizeSVG)((0,_data_blob__WEBPACK_IMPORTED_MODULE_33__.dataURLToString)(fileData.dataURL)), _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.MIME_TYPES.svg);\n\n if (fileData.dataURL !== restoredDataURL) {\n // bump version so persistence layer can update the store\n fileData.version = ((_a = fileData.version) !== null && _a !== void 0 ? _a : 1) + 1;\n fileData.dataURL = restoredDataURL;\n }\n } catch (error) {\n console.error(error);\n }\n }\n }\n\n this.files = nextFiles;\n return {\n addedFiles\n };\n };\n\n this.updateScene = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(sceneData => {\n const {\n elements,\n appState,\n collaborators,\n captureUpdate\n } = sceneData;\n\n if (captureUpdate) {\n const nextElements = elements ? elements : undefined;\n const observedAppState = appState ? (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getObservedAppState)(Object.assign(Object.assign({}, this.store.snapshot.appState), appState)) : undefined;\n this.store.scheduleMicroAction({\n action: captureUpdate,\n elements: nextElements,\n appState: observedAppState\n });\n } //zsviczian forceFlushSync is set to true in ExcalidrawView.updateScene.\n //without this e.g. text search did not select the elements\n\n\n if (sceneData.forceFlushSync === true) {\n (0,react_dom__WEBPACK_IMPORTED_MODULE_3__.flushSync)(() => {\n if (appState) {\n this.setState(appState);\n }\n });\n } else if (appState) {\n this.setState(appState);\n }\n\n if (elements) {\n this.scene.replaceAllElements(elements);\n }\n\n if (collaborators) {\n this.setState({\n collaborators\n });\n }\n });\n\n this.applyDeltas = (deltas, options) => {\n // squash all deltas together, starting with a fresh new delta instance\n const aggregatedDelta = _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.StoreDelta.squash(...deltas); // create new instance of elements map & appState, so we don't accidentaly mutate existing ones\n\n const nextAppState = Object.assign({}, this.state);\n const nextElements = new Map(this.scene.getElementsMapIncludingDeleted());\n return _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.StoreDelta.applyTo(aggregatedDelta, nextElements, nextAppState, options);\n };\n\n this.mutateElement = (element, updates, informMutation = true) => {\n return this.scene.mutateElement(element, updates, {\n informMutation,\n isDragging: false\n });\n };\n\n this.triggerRender = (\n /** force always re-renders canvas even if no change */\n force) => {\n if (force === true) {\n this.scene.triggerUpdate();\n } else {\n this.setState({});\n }\n };\n /**\r\n * @returns whether the menu was toggled on or off\r\n */\n\n\n this.toggleSidebar = ({\n name,\n tab,\n force\n }) => {\n var _a, _b;\n\n let nextName;\n\n if (force === undefined) {\n nextName = ((_a = this.state.openSidebar) === null || _a === void 0 ? void 0 : _a.name) === name && ((_b = this.state.openSidebar) === null || _b === void 0 ? void 0 : _b.tab) === tab ? null : name;\n } else {\n nextName = force ? name : null;\n }\n\n const nextState = nextName ? {\n name: nextName\n } : null;\n\n if (nextState && tab) {\n nextState.tab = tab;\n }\n\n this.setState({\n openSidebar: nextState\n });\n return !!nextName;\n };\n\n this.updateCurrentCursorPosition = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(event => {\n this.lastViewportPosition.x = event.clientX;\n this.lastViewportPosition.y = event.clientY;\n });\n\n this.getEditorUIOffsets = () => {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;\n\n const toolbarBottom = ((_e = (_d = (_c = (_b = (_a = this.excalidrawContainerRef) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.querySelector(\".App-toolbar\")) === null || _c === void 0 ? void 0 : _c.getBoundingClientRect()) === null || _d === void 0 ? void 0 : _d.bottom) !== null && _e !== void 0 ? _e : 0) - this.state.offsetTop;\n const sidebarRect = (_h = (_g = (_f = this.excalidrawContainerRef) === null || _f === void 0 ? void 0 : _f.current) === null || _g === void 0 ? void 0 : _g.querySelector(\".sidebar\")) === null || _h === void 0 ? void 0 : _h.getBoundingClientRect();\n const propertiesPanelRect = (_l = (_k = (_j = this.excalidrawContainerRef) === null || _j === void 0 ? void 0 : _j.current) === null || _k === void 0 ? void 0 : _k.querySelector(\".App-menu__left\")) === null || _l === void 0 ? void 0 : _l.getBoundingClientRect();\n const PADDING = 16;\n\n const adjustRectValueForOffset = ( //zsviczian https://github.com/excalidraw/excalidraw/issues/8561\n value, fallback) => (value !== null && value !== void 0 ? value : fallback + this.state.offsetLeft) - this.state.offsetLeft;\n\n return (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.getLanguage)().rtl ? {\n top: toolbarBottom + PADDING,\n right: Math.max(this.state.width - adjustRectValueForOffset( //zsivczian\n propertiesPanelRect === null || propertiesPanelRect === void 0 ? void 0 : propertiesPanelRect.left, this.state.width), 0) + PADDING,\n bottom: PADDING,\n //zsivczian\n left: Math.max(adjustRectValueForOffset(sidebarRect === null || sidebarRect === void 0 ? void 0 : sidebarRect.right, 0), 0) + PADDING\n } : {\n top: toolbarBottom + PADDING,\n right: Math.max(this.state.width - adjustRectValueForOffset(sidebarRect === null || sidebarRect === void 0 ? void 0 : sidebarRect.left, this.state.width) + //zsivczian\n PADDING, 0),\n bottom: PADDING,\n //zsivczian\n left: Math.max(adjustRectValueForOffset(propertiesPanelRect === null || propertiesPanelRect === void 0 ? void 0 : propertiesPanelRect.right, 0), 0) + PADDING\n };\n }; // Input handling\n\n\n this.onKeyDown = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(event => {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n\n if (this.state.activeTool.type === \"selection\" && this.state.resizingElement && (event.shiftKey || event.altKey)) {\n event.stopPropagation(); //zsviczian shift fires repeatedly causing slowdown when resizing sticky notes\n\n return;\n } // normalize `event.key` when CapsLock is pressed #2372\n\n\n if (\"Proxy\" in window && (!event.shiftKey && /^[A-Z]$/.test(event.key) || event.shiftKey && /^[a-z]$/.test(event.key))) {\n event = new Proxy(event, {\n get(ev, prop) {\n const value = ev[prop];\n\n if (typeof value === \"function\") {\n // fix for Proxies hijacking `this`\n return value.bind(ev);\n }\n\n return prop === \"key\" ? // CapsLock inverts capitalization based on ShiftKey, so invert\n // it back\n event.shiftKey ? ev.key.toUpperCase() : ev.key.toLowerCase() : value;\n }\n\n });\n }\n\n if (!(0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isInputLike)(event.target)) {\n if ((event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.ESCAPE || event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.ENTER) && this.state.croppingElementId) {\n this.finishImageCropping();\n return;\n }\n\n const selectedElements = (0,_scene__WEBPACK_IMPORTED_MODULE_31__.getSelectedElements)(this.scene.getNonDeletedElementsMap(), this.state);\n\n if (selectedElements.length === 1 && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isImageElement)(selectedElements[0]) && event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.ENTER) {\n this.startImageCropping(selectedElements[0]);\n return;\n } // Shape switching\n\n\n if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.ESCAPE) {\n this.updateEditorAtom(_ConvertElementTypePopup__WEBPACK_IMPORTED_MODULE_52__.convertElementTypePopupAtom, null);\n } else if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.TAB && (document.activeElement === ((_a = this.excalidrawContainerRef) === null || _a === void 0 ? void 0 : _a.current) || ((_b = document.activeElement) === null || _b === void 0 ? void 0 : _b.classList.contains(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CLASSES.CONVERT_ELEMENT_TYPE_POPUP)))) {\n event.preventDefault();\n const conversionType = (0,_ConvertElementTypePopup__WEBPACK_IMPORTED_MODULE_52__.getConversionTypeFromElements)(selectedElements);\n\n if (((_c = _editor_jotai__WEBPACK_IMPORTED_MODULE_37__.editorJotaiStore.get(_ConvertElementTypePopup__WEBPACK_IMPORTED_MODULE_52__.convertElementTypePopupAtom)) === null || _c === void 0 ? void 0 : _c.type) === \"panel\") {\n if ((0,_ConvertElementTypePopup__WEBPACK_IMPORTED_MODULE_52__.convertElementTypes)(this, {\n conversionType,\n direction: event.shiftKey ? \"left\" : \"right\"\n })) {\n this.store.scheduleCapture();\n }\n }\n\n if (conversionType) {\n this.updateEditorAtom(_ConvertElementTypePopup__WEBPACK_IMPORTED_MODULE_52__.convertElementTypePopupAtom, {\n type: \"panel\"\n });\n }\n }\n\n if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.ESCAPE && this.flowChartCreator.isCreatingChart) {\n this.flowChartCreator.clear();\n this.triggerRender(true);\n return;\n }\n\n const arrowKeyPressed = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isArrowKey)(event.key);\n\n if (event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] && arrowKeyPressed && !event.shiftKey) {\n event.preventDefault();\n const selectedElements = (0,_scene__WEBPACK_IMPORTED_MODULE_31__.getSelectedElements)(this.scene.getNonDeletedElementsMap(), this.state);\n\n if (selectedElements.length === 1 && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isFlowchartNodeElement)(selectedElements[0])) {\n this.flowChartCreator.createNodes(selectedElements[0], this.state, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getLinkDirectionFromKey)(event.key), this.scene);\n }\n\n if (((_d = this.flowChartCreator.pendingNodes) === null || _d === void 0 ? void 0 : _d.length) && !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElementCompletelyInViewport)(this.flowChartCreator.pendingNodes, this.canvas.width / window.devicePixelRatio, this.canvas.height / window.devicePixelRatio, {\n offsetLeft: this.state.offsetLeft,\n offsetTop: this.state.offsetTop,\n scrollX: this.state.scrollX,\n scrollY: this.state.scrollY,\n zoom: this.state.zoom\n }, this.scene.getNonDeletedElementsMap(), this.getEditorUIOffsets())) {\n this.scrollToContent(this.flowChartCreator.pendingNodes, {\n animate: true,\n duration: 300,\n fitToContent: true,\n canvasOffsets: this.getEditorUIOffsets()\n });\n }\n\n return;\n }\n\n if (event.altKey) {\n const selectedElements = (0,_scene__WEBPACK_IMPORTED_MODULE_31__.getSelectedElements)(this.scene.getNonDeletedElementsMap(), this.state);\n\n if (selectedElements.length === 1 && arrowKeyPressed) {\n event.preventDefault();\n const nextId = this.flowChartNavigator.exploreByDirection(selectedElements[0], this.scene.getNonDeletedElementsMap(), (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getLinkDirectionFromKey)(event.key));\n\n if (nextId) {\n this.setState(prevState => ({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)({\n [nextId]: true\n }, prevState)\n }));\n const nextNode = this.scene.getNonDeletedElementsMap().get(nextId);\n\n if (nextNode && !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElementCompletelyInViewport)([nextNode], this.canvas.width / window.devicePixelRatio, this.canvas.height / window.devicePixelRatio, {\n offsetLeft: this.state.offsetLeft,\n offsetTop: this.state.offsetTop,\n scrollX: this.state.scrollX,\n scrollY: this.state.scrollY,\n zoom: this.state.zoom\n }, this.scene.getNonDeletedElementsMap(), this.getEditorUIOffsets())) {\n this.scrollToContent(nextNode, {\n animate: true,\n duration: 300,\n canvasOffsets: this.getEditorUIOffsets()\n });\n }\n }\n\n return;\n }\n }\n }\n\n if (event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] && event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.P && !event.shiftKey && !event.altKey) {\n this.setToast({\n message: (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"commandPalette.shortcutHint\", {\n shortcut: (0,_actions_shortcuts__WEBPACK_IMPORTED_MODULE_20__.getShortcutFromShortcutName)(\"commandPalette\")\n })\n });\n event.preventDefault();\n return;\n }\n\n if (event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] && event.key.toLowerCase() === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.V) {\n IS_PLAIN_PASTE = event.shiftKey;\n clearTimeout(IS_PLAIN_PASTE_TIMER); // reset (100ms to be safe that we it runs after the ensuing\n // paste event). Though, technically unnecessary to reset since we\n // (re)set the flag before each paste event.\n\n IS_PLAIN_PASTE_TIMER = window.setTimeout(() => {\n IS_PLAIN_PASTE = false;\n }, 100);\n } // prevent browser zoom in input fields\n\n\n if (event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] && (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isWritableElement)(event.target)) {\n if (event.code === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CODES.MINUS || event.code === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CODES.EQUAL) {\n event.preventDefault();\n return;\n }\n } // bail if\n\n\n if ( // inside an input\n (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isWritableElement)(event.target) && // unless pressing escape (finalize action)\n event.key !== _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.ESCAPE || // or unless using arrows (to move between buttons)\n (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isArrowKey)(event.key) && (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isInputLike)(event.target)) {\n return;\n } //mfuria #329. open context menu with 'm' if not editing text and container focused\n\n\n if ((0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_70__.isPanWithRightMouseEnabled)() && event.key.toLowerCase() === 'm' && !this.state.editingTextElement && // don't trigger when typing in inputs\n !(0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isInputLike)(event.target) && ( // ensure focus is within excalidraw container\n (_f = (_e = this.excalidrawContainerRef) === null || _e === void 0 ? void 0 : _e.current) === null || _f === void 0 ? void 0 : _f.contains(document.activeElement))) {\n // open context menu at current cursor position\n const container = this.excalidrawContainerRef.current;\n const {\n top: offsetTop,\n left: offsetLeft\n } = container.getBoundingClientRect();\n const left = this.lastViewportPosition.x - offsetLeft;\n const top = this.lastViewportPosition.y - offsetTop;\n const {\n x,\n y\n } = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)({\n clientX: this.lastViewportPosition.x,\n clientY: this.lastViewportPosition.y\n }, this.state);\n const element = this.getElementAtPosition(x, y, {\n preferSelected: true,\n includeLockedElements: true\n });\n const selectedElements = this.scene.getSelectedElements(this.state);\n const isHittingCommonBoundBox = this.isHittingCommonBoundingBoxOfSelectedElements({\n x,\n y\n }, selectedElements);\n const type = element || isHittingCommonBoundBox ? 'element' : 'canvas';\n this.setState({\n contextMenu: {\n top,\n left,\n items: this.getContextMenuItems(type)\n }\n });\n event.preventDefault();\n return;\n }\n\n if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.QUESTION_MARK) {\n this.setState({\n openDialog: {\n name: \"help\"\n }\n });\n return;\n } else if (event.key.toLowerCase() === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.E && event.shiftKey && event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD]) {\n event.preventDefault();\n this.setState({\n openDialog: {\n name: \"imageExport\"\n }\n });\n return;\n }\n\n if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.PAGE_UP || event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.PAGE_DOWN) {\n let offset = (event.shiftKey ? this.state.width : this.state.height) / this.state.zoom.value;\n\n if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.PAGE_DOWN) {\n offset = -offset;\n }\n\n if (event.shiftKey) {\n this.translateCanvas(state => ({\n scrollX: state.scrollX + offset\n }));\n } else {\n this.translateCanvas(state => ({\n scrollY: state.scrollY + offset\n }));\n }\n }\n\n if (((_g = this.state.openDialog) === null || _g === void 0 ? void 0 : _g.name) === \"elementLinkSelector\") {\n return;\n }\n\n if (this.actionManager.handleKeyDown(event)) {\n return;\n }\n\n if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.K && !event.altKey && !event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD]) {\n if ((0,_appState__WEBPACK_IMPORTED_MODULE_23__.isLaserPointerActive)(this.state)) {\n this.setActiveTool({\n type: \"selection\"\n });\n } else {\n this.setActiveTool({\n type: \"laser\"\n });\n }\n\n return;\n }\n\n if (this.state.viewModeEnabled) {\n //revert to hand in case a key is pressed (K is handled above)\n if (event.key !== _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.K) {\n this.setActiveTool({\n type: \"selection\"\n });\n }\n\n return;\n }\n\n if (event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] && this.state.isBindingEnabled) {\n this.setState({\n isBindingEnabled: false\n });\n }\n\n if ((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isArrowKey)(event.key)) {\n let selectedElements = this.scene.getSelectedElements({\n selectedElementIds: this.state.selectedElementIds,\n includeBoundTextElement: true,\n includeElementsInFrames: true\n });\n const elbowArrow = selectedElements.find(_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow);\n const arrowIdsToRemove = new Set();\n selectedElements.filter(_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow).filter(arrow => {\n const startElementNotInSelection = arrow.startBinding && !selectedElements.some(el => {\n var _a;\n\n return el.id === ((_a = arrow.startBinding) === null || _a === void 0 ? void 0 : _a.elementId);\n });\n const endElementNotInSelection = arrow.endBinding && !selectedElements.some(el => {\n var _a;\n\n return el.id === ((_a = arrow.endBinding) === null || _a === void 0 ? void 0 : _a.elementId);\n });\n return startElementNotInSelection || endElementNotInSelection;\n }).forEach(arrow => arrowIdsToRemove.add(arrow.id));\n selectedElements = selectedElements.filter(el => !arrowIdsToRemove.has(el.id));\n const step = this.getEffectiveGridSize() && (event.shiftKey ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.ELEMENT_TRANSLATE_AMOUNT : this.getEffectiveGridSize()) || (event.shiftKey ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.ELEMENT_SHIFT_TRANSLATE_AMOUNT : _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.ELEMENT_TRANSLATE_AMOUNT);\n let offsetX = 0;\n let offsetY = 0;\n\n if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.ARROW_LEFT) {\n offsetX = -step;\n } else if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.ARROW_RIGHT) {\n offsetX = step;\n } else if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.ARROW_UP) {\n offsetY = -step;\n } else if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.ARROW_DOWN) {\n offsetY = step;\n }\n\n selectedElements.forEach(element => {\n this.scene.mutateElement(element, {\n x: element.x + offsetX,\n y: element.y + offsetY\n }, {\n informMutation: false,\n isDragging: false\n });\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.updateBoundElements)(element, this.scene, {\n simultaneouslyUpdated: selectedElements\n });\n });\n this.setState({\n suggestedBindings: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getSuggestedBindingsForArrows)(selectedElements.filter(element => element.id !== (elbowArrow === null || elbowArrow === void 0 ? void 0 : elbowArrow.id) || step !== 0), this.scene.getNonDeletedElementsMap(), this.state.zoom)\n });\n this.scene.triggerUpdate();\n event.preventDefault();\n } else if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.ENTER) {\n const selectedElements = this.scene.getSelectedElements(this.state);\n\n if (selectedElements.length === 1) {\n const selectedElement = selectedElements[0];\n\n if (event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLineElement)(selectedElement)) {\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLinearElement)(selectedElement)) {\n if (!((_h = this.state.selectedLinearElement) === null || _h === void 0 ? void 0 : _h.isEditing) || this.state.selectedLinearElement.elementId !== selectedElement.id) {\n this.store.scheduleCapture();\n\n if (!(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(selectedElement)) {\n this.actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_8__.actionToggleLinearEditor);\n }\n }\n }\n } else if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isTextElement)(selectedElement) || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isValidTextContainer)(selectedElement)) {\n let container;\n\n if (!(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isTextElement)(selectedElement)) {\n container = selectedElement;\n }\n\n const midPoint = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getContainerCenter)(selectedElement, this.state, this.scene.getNonDeletedElementsMap());\n const sceneX = midPoint.x;\n const sceneY = midPoint.y;\n this.startTextEditing({\n sceneX,\n sceneY,\n container\n });\n event.preventDefault();\n return;\n } else if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isFrameLikeElement)(selectedElement)) {\n this.setState({\n editingFrame: selectedElement.id\n });\n } else if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isEmbeddableElement)(selectedElement)) {\n //zsviczian\n this.setState({\n activeEmbeddable: {\n element: selectedElement,\n state: \"active\"\n }\n });\n }\n }\n } else if (!event.ctrlKey && !event.altKey && !event.metaKey && !this.state.newElement && !this.state.selectionElement && !this.state.selectedElementsAreBeingDragged) {\n const shape = (0,_shapes__WEBPACK_IMPORTED_MODULE_68__.findShapeByKey)(event.key, this);\n\n if (shape) {\n if (this.state.activeTool.type !== shape) {\n (0,_analytics__WEBPACK_IMPORTED_MODULE_21__.trackEvent)(\"toolbar\", shape, `keyboard (${this.editorInterface.formFactor === \"phone\" ? \"mobile\" : \"desktop\"})`);\n }\n\n if (shape === \"arrow\" && this.state.activeTool.type === \"arrow\") {\n this.setState(prevState => ({\n currentItemArrowType: prevState.currentItemArrowType === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.ARROW_TYPE.sharp ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.ARROW_TYPE.round : prevState.currentItemArrowType === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.ARROW_TYPE.round ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.ARROW_TYPE.elbow : _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.ARROW_TYPE.sharp\n }));\n }\n\n this.setActiveTool({\n type: shape\n });\n event.stopPropagation();\n } else if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.Q) {\n this.toggleLock(\"keyboard\");\n event.stopPropagation();\n }\n }\n\n if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.SPACE && gesture.pointers.size === 0) {\n isHoldingSpace = true;\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.GRAB);\n event.preventDefault();\n }\n\n if ((event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.G || event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.S) && !event.altKey && !event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD]) {\n const selectedElements = this.scene.getSelectedElements(this.state);\n\n if (this.state.activeTool.type === \"selection\" && !selectedElements.length) {\n return;\n }\n\n if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.G && ((0,_scene__WEBPACK_IMPORTED_MODULE_31__.hasBackground)(this.state.activeTool.type) || selectedElements.some(element => (0,_scene__WEBPACK_IMPORTED_MODULE_31__.hasBackground)(element.type)))) {\n this.setState({\n openPopup: \"elementBackground\"\n });\n event.stopPropagation();\n }\n\n if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.S) {\n this.setState({\n openPopup: \"elementStroke\"\n });\n event.stopPropagation();\n }\n }\n\n if (!event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] && event.shiftKey && event.key.toLowerCase() === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.F) {\n const selectedElements = this.scene.getSelectedElements(this.state);\n\n if (this.state.activeTool.type === \"selection\" && !selectedElements.length) {\n return;\n }\n\n if (this.state.activeTool.type === \"text\" || selectedElements.find(element => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isTextElement)(element) || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getBoundTextElement)(element, this.scene.getNonDeletedElementsMap()))) {\n event.preventDefault();\n this.setState({\n openPopup: \"fontFamily\"\n });\n }\n }\n\n if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.K && !event.altKey && !event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD]) {\n if (this.state.activeTool.type === \"laser\") {\n this.setActiveTool({\n type: this.state.preferredSelectionTool.type\n });\n } else {\n this.setActiveTool({\n type: \"laser\"\n });\n }\n\n return;\n }\n\n if (event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] && (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.BACKSPACE || event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.DELETE)) {\n this.updateEditorAtom(_ActiveConfirmDialog__WEBPACK_IMPORTED_MODULE_53__.activeConfirmDialogAtom, \"clearCanvas\");\n } // eye dropper\n // -----------------------------------------------------------------------\n\n\n const lowerCased = event.key.toLocaleLowerCase();\n const isPickingStroke = lowerCased === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.S && event.shiftKey;\n const isPickingBackground = event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.I || lowerCased === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.G && event.shiftKey;\n\n if (isPickingStroke || isPickingBackground) {\n this.openEyeDropper({\n type: isPickingStroke ? \"stroke\" : \"background\"\n });\n } // -----------------------------------------------------------------------\n\n });\n this.onKeyUp = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(event => {\n var _a, _b, _c, _d, _e;\n\n if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.SPACE) {\n if (this.state.viewModeEnabled || ((_a = this.state.openDialog) === null || _a === void 0 ? void 0 : _a.name) === \"elementLinkSelector\") {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.GRAB);\n } else if (this.state.activeTool.type === \"selection\" || this.state.activeTool.type === \"lasso\") {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.resetCursor)(this.interactiveCanvas);\n } else {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursorForShape)(this.interactiveCanvas, this.state);\n this.setState({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)({}, this.state),\n selectedGroupIds: {},\n editingGroupId: null,\n activeEmbeddable: null\n });\n }\n\n isHoldingSpace = false;\n }\n\n if (!event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] && !this.state.isBindingEnabled) {\n this.setState({\n isBindingEnabled: true\n });\n }\n\n if ((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isArrowKey)(event.key)) {\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.bindOrUnbindLinearElements)(this.scene.getSelectedElements(this.state).filter(_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLinearElement), (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isBindingEnabled)(this.state), (_c = (_b = this.state.selectedLinearElement) === null || _b === void 0 ? void 0 : _b.selectedPointsIndices) !== null && _c !== void 0 ? _c : [], this.scene, this.state.zoom);\n this.setState({\n suggestedBindings: []\n });\n }\n\n if (!event.altKey) {\n if (this.flowChartNavigator.isExploring) {\n this.flowChartNavigator.clear();\n this.syncActionResult({\n captureUpdate: _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.CaptureUpdateAction.IMMEDIATELY\n });\n }\n }\n\n if (!event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD]) {\n if (this.flowChartCreator.isCreatingChart) {\n if ((_d = this.flowChartCreator.pendingNodes) === null || _d === void 0 ? void 0 : _d.length) {\n this.scene.insertElements(this.flowChartCreator.pendingNodes);\n }\n\n const firstNode = (_e = this.flowChartCreator.pendingNodes) === null || _e === void 0 ? void 0 : _e[0];\n\n if (firstNode) {\n this.setState(prevState => ({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)({\n [firstNode.id]: true\n }, prevState)\n }));\n\n if (!(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElementCompletelyInViewport)([firstNode], this.canvas.width / window.devicePixelRatio, this.canvas.height / window.devicePixelRatio, {\n offsetLeft: this.state.offsetLeft,\n offsetTop: this.state.offsetTop,\n scrollX: this.state.scrollX,\n scrollY: this.state.scrollY,\n zoom: this.state.zoom\n }, this.scene.getNonDeletedElementsMap(), this.getEditorUIOffsets())) {\n this.scrollToContent(firstNode, {\n animate: true,\n duration: 300,\n canvasOffsets: this.getEditorUIOffsets()\n });\n }\n }\n\n this.flowChartCreator.clear();\n this.syncActionResult({\n captureUpdate: _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.CaptureUpdateAction.IMMEDIATELY\n });\n }\n }\n }); // We purposely widen the `tool` type so this helper can be called with\n // any tool without having to type check it\n\n this.isToolSupported = tool => {\n var _a;\n\n return ((_a = this.props.UIOptions.tools) === null || _a === void 0 ? void 0 : _a[tool]) !== false;\n };\n\n this.setActiveTool = (tool, keepSelection = false) => {\n if (!this.isToolSupported(tool.type)) {\n console.warn(`\"${tool.type}\" tool is disabled via \"UIOptions.canvasActions.tools.${tool.type}\"`);\n return;\n }\n\n const nextActiveTool = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateActiveTool)(this.state, tool);\n\n if (nextActiveTool.type === \"hand\") {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.GRAB);\n } else if (!isHoldingSpace) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursorForShape)(this.interactiveCanvas, Object.assign(Object.assign({}, this.state), {\n activeTool: nextActiveTool\n }));\n }\n\n if ((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isToolIcon)(document.activeElement)) {\n this.focusContainer();\n }\n\n if (!(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLinearElementType)(nextActiveTool.type)) {\n this.setState({\n suggestedBindings: []\n });\n }\n\n if (nextActiveTool.type === \"image\") {\n this.onImageToolbarButtonClick();\n }\n\n setTimeout(() => {\n this.setState(prevState => {\n const commonResets = {\n snapLines: prevState.snapLines.length ? [] : prevState.snapLines,\n originSnapOffset: null,\n activeEmbeddable: null\n };\n\n if (nextActiveTool.type === \"freedraw\") {\n this.store.scheduleCapture();\n }\n\n if (nextActiveTool.type === \"lasso\") {\n return Object.assign(Object.assign(Object.assign(Object.assign({}, prevState), {\n activeTool: nextActiveTool\n }), keepSelection ? {} : {\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)({}, prevState),\n selectedGroupIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)({}, prevState),\n editingGroupId: null,\n multiElement: null\n }), commonResets);\n } else if (nextActiveTool.type !== \"selection\") {\n return Object.assign(Object.assign(Object.assign({}, prevState), {\n activeTool: nextActiveTool,\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)(nextActiveTool.type === \"mermaid\" //zsviczian\n ? this.state.selectedElementIds : {}, prevState),\n selectedGroupIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)({}, prevState),\n editingGroupId: null,\n multiElement: null\n }), commonResets);\n }\n\n return Object.assign(Object.assign(Object.assign({}, prevState), {\n activeTool: nextActiveTool\n }), commonResets);\n });\n }); //zsviczian added timeout because button won't select otherwise\n };\n\n this.setOpenDialog = dialogType => {\n this.setState({\n openDialog: dialogType\n });\n };\n\n this.setCursor = cursor => {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, cursor);\n };\n\n this.resetCursor = () => {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.resetCursor)(this.interactiveCanvas);\n };\n /**\r\n * returns whether user is making a gesture with >= 2 fingers (points)\r\n * on o touch screen (not on a trackpad). Currently only relates to Darwin\r\n * (iOS/iPadOS,MacOS), but may work on other devices in the future if\r\n * GestureEvent is standardized.\r\n */\n\n\n this.isTouchScreenMultiTouchGesture = () => {\n // we don't want to deselect when using trackpad, and multi-point gestures\n // only work on touch screens, so checking for >= pointers means we're on a\n // touchscreen\n return gesture.pointers.size >= 2;\n };\n\n this.getName = () => {\n return this.state.name || this.props.name || `${(0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"labels.untitled\")}-${(0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getDateTime)()}`;\n }; // fires only on Safari\n\n\n this.onGestureStart = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(event => {\n //zsviczian - start\n // If an embeddable is active and the pinch starts over it, let it handle the gesture.\n if ((0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_70__.shouldDisableZoom)(this.state)) {\n gesture.initialScale = null;\n return;\n }\n\n event.preventDefault(); // we only want to deselect on touch screens because user may have selected\n // elements by mistake while zooming\n\n if (this.isTouchScreenMultiTouchGesture()) {\n this.setState({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)({}, this.state),\n activeEmbeddable: null\n });\n }\n\n gesture.initialScale = this.state.zoom.value;\n }); // fires only on Safari\n\n this.onGestureChange = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(event => {\n //zsviczian\n if (!gesture.initialScale) {\n return;\n }\n\n event.preventDefault(); // onGestureChange only has zoom factor but not the center.\n // If we're on iPad or iPhone, then we recognize multi-touch and will\n // zoom in at the right location in the touchmove handler\n // (handleCanvasPointerMove).\n //\n // On Macbook trackpad, we don't have those events so will zoom in at the\n // current location instead.\n //\n // As such, bail from this handler on touch devices.\n\n if (this.isTouchScreenMultiTouchGesture()) {\n return;\n }\n\n const initialScale = gesture.initialScale;\n\n if (initialScale) {\n this.setState(state => Object.assign({}, (0,_scene_zoom__WEBPACK_IMPORTED_MODULE_32__.getStateForZoom)({\n viewportX: this.lastViewportPosition.x,\n viewportY: this.lastViewportPosition.y,\n nextZoom: (0,_scene__WEBPACK_IMPORTED_MODULE_31__.getNormalizedZoom)(initialScale * event.scale)\n }, state)));\n }\n }); // fires only on Safari\n\n this.onGestureEnd = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(event => {\n event.preventDefault(); // reselect elements only on touch screens (see onGestureStart)\n\n if (this.isTouchScreenMultiTouchGesture()) {\n this.setState({\n previousSelectedElementIds: {},\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)(this.state.previousSelectedElementIds, this.state)\n });\n }\n\n gesture.initialScale = null;\n });\n\n this.startTextEditing = ({\n sceneX,\n sceneY,\n insertAtParentCenter = true,\n container,\n autoEdit = true\n }) => {\n var _a;\n\n let shouldBindToContainer = false;\n let parentCenterPosition = insertAtParentCenter && this.getTextWysiwygSnappedToCenterPosition(sceneX, sceneY, this.state, container);\n\n if (container && parentCenterPosition) {\n const boundTextElementToContainer = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getBoundTextElement)(container, this.scene.getNonDeletedElementsMap());\n\n if (!boundTextElementToContainer) {\n shouldBindToContainer = true;\n }\n }\n\n let existingTextElement = null;\n const selectedElements = this.scene.getSelectedElements(this.state);\n\n if (selectedElements.length === 1) {\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isTextElement)(selectedElements[0])) {\n existingTextElement = selectedElements[0];\n } else if (container) {\n existingTextElement = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getBoundTextElement)(selectedElements[0], this.scene.getNonDeletedElementsMap());\n } else {\n existingTextElement = this.getTextElementAtPosition(sceneX, sceneY);\n }\n } else {\n existingTextElement = this.getTextElementAtPosition(sceneX, sceneY);\n }\n\n const fontFamily = (existingTextElement === null || existingTextElement === void 0 ? void 0 : existingTextElement.fontFamily) || this.state.currentItemFontFamily;\n const lineHeight = (existingTextElement === null || existingTextElement === void 0 ? void 0 : existingTextElement.lineHeight) || (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getLineHeight)(fontFamily);\n const fontSize = (0,_actions_actionProperties__WEBPACK_IMPORTED_MODULE_72__.getFontSize)(this.state.currentItemFontSize, this.state.zoom.value); //zsviczian\n\n if (!existingTextElement && shouldBindToContainer && container && !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isArrowElement)(container)) {\n const fontString = {\n fontSize,\n fontFamily\n };\n const minWidth = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getApproxMinLineWidth)((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getFontString)(fontString), lineHeight);\n const minHeight = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getApproxMinLineHeight)(fontSize, lineHeight);\n const newHeight = Math.max(container.height, minHeight);\n const newWidth = Math.max(container.width, minWidth);\n this.scene.mutateElement(container, {\n height: newHeight,\n width: newWidth\n });\n sceneX = container.x + newWidth / 2;\n sceneY = container.y + newHeight / 2;\n\n if (parentCenterPosition) {\n parentCenterPosition = this.getTextWysiwygSnappedToCenterPosition(sceneX, sceneY, this.state, container);\n }\n }\n\n const topLayerFrame = this.getTopLayerFrameAtSceneCoords({\n x: sceneX,\n y: sceneY\n });\n const element = existingTextElement || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newTextElement)({\n x: parentCenterPosition ? parentCenterPosition.elementCenterX : sceneX,\n y: parentCenterPosition ? parentCenterPosition.elementCenterY : sceneY,\n strokeColor: this.state.currentItemStrokeColor,\n backgroundColor: this.state.currentItemBackgroundColor,\n fillStyle: this.state.currentItemFillStyle,\n strokeWidth: this.state.currentItemStrokeWidth,\n strokeStyle: this.state.currentItemStrokeStyle,\n roughness: this.state.currentItemRoughness,\n opacity: this.state.currentItemOpacity,\n text: \"\",\n rawText: \"\",\n fontSize,\n fontFamily,\n textAlign: parentCenterPosition ? \"center\" : this.state.currentItemTextAlign,\n verticalAlign: parentCenterPosition ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.VERTICAL_ALIGN.MIDDLE : _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.DEFAULT_VERTICAL_ALIGN,\n containerId: shouldBindToContainer ? container === null || container === void 0 ? void 0 : container.id : undefined,\n groupIds: (_a = container === null || container === void 0 ? void 0 : container.groupIds) !== null && _a !== void 0 ? _a : [],\n lineHeight,\n angle: container ? (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isArrowElement)(container) ? 0 : container.angle : 0,\n frameId: topLayerFrame ? topLayerFrame.id : null\n });\n\n if (!existingTextElement && shouldBindToContainer && container) {\n this.scene.mutateElement(container, {\n boundElements: (container.boundElements || []).concat({\n type: \"text\",\n id: element.id\n })\n });\n }\n\n this.setState({\n editingTextElement: element\n });\n\n if (!existingTextElement) {\n if (container && shouldBindToContainer) {\n const containerIndex = this.scene.getElementIndex(container.id);\n this.scene.insertElementAtIndex(element, containerIndex + 1);\n } else {\n this.scene.insertElement(element);\n }\n }\n\n if (autoEdit || existingTextElement || container) {\n this.handleTextWysiwyg(element, {\n isExistingElement: !!existingTextElement\n });\n } else {\n this.setState({\n newElement: element,\n multiElement: null\n });\n }\n };\n\n this.debounceDoubleClickTimestamp = 0; //zsviczian\n\n this.startImageCropping = image => {\n this.store.scheduleCapture();\n this.setState({\n croppingElementId: image.id\n });\n };\n\n this.finishImageCropping = () => {\n if (this.state.croppingElementId) {\n this.store.scheduleCapture();\n this.setState({\n croppingElementId: null\n });\n }\n };\n\n this.handleCanvasDoubleClick = event => {\n var _a, _b, _c, _d; // case: double-clicking with arrow/line tool selected would both create\n // text and enter multiElement mode\n\n\n if (this.state.multiElement) {\n return;\n }\n\n if ( //zsviczian - double click eraser\n this.state.penMode && (0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_70__.allowDoubleTapEraser)() && ((_a = this.lastPointerDownEvent) === null || _a === void 0 ? void 0 : _a.pointerType) === \"touch\" && this.state.activeTool.type !== \"selection\") {\n const now = Date.now();\n\n if (now - this.debounceDoubleClickTimestamp < 200) {\n //handleCanvasDoubleClick click fires twice in case of touch.\n //Once from the onTouchStart event handler, once from the double click event handler\n return;\n }\n\n this.debounceDoubleClickTimestamp = now;\n this.updateScene(_actions_actionCanvas__WEBPACK_IMPORTED_MODULE_10__.actionToggleEraserTool.perform([], this.state, null, this));\n return;\n } // zsviczian - end\n // we should only be able to double click when mode is selection\n\n\n if (this.state.activeTool.type !== this.state.preferredSelectionTool.type) {\n return;\n }\n\n const selectedElements = this.scene.getSelectedElements(this.state);\n let {\n x: sceneX,\n y: sceneY\n } = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)(event, this.state);\n\n if (selectedElements.length === 1 && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLinearElement)(selectedElements[0])) {\n const selectedLinearElement = selectedElements[0];\n\n if ((event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isSimpleArrow)(selectedLinearElement) || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLineElement)(selectedLinearElement)) && (!((_b = this.state.selectedLinearElement) === null || _b === void 0 ? void 0 : _b.isEditing) || this.state.selectedLinearElement.elementId !== selectedLinearElement.id)) {\n // Use the proper action to ensure immediate history capture\n this.actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_8__.actionToggleLinearEditor);\n return;\n } else if (this.state.selectedLinearElement && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(selectedElements[0])) {\n const hitCoords = _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.getSegmentMidpointHitCoords(this.state.selectedLinearElement, {\n x: sceneX,\n y: sceneY\n }, this.state, this.scene.getNonDeletedElementsMap());\n const midPoint = hitCoords ? _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.getSegmentMidPointIndex(this.state.selectedLinearElement, this.state, hitCoords, this.scene.getNonDeletedElementsMap()) : -1;\n\n if (midPoint && midPoint > -1) {\n this.store.scheduleCapture();\n _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.deleteFixedSegment(selectedElements[0], this.scene, midPoint);\n const nextCoords = _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.getSegmentMidpointHitCoords(Object.assign(Object.assign({}, this.state.selectedLinearElement), {\n segmentMidPointHoveredCoords: null\n }), {\n x: sceneX,\n y: sceneY\n }, this.state, this.scene.getNonDeletedElementsMap());\n const nextIndex = nextCoords ? _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.getSegmentMidPointIndex(this.state.selectedLinearElement, this.state, nextCoords, this.scene.getNonDeletedElementsMap()) : null;\n this.setState({\n selectedLinearElement: Object.assign(Object.assign({}, this.state.selectedLinearElement), {\n pointerDownState: Object.assign(Object.assign({}, this.state.selectedLinearElement.pointerDownState), {\n segmentMidpoint: {\n index: nextIndex,\n value: hitCoords,\n added: false\n }\n }),\n segmentMidPointHoveredCoords: nextCoords\n })\n });\n return;\n }\n } else if (((_c = this.state.selectedLinearElement) === null || _c === void 0 ? void 0 : _c.isEditing) && this.state.selectedLinearElement.elementId === selectedLinearElement.id && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLineElement)(selectedLinearElement)) {\n return;\n }\n }\n\n if (selectedElements.length === 1 && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isImageElement)(selectedElements[0])) {\n this.startImageCropping(selectedElements[0]);\n return;\n }\n\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.resetCursor)(this.interactiveCanvas);\n const selectedGroupIds = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getSelectedGroupIds)(this.state);\n\n if (selectedGroupIds.length > 0) {\n const hitElement = this.getElementAtPosition(sceneX, sceneY);\n const selectedGroupId = hitElement && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getSelectedGroupIdForElement)(hitElement, this.state.selectedGroupIds);\n\n if (selectedGroupId) {\n this.store.scheduleCapture();\n this.setState(prevState => Object.assign(Object.assign({}, prevState), (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.selectGroupsForSelectedElements)({\n editingGroupId: selectedGroupId,\n selectedElementIds: {\n [hitElement.id]: true\n }\n }, this.scene.getNonDeletedElements(), prevState, this)));\n return;\n }\n }\n\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.resetCursor)(this.interactiveCanvas);\n\n if (!event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] && !this.state.viewModeEnabled) {\n const hitElement = this.getElementAtPosition(sceneX, sceneY);\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isIframeLikeElement)(hitElement)) {\n this.setState({\n activeEmbeddable: {\n element: hitElement,\n state: \"active\"\n }\n });\n return;\n } // shouldn't edit/create text when inside line editor (often false positive)\n\n\n if (!((_d = this.state.selectedLinearElement) === null || _d === void 0 ? void 0 : _d.isEditing)) {\n const container = this.getTextBindableContainerAtPosition(sceneX, sceneY);\n\n if (container) {\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.hasBoundTextElement)(container) || !(0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isTransparent)(container.backgroundColor) || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.hitElementItself)({\n point: (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(sceneX, sceneY),\n element: container,\n elementsMap: this.scene.getNonDeletedElementsMap(),\n threshold: this.getElementHitThreshold(container)\n })) {\n const midPoint = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getContainerCenter)(container, this.state, this.scene.getNonDeletedElementsMap());\n sceneX = midPoint.x;\n sceneY = midPoint.y;\n }\n } //zsviczian Disable double click text create, but allow double click edit\n\n\n if ((0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_70__.disableDoubleClickTextEditing)()) {\n let existingTextElement = null;\n const selectedElements = this.scene.getSelectedElements(this.state);\n\n if (selectedElements.length === 1) {\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isTextElement)(selectedElements[0])) {\n existingTextElement = selectedElements[0];\n } else if (container) {\n existingTextElement = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getBoundTextElement)(selectedElements[0], this.scene.getNonDeletedElementsMap());\n } else {\n existingTextElement = this.getTextElementAtPosition(sceneX, sceneY);\n }\n } else {\n existingTextElement = this.getTextElementAtPosition(sceneX, sceneY);\n }\n\n if (!existingTextElement) {\n return;\n }\n }\n\n this.startTextEditing({\n sceneX,\n sceneY,\n insertAtParentCenter: !event.altKey,\n container\n });\n }\n }\n };\n\n this.getElementLinkAtPosition = (scenePointer, hitElementMightBeLocked) => {\n if (hitElementMightBeLocked && hitElementMightBeLocked.locked) {\n return undefined;\n }\n\n const elements = this.scene.getNonDeletedElements();\n let hitElementIndex = -1;\n\n for (let index = elements.length - 1; index >= 0; index--) {\n const element = elements[index];\n\n if (hitElementMightBeLocked && element.id === hitElementMightBeLocked.id) {\n hitElementIndex = index;\n }\n\n if (element.link && index >= hitElementIndex && (0,_hyperlink_helpers__WEBPACK_IMPORTED_MODULE_65__.isPointHittingLink)(element, this.scene.getNonDeletedElementsMap(), this.state, (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(scenePointer.x, scenePointer.y), this.editorInterface.formFactor === \"phone\")) {\n return element;\n }\n }\n };\n\n this.redirectToLink = (event, isTouchScreen) => {\n const draggedDistance = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointDistance)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(this.lastPointerDownEvent.clientX, this.lastPointerDownEvent.clientY), (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(this.lastPointerUpEvent.clientX, this.lastPointerUpEvent.clientY));\n\n if (!this.hitLinkElement || draggedDistance > _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.DRAGGING_THRESHOLD) {\n return;\n }\n\n const lastPointerDownCoords = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)(this.lastPointerDownEvent, this.state);\n const elementsMap = this.scene.getNonDeletedElementsMap();\n const lastPointerDownHittingLinkIcon = (0,_hyperlink_helpers__WEBPACK_IMPORTED_MODULE_65__.isPointHittingLink)(this.hitLinkElement, elementsMap, this.state, (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(lastPointerDownCoords.x, lastPointerDownCoords.y), this.editorInterface.formFactor === \"phone\");\n const lastPointerUpCoords = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)(this.lastPointerUpEvent, this.state);\n const lastPointerUpHittingLinkIcon = (0,_hyperlink_helpers__WEBPACK_IMPORTED_MODULE_65__.isPointHittingLink)(this.hitLinkElement, elementsMap, this.state, (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(lastPointerUpCoords.x, lastPointerUpCoords.y), this.editorInterface.formFactor === \"phone\");\n\n if (lastPointerDownHittingLinkIcon && lastPointerUpHittingLinkIcon) {\n (0,_components_hyperlink_Hyperlink__WEBPACK_IMPORTED_MODULE_35__.hideHyperlinkToolip)();\n let url = this.hitLinkElement.link;\n\n if (url) {\n url = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.normalizeLink)(url);\n let customEvent;\n\n if (this.props.onLinkOpen) {\n customEvent = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.wrapEvent)(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.EXCALIDRAW_LINK, event.nativeEvent);\n this.props.onLinkOpen(Object.assign(Object.assign({}, this.hitLinkElement), {\n link: url\n }), customEvent);\n }\n\n if (!(customEvent === null || customEvent === void 0 ? void 0 : customEvent.defaultPrevented)) {\n const target = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isLocalLink)(url) ? \"_self\" : \"_blank\";\n const newWindow = window.open(undefined, target); // https://mathiasbynens.github.io/rel-noopener/\n\n if (newWindow) {\n newWindow.opener = null;\n newWindow.location = url;\n }\n }\n }\n }\n };\n\n this.getTopLayerFrameAtSceneCoords = sceneCoords => {\n const elementsMap = this.scene.getNonDeletedElementsMap();\n const frames = this.scene.getNonDeletedFramesLikes().filter(frame => !frame.locked && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isCursorInFrame)(sceneCoords, frame, elementsMap) && frame.frameRole !== \"marker\");\n return frames.length ? frames[frames.length - 1] : null;\n };\n\n this.handleCanvasPointerMove = event => {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j;\n\n this.savePointer(event.clientX, event.clientY, this.state.cursorButton);\n this.lastPointerMoveEvent = event.nativeEvent;\n\n if (gesture.pointers.has(event.pointerId)) {\n gesture.pointers.set(event.pointerId, {\n x: event.clientX,\n y: event.clientY\n });\n }\n\n const initialScale = gesture.initialScale;\n\n if (gesture.pointers.size === 2 && gesture.lastCenter && initialScale && gesture.initialDistance) {\n const center = (0,_gesture__WEBPACK_IMPORTED_MODULE_28__.getCenter)(gesture.pointers);\n const deltaX = center.x - gesture.lastCenter.x;\n const deltaY = center.y - gesture.lastCenter.y;\n gesture.lastCenter = center;\n const distance = (0,_gesture__WEBPACK_IMPORTED_MODULE_28__.getDistance)(Array.from(gesture.pointers.values()));\n const scaleFactor = !this.state.allowPinchZoom && //zsviczian\n this.state.activeTool.type === \"freedraw\" && this.state.penMode ? 1 : distance / gesture.initialDistance;\n const nextZoom = scaleFactor ? (0,_scene__WEBPACK_IMPORTED_MODULE_31__.getNormalizedZoom)(initialScale * scaleFactor) : this.state.zoom.value;\n this.setState(state => {\n const zoomState = (0,_scene_zoom__WEBPACK_IMPORTED_MODULE_32__.getStateForZoom)({\n viewportX: center.x,\n viewportY: center.y,\n nextZoom\n }, state);\n this.translateCanvas({\n zoom: zoomState.zoom,\n // 2x multiplier is just a magic number that makes this work correctly\n // on touchscreen devices (note: if we get report that panning is slower/faster\n // than actual movement, consider swapping with devicePixelRatio)\n scrollX: zoomState.scrollX + 2 * (deltaX / nextZoom),\n scrollY: zoomState.scrollY + 2 * (deltaY / nextZoom),\n shouldCacheIgnoreZoom: true\n });\n });\n this.resetShouldCacheIgnoreZoomDebounced();\n } else {\n gesture.lastCenter = gesture.initialDistance = gesture.initialScale = null;\n }\n\n if (isHoldingSpace || isPanning || isDraggingScrollBar || (0,_appState__WEBPACK_IMPORTED_MODULE_23__.isHandToolActive)(this.state)) {\n return;\n }\n\n const isPointerOverScrollBars = (0,_scene_scrollbars__WEBPACK_IMPORTED_MODULE_47__.isOverScrollBars)(currentScrollBars, event.clientX - this.state.offsetLeft, event.clientY - this.state.offsetTop);\n const isOverScrollBar = isPointerOverScrollBars.isOverEither;\n const isPenFreedraw = this.state.activeTool.type === \"freedraw\" && event.pointerType === \"pen\"; //zsviczian\n\n if (!this.state.newElement && !this.state.selectionElement && !this.state.selectedElementsAreBeingDragged && !this.state.multiElement) {\n if (isOverScrollBar) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.resetCursor)(this.interactiveCanvas);\n } else if (isPenFreedraw && this.interactiveCanvas && (0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_70__.hideFreedrawPenmodeCursor)()) {\n //zsviczian https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/1659\n this.interactiveCanvas.style.cursor = \"none\";\n } else {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursorForShape)(this.interactiveCanvas, this.state);\n }\n }\n\n const scenePointer = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)(event, this.state);\n const {\n x: scenePointerX,\n y: scenePointerY\n } = scenePointer;\n\n if (!this.state.newElement && (0,_snapping__WEBPACK_IMPORTED_MODULE_39__.isActiveToolNonLinearSnappable)(this.state.activeTool.type)) {\n const {\n originOffset,\n snapLines\n } = (0,_snapping__WEBPACK_IMPORTED_MODULE_39__.getSnapLinesAtPointer)(this.scene.getNonDeletedElements(), this, {\n x: scenePointerX,\n y: scenePointerY\n }, event, this.scene.getNonDeletedElementsMap());\n this.setState(prevState => {\n const nextSnapLines = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateStable)(prevState.snapLines, snapLines);\n const nextOriginOffset = prevState.originSnapOffset ? (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateStable)(prevState.originSnapOffset, originOffset) : originOffset;\n\n if (prevState.snapLines === nextSnapLines && prevState.originSnapOffset === nextOriginOffset) {\n return null;\n }\n\n return {\n snapLines: nextSnapLines,\n originSnapOffset: nextOriginOffset\n };\n });\n } else if (!this.state.newElement && !this.state.selectedElementsAreBeingDragged && !this.state.selectionElement) {\n this.setState(prevState => {\n if (prevState.snapLines.length) {\n return {\n snapLines: []\n };\n }\n\n return null;\n });\n }\n\n if (((_a = this.state.selectedLinearElement) === null || _a === void 0 ? void 0 : _a.isEditing) && !this.state.selectedLinearElement.isDragging) {\n const editingLinearElement = _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.handlePointerMove(event, scenePointerX, scenePointerY, this);\n const linearElement = editingLinearElement ? this.scene.getElement(editingLinearElement.elementId) : null;\n\n if (editingLinearElement && editingLinearElement !== this.state.selectedLinearElement) {\n // Since we are reading from previous state which is not possible with\n // automatic batching in React 18 hence using flush sync to synchronously\n // update the state. Check https://github.com/excalidraw/excalidraw/pull/5508 for more details.\n (0,react_dom__WEBPACK_IMPORTED_MODULE_3__.flushSync)(() => {\n this.setState({\n selectedLinearElement: editingLinearElement\n });\n });\n }\n\n if ((editingLinearElement === null || editingLinearElement === void 0 ? void 0 : editingLinearElement.lastUncommittedPoint) != null && linearElement && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isBindingElementType)(linearElement.type)) {\n this.maybeSuggestBindingAtCursor(scenePointer, editingLinearElement.elbowed);\n } else if (this.state.suggestedBindings.length) {\n this.setState({\n suggestedBindings: []\n });\n }\n }\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isBindingElementType)(this.state.activeTool.type)) {\n // Hovering with a selected tool or creating new linear element via click\n // and point\n const {\n newElement\n } = this.state;\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isBindingElement)(newElement, false)) {\n this.setState({\n suggestedBindings: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.maybeSuggestBindingsForLinearElementAtCoords)(newElement, [scenePointer], this.scene, this.state.zoom, this.state.startBoundElement)\n });\n } else {\n this.maybeSuggestBindingAtCursor(scenePointer, false);\n }\n }\n\n if (this.state.multiElement) {\n const {\n multiElement\n } = this.state;\n const {\n x: rx,\n y: ry\n } = multiElement;\n const {\n points,\n lastCommittedPoint\n } = multiElement;\n const lastPoint = points[points.length - 1];\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursorForShape)(this.interactiveCanvas, this.state);\n\n if (lastPoint === lastCommittedPoint) {\n // if we haven't yet created a temp point and we're beyond commit-zone\n // threshold, add a point\n if ((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointDistance)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(scenePointerX - rx, scenePointerY - ry), lastPoint) >= _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.LINE_CONFIRM_THRESHOLD) {\n this.scene.mutateElement(multiElement, {\n points: [...points, (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(scenePointerX - rx, scenePointerY - ry)]\n }, {\n informMutation: false,\n isDragging: false\n });\n } else {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.POINTER); // in this branch, we're inside the commit zone, and no uncommitted\n // point exists. Thus do nothing (don't add/remove points).\n }\n } else if (points.length > 2 && lastCommittedPoint && (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointDistance)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(scenePointerX - rx, scenePointerY - ry), lastCommittedPoint) < _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.LINE_CONFIRM_THRESHOLD) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.POINTER);\n this.scene.mutateElement(multiElement, {\n points: points.slice(0, -1)\n }, {\n informMutation: false,\n isDragging: false\n });\n } else {\n const [gridX, gridY] = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(scenePointerX, scenePointerY, event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(multiElement) ? null : this.getEffectiveGridSize());\n const [lastCommittedX, lastCommittedY] = (_b = multiElement === null || multiElement === void 0 ? void 0 : multiElement.lastCommittedPoint) !== null && _b !== void 0 ? _b : [0, 0];\n let dxFromLastCommitted = gridX - rx - lastCommittedX;\n let dyFromLastCommitted = gridY - ry - lastCommittedY;\n\n if ((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.shouldRotateWithDiscreteAngle)(event)) {\n ({\n width: dxFromLastCommitted,\n height: dyFromLastCommitted\n } = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getLockedLinearCursorAlignSize)( // actual coordinate of the last committed point\n lastCommittedX + rx, lastCommittedY + ry, // cursor-grid coordinate\n gridX, gridY));\n }\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isPathALoop)(points, this.state.zoom.value)) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.POINTER);\n } // update last uncommitted point\n\n\n this.scene.mutateElement(multiElement, {\n points: [...points.slice(0, -1), (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(lastCommittedX + dxFromLastCommitted, lastCommittedY + dyFromLastCommitted)]\n }, {\n isDragging: true,\n informMutation: false\n }); // in this path, we're mutating multiElement to reflect\n // how it will be after adding pointer position as the next point\n // trigger update here so that new element canvas renders again to reflect this\n\n this.triggerRender(false);\n }\n\n return;\n }\n\n const hasDeselectedButton = Boolean(event.buttons);\n\n if (hasDeselectedButton || this.state.activeTool.type !== \"selection\" && this.state.activeTool.type !== \"lasso\" && this.state.activeTool.type !== \"text\" && this.state.activeTool.type !== \"eraser\") {\n return;\n }\n\n const elements = this.scene.getNonDeletedElements();\n const selectedElements = this.scene.getSelectedElements(this.state);\n\n if (selectedElements.length === 1 && !isOverScrollBar && !((_c = this.state.selectedLinearElement) === null || _c === void 0 ? void 0 : _c.isEditing)) {\n // for linear elements, we'd like to prioritize point dragging over edge resizing\n // therefore, we update and check hovered point index first\n if (this.state.selectedLinearElement) {\n this.handleHoverSelectedLinearElement(this.state.selectedLinearElement, scenePointerX, scenePointerY);\n }\n\n if ((!this.state.selectedLinearElement || this.state.selectedLinearElement.hoverPointIndex === -1) && ((_d = this.state.openDialog) === null || _d === void 0 ? void 0 : _d.name) !== \"elementLinkSelector\" && !(selectedElements.length === 1 && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(selectedElements[0])) && // HACK: Disable transform handles for linear elements on mobile until a\n // better way of showing them is found\n !((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLinearElement)(selectedElements[0]) && (this.editorInterface.userAgent.isMobileDevice || selectedElements[0].points.length === 2))) {\n const elementWithTransformHandleType = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getElementWithTransformHandleType)(elements, this.state, scenePointerX, scenePointerY, this.state.zoom, event.pointerType, this.scene.getNonDeletedElementsMap(), this.editorInterface);\n\n if (elementWithTransformHandleType && elementWithTransformHandleType.transformHandleType) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getCursorForResizingElement)(elementWithTransformHandleType));\n return;\n }\n }\n } else if (selectedElements.length > 1 && !isOverScrollBar && ((_e = this.state.openDialog) === null || _e === void 0 ? void 0 : _e.name) !== \"elementLinkSelector\") {\n const transformHandleType = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getTransformHandleTypeFromCoords)((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getCommonBounds)(selectedElements), scenePointerX, scenePointerY, this.state.zoom, event.pointerType, this.editorInterface);\n\n if (transformHandleType) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getCursorForResizingElement)({\n transformHandleType\n }));\n return;\n }\n }\n\n const hitElementMightBeLocked = this.getElementAtPosition(scenePointerX, scenePointerY, {\n preferSelected: true,\n includeLockedElements: true\n });\n let hitElement = null;\n\n if (hitElementMightBeLocked && hitElementMightBeLocked.locked) {\n hitElement = null;\n } else {\n hitElement = hitElementMightBeLocked;\n }\n\n this.hitLinkElement = this.getElementLinkAtPosition(scenePointer, hitElementMightBeLocked);\n\n if ((0,_appState__WEBPACK_IMPORTED_MODULE_23__.isEraserActive)(this.state)) {\n return;\n }\n\n if (this.hitLinkElement && !this.state.selectedElementIds[this.hitLinkElement.id]) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.POINTER);\n (0,_components_hyperlink_Hyperlink__WEBPACK_IMPORTED_MODULE_35__.showHyperlinkTooltip)(this.hitLinkElement, this.state, this.scene.getNonDeletedElementsMap());\n\n if (this.props.onLinkHover) {\n this.props.onLinkHover(this.hitLinkElement, event);\n } //zsviczian\n\n } else {\n (0,_components_hyperlink_Hyperlink__WEBPACK_IMPORTED_MODULE_35__.hideHyperlinkToolip)();\n\n if (hitElement && (hitElement.link || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isEmbeddableElement)(hitElement)) && this.state.selectedElementIds[hitElement.id] && !this.state.contextMenu && !this.state.showHyperlinkPopup) {\n this.setState({\n showHyperlinkPopup: \"info\"\n });\n } else if (this.state.activeTool.type === \"text\") {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isTextElement)(hitElement) ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.TEXT : _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.CROSSHAIR);\n } else if (this.state.viewModeEnabled) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.GRAB);\n } else if (((_f = this.state.openDialog) === null || _f === void 0 ? void 0 : _f.name) === \"elementLinkSelector\") {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.AUTO);\n } else if (isOverScrollBar) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.AUTO);\n } else if ( // if using cmd/ctrl, we're not dragging\n !event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD]) {\n if ((hitElement || this.isHittingCommonBoundingBoxOfSelectedElements(scenePointer, selectedElements)) && !(hitElement === null || hitElement === void 0 ? void 0 : hitElement.locked)) {\n if (hitElement && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isIframeLikeElement)(hitElement) && this.isIframeLikeElementCenter(hitElement, event, scenePointerX, scenePointerY)) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.POINTER);\n this.setState({\n activeEmbeddable: {\n element: hitElement,\n state: \"hover\"\n }\n });\n } else if (!hitElement || // Ebow arrows can only be moved when unconnected\n !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(hitElement) || !(hitElement.startBinding || hitElement.endBinding)) {\n if (this.state.activeTool.type !== \"lasso\" || selectedElements.length > 0) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.MOVE);\n }\n\n if (((_g = this.state.activeEmbeddable) === null || _g === void 0 ? void 0 : _g.state) === \"hover\") {\n this.setState({\n activeEmbeddable: null\n });\n }\n }\n }\n } else {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.AUTO);\n }\n\n if (this.state.selectedLinearElement) {\n this.handleHoverSelectedLinearElement(this.state.selectedLinearElement, scenePointerX, scenePointerY);\n }\n }\n\n if (((_h = this.state.openDialog) === null || _h === void 0 ? void 0 : _h.name) === \"elementLinkSelector\" && hitElement) {\n this.setState(prevState => {\n return {\n hoveredElementIds: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateStable)(prevState.hoveredElementIds, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.selectGroupsForSelectedElements)({\n editingGroupId: prevState.editingGroupId,\n selectedElementIds: {\n [hitElement.id]: true\n }\n }, this.scene.getNonDeletedElements(), prevState, this).selectedElementIds)\n };\n });\n } else if (((_j = this.state.openDialog) === null || _j === void 0 ? void 0 : _j.name) === \"elementLinkSelector\" && !hitElement) {\n this.setState(prevState => ({\n hoveredElementIds: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateStable)(prevState.hoveredElementIds, {})\n }));\n }\n };\n\n this.handleEraser = (event, scenePointer) => {\n const elementsToErase = this.eraserTrail.addPointToPath(scenePointer.x, scenePointer.y, event.altKey);\n this.elementsPendingErasure = new Set(elementsToErase);\n this.triggerRender();\n }; // set touch moving for mobile context menu\n\n\n this.handleTouchMove = event => {\n this.resetContextMenuTimer(); //zsviczian\n };\n\n this.handleCanvasPointerDown = event => {\n var _a, _b, _c, _d, _e; //mfuria #329. Right-click pan support when enabled via host plugin setting\n\n\n if ((0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_70__.isPanWithRightMouseEnabled)() && event.pointerType === \"mouse\" && event.button === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.POINTER_BUTTON.SECONDARY && !this.state.editingTextElement) {\n // prevent native context menu\n const onContextMenu = e => {\n e.preventDefault();\n };\n\n window.addEventListener('contextmenu', onContextMenu, {\n once: true\n }); // Start right-click panning\n\n this.startRightClickPanning(event);\n return;\n } //zsviczian - begin\n\n\n const isInsideEmbeddableContainer = !!((_b = (_a = event.target) === null || _a === void 0 ? void 0 : _a.closest) === null || _b === void 0 ? void 0 : _b.call(_a, \".excalidraw__embeddable-container\"));\n\n if (!isInsideEmbeddableContainer) {\n this.focusContainer();\n } //zsviczian - end\n\n\n const target = event.target; // capture subsequent pointer events to the canvas\n // this makes other elements non-interactive until pointer up\n\n if (target.setPointerCapture) {\n target.setPointerCapture(event.pointerId);\n }\n\n this.maybeCleanupAfterMissingPointerUp(event.nativeEvent);\n this.maybeUnfollowRemoteUser();\n\n if (this.state.searchMatches) {\n this.setState(state => {\n return {\n searchMatches: state.searchMatches && {\n focusedId: null,\n matches: state.searchMatches.matches.map(searchMatch => Object.assign(Object.assign({}, searchMatch), {\n focus: false\n }))\n }\n };\n });\n this.updateEditorAtom(_SearchMenu__WEBPACK_IMPORTED_MODULE_61__.searchItemInFocusAtom, null);\n }\n\n if (_editor_jotai__WEBPACK_IMPORTED_MODULE_37__.editorJotaiStore.get(_ConvertElementTypePopup__WEBPACK_IMPORTED_MODULE_52__.convertElementTypePopupAtom)) {\n this.updateEditorAtom(_ConvertElementTypePopup__WEBPACK_IMPORTED_MODULE_52__.convertElementTypePopupAtom, null);\n } // since contextMenu options are potentially evaluated on each render,\n // and an contextMenu action may depend on selection state, we must\n // close the contextMenu before we update the selection on pointerDown\n // (e.g. resetting selection)\n\n\n if (this.state.contextMenu) {\n this.setState({\n contextMenu: null\n });\n }\n\n if (this.state.snapLines) {\n this.setAppState({\n snapLines: []\n });\n }\n\n if (this.state.openPopup) {\n this.setState({\n openPopup: null\n });\n }\n\n this.updateGestureOnPointerDown(event); // if dragging element is freedraw and another pointerdown event occurs\n // a second finger is on the screen\n // discard the freedraw element if it is very short because it is likely\n // just a spike, otherwise finalize the freedraw element when the second\n // finger is lifted\n\n if (event.pointerType === \"touch\" && this.state.newElement && this.state.newElement.type === \"freedraw\") {\n const element = this.state.newElement;\n this.updateScene(Object.assign(Object.assign({}, element.points.length < 10 ? {\n elements: this.scene.getElementsIncludingDeleted().filter(el => el.id !== element.id)\n } : {}), {\n appState: {\n newElement: null,\n editingTextElement: null,\n startBoundElement: null,\n suggestedBindings: [],\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)(Object.keys(this.state.selectedElementIds).filter(key => key !== element.id).reduce((obj, key) => {\n obj[key] = this.state.selectedElementIds[key];\n return obj;\n }, {}), this.state)\n },\n captureUpdate: ((_c = this.state.openDialog) === null || _c === void 0 ? void 0 : _c.name) === \"elementLinkSelector\" ? _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.CaptureUpdateAction.EVENTUALLY : _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.CaptureUpdateAction.NEVER\n }));\n return;\n } // remove any active selection when we start to interact with canvas\n // (mainly, we care about removing selection outside the component which\n // would prevent our copy handling otherwise)\n\n\n const selection = document.getSelection();\n\n if (selection === null || selection === void 0 ? void 0 : selection.anchorNode) {\n selection.removeAllRanges();\n }\n\n this.maybeOpenContextMenuAfterPointerDownOnTouchDevices(event); //fires only once, if pen is detected, penMode is enabled\n //the user can disable this by toggling the penMode button\n\n if (!this.state.penDetected && event.pointerType === \"pen\") {\n this.setState(prevState => {\n return {\n penMode: true,\n penDetected: true\n };\n });\n }\n\n if (!this.editorInterface.isTouchScreen && [\"pen\", \"touch\"].includes(event.pointerType)) {\n this.editorInterface = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateObject)(this.editorInterface, {\n isTouchScreen: true\n });\n }\n\n if (isPanning) {\n return;\n }\n\n this.lastPointerDownEvent = event; // we must exit before we set `cursorButton` state and `savePointer`\n // else it will send pointer state & laser pointer events in collab when\n // panning\n\n /*if (this.handleCanvasPanUsingWheelOrSpaceDrag(event)) {\r\n return;\r\n }*/\n //zsviczian this broke on pointer down in onPointerUpdate\n\n this.setState({\n lastPointerDownWith: event.pointerType,\n cursorButton: \"down\"\n });\n this.savePointer(event.clientX, event.clientY, \"down\");\n\n if (this.handleCanvasPanUsingWheelOrSpaceDrag(event)) {\n return;\n } //zsviczian moved it here, because else pointer down in onPointerUpdate did not work\n\n\n if (event.button === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.POINTER_BUTTON.ERASER && this.state.activeTool.type !== _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.TOOL_TYPE.eraser) {\n this.setState({\n activeTool: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateActiveTool)(this.state, {\n type: _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.TOOL_TYPE.eraser,\n lastActiveToolBeforeEraser: this.state.activeTool\n })\n }, () => {\n this.handleCanvasPointerDown(event);\n\n const onPointerUp = () => {\n unsubPointerUp();\n unsubCleanup === null || unsubCleanup === void 0 ? void 0 : unsubCleanup();\n\n if ((0,_appState__WEBPACK_IMPORTED_MODULE_23__.isEraserActive)(this.state)) {\n this.setState({\n activeTool: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateActiveTool)(this.state, Object.assign(Object.assign({}, this.state.activeTool.lastActiveTool || {\n type: _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.TOOL_TYPE.selection\n }), {\n lastActiveToolBeforeEraser: null\n }))\n });\n }\n };\n\n const unsubPointerUp = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(window, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_UP, onPointerUp, {\n once: true\n });\n let unsubCleanup; // subscribe inside rAF lest it'd be triggered on the same pointerdown\n // if we start erasing while coming from blurred document since\n // we cleanup pointer events on focus\n\n requestAnimationFrame(() => {\n unsubCleanup = this.missingPointerEventCleanupEmitter.once(onPointerUp);\n });\n });\n return;\n } // only handle left mouse button or touch\n\n\n if (event.button !== _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.POINTER_BUTTON.MAIN && event.button !== _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.POINTER_BUTTON.TOUCH && event.button !== _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.POINTER_BUTTON.ERASER) {\n return;\n } // don't select while panning\n\n\n if (gesture.pointers.size > 1) {\n return;\n } // State for the duration of a pointer interaction, which starts with a\n // pointerDown event, ends with a pointerUp event (or another pointerDown)\n\n\n const pointerDownState = this.initialPointerDownState(event);\n this.setState({\n selectedElementsAreBeingDragged: false\n });\n\n if (this.handleDraggingScrollBar(event, pointerDownState)) {\n return;\n }\n\n this.clearSelectionIfNotUsingSelection();\n this.updateBindingEnabledOnPointerMove(event);\n\n if (this.handleSelectionOnPointerDown(event, pointerDownState)) {\n return;\n }\n\n const allowOnPointerDown = !this.state.penMode || event.pointerType !== \"touch\" || this.state.activeTool.type === \"selection\" || this.state.activeTool.type === \"lasso\" || this.state.activeTool.type === \"text\" || this.state.activeTool.type === \"image\";\n\n if (!allowOnPointerDown) {\n return;\n }\n\n if (this.state.activeTool.type === \"lasso\") {\n const hitSelectedElement = pointerDownState.hit.element && this.isASelectedElement(pointerDownState.hit.element);\n\n if (!pointerDownState.hit.hasHitCommonBoundingBoxOfSelectedElements && !pointerDownState.resize.handleType && !hitSelectedElement) {\n this.lassoTrail.startPath(pointerDownState.origin.x, pointerDownState.origin.y, event.shiftKey); // block dragging after lasso selection on PCs until the next pointer down\n // (on mobile or tablet, we want to allow user to drag immediately)\n\n pointerDownState.drag.blockDragging = this.editorInterface.formFactor === \"desktop\";\n } // only for mobile or tablet, if we hit an element, select it immediately like normal selection\n\n\n if (this.editorInterface.formFactor !== \"desktop\" && pointerDownState.hit.element && !hitSelectedElement) {\n this.setState(prevState => {\n const nextSelectedElementIds = Object.assign(Object.assign({}, prevState.selectedElementIds), {\n [pointerDownState.hit.element.id]: true\n });\n const previouslySelectedElements = [];\n Object.keys(prevState.selectedElementIds).forEach(id => {\n const element = this.scene.getElement(id);\n element && previouslySelectedElements.push(element);\n });\n const hitElement = pointerDownState.hit.element; // if hitElement is frame-like, deselect all of its elements\n // if they are selected\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isFrameLikeElement)(hitElement)) {\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getFrameChildren)(previouslySelectedElements, hitElement.id).forEach(element => {\n delete nextSelectedElementIds[element.id];\n });\n } else if (hitElement.frameId) {\n // if hitElement is in a frame and its frame has been selected\n // disable selection for the given element\n if (nextSelectedElementIds[hitElement.frameId]) {\n delete nextSelectedElementIds[hitElement.id];\n }\n } else {\n // hitElement is neither a frame nor an element in a frame\n // but since hitElement could be in a group with some frames\n // this means selecting hitElement will have the frames selected as well\n // because we want to keep the invariant:\n // - frames and their elements are not selected at the same time\n // we deselect elements in those frames that were previously selected\n const groupIds = hitElement.groupIds;\n const framesInGroups = new Set(groupIds.flatMap(gid => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getElementsInGroup)(this.scene.getNonDeletedElements(), gid)).filter(element => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isFrameLikeElement)(element)).map(frame => frame.id));\n\n if (framesInGroups.size > 0) {\n previouslySelectedElements.forEach(element => {\n if (element.frameId && framesInGroups.has(element.frameId)) {\n // deselect element and groups containing the element\n delete nextSelectedElementIds[element.id];\n element.groupIds.flatMap(gid => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getElementsInGroup)(this.scene.getNonDeletedElements(), gid)).forEach(element => {\n delete nextSelectedElementIds[element.id];\n });\n }\n });\n }\n }\n\n return Object.assign(Object.assign({}, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.selectGroupsForSelectedElements)({\n editingGroupId: prevState.editingGroupId,\n selectedElementIds: nextSelectedElementIds\n }, this.scene.getNonDeletedElements(), prevState, this)), {\n showHyperlinkPopup: hitElement.link || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isEmbeddableElement)(hitElement) ? \"info\" : false\n });\n });\n pointerDownState.hit.wasAddedToSelection = true;\n }\n } else if (this.state.activeTool.type === \"text\") {\n this.handleTextOnPointerDown(event, pointerDownState);\n } else if (this.state.activeTool.type === \"arrow\" || this.state.activeTool.type === \"line\") {\n this.handleLinearElementOnPointerDown(event, this.state.activeTool.type, pointerDownState);\n } else if (this.state.activeTool.type === \"freedraw\") {\n this.handleFreeDrawElementOnPointerDown(event, this.state.activeTool.type, pointerDownState);\n } else if (this.state.activeTool.type === \"custom\") {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursorForShape)(this.interactiveCanvas, this.state);\n } else if (this.state.activeTool.type === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.TOOL_TYPE.frame || this.state.activeTool.type === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.TOOL_TYPE.magicframe) {\n this.createFrameElementOnPointerDown(pointerDownState, this.state.activeTool.type);\n } else if (this.state.activeTool.type === \"laser\") {\n this.laserTrails.startPath(pointerDownState.lastCoords.x, pointerDownState.lastCoords.y);\n } else if (this.state.activeTool.type !== \"eraser\" && this.state.activeTool.type !== \"hand\" && this.state.activeTool.type !== \"mermaid\" && //zsviczian\n this.state.activeTool.type !== \"image\") {\n this.createGenericElementOnPointerDown(this.state.activeTool.type, pointerDownState);\n }\n\n (_e = (_d = this.props) === null || _d === void 0 ? void 0 : _d.onPointerDown) === null || _e === void 0 ? void 0 : _e.call(_d, this.state.activeTool, pointerDownState);\n this.onPointerDownEmitter.trigger(this.state.activeTool, pointerDownState, event);\n\n if (this.state.activeTool.type === \"eraser\") {\n this.eraserTrail.startPath(pointerDownState.lastCoords.x, pointerDownState.lastCoords.y);\n }\n\n const onPointerMove = this.onPointerMoveFromPointerDownHandler(pointerDownState);\n const onPointerUp = this.onPointerUpFromPointerDownHandler(pointerDownState);\n const onKeyDown = this.onKeyDownFromPointerDownHandler(pointerDownState);\n const onKeyUp = this.onKeyUpFromPointerDownHandler(pointerDownState);\n this.missingPointerEventCleanupEmitter.once(_event => onPointerUp(_event || event.nativeEvent));\n\n if (!this.state.viewModeEnabled || this.state.activeTool.type === \"laser\") {\n window.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_MOVE, onPointerMove);\n window.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_UP, onPointerUp);\n window.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.KEYDOWN, onKeyDown);\n window.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.KEYUP, onKeyUp);\n pointerDownState.eventListeners.onMove = onPointerMove;\n pointerDownState.eventListeners.onUp = onPointerUp;\n pointerDownState.eventListeners.onKeyUp = onKeyUp;\n pointerDownState.eventListeners.onKeyDown = onKeyDown;\n }\n };\n\n this.handleCanvasPointerUp = event => {\n var _a, _b;\n\n this.removePointer(event);\n this.lastPointerUpEvent = event;\n const scenePointer = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)({\n clientX: event.clientX,\n clientY: event.clientY\n }, this.state);\n const clicklength = event.timeStamp - ((_b = (_a = this.lastPointerDownEvent) === null || _a === void 0 ? void 0 : _a.timeStamp) !== null && _b !== void 0 ? _b : 0);\n\n if (this.editorInterface.formFactor === \"phone\" && clicklength < 300) {\n const hitElement = this.getElementAtPosition(scenePointer.x, scenePointer.y);\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isIframeLikeElement)(hitElement) && this.isIframeLikeElementCenter(hitElement, event, scenePointer.x, scenePointer.y)) {\n this.handleEmbeddableCenterClick(hitElement);\n return;\n }\n }\n\n if (this.editorInterface.isTouchScreen) {\n const hitElement = this.getElementAtPosition(scenePointer.x, scenePointer.y, {\n includeLockedElements: true\n });\n this.hitLinkElement = this.getElementLinkAtPosition(scenePointer, hitElement);\n }\n\n if (this.hitLinkElement && !this.state.selectedElementIds[this.hitLinkElement.id]) {\n if (clicklength < 300 && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isIframeLikeElement)(this.hitLinkElement) && !(0,_hyperlink_helpers__WEBPACK_IMPORTED_MODULE_65__.isPointHittingLinkIcon)(this.hitLinkElement, this.scene.getNonDeletedElementsMap(), this.state, (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(scenePointer.x, scenePointer.y))) {\n this.handleEmbeddableCenterClick(this.hitLinkElement);\n } else {\n this.redirectToLink(event, this.editorInterface.isTouchScreen);\n }\n } else if (this.state.viewModeEnabled) {\n this.setState({\n activeEmbeddable: null,\n selectedElementIds: {}\n });\n }\n };\n\n this.maybeOpenContextMenuAfterPointerDownOnTouchDevices = event => {\n if ((0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_70__.isContextMenuDisabled)()) {\n return;\n } // deal with opening context menu on touch devices\n\n\n if (event.pointerType === \"touch\") {\n invalidateContextMenu = false;\n\n if (touchTimeout) {\n // If there's already a touchTimeout, this means that there's another\n // touch down and we are doing another touch, so we shouldn't open the\n // context menu.\n invalidateContextMenu = true;\n } else {\n // open the context menu with the first touch's clientX and clientY\n // if the touch is not moving\n touchTimeout = window.setTimeout(() => {\n touchTimeout = 0;\n\n if (!invalidateContextMenu && !this.state.isResizing) {\n //zsviczian - avoid context menu during resizing on Mobiles\n this.handleCanvasContextMenu(event);\n }\n }, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.TOUCH_CTX_MENU_TIMEOUT);\n }\n }\n };\n\n this.resetContextMenuTimer = () => {\n clearTimeout(touchTimeout);\n touchTimeout = 0;\n invalidateContextMenu = false;\n };\n /**\r\n * pointerup may not fire in certian cases (user tabs away...), so in order\r\n * to properly cleanup pointerdown state, we need to fire any hanging\r\n * pointerup handlers manually\r\n */\n\n\n this.maybeCleanupAfterMissingPointerUp = event => {\n lastPointerUp === null || lastPointerUp === void 0 ? void 0 : lastPointerUp();\n this.missingPointerEventCleanupEmitter.trigger(event).clear();\n }; // Returns whether the event is a panning\n\n\n this.handleCanvasPanUsingWheelOrSpaceDrag = event => {\n if (!(gesture.pointers.size <= 1 && (event.button === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.POINTER_BUTTON.WHEEL || event.button === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.POINTER_BUTTON.MAIN && isHoldingSpace || (0,_appState__WEBPACK_IMPORTED_MODULE_23__.isHandToolActive)(this.state) || //zsviczian\n (0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_70__.isTouchInPenMode)(this.state, event) || //!isLaserPointerActive added by zsviczian (but don't remember why....)\n this.state.viewModeEnabled && !(0,_appState__WEBPACK_IMPORTED_MODULE_23__.isLaserPointerActive)(this.state)))) {\n return false;\n }\n\n isPanning = true; // due to event.preventDefault below, container wouldn't get focus\n // automatically\n\n this.focusContainer(); // preventing defualt while text editing messes with cursor/focus\n\n if (!this.state.editingTextElement) {\n // necessary to prevent browser from scrolling the page if excalidraw\n // not full-page #4489\n //\n // as such, the above is broken when panning canvas while in wysiwyg\n event.preventDefault();\n }\n\n let nextPastePrevented = false;\n const isLinux = typeof window === undefined ? false : /Linux/.test(window.navigator.platform);\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.GRABBING);\n let {\n clientX: lastX,\n clientY: lastY\n } = event;\n const onPointerMove = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdatesThrottled)(event => {\n const deltaX = lastX - event.clientX;\n const deltaY = lastY - event.clientY;\n lastX = event.clientX;\n lastY = event.clientY;\n /*\r\n * Prevent paste event if we move while middle clicking on Linux.\r\n * See issue #1383.\r\n */\n\n if (isLinux && !nextPastePrevented && (Math.abs(deltaX) > 1 || Math.abs(deltaY) > 1)) {\n nextPastePrevented = true;\n /* Prevent the next paste event */\n\n const preventNextPaste = event => {\n document.body.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.PASTE, preventNextPaste);\n event.stopPropagation();\n };\n /*\r\n * Reenable next paste in case of disabled middle click paste for\r\n * any reason:\r\n * - right click paste\r\n * - empty clipboard\r\n */\n\n\n const enableNextPaste = () => {\n setTimeout(() => {\n document.body.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.PASTE, preventNextPaste);\n window.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_UP, enableNextPaste);\n }, 100);\n };\n\n document.body.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.PASTE, preventNextPaste);\n window.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_UP, enableNextPaste);\n }\n\n this.translateCanvas({\n scrollX: this.state.scrollX - deltaX / this.state.zoom.value,\n scrollY: this.state.scrollY - deltaY / this.state.zoom.value\n });\n });\n const teardown = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(lastPointerUp = () => {\n lastPointerUp = null;\n isPanning = false;\n\n if (!isHoldingSpace) {\n if (this.state.viewModeEnabled) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.GRAB);\n } else {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursorForShape)(this.interactiveCanvas, this.state);\n }\n }\n\n this.setState({\n cursorButton: \"up\"\n });\n this.savePointer(event.clientX, event.clientY, \"up\");\n window.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_MOVE, onPointerMove);\n window.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_UP, teardown);\n window.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.BLUR, teardown);\n onPointerMove.flush();\n });\n window.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.BLUR, teardown);\n window.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_MOVE, onPointerMove, {\n passive: true\n });\n window.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_UP, teardown);\n return true;\n };\n\n this.clearSelectionIfNotUsingSelection = () => {\n if (this.state.activeTool.type !== \"selection\" && this.state.activeTool.type !== \"lasso\") {\n this.setState({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)({}, this.state),\n selectedGroupIds: {},\n editingGroupId: null,\n activeEmbeddable: null\n });\n }\n };\n /**\r\n * @returns whether the pointer event has been completely handled\r\n */\n\n\n this.handleSelectionOnPointerDown = (event, pointerDownState) => {\n var _a, _b, _c, _d, _e;\n\n if (this.state.activeTool.type === \"selection\" || this.state.activeTool.type === \"lasso\") {\n const elements = this.scene.getNonDeletedElements();\n const elementsMap = this.scene.getNonDeletedElementsMap();\n const selectedElements = this.scene.getSelectedElements(this.state);\n\n if (selectedElements.length === 1 && !((_a = this.state.selectedLinearElement) === null || _a === void 0 ? void 0 : _a.isEditing) && !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(selectedElements[0]) && !((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLinearElement)(selectedElements[0]) && (this.editorInterface.userAgent.isMobileDevice || selectedElements[0].points.length === 2)) && !(this.state.selectedLinearElement && this.state.selectedLinearElement.hoverPointIndex !== -1)) {\n const elementWithTransformHandleType = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getElementWithTransformHandleType)(elements, this.state, pointerDownState.origin.x, pointerDownState.origin.y, this.state.zoom, event.pointerType, this.scene.getNonDeletedElementsMap(), this.editorInterface);\n\n if (elementWithTransformHandleType != null) {\n if (elementWithTransformHandleType.transformHandleType === \"rotation\") {\n this.setState({\n resizingElement: elementWithTransformHandleType.element\n });\n pointerDownState.resize.handleType = elementWithTransformHandleType.transformHandleType;\n } else if (this.state.croppingElementId) {\n pointerDownState.resize.handleType = elementWithTransformHandleType.transformHandleType;\n } else {\n this.setState({\n resizingElement: elementWithTransformHandleType.element\n });\n pointerDownState.resize.handleType = elementWithTransformHandleType.transformHandleType;\n }\n }\n } else if (selectedElements.length > 1) {\n pointerDownState.resize.handleType = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getTransformHandleTypeFromCoords)((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getCommonBounds)(selectedElements), pointerDownState.origin.x, pointerDownState.origin.y, this.state.zoom, event.pointerType, this.editorInterface);\n }\n\n if (pointerDownState.resize.handleType) {\n pointerDownState.resize.isResizing = true;\n pointerDownState.resize.offset = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.tupleToCoors)((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getResizeOffsetXY)(pointerDownState.resize.handleType, selectedElements, elementsMap, pointerDownState.origin.x, pointerDownState.origin.y));\n\n if (selectedElements.length === 1 && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLinearElement)(selectedElements[0]) && selectedElements[0].points.length === 2) {\n pointerDownState.resize.arrowDirection = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getResizeArrowDirection)(pointerDownState.resize.handleType, selectedElements[0]);\n }\n } else {\n if (this.state.selectedLinearElement) {\n const linearElementEditor = this.state.selectedLinearElement;\n const ret = _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.handlePointerDown(event, this, this.store, pointerDownState.origin, linearElementEditor, this.scene);\n\n if (ret.hitElement) {\n pointerDownState.hit.element = ret.hitElement;\n }\n\n if (ret.linearElementEditor) {\n this.setState({\n selectedLinearElement: ret.linearElementEditor\n });\n }\n\n if (ret.didAddPoint) {\n return true;\n }\n }\n\n const allHitElements = this.getElementsAtPosition(pointerDownState.origin.x, pointerDownState.origin.y, {\n includeLockedElements: true\n });\n const unlockedHitElements = allHitElements.filter(e => !e.locked); // Cannot set preferSelected in getElementAtPosition as we do in pointer move; consider:\n // A & B: both unlocked, A selected, B on top, A & B overlaps in some way\n // we want to select B when clicking on the overlapping area\n\n const hitElementMightBeLocked = this.getElementAtPosition(pointerDownState.origin.x, pointerDownState.origin.y, {\n allHitElements\n });\n\n if (!hitElementMightBeLocked || hitElementMightBeLocked.id !== this.state.activeLockedId) {\n this.setState({\n activeLockedId: null\n });\n }\n\n const isUnlockedHitElSelected = unlockedHitElements.some(el => this.state.selectedElementIds[el.id]); //zsviczian\n // Prioritize unlocked elements over locked ones\n\n if (!isUnlockedHitElSelected && unlockedHitElements.length > 0) {\n //zsviczian https://github.com/excalidraw/excalidraw/pull/9582\n // If there are unlocked elements, use the topmost one\n pointerDownState.hit.element = unlockedHitElements[unlockedHitElements.length - 1];\n } else if (hitElementMightBeLocked && hitElementMightBeLocked.locked && !isUnlockedHitElSelected //zsviczian\n ) {\n pointerDownState.hit.element = null;\n } else {\n // hitElement may already be set above, so check first\n pointerDownState.hit.element = (_b = pointerDownState.hit.element) !== null && _b !== void 0 ? _b : this.getElementAtPosition(pointerDownState.origin.x, pointerDownState.origin.y);\n }\n\n this.hitLinkElement = this.getElementLinkAtPosition(pointerDownState.origin, hitElementMightBeLocked);\n\n if (this.hitLinkElement) {\n return true;\n }\n\n if (this.state.croppingElementId && ((_c = pointerDownState.hit.element) === null || _c === void 0 ? void 0 : _c.id) !== this.state.croppingElementId) {\n this.finishImageCropping();\n }\n\n if (pointerDownState.hit.element) {\n // Early return if pointer is hitting link icon\n const hitLinkElement = this.getElementLinkAtPosition({\n x: pointerDownState.origin.x,\n y: pointerDownState.origin.y\n }, pointerDownState.hit.element);\n\n if (hitLinkElement) {\n return false;\n }\n } // For overlapped elements one position may hit\n // multiple elements\n\n\n pointerDownState.hit.allHitElements = unlockedHitElements;\n const hitElement = pointerDownState.hit.element;\n const someHitElementIsSelected = pointerDownState.hit.allHitElements.some(element => this.isASelectedElement(element));\n\n if ((hitElement === null || !someHitElementIsSelected) && !event.shiftKey && !pointerDownState.hit.hasHitCommonBoundingBoxOfSelectedElements) {\n this.clearSelection(hitElement);\n }\n\n if ((_d = this.state.selectedLinearElement) === null || _d === void 0 ? void 0 : _d.isEditing) {\n this.setState({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)({\n [this.state.selectedLinearElement.elementId]: true\n }, this.state)\n }); // If we click on something\n } else if (hitElement != null) {\n // == deep selection ==\n // on CMD/CTRL, drill down to hit element regardless of groups etc.\n if (event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD]) {\n if (event.altKey) {\n // ctrl + alt means we're lasso selecting - start lasso trail and switch to lasso tool\n // Close any open dialogs that might interfere with lasso selection\n if (((_e = this.state.openDialog) === null || _e === void 0 ? void 0 : _e.name) === \"elementLinkSelector\") {\n this.setOpenDialog(null);\n }\n\n this.lassoTrail.startPath(pointerDownState.origin.x, pointerDownState.origin.y, event.shiftKey);\n this.setActiveTool({\n type: \"lasso\",\n fromSelection: true\n });\n return false;\n }\n\n if (!this.state.selectedElementIds[hitElement.id]) {\n pointerDownState.hit.wasAddedToSelection = true;\n }\n\n this.setState(prevState => Object.assign(Object.assign({}, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.editGroupForSelectedElement)(prevState, hitElement)), {\n previousSelectedElementIds: this.state.selectedElementIds\n })); // mark as not completely handled so as to allow dragging etc.\n\n return false;\n } // deselect if item is selected\n // if shift is not clicked, this will always return true\n // otherwise, it will trigger selection based on current\n // state of the box\n\n\n if (!this.state.selectedElementIds[hitElement.id]) {\n // if we are currently editing a group, exiting editing mode and deselect the group.\n if (this.state.editingGroupId && !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElementInGroup)(hitElement, this.state.editingGroupId)) {\n this.setState({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)({}, this.state),\n selectedGroupIds: {},\n editingGroupId: null,\n activeEmbeddable: null\n });\n } // Add hit element to selection. At this point if we're not holding\n // SHIFT the previously selected element(s) were deselected above\n // (make sure you use setState updater to use latest state)\n // With shift-selection, we want to make sure that frames and their containing\n // elements are not selected at the same time.\n\n\n if (!someHitElementIsSelected && !pointerDownState.hit.hasHitCommonBoundingBoxOfSelectedElements) {\n this.setState(prevState => {\n var _a;\n\n let nextSelectedElementIds = Object.assign(Object.assign({}, prevState.selectedElementIds), {\n [hitElement.id]: true\n });\n const previouslySelectedElements = [];\n Object.keys(prevState.selectedElementIds).forEach(id => {\n const element = this.scene.getElement(id);\n element && previouslySelectedElements.push(element);\n }); // if hitElement is frame-like, deselect all of its elements\n // if they are selected\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isFrameLikeElement)(hitElement)) {\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getFrameChildren)(previouslySelectedElements, hitElement.id).forEach(element => {\n delete nextSelectedElementIds[element.id];\n });\n } else if (hitElement.frameId) {\n // if hitElement is in a frame and its frame has been selected\n // disable selection for the given element\n if (nextSelectedElementIds[hitElement.frameId]) {\n delete nextSelectedElementIds[hitElement.id];\n }\n } else {\n // hitElement is neither a frame nor an element in a frame\n // but since hitElement could be in a group with some frames\n // this means selecting hitElement will have the frames selected as well\n // because we want to keep the invariant:\n // - frames and their elements are not selected at the same time\n // we deselect elements in those frames that were previously selected\n const groupIds = hitElement.groupIds;\n const framesInGroups = new Set(groupIds.flatMap(gid => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getElementsInGroup)(this.scene.getNonDeletedElements(), gid)).filter(element => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isFrameLikeElement)(element)).map(frame => frame.id));\n\n if (framesInGroups.size > 0) {\n previouslySelectedElements.forEach(element => {\n if (element.frameId && framesInGroups.has(element.frameId)) {\n // deselect element and groups containing the element\n delete nextSelectedElementIds[element.id];\n element.groupIds.flatMap(gid => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getElementsInGroup)(this.scene.getNonDeletedElements(), gid)).forEach(element => {\n delete nextSelectedElementIds[element.id];\n });\n }\n });\n }\n } // Finally, in shape selection mode, we'd like to\n // keep only one shape or group selected at a time.\n // This means, if the hitElement is a different shape or group\n // than the previously selected ones, we deselect the previous ones\n // and select the hitElement\n\n\n if (((_a = prevState.openDialog) === null || _a === void 0 ? void 0 : _a.name) === \"elementLinkSelector\") {\n if (!hitElement.groupIds.some(gid => prevState.selectedGroupIds[gid])) {\n nextSelectedElementIds = {\n [hitElement.id]: true\n };\n }\n }\n\n return Object.assign(Object.assign({}, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.selectGroupsForSelectedElements)({\n editingGroupId: prevState.editingGroupId,\n selectedElementIds: nextSelectedElementIds\n }, this.scene.getNonDeletedElements(), prevState, this)), {\n showHyperlinkPopup: hitElement.link || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isEmbeddableElement)(hitElement) ? \"info\" : false\n });\n });\n pointerDownState.hit.wasAddedToSelection = true;\n }\n }\n }\n\n this.setState({\n previousSelectedElementIds: this.state.selectedElementIds\n });\n }\n }\n\n return false;\n };\n\n this.handleTextOnPointerDown = (event, pointerDownState) => {\n // if we're currently still editing text, clicking outside\n // should only finalize it, not create another (irrespective\n // of state.activeTool.locked)\n if (this.state.editingTextElement) {\n return;\n }\n\n let sceneX = pointerDownState.origin.x;\n let sceneY = pointerDownState.origin.y;\n const element = this.getElementAtPosition(sceneX, sceneY, {\n includeBoundTextElement: true\n }); // FIXME\n\n let container = this.getTextBindableContainerAtPosition(sceneX, sceneY);\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.hasBoundTextElement)(element)) {\n container = element;\n sceneX = element.x + element.width / 2;\n sceneY = element.y + element.height / 2;\n }\n\n this.startTextEditing({\n sceneX,\n sceneY,\n insertAtParentCenter: !event.altKey,\n container,\n autoEdit: false\n });\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.resetCursor)(this.interactiveCanvas);\n\n if (!this.state.activeTool.locked) {\n this.setState({\n activeTool: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateActiveTool)(this.state, {\n type: this.state.preferredSelectionTool.type\n })\n });\n }\n };\n\n this.handleFreeDrawElementOnPointerDown = (event, elementType, pointerDownState) => {\n // Begin a mark capture. This does not have to update state yet.\n const [gridX, gridY] = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(pointerDownState.origin.x, pointerDownState.origin.y, null);\n const topLayerFrame = this.getTopLayerFrameAtSceneCoords({\n x: gridX,\n y: gridY\n });\n const strokeOptions = this.state.currentStrokeOptions; //zsviczian\n\n const simulatePressure = (strokeOptions === null || strokeOptions === void 0 ? void 0 : strokeOptions.constantPressure //zsviczian\n ) ? false : event.pressure === 0.5;\n const element = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newFreeDrawElement)(Object.assign(Object.assign({\n type: elementType,\n x: gridX,\n y: gridY,\n strokeColor: this.state.currentItemStrokeColor,\n backgroundColor: this.state.currentItemBackgroundColor,\n fillStyle: this.state.currentItemFillStyle,\n strokeWidth: this.state.currentItemStrokeWidth,\n strokeStyle: this.state.currentItemStrokeStyle,\n roughness: this.state.currentItemRoughness,\n opacity: this.state.currentItemOpacity,\n roundness: null,\n simulatePressure,\n locked: false\n }, strokeOptions //zsviczian\n ? {\n customData: {\n strokeOptions\n }\n } : {}), {\n frameId: topLayerFrame ? topLayerFrame.id : null,\n points: [(0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(0, 0)],\n pressures: simulatePressure ? [] : [(strokeOptions === null || strokeOptions === void 0 ? void 0 : strokeOptions.constantPressure) ? 1 : event.pressure]\n })); //zsviczian\n\n if (strokeOptions === null || strokeOptions === void 0 ? void 0 : strokeOptions.highlighter) {\n this.scene.insertElement(element, 0);\n } else {\n this.scene.insertElement(element);\n }\n\n this.setState(prevState => {\n const nextSelectedElementIds = Object.assign({}, prevState.selectedElementIds);\n delete nextSelectedElementIds[element.id];\n return {\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)(nextSelectedElementIds, prevState)\n };\n });\n const boundElement = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getHoveredElementForBinding)(pointerDownState.origin, this.scene.getNonDeletedElements(), this.scene.getNonDeletedElementsMap(), this.state.zoom);\n this.setState({\n newElement: element,\n startBoundElement: boundElement,\n suggestedBindings: []\n });\n };\n\n this.insertIframeElement = ({\n sceneX,\n sceneY,\n width,\n height\n }) => {\n var _a;\n\n const [gridX, gridY] = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(sceneX, sceneY, ((_a = this.lastPointerDownEvent) === null || _a === void 0 ? void 0 : _a[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD]) ? null : this.getEffectiveGridSize());\n const element = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newIframeElement)({\n type: \"iframe\",\n x: gridX,\n y: gridY,\n strokeColor: \"transparent\",\n backgroundColor: \"transparent\",\n fillStyle: this.state.currentItemFillStyle,\n strokeWidth: this.state.currentItemStrokeWidth,\n strokeStyle: this.state.currentItemStrokeStyle,\n roughness: this.state.currentItemRoughness,\n roundness: this.getCurrentItemRoundness(\"iframe\"),\n opacity: this.state.currentItemOpacity,\n locked: false,\n width,\n height\n });\n this.scene.insertElement(element);\n return element;\n }; //create rectangle element with youtube top left on nearest grid point width / hight 640/360\n\n\n this.insertEmbeddableElement = ({\n sceneX,\n sceneY,\n link\n }) => {\n var _a;\n\n const [gridX, gridY] = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(sceneX, sceneY, ((_a = this.lastPointerDownEvent) === null || _a === void 0 ? void 0 : _a[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD]) ? null : this.getEffectiveGridSize());\n const embedLink = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getEmbedLink)(link);\n\n if (!embedLink) {\n return;\n }\n\n if (embedLink.error instanceof URIError) {\n this.setToast({\n message: (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"toast.unrecognizedLinkFormat\"),\n closable: true\n });\n }\n\n const element = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newEmbeddableElement)({\n type: \"embeddable\",\n x: gridX,\n y: gridY,\n strokeColor: \"transparent\",\n backgroundColor: \"transparent\",\n fillStyle: this.state.currentItemFillStyle,\n strokeWidth: this.state.currentItemStrokeWidth,\n strokeStyle: this.state.currentItemStrokeStyle,\n roughness: this.state.currentItemRoughness,\n roundness: this.getCurrentItemRoundness(\"embeddable\"),\n opacity: this.state.currentItemOpacity,\n locked: false,\n width: embedLink.intrinsicSize.w,\n height: embedLink.intrinsicSize.h,\n link\n });\n this.scene.insertElement(element);\n return element;\n };\n\n this.newImagePlaceholder = ({\n sceneX,\n sceneY,\n addToFrameUnderCursor = true\n }) => {\n var _a;\n\n const [gridX, gridY] = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(sceneX, sceneY, ((_a = this.lastPointerDownEvent) === null || _a === void 0 ? void 0 : _a[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD]) ? null : this.getEffectiveGridSize());\n const topLayerFrame = addToFrameUnderCursor ? this.getTopLayerFrameAtSceneCoords({\n x: gridX,\n y: gridY\n }) : null;\n const placeholderSize = 100 / this.state.zoom.value;\n return (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newImageElement)({\n type: \"image\",\n strokeColor: this.state.currentItemStrokeColor,\n backgroundColor: this.state.currentItemBackgroundColor,\n fillStyle: this.state.currentItemFillStyle,\n strokeWidth: this.state.currentItemStrokeWidth,\n strokeStyle: this.state.currentItemStrokeStyle,\n roughness: this.state.currentItemRoughness,\n roundness: null,\n opacity: this.state.currentItemOpacity,\n locked: false,\n frameId: topLayerFrame ? topLayerFrame.id : null,\n x: gridX - placeholderSize / 2,\n y: gridY - placeholderSize / 2,\n width: placeholderSize,\n height: placeholderSize\n });\n };\n\n this.handleLinearElementOnPointerDown = (event, elementType, pointerDownState) => {\n if (this.state.multiElement) {\n const {\n multiElement\n } = this.state; // finalize if completing a loop\n\n if (multiElement.type === \"line\" && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isPathALoop)(multiElement.points, this.state.zoom.value)) {\n this.scene.mutateElement(multiElement, {\n lastCommittedPoint: multiElement.points[multiElement.points.length - 1]\n });\n this.actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_8__.actionFinalize);\n return;\n } // Elbow arrows cannot be created by putting down points\n // only the start and end points can be defined\n\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(multiElement) && multiElement.points.length > 1) {\n this.scene.mutateElement(multiElement, {\n lastCommittedPoint: multiElement.points[multiElement.points.length - 1]\n });\n this.actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_8__.actionFinalize);\n return;\n }\n\n const {\n x: rx,\n y: ry,\n lastCommittedPoint\n } = multiElement; // clicking inside commit zone → finalize arrow\n\n if (multiElement.points.length > 1 && lastCommittedPoint && (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointDistance)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(pointerDownState.origin.x - rx, pointerDownState.origin.y - ry), lastCommittedPoint) < _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.LINE_CONFIRM_THRESHOLD) {\n this.actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_8__.actionFinalize);\n return;\n }\n\n this.setState(prevState => ({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)(Object.assign(Object.assign({}, prevState.selectedElementIds), {\n [multiElement.id]: true\n }), prevState)\n })); // clicking outside commit zone → update reference for last committed\n // point\n\n this.scene.mutateElement(multiElement, {\n lastCommittedPoint: multiElement.points[multiElement.points.length - 1]\n });\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.POINTER);\n } else {\n const [gridX, gridY] = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(pointerDownState.origin.x, pointerDownState.origin.y, event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] ? null : this.getEffectiveGridSize());\n const topLayerFrame = this.getTopLayerFrameAtSceneCoords({\n x: gridX,\n y: gridY\n });\n /* If arrow is pre-arrowheads, it will have undefined for both start and end arrowheads.\r\n If so, we want it to be null for start and \"arrow\" for end. If the linear item is not\r\n an arrow, we want it to be null for both. Otherwise, we want it to use the\r\n values from appState. */\n\n const {\n currentItemStartArrowhead,\n currentItemEndArrowhead\n } = this.state;\n const [startArrowhead, endArrowhead] = elementType === \"arrow\" ? [currentItemStartArrowhead, currentItemEndArrowhead] : [null, null];\n const element = elementType === \"arrow\" ? (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newArrowElement)({\n type: elementType,\n x: gridX,\n y: gridY,\n strokeColor: this.state.currentItemStrokeColor,\n backgroundColor: this.state.currentItemBackgroundColor,\n fillStyle: this.state.currentItemFillStyle,\n strokeWidth: this.state.currentItemStrokeWidth,\n strokeStyle: this.state.currentItemStrokeStyle,\n roughness: this.state.currentItemRoughness,\n opacity: this.state.currentItemOpacity,\n roundness: this.state.currentItemArrowType === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.ARROW_TYPE.round ? {\n type: _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.ROUNDNESS.PROPORTIONAL_RADIUS\n } : // note, roundness doesn't have any effect for elbow arrows,\n // but it's best to set it to null as well\n null,\n startArrowhead,\n endArrowhead,\n locked: false,\n frameId: topLayerFrame ? topLayerFrame.id : null,\n elbowed: this.state.currentItemArrowType === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.ARROW_TYPE.elbow,\n fixedSegments: this.state.currentItemArrowType === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.ARROW_TYPE.elbow ? [] : null\n }) : (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newLinearElement)({\n type: elementType,\n x: gridX,\n y: gridY,\n strokeColor: this.state.currentItemStrokeColor,\n backgroundColor: this.state.currentItemBackgroundColor,\n fillStyle: this.state.currentItemFillStyle,\n strokeWidth: this.state.currentItemStrokeWidth,\n strokeStyle: this.state.currentItemStrokeStyle,\n roughness: this.state.currentItemRoughness,\n opacity: this.state.currentItemOpacity,\n roundness: this.state.currentItemRoundness === \"round\" ? {\n type: _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.ROUNDNESS.PROPORTIONAL_RADIUS\n } : null,\n locked: false,\n frameId: topLayerFrame ? topLayerFrame.id : null\n });\n this.setState(prevState => {\n const nextSelectedElementIds = Object.assign({}, prevState.selectedElementIds);\n delete nextSelectedElementIds[element.id];\n return {\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)(nextSelectedElementIds, prevState)\n };\n });\n this.scene.mutateElement(element, {\n points: [...element.points, (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(0, 0)]\n });\n const boundElement = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getHoveredElementForBinding)(pointerDownState.origin, this.scene.getNonDeletedElements(), this.scene.getNonDeletedElementsMap(), this.state.zoom, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(element), (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(element));\n this.scene.insertElement(element);\n this.setState({\n newElement: element,\n startBoundElement: boundElement,\n suggestedBindings: []\n });\n }\n };\n\n this.createGenericElementOnPointerDown = (elementType, pointerDownState) => {\n var _a;\n\n const [gridX, gridY] = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(pointerDownState.origin.x, pointerDownState.origin.y, ((_a = this.lastPointerDownEvent) === null || _a === void 0 ? void 0 : _a[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD]) ? null : this.getEffectiveGridSize());\n const topLayerFrame = this.getTopLayerFrameAtSceneCoords({\n x: gridX,\n y: gridY\n });\n const baseElementAttributes = {\n x: gridX,\n y: gridY,\n strokeColor: this.state.currentItemStrokeColor,\n backgroundColor: this.state.currentItemBackgroundColor,\n fillStyle: this.state.currentItemFillStyle,\n strokeWidth: this.state.currentItemStrokeWidth,\n strokeStyle: this.state.currentItemStrokeStyle,\n roughness: this.state.currentItemRoughness,\n opacity: this.state.currentItemOpacity,\n roundness: this.getCurrentItemRoundness(elementType),\n locked: false,\n frameId: topLayerFrame ? topLayerFrame.id : null\n };\n let element;\n\n if (elementType === \"embeddable\") {\n element = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newEmbeddableElement)(Object.assign({\n type: \"embeddable\"\n }, baseElementAttributes));\n } else {\n element = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newElement)(Object.assign({\n type: elementType\n }, baseElementAttributes));\n }\n\n if (element.type === \"selection\") {\n this.setState({\n selectionElement: element\n });\n } else {\n this.scene.insertElement(element);\n this.setState({\n multiElement: null,\n newElement: element\n });\n }\n };\n\n this.createFrameElementOnPointerDown = (pointerDownState, type) => {\n var _a;\n\n const [gridX, gridY] = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(pointerDownState.origin.x, pointerDownState.origin.y, ((_a = this.lastPointerDownEvent) === null || _a === void 0 ? void 0 : _a[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD]) ? null : this.getEffectiveGridSize());\n const constructorOpts = Object.assign(Object.assign(Object.assign({\n x: gridX,\n y: gridY,\n opacity: this.state.currentItemOpacity,\n locked: false\n }, type === \"frame\" && this.state.currentItemFrameRole ? {\n frameRole: this.state.currentItemFrameRole\n } : {}), _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.FRAME_STYLE), this.state.frameColor ? {\n //zsviczian\n customData: {\n frameColor: this.state.frameColor\n }\n } : {});\n const frame = type === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.TOOL_TYPE.magicframe ? (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newMagicFrameElement)(constructorOpts) : (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newFrameElement)(constructorOpts, this.scene.getNonDeletedElements()); //zsviczian\n\n this.scene.insertElement(frame);\n this.setState({\n multiElement: null,\n newElement: frame\n });\n };\n\n this.restoreReadyToEraseElements = () => {\n this.elementsPendingErasure = new Set();\n this.triggerRender();\n };\n\n this.eraseElements = () => {\n let didChange = false;\n const elements = this.scene.getElementsIncludingDeleted().map(ele => {\n if (this.elementsPendingErasure.has(ele.id) || ele.frameId && this.elementsPendingErasure.has(ele.frameId) || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isBoundToContainer)(ele) && this.elementsPendingErasure.has(ele.containerId)) {\n didChange = true;\n return (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newElementWith)(ele, {\n isDeleted: true\n });\n }\n\n return ele;\n });\n this.elementsPendingErasure = new Set();\n\n if (didChange) {\n this.store.scheduleCapture();\n this.scene.replaceAllElements(elements);\n }\n };\n\n this.initializeImage = async (placeholderImageElement, imageFile) => {\n var _a, _b, _c; // at this point this should be guaranteed image file, but we do this check\n // to satisfy TS down the line\n\n\n if (!(0,_data_blob__WEBPACK_IMPORTED_MODULE_33__.isSupportedImageFile)(imageFile)) {\n throw new Error((0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"errors.unsupportedFileType\"));\n }\n\n const mimeType = imageFile.type;\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, \"wait\");\n\n if (mimeType === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.MIME_TYPES.svg) {\n try {\n imageFile = (0,_data_blob__WEBPACK_IMPORTED_MODULE_33__.SVGStringToFile)((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.normalizeSVG)(await imageFile.text()), imageFile.name);\n } catch (error) {\n console.warn(error);\n throw new Error((0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"errors.svgImageInsertError\"));\n }\n } // generate image id (by default the file digest) before any\n // resizing/compression takes place to keep it more portable\n\n\n const fileId = await (((_b = (_a = this.props).generateIdForFile) === null || _b === void 0 ? void 0 : _b.call(_a, imageFile)) || (0,_data_blob__WEBPACK_IMPORTED_MODULE_33__.generateIdFromFile)(imageFile));\n\n if (!fileId) {\n console.warn(\"Couldn't generate file id or the supplied `generateIdForFile` didn't resolve to one.\");\n throw new Error((0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"errors.imageInsertError\"));\n }\n\n const existingFileData = this.files[fileId];\n\n if (!(existingFileData === null || existingFileData === void 0 ? void 0 : existingFileData.dataURL)) {\n try {\n imageFile = await (0,_data_blob__WEBPACK_IMPORTED_MODULE_33__.resizeImageFile)(imageFile, {\n maxWidthOrHeight: _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT\n });\n } catch (error) {\n console.error(\"Error trying to resizing image file on insertion\", error);\n }\n\n if (imageFile.size > _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.MAX_ALLOWED_FILE_BYTES) {\n throw new Error((0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"errors.fileTooBig\", {\n maxSize: `${Math.trunc(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.MAX_ALLOWED_FILE_BYTES / 1024 / 1024)}MB`\n }));\n }\n }\n\n const dataURL = ((_c = this.files[fileId]) === null || _c === void 0 ? void 0 : _c.dataURL) || (await (0,_data_blob__WEBPACK_IMPORTED_MODULE_33__.getDataURL)(imageFile));\n return new Promise(async (resolve, reject) => {\n var _a, _b;\n\n try {\n let initializedImageElement = this.getLatestInitializedImageElement(placeholderImageElement, fileId);\n this.addMissingFiles([{\n mimeType,\n id: fileId,\n dataURL,\n created: Date.now(),\n lastRetrieved: Date.now(),\n //@ts-ignore\n name: (imageFile === null || imageFile === void 0 ? void 0 : imageFile.name) && imageFile.name !== \"image.png\" ? imageFile.name : undefined // zsviczian\n\n }]);\n\n if (!this.imageCache.get(fileId)) {\n this.addNewImagesToImageCache();\n const {\n erroredFiles\n } = await this.updateImageCache([initializedImageElement]);\n\n if (erroredFiles.size) {\n throw new Error(\"Image cache update resulted with an error.\");\n }\n }\n\n const imageHTML = await ((_a = this.imageCache.get(fileId)) === null || _a === void 0 ? void 0 : _a.image);\n\n if (imageHTML && ((_b = this.state.newElement) === null || _b === void 0 ? void 0 : _b.id) !== initializedImageElement.id) {\n initializedImageElement = this.getLatestInitializedImageElement(placeholderImageElement, fileId);\n const naturalDimensions = this.getImageNaturalDimensions(initializedImageElement, imageHTML); // no need to create a new instance anymore, just assign the natural dimensions\n\n Object.assign(initializedImageElement, naturalDimensions);\n }\n\n resolve(initializedImageElement);\n } catch (error) {\n console.error(error);\n reject(new Error((0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"errors.imageInsertError\")));\n }\n });\n };\n /**\r\n * use during async image initialization,\r\n * when the placeholder image could have been modified in the meantime,\r\n * and when you don't want to loose those modifications\r\n */\n\n\n this.getLatestInitializedImageElement = (imagePlaceholder, fileId) => {\n var _a;\n\n const latestImageElement = (_a = this.scene.getElement(imagePlaceholder.id)) !== null && _a !== void 0 ? _a : imagePlaceholder;\n return (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newElementWith)(latestImageElement, {\n fileId\n });\n };\n\n this.onImageToolbarButtonClick = async () => {\n try {\n const clientX = this.state.width / 2 + this.state.offsetLeft;\n const clientY = this.state.height / 2 + this.state.offsetTop;\n const {\n x,\n y\n } = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)({\n clientX,\n clientY\n }, this.state);\n const imageFiles = await (0,_data_filesystem__WEBPACK_IMPORTED_MODULE_34__.fileOpen)({\n description: \"Image\",\n extensions: Object.keys(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.IMAGE_MIME_TYPES),\n multiple: true\n });\n this.insertImages(imageFiles, x, y);\n } catch (error) {\n if (error.name !== \"AbortError\") {\n console.error(error);\n } else {\n console.warn(error);\n }\n\n this.setState({\n newElement: null,\n activeTool: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateActiveTool)(this.state, {\n type: this.state.preferredSelectionTool.type\n })\n }, () => {\n this.actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_8__.actionFinalize);\n });\n }\n };\n\n this.getImageNaturalDimensions = (imageElement, imageHTML) => {\n const minHeight = Math.max(this.state.height - 120, 160); // max 65% of canvas height, clamped to <300px, vh - 120px>\n\n const maxHeight = Math.min(minHeight, Math.floor(this.state.height * 0.5) / this.state.zoom.value);\n const height = Math.min(imageHTML.naturalHeight, maxHeight);\n const width = height * (imageHTML.naturalWidth / imageHTML.naturalHeight); // add current imageElement width/height to account for previous centering\n // of the placeholder image\n\n const x = imageElement.x + imageElement.width / 2 - width / 2;\n const y = imageElement.y + imageElement.height / 2 - height / 2;\n return {\n x,\n y,\n width,\n height,\n crop: null\n };\n };\n /** updates image cache, refreshing updated elements and/or setting status\r\n to error for images that fail during <img> element creation */\n\n\n this.updateImageCache = async (elements, files = this.files) => {\n const {\n updatedFiles,\n erroredFiles\n } = await (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.updateImageCache)({\n imageCache: this.imageCache,\n fileIds: elements.map(element => element.fileId),\n files\n });\n\n if (erroredFiles.size) {\n this.store.scheduleAction(_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.CaptureUpdateAction.NEVER);\n this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().map(element => {\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isInitializedImageElement)(element) && erroredFiles.has(element.fileId)) {\n return (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newElementWith)(element, {\n status: \"error\"\n });\n }\n\n return element;\n }));\n }\n\n return {\n updatedFiles,\n erroredFiles\n };\n };\n /** adds new images to imageCache and re-renders if needed */\n\n\n this.addNewImagesToImageCache = async (imageElements = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getInitializedImageElements)(this.scene.getNonDeletedElements()), files = this.files) => {\n const uncachedImageElements = imageElements.filter(element => !element.isDeleted && !this.imageCache.has(element.fileId));\n\n if (uncachedImageElements.length) {\n const {\n updatedFiles\n } = await this.updateImageCache(uncachedImageElements, files);\n\n if (updatedFiles.size) {\n for (const element of uncachedImageElements) {\n if (updatedFiles.has(element.fileId)) {\n _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.ShapeCache.delete(element);\n }\n }\n }\n\n if (updatedFiles.size) {\n this.scene.triggerUpdate();\n }\n }\n };\n /** generally you should use `addNewImagesToImageCache()` directly if you need\r\n * to render new images. This is just a failsafe */\n\n\n this.scheduleImageRefresh = lodash_throttle__WEBPACK_IMPORTED_MODULE_1___default()(() => {\n this.addNewImagesToImageCache();\n }, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.IMAGE_RENDER_TIMEOUT);\n\n this.updateBindingEnabledOnPointerMove = event => {\n const shouldEnableBinding = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.shouldEnableBindingForPointerEvent)(event);\n\n if (this.state.isBindingEnabled !== shouldEnableBinding) {\n this.setState({\n isBindingEnabled: shouldEnableBinding\n });\n }\n };\n\n this.maybeSuggestBindingAtCursor = (pointerCoords, considerAll) => {\n const hoveredBindableElement = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getHoveredElementForBinding)(pointerCoords, this.scene.getNonDeletedElements(), this.scene.getNonDeletedElementsMap(), this.state.zoom, false, considerAll);\n this.setState({\n suggestedBindings: hoveredBindableElement != null ? [hoveredBindableElement] : []\n });\n };\n\n this.handleInteractiveCanvasRef = canvas => {\n var _a, _b; // canvas is null when unmounting\n\n\n if (canvas !== null) {\n this.interactiveCanvas = canvas; // -----------------------------------------------------------------------\n // NOTE wheel, touchstart, touchend events must be registered outside\n // of react because react binds them them passively (so we can't prevent\n // default on them)\n\n this.interactiveCanvas.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.TOUCH_START, this.onTouchStart, {\n passive: false\n });\n this.interactiveCanvas.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.TOUCH_END, this.onTouchEnd); // -----------------------------------------------------------------------\n } else {\n (_a = this.interactiveCanvas) === null || _a === void 0 ? void 0 : _a.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.TOUCH_START, this.onTouchStart);\n (_b = this.interactiveCanvas) === null || _b === void 0 ? void 0 : _b.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.TOUCH_END, this.onTouchEnd);\n }\n };\n\n this.insertImages = async (imageFiles, sceneX, sceneY) => {\n const gridPadding = 50 / this.state.zoom.value; // Create, position, and insert placeholders\n\n const placeholders = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.positionElementsOnGrid)(imageFiles.map(() => this.newImagePlaceholder({\n sceneX,\n sceneY\n })), sceneX, sceneY, gridPadding);\n placeholders.forEach(el => this.scene.insertElement(el)); // Create, position, insert and select initialized (replacing placeholders)\n\n const initialized = await Promise.all(placeholders.map(async (placeholder, i) => {\n try {\n return await this.initializeImage(placeholder, await (0,_data_blob__WEBPACK_IMPORTED_MODULE_33__.normalizeFile)(imageFiles[i]));\n } catch (error) {\n this.setState({\n errorMessage: error.message || (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"errors.imageInsertError\")\n });\n return (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newElementWith)(placeholder, {\n isDeleted: true\n });\n }\n }));\n const initializedMap = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.arrayToMap)(initialized);\n const positioned = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.positionElementsOnGrid)(initialized.filter(el => !el.isDeleted), sceneX, sceneY, gridPadding);\n const positionedMap = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.arrayToMap)(positioned);\n const nextElements = this.scene.getElementsIncludingDeleted().map(el => {\n var _a, _b;\n\n return (_b = (_a = positionedMap.get(el.id)) !== null && _a !== void 0 ? _a : initializedMap.get(el.id)) !== null && _b !== void 0 ? _b : el;\n });\n this.updateScene({\n appState: {\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)(Object.fromEntries(positioned.map(el => [el.id, true])), this.state)\n },\n elements: nextElements,\n captureUpdate: _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.CaptureUpdateAction.IMMEDIATELY\n });\n this.setState({}, () => {\n // actionFinalize after all state values have been updated\n this.actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_8__.actionFinalize);\n });\n };\n\n this.handleAppOnDrop = async event => {\n var _a;\n\n if (this.props.onDrop) {\n //zsviczian\n try {\n if ((await this.props.onDrop(event)) === false) {\n return;\n }\n } catch (e) {\n console.error(e);\n }\n }\n\n const {\n x: sceneX,\n y: sceneY\n } = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)(event, this.state);\n const dataTransferList = await (0,_clipboard__WEBPACK_IMPORTED_MODULE_24__.parseDataTransferEvent)(event); // must be retrieved first, in the same frame\n\n const fileItems = dataTransferList.getFiles();\n\n if (fileItems.length === 1) {\n const {\n file,\n fileHandle\n } = fileItems[0];\n\n if (file && (file.type === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.MIME_TYPES.png || file.type === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.MIME_TYPES.svg)) {\n try {\n const scene = await (0,_data__WEBPACK_IMPORTED_MODULE_25__.loadFromBlob)(file, this.state, this.scene.getElementsIncludingDeleted(), fileHandle);\n this.syncActionResult(Object.assign(Object.assign({}, scene), {\n appState: Object.assign(Object.assign({}, scene.appState || this.state), {\n isLoading: false\n }),\n replaceFiles: true,\n captureUpdate: _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.CaptureUpdateAction.IMMEDIATELY\n }));\n return;\n } catch (error) {\n if (error.name !== \"EncodingError\") {\n throw new Error((0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"alerts.couldNotLoadInvalidFile\"));\n } // if EncodingError, fall through to insert as regular image\n\n }\n }\n }\n\n const imageFiles = fileItems.map(data => data.file).filter(file => (0,_data_blob__WEBPACK_IMPORTED_MODULE_33__.isSupportedImageFile)(file));\n\n if (imageFiles.length > 0 && this.isToolSupported(\"image\")) {\n return this.insertImages(imageFiles, sceneX, sceneY);\n }\n\n const excalidrawLibrary_ids = dataTransferList.getData(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.MIME_TYPES.excalidrawlibIds);\n const excalidrawLibrary_data = dataTransferList.getData(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.MIME_TYPES.excalidrawlib);\n\n if (excalidrawLibrary_ids || excalidrawLibrary_data) {\n try {\n let libraryItems = null;\n\n if (excalidrawLibrary_ids) {\n const {\n itemIds\n } = JSON.parse(excalidrawLibrary_ids);\n const allLibraryItems = await this.library.getLatestLibrary();\n libraryItems = allLibraryItems.filter(item => itemIds.includes(item.id)); // legacy library dataTransfer format\n } else if (excalidrawLibrary_data) {\n libraryItems = (0,_data_blob__WEBPACK_IMPORTED_MODULE_33__.parseLibraryJSON)(excalidrawLibrary_data);\n }\n\n if (libraryItems === null || libraryItems === void 0 ? void 0 : libraryItems.length) {\n libraryItems = libraryItems.map(item => Object.assign(Object.assign({}, item), {\n // #6465\n elements: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.duplicateElements)({\n type: \"everything\",\n elements: item.elements,\n randomizeSeed: true\n }).duplicatedElements\n }));\n this.addElementsFromPasteOrLibrary({\n elements: (0,_data_library__WEBPACK_IMPORTED_MODULE_26__.distributeLibraryItemsOnSquareGrid)(libraryItems),\n position: event,\n files: null\n });\n }\n } catch (error) {\n this.setState({\n errorMessage: error.message\n });\n }\n\n return;\n }\n\n if (fileItems.length > 0) {\n const {\n file,\n fileHandle\n } = fileItems[0];\n\n if (file) {\n // Attempt to parse an excalidraw/excalidrawlib file\n await this.loadFileToCanvas(file, fileHandle);\n }\n }\n\n const textItem = dataTransferList.findByType(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.MIME_TYPES.text);\n\n if (textItem) {\n const text = textItem.value;\n\n if (text && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.embeddableURLValidator)(text, this.props.validateEmbeddable) && (/^(http|https):\\/\\/[^\\s/$.?#].[^\\s]*$/.test(text) || ((_a = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getEmbedLink)(text)) === null || _a === void 0 ? void 0 : _a.type) === \"video\")) {\n const embeddable = this.insertEmbeddableElement({\n sceneX,\n sceneY,\n link: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.normalizeLink)(text)\n });\n\n if (embeddable) {\n this.store.scheduleCapture();\n this.setState({\n selectedElementIds: {\n [embeddable.id]: true\n }\n });\n }\n }\n }\n };\n\n this.loadFileToCanvas = async (file, fileHandle) => {\n file = await (0,_data_blob__WEBPACK_IMPORTED_MODULE_33__.normalizeFile)(file);\n\n try {\n const elements = this.scene.getElementsIncludingDeleted();\n let ret;\n\n try {\n ret = await (0,_data_blob__WEBPACK_IMPORTED_MODULE_33__.loadSceneOrLibraryFromBlob)(file, this.state, elements, fileHandle);\n } catch (error) {\n const imageSceneDataError = error instanceof _errors__WEBPACK_IMPORTED_MODULE_38__.ImageSceneDataError;\n\n if (imageSceneDataError && error.code === \"IMAGE_NOT_CONTAINS_SCENE_DATA\" && !this.isToolSupported(\"image\")) {\n this.setState({\n isLoading: false,\n errorMessage: (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"errors.imageToolNotSupported\")\n });\n return;\n }\n\n const errorMessage = imageSceneDataError ? (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"alerts.cannotRestoreFromImage\") : (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"alerts.couldNotLoadInvalidFile\");\n this.setState({\n isLoading: false,\n errorMessage\n });\n }\n\n if (!ret) {\n return;\n }\n\n if (ret.type === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.MIME_TYPES.excalidraw) {\n // restore the fractional indices by mutating elements\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.syncInvalidIndices)(elements.concat(ret.data.elements)); // don't capture and only update the store snapshot for old elements,\n // otherwise we would end up with duplicated fractional indices on undo\n\n this.store.scheduleMicroAction({\n action: _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.CaptureUpdateAction.NEVER,\n elements,\n appState: undefined\n });\n this.setState({\n isLoading: true\n });\n this.syncActionResult(Object.assign(Object.assign({}, ret.data), {\n appState: Object.assign(Object.assign({}, ret.data.appState || this.state), {\n isLoading: false\n }),\n replaceFiles: true,\n captureUpdate: _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.CaptureUpdateAction.IMMEDIATELY\n }));\n } else if (ret.type === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.MIME_TYPES.excalidrawlib) {\n await this.library.updateLibrary({\n libraryItems: file,\n merge: true,\n openLibraryMenu: true\n }).catch(error => {\n console.error(error);\n this.setState({\n errorMessage: (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"errors.importLibraryError\")\n });\n });\n }\n } catch (error) {\n this.setState({\n isLoading: false,\n errorMessage: error.message\n });\n }\n };\n\n this.handleCanvasContextMenu = event => {\n event.preventDefault();\n\n if (this.state.disableContextMenu) {\n //zsviczian\n return;\n } //mfuria #329. if right-click pan is enabled, we suppress opening our custom menu too.\n\n\n if ((0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_70__.isPanWithRightMouseEnabled)()) {\n return;\n }\n\n if ((\"pointerType\" in event.nativeEvent && event.nativeEvent.pointerType === \"touch\" || \"pointerType\" in event.nativeEvent && event.nativeEvent.pointerType === \"pen\" && // always allow if user uses a pen secondary button\n event.button !== _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.POINTER_BUTTON.SECONDARY) && this.state.activeTool.type !== this.state.preferredSelectionTool.type) {\n return;\n }\n\n const {\n x,\n y\n } = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)(event, this.state);\n const element = this.getElementAtPosition(x, y, {\n preferSelected: true,\n includeLockedElements: true\n });\n const selectedElements = this.scene.getSelectedElements(this.state);\n const isHittingCommonBoundBox = this.isHittingCommonBoundingBoxOfSelectedElements({\n x,\n y\n }, selectedElements);\n const type = element || isHittingCommonBoundBox ? \"element\" : \"canvas\";\n const container = this.excalidrawContainerRef.current;\n const {\n top: offsetTop,\n left: offsetLeft\n } = container.getBoundingClientRect();\n const left = event.clientX - offsetLeft;\n const top = event.clientY - offsetTop;\n (0,_analytics__WEBPACK_IMPORTED_MODULE_21__.trackEvent)(\"contextMenu\", \"openContextMenu\", type);\n this.setState(Object.assign(Object.assign({}, element && !this.state.selectedElementIds[element.id] ? Object.assign(Object.assign(Object.assign({}, this.state), (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.selectGroupsForSelectedElements)({\n editingGroupId: this.state.editingGroupId,\n selectedElementIds: {\n [element.id]: true\n }\n }, this.scene.getNonDeletedElements(), this.state, this)), {\n selectedLinearElement: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLinearElement)(element) ? new _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor(element, this.scene.getNonDeletedElementsMap()) : null\n }) : this.state), {\n showHyperlinkPopup: false\n }), () => {\n this.setState({\n contextMenu: {\n top,\n left,\n items: this.getContextMenuItems(type)\n }\n });\n });\n };\n\n this.maybeDragNewGenericElement = (pointerDownState, event, informMutation = true) => {\n var _a, _b, _c, _d, _e;\n\n const selectionElement = this.state.selectionElement;\n const pointerCoords = pointerDownState.lastCoords;\n\n if (selectionElement && this.state.activeTool.type !== \"eraser\") {\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.dragNewElement)({\n newElement: selectionElement,\n elementType: this.state.activeTool.type,\n originX: pointerDownState.origin.x,\n originY: pointerDownState.origin.y,\n x: pointerCoords.x,\n y: pointerCoords.y,\n width: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.distance)(pointerDownState.origin.x, pointerCoords.x),\n height: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.distance)(pointerDownState.origin.y, pointerCoords.y),\n shouldMaintainAspectRatio: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.shouldMaintainAspectRatio)(event),\n shouldResizeFromCenter: false,\n scene: this.scene,\n zoom: this.state.zoom.value,\n informMutation: false\n });\n return;\n }\n\n const newElement = this.state.newElement;\n\n if (!newElement) {\n return;\n }\n\n let [gridX, gridY] = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(pointerCoords.x, pointerCoords.y, event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] ? null : this.getEffectiveGridSize());\n const image = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isInitializedImageElement)(newElement) && ((_a = this.imageCache.get(newElement.fileId)) === null || _a === void 0 ? void 0 : _a.image);\n const aspectRatio = image && !(image instanceof Promise) ? image.width / image.height : null;\n this.maybeCacheReferenceSnapPoints(event, [newElement]);\n const {\n snapOffset,\n snapLines\n } = (0,_snapping__WEBPACK_IMPORTED_MODULE_39__.snapNewElement)(newElement, this, event, {\n x: pointerDownState.originInGrid.x + ((_c = (_b = this.state.originSnapOffset) === null || _b === void 0 ? void 0 : _b.x) !== null && _c !== void 0 ? _c : 0),\n y: pointerDownState.originInGrid.y + ((_e = (_d = this.state.originSnapOffset) === null || _d === void 0 ? void 0 : _d.y) !== null && _e !== void 0 ? _e : 0)\n }, {\n x: gridX - pointerDownState.originInGrid.x,\n y: gridY - pointerDownState.originInGrid.y\n }, this.scene.getNonDeletedElementsMap());\n gridX += snapOffset.x;\n gridY += snapOffset.y;\n this.setState({\n snapLines\n });\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.dragNewElement)({\n newElement,\n elementType: this.state.activeTool.type,\n originX: pointerDownState.originInGrid.x,\n originY: pointerDownState.originInGrid.y,\n x: gridX,\n y: gridY,\n width: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.distance)(pointerDownState.originInGrid.x, gridX),\n height: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.distance)(pointerDownState.originInGrid.y, gridY),\n shouldMaintainAspectRatio: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isImageElement)(newElement) ? !(0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.shouldMaintainAspectRatio)(event) : (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.shouldMaintainAspectRatio)(event),\n shouldResizeFromCenter: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.shouldResizeFromCenter)(event),\n zoom: this.state.zoom.value,\n scene: this.scene,\n widthAspectRatio: aspectRatio,\n originOffset: this.state.originSnapOffset,\n informMutation\n });\n this.setState({\n newElement\n }); // highlight elements that are to be added to frames on frames creation\n\n if (this.state.activeTool.type === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.TOOL_TYPE.frame || this.state.activeTool.type === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.TOOL_TYPE.magicframe) {\n this.setState({\n elementsToHighlight: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getElementsInResizingFrame)(this.scene.getNonDeletedElements(), newElement, this.state, this.scene.getNonDeletedElementsMap())\n });\n }\n };\n\n this.maybeHandleCrop = (pointerDownState, event) => {\n var _a; // to crop, we must already be in the cropping mode, where croppingElement has been set\n\n\n if (!this.state.croppingElementId) {\n return false;\n }\n\n const transformHandleType = pointerDownState.resize.handleType;\n const pointerCoords = pointerDownState.lastCoords;\n const [x, y] = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(pointerCoords.x - pointerDownState.resize.offset.x, pointerCoords.y - pointerDownState.resize.offset.y, event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] ? null : this.getEffectiveGridSize());\n const croppingElement = this.scene.getNonDeletedElementsMap().get(this.state.croppingElementId);\n\n if (transformHandleType && croppingElement && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isImageElement)(croppingElement)) {\n const croppingAtStateStart = pointerDownState.originalElements.get(croppingElement.id);\n const image = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isInitializedImageElement)(croppingElement) && ((_a = this.imageCache.get(croppingElement.fileId)) === null || _a === void 0 ? void 0 : _a.image);\n\n if (croppingAtStateStart && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isImageElement)(croppingAtStateStart) && image && !(image instanceof Promise)) {\n const [gridX, gridY] = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(pointerCoords.x, pointerCoords.y, event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] ? null : this.getEffectiveGridSize());\n const dragOffset = {\n x: gridX - pointerDownState.originInGrid.x,\n y: gridY - pointerDownState.originInGrid.y\n };\n this.maybeCacheReferenceSnapPoints(event, [croppingElement]);\n const {\n snapOffset,\n snapLines\n } = (0,_snapping__WEBPACK_IMPORTED_MODULE_39__.snapResizingElements)([croppingElement], [croppingAtStateStart], this, event, dragOffset, transformHandleType);\n this.scene.mutateElement(croppingElement, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.cropElement)(croppingElement, this.scene.getNonDeletedElementsMap(), transformHandleType, image.naturalWidth, image.naturalHeight, x + snapOffset.x, y + snapOffset.y, event.shiftKey ? croppingAtStateStart.width / croppingAtStateStart.height : undefined));\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.updateBoundElements)(croppingElement, this.scene, {\n newSize: {\n width: croppingElement.width,\n height: croppingElement.height\n }\n });\n this.setState({\n isCropping: transformHandleType && transformHandleType !== \"rotation\",\n snapLines\n });\n }\n\n return true;\n }\n\n return false;\n };\n\n this.maybeHandleResize = (pointerDownState, event) => {\n const selectedElements = this.scene.getSelectedElements(this.state);\n const selectedFrames = selectedElements.filter(element => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isFrameLikeElement)(element));\n const transformHandleType = pointerDownState.resize.handleType;\n\n if ( // Frames cannot be rotated.\n selectedFrames.length > 0 && transformHandleType === \"rotation\" || // Elbow arrows cannot be transformed (resized or rotated).\n selectedElements.length === 1 && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(selectedElements[0]) || // Do not resize when in crop mode\n this.state.croppingElementId) {\n return false;\n }\n\n this.setState({\n // TODO: rename this state field to \"isScaling\" to distinguish\n // it from the generic \"isResizing\" which includes scaling and\n // rotating\n isResizing: transformHandleType && transformHandleType !== \"rotation\",\n isRotating: transformHandleType === \"rotation\",\n activeEmbeddable: null\n });\n const pointerCoords = pointerDownState.lastCoords;\n let [resizeX, resizeY] = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(pointerCoords.x - pointerDownState.resize.offset.x, pointerCoords.y - pointerDownState.resize.offset.y, event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] ? null : this.getEffectiveGridSize());\n const frameElementsOffsetsMap = new Map();\n selectedFrames.forEach(frame => {\n const elementsInFrame = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getFrameChildren)(this.scene.getNonDeletedElements(), frame.id);\n elementsInFrame.forEach(element => {\n frameElementsOffsetsMap.set(frame.id + element.id, {\n x: element.x - frame.x,\n y: element.y - frame.y\n });\n });\n }); // check needed for avoiding flickering when a key gets pressed\n // during dragging\n\n if (!this.state.selectedElementsAreBeingDragged) {\n const [gridX, gridY] = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(pointerCoords.x, pointerCoords.y, event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] ? null : this.getEffectiveGridSize());\n const dragOffset = {\n x: gridX - pointerDownState.originInGrid.x,\n y: gridY - pointerDownState.originInGrid.y\n };\n const originalElements = [...pointerDownState.originalElements.values()];\n this.maybeCacheReferenceSnapPoints(event, selectedElements);\n const {\n snapOffset,\n snapLines\n } = (0,_snapping__WEBPACK_IMPORTED_MODULE_39__.snapResizingElements)(selectedElements, (0,_scene__WEBPACK_IMPORTED_MODULE_31__.getSelectedElements)(originalElements, this.state), this, event, dragOffset, transformHandleType);\n resizeX += snapOffset.x;\n resizeY += snapOffset.y;\n this.setState({\n snapLines\n });\n }\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.transformElements)(pointerDownState.originalElements, transformHandleType, selectedElements, this.scene, (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.shouldRotateWithDiscreteAngle)(event), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.shouldResizeFromCenter)(event), selectedElements.some(element => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isImageElement)(element)) ? !(0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.shouldMaintainAspectRatio)(event) : (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.shouldMaintainAspectRatio)(event), resizeX, resizeY, pointerDownState.resize.center.x, pointerDownState.resize.center.y)) {\n const suggestedBindings = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getSuggestedBindingsForArrows)(selectedElements, this.scene.getNonDeletedElementsMap(), this.state.zoom);\n const elementsToHighlight = new Set();\n selectedFrames.forEach(frame => {\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getElementsInResizingFrame)(this.scene.getNonDeletedElements(), frame, this.state, this.scene.getNonDeletedElementsMap()).forEach(element => elementsToHighlight.add(element));\n });\n this.setState({\n elementsToHighlight: [...elementsToHighlight],\n suggestedBindings\n });\n return true;\n }\n\n return false;\n };\n\n this.getContextMenuItems = type => {\n const options = [];\n options.push(_actions__WEBPACK_IMPORTED_MODULE_8__.actionCopyAsPng, _actions__WEBPACK_IMPORTED_MODULE_8__.actionCopyAsSvg); // canvas contextMenu\n // -------------------------------------------------------------------------\n\n if (type === \"canvas\") {\n if (this.state.viewModeEnabled) {\n return [...options, _actions__WEBPACK_IMPORTED_MODULE_8__.actionToggleGridMode, _actions__WEBPACK_IMPORTED_MODULE_8__.actionToggleZenMode, _actions_actionToggleViewMode__WEBPACK_IMPORTED_MODULE_17__.actionToggleViewMode, _actions__WEBPACK_IMPORTED_MODULE_8__.actionToggleStats, _actions_actionCanvas__WEBPACK_IMPORTED_MODULE_10__.actionToggleLaserPointer];\n }\n\n return [_actions_actionClipboard__WEBPACK_IMPORTED_MODULE_11__.actionPaste, _ContextMenu__WEBPACK_IMPORTED_MODULE_55__.CONTEXT_MENU_SEPARATOR, _actions__WEBPACK_IMPORTED_MODULE_8__.actionCopyAsPng, _actions__WEBPACK_IMPORTED_MODULE_8__.actionCopyAsSvg, _actions__WEBPACK_IMPORTED_MODULE_8__.copyText, _ContextMenu__WEBPACK_IMPORTED_MODULE_55__.CONTEXT_MENU_SEPARATOR, _actions__WEBPACK_IMPORTED_MODULE_8__.actionSelectAll, _actions_actionElementLock__WEBPACK_IMPORTED_MODULE_13__.actionUnlockAllElements, _ContextMenu__WEBPACK_IMPORTED_MODULE_55__.CONTEXT_MENU_SEPARATOR, _actions__WEBPACK_IMPORTED_MODULE_8__.actionToggleGridMode, _actions__WEBPACK_IMPORTED_MODULE_8__.actionToggleObjectsSnapMode, _actions__WEBPACK_IMPORTED_MODULE_8__.actionToggleZenMode, _actions_actionToggleViewMode__WEBPACK_IMPORTED_MODULE_17__.actionToggleViewMode, _actions__WEBPACK_IMPORTED_MODULE_8__.actionToggleStats];\n } // element contextMenu\n // -------------------------------------------------------------------------\n\n\n options.push(_actions__WEBPACK_IMPORTED_MODULE_8__.copyText);\n\n if (this.state.viewModeEnabled) {\n return [_actions__WEBPACK_IMPORTED_MODULE_8__.actionCopy, ...options];\n }\n\n const zIndexActions = this.editorInterface.formFactor === \"desktop\" ? [_ContextMenu__WEBPACK_IMPORTED_MODULE_55__.CONTEXT_MENU_SEPARATOR, _actions__WEBPACK_IMPORTED_MODULE_8__.actionSendBackward, _actions__WEBPACK_IMPORTED_MODULE_8__.actionBringForward, _actions__WEBPACK_IMPORTED_MODULE_8__.actionSendToBack, _actions__WEBPACK_IMPORTED_MODULE_8__.actionBringToFront] : [];\n return [_ContextMenu__WEBPACK_IMPORTED_MODULE_55__.CONTEXT_MENU_SEPARATOR, _actions__WEBPACK_IMPORTED_MODULE_8__.actionCut, _actions__WEBPACK_IMPORTED_MODULE_8__.actionCopy, _actions_actionClipboard__WEBPACK_IMPORTED_MODULE_11__.actionPaste, _ContextMenu__WEBPACK_IMPORTED_MODULE_55__.CONTEXT_MENU_SEPARATOR, _actions_actionFrame__WEBPACK_IMPORTED_MODULE_14__.actionSelectAllElementsInFrame, _actions_actionFrame__WEBPACK_IMPORTED_MODULE_14__.actionRemoveAllElementsFromFrame, _actions_actionFrame__WEBPACK_IMPORTED_MODULE_14__.actionWrapSelectionInFrame, _ContextMenu__WEBPACK_IMPORTED_MODULE_55__.CONTEXT_MENU_SEPARATOR, _actions__WEBPACK_IMPORTED_MODULE_8__.actionToggleCropEditor, _ContextMenu__WEBPACK_IMPORTED_MODULE_55__.CONTEXT_MENU_SEPARATOR, ...options, _ContextMenu__WEBPACK_IMPORTED_MODULE_55__.CONTEXT_MENU_SEPARATOR, _actions__WEBPACK_IMPORTED_MODULE_8__.actionCopyStyles, _actions__WEBPACK_IMPORTED_MODULE_8__.actionPasteStyles, _ContextMenu__WEBPACK_IMPORTED_MODULE_55__.CONTEXT_MENU_SEPARATOR, _actions__WEBPACK_IMPORTED_MODULE_8__.actionGroup, _actions_actionTextAutoResize__WEBPACK_IMPORTED_MODULE_16__.actionTextAutoResize, _actions__WEBPACK_IMPORTED_MODULE_8__.actionUnbindText, _actions__WEBPACK_IMPORTED_MODULE_8__.actionBindText, _actions_actionBoundText__WEBPACK_IMPORTED_MODULE_9__.actionWrapTextInContainer, _actions__WEBPACK_IMPORTED_MODULE_8__.actionUngroup, _ContextMenu__WEBPACK_IMPORTED_MODULE_55__.CONTEXT_MENU_SEPARATOR, _actions__WEBPACK_IMPORTED_MODULE_8__.actionAddToLibrary, ...zIndexActions, _ContextMenu__WEBPACK_IMPORTED_MODULE_55__.CONTEXT_MENU_SEPARATOR, _actions__WEBPACK_IMPORTED_MODULE_8__.actionFlipHorizontal, _actions__WEBPACK_IMPORTED_MODULE_8__.actionFlipVertical, _ContextMenu__WEBPACK_IMPORTED_MODULE_55__.CONTEXT_MENU_SEPARATOR, _actions__WEBPACK_IMPORTED_MODULE_8__.actionToggleLinearEditor, _ContextMenu__WEBPACK_IMPORTED_MODULE_55__.CONTEXT_MENU_SEPARATOR, _actions__WEBPACK_IMPORTED_MODULE_8__.actionLink, _actions_actionElementLink__WEBPACK_IMPORTED_MODULE_12__.actionCopyElementLink, _ContextMenu__WEBPACK_IMPORTED_MODULE_55__.CONTEXT_MENU_SEPARATOR, _actions__WEBPACK_IMPORTED_MODULE_8__.actionDuplicateSelection, _actions__WEBPACK_IMPORTED_MODULE_8__.actionToggleElementLock, _ContextMenu__WEBPACK_IMPORTED_MODULE_55__.CONTEXT_MENU_SEPARATOR, _actions__WEBPACK_IMPORTED_MODULE_8__.actionDeleteSelected];\n };\n\n this.handleWheel = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(event => {\n var _a, _b, _c, _d; // if not scrolling on canvas/wysiwyg, ignore\n //zsviczian - begin\n\n\n const path = (_b = (_a = event).composedPath) === null || _b === void 0 ? void 0 : _b.call(_a);\n const isOnExcalidrawCanvas = (path === null || path === void 0 ? void 0 : path.some(n => {\n var _a;\n\n return n instanceof HTMLCanvasElement && ((_a = n.classList) === null || _a === void 0 ? void 0 : _a.contains(\"excalidraw__canvas\"));\n })) || ((_d = (_c = event.target) === null || _c === void 0 ? void 0 : _c.closest) === null || _d === void 0 ? void 0 : _d.call(_c, \"canvas.excalidraw__canvas\")) != null; //zsviczian - end\n\n if (!(isOnExcalidrawCanvas || //zsviczian\n event.target instanceof HTMLTextAreaElement || event.target instanceof HTMLIFrameElement)) {\n // prevent zooming the browser (but allow scrolling DOM)\n if (event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD]) {\n event.preventDefault();\n }\n\n return;\n }\n\n event.preventDefault();\n\n if (isPanning) {\n return;\n }\n\n const {\n deltaX,\n deltaY\n } = event; // note that event.ctrlKey is necessary to handle pinch zooming\n\n if ( //zsviczian\n (event.metaKey || event.ctrlKey) && !this.state.allowWheelZoom || !(event.metaKey || event.ctrlKey) && this.state.allowWheelZoom) {\n const sign = Math.sign(deltaY);\n const MAX_STEP = (0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_70__.getZoomStep)() * 100;\n const absDelta = Math.abs(deltaY);\n let delta = deltaY;\n\n if (absDelta > MAX_STEP) {\n delta = MAX_STEP * sign;\n }\n\n let newZoom = this.state.zoom.value - delta / 100; // increase zoom steps the more zoomed-in we are (applies to >100% only)\n\n newZoom += Math.log10(Math.max(1, this.state.zoom.value)) * -sign * // reduced amplification for small deltas (small movements on a trackpad)\n Math.min(1, absDelta / 20);\n this.translateCanvas(state => Object.assign(Object.assign({}, (0,_scene_zoom__WEBPACK_IMPORTED_MODULE_32__.getStateForZoom)({\n viewportX: this.lastViewportPosition.x,\n viewportY: this.lastViewportPosition.y,\n nextZoom: (0,_scene__WEBPACK_IMPORTED_MODULE_31__.getNormalizedZoom)(newZoom)\n }, state)), {\n shouldCacheIgnoreZoom: true\n }));\n this.resetShouldCacheIgnoreZoomDebounced();\n return;\n } // scroll horizontally when shift pressed\n\n\n if (event.shiftKey) {\n this.translateCanvas(({\n zoom,\n scrollX\n }) => ({\n // on Mac, shift+wheel tends to result in deltaX\n scrollX: scrollX - (deltaY || deltaX) / zoom.value\n }));\n return;\n }\n\n this.translateCanvas(({\n zoom,\n scrollX,\n scrollY\n }) => ({\n scrollX: scrollX - deltaX / zoom.value,\n scrollY: scrollY - deltaY / zoom.value\n }));\n });\n\n this.savePointer = (x, y, button) => {\n var _a, _b;\n\n if (!x || !y) {\n return;\n }\n\n const {\n x: sceneX,\n y: sceneY\n } = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)({\n clientX: x,\n clientY: y\n }, this.state);\n\n if (isNaN(sceneX) || isNaN(sceneY)) {// sometimes the pointer goes off screen\n }\n\n const pointer = {\n x: sceneX,\n y: sceneY,\n tool: this.state.activeTool.type === \"laser\" ? \"laser\" : \"pointer\"\n };\n (_b = (_a = this.props).onPointerUpdate) === null || _b === void 0 ? void 0 : _b.call(_a, {\n pointer,\n button,\n pointersMap: gesture.pointers\n });\n };\n\n this.resetShouldCacheIgnoreZoomDebounced = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.debounce)(() => {\n if (!this.unmounted) {\n this.setState({\n shouldCacheIgnoreZoom: false\n });\n }\n }, 300);\n\n this.updateDOMRect = cb => {\n var _a;\n\n if ((_a = this.excalidrawContainerRef) === null || _a === void 0 ? void 0 : _a.current) {\n const excalidrawContainer = this.excalidrawContainerRef.current;\n const {\n width,\n height,\n left: offsetLeft,\n top: offsetTop\n } = excalidrawContainer.getBoundingClientRect();\n const {\n width: currentWidth,\n height: currentHeight,\n offsetTop: currentOffsetTop,\n offsetLeft: currentOffsetLeft\n } = this.state;\n\n if (width === currentWidth && height === currentHeight && offsetLeft === currentOffsetLeft && offsetTop === currentOffsetTop) {\n if (cb) {\n cb();\n }\n\n return;\n } //zsviczian\n\n\n if (width === 0 || height === 0) {\n if (cb) {\n cb();\n }\n\n return;\n }\n\n this.setState({\n width,\n height,\n offsetLeft,\n offsetTop\n }, () => {\n cb && cb();\n });\n }\n };\n\n this.refresh = () => {\n this.setState(Object.assign({}, this.getCanvasOffsets()));\n };\n\n const defaultAppState = (0,_appState__WEBPACK_IMPORTED_MODULE_23__.getDefaultAppState)();\n const {\n excalidrawAPI,\n viewModeEnabled = false,\n zenModeEnabled = false,\n gridModeEnabled = false,\n objectsSnapModeEnabled = false,\n theme = defaultAppState.theme,\n initState,\n //zsviczian\n name = `${(0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"labels.untitled\")}-${(0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getDateTime)()}`\n } = props;\n this.state = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, defaultAppState), {\n theme,\n isLoading: true\n }), this.getCanvasOffsets()), {\n viewModeEnabled,\n zenModeEnabled,\n objectsSnapModeEnabled,\n gridModeEnabled: gridModeEnabled !== null && gridModeEnabled !== void 0 ? gridModeEnabled : defaultAppState.gridModeEnabled,\n name,\n width: window.innerWidth,\n height: window.innerHeight\n }), initState !== null && initState !== void 0 ? initState : {});\n this.refreshEditorInterface();\n this.stylesPanelMode = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.deriveStylesPanelMode)(this.editorInterface);\n this.id = (0,nanoid__WEBPACK_IMPORTED_MODULE_73__.nanoid)();\n (0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_70__.initializeObsidianUtils)();\n this.library = new _data_library__WEBPACK_IMPORTED_MODULE_26__[\"default\"](this);\n this.actionManager = new _actions_manager__WEBPACK_IMPORTED_MODULE_18__.ActionManager(this.syncActionResult, () => this.state, () => this.scene.getElementsIncludingDeleted(), this);\n this.scene = new _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.Scene();\n this.canvas = document.createElement(\"canvas\");\n this.rc = roughjs_bin_rough__WEBPACK_IMPORTED_MODULE_4__[\"default\"].canvas(this.canvas);\n this.renderer = new _scene_Renderer__WEBPACK_IMPORTED_MODULE_41__.Renderer(this.scene);\n this.visibleElements = [];\n this.store = new _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.Store(this);\n this.history = new _history__WEBPACK_IMPORTED_MODULE_29__.History(this.store);\n\n if (excalidrawAPI) {\n const api = {\n updateScene: this.updateScene,\n applyDeltas: this.applyDeltas,\n mutateElement: this.mutateElement,\n updateLibrary: this.library.updateLibrary,\n addFiles: this.addFiles,\n resetScene: this.resetScene,\n getSceneElementsIncludingDeleted: this.getSceneElementsIncludingDeleted,\n getSceneElementsMapIncludingDeleted: this.getSceneElementsMapIncludingDeleted,\n history: {\n clear: this.resetHistory\n },\n scrollToContent: this.scrollToContent,\n setForceRenderAllEmbeddables: this.setForceRenderAllEmbeddables,\n zoomToFit: this.zoomToFit,\n refreshEditorInterface: this.refreshEditorInterface,\n setTrayModeEnabled: this.setTrayModeEnabled,\n setDesktopUIMode: this.setDesktopUIMode,\n setMobileModeAllowed: this.setMobileModeAllowed,\n isTouchScreen: this.isTouchScreen,\n isTrayModeEnabled: this.isTrayModeEnabled,\n getColorAtScenePoint: this.getColorAtScenePoint,\n startLineEditor: this.startLineEditor,\n getSceneElements: this.getSceneElements,\n getAppState: () => this.state,\n getFiles: () => this.files,\n getName: this.getName,\n registerAction: action => {\n this.actionManager.registerAction(action);\n },\n refresh: this.refresh,\n setToast: this.setToast,\n updateContainerSize: this.updateContainerSize,\n id: this.id,\n selectElements: this.selectElements,\n sendBackward: this.sendBackward,\n bringForward: this.bringForward,\n sendToBack: this.sendToBack,\n bringToFront: this.bringToFront,\n setActiveTool: this.setActiveTool,\n setCursor: this.setCursor,\n resetCursor: this.resetCursor,\n getEditorInterface: () => this.editorInterface,\n updateFrameRendering: this.updateFrameRendering,\n toggleSidebar: this.toggleSidebar,\n getHTMLIFrameElement: id => this.getHTMLIFrameElement(id),\n onChange: cb => this.onChangeEmitter.on(cb),\n onIncrement: cb => this.store.onStoreIncrementEmitter.on(cb),\n onPointerDown: cb => this.onPointerDownEmitter.on(cb),\n onPointerUp: cb => this.onPointerUpEmitter.on(cb),\n onScrollChange: cb => this.onScrollChangeEmitter.on(cb),\n onUserFollow: cb => this.onUserFollowEmitter.on(cb)\n };\n\n if (typeof excalidrawAPI === \"function\") {\n excalidrawAPI(api);\n } else {\n console.error(\"excalidrawAPI should be a function!\");\n }\n }\n\n this.excalidrawContainerValue = {\n container: this.excalidrawContainerRef.current,\n id: this.id\n };\n this.fonts = new _fonts__WEBPACK_IMPORTED_MODULE_36__.Fonts(this.scene);\n this.history = new _history__WEBPACK_IMPORTED_MODULE_29__.History(this.store);\n this.actionManager.registerAll(_actions_register__WEBPACK_IMPORTED_MODULE_19__.actions);\n this.actionManager.registerAction((0,_actions_actionHistory__WEBPACK_IMPORTED_MODULE_15__.createUndoAction)(this.history));\n this.actionManager.registerAction((0,_actions_actionHistory__WEBPACK_IMPORTED_MODULE_15__.createRedoAction)(this.history));\n }\n\n onWindowMessage(event) {\n if (event.origin !== \"https://player.vimeo.com\" && event.origin !== \"https://www.youtube.com\") {\n return;\n }\n\n let data = null;\n\n try {\n data = JSON.parse(event.data);\n } catch (e) {}\n\n if (!data) {\n return;\n }\n\n switch (event.origin) {\n case \"https://player.vimeo.com\":\n //Allowing for multiple instances of Excalidraw running in the window\n if (data.method === \"paused\") {\n let source = null;\n const iframes = document.body.querySelectorAll(\"iframe.excalidraw__embeddable\");\n\n if (!iframes) {\n break;\n }\n\n for (const iframe of iframes) {\n if (iframe.contentWindow === event.source) {\n source = iframe.contentWindow;\n }\n }\n\n source === null || source === void 0 ? void 0 : source.postMessage(JSON.stringify({\n method: data.value ? \"play\" : \"pause\",\n value: true\n }), \"*\");\n }\n\n break;\n\n case \"https://www.youtube.com\":\n if (data.event === \"infoDelivery\" && data.info && data.id && typeof data.info.playerState === \"number\") {\n const id = data.id;\n const playerState = data.info.playerState;\n\n if (Object.values(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.YOUTUBE_STATES).includes(playerState)) {\n YOUTUBE_VIDEO_STATES.set(id, playerState);\n }\n }\n\n break;\n }\n }\n\n cacheEmbeddableRef(element, ref) {\n if (ref) {\n this.iFrameRefs.set(element.id, ref);\n }\n }\n\n getHTMLIFrameElement(element) {\n //zsviczian\n if (typeof element === \"string\") {\n return this.iFrameRefs.get(element);\n }\n\n return this.iFrameRefs.get(element.id);\n }\n\n handleEmbeddableCenterClick(element) {\n var _a, _b, _c, _d;\n\n if (((_a = this.state.activeEmbeddable) === null || _a === void 0 ? void 0 : _a.element) === element && ((_b = this.state.activeEmbeddable) === null || _b === void 0 ? void 0 : _b.state) === \"active\") {\n return;\n } // The delay serves two purposes\n // 1. To prevent first click propagating to iframe on mobile,\n // else the click will immediately start and stop the video\n // 2. If the user double clicks the frame center to activate it\n // without the delay youtube will immediately open the video\n // in fullscreen mode\n\n\n setTimeout(() => {\n this.setState({\n activeEmbeddable: {\n element,\n state: \"active\"\n },\n selectedElementIds: {\n [element.id]: true\n },\n newElement: null,\n selectionElement: null\n });\n }, 100);\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isIframeElement)(element)) {\n return;\n }\n\n const iframe = this.getHTMLIFrameElement(element);\n\n if (!(iframe === null || iframe === void 0 ? void 0 : iframe.contentWindow)) {\n return;\n }\n\n if (iframe.src.includes(\"youtube\")) {\n const state = YOUTUBE_VIDEO_STATES.get(element.id);\n\n if (!state) {\n YOUTUBE_VIDEO_STATES.set(element.id, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.YOUTUBE_STATES.UNSTARTED);\n iframe.contentWindow.postMessage(JSON.stringify({\n event: \"listening\",\n id: element.id\n }), \"*\");\n }\n\n switch (state) {\n case _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.YOUTUBE_STATES.PLAYING:\n case _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.YOUTUBE_STATES.BUFFERING:\n (_c = iframe.contentWindow) === null || _c === void 0 ? void 0 : _c.postMessage(JSON.stringify({\n event: \"command\",\n func: \"pauseVideo\",\n args: \"\"\n }), \"*\");\n break;\n\n default:\n (_d = iframe.contentWindow) === null || _d === void 0 ? void 0 : _d.postMessage(JSON.stringify({\n event: \"command\",\n func: \"playVideo\",\n args: \"\"\n }), \"*\");\n }\n }\n\n if (iframe.src.includes(\"player.vimeo.com\")) {\n iframe.contentWindow.postMessage(JSON.stringify({\n method: \"paused\" //video play/pause in onWindowMessage handler\n\n }), \"*\");\n }\n }\n\n isIframeLikeElementCenter(el, event, sceneX, sceneY) {\n var _a, _b;\n\n return el && !event.altKey && !event.shiftKey && !event.metaKey && !event.ctrlKey && (((_a = this.state.activeEmbeddable) === null || _a === void 0 ? void 0 : _a.element) !== el || ((_b = this.state.activeEmbeddable) === null || _b === void 0 ? void 0 : _b.state) === \"hover\" || !this.state.activeEmbeddable) && sceneX >= el.x + el.width / 3 && sceneX <= el.x + 2 * el.width / 3 && sceneY >= el.y + el.height / 3 && sceneY <= el.y + 2 * el.height / 3;\n }\n\n renderEmbeddables() {\n const scale = this.state.zoom.value;\n const normalizedWidth = this.state.width;\n const normalizedHeight = this.state.height;\n const embeddableElements = this.scene.getNonDeletedElements().filter(el => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isEmbeddableElement)(el) && this.embedsValidationStatus.get(el.id) === true || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isIframeElement)(el));\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, embeddableElements.map(el => {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;\n\n const {\n x,\n y\n } = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.sceneCoordsToViewportCoords)({\n sceneX: el.x,\n sceneY: el.y\n }, this.state); //zsviczian - shouldRenderAllEmbeddables\n\n const isVisible = this.shouldRenderAllEmbeddables || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElementInViewport)(el, normalizedWidth, normalizedHeight, this.state, this.scene.getNonDeletedElementsMap());\n const hasBeenInitialized = this.initializedEmbeds.has(el.id);\n\n if (isVisible && !hasBeenInitialized) {\n this.initializedEmbeds.add(el.id);\n }\n\n const shouldRender = isVisible || hasBeenInitialized;\n\n if (!shouldRender) {\n return null;\n }\n\n let src;\n const embedLink = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getEmbedLink)((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.toValidURL)(el.link || \"\")); //zsviczian\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isIframeElement)(el)) {\n src = null;\n const data = ((_b = (_a = el.customData) === null || _a === void 0 ? void 0 : _a.generationData) !== null && _b !== void 0 ? _b : this.magicGenerations.get(el.id)) || {\n status: \"error\",\n message: \"No generation data\",\n code: \"ERR_NO_GENERATION_DATA\"\n };\n\n if (data.status === \"done\") {\n const html = data.html;\n src = {\n intrinsicSize: {\n w: el.width,\n h: el.height\n },\n type: \"document\",\n srcdoc: () => {\n return html;\n }\n };\n } else if (data.status === \"pending\") {\n src = {\n intrinsicSize: {\n w: el.width,\n h: el.height\n },\n type: \"document\",\n srcdoc: () => {\n return (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.createSrcDoc)(`\n <style>\n html, body {\n width: 100%;\n height: 100%;\n color: ${this.state.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.THEME.DARK ? \"white\" : \"black\"};\n }\n body {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n gap: 1rem;\n }\n\n .Spinner {\n display: flex;\n align-items: center;\n justify-content: center;\n margin-left: auto;\n margin-right: auto;\n }\n\n .Spinner svg {\n animation: rotate 1.6s linear infinite;\n transform-origin: center center;\n width: 40px;\n height: 40px;\n }\n\n .Spinner circle {\n stroke: currentColor;\n animation: dash 1.6s linear 0s infinite;\n stroke-linecap: round;\n }\n\n @keyframes rotate {\n 100% {\n transform: rotate(360deg);\n }\n }\n\n @keyframes dash {\n 0% {\n stroke-dasharray: 1, 300;\n stroke-dashoffset: 0;\n }\n 50% {\n stroke-dasharray: 150, 300;\n stroke-dashoffset: -200;\n }\n 100% {\n stroke-dasharray: 1, 300;\n stroke-dashoffset: -280;\n }\n }\n </style>\n <div class=\"Spinner\">\n <svg\n viewBox=\"0 0 100 100\"\n >\n <circle\n cx=\"50\"\n cy=\"50\"\n r=\"46\"\n stroke-width=\"8\"\n fill=\"none\"\n stroke-miter-limit=\"10\"\n />\n </svg>\n </div>\n <div>Generating...</div>\n `);\n }\n };\n } else {\n let message;\n\n if (data.code === \"ERR_GENERATION_INTERRUPTED\") {\n message = \"Generation was interrupted...\";\n } else {\n message = data.message || \"Generation failed\";\n }\n\n src = {\n intrinsicSize: {\n w: el.width,\n h: el.height\n },\n type: \"document\",\n srcdoc: () => {\n return (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.createSrcDoc)(`\n <style>\n html, body {\n height: 100%;\n }\n body {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n color: ${_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.COLOR_PALETTE.red[3]};\n }\n h1, h3 {\n margin-top: 0;\n margin-bottom: 0.5rem;\n }\n </style>\n <h1>Error!</h1>\n <h3>${message}</h3>\n `);\n }\n };\n }\n } else {\n src = embedLink; //zsviczian getEmbedLink(toValidURL(el.link || \"\"));\n }\n\n const isActive = ((_c = this.state.activeEmbeddable) === null || _c === void 0 ? void 0 : _c.element) === el && ((_d = this.state.activeEmbeddable) === null || _d === void 0 ? void 0 : _d.state) === \"active\";\n const isHovered = ((_e = this.state.activeEmbeddable) === null || _e === void 0 ? void 0 : _e.element) === el && ((_f = this.state.activeEmbeddable) === null || _f === void 0 ? void 0 : _f.state) === \"hover\";\n const isWebview = //zsviczian\n !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isIframeElement)(el) && this.props.renderWebview && (embedLink === null || embedLink === void 0 ? void 0 : embedLink.type) !== \"document\" && !((_h = (_g = embedLink === null || embedLink === void 0 ? void 0 : embedLink.link) === null || _g === void 0 ? void 0 : _g.startsWith) === null || _h === void 0 ? void 0 : _h.call(_g, \"https://player.vimeo.com\")); // Modify the scale based on el.scale property\n\n const [xScale, yScale] = (_j = el.scale) !== null && _j !== void 0 ? _j : [1, 1]; //zsviczian\n\n const scaledTransform = `scale(${scale * xScale}, ${scale * yScale})`;\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n key: el.id,\n className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"excalidraw__embeddable-container\", {\n \"is-hovered\": isHovered\n }),\n style: {\n transform: isVisible ? `translate(${x - this.state.offsetLeft}px, ${y - this.state.offsetTop}px) ${scaledTransform}` : \"none\",\n display: isVisible ? \"block\" : \"none\",\n opacity: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getRenderOpacity)(el, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getContainingFrame)(el, this.scene.getNonDeletedElementsMap()), this.elementsPendingErasure, null, ((_k = this.state.openDialog) === null || _k === void 0 ? void 0 : _k.name) === \"elementLinkSelector\" ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.DEFAULT_REDUCED_GLOBAL_ALPHA : 1),\n [\"--embeddable-radius\"]: `${(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getCornerRadius)(Math.min(el.width, el.height), el) / xScale //zsviczian\n }px`\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n //this is a hack that addresses isse with embedded excalidraw.com embeddable\n //https://github.com/excalidraw/excalidraw/pull/6691#issuecomment-1607383938\n\n /*ref={(ref) => {\r\n if (!this.excalidrawContainerRef.current) {\r\n return;\r\n }\r\n const container = this.excalidrawContainerRef.current;\r\n const sh = container.scrollHeight;\r\n const ch = container.clientHeight;\r\n if (sh !== ch) {\r\n container.style.height = `${sh}px`;\r\n setTimeout(() => {\r\n container.style.height = `100%`;\r\n });\r\n }\r\n }}*/\n className: \"excalidraw__embeddable-container__inner\",\n style: {\n width: isVisible ? `${el.width / xScale}px` : 0,\n height: isVisible ? `${el.height / yScale}px` : 0,\n transform: isVisible ? `rotate(${el.angle}rad)` : \"none\",\n pointerEvents: isActive ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.POINTER_EVENTS.enabled : _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.POINTER_EVENTS.disabled\n }\n }, isHovered && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"excalidraw__embeddable-hint\"\n }, (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"buttons.embeddableInteractionButton\")), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"excalidraw__embeddable__outer\",\n style: {\n padding: `${el.strokeWidth / (4 * el.scale[0])}px` //zsviczian MDEmbeddable round border cutoff issue\n\n }\n }, (_o = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isEmbeddableElement)(el) ? (_m = (_l = this.props).renderEmbeddable) === null || _m === void 0 ? void 0 : _m.call(_l, el, this.state) //zsviczian\n : null) !== null && _o !== void 0 ? _o : isWebview ?\n /*#__PURE__*/\n //zsviczian\n react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"webview\", {\n ref: ref => this.cacheEmbeddableRef(el, ref),\n className: \"excalidraw__embeddable\",\n src: (embedLink === null || embedLink === void 0 ? void 0 : embedLink.type) === \"generic\" || (embedLink === null || embedLink === void 0 ? void 0 : embedLink.type) === \"video\" ? embedLink.link : \"\",\n title: \"Excalidraw Embedded Content\",\n allowFullScreen: true\n }) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"iframe\", {\n ref: ref => this.cacheEmbeddableRef(el, ref),\n className: \"excalidraw__embeddable\",\n srcDoc: (src === null || src === void 0 ? void 0 : src.type) === \"document\" ? src.srcdoc(this.state.theme) : undefined,\n src: (src === null || src === void 0 ? void 0 : src.type) !== \"document\" ? (_p = src === null || src === void 0 ? void 0 : src.link) !== null && _p !== void 0 ? _p : \"\" : undefined,\n // https://stackoverflow.com/q/18470015\n // scrolling=\"no\" //zsviczian\n referrerPolicy: \"no-referrer-when-downgrade\",\n title: \"Excalidraw Embedded Content\",\n allow: \"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\",\n allowFullScreen: true,\n sandbox: `${((_q = src === null || src === void 0 ? void 0 : src.sandbox) === null || _q === void 0 ? void 0 : _q.allowSameOrigin) ? \"allow-same-origin\" : \"\"} allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation allow-downloads`\n }))));\n }));\n }\n\n toggleOverscrollBehavior(event) {\n // when pointer inside editor, disable overscroll behavior to prevent\n // panning to trigger history back/forward on MacOS Chrome\n document.documentElement.style.overscrollBehaviorX = event.type === \"pointerenter\" ? \"none\" : \"auto\";\n }\n\n render() {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;\n\n const selectedElements = this.scene.getSelectedElements(this.state);\n const {\n renderTopRightUI,\n renderTopLeftUI,\n renderCustomStats\n } = this.props;\n const sceneNonce = this.scene.getSceneNonce();\n const {\n elementsMap,\n visibleElements\n } = this.renderer.getRenderableElements({\n sceneNonce,\n zoom: this.state.zoom,\n offsetLeft: this.state.offsetLeft,\n offsetTop: this.state.offsetTop,\n scrollX: this.state.scrollX,\n scrollY: this.state.scrollY,\n height: this.state.height,\n width: this.state.width,\n editingTextElement: this.state.editingTextElement,\n newElementId: (_a = this.state.newElement) === null || _a === void 0 ? void 0 : _a.id\n });\n this.visibleElements = visibleElements;\n const allElementsMap = this.scene.getNonDeletedElementsMap();\n const shouldBlockPointerEvents = // default back to `--ui-pointerEvents` flow if setPointerCapture\n // not supported\n \"setPointerCapture\" in HTMLElement.prototype ? false : this.state.selectionElement || this.state.newElement || this.state.selectedElementsAreBeingDragged || this.state.resizingElement || this.state.activeTool.type === \"laser\" && // technically we can just test on this once we make it more safe\n this.state.cursorButton === \"down\";\n const firstSelectedElement = selectedElements[0]; //zsviczian\n\n const isHighlighter = (_d = (_c = (_b = this.state.newElement) === null || _b === void 0 ? void 0 : _b.customData) === null || _c === void 0 ? void 0 : _c.strokeOptions) === null || _d === void 0 ? void 0 : _d.highlighter;\n const showShapeSwitchPanel = ((_e = _editor_jotai__WEBPACK_IMPORTED_MODULE_37__.editorJotaiStore.get(_ConvertElementTypePopup__WEBPACK_IMPORTED_MODULE_52__.convertElementTypePopupAtom)) === null || _e === void 0 ? void 0 : _e.type) === \"panel\";\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"excalidraw excalidraw-container\", {\n \"excalidraw--view-mode\": this.state.viewModeEnabled || ((_f = this.state.openDialog) === null || _f === void 0 ? void 0 : _f.name) === \"elementLinkSelector\",\n \"excalidraw--mobile\": this.editorInterface.formFactor === \"phone\",\n \"excalidraw--tray\": !(this.state.viewModeEnabled || this.state.zenModeEnabled) && this.editorInterface.formFactor !== \"phone\" && this.editorInterface.preferTrayMode //zsviczian\n\n }),\n style: Object.assign(Object.assign({\n //zsviczian\n [\"--ui-pointerEvents\"]: shouldBlockPointerEvents ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.POINTER_EVENTS.disabled : _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.POINTER_EVENTS.enabled\n }, this.state.dynamicStyle || {}), {\n [\"--right-sidebar-width\"]: \"302px\"\n }),\n ref: this.excalidrawContainerRef,\n onDrop: this.handleAppOnDrop,\n tabIndex: 0,\n onKeyDown: this.props.handleKeyboardGlobally ? undefined : this.onKeyDown,\n onPointerEnter: this.toggleOverscrollBehavior,\n onPointerLeave: this.toggleOverscrollBehavior\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(AppContext.Provider, {\n value: this\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(AppPropsContext.Provider, {\n value: this.props\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(ExcalidrawContainerContext.Provider, {\n value: this.excalidrawContainerValue\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(EditorInterfaceContext.Provider, {\n value: this.editorInterface\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(ExcalidrawSetAppStateContext.Provider, {\n value: this.setAppState\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(ExcalidrawAppStateContext.Provider, {\n value: this.state\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(ExcalidrawElementsContext.Provider, {\n value: this.scene.getNonDeletedElements()\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(ExcalidrawActionManagerContext.Provider, {\n value: this.actionManager\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_LayerUI__WEBPACK_IMPORTED_MODULE_58__[\"default\"], {\n canvas: this.canvas,\n appState: this.state,\n files: this.files,\n setAppState: this.setAppState,\n actionManager: this.actionManager,\n elements: this.scene.getNonDeletedElements(),\n onLockToggle: this.toggleLock,\n onPenModeToggle: this.togglePenMode,\n onHandToolToggle: this.onHandToolToggle,\n langCode: (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.getLanguage)().code,\n renderTopLeftUI: renderTopLeftUI,\n renderTopRightUI: renderTopRightUI,\n renderCustomStats: renderCustomStats,\n showExitZenModeBtn: typeof ((_g = this.props) === null || _g === void 0 ? void 0 : _g.zenModeEnabled) === \"undefined\" && this.state.zenModeEnabled,\n UIOptions: this.props.UIOptions,\n onExportImage: this.onExportImage,\n renderWelcomeScreen: !this.state.isLoading && this.state.showWelcomeScreen && this.state.activeTool.type === this.state.preferredSelectionTool.type && !this.state.zenModeEnabled && !this.scene.getElementsIncludingDeleted().length,\n app: this,\n isCollaborating: this.props.isCollaborating,\n generateLinkForSelection: this.props.generateLinkForSelection\n }, this.props.children), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"excalidraw-textEditorContainer\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"excalidraw-contextMenuContainer\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"div\", {\n className: \"excalidraw-eye-dropper-container\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_SVGLayer__WEBPACK_IMPORTED_MODULE_60__.SVGLayer, {\n trails: [this.laserTrails, this.lassoTrail, this.eraserTrail]\n }), selectedElements.length === 1 && ((_h = this.state.openDialog) === null || _h === void 0 ? void 0 : _h.name) !== \"elementLinkSelector\" && this.state.showHyperlinkPopup && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_components_hyperlink_Hyperlink__WEBPACK_IMPORTED_MODULE_35__.Hyperlink, {\n key: firstSelectedElement.id,\n element: firstSelectedElement,\n scene: this.scene,\n setAppState: this.setAppState,\n onLinkOpen: this.props.onLinkOpen,\n setToast: this.setToast,\n updateEmbedValidationStatus: this.updateEmbedValidationStatus\n }), this.props.aiEnabled !== false && selectedElements.length === 1 && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isMagicFrameElement)(firstSelectedElement) && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_components_ElementCanvasButtons__WEBPACK_IMPORTED_MODULE_43__.ElementCanvasButtons, {\n element: firstSelectedElement,\n elementsMap: elementsMap\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_MagicButton__WEBPACK_IMPORTED_MODULE_59__.ElementCanvasButton, {\n title: (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"labels.convertToCode\"),\n icon: _icons__WEBPACK_IMPORTED_MODULE_66__.MagicIcon,\n checked: false,\n onChange: () => this.onMagicFrameGenerate(firstSelectedElement, \"button\")\n })), selectedElements.length === 1 && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isIframeElement)(firstSelectedElement) && ((_k = (_j = firstSelectedElement.customData) === null || _j === void 0 ? void 0 : _j.generationData) === null || _k === void 0 ? void 0 : _k.status) === \"done\" && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_components_ElementCanvasButtons__WEBPACK_IMPORTED_MODULE_43__.ElementCanvasButtons, {\n element: firstSelectedElement,\n elementsMap: elementsMap\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_MagicButton__WEBPACK_IMPORTED_MODULE_59__.ElementCanvasButton, {\n title: (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"labels.copySource\"),\n icon: _icons__WEBPACK_IMPORTED_MODULE_66__.copyIcon,\n checked: false,\n onChange: () => this.onIframeSrcCopy(firstSelectedElement)\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_MagicButton__WEBPACK_IMPORTED_MODULE_59__.ElementCanvasButton, {\n title: \"Enter fullscreen\",\n icon: _icons__WEBPACK_IMPORTED_MODULE_66__.fullscreenIcon,\n checked: false,\n onChange: () => {\n const iframe = this.getHTMLIFrameElement(firstSelectedElement);\n\n if (iframe) {\n try {\n iframe.requestFullscreen();\n this.setState({\n activeEmbeddable: {\n element: firstSelectedElement,\n state: \"active\"\n },\n selectedElementIds: {\n [firstSelectedElement.id]: true\n },\n newElement: null,\n selectionElement: null\n });\n } catch (err) {\n console.warn(err);\n this.setState({\n errorMessage: \"Couldn't enter fullscreen\"\n });\n }\n }\n }\n })), this.state.toast !== null && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_Toast__WEBPACK_IMPORTED_MODULE_67__.Toast, {\n message: this.state.toast.message,\n onClose: this.handleToastClose,\n duration: this.state.toast.duration,\n closable: this.state.toast.closable\n }), this.state.contextMenu && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_ContextMenu__WEBPACK_IMPORTED_MODULE_55__.ContextMenu, {\n items: this.state.contextMenu.items,\n top: this.state.contextMenu.top,\n left: this.state.contextMenu.left,\n actionManager: this.actionManager,\n onClose: callback => {\n this.setState({\n contextMenu: null\n }, () => {\n this.focusContainer();\n callback === null || callback === void 0 ? void 0 : callback();\n });\n }\n }), this.state.newElement && isHighlighter &&\n /*#__PURE__*/\n //zsviczian\n react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_canvases_NewElementCanvas__WEBPACK_IMPORTED_MODULE_64__[\"default\"], {\n appState: this.state,\n scale: window.devicePixelRatio,\n rc: this.rc,\n elementsMap: elementsMap,\n allElementsMap: allElementsMap,\n renderConfig: {\n imageCache: this.imageCache,\n isExporting: false,\n renderGrid: false,\n canvasBackgroundColor: this.state.viewBackgroundColor,\n embedsValidationStatus: this.embedsValidationStatus,\n elementsPendingErasure: this.elementsPendingErasure,\n pendingFlowchartNodes: null,\n isHighlighterPenDrawing: isHighlighter //zsviczian\n\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_canvases__WEBPACK_IMPORTED_MODULE_63__.StaticCanvas, {\n canvas: this.canvas,\n rc: this.rc,\n elementsMap: elementsMap,\n allElementsMap: allElementsMap,\n visibleElements: visibleElements,\n sceneNonce: sceneNonce,\n selectionNonce: (_l = this.state.selectionElement) === null || _l === void 0 ? void 0 : _l.versionNonce,\n scale: window.devicePixelRatio,\n appState: this.state,\n renderConfig: {\n imageCache: this.imageCache,\n isExporting: false,\n renderGrid: (0,_snapping__WEBPACK_IMPORTED_MODULE_39__.isGridModeEnabled)(this),\n canvasBackgroundColor: this.state.viewBackgroundColor,\n embedsValidationStatus: this.embedsValidationStatus,\n elementsPendingErasure: this.elementsPendingErasure,\n pendingFlowchartNodes: this.flowChartCreator.pendingNodes,\n isHighlighterPenDrawing: isHighlighter //zsviczian\n\n }\n }), this.state.newElement && !isHighlighter &&\n /*#__PURE__*/\n //zsviczian\n react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_canvases_NewElementCanvas__WEBPACK_IMPORTED_MODULE_64__[\"default\"], {\n appState: this.state,\n scale: window.devicePixelRatio,\n rc: this.rc,\n elementsMap: elementsMap,\n allElementsMap: allElementsMap,\n renderConfig: {\n imageCache: this.imageCache,\n isExporting: false,\n renderGrid: false,\n canvasBackgroundColor: this.state.viewBackgroundColor,\n embedsValidationStatus: this.embedsValidationStatus,\n elementsPendingErasure: this.elementsPendingErasure,\n pendingFlowchartNodes: null,\n isHighlighterPenDrawing: isHighlighter //zsviczian\n\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_canvases__WEBPACK_IMPORTED_MODULE_63__.InteractiveCanvas, {\n containerRef: this.excalidrawContainerRef,\n canvas: this.interactiveCanvas,\n elementsMap: elementsMap,\n visibleElements: visibleElements,\n allElementsMap: allElementsMap,\n selectedElements: selectedElements,\n sceneNonce: sceneNonce,\n selectionNonce: (_m = this.state.selectionElement) === null || _m === void 0 ? void 0 : _m.versionNonce,\n scale: window.devicePixelRatio,\n appState: this.state,\n renderScrollbars: this.props.renderScrollbars === true,\n editorInterface: this.editorInterface,\n renderInteractiveSceneCallback: this.renderInteractiveSceneCallback,\n handleCanvasRef: this.handleInteractiveCanvasRef,\n onContextMenu: this.handleCanvasContextMenu,\n onPointerMove: this.handleCanvasPointerMove,\n onPointerUp: this.handleCanvasPointerUp,\n onPointerCancel: this.removePointer,\n onTouchMove: this.handleTouchMove,\n onPointerDown: this.handleCanvasPointerDown,\n onDoubleClick: this.handleCanvasDoubleClick\n }), this.state.userToFollow && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_FollowMode_FollowMode__WEBPACK_IMPORTED_MODULE_57__[\"default\"], {\n width: this.state.width,\n height: this.state.height,\n userToFollow: this.state.userToFollow,\n onDisconnect: this.maybeUnfollowRemoteUser\n }), this.renderFrameNames(), ((_o = this.state.activeEmbeddable) === null || _o === void 0 ? void 0 : _o.state) === \"active\" && ( //zsviczian\n (_q = (_p = this.props).renderEmbeddableMenu) === null || _q === void 0 ? void 0 : _q.call(_p, this.state)), this.state.activeLockedId && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_UnlockPopup__WEBPACK_IMPORTED_MODULE_69__[\"default\"], {\n app: this,\n activeLockedId: this.state.activeLockedId\n }), showShapeSwitchPanel && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_ConvertElementTypePopup__WEBPACK_IMPORTED_MODULE_52__[\"default\"], {\n app: this\n })), this.renderEmbeddables()))))))));\n }\n\n setPlugins(plugins) {\n Object.assign(this.plugins, plugins);\n }\n\n async onMagicFrameGenerate(magicFrame, source) {\n var _a;\n\n const generateDiagramToCode = (_a = this.plugins.diagramToCode) === null || _a === void 0 ? void 0 : _a.generate;\n\n if (!generateDiagramToCode) {\n this.setState({\n errorMessage: \"No diagram to code plugin found\"\n });\n return;\n }\n\n const magicFrameChildren = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getElementsOverlappingFrame)(this.scene.getNonDeletedElements(), magicFrame).filter(el => !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isMagicFrameElement)(el));\n\n if (!magicFrameChildren.length) {\n if (source === \"button\") {\n this.setState({\n errorMessage: \"Cannot generate from an empty frame\"\n });\n (0,_analytics__WEBPACK_IMPORTED_MODULE_21__.trackEvent)(\"ai\", \"generate (no-children)\", \"d2c\");\n } else {\n this.setActiveTool({\n type: \"magicframe\"\n });\n }\n\n return;\n }\n\n const frameElement = this.insertIframeElement({\n sceneX: magicFrame.x + magicFrame.width + 30,\n sceneY: magicFrame.y,\n width: magicFrame.width,\n height: magicFrame.height\n });\n\n if (!frameElement) {\n return;\n }\n\n this.updateMagicGeneration({\n frameElement,\n data: {\n status: \"pending\"\n }\n });\n this.setState({\n selectedElementIds: {\n [frameElement.id]: true\n }\n });\n (0,_analytics__WEBPACK_IMPORTED_MODULE_21__.trackEvent)(\"ai\", \"generate (start)\", \"d2c\");\n\n try {\n const {\n html\n } = await generateDiagramToCode({\n frame: magicFrame,\n children: magicFrameChildren\n });\n (0,_analytics__WEBPACK_IMPORTED_MODULE_21__.trackEvent)(\"ai\", \"generate (success)\", \"d2c\");\n\n if (!html.trim()) {\n this.updateMagicGeneration({\n frameElement,\n data: {\n status: \"error\",\n code: \"ERR_OAI\",\n message: \"Nothing genereated :(\"\n }\n });\n return;\n }\n\n const parsedHtml = html.includes(\"<!DOCTYPE html>\") && html.includes(\"</html>\") ? html.slice(html.indexOf(\"<!DOCTYPE html>\"), html.indexOf(\"</html>\") + \"</html>\".length) : html;\n this.updateMagicGeneration({\n frameElement,\n data: {\n status: \"done\",\n html: parsedHtml\n }\n });\n } catch (error) {\n (0,_analytics__WEBPACK_IMPORTED_MODULE_21__.trackEvent)(\"ai\", \"generate (failed)\", \"d2c\");\n this.updateMagicGeneration({\n frameElement,\n data: {\n status: \"error\",\n code: \"ERR_OAI\",\n message: error.message || \"Unknown error during generation\"\n }\n });\n }\n }\n\n onIframeSrcCopy(element) {\n var _a, _b;\n\n if (((_b = (_a = element.customData) === null || _a === void 0 ? void 0 : _a.generationData) === null || _b === void 0 ? void 0 : _b.status) === \"done\") {\n (0,_clipboard__WEBPACK_IMPORTED_MODULE_24__.copyTextToSystemClipboard)(element.customData.generationData.html);\n this.setToast({\n message: \"copied to clipboard\",\n closable: false,\n duration: 1500\n });\n }\n }\n\n clearImageShapeCache(filesMap) {\n const files = filesMap !== null && filesMap !== void 0 ? filesMap : this.files;\n this.scene.getNonDeletedElements().forEach(element => {\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isInitializedImageElement)(element) && files[element.fileId]) {\n this.imageCache.delete(element.fileId);\n _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.ShapeCache.delete(element);\n }\n });\n }\n\n async componentDidMount() {\n var _a;\n\n this.unmounted = false;\n this.excalidrawContainerValue.container = this.excalidrawContainerRef.current; //zsviczian disabling this code\n\n /*\r\n if (false && (isTestEnv() || isDevEnv())) {\r\n const setState = this.setState.bind(this);\r\n Object.defineProperties(window.h, {\r\n state: {\r\n configurable: true,\r\n get: () => {\r\n return this.state;\r\n },\r\n },\r\n setState: {\r\n configurable: true,\r\n value: (...args: Parameters<typeof setState>) => {\r\n return this.setState(...args);\r\n },\r\n },\r\n app: {\r\n configurable: true,\r\n value: this,\r\n },\r\n history: {\r\n configurable: true,\r\n value: this.history,\r\n },\r\n store: {\r\n configurable: true,\r\n value: this.store,\r\n },\r\n fonts: {\r\n configurable: true,\r\n value: this.fonts,\r\n },\r\n });\r\n }*/\n\n this.store.onDurableIncrementEmitter.on(increment => {\n this.history.record(increment.delta);\n });\n const {\n onIncrement\n } = this.props; // per. optimmisation, only subscribe if there is the `onIncrement` prop registered, to avoid unnecessary computation\n\n if (onIncrement) {\n this.store.onStoreIncrementEmitter.on(increment => {\n onIncrement(increment);\n });\n }\n\n this.scene.onUpdate(this.triggerRender);\n this.addEventListeners();\n\n if (this.props.autoFocus && this.excalidrawContainerRef.current) {\n this.focusContainer();\n }\n\n if (_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.supportsResizeObserver && this.excalidrawContainerRef.current) {\n this.resizeObserver = new ResizeObserver(() => {\n this.refreshEditorInterface();\n this.updateDOMRect();\n });\n (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.observe(this.excalidrawContainerRef.current);\n }\n\n const searchParams = new URLSearchParams(window.location.search.slice(1));\n\n if (searchParams.has(\"web-share-target\")) {\n // Obtain a file that was shared via the Web Share Target API.\n this.restoreFileFromShare();\n } else {\n this.updateDOMRect(this.initializeScene);\n } // note that this check seems to always pass in localhost\n\n\n if ((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isBrave)() && !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isMeasureTextSupported)()) {\n this.setState({\n errorMessage: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_BraveMeasureTextError__WEBPACK_IMPORTED_MODULE_54__[\"default\"], null)\n });\n }\n }\n\n componentWillUnmount() {\n var _a, _b;\n\n (_a = window.launchQueue) === null || _a === void 0 ? void 0 : _a.setConsumer(() => {});\n this.renderer.destroy();\n this.scene.destroy();\n this.scene = new _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.Scene();\n this.fonts = new _fonts__WEBPACK_IMPORTED_MODULE_36__.Fonts(this.scene);\n this.renderer = new _scene_Renderer__WEBPACK_IMPORTED_MODULE_41__.Renderer(this.scene);\n this.files = {};\n this.imageCache.clear();\n (_b = this.resizeObserver) === null || _b === void 0 ? void 0 : _b.disconnect();\n this.unmounted = true;\n this.removeEventListeners();\n this.library.destroy();\n this.laserTrails.stop();\n this.eraserTrail.stop();\n this.onChangeEmitter.clear();\n this.store.onStoreIncrementEmitter.clear();\n this.store.onDurableIncrementEmitter.clear();\n _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.ShapeCache.destroy();\n _snapping__WEBPACK_IMPORTED_MODULE_39__.SnapCache.destroy();\n clearTimeout(touchTimeout);\n _scene__WEBPACK_IMPORTED_MODULE_31__.isSomeElementSelected.clearCache();\n _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.selectGroupsForSelectedElements.clearCache();\n touchTimeout = 0;\n document.documentElement.style.overscrollBehaviorX = \"\";\n document.body.removeChild((0,_Tooltip__WEBPACK_IMPORTED_MODULE_71__.getTooltipDiv)()); //clearRenderCache(); //zsviczian\n\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.clearEraserCanvasCache)(); //zsviczian\n\n this.interactiveCanvas = null; //zsviczian\n\n this.iFrameRefs.clear(); //zsviczian\n //@ts-ignore\n\n this.iFrameRefs = null; //zsviczian\n\n this.embedsValidationStatus.clear(); //zsviczian\n //@ts-ignore\n\n this.embedsValidationStatus = null; //zsviczian\n\n this.initializedEmbeds.clear(); //zsviczian\n //@ts-ignore\n\n this.initializedEmbeds = null; //zsviczian\n\n this.elementsPendingErasure.clear(); //zsviczian\n //@ts-ignore\n\n this.elementsPendingErasure = null; //zsviczian\n\n this.lastPointerDownEvent = null; //zsviczian\n\n this.lastPointerUpEvent = null; //zsviczian\n\n this.lastPointerMoveEvent = null; //zsviczian\n //@ts-ignore\n\n this.actionManager.app = null; //zsviczian\n\n this.actionManager.actions = {}; //zsviczian\n\n this.history.clear(); //zsviczian\n\n this.store.clear(); //zsviczian\n //@ts-ignore\n\n this.store = null; //zsviczian\n //@ts-ignore\n\n this.library = null; //zsviczian\n //@ts-ignore\n\n this.canvas = null; //zsviczian\n //@ts-ignore\n\n this.rc = null; //zsviczian\n //@ts-ignore\n\n this.excalidrawContainerRef.current = undefined; //zsviczian\n\n this.nearestScrollableContainer = undefined; //zsviczian\n\n this.excalidrawContainerValue = {\n container: null,\n id: \"unknown\"\n }; //zsviczian\n //@ts-ignore\n // this.laserTrails.terminate(); //zsviczian\n // this.eraserTrail.terminate(); //zsviczian\n\n /*\r\n Object.keys(this).forEach((key) => {\r\n //@ts-ignore\r\n delete this[key];\r\n });*/\n }\n\n removeEventListeners() {\n this.onRemoveEventListenersEmitter.trigger();\n }\n\n addEventListeners() {\n // remove first as we can add event listeners multiple times\n this.removeEventListeners(); // -------------------------------------------------------------------------\n // view+edit mode listeners\n // -------------------------------------------------------------------------\n\n if (this.props.handleKeyboardGlobally) {\n this.onRemoveEventListenersEmitter.once((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(document, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.KEYDOWN, this.onKeyDown, false));\n }\n\n this.onRemoveEventListenersEmitter.once((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(this.excalidrawContainerRef.current, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.WHEEL, this.handleWheel, {\n passive: false\n }), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(window, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.MESSAGE, this.onWindowMessage, false), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(document, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_UP, this.removePointer, {\n passive: false\n }), // #3553\n (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(document, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.COPY, this.onCopy, {\n passive: false\n }), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(document, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.KEYUP, this.onKeyUp, {\n passive: true\n }), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(window, \"focus\", () => this.triggerRender(true), {\n passive: true\n }), //zsviczian\n (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(document, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_MOVE, this.updateCurrentCursorPosition, {\n passive: false\n }), // rerender text elements on font load to fix #637 && #1553\n // zsviczian In Obsidian this is not needed as I manage font load separately\n (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(document.fonts, \"loadingdone\", event => {\n const fontFaces = event.fontfaces;\n this.fonts.onLoaded(fontFaces);\n }, {\n passive: false\n }), // Safari-only desktop pinch zoom\n (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(document, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.GESTURE_START, this.onGestureStart, false), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(document, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.GESTURE_CHANGE, this.onGestureChange, false), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(document, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.GESTURE_END, this.onGestureEnd, false), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(window, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.FOCUS, () => {\n this.maybeCleanupAfterMissingPointerUp(null); // browsers (chrome?) tend to free up memory a lot, which results\n // in canvas context being cleared. Thus re-render on focus.\n\n this.triggerRender(true);\n }, {\n passive: false\n }));\n\n if (this.state.viewModeEnabled) {\n return;\n } // -------------------------------------------------------------------------\n // edit-mode listeners only\n // -------------------------------------------------------------------------\n\n\n this.onRemoveEventListenersEmitter.once((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(document, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.FULLSCREENCHANGE, this.onFullscreenChange, {\n passive: false\n }), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(document, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.PASTE, this.pasteFromClipboard, {\n passive: false\n }), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(document, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.CUT, this.onCut, {\n passive: false\n }), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(window, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.RESIZE, this.onResize, false), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(window, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.UNLOAD, this.onUnload, false), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(window, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.BLUR, this.onBlur, false),\n /*addEventListener( //zsviczian (duplicate)\r\n this.excalidrawContainerRef.current,\r\n EVENT.WHEEL,\r\n this.handleWheel,\r\n { passive: false },\r\n ),*/\n (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(this.excalidrawContainerRef.current, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.DRAG_OVER, this.disableEvent, false), (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)(this.excalidrawContainerRef.current, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.DROP, this.disableEvent, false));\n\n if (this.props.detectScroll) {\n this.onRemoveEventListenersEmitter.once((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.addEventListener)((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getNearestScrollableContainer)(this.excalidrawContainerRef.current), _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.SCROLL, this.onScroll, {\n passive: false\n }));\n }\n }\n\n componentDidUpdate(prevProps, prevState) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;\n\n this.updateEmbeddables();\n const elements = this.scene.getElementsIncludingDeleted();\n const elementsMap = this.scene.getElementsMapIncludingDeleted();\n\n if (!this.state.showWelcomeScreen && !elements.length) {\n this.setState({\n showWelcomeScreen: true\n });\n }\n\n const hasFollowedPersonLeft = prevState.userToFollow && !this.state.collaborators.has(prevState.userToFollow.socketId);\n\n if (hasFollowedPersonLeft) {\n this.maybeUnfollowRemoteUser();\n }\n\n if (prevState.zoom.value !== this.state.zoom.value || prevState.scrollX !== this.state.scrollX || prevState.scrollY !== this.state.scrollY) {\n (_b = (_a = this.props) === null || _a === void 0 ? void 0 : _a.onScrollChange) === null || _b === void 0 ? void 0 : _b.call(_a, this.state.scrollX, this.state.scrollY, this.state.zoom);\n this.onScrollChangeEmitter.trigger(this.state.scrollX, this.state.scrollY, this.state.zoom);\n }\n\n if (prevState.userToFollow !== this.state.userToFollow) {\n if (prevState.userToFollow) {\n this.onUserFollowEmitter.trigger({\n userToFollow: prevState.userToFollow,\n action: \"UNFOLLOW\"\n });\n }\n\n if (this.state.userToFollow) {\n this.onUserFollowEmitter.trigger({\n userToFollow: this.state.userToFollow,\n action: \"FOLLOW\"\n });\n }\n } // zsviczian\n\n\n if (this.state.highlightSearchResult && !this.debounceClearHighlightSearchResults && prevState.selectedElementIds !== this.state.selectedElementIds) {\n this.setState({\n highlightSearchResult: false\n });\n }\n\n if (Object.keys(this.state.selectedElementIds).length && (0,_appState__WEBPACK_IMPORTED_MODULE_23__.isEraserActive)(this.state)) {\n this.setState({\n activeTool: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateActiveTool)(this.state, {\n type: \"selection\"\n })\n });\n }\n\n if (this.state.activeTool.type === \"eraser\" && prevState.theme !== this.state.theme) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setEraserCursor)(this.interactiveCanvas, this.state.theme);\n } // Hide hyperlink popup if shown when element type is not selection\n\n\n if (prevState.activeTool.type === \"selection\" && this.state.activeTool.type !== \"selection\" && this.state.showHyperlinkPopup) {\n this.setState({\n showHyperlinkPopup: false\n });\n }\n\n if (prevProps.langCode !== this.props.langCode) {\n this.updateLanguage();\n }\n\n if ((0,_appState__WEBPACK_IMPORTED_MODULE_23__.isEraserActive)(prevState) && !(0,_appState__WEBPACK_IMPORTED_MODULE_23__.isEraserActive)(this.state)) {\n this.eraserTrail.endPath();\n }\n\n if (prevProps.viewModeEnabled !== this.props.viewModeEnabled) {\n this.setState({\n viewModeEnabled: !!this.props.viewModeEnabled\n });\n }\n\n if (prevState.viewModeEnabled !== this.state.viewModeEnabled) {\n this.addEventListeners();\n this.deselectElements();\n } // cleanup\n\n\n if ((((_c = prevState.openDialog) === null || _c === void 0 ? void 0 : _c.name) === \"elementLinkSelector\" || ((_d = this.state.openDialog) === null || _d === void 0 ? void 0 : _d.name) === \"elementLinkSelector\") && ((_e = prevState.openDialog) === null || _e === void 0 ? void 0 : _e.name) !== ((_f = this.state.openDialog) === null || _f === void 0 ? void 0 : _f.name)) {\n this.deselectElements();\n this.setState({\n hoveredElementIds: {}\n });\n }\n\n if (prevProps.zenModeEnabled !== this.props.zenModeEnabled) {\n this.setState({\n zenModeEnabled: !!this.props.zenModeEnabled\n });\n }\n\n if (prevProps.theme !== this.props.theme && this.props.theme) {\n this.setState({\n theme: this.props.theme\n });\n }\n\n (_g = this.excalidrawContainerRef.current) === null || _g === void 0 ? void 0 : _g.classList.toggle(\"theme--dark\", this.state.theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.THEME.DARK);\n\n if (((_h = this.state.selectedLinearElement) === null || _h === void 0 ? void 0 : _h.isEditing) && !this.state.selectedElementIds[this.state.selectedLinearElement.elementId]) {\n // defer so that the scheduleCapture flag isn't reset via current update\n setTimeout(() => {\n var _a; // execute only if the condition still holds when the deferred callback\n // executes (it can be scheduled multiple times depending on how\n // many times the component renders)\n\n\n ((_a = this.state.selectedLinearElement) === null || _a === void 0 ? void 0 : _a.isEditing) && this.actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_8__.actionFinalize);\n });\n } // failsafe in case the state is being updated in incorrect order resulting\n // in the editingTextElement being now a deleted element\n\n\n if ((_j = this.state.editingTextElement) === null || _j === void 0 ? void 0 : _j.isDeleted) {\n this.setState({\n editingTextElement: null\n });\n }\n\n if (this.state.selectedLinearElement && !this.state.selectedElementIds[this.state.selectedLinearElement.elementId]) {\n // To make sure `selectedLinearElement` is in sync with `selectedElementIds`, however this shouldn't be needed once\n // we have a single API to update `selectedElementIds`\n this.setState({\n selectedLinearElement: null\n });\n }\n\n this.store.commit(elementsMap, this.state); // Do not notify consumers if we're still loading the scene. Among other\n // potential issues, this fixes a case where the tab isn't focused during\n // init, which would trigger onChange with empty elements, which would then\n // override whatever is in localStorage currently.\n\n if (!this.state.isLoading) {\n (_l = (_k = this.props).onChange) === null || _l === void 0 ? void 0 : _l.call(_k, elements, this.state, this.files);\n this.onChangeEmitter.trigger(elements, this.state, this.files);\n }\n }\n\n static resetTapTwice() {\n didTapTwice = false;\n firstTapPosition = null;\n } // TODO: Cover with tests\n\n\n async insertClipboardContent(data, dataTransferFiles, isPlainPaste) {\n const {\n x: sceneX,\n y: sceneY\n } = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)({\n clientX: this.lastViewportPosition.x,\n clientY: this.lastViewportPosition.y\n }, this.state); // ------------------- Error -------------------\n\n if (data.errorMessage) {\n this.setState({\n errorMessage: data.errorMessage\n });\n return;\n } // ------------------- Mixed content with no files -------------------\n\n\n if (dataTransferFiles.length === 0 && !isPlainPaste && data.mixedContent) {\n await this.addElementsFromMixedContentPaste(data.mixedContent, {\n isPlainPaste,\n sceneX,\n sceneY\n });\n return;\n } // ------------------- Spreadsheet -------------------\n\n\n if (data.spreadsheet && !isPlainPaste) {\n this.setState({\n pasteDialog: {\n data: data.spreadsheet,\n shown: true\n }\n });\n return;\n } // ------------------- Images or SVG code -------------------\n\n\n const imageFiles = dataTransferFiles.map(data => data.file);\n\n if (imageFiles.length === 0 && data.text && !isPlainPaste) {\n const trimmedText = data.text.trim();\n\n if (trimmedText.startsWith(\"<svg\") && trimmedText.endsWith(\"</svg>\")) {\n // ignore SVG validation/normalization which will be done during image\n // initialization\n imageFiles.push((0,_data_blob__WEBPACK_IMPORTED_MODULE_33__.SVGStringToFile)(trimmedText));\n }\n }\n\n if (imageFiles.length > 0) {\n if (this.isToolSupported(\"image\")) {\n await this.insertImages(imageFiles, sceneX, sceneY);\n } else {\n this.setState({\n errorMessage: (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"errors.imageToolNotSupported\")\n });\n }\n\n return;\n } // ------------------- Elements -------------------\n\n\n if (data.elements) {\n const elements = data.programmaticAPI ? (0,_data_transform__WEBPACK_IMPORTED_MODULE_40__.convertToExcalidrawElements)(data.elements) : data.elements; // TODO: remove formatting from elements if isPlainPaste\n\n this.addElementsFromPasteOrLibrary({\n elements,\n files: data.files || null,\n position: this.editorInterface.formFactor === \"desktop\" ? \"cursor\" : \"center\",\n retainSeed: isPlainPaste\n });\n return;\n } // ------------------- Only textual stuff remaining -------------------\n\n\n if (!data.text) {\n return;\n } // ------------------- Successful Mermaid -------------------\n\n\n if (!isPlainPaste && (0,_mermaid__WEBPACK_IMPORTED_MODULE_48__.isMaybeMermaidDefinition)(data.text)) {\n const api = await Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! @zsviczian/mermaid-to-excalidraw */ \"../../node_modules/@zsviczian/mermaid-to-excalidraw/dist/index.js\"));\n\n try {\n const {\n elements: skeletonElements,\n files\n } = await api.parseMermaidToExcalidraw(data.text);\n const elements = (0,_data_transform__WEBPACK_IMPORTED_MODULE_40__.convertToExcalidrawElements)(skeletonElements, {\n regenerateIds: true\n });\n this.addElementsFromPasteOrLibrary({\n elements,\n files,\n position: this.editorInterface.formFactor === \"desktop\" ? \"cursor\" : \"center\"\n });\n return;\n } catch (err) {\n console.warn(`parsing pasted text as mermaid definition failed: ${err.message}`);\n }\n } // ------------------- Pure embeddable URLs -------------------\n\n\n const nonEmptyLines = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.normalizeEOL)(data.text).split(/\\n+/).map(s => s.trim()).filter(Boolean);\n const embbeddableUrls = nonEmptyLines.map(str => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.maybeParseEmbedSrc)(str)).filter(string => {\n var _a;\n\n return (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.embeddableURLValidator)(string, this.props.validateEmbeddable) && (/^(http|https):\\/\\/[^\\s/$.?#].[^\\s]*$/.test(string) || ((_a = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getEmbedLink)(string)) === null || _a === void 0 ? void 0 : _a.type) === \"video\");\n });\n\n if (!isPlainPaste && embbeddableUrls.length > 0 && embbeddableUrls.length === nonEmptyLines.length) {\n const embeddables = [];\n\n for (const url of embbeddableUrls) {\n const prevEmbeddable = embeddables[embeddables.length - 1];\n const embeddable = this.insertEmbeddableElement({\n sceneX: prevEmbeddable ? prevEmbeddable.x + prevEmbeddable.width + 20 : sceneX,\n sceneY,\n link: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.normalizeLink)(url)\n });\n\n if (embeddable) {\n embeddables.push(embeddable);\n }\n }\n\n if (embeddables.length) {\n this.store.scheduleCapture();\n this.setState({\n selectedElementIds: Object.fromEntries(embeddables.map(embeddable => [embeddable.id, true]))\n });\n }\n\n return;\n } // ------------------- Text -------------------\n\n\n this.addTextFromPaste(data.text, isPlainPaste);\n } // TODO rewrite this to paste both text & images at the same time if\n // pasted data contains both\n\n\n async addElementsFromMixedContentPaste(mixedContent, {\n isPlainPaste,\n sceneX,\n sceneY\n }) {\n if (!isPlainPaste && mixedContent.some(node => node.type === \"imageUrl\") && this.isToolSupported(\"image\")) {\n const imageURLs = mixedContent.filter(node => node.type === \"imageUrl\").map(node => node.value);\n const responses = await Promise.all(imageURLs.map(async url => {\n try {\n return {\n file: await (0,_data_blob__WEBPACK_IMPORTED_MODULE_33__.ImageURLToFile)(url)\n };\n } catch (error) {\n let errorMessage = error.message;\n\n if (error.cause === \"FETCH_ERROR\") {\n errorMessage = (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"errors.failedToFetchImage\");\n } else if (error.cause === \"UNSUPPORTED\") {\n errorMessage = (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"errors.unsupportedFileType\");\n }\n\n return {\n errorMessage\n };\n }\n }));\n const imageFiles = responses.filter(response => !!response.file).map(response => response.file);\n await this.insertImages(imageFiles, sceneX, sceneY);\n const error = responses.find(response => !!response.errorMessage);\n\n if (error && error.errorMessage) {\n this.setState({\n errorMessage: error.errorMessage\n });\n }\n } else {\n const textNodes = mixedContent.filter(node => node.type === \"text\");\n\n if (textNodes.length) {\n this.addTextFromPaste(textNodes.map(node => node.value).join(\"\\n\\n\"), isPlainPaste);\n }\n }\n }\n\n addTextFromPaste(text, isPlainPaste = false) {\n const {\n x,\n y\n } = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)({\n clientX: this.lastViewportPosition.x,\n clientY: this.lastViewportPosition.y\n }, this.state);\n const textElementProps = {\n x,\n y,\n strokeColor: this.state.currentItemStrokeColor,\n backgroundColor: this.state.currentItemBackgroundColor,\n fillStyle: this.state.currentItemFillStyle,\n strokeWidth: this.state.currentItemStrokeWidth,\n strokeStyle: this.state.currentItemStrokeStyle,\n roundness: null,\n roughness: this.state.currentItemRoughness,\n opacity: this.state.currentItemOpacity,\n text,\n rawText: text,\n fontSize: (0,_actions_actionProperties__WEBPACK_IMPORTED_MODULE_72__.getFontSize)(this.state.currentItemFontSize, this.state.zoom.value),\n fontFamily: this.state.currentItemFontFamily,\n textAlign: _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.DEFAULT_TEXT_ALIGN,\n verticalAlign: _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.DEFAULT_VERTICAL_ALIGN,\n locked: false\n };\n const fontString = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getFontString)({\n fontSize: textElementProps.fontSize,\n fontFamily: textElementProps.fontFamily\n });\n const lineHeight = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getLineHeight)(textElementProps.fontFamily);\n const [x1,, x2] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getVisibleSceneBounds)(this.state); // long texts should not go beyond 800 pixels in width nor should it go below 200 px\n\n const maxTextWidth = Math.max(Math.min((x2 - x1) * 0.5, 800), 200);\n const LINE_GAP = 10;\n let currentY = y;\n const lines = isPlainPaste ? [text] : text.split(\"\\n\");\n const textElements = lines.reduce((acc, line, idx) => {\n var _a;\n\n const originalText = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.normalizeText)(line).trim();\n\n if (originalText.length) {\n const topLayerFrame = this.getTopLayerFrameAtSceneCoords({\n x,\n y: currentY\n });\n let metrics = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.measureText)(originalText, fontString, lineHeight);\n const isTextUnwrapped = metrics.width > maxTextWidth;\n const text = isTextUnwrapped ? (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.wrapText)(originalText, fontString, maxTextWidth) : originalText;\n metrics = isTextUnwrapped ? (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.measureText)(text, fontString, lineHeight) : metrics;\n const startX = x - metrics.width / 2;\n const startY = currentY - metrics.height / 2;\n const element = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newTextElement)(Object.assign(Object.assign({}, textElementProps), {\n x: startX,\n y: startY,\n text,\n rawText: originalText,\n //zsviczian\n originalText,\n lineHeight,\n autoResize: !isTextUnwrapped,\n frameId: topLayerFrame ? topLayerFrame.id : null\n }));\n acc.push(element);\n currentY += element.height + LINE_GAP;\n } else {\n const prevLine = (_a = lines[idx - 1]) === null || _a === void 0 ? void 0 : _a.trim(); // add paragraph only if previous line was not empty, IOW don't add\n // more than one empty line\n\n if (prevLine) {\n currentY += (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getLineHeightInPx)(textElementProps.fontSize, lineHeight) + LINE_GAP;\n }\n }\n\n return acc;\n }, []);\n\n if (textElements.length === 0) {\n return;\n }\n\n this.scene.insertElements(textElements);\n this.store.scheduleCapture();\n this.setState({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)(Object.fromEntries(textElements.map(el => [el.id, true])), this.state)\n });\n\n if (!isPlainPaste && textElements.length > 1 && PLAIN_PASTE_TOAST_SHOWN === false && this.editorInterface.formFactor !== \"phone\") {\n this.setToast({\n message: (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.t)(\"toast.pasteAsSingleElement\", {\n shortcut: (0,_shortcut__WEBPACK_IMPORTED_MODULE_51__.getShortcutKey)(\"CtrlOrCmd+Shift+V\")\n }),\n duration: 5000\n });\n PLAIN_PASTE_TOAST_SHOWN = true;\n }\n }\n\n handleTextWysiwyg(element, {\n isExistingElement = false\n }) {\n const elementsMap = this.scene.getElementsMapIncludingDeleted();\n\n const updateElement = (nextOriginalText, isDeleted, rawText, //zsviczian\n link) => {\n this.scene.replaceAllElements([// Not sure why we include deleted elements as well hence using deleted elements map\n ...this.scene.getElementsIncludingDeleted().map(_element => {\n if (_element.id === element.id && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isTextElement)(_element)) {\n return (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newElementWith)(_element, Object.assign({\n originalText: nextOriginalText,\n rawText: rawText !== null && rawText !== void 0 ? rawText : nextOriginalText,\n //zsviczian\n link,\n isDeleted: isDeleted !== null && isDeleted !== void 0 ? isDeleted : _element.isDeleted\n }, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.refreshTextDimensions)(_element, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getContainerElement)(_element, elementsMap), elementsMap, nextOriginalText)));\n }\n\n return _element;\n })]);\n }; //zsviczian\n\n\n if (this.props.onBeforeTextEdit) {\n const text = this.props.onBeforeTextEdit(element, isExistingElement);\n\n if (text && text !== element.originalText) {\n this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted().map(_element => {\n if (_element.id === element.id && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isTextElement)(_element)) {\n //changing the value of element so this gets edited by textWysiwyg\n element = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newElementWith)(_element, Object.assign({\n originalText: text,\n rawText: text,\n isDeleted: false\n }, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.refreshTextDimensions)(_element, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getContainerElement)(_element, elementsMap), elementsMap, text)));\n return element;\n }\n\n return _element;\n })]);\n }\n }\n\n (0,_wysiwyg_textWysiwyg__WEBPACK_IMPORTED_MODULE_46__.textWysiwyg)({\n id: element.id,\n canvas: this.canvas,\n getViewportCoords: (x, y) => {\n const {\n x: viewportX,\n y: viewportY\n } = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.sceneCoordsToViewportCoords)({\n sceneX: x,\n sceneY: y\n }, this.state);\n return [viewportX - this.state.offsetLeft, viewportY - this.state.offsetTop];\n },\n onChange: (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(nextOriginalText => {\n updateElement(nextOriginalText, false);\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isNonDeletedElement)(element)) {\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.updateBoundElements)(element, this.scene);\n }\n }),\n onSubmit: (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(({\n viaKeyboard,\n nextOriginalText\n }) => {\n var _a;\n\n const isDeleted = !nextOriginalText.trim(); //zsviczian insert start\n\n const rawText = nextOriginalText; //should this be originalText??\n\n let link = undefined;\n\n if (this.props.onBeforeTextSubmit) {\n const _element = this.scene.getElementsIncludingDeleted().find(el => el.id === element.id && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isTextElement)(el));\n\n if (_element) {\n const dismensionsData = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.refreshTextDimensions)(_element, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getContainerElement)(_element, elementsMap), elementsMap, nextOriginalText);\n const {\n updatedNextOriginalText,\n nextLink\n } = this.props.onBeforeTextSubmit(element, (_a = dismensionsData === null || dismensionsData === void 0 ? void 0 : dismensionsData.text) !== null && _a !== void 0 ? _a : nextOriginalText, //should never be undefined\n nextOriginalText, isDeleted);\n nextOriginalText = updatedNextOriginalText !== null && updatedNextOriginalText !== void 0 ? updatedNextOriginalText : nextOriginalText;\n link = nextLink;\n }\n } //zsviczian insert end\n\n\n updateElement(nextOriginalText, isDeleted, rawText, link); //zsviczian (added rawText, link, text)\n // select the created text element only if submitting via keyboard\n // (when submitting via click it should act as signal to deselect)\n\n if (!isDeleted && viaKeyboard) {\n const elementIdToSelect = element.containerId ? element.containerId : element.id; // needed to ensure state is updated before \"finalize\" action\n // that's invoked on keyboard-submit as well\n // TODO either move this into finalize as well, or handle all state\n // updates in one place, skipping finalize action\n\n (0,react_dom__WEBPACK_IMPORTED_MODULE_3__.flushSync)(() => {\n this.setState(prevState => ({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)(Object.assign(Object.assign({}, prevState.selectedElementIds), {\n [elementIdToSelect]: true\n }), prevState)\n }));\n });\n }\n\n if (isDeleted) {\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.fixBindingsAfterDeletion)(this.scene.getNonDeletedElements(), [element]);\n }\n\n if (!isDeleted || isExistingElement) {\n this.store.scheduleCapture();\n }\n\n (0,react_dom__WEBPACK_IMPORTED_MODULE_3__.flushSync)(() => {\n this.setState({\n newElement: null,\n editingTextElement: null\n });\n });\n\n if (this.state.activeTool.locked) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursorForShape)(this.interactiveCanvas, this.state);\n }\n\n this.focusContainer();\n }),\n element,\n excalidrawContainer: this.excalidrawContainerRef.current,\n app: this,\n // when text is selected, it's hard (at least on iOS) to re-position the\n // caret (i.e. deselect). There's not much use for always selecting\n // the text on edit anyway (and users can select-all from contextmenu\n // if needed)\n autoSelect: !this.editorInterface.isTouchScreen\n }); // deselect all other elements when inserting text\n\n this.deselectElements(); // do an initial update to re-initialize element position since we were\n // modifying element's x/y for sake of editor (case: syncing to remote)\n\n updateElement(element.originalText, false);\n }\n\n deselectElements() {\n this.setState({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)({}, this.state),\n selectedGroupIds: {},\n editingGroupId: null,\n activeEmbeddable: null\n });\n }\n\n getTextElementAtPosition(x, y) {\n const element = this.getElementAtPosition(x, y, {\n includeBoundTextElement: true\n });\n\n if (element && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isTextElement)(element) && !element.isDeleted) {\n return element;\n }\n\n return null;\n } // NOTE: Hot path for hit testing, so avoid unnecessary computations\n\n\n getElementAtPosition(x, y, opts) {\n let allHitElements = [];\n\n if (opts && \"allHitElements\" in opts) {\n allHitElements = (opts === null || opts === void 0 ? void 0 : opts.allHitElements) || [];\n } else {\n allHitElements = this.getElementsAtPosition(x, y, {\n includeBoundTextElement: opts === null || opts === void 0 ? void 0 : opts.includeBoundTextElement,\n includeLockedElements: opts === null || opts === void 0 ? void 0 : opts.includeLockedElements\n });\n }\n\n if (allHitElements.length > 1) {\n if (opts === null || opts === void 0 ? void 0 : opts.preferSelected) {\n for (let index = allHitElements.length - 1; index > -1; index--) {\n if (this.state.selectedElementIds[allHitElements[index].id]) {\n return allHitElements[index];\n }\n }\n }\n\n const elementWithHighestZIndex = allHitElements[allHitElements.length - 1]; // If we're hitting element with highest z-index only on its bounding box\n // while also hitting other element figure, the latter should be considered.\n\n return (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.hitElementItself)({\n point: (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(x, y),\n element: elementWithHighestZIndex,\n // when overlapping, we would like to be more precise\n // this also avoids the need to update past tests\n threshold: this.getElementHitThreshold(elementWithHighestZIndex) / 2,\n elementsMap: this.scene.getNonDeletedElementsMap(),\n frameNameBound: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isFrameLikeElement)(elementWithHighestZIndex) ? this.frameNameBoundsCache.get(elementWithHighestZIndex) : null\n }) ? elementWithHighestZIndex : allHitElements[allHitElements.length - 2];\n }\n\n if (allHitElements.length === 1) {\n return allHitElements[0];\n }\n\n return null;\n } // NOTE: Hot path for hit testing, so avoid unnecessary computations\n\n\n getElementsAtPosition(x, y, opts) {\n const iframeLikes = [];\n const elementsMap = this.scene.getNonDeletedElementsMap();\n const elements = ((opts === null || opts === void 0 ? void 0 : opts.includeBoundTextElement) && (opts === null || opts === void 0 ? void 0 : opts.includeLockedElements) ? this.scene.getNonDeletedElements() : this.scene.getNonDeletedElements().filter(element => ((opts === null || opts === void 0 ? void 0 : opts.includeLockedElements) || !element.locked) && ((opts === null || opts === void 0 ? void 0 : opts.includeBoundTextElement) || !((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isTextElement)(element) && element.containerId)))).filter(el => this.hitElement(x, y, el)).filter(element => {\n // hitting a frame's element from outside the frame is not considered a hit\n const containingFrame = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getContainingFrame)(element, elementsMap);\n return containingFrame && this.state.frameRendering.enabled && this.state.frameRendering.clip ? (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isCursorInFrame)({\n x,\n y\n }, containingFrame, elementsMap) : true;\n }).filter(el => {\n // The parameter elements comes ordered from lower z-index to higher.\n // We want to preserve that order on the returned array.\n // Exception being embeddables which should be on top of everything else in\n // terms of hit testing.\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isIframeElement)(el)) {\n iframeLikes.push(el);\n return false;\n }\n\n return true;\n }).concat(iframeLikes);\n return elements;\n }\n\n getElementHitThreshold(element) {\n return Math.max(element.strokeWidth / 2 + 0.1, // NOTE: Here be dragons. Do not go under the 0.63 multiplier unless you're\n // willing to test extensively. The hit testing starts to become unreliable\n // due to FP imprecision under 0.63 in high zoom levels.\n 0.85 * (_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.DEFAULT_COLLISION_THRESHOLD / this.state.zoom.value));\n }\n\n hitElement(x, y, element, considerBoundingBox = true) {\n // if the element is selected, then hit test is done against its bounding box\n if (considerBoundingBox && this.state.selectedElementIds[element.id] && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.hasBoundingBox)([element], this.state, this.editorInterface)) {\n // if hitting the bounding box, return early\n // but if not, we should check for other cases as well (e.g. frame name)\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.hitElementBoundingBox)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(x, y), element, this.scene.getNonDeletedElementsMap(), this.getElementHitThreshold(element))) {\n return true;\n }\n } // take bound text element into consideration for hit collision as well\n\n\n const hitBoundTextOfElement = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.hitElementBoundText)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(x, y), element, this.scene.getNonDeletedElementsMap());\n\n if (hitBoundTextOfElement) {\n return true;\n }\n\n return (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.hitElementItself)({\n point: (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(x, y),\n element,\n threshold: this.getElementHitThreshold(element),\n elementsMap: this.scene.getNonDeletedElementsMap(),\n frameNameBound: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isFrameLikeElement)(element) ? this.frameNameBoundsCache.get(element) : null\n });\n }\n\n getTextBindableContainerAtPosition(x, y) {\n const elements = this.scene.getNonDeletedElements();\n const selectedElements = this.scene.getSelectedElements(this.state);\n\n if (selectedElements.length === 1) {\n return (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isTextBindableContainer)(selectedElements[0], false) ? selectedElements[0] : null;\n }\n\n let hitElement = null; // We need to do hit testing from front (end of the array) to back (beginning of the array)\n\n for (let index = elements.length - 1; index >= 0; --index) {\n if (elements[index].isDeleted) {\n continue;\n }\n\n const [x1, y1, x2, y2] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getElementAbsoluteCoords)(elements[index], this.scene.getNonDeletedElementsMap());\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isArrowElement)(elements[index]) && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.hitElementItself)({\n point: (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(x, y),\n element: elements[index],\n elementsMap: this.scene.getNonDeletedElementsMap(),\n threshold: this.getElementHitThreshold(elements[index])\n })) {\n hitElement = elements[index];\n break;\n } else if (x1 < x && x < x2 && y1 < y && y < y2) {\n hitElement = elements[index];\n break;\n }\n }\n\n return (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isTextBindableContainer)(hitElement, false) ? hitElement : null;\n }\n\n handleHoverSelectedLinearElement(linearElementEditor, scenePointerX, scenePointerY) {\n const elementsMap = this.scene.getNonDeletedElementsMap();\n const element = _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.getElement(linearElementEditor.elementId, elementsMap);\n\n if (!element) {\n return;\n }\n\n if (this.state.selectedLinearElement) {\n let hoverPointIndex = -1;\n let segmentMidPointHoveredCoords = null;\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.hitElementItself)({\n point: (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(scenePointerX, scenePointerY),\n element,\n elementsMap,\n threshold: this.getElementHitThreshold(element)\n })) {\n hoverPointIndex = _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.getPointIndexUnderCursor(element, elementsMap, this.state.zoom, scenePointerX, scenePointerY);\n segmentMidPointHoveredCoords = _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.getSegmentMidpointHitCoords(linearElementEditor, {\n x: scenePointerX,\n y: scenePointerY\n }, this.state, this.scene.getNonDeletedElementsMap());\n const isHoveringAPointHandle = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(element) ? hoverPointIndex === 0 || hoverPointIndex === element.points.length - 1 : hoverPointIndex >= 0;\n\n if (isHoveringAPointHandle || segmentMidPointHoveredCoords) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.POINTER);\n } else if (this.hitElement(scenePointerX, scenePointerY, element)) {\n if ( // Ebow arrows can only be moved when unconnected\n !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(element) || !(element.startBinding || element.endBinding)) {\n if (this.state.activeTool.type !== \"lasso\" || Object.keys(this.state.selectedElementIds).length > 0) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.MOVE);\n }\n }\n }\n } else if (this.hitElement(scenePointerX, scenePointerY, element)) {\n if ( // Ebow arrows can only be moved when unconnected\n !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(element) || !(element.startBinding || element.endBinding)) {\n if (this.state.activeTool.type !== \"lasso\" || Object.keys(this.state.selectedElementIds).length > 0) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.MOVE);\n }\n }\n }\n\n if (this.state.selectedLinearElement.hoverPointIndex !== hoverPointIndex) {\n this.setState({\n selectedLinearElement: Object.assign(Object.assign({}, this.state.selectedLinearElement), {\n hoverPointIndex\n })\n });\n }\n\n if (!_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.arePointsEqual(this.state.selectedLinearElement.segmentMidPointHoveredCoords, segmentMidPointHoveredCoords)) {\n this.setState({\n selectedLinearElement: Object.assign(Object.assign({}, this.state.selectedLinearElement), {\n segmentMidPointHoveredCoords\n })\n });\n }\n } else {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.AUTO);\n }\n } //mfuria #329. start right-click panning\n\n\n startRightClickPanning(event) {\n // Set up right-click panning similar to hand tool\n isPanning = true;\n this.focusContainer();\n\n if (!this.state.editingTextElement) {\n event.preventDefault();\n }\n\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.GRABBING);\n let {\n clientX: lastX,\n clientY: lastY\n } = event;\n const onPointerMove = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdatesThrottled)(event => {\n const deltaX = lastX - event.clientX;\n const deltaY = lastY - event.clientY;\n lastX = event.clientX;\n lastY = event.clientY;\n this.translateCanvas({\n scrollX: this.state.scrollX - deltaX / this.state.zoom.value,\n scrollY: this.state.scrollY - deltaY / this.state.zoom.value\n });\n });\n const teardown = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(() => {\n isPanning = false;\n\n if (this.state.viewModeEnabled) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.GRAB);\n } else {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursorForShape)(this.interactiveCanvas, this.state);\n }\n\n this.setState({\n cursorButton: \"up\"\n });\n this.savePointer(event.clientX, event.clientY, \"up\");\n window.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_MOVE, onPointerMove);\n window.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_UP, teardown);\n window.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.BLUR, teardown);\n onPointerMove.flush();\n });\n window.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.BLUR, teardown);\n window.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_MOVE, onPointerMove, {\n passive: true\n });\n window.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_UP, teardown);\n }\n\n updateGestureOnPointerDown(event) {\n gesture.pointers.set(event.pointerId, {\n x: event.clientX,\n y: event.clientY\n });\n\n if (gesture.pointers.size === 2) {\n if ((0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_70__.shouldDisableZoom)(this.state)) {\n //zsviczian\n gesture.initialDistance = null;\n } else {\n gesture.lastCenter = (0,_gesture__WEBPACK_IMPORTED_MODULE_28__.getCenter)(gesture.pointers);\n gesture.initialScale = this.state.zoom.value;\n gesture.initialDistance = (0,_gesture__WEBPACK_IMPORTED_MODULE_28__.getDistance)(Array.from(gesture.pointers.values()));\n }\n }\n }\n\n initialPointerDownState(event) {\n const origin = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)(event, this.state);\n const selectedElements = this.scene.getSelectedElements(this.state);\n const [minX, minY, maxX, maxY] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getCommonBounds)(selectedElements);\n const isElbowArrowOnly = selectedElements.findIndex(_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow) === 0;\n return {\n origin,\n withCmdOrCtrl: event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD],\n originInGrid: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.tupleToCoors)((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(origin.x, origin.y, event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] || isElbowArrowOnly ? null : this.getEffectiveGridSize())),\n scrollbars: (0,_scene_scrollbars__WEBPACK_IMPORTED_MODULE_47__.isOverScrollBars)(currentScrollBars, event.clientX - this.state.offsetLeft, event.clientY - this.state.offsetTop),\n // we need to duplicate because we'll be updating this state\n lastCoords: Object.assign({}, origin),\n originalElements: this.scene.getNonDeletedElements().reduce((acc, element) => {\n acc.set(element.id, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.deepCopyElement)(element));\n return acc;\n }, new Map()),\n resize: {\n handleType: false,\n isResizing: false,\n offset: {\n x: 0,\n y: 0\n },\n arrowDirection: \"origin\",\n center: {\n x: (maxX + minX) / 2,\n y: (maxY + minY) / 2\n }\n },\n hit: {\n element: null,\n allHitElements: [],\n wasAddedToSelection: false,\n hasBeenDuplicated: false,\n hasHitCommonBoundingBoxOfSelectedElements: this.isHittingCommonBoundingBoxOfSelectedElements(origin, selectedElements)\n },\n drag: {\n hasOccurred: false,\n offset: null,\n origin: Object.assign({}, origin),\n blockDragging: false\n },\n eventListeners: {\n onMove: null,\n onUp: null,\n onKeyUp: null,\n onKeyDown: null\n },\n boxSelection: {\n hasOccurred: false\n }\n };\n } // Returns whether the event is a dragging a scrollbar\n\n\n handleDraggingScrollBar(event, pointerDownState) {\n if (!(pointerDownState.scrollbars.isOverEither && !this.state.multiElement)) {\n return false;\n }\n\n isDraggingScrollBar = true;\n pointerDownState.lastCoords.x = event.clientX;\n pointerDownState.lastCoords.y = event.clientY;\n const onPointerMove = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdatesThrottled)(event => {\n const target = event.target;\n\n if (!(target instanceof HTMLElement)) {\n return;\n }\n\n this.handlePointerMoveOverScrollbars(event, pointerDownState);\n });\n const onPointerUp = (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(() => {\n lastPointerUp = null;\n isDraggingScrollBar = false;\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursorForShape)(this.interactiveCanvas, this.state);\n this.setState({\n cursorButton: \"up\"\n });\n this.savePointer(event.clientX, event.clientY, \"up\");\n window.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_MOVE, onPointerMove);\n window.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_UP, onPointerUp);\n onPointerMove.flush();\n });\n lastPointerUp = onPointerUp;\n window.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_MOVE, onPointerMove);\n window.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_UP, onPointerUp);\n return true;\n }\n\n isASelectedElement(hitElement) {\n return hitElement != null && this.state.selectedElementIds[hitElement.id];\n }\n\n isHittingCommonBoundingBoxOfSelectedElements(point, selectedElements) {\n if (selectedElements.length < 2) {\n return false;\n } // How many pixels off the shape boundary we still consider a hit\n\n\n const threshold = Math.max(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.DEFAULT_COLLISION_THRESHOLD / this.state.zoom.value, 1);\n const [x1, y1, x2, y2] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getCommonBounds)(selectedElements);\n return point.x > x1 - threshold && point.x < x2 + threshold && point.y > y1 - threshold && point.y < y2 + threshold;\n }\n\n getCurrentItemRoundness(elementType) {\n return this.state.currentItemRoundness === \"round\" ? {\n type: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isUsingAdaptiveRadius)(elementType) ? _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.ROUNDNESS.ADAPTIVE_RADIUS : _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.ROUNDNESS.PROPORTIONAL_RADIUS\n } : null;\n }\n\n maybeCacheReferenceSnapPoints(event, selectedElements, recomputeAnyways = false) {\n if ((0,_snapping__WEBPACK_IMPORTED_MODULE_39__.isSnappingEnabled)({\n event,\n app: this,\n selectedElements\n }) && (recomputeAnyways || !_snapping__WEBPACK_IMPORTED_MODULE_39__.SnapCache.getReferenceSnapPoints())) {\n _snapping__WEBPACK_IMPORTED_MODULE_39__.SnapCache.setReferenceSnapPoints((0,_snapping__WEBPACK_IMPORTED_MODULE_39__.getReferenceSnapPoints)(this.scene.getNonDeletedElements(), selectedElements, this.state, this.scene.getNonDeletedElementsMap()));\n }\n }\n\n maybeCacheVisibleGaps(event, selectedElements, recomputeAnyways = false) {\n if ((0,_snapping__WEBPACK_IMPORTED_MODULE_39__.isSnappingEnabled)({\n event,\n app: this,\n selectedElements\n }) && (recomputeAnyways || !_snapping__WEBPACK_IMPORTED_MODULE_39__.SnapCache.getVisibleGaps())) {\n _snapping__WEBPACK_IMPORTED_MODULE_39__.SnapCache.setVisibleGaps((0,_snapping__WEBPACK_IMPORTED_MODULE_39__.getVisibleGaps)(this.scene.getNonDeletedElements(), selectedElements, this.state, this.scene.getNonDeletedElementsMap()));\n }\n }\n\n onKeyDownFromPointerDownHandler(pointerDownState) {\n return (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(event => {\n if (this.maybeHandleResize(pointerDownState, event)) {\n return;\n }\n\n this.maybeDragNewGenericElement(pointerDownState, event);\n });\n }\n\n onKeyUpFromPointerDownHandler(pointerDownState) {\n return (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(event => {\n // Prevents focus from escaping excalidraw tab\n event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.ALT && event.preventDefault();\n\n if (this.maybeHandleResize(pointerDownState, event)) {\n return;\n }\n\n this.maybeDragNewGenericElement(pointerDownState, event);\n });\n }\n\n onPointerMoveFromPointerDownHandler(pointerDownState) {\n return (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdatesThrottled)(event => {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j; //To avoid pointerMove canceling the selection of locked elements on mobile //zsviczian\n\n\n if (Boolean(this.state.contextMenu) || ((_a = this.state.openDialog) === null || _a === void 0 ? void 0 : _a.name) === \"elementLinkSelector\") {\n return;\n }\n\n const pointerCoords = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)(event, this.state);\n\n if (this.state.activeLockedId) {\n this.setState({\n activeLockedId: null\n });\n }\n\n if (this.state.selectedLinearElement && this.state.selectedLinearElement.elbowed && this.state.selectedLinearElement.pointerDownState.segmentMidpoint.index) {\n const [gridX, gridY] = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(pointerCoords.x, pointerCoords.y, event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] ? null : this.getEffectiveGridSize());\n let index = this.state.selectedLinearElement.pointerDownState.segmentMidpoint.index;\n\n if (index < 0) {\n const nextCoords = _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.getSegmentMidpointHitCoords(Object.assign(Object.assign({}, this.state.selectedLinearElement), {\n segmentMidPointHoveredCoords: null\n }), {\n x: gridX,\n y: gridY\n }, this.state, this.scene.getNonDeletedElementsMap());\n index = nextCoords ? _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.getSegmentMidPointIndex(this.state.selectedLinearElement, this.state, nextCoords, this.scene.getNonDeletedElementsMap()) : -1;\n }\n\n const ret = _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.moveFixedSegment(this.state.selectedLinearElement, index, gridX, gridY, this.scene);\n this.setState({\n selectedLinearElement: Object.assign(Object.assign({}, this.state.selectedLinearElement), {\n segmentMidPointHoveredCoords: ret.segmentMidPointHoveredCoords,\n pointerDownState: ret.pointerDownState\n })\n });\n return;\n }\n\n const lastPointerCoords = (_b = this.lastPointerMoveCoords) !== null && _b !== void 0 ? _b : pointerDownState.origin;\n this.lastPointerMoveCoords = pointerCoords; // We need to initialize dragOffsetXY only after we've updated\n // `state.selectedElementIds` on pointerDown. Doing it here in pointerMove\n // event handler should hopefully ensure we're already working with\n // the updated state.\n\n if (pointerDownState.drag.offset === null) {\n pointerDownState.drag.offset = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.tupleToCoors)((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getDragOffsetXY)(this.scene.getSelectedElements(this.state), pointerDownState.origin.x, pointerDownState.origin.y));\n }\n\n const target = event.target;\n\n if (!(target instanceof HTMLElement)) {\n return;\n }\n\n if (this.handlePointerMoveOverScrollbars(event, pointerDownState)) {\n return;\n }\n\n if ((0,_appState__WEBPACK_IMPORTED_MODULE_23__.isEraserActive)(this.state)) {\n this.handleEraser(event, pointerCoords);\n return;\n }\n\n if (this.state.activeTool.type === \"laser\") {\n this.laserTrails.addPointToPath(pointerCoords.x, pointerCoords.y);\n }\n\n const [gridX, gridY] = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getGridPoint)(pointerCoords.x, pointerCoords.y, event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] ? null : this.getEffectiveGridSize()); // for arrows/lines, don't start dragging until a given threshold\n // to ensure we don't create a 2-point arrow by mistake when\n // user clicks mouse in a way that it moves a tiny bit (thus\n // triggering pointermove)\n\n if (!pointerDownState.drag.hasOccurred && (this.state.activeTool.type === \"arrow\" || this.state.activeTool.type === \"line\")) {\n if ((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointDistance)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(pointerCoords.x, pointerCoords.y), (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(pointerDownState.origin.x, pointerDownState.origin.y)) * this.state.zoom.value < _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.MINIMUM_ARROW_SIZE) {\n return;\n }\n }\n\n if (pointerDownState.resize.isResizing) {\n pointerDownState.lastCoords.x = pointerCoords.x;\n pointerDownState.lastCoords.y = pointerCoords.y;\n\n if (this.maybeHandleCrop(pointerDownState, event)) {\n return true;\n }\n\n if (this.maybeHandleResize(pointerDownState, event)) {\n return true;\n }\n }\n\n const elementsMap = this.scene.getNonDeletedElementsMap();\n\n if (this.state.selectedLinearElement) {\n const linearElementEditor = this.state.selectedLinearElement;\n\n if (_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.shouldAddMidpoint(this.state.selectedLinearElement, pointerCoords, this.state, elementsMap)) {\n const ret = _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.addMidpoint(this.state.selectedLinearElement, pointerCoords, this, !event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD], this.scene);\n\n if (!ret) {\n return;\n } // Since we are reading from previous state which is not possible with\n // automatic batching in React 18 hence using flush sync to synchronously\n // update the state. Check https://github.com/excalidraw/excalidraw/pull/5508 for more details.\n\n\n (0,react_dom__WEBPACK_IMPORTED_MODULE_3__.flushSync)(() => {\n if (this.state.selectedLinearElement) {\n this.setState({\n selectedLinearElement: Object.assign(Object.assign({}, this.state.selectedLinearElement), {\n pointerDownState: ret.pointerDownState,\n selectedPointsIndices: ret.selectedPointsIndices,\n segmentMidPointHoveredCoords: null\n })\n });\n }\n });\n return;\n } else if (linearElementEditor.pointerDownState.segmentMidpoint.value !== null && !linearElementEditor.pointerDownState.segmentMidpoint.added) {\n return;\n }\n\n const newState = _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.handlePointDragging(event, this, pointerCoords.x, pointerCoords.y, linearElementEditor);\n\n if (newState) {\n pointerDownState.lastCoords.x = pointerCoords.x;\n pointerDownState.lastCoords.y = pointerCoords.y;\n pointerDownState.drag.hasOccurred = true;\n this.setState(newState);\n return;\n }\n }\n\n const hasHitASelectedElement = pointerDownState.hit.allHitElements.some(element => this.isASelectedElement(element));\n const isSelectingPointsInLineEditor = ((_c = this.state.selectedLinearElement) === null || _c === void 0 ? void 0 : _c.isEditing) && event.shiftKey && this.state.selectedLinearElement.elementId === ((_d = pointerDownState.hit.element) === null || _d === void 0 ? void 0 : _d.id);\n\n if ((hasHitASelectedElement || pointerDownState.hit.hasHitCommonBoundingBoxOfSelectedElements) && !isSelectingPointsInLineEditor && !pointerDownState.drag.blockDragging) {\n const selectedElements = this.scene.getSelectedElements(this.state);\n\n if (selectedElements.length > 0 && selectedElements.every(element => element.locked)) {\n return;\n }\n\n const selectedElementsHasAFrame = selectedElements.find(e => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isFrameLikeElement)(e));\n const topLayerFrame = this.getTopLayerFrameAtSceneCoords(pointerCoords);\n const frameToHighlight = topLayerFrame && !selectedElementsHasAFrame ? topLayerFrame : null; // Only update the state if there is a difference\n\n if (this.state.frameToHighlight !== frameToHighlight) {\n (0,react_dom__WEBPACK_IMPORTED_MODULE_3__.flushSync)(() => {\n this.setState({\n frameToHighlight\n });\n });\n } // Marking that click was used for dragging to check\n // if elements should be deselected on pointerup\n\n\n pointerDownState.drag.hasOccurred = true; // prevent immediate dragging during lasso selection to avoid element displacement\n // only allow dragging if we're not in the middle of lasso selection\n // (on mobile, allow dragging if we hit an element)\n\n if (this.state.activeTool.type === \"lasso\" && this.lassoTrail.hasCurrentTrail && !(this.editorInterface.formFactor !== \"desktop\" && pointerDownState.hit.element) && !this.state.activeTool.fromSelection) {\n return;\n } // Clear lasso trail when starting to drag selected elements with lasso tool\n // Only clear if we're actually dragging (not during lasso selection)\n\n\n if (this.state.activeTool.type === \"lasso\" && selectedElements.length > 0 && pointerDownState.drag.hasOccurred && !this.state.activeTool.fromSelection) {\n this.lassoTrail.endPath();\n } // prevent dragging even if we're no longer holding cmd/ctrl otherwise\n // it would have weird results (stuff jumping all over the screen)\n // Checking for editingTextElement to avoid jump while editing on mobile #6503\n\n\n if (selectedElements.length > 0 && !pointerDownState.withCmdOrCtrl && !this.state.editingTextElement && ((_e = this.state.activeEmbeddable) === null || _e === void 0 ? void 0 : _e.state) !== \"active\") {\n const dragOffset = {\n x: pointerCoords.x - pointerDownState.drag.origin.x,\n y: pointerCoords.y - pointerDownState.drag.origin.y\n };\n const originalElements = [...pointerDownState.originalElements.values()]; // We only drag in one direction if shift is pressed\n\n const lockDirection = event.shiftKey;\n\n if (lockDirection) {\n const distanceX = Math.abs(dragOffset.x);\n const distanceY = Math.abs(dragOffset.y);\n const lockX = lockDirection && distanceX < distanceY;\n const lockY = lockDirection && distanceX > distanceY;\n\n if (lockX) {\n dragOffset.x = 0;\n }\n\n if (lockY) {\n dragOffset.y = 0;\n }\n } // #region move crop region\n\n\n if (this.state.croppingElementId) {\n const croppingElement = this.scene.getNonDeletedElementsMap().get(this.state.croppingElementId);\n\n if (croppingElement && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isImageElement)(croppingElement) && croppingElement.crop !== null && pointerDownState.hit.element === croppingElement) {\n const crop = croppingElement.crop;\n const image = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isInitializedImageElement)(croppingElement) && ((_f = this.imageCache.get(croppingElement.fileId)) === null || _f === void 0 ? void 0 : _f.image);\n\n if (image && !(image instanceof Promise)) {\n const instantDragOffset = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.vectorScale)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.vector)(pointerCoords.x - lastPointerCoords.x, pointerCoords.y - lastPointerCoords.y), Math.max(this.state.zoom.value, 2));\n const [x1, y1, x2, y2, cx, cy] = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getElementAbsoluteCoords)(croppingElement, elementsMap);\n const topLeft = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.vectorFromPoint)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointRotateRads)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(x1, y1), (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(cx, cy), croppingElement.angle));\n const topRight = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.vectorFromPoint)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointRotateRads)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(x2, y1), (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(cx, cy), croppingElement.angle));\n const bottomLeft = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.vectorFromPoint)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointRotateRads)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(x1, y2), (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(cx, cy), croppingElement.angle));\n const topEdge = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.vectorNormalize)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.vectorSubtract)(topRight, topLeft));\n const leftEdge = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.vectorNormalize)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.vectorSubtract)(bottomLeft, topLeft)); // project instantDrafOffset onto leftEdge and topEdge to decompose\n\n const offsetVector = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.vector)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.vectorDot)(instantDragOffset, topEdge), (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.vectorDot)(instantDragOffset, leftEdge));\n const nextCrop = Object.assign(Object.assign({}, crop), {\n x: (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.clamp)(crop.x - offsetVector[0] * Math.sign(croppingElement.scale[0]), 0, image.naturalWidth - crop.width),\n y: (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.clamp)(crop.y - offsetVector[1] * Math.sign(croppingElement.scale[1]), 0, image.naturalHeight - crop.height)\n });\n this.scene.mutateElement(croppingElement, {\n crop: nextCrop\n });\n return;\n }\n }\n } // Snap cache *must* be synchronously popuplated before initial drag,\n // otherwise the first drag even will not snap, causing a jump before\n // it snaps to its position if previously snapped already.\n\n\n this.maybeCacheVisibleGaps(event, selectedElements);\n this.maybeCacheReferenceSnapPoints(event, selectedElements);\n const {\n snapOffset,\n snapLines\n } = (0,_snapping__WEBPACK_IMPORTED_MODULE_39__.snapDraggedElements)(originalElements, dragOffset, this, event, this.scene.getNonDeletedElementsMap());\n this.setState({\n snapLines\n }); // when we're editing the name of a frame, we want the user to be\n // able to select and interact with the text input\n\n if (!this.state.editingFrame) {\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.dragSelectedElements)(pointerDownState, selectedElements, dragOffset, this.scene, snapOffset, event[_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.KEYS.CTRL_OR_CMD] ? null : this.getEffectiveGridSize());\n }\n\n this.setState({\n selectedElementsAreBeingDragged: true,\n // element is being dragged and selectionElement that was created on pointer down\n // should be removed\n selectionElement: null\n });\n\n if (selectedElements.length !== 1 || !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(selectedElements[0])) {\n this.setState({\n suggestedBindings: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getSuggestedBindingsForArrows)(selectedElements, this.scene.getNonDeletedElementsMap(), this.state.zoom)\n });\n } // We duplicate the selected element if alt is pressed on pointer move\n\n\n if (event.altKey && !pointerDownState.hit.hasBeenDuplicated) {\n // Move the currently selected elements to the top of the z index stack, and\n // put the duplicates where the selected elements used to be.\n // (the origin point where the dragging started)\n pointerDownState.hit.hasBeenDuplicated = true;\n const elements = this.scene.getElementsIncludingDeleted();\n const hitElement = pointerDownState.hit.element;\n const selectedElements = this.scene.getSelectedElements({\n selectedElementIds: this.state.selectedElementIds,\n includeBoundTextElement: true,\n includeElementsInFrames: true\n });\n\n if (hitElement && // hit element may not end up being selected\n // if we're alt-dragging a common bounding box\n // over the hit element\n pointerDownState.hit.wasAddedToSelection && !selectedElements.find(el => el.id === hitElement.id)) {\n selectedElements.push(hitElement);\n }\n\n const idsOfElementsToDuplicate = new Map(selectedElements.map(el => [el.id, el]));\n const {\n duplicatedElements,\n duplicateElementsMap,\n elementsWithDuplicates,\n origIdToDuplicateId\n } = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.duplicateElements)({\n type: \"in-place\",\n elements,\n appState: this.state,\n randomizeSeed: true,\n idsOfElementsToDuplicate,\n overrides: ({\n duplicateElement,\n origElement\n }) => {\n var _a;\n\n return {\n // reset to the original element's frameId (unless we've\n // duplicated alongside a frame in which case we need to\n // keep the duplicate frame's id) so that the element\n // frame membership is refreshed on pointerup\n // NOTE this is a hacky solution and should be done\n // differently\n frameId: (_a = duplicateElement.frameId) !== null && _a !== void 0 ? _a : origElement.frameId,\n seed: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.randomInteger)()\n };\n }\n });\n duplicatedElements.forEach(element => {\n pointerDownState.originalElements.set(element.id, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.deepCopyElement)(element));\n });\n const mappedClonedElements = elementsWithDuplicates.map(el => {\n if (idsOfElementsToDuplicate.has(el.id)) {\n const origEl = pointerDownState.originalElements.get(el.id);\n\n if (origEl) {\n return (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.newElementWith)(el, {\n x: origEl.x,\n y: origEl.y\n });\n }\n }\n\n return el;\n });\n const mappedNewSceneElements = (_h = (_g = this.props).onDuplicate) === null || _h === void 0 ? void 0 : _h.call(_g, mappedClonedElements, elements);\n const elementsWithIndices = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.syncMovedIndices)(mappedNewSceneElements || mappedClonedElements, (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.arrayToMap)(duplicatedElements)); // we need to update synchronously so as to keep pointerDownState,\n // appState, and scene elements in sync\n\n (0,react_dom__WEBPACK_IMPORTED_MODULE_3__.flushSync)(() => {\n // swap hit element with the duplicated one\n if (pointerDownState.hit.element) {\n const cloneId = origIdToDuplicateId.get(pointerDownState.hit.element.id);\n const clonedElement = cloneId && duplicateElementsMap.get(cloneId);\n pointerDownState.hit.element = clonedElement || null;\n } // swap hit elements with the duplicated ones\n\n\n pointerDownState.hit.allHitElements = pointerDownState.hit.allHitElements.reduce((acc, origHitElement) => {\n const cloneId = origIdToDuplicateId.get(origHitElement.id);\n const clonedElement = cloneId && duplicateElementsMap.get(cloneId);\n\n if (clonedElement) {\n acc.push(clonedElement);\n }\n\n return acc;\n }, []); // update drag origin to the position at which we started\n // the duplication so that the drag offset is correct\n\n pointerDownState.drag.origin = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)(event, this.state); // switch selected elements to the duplicated ones\n\n this.setState(prevState => Object.assign({}, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getSelectionStateForElements)(duplicatedElements, this.scene.getNonDeletedElements(), prevState)));\n this.scene.replaceAllElements(elementsWithIndices);\n this.maybeCacheVisibleGaps(event, selectedElements, true);\n this.maybeCacheReferenceSnapPoints(event, selectedElements, true);\n });\n }\n\n return;\n }\n }\n\n if (this.state.selectionElement) {\n pointerDownState.lastCoords.x = pointerCoords.x;\n pointerDownState.lastCoords.y = pointerCoords.y;\n\n if (event.altKey) {\n this.setActiveTool({\n type: \"lasso\",\n fromSelection: true\n }, event.shiftKey);\n this.lassoTrail.startPath(pointerDownState.origin.x, pointerDownState.origin.y, event.shiftKey);\n this.setAppState({\n selectionElement: null\n });\n return;\n }\n\n this.maybeDragNewGenericElement(pointerDownState, event);\n } else if (this.state.activeTool.type === \"lasso\") {\n if (!event.altKey && this.state.activeTool.fromSelection) {\n this.setActiveTool({\n type: \"selection\"\n });\n this.createGenericElementOnPointerDown(\"selection\", pointerDownState);\n pointerDownState.lastCoords.x = pointerCoords.x;\n pointerDownState.lastCoords.y = pointerCoords.y;\n this.maybeDragNewGenericElement(pointerDownState, event);\n this.lassoTrail.endPath();\n } else {\n this.lassoTrail.addPointToPath(pointerCoords.x, pointerCoords.y, event.shiftKey);\n }\n } else {\n // It is very important to read this.state within each move event,\n // otherwise we would read a stale one!\n const newElement = this.state.newElement;\n\n if (!newElement) {\n return;\n }\n\n if (newElement.type === \"freedraw\") {\n const points = newElement.points;\n const dx = pointerCoords.x - newElement.x;\n const dy = pointerCoords.y - newElement.y;\n const lastPoint = points.length > 0 && points[points.length - 1];\n const discardPoint = lastPoint && lastPoint[0] === dx && lastPoint[1] === dy;\n\n if (!discardPoint) {\n const strokeOptions = this.state.currentStrokeOptions; //zsviczian\n\n const pressures = newElement.simulatePressure ? newElement.pressures : [//zsviczian\n ...newElement.pressures, (strokeOptions === null || strokeOptions === void 0 ? void 0 : strokeOptions.constantPressure) ? 1 : event.pressure];\n this.scene.mutateElement(newElement, {\n points: [...points, (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(dx, dy)],\n pressures\n }, {\n informMutation: false,\n isDragging: false\n });\n this.setState({\n newElement\n });\n }\n } else if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLinearElement)(newElement)) {\n pointerDownState.drag.hasOccurred = true;\n const points = newElement.points;\n let dx = gridX - newElement.x;\n let dy = gridY - newElement.y;\n\n if ((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.shouldRotateWithDiscreteAngle)(event) && points.length === 2) {\n ({\n width: dx,\n height: dy\n } = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getLockedLinearCursorAlignSize)(newElement.x, newElement.y, pointerCoords.x, pointerCoords.y));\n }\n\n if (points.length === 1) {\n this.scene.mutateElement(newElement, {\n points: [...points, (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(dx, dy)]\n }, {\n informMutation: false,\n isDragging: false\n });\n } else if (points.length === 2 || points.length > 1 && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(newElement)) {\n this.scene.mutateElement(newElement, {\n points: [...points.slice(0, -1), (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(dx, dy)]\n }, {\n isDragging: true,\n informMutation: false\n });\n }\n\n this.setState({\n newElement\n });\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isBindingElement)(newElement, false)) {\n // When creating a linear element by dragging\n this.setState({\n suggestedBindings: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.maybeSuggestBindingsForLinearElementAtCoords)(newElement, [pointerCoords], this.scene, this.state.zoom, this.state.startBoundElement)\n });\n }\n } else {\n pointerDownState.lastCoords.x = pointerCoords.x;\n pointerDownState.lastCoords.y = pointerCoords.y;\n this.maybeDragNewGenericElement(pointerDownState, event, false);\n }\n }\n\n if (this.state.activeTool.type === \"selection\") {\n pointerDownState.boxSelection.hasOccurred = true;\n const elements = this.scene.getNonDeletedElements(); // box-select line editor points\n\n if ((_j = this.state.selectedLinearElement) === null || _j === void 0 ? void 0 : _j.isEditing) {\n _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.handleBoxSelection(event, this.state, this.setState.bind(this), this.scene.getNonDeletedElementsMap()); // regular box-select\n } else {\n let shouldReuseSelection = true;\n\n if (!event.shiftKey && (0,_scene__WEBPACK_IMPORTED_MODULE_31__.isSomeElementSelected)(elements, this.state)) {\n if (pointerDownState.withCmdOrCtrl && pointerDownState.hit.element) {\n this.setState(prevState => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.selectGroupsForSelectedElements)(Object.assign(Object.assign({}, prevState), {\n selectedElementIds: {\n [pointerDownState.hit.element.id]: true\n }\n }), this.scene.getNonDeletedElements(), prevState, this));\n } else {\n shouldReuseSelection = false;\n }\n }\n\n const elementsWithinSelection = this.state.selectionElement ? (0,_scene__WEBPACK_IMPORTED_MODULE_31__.getElementsWithinSelection)(elements, this.state.selectionElement, this.scene.getNonDeletedElementsMap(), false) : [];\n this.setState(prevState => {\n const nextSelectedElementIds = Object.assign(Object.assign({}, shouldReuseSelection && prevState.selectedElementIds), elementsWithinSelection.reduce((acc, element) => {\n acc[element.id] = true;\n return acc;\n }, {}));\n\n if (pointerDownState.hit.element) {\n // if using ctrl/cmd, select the hitElement only if we\n // haven't box-selected anything else\n if (!elementsWithinSelection.length) {\n nextSelectedElementIds[pointerDownState.hit.element.id] = true;\n } else {\n delete nextSelectedElementIds[pointerDownState.hit.element.id];\n }\n }\n\n prevState = !shouldReuseSelection ? Object.assign(Object.assign({}, prevState), {\n selectedGroupIds: {},\n editingGroupId: null\n }) : prevState;\n return Object.assign(Object.assign({}, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.selectGroupsForSelectedElements)({\n editingGroupId: prevState.editingGroupId,\n selectedElementIds: nextSelectedElementIds\n }, this.scene.getNonDeletedElements(), prevState, this)), {\n // select linear element only when we haven't box-selected anything else\n selectedLinearElement: elementsWithinSelection.length === 1 && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLinearElement)(elementsWithinSelection[0]) ? new _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor(elementsWithinSelection[0], this.scene.getNonDeletedElementsMap()) : null,\n showHyperlinkPopup: elementsWithinSelection.length === 1 && (elementsWithinSelection[0].link || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isEmbeddableElement)(elementsWithinSelection[0])) ? \"info\" : false\n });\n });\n }\n }\n });\n } // Returns whether the pointer move happened over either scrollbar\n\n\n handlePointerMoveOverScrollbars(event, pointerDownState) {\n var _a, _b;\n\n if (pointerDownState.scrollbars.isOverHorizontal) {\n const x = event.clientX;\n const dx = x - pointerDownState.lastCoords.x;\n this.translateCanvas({\n scrollX: this.state.scrollX - dx * (((_a = currentScrollBars.horizontal) === null || _a === void 0 ? void 0 : _a.deltaMultiplier) || 1) / this.state.zoom.value\n });\n pointerDownState.lastCoords.x = x;\n return true;\n }\n\n if (pointerDownState.scrollbars.isOverVertical) {\n const y = event.clientY;\n const dy = y - pointerDownState.lastCoords.y;\n this.translateCanvas({\n scrollY: this.state.scrollY - dy * (((_b = currentScrollBars.vertical) === null || _b === void 0 ? void 0 : _b.deltaMultiplier) || 1) / this.state.zoom.value\n });\n pointerDownState.lastCoords.y = y;\n return true;\n }\n\n return false;\n }\n\n onPointerUpFromPointerDownHandler(pointerDownState) {\n return (0,_reactUtils__WEBPACK_IMPORTED_MODULE_45__.withBatchedUpdates)(childEvent => {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;\n\n this.removePointer(childEvent);\n pointerDownState.drag.blockDragging = false;\n\n if (pointerDownState.eventListeners.onMove) {\n pointerDownState.eventListeners.onMove.flush();\n }\n\n const {\n newElement,\n resizingElement,\n croppingElementId,\n multiElement,\n activeTool,\n isResizing,\n isRotating,\n isCropping\n } = this.state;\n this.setState(prevState => ({\n isResizing: false,\n isRotating: false,\n isCropping: false,\n resizingElement: null,\n selectionElement: null,\n frameToHighlight: null,\n elementsToHighlight: null,\n cursorButton: \"up\",\n snapLines: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateStable)(prevState.snapLines, []),\n originSnapOffset: null\n })); // just in case, tool changes mid drag, always clean up\n\n this.lassoTrail.endPath();\n this.lastPointerMoveCoords = null;\n _snapping__WEBPACK_IMPORTED_MODULE_39__.SnapCache.setReferenceSnapPoints(null);\n _snapping__WEBPACK_IMPORTED_MODULE_39__.SnapCache.setVisibleGaps(null);\n this.savePointer(childEvent.clientX, childEvent.clientY, \"up\"); // if current elements are still selected\n // and the pointer is just over a locked element\n // do not allow activeLockedId to be set\n\n const hitElements = pointerDownState.hit.allHitElements;\n const sceneCoords = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)({\n clientX: childEvent.clientX,\n clientY: childEvent.clientY\n }, this.state);\n\n if (this.state.activeTool.type === \"selection\" && !pointerDownState.boxSelection.hasOccurred && !pointerDownState.resize.isResizing && !hitElements.some(el => this.state.selectedElementIds[el.id])) {\n const hitLockedElement = this.getElementAtPosition(sceneCoords.x, sceneCoords.y, {\n includeLockedElements: true\n });\n this.store.scheduleCapture();\n\n if (hitLockedElement === null || hitLockedElement === void 0 ? void 0 : hitLockedElement.locked) {\n this.setState({\n activeLockedId: hitLockedElement.groupIds.length > 0 ? hitLockedElement.groupIds.at(-1) || \"\" : hitLockedElement.id\n });\n } else {\n this.setState({\n activeLockedId: null\n });\n }\n } else {\n this.setState({\n activeLockedId: null\n });\n }\n\n this.setState({\n selectedElementsAreBeingDragged: false\n });\n const elementsMap = this.scene.getNonDeletedElementsMap();\n\n if (pointerDownState.drag.hasOccurred && ((_b = (_a = pointerDownState.hit) === null || _a === void 0 ? void 0 : _a.element) === null || _b === void 0 ? void 0 : _b.id)) {\n const element = elementsMap.get(pointerDownState.hit.element.id);\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isBindableElement)(element)) {\n // Renormalize elbow arrows when they are changed via indirect move\n (_c = element.boundElements) === null || _c === void 0 ? void 0 : _c.filter(e => e.type === \"arrow\").map(e => elementsMap.get(e.id)).filter(e => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(e)).forEach(e => {\n !!e && this.scene.mutateElement(e, {});\n });\n }\n } // Handle end of dragging a point of a linear element, might close a loop\n // and sets binding element\n\n\n if ((_d = this.state.selectedLinearElement) === null || _d === void 0 ? void 0 : _d.isEditing) {\n if (!pointerDownState.boxSelection.hasOccurred && ((_f = (_e = pointerDownState.hit) === null || _e === void 0 ? void 0 : _e.element) === null || _f === void 0 ? void 0 : _f.id) !== this.state.selectedLinearElement.elementId) {\n this.actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_8__.actionFinalize);\n } else {\n const editingLinearElement = _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.handlePointerUp(childEvent, this.state.selectedLinearElement, this.state, this.scene);\n\n if (editingLinearElement !== this.state.selectedLinearElement) {\n this.setState({\n selectedLinearElement: editingLinearElement,\n suggestedBindings: []\n });\n }\n }\n } else if (this.state.selectedLinearElement) {\n // Normalize elbow arrow points, remove close parallel segments\n if (this.state.selectedLinearElement.elbowed) {\n const element = _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor.getElement(this.state.selectedLinearElement.elementId, this.scene.getNonDeletedElementsMap());\n\n if (element) {\n this.scene.mutateElement(element, {});\n }\n }\n\n if (((_h = (_g = pointerDownState.hit) === null || _g === void 0 ? void 0 : _g.element) === null || _h === void 0 ? void 0 : _h.id) !== this.state.selectedLinearElement.elementId) {\n const selectedELements = this.scene.getSelectedElements(this.state); // set selectedLinearElement to null if there is more than one element selected since we don't want to show linear element handles\n\n if (selectedELements.length > 1) {\n this.setState({\n selectedLinearElement: null\n });\n }\n } else if (this.state.selectedLinearElement.isDragging) {\n this.actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_8__.actionFinalize, \"ui\", {\n event: childEvent,\n sceneCoords\n });\n }\n }\n\n this.missingPointerEventCleanupEmitter.clear();\n window.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_MOVE, pointerDownState.eventListeners.onMove);\n window.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.POINTER_UP, pointerDownState.eventListeners.onUp);\n window.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.KEYDOWN, pointerDownState.eventListeners.onKeyDown);\n window.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.EVENT.KEYUP, pointerDownState.eventListeners.onKeyUp);\n (_k = (_j = this.props) === null || _j === void 0 ? void 0 : _j.onPointerUp) === null || _k === void 0 ? void 0 : _k.call(_j, activeTool, pointerDownState);\n this.onPointerUpEmitter.trigger(this.state.activeTool, pointerDownState, childEvent);\n\n if ((newElement === null || newElement === void 0 ? void 0 : newElement.type) === \"freedraw\") {\n const pointerCoords = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)(childEvent, this.state);\n const points = newElement.points;\n let dx = pointerCoords.x - newElement.x;\n let dy = pointerCoords.y - newElement.y; // Allows dots to avoid being flagged as infinitely small\n\n if (dx === points[0][0] && dy === points[0][1]) {\n dy += 0.0001;\n dx += 0.0001;\n }\n\n const pressures = newElement.simulatePressure ? [] : [...newElement.pressures, childEvent.pressure];\n this.scene.mutateElement(newElement, {\n points: [...points, (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(dx, dy)],\n pressures,\n lastCommittedPoint: (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(dx, dy)\n });\n this.actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_8__.actionFinalize);\n return;\n }\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLinearElement)(newElement)) {\n if (newElement.points.length > 1) {\n this.store.scheduleCapture();\n }\n\n const pointerCoords = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)(childEvent, this.state);\n const dragDistance = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointDistance)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(pointerCoords.x, pointerCoords.y), (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(pointerDownState.origin.x, pointerDownState.origin.y)) * this.state.zoom.value;\n\n if ((!pointerDownState.drag.hasOccurred || dragDistance < _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.MINIMUM_ARROW_SIZE) && newElement && !multiElement) {\n if (this.editorInterface.isTouchScreen && newElement.points.length > 1) {\n //zsviczian\n const FIXED_DELTA_X = Math.min(this.state.width * 0.7 / this.state.zoom.value, 100);\n this.scene.mutateElement(newElement, {\n x: newElement.x - FIXED_DELTA_X / 2,\n points: [(0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(0, 0), (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(FIXED_DELTA_X, 0)]\n }, {\n informMutation: false,\n isDragging: false\n });\n this.actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_8__.actionFinalize);\n } else {\n const dx = pointerCoords.x - newElement.x;\n const dy = pointerCoords.y - newElement.y;\n this.scene.mutateElement(newElement, {\n points: [...newElement.points, (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(dx, dy)]\n }, {\n informMutation: false,\n isDragging: false\n });\n this.setState({\n multiElement: newElement,\n newElement\n });\n }\n } else if (pointerDownState.drag.hasOccurred && !multiElement) {\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isBindingEnabled)(this.state) && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isBindingElement)(newElement, false)) {\n this.actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_8__.actionFinalize, \"ui\", {\n event: childEvent,\n sceneCoords\n });\n }\n\n this.setState({\n suggestedBindings: [],\n startBoundElement: null\n });\n\n if (!activeTool.locked) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.resetCursor)(this.interactiveCanvas);\n this.setState(prevState => ({\n newElement: null,\n activeTool: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateActiveTool)(this.state, {\n type: this.state.preferredSelectionTool.type\n }),\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)(Object.assign(Object.assign({}, prevState.selectedElementIds), {\n [newElement.id]: true\n }), prevState),\n selectedLinearElement: new _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor(newElement, this.scene.getNonDeletedElementsMap())\n }));\n } else {\n this.setState(prevState => ({\n newElement: null\n }));\n } // so that the scene gets rendered again to display the newly drawn linear as well\n\n\n this.scene.triggerUpdate();\n }\n\n return;\n }\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isTextElement)(newElement)) {\n const minWidth = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getMinTextElementWidth)((0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.getFontString)({\n fontSize: newElement.fontSize,\n fontFamily: newElement.fontFamily\n }), newElement.lineHeight);\n\n if (newElement.width < minWidth) {\n this.scene.mutateElement(newElement, {\n autoResize: true\n });\n }\n\n this.resetCursor();\n this.handleTextWysiwyg(newElement, {\n isExistingElement: true\n });\n }\n\n if (activeTool.type !== \"selection\" && newElement && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isInvisiblySmallElement)(newElement)) {\n // remove invisible element which was added in onPointerDown\n // update the store snapshot, so that invisible elements are not captured by the store\n this.updateScene({\n elements: this.scene.getElementsIncludingDeleted().filter(el => el.id !== newElement.id),\n appState: {\n newElement: null\n },\n captureUpdate: _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.CaptureUpdateAction.NEVER\n });\n return;\n }\n\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isFrameLikeElement)(newElement)) {\n const elementsInsideFrame = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getElementsInNewFrame)(this.scene.getElementsIncludingDeleted(), newElement, this.scene.getNonDeletedElementsMap());\n this.scene.replaceAllElements((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.addElementsToFrame)(this.scene.getElementsMapIncludingDeleted(), elementsInsideFrame, newElement, this.state));\n }\n\n if (newElement) {\n this.scene.mutateElement(newElement, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getNormalizedDimensions)(newElement), {\n informMutation: false,\n isDragging: false\n }); // the above does not guarantee the scene to be rendered again, hence the trigger below\n\n this.scene.triggerUpdate();\n }\n\n if (pointerDownState.drag.hasOccurred) {\n const sceneCoords = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)(childEvent, this.state); // when editing the points of a linear element, we check if the\n // linear element still is in the frame afterwards\n // if not, the linear element will be removed from its frame (if any)\n\n if (this.state.selectedLinearElement && this.state.selectedLinearElement.isDragging) {\n const linearElement = this.scene.getElement(this.state.selectedLinearElement.elementId);\n\n if (linearElement === null || linearElement === void 0 ? void 0 : linearElement.frameId) {\n const frame = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getContainingFrame)(linearElement, elementsMap);\n\n if (frame && linearElement) {\n if (!(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.elementOverlapsWithFrame)(linearElement, frame, this.scene.getNonDeletedElementsMap())) {\n // remove the linear element from all groups\n // before removing it from the frame as well\n this.scene.mutateElement(linearElement, {\n groupIds: []\n });\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.removeElementsFromFrame)([linearElement], this.scene.getNonDeletedElementsMap());\n this.scene.triggerUpdate();\n }\n }\n }\n } else {\n // update the relationships between selected elements and frames\n const topLayerFrame = this.getTopLayerFrameAtSceneCoords(sceneCoords);\n const selectedElements = this.scene.getSelectedElements(this.state);\n let nextElements = this.scene.getElementsMapIncludingDeleted();\n\n const updateGroupIdsAfterEditingGroup = elements => {\n if (elements.length > 0) {\n for (const element of elements) {\n const index = element.groupIds.indexOf(this.state.editingGroupId);\n this.scene.mutateElement(element, {\n groupIds: element.groupIds.slice(0, index)\n }, {\n informMutation: false,\n isDragging: false\n });\n }\n\n nextElements.forEach(element => {\n if (element.groupIds.length && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getElementsInGroup)(nextElements, element.groupIds[element.groupIds.length - 1]).length < 2) {\n this.scene.mutateElement(element, {\n groupIds: []\n }, {\n informMutation: false,\n isDragging: false\n });\n }\n });\n this.setState({\n editingGroupId: null\n });\n }\n };\n\n if (topLayerFrame && !this.state.selectedElementIds[topLayerFrame.id]) {\n const elementsToAdd = selectedElements.filter(element => element.frameId !== topLayerFrame.id && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElementInFrame)(element, nextElements, this.state));\n\n if (this.state.editingGroupId) {\n updateGroupIdsAfterEditingGroup(elementsToAdd);\n }\n\n nextElements = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.addElementsToFrame)(nextElements, elementsToAdd, topLayerFrame, this.state);\n } else if (!topLayerFrame) {\n if (this.state.editingGroupId) {\n const elementsToRemove = selectedElements.filter(element => element.frameId && !(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElementInFrame)(element, nextElements, this.state));\n updateGroupIdsAfterEditingGroup(elementsToRemove);\n }\n }\n\n nextElements = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.updateFrameMembershipOfSelectedElements)(nextElements, this.state, this);\n this.scene.replaceAllElements(nextElements);\n }\n }\n\n if (resizingElement) {\n this.store.scheduleCapture();\n }\n\n if (resizingElement && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isInvisiblySmallElement)(resizingElement)) {\n // update the store snapshot, so that invisible elements are not captured by the store\n this.updateScene({\n elements: this.scene.getElementsIncludingDeleted().filter(el => el.id !== resizingElement.id),\n captureUpdate: _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.CaptureUpdateAction.NEVER\n });\n } // handle frame membership for resizing frames and/or selected elements\n\n\n if (pointerDownState.resize.isResizing) {\n let nextElements = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.updateFrameMembershipOfSelectedElements)(this.scene.getElementsIncludingDeleted(), this.state, this);\n const selectedFrames = this.scene.getSelectedElements(this.state).filter(element => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isFrameLikeElement)(element));\n\n for (const frame of selectedFrames) {\n nextElements = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.replaceAllElementsInFrame)(nextElements, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getElementsInResizingFrame)(this.scene.getElementsIncludingDeleted(), frame, this.state, elementsMap), frame, this);\n }\n\n this.scene.replaceAllElements(nextElements);\n } // Code below handles selection when element(s) weren't\n // drag or added to selection on pointer down phase.\n\n\n const hitElement = pointerDownState.hit.element;\n\n if (((_l = this.state.selectedLinearElement) === null || _l === void 0 ? void 0 : _l.elementId) !== (hitElement === null || hitElement === void 0 ? void 0 : hitElement.id) && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLinearElement)(hitElement)) {\n const selectedElements = this.scene.getSelectedElements(this.state); // set selectedLinearElement when no other element selected except\n // the one we've hit\n\n if (selectedElements.length === 1) {\n this.setState({\n selectedLinearElement: new _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor(hitElement, this.scene.getNonDeletedElementsMap())\n });\n }\n } // click outside the cropping region to exit\n\n\n if ( // not in the cropping mode at all\n !croppingElementId || // in the cropping mode\n croppingElementId && ( // not cropping and no hit element\n !hitElement && !isCropping || // hitting something else\n hitElement && hitElement.id !== croppingElementId)) {\n this.finishImageCropping();\n }\n\n const pointerStart = this.lastPointerDownEvent;\n const pointerEnd = this.lastPointerUpEvent || this.lastPointerMoveEvent;\n\n if ((0,_appState__WEBPACK_IMPORTED_MODULE_23__.isEraserActive)(this.state) && pointerStart && pointerEnd) {\n this.eraserTrail.endPath();\n const draggedDistance = (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointDistance)((0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(pointerStart.clientX, pointerStart.clientY), (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(pointerEnd.clientX, pointerEnd.clientY));\n\n if (draggedDistance === 0) {\n const scenePointer = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.viewportCoordsToSceneCoords)({\n clientX: pointerEnd.clientX,\n clientY: pointerEnd.clientY\n }, this.state);\n const hitElements = this.getElementsAtPosition(scenePointer.x, scenePointer.y);\n hitElements.forEach(hitElement => this.elementsPendingErasure.add(hitElement.id));\n }\n\n this.eraseElements();\n return;\n } else if (this.elementsPendingErasure.size) {\n this.restoreReadyToEraseElements();\n }\n\n if (hitElement && !pointerDownState.drag.hasOccurred && !pointerDownState.hit.wasAddedToSelection && ( // if we're editing a line, pointerup shouldn't switch selection if\n // box selected\n !((_m = this.state.selectedLinearElement) === null || _m === void 0 ? void 0 : _m.isEditing) || !pointerDownState.boxSelection.hasOccurred) && // hitElement can be set when alt + ctrl to toggle lasso and we will\n // just respect the selected elements from lasso instead\n this.state.activeTool.type !== \"lasso\") {\n // when inside line editor, shift selects points instead\n if (childEvent.shiftKey && !((_o = this.state.selectedLinearElement) === null || _o === void 0 ? void 0 : _o.isEditing)) {\n if (this.state.selectedElementIds[hitElement.id]) {\n if ((0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isSelectedViaGroup)(this.state, hitElement)) {\n this.setState(_prevState => {\n const nextSelectedElementIds = Object.assign({}, _prevState.selectedElementIds); // We want to unselect all groups hitElement is part of\n // as well as all elements that are part of the groups\n // hitElement is part of\n\n for (const groupedElement of hitElement.groupIds.flatMap(groupId => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getElementsInGroup)(this.scene.getNonDeletedElements(), groupId))) {\n delete nextSelectedElementIds[groupedElement.id];\n }\n\n return {\n selectedGroupIds: Object.assign(Object.assign({}, _prevState.selectedElementIds), hitElement.groupIds.map(gId => ({\n [gId]: false\n })).reduce((prev, acc) => Object.assign(Object.assign({}, prev), acc), {})),\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)(nextSelectedElementIds, _prevState)\n };\n }); // if not dragging a linear element point (outside editor)\n } else if (!((_p = this.state.selectedLinearElement) === null || _p === void 0 ? void 0 : _p.isDragging)) {\n // remove element from selection while\n // keeping prev elements selected\n this.setState(prevState => {\n const newSelectedElementIds = Object.assign({}, prevState.selectedElementIds);\n delete newSelectedElementIds[hitElement.id];\n const newSelectedElements = (0,_scene__WEBPACK_IMPORTED_MODULE_31__.getSelectedElements)(this.scene.getNonDeletedElements(), {\n selectedElementIds: newSelectedElementIds\n });\n return Object.assign(Object.assign({}, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.selectGroupsForSelectedElements)({\n editingGroupId: prevState.editingGroupId,\n selectedElementIds: newSelectedElementIds\n }, this.scene.getNonDeletedElements(), prevState, this)), {\n // set selectedLinearElement only if thats the only element selected\n selectedLinearElement: newSelectedElements.length === 1 && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLinearElement)(newSelectedElements[0]) ? new _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor(newSelectedElements[0], this.scene.getNonDeletedElementsMap()) : prevState.selectedLinearElement\n });\n });\n }\n } else if (hitElement.frameId && this.state.selectedElementIds[hitElement.frameId]) {\n // when hitElement is part of a selected frame, deselect the frame\n // to avoid frame and containing elements selected simultaneously\n this.setState(prevState => {\n var _a, _b;\n\n const nextSelectedElementIds = Object.assign(Object.assign({}, prevState.selectedElementIds), {\n [hitElement.id]: true\n }); // deselect the frame\n\n delete nextSelectedElementIds[hitElement.frameId]; // deselect groups containing the frame\n\n ((_b = (_a = this.scene.getElement(hitElement.frameId)) === null || _a === void 0 ? void 0 : _a.groupIds) !== null && _b !== void 0 ? _b : []).flatMap(gid => (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getElementsInGroup)(this.scene.getNonDeletedElements(), gid)).forEach(element => {\n delete nextSelectedElementIds[element.id];\n });\n return Object.assign(Object.assign({}, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.selectGroupsForSelectedElements)({\n editingGroupId: prevState.editingGroupId,\n selectedElementIds: nextSelectedElementIds\n }, this.scene.getNonDeletedElements(), prevState, this)), {\n showHyperlinkPopup: hitElement.link || (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isEmbeddableElement)(hitElement) ? \"info\" : false\n });\n });\n } else {\n // add element to selection while keeping prev elements selected\n this.setState(_prevState => ({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)(Object.assign(Object.assign({}, _prevState.selectedElementIds), {\n [hitElement.id]: true\n }), _prevState)\n }));\n }\n } else {\n this.setState(prevState => {\n var _a;\n\n return Object.assign(Object.assign({}, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.selectGroupsForSelectedElements)({\n editingGroupId: prevState.editingGroupId,\n selectedElementIds: {\n [hitElement.id]: true\n }\n }, this.scene.getNonDeletedElements(), prevState, this)), {\n selectedLinearElement: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLinearElement)(hitElement) && // Don't set `selectedLinearElement` if its same as the hitElement, this is mainly to prevent resetting the `hoverPointIndex` to -1.\n // Future we should update the API to take care of setting the correct `hoverPointIndex` when initialized\n ((_a = prevState.selectedLinearElement) === null || _a === void 0 ? void 0 : _a.elementId) !== hitElement.id ? new _excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.LinearElementEditor(hitElement, this.scene.getNonDeletedElementsMap()) : prevState.selectedLinearElement\n });\n });\n }\n }\n\n if ( // do not clear selection if lasso is active\n this.state.activeTool.type !== \"lasso\" && // not elbow midpoint dragged\n !(hitElement && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElbowArrow)(hitElement)) && // not dragged\n !pointerDownState.drag.hasOccurred && // not resized\n !this.state.isResizing && ( // only hitting the bounding box of the previous hit element\n hitElement && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.hitElementBoundingBoxOnly)({\n point: (0,_excalidraw_math__WEBPACK_IMPORTED_MODULE_5__.pointFrom)(pointerDownState.origin.x, pointerDownState.origin.y),\n element: hitElement,\n elementsMap,\n threshold: this.getElementHitThreshold(hitElement),\n frameNameBound: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isFrameLikeElement)(hitElement) ? this.frameNameBoundsCache.get(hitElement) : null\n }, elementsMap) || !hitElement && pointerDownState.hit.hasHitCommonBoundingBoxOfSelectedElements)) {\n if ((_q = this.state.selectedLinearElement) === null || _q === void 0 ? void 0 : _q.isEditing) {\n // Exit editing mode but keep the element selected\n this.actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_8__.actionToggleLinearEditor);\n } else {\n // Deselect selected elements\n this.setState({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)({}, this.state),\n selectedGroupIds: {},\n editingGroupId: null,\n activeEmbeddable: null\n });\n } // reset cursor\n\n\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.setCursor)(this.interactiveCanvas, _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.CURSOR_TYPE.AUTO);\n return;\n }\n\n if (!activeTool.locked && activeTool.type !== \"freedraw\" && newElement) {\n this.setState(prevState => ({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)(Object.assign(Object.assign({}, prevState.selectedElementIds), {\n [newElement.id]: true\n }), prevState),\n showHyperlinkPopup: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isEmbeddableElement)(newElement) && !newElement.link ? \"editor\" : prevState.showHyperlinkPopup\n }));\n }\n\n if (activeTool.type !== \"selection\" || (0,_scene__WEBPACK_IMPORTED_MODULE_31__.isSomeElementSelected)(this.scene.getNonDeletedElements(), this.state) || !(0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.isShallowEqual)(this.state.previousSelectedElementIds, this.state.selectedElementIds)) {\n this.store.scheduleCapture();\n }\n\n if (pointerDownState.drag.hasOccurred && !this.state.selectedLinearElement || isResizing || isRotating || isCropping) {\n // We only allow binding via linear elements, specifically via dragging\n // the endpoints (\"start\" or \"end\").\n const linearElements = this.scene.getSelectedElements(this.state).filter(_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isLinearElement);\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.bindOrUnbindLinearElements)(linearElements, (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isBindingEnabled)(this.state), (_s = (_r = this.state.selectedLinearElement) === null || _r === void 0 ? void 0 : _r.selectedPointsIndices) !== null && _s !== void 0 ? _s : [], this.scene, this.state.zoom);\n }\n\n if (activeTool.type === \"laser\") {\n this.laserTrails.endPath();\n return;\n }\n\n if (!activeTool.locked && activeTool.type !== \"freedraw\" && (activeTool.type !== \"lasso\" || // if lasso is turned on but from selection => reset to selection\n activeTool.type === \"lasso\" && activeTool.fromSelection)) {\n (0,_cursor__WEBPACK_IMPORTED_MODULE_42__.resetCursor)(this.interactiveCanvas);\n this.setState({\n newElement: null,\n suggestedBindings: [],\n activeTool: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.updateActiveTool)(this.state, {\n type: this.state.preferredSelectionTool.type\n })\n });\n } else {\n this.setState({\n newElement: null,\n suggestedBindings: []\n });\n }\n\n if (hitElement && this.lastPointerUpEvent && this.lastPointerDownEvent && this.lastPointerUpEvent.timeStamp - this.lastPointerDownEvent.timeStamp < 300 && gesture.pointers.size <= 1 && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isIframeLikeElement)(hitElement) && this.isIframeLikeElementCenter(hitElement, this.lastPointerUpEvent, pointerDownState.origin.x, pointerDownState.origin.y)) {\n this.handleEmbeddableCenterClick(hitElement);\n }\n });\n } //zsviczian - published on API\n\n\n setSelection(elements) {\n const selectedElementIds = {};\n const selectedGroupIds = {};\n elements.forEach(ele => {\n if (ele.groupIds.length) {\n selectedElementIds[ele.id] = true;\n ele.groupIds.forEach(id => {\n selectedGroupIds[id] = true;\n });\n } // exclude bound text elements as we don't mark them as selected when\n // container is selected unless in group\n else if (!(0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isBoundToContainer)(ele)) {\n selectedElementIds[ele.id] = true;\n }\n });\n this.setState({\n previousSelectedElementIds: this.state.selectedElementIds,\n selectedElementIds,\n selectedGroupIds\n });\n }\n\n clearSelection(hitElement) {\n this.setState(prevState => ({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)({}, prevState),\n activeEmbeddable: null,\n selectedGroupIds: {},\n // Continue editing the same group if the user selected a different\n // element from it\n editingGroupId: prevState.editingGroupId && hitElement != null && (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.isElementInGroup)(hitElement, prevState.editingGroupId) ? prevState.editingGroupId : null\n }));\n this.setState({\n selectedElementIds: (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.makeNextSelectedElementIds)({}, this.state),\n activeEmbeddable: null,\n previousSelectedElementIds: this.state.selectedElementIds\n });\n }\n\n getTextWysiwygSnappedToCenterPosition(x, y, appState, container) {\n if (container) {\n let elementCenterX = container.x + container.width / 2;\n let elementCenterY = container.y + container.height / 2;\n const elementCenter = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_7__.getContainerCenter)(container, appState, this.scene.getNonDeletedElementsMap());\n\n if (elementCenter) {\n elementCenterX = elementCenter.x;\n elementCenterY = elementCenter.y;\n }\n\n const distanceToCenter = Math.hypot(x - elementCenterX, y - elementCenterY);\n const isSnappedToCenter = distanceToCenter < _excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.TEXT_TO_CENTER_SNAP_THRESHOLD;\n\n if (isSnappedToCenter) {\n const {\n x: viewportX,\n y: viewportY\n } = (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_6__.sceneCoordsToViewportCoords)({\n sceneX: elementCenterX,\n sceneY: elementCenterY\n }, appState);\n return {\n viewportX,\n viewportY,\n elementCenterX,\n elementCenterY\n };\n }\n }\n }\n\n getCanvasOffsets() {\n var _a;\n\n if ((_a = this.excalidrawContainerRef) === null || _a === void 0 ? void 0 : _a.current) {\n const excalidrawContainer = this.excalidrawContainerRef.current;\n const {\n left,\n top\n } = excalidrawContainer.getBoundingClientRect();\n return {\n offsetLeft: left,\n offsetTop: top\n };\n }\n\n return {\n offsetLeft: 0,\n offsetTop: 0\n };\n }\n\n async updateLanguage() {\n const currentLang = _i18n__WEBPACK_IMPORTED_MODULE_30__.languages.find(lang => lang.code === this.props.langCode) || _i18n__WEBPACK_IMPORTED_MODULE_30__.defaultLang;\n await (0,_i18n__WEBPACK_IMPORTED_MODULE_30__.setLanguage)(currentLang);\n this.setAppState({});\n }\n\n} // -----------------------------------------------------------------------------\n// TEST HOOKS\n// -----------------------------------------------------------------------------\n\n/* //zsviczian - I get a type error on h, but anyway I don't need this test hook\r\ndeclare global {\r\n interface Window {\r\n h: {\r\n scene: Scene;\r\n elements: readonly ExcalidrawElement[];\r\n state: AppState;\r\n setState: React.Component<any, AppState>[\"setState\"];\r\n app: InstanceType<typeof App>;\r\n history: History;\r\n store: Store;\r\n };\r\n }\r\n}\r\n\r\nexport const createTestHook = () => {\r\n if (isTestEnv() || isDevEnv()) {\r\n window.h = window.h || ({} as Window[\"h\"]);\r\n\r\n Object.defineProperties(window.h, {\r\n elements: {\r\n configurable: true,\r\n get() {\r\n return this.app?.scene.getElementsIncludingDeleted();\r\n },\r\n set(elements: ExcalidrawElement[]) {\r\n return this.app?.scene.replaceAllElements(\r\n syncInvalidIndices(elements),\r\n );\r\n },\r\n },\r\n scene: {\r\n configurable: true,\r\n get() {\r\n return this.app?.scene;\r\n },\r\n },\r\n });\r\n }\r\n};\r\n\r\ncreateTestHook();*/\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (App);\n\n//# sourceURL=webpack://ExcalidrawLib/./components/App.tsx?");
|
|
14349
14349
|
|
|
14350
14350
|
/***/ }),
|
|
14351
14351
|
|
|
@@ -15225,7 +15225,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extr
|
|
|
15225
15225
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
15226
15226
|
|
|
15227
15227
|
"use strict";
|
|
15228
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ \"../../node_modules/clsx/dist/clsx.m.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\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 _actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../actions */ \"./actions/index.ts\");\n/* harmony import */ var _analytics__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../analytics */ \"./analytics.ts\");\n/* harmony import */ var _appState__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../appState */ \"./appState.ts\");\n/* harmony import */ var _context_tunnels__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../context/tunnels */ \"./context/tunnels.ts\");\n/* harmony import */ var _context_ui_appState__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../context/ui-appState */ \"./context/ui-appState.ts\");\n/* harmony import */ var _editor_jotai__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../editor-jotai */ \"./editor-jotai.ts\");\n/* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../i18n */ \"./i18n.ts\");\n/* harmony import */ var _scene__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../scene */ \"./scene/index.ts\");\n/* harmony import */ var _Actions__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./Actions */ \"./components/Actions.tsx\");\n/* harmony import */ var _LoadingMessage__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./LoadingMessage */ \"./components/LoadingMessage.tsx\");\n/* harmony import */ var _LockButton__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./LockButton */ \"./components/LockButton.tsx\");\n/* harmony import */ var _MobileMenu__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./MobileMenu */ \"./components/MobileMenu.tsx\");\n/* harmony import */ var _PasteChartDialog__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./PasteChartDialog */ \"./components/PasteChartDialog.tsx\");\n/* harmony import */ var _Section__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./Section */ \"./components/Section.tsx\");\n/* harmony import */ var _Stack__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./Stack */ \"./components/Stack.tsx\");\n/* harmony import */ var _UserList__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./UserList */ \"./components/UserList.tsx\");\n/* harmony import */ var _PenModeButton__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./PenModeButton */ \"./components/PenModeButton.tsx\");\n/* harmony import */ var _footer_Footer__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./footer/Footer */ \"./components/footer/Footer.tsx\");\n/* harmony import */ var _Sidebar_Sidebar__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./Sidebar/Sidebar */ \"./components/Sidebar/Sidebar.tsx\");\n/* harmony import */ var _main_menu_MainMenu__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./main-menu/MainMenu */ \"./components/main-menu/MainMenu.tsx\");\n/* harmony import */ var _ActiveConfirmDialog__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./ActiveConfirmDialog */ \"./components/ActiveConfirmDialog.tsx\");\n/* harmony import */ var _App__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./App */ \"./components/App.tsx\");\n/* harmony import */ var _OverwriteConfirm_OverwriteConfirm__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./OverwriteConfirm/OverwriteConfirm */ \"./components/OverwriteConfirm/OverwriteConfirm.tsx\");\n/* harmony import */ var _icons__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./icons */ \"./components/icons.tsx\");\n/* harmony import */ var _DefaultSidebar__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./DefaultSidebar */ \"./components/DefaultSidebar.tsx\");\n/* harmony import */ var _TTDDialog_TTDDialog__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./TTDDialog/TTDDialog */ \"./components/TTDDialog/TTDDialog.tsx\");\n/* harmony import */ var _Stats__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./Stats */ \"./components/Stats/index.tsx\");\n/* harmony import */ var _ElementLinkDialog__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./ElementLinkDialog */ \"./components/ElementLinkDialog.tsx\");\n/* harmony import */ var _ErrorDialog__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./ErrorDialog */ \"./components/ErrorDialog.tsx\");\n/* harmony import */ var _EyeDropper__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./EyeDropper */ \"./components/EyeDropper.tsx\");\n/* harmony import */ var _FixedSideContainer__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./FixedSideContainer */ \"./components/FixedSideContainer.tsx\");\n/* harmony import */ var _HandButton__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./HandButton */ \"./components/HandButton.tsx\");\n/* harmony import */ var _HelpDialog__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./HelpDialog */ \"./components/HelpDialog.tsx\");\n/* harmony import */ var _HintViewer__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./HintViewer */ \"./components/HintViewer.tsx\");\n/* harmony import */ var _ImageExportDialog__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./ImageExportDialog */ \"./components/ImageExportDialog.tsx\");\n/* harmony import */ var _Island__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./Island */ \"./components/Island.tsx\");\n/* harmony import */ var _JSONExportDialog__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./JSONExportDialog */ \"./components/JSONExportDialog.tsx\");\n/* harmony import */ var _LaserPointerButton__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./LaserPointerButton */ \"./components/LaserPointerButton.tsx\");\n/* harmony import */ var _LayerUI_scss__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./LayerUI.scss */ \"./components/LayerUI.scss\");\n/* harmony import */ var _Toolbar_scss__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./Toolbar.scss */ \"./components/Toolbar.scss\");\n/* harmony import */ var _TrayMenu__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./TrayMenu */ \"./components/TrayMenu.tsx\");\nvar __rest = undefined && undefined.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst DefaultMainMenu = ({\n UIOptions\n}) => {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_main_menu_MainMenu__WEBPACK_IMPORTED_MODULE_23__[\"default\"], {\n __fallback: true\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_main_menu_MainMenu__WEBPACK_IMPORTED_MODULE_23__[\"default\"].DefaultItems.LoadScene, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_main_menu_MainMenu__WEBPACK_IMPORTED_MODULE_23__[\"default\"].DefaultItems.SaveToActiveFile, null), UIOptions.canvasActions.export && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_main_menu_MainMenu__WEBPACK_IMPORTED_MODULE_23__[\"default\"].DefaultItems.Export, null), UIOptions.canvasActions.saveAsImage && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_main_menu_MainMenu__WEBPACK_IMPORTED_MODULE_23__[\"default\"].DefaultItems.SaveAsImage, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_main_menu_MainMenu__WEBPACK_IMPORTED_MODULE_23__[\"default\"].DefaultItems.SearchMenu, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_main_menu_MainMenu__WEBPACK_IMPORTED_MODULE_23__[\"default\"].DefaultItems.Help, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_main_menu_MainMenu__WEBPACK_IMPORTED_MODULE_23__[\"default\"].DefaultItems.ClearCanvas, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_main_menu_MainMenu__WEBPACK_IMPORTED_MODULE_23__[\"default\"].Separator, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_main_menu_MainMenu__WEBPACK_IMPORTED_MODULE_23__[\"default\"].Group, {\n title: \"Excalidraw links\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_main_menu_MainMenu__WEBPACK_IMPORTED_MODULE_23__[\"default\"].DefaultItems.Socials, null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_main_menu_MainMenu__WEBPACK_IMPORTED_MODULE_23__[\"default\"].Separator, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_main_menu_MainMenu__WEBPACK_IMPORTED_MODULE_23__[\"default\"].DefaultItems.ToggleTheme, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_main_menu_MainMenu__WEBPACK_IMPORTED_MODULE_23__[\"default\"].DefaultItems.ChangeCanvasBackground, null));\n};\n\nconst DefaultOverwriteConfirmDialog = () => {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_OverwriteConfirm_OverwriteConfirm__WEBPACK_IMPORTED_MODULE_26__.OverwriteConfirmDialog, {\n __fallback: true\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_OverwriteConfirm_OverwriteConfirm__WEBPACK_IMPORTED_MODULE_26__.OverwriteConfirmDialog.Actions.SaveToDisk, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_OverwriteConfirm_OverwriteConfirm__WEBPACK_IMPORTED_MODULE_26__.OverwriteConfirmDialog.Actions.ExportToImage, null));\n};\n\nconst LayerUI = ({\n actionManager,\n appState,\n files,\n setAppState,\n elements,\n canvas,\n onLockToggle,\n onHandToolToggle,\n onPenModeToggle,\n showExitZenModeBtn,\n renderTopLeftUI,\n renderTopRightUI,\n renderCustomStats,\n UIOptions,\n onExportImage,\n renderWelcomeScreen,\n children,\n app,\n isCollaborating,\n generateLinkForSelection\n}) => {\n var _a, _b, _c;\n\n const editorInterface = (0,_App__WEBPACK_IMPORTED_MODULE_25__.useEditorInterface)();\n const stylesPanelMode = (0,_App__WEBPACK_IMPORTED_MODULE_25__.useStylesPanelMode)();\n const isCompactStylesPanel = stylesPanelMode === \"compact\";\n const tunnels = (0,_context_tunnels__WEBPACK_IMPORTED_MODULE_7__.useInitializeTunnels)();\n const spacing = isCompactStylesPanel ? {\n menuTopGap: 4,\n toolbarColGap: 4,\n toolbarRowGap: 1,\n toolbarInnerRowGap: 0.5,\n islandPadding: 1,\n collabMarginLeft: 8\n } : {\n menuTopGap: 6,\n toolbarColGap: 4,\n toolbarRowGap: 1,\n toolbarInnerRowGap: 1,\n islandPadding: 1,\n collabMarginLeft: 8\n };\n const TunnelsJotaiProvider = tunnels.tunnelsJotai.Provider;\n const [eyeDropperState, setEyeDropperState] = (0,_editor_jotai__WEBPACK_IMPORTED_MODULE_9__.useAtom)(_EyeDropper__WEBPACK_IMPORTED_MODULE_33__.activeEyeDropperAtom);\n\n const renderJSONExportDialog = () => {\n if (!UIOptions.canvasActions.export) {\n return null;\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_JSONExportDialog__WEBPACK_IMPORTED_MODULE_40__.JSONExportDialog, {\n elements: elements,\n appState: appState,\n files: files,\n actionManager: actionManager,\n exportOpts: UIOptions.canvasActions.export,\n canvas: canvas,\n setAppState: setAppState\n });\n };\n\n const renderImageExportDialog = () => {\n var _a;\n\n if (!UIOptions.canvasActions.saveAsImage || ((_a = appState.openDialog) === null || _a === void 0 ? void 0 : _a.name) !== \"imageExport\") {\n return null;\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_ImageExportDialog__WEBPACK_IMPORTED_MODULE_38__.ImageExportDialog, {\n elements: elements,\n appState: appState,\n files: files,\n actionManager: actionManager,\n onExportImage: onExportImage,\n onCloseRequest: () => setAppState({\n openDialog: null\n }),\n name: app.getName()\n });\n };\n\n const renderCanvasActions = () => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n style: {\n position: \"relative\"\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(tunnels.MainMenuTunnel.Out, null), renderWelcomeScreen && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(tunnels.WelcomeScreenMenuHintTunnel.Out, null));\n\n const renderSelectedShapeActions = () => {\n const isCompactMode = isCompactStylesPanel;\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Section__WEBPACK_IMPORTED_MODULE_17__.Section, {\n heading: \"selectedShapeActions\",\n className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"selected-shape-actions zen-mode-transition\", {\n \"transition-left\": appState.zenModeEnabled\n })\n }, isCompactMode ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Island__WEBPACK_IMPORTED_MODULE_39__.Island, {\n className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"compact-shape-actions-island\"),\n padding: 0,\n style: {\n // we want to make sure this doesn't overflow so subtracting the\n // approximate height of hamburgerMenu + footer\n maxHeight: `${appState.height - 166}px`\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Actions__WEBPACK_IMPORTED_MODULE_12__.CompactShapeActions, {\n appState: appState,\n elementsMap: app.scene.getNonDeletedElementsMap(),\n renderAction: actionManager.renderAction,\n app: app,\n setAppState: setAppState\n })) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Island__WEBPACK_IMPORTED_MODULE_39__.Island, {\n className: _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.CLASSES.SHAPE_ACTIONS_MENU,\n padding: 2,\n style: {\n // we want to make sure this doesn't overflow so subtracting the\n // approximate height of hamburgerMenu + footer\n maxHeight: `${appState.height - 166}px`\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Actions__WEBPACK_IMPORTED_MODULE_12__.SelectedShapeActions, {\n appState: appState,\n elementsMap: app.scene.getNonDeletedElementsMap(),\n renderAction: actionManager.renderAction,\n app: app\n })));\n };\n\n const renderFixedSideContainer = () => {\n var _a, _b, _c, _d, _e, _f;\n\n const shouldRenderSelectedShapeActions = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.showSelectedShapeActions)(appState, elements);\n\n if (appState.viewModeEnabled) {\n return null;\n } //zsviczian\n\n\n const shouldShowStats = appState.stats.open && !appState.zenModeEnabled && !appState.viewModeEnabled && ((_a = appState.openDialog) === null || _a === void 0 ? void 0 : _a.name) !== \"elementLinkSelector\";\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_FixedSideContainer__WEBPACK_IMPORTED_MODULE_34__.FixedSideContainer, {\n side: \"top\",\n sidepanelOpen: !!appState.openSidebar\n /*zsviczian*/\n\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"App-menu App-menu_top\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Stack__WEBPACK_IMPORTED_MODULE_18__[\"default\"].Col, {\n gap: spacing.menuTopGap,\n className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"App-menu_top__left\")\n }, renderCanvasActions(), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"selected-shape-actions-container\", {\n \"selected-shape-actions-container--compact\": isCompactStylesPanel\n })\n }, shouldRenderSelectedShapeActions && renderSelectedShapeActions())), !appState.viewModeEnabled && ((_b = appState.openDialog) === null || _b === void 0 ? void 0 : _b.name) !== \"elementLinkSelector\" && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Section__WEBPACK_IMPORTED_MODULE_17__.Section, {\n heading: \"shapes\",\n className: \"shapes-section\"\n }, heading => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n style: {\n position: \"relative\"\n }\n }, renderWelcomeScreen && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(tunnels.WelcomeScreenToolbarHintTunnel.Out, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Stack__WEBPACK_IMPORTED_MODULE_18__[\"default\"].Col, {\n gap: spacing.toolbarColGap,\n align: \"start\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Stack__WEBPACK_IMPORTED_MODULE_18__[\"default\"].Row, {\n gap: spacing.toolbarRowGap,\n className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"App-toolbar-container\", {\n \"zen-mode\": appState.zenModeEnabled\n })\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Island__WEBPACK_IMPORTED_MODULE_39__.Island, {\n padding: spacing.islandPadding,\n className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"App-toolbar\", {\n \"zen-mode\": appState.zenModeEnabled,\n \"App-toolbar--compact\": isCompactStylesPanel\n })\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_HintViewer__WEBPACK_IMPORTED_MODULE_37__.HintViewer, {\n appState: appState,\n isMobile: editorInterface.formFactor === \"phone\",\n editorInterface: editorInterface,\n app: app\n }), heading, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Stack__WEBPACK_IMPORTED_MODULE_18__[\"default\"].Row, {\n gap: spacing.toolbarInnerRowGap\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_PenModeButton__WEBPACK_IMPORTED_MODULE_20__.PenModeButton, {\n zenModeEnabled: appState.zenModeEnabled,\n checked: appState.penMode,\n onChange: () => onPenModeToggle(null),\n title: (0,_i18n__WEBPACK_IMPORTED_MODULE_10__.t)(\"toolBar.penMode\"),\n penDetected: appState.penDetected\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_LockButton__WEBPACK_IMPORTED_MODULE_14__.LockButton, {\n checked: appState.activeTool.locked,\n onChange: onLockToggle,\n title: (0,_i18n__WEBPACK_IMPORTED_MODULE_10__.t)(\"toolBar.lock\")\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"App-toolbar__divider\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_HandButton__WEBPACK_IMPORTED_MODULE_35__.HandButton, {\n checked: (0,_appState__WEBPACK_IMPORTED_MODULE_6__.isHandToolActive)(appState),\n onChange: () => onHandToolToggle(),\n title: (0,_i18n__WEBPACK_IMPORTED_MODULE_10__.t)(\"toolBar.hand\"),\n isMobile: true\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Actions__WEBPACK_IMPORTED_MODULE_12__.ShapesSwitcher, {\n setAppState: setAppState,\n activeTool: appState.activeTool,\n UIOptions: UIOptions,\n app: app\n }))), isCollaborating && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Island__WEBPACK_IMPORTED_MODULE_39__.Island, {\n style: {\n marginLeft: spacing.collabMarginLeft,\n alignSelf: \"center\",\n height: \"fit-content\"\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_LaserPointerButton__WEBPACK_IMPORTED_MODULE_41__.LaserPointerButton, {\n title: (0,_i18n__WEBPACK_IMPORTED_MODULE_10__.t)(\"toolBar.laser\"),\n checked: appState.activeTool.type === _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.TOOL_TYPE.laser,\n onChange: () => app.setActiveTool({\n type: _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.TOOL_TYPE.laser\n }),\n isMobile: true\n })))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"mobile-misc-tools-container zen-mode-transition\", //zsviczian\n {\n \"transition-right\": appState.zenModeEnabled,\n \"layer-ui__wrapper__top-right--compact\": isCompactStylesPanel\n }),\n style: //zsviczian\n ((_c = document.body) === null || _c === void 0 ? void 0 : _c.classList.contains(\"mod-rtl\")) ? {\n right: \"inherit\",\n left: \"calc(var(--editor-container-padding) * -1)\"\n } : undefined\n }, appState.collaborators.size > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_UserList__WEBPACK_IMPORTED_MODULE_19__.UserList, {\n collaborators: appState.collaborators,\n userToFollow: ((_d = appState.userToFollow) === null || _d === void 0 ? void 0 : _d.socketId) || null\n }), !appState.viewModeEnabled && ( //zsviczian\n renderTopRightUI === null || renderTopRightUI === void 0 ? void 0 : renderTopRightUI(editorInterface.formFactor === \"phone\", appState)), !appState.viewModeEnabled && ((_e = appState.openDialog) === null || _e === void 0 ? void 0 : _e.name) !== \"elementLinkSelector\" && ( // hide button when sidebar docked\n !isSidebarDocked || ((_f = appState.openSidebar) === null || _f === void 0 ? void 0 : _f.name) !== _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_SIDEBAR.name) && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(tunnels.DefaultSidebarTriggerTunnel.Out, null), shouldShowStats && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Stats__WEBPACK_IMPORTED_MODULE_30__.Stats, {\n app: app,\n onClose: () => {\n actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_4__.actionToggleStats);\n },\n renderCustomStats: renderCustomStats\n }))));\n };\n\n const isTrayMode = !(appState.viewModeEnabled || appState.zenModeEnabled) && editorInterface.formFactor !== \"phone\" && editorInterface.preferTrayMode; //zsviczian\n\n const isTrayModeOrMobile = isTrayMode || editorInterface.formFactor === \"phone\"; //zsviczian\n\n const renderSidebars = () => {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_DefaultSidebar__WEBPACK_IMPORTED_MODULE_28__.DefaultSidebar, {\n __fallback: true,\n onDock: docked => {\n (0,_analytics__WEBPACK_IMPORTED_MODULE_5__.trackEvent)(\"sidebar\", `toggleDock (${docked ? \"dock\" : \"undock\"})`, `(${editorInterface.formFactor === \"phone\" ? \"mobile\" : \"desktop\"})`);\n }\n });\n };\n\n const isSidebarDocked = (0,_editor_jotai__WEBPACK_IMPORTED_MODULE_9__.useAtomValue)(_Sidebar_Sidebar__WEBPACK_IMPORTED_MODULE_22__.isSidebarDockedAtom);\n const layerUIJSX = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, children, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(DefaultMainMenu, {\n UIOptions: UIOptions\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_DefaultSidebar__WEBPACK_IMPORTED_MODULE_28__.DefaultSidebar.Trigger, {\n __fallback: true,\n icon: _icons__WEBPACK_IMPORTED_MODULE_27__.LibraryIcon,\n title: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.capitalizeString)((0,_i18n__WEBPACK_IMPORTED_MODULE_10__.t)(\"toolBar.library\")),\n onToggle: open => {\n if (open) {\n (0,_analytics__WEBPACK_IMPORTED_MODULE_5__.trackEvent)(\"sidebar\", `${_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_SIDEBAR.name} (open)`, `button (${editorInterface.formFactor === \"phone\" ? \"mobile\" : \"desktop\"})`);\n }\n },\n tab: _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_SIDEBAR.defaultTab\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(DefaultOverwriteConfirmDialog, null), ((_a = appState.openDialog) === null || _a === void 0 ? void 0 : _a.name) === \"ttd\" && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_TTDDialog_TTDDialog__WEBPACK_IMPORTED_MODULE_29__.TTDDialog, {\n __fallback: true\n }), appState.isLoading && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_LoadingMessage__WEBPACK_IMPORTED_MODULE_13__.LoadingMessage, {\n delay: 250\n }), appState.errorMessage && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_ErrorDialog__WEBPACK_IMPORTED_MODULE_32__.ErrorDialog, {\n onClose: () => setAppState({\n errorMessage: null\n })\n }, appState.errorMessage), eyeDropperState && editorInterface.formFactor !== \"phone\" && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_EyeDropper__WEBPACK_IMPORTED_MODULE_33__.EyeDropper, {\n colorPickerType: eyeDropperState.colorPickerType,\n onCancel: () => {\n setEyeDropperState(null);\n },\n onChange: (colorPickerType, color, selectedElements, {\n altKey\n }) => {\n if (colorPickerType !== \"elementBackground\" && colorPickerType !== \"elementStroke\") {\n return;\n }\n\n if (selectedElements.length) {\n for (const element of selectedElements) {\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.mutateElement)(element, (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.arrayToMap)(elements), {\n [altKey && eyeDropperState.swapPreviewOnAlt ? colorPickerType === \"elementBackground\" ? \"strokeColor\" : \"backgroundColor\" : colorPickerType === \"elementBackground\" ? \"backgroundColor\" : \"strokeColor\"]: color\n });\n _excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.ShapeCache.delete(element);\n }\n\n app.scene.triggerUpdate();\n } else if (colorPickerType === \"elementBackground\") {\n setAppState({\n currentItemBackgroundColor: color\n });\n } else {\n setAppState({\n currentItemStrokeColor: color\n });\n }\n },\n onSelect: (color, event) => {\n var _a;\n\n setEyeDropperState(state => {\n return (state === null || state === void 0 ? void 0 : state.keepOpenOnAlt) && event.altKey ? state : null;\n });\n (_a = eyeDropperState === null || eyeDropperState === void 0 ? void 0 : eyeDropperState.onSelect) === null || _a === void 0 ? void 0 : _a.call(eyeDropperState, color, event);\n }\n }), ((_b = appState.openDialog) === null || _b === void 0 ? void 0 : _b.name) === \"help\" && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_HelpDialog__WEBPACK_IMPORTED_MODULE_36__.HelpDialog, {\n onClose: () => {\n setAppState({\n openDialog: null\n });\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_ActiveConfirmDialog__WEBPACK_IMPORTED_MODULE_24__.ActiveConfirmDialog, null), ((_c = appState.openDialog) === null || _c === void 0 ? void 0 : _c.name) === \"elementLinkSelector\" && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_ElementLinkDialog__WEBPACK_IMPORTED_MODULE_31__[\"default\"], {\n sourceElementId: appState.openDialog.sourceElementId,\n onClose: () => {\n setAppState({\n openDialog: null\n });\n },\n scene: app.scene,\n appState: appState,\n generateLinkForSelection: generateLinkForSelection\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(tunnels.OverwriteConfirmDialogTunnel.Out, null), renderImageExportDialog(), renderJSONExportDialog(), appState.pasteDialog.shown && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_PasteChartDialog__WEBPACK_IMPORTED_MODULE_16__.PasteChartDialog, {\n setAppState: setAppState,\n appState: appState,\n onClose: () => setAppState({\n pasteDialog: {\n shown: false,\n data: null\n }\n })\n }), editorInterface.formFactor !== \"phone\" && isTrayMode &&\n /*#__PURE__*/\n //zsviczian Added isTrayMode condition\n react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_TrayMenu__WEBPACK_IMPORTED_MODULE_44__.TrayMenu, {\n app: app,\n appState: appState,\n elements: elements,\n actionManager: actionManager,\n renderJSONExportDialog: renderJSONExportDialog,\n renderImageExportDialog: renderImageExportDialog,\n setAppState: setAppState,\n onLockToggle: onLockToggle,\n onHandToolToggle: onHandToolToggle,\n onPenModeToggle: onPenModeToggle,\n renderTopRightUI: renderTopRightUI,\n renderCustomStats: renderCustomStats,\n renderSidebars: renderSidebars,\n editorInterface: editorInterface,\n renderWelcomeScreen: renderWelcomeScreen,\n UIOptions: UIOptions\n }), editorInterface.formFactor === \"phone\" && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_MobileMenu__WEBPACK_IMPORTED_MODULE_15__.MobileMenu, {\n app: app,\n appState: appState,\n elements: elements,\n actionManager: actionManager,\n renderJSONExportDialog: renderJSONExportDialog,\n renderImageExportDialog: renderImageExportDialog,\n setAppState: setAppState,\n onHandToolToggle: onHandToolToggle,\n onPenModeToggle: onPenModeToggle,\n renderTopLeftUI: renderTopLeftUI,\n renderTopRightUI: renderTopRightUI,\n renderSidebars: renderSidebars,\n renderWelcomeScreen: renderWelcomeScreen,\n UIOptions: UIOptions\n }), !isTrayModeOrMobile &&\n /*#__PURE__*/\n //zsviczian changed from !device.editor.isMobile\n react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"layer-ui__wrapper\"\n }, renderWelcomeScreen && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(tunnels.WelcomeScreenCenterTunnel.Out, null), renderFixedSideContainer(), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_footer_Footer__WEBPACK_IMPORTED_MODULE_21__[\"default\"], {\n appState: appState,\n actionManager: actionManager,\n showExitZenModeBtn: showExitZenModeBtn,\n renderWelcomeScreen: renderWelcomeScreen\n }), appState.scrolledOutside && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"button\", {\n type: \"button\",\n className: \"scroll-back-to-content\",\n onClick: () => {\n setAppState(appState => Object.assign({}, (0,_scene__WEBPACK_IMPORTED_MODULE_11__.calculateScrollCenter)(elements, appState)));\n }\n }, (0,_i18n__WEBPACK_IMPORTED_MODULE_10__.t)(\"buttons.scrollBackToContent\"))), renderSidebars()));\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_context_ui_appState__WEBPACK_IMPORTED_MODULE_8__.UIAppStateContext.Provider, {\n value: appState\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(TunnelsJotaiProvider, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_context_tunnels__WEBPACK_IMPORTED_MODULE_7__.TunnelsContext.Provider, {\n value: tunnels\n }, layerUIJSX)));\n};\n\nconst stripIrrelevantAppStateProps = appState => {\n const {\n suggestedBindings,\n startBoundElement,\n cursorButton,\n scrollX,\n scrollY\n } = appState,\n ret = __rest(appState, [\"suggestedBindings\", \"startBoundElement\", \"cursorButton\", \"scrollX\", \"scrollY\"]);\n\n return ret;\n};\n\nconst areEqual = (prevProps, nextProps) => {\n // short-circuit early\n if (prevProps.children !== nextProps.children) {\n return false;\n }\n\n const {\n canvas: _pC,\n appState: prevAppState\n } = prevProps,\n prev = __rest(prevProps, [\"canvas\", \"appState\"]);\n\n const {\n canvas: _nC,\n appState: nextAppState\n } = nextProps,\n next = __rest(nextProps, [\"canvas\", \"appState\"]);\n\n return (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.isShallowEqual)( // asserting AppState because we're being passed the whole AppState\n // but resolve to only the UI-relevant props\n stripIrrelevantAppStateProps(prevAppState), stripIrrelevantAppStateProps(nextAppState), {\n selectedElementIds: _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.isShallowEqual,\n selectedGroupIds: _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.isShallowEqual\n }) && (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.isShallowEqual)(prev, next);\n};\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().memo(LayerUI, areEqual));\n\n//# sourceURL=webpack://ExcalidrawLib/./components/LayerUI.tsx?");
|
|
15228
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ \"../../node_modules/clsx/dist/clsx.m.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\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 _actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../actions */ \"./actions/index.ts\");\n/* harmony import */ var _analytics__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../analytics */ \"./analytics.ts\");\n/* harmony import */ var _appState__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../appState */ \"./appState.ts\");\n/* harmony import */ var _context_tunnels__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../context/tunnels */ \"./context/tunnels.ts\");\n/* harmony import */ var _context_ui_appState__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../context/ui-appState */ \"./context/ui-appState.ts\");\n/* harmony import */ var _editor_jotai__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../editor-jotai */ \"./editor-jotai.ts\");\n/* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../i18n */ \"./i18n.ts\");\n/* harmony import */ var _scene__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../scene */ \"./scene/index.ts\");\n/* harmony import */ var _Actions__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./Actions */ \"./components/Actions.tsx\");\n/* harmony import */ var _LoadingMessage__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./LoadingMessage */ \"./components/LoadingMessage.tsx\");\n/* harmony import */ var _LockButton__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./LockButton */ \"./components/LockButton.tsx\");\n/* harmony import */ var _MobileMenu__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./MobileMenu */ \"./components/MobileMenu.tsx\");\n/* harmony import */ var _PasteChartDialog__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./PasteChartDialog */ \"./components/PasteChartDialog.tsx\");\n/* harmony import */ var _Section__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./Section */ \"./components/Section.tsx\");\n/* harmony import */ var _Stack__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./Stack */ \"./components/Stack.tsx\");\n/* harmony import */ var _UserList__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./UserList */ \"./components/UserList.tsx\");\n/* harmony import */ var _PenModeButton__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./PenModeButton */ \"./components/PenModeButton.tsx\");\n/* harmony import */ var _footer_Footer__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./footer/Footer */ \"./components/footer/Footer.tsx\");\n/* harmony import */ var _Sidebar_Sidebar__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./Sidebar/Sidebar */ \"./components/Sidebar/Sidebar.tsx\");\n/* harmony import */ var _main_menu_MainMenu__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./main-menu/MainMenu */ \"./components/main-menu/MainMenu.tsx\");\n/* harmony import */ var _ActiveConfirmDialog__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./ActiveConfirmDialog */ \"./components/ActiveConfirmDialog.tsx\");\n/* harmony import */ var _App__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./App */ \"./components/App.tsx\");\n/* harmony import */ var _OverwriteConfirm_OverwriteConfirm__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./OverwriteConfirm/OverwriteConfirm */ \"./components/OverwriteConfirm/OverwriteConfirm.tsx\");\n/* harmony import */ var _icons__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./icons */ \"./components/icons.tsx\");\n/* harmony import */ var _DefaultSidebar__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./DefaultSidebar */ \"./components/DefaultSidebar.tsx\");\n/* harmony import */ var _TTDDialog_TTDDialog__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./TTDDialog/TTDDialog */ \"./components/TTDDialog/TTDDialog.tsx\");\n/* harmony import */ var _Stats__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./Stats */ \"./components/Stats/index.tsx\");\n/* harmony import */ var _ElementLinkDialog__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./ElementLinkDialog */ \"./components/ElementLinkDialog.tsx\");\n/* harmony import */ var _ErrorDialog__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./ErrorDialog */ \"./components/ErrorDialog.tsx\");\n/* harmony import */ var _EyeDropper__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./EyeDropper */ \"./components/EyeDropper.tsx\");\n/* harmony import */ var _FixedSideContainer__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./FixedSideContainer */ \"./components/FixedSideContainer.tsx\");\n/* harmony import */ var _HandButton__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./HandButton */ \"./components/HandButton.tsx\");\n/* harmony import */ var _HelpDialog__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./HelpDialog */ \"./components/HelpDialog.tsx\");\n/* harmony import */ var _HintViewer__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./HintViewer */ \"./components/HintViewer.tsx\");\n/* harmony import */ var _ImageExportDialog__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./ImageExportDialog */ \"./components/ImageExportDialog.tsx\");\n/* harmony import */ var _Island__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./Island */ \"./components/Island.tsx\");\n/* harmony import */ var _JSONExportDialog__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./JSONExportDialog */ \"./components/JSONExportDialog.tsx\");\n/* harmony import */ var _LaserPointerButton__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./LaserPointerButton */ \"./components/LaserPointerButton.tsx\");\n/* harmony import */ var _LayerUI_scss__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./LayerUI.scss */ \"./components/LayerUI.scss\");\n/* harmony import */ var _Toolbar_scss__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./Toolbar.scss */ \"./components/Toolbar.scss\");\n/* harmony import */ var _TrayMenu__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./TrayMenu */ \"./components/TrayMenu.tsx\");\nvar __rest = undefined && undefined.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst DefaultMainMenu = ({\n UIOptions\n}) => {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_main_menu_MainMenu__WEBPACK_IMPORTED_MODULE_23__[\"default\"], {\n __fallback: true\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_main_menu_MainMenu__WEBPACK_IMPORTED_MODULE_23__[\"default\"].DefaultItems.LoadScene, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_main_menu_MainMenu__WEBPACK_IMPORTED_MODULE_23__[\"default\"].DefaultItems.SaveToActiveFile, null), UIOptions.canvasActions.export && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_main_menu_MainMenu__WEBPACK_IMPORTED_MODULE_23__[\"default\"].DefaultItems.Export, null), UIOptions.canvasActions.saveAsImage && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_main_menu_MainMenu__WEBPACK_IMPORTED_MODULE_23__[\"default\"].DefaultItems.SaveAsImage, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_main_menu_MainMenu__WEBPACK_IMPORTED_MODULE_23__[\"default\"].DefaultItems.SearchMenu, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_main_menu_MainMenu__WEBPACK_IMPORTED_MODULE_23__[\"default\"].DefaultItems.Help, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_main_menu_MainMenu__WEBPACK_IMPORTED_MODULE_23__[\"default\"].DefaultItems.ClearCanvas, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_main_menu_MainMenu__WEBPACK_IMPORTED_MODULE_23__[\"default\"].Separator, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_main_menu_MainMenu__WEBPACK_IMPORTED_MODULE_23__[\"default\"].Group, {\n title: \"Excalidraw links\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_main_menu_MainMenu__WEBPACK_IMPORTED_MODULE_23__[\"default\"].DefaultItems.Socials, null)), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_main_menu_MainMenu__WEBPACK_IMPORTED_MODULE_23__[\"default\"].Separator, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_main_menu_MainMenu__WEBPACK_IMPORTED_MODULE_23__[\"default\"].DefaultItems.ToggleTheme, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_main_menu_MainMenu__WEBPACK_IMPORTED_MODULE_23__[\"default\"].DefaultItems.ChangeCanvasBackground, null));\n};\n\nconst DefaultOverwriteConfirmDialog = () => {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_OverwriteConfirm_OverwriteConfirm__WEBPACK_IMPORTED_MODULE_26__.OverwriteConfirmDialog, {\n __fallback: true\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_OverwriteConfirm_OverwriteConfirm__WEBPACK_IMPORTED_MODULE_26__.OverwriteConfirmDialog.Actions.SaveToDisk, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_OverwriteConfirm_OverwriteConfirm__WEBPACK_IMPORTED_MODULE_26__.OverwriteConfirmDialog.Actions.ExportToImage, null));\n};\n\nconst LayerUI = ({\n actionManager,\n appState,\n files,\n setAppState,\n elements,\n canvas,\n onLockToggle,\n onHandToolToggle,\n onPenModeToggle,\n showExitZenModeBtn,\n renderTopLeftUI,\n renderTopRightUI,\n renderCustomStats,\n UIOptions,\n onExportImage,\n renderWelcomeScreen,\n children,\n app,\n isCollaborating,\n generateLinkForSelection\n}) => {\n var _a, _b, _c;\n\n const editorInterface = (0,_App__WEBPACK_IMPORTED_MODULE_25__.useEditorInterface)();\n const stylesPanelMode = (0,_App__WEBPACK_IMPORTED_MODULE_25__.useStylesPanelMode)();\n const isCompactStylesPanel = stylesPanelMode === \"compact\";\n const tunnels = (0,_context_tunnels__WEBPACK_IMPORTED_MODULE_7__.useInitializeTunnels)();\n const spacing = isCompactStylesPanel ? {\n menuTopGap: 4,\n toolbarColGap: 4,\n toolbarRowGap: 1,\n toolbarInnerRowGap: 0.5,\n islandPadding: 1,\n collabMarginLeft: 8\n } : {\n menuTopGap: 6,\n toolbarColGap: 4,\n toolbarRowGap: 1,\n toolbarInnerRowGap: 1,\n islandPadding: 1,\n collabMarginLeft: 8\n };\n const TunnelsJotaiProvider = tunnels.tunnelsJotai.Provider;\n const [eyeDropperState, setEyeDropperState] = (0,_editor_jotai__WEBPACK_IMPORTED_MODULE_9__.useAtom)(_EyeDropper__WEBPACK_IMPORTED_MODULE_33__.activeEyeDropperAtom);\n\n const renderJSONExportDialog = () => {\n if (!UIOptions.canvasActions.export) {\n return null;\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_JSONExportDialog__WEBPACK_IMPORTED_MODULE_40__.JSONExportDialog, {\n elements: elements,\n appState: appState,\n files: files,\n actionManager: actionManager,\n exportOpts: UIOptions.canvasActions.export,\n canvas: canvas,\n setAppState: setAppState\n });\n };\n\n const renderImageExportDialog = () => {\n var _a;\n\n if (!UIOptions.canvasActions.saveAsImage || ((_a = appState.openDialog) === null || _a === void 0 ? void 0 : _a.name) !== \"imageExport\") {\n return null;\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_ImageExportDialog__WEBPACK_IMPORTED_MODULE_38__.ImageExportDialog, {\n elements: elements,\n appState: appState,\n files: files,\n actionManager: actionManager,\n onExportImage: onExportImage,\n onCloseRequest: () => setAppState({\n openDialog: null\n }),\n name: app.getName()\n });\n };\n\n const renderCanvasActions = () => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n style: {\n position: \"relative\"\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(tunnels.MainMenuTunnel.Out, null), renderWelcomeScreen && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(tunnels.WelcomeScreenMenuHintTunnel.Out, null));\n\n const renderSelectedShapeActions = () => {\n const isCompactMode = isCompactStylesPanel;\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Section__WEBPACK_IMPORTED_MODULE_17__.Section, {\n heading: \"selectedShapeActions\",\n className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"selected-shape-actions zen-mode-transition\", {\n \"transition-left\": appState.zenModeEnabled\n })\n }, isCompactMode ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Island__WEBPACK_IMPORTED_MODULE_39__.Island, {\n className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"compact-shape-actions-island\"),\n padding: 0,\n style: {\n // we want to make sure this doesn't overflow so subtracting the\n // approximate height of hamburgerMenu + footer\n maxHeight: `${appState.height - 166}px`\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Actions__WEBPACK_IMPORTED_MODULE_12__.CompactShapeActions, {\n appState: appState,\n elementsMap: app.scene.getNonDeletedElementsMap(),\n renderAction: actionManager.renderAction,\n app: app,\n setAppState: setAppState\n })) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Island__WEBPACK_IMPORTED_MODULE_39__.Island, {\n className: _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.CLASSES.SHAPE_ACTIONS_MENU,\n padding: 2,\n style: {\n // we want to make sure this doesn't overflow so subtracting the\n // approximate height of hamburgerMenu + footer\n maxHeight: `${appState.height - 166}px`\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Actions__WEBPACK_IMPORTED_MODULE_12__.SelectedShapeActions, {\n appState: appState,\n elementsMap: app.scene.getNonDeletedElementsMap(),\n renderAction: actionManager.renderAction,\n app: app\n })));\n };\n\n const renderFixedSideContainer = () => {\n var _a, _b, _c, _d, _e, _f;\n\n const shouldRenderSelectedShapeActions = (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.showSelectedShapeActions)(appState, elements);\n\n if (appState.viewModeEnabled) {\n return null;\n } //zsviczian\n\n\n const shouldShowStats = appState.stats.open && !appState.zenModeEnabled && !appState.viewModeEnabled && ((_a = appState.openDialog) === null || _a === void 0 ? void 0 : _a.name) !== \"elementLinkSelector\";\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_FixedSideContainer__WEBPACK_IMPORTED_MODULE_34__.FixedSideContainer, {\n side: \"top\",\n sidepanelOpen: !!appState.openSidebar\n /*zsviczian*/\n\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"App-menu App-menu_top\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Stack__WEBPACK_IMPORTED_MODULE_18__[\"default\"].Col, {\n gap: spacing.menuTopGap,\n className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"App-menu_top__left\")\n }, renderCanvasActions(), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"selected-shape-actions-container\", {\n \"selected-shape-actions-container--compact\": isCompactStylesPanel\n })\n }, shouldRenderSelectedShapeActions && renderSelectedShapeActions())), !appState.viewModeEnabled && ((_b = appState.openDialog) === null || _b === void 0 ? void 0 : _b.name) !== \"elementLinkSelector\" && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Section__WEBPACK_IMPORTED_MODULE_17__.Section, {\n heading: \"shapes\",\n className: \"shapes-section\"\n }, heading => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n style: {\n position: \"relative\"\n }\n }, renderWelcomeScreen && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(tunnels.WelcomeScreenToolbarHintTunnel.Out, null), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Stack__WEBPACK_IMPORTED_MODULE_18__[\"default\"].Col, {\n gap: spacing.toolbarColGap,\n align: \"start\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Stack__WEBPACK_IMPORTED_MODULE_18__[\"default\"].Row, {\n gap: spacing.toolbarRowGap,\n className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"App-toolbar-container\", {\n \"zen-mode\": appState.zenModeEnabled\n })\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Island__WEBPACK_IMPORTED_MODULE_39__.Island, {\n padding: spacing.islandPadding,\n className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"App-toolbar\", {\n \"zen-mode\": appState.zenModeEnabled,\n \"App-toolbar--compact\": isCompactStylesPanel\n })\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_HintViewer__WEBPACK_IMPORTED_MODULE_37__.HintViewer, {\n appState: appState,\n isMobile: editorInterface.formFactor === \"phone\",\n editorInterface: editorInterface,\n app: app\n }), heading, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Stack__WEBPACK_IMPORTED_MODULE_18__[\"default\"].Row, {\n gap: spacing.toolbarInnerRowGap\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_PenModeButton__WEBPACK_IMPORTED_MODULE_20__.PenModeButton, {\n zenModeEnabled: appState.zenModeEnabled,\n checked: appState.penMode,\n onChange: () => onPenModeToggle(null),\n title: (0,_i18n__WEBPACK_IMPORTED_MODULE_10__.t)(\"toolBar.penMode\"),\n penDetected: appState.penDetected\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_LockButton__WEBPACK_IMPORTED_MODULE_14__.LockButton, {\n checked: appState.activeTool.locked,\n onChange: onLockToggle,\n title: (0,_i18n__WEBPACK_IMPORTED_MODULE_10__.t)(\"toolBar.lock\")\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"App-toolbar__divider\"\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_HandButton__WEBPACK_IMPORTED_MODULE_35__.HandButton, {\n checked: (0,_appState__WEBPACK_IMPORTED_MODULE_6__.isHandToolActive)(appState),\n onChange: () => onHandToolToggle(),\n title: (0,_i18n__WEBPACK_IMPORTED_MODULE_10__.t)(\"toolBar.hand\"),\n isMobile: true\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Actions__WEBPACK_IMPORTED_MODULE_12__.ShapesSwitcher, {\n setAppState: setAppState,\n activeTool: appState.activeTool,\n UIOptions: UIOptions,\n app: app\n }))), isCollaborating && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Island__WEBPACK_IMPORTED_MODULE_39__.Island, {\n style: {\n marginLeft: spacing.collabMarginLeft,\n alignSelf: \"center\",\n height: \"fit-content\"\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_LaserPointerButton__WEBPACK_IMPORTED_MODULE_41__.LaserPointerButton, {\n title: (0,_i18n__WEBPACK_IMPORTED_MODULE_10__.t)(\"toolBar.laser\"),\n checked: appState.activeTool.type === _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.TOOL_TYPE.laser,\n onChange: () => app.setActiveTool({\n type: _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.TOOL_TYPE.laser\n }),\n isMobile: true\n })))))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(\"mobile-misc-tools-container zen-mode-transition\", //zsviczian\n {\n \"transition-right\": appState.zenModeEnabled,\n \"layer-ui__wrapper__top-right--compact\": isCompactStylesPanel\n }),\n style: //zsviczian\n ((_c = document.body) === null || _c === void 0 ? void 0 : _c.classList.contains(\"mod-rtl\")) ? {\n right: \"inherit\",\n left: \"calc(var(--editor-container-padding) * -1)\"\n } : undefined\n }, appState.collaborators.size > 0 && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_UserList__WEBPACK_IMPORTED_MODULE_19__.UserList, {\n collaborators: appState.collaborators,\n userToFollow: ((_d = appState.userToFollow) === null || _d === void 0 ? void 0 : _d.socketId) || null\n }), !appState.viewModeEnabled && ( //zsviczian\n renderTopRightUI === null || renderTopRightUI === void 0 ? void 0 : renderTopRightUI(editorInterface.formFactor === \"phone\", appState)), !appState.viewModeEnabled && ((_e = appState.openDialog) === null || _e === void 0 ? void 0 : _e.name) !== \"elementLinkSelector\" && ( // hide button when sidebar docked\n !isSidebarDocked || ((_f = appState.openSidebar) === null || _f === void 0 ? void 0 : _f.name) !== _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_SIDEBAR.name) && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(tunnels.DefaultSidebarTriggerTunnel.Out, null), shouldShowStats && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Stats__WEBPACK_IMPORTED_MODULE_30__.Stats, {\n app: app,\n onClose: () => {\n actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_4__.actionToggleStats);\n },\n renderCustomStats: renderCustomStats\n }))));\n };\n\n const isTrayMode = !(appState.viewModeEnabled || appState.zenModeEnabled) && editorInterface.formFactor !== \"phone\" && editorInterface.preferTrayMode; //zsviczian\n\n const isTrayModeOrMobile = isTrayMode || editorInterface.formFactor === \"phone\"; //zsviczian\n\n const renderSidebars = () => {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_DefaultSidebar__WEBPACK_IMPORTED_MODULE_28__.DefaultSidebar, {\n __fallback: true,\n onDock: docked => {\n (0,_analytics__WEBPACK_IMPORTED_MODULE_5__.trackEvent)(\"sidebar\", `toggleDock (${docked ? \"dock\" : \"undock\"})`, `(${editorInterface.formFactor === \"phone\" ? \"mobile\" : \"desktop\"})`);\n }\n });\n };\n\n const isSidebarDocked = (0,_editor_jotai__WEBPACK_IMPORTED_MODULE_9__.useAtomValue)(_Sidebar_Sidebar__WEBPACK_IMPORTED_MODULE_22__.isSidebarDockedAtom);\n const layerUIJSX = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, children, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(DefaultMainMenu, {\n UIOptions: UIOptions\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_DefaultSidebar__WEBPACK_IMPORTED_MODULE_28__.DefaultSidebar.Trigger, {\n __fallback: true,\n icon: _icons__WEBPACK_IMPORTED_MODULE_27__.sidebarRightIcon,\n title: (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.capitalizeString)((0,_i18n__WEBPACK_IMPORTED_MODULE_10__.t)(\"toolBar.library\")),\n onToggle: open => {\n if (open) {\n (0,_analytics__WEBPACK_IMPORTED_MODULE_5__.trackEvent)(\"sidebar\", `${_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_SIDEBAR.name} (open)`, `button (${editorInterface.formFactor === \"phone\" ? \"mobile\" : \"desktop\"})`);\n }\n },\n tab: _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_SIDEBAR.defaultTab\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(DefaultOverwriteConfirmDialog, null), ((_a = appState.openDialog) === null || _a === void 0 ? void 0 : _a.name) === \"ttd\" && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_TTDDialog_TTDDialog__WEBPACK_IMPORTED_MODULE_29__.TTDDialog, {\n __fallback: true\n }), appState.isLoading && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_LoadingMessage__WEBPACK_IMPORTED_MODULE_13__.LoadingMessage, {\n delay: 250\n }), appState.errorMessage && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_ErrorDialog__WEBPACK_IMPORTED_MODULE_32__.ErrorDialog, {\n onClose: () => setAppState({\n errorMessage: null\n })\n }, appState.errorMessage), eyeDropperState && editorInterface.formFactor !== \"phone\" && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_EyeDropper__WEBPACK_IMPORTED_MODULE_33__.EyeDropper, {\n colorPickerType: eyeDropperState.colorPickerType,\n onCancel: () => {\n setEyeDropperState(null);\n },\n onChange: (colorPickerType, color, selectedElements, {\n altKey\n }) => {\n if (colorPickerType !== \"elementBackground\" && colorPickerType !== \"elementStroke\") {\n return;\n }\n\n if (selectedElements.length) {\n for (const element of selectedElements) {\n (0,_excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.mutateElement)(element, (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.arrayToMap)(elements), {\n [altKey && eyeDropperState.swapPreviewOnAlt ? colorPickerType === \"elementBackground\" ? \"strokeColor\" : \"backgroundColor\" : colorPickerType === \"elementBackground\" ? \"backgroundColor\" : \"strokeColor\"]: color\n });\n _excalidraw_element__WEBPACK_IMPORTED_MODULE_3__.ShapeCache.delete(element);\n }\n\n app.scene.triggerUpdate();\n } else if (colorPickerType === \"elementBackground\") {\n setAppState({\n currentItemBackgroundColor: color\n });\n } else {\n setAppState({\n currentItemStrokeColor: color\n });\n }\n },\n onSelect: (color, event) => {\n var _a;\n\n setEyeDropperState(state => {\n return (state === null || state === void 0 ? void 0 : state.keepOpenOnAlt) && event.altKey ? state : null;\n });\n (_a = eyeDropperState === null || eyeDropperState === void 0 ? void 0 : eyeDropperState.onSelect) === null || _a === void 0 ? void 0 : _a.call(eyeDropperState, color, event);\n }\n }), ((_b = appState.openDialog) === null || _b === void 0 ? void 0 : _b.name) === \"help\" && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_HelpDialog__WEBPACK_IMPORTED_MODULE_36__.HelpDialog, {\n onClose: () => {\n setAppState({\n openDialog: null\n });\n }\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_ActiveConfirmDialog__WEBPACK_IMPORTED_MODULE_24__.ActiveConfirmDialog, null), ((_c = appState.openDialog) === null || _c === void 0 ? void 0 : _c.name) === \"elementLinkSelector\" && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_ElementLinkDialog__WEBPACK_IMPORTED_MODULE_31__[\"default\"], {\n sourceElementId: appState.openDialog.sourceElementId,\n onClose: () => {\n setAppState({\n openDialog: null\n });\n },\n scene: app.scene,\n appState: appState,\n generateLinkForSelection: generateLinkForSelection\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(tunnels.OverwriteConfirmDialogTunnel.Out, null), renderImageExportDialog(), renderJSONExportDialog(), appState.pasteDialog.shown && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_PasteChartDialog__WEBPACK_IMPORTED_MODULE_16__.PasteChartDialog, {\n setAppState: setAppState,\n appState: appState,\n onClose: () => setAppState({\n pasteDialog: {\n shown: false,\n data: null\n }\n })\n }), editorInterface.formFactor !== \"phone\" && isTrayMode &&\n /*#__PURE__*/\n //zsviczian Added isTrayMode condition\n react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_TrayMenu__WEBPACK_IMPORTED_MODULE_44__.TrayMenu, {\n app: app,\n appState: appState,\n elements: elements,\n actionManager: actionManager,\n renderJSONExportDialog: renderJSONExportDialog,\n renderImageExportDialog: renderImageExportDialog,\n setAppState: setAppState,\n onLockToggle: onLockToggle,\n onHandToolToggle: onHandToolToggle,\n onPenModeToggle: onPenModeToggle,\n renderTopRightUI: renderTopRightUI,\n renderCustomStats: renderCustomStats,\n renderSidebars: renderSidebars,\n editorInterface: editorInterface,\n renderWelcomeScreen: renderWelcomeScreen,\n UIOptions: UIOptions\n }), editorInterface.formFactor === \"phone\" && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_MobileMenu__WEBPACK_IMPORTED_MODULE_15__.MobileMenu, {\n app: app,\n appState: appState,\n elements: elements,\n actionManager: actionManager,\n renderJSONExportDialog: renderJSONExportDialog,\n renderImageExportDialog: renderImageExportDialog,\n setAppState: setAppState,\n onHandToolToggle: onHandToolToggle,\n onPenModeToggle: onPenModeToggle,\n renderTopLeftUI: renderTopLeftUI,\n renderTopRightUI: renderTopRightUI,\n renderSidebars: renderSidebars,\n renderWelcomeScreen: renderWelcomeScreen,\n UIOptions: UIOptions\n }), !isTrayModeOrMobile &&\n /*#__PURE__*/\n //zsviczian changed from !device.editor.isMobile\n react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n className: \"layer-ui__wrapper\"\n }, renderWelcomeScreen && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(tunnels.WelcomeScreenCenterTunnel.Out, null), renderFixedSideContainer(), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_footer_Footer__WEBPACK_IMPORTED_MODULE_21__[\"default\"], {\n appState: appState,\n actionManager: actionManager,\n showExitZenModeBtn: showExitZenModeBtn,\n renderWelcomeScreen: renderWelcomeScreen\n }), appState.scrolledOutside && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"button\", {\n type: \"button\",\n className: \"scroll-back-to-content\",\n onClick: () => {\n setAppState(appState => Object.assign({}, (0,_scene__WEBPACK_IMPORTED_MODULE_11__.calculateScrollCenter)(elements, appState)));\n }\n }, (0,_i18n__WEBPACK_IMPORTED_MODULE_10__.t)(\"buttons.scrollBackToContent\"))), renderSidebars()));\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_context_ui_appState__WEBPACK_IMPORTED_MODULE_8__.UIAppStateContext.Provider, {\n value: appState\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(TunnelsJotaiProvider, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_context_tunnels__WEBPACK_IMPORTED_MODULE_7__.TunnelsContext.Provider, {\n value: tunnels\n }, layerUIJSX)));\n};\n\nconst stripIrrelevantAppStateProps = appState => {\n const {\n suggestedBindings,\n startBoundElement,\n cursorButton,\n scrollX,\n scrollY\n } = appState,\n ret = __rest(appState, [\"suggestedBindings\", \"startBoundElement\", \"cursorButton\", \"scrollX\", \"scrollY\"]);\n\n return ret;\n};\n\nconst areEqual = (prevProps, nextProps) => {\n // short-circuit early\n if (prevProps.children !== nextProps.children) {\n return false;\n }\n\n const {\n canvas: _pC,\n appState: prevAppState\n } = prevProps,\n prev = __rest(prevProps, [\"canvas\", \"appState\"]);\n\n const {\n canvas: _nC,\n appState: nextAppState\n } = nextProps,\n next = __rest(nextProps, [\"canvas\", \"appState\"]);\n\n return (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.isShallowEqual)( // asserting AppState because we're being passed the whole AppState\n // but resolve to only the UI-relevant props\n stripIrrelevantAppStateProps(prevAppState), stripIrrelevantAppStateProps(nextAppState), {\n selectedElementIds: _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.isShallowEqual,\n selectedGroupIds: _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.isShallowEqual\n }) && (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.isShallowEqual)(prev, next);\n};\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (/*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().memo(LayerUI, areEqual));\n\n//# sourceURL=webpack://ExcalidrawLib/./components/LayerUI.tsx?");
|
|
15229
15229
|
|
|
15230
15230
|
/***/ }),
|
|
15231
15231
|
|
|
@@ -15258,7 +15258,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
15258
15258
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
15259
15259
|
|
|
15260
15260
|
"use strict";
|
|
15261
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n/* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../i18n */ \"./i18n.ts\");\n\n\n\nconst LibraryMenuBrowseButton = ({\n theme,\n id,\n libraryReturnUrl\n}) => {\n const referrer = libraryReturnUrl || window.location.origin + window.location.pathname;\n return React.createElement(\"a\", {\n className: \"library-menu-browse-button\",\n
|
|
15261
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n/* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../i18n */ \"./i18n.ts\");\n/* harmony import */ var _obsidianUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../obsidianUtils */ \"./obsidianUtils.ts\");\n\n\n\n\nconst LibraryMenuBrowseButton = ({\n theme,\n id,\n libraryReturnUrl\n}) => {\n const referrer = libraryReturnUrl || window.location.origin + window.location.pathname;\n return (//zsviczian added link to video about libraries\n React.createElement(React.Fragment, null, React.createElement(\"div\", null, React.createElement(\"a\", {\n href: \"https://youtu.be/P_Q6avJGoWI?t=127\",\n target: \"_blank\",\n rel: \"noreferrer\",\n style: {\n color: \"var(--color-on-surface)\",\n fontSize: \".75rem\"\n }\n }, (0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_2__.t2)(\"ABOUT_LIBRARIES\"))), React.createElement(\"a\", {\n className: \"library-menu-browse-button\",\n href: `${\"https://libraries.excalidraw.com\"}?target=${window.name || \"_blank\"}&referrer=${referrer}&useHash=true&token=${id}&theme=${theme}&version=${_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.VERSIONS.excalidrawLibrary}`,\n target: \"_excalidraw_libraries\"\n }, (0,_i18n__WEBPACK_IMPORTED_MODULE_1__.t)(\"labels.libraries\")))\n );\n};\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LibraryMenuBrowseButton);\n\n//# sourceURL=webpack://ExcalidrawLib/./components/LibraryMenuBrowseButton.tsx?");
|
|
15262
15262
|
|
|
15263
15263
|
/***/ }),
|
|
15264
15264
|
|
|
@@ -15379,7 +15379,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
15379
15379
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
15380
15380
|
|
|
15381
15381
|
"use strict";
|
|
15382
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ MobileMenu: () => (/* binding */ MobileMenu)\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 _context_tunnels__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../context/tunnels */ \"./context/tunnels.ts\");\n/* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../i18n */ \"./i18n.ts\");\n/* harmony import */ var _scene__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../scene */ \"./scene/index.ts\");\n/* harmony import */ var _scene_scrollbars__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../scene/scrollbars */ \"./scene/scrollbars.ts\");\n/* harmony import */ var _Actions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Actions */ \"./components/Actions.tsx\");\n/* harmony import */ var _MobileToolBar__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./MobileToolBar */ \"./components/MobileToolBar.tsx\");\n/* harmony import */ var _FixedSideContainer__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./FixedSideContainer */ \"./components/FixedSideContainer.tsx\");\n/* harmony import */ var _Island__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Island */ \"./components/Island.tsx\");\n/* harmony import */ var
|
|
15382
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ MobileMenu: () => (/* binding */ MobileMenu)\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 _context_tunnels__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../context/tunnels */ \"./context/tunnels.ts\");\n/* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../i18n */ \"./i18n.ts\");\n/* harmony import */ var _scene__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../scene */ \"./scene/index.ts\");\n/* harmony import */ var _scene_scrollbars__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../scene/scrollbars */ \"./scene/scrollbars.ts\");\n/* harmony import */ var _Actions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Actions */ \"./components/Actions.tsx\");\n/* harmony import */ var _MobileToolBar__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./MobileToolBar */ \"./components/MobileToolBar.tsx\");\n/* harmony import */ var _FixedSideContainer__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./FixedSideContainer */ \"./components/FixedSideContainer.tsx\");\n/* harmony import */ var _Island__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Island */ \"./components/Island.tsx\");\n/* harmony import */ var _PenModeButton__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./PenModeButton */ \"./components/PenModeButton.tsx\");\n/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! clsx */ \"../../node_modules/clsx/dist/clsx.m.js\");\n/* harmony import */ var _Stats__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./Stats */ \"./components/Stats/index.tsx\");\n/* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../actions */ \"./actions/index.ts\");\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst MobileMenu = ({\n appState,\n elements,\n actionManager,\n setAppState,\n onHandToolToggle,\n renderTopLeftUI,\n renderTopRightUI,\n renderSidebars,\n renderWelcomeScreen,\n UIOptions,\n app,\n renderCustomStats,\n //zsviczian\n onPenModeToggle\n}) => {\n var _a;\n\n const {\n WelcomeScreenCenterTunnel,\n MainMenuTunnel,\n DefaultSidebarTriggerTunnel\n } = (0,_context_tunnels__WEBPACK_IMPORTED_MODULE_1__.useTunnels)();\n\n const renderAppTopBar = () => {\n var _a;\n\n if (((_a = appState.openDialog) === null || _a === void 0 ? void 0 : _a.name) === \"elementLinkSelector\") {\n return null;\n }\n\n const topRightUI = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, !appState.viewModeEnabled &&\n /*#__PURE__*/\n //zsviczian\n react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"excalidraw-ui-top-right\"\n }, renderTopRightUI === null || renderTopRightUI === void 0 ? void 0 : renderTopRightUI(true, appState)), !appState.viewModeEnabled && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"excalidraw-ui-top-right library-and-pen\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_PenModeButton__WEBPACK_IMPORTED_MODULE_9__.PenModeButton, {\n checked: appState.penMode,\n onChange: () => onPenModeToggle(null),\n title: (0,_i18n__WEBPACK_IMPORTED_MODULE_2__.t)(\"toolBar.penMode\"),\n isMobile: true,\n penDetected: appState.penDetected\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(DefaultSidebarTriggerTunnel.Out, null)), appState.viewModeEnabled && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"excalidraw-ui-top-right\"\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Actions__WEBPACK_IMPORTED_MODULE_5__.ExitViewModeButton, {\n actionManager: actionManager\n })));\n const topLeftUI = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"excalidraw-ui-top-left\"\n }, renderTopLeftUI === null || renderTopLeftUI === void 0 ? void 0 : renderTopLeftUI(true, appState), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(MainMenuTunnel.Out, null));\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"App-toolbar-content\",\n style: {\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\"\n }\n }, topLeftUI, topRightUI);\n };\n\n const renderToolbar = () => {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_MobileToolBar__WEBPACK_IMPORTED_MODULE_6__.MobileToolBar, {\n app: app,\n onHandToolToggle: onHandToolToggle,\n setAppState: setAppState\n });\n };\n\n const shouldShowStats = //zsviczian\n appState.stats.open && !appState.zenModeEnabled && !appState.viewModeEnabled;\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, renderSidebars(), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"App-welcome-screen\"\n }, renderWelcomeScreen && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(WelcomeScreenCenterTunnel.Out, null)), !appState.viewModeEnabled && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"App-bottom-bar\",\n style: {\n marginBottom: _scene_scrollbars__WEBPACK_IMPORTED_MODULE_4__.SCROLLBAR_WIDTH + _scene_scrollbars__WEBPACK_IMPORTED_MODULE_4__.SCROLLBAR_MARGIN\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Actions__WEBPACK_IMPORTED_MODULE_5__.MobileShapeActions, {\n appState: appState,\n elementsMap: app.scene.getNonDeletedElementsMap(),\n renderAction: actionManager.renderAction,\n app: app,\n setAppState: setAppState\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Island__WEBPACK_IMPORTED_MODULE_8__.Island, {\n className: \"App-toolbar\"\n }, !appState.viewModeEnabled && ((_a = appState.openDialog) === null || _a === void 0 ? void 0 : _a.name) !== \"elementLinkSelector\" && renderToolbar(), appState.scrolledOutside && !appState.openMenu && !appState.openSidebar && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"button\", {\n type: \"button\",\n className: \"scroll-back-to-content\",\n onClick: () => {\n setAppState(appState => Object.assign({}, (0,_scene__WEBPACK_IMPORTED_MODULE_3__.calculateScrollCenter)(elements, appState)));\n }\n }, (0,_i18n__WEBPACK_IMPORTED_MODULE_2__.t)(\"buttons.scrollBackToContent\")))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_FixedSideContainer__WEBPACK_IMPORTED_MODULE_7__.FixedSideContainer, {\n side: \"top\",\n className: \"App-top-bar\"\n }, renderAppTopBar(), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: (0,clsx__WEBPACK_IMPORTED_MODULE_10__[\"default\"])(\"layer-ui__wrapper__top-right zen-mode-transition\", {\n \"transition-right\": appState.zenModeEnabled\n }),\n style: {\n marginRight: \"4rem\"\n }\n }, shouldShowStats &&\n /*#__PURE__*/\n //zsviczian\n react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Stats__WEBPACK_IMPORTED_MODULE_11__.Stats, {\n app: app,\n onClose: () => {\n actionManager.executeAction(_actions__WEBPACK_IMPORTED_MODULE_12__.actionToggleStats);\n },\n renderCustomStats: renderCustomStats\n }))));\n};\n\n//# sourceURL=webpack://ExcalidrawLib/./components/MobileMenu.tsx?");
|
|
15383
15383
|
|
|
15384
15384
|
/***/ }),
|
|
15385
15385
|
|
|
@@ -16523,7 +16523,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extr
|
|
|
16523
16523
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
16524
16524
|
|
|
16525
16525
|
"use strict";
|
|
16526
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\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 _DropdownMenuContent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DropdownMenuContent */ \"./components/dropdownMenu/DropdownMenuContent.tsx\");\n/* harmony import */ var _DropdownMenuGroup__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./DropdownMenuGroup */ \"./components/dropdownMenu/DropdownMenuGroup.tsx\");\n/* harmony import */ var _DropdownMenuItem__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./DropdownMenuItem */ \"./components/dropdownMenu/DropdownMenuItem.tsx\");\n/* harmony import */ var _DropdownMenuItemCustom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./DropdownMenuItemCustom */ \"./components/dropdownMenu/DropdownMenuItemCustom.tsx\");\n/* harmony import */ var _DropdownMenuItemLink__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./DropdownMenuItemLink */ \"./components/dropdownMenu/DropdownMenuItemLink.tsx\");\n/* harmony import */ var _DropdownMenuSeparator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./DropdownMenuSeparator */ \"./components/dropdownMenu/DropdownMenuSeparator.tsx\");\n/* harmony import */ var _DropdownMenuTrigger__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./DropdownMenuTrigger */ \"./components/dropdownMenu/DropdownMenuTrigger.tsx\");\n/* harmony import */ var _dropdownMenuUtils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./dropdownMenuUtils */ \"./components/dropdownMenu/dropdownMenuUtils.ts\");\n/* harmony import */ var _DropdownMenu_scss__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./DropdownMenu.scss */ \"./components/dropdownMenu/DropdownMenu.scss\");\n\n\n\n\n\n\n\n\n\n\n\nconst DropdownMenu = ({\n children,\n open,\n placement\n}) => {\n const MenuTriggerComp = (0,_dropdownMenuUtils__WEBPACK_IMPORTED_MODULE_8__.getMenuTriggerComponent)(children);\n const MenuContentComp = (0,_dropdownMenuUtils__WEBPACK_IMPORTED_MODULE_8__.getMenuContentComponent)(children); // clone the MenuContentComp to pass the placement prop\n\n const MenuContentCompWithPlacement = MenuContentComp && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().isValidElement(MenuContentComp) ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(MenuContentComp, {\n placement\n }) : MenuContentComp;\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
|
|
16526
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\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 _DropdownMenuContent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DropdownMenuContent */ \"./components/dropdownMenu/DropdownMenuContent.tsx\");\n/* harmony import */ var _DropdownMenuGroup__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./DropdownMenuGroup */ \"./components/dropdownMenu/DropdownMenuGroup.tsx\");\n/* harmony import */ var _DropdownMenuItem__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./DropdownMenuItem */ \"./components/dropdownMenu/DropdownMenuItem.tsx\");\n/* harmony import */ var _DropdownMenuItemCustom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./DropdownMenuItemCustom */ \"./components/dropdownMenu/DropdownMenuItemCustom.tsx\");\n/* harmony import */ var _DropdownMenuItemLink__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./DropdownMenuItemLink */ \"./components/dropdownMenu/DropdownMenuItemLink.tsx\");\n/* harmony import */ var _DropdownMenuSeparator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./DropdownMenuSeparator */ \"./components/dropdownMenu/DropdownMenuSeparator.tsx\");\n/* harmony import */ var _DropdownMenuTrigger__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./DropdownMenuTrigger */ \"./components/dropdownMenu/DropdownMenuTrigger.tsx\");\n/* harmony import */ var _dropdownMenuUtils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./dropdownMenuUtils */ \"./components/dropdownMenu/dropdownMenuUtils.ts\");\n/* harmony import */ var _DropdownMenu_scss__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./DropdownMenu.scss */ \"./components/dropdownMenu/DropdownMenu.scss\");\n\n\n\n\n\n\n\n\n\n\n\nconst DropdownMenu = ({\n children,\n open,\n placement\n}) => {\n const MenuTriggerComp = (0,_dropdownMenuUtils__WEBPACK_IMPORTED_MODULE_8__.getMenuTriggerComponent)(children);\n const MenuContentComp = (0,_dropdownMenuUtils__WEBPACK_IMPORTED_MODULE_8__.getMenuContentComponent)(children); // clone the MenuContentComp to pass the placement prop\n\n const MenuContentCompWithPlacement = MenuContentComp && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().isValidElement(MenuContentComp) ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(MenuContentComp, {\n placement\n }) : MenuContentComp;\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(\"div\", {\n className: \"dropdown-menu-container\",\n style: {\n // remove this div from box layout\n display: \"contents\"\n }\n }, MenuTriggerComp, open && MenuContentCompWithPlacement);\n};\n\nDropdownMenu.Trigger = _DropdownMenuTrigger__WEBPACK_IMPORTED_MODULE_7__[\"default\"];\nDropdownMenu.Content = _DropdownMenuContent__WEBPACK_IMPORTED_MODULE_1__[\"default\"];\nDropdownMenu.Item = _DropdownMenuItem__WEBPACK_IMPORTED_MODULE_3__[\"default\"];\nDropdownMenu.ItemLink = _DropdownMenuItemLink__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\nDropdownMenu.ItemCustom = _DropdownMenuItemCustom__WEBPACK_IMPORTED_MODULE_4__[\"default\"];\nDropdownMenu.Group = _DropdownMenuGroup__WEBPACK_IMPORTED_MODULE_2__[\"default\"];\nDropdownMenu.Separator = _DropdownMenuSeparator__WEBPACK_IMPORTED_MODULE_6__[\"default\"];\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DropdownMenu);\nDropdownMenu.displayName = \"DropdownMenu\";\n\n//# sourceURL=webpack://ExcalidrawLib/./components/dropdownMenu/DropdownMenu.tsx?");
|
|
16527
16527
|
|
|
16528
16528
|
/***/ }),
|
|
16529
16529
|
|
|
@@ -16534,7 +16534,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
16534
16534
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
16535
16535
|
|
|
16536
16536
|
"use strict";
|
|
16537
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ \"../../node_modules/clsx/dist/clsx.m.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n/* harmony import */ var _hooks_useOutsideClick__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../hooks/useOutsideClick */ \"./hooks/useOutsideClick.ts\");\n/* harmony import */ var _hooks_useStable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../hooks/useStable */ \"./hooks/useStable.ts\");\n/* harmony import */ var _App__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../App */ \"./components/App.tsx\");\n/* harmony import */ var _Island__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Island */ \"./components/Island.tsx\");\n/* harmony import */ var _Stack__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Stack */ \"./components/Stack.tsx\");\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./common */ \"./components/dropdownMenu/common.ts\");\n/* harmony import */ var _excalidraw_excalidraw_context_ui_appState__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @excalidraw/excalidraw/context/ui-appState */ \"./context/ui-appState.ts\");\n\n\n\n\n\n\n\n\n\n\n\nconst MenuContent = ({\n children,\n onClickOutside,\n className = \"\",\n onSelect,\n style,\n placement = \"bottom\"\n}) => {\n const editorInterface = (0,_App__WEBPACK_IMPORTED_MODULE_5__.useEditorInterface)();\n const appState = (0,_excalidraw_excalidraw_context_ui_appState__WEBPACK_IMPORTED_MODULE_9__.useUIAppState)(); //zsviczian\n\n const menuRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);\n const callbacksRef = (0,_hooks_useStable__WEBPACK_IMPORTED_MODULE_4__.useStable)({\n onClickOutside\n });\n (0,_hooks_useOutsideClick__WEBPACK_IMPORTED_MODULE_3__.useOutsideClick)(menuRef,
|
|
16537
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ \"../../node_modules/clsx/dist/clsx.m.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n/* harmony import */ var _hooks_useOutsideClick__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../hooks/useOutsideClick */ \"./hooks/useOutsideClick.ts\");\n/* harmony import */ var _hooks_useStable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../hooks/useStable */ \"./hooks/useStable.ts\");\n/* harmony import */ var _App__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../App */ \"./components/App.tsx\");\n/* harmony import */ var _Island__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Island */ \"./components/Island.tsx\");\n/* harmony import */ var _Stack__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Stack */ \"./components/Stack.tsx\");\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./common */ \"./components/dropdownMenu/common.ts\");\n/* harmony import */ var _excalidraw_excalidraw_context_ui_appState__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @excalidraw/excalidraw/context/ui-appState */ \"./context/ui-appState.ts\");\n\n\n\n\n\n\n\n\n\n\n\nconst MenuContent = ({\n children,\n onClickOutside,\n className = \"\",\n onSelect,\n style,\n placement = \"bottom\"\n}) => {\n const editorInterface = (0,_App__WEBPACK_IMPORTED_MODULE_5__.useEditorInterface)();\n const appState = (0,_excalidraw_excalidraw_context_ui_appState__WEBPACK_IMPORTED_MODULE_9__.useUIAppState)(); //zsviczian\n\n const menuRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);\n const callbacksRef = (0,_hooks_useStable__WEBPACK_IMPORTED_MODULE_4__.useStable)({\n onClickOutside\n });\n (0,_hooks_useOutsideClick__WEBPACK_IMPORTED_MODULE_3__.useOutsideClick)(menuRef, event => {\n var _a, _b, _c; // prevents closing if clicking on the trigger button\n\n\n if (!((_b = (_a = menuRef.current) === null || _a === void 0 ? void 0 : _a.closest(\".dropdown-menu-container\")) === null || _b === void 0 ? void 0 : _b.contains(event.target))) {\n (_c = callbacksRef.onClickOutside) === null || _c === void 0 ? void 0 : _c.call(callbacksRef);\n }\n });\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {\n const onKeyDown = event => {\n var _a;\n\n if (event.key === _excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.KEYS.ESCAPE) {\n event.stopImmediatePropagation();\n (_a = callbacksRef.onClickOutside) === null || _a === void 0 ? void 0 : _a.call(callbacksRef);\n }\n };\n\n const option = {\n // so that we can stop propagation of the event before it reaches\n // event handlers that were bound before this one\n capture: true\n };\n document.addEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.EVENT.KEYDOWN, onKeyDown, option);\n return () => {\n document.removeEventListener(_excalidraw_common__WEBPACK_IMPORTED_MODULE_2__.EVENT.KEYDOWN, onKeyDown, option);\n };\n }, [callbacksRef]);\n const classNames = (0,clsx__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(`dropdown-menu ${className}`, {\n \"dropdown-menu--mobile\": editorInterface.formFactor === \"phone\",\n \"dropdown-menu--tray\": editorInterface.formFactor !== \"phone\" && editorInterface.preferTrayMode,\n \"dropdown-menu--placement-top\": placement === \"top\"\n }).trim();\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_common__WEBPACK_IMPORTED_MODULE_8__.DropdownMenuContentPropsContext.Provider, {\n value: {\n onSelect\n }\n }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", {\n ref: menuRef,\n className: classNames,\n style: style,\n \"data-testid\": \"dropdown-menu\"\n }, editorInterface.formFactor === \"phone\" ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Stack__WEBPACK_IMPORTED_MODULE_7__[\"default\"].Col, {\n className: \"dropdown-menu-container\"\n }, children) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_Island__WEBPACK_IMPORTED_MODULE_6__.Island, {\n className: \"dropdown-menu-container\",\n padding: 2,\n style: {\n zIndex: 2\n }\n }, children)));\n};\n\nMenuContent.displayName = \"DropdownMenuContent\";\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MenuContent);\n\n//# sourceURL=webpack://ExcalidrawLib/./components/dropdownMenu/DropdownMenuContent.tsx?");
|
|
16538
16538
|
|
|
16539
16539
|
/***/ }),
|
|
16540
16540
|
|
|
@@ -16622,7 +16622,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
16622
16622
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
16623
16623
|
|
|
16624
16624
|
"use strict";
|
|
16625
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ \"../../node_modules/clsx/dist/clsx.m.js\");\n/* harmony import */ var _App__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../App */ \"./components/App.tsx\");\nvar __rest = undefined && undefined.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n\n\n\n\nconst MenuTrigger = _a => {\n var {\n className = \"\",\n children,\n onToggle,\n title\n } = _a,\n rest = __rest(_a, [\"className\", \"children\", \"onToggle\", \"title\"]);\n\n const editorInterface = (0,_App__WEBPACK_IMPORTED_MODULE_1__.useEditorInterface)();\n const classNames = (0,clsx__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(`dropdown-menu-button ${className}`, \"zen-mode-transition\", {\n \"dropdown-menu-button--mobile\": editorInterface.formFactor === \"phone\"\n }, {\n \"dropdown-menu-button--tray\": editorInterface.formFactor !== \"phone\" && editorInterface.preferTrayMode //zsviczian\n\n }).trim();\n return React.createElement(\"button\", Object.assign({\n
|
|
16625
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ \"../../node_modules/clsx/dist/clsx.m.js\");\n/* harmony import */ var _App__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../App */ \"./components/App.tsx\");\nvar __rest = undefined && undefined.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n\n\n\n\nconst MenuTrigger = _a => {\n var {\n className = \"\",\n children,\n onToggle,\n title\n } = _a,\n rest = __rest(_a, [\"className\", \"children\", \"onToggle\", \"title\"]);\n\n const editorInterface = (0,_App__WEBPACK_IMPORTED_MODULE_1__.useEditorInterface)();\n const classNames = (0,clsx__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(`dropdown-menu-button ${className}`, \"zen-mode-transition\", {\n \"dropdown-menu-button--mobile\": editorInterface.formFactor === \"phone\"\n }, {\n \"dropdown-menu-button--tray\": editorInterface.formFactor !== \"phone\" && editorInterface.preferTrayMode //zsviczian\n\n }).trim();\n return React.createElement(\"button\", Object.assign({\n className: classNames,\n onClick: onToggle,\n type: \"button\",\n \"data-testid\": \"dropdown-menu-button\",\n title: title\n }, rest), children);\n};\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MenuTrigger);\nMenuTrigger.displayName = \"DropdownMenuTrigger\";\n\n//# sourceURL=webpack://ExcalidrawLib/./components/dropdownMenu/DropdownMenuTrigger.tsx?");
|
|
16626
16626
|
|
|
16627
16627
|
/***/ }),
|
|
16628
16628
|
|
|
@@ -16732,7 +16732,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
16732
16732
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
16733
16733
|
|
|
16734
16734
|
"use strict";
|
|
16735
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AlignBottomIcon: () => (/* binding */ AlignBottomIcon),\n/* harmony export */ AlignLeftIcon: () => (/* binding */ AlignLeftIcon),\n/* harmony export */ AlignRightIcon: () => (/* binding */ AlignRightIcon),\n/* harmony export */ AlignTopIcon: () => (/* binding */ AlignTopIcon),\n/* harmony export */ ArrowIcon: () => (/* binding */ ArrowIcon),\n/* harmony export */ ArrowRightIcon: () => (/* binding */ ArrowRightIcon),\n/* harmony export */ ArrowheadArrowIcon: () => (/* binding */ ArrowheadArrowIcon),\n/* harmony export */ ArrowheadBarIcon: () => (/* binding */ ArrowheadBarIcon),\n/* harmony export */ ArrowheadCircleIcon: () => (/* binding */ ArrowheadCircleIcon),\n/* harmony export */ ArrowheadCircleOutlineIcon: () => (/* binding */ ArrowheadCircleOutlineIcon),\n/* harmony export */ ArrowheadCrowfootIcon: () => (/* binding */ ArrowheadCrowfootIcon),\n/* harmony export */ ArrowheadCrowfootOneIcon: () => (/* binding */ ArrowheadCrowfootOneIcon),\n/* harmony export */ ArrowheadCrowfootOneOrManyIcon: () => (/* binding */ ArrowheadCrowfootOneOrManyIcon),\n/* harmony export */ ArrowheadDiamondIcon: () => (/* binding */ ArrowheadDiamondIcon),\n/* harmony export */ ArrowheadDiamondOutlineIcon: () => (/* binding */ ArrowheadDiamondOutlineIcon),\n/* harmony export */ ArrowheadNoneIcon: () => (/* binding */ ArrowheadNoneIcon),\n/* harmony export */ ArrowheadTriangleIcon: () => (/* binding */ ArrowheadTriangleIcon),\n/* harmony export */ ArrowheadTriangleOutlineIcon: () => (/* binding */ ArrowheadTriangleOutlineIcon),\n/* harmony export */ BringForwardIcon: () => (/* binding */ BringForwardIcon),\n/* harmony export */ BringToFrontIcon: () => (/* binding */ BringToFrontIcon),\n/* harmony export */ Card: () => (/* binding */ Card),\n/* harmony export */ CenterHorizontallyIcon: () => (/* binding */ CenterHorizontallyIcon),\n/* harmony export */ CenterVerticallyIcon: () => (/* binding */ CenterVerticallyIcon),\n/* harmony export */ CloseIcon: () => (/* binding */ CloseIcon),\n/* harmony export */ DeviceDesktopIcon: () => (/* binding */ DeviceDesktopIcon),\n/* harmony export */ DiamondIcon: () => (/* binding */ DiamondIcon),\n/* harmony export */ DiscordIcon: () => (/* binding */ DiscordIcon),\n/* harmony export */ DistributeHorizontallyIcon: () => (/* binding */ DistributeHorizontallyIcon),\n/* harmony export */ DistributeVerticallyIcon: () => (/* binding */ DistributeVerticallyIcon),\n/* harmony export */ DotsHorizontalIcon: () => (/* binding */ DotsHorizontalIcon),\n/* harmony export */ DotsIcon: () => (/* binding */ DotsIcon),\n/* harmony export */ DuplicateIcon: () => (/* binding */ DuplicateIcon),\n/* harmony export */ EdgeRoundIcon: () => (/* binding */ EdgeRoundIcon),\n/* harmony export */ EdgeSharpIcon: () => (/* binding */ EdgeSharpIcon),\n/* harmony export */ EllipseIcon: () => (/* binding */ EllipseIcon),\n/* harmony export */ EmbedIcon: () => (/* binding */ EmbedIcon),\n/* harmony export */ EraserIcon: () => (/* binding */ EraserIcon),\n/* harmony export */ ExcalLogo: () => (/* binding */ ExcalLogo),\n/* harmony export */ ExportIcon: () => (/* binding */ ExportIcon),\n/* harmony export */ ExportImageIcon: () => (/* binding */ ExportImageIcon),\n/* harmony export */ ExternalLinkIcon: () => (/* binding */ ExternalLinkIcon),\n/* harmony export */ FillCrossHatchIcon: () => (/* binding */ FillCrossHatchIcon),\n/* harmony export */ FillHachureIcon: () => (/* binding */ FillHachureIcon),\n/* harmony export */ FillSolidIcon: () => (/* binding */ FillSolidIcon),\n/* harmony export */ FillZigZagIcon: () => (/* binding */ FillZigZagIcon),\n/* harmony export */ FontFamilyCodeIcon: () => (/* binding */ FontFamilyCodeIcon),\n/* harmony export */ FontFamilyHeadingIcon: () => (/* binding */ FontFamilyHeadingIcon),\n/* harmony export */ FontFamilyLocalFontIcon: () => (/* binding */ FontFamilyLocalFontIcon),\n/* harmony export */ FontFamilyNormalIcon: () => (/* binding */ FontFamilyNormalIcon),\n/* harmony export */ FontSizeExtraLargeIcon: () => (/* binding */ FontSizeExtraLargeIcon),\n/* harmony export */ FontSizeLargeIcon: () => (/* binding */ FontSizeLargeIcon),\n/* harmony export */ FontSizeMediumIcon: () => (/* binding */ FontSizeMediumIcon),\n/* harmony export */ FontSizeSmallIcon: () => (/* binding */ FontSizeSmallIcon),\n/* harmony export */ FreedrawIcon: () => (/* binding */ FreedrawIcon),\n/* harmony export */ GithubIcon: () => (/* binding */ GithubIcon),\n/* harmony export */ GroupIcon: () => (/* binding */ GroupIcon),\n/* harmony export */ HamburgerMenuIcon: () => (/* binding */ HamburgerMenuIcon),\n/* harmony export */ HelpIcon: () => (/* binding */ HelpIcon),\n/* harmony export */ HelpIconThin: () => (/* binding */ HelpIconThin),\n/* harmony export */ ImageIcon: () => (/* binding */ ImageIcon),\n/* harmony export */ InsertAnyFileIcon: () => (/* binding */ InsertAnyFileIcon),\n/* harmony export */ LaTeXIcon: () => (/* binding */ LaTeXIcon),\n/* harmony export */ LassoIcon: () => (/* binding */ LassoIcon),\n/* harmony export */ LibraryIcon: () => (/* binding */ LibraryIcon),\n/* harmony export */ LineIcon: () => (/* binding */ LineIcon),\n/* harmony export */ LinkIcon: () => (/* binding */ LinkIcon),\n/* harmony export */ LoadIcon: () => (/* binding */ LoadIcon),\n/* harmony export */ LockedIcon: () => (/* binding */ LockedIcon),\n/* harmony export */ LockedIconFilled: () => (/* binding */ LockedIconFilled),\n/* harmony export */ MagicIcon: () => (/* binding */ MagicIcon),\n/* harmony export */ MagicIconThin: () => (/* binding */ MagicIconThin),\n/* harmony export */ MoonIcon: () => (/* binding */ MoonIcon),\n/* harmony export */ OpenAIIcon: () => (/* binding */ OpenAIIcon),\n/* harmony export */ PenModeIcon: () => (/* binding */ PenModeIcon),\n/* harmony export */ PinIcon: () => (/* binding */ PinIcon),\n/* harmony export */ PlusIcon: () => (/* binding */ PlusIcon),\n/* harmony export */ PlusPromoIcon: () => (/* binding */ PlusPromoIcon),\n/* harmony export */ RectangleIcon: () => (/* binding */ RectangleIcon),\n/* harmony export */ RedoIcon: () => (/* binding */ RedoIcon),\n/* harmony export */ SelectionIcon: () => (/* binding */ SelectionIcon),\n/* harmony export */ SendBackwardIcon: () => (/* binding */ SendBackwardIcon),\n/* harmony export */ SendToBackIcon: () => (/* binding */ SendToBackIcon),\n/* harmony export */ SloppinessArchitectIcon: () => (/* binding */ SloppinessArchitectIcon),\n/* harmony export */ SloppinessArtistIcon: () => (/* binding */ SloppinessArtistIcon),\n/* harmony export */ SloppinessCartoonistIcon: () => (/* binding */ SloppinessCartoonistIcon),\n/* harmony export */ StrokeStyleDashedIcon: () => (/* binding */ StrokeStyleDashedIcon),\n/* harmony export */ StrokeStyleDottedIcon: () => (/* binding */ StrokeStyleDottedIcon),\n/* harmony export */ StrokeStyleSolidIcon: () => (/* binding */ StrokeStyleSolidIcon),\n/* harmony export */ StrokeWidthBaseIcon: () => (/* binding */ StrokeWidthBaseIcon),\n/* harmony export */ StrokeWidthBoldIcon: () => (/* binding */ StrokeWidthBoldIcon),\n/* harmony export */ StrokeWidthExtraBoldIcon: () => (/* binding */ StrokeWidthExtraBoldIcon),\n/* harmony export */ StrokeWidthThinIcon: () => (/* binding */ StrokeWidthThinIcon),\n/* harmony export */ SunIcon: () => (/* binding */ SunIcon),\n/* harmony export */ TextAlignBottomIcon: () => (/* binding */ TextAlignBottomIcon),\n/* harmony export */ TextAlignCenterIcon: () => (/* binding */ TextAlignCenterIcon),\n/* harmony export */ TextAlignLeftIcon: () => (/* binding */ TextAlignLeftIcon),\n/* harmony export */ TextAlignMiddleIcon: () => (/* binding */ TextAlignMiddleIcon),\n/* harmony export */ TextAlignRightIcon: () => (/* binding */ TextAlignRightIcon),\n/* harmony export */ TextAlignTopIcon: () => (/* binding */ TextAlignTopIcon),\n/* harmony export */ TextIcon: () => (/* binding */ TextIcon),\n/* harmony export */ TextSizeIcon: () => (/* binding */ TextSizeIcon),\n/* harmony export */ TrashIcon: () => (/* binding */ TrashIcon),\n/* harmony export */ UndoIcon: () => (/* binding */ UndoIcon),\n/* harmony export */ UngroupIcon: () => (/* binding */ UngroupIcon),\n/* harmony export */ UnlockedIcon: () => (/* binding */ UnlockedIcon),\n/* harmony export */ WelcomeScreenHelpArrow: () => (/* binding */ WelcomeScreenHelpArrow),\n/* harmony export */ WelcomeScreenMenuArrow: () => (/* binding */ WelcomeScreenMenuArrow),\n/* harmony export */ WelcomeScreenTopToolbarArrow: () => (/* binding */ WelcomeScreenTopToolbarArrow),\n/* harmony export */ XBrandIcon: () => (/* binding */ XBrandIcon),\n/* harmony export */ ZoomInIcon: () => (/* binding */ ZoomInIcon),\n/* harmony export */ ZoomOutIcon: () => (/* binding */ ZoomOutIcon),\n/* harmony export */ ZoomResetIcon: () => (/* binding */ ZoomResetIcon),\n/* harmony export */ abacusIcon: () => (/* binding */ abacusIcon),\n/* harmony export */ adjustmentsIcon: () => (/* binding */ adjustmentsIcon),\n/* harmony export */ alertTriangleIcon: () => (/* binding */ alertTriangleIcon),\n/* harmony export */ angleIcon: () => (/* binding */ angleIcon),\n/* harmony export */ boltIcon: () => (/* binding */ boltIcon),\n/* harmony export */ brainIcon: () => (/* binding */ brainIcon),\n/* harmony export */ brainIconThin: () => (/* binding */ brainIconThin),\n/* harmony export */ bucketFillIcon: () => (/* binding */ bucketFillIcon),\n/* harmony export */ checkIcon: () => (/* binding */ checkIcon),\n/* harmony export */ clipboard: () => (/* binding */ clipboard),\n/* harmony export */ clockIcon: () => (/* binding */ clockIcon),\n/* harmony export */ clone: () => (/* binding */ clone),\n/* harmony export */ coffeeIcon: () => (/* binding */ coffeeIcon),\n/* harmony export */ collapseDownIcon: () => (/* binding */ collapseDownIcon),\n/* harmony export */ collapseUpIcon: () => (/* binding */ collapseUpIcon),\n/* harmony export */ copyIcon: () => (/* binding */ copyIcon),\n/* harmony export */ createIcon: () => (/* binding */ createIcon),\n/* harmony export */ cropIcon: () => (/* binding */ cropIcon),\n/* harmony export */ cutIcon: () => (/* binding */ cutIcon),\n/* harmony export */ done: () => (/* binding */ done),\n/* harmony export */ downloadIcon: () => (/* binding */ downloadIcon),\n/* harmony export */ elbowArrowIcon: () => (/* binding */ elbowArrowIcon),\n/* harmony export */ elementLinkIcon: () => (/* binding */ elementLinkIcon),\n/* harmony export */ eraser: () => (/* binding */ eraser),\n/* harmony export */ exportToFileIcon: () => (/* binding */ exportToFileIcon),\n/* harmony export */ exportToPlus: () => (/* binding */ exportToPlus),\n/* harmony export */ extraToolsIcon: () => (/* binding */ extraToolsIcon),\n/* harmony export */ eyeClosedIcon: () => (/* binding */ eyeClosedIcon),\n/* harmony export */ eyeDropperIcon: () => (/* binding */ eyeDropperIcon),\n/* harmony export */ eyeIcon: () => (/* binding */ eyeIcon),\n/* harmony export */ file: () => (/* binding */ file),\n/* harmony export */ flipHorizontal: () => (/* binding */ flipHorizontal),\n/* harmony export */ flipVertical: () => (/* binding */ flipVertical),\n/* harmony export */ fontSizeIcon: () => (/* binding */ fontSizeIcon),\n/* harmony export */ frameToolIcon: () => (/* binding */ frameToolIcon),\n/* harmony export */ fullscreenIcon: () => (/* binding */ fullscreenIcon),\n/* harmony export */ gridIcon: () => (/* binding */ gridIcon),\n/* harmony export */ handIcon: () => (/* binding */ handIcon),\n/* harmony export */ helpIcon: () => (/* binding */ helpIcon),\n/* harmony export */ iconFillColor: () => (/* binding */ iconFillColor),\n/* harmony export */ laserPointerToolIcon: () => (/* binding */ laserPointerToolIcon),\n/* harmony export */ lineEditorIcon: () => (/* binding */ lineEditorIcon),\n/* harmony export */ loginIcon: () => (/* binding */ loginIcon),\n/* harmony export */ magnetIcon: () => (/* binding */ magnetIcon),\n/* harmony export */ markerFrameIcon: () => (/* binding */ markerFrameIcon),\n/* harmony export */ menu: () => (/* binding */ menu),\n/* harmony export */ mermaidLogoIcon: () => (/* binding */ mermaidLogoIcon),\n/* harmony export */ microphoneIcon: () => (/* binding */ microphoneIcon),\n/* harmony export */ microphoneMutedIcon: () => (/* binding */ microphoneMutedIcon),\n/* harmony export */ paintIcon: () => (/* binding */ paintIcon),\n/* harmony export */ palette: () => (/* binding */ palette),\n/* harmony export */ pencilIcon: () => (/* binding */ pencilIcon),\n/* harmony export */ playerPlayIcon: () => (/* binding */ playerPlayIcon),\n/* harmony export */ playerStopFilledIcon: () => (/* binding */ playerStopFilledIcon),\n/* harmony export */ pngIcon: () => (/* binding */ pngIcon),\n/* harmony export */ polygonIcon: () => (/* binding */ polygonIcon),\n/* harmony export */ publishIcon: () => (/* binding */ publishIcon),\n/* harmony export */ questionCircle: () => (/* binding */ questionCircle),\n/* harmony export */ resetZoom: () => (/* binding */ resetZoom),\n/* harmony export */ resizeIcon: () => (/* binding */ resizeIcon),\n/* harmony export */ roundArrowIcon: () => (/* binding */ roundArrowIcon),\n/* harmony export */ save: () => (/* binding */ save),\n/* harmony export */ saveAs: () => (/* binding */ saveAs),\n/* harmony export */ searchIcon: () => (/* binding */ searchIcon),\n/* harmony export */ selectAllIcon: () => (/* binding */ selectAllIcon),\n/* harmony export */ share: () => (/* binding */ share),\n/* harmony export */ shareIOS: () => (/* binding */ shareIOS),\n/* harmony export */ shareWindows: () => (/* binding */ shareWindows),\n/* harmony export */ sharpArrowIcon: () => (/* binding */ sharpArrowIcon),\n/* harmony export */ shield: () => (/* binding */ shield),\n/* harmony export */ slashIcon: () => (/* binding */ slashIcon),\n/* harmony export */ start: () => (/* binding */ start),\n/* harmony export */ stop: () => (/* binding */ stop),\n/* harmony export */ strokeIcon: () => (/* binding */ strokeIcon),\n/* harmony export */ svgIcon: () => (/* binding */ svgIcon),\n/* harmony export */ tablerCheckIcon: () => (/* binding */ tablerCheckIcon),\n/* harmony export */ upIcon: () => (/* binding */ upIcon),\n/* harmony export */ usersIcon: () => (/* binding */ usersIcon),\n/* harmony export */ warning: () => (/* binding */ warning),\n/* harmony export */ youtubeIcon: () => (/* binding */ youtubeIcon),\n/* harmony export */ zoomAreaIcon: () => (/* binding */ zoomAreaIcon),\n/* harmony export */ zoomIn: () => (/* binding */ zoomIn),\n/* harmony export */ zoomOut: () => (/* binding */ zoomOut)\n/* harmony export */ });\n/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ \"../../node_modules/clsx/dist/clsx.m.js\");\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 react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n//\n// All icons are imported from https://fontawesome.com/icons?d=gallery\n// Icons are under the license https://fontawesome.com/license\n//\nvar __rest = undefined && undefined.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n}; // Note: when adding new icons, review https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/RTL_Guidelines\n// to determine whether or not the icons should be mirrored in right-to-left languages.\n\n\n\n\n\n\nconst iconFillColor = theme => \"var(--icon-fill-color)\";\n\nconst handlerColor = theme => theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.THEME.LIGHT ? open_color__WEBPACK_IMPORTED_MODULE_1__.white : \"#1e1e1e\";\n\nconst createIcon = (d, opts = 512) => {\n const _a = typeof opts === \"number\" ? {\n width: opts\n } : opts,\n {\n width = 512,\n height = width,\n mirror,\n style\n } = _a,\n rest = __rest(_a, [\"width\", \"height\", \"mirror\", \"style\"]);\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"svg\", Object.assign({\n \"aria-hidden\": \"true\",\n focusable: \"false\",\n role: \"img\",\n viewBox: `0 0 ${width} ${height}`,\n className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n \"rtl-mirror\": mirror\n }),\n style: style\n }, rest), typeof d === \"string\" ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fill: \"var(--icon-fill-color)\",\n d: d\n }) : d);\n};\nconst tablerIconProps = {\n width: 24,\n height: 24,\n fill: \"none\",\n strokeWidth: 2,\n stroke: \"var(--icon-fill-color)\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n};\nconst modifiedTablerIconProps = {\n width: 20,\n height: 20,\n fill: \"none\",\n stroke: \"var(--icon-fill-color)\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}; // -----------------------------------------------------------------------------\n// tabler-icons: present\n\nconst PlusPromoIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"rect\", {\n x: 3,\n y: 8,\n width: 18,\n height: 4,\n rx: 1\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: 12,\n y1: 8,\n x2: 12,\n y2: 21\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 12v7a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-7\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M7.5 8a2.5 2.5 0 0 1 0 -5a4.8 8 0 0 1 4.5 5a4.8 8 0 0 1 4.5 -5a2.5 2.5 0 0 1 0 5\"\n})), tablerIconProps); // tabler-icons: book\n\nconst LibraryIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"3\",\n y1: \"6\",\n x2: \"3\",\n y2: \"19\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"12\",\n y1: \"6\",\n x2: \"12\",\n y2: \"19\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"21\",\n y1: \"6\",\n x2: \"21\",\n y2: \"19\"\n})), tablerIconProps); // tabler-icons: plus\n\nconst PlusIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"svg\", {\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"12\",\n y1: \"5\",\n x2: \"12\",\n y2: \"19\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"5\",\n y1: \"12\",\n x2: \"19\",\n y2: \"12\"\n})), tablerIconProps); // tabler-icons: dots-vertical\n\nconst DotsIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"circle\", {\n cx: \"12\",\n cy: \"12\",\n r: \"1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"circle\", {\n cx: \"12\",\n cy: \"19\",\n r: \"1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"circle\", {\n cx: \"12\",\n cy: \"5\",\n r: \"1\"\n})), tablerIconProps); // tabler-icons: dots-horizontal (horizontal equivalent of dots-vertical)\n\nconst DotsHorizontalIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\"\n})), tablerIconProps); // tabler-icons: pinned\n\nconst PinIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"svg\", {\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M9 4v6l-2 4v2h10v-2l-2 -4v-6\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"12\",\n y1: \"16\",\n x2: \"12\",\n y2: \"21\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"8\",\n y1: \"4\",\n x2: \"16\",\n y2: \"4\"\n})), tablerIconProps);\nconst polygonIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6.5 9.5l3.5 -3\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M14 5.5l3 1.5\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M18.5 10l-2.5 7\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M13.5 17.5l-7 -5\"\n})), tablerIconProps); // tabler-icons: lock-open (via Figma)\n\nconst UnlockedIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M13.542 8.542H6.458a2.5 2.5 0 0 0-2.5 2.5v3.75a2.5 2.5 0 0 0 2.5 2.5h7.084a2.5 2.5 0 0 0 2.5-2.5v-3.75a2.5 2.5 0 0 0-2.5-2.5Z\",\n stroke: \"var(--icon-fill-color)\" //zsviczian\n ,\n strokeWidth: \"1.25\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10 13.958a1.042 1.042 0 1 0 0-2.083 1.042 1.042 0 0 0 0 2.083Z\",\n stroke: \"var(--icon-fill-color)\" //zsviczian\n ,\n strokeWidth: \"1.25\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"mask\", {\n id: \"UnlockedIcon\",\n style: {\n maskType: \"alpha\"\n },\n maskUnits: \"userSpaceOnUse\",\n x: 6,\n y: 1,\n width: 9,\n height: 9\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M6.399 9.561V5.175c0-.93.401-1.823 1.116-2.48a3.981 3.981 0 0 1 2.693-1.028c1.01 0 1.98.37 2.694 1.027.715.658 1.116 1.55 1.116 2.481\",\n fill: \"#fff\"\n})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n mask: \"url(#UnlockedIcon)\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M5.149 9.561v1.25h2.5v-1.25h-2.5Zm5.06-7.894V.417v1.25Zm2.559 3.508v1.25h2.5v-1.25h-2.5ZM7.648 8.51V5.175h-2.5V8.51h2.5Zm0-3.334c0-.564.243-1.128.713-1.561L6.668 1.775c-.959.883-1.52 2.104-1.52 3.4h2.5Zm.713-1.561a2.732 2.732 0 0 1 1.847-.697v-2.5c-1.31 0-2.585.478-3.54 1.358L8.36 3.614Zm1.847-.697c.71 0 1.374.26 1.847.697l1.694-1.839a5.231 5.231 0 0 0-3.54-1.358v2.5Zm1.847.697c.47.433.713.997.713 1.561h2.5c0-1.296-.56-2.517-1.52-3.4l-1.693 1.839Z\",\n fill: \"var(--icon-fill-color)\" //zsviczian\n\n}))), modifiedTablerIconProps); // tabler-icons: lock (via Figma)\n\nconst LockedIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M13.542 8.542H6.458a2.5 2.5 0 0 0-2.5 2.5v3.75a2.5 2.5 0 0 0 2.5 2.5h7.084a2.5 2.5 0 0 0 2.5-2.5v-3.75a2.5 2.5 0 0 0-2.5-2.5Z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10 13.958a1.042 1.042 0 1 0 0-2.083 1.042 1.042 0 0 0 0 2.083Z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6.667 8.333V5.417C6.667 3.806 8.159 2.5 10 2.5c1.841 0 3.333 1.306 3.333 2.917v2.916\"\n})), modifiedTablerIconProps);\nconst LockedIconFilled = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n fill: \"currentColor\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 2a5 5 0 0 1 5 5v3a3 3 0 0 1 3 3v6a3 3 0 0 1 -3 3h-10a3 3 0 0 1 -3 -3v-6a3 3 0 0 1 3 -3v-3a5 5 0 0 1 5 -5m0 12a2 2 0 0 0 -1.995 1.85l-.005 .15a2 2 0 1 0 2 -2m0 -10a3 3 0 0 0 -3 3v3h6v-3a3 3 0 0 0 -3 -3\"\n})), {\n width: 24,\n height: 24\n}); // custom\n\nconst WelcomeScreenMenuArrow = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M38.5 83.5c-14-2-17.833-10.473-21-22.5C14.333 48.984 12 22 12 12.5\",\n stroke: \"var(--icon-fill-color)\" //zsviczian\n ,\n strokeWidth: 2,\n strokeLinecap: \"round\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"m12.005 10.478 7.905 14.423L6 25.75l6.005-15.273Z\",\n fill: \"var(--icon-fill-color)\" //zsviczian\n\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12.005 10.478c1.92 3.495 3.838 7 7.905 14.423m-7.905-14.423c3.11 5.683 6.23 11.368 7.905 14.423m0 0c-3.68.226-7.35.455-13.91.85m13.91-.85c-5.279.33-10.566.647-13.91.85m0 0c1.936-4.931 3.882-9.86 6.005-15.273M6 25.75c2.069-5.257 4.135-10.505 6.005-15.272\",\n stroke: \"var(--icon-fill-color)\" //zsviczian\n ,\n strokeWidth: 2,\n strokeLinecap: \"round\"\n})), {\n width: 41,\n height: 94,\n fill: \"none\"\n}); // custom\n\nconst WelcomeScreenHelpArrow = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M18.026 1.232c-5.268 13.125-5.548 33.555 3.285 42.311 8.823 8.75 33.31 12.304 42.422 13.523\",\n stroke: \"var(--icon-fill-color)\" //zsviczian\n ,\n strokeWidth: 2,\n strokeLinecap: \"round\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"m72.181 59.247-13.058-10-2.948 13.62 16.006-3.62Z\",\n fill: \"var(--icon-fill-color)\" //zsviczian\n\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M72.181 59.247c-3.163-2.429-6.337-4.856-13.058-10m13.058 10c-5.145-3.936-10.292-7.882-13.058-10m0 0c-.78 3.603-1.563 7.196-2.948 13.62m2.948-13.62c-1.126 5.168-2.24 10.346-2.948 13.62m0 0c5.168-1.166 10.334-2.343 16.006-3.62m-16.006 3.62c5.51-1.248 11.01-2.495 16.006-3.62\",\n stroke: \"var(--icon-fill-color)\" //zsviczian\n ,\n strokeWidth: 2,\n strokeLinecap: \"round\"\n})), {\n width: 85,\n height: 71,\n fill: \"none\"\n}); // custom\n\nconst WelcomeScreenTopToolbarArrow = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M1 77c14-2 31.833-11.973 35-24 3.167-12.016-6-35-9.5-43.5\",\n stroke: \"var(--icon-fill-color)\" //zsviczian\n ,\n strokeWidth: 2,\n strokeLinecap: \"round\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"m24.165 1.093-2.132 16.309 13.27-4.258-11.138-12.05Z\",\n fill: \"var(--icon-fill-color)\" //zsviczian\n\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M24.165 1.093c-.522 3.953-1.037 7.916-2.132 16.309m2.131-16.309c-.835 6.424-1.68 12.854-2.13 16.308m0 0c3.51-1.125 7.013-2.243 13.27-4.257m-13.27 4.257c5.038-1.608 10.08-3.232 13.27-4.257m0 0c-3.595-3.892-7.197-7.777-11.14-12.05m11.14 12.05c-3.837-4.148-7.667-8.287-11.14-12.05\",\n stroke: \"var(--icon-fill-color)\" //zsviczian\n ,\n strokeWidth: 2,\n strokeLinecap: \"round\"\n})), {\n width: 38,\n height: 78,\n fill: \"none\"\n}); // custom\n\nconst ExcalLogo = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n fill: \"--icon-fill-color\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M39.9 32.889a.326.326 0 0 0-.279-.056c-2.094-3.083-4.774-6-7.343-8.833l-.419-.472a.212.212 0 0 0-.056-.139.586.586 0 0 0-.167-.111l-.084-.083-.056-.056c-.084-.167-.28-.278-.475-.167-.782.39-1.507.973-2.206 1.528-.92.722-1.842 1.445-2.708 2.25a8.405 8.405 0 0 0-.977 1.028c-.14.194-.028.361.14.444-.615.611-1.23 1.223-1.843 1.861a.315.315 0 0 0-.084.223c0 .083.056.166.111.194l1.09.833v.028c1.535 1.528 4.244 3.611 7.12 5.861.418.334.865.667 1.284 1 .195.223.39.473.558.695.084.11.28.139.391.055.056.056.14.111.196.167a.398.398 0 0 0 .167.056.255.255 0 0 0 .224-.111.394.394 0 0 0 .055-.167c.029 0 .028.028.056.028a.318.318 0 0 0 .224-.084l5.082-5.528a.309.309 0 0 0 0-.444Zm-14.63-1.917a.485.485 0 0 0 .111.14c.586.5 1.2 1 1.843 1.555l-2.569-1.945-.251-.166c-.056-.028-.112-.084-.168-.111l-.195-.167.056-.056.055-.055.112-.111c.866-.861 2.346-2.306 3.1-3.028-.81.805-2.43 3.167-2.095 3.944Zm8.767 6.89-2.122-1.612a44.713 44.713 0 0 0-2.625-2.5c1.145.861 2.122 1.611 2.262 1.75 1.117.972 1.06.806 1.815 1.445l.921.666a1.06 1.06 0 0 1-.251.25Zm.558.416-.056-.028c.084-.055.168-.111.252-.194l-.196.222ZM1.089 5.75c.055.361.14.722.195 1.056.335 1.833.67 3.5 1.284 4.75l.252.944c.084.361.223.806.363.917 1.424 1.25 3.602 3.11 5.947 4.889a.295.295 0 0 0 .363 0s0 .027.028.027a.254.254 0 0 0 .196.084.318.318 0 0 0 .223-.084c2.988-3.305 5.221-6.027 6.813-8.305.112-.111.14-.278.14-.417.111-.111.195-.25.307-.333.111-.111.111-.306 0-.39l-.028-.027c0-.055-.028-.139-.084-.167-.698-.666-1.2-1.138-1.731-1.638-.922-.862-1.871-1.75-3.881-3.75l-.028-.028c-.028-.028-.056-.056-.112-.056-.558-.194-1.703-.389-3.127-.639C6.087 2.223 3.21 1.723.614.944c0 0-.168 0-.196.028l-.083.084c-.028.027-.056.055-.224.11h.056-.056c.028.167.028.278.084.473 0 .055.112.5.112.555l.782 3.556Zm15.496 3.278-.335-.334c.084.112.196.195.335.334Zm-3.546 4.666-.056.056c0-.028.028-.056.056-.056Zm-2.038-10c.168.167.866.834 1.033.973-.726-.334-2.54-1.167-3.379-1.445.838.167 1.983.334 2.346.472ZM1.424 2.306c.419.722.754 3.222 1.089 5.666-.196-.778-.335-1.555-.503-2.278-.251-1.277-.503-2.416-.838-3.416.056 0 .14 0 .252.028Zm-.168-.584c-.112 0-.223-.028-.307-.028 0-.027 0-.055-.028-.055.14 0 .223.028.335.083Zm-1.089.222c0-.027 0-.027 0 0ZM39.453 1.333c.028-.11-.558-.61-.363-.639.42-.027.42-.666 0-.666-.558.028-1.144.166-1.675.25-.977.194-1.982.389-2.96.61-2.205.473-4.383.973-6.561 1.557-.67.194-1.424.333-2.066.666-.224.111-.196.333-.084.472-.056.028-.084.028-.14.056-.195.028-.363.056-.558.083-.168.028-.252.167-.224.334 0 .027.028.083.028.11-1.173 1.556-2.485 3.195-3.909 4.945-1.396 1.611-2.876 3.306-4.356 5.056-4.719 5.5-10.052 11.75-15.943 17.25a.268.268 0 0 0 0 .389c.028.027.056.055.084.055-.084.084-.168.14-.252.222-.056.056-.084.111-.084.167a.605.605 0 0 0-.111.139c-.112.111-.112.305.028.389.111.11.307.11.39-.028.029-.028.029-.056.056-.056a.44.44 0 0 1 .615 0c.335.362.67.723.977 1.028l-.698-.583c-.112-.111-.307-.083-.39.028-.113.11-.085.305.027.389l7.427 6.194c.056.056.112.056.196.056s.14-.028.195-.084l.168-.166c.028.027.083.027.111.027.084 0 .14-.027.196-.083 10.052-10.055 18.15-17.639 27.42-24.417.083-.055.111-.166.111-.25.112 0 .196-.083.251-.194 1.704-5.194 2.039-9.806 2.15-12.083v-.028c0-.028.028-.056.028-.083.028-.056.028-.084.028-.084a1.626 1.626 0 0 0-.111-1.028ZM21.472 9.5c.446-.5.893-1.028 1.34-1.5-2.876 3.778-7.65 9.583-14.408 16.5 4.607-5.083 9.242-10.333 13.068-15ZM5.193 35.778h.084-.084Zm3.462 3.194c-.027-.028-.027-.028 0-.028v.028Zm4.16-3.583c.224-.25.448-.472.699-.722 0 0 0 .027.028.027-.252.223-.475.445-.726.695Zm1.146-1.111c.14-.14.279-.334.446-.5l.028-.028c1.648-1.694 3.351-3.389 5.082-5.111l.028-.028c.419-.333.921-.694 1.368-1.028a379.003 379.003 0 0 0-6.952 6.695ZM24.794 6.472c-.921 1.195-1.954 2.778-2.82 4.028-2.736 3.944-11.532 13.583-11.727 13.75a1976.983 1976.983 0 0 1-8.042 7.639l-.167.167c-.14-.167-.14-.417.028-.556C14.49 19.861 22.03 10.167 25.074 5.917c-.084.194-.14.36-.28.555Zm4.83 5.695c-1.116-.64-1.646-1.64-1.34-2.611l.084-.334c.028-.083.084-.194.14-.277.307-.5.754-.917 1.257-1.167.027 0 .055 0 .083-.028-.028-.056-.028-.139-.028-.222.028-.167.14-.278.335-.278.335 0 1.369.306 1.76.639.111.083.223.194.335.305.14.167.363.445.474.667.056.028.112.306.196.445.056.222.111.472.084.694-.028.028 0 .194-.028.194a2.668 2.668 0 0 1-.363 1.028c-.028.028-.028.056-.056.084l-.028.027c-.14.223-.335.417-.53.556-.643.444-1.369.583-2.095.389 0 0-.195-.084-.28-.111Zm8.154-.834a39.098 39.098 0 0 1-.893 3.167c0 .028-.028.083 0 .111-.056 0-.084.028-.14.056-2.206 1.61-4.356 3.305-6.506 5.028 1.843-1.64 3.686-3.306 5.613-4.945.558-.5.949-1.139 1.06-1.861l.28-1.667v-.055c.14-.334.67-.195.586.166Z\",\n fill: \"--icon-fill-color\"\n})), {\n width: 40,\n height: 40,\n fill: \"none\"\n}); // custom\n\nconst SelectionIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"var(--icon-fill-color)\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6 6l4.153 11.793a0.365 .365 0 0 0 .331 .207a0.366 .366 0 0 0 .332 -.207l2.184 -4.793l4.787 -1.994a0.355 .355 0 0 0 .213 -.323a0.355 .355 0 0 0 -.213 -.323l-11.787 -4.36z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M13.5 13.5l4.5 4.5\"\n})), {\n fill: \"none\",\n width: 22,\n height: 22,\n strokeWidth: 1.25\n});\nconst LassoIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n strokeWidth: 1.5\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4.028 13.252c-.657 -.972 -1.028 -2.078 -1.028 -3.252c0 -3.866 4.03 -7 9 -7s9 3.134 9 7s-4.03 7 -9 7c-1.913 0 -3.686 -.464 -5.144 -1.255\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 15m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 17c0 1.42 .316 2.805 1 4\"\n})), {\n fill: \"none\",\n width: 22,\n height: 22,\n strokeWidth: 1.25\n}); // tabler-icons: square\n\nconst RectangleIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"rect\", {\n x: \"4\",\n y: \"4\",\n width: \"16\",\n height: \"16\",\n rx: \"2\"\n})), tablerIconProps); // tabler-icons: square-rotated\n\nconst DiamondIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10.5 20.4l-6.9 -6.9c-.781 -.781 -.781 -2.219 0 -3l6.9 -6.9c.781 -.781 2.219 -.781 3 0l6.9 6.9c.781 .781 .781 2.219 0 3l-6.9 6.9c-.781 .781 -2.219 .781 -3 0z\"\n})), tablerIconProps); // tabler-icons: circle\n\nconst EllipseIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"circle\", {\n cx: \"12\",\n cy: \"12\",\n r: \"9\"\n})), tablerIconProps); // tabler-icons: arrow-narrow-right\n\nconst ArrowIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"5\",\n y1: \"12\",\n x2: \"19\",\n y2: \"12\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"15\",\n y1: \"16\",\n x2: \"19\",\n y2: \"12\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"15\",\n y1: \"8\",\n x2: \"19\",\n y2: \"12\"\n})), tablerIconProps); // custom?\n\nconst LineIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4.167 10h11.666\",\n strokeWidth: \"1.5\"\n}), modifiedTablerIconProps);\nconst PenModeIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M20 17v-12c0 -1.121 -.879 -2 -2 -2s-2 .879 -2 2v12l2 2l2 -2z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16 7h4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M18 19h-13a2 2 0 1 1 0 -4h4a2 2 0 1 0 0 -4h-3\"\n})), tablerIconProps); // modified tabler-icons: pencil\n\nconst FreedrawIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n clipRule: \"evenodd\",\n d: \"m7.643 15.69 7.774-7.773a2.357 2.357 0 1 0-3.334-3.334L4.31 12.357a3.333 3.333 0 0 0-.977 2.357v1.953h1.953c.884 0 1.732-.352 2.357-.977Z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"m11.25 5.417 3.333 3.333\"\n})), modifiedTablerIconProps); // tabler-icons: typography\n\nconst TextIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"4\",\n y1: \"20\",\n x2: \"7\",\n y2: \"20\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"14\",\n y1: \"20\",\n x2: \"21\",\n y2: \"20\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"6.9\",\n y1: \"15\",\n x2: \"13.8\",\n y2: \"15\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"10.2\",\n y1: \"6.3\",\n x2: \"16\",\n y2: \"20\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"polyline\", {\n points: \"5 20 11 4 13 4 20 20\"\n})), tablerIconProps);\nconst TextSizeIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\",\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 7v-2h13v2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10 5v14\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 19h-4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15 13v-1h6v1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M18 12v7\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M17 19h2\"\n})), tablerIconProps); // modified tabler-icons: photo\n\nconst ImageIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12.5 6.667h.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4.91 2.625h10.18a2.284 2.284 0 0 1 2.285 2.284v10.182a2.284 2.284 0 0 1-2.284 2.284H4.909a2.284 2.284 0 0 1-2.284-2.284V4.909a2.284 2.284 0 0 1 2.284-2.284Z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"m3.333 12.5 3.334-3.333c.773-.745 1.726-.745 2.5 0l4.166 4.166\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"m11.667 11.667.833-.834c.774-.744 1.726-.744 2.5 0l1.667 1.667\"\n})), modifiedTablerIconProps); // tabler-icons: eraser\n\nconst EraserIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 20h-10.5l-4.21 -4.3a1 1 0 0 1 0 -1.41l10 -10a1 1 0 0 1 1.41 0l5 5a1 1 0 0 1 0 1.41l-9.2 9.3\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M18 13.3l-6.3 -6.3\"\n})), tablerIconProps);\nconst ZoomInIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n strokeWidth: \"1.25\",\n d: \"M10 4.167v11.666M4.167 10h11.666\"\n}), modifiedTablerIconProps);\nconst ZoomOutIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 10h10\",\n strokeWidth: \"1.25\"\n}), modifiedTablerIconProps);\nconst ZoomResetIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M21 21l-6 -6\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3.268 12.043a7.017 7.017 0 0 0 6.634 4.957a7.012 7.012 0 0 0 7.043 -6.131a7 7 0 0 0 -5.314 -7.672a7.021 7.021 0 0 0 -8.241 4.403\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 4v4h4\"\n})), tablerIconProps);\nconst TrashIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n strokeWidth: \"1.25\",\n d: \"M3.333 5.833h13.334M8.333 9.167v5M11.667 9.167v5M4.167 5.833l.833 10c0 .92.746 1.667 1.667 1.667h6.666c.92 0 1.667-.746 1.667-1.667l.833-10M7.5 5.833v-2.5c0-.46.373-.833.833-.833h3.334c.46 0 .833.373.833.833v2.5\"\n}), modifiedTablerIconProps);\nconst EmbedIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"polyline\", {\n points: \"12 16 18 10 12 4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"polyline\", {\n points: \"8 4 2 10 8 16\"\n})), modifiedTablerIconProps);\nconst DuplicateIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M14.375 6.458H8.958a2.5 2.5 0 0 0-2.5 2.5v5.417a2.5 2.5 0 0 0 2.5 2.5h5.417a2.5 2.5 0 0 0 2.5-2.5V8.958a2.5 2.5 0 0 0-2.5-2.5Z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n clipRule: \"evenodd\",\n d: \"M11.667 3.125c.517 0 .986.21 1.325.55.34.338.55.807.55 1.325v1.458H8.333c-.485 0-.927.185-1.26.487-.343.312-.57.75-.609 1.24l-.005 5.357H5a1.87 1.87 0 0 1-1.326-.55 1.87 1.87 0 0 1-.549-1.325V5c0-.518.21-.987.55-1.326.338-.34.807-.549 1.325-.549h6.667Z\"\n})), modifiedTablerIconProps);\nconst MoonIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n clipRule: \"evenodd\",\n d: \"M10 2.5h.328a6.25 6.25 0 0 0 6.6 10.372A7.5 7.5 0 1 1 10 2.493V2.5Z\",\n stroke: \"var(--icon-fill-color)\" //zsviczian\n\n}), modifiedTablerIconProps);\nconst SunIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"var(--icon-fill-color)\" //zsviczian\n ,\n strokeLinejoin: \"round\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM10 4.167V2.5M14.167 5.833l1.166-1.166M15.833 10H17.5M14.167 14.167l1.166 1.166M10 15.833V17.5M5.833 14.167l-1.166 1.166M5 10H3.333M5.833 5.833 4.667 4.667\"\n})), Object.assign(Object.assign({}, modifiedTablerIconProps), {\n strokeWidth: 1.5\n}));\nconst HamburgerMenuIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"4\",\n y1: \"6\",\n x2: \"20\",\n y2: \"6\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"4\",\n y1: \"12\",\n x2: \"20\",\n y2: \"12\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"4\",\n y1: \"18\",\n x2: \"20\",\n y2: \"18\"\n})), tablerIconProps);\nconst ExportIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n strokeWidth: \"1.25\",\n d: \"M3.333 14.167v1.666c0 .92.747 1.667 1.667 1.667h10c.92 0 1.667-.746 1.667-1.667v-1.666M5.833 9.167 10 13.333l4.167-4.166M10 3.333v10\"\n}), modifiedTablerIconProps);\nconst HelpIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"circle\", {\n cx: \"12\",\n cy: \"12\",\n r: \"9\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"12\",\n y1: \"17\",\n x2: \"12\",\n y2: \"17.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4\"\n})), tablerIconProps);\nconst HelpIconThin = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"circle\", {\n cx: \"12\",\n cy: \"12\",\n r: \"9\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"12\",\n y1: \"17\",\n x2: \"12\",\n y2: \"17.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4\"\n})), tablerIconProps);\nconst ExternalLinkIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n strokeWidth: \"1.25\",\n d: \"M9.167 5.833H5.833c-1.254 0-2.5 1.282-2.5 2.5v5.834c0 1.283 1.252 2.5 2.5 2.5h5.834c1.251 0 2.5-1.25 2.5-2.5v-3.334M8.333 11.667l8.334-8.334M12.5 3.333h4.167V7.5\"\n}), modifiedTablerIconProps);\nconst GithubIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M7.5 15.833c-3.583 1.167-3.583-2.083-5-2.5m10 4.167v-2.917c0-.833.083-1.166-.417-1.666 2.334-.25 4.584-1.167 4.584-5a3.833 3.833 0 0 0-1.084-2.667 3.5 3.5 0 0 0-.083-2.667s-.917-.25-2.917 1.084a10.25 10.25 0 0 0-5.166 0C5.417 2.333 4.5 2.583 4.5 2.583a3.5 3.5 0 0 0-.083 2.667 3.833 3.833 0 0 0-1.084 2.667c0 3.833 2.25 4.75 4.584 5-.5.5-.5 1-.417 1.666V17.5\",\n strokeWidth: \"1.25\"\n}), modifiedTablerIconProps);\nconst DiscordIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M7.5 10.833a.833.833 0 1 0 0-1.666.833.833 0 0 0 0 1.666ZM12.5 10.833a.833.833 0 1 0 0-1.666.833.833 0 0 0 0 1.666ZM6.25 6.25c2.917-.833 4.583-.833 7.5 0M5.833 13.75c2.917.833 5.417.833 8.334 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12.917 14.167c0 .833 1.25 2.5 1.666 2.5 1.25 0 2.361-1.39 2.917-2.5.556-1.39.417-4.861-1.25-9.584-1.214-.846-2.5-1.116-3.75-1.25l-.833 2.084M7.083 14.167c0 .833-1.13 2.5-1.526 2.5-1.191 0-2.249-1.39-2.778-2.5-.529-1.39-.397-4.861 1.19-9.584 1.157-.846 2.318-1.116 3.531-1.25l.833 2.084\"\n})), modifiedTablerIconProps);\nconst XBrandIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 4l11.733 16h4.267l-11.733 -16z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772\"\n})), tablerIconProps);\nconst checkIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"polyline\", {\n fill: \"none\",\n stroke: \"var(--icon-fill-color)\",\n points: \"20 6 9 17 4 12\"\n}), {\n width: 24,\n height: 24\n});\nconst LinkIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8.333 11.667a2.917 2.917 0 0 0 4.167 0l3.333-3.334a2.946 2.946 0 1 0-4.166-4.166l-.417.416\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M11.667 8.333a2.917 2.917 0 0 0-4.167 0l-3.333 3.334a2.946 2.946 0 0 0 4.166 4.166l.417-.416\"\n})), modifiedTablerIconProps);\nconst save = createIcon(\"M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z\", {\n width: 448,\n height: 512\n});\nconst saveAs = createIcon(\"M252 54L203 8a28 27 0 00-20-8H28C12 0 0 12 0 27v195c0 15 12 26 28 26h204c15 0 28-11 28-26V73a28 27 0 00-8-19zM130 213c-21 0-37-16-37-36 0-19 16-35 37-35 20 0 37 16 37 35 0 20-17 36-37 36zm56-169v56c0 4-4 6-7 6H44c-4 0-7-2-7-6V42c0-4 3-7 7-7h133l4 2 3 2a7 7 0 012 5z M296 201l87 95-188 205-78 9c-10 1-19-8-18-20l9-84zm141-14l-41-44a31 31 0 00-46 0l-38 41 87 95 38-42c13-14 13-36 0-50z\", {\n width: 448,\n height: 512\n}); // tabler-icon: folder\n\nconst LoadIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"m9.257 6.351.183.183H15.819c.34 0 .727.182 1.051.506.323.323.505.708.505 1.05v5.819c0 .316-.183.7-.52 1.035-.337.338-.723.522-1.037.522H4.182c-.352 0-.74-.181-1.058-.5-.318-.318-.499-.705-.499-1.057V5.182c0-.351.181-.736.5-1.054.32-.321.71-.503 1.057-.503H6.53l2.726 2.726Z\",\n strokeWidth: \"1.25\"\n}), modifiedTablerIconProps);\nconst clipboard = createIcon(\"M384 112v352c0 26.51-21.49 48-48 48H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h80c0-35.29 28.71-64 64-64s64 28.71 64 64h80c26.51 0 48 21.49 48 48zM192 40c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24m96 114v-20a6 6 0 0 0-6-6H102a6 6 0 0 0-6 6v20a6 6 0 0 0 6 6h180a6 6 0 0 0 6-6z\", {\n width: 384,\n height: 512\n});\nconst palette = createIcon(\"M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z\");\nconst bucketFillIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 16l1.465 1.638a2 2 0 1 1 -3.015 .099l1.55 -1.737z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M13.737 9.737c2.299 -2.3 3.23 -5.095 2.081 -6.245c-1.15 -1.15 -3.945 -.217 -6.244 2.082c-2.3 2.299 -3.231 5.095 -2.082 6.244c1.15 1.15 3.946 .218 6.245 -2.081z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M7.492 11.818c.362 .362 .768 .676 1.208 .934l6.895 4.047c1.078 .557 2.255 -.075 3.692 -1.512c1.437 -1.437 2.07 -2.614 1.512 -3.692c-.372 -.718 -1.72 -3.017 -4.047 -6.895a6.015 6.015 0 0 0 -.934 -1.208\"\n})), tablerIconProps); // simple / icon\n\nconst slashIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.5\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6 18l12 -12\"\n})), tablerIconProps);\nconst ExportImageIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15 8h.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 20h-5a3 3 0 0 1 -3 -3v-10a3 3 0 0 1 3 -3h10a3 3 0 0 1 3 3v5\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 15l4 -4c.928 -.893 2.072 -.893 3 0l4 4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M14 14l1 -1c.617 -.593 1.328 -.793 2.009 -.598\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 16v6\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M22 19l-3 3l-3 -3\"\n})), tablerIconProps);\nconst exportToFileIcon = createIcon(\"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z\", {\n width: 512,\n height: 512\n});\nconst zoomIn = createIcon(\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\", {\n width: 448,\n height: 512\n});\nconst zoomOut = createIcon(\"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\", {\n width: 448,\n height: 512\n});\nconst done = createIcon(\"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z\");\nconst menu = createIcon(\"M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z\");\nconst UndoIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M7.5 10.833 4.167 7.5 7.5 4.167M4.167 7.5h9.166a3.333 3.333 0 0 1 0 6.667H12.5\",\n strokeWidth: \"1.25\"\n}), modifiedTablerIconProps);\nconst RedoIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12.5 10.833 15.833 7.5 12.5 4.167M15.833 7.5H6.667a3.333 3.333 0 1 0 0 6.667H7.5\",\n strokeWidth: \"1.25\"\n}), modifiedTablerIconProps);\nconst questionCircle = createIcon(\"M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zM262.655 90c-54.497 0-89.255 22.957-116.549 63.758-3.536 5.286-2.353 12.415 2.715 16.258l34.699 26.31c5.205 3.947 12.621 3.008 16.665-2.122 17.864-22.658 30.113-35.797 57.303-35.797 20.429 0 45.698 13.148 45.698 32.958 0 14.976-12.363 22.667-32.534 33.976C247.128 238.528 216 254.941 216 296v4c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12v-1.333c0-28.462 83.186-29.647 83.186-106.667 0-58.002-60.165-102-116.531-102zM256 338c-25.365 0-46 20.635-46 46 0 25.364 20.635 46 46 46s46-20.636 46-46c0-25.365-20.635-46-46-46z\", {\n mirror: true\n});\nconst share = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM15 7.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM15 17.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM7.25 8.917l5.5-2.834M7.25 11.083l5.5 2.834\",\n strokeWidth: \"1.5\"\n}), modifiedTablerIconProps);\nconst warning = createIcon(\"M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z\");\nconst shareIOS = createIcon(\"M16 5l-1.42 1.42-1.59-1.59V16h-1.98V4.83L9.42 6.42 8 5l4-4 4 4zm4 5v11c0 1.1-.9 2-2 2H6c-1.11 0-2-.9-2-2V10c0-1.11.89-2 2-2h3v2H6v11h12V10h-3V8h3c1.1 0 2 .89 2 2z\", {\n width: 24,\n height: 24\n});\nconst exportToPlus = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 9h-1a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-8a2 2 0 0 0 -2 -2h-1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 14v-11\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M9 6l3 -3l3 3\"\n})), tablerIconProps);\nconst shareWindows = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fill: \"var(--icon-fill-color)\" //zsviczian\n ,\n d: \"M40 5.6v6.1l-4.1.7c-8.9 1.4-16.5 6.9-20.6 15C13 32 10.9 43 12.4 43c.4 0 2.4-1.3 4.4-3 5-3.9 12.1-7 18.2-7.7l5-.6v12.8l11.2-11.3L62.5 22 51.2 10.8 40-.5v6.1zm10.2 22.6L44 34.5v-6.8l-6.9.6c-3.9.3-9.8 1.7-13.2 3.1-3.5 1.4-6.5 2.4-6.7 2.2-.9-1 3-7.5 6.4-10.8C28 18.6 34.4 16 40.1 16c3.7 0 3.9-.1 3.9-3.2V9.5l6.2 6.3 6.3 6.2-6.3 6.2z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"var(--icon-fill-color)\" //zsviczian\n ,\n fill: \"var(--icon-fill-color)\" //zsviczian\n ,\n d: \"M0 36v20h48v-6.2c0-6 0-6.1-2-4.3-1.1 1-2 2.9-2 4.2V52H4V34c0-17.3-.1-18-2-18s-2 .7-2 20z\"\n})), {\n width: 64,\n height: 64\n}); // Icon imported form Storybook\n// Storybook is licensed under MIT https://github.com/storybookjs/storybook/blob/next/LICENSE\n\nconst resetZoom = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"var(--icon-fill-color)\" //zsviczian\n ,\n strokeWidth: \"40\",\n fill: \"var(--icon-fill-color)\" //zsviczian\n ,\n d: \"M148 560a318 318 0 0 0 522 110 316 316 0 0 0 0-450 316 316 0 0 0-450 0c-11 11-21 22-30 34v4h47c25 0 46 21 46 46s-21 45-46 45H90c-13 0-25-6-33-14-9-9-14-20-14-33V156c0-25 20-45 45-45s45 20 45 45v32l1 1a401 401 0 0 1 623 509l212 212a42 42 0 0 1-59 59L698 757A401 401 0 0 1 65 570a42 42 0 0 1 83-10z\"\n}), {\n width: 1024\n});\nconst arrowBarToTopJSX = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.5\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 10l0 10\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 10l4 4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 10l-4 4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 4l16 0\"\n}));\nconst arrownNarrowUpJSX = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.5\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 5l0 14\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16 9l-4 -4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 9l4 -4\"\n}));\nconst BringForwardIcon = createIcon(arrownNarrowUpJSX, tablerIconProps);\nconst SendBackwardIcon = createIcon(arrownNarrowUpJSX, Object.assign(Object.assign({}, tablerIconProps), {\n style: {\n transform: \"rotate(180deg)\"\n }\n}));\nconst BringToFrontIcon = createIcon(arrowBarToTopJSX, tablerIconProps);\nconst SendToBackIcon = createIcon(arrowBarToTopJSX, Object.assign(Object.assign({}, tablerIconProps), {\n style: {\n transform: \"rotate(180deg)\"\n }\n})); //\n// Align action icons created from scratch to match those of z-index actions\n// Note: vertical align icons are flipped so the larger item is always the\n// first one the user sees. Horizontal align icons should not be flipped since\n// that would make them lie about their function.\n//\n\nconst AlignTopIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n clipPath: \"url(#a)\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3.333 3.333h13.334\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M13.542 6.458h-.417c-.92 0-1.667.747-1.667 1.667v7.083c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667V8.125c0-.92-.746-1.667-1.666-1.667ZM6.875 6.458h-.417c-.92 0-1.666.747-1.666 1.667v3.75c0 .92.746 1.667 1.666 1.667h.417c.92 0 1.667-.746 1.667-1.667v-3.75c0-.92-.747-1.667-1.667-1.667Z\"\n})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"clipPath\", {\n id: \"a\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fill: \"#fff\",\n d: \"M0 0h20v20H0z\"\n})))), modifiedTablerIconProps);\nconst AlignBottomIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n clipPath: \"url(#a)\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3.333 16.667h13.334\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6.875 3.125h-.417c-.92 0-1.666.746-1.666 1.667v7.083c0 .92.746 1.667 1.666 1.667h.417c.92 0 1.667-.746 1.667-1.667V4.792c0-.92-.747-1.667-1.667-1.667ZM13.542 5.817h-.417c-.92 0-1.667.747-1.667 1.667v4.391c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667V7.484c0-.92-.746-1.667-1.666-1.667Z\"\n})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"clipPath\", {\n id: \"a\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fill: \"#fff\",\n d: \"M0 0h20v20H0z\"\n})))), modifiedTablerIconProps);\nconst AlignLeftIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n clipPath: \"url(#a)\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3.333 3.333v13.334\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15.208 4.792H8.125c-.92 0-1.667.746-1.667 1.666v.417c0 .92.747 1.667 1.667 1.667h7.083c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666ZM12.516 11.458H8.125c-.92 0-1.667.746-1.667 1.667v.417c0 .92.747 1.666 1.667 1.666h4.391c.92 0 1.667-.746 1.667-1.666v-.417c0-.92-.746-1.667-1.667-1.667Z\"\n})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"clipPath\", {\n id: \"a\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fill: \"#fff\",\n d: \"M0 0h20v20H0z\"\n})))), modifiedTablerIconProps);\nconst AlignRightIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n clipPath: \"url(#a)\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16.667 3.333v13.334\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M11.875 4.792H4.792c-.92 0-1.667.746-1.667 1.666v.417c0 .92.746 1.667 1.667 1.667h7.083c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666ZM11.683 11.458H7.292c-.92 0-1.667.746-1.667 1.667v.417c0 .92.746 1.666 1.667 1.666h4.39c.921 0 1.667-.746 1.667-1.666v-.417c0-.92-.746-1.667-1.666-1.667Z\"\n})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"clipPath\", {\n id: \"a\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fill: \"#fff\",\n d: \"M0 0h20v20H0z\"\n})))), modifiedTablerIconProps);\nconst DistributeHorizontallyIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n clipPath: \"url(#a)\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16.667 3.333v13.334M3.333 3.333v13.334\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M14.375 10.208v-.416c0-.92-.746-1.667-1.667-1.667H7.292c-.92 0-1.667.746-1.667 1.667v.416c0 .92.746 1.667 1.667 1.667h5.416c.92 0 1.667-.746 1.667-1.667Z\"\n})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"clipPath\", {\n id: \"a\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fill: \"#fff\",\n d: \"M0 0h20v20H0z\"\n})))), modifiedTablerIconProps);\nconst DistributeVerticallyIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n clipPath: \"url(#a)\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3.333 3.333h13.334M3.333 16.667h13.334\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10.208 5.625h-.416c-.92 0-1.667.746-1.667 1.667v5.416c0 .92.746 1.667 1.667 1.667h.416c.92 0 1.667-.746 1.667-1.667V7.292c0-.92-.746-1.667-1.667-1.667Z\"\n})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"clipPath\", {\n id: \"a\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fill: \"#fff\",\n d: \"M0 0h20v20H0z\"\n})))), modifiedTablerIconProps);\nconst CenterVerticallyIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M1.667 10h2.916\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8.333 10h3.334\",\n strokeLinejoin: \"round\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15.417 10h2.916\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6.875 4.792h-.417c-.92 0-1.666.746-1.666 1.666v7.084c0 .92.746 1.666 1.666 1.666h.417c.92 0 1.667-.746 1.667-1.666V6.458c0-.92-.747-1.666-1.667-1.666ZM13.542 6.458h-.417c-.92 0-1.667.747-1.667 1.667v3.75c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667v-3.75c0-.92-.746-1.667-1.666-1.667Z\"\n})), modifiedTablerIconProps);\nconst CenterHorizontallyIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10 18.333v-2.916\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10 11.667V8.333\",\n strokeLinejoin: \"round\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10 4.583V1.667\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4.792 13.125v.417c0 .92.746 1.666 1.666 1.666h7.084c.92 0 1.666-.746 1.666-1.666v-.417c0-.92-.746-1.667-1.666-1.667H6.458c-.92 0-1.666.746-1.666 1.667ZM6.458 6.458v.417c0 .92.747 1.667 1.667 1.667h3.75c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666h-3.75c-.92 0-1.667.746-1.667 1.666Z\"\n})), modifiedTablerIconProps);\nconst usersIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"circle\", {\n cx: \"9\",\n cy: \"7\",\n r: \"4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16 3.13a4 4 0 0 1 0 7.75\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M21 21v-2a4 4 0 0 0 -3 -3.85\"\n})), tablerIconProps); // not mirrored because it's inspired by a playback control, which is always RTL\n\nconst start = createIcon(\"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm115.7 272l-176 101c-15.8 8.8-35.7-2.5-35.7-21V152c0-18.4 19.8-29.8 35.7-21l176 107c16.4 9.2 16.4 32.9 0 42z\");\nconst stop = createIcon(\"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm96 328c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16h160c8.8 0 16 7.2 16 16v160z\");\nconst CloseIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n clipPath: \"url(#a)\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15 5 5 15M5 5l10 10\"\n})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"clipPath\", {\n id: \"a\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fill: \"#fff\",\n d: \"M0 0h20v20H0z\"\n})))), modifiedTablerIconProps);\nconst clone = createIcon(\"M464 0c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48H176c-26.51 0-48-21.49-48-48V48c0-26.51 21.49-48 48-48h288M176 416c-44.112 0-80-35.888-80-80V128H48c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h288c26.51 0 48-21.49 48-48v-48H176z\", {\n mirror: true\n}); // modified https://feathericons.com/?query=shield\n\nconst shield = createIcon(\"M11.553 22.894a.998.998 0 00.894 0s3.037-1.516 5.465-4.097C19.616 16.987 21 14.663 21 12V5a1 1 0 00-.649-.936l-8-3a.998.998 0 00-.702 0l-8 3A1 1 0 003 5v7c0 2.663 1.384 4.987 3.088 6.797 2.428 2.581 5.465 4.097 5.465 4.097zm-1.303-8.481l6.644-6.644a.856.856 0 111.212 1.212l-7.25 7.25a.856.856 0 01-1.212 0l-3.75-3.75a.856.856 0 111.212-1.212l3.144 3.144z\", {\n width: 24\n});\nconst file = createIcon(\"M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48zm32-48h224V288l-23.5-23.5c-4.7-4.7-12.3-4.7-17 0L176 352l-39.5-39.5c-4.7-4.7-12.3-4.7-17 0L80 352v64zm48-240c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48z\", {\n width: 384,\n height: 512\n}); // TODO barnabasmolnar/editor-redesign\n// couldn't find a new icon for this\n\nconst GroupIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n theme\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M25 26H111V111H25\",\n fill: iconFillColor(theme)\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z\",\n stroke: iconFillColor(theme),\n strokeWidth: \"2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M100 100H160V160H100\",\n fill: iconFillColor(theme)\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z\",\n stroke: iconFillColor(theme),\n strokeWidth: \"2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n fill: handlerColor(theme),\n stroke: iconFillColor(theme),\n strokeWidth: \"6\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"rect\", {\n x: \"2.5\",\n y: \"2.5\",\n width: \"30\",\n height: \"30\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"rect\", {\n x: \"2.5\",\n y: \"149.5\",\n width: \"30\",\n height: \"30\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"rect\", {\n x: \"147.5\",\n y: \"149.5\",\n width: \"30\",\n height: \"30\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"rect\", {\n x: \"147.5\",\n y: \"2.5\",\n width: \"30\",\n height: \"30\"\n}))), {\n width: 182,\n height: 182,\n mirror: true\n}));\nconst UngroupIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n theme\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M25 26H111V111H25\",\n fill: iconFillColor(theme)\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z\",\n stroke: iconFillColor(theme),\n strokeWidth: \"2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M100 100H160V160H100\",\n fill: iconFillColor(theme)\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z\",\n stroke: iconFillColor(theme),\n strokeWidth: \"2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n fill: handlerColor(theme),\n stroke: iconFillColor(theme),\n strokeWidth: \"6\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"rect\", {\n x: \"2.5\",\n y: \"2.5\",\n width: \"30\",\n height: \"30\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"rect\", {\n x: \"78.5\",\n y: \"149.5\",\n width: \"30\",\n height: \"30\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"rect\", {\n x: \"147.5\",\n y: \"149.5\",\n width: \"30\",\n height: \"30\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"rect\", {\n x: \"147.5\",\n y: \"78.5\",\n width: \"30\",\n height: \"30\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"rect\", {\n x: \"105.5\",\n y: \"2.5\",\n width: \"30\",\n height: \"30\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"rect\", {\n x: \"2.5\",\n y: \"102.5\",\n width: \"30\",\n height: \"30\"\n}))), {\n width: 182,\n height: 182,\n mirror: true\n}));\nconst FillZigZagIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5.879 2.625h8.242a3.27 3.27 0 0 1 3.254 3.254v8.242a3.27 3.27 0 0 1-3.254 3.254H5.88a3.27 3.27 0 0 1-3.254-3.254V5.88A3.27 3.27 0 0 1 5.88 2.626l-.001-.001ZM4.518 16.118l7.608-12.83m.198 13.934 5.051-9.897M2.778 9.675l9.348-6.387m-7.608 12.83 12.857-8.793\"\n})), modifiedTablerIconProps);\nconst FillHachureIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"mask\", {\n id: \"FillHachureIcon\",\n style: {\n maskType: \"alpha\"\n },\n maskUnits: \"userSpaceOnUse\",\n x: 2,\n y: 2,\n width: 16,\n height: 16\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z\",\n fill: \"var(--icon-fill-color)\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\"\n})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n mask: \"url(#FillHachureIcon)\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M2.258 15.156 15.156 2.258M7.324 20.222 20.222 7.325m-20.444 5.35L12.675-.222m-8.157 18.34L17.416 5.22\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}))), modifiedTablerIconProps);\nconst FillCrossHatchIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n clipPath: \"url(#a)\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"mask\", {\n id: \"FillCrossHatchIcon\",\n style: {\n maskType: \"alpha\"\n },\n maskUnits: \"userSpaceOnUse\",\n x: -1,\n y: -1,\n width: 22,\n height: 22\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M2.426 15.044 15.044 2.426M7.383 20 20 7.383M0 12.617 12.617 0m-7.98 17.941L17.256 5.324m-2.211 12.25L2.426 4.956M20 12.617 7.383 0m5.234 20L0 7.383m17.941 7.98L5.324 2.745\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n mask: \"url(#FillCrossHatchIcon)\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M14.121 2H5.88A3.879 3.879 0 0 0 2 5.879v8.242A3.879 3.879 0 0 0 5.879 18h8.242A3.879 3.879 0 0 0 18 14.121V5.88A3.879 3.879 0 0 0 14.121 2Z\",\n fill: \"var(--icon-fill-color)\"\n}))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"clipPath\", {\n id: \"a\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fill: \"#fff\",\n d: \"M0 0h20v20H0z\"\n})))), modifiedTablerIconProps);\nconst FillSolidIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n clipPath: \"url(#a)\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4.91 2.625h10.18a2.284 2.284 0 0 1 2.285 2.284v10.182a2.284 2.284 0 0 1-2.284 2.284H4.909a2.284 2.284 0 0 1-2.284-2.284V4.909a2.284 2.284 0 0 1 2.284-2.284Z\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\"\n})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"clipPath\", {\n id: \"a\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fill: \"#fff\",\n d: \"M0 0h20v20H0z\"\n})))), Object.assign(Object.assign({}, modifiedTablerIconProps), {\n fill: \"var(--icon-fill-color)\"\n}));\nconst StrokeWidthThinIcon = createIcon(\n/*#__PURE__*/\n//zsviczian\nreact__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4.167 10h11.666\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"0.75\" //zsviczian\n ,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n})), modifiedTablerIconProps);\nconst StrokeWidthBaseIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4.167 10h11.666\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"2.25\" //zsviczian\n ,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n})), modifiedTablerIconProps);\nconst StrokeWidthBoldIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 10h10\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"3.5\" //zsviczian\n ,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}), modifiedTablerIconProps);\nconst StrokeWidthExtraBoldIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 10h10\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"5.75\" //zsviczian\n ,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}), modifiedTablerIconProps);\nconst StrokeStyleSolidIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n theme\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6 10H34\",\n stroke: iconFillColor(theme),\n strokeWidth: 2,\n fill: \"none\",\n strokeLinecap: \"round\"\n}), {\n width: 40,\n height: 20\n}));\nconst StrokeStyleDashedIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"2\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 12h2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M17 12h2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M11 12h2\"\n})), tablerIconProps); // tabler-icons: line-dotted\n\nconst StrokeStyleDottedIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"2\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 12v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 12v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 12v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16 12v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M20 12v.01\"\n})), tablerIconProps);\nconst SloppinessArchitectIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M2.5 12.038c1.655-.885 5.9-3.292 8.568-4.354 2.668-1.063.101 2.821 1.32 3.104 1.218.283 5.112-1.814 5.112-1.814\",\n strokeWidth: \"1.25\"\n}), modifiedTablerIconProps);\nconst SloppinessArtistIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M2.5 12.563c1.655-.886 5.9-3.293 8.568-4.355 2.668-1.062.101 2.822 1.32 3.105 1.218.283 5.112-1.814 5.112-1.814m-13.469 2.23c2.963-1.586 6.13-5.62 7.468-4.998 1.338.623-1.153 4.11-.132 5.595 1.02 1.487 6.133-1.43 6.133-1.43\",\n strokeWidth: \"1.25\"\n}), modifiedTablerIconProps);\nconst SloppinessCartoonistIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M2.5 11.936c1.737-.879 8.627-5.346 10.42-5.268 1.795.078-.418 5.138.345 5.736.763.598 3.53-1.789 4.235-2.147M2.929 9.788c1.164-.519 5.47-3.28 6.987-3.114 1.519.165 1 3.827 2.121 4.109 1.122.281 3.839-2.016 4.606-2.42\",\n strokeWidth: \"1.25\"\n}), modifiedTablerIconProps);\nconst EdgeSharpIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"svg\", {\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3.33334 9.99998V6.66665C3.33334 6.04326 3.33403 4.9332 3.33539 3.33646C4.95233 3.33436 6.06276 3.33331 6.66668 3.33331H10\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M13.3333 3.33331V3.34331\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16.6667 3.33331V3.34331\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16.6667 6.66669V6.67669\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16.6667 10V10.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3.33334 13.3333V13.3433\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16.6667 13.3333V13.3433\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3.33334 16.6667V16.6767\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6.66666 16.6667V16.6767\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10 16.6667V16.6767\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M13.3333 16.6667V16.6767\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16.6667 16.6667V16.6767\"\n})), modifiedTablerIconProps); // tabler-icons: border-radius\n\nconst EdgeRoundIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.5\",\n stroke: \"var(--icon-fill-color)\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 12v-4a4 4 0 0 1 4 -4h4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"16\",\n y1: \"4\",\n x2: \"16\",\n y2: \"4.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"20\",\n y1: \"4\",\n x2: \"20\",\n y2: \"4.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"20\",\n y1: \"8\",\n x2: \"20\",\n y2: \"8.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"20\",\n y1: \"12\",\n x2: \"20\",\n y2: \"12.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"4\",\n y1: \"16\",\n x2: \"4\",\n y2: \"16.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"20\",\n y1: \"16\",\n x2: \"20\",\n y2: \"16.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"4\",\n y1: \"20\",\n x2: \"4\",\n y2: \"20.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"8\",\n y1: \"20\",\n x2: \"8\",\n y2: \"20.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"12\",\n y1: \"20\",\n x2: \"12\",\n y2: \"20.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"16\",\n y1: \"20\",\n x2: \"16\",\n y2: \"20.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"20\",\n y1: \"20\",\n x2: \"20\",\n y2: \"20.01\"\n})), tablerIconProps);\nconst ArrowheadNoneIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"var(--icon-fill-color)\",\n opacity: 0.3,\n strokeWidth: 2\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 12l9 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 9l6 6\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 15l6 -6\"\n})), tablerIconProps);\nconst ArrowheadArrowIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n flip = false\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n transform: flip ? \"translate(40, 0) scale(-1, 1)\" : \"\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: 2,\n fill: \"none\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M34 10H6M34 10L27 5M34 10L27 15\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M27.5 5L34.5 10L27.5 15\"\n})), {\n width: 40,\n height: 20\n}));\nconst ArrowheadCircleIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n flip = false\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"var(--icon-fill-color)\",\n fill: \"var(--icon-fill-color)\",\n transform: flip ? \"translate(40, 0) scale(-1, 1)\" : \"\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M32 10L6 10\",\n strokeWidth: 2\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"circle\", {\n r: \"4\",\n transform: \"matrix(-1 0 0 1 30 10)\"\n})), {\n width: 40,\n height: 20\n}));\nconst ArrowheadCircleOutlineIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n flip = false\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\",\n fill: \"none\",\n transform: flip ? \"translate(40, 0) scale(-1, 1)\" : \"\",\n strokeWidth: 2\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M26 10L6 10\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"circle\", {\n r: \"4\",\n transform: \"matrix(-1 0 0 1 30 10)\"\n})), {\n width: 40,\n height: 20\n}));\nconst ArrowheadBarIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n flip = false\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n transform: flip ? \"translate(40, 0) scale(-1, 1)\" : \"\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M34 10H5.99996M34 10L34 5M34 10L34 15\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: 2,\n fill: \"none\"\n})), {\n width: 40,\n height: 20\n}));\nconst ArrowheadTriangleIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n flip = false\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"var(--icon-fill-color)\",\n fill: \"var(--icon-fill-color)\",\n transform: flip ? \"translate(40, 0) scale(-1, 1)\" : \"\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M32 10L6 10\",\n strokeWidth: 2\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M27.5 5.5L34.5 10L27.5 14.5L27.5 5.5\"\n})), {\n width: 40,\n height: 20\n}));\nconst ArrowheadTriangleOutlineIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n flip = false\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\",\n fill: \"none\",\n transform: flip ? \"translate(40, 0) scale(-1, 1)\" : \"\",\n strokeWidth: 2,\n strokeLinejoin: \"round\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6,9.5H27\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M27,5L34,10L27,14Z\",\n fill: \"none\"\n})), {\n width: 40,\n height: 20\n}));\nconst ArrowheadDiamondIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n flip = false\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\",\n fill: \"currentColor\",\n transform: flip ? \"translate(40, 0) scale(-1, 1)\" : \"\",\n strokeLinejoin: \"round\",\n strokeWidth: 2\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6,9.5H20\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M27,5L34,10L27,14L20,9.5Z\"\n})), {\n width: 40,\n height: 20\n}));\nconst ArrowheadDiamondOutlineIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n flip = false\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\",\n fill: \"none\",\n transform: flip ? \"translate(40, 0) scale(-1, 1)\" : \"\",\n strokeLinejoin: \"round\",\n strokeWidth: 2\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6,9.5H20\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M27,5L34,10L27,14L20,9.5Z\"\n})), {\n width: 40,\n height: 20\n}));\nconst ArrowheadCrowfootIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n flip = false\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\",\n fill: \"none\",\n transform: flip ? \"\" : \"translate(40, 0) scale(-1, 1)\",\n strokeLinejoin: \"round\",\n strokeWidth: 2\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M34,10 H6 M15,10 L7,5 M15,10 L7,15\"\n})), {\n width: 40,\n height: 20\n}));\nconst ArrowheadCrowfootOneIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n flip = false\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\",\n fill: \"none\",\n transform: flip ? \"\" : \"translate(40, 0) scale(-1, 1)\",\n strokeLinejoin: \"round\",\n strokeWidth: 2\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M34,10 H6 M15,10 L15,15 L15,5\"\n})), {\n width: 40,\n height: 20\n}));\nconst ArrowheadCrowfootOneOrManyIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n flip = false\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\",\n fill: \"none\",\n transform: flip ? \"\" : \"translate(40, 0) scale(-1, 1)\",\n strokeLinejoin: \"round\",\n strokeWidth: 2\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M34,10 H6 M15,10 L15,16 L15,4 M15,10 L7,5 M15,10 L7,15\"\n})), {\n width: 40,\n height: 20\n}));\nconst FontSizeSmallIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n clipPath: \"url(#a)\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M14.167 6.667a3.333 3.333 0 0 0-3.334-3.334H9.167a3.333 3.333 0 0 0 0 6.667h1.666a3.333 3.333 0 0 1 0 6.667H9.167a3.333 3.333 0 0 1-3.334-3.334\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"clipPath\", {\n id: \"a\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fill: \"#fff\",\n d: \"M0 0h20v20H0z\"\n})))), modifiedTablerIconProps);\nconst FontSizeMediumIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n clipPath: \"url(#a)\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 16.667V3.333L10 15l5-11.667v13.334\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"clipPath\", {\n id: \"a\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fill: \"#fff\",\n d: \"M0 0h20v20H0z\"\n})))), modifiedTablerIconProps);\nconst FontSizeLargeIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n clipPath: \"url(#a)\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5.833 3.333v13.334h8.334\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"clipPath\", {\n id: \"a\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fill: \"#fff\",\n d: \"M0 0h20v20H0z\"\n})))), modifiedTablerIconProps);\nconst FontSizeExtraLargeIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"m1.667 3.333 6.666 13.334M8.333 3.333 1.667 16.667M11.667 3.333v13.334h6.666\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n})), modifiedTablerIconProps);\nconst fontSizeIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 7v-2h13v2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10 5v14\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 19h-4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15 13v-1h6v1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M18 12v7\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M17 19h2\"\n})), tablerIconProps);\nconst FontFamilyHeadingIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\",\n strokeWidth: \"1.25\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M7 12h10\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M7 5v14\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M17 5v14\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15 19h4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15 5h4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 19h4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 5h4\"\n}))), tablerIconProps);\nconst FontFamilyNormalIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5.833 16.667v-10a3.333 3.333 0 0 1 3.334-3.334h1.666a3.333 3.333 0 0 1 3.334 3.334v10M5.833 10.833h8.334\"\n}))), modifiedTablerIconProps);\nconst FontFamilyCodeIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n clipPath: \"url(#a)\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5.833 6.667 2.5 10l3.333 3.333M14.167 6.667 17.5 10l-3.333 3.333M11.667 3.333 8.333 16.667\"\n})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"clipPath\", {\n id: \"a\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fill: \"#fff\",\n d: \"M0 0h20v20H0z\"\n})))), modifiedTablerIconProps);\nconst FontFamilyLocalFontIcon = createIcon(\n/*#__PURE__*/\n//zsviczian\nreact__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"var(--icon-fill-color)\",\n fill: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"m 151.43258,8.7863685 q -7.87381,6.7489805 -14.62279,12.3731315 0,11.248301 0,23.621433 8.99864,35.994564 13.49796,76.488447 -4.49932,7.87381 -11.2483,13.49796 -16.87245,1.12483 -29.24559,-3.37449 -6.74898,-4.49932 -10.123467,-11.2483 -7.87381,-2.24966 -15.747621,0 -6.748981,1.12483 -11.248302,5.62415 l -16.872451,16.87245 q -11.248302,2.24966 -19.122113,8.99864 -6.74898,6.74899 -6.74898,17.99729 2.24966,3.37449 4.49932,7.87381 2.24966,4.49932 2.24966,12.37313 -16.872452,31.49524 -30.3704131,65.24015 -2.2496602,23.62143 0,47.24286 6.7489811,10.12347 15.7476221,20.24694 10.123471,4.49932 20.246942,13.49797 25.871093,4.49932 53.991846,8.99864 23.621437,-5.62415 50.617357,-5.62415 3.37449,2.24966 6.74898,5.62415 0,25.87109 0,55.11667 1.12483,19.12211 5.62415,38.24423 v 61.86565 q 2.24966,5.62415 8.99864,8.99864 10.12347,0 19.12211,-3.37449 3.37449,2.24966 10.12347,2.24966 7.87382,-13.49796 17.99729,-24.74626 5.62415,-34.86973 7.87381,-70.8643 -5.62415,-40.49388 -5.62415,-82.1126 l 7.87381,-7.87381 h 16.87245 q 21.37177,-8.99864 44.9932,-13.49796 14.6228,-7.87381 30.37042,-15.74762 3.37449,-1.12483 8.99864,-1.12483 11.2483,-10.12347 23.62143,-22.4966 2.24966,-6.74898 6.74898,-12.37313 V 230.3779 q 4.49932,-14.62279 6.74898,-30.37041 4.49932,-11.2483 10.12347,-20.24694 2.24966,-17.99728 2.24966,-37.1194 -5.62415,-7.87381 -7.87381,-15.74762 -6.74898,-6.74898 -13.49796,-13.49796 -11.2483,-6.74898 -20.24694,-10.12347 -46.11804,-4.499321 -92.23607,0 -10.12347,4.49932 -22.4966,4.49932 -6.74898,-2.24966 -10.12347,-7.873811 2.24966,-23.621433 2.24966,-46.118035 -5.62415,-8.998641 -4.49932,-19.122113 Q 203.17477,22.28433 195.30095,13.285689 187.42714,3.1622179 178.4285,2.0373877 164.93054,5.4118781 151.43258,8.7863685 Z M 136.80979,175.26123 q 7.87381,2.24966 11.2483,12.37313 -1.12483,39.36905 1.12483,80.98777 4.49932,6.74898 3.37449,15.74762 -5.62415,6.74898 -12.37313,11.2483 -17.99728,1.12483 -33.74491,5.62415 -19.122108,0 -37.11939,-1.12483 -6.748981,-4.49932 -11.248301,-7.87381 -1.12483,-14.62279 1.12483,-29.24558 16.872452,-30.37042 28.120753,-62.99049 4.499321,-7.87381 11.248301,-13.49796 14.622787,-3.37449 29.245587,-5.62415 4.49932,-3.37449 8.99864,-5.62415 z M 283.0377,146.01564 q 8.99865,-1.12483 17.99729,2.24966 4.49932,2.24966 8.99864,7.87382 2.24966,8.99864 1.12483,20.24694 -6.74898,11.2483 -10.12347,22.4966 -4.49932,25.87109 -10.12348,52.86702 -24.74626,11.2483 -47.24286,24.74626 -10.12347,2.24966 -19.12211,4.49932 l -10.12347,-10.12347 q 0,-44.99321 3.37449,-84.36226 -3.37449,-13.49796 -6.74898,-23.62143 4.49932,-6.74898 12.37313,-11.24831 29.24558,-3.37449 59.61599,-5.62415 z M 638.74,93.24 766.76,221.26 488.77,499.25 374.63,511.85 c -15.28,1.69 -28.19,-11.23 -26.49,-26.51 l 12.7,-114.22 z M 845.94,74.18 785.83,14.07 c -18.75,-18.75 -49.16,-18.75 -67.91,0 l -56.55,56.55 128.02,128.02 56.55,-56.55 c 18.75,-18.76 18.75,-49.16 0,-67.91 z\"\n}))));\nconst TextAlignLeftIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"var(--icon-fill-color)\",\n fill: \"none\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n strokeWidth: 2\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"4\",\n y1: \"8\",\n x2: \"20\",\n y2: \"8\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"4\",\n y1: \"12\",\n x2: \"12\",\n y2: \"12\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"4\",\n y1: \"16\",\n x2: \"16\",\n y2: \"16\"\n})), tablerIconProps);\nconst TextAlignCenterIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"var(--icon-fill-color)\",\n fill: \"none\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"4\",\n y1: \"8\",\n x2: \"20\",\n y2: \"8\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"8\",\n y1: \"12\",\n x2: \"16\",\n y2: \"12\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"6\",\n y1: \"16\",\n x2: \"18\",\n y2: \"16\"\n})), tablerIconProps);\nconst TextAlignRightIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"var(--icon-fill-color)\",\n fill: \"none\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"4\",\n y1: \"8\",\n x2: \"20\",\n y2: \"8\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"10\",\n y1: \"12\",\n x2: \"20\",\n y2: \"12\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"8\",\n y1: \"16\",\n x2: \"20\",\n y2: \"16\"\n})), tablerIconProps); // tabler-icons: layout-align-top\n\nconst TextAlignTopIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n theme\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.5\",\n stroke: \"var(--icon-fill-color)\",\n fill: \"none\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"4\",\n y1: \"4\",\n x2: \"20\",\n y2: \"4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"rect\", {\n x: \"9\",\n y: \"8\",\n width: \"6\",\n height: \"12\",\n rx: \"2\"\n})), tablerIconProps)); // tabler-icons: layout-align-bottom\n\nconst TextAlignBottomIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n theme\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"2\",\n stroke: \"var(--icon-fill-color)\",\n fill: \"none\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"4\",\n y1: \"20\",\n x2: \"20\",\n y2: \"20\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"rect\", {\n x: \"9\",\n y: \"4\",\n width: \"6\",\n height: \"12\",\n rx: \"2\"\n})), tablerIconProps)); // tabler-icons: layout-align-middle\n\nconst TextAlignMiddleIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n theme\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.5\",\n stroke: \"var(--icon-fill-color)\",\n fill: \"none\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"4\",\n y1: \"12\",\n x2: \"9\",\n y2: \"12\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"15\",\n y1: \"12\",\n x2: \"20\",\n y2: \"12\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"rect\", {\n x: \"9\",\n y: \"6\",\n width: \"6\",\n height: \"12\",\n rx: \"2\"\n})), tablerIconProps));\nconst angleIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M21 19h-18l9 -15\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M20.615 15.171h.015\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19.515 11.771h.015\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M17.715 8.671h.015\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15.415 5.971h.015\"\n})), tablerIconProps);\nconst publishIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M537.6 226.6c4.1-10.7 6.4-22.4 6.4-34.6 0-53-43-96-96-96-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32c-88.4 0-160 71.6-160 160 0 2.7.1 5.4.2 8.1C40.2 219.8 0 273.2 0 336c0 79.5 64.5 144 144 144h368c70.7 0 128-57.3 128-128 0-61.9-44-113.6-102.4-125.4zM393.4 288H328v112c0 8.8-7.2 16-16 16h-48c-8.8 0-16-7.2-16-16V288h-65.4c-14.3 0-21.4-17.2-11.3-27.3l105.4-105.4c6.2-6.2 16.4-6.2 22.6 0l105.4 105.4c10.1 10.1 2.9 27.3-11.3 27.3z\",\n fill: \"var(--icon-fill-color)\"\n}), {\n width: 640,\n height: 512\n});\nconst eraser = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M480 416C497.7 416 512 430.3 512 448C512 465.7 497.7 480 480 480H150.6C133.7 480 117.4 473.3 105.4 461.3L25.37 381.3C.3786 356.3 .3786 315.7 25.37 290.7L258.7 57.37C283.7 32.38 324.3 32.38 349.3 57.37L486.6 194.7C511.6 219.7 511.6 260.3 486.6 285.3L355.9 416H480zM265.4 416L332.7 348.7L195.3 211.3L70.63 336L150.6 416L265.4 416z\"\n}));\nconst handIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 13v-7.5a1.5 1.5 0 0 1 3 0v6.5\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M11 5.5v-2a1.5 1.5 0 1 1 3 0v8.5\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M14 5.5a1.5 1.5 0 0 1 3 0v6.5\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M17 7.5a1.5 1.5 0 0 1 3 0v8.5a6 6 0 0 1 -6 6h-2h.208a6 6 0 0 1 -5.012 -2.7a69.74 69.74 0 0 1 -.196 -.3c-.312 -.479 -1.407 -2.388 -3.286 -5.728a1.5 1.5 0 0 1 .536 -2.022a1.867 1.867 0 0 1 2.28 .28l1.47 1.47\"\n})), tablerIconProps);\nconst downloadIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M7 11l5 5l5 -5\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 4l0 12\"\n})), tablerIconProps);\nconst copyIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 8m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2\"\n})), tablerIconProps);\nconst cutIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M7 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M9.15 14.85l8.85 -10.85\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6 4l8.85 10.85\"\n})), tablerIconProps);\nconst helpIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 17l0 .01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4\"\n})), tablerIconProps);\nconst playerPlayIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M7 4v16l13 -8z\"\n})), tablerIconProps);\nconst playerStopFilledIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M17 4h-10a3 3 0 0 0 -3 3v10a3 3 0 0 0 3 3h10a3 3 0 0 0 3 -3v-10a3 3 0 0 0 -3 -3z\",\n strokeWidth: \"0\",\n fill: \"--icon-fill-color\"\n})), tablerIconProps);\nconst tablerCheckIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 12l5 5l10 -10\"\n})), tablerIconProps);\nconst alertTriangleIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10.24 3.957l-8.422 14.06a1.989 1.989 0 0 0 1.7 2.983h16.845a1.989 1.989 0 0 0 1.7 -2.983l-8.423 -14.06a1.989 1.989 0 0 0 -3.4 0z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 9v4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 17h.01\"\n})), tablerIconProps);\nconst eyeDropperIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M11 7l6 6\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 16l11.7 -11.7a1 1 0 0 1 1.4 0l2.6 2.6a1 1 0 0 1 0 1.4l-11.7 11.7h-4v-4z\"\n})), tablerIconProps);\nconst extraToolsIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.5\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 3l-4 7h8z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z\"\n})), tablerIconProps);\nconst frameToolIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.5\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 7l16 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 17l16 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M7 4l0 16\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M17 4l0 16\"\n})), tablerIconProps);\nconst mermaidLogoIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fill: \"currentColor\",\n d: \"M407.48,111.18C335.587,108.103 269.573,152.338 245.08,220C220.587,152.338 154.573,108.103 82.68,111.18C80.285,168.229 107.577,222.632 154.74,254.82C178.908,271.419 193.35,298.951 193.27,328.27L193.27,379.13L296.9,379.13L296.9,328.27C296.816,298.953 311.255,271.42 335.42,254.82C382.596,222.644 409.892,168.233 407.48,111.18Z\"\n}));\nconst ArrowRightIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4.16602 10H15.8327\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12.5 13.3333L15.8333 10\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12.5 6.66666L15.8333 9.99999\"\n})), modifiedTablerIconProps);\nconst laserPointerToolIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: \"1.25\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n transform: \"rotate(90 10 10)\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n clipRule: \"evenodd\",\n d: \"m9.644 13.69 7.774-7.773a2.357 2.357 0 0 0-3.334-3.334l-7.773 7.774L8 12l1.643 1.69Z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"m13.25 3.417 3.333 3.333M10 10l2-2M5 15l3-3M2.156 17.894l1-1M5.453 19.029l-.144-1.407M2.377 11.887l.866 1.118M8.354 17.273l-1.194-.758M.953 14.652l1.408.13\"\n})), 20);\nconst MagicIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\",\n fill: \"none\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6 21l15 -15l-3 -3l-15 15l3 3\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15 6l3 3\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M9 3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 13a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2\"\n})), tablerIconProps);\nconst MagicIconThin = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6 21l15 -15l-3 -3l-15 15l3 3\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15 6l3 3\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M9 3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 13a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2\"\n})), tablerIconProps);\nconst OpenAIIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\",\n fill: \"none\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M11.217 19.384a3.501 3.501 0 0 0 6.783 -1.217v-5.167l-6 -3.35\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5.214 15.014a3.501 3.501 0 0 0 4.446 5.266l4.34 -2.534v-6.946\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6 7.63c-1.391 -.236 -2.787 .395 -3.534 1.689a3.474 3.474 0 0 0 1.271 4.745l4.263 2.514l6 -3.348\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12.783 4.616a3.501 3.501 0 0 0 -6.783 1.217v5.067l6 3.45\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M18.786 8.986a3.501 3.501 0 0 0 -4.446 -5.266l-4.34 2.534v6.946\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M18 16.302c1.391 .236 2.787 -.395 3.534 -1.689a3.474 3.474 0 0 0 -1.271 -4.745l-4.308 -2.514l-5.955 3.42\"\n})), tablerIconProps);\nconst fullscreenIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\",\n fill: \"none\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 8v-2a2 2 0 0 1 2 -2h2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 16v2a2 2 0 0 0 2 2h2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16 4h2a2 2 0 0 1 2 2v2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16 20h2a2 2 0 0 0 2 -2v-2\"\n})), tablerIconProps);\nconst eyeIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\",\n fill: \"none\",\n strokeWidth: 1.5\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6\"\n})), tablerIconProps);\nconst eyeClosedIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\",\n fill: \"none\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10.585 10.587a2 2 0 0 0 2.829 2.828\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 3l18 18\"\n})), tablerIconProps);\nconst brainIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\",\n fill: \"none\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15.5 13a3.5 3.5 0 0 0 -3.5 3.5v1a3.5 3.5 0 0 0 7 0v-1.8\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8.5 13a3.5 3.5 0 0 1 3.5 3.5v1a3.5 3.5 0 0 1 -7 0v-1.8\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6.5 16a3.5 3.5 0 0 1 0 -7h.5\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10\"\n})), tablerIconProps);\nconst brainIconThin = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15.5 13a3.5 3.5 0 0 0 -3.5 3.5v1a3.5 3.5 0 0 0 7 0v-1.8\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8.5 13a3.5 3.5 0 0 1 3.5 3.5v1a3.5 3.5 0 0 1 -7 0v-1.8\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6.5 16a3.5 3.5 0 0 1 0 -7h.5\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10\"\n})), tablerIconProps);\nconst searchIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.5\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M21 21l-6 -6\"\n})), tablerIconProps);\nconst clockIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.5\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M20.984 12.53a9 9 0 1 0 -7.552 8.355\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 7v5l3 3\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 16l-2 3h4l-2 3\"\n})), tablerIconProps);\nconst microphoneIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.5\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M9 2m0 3a3 3 0 0 1 3 -3h0a3 3 0 0 1 3 3v5a3 3 0 0 1 -3 3h0a3 3 0 0 1 -3 -3z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 10a7 7 0 0 0 14 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 21l8 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 17l0 4\"\n})), tablerIconProps);\nconst microphoneMutedIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.5\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 3l18 18\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M9 5a3 3 0 0 1 6 0v5a3 3 0 0 1 -.13 .874m-2 2a3 3 0 0 1 -3.87 -2.872v-1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 10a7 7 0 0 0 10.846 5.85m2 -2a6.967 6.967 0 0 0 1.152 -3.85\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 21l8 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 17l0 4\"\n})), tablerIconProps);\nconst boltIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M13 3l0 7l6 0l-8 11l0 -7l-6 0l8 -11\"\n})), tablerIconProps);\nconst selectAllIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 8m0 1a1 1 0 0 1 1 -1h6a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-6a1 1 0 0 1 -1 -1z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 20v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16 20v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 20v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 20v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 16v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 12v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 8v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 4v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 4v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 4v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16 4v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M20 4v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M20 8v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M20 12v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M20 16v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M20 20v.01\"\n})), tablerIconProps);\nconst abacusIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 3v18\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 21v-18\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 7h14\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 15h14\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 13v4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M11 13v4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16 13v4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M14 5v4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M11 5v4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 5v4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 21h18\"\n})), tablerIconProps);\nconst flipVertical = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 12l18 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M7 16l10 0l-10 5l0 -5\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M7 8l10 0l-10 -5l0 5\"\n})), tablerIconProps);\nconst flipHorizontal = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 3l0 18\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16 7l0 10l5 0l-5 -10\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 7l0 10l-5 0l5 -10\"\n})), tablerIconProps);\nconst paintIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 3m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v2a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 6h1a2 2 0 0 1 2 2a5 5 0 0 1 -5 5l-5 0v2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10 15m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z\"\n})), tablerIconProps);\nconst zoomAreaIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15 15m-5 0a5 5 0 1 0 10 0a5 5 0 1 0 -10 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M22 22l-3 -3\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6 18h-1a2 2 0 0 1 -2 -2v-1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 11v-1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 6v-1a2 2 0 0 1 2 -2h1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10 3h1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15 3h1a2 2 0 0 1 2 2v1\"\n})), tablerIconProps);\nconst svgIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M14 3v4a1 1 0 0 0 1 1h4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 20.25c0 .414 .336 .75 .75 .75h1.25a1 1 0 0 0 1 -1v-1a1 1 0 0 0 -1 -1h-1a1 1 0 0 1 -1 -1v-1a1 1 0 0 1 1 -1h1.25a.75 .75 0 0 1 .75 .75\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10 15l2 6l2 -6\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3\"\n})), tablerIconProps);\nconst pngIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M14 3v4a1 1 0 0 0 1 1h4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M11 21v-6l3 6v-6\"\n})), tablerIconProps);\nconst magnetIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 13v-8a2 2 0 0 1 2 -2h1a2 2 0 0 1 2 2v8a2 2 0 0 0 6 0v-8a2 2 0 0 1 2 -2h1a2 2 0 0 1 2 2v8a8 8 0 0 1 -16 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 8l5 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15 8l4 0\"\n})), tablerIconProps);\nconst coffeeIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 14c.83 .642 2.077 1.017 3.5 1c1.423 .017 2.67 -.358 3.5 -1c.83 -.642 2.077 -1.017 3.5 -1c1.423 -.017 2.67 .358 3.5 1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 10h14v5a6 6 0 0 1 -6 6h-2a6 6 0 0 1 -6 -6v-5z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16.746 16.726a3 3 0 1 0 .252 -5.555\"\n})), tablerIconProps);\nconst DeviceDesktopIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 5a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-16a1 1 0 0 1-1-1v-10zM7 20h10M9 16v4M15 16v4\"\n})), Object.assign(Object.assign({}, tablerIconProps), {\n strokeWidth: 1.5\n})); // login\n\nconst loginIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.5\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M21 12h-13l3 -3\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M11 15l-3 -3\"\n})), tablerIconProps);\nconst youtubeIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M2 8a4 4 0 0 1 4 -4h12a4 4 0 0 1 4 4v8a4 4 0 0 1 -4 4h-12a4 4 0 0 1 -4 -4v-8z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10 9l5 3l-5 3z\"\n})), tablerIconProps);\nconst gridIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.5\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 6h18\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 12h18\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 18h18\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6 3v18\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 3v18\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M18 3v18\"\n})), tablerIconProps);\nconst lineEditorIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.5\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M17 3m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 17m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M17 5c-6.627 0 -12 5.373 -12 12\"\n})), tablerIconProps); // arrow-up-right (modified)\n\nconst sharpArrowIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6 18l12 -12\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M18 10v-4h-4\"\n})), tablerIconProps); // arrow-guide (modified)\n\nconst elbowArrowIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4,19L10,19C11.097,19 12,18.097 12,17L12,9C12,7.903 12.903,7 14,7L21,7\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M18 4l3 3l-3 3\"\n})), tablerIconProps); // arrow-ramp-right-2 (heavily modified)\n\nconst roundArrowIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16,12L20,9L16,6\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6 20c0 -6.075 4.925 -11 11 -11h3\"\n})), tablerIconProps);\nconst collapseDownIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6 9l6 6l6 -6\"\n})), tablerIconProps);\nconst collapseUpIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6 15l6 -6l6 6\"\n})), tablerIconProps);\nconst upIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6 15l6 -6l6 6\"\n})), tablerIconProps);\nconst cropIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 5v10a1 1 0 0 0 1 1h10\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 8h10a1 1 0 0 1 1 1v10\"\n})), tablerIconProps);\nconst elementLinkIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 7l0 10\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M7 5l10 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M7 19l10 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 7l0 10\"\n})), tablerIconProps); //zsviczian\n\nconst markerFrameIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 3a2 2 0 0 0-2 2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 3a2 2 0 0 1 2 2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M21 19a2 2 0 0 1-2 2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 21a2 2 0 0 1-2-2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M9 3h1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M9 21h1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M14 3h1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M14 21h1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 9v1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M21 9v1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 14v1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M21 14v1\"\n})), tablerIconProps); //zsviczian\n\nconst LaTeXIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M571.31 251.31l-22.62-22.62c-6.25-6.25-16.38-6.25-22.63 0L480 274.75l-46.06-46.06c-6.25-6.25-16.38-6.25-22.63 0l-22.62 22.62c-6.25 6.25-6.25 16.38 0 22.63L434.75 320l-46.06 46.06c-6.25 6.25-6.25 16.38 0 22.63l22.62 22.62c6.25 6.25 16.38 6.25 22.63 0L480 365.25l46.06 46.06c6.25 6.25 16.38 6.25 22.63 0l22.62-22.62c6.25-6.25 6.25-16.38 0-22.63L525.25 320l46.06-46.06c6.25-6.25 6.25-16.38 0-22.63zM552 0H307.65c-14.54 0-27.26 9.8-30.95 23.87l-84.79 322.8-58.41-106.1A32.008 32.008 0 0 0 105.47 224H24c-13.25 0-24 10.74-24 24v48c0 13.25 10.75 24 24 24h43.62l88.88 163.73C168.99 503.5 186.3 512 204.94 512c17.27 0 44.44-9 54.28-41.48L357.03 96H552c13.25 0 24-10.75 24-24V24c0-13.26-10.75-24-24-24z\"\n}), {\n width: 576,\n height: 512,\n fill: \"var(--icon-fill-color)\",\n stroke: \"none\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n strokeWidth: 2\n}); //zsviczian\n\nconst InsertAnyFileIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M14 2v4a2 2 0 0 0 2 2h4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M9 15h6\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 18v-6\"\n})), {\n width: 24,\n height: 24,\n fill: \"none\",\n stroke: \"var(--icon-fill-color)\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n strokeWidth: 2\n}); //zsviczian\n\nconst Card = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15 3v4a2 2 0 0 0 2 2h4\"\n})), {\n width: 24,\n height: 24,\n fill: \"none\",\n stroke: \"var(--icon-fill-color)\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n strokeWidth: 2\n});\nconst resizeIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.5\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 11v8a1 1 0 0 0 1 1h8m-9 -14v-1a1 1 0 0 1 1 -1h1m5 0h2m5 0h1a1 1 0 0 1 1 1v1m0 5v2m0 5v1a1 1 0 0 1 -1 1h-1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 12h7a1 1 0 0 1 1 1v7\"\n})), tablerIconProps);\nconst adjustmentsIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.5\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 6l8 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16 6l4 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 12l2 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10 12l10 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 18l11 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 18l1 0\"\n})), tablerIconProps);\nconst strokeIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6 10l4 -4 L6 14l8 -8 L6 18l12 -12 L10 18l8 -8 L14 18l4 -4\"\n})), tablerIconProps);\nconst pencilIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M13.5 6.5l4 4\"\n})), tablerIconProps);\n\n//# sourceURL=webpack://ExcalidrawLib/./components/icons.tsx?");
|
|
16735
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AlignBottomIcon: () => (/* binding */ AlignBottomIcon),\n/* harmony export */ AlignLeftIcon: () => (/* binding */ AlignLeftIcon),\n/* harmony export */ AlignRightIcon: () => (/* binding */ AlignRightIcon),\n/* harmony export */ AlignTopIcon: () => (/* binding */ AlignTopIcon),\n/* harmony export */ ArrowIcon: () => (/* binding */ ArrowIcon),\n/* harmony export */ ArrowRightIcon: () => (/* binding */ ArrowRightIcon),\n/* harmony export */ ArrowheadArrowIcon: () => (/* binding */ ArrowheadArrowIcon),\n/* harmony export */ ArrowheadBarIcon: () => (/* binding */ ArrowheadBarIcon),\n/* harmony export */ ArrowheadCircleIcon: () => (/* binding */ ArrowheadCircleIcon),\n/* harmony export */ ArrowheadCircleOutlineIcon: () => (/* binding */ ArrowheadCircleOutlineIcon),\n/* harmony export */ ArrowheadCrowfootIcon: () => (/* binding */ ArrowheadCrowfootIcon),\n/* harmony export */ ArrowheadCrowfootOneIcon: () => (/* binding */ ArrowheadCrowfootOneIcon),\n/* harmony export */ ArrowheadCrowfootOneOrManyIcon: () => (/* binding */ ArrowheadCrowfootOneOrManyIcon),\n/* harmony export */ ArrowheadDiamondIcon: () => (/* binding */ ArrowheadDiamondIcon),\n/* harmony export */ ArrowheadDiamondOutlineIcon: () => (/* binding */ ArrowheadDiamondOutlineIcon),\n/* harmony export */ ArrowheadNoneIcon: () => (/* binding */ ArrowheadNoneIcon),\n/* harmony export */ ArrowheadTriangleIcon: () => (/* binding */ ArrowheadTriangleIcon),\n/* harmony export */ ArrowheadTriangleOutlineIcon: () => (/* binding */ ArrowheadTriangleOutlineIcon),\n/* harmony export */ BringForwardIcon: () => (/* binding */ BringForwardIcon),\n/* harmony export */ BringToFrontIcon: () => (/* binding */ BringToFrontIcon),\n/* harmony export */ Card: () => (/* binding */ Card),\n/* harmony export */ CenterHorizontallyIcon: () => (/* binding */ CenterHorizontallyIcon),\n/* harmony export */ CenterVerticallyIcon: () => (/* binding */ CenterVerticallyIcon),\n/* harmony export */ CloseIcon: () => (/* binding */ CloseIcon),\n/* harmony export */ DeviceDesktopIcon: () => (/* binding */ DeviceDesktopIcon),\n/* harmony export */ DiamondIcon: () => (/* binding */ DiamondIcon),\n/* harmony export */ DiscordIcon: () => (/* binding */ DiscordIcon),\n/* harmony export */ DistributeHorizontallyIcon: () => (/* binding */ DistributeHorizontallyIcon),\n/* harmony export */ DistributeVerticallyIcon: () => (/* binding */ DistributeVerticallyIcon),\n/* harmony export */ DotsHorizontalIcon: () => (/* binding */ DotsHorizontalIcon),\n/* harmony export */ DotsIcon: () => (/* binding */ DotsIcon),\n/* harmony export */ DuplicateIcon: () => (/* binding */ DuplicateIcon),\n/* harmony export */ EdgeRoundIcon: () => (/* binding */ EdgeRoundIcon),\n/* harmony export */ EdgeSharpIcon: () => (/* binding */ EdgeSharpIcon),\n/* harmony export */ EllipseIcon: () => (/* binding */ EllipseIcon),\n/* harmony export */ EmbedIcon: () => (/* binding */ EmbedIcon),\n/* harmony export */ EraserIcon: () => (/* binding */ EraserIcon),\n/* harmony export */ ExcalLogo: () => (/* binding */ ExcalLogo),\n/* harmony export */ ExportIcon: () => (/* binding */ ExportIcon),\n/* harmony export */ ExportImageIcon: () => (/* binding */ ExportImageIcon),\n/* harmony export */ ExternalLinkIcon: () => (/* binding */ ExternalLinkIcon),\n/* harmony export */ FillCrossHatchIcon: () => (/* binding */ FillCrossHatchIcon),\n/* harmony export */ FillHachureIcon: () => (/* binding */ FillHachureIcon),\n/* harmony export */ FillSolidIcon: () => (/* binding */ FillSolidIcon),\n/* harmony export */ FillZigZagIcon: () => (/* binding */ FillZigZagIcon),\n/* harmony export */ FontFamilyCodeIcon: () => (/* binding */ FontFamilyCodeIcon),\n/* harmony export */ FontFamilyHeadingIcon: () => (/* binding */ FontFamilyHeadingIcon),\n/* harmony export */ FontFamilyLocalFontIcon: () => (/* binding */ FontFamilyLocalFontIcon),\n/* harmony export */ FontFamilyNormalIcon: () => (/* binding */ FontFamilyNormalIcon),\n/* harmony export */ FontSizeExtraLargeIcon: () => (/* binding */ FontSizeExtraLargeIcon),\n/* harmony export */ FontSizeLargeIcon: () => (/* binding */ FontSizeLargeIcon),\n/* harmony export */ FontSizeMediumIcon: () => (/* binding */ FontSizeMediumIcon),\n/* harmony export */ FontSizeSmallIcon: () => (/* binding */ FontSizeSmallIcon),\n/* harmony export */ FreedrawIcon: () => (/* binding */ FreedrawIcon),\n/* harmony export */ GithubIcon: () => (/* binding */ GithubIcon),\n/* harmony export */ GroupIcon: () => (/* binding */ GroupIcon),\n/* harmony export */ HamburgerMenuIcon: () => (/* binding */ HamburgerMenuIcon),\n/* harmony export */ HelpIcon: () => (/* binding */ HelpIcon),\n/* harmony export */ HelpIconThin: () => (/* binding */ HelpIconThin),\n/* harmony export */ ImageIcon: () => (/* binding */ ImageIcon),\n/* harmony export */ InsertAnyFileIcon: () => (/* binding */ InsertAnyFileIcon),\n/* harmony export */ LaTeXIcon: () => (/* binding */ LaTeXIcon),\n/* harmony export */ LassoIcon: () => (/* binding */ LassoIcon),\n/* harmony export */ LibraryIcon: () => (/* binding */ LibraryIcon),\n/* harmony export */ LineIcon: () => (/* binding */ LineIcon),\n/* harmony export */ LinkIcon: () => (/* binding */ LinkIcon),\n/* harmony export */ LoadIcon: () => (/* binding */ LoadIcon),\n/* harmony export */ LockedIcon: () => (/* binding */ LockedIcon),\n/* harmony export */ LockedIconFilled: () => (/* binding */ LockedIconFilled),\n/* harmony export */ MagicIcon: () => (/* binding */ MagicIcon),\n/* harmony export */ MagicIconThin: () => (/* binding */ MagicIconThin),\n/* harmony export */ MoonIcon: () => (/* binding */ MoonIcon),\n/* harmony export */ OpenAIIcon: () => (/* binding */ OpenAIIcon),\n/* harmony export */ PenModeIcon: () => (/* binding */ PenModeIcon),\n/* harmony export */ PinIcon: () => (/* binding */ PinIcon),\n/* harmony export */ PlusIcon: () => (/* binding */ PlusIcon),\n/* harmony export */ PlusPromoIcon: () => (/* binding */ PlusPromoIcon),\n/* harmony export */ RectangleIcon: () => (/* binding */ RectangleIcon),\n/* harmony export */ RedoIcon: () => (/* binding */ RedoIcon),\n/* harmony export */ SelectionIcon: () => (/* binding */ SelectionIcon),\n/* harmony export */ SendBackwardIcon: () => (/* binding */ SendBackwardIcon),\n/* harmony export */ SendToBackIcon: () => (/* binding */ SendToBackIcon),\n/* harmony export */ SloppinessArchitectIcon: () => (/* binding */ SloppinessArchitectIcon),\n/* harmony export */ SloppinessArtistIcon: () => (/* binding */ SloppinessArtistIcon),\n/* harmony export */ SloppinessCartoonistIcon: () => (/* binding */ SloppinessCartoonistIcon),\n/* harmony export */ StrokeStyleDashedIcon: () => (/* binding */ StrokeStyleDashedIcon),\n/* harmony export */ StrokeStyleDottedIcon: () => (/* binding */ StrokeStyleDottedIcon),\n/* harmony export */ StrokeStyleSolidIcon: () => (/* binding */ StrokeStyleSolidIcon),\n/* harmony export */ StrokeWidthBaseIcon: () => (/* binding */ StrokeWidthBaseIcon),\n/* harmony export */ StrokeWidthBoldIcon: () => (/* binding */ StrokeWidthBoldIcon),\n/* harmony export */ StrokeWidthExtraBoldIcon: () => (/* binding */ StrokeWidthExtraBoldIcon),\n/* harmony export */ StrokeWidthThinIcon: () => (/* binding */ StrokeWidthThinIcon),\n/* harmony export */ SunIcon: () => (/* binding */ SunIcon),\n/* harmony export */ TextAlignBottomIcon: () => (/* binding */ TextAlignBottomIcon),\n/* harmony export */ TextAlignCenterIcon: () => (/* binding */ TextAlignCenterIcon),\n/* harmony export */ TextAlignLeftIcon: () => (/* binding */ TextAlignLeftIcon),\n/* harmony export */ TextAlignMiddleIcon: () => (/* binding */ TextAlignMiddleIcon),\n/* harmony export */ TextAlignRightIcon: () => (/* binding */ TextAlignRightIcon),\n/* harmony export */ TextAlignTopIcon: () => (/* binding */ TextAlignTopIcon),\n/* harmony export */ TextIcon: () => (/* binding */ TextIcon),\n/* harmony export */ TextSizeIcon: () => (/* binding */ TextSizeIcon),\n/* harmony export */ TrashIcon: () => (/* binding */ TrashIcon),\n/* harmony export */ UndoIcon: () => (/* binding */ UndoIcon),\n/* harmony export */ UngroupIcon: () => (/* binding */ UngroupIcon),\n/* harmony export */ UnlockedIcon: () => (/* binding */ UnlockedIcon),\n/* harmony export */ WelcomeScreenHelpArrow: () => (/* binding */ WelcomeScreenHelpArrow),\n/* harmony export */ WelcomeScreenMenuArrow: () => (/* binding */ WelcomeScreenMenuArrow),\n/* harmony export */ WelcomeScreenTopToolbarArrow: () => (/* binding */ WelcomeScreenTopToolbarArrow),\n/* harmony export */ XBrandIcon: () => (/* binding */ XBrandIcon),\n/* harmony export */ ZoomInIcon: () => (/* binding */ ZoomInIcon),\n/* harmony export */ ZoomOutIcon: () => (/* binding */ ZoomOutIcon),\n/* harmony export */ ZoomResetIcon: () => (/* binding */ ZoomResetIcon),\n/* harmony export */ abacusIcon: () => (/* binding */ abacusIcon),\n/* harmony export */ adjustmentsIcon: () => (/* binding */ adjustmentsIcon),\n/* harmony export */ alertTriangleIcon: () => (/* binding */ alertTriangleIcon),\n/* harmony export */ angleIcon: () => (/* binding */ angleIcon),\n/* harmony export */ boltIcon: () => (/* binding */ boltIcon),\n/* harmony export */ brainIcon: () => (/* binding */ brainIcon),\n/* harmony export */ brainIconThin: () => (/* binding */ brainIconThin),\n/* harmony export */ bucketFillIcon: () => (/* binding */ bucketFillIcon),\n/* harmony export */ checkIcon: () => (/* binding */ checkIcon),\n/* harmony export */ chevronLeftIcon: () => (/* binding */ chevronLeftIcon),\n/* harmony export */ clipboard: () => (/* binding */ clipboard),\n/* harmony export */ clockIcon: () => (/* binding */ clockIcon),\n/* harmony export */ clone: () => (/* binding */ clone),\n/* harmony export */ coffeeIcon: () => (/* binding */ coffeeIcon),\n/* harmony export */ collapseDownIcon: () => (/* binding */ collapseDownIcon),\n/* harmony export */ collapseUpIcon: () => (/* binding */ collapseUpIcon),\n/* harmony export */ copyIcon: () => (/* binding */ copyIcon),\n/* harmony export */ createIcon: () => (/* binding */ createIcon),\n/* harmony export */ cropIcon: () => (/* binding */ cropIcon),\n/* harmony export */ cutIcon: () => (/* binding */ cutIcon),\n/* harmony export */ done: () => (/* binding */ done),\n/* harmony export */ downloadIcon: () => (/* binding */ downloadIcon),\n/* harmony export */ elbowArrowIcon: () => (/* binding */ elbowArrowIcon),\n/* harmony export */ elementLinkIcon: () => (/* binding */ elementLinkIcon),\n/* harmony export */ eraser: () => (/* binding */ eraser),\n/* harmony export */ exportToFileIcon: () => (/* binding */ exportToFileIcon),\n/* harmony export */ exportToPlus: () => (/* binding */ exportToPlus),\n/* harmony export */ extraToolsIcon: () => (/* binding */ extraToolsIcon),\n/* harmony export */ eyeClosedIcon: () => (/* binding */ eyeClosedIcon),\n/* harmony export */ eyeDropperIcon: () => (/* binding */ eyeDropperIcon),\n/* harmony export */ eyeIcon: () => (/* binding */ eyeIcon),\n/* harmony export */ file: () => (/* binding */ file),\n/* harmony export */ flipHorizontal: () => (/* binding */ flipHorizontal),\n/* harmony export */ flipVertical: () => (/* binding */ flipVertical),\n/* harmony export */ fontSizeIcon: () => (/* binding */ fontSizeIcon),\n/* harmony export */ frameToolIcon: () => (/* binding */ frameToolIcon),\n/* harmony export */ fullscreenIcon: () => (/* binding */ fullscreenIcon),\n/* harmony export */ gridIcon: () => (/* binding */ gridIcon),\n/* harmony export */ handIcon: () => (/* binding */ handIcon),\n/* harmony export */ helpIcon: () => (/* binding */ helpIcon),\n/* harmony export */ iconFillColor: () => (/* binding */ iconFillColor),\n/* harmony export */ laserPointerToolIcon: () => (/* binding */ laserPointerToolIcon),\n/* harmony export */ lineEditorIcon: () => (/* binding */ lineEditorIcon),\n/* harmony export */ loginIcon: () => (/* binding */ loginIcon),\n/* harmony export */ magnetIcon: () => (/* binding */ magnetIcon),\n/* harmony export */ markerFrameIcon: () => (/* binding */ markerFrameIcon),\n/* harmony export */ menu: () => (/* binding */ menu),\n/* harmony export */ mermaidLogoIcon: () => (/* binding */ mermaidLogoIcon),\n/* harmony export */ messageCircleIcon: () => (/* binding */ messageCircleIcon),\n/* harmony export */ microphoneIcon: () => (/* binding */ microphoneIcon),\n/* harmony export */ microphoneMutedIcon: () => (/* binding */ microphoneMutedIcon),\n/* harmony export */ paintIcon: () => (/* binding */ paintIcon),\n/* harmony export */ palette: () => (/* binding */ palette),\n/* harmony export */ pencilIcon: () => (/* binding */ pencilIcon),\n/* harmony export */ playerPlayIcon: () => (/* binding */ playerPlayIcon),\n/* harmony export */ playerStopFilledIcon: () => (/* binding */ playerStopFilledIcon),\n/* harmony export */ pngIcon: () => (/* binding */ pngIcon),\n/* harmony export */ polygonIcon: () => (/* binding */ polygonIcon),\n/* harmony export */ presentationIcon: () => (/* binding */ presentationIcon),\n/* harmony export */ publishIcon: () => (/* binding */ publishIcon),\n/* harmony export */ questionCircle: () => (/* binding */ questionCircle),\n/* harmony export */ resetZoom: () => (/* binding */ resetZoom),\n/* harmony export */ resizeIcon: () => (/* binding */ resizeIcon),\n/* harmony export */ roundArrowIcon: () => (/* binding */ roundArrowIcon),\n/* harmony export */ save: () => (/* binding */ save),\n/* harmony export */ saveAs: () => (/* binding */ saveAs),\n/* harmony export */ searchIcon: () => (/* binding */ searchIcon),\n/* harmony export */ selectAllIcon: () => (/* binding */ selectAllIcon),\n/* harmony export */ share: () => (/* binding */ share),\n/* harmony export */ shareIOS: () => (/* binding */ shareIOS),\n/* harmony export */ shareWindows: () => (/* binding */ shareWindows),\n/* harmony export */ sharpArrowIcon: () => (/* binding */ sharpArrowIcon),\n/* harmony export */ shield: () => (/* binding */ shield),\n/* harmony export */ sidebarRightIcon: () => (/* binding */ sidebarRightIcon),\n/* harmony export */ slashIcon: () => (/* binding */ slashIcon),\n/* harmony export */ start: () => (/* binding */ start),\n/* harmony export */ stop: () => (/* binding */ stop),\n/* harmony export */ strokeIcon: () => (/* binding */ strokeIcon),\n/* harmony export */ svgIcon: () => (/* binding */ svgIcon),\n/* harmony export */ tablerCheckIcon: () => (/* binding */ tablerCheckIcon),\n/* harmony export */ upIcon: () => (/* binding */ upIcon),\n/* harmony export */ usersIcon: () => (/* binding */ usersIcon),\n/* harmony export */ warning: () => (/* binding */ warning),\n/* harmony export */ youtubeIcon: () => (/* binding */ youtubeIcon),\n/* harmony export */ zoomAreaIcon: () => (/* binding */ zoomAreaIcon),\n/* harmony export */ zoomIn: () => (/* binding */ zoomIn),\n/* harmony export */ zoomOut: () => (/* binding */ zoomOut)\n/* harmony export */ });\n/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clsx */ \"../../node_modules/clsx/dist/clsx.m.js\");\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 react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n//\n// All icons are imported from https://fontawesome.com/icons?d=gallery\n// Icons are under the license https://fontawesome.com/license\n//\nvar __rest = undefined && undefined.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n}; // Note: when adding new icons, review https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/RTL_Guidelines\n// to determine whether or not the icons should be mirrored in right-to-left languages.\n\n\n\n\n\n\nconst iconFillColor = theme => \"var(--icon-fill-color)\";\n\nconst handlerColor = theme => theme === _excalidraw_common__WEBPACK_IMPORTED_MODULE_3__.THEME.LIGHT ? open_color__WEBPACK_IMPORTED_MODULE_1__.white : \"#1e1e1e\";\n\nconst createIcon = (d, opts = 512) => {\n const _a = typeof opts === \"number\" ? {\n width: opts\n } : opts,\n {\n width = 512,\n height = width,\n mirror,\n style\n } = _a,\n rest = __rest(_a, [\"width\", \"height\", \"mirror\", \"style\"]);\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"svg\", Object.assign({\n \"aria-hidden\": \"true\",\n focusable: \"false\",\n role: \"img\",\n viewBox: `0 0 ${width} ${height}`,\n className: (0,clsx__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n \"rtl-mirror\": mirror\n }),\n style: style\n }, rest), typeof d === \"string\" ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fill: \"var(--icon-fill-color)\",\n d: d\n }) : d);\n};\nconst tablerIconProps = {\n width: 24,\n height: 24,\n fill: \"none\",\n strokeWidth: 2,\n stroke: \"var(--icon-fill-color)\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n};\nconst modifiedTablerIconProps = {\n width: 20,\n height: 20,\n fill: \"none\",\n stroke: \"var(--icon-fill-color)\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}; // -----------------------------------------------------------------------------\n// tabler-icons: present\n\nconst PlusPromoIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"rect\", {\n x: 3,\n y: 8,\n width: 18,\n height: 4,\n rx: 1\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: 12,\n y1: 8,\n x2: 12,\n y2: 21\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 12v7a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-7\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M7.5 8a2.5 2.5 0 0 1 0 -5a4.8 8 0 0 1 4.5 5a4.8 8 0 0 1 4.5 -5a2.5 2.5 0 0 1 0 5\"\n})), tablerIconProps); // tabler-icons: book\n\nconst LibraryIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 19a9 9 0 0 1 9 0a9 9 0 0 1 9 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 6a9 9 0 0 1 9 0a9 9 0 0 1 9 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"3\",\n y1: \"6\",\n x2: \"3\",\n y2: \"19\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"12\",\n y1: \"6\",\n x2: \"12\",\n y2: \"19\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"21\",\n y1: \"6\",\n x2: \"21\",\n y2: \"19\"\n})), tablerIconProps); // tabler-icons: plus\n\nconst PlusIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"svg\", {\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"12\",\n y1: \"5\",\n x2: \"12\",\n y2: \"19\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"5\",\n y1: \"12\",\n x2: \"19\",\n y2: \"12\"\n})), tablerIconProps); // tabler-icons: dots-vertical\n\nconst DotsIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"circle\", {\n cx: \"12\",\n cy: \"12\",\n r: \"1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"circle\", {\n cx: \"12\",\n cy: \"19\",\n r: \"1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"circle\", {\n cx: \"12\",\n cy: \"5\",\n r: \"1\"\n})), tablerIconProps); // tabler-icons: dots-horizontal (horizontal equivalent of dots-vertical)\n\nconst DotsHorizontalIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\"\n})), tablerIconProps); // tabler-icons: pinned\n\nconst PinIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"svg\", {\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M9 4v6l-2 4v2h10v-2l-2 -4v-6\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"12\",\n y1: \"16\",\n x2: \"12\",\n y2: \"21\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"8\",\n y1: \"4\",\n x2: \"16\",\n y2: \"4\"\n})), tablerIconProps);\nconst polygonIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6.5 9.5l3.5 -3\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M14 5.5l3 1.5\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M18.5 10l-2.5 7\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M13.5 17.5l-7 -5\"\n})), tablerIconProps); // tabler-icons: lock-open (via Figma)\n\nconst UnlockedIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M13.542 8.542H6.458a2.5 2.5 0 0 0-2.5 2.5v3.75a2.5 2.5 0 0 0 2.5 2.5h7.084a2.5 2.5 0 0 0 2.5-2.5v-3.75a2.5 2.5 0 0 0-2.5-2.5Z\",\n stroke: \"var(--icon-fill-color)\" //zsviczian\n ,\n strokeWidth: \"1.25\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10 13.958a1.042 1.042 0 1 0 0-2.083 1.042 1.042 0 0 0 0 2.083Z\",\n stroke: \"var(--icon-fill-color)\" //zsviczian\n ,\n strokeWidth: \"1.25\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"mask\", {\n id: \"UnlockedIcon\",\n style: {\n maskType: \"alpha\"\n },\n maskUnits: \"userSpaceOnUse\",\n x: 6,\n y: 1,\n width: 9,\n height: 9\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M6.399 9.561V5.175c0-.93.401-1.823 1.116-2.48a3.981 3.981 0 0 1 2.693-1.028c1.01 0 1.98.37 2.694 1.027.715.658 1.116 1.55 1.116 2.481\",\n fill: \"#fff\"\n})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n mask: \"url(#UnlockedIcon)\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M5.149 9.561v1.25h2.5v-1.25h-2.5Zm5.06-7.894V.417v1.25Zm2.559 3.508v1.25h2.5v-1.25h-2.5ZM7.648 8.51V5.175h-2.5V8.51h2.5Zm0-3.334c0-.564.243-1.128.713-1.561L6.668 1.775c-.959.883-1.52 2.104-1.52 3.4h2.5Zm.713-1.561a2.732 2.732 0 0 1 1.847-.697v-2.5c-1.31 0-2.585.478-3.54 1.358L8.36 3.614Zm1.847-.697c.71 0 1.374.26 1.847.697l1.694-1.839a5.231 5.231 0 0 0-3.54-1.358v2.5Zm1.847.697c.47.433.713.997.713 1.561h2.5c0-1.296-.56-2.517-1.52-3.4l-1.693 1.839Z\",\n fill: \"var(--icon-fill-color)\" //zsviczian\n\n}))), modifiedTablerIconProps); // tabler-icons: lock (via Figma)\n\nconst LockedIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M13.542 8.542H6.458a2.5 2.5 0 0 0-2.5 2.5v3.75a2.5 2.5 0 0 0 2.5 2.5h7.084a2.5 2.5 0 0 0 2.5-2.5v-3.75a2.5 2.5 0 0 0-2.5-2.5Z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10 13.958a1.042 1.042 0 1 0 0-2.083 1.042 1.042 0 0 0 0 2.083Z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6.667 8.333V5.417C6.667 3.806 8.159 2.5 10 2.5c1.841 0 3.333 1.306 3.333 2.917v2.916\"\n})), modifiedTablerIconProps);\nconst LockedIconFilled = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n fill: \"currentColor\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 2a5 5 0 0 1 5 5v3a3 3 0 0 1 3 3v6a3 3 0 0 1 -3 3h-10a3 3 0 0 1 -3 -3v-6a3 3 0 0 1 3 -3v-3a5 5 0 0 1 5 -5m0 12a2 2 0 0 0 -1.995 1.85l-.005 .15a2 2 0 1 0 2 -2m0 -10a3 3 0 0 0 -3 3v3h6v-3a3 3 0 0 0 -3 -3\"\n})), {\n width: 24,\n height: 24\n}); // custom\n\nconst WelcomeScreenMenuArrow = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M38.5 83.5c-14-2-17.833-10.473-21-22.5C14.333 48.984 12 22 12 12.5\",\n stroke: \"var(--icon-fill-color)\" //zsviczian\n ,\n strokeWidth: 2,\n strokeLinecap: \"round\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"m12.005 10.478 7.905 14.423L6 25.75l6.005-15.273Z\",\n fill: \"var(--icon-fill-color)\" //zsviczian\n\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12.005 10.478c1.92 3.495 3.838 7 7.905 14.423m-7.905-14.423c3.11 5.683 6.23 11.368 7.905 14.423m0 0c-3.68.226-7.35.455-13.91.85m13.91-.85c-5.279.33-10.566.647-13.91.85m0 0c1.936-4.931 3.882-9.86 6.005-15.273M6 25.75c2.069-5.257 4.135-10.505 6.005-15.272\",\n stroke: \"var(--icon-fill-color)\" //zsviczian\n ,\n strokeWidth: 2,\n strokeLinecap: \"round\"\n})), {\n width: 41,\n height: 94,\n fill: \"none\"\n}); // custom\n\nconst WelcomeScreenHelpArrow = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M18.026 1.232c-5.268 13.125-5.548 33.555 3.285 42.311 8.823 8.75 33.31 12.304 42.422 13.523\",\n stroke: \"var(--icon-fill-color)\" //zsviczian\n ,\n strokeWidth: 2,\n strokeLinecap: \"round\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"m72.181 59.247-13.058-10-2.948 13.62 16.006-3.62Z\",\n fill: \"var(--icon-fill-color)\" //zsviczian\n\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M72.181 59.247c-3.163-2.429-6.337-4.856-13.058-10m13.058 10c-5.145-3.936-10.292-7.882-13.058-10m0 0c-.78 3.603-1.563 7.196-2.948 13.62m2.948-13.62c-1.126 5.168-2.24 10.346-2.948 13.62m0 0c5.168-1.166 10.334-2.343 16.006-3.62m-16.006 3.62c5.51-1.248 11.01-2.495 16.006-3.62\",\n stroke: \"var(--icon-fill-color)\" //zsviczian\n ,\n strokeWidth: 2,\n strokeLinecap: \"round\"\n})), {\n width: 85,\n height: 71,\n fill: \"none\"\n}); // custom\n\nconst WelcomeScreenTopToolbarArrow = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M1 77c14-2 31.833-11.973 35-24 3.167-12.016-6-35-9.5-43.5\",\n stroke: \"var(--icon-fill-color)\" //zsviczian\n ,\n strokeWidth: 2,\n strokeLinecap: \"round\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"m24.165 1.093-2.132 16.309 13.27-4.258-11.138-12.05Z\",\n fill: \"var(--icon-fill-color)\" //zsviczian\n\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M24.165 1.093c-.522 3.953-1.037 7.916-2.132 16.309m2.131-16.309c-.835 6.424-1.68 12.854-2.13 16.308m0 0c3.51-1.125 7.013-2.243 13.27-4.257m-13.27 4.257c5.038-1.608 10.08-3.232 13.27-4.257m0 0c-3.595-3.892-7.197-7.777-11.14-12.05m11.14 12.05c-3.837-4.148-7.667-8.287-11.14-12.05\",\n stroke: \"var(--icon-fill-color)\" //zsviczian\n ,\n strokeWidth: 2,\n strokeLinecap: \"round\"\n})), {\n width: 38,\n height: 78,\n fill: \"none\"\n}); // custom\n\nconst ExcalLogo = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n fill: \"--icon-fill-color\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M39.9 32.889a.326.326 0 0 0-.279-.056c-2.094-3.083-4.774-6-7.343-8.833l-.419-.472a.212.212 0 0 0-.056-.139.586.586 0 0 0-.167-.111l-.084-.083-.056-.056c-.084-.167-.28-.278-.475-.167-.782.39-1.507.973-2.206 1.528-.92.722-1.842 1.445-2.708 2.25a8.405 8.405 0 0 0-.977 1.028c-.14.194-.028.361.14.444-.615.611-1.23 1.223-1.843 1.861a.315.315 0 0 0-.084.223c0 .083.056.166.111.194l1.09.833v.028c1.535 1.528 4.244 3.611 7.12 5.861.418.334.865.667 1.284 1 .195.223.39.473.558.695.084.11.28.139.391.055.056.056.14.111.196.167a.398.398 0 0 0 .167.056.255.255 0 0 0 .224-.111.394.394 0 0 0 .055-.167c.029 0 .028.028.056.028a.318.318 0 0 0 .224-.084l5.082-5.528a.309.309 0 0 0 0-.444Zm-14.63-1.917a.485.485 0 0 0 .111.14c.586.5 1.2 1 1.843 1.555l-2.569-1.945-.251-.166c-.056-.028-.112-.084-.168-.111l-.195-.167.056-.056.055-.055.112-.111c.866-.861 2.346-2.306 3.1-3.028-.81.805-2.43 3.167-2.095 3.944Zm8.767 6.89-2.122-1.612a44.713 44.713 0 0 0-2.625-2.5c1.145.861 2.122 1.611 2.262 1.75 1.117.972 1.06.806 1.815 1.445l.921.666a1.06 1.06 0 0 1-.251.25Zm.558.416-.056-.028c.084-.055.168-.111.252-.194l-.196.222ZM1.089 5.75c.055.361.14.722.195 1.056.335 1.833.67 3.5 1.284 4.75l.252.944c.084.361.223.806.363.917 1.424 1.25 3.602 3.11 5.947 4.889a.295.295 0 0 0 .363 0s0 .027.028.027a.254.254 0 0 0 .196.084.318.318 0 0 0 .223-.084c2.988-3.305 5.221-6.027 6.813-8.305.112-.111.14-.278.14-.417.111-.111.195-.25.307-.333.111-.111.111-.306 0-.39l-.028-.027c0-.055-.028-.139-.084-.167-.698-.666-1.2-1.138-1.731-1.638-.922-.862-1.871-1.75-3.881-3.75l-.028-.028c-.028-.028-.056-.056-.112-.056-.558-.194-1.703-.389-3.127-.639C6.087 2.223 3.21 1.723.614.944c0 0-.168 0-.196.028l-.083.084c-.028.027-.056.055-.224.11h.056-.056c.028.167.028.278.084.473 0 .055.112.5.112.555l.782 3.556Zm15.496 3.278-.335-.334c.084.112.196.195.335.334Zm-3.546 4.666-.056.056c0-.028.028-.056.056-.056Zm-2.038-10c.168.167.866.834 1.033.973-.726-.334-2.54-1.167-3.379-1.445.838.167 1.983.334 2.346.472ZM1.424 2.306c.419.722.754 3.222 1.089 5.666-.196-.778-.335-1.555-.503-2.278-.251-1.277-.503-2.416-.838-3.416.056 0 .14 0 .252.028Zm-.168-.584c-.112 0-.223-.028-.307-.028 0-.027 0-.055-.028-.055.14 0 .223.028.335.083Zm-1.089.222c0-.027 0-.027 0 0ZM39.453 1.333c.028-.11-.558-.61-.363-.639.42-.027.42-.666 0-.666-.558.028-1.144.166-1.675.25-.977.194-1.982.389-2.96.61-2.205.473-4.383.973-6.561 1.557-.67.194-1.424.333-2.066.666-.224.111-.196.333-.084.472-.056.028-.084.028-.14.056-.195.028-.363.056-.558.083-.168.028-.252.167-.224.334 0 .027.028.083.028.11-1.173 1.556-2.485 3.195-3.909 4.945-1.396 1.611-2.876 3.306-4.356 5.056-4.719 5.5-10.052 11.75-15.943 17.25a.268.268 0 0 0 0 .389c.028.027.056.055.084.055-.084.084-.168.14-.252.222-.056.056-.084.111-.084.167a.605.605 0 0 0-.111.139c-.112.111-.112.305.028.389.111.11.307.11.39-.028.029-.028.029-.056.056-.056a.44.44 0 0 1 .615 0c.335.362.67.723.977 1.028l-.698-.583c-.112-.111-.307-.083-.39.028-.113.11-.085.305.027.389l7.427 6.194c.056.056.112.056.196.056s.14-.028.195-.084l.168-.166c.028.027.083.027.111.027.084 0 .14-.027.196-.083 10.052-10.055 18.15-17.639 27.42-24.417.083-.055.111-.166.111-.25.112 0 .196-.083.251-.194 1.704-5.194 2.039-9.806 2.15-12.083v-.028c0-.028.028-.056.028-.083.028-.056.028-.084.028-.084a1.626 1.626 0 0 0-.111-1.028ZM21.472 9.5c.446-.5.893-1.028 1.34-1.5-2.876 3.778-7.65 9.583-14.408 16.5 4.607-5.083 9.242-10.333 13.068-15ZM5.193 35.778h.084-.084Zm3.462 3.194c-.027-.028-.027-.028 0-.028v.028Zm4.16-3.583c.224-.25.448-.472.699-.722 0 0 0 .027.028.027-.252.223-.475.445-.726.695Zm1.146-1.111c.14-.14.279-.334.446-.5l.028-.028c1.648-1.694 3.351-3.389 5.082-5.111l.028-.028c.419-.333.921-.694 1.368-1.028a379.003 379.003 0 0 0-6.952 6.695ZM24.794 6.472c-.921 1.195-1.954 2.778-2.82 4.028-2.736 3.944-11.532 13.583-11.727 13.75a1976.983 1976.983 0 0 1-8.042 7.639l-.167.167c-.14-.167-.14-.417.028-.556C14.49 19.861 22.03 10.167 25.074 5.917c-.084.194-.14.36-.28.555Zm4.83 5.695c-1.116-.64-1.646-1.64-1.34-2.611l.084-.334c.028-.083.084-.194.14-.277.307-.5.754-.917 1.257-1.167.027 0 .055 0 .083-.028-.028-.056-.028-.139-.028-.222.028-.167.14-.278.335-.278.335 0 1.369.306 1.76.639.111.083.223.194.335.305.14.167.363.445.474.667.056.028.112.306.196.445.056.222.111.472.084.694-.028.028 0 .194-.028.194a2.668 2.668 0 0 1-.363 1.028c-.028.028-.028.056-.056.084l-.028.027c-.14.223-.335.417-.53.556-.643.444-1.369.583-2.095.389 0 0-.195-.084-.28-.111Zm8.154-.834a39.098 39.098 0 0 1-.893 3.167c0 .028-.028.083 0 .111-.056 0-.084.028-.14.056-2.206 1.61-4.356 3.305-6.506 5.028 1.843-1.64 3.686-3.306 5.613-4.945.558-.5.949-1.139 1.06-1.861l.28-1.667v-.055c.14-.334.67-.195.586.166Z\",\n fill: \"--icon-fill-color\"\n})), {\n width: 40,\n height: 40,\n fill: \"none\"\n}); // custom\n\nconst SelectionIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"var(--icon-fill-color)\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6 6l4.153 11.793a0.365 .365 0 0 0 .331 .207a0.366 .366 0 0 0 .332 -.207l2.184 -4.793l4.787 -1.994a0.355 .355 0 0 0 .213 -.323a0.355 .355 0 0 0 -.213 -.323l-11.787 -4.36z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M13.5 13.5l4.5 4.5\"\n})), {\n fill: \"none\",\n width: 22,\n height: 22,\n strokeWidth: 1.25\n});\nconst LassoIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n strokeWidth: 1.5\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4.028 13.252c-.657 -.972 -1.028 -2.078 -1.028 -3.252c0 -3.866 4.03 -7 9 -7s9 3.134 9 7s-4.03 7 -9 7c-1.913 0 -3.686 -.464 -5.144 -1.255\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 15m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 17c0 1.42 .316 2.805 1 4\"\n})), {\n fill: \"none\",\n width: 22,\n height: 22,\n strokeWidth: 1.25\n}); // tabler-icons: square\n\nconst RectangleIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"rect\", {\n x: \"4\",\n y: \"4\",\n width: \"16\",\n height: \"16\",\n rx: \"2\"\n})), tablerIconProps); // tabler-icons: square-rotated\n\nconst DiamondIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10.5 20.4l-6.9 -6.9c-.781 -.781 -.781 -2.219 0 -3l6.9 -6.9c.781 -.781 2.219 -.781 3 0l6.9 6.9c.781 .781 .781 2.219 0 3l-6.9 6.9c-.781 .781 -2.219 .781 -3 0z\"\n})), tablerIconProps); // tabler-icons: circle\n\nconst EllipseIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"circle\", {\n cx: \"12\",\n cy: \"12\",\n r: \"9\"\n})), tablerIconProps); // tabler-icons: arrow-narrow-right\n\nconst ArrowIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"5\",\n y1: \"12\",\n x2: \"19\",\n y2: \"12\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"15\",\n y1: \"16\",\n x2: \"19\",\n y2: \"12\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"15\",\n y1: \"8\",\n x2: \"19\",\n y2: \"12\"\n})), tablerIconProps); // custom?\n\nconst LineIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4.167 10h11.666\",\n strokeWidth: \"1.5\"\n}), modifiedTablerIconProps);\nconst PenModeIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M20 17v-12c0 -1.121 -.879 -2 -2 -2s-2 .879 -2 2v12l2 2l2 -2z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16 7h4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M18 19h-13a2 2 0 1 1 0 -4h4a2 2 0 1 0 0 -4h-3\"\n})), tablerIconProps); // modified tabler-icons: pencil\n\nconst FreedrawIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n clipRule: \"evenodd\",\n d: \"m7.643 15.69 7.774-7.773a2.357 2.357 0 1 0-3.334-3.334L4.31 12.357a3.333 3.333 0 0 0-.977 2.357v1.953h1.953c.884 0 1.732-.352 2.357-.977Z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"m11.25 5.417 3.333 3.333\"\n})), modifiedTablerIconProps); // tabler-icons: typography\n\nconst TextIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"4\",\n y1: \"20\",\n x2: \"7\",\n y2: \"20\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"14\",\n y1: \"20\",\n x2: \"21\",\n y2: \"20\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"6.9\",\n y1: \"15\",\n x2: \"13.8\",\n y2: \"15\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"10.2\",\n y1: \"6.3\",\n x2: \"16\",\n y2: \"20\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"polyline\", {\n points: \"5 20 11 4 13 4 20 20\"\n})), tablerIconProps);\nconst TextSizeIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\",\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 7v-2h13v2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10 5v14\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 19h-4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15 13v-1h6v1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M18 12v7\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M17 19h2\"\n})), tablerIconProps); // modified tabler-icons: photo\n\nconst ImageIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12.5 6.667h.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4.91 2.625h10.18a2.284 2.284 0 0 1 2.285 2.284v10.182a2.284 2.284 0 0 1-2.284 2.284H4.909a2.284 2.284 0 0 1-2.284-2.284V4.909a2.284 2.284 0 0 1 2.284-2.284Z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"m3.333 12.5 3.334-3.333c.773-.745 1.726-.745 2.5 0l4.166 4.166\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"m11.667 11.667.833-.834c.774-.744 1.726-.744 2.5 0l1.667 1.667\"\n})), modifiedTablerIconProps); // tabler-icons: eraser\n\nconst EraserIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 20h-10.5l-4.21 -4.3a1 1 0 0 1 0 -1.41l10 -10a1 1 0 0 1 1.41 0l5 5a1 1 0 0 1 0 1.41l-9.2 9.3\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M18 13.3l-6.3 -6.3\"\n})), tablerIconProps);\nconst ZoomInIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n strokeWidth: \"1.25\",\n d: \"M10 4.167v11.666M4.167 10h11.666\"\n}), modifiedTablerIconProps);\nconst ZoomOutIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 10h10\",\n strokeWidth: \"1.25\"\n}), modifiedTablerIconProps);\nconst ZoomResetIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M21 21l-6 -6\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3.268 12.043a7.017 7.017 0 0 0 6.634 4.957a7.012 7.012 0 0 0 7.043 -6.131a7 7 0 0 0 -5.314 -7.672a7.021 7.021 0 0 0 -8.241 4.403\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 4v4h4\"\n})), tablerIconProps);\nconst TrashIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n strokeWidth: \"1.25\",\n d: \"M3.333 5.833h13.334M8.333 9.167v5M11.667 9.167v5M4.167 5.833l.833 10c0 .92.746 1.667 1.667 1.667h6.666c.92 0 1.667-.746 1.667-1.667l.833-10M7.5 5.833v-2.5c0-.46.373-.833.833-.833h3.334c.46 0 .833.373.833.833v2.5\"\n}), modifiedTablerIconProps);\nconst EmbedIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"polyline\", {\n points: \"12 16 18 10 12 4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"polyline\", {\n points: \"8 4 2 10 8 16\"\n})), modifiedTablerIconProps);\nconst DuplicateIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M14.375 6.458H8.958a2.5 2.5 0 0 0-2.5 2.5v5.417a2.5 2.5 0 0 0 2.5 2.5h5.417a2.5 2.5 0 0 0 2.5-2.5V8.958a2.5 2.5 0 0 0-2.5-2.5Z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n clipRule: \"evenodd\",\n d: \"M11.667 3.125c.517 0 .986.21 1.325.55.34.338.55.807.55 1.325v1.458H8.333c-.485 0-.927.185-1.26.487-.343.312-.57.75-.609 1.24l-.005 5.357H5a1.87 1.87 0 0 1-1.326-.55 1.87 1.87 0 0 1-.549-1.325V5c0-.518.21-.987.55-1.326.338-.34.807-.549 1.325-.549h6.667Z\"\n})), modifiedTablerIconProps);\nconst MoonIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n clipRule: \"evenodd\",\n d: \"M10 2.5h.328a6.25 6.25 0 0 0 6.6 10.372A7.5 7.5 0 1 1 10 2.493V2.5Z\",\n stroke: \"var(--icon-fill-color)\" //zsviczian\n\n}), modifiedTablerIconProps);\nconst SunIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"var(--icon-fill-color)\" //zsviczian\n ,\n strokeLinejoin: \"round\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM10 4.167V2.5M14.167 5.833l1.166-1.166M15.833 10H17.5M14.167 14.167l1.166 1.166M10 15.833V17.5M5.833 14.167l-1.166 1.166M5 10H3.333M5.833 5.833 4.667 4.667\"\n})), Object.assign(Object.assign({}, modifiedTablerIconProps), {\n strokeWidth: 1.5\n}));\nconst HamburgerMenuIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"4\",\n y1: \"6\",\n x2: \"20\",\n y2: \"6\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"4\",\n y1: \"12\",\n x2: \"20\",\n y2: \"12\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"4\",\n y1: \"18\",\n x2: \"20\",\n y2: \"18\"\n})), tablerIconProps);\nconst ExportIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n strokeWidth: \"1.25\",\n d: \"M3.333 14.167v1.666c0 .92.747 1.667 1.667 1.667h10c.92 0 1.667-.746 1.667-1.667v-1.666M5.833 9.167 10 13.333l4.167-4.166M10 3.333v10\"\n}), modifiedTablerIconProps);\nconst HelpIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"circle\", {\n cx: \"12\",\n cy: \"12\",\n r: \"9\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"12\",\n y1: \"17\",\n x2: \"12\",\n y2: \"17.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4\"\n})), tablerIconProps);\nconst HelpIconThin = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"circle\", {\n cx: \"12\",\n cy: \"12\",\n r: \"9\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"12\",\n y1: \"17\",\n x2: \"12\",\n y2: \"17.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4\"\n})), tablerIconProps);\nconst ExternalLinkIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n strokeWidth: \"1.25\",\n d: \"M9.167 5.833H5.833c-1.254 0-2.5 1.282-2.5 2.5v5.834c0 1.283 1.252 2.5 2.5 2.5h5.834c1.251 0 2.5-1.25 2.5-2.5v-3.334M8.333 11.667l8.334-8.334M12.5 3.333h4.167V7.5\"\n}), modifiedTablerIconProps);\nconst GithubIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M7.5 15.833c-3.583 1.167-3.583-2.083-5-2.5m10 4.167v-2.917c0-.833.083-1.166-.417-1.666 2.334-.25 4.584-1.167 4.584-5a3.833 3.833 0 0 0-1.084-2.667 3.5 3.5 0 0 0-.083-2.667s-.917-.25-2.917 1.084a10.25 10.25 0 0 0-5.166 0C5.417 2.333 4.5 2.583 4.5 2.583a3.5 3.5 0 0 0-.083 2.667 3.833 3.833 0 0 0-1.084 2.667c0 3.833 2.25 4.75 4.584 5-.5.5-.5 1-.417 1.666V17.5\",\n strokeWidth: \"1.25\"\n}), modifiedTablerIconProps);\nconst DiscordIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M7.5 10.833a.833.833 0 1 0 0-1.666.833.833 0 0 0 0 1.666ZM12.5 10.833a.833.833 0 1 0 0-1.666.833.833 0 0 0 0 1.666ZM6.25 6.25c2.917-.833 4.583-.833 7.5 0M5.833 13.75c2.917.833 5.417.833 8.334 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12.917 14.167c0 .833 1.25 2.5 1.666 2.5 1.25 0 2.361-1.39 2.917-2.5.556-1.39.417-4.861-1.25-9.584-1.214-.846-2.5-1.116-3.75-1.25l-.833 2.084M7.083 14.167c0 .833-1.13 2.5-1.526 2.5-1.191 0-2.249-1.39-2.778-2.5-.529-1.39-.397-4.861 1.19-9.584 1.157-.846 2.318-1.116 3.531-1.25l.833 2.084\"\n})), modifiedTablerIconProps);\nconst XBrandIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 4l11.733 16h4.267l-11.733 -16z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772\"\n})), tablerIconProps);\nconst checkIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"polyline\", {\n fill: \"none\",\n stroke: \"var(--icon-fill-color)\",\n points: \"20 6 9 17 4 12\"\n}), {\n width: 24,\n height: 24\n});\nconst LinkIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8.333 11.667a2.917 2.917 0 0 0 4.167 0l3.333-3.334a2.946 2.946 0 1 0-4.166-4.166l-.417.416\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M11.667 8.333a2.917 2.917 0 0 0-4.167 0l-3.333 3.334a2.946 2.946 0 0 0 4.166 4.166l.417-.416\"\n})), modifiedTablerIconProps);\nconst save = createIcon(\"M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z\", {\n width: 448,\n height: 512\n});\nconst saveAs = createIcon(\"M252 54L203 8a28 27 0 00-20-8H28C12 0 0 12 0 27v195c0 15 12 26 28 26h204c15 0 28-11 28-26V73a28 27 0 00-8-19zM130 213c-21 0-37-16-37-36 0-19 16-35 37-35 20 0 37 16 37 35 0 20-17 36-37 36zm56-169v56c0 4-4 6-7 6H44c-4 0-7-2-7-6V42c0-4 3-7 7-7h133l4 2 3 2a7 7 0 012 5z M296 201l87 95-188 205-78 9c-10 1-19-8-18-20l9-84zm141-14l-41-44a31 31 0 00-46 0l-38 41 87 95 38-42c13-14 13-36 0-50z\", {\n width: 448,\n height: 512\n}); // tabler-icon: folder\n\nconst LoadIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"m9.257 6.351.183.183H15.819c.34 0 .727.182 1.051.506.323.323.505.708.505 1.05v5.819c0 .316-.183.7-.52 1.035-.337.338-.723.522-1.037.522H4.182c-.352 0-.74-.181-1.058-.5-.318-.318-.499-.705-.499-1.057V5.182c0-.351.181-.736.5-1.054.32-.321.71-.503 1.057-.503H6.53l2.726 2.726Z\",\n strokeWidth: \"1.25\"\n}), modifiedTablerIconProps);\nconst clipboard = createIcon(\"M384 112v352c0 26.51-21.49 48-48 48H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h80c0-35.29 28.71-64 64-64s64 28.71 64 64h80c26.51 0 48 21.49 48 48zM192 40c-13.255 0-24 10.745-24 24s10.745 24 24 24 24-10.745 24-24-10.745-24-24-24m96 114v-20a6 6 0 0 0-6-6H102a6 6 0 0 0-6 6v20a6 6 0 0 0 6 6h180a6 6 0 0 0 6-6z\", {\n width: 384,\n height: 512\n});\nconst palette = createIcon(\"M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z\");\nconst bucketFillIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 16l1.465 1.638a2 2 0 1 1 -3.015 .099l1.55 -1.737z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M13.737 9.737c2.299 -2.3 3.23 -5.095 2.081 -6.245c-1.15 -1.15 -3.945 -.217 -6.244 2.082c-2.3 2.299 -3.231 5.095 -2.082 6.244c1.15 1.15 3.946 .218 6.245 -2.081z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M7.492 11.818c.362 .362 .768 .676 1.208 .934l6.895 4.047c1.078 .557 2.255 -.075 3.692 -1.512c1.437 -1.437 2.07 -2.614 1.512 -3.692c-.372 -.718 -1.72 -3.017 -4.047 -6.895a6.015 6.015 0 0 0 -.934 -1.208\"\n})), tablerIconProps); // simple / icon\n\nconst slashIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.5\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6 18l12 -12\"\n})), tablerIconProps);\nconst ExportImageIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15 8h.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 20h-5a3 3 0 0 1 -3 -3v-10a3 3 0 0 1 3 -3h10a3 3 0 0 1 3 3v5\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 15l4 -4c.928 -.893 2.072 -.893 3 0l4 4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M14 14l1 -1c.617 -.593 1.328 -.793 2.009 -.598\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 16v6\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M22 19l-3 3l-3 -3\"\n})), tablerIconProps);\nconst exportToFileIcon = createIcon(\"M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z\", {\n width: 512,\n height: 512\n});\nconst zoomIn = createIcon(\"M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\", {\n width: 448,\n height: 512\n});\nconst zoomOut = createIcon(\"M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z\", {\n width: 448,\n height: 512\n});\nconst done = createIcon(\"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z\");\nconst menu = createIcon(\"M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z\");\nconst UndoIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M7.5 10.833 4.167 7.5 7.5 4.167M4.167 7.5h9.166a3.333 3.333 0 0 1 0 6.667H12.5\",\n strokeWidth: \"1.25\"\n}), modifiedTablerIconProps);\nconst RedoIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12.5 10.833 15.833 7.5 12.5 4.167M15.833 7.5H6.667a3.333 3.333 0 1 0 0 6.667H7.5\",\n strokeWidth: \"1.25\"\n}), modifiedTablerIconProps);\nconst questionCircle = createIcon(\"M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zM262.655 90c-54.497 0-89.255 22.957-116.549 63.758-3.536 5.286-2.353 12.415 2.715 16.258l34.699 26.31c5.205 3.947 12.621 3.008 16.665-2.122 17.864-22.658 30.113-35.797 57.303-35.797 20.429 0 45.698 13.148 45.698 32.958 0 14.976-12.363 22.667-32.534 33.976C247.128 238.528 216 254.941 216 296v4c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12v-1.333c0-28.462 83.186-29.647 83.186-106.667 0-58.002-60.165-102-116.531-102zM256 338c-25.365 0-46 20.635-46 46 0 25.364 20.635 46 46 46s46-20.636 46-46c0-25.365-20.635-46-46-46z\", {\n mirror: true\n});\nconst share = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 12.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM15 7.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM15 17.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5ZM7.25 8.917l5.5-2.834M7.25 11.083l5.5 2.834\",\n strokeWidth: \"1.5\"\n}), modifiedTablerIconProps);\nconst warning = createIcon(\"M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z\");\nconst shareIOS = createIcon(\"M16 5l-1.42 1.42-1.59-1.59V16h-1.98V4.83L9.42 6.42 8 5l4-4 4 4zm4 5v11c0 1.1-.9 2-2 2H6c-1.11 0-2-.9-2-2V10c0-1.11.89-2 2-2h3v2H6v11h12V10h-3V8h3c1.1 0 2 .89 2 2z\", {\n width: 24,\n height: 24\n});\nconst exportToPlus = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 9h-1a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-8a2 2 0 0 0 -2 -2h-1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 14v-11\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M9 6l3 -3l3 3\"\n})), tablerIconProps);\nconst shareWindows = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fill: \"var(--icon-fill-color)\" //zsviczian\n ,\n d: \"M40 5.6v6.1l-4.1.7c-8.9 1.4-16.5 6.9-20.6 15C13 32 10.9 43 12.4 43c.4 0 2.4-1.3 4.4-3 5-3.9 12.1-7 18.2-7.7l5-.6v12.8l11.2-11.3L62.5 22 51.2 10.8 40-.5v6.1zm10.2 22.6L44 34.5v-6.8l-6.9.6c-3.9.3-9.8 1.7-13.2 3.1-3.5 1.4-6.5 2.4-6.7 2.2-.9-1 3-7.5 6.4-10.8C28 18.6 34.4 16 40.1 16c3.7 0 3.9-.1 3.9-3.2V9.5l6.2 6.3 6.3 6.2-6.3 6.2z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"var(--icon-fill-color)\" //zsviczian\n ,\n fill: \"var(--icon-fill-color)\" //zsviczian\n ,\n d: \"M0 36v20h48v-6.2c0-6 0-6.1-2-4.3-1.1 1-2 2.9-2 4.2V52H4V34c0-17.3-.1-18-2-18s-2 .7-2 20z\"\n})), {\n width: 64,\n height: 64\n}); // Icon imported form Storybook\n// Storybook is licensed under MIT https://github.com/storybookjs/storybook/blob/next/LICENSE\n\nconst resetZoom = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"var(--icon-fill-color)\" //zsviczian\n ,\n strokeWidth: \"40\",\n fill: \"var(--icon-fill-color)\" //zsviczian\n ,\n d: \"M148 560a318 318 0 0 0 522 110 316 316 0 0 0 0-450 316 316 0 0 0-450 0c-11 11-21 22-30 34v4h47c25 0 46 21 46 46s-21 45-46 45H90c-13 0-25-6-33-14-9-9-14-20-14-33V156c0-25 20-45 45-45s45 20 45 45v32l1 1a401 401 0 0 1 623 509l212 212a42 42 0 0 1-59 59L698 757A401 401 0 0 1 65 570a42 42 0 0 1 83-10z\"\n}), {\n width: 1024\n});\nconst arrowBarToTopJSX = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.5\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 10l0 10\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 10l4 4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 10l-4 4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 4l16 0\"\n}));\nconst arrownNarrowUpJSX = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.5\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 5l0 14\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16 9l-4 -4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 9l4 -4\"\n}));\nconst BringForwardIcon = createIcon(arrownNarrowUpJSX, tablerIconProps);\nconst SendBackwardIcon = createIcon(arrownNarrowUpJSX, Object.assign(Object.assign({}, tablerIconProps), {\n style: {\n transform: \"rotate(180deg)\"\n }\n}));\nconst BringToFrontIcon = createIcon(arrowBarToTopJSX, tablerIconProps);\nconst SendToBackIcon = createIcon(arrowBarToTopJSX, Object.assign(Object.assign({}, tablerIconProps), {\n style: {\n transform: \"rotate(180deg)\"\n }\n})); //\n// Align action icons created from scratch to match those of z-index actions\n// Note: vertical align icons are flipped so the larger item is always the\n// first one the user sees. Horizontal align icons should not be flipped since\n// that would make them lie about their function.\n//\n\nconst AlignTopIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n clipPath: \"url(#a)\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3.333 3.333h13.334\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M13.542 6.458h-.417c-.92 0-1.667.747-1.667 1.667v7.083c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667V8.125c0-.92-.746-1.667-1.666-1.667ZM6.875 6.458h-.417c-.92 0-1.666.747-1.666 1.667v3.75c0 .92.746 1.667 1.666 1.667h.417c.92 0 1.667-.746 1.667-1.667v-3.75c0-.92-.747-1.667-1.667-1.667Z\"\n})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"clipPath\", {\n id: \"a\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fill: \"#fff\",\n d: \"M0 0h20v20H0z\"\n})))), modifiedTablerIconProps);\nconst AlignBottomIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n clipPath: \"url(#a)\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3.333 16.667h13.334\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6.875 3.125h-.417c-.92 0-1.666.746-1.666 1.667v7.083c0 .92.746 1.667 1.666 1.667h.417c.92 0 1.667-.746 1.667-1.667V4.792c0-.92-.747-1.667-1.667-1.667ZM13.542 5.817h-.417c-.92 0-1.667.747-1.667 1.667v4.391c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667V7.484c0-.92-.746-1.667-1.666-1.667Z\"\n})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"clipPath\", {\n id: \"a\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fill: \"#fff\",\n d: \"M0 0h20v20H0z\"\n})))), modifiedTablerIconProps);\nconst AlignLeftIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n clipPath: \"url(#a)\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3.333 3.333v13.334\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15.208 4.792H8.125c-.92 0-1.667.746-1.667 1.666v.417c0 .92.747 1.667 1.667 1.667h7.083c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666ZM12.516 11.458H8.125c-.92 0-1.667.746-1.667 1.667v.417c0 .92.747 1.666 1.667 1.666h4.391c.92 0 1.667-.746 1.667-1.666v-.417c0-.92-.746-1.667-1.667-1.667Z\"\n})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"clipPath\", {\n id: \"a\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fill: \"#fff\",\n d: \"M0 0h20v20H0z\"\n})))), modifiedTablerIconProps);\nconst AlignRightIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n clipPath: \"url(#a)\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16.667 3.333v13.334\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M11.875 4.792H4.792c-.92 0-1.667.746-1.667 1.666v.417c0 .92.746 1.667 1.667 1.667h7.083c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666ZM11.683 11.458H7.292c-.92 0-1.667.746-1.667 1.667v.417c0 .92.746 1.666 1.667 1.666h4.39c.921 0 1.667-.746 1.667-1.666v-.417c0-.92-.746-1.667-1.666-1.667Z\"\n})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"clipPath\", {\n id: \"a\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fill: \"#fff\",\n d: \"M0 0h20v20H0z\"\n})))), modifiedTablerIconProps);\nconst DistributeHorizontallyIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n clipPath: \"url(#a)\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16.667 3.333v13.334M3.333 3.333v13.334\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M14.375 10.208v-.416c0-.92-.746-1.667-1.667-1.667H7.292c-.92 0-1.667.746-1.667 1.667v.416c0 .92.746 1.667 1.667 1.667h5.416c.92 0 1.667-.746 1.667-1.667Z\"\n})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"clipPath\", {\n id: \"a\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fill: \"#fff\",\n d: \"M0 0h20v20H0z\"\n})))), modifiedTablerIconProps);\nconst DistributeVerticallyIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n clipPath: \"url(#a)\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3.333 3.333h13.334M3.333 16.667h13.334\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10.208 5.625h-.416c-.92 0-1.667.746-1.667 1.667v5.416c0 .92.746 1.667 1.667 1.667h.416c.92 0 1.667-.746 1.667-1.667V7.292c0-.92-.746-1.667-1.667-1.667Z\"\n})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"clipPath\", {\n id: \"a\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fill: \"#fff\",\n d: \"M0 0h20v20H0z\"\n})))), modifiedTablerIconProps);\nconst CenterVerticallyIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M1.667 10h2.916\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8.333 10h3.334\",\n strokeLinejoin: \"round\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15.417 10h2.916\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6.875 4.792h-.417c-.92 0-1.666.746-1.666 1.666v7.084c0 .92.746 1.666 1.666 1.666h.417c.92 0 1.667-.746 1.667-1.666V6.458c0-.92-.747-1.666-1.667-1.666ZM13.542 6.458h-.417c-.92 0-1.667.747-1.667 1.667v3.75c0 .92.746 1.667 1.667 1.667h.417c.92 0 1.666-.746 1.666-1.667v-3.75c0-.92-.746-1.667-1.666-1.667Z\"\n})), modifiedTablerIconProps);\nconst CenterHorizontallyIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10 18.333v-2.916\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10 11.667V8.333\",\n strokeLinejoin: \"round\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10 4.583V1.667\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4.792 13.125v.417c0 .92.746 1.666 1.666 1.666h7.084c.92 0 1.666-.746 1.666-1.666v-.417c0-.92-.746-1.667-1.666-1.667H6.458c-.92 0-1.666.746-1.666 1.667ZM6.458 6.458v.417c0 .92.747 1.667 1.667 1.667h3.75c.92 0 1.667-.747 1.667-1.667v-.417c0-.92-.746-1.666-1.667-1.666h-3.75c-.92 0-1.667.746-1.667 1.666Z\"\n})), modifiedTablerIconProps);\nconst usersIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"circle\", {\n cx: \"9\",\n cy: \"7\",\n r: \"4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16 3.13a4 4 0 0 1 0 7.75\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M21 21v-2a4 4 0 0 0 -3 -3.85\"\n})), tablerIconProps); // not mirrored because it's inspired by a playback control, which is always RTL\n\nconst start = createIcon(\"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm115.7 272l-176 101c-15.8 8.8-35.7-2.5-35.7-21V152c0-18.4 19.8-29.8 35.7-21l176 107c16.4 9.2 16.4 32.9 0 42z\");\nconst stop = createIcon(\"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm96 328c0 8.8-7.2 16-16 16H176c-8.8 0-16-7.2-16-16V176c0-8.8 7.2-16 16-16h160c8.8 0 16 7.2 16 16v160z\");\nconst CloseIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n clipPath: \"url(#a)\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15 5 5 15M5 5l10 10\"\n})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"clipPath\", {\n id: \"a\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fill: \"#fff\",\n d: \"M0 0h20v20H0z\"\n})))), modifiedTablerIconProps);\nconst clone = createIcon(\"M464 0c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48H176c-26.51 0-48-21.49-48-48V48c0-26.51 21.49-48 48-48h288M176 416c-44.112 0-80-35.888-80-80V128H48c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h288c26.51 0 48-21.49 48-48v-48H176z\", {\n mirror: true\n}); // modified https://feathericons.com/?query=shield\n\nconst shield = createIcon(\"M11.553 22.894a.998.998 0 00.894 0s3.037-1.516 5.465-4.097C19.616 16.987 21 14.663 21 12V5a1 1 0 00-.649-.936l-8-3a.998.998 0 00-.702 0l-8 3A1 1 0 003 5v7c0 2.663 1.384 4.987 3.088 6.797 2.428 2.581 5.465 4.097 5.465 4.097zm-1.303-8.481l6.644-6.644a.856.856 0 111.212 1.212l-7.25 7.25a.856.856 0 01-1.212 0l-3.75-3.75a.856.856 0 111.212-1.212l3.144 3.144z\", {\n width: 24\n});\nconst file = createIcon(\"M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48zm32-48h224V288l-23.5-23.5c-4.7-4.7-12.3-4.7-17 0L176 352l-39.5-39.5c-4.7-4.7-12.3-4.7-17 0L80 352v64zm48-240c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48z\", {\n width: 384,\n height: 512\n}); // TODO barnabasmolnar/editor-redesign\n// couldn't find a new icon for this\n\nconst GroupIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n theme\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M25 26H111V111H25\",\n fill: iconFillColor(theme)\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z\",\n stroke: iconFillColor(theme),\n strokeWidth: \"2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M100 100H160V160H100\",\n fill: iconFillColor(theme)\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z\",\n stroke: iconFillColor(theme),\n strokeWidth: \"2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n fill: handlerColor(theme),\n stroke: iconFillColor(theme),\n strokeWidth: \"6\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"rect\", {\n x: \"2.5\",\n y: \"2.5\",\n width: \"30\",\n height: \"30\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"rect\", {\n x: \"2.5\",\n y: \"149.5\",\n width: \"30\",\n height: \"30\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"rect\", {\n x: \"147.5\",\n y: \"149.5\",\n width: \"30\",\n height: \"30\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"rect\", {\n x: \"147.5\",\n y: \"2.5\",\n width: \"30\",\n height: \"30\"\n}))), {\n width: 182,\n height: 182,\n mirror: true\n}));\nconst UngroupIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n theme\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M25 26H111V111H25\",\n fill: iconFillColor(theme)\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M25 111C25 80.2068 25 49.4135 25 26M25 26C48.6174 26 72.2348 26 111 26H25ZM25 26C53.3671 26 81.7343 26 111 26H25ZM111 26C111 52.303 111 78.606 111 111V26ZM111 26C111 51.2947 111 76.5893 111 111V26ZM111 111C87.0792 111 63.1585 111 25 111H111ZM111 111C87.4646 111 63.9293 111 25 111H111ZM25 111C25 81.1514 25 51.3028 25 26V111Z\",\n stroke: iconFillColor(theme),\n strokeWidth: \"2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M100 100H160V160H100\",\n fill: iconFillColor(theme)\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M100 160C100 144.106 100 128.211 100 100M100 100C117.706 100 135.412 100 160 100H100ZM100 100C114.214 100 128.428 100 160 100H100ZM160 100C160 120.184 160 140.369 160 160V100ZM160 100C160 113.219 160 126.437 160 160V100ZM160 160C145.534 160 131.068 160 100 160H160ZM160 160C143.467 160 126.934 160 100 160H160ZM100 160C100 143.661 100 127.321 100 100V160Z\",\n stroke: iconFillColor(theme),\n strokeWidth: \"2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n fill: handlerColor(theme),\n stroke: iconFillColor(theme),\n strokeWidth: \"6\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"rect\", {\n x: \"2.5\",\n y: \"2.5\",\n width: \"30\",\n height: \"30\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"rect\", {\n x: \"78.5\",\n y: \"149.5\",\n width: \"30\",\n height: \"30\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"rect\", {\n x: \"147.5\",\n y: \"149.5\",\n width: \"30\",\n height: \"30\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"rect\", {\n x: \"147.5\",\n y: \"78.5\",\n width: \"30\",\n height: \"30\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"rect\", {\n x: \"105.5\",\n y: \"2.5\",\n width: \"30\",\n height: \"30\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"rect\", {\n x: \"2.5\",\n y: \"102.5\",\n width: \"30\",\n height: \"30\"\n}))), {\n width: 182,\n height: 182,\n mirror: true\n}));\nconst FillZigZagIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5.879 2.625h8.242a3.27 3.27 0 0 1 3.254 3.254v8.242a3.27 3.27 0 0 1-3.254 3.254H5.88a3.27 3.27 0 0 1-3.254-3.254V5.88A3.27 3.27 0 0 1 5.88 2.626l-.001-.001ZM4.518 16.118l7.608-12.83m.198 13.934 5.051-9.897M2.778 9.675l9.348-6.387m-7.608 12.83 12.857-8.793\"\n})), modifiedTablerIconProps);\nconst FillHachureIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"mask\", {\n id: \"FillHachureIcon\",\n style: {\n maskType: \"alpha\"\n },\n maskUnits: \"userSpaceOnUse\",\n x: 2,\n y: 2,\n width: 16,\n height: 16\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z\",\n fill: \"var(--icon-fill-color)\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\"\n})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n mask: \"url(#FillHachureIcon)\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M2.258 15.156 15.156 2.258M7.324 20.222 20.222 7.325m-20.444 5.35L12.675-.222m-8.157 18.34L17.416 5.22\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}))), modifiedTablerIconProps);\nconst FillCrossHatchIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n clipPath: \"url(#a)\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5.879 2.625h8.242a3.254 3.254 0 0 1 3.254 3.254v8.242a3.254 3.254 0 0 1-3.254 3.254H5.88a3.254 3.254 0 0 1-3.254-3.254V5.88a3.254 3.254 0 0 1 3.254-3.254Z\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"mask\", {\n id: \"FillCrossHatchIcon\",\n style: {\n maskType: \"alpha\"\n },\n maskUnits: \"userSpaceOnUse\",\n x: -1,\n y: -1,\n width: 22,\n height: 22\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M2.426 15.044 15.044 2.426M7.383 20 20 7.383M0 12.617 12.617 0m-7.98 17.941L17.256 5.324m-2.211 12.25L2.426 4.956M20 12.617 7.383 0m5.234 20L0 7.383m17.941 7.98L5.324 2.745\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n mask: \"url(#FillCrossHatchIcon)\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M14.121 2H5.88A3.879 3.879 0 0 0 2 5.879v8.242A3.879 3.879 0 0 0 5.879 18h8.242A3.879 3.879 0 0 0 18 14.121V5.88A3.879 3.879 0 0 0 14.121 2Z\",\n fill: \"var(--icon-fill-color)\"\n}))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"clipPath\", {\n id: \"a\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fill: \"#fff\",\n d: \"M0 0h20v20H0z\"\n})))), modifiedTablerIconProps);\nconst FillSolidIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n clipPath: \"url(#a)\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4.91 2.625h10.18a2.284 2.284 0 0 1 2.285 2.284v10.182a2.284 2.284 0 0 1-2.284 2.284H4.909a2.284 2.284 0 0 1-2.284-2.284V4.909a2.284 2.284 0 0 1 2.284-2.284Z\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\"\n})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"clipPath\", {\n id: \"a\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fill: \"#fff\",\n d: \"M0 0h20v20H0z\"\n})))), Object.assign(Object.assign({}, modifiedTablerIconProps), {\n fill: \"var(--icon-fill-color)\"\n}));\nconst StrokeWidthThinIcon = createIcon(\n/*#__PURE__*/\n//zsviczian\nreact__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4.167 10h11.666\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"0.75\" //zsviczian\n ,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n})), modifiedTablerIconProps);\nconst StrokeWidthBaseIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4.167 10h11.666\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"2.25\" //zsviczian\n ,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n})), modifiedTablerIconProps);\nconst StrokeWidthBoldIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 10h10\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"3.5\" //zsviczian\n ,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}), modifiedTablerIconProps);\nconst StrokeWidthExtraBoldIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 10h10\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"5.75\" //zsviczian\n ,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}), modifiedTablerIconProps);\nconst StrokeStyleSolidIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n theme\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6 10H34\",\n stroke: iconFillColor(theme),\n strokeWidth: 2,\n fill: \"none\",\n strokeLinecap: \"round\"\n}), {\n width: 40,\n height: 20\n}));\nconst StrokeStyleDashedIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"2\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 12h2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M17 12h2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M11 12h2\"\n})), tablerIconProps); // tabler-icons: line-dotted\n\nconst StrokeStyleDottedIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"2\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 12v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 12v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 12v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16 12v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M20 12v.01\"\n})), tablerIconProps);\nconst SloppinessArchitectIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M2.5 12.038c1.655-.885 5.9-3.292 8.568-4.354 2.668-1.063.101 2.821 1.32 3.104 1.218.283 5.112-1.814 5.112-1.814\",\n strokeWidth: \"1.25\"\n}), modifiedTablerIconProps);\nconst SloppinessArtistIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M2.5 12.563c1.655-.886 5.9-3.293 8.568-4.355 2.668-1.062.101 2.822 1.32 3.105 1.218.283 5.112-1.814 5.112-1.814m-13.469 2.23c2.963-1.586 6.13-5.62 7.468-4.998 1.338.623-1.153 4.11-.132 5.595 1.02 1.487 6.133-1.43 6.133-1.43\",\n strokeWidth: \"1.25\"\n}), modifiedTablerIconProps);\nconst SloppinessCartoonistIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M2.5 11.936c1.737-.879 8.627-5.346 10.42-5.268 1.795.078-.418 5.138.345 5.736.763.598 3.53-1.789 4.235-2.147M2.929 9.788c1.164-.519 5.47-3.28 6.987-3.114 1.519.165 1 3.827 2.121 4.109 1.122.281 3.839-2.016 4.606-2.42\",\n strokeWidth: \"1.25\"\n}), modifiedTablerIconProps);\nconst EdgeSharpIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"svg\", {\n strokeWidth: \"1.5\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3.33334 9.99998V6.66665C3.33334 6.04326 3.33403 4.9332 3.33539 3.33646C4.95233 3.33436 6.06276 3.33331 6.66668 3.33331H10\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M13.3333 3.33331V3.34331\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16.6667 3.33331V3.34331\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16.6667 6.66669V6.67669\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16.6667 10V10.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3.33334 13.3333V13.3433\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16.6667 13.3333V13.3433\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3.33334 16.6667V16.6767\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6.66666 16.6667V16.6767\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10 16.6667V16.6767\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M13.3333 16.6667V16.6767\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16.6667 16.6667V16.6767\"\n})), modifiedTablerIconProps); // tabler-icons: border-radius\n\nconst EdgeRoundIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.5\",\n stroke: \"var(--icon-fill-color)\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 12v-4a4 4 0 0 1 4 -4h4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"16\",\n y1: \"4\",\n x2: \"16\",\n y2: \"4.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"20\",\n y1: \"4\",\n x2: \"20\",\n y2: \"4.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"20\",\n y1: \"8\",\n x2: \"20\",\n y2: \"8.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"20\",\n y1: \"12\",\n x2: \"20\",\n y2: \"12.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"4\",\n y1: \"16\",\n x2: \"4\",\n y2: \"16.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"20\",\n y1: \"16\",\n x2: \"20\",\n y2: \"16.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"4\",\n y1: \"20\",\n x2: \"4\",\n y2: \"20.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"8\",\n y1: \"20\",\n x2: \"8\",\n y2: \"20.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"12\",\n y1: \"20\",\n x2: \"12\",\n y2: \"20.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"16\",\n y1: \"20\",\n x2: \"16\",\n y2: \"20.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"20\",\n y1: \"20\",\n x2: \"20\",\n y2: \"20.01\"\n})), tablerIconProps);\nconst ArrowheadNoneIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"var(--icon-fill-color)\",\n opacity: 0.3,\n strokeWidth: 2\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 12l9 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 9l6 6\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 15l6 -6\"\n})), tablerIconProps);\nconst ArrowheadArrowIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n flip = false\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n transform: flip ? \"translate(40, 0) scale(-1, 1)\" : \"\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: 2,\n fill: \"none\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M34 10H6M34 10L27 5M34 10L27 15\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M27.5 5L34.5 10L27.5 15\"\n})), {\n width: 40,\n height: 20\n}));\nconst ArrowheadCircleIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n flip = false\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"var(--icon-fill-color)\",\n fill: \"var(--icon-fill-color)\",\n transform: flip ? \"translate(40, 0) scale(-1, 1)\" : \"\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M32 10L6 10\",\n strokeWidth: 2\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"circle\", {\n r: \"4\",\n transform: \"matrix(-1 0 0 1 30 10)\"\n})), {\n width: 40,\n height: 20\n}));\nconst ArrowheadCircleOutlineIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n flip = false\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\",\n fill: \"none\",\n transform: flip ? \"translate(40, 0) scale(-1, 1)\" : \"\",\n strokeWidth: 2\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M26 10L6 10\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"circle\", {\n r: \"4\",\n transform: \"matrix(-1 0 0 1 30 10)\"\n})), {\n width: 40,\n height: 20\n}));\nconst ArrowheadBarIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n flip = false\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n transform: flip ? \"translate(40, 0) scale(-1, 1)\" : \"\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M34 10H5.99996M34 10L34 5M34 10L34 15\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: 2,\n fill: \"none\"\n})), {\n width: 40,\n height: 20\n}));\nconst ArrowheadTriangleIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n flip = false\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"var(--icon-fill-color)\",\n fill: \"var(--icon-fill-color)\",\n transform: flip ? \"translate(40, 0) scale(-1, 1)\" : \"\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M32 10L6 10\",\n strokeWidth: 2\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M27.5 5.5L34.5 10L27.5 14.5L27.5 5.5\"\n})), {\n width: 40,\n height: 20\n}));\nconst ArrowheadTriangleOutlineIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n flip = false\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\",\n fill: \"none\",\n transform: flip ? \"translate(40, 0) scale(-1, 1)\" : \"\",\n strokeWidth: 2,\n strokeLinejoin: \"round\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6,9.5H27\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M27,5L34,10L27,14Z\",\n fill: \"none\"\n})), {\n width: 40,\n height: 20\n}));\nconst ArrowheadDiamondIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n flip = false\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\",\n fill: \"currentColor\",\n transform: flip ? \"translate(40, 0) scale(-1, 1)\" : \"\",\n strokeLinejoin: \"round\",\n strokeWidth: 2\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6,9.5H20\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M27,5L34,10L27,14L20,9.5Z\"\n})), {\n width: 40,\n height: 20\n}));\nconst ArrowheadDiamondOutlineIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n flip = false\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\",\n fill: \"none\",\n transform: flip ? \"translate(40, 0) scale(-1, 1)\" : \"\",\n strokeLinejoin: \"round\",\n strokeWidth: 2\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6,9.5H20\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M27,5L34,10L27,14L20,9.5Z\"\n})), {\n width: 40,\n height: 20\n}));\nconst ArrowheadCrowfootIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n flip = false\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\",\n fill: \"none\",\n transform: flip ? \"\" : \"translate(40, 0) scale(-1, 1)\",\n strokeLinejoin: \"round\",\n strokeWidth: 2\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M34,10 H6 M15,10 L7,5 M15,10 L7,15\"\n})), {\n width: 40,\n height: 20\n}));\nconst ArrowheadCrowfootOneIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n flip = false\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\",\n fill: \"none\",\n transform: flip ? \"\" : \"translate(40, 0) scale(-1, 1)\",\n strokeLinejoin: \"round\",\n strokeWidth: 2\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M34,10 H6 M15,10 L15,15 L15,5\"\n})), {\n width: 40,\n height: 20\n}));\nconst ArrowheadCrowfootOneOrManyIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n flip = false\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\",\n fill: \"none\",\n transform: flip ? \"\" : \"translate(40, 0) scale(-1, 1)\",\n strokeLinejoin: \"round\",\n strokeWidth: 2\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M34,10 H6 M15,10 L15,16 L15,4 M15,10 L7,5 M15,10 L7,15\"\n})), {\n width: 40,\n height: 20\n}));\nconst FontSizeSmallIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n clipPath: \"url(#a)\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M14.167 6.667a3.333 3.333 0 0 0-3.334-3.334H9.167a3.333 3.333 0 0 0 0 6.667h1.666a3.333 3.333 0 0 1 0 6.667H9.167a3.333 3.333 0 0 1-3.334-3.334\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"clipPath\", {\n id: \"a\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fill: \"#fff\",\n d: \"M0 0h20v20H0z\"\n})))), modifiedTablerIconProps);\nconst FontSizeMediumIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n clipPath: \"url(#a)\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 16.667V3.333L10 15l5-11.667v13.334\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"clipPath\", {\n id: \"a\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fill: \"#fff\",\n d: \"M0 0h20v20H0z\"\n})))), modifiedTablerIconProps);\nconst FontSizeLargeIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n clipPath: \"url(#a)\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5.833 3.333v13.334h8.334\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"clipPath\", {\n id: \"a\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fill: \"#fff\",\n d: \"M0 0h20v20H0z\"\n})))), modifiedTablerIconProps);\nconst FontSizeExtraLargeIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"m1.667 3.333 6.666 13.334M8.333 3.333 1.667 16.667M11.667 3.333v13.334h6.666\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n})), modifiedTablerIconProps);\nconst fontSizeIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 7v-2h13v2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10 5v14\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 19h-4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15 13v-1h6v1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M18 12v7\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M17 19h2\"\n})), tablerIconProps);\nconst FontFamilyHeadingIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\",\n strokeWidth: \"1.25\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M7 12h10\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M7 5v14\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M17 5v14\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15 19h4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15 5h4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 19h4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 5h4\"\n}))), tablerIconProps);\nconst FontFamilyNormalIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5.833 16.667v-10a3.333 3.333 0 0 1 3.334-3.334h1.666a3.333 3.333 0 0 1 3.334 3.334v10M5.833 10.833h8.334\"\n}))), modifiedTablerIconProps);\nconst FontFamilyCodeIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n clipPath: \"url(#a)\",\n stroke: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5.833 6.667 2.5 10l3.333 3.333M14.167 6.667 17.5 10l-3.333 3.333M11.667 3.333 8.333 16.667\"\n})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"defs\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"clipPath\", {\n id: \"a\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fill: \"#fff\",\n d: \"M0 0h20v20H0z\"\n})))), modifiedTablerIconProps);\nconst FontFamilyLocalFontIcon = createIcon(\n/*#__PURE__*/\n//zsviczian\nreact__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"var(--icon-fill-color)\",\n fill: \"var(--icon-fill-color)\",\n strokeWidth: \"1.25\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"m 151.43258,8.7863685 q -7.87381,6.7489805 -14.62279,12.3731315 0,11.248301 0,23.621433 8.99864,35.994564 13.49796,76.488447 -4.49932,7.87381 -11.2483,13.49796 -16.87245,1.12483 -29.24559,-3.37449 -6.74898,-4.49932 -10.123467,-11.2483 -7.87381,-2.24966 -15.747621,0 -6.748981,1.12483 -11.248302,5.62415 l -16.872451,16.87245 q -11.248302,2.24966 -19.122113,8.99864 -6.74898,6.74899 -6.74898,17.99729 2.24966,3.37449 4.49932,7.87381 2.24966,4.49932 2.24966,12.37313 -16.872452,31.49524 -30.3704131,65.24015 -2.2496602,23.62143 0,47.24286 6.7489811,10.12347 15.7476221,20.24694 10.123471,4.49932 20.246942,13.49797 25.871093,4.49932 53.991846,8.99864 23.621437,-5.62415 50.617357,-5.62415 3.37449,2.24966 6.74898,5.62415 0,25.87109 0,55.11667 1.12483,19.12211 5.62415,38.24423 v 61.86565 q 2.24966,5.62415 8.99864,8.99864 10.12347,0 19.12211,-3.37449 3.37449,2.24966 10.12347,2.24966 7.87382,-13.49796 17.99729,-24.74626 5.62415,-34.86973 7.87381,-70.8643 -5.62415,-40.49388 -5.62415,-82.1126 l 7.87381,-7.87381 h 16.87245 q 21.37177,-8.99864 44.9932,-13.49796 14.6228,-7.87381 30.37042,-15.74762 3.37449,-1.12483 8.99864,-1.12483 11.2483,-10.12347 23.62143,-22.4966 2.24966,-6.74898 6.74898,-12.37313 V 230.3779 q 4.49932,-14.62279 6.74898,-30.37041 4.49932,-11.2483 10.12347,-20.24694 2.24966,-17.99728 2.24966,-37.1194 -5.62415,-7.87381 -7.87381,-15.74762 -6.74898,-6.74898 -13.49796,-13.49796 -11.2483,-6.74898 -20.24694,-10.12347 -46.11804,-4.499321 -92.23607,0 -10.12347,4.49932 -22.4966,4.49932 -6.74898,-2.24966 -10.12347,-7.873811 2.24966,-23.621433 2.24966,-46.118035 -5.62415,-8.998641 -4.49932,-19.122113 Q 203.17477,22.28433 195.30095,13.285689 187.42714,3.1622179 178.4285,2.0373877 164.93054,5.4118781 151.43258,8.7863685 Z M 136.80979,175.26123 q 7.87381,2.24966 11.2483,12.37313 -1.12483,39.36905 1.12483,80.98777 4.49932,6.74898 3.37449,15.74762 -5.62415,6.74898 -12.37313,11.2483 -17.99728,1.12483 -33.74491,5.62415 -19.122108,0 -37.11939,-1.12483 -6.748981,-4.49932 -11.248301,-7.87381 -1.12483,-14.62279 1.12483,-29.24558 16.872452,-30.37042 28.120753,-62.99049 4.499321,-7.87381 11.248301,-13.49796 14.622787,-3.37449 29.245587,-5.62415 4.49932,-3.37449 8.99864,-5.62415 z M 283.0377,146.01564 q 8.99865,-1.12483 17.99729,2.24966 4.49932,2.24966 8.99864,7.87382 2.24966,8.99864 1.12483,20.24694 -6.74898,11.2483 -10.12347,22.4966 -4.49932,25.87109 -10.12348,52.86702 -24.74626,11.2483 -47.24286,24.74626 -10.12347,2.24966 -19.12211,4.49932 l -10.12347,-10.12347 q 0,-44.99321 3.37449,-84.36226 -3.37449,-13.49796 -6.74898,-23.62143 4.49932,-6.74898 12.37313,-11.24831 29.24558,-3.37449 59.61599,-5.62415 z M 638.74,93.24 766.76,221.26 488.77,499.25 374.63,511.85 c -15.28,1.69 -28.19,-11.23 -26.49,-26.51 l 12.7,-114.22 z M 845.94,74.18 785.83,14.07 c -18.75,-18.75 -49.16,-18.75 -67.91,0 l -56.55,56.55 128.02,128.02 56.55,-56.55 c 18.75,-18.76 18.75,-49.16 0,-67.91 z\"\n}))));\nconst TextAlignLeftIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"var(--icon-fill-color)\",\n fill: \"none\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n strokeWidth: 2\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"4\",\n y1: \"8\",\n x2: \"20\",\n y2: \"8\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"4\",\n y1: \"12\",\n x2: \"12\",\n y2: \"12\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"4\",\n y1: \"16\",\n x2: \"16\",\n y2: \"16\"\n})), tablerIconProps);\nconst TextAlignCenterIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"var(--icon-fill-color)\",\n fill: \"none\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"4\",\n y1: \"8\",\n x2: \"20\",\n y2: \"8\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"8\",\n y1: \"12\",\n x2: \"16\",\n y2: \"12\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"6\",\n y1: \"16\",\n x2: \"18\",\n y2: \"16\"\n})), tablerIconProps);\nconst TextAlignRightIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"var(--icon-fill-color)\",\n fill: \"none\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"4\",\n y1: \"8\",\n x2: \"20\",\n y2: \"8\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"10\",\n y1: \"12\",\n x2: \"20\",\n y2: \"12\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"8\",\n y1: \"16\",\n x2: \"20\",\n y2: \"16\"\n})), tablerIconProps); // tabler-icons: layout-align-top\n\nconst TextAlignTopIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n theme\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.5\",\n stroke: \"var(--icon-fill-color)\",\n fill: \"none\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"4\",\n y1: \"4\",\n x2: \"20\",\n y2: \"4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"rect\", {\n x: \"9\",\n y: \"8\",\n width: \"6\",\n height: \"12\",\n rx: \"2\"\n})), tablerIconProps)); // tabler-icons: layout-align-bottom\n\nconst TextAlignBottomIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n theme\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"2\",\n stroke: \"var(--icon-fill-color)\",\n fill: \"none\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"4\",\n y1: \"20\",\n x2: \"20\",\n y2: \"20\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"rect\", {\n x: \"9\",\n y: \"4\",\n width: \"6\",\n height: \"12\",\n rx: \"2\"\n})), tablerIconProps)); // tabler-icons: layout-align-middle\n\nconst TextAlignMiddleIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().memo(({\n theme\n}) => createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.5\",\n stroke: \"var(--icon-fill-color)\",\n fill: \"none\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"4\",\n y1: \"12\",\n x2: \"9\",\n y2: \"12\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"line\", {\n x1: \"15\",\n y1: \"12\",\n x2: \"20\",\n y2: \"12\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"rect\", {\n x: \"9\",\n y: \"6\",\n width: \"6\",\n height: \"12\",\n rx: \"2\"\n})), tablerIconProps));\nconst angleIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M21 19h-18l9 -15\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M20.615 15.171h.015\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19.515 11.771h.015\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M17.715 8.671h.015\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15.415 5.971h.015\"\n})), tablerIconProps);\nconst publishIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M537.6 226.6c4.1-10.7 6.4-22.4 6.4-34.6 0-53-43-96-96-96-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32c-88.4 0-160 71.6-160 160 0 2.7.1 5.4.2 8.1C40.2 219.8 0 273.2 0 336c0 79.5 64.5 144 144 144h368c70.7 0 128-57.3 128-128 0-61.9-44-113.6-102.4-125.4zM393.4 288H328v112c0 8.8-7.2 16-16 16h-48c-8.8 0-16-7.2-16-16V288h-65.4c-14.3 0-21.4-17.2-11.3-27.3l105.4-105.4c6.2-6.2 16.4-6.2 22.6 0l105.4 105.4c10.1 10.1 2.9 27.3-11.3 27.3z\",\n fill: \"var(--icon-fill-color)\"\n}), {\n width: 640,\n height: 512\n});\nconst eraser = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M480 416C497.7 416 512 430.3 512 448C512 465.7 497.7 480 480 480H150.6C133.7 480 117.4 473.3 105.4 461.3L25.37 381.3C.3786 356.3 .3786 315.7 25.37 290.7L258.7 57.37C283.7 32.38 324.3 32.38 349.3 57.37L486.6 194.7C511.6 219.7 511.6 260.3 486.6 285.3L355.9 416H480zM265.4 416L332.7 348.7L195.3 211.3L70.63 336L150.6 416L265.4 416z\"\n}));\nconst handIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 13v-7.5a1.5 1.5 0 0 1 3 0v6.5\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M11 5.5v-2a1.5 1.5 0 1 1 3 0v8.5\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M14 5.5a1.5 1.5 0 0 1 3 0v6.5\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M17 7.5a1.5 1.5 0 0 1 3 0v8.5a6 6 0 0 1 -6 6h-2h.208a6 6 0 0 1 -5.012 -2.7a69.74 69.74 0 0 1 -.196 -.3c-.312 -.479 -1.407 -2.388 -3.286 -5.728a1.5 1.5 0 0 1 .536 -2.022a1.867 1.867 0 0 1 2.28 .28l1.47 1.47\"\n})), tablerIconProps);\nconst downloadIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M7 11l5 5l5 -5\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 4l0 12\"\n})), tablerIconProps);\nconst copyIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 8m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2\"\n})), tablerIconProps);\nconst cutIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M7 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M9.15 14.85l8.85 -10.85\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6 4l8.85 10.85\"\n})), tablerIconProps);\nconst helpIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 17l0 .01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4\"\n})), tablerIconProps);\nconst playerPlayIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M7 4v16l13 -8z\"\n})), tablerIconProps);\nconst playerStopFilledIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M17 4h-10a3 3 0 0 0 -3 3v10a3 3 0 0 0 3 3h10a3 3 0 0 0 3 -3v-10a3 3 0 0 0 -3 -3z\",\n strokeWidth: \"0\",\n fill: \"--icon-fill-color\"\n})), tablerIconProps);\nconst tablerCheckIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 12l5 5l10 -10\"\n})), tablerIconProps);\nconst alertTriangleIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10.24 3.957l-8.422 14.06a1.989 1.989 0 0 0 1.7 2.983h16.845a1.989 1.989 0 0 0 1.7 -2.983l-8.423 -14.06a1.989 1.989 0 0 0 -3.4 0z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 9v4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 17h.01\"\n})), tablerIconProps);\nconst eyeDropperIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M11 7l6 6\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 16l11.7 -11.7a1 1 0 0 1 1.4 0l2.6 2.6a1 1 0 0 1 0 1.4l-11.7 11.7h-4v-4z\"\n})), tablerIconProps);\nconst extraToolsIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.5\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 3l-4 7h8z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M17 17m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z\"\n})), tablerIconProps);\nconst frameToolIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.5\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 7l16 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 17l16 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M7 4l0 16\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M17 4l0 16\"\n})), tablerIconProps);\nconst mermaidLogoIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n fill: \"currentColor\",\n d: \"M407.48,111.18C335.587,108.103 269.573,152.338 245.08,220C220.587,152.338 154.573,108.103 82.68,111.18C80.285,168.229 107.577,222.632 154.74,254.82C178.908,271.419 193.35,298.951 193.27,328.27L193.27,379.13L296.9,379.13L296.9,328.27C296.816,298.953 311.255,271.42 335.42,254.82C382.596,222.644 409.892,168.233 407.48,111.18Z\"\n}));\nconst ArrowRightIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4.16602 10H15.8327\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12.5 13.3333L15.8333 10\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12.5 6.66666L15.8333 9.99999\"\n})), modifiedTablerIconProps);\nconst laserPointerToolIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: \"1.25\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n transform: \"rotate(90 10 10)\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n clipRule: \"evenodd\",\n d: \"m9.644 13.69 7.774-7.773a2.357 2.357 0 0 0-3.334-3.334l-7.773 7.774L8 12l1.643 1.69Z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"m13.25 3.417 3.333 3.333M10 10l2-2M5 15l3-3M2.156 17.894l1-1M5.453 19.029l-.144-1.407M2.377 11.887l.866 1.118M8.354 17.273l-1.194-.758M.953 14.652l1.408.13\"\n})), 20);\nconst MagicIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\",\n fill: \"none\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6 21l15 -15l-3 -3l-15 15l3 3\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15 6l3 3\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M9 3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 13a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2\"\n})), tablerIconProps);\nconst MagicIconThin = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6 21l15 -15l-3 -3l-15 15l3 3\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15 6l3 3\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M9 3a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 13a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2\"\n})), tablerIconProps);\nconst OpenAIIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\",\n fill: \"none\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M11.217 19.384a3.501 3.501 0 0 0 6.783 -1.217v-5.167l-6 -3.35\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5.214 15.014a3.501 3.501 0 0 0 4.446 5.266l4.34 -2.534v-6.946\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6 7.63c-1.391 -.236 -2.787 .395 -3.534 1.689a3.474 3.474 0 0 0 1.271 4.745l4.263 2.514l6 -3.348\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12.783 4.616a3.501 3.501 0 0 0 -6.783 1.217v5.067l6 3.45\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M18.786 8.986a3.501 3.501 0 0 0 -4.446 -5.266l-4.34 2.534v6.946\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M18 16.302c1.391 .236 2.787 -.395 3.534 -1.689a3.474 3.474 0 0 0 -1.271 -4.745l-4.308 -2.514l-5.955 3.42\"\n})), tablerIconProps);\nconst fullscreenIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\",\n fill: \"none\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 8v-2a2 2 0 0 1 2 -2h2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 16v2a2 2 0 0 0 2 2h2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16 4h2a2 2 0 0 1 2 2v2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16 20h2a2 2 0 0 0 2 -2v-2\"\n})), tablerIconProps);\nconst eyeIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\",\n fill: \"none\",\n strokeWidth: 1.5\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6\"\n})), tablerIconProps);\nconst eyeClosedIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\",\n fill: \"none\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10.585 10.587a2 2 0 0 0 2.829 2.828\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 3l18 18\"\n})), tablerIconProps);\nconst brainIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\",\n fill: \"none\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15.5 13a3.5 3.5 0 0 0 -3.5 3.5v1a3.5 3.5 0 0 0 7 0v-1.8\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8.5 13a3.5 3.5 0 0 1 3.5 3.5v1a3.5 3.5 0 0 1 -7 0v-1.8\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6.5 16a3.5 3.5 0 0 1 0 -7h.5\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10\"\n})), tablerIconProps);\nconst brainIconThin = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15.5 13a3.5 3.5 0 0 0 -3.5 3.5v1a3.5 3.5 0 0 0 7 0v-1.8\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8.5 13a3.5 3.5 0 0 1 3.5 3.5v1a3.5 3.5 0 0 1 -7 0v-1.8\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M17.5 16a3.5 3.5 0 0 0 0 -7h-.5\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 9.3v-2.8a3.5 3.5 0 0 0 -7 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6.5 16a3.5 3.5 0 0 1 0 -7h.5\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 9.3v-2.8a3.5 3.5 0 0 1 7 0v10\"\n})), tablerIconProps);\nconst searchIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.5\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M21 21l-6 -6\"\n})), tablerIconProps);\nconst clockIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.5\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M20.984 12.53a9 9 0 1 0 -7.552 8.355\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 7v5l3 3\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 16l-2 3h4l-2 3\"\n})), tablerIconProps);\nconst microphoneIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.5\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M9 2m0 3a3 3 0 0 1 3 -3h0a3 3 0 0 1 3 3v5a3 3 0 0 1 -3 3h0a3 3 0 0 1 -3 -3z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 10a7 7 0 0 0 14 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 21l8 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 17l0 4\"\n})), tablerIconProps);\nconst microphoneMutedIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.5\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 3l18 18\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M9 5a3 3 0 0 1 6 0v5a3 3 0 0 1 -.13 .874m-2 2a3 3 0 0 1 -3.87 -2.872v-1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 10a7 7 0 0 0 10.846 5.85m2 -2a6.967 6.967 0 0 0 1.152 -3.85\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 21l8 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 17l0 4\"\n})), tablerIconProps);\nconst boltIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M13 3l0 7l6 0l-8 11l0 -7l-6 0l8 -11\"\n})), tablerIconProps);\nconst selectAllIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 8m0 1a1 1 0 0 1 1 -1h6a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-6a1 1 0 0 1 -1 -1z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 20v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16 20v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 20v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 20v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 16v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 12v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 8v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 4v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 4v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 4v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16 4v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M20 4v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M20 8v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M20 12v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M20 16v.01\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M20 20v.01\"\n})), tablerIconProps);\nconst abacusIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 3v18\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 21v-18\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 7h14\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 15h14\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 13v4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M11 13v4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16 13v4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M14 5v4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M11 5v4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 5v4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 21h18\"\n})), tablerIconProps);\nconst flipVertical = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 12l18 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M7 16l10 0l-10 5l0 -5\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M7 8l10 0l-10 -5l0 5\"\n})), tablerIconProps);\nconst flipHorizontal = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 3l0 18\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16 7l0 10l5 0l-5 -10\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 7l0 10l-5 0l5 -10\"\n})), tablerIconProps);\nconst paintIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 3m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v2a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 6h1a2 2 0 0 1 2 2a5 5 0 0 1 -5 5l-5 0v2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10 15m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z\"\n})), tablerIconProps);\nconst zoomAreaIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15 15m-5 0a5 5 0 1 0 10 0a5 5 0 1 0 -10 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M22 22l-3 -3\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6 18h-1a2 2 0 0 1 -2 -2v-1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 11v-1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 6v-1a2 2 0 0 1 2 -2h1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10 3h1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15 3h1a2 2 0 0 1 2 2v1\"\n})), tablerIconProps);\nconst svgIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M14 3v4a1 1 0 0 0 1 1h4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 20.25c0 .414 .336 .75 .75 .75h1.25a1 1 0 0 0 1 -1v-1a1 1 0 0 0 -1 -1h-1a1 1 0 0 1 -1 -1v-1a1 1 0 0 1 1 -1h1.25a.75 .75 0 0 1 .75 .75\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10 15l2 6l2 -6\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3\"\n})), tablerIconProps);\nconst pngIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M14 3v4a1 1 0 0 0 1 1h4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M11 21v-6l3 6v-6\"\n})), tablerIconProps);\nconst magnetIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 13v-8a2 2 0 0 1 2 -2h1a2 2 0 0 1 2 2v8a2 2 0 0 0 6 0v-8a2 2 0 0 1 2 -2h1a2 2 0 0 1 2 2v8a8 8 0 0 1 -16 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 8l5 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15 8l4 0\"\n})), tablerIconProps);\nconst coffeeIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 14c.83 .642 2.077 1.017 3.5 1c1.423 .017 2.67 -.358 3.5 -1c.83 -.642 2.077 -1.017 3.5 -1c1.423 -.017 2.67 .358 3.5 1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 3a2.4 2.4 0 0 0 -1 2a2.4 2.4 0 0 0 1 2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 10h14v5a6 6 0 0 1 -6 6h-2a6 6 0 0 1 -6 -6v-5z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16.746 16.726a3 3 0 1 0 .252 -5.555\"\n})), tablerIconProps);\nconst DeviceDesktopIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n stroke: \"currentColor\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 5a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-16a1 1 0 0 1-1-1v-10zM7 20h10M9 16v4M15 16v4\"\n})), Object.assign(Object.assign({}, tablerIconProps), {\n strokeWidth: 1.5\n})); // login\n\nconst loginIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.5\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M21 12h-13l3 -3\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M11 15l-3 -3\"\n})), tablerIconProps);\nconst youtubeIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M2 8a4 4 0 0 1 4 -4h12a4 4 0 0 1 4 4v8a4 4 0 0 1 -4 4h-12a4 4 0 0 1 -4 -4v-8z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10 9l5 3l-5 3z\"\n})), tablerIconProps);\nconst gridIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.5\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 6h18\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 12h18\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 18h18\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6 3v18\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 3v18\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M18 3v18\"\n})), tablerIconProps);\nconst lineEditorIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.5\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M17 3m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 17m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M17 5c-6.627 0 -12 5.373 -12 12\"\n})), tablerIconProps); // arrow-up-right (modified)\n\nconst sharpArrowIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6 18l12 -12\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M18 10v-4h-4\"\n})), tablerIconProps); // arrow-guide (modified)\n\nconst elbowArrowIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4,19L10,19C11.097,19 12,18.097 12,17L12,9C12,7.903 12.903,7 14,7L21,7\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M18 4l3 3l-3 3\"\n})), tablerIconProps); // arrow-ramp-right-2 (heavily modified)\n\nconst roundArrowIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16,12L20,9L16,6\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6 20c0 -6.075 4.925 -11 11 -11h3\"\n})), tablerIconProps);\nconst collapseDownIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6 9l6 6l6 -6\"\n})), tablerIconProps);\nconst collapseUpIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6 15l6 -6l6 6\"\n})), tablerIconProps);\nconst upIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6 15l6 -6l6 6\"\n})), tablerIconProps);\nconst cropIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 5v10a1 1 0 0 0 1 1h10\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 8h10a1 1 0 0 1 1 1v10\"\n})), tablerIconProps);\nconst elementLinkIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 7l0 10\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M7 5l10 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M7 19l10 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 7l0 10\"\n})), tablerIconProps); //zsviczian\n\nconst markerFrameIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 3a2 2 0 0 0-2 2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 3a2 2 0 0 1 2 2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M21 19a2 2 0 0 1-2 2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M5 21a2 2 0 0 1-2-2\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M9 3h1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M9 21h1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M14 3h1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M14 21h1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 9v1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M21 9v1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 14v1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M21 14v1\"\n})), tablerIconProps); //zsviczian\n\nconst LaTeXIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M571.31 251.31l-22.62-22.62c-6.25-6.25-16.38-6.25-22.63 0L480 274.75l-46.06-46.06c-6.25-6.25-16.38-6.25-22.63 0l-22.62 22.62c-6.25 6.25-6.25 16.38 0 22.63L434.75 320l-46.06 46.06c-6.25 6.25-6.25 16.38 0 22.63l22.62 22.62c6.25 6.25 16.38 6.25 22.63 0L480 365.25l46.06 46.06c6.25 6.25 16.38 6.25 22.63 0l22.62-22.62c6.25-6.25 6.25-16.38 0-22.63L525.25 320l46.06-46.06c6.25-6.25 6.25-16.38 0-22.63zM552 0H307.65c-14.54 0-27.26 9.8-30.95 23.87l-84.79 322.8-58.41-106.1A32.008 32.008 0 0 0 105.47 224H24c-13.25 0-24 10.74-24 24v48c0 13.25 10.75 24 24 24h43.62l88.88 163.73C168.99 503.5 186.3 512 204.94 512c17.27 0 44.44-9 54.28-41.48L357.03 96H552c13.25 0 24-10.75 24-24V24c0-13.26-10.75-24-24-24z\"\n}), {\n width: 576,\n height: 512,\n fill: \"var(--icon-fill-color)\",\n stroke: \"none\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n strokeWidth: 2\n}); //zsviczian\n\nconst InsertAnyFileIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M14 2v4a2 2 0 0 0 2 2h4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M9 15h6\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 18v-6\"\n})), {\n width: 24,\n height: 24,\n fill: \"none\",\n stroke: \"var(--icon-fill-color)\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n strokeWidth: 2\n}); //zsviczian\n\nconst Card = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15 3v4a2 2 0 0 0 2 2h4\"\n})), {\n width: 24,\n height: 24,\n fill: \"none\",\n stroke: \"var(--icon-fill-color)\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n strokeWidth: 2\n});\nconst resizeIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.5\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 11v8a1 1 0 0 0 1 1h8m-9 -14v-1a1 1 0 0 1 1 -1h1m5 0h2m5 0h1a1 1 0 0 1 1 1v1m0 5v2m0 5v1a1 1 0 0 1 -1 1h-1\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 12h7a1 1 0 0 1 1 1v7\"\n})), tablerIconProps);\nconst adjustmentsIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.5\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 6l8 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M16 6l4 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 12l2 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M10 12l10 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 18l11 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M19 18l1 0\"\n})), tablerIconProps);\nconst strokeIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M6 10l4 -4 L6 14l8 -8 L6 18l12 -12 L10 18l8 -8 L14 18l4 -4\"\n})), tablerIconProps);\nconst pencilIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1.25\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M13.5 6.5l4 4\"\n})), tablerIconProps);\nconst chevronLeftIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: 1\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M11 7l-5 5l5 5\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M17 7l-5 5l5 5\"\n})), tablerIconProps);\nconst sidebarRightIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.75\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M15 4l0 16\"\n})), tablerIconProps);\nconst messageCircleIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 20l1.3 -3.9c-2.324 -3.437 -1.426 -7.872 2.1 -10.374c3.526 -2.501 8.59 -2.296 11.845 .48c3.255 2.777 3.695 7.266 1.029 10.501c-2.666 3.235 -7.615 4.215 -11.574 2.293l-4.7 1\"\n})), tablerIconProps);\nconst presentationIcon = createIcon( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"g\", {\n strokeWidth: \"1.25\"\n}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n stroke: \"none\",\n d: \"M0 0h24v24H0z\",\n fill: \"none\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M3 4l18 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M4 4v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-10\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M12 16l0 4\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M9 20l6 0\"\n}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(\"path\", {\n d: \"M8 12l3 -3l2 2l3 -3\"\n})), tablerIconProps);\n\n//# sourceURL=webpack://ExcalidrawLib/./components/icons.tsx?");
|
|
16736
16736
|
|
|
16737
16737
|
/***/ }),
|
|
16738
16738
|
|
|
@@ -17194,7 +17194,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
17194
17194
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
17195
17195
|
|
|
17196
17196
|
"use strict";
|
|
17197
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ExcalidrawFontFace: () => (/* binding */ ExcalidrawFontFace)\n/* harmony export */ });\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n/* harmony import */ var _subset_subset_main__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../subset/subset-main */ \"./subset/subset-main.ts\");\n/* harmony import */ var _data_encode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../data/encode */ \"./data/encode.ts\");\n/* harmony import */ var _obsidianUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../obsidianUtils */ \"./obsidianUtils.ts\");\n\n\n\n\nclass ExcalidrawFontFace {\n constructor(family, uri, descriptors) {\n this.urls = ExcalidrawFontFace.createUrls(uri);\n const sources = this.urls.map(url => `url(${url}) ${ExcalidrawFontFace.getFormat(url)}`).join(\", \");\n this.fontFace = new FontFace(family, sources, Object.assign({\n display: \"swap\",\n style: \"normal\",\n weight: \"400\"\n }, descriptors));\n }\n /**\r\n * Generates CSS `@font-face` definition with the (subsetted) font source as a data url for the characters within the unicode range.\r\n *\r\n * Retrieves `undefined` otherwise.\r\n */\n\n\n toCSS(characters) {\n // quick exit in case the characters are not within this font face's unicode range\n if (!this.getUnicodeRangeRegex().test(characters)) {\n return;\n } //zsviczian - only woffs are chopped into glyphs other fonts are returned as is\n\n\n if (typeof this.urls[0] === \"string\" && !this.urls[0].startsWith(\"data:font/woff2\")) {\n return Promise.resolve(`@font-face { font-family: ${this.fontFace.family}; src: url(${this.urls[0]}); }`);\n }\n\n const codepoints = Array.from(characters).map(char => char.codePointAt(0));\n return this.getContent(codepoints).then(content => `@font-face { font-family: ${this.fontFace.family}; src: url(${content}); }`);\n }\n /**\r\n * Tries to fetch woff2 content, based on the registered urls (from first to last, treated as fallbacks).\r\n *\r\n * @returns base64 with subsetted glyphs based on the passed codepoint, last defined url otherwise\r\n */\n\n\n async getContent(codePoints) {\n let i = 0;\n const errorMessages = [];\n\n while (i < this.urls.length) {\n const url = this.urls[i];\n\n try {\n const arrayBuffer = await this.fetchFont(url);\n const base64 = await (0,_subset_subset_main__WEBPACK_IMPORTED_MODULE_1__.subsetWoff2GlyphsByCodepoints)(arrayBuffer, codePoints);\n return base64;\n } catch (e) {\n errorMessages.push(`\"${url.toString()}\" returned error \"${e}\"`);\n }\n\n i++;\n }\n\n console.error(`Failed to fetch font family \"${this.fontFace.family}\"`, JSON.stringify(errorMessages, undefined, 2)); // in case of issues, at least return the last url as a content\n // defaults to unpkg for bundled fonts (so that we don't have to host them forever) and http url for others\n\n return this.urls.length ? this.urls[this.urls.length - 1].toString() : \"\";\n }\n\n fetchFont(url) {\n return (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.promiseTry)(async () => {\n const result = await (0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_3__.fetchFontFromVault)(url); //zsviczian\n\n if (result) {\n return result;\n }\n\n const response = await fetch(url, {\n // always prefer cache (even stale), otherwise it always triggers an unnecessary validation request\n // which we don't need as we are controlling freshness of the fonts with the stable hash suffix in the url\n // https://developer.mozilla.org/en-US/docs/Web/API/Request/cache\n cache: \"force-cache\",\n headers: {\n Accept: \"font/woff2\"\n }\n });\n\n if (!response.ok) {\n const urlString = url instanceof URL ? url.toString() : \"dataurl\";\n throw new Error(`Failed to fetch \"${urlString}\": ${response.statusText}`);\n }\n\n const arrayBuffer = await response.arrayBuffer();\n return arrayBuffer;\n });\n }\n\n getUnicodeRangeRegex() {\n // using \\u{h} or \\u{hhhhh} to match any number of hex digits,\n // otherwise we would get an \"Invalid Unicode escape\" error\n // e.g. U+0-1007F -> \\u{0}-\\u{1007F}\n const unicodeRangeRegex = this.fontFace.unicodeRange.split(/,\\s*/).map(range => {\n const [start, end] = range.replace(\"U+\", \"\").split(\"-\");\n\n if (end) {\n return `\\\\u{${start}}-\\\\u{${end}}`;\n }\n\n return `\\\\u{${start}}`;\n }).join(\"\");\n return new RegExp(`[${unicodeRangeRegex}]`, \"u\");\n }\n\n static createUrls(uri) {\n if (uri.startsWith(\"data\")) {\n // don't create the URL instance, as parsing the huge dataurl string is expensive\n return [uri];\n }\n\n if (uri.startsWith(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.LOCAL_FONT_PROTOCOL)) {\n // no url for local fonts\n return [];\n }\n\n if (uri.startsWith(\"http\")) {\n // one url for http imports or data url\n return [new URL(uri)];\n } // absolute assets paths, which are found in tests and excalidraw-app build, won't work with base url, so we are stripping initial slash away\n\n\n const assetUrl = uri.replace(/^\\/+/, \"\");\n const urls = [];\n\n if (typeof window.EXCALIDRAW_ASSET_PATH === \"string\") {\n const normalizedBaseUrl = this.normalizeBaseUrl(window.EXCALIDRAW_ASSET_PATH);\n urls.push(new URL(assetUrl, normalizedBaseUrl));\n } else if (Array.isArray(window.EXCALIDRAW_ASSET_PATH)) {\n window.EXCALIDRAW_ASSET_PATH.forEach(path => {\n const normalizedBaseUrl = this.normalizeBaseUrl(path);\n urls.push(new URL(assetUrl, normalizedBaseUrl));\n });\n } // fallback url for bundled fonts\n\n\n urls.push(new URL(assetUrl, ExcalidrawFontFace.ASSETS_FALLBACK_URL));\n return urls;\n }\n\n static getFormat(url) {\n if (!(url instanceof URL)) {\n // format is irrelevant for data url\n return \"\";\n }\n\n try {\n const parts = new URL(url).pathname.split(\".\");\n\n if (parts.length === 1) {\n return \"\";\n }\n\n return `format('${parts.pop()}')`;\n } catch (error) {\n return \"\";\n }\n }\n\n static normalizeBaseUrl(baseUrl) {\n var _a;\n\n let result = baseUrl; // in case user passed a root-relative url (~absolute path),\n // like \"/\" or \"/some/path\", or relative (starts with \"./\"),\n // prepend it with `location.origin`\n\n if (/^\\.?\\//.test(result)) {\n result = new URL(result.replace(/^\\.?\\/+/, \"\"), (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.origin).toString();\n } // ensure there is a trailing slash, otherwise url won't be correctly concatenated\n\n\n result = `${result.replace(/\\/+$/, \"\")}/`;\n return result;\n }\n /**\r\n * zsviczian https://github.com/zsviczian/excalidraw/commit/b4cfaaa4b4f46ca01f94e27fb7bf651a9da99daa\r\n */\n\n\n async getContentLegacy() {\n let i = 0;\n const errorMessages = [];\n\n while (i < this.urls.length) {\n const url = this.urls[i];\n\n if (typeof url === \"string\" && url.startsWith(\"data:\")) {\n // it's dataurl, the font is inlined as base64, no need to fetch\n return url;\n }\n\n try {\n const result = await (0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_3__.fetchFontFromVault)(url); //zsviczian\n\n if (result) {\n return `data:font/woff2;base64,${(0,_data_encode__WEBPACK_IMPORTED_MODULE_2__.stringToBase64)((0,_data_encode__WEBPACK_IMPORTED_MODULE_2__.toByteString)(result), true)}`;\n }\n\n const response = await fetch(url, {\n headers: {\n Accept: \"font/woff2\"\n }\n });\n\n if (response.ok) {\n const mimeType = response.headers.get(\"Content-Type\");\n const buffer = await response.arrayBuffer();\n return `data:${mimeType};base64,${(0,_data_encode__WEBPACK_IMPORTED_MODULE_2__.stringToBase64)((0,_data_encode__WEBPACK_IMPORTED_MODULE_2__.toByteString)(buffer), true)}`;\n } // response not ok, try to continue\n\n\n errorMessages.push(`\"${url.toString()}\" returned status \"${response.status}\"`);\n } catch (e) {\n errorMessages.push(`\"${url.toString()}\" returned error \"${e}\"`);\n }\n\n i++;\n }\n\n console.error(`Failed to fetch font \"${this.fontFace.family}\" from urls \"${this.urls.toString()}`, JSON.stringify(errorMessages, undefined, 2)); // in case of issues, at least return the last url as a content\n // defaults to unpkg for bundled fonts (so that we don't have to host them forever) and http url for others\n\n return this.urls.length ? this.urls[this.urls.length - 1].toString() : \"\";\n }\n\n}\nExcalidrawFontFace.ASSETS_FALLBACK_URL = `https://esm.sh/${({\"MODE\":\"development\",\"VITE_APP_BACKEND_V2_GET_URL\":\"https://json-dev.excalidraw.com/api/v2/\",\"VITE_APP_BACKEND_V2_POST_URL\":\"https://json-dev.excalidraw.com/api/v2/post/\",\"VITE_APP_LIBRARY_URL\":\"https://libraries.excalidraw.com\",\"VITE_APP_LIBRARY_BACKEND\":\"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries\",\"VITE_APP_WS_SERVER_URL\":\"http://localhost:3002\",\"VITE_APP_PLUS_LP\":\"https://plus.excalidraw.com\",\"VITE_APP_PLUS_APP\":\"http://localhost:3000\",\"VITE_APP_AI_BACKEND\":\"http://localhost:3015\",\"VITE_APP_FIREBASE_CONFIG\":\"{\\\"apiKey\\\":\\\"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8\\\",\\\"authDomain\\\":\\\"excalidraw-oss-dev.firebaseapp.com\\\",\\\"projectId\\\":\\\"excalidraw-oss-dev\\\",\\\"storageBucket\\\":\\\"excalidraw-oss-dev.appspot.com\\\",\\\"messagingSenderId\\\":\\\"664559512677\\\",\\\"appId\\\":\\\"1:664559512677:web:a385181f2928d328a7aa8c\\\"}\",\"VITE_APP_DEV_DISABLE_LIVE_RELOAD\":\"\",\"VITE_APP_ENABLE_TRACKING\":\"true\",\"FAST_REFRESH\":\"false\",\"VITE_APP_PORT\":\"3000\",\"VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX\":\"\",\"VITE_APP_COLLAPSE_OVERLAY\":\"true\",\"VITE_APP_ENABLE_ESLINT\":\"true\",\"VITE_APP_ENABLE_PWA\":\"false\",\"VITE_APP_PLUS_EXPORT_PUBLIC_KEY\":\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\\nHQIDAQAB\",\"VITE_APP_DISABLE_PREVENT_UNLOAD\":\"\",\"VITE_PKG_NAME\":\"@zsviczian/excalidraw\",\"VITE_PKG_VERSION\":\"0.18.0-50\",\"VITE_IS_EXCALIDRAW_NPM_PACKAGE\":true}).PKG_NAME ? `${({\"MODE\":\"development\",\"VITE_APP_BACKEND_V2_GET_URL\":\"https://json-dev.excalidraw.com/api/v2/\",\"VITE_APP_BACKEND_V2_POST_URL\":\"https://json-dev.excalidraw.com/api/v2/post/\",\"VITE_APP_LIBRARY_URL\":\"https://libraries.excalidraw.com\",\"VITE_APP_LIBRARY_BACKEND\":\"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries\",\"VITE_APP_WS_SERVER_URL\":\"http://localhost:3002\",\"VITE_APP_PLUS_LP\":\"https://plus.excalidraw.com\",\"VITE_APP_PLUS_APP\":\"http://localhost:3000\",\"VITE_APP_AI_BACKEND\":\"http://localhost:3015\",\"VITE_APP_FIREBASE_CONFIG\":\"{\\\"apiKey\\\":\\\"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8\\\",\\\"authDomain\\\":\\\"excalidraw-oss-dev.firebaseapp.com\\\",\\\"projectId\\\":\\\"excalidraw-oss-dev\\\",\\\"storageBucket\\\":\\\"excalidraw-oss-dev.appspot.com\\\",\\\"messagingSenderId\\\":\\\"664559512677\\\",\\\"appId\\\":\\\"1:664559512677:web:a385181f2928d328a7aa8c\\\"}\",\"VITE_APP_DEV_DISABLE_LIVE_RELOAD\":\"\",\"VITE_APP_ENABLE_TRACKING\":\"true\",\"FAST_REFRESH\":\"false\",\"VITE_APP_PORT\":\"3000\",\"VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX\":\"\",\"VITE_APP_COLLAPSE_OVERLAY\":\"true\",\"VITE_APP_ENABLE_ESLINT\":\"true\",\"VITE_APP_ENABLE_PWA\":\"false\",\"VITE_APP_PLUS_EXPORT_PUBLIC_KEY\":\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\\nHQIDAQAB\",\"VITE_APP_DISABLE_PREVENT_UNLOAD\":\"\",\"VITE_PKG_NAME\":\"@zsviczian/excalidraw\",\"VITE_PKG_VERSION\":\"0.18.0-50\",\"VITE_IS_EXCALIDRAW_NPM_PACKAGE\":true}).PKG_NAME}@${({\"MODE\":\"development\",\"VITE_APP_BACKEND_V2_GET_URL\":\"https://json-dev.excalidraw.com/api/v2/\",\"VITE_APP_BACKEND_V2_POST_URL\":\"https://json-dev.excalidraw.com/api/v2/post/\",\"VITE_APP_LIBRARY_URL\":\"https://libraries.excalidraw.com\",\"VITE_APP_LIBRARY_BACKEND\":\"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries\",\"VITE_APP_WS_SERVER_URL\":\"http://localhost:3002\",\"VITE_APP_PLUS_LP\":\"https://plus.excalidraw.com\",\"VITE_APP_PLUS_APP\":\"http://localhost:3000\",\"VITE_APP_AI_BACKEND\":\"http://localhost:3015\",\"VITE_APP_FIREBASE_CONFIG\":\"{\\\"apiKey\\\":\\\"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8\\\",\\\"authDomain\\\":\\\"excalidraw-oss-dev.firebaseapp.com\\\",\\\"projectId\\\":\\\"excalidraw-oss-dev\\\",\\\"storageBucket\\\":\\\"excalidraw-oss-dev.appspot.com\\\",\\\"messagingSenderId\\\":\\\"664559512677\\\",\\\"appId\\\":\\\"1:664559512677:web:a385181f2928d328a7aa8c\\\"}\",\"VITE_APP_DEV_DISABLE_LIVE_RELOAD\":\"\",\"VITE_APP_ENABLE_TRACKING\":\"true\",\"FAST_REFRESH\":\"false\",\"VITE_APP_PORT\":\"3000\",\"VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX\":\"\",\"VITE_APP_COLLAPSE_OVERLAY\":\"true\",\"VITE_APP_ENABLE_ESLINT\":\"true\",\"VITE_APP_ENABLE_PWA\":\"false\",\"VITE_APP_PLUS_EXPORT_PUBLIC_KEY\":\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\\nHQIDAQAB\",\"VITE_APP_DISABLE_PREVENT_UNLOAD\":\"\",\"VITE_PKG_NAME\":\"@zsviczian/excalidraw\",\"VITE_PKG_VERSION\":\"0.18.0-50\",\"VITE_IS_EXCALIDRAW_NPM_PACKAGE\":true}).PKG_VERSION}` // is provided during package build\n: \"@excalidraw/excalidraw\" // fallback to the latest package version (i.e. for app)\n}/dist/prod/`;\n\n//# sourceURL=webpack://ExcalidrawLib/./fonts/ExcalidrawFontFace.ts?");
|
|
17197
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ExcalidrawFontFace: () => (/* binding */ ExcalidrawFontFace)\n/* harmony export */ });\n/* harmony import */ var _excalidraw_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @excalidraw/common */ \"../common/src/index.ts\");\n/* harmony import */ var _subset_subset_main__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../subset/subset-main */ \"./subset/subset-main.ts\");\n/* harmony import */ var _data_encode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../data/encode */ \"./data/encode.ts\");\n/* harmony import */ var _obsidianUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../obsidianUtils */ \"./obsidianUtils.ts\");\n\n\n\n\nclass ExcalidrawFontFace {\n constructor(family, uri, descriptors) {\n this.urls = ExcalidrawFontFace.createUrls(uri);\n const sources = this.urls.map(url => `url(${url}) ${ExcalidrawFontFace.getFormat(url)}`).join(\", \");\n this.fontFace = new FontFace(family, sources, Object.assign({\n display: \"swap\",\n style: \"normal\",\n weight: \"400\"\n }, descriptors));\n }\n /**\r\n * Generates CSS `@font-face` definition with the (subsetted) font source as a data url for the characters within the unicode range.\r\n *\r\n * Retrieves `undefined` otherwise.\r\n */\n\n\n toCSS(characters) {\n // quick exit in case the characters are not within this font face's unicode range\n if (!this.getUnicodeRangeRegex().test(characters)) {\n return;\n } //zsviczian - only woffs are chopped into glyphs other fonts are returned as is\n\n\n if (typeof this.urls[0] === \"string\" && !this.urls[0].startsWith(\"data:font/woff2\")) {\n return Promise.resolve(`@font-face { font-family: ${this.fontFace.family}; src: url(${this.urls[0]}); }`);\n }\n\n const codepoints = Array.from(characters).map(char => char.codePointAt(0));\n return this.getContent(codepoints).then(content => `@font-face { font-family: ${this.fontFace.family}; src: url(${content}); }`);\n }\n /**\r\n * Tries to fetch woff2 content, based on the registered urls (from first to last, treated as fallbacks).\r\n *\r\n * @returns base64 with subsetted glyphs based on the passed codepoint, last defined url otherwise\r\n */\n\n\n async getContent(codePoints) {\n let i = 0;\n const errorMessages = [];\n\n while (i < this.urls.length) {\n const url = this.urls[i];\n\n try {\n const arrayBuffer = await this.fetchFont(url);\n const base64 = await (0,_subset_subset_main__WEBPACK_IMPORTED_MODULE_1__.subsetWoff2GlyphsByCodepoints)(arrayBuffer, codePoints);\n return base64;\n } catch (e) {\n errorMessages.push(`\"${url.toString()}\" returned error \"${e}\"`);\n }\n\n i++;\n }\n\n console.error(`Failed to fetch font family \"${this.fontFace.family}\"`, JSON.stringify(errorMessages, undefined, 2)); // in case of issues, at least return the last url as a content\n // defaults to unpkg for bundled fonts (so that we don't have to host them forever) and http url for others\n\n return this.urls.length ? this.urls[this.urls.length - 1].toString() : \"\";\n }\n\n fetchFont(url) {\n return (0,_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.promiseTry)(async () => {\n const result = await (0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_3__.fetchFontFromVault)(url); //zsviczian\n\n if (result) {\n return result;\n }\n\n const response = await fetch(url, {\n // always prefer cache (even stale), otherwise it always triggers an unnecessary validation request\n // which we don't need as we are controlling freshness of the fonts with the stable hash suffix in the url\n // https://developer.mozilla.org/en-US/docs/Web/API/Request/cache\n cache: \"force-cache\",\n headers: {\n Accept: \"font/woff2\"\n }\n });\n\n if (!response.ok) {\n const urlString = url instanceof URL ? url.toString() : \"dataurl\";\n throw new Error(`Failed to fetch \"${urlString}\": ${response.statusText}`);\n }\n\n const arrayBuffer = await response.arrayBuffer();\n return arrayBuffer;\n });\n }\n\n getUnicodeRangeRegex() {\n // using \\u{h} or \\u{hhhhh} to match any number of hex digits,\n // otherwise we would get an \"Invalid Unicode escape\" error\n // e.g. U+0-1007F -> \\u{0}-\\u{1007F}\n const unicodeRangeRegex = this.fontFace.unicodeRange.split(/,\\s*/).map(range => {\n const [start, end] = range.replace(\"U+\", \"\").split(\"-\");\n\n if (end) {\n return `\\\\u{${start}}-\\\\u{${end}}`;\n }\n\n return `\\\\u{${start}}`;\n }).join(\"\");\n return new RegExp(`[${unicodeRangeRegex}]`, \"u\");\n }\n\n static createUrls(uri) {\n if (uri.startsWith(\"data\")) {\n // don't create the URL instance, as parsing the huge dataurl string is expensive\n return [uri];\n }\n\n if (uri.startsWith(_excalidraw_common__WEBPACK_IMPORTED_MODULE_0__.LOCAL_FONT_PROTOCOL)) {\n // no url for local fonts\n return [];\n }\n\n if (uri.startsWith(\"http\")) {\n // one url for http imports or data url\n return [new URL(uri)];\n } // absolute assets paths, which are found in tests and excalidraw-app build, won't work with base url, so we are stripping initial slash away\n\n\n const assetUrl = uri.replace(/^\\/+/, \"\");\n const urls = [];\n\n if (typeof window.EXCALIDRAW_ASSET_PATH === \"string\") {\n const normalizedBaseUrl = this.normalizeBaseUrl(window.EXCALIDRAW_ASSET_PATH);\n urls.push(new URL(assetUrl, normalizedBaseUrl));\n } else if (Array.isArray(window.EXCALIDRAW_ASSET_PATH)) {\n window.EXCALIDRAW_ASSET_PATH.forEach(path => {\n const normalizedBaseUrl = this.normalizeBaseUrl(path);\n urls.push(new URL(assetUrl, normalizedBaseUrl));\n });\n } // fallback url for bundled fonts\n\n\n urls.push(new URL(assetUrl, ExcalidrawFontFace.ASSETS_FALLBACK_URL));\n return urls;\n }\n\n static getFormat(url) {\n if (!(url instanceof URL)) {\n // format is irrelevant for data url\n return \"\";\n }\n\n try {\n const parts = new URL(url).pathname.split(\".\");\n\n if (parts.length === 1) {\n return \"\";\n }\n\n return `format('${parts.pop()}')`;\n } catch (error) {\n return \"\";\n }\n }\n\n static normalizeBaseUrl(baseUrl) {\n var _a;\n\n let result = baseUrl; // in case user passed a root-relative url (~absolute path),\n // like \"/\" or \"/some/path\", or relative (starts with \"./\"),\n // prepend it with `location.origin`\n\n if (/^\\.?\\//.test(result)) {\n result = new URL(result.replace(/^\\.?\\/+/, \"\"), (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.origin).toString();\n } // ensure there is a trailing slash, otherwise url won't be correctly concatenated\n\n\n result = `${result.replace(/\\/+$/, \"\")}/`;\n return result;\n }\n /**\r\n * zsviczian https://github.com/zsviczian/excalidraw/commit/b4cfaaa4b4f46ca01f94e27fb7bf651a9da99daa\r\n */\n\n\n async getContentLegacy() {\n let i = 0;\n const errorMessages = [];\n\n while (i < this.urls.length) {\n const url = this.urls[i];\n\n if (typeof url === \"string\" && url.startsWith(\"data:\")) {\n // it's dataurl, the font is inlined as base64, no need to fetch\n return url;\n }\n\n try {\n const result = await (0,_obsidianUtils__WEBPACK_IMPORTED_MODULE_3__.fetchFontFromVault)(url); //zsviczian\n\n if (result) {\n return `data:font/woff2;base64,${(0,_data_encode__WEBPACK_IMPORTED_MODULE_2__.stringToBase64)((0,_data_encode__WEBPACK_IMPORTED_MODULE_2__.toByteString)(result), true)}`;\n }\n\n const response = await fetch(url, {\n headers: {\n Accept: \"font/woff2\"\n }\n });\n\n if (response.ok) {\n const mimeType = response.headers.get(\"Content-Type\");\n const buffer = await response.arrayBuffer();\n return `data:${mimeType};base64,${(0,_data_encode__WEBPACK_IMPORTED_MODULE_2__.stringToBase64)((0,_data_encode__WEBPACK_IMPORTED_MODULE_2__.toByteString)(buffer), true)}`;\n } // response not ok, try to continue\n\n\n errorMessages.push(`\"${url.toString()}\" returned status \"${response.status}\"`);\n } catch (e) {\n errorMessages.push(`\"${url.toString()}\" returned error \"${e}\"`);\n }\n\n i++;\n }\n\n console.error(`Failed to fetch font \"${this.fontFace.family}\" from urls \"${this.urls.toString()}`, JSON.stringify(errorMessages, undefined, 2)); // in case of issues, at least return the last url as a content\n // defaults to unpkg for bundled fonts (so that we don't have to host them forever) and http url for others\n\n return this.urls.length ? this.urls[this.urls.length - 1].toString() : \"\";\n }\n\n}\nExcalidrawFontFace.ASSETS_FALLBACK_URL = `https://esm.sh/${({\"MODE\":\"development\",\"VITE_APP_BACKEND_V2_GET_URL\":\"https://json-dev.excalidraw.com/api/v2/\",\"VITE_APP_BACKEND_V2_POST_URL\":\"https://json-dev.excalidraw.com/api/v2/post/\",\"VITE_APP_LIBRARY_URL\":\"https://libraries.excalidraw.com\",\"VITE_APP_LIBRARY_BACKEND\":\"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries\",\"VITE_APP_WS_SERVER_URL\":\"http://localhost:3002\",\"VITE_APP_PLUS_LP\":\"https://plus.excalidraw.com\",\"VITE_APP_PLUS_APP\":\"http://localhost:3000\",\"VITE_APP_AI_BACKEND\":\"http://localhost:3015\",\"VITE_APP_FIREBASE_CONFIG\":\"{\\\"apiKey\\\":\\\"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8\\\",\\\"authDomain\\\":\\\"excalidraw-oss-dev.firebaseapp.com\\\",\\\"projectId\\\":\\\"excalidraw-oss-dev\\\",\\\"storageBucket\\\":\\\"excalidraw-oss-dev.appspot.com\\\",\\\"messagingSenderId\\\":\\\"664559512677\\\",\\\"appId\\\":\\\"1:664559512677:web:a385181f2928d328a7aa8c\\\"}\",\"VITE_APP_DEV_DISABLE_LIVE_RELOAD\":\"\",\"VITE_APP_ENABLE_TRACKING\":\"true\",\"FAST_REFRESH\":\"false\",\"VITE_APP_PORT\":\"3000\",\"VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX\":\"\",\"VITE_APP_COLLAPSE_OVERLAY\":\"true\",\"VITE_APP_ENABLE_ESLINT\":\"true\",\"VITE_APP_ENABLE_PWA\":\"false\",\"VITE_APP_PLUS_EXPORT_PUBLIC_KEY\":\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\\nHQIDAQAB\",\"VITE_APP_DISABLE_PREVENT_UNLOAD\":\"\",\"VITE_PKG_NAME\":\"@zsviczian/excalidraw\",\"VITE_PKG_VERSION\":\"0.18.0-51\",\"VITE_IS_EXCALIDRAW_NPM_PACKAGE\":true}).PKG_NAME ? `${({\"MODE\":\"development\",\"VITE_APP_BACKEND_V2_GET_URL\":\"https://json-dev.excalidraw.com/api/v2/\",\"VITE_APP_BACKEND_V2_POST_URL\":\"https://json-dev.excalidraw.com/api/v2/post/\",\"VITE_APP_LIBRARY_URL\":\"https://libraries.excalidraw.com\",\"VITE_APP_LIBRARY_BACKEND\":\"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries\",\"VITE_APP_WS_SERVER_URL\":\"http://localhost:3002\",\"VITE_APP_PLUS_LP\":\"https://plus.excalidraw.com\",\"VITE_APP_PLUS_APP\":\"http://localhost:3000\",\"VITE_APP_AI_BACKEND\":\"http://localhost:3015\",\"VITE_APP_FIREBASE_CONFIG\":\"{\\\"apiKey\\\":\\\"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8\\\",\\\"authDomain\\\":\\\"excalidraw-oss-dev.firebaseapp.com\\\",\\\"projectId\\\":\\\"excalidraw-oss-dev\\\",\\\"storageBucket\\\":\\\"excalidraw-oss-dev.appspot.com\\\",\\\"messagingSenderId\\\":\\\"664559512677\\\",\\\"appId\\\":\\\"1:664559512677:web:a385181f2928d328a7aa8c\\\"}\",\"VITE_APP_DEV_DISABLE_LIVE_RELOAD\":\"\",\"VITE_APP_ENABLE_TRACKING\":\"true\",\"FAST_REFRESH\":\"false\",\"VITE_APP_PORT\":\"3000\",\"VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX\":\"\",\"VITE_APP_COLLAPSE_OVERLAY\":\"true\",\"VITE_APP_ENABLE_ESLINT\":\"true\",\"VITE_APP_ENABLE_PWA\":\"false\",\"VITE_APP_PLUS_EXPORT_PUBLIC_KEY\":\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\\nHQIDAQAB\",\"VITE_APP_DISABLE_PREVENT_UNLOAD\":\"\",\"VITE_PKG_NAME\":\"@zsviczian/excalidraw\",\"VITE_PKG_VERSION\":\"0.18.0-51\",\"VITE_IS_EXCALIDRAW_NPM_PACKAGE\":true}).PKG_NAME}@${({\"MODE\":\"development\",\"VITE_APP_BACKEND_V2_GET_URL\":\"https://json-dev.excalidraw.com/api/v2/\",\"VITE_APP_BACKEND_V2_POST_URL\":\"https://json-dev.excalidraw.com/api/v2/post/\",\"VITE_APP_LIBRARY_URL\":\"https://libraries.excalidraw.com\",\"VITE_APP_LIBRARY_BACKEND\":\"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries\",\"VITE_APP_WS_SERVER_URL\":\"http://localhost:3002\",\"VITE_APP_PLUS_LP\":\"https://plus.excalidraw.com\",\"VITE_APP_PLUS_APP\":\"http://localhost:3000\",\"VITE_APP_AI_BACKEND\":\"http://localhost:3015\",\"VITE_APP_FIREBASE_CONFIG\":\"{\\\"apiKey\\\":\\\"AIzaSyCMkxA60XIW8KbqMYL7edC4qT5l4qHX2h8\\\",\\\"authDomain\\\":\\\"excalidraw-oss-dev.firebaseapp.com\\\",\\\"projectId\\\":\\\"excalidraw-oss-dev\\\",\\\"storageBucket\\\":\\\"excalidraw-oss-dev.appspot.com\\\",\\\"messagingSenderId\\\":\\\"664559512677\\\",\\\"appId\\\":\\\"1:664559512677:web:a385181f2928d328a7aa8c\\\"}\",\"VITE_APP_DEV_DISABLE_LIVE_RELOAD\":\"\",\"VITE_APP_ENABLE_TRACKING\":\"true\",\"FAST_REFRESH\":\"false\",\"VITE_APP_PORT\":\"3000\",\"VITE_APP_DEBUG_ENABLE_TEXT_CONTAINER_BOUNDING_BOX\":\"\",\"VITE_APP_COLLAPSE_OVERLAY\":\"true\",\"VITE_APP_ENABLE_ESLINT\":\"true\",\"VITE_APP_ENABLE_PWA\":\"false\",\"VITE_APP_PLUS_EXPORT_PUBLIC_KEY\":\"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm2g5T+Rub6Kbf1Mf57t0\\n7r2zeHuVg4dla3r5ryXMswtzz6x767octl6oLThn33mQsPSy3GKglFZoCTXJR4ij\\nba8SxB04sL/N8eRrKja7TFWjCVtRwTTfyy771NYYNFVJclkxHyE5qw4m27crHF1y\\nUNWEjuqNMi/lwAErS9fFa2oJlWyT8U7zzv/5kQREkxZI6y9v0AF3qcbsy2731FnD\\ns9ChJvOUW9toIab2gsIdrKW8ZNpu084ZFVKb6LNjvIXI1Se4oMTHeszXzNptzlot\\nkdxxjOoaQMAyfljFSot1F1FlU6MQlag7UnFGvFjRHN1JI5q4K+n3a67DX+TMyRqS\\nHQIDAQAB\",\"VITE_APP_DISABLE_PREVENT_UNLOAD\":\"\",\"VITE_PKG_NAME\":\"@zsviczian/excalidraw\",\"VITE_PKG_VERSION\":\"0.18.0-51\",\"VITE_IS_EXCALIDRAW_NPM_PACKAGE\":true}).PKG_VERSION}` // is provided during package build\n: \"@excalidraw/excalidraw\" // fallback to the latest package version (i.e. for app)\n}/dist/prod/`;\n\n//# sourceURL=webpack://ExcalidrawLib/./fonts/ExcalidrawFontFace.ts?");
|
|
17198
17198
|
|
|
17199
17199
|
/***/ }),
|
|
17200
17200
|
|
|
@@ -20702,7 +20702,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
20702
20702
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
20703
20703
|
|
|
20704
20704
|
"use strict";
|
|
20705
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _excalidraw_common_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @excalidraw/common/constants */ \"../common/src/constants.ts\");\n\n\nif (\"development\" !== _excalidraw_common_constants__WEBPACK_IMPORTED_MODULE_0__.ENV.TEST) {\n /* eslint-disable */\n\n /* global __webpack_public_path__:writable */\n __webpack_require__.p = window.EXCALIDRAW_ASSET_PATH || `https://unpkg.com/${\"@zsviczian/excalidraw\"}@${\"0.18.0-
|
|
20705
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _excalidraw_common_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @excalidraw/common/constants */ \"../common/src/constants.ts\");\n\n\nif (\"development\" !== _excalidraw_common_constants__WEBPACK_IMPORTED_MODULE_0__.ENV.TEST) {\n /* eslint-disable */\n\n /* global __webpack_public_path__:writable */\n __webpack_require__.p = window.EXCALIDRAW_ASSET_PATH || `https://unpkg.com/${\"@zsviczian/excalidraw\"}@${\"0.18.0-51\"}/dist/`;\n}\n\n//# sourceURL=webpack://ExcalidrawLib/./publicPath.js?");
|
|
20706
20706
|
|
|
20707
20707
|
/***/ }),
|
|
20708
20708
|
|