@dwelle/excalidraw 0.3.13 → 0.3.14

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.
@@ -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-auto-flow:column;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"},6177: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 sm},defaultLang:function(){return w},exportToBlob:function(){return $h},exportToCanvas:function(){return qh},exportToClipboard:function(){return Jh},exportToSvg:function(){return Qh},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 Ru},loadLibraryFromBlob:function(){return Fu},mutateElement:function(){return po},newElementWith:function(){return fo},restore:function(){return Lu},restoreAppState:function(){return Au},restoreElements:function(){return Tu},serializeAsJSON:function(){return $u}});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.13"}');"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":100,"bg-BG":68,"ca-ES":84,"cs-CZ":29,"da-DK":20,"de-DE":100,"el-GR":74,"en":100,"es-ES":100,"fa-IR":77,"fi-FI":100,"fr-FR":100,"he-IL":99,"hi-IN":67,"hu-HU":60,"id-ID":100,"it-IT":100,"ja-JP":100,"kab-KAB":93,"kk-KZ":26,"ko-KR":68,"lv-LV":14,"my-MM":56,"nb-NO":100,"nl-NL":100,"nn-NO":74,"oc-FR":100,"pa-IN":99,"pl-PL":70,"pt-BR":100,"pt-PT":99,"ro-RO":100,"ru-RU":99,"sk-SK":100,"sv-SE":100,"tr-TR":78,"uk-UA":80,"zh-CN":100,"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}[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}[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"}))]}var u=g(a,6),d=u[0],p=u[1],f=u[2],h=u[3],v=u[4],b=u[5];if("dotted"===e.strokeStyle){var y=zr(e.strokeWidth-1);m.strokeLineDash=[y[0],y[1]-1]}else delete m.strokeLineDash;return[t.line(f,h,d,p,m),t.line(v,b,d,p,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=Ah().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;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})})),Hs=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})})),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 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})})),Ns=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})})),Rs=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})})),Fs=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})})),Vs=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})})),Us=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})})),Gs=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})})),Ws=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})})),Ks=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"),Zs=[],Ys=function(e){return Zs=Zs.concat(e),e};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 qs(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){D(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 $s=function(e,t){if(e.editingGroupId){var n=Io(nl(t),e.editingGroupId);if(n.length)return qs(qs({},e),{},{selectedElementIds:D({},n[0].id,!0)})}return e},Qs=Ys({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:qs(qs({},$s(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:qs(qs({},t),{},{editingLinearElement:qs(qs(qs({},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:qs(qs({},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:qs(qs({},p=$s(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)})}}),Js=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},ec=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},tc=function(e,t){return t.reduce((function(t,n){var r=e[n];return t[r.id]=r,t}),{})},nc=function(e,t,n){var r,o,a=Js(t,e),i=tc(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=ec(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}))},rc=function(e,t,n){var r,o,a=Js(e,t),i=tc(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))},oc=function(e,t){return nc(t,e,"left")},ac=function(e,t){return nc(t,e,"right")},ic=function(e,t){return rc(e,t,"left")},lc=function(e,t){return rc(e,t,"right")},sc=Ys({name:"sendBackward",perform:function(e,t){return{elements:oc(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})})}}),cc=Ys({name:"bringForward",perform:function(e,t){return{elements:ac(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})})}}),uc=Ys({name:"sendToBack",perform:function(e,t){return{elements:ic(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})})}}),dc=Ys({name:"bringToFront",perform:function(e,t){return{elements:lc(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 pc(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 fc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pc(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var hc=Ys({name:"selectAll",perform:function(e,t){return!t.editingLinearElement&&{appState:Oo(fc(fc({},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 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 gc(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){D(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}var vc=Ys({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:gc(gc({},t),{},{editingLinearElement:gc(gc({},t.editingLinearElement),{},{activePointIndex:r+1})}),elements:e,commitToHistory:!0}}return gc(gc({},bc(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)})}}),bc=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(gc(gc({},t),{},{selectedGroupIds:{},selectedElementIds:r.reduce((function(e,t){return e[t.id]=!0,e}),{})}),nl(l))}},yc=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)}))})},xc=(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})}),wc=(n(4220),function(e){var t=(new Option).style;return t.color=e,!!t.color}),kc=[["1","2","3","4","5"],["q","w","e","r","t"],["a","s","d","f","g"]].flat(),Sc=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(kc.includes(e.key.toLowerCase())&&!Nn(e.target)){var h=kc.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(kc[t].toUpperCase()),"aria-label":I("colors.".concat(o)),"aria-keyshortcuts":kc[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:kc[t]})]},e)})),l&&(0,P.jsx)(Ec,{color:n,label:a,onChange:function(e){r(e)},ref:f})]})]})},Ec=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)||wc(e)?e:wc("#".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})]})})),Cc=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)(Ec,{color:n,label:o,onChange:function(e){r(e)}})]}),(0,P.jsx)(u().Suspense,{fallback:"",children:a?(0,P.jsx)(xc,{onCloseRequest:function(e){return e.target!==l.current&&i(!1)},children:(0,P.jsx)(Sc,{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 jc(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 Oc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jc(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Mc(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 Ic(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)(xc,Oc(Oc({onCloseRequest:function(e){return e.target!==p.current&&d(!1)}},f?{right:5.5}:{left:-5.5}),{},{children:(0,P.jsx)(Mc,{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 Pc(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 Tc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pc(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ac=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}))},Lc=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},_c=(Ys({name:"changeStrokeColor",perform:function(e,t,n){return Tc(Tc({},n.currentItemStrokeColor&&{elements:Ac(e,t,(function(e){return gl(e.type)?fo(e,{strokeColor:n.currentItemStrokeColor}):e}))}),{},{appState:Tc(Tc({},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)(Cc,{type:"elementStroke",label:I("labels.stroke"),color:Lc(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})}})]})}}),Ys({name:"changeBackgroundColor",perform:function(e,t,n){return Tc(Tc({},n.currentItemBackgroundColor&&{elements:Ac(e,t,(function(e){return fo(e,{backgroundColor:n.currentItemBackgroundColor})}))}),{},{appState:Tc(Tc({},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)(Cc,{type:"elementBackground",label:I("labels.background"),color:Lc(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})}})]})}}),Ys({name:"changeFillStyle",perform:function(e,t,n){return{elements:Ac(e,t,(function(e){return fo(e,{fillStyle:n})})),appState:Tc(Tc({},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)(yc,{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:Lc(t,n,(function(e){return e.fillStyle}),n.currentItemFillStyle),onChange:function(e){r(e)}})]})}}),Ys({name:"changeStrokeWidth",perform:function(e,t,n){return{elements:Ac(e,t,(function(e){return fo(e,{strokeWidth:n})})),appState:Tc(Tc({},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)(yc,{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:Lc(t,n,(function(e){return e.strokeWidth}),n.currentItemStrokeWidth),onChange:function(e){return r(e)}})]})}}),Ys({name:"changeSloppiness",perform:function(e,t,n){return{elements:Ac(e,t,(function(e){return fo(e,{seed:lo(),roughness:n})})),appState:Tc(Tc({},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)(yc,{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:Lc(t,n,(function(e){return e.roughness}),n.currentItemRoughness),onChange:function(e){return r(e)}})]})}}),Ys({name:"changeStrokeStyle",perform:function(e,t,n){return{elements:Ac(e,t,(function(e){return fo(e,{strokeStyle:n})})),appState:Tc(Tc({},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)(yc,{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:Lc(t,n,(function(e){return e.strokeStyle}),n.currentItemStrokeStyle),onChange:function(e){return r(e)}})]})}}),Ys({name:"changeOpacity",perform:function(e,t,n){return{elements:Ac(e,t,(function(e){return fo(e,{opacity:n})})),appState:Tc(Tc({},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=Lc(n,r,(function(e){return e.opacity}),r.currentItemOpacity))&&void 0!==t?t:void 0})]})}}),Ys({name:"changeFontSize",perform:function(e,t,n){return{elements:Ac(e,t,(function(e){if(Qe(e)){var t=fo(e,{fontSize:n});return qi(t),t}return e})),appState:Tc(Tc({},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)(yc,{group:"font-size",options:[{value:16,text:I("labels.small"),icon:(0,P.jsx)(zs,{theme:n.theme})},{value:20,text:I("labels.medium"),icon:(0,P.jsx)(Hs,{theme:n.theme})},{value:28,text:I("labels.large"),icon:(0,P.jsx)(Bs,{theme:n.theme})},{value:36,text:I("labels.veryLarge"),icon:(0,P.jsx)(Ns,{theme:n.theme})}],value:Lc(t,n,(function(e){return Qe(e)&&e.fontSize}),n.currentItemFontSize||d.n5),onChange:function(e){return r(e)}})]})}}),Ys({name:"changeFontFamily",perform:function(e,t,n){return{elements:Ac(e,t,(function(e){if(Qe(e)){var t=fo(e,{fontFamily:n});return qi(t),t}return e})),appState:Tc(Tc({},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)(Rs,{theme:n.theme})},{value:d.ut.Helvetica,text:I("labels.normal"),icon:(0,P.jsx)(Fs,{theme:n.theme})},{value:d.ut.Cascadia,text:I("labels.code"),icon:(0,P.jsx)(Vs,{theme:n.theme})}];return(0,P.jsxs)("fieldset",{children:[(0,P.jsx)("legend",{children:I("labels.fontFamily")}),(0,P.jsx)(yc,{group:"font-family",options:o,value:Lc(t,n,(function(e){return Qe(e)&&e.fontFamily}),n.currentItemFontFamily||d.rk),onChange:function(e){return r(e)}})]})}}),Ys({name:"changeTextAlign",perform:function(e,t,n){return{elements:Ac(e,t,(function(e){if(Qe(e)){var t=fo(e,{textAlign:n});return qi(t),t}return e})),appState:Tc(Tc({},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)(yc,{group:"text-align",options:[{value:"left",text:I("labels.left"),icon:(0,P.jsx)(Us,{theme:n.theme})},{value:"center",text:I("labels.center"),icon:(0,P.jsx)(Gs,{theme:n.theme})},{value:"right",text:I("labels.right"),icon:(0,P.jsx)(Ws,{theme:n.theme})}],value:Lc(t,n,(function(e){return Qe(e)&&e.textAlign}),n.currentItemTextAlign),onChange:function(e){return r(e)}})]})}}),Ys({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:Ac(e,t,(function(e){return fo(e,{strokeSharpness:n})})),appState:Tc(Tc({},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)(yc,{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:Lc(t,n,(function(e){return e.strokeSharpness}),yl(n.elementType)&&(nt(n.elementType)?n.currentItemLinearStrokeSharpness:n.currentItemStrokeSharpness)||null),onChange:function(e){return r(e)}})]})}}),Ys({name:"changeArrowhead",perform:function(e,t,n){return{elements:Ac(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:Tc(Tc({},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)(Ic,{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:Lc(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)(Ic,{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:Lc(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?Dc.MOON:Dc.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"})}),Dc={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"})})},zc=(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}),Hc=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 zc().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,zc(),n,o)},onPointerLeave:function(){return zc().classList.remove("excalidraw-tooltip--visible")},children:t})};n(196),n(1106);function Bc(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 Nc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bc(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Rc=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:Nc({"--padding":r},a),ref:t,children:n})})),Fc=(n(8328),function(e){var t=e.theme,n=void 0===t?d.C6.LIGHT:t,r=Vc(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)}),Vc=function(e){var t=g((0,c.useState)(null),2),n=t[0],r=t[1],o=Ph(),a=(0,c.useRef)(o);a.current=o;var i=Ah().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},Uc=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=Ah().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)(Fc,{className:Ye("Dialog",e.className),labelledBy:"dialog-title",maxWidth:e.small?550:800,onCloseRequest:s,theme:e.theme,children:(0,P.jsxs)(Rc,{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:Ph()?ms:hs})]}),(0,P.jsx)("div",{className:"Dialog__content",children:e.children})]})})},Gc=(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:Ph(),onClick:a,"data-testid":"clear-canvas-button"}),r&&(0,P.jsx)(Uc,{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 Wc(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 Kc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wc(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Ys({name:"changeViewBackgroundColor",perform:function(e,t,n){return{appState:Kc(Kc({},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)(Cc,{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"})})}}),Ys({name:"clearCanvas",perform:function(e,t,n,r){return r.imageCache.clear(),{elements:e.map((function(e){return fo(e,{isDeleted:!0})})),appState:Kc(Kc({},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)(Gc,{onConfirm:t})}}),Ys({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:Kc(Kc({},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)}}),Ys({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:Kc(Kc({},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)}}),Ys({name:"resetZoom",perform:function(e,t){return{appState:Kc(Kc({},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)(Hc,{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 Zc=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:Kc(Kc(Kc({},t),fl({scenePoint:{x:p,y:f},viewportDimensions:{width:t.width,height:t.height},zoom:l})),{},{zoom:l}),commitToHistory:!1}};Ys({name:"zoomToSelection",perform:function(e,t){return Zc(e,t,!0)},keyTest:function(e){return e.code===Gt&&e.shiftKey&&!e.altKey&&!e[un]}}),Ys({name:"zoomToFit",perform:function(e,t){return Zc(e,t,!1)},keyTest:function(e){return e.code===Ut&&e.shiftKey&&!e.altKey&&!e[un]}}),Ys({name:"toggleTheme",perform:function(e,t,n){return{appState:Kc(Kc({},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)(_c,{value:t.theme,onChange:function(e){n(e)}})})},keyTest:function(e){return e.altKey&&e.shiftKey&&e.code===Xt}});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){D(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 qc,$c,Qc,Jc=Ys({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:Xc(Xc({},t),{},{editingLinearElement:null}),commitToHistory:!0}}var p=e;t.pendingImageElement&&(p=p.filter((function(e){var n;return e.id!==(null===(n=t.pendingImageElement)||void 0===n?void 0:n.id)}))),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:Xc(Xc({},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?Xc(Xc({},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})}}),eu="undefined"!=typeof process&&null!==(qc=process.env)&&void 0!==qc&&qc.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!==($c=process.env)&&void 0!==$c&&$c.JEST_WORKER_ID,function(e,t,n,r){}),tu=(n(518),n(9966),function(e){var t=Ah().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})]})}),nu=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()},ru=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 ou(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 au(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 au(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 au(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"}(Qc||(Qc={}));var iu=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]}(),lu=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()},su=function(e,t,n,r){e.beginPath(),e.arc(t,n,r,0,2*Math.PI),e.fill(),e.stroke()},cu=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()},uu=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;su(e,r[0],r[1],i/2/n.zoom.value)})),e.restore()},du=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&&cu(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 vu(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&&uu(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){hu(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 ru(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=ou(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 fu(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||pu(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,lu(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);pu(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=ru(te||Z,t),re=ne.background,oe=ne.stroke;x.save(),x.strokeStyle=oe,x.fillStyle=re;var ae=i.remotePointerUserStates[Z];(ee||ae===Qc.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===Qc.AWAY?le=iu?"⚫️":" (".concat(Qc.AWAY,")"):ae===Qc.IDLE?le=iu?"💤":" (".concat(Qc.IDLE,")"):ae===Qc.ACTIVE&&(le=iu?"🟢":"");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&&nu(x,e.x,e.y,e.width,e.height,3)})),x.restore()),x.restore(),{atLeastOneVisibleElement:O.length>0,scrollBars:j}},pu=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?su(e,a[0]+a[2]/2,a[1]+a[3]/2,a[2]/2):lu(e,a[0],a[1],a[2],a[3],a[0]+a[2]/2,a[1]+a[3]/2,r,!0),e.restore())}))},fu=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,lu(e,o-d,a-d,c+2*d,u+2*d,o+c/2,a+u/2,r);e.restore()},hu=function(e,t,n){var r=Array.isArray(n)?gu:mu;e.save(),e.translate(t.scrollX,t.scrollY),r(e,n),e.restore()},mu=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":lu(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)}},gu=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];su(e,o,a,i)}))},vu=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},bu=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 yu=(()=>{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 xu=yu?n.e(736).then(n.bind(n,6629)):n.e(736).then(n.bind(n,3112));yu?n.e(736).then(n.bind(n,5756)):n.e(736).then(n.bind(n,8396));const wu=yu?n.e(736).then(n.bind(n,4868)):n.e(736).then(n.bind(n,6882));var ku=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 xu).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))}}})},Su=function(e,t){return async function(...e){return(await wu).default(...e)}(e,{fileName:"".concat(t.name,".").concat(t.extension),description:t.description,extensions:[".".concat(t.extension)]},t.fileHandle)};function Eu(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 Cu(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 Cu(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 Cu(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 ju(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 Ou(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ju(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ju(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Mu={selection:!0,text:!0,rectangle:!0,diamond:!0,ellipse:!0,line:!0,image:!0,arrow:!0,freedraw:!0},Iu=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 Ou(Ou(Ou({},h),vo(h)),t)},Pu=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 Iu(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 Iu(e,{points:e.points,lastCommittedPoint:null,simulatePressure:e.simulatePressure,pressures:e.pressures});case"image":return Iu(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 Iu(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 Iu(e,{})}},Tu=function(e,t){var n=t?el(t):null;return(e||[]).reduce((function(e,t){if("selection"!==t.type&&!mo(t)){var r=Pu(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}),[])},Au=function(e,t){e=e||{};var n,r=sr(),o={},a=Eu(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 Ou(Ou({},o),{},{elementType:Mu[o.elementType]?o.elementType:"selection",zoom:"number"==typeof e.zoom?{value:e.zoom,translation:r.zoom.translation}:e.zoom||r.zoom})},Lu=function(e,t,n){return{elements:Tu(null==e?void 0:e.elements,n),appState:Au(null==e?void 0:e.appState,t||null),files:(null==e?void 0:e.files)||{}}};function _u(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 Du(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_u(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var zu=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)}}(),Hu=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=Hu(e);return"png"===t||"svg"===t},Nu=function(e){var t=(e||{}).type;return!!t&&d.jo.includes(t)},Ru=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,zu(t);case 2:if(o=e.sent,e.prev=3,a=JSON.parse(o),ed(a)){e.next=7;break}throw new Error(I("alerts.couldNotLoadInvalidFile"));case 7:return i=Lu({elements:il(a.elements||[]),appState:Du(Du({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)}}(),Fu=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,zu(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)}}(),Vu=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)}}(),Uu=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)}}(),Gu=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)}}(),Wu=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})},Ku=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,Nu(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)}}(),Zu=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 Yu(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 Xu(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 Xu(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 Xu(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 qu=function(e,t){var n,r={},o=Yu(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},$u=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?qu(e,n):void 0};return JSON.stringify(o,null,2)},Qu=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=$u(t,n,r,"local"),a=new Blob([o],{type:d.LO.excalidraw}),e.next=4,Su(a,{name:n.name,extension:"excalidraw",description:"Excalidraw file",fileHandle:Bu(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)}}(),Ju=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,ku({description:"Excalidraw files"});case 2:return r=e.sent,e.abrupt("return",Ru(r,t,n));case 4:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),ed=function(e){return(null==e?void 0:e.type)===d.r8.excalidraw&&(!e.elements||Array.isArray(e.elements)&&(!e.appState||"object"===L(e.appState)))},td=function(e){return"object"===L(e)&&e&&e.type===d.r8.excalidrawLibrary&&1===e.version},nd=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,Su(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)}}(),rd=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,ku({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 od(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 ad(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?od(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):od(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var id=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}))},ld=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=id(n.dataURL),a={image:r,mimeType:n.mimeType},o.set(t,a),e.next=8,r;case 8:l=e.sent,o.set(t,ad(ad({},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)}}(),sd=function(e){return e.filter((function(e){return qe(e)}))},cd=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)}}(),ud="\x3c!-- svg-source:excalidraw --\x3e",dd=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=fd(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,ld({imageCache:new Map,fileIds:sd(t).map((function(e){return e.fileId})),files:r});case 7:return E=e.sent,C=E.imageCache,du(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)}}(),pd=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:$u(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=fd(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(ud,"\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),bu(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)}}(),fd=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 hd(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 md(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 md(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 md(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 gd(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?gd(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var bd=32,yd=12,xd=256,wd="NOT_SPREADSHEET",kd="VALID_SPREADSHEET",Sd=function(e){var t=/^[$€£¥₩]?([0-9,]+(\.[0-9]+)?)$/.exec(e);return t?parseFloat(t[1].replace(/,/g,"")):null},Ed=function(e,t){return e.slice(1).every((function(e){return null!==Sd(e[t])}))},Cd=function(e){var t=e[0].length;if(t>2)return{type:wd,reason:"More than 2 columns"};if(1===t){if(!Ed(e,0))return{type:wd,reason:"Value is not numeric"};var n=null===Sd(e[0][0]),r=(n?e.slice(1):e).map((function(e){return Sd(e[0])}));return r.length<2?{type:wd,reason:"Less than two rows"}:{type:kd,spreadsheet:{title:n?e[0][0]:null,labels:null,values:r}}}var o=Ed(e,0)?0:1;if(!Ed(e,o))return{type:wd,reason:"Value is not numeric"};var a=(o+1)%2,i=null===Sd(e[0][o]),l=i?e.slice(1):e;return l.length<2?{type:wd,reason:"Less than 2 rows"}:{type:kd,spreadsheet:{title:i?e[0][o]:null,labels:l.map((function(e){return e[a]})),values:l.map((function(e){return Sd(e[o])}))}}},jd=At.elementBackground.slice(2,At.elementBackground.length),Od={fillStyle:"hachure",fontFamily:d.rk,fontSize:d.n5,opacity:100,roughness:1,strokeColor:At.elementStroke[0],strokeSharpness:"sharp",strokeStyle:"solid",strokeWidth:1,verticalAlign:"middle"},Md=function(e){return{chartWidth:44*e.values.length+yd,chartHeight:280}},Id=function(e,t,n,r,o,a){var i=Md(e),l=i.chartWidth,s=i.chartHeight,c=e.title?Ho(vd(vd({backgroundColor:o,groupIds:[r]},Od),{},{text:e.title,x:t+l/2,y:n-xd-24-d.n5,strokeSharpness:"sharp",strokeStyle:"solid",textAlign:"center"})):null,u=a?Do(vd(vd({backgroundColor:o,groupIds:[r]},Od),{},{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(vd(vd({groupIds:[r],backgroundColor:o},Od),{},{text:e.length>8?"".concat(e.slice(0,5),"..."):e,x:t+44*a+24,y:n+6,width:bd,angle:5.87,fontSize:16,textAlign:"center",verticalAlign:"top"}))})))||[]}(e,t,n,r,o)),_(function(e,t,n,r,o){var a=Ho(vd(vd({groupIds:[r],backgroundColor:o},Od),{},{x:t-yd,y:n-yd,text:"0",textAlign:"right"}));return[a,Ho(vd(vd({groupIds:[r],backgroundColor:o},Od),{},{x:t-yd,y:n-xd-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=Md(e),i=a.chartWidth,l=a.chartHeight;return[No(vd(vd({backgroundColor:o,groupIds:[r]},Od),{},{type:"line",x:t,y:n,startArrowhead:null,endArrowhead:null,width:i,points:[[0,0],[i,0]]})),No(vd(vd({backgroundColor:o,groupIds:[r]},Od),{},{type:"line",x:t,y:n,startArrowhead:null,endArrowhead:null,height:l,points:[[0,0],[0,-l]]})),No(vd(vd({backgroundColor:o,groupIds:[r]},Od),{},{type:"line",x:t,y:n-xd-yd,startArrowhead:null,endArrowhead:null,strokeStyle:"dotted",width:i,opacity:50,points:[[0,0],[i,0]]}))]}(e,t,n,r,o)))},Pd=function(e,t,n,r){return"line"===e?function(e,t,n){var r,o=Math.max.apply(Math,_(e.values)),a=so(),i=jd[Math.floor(Math.random()*jd.length)],l=0,s=[],c=hd(e.values);try{for(c.s();!(r=c.n()).done;){var u=r.value,p=44*l,f=-u/o*xd;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(vd(vd({backgroundColor:i,groupIds:[a]},Od),{},{type:"line",x:t+yd+16,y:n-yd,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*xd+6;return Do(vd(vd({backgroundColor:i,groupIds:[a]},Od),{},{fillStyle:"solid",strokeWidth:2,type:"ellipse",x:t+l+16,y:n+s-24,width:yd,height:yd}))})),x=e.values.map((function(e,r){var l=44*r+6,s=e/o*xd+6+yd;return No(vd(vd({backgroundColor:i,groupIds:[a]},Od),{},{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(_(Id(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=jd[Math.floor(Math.random()*jd.length)],i=e.values.map((function(e,i){var l=e/r*xd;return Do(vd(vd({backgroundColor:a,groupIds:[o]},Od),{},{type:"rectangle",x:t+44*i+yd,y:n-l-yd,width:bd,height:l}))}));return[].concat(_(i),_(Id(e,t,n,o,a,"production"===d.Vi.DEVELOPMENT)))}(t,n,r)},Td="",Ad=!1,Ld="clipboard"in navigator&&"readText"in navigator.clipboard,_d="clipboard"in navigator&&"writeText"in navigator.clipboard,Dd="clipboard"in navigator&&"write"in navigator.clipboard&&"ClipboardItem"in window&&"toBlob"in HTMLCanvasElement.prototype,zd=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),Td=i,e.prev=4,Ad=!1,e.next=8,Vd(i);case 8:e.next=14;break;case 10:e.prev=10,e.t0=e.catch(4),Ad=!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)}}(),Hd=function(){if(!Td)return{};try{return JSON.parse(Td)}catch(e){return console.error(e),{}}},Bd=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:wd,reason:"No values"};var n=t[0].length;if(!t.every((function(e){return e.length===n})))return{type:wd,reason:"All rows don't have same number of columns"};var r=Cd(t);if(r.type!==kd){var o=Cd(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===kd)return o}return r}(e);return t.type===kd?{spreadsheet:t.spreadsheet}:null},Nd=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=Ld,!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)}}(),Rd=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,Nd(t);case 2:if((n=e.sent)&&!n.includes(ud)){e.next=5;break}return e.abrupt("return",Hd());case 5:if(!(r=Bd(n))){e.next=8;break}return e.abrupt("return",r);case 8:if(o=Hd(),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",Ad&&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)}}(),Fd=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)}}(),Vd=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,!_d){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||Ud(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)}}(),Ud=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},Gd=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,pd(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,Su(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,Vd(m.outerHTML);case 16:return e.abrupt("return");case 17:return e.next=19,dd(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,Vu(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:$u(r,o,a,"local")});case 32:v=e.sent;case 33:return e.next=35,Su(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,Fd(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 Wd(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 Kd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wd(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Zd=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=Hu(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=Kd(Kd({},n),{},{exportEmbedScene:!0}),e.next=7,Gd(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)}}(),Yd=(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 Xd(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?Xd(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var $d=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:qd({"--gap":n,alignItems:r,justifyContent:o},i),children:t})},Qd=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})},Jd=(n(554),function(e){var t=e.fileName,n=e.onSave;return(0,P.jsxs)($d,{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 ep(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 tp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ep(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ep(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Ys({name:"changeProjectName",perform:function(e,t,n){return eu("change","title"),{appState:tp(tp({},t),{},{name:n}),commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData,r=e.appProps;return(0,P.jsx)(tu,{label:I("labels.fileTitle"),value:t.name||"Unnamed",onChange:function(e){return n(e)},isNameEditable:void 0===r.name&&!t.viewModeEnabled})}}),Ys({name:"changeExportScale",perform:function(e,t,n){return{appState:tp(tp({},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(fd(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)}))})}}),Ys({name:"changeExportBackground",perform:function(e,t,n){return{appState:tp(tp({},t),{},{exportBackground:n}),commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData;return(0,P.jsx)(Yd,{checked:t.exportBackground,onChange:function(e){return n(e)},children:I("labels.withBackground")})}}),Ys({name:"changeExportEmbedScene",perform:function(e,t,n){return{appState:tp(tp({},t),{},{exportEmbedScene:n}),commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData;return(0,P.jsxs)(Yd,{checked:t.exportEmbedScene,onChange:function(e){return n(e)},children:[I("labels.exportEmbedScene"),(0,P.jsx)(Hc,{label:I("labels.exportEmbedScene_details"),long:!0,children:(0,P.jsx)("div",{className:"excalidraw-tooltip-icon",children:es})})]})}}),Ys({name:"saveToActiveFile",perform:(np=(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,!Bu(n.fileHandle)){e.next=8;break}return e.next=5,Zd(t,n,o.files);case 5:e.t0=e.sent,e.next=11;break;case 8:return e.next=10,Qu(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:tp(tp({},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 np.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)(Jd,{onSave:function(){return n(null)},fileName:null===(t=r.fileHandle)||void 0===t?void 0:t.name})}});var np,rp,op,ap=Ys({name:"saveFileToDisk",perform:(rp=(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,Qu(t,tp(tp({},n),{},{fileHandle:null}),o.files);case 3:return a=e.sent,i=a.fileHandle,e.abrupt("return",{commitToHistory:!1,appState:tp(tp({},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 rp.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:Ph(),hidden:!yu,onClick:function(){return t(null)},"data-testid":"save-as-button"})}});Ys({name:"loadScene",perform:(op=(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,Ju(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:tp(tp({},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 op.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:Ph(),onClick:t,"data-testid":"load-button"})}}),Ys({name:"exportWithDarkMode",perform:function(e,t,n){return{appState:tp(tp({},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)(_c,{value:t.exportWithDarkMode?d.C6.DARK:d.C6.LIGHT,onChange:function(e){n(e===d.C6.DARK)},title:I("labels.toggleExportColorScheme")})})}});function ip(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?ip(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ip(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var sp="{}",cp=Ys({name:"copyStyles",perform:function(e,t){var n=e.find((function(e){return t.selectedElementIds[e.id]}));return n&&(sp=JSON.stringify(n)),{appState:lp(lp({},t),{},{toastMessage:I("toast.copyStyles")}),commitToHistory:!1}},contextItemLabel:"labels.copyStyles",keyTest:function(e){return e[un]&&e.altKey&&e.code===Yt}}),up=Ys({name:"pasteStyles",perform:function(e,t){var n,r=JSON.parse(sp);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}}),dp=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 pp(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 fp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pp(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Ys({name:"toggleCanvasMenu",perform:function(e,t){return{appState:fp(fp({},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})}}),Ys({name:"toggleEditMenu",perform:function(e,t){return{appState:fp(fp({},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})}}),Ys({name:"toggleFullScreen",perform:function(){return Yn()||document.documentElement.requestFullscreen(),Yn()&&document.exitFullscreen(),{commitToHistory:!1}},keyTest:function(e){return e.code===$t&&!e[un]}}),Ys({name:"toggleShortcuts",perform:function(e,t,n,r){var o=r.focusContainer;return t.showHelpDialog&&o(),{appState:fp(fp({},t),{},{showHelpDialog:!t.showHelpDialog}),commitToHistory:!1}},PanelComponent:function(e){var t=e.updateData;return(0,P.jsx)(dp,{title:I("helpDialog.title"),onClick:t})},keyTest:function(e){return e.key===hn}});function hp(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 mp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hp(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function gp(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 vp(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 vp(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 vp(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 bp=function(e,t){var n=dl(nl(e),t);return n.length>=2&&!function(e){if(e.length>=2){var t,n=gp(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)},yp=Ys({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,mp(mp({},t),{},{selectedGroupIds:{}}),nl(h)),elements:h,commitToHistory:!0}},contextItemLabel:"labels.group",contextItemPredicate:function(e,t){return bp(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:!bp(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)})}}),xp=Ys({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(mp(mp({},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)})}}),wp=(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 kp(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?kp(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Ys({name:"goToCollaborator",perform:function(e,t,n){var r=n;return r?{appState:Sp(Sp(Sp({},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=ru(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)(wp,{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 Ep=Ys({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 Cp(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 jp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Cp(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Op=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())},Mp=function(e,t,n){var r=n.axis,o=n.position,a=Ip(e),i=g("x"===r?["minX","maxX"]:["minY","maxY"],2),l=i[0],s=i[1],c={x:0,y:0};return jp(jp({},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))},Ip=function(e){var t=g(Ot(e),4);return{minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}},Pp=function(e,t){return dl(nl(e),t).length>1},Tp=function(e,t,n){var r=function(e,t){var n=Op(e),r=Ip(e);return n.flatMap((function(e){var n=Mp(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}))};Ys({name:"alignTop",perform:function(e,t){return{appState:t,elements:Tp(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:!Pp(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)})}}),Ys({name:"alignBottom",perform:function(e,t){return{appState:t,elements:Tp(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:!Pp(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)})}}),Ys({name:"alignLeft",perform:function(e,t){return{appState:t,elements:Tp(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:!Pp(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)})}}),Ys({name:"alignRight",perform:function(e,t){return{appState:t,elements:Tp(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:!Pp(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)})}}),Ys({name:"alignVerticallyCentered",perform:function(e,t){return{appState:t,elements:Tp(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:!Pp(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)})}}),Ys({name:"alignHorizontallyCentered",perform:function(e,t){return{appState:t,elements:Tp(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:!Pp(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 Ap(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 Lp(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 Lp(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 Lp(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 _p=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())},Dp=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}},zp=function(e,t){return dl(nl(e),t).length>1},Hp=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=Dp(e),c=_p(e).map((function(e){return[e,Dp(e)]})).sort((function(e,t){return e[1][a]-t[1][a]})),u=0,d=Ap(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}))},Bp=(Ys({name:"distributeHorizontally",perform:function(e,t){return{appState:t,elements:Hp(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:!zp(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)})}}),Ys({name:"distributeVertically",perform:function(e,t){return{appState:t,elements:Hp(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:!zp(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)})}}),Ys({name:"flipHorizontal",perform:function(e,t){return{elements:Rp(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)}})),Np=Ys({name:"flipVertical",perform:function(e,t){return{elements:Rp(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)}}),Rp=function(e,t,n){var r=dl(nl(e),t);if(r.length>1)return e;var o=Fp(r,t,n),a=el(o);return e.map((function(e){return a[e.id]||e}))},Fp=function(e,t,n){return e.forEach((function(e){Vp(e,t),"vertical"===n&&Up(e,Math.PI)})),e},Vp=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})},Up=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 Gp(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 Wp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gp(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Kp=Ys({name:"copy",perform:function(e,t,n,r){return zd(nl(e),t,r.files),{commitToHistory:!1}},contextItemLabel:"labels.copy",keyTest:void 0}),Zp=Ys({name:"cut",perform:function(e,t,n,r){return Kp.perform(e,t,n,r),Qs.perform(e,t,n,r)},contextItemLabel:"labels.cut",keyTest:function(e){return e[un]&&e.code===en}}),Yp=Ys({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,Gd("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:Wp(Wp({},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"}),Xp=Ys({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,Gd("clipboard",a.length?a:nl(t),n,o.files,n);case 6:return e.abrupt("return",{appState:Wp(Wp({},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:Wp(Wp({},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 qp(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 $p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qp(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Qp=Ys({name:"gridMode",perform:function(e,t){return eu("view","mode","grid"),{appState:$p($p({},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 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 ef(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 tf=Ys({name:"zenMode",perform:function(e,t){return eu("view","mode","zen"),{appState:ef(ef({},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 nf(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 rf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nf(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var of=Ys({name:"stats",perform:function(e,t){return{appState:rf(rf({},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 af(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?af(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):af(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var sf=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:lf(lf({},t),o.appState),commitToHistory:r,syncHistory:!0}}return{commitToHistory:r}},cf=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}(),uf=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(Tu(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,Fu(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}(),df=function(e){var t=Array.from(e.values());return{x:ff(t,(function(e){return e.x}))/t.length,y:ff(t,(function(e){return e.y}))/t.length}},pf=function(e){var t=g(e,2),n=t[0],r=t[1];return Math.hypot(n.x-r.x,n.y-r.y)},ff=function(e,t){return e.reduce((function(e,n){return e+t(n)}),0)};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}function mf(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){D(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}var gf=function(e){return{selectedElementIds:e.selectedElementIds,selectedGroupIds:e.selectedGroupIds,viewBackgroundColor:e.viewBackgroundColor,editingLinearElement:e.editingLinearElement,editingGroupId:e.editingGroupId,name:e.name}},vf=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:gf(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(mf(mf({},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}(),bf=[{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}],yf=(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")]}),xf=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)(xc,{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=yf[o],l&&l.length>0?l[0]:""):""})]})},t)}))})})},wf=new WeakMap,kf=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)(xf,{top:e.top,left:e.left,options:r,onCloseRequest:function(){return t=e.container,void((n=wf.get(t))&&((0,Lt.unmountComponentAtNode)(n),n.remove(),wf.delete(t)));var t,n},actionManager:e.actionManager,appState:e.appState}),(t=e.container,(n=wf.get(t))||(n=document.createElement("div"),t.querySelector(".excalidraw-contextMenuContainer").appendChild(n),wf.set(t,n),n)))},Sf=function(e){var t=e.appState,n=e.elements,r=e.renderAction,o=e.elementType,a=pl(nl(n),t),i=Boolean(t.editingElement),l=Ph(),s="rtl"===document.documentElement.getAttribute("dir"),c=ml(o)||a.some((function(e){return ml(e.type)&&!rr(e.backgroundColor)})),u=ml(o)||a.some((function(e){return ml(e.type)}));return(0,P.jsxs)("div",{className:"panelColumn",children:[(gl(o)&&"image"!==o||a.some((function(e){return gl(e.type)})))&&r("changeStrokeColor"),u&&r("changeBackgroundColor"),c&&r("changeFillStyle"),(vl(o)||a.some((function(e){return vl(e.type)})))&&r("changeStrokeWidth"),("freedraw"===o||a.some((function(e){return"freedraw"===e.type})))&&r("changeStrokeShape"),(bl(o)||a.some((function(e){return bl(e.type)})))&&(0,P.jsxs)(P.Fragment,{children:[r("changeStrokeStyle"),r("changeSloppiness")]}),(yl(o)||a.some((function(e){return yl(e.type)})))&&(0,P.jsx)(P.Fragment,{children:r("changeSharpness")}),(xl(o)||a.some((function(e){return xl(e.type)})))&&(0,P.jsxs)(P.Fragment,{children:[r("changeFontSize"),r("changeFontFamily"),r("changeTextAlign")]}),(wl(o)||a.some((function(e){return wl(e.type)})))&&(0,P.jsx)(P.Fragment,{children:r("changeArrowhead")}),r("changeOpacity"),(0,P.jsxs)("fieldset",{children:[(0,P.jsx)("legend",{children:I("labels.layers")}),(0,P.jsxs)("div",{className:"buttonList",children:[r("sendToBack"),r("sendBackward"),r("bringToFront"),r("bringForward")]})]}),a.length>1&&(0,P.jsxs)("fieldset",{children:[(0,P.jsx)("legend",{children:I("labels.align")}),(0,P.jsxs)("div",{className:"buttonList",children:[s?(0,P.jsxs)(P.Fragment,{children:[r("alignRight"),r("alignHorizontallyCentered"),r("alignLeft")]}):(0,P.jsxs)(P.Fragment,{children:[r("alignLeft"),r("alignHorizontallyCentered"),r("alignRight")]}),a.length>2&&r("distributeHorizontally"),(0,P.jsxs)("div",{className:"iconRow",children:[r("alignTop"),r("alignVerticallyCentered"),r("alignBottom"),a.length>2&&r("distributeVertically")]})]})]}),!l&&!i&&a.length>0&&(0,P.jsxs)("fieldset",{children:[(0,P.jsx)("legend",{children:I("labels.actions")}),(0,P.jsxs)("div",{className:"buttonList",children:[r("duplicateSelection"),r("deleteSelectedElements"),r("group"),r("ungroup")]})]})]})},Ef=function(e){var t=e.canvas,n=e.elementType,r=e.setAppState,o=e.onImageAction;return(0,P.jsx)(P.Fragment,{children:bf.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)}))})},Cf=function(e){var t=e.renderAction;e.zoom;return(0,P.jsx)(Qd,{gap:1,children:(0,P.jsxs)($d,{gap:1,align:"center",children:[t("zoomOut"),t("zoomIn"),t("resetZoom")]})})},jf=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")]})},Of=(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:Ph()})})}),Mf=function(e){var t=e.message,n=e.onClose,r=g((0,c.useState)(!!t),2),o=r[0],a=r[1],i=Ah().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)(Uc,{small:!0,onCloseRequest:l,title:I("errorDialog.title"),children:(0,P.jsx)("div",{style:{whiteSpace:"pre-wrap"},children:t})})})},If=(n(2205),"filter"in document.createElement("canvas").getContext("2d")),Pf=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"),")"]})]})},Tf=function(e,t){(0,Lt.unmountComponentAtNode)(t),t.innerHTML="",e instanceof HTMLCanvasElement?t.appendChild(e):(0,Lt.render)((0,P.jsx)(Pf,{}),t)},Af=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})},Lf=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&&dd(x,n,r,{exportBackground:b,viewBackgroundColor:y,exportPadding:a}).then((function(t){return Vu(t).then((function(){Tf(t,e)}))})).catch((function(t){console.error(t),Tf(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}),If&&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)(Yd,{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)($d,{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:!yu&&i.renderAction("changeProjectName")}),(0,P.jsxs)($d,{gap:2,justifyContent:"center",style:{margin:"2em 0"},children:[(0,P.jsx)(Af,{color:"indigo",title:I("buttons.exportToPng"),"aria-label":I("buttons.exportToPng"),onClick:function(){return l(x)},children:"PNG"}),(0,P.jsx)(Af,{color:"red",title:I("buttons.exportToSvg"),"aria-label":I("buttons.exportToSvg"),onClick:function(){return s(x)},children:"SVG"}),Dd&&(0,P.jsx)(Af,{title:I("buttons.copyPngToClipboard"),onClick:function(){return u(x)},color:"gray",shade:7,children:Vl})]})]})},_f=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:Ph(),title:I("buttons.exportImage")}),h&&(0,P.jsx)(Uc,{onCloseRequest:v,title:I("buttons.exportImage"),children:(0,P.jsx)(Lf,{elements:t,appState:n,files:r,exportPadding:a,actionManager:i,onExportToPng:l,onExportToSvg:s,onExportToClipboard:p,onCloseRequest:v})})]})},Df=(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})}),zf=(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}),Hf=(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"})})),Bf=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(){(0,f.Z)(b().mark((function e(){var o,a;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=t||r){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,pd(o,{exportBackground:!1,viewBackgroundColor:Pt.white},n);case 5:a=e.sent,i.current&&(i.current.innerHTML=a.outerHTML);case 7:case"end":return e.stop()}}),e)})))()}),[t,r,n]);var l=g((0,c.useState)(!1),2),s=l[0],u=l[1],p=Ph(),h=(s||p)&&r&&(0,P.jsx)("div",{className:"library-unit__adder",children:Hf});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})]})},Nf={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"})})},Rf=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?Nf.CHECKED:Nf.UNCHECKED})]})},Ff=["heading","children"];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}function Uf(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){D(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}var Gf=function(e){var t=e.heading,n=e.children,r=bo(e,Ff),o=Ah().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",Uf(Uf({},r),{},{"aria-labelledby":"".concat(o,"-").concat(t,"-title"),children:"function"==typeof n?n(a):(0,P.jsxs)(P.Fragment,{children:[a,n]})}))},Wf=(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)(Hc,{label:o.username||"Unknown user",children:i.renderAction("goToCollaborator",{id:r})},r)}))})}))),Kf=(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"})}),Zf=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:Kf})]})};function Yf(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 Xf=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.UIOptions,v=e.onImageAction,b=e.renderTopRightUI;return(0,P.jsxs)(P.Fragment,{children:[!h&&(0,P.jsxs)(Df,{side:"top",className:"App-top-bar",children:[(0,P.jsx)(Gf,{heading:"shapes",children:function(e){return(0,P.jsxs)(Qd,{gap:4,align:"center",children:[(0,P.jsxs)($d,{gap:1,children:[(0,P.jsxs)(Rc,{padding:1,children:[e,(0,P.jsx)($d,{gap:1,children:(0,P.jsx)(Ef,{canvas:d,elementType:n.elementType,setAppState:s,onImageAction:function(e){var t=e.pointerType;v({insertOnCanvasDirectly:"mouse"!==t})}})})]}),b&&b(!0,n),(0,P.jsx)(Al,{type:"button",className:"HomeButton ToolIcon_type_floating",title:"Home","aria-label":"Home",icon:Ks,onClick:t},"home"),(0,P.jsx)(Rf,{checked:n.elementLocked,onChange:u,title:I("toolBar.lock")}),(0,P.jsx)(Zf,{appState:n,setAppState:s})]}),o]})}}),(0,P.jsx)(zf,{appState:n,elements:r})]}),(0,P.jsx)("div",{className:"App-bottom-bar",style:{marginBottom:14,marginLeft:14,marginRight:14},children:(0,P.jsxs)(Rc,{padding:0,children:[g.canvasActions&&"canvas"===n.openMenu?(0,P.jsx)(Gf,{className:"App-mobile-menu",heading:"canvasActions",children:(0,P.jsx)("div",{className:"panelColumn",children:(0,P.jsxs)(Qd,{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)(Of,{isCollaborating:p,collaboratorCount:n.collaborators.size,onClick:c}),(0,P.jsx)(jf,{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)(Wf,{mobile:!0,layout:"horizontal",collaborators:n.collaborators,actionManager:a})]})]})})}):"shape"===n.openMenu&&!h&&$i(n,r)?(0,P.jsx)(Gf,{className:"App-mobile-menu",heading:"selectedShapeActions",children:(0,P.jsx)(Sf,{appState:n,elements:r,renderAction:a.renderAction,elementType:n.elementType})}):null,(0,P.jsxs)("footer",{className:"App-toolbar",children:[h?g.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:[g.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?Yf(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},hl(r,n)))},children:I("buttons.scrollBackToContent")})]})]})})]})},qf=(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=Pd(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,pd(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})})}),$f=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),eu("magic","chart",e),t({currentChartType:e,pasteDialog:{shown:!1,data:null}})};return(0,P.jsx)(Uc,{small:!0,onCloseRequest:a,title:I("labels.pasteCharts"),className:"PasteChartDialog",autofocus:!1,children:(0,P.jsxs)("div",{className:"container",children:[(0,P.jsx)(qf,{chartType:"bar",spreadsheet:n.pasteDialog.data,selected:"bar"===n.currentChartType,onClick:i}),(0,P.jsx)(qf,{chartType:"line",spreadsheet:n.pasteDialog.data,selected:"line"===n.currentChartType,onClick:i})]})})};n(3922);function Qf(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 Jf=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")})]})},eh=function(e){return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("h3",{children:e.title}),e.children]})},th=function(e){return(0,P.jsx)("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"space-between"},children:e.children})},nh=function(e){return(0,P.jsx)("div",{style:{width:"49%"},children:e.children})},rh=function(e){return(0,P.jsxs)("div",{className:"HelpDialog--island",children:[(0,P.jsx)("h3",{className:"HelpDialog--island-title",children:e.caption}),e.children]})},oh=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)(ah,{children:t}),e.isOr&&n!==e.shortcuts.length-1&&I("helpDialog.or")]},n)}))})]})})};oh.defaultProps={isOr:!0};var ah=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?Qf(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({className:"HelpDialog--key"},e))},ih=function(e){var t=e.onClose,n=u().useCallback((function(){t&&t()}),[t]);return(0,P.jsx)(P.Fragment,{children:(0,P.jsxs)(Uc,{onCloseRequest:n,title:I("helpDialog.title"),className:"HelpDialog",children:[(0,P.jsx)(Jf,{}),(0,P.jsx)(eh,{title:I("helpDialog.shortcuts"),children:(0,P.jsxs)(th,{children:[(0,P.jsxs)(nh,{children:[(0,P.jsxs)(rh,{caption:I("helpDialog.shapes"),children:[(0,P.jsx)(oh,{label:I("toolBar.selection"),shortcuts:["V","1"]}),(0,P.jsx)(oh,{label:I("toolBar.rectangle"),shortcuts:["R","2"]}),(0,P.jsx)(oh,{label:I("toolBar.diamond"),shortcuts:["D","3"]}),(0,P.jsx)(oh,{label:I("toolBar.ellipse"),shortcuts:["E","4"]}),(0,P.jsx)(oh,{label:I("toolBar.arrow"),shortcuts:["A","5"]}),(0,P.jsx)(oh,{label:I("toolBar.line"),shortcuts:["P","6"]}),(0,P.jsx)(oh,{label:I("toolBar.freedraw"),shortcuts:["Shift+P","7"]}),(0,P.jsx)(oh,{label:I("toolBar.text"),shortcuts:["T","8"]}),(0,P.jsx)(oh,{label:I("toolBar.image"),shortcuts:["9"]}),(0,P.jsx)(oh,{label:I("toolBar.library"),shortcuts:["0"]}),(0,P.jsx)(oh,{label:I("helpDialog.editSelectedShape"),shortcuts:[Xn("Enter"),I("helpDialog.doubleClick")]}),(0,P.jsx)(oh,{label:I("helpDialog.textNewLine"),shortcuts:[Xn("Enter"),Xn("Shift+Enter")]}),(0,P.jsx)(oh,{label:I("helpDialog.textFinish"),shortcuts:[Xn("Esc"),Xn("CtrlOrCmd+Enter")]}),(0,P.jsx)(oh,{label:I("helpDialog.curvedArrow"),shortcuts:["A",I("helpDialog.click"),I("helpDialog.click"),I("helpDialog.click")],isOr:!1}),(0,P.jsx)(oh,{label:I("helpDialog.curvedLine"),shortcuts:["L",I("helpDialog.click"),I("helpDialog.click"),I("helpDialog.click")],isOr:!1}),(0,P.jsx)(oh,{label:I("toolBar.lock"),shortcuts:["Q"]}),(0,P.jsx)(oh,{label:I("helpDialog.preventBinding"),shortcuts:[Xn("CtrlOrCmd")]})]}),(0,P.jsxs)(rh,{caption:I("helpDialog.view"),children:[(0,P.jsx)(oh,{label:I("buttons.zoomIn"),shortcuts:[Xn("CtrlOrCmd++")]}),(0,P.jsx)(oh,{label:I("buttons.zoomOut"),shortcuts:[Xn("CtrlOrCmd+-")]}),(0,P.jsx)(oh,{label:I("buttons.resetZoom"),shortcuts:[Xn("CtrlOrCmd+0")]}),(0,P.jsx)(oh,{label:I("helpDialog.zoomToFit"),shortcuts:["Shift+1"]}),(0,P.jsx)(oh,{label:I("helpDialog.zoomToSelection"),shortcuts:["Shift+2"]}),(0,P.jsx)(oh,{label:I("buttons.fullScreen"),shortcuts:["F"]}),(0,P.jsx)(oh,{label:I("buttons.zenMode"),shortcuts:[Xn("Alt+Z")]}),(0,P.jsx)(oh,{label:I("labels.showGrid"),shortcuts:[Xn("CtrlOrCmd+'")]}),(0,P.jsx)(oh,{label:I("labels.viewMode"),shortcuts:[Xn("Alt+R")]}),(0,P.jsx)(oh,{label:I("labels.toggleTheme"),shortcuts:[Xn("Alt+Shift+D")]}),(0,P.jsx)(oh,{label:I("stats.title"),shortcuts:[Xn("Alt+/")]})]})]}),(0,P.jsx)(nh,{children:(0,P.jsxs)(rh,{caption:I("helpDialog.editor"),children:[(0,P.jsx)(oh,{label:I("labels.selectAll"),shortcuts:[Xn("CtrlOrCmd+A")]}),(0,P.jsx)(oh,{label:I("labels.multiSelect"),shortcuts:[Xn("Shift+".concat(I("helpDialog.click")))]}),(0,P.jsx)(oh,{label:I("labels.moveCanvas"),shortcuts:[Xn("Space+".concat(I("helpDialog.drag"))),Xn("Wheel+".concat(I("helpDialog.drag")))],isOr:!0}),(0,P.jsx)(oh,{label:I("labels.cut"),shortcuts:[Xn("CtrlOrCmd+X")]}),(0,P.jsx)(oh,{label:I("labels.copy"),shortcuts:[Xn("CtrlOrCmd+C")]}),(0,P.jsx)(oh,{label:I("labels.paste"),shortcuts:[Xn("CtrlOrCmd+V")]}),(0,P.jsx)(oh,{label:I("labels.copyAsPng"),shortcuts:[Xn("Shift+Alt+C")]}),(0,P.jsx)(oh,{label:I("labels.copyStyles"),shortcuts:[Xn("CtrlOrCmd+Alt+C")]}),(0,P.jsx)(oh,{label:I("labels.pasteStyles"),shortcuts:[Xn("CtrlOrCmd+Alt+V")]}),(0,P.jsx)(oh,{label:I("labels.delete"),shortcuts:[Xn("Del")]}),(0,P.jsx)(oh,{label:I("labels.sendToBack"),shortcuts:[Xn(_t?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")]}),(0,P.jsx)(oh,{label:I("labels.bringToFront"),shortcuts:[Xn(_t?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")]}),(0,P.jsx)(oh,{label:I("labels.sendBackward"),shortcuts:[Xn("CtrlOrCmd+[")]}),(0,P.jsx)(oh,{label:I("labels.bringForward"),shortcuts:[Xn("CtrlOrCmd+]")]}),(0,P.jsx)(oh,{label:I("labels.alignTop"),shortcuts:[Xn("CtrlOrCmd+Shift+Up")]}),(0,P.jsx)(oh,{label:I("labels.alignBottom"),shortcuts:[Xn("CtrlOrCmd+Shift+Down")]}),(0,P.jsx)(oh,{label:I("labels.alignLeft"),shortcuts:[Xn("CtrlOrCmd+Shift+Left")]}),(0,P.jsx)(oh,{label:I("labels.alignRight"),shortcuts:[Xn("CtrlOrCmd+Shift+Right")]}),(0,P.jsx)(oh,{label:I("labels.duplicateSelection"),shortcuts:[Xn("CtrlOrCmd+D"),Xn("Alt+".concat(I("helpDialog.drag")))]}),(0,P.jsx)(oh,{label:I("buttons.undo"),shortcuts:[Xn("CtrlOrCmd+Z")]}),(0,P.jsx)(oh,{label:I("buttons.redo"),shortcuts:Dt?[Xn("CtrlOrCmd+Y"),Xn("CtrlOrCmd+Shift+Z")]:[Xn("CtrlOrCmd+Shift+Z")]}),(0,P.jsx)(oh,{label:I("labels.group"),shortcuts:[Xn("CtrlOrCmd+G")]}),(0,P.jsx)(oh,{label:I("labels.ungroup"),shortcuts:[Xn("CtrlOrCmd+Shift+G")]}),(0,P.jsx)(oh,{label:I("labels.flipHorizontal"),shortcuts:[Xn("Shift+H")]}),(0,P.jsx)(oh,{label:I("labels.flipVertical"),shortcuts:[Xn("Shift+V")]}),(0,P.jsx)(oh,{label:I("labels.showStroke"),shortcuts:[Xn("S")]}),(0,P.jsx)(oh,{label:I("labels.showBackground"),shortcuts:[Xn("G")]})]})})]})})]})})},lh=(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})}),sh=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)(lh,{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"),!yu&&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(ap)}})]}),l&&(0,P.jsxs)(lh,{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)]})})},ch=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(ap):d(!0)},"data-testid":"json-export-button",icon:Zl,type:"button","aria-label":I("buttons.export"),showAriaLabel:Ph(),title:I("buttons.export")}),s&&a&&"function"!=typeof a&&(0,P.jsx)(Uc,{onCloseRequest:p,title:I("buttons.export"),children:(0,P.jsx)(sh,{elements:t,appState:n,files:r,actionManager:o,onCloseRequest:p,exportOpts:a,canvas:i})})]})},uh=["suggestedBindings","startBoundElement"];function dh(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 ph=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=Ph(),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(){rd(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(){nd(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)(Qd,{children:(0,P.jsx)(Bf,{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)($d,{align:"center",gap:1,children:S},w))}return(0,P.jsx)(Qd,{align:"start",gap:1,className:"layer-ui__library-items",children:b})},fh=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)(Rc,{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)(ph,{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})})},hh=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=Ph(),_=function(){return C.canvasActions&&C.canvasActions.export?(0,P.jsx)(ch,{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,Gd(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&&Bu(r)&&i({fileHandle:r});case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()};return(0,P.jsx)(_f,{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)(fh,{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)(Mf,{message:o.errorMessage,onClose:function(){return i({errorMessage:null})}}),o.showHelpDialog&&(0,P.jsx)(ih,{onClose:function(){i({showHelpDialog:!1})}}),o.pasteDialog.shown&&(0,P.jsx)($f,{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)(Xf,{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,UIOptions:C,onImageAction:A,renderTopRightUI:w})]}):(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)(Df,{side:"top",children:(0,P.jsxs)("div",{className:"App-menu App-menu_top",children:[(0,P.jsxs)(Qd,{gap:4,className:Ye({"disable-pointerEvents":m}),children:[C.canvasActions&&(S?(0,P.jsx)(Gf,{heading:"canvasActions",className:Ye("zen-mode-transition",{"transition-left":m}),children:(0,P.jsx)(Rc,{padding:2,style:{zIndex:1},children:(0,P.jsx)(Qd,{gap:4,children:(0,P.jsxs)($d,{gap:1,justifyContent:"space-between",children:[_(),z()]})})})}):(0,P.jsx)(Gf,{heading:"canvasActions",className:Ye("zen-mode-transition",{"transition-left":m}),children:(0,P.jsx)(Rc,{padding:2,style:{zIndex:1},children:(0,P.jsxs)(Qd,{gap:4,children:[(0,P.jsxs)($d,{gap:3,justifyContent:"space-between",children:[r.renderAction("clearCanvas"),r.renderAction("loadScene"),_(),z(),u&&(0,P.jsx)(Of,{isCollaborating:x,collaboratorCount:o.collaborators.size,onClick:u})]}),(0,P.jsx)(jf,{actionManager:r,appState:o,setAppState:i,showThemeBtn:v}),o.fileHandle&&(0,P.jsx)(P.Fragment,{children:r.renderAction("saveToActiveFile")})]})})})),t&&(0,P.jsx)(Gf,{heading:"selectedShapeActions",className:Ye("zen-mode-transition",{"transition-left":m}),children:(0,P.jsx)(Rc,{className:d.$C.SHAPE_ACTIONS_MENU,padding:2,style:{maxHeight:"".concat(o.height-(o.fileHandle?248:200),"px")},children:(0,P.jsx)(Sf,{appState:o,elements:s,renderAction:r.renderAction,elementType:o.elementType})})})]}),!S&&(0,P.jsx)(Gf,{heading:"shapes",children:function(e){return(0,P.jsxs)(Qd,{gap:4,align:"start",children:[(0,P.jsxs)($d,{gap:1,children:[(0,P.jsx)(Rf,{zenModeEnabled:m,checked:o.elementLocked,onChange:p,title:I("toolBar.lock")}),(0,P.jsxs)(Rc,{padding:1,className:Ye({"zen-mode":m}),children:[(0,P.jsx)(zf,{appState:o,elements:s}),e,(0,P.jsx)($d,{gap:1,children:(0,P.jsx)(Ef,{canvas:l,elementType:o.elementType,setAppState:i,onImageAction:function(e){var t=e.pointerType;A({insertOnCanvasDirectly:"mouse"!==t})}})})]}),(0,P.jsx)(Zf,{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)(Wf,{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)(Qd,{gap:2,children:(0,P.jsxs)(Gf,{heading:"canvasActions",children:[(0,P.jsx)(Rc,{padding:1,children:(0,P.jsx)(Cf,{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?dh(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},hl(s,o)))},children:I("buttons.scrollBackToContent")})]})},mh=function(e,t){var n=function(e){e.suggestedBindings,e.startBoundElement;return bo(e,uh)},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]}))},gh=u().memo(hh,mh),vh=(n(1528),function(e){var t,n=Ph(),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)(Rc,{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)]})})]})})}),bh=(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 yh(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 xh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yh(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var wh=Ys({name:"viewMode",perform:function(e,t){return eu("view","mode","view"),{appState:xh(xh({},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}}),kh=n(200),Sh=n.n(kh);function Eh(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 Ch(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 Ch(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 Ch(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 jh(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 Oh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jh(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Mh(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 Ih=u().createContext(!1),Ph=function(){return(0,c.useContext)(Ih)},Th=u().createContext({container:null,id:null}),Ah=function(){return(0,c.useContext)(Th)},Lh=!1,_h=0,Dh=0,zh=0,Hh=!1,Bh=!1,Nh=!1,Rh={horizontal:null,vertical:null},Fh=0,Vh=!1,Uh=null,Gh={pointers:new Map,lastCenter:null,initialDistance:null,initialScale:null},Wh=function(e){F(o,e);var t,n,r=Mh(o);function o(e){var t;z(this,o),t=r.call(this,e),Kh.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=Oh(Oh(Oh({},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 uf(N(t)),t.history=new vf,t.actionManager=new cf(t.syncActionResult,(function(){return t.state}),(function(){return t.scene.getElementsIncludingDeleted()}),N(t)),t.actionManager.registerAll(Zs),t.actionManager.registerAction((l=t.history,{name:"undo",perform:function(e,t){return sf(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 sf(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)(Th.Provider,{value:this.excalidrawContainerValue,children:(0,P.jsxs)(Ih.Provider,{value:this.isMobile,children:[(0,P.jsx)(gh,{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)(vh,{appState:this.state,setAppState:this.setAppState,elements:this.scene.getElements(),onClose:this.toggleStats,renderCustomStats:u}),null!==this.state.toastMessage&&(0,P.jsx)(bh,{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.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 vf,this.actionManager=new cf(this.syncActionResult,(function(){return t.state}),(function(){return t.scene.getElementsIncludingDeleted()}),this),this.library=new uf(this),this.canvas=null,this.rc=null,this.excalidrawContainerRef.current=void 0,this.nearestScrollableContainer=void 0,this.excalidrawContainerValue={container:null,id:"unmounted"},clearTimeout(Fh),Fh=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(Jc)}));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=du(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&&(Rh=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:Dh,clientY:zh},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;Hh||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:Oh(Oh({},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!==Uh&&Uh(e)}},{key:"updateGestureOnPointerDown",value:function(e){Gh.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),2===Gh.pointers.size&&(Gh.lastCenter=df(Gh.pointers),Gh.initialScale=this.state.zoom.value,Gh.initialDistance=pf(Array.from(Gh.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(Rh,e.clientX-this.state.offsetLeft,e.clientY-this.state.offsetTop),lastCoords:Oh({},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;Nh=!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(){Nh=!1,Zn(n.canvas,n.state.elementType),Uh=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 Uh=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=Eh(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(Oh(Oh({},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(Oh(Oh({},n),{},{selectedElementIds:Oh(Oh(Oh({},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(Uh=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(Jc)}if($e(o)){var b=o;try{t.initializeImageDimensions(b),t.setState({selectedElementIds:D({},b.id,!0)},(function(){t.actionManager.executeAction(Jc)}))}catch(e){console.error(e),t.scene.replaceAllElements(t.scene.getElementsIncludingDeleted().filter((function(e){return e.id!==b.id}))),t.actionManager.executeAction(Jc)}}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:Oh(Oh({},e.selectedElementIds),{},D({},t.state.draggingElement.id,!0))}})):(Wn(t.canvas),t.setState((function(e){return{draggingElement:null,elementType:"selection",selectedElementIds:Oh(Oh({},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 Oh(Oh({},e),t)}),{});t.setState((function(e){return{selectedGroupIds:Oh(Oh({},e.selectedElementIds),x.groupIds.map((function(e){return D({},e,!1)})).reduce((function(e,t){return Oh(Oh({},e),t)}),{})),selectedElementIds:Oh(Oh({},e.selectedElementIds),w)}}))}else t.setState((function(e){return Oo(Oh(Oh({},e),{},{selectedElementIds:Oh(Oh({},e.selectedElementIds),{},D({},x.id,!1))}),t.scene.getElements())}));else t.setState((function(e){return{selectedElementIds:Oh(Oh({},e.selectedElementIds),{},D({},x.id,!0))}}));else t.setState((function(e){return Oh({},Oo(Oh(Oh({},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:Oh(Oh({},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(){Lh=!1}}]),o}(u().Component);Wh.defaultProps={UIOptions:d.cW};var Kh=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:Oh(Oh({},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(){Hh=!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),td(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 Oh(Oh({},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,Ru(o,e.state,e.scene.getElementsIncludingDeleted()).then((function(t){e.syncActionResult(Oh(Oh({},t),{},{appState:Oh(Oh({},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=Lu(a,null,null)).appState=Oh(Oh({},l.appState),{},{elementType:"image"===l.appState.elementType?"selection":l.appState.elementType,isLoading:!1}),null!==(n=a)&&void 0!==n&&n.scrollToContent&&(l.appState=Oh(Oh({},l.appState),hl(l.elements,Oh(Oh({},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(Oh(Oh({},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(Qs)},this.copyAll=function(){zd(e.scene.getElements(),e.state,e.files)},this.onTapStart=function(t){if(!Lh)return Lh=!0,clearTimeout(_h),void(_h=window.setTimeout(Wh.resetTapTwice,d.Gj));if(Lh&&1===t.touches.length){var n=g(t.touches,1)[0];e.handleCanvasDoubleClick({clientX:n.clientX,clientY:n.clientY}),Lh=!1,clearTimeout(_h)}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(Dh,zh),!n||i instanceof HTMLCanvasElement&&!Nn(a)){t.next=7;break}return t.abrupt("return");case 7:return t.next=9,Rd(n);case 9:if(l=t.sent,!(s=null==n||null===(o=n.clipboardData)||void 0===o?void 0:o.files[0])&&l.text&&(c=l.text.trim()).startsWith("<svg")&&c.endsWith("</svg>")&&(s=Zu(c)),!Nu(s)){t.next=19;break}return u=qn({clientX:Dh,clientY:zh},e.state),d=u.x,p=u.y,f=e.createImageElement({sceneX:d,sceneY:p}),e.insertImageElement(f,s),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(l,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: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==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=Tu(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?Dh:e.state.width/2+e.state.offsetLeft,d="object"===L(t.position)?t.position.clientY:"cursor"===t.position?zh: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=Oh(Oh({},e.files),t.files)),e.scene.replaceAllElements(k),e.history.resumeRecording(),e.setState(Oo(Oh(Oh({},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&&Fh&&(clearTimeout(Fh),Fh=0,Vh=!1),Gh.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(tf)},this.toggleStats=function(){e.state.showStats||eu("dialog","stats"),e.actionManager.executeAction(of)},this.scrollToContent=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.scene.getElements();e.setState(Oh({},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=Oh(Oh({},e.files),Object.fromEntries(n)),e.addNewImagesToImageCache(),e.scene.getElements().forEach((function(e){qe(e)&&n.has(e.fileId)&&ho(e)})),e.scene.informMutation()})),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){Dh=e.clientX,zh=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=bf.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===Gh.pointers.size&&(Hh=!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})),Hh=!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:{}}),Gh.initialScale=e.state.zoom.value})),this.onGestureChange=or((function(t){if(t.preventDefault(),2!==Gh.pointers.size){var n=Gh.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:Dh,y:zh})}}))}})),this.onGestureEnd=or((function(t){t.preventDefault(),e.setState({previousSelectedElementIds:{},selectedElementIds:e.state.previousSelectedElementIds}),Gh.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(Oh(Oh({},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),Gh.pointers.has(t.pointerId)&&Gh.pointers.set(t.pointerId,{x:t.clientX,y:t.clientY});var n=Gh.initialScale;if(2===Gh.pointers.size&&Gh.lastCenter&&n&&Gh.initialDistance){var r=df(Gh.pointers),o=r.x-Gh.lastCenter.x,a=r.y-Gh.lastCenter.y;Gh.lastCenter=r;var i=pf(Array.from(Gh.pointers.values()))/Gh.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 Gh.lastCenter=Gh.initialDistance=Gh.initialScale=null;if(!(Hh||Bh||Nh)){var l=cl(Rh,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){Vh=!0},this.handleCanvasPointerDown=function(t){var n=document.getSelection();if(null!=n&&n.anchorNode&&n.removeAllRanges(),e.maybeOpenContextMenuAfterPointerDownOnTouchDevices(t),e.maybeCleanupAfterMissingPointerUp(t),!Bh&&(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),Gh.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);Uh=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&&(Vh=!1,Fh?Vh=!0:Fh=window.setTimeout((function(){Fh=0,Vh||e.handleCanvasContextMenu(t)}),d.nM))},this.handleCanvasPanUsingWheelOrSpaceDrag=function(t){if(0!==Gh.pointers.size||!(t.button===d.Oh.WHEEL||t.button===d.Oh.MAIN&&Hh||e.state.viewModeEnabled))return!1;Bh=!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(Uh=function(){Uh=null,Bh=!1,Hh||(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 Oh(Oh({},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(Oh(Oh({},t),{},{selectedElementIds:Oh(Oh({},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:Oh(Oh({},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(Jc);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(Jc);e.setState((function(e){return{selectedElementIds:Oh(Oh({},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:Oh(Oh({},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,Nu(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=Zu,t.t1=cd,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))||Uu(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,Ku(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&&Wu(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,Gu(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=Oh(Oh({},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(Jc),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,Ku(n,r);case 3:return o=t.sent,t.next=6,Gu(o);case 6:if(a=t.sent,n.type!==d.LO.svg){t.next=20;break}return t.next=10,id(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,ku({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(Jc)}))):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(Jc)}));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,ld({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=Eh(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]:sd(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=Sh()((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],!Nu(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,!yu){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,Ru(a,e.state,e.scene.getElementsIncludingDeleted());case 18:return l=t.sent,e.syncActionResult(Oh(Oh({},l),{},{appState:Oh(Oh({},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}),!yu){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){Ru(t,e.state,e.scene.getElementsIncludingDeleted()).then((function(t){e.syncActionResult(Oh(Oh({},t),{},{appState:Oh(Oh({},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=yp.contextItemPredicate(e.actionManager.getElementsIncludingDeleted(),e.actionManager.getAppState()),i=xp.contextItemPredicate(e.actionManager.getElementsIncludingDeleted(),e.actionManager.getAppState()),l=Bp.contextItemPredicate(e.actionManager.getElementsIncludingDeleted(),e.actionManager.getAppState()),s=Np.contextItemPredicate(e.actionManager.getElementsIncludingDeleted(),e.actionManager.getAppState()),c="separator",u=e.scene.getElements(),d=[];if(Dd&&u.length>0&&d.push(Xp),_d&&u.length>0&&d.push(Yp),"canvas"===n){var p=[].concat(d,[void 0===e.props.gridModeEnabled&&Qp,void 0===e.props.zenModeEnabled&&tf,void 0===e.props.viewModeEnabled&&wh,of]);e.state.viewModeEnabled?kf({options:p,top:o,left:r,actionManager:e.actionManager,appState:e.state,container:e.excalidrawContainerRef.current}):kf({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,Dd&&u.length>0&&Xp,_d&&u.length>0&&Yp,(Dd&&u.length>0||_d&&u.length>0)&&c,hc,c,void 0===e.props.gridModeEnabled&&Qp,void 0===e.props.zenModeEnabled&&tf,void 0===e.props.viewModeEnabled&&wh,of],top:o,left:r,actionManager:e.actionManager,appState:e.state,container:e.excalidrawContainerRef.current})}else"element"===n&&(e.state.viewModeEnabled?kf({options:[navigator.clipboard&&Kp].concat(d),top:o,left:r,actionManager:e.actionManager,appState:e.state,container:e.excalidrawContainerRef.current}):kf({options:[e.isMobile&&Zp,e.isMobile&&navigator.clipboard&&Kp,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,cp,up,c,a&&yp,i&&xp,(a||i)&&c,Ep,c,sc,cc,uc,dc,c,l&&Bp,s&&Np,(l||s)&&c,vc,Qs]),top:o,left:r,actionManager:e.actionManager,appState:e.state,container:e.excalidrawContainerRef.current}))},this.handleWheel=or((function(t){if(t.preventDefault(),!Bh){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:Dh,y:zh}),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:Gh.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(Oh({},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 Zh=Wh;n(4285),n(3313);function Yh(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 Xh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yh(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var qh=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=Lu({elements:t,appState:n},null,null),l=i.elements,s=i.appState,c=s.exportBackground,u=s.viewBackgroundColor;return dd(nl(l),Xh(Xh({},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}}))},$h=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,qh(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)}}(),Qh=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=Lu({elements:n,appState:o},null,null),c=s.elements,u=s.appState,e.abrupt("return",pd(nl(c),Xh(Xh({},u),{},{exportPadding:l}),i));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Jh=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,$h(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)}}(),em=["initialData","UIOptions"],tm=["initialData","UIOptions"];function nm(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 rm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nm(Object(n),!0).forEach((function(t){s()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var om=function(e){var t,n,r,o=e.onHomeButtonClick,a=e.onChange,l=e.initialData,s=e.excalidrawRef,u=e.onCollabButtonClick,p=e.isCollaborating,f=e.onPointerUpdate,h=e.renderTopRightUI,m=e.renderFooter,g=e.langCode,v=void 0===g?w.code:g,b=e.viewModeEnabled,y=e.zenModeEnabled,x=e.gridModeEnabled,k=e.libraryReturnUrl,S=e.theme,E=e.name,C=e.renderCustomStats,j=e.onPaste,O=e.detectScroll,M=void 0===O||O,I=e.handleKeyboardGlobally,T=void 0!==I&&I,L=e.onLibraryChange,_=e.autoFocus,D=void 0!==_&&_,z=e.id,H=e.generateIdForFile,B=null===(t=e.UIOptions)||void 0===t?void 0:t.canvasActions,N={canvasActions:!!B&&rm(rm({},d.cW.canvasActions),B)};N.canvasActions&&"object"===i()(N.canvasActions.export)&&(N.canvasActions.export.saveFileToDisk=null!==(n=null===(r=N.canvasActions.export)||void 0===r?void 0:r.saveFileToDisk)&&void 0!==n?n: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:v,children:(0,P.jsx)(Zh,{id:z,onHomeButtonClick:o,onChange:a,initialData:l,excalidrawRef:s,onCollabButtonClick:u,isCollaborating:p,onPointerUpdate:f,renderTopRightUI:h,renderFooter:m,langCode:v,viewModeEnabled:b,zenModeEnabled:y,gridModeEnabled:x,libraryReturnUrl:k,theme:S,name:E,renderCustomStats:C,UIOptions:N,onPaste:j,detectScroll:M,handleKeyboardGlobally:T,onLibraryChange:L,autoFocus:D,generateIdForFile:H})})},am=function(e,t){e.initialData;var n=e.UIOptions,r=void 0===n?{}:n,a=o()(e,em),i=(t.initialData,t.UIOptions),l=void 0===i?{}:i,s=o()(t,tm),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]}))},im=(0,c.forwardRef)((function(e,t){return(0,P.jsx)(om,rm(rm({},e),{},{excalidrawRef:t}))})),lm=u().memo(im,am),sm=(n(8336),lm)},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","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:"1018b0a7e7e60d808384"}[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(6177)}()}));
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-auto-flow:column;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"},6177: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 um},defaultLang:function(){return w},exportToBlob:function(){return Jh},exportToCanvas:function(){return Qh},exportToClipboard:function(){return tm},exportToSvg:function(){return em},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 Ru},loadLibraryFromBlob:function(){return Fu},mutateElement:function(){return po},newElementWith:function(){return fo},restore:function(){return Lu},restoreAppState:function(){return Au},restoreElements:function(){return Tu},serializeAsJSON:function(){return $u}});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.14"}');"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":100,"bg-BG":68,"ca-ES":84,"cs-CZ":29,"da-DK":20,"de-DE":100,"el-GR":74,"en":100,"es-ES":100,"fa-IR":77,"fi-FI":100,"fr-FR":100,"he-IL":99,"hi-IN":67,"hu-HU":60,"id-ID":100,"it-IT":100,"ja-JP":100,"kab-KAB":93,"kk-KZ":26,"ko-KR":68,"lv-LV":14,"my-MM":56,"nb-NO":100,"nl-NL":100,"nn-NO":74,"oc-FR":100,"pa-IN":99,"pl-PL":70,"pt-BR":100,"pt-PT":99,"ro-RO":100,"ru-RU":99,"sk-SK":100,"sv-SE":100,"tr-TR":78,"uk-UA":80,"zh-CN":100,"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}[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}[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"}))]}var u=g(a,6),d=u[0],p=u[1],f=u[2],h=u[3],v=u[4],b=u[5];if("dotted"===e.strokeStyle){var y=zr(e.strokeWidth-1);m.strokeLineDash=[y[0],y[1]-1]}else delete m.strokeLineDash;return[t.line(f,h,d,p,m),t.line(v,b,d,p,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=_h().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;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})})),Hs=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})})),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 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})})),Ns=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})})),Rs=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})})),Fs=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})})),Vs=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})})),Us=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})})),Gs=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})})),Ws=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})})),Ks=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"),Zs=[],Ys=function(e){return Zs=Zs.concat(e),e};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 qs(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){D(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 $s=function(e,t){if(e.editingGroupId){var n=Io(nl(t),e.editingGroupId);if(n.length)return qs(qs({},e),{},{selectedElementIds:D({},n[0].id,!0)})}return e},Qs=Ys({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:qs(qs({},$s(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:qs(qs({},t),{},{editingLinearElement:qs(qs(qs({},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:qs(qs({},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:qs(qs({},p=$s(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)})}}),Js=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},ec=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},tc=function(e,t){return t.reduce((function(t,n){var r=e[n];return t[r.id]=r,t}),{})},nc=function(e,t,n){var r,o,a=Js(t,e),i=tc(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=ec(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}))},rc=function(e,t,n){var r,o,a=Js(e,t),i=tc(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))},oc=function(e,t){return nc(t,e,"left")},ac=function(e,t){return nc(t,e,"right")},ic=function(e,t){return rc(e,t,"left")},lc=function(e,t){return rc(e,t,"right")},sc=Ys({name:"sendBackward",perform:function(e,t){return{elements:oc(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})})}}),cc=Ys({name:"bringForward",perform:function(e,t){return{elements:ac(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})})}}),uc=Ys({name:"sendToBack",perform:function(e,t){return{elements:ic(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})})}}),dc=Ys({name:"bringToFront",perform:function(e,t){return{elements:lc(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 pc(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 fc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pc(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var hc=Ys({name:"selectAll",perform:function(e,t){return!t.editingLinearElement&&{appState:Oo(fc(fc({},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 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 gc(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){D(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}var vc=Ys({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:gc(gc({},t),{},{editingLinearElement:gc(gc({},t.editingLinearElement),{},{activePointIndex:r+1})}),elements:e,commitToHistory:!0}}return gc(gc({},bc(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)})}}),bc=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(gc(gc({},t),{},{selectedGroupIds:{},selectedElementIds:r.reduce((function(e,t){return e[t.id]=!0,e}),{})}),nl(l))}},yc=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)}))})},xc=(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})}),wc=(n(4220),function(e){var t=(new Option).style;return t.color=e,!!t.color}),kc=[["1","2","3","4","5"],["q","w","e","r","t"],["a","s","d","f","g"]].flat(),Sc=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(kc.includes(e.key.toLowerCase())&&!Nn(e.target)){var h=kc.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(kc[t].toUpperCase()),"aria-label":I("colors.".concat(o)),"aria-keyshortcuts":kc[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:kc[t]})]},e)})),l&&(0,P.jsx)(Ec,{color:n,label:a,onChange:function(e){r(e)},ref:f})]})]})},Ec=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)||wc(e)?e:wc("#".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})]})})),Cc=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)(Ec,{color:n,label:o,onChange:function(e){r(e)}})]}),(0,P.jsx)(u().Suspense,{fallback:"",children:a?(0,P.jsx)(xc,{onCloseRequest:function(e){return e.target!==l.current&&i(!1)},children:(0,P.jsx)(Sc,{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 jc(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 Oc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jc(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Mc(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 Ic(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)(xc,Oc(Oc({onCloseRequest:function(e){return e.target!==p.current&&d(!1)}},f?{right:5.5}:{left:-5.5}),{},{children:(0,P.jsx)(Mc,{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 Pc(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 Tc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pc(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ac=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}))},Lc=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},_c=(Ys({name:"changeStrokeColor",perform:function(e,t,n){return Tc(Tc({},n.currentItemStrokeColor&&{elements:Ac(e,t,(function(e){return gl(e.type)?fo(e,{strokeColor:n.currentItemStrokeColor}):e}))}),{},{appState:Tc(Tc({},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)(Cc,{type:"elementStroke",label:I("labels.stroke"),color:Lc(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})}})]})}}),Ys({name:"changeBackgroundColor",perform:function(e,t,n){return Tc(Tc({},n.currentItemBackgroundColor&&{elements:Ac(e,t,(function(e){return fo(e,{backgroundColor:n.currentItemBackgroundColor})}))}),{},{appState:Tc(Tc({},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)(Cc,{type:"elementBackground",label:I("labels.background"),color:Lc(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})}})]})}}),Ys({name:"changeFillStyle",perform:function(e,t,n){return{elements:Ac(e,t,(function(e){return fo(e,{fillStyle:n})})),appState:Tc(Tc({},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)(yc,{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:Lc(t,n,(function(e){return e.fillStyle}),n.currentItemFillStyle),onChange:function(e){r(e)}})]})}}),Ys({name:"changeStrokeWidth",perform:function(e,t,n){return{elements:Ac(e,t,(function(e){return fo(e,{strokeWidth:n})})),appState:Tc(Tc({},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)(yc,{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:Lc(t,n,(function(e){return e.strokeWidth}),n.currentItemStrokeWidth),onChange:function(e){return r(e)}})]})}}),Ys({name:"changeSloppiness",perform:function(e,t,n){return{elements:Ac(e,t,(function(e){return fo(e,{seed:lo(),roughness:n})})),appState:Tc(Tc({},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)(yc,{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:Lc(t,n,(function(e){return e.roughness}),n.currentItemRoughness),onChange:function(e){return r(e)}})]})}}),Ys({name:"changeStrokeStyle",perform:function(e,t,n){return{elements:Ac(e,t,(function(e){return fo(e,{strokeStyle:n})})),appState:Tc(Tc({},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)(yc,{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:Lc(t,n,(function(e){return e.strokeStyle}),n.currentItemStrokeStyle),onChange:function(e){return r(e)}})]})}}),Ys({name:"changeOpacity",perform:function(e,t,n){return{elements:Ac(e,t,(function(e){return fo(e,{opacity:n})})),appState:Tc(Tc({},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=Lc(n,r,(function(e){return e.opacity}),r.currentItemOpacity))&&void 0!==t?t:void 0})]})}}),Ys({name:"changeFontSize",perform:function(e,t,n){return{elements:Ac(e,t,(function(e){if(Qe(e)){var t=fo(e,{fontSize:n});return qi(t),t}return e})),appState:Tc(Tc({},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)(yc,{group:"font-size",options:[{value:16,text:I("labels.small"),icon:(0,P.jsx)(zs,{theme:n.theme})},{value:20,text:I("labels.medium"),icon:(0,P.jsx)(Hs,{theme:n.theme})},{value:28,text:I("labels.large"),icon:(0,P.jsx)(Bs,{theme:n.theme})},{value:36,text:I("labels.veryLarge"),icon:(0,P.jsx)(Ns,{theme:n.theme})}],value:Lc(t,n,(function(e){return Qe(e)&&e.fontSize}),n.currentItemFontSize||d.n5),onChange:function(e){return r(e)}})]})}}),Ys({name:"changeFontFamily",perform:function(e,t,n){return{elements:Ac(e,t,(function(e){if(Qe(e)){var t=fo(e,{fontFamily:n});return qi(t),t}return e})),appState:Tc(Tc({},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)(Rs,{theme:n.theme})},{value:d.ut.Helvetica,text:I("labels.normal"),icon:(0,P.jsx)(Fs,{theme:n.theme})},{value:d.ut.Cascadia,text:I("labels.code"),icon:(0,P.jsx)(Vs,{theme:n.theme})}];return(0,P.jsxs)("fieldset",{children:[(0,P.jsx)("legend",{children:I("labels.fontFamily")}),(0,P.jsx)(yc,{group:"font-family",options:o,value:Lc(t,n,(function(e){return Qe(e)&&e.fontFamily}),n.currentItemFontFamily||d.rk),onChange:function(e){return r(e)}})]})}}),Ys({name:"changeTextAlign",perform:function(e,t,n){return{elements:Ac(e,t,(function(e){if(Qe(e)){var t=fo(e,{textAlign:n});return qi(t),t}return e})),appState:Tc(Tc({},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)(yc,{group:"text-align",options:[{value:"left",text:I("labels.left"),icon:(0,P.jsx)(Us,{theme:n.theme})},{value:"center",text:I("labels.center"),icon:(0,P.jsx)(Gs,{theme:n.theme})},{value:"right",text:I("labels.right"),icon:(0,P.jsx)(Ws,{theme:n.theme})}],value:Lc(t,n,(function(e){return Qe(e)&&e.textAlign}),n.currentItemTextAlign),onChange:function(e){return r(e)}})]})}}),Ys({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:Ac(e,t,(function(e){return fo(e,{strokeSharpness:n})})),appState:Tc(Tc({},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)(yc,{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:Lc(t,n,(function(e){return e.strokeSharpness}),yl(n.elementType)&&(nt(n.elementType)?n.currentItemLinearStrokeSharpness:n.currentItemStrokeSharpness)||null),onChange:function(e){return r(e)}})]})}}),Ys({name:"changeArrowhead",perform:function(e,t,n){return{elements:Ac(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:Tc(Tc({},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)(Ic,{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:Lc(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)(Ic,{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:Lc(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?Dc.MOON:Dc.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"})}),Dc={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"})})},zc=(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}),Hc=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 zc().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,zc(),n,o)},onPointerLeave:function(){return zc().classList.remove("excalidraw-tooltip--visible")},children:t})};n(196),n(1106);function Bc(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 Nc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bc(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Rc=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:Nc({"--padding":r},a),ref:t,children:n})})),Fc=(n(8328),function(e){var t=e.theme,n=void 0===t?d.C6.LIGHT:t,r=Vc(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)}),Vc=function(e){var t=g((0,c.useState)(null),2),n=t[0],r=t[1],o=Ah(),a=(0,c.useRef)(o);a.current=o;var i=_h().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},Uc=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=_h().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)(Fc,{className:Ye("Dialog",e.className),labelledBy:"dialog-title",maxWidth:e.small?550:800,onCloseRequest:s,theme:e.theme,children:(0,P.jsxs)(Rc,{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:Ah()?ms:hs})]}),(0,P.jsx)("div",{className:"Dialog__content",children:e.children})]})})},Gc=(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:Ah(),onClick:a,"data-testid":"clear-canvas-button"}),r&&(0,P.jsx)(Uc,{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 Wc(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 Kc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wc(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Ys({name:"changeViewBackgroundColor",perform:function(e,t,n){return{appState:Kc(Kc({},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)(Cc,{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"})})}}),Ys({name:"clearCanvas",perform:function(e,t,n,r){return r.imageCache.clear(),{elements:e.map((function(e){return fo(e,{isDeleted:!0})})),appState:Kc(Kc({},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)(Gc,{onConfirm:t})}}),Ys({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:Kc(Kc({},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)}}),Ys({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:Kc(Kc({},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)}}),Ys({name:"resetZoom",perform:function(e,t){return{appState:Kc(Kc({},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)(Hc,{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 Zc=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:Kc(Kc(Kc({},t),fl({scenePoint:{x:p,y:f},viewportDimensions:{width:t.width,height:t.height},zoom:l})),{},{zoom:l}),commitToHistory:!1}};Ys({name:"zoomToSelection",perform:function(e,t){return Zc(e,t,!0)},keyTest:function(e){return e.code===Gt&&e.shiftKey&&!e.altKey&&!e[un]}}),Ys({name:"zoomToFit",perform:function(e,t){return Zc(e,t,!1)},keyTest:function(e){return e.code===Ut&&e.shiftKey&&!e.altKey&&!e[un]}}),Ys({name:"toggleTheme",perform:function(e,t,n){return{appState:Kc(Kc({},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)(_c,{value:t.theme,onChange:function(e){n(e)}})})},keyTest:function(e){return e.altKey&&e.shiftKey&&e.code===Xt}});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){D(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 qc,$c,Qc,Jc=Ys({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:Xc(Xc({},t),{},{editingLinearElement:null}),commitToHistory:!0}}var p=e;t.pendingImageElement&&(p=p.filter((function(e){var n;return e.id!==(null===(n=t.pendingImageElement)||void 0===n?void 0:n.id)}))),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:Xc(Xc({},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?Xc(Xc({},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})}}),eu="undefined"!=typeof process&&null!==(qc=process.env)&&void 0!==qc&&qc.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!==($c=process.env)&&void 0!==$c&&$c.JEST_WORKER_ID,function(e,t,n,r){}),tu=(n(518),n(9966),function(e){var t=_h().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})]})}),nu=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()},ru=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 ou(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 au(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 au(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 au(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"}(Qc||(Qc={}));var iu=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]}(),lu=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()},su=function(e,t,n,r){e.beginPath(),e.arc(t,n,r,0,2*Math.PI),e.fill(),e.stroke()},cu=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()},uu=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;su(e,r[0],r[1],i/2/n.zoom.value)})),e.restore()},du=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&&cu(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 vu(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&&uu(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){hu(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 ru(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=ou(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 fu(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||pu(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,lu(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);pu(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=ru(te||Z,t),re=ne.background,oe=ne.stroke;x.save(),x.strokeStyle=oe,x.fillStyle=re;var ae=i.remotePointerUserStates[Z];(ee||ae===Qc.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===Qc.AWAY?le=iu?"⚫️":" (".concat(Qc.AWAY,")"):ae===Qc.IDLE?le=iu?"💤":" (".concat(Qc.IDLE,")"):ae===Qc.ACTIVE&&(le=iu?"🟢":"");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&&nu(x,e.x,e.y,e.width,e.height,3)})),x.restore()),x.restore(),{atLeastOneVisibleElement:O.length>0,scrollBars:j}},pu=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?su(e,a[0]+a[2]/2,a[1]+a[3]/2,a[2]/2):lu(e,a[0],a[1],a[2],a[3],a[0]+a[2]/2,a[1]+a[3]/2,r,!0),e.restore())}))},fu=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,lu(e,o-d,a-d,c+2*d,u+2*d,o+c/2,a+u/2,r);e.restore()},hu=function(e,t,n){var r=Array.isArray(n)?gu:mu;e.save(),e.translate(t.scrollX,t.scrollY),r(e,n),e.restore()},mu=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":lu(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)}},gu=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];su(e,o,a,i)}))},vu=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},bu=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 yu=(()=>{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 xu=yu?n.e(736).then(n.bind(n,6629)):n.e(736).then(n.bind(n,3112));yu?n.e(736).then(n.bind(n,5756)):n.e(736).then(n.bind(n,8396));const wu=yu?n.e(736).then(n.bind(n,4868)):n.e(736).then(n.bind(n,6882));var ku=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 xu).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))}}})},Su=function(e,t){return async function(...e){return(await wu).default(...e)}(e,{fileName:"".concat(t.name,".").concat(t.extension),description:t.description,extensions:[".".concat(t.extension)]},t.fileHandle)};function Eu(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 Cu(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 Cu(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 Cu(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 ju(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 Ou(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ju(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ju(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Mu={selection:!0,text:!0,rectangle:!0,diamond:!0,ellipse:!0,line:!0,image:!0,arrow:!0,freedraw:!0},Iu=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 Ou(Ou(Ou({},h),vo(h)),t)},Pu=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 Iu(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 Iu(e,{points:e.points,lastCommittedPoint:null,simulatePressure:e.simulatePressure,pressures:e.pressures});case"image":return Iu(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 Iu(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 Iu(e,{})}},Tu=function(e,t){var n=t?el(t):null;return(e||[]).reduce((function(e,t){if("selection"!==t.type&&!mo(t)){var r=Pu(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}),[])},Au=function(e,t){e=e||{};var n,r=sr(),o={},a=Eu(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 Ou(Ou({},o),{},{elementType:Mu[o.elementType]?o.elementType:"selection",zoom:"number"==typeof e.zoom?{value:e.zoom,translation:r.zoom.translation}:e.zoom||r.zoom})},Lu=function(e,t,n){return{elements:Tu(null==e?void 0:e.elements,n),appState:Au(null==e?void 0:e.appState,t||null),files:(null==e?void 0:e.files)||{}}};function _u(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 Du(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_u(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var zu=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)}}(),Hu=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=Hu(e);return"png"===t||"svg"===t},Nu=function(e){var t=(e||{}).type;return!!t&&d.jo.includes(t)},Ru=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,zu(t);case 2:if(o=e.sent,e.prev=3,a=JSON.parse(o),ed(a)){e.next=7;break}throw new Error(I("alerts.couldNotLoadInvalidFile"));case 7:return i=Lu({elements:il(a.elements||[]),appState:Du(Du({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)}}(),Fu=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,zu(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)}}(),Vu=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)}}(),Uu=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)}}(),Gu=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)}}(),Wu=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})},Ku=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,Nu(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)}}(),Zu=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 Yu(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 Xu(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 Xu(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 Xu(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 qu=function(e,t){var n,r={},o=Yu(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},$u=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?qu(e,n):void 0};return JSON.stringify(o,null,2)},Qu=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=$u(t,n,r,"local"),a=new Blob([o],{type:d.LO.excalidraw}),e.next=4,Su(a,{name:n.name,extension:"excalidraw",description:"Excalidraw file",fileHandle:Bu(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)}}(),Ju=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,ku({description:"Excalidraw files"});case 2:return r=e.sent,e.abrupt("return",Ru(r,t,n));case 4:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),ed=function(e){return(null==e?void 0:e.type)===d.r8.excalidraw&&(!e.elements||Array.isArray(e.elements)&&(!e.appState||"object"===L(e.appState)))},td=function(e){return"object"===L(e)&&e&&e.type===d.r8.excalidrawLibrary&&1===e.version},nd=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,Su(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)}}(),rd=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,ku({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 od(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 ad(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?od(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):od(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var id=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}))},ld=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=id(n.dataURL),a={image:r,mimeType:n.mimeType},o.set(t,a),e.next=8,r;case 8:l=e.sent,o.set(t,ad(ad({},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)}}(),sd=function(e){return e.filter((function(e){return qe(e)}))},cd=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)}}(),ud="\x3c!-- svg-source:excalidraw --\x3e",dd=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=fd(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,ld({imageCache:new Map,fileIds:sd(t).map((function(e){return e.fileId})),files:r});case 7:return E=e.sent,C=E.imageCache,du(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)}}(),pd=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:$u(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=fd(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(ud,"\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),bu(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)}}(),fd=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 hd(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 md(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 md(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 md(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 gd(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?gd(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var bd=32,yd=12,xd=256,wd="NOT_SPREADSHEET",kd="VALID_SPREADSHEET",Sd=function(e){var t=/^[$€£¥₩]?([0-9,]+(\.[0-9]+)?)$/.exec(e);return t?parseFloat(t[1].replace(/,/g,"")):null},Ed=function(e,t){return e.slice(1).every((function(e){return null!==Sd(e[t])}))},Cd=function(e){var t=e[0].length;if(t>2)return{type:wd,reason:"More than 2 columns"};if(1===t){if(!Ed(e,0))return{type:wd,reason:"Value is not numeric"};var n=null===Sd(e[0][0]),r=(n?e.slice(1):e).map((function(e){return Sd(e[0])}));return r.length<2?{type:wd,reason:"Less than two rows"}:{type:kd,spreadsheet:{title:n?e[0][0]:null,labels:null,values:r}}}var o=Ed(e,0)?0:1;if(!Ed(e,o))return{type:wd,reason:"Value is not numeric"};var a=(o+1)%2,i=null===Sd(e[0][o]),l=i?e.slice(1):e;return l.length<2?{type:wd,reason:"Less than 2 rows"}:{type:kd,spreadsheet:{title:i?e[0][o]:null,labels:l.map((function(e){return e[a]})),values:l.map((function(e){return Sd(e[o])}))}}},jd=At.elementBackground.slice(2,At.elementBackground.length),Od={fillStyle:"hachure",fontFamily:d.rk,fontSize:d.n5,opacity:100,roughness:1,strokeColor:At.elementStroke[0],strokeSharpness:"sharp",strokeStyle:"solid",strokeWidth:1,verticalAlign:"middle"},Md=function(e){return{chartWidth:44*e.values.length+yd,chartHeight:280}},Id=function(e,t,n,r,o,a){var i=Md(e),l=i.chartWidth,s=i.chartHeight,c=e.title?Ho(vd(vd({backgroundColor:o,groupIds:[r]},Od),{},{text:e.title,x:t+l/2,y:n-xd-24-d.n5,strokeSharpness:"sharp",strokeStyle:"solid",textAlign:"center"})):null,u=a?Do(vd(vd({backgroundColor:o,groupIds:[r]},Od),{},{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(vd(vd({groupIds:[r],backgroundColor:o},Od),{},{text:e.length>8?"".concat(e.slice(0,5),"..."):e,x:t+44*a+24,y:n+6,width:bd,angle:5.87,fontSize:16,textAlign:"center",verticalAlign:"top"}))})))||[]}(e,t,n,r,o)),_(function(e,t,n,r,o){var a=Ho(vd(vd({groupIds:[r],backgroundColor:o},Od),{},{x:t-yd,y:n-yd,text:"0",textAlign:"right"}));return[a,Ho(vd(vd({groupIds:[r],backgroundColor:o},Od),{},{x:t-yd,y:n-xd-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=Md(e),i=a.chartWidth,l=a.chartHeight;return[No(vd(vd({backgroundColor:o,groupIds:[r]},Od),{},{type:"line",x:t,y:n,startArrowhead:null,endArrowhead:null,width:i,points:[[0,0],[i,0]]})),No(vd(vd({backgroundColor:o,groupIds:[r]},Od),{},{type:"line",x:t,y:n,startArrowhead:null,endArrowhead:null,height:l,points:[[0,0],[0,-l]]})),No(vd(vd({backgroundColor:o,groupIds:[r]},Od),{},{type:"line",x:t,y:n-xd-yd,startArrowhead:null,endArrowhead:null,strokeStyle:"dotted",width:i,opacity:50,points:[[0,0],[i,0]]}))]}(e,t,n,r,o)))},Pd=function(e,t,n,r){return"line"===e?function(e,t,n){var r,o=Math.max.apply(Math,_(e.values)),a=so(),i=jd[Math.floor(Math.random()*jd.length)],l=0,s=[],c=hd(e.values);try{for(c.s();!(r=c.n()).done;){var u=r.value,p=44*l,f=-u/o*xd;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(vd(vd({backgroundColor:i,groupIds:[a]},Od),{},{type:"line",x:t+yd+16,y:n-yd,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*xd+6;return Do(vd(vd({backgroundColor:i,groupIds:[a]},Od),{},{fillStyle:"solid",strokeWidth:2,type:"ellipse",x:t+l+16,y:n+s-24,width:yd,height:yd}))})),x=e.values.map((function(e,r){var l=44*r+6,s=e/o*xd+6+yd;return No(vd(vd({backgroundColor:i,groupIds:[a]},Od),{},{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(_(Id(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=jd[Math.floor(Math.random()*jd.length)],i=e.values.map((function(e,i){var l=e/r*xd;return Do(vd(vd({backgroundColor:a,groupIds:[o]},Od),{},{type:"rectangle",x:t+44*i+yd,y:n-l-yd,width:bd,height:l}))}));return[].concat(_(i),_(Id(e,t,n,o,a,"production"===d.Vi.DEVELOPMENT)))}(t,n,r)},Td="",Ad=!1,Ld="clipboard"in navigator&&"readText"in navigator.clipboard,_d="clipboard"in navigator&&"writeText"in navigator.clipboard,Dd="clipboard"in navigator&&"write"in navigator.clipboard&&"ClipboardItem"in window&&"toBlob"in HTMLCanvasElement.prototype,zd=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),Td=i,e.prev=4,Ad=!1,e.next=8,Vd(i);case 8:e.next=14;break;case 10:e.prev=10,e.t0=e.catch(4),Ad=!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)}}(),Hd=function(){if(!Td)return{};try{return JSON.parse(Td)}catch(e){return console.error(e),{}}},Bd=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:wd,reason:"No values"};var n=t[0].length;if(!t.every((function(e){return e.length===n})))return{type:wd,reason:"All rows don't have same number of columns"};var r=Cd(t);if(r.type!==kd){var o=Cd(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===kd)return o}return r}(e);return t.type===kd?{spreadsheet:t.spreadsheet}:null},Nd=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=Ld,!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)}}(),Rd=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,Nd(t);case 2:if((n=e.sent)&&!n.includes(ud)){e.next=5;break}return e.abrupt("return",Hd());case 5:if(!(r=Bd(n))){e.next=8;break}return e.abrupt("return",r);case 8:if(o=Hd(),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",Ad&&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)}}(),Fd=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)}}(),Vd=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,!_d){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||Ud(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)}}(),Ud=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},Gd=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,pd(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,Su(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,Vd(m.outerHTML);case 16:return e.abrupt("return");case 17:return e.next=19,dd(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,Vu(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:$u(r,o,a,"local")});case 32:v=e.sent;case 33:return e.next=35,Su(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,Fd(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 Wd(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 Kd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wd(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Zd=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=Hu(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=Kd(Kd({},n),{},{exportEmbedScene:!0}),e.next=7,Gd(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)}}(),Yd=(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 Xd(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?Xd(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var $d=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:qd({"--gap":n,alignItems:r,justifyContent:o},i),children:t})},Qd=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})},Jd=(n(554),function(e){var t=e.fileName,n=e.onSave;return(0,P.jsxs)($d,{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 ep(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 tp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ep(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ep(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Ys({name:"changeProjectName",perform:function(e,t,n){return eu("change","title"),{appState:tp(tp({},t),{},{name:n}),commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData,r=e.appProps;return(0,P.jsx)(tu,{label:I("labels.fileTitle"),value:t.name||"Unnamed",onChange:function(e){return n(e)},isNameEditable:void 0===r.name&&!t.viewModeEnabled})}}),Ys({name:"changeExportScale",perform:function(e,t,n){return{appState:tp(tp({},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(fd(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)}))})}}),Ys({name:"changeExportBackground",perform:function(e,t,n){return{appState:tp(tp({},t),{},{exportBackground:n}),commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData;return(0,P.jsx)(Yd,{checked:t.exportBackground,onChange:function(e){return n(e)},children:I("labels.withBackground")})}}),Ys({name:"changeExportEmbedScene",perform:function(e,t,n){return{appState:tp(tp({},t),{},{exportEmbedScene:n}),commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData;return(0,P.jsxs)(Yd,{checked:t.exportEmbedScene,onChange:function(e){return n(e)},children:[I("labels.exportEmbedScene"),(0,P.jsx)(Hc,{label:I("labels.exportEmbedScene_details"),long:!0,children:(0,P.jsx)("div",{className:"excalidraw-tooltip-icon",children:es})})]})}}),Ys({name:"saveToActiveFile",perform:(np=(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,!Bu(n.fileHandle)){e.next=8;break}return e.next=5,Zd(t,n,o.files);case 5:e.t0=e.sent,e.next=11;break;case 8:return e.next=10,Qu(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:tp(tp({},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 np.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)(Jd,{onSave:function(){return n(null)},fileName:null===(t=r.fileHandle)||void 0===t?void 0:t.name})}});var np,rp,op,ap=Ys({name:"saveFileToDisk",perform:(rp=(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,Qu(t,tp(tp({},n),{},{fileHandle:null}),o.files);case 3:return a=e.sent,i=a.fileHandle,e.abrupt("return",{commitToHistory:!1,appState:tp(tp({},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 rp.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:Ah(),hidden:!yu,onClick:function(){return t(null)},"data-testid":"save-as-button"})}});Ys({name:"loadScene",perform:(op=(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,Ju(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:tp(tp({},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 op.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:Ah(),onClick:t,"data-testid":"load-button"})}}),Ys({name:"exportWithDarkMode",perform:function(e,t,n){return{appState:tp(tp({},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)(_c,{value:t.exportWithDarkMode?d.C6.DARK:d.C6.LIGHT,onChange:function(e){n(e===d.C6.DARK)},title:I("labels.toggleExportColorScheme")})})}});function ip(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?ip(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ip(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var sp="{}",cp=Ys({name:"copyStyles",perform:function(e,t){var n=e.find((function(e){return t.selectedElementIds[e.id]}));return n&&(sp=JSON.stringify(n)),{appState:lp(lp({},t),{},{toastMessage:I("toast.copyStyles")}),commitToHistory:!1}},contextItemLabel:"labels.copyStyles",keyTest:function(e){return e[un]&&e.altKey&&e.code===Yt}}),up=Ys({name:"pasteStyles",perform:function(e,t){var n,r=JSON.parse(sp);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}}),dp=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 pp(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 fp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pp(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Ys({name:"toggleCanvasMenu",perform:function(e,t){return{appState:fp(fp({},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})}}),Ys({name:"toggleEditMenu",perform:function(e,t){return{appState:fp(fp({},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})}}),Ys({name:"toggleFullScreen",perform:function(){return Yn()||document.documentElement.requestFullscreen(),Yn()&&document.exitFullscreen(),{commitToHistory:!1}},keyTest:function(e){return e.code===$t&&!e[un]}}),Ys({name:"toggleShortcuts",perform:function(e,t,n,r){var o=r.focusContainer;return t.showHelpDialog&&o(),{appState:fp(fp({},t),{},{showHelpDialog:!t.showHelpDialog}),commitToHistory:!1}},PanelComponent:function(e){var t=e.updateData;return(0,P.jsx)(dp,{title:I("helpDialog.title"),onClick:t})},keyTest:function(e){return e.key===hn}});function hp(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 mp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hp(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function gp(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 vp(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 vp(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 vp(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 bp=function(e,t){var n=dl(nl(e),t);return n.length>=2&&!function(e){if(e.length>=2){var t,n=gp(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)},yp=Ys({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,mp(mp({},t),{},{selectedGroupIds:{}}),nl(h)),elements:h,commitToHistory:!0}},contextItemLabel:"labels.group",contextItemPredicate:function(e,t){return bp(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:!bp(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)})}}),xp=Ys({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(mp(mp({},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)})}}),wp=(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 kp(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?kp(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Ys({name:"goToCollaborator",perform:function(e,t,n){var r=n;return r?{appState:Sp(Sp(Sp({},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=ru(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)(wp,{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 Ep=Ys({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 Cp(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 jp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Cp(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Op=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())},Mp=function(e,t,n){var r=n.axis,o=n.position,a=Ip(e),i=g("x"===r?["minX","maxX"]:["minY","maxY"],2),l=i[0],s=i[1],c={x:0,y:0};return jp(jp({},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))},Ip=function(e){var t=g(Ot(e),4);return{minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}},Pp=function(e,t){return dl(nl(e),t).length>1},Tp=function(e,t,n){var r=function(e,t){var n=Op(e),r=Ip(e);return n.flatMap((function(e){var n=Mp(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}))};Ys({name:"alignTop",perform:function(e,t){return{appState:t,elements:Tp(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:!Pp(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)})}}),Ys({name:"alignBottom",perform:function(e,t){return{appState:t,elements:Tp(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:!Pp(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)})}}),Ys({name:"alignLeft",perform:function(e,t){return{appState:t,elements:Tp(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:!Pp(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)})}}),Ys({name:"alignRight",perform:function(e,t){return{appState:t,elements:Tp(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:!Pp(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)})}}),Ys({name:"alignVerticallyCentered",perform:function(e,t){return{appState:t,elements:Tp(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:!Pp(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)})}}),Ys({name:"alignHorizontallyCentered",perform:function(e,t){return{appState:t,elements:Tp(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:!Pp(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 Ap(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 Lp(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 Lp(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 Lp(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 _p=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())},Dp=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}},zp=function(e,t){return dl(nl(e),t).length>1},Hp=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=Dp(e),c=_p(e).map((function(e){return[e,Dp(e)]})).sort((function(e,t){return e[1][a]-t[1][a]})),u=0,d=Ap(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}))},Bp=(Ys({name:"distributeHorizontally",perform:function(e,t){return{appState:t,elements:Hp(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:!zp(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)})}}),Ys({name:"distributeVertically",perform:function(e,t){return{appState:t,elements:Hp(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:!zp(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)})}}),Ys({name:"flipHorizontal",perform:function(e,t){return{elements:Rp(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)}})),Np=Ys({name:"flipVertical",perform:function(e,t){return{elements:Rp(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)}}),Rp=function(e,t,n){var r=dl(nl(e),t);if(r.length>1)return e;var o=Fp(r,t,n),a=el(o);return e.map((function(e){return a[e.id]||e}))},Fp=function(e,t,n){return e.forEach((function(e){Vp(e,t),"vertical"===n&&Up(e,Math.PI)})),e},Vp=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})},Up=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 Gp(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 Wp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gp(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Kp=Ys({name:"copy",perform:function(e,t,n,r){return zd(nl(e),t,r.files),{commitToHistory:!1}},contextItemLabel:"labels.copy",keyTest:void 0}),Zp=Ys({name:"cut",perform:function(e,t,n,r){return Kp.perform(e,t,n,r),Qs.perform(e,t,n,r)},contextItemLabel:"labels.cut",keyTest:function(e){return e[un]&&e.code===en}}),Yp=Ys({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,Gd("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:Wp(Wp({},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"}),Xp=Ys({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,Gd("clipboard",a.length?a:nl(t),n,o.files,n);case 6:return e.abrupt("return",{appState:Wp(Wp({},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:Wp(Wp({},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 qp(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 $p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qp(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Qp=Ys({name:"gridMode",perform:function(e,t){return eu("view","mode","grid"),{appState:$p($p({},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 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 ef(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 tf=Ys({name:"zenMode",perform:function(e,t){return eu("view","mode","zen"),{appState:ef(ef({},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 nf(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 rf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nf(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var of=Ys({name:"stats",perform:function(e,t){return{appState:rf(rf({},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 af(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?af(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):af(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var sf=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:lf(lf({},t),o.appState),commitToHistory:r,syncHistory:!0}}return{commitToHistory:r}},cf=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}(),uf=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(Tu(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,Fu(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}(),df=function(e){var t=Array.from(e.values());return{x:ff(t,(function(e){return e.x}))/t.length,y:ff(t,(function(e){return e.y}))/t.length}},pf=function(e){var t=g(e,2),n=t[0],r=t[1];return Math.hypot(n.x-r.x,n.y-r.y)},ff=function(e,t){return e.reduce((function(e,n){return e+t(n)}),0)};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}function mf(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){D(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}var gf=function(e){return{selectedElementIds:e.selectedElementIds,selectedGroupIds:e.selectedGroupIds,viewBackgroundColor:e.viewBackgroundColor,editingLinearElement:e.editingLinearElement,editingGroupId:e.editingGroupId,name:e.name}},vf=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:gf(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(mf(mf({},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}(),bf=[{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}],yf=(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")]}),xf=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)(xc,{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=yf[o],l&&l.length>0?l[0]:""):""})]})},t)}))})})},wf=new WeakMap,kf=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)(xf,{top:e.top,left:e.left,options:r,onCloseRequest:function(){return t=e.container,void((n=wf.get(t))&&((0,Lt.unmountComponentAtNode)(n),n.remove(),wf.delete(t)));var t,n},actionManager:e.actionManager,appState:e.appState}),(t=e.container,(n=wf.get(t))||(n=document.createElement("div"),t.querySelector(".excalidraw-contextMenuContainer").appendChild(n),wf.set(t,n),n)))};function Sf(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 Ef(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 Ef(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 Ef(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 Cf=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=Ah(),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=Sf(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")]})]})]})},jf=function(e){var t=e.canvas,n=e.elementType,r=e.setAppState,o=e.onImageAction;return(0,P.jsx)(P.Fragment,{children:bf.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)}))})},Of=function(e){var t=e.renderAction;e.zoom;return(0,P.jsx)(Qd,{gap:1,children:(0,P.jsxs)($d,{gap:1,align:"center",children:[t("zoomOut"),t("zoomIn"),t("resetZoom")]})})},Mf=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")]})},If=(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:Ah()})})}),Pf=function(e){var t=e.message,n=e.onClose,r=g((0,c.useState)(!!t),2),o=r[0],a=r[1],i=_h().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)(Uc,{small:!0,onCloseRequest:l,title:I("errorDialog.title"),children:(0,P.jsx)("div",{style:{whiteSpace:"pre-wrap"},children:t})})})},Tf=(n(2205),"filter"in document.createElement("canvas").getContext("2d")),Af=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"),")"]})]})},Lf=function(e,t){(0,Lt.unmountComponentAtNode)(t),t.innerHTML="",e instanceof HTMLCanvasElement?t.appendChild(e):(0,Lt.render)((0,P.jsx)(Af,{}),t)},_f=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})},Df=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&&dd(x,n,r,{exportBackground:b,viewBackgroundColor:y,exportPadding:a}).then((function(t){return Vu(t).then((function(){Lf(t,e)}))})).catch((function(t){console.error(t),Lf(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}),Tf&&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)(Yd,{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)($d,{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:!yu&&i.renderAction("changeProjectName")}),(0,P.jsxs)($d,{gap:2,justifyContent:"center",style:{margin:"2em 0"},children:[(0,P.jsx)(_f,{color:"indigo",title:I("buttons.exportToPng"),"aria-label":I("buttons.exportToPng"),onClick:function(){return l(x)},children:"PNG"}),(0,P.jsx)(_f,{color:"red",title:I("buttons.exportToSvg"),"aria-label":I("buttons.exportToSvg"),onClick:function(){return s(x)},children:"SVG"}),Dd&&(0,P.jsx)(_f,{title:I("buttons.copyPngToClipboard"),onClick:function(){return u(x)},color:"gray",shade:7,children:Vl})]})]})},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,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:Ah(),title:I("buttons.exportImage")}),h&&(0,P.jsx)(Uc,{onCloseRequest:v,title:I("buttons.exportImage"),children:(0,P.jsx)(Df,{elements:t,appState:n,files:r,exportPadding:a,actionManager:i,onExportToPng:l,onExportToSvg:s,onExportToClipboard:p,onCloseRequest:v})})]})},Hf=(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})}),Bf=(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}),Nf=(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"})})),Rf=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(){(0,f.Z)(b().mark((function e(){var o,a;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=t||r){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,pd(o,{exportBackground:!1,viewBackgroundColor:Pt.white},n);case 5:a=e.sent,i.current&&(i.current.innerHTML=a.outerHTML);case 7:case"end":return e.stop()}}),e)})))()}),[t,r,n]);var l=g((0,c.useState)(!1),2),s=l[0],u=l[1],p=Ah(),h=(s||p)&&r&&(0,P.jsx)("div",{className:"library-unit__adder",children:Nf});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})]})},Ff={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"})})},Vf=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?Ff.CHECKED:Ff.UNCHECKED})]})},Uf=["heading","children"];function Gf(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 Wf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gf(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Kf=function(e){var t=e.heading,n=e.children,r=bo(e,Uf),o=_h().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",Wf(Wf({},r),{},{"aria-labelledby":"".concat(o,"-").concat(t,"-title"),children:"function"==typeof n?n(a):(0,P.jsxs)(P.Fragment,{children:[a,n]})}))},Zf=(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)(Hc,{label:o.username||"Unknown user",children:i.renderAction("goToCollaborator",{id:r})},r)}))})}))),Yf=(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"})}),Xf=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:Yf})]})};function qf(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 $f=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.UIOptions,v=e.onImageAction,b=e.renderTopRightUI;return(0,P.jsxs)(P.Fragment,{children:[!h&&(0,P.jsxs)(Hf,{side:"top",className:"App-top-bar",children:[(0,P.jsx)(Kf,{heading:"shapes",children:function(e){return(0,P.jsxs)(Qd,{gap:4,align:"center",children:[(0,P.jsxs)($d,{gap:1,children:[(0,P.jsxs)(Rc,{padding:1,children:[e,(0,P.jsx)($d,{gap:1,children:(0,P.jsx)(jf,{canvas:d,elementType:n.elementType,setAppState:s,onImageAction:function(e){var t=e.pointerType;v({insertOnCanvasDirectly:"mouse"!==t})}})})]}),b&&b(!0,n),(0,P.jsx)(Al,{type:"button",className:"HomeButton ToolIcon_type_floating",title:"Home","aria-label":"Home",icon:Ks,onClick:t},"home"),(0,P.jsx)(Vf,{checked:n.elementLocked,onChange:u,title:I("toolBar.lock")}),(0,P.jsx)(Xf,{appState:n,setAppState:s})]}),o]})}}),(0,P.jsx)(Bf,{appState:n,elements:r})]}),(0,P.jsx)("div",{className:"App-bottom-bar",style:{marginBottom:14,marginLeft:14,marginRight:14},children:(0,P.jsxs)(Rc,{padding:0,children:[g.canvasActions&&"canvas"===n.openMenu?(0,P.jsx)(Kf,{className:"App-mobile-menu",heading:"canvasActions",children:(0,P.jsx)("div",{className:"panelColumn",children:(0,P.jsxs)(Qd,{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)(If,{isCollaborating:p,collaboratorCount:n.collaborators.size,onClick:c}),(0,P.jsx)(Mf,{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)(Zf,{mobile:!0,layout:"horizontal",collaborators:n.collaborators,actionManager:a})]})]})})}):"shape"===n.openMenu&&!h&&$i(n,r)?(0,P.jsx)(Kf,{className:"App-mobile-menu",heading:"selectedShapeActions",children:(0,P.jsx)(Cf,{appState:n,elements:r,renderAction:a.renderAction,elementType:n.elementType})}):null,(0,P.jsxs)("footer",{className:"App-toolbar",children:[h?g.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:[g.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?qf(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},hl(r,n)))},children:I("buttons.scrollBackToContent")})]})]})})]})},Qf=(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=Pd(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,pd(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})})}),Jf=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),eu("magic","chart",e),t({currentChartType:e,pasteDialog:{shown:!1,data:null}})};return(0,P.jsx)(Uc,{small:!0,onCloseRequest:a,title:I("labels.pasteCharts"),className:"PasteChartDialog",autofocus:!1,children:(0,P.jsxs)("div",{className:"container",children:[(0,P.jsx)(Qf,{chartType:"bar",spreadsheet:n.pasteDialog.data,selected:"bar"===n.currentChartType,onClick:i}),(0,P.jsx)(Qf,{chartType:"line",spreadsheet:n.pasteDialog.data,selected:"line"===n.currentChartType,onClick:i})]})})};n(3922);function eh(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(){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")})]})},nh=function(e){return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("h3",{children:e.title}),e.children]})},rh=function(e){return(0,P.jsx)("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"space-between"},children:e.children})},oh=function(e){return(0,P.jsx)("div",{style:{width:"49%"},children:e.children})},ah=function(e){return(0,P.jsxs)("div",{className:"HelpDialog--island",children:[(0,P.jsx)("h3",{className:"HelpDialog--island-title",children:e.caption}),e.children]})},ih=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)(lh,{children:t}),e.isOr&&n!==e.shortcuts.length-1&&I("helpDialog.or")]},n)}))})]})})};ih.defaultProps={isOr:!0};var lh=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?eh(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({className:"HelpDialog--key"},e))},sh=function(e){var t=e.onClose,n=u().useCallback((function(){t&&t()}),[t]);return(0,P.jsx)(P.Fragment,{children:(0,P.jsxs)(Uc,{onCloseRequest:n,title:I("helpDialog.title"),className:"HelpDialog",children:[(0,P.jsx)(th,{}),(0,P.jsx)(nh,{title:I("helpDialog.shortcuts"),children:(0,P.jsxs)(rh,{children:[(0,P.jsxs)(oh,{children:[(0,P.jsxs)(ah,{caption:I("helpDialog.shapes"),children:[(0,P.jsx)(ih,{label:I("toolBar.selection"),shortcuts:["V","1"]}),(0,P.jsx)(ih,{label:I("toolBar.rectangle"),shortcuts:["R","2"]}),(0,P.jsx)(ih,{label:I("toolBar.diamond"),shortcuts:["D","3"]}),(0,P.jsx)(ih,{label:I("toolBar.ellipse"),shortcuts:["E","4"]}),(0,P.jsx)(ih,{label:I("toolBar.arrow"),shortcuts:["A","5"]}),(0,P.jsx)(ih,{label:I("toolBar.line"),shortcuts:["P","6"]}),(0,P.jsx)(ih,{label:I("toolBar.freedraw"),shortcuts:["Shift+P","7"]}),(0,P.jsx)(ih,{label:I("toolBar.text"),shortcuts:["T","8"]}),(0,P.jsx)(ih,{label:I("toolBar.image"),shortcuts:["9"]}),(0,P.jsx)(ih,{label:I("toolBar.library"),shortcuts:["0"]}),(0,P.jsx)(ih,{label:I("helpDialog.editSelectedShape"),shortcuts:[Xn("Enter"),I("helpDialog.doubleClick")]}),(0,P.jsx)(ih,{label:I("helpDialog.textNewLine"),shortcuts:[Xn("Enter"),Xn("Shift+Enter")]}),(0,P.jsx)(ih,{label:I("helpDialog.textFinish"),shortcuts:[Xn("Esc"),Xn("CtrlOrCmd+Enter")]}),(0,P.jsx)(ih,{label:I("helpDialog.curvedArrow"),shortcuts:["A",I("helpDialog.click"),I("helpDialog.click"),I("helpDialog.click")],isOr:!1}),(0,P.jsx)(ih,{label:I("helpDialog.curvedLine"),shortcuts:["L",I("helpDialog.click"),I("helpDialog.click"),I("helpDialog.click")],isOr:!1}),(0,P.jsx)(ih,{label:I("toolBar.lock"),shortcuts:["Q"]}),(0,P.jsx)(ih,{label:I("helpDialog.preventBinding"),shortcuts:[Xn("CtrlOrCmd")]})]}),(0,P.jsxs)(ah,{caption:I("helpDialog.view"),children:[(0,P.jsx)(ih,{label:I("buttons.zoomIn"),shortcuts:[Xn("CtrlOrCmd++")]}),(0,P.jsx)(ih,{label:I("buttons.zoomOut"),shortcuts:[Xn("CtrlOrCmd+-")]}),(0,P.jsx)(ih,{label:I("buttons.resetZoom"),shortcuts:[Xn("CtrlOrCmd+0")]}),(0,P.jsx)(ih,{label:I("helpDialog.zoomToFit"),shortcuts:["Shift+1"]}),(0,P.jsx)(ih,{label:I("helpDialog.zoomToSelection"),shortcuts:["Shift+2"]}),(0,P.jsx)(ih,{label:I("buttons.fullScreen"),shortcuts:["F"]}),(0,P.jsx)(ih,{label:I("buttons.zenMode"),shortcuts:[Xn("Alt+Z")]}),(0,P.jsx)(ih,{label:I("labels.showGrid"),shortcuts:[Xn("CtrlOrCmd+'")]}),(0,P.jsx)(ih,{label:I("labels.viewMode"),shortcuts:[Xn("Alt+R")]}),(0,P.jsx)(ih,{label:I("labels.toggleTheme"),shortcuts:[Xn("Alt+Shift+D")]}),(0,P.jsx)(ih,{label:I("stats.title"),shortcuts:[Xn("Alt+/")]})]})]}),(0,P.jsx)(oh,{children:(0,P.jsxs)(ah,{caption:I("helpDialog.editor"),children:[(0,P.jsx)(ih,{label:I("labels.selectAll"),shortcuts:[Xn("CtrlOrCmd+A")]}),(0,P.jsx)(ih,{label:I("labels.multiSelect"),shortcuts:[Xn("Shift+".concat(I("helpDialog.click")))]}),(0,P.jsx)(ih,{label:I("labels.moveCanvas"),shortcuts:[Xn("Space+".concat(I("helpDialog.drag"))),Xn("Wheel+".concat(I("helpDialog.drag")))],isOr:!0}),(0,P.jsx)(ih,{label:I("labels.cut"),shortcuts:[Xn("CtrlOrCmd+X")]}),(0,P.jsx)(ih,{label:I("labels.copy"),shortcuts:[Xn("CtrlOrCmd+C")]}),(0,P.jsx)(ih,{label:I("labels.paste"),shortcuts:[Xn("CtrlOrCmd+V")]}),(0,P.jsx)(ih,{label:I("labels.copyAsPng"),shortcuts:[Xn("Shift+Alt+C")]}),(0,P.jsx)(ih,{label:I("labels.copyStyles"),shortcuts:[Xn("CtrlOrCmd+Alt+C")]}),(0,P.jsx)(ih,{label:I("labels.pasteStyles"),shortcuts:[Xn("CtrlOrCmd+Alt+V")]}),(0,P.jsx)(ih,{label:I("labels.delete"),shortcuts:[Xn("Del")]}),(0,P.jsx)(ih,{label:I("labels.sendToBack"),shortcuts:[Xn(_t?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")]}),(0,P.jsx)(ih,{label:I("labels.bringToFront"),shortcuts:[Xn(_t?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")]}),(0,P.jsx)(ih,{label:I("labels.sendBackward"),shortcuts:[Xn("CtrlOrCmd+[")]}),(0,P.jsx)(ih,{label:I("labels.bringForward"),shortcuts:[Xn("CtrlOrCmd+]")]}),(0,P.jsx)(ih,{label:I("labels.alignTop"),shortcuts:[Xn("CtrlOrCmd+Shift+Up")]}),(0,P.jsx)(ih,{label:I("labels.alignBottom"),shortcuts:[Xn("CtrlOrCmd+Shift+Down")]}),(0,P.jsx)(ih,{label:I("labels.alignLeft"),shortcuts:[Xn("CtrlOrCmd+Shift+Left")]}),(0,P.jsx)(ih,{label:I("labels.alignRight"),shortcuts:[Xn("CtrlOrCmd+Shift+Right")]}),(0,P.jsx)(ih,{label:I("labels.duplicateSelection"),shortcuts:[Xn("CtrlOrCmd+D"),Xn("Alt+".concat(I("helpDialog.drag")))]}),(0,P.jsx)(ih,{label:I("buttons.undo"),shortcuts:[Xn("CtrlOrCmd+Z")]}),(0,P.jsx)(ih,{label:I("buttons.redo"),shortcuts:Dt?[Xn("CtrlOrCmd+Y"),Xn("CtrlOrCmd+Shift+Z")]:[Xn("CtrlOrCmd+Shift+Z")]}),(0,P.jsx)(ih,{label:I("labels.group"),shortcuts:[Xn("CtrlOrCmd+G")]}),(0,P.jsx)(ih,{label:I("labels.ungroup"),shortcuts:[Xn("CtrlOrCmd+Shift+G")]}),(0,P.jsx)(ih,{label:I("labels.flipHorizontal"),shortcuts:[Xn("Shift+H")]}),(0,P.jsx)(ih,{label:I("labels.flipVertical"),shortcuts:[Xn("Shift+V")]}),(0,P.jsx)(ih,{label:I("labels.showStroke"),shortcuts:[Xn("S")]}),(0,P.jsx)(ih,{label:I("labels.showBackground"),shortcuts:[Xn("G")]})]})})]})})]})})},ch=(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})}),uh=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)(ch,{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"),!yu&&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(ap)}})]}),l&&(0,P.jsxs)(ch,{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)]})})},dh=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(ap):d(!0)},"data-testid":"json-export-button",icon:Zl,type:"button","aria-label":I("buttons.export"),showAriaLabel:Ah(),title:I("buttons.export")}),s&&a&&"function"!=typeof a&&(0,P.jsx)(Uc,{onCloseRequest:p,title:I("buttons.export"),children:(0,P.jsx)(uh,{elements:t,appState:n,files:r,actionManager:o,onCloseRequest:p,exportOpts:a,canvas:i})})]})},ph=["suggestedBindings","startBoundElement"];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}var hh=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=Ah(),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(){rd(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(){nd(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)(Qd,{children:(0,P.jsx)(Rf,{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)($d,{align:"center",gap:1,children:S},w))}return(0,P.jsx)(Qd,{align:"start",gap:1,className:"layer-ui__library-items",children:b})},mh=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)(Rc,{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)(hh,{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})})},gh=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=Ah(),_=function(){return C.canvasActions&&C.canvasActions.export?(0,P.jsx)(dh,{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,Gd(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&&Bu(r)&&i({fileHandle:r});case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()};return(0,P.jsx)(zf,{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)(mh,{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)(Pf,{message:o.errorMessage,onClose:function(){return i({errorMessage:null})}}),o.showHelpDialog&&(0,P.jsx)(sh,{onClose:function(){i({showHelpDialog:!1})}}),o.pasteDialog.shown&&(0,P.jsx)(Jf,{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)($f,{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,UIOptions:C,onImageAction:A,renderTopRightUI:w})]}):(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)(Hf,{side:"top",children:(0,P.jsxs)("div",{className:"App-menu App-menu_top",children:[(0,P.jsxs)(Qd,{gap:4,className:Ye({"disable-pointerEvents":m}),children:[C.canvasActions&&(S?(0,P.jsx)(Kf,{heading:"canvasActions",className:Ye("zen-mode-transition",{"transition-left":m}),children:(0,P.jsx)(Rc,{padding:2,style:{zIndex:1},children:(0,P.jsx)(Qd,{gap:4,children:(0,P.jsxs)($d,{gap:1,justifyContent:"space-between",children:[_(),z()]})})})}):(0,P.jsx)(Kf,{heading:"canvasActions",className:Ye("zen-mode-transition",{"transition-left":m}),children:(0,P.jsx)(Rc,{padding:2,style:{zIndex:1},children:(0,P.jsxs)(Qd,{gap:4,children:[(0,P.jsxs)($d,{gap:3,justifyContent:"space-between",children:[r.renderAction("clearCanvas"),r.renderAction("loadScene"),_(),z(),u&&(0,P.jsx)(If,{isCollaborating:x,collaboratorCount:o.collaborators.size,onClick:u})]}),(0,P.jsx)(Mf,{actionManager:r,appState:o,setAppState:i,showThemeBtn:v}),o.fileHandle&&(0,P.jsx)(P.Fragment,{children:r.renderAction("saveToActiveFile")})]})})})),t&&(0,P.jsx)(Kf,{heading:"selectedShapeActions",className:Ye("zen-mode-transition",{"transition-left":m}),children:(0,P.jsx)(Rc,{className:d.$C.SHAPE_ACTIONS_MENU,padding:2,style:{maxHeight:"".concat(o.height-(o.fileHandle?248:200),"px")},children:(0,P.jsx)(Cf,{appState:o,elements:s,renderAction:r.renderAction,elementType:o.elementType})})})]}),!S&&(0,P.jsx)(Kf,{heading:"shapes",children:function(e){return(0,P.jsxs)(Qd,{gap:4,align:"start",children:[(0,P.jsxs)($d,{gap:1,children:[(0,P.jsx)(Vf,{zenModeEnabled:m,checked:o.elementLocked,onChange:p,title:I("toolBar.lock")}),(0,P.jsxs)(Rc,{padding:1,className:Ye({"zen-mode":m}),children:[(0,P.jsx)(Bf,{appState:o,elements:s}),e,(0,P.jsx)($d,{gap:1,children:(0,P.jsx)(jf,{canvas:l,elementType:o.elementType,setAppState:i,onImageAction:function(e){var t=e.pointerType;A({insertOnCanvasDirectly:"mouse"!==t})}})})]}),(0,P.jsx)(Xf,{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)(Zf,{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)(Qd,{gap:2,children:(0,P.jsxs)(Kf,{heading:"canvasActions",children:[(0,P.jsx)(Rc,{padding:1,children:(0,P.jsx)(Of,{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?fh(Object(n),!0).forEach((function(t){D(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}({},hl(s,o)))},children:I("buttons.scrollBackToContent")})]})},vh=function(e,t){var n=function(e){e.suggestedBindings,e.startBoundElement;return bo(e,ph)},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]}))},bh=u().memo(gh,vh),yh=(n(1528),function(e){var t,n=Ah(),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)(Rc,{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)]})})]})})}),xh=(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 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){D(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 Sh=Ys({name:"viewMode",perform:function(e,t){return eu("view","mode","view"),{appState:kh(kh({},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}}),Eh=n(200),Ch=n.n(Eh);function jh(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 Oh(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 Oh(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 Oh(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 Mh(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 Ih(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mh(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ph(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 Th=u().createContext(!1),Ah=function(){return(0,c.useContext)(Th)},Lh=u().createContext({container:null,id:null}),_h=function(){return(0,c.useContext)(Lh)},Dh=!1,zh=0,Hh=0,Bh=0,Nh=!1,Rh=!1,Fh=!1,Vh={horizontal:null,vertical:null},Uh=0,Gh=!1,Wh=null,Kh={pointers:new Map,lastCenter:null,initialDistance:null,initialScale:null},Zh=function(e){F(o,e);var t,n,r=Ph(o);function o(e){var t;z(this,o),t=r.call(this,e),Yh.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=Ih(Ih(Ih({},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 uf(N(t)),t.history=new vf,t.actionManager=new cf(t.syncActionResult,(function(){return t.state}),(function(){return t.scene.getElementsIncludingDeleted()}),N(t)),t.actionManager.registerAll(Zs),t.actionManager.registerAction((l=t.history,{name:"undo",perform:function(e,t){return sf(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 sf(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)(Lh.Provider,{value:this.excalidrawContainerValue,children:(0,P.jsxs)(Th.Provider,{value:this.isMobile,children:[(0,P.jsx)(bh,{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)(yh,{appState:this.state,setAppState:this.setAppState,elements:this.scene.getElements(),onClose:this.toggleStats,renderCustomStats:u}),null!==this.state.toastMessage&&(0,P.jsx)(xh,{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.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 vf,this.actionManager=new cf(this.syncActionResult,(function(){return t.state}),(function(){return t.scene.getElementsIncludingDeleted()}),this),this.library=new uf(this),this.canvas=null,this.rc=null,this.excalidrawContainerRef.current=void 0,this.nearestScrollableContainer=void 0,this.excalidrawContainerValue={container:null,id:"unmounted"},clearTimeout(Uh),Uh=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(Jc)}));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=du(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&&(Vh=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:Hh,clientY:Bh},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;Nh||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:Ih(Ih({},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!==Wh&&Wh(e)}},{key:"updateGestureOnPointerDown",value:function(e){Kh.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),2===Kh.pointers.size&&(Kh.lastCenter=df(Kh.pointers),Kh.initialScale=this.state.zoom.value,Kh.initialDistance=pf(Array.from(Kh.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(Vh,e.clientX-this.state.offsetLeft,e.clientY-this.state.offsetTop),lastCoords:Ih({},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;Fh=!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(){Fh=!1,Zn(n.canvas,n.state.elementType),Wh=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 Wh=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=jh(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(Ih(Ih({},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(Ih(Ih({},n),{},{selectedElementIds:Ih(Ih(Ih({},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(Wh=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(Jc)}if($e(o)){var b=o;try{t.initializeImageDimensions(b),t.setState({selectedElementIds:D({},b.id,!0)},(function(){t.actionManager.executeAction(Jc)}))}catch(e){console.error(e),t.scene.replaceAllElements(t.scene.getElementsIncludingDeleted().filter((function(e){return e.id!==b.id}))),t.actionManager.executeAction(Jc)}}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:Ih(Ih({},e.selectedElementIds),{},D({},t.state.draggingElement.id,!0))}})):(Wn(t.canvas),t.setState((function(e){return{draggingElement:null,elementType:"selection",selectedElementIds:Ih(Ih({},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 Ih(Ih({},e),t)}),{});t.setState((function(e){return{selectedGroupIds:Ih(Ih({},e.selectedElementIds),x.groupIds.map((function(e){return D({},e,!1)})).reduce((function(e,t){return Ih(Ih({},e),t)}),{})),selectedElementIds:Ih(Ih({},e.selectedElementIds),w)}}))}else t.setState((function(e){return Oo(Ih(Ih({},e),{},{selectedElementIds:Ih(Ih({},e.selectedElementIds),{},D({},x.id,!1))}),t.scene.getElements())}));else t.setState((function(e){return{selectedElementIds:Ih(Ih({},e.selectedElementIds),{},D({},x.id,!0))}}));else t.setState((function(e){return Ih({},Oo(Ih(Ih({},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:Ih(Ih({},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(){Dh=!1}}]),o}(u().Component);Zh.defaultProps={UIOptions:d.cW};var Yh=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:Ih(Ih({},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(){Nh=!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),td(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 Ih(Ih({},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,Ru(o,e.state,e.scene.getElementsIncludingDeleted()).then((function(t){e.syncActionResult(Ih(Ih({},t),{},{appState:Ih(Ih({},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=Lu(a,null,null)).appState=Ih(Ih({},l.appState),{},{elementType:"image"===l.appState.elementType?"selection":l.appState.elementType,isLoading:!1}),null!==(n=a)&&void 0!==n&&n.scrollToContent&&(l.appState=Ih(Ih({},l.appState),hl(l.elements,Ih(Ih({},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(Ih(Ih({},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(Qs)},this.copyAll=function(){zd(e.scene.getElements(),e.state,e.files)},this.onTapStart=function(t){if(!Dh)return Dh=!0,clearTimeout(zh),void(zh=window.setTimeout(Zh.resetTapTwice,d.Gj));if(Dh&&1===t.touches.length){var n=g(t.touches,1)[0];e.handleCanvasDoubleClick({clientX:n.clientX,clientY:n.clientY}),Dh=!1,clearTimeout(zh)}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(Hh,Bh),!n||i instanceof HTMLCanvasElement&&!Nn(a)){t.next=7;break}return t.abrupt("return");case 7:return t.next=9,Rd(n);case 9:if(l=t.sent,!(s=null==n||null===(o=n.clipboardData)||void 0===o?void 0:o.files[0])&&l.text&&(c=l.text.trim()).startsWith("<svg")&&c.endsWith("</svg>")&&(s=Zu(c)),!Nu(s)){t.next=19;break}return u=qn({clientX:Hh,clientY:Bh},e.state),d=u.x,p=u.y,f=e.createImageElement({sceneX:d,sceneY:p}),e.insertImageElement(f,s),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(l,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: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==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=Tu(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?Hh:e.state.width/2+e.state.offsetLeft,d="object"===L(t.position)?t.position.clientY:"cursor"===t.position?Bh: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=Ih(Ih({},e.files),t.files)),e.scene.replaceAllElements(k),e.history.resumeRecording(),e.setState(Oo(Ih(Ih({},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&&Uh&&(clearTimeout(Uh),Uh=0,Gh=!1),Kh.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(tf)},this.toggleStats=function(){e.state.showStats||eu("dialog","stats"),e.actionManager.executeAction(of)},this.scrollToContent=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.scene.getElements();e.setState(Ih({},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=Ih(Ih({},e.files),Object.fromEntries(n)),e.addNewImagesToImageCache(),e.scene.getElements().forEach((function(e){qe(e)&&n.has(e.fileId)&&ho(e)})),e.scene.informMutation()})),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){Hh=e.clientX,Bh=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=bf.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===Kh.pointers.size&&(Nh=!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})),Nh=!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:{}}),Kh.initialScale=e.state.zoom.value})),this.onGestureChange=or((function(t){if(t.preventDefault(),2!==Kh.pointers.size){var n=Kh.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:Hh,y:Bh})}}))}})),this.onGestureEnd=or((function(t){t.preventDefault(),e.setState({previousSelectedElementIds:{},selectedElementIds:e.state.previousSelectedElementIds}),Kh.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(Ih(Ih({},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),Kh.pointers.has(t.pointerId)&&Kh.pointers.set(t.pointerId,{x:t.clientX,y:t.clientY});var n=Kh.initialScale;if(2===Kh.pointers.size&&Kh.lastCenter&&n&&Kh.initialDistance){var r=df(Kh.pointers),o=r.x-Kh.lastCenter.x,a=r.y-Kh.lastCenter.y;Kh.lastCenter=r;var i=pf(Array.from(Kh.pointers.values()))/Kh.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 Kh.lastCenter=Kh.initialDistance=Kh.initialScale=null;if(!(Nh||Rh||Fh)){var l=cl(Vh,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){Gh=!0},this.handleCanvasPointerDown=function(t){var n=document.getSelection();if(null!=n&&n.anchorNode&&n.removeAllRanges(),e.maybeOpenContextMenuAfterPointerDownOnTouchDevices(t),e.maybeCleanupAfterMissingPointerUp(t),!Rh&&(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),Kh.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);Wh=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&&(Gh=!1,Uh?Gh=!0:Uh=window.setTimeout((function(){Uh=0,Gh||e.handleCanvasContextMenu(t)}),d.nM))},this.handleCanvasPanUsingWheelOrSpaceDrag=function(t){if(0!==Kh.pointers.size||!(t.button===d.Oh.WHEEL||t.button===d.Oh.MAIN&&Nh||e.state.viewModeEnabled))return!1;Rh=!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(Wh=function(){Wh=null,Rh=!1,Nh||(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 Ih(Ih({},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(Ih(Ih({},t),{},{selectedElementIds:Ih(Ih({},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:Ih(Ih({},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(Jc);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(Jc);e.setState((function(e){return{selectedElementIds:Ih(Ih({},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:Ih(Ih({},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,Nu(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=Zu,t.t1=cd,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))||Uu(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,Ku(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&&Wu(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,Gu(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=Ih(Ih({},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(Jc),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,Ku(n,r);case 3:return o=t.sent,t.next=6,Gu(o);case 6:if(a=t.sent,n.type!==d.LO.svg){t.next=20;break}return t.next=10,id(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,ku({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(Jc)}))):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(Jc)}));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,ld({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=jh(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]:sd(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=Ch()((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],!Nu(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,!yu){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,Ru(a,e.state,e.scene.getElementsIncludingDeleted());case 18:return l=t.sent,e.syncActionResult(Ih(Ih({},l),{},{appState:Ih(Ih({},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}),!yu){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){Ru(t,e.state,e.scene.getElementsIncludingDeleted()).then((function(t){e.syncActionResult(Ih(Ih({},t),{},{appState:Ih(Ih({},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=yp.contextItemPredicate(e.actionManager.getElementsIncludingDeleted(),e.actionManager.getAppState()),i=xp.contextItemPredicate(e.actionManager.getElementsIncludingDeleted(),e.actionManager.getAppState()),l=Bp.contextItemPredicate(e.actionManager.getElementsIncludingDeleted(),e.actionManager.getAppState()),s=Np.contextItemPredicate(e.actionManager.getElementsIncludingDeleted(),e.actionManager.getAppState()),c="separator",u=e.scene.getElements(),d=[];if(Dd&&u.length>0&&d.push(Xp),_d&&u.length>0&&d.push(Yp),"canvas"===n){var p=[].concat(d,[void 0===e.props.gridModeEnabled&&Qp,void 0===e.props.zenModeEnabled&&tf,void 0===e.props.viewModeEnabled&&Sh,of]);e.state.viewModeEnabled?kf({options:p,top:o,left:r,actionManager:e.actionManager,appState:e.state,container:e.excalidrawContainerRef.current}):kf({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,Dd&&u.length>0&&Xp,_d&&u.length>0&&Yp,(Dd&&u.length>0||_d&&u.length>0)&&c,hc,c,void 0===e.props.gridModeEnabled&&Qp,void 0===e.props.zenModeEnabled&&tf,void 0===e.props.viewModeEnabled&&Sh,of],top:o,left:r,actionManager:e.actionManager,appState:e.state,container:e.excalidrawContainerRef.current})}else"element"===n&&(e.state.viewModeEnabled?kf({options:[navigator.clipboard&&Kp].concat(d),top:o,left:r,actionManager:e.actionManager,appState:e.state,container:e.excalidrawContainerRef.current}):kf({options:[e.isMobile&&Zp,e.isMobile&&navigator.clipboard&&Kp,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,cp,up,c,a&&yp,i&&xp,(a||i)&&c,Ep,c,sc,cc,uc,dc,c,l&&Bp,s&&Np,(l||s)&&c,vc,Qs]),top:o,left:r,actionManager:e.actionManager,appState:e.state,container:e.excalidrawContainerRef.current}))},this.handleWheel=or((function(t){if(t.preventDefault(),!Rh){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:Hh,y:Bh}),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:Kh.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(Ih({},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 Xh=Zh;n(4285),n(3313);function qh(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 $h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qh(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Qh=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=Lu({elements:t,appState:n},null,null),l=i.elements,s=i.appState,c=s.exportBackground,u=s.viewBackgroundColor;return dd(nl(l),$h($h({},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}}))},Jh=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,Qh(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)}}(),em=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=Lu({elements:n,appState:o},null,null),c=s.elements,u=s.appState,e.abrupt("return",pd(nl(c),$h($h({},u),{},{exportPadding:l}),i));case 3: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;return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Jh(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)}}(),nm=["initialData","UIOptions"],rm=["initialData","UIOptions"];function om(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 am(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?om(Object(n),!0).forEach((function(t){s()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):om(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var im=function(e){var t,n,r,o=e.onHomeButtonClick,a=e.onChange,l=e.initialData,s=e.excalidrawRef,u=e.onCollabButtonClick,p=e.isCollaborating,f=e.onPointerUpdate,h=e.renderTopRightUI,m=e.renderFooter,g=e.langCode,v=void 0===g?w.code:g,b=e.viewModeEnabled,y=e.zenModeEnabled,x=e.gridModeEnabled,k=e.libraryReturnUrl,S=e.theme,E=e.name,C=e.renderCustomStats,j=e.onPaste,O=e.detectScroll,M=void 0===O||O,I=e.handleKeyboardGlobally,T=void 0!==I&&I,L=e.onLibraryChange,_=e.autoFocus,D=void 0!==_&&_,z=e.id,H=e.generateIdForFile,B=null===(t=e.UIOptions)||void 0===t?void 0:t.canvasActions,N={canvasActions:!!B&&am(am({},d.cW.canvasActions),B)};N.canvasActions&&"object"===i()(N.canvasActions.export)&&(N.canvasActions.export.saveFileToDisk=null!==(n=null===(r=N.canvasActions.export)||void 0===r?void 0:r.saveFileToDisk)&&void 0!==n?n: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:v,children:(0,P.jsx)(Xh,{id:z,onHomeButtonClick:o,onChange:a,initialData:l,excalidrawRef:s,onCollabButtonClick:u,isCollaborating:p,onPointerUpdate:f,renderTopRightUI:h,renderFooter:m,langCode:v,viewModeEnabled:b,zenModeEnabled:y,gridModeEnabled:x,libraryReturnUrl:k,theme:S,name:E,renderCustomStats:C,UIOptions:N,onPaste:j,detectScroll:M,handleKeyboardGlobally:T,onLibraryChange:L,autoFocus:D,generateIdForFile:H})})},lm=function(e,t){e.initialData;var n=e.UIOptions,r=void 0===n?{}:n,a=o()(e,nm),i=(t.initialData,t.UIOptions),l=void 0===i?{}:i,s=o()(t,rm),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]}))},sm=(0,c.forwardRef)((function(e,t){return(0,P.jsx)(im,am(am({},e),{},{excalidrawRef:t}))})),cm=u().memo(sm,lm),um=(n(8336),cm)},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","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:"1018b0a7e7e60d808384"}[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(6177)}()}));