@dwelle/excalidraw 0.3.16 → 0.3.20
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/CHANGELOG.md +11 -0
- package/README_NEXT.md +2 -17
- package/dist/0adeb55dfbca17fad22e.woff2 +1 -0
- package/dist/be42d56e500bdd14ae50.woff2 +1 -0
- package/dist/d9454a7bea9e32f0c282.woff2 +1 -0
- package/dist/edf7912ad1921efb0e5c.woff2 +1 -0
- package/dist/excalidraw-assets/image-0db17e06143a31f9772b.js +1 -0
- package/dist/excalidraw-assets/image-a26261fb8a718f15853e.js +1 -0
- package/dist/excalidraw-assets/vendor-405364e1fdefedf5d3d7.js +2 -0
- package/dist/excalidraw-assets/vendor-405364e1fdefedf5d3d7.js.LICENSE.txt +14 -0
- package/dist/excalidraw-assets/vendor-64ea3ed78bc76a895e61.js +2 -0
- package/dist/excalidraw-assets/vendor-64ea3ed78bc76a895e61.js.LICENSE.txt +14 -0
- package/dist/excalidraw-assets/vendor-ce466849186c701b6c48.js +2 -0
- package/dist/excalidraw-assets/vendor-ce466849186c701b6c48.js.LICENSE.txt +14 -0
- package/dist/excalidraw-assets-dev/image-469d5bd946743969995a.js +42 -0
- package/dist/excalidraw-assets-dev/image-664005f0b02c93342b89.js +42 -0
- package/dist/excalidraw-assets-dev/image-821afe7d20de2d2ca898.js +42 -0
- package/dist/excalidraw-assets-dev/vendor-7fcb99cece261da4983f.js +344 -0
- package/dist/excalidraw-assets-dev/vendor-a449655791956f151f51.js +344 -0
- package/dist/excalidraw.development.js +384 -188
- package/dist/excalidraw.production.min.js +1 -1
- package/dist/excalidraw.production.min.js.LICENSE.txt +9 -0
- package/package.json +24 -21
- package/types/appState.d.ts +6 -6
- package/types/components/CheckboxItem.d.ts +2 -1
- package/types/components/ClearCanvas.d.ts +0 -1
- package/types/components/ConfirmDialog.d.ts +11 -0
- package/types/components/Dialog.d.ts +4 -2
- package/types/components/HintViewer.d.ts +3 -2
- package/types/components/LibraryMenu.d.ts +18 -0
- package/types/components/LibraryMenuItems.d.ts +22 -0
- package/types/components/LibraryUnit.d.ts +6 -4
- package/types/components/Modal.d.ts +1 -0
- package/types/components/PasteChartDialog.d.ts +1 -1
- package/types/components/PublishLibrary.d.ts +17 -0
- package/types/components/SingleLibraryItem.d.ts +11 -0
- package/types/components/ToolButton.d.ts +5 -0
- package/types/components/Tooltip.d.ts +2 -1
- package/types/components/icons.d.ts +1 -0
- package/types/constants.d.ts +5 -0
- package/types/data/blob.d.ts +5 -1
- package/types/data/encryption.d.ts +3 -3
- package/types/data/filesystem.d.ts +2 -2
- package/types/data/json.d.ts +2 -2
- package/types/data/library.d.ts +1 -1
- package/types/data/restore.d.ts +2 -1
- package/types/data/types.d.ts +7 -4
- package/types/element/bounds.d.ts +8 -1
- package/types/element/index.d.ts +0 -3
- package/types/element/mutateElement.d.ts +1 -1
- package/types/element/newElement.d.ts +1 -1
- package/types/element/types.d.ts +2 -0
- package/types/i18n.d.ts +1 -1
- package/types/packages/excalidraw/dist/excalidraw-assets/image-0db17e06143a31f9772b.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/image-a26261fb8a718f15853e.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/vendor-405364e1fdefedf5d3d7.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/vendor-64ea3ed78bc76a895e61.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets/vendor-ce466849186c701b6c48.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/image-469d5bd946743969995a.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/image-664005f0b02c93342b89.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/image-821afe7d20de2d2ca898.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/vendor-7fcb99cece261da4983f.d.ts +0 -0
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/vendor-a449655791956f151f51.d.ts +0 -0
- package/types/packages/excalidraw/env.d.ts +1 -0
- package/types/packages/excalidraw/index.d.ts +1 -1
- package/types/packages/excalidraw/webpack.dev.config.d.ts +1 -1
- package/types/packages/excalidraw/webpack.prod.config.d.ts +1 -1
- package/types/packages/utils.d.ts +5 -4
- package/types/renderer/renderElement.d.ts +4 -4
- package/types/renderer/renderScene.d.ts +4 -9
- package/types/scene/types.d.ts +15 -8
- package/types/types.d.ts +14 -1
- package/types/utils.d.ts +10 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see excalidraw.production.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.Excalidraw=t(require("react"),require("react-dom")):e.Excalidraw=t(e.React,e.ReactDOM)}(self,(function(e,t){return function(){var n,r,o,a,i={7945:function(e,t,n){e.exports=n(1602)},200:function(e,t,n){var r="Expected a function",o=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,l=/^0o[0-7]+$/i,s=parseInt,c="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,u="object"==typeof self&&self&&self.Object===Object&&self,d=c||u||Function("return this")(),p=Object.prototype.toString,f=Math.max,h=Math.min,m=function(){return d.Date.now()};function g(e,t,n){var o,a,i,l,s,c,u=0,d=!1,p=!1,g=!0;if("function"!=typeof e)throw new TypeError(r);function y(t){var n=o,r=a;return o=a=void 0,u=t,l=e.apply(r,n)}function x(e){return u=e,s=setTimeout(k,t),d?y(e):l}function w(e){var n=e-c;return void 0===c||n>=t||n<0||p&&e-u>=i}function k(){var e=m();if(w(e))return S(e);s=setTimeout(k,function(e){var n=t-(e-c);return p?h(n,i-(e-u)):n}(e))}function S(e){return s=void 0,g&&o?y(e):(o=a=void 0,l)}function E(){var e=m(),n=w(e);if(o=arguments,a=this,c=e,n){if(void 0===s)return x(c);if(p)return s=setTimeout(k,t),y(c)}return void 0===s&&(s=setTimeout(k,t)),l}return t=b(t)||0,v(n)&&(d=!!n.leading,i=(p="maxWait"in n)?f(b(n.maxWait)||0,t):i,g="trailing"in n?!!n.trailing:g),E.cancel=function(){void 0!==s&&clearTimeout(s),u=0,o=c=a=s=void 0},E.flush=function(){return void 0===s?l:S(m())},E}function v(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function b(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==p.call(e)}(e))return NaN;if(v(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=v(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var n=i.test(e);return n||l.test(e)?s(e.slice(2),n?2:8):a.test(e)?NaN:+e}e.exports=function(e,t,n){var o=!0,a=!0;if("function"!=typeof e)throw new TypeError(r);return v(n)&&(o="leading"in n?!!n.leading:o,a="trailing"in n?!!n.trailing:a),g(e,t,{leading:o,maxWait:t,trailing:a})}},4516:function(e){"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,a){for(var i,l,s=o(e),c=1;c<arguments.length;c++){for(var u in i=Object(arguments[c]))n.call(i,u)&&(s[u]=i[u]);if(t){l=t(i);for(var d=0;d<l.length;d++)r.call(i,l[d])&&(s[l[d]]=i[l[d]])}}return s}},6094:function(e,t,n){"use strict";n(4516);var r=n(4698),o=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var a=Symbol.for;o=a("react.element"),t.Fragment=a("react.fragment")}var i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l=Object.prototype.hasOwnProperty,s={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,a={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)l.call(t,r)&&!s.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===a[r]&&(a[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:u,props:a,_owner:i.current}}t.jsx=c,t.jsxs=c},4512:function(e,t,n){"use strict";e.exports=n(6094)},1602:function(e){var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var o=t&&t.prototype instanceof g?t:g,a=Object.create(o.prototype),i=new M(r||[]);return a._invoke=function(e,t,n){var r=d;return function(o,a){if(r===f)throw new Error("Generator is already running");if(r===h){if("throw"===o)throw a;return P()}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var l=C(i,n);if(l){if(l===m)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var s=u(e,t,n);if("normal"===s.type){if(r=n.done?h:p,s.arg===m)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r=h,n.method="throw",n.arg=s.arg)}}}(e,n,i),a}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var d="suspendedStart",p="suspendedYield",f="executing",h="completed",m={};function g(){}function v(){}function b(){}var y={};y[a]=function(){return this};var x=Object.getPrototypeOf,w=x&&x(x(I([])));w&&w!==n&&r.call(w,a)&&(y=w);var k=b.prototype=g.prototype=Object.create(y);function S(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(o,a,i,l){var s=u(e[o],e,a);if("throw"!==s.type){var c=s.arg,d=c.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,i,l)}),(function(e){n("throw",e,i,l)})):t.resolve(d).then((function(e){c.value=e,i(c)}),(function(e){return n("throw",e,i,l)}))}l(s.arg)}var o;this._invoke=function(e,r){function a(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(a,a):a()}}function C(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method))return m;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var o=u(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,m;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function I(e){if(e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}return{next:P}}function P(){return{value:t,done:!0}}return v.prototype=k.constructor=b,b.constructor=v,v.displayName=s(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,s(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},e.awrap=function(e){return{__await:e}},S(E.prototype),E.prototype[i]=function(){return this},e.AsyncIterator=E,e.async=function(t,n,r,o,a){void 0===a&&(a=Promise);var i=new E(c(t,n,r,o),a);return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},S(k),s(k,l,"Generator"),k[a]=function(){return this},k.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=I,M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return l.type="throw",l.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,m):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:I(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}},8336:function(e,t,n){var r=n(487),o=n(4295);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},554:function(e,t,n){var r=n(487),o=n(9135);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},2789:function(e,t,n){var r=n(487),o=n(3729);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},5080:function(e,t,n){var r=n(487),o=n(4241);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},7225:function(e,t,n){var r=n(487),o=n(6029);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},9446:function(e,t,n){var r=n(487),o=n(7572);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},778:function(e,t,n){var r=n(487),o=n(9609);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},4220:function(e,t,n){var r=n(487),o=n(2345);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},1292:function(e,t,n){var r=n(487),o=n(6578);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},196:function(e,t,n){var r=n(487),o=n(9482);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},2205:function(e,t,n){var r=n(487),o=n(7955);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},1310:function(e,t,n){var r=n(487),o=n(3195);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},3922:function(e,t,n){var r=n(487),o=n(2978);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},7096:function(e,t,n){var r=n(487),o=n(1587);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},7117:function(e,t,n){var r=n(487),o=n(9478);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},1106:function(e,t,n){var r=n(487),o=n(7369);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},3336:function(e,t,n){var r=n(487),o=n(1434);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},694:function(e,t,n){var r=n(487),o=n(5644);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},8328:function(e,t,n){var r=n(487),o=n(6843);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},8051:function(e,t,n){var r=n(487),o=n(8461);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},4301:function(e,t,n){var r=n(487),o=n(9935);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},9966:function(e,t,n){var r=n(487),o=n(532);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},371:function(e,t,n){var r=n(487),o=n(5892);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},4623:function(e,t,n){var r=n(487),o=n(3874);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},1528:function(e,t,n){var r=n(487),o=n(2681);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},518:function(e,t,n){var r=n(487),o=n(6759);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},9757:function(e,t,n){var r=n(487),o=n(9650);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},5422:function(e,t,n){var r=n(487),o=n(2044);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},6781:function(e,t,n){var r=n(487),o=n(6626);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},580:function(e,t,n){var r=n(487),o=n(6359);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},4285:function(e,t,n){var r=n(487),o=n(9915);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},3313:function(e,t,n){var r=n(487),o=n(9310);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},8635:function(e,t,n){var r=n(487),o=n(6464);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var a={insert:"head",singleton:!1};r(o,a);e.exports=o.locals||{}},487:function(e,t,n){"use strict";var r,o=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},a=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),i=[];function l(e){for(var t=-1,n=0;n<i.length;n++)if(i[n].identifier===e){t=n;break}return t}function s(e,t){for(var n={},r=[],o=0;o<e.length;o++){var a=e[o],s=t.base?a[0]+t.base:a[0],c=n[s]||0,u="".concat(s," ").concat(c);n[s]=c+1;var d=l(u),p={css:a[1],media:a[2],sourceMap:a[3]};-1!==d?(i[d].references++,i[d].updater(p)):i.push({identifier:u,updater:g(p,t),references:1}),r.push(u)}return r}function c(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var o=n.nc;o&&(r.nonce=o)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var i=a(e.insert||"head");if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(t)}return t}var u,d=(u=[],function(e,t){return u[e]=t,u.filter(Boolean).join("\n")});function p(e,t,n,r){var o=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=d(t,o);else{var a=document.createTextNode(o),i=e.childNodes;i[t]&&e.removeChild(i[t]),i.length?e.insertBefore(a,i[t]):e.appendChild(a)}}function f(e,t,n){var r=n.css,o=n.media,a=n.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),a&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var h=null,m=0;function g(e,t){var n,r,o;if(t.singleton){var a=m++;n=h||(h=c(t)),r=p.bind(null,n,a,!1),o=p.bind(null,n,a,!0)}else n=c(t),r=f.bind(null,n,t),o=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=o());var n=s(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var o=l(n[r]);i[o].references--}for(var a=s(e,t),c=0;c<n.length;c++){var u=l(n[c]);0===i[u].references&&(i[u].updater(),i.splice(u,1))}n=a}}}},9713:function(e){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},6479:function(e,t,n){var r=n(7316);e.exports=function(e,t){if(null==e)return{};var n,o,a=r(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},7316:function(e){e.exports=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}},8:function(e){function t(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=t=function(e){return typeof e}:e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(n)}e.exports=t},4295:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r),a=n(1667),i=n.n(a),l=n(7464),s=n(9638),c=o()((function(e){return e[1]})),u=i()(l.Z),d=i()(s.Z);c.push([e.id,'@font-face{font-family:"Virgil";src:url('+u+');font-display:swap}@font-face{font-family:"Cascadia";src:url('+d+");font-display:swap}",""]),t.default=c},9135:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".excalidraw .ActiveFile .ActiveFile__fileName{display:flex;align-items:center}.excalidraw .ActiveFile .ActiveFile__fileName span{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:9.3em}.excalidraw .ActiveFile .ActiveFile__fileName svg{width:1.15em;-webkit-margin-end:.3em;margin-inline-end:.3em;-webkit-transform:scaleY(0.9);transform:scaleY(0.9)}",""]),t.default=o},3729:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Avatar{width:2.5rem;height:2.5rem;border-radius:50%;display:flex;justify-content:center;align-items:center;color:#fff;cursor:pointer;font-size:.8rem;font-weight:500;overflow:hidden}.excalidraw .Avatar img{width:100%;height:100%}",""]),t.default=o},4241:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Card{display:flex;flex-direction:column;align-items:center;max-width:290px;margin:1em;text-align:center}.excalidraw .Card .Card-icon{font-size:2.6em;display:flex;flex:0 0 auto;padding:1.4rem;border-radius:50%;background:var(--card-color);color:#fff}.excalidraw .Card .Card-icon svg{width:2.8rem;height:2.8rem}.excalidraw .Card .Card-details{font-size:.96em;min-height:90px;padding:0 1em;margin-bottom:auto}.excalidraw .Card .Card-button.ToolIcon_type_button{height:2.5rem;margin-top:1em;margin-bottom:.3em;background-color:var(--card-color)}.excalidraw .Card .Card-button.ToolIcon_type_button:hover{background-color:var(--card-color-darker)}.excalidraw .Card .Card-button.ToolIcon_type_button:active{background-color:var(--card-color-darkest)}.excalidraw .Card .Card-button.ToolIcon_type_button .ToolIcon__label{color:#fff}.excalidraw .Card .Card-button.ToolIcon_type_button .Spinner{--spinner-color: #fff}",""]),t.default=o},6029:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Checkbox{margin:4px .3em;display:flex;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.excalidraw .Checkbox:hover:not(.is-checked) .Checkbox-box:not(:focus){box-shadow:0 0 0 2px #4dabf7}.excalidraw .Checkbox:hover:not(.is-checked) .Checkbox-box:not(:focus) svg{display:block;opacity:.3}.excalidraw .Checkbox:active .Checkbox-box{box-shadow:0 0 2px 1px inset #1c7ed6 !important}.excalidraw .Checkbox:hover .Checkbox-box{background-color:rgba(208,235,255,.2)}.excalidraw .Checkbox.is-checked .Checkbox-box{background-color:#d0ebff}.excalidraw .Checkbox.is-checked .Checkbox-box svg{display:block}.excalidraw .Checkbox.is-checked:hover .Checkbox-box{background-color:#a5d8ff}.excalidraw .Checkbox .Checkbox-box{width:22px;height:22px;padding:0;flex:0 0 auto;margin:0 1em;display:flex;align-items:center;justify-content:center;box-shadow:0 0 0 2px #1c7ed6;background-color:transparent;border-radius:4px;color:#1c7ed6}.excalidraw .Checkbox .Checkbox-box:focus{box-shadow:0 0 0 3px #1c7ed6}.excalidraw .Checkbox .Checkbox-box svg{display:none;width:16px;height:16px;stroke-width:3px}.excalidraw .Checkbox .Checkbox-label{display:flex;align-items:center}.excalidraw .Checkbox .excalidraw-tooltip-icon{width:1em;height:1em}",""]),t.default=o},7572:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .clear-canvas-buttons{display:flex;padding:.2rem 0;justify-content:flex-end}.excalidraw .clear-canvas-buttons .ToolIcon__icon{min-width:2.5rem;width:auto;font-size:1rem}.excalidraw .clear-canvas-buttons .ToolIcon_type_button{margin-left:1.5rem;padding:0 .5rem}.excalidraw .clear-canvas__content{font-size:1rem}.excalidraw .clear-canvas--confirm.ToolIcon_type_button{background-color:#fa5252}.excalidraw .clear-canvas--confirm.ToolIcon_type_button:hover{background-color:#e03131}.excalidraw .clear-canvas--confirm.ToolIcon_type_button .ToolIcon__icon{color:#fff}.excalidraw .clear-canvas--cancel.ToolIcon_type_button{background-color:#e9ecef}",""]),t.default=o},9609:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .CollabButton.is-collaborating{background-color:var(--button-special-active-bg-color)}.excalidraw .CollabButton.is-collaborating .ToolIcon__icon svg,.excalidraw .CollabButton.is-collaborating .ToolIcon__label{color:var(--icon-green-fill-color)}.excalidraw .CollabButton-collaborators{min-width:1em;position:absolute;bottom:-5px;padding:3px;border-radius:50%;background-color:#40c057;color:#fff;font-size:.7em;font-family:var(--ui-font)}:root[dir=ltr] .excalidraw .CollabButton-collaborators{right:-5px}:root[dir=rtl] .excalidraw .CollabButton-collaborators{left:-5px}",""]),t.default=o},2345:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,':export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .color-picker{background:var(--popup-bg-color);border:0 solid rgba(255,255,255,.25);box-shadow:rgba(0,0,0,.25) 0 1px 4px;border-radius:4px;position:absolute}:root[dir=ltr] .excalidraw .color-picker{left:-5.5px}:root[dir=rtl] .excalidraw .color-picker{right:-5.5px}.excalidraw .color-picker-control-container{display:grid;grid-template-columns:auto 1fr;align-items:center}.excalidraw .color-picker-triangle{width:0;height:0;border-style:solid;border-width:0 9px 10px;border-color:transparent transparent var(--popup-bg-color);position:absolute;top:-10px}:root[dir=ltr] .excalidraw .color-picker-triangle{left:12px}:root[dir=rtl] .excalidraw .color-picker-triangle{right:12px}.excalidraw .color-picker-triangle-shadow{border-color:transparent transparent rgba(0,0,0,.1);top:-11px}.excalidraw .color-picker-content{padding:.5rem;display:grid;grid-template-columns:repeat(5, auto);grid-gap:.5rem;border-radius:4px}.excalidraw .color-picker-content:focus{outline:none;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .color-picker-content .color-input-container{grid-column:1/span 5}.excalidraw .color-picker-swatch{position:relative;height:1.875rem;width:1.875rem;cursor:pointer;border-radius:4px;margin:0;box-sizing:border-box;border:1px solid #ddd;background-color:currentColor !important;-webkit-filter:var(--theme-filter);filter:var(--theme-filter)}.excalidraw .color-picker-swatch:focus{box-shadow:0 0 4px 1px currentColor;border-color:var(--select-highlight-color)}.excalidraw .color-picker-transparent{border-radius:4px;box-shadow:rgba(0,0,0,.1) 0 0 0 1px inset;position:absolute;top:0;right:0;bottom:0;left:0}.excalidraw .color-picker-transparent,.excalidraw .color-picker-label-swatch{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==") left center}.excalidraw .color-picker-hash{background:var(--input-border-color);height:1.875rem;width:1.875rem;color:var(--input-label-color);display:flex;align-items:center;justify-content:center;position:relative}:root[dir=ltr] .excalidraw .color-picker-hash{border-radius:4px 0 0 4px}:root[dir=rtl] .excalidraw .color-picker-hash{border-radius:0 4px 4px 0}.excalidraw .color-input-container:focus-within .color-picker-hash{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .color-input-container:focus-within .color-picker-hash::before,.excalidraw .color-input-container:focus-within .color-picker-hash::after{content:"";width:1px;height:100%;position:absolute;top:0}.excalidraw .color-input-container:focus-within .color-picker-hash::before{background:var(--input-border-color)}:root[dir=ltr] .excalidraw .color-input-container:focus-within .color-picker-hash::before{right:-1px}:root[dir=rtl] .excalidraw .color-input-container:focus-within .color-picker-hash::before{left:-1px}.excalidraw .color-input-container:focus-within .color-picker-hash::after{background:var(--input-bg-color)}:root[dir=ltr] .excalidraw .color-input-container:focus-within .color-picker-hash::after{right:-2px}:root[dir=rtl] .excalidraw .color-input-container:focus-within .color-picker-hash::after{left:-2px}.excalidraw .color-input-container{display:flex}.excalidraw .color-picker-input{width:11ch;margin:0;font-size:1rem;background-color:var(--input-bg-color);color:var(--text-primary-color);border:0;outline:none;height:1.75em;box-shadow:var(--input-border-color) 0 0 0 1px inset;float:left;padding:1px;-webkit-padding-start:.5em;padding-inline-start:.5em;-webkit-appearance:none;appearance:none}:root[dir=ltr] .excalidraw .color-picker-input{border-radius:0 4px 4px 0}:root[dir=rtl] .excalidraw .color-picker-input{border-radius:4px 0 0 4px}.excalidraw .color-picker-label-swatch{height:1.875rem;width:1.875rem;-webkit-margin-end:.25rem;margin-inline-end:.25rem;border:1px solid #dee2e6;position:relative;overflow:hidden;background-color:transparent !important;-webkit-filter:var(--theme-filter);filter:var(--theme-filter)}.excalidraw .color-picker-label-swatch:after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;background:var(--swatch-color)}.excalidraw .color-picker-keybinding{position:absolute;bottom:2px;font-size:.7em}:root[dir=ltr] .excalidraw .color-picker-keybinding{right:2px}:root[dir=rtl] .excalidraw .color-picker-keybinding{left:2px}.excalidraw--mobile.excalidraw .color-picker-keybinding{display:none}.excalidraw .color-picker-type-canvasBackground .color-picker-keybinding{color:#aaa}.excalidraw .color-picker-type-elementBackground .color-picker-keybinding{color:#fff}.excalidraw .color-picker-swatch[aria-label=transparent] .color-picker-keybinding{color:#aaa}.excalidraw .color-picker-type-elementStroke .color-picker-keybinding{color:#d4d4d4}.excalidraw.theme--dark .color-picker-type-elementBackground .color-picker-keybinding{color:#000}.excalidraw.theme--dark .color-picker-swatch[aria-label=transparent] .color-picker-keybinding{color:#000}',""]),t.default=o},6578:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,':export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .context-menu{position:relative;border-radius:4px;box-shadow:0 3px 10px rgba(0,0,0,.2);padding:0;list-style:none;-webkit-user-select:none;user-select:none;margin:-0.25rem 0 0 .125rem;padding:.5rem 0;background-color:var(--popup-secondary-bg-color);border:1px solid var(--button-gray-3);cursor:default}.excalidraw .context-menu button{color:var(--popup-text-color)}.excalidraw .context-menu-option{position:relative;width:100%;min-width:9.5rem;margin:0;padding:.25rem 1rem .25rem 1.25rem;text-align:start;border-radius:0;background-color:transparent;border:none;white-space:nowrap;display:grid;grid-template-columns:1fr .2fr;align-items:center}.excalidraw .context-menu-option.checkmark::before{position:absolute;left:6px;margin-bottom:1px;content:"✓"}.excalidraw .context-menu-option.dangerous .context-menu-option__label{color:#f03e3e}.excalidraw .context-menu-option .context-menu-option__label{justify-self:start;-webkit-margin-end:20px;margin-inline-end:20px}.excalidraw .context-menu-option .context-menu-option__shortcut{justify-self:end;opacity:.6;font-family:inherit;font-size:.7rem}.excalidraw .context-menu-option:hover{color:var(--popup-bg-color);background-color:var(--select-highlight-color)}.excalidraw .context-menu-option:hover.dangerous{background-color:#fa5252}.excalidraw .context-menu-option:hover.dangerous .context-menu-option__label{color:var(--popup-bg-color)}.excalidraw .context-menu-option:focus{z-index:1}.excalidraw--mobile.excalidraw .context-menu-option{display:block}.excalidraw--mobile.excalidraw .context-menu-option .context-menu-option__label{-webkit-margin-end:0;margin-inline-end:0}.excalidraw--mobile.excalidraw .context-menu-option .context-menu-option__shortcut{display:none}.excalidraw .context-menu-option-separator{border:none;border-top:1px solid #adb5bd}',""]),t.default=o},9482:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Dialog{-webkit-user-select:text;user-select:text;cursor:auto}.excalidraw .Dialog__title{display:grid;align-items:center;margin-top:0;grid-template-columns:1fr calc(var(--space-factor) * 7);grid-gap:var(--metric);padding:calc(var(--space-factor) * 2);text-align:center;font-variant:small-caps;font-size:1.2em}.excalidraw .Dialog__titleContent{flex:1}.excalidraw .Dialog .Modal__close{color:var(--icon-fill-color);margin:0}.excalidraw .Dialog__content{padding:0 16px 16px}.excalidraw--mobile.excalidraw .Dialog{--metric: calc(var(--space-factor) * 4);--inset-left: max(var(--metric), var(--sal));--inset-right: max(var(--metric), var(--sar))}.excalidraw--mobile.excalidraw .Dialog__title{grid-template-columns:calc(var(--space-factor) * 7) 1fr calc( var(--space-factor) * 7 );position:-webkit-sticky;position:sticky;top:0;padding:calc(var(--space-factor) * 2);background:var(--island-bg-color);font-size:1.25em;box-sizing:border-box;border-bottom:1px solid var(--button-gray-2);z-index:1}.excalidraw--mobile.excalidraw .Dialog__titleContent{text-align:center}.excalidraw--mobile.excalidraw .Dialog .Island{width:100vw;height:100%;box-sizing:border-box;overflow-y:auto;padding-left:max(calc(var(--padding) * var(--space-factor)), var(--sal));padding-right:max(calc(var(--padding) * var(--space-factor)), var(--sar));padding-bottom:max(calc(var(--padding) * var(--space-factor)), var(--sab))}.excalidraw--mobile.excalidraw .Dialog .Modal__close{order:-1}",""]),t.default=o},7955:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,':export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .ExportDialog__preview{--preview-padding: calc(var(--space-factor) * 4);background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==") left center;text-align:center;padding:var(--preview-padding);margin-bottom:calc(var(--space-factor) * 3)}.excalidraw .ExportDialog__preview canvas{max-width:calc(100% - var(--preview-padding) * 2);max-height:25rem}.excalidraw.theme--dark .ExportDialog__preview canvas{-webkit-filter:none;filter:none}.excalidraw .ExportDialog__actions{width:100%;display:flex;grid-gap:calc(var(--space-factor) * 2);align-items:top;justify-content:space-between}.excalidraw--mobile.excalidraw .ExportDialog{display:flex;flex-direction:column}.excalidraw--mobile.excalidraw .ExportDialog__actions{flex-direction:column;align-items:center}.excalidraw--mobile.excalidraw .ExportDialog__actions>*{margin-bottom:calc(var(--space-factor) * 3)}.excalidraw--mobile.excalidraw .ExportDialog__preview canvas{max-height:30vh}.excalidraw--mobile.excalidraw .ExportDialog__dialog,.excalidraw--mobile.excalidraw .ExportDialog__dialog .Island{height:100%;box-sizing:border-box}.excalidraw--mobile.excalidraw .ExportDialog__dialog .Island{overflow-y:auto}.excalidraw .ExportDialog--json .ExportDialog-cards{display:grid;grid-template-columns:repeat(auto-fit, minmax(200px, 1fr));justify-items:center;row-gap:2em}@media(max-width: 460px){.excalidraw .ExportDialog--json .ExportDialog-cards{grid-template-columns:repeat(auto-fit, minmax(240px, 1fr))}.excalidraw .ExportDialog--json .ExportDialog-cards .Card-details{min-height:40px}}.excalidraw .ExportDialog--json .ExportDialog-cards .ProjectName{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;margin:1em auto;align-items:flex-start;flex-direction:column}.excalidraw .ExportDialog--json .ExportDialog-cards .ProjectName .TextInput{width:auto}.excalidraw .ExportDialog--json .ExportDialog-cards .ProjectName-label{margin:.625em 0;font-weight:bold}.excalidraw button.ExportDialog-imageExportButton{width:5rem;height:5rem;margin:0 .2em;border-radius:1rem;background-color:var(--button-color);box-shadow:0 3px 5px -1px rgba(0,0,0,.28),0 6px 10px 0 rgba(0,0,0,.14);font-family:Cascadia;font-size:1.8em;color:#fff}.excalidraw button.ExportDialog-imageExportButton:hover{background-color:var(--button-color-darker)}.excalidraw button.ExportDialog-imageExportButton:active{background-color:var(--button-color-darkest);box-shadow:none}.excalidraw button.ExportDialog-imageExportButton svg{width:.9em}',""]),t.default=o},3195:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".excalidraw .FixedSideContainer{position:absolute;pointer-events:none}.excalidraw .FixedSideContainer>*{pointer-events:all}.excalidraw .FixedSideContainer_side_top{left:var(--space-factor);top:var(--space-factor);right:var(--space-factor);z-index:2}.excalidraw .FixedSideContainer_side_top.zen-mode{right:42px}",""]),t.default=o},2978:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .HelpDialog h3{border-bottom:1px solid var(--button-gray-2);padding-bottom:4px}.excalidraw .HelpDialog--island{border:1px solid var(--button-gray-2);margin-bottom:16px}.excalidraw .HelpDialog--island-title{margin:0;padding:4px;background-color:var(--button-gray-1);text-align:center}.excalidraw .HelpDialog--shortcut{border-top:1px solid var(--button-gray-2)}.excalidraw .HelpDialog--key{word-break:keep-all;border:1px solid var(--button-gray-2);padding:2px 8px;margin:auto 4px;background-color:var(--button-gray-1);border-radius:2px;font-size:.8em;min-height:26px;box-sizing:border-box;display:flex;align-items:center;font-family:inherit}.excalidraw .HelpDialog--header{display:flex;flex-direction:row;justify-content:space-evenly;margin-bottom:32px;padding-bottom:16px}.excalidraw .HelpDialog--btn{border:1px solid var(--link-color);padding:8px 32px;border-radius:4px}.excalidraw .HelpDialog--btn:hover{text-decoration:none}",""]),t.default=o},1587:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .HintViewer{pointer-events:none;box-sizing:border-box;position:absolute;display:flex;justify-content:center;left:0;top:100%;max-width:100%;width:100%;margin-top:6px;text-align:center;color:#868e96;font-size:.8rem}.excalidraw--mobile.excalidraw .HintViewer{position:static;padding-right:2em}.excalidraw .HintViewer>span{padding:.2rem .4rem;background-color:var(--overlay-bg-color);border-radius:4px}",""]),t.default=o},9478:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,':export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .picker-container{display:inline-block;box-sizing:border-box;margin-right:.25rem}.excalidraw .picker{background:var(--popup-bg-color);border:0 solid rgba(255,255,255,.25);box-shadow:rgba(0,0,0,.25) 0 1px 4px;border-radius:4px;position:absolute}.excalidraw .picker-container button,.excalidraw .picker button{position:relative;display:flex;align-items:center;justify-content:center}.excalidraw .picker-container button:focus,.excalidraw .picker button:focus{outline:transparent;background-color:var(--button-gray-2)}.excalidraw .picker-container button:focus svg,.excalidraw .picker button:focus svg{opacity:1}.excalidraw .picker-container button:hover,.excalidraw .picker button:hover{background-color:var(--button-gray-2)}.excalidraw .picker-container button:active,.excalidraw .picker button:active{background-color:var(--button-gray-3)}.excalidraw .picker-container button:disabled,.excalidraw .picker button:disabled{cursor:not-allowed}.excalidraw .picker-container button svg,.excalidraw .picker button svg{margin:0;width:36px;height:18px;opacity:.6;pointer-events:none}.excalidraw .picker button{padding:.25rem .28rem .35rem .25rem}.excalidraw .picker-triangle{width:0;height:0;position:relative;top:-10px;z-index:10}:root[dir=ltr] .excalidraw .picker-triangle{left:12px}:root[dir=rtl] .excalidraw .picker-triangle{right:12px}.excalidraw .picker-triangle:before{content:"";position:absolute;border-style:solid;border-width:0 9px 10px;border-color:transparent transparent rgba(0,0,0,.1);top:-1px}.excalidraw .picker-triangle:after{content:"";position:absolute;border-style:solid;border-width:0 9px 10px;border-color:transparent transparent var(--popup-bg-color)}.excalidraw .picker-content{padding:.5rem;display:grid;grid-template-columns:repeat(3, auto);grid-gap:.5rem;border-radius:4px}:root[dir=rtl] .excalidraw .picker-content{padding:.4rem}.excalidraw .picker-keybinding{position:absolute;bottom:2px;font-size:.7em;color:var(--keybinding-color)}:root[dir=ltr] .excalidraw .picker-keybinding{right:2px}:root[dir=rtl] .excalidraw .picker-keybinding{left:2px}.excalidraw--mobile.excalidraw .picker-keybinding{display:none}.excalidraw .picker-type-canvasBackground .picker-keybinding{color:#aaa}.excalidraw .picker-type-elementBackground .picker-keybinding{color:#fff}.excalidraw .picker-swatch[aria-label=transparent] .picker-keybinding{color:#aaa}.excalidraw .picker-type-elementStroke .picker-keybinding{color:#d4d4d4}.excalidraw.theme--dark .picker-type-elementBackground .picker-keybinding{color:#000}.excalidraw.theme--dark .picker-swatch[aria-label=transparent] .picker-keybinding{color:#000}',""]),t.default=o},7369:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".excalidraw .Island{--padding: 0;background-color:var(--island-bg-color);box-shadow:var(--shadow-island);border-radius:4px;padding:calc(var(--padding) * var(--space-factor));position:relative}.excalidraw .Island.zen-mode{box-shadow:none}.excalidraw .Island::-webkit-scrollbar{width:10px}.excalidraw .Island::-webkit-scrollbar-track{background-color:transparent}.excalidraw .Island::-webkit-scrollbar-thumb{background-color:var(--color-scrollbar-thumb)}.excalidraw .Island::-webkit-scrollbar-thumb:hover{background-color:var(--color-scrollbar-thumb-hover)}.excalidraw .Island::-webkit-scrollbar-thumb:active{background-color:var(--color-scrollbar-thumb-active)}.excalidraw .App-menu_top .Stack_vertical .Island{min-width:216px}.excalidraw .App-menu_top .Stack_vertical .Stack_horizontal{justify-content:center !important}.excalidraw.excalidraw--view-mode .App-menu_top .Stack_vertical .Island{min-width:auto}",""]),t.default=o},1434:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".excalidraw .layer-ui__library{margin:auto;display:flex;align-items:center;justify-content:center}.excalidraw .layer-ui__library .layer-ui__library-header{display:flex;align-items:center;width:100%;margin:2px 0}.excalidraw .layer-ui__library .layer-ui__library-header button{margin:0 2px}.excalidraw .layer-ui__library .layer-ui__library-header a{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-padding-end:18px;padding-inline-end:18px;white-space:nowrap}.excalidraw .layer-ui__library-message{padding:10px 20px;max-width:200px}.excalidraw .layer-ui__library-items{max-height:50vh;overflow:auto}.excalidraw .layer-ui__wrapper{z-index:var(--zIndex-layerUI)}.excalidraw .layer-ui__wrapper__top-right{display:flex}.excalidraw .layer-ui__wrapper__footer{width:100%}.excalidraw .layer-ui__wrapper__footer-right{z-index:100;display:flex}.excalidraw .layer-ui__wrapper .zen-mode-transition{transition:-webkit-transform .5s ease-in-out;transition:transform .5s ease-in-out;transition:transform .5s ease-in-out, -webkit-transform .5s ease-in-out}:root[dir=ltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-left{-webkit-transform:translate(-999px, 0);transform:translate(-999px, 0)}:root[dir=ltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-right{-webkit-transform:translate(999px, 0);transform:translate(999px, 0)}:root[dir=rtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-left{-webkit-transform:translate(999px, 0);transform:translate(999px, 0)}:root[dir=rtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-right{-webkit-transform:translate(-999px, 0);transform:translate(-999px, 0)}:root[dir=ltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-left{-webkit-transform:translate(-76px, 0);transform:translate(-76px, 0)}:root[dir=rtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-left{-webkit-transform:translate(76px, 0);transform:translate(76px, 0)}.excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-bottom{-webkit-transform:translate(0, 92px);transform:translate(0, 92px)}.excalidraw .layer-ui__wrapper .disable-zen-mode{height:30px;position:absolute;bottom:10px;font-size:10px;padding:10px;font-weight:500;opacity:0;visibility:hidden;transition:visibility 0s linear 0s,opacity .5s}[dir=ltr] .excalidraw .layer-ui__wrapper .disable-zen-mode{right:15px}[dir=rtl] .excalidraw .layer-ui__wrapper .disable-zen-mode{left:15px}.excalidraw .layer-ui__wrapper .disable-zen-mode--visible{opacity:1;visibility:visible;transition:visibility 0s linear 300ms,opacity .5s;transition-delay:.8s}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-center{pointer-events:none}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-center>*{pointer-events:all}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-left,.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-right,.excalidraw .layer-ui__wrapper .disable-zen-mode--visible{pointer-events:all}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-left{margin-bottom:.2em}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-right{margin-top:auto;margin-bottom:auto;-webkit-margin-end:1em;margin-inline-end:1em}",""]),t.default=o},5644:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".excalidraw .library-unit{align-items:center;border:1px solid var(--button-gray-2);display:flex;justify-content:center;position:relative;width:63px;height:63px}.excalidraw .library-unit__dragger{display:flex;height:100%;width:100%}.excalidraw .library-unit__dragger>svg{-webkit-filter:var(--theme-filter);filter:var(--theme-filter);flex-grow:1;max-height:100%;max-width:100%}.excalidraw .library-unit__removeFromLibrary,.excalidraw .library-unit__removeFromLibrary:hover,.excalidraw .library-unit__removeFromLibrary:active{align-items:center;background:none;border:none;color:var(--icon-fill-color);display:flex;justify-content:center;margin:0;padding:0;position:absolute;right:5px;top:5px}.excalidraw .library-unit__removeFromLibrary>svg{height:16px;width:16px}.excalidraw .library-unit__pulse{-webkit-transform:scale(1);transform:scale(1);-webkit-animation:library-unit__pulse-animation 1s ease-in infinite;animation:library-unit__pulse-animation 1s ease-in infinite}.excalidraw .library-unit__adder{position:absolute;left:50%;top:50%;width:20px;height:20px;margin-left:-10px;margin-top:-10px;pointer-events:none}.excalidraw .library-unit__active{cursor:pointer}@-webkit-keyframes library-unit__pulse-animation{0%{-webkit-transform:scale(0.95);transform:scale(0.95)}50%{-webkit-transform:scale(1);transform:scale(1)}100%{-webkit-transform:scale(0.95);transform:scale(0.95)}}@keyframes library-unit__pulse-animation{0%{-webkit-transform:scale(0.95);transform:scale(0.95)}50%{-webkit-transform:scale(1);transform:scale(1)}100%{-webkit-transform:scale(0.95);transform:scale(0.95)}}",""]),t.default=o},6843:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw.excalidraw-modal-container{position:absolute;z-index:10}.excalidraw .Modal{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;overflow:auto;padding:calc(var(--space-factor) * 10)}.excalidraw .Modal__background{position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;background-color:rgba(0,0,0,.7)}.excalidraw .Modal__content{position:relative;z-index:2;width:100%;max-width:var(--max-width);max-height:100%;opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px);-webkit-animation:Modal__content_fade-in .1s ease-out .05s forwards;animation:Modal__content_fade-in .1s ease-out .05s forwards;position:relative;overflow-y:auto;background:var(--island-bg-color);border:1px solid var(--dialog-border-color);box-shadow:0 2px 10px rgba(0,0,0,.25);border-radius:6px;box-sizing:border-box}.excalidraw .Modal__content:focus{outline:none}.excalidraw--mobile.excalidraw .Modal__content{max-width:100%;border:0;border-radius:0}@-webkit-keyframes Modal__content_fade-in{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes Modal__content_fade-in{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.excalidraw .Modal__close{width:calc(var(--space-factor) * 7);height:calc(var(--space-factor) * 7);display:flex;align-items:center;justify-content:center}.excalidraw .Modal__close svg{height:calc(var(--space-factor) * 5)}.excalidraw--mobile.excalidraw .Modal{padding:0}.excalidraw--mobile.excalidraw .Modal__content{position:absolute;top:0;left:0;right:0;bottom:0}",""]),t.default=o},8461:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw--mobile.excalidraw .PasteChartDialog .Island{display:flex;flex-direction:column}.excalidraw .PasteChartDialog .container{display:flex;align-items:center;justify-content:space-around;flex-wrap:wrap}.excalidraw--mobile.excalidraw .PasteChartDialog .container{flex-direction:column;justify-content:center}.excalidraw .PasteChartDialog .ChartPreview{margin:8px;text-align:center;width:192px;height:128px;border-radius:2px;padding:1px;border:1px solid #ced4da;display:flex;align-items:center;justify-content:center;background:transparent}.excalidraw .PasteChartDialog .ChartPreview div{display:inline-block}.excalidraw .PasteChartDialog .ChartPreview svg{max-height:120px;max-width:186px}.excalidraw .PasteChartDialog .ChartPreview:hover{padding:0;border:2px solid #339af0}",""]),t.default=o},9935:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".excalidraw .popover{position:absolute;z-index:10}",""]),t.default=o},532:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".ProjectName{margin:auto;display:flex;align-items:center}.ProjectName .TextInput{height:calc(1rem - 3px);width:200px;overflow:hidden;text-align:center;margin-left:8px;text-overflow:ellipsis}.ProjectName .TextInput--readonly{background:none;border:none;width:auto;max-width:200px;padding-left:2px}.ProjectName .TextInput--readonly:hover{background:none}",""]),t.default=o},5892:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".excalidraw .Spinner{display:flex;align-items:center;justify-content:center;height:100%;margin-left:auto;margin-right:auto;--spinner-color: var(--icon-fill-color)}.excalidraw .Spinner svg{-webkit-animation:rotate 1.6s linear infinite;animation:rotate 1.6s linear infinite;-webkit-transform-origin:center center;transform-origin:center center}.excalidraw .Spinner circle{stroke:var(--spinner-color);-webkit-animation:dash 1.6s linear 0s infinite;animation:dash 1.6s linear 0s infinite;stroke-linecap:round}@-webkit-keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes dash{0%{stroke-dasharray:1,300;stroke-dashoffset:0}50%{stroke-dasharray:150,300;stroke-dashoffset:-200}100%{stroke-dasharray:1,300;stroke-dashoffset:-280}}@keyframes dash{0%{stroke-dasharray:1,300;stroke-dashoffset:0}50%{stroke-dasharray:150,300;stroke-dashoffset:-200}100%{stroke-dasharray:1,300;stroke-dashoffset:-280}}",""]),t.default=o},3874:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".excalidraw .Stack{--gap: 0;display:grid;gap:calc(var(--space-factor) * var(--gap))}.excalidraw .Stack_vertical{grid-template-columns:auto;grid-auto-flow:row;grid-auto-rows:-webkit-min-content;grid-auto-rows:min-content}.excalidraw .Stack_horizontal{grid-template-rows:auto;grid-auto-flow:column;grid-auto-columns:-webkit-min-content;grid-auto-columns:min-content}",""]),t.default=o},2681:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Stats{position:absolute;top:64px;right:12px;font-size:12px;z-index:10}.excalidraw .Stats h3{margin:0 24px 8px 0;white-space:nowrap}.excalidraw .Stats .close{float:right;height:16px;width:16px;cursor:pointer}.excalidraw .Stats .close svg{width:100%;height:100%}.excalidraw .Stats table{width:100%}.excalidraw .Stats table th{border-bottom:1px solid var(--input-border-color);padding:4px}.excalidraw .Stats table tr td:nth-child(2){min-width:24px;text-align:right}:root[dir=rtl] .excalidraw .Stats{left:12px;right:initial}:root[dir=rtl] .excalidraw .Stats h3{margin:0 0 8px 24px}:root[dir=rtl] .excalidraw .Stats .close{float:left}",""]),t.default=o},6759:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .TextInput{color:var(--text-primary-color);display:inline-block;border:1.5px solid var(--button-gray-1);line-height:1;padding:.75rem;white-space:nowrap;border-radius:var(--space-factor);background-color:var(--input-bg-color)}.excalidraw .TextInput:not(:focus):hover{background-color:var(--input-hover-bg-color)}.excalidraw .TextInput:focus{outline:none;box-shadow:0 0 0 2px var(--focus-highlight-color)}",""]),t.default=o},9650:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Toast{-webkit-animation:fade-in .5s;animation:fade-in .5s;background-color:var(--button-gray-1);border-radius:4px;bottom:10px;box-sizing:border-box;cursor:default;left:50%;margin-left:-150px;padding:4px 0;position:absolute;text-align:center;width:300px;z-index:999999}.excalidraw .Toast__message{color:var(--popup-text-color);white-space:pre-wrap}@-webkit-keyframes fade-in{from{opacity:0}to{opacity:1}}@keyframes fade-in{from{opacity:0}to{opacity:1}}",""]),t.default=o},2044:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .ToolIcon{display:inline-flex;align-items:center;position:relative;font-family:Cascadia;cursor:pointer;-webkit-tap-highlight-color:transparent;border-radius:var(--space-factor);-webkit-user-select:none;user-select:none;background-color:var(--button-gray-1)}.excalidraw .ToolIcon:hover{background-color:var(--button-gray-2)}.excalidraw .ToolIcon:active{background-color:var(--button-gray-3)}.excalidraw .ToolIcon--plain{background-color:transparent}.excalidraw .ToolIcon--plain .ToolIcon__icon{width:2rem;height:2rem}.excalidraw .ToolIcon__icon{width:2.5rem;height:2.5rem;color:var(--icon-fill-color);display:flex;justify-content:center;align-items:center;border-radius:var(--space-factor)}.excalidraw .ToolIcon__icon svg{position:relative;height:1em;fill:var(--icon-fill-color);color:var(--icon-fill-color)}.excalidraw .ToolIcon__icon+.ToolIcon__label{-webkit-margin-start:0;margin-inline-start:0}.excalidraw .ToolIcon__label{display:flex;align-items:center;color:var(--icon-fill-color);font-family:var(--ui-font);margin:0 .8em;text-overflow:ellipsis}.excalidraw .ToolIcon__label .Spinner{margin-left:.6em}.excalidraw .ToolIcon_size_small .ToolIcon__icon{width:2rem;height:2rem;font-size:.8em}.excalidraw .excalidraw .ToolIcon_type_button,.excalidraw .Modal .ToolIcon_type_button,.excalidraw .ToolIcon_type_button{padding:0;border:none;margin:0;font-size:inherit}.excalidraw .excalidraw .ToolIcon_type_button:focus,.excalidraw .Modal .ToolIcon_type_button:focus,.excalidraw .ToolIcon_type_button:focus{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .excalidraw .ToolIcon_type_button.ToolIcon--selected,.excalidraw .Modal .ToolIcon_type_button.ToolIcon--selected,.excalidraw .ToolIcon_type_button.ToolIcon--selected{background-color:var(--button-gray-2)}.excalidraw .excalidraw .ToolIcon_type_button.ToolIcon--selected:active,.excalidraw .Modal .ToolIcon_type_button.ToolIcon--selected:active,.excalidraw .ToolIcon_type_button.ToolIcon--selected:active{background-color:var(--button-gray-3)}.excalidraw .excalidraw .ToolIcon_type_button:hover,.excalidraw .Modal .ToolIcon_type_button:hover,.excalidraw .ToolIcon_type_button:hover{background-color:var(--button-gray-2)}.excalidraw .excalidraw .ToolIcon_type_button:active,.excalidraw .Modal .ToolIcon_type_button:active,.excalidraw .ToolIcon_type_button:active{background-color:var(--button-gray-3)}.excalidraw .excalidraw .ToolIcon_type_button--show,.excalidraw .Modal .ToolIcon_type_button--show,.excalidraw .ToolIcon_type_button--show{visibility:visible}.excalidraw .excalidraw .ToolIcon_type_button--hide,.excalidraw .Modal .ToolIcon_type_button--hide,.excalidraw .ToolIcon_type_button--hide{visibility:hidden}.excalidraw .ToolIcon_type_radio,.excalidraw .ToolIcon_type_checkbox{position:absolute;opacity:0;pointer-events:none}.excalidraw .ToolIcon_type_radio:not(.ToolIcon_toggle_opaque):checked+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox:not(.ToolIcon_toggle_opaque):checked+.ToolIcon__icon{background-color:var(--button-gray-2)}.excalidraw .ToolIcon_type_radio:not(.ToolIcon_toggle_opaque):checked+.ToolIcon__icon:active,.excalidraw .ToolIcon_type_checkbox:not(.ToolIcon_toggle_opaque):checked+.ToolIcon__icon:active{background-color:var(--button-gray-3)}.excalidraw .ToolIcon_type_radio:focus+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox:focus+.ToolIcon__icon{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .ToolIcon_type_radio:active+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox:active+.ToolIcon__icon{background-color:var(--button-gray-3)}.excalidraw .ToolIcon_type_floating{background-color:transparent}.excalidraw .ToolIcon_type_floating:hover{background-color:transparent}.excalidraw .ToolIcon_type_floating:active{background-color:transparent}.excalidraw .ToolIcon_type_floating:focus{box-shadow:none}.excalidraw .ToolIcon_type_floating .ToolIcon__icon{background-color:var(--button-gray-1);width:2rem;height:2em}.excalidraw .ToolIcon_type_floating .ToolIcon__icon:hover{background-color:var(--button-gray-2)}.excalidraw .ToolIcon_type_floating .ToolIcon__icon:active{background-color:var(--button-gray-3)}.excalidraw .ToolIcon.ToolIcon__lock{-webkit-margin-end:var(--space-factor);margin-inline-end:var(--space-factor)}.excalidraw .ToolIcon.ToolIcon__lock.ToolIcon_type_floating{margin-left:.1rem}.excalidraw .ToolIcon__keybinding{position:absolute;bottom:2px;right:3px;font-size:.5em;color:var(--keybinding-color);font-family:var(--ui-font);-webkit-user-select:none;user-select:none}@media(max-width: 425px){.excalidraw .Shape .ToolIcon__icon{width:2rem;height:2rem}.excalidraw .Shape .ToolIcon__icon svg{height:.8em}}@media(max-width: 760px){.excalidraw .ToolIcon.ToolIcon_type_floating{display:inline-block;position:absolute;right:calc(-2 * var(--space-factor));margin-left:0;border-radius:20px 0 0 20px;z-index:1;background-color:var(--button-gray-1)}.excalidraw .ToolIcon.ToolIcon_type_floating:hover{background-color:var(--button-gray-1)}.excalidraw .ToolIcon.ToolIcon_type_floating:active{background-color:var(--button-gray-2)}.excalidraw .ToolIcon.ToolIcon_type_floating .ToolIcon__icon{border-radius:inherit}.excalidraw .ToolIcon.ToolIcon_type_floating svg{position:static}.excalidraw .ToolIcon.ToolIcon__library{top:100px}.excalidraw .ToolIcon.ToolIcon__lock{-webkit-margin-end:0;margin-inline-end:0;top:60px}}:root[dir=ltr] .excalidraw .unlocked-icon{left:2px}:root[dir=rtl] .excalidraw .unlocked-icon{right:2px}",""]),t.default=o},6626:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw-tooltip{position:absolute;z-index:1000;padding:8px;border-radius:6px;box-sizing:border-box;pointer-events:none;word-wrap:break-word;background:#000;line-height:1.5;text-align:center;font-size:13px;font-weight:500;color:#fff;display:none}.excalidraw-tooltip.excalidraw-tooltip--visible{display:block}.excalidraw-tooltip-wrapper{display:flex;height:100%}.excalidraw-tooltip-icon{width:.9em;height:.9em;margin-left:5px;margin-top:1px;display:flex}.excalidraw--mobile.excalidraw-tooltip-icon{display:none}",""]),t.default=o},6359:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".excalidraw .UserList{pointer-events:none;padding:var(--space-factor);display:flex;justify-content:flex-end;overflow:hidden;border-radius:60px}.excalidraw .UserList.layout-vertical{grid-column:3;flex-direction:column-reverse;position:absolute;top:60px;right:var(--space-factor);max-height:calc( 100vh - var(--space-factor) - 60px - 60px + var(--itemOffset) );padding-bottom:max(calc(var(--itemOffset) * -1), 0px)}.excalidraw .UserList.layout-vertical .Avatar{width:2.4rem;height:2.4rem}.excalidraw .UserList>*{pointer-events:all}.excalidraw .UserList.layout-vertical>*{margin-bottom:var(--itemOffset)}.excalidraw .UserList.layout-horizontal>*{margin-right:var(--itemOffset)}.excalidraw .UserList_mobile{padding:0;justify-content:normal}.excalidraw .UserList_mobile>*{margin:0 var(--space-factor) var(--space-factor) 0}",""]),t.default=o},9915:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,".visually-hidden{position:absolute !important;height:1px;width:1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);white-space:nowrap;-webkit-user-select:none;user-select:none}.LoadingMessage{position:absolute;top:0;right:0;bottom:0;left:0;z-index:999;display:flex;align-items:center;justify-content:center;pointer-events:none}.LoadingMessage span{background-color:var(--button-gray-1);border-radius:5px;padding:.8em 1.2em;color:var(--popup-text-color);font-size:1.3em}",""]),t.default=o},9310:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,':export{themeFilter:invert(93%) hue-rotate(180deg)}:export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw{--theme-filter: none;--button-destructive-bg-color: #ffe3e3;--button-destructive-color: #c92a2a;--button-gray-1: #e9ecef;--button-gray-2: #ced4da;--button-gray-3: #adb5bd;--button-special-active-bg-color: #ebfbee;--dialog-border-color: #868e96;--dropdown-icon: url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="292.4" height="292.4" viewBox="0 0 292 292"><path d="M287 197L159 69c-4-3-8-5-13-5s-9 2-13 5L5 197c-3 4-5 8-5 13s2 9 5 13c4 4 8 5 13 5h256c5 0 9-1 13-5s5-8 5-13-1-9-5-13z"/></svg>\');--focus-highlight-color: #a5d8ff;--icon-fill-color: #000000;--icon-green-fill-color: #2b8a3e;--default-bg-color: #ffffff;--input-bg-color: #ffffff;--input-border-color: #dee2e6;--input-hover-bg-color: #f1f3f5;--input-label-color: #495057;--island-bg-color: rgba(255, 255, 255, 0.96);--keybinding-color: #adb5bd;--link-color: #1c7ed6;--overlay-bg-color: rgba(255, 255, 255, 0.88);--popup-bg-color: #ffffff;--popup-secondary-bg-color: #f1f3f5;--popup-text-color: #000000;--popup-text-inverted-color: #ffffff;--sab: env(safe-area-inset-bottom);--sal: env(safe-area-inset-left);--sar: env(safe-area-inset-right);--sat: env(safe-area-inset-top);--select-highlight-color: #339af0;--shadow-island: 0 1px 5px rgba(0, 0, 0, 0.15);--space-factor: 0.25rem;--text-primary-color: #343a40}.excalidraw.theme--dark{background:#000}.excalidraw.theme--dark.theme--dark-background-none{background:none}.excalidraw.theme--dark{--theme-filter: invert(93%) hue-rotate(180deg);--button-destructive-bg-color: #5a0000;--button-destructive-color: #ffa8a8;--button-gray-1: #363636;--button-gray-2: #272727;--button-gray-3: #222;--button-special-active-bg-color: #204624;--dialog-border-color: #212529;--dropdown-icon: url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="292.4" height="292.4" viewBox="0 0 292 292"><path fill="%23ced4da" d="M287 197L159 69c-4-3-8-5-13-5s-9 2-13 5L5 197c-3 4-5 8-5 13s2 9 5 13c4 4 8 5 13 5h256c5 0 9-1 13-5s5-8 5-13-1-9-5-13z"/></svg>\');--focus-highlight-color: #228be6;--icon-fill-color: #ced4da;--icon-green-fill-color: #69db7c;--default-bg-color: #121212;--input-bg-color: #121212;--input-border-color: #2e2e2e;--input-hover-bg-color: #181818;--input-label-color: #e9ecef;--island-bg-color: rgba(30, 30, 30, 0.98);--keybinding-color: #868e96;--overlay-bg-color: rgba(52, 58, 64, 0.12);--popup-bg-color: #2c2c2c;--popup-secondary-bg-color: #222;--popup-text-color: #ced4da;--popup-text-inverted-color: #635c5c;--select-highlight-color: #4dabf7;--shadow-island: 0 1px 5px rgba(0, 0, 0, 0.3);--text-primary-color: #ced4da}:root{--zIndex-canvas: 1;--zIndex-wysiwyg: 2;--zIndex-layerUI: 3}.excalidraw{position:relative;overflow:hidden;color:var(--text-primary-color);display:flex;top:0;bottom:0;left:0;right:0;height:100%;width:100%;-webkit-user-select:none;user-select:none}.excalidraw:focus{outline:none}.excalidraw a{font-weight:500;text-decoration:none;color:var(--link-color)}.excalidraw a:hover{text-decoration:underline}.excalidraw canvas{touch-action:none;image-rendering:pixelated;image-rendering:-moz-crisp-edges;z-index:var(--zIndex-canvas)}.excalidraw__canvas{position:absolute}.excalidraw.theme--dark canvas{-webkit-filter:var(--theme-filter);filter:var(--theme-filter)}.excalidraw .FixedSideContainer{padding-top:var(--sat, 0);padding-right:var(--sar, 0);padding-bottom:var(--sab, 0);padding-left:var(--sal, 0)}.excalidraw .panelRow{display:flex;justify-content:space-between}.excalidraw .panelColumn{display:flex;flex-direction:column}.excalidraw .panelColumn h3,.excalidraw .panelColumn legend,.excalidraw .panelColumn .control-label{margin-top:.333rem;margin-bottom:.333rem;font-size:.75rem;color:var(--text-primary-color);font-weight:bold;display:block}.excalidraw .panelColumn .control-label input{display:block;width:100%}.excalidraw .panelColumn h3:first-child,.excalidraw .panelColumn legend:first-child,.excalidraw .panelColumn .control-label:first-child{margin-top:0}.excalidraw .panelColumn legend{padding:0}.excalidraw .panelColumn .iconSelectList{flex-wrap:wrap;position:relative}.excalidraw .panelColumn .buttonList{flex-wrap:wrap}.excalidraw .panelColumn .buttonList label{margin-right:.25rem;font-size:.75rem;display:inline-block}.excalidraw .panelColumn .buttonList input[type=radio],.excalidraw .panelColumn .buttonList input[type=button]{opacity:0;position:absolute;pointer-events:none}.excalidraw .panelColumn .buttonList .iconRow{margin-top:8px}.excalidraw .panelColumn .buttonList .ToolIcon{margin:0;-webkit-margin-end:8px;margin-inline-end:8px}.excalidraw .panelColumn .buttonList .ToolIcon:focus{outline:transparent;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .panelColumn .buttonList .ToolIcon:hover{background-color:var(--button-gray-2)}.excalidraw .panelColumn .buttonList .ToolIcon:active{background-color:var(--button-gray-3)}.excalidraw .panelColumn .buttonList .ToolIcon:disabled{cursor:not-allowed}.excalidraw .panelColumn .buttonList .ToolIcon__icon{width:28px;height:28px}.excalidraw .panelColumn fieldset{margin:0;margin-top:.333rem;padding:0;border:none}.excalidraw .divider{width:1px;background-color:#e9ecef;margin:1px}.excalidraw .buttonList label:focus-within,.excalidraw input:focus{outline:transparent;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw button,.excalidraw .buttonList label{-webkit-user-select:none;user-select:none;background-color:var(--button-gray-1);border:0;border-radius:4px;margin:.125rem 0;padding:.25rem;white-space:nowrap;cursor:pointer}.excalidraw button:focus,.excalidraw .buttonList label:focus{outline:transparent;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw button:hover,.excalidraw .buttonList label:hover{background-color:var(--button-gray-2)}.excalidraw button:active,.excalidraw .buttonList label:active{background-color:var(--button-gray-3)}.excalidraw button:disabled,.excalidraw .buttonList label:disabled{cursor:not-allowed}.excalidraw .active,.excalidraw .buttonList label.active{background-color:var(--button-gray-2)}.excalidraw .active:hover,.excalidraw .buttonList label.active:hover{background-color:var(--button-gray-2)}.excalidraw .active:active,.excalidraw .buttonList label.active:active{background-color:var(--button-gray-3)}.excalidraw .buttonList.buttonListIcon label{display:inline-flex;justify-content:center;align-items:center}.excalidraw .buttonList.buttonListIcon label svg{width:36px;height:14px;padding:2px;opacity:.6}.excalidraw .buttonList.buttonListIcon label.active svg{opacity:1}.excalidraw .App-top-bar{z-index:var(--zIndex-layerUI);display:flex;flex-direction:column;align-items:center}.excalidraw .App-bottom-bar{position:absolute;top:0;bottom:0;left:0;right:0;--bar-padding: calc(4 * var(--space-factor));padding-top:max(var(--bar-padding), var(--sat,0));padding-right:var(--sar, 0);padding-bottom:var(--sab, 0);padding-left:var(--sal, 0);z-index:4;display:flex;align-items:flex-end;pointer-events:none}.excalidraw .App-bottom-bar>.Island{width:100%;max-width:100%;min-width:100%;box-sizing:border-box;max-height:100%;display:flex;flex-direction:column;pointer-events:initial}.excalidraw .App-bottom-bar>.Island .panelColumn{padding:8px 8px 0 8px}.excalidraw .App-toolbar{width:100%;box-sizing:border-box}.excalidraw .App-toolbar-content{display:flex;align-items:center;justify-content:space-between;padding:8px}.excalidraw .App-mobile-menu{width:100%;overflow-x:visible;overflow-y:auto;box-sizing:border-box;margin-bottom:var(--bar-padding)}.excalidraw .App-menu{display:grid;color:var(--icon-fill-color)}.excalidraw .App-menu_top{grid-template-columns:1fr auto 1fr;grid-gap:4px;align-items:flex-start;cursor:default;pointer-events:none !important}.excalidraw .layer-ui__wrapper:not(.disable-pointerEvents) .App-menu_top>*{pointer-events:all}.excalidraw .App-menu_top>*:first-child{justify-self:flex-start}.excalidraw .App-menu_top>*:last-child{justify-self:flex-end}.excalidraw .App-menu_bottom{position:absolute;bottom:0;grid-template-columns:-webkit-min-content auto -webkit-min-content;grid-template-columns:min-content auto min-content;grid-gap:15px;align-items:flex-start;cursor:default;pointer-events:none !important;z-index:100}:root[dir=ltr] .excalidraw .App-menu_bottom{left:.25rem}:root[dir=rtl] .excalidraw .App-menu_bottom{right:.25rem}.excalidraw .App-menu_bottom--transition-left section{width:185px}.excalidraw .App-menu_bottom section{display:flex}.excalidraw .App-menu_bottom>*:first-child{justify-self:flex-start}.excalidraw .App-menu_bottom>*:last-child{justify-self:flex-end}.excalidraw .App-menu_left{grid-template-rows:1fr auto 1fr;height:100%}.excalidraw .App-menu_right{grid-template-rows:1fr;height:100%}.excalidraw .App-menu__left{overflow-y:auto}.excalidraw .dropdown-select{height:1.5rem;padding:0;-webkit-padding-start:.5rem;padding-inline-start:.5rem;-webkit-padding-end:1.5rem;padding-inline-end:1.5rem;color:var(--icon-fill-color);background-color:var(--button-gray-1);border-radius:var(--space-factor);border:1px solid var(--button-gray-2);font-size:.8rem;outline:none;-webkit-appearance:none;appearance:none;background-image:var(--dropdown-icon);background-repeat:no-repeat;background-position:right .7rem top 50%,0 0;background-size:.65em auto,100%}:root[dir=rtl] .excalidraw .dropdown-select{background-position:left .7rem top 50%,0 0}.excalidraw .dropdown-select:focus{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .dropdown-select:hover{background-color:var(--button-gray-2)}.excalidraw .dropdown-select:active{background-color:var(--button-gray-2)}.excalidraw .zIndexButton{margin:0;-webkit-margin-end:8px;margin-inline-end:8px;padding:5px;display:inline-flex;align-items:center;justify-content:center}.excalidraw .zIndexButton svg{width:18px;height:18px}.excalidraw .scroll-back-to-content{color:var(--popup-text-color);position:absolute;left:50%;bottom:30px;-webkit-transform:translateX(-50%);transform:translateX(-50%);padding:10px 20px}.excalidraw .help-icon{display:flex;cursor:pointer;fill:#868e96;padding:0;margin:0;background:none;color:var(--icon-fill-color)}.excalidraw .help-icon svg{width:1.5rem;height:1.5rem}.excalidraw .help-icon:hover{background:none}.excalidraw .reset-zoom-button{padding:.2em;background:transparent;color:var(--text-primary-color);font-family:var(--ui-font)}.excalidraw .undo-redo-buttons{display:grid;grid-auto-flow:column;gap:.4em;margin-top:auto;margin-bottom:auto;-webkit-margin-start:.6em;margin-inline-start:.6em}.excalidraw--mobile.excalidraw aside{display:none}.excalidraw--mobile.excalidraw .scroll-back-to-content{bottom:calc(80px + var(--sab, 0));z-index:-1}:root[dir=rtl] .excalidraw .rtl-mirror{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.excalidraw .zen-mode-visibility{visibility:visible;opacity:1;height:auto;width:auto;transition:opacity .5s}.excalidraw .zen-mode-visibility.zen-mode-visibility--hidden{visibility:hidden;opacity:0;height:0;width:0;transition:opacity .5s}.excalidraw .disable-pointerEvents{pointer-events:none !important}.excalidraw.excalidraw--view-mode .App-menu{display:flex;justify-content:space-between}@media print{.excalidraw .App-bottom-bar,.excalidraw .FixedSideContainer,.excalidraw .layer-ui__wrapper{display:none}}.excalidraw .HomeButton.ToolIcon.ToolIcon_type_floating{display:inline-block;position:absolute;top:60px;left:calc(-2 * var(--space-factor));border-radius:0 20px 20px 0;background-color:var(--button-gray-1)}.excalidraw .HomeButton.ToolIcon.ToolIcon_type_floating:hover{background-color:var(--button-gray-1)}.excalidraw .HomeButton.ToolIcon.ToolIcon_type_floating:active{background-color:var(--button-gray-2)}.excalidraw .HomeButton.ToolIcon.ToolIcon_type_floating .ToolIcon__icon{border-radius:inherit}.excalidraw .HomeButton.ToolIcon.ToolIcon_type_floating svg{position:static}.ErrorSplash.excalidraw{min-height:100vh;padding:20px 0;overflow:auto;display:flex;align-items:center;justify-content:center;-webkit-user-select:text;user-select:text}.ErrorSplash.excalidraw .ErrorSplash-messageContainer{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px;background-color:#ffe3e3;border:3px solid #c92a2a}.ErrorSplash.excalidraw .ErrorSplash-paragraph{margin:15px 0;max-width:600px}.ErrorSplash.excalidraw .ErrorSplash-paragraph.align-center{text-align:center}.ErrorSplash.excalidraw .bigger,.ErrorSplash.excalidraw .bigger button{font-size:1.1em}.ErrorSplash.excalidraw .smaller,.ErrorSplash.excalidraw .smaller button{font-size:.9em}.ErrorSplash.excalidraw .ErrorSplash-details{display:flex;flex-direction:column;align-items:flex-start}.ErrorSplash.excalidraw .ErrorSplash-details textarea{width:100%;margin:10px 0;font-family:"Cascadia";font-size:.8em}',""]),t.default=o},6464:function(e,t,n){"use strict";n.r(t);var r=n(3645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,"",""]),o.locals={themeFilter:"invert(93%) hue-rotate(180deg)"},t.default=o},3645:function(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var a=0;a<this.length;a++){var i=this[a][0];null!=i&&(o[i]=!0)}for(var l=0;l<e.length;l++){var s=[].concat(e[l]);r&&o[s[0]]||(n&&(s[2]?s[2]="".concat(n," and ").concat(s[2]):s[2]=n),t.push(s))}},t}},1667:function(e){"use strict";e.exports=function(e,t){return t||(t={}),"string"!=typeof(e=e&&e.__esModule?e.default:e)?e:(/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e)}},9638:function(e,t,n){"use strict";t.Z=n.p+"excalidraw-assets/Cascadia.woff2"},7464:function(e,t,n){"use strict";t.Z=n.p+"excalidraw-assets/Virgil.woff2"},8288:function(e,t,n){"use strict";n.d(t,{iC:function(){return i},f:function(){return l},qx:function(){return s},Iw:function(){return c},$e:function(){return u},wZ:function(){return d},ay:function(){return p},oc:function(){return f},Oh:function(){return h},Ks:function(){return r},Vi:function(){return m},$C:function(){return g},ut:function(){return v},C6:function(){return b},_D:function(){return y},n5:function(){return x},rk:function(){return w},Hg:function(){return k},hs:function(){return S},k:function(){return E},LO:function(){return C},r8:function(){return j},pb:function(){return O},LL:function(){return M},Gj:function(){return I},nM:function(){return P},Lg:function(){return T},HM:function(){return A},V4:function(){return L},EH:function(){return _},ZF:function(){return D},UO:function(){return z},ah:function(){return H},cW:function(){return B},kV:function(){return N},sS:function(){return R},Yx:function(){return F},zK:function(){return V},ZB:function(){return U},qy:function(){return G},h6:function(){return W},jo:function(){return K},$n:function(){return Z},hR:function(){return Y}});var r,o=n(8635),a=n.n(o),i="Excalidraw",l=10,s=8,c=5,u=1,d=30,p=Math.PI/12,f={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},h={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1};!function(e){e.COPY="copy",e.PASTE="paste",e.CUT="cut",e.KEYDOWN="keydown",e.KEYUP="keyup",e.MOUSE_MOVE="mousemove",e.RESIZE="resize",e.UNLOAD="unload",e.FOCUS="focus",e.BLUR="blur",e.DRAG_OVER="dragover",e.DROP="drop",e.GESTURE_END="gestureend",e.BEFORE_UNLOAD="beforeunload",e.GESTURE_START="gesturestart",e.GESTURE_CHANGE="gesturechange",e.POINTER_MOVE="pointermove",e.POINTER_UP="pointerup",e.STATE_CHANGE="statechange",e.WHEEL="wheel",e.TOUCH_START="touchstart",e.TOUCH_END="touchend",e.HASHCHANGE="hashchange",e.VISIBILITY_CHANGE="visibilitychange",e.SCROLL="scroll"}(r||(r={}));var m={TEST:"test",DEVELOPMENT:"development"},g={SHAPE_ACTIONS_MENU:"App-menu__left"},v={Virgil:1,Helvetica:2,Cascadia:3},b={LIGHT:"light",DARK:"dark"},y="Segoe UI Emoji",x=20,w=v.Virgil,k="left",S="top",E=20,C={excalidraw:"application/vnd.excalidraw+json",excalidrawlib:"application/vnd.excalidrawlib+json",json:"application/json",svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",gif:"image/gif",binary:"application/octet-stream"},j={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawLibrary:"excalidrawlib"},O=window.location.origin,M=500,I=300,P=500,T=5e3,A=100,L=.1,_={VIEW:"viewMode",ZEN:"zenMode",GRID:"gridMode"},D=a().themeFilter,z={addLibrary:"addLibrary"},H={addLibrary:"addLibrary"},B={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,theme:!0,saveAsImage:!0}},N=800,R=1e3,F=500,V=2,U=[1,2,3],G=10,W=1440,K=[C.png,C.jpg,C.svg,C.gif],Z=2097152,Y="http://www.w3.org/2000/svg"},9065:function(e,t,n){"use strict";n.r(t),n.d(t,{FONT_FAMILY:function(){return d.ut},THEME:function(){return d.C6},bumpVersion:function(){return ho},cleanAppStateForExport:function(){return pr},clearAppStateForLocalStorage:function(){return dr},default:function(){return dm},defaultLang:function(){return w},exportToBlob:function(){return em},exportToCanvas:function(){return Jh},exportToClipboard:function(){return nm},exportToSvg:function(){return tm},getDefaultAppState:function(){return sr},getElementMap:function(){return el},getFreeDrawSvgPath:function(){return eo},getNonDeletedElements:function(){return nl},getSceneVersion:function(){return tl},isInvisiblySmallElement:function(){return mo},isLinearElement:function(){return tt},languages:function(){return k},loadFromBlob:function(){return Fu},loadLibraryFromBlob:function(){return Vu},mutateElement:function(){return po},newElementWith:function(){return fo},restore:function(){return _u},restoreAppState:function(){return Lu},restoreElements:function(){return Au},serializeAsJSON:function(){return Qu}});var r=n(6479),o=n.n(r),a=n(8),i=n.n(a),l=n(9713),s=n.n(l),c=n(4698),u=n.n(c),d=n(8288),p=JSON.parse('{"u2":"@dwelle/excalidraw","i8":"0.3.16"}');"production"!==d.Vi.TEST&&(n.p=window.EXCALIDRAW_ASSET_PATH||"https://unpkg.com/".concat(p.u2,"@").concat(p.i8,"/dist/"));var f=n(8950);function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function m(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,o=!1,a=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw a}}return n}}(e,t)||m(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var v=n(7945),b=n.n(v),y=n(1463),x=JSON.parse('{"ar-SA":96,"bg-BG":66,"bn-BD":0,"ca-ES":89,"cs-CZ":28,"da-DK":19,"de-DE":100,"el-GR":71,"en":100,"es-ES":96,"fa-IR":74,"fi-FI":99,"fr-FR":100,"he-IL":96,"hi-IN":65,"hu-HU":58,"id-ID":100,"it-IT":99,"ja-JP":100,"kab-KAB":93,"kk-KZ":26,"ko-KR":65,"lv-LV":13,"my-MM":54,"nb-NO":100,"nl-NL":97,"nn-NO":71,"oc-FR":100,"pa-IN":96,"pl-PL":67,"pt-BR":100,"pt-PT":100,"ro-RO":100,"ru-RU":96,"si-LK":4,"sk-SK":99,"sv-SE":99,"ta-IN":91,"tr-TR":75,"uk-UA":80,"zh-CN":98,"zh-HK":33,"zh-TW":100}'),w={code:"en",label:"English"},k=[{code:"ar-SA",label:"العربية",rtl:!0},{code:"bg-BG",label:"Български"},{code:"ca-ES",label:"Català"},{code:"de-DE",label:"Deutsch"},{code:"el-GR",label:"Ελληνικά"},{code:"es-ES",label:"Español"},{code:"fa-IR",label:"فارسی",rtl:!0},{code:"fi-FI",label:"Suomi"},{code:"fr-FR",label:"Français"},{code:"he-IL",label:"עברית",rtl:!0},{code:"hi-IN",label:"हिन्दी"},{code:"hu-HU",label:"Magyar"},{code:"id-ID",label:"Bahasa Indonesia"},{code:"it-IT",label:"Italiano"},{code:"ja-JP",label:"日本語"},{code:"kab-KAB",label:"Taqbaylit"},{code:"ko-KR",label:"한국어"},{code:"my-MM",label:"Burmese"},{code:"nb-NO",label:"Norsk bokmål"},{code:"nl-NL",label:"Nederlands"},{code:"nn-NO",label:"Norsk nynorsk"},{code:"oc-FR",label:"Occitan"},{code:"pa-IN",label:"ਪੰਜਾਬੀ"},{code:"pl-PL",label:"Polski"},{code:"pt-BR",label:"Português Brasileiro"},{code:"pt-PT",label:"Português"},{code:"ro-RO",label:"Română"},{code:"ru-RU",label:"Русский"},{code:"sk-SK",label:"Slovenčina"},{code:"sv-SE",label:"Svenska"},{code:"tr-TR",label:"Türkçe"},{code:"uk-UA",label:"Українська"},{code:"zh-CN",label:"简体中文"},{code:"zh-TW",label:"繁體中文"},{code:"lv-LV",label:"Latviešu"},{code:"cs-CZ",label:"Česky"},{code:"kk-KZ",label:"Қазақ тілі"}].concat([w]).sort((function(e,t){return e.label>t.label?1:-1})).filter((function(e){return x[e.code]>=85})),S="__test__";"production"===d.Vi.DEVELOPMENT&&k.unshift({code:S,label:"test language"},{code:"".concat(S,".rtl"),label:"test language (rtl)",rtl:!0});var E=w,C={},j=function(){var e=(0,f.Z)(b().mark((function e(t){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(E=t,document.documentElement.dir=E.rtl?"rtl":"ltr",document.documentElement.lang=E.code,!t.code.startsWith(S)){e.next=7;break}C={},e.next=10;break;case 7:return e.next=9,Promise.resolve().then(n.t.bind(n,1463,19));case 9:C=e.sent;case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),O=function(){return E},M=function(e,t){for(var n=0;n<t.length;++n){var r=t[n];if(void 0===e[r])return;e=e[r]}if("string"==typeof e)return e},I=function(e,t){if(E.code.startsWith(S)){var n=t?"".concat(e,"(").concat(JSON.stringify(t).slice(1,-1),")"):e;return"[[".concat(n,"]]")}var r=e.split("."),o=M(C,r)||M(y,r);if(void 0===o)throw new Error("Can't find translation for ".concat(e));if(t)for(var a in t)o=o.replace("{{".concat(a,"}}"),t[a]);return o},P=n(4512),T=function(){return(0,P.jsx)("div",{className:"LoadingMessage",children:(0,P.jsx)("span",{children:I("labels.loadingScene")})})},A=function(e){var t=g((0,c.useState)(!0),2),n=t[0],r=t[1];return(0,c.useEffect)((function(){var t=function(){var e=(0,f.Z)(b().mark((function e(){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,j(n);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),n=k.find((function(t){return t.code===e.langCode}))||w;t(),r(!1)}),[e.langCode]),n?(0,P.jsx)(T,{}):e.children};function L(e){return(L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||m(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function D(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function H(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function B(e,t,n){return t&&H(e.prototype,t),n&&H(e,n),e}function N(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function R(e,t){return(R=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function F(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&R(e,t)}function V(e,t){return!t||"object"!==L(t)&&"function"!=typeof t?N(e):t}function U(e){return(U=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function G(e,t,n){if(e&&e.length){const[r,o]=t,a=Math.PI/180*n,i=Math.cos(a),l=Math.sin(a);e.forEach((e=>{const[t,n]=e;e[0]=(t-r)*i-(n-o)*l+r,e[1]=(t-r)*l+(n-o)*i+o}))}}function W(e){const t=e[0],n=e[1];return Math.sqrt(Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2))}function K(e,t,n,r){const o=t[1]-e[1],a=e[0]-t[0],i=o*e[0]+a*e[1],l=r[1]-n[1],s=n[0]-r[0],c=l*n[0]+s*n[1],u=o*s-l*a;return u?[(s*i-a*c)/u,(o*c-l*i)/u]:null}function Z(e,t,n){const r=e.length;if(r<3)return!1;const o=[Number.MAX_SAFE_INTEGER,n],a=[t,n];let i=0;for(let t=0;t<r;t++){const n=e[t],l=e[(t+1)%r];if(q(n,l,a,o)){if(0===X(n,a,l))return Y(n,a,l);i++}}return i%2==1}function Y(e,t,n){return t[0]<=Math.max(e[0],n[0])&&t[0]>=Math.min(e[0],n[0])&&t[1]<=Math.max(e[1],n[1])&&t[1]>=Math.min(e[1],n[1])}function X(e,t,n){const r=(t[1]-e[1])*(n[0]-t[0])-(t[0]-e[0])*(n[1]-t[1]);return 0===r?0:r>0?1:2}function q(e,t,n,r){const o=X(e,t,n),a=X(e,t,r),i=X(n,r,e),l=X(n,r,t);return o!==a&&i!==l||(!(0!==o||!Y(e,n,t))||(!(0!==a||!Y(e,r,t))||(!(0!==i||!Y(n,e,r))||!(0!==l||!Y(n,t,r)))))}function $(e,t){const n=[0,0],r=Math.round(t.hachureAngle+90);r&&G(e,n,r);const o=function(e,t){const n=[...e];n[0].join(",")!==n[n.length-1].join(",")&&n.push([n[0][0],n[0][1]]);const r=[];if(n&&n.length>2){let e=t.hachureGap;e<0&&(e=4*t.strokeWidth),e=Math.max(e,.1);const o=[];for(let e=0;e<n.length-1;e++){const t=n[e],r=n[e+1];if(t[1]!==r[1]){const e=Math.min(t[1],r[1]);o.push({ymin:e,ymax:Math.max(t[1],r[1]),x:e===t[1]?t[0]:r[0],islope:(r[0]-t[0])/(r[1]-t[1])})}}if(o.sort(((e,t)=>e.ymin<t.ymin?-1:e.ymin>t.ymin?1:e.x<t.x?-1:e.x>t.x?1:e.ymax===t.ymax?0:(e.ymax-t.ymax)/Math.abs(e.ymax-t.ymax))),!o.length)return r;let a=[],i=o[0].ymin;for(;a.length||o.length;){if(o.length){let e=-1;for(let t=0;t<o.length&&!(o[t].ymin>i);t++)e=t;o.splice(0,e+1).forEach((e=>{a.push({s:i,edge:e})}))}if(a=a.filter((e=>!(e.edge.ymax<=i))),a.sort(((e,t)=>e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x))),a.length>1)for(let e=0;e<a.length;e+=2){const t=e+1;if(t>=a.length)break;const n=a[e].edge,o=a[t].edge;r.push([[Math.round(n.x),i],[Math.round(o.x),i]])}i+=e,a.forEach((t=>{t.edge.x=t.edge.x+e*t.edge.islope}))}}return r}(e,t);return r&&(G(e,n,-r),function(e,t,n){const r=[];e.forEach((e=>r.push(...e))),G(r,t,n)}(o,n,-r)),o}class Q{constructor(e){this.helper=e}fillPolygon(e,t){return this._fillPolygon(e,t)}_fillPolygon(e,t,n=!1){let r=$(e,t);if(n){const t=this.connectingLines(e,r);r=r.concat(t)}return{type:"fillSketch",ops:this.renderLines(r,t)}}renderLines(e,t){const n=[];for(const r of e)n.push(...this.helper.doubleLineOps(r[0][0],r[0][1],r[1][0],r[1][1],t));return n}connectingLines(e,t){const n=[];if(t.length>1)for(let r=1;r<t.length;r++){const o=t[r-1];if(W(o)<3)continue;const a=[t[r][0],o[1]];if(W(a)>3){const t=this.splitOnIntersections(e,a);n.push(...t)}}return n}midPointInPolygon(e,t){return Z(e,(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2)}splitOnIntersections(e,t){const n=Math.max(5,.1*W(t)),r=[];for(let o=0;o<e.length;o++){const a=e[o],i=e[(o+1)%e.length];if(q(a,i,...t)){const e=K(a,i,t[0],t[1]);if(e){const o=W([e,t[0]]),a=W([e,t[1]]);o>n&&a>n&&r.push({point:e,distance:o})}}}if(r.length>1){const n=r.sort(((e,t)=>e.distance-t.distance)).map((e=>e.point));if(Z(e,...t[0])||n.shift(),Z(e,...t[1])||n.pop(),n.length<=1)return this.midPointInPolygon(e,t)?[t]:[];const o=[t[0],...n,t[1]],a=[];for(let t=0;t<o.length-1;t+=2){const n=[o[t],o[t+1]];this.midPointInPolygon(e,n)&&a.push(n)}return a}return this.midPointInPolygon(e,t)?[t]:[]}}class J extends Q{fillPolygon(e,t){return this._fillPolygon(e,t,!0)}}class ee extends Q{fillPolygon(e,t){const n=this._fillPolygon(e,t),r=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),o=this._fillPolygon(e,r);return n.ops=n.ops.concat(o.ops),n}}class te{constructor(e){this.helper=e}fillPolygon(e,t){const n=$(e,t=Object.assign({},t,{curveStepCount:4,hachureAngle:0,roughness:1}));return this.dotsOnLines(n,t)}dotsOnLines(e,t){const n=[];let r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);let o=t.fillWeight;o<0&&(o=t.strokeWidth/2);const a=r/4;for(const i of e){const e=W(i),l=e/r,s=Math.ceil(l)-1,c=e-s*r,u=(i[0][0]+i[1][0])/2-r/4,d=Math.min(i[0][1],i[1][1]);for(let e=0;e<s;e++){const i=d+c+e*r,l=this.helper.randOffsetWithRange(u-a,u+a,t),s=this.helper.randOffsetWithRange(i-a,i+a,t),p=this.helper.ellipse(l,s,o,o,t);n.push(...p.ops)}}return{type:"fillSketch",ops:n}}}class ne{constructor(e){this.helper=e}fillPolygon(e,t){const n=$(e,t);return{type:"fillSketch",ops:this.dashedLine(n,t)}}dashedLine(e,t){const n=t.dashOffset<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashOffset,r=t.dashGap<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashGap,o=[];return e.forEach((e=>{const a=W(e),i=Math.floor(a/(n+r)),l=(a+r-i*(n+r))/2;let s=e[0],c=e[1];s[0]>c[0]&&(s=e[1],c=e[0]);const u=Math.atan((c[1]-s[1])/(c[0]-s[0]));for(let e=0;e<i;e++){const a=e*(n+r),i=a+n,c=[s[0]+a*Math.cos(u)+l*Math.cos(u),s[1]+a*Math.sin(u)+l*Math.sin(u)],d=[s[0]+i*Math.cos(u)+l*Math.cos(u),s[1]+i*Math.sin(u)+l*Math.sin(u)];o.push(...this.helper.doubleLineOps(c[0],c[1],d[0],d[1],t))}})),o}}class re{constructor(e){this.helper=e}fillPolygon(e,t){const n=t.hachureGap<0?4*t.strokeWidth:t.hachureGap,r=t.zigzagOffset<0?n:t.zigzagOffset,o=$(e,t=Object.assign({},t,{hachureGap:n+r}));return{type:"fillSketch",ops:this.zigzagLines(o,r,t)}}zigzagLines(e,t,n){const r=[];return e.forEach((e=>{const o=W(e),a=Math.round(o/(2*t));let i=e[0],l=e[1];i[0]>l[0]&&(i=e[1],l=e[0]);const s=Math.atan((l[1]-i[1])/(l[0]-i[0]));for(let e=0;e<a;e++){const o=2*e*t,a=2*(e+1)*t,l=Math.sqrt(2*Math.pow(t,2)),c=[i[0]+o*Math.cos(s),i[1]+o*Math.sin(s)],u=[i[0]+a*Math.cos(s),i[1]+a*Math.sin(s)],d=[c[0]+l*Math.cos(s+Math.PI/4),c[1]+l*Math.sin(s+Math.PI/4)];r.push(...this.helper.doubleLineOps(c[0],c[1],d[0],d[1],n),...this.helper.doubleLineOps(d[0],d[1],u[0],u[1],n))}})),r}}const oe={};class ae{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const ie={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function le(e,t){return e.type===t}function se(e){const t=[],n=function(e){const t=new Array;for(;""!==e;)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:0,text:RegExp.$1},e=e.substr(RegExp.$1.length);else{if(!e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];t[t.length]={type:1,text:`${parseFloat(RegExp.$1)}`},e=e.substr(RegExp.$1.length)}return t[t.length]={type:2,text:""},t}(e);let r="BOD",o=0,a=n[o];for(;!le(a,2);){let i=0;const l=[];if("BOD"===r){if("M"!==a.text&&"m"!==a.text)return se("M0,0"+e);o++,i=ie[a.text],r=a.text}else le(a,1)?i=ie[r]:(o++,i=ie[a.text],r=a.text);if(!(o+i<n.length))throw new Error("Path data ended short");for(let e=o;e<o+i;e++){const t=n[e];if(!le(t,1))throw new Error("Param not a number: "+r+","+t.text);l[l.length]=+t.text}if("number"!=typeof ie[r])throw new Error("Bad segment: "+r);{const e={key:r,data:l};t.push(e),o+=i,a=n[o],"M"===r&&(r="L"),"m"===r&&(r="l")}}return t}function ce(e){let t=0,n=0,r=0,o=0;const a=[];for(const{key:i,data:l}of e)switch(i){case"M":a.push({key:"M",data:[...l]}),[t,n]=l,[r,o]=l;break;case"m":t+=l[0],n+=l[1],a.push({key:"M",data:[t,n]}),r=t,o=n;break;case"L":a.push({key:"L",data:[...l]}),[t,n]=l;break;case"l":t+=l[0],n+=l[1],a.push({key:"L",data:[t,n]});break;case"C":a.push({key:"C",data:[...l]}),t=l[4],n=l[5];break;case"c":{const e=l.map(((e,r)=>r%2?e+n:e+t));a.push({key:"C",data:e}),t=e[4],n=e[5];break}case"Q":a.push({key:"Q",data:[...l]}),t=l[2],n=l[3];break;case"q":{const e=l.map(((e,r)=>r%2?e+n:e+t));a.push({key:"Q",data:e}),t=e[2],n=e[3];break}case"A":a.push({key:"A",data:[...l]}),t=l[5],n=l[6];break;case"a":t+=l[5],n+=l[6],a.push({key:"A",data:[l[0],l[1],l[2],l[3],l[4],t,n]});break;case"H":a.push({key:"H",data:[...l]}),t=l[0];break;case"h":t+=l[0],a.push({key:"H",data:[t]});break;case"V":a.push({key:"V",data:[...l]}),n=l[0];break;case"v":n+=l[0],a.push({key:"V",data:[n]});break;case"S":a.push({key:"S",data:[...l]}),t=l[2],n=l[3];break;case"s":{const e=l.map(((e,r)=>r%2?e+n:e+t));a.push({key:"S",data:e}),t=e[2],n=e[3];break}case"T":a.push({key:"T",data:[...l]}),t=l[0],n=l[1];break;case"t":t+=l[0],n+=l[1],a.push({key:"T",data:[t,n]});break;case"Z":case"z":a.push({key:"Z",data:[]}),t=r,n=o}return a}function ue(e){const t=[];let n="",r=0,o=0,a=0,i=0,l=0,s=0;for(const{key:c,data:u}of e){switch(c){case"M":t.push({key:"M",data:[...u]}),[r,o]=u,[a,i]=u;break;case"C":t.push({key:"C",data:[...u]}),r=u[4],o=u[5],l=u[2],s=u[3];break;case"L":t.push({key:"L",data:[...u]}),[r,o]=u;break;case"H":r=u[0],t.push({key:"L",data:[r,o]});break;case"V":o=u[0],t.push({key:"L",data:[r,o]});break;case"S":{let e=0,a=0;"C"===n||"S"===n?(e=r+(r-l),a=o+(o-s)):(e=r,a=o),t.push({key:"C",data:[e,a,...u]}),l=u[0],s=u[1],r=u[2],o=u[3];break}case"T":{const[e,a]=u;let i=0,c=0;"Q"===n||"T"===n?(i=r+(r-l),c=o+(o-s)):(i=r,c=o);const d=r+2*(i-r)/3,p=o+2*(c-o)/3,f=e+2*(i-e)/3,h=a+2*(c-a)/3;t.push({key:"C",data:[d,p,f,h,e,a]}),l=i,s=c,r=e,o=a;break}case"Q":{const[e,n,a,i]=u,c=r+2*(e-r)/3,d=o+2*(n-o)/3,p=a+2*(e-a)/3,f=i+2*(n-i)/3;t.push({key:"C",data:[c,d,p,f,a,i]}),l=e,s=n,r=a,o=i;break}case"A":{const e=Math.abs(u[0]),n=Math.abs(u[1]),a=u[2],i=u[3],l=u[4],s=u[5],c=u[6];if(0===e||0===n)t.push({key:"C",data:[r,o,s,c,s,c]}),r=s,o=c;else if(r!==s||o!==c){pe(r,o,s,c,e,n,a,i,l).forEach((function(e){t.push({key:"C",data:e})})),r=s,o=c}break}case"Z":t.push({key:"Z",data:[]}),r=a,o=i}n=c}return t}function de(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function pe(e,t,n,r,o,a,i,l,s,c){const u=(d=i,Math.PI*d/180);var d;let p=[],f=0,h=0,m=0,g=0;if(c)[f,h,m,g]=c;else{[e,t]=de(e,t,-u),[n,r]=de(n,r,-u);const i=(e-n)/2,c=(t-r)/2;let d=i*i/(o*o)+c*c/(a*a);d>1&&(d=Math.sqrt(d),o*=d,a*=d);const p=o*o,v=a*a,b=p*v-p*c*c-v*i*i,y=p*c*c+v*i*i,x=(l===s?-1:1)*Math.sqrt(Math.abs(b/y));m=x*o*c/a+(e+n)/2,g=x*-a*i/o+(t+r)/2,f=Math.asin(parseFloat(((t-g)/a).toFixed(9))),h=Math.asin(parseFloat(((r-g)/a).toFixed(9))),e<m&&(f=Math.PI-f),n<m&&(h=Math.PI-h),f<0&&(f=2*Math.PI+f),h<0&&(h=2*Math.PI+h),s&&f>h&&(f-=2*Math.PI),!s&&h>f&&(h-=2*Math.PI)}let v=h-f;if(Math.abs(v)>120*Math.PI/180){const e=h,t=n,l=r;h=s&&h>f?f+120*Math.PI/180*1:f+120*Math.PI/180*-1,p=pe(n=m+o*Math.cos(h),r=g+a*Math.sin(h),t,l,o,a,i,0,s,[h,e,m,g])}v=h-f;const b=Math.cos(f),y=Math.sin(f),x=Math.cos(h),w=Math.sin(h),k=Math.tan(v/4),S=4/3*o*k,E=4/3*a*k,C=[e,t],j=[e+S*y,t-E*b],O=[n+S*w,r-E*x],M=[n,r];if(j[0]=2*C[0]-j[0],j[1]=2*C[1]-j[1],c)return[j,O,M].concat(p);{p=[j,O,M].concat(p);const e=[];for(let t=0;t<p.length;t+=3){const n=de(p[t][0],p[t][1],u),r=de(p[t+1][0],p[t+1][1],u),o=de(p[t+2][0],p[t+2][1],u);e.push([n[0],n[1],r[0],r[1],o[0],o[1]])}return e}}const fe={randOffset:function(e,t){return Ce(e,t)},randOffsetWithRange:function(e,t,n){return Ee(e,t,n)},ellipse:function(e,t,n,r,o){const a=be(n,r,o);return ye(e,t,o,a).opset},doubleLineOps:function(e,t,n,r,o){return je(e,t,n,r,o,!0)}};function he(e,t,n,r,o){return{type:"path",ops:je(e,t,n,r,o)}}function me(e,t,n){const r=(e||[]).length;if(r>2){const o=[];for(let t=0;t<r-1;t++)o.push(...je(e[t][0],e[t][1],e[t+1][0],e[t+1][1],n));return t&&o.push(...je(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:"path",ops:o}}return 2===r?he(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:"path",ops:[]}}function ge(e,t,n,r,o){return function(e,t){return me(e,!0,t)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],o)}function ve(e,t){let n=Me(e,1*(1+.2*t.roughness),t);if(!t.disableMultiStroke){const r=Me(e,1.5*(1+.22*t.roughness),function(e){const t=Object.assign({},e);t.randomizer=void 0,e.seed&&(t.seed=e.seed+1);return t}(t));n=n.concat(r)}return{type:"path",ops:n}}function be(e,t,n){const r=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),o=Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r),a=2*Math.PI/o;let i=Math.abs(e/2),l=Math.abs(t/2);const s=1-n.curveFitting;return i+=Ce(i*s,n),l+=Ce(l*s,n),{increment:a,rx:i,ry:l}}function ye(e,t,n,r){const[o,a]=Pe(r.increment,e,t,r.rx,r.ry,1,r.increment*Ee(.1,Ee(.4,1,n),n),n);let i=Ie(o,null,n);if(!n.disableMultiStroke){const[o]=Pe(r.increment,e,t,r.rx,r.ry,1.5,0,n),a=Ie(o,null,n);i=i.concat(a)}return{estimatedPoints:a,opset:{type:"path",ops:i}}}function xe(e,t,n,r,o,a,i,l,s){const c=e,u=t;let d=Math.abs(n/2),p=Math.abs(r/2);d+=Ce(.01*d,s),p+=Ce(.01*p,s);let f=o,h=a;for(;f<0;)f+=2*Math.PI,h+=2*Math.PI;h-f>2*Math.PI&&(f=0,h=2*Math.PI);const m=2*Math.PI/s.curveStepCount,g=Math.min(m/2,(h-f)/2),v=Te(g,c,u,d,p,f,h,1,s);if(!s.disableMultiStroke){const e=Te(g,c,u,d,p,f,h,1.5,s);v.push(...e)}return i&&(l?v.push(...je(c,u,c+d*Math.cos(f),u+p*Math.sin(f),s),...je(c,u,c+d*Math.cos(h),u+p*Math.sin(h),s)):v.push({op:"lineTo",data:[c,u]},{op:"lineTo",data:[c+d*Math.cos(f),u+p*Math.sin(f)]})),{type:"path",ops:v}}function we(e,t){const n=[];if(e.length){const r=t.maxRandomnessOffset||0,o=e.length;if(o>2){n.push({op:"move",data:[e[0][0]+Ce(r,t),e[0][1]+Ce(r,t)]});for(let a=1;a<o;a++)n.push({op:"lineTo",data:[e[a][0]+Ce(r,t),e[a][1]+Ce(r,t)]})}}return{type:"fillPath",ops:n}}function ke(e,t){return function(e,t){let n=e.fillStyle||"hachure";if(!oe[n])switch(n){case"zigzag":oe[n]||(oe[n]=new J(t));break;case"cross-hatch":oe[n]||(oe[n]=new ee(t));break;case"dots":oe[n]||(oe[n]=new te(t));break;case"dashed":oe[n]||(oe[n]=new ne(t));break;case"zigzag-line":oe[n]||(oe[n]=new re(t));break;case"hachure":default:n="hachure",oe[n]||(oe[n]=new Q(t))}return oe[n]}(t,fe).fillPolygon(e,t)}function Se(e){return e.randomizer||(e.randomizer=new ae(e.seed||0)),e.randomizer.next()}function Ee(e,t,n,r=1){return n.roughness*r*(Se(n)*(t-e)+e)}function Ce(e,t,n=1){return Ee(-e,e,t,n)}function je(e,t,n,r,o,a=!1){const i=a?o.disableMultiStrokeFill:o.disableMultiStroke,l=Oe(e,t,n,r,o,!0,!1);if(i)return l;const s=Oe(e,t,n,r,o,!0,!0);return l.concat(s)}function Oe(e,t,n,r,o,a,i){const l=Math.pow(e-n,2)+Math.pow(t-r,2),s=Math.sqrt(l);let c=1;c=s<200?1:s>500?.4:-.0016668*s+1.233334;let u=o.maxRandomnessOffset||0;u*u*100>l&&(u=s/10);const d=u/2,p=.2+.2*Se(o);let f=o.bowing*o.maxRandomnessOffset*(r-t)/200,h=o.bowing*o.maxRandomnessOffset*(e-n)/200;f=Ce(f,o,c),h=Ce(h,o,c);const m=[],g=()=>Ce(d,o,c),v=()=>Ce(u,o,c),b=o.preserveVertices;return a&&(i?m.push({op:"move",data:[e+(b?0:g()),t+(b?0:g())]}):m.push({op:"move",data:[e+(b?0:Ce(u,o,c)),t+(b?0:Ce(u,o,c))]})),i?m.push({op:"bcurveTo",data:[f+e+(n-e)*p+g(),h+t+(r-t)*p+g(),f+e+2*(n-e)*p+g(),h+t+2*(r-t)*p+g(),n+(b?0:g()),r+(b?0:g())]}):m.push({op:"bcurveTo",data:[f+e+(n-e)*p+v(),h+t+(r-t)*p+v(),f+e+2*(n-e)*p+v(),h+t+2*(r-t)*p+v(),n+(b?0:v()),r+(b?0:v())]}),m}function Me(e,t,n){const r=[];r.push([e[0][0]+Ce(t,n),e[0][1]+Ce(t,n)]),r.push([e[0][0]+Ce(t,n),e[0][1]+Ce(t,n)]);for(let o=1;o<e.length;o++)r.push([e[o][0]+Ce(t,n),e[o][1]+Ce(t,n)]),o===e.length-1&&r.push([e[o][0]+Ce(t,n),e[o][1]+Ce(t,n)]);return Ie(r,null,n)}function Ie(e,t,n){const r=e.length,o=[];if(r>3){const a=[],i=1-n.curveTightness;o.push({op:"move",data:[e[1][0],e[1][1]]});for(let t=1;t+2<r;t++){const n=e[t];a[0]=[n[0],n[1]],a[1]=[n[0]+(i*e[t+1][0]-i*e[t-1][0])/6,n[1]+(i*e[t+1][1]-i*e[t-1][1])/6],a[2]=[e[t+1][0]+(i*e[t][0]-i*e[t+2][0])/6,e[t+1][1]+(i*e[t][1]-i*e[t+2][1])/6],a[3]=[e[t+1][0],e[t+1][1]],o.push({op:"bcurveTo",data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}if(t&&2===t.length){const e=n.maxRandomnessOffset;o.push({op:"lineTo",data:[t[0]+Ce(e,n),t[1]+Ce(e,n)]})}}else 3===r?(o.push({op:"move",data:[e[1][0],e[1][1]]}),o.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):2===r&&o.push(...je(e[0][0],e[0][1],e[1][0],e[1][1],n));return o}function Pe(e,t,n,r,o,a,i,l){const s=[],c=[],u=Ce(.5,l)-Math.PI/2;c.push([Ce(a,l)+t+.9*r*Math.cos(u-e),Ce(a,l)+n+.9*o*Math.sin(u-e)]);for(let i=u;i<2*Math.PI+u-.01;i+=e){const e=[Ce(a,l)+t+r*Math.cos(i),Ce(a,l)+n+o*Math.sin(i)];s.push(e),c.push(e)}return c.push([Ce(a,l)+t+r*Math.cos(u+2*Math.PI+.5*i),Ce(a,l)+n+o*Math.sin(u+2*Math.PI+.5*i)]),c.push([Ce(a,l)+t+.98*r*Math.cos(u+i),Ce(a,l)+n+.98*o*Math.sin(u+i)]),c.push([Ce(a,l)+t+.9*r*Math.cos(u+.5*i),Ce(a,l)+n+.9*o*Math.sin(u+.5*i)]),[c,s]}function Te(e,t,n,r,o,a,i,l,s){const c=a+Ce(.1,s),u=[];u.push([Ce(l,s)+t+.9*r*Math.cos(c-e),Ce(l,s)+n+.9*o*Math.sin(c-e)]);for(let a=c;a<=i;a+=e)u.push([Ce(l,s)+t+r*Math.cos(a),Ce(l,s)+n+o*Math.sin(a)]);return u.push([t+r*Math.cos(i),n+o*Math.sin(i)]),u.push([t+r*Math.cos(i),n+o*Math.sin(i)]),Ie(u,null,s)}function Ae(e,t,n,r,o,a,i,l){const s=[],c=[l.maxRandomnessOffset||1,(l.maxRandomnessOffset||1)+.3];let u=[0,0];const d=l.disableMultiStroke?1:2,p=l.preserveVertices;for(let f=0;f<d;f++)0===f?s.push({op:"move",data:[i[0],i[1]]}):s.push({op:"move",data:[i[0]+(p?0:Ce(c[0],l)),i[1]+(p?0:Ce(c[0],l))]}),u=p?[o,a]:[o+Ce(c[f],l),a+Ce(c[f],l)],s.push({op:"bcurveTo",data:[e+Ce(c[f],l),t+Ce(c[f],l),n+Ce(c[f],l),r+Ce(c[f],l),u[0],u[1]]});return s}function Le(e){return[...e]}function _e(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function De(e,t,n){const r=_e(t,n);if(0===r)return _e(e,t);let o=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return o=Math.max(0,Math.min(1,o)),_e(e,ze(t,n,o))}function ze(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function He(e,t,n,r){const o=r||[];if(function(e,t){const n=e[t+0],r=e[t+1],o=e[t+2],a=e[t+3];let i=3*r[0]-2*n[0]-a[0];i*=i;let l=3*r[1]-2*n[1]-a[1];l*=l;let s=3*o[0]-2*a[0]-n[0];s*=s;let c=3*o[1]-2*a[1]-n[1];return c*=c,i<s&&(i=s),l<c&&(l=c),i+l}(e,t)<n){const n=e[t+0];if(o.length){(a=o[o.length-1],i=n,Math.sqrt(_e(a,i)))>1&&o.push(n)}else o.push(n);o.push(e[t+3])}else{const r=.5,a=e[t+0],i=e[t+1],l=e[t+2],s=e[t+3],c=ze(a,i,r),u=ze(i,l,r),d=ze(l,s,r),p=ze(c,u,r),f=ze(u,d,r),h=ze(p,f,r);He([a,c,p,h],0,n,o),He([h,f,d,s],0,n,o)}var a,i;return o}function Be(e,t){return Ne(e,0,e.length,t)}function Ne(e,t,n,r,o){const a=o||[],i=e[t],l=e[n-1];let s=0,c=1;for(let r=t+1;r<n-1;++r){const t=De(e[r],i,l);t>s&&(s=t,c=r)}return Math.sqrt(s)>r?(Ne(e,t,c+1,r,a),Ne(e,c,n,r,a)):(a.length||a.push(i),a.push(l)),a}function Re(e,t=.15,n){const r=[],o=(e.length-1)/3;for(let n=0;n<o;n++){He(e,3*n,t,r)}return n&&n>0?Ne(r,0,r.length,n):r}const Fe="none";class Ve{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,combineNestedSvgPaths:!1,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,t,n){return{shape:e,sets:t||[],options:n||this.defaultOptions}}line(e,t,n,r,o){const a=this._o(o);return this._d("line",[he(e,t,n,r,a)],a)}rectangle(e,t,n,r,o){const a=this._o(o),i=[],l=ge(e,t,n,r,a);if(a.fill){const o=[[e,t],[e+n,t],[e+n,t+r],[e,t+r]];"solid"===a.fillStyle?i.push(we(o,a)):i.push(ke(o,a))}return a.stroke!==Fe&&i.push(l),this._d("rectangle",i,a)}ellipse(e,t,n,r,o){const a=this._o(o),i=[],l=be(n,r,a),s=ye(e,t,a,l);if(a.fill)if("solid"===a.fillStyle){const n=ye(e,t,a,l).opset;n.type="fillPath",i.push(n)}else i.push(ke(s.estimatedPoints,a));return a.stroke!==Fe&&i.push(s.opset),this._d("ellipse",i,a)}circle(e,t,n,r){const o=this.ellipse(e,t,n,n,r);return o.shape="circle",o}linearPath(e,t){const n=this._o(t);return this._d("linearPath",[me(e,!1,n)],n)}arc(e,t,n,r,o,a,i=!1,l){const s=this._o(l),c=[],u=xe(e,t,n,r,o,a,i,!0,s);if(i&&s.fill)if("solid"===s.fillStyle){const i=xe(e,t,n,r,o,a,!0,!1,s);i.type="fillPath",c.push(i)}else c.push(function(e,t,n,r,o,a,i){const l=e,s=t;let c=Math.abs(n/2),u=Math.abs(r/2);c+=Ce(.01*c,i),u+=Ce(.01*u,i);let d=o,p=a;for(;d<0;)d+=2*Math.PI,p+=2*Math.PI;p-d>2*Math.PI&&(d=0,p=2*Math.PI);const f=(p-d)/i.curveStepCount,h=[];for(let e=d;e<=p;e+=f)h.push([l+c*Math.cos(e),s+u*Math.sin(e)]);return h.push([l+c*Math.cos(p),s+u*Math.sin(p)]),h.push([l,s]),ke(h,i)}(e,t,n,r,o,a,s));return s.stroke!==Fe&&c.push(u),this._d("arc",c,s)}curve(e,t){const n=this._o(t),r=[],o=ve(e,n);if(n.fill&&n.fill!==Fe&&e.length>=3){const t=Re(function(e,t=0){const n=e.length;if(n<3)throw new Error("A curve must have at least three points.");const r=[];if(3===n)r.push(Le(e[0]),Le(e[1]),Le(e[2]),Le(e[2]));else{const n=[];n.push(e[0],e[0]);for(let t=1;t<e.length;t++)n.push(e[t]),t===e.length-1&&n.push(e[t]);const o=[],a=1-t;r.push(Le(n[0]));for(let e=1;e+2<n.length;e++){const t=n[e];o[0]=[t[0],t[1]],o[1]=[t[0]+(a*n[e+1][0]-a*n[e-1][0])/6,t[1]+(a*n[e+1][1]-a*n[e-1][1])/6],o[2]=[n[e+1][0]+(a*n[e][0]-a*n[e+2][0])/6,n[e+1][1]+(a*n[e][1]-a*n[e+2][1])/6],o[3]=[n[e+1][0],n[e+1][1]],r.push(o[1],o[2],o[3])}}return r}(e),10,(1+n.roughness)/2);"solid"===n.fillStyle?r.push(we(t,n)):r.push(ke(t,n))}return n.stroke!==Fe&&r.push(o),this._d("curve",r,n)}polygon(e,t){const n=this._o(t),r=[],o=me(e,!0,n);return n.fill&&("solid"===n.fillStyle?r.push(we(e,n)):r.push(ke(e,n))),n.stroke!==Fe&&r.push(o),this._d("polygon",r,n)}path(e,t){const n=this._o(t),r=[];if(!e)return this._d("path",r,n);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const o=n.fill&&"transparent"!==n.fill&&n.fill!==Fe,a=n.stroke!==Fe,i=!!(n.simplification&&n.simplification<1),l=function(e,t,n){const r=ue(ce(se(e))),o=[];let a=[],i=[0,0],l=[];const s=()=>{l.length>=4&&a.push(...Re(l,t)),l=[]},c=()=>{s(),a.length&&(o.push(a),a=[])};for(const{key:e,data:t}of r)switch(e){case"M":c(),i=[t[0],t[1]],a.push(i);break;case"L":s(),a.push([t[0],t[1]]);break;case"C":if(!l.length){const e=a.length?a[a.length-1]:i;l.push([e[0],e[1]])}l.push([t[0],t[1]]),l.push([t[2],t[3]]),l.push([t[4],t[5]]);break;case"Z":s(),a.push([i[0],i[1]])}if(c(),!n)return o;const u=[];for(const e of o){const t=Be(e,n);t.length&&u.push(t)}return u}(e,1,i?4-4*n.simplification:(1+n.roughness)/2);if(o)if(n.combineNestedSvgPaths){const e=[];l.forEach((t=>e.push(...t))),"solid"===n.fillStyle?r.push(we(e,n)):r.push(ke(e,n))}else l.forEach((e=>{"solid"===n.fillStyle?r.push(we(e,n)):r.push(ke(e,n))}));return a&&(i?l.forEach((e=>{r.push(me(e,!1,n))})):r.push(function(e,t){const n=ue(ce(se(e))),r=[];let o=[0,0],a=[0,0];for(const{key:e,data:i}of n)switch(e){case"M":{const e=1*(t.maxRandomnessOffset||0),n=t.preserveVertices;r.push({op:"move",data:i.map((r=>r+(n?0:Ce(e,t))))}),a=[i[0],i[1]],o=[i[0],i[1]];break}case"L":r.push(...je(a[0],a[1],i[0],i[1],t)),a=[i[0],i[1]];break;case"C":{const[e,n,o,l,s,c]=i;r.push(...Ae(e,n,o,l,s,c,a,t)),a=[s,c];break}case"Z":r.push(...je(a[0],a[1],o[0],o[1],t)),a=[o[0],o[1]]}return{type:"path",ops:r}}(e,n))),this._d("path",r,n)}opsToPath(e,t){let n="";for(const r of e.ops){const e="number"==typeof t&&t>=0?r.data.map((e=>+e.toFixed(t))):r.data;switch(r.op){case"move":n+=`M${e[0]} ${e[1]} `;break;case"bcurveTo":n+=`C${e[0]} ${e[1]}, ${e[2]} ${e[3]}, ${e[4]} ${e[5]} `;break;case"lineTo":n+=`L${e[0]} ${e[1]} `}}return n.trim()}toPaths(e){const t=e.sets||[],n=e.options||this.defaultOptions,r=[];for(const e of t){let t=null;switch(e.type){case"path":t={d:this.opsToPath(e),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:Fe};break;case"fillPath":t={d:this.opsToPath(e),stroke:Fe,strokeWidth:0,fill:n.fill||Fe};break;case"fillSketch":t=this.fillSketch(e,n)}t&&r.push(t)}return r}fillSketch(e,t){let n=t.fillWeight;return n<0&&(n=t.strokeWidth/2),{d:this.opsToPath(e),stroke:t.fill||Fe,strokeWidth:n,fill:Fe}}}class Ue{constructor(e,t){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new Ve(t)}draw(e){const t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.ctx;for(const o of t)switch(o.type){case"path":r.save(),r.strokeStyle="none"===n.stroke?"transparent":n.stroke,r.lineWidth=n.strokeWidth,n.strokeLineDash&&r.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(r.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(r,o),r.restore();break;case"fillPath":r.save(),r.fillStyle=n.fill||"";const t="curve"===e.shape||"polygon"===e.shape?"evenodd":"nonzero";this._drawToContext(r,o,t),r.restore();break;case"fillSketch":this.fillSketch(r,o,n)}}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||"",e.lineWidth=r,this._drawToContext(e,t),e.restore()}_drawToContext(e,t,n="nonzero"){e.beginPath();for(const n of t.ops){const t=n.data;switch(n.op){case"move":e.moveTo(t[0],t[1]);break;case"bcurveTo":e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]);break;case"lineTo":e.lineTo(t[0],t[1])}}"fillPath"===t.type?e.fill(n):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,t,n,r,o){const a=this.gen.line(e,t,n,r,o);return this.draw(a),a}rectangle(e,t,n,r,o){const a=this.gen.rectangle(e,t,n,r,o);return this.draw(a),a}ellipse(e,t,n,r,o){const a=this.gen.ellipse(e,t,n,r,o);return this.draw(a),a}circle(e,t,n,r){const o=this.gen.circle(e,t,n,r);return this.draw(o),o}linearPath(e,t){const n=this.gen.linearPath(e,t);return this.draw(n),n}polygon(e,t){const n=this.gen.polygon(e,t);return this.draw(n),n}arc(e,t,n,r,o,a,i=!1,l){const s=this.gen.arc(e,t,n,r,o,a,i,l);return this.draw(s),s}curve(e,t){const n=this.gen.curve(e,t);return this.draw(n),n}path(e,t){const n=this.gen.path(e,t);return this.draw(n),n}}const Ge="http://www.w3.org/2000/svg";class We{constructor(e,t){this.svg=e,this.gen=new Ve(t)}draw(e){const t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.svg.ownerDocument||window.document,o=r.createElementNS(Ge,"g"),a=e.options.fixedDecimalPlaceDigits;for(const i of t){let t=null;switch(i.type){case"path":t=r.createElementNS(Ge,"path"),t.setAttribute("d",this.opsToPath(i,a)),t.setAttribute("stroke",n.stroke),t.setAttribute("stroke-width",n.strokeWidth+""),t.setAttribute("fill","none"),n.strokeLineDash&&t.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&t.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":t=r.createElementNS(Ge,"path"),t.setAttribute("d",this.opsToPath(i,a)),t.setAttribute("stroke","none"),t.setAttribute("stroke-width","0"),t.setAttribute("fill",n.fill||""),"curve"!==e.shape&&"polygon"!==e.shape||t.setAttribute("fill-rule","evenodd");break;case"fillSketch":t=this.fillSketch(r,i,n)}t&&o.appendChild(t)}return o}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2);const o=e.createElementNS(Ge,"path");return o.setAttribute("d",this.opsToPath(t,n.fixedDecimalPlaceDigits)),o.setAttribute("stroke",n.fill||""),o.setAttribute("stroke-width",r+""),o.setAttribute("fill","none"),n.fillLineDash&&o.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&o.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),o}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,t){return this.gen.opsToPath(e,t)}line(e,t,n,r,o){const a=this.gen.line(e,t,n,r,o);return this.draw(a)}rectangle(e,t,n,r,o){const a=this.gen.rectangle(e,t,n,r,o);return this.draw(a)}ellipse(e,t,n,r,o){const a=this.gen.ellipse(e,t,n,r,o);return this.draw(a)}circle(e,t,n,r){const o=this.gen.circle(e,t,n,r);return this.draw(o)}linearPath(e,t){const n=this.gen.linearPath(e,t);return this.draw(n)}polygon(e,t){const n=this.gen.polygon(e,t);return this.draw(n)}arc(e,t,n,r,o,a,i=!1,l){const s=this.gen.arc(e,t,n,r,o,a,i,l);return this.draw(s)}curve(e,t){const n=this.gen.curve(e,t);return this.draw(n)}path(e,t){const n=this.gen.path(e,t);return this.draw(n)}}var Ke={canvas:(e,t)=>new Ue(e,t),svg:(e,t)=>new We(e,t),generator:e=>new Ve(e),newSeed:()=>Ve.newSeed()};function Ze(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Ze(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Ye(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Ze(e))&&(r&&(r+=" "),r+=t);return r}let Xe=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;){let r=63&n[e];t+=r<36?r.toString(36):r<62?(r-26).toString(36).toUpperCase():r<63?"_":"-"}return t};var qe=function(e){return!!e&&"image"===e.type&&!!e.fileId},$e=function(e){return!!e&&"image"===e.type},Qe=function(e){return null!=e&&"text"===e.type},Je=function(e){return null!=e&&et(e.type)},et=function(e){return"freedraw"===e},tt=function(e){return null!=e&&nt(e.type)},nt=function(e){return"arrow"===e||"line"===e},rt=function(e){return null!=e&&ot(e.type)},ot=function(e){return"arrow"===e},at=function(e){return null!=e&&("rectangle"===e.type||"diamond"===e.type||"ellipse"===e.type||"text"===e.type)},it=function(e,t,n,r,o){return[(e-n)*Math.cos(o)-(t-r)*Math.sin(o)+n,(e-n)*Math.sin(o)+(t-r)*Math.cos(o)+r]},lt=function(e,t,n){return it(e[0],e[1],t[0],t[1],n)},st=function(e,t,n,r,o,a,i,l){var s=Math.cos(r),c=Math.sin(r);return e.e&&e.w?t+=o+i:e.e?(t+=o*(1+s),n+=o*c,t+=i*(1-s),n+=i*-c):e.w&&(t+=o*(1-s),n+=o*-c,t+=i*(1+s),n+=i*c),e.n&&e.s?n+=a+l:e.n?(t+=a*c,n+=a*(1-s),t+=l*-c,n+=l*(1+s)):e.s&&(t+=a*-c,n+=a*(1+s),t+=l*c,n+=l*(1-s)),[t,n]},ct=function(e,t,n,r){var o=n-e,a=r-t;return Math.hypot(o,a)},ut=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(e.length>=3){var n=[e[0],e[e.length-1]],r=n[0],o=n[1],a=ct(r[0],r[1],o[0],o[1]);return a<=d.qx/t}return!1},dt=function(e,t,n){var r=e.length;if(r<3)return!1;for(var o=[Number.MAX_SAFE_INTEGER,n],a=[t,n],i=0,l=0;l<r;l++){var s=e[l],c=e[(l+1)%r];if(ht(s,c,a,o)){if(0===ft(s,a,c))return pt(s,a,c);i++}}return i%2==1},pt=function(e,t,n){return t[0]<=Math.max(e[0],n[0])&&t[0]>=Math.min(e[0],n[0])&&t[1]<=Math.max(e[1],n[1])&&t[1]>=Math.min(e[1],n[1])},ft=function(e,t,n){var r=(t[1]-e[1])*(n[0]-t[0])-(t[0]-e[0])*(n[1]-t[1]);return 0===r?0:r>0?1:2},ht=function(e,t,n,r){var o=ft(e,t,n),a=ft(e,t,r),i=ft(n,r,e),l=ft(n,r,t);return o!==a&&i!==l||(!(0!==o||!pt(e,n,t))||(!(0!==a||!pt(e,r,t))||(!(0!==i||!pt(n,e,r))||!(0!==l||!pt(n,t,r)))))},mt=function(e,t,n){return n?[Math.round(e/n)*n,Math.round(t/n)*n]:[e,t]},gt=function(e){var t=e.map((function(e){return e[0]})),n=e.map((function(e){return e[1]}));return{width:Math.max.apply(Math,_(t))-Math.min.apply(Math,_(t)),height:Math.max.apply(Math,_(n))-Math.min.apply(Math,_(n))}},vt=function(e,t,n){var r=n.map((function(t){return t[e]})),o=Math.max.apply(Math,_(r)),a=Math.min.apply(Math,_(r)),i=o-a,l=0===i?1:t/i,s=1/0,c=n.map((function(t){return t.map((function(t,n){if(n!==e)return t;var r=t*l;return s=Math.min(r,s),r}))}));if(2===c.length)return c;var u=a-s;return c.map((function(t){return t.map((function(t,n){return n===e?t+u:t}))}))};function bt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return yt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yt(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}function yt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var xt=function(e){return Je(e)?Et(e):tt(e)?Ct(e):[e.x,e.y,e.x+e.width,e.y+e.height]},wt=function(e){var t,n=bt(e.sets);try{for(n.s();!(t=n.n()).done;){var r=t.value;if("path"===r.type)return r.ops}}catch(e){n.e(e)}finally{n.f()}return e.sets[0].ops},kt=function(e,t){var n=[0,0],r=e.reduce((function(e,r){var o=r.op,a=r.data;if("move"===o)n=a;else if("bcurveTo"===o){var i=[a[0],a[1]],l=[a[2],a[3]],s=[a[4],a[5]],c=n;n=s;for(var u=function(e,t){return Math.pow(1-e,3)*s[t]+3*e*Math.pow(1-e,2)*l[t]+3*Math.pow(e,2)*(1-e)*i[t]+c[t]*Math.pow(e,3)},d=0;d<=1;){var p=u(d,0),f=u(d,1);if(t){var h=g(t(p,f),2);p=h[0],f=h[1]}e.minY=Math.min(e.minY,f),e.minX=Math.min(e.minX,p),e.maxX=Math.max(e.maxX,p),e.maxY=Math.max(e.maxY,f),d+=.1}}return e}),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return[r.minX,r.minY,r.maxX,r.maxY]},St=function(e){var t,n=1/0,r=1/0,o=-1/0,a=-1/0,i=bt(e);try{for(i.s();!(t=i.n()).done;){var l=g(t.value,2),s=l[0],c=l[1];n=Math.min(n,s),r=Math.min(r,c),o=Math.max(o,s),a=Math.max(a,c)}}catch(e){i.e(e)}finally{i.f()}return[n,r,o,a]},Et=function(e){var t=g(St(e.points),4),n=t[0],r=t[1],o=t[2],a=t[3];return[n+e.x,r+e.y,o+e.x,a+e.y]},Ct=function(e){var t;if(e.points.length<2||!Ur(e)){var n=e.points.reduce((function(e,t){var n=g(t,2),r=n[0],o=n[1];return e.minY=Math.min(e.minY,o),e.minX=Math.min(e.minX,r),e.maxX=Math.max(e.maxX,r),e.maxY=Math.max(e.maxY,o),e}),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}),r=n.minX,o=n.minY,a=n.maxX,i=n.maxY;t=[r+e.x,o+e.y,a+e.x,i+e.y]}else{var l=Ur(e),s=wt(l[0]),c=g(kt(s),4),u=c[0],d=c[1],p=c[2],f=c[3];t=[u+e.x,d+e.y,p+e.x,f+e.y]}return t},jt=function(e){var t,n=g(xt(e),4),r=n[0],o=n[1],a=n[2],i=n[3],l=(r+a)/2,s=(o+i)/2;if(Je(e)){var c=St(e.points.map((function(t){var n=g(t,2),r=n[0],o=n[1];return it(r,o,l-e.x,s-e.y,e.angle)}))),u=g(c,4),d=u[0],p=u[1],f=u[2],h=u[3];return[d+e.x,p+e.y,f+e.x,h+e.y]}if(tt(e))t=function(e,t,n){if(e.points.length<2||!Ur(e)){var r=e.points.reduce((function(r,o){var a=g(o,2),i=a[0],l=a[1],s=g(it(e.x+i,e.y+l,t,n,e.angle),2);return i=s[0],l=s[1],r.minY=Math.min(r.minY,l),r.minX=Math.min(r.minX,i),r.maxX=Math.max(r.maxX,i),r.maxY=Math.max(r.maxY,l),r}),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return[r.minX,r.minY,r.maxX,r.maxY]}var o=Ur(e),a=wt(o[0]);return kt(a,(function(r,o){return it(e.x+r,e.y+o,t,n,e.angle)}))}(e,l,s);else if("diamond"===e.type){var m=g(it(l,o,l,s,e.angle),2),v=m[0],b=m[1],y=g(it(l,i,l,s,e.angle),2),x=y[0],w=y[1],k=g(it(r,s,l,s,e.angle),2),S=k[0],E=k[1],C=g(it(a,s,l,s,e.angle),2),j=C[0],O=C[1];t=[Math.min(v,x,S,j),Math.min(b,w,E,O),Math.max(v,x,S,j),Math.max(b,w,E,O)]}else if("ellipse"===e.type){var M=(a-r)/2,I=(i-o)/2,P=Math.cos(e.angle),T=Math.sin(e.angle),A=Math.hypot(M*P,I*T),L=Math.hypot(I*P,M*T);t=[l-A,s-L,l+A,s+L]}else{var _=g(it(r,o,l,s,e.angle),2),D=_[0],z=_[1],H=g(it(r,i,l,s,e.angle),2),B=H[0],N=H[1],R=g(it(a,i,l,s,e.angle),2),F=R[0],V=R[1],U=g(it(a,o,l,s,e.angle),2),G=U[0],W=U[1];t=[Math.min(D,B,F,G),Math.min(z,N,V,W),Math.max(D,B,F,G),Math.max(z,N,V,W)]}return t},Ot=function(e){if(!e.length)return[0,0,0,0];var t=1/0,n=-1/0,r=1/0,o=-1/0;return e.forEach((function(e){var a=g(jt(e),4),i=a[0],l=a[1],s=a[2],c=a[3];t=Math.min(t,i),r=Math.min(r,l),n=Math.max(n,s),o=Math.max(o,c)})),[t,r,n,o]},Mt=function(e,t,n){if(!tt(e)&&!Je(e))return[e.x,e.y,e.x+t,e.y+n];var r,o=vt(0,t,vt(1,n,e.points));if(Je(e))r=St(o);else{var a=Ke.generator(),i="sharp"===e.strokeSharpness?a.linearPath(o,Wr(e)):a.curve(o,Wr(e)),l=wt(i);r=kt(l)}var s=g(r,4),c=s[0],u=s[1],d=s[2],p=s[3];return[c+e.x,u+e.y,d+e.x,p+e.y]},It=function(e,t,n){var r=Ke.generator(),o="sharp"===n?r.linearPath(t,Wr(e)):r.curve(t,Wr(e)),a=wt(o),i=g(kt(a),4),l=i[0],s=i[1],c=i[2],u=i[3];return[l+e.x,s+e.y,c+e.x,u+e.y]},Pt=JSON.parse('{"white":"#ffffff","black":"#000000","gray":["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],"red":["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],"pink":["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],"grape":["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],"violet":["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],"indigo":["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],"blue":["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],"cyan":["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],"teal":["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],"green":["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],"lime":["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],"yellow":["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],"orange":["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]}'),Tt=function(e){return[Pt.red[e],Pt.pink[e],Pt.grape[e],Pt.violet[e],Pt.indigo[e],Pt.blue[e],Pt.cyan[e],Pt.teal[e],Pt.green[e],Pt.lime[e],Pt.yellow[e],Pt.orange[e]]},At={canvasBackground:[Pt.white,Pt.gray[0],Pt.gray[1]].concat(_(Tt(0))),elementBackground:["transparent",Pt.gray[4],Pt.gray[6]].concat(_(Tt(6))),elementStroke:[Pt.black,Pt.gray[8],Pt.gray[7]].concat(_(Tt(9)))},Lt=n(6207),_t=/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),Dt=/^Win/.test(window.navigator.platform),zt="Equal",Ht="Minus",Bt="NumpadAdd",Nt="NumpadSubtract",Rt="Numpad0",Ft="BracketRight",Vt="BracketLeft",Ut="Digit1",Gt="Digit2",Wt="Quote",Kt="Digit0",Zt="Slash",Yt="KeyC",Xt="KeyD",qt="KeyG",$t="KeyF",Qt="KeyH",Jt="KeyV",en="KeyX",tn="KeyZ",nn="KeyR",rn="ArrowDown",on="ArrowLeft",an="ArrowRight",ln="ArrowUp",sn="Backspace",cn="Alt",un=_t?"metaKey":"ctrlKey",dn="Delete",pn="Enter",fn="Escape",hn="?",mn=" ",gn="Tab",vn="a",bn="d",yn="e",xn="g",wn="l",kn="o",Sn="p",En="q",Cn="r",jn="s",On="t",Mn="v",In="x",Pn="y",Tn="z",An=function(e){return e===on||e===an||e===rn||e===ln},Ln=function(e){return e.altKey},_n=function(e){return e.shiftKey},Dn=function(e){return e.shiftKey},zn=null,Hn=function(){if(zn)return zn;var e=new Date,t=e.getFullYear(),n="".concat(e.getMonth()+1).padStart(2,"0"),r="".concat(e.getDate()).padStart(2,"0"),o="".concat(e.getHours()).padStart(2,"0"),a="".concat(e.getMinutes()).padStart(2,"0");return"".concat(t,"-").concat(n,"-").concat(r,"-").concat(o).concat(a)},Bn=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},Nn=function(e){return e instanceof HTMLElement&&"wysiwyg"===e.dataset.type||e instanceof HTMLBRElement||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&("text"===e.type||"number"===e.type)},Rn=function(e){for(var t=e.fontFamily,n=0,r=Object.entries(d.ut);n<r.length;n++){var o=g(r[n],2),a=o[0];if(o[1]===t)return"".concat(a,", ").concat(d._D)}return d._D},Fn=function(e){var t=e.fontSize,n=e.fontFamily;return"".concat(t,"px ").concat(Rn({fontFamily:n}))},Vn=function(e,t){var n=document.createElement("div"),r=document.body;n.style.position="absolute",n.style.whiteSpace="pre",n.style.font=t,r.appendChild(n),n.innerText=e.split("\n").map((function(e){return e||" "})).join("\n");var o=n.offsetWidth,a=n.offsetHeight,i=document.createElement("span");i.style.display="inline-block",i.style.overflow="hidden",i.style.width="1px",i.style.height="1px",n.appendChild(i);var l=i.offsetTop+i.offsetHeight;return document.body.removeChild(n),{width:o,height:a,baseline:l}},Un=function(e,t){var n=0,r=null,o=function(){for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];r=a,clearTimeout(n),n=window.setTimeout((function(){r=null,e.apply(void 0,a)}),t)};return o.flush=function(){if(clearTimeout(n),r){var t=r;r=null,e.apply(void 0,_(t))}},o.cancel=function(){r=null,clearTimeout(n)},o},Gn=function(e,t){return Math.abs(e-t)},Wn=function(e){e&&(e.style.cursor="")},Kn=function(e,t){e&&(e.style.cursor=t)},Zn=function(e,t){e&&("selection"===t?Wn(e):"image"!==t&&(e.style.cursor=d.oc.CROSSHAIR))},Yn=function(){var e;return"HTML"===(null===(e=document.fullscreenElement)||void 0===e?void 0:e.nodeName)},Xn=function(e){return e=e.replace(/\bAlt\b/i,"Alt").replace(/\bShift\b/i,"Shift").replace(/\b(Enter|Return)\b/i,"Enter").replace(/\bDel\b/i,"Delete"),_t?e.replace(/\bCtrlOrCmd\b/i,"Cmd").replace(/\bAlt\b/i,"Option"):e.replace(/\bCtrlOrCmd\b/i,"Ctrl")},qn=function(e,t){var n=e.clientX,r=e.clientY,o=t.zoom,a=t.offsetLeft,i=t.offsetTop,l=t.scrollX,s=t.scrollY,c=1/o.value;return{x:(n-o.translation.x-a)*c-l,y:(r-o.translation.y-i)*c-s}},$n=function(e,t){var n=e.sceneX,r=e.sceneY,o=t.zoom,a=t.offsetLeft,i=t.offsetTop,l=t.scrollX,s=t.scrollY;return{x:(n+l+a)*o.value+o.translation.x,y:(r+s+i)*o.value+o.translation.y}},Qn=function(e){return getComputedStyle(document.documentElement).getPropertyValue("--".concat(e))},Jn=new RegExp("^[^".concat("A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-﷾--","]*[").concat("֑-߿יִ-﷽ﹰ-ﻼ","]")),er=function(e){return Jn.test(e)},tr=function(e){var t=g(e,2);return{x:t[0],y:t[1]}},nr=function(e){if("AbortError"!==(null==e?void 0:e.name))throw e},rr=function(e){var t=5===e.length&&"0"===e.substr(4,1),n=9===e.length&&"00"===e.substr(7,2);return t||n||e===At.elementBackground[0]},or=function(e){return function(t){(0,Lt.unstable_batchedUpdates)(e,t)}};function ar(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ir(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ir(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}function ir(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var lr=d.ZB.includes(devicePixelRatio)?devicePixelRatio:1,sr=function(){return{theme:d.C6.LIGHT,collaborators:new Map,currentChartType:"bar",currentItemBackgroundColor:"transparent",currentItemEndArrowhead:"arrow",currentItemFillStyle:"hachure",currentItemFontFamily:d.rk,currentItemFontSize:d.n5,currentItemLinearStrokeSharpness:"round",currentItemOpacity:100,currentItemRoughness:1,currentItemStartArrowhead:null,currentItemStrokeColor:Pt.black,currentItemStrokeSharpness:"sharp",currentItemStrokeStyle:"solid",currentItemStrokeWidth:1,currentItemTextAlign:d.Hg,cursorButton:"up",draggingElement:null,editingElement:null,editingGroupId:null,editingLinearElement:null,elementLocked:!1,elementType:"selection",errorMessage:null,exportBackground:!0,exportScale:lr,exportEmbedScene:!1,exportWithDarkMode:!1,fileHandle:null,gridSize:null,isBindingEnabled:!0,isLibraryOpen:!1,isLoading:!1,isResizing:!1,isRotating:!1,lastPointerDownWith:"mouse",multiElement:null,name:"".concat(I("labels.untitled"),"-").concat(Hn()),openMenu:null,openPopup:null,pasteDialog:{shown:!1,data:null},previousSelectedElementIds:{},resizingElement:null,scrolledOutside:!1,scrollX:0,scrollY:0,selectedElementIds:{},selectedGroupIds:{},selectionElement:null,shouldCacheIgnoreZoom:!1,showHelpDialog:!1,showStats:!1,startBoundElement:null,suggestedBindings:[],toastMessage:null,viewBackgroundColor:Pt.white,zenModeEnabled:!1,zoom:{value:1,translation:{x:0,y:0}},viewModeEnabled:!1,pendingImageElement:null}},cr={theme:{browser:!0,export:!1,server:!1},collaborators:{browser:!1,export:!1,server:!1},currentChartType:{browser:!0,export:!1,server:!1},currentItemBackgroundColor:{browser:!0,export:!1,server:!1},currentItemEndArrowhead:{browser:!0,export:!1,server:!1},currentItemFillStyle:{browser:!0,export:!1,server:!1},currentItemFontFamily:{browser:!0,export:!1,server:!1},currentItemFontSize:{browser:!0,export:!1,server:!1},currentItemLinearStrokeSharpness:{browser:!0,export:!1,server:!1},currentItemOpacity:{browser:!0,export:!1,server:!1},currentItemRoughness:{browser:!0,export:!1,server:!1},currentItemStartArrowhead:{browser:!0,export:!1,server:!1},currentItemStrokeColor:{browser:!0,export:!1,server:!1},currentItemStrokeSharpness:{browser:!0,export:!1,server:!1},currentItemStrokeStyle:{browser:!0,export:!1,server:!1},currentItemStrokeWidth:{browser:!0,export:!1,server:!1},currentItemTextAlign:{browser:!0,export:!1,server:!1},cursorButton:{browser:!0,export:!1,server:!1},draggingElement:{browser:!1,export:!1,server:!1},editingElement:{browser:!1,export:!1,server:!1},editingGroupId:{browser:!0,export:!1,server:!1},editingLinearElement:{browser:!1,export:!1,server:!1},elementLocked:{browser:!0,export:!1,server:!1},elementType:{browser:!0,export:!1,server:!1},errorMessage:{browser:!1,export:!1,server:!1},exportBackground:{browser:!0,export:!1,server:!1},exportEmbedScene:{browser:!0,export:!1,server:!1},exportScale:{browser:!0,export:!1,server:!1},exportWithDarkMode:{browser:!0,export:!1,server:!1},fileHandle:{browser:!1,export:!1,server:!1},gridSize:{browser:!0,export:!0,server:!0},height:{browser:!1,export:!1,server:!1},isBindingEnabled:{browser:!1,export:!1,server:!1},isLibraryOpen:{browser:!1,export:!1,server:!1},isLoading:{browser:!1,export:!1,server:!1},isResizing:{browser:!1,export:!1,server:!1},isRotating:{browser:!1,export:!1,server:!1},lastPointerDownWith:{browser:!0,export:!1,server:!1},multiElement:{browser:!1,export:!1,server:!1},name:{browser:!0,export:!1,server:!1},offsetLeft:{browser:!1,export:!1,server:!1},offsetTop:{browser:!1,export:!1,server:!1},openMenu:{browser:!0,export:!1,server:!1},openPopup:{browser:!1,export:!1,server:!1},pasteDialog:{browser:!1,export:!1,server:!1},previousSelectedElementIds:{browser:!0,export:!1,server:!1},resizingElement:{browser:!1,export:!1,server:!1},scrolledOutside:{browser:!0,export:!1,server:!1},scrollX:{browser:!0,export:!1,server:!1},scrollY:{browser:!0,export:!1,server:!1},selectedElementIds:{browser:!0,export:!1,server:!1},selectedGroupIds:{browser:!0,export:!1,server:!1},selectionElement:{browser:!1,export:!1,server:!1},shouldCacheIgnoreZoom:{browser:!0,export:!1,server:!1},showHelpDialog:{browser:!1,export:!1,server:!1},showStats:{browser:!0,export:!1,server:!1},startBoundElement:{browser:!1,export:!1,server:!1},suggestedBindings:{browser:!1,export:!1,server:!1},toastMessage:{browser:!1,export:!1,server:!1},viewBackgroundColor:{browser:!0,export:!0,server:!0},width:{browser:!1,export:!1,server:!1},zenModeEnabled:{browser:!0,export:!1,server:!1},zoom:{browser:!0,export:!1,server:!1},viewModeEnabled:{browser:!1,export:!1,server:!1},pendingImageElement:{browser:!1,export:!1,server:!1}},ur=function(e,t){var n,r={},o=ar(Object.keys(e));try{for(o.s();!(n=o.n()).done;){var a=n.value,i=cr[a];if(null!=i&&i[t]){var l=e[a];r[a]=l}}}catch(e){o.e(e)}finally{o.f()}return r},dr=function(e){return ur(e,"browser")},pr=function(e){return ur(e,"export")},fr=function(e){return ur(e,"server")};function hr(e,t,n,r=(e=>e)){return e*r(.5-t*(.5-n))}function mr(e,t){return[e[0]+t[0],e[1]+t[1]]}function gr(e,t){return[e[0]-t[0],e[1]-t[1]]}function vr(e,t){return[e[0]*t,e[1]*t]}function br(e){return[e[1],-e[0]]}function yr(e,t){return e[0]*t[0]+e[1]*t[1]}function xr(e,t){return e[0]===t[0]&&e[1]===t[1]}function wr(e,t){return function(e){return e[0]*e[0]+e[1]*e[1]}(gr(e,t))}function kr(e){return function(e,t){return[e[0]/t,e[1]/t]}(e,function(e){return Math.hypot(e[0],e[1])}(e))}function Sr(e,t){return Math.hypot(e[1]-t[1],e[0]-t[0])}function Er(e,t,n){let r=Math.sin(n),o=Math.cos(n),a=e[0]-t[0],i=e[1]-t[1],l=a*r+i*o;return[a*o-i*r+t[0],l+t[1]]}function Cr(e,t,n){return mr(e,vr(gr(t,e),n))}function jr(e,t,n){return mr(e,vr(t,n))}var{min:Or,PI:Mr}=Math,Ir=Mr+1e-4;function Pr(e,t={}){return function(e,t={}){let{size:n=16,smoothing:r=.5,thinning:o=.5,simulatePressure:a=!0,easing:i=(e=>e),start:l={},end:s={},last:c=!1}=t,{cap:u=!0,taper:d=0,easing:p=(e=>e*(2-e))}=l,{cap:f=!0,taper:h=0,easing:m=(e=>--e*e*e+1)}=s;if(0===e.length||n<=0)return[];let g,v=e[e.length-1].runningLength,b=Math.pow(n*r,2),y=[],x=[],w=e.slice(0,10).reduce(((e,t)=>{let r=t.pressure;if(a){let o=Or(1,t.distance/n),a=Or(1,1-o);r=Or(1,e+.275*o*(a-e))}return(e+r)/2}),e[0].pressure),k=hr(n,o,e[e.length-1].pressure,i),S=e[0].vector,E=e[0].point,C=E,j=E,O=C;for(let t=0;t<e.length;t++){let{pressure:r}=e[t],{point:l,vector:s,distance:c,runningLength:u}=e[t];if(t<e.length-1&&v-u<3)continue;if(o){if(a){let e=Or(1,c/n),t=Or(1,1-e);r=Or(1,w+.275*e*(t-w))}k=hr(n,o,r,i)}else k=n/2;void 0===g&&(g=k);let f=u<d?p(u/d):1,M=v-u<h?m((v-u)/h):1;if(k=Math.max(.01,k*Math.min(f,M)),t===e.length-1){let e=vr(br(s),k);y.push(gr(l,e)),x.push(mr(l,e));continue}let I=e[t+1].vector,P=yr(s,I);if(P<0){let e=vr(br(S),k);for(let t=1/13,n=0;n<=1;n+=t)j=Er(gr(l,e),l,Ir*n),y.push(j),O=Er(mr(l,e),l,Ir*-n),x.push(O);E=j,C=O;continue}let T=vr(br(Cr(I,s,P)),k);j=gr(l,T),(t<=1||wr(E,j)>b)&&(y.push(j),E=j),O=mr(l,T),(t<=1||wr(C,O)>b)&&(x.push(O),C=O),w=r,S=s}let M=e[0].point.slice(0,2),I=e.length>1?e[e.length-1].point.slice(0,2):mr(e[0].point,[1,1]),P=[],T=[];if(1===e.length){if(!d&&!h||c){let e=jr(M,kr(br(gr(M,I))),-(g||k)),t=[];for(let n=1/13,r=n;r<=1;r+=n)t.push(Er(e,M,2*Ir*r));return t}}else{if(!(d||h&&1===e.length))if(u)for(let e=1/13,t=e;t<=1;t+=e){let e=Er(x[0],M,Ir*t);P.push(e)}else{let e=gr(y[0],x[0]),t=vr(e,.5),n=vr(e,.51);P.push(gr(M,t),gr(M,n),mr(M,n),mr(M,t))}let t=br(function(e){return[-e[0],-e[1]]}(e[e.length-1].vector));if(h||d&&1===e.length)T.push(I);else if(f){let e=jr(I,t,k);for(let t=1/29,n=t;n<1;n+=t)T.push(Er(e,I,3*Ir*n))}else T.push(mr(I,vr(t,k)),mr(I,vr(t,.99*k)),gr(I,vr(t,.99*k)),gr(I,vr(t,k)))}return y.concat(T,x.reverse(),P)}(function(e,t={}){var n;let{streamline:r=.5,size:o=16,last:a=!1}=t;if(0===e.length)return[];let i=.15+.85*(1-r),l=Array.isArray(e[0])?e:e.map((({x:e,y:t,pressure:n=.5})=>[e,t,n]));if(2===l.length){let e=l[1];l=l.slice(0,-1);for(let t=1;t<5;t++)l.push(Cr(l[0],e,t/4))}1===l.length&&(l=[...l,[...mr(l[0],[1,1]),...l[0].slice(2)]]);let s=[{point:[l[0][0],l[0][1]],pressure:l[0][2]>=0?l[0][2]:.25,vector:[1,1],distance:0,runningLength:0}],c=!1,u=0,d=s[0],p=l.length-1;for(let e=1;e<l.length;e++){let t=a&&e===p?l[e].slice(0,2):Cr(d.point,l[e],i);if(xr(d.point,t))continue;let n=Sr(t,d.point);if(u+=n,e<p&&!c){if(u<o)continue;c=!0}d={point:t,pressure:l[e][2]>=0?l[e][2]:.5,vector:kr(gr(d.point,t)),distance:n,runningLength:u},s.push(d)}return s[0].vector=(null==(n=s[1])?void 0:n.vector)||[0,0],s}(e,t),t)}function Tr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ar(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tr(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Lr=sr(),_r=function(e,t){return qe(e)&&!t.imageCache.has(e.fileId)},Dr=function(e){return[8,8+e]},zr=function(e){return[1.5,6+e]},Hr=function(e){return"freedraw"===e.type?12*e.strokeWidth:20},Br=document.createElement("img");Br.src="data:".concat(d.LO.svg,",").concat(encodeURIComponent('<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="image" class="svg-inline--fa fa-image fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="#888" d="M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"></path></svg>'));var Nr=document.createElement("img");Nr.src="data:".concat(d.LO.svg,",").concat(encodeURIComponent('<svg viewBox="0 0 668 668" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2"><path d="M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48ZM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56ZM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48Z" style="fill:#888;fill-rule:nonzero" transform="matrix(.81709 0 0 .81709 124.825 145.825)"/><path d="M256 8C119.034 8 8 119.033 8 256c0 136.967 111.034 248 248 248s248-111.034 248-248S392.967 8 256 8Zm130.108 117.892c65.448 65.448 70 165.481 20.677 235.637L150.47 105.216c70.204-49.356 170.226-44.735 235.638 20.676ZM125.892 386.108c-65.448-65.448-70-165.481-20.677-235.637L361.53 406.784c-70.203 49.356-170.226 44.736-235.638-20.676Z" style="fill:#888;fill-rule:nonzero" transform="matrix(.30366 0 0 .30366 506.822 60.065)"/></svg>'));var Rr=function(e,t,n,r){switch(n.globalAlpha=e.opacity/100,e.type){case"rectangle":case"diamond":case"ellipse":n.lineJoin="round",n.lineCap="round",t.draw(Ur(e));break;case"arrow":case"line":n.lineJoin="round",n.lineCap="round",Ur(e).forEach((function(e){t.draw(e)}));break;case"freedraw":n.save(),n.fillStyle=e.strokeColor;var o=function(e){return Qr.get(e)}(e);n.fillStyle=e.strokeColor,n.fill(o),n.restore();break;case"image":var a,i=qe(e)?null===(a=r.imageCache.get(e.fileId))||void 0===a?void 0:a.image:void 0;null==i||i instanceof Promise?function(e,t,n){t.fillStyle="#E7E7E7",t.fillRect(0,0,e.width,e.height);var r=Math.min(e.width,e.height),o=Math.min(r,Math.min(.4*r,100));t.drawImage("error"===e.status?Nr:Br,e.width/2-o/2,e.height/2-o/2,o,o)}(e,n,r.zoom.value):n.drawImage(i,0,0,e.width,e.height);break;default:if(!Qe(e))throw new Error("Unimplemented type ".concat(e.type));var l=er(e.text),s=l&&!n.canvas.isConnected;s&&document.body.appendChild(n.canvas),n.canvas.setAttribute("dir",l?"rtl":"ltr"),n.save(),n.font=Fn(e),n.fillStyle=e.strokeColor,n.textAlign=e.textAlign;for(var c=e.text.replace(/\r\n?/g,"\n").split("\n"),u=e.height/c.length,d=e.height-e.baseline,p="center"===e.textAlign?e.width/2:"right"===e.textAlign?e.width:0,f=0;f<c.length;f++)n.fillText(c[f],p,(f+1)*u-d);n.restore(),s&&n.canvas.remove()}n.globalAlpha=1},Fr=new WeakMap,Vr=new WeakMap,Ur=function(e){return Vr.get(e)},Gr=function(e){return Vr.delete(e)},Wr=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n={seed:e.seed,strokeLineDash:"dashed"===e.strokeStyle?Dr(e.strokeWidth):"dotted"===e.strokeStyle?zr(e.strokeWidth):void 0,disableMultiStroke:"solid"!==e.strokeStyle,strokeWidth:"solid"!==e.strokeStyle?e.strokeWidth+.5:e.strokeWidth,fillWeight:e.strokeWidth/2,hachureGap:4*e.strokeWidth,roughness:e.roughness,stroke:e.strokeColor,preserveVertices:t};switch(e.type){case"rectangle":case"diamond":case"image":case"ellipse":return n.fillStyle=e.fillStyle,n.fill="transparent"===e.backgroundColor?void 0:e.backgroundColor,"ellipse"===e.type&&(n.curveFitting=1),n;case"line":return ut(e.points)&&(n.fillStyle=e.fillStyle,n.fill="transparent"===e.backgroundColor?void 0:e.backgroundColor),n;case"freedraw":case"arrow":return n;default:throw new Error("Unimplemented type ".concat(e.type))}},Kr=function(e,t){var n=Vr.get(e)||null;if(!n){switch(Fr.delete(e),e.type){case"rectangle":if("round"===e.strokeSharpness){var r=e.width,o=e.height,a=.25*Math.min(r,o);n=t.path("M ".concat(a," 0 L ").concat(r-a," 0 Q ").concat(r," 0, ").concat(r," ").concat(a," L ").concat(r," ").concat(o-a," Q ").concat(r," ").concat(o,", ").concat(r-a," ").concat(o," L ").concat(a," ").concat(o," Q 0 ").concat(o,", 0 ").concat(o-a," L 0 ").concat(a," Q 0 0, ").concat(a," 0"),Wr(e,!0))}else n=t.rectangle(0,0,e.width,e.height,Wr(e));break;case"diamond":var i=g(function(e){var t=Math.floor(e.width/2)+1,n=e.width,r=Math.floor(e.height/2)+1;return[t,0,n,r,t,e.height,0,r]}(e),8),l=i[0],s=i[1],c=i[2],u=i[3],d=i[4],p=i[5],f=i[6],h=i[7];n=t.polygon([[l,s],[c,u],[d,p],[f,h]],Wr(e));break;case"ellipse":n=t.ellipse(e.width/2,e.height/2,e.width,e.height,Wr(e));break;case"line":case"arrow":var m=Wr(e),v=e.points.length?e.points:[[0,0]];if(n="sharp"===e.strokeSharpness?m.fill?[t.polygon(v,m)]:[t.linearPath(v,m)]:[t.curve(v,m)],"arrow"===e.type){var b=e.startArrowhead,y=void 0===b?null:b,x=e.endArrowhead,w=void 0===x?"arrow":x,k=function(e,n,r,o){var a=function(e,t,n,r){var o=wt(t[0]);if(o.length<1)return null;var a="start"===n?1:o.length-1,i=o[a].data,l=[i[4],i[5]],s=[i[2],i[3]],c=[i[0],i[1]],u=o[a-1],d=[0,0];"move"===u.op?d=u.data:"bcurveTo"===u.op&&(d=[u.data[4],u.data[5]]);var p=function(e,t){return Math.pow(1-e,3)*l[t]+3*e*Math.pow(1-e,2)*s[t]+3*Math.pow(e,2)*(1-e)*c[t]+d[t]*Math.pow(e,3)},f=g("start"===n?d:l,2),h=f[0],m=f[1],v=[p(.3,0),p(.3,1)],b=v[0],y=v[1],x=Math.hypot(h-b,m-y),w=(h-b)/x,k=(m-y)/x,S={arrow:30,bar:15,dot:15,triangle:15}[r],E=0;if("arrow"===r){var C=g(e.points[e.points.length-1],2),j=C[0],O=C[1],M=g(e.points.length>1?e.points[e.points.length-2]:[0,0],2),I=M[0],P=M[1];E=Math.hypot(j-I,O-P)}else for(var T=0;T<e.points.length;T++){var A=g(e.points[T-1]||[0,0],2),L=A[0],_=A[1],D=g(e.points[T],2),z=D[0],H=D[1];E+=Math.hypot(z-L,H-_)}var B=Math.min(S,E/2),N=h-w*B,R=m-k*B;if("dot"===r)return[h,m,Math.hypot(R-m,N-h)+e.strokeWidth];var F={arrow:20,bar:90,triangle:25}[r],V=g(it(N,R,h,m,-F*Math.PI/180),2),U=V[0],G=V[1],W=g(it(N,R,h,m,F*Math.PI/180),2);return[h,m,U,G,W[0],W[1]]}(e,n,r,o);if(null===a)return[];if("dot"===o){var i=g(a,3),l=i[0],s=i[1],c=i[2];return[t.circle(l,s,c,Ar(Ar({},m),{},{fill:e.strokeColor,fillStyle:"solid",stroke:"none"}))]}if("triangle"===o){var u=g(a,6),d=u[0],p=u[1],f=u[2],h=u[3],v=u[4],b=u[5];return delete m.strokeLineDash,[t.polygon([[d,p],[f,h],[v,b],[d,p]],Ar(Ar({},m),{},{fill:e.strokeColor,fillStyle:"solid"}))]}var y=g(a,6),x=y[0],w=y[1],k=y[2],S=y[3],E=y[4],C=y[5];if("dotted"===e.strokeStyle){var j=zr(e.strokeWidth-1);m.strokeLineDash=[j[0],j[1]-1]}else delete m.strokeLineDash;return[t.line(k,S,x,w,m),t.line(E,C,x,w,m)]};if(null!==y){var S,E=k(e,n,"start",y);(S=n).push.apply(S,_(E))}if(null!==w){var C,j=k(e,n,"end",w);(C=n).push.apply(C,_(j))}}break;case"freedraw":Jr(e),n=[];break;case"text":case"image":n=[]}Vr.set(e,n)}},Zr=function(e,t){var n=t?t.zoom:Lr.zoom,r=Fr.get(e),o=r&&r.canvasZoom!==n.value&&!(null!=t&&t.shouldCacheIgnoreZoom);if(!r||o||r.theme!==t.theme){var a=function(e,t,n){var r,o=document.createElement("canvas"),a=o.getContext("2d"),i=Hr(e),l=0,s=0;if(tt(e)||Je(e)){var c=g(xt(e),4),u=c[0],p=c[1],f=c[2],h=c[3];u=Math.floor(u),f=Math.ceil(f),p=Math.floor(p),h=Math.ceil(h),o.width=Gn(u,f)*window.devicePixelRatio*t.value+i*t.value*2,o.height=Gn(p,h)*window.devicePixelRatio*t.value+i*t.value*2,l=e.x>u?Math.floor(Gn(e.x,u))*window.devicePixelRatio*t.value:0,s=e.y>p?Math.floor(Gn(e.y,p))*window.devicePixelRatio*t.value:0,a.translate(l,s)}else o.width=e.width*window.devicePixelRatio*t.value+i*t.value*2,o.height=e.height*window.devicePixelRatio*t.value+i*t.value*2;a.save(),a.translate(i*t.value,i*t.value),a.scale(window.devicePixelRatio*t.value,window.devicePixelRatio*t.value);var m=Ke.canvas(o);return"dark"===n.theme&&qe(e)&&!_r(e,n)&&(null===(r=n.imageCache.get(e.fileId))||void 0===r?void 0:r.mimeType)!==d.LO.svg&&(a.filter="invert(100%) hue-rotate(180deg) saturate(1.25)"),Rr(e,m,a,n),a.restore(),{element:e,canvas:o,theme:n.theme,canvasZoom:t.value,canvasOffsetX:l,canvasOffsetY:s}}(e,n,t);return Fr.set(e,a),a}return r},Yr=function(e,t,n,r){var o=e.element,a=Hr(o),i=g(xt(o),4),l=i[0],s=i[1],c=i[2],u=i[3];Je(o)&&(l=Math.floor(l),c=Math.ceil(c),s=Math.floor(s),u=Math.ceil(u));var d=((l+c)/2+r.scrollX)*window.devicePixelRatio,p=((s+u)/2+r.scrollY)*window.devicePixelRatio,f=_r(o,r),h="scale"in e.element&&!f?e.element.scale[0]:1,m="scale"in e.element&&!f?e.element.scale[1]:1;n.save(),n.scale(1/window.devicePixelRatio*h,1/window.devicePixelRatio*m),n.translate(d*h,p*m),n.rotate(o.angle*h*m),n.drawImage(e.canvas,-(c-l)/2*window.devicePixelRatio-a*e.canvasZoom/e.canvasZoom,-(u-s)/2*window.devicePixelRatio-a*e.canvasZoom/e.canvasZoom,e.canvas.width/e.canvasZoom,e.canvas.height/e.canvasZoom),n.restore()},Xr=function(e,t,n,r,o){var a=t.generator;switch(e.type){case"selection":n.save(),n.translate(e.x+o.scrollX,e.y+o.scrollY),n.fillStyle="rgba(0, 0, 255, 0.10)",n.fillRect(0,0,e.width,e.height),n.restore();break;case"freedraw":if(Kr(e,a),r){var i=Zr(e,o);Yr(i,0,n,o)}else{var l=g(xt(e),4),s=l[0],c=l[1],u=l[2],d=l[3],p=(s+u)/2+o.scrollX,f=(c+d)/2+o.scrollY,h=(u-s)/2-(e.x-s),m=(d-c)/2-(e.y-c);n.save(),n.translate(p,f),n.rotate(e.angle),n.translate(-h,-m),Rr(e,t,n,o),n.restore()}break;case"rectangle":case"diamond":case"ellipse":case"line":case"arrow":case"image":case"text":if(Kr(e,a),r){var v=Zr(e,o);Yr(v,0,n,o)}else{var b=g(xt(e),4),y=b[0],x=b[1],w=b[2],k=b[3],S=(y+w)/2+o.scrollX,E=(x+k)/2+o.scrollY,C=(w-y)/2-(e.x-y),j=(k-x)/2-(e.y-x);n.save(),n.translate(S,E),n.rotate(e.angle),n.translate(-C,-j),Rr(e,t,n,o),n.restore()}break;default:throw new Error("Unimplemented type ".concat(e.type))}},qr=function(e,t,n){if(void 0===n)return e.draw(t);var r={sets:t.sets,shape:t.shape,options:Ar(Ar({},t.options),{},{fixedDecimalPlaceDigits:n})};return e.draw(r)},$r=function(e,t,n,r,o,a){var i=g(xt(e),4),l=i[0],s=i[1],c=i[2],u=i[3],p=(c-l)/2-(e.x-l),f=(u-s)/2-(e.y-s),h=180*e.angle/Math.PI,m=t.generator;switch(e.type){case"selection":throw new Error("Selection rendering is not supported for SVG");case"rectangle":case"diamond":case"ellipse":Kr(e,m);var v=qr(t,Ur(e),d.zK),b=e.opacity/100;1!==b&&(v.setAttribute("stroke-opacity","".concat(b)),v.setAttribute("fill-opacity","".concat(b))),v.setAttribute("stroke-linecap","round"),v.setAttribute("transform","translate(".concat(o||0," ").concat(a||0,") rotate(").concat(h," ").concat(p," ").concat(f,")")),n.appendChild(v);break;case"line":case"arrow":Kr(e,m);var y=n.ownerDocument.createElementNS(d.hR,"g"),x=e.opacity/100;y.setAttribute("stroke-linecap","round"),Ur(e).forEach((function(n){var r=qr(t,n,d.zK);1!==x&&(r.setAttribute("stroke-opacity","".concat(x)),r.setAttribute("fill-opacity","".concat(x))),r.setAttribute("transform","translate(".concat(o||0," ").concat(a||0,") rotate(").concat(h," ").concat(p," ").concat(f,")")),"line"===e.type&&ut(e.points)&&"transparent"!==e.backgroundColor&&r.setAttribute("fill-rule","evenodd"),y.appendChild(r)})),n.appendChild(y);break;case"freedraw":Jr(e);var w=e.opacity/100,k=n.ownerDocument.createElementNS(d.hR,"g");1!==w&&(k.setAttribute("stroke-opacity","".concat(w)),k.setAttribute("fill-opacity","".concat(w))),k.setAttribute("transform","translate(".concat(o||0," ").concat(a||0,") rotate(").concat(h," ").concat(p," ").concat(f,")"));var S=n.ownerDocument.createElementNS(d.hR,"path");k.setAttribute("stroke","none"),k.setAttribute("fill",e.strokeColor),S.setAttribute("d",eo(e)),k.appendChild(S),n.appendChild(k);break;case"image":var E=qe(e)&&r[e.fileId];if(E){var C="image-".concat(E.id),j=n.querySelector("#".concat(C));if(!j){(j=n.ownerDocument.createElementNS(d.hR,"symbol")).id=C;var O=n.ownerDocument.createElementNS(d.hR,"image");O.setAttribute("width","100%"),O.setAttribute("height","100%"),O.setAttribute("href",E.dataURL),j.appendChild(O),n.prepend(j)}var M=n.ownerDocument.createElementNS(d.hR,"use");M.setAttribute("href","#".concat(C)),M.setAttribute("width","".concat(Math.round(e.width))),M.setAttribute("height","".concat(Math.round(e.height))),M.setAttribute("transform","translate(".concat(o||0," ").concat(a||0,") rotate(").concat(h," ").concat(p," ").concat(f,")")),n.appendChild(M)}break;default:if(!Qe(e))throw new Error("Unimplemented type ".concat(e.type));var I=e.opacity/100,P=n.ownerDocument.createElementNS(d.hR,"g");1!==I&&(P.setAttribute("stroke-opacity","".concat(I)),P.setAttribute("fill-opacity","".concat(I))),P.setAttribute("transform","translate(".concat(o||0," ").concat(a||0,") rotate(").concat(h," ").concat(p," ").concat(f,")"));for(var T=e.text.replace(/\r\n?/g,"\n").split("\n"),A=e.height/T.length,L=e.height-e.baseline,_="center"===e.textAlign?e.width/2:"right"===e.textAlign?e.width:0,D=er(e.text)?"rtl":"ltr",z="center"===e.textAlign?"middle":"right"===e.textAlign||"rtl"===D?"end":"start",H=0;H<T.length;H++){var B=n.ownerDocument.createElementNS(d.hR,"text");B.textContent=T[H],B.setAttribute("x","".concat(_)),B.setAttribute("y","".concat((H+1)*A-L)),B.setAttribute("font-family",Rn(e)),B.setAttribute("font-size","".concat(e.fontSize,"px")),B.setAttribute("fill",e.strokeColor),B.setAttribute("text-anchor",z),B.setAttribute("style","white-space: pre;"),B.setAttribute("direction",D),P.appendChild(B)}n.appendChild(P)}},Qr=new WeakMap([]);function Jr(e){var t=eo(e),n=new Path2D(t);return Qr.set(e,n),n}function eo(e){return function(e){if(!e.length)return"";var t=e.length-1;return e.reduce((function(e,n,r,o){return r===t?e.push(n,to(n,o[0]),"L",o[0],"Z"):e.push(n,to(n,o[r+1])),e}),["M",e[0],"Q"]).join(" ").replace(no,"$1")}(Pr(e.simulatePressure?e.points:e.points.length?e.points.map((function(t,n){var r=g(t,2);return[r[0],r[1],e.pressures[n]]})):[[0,0,.5]],{simulatePressure:e.simulatePressure,size:4.25*e.strokeWidth,thinning:.6,smoothing:.5,streamline:.5,easing:function(e){return Math.sin(e*Math.PI/2)},last:!!e.lastCommittedPoint}))}function to(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}var no=/(\s?[A-Z]?,?-?[0-9]*\.[0-9]{0,2})(([0-9]|e|-)*)/g;var ro=function(e){return"string"==typeof e},oo=function(){function e(){z(this,e),this.callbacks=new Set,this.nonDeletedElements=[],this.elements=[],this.elementsMap=new Map}return B(e,[{key:"getElementsIncludingDeleted",value:function(){return this.elements}},{key:"getElements",value:function(){return this.nonDeletedElements}},{key:"getElement",value:function(e){return this.elementsMap.get(e)||null}},{key:"getNonDeletedElement",value:function(e){var t=this.getElement(e);return t&&rl(t)?t:null}},{key:"getNonDeletedElements",value:function(e){var t=this,n=[];return e.forEach((function(e){var r=t.getNonDeletedElement(e);null!=r&&n.push(r)})),n}},{key:"replaceAllElements",value:function(t){var n=this;this.elements=t,this.elementsMap.clear(),t.forEach((function(t){n.elementsMap.set(t.id,t),e.mapElementToScene(t,n)})),this.nonDeletedElements=nl(this.elements),this.informMutation()}},{key:"informMutation",value:function(){for(var e=0,t=Array.from(this.callbacks);e<t.length;e++){(0,t[e])()}}},{key:"addCallback",value:function(e){var t=this;if(this.callbacks.has(e))throw new Error;return this.callbacks.add(e),function(){if(!t.callbacks.has(e))throw new Error;t.callbacks.delete(e)}}},{key:"destroy",value:function(){var t=this;e.sceneMapById.forEach((function(n,r){n===t&&e.sceneMapById.delete(r)})),this.callbacks.clear()}}],[{key:"mapElementToScene",value:function(e,t){ro(e)?this.sceneMapById.set(e,t):this.sceneMapByElement.set(e,t)}},{key:"getScene",value:function(e){return ro(e)?this.sceneMapById.get(e)||null:this.sceneMapByElement.get(e)||null}}]),e}();oo.sceneMapByElement=new WeakMap,oo.sceneMapById=new Map;var ao=oo,io=new ae(Date.now()),lo=function(){return Math.floor(io.next()*Math.pow(2,31))},so=function(){return Xe()};function co(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function uo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?co(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):co(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var po=function(e,t){var n,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=!1,a=t,i=a.points,l=a.fileId;for(var s in void 0!==i&&(t=uo(uo({},gt(i)),t)),t){var c=t[s];if(void 0!==c){if(e[s]===c&&("object"!==L(c)||null===c||"groupIds"===s||"scale"===s))continue;if("scale"===s){var u=e[s],d=c;if(u[0]===d[0]&&u[1]===d[1])continue}else if("points"===s){var p=e[s],f=c;if(p.length===f.length){for(var h=!1,m=p.length;--m;){var g=p[m],v=f[m];if(g[0]!==v[0]||g[1]!==v[1]){h=!0;break}}if(!h)continue}}e[s]=c,o=!0}}if(!o)return e;(void 0===t.height&&void 0===t.width&&void 0===l&&void 0===i||Gr(e),e.version++,e.versionNonce=lo(),r)&&(null===(n=ao.getScene(e))||void 0===n||n.informMutation());return e},fo=function(e,t){var n=!1;for(var r in t){var o=t[r];if(void 0!==o){if(e[r]===o&&("object"!==L(o)||null===o))continue;n=!0}}return n?uo(uo(uo({},e),t),{},{version:e.version+1,versionNonce:lo()}):e},ho=function(e,t){return e.version=(null!=t?t:e.version)+1,e.versionNonce=lo(),e},mo=function(e){return tt(e)||Je(e)?e.points.length<2:0===e.width&&0===e.height},go=function(e,t,n){var r=Math.abs(t),o=Math.abs(n);if("line"===e||"arrow"===e||"freedraw"===e){var a=Math.round(Math.atan(o/r)/d.ay)*d.ay;0===a?n=0:a===Math.PI/2?t=0:n=Math.round(r*Math.tan(a))*Math.sign(n)||n}else"selection"!==e&&(n=r*Math.sign(n));return{width:t,height:n}},vo=function(e){var t={width:e.width,height:e.height,x:e.x,y:e.y};if(e.width<0){var n=Math.abs(e.width);t.width=n,t.x=e.x-n}if(e.height<0){var r=Math.abs(e.height);t.height=r,t.y=e.y-r}return t};function bo(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function yo(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return xo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xo(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}function xo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function wo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ko(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wo(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var So=function(e,t,n){var r=n.filter((function(t){return t.groupIds.includes(e)}));return r.length<2?t.selectedGroupIds[e]||t.editingGroupId===e?ko(ko({},t),{},{selectedGroupIds:ko(ko({},t.selectedGroupIds),{},D({},e,!1)),editingGroupId:null}):t:ko(ko({},t),{},{selectedGroupIds:ko(ko({},t.selectedGroupIds),{},D({},e,!0)),selectedElementIds:ko(ko({},t.selectedElementIds),Object.fromEntries(r.map((function(e){return[e.id,!0]}))))})},Eo=function(e,t){return null!=Co(e,t)},Co=function(e,t){return t.groupIds.filter((function(t){return t!==e.editingGroupId})).find((function(t){return e.selectedGroupIds[t]}))},jo=function(e){return Object.entries(e.selectedGroupIds).filter((function(e){var t=g(e,2);t[0];return t[1]})).map((function(e){var t=g(e,2),n=t[0];t[1];return n}))},Oo=function(e,t){var n=ko(ko({},e),{},{selectedGroupIds:{}}),r=dl(t,e);if(!r.length)return ko(ko({},n),{},{editingGroupId:null});var o,a=yo(r);try{for(a.s();!(o=a.n()).done;){var i=o.value.groupIds;if(e.editingGroupId){var l=i.indexOf(e.editingGroupId);l>-1&&(i=i.slice(0,l))}if(i.length>0){var s=i[i.length-1];n=So(s,n,t)}}}catch(e){a.e(e)}finally{a.f()}return n},Mo=function(e,t){return e.groupIds.includes(t)},Io=function(e,t){return e.filter((function(e){return Mo(e,t)}))},Po=function(e,t,n){var r=_(e),o=n?r.indexOf(n):-1,a=o>-1?o:r.length;return r.splice(a,0,t),r},To=["x","y","strokeColor","backgroundColor","fillStyle","strokeWidth","strokeStyle","roughness","opacity","width","height","angle","groupIds","strokeSharpness","boundElementIds"];function Ao(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Lo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ao(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ao(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var _o=function(e,t){var n,r,o=t.x,a=t.y,i=t.strokeColor,l=t.backgroundColor,s=t.fillStyle,c=t.strokeWidth,u=t.strokeStyle,d=t.roughness,p=t.opacity,f=t.width,h=void 0===f?0:f,m=t.height,g=void 0===m?0:m,v=t.angle,b=void 0===v?0:v,y=t.groupIds,x=void 0===y?[]:y,w=t.strokeSharpness,k=t.boundElementIds,S=void 0===k?null:k,E=bo(t,To);return{id:E.id||so(),type:e,x:o,y:a,width:h,height:g,angle:b,strokeColor:i,backgroundColor:l,fillStyle:s,strokeWidth:c,strokeStyle:u,roughness:d,opacity:p,groupIds:x,strokeSharpness:w,seed:null!==(n=E.seed)&&void 0!==n?n:lo(),version:E.version||1,versionNonce:null!==(r=E.versionNonce)&&void 0!==r?r:0,isDeleted:!1,boundElementIds:S}},Do=function(e){return _o(e.type,e)},zo=function(e,t){return{x:"center"===e.textAlign?t.width/2:"right"===e.textAlign?t.width:0,y:"middle"===e.verticalAlign?t.height/2:0}},Ho=function(e){var t=Vn(e.text,Fn(e)),n=zo(e,t);return fo(Lo(Lo({},_o("text",e)),{},{text:e.text,fontSize:e.fontSize,fontFamily:e.fontFamily,textAlign:e.textAlign,verticalAlign:e.verticalAlign,x:e.x-n.x,y:e.y-n.y,width:t.width,height:t.height,baseline:t.baseline}),{})},Bo=function(e,t){var n=t.text,r=t.isDeleted;return fo(e,Lo({text:n,isDeleted:null!=r?r:e.isDeleted},function(e,t){var n,r,o=Vn(t,Fn(e)),a=o.width,i=o.height,l=o.baseline,s=e.textAlign,c=e.verticalAlign;if("center"===s&&"middle"===c){var u=Vn(e.text,Fn(e)),d=zo(e,{width:a-u.width,height:i-u.height});n=e.x-d.x,r=e.y-d.y}else{var p=g(xt(e),4),f=p[0],h=p[1],m=p[2],v=p[3],b=g(Mt(e,a,i),4),y=(f-b[0])/2,x=(h-b[1])/2,w=(m-b[2])/2,k=(v-b[3])/2,S=g(st({s:!0,e:"center"===s||"left"===s,w:"center"===s||"right"===s},e.x,e.y,e.angle,y,x,w,k),2);n=S[0],r=S[1]}return{width:a,height:i,x:Number.isFinite(n)?n:e.x,y:Number.isFinite(r)?r:e.y,baseline:l}}(e,n)))},No=function(e){return Lo(Lo({},_o(e.type,e)),{},{points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:e.startArrowhead,endArrowhead:e.endArrowhead})},Ro=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(null==t||"object"!==L(t))return t;if("[object Object]"===Object.prototype.toString.call(t)){var r="function"==typeof t.constructor?Object.create(Object.getPrototypeOf(t)):{};for(var o in t)if(t.hasOwnProperty(o)){if(0===n&&("shape"===o||"canvas"===o))continue;r[o]=e(t[o],n+1)}return r}if(Array.isArray(t)){for(var a=t.length,i=new Array(a);a--;)i[a]=e(t[a],n+1);return i}return t},Fo=function(e,t,n,r){var o=Ro(n);return o.id=so(),o.seed=lo(),o.groupIds=function(e,t,n){for(var r=_(e),o=t?e.indexOf(t):-1,a=o>-1?o:e.length,i=0;i<a;i++)r[i]=n(r[i]);return r}(o.groupIds,e,(function(e){return t.has(e)||t.set(e,so()),t.get(e)})),r&&(o=Object.assign(o,r)),o},Vo={mouse:8,pen:16,touch:28},Uo={e:!0,s:!0,n:!0,w:!0},Go={e:!0,s:!0,n:!0,w:!0},Wo={e:!0,s:!0,n:!0,w:!0,nw:!0,se:!0},Ko={e:!0,s:!0,n:!0,w:!0,ne:!0,sw:!0},Zo=function(e,t,n,r,o,a,i){var l=g(it(e+n/2,t+r/2,o,a,i),2);return[l[0]-n/2,l[1]-r/2,n,r]},Yo=function(e,t,n,r){var o=g(e,4),a=o[0],i=o[1],l=o[2],s=o[3],c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},u=Vo[r],d=u/n.value,p=u/n.value,f=u/n.value,h=u/n.value,m=l-a,v=s-i,b=(a+l)/2,y=(i+s)/2,x=4/n.value,w=(u-8)/(2*n.value),k={nw:c.nw?void 0:Zo(a-x-f+w,i-x-h+w,d,p,b,y,t),ne:c.ne?void 0:Zo(l+x-w,i-x-h+w,d,p,b,y,t),sw:c.sw?void 0:Zo(a-x-f+w,s+x-w,d,p,b,y,t),se:c.se?void 0:Zo(l+x-w,s+x-w,d,p,b,y,t),rotation:c.rotation?void 0:Zo(a+m/2-d/2,i-x-h+w-16/n.value,d,p,b,y,t)},S=5*Vo.mouse/n.value;return Math.abs(m)>S&&(c.n||(k.n=Zo(a+m/2-d/2,i-x-h+w,d,p,b,y,t)),c.s||(k.s=Zo(a+m/2-d/2,s+x-w,d,p,b,y,t))),Math.abs(v)>S&&(c.w||(k.w=Zo(a-x-f+w,i+v/2-p/2,d,p,b,y,t)),c.e||(k.e=Zo(l+x-w,i+v/2-p/2,d,p,b,y,t))),k},Xo=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"mouse",r={};if("arrow"===e.type||"line"===e.type||"freedraw"===e.type){if(2===e.points.length){var o=g(e.points,2),a=o[1];0===a[0]||0===a[1]?r=Ko:a[0]>0&&a[1]<0?r=Wo:a[0]>0&&a[1]>0?r=Ko:a[0]<0&&a[1]>0?r=Wo:a[0]<0&&a[1]<0&&(r=Ko)}}else"text"===e.type&&(r=Go);return Yo(xt(e),e.angle,t,n,r)},qo=function(e,t){return[0,0,0,0,t,e,1,0]},$o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[0,0,0,0,0,0,0,0];if(t<0||t>7)throw new Error("Expected `index` betwen 0 and 7, got `".concat(t,"`"));return 0!==e&&(n[t]=e),n},Qo=function(e){return[e[0],e[1],e[2],e[3],-e[4],-e[5],-e[6],-e[7]]},Jo=function(e,t){return la(t)?[e[0]-t,e[1],e[2],e[3],e[4],e[5],e[6],e[7]]:[e[0]-t[0],e[1]-t[1],e[2]-t[2],e[3]-t[3],e[4]-t[4],e[5]-t[5],e[6]-t[6],e[7]-t[7]]},ea=function(e,t){return la(t)?[e[0]*t,e[1]*t,e[2]*t,e[3]*t,e[4]*t,e[5]*t,e[6]*t,e[7]*t]:[ta(e,t),t[1]*e[0]+t[0]*e[1]-t[4]*e[2]+t[5]*e[3]+t[2]*e[4]-t[3]*e[5]-t[7]*e[6]-t[6]*e[7],t[2]*e[0]+t[0]*e[2]-t[6]*e[3]+t[3]*e[6],t[3]*e[0]+t[6]*e[2]+t[0]*e[3]-t[2]*e[6],t[4]*e[0]+t[2]*e[1]-t[1]*e[2]+t[7]*e[3]+t[0]*e[4]+t[6]*e[5]-t[5]*e[6]+t[3]*e[7],t[5]*e[0]-t[3]*e[1]+t[7]*e[2]+t[1]*e[3]-t[6]*e[4]+t[0]*e[5]+t[4]*e[6]+t[2]*e[7],t[6]*e[0]+t[3]*e[2]-t[2]*e[3]+t[0]*e[6],t[7]*e[0]+t[6]*e[1]+t[5]*e[2]+t[4]*e[3]+t[3]*e[4]+t[2]*e[5]+t[1]*e[6]+t[0]*e[7]]},ta=function(e,t){return t[0]*e[0]+t[2]*e[2]+t[3]*e[3]-t[6]*e[6]},na=function(e,t){return[ra(e,t),e[1]*t[7]+e[4]*t[5]-e[5]*t[4]+e[7]*t[1],e[2]*t[7]-e[4]*t[6]+e[6]*t[4]+e[7]*t[2],e[3]*t[7]+e[5]*t[6]-e[6]*t[5]+e[7]*t[3],e[4]*t[7]+e[7]*t[4],e[5]*t[7]+e[7]*t[5],e[6]*t[7]+e[7]*t[6],e[7]*t[7]]},ra=function(e,t){return e[0]*t[7]+e[1]*t[6]+e[2]*t[5]+e[3]*t[4]+e[4]*t[3]+e[5]*t[2]+e[6]*t[1]+e[7]*t[0]},oa=function(e){return Math.sqrt(Math.abs(e[0]*e[0]-e[2]*e[2]-e[3]*e[3]+e[6]*e[6]))},aa=function(e){var t=oa(e);if(0===t||1===t)return e;var n=e[6]<0?-1:1;return ea(e,n/t)},ia=function(e){var t=function(e){return Math.sqrt(Math.abs(e[7]*e[7]-e[5]*e[5]-e[4]*e[4]+e[1]*e[1]))}(e);return 0===t||1===t?e:ea(e,1/t)},la=function(e){return"number"==typeof e},sa=($o(1,1),$o(1,2),$o(1,3),$o(1,4),$o(1,5),$o(1,6),$o(1,7),function(e,t,n){return aa([0,n,e,t,0,0,0,0])}),ca=function(e,t){return aa(na(t,e))},ua=function(e,t){return function(e,t){return[t[0]*e[0]+t[2]*e[2]+t[3]*e[3]-t[6]*e[6],t[1]*e[0]+t[0]*e[1]-t[4]*e[2]+t[5]*e[3]+t[2]*e[4]-t[3]*e[5]-t[7]*e[6]-t[6]*e[7],t[2]*e[0]+t[0]*e[2]-t[6]*e[3]+t[3]*e[6],t[3]*e[0]+t[6]*e[2]+t[0]*e[3]-t[2]*e[6],t[4]*e[0]+t[7]*e[3]+t[0]*e[4]+t[3]*e[7],t[5]*e[0]+t[7]*e[2]+t[0]*e[5]+t[2]*e[7],t[6]*e[0]+t[0]*e[6],t[7]*e[0]+t[0]*e[7]]}(e,t)},da=function(e){var t=g(e,2),n=t[0];return[0,0,0,0,t[1],n,1,0]},pa=function(e){return[e[5],e[4]]},fa=function(e,t){return aa(function(e,t){return[t[0]*e[0],t[1]*e[0]+t[0]*e[1],t[2]*e[0]+t[0]*e[2],t[3]*e[0]+t[0]*e[3],t[4]*e[0]+t[2]*e[1]-t[1]*e[2]+t[0]*e[4],t[5]*e[0]-t[3]*e[1]+t[1]*e[3]+t[0]*e[5],t[6]*e[0]+t[3]*e[2]-t[2]*e[3]+t[0]*e[6],t[7]*e[0]+t[6]*e[1]+t[5]*e[2]+t[4]*e[3]+t[3]*e[4]+t[2]*e[5]+t[1]*e[6]]}(e,t))},ha=function(e,t){return oa(na(e,t))},ma=function(e,t){return ra(e,t)},ga=function(e){return[0,0,0,0,e[4],e[5],0,0]},va=function(e,t){return function(e,t){return la(t)?[e[0]+t,e[1],e[2],e[3],e[4],e[5],e[6],e[7]]:[e[0]+t[0],e[1]+t[1],e[2]+t[2],e[3]+t[3],e[4]+t[4],e[5]+t[5],e[6]+t[6],e[7]+t[7]]}(ea(e,Math.sin(t/2)),Math.cos(t/2))},ba=function(e,t){return aa(ea(ea(e,t),Qo(e)))};function ya(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return xa(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xa(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}function xa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var wa=function(e,t,n,r){var o=10/t.zoom.value;return!ka(e,t,[n,r])&&Ea(e,[n,r],o)},ka=function(e,t,n){var r=10/t.zoom.value,o="text"===e.type?Ia:function(e){if("arrow"===e.type)return!1;if("freedraw"===e.type)return!0;var t="transparent"!==e.backgroundColor;return"line"===e.type?t&&ut(e.points):t||$e(e)}(e)?Pa:Ta;return Oa({element:e,point:n,threshold:r,check:o})},Sa=function(e,t){return e.selectedElementIds[t.id]},Ea=function(e,t,n){var r=g(t,2),o=r[0],a=r[1],i=g(xt(e),4),l=i[0],s=i[1],c=i[2],u=i[3],d=g(it(o,a,(l+c)/2,(s+u)/2,-e.angle),2),p=d[0],f=d[1];return p>l-n&&p<c+n&&f>s-n&&f<u+n},Ca=function(e,t){var n=t.x,r=t.y,o=ja(e,e.width,e.height);return Oa({element:e,point:[n,r],threshold:o,check:Aa})},ja=function(e,t,n){var r=("diamond"===e.type?1/Math.sqrt(2):1)*Math.min(t,n);return Math.max(16,Math.min(.25*r,32))},Oa=function(e){switch(e.element.type){case"rectangle":case"image":case"text":case"diamond":case"ellipse":var t=Ma(e.element,e.point);return e.check(t,e.threshold);case"freedraw":return!!e.check(La(e.element,e.point),e.threshold)&&Ha(e.element,e.point,e.threshold);case"arrow":case"line":return Ba(e);case"selection":return console.warn("This should not happen, we need to investigate why it does."),!1}},Ma=function(e,t){switch(e.type){case"rectangle":case"image":case"text":return La(e,t);case"diamond":return _a(e,t);case"ellipse":return Da(e,t)}},Ia=function(e,t){return e<0},Pa=function(e,t){return e<t},Ta=function(e,t){return Math.abs(e)<t},Aa=function(e,t){return 0<=e&&e<t},La=function(e,t){var n=g(Na(e,t),4),r=n[1],o=n[2],a=n[3];return Math.max(ma(r,sa(0,1,-a)),ma(r,sa(1,0,-o)))},_a=function(e,t){var n=g(Na(e,t),4),r=n[1],o=n[2],a=n[3],i=sa(a,o,-a*o);return ma(r,i)},Da=function(e,t){var n=g(za(e,t),2),r=n[0],o=n[1];return-function(e){return Math.sign(e[1])}(o)*ma(r,o)},za=function(e,t){var n=g(Na(e,t),4),r=n[1],o=n[2],a=n[3],i=g(pa(r),2),l=i[0],s=i[1],c=.707,u=.707,d=o,p=a;[0,1,2,3].forEach((function(e){var t=d*c,n=p*u,r=(d*d-p*p)*Math.pow(c,3)/d,o=(p*p-d*d)*Math.pow(u,3)/p,a=t-r,i=n-o,f=l-r,h=s-o,m=Math.hypot(i,a),g=Math.hypot(h,f);c=Math.min(1,Math.max(0,(f*m/g+r)/d)),u=Math.min(1,Math.max(0,(h*m/g+o)/p));var v=Math.hypot(u,c);c/=v,u/=v}));var f,h=qo(d*c,p*u);return[r,ua(ca(r,f=h),f)]},Ha=function(e,t,n){var r,o;if(0===e.angle)r=t[0]-e.x,o=t[1]-e.y;else{var a=g(xt(e),4),i=a[0],l=a[1],s=a[2],c=a[3],u=lt(t,[i+(s-i)/2,l+(c-l)/2],-e.angle);r=u[0]-e.x,o=u[1]-e.y}var d,p=g(e.points,2),f=p[0],h=p[1];if(ct(f[0],f[1],r,o)<n||ct(h[0],h[1],r,o)<n)return!0;for(var m=0;m<e.points.length;m++){var v=[h[0]-f[0],h[1]-f[1]],b=Math.hypot(v[1],v[0]),y=[v[0]/b,v[1]/b],x=[r-f[0],o-f[1]],w=(x[0]*y[0]+x[1]*y[1])/Math.hypot(y[1],y[0]);d=[f[0]+y[0]*w,f[1]+y[1]*w];var k=ct(d[0],d[1],f[0],f[1]),S=ct(d[0],d[1],h[0],h[1]);if(d=S<k&&k>b?h:k<S&&S>b?f:d,Math.hypot(o-d[1],r-d[0])<n)return!0;f=h,h=e.points[m+1]}return!1},Ba=function(e){var t=e.element,n=e.threshold;if(!Ur(t))return!1;var r=g(Na(e.element,e.point),4),o=r[0],a=r[1],i=r[2],l=r[3],s=sa(0,1,-l),c=sa(1,0,-i);if(!Pa(ma(a,s),n)||!Pa(ma(a,c),n))return!1;var u=g(pa(o),2),d=u[0],p=u[1],f=Ur(t);if(e.check===Pa&&f.some((function(e){return $a(e,d,p,t.strokeSharpness)})))return!0;return f.some((function(e){return Qa(e,d,p,n)}))},Na=function(e,t){var n,r=da(t),o=xt(e),a=Fa(o),i=va(a,e.angle),l=ba(i,r),s=function(e){return[0,0,0,0,Math.abs(e[4]),Math.abs(e[5]),1,0]}(Jo(l,ga(a))),c=(n=e.x,[0,0,0,0,e.y,n,0,0]),u=Jo(l,c),d=g(o,4),p=d[0],f=d[1];return[u,s,(d[2]-p)/2,(d[3]-f)/2]},Ra=function(e){var t=xt(e),n=Fa(t),r=va(n,e.angle),o=Qo(function(e){return[1,0,0,0,-.5*e[5],.5*e[4],0,0]}(ga(n)));return ea(o,r)},Fa=function(e){var t=g(e,4),n=t[0],r=t[1],o=t[2],a=t[3];return qo((n+o)/2,(r+a)/2)},Va=function(e,t,n){var r=Ra(e),o=ba(r,da(t)),a=ba(r,da(n)),i=ca(o,a),l=e.height/e.width,s=e.width/2,c=e.height/2,u=i[2],d=i[3],p=i[1],f=Math.abs(d),h=Math.abs(u);switch(e.type){case"rectangle":case"image":case"text":return p/(s*(h+l*f));case"diamond":return f<h?p/(h*s):p/(f*c);case"ellipse":return p/(s*Math.sqrt(Math.pow(u,2)+Math.pow(l,2)*Math.pow(d,2)))}},Ua=function(e,t,n){var r,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;switch(e.type){case"rectangle":case"image":case"text":case"diamond":var a=Ga(e);r=a.flatMap((function(e,n){var r=[e,a[(n+1)%4]];return Wa(t,Ka(r,o))})).concat(a.flatMap((function(e){return Ya(e,o,t)})));break;case"ellipse":r=Za(e,o,t)}if(r.length<2)return[];var i=r.sort((function(e,t){return ha(e,n)-ha(t,n)}));return[i[0],i[i.length-1]]},Ga=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=t*e.width/2,r=t*e.height/2;switch(e.type){case"rectangle":case"image":case"text":return[qo(n,r),qo(n,-r),qo(-n,-r),qo(-n,r)];case"diamond":return[qo(0,r),qo(n,0),qo(0,-r),qo(-n,0)]}},Wa=function(e,t){var n=g(t,2),r=n[0],o=n[1];return ma(r,e)*ma(o,e)>=0?[]:[fa(e,ca(r,o))]},Ka=function(e,t){var n=g(e,2),r=n[0],o=n[1],a=function(e,t){var n=.5*t;return[1,0,0,0,n*e[4],n*e[5],0,0]}(function(e,t){return ia([0,0,0,0,t[4]-e[4],t[5]-e[5],0,0])}(r,o),t);return[ba(a,r),ba(a,o)]},Za=function(e,t,n){var r=e.width/2+t,o=e.height/2+t,a=n[2],i=n[3],l=n[1],s=r*r*a*a+o*o*i*i,c=s-l*l;if(0===s||c<=0)return[];var u=Math.sqrt(c),d=-r*r*a*l,p=-o*o*i*l;return[qo((d+r*o*i*u)/s,(p-r*o*a*u)/s),qo((d-r*o*i*u)/s,(p+r*o*a*u)/s)]},Ya=function(e,t,n){if(0===t)return 0===ma(n,e)?[e]:[];var r=n[2],o=n[3],a=n[1],i=g(pa(e),2),l=i[0],s=i[1],c=r*r+o*o,u=t*t*c-Math.pow(r*l+o*s+a,2);if(0===c||u<=0)return[];var d=Math.sqrt(u),p=l*o*o-s*r*o-r*a,f=s*r*r-l*r*o-o*a;return[qo((p+o*d)/c,(f-r*d)/c),qo((p-o*d)/c,(f+r*d)/c)]},Xa=function(e,t,n){var r=Math.abs(t),o=e.width*r/2,a=e.height*r/2,i=Math.sign(t),l=g(pa(n),2),s=l[0],c=l[1],u=0===c?1e-4:c,d=Math.pow(s,2)*Math.pow(a,2)+Math.pow(u,2)*Math.pow(o,2),p=(-s*Math.pow(a,2)+i*u*Math.sqrt(Math.max(0,d-Math.pow(o,2)*Math.pow(a,2))))/d,f=(-p*s-1)/u,h=-Math.pow(o,2)*p/(Math.pow(f,2)*Math.pow(a,2)+Math.pow(p,2)*Math.pow(o,2));return qo(h,(-p*h-1)/f)},qa=function(e,t,n){var r=Math.abs(t),o=Math.sign(t),a=Ga(e,r),i=0,l=null;return a.forEach((function(e){var t=o*ca(n,e)[1];t>i&&(i=t,l=e)})),l},$a=function(e,t,n,r){var o,a=[],i=!1,l=ya(wt(e));try{for(l.s();!(o=l.n()).done;){var s=o.value;"move"===s.op?(i=!i)&&a.push([s.data[0],s.data[1]]):"bcurveTo"===s.op&&i&&(a.push([s.data[0],s.data[1]]),a.push([s.data[2],s.data[3]]),a.push([s.data[4],s.data[5]]))}}catch(e){l.e(e)}finally{l.f()}if(a.length>=4){if("sharp"===r)return dt(a,t,n);var c=Re(a,10,5);return dt(c,t,n)}return!1},Qa=function(e,t,n,r){var o=wt(e),a=[0,0];return o.some((function(e,o){var i=e.op,l=e.data;if("move"===i)a=l;else if("bcurveTo"===i){var s=[l[0],l[1]],c=[l[2],l[3]],u=[l[4],l[5]],d=a;return a=u,function(e,t,n,r,o,a){for(var i=g(o,2),l=i[0],s=i[1],c=function(o,a){return Math.pow(1-o,3)*r[a]+3*o*Math.pow(1-o,2)*n[a]+3*Math.pow(o,2)*(1-o)*t[a]+e[a]*Math.pow(o,3)},u=0;u<=1;){var d=c(u,0),p=c(u,1);if(Math.sqrt(Math.pow(d-l,2)+Math.pow(p-s,2))<a)return!0;u+=.01}return!1}(d,s,c,u,[t,n],r)}return!1}))},Ja=["rotation"],ei=function(e,t,n){return t>=e[0]&&t<=e[0]+e[2]&&n>=e[1]&&n<=e[1]+e[3]},ti=function(e,t,n,r,o,a){return e.reduce((function(e,i){if(e)return e;var l=function(e,t,n,r,o,a){if(!t.selectedElementIds[e.id])return!1;var i=Xo(e,o,a),l=i.rotation,s=bo(i,Ja);if(l&&ei(l,n,r))return"rotation";var c=Object.keys(s).filter((function(e){var t=s[e];return!!t&&ei(t,n,r)}));return c.length>0&&c[0]}(i,t,n,r,o,a);return l?{element:i,transformHandleType:l}:null}),null)},ni=function(e,t,n,r,o){var a=g(e,4),i=a[0],l=a[1],s=a[2],c=a[3],u=Yo([i,l,s,c],0,r,o,Uo);return Object.keys(u).find((function(e){var r=u[e];return r&&ei(r,t,n)}))||!1},ri=["ns","nesw","ew","nwse"],oi=function(e){var t=e.element,n=e.transformHandleType,r=t&&Math.sign(t.height)*Math.sign(t.width)==-1,o=null;switch(n){case"n":case"s":o="ns";break;case"w":case"e":o="ew";break;case"nw":case"se":o=r?"nesw":"nwse";break;case"ne":case"sw":o=r?"nwse":"nesw";break;case"rotation":return"grab"}return o&&t&&(o=function(e,t){var n=ri.indexOf(e);if(n>=0){var r=Math.round(t/(Math.PI/4));e=ri[(n+r)%ri.length]}return e}(o,t.angle)),o?"".concat(o,"-resize"):""};function ai(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ii(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ai(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ai(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var li=function(){function e(t,n){z(this,e),this.elementId=t.id,ao.mapElementToScene(this.elementId,n),e.normalizePoints(t),this.activePointIndex=null,this.lastUncommittedPoint=null,this.isDragging=!1,this.pointerOffset={x:0,y:0},this.startBindingElement="keep",this.endBindingElement="keep"}return B(e,null,[{key:"getElement",value:function(e){var t,n=null===(t=ao.getScene(e))||void 0===t?void 0:t.getNonDeletedElement(e);return n||null}},{key:"handlePointDragging",value:function(t,n,r,o,a){if(!t.editingLinearElement)return!1;var i=t.editingLinearElement,l=i.activePointIndex,s=i.elementId,c=i.isDragging,u=e.getElement(s);if(!u)return!1;if(null!=l&&l>-1){!1===c&&n({editingLinearElement:ii(ii({},i),{},{isDragging:!0})});var d=e.createPointAt(u,r-i.pointerOffset.x,o-i.pointerOffset.y,t.gridSize);return e.movePoint(u,l,d),rt(u)&&a(u,0===l?"start":"end"),!0}return!1}},{key:"handlePointerUp",value:function(t,n,r){var o=n.elementId,a=n.activePointIndex,i=n.isDragging,l=e.getElement(o);if(!l)return n;var s={};!i||0!==a&&a!==l.points.length-1||(ut(l.points,r.zoom.value)&&e.movePoint(l,a,0===a?l.points[l.points.length-1]:l.points[0]),s=D({},0===a?"startBindingElement":"endBindingElement",ci(r)?xi(tr(e.getPointAtIndexGlobalCoordinates(l,a)),ao.getScene(l)):null));return ii(ii(ii({},n),s),{},{isDragging:!1,pointerOffset:{x:0,y:0}})}},{key:"handlePointerDown",value:function(t,n,r,o,a){var i={didAddPoint:!1,hitElement:null};if(!n.editingLinearElement)return i;var l=n.editingLinearElement.elementId,s=e.getElement(l);if(!s)return i;if(t.altKey)return null==n.editingLinearElement.lastUncommittedPoint&&po(s,{points:[].concat(_(s.points),[e.createPointAt(s,a.x,a.y,n.gridSize)])}),o.resumeRecording(),r({editingLinearElement:ii(ii({},n.editingLinearElement),{},{activePointIndex:s.points.length-1,lastUncommittedPoint:null,endBindingElement:xi(a,ao.getScene(s))})}),i.didAddPoint=!0,i;var c=e.getPointIndexUnderCursor(s,n.zoom,a.x,a.y);if(c>-1)i.hitElement=s;else{var u=n.editingLinearElement,d=u.startBindingElement,p=u.endBindingElement;ci(n)&&rt(s)&&ui(s,d,p)}var f=g(xt(s),4),h=f[0],m=f[1],v=(h+f[2])/2,b=(m+f[3])/2,y=c>-1&&it(s.x+s.points[c][0],s.y+s.points[c][1],v,b,s.angle);return r({editingLinearElement:ii(ii({},n.editingLinearElement),{},{activePointIndex:c>-1?c:null,pointerOffset:y?{x:a.x-y[0],y:a.y-y[1]}:{x:0,y:0}})}),i}},{key:"handlePointerMove",value:function(t,n,r,o,a){var i=o.elementId,l=o.lastUncommittedPoint,s=e.getElement(i);if(!s)return o;var c=s.points,u=c[c.length-1];if(!t.altKey)return u===l&&e.movePoint(s,c.length-1,"delete"),ii(ii({},o),{},{lastUncommittedPoint:null});var d=e.createPointAt(s,n-o.pointerOffset.x,r-o.pointerOffset.y,a);return u===l?e.movePoint(s,s.points.length-1,d):e.movePoint(s,"new",d),ii(ii({},o),{},{lastUncommittedPoint:s.points[s.points.length-1]})}},{key:"getPointsGlobalCoordinates",value:function(e){var t=g(xt(e),4),n=t[0],r=t[1],o=t[2],a=t[3],i=(n+o)/2,l=(r+a)/2;return e.points.map((function(t){var n=e.x,r=e.y,o=g(it(n+t[0],r+t[1],i,l,e.angle),2);return[n=o[0],r=o[1]]}))}},{key:"getPointAtIndexGlobalCoordinates",value:function(e,t){var n=t<0?e.points.length+t:t,r=g(xt(e),4),o=r[0],a=r[1],i=(o+r[2])/2,l=(a+r[3])/2,s=e.points[n],c=e.x,u=e.y;return it(c+s[0],u+s[1],i,l,e.angle)}},{key:"pointFromAbsoluteCoords",value:function(e,t){var n=g(xt(e),4),r=n[0],o=n[1],a=(r+n[2])/2,i=(o+n[3])/2,l=g(it(t[0],t[1],a,i,-e.angle),2),s=l[0],c=l[1];return[s-e.x,c-e.y]}},{key:"getPointIndexUnderCursor",value:function(e,t,n,r){for(var o=this.getPointsGlobalCoordinates(e),a=o.length;--a>-1;){var i=o[a];if(ct(n,r,i[0],i[1])*t.value<this.POINT_HANDLE_SIZE/2+1)return a}return-1}},{key:"createPointAt",value:function(e,t,n,r){var o=mt(t,n,r),a=g(xt(e),4),i=a[0],l=a[1],s=(i+a[2])/2,c=(l+a[3])/2,u=g(it(o[0],o[1],s,c,-e.angle),2),d=u[0],p=u[1];return[d-e.x,p-e.y]}},{key:"getNormalizedPoints",value:function(e){var t=e.points,n=t[0][0],r=t[0][1];return{points:t.map((function(e,t){return[e[0]-n,e[1]-r]})),x:e.x+n,y:e.y+r}}},{key:"normalizePoints",value:function(t){po(t,e.getNormalizedPoints(t))}},{key:"movePointByOffset",value:function(t,n,r){var o=g(t.points[n],2),a=o[0],i=o[1];e.movePoint(t,n,[a+r.x,i+r.y])}},{key:"movePoint",value:function(e,t,n,r){var o,a=e.points,i=0,l=0;if("delete"===n){if("new"===t)throw new Error("invalid args in movePoint");(o=a.slice()).splice(t,1),0===t&&(i=o[0][0],l=o[0][1],o=o.map((function(e,t){return 0===t?[0,0]:[e[0]-i,e[1]-l]})))}else if("new"===t)o=[].concat(_(a),[n]);else{var s=n[0]-a[t][0],c=n[1]-a[t][1];o=a.map((function(e,n){return n===t?0===n?(i=s,l=c,e):(i=0,l=0,[e[0]+s,e[1]+c]):i||l?[e[0]-i,e[1]-l]:e}))}var u=It(e,o,e.strokeSharpness||"round"),d=It(e,a,e.strokeSharpness||"round"),p=(u[0]+u[2])/2,f=(u[1]+u[3])/2,h=(d[0]+d[2])/2,m=(d[1]+d[3])/2,g=it(i,l,h-p,m-f,e.angle);po(e,ii(ii({},r),{},{points:o,x:e.x+g[0],y:e.y+g[1]}))}}]),e}();function si(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}li.POINT_HANDLE_SIZE=20;var ci=function(e){return e.isBindingEnabled},ui=function(e,t,n){var r=new Set,o=new Set;di(e,t,n,"start",r,o),di(e,n,t,"end",r,o);var a=Array.from(o).filter((function(e){return!r.has(e)}));ao.getScene(e).getNonDeletedElements(a).forEach((function(t){var n;po(t,{boundElementIds:null===(n=t.boundElementIds)||void 0===n?void 0:n.filter((function(t){return t!==e.id}))})}))},di=function(e,t,n,r,o,a){if("keep"!==t)if(null!=t)null!=n&&("keep"===n?gi(e,t,r):"start"!==r&&n.id===t.id)||(mi(e,t,r),o.add(t.id));else{var i=yi(e,r);null!=i&&a.add(i)}},pi=function(e){e.forEach((function(e){rt(e)?ui(e,Mi(e,"start"),Mi(e,"end")):at(e)&&fi(e)}))},fi=function(e){Pi(e).forEach((function(t){var n=g(t,2),r=n[0],o=n[1];return ui(r,"end"===o?"keep":e,"start"===o?"keep":e)}))},hi=function(e,t,n,r){null!=t.startBoundElement&&mi(e,t.startBoundElement,"start");var o=xi(r,n);null==o||gi(e,o,"end")||mi(e,o,"end")},mi=function(e,t,n){var r;po(e,D({},"start"===n?"startBinding":"endBinding",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?si(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):si(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({elementId:t.id},wi(e,t,n)))),po(t,{boundElementIds:Array.from(new Set([].concat(_(null!==(r=t.boundElementIds)&&void 0!==r?r:[]),[e.id])))})},gi=function(e,t,n){var r=e["start"===n?"endBinding":"startBinding"];return vi(e,null==r?void 0:r.elementId,t)},vi=function(e,t,n){return t===n.id&&e.points.length<3},bi=function(e){e.forEach((function(e){rt(e)&&ui(e,null,null)}))},yi=function(e,t){var n="start"===t?"startBinding":"endBinding",r=e[n];return null==r?null:(po(e,D({},n,null)),r.elementId)},xi=function(e,t){return kl(t.getElements(),(function(t){return at(t)&&Ca(t,e)}))},wi=function(e,t,n){var r="start"===n?-1:1,o=-1===r?0:e.points.length-1,a=o-r,i=li.getPointAtIndexGlobalCoordinates(e,o),l=li.getPointAtIndexGlobalCoordinates(e,a);return{focus:Va(t,l,i),gap:Math.max(1,Ma(t,i))}},ki=function(e,t){var n,r=null!==(n=e.boundElementIds)&&void 0!==n?n:[];if(0!==r.length){var o=null!=t?t:{},a=o.newSize,i=o.simultaneouslyUpdated,l=Ei(i);ao.getScene(e).getNonDeletedElements(r).forEach((function(t){var n=e;if(Si(t,n)){var r=ji(n,t.startBinding,a),o=ji(n,t.endBinding,a);l.has(t.id)?po(t,{startBinding:r,endBinding:o}):(Ci(t,"start",r,e),Ci(t,"end",o,e))}}))}},Si=function(e,t){var n,r;return(null===(n=e.startBinding)||void 0===n?void 0:n.elementId)===t.id||(null===(r=e.endBinding)||void 0===r?void 0:r.elementId)===t.id},Ei=function(e){return new Set((e||[]).map((function(e){return e.id})))},Ci=function(e,t,n,r){if(!(null==n||n.elementId!==r.id&&e.points.length>2)){var o=ao.getScene(e).getElement(n.elementId);if(null!=o){var a,i="start"===t?-1:1,l=-1===i?0:e.points.length-1,s=l-i,c=li.getPointAtIndexGlobalCoordinates(e,s),u=function(e,t,n){if(0===t){var r=xt(e),o=Fa(r);return pa(o)}var a,i=Ra(e),l=ba(i,da(n)),s=Qo(i);switch(e.type){case"rectangle":case"image":case"text":case"diamond":a=qa(e,t,l);break;case"ellipse":a=Xa(e,t,l)}return pa(ba(s,a))}(o,n.focus,c);if(0===n.gap)a=u;else{var d=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=Ra(e),a=ba(o,da(t)),i=ba(o,da(n)),l=ca(a,i),s=Qo(o);return Ua(e,l,a,r).map((function(e){return pa(ba(s,e))}))}(o,c,u,n.gap);a=0===d.length?u:d[0]}li.movePoint(e,l,li.pointFromAbsoluteCoords(e,a),D({},"start"===t?"startBinding":"endBinding",n))}}},ji=function(e,t,n){if(null==t||null==n)return t;var r=t.gap,o=t.focus,a=t.elementId,i=n.width,l=n.height,s=e.width,c=e.height;return{elementId:a,gap:Math.max(1,Math.min(ja(e,i,l),r*(i<l?i/s:l/c))),focus:o}},Oi=function(e){return[Mi(e,"start"),Mi(e,"end")].filter((function(e){return null!=e}))},Mi=function(e,t){return xi(Ii(e,t),ao.getScene(e))},Ii=function(e,t){var n="start"===t?0:-1;return tr(li.getPointAtIndexGlobalCoordinates(e,n))},Pi=function(e){return ao.getScene(e).getElements().map((function(t){if(!rt(t))return null;var n=Ti(t,"start",e),r=Ti(t,"end",e);return n||r?[t,n&&r?"both":n?"start":"end",e]:null})).filter((function(e){return null!=e}))},Ti=function(e,t,n){return null==e["start"===t?"startBinding":"endBinding"]&&!gi(e,n,t)&&Ca(n,Ii(e,t))},Ai=function(e,t,n,r){var o=new Set,a=new Set,i="duplicatesServeAsOld"===r;t.forEach((function(e){var t=e.boundElementIds;if(null!=t&&t.length>0&&(t.forEach((function(e){i&&!n.has(e)&&o.add(e)})),a.add(n.get(e.id))),rt(e)){if(null!=e.startBinding){var r=e.startBinding.elementId;i&&!n.has(r)&&a.add(r)}if(null!=e.endBinding){var l=e.endBinding.elementId;i&&!n.has(l)&&a.add(l)}null==e.startBinding&&null==e.endBinding||o.add(n.get(e.id))}})),e.filter((function(e){var t=e.id;return o.has(t)})).forEach((function(e){var t=e.startBinding,r=e.endBinding;po(e,{startBinding:Li(t,n),endBinding:Li(r,n)})})),e.filter((function(e){var t=e.id;return a.has(t)})).forEach((function(e){var t=e.boundElementIds;null!=t&&t.length>0&&po(e,{boundElementIds:t.map((function(e){var t;return null!==(t=n.get(e))&&void 0!==t?t:e}))})}))},Li=function(e,t){var n;if(null==e)return null;var r=e.elementId;return{focus:e.focus,gap:e.gap,elementId:null!==(n=t.get(r))&&void 0!==n?n:r}},_i=function(e,t){var n=new Set(t.map((function(e){return e.id}))),r=new Set;t.forEach((function(e){var t;at(e)&&(null===(t=e.boundElementIds)||void 0===t||t.forEach((function(e){n.has(e)||r.add(e)})))})),e.filter((function(e){var t=e.id;return r.has(t)})).forEach((function(e){var t=e.startBinding,r=e.endBinding;po(e,{startBinding:Di(t,n),endBinding:Di(r,n)})}))},Di=function(e,t){return null==e||t.has(e.elementId)?null:e};function zi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Hi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zi(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Bi=function(e){return e>=2*Math.PI?e-2*Math.PI:e},Ni=function(e,t,n,r){var o=g(xt(e),4),a=o[0],i=o[1],l=(a+o[2])/2,s=(i+o[3])/2,c=5*Math.PI/2+Math.atan2(n-s,t-l);r&&(c+=d.ay/2,c-=c%d.ay),c=Bi(c),po(e,{angle:c})},Ri=function(e,t,n,r,o){var a=g(xt(e),4),i=a[0],l=a[1],s=a[2],c=a[3],u=g(it(r,o,(i+s)/2,(l+c)/2,-e.angle),2),d=u[0],p=u[1],f=g("end"===t?[d-e.x,p-e.y]:[e.x+e.points[1][0]-d,e.y+e.points[1][1]-p],2),h=f[0],m=f[1];if(n){var v=g(function(e,t,n,r){var o=go.apply(void 0,[e].concat(_(it(t,n,0,0,r))));return it(o.width,o.height,0,0,-r)}(e.type,h,m,e.angle),2);h=v[0],m=v[1]}var b=g(st("end"===t?{s:!0,e:!0}:{n:!0,w:!0},e.x,e.y,e.angle,0,0,(e.points[1][0]-h)/2,(e.points[1][1]-m)/2),2),y=b[0],x=b[1];po(e,{x:y,y:x,points:[[0,0],[h,m]]})},Fi=function(e,t,n){return tt(e)||Je(e)?{points:vt(0,t,vt(1,n,e.points))}:{}},Vi=function(e,t,n){var r=e.fontSize*(t/e.width);if(r<1)return null;var o=Vn(e.text,Fn({fontSize:r,fontFamily:e.fontFamily}));return{size:r,baseline:o.baseline+(n-o.height)}},Ui=function(e,t,n,r,o){var a,i=g(xt(e),4),l=i[0],s=i[1],c=i[2],u=i[3],d=g(it(r,o,(l+c)/2,(s+u)/2,-e.angle),2),p=d[0],f=d[1];switch(t){case"se":a=Math.max((p-l)/(c-l),(f-s)/(u-s));break;case"nw":a=Math.max((c-p)/(c-l),(u-f)/(u-s));break;case"ne":a=Math.max((p-l)/(c-l),(u-f)/(u-s));break;case"sw":a=Math.max((c-p)/(c-l),(f-s)/(u-s))}if(a>0){var h=e.width*a,m=e.height*a,v=Vi(e,h,m);if(null===v)return;var b=g(Mt(e,h,m),4),y=(l-b[0])/2,x=(s-b[1])/2,w=(c-b[2])/2,k=(u-b[3])/2,S=g(st(function(e,t){return{n:/^(n|ne|nw)$/.test(e)||t&&/^(s|se|sw)$/.test(e),s:/^(s|se|sw)$/.test(e)||t&&/^(n|ne|nw)$/.test(e),w:/^(w|nw|sw)$/.test(e)||t&&/^(e|ne|se)$/.test(e),e:/^(e|ne|se)$/.test(e)||t&&/^(w|nw|sw)$/.test(e)}}(t,n),e.x,e.y,e.angle,y,x,w,k),2),E=S[0],C=S[1];po(e,{fontSize:v.size,width:h,height:m,baseline:v.baseline,x:E,y:C})}},Gi=function(e,t,n,r,o,a,i){var l=g(Mt(e,e.width,e.height),4),s=[l[0],l[1]],c=[l[2],l[3]],u=function(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}(s,c),d=lt([a,i],u,-e.angle),p=g(Mt(n,n.width,n.height),4),f=p[0],h=p[1],m=p[2]-f,v=p[3]-h,b=(c[0]-s[0])/m,y=(c[1]-s[1])/v;r.includes("e")&&(b=(d[0]-s[0])/m),r.includes("s")&&(y=(d[1]-s[1])/v),r.includes("w")&&(b=(c[0]-d[0])/m),r.includes("n")&&(y=(c[1]-d[1])/v);var x=e.width,w=e.height,k=n.width*b,S=n.height*y;if(o&&(k=2*k-x,S=2*S-w),t){var E=Math.abs(k)/x,C=Math.abs(S)/w;if(1===r.length&&(S*=E,k*=C),2===r.length){var j=Math.max(E,C);k=x*j*Math.sign(k),S=w*j*Math.sign(S)}}var O=g(Mt(e,k,S),4),M=O[0],I=O[1],P=O[2]-M,T=O[3]-I,A=[].concat(s);if(["n","w","nw"].includes(r)&&(A=[c[0]-Math.abs(P),c[1]-Math.abs(T)]),"ne"===r){var L=[s[0],c[1]];A=[L[0],L[1]-Math.abs(T)]}if("sw"===r){var D=[c[0],s[1]];A=[D[0]-Math.abs(P),D[1]]}t&&(["s","n"].includes(r)&&(A[0]=u[0]-P/2),["e","w"].includes(r)&&(A[1]=u[1]-T/2)),k<0&&(r.includes("e")&&(A[0]-=Math.abs(P)),r.includes("w")&&(A[0]+=Math.abs(P))),S<0&&(r.includes("s")&&(A[1]-=Math.abs(T)),r.includes("n")&&(A[1]+=Math.abs(T))),o&&(A[0]=u[0]-Math.abs(P)/2,A[1]=u[1]-Math.abs(T)/2);var z=e.angle,H=lt(A,u,z),B=[A[0]+Math.abs(P)/2,A[1]+Math.abs(T)/2],N=lt(B,u,z);A=lt(H,N,-z);var R=Fi(e,k,S),F=_(A);F[0]+=e.x-M,F[1]+=e.y-I;var V=Hi({width:Math.abs(k),height:Math.abs(S),x:F[0],y:F[1]},R);"scale"in n&&"scale"in e&&po(n,{scale:[(Math.sign(b)||e.scale[0])*e.scale[0],(Math.sign(y)||e.scale[1])*e.scale[1]]}),0!==V.width&&0!==V.height&&Number.isFinite(V.x)&&Number.isFinite(V.y)&&(ki(n,{newSize:{width:V.width,height:V.height}}),po(n,V))},Wi=function(e,t,n,r){var o,a,i=g(Ot(e),4),l=i[0],s=i[1],c=i[2],u=i[3];switch(t){case"se":o=Math.max((n-l)/(c-l),(r-s)/(u-s)),a=function(e,t,n){var r=g(t,2),a=r[0],i=r[1],c=g(n,2),u=c[0],d=c[1];return{x:e.x+(a-l)*(o-1)+a-u,y:e.y+(i-s)*(o-1)+i-d}};break;case"nw":o=Math.max((c-n)/(c-l),(u-r)/(u-s)),a=function(e,t,n){var r=g(t,4),a=r[2],i=r[3],l=g(n,4),s=l[2],d=l[3];return{x:e.x-(c-a)*(o-1)+a-s,y:e.y-(u-i)*(o-1)+i-d}};break;case"ne":o=Math.max((n-l)/(c-l),(u-r)/(u-s)),a=function(e,t,n){var r=g(t,4),a=r[0],i=r[3],s=g(n,4),c=s[0],d=s[3];return{x:e.x+(a-l)*(o-1)+a-c,y:e.y-(u-i)*(o-1)+i-d}};break;case"sw":o=Math.max((c-n)/(c-l),(r-s)/(u-s)),a=function(e,t,n){var r=g(t,3),a=r[1],i=r[2],l=g(n,3),u=l[1],d=l[2];return{x:e.x-(c-i)*(o-1)+i-d,y:e.y+(a-s)*(o-1)+a-u}}}if(o>0){var d=e.reduce((function(t,n){if(!t)return t;var r=n.width*o,i=n.height*o,l={};if("text"===n.type){var s=Vi(n,r,i);if(null===s)return null;l={fontSize:s.size,baseline:s.baseline}}var c=xt(n),u=Fi(n,r,i);ki(n,{newSize:{width:r,height:i},simultaneouslyUpdated:e});var d=Mt(Hi(Hi({},n),u),r,i),p=a(n,c,d),f=p.x,h=p.y;return[].concat(_(t),[Hi(Hi({width:r,height:i,x:f,y:h},u),l)])}),[]);d&&e.forEach((function(e,t){po(e,d[t])}))}},Ki=function(e,t,n,r,o,a,i){var l=5*Math.PI/2+Math.atan2(r-i,n-a);o&&(l+=d.ay/2,l-=l%d.ay),t.forEach((function(t,n){var r,o,s=g(xt(t),4),c=s[0],u=s[1],d=(c+s[2])/2,p=(u+s[3])/2,f=null!==(r=null===(o=e.originalElements.get(t.id))||void 0===o?void 0:o.angle)&&void 0!==r?r:t.angle,h=g(it(d,p,a,i,l+f-t.angle),2),m=h[0],v=h[1];po(t,{x:t.x+(m-d),y:t.y+(v-p),angle:Bi(l+f)})}))},Zi=function(e,t,n,r,o,a,i,l,s,c,u){if(s)if(u)l=i/u;else{var d=go(t,i,a<r?-l:l);i=d.width,(l=d.height)<0&&(l=-l)}var p=o<n?n-i:n,f=a<r?r-l:r;c&&(p=n-(i+=i)/2,f=r-(l+=l)/2),0!==i&&0!==l&&po(e,{x:p,y:f,width:i,height:l})},Yi=function(e){return e.replace(/\t/g," ").replace(/\r?\n|\r/g,"\n")},Xi=function(e,t,n,r,o){var a=r.zoom,i=r.offsetTop,l=r.offsetLeft,s=180*n/Math.PI,c=(e-2*l)*(a.value-1)/2,u=(t-2*i)*(a.value-1)/2;return e>o&&1!==a.value&&(c=o/2*(a.value-1)),"translate(".concat(c,"px, ").concat(u,"px) scale(").concat(a.value,") rotate(").concat(s,"deg)")},qi=function(e){var t=Vn(e.text,Fn(e));po(e,{width:t.width,height:t.height,baseline:t.baseline})},$i=function(e,t){return Boolean(!e.viewModeEnabled&&(e.editingElement||dl(t,e).length||"selection"!==e.elementType))};function Qi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ji(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qi(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var el=function(e){return e.reduce((function(e,t){return e[t.id]=t,e}),{})},tl=function(e){return e.reduce((function(e,t){return e+t.version}),0)},nl=function(e){return e.filter((function(e){return!e.isDeleted}))},rl=function(e){return!e.isDeleted},ol=function(e){return nl(e).map((function(e){return nt(e.type)?Ji(Ji({},e),{},{lastCommittedPoint:null}):e}))},al=function(e){return ol(e)},il=function(e){return ol(e)},ll="rgba(0,0,0,0.3)",sl=function(e,t,n,r){var o=r.scrollX,a=r.scrollY,i=r.zoom;if(0===e.length)return{horizontal:null,vertical:null};var l=g(Ot(e),4),s=l[0],c=l[1],u=l[2],d=l[3],p=t/i.value,f=n/i.value,h=t-p,m=n-f,v={top:parseInt(Qn("sat")),bottom:parseInt(Qn("sab")),left:parseInt(Qn("sal")),right:parseInt(Qn("sar"))},b=O().rtl,y=h/2-o+v.left,x=m/2-a+v.top,w=y+p-v.right,k=x+f-v.bottom,S=Math.min(s,y),E=Math.min(c,x),C=Math.max(u,w),j=Math.max(d,k);return{horizontal:y===S&&w===C?null:{x:Math.max(v.left,4)+(y-S)/(C-S)*t,y:n-6-Math.max(4,v.bottom),width:(w-y)/(C-S)*t-Math.max(8,v.left+v.right),height:6},vertical:x===E&&k===j?null:{x:b?Math.max(v.left,4):t-6-Math.max(v.right,4),y:(x-E)/(j-E)*n+Math.max(v.top,4),width:6,height:(k-x)/(j-E)*n-Math.max(8,v.top+v.bottom)}}},cl=function(e,t,n){var r=g([e.horizontal,e.vertical].map((function(e){return null!=e&&e.x<=t&&t<=e.x+e.width&&e.y<=n&&n<=e.y+e.height})),2),o=r[0],a=r[1];return{isOverEither:o||a,isOverHorizontal:o,isOverVertical:a}},ul=function(e,t){return e.some((function(e){return t.selectedElementIds[e.id]}))},dl=function(e,t){return e.filter((function(e){return t.selectedElementIds[e.id]}))},pl=function(e,t){return t.editingElement?[t.editingElement]:dl(e,t)},fl=function(e){var t=e.scenePoint,n=e.viewportDimensions,r=e.zoom;return{scrollX:n.width/2*(1/r.value)-t.x-r.translation.x*(1/r.value),scrollY:n.height/2*(1/r.value)-t.y-r.translation.y*(1/r.value)}},hl=function(e,t,n){if(!(e=function(e){return e.filter((function(e){return!e.isDeleted&&!mo(e)}))}(e)).length)return{scrollX:0,scrollY:0};var r=g(Ot(e),4),o=r[0],a=r[1],i=r[2],l=r[3];if(function(e,t,n){var r=g(n,4),o=r[0],a=r[1],i=r[2],l=r[3],s=$n({sceneX:o,sceneY:a},e),c=s.x,u=s.y,d=$n({sceneX:i,sceneY:l},e),p=d.x,f=d.y;return p-c>e.width||f-u>e.height}(t,0,[o,a,i,l])){var s=function(e,t){if(!e.length)return[0,0,0,0];var n=1/0,r=e[0];return e.forEach((function(e){var o=g(jt(e),4),a=o[0],i=o[1],l=o[2],s=o[3],c=ct((a+l)/2,(i+s)/2,t.x,t.y);c<n&&(n=c,r=e)})),jt(r)}(e,qn({clientX:t.scrollX,clientY:t.scrollY},t)),c=g(s,4);o=c[0],a=c[1],i=c[2],l=c[3]}return fl({scenePoint:{x:(o+i)/2,y:(a+l)/2},viewportDimensions:{width:t.width,height:t.height},zoom:t.zoom})},ml=function(e){return"rectangle"===e||"ellipse"===e||"diamond"===e||"line"===e},gl=function(e){return"image"!==e},vl=function(e){return"rectangle"===e||"ellipse"===e||"diamond"===e||"freedraw"===e||"arrow"===e||"line"===e},bl=function(e){return"rectangle"===e||"ellipse"===e||"diamond"===e||"arrow"===e||"line"===e},yl=function(e){return"rectangle"===e||"arrow"===e||"line"===e},xl=function(e){return"text"===e},wl=function(e){return"arrow"===e},kl=function(e,t){for(var n=null,r=e.length-1;r>=0;--r){var o=e[r];if(!o.isDeleted&&t(o)){n=o;break}}return n},Sl=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{x:0,y:0};return{value:e,translation:{x:r.x-n.left-(r.x-n.left-t.translation.x)*(e/t.value),y:r.y-n.top-(r.y-n.top-t.translation.y)*(e/t.value)}}},El=function(e){var t=parseFloat(e.toFixed(2));return Math.max(.1,Math.min(t,10))};n(5422);function Cl(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function jl(e,t,n){return(jl=Cl()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&R(o,n.prototype),o}).apply(null,arguments)}function Ol(e){var t="function"==typeof Map?new Map:void 0;return(Ol=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return jl(e,arguments,U(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),R(r,e)})(e)}function Ml(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=U(e);if(t){var o=U(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return V(this,n)}}var Il=function(e){F(n,e);var t=Ml(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Couldn't export canvas.",o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"CANVAS_ERROR";return z(this,n),(e=t.call(this)).name=o,e.message=r,e}return n}(Ol(Error)),Pl=function(e){F(n,e);var t=Ml(n);function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Request Aborted";return z(this,n),t.call(this,e,"AbortError")}return n}(Ol(DOMException)),Tl=(n(371),function(e){var t=e.size,n=void 0===t?"1em":t,r=e.circleWidth,o=void 0===r?8:r;return(0,P.jsx)("div",{className:"Spinner",children:(0,P.jsx)("svg",{viewBox:"0 0 100 100",style:{width:n,height:n},children:(0,P.jsx)("circle",{cx:"50",cy:"50",r:50-o/2,strokeWidth:o,fill:"none",strokeMiterlimit:"10"})})})}),Al=u().forwardRef((function(e,t){var n=Dh().id,r=u().useRef(null);u().useImperativeHandle(t,(function(){return r.current}));var o="ToolIcon_size_".concat(e.size),a=g((0,c.useState)(!1),2),i=a[0],l=a[1],s=(0,c.useRef)(!0),d=function(){var t=(0,f.Z)(b().mark((function t(n){var r,o;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(o="onClick"in e&&(null===(r=e.onClick)||void 0===r?void 0:r.call(e,n)))||!("then"in o)){t.next=15;break}return t.prev=2,l(!0),t.next=6,o;case 6:t.next=12;break;case 8:if(t.prev=8,t.t0=t.catch(2),t.t0 instanceof Pl){t.next=12;break}throw t.t0;case 12:return t.prev=12,s.current&&l(!1),t.finish(12);case 15:case"end":return t.stop()}}),t,null,[[2,8,12,15]])})));return function(e){return t.apply(this,arguments)}}();(0,c.useEffect)((function(){return function(){s.current=!1}}),[]);var p=(0,c.useRef)(null);return"button"===e.type||"icon"===e.type?(0,P.jsxs)("button",{className:Ye("ToolIcon_type_button",o,e.className,e.visible&&!e.hidden?"ToolIcon_type_button--show":"ToolIcon_type_button--hide",{ToolIcon:!e.hidden,"ToolIcon--selected":e.selected,"ToolIcon--plain":"icon"===e.type}),"data-testid":e["data-testid"],hidden:e.hidden,title:e.title,"aria-label":e["aria-label"],type:"button",onClick:d,ref:r,disabled:i,children:[(e.icon||e.label)&&(0,P.jsxs)("div",{className:"ToolIcon__icon","aria-hidden":"true",children:[e.icon||e.label,e.keyBindingLabel&&(0,P.jsx)("span",{className:"ToolIcon__keybinding",children:e.keyBindingLabel})]}),e.showAriaLabel&&(0,P.jsxs)("div",{className:"ToolIcon__label",children:[e["aria-label"]," ",i&&(0,P.jsx)(Tl,{})]}),e.children]}):(0,P.jsxs)("label",{className:Ye("ToolIcon",e.className),title:e.title,onPointerDown:function(e){p.current=e.pointerType||null},onPointerUp:function(){requestAnimationFrame((function(){p.current=null}))},children:[(0,P.jsx)("input",{className:"ToolIcon_type_radio ".concat(o),type:"radio",name:e.name,"aria-label":e["aria-label"],"aria-keyshortcuts":e["aria-keyshortcuts"],"data-testid":e["data-testid"],id:"".concat(n,"-").concat(e.id),onChange:function(){var t;null===(t=e.onChange)||void 0===t||t.call(e,{pointerType:p.current})},checked:e.checked,ref:r}),(0,P.jsxs)("div",{className:"ToolIcon__icon",children:[e.icon,e.keyBindingLabel&&(0,P.jsx)("span",{className:"ToolIcon__keybinding",children:e.keyBindingLabel})]})]})}));Al.defaultProps={visible:!0,className:"",size:"medium"};var Ll=function(e){return e===d.C6.LIGHT?Pt.orange[4]:Pt.orange[9]},_l=function(e){return e===d.C6.LIGHT?Pt.black:Pt.gray[4]},Dl=function(e){return e===d.C6.LIGHT?Pt.white:"#1e1e1e"},zl=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:512,n="number"==typeof t?{width:t}:t,r=n.width,o=void 0===r?512:r,a=n.height,i=void 0===a?o:a,l=n.mirror,s=n.style;return(0,P.jsx)("svg",{"aria-hidden":"true",focusable:"false",role:"img",viewBox:"0 0 ".concat(o," ").concat(i),className:Ye({"rtl-mirror":l}),style:s,children:"string"==typeof e?(0,P.jsx)("path",{fill:"currentColor",d:e}):e})},Hl=zl((0,P.jsx)("polyline",{fill:"none",stroke:"currentColor",points:"20 6 9 17 4 12"}),{width:24,height:24}),Bl=zl("M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z",{mirror:!0}),Nl=zl("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",{width:448,height:512}),Rl=zl("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",{width:448,height:512}),Fl=zl("M572.694 292.093L500.27 416.248A63.997 63.997 0 0 1 444.989 448H45.025c-18.523 0-30.064-20.093-20.731-36.093l72.424-124.155A64 64 0 0 1 152 256h399.964c18.523 0 30.064 20.093 20.73 36.093zM152 224h328v-48c0-26.51-21.49-48-48-48H272l-64-64H48C21.49 64 0 85.49 0 112v278.046l69.077-118.418C86.214 242.25 117.989 224 152 224z",{width:576,height:512,mirror:!0}),Vl=zl("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",{width:384,height:512}),Ul=zl("M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z",{width:448,height:512}),Gl=zl("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"),Wl=zl("M384 121.9c0-6.3-2.5-12.4-7-16.9L279.1 7c-4.5-4.5-10.6-7-17-7H256v128h128zM571 308l-95.7-96.4c-10.1-10.1-27.4-3-27.4 11.3V288h-64v64h64v65.2c0 14.3 17.3 21.4 27.4 11.3L571 332c6.6-6.6 6.6-17.4 0-24zm-379 28v-32c0-8.8 7.2-16 16-16h176V160H248c-13.2 0-24-10.8-24-24V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V352H208c-8.8 0-16-7.2-16-16z",{width:576,height:512,mirror:!0}),Kl=zl((0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("path",{d:"M571 308l-95.7-96.4c-10.1-10.1-27.4-3-27.4 11.3V288h-64v64h64v65.2c0 14.3 17.3 21.4 27.4 11.3L571 332c6.6-6.6 6.6-17.4 0-24zm-187 44v-64 64z"}),(0,P.jsx)("path",{d:"M384 121.941V128H256V0h6.059c6.362 0 12.471 2.53 16.97 7.029l97.941 97.941a24.01 24.01 0 017.03 16.971zM248 160c-13.2 0-24-10.8-24-24V0H24C10.745 0 0 10.745 0 24v464c0 13.255 10.745 24 24 24h336c13.255 0 24-10.745 24-24V160H248zm-135.455 16c26.51 0 48 21.49 48 48s-21.49 48-48 48-48-21.49-48-48 21.491-48 48-48zm208 240h-256l.485-48.485L104.545 328c4.686-4.686 11.799-4.201 16.485.485L160.545 368 264.06 264.485c4.686-4.686 12.284-4.686 16.971 0L320.545 304v112z"})]}),{width:576,height:512,mirror:!0}),Zl=zl("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",{width:512,height:512}),Yl=zl("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",{width:448,height:512}),Xl=zl("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",{width:448,height:512}),ql=zl("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"),$l=zl("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"),Ql=zl("M255.545 8c-66.269.119-126.438 26.233-170.86 68.685L48.971 40.971C33.851 25.851 8 36.559 8 57.941V192c0 13.255 10.745 24 24 24h134.059c21.382 0 32.09-25.851 16.971-40.971l-41.75-41.75c30.864-28.899 70.801-44.907 113.23-45.273 92.398-.798 170.283 73.977 169.484 169.442C423.236 348.009 349.816 424 256 424c-41.127 0-79.997-14.678-110.63-41.556-4.743-4.161-11.906-3.908-16.368.553L89.34 422.659c-4.872 4.872-4.631 12.815.482 17.433C133.798 479.813 192.074 504 256 504c136.966 0 247.999-111.033 248-247.998C504.001 119.193 392.354 7.755 255.545 8z",{mirror:!0}),Jl=zl("M256.455 8c66.269.119 126.437 26.233 170.859 68.685l35.715-35.715C478.149 25.851 504 36.559 504 57.941V192c0 13.255-10.745 24-24 24H345.941c-21.382 0-32.09-25.851-16.971-40.971l41.75-41.75c-30.864-28.899-70.801-44.907-113.23-45.273-92.398-.798-170.283 73.977-169.484 169.442C88.764 348.009 162.184 424 256 424c41.127 0 79.997-14.678 110.629-41.556 4.743-4.161 11.906-3.908 16.368.553l39.662 39.662c4.872 4.872 4.631 12.815-.482 17.433C378.202 479.813 319.926 504 256 504 119.034 504 8.001 392.967 8 256.002 7.999 119.193 119.646 7.755 256.455 8z",{mirror:!0}),es=zl("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",{mirror:!0}),ts=(zl("M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92 1.61 0 2.92-1.31 2.92-2.92s-1.31-2.92-2.92-2.92z",{width:24,height:24}),zl("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",{width:24,height:24}),zl((0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("path",{stroke:"currentColor",fill:"currentColor",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"}),(0,P.jsx)("path",{stroke:"currentColor",fill:"currentColor",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"})]}),{width:64,height:64}),zl((0,P.jsx)("path",{stroke:"currentColor",strokeWidth:"40",fill:"currentColor",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"}),{width:1024}),u().memo((function(e){var t=e.theme;return zl((0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("path",{d:"M22 9.556C22 8.696 21.303 8 20.444 8H16v8H8v4.444C8 21.304 8.697 22 9.556 22h10.888c.86 0 1.556-.697 1.556-1.556V9.556z",fill:_l(t),stroke:_l(t),strokeWidth:"2"}),(0,P.jsx)("path",{d:"M16 3.556C16 2.696 15.303 2 14.444 2H3.556C2.696 2 2 2.697 2 3.556v10.888C2 15.304 2.697 16 3.556 16h10.888c.86 0 1.556-.697 1.556-1.556V3.556z",fill:Ll(t),stroke:Ll(t),strokeWidth:"2"})]}),{width:24,mirror:!0})}))),ns=u().memo((function(e){var t=e.theme;return zl((0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("path",{d:"M16 3.556C16 2.696 15.303 2 14.444 2H3.556C2.696 2 2 2.697 2 3.556v10.888C2 15.304 2.697 16 3.556 16h10.888c.86 0 1.556-.697 1.556-1.556V3.556z",fill:Ll(t),stroke:Ll(t),strokeWidth:"2"}),(0,P.jsx)("path",{d:"M22 9.556C22 8.696 21.303 8 20.444 8H9.556C8.696 8 8 8.697 8 9.556v10.888C8 21.304 8.697 22 9.556 22h10.888c.86 0 1.556-.697 1.556-1.556V9.556z",fill:_l(t),stroke:_l(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),rs=u().memo((function(e){var t=e.theme;return zl((0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("path",{d:"M13 21a1 1 0 001 1h7a1 1 0 001-1v-7a1 1 0 00-1-1h-3v5h-5v3zM11 3a1 1 0 00-1-1H3a1 1 0 00-1 1v7a1 1 0 001 1h3V6h5V3z",fill:_l(t),stroke:_l(t),strokeWidth:"2"}),(0,P.jsx)("path",{d:"M18 7.333C18 6.597 17.403 6 16.667 6H7.333C6.597 6 6 6.597 6 7.333v9.334C6 17.403 6.597 18 7.333 18h9.334c.736 0 1.333-.597 1.333-1.333V7.333z",fill:Ll(t),stroke:Ll(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),os=u().memo((function(e){var t=e.theme;return zl((0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("path",{d:"M18 7.333C18 6.597 17.403 6 16.667 6H7.333C6.597 6 6 6.597 6 7.333v9.334C6 17.403 6.597 18 7.333 18h9.334c.736 0 1.333-.597 1.333-1.333V7.333z",fill:Ll(t),stroke:Ll(t),strokeWidth:"2"}),(0,P.jsx)("path",{d:"M11 3a1 1 0 00-1-1H3a1 1 0 00-1 1v7a1 1 0 001 1h8V3zM22 14a1 1 0 00-1-1h-7a1 1 0 00-1 1v7a1 1 0 001 1h8v-8z",fill:_l(t),stroke:_l(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),as=u().memo((function(e){var t=e.theme;return zl((0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("path",{d:"M 2,5 H 22",fill:_l(t),stroke:_l(t),strokeWidth:"2",strokeLinecap:"round"}),(0,P.jsx)("path",{d:"M 6,7 C 5.446,7 5,7.446 5,8 v 9.999992 c 0,0.554 0.446,1 1,1 h 3.0000001 c 0.554,0 0.9999999,-0.446 0.9999999,-1 V 8 C 10,7.446 9.5540001,7 9.0000001,7 Z m 9,0 c -0.554,0 -1,0.446 -1,1 v 5.999992 c 0,0.554 0.446,1 1,1 h 3 c 0.554,0 1,-0.446 1,-1 V 8 C 19,7.446 18.554,7 18,7 Z",fill:Ll(t),stroke:Ll(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),is=u().memo((function(e){var t=e.theme;return zl((0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("path",{d:"M 2,19 H 22",fill:_l(t),stroke:_l(t),strokeWidth:"2",strokeLinecap:"round"}),(0,P.jsx)("path",{d:"m 6,16.999992 c -0.554,0 -1,-0.446 -1,-1 V 6 C 5,5.446 5.446,5 6,5 H 9.0000001 C 9.5540001,5 10,5.446 10,6 v 9.999992 c 0,0.554 -0.4459999,1 -0.9999999,1 z m 9,0 c -0.554,0 -1,-0.446 -1,-1 V 10 c 0,-0.554 0.446,-1 1,-1 h 3 c 0.554,0 1,0.446 1,1 v 5.999992 c 0,0.554 -0.446,1 -1,1 z",fill:Ll(t),stroke:Ll(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),ls=u().memo((function(e){var t=e.theme;return zl((0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("path",{d:"M 5,2 V 22",fill:_l(t),stroke:_l(t),strokeWidth:"2",strokeLinecap:"round"}),(0,P.jsx)("path",{d:"m 7.000004,5.999996 c 0,-0.554 0.446,-1 1,-1 h 9.999992 c 0.554,0 1,0.446 1,1 v 3.0000001 c 0,0.554 -0.446,0.9999999 -1,0.9999999 H 8.000004 c -0.554,0 -1,-0.4459999 -1,-0.9999999 z m 0,9 c 0,-0.554 0.446,-1 1,-1 h 5.999992 c 0.554,0 1,0.446 1,1 v 3 c 0,0.554 -0.446,1 -1,1 H 8.000004 c -0.554,0 -1,-0.446 -1,-1 z",fill:Ll(t),stroke:Ll(t),strokeWidth:"2"})]}),{width:24})})),ss=u().memo((function(e){var t=e.theme;return zl((0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("path",{d:"M 19,2 V 22",fill:_l(t),stroke:_l(t),strokeWidth:"2",strokeLinecap:"round"}),(0,P.jsx)("path",{d:"m 16.999996,5.999996 c 0,-0.554 -0.446,-1 -1,-1 H 6.000004 c -0.554,0 -1,0.446 -1,1 v 3.0000001 c 0,0.554 0.446,0.9999999 1,0.9999999 h 9.999992 c 0.554,0 1,-0.4459999 1,-0.9999999 z m 0,9 c 0,-0.554 -0.446,-1 -1,-1 h -5.999992 c -0.554,0 -1,0.446 -1,1 v 3 c 0,0.554 0.446,1 1,1 h 5.999992 c 0.554,0 1,-0.446 1,-1 z",fill:Ll(t),stroke:Ll(t),strokeWidth:"2"})]}),{width:24})})),cs=u().memo((function(e){var t=e.theme;return zl((0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("path",{d:"M19 5V19M5 5V19",stroke:_l(t),strokeWidth:"2",strokeLinecap:"round"}),(0,P.jsx)("path",{d:"M15 9C15.554 9 16 9.446 16 10V14C16 14.554 15.554 15 15 15H9C8.446 15 8 14.554 8 14V10C8 9.446 8.446 9 9 9H15Z",fill:Ll(t),stroke:Ll(t),strokeWidth:"2"})]}),{width:24})})),us=u().memo((function(e){var t=e.theme;return zl((0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("path",{d:"M5 5L19 5M5 19H19",fill:_l(t),stroke:_l(t),strokeWidth:"2",strokeLinecap:"round"}),(0,P.jsx)("path",{d:"M15 9C15.554 9 16 9.446 16 10V14C16 14.554 15.554 15 15 15H9C8.446 15 8 14.554 8 14V10C8 9.446 8.446 9 9 9H15Z",fill:Ll(t),stroke:Ll(t),strokeWidth:"2"})]}),{width:24})})),ds=u().memo((function(e){var t=e.theme;return zl((0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("path",{d:"m 5.000004,16.999996 c 0,0.554 0.446,1 1,1 h 3 c 0.554,0 1,-0.446 1,-1 v -10 c 0,-0.554 -0.446,-1 -1,-1 h -3 c -0.554,0 -1,0.446 -1,1 z m 9,-2 c 0,0.554 0.446,1 1,1 h 3 c 0.554,0 1,-0.446 1,-1 v -6 c 0,-0.554 -0.446,-1 -1,-1 h -3 c -0.554,0 -1,0.446 -1,1 z",fill:Ll(t),stroke:Ll(t),strokeWidth:"2"}),(0,P.jsx)("path",{d:"M 2,12 H 22",fill:_l(t),stroke:_l(t),strokeWidth:"2",strokeDasharray:"1, 2.8",strokeLinecap:"round"})]}),{width:24,mirror:!0})})),ps=u().memo((function(e){var t=e.theme;return zl((0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("path",{d:"M 7 5 C 6.446 5 6 5.446 6 6 L 6 9 C 6 9.554 6.446 10 7 10 L 17 10 C 17.554 10 18 9.554 18 9 L 18 6 C 18 5.446 17.554 5 17 5 L 7 5 z M 9 14 C 8.446 14 8 14.446 8 15 L 8 18 C 8 18.554 8.446 19 9 19 L 15 19 C 15.554 19 16 18.554 16 18 L 16 15 C 16 14.446 15.554 14 15 14 L 9 14 z ",fill:Ll(t),stroke:Ll(t),strokeWidth:"2"}),(0,P.jsx)("path",{d:"M 12,2 V 22",fill:_l(t),stroke:_l(t),strokeWidth:"2",strokeDasharray:"1, 2.8",strokeLinecap:"round"})]}),{width:24})})),fs=zl("M192 256c61.9 0 112-50.1 112-112S253.9 32 192 32 80 82.1 80 144s50.1 112 112 112zm76.8 32h-8.3c-20.8 10-43.9 16-68.5 16s-47.6-6-68.5-16h-8.3C51.6 288 0 339.6 0 403.2V432c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48v-28.8c0-63.6-51.6-115.2-115.2-115.2zM480 256c53 0 96-43 96-96s-43-96-96-96-96 43-96 96 43 96 96 96zm48 32h-3.8c-13.9 4.8-28.6 8-44.2 8s-30.3-3.2-44.2-8H432c-20.4 0-39.2 5.9-55.7 15.4 24.4 26.3 39.7 61.2 39.7 99.8v38.4c0 2.2-.5 4.3-.6 6.4H592c26.5 0 48-21.5 48-48 0-61.9-50.1-112-112-112z",{width:640,height:512,mirror:!0}),hs=(zl("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"),zl("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"),zl("M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z",{width:352,height:512})),ms=zl("M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z",{width:320,height:512,style:{marginLeft:"-0.2rem"},mirror:!0}),gs=zl("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",{mirror:!0}),vs=(zl("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",{width:24}),zl("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",{width:384,height:512})),bs=u().memo((function(e){var t=e.theme;return zl((0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("path",{d:"M25 26H111V111H25",fill:_l(t)}),(0,P.jsx)("path",{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",stroke:_l(t),strokeWidth:"2"}),(0,P.jsx)("path",{d:"M100 100H160V160H100",fill:_l(t)}),(0,P.jsx)("path",{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",stroke:_l(t),strokeWidth:"2"}),(0,P.jsxs)("g",{fill:Dl(t),stroke:_l(t),strokeWidth:"6",children:[(0,P.jsx)("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),(0,P.jsx)("rect",{x:"2.5",y:"149.5",width:"30",height:"30"}),(0,P.jsx)("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),(0,P.jsx)("rect",{x:"147.5",y:"2.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})})),ys=u().memo((function(e){var t=e.theme;return zl((0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("path",{d:"M25 26H111V111H25",fill:_l(t)}),(0,P.jsx)("path",{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",stroke:_l(t),strokeWidth:"2"}),(0,P.jsx)("path",{d:"M100 100H160V160H100",fill:_l(t)}),(0,P.jsx)("path",{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",stroke:_l(t),strokeWidth:"2"}),(0,P.jsxs)("g",{fill:Dl(t),stroke:_l(t),strokeWidth:"6",children:[(0,P.jsx)("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),(0,P.jsx)("rect",{x:"78.5",y:"149.5",width:"30",height:"30"}),(0,P.jsx)("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),(0,P.jsx)("rect",{x:"147.5",y:"78.5",width:"30",height:"30"}),(0,P.jsx)("rect",{x:"105.5",y:"2.5",width:"30",height:"30"}),(0,P.jsx)("rect",{x:"2.5",y:"102.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})})),xs=u().memo((function(e){var t=e.theme;return zl((0,P.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.101 16H28.0934L36 8.95989V4H33.5779L20.101 16ZM30.5704 4L17.0935 16H9.10101L22.5779 4H30.5704ZM19.5704 4L6.09349 16H4V10.7475L11.5779 4H19.5704ZM8.57036 4H4V8.06952L8.57036 4ZM36 11.6378L31.101 16H36V11.6378ZM2 2V18H38V2H2Z",fill:_l(t)}),{width:40,height:20})})),ws=u().memo((function(e){var t=e.theme;return zl((0,P.jsxs)("g",{fill:_l(t),fillRule:"evenodd",clipRule:"evenodd",children:[(0,P.jsx)("path",{d:"M20.101 16H28.0934L36 8.95989V4H33.5779L20.101 16ZM30.5704 4L17.0935 16H9.10101L22.5779 4H30.5704ZM19.5704 4L6.09349 16H4V10.7475L11.5779 4H19.5704ZM8.57036 4H4V8.06952L8.57036 4ZM36 11.6378L31.101 16H36V11.6378ZM2 2V18H38V2H2Z"}),(0,P.jsx)("path",{d:"M14.0001 18L3.00006 4.00002L4.5727 2.76438L15.5727 16.7644L14.0001 18ZM25.0001 18L14.0001 4.00002L15.5727 2.76438L26.5727 16.7644L25.0001 18ZM36.0001 18L25.0001 4.00002L26.5727 2.76438L37.5727 16.7644L36.0001 18Z"})]}),{width:40,height:20})})),ks=u().memo((function(e){var t=e.theme;return zl((0,P.jsx)("path",{d:"M2 2H38V18H2V2Z",fill:_l(t)}),{width:40,height:20})})),Ss=u().memo((function(e){var t=e.theme,n=e.strokeWidth;return zl((0,P.jsx)("path",{d:"M6 10H32",stroke:_l(t),strokeWidth:n,strokeLinecap:"round",fill:"none"}),{width:40,height:20})})),Es=u().memo((function(e){var t=e.theme;return zl((0,P.jsx)("path",{d:"M6 10H34",stroke:_l(t),strokeWidth:2,fill:"none",strokeLinecap:"round"}),{width:40,height:20})})),Cs=u().memo((function(e){var t=e.theme;return zl((0,P.jsx)("path",{d:"M6 10H34",stroke:_l(t),strokeWidth:2.5,strokeDasharray:"10, 8",fill:"none",strokeLinecap:"round"}),{width:40,height:20})})),js=u().memo((function(e){var t=e.theme;return zl((0,P.jsx)("path",{d:"M6 10H36",stroke:_l(t),strokeWidth:2.5,strokeDasharray:"2, 4.5",fill:"none",strokeLinecap:"round"}),{width:40,height:20})})),Os=u().memo((function(e){var t=e.theme;return zl((0,P.jsx)("path",{d:"M3.00098 16.1691C6.28774 13.9744 19.6399 2.8905 22.7215 3.00082C25.8041 3.11113 19.1158 15.5488 21.4962 16.8309C23.8757 18.1131 34.4155 11.7148 37.0001 10.6919",stroke:_l(t),strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),Ms=u().memo((function(e){var t=e.theme;return zl((0,P.jsx)("path",{d:"M3 17C6.68158 14.8752 16.1296 9.09849 22.0648 6.54922C28 3.99995 22.2896 13.3209 25 14C27.7104 14.6791 36.3757 9.6471 36.3757 9.6471M6.40706 15C13 11.1918 20.0468 1.51045 23.0234 3.0052C26 4.49995 20.457 12.8659 22.7285 16.4329C25 20 36.3757 13 36.3757 13",stroke:_l(t),strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),Is=u().memo((function(e){var t=e.theme;return zl((0,P.jsx)("path",{d:"M3 15.6468C6.93692 13.5378 22.5544 2.81528 26.6206 3.00242C30.6877 3.18956 25.6708 15.3346 27.4009 16.7705C29.1309 18.2055 35.4001 12.4762 37 11.6177M3.97143 10.4917C6.61158 9.24563 16.3706 2.61886 19.8104 3.01724C23.2522 3.41472 22.0773 12.2013 24.6181 12.8783C27.1598 13.5536 33.3179 8.04068 35.0571 7.07244",stroke:_l(t),strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),Ps=u().memo((function(e){var t=e.theme;return zl((0,P.jsx)("path",{d:"M10 17L10 5L35 5",stroke:_l(t),strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),Ts=u().memo((function(e){var t=e.theme;return zl((0,P.jsx)("path",{d:"M10 17V15C10 8 13 5 21 5L33.5 5",stroke:_l(t),strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),As=u().memo((function(e){var t=e.theme;return zl((0,P.jsx)("path",{d:"M6 10H34",stroke:_l(t),strokeWidth:2,fill:"none"}),{width:40,height:20})})),Ls=u().memo((function(e){var t=e.theme,n=e.flip,r=void 0!==n&&n;return zl((0,P.jsxs)("g",{transform:r?"translate(40, 0) scale(-1, 1)":"",stroke:_l(t),strokeWidth:2,fill:"none",children:[(0,P.jsx)("path",{d:"M34 10H6M34 10L27 5M34 10L27 15"}),(0,P.jsx)("path",{d:"M27.5 5L34.5 10L27.5 15"})]}),{width:40,height:20})})),_s=u().memo((function(e){var t=e.theme,n=e.flip,r=void 0!==n&&n;return zl((0,P.jsxs)("g",{stroke:_l(t),fill:_l(t),transform:r?"translate(40, 0) scale(-1, 1)":"",children:[(0,P.jsx)("path",{d:"M32 10L6 10",strokeWidth:2}),(0,P.jsx)("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})})),Ds=u().memo((function(e){var t=e.theme,n=e.flip,r=void 0!==n&&n;return zl((0,P.jsx)("g",{transform:r?"translate(40, 0) scale(-1, 1)":"",children:(0,P.jsx)("path",{d:"M34 10H5.99996M34 10L34 5M34 10L34 15",stroke:_l(t),strokeWidth:2,fill:"none"})}),{width:40,height:20})})),zs=u().memo((function(e){var t=e.theme,n=e.flip,r=void 0!==n&&n;return zl((0,P.jsxs)("g",{stroke:_l(t),fill:_l(t),transform:r?"translate(40, 0) scale(-1, 1)":"",children:[(0,P.jsx)("path",{d:"M32 10L6 10",strokeWidth:2}),(0,P.jsx)("path",{d:"M27.5 5.5L34.5 10L27.5 14.5L27.5 5.5"})]}),{width:40,height:20})})),Hs=u().memo((function(e){var t=e.theme;return zl((0,P.jsx)("path",{fill:_l(t),d:"M 0 69.092 L 0 55.03 A 124.24 124.24 0 0 0 4.706 57.02 Q 6.826 57.863 8.708 58.5 A 53.466 53.466 0 0 0 12.231 59.571 Q 17.236 60.889 21.387 60.889 A 20.909 20.909 0 0 0 24.265 60.704 Q 25.719 60.502 26.903 60.077 A 8.649 8.649 0 0 0 29.028 58.985 Q 31.689 57.08 31.689 53.321 Q 31.689 51.221 30.518 49.585 A 10.126 10.126 0 0 0 29.282 48.177 Q 28.352 47.287 27.075 46.436 A 23.719 23.719 0 0 0 25.752 45.627 Q 23.774 44.492 20.176 42.735 A 254.44 254.44 0 0 0 17.822 41.602 Q 11.503 38.631 8.236 35.888 A 19.742 19.742 0 0 1 8.008 35.694 A 22.18 22.18 0 0 1 2.783 29.102 Q 0.83 25.342 0.83 20.313 A 22.471 22.471 0 0 1 1.733 13.778 A 17.283 17.283 0 0 1 7.251 5.42 A 21.486 21.486 0 0 1 15.177 1.272 Q 18.361 0.338 22.166 0.09 A 43.573 43.573 0 0 1 25 0 A 42.399 42.399 0 0 1 34.349 1.01 A 39.075 39.075 0 0 1 35.62 1.319 A 67.407 67.407 0 0 1 42.108 3.382 A 83.357 83.357 0 0 1 46.191 5.03 L 41.309 16.797 Q 35.596 14.453 31.86 13.526 A 30.762 30.762 0 0 0 25.417 12.612 A 28.337 28.337 0 0 0 24.512 12.598 A 14.846 14.846 0 0 0 22.022 12.793 Q 19.498 13.224 17.92 14.6 Q 15.625 16.602 15.625 19.824 Q 15.625 21.826 16.553 23.316 Q 17.48 24.805 19.507 26.197 A 18.343 18.343 0 0 0 20.659 26.912 Q 22.596 28.035 26.516 29.953 A 299.99 299.99 0 0 0 29.102 31.201 Q 37.91 35.412 41.841 39.642 A 16.553 16.553 0 0 1 42.822 40.796 A 17.675 17.675 0 0 1 46.301 49.233 A 23.517 23.517 0 0 1 46.533 52.588 A 21.581 21.581 0 0 1 45.471 59.515 A 17.733 17.733 0 0 1 39.575 67.823 Q 33.745 72.486 24.094 73.243 A 49.683 49.683 0 0 1 20.215 73.389 A 51.712 51.712 0 0 1 9.448 72.315 A 40.672 40.672 0 0 1 0 69.092 Z"}),{width:47,height:77})})),Bs=u().memo((function(e){var t=e.theme;return zl((0,P.jsx)("path",{fill:_l(t),d:"M 44.092 71.387 L 30.225 71.387 L 13.037 15.381 L 12.598 15.381 A 1505.093 1505.093 0 0 1 12.959 22.313 Q 13.426 31.715 13.508 36.4 A 102.991 102.991 0 0 1 13.525 38.184 L 13.525 71.387 L 0 71.387 L 0 0 L 20.605 0 L 37.5 54.59 L 37.793 54.59 L 55.713 0 L 76.318 0 L 76.318 71.387 L 62.207 71.387 L 62.207 37.598 Q 62.207 35.205 62.28 32.08 A 160.703 160.703 0 0 1 62.326 30.544 Q 62.452 26.754 62.866 17.168 A 5390.536 5390.536 0 0 1 62.939 15.479 L 62.5 15.479 L 44.092 71.387 Z"}),{width:77,height:75})})),Ns=u().memo((function(e){var t=e.theme;return zl((0,P.jsx)("path",{fill:_l(t),d:"M 44.092 71.387 L 0 71.387 L 0 0 L 15.137 0 L 15.137 58.887 L 44.092 58.887 L 44.092 71.387 Z"}),{width:45,height:75})})),Rs=u().memo((function(e){var t=e.theme;return zl((0,P.jsx)("path",{fill:_l(t),d:"M 42.578 35.4 L 66.699 71.387 L 49.414 71.387 L 32.813 44.385 L 16.211 71.387 L 0 71.387 L 23.682 34.57 L 1.514 0 L 18.213 0 L 33.594 25.684 L 48.682 0 L 64.99 0 L 42.578 35.4 Z M 119.775 71.387 L 75.684 71.387 L 75.684 0 L 90.82 0 L 90.82 58.887 L 119.775 58.887 L 119.775 71.387 Z"}),{width:120,height:75})})),Fs=u().memo((function(e){var t=e.theme;return zl((0,P.jsx)("path",{fill:_l(t),d:"M290.74 93.24l128.02 128.02-277.99 277.99-114.14 12.6C11.35 513.54-1.56 500.62.14 485.34l12.7-114.22 277.9-277.88zm207.2-19.06l-60.11-60.11c-18.75-18.75-49.16-18.75-67.91 0l-56.55 56.55 128.02 128.02 56.55-56.55c18.75-18.76 18.75-49.16 0-67.91z"}),{width:448,height:512})})),Vs=u().memo((function(e){var t=e.theme;return zl((0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("path",{fill:_l(t),d:"M 63.818 71.68 L 54.492 71.68 L 45.898 49.561 L 17.578 49.561 L 9.082 71.68 L 0 71.68 L 27.881 0 L 35.986 0 L 63.818 71.68 Z M 20.605 41.602 L 43.213 41.602 L 35.205 19.971 L 31.787 9.277 Q 30.322 15.137 28.711 19.971 L 20.605 41.602 Z"}),(0,P.jsx)("path",{fill:_l(t),d:"M 68.994 71.68 L 52.686 71.68 L 47.51 54.688 L 21.484 54.688 L 16.309 71.68 L 0 71.68 L 25.195 0 L 43.701 0 L 68.994 71.68 Z M 25.293 41.992 L 43.896 41.992 A 27590.463 27590.463 0 0 1 42.2 36.532 Q 36.965 19.676 35.937 16.273 A 120.932 120.932 0 0 1 35.815 15.869 A 131.65 131.65 0 0 1 35.396 14.435 Q 34.951 12.879 34.675 11.741 A 34.866 34.866 0 0 1 34.521 11.084 A 141.762 141.762 0 0 1 33.706 14.075 Q 31.482 21.957 25.293 41.992 Z"})]}),{width:70,height:78})})),Us=u().memo((function(e){var t=e.theme;return zl((0,P.jsx)(P.Fragment,{children:(0,P.jsx)("path",{fill:_l(t),d:"M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"})}),{width:640,height:512})})),Gs=u().memo((function(e){var t=e.theme;return zl((0,P.jsx)("path",{d:"M12.83 352h262.34A12.82 12.82 0 00288 339.17v-38.34A12.82 12.82 0 00275.17 288H12.83A12.82 12.82 0 000 300.83v38.34A12.82 12.82 0 0012.83 352zm0-256h262.34A12.82 12.82 0 00288 83.17V44.83A12.82 12.82 0 00275.17 32H12.83A12.82 12.82 0 000 44.83v38.34A12.82 12.82 0 0012.83 96zM432 160H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16zm0 256H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16z",fill:_l(t),strokeLinecap:"round"}),{width:448,height:512})})),Ws=u().memo((function(e){var t=e.theme;return zl((0,P.jsx)("path",{d:"M432 160H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16zm0 256H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16zM108.1 96h231.81A12.09 12.09 0 00352 83.9V44.09A12.09 12.09 0 00339.91 32H108.1A12.09 12.09 0 0096 44.09V83.9A12.1 12.1 0 00108.1 96zm231.81 256A12.09 12.09 0 00352 339.9v-39.81A12.09 12.09 0 00339.91 288H108.1A12.09 12.09 0 0096 300.09v39.81a12.1 12.1 0 0012.1 12.1z",fill:_l(t)}),{width:448,height:512})})),Ks=u().memo((function(e){var t=e.theme;return zl((0,P.jsx)("path",{d:"M16 224h416a16 16 0 0016-16v-32a16 16 0 00-16-16H16a16 16 0 00-16 16v32a16 16 0 0016 16zm416 192H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16zm3.17-384H172.83A12.82 12.82 0 00160 44.83v38.34A12.82 12.82 0 00172.83 96h262.34A12.82 12.82 0 00448 83.17V44.83A12.82 12.82 0 00435.17 32zm0 256H172.83A12.82 12.82 0 00160 300.83v38.34A12.82 12.82 0 00172.83 352h262.34A12.82 12.82 0 00448 339.17v-38.34A12.82 12.82 0 00435.17 288z",fill:_l(t),strokeLinecap:"round"}),{width:448,height:512})})),Zs=zl("M280.37 148.26L96 300.11V464a16 16 0 0 0 16 16l112.06-.29a16 16 0 0 0 15.92-16V368a16 16 0 0 1 16-16h64a16 16 0 0 1 16 16v95.64a16 16 0 0 0 16 16.05L464 480a16 16 0 0 0 16-16V300L295.67 148.26a12.19 12.19 0 0 0-15.3 0zM571.6 251.47L488 182.56V44.05a12 12 0 0 0-12-12h-56a12 12 0 0 0-12 12v72.61L318.47 43a48 48 0 0 0-61 0L4.34 251.47a12 12 0 0 0-1.6 16.9l25.5 31A12 12 0 0 0 45.15 301l235.22-193.74a12.19 12.19 0 0 1 15.3 0L530.9 301a12 12 0 0 0 16.9-1.6l25.5-31a12 12 0 0 0-1.7-16.93z"),Ys=[],Xs=function(e){return Ys=Ys.concat(e),e};function qs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qs(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Qs=function(e,t){if(e.editingGroupId){var n=Io(nl(t),e.editingGroupId);if(n.length)return $s($s({},e),{},{selectedElementIds:D({},n[0].id,!0)})}return e},Js=Xs({name:"deleteSelectedElements",perform:function(e,t){if(t.editingLinearElement){var n=t.editingLinearElement,r=n.elementId,o=n.activePointIndex,a=n.startBindingElement,i=n.endBindingElement,l=li.getElement(r);if(!l)return!1;if(null==o||-1===o||l.points.length<2){var s=e.filter((function(e){return e.id!==l.id}));return{elements:s,appState:$s($s({},Qs(t,s)),{},{editingLinearElement:null}),commitToHistory:!1}}var c={startBindingElement:0===o?null:a,endBindingElement:o===l.points.length-1?null:i};return li.movePoint(l,o,"delete"),{elements:e,appState:$s($s({},t),{},{editingLinearElement:$s($s($s({},t.editingLinearElement),c),{},{activePointIndex:o>0?o-1:0})}),commitToHistory:!0}}var u=function(e,t){return{elements:e.map((function(e){return t.selectedElementIds[e.id]?fo(e,{isDeleted:!0}):e})),appState:$s($s({},t),{},{selectedElementIds:{}})}}(e,t),d=u.elements,p=u.appState;return _i(d,e.filter((function(e){var n=e.id;return t.selectedElementIds[n]}))),{elements:d,appState:$s($s({},p=Qs(p,d)),{},{elementType:"selection",multiElement:null}),commitToHistory:ul(nl(e),t)}},contextItemLabel:"labels.delete",keyTest:function(e){return e.key===sn||e.key===dn},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,P.jsx)(Al,{type:"button",icon:Ul,title:I("labels.delete"),"aria-label":I("labels.delete"),onClick:function(){return r(null)},visible:ul(nl(t),n)})}}),ec=function(e,t){for(var n=[],r=[],o=null,a=-1;++a<e.length;)t.selectedElementIds[e[a].id]?(r.length&&(n=n.concat(r),r=[]),n.push(a),o=a+1):e[a].isDeleted&&o===a?(o=a+1,r.push(a)):r=[];return n},tc=function(e,t,n,r){var o=t[n],a=function(t){return!t.isDeleted&&(!e.editingGroupId||t.groupIds.includes(e.editingGroupId))},i="left"===r?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length-1;n<0&&(n=e.length+n);for(var r=(n=Math.min(e.length-1,Math.max(n,0)))+1;--r>-1;)if(t(e[r],r,e))return r;return-1}(t,a,Math.max(0,n-1)):function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;n<0&&(n=e.length+n);for(var r=(n=Math.min(e.length,Math.max(n,0)))-1;++r<e.length;)if(t(e[r],r,e))return r;return-1}(t,a,n+1),l=t[i];if(!l)return-1;if(e.editingGroupId){if((null==o?void 0:o.groupIds.join(""))===(null==l?void 0:l.groupIds.join("")))return i;if(null==l||!l.groupIds.includes(e.editingGroupId))return-1}if(!l.groupIds.length)return i;var s=e.editingGroupId?l.groupIds[l.groupIds.indexOf(e.editingGroupId)-1]:l.groupIds[l.groupIds.length-1],c=Io(t,s);return c.length?"left"===r?t.indexOf(c[0]):t.indexOf(c[c.length-1]):i},nc=function(e,t){return t.reduce((function(t,n){var r=e[n];return t[r.id]=r,t}),{})},rc=function(e,t,n){var r,o,a=ec(t,e),i=nc(t,a),l=(o=0,(r=a).reduce((function(e,t,n){return n>0&&r[n-1]!==t-1&&(o=++o),(e[o]||(e[o]=[])).push(t),e}),[]));return"right"===n&&(l=l.reverse()),l.forEach((function(r,o){var a=r[0],i=r[r.length-1],l="left"===n?a:i,s=tc(e,t,l,n);if(-1!==s&&l!==s){var c="left"===n?t.slice(0,s):t.slice(0,a),u=t.slice(a,i+1),d="left"===n?t.slice(s,a):t.slice(i+1,s+1),p="left"===n?t.slice(i+1):t.slice(s+1);t="left"===n?[].concat(_(c),_(u),_(d),_(p)):[].concat(_(c),_(d),_(u),_(p))}})),t.map((function(e){return i[e.id]?ho(e):e}))},oc=function(e,t,n){var r,o,a=ec(e,t),i=nc(e,a),l=[];if("left"===n){if(t.editingGroupId){var s=Io(e,t.editingGroupId);if(!s.length)return e;r=e.indexOf(s[0])}else r=0;o=a[a.length-1]}else{if(t.editingGroupId){var c=Io(e,t.editingGroupId);if(!c.length)return e;o=e.indexOf(c[c.length-1])}else o=e.length-1;r=a[0]}for(var u=r;u<o+1;u++)a.includes(u)||l.push(e[u]);var d=Object.values(i).map((function(e){return ho(e)})),p=e.slice(0,r),f=e.slice(o+1);return"left"===n?[].concat(_(p),_(d),l,_(f)):[].concat(_(p),l,_(d),_(f))},ac=function(e,t){return rc(t,e,"left")},ic=function(e,t){return rc(t,e,"right")},lc=function(e,t){return oc(e,t,"left")},sc=function(e,t){return oc(e,t,"right")},cc=Xs({name:"sendBackward",perform:function(e,t){return{elements:ac(e,t),appState:t,commitToHistory:!0}},contextItemLabel:"labels.sendBackward",keyPriority:40,keyTest:function(e){return e[un]&&!e.shiftKey&&e.code===Vt},PanelComponent:function(e){var t=e.updateData,n=e.appState;return(0,P.jsx)("button",{type:"button",className:"zIndexButton",onClick:function(){return t(null)},title:"".concat(I("labels.sendBackward")," — ").concat(Xn("CtrlOrCmd+[")),children:(0,P.jsx)(ns,{theme:n.theme})})}}),uc=Xs({name:"bringForward",perform:function(e,t){return{elements:ic(e,t),appState:t,commitToHistory:!0}},contextItemLabel:"labels.bringForward",keyPriority:40,keyTest:function(e){return e[un]&&!e.shiftKey&&e.code===Ft},PanelComponent:function(e){var t=e.updateData,n=e.appState;return(0,P.jsx)("button",{type:"button",className:"zIndexButton",onClick:function(){return t(null)},title:"".concat(I("labels.bringForward")," — ").concat(Xn("CtrlOrCmd+]")),children:(0,P.jsx)(ts,{theme:n.theme})})}}),dc=Xs({name:"sendToBack",perform:function(e,t){return{elements:lc(e,t),appState:t,commitToHistory:!0}},contextItemLabel:"labels.sendToBack",keyTest:function(e){return _t?e[un]&&e.altKey&&e.code===Vt:e[un]&&e.shiftKey&&e.code===Vt},PanelComponent:function(e){var t=e.updateData,n=e.appState;return(0,P.jsx)("button",{type:"button",className:"zIndexButton",onClick:function(){return t(null)},title:"".concat(I("labels.sendToBack")," — ").concat(Xn(_t?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")),children:(0,P.jsx)(os,{theme:n.theme})})}}),pc=Xs({name:"bringToFront",perform:function(e,t){return{elements:sc(e,t),appState:t,commitToHistory:!0}},contextItemLabel:"labels.bringToFront",keyTest:function(e){return _t?e[un]&&e.altKey&&e.code===Ft:e[un]&&e.shiftKey&&e.code===Ft},PanelComponent:function(e){var t=e.updateData,n=e.appState;return(0,P.jsx)("button",{type:"button",className:"zIndexButton",onClick:function(e){return t(null)},title:"".concat(I("labels.bringToFront")," — ").concat(Xn(_t?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")),children:(0,P.jsx)(rs,{theme:n.theme})})}});function fc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function hc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fc(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var mc=Xs({name:"selectAll",perform:function(e,t){return!t.editingLinearElement&&{appState:Oo(hc(hc({},t),{},{editingGroupId:null,selectedElementIds:e.reduce((function(e,t){return t.isDeleted||(e[t.id]=!0),e}),{})}),nl(e)),commitToHistory:!0}},contextItemLabel:"labels.selectAll",keyTest:function(e){return e[un]&&e.key===vn}});function gc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gc(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var bc=Xs({name:"duplicateSelection",perform:function(e,t){if(t.editingLinearElement){var n=t.editingLinearElement,r=n.activePointIndex,o=n.elementId,a=li.getElement(o);if(!a||null===r)return!1;var i=a.points,l=i[r],s=i[r+1];return po(a,{points:[].concat(_(i.slice(0,r+1)),[s?[(l[0]+s[0])/2,(l[1]+s[1])/2]:[l[0]+30,l[1]+30]],_(i.slice(r+1)))}),{appState:vc(vc({},t),{},{editingLinearElement:vc(vc({},t.editingLinearElement),{},{activePointIndex:r+1})}),elements:e,commitToHistory:!0}}return vc(vc({},yc(e,t)),{},{commitToHistory:!0})},contextItemLabel:"labels.duplicateSelection",keyTest:function(e){return e[un]&&e.key===bn},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,P.jsx)(Al,{type:"button",icon:gs,title:"".concat(I("labels.duplicateSelection")," — ").concat(Xn("CtrlOrCmd+D")),"aria-label":I("labels.duplicateSelection"),onClick:function(){return r(null)},visible:ul(nl(t),n)})}}),yc=function(e,t){for(var n=new Map,r=[],o=[],a=new Map,i=function(e){var i=Fo(t.editingGroupId,n,e,{x:e.x+d.k/2,y:e.y+d.k/2});return a.set(e.id,i.id),o.push(e),r.push(i),i},l=[],s=0;s<e.length;){var c=e[s];if(t.selectedElementIds[c.id]){if(c.groupIds.length){var u=Co(t,c);if(u){var p=Io(e,u);l.push.apply(l,_(p).concat(_(p.map((function(e){return i(e)}))))),s+=p.length;continue}}l.push(c,i(c))}else l.push(c);s++}return Ai(l,o,a),{elements:l,appState:Oo(vc(vc({},t),{},{selectedGroupIds:{},selectedElementIds:r.reduce((function(e,t){return e[t.id]=!0,e}),{})}),nl(l))}},xc=function(e){var t=e.options,n=e.value,r=e.onChange,o=e.group;return(0,P.jsx)("div",{className:"buttonList buttonListIcon",children:t.map((function(e){return(0,P.jsxs)("label",{className:Ye({active:n===e.value}),title:e.text,children:[(0,P.jsx)("input",{type:"radio",name:o,onChange:function(){return r(e.value)},checked:n===e.value}),e.icon]},e.text)}))})},wc=(n(4301),function(e){var t=e.children,n=e.left,r=e.top,o=e.onCloseRequest,a=e.fitInViewport,i=void 0!==a&&a,l=(0,c.useRef)(null);return(0,c.useLayoutEffect)((function(){if(i&&l.current){var e=l.current,t=e.getBoundingClientRect(),n=t.x,r=t.y,o=t.width,a=t.height,s=window.innerWidth;n+o>s&&(e.style.left="".concat(s-o,"px"));var c=window.innerHeight;r+a>c&&(e.style.top="".concat(c-a,"px"))}}),[i]),(0,c.useEffect)((function(){if(o){var e=function(e){var t;null!==(t=l.current)&&void 0!==t&&t.contains(e.target)||(0,Lt.unstable_batchedUpdates)((function(){return o(e)}))};return document.addEventListener("pointerdown",e,!1),function(){return document.removeEventListener("pointerdown",e,!1)}}}),[o]),(0,P.jsx)("div",{className:"popover",style:{top:r,left:n},ref:l,children:t})}),kc=(n(4220),function(e){var t=(new Option).style;return t.color=e,!!t.color}),Sc=[["1","2","3","4","5"],["q","w","e","r","t"],["a","s","d","f","g"]].flat(),Ec=function(e){var t=e.colors,n=e.color,r=e.onChange,o=e.onClose,a=e.label,i=e.showInput,l=void 0===i||i,s=e.type,c=u().useRef(),d=u().useRef(),p=u().useRef(),f=u().useRef();u().useEffect((function(){d.current?d.current.focus():f.current?f.current.focus():p.current&&p.current.focus()}),[]);return(0,P.jsxs)("div",{className:"color-picker color-picker-type-".concat(s),role:"dialog","aria-modal":"true","aria-label":I("labels.colorPicker"),onKeyDown:function(e){if(e.key===gn){var t,n=document.activeElement;if(e.shiftKey){if(n===c.current)null===(t=f.current)||void 0===t||t.focus(),e.preventDefault()}else if(n===f.current){var r;null===(r=c.current)||void 0===r||r.focus(),e.preventDefault()}}else if(An(e.key)){var a=document.activeElement,i=O().rtl,s=Array.prototype.indexOf.call(p.current.children,a);if(-1!==s){var u=p.current.children.length-(l?1:0),d=e.key===(i?on:an)?(s+1)%u:e.key===(i?an:on)?(u+s-1)%u:e.key===rn?(s+5)%u:e.key===ln?(u+s-5)%u:s;p.current.children[d].focus()}e.preventDefault()}else if(Sc.includes(e.key.toLowerCase())&&!Nn(e.target)){var h=Sc.indexOf(e.key.toLowerCase());p.current.children[h].focus(),e.preventDefault()}else e.key!==fn&&e.key!==pn||(e.preventDefault(),o());e.nativeEvent.stopImmediatePropagation(),e.stopPropagation()},children:[(0,P.jsx)("div",{className:"color-picker-triangle color-picker-triangle-shadow"}),(0,P.jsx)("div",{className:"color-picker-triangle"}),(0,P.jsxs)("div",{className:"color-picker-content",ref:function(e){e&&(p.current=e)},tabIndex:0,children:[t.map((function(e,t){var o=e.replace("#","");return(0,P.jsxs)("button",{className:"color-picker-swatch",onClick:function(t){t.currentTarget.focus(),r(e)},title:"".concat(I("colors.".concat(o))).concat(rr(e)?"":" (".concat(e,")")," — ").concat(Sc[t].toUpperCase()),"aria-label":I("colors.".concat(o)),"aria-keyshortcuts":Sc[t],style:{color:e},ref:function(r){r&&0===t&&(c.current=r),r&&e===n&&(d.current=r)},onFocus:function(){r(e)},children:[rr(e)?(0,P.jsx)("div",{className:"color-picker-transparent"}):void 0,(0,P.jsx)("span",{className:"color-picker-keybinding",children:Sc[t]})]},e)})),l&&(0,P.jsx)(Cc,{color:n,label:a,onChange:function(e){r(e)},ref:f})]})]})},Cc=u().forwardRef((function(e,t){var n=e.color,r=e.onChange,o=e.label,a=g(u().useState(n),2),i=a[0],l=a[1],s=u().useRef(null);u().useEffect((function(){l(n)}),[n]),u().useImperativeHandle(t,(function(){return s.current}));var c=u().useCallback((function(e){var t=e.toLowerCase(),n=function(e){return rr(e)||kc(e)?e:kc("#".concat(e))?"#".concat(e):null}(t);n&&r(n),l(t)}),[r]);return(0,P.jsxs)("label",{className:"color-input-container",children:[(0,P.jsx)("div",{className:"color-picker-hash",children:"#"}),(0,P.jsx)("input",{spellCheck:!1,className:"color-picker-input","aria-label":o,onChange:function(e){return c(e.target.value)},value:(i||"").replace(/^#/,""),onBlur:function(){return l(n)},ref:s})]})})),jc=function(e){var t=e.type,n=e.color,r=e.onChange,o=e.label,a=e.isActive,i=e.setActive,l=u().useRef(null);return(0,P.jsxs)("div",{children:[(0,P.jsxs)("div",{className:"color-picker-control-container",children:[(0,P.jsx)("button",{className:"color-picker-label-swatch","aria-label":o,style:n?{"--swatch-color":n}:void 0,onClick:function(){return i(!a)},ref:l}),(0,P.jsx)(Cc,{color:n,label:o,onChange:function(e){r(e)}})]}),(0,P.jsx)(u().Suspense,{fallback:"",children:a?(0,P.jsx)(wc,{onCloseRequest:function(e){return e.target!==l.current&&i(!1)},children:(0,P.jsx)(Ec,{colors:At[t],color:n||null,onChange:function(e){r(e)},onClose:function(){var e;i(!1),null===(e=l.current)||void 0===e||e.focus()},label:o,showInput:!1,type:t})}):null})]})};n(7117);function Oc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Mc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Oc(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ic(e){var t=e.options,n=e.value,r=e.label,o=e.onChange,a=e.onClose,i=u().useRef(),l=u().useRef(),s=u().useRef(null);u().useEffect((function(){l.current?l.current.focus():s.current&&s.current.focus()}),[]);return(0,P.jsx)("div",{className:"picker",role:"dialog","aria-modal":"true","aria-label":r,onKeyDown:function(e){var n=t.find((function(t){return t.keyBinding===e.key.toLowerCase()}));if(e.metaKey||e.altKey||e.ctrlKey||!n)if(e.key===gn)setTimeout((function(){l.current!==document.activeElement&&a()}),0);else if(An(e.key)){var r=document.activeElement,o=O().rtl,i=Array.prototype.indexOf.call(s.current.children,r);if(-1!==i){var c=t.length,u=i;switch(e.key){case o?on:an:case rn:u=(i+1)%c;break;case o?an:on:case ln:u=(c+i-1)%c}s.current.children[u].focus()}e.preventDefault()}else e.key!==fn&&e.key!==pn||(e.preventDefault(),a());else{var d=t.indexOf(n);s.current.children[d].focus(),e.preventDefault()}e.nativeEvent.stopImmediatePropagation(),e.stopPropagation()},children:(0,P.jsx)("div",{className:"picker-content",ref:s,children:t.map((function(e,t){return(0,P.jsxs)("button",{className:"picker-option",onClick:function(t){t.currentTarget.focus(),o(e.value)},title:"".concat(e.text," — ").concat(e.keyBinding.toUpperCase()),"aria-label":e.text||"none","aria-keyshortcuts":e.keyBinding,ref:function(r){r&&0===t&&(i.current=r),r&&e.value===n&&(l.current=r)},onFocus:function(){o(e.value)},children:[e.icon,(0,P.jsx)("span",{className:"picker-keybinding",children:e.keyBinding})]},e.text)}))})})}function Pc(e){var t,n=e.value,r=e.label,o=e.options,a=e.onChange,i=e.group,l=void 0===i?"":i,s=g(u().useState(!1),2),c=s[0],d=s[1],p=u().useRef(null),f=O().rtl;return(0,P.jsxs)("label",{className:"picker-container",children:[(0,P.jsx)("button",{name:l,className:c?"active":"","aria-label":r,onClick:function(){return d(!c)},ref:p,children:null===(t=o.find((function(e){return e.value===n})))||void 0===t?void 0:t.icon}),(0,P.jsx)(u().Suspense,{fallback:"",children:c?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(wc,Mc(Mc({onCloseRequest:function(e){return e.target!==p.current&&d(!1)}},f?{right:5.5}:{left:-5.5}),{},{children:(0,P.jsx)(Ic,{options:o,value:n,label:r,onChange:a,onClose:function(){var e;d(!1),null===(e=p.current)||void 0===e||e.focus()}})})),(0,P.jsx)("div",{className:"picker-triangle"})]}):null})]})}function Tc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ac(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tc(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Lc=function(e,t,n){return e.map((function(e){var r;return t.selectedElementIds[e.id]||e.id===(null===(r=t.editingElement)||void 0===r?void 0:r.id)?n(e):e}))},_c=function(e,t,n,r){var o,a,i=t.editingElement,l=nl(e);return null!==(o=null!==(a=i&&n(i))&&void 0!==a?a:ul(l,t)?function(e,t,n){var r=Array.from(new Set(dl(e,t).map((function(e){return n(e)}))));return 1===r.length?r[0]:null}(l,t,n):r)&&void 0!==o?o:null},Dc=(Xs({name:"changeStrokeColor",perform:function(e,t,n){return Ac(Ac({},n.currentItemStrokeColor&&{elements:Lc(e,t,(function(e){return gl(e.type)?fo(e,{strokeColor:n.currentItemStrokeColor}):e}))}),{},{appState:Ac(Ac({},t),n),commitToHistory:!!n.currentItemStrokeColor})},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("h3",{"aria-hidden":"true",children:I("labels.stroke")}),(0,P.jsx)(jc,{type:"elementStroke",label:I("labels.stroke"),color:_c(t,n,(function(e){return e.strokeColor}),n.currentItemStrokeColor),onChange:function(e){return r({currentItemStrokeColor:e})},isActive:"strokeColorPicker"===n.openPopup,setActive:function(e){return r({openPopup:e?"strokeColorPicker":null})}})]})}}),Xs({name:"changeBackgroundColor",perform:function(e,t,n){return Ac(Ac({},n.currentItemBackgroundColor&&{elements:Lc(e,t,(function(e){return fo(e,{backgroundColor:n.currentItemBackgroundColor})}))}),{},{appState:Ac(Ac({},t),n),commitToHistory:!!n.currentItemBackgroundColor})},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("h3",{"aria-hidden":"true",children:I("labels.background")}),(0,P.jsx)(jc,{type:"elementBackground",label:I("labels.background"),color:_c(t,n,(function(e){return e.backgroundColor}),n.currentItemBackgroundColor),onChange:function(e){return r({currentItemBackgroundColor:e})},isActive:"backgroundColorPicker"===n.openPopup,setActive:function(e){return r({openPopup:e?"backgroundColorPicker":null})}})]})}}),Xs({name:"changeFillStyle",perform:function(e,t,n){return{elements:Lc(e,t,(function(e){return fo(e,{fillStyle:n})})),appState:Ac(Ac({},t),{},{currentItemFillStyle:n}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,P.jsxs)("fieldset",{children:[(0,P.jsx)("legend",{children:I("labels.fill")}),(0,P.jsx)(xc,{options:[{value:"hachure",text:I("labels.hachure"),icon:(0,P.jsx)(xs,{theme:n.theme})},{value:"cross-hatch",text:I("labels.crossHatch"),icon:(0,P.jsx)(ws,{theme:n.theme})},{value:"solid",text:I("labels.solid"),icon:(0,P.jsx)(ks,{theme:n.theme})}],group:"fill",value:_c(t,n,(function(e){return e.fillStyle}),n.currentItemFillStyle),onChange:function(e){r(e)}})]})}}),Xs({name:"changeStrokeWidth",perform:function(e,t,n){return{elements:Lc(e,t,(function(e){return fo(e,{strokeWidth:n})})),appState:Ac(Ac({},t),{},{currentItemStrokeWidth:n}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,P.jsxs)("fieldset",{children:[(0,P.jsx)("legend",{children:I("labels.strokeWidth")}),(0,P.jsx)(xc,{group:"stroke-width",options:[{value:1,text:I("labels.thin"),icon:(0,P.jsx)(Ss,{theme:n.theme,strokeWidth:2})},{value:2,text:I("labels.bold"),icon:(0,P.jsx)(Ss,{theme:n.theme,strokeWidth:6})},{value:4,text:I("labels.extraBold"),icon:(0,P.jsx)(Ss,{theme:n.theme,strokeWidth:10})}],value:_c(t,n,(function(e){return e.strokeWidth}),n.currentItemStrokeWidth),onChange:function(e){return r(e)}})]})}}),Xs({name:"changeSloppiness",perform:function(e,t,n){return{elements:Lc(e,t,(function(e){return fo(e,{seed:lo(),roughness:n})})),appState:Ac(Ac({},t),{},{currentItemRoughness:n}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,P.jsxs)("fieldset",{children:[(0,P.jsx)("legend",{children:I("labels.sloppiness")}),(0,P.jsx)(xc,{group:"sloppiness",options:[{value:0,text:I("labels.architect"),icon:(0,P.jsx)(Os,{theme:n.theme})},{value:1,text:I("labels.artist"),icon:(0,P.jsx)(Ms,{theme:n.theme})},{value:2,text:I("labels.cartoonist"),icon:(0,P.jsx)(Is,{theme:n.theme})}],value:_c(t,n,(function(e){return e.roughness}),n.currentItemRoughness),onChange:function(e){return r(e)}})]})}}),Xs({name:"changeStrokeStyle",perform:function(e,t,n){return{elements:Lc(e,t,(function(e){return fo(e,{strokeStyle:n})})),appState:Ac(Ac({},t),{},{currentItemStrokeStyle:n}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,P.jsxs)("fieldset",{children:[(0,P.jsx)("legend",{children:I("labels.strokeStyle")}),(0,P.jsx)(xc,{group:"strokeStyle",options:[{value:"solid",text:I("labels.strokeStyle_solid"),icon:(0,P.jsx)(Es,{theme:n.theme})},{value:"dashed",text:I("labels.strokeStyle_dashed"),icon:(0,P.jsx)(Cs,{theme:n.theme})},{value:"dotted",text:I("labels.strokeStyle_dotted"),icon:(0,P.jsx)(js,{theme:n.theme})}],value:_c(t,n,(function(e){return e.strokeStyle}),n.currentItemStrokeStyle),onChange:function(e){return r(e)}})]})}}),Xs({name:"changeOpacity",perform:function(e,t,n){return{elements:Lc(e,t,(function(e){return fo(e,{opacity:n})})),appState:Ac(Ac({},t),{},{currentItemOpacity:n}),commitToHistory:!0}},PanelComponent:function(e){var t,n=e.elements,r=e.appState,o=e.updateData;return(0,P.jsxs)("label",{className:"control-label",children:[I("labels.opacity"),(0,P.jsx)("input",{type:"range",min:"0",max:"100",step:"10",onChange:function(e){return o(+e.target.value)},onWheel:function(e){e.stopPropagation();var t=+e.target.value;e.deltaY<0&&t<100?o(t+10):e.deltaY>0&&t>0&&o(t-10)},value:null!==(t=_c(n,r,(function(e){return e.opacity}),r.currentItemOpacity))&&void 0!==t?t:void 0})]})}}),Xs({name:"changeFontSize",perform:function(e,t,n){return{elements:Lc(e,t,(function(e){if(Qe(e)){var t=fo(e,{fontSize:n});return qi(t),t}return e})),appState:Ac(Ac({},t),{},{currentItemFontSize:n}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,P.jsxs)("fieldset",{children:[(0,P.jsx)("legend",{children:I("labels.fontSize")}),(0,P.jsx)(xc,{group:"font-size",options:[{value:16,text:I("labels.small"),icon:(0,P.jsx)(Hs,{theme:n.theme})},{value:20,text:I("labels.medium"),icon:(0,P.jsx)(Bs,{theme:n.theme})},{value:28,text:I("labels.large"),icon:(0,P.jsx)(Ns,{theme:n.theme})},{value:36,text:I("labels.veryLarge"),icon:(0,P.jsx)(Rs,{theme:n.theme})}],value:_c(t,n,(function(e){return Qe(e)&&e.fontSize}),n.currentItemFontSize||d.n5),onChange:function(e){return r(e)}})]})}}),Xs({name:"changeFontFamily",perform:function(e,t,n){return{elements:Lc(e,t,(function(e){if(Qe(e)){var t=fo(e,{fontFamily:n});return qi(t),t}return e})),appState:Ac(Ac({},t),{},{currentItemFontFamily:n}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData,o=[{value:d.ut.Virgil,text:I("labels.handDrawn"),icon:(0,P.jsx)(Fs,{theme:n.theme})},{value:d.ut.Helvetica,text:I("labels.normal"),icon:(0,P.jsx)(Vs,{theme:n.theme})},{value:d.ut.Cascadia,text:I("labels.code"),icon:(0,P.jsx)(Us,{theme:n.theme})}];return(0,P.jsxs)("fieldset",{children:[(0,P.jsx)("legend",{children:I("labels.fontFamily")}),(0,P.jsx)(xc,{group:"font-family",options:o,value:_c(t,n,(function(e){return Qe(e)&&e.fontFamily}),n.currentItemFontFamily||d.rk),onChange:function(e){return r(e)}})]})}}),Xs({name:"changeTextAlign",perform:function(e,t,n){return{elements:Lc(e,t,(function(e){if(Qe(e)){var t=fo(e,{textAlign:n});return qi(t),t}return e})),appState:Ac(Ac({},t),{},{currentItemTextAlign:n}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,P.jsxs)("fieldset",{children:[(0,P.jsx)("legend",{children:I("labels.textAlign")}),(0,P.jsx)(xc,{group:"text-align",options:[{value:"left",text:I("labels.left"),icon:(0,P.jsx)(Gs,{theme:n.theme})},{value:"center",text:I("labels.center"),icon:(0,P.jsx)(Ws,{theme:n.theme})},{value:"right",text:I("labels.right"),icon:(0,P.jsx)(Ks,{theme:n.theme})}],value:_c(t,n,(function(e){return Qe(e)&&e.textAlign}),n.currentItemTextAlign),onChange:function(e){return r(e)}})]})}}),Xs({name:"changeSharpness",perform:function(e,t,n){var r=pl(nl(e),t),o=r.length?r.every((function(e){return!tt(e)})):!nt(t.elementType),a=r.length?r.every(tt):nt(t.elementType);return{elements:Lc(e,t,(function(e){return fo(e,{strokeSharpness:n})})),appState:Ac(Ac({},t),{},{currentItemStrokeSharpness:o?n:t.currentItemStrokeSharpness,currentItemLinearStrokeSharpness:a?n:t.currentItemLinearStrokeSharpness}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,P.jsxs)("fieldset",{children:[(0,P.jsx)("legend",{children:I("labels.edges")}),(0,P.jsx)(xc,{group:"edges",options:[{value:"sharp",text:I("labels.sharp"),icon:(0,P.jsx)(Ps,{theme:n.theme})},{value:"round",text:I("labels.round"),icon:(0,P.jsx)(Ts,{theme:n.theme})}],value:_c(t,n,(function(e){return e.strokeSharpness}),yl(n.elementType)&&(nt(n.elementType)?n.currentItemLinearStrokeSharpness:n.currentItemStrokeSharpness)||null),onChange:function(e){return r(e)}})]})}}),Xs({name:"changeArrowhead",perform:function(e,t,n){return{elements:Lc(e,t,(function(e){if(tt(e)){var t=n.position,r=n.type;if("start"===t)return fo(e,{startArrowhead:r});if("end"===t)return fo(e,{endArrowhead:r})}return e})),appState:Ac(Ac({},t),{},D({},"start"===n.position?"currentItemStartArrowhead":"currentItemEndArrowhead",n.type)),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData,o=O().rtl;return(0,P.jsxs)("fieldset",{children:[(0,P.jsx)("legend",{children:I("labels.arrowheads")}),(0,P.jsxs)("div",{className:"iconSelectList",children:[(0,P.jsx)(Pc,{label:"arrowhead_start",options:[{value:null,text:I("labels.arrowhead_none"),icon:(0,P.jsx)(As,{theme:n.theme}),keyBinding:"q"},{value:"arrow",text:I("labels.arrowhead_arrow"),icon:(0,P.jsx)(Ls,{theme:n.theme,flip:!o}),keyBinding:"w"},{value:"bar",text:I("labels.arrowhead_bar"),icon:(0,P.jsx)(Ds,{theme:n.theme,flip:!o}),keyBinding:"e"},{value:"dot",text:I("labels.arrowhead_dot"),icon:(0,P.jsx)(_s,{theme:n.theme,flip:!o}),keyBinding:"r"},{value:"triangle",text:I("labels.arrowhead_triangle"),icon:(0,P.jsx)(zs,{theme:n.theme,flip:!o}),keyBinding:"t"}],value:_c(t,n,(function(e){return tt(e)&&wl(e.type)?e.startArrowhead:n.currentItemStartArrowhead}),n.currentItemStartArrowhead),onChange:function(e){return r({position:"start",type:e})}}),(0,P.jsx)(Pc,{label:"arrowhead_end",group:"arrowheads",options:[{value:null,text:I("labels.arrowhead_none"),keyBinding:"q",icon:(0,P.jsx)(As,{theme:n.theme})},{value:"arrow",text:I("labels.arrowhead_arrow"),keyBinding:"w",icon:(0,P.jsx)(Ls,{theme:n.theme,flip:o})},{value:"bar",text:I("labels.arrowhead_bar"),keyBinding:"e",icon:(0,P.jsx)(Ds,{theme:n.theme,flip:o})},{value:"dot",text:I("labels.arrowhead_dot"),keyBinding:"r",icon:(0,P.jsx)(_s,{theme:n.theme,flip:o})},{value:"triangle",text:I("labels.arrowhead_triangle"),icon:(0,P.jsx)(zs,{theme:n.theme,flip:o}),keyBinding:"t"}],value:_c(t,n,(function(e){return tt(e)&&wl(e.type)?e.endArrowhead:n.currentItemEndArrowhead}),n.currentItemEndArrowhead),onChange:function(e){return r({position:"end",type:e})}})]})]})}}),function(e){var t=e.title||("dark"===e.value?I("buttons.lightMode"):I("buttons.darkMode"));return(0,P.jsx)(Al,{type:"icon",icon:e.value===d.C6.LIGHT?zc.MOON:zc.SUN,title:t,"aria-label":t,onClick:function(){return e.onChange(e.value===d.C6.DARK?d.C6.LIGHT:d.C6.DARK)},"data-testid":"toggle-dark-mode"})}),zc={SUN:(0,P.jsx)("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:(0,P.jsx)("path",{fill:"currentColor",d:"M256 160c-52.9 0-96 43.1-96 96s43.1 96 96 96 96-43.1 96-96-43.1-96-96-96zm246.4 80.5l-94.7-47.3 33.5-100.4c4.5-13.6-8.4-26.5-21.9-21.9l-100.4 33.5-47.4-94.8c-6.4-12.8-24.6-12.8-31 0l-47.3 94.7L92.7 70.8c-13.6-4.5-26.5 8.4-21.9 21.9l33.5 100.4-94.7 47.4c-12.8 6.4-12.8 24.6 0 31l94.7 47.3-33.5 100.5c-4.5 13.6 8.4 26.5 21.9 21.9l100.4-33.5 47.3 94.7c6.4 12.8 24.6 12.8 31 0l47.3-94.7 100.4 33.5c13.6 4.5 26.5-8.4 21.9-21.9l-33.5-100.4 94.7-47.3c13-6.5 13-24.7.2-31.1zm-155.9 106c-49.9 49.9-131.1 49.9-181 0-49.9-49.9-49.9-131.1 0-181 49.9-49.9 131.1-49.9 181 0 49.9 49.9 49.9 131.1 0 181z"})}),MOON:(0,P.jsx)("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:(0,P.jsx)("path",{fill:"currentColor",d:"M283.211 512c78.962 0 151.079-35.925 198.857-94.792 7.068-8.708-.639-21.43-11.562-19.35-124.203 23.654-238.262-71.576-238.262-196.954 0-72.222 38.662-138.635 101.498-174.394 9.686-5.512 7.25-20.197-3.756-22.23A258.156 258.156 0 0 0 283.211 0c-141.309 0-256 114.511-256 256 0 141.309 114.511 256 256 256z"})})},Hc=(n(6781),function(){var e=document.querySelector(".excalidraw-tooltip");if(e)return e;var t=document.createElement("div");return document.body.appendChild(t),t.classList.add("excalidraw-tooltip"),t}),Bc=function(e){var t=e.children,n=e.label,r=e.long,o=void 0!==r&&r;return(0,c.useEffect)((function(){return function(){return Hc().classList.remove("excalidraw-tooltip--visible")}}),[]),(0,P.jsx)("div",{className:"excalidraw-tooltip-wrapper",onPointerEnter:function(e){return function(e,t,n,r){t.classList.add("excalidraw-tooltip--visible"),t.style.minWidth=r?"50ch":"10ch",t.style.maxWidth=r?"50ch":"15ch",t.textContent=n;var o=e.getBoundingClientRect(),a=o.x,i=o.bottom,l=o.top,s=o.width,c=t.getBoundingClientRect(),u=c.width,d=c.height,p=window.innerWidth,f=a+s/2-u/2,h=f+u>=p?f+u-p:0,m=i+5,g=m+d>=window.innerHeight?i-l+d+10:0;Object.assign(t.style,{top:"".concat(m-g,"px"),left:"".concat(f-h,"px")})}(e.currentTarget,Hc(),n,o)},onPointerLeave:function(){return Hc().classList.remove("excalidraw-tooltip--visible")},children:t})};n(196),n(1106);function Nc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Rc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Nc(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Fc=u().forwardRef((function(e,t){var n=e.children,r=e.padding,o=e.className,a=e.style;return(0,P.jsx)("div",{className:Ye("Island",o),style:Rc({"--padding":r},a),ref:t,children:n})})),Vc=(n(8328),function(e){var t=e.theme,n=void 0===t?d.C6.LIGHT:t,r=Uc(n);if(!r)return null;return(0,Lt.createPortal)((0,P.jsxs)("div",{className:Ye("Modal",e.className),role:"dialog","aria-modal":"true",onKeyDown:function(t){t.key===fn&&(t.nativeEvent.stopImmediatePropagation(),t.stopPropagation(),e.onCloseRequest())},"aria-labelledby":e.labelledBy,children:[(0,P.jsx)("div",{className:"Modal__background",onClick:e.onCloseRequest}),(0,P.jsx)("div",{className:"Modal__content",style:{"--max-width":"".concat(e.maxWidth,"px")},tabIndex:0,children:e.children})]}),r)}),Uc=function(e){var t=g((0,c.useState)(null),2),n=t[0],r=t[1],o=Lh(),a=(0,c.useRef)(o);a.current=o;var i=Dh().container;return(0,c.useLayoutEffect)((function(){n&&n.classList.toggle("excalidraw--mobile",o)}),[n,o]),(0,c.useLayoutEffect)((function(){var t=!(null==i||!i.classList.contains("theme--dark"))||"dark"===e,n=document.createElement("div");return n.classList.add("excalidraw","excalidraw-modal-container"),n.classList.toggle("excalidraw--mobile",a.current),t&&(n.classList.add("theme--dark"),n.classList.add("theme--dark-background-none")),document.body.appendChild(n),r(n),function(){document.body.removeChild(n)}}),[i,e]),n},Gc=function(e){var t=function(){var e=g((0,c.useState)(null),2),t=e[0],n=e[1];return[t,(0,c.useCallback)((function(e){return n(e)}),[])]}(),n=g(t,2),r=n[0],o=n[1],a=g((0,c.useState)(document.activeElement),1)[0],i=Dh().id;(0,c.useEffect)((function(){if(r){var t=l(r);t.length>0&&!1!==e.autofocus&&(t[1]||t[0]).focus();var n=function(e){if(e.key===gn){var t=l(r),n=document.activeElement,o=t.findIndex((function(e){return e===n}));0===o&&e.shiftKey?(t[t.length-1].focus(),e.preventDefault()):o!==t.length-1||e.shiftKey||(t[0].focus(),e.preventDefault())}};return r.addEventListener("keydown",n),function(){return r.removeEventListener("keydown",n)}}}),[r,e.autofocus]);var l=function(e){var t=e.querySelectorAll("button, a, input, select, textarea, div[tabindex]");return t?Array.from(t):[]},s=function(){a.focus(),e.onCloseRequest()};return(0,P.jsx)(Vc,{className:Ye("Dialog",e.className),labelledBy:"dialog-title",maxWidth:e.small?550:800,onCloseRequest:s,theme:e.theme,children:(0,P.jsxs)(Fc,{ref:o,children:[(0,P.jsxs)("h2",{id:"".concat(i,"-dialog-title"),className:"Dialog__title",children:[(0,P.jsx)("span",{className:"Dialog__titleContent",children:e.title}),(0,P.jsx)("button",{className:"Modal__close",onClick:s,"aria-label":I("buttons.close"),children:Lh()?ms:hs})]}),(0,P.jsx)("div",{className:"Dialog__content",children:e.children})]})})},Wc=(n(9446),function(e){var t=e.onConfirm,n=g((0,c.useState)(!1),2),r=n[0],o=n[1],a=function(){o(!r)};return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Al,{type:"button",icon:Ul,title:I("buttons.clearReset"),"aria-label":I("buttons.clearReset"),showAriaLabel:Lh(),onClick:a,"data-testid":"clear-canvas-button"}),r&&(0,P.jsx)(Gc,{onCloseRequest:a,title:I("clearCanvasDialog.title"),className:"clear-canvas",small:!0,children:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)("p",{className:"clear-canvas__content",children:[" ",I("alerts.clearReset")]}),(0,P.jsxs)("div",{className:"clear-canvas-buttons",children:[(0,P.jsx)(Al,{type:"button",title:I("buttons.clear"),"aria-label":I("buttons.clear"),label:I("buttons.clear"),onClick:function(){t(),a()},"data-testid":"confirm-clear-canvas-button",className:"clear-canvas--confirm"}),(0,P.jsx)(Al,{type:"button",title:I("buttons.cancel"),"aria-label":I("buttons.cancel"),label:I("buttons.cancel"),onClick:a,"data-testid":"cancel-clear-canvas-button",className:"clear-canvas--cancel"})]})]})})]})});function Kc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Zc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Kc(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Xs({name:"changeViewBackgroundColor",perform:function(e,t,n){return{appState:Zc(Zc({},t),n),commitToHistory:!!n.viewBackgroundColor}},PanelComponent:function(e){var t=e.appState,n=e.updateData;return(0,P.jsx)("div",{style:{position:"relative"},children:(0,P.jsx)(jc,{label:I("labels.canvasBackground"),type:"canvasBackground",color:t.viewBackgroundColor,onChange:function(e){return n({viewBackgroundColor:e})},isActive:"canvasColorPicker"===t.openPopup,setActive:function(e){return n({openPopup:e?"canvasColorPicker":null})},"data-testid":"canvas-background-picker"})})}}),Xs({name:"clearCanvas",perform:function(e,t,n,r){return r.imageCache.clear(),{elements:e.map((function(e){return fo(e,{isDeleted:!0})})),appState:Zc(Zc({},sr()),{},{files:{},theme:t.theme,elementLocked:t.elementLocked,exportBackground:t.exportBackground,exportEmbedScene:t.exportEmbedScene,gridSize:t.gridSize,showStats:t.showStats,pasteDialog:t.pasteDialog}),commitToHistory:!0}},PanelComponent:function(e){var t=e.updateData;return(0,P.jsx)(Wc,{onConfirm:t})}}),Xs({name:"zoomIn",perform:function(e,t){var n=Sl(El(t.zoom.value+d.V4),t.zoom,{left:t.offsetLeft,top:t.offsetTop},{x:t.width/2,y:t.height/2});return{appState:Zc(Zc({},t),{},{zoom:n}),commitToHistory:!1}},PanelComponent:function(e){var t=e.updateData;return(0,P.jsx)(Al,{type:"button",icon:Yl,title:"".concat(I("buttons.zoomIn")," — ").concat(Xn("CtrlOrCmd++")),"aria-label":I("buttons.zoomIn"),onClick:function(){t(null)},size:"small"})},keyTest:function(e){return(e.code===zt||e.code===Bt)&&(e[un]||e.shiftKey)}}),Xs({name:"zoomOut",perform:function(e,t){var n=Sl(El(t.zoom.value-d.V4),t.zoom,{left:t.offsetLeft,top:t.offsetTop},{x:t.width/2,y:t.height/2});return{appState:Zc(Zc({},t),{},{zoom:n}),commitToHistory:!1}},PanelComponent:function(e){var t=e.updateData;return(0,P.jsx)(Al,{type:"button",icon:Xl,title:"".concat(I("buttons.zoomOut")," — ").concat(Xn("CtrlOrCmd+-")),"aria-label":I("buttons.zoomOut"),onClick:function(){t(null)},size:"small"})},keyTest:function(e){return(e.code===Ht||e.code===Nt)&&(e[un]||e.shiftKey)}}),Xs({name:"resetZoom",perform:function(e,t){return{appState:Zc(Zc({},t),{},{zoom:Sl(1,t.zoom,{left:t.offsetLeft,top:t.offsetTop},{x:t.width/2,y:t.height/2})}),commitToHistory:!1}},PanelComponent:function(e){var t=e.updateData,n=e.appState;return(0,P.jsx)(Bc,{label:I("buttons.resetZoom"),children:(0,P.jsxs)(Al,{type:"button",className:"reset-zoom-button",title:I("buttons.resetZoom"),"aria-label":I("buttons.resetZoom"),onClick:function(){t(null)},size:"small",children:[(100*n.zoom.value).toFixed(0),"%"]})})},keyTest:function(e){return(e.code===Kt||e.code===Rt)&&(e[un]||e.shiftKey)}});var Yc=function(e,t,n){var r=nl(e),o=dl(r,t),a=n&&o.length>0?Ot(o):Ot(r),i=function(e,t){var n=g(e,4),r=n[0],o=n[1],a=n[2],i=n[3],l=a-r,s=t.width/l,c=i-o,u=t.height/c,p=Math.min(s,u),f=Math.floor(p/d.V4)*d.V4;return Math.min(Math.max(f,d.V4),1)}(a,{width:t.width,height:t.height}),l=Sl(i,t.zoom,{left:t.offsetLeft,top:t.offsetTop}),s=g(a,4),c=s[0],u=s[1],p=(c+s[2])/2,f=(u+s[3])/2;return{appState:Zc(Zc(Zc({},t),fl({scenePoint:{x:p,y:f},viewportDimensions:{width:t.width,height:t.height},zoom:l})),{},{zoom:l}),commitToHistory:!1}};Xs({name:"zoomToSelection",perform:function(e,t){return Yc(e,t,!0)},keyTest:function(e){return e.code===Gt&&e.shiftKey&&!e.altKey&&!e[un]}}),Xs({name:"zoomToFit",perform:function(e,t){return Yc(e,t,!1)},keyTest:function(e){return e.code===Ut&&e.shiftKey&&!e.altKey&&!e[un]}}),Xs({name:"toggleTheme",perform:function(e,t,n){return{appState:Zc(Zc({},t),{},{theme:n||(t.theme===d.C6.LIGHT?d.C6.DARK:d.C6.LIGHT)}),commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData;return(0,P.jsx)("div",{style:{marginInlineStart:"0.25rem"},children:(0,P.jsx)(Dc,{value:t.theme,onChange:function(e){n(e)}})})},keyTest:function(e){return e.altKey&&e.shiftKey&&e.code===Xt}});function Xc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function qc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xc(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var $c,Qc,Jc,eu=Xs({name:"finalize",perform:function(e,t,n,r){var o,a=r.canvas,i=r.focusContainer;if(t.editingLinearElement){var l=t.editingLinearElement,s=l.elementId,c=l.startBindingElement,u=l.endBindingElement,d=li.getElement(s);if(d)return rt(d)&&ui(d,c,u),{elements:d.points.length<2||mo(d)?e.filter((function(e){return e.id!==d.id})):void 0,appState:qc(qc({},t),{},{editingLinearElement:null}),commitToHistory:!0}}var p=e;t.pendingImageElement&&po(t.pendingImageElement,{isDeleted:!0},!1),window.document.activeElement instanceof HTMLElement&&i();var f=t.multiElement?t.multiElement:"freedraw"===(null===(o=t.editingElement)||void 0===o?void 0:o.type)?t.editingElement:null;if(f){if("freedraw"!==f.type&&"touch"!==t.lastPointerDownWith){var h=f.points,m=f.lastCommittedPoint;m&&h[h.length-1]===m||po(f,{points:f.points.slice(0,-1)})}mo(f)&&(p=p.slice(0,-1));var v=ut(f.points,t.zoom.value);if(("line"===f.type||"freedraw"===f.type)&&v){var b=f.points,y=b[0];po(f,{points:b.map((function(e,t){return t===b.length-1?[y[0],y[1]]:e}))})}if(rt(f)&&!v&&f.points.length>1){var x=g(li.getPointAtIndexGlobalCoordinates(f,-1),2),w=x[0],k=x[1];hi(f,t,ao.getScene(f),{x:w,y:k})}t.elementLocked||"freedraw"===t.elementType||(t.selectedElementIds[f.id]=!0)}return(t.elementLocked||"freedraw"===t.elementType)&&f||Wn(a),{elements:p,appState:qc(qc({},t),{},{elementType:(t.elementLocked||"freedraw"===t.elementType)&&f?t.elementType:"selection",draggingElement:null,multiElement:null,editingElement:null,startBoundElement:null,suggestedBindings:[],selectedElementIds:f&&!t.elementLocked&&"freedraw"!==t.elementType?qc(qc({},t.selectedElementIds),{},D({},f.id,!0)):t.selectedElementIds,pendingImageElement:null}),commitToHistory:"freedraw"===t.elementType}},keyTest:function(e,t){return e.key===fn&&(null!==t.editingLinearElement||!t.draggingElement&&null===t.multiElement)||(e.key===fn||e.key===pn)&&null!==t.multiElement},PanelComponent:function(e){var t=e.appState,n=e.updateData;return(0,P.jsx)(Al,{type:"button",icon:ql,title:I("buttons.done"),"aria-label":I("buttons.done"),onClick:n,visible:null!=t.multiElement})}}),tu="undefined"!=typeof process&&null!==($c=process.env)&&void 0!==$c&&$c.REACT_APP_GOOGLE_ANALYTICS_ID&&"undefined"!=typeof window&&window.gtag?function(e,t,n,r){window.gtag("event",t,{event_category:e,event_label:n,value:r})}:("undefined"!=typeof process&&null!==(Qc=process.env)&&void 0!==Qc&&Qc.JEST_WORKER_ID,function(e,t,n,r){}),nu=(n(518),n(9966),function(e){var t=Dh().id,n=g((0,c.useState)(e.value),2),r=n[0],o=n[1];return(0,P.jsxs)("div",{className:"ProjectName",children:[(0,P.jsx)("label",{className:"ProjectName-label",htmlFor:"filename",children:"".concat(e.label).concat(e.isNameEditable?"":":")}),e.isNameEditable?(0,P.jsx)("input",{className:"TextInput",onBlur:function(t){!function(e){for(var t=e.parentElement;t;){if(t.tabIndex>-1)return void t.focus();t=t.parentElement}}(t.target);var n=t.target.value;n!==e.value&&e.onChange(n)},onKeyDown:function(e){if("Enter"===e.key){if(e.preventDefault(),e.nativeEvent.isComposing||229===e.keyCode)return;e.currentTarget.blur()}},id:"".concat(t,"-filename"),value:r,onChange:function(e){return o(e.target.value)}}):(0,P.jsx)("span",{className:"TextInput TextInput--readonly",id:"".concat(t,"-filename"),children:e.value})]})}),ru=function(e,t,n,r,o,a){e.beginPath(),e.moveTo(t+a,n),e.lineTo(t+r-a,n),e.quadraticCurveTo(t+r,n,t+r,n+a),e.lineTo(t+r,n+o-a),e.quadraticCurveTo(t+r,n+o,t+r-a,n+o),e.lineTo(t+a,n+o),e.quadraticCurveTo(t,n+o,t,n+o-a),e.lineTo(t,n+a),e.quadraticCurveTo(t,n,t+a,n),e.closePath(),e.fill(),e.stroke()},ou=function(e,t){if(null!=t&&t.collaborators){var n=t.collaborators.get(e);if(null!=n&&n.color)return n.color}var r=e.split("").reduce((function(e,t){return e+t.charCodeAt(0)}),0),o=At.elementBackground.slice(1),a=At.elementStroke.slice(1);return{background:o[r%o.length],stroke:a[r%a.length]}};function au(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return iu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return iu(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}function iu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}!function(e){e.ACTIVE="active",e.AWAY="away",e.IDLE="idle"}(Jc||(Jc={}));var lu=function(){var e=document.createElement("canvas").getContext("2d");if(!e)return!1;return e.fillStyle="#f00",e.textBaseline="top",e.font="32px Arial",e.fillText("😀",0,0),0!==e.getImageData(12,12,1,1).data[0]}(),su=function(e,t,n,r,o,a,i,l){var s=arguments.length>8&&void 0!==arguments[8]&&arguments[8];e.save(),e.translate(a,i),e.rotate(l),s&&e.fillRect(t-a,n-i,r,o),e.strokeRect(t-a,n-i,r,o),e.restore()},cu=function(e,t,n,r){e.beginPath(),e.arc(t,n,r,0,2*Math.PI),e.fill(),e.stroke()},uu=function(e,t,n,r,o,a){e.save(),e.strokeStyle="rgba(0,0,0,0.1)",e.beginPath();for(var i=n;i<n+o+2*t;i+=t)e.moveTo(i,r-t),e.lineTo(i,r+a+2*t);for(var l=r;l<r+a+2*t;l+=t)e.moveTo(n-t,l),e.lineTo(n+o+2*t,l);e.stroke(),e.restore()},du=function(e,t,n,r){e.save(),e.translate(n.scrollX,n.scrollY),e.lineWidth=1/n.zoom.value,li.getPointsGlobalCoordinates(r).forEach((function(r,o){var a;e.strokeStyle="red",e.setLineDash([]),e.fillStyle=(null===(a=t.editingLinearElement)||void 0===a?void 0:a.activePointIndex)===o?"rgba(255, 127, 127, 0.9)":"rgba(255, 255, 255, 0.9)";var i=li.POINT_HANDLE_SIZE;cu(e,r[0],r[1],i/2/n.zoom.value)})),e.restore()},pu=function(e,t,n,r,o,a,i){var l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:{},s=l.renderScrollbars,c=void 0===s||s,u=l.renderSelection,p=void 0===u||u,f=l.renderOptimizations,h=void 0!==f&&f,m=l.renderGrid,v=void 0===m||m,b=l.isExport,y=void 0!==b&&b;if(null===a)return{atLeastOneVisibleElement:!1};var x=a.getContext("2d");x.setTransform(1,0,0,1,0,0),x.save(),x.scale(r,r);var w=a.width/r,k=a.height/r;if(y&&"dark"===i.theme&&(x.filter=d.ZF),"string"==typeof i.viewBackgroundColor){var S="transparent"===i.viewBackgroundColor||5===i.viewBackgroundColor.length||9===i.viewBackgroundColor.length||/(hsla|rgba)\(/.test(i.viewBackgroundColor);S&&x.clearRect(0,0,w,k),x.save(),x.fillStyle=i.viewBackgroundColor,x.fillRect(0,0,w,k),x.restore()}else x.clearRect(0,0,w,k);var E=i.zoom.translation.x,C=i.zoom.translation.y;x.save(),x.translate(E,C),x.scale(i.zoom.value,i.zoom.value),v&&t.gridSize&&uu(x,t.gridSize,-Math.ceil(E/i.zoom.value/t.gridSize)*t.gridSize+i.scrollX%t.gridSize,-Math.ceil(C/i.zoom.value/t.gridSize)*t.gridSize+i.scrollY%t.gridSize,w/i.zoom.value,k/i.zoom.value);var j,O=e.filter((function(e){return bu(e,w,k,{zoom:i.zoom,offsetLeft:t.offsetLeft,offsetTop:t.offsetTop,scrollX:i.scrollX,scrollY:i.scrollY})}));if(O.forEach((function(e){try{Xr(e,o,x,h,i)}catch(e){console.error(e)}})),t.editingLinearElement){var M=li.getElement(t.editingLinearElement.elementId);M&&du(x,t,i,M)}if(n)try{Xr(n,o,x,h,i)}catch(e){console.error(e)}if(ci(t)&&t.suggestedBindings.filter((function(e){return null!=e})).forEach((function(e){mu(x,i,e)})),p&&!t.multiElement&&!t.editingLinearElement){var I,P=e.reduce((function(e,n){var r=[];if(t.selectedElementIds[n.id]&&!Eo(t,n)&&r.push(Pt.black),i.remoteSelectedElementIds[n.id]&&r.push.apply(r,_(i.remoteSelectedElementIds[n.id].map((function(e){var n,r=null===(n=t.collaborators.get(e))||void 0===n?void 0:n.picture;return ou(r||e,t).background})))),r.length){var o=g(xt(n),4),a=o[0],l=o[1],s=o[2],c=o[3];e.push({angle:n.angle,elementX1:a,elementY1:l,elementX2:s,elementY2:c,selectionColors:r})}return e}),[]),T=function(t){var n=Io(e,t),r=g(Ot(n),4),o=r[0],a=r[1],i=r[2],l=r[3];P.push({angle:0,elementX1:o,elementX2:i,elementY1:a,elementY2:l,selectionColors:[Pt.black]})},A=au(jo(t));try{for(A.s();!(I=A.n()).done;){var L=I.value;T(L)}}catch(e){A.e(e)}finally{A.f()}t.editingGroupId&&T(t.editingGroupId),P.forEach((function(e){return hu(x,i,e)}));var D=dl(e,t);if(x.save(),x.translate(i.scrollX,i.scrollY),1===D.length){x.fillStyle=Pt.white;var z=Xo(D[0],i.zoom,"mouse");t.viewModeEnabled||fu(x,i,z,D[0].angle)}else if(D.length>1&&!t.isRotating){var H=4/i.zoom.value;x.fillStyle=Pt.white;var B=Ot(D),N=g(B,4),R=N[0],F=N[1],V=N[2],U=N[3],G=x.getLineDash();x.setLineDash([2/i.zoom.value]);var W=x.lineWidth;x.lineWidth=1/i.zoom.value,su(x,R-H,F-H,V-R+2*H,U-F+2*H,(R+V)/2,(F+U)/2,0),x.lineWidth=W,x.setLineDash(G);var K=Yo([R,F,V,U],0,i.zoom,"mouse",Uo);fu(x,i,K,0)}x.restore()}for(var Z in x.restore(),i.remotePointerViewportCoords){var Y,X=i.remotePointerViewportCoords[Z],q=X.x,$=X.y;q-=t.offsetLeft,$-=t.offsetTop;var Q=9,J=14,ee=q<0||q>w-Q||$<0||$>k-J;q=Math.max(q,0),q=Math.min(q,w-Q),$=Math.max($,0),$=Math.min($,k-J);var te=null===(Y=t.collaborators.get(Z))||void 0===Y?void 0:Y.picture,ne=ou(te||Z,t),re=ne.background,oe=ne.stroke;x.save(),x.strokeStyle=oe,x.fillStyle=re;var ae=i.remotePointerUserStates[Z];(ee||ae===Jc.AWAY)&&(x.globalAlpha=.48),i.remotePointerButton&&"down"===i.remotePointerButton[Z]&&(x.beginPath(),x.arc(q,$,15,0,2*Math.PI,!1),x.lineWidth=3,x.strokeStyle="#ffffff88",x.stroke(),x.closePath(),x.beginPath(),x.arc(q,$,15,0,2*Math.PI,!1),x.lineWidth=1,x.strokeStyle=oe,x.stroke(),x.closePath()),x.beginPath(),x.moveTo(q,$),x.lineTo(q+1,$+14),x.lineTo(q+4,$+9),x.lineTo(q+9,$+10),x.lineTo(q,$),x.fill(),x.stroke();var ie=i.remotePointerUsernames[Z],le="";ae===Jc.AWAY?le=lu?"⚫️":" (".concat(Jc.AWAY,")"):ae===Jc.IDLE?le=lu?"💤":" (".concat(Jc.IDLE,")"):ae===Jc.ACTIVE&&(le=lu?"🟢":"");var se="".concat(ie?"".concat(ie," "):"").concat(le);if(!ee&&se){var ce=q+Q,ue=$+J,de=4,pe=4,fe=x.measureText(se),he=fe.actualBoundingBoxDescent+fe.actualBoundingBoxAscent;x.fillStyle=oe,x.fillRect(ce-1,ue-1,fe.width+2*de+2,he+2*pe+2),x.fillStyle=re,x.fillRect(ce,ue,fe.width+2*de,he+2*pe),x.fillStyle=Pt.white,x.fillText(se,ce+de,ue+pe+fe.actualBoundingBoxAscent)}x.restore(),x.closePath()}return c&&(j=sl(e,w,k,i),x.save(),x.fillStyle=ll,x.strokeStyle="rgba(255,255,255,0.8)",[j.horizontal,j.vertical].forEach((function(e){e&&ru(x,e.x,e.y,e.width,e.height,3)})),x.restore()),x.restore(),{atLeastOneVisibleElement:O.length>0,scrollBars:j}},fu=function(e,t,n,r){Object.keys(n).forEach((function(o){var a=n[o];void 0!==a&&(e.save(),e.lineWidth=1/t.zoom.value,"rotation"===o?cu(e,a[0]+a[2]/2,a[1]+a[3]/2,a[2]/2):su(e,a[0],a[1],a[2],a[3],a[0]+a[2]/2,a[1]+a[3]/2,r,!0),e.restore())}))},hu=function(e,t,n){var r=n.angle,o=n.elementX1,a=n.elementY1,i=n.elementX2,l=n.elementY2,s=n.selectionColors,c=i-o,u=l-a,d=4/t.zoom.value,p=8/t.zoom.value,f=4/t.zoom.value;e.save(),e.translate(t.scrollX,t.scrollY),e.lineWidth=1/t.zoom.value;for(var h=s.length,m=0;m<h;++m)e.strokeStyle=s[m],e.setLineDash([p,f+(p+f)*(h-1)]),e.lineDashOffset=(p+f)*m,su(e,o-d,a-d,c+2*d,u+2*d,o+c/2,a+u/2,r);e.restore()},mu=function(e,t,n){var r=Array.isArray(n)?vu:gu;e.save(),e.translate(t.scrollX,t.scrollY),r(e,n),e.restore()},gu=function(e,t){var n=g(xt(t),4),r=n[0],o=n[1],a=n[2]-r,i=n[3]-o,l=ja(t,a,i);e.strokeStyle="rgba(0,0,0,.05)",e.lineWidth=l-4;var s=2+l/2;switch(t.type){case"rectangle":case"text":su(e,r-s,o-s,a+2*s,i+2*s,r+a/2,o+i/2,t.angle);break;case"diamond":var c=Math.hypot(a,i);!function(e,t,n,r,o,a){e.save(),e.translate(r,o),e.rotate(a),e.beginPath(),e.moveTo(0,n/2),e.lineTo(t/2,0),e.lineTo(0,-n/2),e.lineTo(-t/2,0),e.closePath(),e.stroke(),e.restore()}(e,a+2*(s*c/i),i+2*(s*c/a),r+a/2,o+i/2,t.angle);break;case"ellipse":!function(e,t,n,r,o,a){e.beginPath(),e.ellipse(r,o,t/2,n/2,a,0,2*Math.PI),e.stroke()}(e,a+2*s,i+2*s,r+a/2,o+i/2,t.angle)}},vu=function(e,t){var n=g(t,3),r=n[0],o=n[1],a=n[2],i=ja(a,a.width,a.height);e.strokeStyle="rgba(0,0,0,0)",e.fillStyle="rgba(0,0,0,.05)",("both"===o?[0,-1]:"start"===o?[0]:[-1]).forEach((function(t){var n=g(li.getPointAtIndexGlobalCoordinates(r,t),2),o=n[0],a=n[1];cu(e,o,a,i)}))},bu=function(e,t,n,r){var o=g(jt(e),4),a=o[0],i=o[1],l=o[2],s=o[3],c=qn({clientX:r.offsetLeft,clientY:r.offsetTop},r),u=qn({clientX:r.offsetLeft+t,clientY:r.offsetTop+n},r);return c.x<=l&&c.y<=s&&u.x>=a&&u.y>=i},yu=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=o.offsetX,i=void 0===a?0:a,l=o.offsetY,s=void 0===l?0:l;n&&e.forEach((function(e){if(!e.isDeleted)try{$r(e,t,n,r,e.x+i,e.y+s)}catch(e){console.error(e)}}))};var xu=(()=>{if("undefined"==typeof self)return!1;if("top"in self&&self!==top)try{top.location}catch{return!1}else if("showOpenFilePicker"in self)return"showOpenFilePicker";return!1})();const wu=xu?n.e(736).then(n.bind(n,6327)):n.e(736).then(n.bind(n,2343));xu?n.e(736).then(n.bind(n,9655)):n.e(736).then(n.bind(n,3610));const ku=xu?n.e(736).then(n.bind(n,5791)):n.e(736).then(n.bind(n,2138));var Su=function(e){var t,n,r,o=null===(t=e.extensions)||void 0===t?void 0:t.reduce((function(e,t){return e.push(d.LO[t]),e}),[]),a=null===(n=e.extensions)||void 0===n?void 0:n.reduce((function(e,t){return"jpg"===t?e.concat(".jpg",".jpeg"):e.concat(".".concat(t))}),[]);return async function(...e){return(await wu).default(...e)}({description:e.description,extensions:a,mimeTypes:o,multiple:null!==(r=e.multiple)&&void 0!==r&&r,legacySetup:function(t,n,r){var o=Un(n,500),a=function(){i(),document.addEventListener(d.Ks.KEYUP,o),document.addEventListener(d.Ks.POINTER_UP,o),o()},i=function(){var n;if(null!==(n=r.files)&&void 0!==n&&n.length){var o=e.multiple?_(r.files):r.files[0];t(o)}};requestAnimationFrame((function(){window.addEventListener(d.Ks.FOCUS,a)}));var l=window.setInterval((function(){i()}),500);return function(e){clearInterval(l),o.cancel(),window.removeEventListener(d.Ks.FOCUS,a),document.removeEventListener(d.Ks.KEYUP,o),document.removeEventListener(d.Ks.POINTER_UP,o),e&&(console.warn("Opening the file was canceled (legacy-fs)."),e(new Pl))}}})},Eu=function(e,t){return async function(...e){return(await ku).default(...e)}(e,{fileName:"".concat(t.name,".").concat(t.extension),description:t.description,extensions:[".".concat(t.extension)]},t.fileHandle)};function Cu(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ju(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ju(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}function ju(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ou(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Mu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ou(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ou(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Iu={selection:!0,text:!0,rectangle:!0,diamond:!0,ellipse:!0,line:!0,image:!0,arrow:!0,freedraw:!0},Pu=function(e,t){var n,r,o,a,i,l,s,c,u,d,p,f,h={type:t.type||e.type,version:e.version||1,versionNonce:null!==(n=e.versionNonce)&&void 0!==n?n:0,isDeleted:null!==(r=e.isDeleted)&&void 0!==r&&r,id:e.id||so(),fillStyle:e.fillStyle||"hachure",strokeWidth:e.strokeWidth||1,strokeStyle:null!==(o=e.strokeStyle)&&void 0!==o?o:"solid",roughness:null!==(a=e.roughness)&&void 0!==a?a:1,opacity:null==e.opacity?100:e.opacity,angle:e.angle||0,x:null!==(i=null!==(l=t.x)&&void 0!==l?l:e.x)&&void 0!==i?i:0,y:null!==(s=null!==(c=t.y)&&void 0!==c?c:e.y)&&void 0!==s?s:0,strokeColor:e.strokeColor,backgroundColor:e.backgroundColor,width:e.width||0,height:e.height||0,seed:null!==(u=e.seed)&&void 0!==u?u:1,groupIds:null!==(d=e.groupIds)&&void 0!==d?d:[],strokeSharpness:null!==(p=e.strokeSharpness)&&void 0!==p?p:nt(e.type)?"round":"sharp",boundElementIds:null!==(f=e.boundElementIds)&&void 0!==f?f:[]};return Mu(Mu(Mu({},h),vo(h)),t)},Tu=function(e){var t,n;switch(e.type){case"text":var r=e.fontSize,o=e.fontFamily;if("font"in e){var a=g(e.font.split(" "),2),i=a[0],l=a[1];r=parseInt(i,10),n=l,o=Object.keys(d.ut).includes(n)?d.ut[n]:d.rk}return Pu(e,{fontSize:r,fontFamily:o,text:null!==(t=e.text)&&void 0!==t?t:"",baseline:e.baseline,textAlign:e.textAlign||d.Hg,verticalAlign:e.verticalAlign||d.hs});case"freedraw":return Pu(e,{points:e.points,lastCommittedPoint:null,simulatePressure:e.simulatePressure,pressures:e.pressures});case"image":return Pu(e,{status:e.status||"pending",fileId:e.fileId,scale:e.scale||[1,1]});case"line":case"draw":case"arrow":var s=e.startArrowhead,c=void 0===s?null:s,u=e.endArrowhead,p=void 0===u?"arrow"===e.type?"arrow":null:u,f=e.x,h=e.y,m=!Array.isArray(e.points)||e.points.length<2?[[0,0],[e.width,e.height]]:e.points;if(0!==m[0][0]||0!==m[0][1]){var v=li.getNormalizedPoints(e);m=v.points,f=v.x,h=v.y}return Pu(e,{type:"draw"===e.type?"line":e.type,startBinding:e.startBinding,endBinding:e.endBinding,lastCommittedPoint:null,startArrowhead:c,endArrowhead:p,points:m,x:f,y:h});case"ellipse":case"rectangle":case"diamond":return Pu(e,{})}},Au=function(e,t){var n=t?el(t):null;return(e||[]).reduce((function(e,t){if("selection"!==t.type&&!mo(t)){var r=Tu(t);if(r){var o=null==n?void 0:n[t.id];o&&o.version>r.version&&(r=ho(r,o.version)),e.push(r)}}return e}),[])},Lu=function(e,t){e=e||{};var n,r=sr(),o={},a=Cu(Object.entries(r));try{for(a.s();!(n=a.n()).done;){var i=g(n.value,2),l=i[0],s=i[1],c=e[l],u=t?t[l]:void 0;o[l]=void 0!==c?c:void 0!==u?u:s}}catch(e){a.e(e)}finally{a.f()}return Mu(Mu({},o),{},{elementType:Iu[o.elementType]?o.elementType:"selection",zoom:"number"==typeof e.zoom?{value:e.zoom,translation:r.zoom.translation}:e.zoom||r.zoom})},_u=function(e,t,n){return{elements:Au(null==e?void 0:e.elements,n),appState:Lu(null==e?void 0:e.appState,t||null),files:(null==e?void 0:e.files)||{}}};function Du(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Du(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Du(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Hu=function(){var e=(0,f.Z)(b().mark((function e(t){var r;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.type!==d.LO.png){e.next=18;break}return e.prev=1,e.next=4,Promise.all([n.e(736),n.e(9)]).then(n.bind(n,673));case 4:return e.next=6,e.sent.decodePngMetadata(t);case 6:return e.abrupt("return",e.sent);case 9:if(e.prev=9,e.t0=e.catch(1),"INVALID"!==e.t0.message){e.next=15;break}throw new DOMException(I("alerts.imageDoesNotContainScene"),"EncodingError");case 15:throw new DOMException(I("alerts.cannotRestoreFromImage"),"EncodingError");case 16:e.next=43;break;case 18:if(!("text"in Blob)){e.next=24;break}return e.next=21,t.text();case 21:r=e.sent,e.next=27;break;case 24:return e.next=26,new Promise((function(e){var n=new FileReader;n.readAsText(t,"utf8"),n.onloadend=function(){n.readyState===FileReader.DONE&&e(n.result)}}));case 26:r=e.sent;case 27:if(t.type!==d.LO.svg){e.next=43;break}return e.prev=28,e.next=31,Promise.all([n.e(736),n.e(9)]).then(n.bind(n,673));case 31:return e.next=33,e.sent.decodeSvgMetadata({svg:r});case 33:return e.abrupt("return",e.sent);case 36:if(e.prev=36,e.t1=e.catch(28),"INVALID"!==e.t1.message){e.next=42;break}throw new DOMException(I("alerts.imageDoesNotContainScene"),"EncodingError");case 42:throw new DOMException(I("alerts.cannotRestoreFromImage"),"EncodingError");case 43:return e.abrupt("return",r);case 44:case"end":return e.stop()}}),e,null,[[1,9],[28,36]])})));return function(t){return e.apply(this,arguments)}}(),Bu=function(e){var t;return e&&(null===(t=e.name.match(/\.(json|excalidraw|png|svg)$/))||void 0===t?void 0:t[1])||null},Nu=function(e){var t=Bu(e);return"png"===t||"svg"===t},Ru=function(e){var t=(e||{}).type;return!!t&&d.jo.includes(t)},Fu=function(){var e=(0,f.Z)(b().mark((function e(t,n,r){var o,a,i;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Hu(t);case 2:if(o=e.sent,e.prev=3,a=JSON.parse(o),td(a)){e.next=7;break}throw new Error(I("alerts.couldNotLoadInvalidFile"));case 7:return i=_u({elements:il(a.elements||[]),appState:zu(zu({theme:null==n?void 0:n.theme,fileHandle:t.handle||null},pr(a.appState||{})),n?hl(a.elements||[],n):{}),files:a.files},n,r),e.abrupt("return",i);case 11:throw e.prev=11,e.t0=e.catch(3),console.error(e.t0.message),new Error(I("alerts.couldNotLoadInvalidFile"));case 15:case"end":return e.stop()}}),e,null,[[3,11]])})));return function(t,n,r){return e.apply(this,arguments)}}(),Vu=function(){var e=(0,f.Z)(b().mark((function e(t){var n,r;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Hu(t);case 2:if(n=e.sent,(r=JSON.parse(n)).type===d.r8.excalidrawLibrary){e.next=6;break}throw new Error(I("alerts.couldNotLoadInvalidFile"));case 6:return e.abrupt("return",r);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Uu=function(){var e=(0,f.Z)(b().mark((function e(t){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){try{t.toBlob((function(t){if(!t)return n(new Il(I("canvasError.canvasTooBig"),"CANVAS_POSSIBLY_TOO_BIG"));e(t)}))}catch(e){n(e)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Gu=function(){var e=(0,f.Z)(b().mark((function e(t){var n,r;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.t0=window.crypto.subtle,e.next=4,t.arrayBuffer();case 4:return e.t1=e.sent,e.next=7,e.t0.digest.call(e.t0,"SHA-1",e.t1);case 7:r=e.sent,n=Array.from(new Uint8Array(r)).map((function(e){return e.toString(16).padStart(2,"0")})).join(""),e.next=15;break;case 11:e.prev=11,e.t2=e.catch(0),console.error(e.t2),n=Xe(40);case 15:return e.abrupt("return",n);case 16:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(t){return e.apply(this,arguments)}}(),Wu=function(){var e=(0,f.Z)(b().mark((function e(t){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var r=new FileReader;r.onload=function(){var t=r.result;e(t)},r.onerror=function(e){return n(e)},r.readAsDataURL(t)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ku=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e.indexOf(","),r=atob(e.slice(n+1)),o=e.slice(0,n).split(":")[1].split(";")[0],a=new ArrayBuffer(r.length),i=new Uint8Array(a),l=0;l<r.length;l++)i[l]=r.charCodeAt(l);return new File([a],t,{type:o})},Zu=function(){var e=(0,f.Z)(b().mark((function e(t,r){var o,a,i,l,s,c;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.type!==d.LO.svg){e.next=2;break}return e.abrupt("return",t);case 2:return e.next=4,Promise.all([n.e(736).then(n.t.bind(n,4881,23)).then((function(e){return e.default})),n.e(736).then(n.bind(n,100)).then((function(e){return e.default}))]);case 4:if(o=e.sent,a=g(o,2),i=a[0],l=a[1],s=l({pica:i({features:["js","wasm"]})}),c=t.type,Ru(t)){e.next=12;break}throw new Error(I("errors.unsupportedFileType"));case 12:return e.t0=File,e.next=15,s.toBlob(t,{max:r});case 15:return e.t1=e.sent,e.t2=[e.t1],e.t3=t.name,e.t4={type:c},e.abrupt("return",new e.t0(e.t2,e.t3,e.t4));case 20:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),Yu=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return new File([(new TextEncoder).encode(e)],t,{type:d.LO.svg})};function Xu(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return qu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qu(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}function qu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var $u=function(e,t){var n,r={},o=Xu(e);try{for(o.s();!(n=o.n()).done;){var a=n.value;!a.isDeleted&&"fileId"in a&&a.fileId&&t[a.fileId]&&(r[a.fileId]=t[a.fileId])}}catch(e){o.e(e)}finally{o.f()}return r},Qu=function(e,t,n,r){var o={type:d.r8.excalidraw,version:2,source:d.pb,elements:"local"===r?il(e):al(e),appState:"local"===r?pr(t):fr(t),files:"local"===r?$u(e,n):void 0};return JSON.stringify(o,null,2)},Ju=function(){var e=(0,f.Z)(b().mark((function e(t,n,r){var o,a,i;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=Qu(t,n,r,"local"),a=new Blob([o],{type:d.LO.excalidraw}),e.next=4,Eu(a,{name:n.name,extension:"excalidraw",description:"Excalidraw file",fileHandle:Nu(n.fileHandle)?null:n.fileHandle});case 4:return i=e.sent,e.abrupt("return",{fileHandle:i});case 6:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),ed=function(){var e=(0,f.Z)(b().mark((function e(t,n){var r;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Su({description:"Excalidraw files"});case 2:return r=e.sent,e.abrupt("return",Fu(r,t,n));case 4:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),td=function(e){return(null==e?void 0:e.type)===d.r8.excalidraw&&(!e.elements||Array.isArray(e.elements)&&(!e.appState||"object"===L(e.appState)))},nd=function(e){return"object"===L(e)&&e&&e.type===d.r8.excalidrawLibrary&&1===e.version},rd=function(){var e=(0,f.Z)(b().mark((function e(t){var n,r,o;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.loadLibrary();case 2:return n=e.sent,r={type:d.r8.excalidrawLibrary,version:1,source:d.pb,library:n},o=JSON.stringify(r,null,2),e.next=7,Eu(new Blob([o],{type:d.LO.excalidrawlib}),{name:"library",extension:"excalidrawlib",description:"Excalidraw library file"});case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),od=function(){var e=(0,f.Z)(b().mark((function e(t){var n;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Su({description:"Excalidraw library files"});case 2:return n=e.sent,e.next=5,t.importLibrary(n);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function ad(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function id(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ad(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ad(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ld=function(e){return new Promise((function(t,n){var r=new Image;r.onload=function(){t(r)},r.onerror=function(e){n(e)},r.src=e}))},sd=function(){var e=(0,f.Z)(b().mark((function e(t){var n,r,o,a,i;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.fileIds,r=t.files,o=t.imageCache,a=new Map,i=new Map,e.next=5,Promise.all(n.reduce((function(e,t){var n=r[t];return n&&!a.has(t)?(a.set(t,!0),e.concat((0,f.Z)(b().mark((function e(){var r,a,l;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,n.mimeType!==d.LO.binary){e.next=3;break}throw new Error("Only images can be added to ImageCache");case 3:return r=ld(n.dataURL),a={image:r,mimeType:n.mimeType},o.set(t,a),e.next=8,r;case 8:l=e.sent,o.set(t,id(id({},a),{},{image:l})),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),i.set(t,!0);case 15:case"end":return e.stop()}}),e,null,[[0,12]])})))())):e}),[]));case 5:return e.abrupt("return",{imageCache:o,updatedFiles:a,erroredFiles:i});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),cd=function(e){return e.filter((function(e){return qe(e)}))},ud=function(){var e=(0,f.Z)(b().mark((function e(t){var n,r;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(new DOMParser).parseFromString(t,d.LO.svg),r=n.querySelector("svg"),!n.querySelector("parsererror")&&"svg"===(null==(o=r)?void 0:o.nodeName.toLowerCase())){e.next=7;break}throw new Error(I("errors.invalidSVGString"));case 7:return r.hasAttribute("xmlns")||r.setAttribute("xmlns",d.hR),e.abrupt("return",r.outerHTML);case 9:case"end":return e.stop()}var o}),e)})));return function(t){return e.apply(this,arguments)}}(),dd="\x3c!-- svg-source:excalidraw --\x3e",pd=function(){var e=(0,f.Z)(b().mark((function e(t,n,r,o){var a,i,l,s,c,u,p,f,h,m,v,y,x,w,k,S,E,C,j=arguments;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=o.exportBackground,i=o.exportPadding,l=void 0===i?d.qy:i,s=o.viewBackgroundColor,c=j.length>4&&void 0!==j[4]?j[4]:function(e,t){var r=document.createElement("canvas");return r.width=e*n.exportScale,r.height=t*n.exportScale,{canvas:r,scale:n.exportScale}},u=hd(t,l),p=g(u,4),f=p[0],h=p[1],m=p[2],v=p[3],y=c(m,v),x=y.canvas,w=y.scale,k=void 0===w?1:w,S=sr(),e.next=7,sd({imageCache:new Map,fileIds:cd(t).map((function(e){return e.fileId})),files:r});case 7:return E=e.sent,C=E.imageCache,pu(t,n,null,k,Ke.canvas(x),x,{viewBackgroundColor:a?s:null,scrollX:-f+l,scrollY:-h+l,zoom:S.zoom,remotePointerViewportCoords:{},remoteSelectedElementIds:{},shouldCacheIgnoreZoom:!1,remotePointerUsernames:{},remotePointerUserStates:{},theme:n.exportWithDarkMode?"dark":"light",imageCache:C},{renderScrollbars:!1,renderSelection:!1,renderOptimizations:!0,renderGrid:!1,isExport:!0}),e.abrupt("return",x);case 11:case"end":return e.stop()}}),e)})));return function(t,n,r,o){return e.apply(this,arguments)}}(),fd=function(){var e=(0,f.Z)(b().mark((function e(t,r,o){var a,i,l,s,c,u,p,f,h,m,v,y,x,w,k,S;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=r.exportPadding,i=void 0===a?d.qy:a,l=r.viewBackgroundColor,s=r.exportScale,c=void 0===s?1:s,u=r.exportEmbedScene,p="",!u){e.next=14;break}return e.prev=3,e.next=6,Promise.all([n.e(736),n.e(9)]).then(n.bind(n,673));case 6:return e.next=8,e.sent.encodeSvgMetadata({text:Qu(t,r,o||{},"local")});case 8:p=e.sent,e.next=14;break;case 11:e.prev=11,e.t0=e.catch(3),console.error(e.t0);case 14:return f=hd(t,i),h=g(f,4),m=h[0],v=h[1],y=h[2],x=h[3],(w=document.createElementNS(d.hR,"svg")).setAttribute("version","1.1"),w.setAttribute("xmlns",d.hR),w.setAttribute("viewBox","0 0 ".concat(y," ").concat(x)),w.setAttribute("width","".concat(y*c)),w.setAttribute("height","".concat(x*c)),r.exportWithDarkMode&&w.setAttribute("filter",d.ZF),w.innerHTML="\n ".concat(dd,"\n ").concat(p,'\n <defs>\n <style>\n @font-face {\n font-family: "Virgil";\n src: url("https://plus.excalidraw.com/Virgil.woff2");\n }\n @font-face {\n font-family: "Cascadia";\n src: url("https://plus.excalidraw.com/Cascadia.woff2");\n }\n </style>\n </defs>\n '),r.exportBackground&&l&&((k=w.ownerDocument.createElementNS(d.hR,"rect")).setAttribute("x","0"),k.setAttribute("y","0"),k.setAttribute("width","".concat(y)),k.setAttribute("height","".concat(x)),k.setAttribute("fill",l),w.appendChild(k)),S=Ke.svg(w),yu(t,S,w,o||{},{offsetX:-m+i,offsetY:-v+i}),e.abrupt("return",w);case 27:case"end":return e.stop()}}),e,null,[[3,11]])})));return function(t,n,r){return e.apply(this,arguments)}}(),hd=function(e,t){var n=g(Ot(e),4),r=n[0],o=n[1],a=n[2],i=n[3];return[r,o,Gn(r,a)+2*t,Gn(o,i)+t+t]};function md(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return gd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gd(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}function gd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function vd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vd(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var yd=32,xd=12,wd=256,kd="NOT_SPREADSHEET",Sd="VALID_SPREADSHEET",Ed=function(e){var t=/^[$€£¥₩]?([0-9,]+(\.[0-9]+)?)$/.exec(e);return t?parseFloat(t[1].replace(/,/g,"")):null},Cd=function(e,t){return e.slice(1).every((function(e){return null!==Ed(e[t])}))},jd=function(e){var t=e[0].length;if(t>2)return{type:kd,reason:"More than 2 columns"};if(1===t){if(!Cd(e,0))return{type:kd,reason:"Value is not numeric"};var n=null===Ed(e[0][0]),r=(n?e.slice(1):e).map((function(e){return Ed(e[0])}));return r.length<2?{type:kd,reason:"Less than two rows"}:{type:Sd,spreadsheet:{title:n?e[0][0]:null,labels:null,values:r}}}var o=Cd(e,0)?0:1;if(!Cd(e,o))return{type:kd,reason:"Value is not numeric"};var a=(o+1)%2,i=null===Ed(e[0][o]),l=i?e.slice(1):e;return l.length<2?{type:kd,reason:"Less than 2 rows"}:{type:Sd,spreadsheet:{title:i?e[0][o]:null,labels:l.map((function(e){return e[a]})),values:l.map((function(e){return Ed(e[o])}))}}},Od=At.elementBackground.slice(2,At.elementBackground.length),Md={fillStyle:"hachure",fontFamily:d.rk,fontSize:d.n5,opacity:100,roughness:1,strokeColor:At.elementStroke[0],strokeSharpness:"sharp",strokeStyle:"solid",strokeWidth:1,verticalAlign:"middle"},Id=function(e){return{chartWidth:44*e.values.length+xd,chartHeight:280}},Pd=function(e,t,n,r,o,a){var i=Id(e),l=i.chartWidth,s=i.chartHeight,c=e.title?Ho(bd(bd({backgroundColor:o,groupIds:[r]},Md),{},{text:e.title,x:t+l/2,y:n-wd-24-d.n5,strokeSharpness:"sharp",strokeStyle:"solid",textAlign:"center"})):null,u=a?Do(bd(bd({backgroundColor:o,groupIds:[r]},Md),{},{type:"rectangle",x:t,y:n-s,width:l,height:s,strokeColor:At.elementStroke[0],fillStyle:"solid",opacity:6})):null;return[].concat(_(u?[u]:[]),_(c?[c]:[]),_(function(e,t,n,r,o){var a;return(null===(a=e.labels)||void 0===a?void 0:a.map((function(e,a){return Ho(bd(bd({groupIds:[r],backgroundColor:o},Md),{},{text:e.length>8?"".concat(e.slice(0,5),"..."):e,x:t+44*a+24,y:n+6,width:yd,angle:5.87,fontSize:16,textAlign:"center",verticalAlign:"top"}))})))||[]}(e,t,n,r,o)),_(function(e,t,n,r,o){var a=Ho(bd(bd({groupIds:[r],backgroundColor:o},Md),{},{x:t-xd,y:n-xd,text:"0",textAlign:"right"}));return[a,Ho(bd(bd({groupIds:[r],backgroundColor:o},Md),{},{x:t-xd,y:n-wd-a.height/2,text:Math.max.apply(Math,_(e.values)).toLocaleString(),textAlign:"right"}))]}(e,t,n,r,o)),_(function(e,t,n,r,o){var a=Id(e),i=a.chartWidth,l=a.chartHeight;return[No(bd(bd({backgroundColor:o,groupIds:[r]},Md),{},{type:"line",x:t,y:n,startArrowhead:null,endArrowhead:null,width:i,points:[[0,0],[i,0]]})),No(bd(bd({backgroundColor:o,groupIds:[r]},Md),{},{type:"line",x:t,y:n,startArrowhead:null,endArrowhead:null,height:l,points:[[0,0],[0,-l]]})),No(bd(bd({backgroundColor:o,groupIds:[r]},Md),{},{type:"line",x:t,y:n-wd-xd,startArrowhead:null,endArrowhead:null,strokeStyle:"dotted",width:i,opacity:50,points:[[0,0],[i,0]]}))]}(e,t,n,r,o)))},Td=function(e,t,n,r){return"line"===e?function(e,t,n){var r,o=Math.max.apply(Math,_(e.values)),a=so(),i=Od[Math.floor(Math.random()*Od.length)],l=0,s=[],c=md(e.values);try{for(c.s();!(r=c.n()).done;){var u=r.value,p=44*l,f=-u/o*wd;s.push([p,f]),l++}}catch(e){c.e(e)}finally{c.f()}var h=Math.max.apply(Math,_(s.map((function(e){return e[0]})))),m=Math.max.apply(Math,_(s.map((function(e){return e[1]})))),g=Math.min.apply(Math,_(s.map((function(e){return e[0]})))),v=Math.min.apply(Math,_(s.map((function(e){return e[1]})))),b=No(bd(bd({backgroundColor:i,groupIds:[a]},Md),{},{type:"line",x:t+xd+16,y:n-xd,startArrowhead:null,endArrowhead:null,height:m-v,width:h-g,strokeWidth:2,points:s})),y=e.values.map((function(e,r){var l=44*r+6,s=-e/o*wd+6;return Do(bd(bd({backgroundColor:i,groupIds:[a]},Md),{},{fillStyle:"solid",strokeWidth:2,type:"ellipse",x:t+l+16,y:n+s-24,width:xd,height:xd}))})),x=e.values.map((function(e,r){var l=44*r+6,s=e/o*wd+6+xd;return No(bd(bd({backgroundColor:i,groupIds:[a]},Md),{},{type:"line",x:t+l+16+6,y:n-s,startArrowhead:null,endArrowhead:null,height:s,strokeStyle:"dotted",opacity:50,points:[[0,0],[0,s]]}))}));return[].concat(_(Pd(e,t,n,a,i,"production"===d.Vi.DEVELOPMENT)),[b],_(x),_(y))}(t,n,r):function(e,t,n){var r=Math.max.apply(Math,_(e.values)),o=so(),a=Od[Math.floor(Math.random()*Od.length)],i=e.values.map((function(e,i){var l=e/r*wd;return Do(bd(bd({backgroundColor:a,groupIds:[o]},Md),{},{type:"rectangle",x:t+44*i+xd,y:n-l-xd,width:yd,height:l}))}));return[].concat(_(i),_(Pd(e,t,n,o,a,"production"===d.Vi.DEVELOPMENT)))}(t,n,r)},Ad="",Ld=!1,_d="clipboard"in navigator&&"readText"in navigator.clipboard,Dd="clipboard"in navigator&&"writeText"in navigator.clipboard,zd="clipboard"in navigator&&"write"in navigator.clipboard&&"ClipboardItem"in window&&"toBlob"in HTMLCanvasElement.prototype,Hd=function(){var e=(0,f.Z)(b().mark((function e(t,n,r){var o,a,i;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=dl(t,n),a={type:d.r8.excalidrawClipboard,elements:o,files:o.reduce((function(e,t){return qe(t)&&r[t.fileId]&&(e[t.fileId]=r[t.fileId]),e}),{})},i=JSON.stringify(a),Ad=i,e.prev=4,Ld=!1,e.next=8,Ud(i);case 8:e.next=14;break;case 10:e.prev=10,e.t0=e.catch(4),Ld=!0,console.error(e.t0);case 14:case"end":return e.stop()}}),e,null,[[4,10]])})));return function(t,n,r){return e.apply(this,arguments)}}(),Bd=function(){if(!Ad)return{};try{return JSON.parse(Ad)}catch(e){return console.error(e),{}}},Nd=function(e){var t=function(e){var t=e.trim().split("\n").map((function(e){return e.trim().split("\t")}));if(t.length&&2!==t[0].length&&(t=e.trim().split("\n").map((function(e){return e.trim().split(",")}))),0===t.length)return{type:kd,reason:"No values"};var n=t[0].length;if(!t.every((function(e){return e.length===n})))return{type:kd,reason:"All rows don't have same number of columns"};var r=jd(t);if(r.type!==Sd){var o=jd(function(e){for(var t=[],n=0;n<e[0].length;n++){for(var r=[],o=0;o<e.length;o++)r.push(e[o][n]);t.push(r)}return t}(t));if(o.type===Sd)return o}return r}(e);return t.type===Sd?{spreadsheet:t.spreadsheet}:null},Rd=function(){var e=(0,f.Z)(b().mark((function e(t){var n,r;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!t){e.next=5;break}e.t0=null===(n=t.clipboardData)||void 0===n?void 0:n.getData("text/plain").trim(),e.next=11;break;case 5:if(e.t1=_d,!e.t1){e.next=10;break}return e.next=9,navigator.clipboard.readText();case 9:e.t1=e.sent;case 10:e.t0=e.t1;case 11:return r=e.t0,e.abrupt("return",r||"");case 15:return e.prev=15,e.t2=e.catch(0),e.abrupt("return","");case 18:case"end":return e.stop()}}),e,null,[[0,15]])})));return function(t){return e.apply(this,arguments)}}(),Fd=function(){var e=(0,f.Z)(b().mark((function e(t){var n,r,o,a;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Rd(t);case 2:if((n=e.sent)&&!n.includes(dd)){e.next=5;break}return e.abrupt("return",Bd());case 5:if(!(r=Nd(n))){e.next=8;break}return e.abrupt("return",r);case 8:if(o=Bd(),e.prev=9,a=JSON.parse(n),i=a,![d.r8.excalidraw,d.r8.excalidrawClipboard].includes(null==i?void 0:i.type)||!Array.isArray(i.elements)){e.next=13;break}return e.abrupt("return",{elements:a.elements,files:a.files});case 13:return e.abrupt("return",o);case 16:return e.prev=16,e.t0=e.catch(9),e.abrupt("return",Ld&&o.elements?o:{text:n});case 19:case"end":return e.stop()}var i}),e,null,[[9,16]])})));return function(t){return e.apply(this,arguments)}}(),Vd=function(){var e=(0,f.Z)(b().mark((function e(t){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,navigator.clipboard.write([new window.ClipboardItem(D({},d.LO.png,t))]);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ud=function(){var e=(0,f.Z)(b().mark((function e(t){var n;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=!1,!Dd){e.next=11;break}return e.prev=2,e.next=5,navigator.clipboard.writeText(t||"");case 5:n=!0,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(2),console.error(e.t0);case 11:if(n||Gd(t||" ")){e.next=13;break}throw new Error("couldn't copy");case 13:case"end":return e.stop()}}),e,null,[[2,8]])})));return function(t){return e.apply(this,arguments)}}(),Gd=function(e){var t="rtl"===document.documentElement.getAttribute("dir"),n=document.createElement("textarea");n.style.border="0",n.style.padding="0",n.style.margin="0",n.style.position="absolute",n.style[t?"right":"left"]="-9999px";var r=window.pageYOffset||document.documentElement.scrollTop;n.style.top="".concat(r,"px"),n.style.fontSize="12pt",n.setAttribute("readonly",""),n.value=e,document.body.appendChild(n);var o=!1;try{n.select(),n.setSelectionRange(0,n.value.length),o=document.execCommand("copy")}catch(e){console.error(e)}return n.remove(),o},Wd=function(){var e=(0,f.Z)(b().mark((function e(t,r,o,a,i){var l,s,c,u,p,f,h,m,g,v;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l=i.exportBackground,s=i.exportPadding,c=void 0===s?d.qy:s,u=i.viewBackgroundColor,p=i.name,f=i.fileHandle,h=void 0===f?null:f,0!==r.length){e.next=3;break}throw new Error(I("alerts.cannotExportEmptyCanvas"));case 3:if("svg"!==t&&"clipboard-svg"!==t){e.next=17;break}return e.next=6,fd(r,{exportBackground:l,exportWithDarkMode:o.exportWithDarkMode,viewBackgroundColor:u,exportPadding:c,exportScale:o.exportScale,exportEmbedScene:o.exportEmbedScene&&"svg"===t},a);case 6:if(m=e.sent,"svg"!==t){e.next=13;break}return e.next=10,Eu(new Blob([m.outerHTML],{type:d.LO.svg}),{name:p,extension:"svg",fileHandle:h});case 10:return e.abrupt("return",e.sent);case 13:if("clipboard-svg"!==t){e.next=17;break}return e.next=16,Ud(m.outerHTML);case 16:return e.abrupt("return");case 17:return e.next=19,pd(r,o,a,{exportBackground:l,viewBackgroundColor:u,exportPadding:c});case 19:return(g=e.sent).style.display="none",document.body.appendChild(g),e.next=24,Uu(g);case 24:if(v=e.sent,g.remove(),"png"!==t){e.next=38;break}if(!o.exportEmbedScene){e.next=33;break}return e.next=30,Promise.all([n.e(736),n.e(9)]).then(n.bind(n,673));case 30:return e.next=32,e.sent.encodePngMetadata({blob:v,metadata:Qu(r,o,a,"local")});case 32:v=e.sent;case 33:return e.next=35,Eu(v,{name:p,extension:"png",fileHandle:h});case 35:return e.abrupt("return",e.sent);case 38:if("clipboard"!==t){e.next=49;break}return e.prev=39,e.next=42,Vd(v);case 42:e.next=49;break;case 44:if(e.prev=44,e.t0=e.catch(39),"CANVAS_POSSIBLY_TOO_BIG"!==e.t0.name){e.next=48;break}throw e.t0;case 48:throw new Error(I("alerts.couldNotCopyToClipboard"));case 49:case"end":return e.stop()}}),e,null,[[39,44]])})));return function(t,n,r,o,a){return e.apply(this,arguments)}}();function Kd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Zd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Kd(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Yd=function(){var e=(0,f.Z)(b().mark((function e(t,n,r){var o,a,i,l,s,c;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=(o=n).exportBackground,i=o.viewBackgroundColor,l=o.name,s=o.fileHandle,c=Bu(s),s&&("png"===(u=c)||"svg"===u)){e.next=4;break}throw new Error("fileHandle should exist and should be of type svg or png when resaving");case 4:return n=Zd(Zd({},n),{},{exportEmbedScene:!0}),e.next=7,Wd(c,nl(t),n,r,{exportBackground:a,viewBackgroundColor:i,name:l,fileHandle:s});case 7:return e.abrupt("return",{fileHandle:s});case 8:case"end":return e.stop()}var u}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),Xd=(n(7225),function(e){var t=e.children,n=e.checked,r=e.onChange;return(0,P.jsxs)("div",{className:Ye("Checkbox",{"is-checked":n}),onClick:function(e){r(!n),e.currentTarget.querySelector(".Checkbox-box").focus()},children:[(0,P.jsx)("button",{className:"Checkbox-box",role:"checkbox","aria-checked":n,children:Hl}),(0,P.jsx)("div",{className:"Checkbox-label",children:t})]})});n(4623);function qd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qd(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Qd=function(e){var t=e.children,n=e.gap,r=e.align,o=e.justifyContent,a=e.className,i=e.style;return(0,P.jsx)("div",{className:Ye("Stack Stack_horizontal",a),style:$d({"--gap":n,alignItems:r,justifyContent:o},i),children:t})},Jd=function(e){var t=e.children,n=e.gap,r=e.align,o=e.justifyContent,a=e.className;return(0,P.jsx)("div",{className:Ye("Stack Stack_vertical",a),style:{"--gap":n,justifyItems:r,justifyContent:o},children:t})},ep=(n(554),function(e){var t=e.fileName,n=e.onSave;return(0,P.jsxs)(Qd,{className:"ActiveFile",gap:1,align:"center",children:[(0,P.jsxs)("span",{className:"ActiveFile__fileName",children:[vs,(0,P.jsx)("span",{children:t})]}),(0,P.jsx)(Al,{type:"icon",icon:Nl,title:I("buttons.save"),"aria-label":I("buttons.save"),onClick:n,"data-testid":"save-button"})]})});function tp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function np(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tp(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Xs({name:"changeProjectName",perform:function(e,t,n){return tu("change","title"),{appState:np(np({},t),{},{name:n}),commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData,r=e.appProps;return(0,P.jsx)(nu,{label:I("labels.fileTitle"),value:t.name||"Unnamed",onChange:function(e){return n(e)},isNameEditable:void 0===r.name&&!t.viewModeEnabled})}}),Xs({name:"changeExportScale",perform:function(e,t,n){return{appState:np(np({},t),{},{exportScale:n}),commitToHistory:!1}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData,o=nl(t),a=ul(o,n)?dl(o,n):o;return(0,P.jsx)(P.Fragment,{children:d.ZB.map((function(e){var t=function(e,t,n){var r=g(hd(e,t).map((function(e){return Math.trunc(e*n)})),4);return[r[2],r[3]]}(a,d.qy,e),o=g(t,2),i=o[0],l=o[1],s="".concat(I("buttons.scale")," ").concat(e,"x (").concat(i,"x").concat(l,")");return(0,P.jsx)(Al,{size:"small",type:"radio",icon:"".concat(e,"x"),name:"export-canvas-scale",title:s,"aria-label":s,id:"export-canvas-scale",checked:e===n.exportScale,onChange:function(){return r(e)}},e)}))})}}),Xs({name:"changeExportBackground",perform:function(e,t,n){return{appState:np(np({},t),{},{exportBackground:n}),commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData;return(0,P.jsx)(Xd,{checked:t.exportBackground,onChange:function(e){return n(e)},children:I("labels.withBackground")})}}),Xs({name:"changeExportEmbedScene",perform:function(e,t,n){return{appState:np(np({},t),{},{exportEmbedScene:n}),commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData;return(0,P.jsxs)(Xd,{checked:t.exportEmbedScene,onChange:function(e){return n(e)},children:[I("labels.exportEmbedScene"),(0,P.jsx)(Bc,{label:I("labels.exportEmbedScene_details"),long:!0,children:(0,P.jsx)("div",{className:"excalidraw-tooltip-icon",children:es})})]})}}),Xs({name:"saveToActiveFile",perform:(rp=(0,f.Z)(b().mark((function e(t,n,r,o){var a,i,l;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=!!n.fileHandle,e.prev=1,!Nu(n.fileHandle)){e.next=8;break}return e.next=5,Yd(t,n,o.files);case 5:e.t0=e.sent,e.next=11;break;case 8:return e.next=10,Ju(t,n,o.files);case 10:e.t0=e.sent;case 11:return i=e.t0,l=i.fileHandle,e.abrupt("return",{commitToHistory:!1,appState:np(np({},n),{},{fileHandle:l,toastMessage:a?null!=l&&l.name?I("toast.fileSavedToFilename").replace("{filename}",'"'.concat(l.name,'"')):I("toast.fileSaved"):null})});case 16:return e.prev=16,e.t1=e.catch(1),"AbortError"!==(null===e.t1||void 0===e.t1?void 0:e.t1.name)&&console.error(e.t1),e.abrupt("return",{commitToHistory:!1});case 20:case"end":return e.stop()}}),e,null,[[1,16]])}))),function(e,t,n,r){return rp.apply(this,arguments)}),keyTest:function(e){return e.key===jn&&e[un]&&!e.shiftKey},PanelComponent:function(e){var t,n=e.updateData,r=e.appState;return(0,P.jsx)(ep,{onSave:function(){return n(null)},fileName:null===(t=r.fileHandle)||void 0===t?void 0:t.name})}});var rp,op,ap,ip=Xs({name:"saveFileToDisk",perform:(op=(0,f.Z)(b().mark((function e(t,n,r,o){var a,i;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ju(t,np(np({},n),{},{fileHandle:null}),o.files);case 3:return a=e.sent,i=a.fileHandle,e.abrupt("return",{commitToHistory:!1,appState:np(np({},n),{},{fileHandle:i})});case 8:return e.prev=8,e.t0=e.catch(0),"AbortError"!==(null===e.t0||void 0===e.t0?void 0:e.t0.name)&&console.error(e.t0),e.abrupt("return",{commitToHistory:!1});case 12:case"end":return e.stop()}}),e,null,[[0,8]])}))),function(e,t,n,r){return op.apply(this,arguments)}),keyTest:function(e){return e.key===jn&&e.shiftKey&&e[un]},PanelComponent:function(e){var t=e.updateData;return(0,P.jsx)(Al,{type:"button",icon:Rl,title:I("buttons.saveAs"),"aria-label":I("buttons.saveAs"),showAriaLabel:Lh(),hidden:!xu,onClick:function(){return t(null)},"data-testid":"save-as-button"})}});Xs({name:"loadScene",perform:(ap=(0,f.Z)(b().mark((function e(t,n,r,o){var a,i,l,s;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ed(n,t);case 3:return a=e.sent,i=a.elements,l=a.appState,s=a.files,e.abrupt("return",{elements:i,appState:l,files:s,commitToHistory:!0});case 10:if(e.prev=10,e.t0=e.catch(0),"AbortError"!==(null===e.t0||void 0===e.t0?void 0:e.t0.name)){e.next=14;break}return e.abrupt("return",!1);case 14:return e.abrupt("return",{elements:t,appState:np(np({},n),{},{errorMessage:e.t0.message}),files:o.files,commitToHistory:!1});case 15:case"end":return e.stop()}}),e,null,[[0,10]])}))),function(e,t,n,r){return ap.apply(this,arguments)}),keyTest:function(e){return e[un]&&e.key===kn},PanelComponent:function(e){var t=e.updateData;e.appState;return(0,P.jsx)(Al,{type:"button",icon:Fl,title:I("buttons.load"),"aria-label":I("buttons.load"),showAriaLabel:Lh(),onClick:t,"data-testid":"load-button"})}}),Xs({name:"exportWithDarkMode",perform:function(e,t,n){return{appState:np(np({},t),{},{exportWithDarkMode:n}),commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData;return(0,P.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"-45px",marginBottom:"10px"},children:(0,P.jsx)(Dc,{value:t.exportWithDarkMode?d.C6.DARK:d.C6.LIGHT,onChange:function(e){n(e===d.C6.DARK)},title:I("labels.toggleExportColorScheme")})})}});function lp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function sp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lp(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var cp="{}",up=Xs({name:"copyStyles",perform:function(e,t){var n=e.find((function(e){return t.selectedElementIds[e.id]}));return n&&(cp=JSON.stringify(n)),{appState:sp(sp({},t),{},{toastMessage:I("toast.copyStyles")}),commitToHistory:!1}},contextItemLabel:"labels.copyStyles",keyTest:function(e){return e[un]&&e.altKey&&e.code===Yt}}),dp=Xs({name:"pasteStyles",perform:function(e,t){var n,r=JSON.parse(cp);return"text"!==(null==(n=r)?void 0:n.type)&&"diamond"!==(null==n?void 0:n.type)&&"rectangle"!==(null==n?void 0:n.type)&&"ellipse"!==(null==n?void 0:n.type)&&"arrow"!==(null==n?void 0:n.type)&&"freedraw"!==(null==n?void 0:n.type)&&"line"!==(null==n?void 0:n.type)?{elements:e,commitToHistory:!1}:{elements:e.map((function(e){if(t.selectedElementIds[e.id]){var n=fo(e,{backgroundColor:null==r?void 0:r.backgroundColor,strokeWidth:null==r?void 0:r.strokeWidth,strokeColor:null==r?void 0:r.strokeColor,strokeStyle:null==r?void 0:r.strokeStyle,fillStyle:null==r?void 0:r.fillStyle,opacity:null==r?void 0:r.opacity,roughness:null==r?void 0:r.roughness});return Qe(n)&&(po(n,{fontSize:(null==r?void 0:r.fontSize)||d.n5,fontFamily:(null==r?void 0:r.fontFamily)||d.rk,textAlign:(null==r?void 0:r.textAlign)||d.Hg}),qi(n)),n}return e})),commitToHistory:!0}},contextItemLabel:"labels.pasteStyles",keyTest:function(e){return e[un]&&e.altKey&&e.code===Jt}}),pp=function(e){return(0,P.jsx)("button",{className:"help-icon",onClick:e.onClick,type:"button",title:"".concat(e.title," — ?"),"aria-label":e.title,children:es})};function fp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function hp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fp(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Xs({name:"toggleCanvasMenu",perform:function(e,t){return{appState:hp(hp({},t),{},{openMenu:"canvas"===t.openMenu?null:"canvas"}),commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData;return(0,P.jsx)(Al,{type:"button",icon:$l,"aria-label":I("buttons.menu"),onClick:n,selected:"canvas"===t.openMenu})}}),Xs({name:"toggleEditMenu",perform:function(e,t){return{appState:hp(hp({},t),{},{openMenu:"shape"===t.openMenu?null:"shape"}),commitToHistory:!1}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,P.jsx)(Al,{visible:$i(n,nl(t)),type:"button",icon:Gl,"aria-label":I("buttons.edit"),onClick:r,selected:"shape"===n.openMenu})}}),Xs({name:"toggleFullScreen",perform:function(){return Yn()||document.documentElement.requestFullscreen(),Yn()&&document.exitFullscreen(),{commitToHistory:!1}},keyTest:function(e){return e.code===$t&&!e[un]}}),Xs({name:"toggleShortcuts",perform:function(e,t,n,r){var o=r.focusContainer;return t.showHelpDialog&&o(),{appState:hp(hp({},t),{},{showHelpDialog:!t.showHelpDialog}),commitToHistory:!1}},PanelComponent:function(e){var t=e.updateData;return(0,P.jsx)(pp,{title:I("helpDialog.title"),onClick:t})},keyTest:function(e){return e.key===hn}});function mp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mp(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function vp(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return bp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bp(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}function bp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var yp=function(e,t){var n=dl(nl(e),t);return n.length>=2&&!function(e){if(e.length>=2){var t,n=vp(e[0].groupIds);try{var r=function(){var n=t.value;if(e.reduce((function(e,t){return e&&Mo(t,n)}),!0))return{v:!0}};for(n.s();!(t=n.n()).done;){var o=r();if("object"===L(o))return o.v}}catch(e){n.e(e)}finally{n.f()}}return!1}(n)},xp=Xs({name:"group",perform:function(e,t){var n=dl(nl(e),t);if(n.length<2)return{appState:t,elements:e,commitToHistory:!1};var r=jo(t);if(1===r.length){var o=r[0],a=new Set(Io(e,o).map((function(e){return e.id}))),i=new Set(n.map((function(e){return e.id})));if(new Set([].concat(_(Array.from(a)),_(Array.from(i)))).size===a.size)return{appState:t,elements:e,commitToHistory:!1}}var l=so(),s=e.map((function(e){return t.selectedElementIds[e.id]?fo(e,{groupIds:Po(e.groupIds,l,t.editingGroupId)}):e})),c=Io(s,l),u=c[c.length-1],d=s.lastIndexOf(u),p=s.slice(d+1),f=s.slice(0,d).filter((function(e){return!Mo(e,l)})),h=[].concat(_(f),_(c),_(p));return{appState:So(l,gp(gp({},t),{},{selectedGroupIds:{}}),nl(h)),elements:h,commitToHistory:!0}},contextItemLabel:"labels.group",contextItemPredicate:function(e,t){return yp(e,t)},keyTest:function(e){return!e.shiftKey&&e[un]&&e.code===qt},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,P.jsx)(Al,{hidden:!yp(t,n),type:"button",icon:(0,P.jsx)(bs,{theme:n.theme}),onClick:function(){return r(null)},title:"".concat(I("labels.group")," — ").concat(Xn("CtrlOrCmd+G")),"aria-label":I("labels.group"),visible:ul(nl(t),n)})}}),wp=Xs({name:"ungroup",perform:function(e,t){if(0===jo(t).length)return{appState:t,elements:e,commitToHistory:!1};var n=e.map((function(e){var n=function(e,t){return e.filter((function(e){return!t[e]}))}(e.groupIds,t.selectedGroupIds);return n.length===e.groupIds.length?e:fo(e,{groupIds:n})}));return{appState:Oo(gp(gp({},t),{},{selectedGroupIds:{}}),nl(n)),elements:n,commitToHistory:!0}},keyTest:function(e){return e.shiftKey&&e[un]&&e.code===qt},contextItemLabel:"labels.ungroup",contextItemPredicate:function(e,t){return jo(t).length>0},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,P.jsx)(Al,{type:"button",hidden:0===jo(n).length,icon:(0,P.jsx)(ys,{theme:n.theme}),onClick:function(){return r(null)},title:"".concat(I("labels.ungroup")," — ").concat(Xn("CtrlOrCmd+Shift+G")),"aria-label":I("labels.ungroup"),visible:ul(nl(t),n)})}}),kp=(n(2789),function(e){var t=e.children,n=e.color,r=e.border,o=e.onClick;return(0,P.jsx)("div",{className:"Avatar",style:{background:n,border:"2px solid ".concat(r)},onClick:o,children:t})});function Sp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ep(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Sp(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Xs({name:"goToCollaborator",perform:function(e,t,n){var r=n;return r?{appState:Ep(Ep(Ep({},t),fl({scenePoint:r,viewportDimensions:{width:t.width,height:t.height},zoom:t.zoom})),{},{openMenu:"canvas"===t.openMenu?null:t.openMenu}),commitToHistory:!1}:{appState:t,commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData,r=e.data,o=null==r?void 0:r.id;if(!o)return null;var a=t.collaborators.get(o);if(!a)return null;var i=ou(a.picture||o,t),l=i.background,s=i.stroke,c=a.picture,u=function(e){if(!e)return"?";var t=e.trim().split(" ");if(t.length<2)return t[0].substring(0,2).toUpperCase();var n=t[0],r=t[t.length-1];return(n[0]+r[0]).toUpperCase()}(a.username);return(0,P.jsx)(kp,{color:l,border:c?"transparent":s,onClick:function(){return n(a.pointer)},children:c?(0,P.jsx)("img",{referrerPolicy:"no-referrer",src:c,alt:u}):u})}});var Cp=Xs({name:"addToLibrary",perform:function(e,t,n,r){var o=dl(nl(e),t);return r.library.loadLibrary().then((function(e){r.library.saveLibrary([].concat(_(e),[o.map(Ro)]))})),!1},contextItemLabel:"labels.addToLibrary"});function jp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Op(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jp(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Mp=function(e){var t=new Map;return e.forEach((function(e){var n=0===e.groupIds.length?e.id:e.groupIds[e.groupIds.length-1],r=t.get(n)||[];t.set(n,[].concat(_(r),[e]))})),Array.from(t.values())},Ip=function(e,t,n){var r=n.axis,o=n.position,a=Pp(e),i=g("x"===r?["minX","maxX"]:["minY","maxY"],2),l=i[0],s=i[1],c={x:0,y:0};return Op(Op({},c),{},D({},r,"start"===o?t[l]-a[l]:"end"===o?t[s]-a[s]:(t[l]+t[s])/2-(a[l]+a[s])/2))},Pp=function(e){var t=g(Ot(e),4);return{minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}},Tp=function(e,t){return dl(nl(e),t).length>1},Ap=function(e,t,n){var r=function(e,t){var n=Mp(e),r=Pp(e);return n.flatMap((function(e){var n=Ip(e,r,t);return e.map((function(e){return fo(e,{x:e.x+n.x,y:e.y+n.y})}))}))}(dl(nl(e),t),n),o=el(r);return e.map((function(e){return o[e.id]||e}))};Xs({name:"alignTop",perform:function(e,t){return{appState:t,elements:Ap(e,t,{position:"start",axis:"y"}),commitToHistory:!0}},keyTest:function(e){return e[un]&&e.shiftKey&&e.key===ln},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,P.jsx)(Al,{hidden:!Tp(t,n),type:"button",icon:(0,P.jsx)(as,{theme:n.theme}),onClick:function(){return r(null)},title:"".concat(I("labels.alignTop")," — ").concat(Xn("CtrlOrCmd+Shift+Up")),"aria-label":I("labels.alignTop"),visible:ul(nl(t),n)})}}),Xs({name:"alignBottom",perform:function(e,t){return{appState:t,elements:Ap(e,t,{position:"end",axis:"y"}),commitToHistory:!0}},keyTest:function(e){return e[un]&&e.shiftKey&&e.key===rn},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,P.jsx)(Al,{hidden:!Tp(t,n),type:"button",icon:(0,P.jsx)(is,{theme:n.theme}),onClick:function(){return r(null)},title:"".concat(I("labels.alignBottom")," — ").concat(Xn("CtrlOrCmd+Shift+Down")),"aria-label":I("labels.alignBottom"),visible:ul(nl(t),n)})}}),Xs({name:"alignLeft",perform:function(e,t){return{appState:t,elements:Ap(e,t,{position:"start",axis:"x"}),commitToHistory:!0}},keyTest:function(e){return e[un]&&e.shiftKey&&e.key===on},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,P.jsx)(Al,{hidden:!Tp(t,n),type:"button",icon:(0,P.jsx)(ls,{theme:n.theme}),onClick:function(){return r(null)},title:"".concat(I("labels.alignLeft")," — ").concat(Xn("CtrlOrCmd+Shift+Left")),"aria-label":I("labels.alignLeft"),visible:ul(nl(t),n)})}}),Xs({name:"alignRight",perform:function(e,t){return{appState:t,elements:Ap(e,t,{position:"end",axis:"x"}),commitToHistory:!0}},keyTest:function(e){return e[un]&&e.shiftKey&&e.key===an},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,P.jsx)(Al,{hidden:!Tp(t,n),type:"button",icon:(0,P.jsx)(ss,{theme:n.theme}),onClick:function(){return r(null)},title:"".concat(I("labels.alignRight")," — ").concat(Xn("CtrlOrCmd+Shift+Right")),"aria-label":I("labels.alignRight"),visible:ul(nl(t),n)})}}),Xs({name:"alignVerticallyCentered",perform:function(e,t){return{appState:t,elements:Ap(e,t,{position:"center",axis:"y"}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,P.jsx)(Al,{hidden:!Tp(t,n),type:"button",icon:(0,P.jsx)(ds,{theme:n.theme}),onClick:function(){return r(null)},title:I("labels.centerVertically"),"aria-label":I("labels.centerVertically"),visible:ul(nl(t),n)})}}),Xs({name:"alignHorizontallyCentered",perform:function(e,t){return{appState:t,elements:Ap(e,t,{position:"center",axis:"x"}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,P.jsx)(Al,{hidden:!Tp(t,n),type:"button",icon:(0,P.jsx)(ps,{theme:n.theme}),onClick:function(){return r(null)},title:I("labels.centerHorizontally"),"aria-label":I("labels.centerHorizontally"),visible:ul(nl(t),n)})}});function Lp(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return _p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _p(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}function _p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Dp=function(e){var t=new Map;return e.forEach((function(e){var n=0===e.groupIds.length?e.id:e.groupIds[e.groupIds.length-1],r=t.get(n)||[];t.set(n,[].concat(_(r),[e]))})),Array.from(t.values())},zp=function(e){var t=g(Ot(e),4),n=t[0],r=t[1],o=t[2],a=t[3];return{minX:n,minY:r,maxX:o,maxY:a,width:o-n,height:a-r,midX:(n+o)/2,midY:(r+a)/2}},Hp=function(e,t){return dl(nl(e),t).length>1},Bp=function(e,t,n){var r=function(e,t){var n,r=g("x"===t.axis?["minX","midX","maxX","width"]:["minY","midY","maxY","height"],4),o=r[0],a=r[1],i=r[2],l=r[3],s=zp(e),c=Dp(e).map((function(e){return[e,zp(e)]})).sort((function(e,t){return e[1][a]-t[1][a]})),u=0,d=Lp(c);try{for(d.s();!(n=d.n()).done;)u+=n.value[1][l]}catch(e){d.e(e)}finally{d.f()}var p=(s[l]-u)/(c.length-1);if(p<0){var f=c.findIndex((function(e){return e[1][o]===s[o]})),h=c.findIndex((function(e){return e[1][i]===s[i]})),m=(c[h][1][a]-c[f][1][a])/(c.length-1),v=c[f][1][a];return c.flatMap((function(e,n){var r=g(e,2),o=r[0],i=r[1],l={x:0,y:0};return n!==f&&n!==h&&(v+=m,l[t.axis]=v-i[a]),o.map((function(e){return fo(e,{x:e.x+l.x,y:e.y+l.y})}))}))}var b=s[o];return c.flatMap((function(e){var n=g(e,2),r=n[0],a=n[1],i={x:0,y:0};return i[t.axis]=b-a[o],b+=p,b+=a[l],r.map((function(e){return fo(e,{x:e.x+i.x,y:e.y+i.y})}))}))}(dl(nl(e),t),n),o=el(r);return e.map((function(e){return o[e.id]||e}))},Np=(Xs({name:"distributeHorizontally",perform:function(e,t){return{appState:t,elements:Bp(e,t,{space:"between",axis:"x"}),commitToHistory:!0}},keyTest:function(e){return e.altKey&&e.code===Qt},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,P.jsx)(Al,{hidden:!Hp(t,n),type:"button",icon:(0,P.jsx)(cs,{theme:n.theme}),onClick:function(){return r(null)},title:"".concat(I("labels.distributeHorizontally")," — ").concat(Xn("Alt+H")),"aria-label":I("labels.distributeHorizontally"),visible:ul(nl(t),n)})}}),Xs({name:"distributeVertically",perform:function(e,t){return{appState:t,elements:Bp(e,t,{space:"between",axis:"y"}),commitToHistory:!0}},keyTest:function(e){return e.altKey&&e.code===Jt},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,P.jsx)(Al,{hidden:!Hp(t,n),type:"button",icon:(0,P.jsx)(us,{theme:n.theme}),onClick:function(){return r(null)},title:"".concat(I("labels.distributeVertically")," — ").concat(Xn("Alt+V")),"aria-label":I("labels.distributeVertically"),visible:ul(nl(t),n)})}}),Xs({name:"flipHorizontal",perform:function(e,t){return{elements:Fp(e,t,"horizontal"),appState:t,commitToHistory:!0}},keyTest:function(e){return e.shiftKey&&"KeyH"===e.code},contextItemLabel:"labels.flipHorizontal",contextItemPredicate:function(e,t){return function(e,t){var n=dl(nl(e),t);return 1===n.length&&"text"!==n[0].type}(e,t)}})),Rp=Xs({name:"flipVertical",perform:function(e,t){return{elements:Fp(e,t,"vertical"),appState:t,commitToHistory:!0}},keyTest:function(e){return e.shiftKey&&"KeyV"===e.code},contextItemLabel:"labels.flipVertical",contextItemPredicate:function(e,t){return function(e,t){return 1===dl(nl(e),t).length}(e,t)}}),Fp=function(e,t,n){var r=dl(nl(e),t);if(r.length>1)return e;var o=Vp(r,t,n),a=el(o);return e.map((function(e){return a[e.id]||e}))},Vp=function(e,t,n){return e.forEach((function(e){Up(e,t),"vertical"===n&&Gp(e,Math.PI)})),e},Up=function(e,t){var n=e.x,r=e.y,o=e.width,a=e.height,i=Bi(e.angle),l=0;(tt(e)||Je(e))&&(l=2*e.points.reduce((function(e,t){return Math.max(e,t[0])}),0)-e.width),po(e,{angle:Bi(0)});var s=Xo(e,t.zoom),c=!0,u=0,d=s.nw;if(d||(c=!1,d=s.ne)){if(tt(e)){for(var p=1;p<e.points.length;p++)li.movePoint(e,p,[-e.points[p][0],e.points[p][1]]);li.normalizePoints(e)}else u=c?e.x+2*o:e.x-2*o,Gi(e,!0,e,c?"nw":"ne",!1,u,d[1]),po(e,{width:o,height:a});var f=Bi(2*Math.PI-i);f<0&&(f=Bi(f+2*Math.PI)),po(e,{angle:f}),po(e,{x:n+l,y:r}),ki(e)}else po(e,{angle:i})},Gp=function(e,t){var n=e.x,r=e.y,o=Bi(e.angle+t);o<0&&(o=Bi(2*Math.PI+o)),po(e,{angle:o}),po(e,{x:n,y:r})};function Wp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Kp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wp(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Zp=Xs({name:"copy",perform:function(e,t,n,r){return Hd(nl(e),t,r.files),{commitToHistory:!1}},contextItemLabel:"labels.copy",keyTest:void 0}),Yp=Xs({name:"cut",perform:function(e,t,n,r){return Zp.perform(e,t,n,r),Js.perform(e,t,n,r)},contextItemLabel:"labels.cut",keyTest:function(e){return e[un]&&e.code===en}}),Xp=Xs({name:"copyAsSvg",perform:function(){var e=(0,f.Z)(b().mark((function e(t,n,r,o){var a;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o.canvas){e.next=2;break}return e.abrupt("return",{commitToHistory:!1});case 2:return a=dl(nl(t),n),e.prev=3,e.next=6,Wd("clipboard-svg",a.length?a:nl(t),n,o.files,n);case 6:return e.abrupt("return",{commitToHistory:!1});case 9:return e.prev=9,e.t0=e.catch(3),console.error(e.t0),e.abrupt("return",{appState:Kp(Kp({},n),{},{errorMessage:e.t0.message}),commitToHistory:!1});case 13:case"end":return e.stop()}}),e,null,[[3,9]])})));return function(t,n,r,o){return e.apply(this,arguments)}}(),contextItemLabel:"labels.copyAsSvg"}),qp=Xs({name:"copyAsPng",perform:function(){var e=(0,f.Z)(b().mark((function e(t,n,r,o){var a;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o.canvas){e.next=2;break}return e.abrupt("return",{commitToHistory:!1});case 2:return a=dl(nl(t),n),e.prev=3,e.next=6,Wd("clipboard",a.length?a:nl(t),n,o.files,n);case 6:return e.abrupt("return",{appState:Kp(Kp({},n),{},{toastMessage:I("toast.copyToClipboardAsPng",{exportSelection:a.length?I("toast.selection"):I("toast.canvas"),exportColorScheme:n.exportWithDarkMode?I("buttons.darkMode"):I("buttons.lightMode")})}),commitToHistory:!1});case 9:return e.prev=9,e.t0=e.catch(3),console.error(e.t0),e.abrupt("return",{appState:Kp(Kp({},n),{},{errorMessage:e.t0.message}),commitToHistory:!1});case 13:case"end":return e.stop()}}),e,null,[[3,9]])})));return function(t,n,r,o){return e.apply(this,arguments)}}(),contextItemLabel:"labels.copyAsPng",keyTest:function(e){return e.code===Yt&&e.altKey&&e.shiftKey}});function $p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$p(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Jp=Xs({name:"gridMode",perform:function(e,t){return tu("view","mode","grid"),{appState:Qp(Qp({},t),{},{gridSize:this.checked(t)?null:d.k}),commitToHistory:!1}},checked:function(e){return null!==e.gridSize},contextItemLabel:"labels.showGrid",keyTest:function(e){return e[un]&&e.code===Wt}});function ef(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function tf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ef(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ef(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var nf=Xs({name:"zenMode",perform:function(e,t){return tu("view","mode","zen"),{appState:tf(tf({},t),{},{zenModeEnabled:!this.checked(t)}),commitToHistory:!1}},checked:function(e){return e.zenModeEnabled},contextItemLabel:"buttons.zenMode",keyTest:function(e){return!e[un]&&e.altKey&&e.code===tn}});function rf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function of(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rf(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var af=Xs({name:"stats",perform:function(e,t){return{appState:of(of({},t),{},{showStats:!this.checked(t)}),commitToHistory:!1}},checked:function(e){return e.showStats},contextItemLabel:"stats.title",keyTest:function(e){return!e[un]&&e.altKey&&e.code===Zt}});function lf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function sf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lf(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var cf=function(e,t,n){var r=!1;if(!(t.multiElement||t.resizingElement||t.editingElement||t.draggingElement)){var o=n();if(null===o)return{commitToHistory:r};var a=el(e),i=o.elements,l=el(i),s=e.filter((function(e){return!l.hasOwnProperty(e.id)})),c=i.map((function(e){return fo(a[e.id]||e,e)})).concat(s.map((function(e){return fo(e,{isDeleted:!0})})));return _i(c,s),{elements:c,appState:sf(sf({},t),o.appState),commitToHistory:r,syncHistory:!0}}return{commitToHistory:r}},uf=function(){function e(t,n,r,o){var a=this;z(this,e),this.actions={},this.renderAction=function(e,t){var n=a.app.props.UIOptions.canvasActions;if(a.actions[e]&&"PanelComponent"in a.actions[e]&&(!n||!(e in n)||n[e])){var r=a.actions[e],o=r.PanelComponent;return(0,P.jsx)(o,{elements:a.getElementsIncludingDeleted(),appState:a.getAppState(),updateData:function(e){a.updater(r.perform(a.getElementsIncludingDeleted(),a.getAppState(),e,a.app))},appProps:a.app.props,data:t})}return null},this.updater=function(e){if(!e||!("then"in e))return t(e);e.then((function(e){return t(e)}))},this.getAppState=n,this.getElementsIncludingDeleted=r,this.app=o}return B(e,[{key:"registerAction",value:function(e){this.actions[e.name]=e}},{key:"registerAll",value:function(e){var t=this;e.forEach((function(e){return t.registerAction(e)}))}},{key:"handleKeyDown",value:function(e){var t=this,n=this.app.props.UIOptions.canvasActions,r=Object.values(this.actions).sort((function(e,t){return(t.keyPriority||0)-(e.keyPriority||0)})).filter((function(r){return(!n||!(r.name in n)||n[r.name])&&r.keyTest&&r.keyTest(e,t.getAppState(),t.getElementsIncludingDeleted())}));return 0!==r.length&&(!(this.getAppState().viewModeEnabled&&!Object.values(d.EH).includes(r[0].name))&&(e.preventDefault(),this.updater(r[0].perform(this.getElementsIncludingDeleted(),this.getAppState(),null,this.app)),!0))}},{key:"executeAction",value:function(e){this.updater(e.perform(this.getElementsIncludingDeleted(),this.getAppState(),null,this.app))}}]),e}(),df=function(){function e(t){var n=this;z(this,e),this.libraryCache=null,this.resetLibrary=(0,f.Z)(b().mark((function e(){var t,r;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null===(t=(r=n.app.props).onLibraryChange)||void 0===t?void 0:t.call(r,[]);case 2:n.libraryCache=[];case 3:case"end":return e.stop()}}),e)}))),this.restoreLibraryItem=function(e){var t=nl(Au(e,null));return t.length?t:null},this.loadLibrary=function(){return new Promise(function(){var e=(0,f.Z)(b().mark((function e(t){var r,o;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n.libraryCache){e.next=2;break}return e.abrupt("return",t(JSON.parse(JSON.stringify(n.libraryCache))));case 2:if(e.prev=2,r=n.app.libraryItemsFromStorage){e.next=6;break}return e.abrupt("return",t([]));case 6:o=r.reduce((function(e,t){return n.restoreLibraryItem(t)&&e.push(t),e}),[]),n.libraryCache=JSON.parse(JSON.stringify(o)),t(o),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(2),console.error(e.t0),t([]);case 15:case"end":return e.stop()}}),e,null,[[2,11]])})));return function(t){return e.apply(this,arguments)}}())},this.saveLibrary=function(){var e=(0,f.Z)(b().mark((function e(t){var r,o,a,i;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.libraryCache,e.prev=1,i=JSON.stringify(t),n.libraryCache=JSON.parse(i),e.next=6,null===(o=(a=n.app.props).onLibraryChange)||void 0===o?void 0:o.call(a,t);case 6:e.next=12;break;case 8:throw e.prev=8,e.t0=e.catch(1),n.libraryCache=r,e.t0;case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}(),this.app=t}var t;return B(e,[{key:"importLibrary",value:(t=(0,f.Z)(b().mark((function e(t){var n,r,o,a,i=this;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Vu(t);case 2:if((n=e.sent)&&n.library){e.next=5;break}return e.abrupt("return");case 5:return r=function(e,t){return!e.find((function(e){return e.length===t.length&&e.every((function(e,n){return e.id===t[n].id&&e.versionNonce===t[n].versionNonce}))}))},e.next=8,this.loadLibrary();case 8:return o=e.sent,a=n.library.reduce((function(e,t){var n=i.restoreLibraryItem(t);return n&&r(o,n)&&e.push(n),e}),[]),e.next=12,this.saveLibrary([].concat(_(o),_(a)));case 12:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}(),pf=function(e){var t=Array.from(e.values());return{x:hf(t,(function(e){return e.x}))/t.length,y:hf(t,(function(e){return e.y}))/t.length}},ff=function(e){var t=g(e,2),n=t[0],r=t[1];return Math.hypot(n.x-r.x,n.y-r.y)},hf=function(e,t){return e.reduce((function(e,n){return e+t(n)}),0)};function mf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mf(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var vf=function(e){return{selectedElementIds:e.selectedElementIds,selectedGroupIds:e.selectedGroupIds,viewBackgroundColor:e.viewBackgroundColor,editingLinearElement:e.editingLinearElement,editingGroupId:e.editingGroupId,name:e.name}},bf=function(){function e(){var t=this;z(this,e),this.elementCache=new Map,this.recording=!0,this.stateHistory=[],this.redoStack=[],this.lastEntry=null,this.generateEntry=function(e,n){return t.dehydrateHistoryEntry({appState:vf(e),elements:n.reduce((function(t,n){if(tt(n)&&e.multiElement&&e.multiElement.id===n.id){if(e.multiElement&&e.multiElement.id===n.id&&n.points.length<2)return t;t.push(gf(gf({},n),{},{points:n.lastCommittedPoint!==n.points[n.points.length-1]?n.points.slice(0,-1):n.points}))}else t.push(n);return t}),[])})}}return B(e,[{key:"hydrateHistoryEntry",value:function(e){var t=this,n=e.appState,r=e.elements;return{appState:JSON.parse(n),elements:r.map((function(e){var n,r=null===(n=t.elementCache.get(e.id))||void 0===n?void 0:n.get(e.versionNonce);if(!r)throw new Error("Element not found: ".concat(e.id,":").concat(e.versionNonce));return r}))}}},{key:"dehydrateHistoryEntry",value:function(e){var t=this,n=e.appState,r=e.elements;return{appState:JSON.stringify(n),elements:r.map((function(e){t.elementCache.has(e.id)||t.elementCache.set(e.id,new Map);var n=t.elementCache.get(e.id);return n.has(e.versionNonce)||n.set(e.versionNonce,Ro(e)),{id:e.id,versionNonce:e.versionNonce}}))}}},{key:"getSnapshotForTest",value:function(){var e=this;return{recording:this.recording,stateHistory:this.stateHistory.map((function(t){return e.hydrateHistoryEntry(t)})),redoStack:this.redoStack.map((function(t){return e.hydrateHistoryEntry(t)}))}}},{key:"clear",value:function(){this.stateHistory.length=0,this.redoStack.length=0,this.lastEntry=null,this.elementCache.clear()}},{key:"shouldCreateEntry",value:function(e){var t,n=this.lastEntry;if(!n)return!0;if(e.elements.length!==n.elements.length)return!0;for(var r=e.elements.length-1;r>-1;r--){var o=e.elements[r],a=n.elements[r];if(!o||!a||o.id!==a.id||o.versionNonce!==a.versionNonce)return!0}for(t in e.appState){var i,l;if("editingLinearElement"===t)if((null===(i=e.appState[t])||void 0===i?void 0:i.elementId)===(null===(l=n.appState[t])||void 0===l?void 0:l.elementId))continue;if("selectedElementIds"!==t&&"selectedGroupIds"!==t&&e.appState[t]!==n.appState[t])return!0}return!1}},{key:"pushEntry",value:function(e,t){var n=this.generateEntry(e,t),r=this.hydrateHistoryEntry(n);if(r){if(!this.shouldCreateEntry(r))return;this.stateHistory.push(n),this.lastEntry=r,this.clearRedoStack()}}},{key:"clearRedoStack",value:function(){this.redoStack.splice(0,this.redoStack.length)}},{key:"redoOnce",value:function(){if(0===this.redoStack.length)return null;var e=this.redoStack.pop();return void 0!==e?(this.stateHistory.push(e),this.hydrateHistoryEntry(e)):null}},{key:"undoOnce",value:function(){if(1===this.stateHistory.length)return null;var e=this.stateHistory.pop(),t=this.stateHistory[this.stateHistory.length-1];return void 0!==e?(this.redoStack.push(e),this.hydrateHistoryEntry(t)):null}},{key:"setCurrentState",value:function(e,t){this.lastEntry=this.hydrateHistoryEntry(this.generateEntry(e,t))}},{key:"resumeRecording",value:function(){this.recording=!0}},{key:"record",value:function(e,t){this.recording&&(this.pushEntry(e,t),this.recording=!1)}}]),e}(),yf=[{icon:(0,P.jsx)("svg",{viewBox:"0 0 320 512",className:"",children:(0,P.jsx)("path",{d:"M302.189 329.126H196.105l55.831 135.993c3.889 9.428-.555 19.999-9.444 23.999l-49.165 21.427c-9.165 4-19.443-.571-23.332-9.714l-53.053-129.136-86.664 89.138C18.729 472.71 0 463.554 0 447.977V18.299C0 1.899 19.921-6.096 30.277 5.443l284.412 292.542c11.472 11.179 3.007 31.141-12.5 31.141z"})}),value:"selection",key:Mn},{icon:(0,P.jsx)("svg",{viewBox:"0 0 448 512",children:(0,P.jsx)("path",{d:"M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48z"})}),value:"rectangle",key:Cn},{icon:(0,P.jsx)("svg",{viewBox:"0 0 223.646 223.646",children:(0,P.jsx)("path",{d:"M111.823 0L16.622 111.823 111.823 223.646 207.025 111.823z"})}),value:"diamond",key:bn},{icon:(0,P.jsx)("svg",{viewBox:"0 0 512 512",children:(0,P.jsx)("path",{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"})}),value:"ellipse",key:yn},{icon:(0,P.jsx)("svg",{viewBox:"0 0 448 512",className:"rtl-mirror",children:(0,P.jsx)("path",{d:"M313.941 216H12c-6.627 0-12 5.373-12 12v56c0 6.627 5.373 12 12 12h301.941v46.059c0 21.382 25.851 32.09 40.971 16.971l86.059-86.059c9.373-9.373 9.373-24.569 0-33.941l-86.059-86.059c-15.119-15.119-40.971-4.411-40.971 16.971V216z"})}),value:"arrow",key:vn},{icon:(0,P.jsx)("svg",{viewBox:"0 0 6 6",children:(0,P.jsx)("line",{x1:"0",y1:"3",x2:"6",y2:"3",stroke:"currentColor",strokeLinecap:"round"})}),value:"line",key:[Sn,wn]},{icon:(0,P.jsx)("svg",{viewBox:"0 0 512 512",children:(0,P.jsx)("path",{fill:"currentColor",d:"M290.74 93.24l128.02 128.02-277.99 277.99-114.14 12.6C11.35 513.54-1.56 500.62.14 485.34l12.7-114.22 277.9-277.88zm207.2-19.06l-60.11-60.11c-18.75-18.75-49.16-18.75-67.91 0l-56.55 56.55 128.02 128.02 56.55-56.55c18.75-18.76 18.75-49.16 0-67.91z"})}),value:"freedraw",key:In},{icon:(0,P.jsx)("svg",{viewBox:"0 0 448 512",children:(0,P.jsx)("path",{d:"M432 416h-23.41L277.88 53.69A32 32 0 0 0 247.58 32h-47.16a32 32 0 0 0-30.3 21.69L39.41 416H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16h-19.58l23.3-64h152.56l23.3 64H304a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM176.85 272L224 142.51 271.15 272z"})}),value:"text",key:On},{icon:(0,P.jsx)("svg",{viewBox:"0 0 512 512",children:(0,P.jsx)("path",{fill:"currentColor",d:"M464 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm-6 336H54a6 6 0 0 1-6-6V118a6 6 0 0 1 6-6h404a6 6 0 0 1 6 6v276a6 6 0 0 1-6 6zM128 152c-22.091 0-40 17.909-40 40s17.909 40 40 40 40-17.909 40-40-17.909-40-40-40zM96 352h320v-80l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L192 304l-39.515-39.515c-4.686-4.686-12.284-4.686-16.971 0L96 304v48z"})}),value:"image",key:null}],xf=(n(1292),{cut:[Xn("CtrlOrCmd+X")],copy:[Xn("CtrlOrCmd+C")],paste:[Xn("CtrlOrCmd+V")],copyStyles:[Xn("CtrlOrCmd+Alt+C")],pasteStyles:[Xn("CtrlOrCmd+Alt+V")],selectAll:[Xn("CtrlOrCmd+A")],deleteSelectedElements:[Xn("Del")],duplicateSelection:[Xn("CtrlOrCmd+D"),Xn("Alt+".concat(I("helpDialog.drag")))],sendBackward:[Xn("CtrlOrCmd+[")],bringForward:[Xn("CtrlOrCmd+]")],sendToBack:[Xn(_t?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")],bringToFront:[Xn(_t?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")],copyAsPng:[Xn("Shift+Alt+C")],copyAsSvg:[],group:[Xn("CtrlOrCmd+G")],ungroup:[Xn("CtrlOrCmd+Shift+G")],gridMode:[Xn("CtrlOrCmd+'")],zenMode:[Xn("Alt+Z")],stats:[Xn("Alt+/")],addToLibrary:[],flipHorizontal:[Xn("Shift+H")],flipVertical:[Xn("Shift+V")],viewMode:[Xn("Alt+R")]}),wf=function(e){var t=e.options,n=e.onCloseRequest,r=e.top,o=e.left,a=e.actionManager,i=e.appState;return(0,P.jsx)(wc,{onCloseRequest:n,top:r,left:o,fitInViewport:!0,children:(0,P.jsx)("ul",{className:"context-menu",onContextMenu:function(e){return e.preventDefault()},children:t.map((function(e,t){var r;if("separator"===e)return(0,P.jsx)("hr",{className:"context-menu-option-separator"},t);var o,l,s=e.name,c=e.contextItemLabel?I(e.contextItemLabel):"";return(0,P.jsx)("li",{"data-testid":s,onClick:n,children:(0,P.jsxs)("button",{className:Ye("context-menu-option",{dangerous:"deleteSelectedElements"===s,checkmark:null===(r=e.checked)||void 0===r?void 0:r.call(e,i)}),onClick:function(){return a.executeAction(e)},children:[(0,P.jsx)("div",{className:"context-menu-option__label",children:c}),(0,P.jsx)("kbd",{className:"context-menu-option__shortcut",children:s?(o=s,l=xf[o],l&&l.length>0?l[0]:""):""})]})},t)}))})})},kf=new WeakMap,Sf=function(e){var t,n,r=Array.of();e.options.forEach((function(e){e&&r.push(e)})),r.length&&(0,Lt.render)((0,P.jsx)(wf,{top:e.top,left:e.left,options:r,onCloseRequest:function(){return t=e.container,void((n=kf.get(t))&&((0,Lt.unmountComponentAtNode)(n),n.remove(),kf.delete(t)));var t,n},actionManager:e.actionManager,appState:e.appState}),(t=e.container,(n=kf.get(t))||(n=document.createElement("div"),t.querySelector(".excalidraw-contextMenuContainer").appendChild(n),kf.set(t,n),n)))};function Ef(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Cf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cf(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}function Cf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var jf=function(e){var t,n,r=e.appState,o=e.elements,a=e.renderAction,i=e.elementType,l=pl(nl(o),r),s=Boolean(r.editingElement),c=Lh(),u="rtl"===document.documentElement.getAttribute("dir"),d=ml(i)||l.some((function(e){return ml(e.type)&&!rr(e.backgroundColor)})),p=ml(i)||l.some((function(e){return ml(e.type)})),f=(null===(t=l[0])||void 0===t?void 0:t.type)||null,h=Ef(l);try{for(h.s();!(n=h.n()).done;){if(n.value.type!==f){f=null;break}}}catch(e){h.e(e)}finally{h.f()}return(0,P.jsxs)("div",{className:"panelColumn",children:[(gl(i)&&"image"!==i&&"image"!==f||l.some((function(e){return gl(e.type)})))&&a("changeStrokeColor"),p&&a("changeBackgroundColor"),d&&a("changeFillStyle"),(vl(i)||l.some((function(e){return vl(e.type)})))&&a("changeStrokeWidth"),("freedraw"===i||l.some((function(e){return"freedraw"===e.type})))&&a("changeStrokeShape"),(bl(i)||l.some((function(e){return bl(e.type)})))&&(0,P.jsxs)(P.Fragment,{children:[a("changeStrokeStyle"),a("changeSloppiness")]}),(yl(i)||l.some((function(e){return yl(e.type)})))&&(0,P.jsx)(P.Fragment,{children:a("changeSharpness")}),(xl(i)||l.some((function(e){return xl(e.type)})))&&(0,P.jsxs)(P.Fragment,{children:[a("changeFontSize"),a("changeFontFamily"),a("changeTextAlign")]}),(wl(i)||l.some((function(e){return wl(e.type)})))&&(0,P.jsx)(P.Fragment,{children:a("changeArrowhead")}),a("changeOpacity"),(0,P.jsxs)("fieldset",{children:[(0,P.jsx)("legend",{children:I("labels.layers")}),(0,P.jsxs)("div",{className:"buttonList",children:[a("sendToBack"),a("sendBackward"),a("bringToFront"),a("bringForward")]})]}),l.length>1&&(0,P.jsxs)("fieldset",{children:[(0,P.jsx)("legend",{children:I("labels.align")}),(0,P.jsxs)("div",{className:"buttonList",children:[u?(0,P.jsxs)(P.Fragment,{children:[a("alignRight"),a("alignHorizontallyCentered"),a("alignLeft")]}):(0,P.jsxs)(P.Fragment,{children:[a("alignLeft"),a("alignHorizontallyCentered"),a("alignRight")]}),l.length>2&&a("distributeHorizontally"),(0,P.jsxs)("div",{className:"iconRow",children:[a("alignTop"),a("alignVerticallyCentered"),a("alignBottom"),l.length>2&&a("distributeVertically")]})]})]}),!c&&!s&&l.length>0&&(0,P.jsxs)("fieldset",{children:[(0,P.jsx)("legend",{children:I("labels.actions")}),(0,P.jsxs)("div",{className:"buttonList",children:[a("duplicateSelection"),a("deleteSelectedElements"),a("group"),a("ungroup")]})]})]})},Of=function(e){var t=e.canvas,n=e.elementType,r=e.setAppState,o=e.onImageAction;return(0,P.jsx)(P.Fragment,{children:yf.map((function(e,a){var i=e.value,l=e.icon,s=e.key,c=I("toolBar.".concat(i)),u=s&&("string"==typeof s?s:s[0]),d=u?"".concat(Bn(u)," ").concat(I("helpDialog.or")," ").concat(a+1):"".concat(a+1);return(0,P.jsx)(Al,{className:"Shape",type:"radio",icon:l,checked:n===i,name:"editor-current-shape",title:"".concat(Bn(c)," — ").concat(d),keyBindingLabel:"".concat(a+1),"aria-label":Bn(c),"aria-keyshortcuts":d,"data-testid":i,onChange:function(e){var n=e.pointerType;r({elementType:i,multiElement:null,selectedElementIds:{}}),Zn(t,i),"image"===i&&o({pointerType:n})}},i)}))})},Mf=function(e){var t=e.renderAction;e.zoom;return(0,P.jsx)(Jd,{gap:1,children:(0,P.jsxs)(Qd,{gap:1,align:"center",children:[t("zoomOut"),t("zoomIn"),t("resetZoom")]})})},If=function(e){e.appState,e.setAppState;var t=e.actionManager,n=e.showThemeBtn;return(0,P.jsxs)("div",{style:{display:"flex"},children:[t.renderAction("changeViewBackgroundColor"),n&&t.renderAction("toggleTheme")]})},Pf=(n(778),function(e){var t=e.isCollaborating,n=(e.collaboratorCount,e.onClick);return(0,P.jsx)(P.Fragment,{children:(0,P.jsx)(Al,{className:Ye("CollabButton",{"is-collaborating":t}),onClick:n,icon:fs,type:"button",title:I("labels.liveCollaboration"),"aria-label":I("labels.liveCollaboration"),showAriaLabel:Lh()})})}),Tf=function(e){var t=e.message,n=e.onClose,r=g((0,c.useState)(!!t),2),o=r[0],a=r[1],i=Dh().container,l=u().useCallback((function(){a(!1),n&&n(),null==i||i.focus()}),[n,i]);return(0,P.jsx)(P.Fragment,{children:o&&(0,P.jsx)(Gc,{small:!0,onCloseRequest:l,title:I("errorDialog.title"),children:(0,P.jsx)("div",{style:{whiteSpace:"pre-wrap"},children:t})})})},Af=(n(2205),"filter"in document.createElement("canvas").getContext("2d")),Lf=function(){return(0,P.jsxs)("div",{children:[(0,P.jsx)("h3",{children:I("canvasError.cannotShowPreview")}),(0,P.jsx)("p",{children:(0,P.jsx)("span",{children:I("canvasError.canvasTooBig")})}),(0,P.jsxs)("em",{children:["(",I("canvasError.canvasTooBigTip"),")"]})]})},_f=function(e,t){(0,Lt.unmountComponentAtNode)(t),t.innerHTML="",e instanceof HTMLCanvasElement?t.appendChild(e):(0,Lt.render)((0,P.jsx)(Lf,{}),t)},Df=function(e){var t,n=e.children,r=e.title,o=e.onClick,a=e.color,i=e.shade,l=void 0===i?6:i;return(0,P.jsx)("button",{className:"ExportDialog-imageExportButton",style:(t={},D(t,"--button-color",Pt[a][l]),D(t,"--button-color-darker",Pt[a][l+1]),D(t,"--button-color-darkest",Pt[a][l+2]),t),title:r,"aria-label":r,onClick:o,children:n})},zf=function(e){var t=e.elements,n=e.appState,r=e.files,o=e.exportPadding,a=void 0===o?d.qy:o,i=e.actionManager,l=e.onExportToPng,s=e.onExportToSvg,u=e.onExportToClipboard,p=ul(t,n),f=g((0,c.useState)(p),2),h=f[0],m=f[1],v=(0,c.useRef)(null),b=n.exportBackground,y=n.viewBackgroundColor,x=h?dl(t,n):t;return(0,c.useEffect)((function(){m(p)}),[p]),(0,c.useEffect)((function(){var e=v.current;e&&pd(x,n,r,{exportBackground:b,viewBackgroundColor:y,exportPadding:a}).then((function(t){return Uu(t).then((function(){_f(t,e)}))})).catch((function(t){console.error(t),_f(new Il,e)}))}),[n,r,x,b,a,y]),(0,P.jsxs)("div",{className:"ExportDialog",children:[(0,P.jsx)("div",{className:"ExportDialog__preview",ref:v}),Af&&i.renderAction("exportWithDarkMode"),(0,P.jsx)("div",{style:{display:"grid",gridTemplateColumns:"1fr"},children:(0,P.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(190px, 1fr))",overflow:"hidden"},children:[i.renderAction("changeExportBackground"),p&&(0,P.jsx)(Xd,{checked:h,onChange:function(e){return m(e)},children:I("labels.onlySelected")}),i.renderAction("changeExportEmbedScene")]})}),(0,P.jsxs)("div",{style:{display:"flex",alignItems:"center",marginTop:".6em"},children:[(0,P.jsx)(Qd,{gap:2,children:i.renderAction("changeExportScale")}),(0,P.jsx)("p",{style:{marginLeft:"1em",userSelect:"none"},children:"Scale"})]}),(0,P.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",margin:".6em 0"},children:!xu&&i.renderAction("changeProjectName")}),(0,P.jsxs)(Qd,{gap:2,justifyContent:"center",style:{margin:"2em 0"},children:[(0,P.jsx)(Df,{color:"indigo",title:I("buttons.exportToPng"),"aria-label":I("buttons.exportToPng"),onClick:function(){return l(x)},children:"PNG"}),(0,P.jsx)(Df,{color:"red",title:I("buttons.exportToSvg"),"aria-label":I("buttons.exportToSvg"),onClick:function(){return s(x)},children:"SVG"}),zd&&(0,P.jsx)(Df,{title:I("buttons.copyPngToClipboard"),onClick:function(){return u(x)},color:"gray",shade:7,children:Vl})]})]})},Hf=function(e){var t=e.elements,n=e.appState,r=e.files,o=e.exportPadding,a=void 0===o?d.qy:o,i=e.actionManager,l=e.onExportToPng,s=e.onExportToSvg,p=e.onExportToClipboard,f=g((0,c.useState)(!1),2),h=f[0],m=f[1],v=u().useCallback((function(){m(!1)}),[]);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Al,{onClick:function(){m(!0)},"data-testid":"image-export-button",icon:Kl,type:"button","aria-label":I("buttons.exportImage"),showAriaLabel:Lh(),title:I("buttons.exportImage")}),h&&(0,P.jsx)(Gc,{onCloseRequest:v,title:I("buttons.exportImage"),children:(0,P.jsx)(zf,{elements:t,appState:n,files:r,exportPadding:a,actionManager:i,onExportToPng:l,onExportToSvg:s,onExportToClipboard:p,onCloseRequest:v})})]})},Bf=(n(1310),function(e){var t=e.children,n=e.side,r=e.className;return(0,P.jsx)("div",{className:Ye("FixedSideContainer","FixedSideContainer_side_".concat(n),r),children:t})}),Nf=(n(7096),function(e){var t=function(e){var t=e.appState,n=e.elements,r=t.elementType,o=t.isResizing,a=t.isRotating,i=t.lastPointerDownWith,l=null!==t.multiElement;if("arrow"===r||"line"===r)return I(l?"hints.linearElementMulti":"hints.linearElement");if("freedraw"===r)return I("hints.freeDraw");if("text"===r)return I("hints.text");if("image"===t.elementType&&t.pendingImageElement)return I("hints.placeImage");var s=dl(n,t);if(o&&"mouse"===i&&1===s.length){var c=s[0];return tt(c)&&2===c.points.length?I("hints.lockAngle"):$e(c)?I("hints.resizeImage"):I("hints.resize")}return a&&"mouse"===i?I("hints.rotate"):1===s.length&&tt(s[0])?t.editingLinearElement?t.editingLinearElement.activePointIndex?I("hints.lineEditor_pointSelected"):I("hints.lineEditor_nothingSelected"):I("hints.lineEditor_info"):1===s.length&&Qe(s[0])?I("hints.text_selected"):t.editingElement&&Qe(t.editingElement)?I("hints.text_editing"):null}({appState:e.appState,elements:e.elements});return t?(t=Xn(t),(0,P.jsx)("div",{className:"HintViewer",children:(0,P.jsx)("span",{children:t})})):null}),Rf=(n(3336),n(694),(0,P.jsx)("svg",{viewBox:"0 0 1792 1792",children:(0,P.jsx)("path",{fill:"currentColor",d:"M1600 736v192q0 40-28 68t-68 28h-416v416q0 40-28 68t-68 28h-192q-40 0-68-28t-28-68v-416h-416q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h416v-416q0-40 28-68t68-28h192q40 0 68 28t28 68v416h416q40 0 68 28t28 68z"})})),Ff=function(e){var t=e.elements,n=e.files,r=e.pendingElements,o=e.onRemoveFromLibrary,a=e.onClick,i=(0,c.useRef)(null);(0,c.useEffect)((function(){var e=i.current;if(e)return(0,f.Z)(b().mark((function o(){var a,i;return b().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(a=t||r){o.next=3;break}return o.abrupt("return");case 3:return o.next=5,fd(a,{exportBackground:!1,viewBackgroundColor:Pt.white},n);case 5:i=o.sent,e.innerHTML=i.outerHTML;case 7:case"end":return o.stop()}}),o)})))(),function(){e.innerHTML=""}}),[t,r,n]);var l=g((0,c.useState)(!1),2),s=l[0],u=l[1],p=Lh(),h=(s||p)&&r&&(0,P.jsx)("div",{className:"library-unit__adder",children:Rf});return(0,P.jsxs)("div",{className:Ye("library-unit",{"library-unit__active":t||r}),onMouseEnter:function(){return u(!0)},onMouseLeave:function(){return u(!1)},children:[(0,P.jsx)("div",{className:Ye("library-unit__dragger",{"library-unit__pulse":!!r}),ref:i,draggable:!!t,onClick:t||r?a:void 0,onDragStart:function(e){u(!1),e.dataTransfer.setData(d.LO.excalidrawlib,JSON.stringify(t))}}),h,t&&(s||p)&&(0,P.jsx)("button",{className:"library-unit__removeFromLibrary","aria-label":I("labels.removeFromLibrary"),onClick:o,children:hs})]})},Vf={CHECKED:(0,P.jsx)("svg",{width:"1792",height:"1792",viewBox:"0 0 1792 1792",xmlns:"http://www.w3.org/2000/svg",children:(0,P.jsx)("path",{d:"M640 768h512v-192q0-106-75-181t-181-75-181 75-75 181v192zm832 96v576q0 40-28 68t-68 28h-960q-40 0-68-28t-28-68v-576q0-40 28-68t68-28h32v-192q0-184 132-316t316-132 316 132 132 316v192h32q40 0 68 28t28 68z"})}),UNCHECKED:(0,P.jsx)("svg",{width:"1792",height:"1792",viewBox:"0 0 1792 1792",xmlns:"http://www.w3.org/2000/svg",className:"unlocked-icon rtl-mirror",children:(0,P.jsx)("path",{d:"M1728 576v256q0 26-19 45t-45 19h-64q-26 0-45-19t-19-45v-256q0-106-75-181t-181-75-181 75-75 181v192h96q40 0 68 28t28 68v576q0 40-28 68t-68 28h-960q-40 0-68-28t-28-68v-576q0-40 28-68t68-28h672v-192q0-185 131.5-316.5t316.5-131.5 316.5 131.5 131.5 316.5z"})})},Uf=function(e){return(0,P.jsxs)("label",{className:Ye("ToolIcon ToolIcon__lock ToolIcon_type_floating zen-mode-visibility","ToolIcon_size_".concat("medium"),{"zen-mode-visibility--hidden":e.zenModeEnabled}),title:"".concat(e.title," — Q"),children:[(0,P.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title}),(0,P.jsx)("div",{className:"ToolIcon__icon",children:e.checked?Vf.CHECKED:Vf.UNCHECKED})]})},Gf=["heading","children"];function Wf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Kf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wf(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Zf=function(e){var t=e.heading,n=e.children,r=bo(e,Gf),o=Dh().id,a=(0,P.jsx)("h2",{className:"visually-hidden",id:"".concat(o,"-").concat(t,"-title"),children:I("headings.".concat(t))});return(0,P.jsx)("section",Kf(Kf({},r),{},{"aria-labelledby":"".concat(o,"-").concat(t,"-title"),children:"function"==typeof n?n(a):(0,P.jsxs)(P.Fragment,{children:[a,n]})}))},Yf=(n(580),u().memo((function(e){var t=e.className,n=e.mobile,r=e.collaborators,o=void 0===r?new Map:r,a=e.layout,i=e.actionManager,l="vertical"===a?6:3,s=o.size>l?-2*Math.min(o.size-l,15):4;return(0,P.jsx)("div",{className:Ye("UserList layout-".concat(a),t,{UserList_mobile:n}),style:D({},"--itemOffset","".concat(s,"px")),children:o.size>0&&Array.from(o).filter((function(e){var t=g(e,2),n=(t[0],t[1]);return 0!==Object.keys(n).length})).map((function(e){var t=g(e,2),r=t[0],o=t[1];return n?i.renderAction("goToCollaborator",{id:r}):(0,P.jsx)(Bc,{label:o.username||"Unknown user",children:i.renderAction("goToCollaborator",{id:r})},r)}))})}))),Xf=(0,P.jsx)("svg",{viewBox:"0 0 576 512",children:(0,P.jsx)("path",{fill:"currentColor",d:"M542.22 32.05c-54.8 3.11-163.72 14.43-230.96 55.59-4.64 2.84-7.27 7.89-7.27 13.17v363.87c0 11.55 12.63 18.85 23.28 13.49 69.18-34.82 169.23-44.32 218.7-46.92 16.89-.89 30.02-14.43 30.02-30.66V62.75c.01-17.71-15.35-31.74-33.77-30.7zM264.73 87.64C197.5 46.48 88.58 35.17 33.78 32.05 15.36 31.01 0 45.04 0 62.75V400.6c0 16.24 13.13 29.78 30.02 30.66 49.49 2.6 149.59 12.11 218.77 46.95 10.62 5.35 23.21-1.94 23.21-13.46V100.63c0-5.29-2.62-10.14-7.27-12.99z"})}),qf=function(e){var t=e.appState,n=e.setAppState;return(0,P.jsxs)("label",{className:Ye("ToolIcon ToolIcon_type_floating ToolIcon__library zen-mode-visibility","ToolIcon_size_medium",{"zen-mode-visibility--hidden":t.zenModeEnabled}),title:"".concat(Bn(I("toolBar.library"))," — 0"),style:{marginInlineStart:"var(--space-factor)"},children:[(0,P.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:"editor-library",onChange:function(e){n({isLibraryOpen:e.target.checked})},checked:t.isLibraryOpen,"aria-label":Bn(I("toolBar.library")),"aria-keyshortcuts":"0"}),(0,P.jsx)("div",{className:"ToolIcon__icon",children:Xf})]})};function $f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Qf=function(e){var t=e.onHomeButtonClick,n=e.appState,r=e.elements,o=e.libraryMenu,a=e.actionManager,i=e.renderJSONExportDialog,l=e.renderImageExportDialog,s=e.setAppState,c=e.onCollabButtonClick,u=e.onLockToggle,d=e.canvas,p=e.isCollaborating,f=e.renderCustomFooter,h=e.viewModeEnabled,m=e.showThemeBtn,g=e.onImageAction,v=e.renderTopRightUI,b=e.UIOptions;return(0,P.jsxs)(P.Fragment,{children:[!h&&(0,P.jsxs)(Bf,{side:"top",className:"App-top-bar",children:[(0,P.jsx)(Zf,{heading:"shapes",children:function(e){return(0,P.jsxs)(Jd,{gap:4,align:"center",children:[(0,P.jsxs)(Qd,{gap:1,children:[(0,P.jsxs)(Fc,{padding:1,children:[e,(0,P.jsx)(Qd,{gap:1,children:(0,P.jsx)(Of,{canvas:d,elementType:n.elementType,setAppState:s,onImageAction:function(e){var t=e.pointerType;g({insertOnCanvasDirectly:"mouse"!==t})}})})]}),v&&v(!0,n),(0,P.jsx)(Al,{type:"button",className:"HomeButton ToolIcon_type_floating",title:"Home","aria-label":"Home",icon:Zs,onClick:t},"home"),(0,P.jsx)(Uf,{checked:n.elementLocked,onChange:u,title:I("toolBar.lock")}),(0,P.jsx)(qf,{appState:n,setAppState:s})]}),o]})}}),(0,P.jsx)(Nf,{appState:n,elements:r})]}),(0,P.jsx)("div",{className:"App-bottom-bar",style:{marginBottom:14,marginLeft:14,marginRight:14},children:(0,P.jsxs)(Fc,{padding:0,children:[b.canvasActions&&"canvas"===n.openMenu?(0,P.jsx)(Zf,{className:"App-mobile-menu",heading:"canvasActions",children:(0,P.jsx)("div",{className:"panelColumn",children:(0,P.jsxs)(Jd,{gap:4,children:[h?(0,P.jsxs)(P.Fragment,{children:[i(),l()]}):(0,P.jsxs)(P.Fragment,{children:[a.renderAction("clearCanvas"),a.renderAction("loadScene"),i(),l(),c&&(0,P.jsx)(Pf,{isCollaborating:p,collaboratorCount:n.collaborators.size,onClick:c}),(0,P.jsx)(If,{actionManager:a,appState:n,setAppState:s,showThemeBtn:m})]}),null==f?void 0:f(!0,n),n.collaborators.size>0&&(0,P.jsxs)("fieldset",{children:[(0,P.jsx)("legend",{children:I("labels.collaborators")}),(0,P.jsx)(Yf,{mobile:!0,layout:"horizontal",collaborators:n.collaborators,actionManager:a})]})]})})}):"shape"===n.openMenu&&!h&&$i(n,r)?(0,P.jsx)(Zf,{className:"App-mobile-menu",heading:"selectedShapeActions",children:(0,P.jsx)(jf,{appState:n,elements:r,renderAction:a.renderAction,elementType:n.elementType})}):null,(0,P.jsxs)("footer",{className:"App-toolbar",children:[h?b.canvasActions?(0,P.jsx)("div",{className:"App-toolbar-content",children:a.renderAction("toggleCanvasMenu")}):(0,P.jsx)("div",{children:"Excalidraw"}):(0,P.jsxs)("div",{className:"App-toolbar-content",children:[b.canvasActions&&a.renderAction("toggleCanvasMenu"),a.renderAction("toggleEditMenu"),a.renderAction("undo"),a.renderAction("redo"),a.renderAction(n.multiElement?"finalize":"duplicateSelection"),a.renderAction("deleteSelectedElements")]}),n.scrolledOutside&&!n.openMenu&&(0,P.jsx)("button",{className:"scroll-back-to-content",onClick:function(){s(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$f(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},hl(r,n)))},children:I("buttons.scrollBackToContent")})]})]})})]})},Jf=(n(8051),function(e){var t=(0,c.useRef)(null),n=g((0,c.useState)(null),2),r=n[0],o=n[1];return(0,c.useLayoutEffect)((function(){if(e.spreadsheet){var n,r=Td(e.chartType,e.spreadsheet,0,0);o(r);var a=t.current;return(0,f.Z)(b().mark((function t(){return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fd(r,{exportBackground:!1,viewBackgroundColor:Pt.white},null);case 2:n=t.sent,a.appendChild(n),e.selected&&a.parentNode.focus();case 5:case"end":return t.stop()}}),t)})))(),function(){a.removeChild(n)}}}),[e.spreadsheet,e.chartType,e.selected]),(0,P.jsx)("button",{className:"ChartPreview",onClick:function(){r&&e.onClick(e.chartType,r)},children:(0,P.jsx)("div",{ref:t})})}),eh=function(e){var t=e.setAppState,n=e.appState,r=e.onClose,o=e.onInsertChart,a=u().useCallback((function(){r&&r()}),[r]),i=function(e,n){o(n),tu("magic","chart",e),t({currentChartType:e,pasteDialog:{shown:!1,data:null}})};return(0,P.jsx)(Gc,{small:!0,onCloseRequest:a,title:I("labels.pasteCharts"),className:"PasteChartDialog",autofocus:!1,children:(0,P.jsxs)("div",{className:"container",children:[(0,P.jsx)(Jf,{chartType:"bar",spreadsheet:n.pasteDialog.data,selected:"bar"===n.currentChartType,onClick:i}),(0,P.jsx)(Jf,{chartType:"line",spreadsheet:n.pasteDialog.data,selected:"line"===n.currentChartType,onClick:i})]})})};n(3922);function th(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var nh=function(){return(0,P.jsxs)("div",{className:"HelpDialog--header",children:[(0,P.jsx)("a",{className:"HelpDialog--btn",href:"https://github.com/excalidraw/excalidraw#documentation",target:"_blank",rel:"noopener noreferrer",children:I("helpDialog.documentation")}),(0,P.jsx)("a",{className:"HelpDialog--btn",href:"https://blog.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:I("helpDialog.blog")}),(0,P.jsx)("a",{className:"HelpDialog--btn",href:"https://github.com/excalidraw/excalidraw/issues",target:"_blank",rel:"noopener noreferrer",children:I("helpDialog.github")})]})},rh=function(e){return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("h3",{children:e.title}),e.children]})},oh=function(e){return(0,P.jsx)("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"space-between"},children:e.children})},ah=function(e){return(0,P.jsx)("div",{style:{width:"49%"},children:e.children})},ih=function(e){return(0,P.jsxs)("div",{className:"HelpDialog--island",children:[(0,P.jsx)("h3",{className:"HelpDialog--island-title",children:e.caption}),e.children]})},lh=function(e){return(0,P.jsx)("div",{className:"HelpDialog--shortcut",children:(0,P.jsxs)("div",{style:{display:"flex",margin:"0",padding:"4px 8px",alignItems:"center"},children:[(0,P.jsx)("div",{style:{lineHeight:1.4},children:e.label}),(0,P.jsx)("div",{style:{display:"flex",flex:"0 0 auto",justifyContent:"flex-end",marginInlineStart:"auto",minWidth:"30%"},children:e.shortcuts.map((function(t,n){return(0,P.jsxs)(u().Fragment,{children:[(0,P.jsx)(sh,{children:t}),e.isOr&&n!==e.shortcuts.length-1&&I("helpDialog.or")]},n)}))})]})})};lh.defaultProps={isOr:!0};var sh=function(e){return(0,P.jsx)("kbd",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?th(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):th(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({className:"HelpDialog--key"},e))},ch=function(e){var t=e.onClose,n=u().useCallback((function(){t&&t()}),[t]);return(0,P.jsx)(P.Fragment,{children:(0,P.jsxs)(Gc,{onCloseRequest:n,title:I("helpDialog.title"),className:"HelpDialog",children:[(0,P.jsx)(nh,{}),(0,P.jsx)(rh,{title:I("helpDialog.shortcuts"),children:(0,P.jsxs)(oh,{children:[(0,P.jsxs)(ah,{children:[(0,P.jsxs)(ih,{caption:I("helpDialog.shapes"),children:[(0,P.jsx)(lh,{label:I("toolBar.selection"),shortcuts:["V","1"]}),(0,P.jsx)(lh,{label:I("toolBar.rectangle"),shortcuts:["R","2"]}),(0,P.jsx)(lh,{label:I("toolBar.diamond"),shortcuts:["D","3"]}),(0,P.jsx)(lh,{label:I("toolBar.ellipse"),shortcuts:["E","4"]}),(0,P.jsx)(lh,{label:I("toolBar.arrow"),shortcuts:["A","5"]}),(0,P.jsx)(lh,{label:I("toolBar.line"),shortcuts:["P","6"]}),(0,P.jsx)(lh,{label:I("toolBar.freedraw"),shortcuts:["Shift+P","7"]}),(0,P.jsx)(lh,{label:I("toolBar.text"),shortcuts:["T","8"]}),(0,P.jsx)(lh,{label:I("toolBar.image"),shortcuts:["9"]}),(0,P.jsx)(lh,{label:I("toolBar.library"),shortcuts:["0"]}),(0,P.jsx)(lh,{label:I("helpDialog.editSelectedShape"),shortcuts:[Xn("Enter"),I("helpDialog.doubleClick")]}),(0,P.jsx)(lh,{label:I("helpDialog.textNewLine"),shortcuts:[Xn("Enter"),Xn("Shift+Enter")]}),(0,P.jsx)(lh,{label:I("helpDialog.textFinish"),shortcuts:[Xn("Esc"),Xn("CtrlOrCmd+Enter")]}),(0,P.jsx)(lh,{label:I("helpDialog.curvedArrow"),shortcuts:["A",I("helpDialog.click"),I("helpDialog.click"),I("helpDialog.click")],isOr:!1}),(0,P.jsx)(lh,{label:I("helpDialog.curvedLine"),shortcuts:["L",I("helpDialog.click"),I("helpDialog.click"),I("helpDialog.click")],isOr:!1}),(0,P.jsx)(lh,{label:I("toolBar.lock"),shortcuts:["Q"]}),(0,P.jsx)(lh,{label:I("helpDialog.preventBinding"),shortcuts:[Xn("CtrlOrCmd")]})]}),(0,P.jsxs)(ih,{caption:I("helpDialog.view"),children:[(0,P.jsx)(lh,{label:I("buttons.zoomIn"),shortcuts:[Xn("CtrlOrCmd++")]}),(0,P.jsx)(lh,{label:I("buttons.zoomOut"),shortcuts:[Xn("CtrlOrCmd+-")]}),(0,P.jsx)(lh,{label:I("buttons.resetZoom"),shortcuts:[Xn("CtrlOrCmd+0")]}),(0,P.jsx)(lh,{label:I("helpDialog.zoomToFit"),shortcuts:["Shift+1"]}),(0,P.jsx)(lh,{label:I("helpDialog.zoomToSelection"),shortcuts:["Shift+2"]}),(0,P.jsx)(lh,{label:I("buttons.fullScreen"),shortcuts:["F"]}),(0,P.jsx)(lh,{label:I("buttons.zenMode"),shortcuts:[Xn("Alt+Z")]}),(0,P.jsx)(lh,{label:I("labels.showGrid"),shortcuts:[Xn("CtrlOrCmd+'")]}),(0,P.jsx)(lh,{label:I("labels.viewMode"),shortcuts:[Xn("Alt+R")]}),(0,P.jsx)(lh,{label:I("labels.toggleTheme"),shortcuts:[Xn("Alt+Shift+D")]}),(0,P.jsx)(lh,{label:I("stats.title"),shortcuts:[Xn("Alt+/")]})]})]}),(0,P.jsx)(ah,{children:(0,P.jsxs)(ih,{caption:I("helpDialog.editor"),children:[(0,P.jsx)(lh,{label:I("labels.selectAll"),shortcuts:[Xn("CtrlOrCmd+A")]}),(0,P.jsx)(lh,{label:I("labels.multiSelect"),shortcuts:[Xn("Shift+".concat(I("helpDialog.click")))]}),(0,P.jsx)(lh,{label:I("labels.moveCanvas"),shortcuts:[Xn("Space+".concat(I("helpDialog.drag"))),Xn("Wheel+".concat(I("helpDialog.drag")))],isOr:!0}),(0,P.jsx)(lh,{label:I("labels.cut"),shortcuts:[Xn("CtrlOrCmd+X")]}),(0,P.jsx)(lh,{label:I("labels.copy"),shortcuts:[Xn("CtrlOrCmd+C")]}),(0,P.jsx)(lh,{label:I("labels.paste"),shortcuts:[Xn("CtrlOrCmd+V")]}),(0,P.jsx)(lh,{label:I("labels.copyAsPng"),shortcuts:[Xn("Shift+Alt+C")]}),(0,P.jsx)(lh,{label:I("labels.copyStyles"),shortcuts:[Xn("CtrlOrCmd+Alt+C")]}),(0,P.jsx)(lh,{label:I("labels.pasteStyles"),shortcuts:[Xn("CtrlOrCmd+Alt+V")]}),(0,P.jsx)(lh,{label:I("labels.delete"),shortcuts:[Xn("Del")]}),(0,P.jsx)(lh,{label:I("labels.sendToBack"),shortcuts:[Xn(_t?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")]}),(0,P.jsx)(lh,{label:I("labels.bringToFront"),shortcuts:[Xn(_t?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")]}),(0,P.jsx)(lh,{label:I("labels.sendBackward"),shortcuts:[Xn("CtrlOrCmd+[")]}),(0,P.jsx)(lh,{label:I("labels.bringForward"),shortcuts:[Xn("CtrlOrCmd+]")]}),(0,P.jsx)(lh,{label:I("labels.alignTop"),shortcuts:[Xn("CtrlOrCmd+Shift+Up")]}),(0,P.jsx)(lh,{label:I("labels.alignBottom"),shortcuts:[Xn("CtrlOrCmd+Shift+Down")]}),(0,P.jsx)(lh,{label:I("labels.alignLeft"),shortcuts:[Xn("CtrlOrCmd+Shift+Left")]}),(0,P.jsx)(lh,{label:I("labels.alignRight"),shortcuts:[Xn("CtrlOrCmd+Shift+Right")]}),(0,P.jsx)(lh,{label:I("labels.duplicateSelection"),shortcuts:[Xn("CtrlOrCmd+D"),Xn("Alt+".concat(I("helpDialog.drag")))]}),(0,P.jsx)(lh,{label:I("buttons.undo"),shortcuts:[Xn("CtrlOrCmd+Z")]}),(0,P.jsx)(lh,{label:I("buttons.redo"),shortcuts:Dt?[Xn("CtrlOrCmd+Y"),Xn("CtrlOrCmd+Shift+Z")]:[Xn("CtrlOrCmd+Shift+Z")]}),(0,P.jsx)(lh,{label:I("labels.group"),shortcuts:[Xn("CtrlOrCmd+G")]}),(0,P.jsx)(lh,{label:I("labels.ungroup"),shortcuts:[Xn("CtrlOrCmd+Shift+G")]}),(0,P.jsx)(lh,{label:I("labels.flipHorizontal"),shortcuts:[Xn("Shift+H")]}),(0,P.jsx)(lh,{label:I("labels.flipVertical"),shortcuts:[Xn("Shift+V")]}),(0,P.jsx)(lh,{label:I("labels.showStroke"),shortcuts:[Xn("S")]}),(0,P.jsx)(lh,{label:I("labels.showBackground"),shortcuts:[Xn("G")]})]})})]})})]})})},uh=(n(5080),function(e){var t,n=e.children,r=e.color;return(0,P.jsx)("div",{className:"Card",style:(t={},D(t,"--card-color",Pt[r][7]),D(t,"--card-color-darker",Pt[r][8]),D(t,"--card-color-darkest",Pt[r][9]),t),children:n})}),dh=function(e){var t=e.elements,n=e.appState,r=e.files,o=e.actionManager,a=e.exportOpts,i=e.canvas,l=a.onExportToBackend;return(0,P.jsx)("div",{className:"ExportDialog ExportDialog--json",children:(0,P.jsxs)("div",{className:"ExportDialog-cards",children:[a.saveFileToDisk&&(0,P.jsxs)(uh,{color:"lime",children:[(0,P.jsx)("div",{className:"Card-icon",children:Zl}),(0,P.jsx)("h2",{children:I("exportDialog.disk_title")}),(0,P.jsxs)("div",{className:"Card-details",children:[I("exportDialog.disk_details"),!xu&&o.renderAction("changeProjectName")]}),(0,P.jsx)(Al,{className:"Card-button",type:"button",title:I("exportDialog.disk_button"),"aria-label":I("exportDialog.disk_button"),showAriaLabel:!0,onClick:function(){o.executeAction(ip)}})]}),l&&(0,P.jsxs)(uh,{color:"pink",children:[(0,P.jsx)("div",{className:"Card-icon",children:Bl}),(0,P.jsx)("h2",{children:I("exportDialog.link_title")}),(0,P.jsx)("div",{className:"Card-details",children:I("exportDialog.link_details")}),(0,P.jsx)(Al,{className:"Card-button",type:"button",title:I("exportDialog.link_button"),"aria-label":I("exportDialog.link_button"),showAriaLabel:!0,onClick:function(){return l(t,n,r,i)}})]}),a.renderCustomUI&&a.renderCustomUI(t,n,r,i)]})})},ph=function(e){var t=e.elements,n=e.appState,r=e.files,o=e.actionManager,a=e.exportOpts,i=e.canvas,l=g((0,c.useState)(!1),2),s=l[0],d=l[1],p=u().useCallback((function(){d(!1)}),[]);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Al,{onClick:function(){"function"==typeof a?o.executeAction(ip):d(!0)},"data-testid":"json-export-button",icon:Zl,type:"button","aria-label":I("buttons.export"),showAriaLabel:Lh(),title:I("buttons.export")}),s&&a&&"function"!=typeof a&&(0,P.jsx)(Gc,{onCloseRequest:p,title:I("buttons.export"),children:(0,P.jsx)(dh,{elements:t,appState:n,files:r,actionManager:o,onCloseRequest:p,exportOpts:a,canvas:i})})]})},fh=["suggestedBindings","startBoundElement"];function hh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var mh=function(e){var t=e.libraryItems,n=e.onRemoveFromLibrary,r=e.onAddToLibrary,o=e.onInsertShape,a=e.pendingElements,i=e.theme,l=e.setAppState,s=e.setLibraryItems,c=e.libraryReturnUrl,u=e.focusContainer,d=e.library,p=e.files,f=e.id,h=Lh(),m=t.length+(a.length>0?1:0),g=h?4:6,v=Math.max(1,Math.ceil(m/g)),b=[],y=!1,x=c||window.location.origin+window.location.pathname;b.push((0,P.jsxs)("div",{className:"layer-ui__library-header",children:[(0,P.jsx)(Al,{type:"button",title:I("buttons.load"),"aria-label":I("buttons.load"),icon:Fl,onClick:function(){od(d).then((function(){l({isLibraryOpen:!1}),l({isLibraryOpen:!0})})).catch(nr).catch((function(e){l({errorMessage:e.message})}))}},"import"),!!t.length&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Al,{type:"button",title:I("buttons.export"),"aria-label":I("buttons.export"),icon:Wl,onClick:function(){rd(d).catch(nr).catch((function(e){l({errorMessage:e.message})}))}},"export"),(0,P.jsx)(Al,{type:"button",title:I("buttons.resetLibrary"),"aria-label":I("buttons.resetLibrary"),icon:Ul,onClick:function(){window.confirm(I("alerts.resetLibrary"))&&(d.resetLibrary(),s([]),u())}},"reset")]}),(0,P.jsx)("a",{href:"https://libraries.excalidraw.com?target=".concat(window.name||"_blank","&referrer=").concat(x,"&useHash=true&token=").concat(f,"&theme=").concat(i),target:"_excalidraw_libraries",children:I("labels.libraries")})]},"library-header"));for(var w=0;w<v;w++){for(var k=g*w,S=[],E=0;E<g;E++){var C=a.length>0&&!y&&k+E>=t.length;y=y||C,S.push((0,P.jsx)(Jd,{children:(0,P.jsx)(Ff,{elements:t[k+E],files:p,pendingElements:C?a:void 0,onRemoveFromLibrary:n.bind(null,k+E),onClick:C?r.bind(null,a):o.bind(null,t[k+E])})},E))}b.push((0,P.jsx)(Qd,{align:"center",gap:1,children:S},w))}return(0,P.jsx)(Jd,{align:"start",gap:1,className:"layer-ui__library-items",children:b})},gh=function(e){var t=e.onClickOutside,n=e.onInsertShape,r=e.pendingElements,o=e.onAddToLibrary,a=e.theme,i=e.setAppState,l=e.files,s=e.libraryReturnUrl,u=e.focusContainer,d=e.library,p=e.id,h=(0,c.useRef)(null);!function(e,t){(0,c.useEffect)((function(){var n=function(n){e.current&&(n.target instanceof Element&&(e.current.contains(n.target)||!document.body.contains(n.target))||t(n))};return document.addEventListener("pointerdown",n,!1),function(){document.removeEventListener("pointerdown",n)}}),[e,t])}(h,(function(e){e.target.closest(".ToolIcon_type_button__library")||t(e)}));var m=g((0,c.useState)([]),2),v=m[0],y=m[1],x=g((0,c.useState)("preloading"),2),w=x[0],k=x[1],S=(0,c.useRef)(null);(0,c.useEffect)((function(){return Promise.race([new Promise((function(e){S.current=window.setTimeout((function(){e("loading")}),100)})),d.loadLibrary().then((function(e){y(e),k("ready")}))]).then((function(e){"loading"===e&&k("loading")})),function(){clearTimeout(S.current)}}),[d]);var E=(0,c.useCallback)(function(){var e=(0,f.Z)(b().mark((function e(t){var n,r;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.loadLibrary();case 2:n=e.sent,r=n.filter((function(e,n){return n!==t})),d.saveLibrary(r).catch((function(e){y(n),i({errorMessage:I("alerts.errorRemovingFromLibrary")})})),y(r);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[d,i]),C=(0,c.useCallback)(function(){var e=(0,f.Z)(b().mark((function e(t){var n,r;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.some((function(e){return"image"===e.type}))){e.next=2;break}return e.abrupt("return",i({errorMessage:"Support for adding images to the library coming soon!"}));case 2:return e.next=4,d.loadLibrary();case 4:n=e.sent,r=[].concat(_(n),[t]),o(),d.saveLibrary(r).catch((function(e){y(n),i({errorMessage:I("alerts.errorAddingToLibrary")})})),y(r);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[o,d,i]);return"preloading"===w?null:(0,P.jsx)(Fc,{padding:1,ref:h,className:"layer-ui__library",children:"loading"===w?(0,P.jsx)("div",{className:"layer-ui__library-message",children:I("labels.libraryLoadingMessage")}):(0,P.jsx)(mh,{libraryItems:v,onRemoveFromLibrary:E,onAddToLibrary:C,onInsertShape:n,pendingElements:r,setAppState:i,setLibraryItems:y,libraryReturnUrl:s,focusContainer:u,library:d,theme:a,files:l,id:p})})},vh=function(e){var t,n=e.onHomeButtonClick,r=e.actionManager,o=e.appState,a=e.files,i=e.setAppState,l=e.canvas,s=e.elements,u=e.onCollabButtonClick,p=e.onLockToggle,h=e.onInsertElements,m=e.zenModeEnabled,g=e.showExitZenModeBtn,v=e.showThemeBtn,y=e.toggleZenMode,x=e.isCollaborating,w=e.renderTopRightUI,k=e.renderCustomFooter,S=e.viewModeEnabled,E=e.libraryReturnUrl,C=e.UIOptions,j=e.focusContainer,O=e.library,M=e.id,A=e.onImageAction,L=Lh(),_=function(){return C.canvasActions&&C.canvasActions.export?(0,P.jsx)(ph,{elements:s,appState:o,files:a,actionManager:r,exportOpts:C.canvasActions.export,canvas:l}):null},z=function(){if(!C.canvasActions||!C.canvasActions.saveAsImage)return null;var e=function(e){return function(){var t=(0,f.Z)(b().mark((function t(n){var r;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Wd(e,n,o,a,{exportBackground:o.exportBackground,name:o.name,viewBackgroundColor:o.viewBackgroundColor}).catch(nr).catch((function(e){console.error(e),i({errorMessage:e.message})}));case 2:r=t.sent,o.exportEmbedScene&&r&&Nu(r)&&i({fileHandle:r});case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()};return(0,P.jsx)(Hf,{elements:s,appState:o,files:a,actionManager:r,onExportToPng:e("png"),onExportToSvg:e("svg"),onExportToClipboard:e("clipboard")})},H=(0,c.useCallback)((function(e){i({isLibraryOpen:!1})}),[i]),B=(0,c.useCallback)((function(){i({selectedElementIds:{},selectedGroupIds:{}})}),[i]),N=o.isLibraryOpen?(0,P.jsx)(gh,{pendingElements:dl(s,o),onClickOutside:H,onInsertShape:h,onAddToLibrary:B,setAppState:i,libraryReturnUrl:E,focusContainer:j,library:O,theme:o.theme,files:a,id:M}):null,R=(0,P.jsxs)(P.Fragment,{children:[o.isLoading&&(0,P.jsx)(T,{}),o.errorMessage&&(0,P.jsx)(Tf,{message:o.errorMessage,onClose:function(){return i({errorMessage:null})}}),o.showHelpDialog&&(0,P.jsx)(ch,{onClose:function(){i({showHelpDialog:!1})}}),o.pasteDialog.shown&&(0,P.jsx)(eh,{setAppState:i,appState:o,onInsertChart:h,onClose:function(){return i({pasteDialog:{shown:!1,data:null}})}})]});return L?(0,P.jsxs)(P.Fragment,{children:[R,(0,P.jsx)(Qf,{onHomeButtonClick:n,appState:o,elements:s,actionManager:r,libraryMenu:N,renderJSONExportDialog:_,renderImageExportDialog:z,setAppState:i,onCollabButtonClick:u,onLockToggle:p,canvas:l,isCollaborating:x,renderCustomFooter:k,viewModeEnabled:S,showThemeBtn:v,onImageAction:A,renderTopRightUI:w,UIOptions:C})]}):(0,P.jsxs)("div",{className:Ye("layer-ui__wrapper",{"disable-pointerEvents":o.draggingElement||o.resizingElement||o.editingElement&&!Qe(o.editingElement)}),children:[R,(t=$i(o,s),(0,P.jsx)(Bf,{side:"top",children:(0,P.jsxs)("div",{className:"App-menu App-menu_top",children:[(0,P.jsxs)(Jd,{gap:4,className:Ye({"disable-pointerEvents":m}),children:[C.canvasActions&&(S?(0,P.jsx)(Zf,{heading:"canvasActions",className:Ye("zen-mode-transition",{"transition-left":m}),children:(0,P.jsx)(Fc,{padding:2,style:{zIndex:1},children:(0,P.jsx)(Jd,{gap:4,children:(0,P.jsxs)(Qd,{gap:1,justifyContent:"space-between",children:[_(),z()]})})})}):(0,P.jsx)(Zf,{heading:"canvasActions",className:Ye("zen-mode-transition",{"transition-left":m}),children:(0,P.jsx)(Fc,{padding:2,style:{zIndex:1},children:(0,P.jsxs)(Jd,{gap:4,children:[(0,P.jsxs)(Qd,{gap:3,justifyContent:"space-between",children:[r.renderAction("clearCanvas"),r.renderAction("loadScene"),_(),z(),u&&(0,P.jsx)(Pf,{isCollaborating:x,collaboratorCount:o.collaborators.size,onClick:u})]}),(0,P.jsx)(If,{actionManager:r,appState:o,setAppState:i,showThemeBtn:v}),o.fileHandle&&(0,P.jsx)(P.Fragment,{children:r.renderAction("saveToActiveFile")})]})})})),t&&(0,P.jsx)(Zf,{heading:"selectedShapeActions",className:Ye("zen-mode-transition",{"transition-left":m}),children:(0,P.jsx)(Fc,{className:d.$C.SHAPE_ACTIONS_MENU,padding:2,style:{maxHeight:"".concat(o.height-(o.fileHandle?248:200),"px")},children:(0,P.jsx)(jf,{appState:o,elements:s,renderAction:r.renderAction,elementType:o.elementType})})})]}),!S&&(0,P.jsx)(Zf,{heading:"shapes",children:function(e){return(0,P.jsxs)(Jd,{gap:4,align:"start",children:[(0,P.jsxs)(Qd,{gap:1,children:[(0,P.jsx)(Uf,{zenModeEnabled:m,checked:o.elementLocked,onChange:p,title:I("toolBar.lock")}),(0,P.jsxs)(Fc,{padding:1,className:Ye({"zen-mode":m}),children:[(0,P.jsx)(Nf,{appState:o,elements:s}),e,(0,P.jsx)(Qd,{gap:1,children:(0,P.jsx)(Of,{canvas:l,elementType:o.elementType,setAppState:i,onImageAction:function(e){var t=e.pointerType;A({insertOnCanvasDirectly:"mouse"!==t})}})})]}),(0,P.jsx)(qf,{appState:o,setAppState:i})]}),N]})}}),(0,P.jsx)("div",{className:Ye("layer-ui__wrapper__top-right zen-mode-transition",{"transition-right":m}),children:null==w?void 0:w(L,o)}),(0,P.jsx)(Yf,{className:Ye("zen-mode-transition",{"transition-right":m}),layout:"vertical",collaborators:o.collaborators,actionManager:r})]})})),(0,P.jsxs)("footer",{role:"contentinfo",className:"layer-ui__wrapper__footer App-menu App-menu_bottom",children:[(0,P.jsx)("div",{className:Ye("layer-ui__wrapper__footer-left zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":m}),children:(0,P.jsx)(Jd,{gap:2,children:(0,P.jsxs)(Zf,{heading:"canvasActions",children:[(0,P.jsx)(Fc,{padding:1,children:(0,P.jsx)(Mf,{renderAction:r.renderAction,zoom:o.zoom})}),!S&&(0,P.jsxs)("div",{className:Ye("undo-redo-buttons zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":m}),children:[r.renderAction("undo",{size:"small"}),r.renderAction("redo",{size:"small"})]})]})})}),(0,P.jsx)("div",{className:Ye("layer-ui__wrapper__footer-center zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":m}),children:null==k?void 0:k(!1,o)}),(0,P.jsx)("div",{className:Ye("layer-ui__wrapper__footer-right zen-mode-transition",{"transition-right disable-pointerEvents":m}),children:r.renderAction("toggleShortcuts")}),(0,P.jsx)("button",{className:Ye("disable-zen-mode",{"disable-zen-mode--visible":g}),onClick:y,children:I("buttons.exitZenMode")})]}),o.scrolledOutside&&(0,P.jsx)("button",{className:"scroll-back-to-content",onClick:function(){i(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hh(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},hl(s,o)))},children:I("buttons.scrollBackToContent")})]})},bh=function(e,t){var n=function(e){e.suggestedBindings,e.startBoundElement;return bo(e,fh)},r=n(e.appState),o=n(t.appState),a=Object.keys(r);return e.renderTopRightUI===t.renderTopRightUI&&e.renderCustomFooter===t.renderCustomFooter&&e.langCode===t.langCode&&e.elements===t.elements&&a.every((function(e){return r[e]===o[e]}))},yh=u().memo(vh,bh),xh=(n(1528),function(e){var t,n=Lh(),r=Ot(e.elements),o=pl(e.elements,e.appState),a=Ot(o);return n&&e.appState.openMenu?null:(0,P.jsx)("div",{className:"Stats",children:(0,P.jsxs)(Fc,{padding:2,children:[(0,P.jsx)("div",{className:"close",onClick:e.onClose,children:hs}),(0,P.jsx)("h3",{children:I("stats.title")}),(0,P.jsx)("table",{children:(0,P.jsxs)("tbody",{children:[(0,P.jsx)("tr",{children:(0,P.jsx)("th",{colSpan:2,children:I("stats.scene")})}),(0,P.jsxs)("tr",{children:[(0,P.jsx)("td",{children:I("stats.elements")}),(0,P.jsx)("td",{children:e.elements.length})]}),(0,P.jsxs)("tr",{children:[(0,P.jsx)("td",{children:I("stats.width")}),(0,P.jsx)("td",{children:Math.round(r[2])-Math.round(r[0])})]}),(0,P.jsxs)("tr",{children:[(0,P.jsx)("td",{children:I("stats.height")}),(0,P.jsx)("td",{children:Math.round(r[3])-Math.round(r[1])})]}),1===o.length&&(0,P.jsx)("tr",{children:(0,P.jsx)("th",{colSpan:2,children:I("stats.element")})}),o.length>1&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("tr",{children:(0,P.jsx)("th",{colSpan:2,children:I("stats.selected")})}),(0,P.jsxs)("tr",{children:[(0,P.jsx)("td",{children:I("stats.elements")}),(0,P.jsx)("td",{children:o.length})]})]}),o.length>0&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)("tr",{children:[(0,P.jsx)("td",{children:"x"}),(0,P.jsx)("td",{children:Math.round(a[0])})]}),(0,P.jsxs)("tr",{children:[(0,P.jsx)("td",{children:"y"}),(0,P.jsx)("td",{children:Math.round(a[1])})]}),(0,P.jsxs)("tr",{children:[(0,P.jsx)("td",{children:I("stats.width")}),(0,P.jsx)("td",{children:Math.round(a[2]-a[0])})]}),(0,P.jsxs)("tr",{children:[(0,P.jsx)("td",{children:I("stats.height")}),(0,P.jsx)("td",{children:Math.round(a[3]-a[1])})]})]}),1===o.length&&(0,P.jsxs)("tr",{children:[(0,P.jsx)("td",{children:I("stats.angle")}),(0,P.jsx)("td",{children:"".concat(Math.round(180*o[0].angle/Math.PI),"°")})]}),null===(t=e.renderCustomStats)||void 0===t?void 0:t.call(e,e.elements,e.appState)]})})]})})}),wh=(n(9757),function(e){var t=e.message,n=e.clearToast,r=(0,c.useRef)(0),o=(0,c.useCallback)((function(){return r.current=window.setTimeout((function(){return n()}),d.Lg)}),[n]);return(0,c.useEffect)((function(){return o(),function(){return clearTimeout(r.current)}}),[o,t]),(0,P.jsx)("div",{className:"Toast",onMouseEnter:function(){return clearTimeout(null==r?void 0:r.current)},onMouseLeave:o,children:(0,P.jsx)("p",{className:"Toast__message",children:t})})});function kh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Sh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kh(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Eh=Xs({name:"viewMode",perform:function(e,t){return tu("view","mode","view"),{appState:Sh(Sh({},t),{},{viewModeEnabled:!this.checked(t)}),commitToHistory:!1}},checked:function(e){return e.viewModeEnabled},contextItemLabel:"labels.viewMode",keyTest:function(e){return!e[un]&&e.altKey&&e.code===nn}}),Ch=n(200),jh=n.n(Ch);function Oh(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Mh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Mh(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}function Mh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ih(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ph(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ih(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ih(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Th(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=U(e);if(t){var o=U(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return V(this,n)}}var Ah=u().createContext(!1),Lh=function(){return(0,c.useContext)(Ah)},_h=u().createContext({container:null,id:null}),Dh=function(){return(0,c.useContext)(_h)},zh=!1,Hh=0,Bh=0,Nh=0,Rh=!1,Fh=!1,Vh=!1,Uh={horizontal:null,vertical:null},Gh=0,Wh=!1,Kh=null,Zh={pointers:new Map,lastCenter:null,initialDistance:null,initialScale:null},Yh=function(e){F(o,e);var t,n,r=Th(o);function o(e){var t;z(this,o),t=r.call(this,e),Xh.call(N(t));var n,a,i,l,s=sr(),c=e.excalidrawRef,u=e.viewModeEnabled,p=void 0!==u&&u,f=e.zenModeEnabled,h=void 0!==f&&f,m=e.gridModeEnabled,g=void 0!==m&&m,v=e.theme,b=void 0===v?s.theme:v,y=e.name,x=void 0===y?s.name:y;if(t.state=Ph(Ph(Ph({},s),{},{theme:b,isLoading:!0},t.getCanvasOffsets()),{},{viewModeEnabled:p,zenModeEnabled:h,gridSize:g?d.k:null,name:x,width:window.innerWidth,height:window.innerHeight}),t.id=Xe(),c){var w,k="current"in c&&(null===(w=c.current)||void 0===w?void 0:w.readyPromise)||((i=new Promise((function(e,t){n=e,a=t}))).resolve=n,i.reject=a,i),S={ready:!0,readyPromise:k,updateScene:t.updateScene,addFiles:t.addFiles,resetScene:t.resetScene,getSceneElementsIncludingDeleted:t.getSceneElementsIncludingDeleted,history:{clear:t.resetHistory},scrollToContent:t.scrollToContent,getSceneElements:t.getSceneElements,getAppState:function(){return t.state},getFiles:function(){return t.files},refresh:t.refresh,importLibrary:t.importLibraryFromUrl,setToastMessage:t.setToastMessage,id:t.id};"function"==typeof c?c(S):c.current=S,k.resolve(S)}return t.excalidrawContainerValue={container:t.excalidrawContainerRef.current,id:t.id},t.scene=new ao,t.library=new df(N(t)),t.history=new bf,t.actionManager=new uf(t.syncActionResult,(function(){return t.state}),(function(){return t.scene.getElementsIncludingDeleted()}),N(t)),t.actionManager.registerAll(Ys),t.actionManager.registerAction((l=t.history,{name:"undo",perform:function(e,t){return cf(e,t,(function(){return l.undoOnce()}))},keyTest:function(e){return e[un]&&e.key.toLowerCase()===Tn&&!e.shiftKey},PanelComponent:function(e){var t=e.updateData,n=e.data;return(0,P.jsx)(Al,{type:"button",icon:Ql,"aria-label":I("buttons.undo"),onClick:t,size:(null==n?void 0:n.size)||"medium"})},commitToHistory:function(){return!1}})),t.actionManager.registerAction(function(e){return{name:"redo",perform:function(t,n){return cf(t,n,(function(){return e.redoOnce()}))},keyTest:function(e){return e[un]&&e.shiftKey&&e.key.toLowerCase()===Tn||Dt&&e.ctrlKey&&!e.shiftKey&&e.key===Pn},PanelComponent:function(e){var t=e.updateData,n=e.data;return(0,P.jsx)(Al,{type:"button",icon:Jl,"aria-label":I("buttons.redo"),onClick:t,size:(null==n?void 0:n.size)||"medium"})},commitToHistory:function(){return!1}}}(t.history)),t}return B(o,[{key:"renderCanvas",value:function(){var e=window.devicePixelRatio,t=this.state,n=t.width,r=t.height,o=n*e,a=r*e;return t.viewModeEnabled?(0,P.jsx)("canvas",{className:"excalidraw__canvas",style:{width:n,height:r,cursor:d.oc.GRAB},width:o,height:a,ref:this.handleCanvasRef,onContextMenu:this.handleCanvasContextMenu,onPointerMove:this.handleCanvasPointerMove,onPointerUp:this.removePointer,onPointerCancel:this.removePointer,onTouchMove:this.handleTouchMove,onPointerDown:this.handleCanvasPointerDown,children:I("labels.drawingCanvas")}):(0,P.jsx)("canvas",{className:"excalidraw__canvas",style:{width:n,height:r},width:o,height:a,ref:this.handleCanvasRef,onContextMenu:this.handleCanvasContextMenu,onPointerDown:this.handleCanvasPointerDown,onDoubleClick:this.handleCanvasDoubleClick,onPointerMove:this.handleCanvasPointerMove,onPointerUp:this.removePointer,onPointerCancel:this.removePointer,onTouchMove:this.handleTouchMove,children:I("labels.drawingCanvas")})}},{key:"render",value:function(){var e,t,n=this,r=this.state,o=r.zenModeEnabled,a=r.viewModeEnabled,i=this.props,l=i.onCollabButtonClick,s=i.renderTopRightUI,c=i.renderFooter,u=i.renderCustomStats;return(0,P.jsx)("div",{className:Ye("excalidraw excalidraw-container",{"excalidraw--zen-mode":o,"excalidraw--view-mode":a,"excalidraw--mobile":this.isMobile}),ref:this.excalidrawContainerRef,onDrop:this.handleAppOnDrop,tabIndex:0,onKeyDown:this.props.handleKeyboardGlobally?void 0:this.onKeyDown,children:(0,P.jsx)(_h.Provider,{value:this.excalidrawContainerValue,children:(0,P.jsxs)(Ah.Provider,{value:this.isMobile,children:[(0,P.jsx)(yh,{onHomeButtonClick:this.props.onHomeButtonClick,canvas:this.canvas,appState:this.state,files:this.files,setAppState:this.setAppState,actionManager:this.actionManager,elements:this.scene.getElements(),onCollabButtonClick:l,onLockToggle:this.toggleLock,onInsertElements:function(e){return n.addElementsFromPasteOrLibrary({elements:e,position:"center",files:null})},zenModeEnabled:o,toggleZenMode:this.toggleZenMode,langCode:O().code,isCollaborating:this.props.isCollaborating||!1,renderTopRightUI:s,renderCustomFooter:c,viewModeEnabled:a,showExitZenModeBtn:void 0===(null===(e=this.props)||void 0===e?void 0:e.zenModeEnabled)&&o,showThemeBtn:void 0===(null===(t=this.props)||void 0===t?void 0:t.theme)&&this.props.UIOptions.canvasActions&&this.props.UIOptions.canvasActions.theme,libraryReturnUrl:this.props.libraryReturnUrl,UIOptions:this.props.UIOptions,focusContainer:this.focusContainer,library:this.library,id:this.id,onImageAction:this.onImageAction}),(0,P.jsx)("div",{className:"excalidraw-textEditorContainer"}),(0,P.jsx)("div",{className:"excalidraw-contextMenuContainer"}),this.state.showStats&&(0,P.jsx)(xh,{appState:this.state,setAppState:this.setAppState,elements:this.scene.getElements(),onClose:this.toggleStats,renderCustomStats:u}),null!==this.state.toastMessage&&(0,P.jsx)(wh,{message:this.state.toastMessage,clearToast:this.clearToast}),(0,P.jsx)("main",{children:this.renderCanvas()})]})})})}},{key:"componentDidMount",value:(n=(0,f.Z)(b().mark((function e(){var t,n,r,o,a=this;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.excalidrawContainerValue.container=this.excalidrawContainerRef.current,"production"!==d.Vi.TEST&&"production"!==d.Vi.DEVELOPMENT||(this.setState.bind(this),Object.defineProperties(window.h,{state:{configurable:!0,get:function(){return a.state}},setState:{configurable:!0,value:function(){return a.setState.apply(a,arguments)}},app:{configurable:!0,value:this},history:{configurable:!0,value:this.history}})),this.scene.addCallback(this.onSceneUpdated),this.addEventListeners(),this.excalidrawContainerRef.current&&this.focusContainer(),"ResizeObserver"in window&&null!==(t=this.excalidrawContainerRef)&&void 0!==t&&t.current?(this.resizeObserver=new ResizeObserver((function(){var e=a.excalidrawContainerRef.current.getBoundingClientRect(),t=e.width,n=e.height;a.isMobile=t<d.kV||n<d.Yx&&t<d.sS,a.updateDOMRect()})),null===(n=this.resizeObserver)||void 0===n||n.observe(this.excalidrawContainerRef.current)):window.matchMedia&&(r=window.matchMedia("(max-width: ".concat(d.kV,"px), (max-height: ").concat(d.Yx,"px) and (max-width: ").concat(d.sS,"px)")),o=function(){return a.isMobile=r.matches},r.addListener(o),this.detachIsMobileMqHandler=function(){return r.removeListener(o)}),new URLSearchParams(window.location.search.slice(1)).has("web-share-target")?this.restoreFileFromShare():this.updateDOMRect(this.initializeScene);case 8:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"componentWillUnmount",value:function(){var e,t=this;this.files={},this.imageCache.clear(),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.unmounted=!0,this.removeEventListeners(),this.scene.destroy(),Fr=new WeakMap,Vr=new WeakMap,Qr=new WeakMap,this.scene=new ao,this.history=new bf,this.actionManager=new uf(this.syncActionResult,(function(){return t.state}),(function(){return t.scene.getElementsIncludingDeleted()}),this),this.library=new df(this),this.canvas=null,this.rc=null,this.excalidrawContainerRef.current=void 0,this.nearestScrollableContainer=void 0,this.excalidrawContainerValue={container:null,id:"unmounted"},clearTimeout(Gh),Gh=0}},{key:"removeEventListeners",value:function(){var e,t,n,r;document.removeEventListener(d.Ks.POINTER_UP,this.removePointer),document.removeEventListener(d.Ks.COPY,this.onCopy),document.removeEventListener(d.Ks.PASTE,this.pasteFromClipboard),document.removeEventListener(d.Ks.CUT,this.onCut),null===(e=this.nearestScrollableContainer)||void 0===e||e.removeEventListener(d.Ks.SCROLL,this.onScroll),document.removeEventListener(d.Ks.KEYDOWN,this.onKeyDown,!1),document.removeEventListener(d.Ks.MOUSE_MOVE,this.updateCurrentCursorPosition,!1),document.removeEventListener(d.Ks.KEYUP,this.onKeyUp),window.removeEventListener(d.Ks.RESIZE,this.onResize,!1),window.removeEventListener(d.Ks.UNLOAD,this.onUnload,!1),window.removeEventListener(d.Ks.BLUR,this.onBlur,!1),window.removeEventListener(d.Ks.DRAG_OVER,this.disableEvent,!1),window.removeEventListener(d.Ks.DROP,this.disableEvent,!1),null===(t=document.fonts)||void 0===t||null===(n=t.removeEventListener)||void 0===n||n.call(t,"loadingdone",this.onFontLoaded),document.removeEventListener(d.Ks.GESTURE_START,this.onGestureStart,!1),document.removeEventListener(d.Ks.GESTURE_CHANGE,this.onGestureChange,!1),document.removeEventListener(d.Ks.GESTURE_END,this.onGestureEnd,!1),null===(r=this.detachIsMobileMqHandler)||void 0===r||r.call(this)}},{key:"addEventListeners",value:function(){var e,t;this.removeEventListeners(),document.addEventListener(d.Ks.POINTER_UP,this.removePointer),document.addEventListener(d.Ks.COPY,this.onCopy),this.props.handleKeyboardGlobally&&document.addEventListener(d.Ks.KEYDOWN,this.onKeyDown,!1),document.addEventListener(d.Ks.KEYUP,this.onKeyUp,{passive:!0}),document.addEventListener(d.Ks.MOUSE_MOVE,this.updateCurrentCursorPosition),null===(e=document.fonts)||void 0===e||null===(t=e.addEventListener)||void 0===t||t.call(e,"loadingdone",this.onFontLoaded),document.addEventListener(d.Ks.GESTURE_START,this.onGestureStart,!1),document.addEventListener(d.Ks.GESTURE_CHANGE,this.onGestureChange,!1),document.addEventListener(d.Ks.GESTURE_END,this.onGestureEnd,!1),this.state.viewModeEnabled||(document.addEventListener(d.Ks.PASTE,this.pasteFromClipboard),document.addEventListener(d.Ks.CUT,this.onCut),this.props.detectScroll&&(this.nearestScrollableContainer=function(e){for(var t=e.parentElement;t;){if(t===document.body)return document;var n=window.getComputedStyle(t).overflowY;if(t.scrollHeight>t.clientHeight&&("auto"===n||"scroll"===n))return t;t=t.parentElement}return document}(this.excalidrawContainerRef.current),this.nearestScrollableContainer.addEventListener(d.Ks.SCROLL,this.onScroll)),window.addEventListener(d.Ks.RESIZE,this.onResize,!1),window.addEventListener(d.Ks.UNLOAD,this.onUnload,!1),window.addEventListener(d.Ks.BLUR,this.onBlur,!1),window.addEventListener(d.Ks.DRAG_OVER,this.disableEvent,!1),window.addEventListener(d.Ks.DROP,this.disableEvent,!1))}},{key:"componentDidUpdate",value:function(e,t){var n,r,o=this;e.langCode!==this.props.langCode&&this.updateLanguage(),e.viewModeEnabled!==this.props.viewModeEnabled&&this.setState({viewModeEnabled:!!this.props.viewModeEnabled}),t.viewModeEnabled!==this.state.viewModeEnabled&&(this.addEventListeners(),this.deselectElements()),e.zenModeEnabled!==this.props.zenModeEnabled&&this.setState({zenModeEnabled:!!this.props.zenModeEnabled}),e.theme!==this.props.theme&&this.props.theme&&this.setState({theme:this.props.theme}),e.gridModeEnabled!==this.props.gridModeEnabled&&this.setState({gridSize:this.props.gridModeEnabled?d.k:null}),this.props.UIOptions.canvasActions||"canvas"!==this.state.openMenu||this.setState({openMenu:null}),this.props.name&&e.name!==this.props.name&&this.setState({name:this.props.name}),null===(n=this.excalidrawContainerRef.current)||void 0===n||n.classList.toggle("theme--dark","dark"===this.state.theme),this.state.editingLinearElement&&!this.state.selectedElementIds[this.state.editingLinearElement.elementId]&&setTimeout((function(){o.actionManager.executeAction(eu)}));var a=t.multiElement;t.elementType!==this.state.elementType&&null!=a&&ci(this.state)&&rt(a)&&hi(a,this.state,this.scene,tr(li.getPointAtIndexGlobalCoordinates(a,-1)));var i={},l={},s={},c={},u={};this.state.collaborators.forEach((function(e,t){if(e.selectedElementIds)for(var n=0,r=Object.keys(e.selectedElementIds);n<r.length;n++){var a=r[n];a in s||(s[a]=[]),s[a].push(t)}e.pointer&&(e.username&&(c[t]=e.username),e.userState&&(u[t]=e.userState),l[t]=$n({sceneX:e.pointer.x,sceneY:e.pointer.y},o.state),i[t]=e.button)}));var p=this.scene.getElements().filter((function(e){return(!$e(e)||!o.state.pendingImageElement||e.id!==o.state.pendingImageElement.id)&&(!o.state.editingElement||"text"!==o.state.editingElement.type||e.id!==o.state.editingElement.id)})),f=pu(p,this.state,this.state.selectionElement,window.devicePixelRatio,this.rc,this.canvas,{scrollX:this.state.scrollX,scrollY:this.state.scrollY,viewBackgroundColor:this.state.viewBackgroundColor,zoom:this.state.zoom,remotePointerViewportCoords:l,remotePointerButton:i,remoteSelectedElementIds:s,remotePointerUsernames:c,remotePointerUserStates:u,shouldCacheIgnoreZoom:this.state.shouldCacheIgnoreZoom,theme:this.state.theme,imageCache:this.imageCache},{renderOptimizations:!0,renderScrollbars:!this.isMobile}),h=f.atLeastOneVisibleElement,m=f.scrollBars;m&&(Uh=m);var g,v,b="text"!==(null===(r=this.state.editingElement)||void 0===r?void 0:r.type)&&(!h&&p.length>0);(this.state.scrolledOutside!==b&&this.setState({scrolledOutside:b}),this.history.record(this.state,this.scene.getElementsIncludingDeleted()),this.scheduleImageRefresh(),this.state.isLoading)||(null===(g=(v=this.props).onChange)||void 0===g||g.call(v,this.scene.getElementsIncludingDeleted(),this.state,this.files,this.props.id))}},{key:"addTextFromPaste",value:function(e){var t=qn({clientX:Bh,clientY:Nh},this.state),n=t.x,r=t.y,o=Ho({x:n,y:r,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,strokeSharpness:this.state.currentItemStrokeSharpness,text:e,fontSize:this.state.currentItemFontSize,fontFamily:this.state.currentItemFontFamily,textAlign:this.state.currentItemTextAlign,verticalAlign:d.hs});this.scene.replaceAllElements([].concat(_(this.scene.getElementsIncludingDeleted()),[o])),this.setState({selectedElementIds:D({},o.id,!0)}),this.history.resumeRecording()}},{key:"selectShapeTool",value:function(e){var t;Rh||Zn(this.canvas,e),(t=document.activeElement)instanceof HTMLElement&&t.className.includes("ToolIcon")&&this.focusContainer(),nt(e)||this.setState({suggestedBindings:[]}),"image"===e&&this.onImageAction(),"selection"!==e?this.setState({elementType:e,selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}):this.setState({elementType:e})}},{key:"handleTextWysiwyg",value:function(e,t){var n=this,r=t.isExistingElement,o=void 0!==r&&r,a=function(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n.scene.replaceAllElements(_(n.scene.getElementsIncludingDeleted().map((function(n){return n.id===e.id&&Qe(n)?Bo(n,{text:t,isDeleted:r}):n}))))};!function(e){var t=e.id,n=e.appState,r=e.onChange,o=e.onSubmit,a=e.getViewportCoords,i=e.element,l=e.canvas,s=e.excalidrawContainer,c=function(){var e,r=null===(e=ao.getScene(i))||void 0===e?void 0:e.getElement(t);if(r&&Qe(r)){var o=g(a(r.x,r.y),2),l=o[0],c=o[1],d=r.textAlign,p=r.angle;u.value=r.text;var f=r.text.replace(/\r\n?/g,"\n").split("\n"),h=r.height/f.length,m=(n.offsetLeft+n.width-l-8)/n.zoom.value-Number(getComputedStyle(null==s?void 0:s.parentNode).marginRight.slice(0,-2));Object.assign(u.style,{font:Fn(r),lineHeight:"".concat(h,"px"),width:"".concat(r.width,"px"),height:"".concat(r.height,"px"),left:"".concat(l,"px"),top:"".concat(c,"px"),transform:Xi(r.width,r.height,p,n,m),textAlign:d,color:r.strokeColor,opacity:r.opacity/100,filter:"var(--theme-filter)",maxWidth:"".concat(m,"px")})}},u=document.createElement("textarea");u.dir="auto",u.tabIndex=0,u.dataset.type="wysiwyg",u.wrap="off",Object.assign(u.style,{position:"absolute",display:"inline-block",minHeight:"1em",backfaceVisibility:"hidden",margin:0,padding:0,border:0,outline:0,resize:"none",background:"transparent",overflow:"hidden",whiteSpace:"pre",zIndex:"var(--zIndex-wysiwyg)"}),c(),r&&(u.oninput=function(){r(Yi(u.value))}),u.onkeydown=function(e){if(e.stopPropagation(),e.key===fn)e.preventDefault(),y=!0,x();else if(e.key===pn&&e[un]){if(e.preventDefault(),e.isComposing||229===e.keyCode)return;y=!0,x()}else(e.key===gn||e[un]&&(e.code===Vt||e.code===Ft))&&(e.preventDefault(),e.shiftKey||e.code===Vt?m():h(),u.dispatchEvent(new Event("input")))};var p=" ".repeat(4),f=new RegExp("^ {1,".concat(4,"}")),h=function(){var e=u.selectionStart,t=u.selectionEnd,n=v(),r=u.value;n.forEach((function(e){var t=r.slice(0,e),n=r.slice(e);r="".concat(t).concat(p).concat(n)})),u.value=r,u.selectionStart=e+4,u.selectionEnd=t+4*n.length},m=function(){var e=u.selectionStart,t=u.selectionEnd,n=v(),r=[],o=u.value;n.forEach((function(e){var t=o.slice(e,e+4).match(f);if(t){var n=o.slice(0,e),a=o.slice(e+t[0].length);o="".concat(n).concat(a),r.push(e)}})),u.value=o,r.length&&(e>r[r.length-1]?u.selectionStart=Math.max(e-4,r[r.length-1]):u.selectionStart=e,u.selectionEnd=Math.max(u.selectionStart,t-4*r.length))},v=function(){var e=u.selectionStart,t=u.selectionEnd,n=u.value,r=n.slice(0,e).match(/[^\n]*$/)[0].length;return e-=r,n.slice(e,t).split("\n").reduce((function(t,n,r,o){return t.concat(r?t[r-1]+o[r-1].length+1:e)}),[]).reverse()},b=function(e){e.preventDefault(),e.stopPropagation()},y=!1,x=function(){w(),o({text:Yi(u.value),viaKeyboard:y})},w=function(){C||(C=!0,u.onblur=null,u.oninput=null,u.onkeydown=null,j&&j.disconnect(),window.removeEventListener("resize",c),window.removeEventListener("wheel",b,!0),window.removeEventListener("pointerdown",S),window.removeEventListener("pointerup",k),window.removeEventListener("blur",x),E(),u.remove())},k=function e(){window.removeEventListener("pointerup",e),setTimeout((function(){u.onblur=x,u.focus()}))},S=function(e){(e.target instanceof HTMLElement||e.target instanceof SVGElement)&&e.target.closest(".".concat(d.$C.SHAPE_ACTIONS_MENU))&&!Nn(e.target)&&(u.onblur=null,window.addEventListener("pointerup",k),window.addEventListener("blur",x))},E=ao.getScene(i).addCallback((function(){c(),u.focus()})),C=!1;u.select(),k();var j=null;l&&"ResizeObserver"in window?(j=new window.ResizeObserver((function(){c()}))).observe(l):window.addEventListener("resize",c),window.addEventListener("pointerdown",S),window.addEventListener("wheel",b,{passive:!1,capture:!0}),null==s||s.querySelector(".excalidraw-textEditorContainer").appendChild(u)}({id:e.id,appState:this.state,canvas:this.canvas,getViewportCoords:function(e,t){var r=$n({sceneX:e,sceneY:t},n.state),o=r.x,a=r.y;return[o-n.state.offsetLeft,a-n.state.offsetTop]},onChange:or((function(t){a(t),rl(e)&&ki(e)})),onSubmit:or((function(t){var r=t.text,i=t.viaKeyboard,l=!r.trim();a(r,l),!l&&i&&n.setState((function(t){return{selectedElementIds:Ph(Ph({},t.selectedElementIds),{},D({},e.id,!0))}})),l&&_i(n.scene.getElements(),[e]),l&&!o||n.history.resumeRecording(),n.setState({draggingElement:null,editingElement:null}),n.state.elementLocked&&Zn(n.canvas,n.state.elementType),n.focusContainer()})),element:e,excalidrawContainer:this.excalidrawContainerRef.current}),this.deselectElements(),a(e.text)}},{key:"deselectElements",value:function(){this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})}},{key:"getTextElementAtPosition",value:function(e,t){var n=this.getElementAtPosition(e,t);return n&&Qe(n)&&!n.isDeleted?n:null}},{key:"getElementAtPosition",value:function(e,t,n){var r=this.getElementsAtPosition(e,t);if(r.length>1){if(null!=n&&n.preferSelected)for(var o=r.length-1;o>-1;o--)if(this.state.selectedElementIds[r[o].id])return r[o];var a=r[r.length-1];return wa(a,this.state,e,t)?r[r.length-2]:a}return 1===r.length?r[0]:null}},{key:"getElementsAtPosition",value:function(e,t){var n,r,o=this;return n=this.scene.getElements(),r=function(n){return function(e,t,n,r){var o=10/t.zoom.value,a=[n,r];return Sa(t,e)?Ea(e,a,o):ka(e,t,a)}(n,o.state,e,t)},n.filter((function(e){return!e.isDeleted&&r(e)}))}},{key:"maybeCleanupAfterMissingPointerUp",value:function(e){null!==Kh&&Kh(e)}},{key:"updateGestureOnPointerDown",value:function(e){Zh.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),2===Zh.pointers.size&&(Zh.lastCenter=pf(Zh.pointers),Zh.initialScale=this.state.zoom.value,Zh.initialDistance=ff(Array.from(Zh.pointers.values())))}},{key:"initialPointerDownState",value:function(e){var t=qn(e,this.state),n=dl(this.scene.getElements(),this.state),r=g(Ot(n),4),o=r[0],a=r[1],i=r[2],l=r[3];return{origin:t,withCmdOrCtrl:e[un],originInGrid:tr(mt(t.x,t.y,this.state.gridSize)),scrollbars:cl(Uh,e.clientX-this.state.offsetLeft,e.clientY-this.state.offsetTop),lastCoords:Ph({},t),originalElements:this.scene.getElements().reduce((function(e,t){return e.set(t.id,Ro(t)),e}),new Map),resize:{handleType:!1,isResizing:!1,offset:{x:0,y:0},arrowDirection:"origin",center:{x:(i+o)/2,y:(l+a)/2}},hit:{element:null,allHitElements:[],wasAddedToSelection:!1,hasBeenDuplicated:!1,hasHitCommonBoundingBoxOfSelectedElements:this.isHittingCommonBoundingBoxOfSelectedElements(t,n)},drag:{hasOccurred:!1,offset:null},eventListeners:{onMove:null,onUp:null,onKeyUp:null,onKeyDown:null}}}},{key:"handleDraggingScrollBar",value:function(e,t){var n=this;if(!t.scrollbars.isOverEither||this.state.multiElement)return!1;Vh=!0,t.lastCoords.x=e.clientX,t.lastCoords.y=e.clientY;var r=or((function(e){e.target instanceof HTMLElement&&n.handlePointerMoveOverScrollbars(e,t)})),o=or((function(){Vh=!1,Zn(n.canvas,n.state.elementType),Kh=null,n.setState({cursorButton:"up"}),n.savePointer(e.clientX,e.clientY,"up"),window.removeEventListener(d.Ks.POINTER_MOVE,r),window.removeEventListener(d.Ks.POINTER_UP,o)}));return Kh=o,window.addEventListener(d.Ks.POINTER_MOVE,r),window.addEventListener(d.Ks.POINTER_UP,o),!0}},{key:"isASelectedElement",value:function(e){return null!=e&&this.state.selectedElementIds[e.id]}},{key:"isHittingCommonBoundingBoxOfSelectedElements",value:function(e,t){if(t.length<2)return!1;var n=10/this.state.zoom.value,r=g(Ot(t),4),o=r[0],a=r[1],i=r[2],l=r[3];return e.x>o-n&&e.x<i+n&&e.y>a-n&&e.y<l+n}},{key:"onKeyDownFromPointerDownHandler",value:function(e){var t=this;return or((function(n){t.maybeHandleResize(e,n)||t.maybeDragNewGenericElement(e,n)}))}},{key:"onKeyUpFromPointerDownHandler",value:function(e){var t=this;return or((function(n){n.key===cn&&n.preventDefault(),t.maybeHandleResize(e,n)||t.maybeDragNewGenericElement(e,n)}))}},{key:"onPointerMoveFromPointerDownHandler",value:function(e){var t=this;return or((function(n){if(null===e.drag.offset&&(e.drag.offset=tr(function(e,t,n){var r=g(Ot(e),2);return[t-r[0],n-r[1]]}(dl(t.scene.getElements(),t.state),e.origin.x,e.origin.y))),n.target instanceof HTMLElement&&!t.handlePointerMoveOverScrollbars(n,e)){var r=qn(n,t.state),o=g(mt(r.x,r.y,t.state.gridSize),2),a=o[0],i=o[1];if(e.drag.hasOccurred||"arrow"!==t.state.elementType&&"line"!==t.state.elementType||!(ct(r.x,r.y,e.origin.x,e.origin.y)<d.f)){if(e.resize.isResizing&&(e.lastCoords.x=r.x,e.lastCoords.y=r.y,t.maybeHandleResize(e,n)))return!0;if(t.state.editingLinearElement)if(li.handlePointDragging(t.state,(function(e){return t.setState(e)}),r.x,r.y,(function(e,n){t.maybeSuggestBindingForLinearElementAtCursor(e,n,r)})))return e.lastCoords.x=r.x,void(e.lastCoords.y=r.y);if(e.hit.allHitElements.some((function(e){return t.isASelectedElement(e)}))||e.hit.hasHitCommonBoundingBoxOfSelectedElements){e.drag.hasOccurred=!0;var l=dl(t.scene.getElements(),t.state);if(l.length>0&&!e.withCmdOrCtrl){var s=g(mt(r.x-e.drag.offset.x,r.y-e.drag.offset.y,t.state.gridSize),2),c=s[0],u=s[1],p=[Math.abs(r.x-e.origin.x),Math.abs(r.y-e.origin.y)],f=p[0],h=p[1],m=n.shiftKey;if(function(e,t,n,r,o){var a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],i=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,s=g(Ot(t),2),c=s[0],u=s[1],d={x:n-c,y:r-u};t.forEach((function(n){var r,o;if(a){var s=a&&i<l,c=a&&i>l,u=e.originalElements.get(n.id);r=s&&u?u.x:n.x+d.x,o=c&&u?u.y:n.y+d.y}else r=n.x+d.x,o=n.y+d.y;po(n,{x:r,y:o}),ki(n,{simultaneouslyUpdated:t})}))}(e,l,c,u,t.scene,m,f,h),t.maybeSuggestBindingForAll(l),n.altKey&&!e.hit.hasBeenDuplicated){e.hit.hasBeenDuplicated=!0;var v,b=[],y=[],x=new Map,w=new Map,k=e.hit.element,S=Oh(t.scene.getElementsIncludingDeleted());try{for(S.s();!(v=S.n()).done;){var E=v.value;if(t.state.selectedElementIds[E.id]||E.id===(null==k?void 0:k.id)&&e.hit.wasAddedToSelection){var C=Fo(t.state.editingGroupId,x,E),j=g(mt(e.origin.x-e.drag.offset.x,e.origin.y-e.drag.offset.y,t.state.gridSize),2),O=j[0],M=j[1];po(C,{x:C.x+(O-c),y:C.y+(M-u)}),b.push(C),y.push(E),w.set(E.id,C.id)}else b.push(E)}}catch(e){S.e(e)}finally{S.f()}var I=[].concat(b,y);Ai(I,y,w,"duplicatesServeAsOld"),t.scene.replaceAllElements(I)}return}}var P=t.state.draggingElement;if(P){if("freedraw"===P.type){var T=P.points,A=r.x-P.x,L=r.y-P.y,z=P.simulatePressure?P.pressures:[].concat(_(P.pressures),[n.pressure]);po(P,{points:[].concat(_(T),[[A,L]]),pressures:z})}else if(tt(P)){e.drag.hasOccurred=!0;var H=P.points,B=a-P.x,N=i-P.y;if(Dn(n)&&2===H.length){var R=go(t.state.elementType,B,N);B=R.width,N=R.height}1===H.length?po(P,{points:[].concat(_(H),[[B,N]])}):H.length>1&&po(P,{points:[].concat(_(H.slice(0,-1)),[[B,N]])}),rt(P)&&t.maybeSuggestBindingForLinearElementAtCursor(P,"end",r,t.state.startBoundElement)}else e.lastCoords.x=r.x,e.lastCoords.y=r.y,t.maybeDragNewGenericElement(e,n);if("selection"===t.state.elementType){var F=t.scene.getElements();!n.shiftKey&&ul(F,t.state)&&(e.withCmdOrCtrl&&e.hit.element?t.setState((function(n){return Oo(Ph(Ph({},n),{},{selectedElementIds:D({},e.hit.element.id,!0)}),t.scene.getElements())})):t.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}));var V=function(e,t){var n=g(xt(t),4),r=n[0],o=n[1],a=n[2],i=n[3];return e.filter((function(e){var t=g(jt(e),4),n=t[0],l=t[1],s=t[2],c=t[3];return"selection"!==e.type&&r<=n&&o<=l&&a>=s&&i>=c}))}(F,P);t.setState((function(n){return Oo(Ph(Ph({},n),{},{selectedElementIds:Ph(Ph(Ph({},n.selectedElementIds),V.reduce((function(e,t){return e[t.id]=!0,e}),{})),e.hit.element?D({},e.hit.element.id,!V.length):null)}),t.scene.getElements())}))}}}}}))}},{key:"handlePointerMoveOverScrollbars",value:function(e,t){if(t.scrollbars.isOverHorizontal){var n=e.clientX,r=n-t.lastCoords.x;return this.setState({scrollX:this.state.scrollX-r/this.state.zoom.value}),t.lastCoords.x=n,!0}if(t.scrollbars.isOverVertical){var o=e.clientY,a=o-t.lastCoords.y;return this.setState({scrollY:this.state.scrollY-a/this.state.zoom.value}),t.lastCoords.y=o,!0}return!1}},{key:"onPointerUpFromPointerDownHandler",value:function(e){var t=this;return or((function(n){var r=t.state,o=r.draggingElement,a=r.resizingElement,i=r.multiElement,l=r.elementType,s=r.elementLocked,c=r.isResizing,u=r.isRotating;if(t.setState({isResizing:!1,isRotating:!1,resizingElement:null,selectionElement:null,cursorButton:"up",editingElement:i||Qe(t.state.editingElement)?t.state.editingElement:null}),t.savePointer(n.clientX,n.clientY,"up"),t.state.editingLinearElement){var p=li.handlePointerUp(n,t.state.editingLinearElement,t.state);p!==t.state.editingLinearElement&&t.setState({editingLinearElement:p,suggestedBindings:[]})}if(Kh=null,window.removeEventListener(d.Ks.POINTER_MOVE,e.eventListeners.onMove),window.removeEventListener(d.Ks.POINTER_UP,e.eventListeners.onUp),window.removeEventListener(d.Ks.KEYDOWN,e.eventListeners.onKeyDown),window.removeEventListener(d.Ks.KEYUP,e.eventListeners.onKeyUp),t.state.pendingImageElement&&t.setState({pendingImageElement:null}),"freedraw"===(null==o?void 0:o.type)){var f=qn(n,t.state),h=o.points,m=f.x-o.x,g=f.y-o.y;m===h[0][0]&&g===h[0][1]&&(g+=1e-4,m+=1e-4);var v=o.simulatePressure?[]:[].concat(_(o.pressures),[n.pressure]);return po(o,{points:[].concat(_(h),[[m,g]]),pressures:v,lastCommittedPoint:[m,g]}),void t.actionManager.executeAction(eu)}if($e(o)){var b=o;try{t.initializeImageDimensions(b),t.setState({selectedElementIds:D({},b.id,!0)},(function(){t.actionManager.executeAction(eu)}))}catch(e){console.error(e),t.scene.replaceAllElements(t.scene.getElementsIncludingDeleted().filter((function(e){return e.id!==b.id}))),t.actionManager.executeAction(eu)}}else if(tt(o)){o.points.length>1&&t.history.resumeRecording();var y=qn(n,t.state);e.drag.hasOccurred||!o||i?e.drag.hasOccurred&&!i&&(ci(t.state)&&rt(o)&&hi(o,t.state,t.scene,y),t.setState({suggestedBindings:[],startBoundElement:null}),s?t.setState((function(e){return{draggingElement:null,selectedElementIds:Ph(Ph({},e.selectedElementIds),{},D({},t.state.draggingElement.id,!0))}})):(Wn(t.canvas),t.setState((function(e){return{draggingElement:null,elementType:"selection",selectedElementIds:Ph(Ph({},e.selectedElementIds),{},D({},t.state.draggingElement.id,!0))}})))):(po(o,{points:[].concat(_(o.points),[[y.x-o.x,y.y-o.y]])}),t.setState({multiElement:o,editingElement:t.state.draggingElement}))}else{if("selection"!==l&&o&&mo(o))return t.scene.replaceAllElements(t.scene.getElementsIncludingDeleted().slice(0,-1)),void t.setState({draggingElement:null});o&&po(o,vo(o)),a&&t.history.resumeRecording(),a&&mo(a)&&t.scene.replaceAllElements(t.scene.getElementsIncludingDeleted().filter((function(e){return e.id!==a.id})));var x=e.hit.element;if(x&&!e.drag.hasOccurred&&!e.hit.wasAddedToSelection)if(n.shiftKey)if(t.state.selectedElementIds[x.id])if(Eo(t.state,x)){var w=x.groupIds.flatMap((function(e){return Io(t.scene.getElements(),e)})).map((function(e){return D({},e.id,!1)})).reduce((function(e,t){return Ph(Ph({},e),t)}),{});t.setState((function(e){return{selectedGroupIds:Ph(Ph({},e.selectedElementIds),x.groupIds.map((function(e){return D({},e,!1)})).reduce((function(e,t){return Ph(Ph({},e),t)}),{})),selectedElementIds:Ph(Ph({},e.selectedElementIds),w)}}))}else t.setState((function(e){return Oo(Ph(Ph({},e),{},{selectedElementIds:Ph(Ph({},e.selectedElementIds),{},D({},x.id,!1))}),t.scene.getElements())}));else t.setState((function(e){return{selectedElementIds:Ph(Ph({},e.selectedElementIds),{},D({},x.id,!0))}}));else t.setState((function(e){return Ph({},Oo(Ph(Ph({},e),{},{selectedElementIds:D({},x.id,!0)}),t.scene.getElements()))}));t.state.editingLinearElement||e.drag.hasOccurred||t.state.isResizing||!(x&&wa(x,t.state,e.origin.x,e.origin.y)||!x&&e.hit.hasHitCommonBoundingBoxOfSelectedElements)?(!s&&"freedraw"!==l&&o&&t.setState((function(e){return{selectedElementIds:Ph(Ph({},e.selectedElementIds),{},D({},o.id,!0))}})),("selection"!==l||ul(t.scene.getElements(),t.state))&&t.history.resumeRecording(),(e.drag.hasOccurred||c||u)&&(ci(t.state)?pi:bi)(dl(t.scene.getElements(),t.state)),s||"freedraw"===l?t.setState({draggingElement:null,suggestedBindings:[]}):(Wn(t.canvas),t.setState({draggingElement:null,suggestedBindings:[],elementType:"selection"}))):t.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})}}))}},{key:"maybeSuggestBindingForAll",value:function(e){var t,n,r=(t=e,n=new Set(t.map((function(e){return e.id}))),t.flatMap((function(e){return rt(e)?Oi(e).filter((function(e){return!n.has(e.id)})):at(e)?Pi(e).filter((function(e){return!n.has(e[0].id)})):[]})));this.setState({suggestedBindings:r})}},{key:"clearSelection",value:function(e){this.setState((function(t){return{selectedElementIds:{},selectedGroupIds:{},editingGroupId:t.editingGroupId&&null!=e&&Mo(e,t.editingGroupId)?t.editingGroupId:null}})),this.setState({selectedElementIds:{},previousSelectedElementIds:this.state.selectedElementIds})}},{key:"getTextWysiwygSnappedToCenterPosition",value:function(e,t,n,r,o){var a=function(e,t,n){for(var r=null,o=e.length-1;o>=0;--o)if(!e[o].isDeleted){var a=g(xt(e[o]),4),i=a[0],l=a[1],s=a[2],c=a[3];if(i<t&&t<s&&l<n&&n<c){r=e[o];break}}return r}(this.scene.getElementsIncludingDeleted().filter((function(e){return!Qe(e)})),e,t);if(a){var i=a.x+a.width/2,l=a.y+a.height/2;if(Math.hypot(e-i,t-l)<d.wZ){var s=$n({sceneX:i,sceneY:l},n);return{viewportX:s.x,viewportY:s.y,elementCenterX:i,elementCenterY:l}}}}},{key:"getCanvasOffsets",value:function(){var e;if(null!==(e=this.excalidrawContainerRef)&&void 0!==e&&e.current){var t=this.excalidrawContainerRef.current.getBoundingClientRect();return{offsetLeft:t.left,offsetTop:t.top}}return{offsetLeft:0,offsetTop:0}}},{key:"updateLanguage",value:(t=(0,f.Z)(b().mark((function e(){var t,n=this;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=k.find((function(e){return e.code===n.props.langCode}))||w,e.next=3,j(t);case 3:this.setAppState({});case 4:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}],[{key:"resetTapTwice",value:function(){zh=!1}}]),o}(u().Component);Yh.defaultProps={UIOptions:d.cW};var Xh=function(){var e=this;this.canvas=null,this.rc=null,this.unmounted=!1,this.isMobile=!1,this.excalidrawContainerRef=u().createRef(),this.files={},this.imageCache=new Map,this.focusContainer=function(){var t;e.props.autoFocus&&(null===(t=e.excalidrawContainerRef.current)||void 0===t||t.focus())},this.getSceneElementsIncludingDeleted=function(){return e.scene.getElementsIncludingDeleted()},this.getSceneElements=function(){return e.scene.getElements()},this.syncActionResult=or((function(t){if(!e.unmounted&&!1!==t){var n=null;if(t.elements&&(t.elements.forEach((function(t){var r;(null===(r=e.state.editingElement)||void 0===r?void 0:r.id)===t.id&&e.state.editingElement!==t&&rl(t)&&(n=t)})),e.scene.replaceAllElements(t.elements),t.commitToHistory&&e.history.resumeRecording()),t.files&&(e.files=t.replaceFiles?t.files:Ph(Ph({},e.files),t.files),e.addNewImagesToImageCache()),t.appState||n){var r,o,a,i,l,s;t.commitToHistory&&e.history.resumeRecording();var c=(null==t||null===(r=t.appState)||void 0===r?void 0:r.viewModeEnabled)||!1,u=(null==t||null===(o=t.appState)||void 0===o?void 0:o.zenModeEnabled)||!1,p=(null==t||null===(a=t.appState)||void 0===a?void 0:a.gridSize)||null,f=(null==t||null===(i=t.appState)||void 0===i?void 0:i.theme)||d.C6.LIGHT,h=null!==(l=null==t||null===(s=t.appState)||void 0===s?void 0:s.name)&&void 0!==l?l:e.state.name;void 0!==e.props.viewModeEnabled&&(c=e.props.viewModeEnabled),void 0!==e.props.zenModeEnabled&&(u=e.props.zenModeEnabled),void 0!==e.props.gridModeEnabled&&(p=e.props.gridModeEnabled?d.k:null),void 0!==e.props.theme&&(f=e.props.theme),void 0!==e.props.name&&(h=e.props.name),e.setState((function(e){var r;return Object.assign(t.appState||{},{editingElement:n||(null===(r=t.appState)||void 0===r?void 0:r.editingElement)||null,viewModeEnabled:c,zenModeEnabled:u,gridSize:p,theme:f,name:h})}),(function(){t.syncHistory&&e.history.setCurrentState(e.state,e.scene.getElementsIncludingDeleted())}))}}})),this.onBlur=or((function(){Rh=!1,e.setState({isBindingEnabled:!0})})),this.onUnload=function(){e.onBlur()},this.disableEvent=function(e){e.preventDefault()},this.onFontLoaded=function(){e.scene.getElementsIncludingDeleted().forEach((function(e){Qe(e)&&Gr(e)})),e.onSceneUpdated()},this.importLibraryFromUrl=function(){var t=(0,f.Z)(b().mark((function t(n,r){var o,a,i,l,s;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return window.location.hash.includes(d.ah.addLibrary)?((o=new URLSearchParams(window.location.hash.slice(1))).delete(d.ah.addLibrary),window.history.replaceState({},d.iC,"#".concat(o.toString()))):window.location.search.includes(d.UO.addLibrary)&&((a=new URLSearchParams(window.location.search)).delete(d.UO.addLibrary),window.history.replaceState({},d.iC,"?".concat(a.toString()))),t.prev=1,t.next=4,fetch(decodeURIComponent(n));case 4:return i=t.sent,t.next=7,i.blob();case 7:return l=t.sent,t.t0=JSON,t.next=11,l.text();case 11:if(t.t1=t.sent,s=t.t0.parse.call(t.t0,t.t1),nd(s)){t.next=15;break}throw new Error;case 15:if(r!==e.id&&!window.confirm(I("alerts.confirmAddLibrary",{numShapes:s.library.length}))){t.next=20;break}return t.next=18,e.library.importLibrary(l);case 18:e.state.isLibraryOpen&&e.setState({isLibraryOpen:!1}),e.setState({isLibraryOpen:!0});case 20:t.next=26;break;case 22:t.prev=22,t.t2=t.catch(1),window.alert(I("alerts.errorLoadingLibrary")),console.error(t.t2);case 26:return t.prev=26,e.focusContainer(),t.finish(26);case 29:case"end":return t.stop()}}),t,null,[[1,22,26,29]])})));return function(e,n){return t.apply(this,arguments)}}(),this.resetHistory=function(){e.history.clear()},this.resetScene=or((function(t){e.scene.replaceAllElements([]),e.setState((function(n){return Ph(Ph({},sr()),{},{isLoading:(null==t||!t.resetLoadingState)&&n.isLoading,theme:e.state.theme})})),e.resetHistory()})),this.initializeScene=(0,f.Z)(b().mark((function t(){var n,r,o,a,i,l,s;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return"launchQueue"in window&&"LaunchParams"in window&&window.launchQueue.setConsumer(function(){var t=(0,f.Z)(b().mark((function t(n){var r,o;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n.files.length){t.next=2;break}return t.abrupt("return");case 2:return r=n.files[0],t.next=5,r.getFile();case 5:(o=t.sent).handle=r,Fu(o,e.state,e.scene.getElementsIncludingDeleted()).then((function(t){e.syncActionResult(Ph(Ph({},t),{},{appState:Ph(Ph({},t.appState||e.state),{},{isLoading:!1}),commitToHistory:!0}))})).catch((function(t){e.setState({isLoading:!1,errorMessage:t.message})}));case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),e.state.isLoading||e.setState({isLoading:!0}),a=null,t.prev=3,t.next=6,e.props.initialData;case 6:if(t.t0=t.sent,t.t0){t.next=9;break}t.t0=null;case 9:a=t.t0,null!==(i=a)&&void 0!==i&&i.libraryItems&&(e.libraryItemsFromStorage=a.libraryItems),t.next=17;break;case 13:t.prev=13,t.t1=t.catch(3),console.error(t.t1),a={appState:{errorMessage:t.t1.message||"Encountered an error during importing or restoring scene data"}};case 17:if((l=_u(a,null,null)).appState=Ph(Ph({},l.appState),{},{elementType:"image"===l.appState.elementType?"selection":l.appState.elementType,isLoading:!1}),null!==(n=a)&&void 0!==n&&n.scrollToContent&&(l.appState=Ph(Ph({},l.appState),hl(l.elements,Ph(Ph({},l.appState),{},{width:e.state.width,height:e.state.height,offsetTop:e.state.offsetTop,offsetLeft:e.state.offsetLeft})))),null!=(null===(r=a)||void 0===r?void 0:r.scrollX)&&(l.appState.scrollX=a.scrollX),null!=(null===(o=a)||void 0===o?void 0:o.scrollY)&&(l.appState.scrollY=a.scrollY),e.resetHistory(),e.syncActionResult(Ph(Ph({},l),{},{commitToHistory:!0})),!(s=new URLSearchParams(window.location.hash.slice(1)).get(d.ah.addLibrary)||new URLSearchParams(window.location.search).get(d.UO.addLibrary))){t.next=28;break}return t.next=28,e.importLibraryFromUrl(s);case 28:case"end":return t.stop()}}),t,null,[[3,13]])}))),this.onResize=or((function(){e.scene.getElementsIncludingDeleted().forEach((function(e){return Gr(e)})),e.setState({})})),this.onScroll=Un((function(){var t=e.getCanvasOffsets(),n=t.offsetTop,r=t.offsetLeft;e.setState((function(e){return e.offsetLeft===r&&e.offsetTop===n?null:{offsetTop:n,offsetLeft:r}}))}),d.HM),this.onCut=or((function(t){var n;(null===(n=e.excalidrawContainerRef.current)||void 0===n?void 0:n.contains(document.activeElement))&&!Nn(t.target)&&(e.cutAll(),t.preventDefault())})),this.onCopy=or((function(t){var n;(null===(n=e.excalidrawContainerRef.current)||void 0===n?void 0:n.contains(document.activeElement))&&!Nn(t.target)&&(e.copyAll(),t.preventDefault())})),this.cutAll=function(){e.copyAll(),e.actionManager.executeAction(Js)},this.copyAll=function(){Hd(e.scene.getElements(),e.state,e.files)},this.onTapStart=function(t){if(!zh)return zh=!0,clearTimeout(Hh),void(Hh=window.setTimeout(Yh.resetTapTwice,d.Gj));if(zh&&1===t.touches.length){var n=g(t.touches,1)[0];e.handleCanvasDoubleClick({clientX:n.clientX,clientY:n.clientY}),zh=!1,clearTimeout(Hh)}t.preventDefault(),2===t.touches.length&&e.setState({selectedElementIds:{}})},this.onTapEnd=function(t){t.touches.length>0&&e.setState({previousSelectedElementIds:{},selectedElementIds:e.state.previousSelectedElementIds})},this.pasteFromClipboard=or(function(){var t=(0,f.Z)(b().mark((function t(n){var r,o,a,i,l,s,c,u,d,p,f;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=document.activeElement,null===(r=e.excalidrawContainerRef.current)||void 0===r?void 0:r.contains(a)){t.next=4;break}return t.abrupt("return");case 4:if(i=document.elementFromPoint(Bh,Nh),!n||i instanceof HTMLCanvasElement&&!Nn(a)){t.next=7;break}return t.abrupt("return");case 7:return l=null==n||null===(o=n.clipboardData)||void 0===o?void 0:o.files[0],t.next=10,Fd(n);case 10:if(s=t.sent,!l&&s.text&&(c=s.text.trim()).startsWith("<svg")&&c.endsWith("</svg>")&&(l=Yu(c)),!Ru(l)){t.next=19;break}return u=qn({clientX:Bh,clientY:Nh},e.state),d=u.x,p=u.y,f=e.createImageElement({sceneX:d,sceneY:p}),e.insertImageElement(f,l),e.initializeImageDimensions(f),e.setState({selectedElementIds:D({},f.id,!0)}),t.abrupt("return");case 19:if(!e.props.onPaste){t.next=31;break}return t.prev=20,t.next=23,e.props.onPaste(s,n);case 23:if(t.t0=t.sent,!1!==t.t0){t.next=26;break}return t.abrupt("return");case 26:t.next=31;break;case 28:t.prev=28,t.t1=t.catch(20),console.error(t.t1);case 31:s.errorMessage?e.setState({errorMessage:s.errorMessage}):s.spreadsheet?e.setState({pasteDialog:{data:s.spreadsheet,shown:!0}}):s.elements?e.addElementsFromPasteOrLibrary({elements:s.elements,files:s.files||null,position:"cursor"}):s.text&&e.addTextFromPaste(s.text),e.selectShapeTool("selection"),null==n||n.preventDefault();case 34:case"end":return t.stop()}}),t,null,[[20,28]])})));return function(e){return t.apply(this,arguments)}}()),this.addElementsFromPasteOrLibrary=function(t){var n=Au(t.elements,null),r=g(Ot(n),4),o=r[0],a=r[1],i=r[2],l=r[3],s=Gn(o,i)/2,c=Gn(a,l)/2,u="object"===L(t.position)?t.position.clientX:"cursor"===t.position?Bh:e.state.width/2+e.state.offsetLeft,d="object"===L(t.position)?t.position.clientY:"cursor"===t.position?Nh:e.state.height/2+e.state.offsetTop,p=qn({clientX:u,clientY:d},e.state),f=p.x-s,h=p.y-c,m=new Map,v=g(mt(f,h,e.state.gridSize),2),b=v[0],y=v[1],x=new Map,w=n.map((function(t){var n=Fo(e.state.editingGroupId,m,t,{x:t.x+b-o,y:t.y+y-a});return x.set(t.id,n.id),n})),k=[].concat(_(e.scene.getElementsIncludingDeleted()),_(w));Ai(k,n,x),t.files&&(e.files=Ph(Ph({},e.files),t.files)),e.scene.replaceAllElements(k),e.history.resumeRecording(),e.setState(Oo(Ph(Ph({},e.state),{},{isLibraryOpen:!1,selectedElementIds:w.reduce((function(e,t){return e[t.id]=!0,e}),{}),selectedGroupIds:{}}),e.scene.getElements()),(function(){t.files&&e.addNewImagesToImageCache()})),e.selectShapeTool("selection")},this.setAppState=function(t){e.setState(t)},this.removePointer=function(e){"touch"===e.pointerType&&Gh&&(clearTimeout(Gh),Gh=0,Wh=!1),Zh.pointers.delete(e.pointerId)},this.toggleLock=function(){e.setState((function(e){return{elementLocked:!e.elementLocked,elementType:e.elementLocked?"selection":e.elementType}}))},this.toggleZenMode=function(){e.actionManager.executeAction(nf)},this.toggleStats=function(){e.state.showStats||tu("dialog","stats"),e.actionManager.executeAction(af)},this.scrollToContent=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.scene.getElements();e.setState(Ph({},hl(Array.isArray(t)?t:[t],e.state,e.canvas)))},this.clearToast=function(){e.setState({toastMessage:null})},this.setToastMessage=function(t){e.setState({toastMessage:t})},this.restoreFileFromShare=(0,f.Z)(b().mark((function t(){var n,r,o;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,caches.open("web-share-target");case 3:return n=t.sent,t.next=6,n.match("shared-file");case 6:if(!(r=t.sent)){t.next=15;break}return t.next=10,r.blob();case 10:return o=t.sent,e.loadFileToCanvas(o),t.next=14,n.delete("shared-file");case 14:window.history.replaceState(null,d.iC,window.location.pathname);case 15:t.next=20;break;case 17:t.prev=17,t.t0=t.catch(0),e.setState({errorMessage:t.t0.message});case 20:case"end":return t.stop()}}),t,null,[[0,17]])}))),this.addFiles=or((function(t){var n=t.reduce((function(e,t){return e.set(t.id,t),e}),new Map);e.files=Ph(Ph({},e.files),Object.fromEntries(n)),e.scene.getElements().forEach((function(t){qe(t)&&n.has(t.fileId)&&(e.imageCache.delete(t.fileId),Gr(t),ho(t))})),e.scene.informMutation(),e.addNewImagesToImageCache()})),this.updateScene=or((function(t){t.commitToHistory&&e.history.resumeRecording(),t.appState&&e.setState(t.appState),t.elements&&e.scene.replaceAllElements(t.elements),t.collaborators&&e.setState({collaborators:t.collaborators})})),this.onSceneUpdated=function(){e.setState({})},this.updateCurrentCursorPosition=or((function(e){Bh=e.clientX,Nh=e.clientY})),this.onKeyDown=or((function(t){var n;if(("Proxy"in window&&(!t.shiftKey&&/^[A-Z]$/.test(t.key)||t.shiftKey&&/^[a-z]$/.test(t.key))&&(t=new Proxy(t,{get:function(e,n){var r=e[n];return"function"==typeof r?r.bind(e):"key"===n?t.shiftKey?e.key.toUpperCase():e.key.toLowerCase():r}})),!(Nn(t.target)&&t.key!==fn||An(t.key)&&(n=t.target,n instanceof HTMLElement&&"wysiwyg"===n.dataset.type||n instanceof HTMLBRElement||n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement)))&&(t.key===hn&&e.setState({showHelpDialog:!0}),!e.actionManager.handleKeyDown(t)&&!e.state.viewModeEnabled)){if(t[un]&&e.state.isBindingEnabled&&e.setState({isBindingEnabled:!1}),t.code===Kt&&e.setState({isLibraryOpen:!e.state.isLibraryOpen}),An(t.key)){var r=e.state.gridSize&&(t.shiftKey?d.$e:e.state.gridSize)||(t.shiftKey?d.Iw:d.$e),o=e.scene.getElements().filter((function(t){return e.state.selectedElementIds[t.id]})),a=0,i=0;t.key===on?a=-r:t.key===an?a=r:t.key===ln?i=-r:t.key===rn&&(i=r),o.forEach((function(e){po(e,{x:e.x+a,y:e.y+i}),ki(e,{simultaneouslyUpdated:o})})),e.maybeSuggestBindingForAll(o),t.preventDefault()}else if(t.key===pn){var l=dl(e.scene.getElements(),e.state);if(1===l.length&&tt(l[0]))e.state.editingLinearElement&&e.state.editingLinearElement.elementId===l[0].id||(e.history.resumeRecording(),e.setState({editingLinearElement:new li(l[0],e.scene)}));else if(1===l.length&&!tt(l[0])){var s=l[0];return e.startTextEditing({sceneX:s.x+s.width/2,sceneY:s.y+s.height/2}),void t.preventDefault()}}else if(!t.ctrlKey&&!t.altKey&&!t.metaKey&&null===e.state.draggingElement){var c=function(e){var t=yf.find((function(t,n){return e===(n+1).toString()||t.key&&("string"==typeof t.key?t.key===e:t.key.includes(e))}));return(null==t?void 0:t.value)||null}(t.key);c?e.selectShapeTool(c):t.key===En&&e.toggleLock()}if(t.key===mn&&0===Zh.pointers.size&&(Rh=!0,Kn(e.canvas,d.oc.GRABBING)),t.key===xn||t.key===jn){var u=dl(e.scene.getElements(),e.state);if("selection"===e.state.elementType&&!u.length)return;t.key===xn&&(ml(e.state.elementType)||u.some((function(e){return ml(e.type)})))&&e.setState({openPopup:"backgroundColorPicker"}),t.key===jn&&e.setState({openPopup:"strokeColorPicker"})}}})),this.onKeyUp=or((function(t){if(t.key===mn&&(e.state.viewModeEnabled?Kn(e.canvas,d.oc.GRAB):"selection"===e.state.elementType?Wn(e.canvas):(Zn(e.canvas,e.state.elementType),e.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})),Rh=!1),t[un]||e.state.isBindingEnabled||e.setState({isBindingEnabled:!0}),An(t.key)){var n=dl(e.scene.getElements(),e.state);ci(e.state)?pi(n):bi(n),e.setState({suggestedBindings:[]})}})),this.onGestureStart=or((function(t){t.preventDefault(),e.setState({selectedElementIds:{}}),Zh.initialScale=e.state.zoom.value})),this.onGestureChange=or((function(t){if(t.preventDefault(),2!==Zh.pointers.size){var n=Zh.initialScale;n&&e.setState((function(e){var r=e.zoom,o=e.offsetLeft,a=e.offsetTop;return{zoom:Sl(El(n*t.scale),r,{left:o,top:a},{x:Bh,y:Nh})}}))}})),this.onGestureEnd=or((function(t){t.preventDefault(),e.setState({previousSelectedElementIds:{},selectedElementIds:e.state.previousSelectedElementIds}),Zh.initialScale=null})),this.startTextEditing=function(t){var n=t.sceneX,r=t.sceneY,o=t.insertAtParentCenter,a=void 0===o||o,i=e.getTextElementAtPosition(n,r),l=a&&e.getTextWysiwygSnappedToCenterPosition(n,r,e.state,e.canvas,window.devicePixelRatio),s=i||Ho({x:l?l.elementCenterX:n,y:l?l.elementCenterY:r,strokeColor:e.state.currentItemStrokeColor,backgroundColor:e.state.currentItemBackgroundColor,fillStyle:e.state.currentItemFillStyle,strokeWidth:e.state.currentItemStrokeWidth,strokeStyle:e.state.currentItemStrokeStyle,roughness:e.state.currentItemRoughness,opacity:e.state.currentItemOpacity,strokeSharpness:e.state.currentItemStrokeSharpness,text:"",fontSize:e.state.currentItemFontSize,fontFamily:e.state.currentItemFontFamily,textAlign:l?"center":e.state.currentItemTextAlign,verticalAlign:l?"middle":d.hs});e.setState({editingElement:s}),i?l&&"center"===s.textAlign||po(s,{verticalAlign:d.hs}):(e.scene.replaceAllElements([].concat(_(e.scene.getElementsIncludingDeleted()),[s])),l||po(s,{y:s.y-s.baseline/2})),e.setState({editingElement:s}),e.handleTextWysiwyg(s,{isExistingElement:!!i})},this.handleCanvasDoubleClick=function(t){if(!e.state.multiElement&&"selection"===e.state.elementType){var n=dl(e.scene.getElements(),e.state);if(1===n.length&&tt(n[0]))e.state.editingLinearElement&&e.state.editingLinearElement.elementId===n[0].id||(e.history.resumeRecording(),e.setState({editingLinearElement:new li(n[0],e.scene)}));else{Wn(e.canvas);var r=qn(t,e.state),o=r.x,a=r.y;if(jo(e.state).length>0){var i=e.getElementAtPosition(o,a),l=i&&function(e,t){return e.groupIds.find((function(e){return t[e]}))}(i,e.state.selectedGroupIds);if(l)return void e.setState((function(t){return Oo(Ph(Ph({},t),{},{editingGroupId:l,selectedElementIds:D({},i.id,!0),selectedGroupIds:{}}),e.scene.getElements())}))}Wn(e.canvas),t[un]||e.state.viewModeEnabled||e.startTextEditing({sceneX:o,sceneY:a,insertAtParentCenter:!t.altKey})}}},this.handleCanvasPointerMove=function(t){e.savePointer(t.clientX,t.clientY,e.state.cursorButton),Zh.pointers.has(t.pointerId)&&Zh.pointers.set(t.pointerId,{x:t.clientX,y:t.clientY});var n=Zh.initialScale;if(2===Zh.pointers.size&&Zh.lastCenter&&n&&Zh.initialDistance){var r=pf(Zh.pointers),o=r.x-Zh.lastCenter.x,a=r.y-Zh.lastCenter.y;Zh.lastCenter=r;var i=ff(Array.from(Zh.pointers.values()))/Zh.initialDistance;e.setState((function(e){var t=e.zoom,l=e.scrollX,s=e.scrollY,c=e.offsetLeft,u=e.offsetTop;return{scrollX:l+o/t.value,scrollY:s+a/t.value,zoom:Sl(El(n*i),t,{left:c,top:u},r),shouldCacheIgnoreZoom:!0}})),e.resetShouldCacheIgnoreZoomDebounced()}else Zh.lastCenter=Zh.initialDistance=Zh.initialScale=null;if(!(Rh||Fh||Vh)){var l=cl(Uh,t.clientX-e.state.offsetLeft,t.clientY-e.state.offsetTop).isOverEither;e.state.draggingElement||e.state.multiElement||(l?Wn(e.canvas):Zn(e.canvas,e.state.elementType));var s=qn(t,e.state),c=s.x,u=s.y;if(e.state.editingLinearElement&&!e.state.editingLinearElement.isDragging){var p=li.handlePointerMove(t,c,u,e.state.editingLinearElement,e.state.gridSize);p!==e.state.editingLinearElement&&e.setState({editingLinearElement:p}),null!=p.lastUncommittedPoint?e.maybeSuggestBindingAtCursor(s):e.setState({suggestedBindings:[]})}if(ot(e.state.elementType)){var f=e.state.draggingElement;rt(f)?e.maybeSuggestBindingForLinearElementAtCursor(f,"end",s,e.state.startBoundElement):e.maybeSuggestBindingAtCursor(s)}if(e.state.multiElement){var h=e.state.multiElement,m=h.x,g=h.y,v=h.points,b=h.lastCommittedPoint,y=v[v.length-1];return Zn(e.canvas,e.state.elementType),void(y===b?ct(c-m,u-g,y[0],y[1])>=d.qx?po(h,{points:[].concat(_(v),[[c-m,u-g]])}):Kn(e.canvas,d.oc.POINTER):v.length>2&&b&&ct(c-m,u-g,b[0],b[1])<d.qx?(Kn(e.canvas,d.oc.POINTER),po(h,{points:v.slice(0,-1)})):(ut(v,e.state.zoom.value)&&Kn(e.canvas,d.oc.POINTER),po(h,{points:[].concat(_(v.slice(0,-1)),[[c-m,u-g]])})))}if(!(Boolean(t.buttons)||"selection"!==e.state.elementType&&"text"!==e.state.elementType)){var x=e.scene.getElements(),w=dl(x,e.state);if(1!==w.length||l||e.state.editingLinearElement){if(w.length>1&&!l){var k=ni(Ot(w),c,u,e.state.zoom,t.pointerType);if(k)return void Kn(e.canvas,oi({transformHandleType:k}))}}else{var S=ti(x,e.state,c,u,e.state.zoom,t.pointerType);if(S&&S.transformHandleType)return void Kn(e.canvas,oi(S))}var E=e.getElementAtPosition(s.x,s.y);"text"===e.state.elementType?Kn(e.canvas,Qe(E)?d.oc.TEXT:d.oc.CROSSHAIR):e.state.viewModeEnabled?Kn(e.canvas,d.oc.GRAB):l||t[un]||!E&&!e.isHittingCommonBoundingBoxOfSelectedElements(s,w)?Kn(e.canvas,d.oc.AUTO):Kn(e.canvas,d.oc.MOVE)}}},this.handleTouchMove=function(e){Wh=!0},this.handleCanvasPointerDown=function(t){var n=document.getSelection();if(null!=n&&n.anchorNode&&n.removeAllRanges(),e.maybeOpenContextMenuAfterPointerDownOnTouchDevices(t),e.maybeCleanupAfterMissingPointerUp(t),!Fh&&(e.setState({lastPointerDownWith:t.pointerType,cursorButton:"down"}),e.savePointer(t.clientX,t.clientY,"down"),!e.handleCanvasPanUsingWheelOrSpaceDrag(t)&&!(t.button!==d.Oh.MAIN&&t.button!==d.Oh.TOUCH||(e.updateGestureOnPointerDown(t),Zh.pointers.size>1)))){var r=e.initialPointerDownState(t);if(!e.handleDraggingScrollBar(t,r)&&(e.clearSelectionIfNotUsingSelection(),e.updateBindingEnabledOnPointerMove(t),!e.handleSelectionOnPointerDown(t,r)))if("text"!==e.state.elementType){if("arrow"===e.state.elementType||"line"===e.state.elementType)e.handleLinearElementOnPointerDown(t,e.state.elementType,r);else if("image"===e.state.elementType){if(Kn(e.canvas,d.oc.CROSSHAIR),!e.state.pendingImageElement)return;e.setState({draggingElement:e.state.pendingImageElement,editingElement:e.state.pendingImageElement,pendingImageElement:null,multiElement:null});var o=qn(t,e.state),a=o.x,i=o.y;po(e.state.pendingImageElement,{x:a,y:i})}else"freedraw"===e.state.elementType?e.handleFreeDrawElementOnPointerDown(t,e.state.elementType,r):e.createGenericElementOnPointerDown(e.state.elementType,r);var l=e.onPointerMoveFromPointerDownHandler(r),s=e.onPointerUpFromPointerDownHandler(r),c=e.onKeyDownFromPointerDownHandler(r),u=e.onKeyUpFromPointerDownHandler(r);Kh=s,e.state.viewModeEnabled||(window.addEventListener(d.Ks.POINTER_MOVE,l),window.addEventListener(d.Ks.POINTER_UP,s),window.addEventListener(d.Ks.KEYDOWN,c),window.addEventListener(d.Ks.KEYUP,u),r.eventListeners.onMove=l,r.eventListeners.onUp=s,r.eventListeners.onKeyUp=u,r.eventListeners.onKeyDown=c)}else e.handleTextOnPointerDown(t,r)}},this.maybeOpenContextMenuAfterPointerDownOnTouchDevices=function(t){"touch"===t.pointerType&&(Wh=!1,Gh?Wh=!0:Gh=window.setTimeout((function(){Gh=0,Wh||e.handleCanvasContextMenu(t)}),d.nM))},this.handleCanvasPanUsingWheelOrSpaceDrag=function(t){if(0!==Zh.pointers.size||!(t.button===d.Oh.WHEEL||t.button===d.Oh.MAIN&&Rh||e.state.viewModeEnabled))return!1;Fh=!0;var n=!1,r=/Linux/.test(window.navigator.platform);Kn(e.canvas,d.oc.GRABBING);var o=t.clientX,a=t.clientY,i=or((function(t){var i=o-t.clientX,l=a-t.clientY;if(o=t.clientX,a=t.clientY,r&&!n&&(Math.abs(i)>1||Math.abs(l)>1)){n=!0;var s=function e(t){document.body.removeEventListener(d.Ks.PASTE,e),t.stopPropagation()};document.body.addEventListener(d.Ks.PASTE,s),window.addEventListener(d.Ks.POINTER_UP,(function e(){setTimeout((function(){document.body.removeEventListener(d.Ks.PASTE,s),window.removeEventListener(d.Ks.POINTER_UP,e)}),100)}))}e.setState({scrollX:e.state.scrollX-i/e.state.zoom.value,scrollY:e.state.scrollY-l/e.state.zoom.value})})),l=or(Kh=function(){Kh=null,Fh=!1,Rh||(e.state.viewModeEnabled?Kn(e.canvas,d.oc.GRAB):Zn(e.canvas,e.state.elementType)),e.setState({cursorButton:"up"}),e.savePointer(t.clientX,t.clientY,"up"),window.removeEventListener(d.Ks.POINTER_MOVE,i),window.removeEventListener(d.Ks.POINTER_UP,l),window.removeEventListener(d.Ks.BLUR,l)});return window.addEventListener(d.Ks.BLUR,l),window.addEventListener(d.Ks.POINTER_MOVE,i,{passive:!0}),window.addEventListener(d.Ks.POINTER_UP,l),!0},this.clearSelectionIfNotUsingSelection=function(){"selection"!==e.state.elementType&&e.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})},this.handleSelectionOnPointerDown=function(t,n){if("selection"===e.state.elementType){var r=e.scene.getElements(),o=dl(r,e.state);if(1!==o.length||e.state.editingLinearElement)o.length>1&&(n.resize.handleType=ni(Ot(o),n.origin.x,n.origin.y,e.state.zoom,t.pointerType));else{var a=ti(r,e.state,n.origin.x,n.origin.y,e.state.zoom,t.pointerType);null!=a&&(e.setState({resizingElement:a.element}),n.resize.handleType=a.transformHandleType)}if(n.resize.handleType)Kn(e.canvas,oi({transformHandleType:n.resize.handleType})),n.resize.isResizing=!0,n.resize.offset=tr(function(e,t,n,r){var o=g(1===t.length?xt(t[0]):Ot(t),4),a=o[0],i=o[1],l=o[2],s=o[3],c=(a+l)/2,u=(i+s)/2,d=1===t.length?t[0].angle:0,p=g(it(n,r,c,u,-d),2);switch(n=p[0],r=p[1],e){case"n":return it(n-(a+l)/2,r-i,0,0,d);case"s":return it(n-(a+l)/2,r-s,0,0,d);case"w":return it(n-a,r-(i+s)/2,0,0,d);case"e":return it(n-l,r-(i+s)/2,0,0,d);case"nw":return it(n-a,r-i,0,0,d);case"ne":return it(n-l,r-i,0,0,d);case"sw":return it(n-a,r-s,0,0,d);case"se":return it(n-l,r-s,0,0,d);default:return[0,0]}}(n.resize.handleType,o,n.origin.x,n.origin.y)),1===o.length&&tt(o[0])&&2===o[0].points.length&&(n.resize.arrowDirection=(u=n.resize.handleType,d=o[0],p=g(d.points,2),f=g(p[1],2),h=f[0],m=f[1],"nw"===u&&(h<0||m<0)||"ne"===u&&h>=0||"sw"===u&&h<=0||"se"===u&&(h>0||m>0)?"end":"origin"));else{var i;if(e.state.editingLinearElement){var l=li.handlePointerDown(t,e.state,(function(t){return e.setState(t)}),e.history,n.origin);if(l.hitElement&&(n.hit.element=l.hitElement),l.didAddPoint)return!0}n.hit.element=null!==(i=n.hit.element)&&void 0!==i?i:e.getElementAtPosition(n.origin.x,n.origin.y),n.hit.allHitElements=e.getElementsAtPosition(n.origin.x,n.origin.y);var s=n.hit.element,c=n.hit.allHitElements.some((function(t){return e.isASelectedElement(t)}));if(null!==s&&c||t.shiftKey||n.hit.hasHitCommonBoundingBoxOfSelectedElements||e.clearSelection(s),null!=s){if(t[un])return e.state.selectedElementIds[s.id]||(n.hit.wasAddedToSelection=!0),e.setState((function(t){return Ph(Ph({},function(e,t){return ko(ko({},e),{},{editingGroupId:t.groupIds.length?t.groupIds[0]:null,selectedGroupIds:{},selectedElementIds:D({},t.id,!0)})}(t,s)),{},{previousSelectedElementIds:e.state.selectedElementIds})})),!1;e.state.selectedElementIds[s.id]||(e.state.editingGroupId&&!Mo(s,e.state.editingGroupId)&&e.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}),c||n.hit.hasHitCommonBoundingBoxOfSelectedElements||(e.setState((function(t){return Oo(Ph(Ph({},t),{},{selectedElementIds:Ph(Ph({},t.selectedElementIds),{},D({},s.id,!0))}),e.scene.getElements())})),n.hit.wasAddedToSelection=!0))}e.setState({previousSelectedElementIds:e.state.selectedElementIds})}}var u,d,p,f,h,m;return!1},this.handleTextOnPointerDown=function(t,n){var r;"text"!==(null===(r=e.state.editingElement)||void 0===r?void 0:r.type)&&(e.startTextEditing({sceneX:n.origin.x,sceneY:n.origin.y,insertAtParentCenter:!t.altKey}),Wn(e.canvas),e.state.elementLocked||e.setState({elementType:"selection"}))},this.handleFreeDrawElementOnPointerDown=function(t,n,r){var o,a=g(mt(r.origin.x,r.origin.y,null),2),i=a[0],l=a[1],s=(o={type:n,x:i,y:l,strokeColor:e.state.currentItemStrokeColor,backgroundColor:e.state.currentItemBackgroundColor,fillStyle:e.state.currentItemFillStyle,strokeWidth:e.state.currentItemStrokeWidth,strokeStyle:e.state.currentItemStrokeStyle,roughness:e.state.currentItemRoughness,opacity:e.state.currentItemOpacity,strokeSharpness:e.state.currentItemLinearStrokeSharpness,simulatePressure:.5===t.pressure},Lo(Lo({},_o(o.type,o)),{},{points:o.points||[],pressures:[],simulatePressure:o.simulatePressure,lastCommittedPoint:null}));e.setState((function(e){return{selectedElementIds:Ph(Ph({},e.selectedElementIds),{},D({},s.id,!1))}}));var c=s.simulatePressure?s.pressures:[].concat(_(s.pressures),[t.pressure]);po(s,{points:[[0,0]],pressures:c});var u=xi(r.origin,e.scene);e.scene.replaceAllElements([].concat(_(e.scene.getElementsIncludingDeleted()),[s])),e.setState({draggingElement:s,editingElement:s,startBoundElement:u,suggestedBindings:[]})},this.createImageElement=function(t){var n,r=t.sceneX,o=t.sceneY,a=g(mt(r,o,e.state.gridSize),2),i=a[0],l=a[1];return n={type:"image",x:i,y:l,strokeColor:e.state.currentItemStrokeColor,backgroundColor:e.state.currentItemBackgroundColor,fillStyle:e.state.currentItemFillStyle,strokeWidth:e.state.currentItemStrokeWidth,strokeStyle:e.state.currentItemStrokeStyle,roughness:e.state.currentItemRoughness,opacity:e.state.currentItemOpacity,strokeSharpness:e.state.currentItemLinearStrokeSharpness},Lo(Lo({},_o("image",n)),{},{strokeColor:"transparent",status:"pending",fileId:null,scale:[1,1]})},this.handleLinearElementOnPointerDown=function(t,n,r){if(e.state.multiElement){var o=e.state.multiElement;if("line"===o.type&&ut(o.points,e.state.zoom.value))return po(o,{lastCommittedPoint:o.points[o.points.length-1]}),void e.actionManager.executeAction(eu);var a=o.x,i=o.y,l=o.lastCommittedPoint;if(o.points.length>1&&l&&ct(r.origin.x-a,r.origin.y-i,l[0],l[1])<d.qx)return void e.actionManager.executeAction(eu);e.setState((function(e){return{selectedElementIds:Ph(Ph({},e.selectedElementIds),{},D({},o.id,!0))}})),po(o,{lastCommittedPoint:o.points[o.points.length-1]}),Kn(e.canvas,d.oc.POINTER)}else{var s=g(mt(r.origin.x,r.origin.y,e.state.gridSize),2),c=s[0],u=s[1],p=e.state,f=p.currentItemStartArrowhead,h=p.currentItemEndArrowhead,m=g("arrow"===n?[f,h]:[null,null],2),v=m[0],b=m[1],y=No({type:n,x:c,y:u,strokeColor:e.state.currentItemStrokeColor,backgroundColor:e.state.currentItemBackgroundColor,fillStyle:e.state.currentItemFillStyle,strokeWidth:e.state.currentItemStrokeWidth,strokeStyle:e.state.currentItemStrokeStyle,roughness:e.state.currentItemRoughness,opacity:e.state.currentItemOpacity,strokeSharpness:e.state.currentItemLinearStrokeSharpness,startArrowhead:v,endArrowhead:b});e.setState((function(e){return{selectedElementIds:Ph(Ph({},e.selectedElementIds),{},D({},y.id,!1))}})),po(y,{points:[].concat(_(y.points),[[0,0]])});var x=xi(r.origin,e.scene);e.scene.replaceAllElements([].concat(_(e.scene.getElementsIncludingDeleted()),[y])),e.setState({draggingElement:y,editingElement:y,startBoundElement:x,suggestedBindings:[]})}},this.createGenericElementOnPointerDown=function(t,n){var r=g(mt(n.origin.x,n.origin.y,e.state.gridSize),2),o=r[0],a=r[1],i=Do({type:t,x:o,y:a,strokeColor:e.state.currentItemStrokeColor,backgroundColor:e.state.currentItemBackgroundColor,fillStyle:e.state.currentItemFillStyle,strokeWidth:e.state.currentItemStrokeWidth,strokeStyle:e.state.currentItemStrokeStyle,roughness:e.state.currentItemRoughness,opacity:e.state.currentItemOpacity,strokeSharpness:e.state.currentItemStrokeSharpness});"selection"===i.type?e.setState({selectionElement:i,draggingElement:i}):(e.scene.replaceAllElements([].concat(_(e.scene.getElementsIncludingDeleted()),[i])),e.setState({multiElement:null,draggingElement:i,editingElement:i}))},this.initializeImage=function(){var t=(0,f.Z)(b().mark((function t(n){var r,o,a,i,l,s,c,u,p,h,m,g,v,y,x;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=n.imageFile,l=n.imageElement,s=n.showCursorImagePreview,c=void 0!==s&&s,Ru(i)){t.next=3;break}throw new Error(I("errors.unsupportedFileType"));case 3:if(u=i.type,Kn(e.canvas,"wait"),u!==d.LO.svg){t.next=23;break}return t.prev=6,t.t0=Yu,t.t1=ud,t.next=11,i.text();case 11:return t.t2=t.sent,t.next=14,(0,t.t1)(t.t2);case 14:t.t3=t.sent,t.t4=i.name,i=(0,t.t0)(t.t3,t.t4),t.next=23;break;case 19:throw t.prev=19,t.t5=t.catch(6),console.warn(t.t5),new Error(I("errors.svgImageInsertError"));case 23:return t.next=25,(null===(r=(o=e.props).generateIdForFile)||void 0===r?void 0:r.call(o,i))||Gu(i);case 25:if(p=t.sent){t.next=29;break}throw console.warn("Couldn't generate file id or the supplied `generateIdForFile` didn't resolve to one."),new Error(I("errors.imageInsertError"));case 29:if(null!=(h=e.files[p])&&h.dataURL){t.next=42;break}return t.prev=31,t.next=34,Zu(i,d.h6);case 34:i=t.sent,t.next=40;break;case 37:t.prev=37,t.t6=t.catch(31),console.error("error trying to resing image file on insertion",t.t6);case 40:if(!(i.size>d.$n)){t.next=42;break}throw new Error(I("errors.fileTooBig",{maxSize:"".concat(Math.trunc(d.$n/1024/1024),"MB")}));case 42:if(c&&(g=null===(m=e.files[p])||void 0===m?void 0:m.dataURL,v=g&&Ku(g),e.setImagePreviewCursor(v||i)),t.t7=null===(a=e.files[p])||void 0===a?void 0:a.dataURL,t.t7){t.next=48;break}return t.next=47,Wu(i);case 47:t.t7=t.sent;case 48:return y=t.t7,x=po(l,{fileId:p},!1),t.abrupt("return",new Promise(function(){var t=(0,f.Z)(b().mark((function t(n,r){var o,a,i;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,e.files=Ph(Ph({},e.files),{},D({},p,{mimeType:u,id:p,dataURL:y,created:Date.now()})),i=e.imageCache.get(p)){t.next=7;break}return e.addNewImagesToImageCache(),t.next=7,e.updateImageCache([x]);case 7:if(!((null==i?void 0:i.image)instanceof Promise)){t.next=10;break}return t.next=10,i.image;case 10:(null===(o=e.state.pendingImageElement)||void 0===o?void 0:o.id)!==x.id&&(null===(a=e.state.draggingElement)||void 0===a?void 0:a.id)!==x.id&&e.initializeImageDimensions(x,!0),n(x),t.next=18;break;case 14:t.prev=14,t.t0=t.catch(0),console.error(t.t0),r(new Error(I("errors.imageInsertError")));case 18:return t.prev=18,c||Wn(e.canvas),t.finish(18);case 21:case"end":return t.stop()}}),t,null,[[0,14,18,21]])})));return function(e,n){return t.apply(this,arguments)}}()));case 51:case"end":return t.stop()}}),t,null,[[6,19],[31,37]])})));return function(e){return t.apply(this,arguments)}}(),this.insertImageElement=function(){var t=(0,f.Z)(b().mark((function t(n,r,o){return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.scene.replaceAllElements([].concat(_(e.scene.getElementsIncludingDeleted()),[n])),t.prev=1,t.next=4,e.initializeImage({imageFile:r,imageElement:n,showCursorImagePreview:o});case 4:t.next=11;break;case 6:t.prev=6,t.t0=t.catch(1),po(n,{isDeleted:!0}),e.actionManager.executeAction(eu),e.setState({errorMessage:t.t0.message||I("errors.imageInsertError")});case 11:case"end":return t.stop()}}),t,null,[[1,6]])})));return function(e,n,r){return t.apply(this,arguments)}}(),this.setImagePreviewCursor=function(){var t=(0,f.Z)(b().mark((function t(n){var r,o,a,i,l,s,c;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=96,t.next=3,Zu(n,r);case 3:return o=t.sent,t.next=6,Wu(o);case 6:if(a=t.sent,n.type!==d.LO.svg){t.next=20;break}return t.next=10,ld(a);case 10:i=t.sent,l=Math.min(i.height,r),(s=l*(i.width/i.height))>r&&(l=(s=r)*(i.height/i.width)),(c=document.createElement("canvas")).height=l,c.width=s,c.getContext("2d").drawImage(i,0,0,s,l),a=c.toDataURL(d.LO.svg);case 20:e.state.pendingImageElement&&Kn(e.canvas,"url(".concat(a,") 4 4, auto"));case 21:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onImageAction=function(){var t=(0,f.Z)(b().mark((function t(){var n,r,o,a,i,l,s,c,u,d=arguments;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=d.length>0&&void 0!==d[0]?d[0]:{insertOnCanvasDirectly:!1},r=n.insertOnCanvasDirectly,t.prev=1,o=e.state.width/2+e.state.offsetLeft,a=e.state.height/2+e.state.offsetTop,i=qn({clientX:o,clientY:a},e.state),l=i.x,s=i.y,t.next=7,Su({description:"Image",extensions:["jpg","png","svg","gif"]});case 7:c=t.sent,u=e.createImageElement({sceneX:l,sceneY:s}),r?(e.insertImageElement(u,c),e.initializeImageDimensions(u),e.setState({selectedElementIds:D({},u.id,!0)},(function(){e.actionManager.executeAction(eu)}))):e.setState({pendingImageElement:u},(function(){e.insertImageElement(u,c,!0)})),t.next=16;break;case 12:t.prev=12,t.t0=t.catch(1),"AbortError"!==t.t0.name&&console.error(t.t0),e.setState({pendingImageElement:null,editingElement:null,elementType:"selection"},(function(){e.actionManager.executeAction(eu)}));case 16:case"end":return t.stop()}}),t,null,[[1,12]])})));return function(){return t.apply(this,arguments)}}(),this.initializeImageDimensions=function(t){var n,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=qe(t)&&(null===(n=e.imageCache.get(t.fileId))||void 0===n?void 0:n.image);if(!o||o instanceof Promise){if(t.width<d.f/e.state.zoom.value&&t.height<d.f/e.state.zoom.value){var a=100/e.state.zoom.value;po(t,{x:t.x-a/2,y:t.y-a/2,width:a,height:a})}}else if(r||t.width<d.f/e.state.zoom.value&&t.height<d.f/e.state.zoom.value){var i=Math.max(e.state.height-120,160),l=Math.min(i,Math.floor(.5*e.state.height)/e.state.zoom.value),s=Math.min(o.naturalHeight,l),c=s*(o.naturalWidth/o.naturalHeight),u=t.x+t.width/2-c/2,p=t.y+t.height/2-s/2;po(t,{x:u,y:p,width:c,height:s})}},this.updateImageCache=function(){var t=(0,f.Z)(b().mark((function t(n){var r,o,a,i,l,s,c,u=arguments;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=u.length>1&&void 0!==u[1]?u[1]:e.files,t.next=3,sd({imageCache:e.imageCache,fileIds:n.map((function(e){return e.fileId})),files:r});case 3:if(o=t.sent,a=o.updatedFiles,i=o.erroredFiles,a.size||i.size){l=Oh(n);try{for(l.s();!(s=l.n()).done;)c=s.value,a.has(c.fileId)&&Gr(c),i.has(c.fileId)&&po(c,{status:"error"},!1)}catch(e){l.e(e)}finally{l.f()}}return t.abrupt("return",{updatedFiles:a,erroredFiles:i});case 8:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.addNewImagesToImageCache=function(){var t=(0,f.Z)(b().mark((function t(){var n,r,o,a,i=arguments;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=i.length>0&&void 0!==i[0]?i[0]:cd(e.scene.getElements()),r=i.length>1&&void 0!==i[1]?i[1]:e.files,!(o=n.filter((function(t){return!t.isDeleted&&!e.imageCache.has(t.fileId)}))).length){t.next=9;break}return t.next=6,e.updateImageCache(o,r);case 6:a=t.sent,a.updatedFiles.size&&e.scene.informMutation();case 9:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),this.scheduleImageRefresh=jh()((function(){e.addNewImagesToImageCache()}),d.LL),this.updateBindingEnabledOnPointerMove=function(t){var n=function(e){return!e[un]}(t);e.state.isBindingEnabled!==n&&e.setState({isBindingEnabled:n})},this.maybeSuggestBindingAtCursor=function(t){var n=xi(t,e.scene);e.setState({suggestedBindings:null!=n?[n]:[]})},this.maybeSuggestBindingForLinearElementAtCursor=function(t,n,r,o){var a=xi(r,e.scene);e.setState({suggestedBindings:null==a||vi(t,null==o?void 0:o.id,a)?[]:[a]})},this.handleCanvasRef=function(t){var n,r,o;null!==t?(e.canvas=t,e.rc=Ke.canvas(e.canvas),e.canvas.addEventListener(d.Ks.WHEEL,e.handleWheel,{passive:!1}),e.canvas.addEventListener(d.Ks.TOUCH_START,e.onTapStart),e.canvas.addEventListener(d.Ks.TOUCH_END,e.onTapEnd)):(null===(n=e.canvas)||void 0===n||n.removeEventListener(d.Ks.WHEEL,e.handleWheel),null===(r=e.canvas)||void 0===r||r.removeEventListener(d.Ks.TOUCH_START,e.onTapStart),null===(o=e.canvas)||void 0===o||o.removeEventListener(d.Ks.TOUCH_END,e.onTapEnd))},this.handleAppOnDrop=function(){var t=(0,f.Z)(b().mark((function t(n){var r,o,a,i,l,s,c,u,p,f,h,m;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,a=n.dataTransfer.files[0],!Ru(a)){t.next=33;break}if((null==a?void 0:a.type)!==d.LO.png&&(null==a?void 0:a.type)!==d.LO.svg){t.next=27;break}if(t.prev=4,!xu){t.next=16;break}return t.prev=6,i=n.dataTransfer.items[0],t.next=10,i.getAsFileSystemHandle();case 10:a.handle=t.sent,t.next=16;break;case 13:t.prev=13,t.t0=t.catch(6),console.warn(t.t0.name,t.t0.message);case 16:return t.next=18,Fu(a,e.state,e.scene.getElementsIncludingDeleted());case 18:return l=t.sent,e.syncActionResult(Ph(Ph({},l),{},{appState:Ph(Ph({},l.appState||e.state),{},{isLoading:!1}),replaceFiles:!0,commitToHistory:!0})),t.abrupt("return");case 23:if(t.prev=23,t.t1=t.catch(4),"EncodingError"===t.t1.name){t.next=27;break}throw t.t1;case 27:return s=qn(n,e.state),c=s.x,u=s.y,p=e.createImageElement({sceneX:c,sceneY:u}),e.insertImageElement(p,a),e.initializeImageDimensions(p),e.setState({selectedElementIds:D({},p.id,!0)}),t.abrupt("return");case 33:t.next=38;break;case 35:return t.prev=35,t.t2=t.catch(0),t.abrupt("return",e.setState({isLoading:!1,errorMessage:t.t2.message}));case 38:if(""===(f=n.dataTransfer.getData(d.LO.excalidrawlib))){t.next=42;break}return e.addElementsFromPasteOrLibrary({elements:JSON.parse(f),position:n,files:null}),t.abrupt("return");case 42:if(!((null==(h=null===(r=n.dataTransfer)||void 0===r?void 0:r.files[0])?void 0:h.type)===d.LO.excalidrawlib||null!=h&&null!==(o=h.name)&&void 0!==o&&o.endsWith(".excalidrawlib"))){t.next=47;break}e.library.importLibrary(h).then((function(){e.setState({isLibraryOpen:!1}),e.setState({isLibraryOpen:!0})})).catch((function(t){return e.setState({isLoading:!1,errorMessage:t.message})})),t.next=61;break;case 47:if(e.setState({isLoading:!0}),!xu){t.next=59;break}return t.prev=49,m=n.dataTransfer.items[0],t.next=53,m.getAsFileSystemHandle();case 53:h.handle=t.sent,t.next=59;break;case 56:t.prev=56,t.t3=t.catch(49),console.warn(t.t3.name,t.t3.message);case 59:return t.next=61,e.loadFileToCanvas(h);case 61:case"end":return t.stop()}}),t,null,[[0,35],[4,23],[6,13],[49,56]])})));return function(e){return t.apply(this,arguments)}}(),this.loadFileToCanvas=function(t){Fu(t,e.state,e.scene.getElementsIncludingDeleted()).then((function(t){e.syncActionResult(Ph(Ph({},t),{},{appState:Ph(Ph({},t.appState||e.state),{},{isLoading:!1}),replaceFiles:!0,commitToHistory:!0}))})).catch((function(t){e.setState({isLoading:!1,errorMessage:t.message})}))},this.handleCanvasContextMenu=function(t){t.preventDefault();var n=qn(t,e.state),r=n.x,o=n.y,a=e.getElementAtPosition(r,o,{preferSelected:!0}),i=a?"element":"canvas",l=e.excalidrawContainerRef.current.getBoundingClientRect(),s=l.top,c=l.left,u=t.clientX-c,d=t.clientY-s;a&&!e.state.selectedElementIds[a.id]?e.setState({selectedElementIds:D({},a.id,!0)},(function(){e._openContextMenu({top:d,left:u},i)})):e._openContextMenu({top:d,left:u},i)},this.maybeDragNewGenericElement=function(t,n){var r=e.state.draggingElement,o=t.lastCoords;if(r)if("selection"===r.type)Zi(r,e.state.elementType,t.origin.x,t.origin.y,o.x,o.y,Gn(t.origin.x,o.x),Gn(t.origin.y,o.y),_n(n),Ln(n));else{var a,i=g(mt(o.x,o.y,e.state.gridSize),2),l=i[0],s=i[1],c=qe(r)&&(null===(a=e.imageCache.get(r.fileId))||void 0===a?void 0:a.image),u=!c||c instanceof Promise?null:c.width/c.height;Zi(r,e.state.elementType,t.originInGrid.x,t.originInGrid.y,l,s,Gn(t.originInGrid.x,l),Gn(t.originInGrid.y,s),$e(r)?!_n(n):_n(n),Ln(n),u),e.maybeSuggestBindingForAll([r])}},this.maybeHandleResize=function(t,n){var r=dl(e.scene.getElements(),e.state),o=t.resize.handleType;e.setState({isResizing:o&&"rotation"!==o,isRotating:"rotation"===o});var a=t.lastCoords,i=g(mt(a.x-t.resize.offset.x,a.y-t.resize.offset.y,e.state.gridSize),2),l=i[0],s=i[1];return!!function(e,t,n,r,o,a,i,l,s,c,u){if(1===n.length){var d=g(n,1)[0];return"rotation"===t?(Ni(d,l,s,o),ki(d)):!tt(d)||2!==d.points.length||"nw"!==t&&"ne"!==t&&"sw"!==t&&"se"!==t?!Qe(d)||"nw"!==t&&"ne"!==t&&"sw"!==t&&"se"!==t?t&&Gi(e.originalElements.get(d.id),i,d,t,a,l,s):(Ui(d,t,a,l,s),ki(d)):Ri(d,r,o,l,s),!0}if(n.length>1){if("rotation"===t)return Ki(e,n,l,s,o,c,u),!0;if("nw"===t||"ne"===t||"sw"===t||"se"===t)return Wi(n,t,l,s),!0}return!1}(t,o,r,t.resize.arrowDirection,Dn(n),Ln(n),1===r.length&&$e(r[0])?!_n(n):_n(n),l,s,t.resize.center.x,t.resize.center.y)&&(e.maybeSuggestBindingForAll(r),!0)},this._openContextMenu=function(t,n){var r=t.left,o=t.top,a=xp.contextItemPredicate(e.actionManager.getElementsIncludingDeleted(),e.actionManager.getAppState()),i=wp.contextItemPredicate(e.actionManager.getElementsIncludingDeleted(),e.actionManager.getAppState()),l=Np.contextItemPredicate(e.actionManager.getElementsIncludingDeleted(),e.actionManager.getAppState()),s=Rp.contextItemPredicate(e.actionManager.getElementsIncludingDeleted(),e.actionManager.getAppState()),c="separator",u=e.scene.getElements(),d=[];if(zd&&u.length>0&&d.push(qp),Dd&&u.length>0&&d.push(Xp),"canvas"===n){var p=[].concat(d,[void 0===e.props.gridModeEnabled&&Jp,void 0===e.props.zenModeEnabled&&nf,void 0===e.props.viewModeEnabled&&Eh,af]);e.state.viewModeEnabled?Sf({options:p,top:o,left:r,actionManager:e.actionManager,appState:e.state,container:e.excalidrawContainerRef.current}):Sf({options:[e.isMobile&&navigator.clipboard&&{name:"paste",perform:function(t,n){return e.pasteFromClipboard(null),{commitToHistory:!1}},contextItemLabel:"labels.paste"},e.isMobile&&navigator.clipboard&&c,zd&&u.length>0&&qp,Dd&&u.length>0&&Xp,(zd&&u.length>0||Dd&&u.length>0)&&c,mc,c,void 0===e.props.gridModeEnabled&&Jp,void 0===e.props.zenModeEnabled&&nf,void 0===e.props.viewModeEnabled&&Eh,af],top:o,left:r,actionManager:e.actionManager,appState:e.state,container:e.excalidrawContainerRef.current})}else"element"===n&&(e.state.viewModeEnabled?Sf({options:[navigator.clipboard&&Zp].concat(d),top:o,left:r,actionManager:e.actionManager,appState:e.state,container:e.excalidrawContainerRef.current}):Sf({options:[e.isMobile&&Yp,e.isMobile&&navigator.clipboard&&Zp,e.isMobile&&navigator.clipboard&&{name:"paste",perform:function(t,n){return e.pasteFromClipboard(null),{commitToHistory:!1}},contextItemLabel:"labels.paste"},e.isMobile&&c].concat(d,[c,up,dp,c,a&&xp,i&&wp,(a||i)&&c,Cp,c,cc,uc,dc,pc,c,l&&Np,s&&Rp,(l||s)&&c,bc,Js]),top:o,left:r,actionManager:e.actionManager,appState:e.state,container:e.excalidrawContainerRef.current}))},this.handleWheel=or((function(t){if(t.preventDefault(),!Fh){var n=t.deltaX,r=t.deltaY,o=e.state,a=o.selectedElementIds,i=o.previousSelectedElementIds;if(t.metaKey||t.ctrlKey){var l=Math.sign(r),s=Math.abs(r);s>10&&(s=10),s*=l,0!==Object.keys(i).length&&setTimeout((function(){e.setState({selectedElementIds:i,previousSelectedElementIds:{}})}),1e3);var c=e.state.zoom.value-s/100;return c+=Math.log10(Math.max(1,e.state.zoom.value))*-l,c=Math.round(c*d.V4*100)/(100*d.V4),e.setState((function(e){var t=e.zoom,n=e.offsetLeft,r=e.offsetTop;return{zoom:Sl(El(c),t,{left:n,top:r},{x:Bh,y:Nh}),selectedElementIds:{},previousSelectedElementIds:0!==Object.keys(a).length?a:i,shouldCacheIgnoreZoom:!0}})),void e.resetShouldCacheIgnoreZoomDebounced()}t.shiftKey?e.setState((function(e){var t=e.zoom;return{scrollX:e.scrollX-(r||n)/t.value}})):e.setState((function(e){var t=e.zoom,o=e.scrollX,a=e.scrollY;return{scrollX:o-n/t.value,scrollY:a-r/t.value}}))}})),this.savePointer=function(t,n,r){var o,a;if(t&&n){var i=qn({clientX:t,clientY:n},e.state);isNaN(i.x)||isNaN(i.y),null===(o=(a=e.props).onPointerUpdate)||void 0===o||o.call(a,{pointer:i,button:r,pointersMap:Zh.pointers})}},this.resetShouldCacheIgnoreZoomDebounced=Un((function(){e.unmounted||e.setState({shouldCacheIgnoreZoom:!1})}),300),this.updateDOMRect=function(t){var n;if(null!==(n=e.excalidrawContainerRef)&&void 0!==n&&n.current){var r=e.excalidrawContainerRef.current.getBoundingClientRect(),o=r.width,a=r.height,i=r.left,l=r.top,s=e.state,c=s.width,u=s.height,d=s.offsetTop,p=s.offsetLeft;if(o===c&&a===u&&i===p&&l===d)return void(t&&t());e.setState({width:o,height:a,offsetLeft:i,offsetTop:l},(function(){t&&t()}))}},this.refresh=function(){e.setState(Ph({},e.getCanvasOffsets()))}};"production"!==d.Vi.TEST&&"production"!==d.Vi.DEVELOPMENT||(window.h=window.h||{},Object.defineProperties(window.h,{elements:{configurable:!0,get:function(){return this.app.scene.getElementsIncludingDeleted()},set:function(e){return this.app.scene.replaceAllElements(e)}}}));var qh=Yh;n(4285),n(3313);function $h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$h(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Jh=function(e){var t=e.elements,n=e.appState,r=e.files,o=e.getDimensions,a=void 0===o?function(e,t){return{width:e,height:t,scale:1}}:o,i=_u({elements:t,appState:n},null,null),l=i.elements,s=i.appState,c=s.exportBackground,u=s.viewBackgroundColor;return pd(nl(l),Qh(Qh({},s),{},{offsetTop:0,offsetLeft:0,width:0,height:0}),r||{},{exportBackground:c,viewBackgroundColor:u},(function(e,t){var n=document.createElement("canvas"),r=a(e,t);return n.width=r.width,n.height=r.height,{canvas:n,scale:r.scale}}))},em=function(){var e=(0,f.Z)(b().mark((function e(t){var n,r,o,a;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Jh(t);case 2:return n=e.sent,r=t.mimeType,o=void 0===r?d.LO.png:r,a=t.quality,o===d.LO.png&&"number"==typeof a&&console.warn('"quality" will be ignored for "'.concat(d.LO.png,'" mimeType')),"image/jpg"===o&&(o=d.LO.jpg),a=a||(/image\/jpe?g/.test(o)?.92:.8),e.abrupt("return",new Promise((function(e){n.toBlob((function(t){e(t)}),o,a)})));case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),tm=function(){var e=(0,f.Z)(b().mark((function e(t){var n,r,o,a,i,l,s,c,u;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.elements,r=t.appState,o=void 0===r?sr():r,a=t.files,i=void 0===a?{}:a,l=t.exportPadding,s=_u({elements:n,appState:o},null,null),c=s.elements,u=s.appState,e.abrupt("return",fd(nl(c),Qh(Qh({},u),{},{exportPadding:l}),i));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),nm=function(){var e=(0,f.Z)(b().mark((function e(t){var n;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,em(t);case 2:if(n=e.sent){e.next=5;break}throw new Error("couldn't export to blob");case 5:return e.next=7,navigator.clipboard.write([new window.ClipboardItem({"image/png":n})]);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),rm=["initialData","UIOptions"],om=["initialData","UIOptions"];function am(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function im(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?am(Object(n),!0).forEach((function(t){s()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):am(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var lm=function(e){var t,n,r=e.onHomeButtonClick,o=e.onChange,a=e.initialData,l=e.excalidrawRef,s=e.onCollabButtonClick,u=e.isCollaborating,p=e.onPointerUpdate,f=e.renderTopRightUI,h=e.renderFooter,m=e.langCode,g=void 0===m?w.code:m,v=e.viewModeEnabled,b=e.zenModeEnabled,y=e.gridModeEnabled,x=e.libraryReturnUrl,k=e.theme,S=e.name,E=e.renderCustomStats,C=e.onPaste,j=e.detectScroll,O=void 0===j||j,M=e.handleKeyboardGlobally,I=void 0!==M&&M,T=e.onLibraryChange,L=e.autoFocus,_=void 0!==L&&L,D=e.generateIdForFile,z=e.id,H=null===(t=e.UIOptions)||void 0===t?void 0:t.canvasActions,B={canvasActions:!!H&&im(im({},d.cW.canvasActions),H)};H&&"object"===i()(H.export)&&(H.export.saveFileToDisk=(null===(n=H.export)||void 0===n?void 0:n.saveFileToDisk)||d.cW.canvasActions.export.saveFileToDisk);return(0,c.useEffect)((function(){var e=function(e){"number"==typeof e.scale&&1!==e.scale&&e.preventDefault()};return document.addEventListener("touchmove",e,{passive:!1}),function(){document.removeEventListener("touchmove",e)}}),[]),(0,P.jsx)(A,{langCode:g,children:(0,P.jsx)(qh,{id:z,onHomeButtonClick:r,onChange:o,initialData:a,excalidrawRef:l,onCollabButtonClick:s,isCollaborating:u,onPointerUpdate:p,renderTopRightUI:f,renderFooter:h,langCode:g,viewModeEnabled:v,zenModeEnabled:b,gridModeEnabled:y,libraryReturnUrl:x,theme:k,name:S,renderCustomStats:E,UIOptions:B,onPaste:C,detectScroll:O,handleKeyboardGlobally:I,onLibraryChange:T,autoFocus:_,generateIdForFile:D})})},sm=function(e,t){e.initialData;var n=e.UIOptions,r=void 0===n?{}:n,a=o()(e,rm),i=(t.initialData,t.UIOptions),l=void 0===i?{}:i,s=o()(t,om),c=Object.keys(r),u=Object.keys(l);if(c.length!==u.length)return!1;var d=c.every((function(e){"canvasActions"===e&&Object.keys(r.canvasActions).every((function(e){var t,n,o,a;return null!=r&&r.canvasActions&&null!=l&&l.canvasActions?"export"===e&&null!=r&&null!==(t=r.canvasActions)&&void 0!==t&&t.export&&null!=l&&null!==(n=l.canvasActions)&&void 0!==n&&n.export?"function"==typeof r.canvasActions.export||"function"==typeof l.canvasActions.export?r.canvasActions.export===l.canvasActions.export:r.canvasActions.export.saveFileToDisk===l.canvasActions.export.saveFileToDisk:(null==r||null===(o=r.canvasActions)||void 0===o?void 0:o[e])===(null==l||null===(a=l.canvasActions)||void 0===a?void 0:a[e]):(null==r?void 0:r.canvasActions)===(null==l?void 0:l.canvasActions)}));return!0})),p=Object.keys(e),f=Object.keys(t);return d&&p.length===f.length&&p.every((function(e){return a[e]===s[e]}))},cm=(0,c.forwardRef)((function(e,t){return(0,P.jsx)(lm,im(im({},e),{},{excalidrawRef:t}))})),um=u().memo(cm,sm),dm=(n(8336),um)},4698:function(t){"use strict";t.exports=e},6207:function(e){"use strict";e.exports=t},8950:function(e,t,n){"use strict";function r(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(o,a){var i=e.apply(t,n);function l(e){r(i,o,a,l,s,"next",e)}function s(e){r(i,o,a,l,s,"throw",e)}l(void 0)}))}}n.d(t,{Z:function(){return o}})},1463:function(e){"use strict";e.exports=JSON.parse('{"labels":{"paste":"Paste","pasteCharts":"Paste charts","selectAll":"Select all","multiSelect":"Add element to selection","moveCanvas":"Move canvas","cut":"Cut","copy":"Copy","copyAsPng":"Copy to clipboard as PNG","copyAsSvg":"Copy to clipboard as SVG","bringForward":"Bring forward","sendToBack":"Send to back","bringToFront":"Bring to front","sendBackward":"Send backward","delete":"Delete","copyStyles":"Copy styles","pasteStyles":"Paste styles","stroke":"Stroke","background":"Background","fill":"Fill","strokeWidth":"Stroke width","strokeShape":"Stroke shape","strokeShape_gel":"Gel pen","strokeShape_fountain":"Fountain pen","strokeShape_brush":"Brush pen","strokeStyle":"Stroke style","strokeStyle_solid":"Solid","strokeStyle_dashed":"Dashed","strokeStyle_dotted":"Dotted","sloppiness":"Sloppiness","opacity":"Opacity","textAlign":"Text align","edges":"Edges","sharp":"Sharp","round":"Round","arrowheads":"Arrowheads","arrowhead_none":"None","arrowhead_arrow":"Arrow","arrowhead_bar":"Bar","arrowhead_dot":"Dot","arrowhead_triangle":"Triangle","fontSize":"Font size","fontFamily":"Font family","onlySelected":"Only selected","withBackground":"Background","exportEmbedScene":"Embed scene","exportEmbedScene_details":"Scene data will be saved into the exported PNG/SVG file so that the scene can be restored from it.\\nWill increase exported file size.","addWatermark":"Add \\"Made with Excalidraw\\"","handDrawn":"Hand-drawn","normal":"Normal","code":"Code","small":"Small","medium":"Medium","large":"Large","veryLarge":"Very large","solid":"Solid","hachure":"Hachure","crossHatch":"Cross-hatch","thin":"Thin","bold":"Bold","left":"Left","center":"Center","right":"Right","extraBold":"Extra bold","architect":"Architect","artist":"Artist","cartoonist":"Cartoonist","fileTitle":"File name","colorPicker":"Color picker","canvasBackground":"Canvas background","drawingCanvas":"Drawing canvas","layers":"Layers","actions":"Actions","language":"Language","liveCollaboration":"Live collaboration","duplicateSelection":"Duplicate","untitled":"Untitled","name":"Name","yourName":"Your name","madeWithExcalidraw":"Made with Excalidraw","group":"Group selection","ungroup":"Ungroup selection","collaborators":"Collaborators","showGrid":"Show grid","addToLibrary":"Add to library","removeFromLibrary":"Remove from library","libraryLoadingMessage":"Loading library…","libraries":"Browse libraries","loadingScene":"Loading scene…","align":"Align","alignTop":"Align top","alignBottom":"Align bottom","alignLeft":"Align left","alignRight":"Align right","centerVertically":"Center vertically","centerHorizontally":"Center horizontally","distributeHorizontally":"Distribute horizontally","distributeVertically":"Distribute vertically","flipHorizontal":"Flip horizontal","flipVertical":"Flip vertical","viewMode":"View mode","toggleExportColorScheme":"Toggle export color scheme","share":"Share","showStroke":"Show stroke color picker","showBackground":"Show background color picker","toggleTheme":"Toggle theme"},"buttons":{"clearReset":"Reset the canvas","exportJSON":"Export to file","exportImage":"Save as image","export":"Export","exportToPng":"Export to PNG","exportToSvg":"Export to SVG","copyToClipboard":"Copy to clipboard","copyPngToClipboard":"Copy PNG to clipboard","scale":"Scale","save":"Save (to active file)","saveAs":"Save as","load":"Load","getShareableLink":"Get shareable link","close":"Close","selectLanguage":"Select language","scrollBackToContent":"Scroll back to content","zoomIn":"Zoom in","zoomOut":"Zoom out","resetZoom":"Reset zoom","menu":"Menu","done":"Done","edit":"Edit","undo":"Undo","redo":"Redo","resetLibrary":"Reset library","roomDialog":"Sharing","createNewRoom":"Create new room","fullScreen":"Full screen","darkMode":"Dark mode","lightMode":"Light mode","zenMode":"Zen mode","exitZenMode":"Exit zen mode","cancel":"Cancel","clear":"Clear"},"alerts":{"clearReset":"This will clear the whole canvas. Are you sure?","couldNotCreateShareableLink":"Couldn\'t create shareable link.","couldNotCreateShareableLinkTooBig":"Couldn\'t create shareable link: the scene is too big","couldNotLoadInvalidFile":"Couldn\'t load invalid file","importBackendFailed":"Importing from backend failed.","cannotExportEmptyCanvas":"Cannot export empty canvas.","couldNotCopyToClipboard":"Couldn\'t copy to clipboard. Try using Chrome browser.","decryptFailed":"Couldn\'t decrypt data.","uploadedSecurly":"The upload has been secured with end-to-end encryption, which means that Excalidraw server and third parties can\'t read the content.","loadSceneOverridePrompt":"Loading external drawing will replace your existing content. Do you wish to continue?","collabStopOverridePrompt":"Stopping the session will overwrite your previous, locally stored drawing. Are you sure?\\n\\n(If you want to keep your local drawing, simply close the browser tab instead.)","errorLoadingLibrary":"There was an error loading the third party library.","errorAddingToLibrary":"Couldn\'t add item to the library","errorRemovingFromLibrary":"Couldn\'t remove item from the library","confirmAddLibrary":"This will add {{numShapes}} shape(s) to your library. Are you sure?","imageDoesNotContainScene":"This image does not seem to contain any scene data. Have you enabled scene embedding during export?","cannotRestoreFromImage":"Scene couldn\'t be restored from this image file","invalidSceneUrl":"Couldn\'t import scene from the supplied URL. It\'s either malformed, or doesn\'t contain valid Excalidraw JSON data.","resetLibrary":"This will clear your library. Are you sure?","invalidEncryptionKey":"Encryption key must be of 22 characters. Live collaboration is disabled."},"errors":{"unsupportedFileType":"Unsupported file type.","imageInsertError":"Couldn\'t insert image. Try again later...","fileTooBig":"File is too big. Maximum allowed size is {{maxSize}}.","svgImageInsertError":"Couldn\'t insert SVG image. The SVG markup looks invalid.","invalidSVGString":"errors.invalidSVGString"},"toolBar":{"selection":"Selection","image":"Insert image","rectangle":"Rectangle","diamond":"Diamond","ellipse":"Ellipse","arrow":"Arrow","line":"Line","freedraw":"Draw","text":"Text","library":"Library","lock":"Keep selected tool active after drawing"},"headings":{"canvasActions":"Canvas actions","selectedShapeActions":"Selected shape actions","shapes":"Shapes"},"hints":{"linearElement":"Click to start multiple points, drag for single line","freeDraw":"Click and drag, release when you\'re finished","text":"Tip: you can also add text by double-clicking anywhere with the selection tool","text_selected":"Double-click or press ENTER to edit text","text_editing":"Press Escape or CtrlOrCmd+ENTER to finish editing","linearElementMulti":"Click on last point or press Escape or Enter to finish","lockAngle":"You can constrain angle by holding SHIFT","resize":"You can constrain proportions by holding SHIFT while resizing,\\nhold ALT to resize from the center","resizeImage":"You can resize freely by holding SHIFT,\\nhold ALT to resize from the center","rotate":"You can constrain angles by holding SHIFT while rotating","lineEditor_info":"Double-click or press Enter to edit points","lineEditor_pointSelected":"Press Delete to remove point, CtrlOrCmd+D to duplicate, or drag to move","lineEditor_nothingSelected":"Select a point to move or remove, or hold Alt and click to add new points","placeImage":"Click to place the image, or click and drag to set its size manually"},"canvasError":{"cannotShowPreview":"Cannot show preview","canvasTooBig":"The canvas may be too big.","canvasTooBigTip":"Tip: try moving the farthest elements a bit closer together."},"errorSplash":{"headingMain_pre":"Encountered an error. Try ","headingMain_button":"reloading the page.","clearCanvasMessage":"If reloading doesn\'t work, try ","clearCanvasMessage_button":"clearing the canvas.","clearCanvasCaveat":" This will result in loss of work ","trackedToSentry_pre":"The error with identifier ","trackedToSentry_post":" was tracked on our system.","openIssueMessage_pre":"We were very cautious not to include your scene information on the error. If your scene is not private, please consider following up on our ","openIssueMessage_button":"bug tracker.","openIssueMessage_post":" Please include information below by copying and pasting into the GitHub issue.","sceneContent":"Scene content:"},"roomDialog":{"desc_intro":"You can invite people to your current scene to collaborate with you.","desc_privacy":"Don\'t worry, the session uses end-to-end encryption, so whatever you draw will stay private. Not even our server will be able to see what you come up with.","button_startSession":"Start session","button_stopSession":"Stop session","desc_inProgressIntro":"Live-collaboration session is now in progress.","desc_shareLink":"Share this link with anyone you want to collaborate with:","desc_exitSession":"Stopping the session will disconnect you from the room, but you\'ll be able to continue working with the scene, locally. Note that this won\'t affect other people, and they\'ll still be able to collaborate on their version.","shareTitle":"Join a live collaboration session on Excalidraw"},"errorDialog":{"title":"Error"},"exportDialog":{"disk_title":"Save to disk","disk_details":"Export the scene data to a file from which you can import later.","disk_button":"Save to file","link_title":"Shareable link","link_details":"Export as a read-only link.","link_button":"Export to Link","excalidrawplus_description":"Save the scene to your Excalidraw+ workspace.","excalidrawplus_button":"Export","excalidrawplus_exportError":"Couldn\'t export to Excalidraw+ at this moment..."},"helpDialog":{"blog":"Read our blog","click":"click","curvedArrow":"Curved arrow","curvedLine":"Curved line","documentation":"Documentation","doubleClick":"double-click","drag":"drag","editor":"Editor","editSelectedShape":"Edit selected shape (text/arrow/line)","github":"Found an issue? Submit","howto":"Follow our guides","or":"or","preventBinding":"Prevent arrow binding","shapes":"Shapes","shortcuts":"Keyboard shortcuts","textFinish":"Finish editing (text editor)","textNewLine":"Add new line (text editor)","title":"Help","view":"View","zoomToFit":"Zoom to fit all elements","zoomToSelection":"Zoom to selection"},"clearCanvasDialog":{"title":"Clear Canvas"},"encrypted":{"tooltip":"Your drawings are end-to-end encrypted so Excalidraw\'s servers will never see them.","link":"Blog post on end-to-end encryption in Excalidraw"},"stats":{"angle":"Angle","element":"Element","elements":"Elements","height":"Height","scene":"Scene","selected":"Selected","storage":"Storage","title":"Stats for nerds","total":"Total","version":"Version","versionCopy":"Click to copy","versionNotAvailable":"Version not available","width":"Width"},"toast":{"copyStyles":"Copied styles.","copyToClipboard":"Copied to clipboard.","copyToClipboardAsPng":"Copied {{exportSelection}} to clipboard as PNG\\n({{exportColorScheme}})","fileSaved":"File saved.","fileSavedToFilename":"Saved to {filename}","canvas":"canvas","selection":"selection"},"colors":{"495057":"Gray 7","ffffff":"White","f8f9fa":"Gray 0","f1f3f5":"Gray 1","fff5f5":"Red 0","fff0f6":"Pink 0","f8f0fc":"Grape 0","f3f0ff":"Violet 0","edf2ff":"Indigo 0","e7f5ff":"Blue 0","e3fafc":"Cyan 0","e6fcf5":"Teal 0","ebfbee":"Green 0","f4fce3":"Lime 0","fff9db":"Yellow 0","fff4e6":"Orange 0","transparent":"Transparent","ced4da":"Gray 4","868e96":"Gray 6","fa5252":"Red 6","e64980":"Pink 6","be4bdb":"Grape 6","7950f2":"Violet 6","4c6ef5":"Indigo 6","228be6":"Blue 6","15aabf":"Cyan 6","12b886":"Teal 6","40c057":"Green 6","82c91e":"Lime 6","fab005":"Yellow 6","fd7e14":"Orange 6","000000":"Black","343a40":"Gray 8","c92a2a":"Red 9","a61e4d":"Pink 9","862e9c":"Grape 9","5f3dc4":"Violet 9","364fc7":"Indigo 9","1864ab":"Blue 9","0b7285":"Cyan 9","087f5b":"Teal 9","2b8a3e":"Green 9","5c940d":"Lime 9","e67700":"Yellow 9","d9480f":"Orange 9"}}')}},l={};function s(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={id:e,exports:{}};return i[e](n,n.exports,s),n.exports}return s.m=i,s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},r=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},s.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var o=Object.create(null);s.r(o);var a={};n=n||[null,r({}),r([]),r(r)];for(var i=2&t&&e;"object"==typeof i&&!~n.indexOf(i);i=r(i))Object.getOwnPropertyNames(i).forEach((function(t){a[t]=function(){return e[t]}}));return a.default=function(){return e},s.d(o,a),o},s.d=function(e,t){for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=function(e){return Promise.all(Object.keys(s.f).reduce((function(t,n){return s.f[n](e,t),t}),[]))},s.u=function(e){return"excalidraw-assets/"+{9:"image",736:"vendor"}[e]+"-"+{9:"46f5e8e621bfedbf6d91",736:"807e23d7531555236936"}[e]+".js"},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o={},a="Excalidraw:",s.l=function(e,t,n,r){if(o[e])o[e].push(t);else{var i,l;if(void 0!==n)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var d=c[u];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==a+n){i=d;break}}i||(l=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,s.nc&&i.setAttribute("nonce",s.nc),i.setAttribute("data-webpack",a+n),i.src=e),o[e]=[t];var p=function(t,n){i.onerror=i.onload=null,clearTimeout(f);var r=o[e];if(delete o[e],i.parentNode&&i.parentNode.removeChild(i),r&&r.forEach((function(e){return e(n)})),t)return t(n)},f=setTimeout(p.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=p.bind(null,i.onerror),i.onload=p.bind(null,i.onload),l&&document.head.appendChild(i)}},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.p="",function(){var e={388:0};s.f.j=function(t,n){var r=s.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise((function(n,o){r=e[t]=[n,o]}));n.push(r[2]=o);var a=s.p+s.u(t),i=new Error;s.l(a,(function(n){if(s.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),a=n&&n.target&&n.target.src;i.message="Loading chunk "+t+" failed.\n("+o+": "+a+")",i.name="ChunkLoadError",i.type=o,i.request=a,r[1](i)}}),"chunk-"+t,t)}};var t=function(t,n){var r,o,a=n[0],i=n[1],l=n[2],c=0;for(r in i)s.o(i,r)&&(s.m[r]=i[r]);if(l)l(s);for(t&&t(n);c<a.length;c++)o=a[c],s.o(e,o)&&e[o]&&e[o][0](),e[a[c]]=0},n=self.webpackChunkExcalidraw=self.webpackChunkExcalidraw||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}(),s(9065)}()}));
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.Excalidraw=t(require("react"),require("react-dom")):e.Excalidraw=t(e.React,e.ReactDOM)}(self,(function(e,t){return(()=>{var n,r,o,i,a={200:(e,t,n)=>{var r="Expected a function",o=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,l=/^0o[0-7]+$/i,s=parseInt,c="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,u="object"==typeof self&&self&&self.Object===Object&&self,d=c||u||Function("return this")(),p=Object.prototype.toString,f=Math.max,h=Math.min,g=function(){return d.Date.now()};function m(e,t,n){var o,i,a,l,s,c,u=0,d=!1,p=!1,m=!0;if("function"!=typeof e)throw new TypeError(r);function y(t){var n=o,r=i;return o=i=void 0,u=t,l=e.apply(r,n)}function x(e){return u=e,s=setTimeout(k,t),d?y(e):l}function w(e){var n=e-c;return void 0===c||n>=t||n<0||p&&e-u>=a}function k(){var e=g();if(w(e))return S(e);s=setTimeout(k,function(e){var n=t-(e-c);return p?h(n,a-(e-u)):n}(e))}function S(e){return s=void 0,m&&o?y(e):(o=i=void 0,l)}function E(){var e=g(),n=w(e);if(o=arguments,i=this,c=e,n){if(void 0===s)return x(c);if(p)return s=setTimeout(k,t),y(c)}return void 0===s&&(s=setTimeout(k,t)),l}return t=b(t)||0,v(n)&&(d=!!n.leading,a=(p="maxWait"in n)?f(b(n.maxWait)||0,t):a,m="trailing"in n?!!n.trailing:m),E.cancel=function(){void 0!==s&&clearTimeout(s),u=0,o=c=i=s=void 0},E.flush=function(){return void 0===s?l:S(g())},E}function v(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function b(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==p.call(e)}(e))return NaN;if(v(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=v(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var n=a.test(e);return n||l.test(e)?s(e.slice(2),n?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var o=!0,i=!0;if("function"!=typeof e)throw new TypeError(r);return v(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),m(e,t,{leading:o,maxWait:t,trailing:i})}},2891:function(e,t,n){var r;e=n.nmd(e),function(){var o,i="Expected a function",a="__lodash_hash_undefined__",l="__lodash_placeholder__",s=16,c=32,u=64,d=128,p=256,f=1/0,h=9007199254740991,g=NaN,m=4294967295,v=[["ary",d],["bind",1],["bindKey",2],["curry",8],["curryRight",s],["flip",512],["partial",c],["partialRight",u],["rearg",p]],b="[object Arguments]",y="[object Array]",x="[object Boolean]",w="[object Date]",k="[object Error]",S="[object Function]",E="[object GeneratorFunction]",j="[object Map]",_="[object Number]",C="[object Object]",O="[object Promise]",I="[object RegExp]",M="[object Set]",P="[object String]",T="[object Symbol]",L="[object WeakMap]",A="[object ArrayBuffer]",D="[object DataView]",z="[object Float32Array]",N="[object Float64Array]",H="[object Int8Array]",R="[object Int16Array]",B="[object Int32Array]",F="[object Uint8Array]",U="[object Uint8ClampedArray]",V="[object Uint16Array]",G="[object Uint32Array]",W=/\b__p \+= '';/g,K=/\b(__p \+=) '' \+/g,Z=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Y=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,X=RegExp(Y.source),$=RegExp(q.source),Q=/<%-([\s\S]+?)%>/g,J=/<%([\s\S]+?)%>/g,ee=/<%=([\s\S]+?)%>/g,te=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ne=/^\w*$/,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,oe=/[\\^$.*+?()[\]{}|]/g,ie=RegExp(oe.source),ae=/^\s+/,le=/\s/,se=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ce=/\{\n\/\* \[wrapped with (.+)\] \*/,ue=/,? & /,de=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,pe=/[()=,{}\[\]\/\s]/,fe=/\\(\\)?/g,he=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ge=/\w*$/,me=/^[-+]0x[0-9a-f]+$/i,ve=/^0b[01]+$/i,be=/^\[object .+?Constructor\]$/,ye=/^0o[0-7]+$/i,xe=/^(?:0|[1-9]\d*)$/,we=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ke=/($^)/,Se=/['\n\r\u2028\u2029\\]/g,Ee="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",je="\\u2700-\\u27bf",_e="a-z\\xdf-\\xf6\\xf8-\\xff",Ce="A-Z\\xc0-\\xd6\\xd8-\\xde",Oe="\\ufe0e\\ufe0f",Ie="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Me="['’]",Pe="[\\ud800-\\udfff]",Te="["+Ie+"]",Le="["+Ee+"]",Ae="\\d+",De="[\\u2700-\\u27bf]",ze="["+_e+"]",Ne="[^\\ud800-\\udfff"+Ie+Ae+je+_e+Ce+"]",He="\\ud83c[\\udffb-\\udfff]",Re="[^\\ud800-\\udfff]",Be="(?:\\ud83c[\\udde6-\\uddff]){2}",Fe="[\\ud800-\\udbff][\\udc00-\\udfff]",Ue="["+Ce+"]",Ve="(?:"+ze+"|"+Ne+")",Ge="(?:"+Ue+"|"+Ne+")",We="(?:['’](?:d|ll|m|re|s|t|ve))?",Ke="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ze="(?:"+Le+"|"+He+")"+"?",Ye="[\\ufe0e\\ufe0f]?",qe=Ye+Ze+("(?:\\u200d(?:"+[Re,Be,Fe].join("|")+")"+Ye+Ze+")*"),Xe="(?:"+[De,Be,Fe].join("|")+")"+qe,$e="(?:"+[Re+Le+"?",Le,Be,Fe,Pe].join("|")+")",Qe=RegExp(Me,"g"),Je=RegExp(Le,"g"),et=RegExp(He+"(?="+He+")|"+$e+qe,"g"),tt=RegExp([Ue+"?"+ze+"+"+We+"(?="+[Te,Ue,"$"].join("|")+")",Ge+"+"+Ke+"(?="+[Te,Ue+Ve,"$"].join("|")+")",Ue+"?"+Ve+"+"+We,Ue+"+"+Ke,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ae,Xe].join("|"),"g"),nt=RegExp("[\\u200d\\ud800-\\udfff"+Ee+Oe+"]"),rt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ot=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],it=-1,at={};at[z]=at[N]=at[H]=at[R]=at[B]=at[F]=at[U]=at[V]=at[G]=!0,at[b]=at[y]=at[A]=at[x]=at[D]=at[w]=at[k]=at[S]=at[j]=at[_]=at[C]=at[I]=at[M]=at[P]=at[L]=!1;var lt={};lt[b]=lt[y]=lt[A]=lt[D]=lt[x]=lt[w]=lt[z]=lt[N]=lt[H]=lt[R]=lt[B]=lt[j]=lt[_]=lt[C]=lt[I]=lt[M]=lt[P]=lt[T]=lt[F]=lt[U]=lt[V]=lt[G]=!0,lt[k]=lt[S]=lt[L]=!1;var st={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ct=parseFloat,ut=parseInt,dt="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,pt="object"==typeof self&&self&&self.Object===Object&&self,ft=dt||pt||Function("return this")(),ht=t&&!t.nodeType&&t,gt=ht&&e&&!e.nodeType&&e,mt=gt&>.exports===ht,vt=mt&&dt.process,bt=function(){try{var e=gt&>.require&>.require("util").types;return e||vt&&vt.binding&&vt.binding("util")}catch(e){}}(),yt=bt&&bt.isArrayBuffer,xt=bt&&bt.isDate,wt=bt&&bt.isMap,kt=bt&&bt.isRegExp,St=bt&&bt.isSet,Et=bt&&bt.isTypedArray;function jt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function _t(e,t,n,r){for(var o=-1,i=null==e?0:e.length;++o<i;){var a=e[o];t(r,a,n(a),e)}return r}function Ct(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function Ot(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function It(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function Mt(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}function Pt(e,t){return!!(null==e?0:e.length)&&Ft(e,t,0)>-1}function Tt(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}function Lt(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}function At(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function Dt(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function zt(e,t,n,r){var o=null==e?0:e.length;for(r&&o&&(n=e[--o]);o--;)n=t(n,e[o],o,e);return n}function Nt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Ht=Wt("length");function Rt(e,t,n){var r;return n(e,(function(e,n,o){if(t(e,n,o))return r=n,!1})),r}function Bt(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}function Ft(e,t,n){return t==t?function(e,t,n){var r=n-1,o=e.length;for(;++r<o;)if(e[r]===t)return r;return-1}(e,t,n):Bt(e,Vt,n)}function Ut(e,t,n,r){for(var o=n-1,i=e.length;++o<i;)if(r(e[o],t))return o;return-1}function Vt(e){return e!=e}function Gt(e,t){var n=null==e?0:e.length;return n?Yt(e,t)/n:g}function Wt(e){return function(t){return null==t?o:t[e]}}function Kt(e){return function(t){return null==e?o:e[t]}}function Zt(e,t,n,r,o){return o(e,(function(e,o,i){n=r?(r=!1,e):t(n,e,o,i)})),n}function Yt(e,t){for(var n,r=-1,i=e.length;++r<i;){var a=t(e[r]);a!==o&&(n=n===o?a:n+a)}return n}function qt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Xt(e){return e?e.slice(0,gn(e)+1).replace(ae,""):e}function $t(e){return function(t){return e(t)}}function Qt(e,t){return Lt(t,(function(t){return e[t]}))}function Jt(e,t){return e.has(t)}function en(e,t){for(var n=-1,r=e.length;++n<r&&Ft(t,e[n],0)>-1;);return n}function tn(e,t){for(var n=e.length;n--&&Ft(t,e[n],0)>-1;);return n}function nn(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var rn=Kt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),on=Kt({"&":"&","<":"<",">":">",'"':""","'":"'"});function an(e){return"\\"+st[e]}function ln(e){return nt.test(e)}function sn(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function cn(e,t){return function(n){return e(t(n))}}function un(e,t){for(var n=-1,r=e.length,o=0,i=[];++n<r;){var a=e[n];a!==t&&a!==l||(e[n]=l,i[o++]=n)}return i}function dn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}function pn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}function fn(e){return ln(e)?function(e){var t=et.lastIndex=0;for(;et.test(e);)++t;return t}(e):Ht(e)}function hn(e){return ln(e)?function(e){return e.match(et)||[]}(e):function(e){return e.split("")}(e)}function gn(e){for(var t=e.length;t--&&le.test(e.charAt(t)););return t}var mn=Kt({"&":"&","<":"<",">":">",""":'"',"'":"'"});var vn=function e(t){var n,r=(t=null==t?ft:vn.defaults(ft.Object(),t,vn.pick(ft,ot))).Array,le=t.Date,Ee=t.Error,je=t.Function,_e=t.Math,Ce=t.Object,Oe=t.RegExp,Ie=t.String,Me=t.TypeError,Pe=r.prototype,Te=je.prototype,Le=Ce.prototype,Ae=t["__core-js_shared__"],De=Te.toString,ze=Le.hasOwnProperty,Ne=0,He=(n=/[^.]+$/.exec(Ae&&Ae.keys&&Ae.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Re=Le.toString,Be=De.call(Ce),Fe=ft._,Ue=Oe("^"+De.call(ze).replace(oe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ve=mt?t.Buffer:o,Ge=t.Symbol,We=t.Uint8Array,Ke=Ve?Ve.allocUnsafe:o,Ze=cn(Ce.getPrototypeOf,Ce),Ye=Ce.create,qe=Le.propertyIsEnumerable,Xe=Pe.splice,$e=Ge?Ge.isConcatSpreadable:o,et=Ge?Ge.iterator:o,nt=Ge?Ge.toStringTag:o,st=function(){try{var e=hi(Ce,"defineProperty");return e({},"",{}),e}catch(e){}}(),dt=t.clearTimeout!==ft.clearTimeout&&t.clearTimeout,pt=le&&le.now!==ft.Date.now&&le.now,ht=t.setTimeout!==ft.setTimeout&&t.setTimeout,gt=_e.ceil,vt=_e.floor,bt=Ce.getOwnPropertySymbols,Ht=Ve?Ve.isBuffer:o,Kt=t.isFinite,bn=Pe.join,yn=cn(Ce.keys,Ce),xn=_e.max,wn=_e.min,kn=le.now,Sn=t.parseInt,En=_e.random,jn=Pe.reverse,_n=hi(t,"DataView"),Cn=hi(t,"Map"),On=hi(t,"Promise"),In=hi(t,"Set"),Mn=hi(t,"WeakMap"),Pn=hi(Ce,"create"),Tn=Mn&&new Mn,Ln={},An=Fi(_n),Dn=Fi(Cn),zn=Fi(On),Nn=Fi(In),Hn=Fi(Mn),Rn=Ge?Ge.prototype:o,Bn=Rn?Rn.valueOf:o,Fn=Rn?Rn.toString:o;function Un(e){if(ol(e)&&!Za(e)&&!(e instanceof Kn)){if(e instanceof Wn)return e;if(ze.call(e,"__wrapped__"))return Ui(e)}return new Wn(e)}var Vn=function(){function e(){}return function(t){if(!rl(t))return{};if(Ye)return Ye(t);e.prototype=t;var n=new e;return e.prototype=o,n}}();function Gn(){}function Wn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=o}function Kn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=m,this.__views__=[]}function Zn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Yn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function qn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Xn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new qn;++t<n;)this.add(e[t])}function $n(e){var t=this.__data__=new Yn(e);this.size=t.size}function Qn(e,t){var n=Za(e),r=!n&&Ka(e),o=!n&&!r&&$a(e),i=!n&&!r&&!o&&pl(e),a=n||r||o||i,l=a?qt(e.length,Ie):[],s=l.length;for(var c in e)!t&&!ze.call(e,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||wi(c,s))||l.push(c);return l}function Jn(e){var t=e.length;return t?e[Xr(0,t-1)]:o}function er(e,t){return Hi(To(e),cr(t,0,e.length))}function tr(e){return Hi(To(e))}function nr(e,t,n){(n!==o&&!Va(e[t],n)||n===o&&!(t in e))&&lr(e,t,n)}function rr(e,t,n){var r=e[t];ze.call(e,t)&&Va(r,n)&&(n!==o||t in e)||lr(e,t,n)}function or(e,t){for(var n=e.length;n--;)if(Va(e[n][0],t))return n;return-1}function ir(e,t,n,r){return hr(e,(function(e,o,i){t(r,e,n(e),i)})),r}function ar(e,t){return e&&Lo(t,Al(t),e)}function lr(e,t,n){"__proto__"==t&&st?st(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function sr(e,t){for(var n=-1,i=t.length,a=r(i),l=null==e;++n<i;)a[n]=l?o:Il(e,t[n]);return a}function cr(e,t,n){return e==e&&(n!==o&&(e=e<=n?e:n),t!==o&&(e=e>=t?e:t)),e}function ur(e,t,n,r,i,a){var l,s=1&t,c=2&t,u=4&t;if(n&&(l=i?n(e,r,i,a):n(e)),l!==o)return l;if(!rl(e))return e;var d=Za(e);if(d){if(l=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&ze.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!s)return To(e,l)}else{var p=vi(e),f=p==S||p==E;if($a(e))return _o(e,s);if(p==C||p==b||f&&!i){if(l=c||f?{}:yi(e),!s)return c?function(e,t){return Lo(e,mi(e),t)}(e,function(e,t){return e&&Lo(t,Dl(t),e)}(l,e)):function(e,t){return Lo(e,gi(e),t)}(e,ar(l,e))}else{if(!lt[p])return i?e:{};l=function(e,t,n){var r=e.constructor;switch(t){case A:return Co(e);case x:case w:return new r(+e);case D:return function(e,t){var n=t?Co(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case z:case N:case H:case R:case B:case F:case U:case V:case G:return Oo(e,n);case j:case M:return new r;case _:case P:return new r(e);case I:return function(e){var t=new e.constructor(e.source,ge.exec(e));return t.lastIndex=e.lastIndex,t}(e);case T:return o=e,Bn?Ce(Bn.call(o)):{}}var o}(e,p,s)}}a||(a=new $n);var h=a.get(e);if(h)return h;a.set(e,l),cl(e)?e.forEach((function(r){l.add(ur(r,t,n,r,e,a))})):il(e)&&e.forEach((function(r,o){l.set(o,ur(r,t,n,o,e,a))}));var g=d?o:(u?c?li:ai:c?Dl:Al)(e);return Ct(g||e,(function(r,o){g&&(r=e[o=r]),rr(l,o,ur(r,t,n,o,e,a))})),l}function dr(e,t,n){var r=n.length;if(null==e)return!r;for(e=Ce(e);r--;){var i=n[r],a=t[i],l=e[i];if(l===o&&!(i in e)||!a(l))return!1}return!0}function pr(e,t,n){if("function"!=typeof e)throw new Me(i);return Ai((function(){e.apply(o,n)}),t)}function fr(e,t,n,r){var o=-1,i=Pt,a=!0,l=e.length,s=[],c=t.length;if(!l)return s;n&&(t=Lt(t,$t(n))),r?(i=Tt,a=!1):t.length>=200&&(i=Jt,a=!1,t=new Xn(t));e:for(;++o<l;){var u=e[o],d=null==n?u:n(u);if(u=r||0!==u?u:0,a&&d==d){for(var p=c;p--;)if(t[p]===d)continue e;s.push(u)}else i(t,d,r)||s.push(u)}return s}Un.templateSettings={escape:Q,evaluate:J,interpolate:ee,variable:"",imports:{_:Un}},Un.prototype=Gn.prototype,Un.prototype.constructor=Un,Wn.prototype=Vn(Gn.prototype),Wn.prototype.constructor=Wn,Kn.prototype=Vn(Gn.prototype),Kn.prototype.constructor=Kn,Zn.prototype.clear=function(){this.__data__=Pn?Pn(null):{},this.size=0},Zn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Zn.prototype.get=function(e){var t=this.__data__;if(Pn){var n=t[e];return n===a?o:n}return ze.call(t,e)?t[e]:o},Zn.prototype.has=function(e){var t=this.__data__;return Pn?t[e]!==o:ze.call(t,e)},Zn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Pn&&t===o?a:t,this},Yn.prototype.clear=function(){this.__data__=[],this.size=0},Yn.prototype.delete=function(e){var t=this.__data__,n=or(t,e);return!(n<0)&&(n==t.length-1?t.pop():Xe.call(t,n,1),--this.size,!0)},Yn.prototype.get=function(e){var t=this.__data__,n=or(t,e);return n<0?o:t[n][1]},Yn.prototype.has=function(e){return or(this.__data__,e)>-1},Yn.prototype.set=function(e,t){var n=this.__data__,r=or(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},qn.prototype.clear=function(){this.size=0,this.__data__={hash:new Zn,map:new(Cn||Yn),string:new Zn}},qn.prototype.delete=function(e){var t=pi(this,e).delete(e);return this.size-=t?1:0,t},qn.prototype.get=function(e){return pi(this,e).get(e)},qn.prototype.has=function(e){return pi(this,e).has(e)},qn.prototype.set=function(e,t){var n=pi(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Xn.prototype.add=Xn.prototype.push=function(e){return this.__data__.set(e,a),this},Xn.prototype.has=function(e){return this.__data__.has(e)},$n.prototype.clear=function(){this.__data__=new Yn,this.size=0},$n.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},$n.prototype.get=function(e){return this.__data__.get(e)},$n.prototype.has=function(e){return this.__data__.has(e)},$n.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Yn){var r=n.__data__;if(!Cn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new qn(r)}return n.set(e,t),this.size=n.size,this};var hr=zo(kr),gr=zo(Sr,!0);function mr(e,t){var n=!0;return hr(e,(function(e,r,o){return n=!!t(e,r,o)})),n}function vr(e,t,n){for(var r=-1,i=e.length;++r<i;){var a=e[r],l=t(a);if(null!=l&&(s===o?l==l&&!dl(l):n(l,s)))var s=l,c=a}return c}function br(e,t){var n=[];return hr(e,(function(e,r,o){t(e,r,o)&&n.push(e)})),n}function yr(e,t,n,r,o){var i=-1,a=e.length;for(n||(n=xi),o||(o=[]);++i<a;){var l=e[i];t>0&&n(l)?t>1?yr(l,t-1,n,r,o):At(o,l):r||(o[o.length]=l)}return o}var xr=No(),wr=No(!0);function kr(e,t){return e&&xr(e,t,Al)}function Sr(e,t){return e&&wr(e,t,Al)}function Er(e,t){return Mt(t,(function(t){return el(e[t])}))}function jr(e,t){for(var n=0,r=(t=ko(t,e)).length;null!=e&&n<r;)e=e[Bi(t[n++])];return n&&n==r?e:o}function _r(e,t,n){var r=t(e);return Za(e)?r:At(r,n(e))}function Cr(e){return null==e?e===o?"[object Undefined]":"[object Null]":nt&&nt in Ce(e)?function(e){var t=ze.call(e,nt),n=e[nt];try{e[nt]=o;var r=!0}catch(e){}var i=Re.call(e);r&&(t?e[nt]=n:delete e[nt]);return i}(e):function(e){return Re.call(e)}(e)}function Or(e,t){return e>t}function Ir(e,t){return null!=e&&ze.call(e,t)}function Mr(e,t){return null!=e&&t in Ce(e)}function Pr(e,t,n){for(var i=n?Tt:Pt,a=e[0].length,l=e.length,s=l,c=r(l),u=1/0,d=[];s--;){var p=e[s];s&&t&&(p=Lt(p,$t(t))),u=wn(p.length,u),c[s]=!n&&(t||a>=120&&p.length>=120)?new Xn(s&&p):o}p=e[0];var f=-1,h=c[0];e:for(;++f<a&&d.length<u;){var g=p[f],m=t?t(g):g;if(g=n||0!==g?g:0,!(h?Jt(h,m):i(d,m,n))){for(s=l;--s;){var v=c[s];if(!(v?Jt(v,m):i(e[s],m,n)))continue e}h&&h.push(m),d.push(g)}}return d}function Tr(e,t,n){var r=null==(e=Mi(e,t=ko(t,e)))?e:e[Bi(Ji(t))];return null==r?o:jt(r,e,n)}function Lr(e){return ol(e)&&Cr(e)==b}function Ar(e,t,n,r,i){return e===t||(null==e||null==t||!ol(e)&&!ol(t)?e!=e&&t!=t:function(e,t,n,r,i,a){var l=Za(e),s=Za(t),c=l?y:vi(e),u=s?y:vi(t),d=(c=c==b?C:c)==C,p=(u=u==b?C:u)==C,f=c==u;if(f&&$a(e)){if(!$a(t))return!1;l=!0,d=!1}if(f&&!d)return a||(a=new $n),l||pl(e)?oi(e,t,n,r,i,a):function(e,t,n,r,o,i,a){switch(n){case D:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case A:return!(e.byteLength!=t.byteLength||!i(new We(e),new We(t)));case x:case w:case _:return Va(+e,+t);case k:return e.name==t.name&&e.message==t.message;case I:case P:return e==t+"";case j:var l=sn;case M:var s=1&r;if(l||(l=dn),e.size!=t.size&&!s)return!1;var c=a.get(e);if(c)return c==t;r|=2,a.set(e,t);var u=oi(l(e),l(t),r,o,i,a);return a.delete(e),u;case T:if(Bn)return Bn.call(e)==Bn.call(t)}return!1}(e,t,c,n,r,i,a);if(!(1&n)){var h=d&&ze.call(e,"__wrapped__"),g=p&&ze.call(t,"__wrapped__");if(h||g){var m=h?e.value():e,v=g?t.value():t;return a||(a=new $n),i(m,v,n,r,a)}}if(!f)return!1;return a||(a=new $n),function(e,t,n,r,i,a){var l=1&n,s=ai(e),c=s.length,u=ai(t).length;if(c!=u&&!l)return!1;var d=c;for(;d--;){var p=s[d];if(!(l?p in t:ze.call(t,p)))return!1}var f=a.get(e),h=a.get(t);if(f&&h)return f==t&&h==e;var g=!0;a.set(e,t),a.set(t,e);var m=l;for(;++d<c;){var v=e[p=s[d]],b=t[p];if(r)var y=l?r(b,v,p,t,e,a):r(v,b,p,e,t,a);if(!(y===o?v===b||i(v,b,n,r,a):y)){g=!1;break}m||(m="constructor"==p)}if(g&&!m){var x=e.constructor,w=t.constructor;x==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof x&&x instanceof x&&"function"==typeof w&&w instanceof w||(g=!1)}return a.delete(e),a.delete(t),g}(e,t,n,r,i,a)}(e,t,n,r,Ar,i))}function Dr(e,t,n,r){var i=n.length,a=i,l=!r;if(null==e)return!a;for(e=Ce(e);i--;){var s=n[i];if(l&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){var c=(s=n[i])[0],u=e[c],d=s[1];if(l&&s[2]){if(u===o&&!(c in e))return!1}else{var p=new $n;if(r)var f=r(u,d,c,e,t,p);if(!(f===o?Ar(d,u,3,r,p):f))return!1}}return!0}function zr(e){return!(!rl(e)||(t=e,He&&He in t))&&(el(e)?Ue:be).test(Fi(e));var t}function Nr(e){return"function"==typeof e?e:null==e?as:"object"==typeof e?Za(e)?Vr(e[0],e[1]):Ur(e):gs(e)}function Hr(e){if(!_i(e))return yn(e);var t=[];for(var n in Ce(e))ze.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Rr(e){if(!rl(e))return function(e){var t=[];if(null!=e)for(var n in Ce(e))t.push(n);return t}(e);var t=_i(e),n=[];for(var r in e)("constructor"!=r||!t&&ze.call(e,r))&&n.push(r);return n}function Br(e,t){return e<t}function Fr(e,t){var n=-1,o=qa(e)?r(e.length):[];return hr(e,(function(e,r,i){o[++n]=t(e,r,i)})),o}function Ur(e){var t=fi(e);return 1==t.length&&t[0][2]?Oi(t[0][0],t[0][1]):function(n){return n===e||Dr(n,e,t)}}function Vr(e,t){return Si(e)&&Ci(t)?Oi(Bi(e),t):function(n){var r=Il(n,e);return r===o&&r===t?Ml(n,e):Ar(t,r,3)}}function Gr(e,t,n,r,i){e!==t&&xr(t,(function(a,l){if(i||(i=new $n),rl(a))!function(e,t,n,r,i,a,l){var s=Ti(e,n),c=Ti(t,n),u=l.get(c);if(u)return void nr(e,n,u);var d=a?a(s,c,n+"",e,t,l):o,p=d===o;if(p){var f=Za(c),h=!f&&$a(c),g=!f&&!h&&pl(c);d=c,f||h||g?Za(s)?d=s:Xa(s)?d=To(s):h?(p=!1,d=_o(c,!0)):g?(p=!1,d=Oo(c,!0)):d=[]:ll(c)||Ka(c)?(d=s,Ka(s)?d=xl(s):rl(s)&&!el(s)||(d=yi(c))):p=!1}p&&(l.set(c,d),i(d,c,r,a,l),l.delete(c));nr(e,n,d)}(e,t,l,n,Gr,r,i);else{var s=r?r(Ti(e,l),a,l+"",e,t,i):o;s===o&&(s=a),nr(e,l,s)}}),Dl)}function Wr(e,t){var n=e.length;if(n)return wi(t+=t<0?n:0,n)?e[t]:o}function Kr(e,t,n){t=t.length?Lt(t,(function(e){return Za(e)?function(t){return jr(t,1===e.length?e[0]:e)}:e})):[as];var r=-1;t=Lt(t,$t(di()));var o=Fr(e,(function(e,n,o){var i=Lt(t,(function(t){return t(e)}));return{criteria:i,index:++r,value:e}}));return function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(o,(function(e,t){return function(e,t,n){var r=-1,o=e.criteria,i=t.criteria,a=o.length,l=n.length;for(;++r<a;){var s=Io(o[r],i[r]);if(s)return r>=l?s:s*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function Zr(e,t,n){for(var r=-1,o=t.length,i={};++r<o;){var a=t[r],l=jr(e,a);n(l,a)&&to(i,ko(a,e),l)}return i}function Yr(e,t,n,r){var o=r?Ut:Ft,i=-1,a=t.length,l=e;for(e===t&&(t=To(t)),n&&(l=Lt(e,$t(n)));++i<a;)for(var s=0,c=t[i],u=n?n(c):c;(s=o(l,u,s,r))>-1;)l!==e&&Xe.call(l,s,1),Xe.call(e,s,1);return e}function qr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(n==r||o!==i){var i=o;wi(o)?Xe.call(e,o,1):ho(e,o)}}return e}function Xr(e,t){return e+vt(En()*(t-e+1))}function $r(e,t){var n="";if(!e||t<1||t>h)return n;do{t%2&&(n+=e),(t=vt(t/2))&&(e+=e)}while(t);return n}function Qr(e,t){return Di(Ii(e,t,as),e+"")}function Jr(e){return Jn(Vl(e))}function eo(e,t){var n=Vl(e);return Hi(n,cr(t,0,n.length))}function to(e,t,n,r){if(!rl(e))return e;for(var i=-1,a=(t=ko(t,e)).length,l=a-1,s=e;null!=s&&++i<a;){var c=Bi(t[i]),u=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(i!=l){var d=s[c];(u=r?r(d,c,s):o)===o&&(u=rl(d)?d:wi(t[i+1])?[]:{})}rr(s,c,u),s=s[c]}return e}var no=Tn?function(e,t){return Tn.set(e,t),e}:as,ro=st?function(e,t){return st(e,"toString",{configurable:!0,enumerable:!1,value:rs(t),writable:!0})}:as;function oo(e){return Hi(Vl(e))}function io(e,t,n){var o=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=r(i);++o<i;)a[o]=e[o+t];return a}function ao(e,t){var n;return hr(e,(function(e,r,o){return!(n=t(e,r,o))})),!!n}function lo(e,t,n){var r=0,o=null==e?r:e.length;if("number"==typeof t&&t==t&&o<=2147483647){for(;r<o;){var i=r+o>>>1,a=e[i];null!==a&&!dl(a)&&(n?a<=t:a<t)?r=i+1:o=i}return o}return so(e,t,as,n)}function so(e,t,n,r){var i=0,a=null==e?0:e.length;if(0===a)return 0;for(var l=(t=n(t))!=t,s=null===t,c=dl(t),u=t===o;i<a;){var d=vt((i+a)/2),p=n(e[d]),f=p!==o,h=null===p,g=p==p,m=dl(p);if(l)var v=r||g;else v=u?g&&(r||f):s?g&&f&&(r||!h):c?g&&f&&!h&&(r||!m):!h&&!m&&(r?p<=t:p<t);v?i=d+1:a=d}return wn(a,4294967294)}function co(e,t){for(var n=-1,r=e.length,o=0,i=[];++n<r;){var a=e[n],l=t?t(a):a;if(!n||!Va(l,s)){var s=l;i[o++]=0===a?0:a}}return i}function uo(e){return"number"==typeof e?e:dl(e)?g:+e}function po(e){if("string"==typeof e)return e;if(Za(e))return Lt(e,po)+"";if(dl(e))return Fn?Fn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function fo(e,t,n){var r=-1,o=Pt,i=e.length,a=!0,l=[],s=l;if(n)a=!1,o=Tt;else if(i>=200){var c=t?null:Qo(e);if(c)return dn(c);a=!1,o=Jt,s=new Xn}else s=t?[]:l;e:for(;++r<i;){var u=e[r],d=t?t(u):u;if(u=n||0!==u?u:0,a&&d==d){for(var p=s.length;p--;)if(s[p]===d)continue e;t&&s.push(d),l.push(u)}else o(s,d,n)||(s!==l&&s.push(d),l.push(u))}return l}function ho(e,t){return null==(e=Mi(e,t=ko(t,e)))||delete e[Bi(Ji(t))]}function go(e,t,n,r){return to(e,t,n(jr(e,t)),r)}function mo(e,t,n,r){for(var o=e.length,i=r?o:-1;(r?i--:++i<o)&&t(e[i],i,e););return n?io(e,r?0:i,r?i+1:o):io(e,r?i+1:0,r?o:i)}function vo(e,t){var n=e;return n instanceof Kn&&(n=n.value()),Dt(t,(function(e,t){return t.func.apply(t.thisArg,At([e],t.args))}),n)}function bo(e,t,n){var o=e.length;if(o<2)return o?fo(e[0]):[];for(var i=-1,a=r(o);++i<o;)for(var l=e[i],s=-1;++s<o;)s!=i&&(a[i]=fr(a[i]||l,e[s],t,n));return fo(yr(a,1),t,n)}function yo(e,t,n){for(var r=-1,i=e.length,a=t.length,l={};++r<i;){var s=r<a?t[r]:o;n(l,e[r],s)}return l}function xo(e){return Xa(e)?e:[]}function wo(e){return"function"==typeof e?e:as}function ko(e,t){return Za(e)?e:Si(e,t)?[e]:Ri(wl(e))}var So=Qr;function Eo(e,t,n){var r=e.length;return n=n===o?r:n,!t&&n>=r?e:io(e,t,n)}var jo=dt||function(e){return ft.clearTimeout(e)};function _o(e,t){if(t)return e.slice();var n=e.length,r=Ke?Ke(n):new e.constructor(n);return e.copy(r),r}function Co(e){var t=new e.constructor(e.byteLength);return new We(t).set(new We(e)),t}function Oo(e,t){var n=t?Co(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Io(e,t){if(e!==t){var n=e!==o,r=null===e,i=e==e,a=dl(e),l=t!==o,s=null===t,c=t==t,u=dl(t);if(!s&&!u&&!a&&e>t||a&&l&&c&&!s&&!u||r&&l&&c||!n&&c||!i)return 1;if(!r&&!a&&!u&&e<t||u&&n&&i&&!r&&!a||s&&n&&i||!l&&i||!c)return-1}return 0}function Mo(e,t,n,o){for(var i=-1,a=e.length,l=n.length,s=-1,c=t.length,u=xn(a-l,0),d=r(c+u),p=!o;++s<c;)d[s]=t[s];for(;++i<l;)(p||i<a)&&(d[n[i]]=e[i]);for(;u--;)d[s++]=e[i++];return d}function Po(e,t,n,o){for(var i=-1,a=e.length,l=-1,s=n.length,c=-1,u=t.length,d=xn(a-s,0),p=r(d+u),f=!o;++i<d;)p[i]=e[i];for(var h=i;++c<u;)p[h+c]=t[c];for(;++l<s;)(f||i<a)&&(p[h+n[l]]=e[i++]);return p}function To(e,t){var n=-1,o=e.length;for(t||(t=r(o));++n<o;)t[n]=e[n];return t}function Lo(e,t,n,r){var i=!n;n||(n={});for(var a=-1,l=t.length;++a<l;){var s=t[a],c=r?r(n[s],e[s],s,n,e):o;c===o&&(c=e[s]),i?lr(n,s,c):rr(n,s,c)}return n}function Ao(e,t){return function(n,r){var o=Za(n)?_t:ir,i=t?t():{};return o(n,e,di(r,2),i)}}function Do(e){return Qr((function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:o,l=i>2?n[2]:o;for(a=e.length>3&&"function"==typeof a?(i--,a):o,l&&ki(n[0],n[1],l)&&(a=i<3?o:a,i=1),t=Ce(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t}))}function zo(e,t){return function(n,r){if(null==n)return n;if(!qa(n))return e(n,r);for(var o=n.length,i=t?o:-1,a=Ce(n);(t?i--:++i<o)&&!1!==r(a[i],i,a););return n}}function No(e){return function(t,n,r){for(var o=-1,i=Ce(t),a=r(t),l=a.length;l--;){var s=a[e?l:++o];if(!1===n(i[s],s,i))break}return t}}function Ho(e){return function(t){var n=ln(t=wl(t))?hn(t):o,r=n?n[0]:t.charAt(0),i=n?Eo(n,1).join(""):t.slice(1);return r[e]()+i}}function Ro(e){return function(t){return Dt(es(Kl(t).replace(Qe,"")),e,"")}}function Bo(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Vn(e.prototype),r=e.apply(n,t);return rl(r)?r:n}}function Fo(e){return function(t,n,r){var i=Ce(t);if(!qa(t)){var a=di(n,3);t=Al(t),n=function(e){return a(i[e],e,i)}}var l=e(t,n,r);return l>-1?i[a?t[l]:l]:o}}function Uo(e){return ii((function(t){var n=t.length,r=n,a=Wn.prototype.thru;for(e&&t.reverse();r--;){var l=t[r];if("function"!=typeof l)throw new Me(i);if(a&&!s&&"wrapper"==ci(l))var s=new Wn([],!0)}for(r=s?r:n;++r<n;){var c=ci(l=t[r]),u="wrapper"==c?si(l):o;s=u&&Ei(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?s[ci(u[0])].apply(s,u[3]):1==l.length&&Ei(l)?s[c]():s.thru(l)}return function(){var e=arguments,r=e[0];if(s&&1==e.length&&Za(r))return s.plant(r).value();for(var o=0,i=n?t[o].apply(this,e):r;++o<n;)i=t[o].call(this,i);return i}}))}function Vo(e,t,n,i,a,l,s,c,u,p){var f=t&d,h=1&t,g=2&t,m=24&t,v=512&t,b=g?o:Bo(e);return function o(){for(var d=arguments.length,y=r(d),x=d;x--;)y[x]=arguments[x];if(m)var w=ui(o),k=nn(y,w);if(i&&(y=Mo(y,i,a,m)),l&&(y=Po(y,l,s,m)),d-=k,m&&d<p){var S=un(y,w);return Xo(e,t,Vo,o.placeholder,n,y,S,c,u,p-d)}var E=h?n:this,j=g?E[e]:e;return d=y.length,c?y=Pi(y,c):v&&d>1&&y.reverse(),f&&u<d&&(y.length=u),this&&this!==ft&&this instanceof o&&(j=b||Bo(j)),j.apply(E,y)}}function Go(e,t){return function(n,r){return function(e,t,n,r){return kr(e,(function(e,o,i){t(r,n(e),o,i)})),r}(n,e,t(r),{})}}function Wo(e,t){return function(n,r){var i;if(n===o&&r===o)return t;if(n!==o&&(i=n),r!==o){if(i===o)return r;"string"==typeof n||"string"==typeof r?(n=po(n),r=po(r)):(n=uo(n),r=uo(r)),i=e(n,r)}return i}}function Ko(e){return ii((function(t){return t=Lt(t,$t(di())),Qr((function(n){var r=this;return e(t,(function(e){return jt(e,r,n)}))}))}))}function Zo(e,t){var n=(t=t===o?" ":po(t)).length;if(n<2)return n?$r(t,e):t;var r=$r(t,gt(e/fn(t)));return ln(t)?Eo(hn(r),0,e).join(""):r.slice(0,e)}function Yo(e){return function(t,n,i){return i&&"number"!=typeof i&&ki(t,n,i)&&(n=i=o),t=ml(t),n===o?(n=t,t=0):n=ml(n),function(e,t,n,o){for(var i=-1,a=xn(gt((t-e)/(n||1)),0),l=r(a);a--;)l[o?a:++i]=e,e+=n;return l}(t,n,i=i===o?t<n?1:-1:ml(i),e)}}function qo(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=yl(t),n=yl(n)),e(t,n)}}function Xo(e,t,n,r,i,a,l,s,d,p){var f=8&t;t|=f?c:u,4&(t&=~(f?u:c))||(t&=-4);var h=[e,t,i,f?a:o,f?l:o,f?o:a,f?o:l,s,d,p],g=n.apply(o,h);return Ei(e)&&Li(g,h),g.placeholder=r,zi(g,e,t)}function $o(e){var t=_e[e];return function(e,n){if(e=yl(e),(n=null==n?0:wn(vl(n),292))&&Kt(e)){var r=(wl(e)+"e").split("e");return+((r=(wl(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Qo=In&&1/dn(new In([,-0]))[1]==f?function(e){return new In(e)}:ds;function Jo(e){return function(t){var n=vi(t);return n==j?sn(t):n==M?pn(t):function(e,t){return Lt(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function ei(e,t,n,a,f,h,g,m){var v=2&t;if(!v&&"function"!=typeof e)throw new Me(i);var b=a?a.length:0;if(b||(t&=-97,a=f=o),g=g===o?g:xn(vl(g),0),m=m===o?m:vl(m),b-=f?f.length:0,t&u){var y=a,x=f;a=f=o}var w=v?o:si(e),k=[e,t,n,a,f,y,x,h,g,m];if(w&&function(e,t){var n=e[1],r=t[1],o=n|r,i=o<131,a=r==d&&8==n||r==d&&n==p&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!i&&!a)return e;1&r&&(e[2]=t[2],o|=1&n?0:4);var s=t[3];if(s){var c=e[3];e[3]=c?Mo(c,s,t[4]):s,e[4]=c?un(e[3],l):t[4]}(s=t[5])&&(c=e[5],e[5]=c?Po(c,s,t[6]):s,e[6]=c?un(e[5],l):t[6]);(s=t[7])&&(e[7]=s);r&d&&(e[8]=null==e[8]?t[8]:wn(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=o}(k,w),e=k[0],t=k[1],n=k[2],a=k[3],f=k[4],!(m=k[9]=k[9]===o?v?0:e.length:xn(k[9]-b,0))&&24&t&&(t&=-25),t&&1!=t)S=8==t||t==s?function(e,t,n){var i=Bo(e);return function a(){for(var l=arguments.length,s=r(l),c=l,u=ui(a);c--;)s[c]=arguments[c];var d=l<3&&s[0]!==u&&s[l-1]!==u?[]:un(s,u);return(l-=d.length)<n?Xo(e,t,Vo,a.placeholder,o,s,d,o,o,n-l):jt(this&&this!==ft&&this instanceof a?i:e,this,s)}}(e,t,m):t!=c&&33!=t||f.length?Vo.apply(o,k):function(e,t,n,o){var i=1&t,a=Bo(e);return function t(){for(var l=-1,s=arguments.length,c=-1,u=o.length,d=r(u+s),p=this&&this!==ft&&this instanceof t?a:e;++c<u;)d[c]=o[c];for(;s--;)d[c++]=arguments[++l];return jt(p,i?n:this,d)}}(e,t,n,a);else var S=function(e,t,n){var r=1&t,o=Bo(e);return function t(){return(this&&this!==ft&&this instanceof t?o:e).apply(r?n:this,arguments)}}(e,t,n);return zi((w?no:Li)(S,k),e,t)}function ti(e,t,n,r){return e===o||Va(e,Le[n])&&!ze.call(r,n)?t:e}function ni(e,t,n,r,i,a){return rl(e)&&rl(t)&&(a.set(t,e),Gr(e,t,o,ni,a),a.delete(t)),e}function ri(e){return ll(e)?o:e}function oi(e,t,n,r,i,a){var l=1&n,s=e.length,c=t.length;if(s!=c&&!(l&&c>s))return!1;var u=a.get(e),d=a.get(t);if(u&&d)return u==t&&d==e;var p=-1,f=!0,h=2&n?new Xn:o;for(a.set(e,t),a.set(t,e);++p<s;){var g=e[p],m=t[p];if(r)var v=l?r(m,g,p,t,e,a):r(g,m,p,e,t,a);if(v!==o){if(v)continue;f=!1;break}if(h){if(!Nt(t,(function(e,t){if(!Jt(h,t)&&(g===e||i(g,e,n,r,a)))return h.push(t)}))){f=!1;break}}else if(g!==m&&!i(g,m,n,r,a)){f=!1;break}}return a.delete(e),a.delete(t),f}function ii(e){return Di(Ii(e,o,Yi),e+"")}function ai(e){return _r(e,Al,gi)}function li(e){return _r(e,Dl,mi)}var si=Tn?function(e){return Tn.get(e)}:ds;function ci(e){for(var t=e.name+"",n=Ln[t],r=ze.call(Ln,t)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==e)return o.name}return t}function ui(e){return(ze.call(Un,"placeholder")?Un:e).placeholder}function di(){var e=Un.iteratee||ls;return e=e===ls?Nr:e,arguments.length?e(arguments[0],arguments[1]):e}function pi(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function fi(e){for(var t=Al(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,Ci(o)]}return t}function hi(e,t){var n=function(e,t){return null==e?o:e[t]}(e,t);return zr(n)?n:o}var gi=bt?function(e){return null==e?[]:(e=Ce(e),Mt(bt(e),(function(t){return qe.call(e,t)})))}:bs,mi=bt?function(e){for(var t=[];e;)At(t,gi(e)),e=Ze(e);return t}:bs,vi=Cr;function bi(e,t,n){for(var r=-1,o=(t=ko(t,e)).length,i=!1;++r<o;){var a=Bi(t[r]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&nl(o)&&wi(a,o)&&(Za(e)||Ka(e))}function yi(e){return"function"!=typeof e.constructor||_i(e)?{}:Vn(Ze(e))}function xi(e){return Za(e)||Ka(e)||!!($e&&e&&e[$e])}function wi(e,t){var n=typeof e;return!!(t=null==t?h:t)&&("number"==n||"symbol"!=n&&xe.test(e))&&e>-1&&e%1==0&&e<t}function ki(e,t,n){if(!rl(n))return!1;var r=typeof t;return!!("number"==r?qa(n)&&wi(t,n.length):"string"==r&&t in n)&&Va(n[t],e)}function Si(e,t){if(Za(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!dl(e))||(ne.test(e)||!te.test(e)||null!=t&&e in Ce(t))}function Ei(e){var t=ci(e),n=Un[t];if("function"!=typeof n||!(t in Kn.prototype))return!1;if(e===n)return!0;var r=si(n);return!!r&&e===r[0]}(_n&&vi(new _n(new ArrayBuffer(1)))!=D||Cn&&vi(new Cn)!=j||On&&vi(On.resolve())!=O||In&&vi(new In)!=M||Mn&&vi(new Mn)!=L)&&(vi=function(e){var t=Cr(e),n=t==C?e.constructor:o,r=n?Fi(n):"";if(r)switch(r){case An:return D;case Dn:return j;case zn:return O;case Nn:return M;case Hn:return L}return t});var ji=Ae?el:ys;function _i(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Le)}function Ci(e){return e==e&&!rl(e)}function Oi(e,t){return function(n){return null!=n&&(n[e]===t&&(t!==o||e in Ce(n)))}}function Ii(e,t,n){return t=xn(t===o?e.length-1:t,0),function(){for(var o=arguments,i=-1,a=xn(o.length-t,0),l=r(a);++i<a;)l[i]=o[t+i];i=-1;for(var s=r(t+1);++i<t;)s[i]=o[i];return s[t]=n(l),jt(e,this,s)}}function Mi(e,t){return t.length<2?e:jr(e,io(t,0,-1))}function Pi(e,t){for(var n=e.length,r=wn(t.length,n),i=To(e);r--;){var a=t[r];e[r]=wi(a,n)?i[a]:o}return e}function Ti(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Li=Ni(no),Ai=ht||function(e,t){return ft.setTimeout(e,t)},Di=Ni(ro);function zi(e,t,n){var r=t+"";return Di(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(se,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return Ct(v,(function(n){var r="_."+n[0];t&n[1]&&!Pt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(ce);return t?t[1].split(ue):[]}(r),n)))}function Ni(e){var t=0,n=0;return function(){var r=kn(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(o,arguments)}}function Hi(e,t){var n=-1,r=e.length,i=r-1;for(t=t===o?r:t;++n<t;){var a=Xr(n,i),l=e[a];e[a]=e[n],e[n]=l}return e.length=t,e}var Ri=function(e){var t=Na(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(re,(function(e,n,r,o){t.push(r?o.replace(fe,"$1"):n||e)})),t}));function Bi(e){if("string"==typeof e||dl(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Fi(e){if(null!=e){try{return De.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ui(e){if(e instanceof Kn)return e.clone();var t=new Wn(e.__wrapped__,e.__chain__);return t.__actions__=To(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Vi=Qr((function(e,t){return Xa(e)?fr(e,yr(t,1,Xa,!0)):[]})),Gi=Qr((function(e,t){var n=Ji(t);return Xa(n)&&(n=o),Xa(e)?fr(e,yr(t,1,Xa,!0),di(n,2)):[]})),Wi=Qr((function(e,t){var n=Ji(t);return Xa(n)&&(n=o),Xa(e)?fr(e,yr(t,1,Xa,!0),o,n):[]}));function Ki(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:vl(n);return o<0&&(o=xn(r+o,0)),Bt(e,di(t,3),o)}function Zi(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r-1;return n!==o&&(i=vl(n),i=n<0?xn(r+i,0):wn(i,r-1)),Bt(e,di(t,3),i,!0)}function Yi(e){return(null==e?0:e.length)?yr(e,1):[]}function qi(e){return e&&e.length?e[0]:o}var Xi=Qr((function(e){var t=Lt(e,xo);return t.length&&t[0]===e[0]?Pr(t):[]})),$i=Qr((function(e){var t=Ji(e),n=Lt(e,xo);return t===Ji(n)?t=o:n.pop(),n.length&&n[0]===e[0]?Pr(n,di(t,2)):[]})),Qi=Qr((function(e){var t=Ji(e),n=Lt(e,xo);return(t="function"==typeof t?t:o)&&n.pop(),n.length&&n[0]===e[0]?Pr(n,o,t):[]}));function Ji(e){var t=null==e?0:e.length;return t?e[t-1]:o}var ea=Qr(ta);function ta(e,t){return e&&e.length&&t&&t.length?Yr(e,t):e}var na=ii((function(e,t){var n=null==e?0:e.length,r=sr(e,t);return qr(e,Lt(t,(function(e){return wi(e,n)?+e:e})).sort(Io)),r}));function ra(e){return null==e?e:jn.call(e)}var oa=Qr((function(e){return fo(yr(e,1,Xa,!0))})),ia=Qr((function(e){var t=Ji(e);return Xa(t)&&(t=o),fo(yr(e,1,Xa,!0),di(t,2))})),aa=Qr((function(e){var t=Ji(e);return t="function"==typeof t?t:o,fo(yr(e,1,Xa,!0),o,t)}));function la(e){if(!e||!e.length)return[];var t=0;return e=Mt(e,(function(e){if(Xa(e))return t=xn(e.length,t),!0})),qt(t,(function(t){return Lt(e,Wt(t))}))}function sa(e,t){if(!e||!e.length)return[];var n=la(e);return null==t?n:Lt(n,(function(e){return jt(t,o,e)}))}var ca=Qr((function(e,t){return Xa(e)?fr(e,t):[]})),ua=Qr((function(e){return bo(Mt(e,Xa))})),da=Qr((function(e){var t=Ji(e);return Xa(t)&&(t=o),bo(Mt(e,Xa),di(t,2))})),pa=Qr((function(e){var t=Ji(e);return t="function"==typeof t?t:o,bo(Mt(e,Xa),o,t)})),fa=Qr(la);var ha=Qr((function(e){var t=e.length,n=t>1?e[t-1]:o;return n="function"==typeof n?(e.pop(),n):o,sa(e,n)}));function ga(e){var t=Un(e);return t.__chain__=!0,t}function ma(e,t){return t(e)}var va=ii((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,i=function(t){return sr(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Kn&&wi(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:ma,args:[i],thisArg:o}),new Wn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(o),e}))):this.thru(i)}));var ba=Ao((function(e,t,n){ze.call(e,n)?++e[n]:lr(e,n,1)}));var ya=Fo(Ki),xa=Fo(Zi);function wa(e,t){return(Za(e)?Ct:hr)(e,di(t,3))}function ka(e,t){return(Za(e)?Ot:gr)(e,di(t,3))}var Sa=Ao((function(e,t,n){ze.call(e,n)?e[n].push(t):lr(e,n,[t])}));var Ea=Qr((function(e,t,n){var o=-1,i="function"==typeof t,a=qa(e)?r(e.length):[];return hr(e,(function(e){a[++o]=i?jt(t,e,n):Tr(e,t,n)})),a})),ja=Ao((function(e,t,n){lr(e,n,t)}));function _a(e,t){return(Za(e)?Lt:Fr)(e,di(t,3))}var Ca=Ao((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var Oa=Qr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&ki(e,t[0],t[1])?t=[]:n>2&&ki(t[0],t[1],t[2])&&(t=[t[0]]),Kr(e,yr(t,1),[])})),Ia=pt||function(){return ft.Date.now()};function Ma(e,t,n){return t=n?o:t,t=e&&null==t?e.length:t,ei(e,d,o,o,o,o,t)}function Pa(e,t){var n;if("function"!=typeof t)throw new Me(i);return e=vl(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=o),n}}var Ta=Qr((function(e,t,n){var r=1;if(n.length){var o=un(n,ui(Ta));r|=c}return ei(e,r,t,n,o)})),La=Qr((function(e,t,n){var r=3;if(n.length){var o=un(n,ui(La));r|=c}return ei(t,r,e,n,o)}));function Aa(e,t,n){var r,a,l,s,c,u,d=0,p=!1,f=!1,h=!0;if("function"!=typeof e)throw new Me(i);function g(t){var n=r,i=a;return r=a=o,d=t,s=e.apply(i,n)}function m(e){return d=e,c=Ai(b,t),p?g(e):s}function v(e){var n=e-u;return u===o||n>=t||n<0||f&&e-d>=l}function b(){var e=Ia();if(v(e))return y(e);c=Ai(b,function(e){var n=t-(e-u);return f?wn(n,l-(e-d)):n}(e))}function y(e){return c=o,h&&r?g(e):(r=a=o,s)}function x(){var e=Ia(),n=v(e);if(r=arguments,a=this,u=e,n){if(c===o)return m(u);if(f)return jo(c),c=Ai(b,t),g(u)}return c===o&&(c=Ai(b,t)),s}return t=yl(t)||0,rl(n)&&(p=!!n.leading,l=(f="maxWait"in n)?xn(yl(n.maxWait)||0,t):l,h="trailing"in n?!!n.trailing:h),x.cancel=function(){c!==o&&jo(c),d=0,r=u=a=c=o},x.flush=function(){return c===o?s:y(Ia())},x}var Da=Qr((function(e,t){return pr(e,1,t)})),za=Qr((function(e,t,n){return pr(e,yl(t)||0,n)}));function Na(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Me(i);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(Na.Cache||qn),n}function Ha(e){if("function"!=typeof e)throw new Me(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Na.Cache=qn;var Ra=So((function(e,t){var n=(t=1==t.length&&Za(t[0])?Lt(t[0],$t(di())):Lt(yr(t,1),$t(di()))).length;return Qr((function(r){for(var o=-1,i=wn(r.length,n);++o<i;)r[o]=t[o].call(this,r[o]);return jt(e,this,r)}))})),Ba=Qr((function(e,t){var n=un(t,ui(Ba));return ei(e,c,o,t,n)})),Fa=Qr((function(e,t){var n=un(t,ui(Fa));return ei(e,u,o,t,n)})),Ua=ii((function(e,t){return ei(e,p,o,o,o,t)}));function Va(e,t){return e===t||e!=e&&t!=t}var Ga=qo(Or),Wa=qo((function(e,t){return e>=t})),Ka=Lr(function(){return arguments}())?Lr:function(e){return ol(e)&&ze.call(e,"callee")&&!qe.call(e,"callee")},Za=r.isArray,Ya=yt?$t(yt):function(e){return ol(e)&&Cr(e)==A};function qa(e){return null!=e&&nl(e.length)&&!el(e)}function Xa(e){return ol(e)&&qa(e)}var $a=Ht||ys,Qa=xt?$t(xt):function(e){return ol(e)&&Cr(e)==w};function Ja(e){if(!ol(e))return!1;var t=Cr(e);return t==k||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ll(e)}function el(e){if(!rl(e))return!1;var t=Cr(e);return t==S||t==E||"[object AsyncFunction]"==t||"[object Proxy]"==t}function tl(e){return"number"==typeof e&&e==vl(e)}function nl(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=h}function rl(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ol(e){return null!=e&&"object"==typeof e}var il=wt?$t(wt):function(e){return ol(e)&&vi(e)==j};function al(e){return"number"==typeof e||ol(e)&&Cr(e)==_}function ll(e){if(!ol(e)||Cr(e)!=C)return!1;var t=Ze(e);if(null===t)return!0;var n=ze.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&De.call(n)==Be}var sl=kt?$t(kt):function(e){return ol(e)&&Cr(e)==I};var cl=St?$t(St):function(e){return ol(e)&&vi(e)==M};function ul(e){return"string"==typeof e||!Za(e)&&ol(e)&&Cr(e)==P}function dl(e){return"symbol"==typeof e||ol(e)&&Cr(e)==T}var pl=Et?$t(Et):function(e){return ol(e)&&nl(e.length)&&!!at[Cr(e)]};var fl=qo(Br),hl=qo((function(e,t){return e<=t}));function gl(e){if(!e)return[];if(qa(e))return ul(e)?hn(e):To(e);if(et&&e[et])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[et]());var t=vi(e);return(t==j?sn:t==M?dn:Vl)(e)}function ml(e){return e?(e=yl(e))===f||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function vl(e){var t=ml(e),n=t%1;return t==t?n?t-n:t:0}function bl(e){return e?cr(vl(e),0,m):0}function yl(e){if("number"==typeof e)return e;if(dl(e))return g;if(rl(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=rl(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Xt(e);var n=ve.test(e);return n||ye.test(e)?ut(e.slice(2),n?2:8):me.test(e)?g:+e}function xl(e){return Lo(e,Dl(e))}function wl(e){return null==e?"":po(e)}var kl=Do((function(e,t){if(_i(t)||qa(t))Lo(t,Al(t),e);else for(var n in t)ze.call(t,n)&&rr(e,n,t[n])})),Sl=Do((function(e,t){Lo(t,Dl(t),e)})),El=Do((function(e,t,n,r){Lo(t,Dl(t),e,r)})),jl=Do((function(e,t,n,r){Lo(t,Al(t),e,r)})),_l=ii(sr);var Cl=Qr((function(e,t){e=Ce(e);var n=-1,r=t.length,i=r>2?t[2]:o;for(i&&ki(t[0],t[1],i)&&(r=1);++n<r;)for(var a=t[n],l=Dl(a),s=-1,c=l.length;++s<c;){var u=l[s],d=e[u];(d===o||Va(d,Le[u])&&!ze.call(e,u))&&(e[u]=a[u])}return e})),Ol=Qr((function(e){return e.push(o,ni),jt(Nl,o,e)}));function Il(e,t,n){var r=null==e?o:jr(e,t);return r===o?n:r}function Ml(e,t){return null!=e&&bi(e,t,Mr)}var Pl=Go((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Re.call(t)),e[t]=n}),rs(as)),Tl=Go((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Re.call(t)),ze.call(e,t)?e[t].push(n):e[t]=[n]}),di),Ll=Qr(Tr);function Al(e){return qa(e)?Qn(e):Hr(e)}function Dl(e){return qa(e)?Qn(e,!0):Rr(e)}var zl=Do((function(e,t,n){Gr(e,t,n)})),Nl=Do((function(e,t,n,r){Gr(e,t,n,r)})),Hl=ii((function(e,t){var n={};if(null==e)return n;var r=!1;t=Lt(t,(function(t){return t=ko(t,e),r||(r=t.length>1),t})),Lo(e,li(e),n),r&&(n=ur(n,7,ri));for(var o=t.length;o--;)ho(n,t[o]);return n}));var Rl=ii((function(e,t){return null==e?{}:function(e,t){return Zr(e,t,(function(t,n){return Ml(e,n)}))}(e,t)}));function Bl(e,t){if(null==e)return{};var n=Lt(li(e),(function(e){return[e]}));return t=di(t),Zr(e,n,(function(e,n){return t(e,n[0])}))}var Fl=Jo(Al),Ul=Jo(Dl);function Vl(e){return null==e?[]:Qt(e,Al(e))}var Gl=Ro((function(e,t,n){return t=t.toLowerCase(),e+(n?Wl(t):t)}));function Wl(e){return Jl(wl(e).toLowerCase())}function Kl(e){return(e=wl(e))&&e.replace(we,rn).replace(Je,"")}var Zl=Ro((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Yl=Ro((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),ql=Ho("toLowerCase");var Xl=Ro((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var $l=Ro((function(e,t,n){return e+(n?" ":"")+Jl(t)}));var Ql=Ro((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Jl=Ho("toUpperCase");function es(e,t,n){return e=wl(e),(t=n?o:t)===o?function(e){return rt.test(e)}(e)?function(e){return e.match(tt)||[]}(e):function(e){return e.match(de)||[]}(e):e.match(t)||[]}var ts=Qr((function(e,t){try{return jt(e,o,t)}catch(e){return Ja(e)?e:new Ee(e)}})),ns=ii((function(e,t){return Ct(t,(function(t){t=Bi(t),lr(e,t,Ta(e[t],e))})),e}));function rs(e){return function(){return e}}var os=Uo(),is=Uo(!0);function as(e){return e}function ls(e){return Nr("function"==typeof e?e:ur(e,1))}var ss=Qr((function(e,t){return function(n){return Tr(n,e,t)}})),cs=Qr((function(e,t){return function(n){return Tr(e,n,t)}}));function us(e,t,n){var r=Al(t),o=Er(t,r);null!=n||rl(t)&&(o.length||!r.length)||(n=t,t=e,e=this,o=Er(t,Al(t)));var i=!(rl(n)&&"chain"in n&&!n.chain),a=el(e);return Ct(o,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__),o=n.__actions__=To(this.__actions__);return o.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,At([this.value()],arguments))})})),e}function ds(){}var ps=Ko(Lt),fs=Ko(It),hs=Ko(Nt);function gs(e){return Si(e)?Wt(Bi(e)):function(e){return function(t){return jr(t,e)}}(e)}var ms=Yo(),vs=Yo(!0);function bs(){return[]}function ys(){return!1}var xs=Wo((function(e,t){return e+t}),0),ws=$o("ceil"),ks=Wo((function(e,t){return e/t}),1),Ss=$o("floor");var Es,js=Wo((function(e,t){return e*t}),1),_s=$o("round"),Cs=Wo((function(e,t){return e-t}),0);return Un.after=function(e,t){if("function"!=typeof t)throw new Me(i);return e=vl(e),function(){if(--e<1)return t.apply(this,arguments)}},Un.ary=Ma,Un.assign=kl,Un.assignIn=Sl,Un.assignInWith=El,Un.assignWith=jl,Un.at=_l,Un.before=Pa,Un.bind=Ta,Un.bindAll=ns,Un.bindKey=La,Un.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Za(e)?e:[e]},Un.chain=ga,Un.chunk=function(e,t,n){t=(n?ki(e,t,n):t===o)?1:xn(vl(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var a=0,l=0,s=r(gt(i/t));a<i;)s[l++]=io(e,a,a+=t);return s},Un.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,o=[];++t<n;){var i=e[t];i&&(o[r++]=i)}return o},Un.concat=function(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],o=e;o--;)t[o-1]=arguments[o];return At(Za(n)?To(n):[n],yr(t,1))},Un.cond=function(e){var t=null==e?0:e.length,n=di();return e=t?Lt(e,(function(e){if("function"!=typeof e[1])throw new Me(i);return[n(e[0]),e[1]]})):[],Qr((function(n){for(var r=-1;++r<t;){var o=e[r];if(jt(o[0],this,n))return jt(o[1],this,n)}}))},Un.conforms=function(e){return function(e){var t=Al(e);return function(n){return dr(n,e,t)}}(ur(e,1))},Un.constant=rs,Un.countBy=ba,Un.create=function(e,t){var n=Vn(e);return null==t?n:ar(n,t)},Un.curry=function e(t,n,r){var i=ei(t,8,o,o,o,o,o,n=r?o:n);return i.placeholder=e.placeholder,i},Un.curryRight=function e(t,n,r){var i=ei(t,s,o,o,o,o,o,n=r?o:n);return i.placeholder=e.placeholder,i},Un.debounce=Aa,Un.defaults=Cl,Un.defaultsDeep=Ol,Un.defer=Da,Un.delay=za,Un.difference=Vi,Un.differenceBy=Gi,Un.differenceWith=Wi,Un.drop=function(e,t,n){var r=null==e?0:e.length;return r?io(e,(t=n||t===o?1:vl(t))<0?0:t,r):[]},Un.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?io(e,0,(t=r-(t=n||t===o?1:vl(t)))<0?0:t):[]},Un.dropRightWhile=function(e,t){return e&&e.length?mo(e,di(t,3),!0,!0):[]},Un.dropWhile=function(e,t){return e&&e.length?mo(e,di(t,3),!0):[]},Un.fill=function(e,t,n,r){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&ki(e,t,n)&&(n=0,r=i),function(e,t,n,r){var i=e.length;for((n=vl(n))<0&&(n=-n>i?0:i+n),(r=r===o||r>i?i:vl(r))<0&&(r+=i),r=n>r?0:bl(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},Un.filter=function(e,t){return(Za(e)?Mt:br)(e,di(t,3))},Un.flatMap=function(e,t){return yr(_a(e,t),1)},Un.flatMapDeep=function(e,t){return yr(_a(e,t),f)},Un.flatMapDepth=function(e,t,n){return n=n===o?1:vl(n),yr(_a(e,t),n)},Un.flatten=Yi,Un.flattenDeep=function(e){return(null==e?0:e.length)?yr(e,f):[]},Un.flattenDepth=function(e,t){return(null==e?0:e.length)?yr(e,t=t===o?1:vl(t)):[]},Un.flip=function(e){return ei(e,512)},Un.flow=os,Un.flowRight=is,Un.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var o=e[t];r[o[0]]=o[1]}return r},Un.functions=function(e){return null==e?[]:Er(e,Al(e))},Un.functionsIn=function(e){return null==e?[]:Er(e,Dl(e))},Un.groupBy=Sa,Un.initial=function(e){return(null==e?0:e.length)?io(e,0,-1):[]},Un.intersection=Xi,Un.intersectionBy=$i,Un.intersectionWith=Qi,Un.invert=Pl,Un.invertBy=Tl,Un.invokeMap=Ea,Un.iteratee=ls,Un.keyBy=ja,Un.keys=Al,Un.keysIn=Dl,Un.map=_a,Un.mapKeys=function(e,t){var n={};return t=di(t,3),kr(e,(function(e,r,o){lr(n,t(e,r,o),e)})),n},Un.mapValues=function(e,t){var n={};return t=di(t,3),kr(e,(function(e,r,o){lr(n,r,t(e,r,o))})),n},Un.matches=function(e){return Ur(ur(e,1))},Un.matchesProperty=function(e,t){return Vr(e,ur(t,1))},Un.memoize=Na,Un.merge=zl,Un.mergeWith=Nl,Un.method=ss,Un.methodOf=cs,Un.mixin=us,Un.negate=Ha,Un.nthArg=function(e){return e=vl(e),Qr((function(t){return Wr(t,e)}))},Un.omit=Hl,Un.omitBy=function(e,t){return Bl(e,Ha(di(t)))},Un.once=function(e){return Pa(2,e)},Un.orderBy=function(e,t,n,r){return null==e?[]:(Za(t)||(t=null==t?[]:[t]),Za(n=r?o:n)||(n=null==n?[]:[n]),Kr(e,t,n))},Un.over=ps,Un.overArgs=Ra,Un.overEvery=fs,Un.overSome=hs,Un.partial=Ba,Un.partialRight=Fa,Un.partition=Ca,Un.pick=Rl,Un.pickBy=Bl,Un.property=gs,Un.propertyOf=function(e){return function(t){return null==e?o:jr(e,t)}},Un.pull=ea,Un.pullAll=ta,Un.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Yr(e,t,di(n,2)):e},Un.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Yr(e,t,o,n):e},Un.pullAt=na,Un.range=ms,Un.rangeRight=vs,Un.rearg=Ua,Un.reject=function(e,t){return(Za(e)?Mt:br)(e,Ha(di(t,3)))},Un.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,o=[],i=e.length;for(t=di(t,3);++r<i;){var a=e[r];t(a,r,e)&&(n.push(a),o.push(r))}return qr(e,o),n},Un.rest=function(e,t){if("function"!=typeof e)throw new Me(i);return Qr(e,t=t===o?t:vl(t))},Un.reverse=ra,Un.sampleSize=function(e,t,n){return t=(n?ki(e,t,n):t===o)?1:vl(t),(Za(e)?er:eo)(e,t)},Un.set=function(e,t,n){return null==e?e:to(e,t,n)},Un.setWith=function(e,t,n,r){return r="function"==typeof r?r:o,null==e?e:to(e,t,n,r)},Un.shuffle=function(e){return(Za(e)?tr:oo)(e)},Un.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&ki(e,t,n)?(t=0,n=r):(t=null==t?0:vl(t),n=n===o?r:vl(n)),io(e,t,n)):[]},Un.sortBy=Oa,Un.sortedUniq=function(e){return e&&e.length?co(e):[]},Un.sortedUniqBy=function(e,t){return e&&e.length?co(e,di(t,2)):[]},Un.split=function(e,t,n){return n&&"number"!=typeof n&&ki(e,t,n)&&(t=n=o),(n=n===o?m:n>>>0)?(e=wl(e))&&("string"==typeof t||null!=t&&!sl(t))&&!(t=po(t))&&ln(e)?Eo(hn(e),0,n):e.split(t,n):[]},Un.spread=function(e,t){if("function"!=typeof e)throw new Me(i);return t=null==t?0:xn(vl(t),0),Qr((function(n){var r=n[t],o=Eo(n,0,t);return r&&At(o,r),jt(e,this,o)}))},Un.tail=function(e){var t=null==e?0:e.length;return t?io(e,1,t):[]},Un.take=function(e,t,n){return e&&e.length?io(e,0,(t=n||t===o?1:vl(t))<0?0:t):[]},Un.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?io(e,(t=r-(t=n||t===o?1:vl(t)))<0?0:t,r):[]},Un.takeRightWhile=function(e,t){return e&&e.length?mo(e,di(t,3),!1,!0):[]},Un.takeWhile=function(e,t){return e&&e.length?mo(e,di(t,3)):[]},Un.tap=function(e,t){return t(e),e},Un.throttle=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new Me(i);return rl(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),Aa(e,t,{leading:r,maxWait:t,trailing:o})},Un.thru=ma,Un.toArray=gl,Un.toPairs=Fl,Un.toPairsIn=Ul,Un.toPath=function(e){return Za(e)?Lt(e,Bi):dl(e)?[e]:To(Ri(wl(e)))},Un.toPlainObject=xl,Un.transform=function(e,t,n){var r=Za(e),o=r||$a(e)||pl(e);if(t=di(t,4),null==n){var i=e&&e.constructor;n=o?r?new i:[]:rl(e)&&el(i)?Vn(Ze(e)):{}}return(o?Ct:kr)(e,(function(e,r,o){return t(n,e,r,o)})),n},Un.unary=function(e){return Ma(e,1)},Un.union=oa,Un.unionBy=ia,Un.unionWith=aa,Un.uniq=function(e){return e&&e.length?fo(e):[]},Un.uniqBy=function(e,t){return e&&e.length?fo(e,di(t,2)):[]},Un.uniqWith=function(e,t){return t="function"==typeof t?t:o,e&&e.length?fo(e,o,t):[]},Un.unset=function(e,t){return null==e||ho(e,t)},Un.unzip=la,Un.unzipWith=sa,Un.update=function(e,t,n){return null==e?e:go(e,t,wo(n))},Un.updateWith=function(e,t,n,r){return r="function"==typeof r?r:o,null==e?e:go(e,t,wo(n),r)},Un.values=Vl,Un.valuesIn=function(e){return null==e?[]:Qt(e,Dl(e))},Un.without=ca,Un.words=es,Un.wrap=function(e,t){return Ba(wo(t),e)},Un.xor=ua,Un.xorBy=da,Un.xorWith=pa,Un.zip=fa,Un.zipObject=function(e,t){return yo(e||[],t||[],rr)},Un.zipObjectDeep=function(e,t){return yo(e||[],t||[],to)},Un.zipWith=ha,Un.entries=Fl,Un.entriesIn=Ul,Un.extend=Sl,Un.extendWith=El,us(Un,Un),Un.add=xs,Un.attempt=ts,Un.camelCase=Gl,Un.capitalize=Wl,Un.ceil=ws,Un.clamp=function(e,t,n){return n===o&&(n=t,t=o),n!==o&&(n=(n=yl(n))==n?n:0),t!==o&&(t=(t=yl(t))==t?t:0),cr(yl(e),t,n)},Un.clone=function(e){return ur(e,4)},Un.cloneDeep=function(e){return ur(e,5)},Un.cloneDeepWith=function(e,t){return ur(e,5,t="function"==typeof t?t:o)},Un.cloneWith=function(e,t){return ur(e,4,t="function"==typeof t?t:o)},Un.conformsTo=function(e,t){return null==t||dr(e,t,Al(t))},Un.deburr=Kl,Un.defaultTo=function(e,t){return null==e||e!=e?t:e},Un.divide=ks,Un.endsWith=function(e,t,n){e=wl(e),t=po(t);var r=e.length,i=n=n===o?r:cr(vl(n),0,r);return(n-=t.length)>=0&&e.slice(n,i)==t},Un.eq=Va,Un.escape=function(e){return(e=wl(e))&&$.test(e)?e.replace(q,on):e},Un.escapeRegExp=function(e){return(e=wl(e))&&ie.test(e)?e.replace(oe,"\\$&"):e},Un.every=function(e,t,n){var r=Za(e)?It:mr;return n&&ki(e,t,n)&&(t=o),r(e,di(t,3))},Un.find=ya,Un.findIndex=Ki,Un.findKey=function(e,t){return Rt(e,di(t,3),kr)},Un.findLast=xa,Un.findLastIndex=Zi,Un.findLastKey=function(e,t){return Rt(e,di(t,3),Sr)},Un.floor=Ss,Un.forEach=wa,Un.forEachRight=ka,Un.forIn=function(e,t){return null==e?e:xr(e,di(t,3),Dl)},Un.forInRight=function(e,t){return null==e?e:wr(e,di(t,3),Dl)},Un.forOwn=function(e,t){return e&&kr(e,di(t,3))},Un.forOwnRight=function(e,t){return e&&Sr(e,di(t,3))},Un.get=Il,Un.gt=Ga,Un.gte=Wa,Un.has=function(e,t){return null!=e&&bi(e,t,Ir)},Un.hasIn=Ml,Un.head=qi,Un.identity=as,Un.includes=function(e,t,n,r){e=qa(e)?e:Vl(e),n=n&&!r?vl(n):0;var o=e.length;return n<0&&(n=xn(o+n,0)),ul(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&Ft(e,t,n)>-1},Un.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:vl(n);return o<0&&(o=xn(r+o,0)),Ft(e,t,o)},Un.inRange=function(e,t,n){return t=ml(t),n===o?(n=t,t=0):n=ml(n),function(e,t,n){return e>=wn(t,n)&&e<xn(t,n)}(e=yl(e),t,n)},Un.invoke=Ll,Un.isArguments=Ka,Un.isArray=Za,Un.isArrayBuffer=Ya,Un.isArrayLike=qa,Un.isArrayLikeObject=Xa,Un.isBoolean=function(e){return!0===e||!1===e||ol(e)&&Cr(e)==x},Un.isBuffer=$a,Un.isDate=Qa,Un.isElement=function(e){return ol(e)&&1===e.nodeType&&!ll(e)},Un.isEmpty=function(e){if(null==e)return!0;if(qa(e)&&(Za(e)||"string"==typeof e||"function"==typeof e.splice||$a(e)||pl(e)||Ka(e)))return!e.length;var t=vi(e);if(t==j||t==M)return!e.size;if(_i(e))return!Hr(e).length;for(var n in e)if(ze.call(e,n))return!1;return!0},Un.isEqual=function(e,t){return Ar(e,t)},Un.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:o)?n(e,t):o;return r===o?Ar(e,t,o,n):!!r},Un.isError=Ja,Un.isFinite=function(e){return"number"==typeof e&&Kt(e)},Un.isFunction=el,Un.isInteger=tl,Un.isLength=nl,Un.isMap=il,Un.isMatch=function(e,t){return e===t||Dr(e,t,fi(t))},Un.isMatchWith=function(e,t,n){return n="function"==typeof n?n:o,Dr(e,t,fi(t),n)},Un.isNaN=function(e){return al(e)&&e!=+e},Un.isNative=function(e){if(ji(e))throw new Ee("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return zr(e)},Un.isNil=function(e){return null==e},Un.isNull=function(e){return null===e},Un.isNumber=al,Un.isObject=rl,Un.isObjectLike=ol,Un.isPlainObject=ll,Un.isRegExp=sl,Un.isSafeInteger=function(e){return tl(e)&&e>=-9007199254740991&&e<=h},Un.isSet=cl,Un.isString=ul,Un.isSymbol=dl,Un.isTypedArray=pl,Un.isUndefined=function(e){return e===o},Un.isWeakMap=function(e){return ol(e)&&vi(e)==L},Un.isWeakSet=function(e){return ol(e)&&"[object WeakSet]"==Cr(e)},Un.join=function(e,t){return null==e?"":bn.call(e,t)},Un.kebabCase=Zl,Un.last=Ji,Un.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r;return n!==o&&(i=(i=vl(n))<0?xn(r+i,0):wn(i,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):Bt(e,Vt,i,!0)},Un.lowerCase=Yl,Un.lowerFirst=ql,Un.lt=fl,Un.lte=hl,Un.max=function(e){return e&&e.length?vr(e,as,Or):o},Un.maxBy=function(e,t){return e&&e.length?vr(e,di(t,2),Or):o},Un.mean=function(e){return Gt(e,as)},Un.meanBy=function(e,t){return Gt(e,di(t,2))},Un.min=function(e){return e&&e.length?vr(e,as,Br):o},Un.minBy=function(e,t){return e&&e.length?vr(e,di(t,2),Br):o},Un.stubArray=bs,Un.stubFalse=ys,Un.stubObject=function(){return{}},Un.stubString=function(){return""},Un.stubTrue=function(){return!0},Un.multiply=js,Un.nth=function(e,t){return e&&e.length?Wr(e,vl(t)):o},Un.noConflict=function(){return ft._===this&&(ft._=Fe),this},Un.noop=ds,Un.now=Ia,Un.pad=function(e,t,n){e=wl(e);var r=(t=vl(t))?fn(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return Zo(vt(o),n)+e+Zo(gt(o),n)},Un.padEnd=function(e,t,n){e=wl(e);var r=(t=vl(t))?fn(e):0;return t&&r<t?e+Zo(t-r,n):e},Un.padStart=function(e,t,n){e=wl(e);var r=(t=vl(t))?fn(e):0;return t&&r<t?Zo(t-r,n)+e:e},Un.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),Sn(wl(e).replace(ae,""),t||0)},Un.random=function(e,t,n){if(n&&"boolean"!=typeof n&&ki(e,t,n)&&(t=n=o),n===o&&("boolean"==typeof t?(n=t,t=o):"boolean"==typeof e&&(n=e,e=o)),e===o&&t===o?(e=0,t=1):(e=ml(e),t===o?(t=e,e=0):t=ml(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var i=En();return wn(e+i*(t-e+ct("1e-"+((i+"").length-1))),t)}return Xr(e,t)},Un.reduce=function(e,t,n){var r=Za(e)?Dt:Zt,o=arguments.length<3;return r(e,di(t,4),n,o,hr)},Un.reduceRight=function(e,t,n){var r=Za(e)?zt:Zt,o=arguments.length<3;return r(e,di(t,4),n,o,gr)},Un.repeat=function(e,t,n){return t=(n?ki(e,t,n):t===o)?1:vl(t),$r(wl(e),t)},Un.replace=function(){var e=arguments,t=wl(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Un.result=function(e,t,n){var r=-1,i=(t=ko(t,e)).length;for(i||(i=1,e=o);++r<i;){var a=null==e?o:e[Bi(t[r])];a===o&&(r=i,a=n),e=el(a)?a.call(e):a}return e},Un.round=_s,Un.runInContext=e,Un.sample=function(e){return(Za(e)?Jn:Jr)(e)},Un.size=function(e){if(null==e)return 0;if(qa(e))return ul(e)?fn(e):e.length;var t=vi(e);return t==j||t==M?e.size:Hr(e).length},Un.snakeCase=Xl,Un.some=function(e,t,n){var r=Za(e)?Nt:ao;return n&&ki(e,t,n)&&(t=o),r(e,di(t,3))},Un.sortedIndex=function(e,t){return lo(e,t)},Un.sortedIndexBy=function(e,t,n){return so(e,t,di(n,2))},Un.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=lo(e,t);if(r<n&&Va(e[r],t))return r}return-1},Un.sortedLastIndex=function(e,t){return lo(e,t,!0)},Un.sortedLastIndexBy=function(e,t,n){return so(e,t,di(n,2),!0)},Un.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var n=lo(e,t,!0)-1;if(Va(e[n],t))return n}return-1},Un.startCase=$l,Un.startsWith=function(e,t,n){return e=wl(e),n=null==n?0:cr(vl(n),0,e.length),t=po(t),e.slice(n,n+t.length)==t},Un.subtract=Cs,Un.sum=function(e){return e&&e.length?Yt(e,as):0},Un.sumBy=function(e,t){return e&&e.length?Yt(e,di(t,2)):0},Un.template=function(e,t,n){var r=Un.templateSettings;n&&ki(e,t,n)&&(t=o),e=wl(e),t=El({},t,r,ti);var i,a,l=El({},t.imports,r.imports,ti),s=Al(l),c=Qt(l,s),u=0,d=t.interpolate||ke,p="__p += '",f=Oe((t.escape||ke).source+"|"+d.source+"|"+(d===ee?he:ke).source+"|"+(t.evaluate||ke).source+"|$","g"),h="//# sourceURL="+(ze.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++it+"]")+"\n";e.replace(f,(function(t,n,r,o,l,s){return r||(r=o),p+=e.slice(u,s).replace(Se,an),n&&(i=!0,p+="' +\n__e("+n+") +\n'"),l&&(a=!0,p+="';\n"+l+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),u=s+t.length,t})),p+="';\n";var g=ze.call(t,"variable")&&t.variable;if(g){if(pe.test(g))throw new Ee("Invalid `variable` option passed into `_.template`")}else p="with (obj) {\n"+p+"\n}\n";p=(a?p.replace(W,""):p).replace(K,"$1").replace(Z,"$1;"),p="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var m=ts((function(){return je(s,h+"return "+p).apply(o,c)}));if(m.source=p,Ja(m))throw m;return m},Un.times=function(e,t){if((e=vl(e))<1||e>h)return[];var n=m,r=wn(e,m);t=di(t),e-=m;for(var o=qt(r,t);++n<e;)t(n);return o},Un.toFinite=ml,Un.toInteger=vl,Un.toLength=bl,Un.toLower=function(e){return wl(e).toLowerCase()},Un.toNumber=yl,Un.toSafeInteger=function(e){return e?cr(vl(e),-9007199254740991,h):0===e?e:0},Un.toString=wl,Un.toUpper=function(e){return wl(e).toUpperCase()},Un.trim=function(e,t,n){if((e=wl(e))&&(n||t===o))return Xt(e);if(!e||!(t=po(t)))return e;var r=hn(e),i=hn(t);return Eo(r,en(r,i),tn(r,i)+1).join("")},Un.trimEnd=function(e,t,n){if((e=wl(e))&&(n||t===o))return e.slice(0,gn(e)+1);if(!e||!(t=po(t)))return e;var r=hn(e);return Eo(r,0,tn(r,hn(t))+1).join("")},Un.trimStart=function(e,t,n){if((e=wl(e))&&(n||t===o))return e.replace(ae,"");if(!e||!(t=po(t)))return e;var r=hn(e);return Eo(r,en(r,hn(t))).join("")},Un.truncate=function(e,t){var n=30,r="...";if(rl(t)){var i="separator"in t?t.separator:i;n="length"in t?vl(t.length):n,r="omission"in t?po(t.omission):r}var a=(e=wl(e)).length;if(ln(e)){var l=hn(e);a=l.length}if(n>=a)return e;var s=n-fn(r);if(s<1)return r;var c=l?Eo(l,0,s).join(""):e.slice(0,s);if(i===o)return c+r;if(l&&(s+=c.length-s),sl(i)){if(e.slice(s).search(i)){var u,d=c;for(i.global||(i=Oe(i.source,wl(ge.exec(i))+"g")),i.lastIndex=0;u=i.exec(d);)var p=u.index;c=c.slice(0,p===o?s:p)}}else if(e.indexOf(po(i),s)!=s){var f=c.lastIndexOf(i);f>-1&&(c=c.slice(0,f))}return c+r},Un.unescape=function(e){return(e=wl(e))&&X.test(e)?e.replace(Y,mn):e},Un.uniqueId=function(e){var t=++Ne;return wl(e)+t},Un.upperCase=Ql,Un.upperFirst=Jl,Un.each=wa,Un.eachRight=ka,Un.first=qi,us(Un,(Es={},kr(Un,(function(e,t){ze.call(Un.prototype,t)||(Es[t]=e)})),Es),{chain:!1}),Un.VERSION="4.17.21",Ct(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Un[e].placeholder=Un})),Ct(["drop","take"],(function(e,t){Kn.prototype[e]=function(n){n=n===o?1:xn(vl(n),0);var r=this.__filtered__&&!t?new Kn(this):this.clone();return r.__filtered__?r.__takeCount__=wn(n,r.__takeCount__):r.__views__.push({size:wn(n,m),type:e+(r.__dir__<0?"Right":"")}),r},Kn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Ct(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Kn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:di(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),Ct(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Kn.prototype[e]=function(){return this[n](1).value()[0]}})),Ct(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Kn.prototype[e]=function(){return this.__filtered__?new Kn(this):this[n](1)}})),Kn.prototype.compact=function(){return this.filter(as)},Kn.prototype.find=function(e){return this.filter(e).head()},Kn.prototype.findLast=function(e){return this.reverse().find(e)},Kn.prototype.invokeMap=Qr((function(e,t){return"function"==typeof e?new Kn(this):this.map((function(n){return Tr(n,e,t)}))})),Kn.prototype.reject=function(e){return this.filter(Ha(di(e)))},Kn.prototype.slice=function(e,t){e=vl(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Kn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==o&&(n=(t=vl(t))<0?n.dropRight(-t):n.take(t-e)),n)},Kn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Kn.prototype.toArray=function(){return this.take(m)},kr(Kn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=Un[r?"take"+("last"==t?"Right":""):t],a=r||/^find/.test(t);i&&(Un.prototype[t]=function(){var t=this.__wrapped__,l=r?[1]:arguments,s=t instanceof Kn,c=l[0],u=s||Za(t),d=function(e){var t=i.apply(Un,At([e],l));return r&&p?t[0]:t};u&&n&&"function"==typeof c&&1!=c.length&&(s=u=!1);var p=this.__chain__,f=!!this.__actions__.length,h=a&&!p,g=s&&!f;if(!a&&u){t=g?t:new Kn(this);var m=e.apply(t,l);return m.__actions__.push({func:ma,args:[d],thisArg:o}),new Wn(m,p)}return h&&g?e.apply(this,l):(m=this.thru(d),h?r?m.value()[0]:m.value():m)})})),Ct(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Pe[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Un.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(Za(o)?o:[],e)}return this[n]((function(n){return t.apply(Za(n)?n:[],e)}))}})),kr(Kn.prototype,(function(e,t){var n=Un[t];if(n){var r=n.name+"";ze.call(Ln,r)||(Ln[r]=[]),Ln[r].push({name:t,func:n})}})),Ln[Vo(o,2).name]=[{name:"wrapper",func:o}],Kn.prototype.clone=function(){var e=new Kn(this.__wrapped__);return e.__actions__=To(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=To(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=To(this.__views__),e},Kn.prototype.reverse=function(){if(this.__filtered__){var e=new Kn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Kn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Za(e),r=t<0,o=n?e.length:0,i=function(e,t,n){var r=-1,o=n.length;for(;++r<o;){var i=n[r],a=i.size;switch(i.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=wn(t,e+a);break;case"takeRight":e=xn(e,t-a)}}return{start:e,end:t}}(0,o,this.__views__),a=i.start,l=i.end,s=l-a,c=r?l:a-1,u=this.__iteratees__,d=u.length,p=0,f=wn(s,this.__takeCount__);if(!n||!r&&o==s&&f==s)return vo(e,this.__actions__);var h=[];e:for(;s--&&p<f;){for(var g=-1,m=e[c+=t];++g<d;){var v=u[g],b=v.iteratee,y=v.type,x=b(m);if(2==y)m=x;else if(!x){if(1==y)continue e;break e}}h[p++]=m}return h},Un.prototype.at=va,Un.prototype.chain=function(){return ga(this)},Un.prototype.commit=function(){return new Wn(this.value(),this.__chain__)},Un.prototype.next=function(){this.__values__===o&&(this.__values__=gl(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?o:this.__values__[this.__index__++]}},Un.prototype.plant=function(e){for(var t,n=this;n instanceof Gn;){var r=Ui(n);r.__index__=0,r.__values__=o,t?i.__wrapped__=r:t=r;var i=r;n=n.__wrapped__}return i.__wrapped__=e,t},Un.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Kn){var t=e;return this.__actions__.length&&(t=new Kn(this)),(t=t.reverse()).__actions__.push({func:ma,args:[ra],thisArg:o}),new Wn(t,this.__chain__)}return this.thru(ra)},Un.prototype.toJSON=Un.prototype.valueOf=Un.prototype.value=function(){return vo(this.__wrapped__,this.__actions__)},Un.prototype.first=Un.prototype.head,et&&(Un.prototype[et]=function(){return this}),Un}();ft._=vn,(r=function(){return vn}.call(t,n,t,e))===o||(e.exports=r)}.call(this)},4516:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,i){for(var a,l,s=o(e),c=1;c<arguments.length;c++){for(var u in a=Object(arguments[c]))n.call(a,u)&&(s[u]=a[u]);if(t){l=t(a);for(var d=0;d<l.length;d++)r.call(a,l[d])&&(s[l[d]]=a[l[d]])}}return s}},6094:(e,t,n)=>{"use strict";n(4516);var r=n(9787),o=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var i=Symbol.for;o=i("react.element"),t.Fragment=i("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l=Object.prototype.hasOwnProperty,s={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,i={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)l.call(t,r)&&!s.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:u,props:i,_owner:a.current}}t.jsx=c,t.jsxs=c},4512:(e,t,n)=>{"use strict";e.exports=n(6094)},8336:(e,t,n)=>{var r=n(487),o=n(4295);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},554:(e,t,n)=>{var r=n(487),o=n(9135);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},2789:(e,t,n)=>{var r=n(487),o=n(3729);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},5080:(e,t,n)=>{var r=n(487),o=n(4241);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},7225:(e,t,n)=>{var r=n(487),o=n(6029);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},778:(e,t,n)=>{var r=n(487),o=n(9609);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},4220:(e,t,n)=>{var r=n(487),o=n(2345);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},4678:(e,t,n)=>{var r=n(487),o=n(9393);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},1292:(e,t,n)=>{var r=n(487),o=n(6578);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},196:(e,t,n)=>{var r=n(487),o=n(9482);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},2205:(e,t,n)=>{var r=n(487),o=n(7955);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},1310:(e,t,n)=>{var r=n(487),o=n(3195);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},3922:(e,t,n)=>{var r=n(487),o=n(2978);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},7096:(e,t,n)=>{var r=n(487),o=n(1587);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},7117:(e,t,n)=>{var r=n(487),o=n(9478);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},1106:(e,t,n)=>{var r=n(487),o=n(7369);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},3336:(e,t,n)=>{var r=n(487),o=n(1434);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},4406:(e,t,n)=>{var r=n(487),o=n(8923);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},6043:(e,t,n)=>{var r=n(487),o=n(5605);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},694:(e,t,n)=>{var r=n(487),o=n(5644);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},8328:(e,t,n)=>{var r=n(487),o=n(6843);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},8051:(e,t,n)=>{var r=n(487),o=n(8461);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},4301:(e,t,n)=>{var r=n(487),o=n(9935);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},9966:(e,t,n)=>{var r=n(487),o=n(532);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},9295:(e,t,n)=>{var r=n(487),o=n(7589);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},9781:(e,t,n)=>{var r=n(487),o=n(8465);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},371:(e,t,n)=>{var r=n(487),o=n(5892);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},4623:(e,t,n)=>{var r=n(487),o=n(3874);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},1528:(e,t,n)=>{var r=n(487),o=n(2681);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},518:(e,t,n)=>{var r=n(487),o=n(6759);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},9757:(e,t,n)=>{var r=n(487),o=n(9650);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},5422:(e,t,n)=>{var r=n(487),o=n(2044);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},6781:(e,t,n)=>{var r=n(487),o=n(6626);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},580:(e,t,n)=>{var r=n(487),o=n(6359);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},4285:(e,t,n)=>{var r=n(487),o=n(9915);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},3313:(e,t,n)=>{var r=n(487),o=n(9310);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},8635:(e,t,n)=>{var r=n(487),o=n(6464);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]);var i={insert:"head",singleton:!1};r(o,i);e.exports=o.locals||{}},487:(e,t,n)=>{"use strict";var r,o=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},i=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),a=[];function l(e){for(var t=-1,n=0;n<a.length;n++)if(a[n].identifier===e){t=n;break}return t}function s(e,t){for(var n={},r=[],o=0;o<e.length;o++){var i=e[o],s=t.base?i[0]+t.base:i[0],c=n[s]||0,u="".concat(s," ").concat(c);n[s]=c+1;var d=l(u),p={css:i[1],media:i[2],sourceMap:i[3]};-1!==d?(a[d].references++,a[d].updater(p)):a.push({identifier:u,updater:m(p,t),references:1}),r.push(u)}return r}function c(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var o=n.nc;o&&(r.nonce=o)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var a=i(e.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(t)}return t}var u,d=(u=[],function(e,t){return u[e]=t,u.filter(Boolean).join("\n")});function p(e,t,n,r){var o=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=d(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}function f(e,t,n){var r=n.css,o=n.media,i=n.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var h=null,g=0;function m(e,t){var n,r,o;if(t.singleton){var i=g++;n=h||(h=c(t)),r=p.bind(null,n,i,!1),o=p.bind(null,n,i,!0)}else n=c(t),r=f.bind(null,n,t),o=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=o());var n=s(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var o=l(n[r]);a[o].references--}for(var i=s(e,t),c=0;c<n.length;c++){var u=l(n[c]);0===a[u].references&&(a[u].updater(),a.splice(u,1))}n=i}}}},9713:e=>{e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},6479:(e,t,n)=>{var r=n(7316);e.exports=function(e,t){if(null==e)return{};var n,o,i=r(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}},7316:e=>{e.exports=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}},4295:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>h});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i),l=n(1667),s=n.n(l),c=new URL(n(1652),n.b),u=new URL(n(2787),n.b),d=a()(o()),p=s()(c),f=s()(u);d.push([e.id,'@font-face{font-family:"Virgil";src:url('+p+');font-display:swap}@font-face{font-family:"Cascadia";src:url('+f+");font-display:swap}",""]);const h=d},9135:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".excalidraw .ActiveFile .ActiveFile__fileName{display:flex;align-items:center}.excalidraw .ActiveFile .ActiveFile__fileName span{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:9.3em}.excalidraw .ActiveFile .ActiveFile__fileName svg{width:1.15em;margin-inline-end:.3em;transform:scaleY(0.9)}",""]);const l=a},3729:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Avatar{width:2.5rem;height:2.5rem;border-radius:50%;display:flex;justify-content:center;align-items:center;color:#fff;cursor:pointer;font-size:.8rem;font-weight:500;overflow:hidden}.excalidraw .Avatar img{width:100%;height:100%}",""]);const l=a},4241:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Card{display:flex;flex-direction:column;align-items:center;max-width:290px;margin:1em;text-align:center}.excalidraw .Card .Card-icon{font-size:2.6em;display:flex;flex:0 0 auto;padding:1.4rem;border-radius:50%;background:var(--card-color);color:#fff}.excalidraw .Card .Card-icon svg{width:2.8rem;height:2.8rem}.excalidraw .Card .Card-details{font-size:.96em;min-height:90px;padding:0 1em;margin-bottom:auto}.excalidraw .Card .Card-button.ToolIcon_type_button{height:2.5rem;margin-top:1em;margin-bottom:.3em;background-color:var(--card-color)}.excalidraw .Card .Card-button.ToolIcon_type_button:hover{background-color:var(--card-color-darker)}.excalidraw .Card .Card-button.ToolIcon_type_button:active{background-color:var(--card-color-darkest)}.excalidraw .Card .Card-button.ToolIcon_type_button .ToolIcon__label{color:#fff}.excalidraw .Card .Card-button.ToolIcon_type_button .Spinner{--spinner-color: #fff}",""]);const l=a},6029:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Checkbox{margin:4px .3em;display:flex;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.excalidraw .Checkbox:hover:not(.is-checked) .Checkbox-box:not(:focus){box-shadow:0 0 0 2px #4dabf7}.excalidraw .Checkbox:hover:not(.is-checked) .Checkbox-box:not(:focus) svg{display:block;opacity:.3}.excalidraw .Checkbox:active .Checkbox-box{box-shadow:0 0 2px 1px inset #1c7ed6 !important}.excalidraw .Checkbox:hover .Checkbox-box{background-color:rgba(208,235,255,.2)}.excalidraw .Checkbox.is-checked .Checkbox-box{background-color:#d0ebff}.excalidraw .Checkbox.is-checked .Checkbox-box svg{display:block}.excalidraw .Checkbox.is-checked:hover .Checkbox-box{background-color:#a5d8ff}.excalidraw .Checkbox .Checkbox-box{width:22px;height:22px;padding:0;flex:0 0 auto;margin:0 1em;display:flex;align-items:center;justify-content:center;box-shadow:0 0 0 2px #1c7ed6;background-color:transparent;border-radius:4px;color:#1c7ed6}.excalidraw .Checkbox .Checkbox-box:focus{box-shadow:0 0 0 3px #1c7ed6}.excalidraw .Checkbox .Checkbox-box svg{display:none;width:16px;height:16px;stroke-width:3px}.excalidraw .Checkbox .Checkbox-label{display:flex;align-items:center}.excalidraw .Checkbox .excalidraw-tooltip-icon{width:1em;height:1em}",""]);const l=a},9609:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .CollabButton.is-collaborating{background-color:var(--button-special-active-bg-color)}.excalidraw .CollabButton.is-collaborating .ToolIcon__icon svg,.excalidraw .CollabButton.is-collaborating .ToolIcon__label{color:var(--icon-green-fill-color)}.excalidraw .CollabButton-collaborators{min-width:1em;position:absolute;bottom:-5px;padding:3px;border-radius:50%;background-color:#40c057;color:#fff;font-size:.7em;font-family:var(--ui-font)}:root[dir=ltr] .excalidraw .CollabButton-collaborators{right:-5px}:root[dir=rtl] .excalidraw .CollabButton-collaborators{left:-5px}",""]);const l=a},2345:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>p});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i),l=n(1667),s=n.n(l),c=new URL(n(9669),n.b),u=a()(o()),d=s()(c);u.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .color-picker{background:var(--popup-bg-color);border:0 solid rgba(255,255,255,.25);box-shadow:rgba(0,0,0,.25) 0 1px 4px;border-radius:4px;position:absolute}:root[dir=ltr] .excalidraw .color-picker{left:-5.5px}:root[dir=rtl] .excalidraw .color-picker{right:-5.5px}.excalidraw .color-picker-control-container{display:grid;grid-template-columns:auto 1fr;align-items:center}.excalidraw .color-picker-triangle{width:0;height:0;border-style:solid;border-width:0 9px 10px;border-color:transparent transparent var(--popup-bg-color);position:absolute;top:-10px}:root[dir=ltr] .excalidraw .color-picker-triangle{left:12px}:root[dir=rtl] .excalidraw .color-picker-triangle{right:12px}.excalidraw .color-picker-triangle-shadow{border-color:transparent transparent rgba(0,0,0,.1);top:-11px}.excalidraw .color-picker-content{padding:.5rem;display:grid;grid-template-columns:repeat(5, auto);grid-gap:.5rem;border-radius:4px}.excalidraw .color-picker-content:focus{outline:none;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .color-picker-content .color-input-container{grid-column:1/span 5}.excalidraw .color-picker-swatch{position:relative;height:1.875rem;width:1.875rem;cursor:pointer;border-radius:4px;margin:0;box-sizing:border-box;border:1px solid #ddd;background-color:currentColor !important;filter:var(--theme-filter)}.excalidraw .color-picker-swatch:focus{box-shadow:0 0 4px 1px currentColor;border-color:var(--select-highlight-color)}.excalidraw .color-picker-transparent{border-radius:4px;box-shadow:rgba(0,0,0,.1) 0 0 0 1px inset;position:absolute;top:0;right:0;bottom:0;left:0}.excalidraw .color-picker-transparent,.excalidraw .color-picker-label-swatch{background:url("+d+') left center}.excalidraw .color-picker-hash{background:var(--input-border-color);height:1.875rem;width:1.875rem;color:var(--input-label-color);display:flex;align-items:center;justify-content:center;position:relative}:root[dir=ltr] .excalidraw .color-picker-hash{border-radius:4px 0 0 4px}:root[dir=rtl] .excalidraw .color-picker-hash{border-radius:0 4px 4px 0}.excalidraw .color-input-container:focus-within .color-picker-hash{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .color-input-container:focus-within .color-picker-hash::before,.excalidraw .color-input-container:focus-within .color-picker-hash::after{content:"";width:1px;height:100%;position:absolute;top:0}.excalidraw .color-input-container:focus-within .color-picker-hash::before{background:var(--input-border-color)}:root[dir=ltr] .excalidraw .color-input-container:focus-within .color-picker-hash::before{right:-1px}:root[dir=rtl] .excalidraw .color-input-container:focus-within .color-picker-hash::before{left:-1px}.excalidraw .color-input-container:focus-within .color-picker-hash::after{background:var(--input-bg-color)}:root[dir=ltr] .excalidraw .color-input-container:focus-within .color-picker-hash::after{right:-2px}:root[dir=rtl] .excalidraw .color-input-container:focus-within .color-picker-hash::after{left:-2px}.excalidraw .color-input-container{display:flex}.excalidraw .color-picker-input{width:11ch;margin:0;font-size:1rem;background-color:var(--input-bg-color);color:var(--text-primary-color);border:0;outline:none;height:1.75em;box-shadow:var(--input-border-color) 0 0 0 1px inset;float:left;padding:1px;padding-inline-start:.5em;-webkit-appearance:none;appearance:none}:root[dir=ltr] .excalidraw .color-picker-input{border-radius:0 4px 4px 0}:root[dir=rtl] .excalidraw .color-picker-input{border-radius:4px 0 0 4px}.excalidraw .color-picker-label-swatch{height:1.875rem;width:1.875rem;margin-inline-end:.25rem;border:1px solid #dee2e6;position:relative;overflow:hidden;background-color:transparent !important;filter:var(--theme-filter)}.excalidraw .color-picker-label-swatch:after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;background:var(--swatch-color)}.excalidraw .color-picker-keybinding{position:absolute;bottom:2px;font-size:.7em}:root[dir=ltr] .excalidraw .color-picker-keybinding{right:2px}:root[dir=rtl] .excalidraw .color-picker-keybinding{left:2px}.excalidraw--mobile.excalidraw .color-picker-keybinding{display:none}.excalidraw .color-picker-type-canvasBackground .color-picker-keybinding{color:#aaa}.excalidraw .color-picker-type-elementBackground .color-picker-keybinding{color:#fff}.excalidraw .color-picker-swatch[aria-label=transparent] .color-picker-keybinding{color:#aaa}.excalidraw .color-picker-type-elementStroke .color-picker-keybinding{color:#d4d4d4}.excalidraw.theme--dark .color-picker-type-elementBackground .color-picker-keybinding{color:#000}.excalidraw.theme--dark .color-picker-swatch[aria-label=transparent] .color-picker-keybinding{color:#000}',""]);const p=u},9393:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .confirm-dialog-buttons{display:flex;padding:.2rem 0;justify-content:flex-end}.excalidraw .confirm-dialog .ToolIcon__icon{min-width:2.5rem;width:auto;font-size:1rem}.excalidraw .confirm-dialog .ToolIcon_type_button{margin-left:.8rem;padding:0 .5rem}.excalidraw .confirm-dialog__content{font-size:1rem}.excalidraw .confirm-dialog--confirm.ToolIcon_type_button{background-color:#fa5252}.excalidraw .confirm-dialog--confirm.ToolIcon_type_button:hover{background-color:#e03131}.excalidraw .confirm-dialog--confirm.ToolIcon_type_button .ToolIcon__icon{color:#fff}",""]);const l=a},6578:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,':export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .context-menu{position:relative;border-radius:4px;box-shadow:0 3px 10px rgba(0,0,0,.2);padding:0;list-style:none;-webkit-user-select:none;user-select:none;margin:-0.25rem 0 0 .125rem;padding:.5rem 0;background-color:var(--popup-secondary-bg-color);border:1px solid var(--button-gray-3);cursor:default}.excalidraw .context-menu button{color:var(--popup-text-color)}.excalidraw .context-menu-option{position:relative;width:100%;min-width:9.5rem;margin:0;padding:.25rem 1rem .25rem 1.25rem;text-align:start;border-radius:0;background-color:transparent;border:none;white-space:nowrap;display:grid;grid-template-columns:1fr .2fr;align-items:center}.excalidraw .context-menu-option.checkmark::before{position:absolute;left:6px;margin-bottom:1px;content:"✓"}.excalidraw .context-menu-option.dangerous .context-menu-option__label{color:#f03e3e}.excalidraw .context-menu-option .context-menu-option__label{justify-self:start;margin-inline-end:20px}.excalidraw .context-menu-option .context-menu-option__shortcut{justify-self:end;opacity:.6;font-family:inherit;font-size:.7rem}.excalidraw .context-menu-option:hover{color:var(--popup-bg-color);background-color:var(--select-highlight-color)}.excalidraw .context-menu-option:hover.dangerous{background-color:#fa5252}.excalidraw .context-menu-option:hover.dangerous .context-menu-option__label{color:var(--popup-bg-color)}.excalidraw .context-menu-option:focus{z-index:1}.excalidraw--mobile.excalidraw .context-menu-option{display:block}.excalidraw--mobile.excalidraw .context-menu-option .context-menu-option__label{margin-inline-end:0}.excalidraw--mobile.excalidraw .context-menu-option .context-menu-option__shortcut{display:none}.excalidraw .context-menu-option-separator{border:none;border-top:1px solid #adb5bd}',""]);const l=a},9482:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Dialog{-webkit-user-select:text;user-select:text;cursor:auto}.excalidraw .Dialog__title{display:grid;align-items:center;margin-top:0;grid-template-columns:1fr calc(var(--space-factor)*7);grid-gap:var(--metric);padding:calc(var(--space-factor)*2);text-align:center;font-variant:small-caps;font-size:1.2em}.excalidraw .Dialog__titleContent{flex:1}.excalidraw .Dialog .Modal__close{color:var(--icon-fill-color);margin:0}.excalidraw .Dialog__content{padding:0 16px 16px}.excalidraw--mobile.excalidraw .Dialog{--metric: calc(var(--space-factor) * 4);--inset-left: max(var(--metric), var(--sal));--inset-right: max(var(--metric), var(--sar))}.excalidraw--mobile.excalidraw .Dialog__title{grid-template-columns:calc(var(--space-factor)*7) 1fr calc(var(--space-factor)*7);position:-webkit-sticky;position:sticky;top:0;padding:calc(var(--space-factor)*2);background:var(--island-bg-color);font-size:1.25em;box-sizing:border-box;border-bottom:1px solid var(--button-gray-2);z-index:1}.excalidraw--mobile.excalidraw .Dialog__titleContent{text-align:center}.excalidraw--mobile.excalidraw .Dialog .Island{width:100vw;height:100%;box-sizing:border-box;overflow-y:auto;padding-left:max(calc(var(--padding) * var(--space-factor)), var(--sal));padding-right:max(calc(var(--padding) * var(--space-factor)), var(--sar));padding-bottom:max(calc(var(--padding) * var(--space-factor)), var(--sab))}.excalidraw--mobile.excalidraw .Dialog .Modal__close{order:-1}",""]);const l=a},7955:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>p});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i),l=n(1667),s=n.n(l),c=new URL(n(9669),n.b),u=a()(o()),d=s()(c);u.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .ExportDialog__preview{--preview-padding: calc(var(--space-factor) * 4);background:url("+d+") left center;text-align:center;padding:var(--preview-padding);margin-bottom:calc(var(--space-factor)*3)}.excalidraw .ExportDialog__preview canvas{max-width:calc(100% - var(--preview-padding)*2);max-height:25rem}.excalidraw.theme--dark .ExportDialog__preview canvas{filter:none}.excalidraw .ExportDialog__actions{width:100%;display:flex;grid-gap:calc(var(--space-factor)*2);align-items:top;justify-content:space-between}.excalidraw--mobile.excalidraw .ExportDialog{display:flex;flex-direction:column}.excalidraw--mobile.excalidraw .ExportDialog__actions{flex-direction:column;align-items:center}.excalidraw--mobile.excalidraw .ExportDialog__actions>*{margin-bottom:calc(var(--space-factor)*3)}.excalidraw--mobile.excalidraw .ExportDialog__preview canvas{max-height:30vh}.excalidraw--mobile.excalidraw .ExportDialog__dialog,.excalidraw--mobile.excalidraw .ExportDialog__dialog .Island{height:100%;box-sizing:border-box}.excalidraw--mobile.excalidraw .ExportDialog__dialog .Island{overflow-y:auto}.excalidraw .ExportDialog--json .ExportDialog-cards{display:grid;grid-template-columns:repeat(auto-fit, minmax(200px, 1fr));justify-items:center;row-gap:2em}@media(max-width: 460px){.excalidraw .ExportDialog--json .ExportDialog-cards{grid-template-columns:repeat(auto-fit, minmax(240px, 1fr))}.excalidraw .ExportDialog--json .ExportDialog-cards .Card-details{min-height:40px}}.excalidraw .ExportDialog--json .ExportDialog-cards .ProjectName{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;margin:1em auto;align-items:flex-start;flex-direction:column}.excalidraw .ExportDialog--json .ExportDialog-cards .ProjectName .TextInput{width:auto}.excalidraw .ExportDialog--json .ExportDialog-cards .ProjectName-label{margin:.625em 0;font-weight:bold}.excalidraw button.ExportDialog-imageExportButton{width:5rem;height:5rem;margin:0 .2em;border-radius:1rem;background-color:var(--button-color);box-shadow:0 3px 5px -1px rgba(0,0,0,.28),0 6px 10px 0 rgba(0,0,0,.14);font-family:Cascadia;font-size:1.8em;color:#fff}.excalidraw button.ExportDialog-imageExportButton:hover{background-color:var(--button-color-darker)}.excalidraw button.ExportDialog-imageExportButton:active{background-color:var(--button-color-darkest);box-shadow:none}.excalidraw button.ExportDialog-imageExportButton svg{width:.9em}",""]);const p=u},3195:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".excalidraw .FixedSideContainer{position:absolute;pointer-events:none}.excalidraw .FixedSideContainer>*{pointer-events:all}.excalidraw .FixedSideContainer_side_top{left:var(--space-factor);top:var(--space-factor);right:var(--space-factor);z-index:2}.excalidraw .FixedSideContainer_side_top.zen-mode{right:42px}",""]);const l=a},2978:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .HelpDialog h3{border-bottom:1px solid var(--button-gray-2);padding-bottom:4px}.excalidraw .HelpDialog--island{border:1px solid var(--button-gray-2);margin-bottom:16px}.excalidraw .HelpDialog--island-title{margin:0;padding:4px;background-color:var(--button-gray-1);text-align:center}.excalidraw .HelpDialog--shortcut{border-top:1px solid var(--button-gray-2)}.excalidraw .HelpDialog--key{word-break:keep-all;border:1px solid var(--button-gray-2);padding:2px 8px;margin:auto 4px;background-color:var(--button-gray-1);border-radius:2px;font-size:.8em;min-height:26px;box-sizing:border-box;display:flex;align-items:center;font-family:inherit}.excalidraw .HelpDialog--header{display:flex;flex-direction:row;justify-content:space-evenly;margin-bottom:32px;padding-bottom:16px}.excalidraw .HelpDialog--btn{border:1px solid var(--link-color);padding:8px 32px;border-radius:4px}.excalidraw .HelpDialog--btn:hover{text-decoration:none}",""]);const l=a},1587:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .HintViewer{pointer-events:none;box-sizing:border-box;position:absolute;display:flex;justify-content:center;left:0;top:100%;max-width:100%;width:100%;margin-top:6px;text-align:center;color:#868e96;font-size:.8rem}.excalidraw--mobile.excalidraw .HintViewer{position:static;padding-right:2em}.excalidraw .HintViewer>span{padding:.2rem .4rem;background-color:var(--overlay-bg-color);border-radius:4px}",""]);const l=a},9478:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,':export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .picker-container{display:inline-block;box-sizing:border-box;margin-right:.25rem}.excalidraw .picker{background:var(--popup-bg-color);border:0 solid rgba(255,255,255,.25);box-shadow:rgba(0,0,0,.25) 0 1px 4px;border-radius:4px;position:absolute}.excalidraw .picker-container button,.excalidraw .picker button{position:relative;display:flex;align-items:center;justify-content:center}.excalidraw .picker-container button:focus,.excalidraw .picker button:focus{outline:transparent;background-color:var(--button-gray-2)}.excalidraw .picker-container button:focus svg,.excalidraw .picker button:focus svg{opacity:1}.excalidraw .picker-container button:hover,.excalidraw .picker button:hover{background-color:var(--button-gray-2)}.excalidraw .picker-container button:active,.excalidraw .picker button:active{background-color:var(--button-gray-3)}.excalidraw .picker-container button:disabled,.excalidraw .picker button:disabled{cursor:not-allowed}.excalidraw .picker-container button svg,.excalidraw .picker button svg{margin:0;width:36px;height:18px;opacity:.6;pointer-events:none}.excalidraw .picker button{padding:.25rem .28rem .35rem .25rem}.excalidraw .picker-triangle{width:0;height:0;position:relative;top:-10px;z-index:10}:root[dir=ltr] .excalidraw .picker-triangle{left:12px}:root[dir=rtl] .excalidraw .picker-triangle{right:12px}.excalidraw .picker-triangle:before{content:"";position:absolute;border-style:solid;border-width:0 9px 10px;border-color:transparent transparent rgba(0,0,0,.1);top:-1px}.excalidraw .picker-triangle:after{content:"";position:absolute;border-style:solid;border-width:0 9px 10px;border-color:transparent transparent var(--popup-bg-color)}.excalidraw .picker-content{padding:.5rem;display:grid;grid-template-columns:repeat(3, auto);grid-gap:.5rem;border-radius:4px}:root[dir=rtl] .excalidraw .picker-content{padding:.4rem}.excalidraw .picker-keybinding{position:absolute;bottom:2px;font-size:.7em;color:var(--keybinding-color)}:root[dir=ltr] .excalidraw .picker-keybinding{right:2px}:root[dir=rtl] .excalidraw .picker-keybinding{left:2px}.excalidraw--mobile.excalidraw .picker-keybinding{display:none}.excalidraw .picker-type-canvasBackground .picker-keybinding{color:#aaa}.excalidraw .picker-type-elementBackground .picker-keybinding{color:#fff}.excalidraw .picker-swatch[aria-label=transparent] .picker-keybinding{color:#aaa}.excalidraw .picker-type-elementStroke .picker-keybinding{color:#d4d4d4}.excalidraw.theme--dark .picker-type-elementBackground .picker-keybinding{color:#000}.excalidraw.theme--dark .picker-swatch[aria-label=transparent] .picker-keybinding{color:#000}',""]);const l=a},7369:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".excalidraw .Island{--padding: 0;background-color:var(--island-bg-color);box-shadow:var(--shadow-island);border-radius:4px;padding:calc(var(--padding)*var(--space-factor));position:relative}.excalidraw .Island.zen-mode{box-shadow:none}.excalidraw .Island::-webkit-scrollbar{width:10px}.excalidraw .Island::-webkit-scrollbar-track{background-color:transparent}.excalidraw .Island::-webkit-scrollbar-thumb{background-color:var(--color-scrollbar-thumb)}.excalidraw .Island::-webkit-scrollbar-thumb:hover{background-color:var(--color-scrollbar-thumb-hover)}.excalidraw .Island::-webkit-scrollbar-thumb:active{background-color:var(--color-scrollbar-thumb-active)}.excalidraw .App-menu_top .Stack_vertical .Island{min-width:216px}.excalidraw .App-menu_top .Stack_vertical .Stack_horizontal{justify-content:center !important}.excalidraw.excalidraw--view-mode .App-menu_top .Stack_vertical .Island{min-width:auto}",""]);const l=a},1434:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".excalidraw .layer-ui__wrapper{z-index:var(--zIndex-layerUI)}.excalidraw .layer-ui__wrapper__top-right{display:flex}.excalidraw .layer-ui__wrapper__footer{width:100%}.excalidraw .layer-ui__wrapper__footer-right{z-index:100;display:flex}.excalidraw .layer-ui__wrapper .zen-mode-transition{transition:transform .5s ease-in-out}:root[dir=ltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-left{transform:translate(-999px, 0)}:root[dir=ltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-right{transform:translate(999px, 0)}:root[dir=rtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-left{transform:translate(999px, 0)}:root[dir=rtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-right{transform:translate(-999px, 0)}:root[dir=ltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-left{transform:translate(-76px, 0)}:root[dir=rtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-left{transform:translate(76px, 0)}.excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-bottom{transform:translate(0, 92px)}.excalidraw .layer-ui__wrapper .disable-zen-mode{height:30px;position:absolute;bottom:10px;font-size:10px;padding:10px;font-weight:500;opacity:0;visibility:hidden;transition:visibility 0s linear 0s,opacity .5s}[dir=ltr] .excalidraw .layer-ui__wrapper .disable-zen-mode{right:15px}[dir=rtl] .excalidraw .layer-ui__wrapper .disable-zen-mode{left:15px}.excalidraw .layer-ui__wrapper .disable-zen-mode--visible{opacity:1;visibility:visible;transition:visibility 0s linear 300ms,opacity .5s;transition-delay:.8s}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-center{pointer-events:none}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-center>*{pointer-events:all}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-left,.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-right,.excalidraw .layer-ui__wrapper .disable-zen-mode--visible{pointer-events:all}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-left{margin-bottom:.2em}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-right{margin-top:auto;margin-bottom:auto;margin-inline-end:1em}",""]);const l=a},8923:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".excalidraw .layer-ui__library{margin:auto;display:flex;align-items:center;justify-content:center}.excalidraw .layer-ui__library .layer-ui__library-header{display:flex;align-items:center;width:100%;margin:2px 0}.excalidraw .layer-ui__library .layer-ui__library-header button{margin:0 2px}.excalidraw .layer-ui__library .layer-ui__library-header a{margin-inline-start:auto;padding-inline-end:18px;white-space:nowrap}.excalidraw .layer-ui__library-message{padding:10px 20px;max-width:200px}.excalidraw .publish-library-success .Dialog__content{display:flex;flex-direction:column}.excalidraw .publish-library-success-close.ToolIcon_type_button{background-color:#228be6;align-self:flex-end}.excalidraw .publish-library-success-close.ToolIcon_type_button:hover{background-color:#1971c2}.excalidraw .publish-library-success-close.ToolIcon_type_button .ToolIcon__icon{width:auto;font-size:1rem;color:#fff;padding:0 .5rem}",""]);const l=a},5605:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".excalidraw .library-menu-items-container .library-actions{display:flex}.excalidraw .library-menu-items-container .library-actions button .library-actions-counter{position:absolute;right:2px;bottom:2px;border-radius:50%;width:1em;height:1em;padding:1px;font-size:.7rem;background:#fff}.excalidraw .library-menu-items-container .library-actions--remove{background-color:#f03e3e}.excalidraw .library-menu-items-container .library-actions--remove:hover{background-color:#e03131}.excalidraw .library-menu-items-container .library-actions--remove:active{background-color:#c92a2a}.excalidraw .library-menu-items-container .library-actions--remove svg{color:#fff}.excalidraw .library-menu-items-container .library-actions--remove .library-actions-counter{color:#f03e3e}.excalidraw .library-menu-items-container .library-actions--export{background-color:#94d82d}.excalidraw .library-menu-items-container .library-actions--export:hover{background-color:#74b816}.excalidraw .library-menu-items-container .library-actions--export:active{background-color:#66a80f}.excalidraw .library-menu-items-container .library-actions--export svg{color:#fff}.excalidraw .library-menu-items-container .library-actions--export .library-actions-counter{color:#94d82d}.excalidraw .library-menu-items-container .library-actions--publish{background-color:#15aabf}.excalidraw .library-menu-items-container .library-actions--publish:hover{background-color:#1098ad}.excalidraw .library-menu-items-container .library-actions--publish:active{background-color:#0b7285}.excalidraw .library-menu-items-container .library-actions--publish svg{color:#fff}.excalidraw .library-menu-items-container .library-actions--publish label{margin-left:-0.2em;margin-right:1.1em;color:#fff;font-size:.86em}.excalidraw .library-menu-items-container .library-actions--publish .library-actions-counter{color:#15aabf}.excalidraw .library-menu-items-container .library-actions--load{background-color:#228be6}.excalidraw .library-menu-items-container .library-actions--load:hover{background-color:#1c7ed6}.excalidraw .library-menu-items-container .library-actions--load:active{background-color:#1864ab}.excalidraw .library-menu-items-container .library-actions--load svg{color:#fff}.excalidraw .library-menu-items-container__items{max-height:50vh;overflow:auto;margin-top:.5rem}.excalidraw .library-menu-items-container .separator{font-weight:500;font-size:.9rem;margin:.6em .2em;color:var(--text-primary-color)}",""]);const l=a},5644:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .library-unit{align-items:center;border:1px solid var(--button-gray-2);display:flex;justify-content:center;position:relative;width:63px;height:63px}.excalidraw .library-unit--hover{box-shadow:inset 0px 0px 0px 2px #339af0;border-color:#339af0}.excalidraw .library-unit--selected{box-shadow:inset 0px 0px 0px 2px #1971c2;border-color:#1971c2}.excalidraw.theme--dark .library-unit{border-color:#303030}.excalidraw .library-unit__dragger{display:flex;height:100%;width:100%}.excalidraw .library-unit__dragger>svg{filter:var(--theme-filter);flex-grow:1;max-height:100%;max-width:100%}.excalidraw .library-unit__checkbox-container,.excalidraw .library-unit__checkbox-container:hover,.excalidraw .library-unit__checkbox-container:active{align-items:center;background:none;border:none;color:var(--icon-fill-color);display:flex;justify-content:center;margin:0;padding:.5rem;position:absolute;left:2rem;bottom:2rem;cursor:pointer}.excalidraw .library-unit__checkbox-container input,.excalidraw .library-unit__checkbox-container:hover input,.excalidraw .library-unit__checkbox-container:active input{cursor:pointer}.excalidraw .library-unit__checkbox{position:absolute;left:2.3rem;bottom:2.3rem}.excalidraw .library-unit__checkbox .Checkbox-box{width:13px;height:13px;border-radius:2px;margin:.5em .5em .2em .2em;background-color:#d0ebff}.excalidraw .library-unit__checkbox.Checkbox:hover .Checkbox-box{background-color:#a5d8ff}.excalidraw .library-unit__removeFromLibrary>svg{height:16px;width:16px}.excalidraw .library-unit__adder{transform:scale(1);animation:library-unit__adder-animation 1s ease-in infinite}.excalidraw .library-unit__adder{position:absolute;left:40%;top:40%;width:2rem;height:2rem;margin-left:-10px;margin-top:-10px;pointer-events:none}.excalidraw .library-unit:hover .library-unit__adder{fill:#1c7ed6}.excalidraw .library-unit:active .library-unit__adder{animation:none;transform:scale(0.8);fill:#000}.excalidraw .library-unit__active{cursor:pointer}@keyframes library-unit__adder-animation{0%{transform:scale(0.85)}50%{transform:scale(1)}100%{transform:scale(0.85)}}",""]);const l=a},6843:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw.excalidraw-modal-container{position:absolute;z-index:10}.excalidraw .Modal{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;overflow:auto;padding:calc(var(--space-factor)*10)}.excalidraw .Modal__background{position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;background-color:rgba(0,0,0,.7)}.excalidraw .Modal__content{position:relative;z-index:2;width:100%;max-width:var(--max-width);max-height:100%;opacity:0;transform:translateY(10px);animation:Modal__content_fade-in .1s ease-out .05s forwards;position:relative;overflow-y:auto;background:var(--island-bg-color);border:1px solid var(--dialog-border-color);box-shadow:0 2px 10px rgba(0,0,0,.25);border-radius:6px;box-sizing:border-box}.excalidraw .Modal__content:focus{outline:none}.excalidraw--mobile.excalidraw .Modal__content{max-width:100%;border:0;border-radius:0}@keyframes Modal__content_fade-in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.excalidraw .Modal__close{width:calc(var(--space-factor)*7);height:calc(var(--space-factor)*7);display:flex;align-items:center;justify-content:center}.excalidraw .Modal__close svg{height:calc(var(--space-factor)*5)}.excalidraw--mobile.excalidraw .Modal{padding:0}.excalidraw--mobile.excalidraw .Modal__content{position:absolute;top:0;left:0;right:0;bottom:0}",""]);const l=a},8461:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw--mobile.excalidraw .PasteChartDialog .Island{display:flex;flex-direction:column}.excalidraw .PasteChartDialog .container{display:flex;align-items:center;justify-content:space-around;flex-wrap:wrap}.excalidraw--mobile.excalidraw .PasteChartDialog .container{flex-direction:column;justify-content:center}.excalidraw .PasteChartDialog .ChartPreview{margin:8px;text-align:center;width:192px;height:128px;border-radius:2px;padding:1px;border:1px solid #ced4da;display:flex;align-items:center;justify-content:center;background:transparent}.excalidraw .PasteChartDialog .ChartPreview div{display:inline-block}.excalidraw .PasteChartDialog .ChartPreview svg{max-height:120px;max-width:186px}.excalidraw .PasteChartDialog .ChartPreview:hover{padding:0;border:2px solid #339af0}",""]);const l=a},9935:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".excalidraw .popover{position:absolute;z-index:10}",""]);const l=a},532:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".ProjectName{margin:auto;display:flex;align-items:center}.ProjectName .TextInput{height:calc(1rem - 3px);width:200px;overflow:hidden;text-align:center;margin-left:8px;text-overflow:ellipsis}.ProjectName .TextInput--readonly{background:none;border:none;width:auto;max-width:200px;padding-left:2px}.ProjectName .TextInput--readonly:hover{background:none}",""]);const l=a},7589:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .publish-library__fields{display:flex;flex-direction:column}.excalidraw .publish-library__fields label{padding:1em;display:flex;justify-content:space-between;align-items:center}.excalidraw .publish-library__fields label span{font-weight:500;font-size:1rem;color:#868e96}.excalidraw .publish-library__fields label input,.excalidraw .publish-library__fields label textarea{width:70%;padding:.6em;font-family:var(--ui-font)}.excalidraw .publish-library__fields label .required{color:#e03131;margin:.2rem}.excalidraw .publish-library__buttons{display:flex;padding:.2rem 0;justify-content:flex-end}.excalidraw .publish-library__buttons .ToolIcon__icon{min-width:2.5rem;width:auto;font-size:1rem}.excalidraw .publish-library__buttons .ToolIcon_type_button{margin-left:1rem;padding:0 .5rem}.excalidraw .publish-library__buttons--confirm.ToolIcon_type_button{background-color:#228be6}.excalidraw .publish-library__buttons--confirm.ToolIcon_type_button:hover{background-color:#1971c2}.excalidraw .publish-library__buttons--cancel.ToolIcon_type_button{background-color:#adb5bd}.excalidraw .publish-library__buttons--cancel.ToolIcon_type_button:hover{background-color:#868e96}.excalidraw .publish-library__buttons .ToolIcon__icon{color:#fff}.excalidraw .publish-library__buttons .ToolIcon__icon .Spinner{--spinner-color: #fff}.excalidraw .publish-library__buttons .ToolIcon__icon .Spinner svg{padding:.5rem}.excalidraw .publish-library .selected-library-items{display:flex;padding:0 .8rem;flex-wrap:wrap}.excalidraw .publish-library .selected-library-items .single-library-item-wrapper{width:9rem}.excalidraw .publish-library-note{padding:1em;font-style:italic;font-size:14px;display:block}",""]);const l=a},8465:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .single-library-item{position:relative}.excalidraw .single-library-item__svg{width:7.5rem;height:7.5rem;border:1px solid var(--button-gray-2);margin:.3rem}.excalidraw .single-library-item__svg svg{width:100%;height:100%}.excalidraw .single-library-item .ToolIcon__icon{background-color:#fff;width:auto;height:auto;margin:0 .5rem}.excalidraw .single-library-item .ToolIcon,.excalidraw .single-library-item .ToolIcon_type_button:hover{background-color:#fff}.excalidraw .single-library-item .required,.excalidraw .single-library-item .error{color:#e03131;font-weight:bold;font-size:1rem;margin:.2rem}.excalidraw .single-library-item .error{font-weight:500;margin:0;padding:.3em 0}.excalidraw .single-library-item--remove{position:absolute;top:.2rem;right:1.3rem}.excalidraw .single-library-item--remove .ToolIcon__icon{margin:0}.excalidraw .single-library-item--remove .ToolIcon__icon{background-color:#fa5252}.excalidraw .single-library-item--remove .ToolIcon__icon:hover{background-color:#f03e3e}.excalidraw .single-library-item--remove .ToolIcon__icon:active{background-color:#e03131}.excalidraw .single-library-item--remove svg{color:#fff;padding:.26rem;border-radius:.3em;width:1rem;height:1rem}",""]);const l=a},5892:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".excalidraw .Spinner{display:flex;align-items:center;justify-content:center;height:100%;margin-left:auto;margin-right:auto;--spinner-color: var(--icon-fill-color)}.excalidraw .Spinner svg{animation:rotate 1.6s linear infinite;transform-origin:center center}.excalidraw .Spinner circle{stroke:var(--spinner-color);animation:dash 1.6s linear 0s infinite;stroke-linecap:round}@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,300;stroke-dashoffset:0}50%{stroke-dasharray:150,300;stroke-dashoffset:-200}100%{stroke-dasharray:1,300;stroke-dashoffset:-280}}",""]);const l=a},3874:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".excalidraw .Stack{--gap: 0;display:grid;gap:calc(var(--space-factor)*var(--gap))}.excalidraw .Stack_vertical{grid-template-columns:auto;grid-auto-flow:row;grid-auto-rows:-webkit-min-content;grid-auto-rows:min-content}.excalidraw .Stack_horizontal{grid-template-rows:auto;grid-auto-flow:column;grid-auto-columns:-webkit-min-content;grid-auto-columns:min-content}",""]);const l=a},2681:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Stats{position:absolute;top:64px;right:12px;font-size:12px;z-index:10}.excalidraw .Stats h3{margin:0 24px 8px 0;white-space:nowrap}.excalidraw .Stats .close{float:right;height:16px;width:16px;cursor:pointer}.excalidraw .Stats .close svg{width:100%;height:100%}.excalidraw .Stats table{width:100%}.excalidraw .Stats table th{border-bottom:1px solid var(--input-border-color);padding:4px}.excalidraw .Stats table tr td:nth-child(2){min-width:24px;text-align:right}:root[dir=rtl] .excalidraw .Stats{left:12px;right:initial}:root[dir=rtl] .excalidraw .Stats h3{margin:0 0 8px 24px}:root[dir=rtl] .excalidraw .Stats .close{float:left}",""]);const l=a},6759:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .TextInput{display:inline-block}",""]);const l=a},9650:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Toast{animation:fade-in .5s;background-color:var(--button-gray-1);border-radius:4px;bottom:10px;box-sizing:border-box;cursor:default;left:50%;margin-left:-150px;padding:4px 0;position:absolute;text-align:center;width:300px;z-index:999999}.excalidraw .Toast__message{color:var(--popup-text-color);white-space:pre-wrap}@keyframes fade-in{from{opacity:0}to{opacity:1}}",""]);const l=a},2044:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .ToolIcon{display:inline-flex;align-items:center;position:relative;cursor:pointer;-webkit-tap-highlight-color:transparent;border-radius:var(--space-factor);-webkit-user-select:none;user-select:none;background-color:var(--button-gray-1)}.excalidraw .ToolIcon:hover{background-color:var(--button-gray-2)}.excalidraw .ToolIcon:active{background-color:var(--button-gray-3)}.excalidraw .ToolIcon--plain{background-color:transparent}.excalidraw .ToolIcon--plain .ToolIcon__icon{width:2rem;height:2rem}.excalidraw .ToolIcon__icon{width:2.5rem;height:2.5rem;color:var(--icon-fill-color);display:flex;justify-content:center;align-items:center;border-radius:var(--space-factor)}.excalidraw .ToolIcon__icon svg{position:relative;height:1em;fill:var(--icon-fill-color);color:var(--icon-fill-color)}.excalidraw .ToolIcon__icon+.ToolIcon__label{margin-inline-start:0}.excalidraw .ToolIcon__label{display:flex;align-items:center;color:var(--icon-fill-color);font-family:var(--ui-font);margin:0 .8em;text-overflow:ellipsis}.excalidraw .ToolIcon__label .Spinner{margin-left:.6em}.excalidraw .ToolIcon_size_small .ToolIcon__icon{width:2rem;height:2rem;font-size:.8em}.excalidraw .excalidraw .ToolIcon_type_button,.excalidraw .Modal .ToolIcon_type_button,.excalidraw .ToolIcon_type_button{padding:0;border:none;margin:0;font-size:inherit}.excalidraw .excalidraw .ToolIcon_type_button:focus,.excalidraw .Modal .ToolIcon_type_button:focus,.excalidraw .ToolIcon_type_button:focus{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .excalidraw .ToolIcon_type_button.ToolIcon--selected,.excalidraw .Modal .ToolIcon_type_button.ToolIcon--selected,.excalidraw .ToolIcon_type_button.ToolIcon--selected{background-color:var(--button-gray-2)}.excalidraw .excalidraw .ToolIcon_type_button.ToolIcon--selected:active,.excalidraw .Modal .ToolIcon_type_button.ToolIcon--selected:active,.excalidraw .ToolIcon_type_button.ToolIcon--selected:active{background-color:var(--button-gray-3)}.excalidraw .excalidraw .ToolIcon_type_button:hover,.excalidraw .Modal .ToolIcon_type_button:hover,.excalidraw .ToolIcon_type_button:hover{background-color:var(--button-gray-2)}.excalidraw .excalidraw .ToolIcon_type_button:active,.excalidraw .Modal .ToolIcon_type_button:active,.excalidraw .ToolIcon_type_button:active{background-color:var(--button-gray-3)}.excalidraw .excalidraw .ToolIcon_type_button--show,.excalidraw .Modal .ToolIcon_type_button--show,.excalidraw .ToolIcon_type_button--show{visibility:visible}.excalidraw .excalidraw .ToolIcon_type_button--hide,.excalidraw .Modal .ToolIcon_type_button--hide,.excalidraw .ToolIcon_type_button--hide{visibility:hidden}.excalidraw .ToolIcon_type_radio,.excalidraw .ToolIcon_type_checkbox{position:absolute;opacity:0;pointer-events:none}.excalidraw .ToolIcon_type_radio:not(.ToolIcon_toggle_opaque):checked+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox:not(.ToolIcon_toggle_opaque):checked+.ToolIcon__icon{background-color:var(--button-gray-2)}.excalidraw .ToolIcon_type_radio:not(.ToolIcon_toggle_opaque):checked+.ToolIcon__icon:active,.excalidraw .ToolIcon_type_checkbox:not(.ToolIcon_toggle_opaque):checked+.ToolIcon__icon:active{background-color:var(--button-gray-3)}.excalidraw .ToolIcon_type_radio:focus+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox:focus+.ToolIcon__icon{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .ToolIcon_type_radio:active+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox:active+.ToolIcon__icon{background-color:var(--button-gray-3)}.excalidraw .ToolIcon_type_floating{background-color:transparent}.excalidraw .ToolIcon_type_floating:hover{background-color:transparent}.excalidraw .ToolIcon_type_floating:active{background-color:transparent}.excalidraw .ToolIcon_type_floating:focus{box-shadow:none}.excalidraw .ToolIcon_type_floating .ToolIcon__icon{background-color:var(--button-gray-1);width:2rem;height:2em}.excalidraw .ToolIcon_type_floating .ToolIcon__icon:hover{background-color:var(--button-gray-2)}.excalidraw .ToolIcon_type_floating .ToolIcon__icon:active{background-color:var(--button-gray-3)}.excalidraw .ToolIcon.ToolIcon__lock{margin-inline-end:var(--space-factor)}.excalidraw .ToolIcon.ToolIcon__lock.ToolIcon_type_floating{margin-left:.1rem}.excalidraw .ToolIcon__keybinding{position:absolute;bottom:2px;right:3px;font-size:.5em;color:var(--keybinding-color);font-family:var(--ui-font);-webkit-user-select:none;user-select:none}@media(max-width: 425px){.excalidraw .Shape .ToolIcon__icon{width:2rem;height:2rem}.excalidraw .Shape .ToolIcon__icon svg{height:.8em}}@media(max-width: 760px){.excalidraw .ToolIcon.ToolIcon_type_floating{display:inline-block;position:absolute;right:calc(-2*var(--space-factor));margin-left:0;border-radius:20px 0 0 20px;z-index:1;background-color:var(--button-gray-1)}.excalidraw .ToolIcon.ToolIcon_type_floating:hover{background-color:var(--button-gray-1)}.excalidraw .ToolIcon.ToolIcon_type_floating:active{background-color:var(--button-gray-2)}.excalidraw .ToolIcon.ToolIcon_type_floating .ToolIcon__icon{border-radius:inherit}.excalidraw .ToolIcon.ToolIcon_type_floating svg{position:static}.excalidraw .ToolIcon.ToolIcon__library{top:100px}.excalidraw .ToolIcon.ToolIcon__lock{margin-inline-end:0;top:60px}}:root[dir=ltr] .excalidraw .unlocked-icon{left:2px}:root[dir=rtl] .excalidraw .unlocked-icon{right:2px}",""]);const l=a},6626:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw-tooltip{position:absolute;z-index:1000;padding:8px;border-radius:6px;box-sizing:border-box;pointer-events:none;word-wrap:break-word;background:#000;line-height:1.5;text-align:center;font-size:13px;font-weight:500;color:#fff;display:none}.excalidraw-tooltip.excalidraw-tooltip--visible{display:block}.excalidraw-tooltip-wrapper{display:flex}.excalidraw-tooltip-icon{width:.9em;height:.9em;margin-left:5px;margin-top:1px;display:flex}.excalidraw--mobile.excalidraw-tooltip-icon{display:none}",""]);const l=a},6359:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".excalidraw .UserList{pointer-events:none;padding:var(--space-factor);display:flex;justify-content:flex-end;overflow:hidden;border-radius:60px}.excalidraw .UserList.layout-vertical{grid-column:3;flex-direction:column-reverse;position:absolute;top:60px;right:var(--space-factor);max-height:calc(\n 100vh - var(--space-factor) - 60px - 60px +\n var(--itemOffset)\n );padding-bottom:max(var(--itemOffset)*-1,0px)}.excalidraw .UserList.layout-vertical .Avatar{width:2.4rem;height:2.4rem}.excalidraw .UserList>*{pointer-events:all}.excalidraw .UserList.layout-vertical>*{margin-bottom:var(--itemOffset)}.excalidraw .UserList.layout-horizontal>*{margin-right:var(--itemOffset)}.excalidraw .UserList_mobile{padding:0;justify-content:normal}.excalidraw .UserList_mobile>*{margin:0 var(--space-factor) var(--space-factor) 0}",""]);const l=a},9915:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".visually-hidden{position:absolute !important;height:1px;width:1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);white-space:nowrap;-webkit-user-select:none;user-select:none}.LoadingMessage{position:absolute;top:0;right:0;bottom:0;left:0;z-index:999;display:flex;align-items:center;justify-content:center;pointer-events:none}.LoadingMessage span{background-color:var(--button-gray-1);border-radius:5px;padding:.8em 1.2em;color:var(--popup-text-color);font-size:1.3em}",""]);const l=a},9310:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>h});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i),l=n(1667),s=n.n(l),c=new URL(n(7984),n.b),u=new URL(n(1639),n.b),d=a()(o()),p=s()(c),f=s()(u);d.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}:export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw{--theme-filter: none;--button-destructive-bg-color: #ffe3e3;--button-destructive-color: #c92a2a;--button-gray-1: #e9ecef;--button-gray-2: #ced4da;--button-gray-3: #adb5bd;--button-special-active-bg-color: #ebfbee;--dialog-border-color: #868e96;--dropdown-icon: url("+p+");--focus-highlight-color: #a5d8ff;--icon-fill-color: #000000;--icon-green-fill-color: #2b8a3e;--default-bg-color: #ffffff;--input-bg-color: #ffffff;--input-border-color: #ced4da;--input-hover-bg-color: #f1f3f5;--input-label-color: #495057;--island-bg-color: rgba(255, 255, 255, 0.96);--keybinding-color: #adb5bd;--link-color: #1c7ed6;--overlay-bg-color: rgba(255, 255, 255, 0.88);--popup-bg-color: #ffffff;--popup-secondary-bg-color: #f1f3f5;--popup-text-color: #000000;--popup-text-inverted-color: #ffffff;--sab: env(safe-area-inset-bottom);--sal: env(safe-area-inset-left);--sar: env(safe-area-inset-right);--sat: env(safe-area-inset-top);--select-highlight-color: #339af0;--shadow-island: 0 1px 5px rgba(0, 0, 0, 0.15);--space-factor: 0.25rem;--text-primary-color: #343a40}.excalidraw.theme--dark{background:#000}.excalidraw.theme--dark.theme--dark-background-none{background:none}.excalidraw.theme--dark{--theme-filter: invert(93%) hue-rotate(180deg);--button-destructive-bg-color: #5a0000;--button-destructive-color: #ffa8a8;--button-gray-1: #363636;--button-gray-2: #272727;--button-gray-3: #222;--button-special-active-bg-color: #204624;--dialog-border-color: #212529;--dropdown-icon: url("+f+');--focus-highlight-color: #228be6;--icon-fill-color: #ced4da;--icon-green-fill-color: #69db7c;--default-bg-color: #121212;--input-bg-color: #121212;--input-border-color: #2e2e2e;--input-hover-bg-color: #181818;--input-label-color: #e9ecef;--island-bg-color: rgba(30, 30, 30, 0.98);--keybinding-color: #868e96;--link-color: #4dabf7;--overlay-bg-color: rgba(52, 58, 64, 0.12);--popup-bg-color: #2c2c2c;--popup-secondary-bg-color: #222;--popup-text-color: #ced4da;--popup-text-inverted-color: #635c5c;--select-highlight-color: #4dabf7;--shadow-island: 0 1px 5px rgba(0, 0, 0, 0.3);--text-primary-color: #ced4da}:root{--zIndex-canvas: 1;--zIndex-wysiwyg: 2;--zIndex-layerUI: 3}.excalidraw{position:relative;overflow:hidden;color:var(--text-primary-color);display:flex;top:0;bottom:0;left:0;right:0;height:100%;width:100%;-webkit-user-select:none;user-select:none}.excalidraw:focus{outline:none}.excalidraw a{font-weight:500;text-decoration:none;color:var(--link-color)}.excalidraw a:hover{text-decoration:underline}.excalidraw canvas{touch-action:none;image-rendering:pixelated;image-rendering:-moz-crisp-edges;z-index:var(--zIndex-canvas)}.excalidraw__canvas{position:absolute}.excalidraw.theme--dark canvas{filter:var(--theme-filter)}.excalidraw .FixedSideContainer{padding-top:var(--sat, 0);padding-right:var(--sar, 0);padding-bottom:var(--sab, 0);padding-left:var(--sal, 0)}.excalidraw .panelRow{display:flex;justify-content:space-between}.excalidraw .panelColumn{display:flex;flex-direction:column}.excalidraw .panelColumn h3,.excalidraw .panelColumn legend,.excalidraw .panelColumn .control-label{margin-top:.333rem;margin-bottom:.333rem;font-size:.75rem;color:var(--text-primary-color);font-weight:bold;display:block}.excalidraw .panelColumn .control-label input{display:block;width:100%}.excalidraw .panelColumn h3:first-child,.excalidraw .panelColumn legend:first-child,.excalidraw .panelColumn .control-label:first-child{margin-top:0}.excalidraw .panelColumn legend{padding:0}.excalidraw .panelColumn .iconSelectList{flex-wrap:wrap;position:relative}.excalidraw .panelColumn .buttonList{flex-wrap:wrap}.excalidraw .panelColumn .buttonList label{margin-right:.25rem;font-size:.75rem;display:inline-block}.excalidraw .panelColumn .buttonList input[type=radio],.excalidraw .panelColumn .buttonList input[type=button]{opacity:0;position:absolute;pointer-events:none}.excalidraw .panelColumn .buttonList .iconRow{margin-top:8px}.excalidraw .panelColumn .buttonList .ToolIcon{margin:0;margin-inline-end:8px}.excalidraw .panelColumn .buttonList .ToolIcon:focus{outline:transparent;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .panelColumn .buttonList .ToolIcon:hover{background-color:var(--button-gray-2)}.excalidraw .panelColumn .buttonList .ToolIcon:active{background-color:var(--button-gray-3)}.excalidraw .panelColumn .buttonList .ToolIcon:disabled{cursor:not-allowed}.excalidraw .panelColumn .buttonList .ToolIcon__icon{width:28px;height:28px}.excalidraw .panelColumn fieldset{margin:0;margin-top:.333rem;padding:0;border:none}.excalidraw .divider{width:1px;background-color:#e9ecef;margin:1px}.excalidraw .buttonList label:focus-within,.excalidraw input:focus{outline:transparent;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw button,.excalidraw .buttonList label{-webkit-user-select:none;user-select:none;background-color:var(--button-gray-1);border:0;border-radius:4px;margin:.125rem 0;padding:.25rem;white-space:nowrap;cursor:pointer}.excalidraw button:focus,.excalidraw .buttonList label:focus{outline:transparent;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw button:hover,.excalidraw .buttonList label:hover{background-color:var(--button-gray-2)}.excalidraw button:active,.excalidraw .buttonList label:active{background-color:var(--button-gray-3)}.excalidraw button:disabled,.excalidraw .buttonList label:disabled{cursor:not-allowed}.excalidraw .active,.excalidraw .buttonList label.active{background-color:var(--button-gray-2)}.excalidraw .active:hover,.excalidraw .buttonList label.active:hover{background-color:var(--button-gray-2)}.excalidraw .active:active,.excalidraw .buttonList label.active:active{background-color:var(--button-gray-3)}.excalidraw .buttonList.buttonListIcon label{display:inline-flex;justify-content:center;align-items:center}.excalidraw .buttonList.buttonListIcon label svg{width:36px;height:14px;padding:2px;opacity:.6}.excalidraw .buttonList.buttonListIcon label.active svg{opacity:1}.excalidraw .App-top-bar{z-index:var(--zIndex-layerUI);display:flex;flex-direction:column;align-items:center}.excalidraw .App-bottom-bar{position:absolute;top:0;bottom:0;left:0;right:0;--bar-padding: calc(4 * var(--space-factor));padding-top:max(var(--bar-padding), var(--sat,0));padding-right:var(--sar, 0);padding-bottom:var(--sab, 0);padding-left:var(--sal, 0);z-index:4;display:flex;align-items:flex-end;pointer-events:none}.excalidraw .App-bottom-bar>.Island{width:100%;max-width:100%;min-width:100%;box-sizing:border-box;max-height:100%;display:flex;flex-direction:column;pointer-events:initial}.excalidraw .App-bottom-bar>.Island .panelColumn{padding:8px 8px 0 8px}.excalidraw .App-toolbar{width:100%;box-sizing:border-box}.excalidraw .App-toolbar-content{display:flex;align-items:center;justify-content:space-between;padding:8px}.excalidraw .App-mobile-menu{width:100%;overflow-x:visible;overflow-y:auto;box-sizing:border-box;margin-bottom:var(--bar-padding)}.excalidraw .App-menu{display:grid;color:var(--icon-fill-color)}.excalidraw .App-menu_top{grid-template-columns:1fr auto 1fr;grid-gap:4px;align-items:flex-start;cursor:default;pointer-events:none !important}.excalidraw .layer-ui__wrapper:not(.disable-pointerEvents) .App-menu_top>*{pointer-events:all}.excalidraw .App-menu_top>*:first-child{justify-self:flex-start}.excalidraw .App-menu_top>*:last-child{justify-self:flex-end}.excalidraw .App-menu_bottom{position:absolute;bottom:0;grid-template-columns:-webkit-min-content auto -webkit-min-content;grid-template-columns:min-content auto min-content;grid-gap:15px;align-items:flex-start;cursor:default;pointer-events:none !important;z-index:100}:root[dir=ltr] .excalidraw .App-menu_bottom{left:.25rem}:root[dir=rtl] .excalidraw .App-menu_bottom{right:.25rem}.excalidraw .App-menu_bottom--transition-left section{width:185px}.excalidraw .App-menu_bottom section{display:flex}.excalidraw .App-menu_bottom>*:first-child{justify-self:flex-start}.excalidraw .App-menu_bottom>*:last-child{justify-self:flex-end}.excalidraw .App-menu_left{grid-template-rows:1fr auto 1fr;height:100%}.excalidraw .App-menu_right{grid-template-rows:1fr;height:100%}.excalidraw .App-menu__left{overflow-y:auto}.excalidraw .dropdown-select{height:1.5rem;padding:0;padding-inline-start:.5rem;padding-inline-end:1.5rem;color:var(--icon-fill-color);background-color:var(--button-gray-1);border-radius:var(--space-factor);border:1px solid var(--button-gray-2);font-size:.8rem;outline:none;-webkit-appearance:none;appearance:none;background-image:var(--dropdown-icon);background-repeat:no-repeat;background-position:right .7rem top 50%,0 0;background-size:.65em auto,100%}:root[dir=rtl] .excalidraw .dropdown-select{background-position:left .7rem top 50%,0 0}.excalidraw .dropdown-select:focus{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .dropdown-select:hover{background-color:var(--button-gray-2)}.excalidraw .dropdown-select:active{background-color:var(--button-gray-2)}.excalidraw .zIndexButton{margin:0;margin-inline-end:8px;padding:5px;display:inline-flex;align-items:center;justify-content:center}.excalidraw .zIndexButton svg{width:18px;height:18px}.excalidraw .scroll-back-to-content{color:var(--popup-text-color);position:absolute;left:50%;bottom:30px;transform:translateX(-50%);padding:10px 20px}.excalidraw .help-icon{display:flex;cursor:pointer;fill:#868e96;padding:0;margin:0;background:none;color:var(--icon-fill-color)}.excalidraw .help-icon svg{width:1.5rem;height:1.5rem}.excalidraw .help-icon:hover{background:none}.excalidraw .reset-zoom-button{padding:.2em;background:transparent;color:var(--text-primary-color);font-family:var(--ui-font)}.excalidraw .undo-redo-buttons{display:grid;grid-auto-flow:column;gap:.4em;margin-top:auto;margin-bottom:auto;margin-inline-start:.6em}.excalidraw--mobile.excalidraw aside{display:none}.excalidraw--mobile.excalidraw .scroll-back-to-content{bottom:calc(80px + var(--sab, 0));z-index:-1}:root[dir=rtl] .excalidraw .rtl-mirror{transform:scaleX(-1)}.excalidraw .zen-mode-visibility{visibility:visible;opacity:1;height:auto;width:auto;transition:opacity .5s}.excalidraw .zen-mode-visibility.zen-mode-visibility--hidden{visibility:hidden;opacity:0;height:0;width:0;transition:opacity .5s}.excalidraw .disable-pointerEvents{pointer-events:none !important}.excalidraw.excalidraw--view-mode .App-menu{display:flex;justify-content:space-between}.excalidraw input[type=text],.excalidraw textarea:not(.excalidraw-wysiwyg){color:var(--text-primary-color);border:1.5px solid var(--input-border-color);padding:.75rem;white-space:nowrap;border-radius:var(--space-factor);background-color:var(--input-bg-color)}.excalidraw input[type=text]:not(:focus):hover,.excalidraw textarea:not(.excalidraw-wysiwyg):not(:focus):hover{background-color:var(--input-hover-bg-color)}.excalidraw input[type=text]:focus,.excalidraw textarea:not(.excalidraw-wysiwyg):focus{outline:none;box-shadow:0 0 0 2px var(--focus-highlight-color)}@media print{.excalidraw .App-bottom-bar,.excalidraw .FixedSideContainer,.excalidraw .layer-ui__wrapper{display:none}}.excalidraw .HomeButton.ToolIcon.ToolIcon_type_floating{display:inline-block;position:absolute;top:60px;left:calc(-2*var(--space-factor));border-radius:0 20px 20px 0;background-color:var(--button-gray-1)}.excalidraw .HomeButton.ToolIcon.ToolIcon_type_floating:hover{background-color:var(--button-gray-1)}.excalidraw .HomeButton.ToolIcon.ToolIcon_type_floating:active{background-color:var(--button-gray-2)}.excalidraw .HomeButton.ToolIcon.ToolIcon_type_floating .ToolIcon__icon{border-radius:inherit}.excalidraw .HomeButton.ToolIcon.ToolIcon_type_floating svg{position:static}.ErrorSplash.excalidraw{min-height:100vh;padding:20px 0;overflow:auto;display:flex;align-items:center;justify-content:center;-webkit-user-select:text;user-select:text}.ErrorSplash.excalidraw .ErrorSplash-messageContainer{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px;background-color:#ffe3e3;border:3px solid #c92a2a}.ErrorSplash.excalidraw .ErrorSplash-paragraph{margin:15px 0;max-width:600px}.ErrorSplash.excalidraw .ErrorSplash-paragraph.align-center{text-align:center}.ErrorSplash.excalidraw .bigger,.ErrorSplash.excalidraw .bigger button{font-size:1.1em}.ErrorSplash.excalidraw .smaller,.ErrorSplash.excalidraw .smaller button{font-size:.9em}.ErrorSplash.excalidraw .ErrorSplash-details{display:flex;flex-direction:column;align-items:flex-start}.ErrorSplash.excalidraw .ErrorSplash-details textarea{width:100%;margin:10px 0;font-family:"Cascadia";font-size:.8em}',""]);const h=d},6464:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l});var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,"",""]),a.locals={themeFilter:"invert(93%) hue-rotate(180deg)"};const l=a},3645:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,o,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var l=0;l<this.length;l++){var s=this[l][0];null!=s&&(a[s]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);r&&a[u[0]]||(void 0!==i&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=i),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),t.push(u))}},t}},1667:e=>{"use strict";e.exports=function(e,t){return t||(t={}),e?(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]|(%20)/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e):e}},8081:e=>{"use strict";e.exports=function(e){return e[1]}},8288:(e,t,n)=>{"use strict";n.d(t,{iC:()=>a,f:()=>l,qx:()=>s,Iw:()=>c,$e:()=>u,wZ:()=>d,ay:()=>p,oc:()=>f,Oh:()=>h,Ks:()=>r,Vi:()=>g,$C:()=>m,ut:()=>v,C6:()=>b,_D:()=>y,n5:()=>x,rk:()=>w,Hg:()=>k,hs:()=>S,k:()=>E,LO:()=>j,r8:()=>_,pb:()=>C,LL:()=>O,Gj:()=>I,nM:()=>M,Lg:()=>P,HM:()=>T,V4:()=>L,EH:()=>A,ZF:()=>D,UO:()=>z,ah:()=>N,cW:()=>H,kV:()=>R,sS:()=>B,Yx:()=>F,zK:()=>U,ZB:()=>V,qy:()=>G,h6:()=>W,jo:()=>K,$n:()=>Z,hR:()=>Y,Kr:()=>q});var r,o=n(8635),i=n.n(o),a="Excalidraw",l=10,s=8,c=5,u=1,d=30,p=Math.PI/12,f={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},h={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1};!function(e){e.COPY="copy",e.PASTE="paste",e.CUT="cut",e.KEYDOWN="keydown",e.KEYUP="keyup",e.MOUSE_MOVE="mousemove",e.RESIZE="resize",e.UNLOAD="unload",e.FOCUS="focus",e.BLUR="blur",e.DRAG_OVER="dragover",e.DROP="drop",e.GESTURE_END="gestureend",e.BEFORE_UNLOAD="beforeunload",e.GESTURE_START="gesturestart",e.GESTURE_CHANGE="gesturechange",e.POINTER_MOVE="pointermove",e.POINTER_UP="pointerup",e.STATE_CHANGE="statechange",e.WHEEL="wheel",e.TOUCH_START="touchstart",e.TOUCH_END="touchend",e.HASHCHANGE="hashchange",e.VISIBILITY_CHANGE="visibilitychange",e.SCROLL="scroll"}(r||(r={}));var g={TEST:"test",DEVELOPMENT:"development"},m={SHAPE_ACTIONS_MENU:"App-menu__left"},v={Virgil:1,Helvetica:2,Cascadia:3},b={LIGHT:"light",DARK:"dark"},y="Segoe UI Emoji",x=20,w=v.Virgil,k="left",S="top",E=20,j={excalidraw:"application/vnd.excalidraw+json",excalidrawlib:"application/vnd.excalidrawlib+json",json:"application/json",svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",gif:"image/gif",binary:"application/octet-stream"},_={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawLibrary:"excalidrawlib"},C=window.location.origin,O=500,I=300,M=500,P=5e3,T=100,L=.1,A={VIEW:"viewMode",ZEN:"zenMode",GRID:"gridMode"},D=i().themeFilter,z={addLibrary:"addLibrary"},N={addLibrary:"addLibrary"},H={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,theme:!0,saveAsImage:!0}},R=800,B=1e3,F=500,U=2,V=[1,2,3],G=10,W=1440,K=[j.png,j.jpg,j.svg,j.gif],Z=2097152,Y="http://www.w3.org/2000/svg",q={excalidraw:2,excalidrawLibrary:2}},9997:(e,t,n)=>{"use strict";n.r(t),n.d(t,{FONT_FAMILY:()=>c.ut,THEME:()=>c.C6,bumpVersion:()=>qr,cleanAppStateForExport:()=>Kn,clearAppStateForLocalStorage:()=>Wn,default:()=>xg,defaultLang:()=>g,exportToBlob:()=>ih,exportToCanvas:()=>oh,exportToClipboard:()=>lh,exportToSvg:()=>ah,getDefaultAppState:()=>Un,getFreeDrawSvgPath:()=>zr,getNonDeletedElements:()=>Ha,getSceneVersion:()=>Na,isInvisiblySmallElement:()=>Xr,isLinearElement:()=>De,languages:()=>m,loadFromBlob:()=>xu,loadLibraryFromBlob:()=>wu,mutateElement:()=>Zr,newElementWith:()=>Yr,restore:()=>du,restoreAppState:()=>uu,restoreElements:()=>cu,serializeAsJSON:()=>Iu});var r=n(6479),o=n.n(r),i=n(9713),a=n.n(i),l=n(9787),s=n.n(l),c=n(8288);const u=JSON.parse('{"u2":"@dwelle/excalidraw","i8":"0.3.20"}');"production"!==c.Vi.TEST&&(n.p=window.EXCALIDRAW_ASSET_PATH||"https://unpkg.com/".concat(u.u2,"@").concat(u.i8,"/dist/"));var d=n(8950),p=n(1463);const f=JSON.parse('{"ar-SA":86,"bg-BG":59,"bn-BD":0,"ca-ES":78,"cs-CZ":25,"da-DK":17,"de-DE":100,"el-GR":88,"en":100,"es-ES":88,"fa-IR":66,"fi-FI":100,"fr-FR":100,"he-IL":84,"hi-IN":58,"hu-HU":52,"id-ID":100,"it-IT":100,"ja-JP":99,"kab-KAB":82,"kk-KZ":24,"ko-KR":58,"lv-LV":100,"my-MM":49,"nb-NO":100,"nl-NL":93,"nn-NO":87,"oc-FR":99,"pa-IN":84,"pl-PL":97,"pt-BR":99,"pt-PT":87,"ro-RO":100,"ru-RU":86,"si-LK":9,"sk-SK":99,"sv-SE":99,"ta-IN":98,"tr-TR":78,"uk-UA":85,"zh-CN":92,"zh-HK":29,"zh-TW":100}');var h=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}},g={code:"en",label:"English"},m=[{code:"ar-SA",label:"العربية",rtl:!0},{code:"bg-BG",label:"Български"},{code:"ca-ES",label:"Català"},{code:"de-DE",label:"Deutsch"},{code:"el-GR",label:"Ελληνικά"},{code:"es-ES",label:"Español"},{code:"fa-IR",label:"فارسی",rtl:!0},{code:"fi-FI",label:"Suomi"},{code:"fr-FR",label:"Français"},{code:"he-IL",label:"עברית",rtl:!0},{code:"hi-IN",label:"हिन्दी"},{code:"hu-HU",label:"Magyar"},{code:"id-ID",label:"Bahasa Indonesia"},{code:"it-IT",label:"Italiano"},{code:"ja-JP",label:"日本語"},{code:"kab-KAB",label:"Taqbaylit"},{code:"ko-KR",label:"한국어"},{code:"my-MM",label:"Burmese"},{code:"nb-NO",label:"Norsk bokmål"},{code:"nl-NL",label:"Nederlands"},{code:"nn-NO",label:"Norsk nynorsk"},{code:"oc-FR",label:"Occitan"},{code:"pa-IN",label:"ਪੰਜਾਬੀ"},{code:"pl-PL",label:"Polski"},{code:"pt-BR",label:"Português Brasileiro"},{code:"pt-PT",label:"Português"},{code:"ro-RO",label:"Română"},{code:"ru-RU",label:"Русский"},{code:"sk-SK",label:"Slovenčina"},{code:"sv-SE",label:"Svenska"},{code:"tr-TR",label:"Türkçe"},{code:"uk-UA",label:"Українська"},{code:"zh-CN",label:"简体中文"},{code:"zh-TW",label:"繁體中文"},{code:"lv-LV",label:"Latviešu"},{code:"cs-CZ",label:"Česky"},{code:"kk-KZ",label:"Қазақ тілі"}].concat([g]).sort((function(e,t){return e.label>t.label?1:-1})).filter((function(e){return f[e.code]>=85})),v="__test__";"production"===c.Vi.DEVELOPMENT&&m.unshift({code:v,label:"test language"},{code:"".concat(v,".rtl"),label:"test language (rtl)",rtl:!0});var b=g,y={},x=function(){var e=(0,d.Z)((function(e){return h(this,(function(t){switch(t.label){case 0:return b=e,document.documentElement.dir=b.rtl?"rtl":"ltr",document.documentElement.lang=b.code,e.code.startsWith(v)?(y={},[3,3]):[3,1];case 1:return[4,Promise.resolve().then(n.t.bind(n,1463,19))];case 2:y=t.sent(),t.label=3;case 3:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),w=function(){return b},k=function(e,t){for(var n=0;n<t.length;++n){var r=t[n];if(void 0===e[r])return;e=e[r]}if("string"==typeof e)return e},S=function(e,t){if(b.code.startsWith(v)){var n=t?"".concat(e,"(").concat(JSON.stringify(t).slice(1,-1),")"):e;return"[[".concat(n,"]]")}var r=e.split("."),o=k(y,r)||k(p,r);if(void 0===o)throw new Error("Can't find translation for ".concat(e));if(t)for(var i in t)o=o.replace("{{".concat(i,"}}"),String(t[i]));return o},E=n(4512),j=function(){return(0,E.jsx)("div",{className:"LoadingMessage",children:(0,E.jsx)("span",{children:S("labels.loadingScene")})})},_=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}},C=function(e){var t=(0,l.useState)(!0),n=t[0],r=t[1];return(0,l.useEffect)((function(){var t=function(){var e=(0,d.Z)((function(){return _(this,(function(e){switch(e.label){case 0:return[4,x(n)];case 1:return e.sent(),[2]}}))}));return function(){return e.apply(this,arguments)}}(),n=m.find((function(t){return t.code===e.langCode}))||g;t(),r(!1)}),[e.langCode]),n?(0,E.jsx)(j,{}):e.children};function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I(e,t,n){if(e&&e.length){const[r,o]=t,i=Math.PI/180*n,a=Math.cos(i),l=Math.sin(i);e.forEach((e=>{const[t,n]=e;e[0]=(t-r)*a-(n-o)*l+r,e[1]=(t-r)*l+(n-o)*a+o}))}}function M(e){const t=e[0],n=e[1];return Math.sqrt(Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2))}function P(e,t){const n=t.hachureAngle+90;let r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);const o=[0,0];if(n)for(const t of e)I(t,o,n);const i=function(e,t){const n=[];for(const t of e){const e=[...t];e[0].join(",")!==e[e.length-1].join(",")&&e.push([e[0][0],e[0][1]]),e.length>2&&n.push(e)}const r=[];t=Math.max(t,.1);const o=[];for(const e of n)for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];if(n[1]!==r[1]){const e=Math.min(n[1],r[1]);o.push({ymin:e,ymax:Math.max(n[1],r[1]),x:e===n[1]?n[0]:r[0],islope:(r[0]-n[0])/(r[1]-n[1])})}}if(o.sort(((e,t)=>e.ymin<t.ymin?-1:e.ymin>t.ymin?1:e.x<t.x?-1:e.x>t.x?1:e.ymax===t.ymax?0:(e.ymax-t.ymax)/Math.abs(e.ymax-t.ymax))),!o.length)return r;let i=[],a=o[0].ymin;for(;i.length||o.length;){if(o.length){let e=-1;for(let t=0;t<o.length&&!(o[t].ymin>a);t++)e=t;o.splice(0,e+1).forEach((e=>{i.push({s:a,edge:e})}))}if(i=i.filter((e=>!(e.edge.ymax<=a))),i.sort(((e,t)=>e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x))),i.length>1)for(let e=0;e<i.length;e+=2){const t=e+1;if(t>=i.length)break;const n=i[e].edge,o=i[t].edge;r.push([[Math.round(n.x),a],[Math.round(o.x),a]])}a+=t,i.forEach((e=>{e.edge.x=e.edge.x+t*e.edge.islope}))}return r}(e,r);if(n){for(const t of e)I(t,o,-n);!function(e,t,n){const r=[];e.forEach((e=>r.push(...e))),I(r,t,n)}(i,o,-n)}return i}class T{constructor(e){this.helper=e}fillPolygons(e,t){return this._fillPolygons(e,t)}_fillPolygons(e,t){const n=P(e,t);return{type:"fillSketch",ops:this.renderLines(n,t)}}renderLines(e,t){const n=[];for(const r of e)n.push(...this.helper.doubleLineOps(r[0][0],r[0][1],r[1][0],r[1][1],t));return n}}class L extends T{fillPolygons(e,t){let n=t.hachureGap;n<0&&(n=4*t.strokeWidth),n=Math.max(n,.1);const r=P(e,Object.assign({},t,{hachureGap:n})),o=Math.PI/180*t.hachureAngle,i=[],a=.5*n*Math.cos(o),l=.5*n*Math.sin(o);for(const[e,t]of r)M([e,t])&&i.push([[e[0]-a,e[1]+l],[...t]],[[e[0]+a,e[1]-l],[...t]]);return{type:"fillSketch",ops:this.renderLines(i,t)}}}class A extends T{fillPolygons(e,t){const n=this._fillPolygons(e,t),r=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),o=this._fillPolygons(e,r);return n.ops=n.ops.concat(o.ops),n}}class D{constructor(e){this.helper=e}fillPolygons(e,t){const n=P(e,t=Object.assign({},t,{hachureAngle:0}));return this.dotsOnLines(n,t)}dotsOnLines(e,t){const n=[];let r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);let o=t.fillWeight;o<0&&(o=t.strokeWidth/2);const i=r/4;for(const a of e){const e=M(a),l=e/r,s=Math.ceil(l)-1,c=e-s*r,u=(a[0][0]+a[1][0])/2-r/4,d=Math.min(a[0][1],a[1][1]);for(let e=0;e<s;e++){const a=d+c+e*r,l=u-i+2*Math.random()*i,s=a-i+2*Math.random()*i,p=this.helper.ellipse(l,s,o,o,t);n.push(...p.ops)}}return{type:"fillSketch",ops:n}}}class z{constructor(e){this.helper=e}fillPolygons(e,t){const n=P(e,t);return{type:"fillSketch",ops:this.dashedLine(n,t)}}dashedLine(e,t){const n=t.dashOffset<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashOffset,r=t.dashGap<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashGap,o=[];return e.forEach((e=>{const i=M(e),a=Math.floor(i/(n+r)),l=(i+r-a*(n+r))/2;let s=e[0],c=e[1];s[0]>c[0]&&(s=e[1],c=e[0]);const u=Math.atan((c[1]-s[1])/(c[0]-s[0]));for(let e=0;e<a;e++){const i=e*(n+r),a=i+n,c=[s[0]+i*Math.cos(u)+l*Math.cos(u),s[1]+i*Math.sin(u)+l*Math.sin(u)],d=[s[0]+a*Math.cos(u)+l*Math.cos(u),s[1]+a*Math.sin(u)+l*Math.sin(u)];o.push(...this.helper.doubleLineOps(c[0],c[1],d[0],d[1],t))}})),o}}class N{constructor(e){this.helper=e}fillPolygons(e,t){const n=t.hachureGap<0?4*t.strokeWidth:t.hachureGap,r=t.zigzagOffset<0?n:t.zigzagOffset,o=P(e,t=Object.assign({},t,{hachureGap:n+r}));return{type:"fillSketch",ops:this.zigzagLines(o,r,t)}}zigzagLines(e,t,n){const r=[];return e.forEach((e=>{const o=M(e),i=Math.round(o/(2*t));let a=e[0],l=e[1];a[0]>l[0]&&(a=e[1],l=e[0]);const s=Math.atan((l[1]-a[1])/(l[0]-a[0]));for(let e=0;e<i;e++){const o=2*e*t,i=2*(e+1)*t,l=Math.sqrt(2*Math.pow(t,2)),c=[a[0]+o*Math.cos(s),a[1]+o*Math.sin(s)],u=[a[0]+i*Math.cos(s),a[1]+i*Math.sin(s)],d=[c[0]+l*Math.cos(s+Math.PI/4),c[1]+l*Math.sin(s+Math.PI/4)];r.push(...this.helper.doubleLineOps(c[0],c[1],d[0],d[1],n),...this.helper.doubleLineOps(d[0],d[1],u[0],u[1],n))}})),r}}const H={};class R{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const B={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function F(e,t){return e.type===t}function U(e){const t=[],n=function(e){const t=new Array;for(;""!==e;)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:0,text:RegExp.$1},e=e.substr(RegExp.$1.length);else{if(!e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];t[t.length]={type:1,text:`${parseFloat(RegExp.$1)}`},e=e.substr(RegExp.$1.length)}return t[t.length]={type:2,text:""},t}(e);let r="BOD",o=0,i=n[o];for(;!F(i,2);){let a=0;const l=[];if("BOD"===r){if("M"!==i.text&&"m"!==i.text)return U("M0,0"+e);o++,a=B[i.text],r=i.text}else F(i,1)?a=B[r]:(o++,a=B[i.text],r=i.text);if(!(o+a<n.length))throw new Error("Path data ended short");for(let e=o;e<o+a;e++){const t=n[e];if(!F(t,1))throw new Error("Param not a number: "+r+","+t.text);l[l.length]=+t.text}if("number"!=typeof B[r])throw new Error("Bad segment: "+r);{const e={key:r,data:l};t.push(e),o+=a,i=n[o],"M"===r&&(r="L"),"m"===r&&(r="l")}}return t}function V(e){let t=0,n=0,r=0,o=0;const i=[];for(const{key:a,data:l}of e)switch(a){case"M":i.push({key:"M",data:[...l]}),[t,n]=l,[r,o]=l;break;case"m":t+=l[0],n+=l[1],i.push({key:"M",data:[t,n]}),r=t,o=n;break;case"L":i.push({key:"L",data:[...l]}),[t,n]=l;break;case"l":t+=l[0],n+=l[1],i.push({key:"L",data:[t,n]});break;case"C":i.push({key:"C",data:[...l]}),t=l[4],n=l[5];break;case"c":{const e=l.map(((e,r)=>r%2?e+n:e+t));i.push({key:"C",data:e}),t=e[4],n=e[5];break}case"Q":i.push({key:"Q",data:[...l]}),t=l[2],n=l[3];break;case"q":{const e=l.map(((e,r)=>r%2?e+n:e+t));i.push({key:"Q",data:e}),t=e[2],n=e[3];break}case"A":i.push({key:"A",data:[...l]}),t=l[5],n=l[6];break;case"a":t+=l[5],n+=l[6],i.push({key:"A",data:[l[0],l[1],l[2],l[3],l[4],t,n]});break;case"H":i.push({key:"H",data:[...l]}),t=l[0];break;case"h":t+=l[0],i.push({key:"H",data:[t]});break;case"V":i.push({key:"V",data:[...l]}),n=l[0];break;case"v":n+=l[0],i.push({key:"V",data:[n]});break;case"S":i.push({key:"S",data:[...l]}),t=l[2],n=l[3];break;case"s":{const e=l.map(((e,r)=>r%2?e+n:e+t));i.push({key:"S",data:e}),t=e[2],n=e[3];break}case"T":i.push({key:"T",data:[...l]}),t=l[0],n=l[1];break;case"t":t+=l[0],n+=l[1],i.push({key:"T",data:[t,n]});break;case"Z":case"z":i.push({key:"Z",data:[]}),t=r,n=o}return i}function G(e){const t=[];let n="",r=0,o=0,i=0,a=0,l=0,s=0;for(const{key:c,data:u}of e){switch(c){case"M":t.push({key:"M",data:[...u]}),[r,o]=u,[i,a]=u;break;case"C":t.push({key:"C",data:[...u]}),r=u[4],o=u[5],l=u[2],s=u[3];break;case"L":t.push({key:"L",data:[...u]}),[r,o]=u;break;case"H":r=u[0],t.push({key:"L",data:[r,o]});break;case"V":o=u[0],t.push({key:"L",data:[r,o]});break;case"S":{let e=0,i=0;"C"===n||"S"===n?(e=r+(r-l),i=o+(o-s)):(e=r,i=o),t.push({key:"C",data:[e,i,...u]}),l=u[0],s=u[1],r=u[2],o=u[3];break}case"T":{const[e,i]=u;let a=0,c=0;"Q"===n||"T"===n?(a=r+(r-l),c=o+(o-s)):(a=r,c=o);const d=r+2*(a-r)/3,p=o+2*(c-o)/3,f=e+2*(a-e)/3,h=i+2*(c-i)/3;t.push({key:"C",data:[d,p,f,h,e,i]}),l=a,s=c,r=e,o=i;break}case"Q":{const[e,n,i,a]=u,c=r+2*(e-r)/3,d=o+2*(n-o)/3,p=i+2*(e-i)/3,f=a+2*(n-a)/3;t.push({key:"C",data:[c,d,p,f,i,a]}),l=e,s=n,r=i,o=a;break}case"A":{const e=Math.abs(u[0]),n=Math.abs(u[1]),i=u[2],a=u[3],l=u[4],s=u[5],c=u[6];if(0===e||0===n)t.push({key:"C",data:[r,o,s,c,s,c]}),r=s,o=c;else if(r!==s||o!==c){K(r,o,s,c,e,n,i,a,l).forEach((function(e){t.push({key:"C",data:e})})),r=s,o=c}break}case"Z":t.push({key:"Z",data:[]}),r=i,o=a}n=c}return t}function W(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function K(e,t,n,r,o,i,a,l,s,c){const u=(d=a,Math.PI*d/180);var d;let p=[],f=0,h=0,g=0,m=0;if(c)[f,h,g,m]=c;else{[e,t]=W(e,t,-u),[n,r]=W(n,r,-u);const a=(e-n)/2,c=(t-r)/2;let d=a*a/(o*o)+c*c/(i*i);d>1&&(d=Math.sqrt(d),o*=d,i*=d);const p=o*o,v=i*i,b=p*v-p*c*c-v*a*a,y=p*c*c+v*a*a,x=(l===s?-1:1)*Math.sqrt(Math.abs(b/y));g=x*o*c/i+(e+n)/2,m=x*-i*a/o+(t+r)/2,f=Math.asin(parseFloat(((t-m)/i).toFixed(9))),h=Math.asin(parseFloat(((r-m)/i).toFixed(9))),e<g&&(f=Math.PI-f),n<g&&(h=Math.PI-h),f<0&&(f=2*Math.PI+f),h<0&&(h=2*Math.PI+h),s&&f>h&&(f-=2*Math.PI),!s&&h>f&&(h-=2*Math.PI)}let v=h-f;if(Math.abs(v)>120*Math.PI/180){const e=h,t=n,l=r;h=s&&h>f?f+120*Math.PI/180*1:f+120*Math.PI/180*-1,p=K(n=g+o*Math.cos(h),r=m+i*Math.sin(h),t,l,o,i,a,0,s,[h,e,g,m])}v=h-f;const b=Math.cos(f),y=Math.sin(f),x=Math.cos(h),w=Math.sin(h),k=Math.tan(v/4),S=4/3*o*k,E=4/3*i*k,j=[e,t],_=[e+S*y,t-E*b],C=[n+S*w,r-E*x],O=[n,r];if(_[0]=2*j[0]-_[0],_[1]=2*j[1]-_[1],c)return[_,C,O].concat(p);{p=[_,C,O].concat(p);const e=[];for(let t=0;t<p.length;t+=3){const n=W(p[t][0],p[t][1],u),r=W(p[t+1][0],p[t+1][1],u),o=W(p[t+2][0],p[t+2][1],u);e.push([n[0],n[1],r[0],r[1],o[0],o[1]])}return e}}const Z={randOffset:function(e,t){return ie(e,t)},randOffsetWithRange:function(e,t,n){return oe(e,t,n)},ellipse:function(e,t,n,r,o){const i=Q(n,r,o);return J(e,t,o,i).opset},doubleLineOps:function(e,t,n,r,o){return ae(e,t,n,r,o,!0)}};function Y(e,t,n,r,o){return{type:"path",ops:ae(e,t,n,r,o)}}function q(e,t,n){const r=(e||[]).length;if(r>2){const o=[];for(let t=0;t<r-1;t++)o.push(...ae(e[t][0],e[t][1],e[t+1][0],e[t+1][1],n));return t&&o.push(...ae(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:"path",ops:o}}return 2===r?Y(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:"path",ops:[]}}function X(e,t,n,r,o){return function(e,t){return q(e,!0,t)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],o)}function $(e,t){let n=se(e,1*(1+.2*t.roughness),t);if(!t.disableMultiStroke){const r=se(e,1.5*(1+.22*t.roughness),function(e){const t=Object.assign({},e);t.randomizer=void 0,e.seed&&(t.seed=e.seed+1);return t}(t));n=n.concat(r)}return{type:"path",ops:n}}function Q(e,t,n){const r=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),o=Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r),i=2*Math.PI/o;let a=Math.abs(e/2),l=Math.abs(t/2);const s=1-n.curveFitting;return a+=ie(a*s,n),l+=ie(l*s,n),{increment:i,rx:a,ry:l}}function J(e,t,n,r){const[o,i]=ue(r.increment,e,t,r.rx,r.ry,1,r.increment*oe(.1,oe(.4,1,n),n),n);let a=ce(o,null,n);if(!n.disableMultiStroke&&0!==n.roughness){const[o]=ue(r.increment,e,t,r.rx,r.ry,1.5,0,n),i=ce(o,null,n);a=a.concat(i)}return{estimatedPoints:i,opset:{type:"path",ops:a}}}function ee(e,t,n,r,o,i,a,l,s){const c=e,u=t;let d=Math.abs(n/2),p=Math.abs(r/2);d+=ie(.01*d,s),p+=ie(.01*p,s);let f=o,h=i;for(;f<0;)f+=2*Math.PI,h+=2*Math.PI;h-f>2*Math.PI&&(f=0,h=2*Math.PI);const g=2*Math.PI/s.curveStepCount,m=Math.min(g/2,(h-f)/2),v=de(m,c,u,d,p,f,h,1,s);if(!s.disableMultiStroke){const e=de(m,c,u,d,p,f,h,1.5,s);v.push(...e)}return a&&(l?v.push(...ae(c,u,c+d*Math.cos(f),u+p*Math.sin(f),s),...ae(c,u,c+d*Math.cos(h),u+p*Math.sin(h),s)):v.push({op:"lineTo",data:[c,u]},{op:"lineTo",data:[c+d*Math.cos(f),u+p*Math.sin(f)]})),{type:"path",ops:v}}function te(e,t){const n=[];for(const r of e)if(r.length){const e=t.maxRandomnessOffset||0,o=r.length;if(o>2){n.push({op:"move",data:[r[0][0]+ie(e,t),r[0][1]+ie(e,t)]});for(let i=1;i<o;i++)n.push({op:"lineTo",data:[r[i][0]+ie(e,t),r[i][1]+ie(e,t)]})}}return{type:"fillPath",ops:n}}function ne(e,t){return function(e,t){let n=e.fillStyle||"hachure";if(!H[n])switch(n){case"zigzag":H[n]||(H[n]=new L(t));break;case"cross-hatch":H[n]||(H[n]=new A(t));break;case"dots":H[n]||(H[n]=new D(t));break;case"dashed":H[n]||(H[n]=new z(t));break;case"zigzag-line":H[n]||(H[n]=new N(t));break;default:n="hachure",H[n]||(H[n]=new T(t))}return H[n]}(t,Z).fillPolygons(e,t)}function re(e){return e.randomizer||(e.randomizer=new R(e.seed||0)),e.randomizer.next()}function oe(e,t,n,r=1){return n.roughness*r*(re(n)*(t-e)+e)}function ie(e,t,n=1){return oe(-e,e,t,n)}function ae(e,t,n,r,o,i=!1){const a=i?o.disableMultiStrokeFill:o.disableMultiStroke,l=le(e,t,n,r,o,!0,!1);if(a)return l;const s=le(e,t,n,r,o,!0,!0);return l.concat(s)}function le(e,t,n,r,o,i,a){const l=Math.pow(e-n,2)+Math.pow(t-r,2),s=Math.sqrt(l);let c=1;c=s<200?1:s>500?.4:-.0016668*s+1.233334;let u=o.maxRandomnessOffset||0;u*u*100>l&&(u=s/10);const d=u/2,p=.2+.2*re(o);let f=o.bowing*o.maxRandomnessOffset*(r-t)/200,h=o.bowing*o.maxRandomnessOffset*(e-n)/200;f=ie(f,o,c),h=ie(h,o,c);const g=[],m=()=>ie(d,o,c),v=()=>ie(u,o,c),b=o.preserveVertices;return i&&(a?g.push({op:"move",data:[e+(b?0:m()),t+(b?0:m())]}):g.push({op:"move",data:[e+(b?0:ie(u,o,c)),t+(b?0:ie(u,o,c))]})),a?g.push({op:"bcurveTo",data:[f+e+(n-e)*p+m(),h+t+(r-t)*p+m(),f+e+2*(n-e)*p+m(),h+t+2*(r-t)*p+m(),n+(b?0:m()),r+(b?0:m())]}):g.push({op:"bcurveTo",data:[f+e+(n-e)*p+v(),h+t+(r-t)*p+v(),f+e+2*(n-e)*p+v(),h+t+2*(r-t)*p+v(),n+(b?0:v()),r+(b?0:v())]}),g}function se(e,t,n){const r=[];r.push([e[0][0]+ie(t,n),e[0][1]+ie(t,n)]),r.push([e[0][0]+ie(t,n),e[0][1]+ie(t,n)]);for(let o=1;o<e.length;o++)r.push([e[o][0]+ie(t,n),e[o][1]+ie(t,n)]),o===e.length-1&&r.push([e[o][0]+ie(t,n),e[o][1]+ie(t,n)]);return ce(r,null,n)}function ce(e,t,n){const r=e.length,o=[];if(r>3){const i=[],a=1-n.curveTightness;o.push({op:"move",data:[e[1][0],e[1][1]]});for(let t=1;t+2<r;t++){const n=e[t];i[0]=[n[0],n[1]],i[1]=[n[0]+(a*e[t+1][0]-a*e[t-1][0])/6,n[1]+(a*e[t+1][1]-a*e[t-1][1])/6],i[2]=[e[t+1][0]+(a*e[t][0]-a*e[t+2][0])/6,e[t+1][1]+(a*e[t][1]-a*e[t+2][1])/6],i[3]=[e[t+1][0],e[t+1][1]],o.push({op:"bcurveTo",data:[i[1][0],i[1][1],i[2][0],i[2][1],i[3][0],i[3][1]]})}if(t&&2===t.length){const e=n.maxRandomnessOffset;o.push({op:"lineTo",data:[t[0]+ie(e,n),t[1]+ie(e,n)]})}}else 3===r?(o.push({op:"move",data:[e[1][0],e[1][1]]}),o.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):2===r&&o.push(...ae(e[0][0],e[0][1],e[1][0],e[1][1],n));return o}function ue(e,t,n,r,o,i,a,l){const s=[],c=[],u=ie(.5,l)-Math.PI/2,d=0===l.roughness;d||c.push([ie(i,l)+t+.9*r*Math.cos(u-e),ie(i,l)+n+.9*o*Math.sin(u-e)]);const p=2*Math.PI+(d?0:u-.01);for(let a=u;a<p;a+=e){const e=[ie(i,l)+t+r*Math.cos(a),ie(i,l)+n+o*Math.sin(a)];s.push(e),c.push(e)}return d||(c.push([ie(i,l)+t+r*Math.cos(u+2*Math.PI+.5*a),ie(i,l)+n+o*Math.sin(u+2*Math.PI+.5*a)]),c.push([ie(i,l)+t+.98*r*Math.cos(u+a),ie(i,l)+n+.98*o*Math.sin(u+a)]),c.push([ie(i,l)+t+.9*r*Math.cos(u+.5*a),ie(i,l)+n+.9*o*Math.sin(u+.5*a)])),[c,s]}function de(e,t,n,r,o,i,a,l,s){const c=i+ie(.1,s),u=[];u.push([ie(l,s)+t+.9*r*Math.cos(c-e),ie(l,s)+n+.9*o*Math.sin(c-e)]);for(let i=c;i<=a;i+=e)u.push([ie(l,s)+t+r*Math.cos(i),ie(l,s)+n+o*Math.sin(i)]);return u.push([t+r*Math.cos(a),n+o*Math.sin(a)]),u.push([t+r*Math.cos(a),n+o*Math.sin(a)]),ce(u,null,s)}function pe(e,t,n,r,o,i,a,l){const s=[],c=[l.maxRandomnessOffset||1,(l.maxRandomnessOffset||1)+.3];let u=[0,0];const d=l.disableMultiStroke?1:2,p=l.preserveVertices;for(let f=0;f<d;f++)0===f?s.push({op:"move",data:[a[0],a[1]]}):s.push({op:"move",data:[a[0]+(p?0:ie(c[0],l)),a[1]+(p?0:ie(c[0],l))]}),u=p?[o,i]:[o+ie(c[f],l),i+ie(c[f],l)],s.push({op:"bcurveTo",data:[e+ie(c[f],l),t+ie(c[f],l),n+ie(c[f],l),r+ie(c[f],l),u[0],u[1]]});return s}function fe(e){return[...e]}function he(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function ge(e,t,n){const r=he(t,n);if(0===r)return he(e,t);let o=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return o=Math.max(0,Math.min(1,o)),he(e,me(t,n,o))}function me(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function ve(e,t,n,r){const o=r||[];if(function(e,t){const n=e[t+0],r=e[t+1],o=e[t+2],i=e[t+3];let a=3*r[0]-2*n[0]-i[0];a*=a;let l=3*r[1]-2*n[1]-i[1];l*=l;let s=3*o[0]-2*i[0]-n[0];s*=s;let c=3*o[1]-2*i[1]-n[1];return c*=c,a<s&&(a=s),l<c&&(l=c),a+l}(e,t)<n){const n=e[t+0];if(o.length){(i=o[o.length-1],a=n,Math.sqrt(he(i,a)))>1&&o.push(n)}else o.push(n);o.push(e[t+3])}else{const r=.5,i=e[t+0],a=e[t+1],l=e[t+2],s=e[t+3],c=me(i,a,r),u=me(a,l,r),d=me(l,s,r),p=me(c,u,r),f=me(u,d,r),h=me(p,f,r);ve([i,c,p,h],0,n,o),ve([h,f,d,s],0,n,o)}var i,a;return o}function be(e,t){return ye(e,0,e.length,t)}function ye(e,t,n,r,o){const i=o||[],a=e[t],l=e[n-1];let s=0,c=1;for(let r=t+1;r<n-1;++r){const t=ge(e[r],a,l);t>s&&(s=t,c=r)}return Math.sqrt(s)>r?(ye(e,t,c+1,r,i),ye(e,c,n,r,i)):(i.length||i.push(a),i.push(l)),i}function xe(e,t=.15,n){const r=[],o=(e.length-1)/3;for(let n=0;n<o;n++){ve(e,3*n,t,r)}return n&&n>0?ye(r,0,r.length,n):r}const we="none";class ke{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,t,n){return{shape:e,sets:t||[],options:n||this.defaultOptions}}line(e,t,n,r,o){const i=this._o(o);return this._d("line",[Y(e,t,n,r,i)],i)}rectangle(e,t,n,r,o){const i=this._o(o),a=[],l=X(e,t,n,r,i);if(i.fill){const o=[[e,t],[e+n,t],[e+n,t+r],[e,t+r]];"solid"===i.fillStyle?a.push(te([o],i)):a.push(ne([o],i))}return i.stroke!==we&&a.push(l),this._d("rectangle",a,i)}ellipse(e,t,n,r,o){const i=this._o(o),a=[],l=Q(n,r,i),s=J(e,t,i,l);if(i.fill)if("solid"===i.fillStyle){const n=J(e,t,i,l).opset;n.type="fillPath",a.push(n)}else a.push(ne([s.estimatedPoints],i));return i.stroke!==we&&a.push(s.opset),this._d("ellipse",a,i)}circle(e,t,n,r){const o=this.ellipse(e,t,n,n,r);return o.shape="circle",o}linearPath(e,t){const n=this._o(t);return this._d("linearPath",[q(e,!1,n)],n)}arc(e,t,n,r,o,i,a=!1,l){const s=this._o(l),c=[],u=ee(e,t,n,r,o,i,a,!0,s);if(a&&s.fill)if("solid"===s.fillStyle){const a=Object.assign({},s);a.disableMultiStroke=!0;const l=ee(e,t,n,r,o,i,!0,!1,a);l.type="fillPath",c.push(l)}else c.push(function(e,t,n,r,o,i,a){const l=e,s=t;let c=Math.abs(n/2),u=Math.abs(r/2);c+=ie(.01*c,a),u+=ie(.01*u,a);let d=o,p=i;for(;d<0;)d+=2*Math.PI,p+=2*Math.PI;p-d>2*Math.PI&&(d=0,p=2*Math.PI);const f=(p-d)/a.curveStepCount,h=[];for(let e=d;e<=p;e+=f)h.push([l+c*Math.cos(e),s+u*Math.sin(e)]);return h.push([l+c*Math.cos(p),s+u*Math.sin(p)]),h.push([l,s]),ne([h],a)}(e,t,n,r,o,i,s));return s.stroke!==we&&c.push(u),this._d("arc",c,s)}curve(e,t){const n=this._o(t),r=[],o=$(e,n);if(n.fill&&n.fill!==we&&e.length>=3){const t=function(e,t=0){const n=e.length;if(n<3)throw new Error("A curve must have at least three points.");const r=[];if(3===n)r.push(fe(e[0]),fe(e[1]),fe(e[2]),fe(e[2]));else{const n=[];n.push(e[0],e[0]);for(let t=1;t<e.length;t++)n.push(e[t]),t===e.length-1&&n.push(e[t]);const o=[],i=1-t;r.push(fe(n[0]));for(let e=1;e+2<n.length;e++){const t=n[e];o[0]=[t[0],t[1]],o[1]=[t[0]+(i*n[e+1][0]-i*n[e-1][0])/6,t[1]+(i*n[e+1][1]-i*n[e-1][1])/6],o[2]=[n[e+1][0]+(i*n[e][0]-i*n[e+2][0])/6,n[e+1][1]+(i*n[e][1]-i*n[e+2][1])/6],o[3]=[n[e+1][0],n[e+1][1]],r.push(o[1],o[2],o[3])}}return r}(e),o=xe(t,10,(1+n.roughness)/2);"solid"===n.fillStyle?r.push(te([o],n)):r.push(ne([o],n))}return n.stroke!==we&&r.push(o),this._d("curve",r,n)}polygon(e,t){const n=this._o(t),r=[],o=q(e,!0,n);return n.fill&&("solid"===n.fillStyle?r.push(te([e],n)):r.push(ne([e],n))),n.stroke!==we&&r.push(o),this._d("polygon",r,n)}path(e,t){const n=this._o(t),r=[];if(!e)return this._d("path",r,n);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const o=n.fill&&"transparent"!==n.fill&&n.fill!==we,i=n.stroke!==we,a=!!(n.simplification&&n.simplification<1),l=function(e,t,n){const r=G(V(U(e))),o=[];let i=[],a=[0,0],l=[];const s=()=>{l.length>=4&&i.push(...xe(l,t)),l=[]},c=()=>{s(),i.length&&(o.push(i),i=[])};for(const{key:e,data:t}of r)switch(e){case"M":c(),a=[t[0],t[1]],i.push(a);break;case"L":s(),i.push([t[0],t[1]]);break;case"C":if(!l.length){const e=i.length?i[i.length-1]:a;l.push([e[0],e[1]])}l.push([t[0],t[1]]),l.push([t[2],t[3]]),l.push([t[4],t[5]]);break;case"Z":s(),i.push([a[0],a[1]])}if(c(),!n)return o;const u=[];for(const e of o){const t=be(e,n);t.length&&u.push(t)}return u}(e,1,a?4-4*n.simplification:(1+n.roughness)/2);return o&&("solid"===n.fillStyle?r.push(te(l,n)):r.push(ne(l,n))),i&&(a?l.forEach((e=>{r.push(q(e,!1,n))})):r.push(function(e,t){const n=G(V(U(e))),r=[];let o=[0,0],i=[0,0];for(const{key:e,data:a}of n)switch(e){case"M":{const e=1*(t.maxRandomnessOffset||0),n=t.preserveVertices;r.push({op:"move",data:a.map((r=>r+(n?0:ie(e,t))))}),i=[a[0],a[1]],o=[a[0],a[1]];break}case"L":r.push(...ae(i[0],i[1],a[0],a[1],t)),i=[a[0],a[1]];break;case"C":{const[e,n,o,l,s,c]=a;r.push(...pe(e,n,o,l,s,c,i,t)),i=[s,c];break}case"Z":r.push(...ae(i[0],i[1],o[0],o[1],t)),i=[o[0],o[1]]}return{type:"path",ops:r}}(e,n))),this._d("path",r,n)}opsToPath(e,t){let n="";for(const r of e.ops){const e="number"==typeof t&&t>=0?r.data.map((e=>+e.toFixed(t))):r.data;switch(r.op){case"move":n+=`M${e[0]} ${e[1]} `;break;case"bcurveTo":n+=`C${e[0]} ${e[1]}, ${e[2]} ${e[3]}, ${e[4]} ${e[5]} `;break;case"lineTo":n+=`L${e[0]} ${e[1]} `}}return n.trim()}toPaths(e){const t=e.sets||[],n=e.options||this.defaultOptions,r=[];for(const e of t){let t=null;switch(e.type){case"path":t={d:this.opsToPath(e),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:we};break;case"fillPath":t={d:this.opsToPath(e),stroke:we,strokeWidth:0,fill:n.fill||we};break;case"fillSketch":t=this.fillSketch(e,n)}t&&r.push(t)}return r}fillSketch(e,t){let n=t.fillWeight;return n<0&&(n=t.strokeWidth/2),{d:this.opsToPath(e),stroke:t.fill||we,strokeWidth:n,fill:we}}}class Se{constructor(e,t){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new ke(t)}draw(e){const t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.ctx,o=e.options.fixedDecimalPlaceDigits;for(const i of t)switch(i.type){case"path":r.save(),r.strokeStyle="none"===n.stroke?"transparent":n.stroke,r.lineWidth=n.strokeWidth,n.strokeLineDash&&r.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(r.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(r,i,o),r.restore();break;case"fillPath":{r.save(),r.fillStyle=n.fill||"";const t="curve"===e.shape||"polygon"===e.shape||"path"===e.shape?"evenodd":"nonzero";this._drawToContext(r,i,o,t),r.restore();break}case"fillSketch":this.fillSketch(r,i,n)}}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||"",e.lineWidth=r,this._drawToContext(e,t,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,t,n,r="nonzero"){e.beginPath();for(const r of t.ops){const t="number"==typeof n&&n>=0?r.data.map((e=>+e.toFixed(n))):r.data;switch(r.op){case"move":e.moveTo(t[0],t[1]);break;case"bcurveTo":e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]);break;case"lineTo":e.lineTo(t[0],t[1])}}"fillPath"===t.type?e.fill(r):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,t,n,r,o){const i=this.gen.line(e,t,n,r,o);return this.draw(i),i}rectangle(e,t,n,r,o){const i=this.gen.rectangle(e,t,n,r,o);return this.draw(i),i}ellipse(e,t,n,r,o){const i=this.gen.ellipse(e,t,n,r,o);return this.draw(i),i}circle(e,t,n,r){const o=this.gen.circle(e,t,n,r);return this.draw(o),o}linearPath(e,t){const n=this.gen.linearPath(e,t);return this.draw(n),n}polygon(e,t){const n=this.gen.polygon(e,t);return this.draw(n),n}arc(e,t,n,r,o,i,a=!1,l){const s=this.gen.arc(e,t,n,r,o,i,a,l);return this.draw(s),s}curve(e,t){const n=this.gen.curve(e,t);return this.draw(n),n}path(e,t){const n=this.gen.path(e,t);return this.draw(n),n}}const Ee="http://www.w3.org/2000/svg";class je{constructor(e,t){this.svg=e,this.gen=new ke(t)}draw(e){const t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.svg.ownerDocument||window.document,o=r.createElementNS(Ee,"g"),i=e.options.fixedDecimalPlaceDigits;for(const a of t){let t=null;switch(a.type){case"path":t=r.createElementNS(Ee,"path"),t.setAttribute("d",this.opsToPath(a,i)),t.setAttribute("stroke",n.stroke),t.setAttribute("stroke-width",n.strokeWidth+""),t.setAttribute("fill","none"),n.strokeLineDash&&t.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&t.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":t=r.createElementNS(Ee,"path"),t.setAttribute("d",this.opsToPath(a,i)),t.setAttribute("stroke","none"),t.setAttribute("stroke-width","0"),t.setAttribute("fill",n.fill||""),"curve"!==e.shape&&"polygon"!==e.shape||t.setAttribute("fill-rule","evenodd");break;case"fillSketch":t=this.fillSketch(r,a,n)}t&&o.appendChild(t)}return o}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2);const o=e.createElementNS(Ee,"path");return o.setAttribute("d",this.opsToPath(t,n.fixedDecimalPlaceDigits)),o.setAttribute("stroke",n.fill||""),o.setAttribute("stroke-width",r+""),o.setAttribute("fill","none"),n.fillLineDash&&o.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&o.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),o}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,t){return this.gen.opsToPath(e,t)}line(e,t,n,r,o){const i=this.gen.line(e,t,n,r,o);return this.draw(i)}rectangle(e,t,n,r,o){const i=this.gen.rectangle(e,t,n,r,o);return this.draw(i)}ellipse(e,t,n,r,o){const i=this.gen.ellipse(e,t,n,r,o);return this.draw(i)}circle(e,t,n,r){const o=this.gen.circle(e,t,n,r);return this.draw(o)}linearPath(e,t){const n=this.gen.linearPath(e,t);return this.draw(n)}polygon(e,t){const n=this.gen.polygon(e,t);return this.draw(n)}arc(e,t,n,r,o,i,a=!1,l){const s=this.gen.arc(e,t,n,r,o,i,a,l);return this.draw(s)}curve(e,t){const n=this.gen.curve(e,t);return this.draw(n)}path(e,t){const n=this.gen.path(e,t);return this.draw(n)}}const _e={canvas:(e,t)=>new Se(e,t),svg:(e,t)=>new je(e,t),generator:e=>new ke(e),newSeed:()=>ke.newSeed()};function Ce(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Ce(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Oe(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Ce(e))&&(r&&(r+=" "),r+=t);return r}let Ie=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;){let r=63&n[e];t+=r<36?r.toString(36):r<62?(r-26).toString(36).toUpperCase():r<63?"_":"-"}return t};var Me=function(e){return!!e&&"image"===e.type&&!!e.fileId},Pe=function(e){return!!e&&"image"===e.type},Te=function(e){return null!=e&&"text"===e.type},Le=function(e){return null!=e&&Ae(e.type)},Ae=function(e){return"freedraw"===e},De=function(e){return null!=e&&ze(e.type)},ze=function(e){return"arrow"===e||"line"===e},Ne=function(e){return null!=e&&He(e.type)},He=function(e){return"arrow"===e},Re=function(e){return null!=e&&("rectangle"===e.type||"diamond"===e.type||"ellipse"===e.type||"text"===e.type)},Be=function(e,t,n,r,o){return[(e-n)*Math.cos(o)-(t-r)*Math.sin(o)+n,(e-n)*Math.sin(o)+(t-r)*Math.cos(o)+r]},Fe=function(e,t,n){return Be(e[0],e[1],t[0],t[1],n)},Ue=function(e,t,n,r,o,i,a,l){var s=Math.cos(r),c=Math.sin(r);return e.e&&e.w?t+=o+a:e.e?(t+=o*(1+s),n+=o*c,t+=a*(1-s),n+=a*-c):e.w&&(t+=o*(1-s),n+=o*-c,t+=a*(1+s),n+=a*c),e.n&&e.s?n+=i+l:e.n?(t+=i*c,n+=i*(1-s),t+=l*-c,n+=l*(1+s)):e.s&&(t+=i*-c,n+=i*(1+s),t+=l*c,n+=l*(1-s)),[t,n]},Ve=function(e,t,n,r){var o=n-e,i=r-t;return Math.hypot(o,i)},Ge=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(e.length>=3){var n=[e[0],e[e.length-1]],r=n[0],o=n[1],i=Ve(r[0],r[1],o[0],o[1]);return i<=c.qx/t}return!1},We=function(e,t,n){var r=e.length;if(r<3)return!1;for(var o=[Number.MAX_SAFE_INTEGER,n],i=[t,n],a=0,l=0;l<r;l++){var s=e[l],c=e[(l+1)%r];if(Ye(s,c,i,o)){if(0===Ze(s,i,c))return Ke(s,i,c);a++}}return a%2==1},Ke=function(e,t,n){return t[0]<=Math.max(e[0],n[0])&&t[0]>=Math.min(e[0],n[0])&&t[1]<=Math.max(e[1],n[1])&&t[1]>=Math.min(e[1],n[1])},Ze=function(e,t,n){var r=(t[1]-e[1])*(n[0]-t[0])-(t[0]-e[0])*(n[1]-t[1]);return 0===r?0:r>0?1:2},Ye=function(e,t,n,r){var o=Ze(e,t,n),i=Ze(e,t,r),a=Ze(n,r,e),l=Ze(n,r,t);return o!==i&&a!==l||(!(0!==o||!Ke(e,n,t))||(!(0!==i||!Ke(e,r,t))||(!(0!==a||!Ke(n,e,r))||!(0!==l||!Ke(n,t,r)))))},qe=function(e,t,n){return n?[Math.round(e/n)*n,Math.round(t/n)*n]:[e,t]},Xe=function(e){var t=e.map((function(e){return e[0]})),n=e.map((function(e){return e[1]}));return{width:Math.max.apply(Math,t)-Math.min.apply(Math,t),height:Math.max.apply(Math,n)-Math.min.apply(Math,n)}},$e=function(e,t,n){var r=n.map((function(t){return t[e]})),o=Math.max.apply(Math,r),i=Math.min.apply(Math,r),a=o-i,l=0===a?1:t/a,s=1/0,c=n.map((function(t){return t.map((function(t,n){if(n!==e)return t;var r=t*l;return s=Math.min(r,s),r}))}));if(2===c.length)return c;var u=i-s;return c.map((function(t){return t.map((function(t,n){return n===e?t+u:t}))}))},Qe=function(e){return Le(e)?nt(e):De(e)?rt(e):[e.x,e.y,e.x+e.width,e.y+e.height]},Je=function(e){for(var t=0,n=e.sets;t<n.length;t++){var r=n[t];if("path"===r.type)return r.ops}return e.sets[0].ops},et=function(e,t){var n=[0,0],r=e.reduce((function(e,r){var o,i=r.op,a=r.data;if("move"===i)n=a;else if("bcurveTo"===i){var l=[a[0],a[1]],s=[a[2],a[3]],c=[a[4],a[5]],u=n;n=c;for(var d=function(e,t){return Math.pow(1-e,3)*c[t]+3*e*Math.pow(1-e,2)*s[t]+3*Math.pow(e,2)*(1-e)*l[t]+u[t]*Math.pow(e,3)},p=0;p<=1;){var f=d(p,0),h=d(p,1);t&&(f=(o=t(f,h))[0],h=o[1]),e.minY=Math.min(e.minY,h),e.minX=Math.min(e.minX,f),e.maxX=Math.max(e.maxX,f),e.maxY=Math.max(e.maxY,h),p+=.1}}return e}),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return[r.minX,r.minY,r.maxX,r.maxY]},tt=function(e){for(var t=1/0,n=1/0,r=-1/0,o=-1/0,i=0,a=e;i<a.length;i++){var l=a[i],s=l[0],c=l[1];t=Math.min(t,s),n=Math.min(n,c),r=Math.max(r,s),o=Math.max(o,c)}return[t,n,r,o]},nt=function(e){var t=tt(e.points),n=t[0],r=t[1],o=t[2],i=t[3];return[n+e.x,r+e.y,o+e.x,i+e.y]},rt=function(e){var t;if(e.points.length<2||!jr(e)){var n=e.points.reduce((function(e,t){var n=t[0],r=t[1];return e.minY=Math.min(e.minY,r),e.minX=Math.min(e.minX,n),e.maxX=Math.max(e.maxX,n),e.maxY=Math.max(e.maxY,r),e}),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}),r=n.minX,o=n.minY,i=n.maxX,a=n.maxY;t=[r+e.x,o+e.y,i+e.x,a+e.y]}else{var l=jr(e),s=Je(l[0]),c=et(s);r=c[0],o=c[1],i=c[2],a=c[3];t=[r+e.x,o+e.y,i+e.x,a+e.y]}return t},ot=function(e){var t,n=Qe(e),r=n[0],o=n[1],i=n[2],a=n[3],l=(r+i)/2,s=(o+a)/2;if(Le(e)){var c=tt(e.points.map((function(t){var n=t[0],r=t[1];return Be(n,r,l-e.x,s-e.y,e.angle)}))),u=c[0],d=c[1],p=c[2],f=c[3];return[u+e.x,d+e.y,p+e.x,f+e.y]}if(De(e))t=function(e,t,n){if(e.points.length<2||!jr(e)){var r=e.points.reduce((function(r,o){var i,a=o[0],l=o[1];return a=(i=Be(e.x+a,e.y+l,t,n,e.angle))[0],l=i[1],r.minY=Math.min(r.minY,l),r.minX=Math.min(r.minX,a),r.maxX=Math.max(r.maxX,a),r.maxY=Math.max(r.maxY,l),r}),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return[r.minX,r.minY,r.maxX,r.maxY]}var o=jr(e),i=Je(o[0]);return et(i,(function(r,o){return Be(e.x+r,e.y+o,t,n,e.angle)}))}(e,l,s);else if("diamond"===e.type){var h=Be(l,o,l,s,e.angle),g=h[0],m=h[1],v=Be(l,a,l,s,e.angle),b=v[0],y=v[1],x=Be(r,s,l,s,e.angle),w=x[0],k=x[1],S=Be(i,s,l,s,e.angle),E=S[0],j=S[1];t=[u=Math.min(g,b,w,E),d=Math.min(m,y,k,j),p=Math.max(g,b,w,E),f=Math.max(m,y,k,j)]}else if("ellipse"===e.type){var _=(i-r)/2,C=(a-o)/2,O=Math.cos(e.angle),I=Math.sin(e.angle),M=Math.hypot(_*O,C*I),P=Math.hypot(C*O,_*I);t=[l-M,s-P,l+M,s+P]}else{var T=Be(r,o,l,s,e.angle),L=(g=T[0],m=T[1],Be(r,a,l,s,e.angle)),A=(b=L[0],y=L[1],Be(i,a,l,s,e.angle)),D=(w=A[0],k=A[1],Be(i,o,l,s,e.angle));E=D[0],j=D[1];t=[u=Math.min(g,b,w,E),d=Math.min(m,y,k,j),p=Math.max(g,b,w,E),f=Math.max(m,y,k,j)]}return t},it=function(e){if(!e.length)return[0,0,0,0];var t=1/0,n=-1/0,r=1/0,o=-1/0;return e.forEach((function(e){var i=ot(e),a=i[0],l=i[1],s=i[2],c=i[3];t=Math.min(t,a),r=Math.min(r,l),n=Math.max(n,s),o=Math.max(o,c)})),[t,r,n,o]},at=function(e,t,n){if(!De(e)&&!Le(e))return[e.x,e.y,e.x+t,e.y+n];var r,o=$e(0,t,$e(1,n,e.points));if(Le(e))r=tt(o);else{var i=_e.generator(),a="sharp"===e.strokeSharpness?i.linearPath(o,Cr(e)):i.curve(o,Cr(e)),l=Je(a);r=et(l)}var s=r[0],c=r[1],u=r[2],d=r[3];return[s+e.x,c+e.y,u+e.x,d+e.y]},lt=function(e,t,n){var r=_e.generator(),o="sharp"===n?r.linearPath(t,Cr(e)):r.curve(t,Cr(e)),i=Je(o),a=et(i),l=a[0],s=a[1],c=a[2],u=a[3];return[l+e.x,s+e.y,c+e.x,u+e.y]},st=function(e){var t=it(e);return{minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}};const ct=JSON.parse('{"white":"#ffffff","black":"#000000","gray":["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],"red":["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],"pink":["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],"grape":["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],"violet":["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],"indigo":["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],"blue":["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],"cyan":["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],"teal":["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],"green":["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],"lime":["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],"yellow":["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],"orange":["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]}');var ut=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},dt=function(e){return[ct.red[e],ct.pink[e],ct.grape[e],ct.violet[e],ct.indigo[e],ct.blue[e],ct.cyan[e],ct.teal[e],ct.green[e],ct.lime[e],ct.yellow[e],ct.orange[e]]};const pt={canvasBackground:ut([ct.white,ct.gray[0],ct.gray[1]],dt(0),!0),elementBackground:ut(["transparent",ct.gray[4],ct.gray[6]],dt(6),!0),elementStroke:ut([ct.black,ct.gray[8],ct.gray[7]],dt(9),!0)};var ft=n(5156),ht=/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),gt=/^Win/.test(window.navigator.platform),mt="Equal",vt="Minus",bt="NumpadAdd",yt="NumpadSubtract",xt="Numpad0",wt="BracketRight",kt="BracketLeft",St="Digit1",Et="Digit2",jt="Quote",_t="Digit0",Ct="Slash",Ot="KeyC",It="KeyD",Mt="KeyG",Pt="KeyF",Tt="KeyH",Lt="KeyV",At="KeyX",Dt="KeyZ",zt="KeyR",Nt="ArrowDown",Ht="ArrowLeft",Rt="ArrowRight",Bt="ArrowUp",Ft="Backspace",Ut="Alt",Vt=ht?"metaKey":"ctrlKey",Gt="Delete",Wt="Enter",Kt="Escape",Zt="?",Yt=" ",qt="Tab",Xt="a",$t="d",Qt="e",Jt="g",en="l",tn="o",nn="p",rn="q",on="r",an="s",ln="t",sn="v",cn="x",un="y",dn="z",pn=function(e){return e===Ht||e===Rt||e===Nt||e===Bt},fn=function(e){return e.altKey},hn=function(e){return e.shiftKey},gn=function(e){return e.shiftKey},mn=null,vn=function(){if(mn)return mn;var e=new Date,t=e.getFullYear(),n="".concat(e.getMonth()+1).padStart(2,"0"),r="".concat(e.getDate()).padStart(2,"0"),o="".concat(e.getHours()).padStart(2,"0"),i="".concat(e.getMinutes()).padStart(2,"0");return"".concat(t,"-").concat(n,"-").concat(r,"-").concat(o).concat(i)},bn=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},yn=function(e){return e instanceof HTMLElement&&"wysiwyg"===e.dataset.type||e instanceof HTMLBRElement||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&("text"===e.type||"number"===e.type)},xn=function(e){for(var t=e.fontFamily,n=0,r=Object.entries(c.ut);n<r.length;n++){var o=r[n],i=o[0];if(o[1]===t)return"".concat(i,", ").concat(c._D)}return c._D},wn=function(e){var t=e.fontSize,n=e.fontFamily;return"".concat(t,"px ").concat(xn({fontFamily:n}))},kn=function(e,t){var n=document.createElement("div"),r=document.body;n.style.position="absolute",n.style.whiteSpace="pre",n.style.font=t,r.appendChild(n),n.innerText=e.split("\n").map((function(e){return e||" "})).join("\n");var o=n.offsetWidth,i=n.offsetHeight,a=document.createElement("span");a.style.display="inline-block",a.style.overflow="hidden",a.style.width="1px",a.style.height="1px",n.appendChild(a);var l=a.offsetTop+a.offsetHeight;return document.body.removeChild(n),{width:o,height:i,baseline:l}},Sn=function(e,t){var n=0,r=null,o=function(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];r=i,clearTimeout(n),n=window.setTimeout((function(){r=null,e.apply(void 0,i)}),t)};return o.flush=function(){if(clearTimeout(n),r){var t=r;r=null,e.apply(void 0,t)}},o.cancel=function(){r=null,clearTimeout(n)},o},En=function(e,t){return Math.abs(e-t)},jn=function(e){e&&(e.style.cursor="")},_n=function(e,t){e&&(e.style.cursor=t)},Cn=function(e,t){e&&("selection"===t?jn(e):"image"!==t&&(e.style.cursor=c.oc.CROSSHAIR))},On=function(){var e;return"HTML"===(null===(e=document.fullscreenElement)||void 0===e?void 0:e.nodeName)},In=function(e){return e=e.replace(/\bAlt\b/i,"Alt").replace(/\bShift\b/i,"Shift").replace(/\b(Enter|Return)\b/i,"Enter").replace(/\bDel\b/i,"Delete"),ht?e.replace(/\bCtrlOrCmd\b/i,"Cmd").replace(/\bAlt\b/i,"Option"):e.replace(/\bCtrlOrCmd\b/i,"Ctrl")},Mn=function(e,t){var n=e.clientX,r=e.clientY,o=t.zoom,i=t.offsetLeft,a=t.offsetTop,l=t.scrollX,s=t.scrollY,c=1/o.value;return{x:(n-o.translation.x-i)*c-l,y:(r-o.translation.y-a)*c-s}},Pn=function(e,t){var n=e.sceneX,r=e.sceneY,o=t.zoom,i=t.offsetLeft,a=t.offsetTop,l=t.scrollX,s=t.scrollY;return{x:(n+l+i)*o.value+o.translation.x,y:(r+s+a)*o.value+o.translation.y}},Tn=function(e){return getComputedStyle(document.documentElement).getPropertyValue("--".concat(e))},Ln=new RegExp("^[^".concat("A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-﷾--","]*[").concat("֑-߿יִ-﷽ﹰ-ﻼ","]")),An=function(e){return Ln.test(e)},Dn=function(e){return{x:e[0],y:e[1]}},zn=function(e){if("AbortError"!==(null==e?void 0:e.name))throw e;console.warn(e)},Nn=function(e){var t=5===e.length&&"0"===e.substr(4,1),n=9===e.length&&"00"===e.substr(7,2);return t||n||e===pt.elementBackground[0]},Hn=function(e){return function(t){(0,ft.unstable_batchedUpdates)(e,t)}},Rn=function(){return Date.now()},Bn=function(e){return e.reduce((function(e,t){return e.set("string"==typeof t?t:t.id,t),e}),new Map)},Fn=c.ZB.includes(devicePixelRatio)?devicePixelRatio:1,Un=function(){return{theme:c.C6.LIGHT,collaborators:new Map,currentChartType:"bar",currentItemBackgroundColor:"transparent",currentItemEndArrowhead:"arrow",currentItemFillStyle:"hachure",currentItemFontFamily:c.rk,currentItemFontSize:c.n5,currentItemLinearStrokeSharpness:"round",currentItemOpacity:100,currentItemRoughness:1,currentItemStartArrowhead:null,currentItemStrokeColor:ct.black,currentItemStrokeSharpness:"sharp",currentItemStrokeStyle:"solid",currentItemStrokeWidth:1,currentItemTextAlign:c.Hg,cursorButton:"up",draggingElement:null,editingElement:null,editingGroupId:null,editingLinearElement:null,elementLocked:!1,elementType:"selection",errorMessage:null,exportBackground:!0,exportScale:Fn,exportEmbedScene:!1,exportWithDarkMode:!1,fileHandle:null,gridSize:null,isBindingEnabled:!0,isLibraryOpen:!1,isLoading:!1,isResizing:!1,isRotating:!1,lastPointerDownWith:"mouse",multiElement:null,name:"".concat(S("labels.untitled"),"-").concat(vn()),openMenu:null,openPopup:null,pasteDialog:{shown:!1,data:null},previousSelectedElementIds:{},resizingElement:null,scrolledOutside:!1,scrollX:0,scrollY:0,selectedElementIds:{},selectedGroupIds:{},selectionElement:null,shouldCacheIgnoreZoom:!1,showHelpDialog:!1,showStats:!1,startBoundElement:null,suggestedBindings:[],toastMessage:null,viewBackgroundColor:ct.white,zenModeEnabled:!1,zoom:{value:1,translation:{x:0,y:0}},viewModeEnabled:!1,pendingImageElement:null}},Vn={theme:{browser:!0,export:!1,server:!1},collaborators:{browser:!1,export:!1,server:!1},currentChartType:{browser:!0,export:!1,server:!1},currentItemBackgroundColor:{browser:!0,export:!1,server:!1},currentItemEndArrowhead:{browser:!0,export:!1,server:!1},currentItemFillStyle:{browser:!0,export:!1,server:!1},currentItemFontFamily:{browser:!0,export:!1,server:!1},currentItemFontSize:{browser:!0,export:!1,server:!1},currentItemLinearStrokeSharpness:{browser:!0,export:!1,server:!1},currentItemOpacity:{browser:!0,export:!1,server:!1},currentItemRoughness:{browser:!0,export:!1,server:!1},currentItemStartArrowhead:{browser:!0,export:!1,server:!1},currentItemStrokeColor:{browser:!0,export:!1,server:!1},currentItemStrokeSharpness:{browser:!0,export:!1,server:!1},currentItemStrokeStyle:{browser:!0,export:!1,server:!1},currentItemStrokeWidth:{browser:!0,export:!1,server:!1},currentItemTextAlign:{browser:!0,export:!1,server:!1},cursorButton:{browser:!0,export:!1,server:!1},draggingElement:{browser:!1,export:!1,server:!1},editingElement:{browser:!1,export:!1,server:!1},editingGroupId:{browser:!0,export:!1,server:!1},editingLinearElement:{browser:!1,export:!1,server:!1},elementLocked:{browser:!0,export:!1,server:!1},elementType:{browser:!0,export:!1,server:!1},errorMessage:{browser:!1,export:!1,server:!1},exportBackground:{browser:!0,export:!1,server:!1},exportEmbedScene:{browser:!0,export:!1,server:!1},exportScale:{browser:!0,export:!1,server:!1},exportWithDarkMode:{browser:!0,export:!1,server:!1},fileHandle:{browser:!1,export:!1,server:!1},gridSize:{browser:!0,export:!0,server:!0},height:{browser:!1,export:!1,server:!1},isBindingEnabled:{browser:!1,export:!1,server:!1},isLibraryOpen:{browser:!1,export:!1,server:!1},isLoading:{browser:!1,export:!1,server:!1},isResizing:{browser:!1,export:!1,server:!1},isRotating:{browser:!1,export:!1,server:!1},lastPointerDownWith:{browser:!0,export:!1,server:!1},multiElement:{browser:!1,export:!1,server:!1},name:{browser:!0,export:!1,server:!1},offsetLeft:{browser:!1,export:!1,server:!1},offsetTop:{browser:!1,export:!1,server:!1},openMenu:{browser:!0,export:!1,server:!1},openPopup:{browser:!1,export:!1,server:!1},pasteDialog:{browser:!1,export:!1,server:!1},previousSelectedElementIds:{browser:!0,export:!1,server:!1},resizingElement:{browser:!1,export:!1,server:!1},scrolledOutside:{browser:!0,export:!1,server:!1},scrollX:{browser:!0,export:!1,server:!1},scrollY:{browser:!0,export:!1,server:!1},selectedElementIds:{browser:!0,export:!1,server:!1},selectedGroupIds:{browser:!0,export:!1,server:!1},selectionElement:{browser:!1,export:!1,server:!1},shouldCacheIgnoreZoom:{browser:!0,export:!1,server:!1},showHelpDialog:{browser:!1,export:!1,server:!1},showStats:{browser:!0,export:!1,server:!1},startBoundElement:{browser:!1,export:!1,server:!1},suggestedBindings:{browser:!1,export:!1,server:!1},toastMessage:{browser:!1,export:!1,server:!1},viewBackgroundColor:{browser:!0,export:!0,server:!0},width:{browser:!1,export:!1,server:!1},zenModeEnabled:{browser:!0,export:!1,server:!1},zoom:{browser:!0,export:!1,server:!1},viewModeEnabled:{browser:!1,export:!1,server:!1},pendingImageElement:{browser:!1,export:!1,server:!1}},Gn=function(e,t){for(var n={},r=0,o=Object.keys(e);r<o.length;r++){var i=o[r],a=Vn[i];if(null!=a&&a[t]){var l=e[i];n[i]=l}}return n},Wn=function(e){return Gn(e,"browser")},Kn=function(e){return Gn(e,"export")},Zn=function(e){return Gn(e,"server")};function Yn(e,t,n,r=(e=>e)){return e*r(.5-t*(.5-n))}function qn(e,t){return[e[0]+t[0],e[1]+t[1]]}function Xn(e,t){return[e[0]-t[0],e[1]-t[1]]}function $n(e,t){return[e[0]*t,e[1]*t]}function Qn(e){return[e[1],-e[0]]}function Jn(e,t){return e[0]*t[0]+e[1]*t[1]}function er(e,t){return e[0]===t[0]&&e[1]===t[1]}function tr(e,t){return function(e){return e[0]*e[0]+e[1]*e[1]}(Xn(e,t))}function nr(e){return function(e,t){return[e[0]/t,e[1]/t]}(e,function(e){return Math.hypot(e[0],e[1])}(e))}function rr(e,t){return Math.hypot(e[1]-t[1],e[0]-t[0])}function or(e,t,n){let r=Math.sin(n),o=Math.cos(n),i=e[0]-t[0],a=e[1]-t[1],l=i*r+a*o;return[i*o-a*r+t[0],l+t[1]]}function ir(e,t,n){return qn(e,$n(Xn(t,e),n))}function ar(e,t,n){return qn(e,$n(t,n))}var{min:lr,PI:sr}=Math,cr=sr+1e-4;function ur(e,t={}){return function(e,t={}){let{size:n=16,smoothing:r=.5,thinning:o=.5,simulatePressure:i=!0,easing:a=(e=>e),start:l={},end:s={},last:c=!1}=t,{cap:u=!0,taper:d=0,easing:p=(e=>e*(2-e))}=l,{cap:f=!0,taper:h=0,easing:g=(e=>--e*e*e+1)}=s;if(0===e.length||n<=0)return[];let m,v=e[e.length-1].runningLength,b=Math.pow(n*r,2),y=[],x=[],w=e.slice(0,10).reduce(((e,t)=>{let r=t.pressure;if(i){let o=lr(1,t.distance/n),i=lr(1,1-o);r=lr(1,e+.275*o*(i-e))}return(e+r)/2}),e[0].pressure),k=Yn(n,o,e[e.length-1].pressure,a),S=e[0].vector,E=e[0].point,j=E,_=E,C=j;for(let t=0;t<e.length;t++){let{pressure:r}=e[t],{point:l,vector:s,distance:c,runningLength:u}=e[t];if(t<e.length-1&&v-u<3)continue;if(o){if(i){let e=lr(1,c/n),t=lr(1,1-e);r=lr(1,w+.275*e*(t-w))}k=Yn(n,o,r,a)}else k=n/2;void 0===m&&(m=k);let f=u<d?p(u/d):1,O=v-u<h?g((v-u)/h):1;if(k=Math.max(.01,k*Math.min(f,O)),t===e.length-1){let e=$n(Qn(s),k);y.push(Xn(l,e)),x.push(qn(l,e));continue}let I=e[t+1].vector,M=Jn(s,I);if(M<0){let e=$n(Qn(S),k);for(let t=1/13,n=0;n<=1;n+=t)_=or(Xn(l,e),l,cr*n),y.push(_),C=or(qn(l,e),l,cr*-n),x.push(C);E=_,j=C;continue}let P=$n(Qn(ir(I,s,M)),k);_=Xn(l,P),(t<=1||tr(E,_)>b)&&(y.push(_),E=_),C=qn(l,P),(t<=1||tr(j,C)>b)&&(x.push(C),j=C),w=r,S=s}let O=e[0].point.slice(0,2),I=e.length>1?e[e.length-1].point.slice(0,2):qn(e[0].point,[1,1]),M=[],P=[];if(1===e.length){if(!d&&!h||c){let e=ar(O,nr(Qn(Xn(O,I))),-(m||k)),t=[];for(let n=1/13,r=n;r<=1;r+=n)t.push(or(e,O,2*cr*r));return t}}else{if(!(d||h&&1===e.length))if(u)for(let e=1/13,t=e;t<=1;t+=e){let e=or(x[0],O,cr*t);M.push(e)}else{let e=Xn(y[0],x[0]),t=$n(e,.5),n=$n(e,.51);M.push(Xn(O,t),Xn(O,n),qn(O,n),qn(O,t))}let t=Qn(function(e){return[-e[0],-e[1]]}(e[e.length-1].vector));if(h||d&&1===e.length)P.push(I);else if(f){let e=ar(I,t,k);for(let t=1/29,n=t;n<1;n+=t)P.push(or(e,I,3*cr*n))}else P.push(qn(I,$n(t,k)),qn(I,$n(t,.99*k)),Xn(I,$n(t,.99*k)),Xn(I,$n(t,k)))}return y.concat(P,x.reverse(),M)}(function(e,t={}){var n;let{streamline:r=.5,size:o=16,last:i=!1}=t;if(0===e.length)return[];let a=.15+.85*(1-r),l=Array.isArray(e[0])?e:e.map((({x:e,y:t,pressure:n=.5})=>[e,t,n]));if(2===l.length){let e=l[1];l=l.slice(0,-1);for(let t=1;t<5;t++)l.push(ir(l[0],e,t/4))}1===l.length&&(l=[...l,[...qn(l[0],[1,1]),...l[0].slice(2)]]);let s=[{point:[l[0][0],l[0][1]],pressure:l[0][2]>=0?l[0][2]:.25,vector:[1,1],distance:0,runningLength:0}],c=!1,u=0,d=s[0],p=l.length-1;for(let e=1;e<l.length;e++){let t=i&&e===p?l[e].slice(0,2):ir(d.point,l[e],a);if(er(d.point,t))continue;let n=rr(t,d.point);if(u+=n,e<p&&!c){if(u<o)continue;c=!0}d={point:t,pressure:l[e][2]>=0?l[e][2]:.5,vector:nr(Xn(d.point,t)),distance:n,runningLength:u},s.push(d)}return s[0].vector=(null==(n=s[1])?void 0:n.vector)||[0,0],s}(e,t),t)}function dr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dr(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var fr="invert(100%) hue-rotate(180deg) saturate(1.25)",hr=Un(),gr=function(e,t){return Me(e)&&!t.imageCache.has(e.fileId)},mr=function(e,t){var n;return"dark"===t.theme&&Me(e)&&!gr(e,t)&&(null===(n=t.imageCache.get(e.fileId))||void 0===n?void 0:n.mimeType)!==c.LO.svg},vr=function(e){return[8,8+e]},br=function(e){return[1.5,6+e]},yr=function(e){return"freedraw"===e.type?12*e.strokeWidth:20},xr=document.createElement("img");xr.src="data:".concat(c.LO.svg,",").concat(encodeURIComponent('<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="image" class="svg-inline--fa fa-image fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="#888" d="M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"></path></svg>'));var wr=document.createElement("img");wr.src="data:".concat(c.LO.svg,",").concat(encodeURIComponent('<svg viewBox="0 0 668 668" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2"><path d="M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48ZM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56ZM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48Z" style="fill:#888;fill-rule:nonzero" transform="matrix(.81709 0 0 .81709 124.825 145.825)"/><path d="M256 8C119.034 8 8 119.033 8 256c0 136.967 111.034 248 248 248s248-111.034 248-248S392.967 8 256 8Zm130.108 117.892c65.448 65.448 70 165.481 20.677 235.637L150.47 105.216c70.204-49.356 170.226-44.735 235.638 20.676ZM125.892 386.108c-65.448-65.448-70-165.481-20.677-235.637L361.53 406.784c-70.203 49.356-170.226 44.736-235.638-20.676Z" style="fill:#888;fill-rule:nonzero" transform="matrix(.30366 0 0 .30366 506.822 60.065)"/></svg>'));var kr=function(e,t,n,r){switch(n.globalAlpha=e.opacity/100,e.type){case"rectangle":case"diamond":case"ellipse":n.lineJoin="round",n.lineCap="round",t.draw(jr(e));break;case"arrow":case"line":n.lineJoin="round",n.lineCap="round",jr(e).forEach((function(e){t.draw(e)}));break;case"freedraw":n.save(),n.fillStyle=e.strokeColor;var o=function(e){return Ar.get(e)}(e);n.fillStyle=e.strokeColor,n.fill(o),n.restore();break;case"image":var i,a=Me(e)?null===(i=r.imageCache.get(e.fileId))||void 0===i?void 0:i.image:void 0;null==a||a instanceof Promise?function(e,t,n){t.fillStyle="#E7E7E7",t.fillRect(0,0,e.width,e.height);var r=Math.min(e.width,e.height),o=Math.min(r,Math.min(.4*r,100));t.drawImage("error"===e.status?wr:xr,e.width/2-o/2,e.height/2-o/2,o,o)}(e,n,r.zoom.value):n.drawImage(a,0,0,e.width,e.height);break;default:if(!Te(e))throw new Error("Unimplemented type ".concat(e.type));var l=An(e.text),s=l&&!n.canvas.isConnected;s&&document.body.appendChild(n.canvas),n.canvas.setAttribute("dir",l?"rtl":"ltr"),n.save(),n.font=wn(e),n.fillStyle=e.strokeColor,n.textAlign=e.textAlign;for(var c=e.text.replace(/\r\n?/g,"\n").split("\n"),u=e.height/c.length,d=e.height-e.baseline,p="center"===e.textAlign?e.width/2:"right"===e.textAlign?e.width:0,f=0;f<c.length;f++)n.fillText(c[f],p,(f+1)*u-d);n.restore(),s&&n.canvas.remove()}n.globalAlpha=1},Sr=new WeakMap,Er=new WeakMap,jr=function(e){return Er.get(e)},_r=function(e){return Er.delete(e)},Cr=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n={seed:e.seed,strokeLineDash:"dashed"===e.strokeStyle?vr(e.strokeWidth):"dotted"===e.strokeStyle?br(e.strokeWidth):void 0,disableMultiStroke:"solid"!==e.strokeStyle,strokeWidth:"solid"!==e.strokeStyle?e.strokeWidth+.5:e.strokeWidth,fillWeight:e.strokeWidth/2,hachureGap:4*e.strokeWidth,roughness:e.roughness,stroke:e.strokeColor,preserveVertices:t,fixedDecimalPlaceDigits:0};switch(e.type){case"rectangle":case"diamond":case"ellipse":return n.fillStyle=e.fillStyle,n.fill="transparent"===e.backgroundColor?void 0:e.backgroundColor,"ellipse"===e.type&&(n.curveFitting=1),n;case"line":return Ge(e.points)&&(n.fillStyle=e.fillStyle,n.fill="transparent"===e.backgroundColor?void 0:e.backgroundColor),n;case"freedraw":case"arrow":return n;default:throw new Error("Unimplemented type ".concat(e.type))}},Or=function(e,t){var n=Er.get(e)||null;if(!n){switch(Sr.delete(e),e.type){case"rectangle":if("round"===e.strokeSharpness){var r=e.width,o=e.height,i=.25*Math.min(r,o);n=t.path("M ".concat(i," 0 L ").concat(r-i," 0 Q ").concat(r," 0, ").concat(r," ").concat(i," L ").concat(r," ").concat(o-i," Q ").concat(r," ").concat(o,", ").concat(r-i," ").concat(o," L ").concat(i," ").concat(o," Q 0 ").concat(o,", 0 ").concat(o-i," L 0 ").concat(i," Q 0 0, ").concat(i," 0"),Cr(e,!0))}else n=t.rectangle(0,0,e.width,e.height,Cr(e));break;case"diamond":var a=function(e){var t=Math.floor(e.width/2)+1,n=e.width,r=Math.floor(e.height/2)+1;return[t,0,n,r,t,e.height,0,r]}(e),l=a[0],s=a[1],c=a[2],u=a[3],d=a[4],p=a[5],f=a[6],h=a[7];n=t.polygon([[l,s],[c,u],[d,p],[f,h]],Cr(e));break;case"ellipse":n=t.ellipse(e.width/2,e.height/2,e.width,e.height,Cr(e));break;case"line":case"arrow":var g=Cr(e),m=e.points.length?e.points:[[0,0]];if(n="sharp"===e.strokeSharpness?g.fill?[t.polygon(m,g)]:[t.linearPath(m,g)]:[t.curve(m,g)],"arrow"===e.type){var v=e.startArrowhead,b=void 0===v?null:v,y=e.endArrowhead,x=void 0===y?"arrow":y,w=function(e,n,r,o){var i=function(e,t,n,r){var o=Je(t[0]);if(o.length<1)return null;var i="start"===n?1:o.length-1,a=o[i].data,l=[a[4],a[5]],s=[a[2],a[3]],c=[a[0],a[1]],u=o[i-1],d=[0,0];"move"===u.op?d=u.data:"bcurveTo"===u.op&&(d=[u.data[4],u.data[5]]);var p=function(e,t){return Math.pow(1-e,3)*l[t]+3*e*Math.pow(1-e,2)*s[t]+3*Math.pow(e,2)*(1-e)*c[t]+d[t]*Math.pow(e,3)},f="start"===n?d:l,h=f[0],g=f[1],m=[p(.3,0),p(.3,1)],v=m[0],b=m[1],y=Math.hypot(h-v,g-b),x=(h-v)/y,w=(g-b)/y,k={arrow:30,bar:15,dot:15,triangle:15}[r],S=0;if("arrow"===r){var E=e.points[e.points.length-1],j=E[0],_=E[1],C=e.points.length>1?e.points[e.points.length-2]:[0,0],O=C[0],I=C[1];S=Math.hypot(j-O,_-I)}else for(var M=0;M<e.points.length;M++){var P=e.points[M-1]||[0,0],T=(O=P[0],I=P[1],e.points[M]);j=T[0],_=T[1],S+=Math.hypot(j-O,_-I)}var L=Math.min(k,S/2),A=h-x*L,D=g-w*L;if("dot"===r)return[h,g,Math.hypot(D-g,A-h)+e.strokeWidth];var z={arrow:20,bar:90,triangle:25}[r],N=Be(A,D,h,g,-z*Math.PI/180),H=N[0],R=N[1],B=Be(A,D,h,g,z*Math.PI/180);return[h,g,H,R,B[0],B[1]]}(e,n,r,o);if(null===i)return[];if("dot"===o){var a=i[0],l=i[1],s=i[2];return[t.circle(a,l,s,pr(pr({},g),{},{fill:e.strokeColor,fillStyle:"solid",stroke:"none"}))]}if("triangle"===o){a=i[0],l=i[1];var c=i[2],u=i[3],d=i[4],p=i[5];return delete g.strokeLineDash,[t.polygon([[a,l],[c,u],[d,p],[a,l]],pr(pr({},g),{},{fill:e.strokeColor,fillStyle:"solid"}))]}var f=i[0],h=i[1],m=i[2],v=i[3],b=i[4],y=i[5];if("dotted"===e.strokeStyle){var x=br(e.strokeWidth-1);g.strokeLineDash=[x[0],x[1]-1]}else delete g.strokeLineDash;return[t.line(m,v,f,h,g),t.line(b,y,f,h,g)]};if(null!==b){var k=w(e,n,"start",b);n.push.apply(n,k)}if(null!==x){k=w(e,n,"end",x);n.push.apply(n,k)}}break;case"freedraw":Dr(e),n=[];break;case"text":case"image":n=[]}Er.set(e,n)}},Ir=function(e,t){var n=t?t.zoom:hr.zoom,r=Sr.get(e),o=r&&r.canvasZoom!==n.value&&!(null!=t&&t.shouldCacheIgnoreZoom);if(!r||o||r.theme!==t.theme){var i=function(e,t,n){var r=document.createElement("canvas"),o=r.getContext("2d"),i=yr(e),a=0,l=0;if(De(e)||Le(e)){var s=Qe(e),c=s[0],u=s[1],d=s[2],p=s[3];c=Math.floor(c),d=Math.ceil(d),u=Math.floor(u),p=Math.ceil(p),r.width=En(c,d)*window.devicePixelRatio*t.value+i*t.value*2,r.height=En(u,p)*window.devicePixelRatio*t.value+i*t.value*2,a=e.x>c?Math.floor(En(e.x,c))*window.devicePixelRatio*t.value:0,l=e.y>u?Math.floor(En(e.y,u))*window.devicePixelRatio*t.value:0,o.translate(a,l)}else r.width=e.width*window.devicePixelRatio*t.value+i*t.value*2,r.height=e.height*window.devicePixelRatio*t.value+i*t.value*2;o.save(),o.translate(i*t.value,i*t.value),o.scale(window.devicePixelRatio*t.value,window.devicePixelRatio*t.value);var f=_e.canvas(r);return mr(e,n)&&(o.filter=fr),kr(e,f,o,n),o.restore(),{element:e,canvas:r,theme:n.theme,canvasZoom:t.value,canvasOffsetX:a,canvasOffsetY:l}}(e,n,t);return Sr.set(e,i),i}return r},Mr=function(e,t,n,r){var o=e.element,i=yr(o),a=Qe(o),l=a[0],s=a[1],c=a[2],u=a[3];Le(o)&&(l=Math.floor(l),c=Math.ceil(c),s=Math.floor(s),u=Math.ceil(u));var d=((l+c)/2+r.scrollX)*window.devicePixelRatio,p=((s+u)/2+r.scrollY)*window.devicePixelRatio,f=gr(o,r),h="scale"in e.element&&!f?e.element.scale[0]:1,g="scale"in e.element&&!f?e.element.scale[1]:1;n.save(),n.scale(1/window.devicePixelRatio*h,1/window.devicePixelRatio*g),n.translate(d*h,p*g),n.rotate(o.angle*h*g),n.drawImage(e.canvas,-(c-l)/2*window.devicePixelRatio-i*e.canvasZoom/e.canvasZoom,-(u-s)/2*window.devicePixelRatio-i*e.canvasZoom/e.canvasZoom,e.canvas.width/e.canvasZoom,e.canvas.height/e.canvasZoom),n.restore()},Pr=function(e,t,n,r){var o=t.generator;switch(e.type){case"selection":n.save(),n.translate(e.x+r.scrollX,e.y+r.scrollY),n.fillStyle="rgba(0, 0, 255, 0.10)",n.fillRect(0,0,e.width,e.height),n.restore();break;case"freedraw":if(Or(e,o),r.isExporting){var i=Ir(e,r);Mr(i,0,n,r)}else{var a=Qe(e),l=a[0],s=a[1],c=a[2],u=a[3],d=(l+c)/2+r.scrollX,p=(s+u)/2+r.scrollY,f=(c-l)/2-(e.x-l),h=(u-s)/2-(e.y-s);n.save(),n.translate(d,p),n.rotate(e.angle),n.translate(-f,-h),kr(e,t,n,r),n.restore()}break;case"rectangle":case"diamond":case"ellipse":case"line":case"arrow":case"image":case"text":if(Or(e,o),r.isExporting){var g=Qe(e);l=g[0],s=g[1],c=g[2],u=g[3],d=(l+c)/2+r.scrollX,p=(s+u)/2+r.scrollY,f=(c-l)/2-(e.x-l),h=(u-s)/2-(e.y-s);n.save(),n.translate(d,p),n.rotate(e.angle),n.translate(-f,-h),mr(e,r)&&(n.filter="none"),kr(e,t,n,r),n.restore()}else{i=Ir(e,r);Mr(i,0,n,r)}break;default:throw new Error("Unimplemented type ".concat(e.type))}},Tr=function(e,t,n){if(void 0===n)return e.draw(t);var r={sets:t.sets,shape:t.shape,options:pr(pr({},t.options),{},{fixedDecimalPlaceDigits:n})};return e.draw(r)},Lr=function(e,t,n,r,o,i,a){var l=Qe(e),s=l[0],u=l[1],d=l[2],p=l[3],f=(d-s)/2-(e.x-s),h=(p-u)/2-(e.y-u),g=180*e.angle/Math.PI,m=t.generator;switch(e.type){case"selection":throw new Error("Selection rendering is not supported for SVG");case"rectangle":case"diamond":case"ellipse":Or(e,m);var v=Tr(t,jr(e),c.zK);1!==(x=e.opacity/100)&&(v.setAttribute("stroke-opacity","".concat(x)),v.setAttribute("fill-opacity","".concat(x))),v.setAttribute("stroke-linecap","round"),v.setAttribute("transform","translate(".concat(o||0," ").concat(i||0,") rotate(").concat(g," ").concat(f," ").concat(h,")")),n.appendChild(v);break;case"line":case"arrow":Or(e,m);var b=n.ownerDocument.createElementNS(c.hR,"g"),y=e.opacity/100;b.setAttribute("stroke-linecap","round"),jr(e).forEach((function(n){var r=Tr(t,n,c.zK);1!==y&&(r.setAttribute("stroke-opacity","".concat(y)),r.setAttribute("fill-opacity","".concat(y))),r.setAttribute("transform","translate(".concat(o||0," ").concat(i||0,") rotate(").concat(g," ").concat(f," ").concat(h,")")),"line"===e.type&&Ge(e.points)&&"transparent"!==e.backgroundColor&&r.setAttribute("fill-rule","evenodd"),b.appendChild(r)})),n.appendChild(b);break;case"freedraw":Dr(e);var x=e.opacity/100;v=n.ownerDocument.createElementNS(c.hR,"g");1!==x&&(v.setAttribute("stroke-opacity","".concat(x)),v.setAttribute("fill-opacity","".concat(x))),v.setAttribute("transform","translate(".concat(o||0," ").concat(i||0,") rotate(").concat(g," ").concat(f," ").concat(h,")"));var w=n.ownerDocument.createElementNS(c.hR,"path");v.setAttribute("stroke","none"),v.setAttribute("fill",e.strokeColor),w.setAttribute("d",zr(e)),v.appendChild(w),n.appendChild(v);break;case"image":var k=Me(e)&&r[e.fileId];if(k){var S="image-".concat(k.id),E=n.querySelector("#".concat(S));if(!E){(E=n.ownerDocument.createElementNS(c.hR,"symbol")).id=S;var j=n.ownerDocument.createElementNS(c.hR,"image");j.setAttribute("width","100%"),j.setAttribute("height","100%"),j.setAttribute("href",k.dataURL),E.appendChild(j),n.prepend(E)}var _=n.ownerDocument.createElementNS(c.hR,"use");_.setAttribute("href","#".concat(S)),a&&k.mimeType!==c.LO.svg&&_.setAttribute("filter",fr),_.setAttribute("width","".concat(Math.round(e.width))),_.setAttribute("height","".concat(Math.round(e.height))),_.setAttribute("transform","translate(".concat(o||0," ").concat(i||0,") rotate(").concat(g," ").concat(f," ").concat(h,")")),n.appendChild(_)}break;default:if(!Te(e))throw new Error("Unimplemented type ".concat(e.type));x=e.opacity/100,v=n.ownerDocument.createElementNS(c.hR,"g");1!==x&&(v.setAttribute("stroke-opacity","".concat(x)),v.setAttribute("fill-opacity","".concat(x))),v.setAttribute("transform","translate(".concat(o||0," ").concat(i||0,") rotate(").concat(g," ").concat(f," ").concat(h,")"));for(var C=e.text.replace(/\r\n?/g,"\n").split("\n"),O=e.height/C.length,I=e.height-e.baseline,M="center"===e.textAlign?e.width/2:"right"===e.textAlign?e.width:0,P=An(e.text)?"rtl":"ltr",T="center"===e.textAlign?"middle":"right"===e.textAlign||"rtl"===P?"end":"start",L=0;L<C.length;L++){var A=n.ownerDocument.createElementNS(c.hR,"text");A.textContent=C[L],A.setAttribute("x","".concat(M)),A.setAttribute("y","".concat((L+1)*O-I)),A.setAttribute("font-family",xn(e)),A.setAttribute("font-size","".concat(e.fontSize,"px")),A.setAttribute("fill",e.strokeColor),A.setAttribute("text-anchor",T),A.setAttribute("style","white-space: pre;"),A.setAttribute("direction",P),v.appendChild(A)}n.appendChild(v)}},Ar=new WeakMap([]);function Dr(e){var t=zr(e),n=new Path2D(t);return Ar.set(e,n),n}function zr(e){var t=e.simulatePressure?e.points:e.points.length?e.points.map((function(t,n){return[t[0],t[1],e.pressures[n]]})):[[0,0,.5]],n={simulatePressure:e.simulatePressure,size:4.25*e.strokeWidth,thinning:.6,smoothing:.5,streamline:.5,easing:function(e){return Math.sin(e*Math.PI/2)},last:!!e.lastCommittedPoint};return function(e){if(!e.length)return"";var t=e.length-1;return e.reduce((function(e,n,r,o){return r===t?e.push(n,Nr(n,o[0]),"L",o[0],"Z"):e.push(n,Nr(n,o[r+1])),e}),["M",e[0],"Q"]).join(" ").replace(Hr,"$1")}(ur(t,n))}function Nr(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}var Hr=/(\s?[A-Z]?,?-?[0-9]*\.[0-9]{0,2})(([0-9]|e|-)*)/g;var Rr=function(e){return"string"==typeof e},Br=function(){function e(){this.callbacks=new Set,this.nonDeletedElements=[],this.elements=[],this.elementsMap=new Map}return e.mapElementToScene=function(e,t){Rr(e)?this.sceneMapById.set(e,t):this.sceneMapByElement.set(e,t)},e.getScene=function(e){return Rr(e)?this.sceneMapById.get(e)||null:this.sceneMapByElement.get(e)||null},e.prototype.getElementsIncludingDeleted=function(){return this.elements},e.prototype.getElements=function(){return this.nonDeletedElements},e.prototype.getElement=function(e){return this.elementsMap.get(e)||null},e.prototype.getNonDeletedElement=function(e){var t=this.getElement(e);return t&&Ra(t)?t:null},e.prototype.getNonDeletedElements=function(e){var t=this,n=[];return e.forEach((function(e){var r=t.getNonDeletedElement(e);null!=r&&n.push(r)})),n},e.prototype.replaceAllElements=function(t){var n=this;this.elements=t,this.elementsMap.clear(),t.forEach((function(t){n.elementsMap.set(t.id,t),e.mapElementToScene(t,n)})),this.nonDeletedElements=Ha(this.elements),this.informMutation()},e.prototype.informMutation=function(){for(var e=0,t=Array.from(this.callbacks);e<t.length;e++){(0,t[e])()}},e.prototype.addCallback=function(e){var t=this;if(this.callbacks.has(e))throw new Error;return this.callbacks.add(e),function(){if(!t.callbacks.has(e))throw new Error;t.callbacks.delete(e)}},e.prototype.destroy=function(){var t=this;e.sceneMapById.forEach((function(n,r){n===t&&e.sceneMapById.delete(r)})),this.callbacks.clear()},e}();Br.sceneMapByElement=new WeakMap,Br.sceneMapById=new Map;const Fr=Br;var Ur=new R(Date.now()),Vr=function(){return Math.floor(Ur.next()*Math.pow(2,31))},Gr=function(){return Ie()};function Wr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Kr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wr(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Zr=function(e,t){var n,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=!1,i=t.points,a=t.fileId;for(var l in void 0!==i&&(t=Kr(Kr({},Xe(i)),t)),t){var s=t[l];if(void 0!==s){if(e[l]===s&&("object"!=typeof s||null===s||"groupIds"===l||"scale"===l))continue;if("scale"===l){var c=e[l],u=s;if(c[0]===u[0]&&c[1]===u[1])continue}else if("points"===l){var d=e[l],p=s;if(d.length===p.length){for(var f=!1,h=d.length;--h;){var g=d[h],m=p[h];if(g[0]!==m[0]||g[1]!==m[1]){f=!0;break}}if(!f)continue}}e[l]=s,o=!0}}if(!o)return e;(void 0===t.height&&void 0===t.width&&void 0===a&&void 0===i||_r(e),e.version++,e.versionNonce=Vr(),e.updated=Rn(),r)&&(null===(n=Fr.getScene(e))||void 0===n||n.informMutation());return e},Yr=function(e,t){var n=!1;for(var r in t){var o=t[r];if(void 0!==o){if(e[r]===o&&("object"!=typeof o||null===o))continue;n=!0}}return n?Kr(Kr(Kr({},e),t),{},{updated:Rn(),version:e.version+1,versionNonce:Vr()}):e},qr=function(e,t){return e.version=(null!=t?t:e.version)+1,e.versionNonce=Vr(),e.updated=Rn(),e},Xr=function(e){return De(e)||Le(e)?e.points.length<2:0===e.width&&0===e.height},$r=function(e,t,n){var r=Math.abs(t),o=Math.abs(n);if("line"===e||"arrow"===e||"freedraw"===e){var i=Math.round(Math.atan(o/r)/c.ay)*c.ay;0===i?n=0:i===Math.PI/2?t=0:n=Math.round(r*Math.tan(i))*Math.sign(n)||n}else"selection"!==e&&(n=r*Math.sign(n));return{width:t,height:n}},Qr=function(e){var t={width:e.width,height:e.height,x:e.x,y:e.y};if(e.width<0){var n=Math.abs(e.width);t.width=n,t.x=e.x-n}if(e.height<0){var r=Math.abs(e.height);t.height=r,t.y=e.y-r}return t};function Jr(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var eo=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};function to(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function no(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?to(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):to(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ro=function(e,t,n){var r,o,i=n.filter((function(t){return t.groupIds.includes(e)}));return i.length<2?t.selectedGroupIds[e]||t.editingGroupId===e?no(no({},t),{},{selectedGroupIds:no(no({},t.selectedGroupIds),{},(r={},r[e]=!1,r)),editingGroupId:null}):t:no(no({},t),{},{selectedGroupIds:no(no({},t.selectedGroupIds),{},(o={},o[e]=!0,o)),selectedElementIds:no(no({},t.selectedElementIds),Object.fromEntries(i.map((function(e){return[e.id,!0]}))))})},oo=function(e,t){return null!=io(e,t)},io=function(e,t){return t.groupIds.filter((function(t){return t!==e.editingGroupId})).find((function(t){return e.selectedGroupIds[t]}))},ao=function(e){return Object.entries(e.selectedGroupIds).filter((function(e){e[0];return e[1]})).map((function(e){var t=e[0];e[1];return t}))},lo=function(e,t){var n=no(no({},e),{},{selectedGroupIds:{}}),r=Wa(t,e);if(!r.length)return no(no({},n),{},{editingGroupId:null});for(var o=0,i=r;o<i.length;o++){var a=i[o].groupIds;if(e.editingGroupId){var l=a.indexOf(e.editingGroupId);l>-1&&(a=a.slice(0,l))}if(a.length>0){var s=a[a.length-1];n=ro(s,n,t)}}return n},so=function(e,t){return e.groupIds.includes(t)},co=function(e,t){return e.filter((function(e){return so(e,t)}))},uo=function(e,t,n){var r=eo([],e,!0),o=n?r.indexOf(n):-1,i=o>-1?o:r.length;return r.splice(i,0,t),r},po=["x","y","strokeColor","backgroundColor","fillStyle","strokeWidth","strokeStyle","roughness","opacity","width","height","angle","groupIds","strokeSharpness","boundElementIds"];function fo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ho(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fo(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var go=function(e,t){var n,r,o=t.x,i=t.y,a=t.strokeColor,l=t.backgroundColor,s=t.fillStyle,c=t.strokeWidth,u=t.strokeStyle,d=t.roughness,p=t.opacity,f=t.width,h=void 0===f?0:f,g=t.height,m=void 0===g?0:g,v=t.angle,b=void 0===v?0:v,y=t.groupIds,x=void 0===y?[]:y,w=t.strokeSharpness,k=t.boundElementIds,S=void 0===k?null:k,E=Jr(t,po);return{id:E.id||Gr(),type:e,x:o,y:i,width:h,height:m,angle:b,strokeColor:a,backgroundColor:l,fillStyle:s,strokeWidth:c,strokeStyle:u,roughness:d,opacity:p,groupIds:x,strokeSharpness:w,seed:null!==(n=E.seed)&&void 0!==n?n:Vr(),version:E.version||1,versionNonce:null!==(r=E.versionNonce)&&void 0!==r?r:0,isDeleted:!1,boundElementIds:S,updated:Rn()}},mo=function(e){return go(e.type,e)},vo=function(e,t){return{x:"center"===e.textAlign?t.width/2:"right"===e.textAlign?t.width:0,y:"middle"===e.verticalAlign?t.height/2:0}},bo=function(e){var t=kn(e.text,wn(e)),n=vo(e,t);return Yr(ho(ho({},go("text",e)),{},{text:e.text,fontSize:e.fontSize,fontFamily:e.fontFamily,textAlign:e.textAlign,verticalAlign:e.verticalAlign,x:e.x-n.x,y:e.y-n.y,width:t.width,height:t.height,baseline:t.baseline}),{})},yo=function(e,t){var n=t.text,r=t.isDeleted;return Yr(e,ho({text:n,isDeleted:null!=r?r:e.isDeleted},function(e,t){var n,r,o,i=kn(t,wn(e)),a=i.width,l=i.height,s=i.baseline,c=e.textAlign,u=e.verticalAlign;if("center"===c&&"middle"===u){var d=kn(e.text,wn(e)),p=vo(e,{width:a-d.width,height:l-d.height});r=e.x-p.x,o=e.y-p.y}else{var f=Qe(e),h=f[0],g=f[1],m=f[2],v=f[3],b=at(e,a,l),y=(h-b[0])/2,x=(g-b[1])/2,w=(m-b[2])/2,k=(v-b[3])/2;r=(n=Ue({s:!0,e:"center"===c||"left"===c,w:"center"===c||"right"===c},e.x,e.y,e.angle,y,x,w,k))[0],o=n[1]}return{width:a,height:l,x:Number.isFinite(r)?r:e.x,y:Number.isFinite(o)?o:e.y,baseline:s}}(e,n)))},xo=function(e){return ho(ho({},go(e.type,e)),{},{points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:e.startArrowhead,endArrowhead:e.endArrowhead})},wo=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(null==e||"object"!=typeof e)return e;if("[object Object]"===Object.prototype.toString.call(e)){var n="function"==typeof e.constructor?Object.create(Object.getPrototypeOf(e)):{};for(var r in e)if(e.hasOwnProperty(r)){if(0===t&&("shape"===r||"canvas"===r))continue;n[r]=wo(e[r],t+1)}return n}if(Array.isArray(e)){for(var o=e.length,i=new Array(o);o--;)i[o]=wo(e[o],t+1);return i}return e},ko=function(e,t,n,r){var o=wo(n);return o.id=Gr(),o.updated=Rn(),o.seed=Vr(),o.groupIds=function(e,t,n){for(var r=eo([],e,!0),o=t?e.indexOf(t):-1,i=o>-1?o:e.length,a=0;a<i;a++)r[a]=n(r[a]);return r}(o.groupIds,e,(function(e){return t.has(e)||t.set(e,Gr()),t.get(e)})),r&&(o=Object.assign(o,r)),o},So={mouse:8,pen:16,touch:28},Eo={e:!0,s:!0,n:!0,w:!0},jo={e:!0,s:!0,n:!0,w:!0},_o={e:!0,s:!0,n:!0,w:!0,nw:!0,se:!0},Co={e:!0,s:!0,n:!0,w:!0,ne:!0,sw:!0},Oo=function(e,t,n,r,o,i,a){var l=Be(e+n/2,t+r/2,o,i,a);return[l[0]-n/2,l[1]-r/2,n,r]},Io=function(e,t,n,r){var o=e[0],i=e[1],a=e[2],l=e[3],s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},c=So[r],u=c/n.value,d=c/n.value,p=c/n.value,f=c/n.value,h=a-o,g=l-i,m=(o+a)/2,v=(i+l)/2,b=4/n.value,y=(c-8)/(2*n.value),x={nw:s.nw?void 0:Oo(o-b-p+y,i-b-f+y,u,d,m,v,t),ne:s.ne?void 0:Oo(a+b-y,i-b-f+y,u,d,m,v,t),sw:s.sw?void 0:Oo(o-b-p+y,l+b-y,u,d,m,v,t),se:s.se?void 0:Oo(a+b-y,l+b-y,u,d,m,v,t),rotation:s.rotation?void 0:Oo(o+h/2-u/2,i-b-f+y-16/n.value,u,d,m,v,t)},w=5*So.mouse/n.value;return Math.abs(h)>w&&(s.n||(x.n=Oo(o+h/2-u/2,i-b-f+y,u,d,m,v,t)),s.s||(x.s=Oo(o+h/2-u/2,l+b-y,u,d,m,v,t))),Math.abs(g)>w&&(s.w||(x.w=Oo(o-b-p+y,i+g/2-d/2,u,d,m,v,t)),s.e||(x.e=Oo(a+b-y,i+g/2-d/2,u,d,m,v,t))),x},Mo=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"mouse",r={};if("arrow"===e.type||"line"===e.type||"freedraw"===e.type){if(2===e.points.length){var o=e.points,i=o[1];0===i[0]||0===i[1]?r=Co:i[0]>0&&i[1]<0?r=_o:i[0]>0&&i[1]>0?r=Co:i[0]<0&&i[1]>0?r=_o:i[0]<0&&i[1]<0&&(r=Co)}}else"text"===e.type&&(r=jo);return Io(Qe(e),e.angle,t,n,r)},Po=function(e,t){return[0,0,0,0,t,e,1,0]},To=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[0,0,0,0,0,0,0,0];if(t<0||t>7)throw new Error("Expected `index` betwen 0 and 7, got `".concat(t,"`"));return 0!==e&&(n[t]=e),n},Lo=function(e){return[e[0],e[1],e[2],e[3],-e[4],-e[5],-e[6],-e[7]]},Ao=function(e,t){return Uo(t)?[e[0]-t,e[1],e[2],e[3],e[4],e[5],e[6],e[7]]:[e[0]-t[0],e[1]-t[1],e[2]-t[2],e[3]-t[3],e[4]-t[4],e[5]-t[5],e[6]-t[6],e[7]-t[7]]},Do=function(e,t){return Uo(t)?[e[0]*t,e[1]*t,e[2]*t,e[3]*t,e[4]*t,e[5]*t,e[6]*t,e[7]*t]:[zo(e,t),t[1]*e[0]+t[0]*e[1]-t[4]*e[2]+t[5]*e[3]+t[2]*e[4]-t[3]*e[5]-t[7]*e[6]-t[6]*e[7],t[2]*e[0]+t[0]*e[2]-t[6]*e[3]+t[3]*e[6],t[3]*e[0]+t[6]*e[2]+t[0]*e[3]-t[2]*e[6],t[4]*e[0]+t[2]*e[1]-t[1]*e[2]+t[7]*e[3]+t[0]*e[4]+t[6]*e[5]-t[5]*e[6]+t[3]*e[7],t[5]*e[0]-t[3]*e[1]+t[7]*e[2]+t[1]*e[3]-t[6]*e[4]+t[0]*e[5]+t[4]*e[6]+t[2]*e[7],t[6]*e[0]+t[3]*e[2]-t[2]*e[3]+t[0]*e[6],t[7]*e[0]+t[6]*e[1]+t[5]*e[2]+t[4]*e[3]+t[3]*e[4]+t[2]*e[5]+t[1]*e[6]+t[0]*e[7]]},zo=function(e,t){return t[0]*e[0]+t[2]*e[2]+t[3]*e[3]-t[6]*e[6]},No=function(e,t){return[Ho(e,t),e[1]*t[7]+e[4]*t[5]-e[5]*t[4]+e[7]*t[1],e[2]*t[7]-e[4]*t[6]+e[6]*t[4]+e[7]*t[2],e[3]*t[7]+e[5]*t[6]-e[6]*t[5]+e[7]*t[3],e[4]*t[7]+e[7]*t[4],e[5]*t[7]+e[7]*t[5],e[6]*t[7]+e[7]*t[6],e[7]*t[7]]},Ho=function(e,t){return e[0]*t[7]+e[1]*t[6]+e[2]*t[5]+e[3]*t[4]+e[4]*t[3]+e[5]*t[2]+e[6]*t[1]+e[7]*t[0]},Ro=function(e){return Math.sqrt(Math.abs(e[0]*e[0]-e[2]*e[2]-e[3]*e[3]+e[6]*e[6]))},Bo=function(e){var t=Ro(e);if(0===t||1===t)return e;var n=e[6]<0?-1:1;return Do(e,n/t)},Fo=function(e){var t=function(e){return Math.sqrt(Math.abs(e[7]*e[7]-e[5]*e[5]-e[4]*e[4]+e[1]*e[1]))}(e);return 0===t||1===t?e:Do(e,1/t)},Uo=function(e){return"number"==typeof e},Vo=(To(1,1),To(1,2),To(1,3),To(1,4),To(1,5),To(1,6),To(1,7),function(e,t,n){return Bo([0,n,e,t,0,0,0,0])}),Go=function(e,t){return Bo(No(t,e))},Wo=function(e,t){return function(e,t){return[t[0]*e[0]+t[2]*e[2]+t[3]*e[3]-t[6]*e[6],t[1]*e[0]+t[0]*e[1]-t[4]*e[2]+t[5]*e[3]+t[2]*e[4]-t[3]*e[5]-t[7]*e[6]-t[6]*e[7],t[2]*e[0]+t[0]*e[2]-t[6]*e[3]+t[3]*e[6],t[3]*e[0]+t[6]*e[2]+t[0]*e[3]-t[2]*e[6],t[4]*e[0]+t[7]*e[3]+t[0]*e[4]+t[3]*e[7],t[5]*e[0]+t[7]*e[2]+t[0]*e[5]+t[2]*e[7],t[6]*e[0]+t[0]*e[6],t[7]*e[0]+t[0]*e[7]]}(e,t)},Ko=function(e){var t=e[0];return[0,0,0,0,e[1],t,1,0]},Zo=function(e){return[e[5],e[4]]},Yo=function(e,t){return Bo(function(e,t){return[t[0]*e[0],t[1]*e[0]+t[0]*e[1],t[2]*e[0]+t[0]*e[2],t[3]*e[0]+t[0]*e[3],t[4]*e[0]+t[2]*e[1]-t[1]*e[2]+t[0]*e[4],t[5]*e[0]-t[3]*e[1]+t[1]*e[3]+t[0]*e[5],t[6]*e[0]+t[3]*e[2]-t[2]*e[3]+t[0]*e[6],t[7]*e[0]+t[6]*e[1]+t[5]*e[2]+t[4]*e[3]+t[3]*e[4]+t[2]*e[5]+t[1]*e[6]]}(e,t))},qo=function(e,t){return Ro(No(e,t))},Xo=function(e,t){return Ho(e,t)},$o=function(e){return[0,0,0,0,e[4],e[5],0,0]},Qo=function(e,t){return function(e,t){return Uo(t)?[e[0]+t,e[1],e[2],e[3],e[4],e[5],e[6],e[7]]:[e[0]+t[0],e[1]+t[1],e[2]+t[2],e[3]+t[3],e[4]+t[4],e[5]+t[5],e[6]+t[6],e[7]+t[7]]}(Do(e,Math.sin(t/2)),Math.cos(t/2))},Jo=function(e,t){return Bo(Do(Do(e,t),Lo(e)))},ei=function(e,t,n,r){var o=10/t.zoom.value;return!ti(e,t,[n,r])&&ri(e,[n,r],o)},ti=function(e,t,n){var r=10/t.zoom.value,o="text"===e.type?si:function(e){if("arrow"===e.type)return!1;if("freedraw"===e.type)return!0;var t="transparent"!==e.backgroundColor;return"line"===e.type?t&&Ge(e.points):t||Pe(e)}(e)?ci:ui;return ai({element:e,point:n,threshold:r,check:o})},ni=function(e,t){return e.selectedElementIds[t.id]},ri=function(e,t,n){var r=t[0],o=t[1],i=Qe(e),a=i[0],l=i[1],s=i[2],c=i[3],u=Be(r,o,(a+s)/2,(l+c)/2,-e.angle),d=u[0],p=u[1];return d>a-n&&d<s+n&&p>l-n&&p<c+n},oi=function(e,t){var n=t.x,r=t.y,o=ii(e,e.width,e.height);return ai({element:e,point:[n,r],threshold:o,check:di})},ii=function(e,t,n){var r=("diamond"===e.type?1/Math.sqrt(2):1)*Math.min(t,n);return Math.max(16,Math.min(.25*r,32))},ai=function(e){switch(e.element.type){case"rectangle":case"image":case"text":case"diamond":case"ellipse":var t=li(e.element,e.point);return e.check(t,e.threshold);case"freedraw":return!!e.check(pi(e.element,e.point),e.threshold)&&mi(e.element,e.point,e.threshold);case"arrow":case"line":return vi(e);case"selection":return console.warn("This should not happen, we need to investigate why it does."),!1}},li=function(e,t){switch(e.type){case"rectangle":case"image":case"text":return pi(e,t);case"diamond":return fi(e,t);case"ellipse":return hi(e,t)}},si=function(e,t){return e<0},ci=function(e,t){return e<t},ui=function(e,t){return Math.abs(e)<t},di=function(e,t){return 0<=e&&e<t},pi=function(e,t){var n=bi(e,t),r=n[1],o=n[2],i=n[3];return Math.max(Xo(r,Vo(0,1,-i)),Xo(r,Vo(1,0,-o)))},fi=function(e,t){var n=bi(e,t),r=n[1],o=n[2],i=n[3],a=Vo(i,o,-i*o);return Xo(r,a)},hi=function(e,t){var n=gi(e,t),r=n[0],o=n[1];return-function(e){return Math.sign(e[1])}(o)*Xo(r,o)},gi=function(e,t){var n=bi(e,t),r=n[1],o=n[2],i=n[3],a=Zo(r),l=a[0],s=a[1],c=.707,u=.707,d=o,p=i;[0,1,2,3].forEach((function(e){var t=d*c,n=p*u,r=(d*d-p*p)*Math.pow(c,3)/d,o=(p*p-d*d)*Math.pow(u,3)/p,i=t-r,a=n-o,f=l-r,h=s-o,g=Math.hypot(a,i),m=Math.hypot(h,f);c=Math.min(1,Math.max(0,(f*g/m+r)/d)),u=Math.min(1,Math.max(0,(h*g/m+o)/p));var v=Math.hypot(u,c);c/=v,u/=v}));var f,h=Po(d*c,p*u);return[r,Wo(Go(r,f=h),f)]},mi=function(e,t,n){var r,o;if(0===e.angle)r=t[0]-e.x,o=t[1]-e.y;else{var i=Qe(e),a=i[0],l=i[1],s=i[2],c=i[3],u=Fe(t,[a+(s-a)/2,l+(c-l)/2],-e.angle);r=u[0]-e.x,o=u[1]-e.y}var d,p=e.points,f=p[0],h=p[1];if(Ve(f[0],f[1],r,o)<n||Ve(h[0],h[1],r,o)<n)return!0;for(var g=0;g<e.points.length;g++){var m=[h[0]-f[0],h[1]-f[1]],v=Math.hypot(m[1],m[0]),b=[m[0]/v,m[1]/v],y=[r-f[0],o-f[1]],x=(y[0]*b[0]+y[1]*b[1])/Math.hypot(b[1],b[0]);d=[f[0]+b[0]*x,f[1]+b[1]*x];var w=Ve(d[0],d[1],f[0],f[1]),k=Ve(d[0],d[1],h[0],h[1]);if(d=k<w&&w>v?h:w<k&&k>v?f:d,Math.hypot(o-d[1],r-d[0])<n)return!0;f=h,h=e.points[g+1]}return!1},vi=function(e){var t=e.element,n=e.threshold;if(!jr(t))return!1;var r=bi(e.element,e.point),o=r[0],i=r[1],a=r[2],l=r[3],s=Vo(0,1,-l),c=Vo(1,0,-a);if(!ci(Xo(i,s),n)||!ci(Xo(i,c),n))return!1;var u=Zo(o),d=u[0],p=u[1],f=jr(t);if(e.check===ci&&f.some((function(e){return Mi(e,d,p,t.strokeSharpness)})))return!0;return f.some((function(e){return Pi(e,d,p,n)}))},bi=function(e,t){var n,r=Ko(t),o=Qe(e),i=xi(o),a=Qo(i,e.angle),l=Jo(a,r),s=function(e){return[0,0,0,0,Math.abs(e[4]),Math.abs(e[5]),1,0]}(Ao(l,$o(i))),c=(n=e.x,[0,0,0,0,e.y,n,0,0]),u=Ao(l,c),d=o[0],p=o[1];return[u,s,(o[2]-d)/2,(o[3]-p)/2]},yi=function(e){var t=Qe(e),n=xi(t),r=Qo(n,e.angle),o=Lo(function(e){return[1,0,0,0,-.5*e[5],.5*e[4],0,0]}($o(n)));return Do(o,r)},xi=function(e){var t=e[0],n=e[1],r=e[2],o=e[3];return Po((t+r)/2,(n+o)/2)},wi=function(e,t,n){var r=yi(e),o=Jo(r,Ko(t)),i=Jo(r,Ko(n)),a=Go(o,i),l=e.height/e.width,s=e.width/2,c=e.height/2,u=a[2],d=a[3],p=a[1],f=Math.abs(d),h=Math.abs(u);switch(e.type){case"rectangle":case"image":case"text":return p/(s*(h+l*f));case"diamond":return f<h?p/(h*s):p/(f*c);case"ellipse":return p/(s*Math.sqrt(Math.pow(u,2)+Math.pow(l,2)*Math.pow(d,2)))}},ki=function(e,t,n){var r,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;switch(e.type){case"rectangle":case"image":case"text":case"diamond":var i=Si(e);r=i.flatMap((function(e,n){var r=[e,i[(n+1)%4]];return Ei(t,ji(r,o))})).concat(i.flatMap((function(e){return Ci(e,o,t)})));break;case"ellipse":r=_i(e,o,t)}if(r.length<2)return[];var a=r.sort((function(e,t){return qo(e,n)-qo(t,n)}));return[a[0],a[a.length-1]]},Si=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=t*e.width/2,r=t*e.height/2;switch(e.type){case"rectangle":case"image":case"text":return[Po(n,r),Po(n,-r),Po(-n,-r),Po(-n,r)];case"diamond":return[Po(0,r),Po(n,0),Po(0,-r),Po(-n,0)]}},Ei=function(e,t){var n=t[0],r=t[1];return Xo(n,e)*Xo(r,e)>=0?[]:[Yo(e,Go(n,r))]},ji=function(e,t){var n=e[0],r=e[1],o=function(e,t){var n=.5*t;return[1,0,0,0,n*e[4],n*e[5],0,0]}(function(e,t){return Fo([0,0,0,0,t[4]-e[4],t[5]-e[5],0,0])}(n,r),t);return[Jo(o,n),Jo(o,r)]},_i=function(e,t,n){var r=e.width/2+t,o=e.height/2+t,i=n[2],a=n[3],l=n[1],s=r*r*i*i+o*o*a*a,c=s-l*l;if(0===s||c<=0)return[];var u=Math.sqrt(c),d=-r*r*i*l,p=-o*o*a*l;return[Po((d+r*o*a*u)/s,(p-r*o*i*u)/s),Po((d-r*o*a*u)/s,(p+r*o*i*u)/s)]},Ci=function(e,t,n){if(0===t)return 0===Xo(n,e)?[e]:[];var r=n[2],o=n[3],i=n[1],a=Zo(e),l=a[0],s=a[1],c=r*r+o*o,u=t*t*c-Math.pow(r*l+o*s+i,2);if(0===c||u<=0)return[];var d=Math.sqrt(u),p=l*o*o-s*r*o-r*i,f=s*r*r-l*r*o-o*i;return[Po((p+o*d)/c,(f-r*d)/c),Po((p-o*d)/c,(f+r*d)/c)]},Oi=function(e,t,n){var r=Math.abs(t),o=e.width*r/2,i=e.height*r/2,a=Math.sign(t),l=Zo(n),s=l[0],c=l[1],u=0===c?1e-4:c,d=Math.pow(s,2)*Math.pow(i,2)+Math.pow(u,2)*Math.pow(o,2),p=(-s*Math.pow(i,2)+a*u*Math.sqrt(Math.max(0,d-Math.pow(o,2)*Math.pow(i,2))))/d,f=(-p*s-1)/u,h=-Math.pow(o,2)*p/(Math.pow(f,2)*Math.pow(i,2)+Math.pow(p,2)*Math.pow(o,2));return Po(h,(-p*h-1)/f)},Ii=function(e,t,n){var r=Math.abs(t),o=Math.sign(t),i=Si(e,r),a=0,l=null;return i.forEach((function(e){var t=o*Go(n,e)[1];t>a&&(a=t,l=e)})),l},Mi=function(e,t,n,r){for(var o=[],i=!1,a=0,l=Je(e);a<l.length;a++){var s=l[a];"move"===s.op?(i=!i)&&o.push([s.data[0],s.data[1]]):"bcurveTo"===s.op&&i&&(o.push([s.data[0],s.data[1]]),o.push([s.data[2],s.data[3]]),o.push([s.data[4],s.data[5]]))}if(o.length>=4){if("sharp"===r)return We(o,t,n);var c=xe(o,10,5);return We(c,t,n)}return!1},Pi=function(e,t,n,r){var o=Je(e),i=[0,0];return o.some((function(e,o){var a=e.op,l=e.data;if("move"===a)i=l;else if("bcurveTo"===a){var s=[l[0],l[1]],c=[l[2],l[3]],u=[l[4],l[5]],d=i;i=u;var p=function(e,t,n,r,o,i){for(var a=o[0],l=o[1],s=function(o,i){return Math.pow(1-o,3)*r[i]+3*o*Math.pow(1-o,2)*n[i]+3*Math.pow(o,2)*(1-o)*t[i]+e[i]*Math.pow(o,3)},c=0;c<=1;){var u=s(c,0),d=s(c,1);if(Math.sqrt(Math.pow(u-a,2)+Math.pow(d-l,2))<i)return!0;c+=.01}return!1}(d,s,c,u,[t,n],r);return p}return!1}))},Ti=["rotation"],Li=function(e,t,n){return t>=e[0]&&t<=e[0]+e[2]&&n>=e[1]&&n<=e[1]+e[3]},Ai=function(e,t,n,r,o,i){return e.reduce((function(e,a){if(e)return e;var l=function(e,t,n,r,o,i){if(!t.selectedElementIds[e.id])return!1;var a=Mo(e,o,i),l=a.rotation,s=Jr(a,Ti);if(l&&Li(l,n,r))return"rotation";var c=Object.keys(s).filter((function(e){var t=s[e];return!!t&&Li(t,n,r)}));return c.length>0&&c[0]}(a,t,n,r,o,i);return l?{element:a,transformHandleType:l}:null}),null)},Di=function(e,t,n,r,o){var i=e[0],a=e[1],l=e[2],s=e[3],c=Io([i,a,l,s],0,r,o,Eo);return Object.keys(c).find((function(e){var r=c[e];return r&&Li(r,t,n)}))||!1},zi=["ns","nesw","ew","nwse"],Ni=function(e){var t=e.element,n=e.transformHandleType,r=t&&Math.sign(t.height)*Math.sign(t.width)==-1,o=null;switch(n){case"n":case"s":o="ns";break;case"w":case"e":o="ew";break;case"nw":case"se":o=r?"nesw":"nwse";break;case"ne":case"sw":o=r?"nwse":"nesw";break;case"rotation":return"grab"}return o&&t&&(o=function(e,t){var n=zi.indexOf(e);if(n>=0){var r=Math.round(t/(Math.PI/4));e=zi[(n+r)%zi.length]}return e}(o,t.angle)),o?"".concat(o,"-resize"):""},Hi=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};function Ri(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Bi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ri(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ri(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Fi=function(){function e(t,n){this.elementId=t.id,Fr.mapElementToScene(this.elementId,n),e.normalizePoints(t),this.activePointIndex=null,this.lastUncommittedPoint=null,this.isDragging=!1,this.pointerOffset={x:0,y:0},this.startBindingElement="keep",this.endBindingElement="keep"}return e.getElement=function(e){var t,n=null===(t=Fr.getScene(e))||void 0===t?void 0:t.getNonDeletedElement(e);return n||null},e.handlePointDragging=function(t,n,r,o,i){if(!t.editingLinearElement)return!1;var a=t.editingLinearElement,l=a.activePointIndex,s=a.elementId,c=a.isDragging,u=e.getElement(s);if(!u)return!1;if(null!=l&&l>-1){!1===c&&n({editingLinearElement:Bi(Bi({},a),{},{isDragging:!0})});var d=e.createPointAt(u,r-a.pointerOffset.x,o-a.pointerOffset.y,t.gridSize);return e.movePoint(u,l,d),Ne(u)&&i(u,0===l?"start":"end"),!0}return!1},e.handlePointerUp=function(t,n,r){var o,i=n.elementId,a=n.activePointIndex,l=n.isDragging,s=e.getElement(i);if(!s)return n;var c={};if(l&&(0===a||a===s.points.length-1)){Ge(s.points,r.zoom.value)&&e.movePoint(s,a,0===a?s.points[s.points.length-1]:s.points[0]);var u=Gi(r)?ta(Dn(e.getPointAtIndexGlobalCoordinates(s,a)),Fr.getScene(s)):null;(o={})[0===a?"startBindingElement":"endBindingElement"]=u,c=o}return Bi(Bi(Bi({},n),c),{},{isDragging:!1,pointerOffset:{x:0,y:0}})},e.handlePointerDown=function(t,n,r,o,i){var a={didAddPoint:!1,hitElement:null};if(!n.editingLinearElement)return a;var l=n.editingLinearElement.elementId,s=e.getElement(l);if(!s)return a;if(t.altKey)return null==n.editingLinearElement.lastUncommittedPoint&&Zr(s,{points:Hi(Hi([],s.points,!0),[e.createPointAt(s,i.x,i.y,n.gridSize)],!1)}),o.resumeRecording(),r({editingLinearElement:Bi(Bi({},n.editingLinearElement),{},{activePointIndex:s.points.length-1,lastUncommittedPoint:null,endBindingElement:ta(i,Fr.getScene(s))})}),a.didAddPoint=!0,a;var c=e.getPointIndexUnderCursor(s,n.zoom,i.x,i.y);if(c>-1)a.hitElement=s;else{var u=n.editingLinearElement,d=u.startBindingElement,p=u.endBindingElement;Gi(n)&&Ne(s)&&Wi(s,d,p)}var f=Qe(s),h=f[0],g=f[1],m=(h+f[2])/2,v=(g+f[3])/2,b=c>-1&&Be(s.x+s.points[c][0],s.y+s.points[c][1],m,v,s.angle);return r({editingLinearElement:Bi(Bi({},n.editingLinearElement),{},{activePointIndex:c>-1?c:null,pointerOffset:b?{x:i.x-b[0],y:i.y-b[1]}:{x:0,y:0}})}),a},e.handlePointerMove=function(t,n,r,o,i){var a=o.elementId,l=o.lastUncommittedPoint,s=e.getElement(a);if(!s)return o;var c=s.points,u=c[c.length-1];if(!t.altKey)return u===l&&e.movePoint(s,c.length-1,"delete"),Bi(Bi({},o),{},{lastUncommittedPoint:null});var d=e.createPointAt(s,n-o.pointerOffset.x,r-o.pointerOffset.y,i);return u===l?e.movePoint(s,s.points.length-1,d):e.movePoint(s,"new",d),Bi(Bi({},o),{},{lastUncommittedPoint:s.points[s.points.length-1]})},e.getPointsGlobalCoordinates=function(e){var t=Qe(e),n=t[0],r=t[1],o=t[2],i=t[3],a=(n+o)/2,l=(r+i)/2;return e.points.map((function(t){var n,r=e.x,o=e.y;return[r=(n=Be(r+t[0],o+t[1],a,l,e.angle))[0],o=n[1]]}))},e.getPointAtIndexGlobalCoordinates=function(e,t){var n=t<0?e.points.length+t:t,r=Qe(e),o=r[0],i=r[1],a=(o+r[2])/2,l=(i+r[3])/2,s=e.points[n],c=e.x,u=e.y;return Be(c+s[0],u+s[1],a,l,e.angle)},e.pointFromAbsoluteCoords=function(e,t){var n=Qe(e),r=n[0],o=n[1],i=(r+n[2])/2,a=(o+n[3])/2,l=Be(t[0],t[1],i,a,-e.angle),s=l[0],c=l[1];return[s-e.x,c-e.y]},e.getPointIndexUnderCursor=function(e,t,n,r){for(var o=this.getPointsGlobalCoordinates(e),i=o.length;--i>-1;){var a=o[i];if(Ve(n,r,a[0],a[1])*t.value<this.POINT_HANDLE_SIZE/2+1)return i}return-1},e.createPointAt=function(e,t,n,r){var o=qe(t,n,r),i=Qe(e),a=i[0],l=i[1],s=(a+i[2])/2,c=(l+i[3])/2,u=Be(o[0],o[1],s,c,-e.angle),d=u[0],p=u[1];return[d-e.x,p-e.y]},e.getNormalizedPoints=function(e){var t=e.points,n=t[0][0],r=t[0][1];return{points:t.map((function(e,t){return[e[0]-n,e[1]-r]})),x:e.x+n,y:e.y+r}},e.normalizePoints=function(t){Zr(t,e.getNormalizedPoints(t))},e.movePointByOffset=function(t,n,r){var o=t.points[n],i=o[0],a=o[1];e.movePoint(t,n,[i+r.x,a+r.y])},e.movePoint=function(e,t,n,r){var o,i=e.points,a=0,l=0;if("delete"===n){if("new"===t)throw new Error("invalid args in movePoint");(o=i.slice()).splice(t,1),0===t&&(a=o[0][0],l=o[0][1],o=o.map((function(e,t){return 0===t?[0,0]:[e[0]-a,e[1]-l]})))}else if("new"===t)o=Hi(Hi([],i,!0),[n],!1);else{var s=n[0]-i[t][0],c=n[1]-i[t][1];o=i.map((function(e,n){return n===t?0===n?(a=s,l=c,e):(a=0,l=0,[e[0]+s,e[1]+c]):a||l?[e[0]-a,e[1]-l]:e}))}var u=lt(e,o,e.strokeSharpness||"round"),d=lt(e,i,e.strokeSharpness||"round"),p=(u[0]+u[2])/2,f=(u[1]+u[3])/2,h=(d[0]+d[2])/2,g=(d[1]+d[3])/2,m=Be(a,l,h-p,g-f,e.angle);Zr(e,Bi(Bi({},r),{},{points:o,x:e.x+m[0],y:e.y+m[1]}))},e}();Fi.POINT_HANDLE_SIZE=20;var Ui=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};function Vi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Gi=function(e){return e.isBindingEnabled},Wi=function(e,t,n){var r=new Set,o=new Set;Ki(e,t,n,"start",r,o),Ki(e,n,t,"end",r,o);var i=Array.from(o).filter((function(e){return!r.has(e)}));Fr.getScene(e).getNonDeletedElements(i).forEach((function(t){var n;Zr(t,{boundElementIds:null===(n=t.boundElementIds)||void 0===n?void 0:n.filter((function(t){return t!==e.id}))})}))},Ki=function(e,t,n,r,o,i){if("keep"!==t)if(null!=t)null!=n&&("keep"===n?$i(e,t,r):"start"!==r&&n.id===t.id)||(Xi(e,t,r),o.add(t.id));else{var a=ea(e,r);null!=a&&i.add(a)}},Zi=function(e){e.forEach((function(e){Ne(e)?Wi(e,ca(e,"start"),ca(e,"end")):Re(e)&&Yi(e)}))},Yi=function(e){da(e).forEach((function(t){var n=t[0],r=t[1];return Wi(n,"end"===r?"keep":e,"start"===r?"keep":e)}))},qi=function(e,t,n,r){null!=t.startBoundElement&&Xi(e,t.startBoundElement,"start");var o=ta(r,n);null==o||$i(e,o,"end")||Xi(e,o,"end")},Xi=function(e,t,n){var r,o;Zr(e,((r={})["start"===n?"startBinding":"endBinding"]=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vi(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({elementId:t.id},na(e,t,n)),r)),Zr(t,{boundElementIds:Array.from(new Set(Ui(Ui([],null!==(o=t.boundElementIds)&&void 0!==o?o:[],!0),[e.id],!1)))})},$i=function(e,t,n){var r=e["start"===n?"endBinding":"startBinding"];return Qi(e,null==r?void 0:r.elementId,t)},Qi=function(e,t,n){return t===n.id&&e.points.length<3},Ji=function(e){e.forEach((function(e){Ne(e)&&Wi(e,null,null)}))},ea=function(e,t){var n,r="start"===t?"startBinding":"endBinding",o=e[r];return null==o?null:(Zr(e,((n={})[r]=null,n)),o.elementId)},ta=function(e,t){return nl(t.getElements(),(function(t){return Re(t)&&oi(t,e)}))},na=function(e,t,n){var r="start"===n?-1:1,o=-1===r?0:e.points.length-1,i=o-r,a=Fi.getPointAtIndexGlobalCoordinates(e,o),l=Fi.getPointAtIndexGlobalCoordinates(e,i);return{focus:wi(t,l,a),gap:Math.max(1,li(t,a))}},ra=function(e,t){var n,r=null!==(n=e.boundElementIds)&&void 0!==n?n:[];if(0!==r.length){var o=null!=t?t:{},i=o.newSize,a=o.simultaneouslyUpdated,l=ia(a);Fr.getScene(e).getNonDeletedElements(r).forEach((function(t){var n=e;if(oa(t,n)){var r=la(n,t.startBinding,i),o=la(n,t.endBinding,i);l.has(t.id)?Zr(t,{startBinding:r,endBinding:o}):(aa(t,"start",r,e),aa(t,"end",o,e))}}))}},oa=function(e,t){var n,r;return(null===(n=e.startBinding)||void 0===n?void 0:n.elementId)===t.id||(null===(r=e.endBinding)||void 0===r?void 0:r.elementId)===t.id},ia=function(e){return new Set((e||[]).map((function(e){return e.id})))},aa=function(e,t,n,r){var o;if(!(null==n||n.elementId!==r.id&&e.points.length>2)){var i=Fr.getScene(e).getElement(n.elementId);if(null!=i){var a,l="start"===t?-1:1,s=-1===l?0:e.points.length-1,c=s-l,u=Fi.getPointAtIndexGlobalCoordinates(e,c),d=function(e,t,n){if(0===t){var r=Qe(e),o=xi(r);return Zo(o)}var i,a=yi(e),l=Jo(a,Ko(n)),s=Lo(a);switch(e.type){case"rectangle":case"image":case"text":case"diamond":i=Ii(e,t,l);break;case"ellipse":i=Oi(e,t,l)}return Zo(Jo(s,i))}(i,n.focus,u);if(0===n.gap)a=d;else{var p=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=yi(e),i=Jo(o,Ko(t)),a=Jo(o,Ko(n)),l=Go(i,a),s=Lo(o);return ki(e,l,i,r).map((function(e){return Zo(Jo(s,e))}))}(i,u,d,n.gap);a=0===p.length?d:p[0]}Fi.movePoint(e,s,Fi.pointFromAbsoluteCoords(e,a),((o={})["start"===t?"startBinding":"endBinding"]=n,o))}}},la=function(e,t,n){if(null==t||null==n)return t;var r=t.gap,o=t.focus,i=t.elementId,a=n.width,l=n.height,s=e.width,c=e.height;return{elementId:i,gap:Math.max(1,Math.min(ii(e,a,l),r*(a<l?a/s:l/c))),focus:o}},sa=function(e){return[ca(e,"start"),ca(e,"end")].filter((function(e){return null!=e}))},ca=function(e,t){return ta(ua(e,t),Fr.getScene(e))},ua=function(e,t){var n="start"===t?0:-1;return Dn(Fi.getPointAtIndexGlobalCoordinates(e,n))},da=function(e){return Fr.getScene(e).getElements().map((function(t){if(!Ne(t))return null;var n=pa(t,"start",e),r=pa(t,"end",e);return n||r?[t,n&&r?"both":n?"start":"end",e]:null})).filter((function(e){return null!=e}))},pa=function(e,t,n){return null==e["start"===t?"startBinding":"endBinding"]&&!$i(e,n,t)&&oi(n,ua(e,t))},fa=function(e,t,n,r){var o=new Set,i=new Set,a="duplicatesServeAsOld"===r;t.forEach((function(e){var t=e.boundElementIds;if(null!=t&&t.length>0&&(t.forEach((function(e){a&&!n.has(e)&&o.add(e)})),i.add(n.get(e.id))),Ne(e)){if(null!=e.startBinding){var r=e.startBinding.elementId;a&&!n.has(r)&&i.add(r)}if(null!=e.endBinding){r=e.endBinding.elementId;a&&!n.has(r)&&i.add(r)}null==e.startBinding&&null==e.endBinding||o.add(n.get(e.id))}})),e.filter((function(e){var t=e.id;return o.has(t)})).forEach((function(e){var t=e.startBinding,r=e.endBinding;Zr(e,{startBinding:ha(t,n),endBinding:ha(r,n)})})),e.filter((function(e){var t=e.id;return i.has(t)})).forEach((function(e){var t=e.boundElementIds;null!=t&&t.length>0&&Zr(e,{boundElementIds:t.map((function(e){var t;return null!==(t=n.get(e))&&void 0!==t?t:e}))})}))},ha=function(e,t){var n;if(null==e)return null;var r=e.elementId;return{focus:e.focus,gap:e.gap,elementId:null!==(n=t.get(r))&&void 0!==n?n:r}},ga=function(e,t){var n=new Set(t.map((function(e){return e.id}))),r=new Set;t.forEach((function(e){var t;Re(e)&&(null===(t=e.boundElementIds)||void 0===t||t.forEach((function(e){n.has(e)||r.add(e)})))})),e.filter((function(e){var t=e.id;return r.has(t)})).forEach((function(e){var t=e.startBinding,r=e.endBinding;Zr(e,{startBinding:ma(t,n),endBinding:ma(r,n)})}))},ma=function(e,t){return null==e||t.has(e.elementId)?null:e},va=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};function ba(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ya(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ba(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ba(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var xa=function(e){return e>=2*Math.PI?e-2*Math.PI:e},wa=function(e,t,n,r){var o=Qe(e),i=o[0],a=o[1],l=(i+o[2])/2,s=(a+o[3])/2,u=5*Math.PI/2+Math.atan2(n-s,t-l);r&&(u+=c.ay/2,u-=u%c.ay),u=xa(u),Zr(e,{angle:u})},ka=function(e,t,n,r,o){var i;var a=Qe(e),l=a[0],s=a[1],c=a[2],u=a[3],d=Be(r,o,(l+c)/2,(s+u)/2,-e.angle),p=d[0],f=d[1],h="end"===t?[p-e.x,f-e.y]:[e.x+e.points[1][0]-p,e.y+e.points[1][1]-f],g=h[0],m=h[1];n&&(i=function(e,t,n,r){var o=$r.apply(void 0,va([e],Be(t,n,0,0,r),!1));return Be(o.width,o.height,0,0,-r)}(e.type,g,m,e.angle),g=i[0],m=i[1]);var v=Ue("end"===t?{s:!0,e:!0}:{n:!0,w:!0},e.x,e.y,e.angle,0,0,(e.points[1][0]-g)/2,(e.points[1][1]-m)/2),b=v[0],y=v[1];Zr(e,{x:b,y,points:[[0,0],[g,m]]})},Sa=function(e,t,n){return De(e)||Le(e)?{points:$e(0,t,$e(1,n,e.points))}:{}},Ea=function(e,t,n){var r=e.fontSize*(t/e.width);if(r<1)return null;var o=kn(e.text,wn({fontSize:r,fontFamily:e.fontFamily}));return{size:r,baseline:o.baseline+(n-o.height)}},ja=function(e,t,n,r,o){var i,a=Qe(e),l=a[0],s=a[1],c=a[2],u=a[3],d=Be(r,o,(l+c)/2,(s+u)/2,-e.angle),p=d[0],f=d[1];switch(t){case"se":i=Math.max((p-l)/(c-l),(f-s)/(u-s));break;case"nw":i=Math.max((c-p)/(c-l),(u-f)/(u-s));break;case"ne":i=Math.max((p-l)/(c-l),(u-f)/(u-s));break;case"sw":i=Math.max((c-p)/(c-l),(f-s)/(u-s))}if(i>0){var h=e.width*i,g=e.height*i,m=Ea(e,h,g);if(null===m)return;var v=at(e,h,g),b=(l-v[0])/2,y=(s-v[1])/2,x=(c-v[2])/2,w=(u-v[3])/2,k=Ue(function(e,t){return{n:/^(n|ne|nw)$/.test(e)||t&&/^(s|se|sw)$/.test(e),s:/^(s|se|sw)$/.test(e)||t&&/^(n|ne|nw)$/.test(e),w:/^(w|nw|sw)$/.test(e)||t&&/^(e|ne|se)$/.test(e),e:/^(e|ne|se)$/.test(e)||t&&/^(w|nw|sw)$/.test(e)}}(t,n),e.x,e.y,e.angle,b,y,x,w),S=k[0],E=k[1];Zr(e,{fontSize:m.size,width:h,height:g,baseline:m.baseline,x:S,y:E})}},_a=function(e,t,n,r,o,i,a){var l=at(e,e.width,e.height),s=[l[0],l[1]],c=[l[2],l[3]],u=function(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}(s,c),d=Fe([i,a],u,-e.angle),p=at(n,n.width,n.height),f=p[0],h=p[1],g=p[2]-f,m=p[3]-h,v=(c[0]-s[0])/g,b=(c[1]-s[1])/m;r.includes("e")&&(v=(d[0]-s[0])/g),r.includes("s")&&(b=(d[1]-s[1])/m),r.includes("w")&&(v=(c[0]-d[0])/g),r.includes("n")&&(b=(c[1]-d[1])/m);var y=e.width,x=e.height,w=n.width*v,k=n.height*b;if(o&&(w=2*w-y,k=2*k-x),t){var S=Math.abs(w)/y,E=Math.abs(k)/x;if(1===r.length&&(k*=S,w*=E),2===r.length){var j=Math.max(S,E);w=y*j*Math.sign(w),k=x*j*Math.sign(k)}}var _=at(e,w,k),C=_[0],O=_[1],I=_[2]-C,M=_[3]-O,P=va([],s,!0);if(["n","w","nw"].includes(r)&&(P=[c[0]-Math.abs(I),c[1]-Math.abs(M)]),"ne"===r){var T=[s[0],c[1]];P=[T[0],T[1]-Math.abs(M)]}if("sw"===r){var L=[c[0],s[1]];P=[L[0]-Math.abs(I),L[1]]}t&&(["s","n"].includes(r)&&(P[0]=u[0]-I/2),["e","w"].includes(r)&&(P[1]=u[1]-M/2)),w<0&&(r.includes("e")&&(P[0]-=Math.abs(I)),r.includes("w")&&(P[0]+=Math.abs(I))),k<0&&(r.includes("s")&&(P[1]-=Math.abs(M)),r.includes("n")&&(P[1]+=Math.abs(M))),o&&(P[0]=u[0]-Math.abs(I)/2,P[1]=u[1]-Math.abs(M)/2);var A=e.angle,D=Fe(P,u,A),z=[P[0]+Math.abs(I)/2,P[1]+Math.abs(M)/2],N=Fe(z,u,A);P=Fe(D,N,-A);var H=Sa(e,w,k),R=va([],P,!0);R[0]+=e.x-C,R[1]+=e.y-O;var B=ya({width:Math.abs(w),height:Math.abs(k),x:R[0],y:R[1]},H);"scale"in n&&"scale"in e&&Zr(n,{scale:[(Math.sign(v)||e.scale[0])*e.scale[0],(Math.sign(b)||e.scale[1])*e.scale[1]]}),0!==B.width&&0!==B.height&&Number.isFinite(B.x)&&Number.isFinite(B.y)&&(ra(n,{newSize:{width:B.width,height:B.height}}),Zr(n,B))},Ca=function(e,t,n,r){var o,i,a=it(e),l=a[0],s=a[1],c=a[2],u=a[3];switch(t){case"se":o=Math.max((n-l)/(c-l),(r-s)/(u-s)),i=function(e,t,n){var r=t[0],i=t[1],a=n[0],c=n[1];return{x:e.x+(r-l)*(o-1)+r-a,y:e.y+(i-s)*(o-1)+i-c}};break;case"nw":o=Math.max((c-n)/(c-l),(u-r)/(u-s)),i=function(e,t,n){var r=t[2],i=t[3],a=n[2],l=n[3];return{x:e.x-(c-r)*(o-1)+r-a,y:e.y-(u-i)*(o-1)+i-l}};break;case"ne":o=Math.max((n-l)/(c-l),(u-r)/(u-s)),i=function(e,t,n){var r=t[0],i=t[3],a=n[0],s=n[3];return{x:e.x+(r-l)*(o-1)+r-a,y:e.y-(u-i)*(o-1)+i-s}};break;case"sw":o=Math.max((c-n)/(c-l),(r-s)/(u-s)),i=function(e,t,n){var r=t[1],i=t[2],a=n[1],l=n[2];return{x:e.x-(c-i)*(o-1)+i-l,y:e.y+(r-s)*(o-1)+r-a}}}if(o>0){var d=e.reduce((function(t,n){if(!t)return t;var r=n.width*o,a=n.height*o,l={};if("text"===n.type){var s=Ea(n,r,a);if(null===s)return null;l={fontSize:s.size,baseline:s.baseline}}var c=Qe(n),u=Sa(n,r,a);ra(n,{newSize:{width:r,height:a},simultaneouslyUpdated:e});var d=at(ya(ya({},n),u),r,a),p=i(n,c,d),f=p.x,h=p.y;return va(va([],t,!0),[ya(ya({width:r,height:a,x:f,y:h},u),l)],!1)}),[]);d&&e.forEach((function(e,t){Zr(e,d[t])}))}},Oa=function(e,t,n,r,o,i,a){var l=5*Math.PI/2+Math.atan2(r-a,n-i);o&&(l+=c.ay/2,l-=l%c.ay),t.forEach((function(t,n){var r,o,s=Qe(t),c=s[0],u=s[1],d=(c+s[2])/2,p=(u+s[3])/2,f=null!==(r=null===(o=e.originalElements.get(t.id))||void 0===o?void 0:o.angle)&&void 0!==r?r:t.angle,h=Be(d,p,i,a,l+f-t.angle),g=h[0],m=h[1];Zr(t,{x:t.x+(g-d),y:t.y+(m-p),angle:xa(l+f)})}))},Ia=function(e,t,n,r,o,i,a,l,s,c,u){var d;s&&(u?l=a/u:(a=(d=$r(t,a,i<r?-l:l)).width,(l=d.height)<0&&(l=-l)));var p=o<n?n-a:n,f=i<r?r-l:r;c&&(p=n-(a+=a)/2,f=r-(l+=l)/2),0!==a&&0!==l&&Zr(e,{x:p,y:f,width:a,height:l})},Ma=function(e){return e.replace(/\t/g," ").replace(/\r?\n|\r/g,"\n")},Pa=function(e,t,n,r,o){var i=r.zoom,a=r.offsetTop,l=r.offsetLeft,s=180*n/Math.PI,c=(e-2*l)*(i.value-1)/2,u=(t-2*a)*(i.value-1)/2;return e>o&&1!==i.value&&(c=o/2*(i.value-1)),"translate(".concat(c,"px, ").concat(u,"px) scale(").concat(i.value,") rotate(").concat(s,"deg)")},Ta=function(e){var t=kn(e.text,wn(e));Zr(e,{width:t.width,height:t.height,baseline:t.baseline})},La=function(e,t){return Boolean(!e.viewModeEnabled&&(e.editingElement||Wa(t,e).length||"selection"!==e.elementType))};function Aa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Da(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Aa(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Aa(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var za,Na=function(e){return e.reduce((function(e,t){return e+t.version}),0)},Ha=function(e){return e.filter((function(e){return!e.isDeleted}))},Ra=function(e){return!e.isDeleted},Ba=function(e){return Ha(e).map((function(e){return ze(e.type)?Da(Da({},e),{},{lastCommittedPoint:null}):e}))},Fa=function(e){return Ba(e)},Ua=function(e){return Ba(e)},Va=function(e,t,n){var r=[e.horizontal,e.vertical].map((function(e){return null!=e&&e.x<=t&&t<=e.x+e.width&&e.y<=n&&n<=e.y+e.height})),o=r[0],i=r[1];return{isOverEither:o||i,isOverHorizontal:o,isOverVertical:i}},Ga=function(e,t){return e.some((function(e){return t.selectedElementIds[e.id]}))},Wa=function(e,t){return e.filter((function(e){return t.selectedElementIds[e.id]}))},Ka=function(e,t){return t.editingElement?[t.editingElement]:Wa(e,t)},Za=function(e){var t=e.scenePoint,n=e.viewportDimensions,r=e.zoom;return{scrollX:n.width/2*(1/r.value)-t.x-r.translation.x*(1/r.value),scrollY:n.height/2*(1/r.value)-t.y-r.translation.y*(1/r.value)}},Ya=function(e,t,n){var r;if(!(e=function(e){return e.filter((function(e){return!e.isDeleted&&!Xr(e)}))}(e)).length)return{scrollX:0,scrollY:0};var o=it(e),i=o[0],a=o[1],l=o[2],s=o[3];return function(e,t,n){var r=n[0],o=n[1],i=n[2],a=n[3],l=Pn({sceneX:r,sceneY:o},e),s=l.x,c=l.y,u=Pn({sceneX:i,sceneY:a},e),d=u.x,p=u.y;return d-s>e.width||p-c>e.height}(t,0,[i,a,l,s])&&(r=function(e,t){if(!e.length)return[0,0,0,0];var n=1/0,r=e[0];return e.forEach((function(e){var o=ot(e),i=o[0],a=o[1],l=o[2],s=o[3],c=Ve((i+l)/2,(a+s)/2,t.x,t.y);c<n&&(n=c,r=e)})),ot(r)}(e,Mn({clientX:t.scrollX,clientY:t.scrollY},t)),i=r[0],a=r[1],l=r[2],s=r[3]),Za({scenePoint:{x:(i+l)/2,y:(a+s)/2},viewportDimensions:{width:t.width,height:t.height},zoom:t.zoom})},qa=function(e){return"rectangle"===e||"ellipse"===e||"diamond"===e||"line"===e},Xa=function(e){return"image"!==e},$a=function(e){return"rectangle"===e||"ellipse"===e||"diamond"===e||"freedraw"===e||"arrow"===e||"line"===e},Qa=function(e){return"rectangle"===e||"ellipse"===e||"diamond"===e||"arrow"===e||"line"===e},Ja=function(e){return"rectangle"===e||"arrow"===e||"line"===e},el=function(e){return"text"===e},tl=function(e){return"arrow"===e},nl=function(e,t){for(var n=null,r=e.length-1;r>=0;--r){var o=e[r];if(!o.isDeleted&&t(o)){n=o;break}}return n},rl=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{x:0,y:0};return{value:e,translation:{x:r.x-n.left-(r.x-n.left-t.translation.x)*(e/t.value),y:r.y-n.top-(r.y-n.top-t.translation.y)*(e/t.value)}}},ol=function(e){var t=parseFloat(e.toFixed(2));return Math.max(.1,Math.min(t,10))},il=(n(5422),za=function(e,t){return za=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},za(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}za(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),al=function(e){function t(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Couldn't export canvas.",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"CANVAS_ERROR";return(t=e.call(this)||this).name=r,t.message=n,t}return il(t,e),t}(Error),ll=function(e){function t(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Request Aborted";return e.call(this,t,"AbortError")||this}return il(t,e),t}(DOMException);n(371);const sl=function(e){var t=e.size,n=void 0===t?"1em":t,r=e.circleWidth,o=void 0===r?8:r;return(0,E.jsx)("div",{className:"Spinner",children:(0,E.jsx)("svg",{viewBox:"0 0 100 100",style:{width:n,height:n},children:(0,E.jsx)("circle",{cx:"50",cy:"50",r:50-o/2,strokeWidth:o,fill:"none",strokeMiterlimit:"10"})})})};var cl=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}},ul=s().forwardRef((function(e,t){var n=Xh().id,r=s().useRef(null);s().useImperativeHandle(t,(function(){return r.current}));var o="ToolIcon_size_".concat(e.size),i=(0,l.useState)(!1),a=i[0],c=i[1],u=(0,l.useRef)(!0),p=function(){var t=(0,d.Z)((function(t){var n,r,o;return cl(this,(function(i){switch(i.label){case 0:if(!(r="onClick"in e&&(null===(n=e.onClick)||void 0===n?void 0:n.call(e,t)))||!("then"in r))return[3,5];i.label=1;case 1:return i.trys.push([1,3,4,5]),c(!0),[4,r];case 2:return i.sent(),[3,5];case 3:if(!((o=i.sent())instanceof ll))throw o;return console.warn(o),[3,5];case 4:return u.current&&c(!1),[7];case 5:return[2]}}))}));return function(e){return t.apply(this,arguments)}}();(0,l.useEffect)((function(){return function(){u.current=!1}}),[]);var f=(0,l.useRef)(null);if("button"===e.type||"icon"===e.type||"submit"===e.type){var h="icon"===e.type?"button":e.type;return(0,E.jsxs)("button",{className:Oe("ToolIcon_type_button",o,e.className,e.visible&&!e.hidden?"ToolIcon_type_button--show":"ToolIcon_type_button--hide",{ToolIcon:!e.hidden,"ToolIcon--selected":e.selected,"ToolIcon--plain":"icon"===e.type}),"data-testid":e["data-testid"],hidden:e.hidden,title:e.title,"aria-label":e["aria-label"],type:h,onClick:p,ref:r,disabled:a||e.isLoading,children:[(e.icon||e.label)&&(0,E.jsxs)("div",{className:"ToolIcon__icon","aria-hidden":"true",children:[e.icon||e.label,e.keyBindingLabel&&(0,E.jsx)("span",{className:"ToolIcon__keybinding",children:e.keyBindingLabel}),e.isLoading&&(0,E.jsx)(sl,{})]}),e.showAriaLabel&&(0,E.jsxs)("div",{className:"ToolIcon__label",children:[e["aria-label"]," ",a&&(0,E.jsx)(sl,{})]}),e.children]})}return(0,E.jsxs)("label",{className:Oe("ToolIcon",e.className),title:e.title,onPointerDown:function(e){f.current=e.pointerType||null},onPointerUp:function(){requestAnimationFrame((function(){f.current=null}))},children:[(0,E.jsx)("input",{className:"ToolIcon_type_radio ".concat(o),type:"radio",name:e.name,"aria-label":e["aria-label"],"aria-keyshortcuts":e["aria-keyshortcuts"],"data-testid":e["data-testid"],id:"".concat(n,"-").concat(e.id),onChange:function(){var t;null===(t=e.onChange)||void 0===t||t.call(e,{pointerType:f.current})},checked:e.checked,ref:r}),(0,E.jsxs)("div",{className:"ToolIcon__icon",children:[e.icon,e.keyBindingLabel&&(0,E.jsx)("span",{className:"ToolIcon__keybinding",children:e.keyBindingLabel})]})]})}));ul.defaultProps={visible:!0,className:"",size:"medium"};var dl=function(e){return e===c.C6.LIGHT?ct.orange[4]:ct.orange[9]},pl=function(e){return e===c.C6.LIGHT?ct.black:ct.gray[4]},fl=function(e){return e===c.C6.LIGHT?ct.white:"#1e1e1e"},hl=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:512,n="number"==typeof t?{width:t}:t,r=n.width,o=void 0===r?512:r,i=n.height,a=void 0===i?o:i,l=n.mirror,s=n.style;return(0,E.jsx)("svg",{"aria-hidden":"true",focusable:"false",role:"img",viewBox:"0 0 ".concat(o," ").concat(a),className:Oe({"rtl-mirror":l}),style:s,children:"string"==typeof e?(0,E.jsx)("path",{fill:"currentColor",d:e}):e})},gl=hl((0,E.jsx)("polyline",{fill:"none",stroke:"currentColor",points:"20 6 9 17 4 12"}),{width:24,height:24}),ml=hl("M326.612 185.391c59.747 59.809 58.927 155.698.36 214.59-.11.12-.24.25-.36.37l-67.2 67.2c-59.27 59.27-155.699 59.262-214.96 0-59.27-59.26-59.27-155.7 0-214.96l37.106-37.106c9.84-9.84 26.786-3.3 27.294 10.606.648 17.722 3.826 35.527 9.69 52.721 1.986 5.822.567 12.262-3.783 16.612l-13.087 13.087c-28.026 28.026-28.905 73.66-1.155 101.96 28.024 28.579 74.086 28.749 102.325.51l67.2-67.19c28.191-28.191 28.073-73.757 0-101.83-3.701-3.694-7.429-6.564-10.341-8.569a16.037 16.037 0 0 1-6.947-12.606c-.396-10.567 3.348-21.456 11.698-29.806l21.054-21.055c5.521-5.521 14.182-6.199 20.584-1.731a152.482 152.482 0 0 1 20.522 17.197zM467.547 44.449c-59.261-59.262-155.69-59.27-214.96 0l-67.2 67.2c-.12.12-.25.25-.36.37-58.566 58.892-59.387 154.781.36 214.59a152.454 152.454 0 0 0 20.521 17.196c6.402 4.468 15.064 3.789 20.584-1.731l21.054-21.055c8.35-8.35 12.094-19.239 11.698-29.806a16.037 16.037 0 0 0-6.947-12.606c-2.912-2.005-6.64-4.875-10.341-8.569-28.073-28.073-28.191-73.639 0-101.83l67.2-67.19c28.239-28.239 74.3-28.069 102.325.51 27.75 28.3 26.872 73.934-1.155 101.96l-13.087 13.087c-4.35 4.35-5.769 10.79-3.783 16.612 5.864 17.194 9.042 34.999 9.69 52.721.509 13.906 17.454 20.446 27.294 10.606l37.106-37.106c59.271-59.259 59.271-155.699.001-214.959z",{mirror:!0}),vl=hl("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",{width:448,height:512}),bl=hl("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",{width:448,height:512}),yl=hl("M572.694 292.093L500.27 416.248A63.997 63.997 0 0 1 444.989 448H45.025c-18.523 0-30.064-20.093-20.731-36.093l72.424-124.155A64 64 0 0 1 152 256h399.964c18.523 0 30.064 20.093 20.73 36.093zM152 224h328v-48c0-26.51-21.49-48-48-48H272l-64-64H48C21.49 64 0 85.49 0 112v278.046l69.077-118.418C86.214 242.25 117.989 224 152 224z",{width:576,height:512,mirror:!0}),xl=hl("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",{width:384,height:512}),wl=hl("M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z",{width:448,height:512}),kl=hl("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"),Sl=(hl("M384 121.9c0-6.3-2.5-12.4-7-16.9L279.1 7c-4.5-4.5-10.6-7-17-7H256v128h128zM571 308l-95.7-96.4c-10.1-10.1-27.4-3-27.4 11.3V288h-64v64h64v65.2c0 14.3 17.3 21.4 27.4 11.3L571 332c6.6-6.6 6.6-17.4 0-24zm-379 28v-32c0-8.8 7.2-16 16-16h176V160H248c-13.2 0-24-10.8-24-24V0H24C10.7 0 0 10.7 0 24v464c0 13.3 10.7 24 24 24h336c13.3 0 24-10.7 24-24V352H208c-8.8 0-16-7.2-16-16z",{width:576,height:512,mirror:!0}),hl((0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("path",{d:"M571 308l-95.7-96.4c-10.1-10.1-27.4-3-27.4 11.3V288h-64v64h64v65.2c0 14.3 17.3 21.4 27.4 11.3L571 332c6.6-6.6 6.6-17.4 0-24zm-187 44v-64 64z"}),(0,E.jsx)("path",{d:"M384 121.941V128H256V0h6.059c6.362 0 12.471 2.53 16.97 7.029l97.941 97.941a24.01 24.01 0 017.03 16.971zM248 160c-13.2 0-24-10.8-24-24V0H24C10.745 0 0 10.745 0 24v464c0 13.255 10.745 24 24 24h336c13.255 0 24-10.745 24-24V160H248zm-135.455 16c26.51 0 48 21.49 48 48s-21.49 48-48 48-48-21.49-48-48 21.491-48 48-48zm208 240h-256l.485-48.485L104.545 328c4.686-4.686 11.799-4.201 16.485.485L160.545 368 264.06 264.485c4.686-4.686 12.284-4.686 16.971 0L320.545 304v112z"})]}),{width:576,height:512,mirror:!0})),El=hl("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",{width:512,height:512}),jl=hl("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",{width:448,height:512}),_l=hl("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",{width:448,height:512}),Cl=hl("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"),Ol=hl("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"),Il=hl("M255.545 8c-66.269.119-126.438 26.233-170.86 68.685L48.971 40.971C33.851 25.851 8 36.559 8 57.941V192c0 13.255 10.745 24 24 24h134.059c21.382 0 32.09-25.851 16.971-40.971l-41.75-41.75c30.864-28.899 70.801-44.907 113.23-45.273 92.398-.798 170.283 73.977 169.484 169.442C423.236 348.009 349.816 424 256 424c-41.127 0-79.997-14.678-110.63-41.556-4.743-4.161-11.906-3.908-16.368.553L89.34 422.659c-4.872 4.872-4.631 12.815.482 17.433C133.798 479.813 192.074 504 256 504c136.966 0 247.999-111.033 248-247.998C504.001 119.193 392.354 7.755 255.545 8z",{mirror:!0}),Ml=hl("M256.455 8c66.269.119 126.437 26.233 170.859 68.685l35.715-35.715C478.149 25.851 504 36.559 504 57.941V192c0 13.255-10.745 24-24 24H345.941c-21.382 0-32.09-25.851-16.971-40.971l41.75-41.75c-30.864-28.899-70.801-44.907-113.23-45.273-92.398-.798-170.283 73.977-169.484 169.442C88.764 348.009 162.184 424 256 424c41.127 0 79.997-14.678 110.629-41.556 4.743-4.161 11.906-3.908 16.368.553l39.662 39.662c4.872 4.872 4.631 12.815-.482 17.433C378.202 479.813 319.926 504 256 504 119.034 504 8.001 392.967 8 256.002 7.999 119.193 119.646 7.755 256.455 8z",{mirror:!0}),Pl=hl("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",{mirror:!0}),Tl=(hl("M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92 1.61 0 2.92-1.31 2.92-2.92s-1.31-2.92-2.92-2.92z",{width:24,height:24}),hl("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",{width:24,height:24}),hl((0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("path",{stroke:"currentColor",fill:"currentColor",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"}),(0,E.jsx)("path",{stroke:"currentColor",fill:"currentColor",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"})]}),{width:64,height:64}),hl((0,E.jsx)("path",{stroke:"currentColor",strokeWidth:"40",fill:"currentColor",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"}),{width:1024}),s().memo((function(e){var t=e.theme;return hl((0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("path",{d:"M22 9.556C22 8.696 21.303 8 20.444 8H16v8H8v4.444C8 21.304 8.697 22 9.556 22h10.888c.86 0 1.556-.697 1.556-1.556V9.556z",fill:pl(t),stroke:pl(t),strokeWidth:"2"}),(0,E.jsx)("path",{d:"M16 3.556C16 2.696 15.303 2 14.444 2H3.556C2.696 2 2 2.697 2 3.556v10.888C2 15.304 2.697 16 3.556 16h10.888c.86 0 1.556-.697 1.556-1.556V3.556z",fill:dl(t),stroke:dl(t),strokeWidth:"2"})]}),{width:24,mirror:!0})}))),Ll=s().memo((function(e){var t=e.theme;return hl((0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("path",{d:"M16 3.556C16 2.696 15.303 2 14.444 2H3.556C2.696 2 2 2.697 2 3.556v10.888C2 15.304 2.697 16 3.556 16h10.888c.86 0 1.556-.697 1.556-1.556V3.556z",fill:dl(t),stroke:dl(t),strokeWidth:"2"}),(0,E.jsx)("path",{d:"M22 9.556C22 8.696 21.303 8 20.444 8H9.556C8.696 8 8 8.697 8 9.556v10.888C8 21.304 8.697 22 9.556 22h10.888c.86 0 1.556-.697 1.556-1.556V9.556z",fill:pl(t),stroke:pl(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),Al=s().memo((function(e){var t=e.theme;return hl((0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("path",{d:"M13 21a1 1 0 001 1h7a1 1 0 001-1v-7a1 1 0 00-1-1h-3v5h-5v3zM11 3a1 1 0 00-1-1H3a1 1 0 00-1 1v7a1 1 0 001 1h3V6h5V3z",fill:pl(t),stroke:pl(t),strokeWidth:"2"}),(0,E.jsx)("path",{d:"M18 7.333C18 6.597 17.403 6 16.667 6H7.333C6.597 6 6 6.597 6 7.333v9.334C6 17.403 6.597 18 7.333 18h9.334c.736 0 1.333-.597 1.333-1.333V7.333z",fill:dl(t),stroke:dl(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),Dl=s().memo((function(e){var t=e.theme;return hl((0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("path",{d:"M18 7.333C18 6.597 17.403 6 16.667 6H7.333C6.597 6 6 6.597 6 7.333v9.334C6 17.403 6.597 18 7.333 18h9.334c.736 0 1.333-.597 1.333-1.333V7.333z",fill:dl(t),stroke:dl(t),strokeWidth:"2"}),(0,E.jsx)("path",{d:"M11 3a1 1 0 00-1-1H3a1 1 0 00-1 1v7a1 1 0 001 1h8V3zM22 14a1 1 0 00-1-1h-7a1 1 0 00-1 1v7a1 1 0 001 1h8v-8z",fill:pl(t),stroke:pl(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),zl=s().memo((function(e){var t=e.theme;return hl((0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("path",{d:"M 2,5 H 22",fill:pl(t),stroke:pl(t),strokeWidth:"2",strokeLinecap:"round"}),(0,E.jsx)("path",{d:"M 6,7 C 5.446,7 5,7.446 5,8 v 9.999992 c 0,0.554 0.446,1 1,1 h 3.0000001 c 0.554,0 0.9999999,-0.446 0.9999999,-1 V 8 C 10,7.446 9.5540001,7 9.0000001,7 Z m 9,0 c -0.554,0 -1,0.446 -1,1 v 5.999992 c 0,0.554 0.446,1 1,1 h 3 c 0.554,0 1,-0.446 1,-1 V 8 C 19,7.446 18.554,7 18,7 Z",fill:dl(t),stroke:dl(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),Nl=s().memo((function(e){var t=e.theme;return hl((0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("path",{d:"M 2,19 H 22",fill:pl(t),stroke:pl(t),strokeWidth:"2",strokeLinecap:"round"}),(0,E.jsx)("path",{d:"m 6,16.999992 c -0.554,0 -1,-0.446 -1,-1 V 6 C 5,5.446 5.446,5 6,5 H 9.0000001 C 9.5540001,5 10,5.446 10,6 v 9.999992 c 0,0.554 -0.4459999,1 -0.9999999,1 z m 9,0 c -0.554,0 -1,-0.446 -1,-1 V 10 c 0,-0.554 0.446,-1 1,-1 h 3 c 0.554,0 1,0.446 1,1 v 5.999992 c 0,0.554 -0.446,1 -1,1 z",fill:dl(t),stroke:dl(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),Hl=s().memo((function(e){var t=e.theme;return hl((0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("path",{d:"M 5,2 V 22",fill:pl(t),stroke:pl(t),strokeWidth:"2",strokeLinecap:"round"}),(0,E.jsx)("path",{d:"m 7.000004,5.999996 c 0,-0.554 0.446,-1 1,-1 h 9.999992 c 0.554,0 1,0.446 1,1 v 3.0000001 c 0,0.554 -0.446,0.9999999 -1,0.9999999 H 8.000004 c -0.554,0 -1,-0.4459999 -1,-0.9999999 z m 0,9 c 0,-0.554 0.446,-1 1,-1 h 5.999992 c 0.554,0 1,0.446 1,1 v 3 c 0,0.554 -0.446,1 -1,1 H 8.000004 c -0.554,0 -1,-0.446 -1,-1 z",fill:dl(t),stroke:dl(t),strokeWidth:"2"})]}),{width:24})})),Rl=s().memo((function(e){var t=e.theme;return hl((0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("path",{d:"M 19,2 V 22",fill:pl(t),stroke:pl(t),strokeWidth:"2",strokeLinecap:"round"}),(0,E.jsx)("path",{d:"m 16.999996,5.999996 c 0,-0.554 -0.446,-1 -1,-1 H 6.000004 c -0.554,0 -1,0.446 -1,1 v 3.0000001 c 0,0.554 0.446,0.9999999 1,0.9999999 h 9.999992 c 0.554,0 1,-0.4459999 1,-0.9999999 z m 0,9 c 0,-0.554 -0.446,-1 -1,-1 h -5.999992 c -0.554,0 -1,0.446 -1,1 v 3 c 0,0.554 0.446,1 1,1 h 5.999992 c 0.554,0 1,-0.446 1,-1 z",fill:dl(t),stroke:dl(t),strokeWidth:"2"})]}),{width:24})})),Bl=s().memo((function(e){var t=e.theme;return hl((0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("path",{d:"M19 5V19M5 5V19",stroke:pl(t),strokeWidth:"2",strokeLinecap:"round"}),(0,E.jsx)("path",{d:"M15 9C15.554 9 16 9.446 16 10V14C16 14.554 15.554 15 15 15H9C8.446 15 8 14.554 8 14V10C8 9.446 8.446 9 9 9H15Z",fill:dl(t),stroke:dl(t),strokeWidth:"2"})]}),{width:24})})),Fl=s().memo((function(e){var t=e.theme;return hl((0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("path",{d:"M5 5L19 5M5 19H19",fill:pl(t),stroke:pl(t),strokeWidth:"2",strokeLinecap:"round"}),(0,E.jsx)("path",{d:"M15 9C15.554 9 16 9.446 16 10V14C16 14.554 15.554 15 15 15H9C8.446 15 8 14.554 8 14V10C8 9.446 8.446 9 9 9H15Z",fill:dl(t),stroke:dl(t),strokeWidth:"2"})]}),{width:24})})),Ul=s().memo((function(e){var t=e.theme;return hl((0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("path",{d:"m 5.000004,16.999996 c 0,0.554 0.446,1 1,1 h 3 c 0.554,0 1,-0.446 1,-1 v -10 c 0,-0.554 -0.446,-1 -1,-1 h -3 c -0.554,0 -1,0.446 -1,1 z m 9,-2 c 0,0.554 0.446,1 1,1 h 3 c 0.554,0 1,-0.446 1,-1 v -6 c 0,-0.554 -0.446,-1 -1,-1 h -3 c -0.554,0 -1,0.446 -1,1 z",fill:dl(t),stroke:dl(t),strokeWidth:"2"}),(0,E.jsx)("path",{d:"M 2,12 H 22",fill:pl(t),stroke:pl(t),strokeWidth:"2",strokeDasharray:"1, 2.8",strokeLinecap:"round"})]}),{width:24,mirror:!0})})),Vl=s().memo((function(e){var t=e.theme;return hl((0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("path",{d:"M 7 5 C 6.446 5 6 5.446 6 6 L 6 9 C 6 9.554 6.446 10 7 10 L 17 10 C 17.554 10 18 9.554 18 9 L 18 6 C 18 5.446 17.554 5 17 5 L 7 5 z M 9 14 C 8.446 14 8 14.446 8 15 L 8 18 C 8 18.554 8.446 19 9 19 L 15 19 C 15.554 19 16 18.554 16 18 L 16 15 C 16 14.446 15.554 14 15 14 L 9 14 z ",fill:dl(t),stroke:dl(t),strokeWidth:"2"}),(0,E.jsx)("path",{d:"M 12,2 V 22",fill:pl(t),stroke:pl(t),strokeWidth:"2",strokeDasharray:"1, 2.8",strokeLinecap:"round"})]}),{width:24})})),Gl=hl("M192 256c61.9 0 112-50.1 112-112S253.9 32 192 32 80 82.1 80 144s50.1 112 112 112zm76.8 32h-8.3c-20.8 10-43.9 16-68.5 16s-47.6-6-68.5-16h-8.3C51.6 288 0 339.6 0 403.2V432c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48v-28.8c0-63.6-51.6-115.2-115.2-115.2zM480 256c53 0 96-43 96-96s-43-96-96-96-96 43-96 96 43 96 96 96zm48 32h-3.8c-13.9 4.8-28.6 8-44.2 8s-30.3-3.2-44.2-8H432c-20.4 0-39.2 5.9-55.7 15.4 24.4 26.3 39.7 61.2 39.7 99.8v38.4c0 2.2-.5 4.3-.6 6.4H592c26.5 0 48-21.5 48-48 0-61.9-50.1-112-112-112z",{width:640,height:512,mirror:!0}),Wl=(hl("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"),hl("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"),hl("M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z",{width:352,height:512})),Kl=hl("M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z",{width:320,height:512,style:{marginLeft:"-0.2rem"},mirror:!0}),Zl=hl("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",{mirror:!0}),Yl=(hl("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",{width:24}),hl("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",{width:384,height:512})),ql=s().memo((function(e){var t=e.theme;return hl((0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("path",{d:"M25 26H111V111H25",fill:pl(t)}),(0,E.jsx)("path",{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",stroke:pl(t),strokeWidth:"2"}),(0,E.jsx)("path",{d:"M100 100H160V160H100",fill:pl(t)}),(0,E.jsx)("path",{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",stroke:pl(t),strokeWidth:"2"}),(0,E.jsxs)("g",{fill:fl(t),stroke:pl(t),strokeWidth:"6",children:[(0,E.jsx)("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),(0,E.jsx)("rect",{x:"2.5",y:"149.5",width:"30",height:"30"}),(0,E.jsx)("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),(0,E.jsx)("rect",{x:"147.5",y:"2.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})})),Xl=s().memo((function(e){var t=e.theme;return hl((0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("path",{d:"M25 26H111V111H25",fill:pl(t)}),(0,E.jsx)("path",{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",stroke:pl(t),strokeWidth:"2"}),(0,E.jsx)("path",{d:"M100 100H160V160H100",fill:pl(t)}),(0,E.jsx)("path",{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",stroke:pl(t),strokeWidth:"2"}),(0,E.jsxs)("g",{fill:fl(t),stroke:pl(t),strokeWidth:"6",children:[(0,E.jsx)("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),(0,E.jsx)("rect",{x:"78.5",y:"149.5",width:"30",height:"30"}),(0,E.jsx)("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),(0,E.jsx)("rect",{x:"147.5",y:"78.5",width:"30",height:"30"}),(0,E.jsx)("rect",{x:"105.5",y:"2.5",width:"30",height:"30"}),(0,E.jsx)("rect",{x:"2.5",y:"102.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})})),$l=s().memo((function(e){var t=e.theme;return hl((0,E.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.101 16H28.0934L36 8.95989V4H33.5779L20.101 16ZM30.5704 4L17.0935 16H9.10101L22.5779 4H30.5704ZM19.5704 4L6.09349 16H4V10.7475L11.5779 4H19.5704ZM8.57036 4H4V8.06952L8.57036 4ZM36 11.6378L31.101 16H36V11.6378ZM2 2V18H38V2H2Z",fill:pl(t)}),{width:40,height:20})})),Ql=s().memo((function(e){var t=e.theme;return hl((0,E.jsxs)("g",{fill:pl(t),fillRule:"evenodd",clipRule:"evenodd",children:[(0,E.jsx)("path",{d:"M20.101 16H28.0934L36 8.95989V4H33.5779L20.101 16ZM30.5704 4L17.0935 16H9.10101L22.5779 4H30.5704ZM19.5704 4L6.09349 16H4V10.7475L11.5779 4H19.5704ZM8.57036 4H4V8.06952L8.57036 4ZM36 11.6378L31.101 16H36V11.6378ZM2 2V18H38V2H2Z"}),(0,E.jsx)("path",{d:"M14.0001 18L3.00006 4.00002L4.5727 2.76438L15.5727 16.7644L14.0001 18ZM25.0001 18L14.0001 4.00002L15.5727 2.76438L26.5727 16.7644L25.0001 18ZM36.0001 18L25.0001 4.00002L26.5727 2.76438L37.5727 16.7644L36.0001 18Z"})]}),{width:40,height:20})})),Jl=s().memo((function(e){var t=e.theme;return hl((0,E.jsx)("path",{d:"M2 2H38V18H2V2Z",fill:pl(t)}),{width:40,height:20})})),es=s().memo((function(e){var t=e.theme,n=e.strokeWidth;return hl((0,E.jsx)("path",{d:"M6 10H32",stroke:pl(t),strokeWidth:n,strokeLinecap:"round",fill:"none"}),{width:40,height:20})})),ts=s().memo((function(e){var t=e.theme;return hl((0,E.jsx)("path",{d:"M6 10H34",stroke:pl(t),strokeWidth:2,fill:"none",strokeLinecap:"round"}),{width:40,height:20})})),ns=s().memo((function(e){var t=e.theme;return hl((0,E.jsx)("path",{d:"M6 10H34",stroke:pl(t),strokeWidth:2.5,strokeDasharray:"10, 8",fill:"none",strokeLinecap:"round"}),{width:40,height:20})})),rs=s().memo((function(e){var t=e.theme;return hl((0,E.jsx)("path",{d:"M6 10H36",stroke:pl(t),strokeWidth:2.5,strokeDasharray:"2, 4.5",fill:"none",strokeLinecap:"round"}),{width:40,height:20})})),os=s().memo((function(e){var t=e.theme;return hl((0,E.jsx)("path",{d:"M3.00098 16.1691C6.28774 13.9744 19.6399 2.8905 22.7215 3.00082C25.8041 3.11113 19.1158 15.5488 21.4962 16.8309C23.8757 18.1131 34.4155 11.7148 37.0001 10.6919",stroke:pl(t),strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),is=s().memo((function(e){var t=e.theme;return hl((0,E.jsx)("path",{d:"M3 17C6.68158 14.8752 16.1296 9.09849 22.0648 6.54922C28 3.99995 22.2896 13.3209 25 14C27.7104 14.6791 36.3757 9.6471 36.3757 9.6471M6.40706 15C13 11.1918 20.0468 1.51045 23.0234 3.0052C26 4.49995 20.457 12.8659 22.7285 16.4329C25 20 36.3757 13 36.3757 13",stroke:pl(t),strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),as=s().memo((function(e){var t=e.theme;return hl((0,E.jsx)("path",{d:"M3 15.6468C6.93692 13.5378 22.5544 2.81528 26.6206 3.00242C30.6877 3.18956 25.6708 15.3346 27.4009 16.7705C29.1309 18.2055 35.4001 12.4762 37 11.6177M3.97143 10.4917C6.61158 9.24563 16.3706 2.61886 19.8104 3.01724C23.2522 3.41472 22.0773 12.2013 24.6181 12.8783C27.1598 13.5536 33.3179 8.04068 35.0571 7.07244",stroke:pl(t),strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),ls=s().memo((function(e){var t=e.theme;return hl((0,E.jsx)("path",{d:"M10 17L10 5L35 5",stroke:pl(t),strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),ss=s().memo((function(e){var t=e.theme;return hl((0,E.jsx)("path",{d:"M10 17V15C10 8 13 5 21 5L33.5 5",stroke:pl(t),strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),cs=s().memo((function(e){var t=e.theme;return hl((0,E.jsx)("path",{d:"M6 10H34",stroke:pl(t),strokeWidth:2,fill:"none"}),{width:40,height:20})})),us=s().memo((function(e){var t=e.theme,n=e.flip,r=void 0!==n&&n;return hl((0,E.jsxs)("g",{transform:r?"translate(40, 0) scale(-1, 1)":"",stroke:pl(t),strokeWidth:2,fill:"none",children:[(0,E.jsx)("path",{d:"M34 10H6M34 10L27 5M34 10L27 15"}),(0,E.jsx)("path",{d:"M27.5 5L34.5 10L27.5 15"})]}),{width:40,height:20})})),ds=s().memo((function(e){var t=e.theme,n=e.flip,r=void 0!==n&&n;return hl((0,E.jsxs)("g",{stroke:pl(t),fill:pl(t),transform:r?"translate(40, 0) scale(-1, 1)":"",children:[(0,E.jsx)("path",{d:"M32 10L6 10",strokeWidth:2}),(0,E.jsx)("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})})),ps=s().memo((function(e){var t=e.theme,n=e.flip,r=void 0!==n&&n;return hl((0,E.jsx)("g",{transform:r?"translate(40, 0) scale(-1, 1)":"",children:(0,E.jsx)("path",{d:"M34 10H5.99996M34 10L34 5M34 10L34 15",stroke:pl(t),strokeWidth:2,fill:"none"})}),{width:40,height:20})})),fs=s().memo((function(e){var t=e.theme,n=e.flip,r=void 0!==n&&n;return hl((0,E.jsxs)("g",{stroke:pl(t),fill:pl(t),transform:r?"translate(40, 0) scale(-1, 1)":"",children:[(0,E.jsx)("path",{d:"M32 10L6 10",strokeWidth:2}),(0,E.jsx)("path",{d:"M27.5 5.5L34.5 10L27.5 14.5L27.5 5.5"})]}),{width:40,height:20})})),hs=s().memo((function(e){var t=e.theme;return hl((0,E.jsx)("path",{fill:pl(t),d:"M 0 69.092 L 0 55.03 A 124.24 124.24 0 0 0 4.706 57.02 Q 6.826 57.863 8.708 58.5 A 53.466 53.466 0 0 0 12.231 59.571 Q 17.236 60.889 21.387 60.889 A 20.909 20.909 0 0 0 24.265 60.704 Q 25.719 60.502 26.903 60.077 A 8.649 8.649 0 0 0 29.028 58.985 Q 31.689 57.08 31.689 53.321 Q 31.689 51.221 30.518 49.585 A 10.126 10.126 0 0 0 29.282 48.177 Q 28.352 47.287 27.075 46.436 A 23.719 23.719 0 0 0 25.752 45.627 Q 23.774 44.492 20.176 42.735 A 254.44 254.44 0 0 0 17.822 41.602 Q 11.503 38.631 8.236 35.888 A 19.742 19.742 0 0 1 8.008 35.694 A 22.18 22.18 0 0 1 2.783 29.102 Q 0.83 25.342 0.83 20.313 A 22.471 22.471 0 0 1 1.733 13.778 A 17.283 17.283 0 0 1 7.251 5.42 A 21.486 21.486 0 0 1 15.177 1.272 Q 18.361 0.338 22.166 0.09 A 43.573 43.573 0 0 1 25 0 A 42.399 42.399 0 0 1 34.349 1.01 A 39.075 39.075 0 0 1 35.62 1.319 A 67.407 67.407 0 0 1 42.108 3.382 A 83.357 83.357 0 0 1 46.191 5.03 L 41.309 16.797 Q 35.596 14.453 31.86 13.526 A 30.762 30.762 0 0 0 25.417 12.612 A 28.337 28.337 0 0 0 24.512 12.598 A 14.846 14.846 0 0 0 22.022 12.793 Q 19.498 13.224 17.92 14.6 Q 15.625 16.602 15.625 19.824 Q 15.625 21.826 16.553 23.316 Q 17.48 24.805 19.507 26.197 A 18.343 18.343 0 0 0 20.659 26.912 Q 22.596 28.035 26.516 29.953 A 299.99 299.99 0 0 0 29.102 31.201 Q 37.91 35.412 41.841 39.642 A 16.553 16.553 0 0 1 42.822 40.796 A 17.675 17.675 0 0 1 46.301 49.233 A 23.517 23.517 0 0 1 46.533 52.588 A 21.581 21.581 0 0 1 45.471 59.515 A 17.733 17.733 0 0 1 39.575 67.823 Q 33.745 72.486 24.094 73.243 A 49.683 49.683 0 0 1 20.215 73.389 A 51.712 51.712 0 0 1 9.448 72.315 A 40.672 40.672 0 0 1 0 69.092 Z"}),{width:47,height:77})})),gs=s().memo((function(e){var t=e.theme;return hl((0,E.jsx)("path",{fill:pl(t),d:"M 44.092 71.387 L 30.225 71.387 L 13.037 15.381 L 12.598 15.381 A 1505.093 1505.093 0 0 1 12.959 22.313 Q 13.426 31.715 13.508 36.4 A 102.991 102.991 0 0 1 13.525 38.184 L 13.525 71.387 L 0 71.387 L 0 0 L 20.605 0 L 37.5 54.59 L 37.793 54.59 L 55.713 0 L 76.318 0 L 76.318 71.387 L 62.207 71.387 L 62.207 37.598 Q 62.207 35.205 62.28 32.08 A 160.703 160.703 0 0 1 62.326 30.544 Q 62.452 26.754 62.866 17.168 A 5390.536 5390.536 0 0 1 62.939 15.479 L 62.5 15.479 L 44.092 71.387 Z"}),{width:77,height:75})})),ms=s().memo((function(e){var t=e.theme;return hl((0,E.jsx)("path",{fill:pl(t),d:"M 44.092 71.387 L 0 71.387 L 0 0 L 15.137 0 L 15.137 58.887 L 44.092 58.887 L 44.092 71.387 Z"}),{width:45,height:75})})),vs=s().memo((function(e){var t=e.theme;return hl((0,E.jsx)("path",{fill:pl(t),d:"M 42.578 35.4 L 66.699 71.387 L 49.414 71.387 L 32.813 44.385 L 16.211 71.387 L 0 71.387 L 23.682 34.57 L 1.514 0 L 18.213 0 L 33.594 25.684 L 48.682 0 L 64.99 0 L 42.578 35.4 Z M 119.775 71.387 L 75.684 71.387 L 75.684 0 L 90.82 0 L 90.82 58.887 L 119.775 58.887 L 119.775 71.387 Z"}),{width:120,height:75})})),bs=s().memo((function(e){var t=e.theme;return hl((0,E.jsx)("path",{fill:pl(t),d:"M290.74 93.24l128.02 128.02-277.99 277.99-114.14 12.6C11.35 513.54-1.56 500.62.14 485.34l12.7-114.22 277.9-277.88zm207.2-19.06l-60.11-60.11c-18.75-18.75-49.16-18.75-67.91 0l-56.55 56.55 128.02 128.02 56.55-56.55c18.75-18.76 18.75-49.16 0-67.91z"}),{width:448,height:512})})),ys=s().memo((function(e){var t=e.theme;return hl((0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("path",{fill:pl(t),d:"M 63.818 71.68 L 54.492 71.68 L 45.898 49.561 L 17.578 49.561 L 9.082 71.68 L 0 71.68 L 27.881 0 L 35.986 0 L 63.818 71.68 Z M 20.605 41.602 L 43.213 41.602 L 35.205 19.971 L 31.787 9.277 Q 30.322 15.137 28.711 19.971 L 20.605 41.602 Z"}),(0,E.jsx)("path",{fill:pl(t),d:"M 68.994 71.68 L 52.686 71.68 L 47.51 54.688 L 21.484 54.688 L 16.309 71.68 L 0 71.68 L 25.195 0 L 43.701 0 L 68.994 71.68 Z M 25.293 41.992 L 43.896 41.992 A 27590.463 27590.463 0 0 1 42.2 36.532 Q 36.965 19.676 35.937 16.273 A 120.932 120.932 0 0 1 35.815 15.869 A 131.65 131.65 0 0 1 35.396 14.435 Q 34.951 12.879 34.675 11.741 A 34.866 34.866 0 0 1 34.521 11.084 A 141.762 141.762 0 0 1 33.706 14.075 Q 31.482 21.957 25.293 41.992 Z"})]}),{width:70,height:78})})),xs=s().memo((function(e){var t=e.theme;return hl((0,E.jsx)(E.Fragment,{children:(0,E.jsx)("path",{fill:pl(t),d:"M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"})}),{width:640,height:512})})),ws=s().memo((function(e){var t=e.theme;return hl((0,E.jsx)("path",{d:"M12.83 352h262.34A12.82 12.82 0 00288 339.17v-38.34A12.82 12.82 0 00275.17 288H12.83A12.82 12.82 0 000 300.83v38.34A12.82 12.82 0 0012.83 352zm0-256h262.34A12.82 12.82 0 00288 83.17V44.83A12.82 12.82 0 00275.17 32H12.83A12.82 12.82 0 000 44.83v38.34A12.82 12.82 0 0012.83 96zM432 160H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16zm0 256H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16z",fill:pl(t),strokeLinecap:"round"}),{width:448,height:512})})),ks=s().memo((function(e){var t=e.theme;return hl((0,E.jsx)("path",{d:"M432 160H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16zm0 256H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16zM108.1 96h231.81A12.09 12.09 0 00352 83.9V44.09A12.09 12.09 0 00339.91 32H108.1A12.09 12.09 0 0096 44.09V83.9A12.1 12.1 0 00108.1 96zm231.81 256A12.09 12.09 0 00352 339.9v-39.81A12.09 12.09 0 00339.91 288H108.1A12.09 12.09 0 0096 300.09v39.81a12.1 12.1 0 0012.1 12.1z",fill:pl(t)}),{width:448,height:512})})),Ss=s().memo((function(e){var t=e.theme;return hl((0,E.jsx)("path",{d:"M16 224h416a16 16 0 0016-16v-32a16 16 0 00-16-16H16a16 16 0 00-16 16v32a16 16 0 0016 16zm416 192H16a16 16 0 00-16 16v32a16 16 0 0016 16h416a16 16 0 0016-16v-32a16 16 0 00-16-16zm3.17-384H172.83A12.82 12.82 0 00160 44.83v38.34A12.82 12.82 0 00172.83 96h262.34A12.82 12.82 0 00448 83.17V44.83A12.82 12.82 0 00435.17 32zm0 256H172.83A12.82 12.82 0 00160 300.83v38.34A12.82 12.82 0 00172.83 352h262.34A12.82 12.82 0 00448 339.17v-38.34A12.82 12.82 0 00435.17 288z",fill:pl(t),strokeLinecap:"round"}),{width:448,height:512})})),Es=hl((0,E.jsx)("path",{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",fill:"currentColor"}),{width:640,height:512}),js=hl("M280.37 148.26L96 300.11V464a16 16 0 0 0 16 16l112.06-.29a16 16 0 0 0 15.92-16V368a16 16 0 0 1 16-16h64a16 16 0 0 1 16 16v95.64a16 16 0 0 0 16 16.05L464 480a16 16 0 0 0 16-16V300L295.67 148.26a12.19 12.19 0 0 0-15.3 0zM571.6 251.47L488 182.56V44.05a12 12 0 0 0-12-12h-56a12 12 0 0 0-12 12v72.61L318.47 43a48 48 0 0 0-61 0L4.34 251.47a12 12 0 0 0-1.6 16.9l25.5 31A12 12 0 0 0 45.15 301l235.22-193.74a12.19 12.19 0 0 1 15.3 0L530.9 301a12 12 0 0 0 16.9-1.6l25.5-31a12 12 0 0 0-1.7-16.93z"),_s=[],Cs=function(e){return _s=_s.concat(e),e};function Os(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Is(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Os(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Os(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ms=function(e,t){var n;if(e.editingGroupId){var r=co(Ha(t),e.editingGroupId);if(r.length)return Is(Is({},e),{},{selectedElementIds:(n={},n[r[0].id]=!0,n)})}return e},Ps=Cs({name:"deleteSelectedElements",perform:function(e,t){if(t.editingLinearElement){var n=t.editingLinearElement,r=n.elementId,o=n.activePointIndex,i=n.startBindingElement,a=n.endBindingElement,l=Fi.getElement(r);if(!l)return!1;if(null==o||-1===o||l.points.length<2){var s=e.filter((function(e){return e.id!==l.id}));return{elements:s,appState:Is(Is({},Ms(t,s)),{},{editingLinearElement:null}),commitToHistory:!1}}var c={startBindingElement:0===o?null:i,endBindingElement:o===l.points.length-1?null:a};return Fi.movePoint(l,o,"delete"),{elements:e,appState:Is(Is({},t),{},{editingLinearElement:Is(Is(Is({},t.editingLinearElement),c),{},{activePointIndex:o>0?o-1:0})}),commitToHistory:!0}}var u=function(e,t){return{elements:e.map((function(e){return t.selectedElementIds[e.id]?Yr(e,{isDeleted:!0}):e})),appState:Is(Is({},t),{},{selectedElementIds:{}})}}(e,t),d=u.elements,p=u.appState;return ga(d,e.filter((function(e){var n=e.id;return t.selectedElementIds[n]}))),{elements:d,appState:Is(Is({},p=Ms(p,d)),{},{elementType:"selection",multiElement:null}),commitToHistory:Ga(Ha(e),t)}},contextItemLabel:"labels.delete",keyTest:function(e){return e.key===Ft||e.key===Gt},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,E.jsx)(ul,{type:"button",icon:wl,title:S("labels.delete"),"aria-label":S("labels.delete"),onClick:function(){return r(null)},visible:Ga(Ha(t),n)})}}),Ts=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},Ls=function(e,t){for(var n=[],r=[],o=null,i=-1;++i<e.length;)t.selectedElementIds[e[i].id]?(r.length&&(n=n.concat(r),r=[]),n.push(i),o=i+1):e[i].isDeleted&&o===i?(o=i+1,r.push(i)):r=[];return n},As=function(e,t,n,r){var o=t[n],i=function(t){return!t.isDeleted&&(!e.editingGroupId||t.groupIds.includes(e.editingGroupId))},a="left"===r?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length-1;n<0&&(n=e.length+n);for(var r=(n=Math.min(e.length-1,Math.max(n,0)))+1;--r>-1;)if(t(e[r],r,e))return r;return-1}(t,i,Math.max(0,n-1)):function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;n<0&&(n=e.length+n);for(var r=(n=Math.min(e.length,Math.max(n,0)))-1;++r<e.length;)if(t(e[r],r,e))return r;return-1}(t,i,n+1),l=t[a];if(!l)return-1;if(e.editingGroupId){if((null==o?void 0:o.groupIds.join(""))===(null==l?void 0:l.groupIds.join("")))return a;if(null==l||!l.groupIds.includes(e.editingGroupId))return-1}if(!l.groupIds.length)return a;var s=e.editingGroupId?l.groupIds[l.groupIds.indexOf(e.editingGroupId)-1]:l.groupIds[l.groupIds.length-1],c=co(t,s);return c.length?"left"===r?t.indexOf(c[0]):t.indexOf(c[c.length-1]):a},Ds=function(e,t){return t.reduce((function(t,n){var r=e[n];return t[r.id]=r,t}),{})},zs=function(e,t,n){var r,o,i=Ls(t,e),a=Ds(t,i),l=(o=0,(r=i).reduce((function(e,t,n){return n>0&&r[n-1]!==t-1&&(o=++o),(e[o]||(e[o]=[])).push(t),e}),[]));return"right"===n&&(l=l.reverse()),l.forEach((function(r,o){var i=r[0],a=r[r.length-1],l="left"===n?i:a,s=As(e,t,l,n);if(-1!==s&&l!==s){var c="left"===n?t.slice(0,s):t.slice(0,i),u=t.slice(i,a+1),d="left"===n?t.slice(s,i):t.slice(a+1,s+1),p="left"===n?t.slice(a+1):t.slice(s+1);t=Ts("left"===n?Ts(Ts(Ts([],c,!0),u,!0),d,!0):Ts(Ts(Ts([],c,!0),d,!0),u,!0),p,!0)}})),t.map((function(e){return a[e.id]?qr(e):e}))},Ns=function(e,t,n){var r,o,i=Ls(e,t),a=Ds(e,i),l=[];if("left"===n){if(t.editingGroupId){if(!(s=co(e,t.editingGroupId)).length)return e;r=e.indexOf(s[0])}else r=0;o=i[i.length-1]}else{if(t.editingGroupId){var s;if(!(s=co(e,t.editingGroupId)).length)return e;o=e.indexOf(s[s.length-1])}else o=e.length-1;r=i[0]}for(var c=r;c<o+1;c++)i.includes(c)||l.push(e[c]);var u=Object.values(a).map((function(e){return qr(e)})),d=e.slice(0,r),p=e.slice(o+1);return Ts("left"===n?Ts(Ts(Ts([],d,!0),u,!0),l,!0):Ts(Ts(Ts([],d,!0),l,!0),u,!0),p,!0)},Hs=function(e,t){return zs(t,e,"left")},Rs=function(e,t){return zs(t,e,"right")},Bs=function(e,t){return Ns(e,t,"left")},Fs=function(e,t){return Ns(e,t,"right")},Us=Cs({name:"sendBackward",perform:function(e,t){return{elements:Hs(e,t),appState:t,commitToHistory:!0}},contextItemLabel:"labels.sendBackward",keyPriority:40,keyTest:function(e){return e[Vt]&&!e.shiftKey&&e.code===kt},PanelComponent:function(e){var t=e.updateData,n=e.appState;return(0,E.jsx)("button",{type:"button",className:"zIndexButton",onClick:function(){return t(null)},title:"".concat(S("labels.sendBackward")," — ").concat(In("CtrlOrCmd+[")),children:(0,E.jsx)(Ll,{theme:n.theme})})}}),Vs=Cs({name:"bringForward",perform:function(e,t){return{elements:Rs(e,t),appState:t,commitToHistory:!0}},contextItemLabel:"labels.bringForward",keyPriority:40,keyTest:function(e){return e[Vt]&&!e.shiftKey&&e.code===wt},PanelComponent:function(e){var t=e.updateData,n=e.appState;return(0,E.jsx)("button",{type:"button",className:"zIndexButton",onClick:function(){return t(null)},title:"".concat(S("labels.bringForward")," — ").concat(In("CtrlOrCmd+]")),children:(0,E.jsx)(Tl,{theme:n.theme})})}}),Gs=Cs({name:"sendToBack",perform:function(e,t){return{elements:Bs(e,t),appState:t,commitToHistory:!0}},contextItemLabel:"labels.sendToBack",keyTest:function(e){return ht?e[Vt]&&e.altKey&&e.code===kt:e[Vt]&&e.shiftKey&&e.code===kt},PanelComponent:function(e){var t=e.updateData,n=e.appState;return(0,E.jsx)("button",{type:"button",className:"zIndexButton",onClick:function(){return t(null)},title:"".concat(S("labels.sendToBack")," — ").concat(In(ht?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")),children:(0,E.jsx)(Dl,{theme:n.theme})})}}),Ws=Cs({name:"bringToFront",perform:function(e,t){return{elements:Fs(e,t),appState:t,commitToHistory:!0}},contextItemLabel:"labels.bringToFront",keyTest:function(e){return ht?e[Vt]&&e.altKey&&e.code===wt:e[Vt]&&e.shiftKey&&e.code===wt},PanelComponent:function(e){var t=e.updateData,n=e.appState;return(0,E.jsx)("button",{type:"button",className:"zIndexButton",onClick:function(e){return t(null)},title:"".concat(S("labels.bringToFront")," — ").concat(In(ht?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")),children:(0,E.jsx)(Al,{theme:n.theme})})}});function Ks(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Zs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ks(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ks(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ys=Cs({name:"selectAll",perform:function(e,t){return!t.editingLinearElement&&{appState:lo(Zs(Zs({},t),{},{editingGroupId:null,selectedElementIds:e.reduce((function(e,t){return t.isDeleted||(e[t.id]=!0),e}),{})}),Ha(e)),commitToHistory:!0}},contextItemLabel:"labels.selectAll",keyTest:function(e){return e[Vt]&&e.key===Xt}}),qs=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};function Xs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Xs(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Qs=Cs({name:"duplicateSelection",perform:function(e,t){if(t.editingLinearElement){var n=t.editingLinearElement,r=n.activePointIndex,o=n.elementId,i=Fi.getElement(o);if(!i||null===r)return!1;var a=i.points,l=a[r],s=a[r+1];return Zr(i,{points:qs(qs(qs([],a.slice(0,r+1),!0),[s?[(l[0]+s[0])/2,(l[1]+s[1])/2]:[l[0]+30,l[1]+30]],!1),a.slice(r+1),!0)}),{appState:$s($s({},t),{},{editingLinearElement:$s($s({},t.editingLinearElement),{},{activePointIndex:r+1})}),elements:e,commitToHistory:!0}}return $s($s({},Js(e,t)),{},{commitToHistory:!0})},contextItemLabel:"labels.duplicateSelection",keyTest:function(e){return e[Vt]&&e.key===$t},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,E.jsx)(ul,{type:"button",icon:Zl,title:"".concat(S("labels.duplicateSelection")," — ").concat(In("CtrlOrCmd+D")),"aria-label":S("labels.duplicateSelection"),onClick:function(){return r(null)},visible:Ga(Ha(t),n)})}}),Js=function(e,t){for(var n=new Map,r=[],o=[],i=new Map,a=function(e){var a=ko(t.editingGroupId,n,e,{x:e.x+c.k/2,y:e.y+c.k/2});return i.set(e.id,a.id),o.push(e),r.push(a),a},l=[],s=0;s<e.length;){var u=e[s];if(t.selectedElementIds[u.id]){if(u.groupIds.length){var d=io(t,u);if(d){var p=co(e,d);l.push.apply(l,qs(qs([],p,!1),p.map((function(e){return a(e)})),!1)),s+=p.length;continue}}l.push(u,a(u))}else l.push(u);s++}return fa(l,o,i),{elements:l,appState:lo($s($s({},t),{},{selectedGroupIds:{},selectedElementIds:r.reduce((function(e,t){return e[t.id]=!0,e}),{})}),Ha(l))}},ec=function(e){var t=e.options,n=e.value,r=e.onChange,o=e.group;return(0,E.jsx)("div",{className:"buttonList buttonListIcon",children:t.map((function(e){return(0,E.jsxs)("label",{className:Oe({active:n===e.value}),title:e.text,children:[(0,E.jsx)("input",{type:"radio",name:o,onChange:function(){return r(e.value)},checked:n===e.value}),e.icon]},e.text)}))})},tc=(n(4301),function(e){var t=e.children,n=e.left,r=e.top,o=e.onCloseRequest,i=e.fitInViewport,a=void 0!==i&&i,s=(0,l.useRef)(null);return(0,l.useLayoutEffect)((function(){if(a&&s.current){var e=s.current,t=e.getBoundingClientRect(),n=t.x,r=t.y,o=t.width,i=t.height,l=window.innerWidth;n+o>l&&(e.style.left="".concat(l-o,"px"));var c=window.innerHeight;r+i>c&&(e.style.top="".concat(c-i,"px"))}}),[a]),(0,l.useEffect)((function(){if(o){var e=function(e){var t;null!==(t=s.current)&&void 0!==t&&t.contains(e.target)||(0,ft.unstable_batchedUpdates)((function(){return o(e)}))};return document.addEventListener("pointerdown",e,!1),function(){return document.removeEventListener("pointerdown",e,!1)}}}),[o]),(0,E.jsx)("div",{className:"popover",style:{top:r,left:n},ref:s,children:t})}),nc=(n(4220),function(e){var t=(new Option).style;return t.color=e,!!t.color}),rc=[["1","2","3","4","5"],["q","w","e","r","t"],["a","s","d","f","g"]].flat(),oc=function(e){var t=e.colors,n=e.color,r=e.onChange,o=e.onClose,i=e.label,a=e.showInput,l=void 0===a||a,c=e.type,u=s().useRef(),d=s().useRef(),p=s().useRef(),f=s().useRef();s().useEffect((function(){d.current?d.current.focus():f.current?f.current.focus():p.current&&p.current.focus()}),[]);return(0,E.jsxs)("div",{className:"color-picker color-picker-type-".concat(c),role:"dialog","aria-modal":"true","aria-label":S("labels.colorPicker"),onKeyDown:function(e){if(e.key===qt){var t,n=document.activeElement;if(e.shiftKey){if(n===u.current)null===(t=f.current)||void 0===t||t.focus(),e.preventDefault()}else if(n===f.current){var r;null===(r=u.current)||void 0===r||r.focus(),e.preventDefault()}}else if(pn(e.key)){n=document.activeElement;var i=w().rtl;if(-1!==(c=Array.prototype.indexOf.call(p.current.children,n))){var a=p.current.children.length-(l?1:0),s=e.key===(i?Ht:Rt)?(c+1)%a:e.key===(i?Rt:Ht)?(a+c-1)%a:e.key===Nt?(c+5)%a:e.key===Bt?(a+c-5)%a:c;p.current.children[s].focus()}e.preventDefault()}else if(rc.includes(e.key.toLowerCase())&&!yn(e.target)){var c=rc.indexOf(e.key.toLowerCase());p.current.children[c].focus(),e.preventDefault()}else e.key!==Kt&&e.key!==Wt||(e.preventDefault(),o());e.nativeEvent.stopImmediatePropagation(),e.stopPropagation()},children:[(0,E.jsx)("div",{className:"color-picker-triangle color-picker-triangle-shadow"}),(0,E.jsx)("div",{className:"color-picker-triangle"}),(0,E.jsxs)("div",{className:"color-picker-content",ref:function(e){e&&(p.current=e)},tabIndex:0,children:[t.map((function(e,t){var o=e.replace("#","");return(0,E.jsxs)("button",{className:"color-picker-swatch",onClick:function(t){t.currentTarget.focus(),r(e)},title:"".concat(S("colors.".concat(o))).concat(Nn(e)?"":" (".concat(e,")")," — ").concat(rc[t].toUpperCase()),"aria-label":S("colors.".concat(o)),"aria-keyshortcuts":rc[t],style:{color:e},ref:function(r){r&&0===t&&(u.current=r),r&&e===n&&(d.current=r)},onFocus:function(){r(e)},children:[Nn(e)?(0,E.jsx)("div",{className:"color-picker-transparent"}):void 0,(0,E.jsx)("span",{className:"color-picker-keybinding",children:rc[t]})]},e)})),l&&(0,E.jsx)(ic,{color:n,label:i,onChange:function(e){r(e)},ref:f})]})]})},ic=s().forwardRef((function(e,t){var n=e.color,r=e.onChange,o=e.label,i=s().useState(n),a=i[0],l=i[1],c=s().useRef(null);s().useEffect((function(){l(n)}),[n]),s().useImperativeHandle(t,(function(){return c.current}));var u=s().useCallback((function(e){var t=e.toLowerCase(),n=function(e){return Nn(e)||nc(e)?e:nc("#".concat(e))?"#".concat(e):null}(t);n&&r(n),l(t)}),[r]);return(0,E.jsxs)("label",{className:"color-input-container",children:[(0,E.jsx)("div",{className:"color-picker-hash",children:"#"}),(0,E.jsx)("input",{spellCheck:!1,className:"color-picker-input","aria-label":o,onChange:function(e){return u(e.target.value)},value:(a||"").replace(/^#/,""),onBlur:function(){return l(n)},ref:c})]})})),ac=function(e){var t=e.type,n=e.color,r=e.onChange,o=e.label,i=e.isActive,a=e.setActive,l=s().useRef(null);return(0,E.jsxs)("div",{children:[(0,E.jsxs)("div",{className:"color-picker-control-container",children:[(0,E.jsx)("button",{className:"color-picker-label-swatch","aria-label":o,style:n?{"--swatch-color":n}:void 0,onClick:function(){return a(!i)},ref:l}),(0,E.jsx)(ic,{color:n,label:o,onChange:function(e){r(e)}})]}),(0,E.jsx)(s().Suspense,{fallback:"",children:i?(0,E.jsx)(tc,{onCloseRequest:function(e){return e.target!==l.current&&a(!1)},children:(0,E.jsx)(oc,{colors:pt[t],color:n||null,onChange:function(e){r(e)},onClose:function(){var e;a(!1),null===(e=l.current)||void 0===e||e.focus()},label:o,showInput:!1,type:t})}):null})]})};n(7117);function lc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function sc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lc(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function cc(e){var t=e.options,n=e.value,r=e.label,o=e.onChange,i=e.onClose,a=s().useRef(),l=s().useRef(),c=s().useRef(null);s().useEffect((function(){l.current?l.current.focus():c.current&&c.current.focus()}),[]);return(0,E.jsx)("div",{className:"picker",role:"dialog","aria-modal":"true","aria-label":r,onKeyDown:function(e){var n=t.find((function(t){return t.keyBinding===e.key.toLowerCase()}));if(e.metaKey||e.altKey||e.ctrlKey||!n)if(e.key===qt)setTimeout((function(){l.current!==document.activeElement&&i()}),0);else if(pn(e.key)){var r=document.activeElement,o=w().rtl;if(-1!==(u=Array.prototype.indexOf.call(c.current.children,r))){var a=t.length,s=u;switch(e.key){case o?Ht:Rt:case Nt:s=(u+1)%a;break;case o?Rt:Ht:case Bt:s=(a+u-1)%a}c.current.children[s].focus()}e.preventDefault()}else e.key!==Kt&&e.key!==Wt||(e.preventDefault(),i());else{var u=t.indexOf(n);c.current.children[u].focus(),e.preventDefault()}e.nativeEvent.stopImmediatePropagation(),e.stopPropagation()},children:(0,E.jsx)("div",{className:"picker-content",ref:c,children:t.map((function(e,t){return(0,E.jsxs)("button",{className:"picker-option",onClick:function(t){t.currentTarget.focus(),o(e.value)},title:"".concat(e.text," — ").concat(e.keyBinding.toUpperCase()),"aria-label":e.text||"none","aria-keyshortcuts":e.keyBinding,ref:function(r){r&&0===t&&(a.current=r),r&&e.value===n&&(l.current=r)},onFocus:function(){o(e.value)},children:[e.icon,(0,E.jsx)("span",{className:"picker-keybinding",children:e.keyBinding})]},e.text)}))})})}function uc(e){var t,n=e.value,r=e.label,o=e.options,i=e.onChange,a=e.group,l=void 0===a?"":a,c=s().useState(!1),u=c[0],d=c[1],p=s().useRef(null),f=w().rtl;return(0,E.jsxs)("label",{className:"picker-container",children:[(0,E.jsx)("button",{name:l,className:u?"active":"","aria-label":r,onClick:function(){return d(!u)},ref:p,children:null===(t=o.find((function(e){return e.value===n})))||void 0===t?void 0:t.icon}),(0,E.jsx)(s().Suspense,{fallback:"",children:u?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(tc,sc(sc({onCloseRequest:function(e){return e.target!==p.current&&d(!1)}},f?{right:5.5}:{left:-5.5}),{},{children:(0,E.jsx)(cc,{options:o,value:n,label:r,onChange:i,onClose:function(){var e;d(!1),null===(e=p.current)||void 0===e||e.focus()}})})),(0,E.jsx)("div",{className:"picker-triangle"})]}):null})]})}function dc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dc(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var fc=function(e,t,n){return e.map((function(e){var r;return t.selectedElementIds[e.id]||e.id===(null===(r=t.editingElement)||void 0===r?void 0:r.id)?n(e):e}))},hc=function(e,t,n,r){var o,i,a=t.editingElement,l=Ha(e);return null!==(o=null!==(i=a&&n(a))&&void 0!==i?i:Ga(l,t)?function(e,t,n){var r=Array.from(new Set(Wa(e,t).map((function(e){return n(e)}))));return 1===r.length?r[0]:null}(l,t,n):r)&&void 0!==o?o:null},gc=(Cs({name:"changeStrokeColor",perform:function(e,t,n){return pc(pc({},n.currentItemStrokeColor&&{elements:fc(e,t,(function(e){return Xa(e.type)?Yr(e,{strokeColor:n.currentItemStrokeColor}):e}))}),{},{appState:pc(pc({},t),n),commitToHistory:!!n.currentItemStrokeColor})},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("h3",{"aria-hidden":"true",children:S("labels.stroke")}),(0,E.jsx)(ac,{type:"elementStroke",label:S("labels.stroke"),color:hc(t,n,(function(e){return e.strokeColor}),n.currentItemStrokeColor),onChange:function(e){return r({currentItemStrokeColor:e})},isActive:"strokeColorPicker"===n.openPopup,setActive:function(e){return r({openPopup:e?"strokeColorPicker":null})}})]})}}),Cs({name:"changeBackgroundColor",perform:function(e,t,n){return pc(pc({},n.currentItemBackgroundColor&&{elements:fc(e,t,(function(e){return Yr(e,{backgroundColor:n.currentItemBackgroundColor})}))}),{},{appState:pc(pc({},t),n),commitToHistory:!!n.currentItemBackgroundColor})},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("h3",{"aria-hidden":"true",children:S("labels.background")}),(0,E.jsx)(ac,{type:"elementBackground",label:S("labels.background"),color:hc(t,n,(function(e){return e.backgroundColor}),n.currentItemBackgroundColor),onChange:function(e){return r({currentItemBackgroundColor:e})},isActive:"backgroundColorPicker"===n.openPopup,setActive:function(e){return r({openPopup:e?"backgroundColorPicker":null})}})]})}}),Cs({name:"changeFillStyle",perform:function(e,t,n){return{elements:fc(e,t,(function(e){return Yr(e,{fillStyle:n})})),appState:pc(pc({},t),{},{currentItemFillStyle:n}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,E.jsxs)("fieldset",{children:[(0,E.jsx)("legend",{children:S("labels.fill")}),(0,E.jsx)(ec,{options:[{value:"hachure",text:S("labels.hachure"),icon:(0,E.jsx)($l,{theme:n.theme})},{value:"cross-hatch",text:S("labels.crossHatch"),icon:(0,E.jsx)(Ql,{theme:n.theme})},{value:"solid",text:S("labels.solid"),icon:(0,E.jsx)(Jl,{theme:n.theme})}],group:"fill",value:hc(t,n,(function(e){return e.fillStyle}),n.currentItemFillStyle),onChange:function(e){r(e)}})]})}}),Cs({name:"changeStrokeWidth",perform:function(e,t,n){return{elements:fc(e,t,(function(e){return Yr(e,{strokeWidth:n})})),appState:pc(pc({},t),{},{currentItemStrokeWidth:n}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,E.jsxs)("fieldset",{children:[(0,E.jsx)("legend",{children:S("labels.strokeWidth")}),(0,E.jsx)(ec,{group:"stroke-width",options:[{value:1,text:S("labels.thin"),icon:(0,E.jsx)(es,{theme:n.theme,strokeWidth:2})},{value:2,text:S("labels.bold"),icon:(0,E.jsx)(es,{theme:n.theme,strokeWidth:6})},{value:4,text:S("labels.extraBold"),icon:(0,E.jsx)(es,{theme:n.theme,strokeWidth:10})}],value:hc(t,n,(function(e){return e.strokeWidth}),n.currentItemStrokeWidth),onChange:function(e){return r(e)}})]})}}),Cs({name:"changeSloppiness",perform:function(e,t,n){return{elements:fc(e,t,(function(e){return Yr(e,{seed:Vr(),roughness:n})})),appState:pc(pc({},t),{},{currentItemRoughness:n}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,E.jsxs)("fieldset",{children:[(0,E.jsx)("legend",{children:S("labels.sloppiness")}),(0,E.jsx)(ec,{group:"sloppiness",options:[{value:0,text:S("labels.architect"),icon:(0,E.jsx)(os,{theme:n.theme})},{value:1,text:S("labels.artist"),icon:(0,E.jsx)(is,{theme:n.theme})},{value:2,text:S("labels.cartoonist"),icon:(0,E.jsx)(as,{theme:n.theme})}],value:hc(t,n,(function(e){return e.roughness}),n.currentItemRoughness),onChange:function(e){return r(e)}})]})}}),Cs({name:"changeStrokeStyle",perform:function(e,t,n){return{elements:fc(e,t,(function(e){return Yr(e,{strokeStyle:n})})),appState:pc(pc({},t),{},{currentItemStrokeStyle:n}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,E.jsxs)("fieldset",{children:[(0,E.jsx)("legend",{children:S("labels.strokeStyle")}),(0,E.jsx)(ec,{group:"strokeStyle",options:[{value:"solid",text:S("labels.strokeStyle_solid"),icon:(0,E.jsx)(ts,{theme:n.theme})},{value:"dashed",text:S("labels.strokeStyle_dashed"),icon:(0,E.jsx)(ns,{theme:n.theme})},{value:"dotted",text:S("labels.strokeStyle_dotted"),icon:(0,E.jsx)(rs,{theme:n.theme})}],value:hc(t,n,(function(e){return e.strokeStyle}),n.currentItemStrokeStyle),onChange:function(e){return r(e)}})]})}}),Cs({name:"changeOpacity",perform:function(e,t,n){return{elements:fc(e,t,(function(e){return Yr(e,{opacity:n})})),appState:pc(pc({},t),{},{currentItemOpacity:n}),commitToHistory:!0}},PanelComponent:function(e){var t,n=e.elements,r=e.appState,o=e.updateData;return(0,E.jsxs)("label",{className:"control-label",children:[S("labels.opacity"),(0,E.jsx)("input",{type:"range",min:"0",max:"100",step:"10",onChange:function(e){return o(+e.target.value)},onWheel:function(e){e.stopPropagation();var t=+e.target.value;e.deltaY<0&&t<100?o(t+10):e.deltaY>0&&t>0&&o(t-10)},value:null!==(t=hc(n,r,(function(e){return e.opacity}),r.currentItemOpacity))&&void 0!==t?t:void 0})]})}}),Cs({name:"changeFontSize",perform:function(e,t,n){return{elements:fc(e,t,(function(e){if(Te(e)){var t=Yr(e,{fontSize:n});return Ta(t),t}return e})),appState:pc(pc({},t),{},{currentItemFontSize:n}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,E.jsxs)("fieldset",{children:[(0,E.jsx)("legend",{children:S("labels.fontSize")}),(0,E.jsx)(ec,{group:"font-size",options:[{value:16,text:S("labels.small"),icon:(0,E.jsx)(hs,{theme:n.theme})},{value:20,text:S("labels.medium"),icon:(0,E.jsx)(gs,{theme:n.theme})},{value:28,text:S("labels.large"),icon:(0,E.jsx)(ms,{theme:n.theme})},{value:36,text:S("labels.veryLarge"),icon:(0,E.jsx)(vs,{theme:n.theme})}],value:hc(t,n,(function(e){return Te(e)&&e.fontSize}),n.currentItemFontSize||c.n5),onChange:function(e){return r(e)}})]})}}),Cs({name:"changeFontFamily",perform:function(e,t,n){return{elements:fc(e,t,(function(e){if(Te(e)){var t=Yr(e,{fontFamily:n});return Ta(t),t}return e})),appState:pc(pc({},t),{},{currentItemFontFamily:n}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData,o=[{value:c.ut.Virgil,text:S("labels.handDrawn"),icon:(0,E.jsx)(bs,{theme:n.theme})},{value:c.ut.Helvetica,text:S("labels.normal"),icon:(0,E.jsx)(ys,{theme:n.theme})},{value:c.ut.Cascadia,text:S("labels.code"),icon:(0,E.jsx)(xs,{theme:n.theme})}];return(0,E.jsxs)("fieldset",{children:[(0,E.jsx)("legend",{children:S("labels.fontFamily")}),(0,E.jsx)(ec,{group:"font-family",options:o,value:hc(t,n,(function(e){return Te(e)&&e.fontFamily}),n.currentItemFontFamily||c.rk),onChange:function(e){return r(e)}})]})}}),Cs({name:"changeTextAlign",perform:function(e,t,n){return{elements:fc(e,t,(function(e){if(Te(e)){var t=Yr(e,{textAlign:n});return Ta(t),t}return e})),appState:pc(pc({},t),{},{currentItemTextAlign:n}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,E.jsxs)("fieldset",{children:[(0,E.jsx)("legend",{children:S("labels.textAlign")}),(0,E.jsx)(ec,{group:"text-align",options:[{value:"left",text:S("labels.left"),icon:(0,E.jsx)(ws,{theme:n.theme})},{value:"center",text:S("labels.center"),icon:(0,E.jsx)(ks,{theme:n.theme})},{value:"right",text:S("labels.right"),icon:(0,E.jsx)(Ss,{theme:n.theme})}],value:hc(t,n,(function(e){return Te(e)&&e.textAlign}),n.currentItemTextAlign),onChange:function(e){return r(e)}})]})}}),Cs({name:"changeSharpness",perform:function(e,t,n){var r=Ka(Ha(e),t),o=r.length?r.every((function(e){return!De(e)})):!ze(t.elementType),i=r.length?r.every(De):ze(t.elementType);return{elements:fc(e,t,(function(e){return Yr(e,{strokeSharpness:n})})),appState:pc(pc({},t),{},{currentItemStrokeSharpness:o?n:t.currentItemStrokeSharpness,currentItemLinearStrokeSharpness:i?n:t.currentItemLinearStrokeSharpness}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,E.jsxs)("fieldset",{children:[(0,E.jsx)("legend",{children:S("labels.edges")}),(0,E.jsx)(ec,{group:"edges",options:[{value:"sharp",text:S("labels.sharp"),icon:(0,E.jsx)(ls,{theme:n.theme})},{value:"round",text:S("labels.round"),icon:(0,E.jsx)(ss,{theme:n.theme})}],value:hc(t,n,(function(e){return e.strokeSharpness}),Ja(n.elementType)&&(ze(n.elementType)?n.currentItemLinearStrokeSharpness:n.currentItemStrokeSharpness)||null),onChange:function(e){return r(e)}})]})}}),Cs({name:"changeArrowhead",perform:function(e,t,n){var r;return{elements:fc(e,t,(function(e){if(De(e)){var t=n.position,r=n.type;if("start"===t)return Yr(e,{startArrowhead:r});if("end"===t)return Yr(e,{endArrowhead:r})}return e})),appState:pc(pc({},t),{},(r={},r["start"===n.position?"currentItemStartArrowhead":"currentItemEndArrowhead"]=n.type,r)),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData,o=w().rtl;return(0,E.jsxs)("fieldset",{children:[(0,E.jsx)("legend",{children:S("labels.arrowheads")}),(0,E.jsxs)("div",{className:"iconSelectList",children:[(0,E.jsx)(uc,{label:"arrowhead_start",options:[{value:null,text:S("labels.arrowhead_none"),icon:(0,E.jsx)(cs,{theme:n.theme}),keyBinding:"q"},{value:"arrow",text:S("labels.arrowhead_arrow"),icon:(0,E.jsx)(us,{theme:n.theme,flip:!o}),keyBinding:"w"},{value:"bar",text:S("labels.arrowhead_bar"),icon:(0,E.jsx)(ps,{theme:n.theme,flip:!o}),keyBinding:"e"},{value:"dot",text:S("labels.arrowhead_dot"),icon:(0,E.jsx)(ds,{theme:n.theme,flip:!o}),keyBinding:"r"},{value:"triangle",text:S("labels.arrowhead_triangle"),icon:(0,E.jsx)(fs,{theme:n.theme,flip:!o}),keyBinding:"t"}],value:hc(t,n,(function(e){return De(e)&&tl(e.type)?e.startArrowhead:n.currentItemStartArrowhead}),n.currentItemStartArrowhead),onChange:function(e){return r({position:"start",type:e})}}),(0,E.jsx)(uc,{label:"arrowhead_end",group:"arrowheads",options:[{value:null,text:S("labels.arrowhead_none"),keyBinding:"q",icon:(0,E.jsx)(cs,{theme:n.theme})},{value:"arrow",text:S("labels.arrowhead_arrow"),keyBinding:"w",icon:(0,E.jsx)(us,{theme:n.theme,flip:o})},{value:"bar",text:S("labels.arrowhead_bar"),keyBinding:"e",icon:(0,E.jsx)(ps,{theme:n.theme,flip:o})},{value:"dot",text:S("labels.arrowhead_dot"),keyBinding:"r",icon:(0,E.jsx)(ds,{theme:n.theme,flip:o})},{value:"triangle",text:S("labels.arrowhead_triangle"),icon:(0,E.jsx)(fs,{theme:n.theme,flip:o}),keyBinding:"t"}],value:hc(t,n,(function(e){return De(e)&&tl(e.type)?e.endArrowhead:n.currentItemEndArrowhead}),n.currentItemEndArrowhead),onChange:function(e){return r({position:"end",type:e})}})]})]})}}),function(e){var t=e.title||("dark"===e.value?S("buttons.lightMode"):S("buttons.darkMode"));return(0,E.jsx)(ul,{type:"icon",icon:e.value===c.C6.LIGHT?mc.MOON:mc.SUN,title:t,"aria-label":t,onClick:function(){return e.onChange(e.value===c.C6.DARK?c.C6.LIGHT:c.C6.DARK)},"data-testid":"toggle-dark-mode"})}),mc={SUN:(0,E.jsx)("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:(0,E.jsx)("path",{fill:"currentColor",d:"M256 160c-52.9 0-96 43.1-96 96s43.1 96 96 96 96-43.1 96-96-43.1-96-96-96zm246.4 80.5l-94.7-47.3 33.5-100.4c4.5-13.6-8.4-26.5-21.9-21.9l-100.4 33.5-47.4-94.8c-6.4-12.8-24.6-12.8-31 0l-47.3 94.7L92.7 70.8c-13.6-4.5-26.5 8.4-21.9 21.9l33.5 100.4-94.7 47.4c-12.8 6.4-12.8 24.6 0 31l94.7 47.3-33.5 100.5c-4.5 13.6 8.4 26.5 21.9 21.9l100.4-33.5 47.3 94.7c6.4 12.8 24.6 12.8 31 0l47.3-94.7 100.4 33.5c13.6 4.5 26.5-8.4 21.9-21.9l-33.5-100.4 94.7-47.3c13-6.5 13-24.7.2-31.1zm-155.9 106c-49.9 49.9-131.1 49.9-181 0-49.9-49.9-49.9-131.1 0-181 49.9-49.9 131.1-49.9 181 0 49.9 49.9 49.9 131.1 0 181z"})}),MOON:(0,E.jsx)("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:(0,E.jsx)("path",{fill:"currentColor",d:"M283.211 512c78.962 0 151.079-35.925 198.857-94.792 7.068-8.708-.639-21.43-11.562-19.35-124.203 23.654-238.262-71.576-238.262-196.954 0-72.222 38.662-138.635 101.498-174.394 9.686-5.512 7.25-20.197-3.756-22.23A258.156 258.156 0 0 0 283.211 0c-141.309 0-256 114.511-256 256 0 141.309 114.511 256 256 256z"})})},vc=(n(6781),function(){var e=document.querySelector(".excalidraw-tooltip");if(e)return e;var t=document.createElement("div");return document.body.appendChild(t),t.classList.add("excalidraw-tooltip"),t}),bc=function(e){var t=e.children,n=e.label,r=e.long,o=void 0!==r&&r,i=e.style;return(0,l.useEffect)((function(){return function(){return vc().classList.remove("excalidraw-tooltip--visible")}}),[]),(0,E.jsx)("div",{className:"excalidraw-tooltip-wrapper",onPointerEnter:function(e){return function(e,t,n,r){t.classList.add("excalidraw-tooltip--visible"),t.style.minWidth=r?"50ch":"10ch",t.style.maxWidth=r?"50ch":"15ch",t.textContent=n;var o=e.getBoundingClientRect(),i=o.x,a=o.bottom,l=o.top,s=o.width,c=t.getBoundingClientRect(),u=c.width,d=c.height,p=window.innerWidth,f=i+s/2-u/2,h=f+u>=p?f+u-p:0,g=a+5,m=g+d>=window.innerHeight?a-l+d+10:0;Object.assign(t.style,{top:"".concat(g-m,"px"),left:"".concat(f-h,"px")})}(e.currentTarget,vc(),n,o)},onPointerLeave:function(){return vc().classList.remove("excalidraw-tooltip--visible")},style:i,children:t})};n(196),n(1106);function yc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yc(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var wc=s().forwardRef((function(e,t){var n=e.children,r=e.padding,o=e.className,i=e.style;return(0,E.jsx)("div",{className:Oe("Island",o),style:xc({"--padding":r},i),ref:t,children:n})})),kc=(n(8328),function(e){var t=e.theme,n=void 0===t?c.C6.LIGHT:t,r=e.closeOnClickOutside,o=void 0===r||r,i=Sc(n);if(!i)return null;return(0,ft.createPortal)((0,E.jsxs)("div",{className:Oe("Modal",e.className),role:"dialog","aria-modal":"true",onKeyDown:function(t){t.key===Kt&&(t.nativeEvent.stopImmediatePropagation(),t.stopPropagation(),e.onCloseRequest())},"aria-labelledby":e.labelledBy,children:[(0,E.jsx)("div",{className:"Modal__background",onClick:o?e.onCloseRequest:void 0}),(0,E.jsx)("div",{className:"Modal__content",style:{"--max-width":"".concat(e.maxWidth,"px")},tabIndex:0,children:e.children})]}),i)}),Sc=function(e){var t=(0,l.useState)(null),n=t[0],r=t[1],o=Yh(),i=(0,l.useRef)(o);i.current=o;var a=Xh().container;return(0,l.useLayoutEffect)((function(){n&&n.classList.toggle("excalidraw--mobile",o)}),[n,o]),(0,l.useLayoutEffect)((function(){var t=!(null==a||!a.classList.contains("theme--dark"))||"dark"===e,n=document.createElement("div");return n.classList.add("excalidraw","excalidraw-modal-container"),n.classList.toggle("excalidraw--mobile",i.current),t&&(n.classList.add("theme--dark"),n.classList.add("theme--dark-background-none")),document.body.appendChild(n),r(n),function(){document.body.removeChild(n)}}),[a,e]),n},Ec=function(e){var t=function(){var e=(0,l.useState)(null),t=e[0],n=e[1];return[t,(0,l.useCallback)((function(e){return n(e)}),[])]}(),n=t[0],r=t[1],o=(0,l.useState)(document.activeElement)[0],i=Xh().id;(0,l.useEffect)((function(){if(n){var t=a(n);t.length>0&&!1!==e.autofocus&&(t[1]||t[0]).focus();var r=function(e){if(e.key===qt){var t=a(n),r=document.activeElement,o=t.findIndex((function(e){return e===r}));0===o&&e.shiftKey?(t[t.length-1].focus(),e.preventDefault()):o!==t.length-1||e.shiftKey||(t[0].focus(),e.preventDefault())}};return n.addEventListener("keydown",r),function(){return n.removeEventListener("keydown",r)}}}),[n,e.autofocus]);var a=function(e){var t=e.querySelectorAll("button, a, input, select, textarea, div[tabindex]");return t?Array.from(t):[]},s=function(){o.focus(),e.onCloseRequest()};return(0,E.jsx)(kc,{className:Oe("Dialog",e.className),labelledBy:"dialog-title",maxWidth:e.small?550:800,onCloseRequest:s,theme:e.theme,closeOnClickOutside:e.closeOnClickOutside,children:(0,E.jsxs)(wc,{ref:r,children:[(0,E.jsxs)("h2",{id:"".concat(i,"-dialog-title"),className:"Dialog__title",children:[(0,E.jsx)("span",{className:"Dialog__titleContent",children:e.title}),(0,E.jsx)("button",{className:"Modal__close",onClick:s,"aria-label":S("buttons.close"),children:Yh()?Kl:Wl})]}),(0,E.jsx)("div",{className:"Dialog__content",children:e.children})]})})},jc=(n(4678),["onConfirm","onCancel","children","confirmText","cancelText","className"]);function _c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Cc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_c(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Oc=function(e){var t=e.onConfirm,n=e.onCancel,r=e.children,o=e.confirmText,i=void 0===o?S("buttons.confirm"):o,a=e.cancelText,l=void 0===a?S("buttons.cancel"):a,s=e.className,c=void 0===s?"":s,u=Jr(e,jc);return(0,E.jsxs)(Ec,Cc(Cc({onCloseRequest:n,small:!0},u),{},{className:"confirm-dialog ".concat(c),children:[r,(0,E.jsxs)("div",{className:"confirm-dialog-buttons",children:[(0,E.jsx)(ul,{type:"button",title:l,"aria-label":l,label:l,onClick:n,className:"confirm-dialog--cancel"}),(0,E.jsx)(ul,{type:"button",title:i,"aria-label":i,label:i,onClick:t,className:"confirm-dialog--confirm"})]})]}))};const Ic=function(e){var t=e.onConfirm,n=(0,l.useState)(!1),r=n[0],o=n[1],i=function(){o(!r)};return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(ul,{type:"button",icon:wl,title:S("buttons.clearReset"),"aria-label":S("buttons.clearReset"),showAriaLabel:Yh(),onClick:i,"data-testid":"clear-canvas-button"}),r&&(0,E.jsx)(Oc,{onConfirm:function(){t(),i()},onCancel:i,title:S("clearCanvasDialog.title"),children:(0,E.jsxs)("p",{className:"clear-canvas__content",children:[" ",S("alerts.clearReset")]})})]})};function Mc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mc(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Cs({name:"changeViewBackgroundColor",perform:function(e,t,n){return{appState:Pc(Pc({},t),n),commitToHistory:!!n.viewBackgroundColor}},PanelComponent:function(e){var t=e.appState,n=e.updateData;return(0,E.jsx)("div",{style:{position:"relative"},children:(0,E.jsx)(ac,{label:S("labels.canvasBackground"),type:"canvasBackground",color:t.viewBackgroundColor,onChange:function(e){return n({viewBackgroundColor:e})},isActive:"canvasColorPicker"===t.openPopup,setActive:function(e){return n({openPopup:e?"canvasColorPicker":null})},"data-testid":"canvas-background-picker"})})}}),Cs({name:"clearCanvas",perform:function(e,t,n,r){return r.imageCache.clear(),{elements:e.map((function(e){return Yr(e,{isDeleted:!0})})),appState:Pc(Pc({},Un()),{},{files:{},theme:t.theme,elementLocked:t.elementLocked,exportBackground:t.exportBackground,exportEmbedScene:t.exportEmbedScene,gridSize:t.gridSize,showStats:t.showStats,pasteDialog:t.pasteDialog}),commitToHistory:!0}},PanelComponent:function(e){var t=e.updateData;return(0,E.jsx)(Ic,{onConfirm:t})}}),Cs({name:"zoomIn",perform:function(e,t){var n=rl(ol(t.zoom.value+c.V4),t.zoom,{left:t.offsetLeft,top:t.offsetTop},{x:t.width/2,y:t.height/2});return{appState:Pc(Pc({},t),{},{zoom:n}),commitToHistory:!1}},PanelComponent:function(e){var t=e.updateData;return(0,E.jsx)(ul,{type:"button",icon:jl,title:"".concat(S("buttons.zoomIn")," — ").concat(In("CtrlOrCmd++")),"aria-label":S("buttons.zoomIn"),onClick:function(){t(null)},size:"small"})},keyTest:function(e){return(e.code===mt||e.code===bt)&&(e[Vt]||e.shiftKey)}}),Cs({name:"zoomOut",perform:function(e,t){var n=rl(ol(t.zoom.value-c.V4),t.zoom,{left:t.offsetLeft,top:t.offsetTop},{x:t.width/2,y:t.height/2});return{appState:Pc(Pc({},t),{},{zoom:n}),commitToHistory:!1}},PanelComponent:function(e){var t=e.updateData;return(0,E.jsx)(ul,{type:"button",icon:_l,title:"".concat(S("buttons.zoomOut")," — ").concat(In("CtrlOrCmd+-")),"aria-label":S("buttons.zoomOut"),onClick:function(){t(null)},size:"small"})},keyTest:function(e){return(e.code===vt||e.code===yt)&&(e[Vt]||e.shiftKey)}}),Cs({name:"resetZoom",perform:function(e,t){return{appState:Pc(Pc({},t),{},{zoom:rl(1,t.zoom,{left:t.offsetLeft,top:t.offsetTop},{x:t.width/2,y:t.height/2})}),commitToHistory:!1}},PanelComponent:function(e){var t=e.updateData,n=e.appState;return(0,E.jsx)(bc,{label:S("buttons.resetZoom"),style:{height:"100%"},children:(0,E.jsxs)(ul,{type:"button",className:"reset-zoom-button",title:S("buttons.resetZoom"),"aria-label":S("buttons.resetZoom"),onClick:function(){t(null)},size:"small",children:[(100*n.zoom.value).toFixed(0),"%"]})})},keyTest:function(e){return(e.code===_t||e.code===xt)&&(e[Vt]||e.shiftKey)}});var Tc=function(e,t,n){var r=Ha(e),o=Wa(r,t),i=n&&o.length>0?it(o):it(r),a=function(e,t){var n=e[0],r=e[1],o=e[2],i=e[3],a=o-n,l=t.width/a,s=i-r,u=t.height/s,d=Math.min(l,u),p=Math.floor(d/c.V4)*c.V4;return Math.min(Math.max(p,c.V4),1)}(i,{width:t.width,height:t.height}),l=rl(a,t.zoom,{left:t.offsetLeft,top:t.offsetTop}),s=i[0],u=i[1],d=(s+i[2])/2,p=(u+i[3])/2;return{appState:Pc(Pc(Pc({},t),Za({scenePoint:{x:d,y:p},viewportDimensions:{width:t.width,height:t.height},zoom:l})),{},{zoom:l}),commitToHistory:!1}};Cs({name:"zoomToSelection",perform:function(e,t){return Tc(e,t,!0)},keyTest:function(e){return e.code===Et&&e.shiftKey&&!e.altKey&&!e[Vt]}}),Cs({name:"zoomToFit",perform:function(e,t){return Tc(e,t,!1)},keyTest:function(e){return e.code===St&&e.shiftKey&&!e.altKey&&!e[Vt]}}),Cs({name:"toggleTheme",perform:function(e,t,n){return{appState:Pc(Pc({},t),{},{theme:n||(t.theme===c.C6.LIGHT?c.C6.DARK:c.C6.LIGHT)}),commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData;return(0,E.jsx)("div",{style:{marginInlineStart:"0.25rem"},children:(0,E.jsx)(gc,{value:t.theme,onChange:function(e){n(e)}})})},keyTest:function(e){return e.altKey&&e.shiftKey&&e.code===It}});function Lc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ac(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lc(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Dc,zc,Nc,Hc=Cs({name:"finalize",perform:function(e,t,n,r){var o,i,a=r.canvas,l=r.focusContainer;if(t.editingLinearElement){var s=t.editingLinearElement,c=s.elementId,u=s.startBindingElement,d=s.endBindingElement,p=Fi.getElement(c);if(p)return Ne(p)&&Wi(p,u,d),{elements:p.points.length<2||Xr(p)?e.filter((function(e){return e.id!==p.id})):void 0,appState:Ac(Ac({},t),{},{editingLinearElement:null}),commitToHistory:!0}}var f=e;t.pendingImageElement&&Zr(t.pendingImageElement,{isDeleted:!0},!1),window.document.activeElement instanceof HTMLElement&&l();var h=t.multiElement?t.multiElement:"freedraw"===(null===(i=t.editingElement)||void 0===i?void 0:i.type)?t.editingElement:null;if(h){if("freedraw"!==h.type&&"touch"!==t.lastPointerDownWith){var g=h.points,m=h.lastCommittedPoint;m&&g[g.length-1]===m||Zr(h,{points:h.points.slice(0,-1)})}Xr(h)&&(f=f.slice(0,-1));var v=Ge(h.points,t.zoom.value);if(("line"===h.type||"freedraw"===h.type)&&v){var b=h.points,y=b[0];Zr(h,{points:b.map((function(e,t){return t===b.length-1?[y[0],y[1]]:e}))})}if(Ne(h)&&!v&&h.points.length>1){var x=Fi.getPointAtIndexGlobalCoordinates(h,-1),w=x[0],k=x[1];qi(h,t,Fr.getScene(h),{x:w,y:k})}t.elementLocked||"freedraw"===t.elementType||(t.selectedElementIds[h.id]=!0)}return(t.elementLocked||"freedraw"===t.elementType)&&h||jn(a),{elements:f,appState:Ac(Ac({},t),{},{elementType:(t.elementLocked||"freedraw"===t.elementType)&&h?t.elementType:"selection",draggingElement:null,multiElement:null,editingElement:null,startBoundElement:null,suggestedBindings:[],selectedElementIds:h&&!t.elementLocked&&"freedraw"!==t.elementType?Ac(Ac({},t.selectedElementIds),{},(o={},o[h.id]=!0,o)):t.selectedElementIds,pendingImageElement:null}),commitToHistory:"freedraw"===t.elementType}},keyTest:function(e,t){return e.key===Kt&&(null!==t.editingLinearElement||!t.draggingElement&&null===t.multiElement)||(e.key===Kt||e.key===Wt)&&null!==t.multiElement},PanelComponent:function(e){var t=e.appState,n=e.updateData;return(0,E.jsx)(ul,{type:"button",icon:Cl,title:S("buttons.done"),"aria-label":S("buttons.done"),onClick:n,visible:null!=t.multiElement})}}),Rc="undefined"!=typeof process&&null!==(Dc={REACT_APP_BACKEND_V2_GET_URL:"https://json.excalidraw.com/api/v2/",REACT_APP_BACKEND_V2_POST_URL:"https://json.excalidraw.com/api/v2/post/",REACT_APP_LIBRARY_URL:"https://libraries.excalidraw.com",REACT_APP_LIBRARY_BACKEND:"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries",REACT_APP_SOCKET_SERVER_URL:"https://oss-collab-us1.excalidraw.com",REACT_APP_FIREBASE_CONFIG:'{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}',REACT_APP_GOOGLE_ANALYTICS_ID:"UA-387204-13"})&&void 0!==Dc&&Dc.REACT_APP_GOOGLE_ANALYTICS_ID&&"undefined"!=typeof window&&window.gtag?function(e,t,n,r){window.gtag("event",t,{event_category:e,event_label:n,value:r})}:("undefined"!=typeof process&&null!==(zc={REACT_APP_BACKEND_V2_GET_URL:"https://json.excalidraw.com/api/v2/",REACT_APP_BACKEND_V2_POST_URL:"https://json.excalidraw.com/api/v2/post/",REACT_APP_LIBRARY_URL:"https://libraries.excalidraw.com",REACT_APP_LIBRARY_BACKEND:"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries",REACT_APP_SOCKET_SERVER_URL:"https://oss-collab-us1.excalidraw.com",REACT_APP_FIREBASE_CONFIG:'{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}',REACT_APP_GOOGLE_ANALYTICS_ID:"UA-387204-13"})&&void 0!==zc&&zc.JEST_WORKER_ID,function(e,t,n,r){}),Bc=(n(518),n(9966),function(e){var t=Xh().id,n=(0,l.useState)(e.value),r=n[0],o=n[1];return(0,E.jsxs)("div",{className:"ProjectName",children:[(0,E.jsx)("label",{className:"ProjectName-label",htmlFor:"filename",children:"".concat(e.label).concat(e.isNameEditable?"":":")}),e.isNameEditable?(0,E.jsx)("input",{type:"text",className:"TextInput",onBlur:function(t){!function(e){for(var t=e.parentElement;t;){if(t.tabIndex>-1)return void t.focus();t=t.parentElement}}(t.target);var n=t.target.value;n!==e.value&&e.onChange(n)},onKeyDown:function(e){if("Enter"===e.key){if(e.preventDefault(),e.nativeEvent.isComposing||229===e.keyCode)return;e.currentTarget.blur()}},id:"".concat(t,"-filename"),value:r,onChange:function(e){return o(e.target.value)}}):(0,E.jsx)("span",{className:"TextInput TextInput--readonly",id:"".concat(t,"-filename"),children:e.value})]})}),Fc=function(e,t){if(null!=t&&t.collaborators){var n=t.collaborators.get(e);if(null!=n&&n.color)return n.color}var r=e.split("").reduce((function(e,t){return e+t.charCodeAt(0)}),0),o=pt.elementBackground.slice(1),i=pt.elementStroke.slice(1);return{background:o[r%o.length],stroke:i[r%i.length]}};!function(e){e.ACTIVE="active",e.AWAY="away",e.IDLE="idle"}(Nc||(Nc={}));var Uc=function(){var e=document.createElement("canvas").getContext("2d");if(!e)return!1;return e.fillStyle="#f00",e.textBaseline="top",e.font="32px Arial",e.fillText("😀",0,0),0!==e.getImageData(12,12,1,1).data[0]}(),Vc=function(e,t,n,r,o,i,a,l){var s=arguments.length>8&&void 0!==arguments[8]&&arguments[8];e.save(),e.translate(i,a),e.rotate(l),s&&e.fillRect(t-i,n-a,r,o),e.strokeRect(t-i,n-a,r,o),e.restore()},Gc=function(e,t,n,r){e.beginPath(),e.arc(t,n,r,0,2*Math.PI),e.fill(),e.stroke()},Wc=function(e,t,n,r,o,i,a){if(null===i)return{atLeastOneVisibleElement:!1};var l=a.renderScrollbars,s=void 0===l||l,u=a.renderSelection,d=void 0===u||u,p=a.renderGrid,f=void 0===p||p,h=a.isExporting,g=i.getContext("2d");g.setTransform(1,0,0,1,0,0),g.save(),g.scale(r,r);var m=i.width/r,v=i.height/r;(h&&"dark"===a.theme&&(g.filter=c.ZF),"string"==typeof a.viewBackgroundColor)?(("transparent"===a.viewBackgroundColor||5===a.viewBackgroundColor.length||9===a.viewBackgroundColor.length||/(hsla|rgba)\(/.test(a.viewBackgroundColor))&&g.clearRect(0,0,m,v),g.save(),g.fillStyle=a.viewBackgroundColor,g.fillRect(0,0,m,v),g.restore()):g.clearRect(0,0,m,v);var b=a.zoom.translation.x,y=a.zoom.translation.y;g.save(),g.translate(b,y),g.scale(a.zoom.value,a.zoom.value),f&&t.gridSize&&function(e,t,n,r,o,i){e.save(),e.strokeStyle="rgba(0,0,0,0.1)",e.beginPath();for(var a=n;a<n+o+2*t;a+=t)e.moveTo(a,r-t),e.lineTo(a,r+i+2*t);for(var l=r;l<r+i+2*t;l+=t)e.moveTo(n-t,l),e.lineTo(n+o+2*t,l);e.stroke(),e.restore()}(g,t.gridSize,-Math.ceil(b/a.zoom.value/t.gridSize)*t.gridSize+a.scrollX%t.gridSize,-Math.ceil(y/a.zoom.value/t.gridSize)*t.gridSize+a.scrollY%t.gridSize,m/a.zoom.value,v/a.zoom.value);var x,k=e.filter((function(e){return $c(e,m,v,{zoom:a.zoom,offsetLeft:t.offsetLeft,offsetTop:t.offsetTop,scrollX:a.scrollX,scrollY:a.scrollY})}));if(k.forEach((function(e){try{Pr(e,o,g,a)}catch(e){console.error(e)}})),t.editingLinearElement){var S=Fi.getElement(t.editingLinearElement.elementId);S&&function(e,t,n,r){e.save(),e.translate(n.scrollX,n.scrollY),e.lineWidth=1/n.zoom.value,Fi.getPointsGlobalCoordinates(r).forEach((function(r,o){var i;e.strokeStyle="red",e.setLineDash([]),e.fillStyle=(null===(i=t.editingLinearElement)||void 0===i?void 0:i.activePointIndex)===o?"rgba(255, 127, 127, 0.9)":"rgba(255, 255, 255, 0.9)";var a=Fi.POINT_HANDLE_SIZE;Gc(e,r[0],r[1],a/2/n.zoom.value)})),e.restore()}(g,t,a,S)}if(n)try{Pr(n,o,g,a)}catch(e){console.error(e)}if(Gi(t)&&t.suggestedBindings.filter((function(e){return null!=e})).forEach((function(e){Yc(g,a,e)})),d&&!t.multiElement&&!t.editingLinearElement){for(var E=e.reduce((function(e,n){var r=[];if(t.selectedElementIds[n.id]&&!oo(t,n)&&r.push(ct.black),a.remoteSelectedElementIds[n.id]&&r.push.apply(r,a.remoteSelectedElementIds[n.id].map((function(e){var n,r=null===(n=t.collaborators.get(e))||void 0===n?void 0:n.picture;return Fc(r||e,t).background}))),r.length){var o=Qe(n),i=o[0],l=o[1],s=o[2],c=o[3];e.push({angle:n.angle,elementX1:i,elementY1:l,elementX2:s,elementY2:c,selectionColors:r})}return e}),[]),j=function(t){var n=co(e,t),r=it(n),o=r[0],i=r[1],a=r[2],l=r[3];E.push({angle:0,elementX1:o,elementX2:a,elementY1:i,elementY2:l,selectionColors:[ct.black]})},_=0,C=ao(t);_<C.length;_++){j(C[_])}t.editingGroupId&&j(t.editingGroupId),E.forEach((function(e){return Zc(g,a,e)}));var O=Wa(e,t);if(g.save(),g.translate(a.scrollX,a.scrollY),1===O.length){g.fillStyle=ct.white;var I=Mo(O[0],a.zoom,"mouse");t.viewModeEnabled||Kc(g,a,I,O[0].angle)}else if(O.length>1&&!t.isRotating){var M=4/a.zoom.value;g.fillStyle=ct.white;var P=it(O),T=P[0],L=P[1],A=P[2],D=P[3],z=g.getLineDash();g.setLineDash([2/a.zoom.value]);var N=g.lineWidth;g.lineWidth=1/a.zoom.value,Vc(g,T-M,L-M,A-T+2*M,D-L+2*M,(T+A)/2,(L+D)/2,0),g.lineWidth=N,g.setLineDash(z);I=Io([T,L,A,D],0,a.zoom,"mouse",Eo);Kc(g,a,I,0)}g.restore()}for(var H in g.restore(),a.remotePointerViewportCoords){var R,B=a.remotePointerViewportCoords[H],F=B.x,U=B.y;F-=t.offsetLeft,U-=t.offsetTop;var V=F<0||F>m-9||U<0||U>v-14;F=Math.max(F,0),F=Math.min(F,m-9),U=Math.max(U,0),U=Math.min(U,v-14);var G=null===(R=t.collaborators.get(H))||void 0===R?void 0:R.picture,W=Fc(G||H,t),K=W.background,Z=W.stroke;g.save(),g.strokeStyle=Z,g.fillStyle=K;var Y=a.remotePointerUserStates[H];(V||Y===Nc.AWAY)&&(g.globalAlpha=.48),a.remotePointerButton&&"down"===a.remotePointerButton[H]&&(g.beginPath(),g.arc(F,U,15,0,2*Math.PI,!1),g.lineWidth=3,g.strokeStyle="#ffffff88",g.stroke(),g.closePath(),g.beginPath(),g.arc(F,U,15,0,2*Math.PI,!1),g.lineWidth=1,g.strokeStyle=Z,g.stroke(),g.closePath()),g.beginPath(),g.moveTo(F,U),g.lineTo(F+1,U+14),g.lineTo(F+4,U+9),g.lineTo(F+9,U+10),g.lineTo(F,U),g.fill(),g.stroke();var q=a.remotePointerUsernames[H],X="";Y===Nc.AWAY?X=Uc?"⚫️":" (".concat(Nc.AWAY,")"):Y===Nc.IDLE?X=Uc?"💤":" (".concat(Nc.IDLE,")"):Y===Nc.ACTIVE&&(X=Uc?"🟢":"");var $="".concat(q?"".concat(q," "):"").concat(X);if(!V&&$){var Q=F+9,J=U+14,ee=g.measureText($),te=ee.actualBoundingBoxDescent+ee.actualBoundingBoxAscent;g.fillStyle=Z,g.fillRect(Q-1,J-1,ee.width+8+2,te+8+2),g.fillStyle=K,g.fillRect(Q,J,ee.width+8,te+8),g.fillStyle=ct.white,g.fillText($,Q+4,J+4+ee.actualBoundingBoxAscent)}g.restore(),g.closePath()}return s&&(x=function(e,t,n,r){var o=r.scrollX,i=r.scrollY,a=r.zoom;if(0===e.length)return{horizontal:null,vertical:null};var l=it(e),s=l[0],c=l[1],u=l[2],d=l[3],p=t/a.value,f=n/a.value,h=t-p,g=n-f,m={top:parseInt(Tn("sat")),bottom:parseInt(Tn("sab")),left:parseInt(Tn("sal")),right:parseInt(Tn("sar"))},v=w().rtl,b=h/2-o+m.left,y=g/2-i+m.top,x=b+p-m.right,k=y+f-m.bottom,S=Math.min(s,b),E=Math.min(c,y),j=Math.max(u,x),_=Math.max(d,k);return{horizontal:b===S&&x===j?null:{x:Math.max(m.left,4)+(b-S)/(j-S)*t,y:n-6-Math.max(4,m.bottom),width:(x-b)/(j-S)*t-Math.max(8,m.left+m.right),height:6},vertical:y===E&&k===_?null:{x:v?Math.max(m.left,4):t-6-Math.max(m.right,4),y:(y-E)/(_-E)*n+Math.max(m.top,4),width:6,height:(k-y)/(_-E)*n-Math.max(8,m.top+m.bottom)}}}(e,m,v,a),g.save(),g.fillStyle="rgba(0,0,0,0.3)",g.strokeStyle="rgba(255,255,255,0.8)",[x.horizontal,x.vertical].forEach((function(e){e&&function(e,t,n,r,o,i){e.beginPath(),e.moveTo(t+i,n),e.lineTo(t+r-i,n),e.quadraticCurveTo(t+r,n,t+r,n+i),e.lineTo(t+r,n+o-i),e.quadraticCurveTo(t+r,n+o,t+r-i,n+o),e.lineTo(t+i,n+o),e.quadraticCurveTo(t,n+o,t,n+o-i),e.lineTo(t,n+i),e.quadraticCurveTo(t,n,t+i,n),e.closePath(),e.fill(),e.stroke()}(g,e.x,e.y,e.width,e.height,3)})),g.restore()),g.restore(),{atLeastOneVisibleElement:k.length>0,scrollBars:x}},Kc=function(e,t,n,r){Object.keys(n).forEach((function(o){var i=n[o];void 0!==i&&(e.save(),e.lineWidth=1/t.zoom.value,"rotation"===o?Gc(e,i[0]+i[2]/2,i[1]+i[3]/2,i[2]/2):Vc(e,i[0],i[1],i[2],i[3],i[0]+i[2]/2,i[1]+i[3]/2,r,!0),e.restore())}))},Zc=function(e,t,n){var r=n.angle,o=n.elementX1,i=n.elementY1,a=n.elementX2,l=n.elementY2,s=n.selectionColors,c=a-o,u=l-i,d=4/t.zoom.value,p=8/t.zoom.value,f=4/t.zoom.value;e.save(),e.translate(t.scrollX,t.scrollY),e.lineWidth=1/t.zoom.value;for(var h=s.length,g=0;g<h;++g)e.strokeStyle=s[g],e.setLineDash([p,f+(p+f)*(h-1)]),e.lineDashOffset=(p+f)*g,Vc(e,o-d,i-d,c+2*d,u+2*d,o+c/2,i+u/2,r);e.restore()},Yc=function(e,t,n){var r=Array.isArray(n)?Xc:qc;e.save(),e.translate(t.scrollX,t.scrollY),r(e,n),e.restore()},qc=function(e,t){var n=Qe(t),r=n[0],o=n[1],i=n[2]-r,a=n[3]-o,l=ii(t,i,a);e.strokeStyle="rgba(0,0,0,.05)",e.lineWidth=l-4;var s=2+l/2;switch(t.type){case"rectangle":case"text":Vc(e,r-s,o-s,i+2*s,a+2*s,r+i/2,o+a/2,t.angle);break;case"diamond":var c=Math.hypot(i,a);!function(e,t,n,r,o,i){e.save(),e.translate(r,o),e.rotate(i),e.beginPath(),e.moveTo(0,n/2),e.lineTo(t/2,0),e.lineTo(0,-n/2),e.lineTo(-t/2,0),e.closePath(),e.stroke(),e.restore()}(e,i+2*(s*c/a),a+2*(s*c/i),r+i/2,o+a/2,t.angle);break;case"ellipse":!function(e,t,n,r,o,i){e.beginPath(),e.ellipse(r,o,t/2,n/2,i,0,2*Math.PI),e.stroke()}(e,i+2*s,a+2*s,r+i/2,o+a/2,t.angle)}},Xc=function(e,t){var n=t[0],r=t[1],o=t[2],i=ii(o,o.width,o.height);e.strokeStyle="rgba(0,0,0,0)",e.fillStyle="rgba(0,0,0,.05)",("both"===r?[0,-1]:"start"===r?[0]:[-1]).forEach((function(t){var r=Fi.getPointAtIndexGlobalCoordinates(n,t),o=r[0],a=r[1];Gc(e,o,a,i)}))},$c=function(e,t,n,r){var o=ot(e),i=o[0],a=o[1],l=o[2],s=o[3],c=Mn({clientX:r.offsetLeft,clientY:r.offsetTop},r),u=Mn({clientX:r.offsetLeft+t,clientY:r.offsetTop+n},r);return c.x<=l&&c.y<=s&&u.x>=i&&u.y>=a};const Qc=(()=>{if("undefined"==typeof self)return!1;if("top"in self&&self!==top)try{top.location}catch{return!1}else if("showOpenFilePicker"in self)return"showOpenFilePicker";return!1})(),Jc=Qc?n.e(736).then(n.bind(n,6327)):n.e(736).then(n.bind(n,2343));Qc?n.e(736).then(n.bind(n,9655)):n.e(736).then(n.bind(n,3610));const eu=Qc?n.e(736).then(n.bind(n,5791)):n.e(736).then(n.bind(n,2138));var tu=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},nu=function(e){var t,n,r,o=null===(t=e.extensions)||void 0===t?void 0:t.reduce((function(e,t){return e.push(c.LO[t]),e}),[]),i=null===(n=e.extensions)||void 0===n?void 0:n.reduce((function(e,t){return"jpg"===t?e.concat(".jpg",".jpeg"):e.concat(".".concat(t))}),[]);return async function(...e){return(await Jc).default(...e)}({description:e.description,extensions:i,mimeTypes:o,multiple:null!==(r=e.multiple)&&void 0!==r&&r,legacySetup:function(t,n,r){var o=Sn(n,500),i=function(){a(),document.addEventListener(c.Ks.KEYUP,o),document.addEventListener(c.Ks.POINTER_UP,o),o()},a=function(){var n;if(null!==(n=r.files)&&void 0!==n&&n.length){var o=e.multiple?tu([],r.files,!0):r.files[0];t(o)}};requestAnimationFrame((function(){window.addEventListener(c.Ks.FOCUS,i)}));var l=window.setInterval((function(){a()}),500);return function(e){clearInterval(l),o.cancel(),window.removeEventListener(c.Ks.FOCUS,i),document.removeEventListener(c.Ks.KEYUP,o),document.removeEventListener(c.Ks.POINTER_UP,o),e&&(console.warn("Opening the file was canceled (legacy-fs)."),e(new ll))}}})},ru=function(e,t){return async function(...e){return(await eu).default(...e)}(e,{fileName:"".concat(t.name,".").concat(t.extension),description:t.description,extensions:[".".concat(t.extension)]},t.fileHandle)};function ou(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function iu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ou(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ou(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var au={selection:!0,text:!0,rectangle:!0,diamond:!0,ellipse:!0,line:!0,image:!0,arrow:!0,freedraw:!0},lu=function(e,t){var n,r,o,i,a,l,s,c,u,d,p,f,h,g={type:t.type||e.type,version:e.version||1,versionNonce:null!==(n=e.versionNonce)&&void 0!==n?n:0,isDeleted:null!==(r=e.isDeleted)&&void 0!==r&&r,id:e.id||Gr(),fillStyle:e.fillStyle||"hachure",strokeWidth:e.strokeWidth||1,strokeStyle:null!==(o=e.strokeStyle)&&void 0!==o?o:"solid",roughness:null!==(i=e.roughness)&&void 0!==i?i:1,opacity:null==e.opacity?100:e.opacity,angle:e.angle||0,x:null!==(a=null!==(l=t.x)&&void 0!==l?l:e.x)&&void 0!==a?a:0,y:null!==(s=null!==(c=t.y)&&void 0!==c?c:e.y)&&void 0!==s?s:0,strokeColor:e.strokeColor,backgroundColor:e.backgroundColor,width:e.width||0,height:e.height||0,seed:null!==(u=e.seed)&&void 0!==u?u:1,groupIds:null!==(d=e.groupIds)&&void 0!==d?d:[],strokeSharpness:null!==(p=e.strokeSharpness)&&void 0!==p?p:ze(e.type)?"round":"sharp",boundElementIds:null!==(f=e.boundElementIds)&&void 0!==f?f:[],updated:null!==(h=e.updated)&&void 0!==h?h:Rn()};return iu(iu(iu({},g),Qr(g)),t)},su=function(e){var t,n,r;switch(e.type){case"text":var o=e.fontSize,i=e.fontFamily;if("font"in e){var a=e.font.split(" "),l=a[0],s=a[1];o=parseInt(l,10),r=s,i=Object.keys(c.ut).includes(r)?c.ut[r]:c.rk}return lu(e,{fontSize:o,fontFamily:i,text:null!==(n=e.text)&&void 0!==n?n:"",baseline:e.baseline,textAlign:e.textAlign||c.Hg,verticalAlign:e.verticalAlign||c.hs});case"freedraw":return lu(e,{points:e.points,lastCommittedPoint:null,simulatePressure:e.simulatePressure,pressures:e.pressures});case"image":return lu(e,{status:e.status||"pending",fileId:e.fileId,scale:e.scale||[1,1]});case"line":case"draw":case"arrow":var u=e.startArrowhead,d=void 0===u?null:u,p=e.endArrowhead,f=void 0===p?"arrow"===e.type?"arrow":null:p,h=e.x,g=e.y,m=!Array.isArray(e.points)||e.points.length<2?[[0,0],[e.width,e.height]]:e.points;return 0===m[0][0]&&0===m[0][1]||(m=(t=Fi.getNormalizedPoints(e)).points,h=t.x,g=t.y),lu(e,{type:"draw"===e.type?"line":e.type,startBinding:e.startBinding,endBinding:e.endBinding,lastCommittedPoint:null,startArrowhead:d,endArrowhead:f,points:m,x:h,y:g});case"ellipse":case"rectangle":case"diamond":return lu(e,{})}},cu=function(e,t){var n=t?Bn(t):null;return(e||[]).reduce((function(e,t){if("selection"!==t.type&&!Xr(t)){var r=su(t);if(r){var o=null==n?void 0:n.get(t.id);o&&o.version>r.version&&(r=qr(r,o.version)),e.push(r)}}return e}),[])},uu=function(e,t){e=e||{};for(var n=Un(),r={},o=0,i=Object.entries(n);o<i.length;o++){var a=i[o],l=a[0],s=a[1],c=e[l],u=t?t[l]:void 0;r[l]=void 0!==c?c:void 0!==u?u:s}return iu(iu({},r),{},{elementType:au[r.elementType]?r.elementType:"selection",zoom:"number"==typeof e.zoom?{value:e.zoom,translation:n.zoom.translation}:e.zoom||n.zoom})},du=function(e,t,n){return{elements:cu(null==e?void 0:e.elements,n),appState:uu(null==e?void 0:e.appState,t||null),files:(null==e?void 0:e.files)||{}}},pu=function(e,t){for(var n=[],r=0,o=e;r<o.length;r++){var i=o[r];if(Array.isArray(i))n.push({status:t,elements:i,id:Gr(),created:Date.now()});else{var a=i;n.push(iu(iu({},a),{},{id:a.id||Gr(),status:a.status||t,created:a.created||Date.now()}))}}return n},fu=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}};function hu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hu(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var mu=function(){var e=(0,d.Z)((function(e){var t;return fu(this,(function(r){switch(r.label){case 0:if(e.type!==c.LO.png)return[3,6];r.label=1;case 1:return r.trys.push([1,4,,5]),[4,Promise.all([n.e(736),n.e(9)]).then(n.bind(n,673))];case 2:return[4,r.sent().decodePngMetadata(e)];case 3:return[2,r.sent()];case 4:throw"INVALID"===r.sent().message?new DOMException(S("alerts.imageDoesNotContainScene"),"EncodingError"):new DOMException(S("alerts.cannotRestoreFromImage"),"EncodingError");case 5:return[3,15];case 6:return"text"in Blob?[4,e.text()]:[3,8];case 7:return t=r.sent(),[3,10];case 8:return[4,new Promise((function(t){var n=new FileReader;n.readAsText(e,"utf8"),n.onloadend=function(){n.readyState===FileReader.DONE&&t(n.result)}}))];case 9:t=r.sent(),r.label=10;case 10:if(e.type!==c.LO.svg)return[3,15];r.label=11;case 11:return r.trys.push([11,14,,15]),[4,Promise.all([n.e(736),n.e(9)]).then(n.bind(n,673))];case 12:return[4,r.sent().decodeSvgMetadata({svg:t})];case 13:return[2,r.sent()];case 14:throw"INVALID"===r.sent().message?new DOMException(S("alerts.imageDoesNotContainScene"),"EncodingError"):new DOMException(S("alerts.cannotRestoreFromImage"),"EncodingError");case 15:return[2,t]}}))}));return function(t){return e.apply(this,arguments)}}(),vu=function(e){var t;return e&&(null===(t=e.name.match(/\.(json|excalidraw|png|svg)$/))||void 0===t?void 0:t[1])||null},bu=function(e){var t=vu(e);return"png"===t||"svg"===t},yu=function(e){var t=(e||{}).type;return!!t&&c.jo.includes(t)},xu=function(){var e=(0,d.Z)((function(e,t,n){var r,o;return fu(this,(function(i){switch(i.label){case 0:return[4,mu(e)];case 1:r=i.sent();try{if(o=JSON.parse(r),!Tu(o))throw new Error(S("alerts.couldNotLoadInvalidFile"));return[2,du({elements:Ua(o.elements||[]),appState:gu(gu({theme:null==t?void 0:t.theme,fileHandle:e.handle||null},Kn(o.appState||{})),t?Ya(o.elements||[],t):{}),files:o.files},t,n)]}catch(e){throw console.error(e.message),new Error(S("alerts.couldNotLoadInvalidFile"))}return[2]}}))}));return function(t,n,r){return e.apply(this,arguments)}}(),wu=function(){var e=(0,d.Z)((function(e){var t,n;return fu(this,(function(r){switch(r.label){case 0:return[4,mu(e)];case 1:if(t=r.sent(),(n=JSON.parse(t)).type!==c.r8.excalidrawLibrary)throw new Error(S("alerts.couldNotLoadInvalidFile"));return[2,n]}}))}));return function(t){return e.apply(this,arguments)}}(),ku=function(){var e=(0,d.Z)((function(e){return fu(this,(function(t){return[2,new Promise((function(t,n){try{e.toBlob((function(e){if(!e)return n(new al(S("canvasError.canvasTooBig"),"CANVAS_POSSIBLY_TOO_BIG"));t(e)}))}catch(e){n(e)}}))]}))}));return function(t){return e.apply(this,arguments)}}(),Su=function(){var e=(0,d.Z)((function(e){var t,n,r,o,i;return fu(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),r=(n=window.crypto.subtle).digest,o=["SHA-1"],[4,e.arrayBuffer()];case 1:return[4,r.apply(n,o.concat([a.sent()]))];case 2:return t=a.sent(),[2,(l=new Uint8Array(t),Array.from(l).map((function(e){return"0".concat(e.toString(16)).slice(-2)})).join(""))];case 3:return i=a.sent(),console.error(i),[2,Ie(40)];case 4:return[2]}var l}))}));return function(t){return e.apply(this,arguments)}}(),Eu=function(){var e=(0,d.Z)((function(e){return fu(this,(function(t){return[2,new Promise((function(t,n){var r=new FileReader;r.onload=function(){var e=r.result;t(e)},r.onerror=function(e){return n(e)},r.readAsDataURL(e)}))]}))}));return function(t){return e.apply(this,arguments)}}(),ju=function(){var e=(0,d.Z)((function(e,t){var r,o,i,a,l,s;return fu(this,(function(u){switch(u.label){case 0:return e.type===c.LO.svg?[2,e]:[4,Promise.all([n.e(736).then(n.t.bind(n,4881,23)).then((function(e){return e.default})),n.e(736).then(n.bind(n,100)).then((function(e){return e.default}))])];case 1:if(r=u.sent(),o=r[0],i=r[1],a=i({pica:o({features:["js","wasm"]})}),t.outputType&&(l=t.outputType,a._create_blob=function(e){return this.pica.toBlob(e.out_canvas,l,.8).then((function(t){return e.out_blob=t,e}))}),!yu(e))throw new Error(S("errors.unsupportedFileType"));return s=File.bind,[4,a.toBlob(e,{max:t.maxWidthOrHeight})];case 2:return[2,new(s.apply(File,[void 0,[u.sent()],e.name,{type:t.outputType||e.type}]))]}}))}));return function(t,n){return e.apply(this,arguments)}}(),_u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return new File([(new TextEncoder).encode(e)],t,{type:c.LO.svg})},Cu=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}},Ou=function(e,t){for(var n={},r=0,o=e;r<o.length;r++){var i=o[r];!i.isDeleted&&"fileId"in i&&i.fileId&&t[i.fileId]&&(n[i.fileId]=t[i.fileId])}return n},Iu=function(e,t,n,r){var o={type:c.r8.excalidraw,version:c.Kr.excalidraw,source:c.pb,elements:"local"===r?Ua(e):Fa(e),appState:"local"===r?Kn(t):Zn(t),files:"local"===r?Ou(e,n):void 0};return JSON.stringify(o,null,2)},Mu=function(){var e=(0,d.Z)((function(e,t,n){var r,o;return Cu(this,(function(i){switch(i.label){case 0:return r=Iu(e,t,n,"local"),o=new Blob([r],{type:c.LO.excalidraw}),[4,ru(o,{name:t.name,extension:"excalidraw",description:"Excalidraw file",fileHandle:bu(t.fileHandle)?null:t.fileHandle})];case 1:return[2,{fileHandle:i.sent()}]}}))}));return function(t,n,r){return e.apply(this,arguments)}}(),Pu=function(){var e=(0,d.Z)((function(e,t){var n;return Cu(this,(function(r){switch(r.label){case 0:return[4,nu({description:"Excalidraw files"})];case 1:return n=r.sent(),[2,xu(n,e,t)]}}))}));return function(t,n){return e.apply(this,arguments)}}(),Tu=function(e){return(null==e?void 0:e.type)===c.r8.excalidraw&&(!e.elements||Array.isArray(e.elements)&&(!e.appState||"object"==typeof e.appState))},Lu=function(){var e=(0,d.Z)((function(e){var t,n;return Cu(this,(function(r){switch(r.label){case 0:return t={type:c.r8.excalidrawLibrary,version:c.Kr.excalidrawLibrary,source:c.pb,libraryItems:e},n=JSON.stringify(t,null,2),[4,ru(new Blob([n],{type:c.LO.excalidrawlib}),{name:"library",extension:"excalidrawlib",description:"Excalidraw library file"})];case 1:return r.sent(),[2]}}))}));return function(t){return e.apply(this,arguments)}}(),Au=function(){var e=(0,d.Z)((function(e){var t;return Cu(this,(function(n){switch(n.label){case 0:return[4,nu({description:"Excalidraw library files"})];case 1:return t=n.sent(),[4,e.importLibrary(t)];case 2:return n.sent(),[2]}}))}));return function(t){return e.apply(this,arguments)}}(),Du=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}};function zu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Nu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zu(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Hu=function(e){return new Promise((function(t,n){var r=new Image;r.onload=function(){t(r)},r.onerror=function(e){n(e)},r.src=e}))},Ru=function(){var e=(0,d.Z)((function(e){var t,n,r,o,i;return Du(this,(function(a){switch(a.label){case 0:return t=e.fileIds,n=e.files,r=e.imageCache,o=new Map,i=new Map,[4,Promise.all(t.reduce((function(e,t){var a=n[t];return a&&!o.has(t)?(o.set(t,!0),e.concat((0,d.Z)((function(){var e,n,o;return Du(this,(function(l){switch(l.label){case 0:if(l.trys.push([0,2,,3]),a.mimeType===c.LO.binary)throw new Error("Only images can be added to ImageCache");return e=Hu(a.dataURL),n={image:e,mimeType:a.mimeType},r.set(t,n),[4,e];case 1:return o=l.sent(),r.set(t,Nu(Nu({},n),{},{image:o})),[3,3];case 2:return l.sent(),i.set(t,!0),[3,3];case 3:return[2]}}))}))())):e}),[]))];case 1:return a.sent(),[2,{imageCache:r,updatedFiles:o,erroredFiles:i}]}}))}));return function(t){return e.apply(this,arguments)}}(),Bu=function(e){return e.filter((function(e){return Me(e)}))},Fu=function(){var e=(0,d.Z)((function(e){var t,n;return Du(this,(function(r){if(t=(new DOMParser).parseFromString(e,c.LO.svg),n=t.querySelector("svg"),t.querySelector("parsererror")||"svg"!==(null==(o=n)?void 0:o.nodeName.toLowerCase()))throw new Error(S("errors.invalidSVGString"));return n.hasAttribute("xmlns")||n.setAttribute("xmlns",c.hR),[2,n.outerHTML];var o}))}));return function(t){return e.apply(this,arguments)}}(),Uu=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}},Vu="\x3c!-- svg-source:excalidraw --\x3e",Gu=function(){var e=(0,d.Z)((function(e,t,n,r){var o,i,a,l,s,u,d,p,f,h,g,m,v,b,y,x;return Uu(this,(function(w){switch(w.label){case 0:return o=r.exportBackground,i=r.exportPadding,a=void 0===i?c.qy:i,l=r.viewBackgroundColor,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(e,n){var r=document.createElement("canvas");return r.width=e*t.exportScale,r.height=n*t.exportScale,{canvas:r,scale:t.exportScale}},u=Ku(e,a),d=u[0],p=u[1],f=u[2],h=u[3],g=s(f,h),m=g.canvas,v=g.scale,b=void 0===v?1:v,y=Un(),[4,Ru({imageCache:new Map,fileIds:Bu(e).map((function(e){return e.fileId})),files:n})];case 1:return x=w.sent().imageCache,Wc(e,t,null,b,_e.canvas(m),m,{viewBackgroundColor:o?l:null,scrollX:-d+a,scrollY:-p+a,zoom:y.zoom,remotePointerViewportCoords:{},remoteSelectedElementIds:{},shouldCacheIgnoreZoom:!1,remotePointerUsernames:{},remotePointerUserStates:{},theme:t.exportWithDarkMode?"dark":"light",imageCache:x,renderScrollbars:!1,renderSelection:!1,renderGrid:!1,isExporting:!0}),[2,m]}}))}));return function(t,n,r,o){return e.apply(this,arguments)}}(),Wu=function(){var e=(0,d.Z)((function(e,t,r){var o,i,a,l,s,u,d,p,f,h,g,m,v,b,y,x;return Uu(this,(function(w){switch(w.label){case 0:if(o=t.exportPadding,i=void 0===o?c.qy:o,a=t.viewBackgroundColor,l=t.exportScale,s=void 0===l?1:l,u=t.exportEmbedScene,d="",!u)return[3,5];w.label=1;case 1:return w.trys.push([1,4,,5]),[4,Promise.all([n.e(736),n.e(9)]).then(n.bind(n,673))];case 2:return[4,w.sent().encodeSvgMetadata({text:Iu(e,t,r||{},"local")})];case 3:return d=w.sent(),[3,5];case 4:return p=w.sent(),console.error(p),[3,5];case 5:return f=Ku(e,i),h=f[0],g=f[1],m=f[2],v=f[3],(b=document.createElementNS(c.hR,"svg")).setAttribute("version","1.1"),b.setAttribute("xmlns",c.hR),b.setAttribute("viewBox","0 0 ".concat(m," ").concat(v)),b.setAttribute("width","".concat(m*s)),b.setAttribute("height","".concat(v*s)),t.exportWithDarkMode&&b.setAttribute("filter",c.ZF),b.innerHTML="\n ".concat(Vu,"\n ").concat(d,'\n <defs>\n <style>\n @font-face {\n font-family: "Virgil";\n src: url("https://plus.excalidraw.com/Virgil.woff2");\n }\n @font-face {\n font-family: "Cascadia";\n src: url("https://plus.excalidraw.com/Cascadia.woff2");\n }\n </style>\n </defs>\n '),t.exportBackground&&a&&((y=b.ownerDocument.createElementNS(c.hR,"rect")).setAttribute("x","0"),y.setAttribute("y","0"),y.setAttribute("width","".concat(m)),y.setAttribute("height","".concat(v)),y.setAttribute("fill",a),b.appendChild(y)),x=_e.svg(b),function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i=o.offsetX,a=void 0===i?0:i,l=o.offsetY,s=void 0===l?0:l,c=o.exportWithDarkMode,u=void 0!==c&&c;n&&e.forEach((function(e){if(!e.isDeleted)try{Lr(e,t,n,r,e.x+a,e.y+s,u)}catch(e){console.error(e)}}))}(e,x,b,r||{},{offsetX:-h+i,offsetY:-g+i,exportWithDarkMode:t.exportWithDarkMode}),[2,b]}}))}));return function(t,n,r){return e.apply(this,arguments)}}(),Ku=function(e,t){var n=it(e),r=n[0],o=n[1],i=n[2],a=n[3];return[r,o,En(r,i)+2*t,En(o,a)+t+t]},Zu=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};function Yu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function qu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yu(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Xu=32,$u=12,Qu=256,Ju="NOT_SPREADSHEET",ed="VALID_SPREADSHEET",td=function(e){var t=/^[$€£¥₩]?([0-9,]+(\.[0-9]+)?)$/.exec(e);return t?parseFloat(t[1].replace(/,/g,"")):null},nd=function(e,t){return e.slice(1).every((function(e){return null!==td(e[t])}))},rd=function(e){var t=e[0].length;if(t>2)return{type:Ju,reason:"More than 2 columns"};if(1===t){if(!nd(e,0))return{type:Ju,reason:"Value is not numeric"};var n=null===td(e[0][0]),r=(n?e.slice(1):e).map((function(e){return td(e[0])}));return r.length<2?{type:Ju,reason:"Less than two rows"}:{type:ed,spreadsheet:{title:n?e[0][0]:null,labels:null,values:r}}}var o=nd(e,0)?0:1;if(!nd(e,o))return{type:Ju,reason:"Value is not numeric"};var i=(o+1)%2,a=null===td(e[0][o]),l=a?e.slice(1):e;return l.length<2?{type:Ju,reason:"Less than 2 rows"}:{type:ed,spreadsheet:{title:a?e[0][o]:null,labels:l.map((function(e){return e[i]})),values:l.map((function(e){return td(e[o])}))}}},od=pt.elementBackground.slice(2,pt.elementBackground.length),id={fillStyle:"hachure",fontFamily:c.rk,fontSize:c.n5,opacity:100,roughness:1,strokeColor:pt.elementStroke[0],strokeSharpness:"sharp",strokeStyle:"solid",strokeWidth:1,verticalAlign:"middle"},ad=function(e){return{chartWidth:44*e.values.length+$u,chartHeight:280}},ld=function(e,t,n,r,o,i){var a=ad(e),l=a.chartWidth,s=a.chartHeight,u=e.title?bo(qu(qu({backgroundColor:o,groupIds:[r]},id),{},{text:e.title,x:t+l/2,y:n-Qu-24-c.n5,strokeSharpness:"sharp",strokeStyle:"solid",textAlign:"center"})):null,d=i?mo(qu(qu({backgroundColor:o,groupIds:[r]},id),{},{type:"rectangle",x:t,y:n-s,width:l,height:s,strokeColor:pt.elementStroke[0],fillStyle:"solid",opacity:6})):null;return Zu(Zu(Zu(Zu(Zu([],d?[d]:[],!0),u?[u]:[],!0),function(e,t,n,r,o){var i;return(null===(i=e.labels)||void 0===i?void 0:i.map((function(e,i){return bo(qu(qu({groupIds:[r],backgroundColor:o},id),{},{text:e.length>8?"".concat(e.slice(0,5),"..."):e,x:t+44*i+24,y:n+6,width:Xu,angle:5.87,fontSize:16,textAlign:"center",verticalAlign:"top"}))})))||[]}(e,t,n,r,o),!0),function(e,t,n,r,o){var i=bo(qu(qu({groupIds:[r],backgroundColor:o},id),{},{x:t-$u,y:n-$u,text:"0",textAlign:"right"}));return[i,bo(qu(qu({groupIds:[r],backgroundColor:o},id),{},{x:t-$u,y:n-Qu-i.height/2,text:Math.max.apply(Math,e.values).toLocaleString(),textAlign:"right"}))]}(e,t,n,r,o),!0),function(e,t,n,r,o){var i=ad(e),a=i.chartWidth,l=i.chartHeight;return[xo(qu(qu({backgroundColor:o,groupIds:[r]},id),{},{type:"line",x:t,y:n,startArrowhead:null,endArrowhead:null,width:a,points:[[0,0],[a,0]]})),xo(qu(qu({backgroundColor:o,groupIds:[r]},id),{},{type:"line",x:t,y:n,startArrowhead:null,endArrowhead:null,height:l,points:[[0,0],[0,-l]]})),xo(qu(qu({backgroundColor:o,groupIds:[r]},id),{},{type:"line",x:t,y:n-Qu-$u,startArrowhead:null,endArrowhead:null,strokeStyle:"dotted",width:a,opacity:50,points:[[0,0],[a,0]]}))]}(e,t,n,r,o),!0)},sd=function(e,t,n,r){return"line"===e?function(e,t,n){for(var r=Math.max.apply(Math,e.values),o=Gr(),i=od[Math.floor(Math.random()*od.length)],a=0,l=[],s=0,u=e.values;s<u.length;s++){var d=44*a,p=-u[s]/r*Qu;l.push([d,p]),a++}var f=Math.max.apply(Math,l.map((function(e){return e[0]}))),h=Math.max.apply(Math,l.map((function(e){return e[1]}))),g=Math.min.apply(Math,l.map((function(e){return e[0]}))),m=Math.min.apply(Math,l.map((function(e){return e[1]}))),v=xo(qu(qu({backgroundColor:i,groupIds:[o]},id),{},{type:"line",x:t+$u+16,y:n-$u,startArrowhead:null,endArrowhead:null,height:h-m,width:f-g,strokeWidth:2,points:l})),b=e.values.map((function(e,a){var l=44*a+6,s=-e/r*Qu+6;return mo(qu(qu({backgroundColor:i,groupIds:[o]},id),{},{fillStyle:"solid",strokeWidth:2,type:"ellipse",x:t+l+16,y:n+s-24,width:$u,height:$u}))})),y=e.values.map((function(e,a){var l=44*a+6,s=e/r*Qu+6+$u;return xo(qu(qu({backgroundColor:i,groupIds:[o]},id),{},{type:"line",x:t+l+16+6,y:n-s,startArrowhead:null,endArrowhead:null,height:s,strokeStyle:"dotted",opacity:50,points:[[0,0],[0,s]]}))}));return Zu(Zu(Zu(Zu([],ld(e,t,n,o,i,"production"===c.Vi.DEVELOPMENT),!0),[v],!1),y,!0),b,!0)}(t,n,r):function(e,t,n){var r=Math.max.apply(Math,e.values),o=Gr(),i=od[Math.floor(Math.random()*od.length)],a=e.values.map((function(e,a){var l=e/r*Qu;return mo(qu(qu({backgroundColor:i,groupIds:[o]},id),{},{type:"rectangle",x:t+44*a+$u,y:n-l-$u,width:Xu,height:l}))}));return Zu(Zu([],a,!0),ld(e,t,n,o,i,"production"===c.Vi.DEVELOPMENT),!0)}(t,n,r)},cd=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}},ud="",dd=!1,pd="clipboard"in navigator&&"readText"in navigator.clipboard,fd="clipboard"in navigator&&"writeText"in navigator.clipboard,hd="clipboard"in navigator&&"write"in navigator.clipboard&&"ClipboardItem"in window&&"toBlob"in HTMLCanvasElement.prototype,gd=function(){var e=(0,d.Z)((function(e,t,n){var r,o,i,a;return cd(this,(function(l){switch(l.label){case 0:r=Wa(e,t),o={type:c.r8.excalidrawClipboard,elements:r,files:r.reduce((function(e,t){return Me(t)&&n[t.fileId]&&(e[t.fileId]=n[t.fileId]),e}),{})},i=JSON.stringify(o),ud=i,l.label=1;case 1:return l.trys.push([1,3,,4]),dd=!1,[4,wd(i)];case 2:return l.sent(),[3,4];case 3:return a=l.sent(),dd=!0,console.error(a),[3,4];case 4:return[2]}}))}));return function(t,n,r){return e.apply(this,arguments)}}(),md=function(){if(!ud)return{};try{return JSON.parse(ud)}catch(e){return console.error(e),{}}},vd=function(e){var t=function(e){var t=e.trim().split("\n").map((function(e){return e.trim().split("\t")}));if(t.length&&2!==t[0].length&&(t=e.trim().split("\n").map((function(e){return e.trim().split(",")}))),0===t.length)return{type:Ju,reason:"No values"};var n=t[0].length,r=t.every((function(e){return e.length===n}));if(!r)return{type:Ju,reason:"All rows don't have same number of columns"};var o=rd(t);if(o.type!==ed){var i=rd(function(e){for(var t=[],n=0;n<e[0].length;n++){for(var r=[],o=0;o<e.length;o++)r.push(e[o][n]);t.push(r)}return t}(t));if(i.type===ed)return i}return o}(e);return t.type===ed?{spreadsheet:t.spreadsheet}:null},bd=function(){var e=(0,d.Z)((function(e){var t,n,r;return cd(this,(function(o){switch(o.label){case 0:return o.trys.push([0,5,,6]),e?(n=null===(t=e.clipboardData)||void 0===t?void 0:t.getData("text/plain").trim(),[3,4]):[3,1];case 1:return(r=pd)?[4,navigator.clipboard.readText()]:[3,3];case 2:r=o.sent(),o.label=3;case 3:n=r,o.label=4;case 4:return[2,n||""];case 5:return o.sent(),[2,""];case 6:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),yd=function(){var e=(0,d.Z)((function(e){var t,n,r,o;return cd(this,(function(i){switch(i.label){case 0:return[4,bd(e)];case 1:if(!(t=i.sent())||t.includes(Vu))return[2,md()];if(n=vd(t))return[2,n];r=md();try{return o=JSON.parse(t),a=o,[c.r8.excalidraw,c.r8.excalidrawClipboard].includes(null==a?void 0:a.type)&&Array.isArray(a.elements)?[2,{elements:o.elements,files:o.files}]:[2,r]}catch(e){return[2,dd&&r.elements?r:{text:t}]}return[2]}var a}))}));return function(t){return e.apply(this,arguments)}}(),xd=function(){var e=(0,d.Z)((function(e){var t;return cd(this,(function(n){switch(n.label){case 0:return[4,navigator.clipboard.write([new window.ClipboardItem((t={},t[c.LO.png]=e,t))])];case 1:return n.sent(),[2]}}))}));return function(t){return e.apply(this,arguments)}}(),wd=function(){var e=(0,d.Z)((function(e){var t,n;return cd(this,(function(r){switch(r.label){case 0:if(t=!1,!fd)return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,navigator.clipboard.writeText(e||"")];case 2:return r.sent(),t=!0,[3,4];case 3:return n=r.sent(),console.error(n),[3,4];case 4:if(!t&&!kd(e||" "))throw new Error("couldn't copy");return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),kd=function(e){var t="rtl"===document.documentElement.getAttribute("dir"),n=document.createElement("textarea");n.style.border="0",n.style.padding="0",n.style.margin="0",n.style.position="absolute",n.style[t?"right":"left"]="-9999px";var r=window.pageYOffset||document.documentElement.scrollTop;n.style.top="".concat(r,"px"),n.style.fontSize="12pt",n.setAttribute("readonly",""),n.value=e,document.body.appendChild(n);var o=!1;try{n.select(),n.setSelectionRange(0,n.value.length),o=document.execCommand("copy")}catch(e){console.error(e)}return n.remove(),o},Sd=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}},Ed=function(){var e=(0,d.Z)((function(e,t,r,o,i){var a,l,s,u,d,p,f,h,g,m,v;return Sd(this,(function(b){switch(b.label){case 0:if(a=i.exportBackground,l=i.exportPadding,s=void 0===l?c.qy:l,u=i.viewBackgroundColor,d=i.name,p=i.fileHandle,f=void 0===p?null:p,0===t.length)throw new Error(S("alerts.cannotExportEmptyCanvas"));return"svg"!==e&&"clipboard-svg"!==e?[3,5]:[4,Wu(t,{exportBackground:a,exportWithDarkMode:r.exportWithDarkMode,viewBackgroundColor:u,exportPadding:s,exportScale:r.exportScale,exportEmbedScene:r.exportEmbedScene&&"svg"===e},o)];case 1:return h=b.sent(),"svg"!==e?[3,3]:[4,ru(new Blob([h.outerHTML],{type:c.LO.svg}),{description:"Export to SVG",name:d,extension:"svg",fileHandle:f})];case 2:return[2,b.sent()];case 3:return"clipboard-svg"!==e?[3,5]:[4,wd(h.outerHTML)];case 4:return b.sent(),[2];case 5:return[4,Gu(t,r,o,{exportBackground:a,viewBackgroundColor:u,exportPadding:s})];case 6:return(g=b.sent()).style.display="none",document.body.appendChild(g),[4,ku(g)];case 7:return m=b.sent(),g.remove(),"png"!==e?[3,12]:r.exportEmbedScene?[4,Promise.all([n.e(736),n.e(9)]).then(n.bind(n,673))]:[3,10];case 8:return[4,b.sent().encodePngMetadata({blob:m,metadata:Iu(t,r,o,"local")})];case 9:m=b.sent(),b.label=10;case 10:return[4,ru(m,{description:"Export to PNG",name:d,extension:"png",fileHandle:f})];case 11:return[2,b.sent()];case 12:if("clipboard"!==e)return[3,16];b.label=13;case 13:return b.trys.push([13,15,,16]),[4,xd(m)];case 14:return b.sent(),[3,16];case 15:if("CANVAS_POSSIBLY_TOO_BIG"===(v=b.sent()).name)throw v;throw new Error(S("alerts.couldNotCopyToClipboard"));case 16:return[2]}}))}));return function(t,n,r,o,i){return e.apply(this,arguments)}}(),jd=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}};function _d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Cd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_d(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Od=function(){var e=(0,d.Z)((function(e,t,n){var r,o,i,a,l;return jd(this,(function(s){switch(s.label){case 0:if(r=t.exportBackground,o=t.viewBackgroundColor,i=t.name,a=t.fileHandle,l=vu(a),!a||"png"!==(c=l)&&"svg"!==c)throw new Error("fileHandle should exist and should be of type svg or png when resaving");return t=Cd(Cd({},t),{},{exportEmbedScene:!0}),[4,Ed(l,Ha(e),t,n,{exportBackground:r,viewBackgroundColor:o,name:i,fileHandle:a})];case 1:return s.sent(),[2,{fileHandle:a}]}var c}))}));return function(t,n,r){return e.apply(this,arguments)}}(),Id=(n(7225),function(e){var t=e.children,n=e.checked,r=e.onChange,o=e.className;return(0,E.jsxs)("div",{className:Oe("Checkbox",o,{"is-checked":n}),onClick:function(e){r(!n,e),e.currentTarget.querySelector(".Checkbox-box").focus()},children:[(0,E.jsx)("button",{className:"Checkbox-box",role:"checkbox","aria-checked":n,children:gl}),(0,E.jsx)("div",{className:"Checkbox-label",children:t})]})});n(4623);function Md(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Md(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Md(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const Td=function(e){var t=e.children,n=e.gap,r=e.align,o=e.justifyContent,i=e.className,a=e.style;return(0,E.jsx)("div",{className:Oe("Stack Stack_horizontal",i),style:Pd({"--gap":n,alignItems:r,justifyContent:o},a),children:t})},Ld=function(e){var t=e.children,n=e.gap,r=e.align,o=e.justifyContent,i=e.className;return(0,E.jsx)("div",{className:Oe("Stack Stack_vertical",i),style:{"--gap":n,justifyItems:r,justifyContent:o},children:t})};n(554);var Ad=function(e){var t=e.fileName,n=e.onSave;return(0,E.jsxs)(Td,{className:"ActiveFile",gap:1,align:"center",children:[(0,E.jsxs)("span",{className:"ActiveFile__fileName",children:[Yl,(0,E.jsx)("span",{children:t})]}),(0,E.jsx)(ul,{type:"icon",icon:vl,title:S("buttons.save"),"aria-label":S("buttons.save"),onClick:n,"data-testid":"save-button"})]})},Dd=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}};function zd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Nd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zd(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Cs({name:"changeProjectName",perform:function(e,t,n){return Rc("change","title"),{appState:Nd(Nd({},t),{},{name:n}),commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData,r=e.appProps;return(0,E.jsx)(Bc,{label:S("labels.fileTitle"),value:t.name||"Unnamed",onChange:function(e){return n(e)},isNameEditable:void 0===r.name&&!t.viewModeEnabled})}}),Cs({name:"changeExportScale",perform:function(e,t,n){return{appState:Nd(Nd({},t),{},{exportScale:n}),commitToHistory:!1}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData,o=Ha(t),i=Ga(o,n)?Wa(o,n):o;return(0,E.jsx)(E.Fragment,{children:c.ZB.map((function(e){var t=function(e,t,n){var r=Ku(e,t).map((function(e){return Math.trunc(e*n)}));return[r[2],r[3]]}(i,c.qy,e),o=t[0],a=t[1],l="".concat(S("buttons.scale")," ").concat(e,"x (").concat(o,"x").concat(a,")");return(0,E.jsx)(ul,{size:"small",type:"radio",icon:"".concat(e,"x"),name:"export-canvas-scale",title:l,"aria-label":l,id:"export-canvas-scale",checked:e===n.exportScale,onChange:function(){return r(e)}},e)}))})}}),Cs({name:"changeExportBackground",perform:function(e,t,n){return{appState:Nd(Nd({},t),{},{exportBackground:n}),commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData;return(0,E.jsx)(Id,{checked:t.exportBackground,onChange:function(e){return n(e)},children:S("labels.withBackground")})}}),Cs({name:"changeExportEmbedScene",perform:function(e,t,n){return{appState:Nd(Nd({},t),{},{exportEmbedScene:n}),commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData;return(0,E.jsxs)(Id,{checked:t.exportEmbedScene,onChange:function(e){return n(e)},children:[S("labels.exportEmbedScene"),(0,E.jsx)(bc,{label:S("labels.exportEmbedScene_details"),long:!0,children:(0,E.jsx)("div",{className:"excalidraw-tooltip-icon",children:Pl})})]})}}),Cs({name:"saveToActiveFile",perform:(Hd=(0,d.Z)((function(e,t,n,r){var o,i,a,l;return Dd(this,(function(n){switch(n.label){case 0:o=!!t.fileHandle,n.label=1;case 1:return n.trys.push([1,6,,7]),bu(t.fileHandle)?[4,Od(e,t,r.files)]:[3,3];case 2:return a=n.sent(),[3,5];case 3:return[4,Mu(e,t,r.files)];case 4:a=n.sent(),n.label=5;case 5:return i=a.fileHandle,[2,{commitToHistory:!1,appState:Nd(Nd({},t),{},{fileHandle:i,toastMessage:o?null!=i&&i.name?S("toast.fileSavedToFilename").replace("{filename}",'"'.concat(i.name,'"')):S("toast.fileSaved"):null})}];case 6:return"AbortError"!==(null==(l=n.sent())?void 0:l.name)?console.error(l):console.warn(l),[2,{commitToHistory:!1}];case 7:return[2]}}))})),function(e,t,n,r){return Hd.apply(this,arguments)}),keyTest:function(e){return e.key===an&&e[Vt]&&!e.shiftKey},PanelComponent:function(e){var t,n=e.updateData,r=e.appState;return(0,E.jsx)(Ad,{onSave:function(){return n(null)},fileName:null===(t=r.fileHandle)||void 0===t?void 0:t.name})}});var Hd,Rd,Bd,Fd=Cs({name:"saveFileToDisk",perform:(Rd=(0,d.Z)((function(e,t,n,r){var o,i;return Dd(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,Mu(e,Nd(Nd({},t),{},{fileHandle:null}),r.files)];case 1:return o=n.sent().fileHandle,[2,{commitToHistory:!1,appState:Nd(Nd({},t),{},{fileHandle:o})}];case 2:return"AbortError"!==(null==(i=n.sent())?void 0:i.name)?console.error(i):console.warn(i),[2,{commitToHistory:!1}];case 3:return[2]}}))})),function(e,t,n,r){return Rd.apply(this,arguments)}),keyTest:function(e){return e.key===an&&e.shiftKey&&e[Vt]},PanelComponent:function(e){var t=e.updateData;return(0,E.jsx)(ul,{type:"button",icon:bl,title:S("buttons.saveAs"),"aria-label":S("buttons.saveAs"),showAriaLabel:Yh(),hidden:!Qc,onClick:function(){return t(null)},"data-testid":"save-as-button"})}});Cs({name:"loadScene",perform:(Bd=(0,d.Z)((function(e,t,n,r){var o,i,a,l,s;return Dd(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,Pu(t,e)];case 1:return o=n.sent(),i=o.elements,a=o.appState,l=o.files,[2,{elements:i,appState:a,files:l,commitToHistory:!0}];case 2:return"AbortError"===(null==(s=n.sent())?void 0:s.name)?(console.warn(s),[2,!1]):[2,{elements:e,appState:Nd(Nd({},t),{},{errorMessage:s.message}),files:r.files,commitToHistory:!1}];case 3:return[2]}}))})),function(e,t,n,r){return Bd.apply(this,arguments)}),keyTest:function(e){return e[Vt]&&e.key===tn},PanelComponent:function(e){var t=e.updateData;e.appState;return(0,E.jsx)(ul,{type:"button",icon:yl,title:S("buttons.load"),"aria-label":S("buttons.load"),showAriaLabel:Yh(),onClick:t,"data-testid":"load-button"})}}),Cs({name:"exportWithDarkMode",perform:function(e,t,n){return{appState:Nd(Nd({},t),{},{exportWithDarkMode:n}),commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData;return(0,E.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"-45px",marginBottom:"10px"},children:(0,E.jsx)(gc,{value:t.exportWithDarkMode?c.C6.DARK:c.C6.LIGHT,onChange:function(e){n(e===c.C6.DARK)},title:S("labels.toggleExportColorScheme")})})}});function Ud(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Vd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ud(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ud(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Gd="{}",Wd=Cs({name:"copyStyles",perform:function(e,t){var n=e.find((function(e){return t.selectedElementIds[e.id]}));return n&&(Gd=JSON.stringify(n)),{appState:Vd(Vd({},t),{},{toastMessage:S("toast.copyStyles")}),commitToHistory:!1}},contextItemLabel:"labels.copyStyles",keyTest:function(e){return e[Vt]&&e.altKey&&e.code===Ot}}),Kd=Cs({name:"pasteStyles",perform:function(e,t){var n,r=JSON.parse(Gd);return"text"!==(null==(n=r)?void 0:n.type)&&"diamond"!==(null==n?void 0:n.type)&&"rectangle"!==(null==n?void 0:n.type)&&"ellipse"!==(null==n?void 0:n.type)&&"arrow"!==(null==n?void 0:n.type)&&"freedraw"!==(null==n?void 0:n.type)&&"line"!==(null==n?void 0:n.type)?{elements:e,commitToHistory:!1}:{elements:e.map((function(e){if(t.selectedElementIds[e.id]){var n=Yr(e,{backgroundColor:null==r?void 0:r.backgroundColor,strokeWidth:null==r?void 0:r.strokeWidth,strokeColor:null==r?void 0:r.strokeColor,strokeStyle:null==r?void 0:r.strokeStyle,fillStyle:null==r?void 0:r.fillStyle,opacity:null==r?void 0:r.opacity,roughness:null==r?void 0:r.roughness});return Te(n)&&(Zr(n,{fontSize:(null==r?void 0:r.fontSize)||c.n5,fontFamily:(null==r?void 0:r.fontFamily)||c.rk,textAlign:(null==r?void 0:r.textAlign)||c.Hg}),Ta(n)),n}return e})),commitToHistory:!0}},contextItemLabel:"labels.pasteStyles",keyTest:function(e){return e[Vt]&&e.altKey&&e.code===Lt}}),Zd=function(e){return(0,E.jsx)("button",{className:"help-icon",onClick:e.onClick,type:"button",title:"".concat(e.title," — ?"),"aria-label":e.title,children:Pl})};function Yd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function qd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yd(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Cs({name:"toggleCanvasMenu",perform:function(e,t){return{appState:qd(qd({},t),{},{openMenu:"canvas"===t.openMenu?null:"canvas"}),commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData;return(0,E.jsx)(ul,{type:"button",icon:Ol,"aria-label":S("buttons.menu"),onClick:n,selected:"canvas"===t.openMenu})}}),Cs({name:"toggleEditMenu",perform:function(e,t){return{appState:qd(qd({},t),{},{openMenu:"shape"===t.openMenu?null:"shape"}),commitToHistory:!1}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,E.jsx)(ul,{visible:La(n,Ha(t)),type:"button",icon:kl,"aria-label":S("buttons.edit"),onClick:r,selected:"shape"===n.openMenu})}}),Cs({name:"toggleFullScreen",perform:function(){return On()||document.documentElement.requestFullscreen(),On()&&document.exitFullscreen(),{commitToHistory:!1}},keyTest:function(e){return e.code===Pt&&!e[Vt]}}),Cs({name:"toggleShortcuts",perform:function(e,t,n,r){var o=r.focusContainer;return t.showHelpDialog&&o(),{appState:qd(qd({},t),{},{showHelpDialog:!t.showHelpDialog}),commitToHistory:!1}},PanelComponent:function(e){var t=e.updateData;return(0,E.jsx)(Zd,{title:S("helpDialog.title"),onClick:t})},keyTest:function(e){return e.key===Zt}});var Xd=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};function $d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$d(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Jd=function(e,t){var n=Wa(Ha(e),t);return n.length>=2&&!function(e){if(e.length>=2)for(var t=function(t){if(e.reduce((function(e,n){return e&&so(n,t)}),!0))return{value:!0}},n=0,r=e[0].groupIds;n<r.length;n++){var o=t(r[n]);if("object"==typeof o)return o.value}return!1}(n)},ep=Cs({name:"group",perform:function(e,t){var n=Wa(Ha(e),t);if(n.length<2)return{appState:t,elements:e,commitToHistory:!1};var r=ao(t);if(1===r.length){var o=r[0],i=new Set(co(e,o).map((function(e){return e.id}))),a=new Set(n.map((function(e){return e.id})));if(new Set(Xd(Xd([],Array.from(i),!0),Array.from(a),!0)).size===i.size)return{appState:t,elements:e,commitToHistory:!1}}var l=Gr(),s=e.map((function(e){return t.selectedElementIds[e.id]?Yr(e,{groupIds:uo(e.groupIds,l,t.editingGroupId)}):e})),c=co(s,l),u=c[c.length-1],d=s.lastIndexOf(u),p=s.slice(d+1),f=s.slice(0,d).filter((function(e){return!so(e,l)})),h=Xd(Xd(Xd([],f,!0),c,!0),p,!0);return{appState:ro(l,Qd(Qd({},t),{},{selectedGroupIds:{}}),Ha(h)),elements:h,commitToHistory:!0}},contextItemLabel:"labels.group",contextItemPredicate:function(e,t){return Jd(e,t)},keyTest:function(e){return!e.shiftKey&&e[Vt]&&e.code===Mt},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,E.jsx)(ul,{hidden:!Jd(t,n),type:"button",icon:(0,E.jsx)(ql,{theme:n.theme}),onClick:function(){return r(null)},title:"".concat(S("labels.group")," — ").concat(In("CtrlOrCmd+G")),"aria-label":S("labels.group"),visible:Ga(Ha(t),n)})}}),tp=Cs({name:"ungroup",perform:function(e,t){if(0===ao(t).length)return{appState:t,elements:e,commitToHistory:!1};var n=e.map((function(e){var n=function(e,t){return e.filter((function(e){return!t[e]}))}(e.groupIds,t.selectedGroupIds);return n.length===e.groupIds.length?e:Yr(e,{groupIds:n})}));return{appState:lo(Qd(Qd({},t),{},{selectedGroupIds:{}}),Ha(n)),elements:n,commitToHistory:!0}},keyTest:function(e){return e.shiftKey&&e[Vt]&&e.code===Mt},contextItemLabel:"labels.ungroup",contextItemPredicate:function(e,t){return ao(t).length>0},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,E.jsx)(ul,{type:"button",hidden:0===ao(n).length,icon:(0,E.jsx)(Xl,{theme:n.theme}),onClick:function(){return r(null)},title:"".concat(S("labels.ungroup")," — ").concat(In("CtrlOrCmd+Shift+G")),"aria-label":S("labels.ungroup"),visible:Ga(Ha(t),n)})}}),np=(n(2789),function(e){var t=e.children,n=e.color,r=e.border,o=e.onClick;return(0,E.jsx)("div",{className:"Avatar",style:{background:n,border:"2px solid ".concat(r)},onClick:o,children:t})});function rp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function op(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rp(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Cs({name:"goToCollaborator",perform:function(e,t,n){var r=n;return r?{appState:op(op(op({},t),Za({scenePoint:r,viewportDimensions:{width:t.width,height:t.height},zoom:t.zoom})),{},{openMenu:"canvas"===t.openMenu?null:t.openMenu}),commitToHistory:!1}:{appState:t,commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData,r=e.data,o=null==r?void 0:r.id;if(!o)return null;var i=t.collaborators.get(o);if(!i)return null;var a=Fc(i.picture||o,t),l=a.background,s=a.stroke,c=i.picture,u=function(e){if(!e)return"?";var t=e.trim().split(" ");if(t.length<2)return t[0].substring(0,2).toUpperCase();var n=t[0],r=t[t.length-1];return(n[0]+r[0]).toUpperCase()}(i.username);return(0,E.jsx)(np,{color:l,border:c?"transparent":s,onClick:function(){return n(i.pointer)},children:c?(0,E.jsx)("img",{referrerPolicy:"no-referrer",src:c,alt:u}):u})}});var ip=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};function ap(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function lp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ap(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ap(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var sp=Cs({name:"addToLibrary",perform:function(e,t,n,r){return e.some((function(e){return"image"===e.type}))?{commitToHistory:!1,appState:lp(lp({},t),{},{errorMessage:"Support for adding images to the library coming soon!"})}:r.library.loadLibrary().then((function(n){return r.library.saveLibrary(ip([{id:Gr(),status:"unpublished",elements:Wa(Ha(e),t).map(wo),created:Date.now()}],n,!0))})).then((function(){return{commitToHistory:!1,appState:lp(lp({},t),{},{toastMessage:S("toast.addedToLibrary")})}})).catch((function(e){return{commitToHistory:!1,appState:lp(lp({},t),{},{errorMessage:e.message})}}))},contextItemLabel:"labels.addToLibrary"}),cp=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};function up(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function dp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?up(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):up(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var pp=function(e){var t=new Map;return e.forEach((function(e){var n=0===e.groupIds.length?e.id:e.groupIds[e.groupIds.length-1],r=t.get(n)||[];t.set(n,cp(cp([],r,!0),[e],!1))})),Array.from(t.values())},fp=function(e,t,n){var r,o,i,a=n.axis,l=n.position,s=st(e),c="x"===a?["minX","maxX"]:["minY","maxY"],u=c[0],d=c[1],p={x:0,y:0};return dp(dp({},p),{},"start"===l?((r={})[a]=t[u]-s[u],r):"end"===l?((o={})[a]=t[d]-s[d],o):((i={})[a]=(t[u]+t[d])/2-(s[u]+s[d])/2,i))},hp=function(e,t){return Wa(Ha(e),t).length>1},gp=function(e,t,n){var r=function(e,t){var n=pp(e),r=st(e);return n.flatMap((function(e){var n=fp(e,r,t);return e.map((function(e){return Yr(e,{x:e.x+n.x,y:e.y+n.y})}))}))}(Wa(Ha(e),t),n),o=Bn(r);return e.map((function(e){return o.get(e.id)||e}))},mp=(Cs({name:"alignTop",perform:function(e,t){return{appState:t,elements:gp(e,t,{position:"start",axis:"y"}),commitToHistory:!0}},keyTest:function(e){return e[Vt]&&e.shiftKey&&e.key===Bt},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,E.jsx)(ul,{hidden:!hp(t,n),type:"button",icon:(0,E.jsx)(zl,{theme:n.theme}),onClick:function(){return r(null)},title:"".concat(S("labels.alignTop")," — ").concat(In("CtrlOrCmd+Shift+Up")),"aria-label":S("labels.alignTop"),visible:Ga(Ha(t),n)})}}),Cs({name:"alignBottom",perform:function(e,t){return{appState:t,elements:gp(e,t,{position:"end",axis:"y"}),commitToHistory:!0}},keyTest:function(e){return e[Vt]&&e.shiftKey&&e.key===Nt},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,E.jsx)(ul,{hidden:!hp(t,n),type:"button",icon:(0,E.jsx)(Nl,{theme:n.theme}),onClick:function(){return r(null)},title:"".concat(S("labels.alignBottom")," — ").concat(In("CtrlOrCmd+Shift+Down")),"aria-label":S("labels.alignBottom"),visible:Ga(Ha(t),n)})}}),Cs({name:"alignLeft",perform:function(e,t){return{appState:t,elements:gp(e,t,{position:"start",axis:"x"}),commitToHistory:!0}},keyTest:function(e){return e[Vt]&&e.shiftKey&&e.key===Ht},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,E.jsx)(ul,{hidden:!hp(t,n),type:"button",icon:(0,E.jsx)(Hl,{theme:n.theme}),onClick:function(){return r(null)},title:"".concat(S("labels.alignLeft")," — ").concat(In("CtrlOrCmd+Shift+Left")),"aria-label":S("labels.alignLeft"),visible:Ga(Ha(t),n)})}}),Cs({name:"alignRight",perform:function(e,t){return{appState:t,elements:gp(e,t,{position:"end",axis:"x"}),commitToHistory:!0}},keyTest:function(e){return e[Vt]&&e.shiftKey&&e.key===Rt},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,E.jsx)(ul,{hidden:!hp(t,n),type:"button",icon:(0,E.jsx)(Rl,{theme:n.theme}),onClick:function(){return r(null)},title:"".concat(S("labels.alignRight")," — ").concat(In("CtrlOrCmd+Shift+Right")),"aria-label":S("labels.alignRight"),visible:Ga(Ha(t),n)})}}),Cs({name:"alignVerticallyCentered",perform:function(e,t){return{appState:t,elements:gp(e,t,{position:"center",axis:"y"}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,E.jsx)(ul,{hidden:!hp(t,n),type:"button",icon:(0,E.jsx)(Ul,{theme:n.theme}),onClick:function(){return r(null)},title:S("labels.centerVertically"),"aria-label":S("labels.centerVertically"),visible:Ga(Ha(t),n)})}}),Cs({name:"alignHorizontallyCentered",perform:function(e,t){return{appState:t,elements:gp(e,t,{position:"center",axis:"x"}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,E.jsx)(ul,{hidden:!hp(t,n),type:"button",icon:(0,E.jsx)(Vl,{theme:n.theme}),onClick:function(){return r(null)},title:S("labels.centerHorizontally"),"aria-label":S("labels.centerHorizontally"),visible:Ga(Ha(t),n)})}}),function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}),vp=function(e){var t=new Map;return e.forEach((function(e){var n=0===e.groupIds.length?e.id:e.groupIds[e.groupIds.length-1],r=t.get(n)||[];t.set(n,mp(mp([],r,!0),[e],!1))})),Array.from(t.values())},bp=function(e){var t=it(e),n=t[0],r=t[1],o=t[2],i=t[3];return{minX:n,minY:r,maxX:o,maxY:i,width:o-n,height:i-r,midX:(n+o)/2,midY:(r+i)/2}},yp=function(e,t){return Wa(Ha(e),t).length>1},xp=function(e,t,n){var r=function(e,t){for(var n="x"===t.axis?["minX","midX","maxX","width"]:["minY","midY","maxY","height"],r=n[0],o=n[1],i=n[2],a=n[3],l=bp(e),s=vp(e).map((function(e){return[e,bp(e)]})).sort((function(e,t){return e[1][o]-t[1][o]})),c=0,u=0,d=s;u<d.length;u++)c+=d[u][1][a];var p=(l[a]-c)/(s.length-1);if(p<0){var f=s.findIndex((function(e){return e[1][r]===l[r]})),h=s.findIndex((function(e){return e[1][i]===l[i]})),g=(s[h][1][o]-s[f][1][o])/(s.length-1),m=s[f][1][o];return s.flatMap((function(e,n){var r=e[0],i=e[1],a={x:0,y:0};return n!==f&&n!==h&&(m+=g,a[t.axis]=m-i[o]),r.map((function(e){return Yr(e,{x:e.x+a.x,y:e.y+a.y})}))}))}var v=l[r];return s.flatMap((function(e){var n=e[0],o=e[1],i={x:0,y:0};return i[t.axis]=v-o[r],v+=p,v+=o[a],n.map((function(e){return Yr(e,{x:e.x+i.x,y:e.y+i.y})}))}))}(Wa(Ha(e),t),n),o=Bn(r);return e.map((function(e){return o.get(e.id)||e}))},wp=(Cs({name:"distributeHorizontally",perform:function(e,t){return{appState:t,elements:xp(e,t,{space:"between",axis:"x"}),commitToHistory:!0}},keyTest:function(e){return e.altKey&&e.code===Tt},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,E.jsx)(ul,{hidden:!yp(t,n),type:"button",icon:(0,E.jsx)(Bl,{theme:n.theme}),onClick:function(){return r(null)},title:"".concat(S("labels.distributeHorizontally")," — ").concat(In("Alt+H")),"aria-label":S("labels.distributeHorizontally"),visible:Ga(Ha(t),n)})}}),Cs({name:"distributeVertically",perform:function(e,t){return{appState:t,elements:xp(e,t,{space:"between",axis:"y"}),commitToHistory:!0}},keyTest:function(e){return e.altKey&&e.code===Lt},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,E.jsx)(ul,{hidden:!yp(t,n),type:"button",icon:(0,E.jsx)(Fl,{theme:n.theme}),onClick:function(){return r(null)},title:"".concat(S("labels.distributeVertically")," — ").concat(In("Alt+V")),"aria-label":S("labels.distributeVertically"),visible:Ga(Ha(t),n)})}}),Cs({name:"flipHorizontal",perform:function(e,t){return{elements:Sp(e,t,"horizontal"),appState:t,commitToHistory:!0}},keyTest:function(e){return e.shiftKey&&"KeyH"===e.code},contextItemLabel:"labels.flipHorizontal",contextItemPredicate:function(e,t){return function(e,t){var n=Wa(Ha(e),t);return 1===n.length&&"text"!==n[0].type}(e,t)}})),kp=Cs({name:"flipVertical",perform:function(e,t){return{elements:Sp(e,t,"vertical"),appState:t,commitToHistory:!0}},keyTest:function(e){return e.shiftKey&&"KeyV"===e.code},contextItemLabel:"labels.flipVertical",contextItemPredicate:function(e,t){return function(e,t){return 1===Wa(Ha(e),t).length}(e,t)}}),Sp=function(e,t,n){var r=Wa(Ha(e),t);if(r.length>1)return e;var o=Ep(r,t,n),i=Bn(o);return e.map((function(e){return i.get(e.id)||e}))},Ep=function(e,t,n){return e.forEach((function(e){jp(e,t),"vertical"===n&&_p(e,Math.PI)})),e},jp=function(e,t){var n=e.x,r=e.y,o=e.width,i=e.height,a=xa(e.angle),l=0;(De(e)||Le(e))&&(l=2*e.points.reduce((function(e,t){return Math.max(e,t[0])}),0)-e.width),Zr(e,{angle:xa(0)});var s=Mo(e,t.zoom),c=!0,u=0,d=s.nw;if(d||(c=!1,d=s.ne)){if(De(e)){for(var p=1;p<e.points.length;p++)Fi.movePoint(e,p,[-e.points[p][0],e.points[p][1]]);Fi.normalizePoints(e)}else u=c?e.x+2*o:e.x-2*o,_a(e,!0,e,c?"nw":"ne",!1,u,d[1]),Zr(e,{width:o,height:i});var f=xa(2*Math.PI-a);f<0&&(f=xa(f+2*Math.PI)),Zr(e,{angle:f}),Zr(e,{x:n+l,y:r}),ra(e)}else Zr(e,{angle:a})},_p=function(e,t){var n=e.x,r=e.y,o=xa(e.angle+t);o<0&&(o=xa(2*Math.PI+o)),Zr(e,{angle:o}),Zr(e,{x:n,y:r})},Cp=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}};function Op(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ip(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Op(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Op(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Mp,Pp,Tp=Cs({name:"copy",perform:function(e,t,n,r){return gd(Ha(e),t,r.files),{commitToHistory:!1}},contextItemLabel:"labels.copy",keyTest:void 0}),Lp=Cs({name:"cut",perform:function(e,t,n,r){return Tp.perform(e,t,n,r),Ps.perform(e,t,n,r)},contextItemLabel:"labels.cut",keyTest:function(e){return e[Vt]&&e.code===At}}),Ap=Cs({name:"copyAsSvg",perform:(Mp=(0,d.Z)((function(e,t,n,r){var o,i;return Cp(this,(function(n){switch(n.label){case 0:if(!r.canvas)return[2,{commitToHistory:!1}];o=Wa(Ha(e),t),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,Ed("clipboard-svg",o.length?o:Ha(e),t,r.files,t)];case 2:return n.sent(),[2,{commitToHistory:!1}];case 3:return i=n.sent(),console.error(i),[2,{appState:Ip(Ip({},t),{},{errorMessage:i.message}),commitToHistory:!1}];case 4:return[2]}}))})),function(e,t,n,r){return Mp.apply(this,arguments)}),contextItemLabel:"labels.copyAsSvg"}),Dp=Cs({name:"copyAsPng",perform:(Pp=(0,d.Z)((function(e,t,n,r){var o,i;return Cp(this,(function(n){switch(n.label){case 0:if(!r.canvas)return[2,{commitToHistory:!1}];o=Wa(Ha(e),t),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,Ed("clipboard",o.length?o:Ha(e),t,r.files,t)];case 2:return n.sent(),[2,{appState:Ip(Ip({},t),{},{toastMessage:S("toast.copyToClipboardAsPng",{exportSelection:o.length?S("toast.selection"):S("toast.canvas"),exportColorScheme:t.exportWithDarkMode?S("buttons.darkMode"):S("buttons.lightMode")})}),commitToHistory:!1}];case 3:return i=n.sent(),console.error(i),[2,{appState:Ip(Ip({},t),{},{errorMessage:i.message}),commitToHistory:!1}];case 4:return[2]}}))})),function(e,t,n,r){return Pp.apply(this,arguments)}),contextItemLabel:"labels.copyAsPng",keyTest:function(e){return e.code===Ot&&e.altKey&&e.shiftKey}});function zp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Np(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zp(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Hp=Cs({name:"gridMode",perform:function(e,t){return Rc("view","mode","grid"),{appState:Np(Np({},t),{},{gridSize:this.checked(t)?null:c.k}),commitToHistory:!1}},checked:function(e){return null!==e.gridSize},contextItemLabel:"labels.showGrid",keyTest:function(e){return e[Vt]&&e.code===jt}});function Rp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Bp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rp(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Fp=Cs({name:"zenMode",perform:function(e,t){return Rc("view","mode","zen"),{appState:Bp(Bp({},t),{},{zenModeEnabled:!this.checked(t)}),commitToHistory:!1}},checked:function(e){return e.zenModeEnabled},contextItemLabel:"buttons.zenMode",keyTest:function(e){return!e[Vt]&&e.altKey&&e.code===Dt}});function Up(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Vp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Up(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Up(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Gp=Cs({name:"stats",perform:function(e,t){return{appState:Vp(Vp({},t),{},{showStats:!this.checked(t)}),commitToHistory:!1}},checked:function(e){return e.showStats},contextItemLabel:"stats.title",keyTest:function(e){return!e[Vt]&&e.altKey&&e.code===Ct}});function Wp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Kp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wp(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Zp=function(e,t,n){var r=!1;if(!(t.multiElement||t.resizingElement||t.editingElement||t.draggingElement)){var o=n();if(null===o)return{commitToHistory:r};var i=Bn(e),a=o.elements,l=Bn(a),s=e.filter((function(e){return!l.has(e.id)})),c=a.map((function(e){return Yr(i.get(e.id)||e,e)})).concat(s.map((function(e){return Yr(e,{isDeleted:!0})})));return ga(c,s),{elements:c,appState:Kp(Kp({},t),o.appState),commitToHistory:r,syncHistory:!0}}return{commitToHistory:r}},Yp=function(){function e(e,t,n,r){var o=this;this.actions={},this.renderAction=function(e,t){var n=o.app.props.UIOptions.canvasActions;if(o.actions[e]&&"PanelComponent"in o.actions[e]&&(!n||!(e in n)||n[e])){var r=o.actions[e],i=r.PanelComponent;return(0,E.jsx)(i,{elements:o.getElementsIncludingDeleted(),appState:o.getAppState(),updateData:function(e){o.updater(r.perform(o.getElementsIncludingDeleted(),o.getAppState(),e,o.app))},appProps:o.app.props,data:t})}return null},this.updater=function(t){if(!t||!("then"in t))return e(t);t.then((function(t){return e(t)}))},this.getAppState=t,this.getElementsIncludingDeleted=n,this.app=r}return e.prototype.registerAction=function(e){this.actions[e.name]=e},e.prototype.registerAll=function(e){var t=this;e.forEach((function(e){return t.registerAction(e)}))},e.prototype.handleKeyDown=function(e){var t=this,n=this.app.props.UIOptions.canvasActions,r=Object.values(this.actions).sort((function(e,t){return(t.keyPriority||0)-(e.keyPriority||0)})).filter((function(r){return(!n||!(r.name in n)||n[r.name])&&r.keyTest&&r.keyTest(e,t.getAppState(),t.getElementsIncludingDeleted())}));return 0!==r.length&&(!(this.getAppState().viewModeEnabled&&!Object.values(c.EH).includes(r[0].name))&&(e.preventDefault(),this.updater(r[0].perform(this.getElementsIncludingDeleted(),this.getAppState(),null,this.app)),!0))},e.prototype.executeAction=function(e){this.updater(e.perform(this.getElementsIncludingDeleted(),this.getAppState(),null,this.app))},e}(),qp=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}},Xp=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};function $p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$p(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Jp=function(){function e(e){var t=this;this.libraryCache=null,this.resetLibrary=(0,d.Z)((function(){var e,n;return qp(this,(function(r){switch(r.label){case 0:return[4,null===(e=(n=t.app.props).onLibraryChange)||void 0===e?void 0:e.call(n,[])];case 1:return r.sent(),t.libraryCache=[],[2]}}))})),this.restoreLibraryItem=function(e){var t=Ha(cu(e.elements,null));return t.length?Qp(Qp({},e),{},{elements:t}):null},this.loadLibrary=function(){return new Promise(function(){var e=(0,d.Z)((function(e){var n,r;return qp(this,(function(o){if(t.libraryCache)return[2,e(JSON.parse(JSON.stringify(t.libraryCache)))];try{if(!(n=t.app.libraryItemsFromStorage))return[2,e([])];r=n.reduce((function(e,n){return t.restoreLibraryItem(n)&&e.push(n),e}),[]),t.libraryCache=JSON.parse(JSON.stringify(r)),e(r)}catch(t){console.error(t),e([])}return[2]}))}));return function(t){return e.apply(this,arguments)}}())},this.saveLibrary=function(){var e=(0,d.Z)((function(e){var n,r,o,i,a;return qp(this,(function(l){switch(l.label){case 0:n=t.libraryCache,l.label=1;case 1:return l.trys.push([1,3,,4]),i=JSON.stringify(e),t.libraryCache=JSON.parse(i),[4,null===(r=(o=t.app.props).onLibraryChange)||void 0===r?void 0:r.call(o,e)];case 2:return l.sent(),[3,4];case 3:throw a=l.sent(),t.libraryCache=n,a;case 4:return[2]}}))}));return function(t){return e.apply(this,arguments)}}(),this.app=e}return e.prototype.importLibrary=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unpublished";return(0,d.Z)((function(){var r,o,i,a,l,s,c,u,d,p;return qp(this,(function(f){switch(f.label){case 0:return[4,wu(e)];case 1:return(r=f.sent())&&(r.libraryItems||r.library)?(o=function(e,t){return!e.find((function(e){return e.elements.length===t.elements.length&&e.elements.every((function(e,n){return e.id===t.elements[n].id&&e.versionNonce===t.elements[n].versionNonce}))}))},[4,t.loadLibrary()]):[2];case 2:for(i=f.sent(),a=r.libraryItems||r.library||[],l=pu(a,n),s=[],c=0,u=l;c<u.length;c++)d=u[c],(p=t.restoreLibraryItem(d))&&o(i,p)&&s.push(p);return[4,t.saveLibrary(Xp(Xp([],s,!0),i,!0))];case 3:return f.sent(),[2]}}))}))()},e}();const ef=Jp;var tf=function(e){var t=Array.from(e.values());return{x:rf(t,(function(e){return e.x}))/t.length,y:rf(t,(function(e){return e.y}))/t.length}},nf=function(e){var t=e[0],n=e[1];return Math.hypot(t.x-n.x,t.y-n.y)},rf=function(e,t){return e.reduce((function(e,n){return e+t(n)}),0)};function of(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function af(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?of(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):of(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var lf=function(e){return{selectedElementIds:e.selectedElementIds,selectedGroupIds:e.selectedGroupIds,viewBackgroundColor:e.viewBackgroundColor,editingLinearElement:e.editingLinearElement,editingGroupId:e.editingGroupId,name:e.name}},sf=function(){function e(){var e=this;this.elementCache=new Map,this.recording=!0,this.stateHistory=[],this.redoStack=[],this.lastEntry=null,this.generateEntry=function(t,n){return e.dehydrateHistoryEntry({appState:lf(t),elements:n.reduce((function(e,n){if(De(n)&&t.multiElement&&t.multiElement.id===n.id){if(t.multiElement&&t.multiElement.id===n.id&&n.points.length<2)return e;e.push(af(af({},n),{},{points:n.lastCommittedPoint!==n.points[n.points.length-1]?n.points.slice(0,-1):n.points}))}else e.push(n);return e}),[])})}}return e.prototype.hydrateHistoryEntry=function(e){var t=this,n=e.appState,r=e.elements;return{appState:JSON.parse(n),elements:r.map((function(e){var n,r=null===(n=t.elementCache.get(e.id))||void 0===n?void 0:n.get(e.versionNonce);if(!r)throw new Error("Element not found: ".concat(e.id,":").concat(e.versionNonce));return r}))}},e.prototype.dehydrateHistoryEntry=function(e){var t=this,n=e.appState,r=e.elements;return{appState:JSON.stringify(n),elements:r.map((function(e){t.elementCache.has(e.id)||t.elementCache.set(e.id,new Map);var n=t.elementCache.get(e.id);return n.has(e.versionNonce)||n.set(e.versionNonce,wo(e)),{id:e.id,versionNonce:e.versionNonce}}))}},e.prototype.getSnapshotForTest=function(){var e=this;return{recording:this.recording,stateHistory:this.stateHistory.map((function(t){return e.hydrateHistoryEntry(t)})),redoStack:this.redoStack.map((function(t){return e.hydrateHistoryEntry(t)}))}},e.prototype.clear=function(){this.stateHistory.length=0,this.redoStack.length=0,this.lastEntry=null,this.elementCache.clear()},e.prototype.shouldCreateEntry=function(e){var t,n=this.lastEntry;if(!n)return!0;if(e.elements.length!==n.elements.length)return!0;for(var r=e.elements.length-1;r>-1;r--){var o=e.elements[r],i=n.elements[r];if(!o||!i||o.id!==i.id||o.versionNonce!==i.versionNonce)return!0}for(t in e.appState){var a,l;if("editingLinearElement"===t)if((null===(a=e.appState[t])||void 0===a?void 0:a.elementId)===(null===(l=n.appState[t])||void 0===l?void 0:l.elementId))continue;if("selectedElementIds"!==t&&"selectedGroupIds"!==t&&e.appState[t]!==n.appState[t])return!0}return!1},e.prototype.pushEntry=function(e,t){var n=this.generateEntry(e,t),r=this.hydrateHistoryEntry(n);if(r){if(!this.shouldCreateEntry(r))return;this.stateHistory.push(n),this.lastEntry=r,this.clearRedoStack()}},e.prototype.clearRedoStack=function(){this.redoStack.splice(0,this.redoStack.length)},e.prototype.redoOnce=function(){if(0===this.redoStack.length)return null;var e=this.redoStack.pop();return void 0!==e?(this.stateHistory.push(e),this.hydrateHistoryEntry(e)):null},e.prototype.undoOnce=function(){if(1===this.stateHistory.length)return null;var e=this.stateHistory.pop(),t=this.stateHistory[this.stateHistory.length-1];return void 0!==e?(this.redoStack.push(e),this.hydrateHistoryEntry(t)):null},e.prototype.setCurrentState=function(e,t){this.lastEntry=this.hydrateHistoryEntry(this.generateEntry(e,t))},e.prototype.resumeRecording=function(){this.recording=!0},e.prototype.record=function(e,t){this.recording&&(this.pushEntry(e,t),this.recording=!1)},e}();const cf=sf;var uf=[{icon:(0,E.jsx)("svg",{viewBox:"0 0 320 512",className:"",children:(0,E.jsx)("path",{d:"M302.189 329.126H196.105l55.831 135.993c3.889 9.428-.555 19.999-9.444 23.999l-49.165 21.427c-9.165 4-19.443-.571-23.332-9.714l-53.053-129.136-86.664 89.138C18.729 472.71 0 463.554 0 447.977V18.299C0 1.899 19.921-6.096 30.277 5.443l284.412 292.542c11.472 11.179 3.007 31.141-12.5 31.141z"})}),value:"selection",key:sn},{icon:(0,E.jsx)("svg",{viewBox:"0 0 448 512",children:(0,E.jsx)("path",{d:"M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48z"})}),value:"rectangle",key:on},{icon:(0,E.jsx)("svg",{viewBox:"0 0 223.646 223.646",children:(0,E.jsx)("path",{d:"M111.823 0L16.622 111.823 111.823 223.646 207.025 111.823z"})}),value:"diamond",key:$t},{icon:(0,E.jsx)("svg",{viewBox:"0 0 512 512",children:(0,E.jsx)("path",{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"})}),value:"ellipse",key:Qt},{icon:(0,E.jsx)("svg",{viewBox:"0 0 448 512",className:"rtl-mirror",children:(0,E.jsx)("path",{d:"M313.941 216H12c-6.627 0-12 5.373-12 12v56c0 6.627 5.373 12 12 12h301.941v46.059c0 21.382 25.851 32.09 40.971 16.971l86.059-86.059c9.373-9.373 9.373-24.569 0-33.941l-86.059-86.059c-15.119-15.119-40.971-4.411-40.971 16.971V216z"})}),value:"arrow",key:Xt},{icon:(0,E.jsx)("svg",{viewBox:"0 0 6 6",children:(0,E.jsx)("line",{x1:"0",y1:"3",x2:"6",y2:"3",stroke:"currentColor",strokeLinecap:"round"})}),value:"line",key:[nn,en]},{icon:(0,E.jsx)("svg",{viewBox:"0 0 512 512",children:(0,E.jsx)("path",{fill:"currentColor",d:"M290.74 93.24l128.02 128.02-277.99 277.99-114.14 12.6C11.35 513.54-1.56 500.62.14 485.34l12.7-114.22 277.9-277.88zm207.2-19.06l-60.11-60.11c-18.75-18.75-49.16-18.75-67.91 0l-56.55 56.55 128.02 128.02 56.55-56.55c18.75-18.76 18.75-49.16 0-67.91z"})}),value:"freedraw",key:cn},{icon:(0,E.jsx)("svg",{viewBox:"0 0 448 512",children:(0,E.jsx)("path",{d:"M432 416h-23.41L277.88 53.69A32 32 0 0 0 247.58 32h-47.16a32 32 0 0 0-30.3 21.69L39.41 416H16a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16h-19.58l23.3-64h152.56l23.3 64H304a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM176.85 272L224 142.51 271.15 272z"})}),value:"text",key:ln},{icon:(0,E.jsx)("svg",{viewBox:"0 0 512 512",children:(0,E.jsx)("path",{fill:"currentColor",d:"M464 64H48C21.49 64 0 85.49 0 112v288c0 26.51 21.49 48 48 48h416c26.51 0 48-21.49 48-48V112c0-26.51-21.49-48-48-48zm-6 336H54a6 6 0 0 1-6-6V118a6 6 0 0 1 6-6h404a6 6 0 0 1 6 6v276a6 6 0 0 1-6 6zM128 152c-22.091 0-40 17.909-40 40s17.909 40 40 40 40-17.909 40-40-17.909-40-40-40zM96 352h320v-80l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L192 304l-39.515-39.515c-4.686-4.686-12.284-4.686-16.971 0L96 304v48z"})}),value:"image",key:null}],df=(n(1292),{cut:[In("CtrlOrCmd+X")],copy:[In("CtrlOrCmd+C")],paste:[In("CtrlOrCmd+V")],copyStyles:[In("CtrlOrCmd+Alt+C")],pasteStyles:[In("CtrlOrCmd+Alt+V")],selectAll:[In("CtrlOrCmd+A")],deleteSelectedElements:[In("Del")],duplicateSelection:[In("CtrlOrCmd+D"),In("Alt+".concat(S("helpDialog.drag")))],sendBackward:[In("CtrlOrCmd+[")],bringForward:[In("CtrlOrCmd+]")],sendToBack:[In(ht?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")],bringToFront:[In(ht?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")],copyAsPng:[In("Shift+Alt+C")],copyAsSvg:[],group:[In("CtrlOrCmd+G")],ungroup:[In("CtrlOrCmd+Shift+G")],gridMode:[In("CtrlOrCmd+'")],zenMode:[In("Alt+Z")],stats:[In("Alt+/")],addToLibrary:[],flipHorizontal:[In("Shift+H")],flipVertical:[In("Shift+V")],viewMode:[In("Alt+R")]}),pf=function(e){var t=e.options,n=e.onCloseRequest,r=e.top,o=e.left,i=e.actionManager,a=e.appState;return(0,E.jsx)(tc,{onCloseRequest:n,top:r,left:o,fitInViewport:!0,children:(0,E.jsx)("ul",{className:"context-menu",onContextMenu:function(e){return e.preventDefault()},children:t.map((function(e,t){var r;if("separator"===e)return(0,E.jsx)("hr",{className:"context-menu-option-separator"},t);var o,l,s=e.name,c=e.contextItemLabel?S(e.contextItemLabel):"";return(0,E.jsx)("li",{"data-testid":s,onClick:n,children:(0,E.jsxs)("button",{className:Oe("context-menu-option",{dangerous:"deleteSelectedElements"===s,checkmark:null===(r=e.checked)||void 0===r?void 0:r.call(e,a)}),onClick:function(){return i.executeAction(e)},children:[(0,E.jsx)("div",{className:"context-menu-option__label",children:c}),(0,E.jsx)("kbd",{className:"context-menu-option__shortcut",children:s?(o=s,l=df[o],l&&l.length>0?l[0]:""):""})]})},t)}))})})},ff=new WeakMap;const hf=function(e){var t,n,r=Array.of();e.options.forEach((function(e){e&&r.push(e)})),r.length&&(0,ft.render)((0,E.jsx)(pf,{top:e.top,left:e.left,options:r,onCloseRequest:function(){return t=e.container,void((n=ff.get(t))&&((0,ft.unmountComponentAtNode)(n),n.remove(),ff.delete(t)));var t,n},actionManager:e.actionManager,appState:e.appState}),(t=e.container,(n=ff.get(t))||(n=document.createElement("div"),t.querySelector(".excalidraw-contextMenuContainer").appendChild(n),ff.set(t,n),n)))};var gf=function(e){for(var t,n=e.appState,r=e.elements,o=e.renderAction,i=e.elementType,a=Ka(Ha(r),n),l=Boolean(n.editingElement),s=Yh(),c="rtl"===document.documentElement.getAttribute("dir"),u=qa(i)||a.some((function(e){return qa(e.type)&&!Nn(e.backgroundColor)})),d=qa(i)||a.some((function(e){return qa(e.type)})),p=(null===(t=a[0])||void 0===t?void 0:t.type)||null,f=0,h=a;f<h.length;f++){if(h[f].type!==p){p=null;break}}return(0,E.jsxs)("div",{className:"panelColumn",children:[(Xa(i)&&"image"!==i&&"image"!==p||a.some((function(e){return Xa(e.type)})))&&o("changeStrokeColor"),d&&o("changeBackgroundColor"),u&&o("changeFillStyle"),($a(i)||a.some((function(e){return $a(e.type)})))&&o("changeStrokeWidth"),("freedraw"===i||a.some((function(e){return"freedraw"===e.type})))&&o("changeStrokeShape"),(Qa(i)||a.some((function(e){return Qa(e.type)})))&&(0,E.jsxs)(E.Fragment,{children:[o("changeStrokeStyle"),o("changeSloppiness")]}),(Ja(i)||a.some((function(e){return Ja(e.type)})))&&(0,E.jsx)(E.Fragment,{children:o("changeSharpness")}),(el(i)||a.some((function(e){return el(e.type)})))&&(0,E.jsxs)(E.Fragment,{children:[o("changeFontSize"),o("changeFontFamily"),o("changeTextAlign")]}),(tl(i)||a.some((function(e){return tl(e.type)})))&&(0,E.jsx)(E.Fragment,{children:o("changeArrowhead")}),o("changeOpacity"),(0,E.jsxs)("fieldset",{children:[(0,E.jsx)("legend",{children:S("labels.layers")}),(0,E.jsxs)("div",{className:"buttonList",children:[o("sendToBack"),o("sendBackward"),o("bringToFront"),o("bringForward")]})]}),a.length>1&&(0,E.jsxs)("fieldset",{children:[(0,E.jsx)("legend",{children:S("labels.align")}),(0,E.jsxs)("div",{className:"buttonList",children:[c?(0,E.jsxs)(E.Fragment,{children:[o("alignRight"),o("alignHorizontallyCentered"),o("alignLeft")]}):(0,E.jsxs)(E.Fragment,{children:[o("alignLeft"),o("alignHorizontallyCentered"),o("alignRight")]}),a.length>2&&o("distributeHorizontally"),(0,E.jsxs)("div",{className:"iconRow",children:[o("alignTop"),o("alignVerticallyCentered"),o("alignBottom"),a.length>2&&o("distributeVertically")]})]})]}),!s&&!l&&a.length>0&&(0,E.jsxs)("fieldset",{children:[(0,E.jsx)("legend",{children:S("labels.actions")}),(0,E.jsxs)("div",{className:"buttonList",children:[o("duplicateSelection"),o("deleteSelectedElements"),o("group"),o("ungroup")]})]})]})},mf=function(e){var t=e.canvas,n=e.elementType,r=e.setAppState,o=e.onImageAction;return(0,E.jsx)(E.Fragment,{children:uf.map((function(e,i){var a=e.value,l=e.icon,s=e.key,c=S("toolBar.".concat(a)),u=s&&("string"==typeof s?s:s[0]),d=u?"".concat(bn(u)," ").concat(S("helpDialog.or")," ").concat(i+1):"".concat(i+1);return(0,E.jsx)(ul,{className:"Shape",type:"radio",icon:l,checked:n===a,name:"editor-current-shape",title:"".concat(bn(c)," — ").concat(d),keyBindingLabel:"".concat(i+1),"aria-label":bn(c),"aria-keyshortcuts":d,"data-testid":a,onChange:function(e){var n=e.pointerType;r({elementType:a,multiElement:null,selectedElementIds:{}}),Cn(t,a),"image"===a&&o({pointerType:n})}},a)}))})},vf=function(e){var t=e.renderAction;e.zoom;return(0,E.jsx)(Ld,{gap:1,children:(0,E.jsxs)(Td,{gap:1,align:"center",children:[t("zoomOut"),t("zoomIn"),t("resetZoom")]})})},bf=function(e){e.appState,e.setAppState;var t=e.actionManager,n=e.showThemeBtn;return(0,E.jsxs)("div",{style:{display:"flex"},children:[t.renderAction("changeViewBackgroundColor"),n&&t.renderAction("toggleTheme")]})};n(778);const yf=function(e){var t=e.isCollaborating,n=(e.collaboratorCount,e.onClick);return(0,E.jsx)(E.Fragment,{children:(0,E.jsx)(ul,{className:Oe("CollabButton",{"is-collaborating":t}),onClick:n,icon:Gl,type:"button",title:S("labels.liveCollaboration"),"aria-label":S("labels.liveCollaboration"),showAriaLabel:Yh()})})};var xf=function(e){var t=e.message,n=e.onClose,r=(0,l.useState)(!!t),o=r[0],i=r[1],a=Xh().container,c=s().useCallback((function(){i(!1),n&&n(),null==a||a.focus()}),[n,a]);return(0,E.jsx)(E.Fragment,{children:o&&(0,E.jsx)(Ec,{small:!0,onCloseRequest:c,title:S("errorDialog.title"),children:(0,E.jsx)("div",{style:{whiteSpace:"pre-wrap"},children:t})})})},wf=(n(2205),"filter"in document.createElement("canvas").getContext("2d")),kf=function(){return(0,E.jsxs)("div",{children:[(0,E.jsx)("h3",{children:S("canvasError.cannotShowPreview")}),(0,E.jsx)("p",{children:(0,E.jsx)("span",{children:S("canvasError.canvasTooBig")})}),(0,E.jsxs)("em",{children:["(",S("canvasError.canvasTooBigTip"),")"]})]})},Sf=function(e,t){(0,ft.unmountComponentAtNode)(t),t.innerHTML="",e instanceof HTMLCanvasElement?t.appendChild(e):(0,ft.render)((0,E.jsx)(kf,{}),t)},Ef=function(e){var t,n=e.children,r=e.title,o=e.onClick,i=e.color,a=e.shade,l=void 0===a?6:a;return(0,E.jsx)("button",{className:"ExportDialog-imageExportButton",style:(t={},t["--button-color"]=ct[i][l],t["--button-color-darker"]=ct[i][l+1],t["--button-color-darkest"]=ct[i][l+2],t),title:r,"aria-label":r,onClick:o,children:n})},jf=function(e){var t=e.elements,n=e.appState,r=e.files,o=e.exportPadding,i=void 0===o?c.qy:o,a=e.actionManager,s=e.onExportToPng,u=e.onExportToSvg,d=e.onExportToClipboard,p=Ga(t,n),f=(0,l.useState)(p),h=f[0],g=f[1],m=(0,l.useRef)(null),v=n.exportBackground,b=n.viewBackgroundColor,y=h?Wa(t,n):t;return(0,l.useEffect)((function(){g(p)}),[p]),(0,l.useEffect)((function(){var e=m.current;e&&Gu(y,n,r,{exportBackground:v,viewBackgroundColor:b,exportPadding:i}).then((function(t){return ku(t).then((function(){Sf(t,e)}))})).catch((function(t){console.error(t),Sf(new al,e)}))}),[n,r,y,v,i,b]),(0,E.jsxs)("div",{className:"ExportDialog",children:[(0,E.jsx)("div",{className:"ExportDialog__preview",ref:m}),wf&&a.renderAction("exportWithDarkMode"),(0,E.jsx)("div",{style:{display:"grid",gridTemplateColumns:"1fr"},children:(0,E.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(190px, 1fr))",overflow:"hidden"},children:[a.renderAction("changeExportBackground"),p&&(0,E.jsx)(Id,{checked:h,onChange:function(e){return g(e)},children:S("labels.onlySelected")}),a.renderAction("changeExportEmbedScene")]})}),(0,E.jsxs)("div",{style:{display:"flex",alignItems:"center",marginTop:".6em"},children:[(0,E.jsx)(Td,{gap:2,children:a.renderAction("changeExportScale")}),(0,E.jsx)("p",{style:{marginLeft:"1em",userSelect:"none"},children:"Scale"})]}),(0,E.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",margin:".6em 0"},children:!Qc&&a.renderAction("changeProjectName")}),(0,E.jsxs)(Td,{gap:2,justifyContent:"center",style:{margin:"2em 0"},children:[(0,E.jsx)(Ef,{color:"indigo",title:S("buttons.exportToPng"),"aria-label":S("buttons.exportToPng"),onClick:function(){return s(y)},children:"PNG"}),(0,E.jsx)(Ef,{color:"red",title:S("buttons.exportToSvg"),"aria-label":S("buttons.exportToSvg"),onClick:function(){return u(y)},children:"SVG"}),hd&&(0,E.jsx)(Ef,{title:S("buttons.copyPngToClipboard"),onClick:function(){return d(y)},color:"gray",shade:7,children:xl})]})]})},_f=function(e){var t=e.elements,n=e.appState,r=e.files,o=e.exportPadding,i=void 0===o?c.qy:o,a=e.actionManager,u=e.onExportToPng,d=e.onExportToSvg,p=e.onExportToClipboard,f=(0,l.useState)(!1),h=f[0],g=f[1],m=s().useCallback((function(){g(!1)}),[]);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(ul,{onClick:function(){g(!0)},"data-testid":"image-export-button",icon:Sl,type:"button","aria-label":S("buttons.exportImage"),showAriaLabel:Yh(),title:S("buttons.exportImage")}),h&&(0,E.jsx)(Ec,{onCloseRequest:m,title:S("buttons.exportImage"),children:(0,E.jsx)(jf,{elements:t,appState:n,files:r,exportPadding:i,actionManager:a,onExportToPng:u,onExportToSvg:d,onExportToClipboard:p,onCloseRequest:m})})]})},Cf=(n(1310),function(e){var t=e.children,n=e.side,r=e.className;return(0,E.jsx)("div",{className:Oe("FixedSideContainer","FixedSideContainer_side_".concat(n),r),children:t})}),Of=(n(7096),function(e){var t=function(e){var t=e.appState,n=e.elements,r=e.isMobile,o=t.elementType,i=t.isResizing,a=t.isRotating,l=t.lastPointerDownWith,s=null!==t.multiElement;if("arrow"===o||"line"===o)return S(s?"hints.linearElementMulti":"hints.linearElement");if("freedraw"===o)return S("hints.freeDraw");if("text"===o)return S("hints.text");if("image"===t.elementType&&t.pendingImageElement)return S("hints.placeImage");var c=Wa(n,t);if(i&&"mouse"===l&&1===c.length){var u=c[0];return De(u)&&2===u.points.length?S("hints.lockAngle"):Pe(u)?S("hints.resizeImage"):S("hints.resize")}return a&&"mouse"===l?S("hints.rotate"):1===c.length&&De(c[0])?t.editingLinearElement?t.editingLinearElement.activePointIndex?S("hints.lineEditor_pointSelected"):S("hints.lineEditor_nothingSelected"):S("hints.lineEditor_info"):1===c.length&&Te(c[0])?S("hints.text_selected"):t.editingElement&&Te(t.editingElement)?S("hints.text_editing"):"selection"!==o||c.length||r?null:S("hints.canvasPanning")}({appState:e.appState,elements:e.elements,isMobile:e.isMobile});return t?(t=In(t),(0,E.jsx)("div",{className:"HintViewer",children:(0,E.jsx)("span",{children:t})})):null}),If=(n(3336),{CHECKED:(0,E.jsx)("svg",{width:"1792",height:"1792",viewBox:"0 0 1792 1792",xmlns:"http://www.w3.org/2000/svg",children:(0,E.jsx)("path",{d:"M640 768h512v-192q0-106-75-181t-181-75-181 75-75 181v192zm832 96v576q0 40-28 68t-68 28h-960q-40 0-68-28t-28-68v-576q0-40 28-68t68-28h32v-192q0-184 132-316t316-132 316 132 132 316v192h32q40 0 68 28t28 68z"})}),UNCHECKED:(0,E.jsx)("svg",{width:"1792",height:"1792",viewBox:"0 0 1792 1792",xmlns:"http://www.w3.org/2000/svg",className:"unlocked-icon rtl-mirror",children:(0,E.jsx)("path",{d:"M1728 576v256q0 26-19 45t-45 19h-64q-26 0-45-19t-19-45v-256q0-106-75-181t-181-75-181 75-75 181v192h96q40 0 68 28t28 68v576q0 40-28 68t-68 28h-960q-40 0-68-28t-28-68v-576q0-40 28-68t68-28h672v-192q0-185 131.5-316.5t316.5-131.5 316.5 131.5 131.5 316.5z"})})}),Mf=function(e){return(0,E.jsxs)("label",{className:Oe("ToolIcon ToolIcon__lock ToolIcon_type_floating zen-mode-visibility","ToolIcon_size_".concat("medium"),{"zen-mode-visibility--hidden":e.zenModeEnabled}),title:"".concat(e.title," — Q"),children:[(0,E.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title}),(0,E.jsx)("div",{className:"ToolIcon__icon",children:e.checked?If.CHECKED:If.UNCHECKED})]})},Pf=["heading","children"];function Tf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Lf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Tf(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Af=function(e){var t=e.heading,n=e.children,r=Jr(e,Pf),o=Xh().id,i=(0,E.jsx)("h2",{className:"visually-hidden",id:"".concat(o,"-").concat(t,"-title"),children:S("headings.".concat(t))});return(0,E.jsx)("section",Lf(Lf({},r),{},{"aria-labelledby":"".concat(o,"-").concat(t,"-title"),children:"function"==typeof n?n(i):(0,E.jsxs)(E.Fragment,{children:[i,n]})}))},Df=(n(580),s().memo((function(e){var t,n=e.className,r=e.mobile,o=e.collaborators,i=void 0===o?new Map:o,a=e.layout,l=e.actionManager,s="vertical"===a?6:3,c=i.size>s?-2*Math.min(i.size-s,15):4;return(0,E.jsx)("div",{className:Oe("UserList layout-".concat(a),n,{UserList_mobile:r}),style:(t={},t["--itemOffset"]="".concat(c,"px"),t),children:i.size>0&&Array.from(i).filter((function(e){e[0];var t=e[1];return 0!==Object.keys(t).length})).map((function(e){var t=e[0],n=e[1];return r?l.renderAction("goToCollaborator",{id:t}):(0,E.jsx)(bc,{label:n.username||"Unknown user",children:l.renderAction("goToCollaborator",{id:t})},t)}))})}))),zf=(0,E.jsx)("svg",{viewBox:"0 0 576 512",children:(0,E.jsx)("path",{fill:"currentColor",d:"M542.22 32.05c-54.8 3.11-163.72 14.43-230.96 55.59-4.64 2.84-7.27 7.89-7.27 13.17v363.87c0 11.55 12.63 18.85 23.28 13.49 69.18-34.82 169.23-44.32 218.7-46.92 16.89-.89 30.02-14.43 30.02-30.66V62.75c.01-17.71-15.35-31.74-33.77-30.7zM264.73 87.64C197.5 46.48 88.58 35.17 33.78 32.05 15.36 31.01 0 45.04 0 62.75V400.6c0 16.24 13.13 29.78 30.02 30.66 49.49 2.6 149.59 12.11 218.77 46.95 10.62 5.35 23.21-1.94 23.21-13.46V100.63c0-5.29-2.62-10.14-7.27-12.99z"})}),Nf=function(e){var t=e.appState,n=e.setAppState;return(0,E.jsxs)("label",{className:Oe("ToolIcon ToolIcon_type_floating ToolIcon__library zen-mode-visibility","ToolIcon_size_medium",{"zen-mode-visibility--hidden":t.zenModeEnabled}),title:"".concat(bn(S("toolBar.library"))," — 0"),style:{marginInlineStart:"var(--space-factor)"},children:[(0,E.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:"editor-library",onChange:function(e){n({isLibraryOpen:e.target.checked})},checked:t.isLibraryOpen,"aria-label":bn(S("toolBar.library")),"aria-keyshortcuts":"0"}),(0,E.jsx)("div",{className:"ToolIcon__icon",children:zf})]})};function Hf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Rf=function(e){var t=e.onHomeButtonClick,n=e.appState,r=e.elements,o=e.libraryMenu,i=e.actionManager,a=e.renderJSONExportDialog,l=e.renderImageExportDialog,s=e.setAppState,c=e.onCollabButtonClick,u=e.onLockToggle,d=e.canvas,p=e.isCollaborating,f=e.renderCustomFooter,h=e.viewModeEnabled,g=e.showThemeBtn,m=e.onImageAction,v=e.renderTopRightUI,b=e.UIOptions;return(0,E.jsxs)(E.Fragment,{children:[!h&&(0,E.jsxs)(Cf,{side:"top",className:"App-top-bar",children:[(0,E.jsx)(Af,{heading:"shapes",children:function(e){return(0,E.jsxs)(Ld,{gap:4,align:"center",children:[(0,E.jsxs)(Td,{gap:1,children:[(0,E.jsxs)(wc,{padding:1,children:[e,(0,E.jsx)(Td,{gap:1,children:(0,E.jsx)(mf,{canvas:d,elementType:n.elementType,setAppState:s,onImageAction:function(e){var t=e.pointerType;m({insertOnCanvasDirectly:"mouse"!==t})}})})]}),v&&v(!0,n),(0,E.jsx)(ul,{type:"button",className:"HomeButton ToolIcon_type_floating",title:"Home","aria-label":"Home",icon:js,onClick:t},"home"),(0,E.jsx)(Mf,{checked:n.elementLocked,onChange:u,title:S("toolBar.lock")}),(0,E.jsx)(Nf,{appState:n,setAppState:s})]}),o]})}}),(0,E.jsx)(Of,{appState:n,elements:r,isMobile:!0})]}),(0,E.jsx)("div",{className:"App-bottom-bar",style:{marginBottom:14,marginLeft:14,marginRight:14},children:(0,E.jsxs)(wc,{padding:0,children:[b.canvasActions&&"canvas"===n.openMenu?(0,E.jsx)(Af,{className:"App-mobile-menu",heading:"canvasActions",children:(0,E.jsx)("div",{className:"panelColumn",children:(0,E.jsxs)(Ld,{gap:4,children:[h?(0,E.jsxs)(E.Fragment,{children:[a(),l()]}):(0,E.jsxs)(E.Fragment,{children:[i.renderAction("clearCanvas"),i.renderAction("loadScene"),a(),l(),c&&(0,E.jsx)(yf,{isCollaborating:p,collaboratorCount:n.collaborators.size,onClick:c}),(0,E.jsx)(bf,{actionManager:i,appState:n,setAppState:s,showThemeBtn:g})]}),null==f?void 0:f(!0,n),n.collaborators.size>0&&(0,E.jsxs)("fieldset",{children:[(0,E.jsx)("legend",{children:S("labels.collaborators")}),(0,E.jsx)(Df,{mobile:!0,layout:"horizontal",collaborators:n.collaborators,actionManager:i})]})]})})}):"shape"===n.openMenu&&!h&&La(n,r)?(0,E.jsx)(Af,{className:"App-mobile-menu",heading:"selectedShapeActions",children:(0,E.jsx)(gf,{appState:n,elements:r,renderAction:i.renderAction,elementType:n.elementType})}):null,(0,E.jsxs)("footer",{className:"App-toolbar",children:[h?b.canvasActions?(0,E.jsx)("div",{className:"App-toolbar-content",children:i.renderAction("toggleCanvasMenu")}):(0,E.jsx)("div",{children:"Excalidraw"}):(0,E.jsxs)("div",{className:"App-toolbar-content",children:[b.canvasActions&&i.renderAction("toggleCanvasMenu"),i.renderAction("toggleEditMenu"),i.renderAction("undo"),i.renderAction("redo"),i.renderAction(n.multiElement?"finalize":"duplicateSelection"),i.renderAction("deleteSelectedElements")]}),n.scrolledOutside&&!n.openMenu&&(0,E.jsx)("button",{className:"scroll-back-to-content",onClick:function(){s(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hf(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},Ya(r,n)))},children:S("buttons.scrollBackToContent")})]})]})})]})},Bf=(n(8051),function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}),Ff=function(e){var t=(0,l.useRef)(null),n=(0,l.useState)(null),r=n[0],o=n[1];return(0,l.useLayoutEffect)((function(){if(e.spreadsheet){var n,r=sd(e.chartType,e.spreadsheet,0,0);o(r);var i=t.current;return(0,d.Z)((function(){return Bf(this,(function(t){switch(t.label){case 0:return[4,Wu(r,{exportBackground:!1,viewBackgroundColor:ct.white},null)];case 1:return n=t.sent(),i.appendChild(n),e.selected&&i.parentNode.focus(),[2]}}))}))(),function(){i.removeChild(n)}}}),[e.spreadsheet,e.chartType,e.selected]),(0,E.jsx)("button",{className:"ChartPreview",onClick:function(){r&&e.onClick(e.chartType,r)},children:(0,E.jsx)("div",{ref:t})})},Uf=function(e){var t=e.setAppState,n=e.appState,r=e.onClose,o=e.onInsertChart,i=s().useCallback((function(){r&&r()}),[r]),a=function(e,n){o(n),Rc("magic","chart",e),t({currentChartType:e,pasteDialog:{shown:!1,data:null}})};return(0,E.jsx)(Ec,{small:!0,onCloseRequest:i,title:S("labels.pasteCharts"),className:"PasteChartDialog",autofocus:!1,children:(0,E.jsxs)("div",{className:"container",children:[(0,E.jsx)(Ff,{chartType:"bar",spreadsheet:n.pasteDialog.data,selected:"bar"===n.currentChartType,onClick:a}),(0,E.jsx)(Ff,{chartType:"line",spreadsheet:n.pasteDialog.data,selected:"line"===n.currentChartType,onClick:a})]})})};n(3922);function Vf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Gf=function(){return(0,E.jsxs)("div",{className:"HelpDialog--header",children:[(0,E.jsx)("a",{className:"HelpDialog--btn",href:"https://github.com/excalidraw/excalidraw#documentation",target:"_blank",rel:"noopener noreferrer",children:S("helpDialog.documentation")}),(0,E.jsx)("a",{className:"HelpDialog--btn",href:"https://blog.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:S("helpDialog.blog")}),(0,E.jsx)("a",{className:"HelpDialog--btn",href:"https://github.com/excalidraw/excalidraw/issues",target:"_blank",rel:"noopener noreferrer",children:S("helpDialog.github")})]})},Wf=function(e){return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("h3",{children:e.title}),e.children]})},Kf=function(e){return(0,E.jsx)("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"space-between"},children:e.children})},Zf=function(e){return(0,E.jsx)("div",{style:{width:"49%"},children:e.children})},Yf=function(e){return(0,E.jsxs)("div",{className:"HelpDialog--island",children:[(0,E.jsx)("h3",{className:"HelpDialog--island-title",children:e.caption}),e.children]})},qf=function(e){return(0,E.jsx)("div",{className:"HelpDialog--shortcut",children:(0,E.jsxs)("div",{style:{display:"flex",margin:"0",padding:"4px 8px",alignItems:"center"},children:[(0,E.jsx)("div",{style:{lineHeight:1.4},children:e.label}),(0,E.jsx)("div",{style:{display:"flex",flex:"0 0 auto",justifyContent:"flex-end",marginInlineStart:"auto",minWidth:"30%"},children:e.shortcuts.map((function(t,n){return(0,E.jsxs)(s().Fragment,{children:[(0,E.jsx)(Xf,{children:t}),e.isOr&&n!==e.shortcuts.length-1&&S("helpDialog.or")]},n)}))})]})})};qf.defaultProps={isOr:!0};var Xf=function(e){return(0,E.jsx)("kbd",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vf(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({className:"HelpDialog--key"},e))},$f=function(e){var t=e.onClose,n=s().useCallback((function(){t&&t()}),[t]);return(0,E.jsx)(E.Fragment,{children:(0,E.jsxs)(Ec,{onCloseRequest:n,title:S("helpDialog.title"),className:"HelpDialog",children:[(0,E.jsx)(Gf,{}),(0,E.jsx)(Wf,{title:S("helpDialog.shortcuts"),children:(0,E.jsxs)(Kf,{children:[(0,E.jsxs)(Zf,{children:[(0,E.jsxs)(Yf,{caption:S("helpDialog.shapes"),children:[(0,E.jsx)(qf,{label:S("toolBar.selection"),shortcuts:["V","1"]}),(0,E.jsx)(qf,{label:S("toolBar.rectangle"),shortcuts:["R","2"]}),(0,E.jsx)(qf,{label:S("toolBar.diamond"),shortcuts:["D","3"]}),(0,E.jsx)(qf,{label:S("toolBar.ellipse"),shortcuts:["E","4"]}),(0,E.jsx)(qf,{label:S("toolBar.arrow"),shortcuts:["A","5"]}),(0,E.jsx)(qf,{label:S("toolBar.line"),shortcuts:["P","6"]}),(0,E.jsx)(qf,{label:S("toolBar.freedraw"),shortcuts:["Shift+P","7"]}),(0,E.jsx)(qf,{label:S("toolBar.text"),shortcuts:["T","8"]}),(0,E.jsx)(qf,{label:S("toolBar.image"),shortcuts:["9"]}),(0,E.jsx)(qf,{label:S("toolBar.library"),shortcuts:["0"]}),(0,E.jsx)(qf,{label:S("helpDialog.editSelectedShape"),shortcuts:[In("Enter"),S("helpDialog.doubleClick")]}),(0,E.jsx)(qf,{label:S("helpDialog.textNewLine"),shortcuts:[In("Enter"),In("Shift+Enter")]}),(0,E.jsx)(qf,{label:S("helpDialog.textFinish"),shortcuts:[In("Esc"),In("CtrlOrCmd+Enter")]}),(0,E.jsx)(qf,{label:S("helpDialog.curvedArrow"),shortcuts:["A",S("helpDialog.click"),S("helpDialog.click"),S("helpDialog.click")],isOr:!1}),(0,E.jsx)(qf,{label:S("helpDialog.curvedLine"),shortcuts:["L",S("helpDialog.click"),S("helpDialog.click"),S("helpDialog.click")],isOr:!1}),(0,E.jsx)(qf,{label:S("toolBar.lock"),shortcuts:["Q"]}),(0,E.jsx)(qf,{label:S("helpDialog.preventBinding"),shortcuts:[In("CtrlOrCmd")]})]}),(0,E.jsxs)(Yf,{caption:S("helpDialog.view"),children:[(0,E.jsx)(qf,{label:S("buttons.zoomIn"),shortcuts:[In("CtrlOrCmd++")]}),(0,E.jsx)(qf,{label:S("buttons.zoomOut"),shortcuts:[In("CtrlOrCmd+-")]}),(0,E.jsx)(qf,{label:S("buttons.resetZoom"),shortcuts:[In("CtrlOrCmd+0")]}),(0,E.jsx)(qf,{label:S("helpDialog.zoomToFit"),shortcuts:["Shift+1"]}),(0,E.jsx)(qf,{label:S("helpDialog.zoomToSelection"),shortcuts:["Shift+2"]}),(0,E.jsx)(qf,{label:S("buttons.fullScreen"),shortcuts:["F"]}),(0,E.jsx)(qf,{label:S("buttons.zenMode"),shortcuts:[In("Alt+Z")]}),(0,E.jsx)(qf,{label:S("labels.showGrid"),shortcuts:[In("CtrlOrCmd+'")]}),(0,E.jsx)(qf,{label:S("labels.viewMode"),shortcuts:[In("Alt+R")]}),(0,E.jsx)(qf,{label:S("labels.toggleTheme"),shortcuts:[In("Alt+Shift+D")]}),(0,E.jsx)(qf,{label:S("stats.title"),shortcuts:[In("Alt+/")]})]})]}),(0,E.jsx)(Zf,{children:(0,E.jsxs)(Yf,{caption:S("helpDialog.editor"),children:[(0,E.jsx)(qf,{label:S("labels.selectAll"),shortcuts:[In("CtrlOrCmd+A")]}),(0,E.jsx)(qf,{label:S("labels.multiSelect"),shortcuts:[In("Shift+".concat(S("helpDialog.click")))]}),(0,E.jsx)(qf,{label:S("labels.moveCanvas"),shortcuts:[In("Space+".concat(S("helpDialog.drag"))),In("Wheel+".concat(S("helpDialog.drag")))],isOr:!0}),(0,E.jsx)(qf,{label:S("labels.cut"),shortcuts:[In("CtrlOrCmd+X")]}),(0,E.jsx)(qf,{label:S("labels.copy"),shortcuts:[In("CtrlOrCmd+C")]}),(0,E.jsx)(qf,{label:S("labels.paste"),shortcuts:[In("CtrlOrCmd+V")]}),(0,E.jsx)(qf,{label:S("labels.copyAsPng"),shortcuts:[In("Shift+Alt+C")]}),(0,E.jsx)(qf,{label:S("labels.copyStyles"),shortcuts:[In("CtrlOrCmd+Alt+C")]}),(0,E.jsx)(qf,{label:S("labels.pasteStyles"),shortcuts:[In("CtrlOrCmd+Alt+V")]}),(0,E.jsx)(qf,{label:S("labels.delete"),shortcuts:[In("Del")]}),(0,E.jsx)(qf,{label:S("labels.sendToBack"),shortcuts:[In(ht?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")]}),(0,E.jsx)(qf,{label:S("labels.bringToFront"),shortcuts:[In(ht?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")]}),(0,E.jsx)(qf,{label:S("labels.sendBackward"),shortcuts:[In("CtrlOrCmd+[")]}),(0,E.jsx)(qf,{label:S("labels.bringForward"),shortcuts:[In("CtrlOrCmd+]")]}),(0,E.jsx)(qf,{label:S("labels.alignTop"),shortcuts:[In("CtrlOrCmd+Shift+Up")]}),(0,E.jsx)(qf,{label:S("labels.alignBottom"),shortcuts:[In("CtrlOrCmd+Shift+Down")]}),(0,E.jsx)(qf,{label:S("labels.alignLeft"),shortcuts:[In("CtrlOrCmd+Shift+Left")]}),(0,E.jsx)(qf,{label:S("labels.alignRight"),shortcuts:[In("CtrlOrCmd+Shift+Right")]}),(0,E.jsx)(qf,{label:S("labels.duplicateSelection"),shortcuts:[In("CtrlOrCmd+D"),In("Alt+".concat(S("helpDialog.drag")))]}),(0,E.jsx)(qf,{label:S("buttons.undo"),shortcuts:[In("CtrlOrCmd+Z")]}),(0,E.jsx)(qf,{label:S("buttons.redo"),shortcuts:gt?[In("CtrlOrCmd+Y"),In("CtrlOrCmd+Shift+Z")]:[In("CtrlOrCmd+Shift+Z")]}),(0,E.jsx)(qf,{label:S("labels.group"),shortcuts:[In("CtrlOrCmd+G")]}),(0,E.jsx)(qf,{label:S("labels.ungroup"),shortcuts:[In("CtrlOrCmd+Shift+G")]}),(0,E.jsx)(qf,{label:S("labels.flipHorizontal"),shortcuts:[In("Shift+H")]}),(0,E.jsx)(qf,{label:S("labels.flipVertical"),shortcuts:[In("Shift+V")]}),(0,E.jsx)(qf,{label:S("labels.showStroke"),shortcuts:[In("S")]}),(0,E.jsx)(qf,{label:S("labels.showBackground"),shortcuts:[In("G")]})]})})]})})]})})},Qf=(n(5080),function(e){var t,n=e.children,r=e.color;return(0,E.jsx)("div",{className:"Card",style:(t={},t["--card-color"]=ct[r][7],t["--card-color-darker"]=ct[r][8],t["--card-color-darkest"]=ct[r][9],t),children:n})}),Jf=function(e){var t=e.elements,n=e.appState,r=e.files,o=e.actionManager,i=e.exportOpts,a=e.canvas,l=i.onExportToBackend;return(0,E.jsx)("div",{className:"ExportDialog ExportDialog--json",children:(0,E.jsxs)("div",{className:"ExportDialog-cards",children:[i.saveFileToDisk&&(0,E.jsxs)(Qf,{color:"lime",children:[(0,E.jsx)("div",{className:"Card-icon",children:El}),(0,E.jsx)("h2",{children:S("exportDialog.disk_title")}),(0,E.jsxs)("div",{className:"Card-details",children:[S("exportDialog.disk_details"),!Qc&&o.renderAction("changeProjectName")]}),(0,E.jsx)(ul,{className:"Card-button",type:"button",title:S("exportDialog.disk_button"),"aria-label":S("exportDialog.disk_button"),showAriaLabel:!0,onClick:function(){o.executeAction(Fd)}})]}),l&&(0,E.jsxs)(Qf,{color:"pink",children:[(0,E.jsx)("div",{className:"Card-icon",children:ml}),(0,E.jsx)("h2",{children:S("exportDialog.link_title")}),(0,E.jsx)("div",{className:"Card-details",children:S("exportDialog.link_details")}),(0,E.jsx)(ul,{className:"Card-button",type:"button",title:S("exportDialog.link_button"),"aria-label":S("exportDialog.link_button"),showAriaLabel:!0,onClick:function(){return l(t,n,r,a)}})]}),i.renderCustomUI&&i.renderCustomUI(t,n,r,a)]})})},eh=function(e){var t=e.elements,n=e.appState,r=e.files,o=e.actionManager,i=e.exportOpts,a=e.canvas,c=(0,l.useState)(!1),u=c[0],d=c[1],p=s().useCallback((function(){d(!1)}),[]);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(ul,{onClick:function(){"function"==typeof i?o.executeAction(Fd):d(!0)},"data-testid":"json-export-button",icon:El,type:"button","aria-label":S("buttons.export"),showAriaLabel:Yh(),title:S("buttons.export")}),u&&i&&"function"!=typeof i&&(0,E.jsx)(Ec,{onCloseRequest:p,title:S("buttons.export"),children:(0,E.jsx)(Jf,{elements:t,appState:n,files:r,actionManager:o,onCloseRequest:p,exportOpts:i,canvas:a})})]})},th=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}};function nh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nh(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var oh=function(e){var t=e.elements,n=e.appState,r=e.files,o=e.maxWidthOrHeight,i=e.getDimensions,a=du({elements:t,appState:n},null,null),l=a.elements,s=a.appState,c=s.exportBackground,u=s.viewBackgroundColor;return Gu(Ha(l),rh(rh({},s),{},{offsetTop:0,offsetLeft:0,width:0,height:0}),r||{},{exportBackground:c,viewBackgroundColor:u},(function(e,t){var n,r=document.createElement("canvas");if(o){"function"==typeof i&&console.warn("`getDimensions()` is ignored when `maxWidthOrHeight` is supplied.");var a=Math.max(e,t),l=o/a;return r.width=e*l,r.height=t*l,{canvas:r,scale:l}}var s=(null==i?void 0:i(e,t))||{width:e,height:t};return r.width=s.width,r.height=s.height,{canvas:r,scale:null!==(n=s.scale)&&void 0!==n?n:1}}))},ih=function(){var e=(0,d.Z)((function(e){var t,n,r,o;return th(this,(function(i){switch(i.label){case 0:return[4,oh(e)];case 1:return t=i.sent(),n=e.mimeType,r=void 0===n?c.LO.png:n,o=e.quality,r===c.LO.png&&"number"==typeof o&&console.warn('"quality" will be ignored for "'.concat(c.LO.png,'" mimeType')),"image/jpg"===r&&(r=c.LO.jpg),o=o||(/image\/jpe?g/.test(r)?.92:.8),[2,new Promise((function(e){t.toBlob((function(t){e(t)}),r,o)}))]}}))}));return function(t){return e.apply(this,arguments)}}(),ah=function(){var e=(0,d.Z)((function(e){var t,n,r,o,i,a,l,s,c;return th(this,(function(u){return t=e.elements,n=e.appState,r=void 0===n?Un():n,o=e.files,i=void 0===o?{}:o,a=e.exportPadding,l=du({elements:t,appState:r},null,null),s=l.elements,c=l.appState,[2,Wu(Ha(s),rh(rh({},c),{},{exportPadding:a}),i)]}))}));return function(t){return e.apply(this,arguments)}}(),lh=function(){var e=(0,d.Z)((function(e){var t;return th(this,(function(n){switch(n.label){case 0:return[4,ih(e)];case 1:if(!(t=n.sent()))throw new Error("couldn't export to blob");return[4,navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])];case 2:return n.sent(),[2]}}))}));return function(t){return e.apply(this,arguments)}}(),sh=(n(9295),n(9781),function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}});function ch(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function uh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ch(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ch(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const dh=function(e){var t=e.libItem,n=e.appState,r=e.index,o=e.onChange,i=e.onRemove,a=(0,l.useRef)(null),s=(0,l.useRef)(null);return(0,l.useEffect)((function(){var e=a.current;e&&(0,d.Z)((function(){var r;return sh(this,(function(o){switch(o.label){case 0:return[4,ah({elements:t.elements,appState:uh(uh({},n),{},{viewBackgroundColor:ct.white,exportBackground:!0}),files:null})];case 1:return r=o.sent(),e.innerHTML=r.outerHTML,[2]}}))}))()}),[t.elements,n]),(0,E.jsxs)("div",{className:"single-library-item",children:[(0,E.jsx)("div",{ref:a,className:"single-library-item__svg"}),(0,E.jsx)(ul,{"aria-label":S("buttons.remove"),type:"button",icon:Wl,className:"single-library-item--remove",onClick:i.bind(null,t.id),title:S("buttons.remove")}),(0,E.jsxs)("div",{style:{display:"flex",margin:"0.8rem 0.3rem",width:"100%",fontSize:"14px",fontWeight:500,flexDirection:"column"},children:[(0,E.jsxs)("label",{style:{display:"flex",justifyContent:"space-between",flexDirection:"column"},children:[(0,E.jsxs)("div",{style:{padding:"0.5em 0"},children:[(0,E.jsx)("span",{style:{fontWeight:500,color:ct.gray[6]},children:S("publishDialog.itemName")}),(0,E.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,E.jsx)("input",{type:"text",ref:s,style:{width:"80%",padding:"0.2rem"},defaultValue:t.name,placeholder:"Item name",onChange:function(e){o(e.target.value,r)}})]}),(0,E.jsx)("span",{className:"error",children:t.error})]})]})};var ph=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}};function fh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function hh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fh(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var gh="publish-library-data",mh=function(){var e=(0,d.Z)((function(e){var t,n,r,o,i,a,l,s,u,d,p,f,h,g,m,v,b,y,x;return ph(this,(function(w){switch(w.label){case 0:t=6,n=128,r=Math.round(n/16),o=Math.max(Math.round(n/64),2),i=function(e,t){if(!e.length||t<1)return[];for(var n=0,r=0,o=Array(Math.ceil(e.length/t));n<e.length;)o[r++]=e.slice(n,n+=t);return o}(e,t),(a=document.createElement("canvas")).width=i[0].length*n+(i[0].length+1)*(2*r)-2*r,a.height=i.length*n+(i.length+1)*(2*r)-2*r,(l=a.getContext("2d")).fillStyle=ct.white,l.fillRect(0,0,a.width,a.height),s=0,u=e.entries(),w.label=1;case 1:return s<u.length?(d=u[s],p=d[0],f=d[1],[4,oh({elements:f.elements,files:null,maxWidthOrHeight:n})]):[3,4];case 2:h=w.sent(),g=h.width,m=h.height,v=Math.floor(p/t)*(n+2*r),b=p%t*(n+2*r),l.drawImage(h,b+(n-g)/2+r,v+(n-m)/2+r),l.lineWidth=o,l.strokeStyle=ct.gray[4],l.strokeRect(b+r/2,v+r/2,n+r,n+r),w.label=3;case 3:return s++,[3,1];case 4:return y=ju,x=File.bind,[4,ku(a)];case 5:return[4,y.apply(void 0,[new(x.apply(File,[void 0,[w.sent()],"preview",{type:c.LO.png}])),{outputType:c.LO.jpg,maxWidthOrHeight:5e3}])];case 6:return[2,w.sent()]}}))}));return function(t){return e.apply(this,arguments)}}();const vh=function(e){var t=e.onClose,n=e.libraryItems,r=e.appState,o=e.onSuccess,i=e.onError,a=e.updateItemsInStorage,s=e.onRemove,u=(0,l.useState)({authorName:"",githubHandle:"",name:"",description:"",twitterHandle:"",website:""}),p=u[0],f=u[1],h=(0,l.useState)(!1),g=h[0],m=h[1];(0,l.useEffect)((function(){var e=function(){try{var e=localStorage.getItem(gh);if(e)return JSON.parse(e)}catch(e){console.error(e)}return null}();e&&f(e)}),[]);var v=(0,l.useState)(n.slice()),b=v[0],y=v[1];(0,l.useEffect)((function(){y(n.slice())}),[n]);var x,w=function(e){var t;f(hh(hh({},p),{},((t={})[e.target.name]=e.target.value,t)))},k=function(){var e=(0,d.Z)((function(e){var t,n,r,a,l,s,u;return ph(this,(function(d){switch(d.label){case 0:return e.preventDefault(),m(!0),t=[],n=!1,b.forEach((function(e){var r="";e.name||(r=S("publishDialog.errors.required"),n=!0),t.push(hh(hh({},e),{},{error:r}))})),n?(y(t),m(!1),[2]):[4,mh(b)];case 1:return r=d.sent(),a={type:c.r8.excalidrawLibrary,version:c.Kr.excalidrawLibrary,source:c.pb,libraryItems:b},l=JSON.stringify(a,null,2),s=new Blob([l],{type:"application/json"}),(u=new FormData).append("excalidrawLib",s),u.append("previewImage",r),u.append("previewImageType",r.type),u.append("title",p.name),u.append("authorName",p.authorName),u.append("githubHandle",p.githubHandle),u.append("name",p.name),u.append("description",p.description),u.append("twitterHandle",p.twitterHandle),u.append("website",p.website),fetch("https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries/submit",{method:"post",body:u}).then((function(e){return e.ok?e.json().then((function(e){var t=e.url;localStorage.removeItem(gh),o({url:t,authorName:p.authorName,items:b})})):e.json().catch((function(){throw new Error(e.statusText||"something went wrong")})).then((function(t){throw new Error(t.message||e.statusText||"something went wrong")}))}),(function(e){console.error(e),i(e),m(!1)})).catch((function(e){console.error(e),i(e),m(!1)})),[2]}}))}));return function(t){return e.apply(this,arguments)}}(),j=(0,l.useCallback)((function(){a(b),function(e){try{localStorage.setItem(gh,JSON.stringify(e))}catch(e){console.error(e)}}(p),t()}),[b,t,a,p]),_=!!n.length;return(0,E.jsx)(Ec,{onCloseRequest:j,title:S("publishDialog.title"),className:"publish-library",children:_?(0,E.jsxs)("form",{onSubmit:k,children:[(0,E.jsxs)("div",{className:"publish-library-note",children:[S("publishDialog.noteDescription.pre"),(0,E.jsx)("a",{href:"https://libraries.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:S("publishDialog.noteDescription.link")})," ",S("publishDialog.noteDescription.post")]}),(0,E.jsxs)("span",{className:"publish-library-note",children:[S("publishDialog.noteGuidelines.pre"),(0,E.jsx)("a",{href:"https://github.com/excalidraw/excalidraw-libraries#guidelines",target:"_blank",rel:"noopener noreferrer",children:S("publishDialog.noteGuidelines.link")}),S("publishDialog.noteGuidelines.post")]}),(0,E.jsx)("div",{className:"publish-library-note",children:S("publishDialog.noteItems")}),(x=[],b.forEach((function(e,t){x.push((0,E.jsx)("div",{className:"single-library-item-wrapper",children:(0,E.jsx)(dh,{libItem:e,appState:r,index:t,onChange:function(e,t){var n=b.slice();n[t].name=e,y(n)},onRemove:s})},t))})),(0,E.jsx)("div",{className:"selected-library-items",children:x})),(0,E.jsxs)("div",{className:"publish-library__fields",children:[(0,E.jsxs)("label",{children:[(0,E.jsxs)("div",{children:[(0,E.jsx)("span",{children:S("publishDialog.libraryName")}),(0,E.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,E.jsx)("input",{type:"text",name:"name",required:!0,value:p.name,onChange:w,placeholder:S("publishDialog.placeholder.libraryName")})]}),(0,E.jsxs)("label",{style:{alignItems:"flex-start"},children:[(0,E.jsxs)("div",{children:[(0,E.jsx)("span",{children:S("publishDialog.libraryDesc")}),(0,E.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,E.jsx)("textarea",{name:"description",rows:4,required:!0,value:p.description,onChange:w,placeholder:S("publishDialog.placeholder.libraryDesc")})]}),(0,E.jsxs)("label",{children:[(0,E.jsxs)("div",{children:[(0,E.jsx)("span",{children:S("publishDialog.authorName")}),(0,E.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,E.jsx)("input",{type:"text",name:"authorName",required:!0,value:p.authorName,onChange:w,placeholder:S("publishDialog.placeholder.authorName")})]}),(0,E.jsxs)("label",{children:[(0,E.jsx)("span",{children:S("publishDialog.githubUsername")}),(0,E.jsx)("input",{type:"text",name:"githubHandle",value:p.githubHandle,onChange:w,placeholder:S("publishDialog.placeholder.githubHandle")})]}),(0,E.jsxs)("label",{children:[(0,E.jsx)("span",{children:S("publishDialog.twitterUsername")}),(0,E.jsx)("input",{type:"text",name:"twitterHandle",value:p.twitterHandle,onChange:w,placeholder:S("publishDialog.placeholder.twitterHandle")})]}),(0,E.jsxs)("label",{children:[(0,E.jsx)("span",{children:S("publishDialog.website")}),(0,E.jsx)("input",{type:"text",name:"website",pattern:"https?://.+",title:S("publishDialog.errors.website"),value:p.website,onChange:w,placeholder:S("publishDialog.placeholder.website")})]}),(0,E.jsxs)("span",{className:"publish-library-note",children:[S("publishDialog.noteLicense.pre"),(0,E.jsx)("a",{href:"https://github.com/excalidraw/excalidraw-libraries/blob/main/LICENSE",target:"_blank",rel:"noopener noreferrer",children:S("publishDialog.noteLicense.link")}),S("publishDialog.noteLicense.post")]})]}),(0,E.jsxs)("div",{className:"publish-library__buttons",children:[(0,E.jsx)(ul,{type:"button",title:S("buttons.cancel"),"aria-label":S("buttons.cancel"),label:S("buttons.cancel"),onClick:j,"data-testid":"cancel-clear-canvas-button",className:"publish-library__buttons--cancel"}),(0,E.jsx)(ul,{type:"submit",title:S("buttons.submit"),"aria-label":S("buttons.submit"),label:S("buttons.submit"),className:"publish-library__buttons--confirm",isLoading:g})]})]}):(0,E.jsx)("p",{style:{padding:"1em",textAlign:"center",fontWeight:500},children:S("publishDialog.atleastOneLibItem")})})};n(4406);var bh=n(2891),yh=(n(694),function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}),xh=(0,E.jsx)("svg",{viewBox:"0 0 1792 1792",children:(0,E.jsx)("path",{d:"M1600 736v192c0 26.667-9.33 49.333-28 68-18.67 18.67-41.33 28-68 28h-416v416c0 26.67-9.33 49.33-28 68s-41.33 28-68 28H800c-26.667 0-49.333-9.33-68-28s-28-41.33-28-68v-416H288c-26.667 0-49.333-9.33-68-28-18.667-18.667-28-41.333-28-68V736c0-26.667 9.333-49.333 28-68s41.333-28 68-28h416V224c0-26.667 9.333-49.333 28-68s41.333-28 68-28h192c26.67 0 49.33 9.333 68 28s28 41.333 28 68v416h416c26.67 0 49.33 9.333 68 28s28 41.333 28 68Z",style:{stroke:"#fff",strokeWidth:140},transform:"translate(0 64)"})}),wh=function(e){var t=e.id,n=e.elements,r=e.files,o=e.isPending,i=e.onClick,a=e.selected,s=e.onToggle,u=(0,l.useRef)(null);(0,l.useEffect)((function(){var e=u.current;if(e)return(0,d.Z)((function(){var t;return yh(this,(function(o){switch(o.label){case 0:return n?[4,Wu(n,{exportBackground:!1,viewBackgroundColor:ct.white},r)]:[2];case 1:return t=o.sent(),e.innerHTML=t.outerHTML,[2]}}))}))(),function(){e.innerHTML=""}}),[n,r]);var p=(0,l.useState)(!1),f=p[0],h=p[1],g=Yh(),m=o&&(0,E.jsx)("div",{className:"library-unit__adder",children:xh});return(0,E.jsxs)("div",{className:Oe("library-unit",{"library-unit__active":n,"library-unit--hover":n&&f,"library-unit--selected":a}),onMouseEnter:function(){return h(!0)},onMouseLeave:function(){return h(!1)},children:[(0,E.jsx)("div",{className:Oe("library-unit__dragger",{"library-unit__pulse":!!o}),ref:u,draggable:!!n,onClick:n||o?function(e){t&&e.shiftKey?s(t,e):i()}:void 0,onDragStart:function(e){h(!1),e.dataTransfer.setData(c.LO.excalidrawlib,JSON.stringify(n))}}),m,t&&n&&(f||g||a)&&(0,E.jsx)(Id,{checked:a,onChange:function(e,n){return s(t,n)},className:"library-unit__checkbox"})]})},kh=(n(6043),function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}),Sh=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};const Eh=function(e){var t,n,r,o=e.libraryItems,i=e.onRemoveFromLibrary,a=e.onAddToLibrary,s=e.onInsertShape,u=e.pendingElements,p=e.theme,f=e.setAppState,h=e.libraryReturnUrl,g=e.library,m=e.files,v=e.id,b=e.selectedItems,y=e.onToggle,x=e.onPublish,w=e.resetLibrary,k=(0,l.useCallback)((function(){var e=b.length?S("alerts.removeItemsFromsLibrary",{count:b.length}):S("alerts.resetLibrary"),t=b.length?S("confirmDialog.removeItemsFromLib"):S("confirmDialog.resetLibrary");return(0,E.jsx)(Oc,{onConfirm:function(){b.length?i():w(),C(!1)},onCancel:function(){C(!1)},title:t,children:(0,E.jsx)("p",{children:e})})}),[b,i,w]),j=(0,l.useState)(!1),_=j[0],C=j[1],O=Yh(),I=O?4:6,M=h||window.location.origin+window.location.pathname,P=b.some((function(e){var t;return"published"===(null===(t=o.find((function(t){return t.id===e})))||void 0===t?void 0:t.status)})),T=function(e){var t,n,r,o,i;return(0,E.jsx)(Ld,{children:(0,E.jsx)(wh,{elements:null===(t=e.item)||void 0===t?void 0:t.elements,files:m,isPending:!(null!==(n=e.item)&&void 0!==n&&n.id||null===(r=e.item)||void 0===r||!r.elements),onClick:e.onClick||function(){},id:(null===(o=e.item)||void 0===o?void 0:o.id)||null,selected:!(null===(i=e.item)||void 0===i||!i.id)&&b.includes(e.item.id),onToggle:function(e,t){y(e,t)}})},e.key)},L=function(e){var t=e.map((function(e){return e.id?T({item:e,onClick:function(){return s(e.elements)},key:e.id}):T({key:"__pending__item__",item:e,onClick:function(){return a(u)}})})),n=(0,bh.chunk)(t,I);return n.length||(n=[[]]),n.map((function(e,t,n){return t===n.length-1&&(e=e.concat(new Array(I-e.length).fill(null).map((function(e,t){return T({key:"empty_".concat(t),item:null})})))),(0,E.jsx)(Td,{align:"center",gap:1,children:e},t)}))},A=o.filter((function(e){return"published"===e.status})),D=Sh(Sh([],u.length?[{id:null,elements:u}]:[],!0),o.filter((function(e){return"published"!==e.status})),!0);return(0,E.jsxs)("div",{className:"library-menu-items-container",children:[_&&k(),(0,E.jsxs)("div",{className:"layer-ui__library-header",children:[(t=!!b.length,n=t?o.filter((function(e){return b.includes(e.id)})):o,r=S(t?"buttons.remove":"buttons.resetLibrary"),(0,E.jsxs)("div",{className:"library-actions",children:[(!t||!O)&&(0,E.jsx)(ul,{type:"button",title:S("buttons.load"),"aria-label":S("buttons.load"),icon:yl,onClick:function(){Au(g).then((function(){f({isLibraryOpen:!1}),f({isLibraryOpen:!0})})).catch(zn).catch((function(e){f({errorMessage:e.message})}))},className:"library-actions--load"},"import"),!!n.length&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(ul,{type:"button",title:S("buttons.export"),"aria-label":S("buttons.export"),icon:El,onClick:(0,d.Z)((function(){var e;return kh(this,(function(r){switch(r.label){case 0:return t?(e=n,[3,3]):[3,1];case 1:return[4,g.loadLibrary()];case 2:e=r.sent(),r.label=3;case 3:return Lu(e).catch(zn).catch((function(e){f({errorMessage:e.message})})),[2]}}))})),className:"library-actions--export",children:b.length>0&&(0,E.jsx)("span",{className:"library-actions-counter",children:b.length})},"export"),(0,E.jsx)(ul,{type:"button",title:r,"aria-label":r,icon:wl,onClick:function(){return C(!0)},className:"library-actions--remove",children:b.length>0&&(0,E.jsx)("span",{className:"library-actions-counter",children:b.length})},"reset")]}),t&&!P&&(0,E.jsx)(bc,{label:S("hints.publishLibrary"),children:(0,E.jsxs)(ul,{type:"button","aria-label":S("buttons.publishLibrary"),label:S("buttons.publishLibrary"),icon:Es,className:"library-actions--publish",onClick:x,children:[!O&&(0,E.jsx)("label",{children:S("buttons.publishLibrary")}),b.length>0&&(0,E.jsx)("span",{className:"library-actions-counter",children:b.length})]})})]})),(0,E.jsx)("a",{href:"https://libraries.excalidraw.com?target=".concat(window.name||"_blank","&referrer=").concat(M,"&useHash=true&token=").concat(v,"&theme=").concat(p,"&version=").concat(c.Kr.excalidrawLibrary),target:"_excalidraw_libraries",children:S("labels.libraries")})]},"library-header"),(0,E.jsxs)(Ld,{className:"library-menu-items-container__items",align:"start",gap:1,children:[(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("div",{className:"separator",children:S("labels.personalLib")}),L(D)]}),(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("div",{className:"separator",children:[S("labels.excalidrawLib")," "]}),L(A)]})]})]})};var jh=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}},_h=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},Ch=function(e,t){return e.filter((function(e){return t.includes(e.id)}))},Oh=function(e){var t=e.onClose,n=e.onInsertShape,r=e.pendingElements,o=e.onAddToLibrary,i=e.theme,a=e.setAppState,s=e.files,u=e.libraryReturnUrl,p=e.focusContainer,f=e.library,h=e.id,g=e.appState,m=(0,l.useRef)(null);!function(e,t){(0,l.useEffect)((function(){var n=function(n){e.current&&(n.target instanceof Element&&(e.current.contains(n.target)||!document.body.contains(n.target))||t(n))};return document.addEventListener("pointerdown",n,!1),function(){document.removeEventListener("pointerdown",n)}}),[e,t])}(m,(function(e){e.target.closest(".ToolIcon__library")||t()})),(0,l.useEffect)((function(){var e=function(e){e.key===Kt&&t()};return document.addEventListener(c.Ks.KEYDOWN,e),function(){document.removeEventListener(c.Ks.KEYDOWN,e)}}),[t]);var v=(0,l.useState)([]),b=v[0],y=v[1],x=(0,l.useState)("preloading"),w=x[0],k=x[1],j=(0,l.useState)([]),_=j[0],C=j[1],O=(0,l.useState)(!1),I=O[0],M=O[1],P=(0,l.useState)(null),T=P[0],L=P[1],A=(0,l.useRef)(null);(0,l.useEffect)((function(){return Promise.race([new Promise((function(e){A.current=window.setTimeout((function(){e("loading")}),100)})),f.loadLibrary().then((function(e){y(e),k("ready")}))]).then((function(e){"loading"===e&&k("loading")})),function(){clearTimeout(A.current)}}),[f]);var D=(0,l.useCallback)((0,d.Z)((function(){var e,t;return jh(this,(function(n){switch(n.label){case 0:return[4,f.loadLibrary()];case 1:return e=n.sent(),t=e.filter((function(e){return!_.includes(e.id)})),f.saveLibrary(t).catch((function(t){y(e),a({errorMessage:S("alerts.errorRemovingFromLibrary")})})),C([]),y(t),[2]}}))})),[f,a,_,C]),z=(0,l.useCallback)((function(){f.resetLibrary(),y([]),p()}),[f,p]),N=(0,l.useCallback)(function(){var e=(0,d.Z)((function(e){var t,n;return jh(this,(function(r){switch(r.label){case 0:return e.some((function(e){return"image"===e.type}))?[2,a({errorMessage:"Support for adding images to the library coming soon!"})]:[4,f.loadLibrary()];case 1:return t=r.sent(),n=_h([{status:"unpublished",elements:e,id:Gr(),created:Date.now()}],t,!0),o(),f.saveLibrary(n).catch((function(e){y(t),a({errorMessage:S("alerts.errorAddingToLibrary")})})),y(n),[2]}}))}));return function(t){return e.apply(this,arguments)}}(),[o,f,a]),H=(0,l.useCallback)((function(){return(0,E.jsxs)(Ec,{onCloseRequest:function(){return L(null)},title:S("publishSuccessDialog.title"),className:"publish-library-success",small:!0,children:[(0,E.jsxs)("p",{children:[S("publishSuccessDialog.content",{authorName:T.authorName})," ",(0,E.jsx)("a",{href:null==T?void 0:T.url,target:"_blank",rel:"noopener noreferrer",children:S("publishSuccessDialog.link")})]}),(0,E.jsx)(ul,{type:"button",title:S("buttons.close"),"aria-label":S("buttons.close"),label:S("buttons.close"),onClick:function(){return L(null)},"data-testid":"publish-library-success-close",className:"publish-library-success-close"})]})}),[L,T]),R=(0,l.useCallback)((function(e){M(!1),L({url:e.url,authorName:e.authorName});var t=b.slice();t.forEach((function(e){_.includes(e.id)&&(e.status="published")})),f.saveLibrary(t),y(t)}),[M,L,b,_,f]),B=(0,l.useState)(null),F=B[0],U=B[1];return"preloading"===w?null:(0,E.jsxs)(wc,{padding:1,ref:m,className:"layer-ui__library",children:[I&&(0,E.jsx)(vh,{onClose:function(){return M(!1)},libraryItems:Ch(b,_),appState:g,onSuccess:R,onError:function(e){return window.alert(e)},updateItemsInStorage:function(){return f.saveLibrary(b)},onRemove:function(e){return C(_.filter((function(t){return t!==e})))}}),T&&H(),"loading"===w?(0,E.jsx)("div",{className:"layer-ui__library-message",children:S("labels.libraryLoadingMessage")}):(0,E.jsx)(Eh,{libraryItems:b,onRemoveFromLibrary:D,onAddToLibrary:N,onInsertShape:n,pendingElements:r,setAppState:a,libraryReturnUrl:u,library:f,theme:i,files:s,id:h,selectedItems:_,onToggle:function(e,t){if(!_.includes(e)){if(t.shiftKey&&F){var n=b.findIndex((function(e){return e.id===F})),r=b.findIndex((function(t){return t.id===e}));if(-1===n||-1===r)return void C(_h(_h([],_,!0),[e],!1));var o=Bn(_),i=b.reduce((function(e,t,i){return(i>=n&&i<=r||o.has(t.id))&&e.push(t.id),e}),[]);C(i)}else C(_h(_h([],_,!0),[e],!1));U(e)}else U(null),C(_.filter((function(t){return t!==e})))},onPublish:function(){return M(!0)},resetLibrary:z})]})},Ih=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}},Mh=["suggestedBindings","startBoundElement"];function Ph(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Th=function(e){var t,n=e.onHomeButtonClick,r=e.actionManager,o=e.appState,i=e.files,a=e.setAppState,s=e.canvas,u=e.elements,p=e.onCollabButtonClick,f=e.onLockToggle,h=e.onInsertElements,g=e.zenModeEnabled,m=e.showExitZenModeBtn,v=e.showThemeBtn,b=e.toggleZenMode,y=e.isCollaborating,x=e.renderTopRightUI,w=e.renderCustomFooter,k=e.viewModeEnabled,_=e.libraryReturnUrl,C=e.UIOptions,I=e.focusContainer,M=e.library,P=e.id,T=e.onImageAction,L=Yh(),A=function(){return C.canvasActions&&C.canvasActions.export?(0,E.jsx)(eh,{elements:u,appState:o,files:i,actionManager:r,exportOpts:C.canvasActions.export,canvas:s}):null},D=function(){if(!C.canvasActions||!C.canvasActions.saveAsImage)return null;var e=function(e){return function(){var t=(0,d.Z)((function(t){var n;return Ih(this,(function(r){switch(r.label){case 0:return[4,Ed(e,t,o,i,{exportBackground:o.exportBackground,name:o.name,viewBackgroundColor:o.viewBackgroundColor}).catch(zn).catch((function(e){console.error(e),a({errorMessage:e.message})}))];case 1:return n=r.sent(),o.exportEmbedScene&&n&&bu(n)&&a({fileHandle:n}),[2]}}))}));return function(e){return t.apply(this,arguments)}}()};return(0,E.jsx)(_f,{elements:u,appState:o,files:i,actionManager:r,onExportToPng:e("png"),onExportToSvg:e("svg"),onExportToClipboard:e("clipboard")})},z=(0,l.useCallback)((function(){!!document.querySelector(".Dialog")||a({isLibraryOpen:!1})}),[a]),N=(0,l.useCallback)((function(){a({selectedElementIds:{},selectedGroupIds:{}})}),[a]),H=o.isLibraryOpen?(0,E.jsx)(Oh,{pendingElements:Wa(u,o),onClose:z,onInsertShape:h,onAddToLibrary:N,setAppState:a,libraryReturnUrl:_,focusContainer:I,library:M,theme:o.theme,files:i,id:P,appState:o}):null,R=(0,E.jsxs)(E.Fragment,{children:[o.isLoading&&(0,E.jsx)(j,{}),o.errorMessage&&(0,E.jsx)(xf,{message:o.errorMessage,onClose:function(){return a({errorMessage:null})}}),o.showHelpDialog&&(0,E.jsx)($f,{onClose:function(){a({showHelpDialog:!1})}}),o.pasteDialog.shown&&(0,E.jsx)(Uf,{setAppState:a,appState:o,onInsertChart:h,onClose:function(){return a({pasteDialog:{shown:!1,data:null}})}})]});return L?(0,E.jsxs)(E.Fragment,{children:[R,(0,E.jsx)(Rf,{onHomeButtonClick:n,appState:o,elements:u,actionManager:r,libraryMenu:H,renderJSONExportDialog:A,renderImageExportDialog:D,setAppState:a,onCollabButtonClick:p,onLockToggle:f,canvas:s,isCollaborating:y,renderCustomFooter:w,viewModeEnabled:k,showThemeBtn:v,onImageAction:T,renderTopRightUI:x,UIOptions:C})]}):(0,E.jsxs)("div",{className:Oe("layer-ui__wrapper",{"disable-pointerEvents":o.draggingElement||o.resizingElement||o.editingElement&&!Te(o.editingElement)}),children:[R,(t=La(o,u),(0,E.jsx)(Cf,{side:"top",children:(0,E.jsxs)("div",{className:"App-menu App-menu_top",children:[(0,E.jsxs)(Ld,{gap:4,className:Oe({"disable-pointerEvents":g}),children:[C.canvasActions&&(k?(0,E.jsx)(Af,{heading:"canvasActions",className:Oe("zen-mode-transition",{"transition-left":g}),children:(0,E.jsx)(wc,{padding:2,style:{zIndex:1},children:(0,E.jsx)(Ld,{gap:4,children:(0,E.jsxs)(Td,{gap:1,justifyContent:"space-between",children:[A(),D()]})})})}):(0,E.jsx)(Af,{heading:"canvasActions",className:Oe("zen-mode-transition",{"transition-left":g}),children:(0,E.jsx)(wc,{padding:2,style:{zIndex:1},children:(0,E.jsxs)(Ld,{gap:4,children:[(0,E.jsxs)(Td,{gap:3,justifyContent:"space-between",children:[r.renderAction("clearCanvas"),r.renderAction("loadScene"),A(),D(),p&&(0,E.jsx)(yf,{isCollaborating:y,collaboratorCount:o.collaborators.size,onClick:p})]}),(0,E.jsx)(bf,{actionManager:r,appState:o,setAppState:a,showThemeBtn:v}),o.fileHandle&&(0,E.jsx)(E.Fragment,{children:r.renderAction("saveToActiveFile")})]})})})),t&&(0,E.jsx)(Af,{heading:"selectedShapeActions",className:Oe("zen-mode-transition",{"transition-left":g}),children:(0,E.jsx)(wc,{className:c.$C.SHAPE_ACTIONS_MENU,padding:2,style:{maxHeight:"".concat(o.height-(o.fileHandle?248:200),"px")},children:(0,E.jsx)(gf,{appState:o,elements:u,renderAction:r.renderAction,elementType:o.elementType})})})]}),!k&&(0,E.jsx)(Af,{heading:"shapes",children:function(e){return(0,E.jsxs)(Ld,{gap:4,align:"start",children:[(0,E.jsxs)(Td,{gap:1,children:[(0,E.jsx)(Mf,{zenModeEnabled:g,checked:o.elementLocked,onChange:f,title:S("toolBar.lock")}),(0,E.jsxs)(wc,{padding:1,className:Oe({"zen-mode":g}),children:[(0,E.jsx)(Of,{appState:o,elements:u,isMobile:L}),e,(0,E.jsx)(Td,{gap:1,children:(0,E.jsx)(mf,{canvas:s,elementType:o.elementType,setAppState:a,onImageAction:function(e){var t=e.pointerType;T({insertOnCanvasDirectly:"mouse"!==t})}})})]}),(0,E.jsx)(Nf,{appState:o,setAppState:a})]}),H]})}}),(0,E.jsx)("div",{className:Oe("layer-ui__wrapper__top-right zen-mode-transition",{"transition-right":g}),children:null==x?void 0:x(L,o)}),(0,E.jsx)(Df,{className:Oe("zen-mode-transition",{"transition-right":g}),layout:"vertical",collaborators:o.collaborators,actionManager:r})]})})),(0,E.jsxs)("footer",{role:"contentinfo",className:"layer-ui__wrapper__footer App-menu App-menu_bottom",children:[(0,E.jsx)("div",{className:Oe("layer-ui__wrapper__footer-left zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":g}),children:(0,E.jsx)(Ld,{gap:2,children:(0,E.jsxs)(Af,{heading:"canvasActions",children:[(0,E.jsx)(wc,{padding:1,children:(0,E.jsx)(vf,{renderAction:r.renderAction,zoom:o.zoom})}),!k&&(0,E.jsxs)("div",{className:Oe("undo-redo-buttons zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":g}),children:[r.renderAction("undo",{size:"small"}),r.renderAction("redo",{size:"small"})]})]})})}),(0,E.jsx)("div",{className:Oe("layer-ui__wrapper__footer-center zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":g}),children:null==w?void 0:w(!1,o)}),(0,E.jsx)("div",{className:Oe("layer-ui__wrapper__footer-right zen-mode-transition",{"transition-right disable-pointerEvents":g}),children:r.renderAction("toggleShortcuts")}),(0,E.jsx)("button",{className:Oe("disable-zen-mode",{"disable-zen-mode--visible":m}),onClick:b,children:S("buttons.exitZenMode")})]}),o.scrolledOutside&&(0,E.jsx)("button",{className:"scroll-back-to-content",onClick:function(){a(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ph(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ph(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},Ya(u,o)))},children:S("buttons.scrollBackToContent")})]})},Lh=function(e,t){var n=function(e){e.suggestedBindings,e.startBoundElement;return Jr(e,Mh)},r=n(e.appState),o=n(t.appState),i=Object.keys(r);return e.renderTopRightUI===t.renderTopRightUI&&e.renderCustomFooter===t.renderCustomFooter&&e.langCode===t.langCode&&e.elements===t.elements&&e.files===t.files&&i.every((function(e){return r[e]===o[e]}))};const Ah=s().memo(Th,Lh);n(1528);var Dh=function(e){var t,n=Yh(),r=it(e.elements),o=Ka(e.elements,e.appState),i=it(o);return n&&e.appState.openMenu?null:(0,E.jsx)("div",{className:"Stats",children:(0,E.jsxs)(wc,{padding:2,children:[(0,E.jsx)("div",{className:"close",onClick:e.onClose,children:Wl}),(0,E.jsx)("h3",{children:S("stats.title")}),(0,E.jsx)("table",{children:(0,E.jsxs)("tbody",{children:[(0,E.jsx)("tr",{children:(0,E.jsx)("th",{colSpan:2,children:S("stats.scene")})}),(0,E.jsxs)("tr",{children:[(0,E.jsx)("td",{children:S("stats.elements")}),(0,E.jsx)("td",{children:e.elements.length})]}),(0,E.jsxs)("tr",{children:[(0,E.jsx)("td",{children:S("stats.width")}),(0,E.jsx)("td",{children:Math.round(r[2])-Math.round(r[0])})]}),(0,E.jsxs)("tr",{children:[(0,E.jsx)("td",{children:S("stats.height")}),(0,E.jsx)("td",{children:Math.round(r[3])-Math.round(r[1])})]}),1===o.length&&(0,E.jsx)("tr",{children:(0,E.jsx)("th",{colSpan:2,children:S("stats.element")})}),o.length>1&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("tr",{children:(0,E.jsx)("th",{colSpan:2,children:S("stats.selected")})}),(0,E.jsxs)("tr",{children:[(0,E.jsx)("td",{children:S("stats.elements")}),(0,E.jsx)("td",{children:o.length})]})]}),o.length>0&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("tr",{children:[(0,E.jsx)("td",{children:"x"}),(0,E.jsx)("td",{children:Math.round(i[0])})]}),(0,E.jsxs)("tr",{children:[(0,E.jsx)("td",{children:"y"}),(0,E.jsx)("td",{children:Math.round(i[1])})]}),(0,E.jsxs)("tr",{children:[(0,E.jsx)("td",{children:S("stats.width")}),(0,E.jsx)("td",{children:Math.round(i[2]-i[0])})]}),(0,E.jsxs)("tr",{children:[(0,E.jsx)("td",{children:S("stats.height")}),(0,E.jsx)("td",{children:Math.round(i[3]-i[1])})]})]}),1===o.length&&(0,E.jsxs)("tr",{children:[(0,E.jsx)("td",{children:S("stats.angle")}),(0,E.jsx)("td",{children:"".concat(Math.round(180*o[0].angle/Math.PI),"°")})]}),null===(t=e.renderCustomStats)||void 0===t?void 0:t.call(e,e.elements,e.appState)]})})]})})},zh=(n(9757),function(e){var t=e.message,n=e.clearToast,r=(0,l.useRef)(0),o=(0,l.useCallback)((function(){return r.current=window.setTimeout((function(){return n()}),c.Lg)}),[n]);return(0,l.useEffect)((function(){return o(),function(){return clearTimeout(r.current)}}),[o,t]),(0,E.jsx)("div",{className:"Toast",onMouseEnter:function(){return clearTimeout(null==r?void 0:r.current)},onMouseLeave:o,children:(0,E.jsx)("p",{className:"Toast__message",children:t})})});function Nh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Hh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Nh(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Rh=Cs({name:"viewMode",perform:function(e,t){return Rc("view","mode","view"),{appState:Hh(Hh({},t),{},{viewModeEnabled:!this.checked(t)}),commitToHistory:!1}},checked:function(e){return e.viewModeEnabled},contextItemLabel:"labels.viewMode",keyTest:function(e){return!e[Vt]&&e.altKey&&e.code===zt}}),Bh=n(200),Fh=n.n(Bh),Uh=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vh=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}},Gh=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};function Wh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Kh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wh(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Zh=s().createContext(!1),Yh=function(){return(0,l.useContext)(Zh)},qh=s().createContext({container:null,id:null}),Xh=function(){return(0,l.useContext)(qh)},$h=!1,Qh=0,Jh=0,eg=0,tg=!1,ng=!1,rg=!1,og={horizontal:null,vertical:null},ig=0,ag=!1,lg=null,sg={pointers:new Map,lastCenter:null,initialDistance:null,initialScale:null},cg=function(e){function t(t){var n,r=this;r=e.call(this,t)||this,n=r,ug.call(r);var o,i,a,l,s=Un(),u=t.excalidrawRef,d=t.viewModeEnabled,p=void 0!==d&&d,f=t.zenModeEnabled,h=void 0!==f&&f,g=t.gridModeEnabled,m=void 0!==g&&g,v=t.theme,b=void 0===v?s.theme:v,y=t.name,x=void 0===y?s.name:y;if(r.state=Kh(Kh(Kh({},s),{},{theme:b,isLoading:!0},r.getCanvasOffsets()),{},{viewModeEnabled:p,zenModeEnabled:h,gridSize:m?c.k:null,name:x,width:window.innerWidth,height:window.innerHeight}),r.id=Ie(),u){var w,k="current"in u&&(null===(w=u.current)||void 0===w?void 0:w.readyPromise)||((a=new Promise((function(e,t){o=e,i=t}))).resolve=o,a.reject=i,a),j={ready:!0,readyPromise:k,updateScene:r.updateScene,addFiles:r.addFiles,resetScene:r.resetScene,getSceneElementsIncludingDeleted:r.getSceneElementsIncludingDeleted,history:{clear:r.resetHistory},scrollToContent:r.scrollToContent,getSceneElements:r.getSceneElements,getAppState:function(){return n.state},getFiles:function(){return n.files},refresh:r.refresh,importLibrary:r.importLibraryFromUrl,setToastMessage:r.setToastMessage,id:r.id};"function"==typeof u?u(j):u.current=j,k.resolve(j)}return r.excalidrawContainerValue={container:r.excalidrawContainerRef.current,id:r.id},r.scene=new Fr,r.library=new ef(r),r.history=new cf,r.actionManager=new Yp(r.syncActionResult,(function(){return n.state}),(function(){return n.scene.getElementsIncludingDeleted()}),r),r.actionManager.registerAll(_s),r.actionManager.registerAction((l=r.history,{name:"undo",perform:function(e,t){return Zp(e,t,(function(){return l.undoOnce()}))},keyTest:function(e){return e[Vt]&&e.key.toLowerCase()===dn&&!e.shiftKey},PanelComponent:function(e){var t=e.updateData,n=e.data;return(0,E.jsx)(ul,{type:"button",icon:Il,"aria-label":S("buttons.undo"),onClick:t,size:(null==n?void 0:n.size)||"medium"})},commitToHistory:function(){return!1}})),r.actionManager.registerAction(function(e){return{name:"redo",perform:function(t,n){return Zp(t,n,(function(){return e.redoOnce()}))},keyTest:function(e){return e[Vt]&&e.shiftKey&&e.key.toLowerCase()===dn||gt&&e.ctrlKey&&!e.shiftKey&&e.key===un},PanelComponent:function(e){var t=e.updateData,n=e.data;return(0,E.jsx)(ul,{type:"button",icon:Ml,"aria-label":S("buttons.redo"),onClick:t,size:(null==n?void 0:n.size)||"medium"})},commitToHistory:function(){return!1}}}(r.history)),r}return Uh(t,e),t.prototype.renderCanvas=function(){var e=window.devicePixelRatio,t=this.state,n=t.width,r=t.height,o=n*e,i=r*e;return t.viewModeEnabled?(0,E.jsx)("canvas",{className:"excalidraw__canvas",style:{width:n,height:r,cursor:c.oc.GRAB},width:o,height:i,ref:this.handleCanvasRef,onContextMenu:this.handleCanvasContextMenu,onPointerMove:this.handleCanvasPointerMove,onPointerUp:this.removePointer,onPointerCancel:this.removePointer,onTouchMove:this.handleTouchMove,onPointerDown:this.handleCanvasPointerDown,children:S("labels.drawingCanvas")}):(0,E.jsx)("canvas",{className:"excalidraw__canvas",style:{width:n,height:r},width:o,height:i,ref:this.handleCanvasRef,onContextMenu:this.handleCanvasContextMenu,onPointerDown:this.handleCanvasPointerDown,onDoubleClick:this.handleCanvasDoubleClick,onPointerMove:this.handleCanvasPointerMove,onPointerUp:this.removePointer,onPointerCancel:this.removePointer,onTouchMove:this.handleTouchMove,children:S("labels.drawingCanvas")})},t.prototype.render=function(){var e,t,n=this,r=this.state,o=r.zenModeEnabled,i=r.viewModeEnabled,a=this.props,l=a.onCollabButtonClick,s=a.renderTopRightUI,c=a.renderFooter,u=a.renderCustomStats;return(0,E.jsx)("div",{className:Oe("excalidraw excalidraw-container",{"excalidraw--zen-mode":o,"excalidraw--view-mode":i,"excalidraw--mobile":this.isMobile}),ref:this.excalidrawContainerRef,onDrop:this.handleAppOnDrop,tabIndex:0,onKeyDown:this.props.handleKeyboardGlobally?void 0:this.onKeyDown,children:(0,E.jsx)(qh.Provider,{value:this.excalidrawContainerValue,children:(0,E.jsxs)(Zh.Provider,{value:this.isMobile,children:[(0,E.jsx)(Ah,{onHomeButtonClick:this.props.onHomeButtonClick,canvas:this.canvas,appState:this.state,files:this.files,setAppState:this.setAppState,actionManager:this.actionManager,elements:this.scene.getElements(),onCollabButtonClick:l,onLockToggle:this.toggleLock,onInsertElements:function(e){return n.addElementsFromPasteOrLibrary({elements:e,position:"center",files:null})},zenModeEnabled:o,toggleZenMode:this.toggleZenMode,langCode:w().code,isCollaborating:this.props.isCollaborating||!1,renderTopRightUI:s,renderCustomFooter:c,viewModeEnabled:i,showExitZenModeBtn:void 0===(null===(e=this.props)||void 0===e?void 0:e.zenModeEnabled)&&o,showThemeBtn:void 0===(null===(t=this.props)||void 0===t?void 0:t.theme)&&this.props.UIOptions.canvasActions&&this.props.UIOptions.canvasActions.theme,libraryReturnUrl:this.props.libraryReturnUrl,UIOptions:this.props.UIOptions,focusContainer:this.focusContainer,library:this.library,id:this.id,onImageAction:this.onImageAction}),(0,E.jsx)("div",{className:"excalidraw-textEditorContainer"}),(0,E.jsx)("div",{className:"excalidraw-contextMenuContainer"}),this.state.showStats&&(0,E.jsx)(Dh,{appState:this.state,setAppState:this.setAppState,elements:this.scene.getElements(),onClose:this.toggleStats,renderCustomStats:u}),null!==this.state.toastMessage&&(0,E.jsx)(zh,{message:this.state.toastMessage,clearToast:this.clearToast}),(0,E.jsx)("main",{children:this.renderCanvas()})]})})})},t.prototype.componentDidMount=function(){var e=this;return(0,d.Z)((function(){var t,n,r,o;return Vh(this,(function(i){return e.excalidrawContainerValue.container=e.excalidrawContainerRef.current,"production"!==c.Vi.TEST&&"production"!==c.Vi.DEVELOPMENT||(e.setState.bind(e),Object.defineProperties(window.h,{state:{configurable:!0,get:function(){return e.state}},setState:{configurable:!0,value:function(){return e.setState.apply(e,arguments)}},app:{configurable:!0,value:e},history:{configurable:!0,value:e.history}})),e.scene.addCallback(e.onSceneUpdated),e.addEventListeners(),e.excalidrawContainerRef.current&&e.focusContainer(),"ResizeObserver"in window&&null!==(t=e.excalidrawContainerRef)&&void 0!==t&&t.current?(e.resizeObserver=new ResizeObserver((function(){var t=e.excalidrawContainerRef.current.getBoundingClientRect(),n=t.width,r=t.height;e.isMobile=n<c.kV||r<c.Yx&&n<c.sS,e.updateDOMRect()})),null===(n=e.resizeObserver)||void 0===n||n.observe(e.excalidrawContainerRef.current)):window.matchMedia&&(r=window.matchMedia("(max-width: ".concat(c.kV,"px), (max-height: ").concat(c.Yx,"px) and (max-width: ").concat(c.sS,"px)")),o=function(){return e.isMobile=r.matches},r.addListener(o),e.detachIsMobileMqHandler=function(){return r.removeListener(o)}),new URLSearchParams(window.location.search.slice(1)).has("web-share-target")?e.restoreFileFromShare():e.updateDOMRect(e.initializeScene),[2]}))}))()},t.prototype.componentWillUnmount=function(){var e,t=this;this.files={},this.imageCache.clear(),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.unmounted=!0,this.removeEventListeners(),this.scene.destroy(),Sr=new WeakMap,Er=new WeakMap,Ar=new WeakMap,this.scene=new Fr,this.history=new cf,this.actionManager=new Yp(this.syncActionResult,(function(){return t.state}),(function(){return t.scene.getElementsIncludingDeleted()}),this),this.library=new ef(this),this.canvas=null,this.rc=null,this.excalidrawContainerRef.current=void 0,this.nearestScrollableContainer=void 0,this.excalidrawContainerValue={container:null,id:"unmounted"},clearTimeout(ig),ig=0},t.prototype.removeEventListeners=function(){var e,t,n,r;document.removeEventListener(c.Ks.POINTER_UP,this.removePointer),document.removeEventListener(c.Ks.COPY,this.onCopy),document.removeEventListener(c.Ks.PASTE,this.pasteFromClipboard),document.removeEventListener(c.Ks.CUT,this.onCut),null===(e=this.nearestScrollableContainer)||void 0===e||e.removeEventListener(c.Ks.SCROLL,this.onScroll),document.removeEventListener(c.Ks.KEYDOWN,this.onKeyDown,!1),document.removeEventListener(c.Ks.MOUSE_MOVE,this.updateCurrentCursorPosition,!1),document.removeEventListener(c.Ks.KEYUP,this.onKeyUp),window.removeEventListener(c.Ks.RESIZE,this.onResize,!1),window.removeEventListener(c.Ks.UNLOAD,this.onUnload,!1),window.removeEventListener(c.Ks.BLUR,this.onBlur,!1),window.removeEventListener(c.Ks.DRAG_OVER,this.disableEvent,!1),window.removeEventListener(c.Ks.DROP,this.disableEvent,!1),null===(t=document.fonts)||void 0===t||null===(n=t.removeEventListener)||void 0===n||n.call(t,"loadingdone",this.onFontLoaded),document.removeEventListener(c.Ks.GESTURE_START,this.onGestureStart,!1),document.removeEventListener(c.Ks.GESTURE_CHANGE,this.onGestureChange,!1),document.removeEventListener(c.Ks.GESTURE_END,this.onGestureEnd,!1),null===(r=this.detachIsMobileMqHandler)||void 0===r||r.call(this)},t.prototype.addEventListeners=function(){var e,t;this.removeEventListeners(),document.addEventListener(c.Ks.POINTER_UP,this.removePointer),document.addEventListener(c.Ks.COPY,this.onCopy),this.props.handleKeyboardGlobally&&document.addEventListener(c.Ks.KEYDOWN,this.onKeyDown,!1),document.addEventListener(c.Ks.KEYUP,this.onKeyUp,{passive:!0}),document.addEventListener(c.Ks.MOUSE_MOVE,this.updateCurrentCursorPosition),null===(e=document.fonts)||void 0===e||null===(t=e.addEventListener)||void 0===t||t.call(e,"loadingdone",this.onFontLoaded),document.addEventListener(c.Ks.GESTURE_START,this.onGestureStart,!1),document.addEventListener(c.Ks.GESTURE_CHANGE,this.onGestureChange,!1),document.addEventListener(c.Ks.GESTURE_END,this.onGestureEnd,!1),this.state.viewModeEnabled||(document.addEventListener(c.Ks.PASTE,this.pasteFromClipboard),document.addEventListener(c.Ks.CUT,this.onCut),this.props.detectScroll&&(this.nearestScrollableContainer=function(e){for(var t=e.parentElement;t;){if(t===document.body)return document;var n=window.getComputedStyle(t).overflowY;if(t.scrollHeight>t.clientHeight&&("auto"===n||"scroll"===n))return t;t=t.parentElement}return document}(this.excalidrawContainerRef.current),this.nearestScrollableContainer.addEventListener(c.Ks.SCROLL,this.onScroll)),window.addEventListener(c.Ks.RESIZE,this.onResize,!1),window.addEventListener(c.Ks.UNLOAD,this.onUnload,!1),window.addEventListener(c.Ks.BLUR,this.onBlur,!1),window.addEventListener(c.Ks.DRAG_OVER,this.disableEvent,!1),window.addEventListener(c.Ks.DROP,this.disableEvent,!1))},t.prototype.componentDidUpdate=function(e,t){var n,r,o=this;e.langCode!==this.props.langCode&&this.updateLanguage(),e.viewModeEnabled!==this.props.viewModeEnabled&&this.setState({viewModeEnabled:!!this.props.viewModeEnabled}),t.viewModeEnabled!==this.state.viewModeEnabled&&(this.addEventListeners(),this.deselectElements()),e.zenModeEnabled!==this.props.zenModeEnabled&&this.setState({zenModeEnabled:!!this.props.zenModeEnabled}),e.theme!==this.props.theme&&this.props.theme&&this.setState({theme:this.props.theme}),e.gridModeEnabled!==this.props.gridModeEnabled&&this.setState({gridSize:this.props.gridModeEnabled?c.k:null}),this.props.UIOptions.canvasActions||"canvas"!==this.state.openMenu||this.setState({openMenu:null}),this.props.name&&e.name!==this.props.name&&this.setState({name:this.props.name}),null===(n=this.excalidrawContainerRef.current)||void 0===n||n.classList.toggle("theme--dark","dark"===this.state.theme),this.state.editingLinearElement&&!this.state.selectedElementIds[this.state.editingLinearElement.elementId]&&setTimeout((function(){o.actionManager.executeAction(Hc)}));var i=t.multiElement;t.elementType!==this.state.elementType&&null!=i&&Gi(this.state)&&Ne(i)&&qi(i,this.state,this.scene,Dn(Fi.getPointAtIndexGlobalCoordinates(i,-1)));var a={},l={},s={},u={},d={};this.state.collaborators.forEach((function(e,t){if(e.selectedElementIds)for(var n=0,r=Object.keys(e.selectedElementIds);n<r.length;n++){var i=r[n];i in s||(s[i]=[]),s[i].push(t)}e.pointer&&(e.username&&(u[t]=e.username),e.userState&&(d[t]=e.userState),l[t]=Pn({sceneX:e.pointer.x,sceneY:e.pointer.y},o.state),a[t]=e.button)}));var p=this.scene.getElements().filter((function(e){return(!Pe(e)||!o.state.pendingImageElement||e.id!==o.state.pendingImageElement.id)&&(!o.state.editingElement||"text"!==o.state.editingElement.type||e.id!==o.state.editingElement.id)})),f=Wc(p,this.state,this.state.selectionElement,window.devicePixelRatio,this.rc,this.canvas,{scrollX:this.state.scrollX,scrollY:this.state.scrollY,viewBackgroundColor:this.state.viewBackgroundColor,zoom:this.state.zoom,remotePointerViewportCoords:l,remotePointerButton:a,remoteSelectedElementIds:s,remotePointerUsernames:u,remotePointerUserStates:d,shouldCacheIgnoreZoom:this.state.shouldCacheIgnoreZoom,theme:this.state.theme,imageCache:this.imageCache,isExporting:!1,renderScrollbars:!this.isMobile}),h=f.atLeastOneVisibleElement,g=f.scrollBars;g&&(og=g);var m,v,b="text"!==(null===(r=this.state.editingElement)||void 0===r?void 0:r.type)&&(!h&&p.length>0);(this.state.scrolledOutside!==b&&this.setState({scrolledOutside:b}),this.history.record(this.state,this.scene.getElementsIncludingDeleted()),this.scheduleImageRefresh(),this.state.isLoading)||(null===(m=(v=this.props).onChange)||void 0===m||m.call(v,this.scene.getElementsIncludingDeleted(),this.state,this.files,this.props.id))},t.resetTapTwice=function(){$h=!1},t.prototype.addTextFromPaste=function(e){var t,n=Mn({clientX:Jh,clientY:eg},this.state),r=n.x,o=n.y,i=bo({x:r,y:o,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,strokeSharpness:this.state.currentItemStrokeSharpness,text:e,fontSize:this.state.currentItemFontSize,fontFamily:this.state.currentItemFontFamily,textAlign:this.state.currentItemTextAlign,verticalAlign:c.hs});this.scene.replaceAllElements(Gh(Gh([],this.scene.getElementsIncludingDeleted(),!0),[i],!1)),this.setState({selectedElementIds:(t={},t[i.id]=!0,t)}),this.history.resumeRecording()},t.prototype.selectShapeTool=function(e){var t;tg||Cn(this.canvas,e),(t=document.activeElement)instanceof HTMLElement&&t.className.includes("ToolIcon")&&this.focusContainer(),ze(e)||this.setState({suggestedBindings:[]}),"image"===e&&this.onImageAction(),"selection"!==e?this.setState({elementType:e,selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}):this.setState({elementType:e})},t.prototype.handleTextWysiwyg=function(e,t){var n=this,r=t.isExistingElement,o=void 0!==r&&r,i=function(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n.scene.replaceAllElements(Gh([],n.scene.getElementsIncludingDeleted().map((function(n){return n.id===e.id&&Te(n)?yo(n,{text:t,isDeleted:r}):n})),!0))};!function(e){var t=e.id,n=e.appState,r=e.onChange,o=e.onSubmit,i=e.getViewportCoords,a=e.element,l=e.canvas,s=e.excalidrawContainer,u=function(){var e,r=null===(e=Fr.getScene(a))||void 0===e?void 0:e.getElement(t);if(r&&Te(r)){var o=i(r.x,r.y),l=o[0],c=o[1],u=r.textAlign,p=r.angle;d.value=r.text;var f=r.text.replace(/\r\n?/g,"\n").split("\n"),h=r.height/f.length,g=(n.offsetLeft+n.width-l-8)/n.zoom.value-Number(getComputedStyle(null==s?void 0:s.parentNode).marginRight.slice(0,-2));Object.assign(d.style,{font:wn(r),lineHeight:"".concat(h,"px"),width:"".concat(r.width,"px"),height:"".concat(r.height,"px"),left:"".concat(l,"px"),top:"".concat(c,"px"),transform:Pa(r.width,r.height,p,n,g),textAlign:u,color:r.strokeColor,opacity:r.opacity/100,filter:"var(--theme-filter)",maxWidth:"".concat(g,"px")})}},d=document.createElement("textarea");d.dir="auto",d.tabIndex=0,d.dataset.type="wysiwyg",d.wrap="off",d.classList.add("excalidraw-wysiwyg"),Object.assign(d.style,{position:"absolute",display:"inline-block",minHeight:"1em",backfaceVisibility:"hidden",margin:0,padding:0,border:0,outline:0,resize:"none",background:"transparent",overflow:"hidden",whiteSpace:"pre",zIndex:"var(--zIndex-wysiwyg)"}),u(),r&&(d.oninput=function(){r(Ma(d.value))}),d.onkeydown=function(e){if(e.stopPropagation(),e.key===Kt)e.preventDefault(),b=!0,y();else if(e.key===Wt&&e[Vt]){if(e.preventDefault(),e.isComposing||229===e.keyCode)return;b=!0,y()}else(e.key===qt||e[Vt]&&(e.code===kt||e.code===wt))&&(e.preventDefault(),e.shiftKey||e.code===kt?g():h(),d.dispatchEvent(new Event("input")))};var p=" ".repeat(4),f=new RegExp("^ {1,".concat(4,"}")),h=function(){var e=d.selectionStart,t=d.selectionEnd,n=m(),r=d.value;n.forEach((function(e){var t=r.slice(0,e),n=r.slice(e);r="".concat(t).concat(p).concat(n)})),d.value=r,d.selectionStart=e+4,d.selectionEnd=t+4*n.length},g=function(){var e=d.selectionStart,t=d.selectionEnd,n=m(),r=[],o=d.value;n.forEach((function(e){var t=o.slice(e,e+4).match(f);if(t){var n=o.slice(0,e),i=o.slice(e+t[0].length);o="".concat(n).concat(i),r.push(e)}})),d.value=o,r.length&&(e>r[r.length-1]?d.selectionStart=Math.max(e-4,r[r.length-1]):d.selectionStart=e,d.selectionEnd=Math.max(d.selectionStart,t-4*r.length))},m=function(){var e=d.selectionStart,t=d.selectionEnd,n=d.value,r=n.slice(0,e).match(/[^\n]*$/)[0].length;return e-=r,n.slice(e,t).split("\n").reduce((function(t,n,r,o){return t.concat(r?t[r-1]+o[r-1].length+1:e)}),[]).reverse()},v=function(e){e.preventDefault(),e.stopPropagation()},b=!1,y=function(){x(),o({text:Ma(d.value),viaKeyboard:b})},x=function(){E||(E=!0,d.onblur=null,d.oninput=null,d.onkeydown=null,j&&j.disconnect(),window.removeEventListener("resize",u),window.removeEventListener("wheel",v,!0),window.removeEventListener("pointerdown",k),window.removeEventListener("pointerup",w),window.removeEventListener("blur",y),S(),d.remove())},w=function(){window.removeEventListener("pointerup",w),setTimeout((function(){d.onblur=y,d.focus()}))},k=function(e){(e.target instanceof HTMLElement||e.target instanceof SVGElement)&&e.target.closest(".".concat(c.$C.SHAPE_ACTIONS_MENU))&&!yn(e.target)&&(d.onblur=null,window.addEventListener("pointerup",w),window.addEventListener("blur",y))},S=Fr.getScene(a).addCallback((function(){u(),d.focus()})),E=!1;d.select(),w();var j=null;l&&"ResizeObserver"in window?(j=new window.ResizeObserver((function(){u()}))).observe(l):window.addEventListener("resize",u),window.addEventListener("pointerdown",k),window.addEventListener("wheel",v,{passive:!1,capture:!0}),null==s||s.querySelector(".excalidraw-textEditorContainer").appendChild(d)}({id:e.id,appState:this.state,canvas:this.canvas,getViewportCoords:function(e,t){var r=Pn({sceneX:e,sceneY:t},n.state),o=r.x,i=r.y;return[o-n.state.offsetLeft,i-n.state.offsetTop]},onChange:Hn((function(t){i(t),Ra(e)&&ra(e)})),onSubmit:Hn((function(t){var r=t.text,a=t.viaKeyboard,l=!r.trim();i(r,l),!l&&a&&n.setState((function(t){var n;return{selectedElementIds:Kh(Kh({},t.selectedElementIds),{},(n={},n[e.id]=!0,n))}})),l&&ga(n.scene.getElements(),[e]),l&&!o||n.history.resumeRecording(),n.setState({draggingElement:null,editingElement:null}),n.state.elementLocked&&Cn(n.canvas,n.state.elementType),n.focusContainer()})),element:e,excalidrawContainer:this.excalidrawContainerRef.current}),this.deselectElements(),i(e.text)},t.prototype.deselectElements=function(){this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})},t.prototype.getTextElementAtPosition=function(e,t){var n=this.getElementAtPosition(e,t);return n&&Te(n)&&!n.isDeleted?n:null},t.prototype.getElementAtPosition=function(e,t,n){var r=this.getElementsAtPosition(e,t);if(r.length>1){if(null!=n&&n.preferSelected)for(var o=r.length-1;o>-1;o--)if(this.state.selectedElementIds[r[o].id])return r[o];var i=r[r.length-1];return ei(i,this.state,e,t)?r[r.length-2]:i}return 1===r.length?r[0]:null},t.prototype.getElementsAtPosition=function(e,t){var n,r,o=this;return n=this.scene.getElements(),r=function(n){return function(e,t,n,r){var o=10/t.zoom.value,i=[n,r];return ni(t,e)?ri(e,i,o):ti(e,t,i)}(n,o.state,e,t)},n.filter((function(e){return!e.isDeleted&&r(e)}))},t.prototype.maybeCleanupAfterMissingPointerUp=function(e){null!==lg&&lg(e)},t.prototype.updateGestureOnPointerDown=function(e){sg.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),2===sg.pointers.size&&(sg.lastCenter=tf(sg.pointers),sg.initialScale=this.state.zoom.value,sg.initialDistance=nf(Array.from(sg.pointers.values())))},t.prototype.initialPointerDownState=function(e){var t=Mn(e,this.state),n=Wa(this.scene.getElements(),this.state),r=it(n),o=r[0],i=r[1],a=r[2],l=r[3];return{origin:t,withCmdOrCtrl:e[Vt],originInGrid:Dn(qe(t.x,t.y,this.state.gridSize)),scrollbars:Va(og,e.clientX-this.state.offsetLeft,e.clientY-this.state.offsetTop),lastCoords:Kh({},t),originalElements:this.scene.getElements().reduce((function(e,t){return e.set(t.id,wo(t)),e}),new Map),resize:{handleType:!1,isResizing:!1,offset:{x:0,y:0},arrowDirection:"origin",center:{x:(a+o)/2,y:(l+i)/2}},hit:{element:null,allHitElements:[],wasAddedToSelection:!1,hasBeenDuplicated:!1,hasHitCommonBoundingBoxOfSelectedElements:this.isHittingCommonBoundingBoxOfSelectedElements(t,n)},drag:{hasOccurred:!1,offset:null},eventListeners:{onMove:null,onUp:null,onKeyUp:null,onKeyDown:null}}},t.prototype.handleDraggingScrollBar=function(e,t){var n=this;if(!t.scrollbars.isOverEither||this.state.multiElement)return!1;rg=!0,t.lastCoords.x=e.clientX,t.lastCoords.y=e.clientY;var r=Hn((function(e){e.target instanceof HTMLElement&&n.handlePointerMoveOverScrollbars(e,t)})),o=Hn((function(){rg=!1,Cn(n.canvas,n.state.elementType),lg=null,n.setState({cursorButton:"up"}),n.savePointer(e.clientX,e.clientY,"up"),window.removeEventListener(c.Ks.POINTER_MOVE,r),window.removeEventListener(c.Ks.POINTER_UP,o)}));return lg=o,window.addEventListener(c.Ks.POINTER_MOVE,r),window.addEventListener(c.Ks.POINTER_UP,o),!0},t.prototype.isASelectedElement=function(e){return null!=e&&this.state.selectedElementIds[e.id]},t.prototype.isHittingCommonBoundingBoxOfSelectedElements=function(e,t){if(t.length<2)return!1;var n=10/this.state.zoom.value,r=it(t),o=r[0],i=r[1],a=r[2],l=r[3];return e.x>o-n&&e.x<a+n&&e.y>i-n&&e.y<l+n},t.prototype.onKeyDownFromPointerDownHandler=function(e){var t=this;return Hn((function(n){t.maybeHandleResize(e,n)||t.maybeDragNewGenericElement(e,n)}))},t.prototype.onKeyUpFromPointerDownHandler=function(e){var t=this;return Hn((function(n){n.key===Ut&&n.preventDefault(),t.maybeHandleResize(e,n)||t.maybeDragNewGenericElement(e,n)}))},t.prototype.onPointerMoveFromPointerDownHandler=function(e){var t=this;return Hn((function(n){var r;if(null===e.drag.offset&&(e.drag.offset=Dn(function(e,t,n){var r=it(e);return[t-r[0],n-r[1]]}(Wa(t.scene.getElements(),t.state),e.origin.x,e.origin.y))),n.target instanceof HTMLElement&&!t.handlePointerMoveOverScrollbars(n,e)){var o=Mn(n,t.state),i=qe(o.x,o.y,t.state.gridSize),a=i[0],l=i[1];if(e.drag.hasOccurred||"arrow"!==t.state.elementType&&"line"!==t.state.elementType||!(Ve(o.x,o.y,e.origin.x,e.origin.y)<c.f)){if(e.resize.isResizing&&(e.lastCoords.x=o.x,e.lastCoords.y=o.y,t.maybeHandleResize(e,n)))return!0;if(t.state.editingLinearElement){var s=Fi.handlePointDragging(t.state,(function(e){return t.setState(e)}),o.x,o.y,(function(e,n){t.maybeSuggestBindingForLinearElementAtCursor(e,n,o)}));if(s)return e.lastCoords.x=o.x,void(e.lastCoords.y=o.y)}var u=e.hit.allHitElements.some((function(e){return t.isASelectedElement(e)}));if(u||e.hit.hasHitCommonBoundingBoxOfSelectedElements){e.drag.hasOccurred=!0;var d=Wa(t.scene.getElements(),t.state);if(d.length>0&&!e.withCmdOrCtrl){var p=qe(o.x-e.drag.offset.x,o.y-e.drag.offset.y,t.state.gridSize),f=p[0],h=p[1],g=[Math.abs(o.x-e.origin.x),Math.abs(o.y-e.origin.y)],m=g[0],v=g[1],b=n.shiftKey;if(function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,s=it(t),c=s[0],u=s[1],d={x:n-c,y:r-u};t.forEach((function(n){var r,o;if(i){var s=i&&a<l,c=i&&a>l,u=e.originalElements.get(n.id);r=s&&u?u.x:n.x+d.x,o=c&&u?u.y:n.y+d.y}else r=n.x+d.x,o=n.y+d.y;Zr(n,{x:r,y:o}),ra(n,{simultaneouslyUpdated:t})}))}(e,d,f,h,t.scene,b,m,v),t.maybeSuggestBindingForAll(d),n.altKey&&!e.hit.hasBeenDuplicated){e.hit.hasBeenDuplicated=!0;for(var y=[],x=[],w=new Map,k=new Map,S=e.hit.element,E=0,j=t.scene.getElementsIncludingDeleted();E<j.length;E++){var _=j[E];if(t.state.selectedElementIds[_.id]||_.id===(null==S?void 0:S.id)&&e.hit.wasAddedToSelection){var C=ko(t.state.editingGroupId,w,_),O=qe(e.origin.x-e.drag.offset.x,e.origin.y-e.drag.offset.y,t.state.gridSize),I=O[0],M=O[1];Zr(C,{x:C.x+(I-f),y:C.y+(M-h)}),y.push(C),x.push(_),k.set(_.id,C.id)}else y.push(_)}var P=Gh(Gh([],y,!0),x,!0);fa(P,x,k,"duplicatesServeAsOld"),t.scene.replaceAllElements(P)}return}}var T=t.state.draggingElement;if(T){if("freedraw"===T.type){var L=T.points,A=o.x-T.x,D=o.y-T.y,z=T.simulatePressure?T.pressures:Gh(Gh([],T.pressures,!0),[n.pressure],!1);Zr(T,{points:Gh(Gh([],L,!0),[[A,D]],!1),pressures:z})}else if(De(T)){e.drag.hasOccurred=!0;L=T.points,A=a-T.x,D=l-T.y;gn(n)&&2===L.length&&(A=(r=$r(t.state.elementType,A,D)).width,D=r.height),1===L.length?Zr(T,{points:Gh(Gh([],L,!0),[[A,D]],!1)}):L.length>1&&Zr(T,{points:Gh(Gh([],L.slice(0,-1),!0),[[A,D]],!1)}),Ne(T)&&t.maybeSuggestBindingForLinearElementAtCursor(T,"end",o,t.state.startBoundElement)}else e.lastCoords.x=o.x,e.lastCoords.y=o.y,t.maybeDragNewGenericElement(e,n);if("selection"===t.state.elementType){var N=t.scene.getElements();!n.shiftKey&&Ga(N,t.state)&&(e.withCmdOrCtrl&&e.hit.element?t.setState((function(n){var r;return lo(Kh(Kh({},n),{},{selectedElementIds:(r={},r[e.hit.element.id]=!0,r)}),t.scene.getElements())})):t.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}));var H=function(e,t){var n=Qe(t),r=n[0],o=n[1],i=n[2],a=n[3];return e.filter((function(e){var t=ot(e),n=t[0],l=t[1],s=t[2],c=t[3];return"selection"!==e.type&&r<=n&&o<=l&&i>=s&&a>=c}))}(N,T);t.setState((function(n){var r;return lo(Kh(Kh({},n),{},{selectedElementIds:Kh(Kh(Kh({},n.selectedElementIds),H.reduce((function(e,t){return e[t.id]=!0,e}),{})),e.hit.element?(r={},r[e.hit.element.id]=!H.length,r):null)}),t.scene.getElements())}))}}}}}))},t.prototype.handlePointerMoveOverScrollbars=function(e,t){if(t.scrollbars.isOverHorizontal){var n=e.clientX,r=n-t.lastCoords.x;return this.setState({scrollX:this.state.scrollX-r/this.state.zoom.value}),t.lastCoords.x=n,!0}if(t.scrollbars.isOverVertical){var o=e.clientY,i=o-t.lastCoords.y;return this.setState({scrollY:this.state.scrollY-i/this.state.zoom.value}),t.lastCoords.y=o,!0}return!1},t.prototype.onPointerUpFromPointerDownHandler=function(e){var t=this;return Hn((function(n){var r,o=t.state,i=o.draggingElement,a=o.resizingElement,l=o.multiElement,s=o.elementType,u=o.elementLocked,d=o.isResizing,p=o.isRotating;if(t.setState({isResizing:!1,isRotating:!1,resizingElement:null,selectionElement:null,cursorButton:"up",editingElement:l||Te(t.state.editingElement)?t.state.editingElement:null}),t.savePointer(n.clientX,n.clientY,"up"),t.state.editingLinearElement){var f=Fi.handlePointerUp(n,t.state.editingLinearElement,t.state);f!==t.state.editingLinearElement&&t.setState({editingLinearElement:f,suggestedBindings:[]})}if(lg=null,window.removeEventListener(c.Ks.POINTER_MOVE,e.eventListeners.onMove),window.removeEventListener(c.Ks.POINTER_UP,e.eventListeners.onUp),window.removeEventListener(c.Ks.KEYDOWN,e.eventListeners.onKeyDown),window.removeEventListener(c.Ks.KEYUP,e.eventListeners.onKeyUp),t.state.pendingImageElement&&t.setState({pendingImageElement:null}),"freedraw"===(null==i?void 0:i.type)){var h=Mn(n,t.state),g=i.points,m=h.x-i.x,v=h.y-i.y;m===g[0][0]&&v===g[0][1]&&(v+=1e-4,m+=1e-4);var b=i.simulatePressure?[]:Gh(Gh([],i.pressures,!0),[n.pressure],!1);return Zr(i,{points:Gh(Gh([],g,!0),[[m,v]],!1),pressures:b,lastCommittedPoint:[m,v]}),void t.actionManager.executeAction(Hc)}if(Pe(i)){var y=i;try{t.initializeImageDimensions(y),t.setState({selectedElementIds:(r={},r[y.id]=!0,r)},(function(){t.actionManager.executeAction(Hc)}))}catch(e){console.error(e),t.scene.replaceAllElements(t.scene.getElementsIncludingDeleted().filter((function(e){return e.id!==y.id}))),t.actionManager.executeAction(Hc)}}else if(De(i)){i.points.length>1&&t.history.resumeRecording();h=Mn(n,t.state);e.drag.hasOccurred||!i||l?e.drag.hasOccurred&&!l&&(Gi(t.state)&&Ne(i)&&qi(i,t.state,t.scene,h),t.setState({suggestedBindings:[],startBoundElement:null}),u?t.setState((function(e){var n;return{draggingElement:null,selectedElementIds:Kh(Kh({},e.selectedElementIds),{},(n={},n[t.state.draggingElement.id]=!0,n))}})):(jn(t.canvas),t.setState((function(e){var n;return{draggingElement:null,elementType:"selection",selectedElementIds:Kh(Kh({},e.selectedElementIds),{},(n={},n[t.state.draggingElement.id]=!0,n))}})))):(Zr(i,{points:Gh(Gh([],i.points,!0),[[h.x-i.x,h.y-i.y]],!1)}),t.setState({multiElement:i,editingElement:t.state.draggingElement}))}else{if("selection"!==s&&i&&Xr(i))return t.scene.replaceAllElements(t.scene.getElementsIncludingDeleted().slice(0,-1)),void t.setState({draggingElement:null});i&&Zr(i,Qr(i)),a&&t.history.resumeRecording(),a&&Xr(a)&&t.scene.replaceAllElements(t.scene.getElementsIncludingDeleted().filter((function(e){return e.id!==a.id})));var x=e.hit.element;if(x&&!e.drag.hasOccurred&&!e.hit.wasAddedToSelection)if(n.shiftKey)if(t.state.selectedElementIds[x.id])if(oo(t.state,x)){var w=x.groupIds.flatMap((function(e){return co(t.scene.getElements(),e)})).map((function(e){var t;return(t={})[e.id]=!1,t})).reduce((function(e,t){return Kh(Kh({},e),t)}),{});t.setState((function(e){return{selectedGroupIds:Kh(Kh({},e.selectedElementIds),x.groupIds.map((function(e){var t;return(t={})[e]=!1,t})).reduce((function(e,t){return Kh(Kh({},e),t)}),{})),selectedElementIds:Kh(Kh({},e.selectedElementIds),w)}}))}else t.setState((function(e){var n;return lo(Kh(Kh({},e),{},{selectedElementIds:Kh(Kh({},e.selectedElementIds),{},(n={},n[x.id]=!1,n))}),t.scene.getElements())}));else t.setState((function(e){var t;return{selectedElementIds:Kh(Kh({},e.selectedElementIds),{},(t={},t[x.id]=!0,t))}}));else t.setState((function(e){var n;return Kh({},lo(Kh(Kh({},e),{},{selectedElementIds:(n={},n[x.id]=!0,n)}),t.scene.getElements()))}));t.state.editingLinearElement||e.drag.hasOccurred||t.state.isResizing||!(x&&ei(x,t.state,e.origin.x,e.origin.y)||!x&&e.hit.hasHitCommonBoundingBoxOfSelectedElements)?(!u&&"freedraw"!==s&&i&&t.setState((function(e){var t;return{selectedElementIds:Kh(Kh({},e.selectedElementIds),{},(t={},t[i.id]=!0,t))}})),("selection"!==s||Ga(t.scene.getElements(),t.state))&&t.history.resumeRecording(),(e.drag.hasOccurred||d||p)&&(Gi(t.state)?Zi:Ji)(Wa(t.scene.getElements(),t.state)),u||"freedraw"===s?t.setState({draggingElement:null,suggestedBindings:[]}):(jn(t.canvas),t.setState({draggingElement:null,suggestedBindings:[],elementType:"selection"}))):t.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})}}))},t.prototype.maybeSuggestBindingForAll=function(e){var t,n,r=(t=e,n=new Set(t.map((function(e){return e.id}))),t.flatMap((function(e){return Ne(e)?sa(e).filter((function(e){return!n.has(e.id)})):Re(e)?da(e).filter((function(e){return!n.has(e[0].id)})):[]})));this.setState({suggestedBindings:r})},t.prototype.clearSelection=function(e){this.setState((function(t){return{selectedElementIds:{},selectedGroupIds:{},editingGroupId:t.editingGroupId&&null!=e&&so(e,t.editingGroupId)?t.editingGroupId:null}})),this.setState({selectedElementIds:{},previousSelectedElementIds:this.state.selectedElementIds})},t.prototype.getTextWysiwygSnappedToCenterPosition=function(e,t,n,r,o){var i=function(e,t,n){for(var r=null,o=e.length-1;o>=0;--o)if(!e[o].isDeleted){var i=Qe(e[o]),a=i[0],l=i[1],s=i[2],c=i[3];if(a<t&&t<s&&l<n&&n<c){r=e[o];break}}return r}(this.scene.getElementsIncludingDeleted().filter((function(e){return!Te(e)})),e,t);if(i){var a=i.x+i.width/2,l=i.y+i.height/2;if(Math.hypot(e-a,t-l)<c.wZ){var s=Pn({sceneX:a,sceneY:l},n);return{viewportX:s.x,viewportY:s.y,elementCenterX:a,elementCenterY:l}}}},t.prototype.getCanvasOffsets=function(){var e;if(null!==(e=this.excalidrawContainerRef)&&void 0!==e&&e.current){var t=this.excalidrawContainerRef.current.getBoundingClientRect();return{offsetLeft:t.left,offsetTop:t.top}}return{offsetLeft:0,offsetTop:0}},t.prototype.updateLanguage=function(){var e=this;return(0,d.Z)((function(){var t;return Vh(this,(function(n){switch(n.label){case 0:return t=m.find((function(t){return t.code===e.props.langCode}))||g,[4,x(t)];case 1:return n.sent(),e.setAppState({}),[2]}}))}))()},t}(s().Component);cg.defaultProps={UIOptions:c.cW};var ug=function(){var e=this;this.canvas=null,this.rc=null,this.unmounted=!1,this.isMobile=!1,this.excalidrawContainerRef=s().createRef(),this.files={},this.imageCache=new Map,this.focusContainer=function(){var t;e.props.autoFocus&&(null===(t=e.excalidrawContainerRef.current)||void 0===t||t.focus())},this.getSceneElementsIncludingDeleted=function(){return e.scene.getElementsIncludingDeleted()},this.getSceneElements=function(){return e.scene.getElements()},this.syncActionResult=Hn((function(t){if(!e.unmounted&&!1!==t){var n=null;if(t.elements&&(t.elements.forEach((function(t){var r;(null===(r=e.state.editingElement)||void 0===r?void 0:r.id)===t.id&&e.state.editingElement!==t&&Ra(t)&&(n=t)})),e.scene.replaceAllElements(t.elements),t.commitToHistory&&e.history.resumeRecording()),t.files&&(e.files=t.replaceFiles?t.files:Kh(Kh({},e.files),t.files),e.addNewImagesToImageCache()),t.appState||n){var r,o,i,a,l,s;t.commitToHistory&&e.history.resumeRecording();var u=(null==t||null===(r=t.appState)||void 0===r?void 0:r.viewModeEnabled)||!1,d=(null==t||null===(o=t.appState)||void 0===o?void 0:o.zenModeEnabled)||!1,p=(null==t||null===(i=t.appState)||void 0===i?void 0:i.gridSize)||null,f=(null==t||null===(a=t.appState)||void 0===a?void 0:a.theme)||c.C6.LIGHT,h=null!==(l=null==t||null===(s=t.appState)||void 0===s?void 0:s.name)&&void 0!==l?l:e.state.name;void 0!==e.props.viewModeEnabled&&(u=e.props.viewModeEnabled),void 0!==e.props.zenModeEnabled&&(d=e.props.zenModeEnabled),void 0!==e.props.gridModeEnabled&&(p=e.props.gridModeEnabled?c.k:null),void 0!==e.props.theme&&(f=e.props.theme),void 0!==e.props.name&&(h=e.props.name),e.setState((function(e){var r;return Object.assign(t.appState||{},{editingElement:n||(null===(r=t.appState)||void 0===r?void 0:r.editingElement)||null,viewModeEnabled:u,zenModeEnabled:d,gridSize:p,theme:f,name:h})}),(function(){t.syncHistory&&e.history.setCurrentState(e.state,e.scene.getElementsIncludingDeleted())}))}}})),this.onBlur=Hn((function(){tg=!1,e.setState({isBindingEnabled:!0})})),this.onUnload=function(){e.onBlur()},this.disableEvent=function(e){e.preventDefault()},this.onFontLoaded=function(){e.scene.getElementsIncludingDeleted().forEach((function(e){Te(e)&&_r(e)})),e.onSceneUpdated()},this.importLibraryFromUrl=function(){var t=(0,d.Z)((function(t,n){var r,o,i,a,l,s,u;return Vh(this,(function(d){switch(d.label){case 0:window.location.hash.includes(c.ah.addLibrary)?((r=new URLSearchParams(window.location.hash.slice(1))).delete(c.ah.addLibrary),window.history.replaceState({},c.iC,"#".concat(r.toString()))):window.location.search.includes(c.UO.addLibrary)&&((o=new URLSearchParams(window.location.search)).delete(c.UO.addLibrary),window.history.replaceState({},c.iC,"?".concat(o.toString()))),d.label=1;case 1:return d.trys.push([1,7,8,9]),[4,fetch(decodeURIComponent(t))];case 2:return[4,d.sent().blob()];case 3:return i=d.sent(),s=(l=JSON).parse,[4,i.text()];case 4:if(!function(e){return"object"==typeof e&&e&&e.type===c.r8.excalidrawLibrary&&(1===e.version||2===e.version)}(a=s.apply(l,[d.sent()])))throw new Error;return n===e.id||window.confirm(S("alerts.confirmAddLibrary",{numShapes:(a.libraryItems||a.library||[]).length}))?[4,e.library.importLibrary(i,"published")]:[3,6];case 5:d.sent(),e.state.isLibraryOpen&&e.setState({isLibraryOpen:!1}),e.setState({isLibraryOpen:!0}),d.label=6;case 6:return[3,9];case 7:return u=d.sent(),window.alert(S("alerts.errorLoadingLibrary")),console.error(u),[3,9];case 8:return e.focusContainer(),[7];case 9:return[2]}}))}));return function(e,n){return t.apply(this,arguments)}}(),this.resetHistory=function(){e.history.clear()},this.resetScene=Hn((function(t){e.scene.replaceAllElements([]),e.setState((function(n){return Kh(Kh({},Un()),{},{isLoading:(null==t||!t.resetLoadingState)&&n.isLoading,theme:e.state.theme})})),e.resetHistory()})),this.initializeScene=(0,d.Z)((function(){var t,n,r,o,i,a,l,s;return Vh(this,(function(u){switch(u.label){case 0:"launchQueue"in window&&"LaunchParams"in window&&window.launchQueue.setConsumer(function(){var t=(0,d.Z)((function(t){var n,r;return Vh(this,(function(o){switch(o.label){case 0:return t.files.length?[4,(n=t.files[0]).getFile()]:[2];case 1:return(r=o.sent()).handle=n,xu(r,e.state,e.scene.getElementsIncludingDeleted()).then((function(t){e.syncActionResult(Kh(Kh({},t),{},{appState:Kh(Kh({},t.appState||e.state),{},{isLoading:!1}),commitToHistory:!0}))})).catch((function(t){e.setState({isLoading:!1,errorMessage:t.message})})),[2]}}))}));return function(e){return t.apply(this,arguments)}}()),e.state.isLoading||e.setState({isLoading:!0}),o=null,u.label=1;case 1:return u.trys.push([1,3,,4]),[4,e.props.initialData];case 2:return o=u.sent()||null,null!==(i=o)&&void 0!==i&&i.libraryItems&&(e.libraryItemsFromStorage=pu(o.libraryItems,"unpublished")),[3,4];case 3:return a=u.sent(),console.error(a),o={appState:{errorMessage:a.message||"Encountered an error during importing or restoring scene data"}},[3,4];case 4:return(l=du(o,null,null)).appState=Kh(Kh({},l.appState),{},{elementType:"image"===l.appState.elementType?"selection":l.appState.elementType,isLoading:!1}),null!==(t=o)&&void 0!==t&&t.scrollToContent&&(l.appState=Kh(Kh({},l.appState),Ya(l.elements,Kh(Kh({},l.appState),{},{width:e.state.width,height:e.state.height,offsetTop:e.state.offsetTop,offsetLeft:e.state.offsetLeft})))),null!=(null===(n=o)||void 0===n?void 0:n.scrollX)&&(l.appState.scrollX=o.scrollX),null!=(null===(r=o)||void 0===r?void 0:r.scrollY)&&(l.appState.scrollY=o.scrollY),e.resetHistory(),e.syncActionResult(Kh(Kh({},l),{},{commitToHistory:!0})),(s=new URLSearchParams(window.location.hash.slice(1)).get(c.ah.addLibrary)||new URLSearchParams(window.location.search).get(c.UO.addLibrary))?[4,e.importLibraryFromUrl(s)]:[3,6];case 5:u.sent(),u.label=6;case 6:return[2]}}))})),this.onResize=Hn((function(){e.scene.getElementsIncludingDeleted().forEach((function(e){return _r(e)})),e.setState({})})),this.onScroll=Sn((function(){var t=e.getCanvasOffsets(),n=t.offsetTop,r=t.offsetLeft;e.setState((function(e){return e.offsetLeft===r&&e.offsetTop===n?null:{offsetTop:n,offsetLeft:r}}))}),c.HM),this.onCut=Hn((function(t){var n;(null===(n=e.excalidrawContainerRef.current)||void 0===n?void 0:n.contains(document.activeElement))&&!yn(t.target)&&(e.cutAll(),t.preventDefault())})),this.onCopy=Hn((function(t){var n;(null===(n=e.excalidrawContainerRef.current)||void 0===n?void 0:n.contains(document.activeElement))&&!yn(t.target)&&(e.copyAll(),t.preventDefault())})),this.cutAll=function(){e.copyAll(),e.actionManager.executeAction(Ps)},this.copyAll=function(){gd(e.scene.getElements(),e.state,e.files)},this.onTapStart=function(t){if(!$h)return $h=!0,clearTimeout(Qh),void(Qh=window.setTimeout(cg.resetTapTwice,c.Gj));if($h&&1===t.touches.length){var n=t.touches[0];e.handleCanvasDoubleClick({clientX:n.clientX,clientY:n.clientY}),$h=!1,clearTimeout(Qh)}t.preventDefault(),2===t.touches.length&&e.setState({selectedElementIds:{}})},this.onTapEnd=function(t){t.touches.length>0&&e.setState({previousSelectedElementIds:{},selectedElementIds:e.state.previousSelectedElementIds})},this.pasteFromClipboard=Hn(function(){var t=(0,d.Z)((function(t){var n,r,o,i,a,l,s,c,u,d,p,f,h;return Vh(this,(function(g){switch(g.label){case 0:return o=document.activeElement,(null===(n=e.excalidrawContainerRef.current)||void 0===n?void 0:n.contains(o))?(i=document.elementFromPoint(Jh,eg),!t||i instanceof HTMLCanvasElement&&!yn(o)?(a=null==t||null===(r=t.clipboardData)||void 0===r?void 0:r.files[0],[4,yd(t)]):[2]):[2];case 1:if(l=g.sent(),!a&&l.text&&(s=l.text.trim()).startsWith("<svg")&&s.endsWith("</svg>")&&(a=_u(s)),yu(a))return c=Mn({clientX:Jh,clientY:eg},e.state),u=c.x,d=c.y,p=e.createImageElement({sceneX:u,sceneY:d}),e.insertImageElement(p,a),e.initializeImageDimensions(p),e.setState({selectedElementIds:(h={},h[p.id]=!0,h)}),[2];if(!e.props.onPaste)return[3,5];g.label=2;case 2:return g.trys.push([2,4,,5]),[4,e.props.onPaste(l,t)];case 3:return!1===g.sent()?[2]:[3,5];case 4:return f=g.sent(),console.error(f),[3,5];case 5:return l.errorMessage?e.setState({errorMessage:l.errorMessage}):l.spreadsheet?e.setState({pasteDialog:{data:l.spreadsheet,shown:!0}}):l.elements?e.addElementsFromPasteOrLibrary({elements:l.elements,files:l.files||null,position:"cursor"}):l.text&&e.addTextFromPaste(l.text),e.selectShapeTool("selection"),null==t||t.preventDefault(),[2]}}))}));return function(e){return t.apply(this,arguments)}}()),this.addElementsFromPasteOrLibrary=function(t){var n=cu(t.elements,null),r=it(n),o=r[0],i=r[1],a=r[2],l=r[3],s=En(o,a)/2,c=En(i,l)/2,u="object"==typeof t.position?t.position.clientX:"cursor"===t.position?Jh:e.state.width/2+e.state.offsetLeft,d="object"==typeof t.position?t.position.clientY:"cursor"===t.position?eg:e.state.height/2+e.state.offsetTop,p=Mn({clientX:u,clientY:d},e.state),f=p.x-s,h=p.y-c,g=new Map,m=qe(f,h,e.state.gridSize),v=m[0],b=m[1],y=new Map,x=n.map((function(t){var n=ko(e.state.editingGroupId,g,t,{x:t.x+v-o,y:t.y+b-i});return y.set(t.id,n.id),n})),w=Gh(Gh([],e.scene.getElementsIncludingDeleted(),!0),x,!0);fa(w,n,y),t.files&&(e.files=Kh(Kh({},e.files),t.files)),e.scene.replaceAllElements(w),e.history.resumeRecording(),e.setState(lo(Kh(Kh({},e.state),{},{isLibraryOpen:!1,selectedElementIds:x.reduce((function(e,t){return e[t.id]=!0,e}),{}),selectedGroupIds:{}}),e.scene.getElements()),(function(){t.files&&e.addNewImagesToImageCache()})),e.selectShapeTool("selection")},this.setAppState=function(t){e.setState(t)},this.removePointer=function(e){"touch"===e.pointerType&&ig&&(clearTimeout(ig),ig=0,ag=!1),sg.pointers.delete(e.pointerId)},this.toggleLock=function(){e.setState((function(e){return{elementLocked:!e.elementLocked,elementType:e.elementLocked?"selection":e.elementType}}))},this.toggleZenMode=function(){e.actionManager.executeAction(Fp)},this.toggleStats=function(){e.state.showStats||Rc("dialog","stats"),e.actionManager.executeAction(Gp)},this.scrollToContent=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.scene.getElements();e.setState(Kh({},Ya(Array.isArray(t)?t:[t],e.state,e.canvas)))},this.clearToast=function(){e.setState({toastMessage:null})},this.setToastMessage=function(t){e.setState({toastMessage:t})},this.restoreFileFromShare=(0,d.Z)((function(){var t,n,r,o;return Vh(this,(function(i){switch(i.label){case 0:return i.trys.push([0,6,,7]),[4,caches.open("web-share-target")];case 1:return[4,(t=i.sent()).match("shared-file")];case 2:return(n=i.sent())?[4,n.blob()]:[3,5];case 3:return r=i.sent(),e.loadFileToCanvas(r),[4,t.delete("shared-file")];case 4:i.sent(),window.history.replaceState(null,c.iC,window.location.pathname),i.label=5;case 5:return[3,7];case 6:return o=i.sent(),e.setState({errorMessage:o.message}),[3,7];case 7:return[2]}}))})),this.addFiles=Hn((function(t){var n=t.reduce((function(e,t){return e.set(t.id,t),e}),new Map);e.files=Kh(Kh({},e.files),Object.fromEntries(n)),e.scene.getElements().forEach((function(t){Me(t)&&n.has(t.fileId)&&(e.imageCache.delete(t.fileId),_r(t),qr(t))})),e.scene.informMutation(),e.addNewImagesToImageCache()})),this.updateScene=Hn((function(t){t.commitToHistory&&e.history.resumeRecording(),t.appState&&e.setState(t.appState),t.elements&&e.scene.replaceAllElements(t.elements),t.collaborators&&e.setState({collaborators:t.collaborators})})),this.onSceneUpdated=function(){e.setState({})},this.updateCurrentCursorPosition=Hn((function(e){Jh=e.clientX,eg=e.clientY})),this.onKeyDown=Hn((function(t){var n;if(("Proxy"in window&&(!t.shiftKey&&/^[A-Z]$/.test(t.key)||t.shiftKey&&/^[a-z]$/.test(t.key))&&(t=new Proxy(t,{get:function(e,n){var r=e[n];return"function"==typeof r?r.bind(e):"key"===n?t.shiftKey?e.key.toUpperCase():e.key.toLowerCase():r}})),!(yn(t.target)&&t.key!==Kt||pn(t.key)&&(n=t.target,n instanceof HTMLElement&&"wysiwyg"===n.dataset.type||n instanceof HTMLBRElement||n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement)))&&(t.key===Zt&&e.setState({showHelpDialog:!0}),!e.actionManager.handleKeyDown(t)&&!e.state.viewModeEnabled)){if(t[Vt]&&e.state.isBindingEnabled&&e.setState({isBindingEnabled:!1}),t.code===_t&&e.setState({isLibraryOpen:!e.state.isLibraryOpen}),pn(t.key)){var r=e.state.gridSize&&(t.shiftKey?c.$e:e.state.gridSize)||(t.shiftKey?c.Iw:c.$e),o=e.scene.getElements().filter((function(t){return e.state.selectedElementIds[t.id]})),i=0,a=0;t.key===Ht?i=-r:t.key===Rt?i=r:t.key===Bt?a=-r:t.key===Nt&&(a=r),o.forEach((function(e){Zr(e,{x:e.x+i,y:e.y+a}),ra(e,{simultaneouslyUpdated:o})})),e.maybeSuggestBindingForAll(o),t.preventDefault()}else if(t.key===Wt){if(1===(u=Wa(e.scene.getElements(),e.state)).length&&De(u[0]))e.state.editingLinearElement&&e.state.editingLinearElement.elementId===u[0].id||(e.history.resumeRecording(),e.setState({editingLinearElement:new Fi(u[0],e.scene)}));else if(1===u.length&&!De(u[0])){var l=u[0];return e.startTextEditing({sceneX:l.x+l.width/2,sceneY:l.y+l.height/2}),void t.preventDefault()}}else if(!t.ctrlKey&&!t.altKey&&!t.metaKey&&null===e.state.draggingElement){var s=function(e){var t=uf.find((function(t,n){return e===(n+1).toString()||t.key&&("string"==typeof t.key?t.key===e:t.key.includes(e))}));return(null==t?void 0:t.value)||null}(t.key);s?e.selectShapeTool(s):t.key===rn&&e.toggleLock()}if(t.key===Yt&&0===sg.pointers.size&&(tg=!0,_n(e.canvas,c.oc.GRABBING)),t.key===Jt||t.key===an){var u=Wa(e.scene.getElements(),e.state);if("selection"===e.state.elementType&&!u.length)return;t.key===Jt&&(qa(e.state.elementType)||u.some((function(e){return qa(e.type)})))&&e.setState({openPopup:"backgroundColorPicker"}),t.key===an&&e.setState({openPopup:"strokeColorPicker"})}}})),this.onKeyUp=Hn((function(t){if(t.key===Yt&&(e.state.viewModeEnabled?_n(e.canvas,c.oc.GRAB):"selection"===e.state.elementType?jn(e.canvas):(Cn(e.canvas,e.state.elementType),e.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})),tg=!1),t[Vt]||e.state.isBindingEnabled||e.setState({isBindingEnabled:!0}),pn(t.key)){var n=Wa(e.scene.getElements(),e.state);Gi(e.state)?Zi(n):Ji(n),e.setState({suggestedBindings:[]})}})),this.onGestureStart=Hn((function(t){t.preventDefault(),e.setState({selectedElementIds:{}}),sg.initialScale=e.state.zoom.value})),this.onGestureChange=Hn((function(t){if(t.preventDefault(),2!==sg.pointers.size){var n=sg.initialScale;n&&e.setState((function(e){var r=e.zoom,o=e.offsetLeft,i=e.offsetTop;return{zoom:rl(ol(n*t.scale),r,{left:o,top:i},{x:Jh,y:eg})}}))}})),this.onGestureEnd=Hn((function(t){t.preventDefault(),e.setState({previousSelectedElementIds:{},selectedElementIds:e.state.previousSelectedElementIds}),sg.initialScale=null})),this.startTextEditing=function(t){var n=t.sceneX,r=t.sceneY,o=t.insertAtParentCenter,i=void 0===o||o,a=e.getTextElementAtPosition(n,r),l=i&&e.getTextWysiwygSnappedToCenterPosition(n,r,e.state,e.canvas,window.devicePixelRatio),s=a||bo({x:l?l.elementCenterX:n,y:l?l.elementCenterY:r,strokeColor:e.state.currentItemStrokeColor,backgroundColor:e.state.currentItemBackgroundColor,fillStyle:e.state.currentItemFillStyle,strokeWidth:e.state.currentItemStrokeWidth,strokeStyle:e.state.currentItemStrokeStyle,roughness:e.state.currentItemRoughness,opacity:e.state.currentItemOpacity,strokeSharpness:e.state.currentItemStrokeSharpness,text:"",fontSize:e.state.currentItemFontSize,fontFamily:e.state.currentItemFontFamily,textAlign:l?"center":e.state.currentItemTextAlign,verticalAlign:l?"middle":c.hs});e.setState({editingElement:s}),a?l&&"center"===s.textAlign||Zr(s,{verticalAlign:c.hs}):(e.scene.replaceAllElements(Gh(Gh([],e.scene.getElementsIncludingDeleted(),!0),[s],!1)),l||Zr(s,{y:s.y-s.baseline/2})),e.setState({editingElement:s}),e.handleTextWysiwyg(s,{isExistingElement:!!a})},this.handleCanvasDoubleClick=function(t){if(!e.state.multiElement&&"selection"===e.state.elementType){var n=Wa(e.scene.getElements(),e.state);if(1===n.length&&De(n[0]))e.state.editingLinearElement&&e.state.editingLinearElement.elementId===n[0].id||(e.history.resumeRecording(),e.setState({editingLinearElement:new Fi(n[0],e.scene)}));else{jn(e.canvas);var r=Mn(t,e.state),o=r.x,i=r.y;if(ao(e.state).length>0){var a=e.getElementAtPosition(o,i),l=a&&function(e,t){return e.groupIds.find((function(e){return t[e]}))}(a,e.state.selectedGroupIds);if(l)return void e.setState((function(t){var n;return lo(Kh(Kh({},t),{},{editingGroupId:l,selectedElementIds:(n={},n[a.id]=!0,n),selectedGroupIds:{}}),e.scene.getElements())}))}jn(e.canvas),t[Vt]||e.state.viewModeEnabled||e.startTextEditing({sceneX:o,sceneY:i,insertAtParentCenter:!t.altKey})}}},this.handleCanvasPointerMove=function(t){e.savePointer(t.clientX,t.clientY,e.state.cursorButton),sg.pointers.has(t.pointerId)&&sg.pointers.set(t.pointerId,{x:t.clientX,y:t.clientY});var n=sg.initialScale;if(2===sg.pointers.size&&sg.lastCenter&&n&&sg.initialDistance){var r=tf(sg.pointers),o=r.x-sg.lastCenter.x,i=r.y-sg.lastCenter.y;sg.lastCenter=r;var a=nf(Array.from(sg.pointers.values()))/sg.initialDistance;e.setState((function(e){var t=e.zoom,l=e.scrollX,s=e.scrollY,c=e.offsetLeft,u=e.offsetTop;return{scrollX:l+o/t.value,scrollY:s+i/t.value,zoom:rl(ol(n*a),t,{left:c,top:u},r),shouldCacheIgnoreZoom:!0}})),e.resetShouldCacheIgnoreZoomDebounced()}else sg.lastCenter=sg.initialDistance=sg.initialScale=null;if(!(tg||ng||rg)){var l=Va(og,t.clientX-e.state.offsetLeft,t.clientY-e.state.offsetTop).isOverEither;e.state.draggingElement||e.state.multiElement||(l?jn(e.canvas):Cn(e.canvas,e.state.elementType));var s=Mn(t,e.state),u=s.x,d=s.y;if(e.state.editingLinearElement&&!e.state.editingLinearElement.isDragging){var p=Fi.handlePointerMove(t,u,d,e.state.editingLinearElement,e.state.gridSize);p!==e.state.editingLinearElement&&e.setState({editingLinearElement:p}),null!=p.lastUncommittedPoint?e.maybeSuggestBindingAtCursor(s):e.setState({suggestedBindings:[]})}if(He(e.state.elementType)){var f=e.state.draggingElement;Ne(f)?e.maybeSuggestBindingForLinearElementAtCursor(f,"end",s,e.state.startBoundElement):e.maybeSuggestBindingAtCursor(s)}if(e.state.multiElement){var h=e.state.multiElement,g=h.x,m=h.y,v=h.points,b=h.lastCommittedPoint,y=v[v.length-1];return Cn(e.canvas,e.state.elementType),void(y===b?Ve(u-g,d-m,y[0],y[1])>=c.qx?Zr(h,{points:Gh(Gh([],v,!0),[[u-g,d-m]],!1)}):_n(e.canvas,c.oc.POINTER):v.length>2&&b&&Ve(u-g,d-m,b[0],b[1])<c.qx?(_n(e.canvas,c.oc.POINTER),Zr(h,{points:v.slice(0,-1)})):(Ge(v,e.state.zoom.value)&&_n(e.canvas,c.oc.POINTER),Zr(h,{points:Gh(Gh([],v.slice(0,-1),!0),[[u-g,d-m]],!1)})))}if(!(Boolean(t.buttons)||"selection"!==e.state.elementType&&"text"!==e.state.elementType)){var x=e.scene.getElements(),w=Wa(x,e.state);if(1!==w.length||l||e.state.editingLinearElement){if(w.length>1&&!l){var k=Di(it(w),u,d,e.state.zoom,t.pointerType);if(k)return void _n(e.canvas,Ni({transformHandleType:k}))}}else{var S=Ai(x,e.state,u,d,e.state.zoom,t.pointerType);if(S&&S.transformHandleType)return void _n(e.canvas,Ni(S))}var E=e.getElementAtPosition(s.x,s.y);"text"===e.state.elementType?_n(e.canvas,Te(E)?c.oc.TEXT:c.oc.CROSSHAIR):e.state.viewModeEnabled?_n(e.canvas,c.oc.GRAB):l||t[Vt]||!E&&!e.isHittingCommonBoundingBoxOfSelectedElements(s,w)?_n(e.canvas,c.oc.AUTO):_n(e.canvas,c.oc.MOVE)}}},this.handleTouchMove=function(e){ag=!0},this.handleCanvasPointerDown=function(t){var n=document.getSelection();if(null!=n&&n.anchorNode&&n.removeAllRanges(),e.maybeOpenContextMenuAfterPointerDownOnTouchDevices(t),e.maybeCleanupAfterMissingPointerUp(t),!ng&&(e.setState({lastPointerDownWith:t.pointerType,cursorButton:"down"}),e.savePointer(t.clientX,t.clientY,"down"),!e.handleCanvasPanUsingWheelOrSpaceDrag(t)&&!(t.button!==c.Oh.MAIN&&t.button!==c.Oh.TOUCH||(e.updateGestureOnPointerDown(t),sg.pointers.size>1)))){var r=e.initialPointerDownState(t);if(!e.handleDraggingScrollBar(t,r)&&(e.clearSelectionIfNotUsingSelection(),e.updateBindingEnabledOnPointerMove(t),!e.handleSelectionOnPointerDown(t,r)))if("text"!==e.state.elementType){if("arrow"===e.state.elementType||"line"===e.state.elementType)e.handleLinearElementOnPointerDown(t,e.state.elementType,r);else if("image"===e.state.elementType){if(_n(e.canvas,c.oc.CROSSHAIR),!e.state.pendingImageElement)return;e.setState({draggingElement:e.state.pendingImageElement,editingElement:e.state.pendingImageElement,pendingImageElement:null,multiElement:null});var o=Mn(t,e.state),i=o.x,a=o.y;Zr(e.state.pendingImageElement,{x:i,y:a})}else"freedraw"===e.state.elementType?e.handleFreeDrawElementOnPointerDown(t,e.state.elementType,r):e.createGenericElementOnPointerDown(e.state.elementType,r);var l=e.onPointerMoveFromPointerDownHandler(r),s=e.onPointerUpFromPointerDownHandler(r),u=e.onKeyDownFromPointerDownHandler(r),d=e.onKeyUpFromPointerDownHandler(r);lg=s,e.state.viewModeEnabled||(window.addEventListener(c.Ks.POINTER_MOVE,l),window.addEventListener(c.Ks.POINTER_UP,s),window.addEventListener(c.Ks.KEYDOWN,u),window.addEventListener(c.Ks.KEYUP,d),r.eventListeners.onMove=l,r.eventListeners.onUp=s,r.eventListeners.onKeyUp=d,r.eventListeners.onKeyDown=u)}else e.handleTextOnPointerDown(t,r)}},this.maybeOpenContextMenuAfterPointerDownOnTouchDevices=function(t){"touch"===t.pointerType&&(ag=!1,ig?ag=!0:ig=window.setTimeout((function(){ig=0,ag||e.handleCanvasContextMenu(t)}),c.nM))},this.handleCanvasPanUsingWheelOrSpaceDrag=function(t){if(0!==sg.pointers.size||!(t.button===c.Oh.WHEEL||t.button===c.Oh.MAIN&&tg||e.state.viewModeEnabled))return!1;ng=!0;var n=!1,r=/Linux/.test(window.navigator.platform);_n(e.canvas,c.oc.GRABBING);var o=t.clientX,i=t.clientY,a=Hn((function(t){var a=o-t.clientX,l=i-t.clientY;if(o=t.clientX,i=t.clientY,r&&!n&&(Math.abs(a)>1||Math.abs(l)>1)){n=!0;var s=function(e){document.body.removeEventListener(c.Ks.PASTE,s),e.stopPropagation()},u=function(){setTimeout((function(){document.body.removeEventListener(c.Ks.PASTE,s),window.removeEventListener(c.Ks.POINTER_UP,u)}),100)};document.body.addEventListener(c.Ks.PASTE,s),window.addEventListener(c.Ks.POINTER_UP,u)}e.setState({scrollX:e.state.scrollX-a/e.state.zoom.value,scrollY:e.state.scrollY-l/e.state.zoom.value})})),l=Hn(lg=function(){lg=null,ng=!1,tg||(e.state.viewModeEnabled?_n(e.canvas,c.oc.GRAB):Cn(e.canvas,e.state.elementType)),e.setState({cursorButton:"up"}),e.savePointer(t.clientX,t.clientY,"up"),window.removeEventListener(c.Ks.POINTER_MOVE,a),window.removeEventListener(c.Ks.POINTER_UP,l),window.removeEventListener(c.Ks.BLUR,l)});return window.addEventListener(c.Ks.BLUR,l),window.addEventListener(c.Ks.POINTER_MOVE,a,{passive:!0}),window.addEventListener(c.Ks.POINTER_UP,l),!0},this.clearSelectionIfNotUsingSelection=function(){"selection"!==e.state.elementType&&e.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})},this.handleSelectionOnPointerDown=function(t,n){if("selection"===e.state.elementType){var r=e.scene.getElements(),o=Wa(r,e.state);if(1!==o.length||e.state.editingLinearElement)o.length>1&&(n.resize.handleType=Di(it(o),n.origin.x,n.origin.y,e.state.zoom,t.pointerType));else{var i=Ai(r,e.state,n.origin.x,n.origin.y,e.state.zoom,t.pointerType);null!=i&&(e.setState({resizingElement:i.element}),n.resize.handleType=i.transformHandleType)}if(n.resize.handleType)_n(e.canvas,Ni({transformHandleType:n.resize.handleType})),n.resize.isResizing=!0,n.resize.offset=Dn(function(e,t,n,r){var o,i=1===t.length?Qe(t[0]):it(t),a=i[0],l=i[1],s=i[2],c=i[3],u=(a+s)/2,d=(l+c)/2,p=1===t.length?t[0].angle:0;switch(n=(o=Be(n,r,u,d,-p))[0],r=o[1],e){case"n":return Be(n-(a+s)/2,r-l,0,0,p);case"s":return Be(n-(a+s)/2,r-c,0,0,p);case"w":return Be(n-a,r-(l+c)/2,0,0,p);case"e":return Be(n-s,r-(l+c)/2,0,0,p);case"nw":return Be(n-a,r-l,0,0,p);case"ne":return Be(n-s,r-l,0,0,p);case"sw":return Be(n-a,r-c,0,0,p);case"se":return Be(n-s,r-c,0,0,p);default:return[0,0]}}(n.resize.handleType,o,n.origin.x,n.origin.y)),1===o.length&&De(o[0])&&2===o[0].points.length&&(n.resize.arrowDirection=(u=n.resize.handleType,d=o[0],p=d.points[1],f=p[0],h=p[1],"nw"===u&&(f<0||h<0)||"ne"===u&&f>=0||"sw"===u&&f<=0||"se"===u&&(f>0||h>0)?"end":"origin"));else{var a;if(e.state.editingLinearElement){var l=Fi.handlePointerDown(t,e.state,(function(t){return e.setState(t)}),e.history,n.origin);if(l.hitElement&&(n.hit.element=l.hitElement),l.didAddPoint)return!0}n.hit.element=null!==(a=n.hit.element)&&void 0!==a?a:e.getElementAtPosition(n.origin.x,n.origin.y),n.hit.allHitElements=e.getElementsAtPosition(n.origin.x,n.origin.y);var s=n.hit.element,c=n.hit.allHitElements.some((function(t){return e.isASelectedElement(t)}));if(null!==s&&c||t.shiftKey||n.hit.hasHitCommonBoundingBoxOfSelectedElements||e.clearSelection(s),null!=s){if(t[Vt])return e.state.selectedElementIds[s.id]||(n.hit.wasAddedToSelection=!0),e.setState((function(t){return Kh(Kh({},function(e,t){var n;return no(no({},e),{},{editingGroupId:t.groupIds.length?t.groupIds[0]:null,selectedGroupIds:{},selectedElementIds:(n={},n[t.id]=!0,n)})}(t,s)),{},{previousSelectedElementIds:e.state.selectedElementIds})})),!1;e.state.selectedElementIds[s.id]||(e.state.editingGroupId&&!so(s,e.state.editingGroupId)&&e.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}),c||n.hit.hasHitCommonBoundingBoxOfSelectedElements||(e.setState((function(t){var n;return lo(Kh(Kh({},t),{},{selectedElementIds:Kh(Kh({},t.selectedElementIds),{},(n={},n[s.id]=!0,n))}),e.scene.getElements())})),n.hit.wasAddedToSelection=!0))}e.setState({previousSelectedElementIds:e.state.selectedElementIds})}}var u,d,p,f,h;return!1},this.handleTextOnPointerDown=function(t,n){var r;"text"!==(null===(r=e.state.editingElement)||void 0===r?void 0:r.type)&&(e.startTextEditing({sceneX:n.origin.x,sceneY:n.origin.y,insertAtParentCenter:!t.altKey}),jn(e.canvas),e.state.elementLocked||e.setState({elementType:"selection"}))},this.handleFreeDrawElementOnPointerDown=function(t,n,r){var o,i=qe(r.origin.x,r.origin.y,null),a=i[0],l=i[1],s=(o={type:n,x:a,y:l,strokeColor:e.state.currentItemStrokeColor,backgroundColor:e.state.currentItemBackgroundColor,fillStyle:e.state.currentItemFillStyle,strokeWidth:e.state.currentItemStrokeWidth,strokeStyle:e.state.currentItemStrokeStyle,roughness:e.state.currentItemRoughness,opacity:e.state.currentItemOpacity,strokeSharpness:e.state.currentItemLinearStrokeSharpness,simulatePressure:.5===t.pressure},ho(ho({},go(o.type,o)),{},{points:o.points||[],pressures:[],simulatePressure:o.simulatePressure,lastCommittedPoint:null}));e.setState((function(e){var t;return{selectedElementIds:Kh(Kh({},e.selectedElementIds),{},(t={},t[s.id]=!1,t))}}));var c=s.simulatePressure?s.pressures:Gh(Gh([],s.pressures,!0),[t.pressure],!1);Zr(s,{points:[[0,0]],pressures:c});var u=ta(r.origin,e.scene);e.scene.replaceAllElements(Gh(Gh([],e.scene.getElementsIncludingDeleted(),!0),[s],!1)),e.setState({draggingElement:s,editingElement:s,startBoundElement:u,suggestedBindings:[]})},this.createImageElement=function(t){var n,r=t.sceneX,o=t.sceneY,i=qe(r,o,e.state.gridSize),a=i[0],l=i[1];return n={type:"image",x:a,y:l,strokeColor:e.state.currentItemStrokeColor,backgroundColor:e.state.currentItemBackgroundColor,fillStyle:e.state.currentItemFillStyle,strokeWidth:e.state.currentItemStrokeWidth,strokeStyle:e.state.currentItemStrokeStyle,roughness:e.state.currentItemRoughness,opacity:e.state.currentItemOpacity,strokeSharpness:e.state.currentItemLinearStrokeSharpness},ho(ho({},go("image",n)),{},{strokeColor:"transparent",status:"pending",fileId:null,scale:[1,1]})},this.handleLinearElementOnPointerDown=function(t,n,r){if(e.state.multiElement){var o=e.state.multiElement;if("line"===o.type&&Ge(o.points,e.state.zoom.value))return Zr(o,{lastCommittedPoint:o.points[o.points.length-1]}),void e.actionManager.executeAction(Hc);var i=o.x,a=o.y,l=o.lastCommittedPoint;if(o.points.length>1&&l&&Ve(r.origin.x-i,r.origin.y-a,l[0],l[1])<c.qx)return void e.actionManager.executeAction(Hc);e.setState((function(e){var t;return{selectedElementIds:Kh(Kh({},e.selectedElementIds),{},(t={},t[o.id]=!0,t))}})),Zr(o,{lastCommittedPoint:o.points[o.points.length-1]}),_n(e.canvas,c.oc.POINTER)}else{var s=qe(r.origin.x,r.origin.y,e.state.gridSize),u=s[0],d=s[1],p=e.state,f=p.currentItemStartArrowhead,h=p.currentItemEndArrowhead,g="arrow"===n?[f,h]:[null,null],m=g[0],v=g[1],b=xo({type:n,x:u,y:d,strokeColor:e.state.currentItemStrokeColor,backgroundColor:e.state.currentItemBackgroundColor,fillStyle:e.state.currentItemFillStyle,strokeWidth:e.state.currentItemStrokeWidth,strokeStyle:e.state.currentItemStrokeStyle,roughness:e.state.currentItemRoughness,opacity:e.state.currentItemOpacity,strokeSharpness:e.state.currentItemLinearStrokeSharpness,startArrowhead:m,endArrowhead:v});e.setState((function(e){var t;return{selectedElementIds:Kh(Kh({},e.selectedElementIds),{},(t={},t[b.id]=!1,t))}})),Zr(b,{points:Gh(Gh([],b.points,!0),[[0,0]],!1)});var y=ta(r.origin,e.scene);e.scene.replaceAllElements(Gh(Gh([],e.scene.getElementsIncludingDeleted(),!0),[b],!1)),e.setState({draggingElement:b,editingElement:b,startBoundElement:y,suggestedBindings:[]})}},this.createGenericElementOnPointerDown=function(t,n){var r=qe(n.origin.x,n.origin.y,e.state.gridSize),o=r[0],i=r[1],a=mo({type:t,x:o,y:i,strokeColor:e.state.currentItemStrokeColor,backgroundColor:e.state.currentItemBackgroundColor,fillStyle:e.state.currentItemFillStyle,strokeWidth:e.state.currentItemStrokeWidth,strokeStyle:e.state.currentItemStrokeStyle,roughness:e.state.currentItemRoughness,opacity:e.state.currentItemOpacity,strokeSharpness:e.state.currentItemStrokeSharpness});"selection"===a.type?e.setState({selectionElement:a,draggingElement:a}):(e.scene.replaceAllElements(Gh(Gh([],e.scene.getElementsIncludingDeleted(),!0),[a],!1)),e.setState({multiElement:null,draggingElement:a,editingElement:a}))},this.initializeImage=function(){var t=(0,d.Z)((function(t){var n,r,o,i,a,l,s,u,p,f,h,g,m,v,b,y,x,w,k,E;return Vh(this,(function(j){switch(j.label){case 0:if(i=t.imageFile,a=t.imageElement,l=t.showCursorImagePreview,s=void 0!==l&&l,!yu(i))throw new Error(S("errors.unsupportedFileType"));if(u=i.type,_n(e.canvas,"wait"),u!==c.LO.svg)return[3,5];j.label=1;case 1:return j.trys.push([1,4,,5]),p=_u,f=Fu,[4,i.text()];case 2:return[4,f.apply(void 0,[j.sent()])];case 3:return i=p.apply(void 0,[j.sent(),i.name]),[3,5];case 4:throw h=j.sent(),console.warn(h),new Error(S("errors.svgImageInsertError"));case 5:return[4,(null===(n=(r=e.props).generateIdForFile)||void 0===n?void 0:n.call(r,i))||Su(i)];case 6:if(!(g=j.sent()))throw console.warn("Couldn't generate file id or the supplied `generateIdForFile` didn't resolve to one."),new Error(S("errors.imageInsertError"));if(null!=(m=e.files[g])&&m.dataURL)return[3,11];j.label=7;case 7:return j.trys.push([7,9,,10]),[4,ju(i,{maxWidthOrHeight:c.h6})];case 8:return i=j.sent(),[3,10];case 9:return v=j.sent(),console.error("error trying to resing image file on insertion",v),[3,10];case 10:if(i.size>c.$n)throw new Error(S("errors.fileTooBig",{maxSize:"".concat(Math.trunc(c.$n/1024/1024),"MB")}));j.label=11;case 11:return s&&(y=null===(b=e.files[g])||void 0===b?void 0:b.dataURL,x=y&&function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e.indexOf(","),r=atob(e.slice(n+1)),o=e.slice(0,n).split(":")[1].split(";")[0],i=new ArrayBuffer(r.length),a=new Uint8Array(i),l=0;l<r.length;l++)a[l]=r.charCodeAt(l);return new File([i],t,{type:o})}(y),e.setImagePreviewCursor(x||i)),(k=null===(o=e.files[g])||void 0===o?void 0:o.dataURL)?[3,13]:[4,Eu(i)];case 12:k=j.sent(),j.label=13;case 13:return w=k,E=Zr(a,{fileId:g},!1),[2,new Promise(function(){var t=(0,d.Z)((function(t,n){var r,o,i,a,l;return Vh(this,(function(c){switch(c.label){case 0:return c.trys.push([0,5,6,7]),e.files=Kh(Kh({},e.files),{},((l={})[g]={mimeType:u,id:g,dataURL:w,created:Date.now()},l)),(i=e.imageCache.get(g))?[3,2]:(e.addNewImagesToImageCache(),[4,e.updateImageCache([E])]);case 1:c.sent(),c.label=2;case 2:return(null==i?void 0:i.image)instanceof Promise?[4,i.image]:[3,4];case 3:c.sent(),c.label=4;case 4:return(null===(r=e.state.pendingImageElement)||void 0===r?void 0:r.id)!==E.id&&(null===(o=e.state.draggingElement)||void 0===o?void 0:o.id)!==E.id&&e.initializeImageDimensions(E,!0),t(E),[3,7];case 5:return a=c.sent(),console.error(a),n(new Error(S("errors.imageInsertError"))),[3,7];case 6:return s||jn(e.canvas),[7];case 7:return[2]}}))}));return function(e,n){return t.apply(this,arguments)}}())]}}))}));return function(e){return t.apply(this,arguments)}}(),this.insertImageElement=function(){var t=(0,d.Z)((function(t,n,r){var o;return Vh(this,(function(i){switch(i.label){case 0:e.scene.replaceAllElements(Gh(Gh([],e.scene.getElementsIncludingDeleted(),!0),[t],!1)),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,e.initializeImage({imageFile:n,imageElement:t,showCursorImagePreview:r})];case 2:return i.sent(),[3,4];case 3:return o=i.sent(),Zr(t,{isDeleted:!0}),e.actionManager.executeAction(Hc),e.setState({errorMessage:o.message||S("errors.imageInsertError")}),[3,4];case 4:return[2]}}))}));return function(e,n,r){return t.apply(this,arguments)}}(),this.setImagePreviewCursor=function(){var t=(0,d.Z)((function(t){var n,r,o,i,a,l,s;return Vh(this,(function(u){switch(u.label){case 0:return[4,ju(t,{maxWidthOrHeight:n=96})];case 1:return r=u.sent(),[4,Eu(r)];case 2:return o=u.sent(),t.type!==c.LO.svg?[3,4]:[4,Hu(o)];case 3:i=u.sent(),a=Math.min(i.height,n),(l=a*(i.width/i.height))>n&&(a=(l=n)*(i.height/i.width)),(s=document.createElement("canvas")).height=a,s.width=l,s.getContext("2d").drawImage(i,0,0,l,a),o=s.toDataURL(c.LO.svg),u.label=4;case 4:return e.state.pendingImageElement&&_n(e.canvas,"url(".concat(o,") 4 4, auto")),[2]}}))}));return function(e){return t.apply(this,arguments)}}(),this.onImageAction=function(){var t=(0,d.Z)((function(){var t,n,r,o,i,a,l,s,c,u;return Vh(this,(function(d){switch(d.label){case 0:t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{insertOnCanvasDirectly:!1}).insertOnCanvasDirectly,d.label=1;case 1:return d.trys.push([1,3,,4]),n=e.state.width/2+e.state.offsetLeft,r=e.state.height/2+e.state.offsetTop,o=Mn({clientX:n,clientY:r},e.state),i=o.x,a=o.y,[4,nu({description:"Image",extensions:["jpg","png","svg","gif"]})];case 2:return l=d.sent(),s=e.createImageElement({sceneX:i,sceneY:a}),t?(e.insertImageElement(s,l),e.initializeImageDimensions(s),e.setState({selectedElementIds:(u={},u[s.id]=!0,u)},(function(){e.actionManager.executeAction(Hc)}))):e.setState({pendingImageElement:s},(function(){e.insertImageElement(s,l,!0)})),[3,4];case 3:return"AbortError"!==(c=d.sent()).name?console.error(c):console.warn(c),e.setState({pendingImageElement:null,editingElement:null,elementType:"selection"},(function(){e.actionManager.executeAction(Hc)})),[3,4];case 4:return[2]}}))}));return function(){return t.apply(this,arguments)}}(),this.initializeImageDimensions=function(t){var n,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=Me(t)&&(null===(n=e.imageCache.get(t.fileId))||void 0===n?void 0:n.image);if(!o||o instanceof Promise){if(t.width<c.f/e.state.zoom.value&&t.height<c.f/e.state.zoom.value){var i=100/e.state.zoom.value;Zr(t,{x:t.x-i/2,y:t.y-i/2,width:i,height:i})}}else if(r||t.width<c.f/e.state.zoom.value&&t.height<c.f/e.state.zoom.value){var a=Math.max(e.state.height-120,160),l=Math.min(a,Math.floor(.5*e.state.height)/e.state.zoom.value),s=Math.min(o.naturalHeight,l),u=s*(o.naturalWidth/o.naturalHeight),d=t.x+t.width/2-u/2,p=t.y+t.height/2-s/2;Zr(t,{x:d,y:p,width:u,height:s})}},this.updateImageCache=function(){var t=(0,d.Z)((function(t){var n,r,o,i,a,l,s;return Vh(this,(function(c){switch(c.label){case 0:return n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.files,[4,Ru({imageCache:e.imageCache,fileIds:t.map((function(e){return e.fileId})),files:n})];case 1:if(r=c.sent(),o=r.updatedFiles,i=r.erroredFiles,o.size||i.size)for(a=0,l=t;a<l.length;a++)s=l[a],o.has(s.fileId)&&_r(s);return i.size&&e.scene.replaceAllElements(e.scene.getElementsIncludingDeleted().map((function(e){return Me(e)&&i.has(e.fileId)?Yr(e,{status:"error"}):e}))),[2,{updatedFiles:o,erroredFiles:i}]}}))}));return function(e){return t.apply(this,arguments)}}(),this.addNewImagesToImageCache=function(){var t=(0,d.Z)((function(){var t,n,r;return Vh(this,(function(o){switch(o.label){case 0:return t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Bu(e.scene.getElements()),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.files,(r=t.filter((function(t){return!t.isDeleted&&!e.imageCache.has(t.fileId)}))).length?[4,e.updateImageCache(r,n)]:[3,2];case 1:o.sent().updatedFiles.size&&e.scene.informMutation(),o.label=2;case 2:return[2]}}))}));return function(){return t.apply(this,arguments)}}(),this.scheduleImageRefresh=Fh()((function(){e.addNewImagesToImageCache()}),c.LL),this.updateBindingEnabledOnPointerMove=function(t){var n=function(e){return!e[Vt]}(t);e.state.isBindingEnabled!==n&&e.setState({isBindingEnabled:n})},this.maybeSuggestBindingAtCursor=function(t){var n=ta(t,e.scene);e.setState({suggestedBindings:null!=n?[n]:[]})},this.maybeSuggestBindingForLinearElementAtCursor=function(t,n,r,o){var i=ta(r,e.scene);e.setState({suggestedBindings:null==i||Qi(t,null==o?void 0:o.id,i)?[]:[i]})},this.handleCanvasRef=function(t){var n,r,o;null!==t?(e.canvas=t,e.rc=_e.canvas(e.canvas),e.canvas.addEventListener(c.Ks.WHEEL,e.handleWheel,{passive:!1}),e.canvas.addEventListener(c.Ks.TOUCH_START,e.onTapStart),e.canvas.addEventListener(c.Ks.TOUCH_END,e.onTapEnd)):(null===(n=e.canvas)||void 0===n||n.removeEventListener(c.Ks.WHEEL,e.handleWheel),null===(r=e.canvas)||void 0===r||r.removeEventListener(c.Ks.TOUCH_START,e.onTapStart),null===(o=e.canvas)||void 0===o||o.removeEventListener(c.Ks.TOUCH_END,e.onTapEnd))},this.handleAppOnDrop=function(){var t=(0,d.Z)((function(t){var n,r,o,i,a,l,s,u,d,p,f,h,g,m,v,b,y,x;return Vh(this,(function(w){switch(w.label){case 0:if(w.trys.push([0,10,,11]),o=t.dataTransfer.files[0],!yu(o))return[3,9];if((null==o?void 0:o.type)!==c.LO.png&&(null==o?void 0:o.type)!==c.LO.svg)return[3,8];w.label=1;case 1:if(w.trys.push([1,7,,8]),!Qc)return[3,5];w.label=2;case 2:return w.trys.push([2,4,,5]),v=t.dataTransfer.items[0],i=o,[4,v.getAsFileSystemHandle()];case 3:return i.handle=w.sent(),[3,5];case 4:return a=w.sent(),console.warn(a.name,a.message),[3,5];case 5:return[4,xu(o,e.state,e.scene.getElementsIncludingDeleted())];case 6:return l=w.sent(),e.syncActionResult(Kh(Kh({},l),{},{appState:Kh(Kh({},l.appState||e.state),{},{isLoading:!1}),replaceFiles:!0,commitToHistory:!0})),[2];case 7:if("EncodingError"!==(s=w.sent()).name)throw s;return[3,8];case 8:return u=Mn(t,e.state),d=u.x,p=u.y,f=e.createImageElement({sceneX:d,sceneY:p}),e.insertImageElement(f,o),e.initializeImageDimensions(f),e.setState({selectedElementIds:(x={},x[f.id]=!0,x)}),[2];case 9:return[3,11];case 10:return h=w.sent(),[2,e.setState({isLoading:!1,errorMessage:h.message})];case 11:return""!==(g=t.dataTransfer.getData(c.LO.excalidrawlib))?(e.addElementsFromPasteOrLibrary({elements:JSON.parse(g),position:t,files:null}),[2]):(null==(m=null===(n=t.dataTransfer)||void 0===n?void 0:n.files[0])?void 0:m.type)===c.LO.excalidrawlib||null!=m&&null!==(r=m.name)&&void 0!==r&&r.endsWith(".excalidrawlib")?(e.library.importLibrary(m).then((function(){e.setState({isLibraryOpen:!1}),e.setState({isLibraryOpen:!0})})).catch((function(t){return e.setState({isLoading:!1,errorMessage:t.message})})),[3,18]):[3,12];case 12:if(e.setState({isLoading:!0}),!Qc)return[3,16];w.label=13;case 13:return w.trys.push([13,15,,16]),v=t.dataTransfer.items[0],b=m,[4,v.getAsFileSystemHandle()];case 14:return b.handle=w.sent(),[3,16];case 15:return y=w.sent(),console.warn(y.name,y.message),[3,16];case 16:return[4,e.loadFileToCanvas(m)];case 17:w.sent(),w.label=18;case 18:return[2]}}))}));return function(e){return t.apply(this,arguments)}}(),this.loadFileToCanvas=function(t){xu(t,e.state,e.scene.getElementsIncludingDeleted()).then((function(t){e.syncActionResult(Kh(Kh({},t),{},{appState:Kh(Kh({},t.appState||e.state),{},{isLoading:!1}),replaceFiles:!0,commitToHistory:!0}))})).catch((function(t){e.setState({isLoading:!1,errorMessage:t.message})}))},this.handleCanvasContextMenu=function(t){var n;t.preventDefault();var r=Mn(t,e.state),o=r.x,i=r.y,a=e.getElementAtPosition(o,i,{preferSelected:!0}),l=a?"element":"canvas",s=e.excalidrawContainerRef.current.getBoundingClientRect(),c=s.top,u=s.left,d=t.clientX-u,p=t.clientY-c;a&&!e.state.selectedElementIds[a.id]?e.setState({selectedElementIds:(n={},n[a.id]=!0,n)},(function(){e._openContextMenu({top:p,left:d},l)})):e._openContextMenu({top:p,left:d},l)},this.maybeDragNewGenericElement=function(t,n){var r=e.state.draggingElement,o=t.lastCoords;if(r)if("selection"===r.type)Ia(r,e.state.elementType,t.origin.x,t.origin.y,o.x,o.y,En(t.origin.x,o.x),En(t.origin.y,o.y),hn(n),fn(n));else{var i,a=qe(o.x,o.y,e.state.gridSize),l=a[0],s=a[1],c=Me(r)&&(null===(i=e.imageCache.get(r.fileId))||void 0===i?void 0:i.image),u=!c||c instanceof Promise?null:c.width/c.height;Ia(r,e.state.elementType,t.originInGrid.x,t.originInGrid.y,l,s,En(t.originInGrid.x,l),En(t.originInGrid.y,s),Pe(r)?!hn(n):hn(n),fn(n),u),e.maybeSuggestBindingForAll([r])}},this.maybeHandleResize=function(t,n){var r=Wa(e.scene.getElements(),e.state),o=t.resize.handleType;e.setState({isResizing:o&&"rotation"!==o,isRotating:"rotation"===o});var i=t.lastCoords,a=qe(i.x-t.resize.offset.x,i.y-t.resize.offset.y,e.state.gridSize),l=a[0],s=a[1];return!!function(e,t,n,r,o,i,a,l,s,c,u){if(1===n.length){var d=n[0];return"rotation"===t?(wa(d,l,s,o),ra(d)):!De(d)||2!==d.points.length||"nw"!==t&&"ne"!==t&&"sw"!==t&&"se"!==t?!Te(d)||"nw"!==t&&"ne"!==t&&"sw"!==t&&"se"!==t?t&&_a(e.originalElements.get(d.id),a,d,t,i,l,s):(ja(d,t,i,l,s),ra(d)):ka(d,r,o,l,s),!0}if(n.length>1){if("rotation"===t)return Oa(e,n,l,s,o,c,u),!0;if("nw"===t||"ne"===t||"sw"===t||"se"===t)return Ca(n,t,l,s),!0}return!1}(t,o,r,t.resize.arrowDirection,gn(n),fn(n),1===r.length&&Pe(r[0])?!hn(n):hn(n),l,s,t.resize.center.x,t.resize.center.y)&&(e.maybeSuggestBindingForAll(r),!0)},this._openContextMenu=function(t,n){var r=t.left,o=t.top,i=ep.contextItemPredicate(e.actionManager.getElementsIncludingDeleted(),e.actionManager.getAppState()),a=tp.contextItemPredicate(e.actionManager.getElementsIncludingDeleted(),e.actionManager.getAppState()),l=wp.contextItemPredicate(e.actionManager.getElementsIncludingDeleted(),e.actionManager.getAppState()),s=kp.contextItemPredicate(e.actionManager.getElementsIncludingDeleted(),e.actionManager.getAppState()),c="separator",u=e.scene.getElements(),d=[];if(hd&&u.length>0&&d.push(Dp),fd&&u.length>0&&d.push(Ap),"canvas"===n){var p=Gh(Gh([],d,!0),[void 0===e.props.gridModeEnabled&&Hp,void 0===e.props.zenModeEnabled&&Fp,void 0===e.props.viewModeEnabled&&Rh,Gp],!1);e.state.viewModeEnabled?hf({options:p,top:o,left:r,actionManager:e.actionManager,appState:e.state,container:e.excalidrawContainerRef.current}):hf({options:[e.isMobile&&navigator.clipboard&&{name:"paste",perform:function(t,n){return e.pasteFromClipboard(null),{commitToHistory:!1}},contextItemLabel:"labels.paste"},e.isMobile&&navigator.clipboard&&c,hd&&u.length>0&&Dp,fd&&u.length>0&&Ap,(hd&&u.length>0||fd&&u.length>0)&&c,Ys,c,void 0===e.props.gridModeEnabled&&Hp,void 0===e.props.zenModeEnabled&&Fp,void 0===e.props.viewModeEnabled&&Rh,Gp],top:o,left:r,actionManager:e.actionManager,appState:e.state,container:e.excalidrawContainerRef.current})}else"element"===n&&(e.state.viewModeEnabled?hf({options:Gh([navigator.clipboard&&Tp],d,!0),top:o,left:r,actionManager:e.actionManager,appState:e.state,container:e.excalidrawContainerRef.current}):hf({options:Gh(Gh([e.isMobile&&Lp,e.isMobile&&navigator.clipboard&&Tp,e.isMobile&&navigator.clipboard&&{name:"paste",perform:function(t,n){return e.pasteFromClipboard(null),{commitToHistory:!1}},contextItemLabel:"labels.paste"},e.isMobile&&c],d,!0),[c,Wd,Kd,c,i&&ep,a&&tp,(i||a)&&c,sp,c,Us,Vs,Gs,Ws,c,l&&wp,s&&kp,(l||s)&&c,Qs,Ps],!1),top:o,left:r,actionManager:e.actionManager,appState:e.state,container:e.excalidrawContainerRef.current}))},this.handleWheel=Hn((function(t){if(t.preventDefault(),!ng){var n=t.deltaX,r=t.deltaY,o=e.state,i=o.selectedElementIds,a=o.previousSelectedElementIds;if(t.metaKey||t.ctrlKey){var l=Math.sign(r),s=Math.abs(r);s>10&&(s=10),s*=l,0!==Object.keys(a).length&&setTimeout((function(){e.setState({selectedElementIds:a,previousSelectedElementIds:{}})}),1e3);var u=e.state.zoom.value-s/100;return u+=Math.log10(Math.max(1,e.state.zoom.value))*-l,u=Math.round(u*c.V4*100)/(100*c.V4),e.setState((function(e){var t=e.zoom,n=e.offsetLeft,r=e.offsetTop;return{zoom:rl(ol(u),t,{left:n,top:r},{x:Jh,y:eg}),selectedElementIds:{},previousSelectedElementIds:0!==Object.keys(i).length?i:a,shouldCacheIgnoreZoom:!0}})),void e.resetShouldCacheIgnoreZoomDebounced()}t.shiftKey?e.setState((function(e){var t=e.zoom;return{scrollX:e.scrollX-(r||n)/t.value}})):e.setState((function(e){var t=e.zoom,o=e.scrollX,i=e.scrollY;return{scrollX:o-n/t.value,scrollY:i-r/t.value}}))}})),this.savePointer=function(t,n,r){var o,i;if(t&&n){var a=Mn({clientX:t,clientY:n},e.state);isNaN(a.x)||isNaN(a.y),null===(o=(i=e.props).onPointerUpdate)||void 0===o||o.call(i,{pointer:a,button:r,pointersMap:sg.pointers})}},this.resetShouldCacheIgnoreZoomDebounced=Sn((function(){e.unmounted||e.setState({shouldCacheIgnoreZoom:!1})}),300),this.updateDOMRect=function(t){var n;if(null!==(n=e.excalidrawContainerRef)&&void 0!==n&&n.current){var r=e.excalidrawContainerRef.current.getBoundingClientRect(),o=r.width,i=r.height,a=r.left,l=r.top,s=e.state,c=s.width,u=s.height,d=s.offsetTop,p=s.offsetLeft;if(o===c&&i===u&&a===p&&l===d)return void(t&&t());e.setState({width:o,height:i,offsetLeft:a,offsetTop:l},(function(){t&&t()}))}},this.refresh=function(){e.setState(Kh({},e.getCanvasOffsets()))}};"production"!==c.Vi.TEST&&"production"!==c.Vi.DEVELOPMENT||(window.h=window.h||{},Object.defineProperties(window.h,{elements:{configurable:!0,get:function(){return this.app.scene.getElementsIncludingDeleted()},set:function(e){return this.app.scene.replaceAllElements(e)}}}));const dg=cg;n(4285),n(3313);var pg=["initialData","UIOptions"],fg=["initialData","UIOptions"];function hg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hg(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var mg=function(e){var t,n,r=e.onHomeButtonClick,o=e.onChange,i=e.initialData,a=e.excalidrawRef,s=e.onCollabButtonClick,u=e.isCollaborating,d=e.onPointerUpdate,p=e.renderTopRightUI,f=e.renderFooter,h=e.langCode,m=void 0===h?g.code:h,v=e.viewModeEnabled,b=e.zenModeEnabled,y=e.gridModeEnabled,x=e.libraryReturnUrl,w=e.theme,k=e.name,S=e.renderCustomStats,j=e.onPaste,_=e.detectScroll,O=void 0===_||_,I=e.handleKeyboardGlobally,M=void 0!==I&&I,P=e.onLibraryChange,T=e.autoFocus,L=void 0!==T&&T,A=e.generateIdForFile,D=e.id,z=null===(t=e.UIOptions)||void 0===t?void 0:t.canvasActions,N={canvasActions:!!z&&gg(gg({},c.cW.canvasActions),z)};z&&"object"==typeof z.export&&(z.export.saveFileToDisk=(null===(n=z.export)||void 0===n?void 0:n.saveFileToDisk)||c.cW.canvasActions.export.saveFileToDisk);return(0,l.useEffect)((function(){var e=function(e){"number"==typeof e.scale&&1!==e.scale&&e.preventDefault()};return document.addEventListener("touchmove",e,{passive:!1}),function(){document.removeEventListener("touchmove",e)}}),[]),(0,E.jsx)(C,{langCode:m,children:(0,E.jsx)(dg,{id:D,onHomeButtonClick:r,onChange:o,initialData:i,excalidrawRef:a,onCollabButtonClick:s,isCollaborating:u,onPointerUpdate:d,renderTopRightUI:p,renderFooter:f,langCode:m,viewModeEnabled:v,zenModeEnabled:b,gridModeEnabled:y,libraryReturnUrl:x,theme:w,name:k,renderCustomStats:S,UIOptions:N,onPaste:j,detectScroll:O,handleKeyboardGlobally:M,onLibraryChange:P,autoFocus:L,generateIdForFile:A})})},vg=function(e,t){e.initialData;var n=e.UIOptions,r=void 0===n?{}:n,i=o()(e,pg),a=(t.initialData,t.UIOptions),l=void 0===a?{}:a,s=o()(t,fg),c=Object.keys(r),u=Object.keys(l);if(c.length!==u.length)return!1;var d=c.every((function(e){"canvasActions"===e&&Object.keys(r.canvasActions).every((function(e){var t,n,o,i;return null!=r&&r.canvasActions&&null!=l&&l.canvasActions?"export"===e&&null!=r&&null!==(t=r.canvasActions)&&void 0!==t&&t.export&&null!=l&&null!==(n=l.canvasActions)&&void 0!==n&&n.export?"function"==typeof r.canvasActions.export||"function"==typeof l.canvasActions.export?r.canvasActions.export===l.canvasActions.export:r.canvasActions.export.saveFileToDisk===l.canvasActions.export.saveFileToDisk:(null==r||null===(o=r.canvasActions)||void 0===o?void 0:o[e])===(null==l||null===(i=l.canvasActions)||void 0===i?void 0:i[e]):(null==r?void 0:r.canvasActions)===(null==l?void 0:l.canvasActions)}));return!0})),p=Object.keys(e),f=Object.keys(t);return d&&p.length===f.length&&p.every((function(e){return i[e]===s[e]}))},bg=(0,l.forwardRef)((function(e,t){return(0,E.jsx)(mg,gg(gg({},e),{},{excalidrawRef:t}))}));const yg=s().memo(bg,vg);n(8336);const xg=yg},9669:e=>{"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg=="},7984:e=>{"use strict";e.exports='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="292.4" height="292.4" viewBox="0 0 292 292"><path d="M287 197L159 69c-4-3-8-5-13-5s-9 2-13 5L5 197c-3 4-5 8-5 13s2 9 5 13c4 4 8 5 13 5h256c5 0 9-1 13-5s5-8 5-13-1-9-5-13z"/></svg>'},1639:e=>{"use strict";e.exports='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="292.4" height="292.4" viewBox="0 0 292 292"><path fill="%23ced4da" d="M287 197L159 69c-4-3-8-5-13-5s-9 2-13 5L5 197c-3 4-5 8-5 13s2 9 5 13c4 4 8 5 13 5h256c5 0 9-1 13-5s5-8 5-13-1-9-5-13z"/></svg>'},2787:(e,t,n)=>{"use strict";e.exports=n.p+"0adeb55dfbca17fad22e.woff2"},1652:(e,t,n)=>{"use strict";e.exports=n.p+"d9454a7bea9e32f0c282.woff2"},9787:t=>{"use strict";t.exports=e},5156:e=>{"use strict";e.exports=t},8950:(e,t,n)=>{"use strict";function r(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var a=e.apply(t,n);function l(e){r(a,o,i,l,s,"next",e)}function s(e){r(a,o,i,l,s,"throw",e)}l(void 0)}))}}n.d(t,{Z:()=>o})},1463:e=>{"use strict";e.exports=JSON.parse('{"labels":{"paste":"Paste","pasteCharts":"Paste charts","selectAll":"Select all","multiSelect":"Add element to selection","moveCanvas":"Move canvas","cut":"Cut","copy":"Copy","copyAsPng":"Copy to clipboard as PNG","copyAsSvg":"Copy to clipboard as SVG","bringForward":"Bring forward","sendToBack":"Send to back","bringToFront":"Bring to front","sendBackward":"Send backward","delete":"Delete","copyStyles":"Copy styles","pasteStyles":"Paste styles","stroke":"Stroke","background":"Background","fill":"Fill","strokeWidth":"Stroke width","strokeStyle":"Stroke style","strokeStyle_solid":"Solid","strokeStyle_dashed":"Dashed","strokeStyle_dotted":"Dotted","sloppiness":"Sloppiness","opacity":"Opacity","textAlign":"Text align","edges":"Edges","sharp":"Sharp","round":"Round","arrowheads":"Arrowheads","arrowhead_none":"None","arrowhead_arrow":"Arrow","arrowhead_bar":"Bar","arrowhead_dot":"Dot","arrowhead_triangle":"Triangle","fontSize":"Font size","fontFamily":"Font family","onlySelected":"Only selected","withBackground":"Background","exportEmbedScene":"Embed scene","exportEmbedScene_details":"Scene data will be saved into the exported PNG/SVG file so that the scene can be restored from it.\\nWill increase exported file size.","addWatermark":"Add \\"Made with Excalidraw\\"","handDrawn":"Hand-drawn","normal":"Normal","code":"Code","small":"Small","medium":"Medium","large":"Large","veryLarge":"Very large","solid":"Solid","hachure":"Hachure","crossHatch":"Cross-hatch","thin":"Thin","bold":"Bold","left":"Left","center":"Center","right":"Right","extraBold":"Extra bold","architect":"Architect","artist":"Artist","cartoonist":"Cartoonist","fileTitle":"File name","colorPicker":"Color picker","canvasBackground":"Canvas background","drawingCanvas":"Drawing canvas","layers":"Layers","actions":"Actions","language":"Language","liveCollaboration":"Live collaboration","duplicateSelection":"Duplicate","untitled":"Untitled","name":"Name","yourName":"Your name","madeWithExcalidraw":"Made with Excalidraw","group":"Group selection","ungroup":"Ungroup selection","collaborators":"Collaborators","showGrid":"Show grid","addToLibrary":"Add to library","removeFromLibrary":"Remove from library","libraryLoadingMessage":"Loading library…","libraries":"Browse libraries","loadingScene":"Loading scene…","align":"Align","alignTop":"Align top","alignBottom":"Align bottom","alignLeft":"Align left","alignRight":"Align right","centerVertically":"Center vertically","centerHorizontally":"Center horizontally","distributeHorizontally":"Distribute horizontally","distributeVertically":"Distribute vertically","flipHorizontal":"Flip horizontal","flipVertical":"Flip vertical","viewMode":"View mode","toggleExportColorScheme":"Toggle export color scheme","share":"Share","showStroke":"Show stroke color picker","showBackground":"Show background color picker","toggleTheme":"Toggle theme","personalLib":"Personal Library","excalidrawLib":"Excalidraw Library"},"buttons":{"clearReset":"Reset the canvas","exportJSON":"Export to file","exportImage":"Save as image","export":"Export","exportToPng":"Export to PNG","exportToSvg":"Export to SVG","copyToClipboard":"Copy to clipboard","copyPngToClipboard":"Copy PNG to clipboard","scale":"Scale","save":"Save (to active file)","saveAs":"Save as","load":"Load","getShareableLink":"Get shareable link","close":"Close","selectLanguage":"Select language","scrollBackToContent":"Scroll back to content","zoomIn":"Zoom in","zoomOut":"Zoom out","resetZoom":"Reset zoom","menu":"Menu","done":"Done","edit":"Edit","undo":"Undo","redo":"Redo","resetLibrary":"Reset library","roomDialog":"Sharing","createNewRoom":"Create new room","fullScreen":"Full screen","darkMode":"Dark mode","lightMode":"Light mode","zenMode":"Zen mode","exitZenMode":"Exit zen mode","cancel":"Cancel","clear":"Clear","remove":"Remove","publishLibrary":"Publish","submit":"Submit","confirm":"Confirm"},"alerts":{"clearReset":"This will clear the whole canvas. Are you sure?","couldNotCreateShareableLink":"Couldn\'t create shareable link.","couldNotCreateShareableLinkTooBig":"Couldn\'t create shareable link: the scene is too big","couldNotLoadInvalidFile":"Couldn\'t load invalid file","importBackendFailed":"Importing from backend failed.","cannotExportEmptyCanvas":"Cannot export empty canvas.","couldNotCopyToClipboard":"Couldn\'t copy to clipboard. Try using Chrome browser.","decryptFailed":"Couldn\'t decrypt data.","uploadedSecurly":"The upload has been secured with end-to-end encryption, which means that Excalidraw server and third parties can\'t read the content.","loadSceneOverridePrompt":"Loading external drawing will replace your existing content. Do you wish to continue?","collabStopOverridePrompt":"Stopping the session will overwrite your previous, locally stored drawing. Are you sure?\\n\\n(If you want to keep your local drawing, simply close the browser tab instead.)","errorLoadingLibrary":"There was an error loading the third party library.","errorAddingToLibrary":"Couldn\'t add item to the library","errorRemovingFromLibrary":"Couldn\'t remove item from the library","confirmAddLibrary":"This will add {{numShapes}} shape(s) to your library. Are you sure?","imageDoesNotContainScene":"This image does not seem to contain any scene data. Have you enabled scene embedding during export?","cannotRestoreFromImage":"Scene couldn\'t be restored from this image file","invalidSceneUrl":"Couldn\'t import scene from the supplied URL. It\'s either malformed, or doesn\'t contain valid Excalidraw JSON data.","resetLibrary":"This will clear your library. Are you sure?","removeItemsFromsLibrary":"Delete {{count}} item(s) from library?","invalidEncryptionKey":"Encryption key must be of 22 characters. Live collaboration is disabled."},"errors":{"unsupportedFileType":"Unsupported file type.","imageInsertError":"Couldn\'t insert image. Try again later...","fileTooBig":"File is too big. Maximum allowed size is {{maxSize}}.","svgImageInsertError":"Couldn\'t insert SVG image. The SVG markup looks invalid.","invalidSVGString":"Invalid SVG."},"toolBar":{"selection":"Selection","image":"Insert image","rectangle":"Rectangle","diamond":"Diamond","ellipse":"Ellipse","arrow":"Arrow","line":"Line","freedraw":"Draw","text":"Text","library":"Library","lock":"Keep selected tool active after drawing"},"headings":{"canvasActions":"Canvas actions","selectedShapeActions":"Selected shape actions","shapes":"Shapes"},"hints":{"canvasPanning":"To move canvas, hold mouse wheel or spacebar while dragging","linearElement":"Click to start multiple points, drag for single line","freeDraw":"Click and drag, release when you\'re finished","text":"Tip: you can also add text by double-clicking anywhere with the selection tool","text_selected":"Double-click or press ENTER to edit text","text_editing":"Press Escape or CtrlOrCmd+ENTER to finish editing","linearElementMulti":"Click on last point or press Escape or Enter to finish","lockAngle":"You can constrain angle by holding SHIFT","resize":"You can constrain proportions by holding SHIFT while resizing,\\nhold ALT to resize from the center","resizeImage":"You can resize freely by holding SHIFT,\\nhold ALT to resize from the center","rotate":"You can constrain angles by holding SHIFT while rotating","lineEditor_info":"Double-click or press Enter to edit points","lineEditor_pointSelected":"Press Delete to remove point, CtrlOrCmd+D to duplicate, or drag to move","lineEditor_nothingSelected":"Select a point to move or remove, or hold Alt and click to add new points","placeImage":"Click to place the image, or click and drag to set its size manually","publishLibrary":"Publish your own library"},"canvasError":{"cannotShowPreview":"Cannot show preview","canvasTooBig":"The canvas may be too big.","canvasTooBigTip":"Tip: try moving the farthest elements a bit closer together."},"errorSplash":{"headingMain_pre":"Encountered an error. Try ","headingMain_button":"reloading the page.","clearCanvasMessage":"If reloading doesn\'t work, try ","clearCanvasMessage_button":"clearing the canvas.","clearCanvasCaveat":" This will result in loss of work ","trackedToSentry_pre":"The error with identifier ","trackedToSentry_post":" was tracked on our system.","openIssueMessage_pre":"We were very cautious not to include your scene information on the error. If your scene is not private, please consider following up on our ","openIssueMessage_button":"bug tracker.","openIssueMessage_post":" Please include information below by copying and pasting into the GitHub issue.","sceneContent":"Scene content:"},"roomDialog":{"desc_intro":"You can invite people to your current scene to collaborate with you.","desc_privacy":"Don\'t worry, the session uses end-to-end encryption, so whatever you draw will stay private. Not even our server will be able to see what you come up with.","button_startSession":"Start session","button_stopSession":"Stop session","desc_inProgressIntro":"Live-collaboration session is now in progress.","desc_shareLink":"Share this link with anyone you want to collaborate with:","desc_exitSession":"Stopping the session will disconnect you from the room, but you\'ll be able to continue working with the scene, locally. Note that this won\'t affect other people, and they\'ll still be able to collaborate on their version.","shareTitle":"Join a live collaboration session on Excalidraw"},"errorDialog":{"title":"Error"},"exportDialog":{"disk_title":"Save to disk","disk_details":"Export the scene data to a file from which you can import later.","disk_button":"Save to file","link_title":"Shareable link","link_details":"Export as a read-only link.","link_button":"Export to Link","excalidrawplus_description":"Save the scene to your Excalidraw+ workspace.","excalidrawplus_button":"Export","excalidrawplus_exportError":"Couldn\'t export to Excalidraw+ at this moment..."},"helpDialog":{"blog":"Read our blog","click":"click","curvedArrow":"Curved arrow","curvedLine":"Curved line","documentation":"Documentation","doubleClick":"double-click","drag":"drag","editor":"Editor","editSelectedShape":"Edit selected shape (text/arrow/line)","github":"Found an issue? Submit","howto":"Follow our guides","or":"or","preventBinding":"Prevent arrow binding","shapes":"Shapes","shortcuts":"Keyboard shortcuts","textFinish":"Finish editing (text editor)","textNewLine":"Add new line (text editor)","title":"Help","view":"View","zoomToFit":"Zoom to fit all elements","zoomToSelection":"Zoom to selection"},"clearCanvasDialog":{"title":"Clear canvas"},"publishDialog":{"title":"Publish library","itemName":"Item name","authorName":"Author name","githubUsername":"GitHub username","twitterUsername":"Twitter username","libraryName":"Library name","libraryDesc":"Library description","website":"Website","placeholder":{"authorName":"Your name or username","libraryName":"Name of your library","libraryDesc":"Description of your library to help people understand its usage","githubHandle":"GitHub handle (optional), so you can edit the library once submitted for review","twitterHandle":"Twitter username (optional), so we know who to credit when promoting over Twitter","website":"Link to your personal website or elsewhere (optional)"},"errors":{"required":"Required","website":"Enter a valid URL"},"noteDescription":{"pre":"Submit your library to be included in the ","link":"public library repository","post":"for other people to use in their drawings."},"noteGuidelines":{"pre":"The library needs to be manually approved first. Please read the ","link":"guidelines","post":" before submitting. You will need a GitHub account to communicate and make changes if requested, but it is not strictly required."},"noteLicense":{"pre":"By submitting, you agree the library will be published under the ","link":"MIT License, ","post":"which in short means anyone can use them without restrictions."},"noteItems":"Each library item must have its own name so it\'s filterable. The following library items will be included:","atleastOneLibItem":"Please select at least one library item to get started"},"publishSuccessDialog":{"title":"Library submitted","content":"Thank you {{authorName}}. Your library has been submitted for review. You can track the status","link":"here"},"confirmDialog":{"resetLibrary":"Reset library","removeItemsFromLib":"Remove selected items from library"},"encrypted":{"tooltip":"Your drawings are end-to-end encrypted so Excalidraw\'s servers will never see them.","link":"Blog post on end-to-end encryption in Excalidraw"},"stats":{"angle":"Angle","element":"Element","elements":"Elements","height":"Height","scene":"Scene","selected":"Selected","storage":"Storage","title":"Stats for nerds","total":"Total","version":"Version","versionCopy":"Click to copy","versionNotAvailable":"Version not available","width":"Width"},"toast":{"addedToLibrary":"Added to library","copyStyles":"Copied styles.","copyToClipboard":"Copied to clipboard.","copyToClipboardAsPng":"Copied {{exportSelection}} to clipboard as PNG\\n({{exportColorScheme}})","fileSaved":"File saved.","fileSavedToFilename":"Saved to {filename}","canvas":"canvas","selection":"selection"},"colors":{"495057":"Gray 7","ffffff":"White","f8f9fa":"Gray 0","f1f3f5":"Gray 1","fff5f5":"Red 0","fff0f6":"Pink 0","f8f0fc":"Grape 0","f3f0ff":"Violet 0","edf2ff":"Indigo 0","e7f5ff":"Blue 0","e3fafc":"Cyan 0","e6fcf5":"Teal 0","ebfbee":"Green 0","f4fce3":"Lime 0","fff9db":"Yellow 0","fff4e6":"Orange 0","transparent":"Transparent","ced4da":"Gray 4","868e96":"Gray 6","fa5252":"Red 6","e64980":"Pink 6","be4bdb":"Grape 6","7950f2":"Violet 6","4c6ef5":"Indigo 6","228be6":"Blue 6","15aabf":"Cyan 6","12b886":"Teal 6","40c057":"Green 6","82c91e":"Lime 6","fab005":"Yellow 6","fd7e14":"Orange 6","000000":"Black","343a40":"Gray 8","c92a2a":"Red 9","a61e4d":"Pink 9","862e9c":"Grape 9","5f3dc4":"Violet 9","364fc7":"Indigo 9","1864ab":"Blue 9","0b7285":"Cyan 9","087f5b":"Teal 9","2b8a3e":"Green 9","5c940d":"Lime 9","e67700":"Yellow 9","d9480f":"Orange 9"}}')}},l={};function s(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={id:e,loaded:!1,exports:{}};return a[e].call(n.exports,n,n.exports,s),n.loaded=!0,n.exports}return s.m=a,s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,s.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var o=Object.create(null);s.r(o);var i={};n=n||[null,r({}),r([]),r(r)];for(var a=2&t&&e;"object"==typeof a&&!~n.indexOf(a);a=r(a))Object.getOwnPropertyNames(a).forEach((t=>i[t]=()=>e[t]));return i.default=()=>e,s.d(o,i),o},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,n)=>(s.f[n](e,t),t)),[])),s.u=e=>"excalidraw-assets/"+{9:"image",736:"vendor"}[e]+"-"+{9:"0db17e06143a31f9772b",736:"64ea3ed78bc76a895e61"}[e]+".js",s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={},i="Excalidraw:",s.l=(e,t,n,r)=>{if(o[e])o[e].push(t);else{var a,l;if(void 0!==n)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var d=c[u];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==i+n){a=d;break}}a||(l=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,s.nc&&a.setAttribute("nonce",s.nc),a.setAttribute("data-webpack",i+n),a.src=e),o[e]=[t];var p=(t,n)=>{a.onerror=a.onload=null,clearTimeout(f);var r=o[e];if(delete o[e],a.parentNode&&a.parentNode.removeChild(a),r&&r.forEach((e=>e(n))),t)return t(n)},f=setTimeout(p.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),l&&document.head.appendChild(a)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),s.p="",(()=>{s.b=document.baseURI||self.location.href;var e={388:0};s.f.j=(t,n)=>{var r=s.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise(((n,o)=>r=e[t]=[n,o]));n.push(r[2]=o);var i=s.p+s.u(t),a=new Error;s.l(i,(n=>{if(s.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",a.name="ChunkLoadError",a.type=o,a.request=i,r[1](a)}}),"chunk-"+t,t)}};var t=(t,n)=>{var r,o,[i,a,l]=n,c=0;if(i.some((t=>0!==e[t]))){for(r in a)s.o(a,r)&&(s.m[r]=a[r]);if(l)l(s)}for(t&&t(n);c<i.length;c++)o=i[c],s.o(e,o)&&e[o]&&e[o][0](),e[i[c]]=0},n=self.webpackChunkExcalidraw=self.webpackChunkExcalidraw||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),s(9997)})()}));
|