@dwelle/excalidraw 0.3.49 → 0.3.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/excalidraw.development.js +22 -22
- package/dist/excalidraw.production.min.js +1 -1
- package/package.json +1 -1
- package/types/actions/actionAddToLibrary.d.ts +3 -3
- package/types/actions/actionCanvas.d.ts +96 -7
- package/types/actions/actionClipboard.d.ts +4 -4
- package/types/actions/actionDeleteSelected.d.ts +2 -2
- package/types/actions/actionExport.d.ts +9 -9
- package/types/actions/actionFinalize.d.ts +2 -2
- package/types/actions/actionMenu.d.ts +3 -3
- package/types/actions/actionProperties.d.ts +13 -13
- package/types/actions/actionStyles.d.ts +1 -1
- package/types/actions/actionToggleGridMode.d.ts +1 -1
- package/types/actions/actionToggleStats.d.ts +1 -1
- package/types/actions/actionToggleViewMode.d.ts +1 -1
- package/types/actions/actionToggleZenMode.d.ts +1 -1
- package/types/actions/types.d.ts +1 -1
- package/types/appState.d.ts +4 -1
- package/types/components/Actions.d.ts +2 -2
- package/types/components/App.d.ts +6 -0
- package/types/components/icons.d.ts +1 -0
- package/types/data/restore.d.ts +1 -1
- package/types/element/Hyperlink.d.ts +1 -1
- package/types/element/dragElements.d.ts +1 -2
- package/types/element/linearElementEditor.d.ts +1 -1
- package/types/element/typeChecks.d.ts +3 -2
- package/types/types.d.ts +4 -1
|
@@ -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(()=>{var n,r,i,o,a={200:(e,t,n)=>{var r="Expected a function",i=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt,c="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,d="object"==typeof self&&self&&self.Object===Object&&self,u=c||d||Function("return this")(),h=Object.prototype.toString,p=Math.max,g=Math.min,m=function(){return u.Date.now()};function f(e,t,n){var i,o,a,s,l,c,d=0,u=!1,h=!1,f=!0;if("function"!=typeof e)throw new TypeError(r);function x(t){var n=i,r=o;return i=o=void 0,d=t,s=e.apply(r,n)}function y(e){return d=e,l=setTimeout(k,t),u?x(e):s}function w(e){var n=e-c;return void 0===c||n>=t||n<0||h&&e-d>=a}function k(){var e=m();if(w(e))return _(e);l=setTimeout(k,function(e){var n=t-(e-c);return h?g(n,a-(e-d)):n}(e))}function _(e){return l=void 0,f&&i?x(e):(i=o=void 0,s)}function C(){var e=m(),n=w(e);if(i=arguments,o=this,c=e,n){if(void 0===l)return y(c);if(h)return l=setTimeout(k,t),x(c)}return void 0===l&&(l=setTimeout(k,t)),s}return t=v(t)||0,b(n)&&(u=!!n.leading,a=(h="maxWait"in n)?p(v(n.maxWait)||0,t):a,f="trailing"in n?!!n.trailing:f),C.cancel=function(){void 0!==l&&clearTimeout(l),d=0,i=c=o=l=void 0},C.flush=function(){return void 0===l?s:_(m())},C}function b(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function v(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==h.call(e)}(e))return NaN;if(b(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=b(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var n=a.test(e);return n||s.test(e)?l(e.slice(2),n?2:8):o.test(e)?NaN:+e}e.exports=function(e,t,n){var i=!0,o=!0;if("function"!=typeof e)throw new TypeError(r);return b(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),f(e,t,{leading:i,maxWait:t,trailing:o})}},2891:function(e,t,n){var r;e=n.nmd(e),function(){var i,o="Expected a function",a="__lodash_hash_undefined__",s="__lodash_placeholder__",l=16,c=32,d=64,u=128,h=256,p=1/0,g=9007199254740991,m=NaN,f=4294967295,b=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",l],["flip",512],["partial",c],["partialRight",d],["rearg",h]],v="[object Arguments]",x="[object Array]",y="[object Boolean]",w="[object Date]",k="[object Error]",_="[object Function]",C="[object GeneratorFunction]",E="[object Map]",S="[object Number]",j="[object Object]",I="[object Promise]",T="[object RegExp]",M="[object Set]",O="[object String]",L="[object Symbol]",A="[object WeakMap]",P="[object ArrayBuffer]",D="[object DataView]",z="[object Float32Array]",R="[object Float64Array]",H="[object Int8Array]",N="[object Int16Array]",B="[object Int32Array]",F="[object Uint8Array]",U="[object Uint8ClampedArray]",W="[object Uint16Array]",K="[object Uint32Array]",V=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,Y=/(__e\(.*?\)|\b__t\)) \+\n'';/g,X=/&(?:amp|lt|gt|quot|#39);/g,Z=/[&<>"']/g,q=RegExp(X.source),$=RegExp(Z.source),Q=/<%-([\s\S]+?)%>/g,J=/<%([\s\S]+?)%>/g,ee=/<%=([\s\S]+?)%>/g,te=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ne=/^\w*$/,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ie=/[\\^$.*+?()[\]{}|]/g,oe=RegExp(ie.source),ae=/^\s+/,se=/\s/,le=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ce=/\{\n\/\* \[wrapped with (.+)\] \*/,de=/,? & /,ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,he=/[()=,{}\[\]\/\s]/,pe=/\\(\\)?/g,ge=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,me=/\w*$/,fe=/^[-+]0x[0-9a-f]+$/i,be=/^0b[01]+$/i,ve=/^\[object .+?Constructor\]$/,xe=/^0o[0-7]+$/i,ye=/^(?:0|[1-9]\d*)$/,we=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ke=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,Ce="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ee="\\u2700-\\u27bf",Se="a-z\\xdf-\\xf6\\xf8-\\xff",je="A-Z\\xc0-\\xd6\\xd8-\\xde",Ie="\\ufe0e\\ufe0f",Te="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Me="['’]",Oe="[\\ud800-\\udfff]",Le="["+Te+"]",Ae="["+Ce+"]",Pe="\\d+",De="[\\u2700-\\u27bf]",ze="["+Se+"]",Re="[^\\ud800-\\udfff"+Te+Pe+Ee+Se+je+"]",He="\\ud83c[\\udffb-\\udfff]",Ne="[^\\ud800-\\udfff]",Be="(?:\\ud83c[\\udde6-\\uddff]){2}",Fe="[\\ud800-\\udbff][\\udc00-\\udfff]",Ue="["+je+"]",We="(?:"+ze+"|"+Re+")",Ke="(?:"+Ue+"|"+Re+")",Ve="(?:['’](?:d|ll|m|re|s|t|ve))?",Ge="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ye="(?:"+Ae+"|"+He+")"+"?",Xe="[\\ufe0e\\ufe0f]?",Ze=Xe+Ye+("(?:\\u200d(?:"+[Ne,Be,Fe].join("|")+")"+Xe+Ye+")*"),qe="(?:"+[De,Be,Fe].join("|")+")"+Ze,$e="(?:"+[Ne+Ae+"?",Ae,Be,Fe,Oe].join("|")+")",Qe=RegExp(Me,"g"),Je=RegExp(Ae,"g"),et=RegExp(He+"(?="+He+")|"+$e+Ze,"g"),tt=RegExp([Ue+"?"+ze+"+"+Ve+"(?="+[Le,Ue,"$"].join("|")+")",Ke+"+"+Ge+"(?="+[Le,Ue+We,"$"].join("|")+")",Ue+"?"+We+"+"+Ve,Ue+"+"+Ge,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pe,qe].join("|"),"g"),nt=RegExp("[\\u200d\\ud800-\\udfff"+Ce+Ie+"]"),rt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,it=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ot=-1,at={};at[z]=at[R]=at[H]=at[N]=at[B]=at[F]=at[U]=at[W]=at[K]=!0,at[v]=at[x]=at[P]=at[y]=at[D]=at[w]=at[k]=at[_]=at[E]=at[S]=at[j]=at[T]=at[M]=at[O]=at[A]=!1;var st={};st[v]=st[x]=st[P]=st[D]=st[y]=st[w]=st[z]=st[R]=st[H]=st[N]=st[B]=st[E]=st[S]=st[j]=st[T]=st[M]=st[O]=st[L]=st[F]=st[U]=st[W]=st[K]=!0,st[k]=st[_]=st[A]=!1;var lt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ct=parseFloat,dt=parseInt,ut="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ht="object"==typeof self&&self&&self.Object===Object&&self,pt=ut||ht||Function("return this")(),gt=t&&!t.nodeType&&t,mt=gt&&e&&!e.nodeType&&e,ft=mt&&mt.exports===gt,bt=ft&&ut.process,vt=function(){try{var e=mt&&mt.require&&mt.require("util").types;return e||bt&&bt.binding&&bt.binding("util")}catch(e){}}(),xt=vt&&vt.isArrayBuffer,yt=vt&&vt.isDate,wt=vt&&vt.isMap,kt=vt&&vt.isRegExp,_t=vt&&vt.isSet,Ct=vt&&vt.isTypedArray;function Et(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function St(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(r,a,n(a),e)}return r}function jt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function It(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function Tt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function Mt(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function Ot(e,t){return!!(null==e?0:e.length)&&Ft(e,t,0)>-1}function Lt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function At(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function Pt(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function Dt(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function zt(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function Rt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Ht=Vt("length");function Nt(e,t,n){var r;return n(e,(function(e,n,i){if(t(e,n,i))return r=n,!1})),r}function Bt(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Ft(e,t,n){return t==t?function(e,t,n){var r=n-1,i=e.length;for(;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):Bt(e,Wt,n)}function Ut(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function Wt(e){return e!=e}function Kt(e,t){var n=null==e?0:e.length;return n?Xt(e,t)/n:m}function Vt(e){return function(t){return null==t?i:t[e]}}function Gt(e){return function(t){return null==e?i:e[t]}}function Yt(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}function Xt(e,t){for(var n,r=-1,o=e.length;++r<o;){var a=t(e[r]);a!==i&&(n=n===i?a:n+a)}return n}function Zt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function qt(e){return e?e.slice(0,mn(e)+1).replace(ae,""):e}function $t(e){return function(t){return e(t)}}function Qt(e,t){return At(t,(function(t){return e[t]}))}function Jt(e,t){return e.has(t)}function en(e,t){for(var n=-1,r=e.length;++n<r&&Ft(t,e[n],0)>-1;);return n}function tn(e,t){for(var n=e.length;n--&&Ft(t,e[n],0)>-1;);return n}function nn(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var rn=Gt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),on=Gt({"&":"&","<":"<",">":">",'"':""","'":"'"});function an(e){return"\\"+lt[e]}function sn(e){return nt.test(e)}function ln(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function cn(e,t){return function(n){return e(t(n))}}function dn(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n];a!==t&&a!==s||(e[n]=s,o[i++]=n)}return o}function un(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}function hn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}function pn(e){return sn(e)?function(e){var t=et.lastIndex=0;for(;et.test(e);)++t;return t}(e):Ht(e)}function gn(e){return sn(e)?function(e){return e.match(et)||[]}(e):function(e){return e.split("")}(e)}function mn(e){for(var t=e.length;t--&&se.test(e.charAt(t)););return t}var fn=Gt({"&":"&","<":"<",">":">",""":'"',"'":"'"});var bn=function e(t){var n,r=(t=null==t?pt:bn.defaults(pt.Object(),t,bn.pick(pt,it))).Array,se=t.Date,Ce=t.Error,Ee=t.Function,Se=t.Math,je=t.Object,Ie=t.RegExp,Te=t.String,Me=t.TypeError,Oe=r.prototype,Le=Ee.prototype,Ae=je.prototype,Pe=t["__core-js_shared__"],De=Le.toString,ze=Ae.hasOwnProperty,Re=0,He=(n=/[^.]+$/.exec(Pe&&Pe.keys&&Pe.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Ne=Ae.toString,Be=De.call(je),Fe=pt._,Ue=Ie("^"+De.call(ze).replace(ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),We=ft?t.Buffer:i,Ke=t.Symbol,Ve=t.Uint8Array,Ge=We?We.allocUnsafe:i,Ye=cn(je.getPrototypeOf,je),Xe=je.create,Ze=Ae.propertyIsEnumerable,qe=Oe.splice,$e=Ke?Ke.isConcatSpreadable:i,et=Ke?Ke.iterator:i,nt=Ke?Ke.toStringTag:i,lt=function(){try{var e=go(je,"defineProperty");return e({},"",{}),e}catch(e){}}(),ut=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,ht=se&&se.now!==pt.Date.now&&se.now,gt=t.setTimeout!==pt.setTimeout&&t.setTimeout,mt=Se.ceil,bt=Se.floor,vt=je.getOwnPropertySymbols,Ht=We?We.isBuffer:i,Gt=t.isFinite,vn=Oe.join,xn=cn(je.keys,je),yn=Se.max,wn=Se.min,kn=se.now,_n=t.parseInt,Cn=Se.random,En=Oe.reverse,Sn=go(t,"DataView"),jn=go(t,"Map"),In=go(t,"Promise"),Tn=go(t,"Set"),Mn=go(t,"WeakMap"),On=go(je,"create"),Ln=Mn&&new Mn,An={},Pn=Fo(Sn),Dn=Fo(jn),zn=Fo(In),Rn=Fo(Tn),Hn=Fo(Mn),Nn=Ke?Ke.prototype:i,Bn=Nn?Nn.valueOf:i,Fn=Nn?Nn.toString:i;function Un(e){if(is(e)&&!Ya(e)&&!(e instanceof Gn)){if(e instanceof Vn)return e;if(ze.call(e,"__wrapped__"))return Uo(e)}return new Vn(e)}var Wn=function(){function e(){}return function(t){if(!rs(t))return{};if(Xe)return Xe(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function Kn(){}function Vn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Gn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f,this.__views__=[]}function Yn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Xn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Zn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function qn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Zn;++t<n;)this.add(e[t])}function $n(e){var t=this.__data__=new Xn(e);this.size=t.size}function Qn(e,t){var n=Ya(e),r=!n&&Ga(e),i=!n&&!r&&$a(e),o=!n&&!r&&!i&&hs(e),a=n||r||i||o,s=a?Zt(e.length,Te):[],l=s.length;for(var c in e)!t&&!ze.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||wo(c,l))||s.push(c);return s}function Jn(e){var t=e.length;return t?e[qr(0,t-1)]:i}function er(e,t){return Ho(Oi(e),cr(t,0,e.length))}function tr(e){return Ho(Oi(e))}function nr(e,t,n){(n!==i&&!Wa(e[t],n)||n===i&&!(t in e))&&sr(e,t,n)}function rr(e,t,n){var r=e[t];ze.call(e,t)&&Wa(r,n)&&(n!==i||t in e)||sr(e,t,n)}function ir(e,t){for(var n=e.length;n--;)if(Wa(e[n][0],t))return n;return-1}function or(e,t,n,r){return gr(e,(function(e,i,o){t(r,e,n(e),o)})),r}function ar(e,t){return e&&Li(t,Ps(t),e)}function sr(e,t,n){"__proto__"==t&<?lt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function lr(e,t){for(var n=-1,o=t.length,a=r(o),s=null==e;++n<o;)a[n]=s?i:Ts(e,t[n]);return a}function cr(e,t,n){return e==e&&(n!==i&&(e=e<=n?e:n),t!==i&&(e=e>=t?e:t)),e}function dr(e,t,n,r,o,a){var s,l=1&t,c=2&t,d=4&t;if(n&&(s=o?n(e,r,o,a):n(e)),s!==i)return s;if(!rs(e))return e;var u=Ya(e);if(u){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&ze.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!l)return Oi(e,s)}else{var h=bo(e),p=h==_||h==C;if($a(e))return Ei(e,l);if(h==j||h==v||p&&!o){if(s=c||p?{}:xo(e),!l)return c?function(e,t){return Li(e,fo(e),t)}(e,function(e,t){return e&&Li(t,Ds(t),e)}(s,e)):function(e,t){return Li(e,mo(e),t)}(e,ar(s,e))}else{if(!st[h])return o?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case P:return Si(e);case y:case w:return new r(+e);case D:return function(e,t){var n=t?Si(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case z:case R:case H:case N:case B:case F:case U:case W:case K:return ji(e,n);case E:case M:return new r;case S:case O:return new r(e);case T:return function(e){var t=new e.constructor(e.source,me.exec(e));return t.lastIndex=e.lastIndex,t}(e);case L:return i=e,Bn?je(Bn.call(i)):{}}var i}(e,h,l)}}a||(a=new $n);var g=a.get(e);if(g)return g;a.set(e,s),cs(e)?e.forEach((function(r){s.add(dr(r,t,n,r,e,a))})):os(e)&&e.forEach((function(r,i){s.set(i,dr(r,t,n,i,e,a))}));var m=u?i:(d?c?ao:oo:c?Ds:Ps)(e);return jt(m||e,(function(r,i){m&&(r=e[i=r]),rr(s,i,dr(r,t,n,i,e,a))})),s}function ur(e,t,n){var r=n.length;if(null==e)return!r;for(e=je(e);r--;){var o=n[r],a=t[o],s=e[o];if(s===i&&!(o in e)||!a(s))return!1}return!0}function hr(e,t,n){if("function"!=typeof e)throw new Me(o);return Po((function(){e.apply(i,n)}),t)}function pr(e,t,n,r){var i=-1,o=Ot,a=!0,s=e.length,l=[],c=t.length;if(!s)return l;n&&(t=At(t,$t(n))),r?(o=Lt,a=!1):t.length>=200&&(o=Jt,a=!1,t=new qn(t));e:for(;++i<s;){var d=e[i],u=null==n?d:n(d);if(d=r||0!==d?d:0,a&&u==u){for(var h=c;h--;)if(t[h]===u)continue e;l.push(d)}else o(t,u,r)||l.push(d)}return l}Un.templateSettings={escape:Q,evaluate:J,interpolate:ee,variable:"",imports:{_:Un}},Un.prototype=Kn.prototype,Un.prototype.constructor=Un,Vn.prototype=Wn(Kn.prototype),Vn.prototype.constructor=Vn,Gn.prototype=Wn(Kn.prototype),Gn.prototype.constructor=Gn,Yn.prototype.clear=function(){this.__data__=On?On(null):{},this.size=0},Yn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Yn.prototype.get=function(e){var t=this.__data__;if(On){var n=t[e];return n===a?i:n}return ze.call(t,e)?t[e]:i},Yn.prototype.has=function(e){var t=this.__data__;return On?t[e]!==i:ze.call(t,e)},Yn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=On&&t===i?a:t,this},Xn.prototype.clear=function(){this.__data__=[],this.size=0},Xn.prototype.delete=function(e){var t=this.__data__,n=ir(t,e);return!(n<0)&&(n==t.length-1?t.pop():qe.call(t,n,1),--this.size,!0)},Xn.prototype.get=function(e){var t=this.__data__,n=ir(t,e);return n<0?i:t[n][1]},Xn.prototype.has=function(e){return ir(this.__data__,e)>-1},Xn.prototype.set=function(e,t){var n=this.__data__,r=ir(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Zn.prototype.clear=function(){this.size=0,this.__data__={hash:new Yn,map:new(jn||Xn),string:new Yn}},Zn.prototype.delete=function(e){var t=ho(this,e).delete(e);return this.size-=t?1:0,t},Zn.prototype.get=function(e){return ho(this,e).get(e)},Zn.prototype.has=function(e){return ho(this,e).has(e)},Zn.prototype.set=function(e,t){var n=ho(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},qn.prototype.add=qn.prototype.push=function(e){return this.__data__.set(e,a),this},qn.prototype.has=function(e){return this.__data__.has(e)},$n.prototype.clear=function(){this.__data__=new Xn,this.size=0},$n.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},$n.prototype.get=function(e){return this.__data__.get(e)},$n.prototype.has=function(e){return this.__data__.has(e)},$n.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Xn){var r=n.__data__;if(!jn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Zn(r)}return n.set(e,t),this.size=n.size,this};var gr=Di(kr),mr=Di(_r,!0);function fr(e,t){var n=!0;return gr(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function br(e,t,n){for(var r=-1,o=e.length;++r<o;){var a=e[r],s=t(a);if(null!=s&&(l===i?s==s&&!us(s):n(s,l)))var l=s,c=a}return c}function vr(e,t){var n=[];return gr(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}function xr(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=yo),i||(i=[]);++o<a;){var s=e[o];t>0&&n(s)?t>1?xr(s,t-1,n,r,i):Pt(i,s):r||(i[i.length]=s)}return i}var yr=zi(),wr=zi(!0);function kr(e,t){return e&&yr(e,t,Ps)}function _r(e,t){return e&&wr(e,t,Ps)}function Cr(e,t){return Mt(t,(function(t){return es(e[t])}))}function Er(e,t){for(var n=0,r=(t=wi(t,e)).length;null!=e&&n<r;)e=e[Bo(t[n++])];return n&&n==r?e:i}function Sr(e,t,n){var r=t(e);return Ya(e)?r:Pt(r,n(e))}function jr(e){return null==e?e===i?"[object Undefined]":"[object Null]":nt&&nt in je(e)?function(e){var t=ze.call(e,nt),n=e[nt];try{e[nt]=i;var r=!0}catch(e){}var o=Ne.call(e);r&&(t?e[nt]=n:delete e[nt]);return o}(e):function(e){return Ne.call(e)}(e)}function Ir(e,t){return e>t}function Tr(e,t){return null!=e&&ze.call(e,t)}function Mr(e,t){return null!=e&&t in je(e)}function Or(e,t,n){for(var o=n?Lt:Ot,a=e[0].length,s=e.length,l=s,c=r(s),d=1/0,u=[];l--;){var h=e[l];l&&t&&(h=At(h,$t(t))),d=wn(h.length,d),c[l]=!n&&(t||a>=120&&h.length>=120)?new qn(l&&h):i}h=e[0];var p=-1,g=c[0];e:for(;++p<a&&u.length<d;){var m=h[p],f=t?t(m):m;if(m=n||0!==m?m:0,!(g?Jt(g,f):o(u,f,n))){for(l=s;--l;){var b=c[l];if(!(b?Jt(b,f):o(e[l],f,n)))continue e}g&&g.push(f),u.push(m)}}return u}function Lr(e,t,n){var r=null==(e=Mo(e,t=wi(t,e)))?e:e[Bo(Jo(t))];return null==r?i:Et(r,e,n)}function Ar(e){return is(e)&&jr(e)==v}function Pr(e,t,n,r,o){return e===t||(null==e||null==t||!is(e)&&!is(t)?e!=e&&t!=t:function(e,t,n,r,o,a){var s=Ya(e),l=Ya(t),c=s?x:bo(e),d=l?x:bo(t),u=(c=c==v?j:c)==j,h=(d=d==v?j:d)==j,p=c==d;if(p&&$a(e)){if(!$a(t))return!1;s=!0,u=!1}if(p&&!u)return a||(a=new $n),s||hs(e)?ro(e,t,n,r,o,a):function(e,t,n,r,i,o,a){switch(n){case D:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case P:return!(e.byteLength!=t.byteLength||!o(new Ve(e),new Ve(t)));case y:case w:case S:return Wa(+e,+t);case k:return e.name==t.name&&e.message==t.message;case T:case O:return e==t+"";case E:var s=ln;case M:var l=1&r;if(s||(s=un),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=2,a.set(e,t);var d=ro(s(e),s(t),r,i,o,a);return a.delete(e),d;case L:if(Bn)return Bn.call(e)==Bn.call(t)}return!1}(e,t,c,n,r,o,a);if(!(1&n)){var g=u&&ze.call(e,"__wrapped__"),m=h&&ze.call(t,"__wrapped__");if(g||m){var f=g?e.value():e,b=m?t.value():t;return a||(a=new $n),o(f,b,n,r,a)}}if(!p)return!1;return a||(a=new $n),function(e,t,n,r,o,a){var s=1&n,l=oo(e),c=l.length,d=oo(t).length;if(c!=d&&!s)return!1;var u=c;for(;u--;){var h=l[u];if(!(s?h in t:ze.call(t,h)))return!1}var p=a.get(e),g=a.get(t);if(p&&g)return p==t&&g==e;var m=!0;a.set(e,t),a.set(t,e);var f=s;for(;++u<c;){var b=e[h=l[u]],v=t[h];if(r)var x=s?r(v,b,h,t,e,a):r(b,v,h,e,t,a);if(!(x===i?b===v||o(b,v,n,r,a):x)){m=!1;break}f||(f="constructor"==h)}if(m&&!f){var y=e.constructor,w=t.constructor;y==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof w&&w instanceof w||(m=!1)}return a.delete(e),a.delete(t),m}(e,t,n,r,o,a)}(e,t,n,r,Pr,o))}function Dr(e,t,n,r){var o=n.length,a=o,s=!r;if(null==e)return!a;for(e=je(e);o--;){var l=n[o];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<a;){var c=(l=n[o])[0],d=e[c],u=l[1];if(s&&l[2]){if(d===i&&!(c in e))return!1}else{var h=new $n;if(r)var p=r(d,u,c,e,t,h);if(!(p===i?Pr(u,d,3,r,h):p))return!1}}return!0}function zr(e){return!(!rs(e)||(t=e,He&&He in t))&&(es(e)?Ue:ve).test(Fo(e));var t}function Rr(e){return"function"==typeof e?e:null==e?al:"object"==typeof e?Ya(e)?Wr(e[0],e[1]):Ur(e):ml(e)}function Hr(e){if(!So(e))return xn(e);var t=[];for(var n in je(e))ze.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Nr(e){if(!rs(e))return function(e){var t=[];if(null!=e)for(var n in je(e))t.push(n);return t}(e);var t=So(e),n=[];for(var r in e)("constructor"!=r||!t&&ze.call(e,r))&&n.push(r);return n}function Br(e,t){return e<t}function Fr(e,t){var n=-1,i=Za(e)?r(e.length):[];return gr(e,(function(e,r,o){i[++n]=t(e,r,o)})),i}function Ur(e){var t=po(e);return 1==t.length&&t[0][2]?Io(t[0][0],t[0][1]):function(n){return n===e||Dr(n,e,t)}}function Wr(e,t){return _o(e)&&jo(t)?Io(Bo(e),t):function(n){var r=Ts(n,e);return r===i&&r===t?Ms(n,e):Pr(t,r,3)}}function Kr(e,t,n,r,o){e!==t&&yr(t,(function(a,s){if(o||(o=new $n),rs(a))!function(e,t,n,r,o,a,s){var l=Lo(e,n),c=Lo(t,n),d=s.get(c);if(d)return void nr(e,n,d);var u=a?a(l,c,n+"",e,t,s):i,h=u===i;if(h){var p=Ya(c),g=!p&&$a(c),m=!p&&!g&&hs(c);u=c,p||g||m?Ya(l)?u=l:qa(l)?u=Oi(l):g?(h=!1,u=Ei(c,!0)):m?(h=!1,u=ji(c,!0)):u=[]:ss(c)||Ga(c)?(u=l,Ga(l)?u=ys(l):rs(l)&&!es(l)||(u=xo(c))):h=!1}h&&(s.set(c,u),o(u,c,r,a,s),s.delete(c));nr(e,n,u)}(e,t,s,n,Kr,r,o);else{var l=r?r(Lo(e,s),a,s+"",e,t,o):i;l===i&&(l=a),nr(e,s,l)}}),Ds)}function Vr(e,t){var n=e.length;if(n)return wo(t+=t<0?n:0,n)?e[t]:i}function Gr(e,t,n){t=t.length?At(t,(function(e){return Ya(e)?function(t){return Er(t,1===e.length?e[0]:e)}:e})):[al];var r=-1;t=At(t,$t(uo()));var i=Fr(e,(function(e,n,i){var o=At(t,(function(t){return t(e)}));return{criteria:o,index:++r,value:e}}));return function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(i,(function(e,t){return function(e,t,n){var r=-1,i=e.criteria,o=t.criteria,a=i.length,s=n.length;for(;++r<a;){var l=Ii(i[r],o[r]);if(l)return r>=s?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function Yr(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var a=t[r],s=Er(e,a);n(s,a)&&ti(o,wi(a,e),s)}return o}function Xr(e,t,n,r){var i=r?Ut:Ft,o=-1,a=t.length,s=e;for(e===t&&(t=Oi(t)),n&&(s=At(e,$t(n)));++o<a;)for(var l=0,c=t[o],d=n?n(c):c;(l=i(s,d,l,r))>-1;)s!==e&&qe.call(s,l,1),qe.call(e,l,1);return e}function Zr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;wo(i)?qe.call(e,i,1):pi(e,i)}}return e}function qr(e,t){return e+bt(Cn()*(t-e+1))}function $r(e,t){var n="";if(!e||t<1||t>g)return n;do{t%2&&(n+=e),(t=bt(t/2))&&(e+=e)}while(t);return n}function Qr(e,t){return Do(To(e,t,al),e+"")}function Jr(e){return Jn(Ws(e))}function ei(e,t){var n=Ws(e);return Ho(n,cr(t,0,n.length))}function ti(e,t,n,r){if(!rs(e))return e;for(var o=-1,a=(t=wi(t,e)).length,s=a-1,l=e;null!=l&&++o<a;){var c=Bo(t[o]),d=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=s){var u=l[c];(d=r?r(u,c,l):i)===i&&(d=rs(u)?u:wo(t[o+1])?[]:{})}rr(l,c,d),l=l[c]}return e}var ni=Ln?function(e,t){return Ln.set(e,t),e}:al,ri=lt?function(e,t){return lt(e,"toString",{configurable:!0,enumerable:!1,value:rl(t),writable:!0})}:al;function ii(e){return Ho(Ws(e))}function oi(e,t,n){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=r(o);++i<o;)a[i]=e[i+t];return a}function ai(e,t){var n;return gr(e,(function(e,r,i){return!(n=t(e,r,i))})),!!n}function si(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;r<i;){var o=r+i>>>1,a=e[o];null!==a&&!us(a)&&(n?a<=t:a<t)?r=o+1:i=o}return i}return li(e,t,al,n)}function li(e,t,n,r){var o=0,a=null==e?0:e.length;if(0===a)return 0;for(var s=(t=n(t))!=t,l=null===t,c=us(t),d=t===i;o<a;){var u=bt((o+a)/2),h=n(e[u]),p=h!==i,g=null===h,m=h==h,f=us(h);if(s)var b=r||m;else b=d?m&&(r||p):l?m&&p&&(r||!g):c?m&&p&&!g&&(r||!f):!g&&!f&&(r?h<=t:h<t);b?o=u+1:a=u}return wn(a,4294967294)}function ci(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n],s=t?t(a):a;if(!n||!Wa(s,l)){var l=s;o[i++]=0===a?0:a}}return o}function di(e){return"number"==typeof e?e:us(e)?m:+e}function ui(e){if("string"==typeof e)return e;if(Ya(e))return At(e,ui)+"";if(us(e))return Fn?Fn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function hi(e,t,n){var r=-1,i=Ot,o=e.length,a=!0,s=[],l=s;if(n)a=!1,i=Lt;else if(o>=200){var c=t?null:$i(e);if(c)return un(c);a=!1,i=Jt,l=new qn}else l=t?[]:s;e:for(;++r<o;){var d=e[r],u=t?t(d):d;if(d=n||0!==d?d:0,a&&u==u){for(var h=l.length;h--;)if(l[h]===u)continue e;t&&l.push(u),s.push(d)}else i(l,u,n)||(l!==s&&l.push(u),s.push(d))}return s}function pi(e,t){return null==(e=Mo(e,t=wi(t,e)))||delete e[Bo(Jo(t))]}function gi(e,t,n,r){return ti(e,t,n(Er(e,t)),r)}function mi(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?oi(e,r?0:o,r?o+1:i):oi(e,r?o+1:0,r?i:o)}function fi(e,t){var n=e;return n instanceof Gn&&(n=n.value()),Dt(t,(function(e,t){return t.func.apply(t.thisArg,Pt([e],t.args))}),n)}function bi(e,t,n){var i=e.length;if(i<2)return i?hi(e[0]):[];for(var o=-1,a=r(i);++o<i;)for(var s=e[o],l=-1;++l<i;)l!=o&&(a[o]=pr(a[o]||s,e[l],t,n));return hi(xr(a,1),t,n)}function vi(e,t,n){for(var r=-1,o=e.length,a=t.length,s={};++r<o;){var l=r<a?t[r]:i;n(s,e[r],l)}return s}function xi(e){return qa(e)?e:[]}function yi(e){return"function"==typeof e?e:al}function wi(e,t){return Ya(e)?e:_o(e,t)?[e]:No(ws(e))}var ki=Qr;function _i(e,t,n){var r=e.length;return n=n===i?r:n,!t&&n>=r?e:oi(e,t,n)}var Ci=ut||function(e){return pt.clearTimeout(e)};function Ei(e,t){if(t)return e.slice();var n=e.length,r=Ge?Ge(n):new e.constructor(n);return e.copy(r),r}function Si(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t}function ji(e,t){var n=t?Si(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ii(e,t){if(e!==t){var n=e!==i,r=null===e,o=e==e,a=us(e),s=t!==i,l=null===t,c=t==t,d=us(t);if(!l&&!d&&!a&&e>t||a&&s&&c&&!l&&!d||r&&s&&c||!n&&c||!o)return 1;if(!r&&!a&&!d&&e<t||d&&n&&o&&!r&&!a||l&&n&&o||!s&&o||!c)return-1}return 0}function Ti(e,t,n,i){for(var o=-1,a=e.length,s=n.length,l=-1,c=t.length,d=yn(a-s,0),u=r(c+d),h=!i;++l<c;)u[l]=t[l];for(;++o<s;)(h||o<a)&&(u[n[o]]=e[o]);for(;d--;)u[l++]=e[o++];return u}function Mi(e,t,n,i){for(var o=-1,a=e.length,s=-1,l=n.length,c=-1,d=t.length,u=yn(a-l,0),h=r(u+d),p=!i;++o<u;)h[o]=e[o];for(var g=o;++c<d;)h[g+c]=t[c];for(;++s<l;)(p||o<a)&&(h[g+n[s]]=e[o++]);return h}function Oi(e,t){var n=-1,i=e.length;for(t||(t=r(i));++n<i;)t[n]=e[n];return t}function Li(e,t,n,r){var o=!n;n||(n={});for(var a=-1,s=t.length;++a<s;){var l=t[a],c=r?r(n[l],e[l],l,n,e):i;c===i&&(c=e[l]),o?sr(n,l,c):rr(n,l,c)}return n}function Ai(e,t){return function(n,r){var i=Ya(n)?St:or,o=t?t():{};return i(n,e,uo(r,2),o)}}function Pi(e){return Qr((function(t,n){var r=-1,o=n.length,a=o>1?n[o-1]:i,s=o>2?n[2]:i;for(a=e.length>3&&"function"==typeof a?(o--,a):i,s&&ko(n[0],n[1],s)&&(a=o<3?i:a,o=1),t=je(t);++r<o;){var l=n[r];l&&e(t,l,r,a)}return t}))}function Di(e,t){return function(n,r){if(null==n)return n;if(!Za(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=je(n);(t?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function zi(e){return function(t,n,r){for(var i=-1,o=je(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(!1===n(o[l],l,o))break}return t}}function Ri(e){return function(t){var n=sn(t=ws(t))?gn(t):i,r=n?n[0]:t.charAt(0),o=n?_i(n,1).join(""):t.slice(1);return r[e]()+o}}function Hi(e){return function(t){return Dt(el(Gs(t).replace(Qe,"")),e,"")}}function Ni(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Wn(e.prototype),r=e.apply(n,t);return rs(r)?r:n}}function Bi(e){return function(t,n,r){var o=je(t);if(!Za(t)){var a=uo(n,3);t=Ps(t),n=function(e){return a(o[e],e,o)}}var s=e(t,n,r);return s>-1?o[a?t[s]:s]:i}}function Fi(e){return io((function(t){var n=t.length,r=n,a=Vn.prototype.thru;for(e&&t.reverse();r--;){var s=t[r];if("function"!=typeof s)throw new Me(o);if(a&&!l&&"wrapper"==lo(s))var l=new Vn([],!0)}for(r=l?r:n;++r<n;){var c=lo(s=t[r]),d="wrapper"==c?so(s):i;l=d&&Co(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?l[lo(d[0])].apply(l,d[3]):1==s.length&&Co(s)?l[c]():l.thru(s)}return function(){var e=arguments,r=e[0];if(l&&1==e.length&&Ya(r))return l.plant(r).value();for(var i=0,o=n?t[i].apply(this,e):r;++i<n;)o=t[i].call(this,o);return o}}))}function Ui(e,t,n,o,a,s,l,c,d,h){var p=t&u,g=1&t,m=2&t,f=24&t,b=512&t,v=m?i:Ni(e);return function i(){for(var u=arguments.length,x=r(u),y=u;y--;)x[y]=arguments[y];if(f)var w=co(i),k=nn(x,w);if(o&&(x=Ti(x,o,a,f)),s&&(x=Mi(x,s,l,f)),u-=k,f&&u<h){var _=dn(x,w);return Zi(e,t,Ui,i.placeholder,n,x,_,c,d,h-u)}var C=g?n:this,E=m?C[e]:e;return u=x.length,c?x=Oo(x,c):b&&u>1&&x.reverse(),p&&d<u&&(x.length=d),this&&this!==pt&&this instanceof i&&(E=v||Ni(E)),E.apply(C,x)}}function Wi(e,t){return function(n,r){return function(e,t,n,r){return kr(e,(function(e,i,o){t(r,n(e),i,o)})),r}(n,e,t(r),{})}}function Ki(e,t){return function(n,r){var o;if(n===i&&r===i)return t;if(n!==i&&(o=n),r!==i){if(o===i)return r;"string"==typeof n||"string"==typeof r?(n=ui(n),r=ui(r)):(n=di(n),r=di(r)),o=e(n,r)}return o}}function Vi(e){return io((function(t){return t=At(t,$t(uo())),Qr((function(n){var r=this;return e(t,(function(e){return Et(e,r,n)}))}))}))}function Gi(e,t){var n=(t=t===i?" ":ui(t)).length;if(n<2)return n?$r(t,e):t;var r=$r(t,mt(e/pn(t)));return sn(t)?_i(gn(r),0,e).join(""):r.slice(0,e)}function Yi(e){return function(t,n,o){return o&&"number"!=typeof o&&ko(t,n,o)&&(n=o=i),t=fs(t),n===i?(n=t,t=0):n=fs(n),function(e,t,n,i){for(var o=-1,a=yn(mt((t-e)/(n||1)),0),s=r(a);a--;)s[i?a:++o]=e,e+=n;return s}(t,n,o=o===i?t<n?1:-1:fs(o),e)}}function Xi(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=xs(t),n=xs(n)),e(t,n)}}function Zi(e,t,n,r,o,a,s,l,u,h){var p=8&t;t|=p?c:d,4&(t&=~(p?d:c))||(t&=-4);var g=[e,t,o,p?a:i,p?s:i,p?i:a,p?i:s,l,u,h],m=n.apply(i,g);return Co(e)&&Ao(m,g),m.placeholder=r,zo(m,e,t)}function qi(e){var t=Se[e];return function(e,n){if(e=xs(e),(n=null==n?0:wn(bs(n),292))&&Gt(e)){var r=(ws(e)+"e").split("e");return+((r=(ws(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var $i=Tn&&1/un(new Tn([,-0]))[1]==p?function(e){return new Tn(e)}:ul;function Qi(e){return function(t){var n=bo(t);return n==E?ln(t):n==M?hn(t):function(e,t){return At(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Ji(e,t,n,a,p,g,m,f){var b=2&t;if(!b&&"function"!=typeof e)throw new Me(o);var v=a?a.length:0;if(v||(t&=-97,a=p=i),m=m===i?m:yn(bs(m),0),f=f===i?f:bs(f),v-=p?p.length:0,t&d){var x=a,y=p;a=p=i}var w=b?i:so(e),k=[e,t,n,a,p,x,y,g,m,f];if(w&&function(e,t){var n=e[1],r=t[1],i=n|r,o=i<131,a=r==u&&8==n||r==u&&n==h&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!o&&!a)return e;1&r&&(e[2]=t[2],i|=1&n?0:4);var l=t[3];if(l){var c=e[3];e[3]=c?Ti(c,l,t[4]):l,e[4]=c?dn(e[3],s):t[4]}(l=t[5])&&(c=e[5],e[5]=c?Mi(c,l,t[6]):l,e[6]=c?dn(e[5],s):t[6]);(l=t[7])&&(e[7]=l);r&u&&(e[8]=null==e[8]?t[8]:wn(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=i}(k,w),e=k[0],t=k[1],n=k[2],a=k[3],p=k[4],!(f=k[9]=k[9]===i?b?0:e.length:yn(k[9]-v,0))&&24&t&&(t&=-25),t&&1!=t)_=8==t||t==l?function(e,t,n){var o=Ni(e);return function a(){for(var s=arguments.length,l=r(s),c=s,d=co(a);c--;)l[c]=arguments[c];var u=s<3&&l[0]!==d&&l[s-1]!==d?[]:dn(l,d);return(s-=u.length)<n?Zi(e,t,Ui,a.placeholder,i,l,u,i,i,n-s):Et(this&&this!==pt&&this instanceof a?o:e,this,l)}}(e,t,f):t!=c&&33!=t||p.length?Ui.apply(i,k):function(e,t,n,i){var o=1&t,a=Ni(e);return function t(){for(var s=-1,l=arguments.length,c=-1,d=i.length,u=r(d+l),h=this&&this!==pt&&this instanceof t?a:e;++c<d;)u[c]=i[c];for(;l--;)u[c++]=arguments[++s];return Et(h,o?n:this,u)}}(e,t,n,a);else var _=function(e,t,n){var r=1&t,i=Ni(e);return function t(){return(this&&this!==pt&&this instanceof t?i:e).apply(r?n:this,arguments)}}(e,t,n);return zo((w?ni:Ao)(_,k),e,t)}function eo(e,t,n,r){return e===i||Wa(e,Ae[n])&&!ze.call(r,n)?t:e}function to(e,t,n,r,o,a){return rs(e)&&rs(t)&&(a.set(t,e),Kr(e,t,i,to,a),a.delete(t)),e}function no(e){return ss(e)?i:e}function ro(e,t,n,r,o,a){var s=1&n,l=e.length,c=t.length;if(l!=c&&!(s&&c>l))return!1;var d=a.get(e),u=a.get(t);if(d&&u)return d==t&&u==e;var h=-1,p=!0,g=2&n?new qn:i;for(a.set(e,t),a.set(t,e);++h<l;){var m=e[h],f=t[h];if(r)var b=s?r(f,m,h,t,e,a):r(m,f,h,e,t,a);if(b!==i){if(b)continue;p=!1;break}if(g){if(!Rt(t,(function(e,t){if(!Jt(g,t)&&(m===e||o(m,e,n,r,a)))return g.push(t)}))){p=!1;break}}else if(m!==f&&!o(m,f,n,r,a)){p=!1;break}}return a.delete(e),a.delete(t),p}function io(e){return Do(To(e,i,Xo),e+"")}function oo(e){return Sr(e,Ps,mo)}function ao(e){return Sr(e,Ds,fo)}var so=Ln?function(e){return Ln.get(e)}:ul;function lo(e){for(var t=e.name+"",n=An[t],r=ze.call(An,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function co(e){return(ze.call(Un,"placeholder")?Un:e).placeholder}function uo(){var e=Un.iteratee||sl;return e=e===sl?Rr:e,arguments.length?e(arguments[0],arguments[1]):e}function ho(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function po(e){for(var t=Ps(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,jo(i)]}return t}function go(e,t){var n=function(e,t){return null==e?i:e[t]}(e,t);return zr(n)?n:i}var mo=vt?function(e){return null==e?[]:(e=je(e),Mt(vt(e),(function(t){return Ze.call(e,t)})))}:vl,fo=vt?function(e){for(var t=[];e;)Pt(t,mo(e)),e=Ye(e);return t}:vl,bo=jr;function vo(e,t,n){for(var r=-1,i=(t=wi(t,e)).length,o=!1;++r<i;){var a=Bo(t[r]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&ns(i)&&wo(a,i)&&(Ya(e)||Ga(e))}function xo(e){return"function"!=typeof e.constructor||So(e)?{}:Wn(Ye(e))}function yo(e){return Ya(e)||Ga(e)||!!($e&&e&&e[$e])}function wo(e,t){var n=typeof e;return!!(t=null==t?g:t)&&("number"==n||"symbol"!=n&&ye.test(e))&&e>-1&&e%1==0&&e<t}function ko(e,t,n){if(!rs(n))return!1;var r=typeof t;return!!("number"==r?Za(n)&&wo(t,n.length):"string"==r&&t in n)&&Wa(n[t],e)}function _o(e,t){if(Ya(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!us(e))||(ne.test(e)||!te.test(e)||null!=t&&e in je(t))}function Co(e){var t=lo(e),n=Un[t];if("function"!=typeof n||!(t in Gn.prototype))return!1;if(e===n)return!0;var r=so(n);return!!r&&e===r[0]}(Sn&&bo(new Sn(new ArrayBuffer(1)))!=D||jn&&bo(new jn)!=E||In&&bo(In.resolve())!=I||Tn&&bo(new Tn)!=M||Mn&&bo(new Mn)!=A)&&(bo=function(e){var t=jr(e),n=t==j?e.constructor:i,r=n?Fo(n):"";if(r)switch(r){case Pn:return D;case Dn:return E;case zn:return I;case Rn:return M;case Hn:return A}return t});var Eo=Pe?es:xl;function So(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ae)}function jo(e){return e==e&&!rs(e)}function Io(e,t){return function(n){return null!=n&&(n[e]===t&&(t!==i||e in je(n)))}}function To(e,t,n){return t=yn(t===i?e.length-1:t,0),function(){for(var i=arguments,o=-1,a=yn(i.length-t,0),s=r(a);++o<a;)s[o]=i[t+o];o=-1;for(var l=r(t+1);++o<t;)l[o]=i[o];return l[t]=n(s),Et(e,this,l)}}function Mo(e,t){return t.length<2?e:Er(e,oi(t,0,-1))}function Oo(e,t){for(var n=e.length,r=wn(t.length,n),o=Oi(e);r--;){var a=t[r];e[r]=wo(a,n)?o[a]:i}return e}function Lo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Ao=Ro(ni),Po=gt||function(e,t){return pt.setTimeout(e,t)},Do=Ro(ri);function zo(e,t,n){var r=t+"";return Do(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(le,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return jt(b,(function(n){var r="_."+n[0];t&n[1]&&!Ot(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(ce);return t?t[1].split(de):[]}(r),n)))}function Ro(e){var t=0,n=0;return function(){var r=kn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Ho(e,t){var n=-1,r=e.length,o=r-1;for(t=t===i?r:t;++n<t;){var a=qr(n,o),s=e[a];e[a]=e[n],e[n]=s}return e.length=t,e}var No=function(e){var t=Ra(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(re,(function(e,n,r,i){t.push(r?i.replace(pe,"$1"):n||e)})),t}));function Bo(e){if("string"==typeof e||us(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Fo(e){if(null!=e){try{return De.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Uo(e){if(e instanceof Gn)return e.clone();var t=new Vn(e.__wrapped__,e.__chain__);return t.__actions__=Oi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Wo=Qr((function(e,t){return qa(e)?pr(e,xr(t,1,qa,!0)):[]})),Ko=Qr((function(e,t){var n=Jo(t);return qa(n)&&(n=i),qa(e)?pr(e,xr(t,1,qa,!0),uo(n,2)):[]})),Vo=Qr((function(e,t){var n=Jo(t);return qa(n)&&(n=i),qa(e)?pr(e,xr(t,1,qa,!0),i,n):[]}));function Go(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:bs(n);return i<0&&(i=yn(r+i,0)),Bt(e,uo(t,3),i)}function Yo(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r-1;return n!==i&&(o=bs(n),o=n<0?yn(r+o,0):wn(o,r-1)),Bt(e,uo(t,3),o,!0)}function Xo(e){return(null==e?0:e.length)?xr(e,1):[]}function Zo(e){return e&&e.length?e[0]:i}var qo=Qr((function(e){var t=At(e,xi);return t.length&&t[0]===e[0]?Or(t):[]})),$o=Qr((function(e){var t=Jo(e),n=At(e,xi);return t===Jo(n)?t=i:n.pop(),n.length&&n[0]===e[0]?Or(n,uo(t,2)):[]})),Qo=Qr((function(e){var t=Jo(e),n=At(e,xi);return(t="function"==typeof t?t:i)&&n.pop(),n.length&&n[0]===e[0]?Or(n,i,t):[]}));function Jo(e){var t=null==e?0:e.length;return t?e[t-1]:i}var ea=Qr(ta);function ta(e,t){return e&&e.length&&t&&t.length?Xr(e,t):e}var na=io((function(e,t){var n=null==e?0:e.length,r=lr(e,t);return Zr(e,At(t,(function(e){return wo(e,n)?+e:e})).sort(Ii)),r}));function ra(e){return null==e?e:En.call(e)}var ia=Qr((function(e){return hi(xr(e,1,qa,!0))})),oa=Qr((function(e){var t=Jo(e);return qa(t)&&(t=i),hi(xr(e,1,qa,!0),uo(t,2))})),aa=Qr((function(e){var t=Jo(e);return t="function"==typeof t?t:i,hi(xr(e,1,qa,!0),i,t)}));function sa(e){if(!e||!e.length)return[];var t=0;return e=Mt(e,(function(e){if(qa(e))return t=yn(e.length,t),!0})),Zt(t,(function(t){return At(e,Vt(t))}))}function la(e,t){if(!e||!e.length)return[];var n=sa(e);return null==t?n:At(n,(function(e){return Et(t,i,e)}))}var ca=Qr((function(e,t){return qa(e)?pr(e,t):[]})),da=Qr((function(e){return bi(Mt(e,qa))})),ua=Qr((function(e){var t=Jo(e);return qa(t)&&(t=i),bi(Mt(e,qa),uo(t,2))})),ha=Qr((function(e){var t=Jo(e);return t="function"==typeof t?t:i,bi(Mt(e,qa),i,t)})),pa=Qr(sa);var ga=Qr((function(e){var t=e.length,n=t>1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,la(e,n)}));function ma(e){var t=Un(e);return t.__chain__=!0,t}function fa(e,t){return t(e)}var ba=io((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return lr(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Gn&&wo(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:fa,args:[o],thisArg:i}),new Vn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)}));var va=Ai((function(e,t,n){ze.call(e,n)?++e[n]:sr(e,n,1)}));var xa=Bi(Go),ya=Bi(Yo);function wa(e,t){return(Ya(e)?jt:gr)(e,uo(t,3))}function ka(e,t){return(Ya(e)?It:mr)(e,uo(t,3))}var _a=Ai((function(e,t,n){ze.call(e,n)?e[n].push(t):sr(e,n,[t])}));var Ca=Qr((function(e,t,n){var i=-1,o="function"==typeof t,a=Za(e)?r(e.length):[];return gr(e,(function(e){a[++i]=o?Et(t,e,n):Lr(e,t,n)})),a})),Ea=Ai((function(e,t,n){sr(e,n,t)}));function Sa(e,t){return(Ya(e)?At:Fr)(e,uo(t,3))}var ja=Ai((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var Ia=Qr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&ko(e,t[0],t[1])?t=[]:n>2&&ko(t[0],t[1],t[2])&&(t=[t[0]]),Gr(e,xr(t,1),[])})),Ta=ht||function(){return pt.Date.now()};function Ma(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,Ji(e,u,i,i,i,i,t)}function Oa(e,t){var n;if("function"!=typeof t)throw new Me(o);return e=bs(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var La=Qr((function(e,t,n){var r=1;if(n.length){var i=dn(n,co(La));r|=c}return Ji(e,r,t,n,i)})),Aa=Qr((function(e,t,n){var r=3;if(n.length){var i=dn(n,co(Aa));r|=c}return Ji(t,r,e,n,i)}));function Pa(e,t,n){var r,a,s,l,c,d,u=0,h=!1,p=!1,g=!0;if("function"!=typeof e)throw new Me(o);function m(t){var n=r,o=a;return r=a=i,u=t,l=e.apply(o,n)}function f(e){return u=e,c=Po(v,t),h?m(e):l}function b(e){var n=e-d;return d===i||n>=t||n<0||p&&e-u>=s}function v(){var e=Ta();if(b(e))return x(e);c=Po(v,function(e){var n=t-(e-d);return p?wn(n,s-(e-u)):n}(e))}function x(e){return c=i,g&&r?m(e):(r=a=i,l)}function y(){var e=Ta(),n=b(e);if(r=arguments,a=this,d=e,n){if(c===i)return f(d);if(p)return Ci(c),c=Po(v,t),m(d)}return c===i&&(c=Po(v,t)),l}return t=xs(t)||0,rs(n)&&(h=!!n.leading,s=(p="maxWait"in n)?yn(xs(n.maxWait)||0,t):s,g="trailing"in n?!!n.trailing:g),y.cancel=function(){c!==i&&Ci(c),u=0,r=d=a=c=i},y.flush=function(){return c===i?l:x(Ta())},y}var Da=Qr((function(e,t){return hr(e,1,t)})),za=Qr((function(e,t,n){return hr(e,xs(t)||0,n)}));function Ra(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Me(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Ra.Cache||Zn),n}function Ha(e){if("function"!=typeof e)throw new Me(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ra.Cache=Zn;var Na=ki((function(e,t){var n=(t=1==t.length&&Ya(t[0])?At(t[0],$t(uo())):At(xr(t,1),$t(uo()))).length;return Qr((function(r){for(var i=-1,o=wn(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return Et(e,this,r)}))})),Ba=Qr((function(e,t){var n=dn(t,co(Ba));return Ji(e,c,i,t,n)})),Fa=Qr((function(e,t){var n=dn(t,co(Fa));return Ji(e,d,i,t,n)})),Ua=io((function(e,t){return Ji(e,h,i,i,i,t)}));function Wa(e,t){return e===t||e!=e&&t!=t}var Ka=Xi(Ir),Va=Xi((function(e,t){return e>=t})),Ga=Ar(function(){return arguments}())?Ar:function(e){return is(e)&&ze.call(e,"callee")&&!Ze.call(e,"callee")},Ya=r.isArray,Xa=xt?$t(xt):function(e){return is(e)&&jr(e)==P};function Za(e){return null!=e&&ns(e.length)&&!es(e)}function qa(e){return is(e)&&Za(e)}var $a=Ht||xl,Qa=yt?$t(yt):function(e){return is(e)&&jr(e)==w};function Ja(e){if(!is(e))return!1;var t=jr(e);return t==k||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ss(e)}function es(e){if(!rs(e))return!1;var t=jr(e);return t==_||t==C||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ts(e){return"number"==typeof e&&e==bs(e)}function ns(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=g}function rs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function is(e){return null!=e&&"object"==typeof e}var os=wt?$t(wt):function(e){return is(e)&&bo(e)==E};function as(e){return"number"==typeof e||is(e)&&jr(e)==S}function ss(e){if(!is(e)||jr(e)!=j)return!1;var t=Ye(e);if(null===t)return!0;var n=ze.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&De.call(n)==Be}var ls=kt?$t(kt):function(e){return is(e)&&jr(e)==T};var cs=_t?$t(_t):function(e){return is(e)&&bo(e)==M};function ds(e){return"string"==typeof e||!Ya(e)&&is(e)&&jr(e)==O}function us(e){return"symbol"==typeof e||is(e)&&jr(e)==L}var hs=Ct?$t(Ct):function(e){return is(e)&&ns(e.length)&&!!at[jr(e)]};var ps=Xi(Br),gs=Xi((function(e,t){return e<=t}));function ms(e){if(!e)return[];if(Za(e))return ds(e)?gn(e):Oi(e);if(et&&e[et])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[et]());var t=bo(e);return(t==E?ln:t==M?un:Ws)(e)}function fs(e){return e?(e=xs(e))===p||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function bs(e){var t=fs(e),n=t%1;return t==t?n?t-n:t:0}function vs(e){return e?cr(bs(e),0,f):0}function xs(e){if("number"==typeof e)return e;if(us(e))return m;if(rs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=rs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=qt(e);var n=be.test(e);return n||xe.test(e)?dt(e.slice(2),n?2:8):fe.test(e)?m:+e}function ys(e){return Li(e,Ds(e))}function ws(e){return null==e?"":ui(e)}var ks=Pi((function(e,t){if(So(t)||Za(t))Li(t,Ps(t),e);else for(var n in t)ze.call(t,n)&&rr(e,n,t[n])})),_s=Pi((function(e,t){Li(t,Ds(t),e)})),Cs=Pi((function(e,t,n,r){Li(t,Ds(t),e,r)})),Es=Pi((function(e,t,n,r){Li(t,Ps(t),e,r)})),Ss=io(lr);var js=Qr((function(e,t){e=je(e);var n=-1,r=t.length,o=r>2?t[2]:i;for(o&&ko(t[0],t[1],o)&&(r=1);++n<r;)for(var a=t[n],s=Ds(a),l=-1,c=s.length;++l<c;){var d=s[l],u=e[d];(u===i||Wa(u,Ae[d])&&!ze.call(e,d))&&(e[d]=a[d])}return e})),Is=Qr((function(e){return e.push(i,to),Et(Rs,i,e)}));function Ts(e,t,n){var r=null==e?i:Er(e,t);return r===i?n:r}function Ms(e,t){return null!=e&&vo(e,t,Mr)}var Os=Wi((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),e[t]=n}),rl(al)),Ls=Wi((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),ze.call(e,t)?e[t].push(n):e[t]=[n]}),uo),As=Qr(Lr);function Ps(e){return Za(e)?Qn(e):Hr(e)}function Ds(e){return Za(e)?Qn(e,!0):Nr(e)}var zs=Pi((function(e,t,n){Kr(e,t,n)})),Rs=Pi((function(e,t,n,r){Kr(e,t,n,r)})),Hs=io((function(e,t){var n={};if(null==e)return n;var r=!1;t=At(t,(function(t){return t=wi(t,e),r||(r=t.length>1),t})),Li(e,ao(e),n),r&&(n=dr(n,7,no));for(var i=t.length;i--;)pi(n,t[i]);return n}));var Ns=io((function(e,t){return null==e?{}:function(e,t){return Yr(e,t,(function(t,n){return Ms(e,n)}))}(e,t)}));function Bs(e,t){if(null==e)return{};var n=At(ao(e),(function(e){return[e]}));return t=uo(t),Yr(e,n,(function(e,n){return t(e,n[0])}))}var Fs=Qi(Ps),Us=Qi(Ds);function Ws(e){return null==e?[]:Qt(e,Ps(e))}var Ks=Hi((function(e,t,n){return t=t.toLowerCase(),e+(n?Vs(t):t)}));function Vs(e){return Js(ws(e).toLowerCase())}function Gs(e){return(e=ws(e))&&e.replace(we,rn).replace(Je,"")}var Ys=Hi((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Xs=Hi((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Zs=Ri("toLowerCase");var qs=Hi((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var $s=Hi((function(e,t,n){return e+(n?" ":"")+Js(t)}));var Qs=Hi((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Js=Ri("toUpperCase");function el(e,t,n){return e=ws(e),(t=n?i:t)===i?function(e){return rt.test(e)}(e)?function(e){return e.match(tt)||[]}(e):function(e){return e.match(ue)||[]}(e):e.match(t)||[]}var tl=Qr((function(e,t){try{return Et(e,i,t)}catch(e){return Ja(e)?e:new Ce(e)}})),nl=io((function(e,t){return jt(t,(function(t){t=Bo(t),sr(e,t,La(e[t],e))})),e}));function rl(e){return function(){return e}}var il=Fi(),ol=Fi(!0);function al(e){return e}function sl(e){return Rr("function"==typeof e?e:dr(e,1))}var ll=Qr((function(e,t){return function(n){return Lr(n,e,t)}})),cl=Qr((function(e,t){return function(n){return Lr(e,n,t)}}));function dl(e,t,n){var r=Ps(t),i=Cr(t,r);null!=n||rs(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=Cr(t,Ps(t)));var o=!(rs(n)&&"chain"in n&&!n.chain),a=es(e);return jt(i,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=Oi(this.__actions__);return i.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Pt([this.value()],arguments))})})),e}function ul(){}var hl=Vi(At),pl=Vi(Tt),gl=Vi(Rt);function ml(e){return _o(e)?Vt(Bo(e)):function(e){return function(t){return Er(t,e)}}(e)}var fl=Yi(),bl=Yi(!0);function vl(){return[]}function xl(){return!1}var yl=Ki((function(e,t){return e+t}),0),wl=qi("ceil"),kl=Ki((function(e,t){return e/t}),1),_l=qi("floor");var Cl,El=Ki((function(e,t){return e*t}),1),Sl=qi("round"),jl=Ki((function(e,t){return e-t}),0);return Un.after=function(e,t){if("function"!=typeof t)throw new Me(o);return e=bs(e),function(){if(--e<1)return t.apply(this,arguments)}},Un.ary=Ma,Un.assign=ks,Un.assignIn=_s,Un.assignInWith=Cs,Un.assignWith=Es,Un.at=Ss,Un.before=Oa,Un.bind=La,Un.bindAll=nl,Un.bindKey=Aa,Un.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ya(e)?e:[e]},Un.chain=ma,Un.chunk=function(e,t,n){t=(n?ko(e,t,n):t===i)?1:yn(bs(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var a=0,s=0,l=r(mt(o/t));a<o;)l[s++]=oi(e,a,a+=t);return l},Un.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i},Un.concat=function(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],i=e;i--;)t[i-1]=arguments[i];return Pt(Ya(n)?Oi(n):[n],xr(t,1))},Un.cond=function(e){var t=null==e?0:e.length,n=uo();return e=t?At(e,(function(e){if("function"!=typeof e[1])throw new Me(o);return[n(e[0]),e[1]]})):[],Qr((function(n){for(var r=-1;++r<t;){var i=e[r];if(Et(i[0],this,n))return Et(i[1],this,n)}}))},Un.conforms=function(e){return function(e){var t=Ps(e);return function(n){return ur(n,e,t)}}(dr(e,1))},Un.constant=rl,Un.countBy=va,Un.create=function(e,t){var n=Wn(e);return null==t?n:ar(n,t)},Un.curry=function e(t,n,r){var o=Ji(t,8,i,i,i,i,i,n=r?i:n);return o.placeholder=e.placeholder,o},Un.curryRight=function e(t,n,r){var o=Ji(t,l,i,i,i,i,i,n=r?i:n);return o.placeholder=e.placeholder,o},Un.debounce=Pa,Un.defaults=js,Un.defaultsDeep=Is,Un.defer=Da,Un.delay=za,Un.difference=Wo,Un.differenceBy=Ko,Un.differenceWith=Vo,Un.drop=function(e,t,n){var r=null==e?0:e.length;return r?oi(e,(t=n||t===i?1:bs(t))<0?0:t,r):[]},Un.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?oi(e,0,(t=r-(t=n||t===i?1:bs(t)))<0?0:t):[]},Un.dropRightWhile=function(e,t){return e&&e.length?mi(e,uo(t,3),!0,!0):[]},Un.dropWhile=function(e,t){return e&&e.length?mi(e,uo(t,3),!0):[]},Un.fill=function(e,t,n,r){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&ko(e,t,n)&&(n=0,r=o),function(e,t,n,r){var o=e.length;for((n=bs(n))<0&&(n=-n>o?0:o+n),(r=r===i||r>o?o:bs(r))<0&&(r+=o),r=n>r?0:vs(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},Un.filter=function(e,t){return(Ya(e)?Mt:vr)(e,uo(t,3))},Un.flatMap=function(e,t){return xr(Sa(e,t),1)},Un.flatMapDeep=function(e,t){return xr(Sa(e,t),p)},Un.flatMapDepth=function(e,t,n){return n=n===i?1:bs(n),xr(Sa(e,t),n)},Un.flatten=Xo,Un.flattenDeep=function(e){return(null==e?0:e.length)?xr(e,p):[]},Un.flattenDepth=function(e,t){return(null==e?0:e.length)?xr(e,t=t===i?1:bs(t)):[]},Un.flip=function(e){return Ji(e,512)},Un.flow=il,Un.flowRight=ol,Un.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},Un.functions=function(e){return null==e?[]:Cr(e,Ps(e))},Un.functionsIn=function(e){return null==e?[]:Cr(e,Ds(e))},Un.groupBy=_a,Un.initial=function(e){return(null==e?0:e.length)?oi(e,0,-1):[]},Un.intersection=qo,Un.intersectionBy=$o,Un.intersectionWith=Qo,Un.invert=Os,Un.invertBy=Ls,Un.invokeMap=Ca,Un.iteratee=sl,Un.keyBy=Ea,Un.keys=Ps,Un.keysIn=Ds,Un.map=Sa,Un.mapKeys=function(e,t){var n={};return t=uo(t,3),kr(e,(function(e,r,i){sr(n,t(e,r,i),e)})),n},Un.mapValues=function(e,t){var n={};return t=uo(t,3),kr(e,(function(e,r,i){sr(n,r,t(e,r,i))})),n},Un.matches=function(e){return Ur(dr(e,1))},Un.matchesProperty=function(e,t){return Wr(e,dr(t,1))},Un.memoize=Ra,Un.merge=zs,Un.mergeWith=Rs,Un.method=ll,Un.methodOf=cl,Un.mixin=dl,Un.negate=Ha,Un.nthArg=function(e){return e=bs(e),Qr((function(t){return Vr(t,e)}))},Un.omit=Hs,Un.omitBy=function(e,t){return Bs(e,Ha(uo(t)))},Un.once=function(e){return Oa(2,e)},Un.orderBy=function(e,t,n,r){return null==e?[]:(Ya(t)||(t=null==t?[]:[t]),Ya(n=r?i:n)||(n=null==n?[]:[n]),Gr(e,t,n))},Un.over=hl,Un.overArgs=Na,Un.overEvery=pl,Un.overSome=gl,Un.partial=Ba,Un.partialRight=Fa,Un.partition=ja,Un.pick=Ns,Un.pickBy=Bs,Un.property=ml,Un.propertyOf=function(e){return function(t){return null==e?i:Er(e,t)}},Un.pull=ea,Un.pullAll=ta,Un.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Xr(e,t,uo(n,2)):e},Un.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Xr(e,t,i,n):e},Un.pullAt=na,Un.range=fl,Un.rangeRight=bl,Un.rearg=Ua,Un.reject=function(e,t){return(Ya(e)?Mt:vr)(e,Ha(uo(t,3)))},Un.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=uo(t,3);++r<o;){var a=e[r];t(a,r,e)&&(n.push(a),i.push(r))}return Zr(e,i),n},Un.rest=function(e,t){if("function"!=typeof e)throw new Me(o);return Qr(e,t=t===i?t:bs(t))},Un.reverse=ra,Un.sampleSize=function(e,t,n){return t=(n?ko(e,t,n):t===i)?1:bs(t),(Ya(e)?er:ei)(e,t)},Un.set=function(e,t,n){return null==e?e:ti(e,t,n)},Un.setWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:ti(e,t,n,r)},Un.shuffle=function(e){return(Ya(e)?tr:ii)(e)},Un.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&ko(e,t,n)?(t=0,n=r):(t=null==t?0:bs(t),n=n===i?r:bs(n)),oi(e,t,n)):[]},Un.sortBy=Ia,Un.sortedUniq=function(e){return e&&e.length?ci(e):[]},Un.sortedUniqBy=function(e,t){return e&&e.length?ci(e,uo(t,2)):[]},Un.split=function(e,t,n){return n&&"number"!=typeof n&&ko(e,t,n)&&(t=n=i),(n=n===i?f:n>>>0)?(e=ws(e))&&("string"==typeof t||null!=t&&!ls(t))&&!(t=ui(t))&&sn(e)?_i(gn(e),0,n):e.split(t,n):[]},Un.spread=function(e,t){if("function"!=typeof e)throw new Me(o);return t=null==t?0:yn(bs(t),0),Qr((function(n){var r=n[t],i=_i(n,0,t);return r&&Pt(i,r),Et(e,this,i)}))},Un.tail=function(e){var t=null==e?0:e.length;return t?oi(e,1,t):[]},Un.take=function(e,t,n){return e&&e.length?oi(e,0,(t=n||t===i?1:bs(t))<0?0:t):[]},Un.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?oi(e,(t=r-(t=n||t===i?1:bs(t)))<0?0:t,r):[]},Un.takeRightWhile=function(e,t){return e&&e.length?mi(e,uo(t,3),!1,!0):[]},Un.takeWhile=function(e,t){return e&&e.length?mi(e,uo(t,3)):[]},Un.tap=function(e,t){return t(e),e},Un.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new Me(o);return rs(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Pa(e,t,{leading:r,maxWait:t,trailing:i})},Un.thru=fa,Un.toArray=ms,Un.toPairs=Fs,Un.toPairsIn=Us,Un.toPath=function(e){return Ya(e)?At(e,Bo):us(e)?[e]:Oi(No(ws(e)))},Un.toPlainObject=ys,Un.transform=function(e,t,n){var r=Ya(e),i=r||$a(e)||hs(e);if(t=uo(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:rs(e)&&es(o)?Wn(Ye(e)):{}}return(i?jt:kr)(e,(function(e,r,i){return t(n,e,r,i)})),n},Un.unary=function(e){return Ma(e,1)},Un.union=ia,Un.unionBy=oa,Un.unionWith=aa,Un.uniq=function(e){return e&&e.length?hi(e):[]},Un.uniqBy=function(e,t){return e&&e.length?hi(e,uo(t,2)):[]},Un.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?hi(e,i,t):[]},Un.unset=function(e,t){return null==e||pi(e,t)},Un.unzip=sa,Un.unzipWith=la,Un.update=function(e,t,n){return null==e?e:gi(e,t,yi(n))},Un.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:gi(e,t,yi(n),r)},Un.values=Ws,Un.valuesIn=function(e){return null==e?[]:Qt(e,Ds(e))},Un.without=ca,Un.words=el,Un.wrap=function(e,t){return Ba(yi(t),e)},Un.xor=da,Un.xorBy=ua,Un.xorWith=ha,Un.zip=pa,Un.zipObject=function(e,t){return vi(e||[],t||[],rr)},Un.zipObjectDeep=function(e,t){return vi(e||[],t||[],ti)},Un.zipWith=ga,Un.entries=Fs,Un.entriesIn=Us,Un.extend=_s,Un.extendWith=Cs,dl(Un,Un),Un.add=yl,Un.attempt=tl,Un.camelCase=Ks,Un.capitalize=Vs,Un.ceil=wl,Un.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=xs(n))==n?n:0),t!==i&&(t=(t=xs(t))==t?t:0),cr(xs(e),t,n)},Un.clone=function(e){return dr(e,4)},Un.cloneDeep=function(e){return dr(e,5)},Un.cloneDeepWith=function(e,t){return dr(e,5,t="function"==typeof t?t:i)},Un.cloneWith=function(e,t){return dr(e,4,t="function"==typeof t?t:i)},Un.conformsTo=function(e,t){return null==t||ur(e,t,Ps(t))},Un.deburr=Gs,Un.defaultTo=function(e,t){return null==e||e!=e?t:e},Un.divide=kl,Un.endsWith=function(e,t,n){e=ws(e),t=ui(t);var r=e.length,o=n=n===i?r:cr(bs(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},Un.eq=Wa,Un.escape=function(e){return(e=ws(e))&&$.test(e)?e.replace(Z,on):e},Un.escapeRegExp=function(e){return(e=ws(e))&&oe.test(e)?e.replace(ie,"\\$&"):e},Un.every=function(e,t,n){var r=Ya(e)?Tt:fr;return n&&ko(e,t,n)&&(t=i),r(e,uo(t,3))},Un.find=xa,Un.findIndex=Go,Un.findKey=function(e,t){return Nt(e,uo(t,3),kr)},Un.findLast=ya,Un.findLastIndex=Yo,Un.findLastKey=function(e,t){return Nt(e,uo(t,3),_r)},Un.floor=_l,Un.forEach=wa,Un.forEachRight=ka,Un.forIn=function(e,t){return null==e?e:yr(e,uo(t,3),Ds)},Un.forInRight=function(e,t){return null==e?e:wr(e,uo(t,3),Ds)},Un.forOwn=function(e,t){return e&&kr(e,uo(t,3))},Un.forOwnRight=function(e,t){return e&&_r(e,uo(t,3))},Un.get=Ts,Un.gt=Ka,Un.gte=Va,Un.has=function(e,t){return null!=e&&vo(e,t,Tr)},Un.hasIn=Ms,Un.head=Zo,Un.identity=al,Un.includes=function(e,t,n,r){e=Za(e)?e:Ws(e),n=n&&!r?bs(n):0;var i=e.length;return n<0&&(n=yn(i+n,0)),ds(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Ft(e,t,n)>-1},Un.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:bs(n);return i<0&&(i=yn(r+i,0)),Ft(e,t,i)},Un.inRange=function(e,t,n){return t=fs(t),n===i?(n=t,t=0):n=fs(n),function(e,t,n){return e>=wn(t,n)&&e<yn(t,n)}(e=xs(e),t,n)},Un.invoke=As,Un.isArguments=Ga,Un.isArray=Ya,Un.isArrayBuffer=Xa,Un.isArrayLike=Za,Un.isArrayLikeObject=qa,Un.isBoolean=function(e){return!0===e||!1===e||is(e)&&jr(e)==y},Un.isBuffer=$a,Un.isDate=Qa,Un.isElement=function(e){return is(e)&&1===e.nodeType&&!ss(e)},Un.isEmpty=function(e){if(null==e)return!0;if(Za(e)&&(Ya(e)||"string"==typeof e||"function"==typeof e.splice||$a(e)||hs(e)||Ga(e)))return!e.length;var t=bo(e);if(t==E||t==M)return!e.size;if(So(e))return!Hr(e).length;for(var n in e)if(ze.call(e,n))return!1;return!0},Un.isEqual=function(e,t){return Pr(e,t)},Un.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:i)?n(e,t):i;return r===i?Pr(e,t,i,n):!!r},Un.isError=Ja,Un.isFinite=function(e){return"number"==typeof e&&Gt(e)},Un.isFunction=es,Un.isInteger=ts,Un.isLength=ns,Un.isMap=os,Un.isMatch=function(e,t){return e===t||Dr(e,t,po(t))},Un.isMatchWith=function(e,t,n){return n="function"==typeof n?n:i,Dr(e,t,po(t),n)},Un.isNaN=function(e){return as(e)&&e!=+e},Un.isNative=function(e){if(Eo(e))throw new Ce("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return zr(e)},Un.isNil=function(e){return null==e},Un.isNull=function(e){return null===e},Un.isNumber=as,Un.isObject=rs,Un.isObjectLike=is,Un.isPlainObject=ss,Un.isRegExp=ls,Un.isSafeInteger=function(e){return ts(e)&&e>=-9007199254740991&&e<=g},Un.isSet=cs,Un.isString=ds,Un.isSymbol=us,Un.isTypedArray=hs,Un.isUndefined=function(e){return e===i},Un.isWeakMap=function(e){return is(e)&&bo(e)==A},Un.isWeakSet=function(e){return is(e)&&"[object WeakSet]"==jr(e)},Un.join=function(e,t){return null==e?"":vn.call(e,t)},Un.kebabCase=Ys,Un.last=Jo,Un.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=bs(n))<0?yn(r+o,0):wn(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):Bt(e,Wt,o,!0)},Un.lowerCase=Xs,Un.lowerFirst=Zs,Un.lt=ps,Un.lte=gs,Un.max=function(e){return e&&e.length?br(e,al,Ir):i},Un.maxBy=function(e,t){return e&&e.length?br(e,uo(t,2),Ir):i},Un.mean=function(e){return Kt(e,al)},Un.meanBy=function(e,t){return Kt(e,uo(t,2))},Un.min=function(e){return e&&e.length?br(e,al,Br):i},Un.minBy=function(e,t){return e&&e.length?br(e,uo(t,2),Br):i},Un.stubArray=vl,Un.stubFalse=xl,Un.stubObject=function(){return{}},Un.stubString=function(){return""},Un.stubTrue=function(){return!0},Un.multiply=El,Un.nth=function(e,t){return e&&e.length?Vr(e,bs(t)):i},Un.noConflict=function(){return pt._===this&&(pt._=Fe),this},Un.noop=ul,Un.now=Ta,Un.pad=function(e,t,n){e=ws(e);var r=(t=bs(t))?pn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Gi(bt(i),n)+e+Gi(mt(i),n)},Un.padEnd=function(e,t,n){e=ws(e);var r=(t=bs(t))?pn(e):0;return t&&r<t?e+Gi(t-r,n):e},Un.padStart=function(e,t,n){e=ws(e);var r=(t=bs(t))?pn(e):0;return t&&r<t?Gi(t-r,n)+e:e},Un.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),_n(ws(e).replace(ae,""),t||0)},Un.random=function(e,t,n){if(n&&"boolean"!=typeof n&&ko(e,t,n)&&(t=n=i),n===i&&("boolean"==typeof t?(n=t,t=i):"boolean"==typeof e&&(n=e,e=i)),e===i&&t===i?(e=0,t=1):(e=fs(e),t===i?(t=e,e=0):t=fs(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var o=Cn();return wn(e+o*(t-e+ct("1e-"+((o+"").length-1))),t)}return qr(e,t)},Un.reduce=function(e,t,n){var r=Ya(e)?Dt:Yt,i=arguments.length<3;return r(e,uo(t,4),n,i,gr)},Un.reduceRight=function(e,t,n){var r=Ya(e)?zt:Yt,i=arguments.length<3;return r(e,uo(t,4),n,i,mr)},Un.repeat=function(e,t,n){return t=(n?ko(e,t,n):t===i)?1:bs(t),$r(ws(e),t)},Un.replace=function(){var e=arguments,t=ws(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Un.result=function(e,t,n){var r=-1,o=(t=wi(t,e)).length;for(o||(o=1,e=i);++r<o;){var a=null==e?i:e[Bo(t[r])];a===i&&(r=o,a=n),e=es(a)?a.call(e):a}return e},Un.round=Sl,Un.runInContext=e,Un.sample=function(e){return(Ya(e)?Jn:Jr)(e)},Un.size=function(e){if(null==e)return 0;if(Za(e))return ds(e)?pn(e):e.length;var t=bo(e);return t==E||t==M?e.size:Hr(e).length},Un.snakeCase=qs,Un.some=function(e,t,n){var r=Ya(e)?Rt:ai;return n&&ko(e,t,n)&&(t=i),r(e,uo(t,3))},Un.sortedIndex=function(e,t){return si(e,t)},Un.sortedIndexBy=function(e,t,n){return li(e,t,uo(n,2))},Un.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=si(e,t);if(r<n&&Wa(e[r],t))return r}return-1},Un.sortedLastIndex=function(e,t){return si(e,t,!0)},Un.sortedLastIndexBy=function(e,t,n){return li(e,t,uo(n,2),!0)},Un.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var n=si(e,t,!0)-1;if(Wa(e[n],t))return n}return-1},Un.startCase=$s,Un.startsWith=function(e,t,n){return e=ws(e),n=null==n?0:cr(bs(n),0,e.length),t=ui(t),e.slice(n,n+t.length)==t},Un.subtract=jl,Un.sum=function(e){return e&&e.length?Xt(e,al):0},Un.sumBy=function(e,t){return e&&e.length?Xt(e,uo(t,2)):0},Un.template=function(e,t,n){var r=Un.templateSettings;n&&ko(e,t,n)&&(t=i),e=ws(e),t=Cs({},t,r,eo);var o,a,s=Cs({},t.imports,r.imports,eo),l=Ps(s),c=Qt(s,l),d=0,u=t.interpolate||ke,h="__p += '",p=Ie((t.escape||ke).source+"|"+u.source+"|"+(u===ee?ge:ke).source+"|"+(t.evaluate||ke).source+"|$","g"),g="//# sourceURL="+(ze.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ot+"]")+"\n";e.replace(p,(function(t,n,r,i,s,l){return r||(r=i),h+=e.slice(d,l).replace(_e,an),n&&(o=!0,h+="' +\n__e("+n+") +\n'"),s&&(a=!0,h+="';\n"+s+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),d=l+t.length,t})),h+="';\n";var m=ze.call(t,"variable")&&t.variable;if(m){if(he.test(m))throw new Ce("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(a?h.replace(V,""):h).replace(G,"$1").replace(Y,"$1;"),h="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var f=tl((function(){return Ee(l,g+"return "+h).apply(i,c)}));if(f.source=h,Ja(f))throw f;return f},Un.times=function(e,t){if((e=bs(e))<1||e>g)return[];var n=f,r=wn(e,f);t=uo(t),e-=f;for(var i=Zt(r,t);++n<e;)t(n);return i},Un.toFinite=fs,Un.toInteger=bs,Un.toLength=vs,Un.toLower=function(e){return ws(e).toLowerCase()},Un.toNumber=xs,Un.toSafeInteger=function(e){return e?cr(bs(e),-9007199254740991,g):0===e?e:0},Un.toString=ws,Un.toUpper=function(e){return ws(e).toUpperCase()},Un.trim=function(e,t,n){if((e=ws(e))&&(n||t===i))return qt(e);if(!e||!(t=ui(t)))return e;var r=gn(e),o=gn(t);return _i(r,en(r,o),tn(r,o)+1).join("")},Un.trimEnd=function(e,t,n){if((e=ws(e))&&(n||t===i))return e.slice(0,mn(e)+1);if(!e||!(t=ui(t)))return e;var r=gn(e);return _i(r,0,tn(r,gn(t))+1).join("")},Un.trimStart=function(e,t,n){if((e=ws(e))&&(n||t===i))return e.replace(ae,"");if(!e||!(t=ui(t)))return e;var r=gn(e);return _i(r,en(r,gn(t))).join("")},Un.truncate=function(e,t){var n=30,r="...";if(rs(t)){var o="separator"in t?t.separator:o;n="length"in t?bs(t.length):n,r="omission"in t?ui(t.omission):r}var a=(e=ws(e)).length;if(sn(e)){var s=gn(e);a=s.length}if(n>=a)return e;var l=n-pn(r);if(l<1)return r;var c=s?_i(s,0,l).join(""):e.slice(0,l);if(o===i)return c+r;if(s&&(l+=c.length-l),ls(o)){if(e.slice(l).search(o)){var d,u=c;for(o.global||(o=Ie(o.source,ws(me.exec(o))+"g")),o.lastIndex=0;d=o.exec(u);)var h=d.index;c=c.slice(0,h===i?l:h)}}else if(e.indexOf(ui(o),l)!=l){var p=c.lastIndexOf(o);p>-1&&(c=c.slice(0,p))}return c+r},Un.unescape=function(e){return(e=ws(e))&&q.test(e)?e.replace(X,fn):e},Un.uniqueId=function(e){var t=++Re;return ws(e)+t},Un.upperCase=Qs,Un.upperFirst=Js,Un.each=wa,Un.eachRight=ka,Un.first=Zo,dl(Un,(Cl={},kr(Un,(function(e,t){ze.call(Un.prototype,t)||(Cl[t]=e)})),Cl),{chain:!1}),Un.VERSION="4.17.21",jt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Un[e].placeholder=Un})),jt(["drop","take"],(function(e,t){Gn.prototype[e]=function(n){n=n===i?1:yn(bs(n),0);var r=this.__filtered__&&!t?new Gn(this):this.clone();return r.__filtered__?r.__takeCount__=wn(n,r.__takeCount__):r.__views__.push({size:wn(n,f),type:e+(r.__dir__<0?"Right":"")}),r},Gn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),jt(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Gn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:uo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),jt(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Gn.prototype[e]=function(){return this[n](1).value()[0]}})),jt(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Gn.prototype[e]=function(){return this.__filtered__?new Gn(this):this[n](1)}})),Gn.prototype.compact=function(){return this.filter(al)},Gn.prototype.find=function(e){return this.filter(e).head()},Gn.prototype.findLast=function(e){return this.reverse().find(e)},Gn.prototype.invokeMap=Qr((function(e,t){return"function"==typeof e?new Gn(this):this.map((function(n){return Lr(n,e,t)}))})),Gn.prototype.reject=function(e){return this.filter(Ha(uo(e)))},Gn.prototype.slice=function(e,t){e=bs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Gn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=bs(t))<0?n.dropRight(-t):n.take(t-e)),n)},Gn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Gn.prototype.toArray=function(){return this.take(f)},kr(Gn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=Un[r?"take"+("last"==t?"Right":""):t],a=r||/^find/.test(t);o&&(Un.prototype[t]=function(){var t=this.__wrapped__,s=r?[1]:arguments,l=t instanceof Gn,c=s[0],d=l||Ya(t),u=function(e){var t=o.apply(Un,Pt([e],s));return r&&h?t[0]:t};d&&n&&"function"==typeof c&&1!=c.length&&(l=d=!1);var h=this.__chain__,p=!!this.__actions__.length,g=a&&!h,m=l&&!p;if(!a&&d){t=m?t:new Gn(this);var f=e.apply(t,s);return f.__actions__.push({func:fa,args:[u],thisArg:i}),new Vn(f,h)}return g&&m?e.apply(this,s):(f=this.thru(u),g?r?f.value()[0]:f.value():f)})})),jt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Oe[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Un.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ya(i)?i:[],e)}return this[n]((function(n){return t.apply(Ya(n)?n:[],e)}))}})),kr(Gn.prototype,(function(e,t){var n=Un[t];if(n){var r=n.name+"";ze.call(An,r)||(An[r]=[]),An[r].push({name:t,func:n})}})),An[Ui(i,2).name]=[{name:"wrapper",func:i}],Gn.prototype.clone=function(){var e=new Gn(this.__wrapped__);return e.__actions__=Oi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Oi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Oi(this.__views__),e},Gn.prototype.reverse=function(){if(this.__filtered__){var e=new Gn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Gn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ya(e),r=t<0,i=n?e.length:0,o=function(e,t,n){var r=-1,i=n.length;for(;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=wn(t,e+a);break;case"takeRight":e=yn(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,s=o.end,l=s-a,c=r?s:a-1,d=this.__iteratees__,u=d.length,h=0,p=wn(l,this.__takeCount__);if(!n||!r&&i==l&&p==l)return fi(e,this.__actions__);var g=[];e:for(;l--&&h<p;){for(var m=-1,f=e[c+=t];++m<u;){var b=d[m],v=b.iteratee,x=b.type,y=v(f);if(2==x)f=y;else if(!y){if(1==x)continue e;break e}}g[h++]=f}return g},Un.prototype.at=ba,Un.prototype.chain=function(){return ma(this)},Un.prototype.commit=function(){return new Vn(this.value(),this.__chain__)},Un.prototype.next=function(){this.__values__===i&&(this.__values__=ms(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Un.prototype.plant=function(e){for(var t,n=this;n instanceof Kn;){var r=Uo(n);r.__index__=0,r.__values__=i,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},Un.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Gn){var t=e;return this.__actions__.length&&(t=new Gn(this)),(t=t.reverse()).__actions__.push({func:fa,args:[ra],thisArg:i}),new Vn(t,this.__chain__)}return this.thru(ra)},Un.prototype.toJSON=Un.prototype.valueOf=Un.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},Un.prototype.first=Un.prototype.head,et&&(Un.prototype[et]=function(){return this}),Un}();pt._=bn,(r=function(){return bn}.call(t,n,t,e))===i||(e.exports=r)}.call(this)},4516:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function i(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,o){for(var a,s,l=i(e),c=1;c<arguments.length;c++){for(var d in a=Object(arguments[c]))n.call(a,d)&&(l[d]=a[d]);if(t){s=t(a);for(var u=0;u<s.length;u++)r.call(a,s[u])&&(l[s[u]]=a[s[u]])}}return l}},6094:(e,t,n)=>{"use strict";n(4516);var r=n(9787),i=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var o=Symbol.for;i=o("react.element"),t.Fragment=o("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,o={},c=null,d=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(d=t.ref),t)s.call(t,r)&&!l.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:i,type:e,key:c,ref:d,props:o,_owner:a.current}}t.jsx=c,t.jsxs=c},4512:(e,t,n)=>{"use strict";e.exports=n(6094)},8336:(e,t,n)=>{var r=n(487),i=n(4295);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},554:(e,t,n)=>{var r=n(487),i=n(9135);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},2789:(e,t,n)=>{var r=n(487),i=n(3729);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},5080:(e,t,n)=>{var r=n(487),i=n(4241);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},7225:(e,t,n)=>{var r=n(487),i=n(6029);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},778:(e,t,n)=>{var r=n(487),i=n(9609);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},4220:(e,t,n)=>{var r=n(487),i=n(2345);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},4678:(e,t,n)=>{var r=n(487),i=n(9393);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},1292:(e,t,n)=>{var r=n(487),i=n(6578);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},196:(e,t,n)=>{var r=n(487),i=n(9482);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},2205:(e,t,n)=>{var r=n(487),i=n(7955);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},1310:(e,t,n)=>{var r=n(487),i=n(3195);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},3922:(e,t,n)=>{var r=n(487),i=n(2978);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},7096:(e,t,n)=>{var r=n(487),i=n(1587);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},7117:(e,t,n)=>{var r=n(487),i=n(9478);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},1106:(e,t,n)=>{var r=n(487),i=n(7369);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},3336:(e,t,n)=>{var r=n(487),i=n(1434);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},4406:(e,t,n)=>{var r=n(487),i=n(8923);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},6043:(e,t,n)=>{var r=n(487),i=n(5605);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},694:(e,t,n)=>{var r=n(487),i=n(5644);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},8328:(e,t,n)=>{var r=n(487),i=n(6843);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},8051:(e,t,n)=>{var r=n(487),i=n(8461);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},4301:(e,t,n)=>{var r=n(487),i=n(9935);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},9966:(e,t,n)=>{var r=n(487),i=n(532);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},9295:(e,t,n)=>{var r=n(487),i=n(7589);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},9781:(e,t,n)=>{var r=n(487),i=n(8465);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},371:(e,t,n)=>{var r=n(487),i=n(5892);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},4623:(e,t,n)=>{var r=n(487),i=n(3874);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},1528:(e,t,n)=>{var r=n(487),i=n(2681);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},518:(e,t,n)=>{var r=n(487),i=n(6759);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},9757:(e,t,n)=>{var r=n(487),i=n(9650);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},5422:(e,t,n)=>{var r=n(487),i=n(2044);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},276:(e,t,n)=>{var r=n(487),i=n(9144);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},6781:(e,t,n)=>{var r=n(487),i=n(6626);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},580:(e,t,n)=>{var r=n(487),i=n(6359);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},4285:(e,t,n)=>{var r=n(487),i=n(9915);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},3313:(e,t,n)=>{var r=n(487),i=n(9310);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},8635:(e,t,n)=>{var r=n(487),i=n(6464);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},4404:(e,t,n)=>{var r=n(487),i=n(5260);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},487:(e,t,n)=>{"use strict";var r,i=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},o=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),a=[];function s(e){for(var t=-1,n=0;n<a.length;n++)if(a[n].identifier===e){t=n;break}return t}function l(e,t){for(var n={},r=[],i=0;i<e.length;i++){var o=e[i],l=t.base?o[0]+t.base:o[0],c=n[l]||0,d="".concat(l," ").concat(c);n[l]=c+1;var u=s(d),h={css:o[1],media:o[2],sourceMap:o[3]};-1!==u?(a[u].references++,a[u].updater(h)):a.push({identifier:d,updater:f(h,t),references:1}),r.push(d)}return r}function c(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var i=n.nc;i&&(r.nonce=i)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var a=o(e.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(t)}return t}var d,u=(d=[],function(e,t){return d[e]=t,d.filter(Boolean).join("\n")});function h(e,t,n,r){var i=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=u(t,i);else{var o=document.createTextNode(i),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(o,a[t]):e.appendChild(o)}}function p(e,t,n){var r=n.css,i=n.media,o=n.sourceMap;if(i?e.setAttribute("media",i):e.removeAttribute("media"),o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var g=null,m=0;function f(e,t){var n,r,i;if(t.singleton){var o=m++;n=g||(g=c(t)),r=h.bind(null,n,o,!1),i=h.bind(null,n,o,!0)}else n=c(t),r=p.bind(null,n,t),i=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 i()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=i());var n=l(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 i=s(n[r]);a[i].references--}for(var o=l(e,t),c=0;c<n.length;c++){var d=s(n[c]);0===a[d].references&&(a[d].updater(),a.splice(d,1))}n=o}}}},4295:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>g});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o),s=n(1667),l=n.n(s),c=new URL(n(3940),n.b),d=new URL(n(3147),n.b),u=a()(i()),h=l()(c),p=l()(d);u.push([e.id,'@font-face{font-family:"Virgil";src:url('+h+');font-display:swap}@font-face{font-family:"Cascadia";src:url('+p+");font-display:swap}",""]);const g=u},9135:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .ActiveFile .ActiveFile__fileName{display:flex;align-items:center}.excalidraw .ActiveFile .ActiveFile__fileName span{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:9.3em}.excalidraw .ActiveFile .ActiveFile__fileName svg{width:1.15em;margin-inline-end:.3em;transform:scaleY(0.9)}",""]);const s=a},3729:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Avatar{width:2.5rem;height:2.5rem;border-radius:50%;display:flex;justify-content:center;align-items:center;color:#fff;cursor:pointer;font-size:.8rem;font-weight:500;overflow:hidden}.excalidraw .Avatar img{width:100%;height:100%}",""]);const s=a},4241:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Card{display:flex;flex-direction:column;align-items:center;max-width:290px;margin:1em;text-align:center}.excalidraw .Card .Card-icon{font-size:2.6em;display:flex;flex:0 0 auto;padding:1.4rem;border-radius:50%;background:var(--card-color);color:#fff}.excalidraw .Card .Card-icon svg{width:2.8rem;height:2.8rem}.excalidraw .Card .Card-details{font-size:.96em;min-height:90px;padding:0 1em;margin-bottom:auto}.excalidraw .Card .Card-button.ToolIcon_type_button{height:2.5rem;margin-top:1em;margin-bottom:.3em;background-color:var(--card-color)}.excalidraw .Card .Card-button.ToolIcon_type_button:hover{background-color:var(--card-color-darker)}.excalidraw .Card .Card-button.ToolIcon_type_button:active{background-color:var(--card-color-darkest)}.excalidraw .Card .Card-button.ToolIcon_type_button .ToolIcon__label{color:#fff}.excalidraw .Card .Card-button.ToolIcon_type_button .Spinner{--spinner-color: #fff}",""]);const s=a},6029:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Checkbox{margin:4px .3em;display:flex;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.excalidraw .Checkbox:hover:not(.is-checked) .Checkbox-box:not(:focus){box-shadow:0 0 0 2px #4dabf7}.excalidraw .Checkbox:hover:not(.is-checked) .Checkbox-box:not(:focus) svg{display:block;opacity:.3}.excalidraw .Checkbox:active .Checkbox-box{box-shadow:0 0 2px 1px inset #1c7ed6 !important}.excalidraw .Checkbox:hover .Checkbox-box{background-color:rgba(208,235,255,.2)}.excalidraw .Checkbox.is-checked .Checkbox-box{background-color:#d0ebff}.excalidraw .Checkbox.is-checked .Checkbox-box svg{display:block}.excalidraw .Checkbox.is-checked:hover .Checkbox-box{background-color:#a5d8ff}.excalidraw .Checkbox .Checkbox-box{width:22px;height:22px;padding:0;flex:0 0 auto;margin:0 1em;display:flex;align-items:center;justify-content:center;box-shadow:0 0 0 2px #1c7ed6;background-color:transparent;border-radius:4px;color:#1c7ed6}.excalidraw .Checkbox .Checkbox-box:focus{box-shadow:0 0 0 3px #1c7ed6}.excalidraw .Checkbox .Checkbox-box svg{display:none;width:16px;height:16px;stroke-width:3px}.excalidraw .Checkbox .Checkbox-label{display:flex;align-items:center}.excalidraw .Checkbox .excalidraw-tooltip-icon{width:1em;height:1em}",""]);const s=a},9609:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .CollabButton.is-collaborating{background-color:var(--button-special-active-bg-color)}.excalidraw .CollabButton.is-collaborating .ToolIcon__icon svg,.excalidraw .CollabButton.is-collaborating .ToolIcon__label{color:var(--icon-green-fill-color)}.excalidraw .CollabButton-collaborators{min-width:1em;position:absolute;bottom:-5px;padding:3px;border-radius:50%;background-color:#40c057;color:#fff;font-size:.7em;font-family:var(--ui-font)}:root[dir=ltr] .excalidraw .CollabButton-collaborators{right:-5px}:root[dir=rtl] .excalidraw .CollabButton-collaborators{left:-5px}",""]);const s=a},2345:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>h});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o),s=n(1667),l=n.n(s),c=new URL(n(9669),n.b),d=a()(i()),u=l()(c);d.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--default{padding:.5rem;display:grid;grid-template-columns:repeat(5, auto);grid-gap:.5rem;border-radius:4px}.excalidraw .color-picker-content--default:focus{outline:none;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .color-picker-content--canvas{display:flex;flex-direction:column;padding:.25rem}.excalidraw .color-picker-content--canvas-title{color:#868e96;font-size:12px;padding:0 .25rem}.excalidraw .color-picker-content--canvas-colors{padding:.5rem 0}.excalidraw .color-picker-content--canvas-colors .color-picker-swatch{margin:0 .25rem}.excalidraw .color-picker-content .color-input-container{grid-column:1/span 5}.excalidraw .color-picker-swatch{position:relative;height:1.875rem;width:1.875rem;cursor:pointer;border-radius:4px;margin:0;box-sizing:border-box;border:1px solid #ddd;background-color:currentColor !important;filter:var(--theme-filter)}.excalidraw .color-picker-swatch:focus{box-shadow:0 0 4px 1px currentColor;border-color:var(--select-highlight-color)}.excalidraw .color-picker-transparent{border-radius:4px;box-shadow:rgba(0,0,0,.1) 0 0 0 1px inset;position:absolute;top:0;right:0;bottom:0;left:0}.excalidraw .color-picker-transparent,.excalidraw .color-picker-label-swatch{background:url("+u+') left center}.excalidraw .color-picker-hash{background:var(--input-border-color);height:1.875rem;width:1.875rem;color:var(--input-label-color);display:flex;align-items:center;justify-content:center;position:relative}:root[dir=ltr] .excalidraw .color-picker-hash{border-radius:4px 0 0 4px}:root[dir=rtl] .excalidraw .color-picker-hash{border-radius:0 4px 4px 0}.excalidraw .color-input-container:focus-within .color-picker-hash{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .color-input-container:focus-within .color-picker-hash::before,.excalidraw .color-input-container:focus-within .color-picker-hash::after{content:"";width:1px;height:100%;position:absolute;top:0}.excalidraw .color-input-container:focus-within .color-picker-hash::before{background:var(--input-border-color)}:root[dir=ltr] .excalidraw .color-input-container:focus-within .color-picker-hash::before{right:-1px}:root[dir=rtl] .excalidraw .color-input-container:focus-within .color-picker-hash::before{left:-1px}.excalidraw .color-input-container:focus-within .color-picker-hash::after{background:var(--input-bg-color)}:root[dir=ltr] .excalidraw .color-input-container:focus-within .color-picker-hash::after{right:-2px}:root[dir=rtl] .excalidraw .color-input-container:focus-within .color-picker-hash::after{left:-2px}.excalidraw .color-input-container{display:flex}.excalidraw .color-picker-input{width:11ch;margin:0;font-size:1rem;background-color:var(--input-bg-color);color:var(--text-primary-color);border:0;outline:none;height:1.75em;box-shadow:var(--input-border-color) 0 0 0 1px inset;float:left;padding:1px;padding-inline-start:.5em;-webkit-appearance:none;appearance:none}:root[dir=ltr] .excalidraw .color-picker-input{border-radius:0 4px 4px 0}:root[dir=rtl] .excalidraw .color-picker-input{border-radius:4px 0 0 4px}.excalidraw .color-picker-label-swatch{height:1.875rem;width:1.875rem;margin-inline-end:.25rem;border:1px solid #dee2e6;position:relative;overflow:hidden;background-color:transparent !important;filter:var(--theme-filter)}.excalidraw .color-picker-label-swatch:after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;background:var(--swatch-color)}.excalidraw .color-picker-keybinding{position:absolute;bottom:2px;font-size:.7em}:root[dir=ltr] .excalidraw .color-picker-keybinding{right:2px}:root[dir=rtl] .excalidraw .color-picker-keybinding{left:2px}.excalidraw--mobile.excalidraw .color-picker-keybinding{display:none}.excalidraw .color-picker-type-canvasBackground .color-picker-keybinding{color:#aaa}.excalidraw .color-picker-type-elementBackground .color-picker-keybinding{color:#fff}.excalidraw .color-picker-swatch[aria-label=transparent] .color-picker-keybinding{color:#aaa}.excalidraw .color-picker-type-elementStroke .color-picker-keybinding{color:#d4d4d4}.excalidraw.theme--dark .color-picker-type-elementBackground .color-picker-keybinding{color:#000}.excalidraw.theme--dark .color-picker-swatch[aria-label=transparent] .color-picker-keybinding{color:#000}',""]);const h=d},9393:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .confirm-dialog-buttons{display:flex;padding:.2rem 0;justify-content:flex-end}.excalidraw .confirm-dialog .ToolIcon__icon{min-width:2.5rem;width:auto;font-size:1rem}.excalidraw .confirm-dialog .ToolIcon_type_button{margin-left:.8rem;padding:0 .5rem}.excalidraw .confirm-dialog__content{font-size:1rem}.excalidraw .confirm-dialog--confirm.ToolIcon_type_button{background-color:#fa5252}.excalidraw .confirm-dialog--confirm.ToolIcon_type_button:hover{background-color:#e03131}.excalidraw .confirm-dialog--confirm.ToolIcon_type_button .ToolIcon__icon{color:#fff}",""]);const s=a},6578:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,':export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .context-menu{position:relative;border-radius:4px;box-shadow:0 3px 10px rgba(0,0,0,.2);padding:0;list-style:none;-webkit-user-select:none;user-select:none;margin:-0.25rem 0 0 .125rem;padding:.5rem 0;background-color:var(--popup-secondary-bg-color);border:1px solid var(--button-gray-3);cursor:default}.excalidraw .context-menu button{color:var(--popup-text-color)}.excalidraw .context-menu-option{position:relative;width:100%;min-width:9.5rem;margin:0;padding:.25rem 1rem .25rem 1.25rem;text-align:start;border-radius:0;background-color:transparent;border:none;white-space:nowrap;display:grid;grid-template-columns:1fr .2fr;align-items:center}.excalidraw .context-menu-option.checkmark::before{position:absolute;left:6px;margin-bottom:1px;content:"✓"}.excalidraw .context-menu-option.dangerous .context-menu-option__label{color:#f03e3e}.excalidraw .context-menu-option .context-menu-option__label{justify-self:start;margin-inline-end:20px}.excalidraw .context-menu-option .context-menu-option__shortcut{justify-self:end;opacity:.6;font-family:inherit;font-size:.7rem}.excalidraw .context-menu-option:hover{color:var(--popup-bg-color);background-color:var(--select-highlight-color)}.excalidraw .context-menu-option:hover.dangerous{background-color:#fa5252}.excalidraw .context-menu-option:hover.dangerous .context-menu-option__label{color:var(--popup-bg-color)}.excalidraw .context-menu-option:focus{z-index:1}.excalidraw--mobile.excalidraw .context-menu-option{display:block}.excalidraw--mobile.excalidraw .context-menu-option .context-menu-option__label{margin-inline-end:0}.excalidraw--mobile.excalidraw .context-menu-option .context-menu-option__shortcut{display:none}.excalidraw .context-menu-option-separator{border:none;border-top:1px solid #adb5bd}',""]);const s=a},9482:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Dialog{-webkit-user-select:text;user-select:text;cursor:auto}.excalidraw .Dialog__title{display:grid;align-items:center;margin-top:0;grid-template-columns:1fr calc(var(--space-factor)*7);grid-gap:var(--metric);padding:calc(var(--space-factor)*2);text-align:center;font-variant:small-caps;font-size:1.2em}.excalidraw .Dialog__titleContent{flex:1}.excalidraw .Dialog .Modal__close{color:var(--icon-fill-color);margin:0}.excalidraw .Dialog__content{padding:0 16px 16px}.excalidraw--mobile.excalidraw .Dialog{--metric: calc(var(--space-factor) * 4);--inset-left: max(var(--metric), var(--sal));--inset-right: max(var(--metric), var(--sar))}.excalidraw--mobile.excalidraw .Dialog__title{grid-template-columns:calc(var(--space-factor)*7) 1fr calc(var(--space-factor)*7);position:-webkit-sticky;position:sticky;top:0;padding:calc(var(--space-factor)*2);background:var(--island-bg-color);font-size:1.25em;box-sizing:border-box;border-bottom:1px solid var(--button-gray-2);z-index:1}.excalidraw--mobile.excalidraw .Dialog__titleContent{text-align:center}.excalidraw--mobile.excalidraw .Dialog .Island{width:100vw;height:100%;box-sizing:border-box;overflow-y:auto;padding-left:max(calc(var(--padding) * var(--space-factor)), var(--sal));padding-right:max(calc(var(--padding) * var(--space-factor)), var(--sar));padding-bottom:max(calc(var(--padding) * var(--space-factor)), var(--sab))}.excalidraw--mobile.excalidraw .Dialog .Modal__close{order:-1}",""]);const s=a},7955:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>h});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o),s=n(1667),l=n.n(s),c=new URL(n(9669),n.b),d=a()(i()),u=l()(c);d.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .ExportDialog__preview{--preview-padding: calc(var(--space-factor) * 4);background:url("+u+") left center;text-align:center;padding:var(--preview-padding);margin-bottom:calc(var(--space-factor)*3)}.excalidraw .ExportDialog__preview canvas{max-width:calc(100% - var(--preview-padding)*2);max-height:25rem}.excalidraw.theme--dark .ExportDialog__preview canvas{filter:none}.excalidraw .ExportDialog__actions{width:100%;display:flex;grid-gap:calc(var(--space-factor)*2);align-items:top;justify-content:space-between}.excalidraw--mobile.excalidraw .ExportDialog{display:flex;flex-direction:column}.excalidraw--mobile.excalidraw .ExportDialog__actions{flex-direction:column;align-items:center}.excalidraw--mobile.excalidraw .ExportDialog__actions>*{margin-bottom:calc(var(--space-factor)*3)}.excalidraw--mobile.excalidraw .ExportDialog__preview canvas{max-height:30vh}.excalidraw--mobile.excalidraw .ExportDialog__dialog,.excalidraw--mobile.excalidraw .ExportDialog__dialog .Island{height:100%;box-sizing:border-box}.excalidraw--mobile.excalidraw .ExportDialog__dialog .Island{overflow-y:auto}.excalidraw .ExportDialog--json .ExportDialog-cards{display:grid;grid-template-columns:repeat(auto-fit, minmax(200px, 1fr));justify-items:center;row-gap:2em}@media(max-width: 460px){.excalidraw .ExportDialog--json .ExportDialog-cards{grid-template-columns:repeat(auto-fit, minmax(240px, 1fr))}.excalidraw .ExportDialog--json .ExportDialog-cards .Card-details{min-height:40px}}.excalidraw .ExportDialog--json .ExportDialog-cards .ProjectName{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;margin:1em auto;align-items:flex-start;flex-direction:column}.excalidraw .ExportDialog--json .ExportDialog-cards .ProjectName .TextInput{width:auto}.excalidraw .ExportDialog--json .ExportDialog-cards .ProjectName-label{margin:.625em 0;font-weight:bold}.excalidraw button.ExportDialog-imageExportButton{width:5rem;height:5rem;margin:0 .2em;border-radius:1rem;background-color:var(--button-color);box-shadow:0 3px 5px -1px rgba(0,0,0,.28),0 6px 10px 0 rgba(0,0,0,.14);font-family:Cascadia;font-size:1.8em;color:#fff}.excalidraw button.ExportDialog-imageExportButton:hover{background-color:var(--button-color-darker)}.excalidraw button.ExportDialog-imageExportButton:active{background-color:var(--button-color-darkest);box-shadow:none}.excalidraw button.ExportDialog-imageExportButton svg{width:.9em}",""]);const h=d},3195:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .FixedSideContainer{position:absolute;pointer-events:none}.excalidraw .FixedSideContainer>*{pointer-events:all}.excalidraw .FixedSideContainer_side_top{left:var(--space-factor);top:var(--space-factor);right:var(--space-factor);z-index:2}.excalidraw .FixedSideContainer_side_top.zen-mode{right:42px}",""]);const s=a},2978:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .HelpDialog h3{border-bottom:1px solid var(--button-gray-2);padding-bottom:4px}.excalidraw .HelpDialog--island{border:1px solid var(--button-gray-2);margin-bottom:16px}.excalidraw .HelpDialog--island-title{margin:0;padding:4px;background-color:var(--button-gray-1);text-align:center}.excalidraw .HelpDialog--shortcut{border-top:1px solid var(--button-gray-2)}.excalidraw .HelpDialog--key{word-break:keep-all;border:1px solid var(--button-gray-2);padding:2px 8px;margin:auto 4px;background-color:var(--button-gray-1);border-radius:2px;font-size:.8em;min-height:26px;box-sizing:border-box;display:flex;align-items:center;font-family:inherit}.excalidraw .HelpDialog--header{display:flex;flex-direction:row;justify-content:space-evenly;margin-bottom:32px;padding-bottom:16px}.excalidraw .HelpDialog--btn{border:1px solid var(--link-color);padding:8px 32px;border-radius:4px}.excalidraw .HelpDialog--btn:hover{text-decoration:none}",""]);const s=a},1587:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .HintViewer{pointer-events:none;box-sizing:border-box;position:absolute;display:flex;justify-content:center;left:0;top:100%;max-width:100%;width:100%;margin-top:6px;text-align:center;color:#868e96;font-size:.8rem}.excalidraw--mobile.excalidraw .HintViewer{position:static;padding-right:2em}.excalidraw .HintViewer>span{padding:.2rem .4rem;background-color:var(--overlay-bg-color);border-radius:4px}",""]);const s=a},9478:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,':export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .picker-container{display:inline-block;box-sizing:border-box;margin-right:.25rem}.excalidraw .picker{background:var(--popup-bg-color);border:0 solid rgba(255,255,255,.25);box-shadow:rgba(0,0,0,.25) 0 1px 4px;border-radius:4px;position:absolute}.excalidraw .picker-container button,.excalidraw .picker button{position:relative;display:flex;align-items:center;justify-content:center}.excalidraw .picker-container button:focus-visible,.excalidraw .picker button:focus-visible{outline:transparent;background-color:var(--button-gray-2)}.excalidraw .picker-container button:focus-visible svg,.excalidraw .picker button:focus-visible svg{opacity:1}.excalidraw .picker-container button:hover,.excalidraw .picker button:hover{background-color:var(--button-gray-2)}.excalidraw .picker-container button:active,.excalidraw .picker button:active{background-color:var(--button-gray-3)}.excalidraw .picker-container button:disabled,.excalidraw .picker button:disabled{cursor:not-allowed}.excalidraw .picker-container button svg,.excalidraw .picker button svg{margin:0;width:36px;height:18px;opacity:.6;pointer-events:none}.excalidraw .picker button{padding:.25rem .28rem .35rem .25rem}.excalidraw .picker-triangle{width:0;height:0;position:relative;top:-10px;z-index:10}:root[dir=ltr] .excalidraw .picker-triangle{left:12px}:root[dir=rtl] .excalidraw .picker-triangle{right:12px}.excalidraw .picker-triangle:before{content:"";position:absolute;border-style:solid;border-width:0 9px 10px;border-color:transparent transparent rgba(0,0,0,.1);top:-1px}.excalidraw .picker-triangle:after{content:"";position:absolute;border-style:solid;border-width:0 9px 10px;border-color:transparent transparent var(--popup-bg-color)}.excalidraw .picker-content{padding:.5rem;display:grid;grid-template-columns:repeat(3, auto);grid-gap:.5rem;border-radius:4px}:root[dir=rtl] .excalidraw .picker-content{padding:.4rem}.excalidraw .picker-keybinding{position:absolute;bottom:2px;font-size:.7em;color:var(--keybinding-color)}:root[dir=ltr] .excalidraw .picker-keybinding{right:2px}:root[dir=rtl] .excalidraw .picker-keybinding{left:2px}.excalidraw--mobile.excalidraw .picker-keybinding{display:none}.excalidraw .picker-type-canvasBackground .picker-keybinding{color:#aaa}.excalidraw .picker-type-elementBackground .picker-keybinding{color:#fff}.excalidraw .picker-swatch[aria-label=transparent] .picker-keybinding{color:#aaa}.excalidraw .picker-type-elementStroke .picker-keybinding{color:#d4d4d4}.excalidraw.theme--dark .picker-type-elementBackground .picker-keybinding{color:#000}.excalidraw.theme--dark .picker-swatch[aria-label=transparent] .picker-keybinding{color:#000}',""]);const s=a},7369:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .Island{--padding: 0;background-color:var(--island-bg-color);box-shadow:var(--shadow-island);border-radius:var(--border-radius-lg);padding:calc(var(--padding)*var(--space-factor));position:relative}.excalidraw .Island.zen-mode{box-shadow:none}.excalidraw .Island::-webkit-scrollbar{width:10px}.excalidraw .Island::-webkit-scrollbar-track{background-color:transparent}.excalidraw .Island::-webkit-scrollbar-thumb{background-color:var(--color-scrollbar-thumb)}.excalidraw .Island::-webkit-scrollbar-thumb:hover{background-color:var(--color-scrollbar-thumb-hover)}.excalidraw .Island::-webkit-scrollbar-thumb:active{background-color:var(--color-scrollbar-thumb-active)}.excalidraw .App-menu_top .Stack_vertical .Island{min-width:216px}.excalidraw .App-menu_top .Stack_vertical .Stack_horizontal{justify-content:center !important}.excalidraw.excalidraw--view-mode .App-menu_top .Stack_vertical .Island{min-width:auto}",""]);const s=a},1434:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .layer-ui__wrapper{z-index:var(--zIndex-layerUI)}.excalidraw .layer-ui__wrapper__top-right{display:flex}.excalidraw .layer-ui__wrapper__footer{width:100%}.excalidraw .layer-ui__wrapper__footer-right{z-index:100;display:flex}.excalidraw .layer-ui__wrapper .zen-mode-transition{transition:transform .5s ease-in-out}:root[dir=ltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-left{transform:translate(-999px, 0)}:root[dir=ltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-right{transform:translate(999px, 0)}:root[dir=rtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-left{transform:translate(999px, 0)}:root[dir=rtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-right{transform:translate(-999px, 0)}:root[dir=ltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-left{transform:translate(-76px, 0)}:root[dir=rtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-left{transform:translate(76px, 0)}.excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-bottom{transform:translate(0, 92px)}.excalidraw .layer-ui__wrapper .disable-zen-mode{height:30px;position:absolute;bottom:10px;font-size:10px;padding:10px;font-weight:500;opacity:0;visibility:hidden;transition:visibility 0s linear 0s,opacity .5s}[dir=ltr] .excalidraw .layer-ui__wrapper .disable-zen-mode{right:15px}[dir=rtl] .excalidraw .layer-ui__wrapper .disable-zen-mode{left:15px}.excalidraw .layer-ui__wrapper .disable-zen-mode--visible{opacity:1;visibility:visible;transition:visibility 0s linear 300ms,opacity .5s;transition-delay:.8s}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-center{pointer-events:none}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-center>*{pointer-events:all}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-left,.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-right,.excalidraw .layer-ui__wrapper .disable-zen-mode--visible{pointer-events:all}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-left{margin-bottom:.2em}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-right{margin-top:auto;margin-bottom:auto;margin-inline-end:1em}",""]);const s=a},8923:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .layer-ui__library{margin:auto;display:flex;align-items:center;justify-content:center}.excalidraw .layer-ui__library .layer-ui__library-header{display:flex;align-items:center;width:100%;margin:2px 0}.excalidraw .layer-ui__library .layer-ui__library-header button{margin:0 2px}.excalidraw .layer-ui__library .layer-ui__library-header a{margin-inline-start:auto;padding-inline-end:18px;white-space:nowrap}.excalidraw .layer-ui__library-message{padding:10px 20px;max-width:200px}.excalidraw .publish-library-success .Dialog__content{display:flex;flex-direction:column}.excalidraw .publish-library-success-close.ToolIcon_type_button{background-color:#228be6;align-self:flex-end}.excalidraw .publish-library-success-close.ToolIcon_type_button:hover{background-color:#1971c2}.excalidraw .publish-library-success-close.ToolIcon_type_button .ToolIcon__icon{width:auto;font-size:1rem;color:#fff;padding:0 .5rem}",""]);const s=a},5605:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .library-menu-items-container .library-actions{display:flex}.excalidraw .library-menu-items-container .library-actions button .library-actions-counter{position:absolute;right:2px;bottom:2px;border-radius:50%;width:1em;height:1em;padding:1px;font-size:.7rem;background:#fff}.excalidraw .library-menu-items-container .library-actions--remove{background-color:#f03e3e}.excalidraw .library-menu-items-container .library-actions--remove:hover{background-color:#e03131}.excalidraw .library-menu-items-container .library-actions--remove:active{background-color:#c92a2a}.excalidraw .library-menu-items-container .library-actions--remove svg{color:#fff}.excalidraw .library-menu-items-container .library-actions--remove .library-actions-counter{color:#f03e3e}.excalidraw .library-menu-items-container .library-actions--export{background-color:#94d82d}.excalidraw .library-menu-items-container .library-actions--export:hover{background-color:#74b816}.excalidraw .library-menu-items-container .library-actions--export:active{background-color:#66a80f}.excalidraw .library-menu-items-container .library-actions--export svg{color:#fff}.excalidraw .library-menu-items-container .library-actions--export .library-actions-counter{color:#94d82d}.excalidraw .library-menu-items-container .library-actions--publish{background-color:#15aabf}.excalidraw .library-menu-items-container .library-actions--publish:hover{background-color:#1098ad}.excalidraw .library-menu-items-container .library-actions--publish:active{background-color:#0b7285}.excalidraw .library-menu-items-container .library-actions--publish svg{color:#fff}.excalidraw .library-menu-items-container .library-actions--publish label{margin-left:-0.2em;margin-right:1.1em;color:#fff;font-size:.86em}.excalidraw .library-menu-items-container .library-actions--publish .library-actions-counter{color:#15aabf}.excalidraw .library-menu-items-container .library-actions--load{background-color:#228be6}.excalidraw .library-menu-items-container .library-actions--load:hover{background-color:#1c7ed6}.excalidraw .library-menu-items-container .library-actions--load:active{background-color:#1864ab}.excalidraw .library-menu-items-container .library-actions--load svg{color:#fff}.excalidraw .library-menu-items-container__items{max-height:50vh;overflow:auto;margin-top:.5rem}.excalidraw .library-menu-items-container .separator{font-weight:500;font-size:.9rem;margin:.6em .2em;color:var(--text-primary-color)}",""]);const s=a},5644:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .library-unit{align-items:center;border:1px solid var(--button-gray-2);display:flex;justify-content:center;position:relative;width:63px;height:63px}.excalidraw .library-unit--hover{box-shadow:inset 0px 0px 0px 2px #339af0;border-color:#339af0}.excalidraw .library-unit--selected{box-shadow:inset 0px 0px 0px 2px #1971c2;border-color:#1971c2}.excalidraw.theme--dark .library-unit{border-color:#303030}.excalidraw .library-unit__dragger{display:flex;align-items:center;justify-content:center;height:100%;width:100%}.excalidraw .library-unit__dragger>svg{filter:var(--theme-filter);flex-grow:1;max-height:100%;max-width:100%}.excalidraw .library-unit__checkbox-container,.excalidraw .library-unit__checkbox-container:hover,.excalidraw .library-unit__checkbox-container:active{align-items:center;background:none;border:none;color:var(--icon-fill-color);display:flex;justify-content:center;margin:0;padding:.5rem;position:absolute;left:2rem;bottom:2rem;cursor:pointer}.excalidraw .library-unit__checkbox-container input,.excalidraw .library-unit__checkbox-container:hover input,.excalidraw .library-unit__checkbox-container:active input{cursor:pointer}.excalidraw .library-unit__checkbox{position:absolute;left:2.3rem;bottom:2.3rem}.excalidraw .library-unit__checkbox .Checkbox-box{width:13px;height:13px;border-radius:2px;margin:.5em .5em .2em .2em;background-color:#d0ebff}.excalidraw .library-unit__checkbox.Checkbox:hover .Checkbox-box{background-color:#a5d8ff}.excalidraw .library-unit__removeFromLibrary>svg{height:16px;width:16px}.excalidraw .library-unit__adder{transform:scale(1);animation:library-unit__adder-animation 1s ease-in infinite}.excalidraw .library-unit__adder{position:absolute;left:40%;top:40%;width:2rem;height:2rem;margin-left:-10px;margin-top:-10px;pointer-events:none}.excalidraw .library-unit:hover .library-unit__adder{fill:#1c7ed6}.excalidraw .library-unit:active .library-unit__adder{animation:none;transform:scale(0.8);fill:#000}.excalidraw .library-unit__active{cursor:pointer}@keyframes library-unit__adder-animation{0%{transform:scale(0.85)}50%{transform:scale(1)}100%{transform:scale(0.85)}}",""]);const s=a},6843:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw.excalidraw-modal-container{position:absolute;z-index:10}.excalidraw .Modal{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;overflow:auto;padding:calc(var(--space-factor)*10)}.excalidraw .Modal__background{position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;background-color:rgba(0,0,0,.7)}.excalidraw .Modal__content{position:relative;z-index:2;width:100%;max-width:var(--max-width);max-height:100%;opacity:0;transform:translateY(10px);animation:Modal__content_fade-in .1s ease-out .05s forwards;position:relative;overflow-y:auto;background:var(--island-bg-color);border:1px solid var(--dialog-border-color);box-shadow:0 2px 10px rgba(0,0,0,.25);border-radius:6px;box-sizing:border-box}.excalidraw .Modal__content:focus{outline:none}.excalidraw--mobile.excalidraw .Modal__content{max-width:100%;border:0;border-radius:0}@keyframes Modal__content_fade-in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.excalidraw .Modal__close{width:calc(var(--space-factor)*7);height:calc(var(--space-factor)*7);display:flex;align-items:center;justify-content:center}.excalidraw .Modal__close svg{height:calc(var(--space-factor)*5)}.excalidraw--mobile.excalidraw .Modal{padding:0}.excalidraw--mobile.excalidraw .Modal__content{position:absolute;top:0;left:0;right:0;bottom:0}",""]);const s=a},8461:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw--mobile.excalidraw .PasteChartDialog .Island{display:flex;flex-direction:column}.excalidraw .PasteChartDialog .container{display:flex;align-items:center;justify-content:space-around;flex-wrap:wrap}.excalidraw--mobile.excalidraw .PasteChartDialog .container{flex-direction:column;justify-content:center}.excalidraw .PasteChartDialog .ChartPreview{margin:8px;text-align:center;width:192px;height:128px;border-radius:2px;padding:1px;border:1px solid #ced4da;display:flex;align-items:center;justify-content:center;background:transparent}.excalidraw .PasteChartDialog .ChartPreview div{display:inline-block}.excalidraw .PasteChartDialog .ChartPreview svg{max-height:120px;max-width:186px}.excalidraw .PasteChartDialog .ChartPreview:hover{padding:0;border:2px solid #339af0}",""]);const s=a},9935:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .popover{position:absolute;z-index:10}",""]);const s=a},532:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".ProjectName{margin:auto;display:flex;align-items:center}.ProjectName .TextInput{height:calc(1rem - 3px);width:200px;overflow:hidden;text-align:center;margin-left:8px;text-overflow:ellipsis}.ProjectName .TextInput--readonly{background:none;border:none;width:auto;max-width:200px;padding-left:2px}.ProjectName .TextInput--readonly:hover{background:none}",""]);const s=a},7589:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .publish-library__fields{display:flex;flex-direction:column}.excalidraw .publish-library__fields label{padding:1em;display:flex;justify-content:space-between;align-items:center}.excalidraw .publish-library__fields label span{font-weight:500;font-size:1rem;color:#868e96}.excalidraw .publish-library__fields label input,.excalidraw .publish-library__fields label textarea{width:70%;padding:.6em;font-family:var(--ui-font)}.excalidraw .publish-library__fields label .required{color:#e03131;margin:.2rem}.excalidraw .publish-library__buttons{display:flex;padding:.2rem 0;justify-content:flex-end}.excalidraw .publish-library__buttons .ToolIcon__icon{min-width:2.5rem;width:auto;font-size:1rem}.excalidraw .publish-library__buttons .ToolIcon_type_button{margin-left:1rem;padding:0 .5rem}.excalidraw .publish-library__buttons--confirm.ToolIcon_type_button{background-color:#228be6}.excalidraw .publish-library__buttons--confirm.ToolIcon_type_button:hover{background-color:#1971c2}.excalidraw .publish-library__buttons--cancel.ToolIcon_type_button{background-color:#adb5bd}.excalidraw .publish-library__buttons--cancel.ToolIcon_type_button:hover{background-color:#868e96}.excalidraw .publish-library__buttons .ToolIcon__icon{color:#fff}.excalidraw .publish-library__buttons .ToolIcon__icon .Spinner{--spinner-color: #fff}.excalidraw .publish-library__buttons .ToolIcon__icon .Spinner svg{padding:.5rem}.excalidraw .publish-library .selected-library-items{display:flex;padding:0 .8rem;flex-wrap:wrap}.excalidraw .publish-library .selected-library-items .single-library-item-wrapper{width:9rem}.excalidraw .publish-library-note{padding:1em;font-style:italic;font-size:14px;display:block}",""]);const s=a},8465:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .single-library-item{position:relative}.excalidraw .single-library-item__svg{width:7.5rem;height:7.5rem;border:1px solid var(--button-gray-2);margin:.3rem}.excalidraw .single-library-item__svg svg{width:100%;height:100%}.excalidraw .single-library-item .ToolIcon__icon{background-color:#fff;width:auto;height:auto;margin:0 .5rem}.excalidraw .single-library-item .ToolIcon,.excalidraw .single-library-item .ToolIcon_type_button:hover{background-color:#fff}.excalidraw .single-library-item .required,.excalidraw .single-library-item .error{color:#e03131;font-weight:bold;font-size:1rem;margin:.2rem}.excalidraw .single-library-item .error{font-weight:500;margin:0;padding:.3em 0}.excalidraw .single-library-item--remove{position:absolute;top:.2rem;right:1.3rem}.excalidraw .single-library-item--remove .ToolIcon__icon{margin:0}.excalidraw .single-library-item--remove .ToolIcon__icon{background-color:#fa5252}.excalidraw .single-library-item--remove .ToolIcon__icon:hover{background-color:#f03e3e}.excalidraw .single-library-item--remove .ToolIcon__icon:active{background-color:#e03131}.excalidraw .single-library-item--remove svg{color:#fff;padding:.26rem;border-radius:.3em;width:1rem;height:1rem}",""]);const s=a},5892:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .Spinner{display:flex;align-items:center;justify-content:center;height:100%;margin-left:auto;margin-right:auto;--spinner-color: var(--icon-fill-color)}.excalidraw .Spinner svg{animation:rotate 1.6s linear infinite;transform-origin:center center}.excalidraw .Spinner circle{stroke:var(--spinner-color);animation:dash 1.6s linear 0s infinite;stroke-linecap:round}@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,300;stroke-dashoffset:0}50%{stroke-dasharray:150,300;stroke-dashoffset:-200}100%{stroke-dasharray:1,300;stroke-dashoffset:-280}}",""]);const s=a},3874:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .Stack{--gap: 0;display:grid;gap:calc(var(--space-factor)*var(--gap))}.excalidraw .Stack_vertical{grid-template-columns:auto;grid-auto-flow:row;grid-auto-rows:-webkit-min-content;grid-auto-rows:min-content}.excalidraw .Stack_horizontal{grid-template-rows:auto;grid-auto-flow:column;grid-auto-columns:-webkit-min-content;grid-auto-columns:min-content}",""]);const s=a},2681:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Stats{position:absolute;top:64px;right:12px;font-size:12px;z-index:10}.excalidraw .Stats h3{margin:0 24px 8px 0;white-space:nowrap}.excalidraw .Stats .close{float:right;height:16px;width:16px;cursor:pointer}.excalidraw .Stats .close svg{width:100%;height:100%}.excalidraw .Stats table{width:100%}.excalidraw .Stats table th{border-bottom:1px solid var(--input-border-color);padding:4px}.excalidraw .Stats table tr td:nth-child(2){min-width:24px;text-align:right}:root[dir=rtl] .excalidraw .Stats{left:12px;right:initial}:root[dir=rtl] .excalidraw .Stats h3{margin:0 0 8px 24px}:root[dir=rtl] .excalidraw .Stats .close{float:left}",""]);const s=a},6759:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .TextInput{display:inline-block}",""]);const s=a},9650:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Toast{animation:fade-in .5s;background-color:var(--button-gray-1);border-radius:4px;bottom:10px;box-sizing:border-box;cursor:default;left:50%;margin-left:-150px;padding:4px 0;position:absolute;text-align:center;width:300px;z-index:999999}.excalidraw .Toast__message{color:var(--popup-text-color);white-space:pre-wrap}@keyframes fade-in{from{opacity:0}to{opacity:1}}",""]);const s=a},2044:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .ToolIcon{display:inline-flex;align-items:center;position:relative;cursor:pointer;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}.excalidraw .ToolIcon--plain{background-color:transparent}.excalidraw .ToolIcon--plain .ToolIcon__icon{width:2rem;height:2rem}.excalidraw .ToolIcon_type_radio+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox+.ToolIcon__icon{background-color:var(--button-gray-1)}.excalidraw .ToolIcon_type_radio+.ToolIcon__icon:hover,.excalidraw .ToolIcon_type_checkbox+.ToolIcon__icon:hover{background-color:var(--button-gray-2)}.excalidraw .ToolIcon_type_radio+.ToolIcon__icon:active,.excalidraw .ToolIcon_type_checkbox+.ToolIcon__icon:active{background-color:var(--button-gray-3)}.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(--border-radius-lg)}.excalidraw .ToolIcon__icon+.ToolIcon__label{margin-inline-start:0}.excalidraw .ToolIcon__icon svg{position:relative;height:1em;fill:var(--icon-fill-color);color:var(--icon-fill-color)}.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-visible,.excalidraw .Modal .ToolIcon_type_button:focus-visible,.excalidraw .ToolIcon_type_button:focus-visible{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-visible+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox:focus-visible+.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 .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__keybinding{position:absolute;bottom:2px;right:3px;font-size:.5em;color:var(--keybinding-color);font-family:var(--ui-font);-webkit-user-select:none;user-select:none}@media(max-width: 425px){.excalidraw .Shape .ToolIcon__icon{width:2rem;height:2rem}.excalidraw .Shape .ToolIcon__icon svg{height:.8em}}@media(max-width: 760px){.excalidraw .ToolIcon.ToolIcon_type_floating{display:inline-block;position:absolute;right:calc(-2*var(--space-factor));margin-left:0;border-radius:20px 0 0 20px;z-index:1;background-color:var(--button-gray-1)}.excalidraw .ToolIcon.ToolIcon_type_floating:hover{background-color:var(--button-gray-1)}.excalidraw .ToolIcon.ToolIcon_type_floating:active{background-color:var(--button-gray-2)}.excalidraw .ToolIcon.ToolIcon_type_floating .ToolIcon__icon{border-radius:inherit}.excalidraw .ToolIcon.ToolIcon_type_floating svg{position:static}.excalidraw .ToolIcon.ToolIcon__library{top:100px}.excalidraw .ToolIcon.ToolIcon__lock{margin-inline-end:0;top:60px}.excalidraw .ToolIcon.ToolIcon__penMode{margin-inline-end:0;top:140px}}:root[dir=ltr] .excalidraw .unlocked-icon{left:2px}:root[dir=rtl] .excalidraw .unlocked-icon{right:2px}",""]);const s=a},9144:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_radio+.ToolIcon__icon:active,.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_checkbox+.ToolIcon__icon:active{background:var(--color-primary-light)}.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_radio:checked+.ToolIcon__icon,.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_checkbox:checked+.ToolIcon__icon{background:var(--color-primary);--icon-fill-color: #ffffff;--keybinding-color: #ffffff}.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_radio:checked+.ToolIcon__icon:active,.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_checkbox:checked+.ToolIcon__icon:active{background:var(--color-primary-darker)}.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon__keybinding{bottom:4px;right:4px}.excalidraw .App-toolbar-container .ToolIcon_type_floating:not(.is-mobile) .ToolIcon__icon{padding:1px;background-color:var(--island-bg-color);box-shadow:1px 3px 4px 0px rgba(0,0,0,.15);border-radius:50%;transition:box-shadow .5s ease,transform .5s ease}.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_radio:focus-within+.ToolIcon__icon,.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_checkbox:focus-within+.ToolIcon__icon{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .App-toolbar-container .ToolIcon__hidden{box-shadow:none !important;background-color:transparent !important;pointer-events:none !important}.excalidraw .App-toolbar-container .ToolIcon.ToolIcon__lock{margin-inline-end:var(--space-factor)}.excalidraw .App-toolbar-container .ToolIcon.ToolIcon__lock.ToolIcon_type_floating{margin-left:.1rem}.excalidraw .App-toolbar-container .ToolIcon__library{margin-inline-start:var(--space-factor)}.excalidraw .App-toolbar-container.zen-mode .ToolIcon_type_floating .ToolIcon__icon{box-shadow:none;transform:scale(0.9)}.excalidraw .App-toolbar-container.zen-mode .ToolIcon_type_floating .ToolIcon_type_checkbox:not(:checked):not(:hover):not(:active)+.ToolIcon__icon svg{fill:#adb5bd;color:#adb5bd}.excalidraw .App-toolbar{border-radius:var(--border-radius-lg);box-shadow:0 0 0 1px rgba(0,0,0,.01),1px 1px 5px rgba(0,0,0,.15)}.excalidraw .App-toolbar .ToolIcon:hover{--icon-fill-color: var( --color-primary-contrast-offset, var(--color-primary) );--keybinding-color: var( --color-primary-contrast-offset, var(--color-primary) )}.excalidraw .App-toolbar .ToolIcon:active{--icon-fill-color: #212529;--keybinding-color: #212529}.excalidraw .App-toolbar .ToolIcon .ToolIcon__icon{background:transparent;border-radius:var(--border-radius-lg)}.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_radio+.ToolIcon__icon:active,.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_checkbox+.ToolIcon__icon:active{background:var(--color-primary-light)}.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_radio:checked+.ToolIcon__icon,.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_checkbox:checked+.ToolIcon__icon{background:var(--color-primary);--icon-fill-color: #ffffff;--keybinding-color: #ffffff}.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_radio:checked+.ToolIcon__icon:active,.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_checkbox:checked+.ToolIcon__icon:active{background:var(--color-primary-darker)}.excalidraw .App-toolbar .ToolIcon .ToolIcon__keybinding{bottom:4px;right:4px}.excalidraw .App-toolbar.zen-mode .ToolIcon__keybinding,.excalidraw .App-toolbar.zen-mode .HintViewer{display:none}.excalidraw.theme--dark .App-toolbar .ToolIcon:active{--icon-fill-color: #dee2e6;--keybinding-color: #dee2e6}",""]);const s=a},6626:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw-tooltip{position:absolute;z-index:1000;padding:8px;border-radius:6px;box-sizing:border-box;pointer-events:none;word-wrap:break-word;background:#000;line-height:1.5;text-align:center;font-size:13px;font-weight:500;color:#fff;display:none}.excalidraw-tooltip.excalidraw-tooltip--visible{display:block}.excalidraw-tooltip-wrapper{display:flex}.excalidraw-tooltip-icon{width:.9em;height:.9em;margin-left:5px;margin-top:1px;display:flex}.excalidraw--mobile.excalidraw-tooltip-icon{display:none}",""]);const s=a},6359:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .UserList{pointer-events:none;padding:var(--space-factor);display:flex;justify-content:flex-end;overflow:hidden;border-radius:60px}.excalidraw .UserList:empty{display:none}.excalidraw .UserList.layout-vertical{grid-column:3;flex-direction:column-reverse;position:absolute;top:60px;right:var(--space-factor);max-height:calc(\n 100vh - var(--space-factor) - 60px - 60px +\n var(--itemOffset)\n );padding-bottom:max(var(--itemOffset)*-1,0px)}.excalidraw .UserList.layout-vertical .Avatar{width:2.4rem;height:2.4rem}.excalidraw .UserList>*{pointer-events:all}.excalidraw .UserList.layout-vertical>*{margin-bottom:var(--itemOffset)}.excalidraw .UserList.layout-horizontal>*{margin-right:var(--itemOffset)}.excalidraw .UserList_mobile{padding:0;justify-content:normal}.excalidraw .UserList_mobile>*{margin:0 var(--space-factor) var(--space-factor) 0}",""]);const s=a},9915:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".visually-hidden{position:absolute !important;height:1px;width:1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);white-space:nowrap;-webkit-user-select:none;user-select:none}.LoadingMessage{position:absolute;top:0;right:0;bottom:0;left:0;z-index:999;display:flex;align-items:center;justify-content:center;pointer-events:none}.LoadingMessage span{background-color:var(--button-gray-1);border-radius:5px;padding:.8em 1.2em;color:var(--popup-text-color);font-size:1.3em}",""]);const s=a},9310:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>g});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o),s=n(1667),l=n.n(s),c=new URL(n(7984),n.b),d=new URL(n(1639),n.b),u=a()(i()),h=l()(c),p=l()(d);u.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("+h+");--focus-highlight-color: #a5d8ff;--icon-fill-color: #212529;--icon-green-fill-color: #2b8a3e;--default-bg-color: #ffffff;--input-bg-color: #ffffff;--input-border-color: #ced4da;--input-hover-bg-color: #f1f3f5;--input-label-color: #495057;--island-bg-color: rgba(255, 255, 255, 0.96);--keybinding-color: #adb5bd;--link-color: #1c7ed6;--overlay-bg-color: rgba(255, 255, 255, 0.88);--popup-bg-color: #ffffff;--popup-secondary-bg-color: #f1f3f5;--popup-text-color: #000000;--popup-text-inverted-color: #ffffff;--sab: env(safe-area-inset-bottom);--sal: env(safe-area-inset-left);--sar: env(safe-area-inset-right);--sat: env(safe-area-inset-top);--select-highlight-color: #339af0;--shadow-island: 0 0 0 1px rgba(0, 0, 0, 0.01), 1px 1px 5px rgb(0 0 0 / 12%);--space-factor: 0.25rem;--text-primary-color: #343a40;--color-primary: #6965db;--color-primary-darker: #5b57d1;--color-primary-darkest: #4a47b1;--color-primary-light: #e2e1fc;--border-radius-md: 0.375rem;--border-radius-lg: 0.5rem}.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("+p+');--focus-highlight-color: #228be6;--icon-fill-color: #ced4da;--icon-green-fill-color: #69db7c;--default-bg-color: #121212;--input-bg-color: #121212;--input-border-color: #2e2e2e;--input-hover-bg-color: #181818;--input-label-color: #e9ecef;--island-bg-color: rgba(30, 30, 30, 0.98);--keybinding-color: #868e96;--link-color: #4dabf7;--overlay-bg-color: rgba(52, 58, 64, 0.12);--popup-bg-color: #2c2c2c;--popup-secondary-bg-color: #222;--popup-text-color: #ced4da;--popup-text-inverted-color: #635c5c;--select-highlight-color: #4dabf7;--shadow-island: 1px 1px 5px rgba(0, 0, 0, 0.3);--text-primary-color: #ced4da;--color-primary: #5650f0;--color-primary-darker: #4b46d8;--color-primary-darkest: #3e39be;--color-primary-light: #3f3d64}:root{--zIndex-canvas: 1;--zIndex-wysiwyg: 2;--zIndex-layerUI: 3}.excalidraw{position:relative;overflow:hidden;color:var(--text-primary-color);display:flex;top:0;bottom:0;left:0;right:0;height:100%;width:100%;-webkit-user-select:none;user-select:none}.excalidraw:focus{outline:none}.excalidraw a{font-weight:500;text-decoration:none;color:var(--link-color)}.excalidraw a:hover{text-decoration:underline}.excalidraw canvas{touch-action:none;image-rendering:pixelated;image-rendering:-moz-crisp-edges;z-index:var(--zIndex-canvas)}.excalidraw__canvas{position:absolute}.excalidraw.theme--dark canvas{filter:var(--theme-filter)}.excalidraw .FixedSideContainer{padding-top:var(--sat, 0);padding-right:var(--sar, 0);padding-bottom:var(--sab, 0);padding-left:var(--sal, 0)}.excalidraw .panelRow{display:flex;justify-content:space-between}.excalidraw .panelColumn{display:flex;flex-direction:column}.excalidraw .panelColumn h3,.excalidraw .panelColumn legend,.excalidraw .panelColumn .control-label{margin-top:.333rem;margin-bottom:.333rem;font-size:.75rem;color:var(--text-primary-color);font-weight:bold;display:block}.excalidraw .panelColumn .control-label input{display:block;width:100%}.excalidraw .panelColumn h3:first-child,.excalidraw .panelColumn legend:first-child,.excalidraw .panelColumn .control-label:first-child{margin-top:0}.excalidraw .panelColumn legend{padding:0}.excalidraw .panelColumn .iconSelectList{flex-wrap:wrap;position:relative}.excalidraw .panelColumn .buttonList{flex-wrap:wrap}.excalidraw .panelColumn .buttonList label{margin-right:.25rem;font-size:.75rem;display:inline-block}.excalidraw .panelColumn .buttonList input[type=radio],.excalidraw .panelColumn .buttonList input[type=button]{opacity:0;position:absolute;pointer-events:none}.excalidraw .panelColumn .buttonList .iconRow{margin-top:8px}.excalidraw .panelColumn .buttonList .ToolIcon{margin:0;margin-inline-end:8px}.excalidraw .panelColumn .buttonList .ToolIcon:focus{outline:transparent;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .panelColumn .buttonList .ToolIcon:hover{background-color:var(--button-gray-2)}.excalidraw .panelColumn .buttonList .ToolIcon:active{background-color:var(--button-gray-3)}.excalidraw .panelColumn .buttonList .ToolIcon:disabled{cursor:not-allowed}.excalidraw .panelColumn .buttonList .ToolIcon__icon{width:28px;height:28px}.excalidraw .panelColumn fieldset{margin:0;margin-top:.333rem;padding:0;border:none}.excalidraw .divider{width:1px;background-color:#e9ecef;margin:1px}.excalidraw .buttonList label:focus-within,.excalidraw input:focus-visible{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:var(--border-radius-md);margin:.125rem 0;padding:.25rem;white-space:nowrap;cursor:pointer}.excalidraw button:focus-visible,.excalidraw .buttonList label:focus-visible{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(--color-primary);--icon-fill-color: #ffffff}.excalidraw .active:hover,.excalidraw .buttonList label.active:hover{background-color:var(--color-primary-darker)}.excalidraw .active:active,.excalidraw .buttonList label.active:active{background-color:var(--color-primary-darkest)}.excalidraw .buttonList.buttonListIcon label{display:inline-flex;justify-content:center;align-items:center}.excalidraw .buttonList.buttonListIcon label svg{width:35px;height:14px;padding:2px;opacity:.6}.excalidraw .buttonList.buttonListIcon label.active svg{opacity:1}.excalidraw .App-top-bar{z-index:var(--zIndex-layerUI);display:grid;grid-template-columns:1fr -webkit-max-content 1fr;grid-template-columns:1fr max-content 1fr}.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:auto -webkit-max-content auto;grid-template-columns:auto max-content auto;grid-gap:4px;align-items:flex-start;cursor:default;pointer-events:none !important}.excalidraw .layer-ui__wrapper:not(.disable-pointerEvents) .App-menu_top>*{pointer-events:all}.excalidraw .App-menu_top>*:first-child{justify-self:flex-start}.excalidraw .App-menu_top>*:last-child{justify-self:flex-end}.excalidraw .App-menu_bottom{position:absolute;bottom:0;grid-template-columns:-webkit-min-content auto -webkit-min-content;grid-template-columns:min-content auto min-content;grid-gap:15px;align-items:flex-start;cursor:default;pointer-events:none !important;z-index:100}:root[dir=ltr] .excalidraw .App-menu_bottom{left:.25rem}:root[dir=rtl] .excalidraw .App-menu_bottom{right:.25rem}.excalidraw .App-menu_bottom--transition-left section{width:185px}.excalidraw .App-menu_bottom section{display:flex}.excalidraw .App-menu_bottom>*:first-child{justify-self:flex-start}.excalidraw .App-menu_bottom>*:last-child{justify-self:flex-end}.excalidraw .App-menu_left{grid-template-rows:1fr auto 1fr;height:100%}.excalidraw .App-menu_right{grid-template-rows:1fr;height:100%}.excalidraw .App-menu__left{overflow-y:auto}.excalidraw .dropdown-select{height:1.5rem;padding:0;padding-inline-start:.5rem;padding-inline-end:1.5rem;color:var(--icon-fill-color);background-color:var(--button-gray-1);border-radius:var(--space-factor);border:1px solid var(--button-gray-2);font-size:.8rem;outline:none;-webkit-appearance:none;appearance:none;background-image:var(--dropdown-icon);background-repeat:no-repeat;background-position:right .7rem top 50%,0 0;background-size:.65em auto,100%}:root[dir=rtl] .excalidraw .dropdown-select{background-position:left .7rem top 50%,0 0}.excalidraw .dropdown-select:focus{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .dropdown-select:hover{background-color:var(--button-gray-2)}.excalidraw .dropdown-select:active{background-color:var(--button-gray-2)}.excalidraw .zIndexButton{margin:0;margin-inline-end:8px;padding:5px;display:inline-flex;align-items:center;justify-content:center}.excalidraw .zIndexButton svg{width:18px;height:18px}.excalidraw .scroll-back-to-content{color:var(--popup-text-color);position:absolute;left:50%;bottom:30px;transform:translateX(-50%);padding:10px 20px}.excalidraw .help-icon{display:flex;cursor:pointer;fill:#868e96;padding:0;margin:0;background:none;color:var(--icon-fill-color)}.excalidraw .help-icon svg{width:1.5rem;height:1.5rem}.excalidraw .help-icon:hover{background:none}.excalidraw .reset-zoom-button{padding:.2em;background:transparent;color:var(--text-primary-color);font-family:var(--ui-font)}.excalidraw .undo-redo-buttons{display:grid;grid-auto-flow:column;gap:.4em;margin-top:auto;margin-bottom:auto;margin-inline-start:.6em}.excalidraw--mobile.excalidraw aside{display:none}.excalidraw--mobile.excalidraw .scroll-back-to-content{bottom:calc(80px + var(--sab, 0));z-index:-1}:root[dir=rtl] .excalidraw .rtl-mirror{transform:scaleX(-1)}.excalidraw .zen-mode-visibility{visibility:visible;opacity:1;height:auto;width:auto;transition:opacity .5s}.excalidraw .zen-mode-visibility.zen-mode-visibility--hidden{visibility:hidden;opacity:0;height:0;width:0;transition:opacity .5s}.excalidraw .disable-pointerEvents{pointer-events:none !important}.excalidraw.excalidraw--view-mode .App-menu{display:flex;justify-content:space-between}.excalidraw input[type=text],.excalidraw textarea:not(.excalidraw-wysiwyg){color:var(--text-primary-color);border:1.5px solid var(--input-border-color);padding:.75rem;white-space:nowrap;border-radius:var(--space-factor);background-color:var(--input-bg-color)}.excalidraw input[type=text]:not(:focus):hover,.excalidraw textarea:not(.excalidraw-wysiwyg):not(:focus):hover{background-color:var(--input-hover-bg-color)}.excalidraw input[type=text]:focus,.excalidraw textarea:not(.excalidraw-wysiwyg):focus{outline:none;box-shadow:0 0 0 2px var(--focus-highlight-color)}@media print{.excalidraw .App-bottom-bar,.excalidraw .FixedSideContainer,.excalidraw .layer-ui__wrapper{display:none}}.excalidraw .HomeButton.ToolIcon.ToolIcon_type_floating{display:inline-block;position:absolute;top:60px;left:calc(-2*var(--space-factor));border-radius:0 20px 20px 0;background-color:var(--button-gray-1)}.excalidraw .HomeButton.ToolIcon.ToolIcon_type_floating:hover{background-color:var(--button-gray-1)}.excalidraw .HomeButton.ToolIcon.ToolIcon_type_floating:active{background-color:var(--button-gray-2)}.excalidraw .HomeButton.ToolIcon.ToolIcon_type_floating .ToolIcon__icon{border-radius:inherit}.excalidraw .HomeButton.ToolIcon.ToolIcon_type_floating svg{position:static}.ErrorSplash.excalidraw{min-height:100vh;padding:20px 0;overflow:auto;display:flex;align-items:center;justify-content:center;-webkit-user-select:text;user-select:text}.ErrorSplash.excalidraw .ErrorSplash-messageContainer{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px;background-color:#ffe3e3;border:3px solid #c92a2a}.ErrorSplash.excalidraw .ErrorSplash-paragraph{margin:15px 0;max-width:600px}.ErrorSplash.excalidraw .ErrorSplash-paragraph.align-center{text-align:center}.ErrorSplash.excalidraw .bigger,.ErrorSplash.excalidraw .bigger button{font-size:1.1em}.ErrorSplash.excalidraw .smaller,.ErrorSplash.excalidraw .smaller button{font-size:.9em}.ErrorSplash.excalidraw .ErrorSplash-details{display:flex;flex-direction:column;align-items:flex-start}.ErrorSplash.excalidraw .ErrorSplash-details textarea{width:100%;margin:10px 0;font-family:"Cascadia";font-size:.8em}',""]);const g=u},6464:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,"",""]),a.locals={themeFilter:"invert(93%) hue-rotate(180deg)"};const s=a},5260:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw-hyperlinkContainer{display:flex;align-items:center;justify-content:space-between;position:absolute;box-shadow:0px 2px 4px 0 rgba(0,0,0,.3);z-index:100;background:var(--island-bg-color);border-radius:var(--border-radius-md);box-sizing:border-box;min-height:42px}.excalidraw-hyperlinkContainer-input,.excalidraw-hyperlinkContainer button{z-index:100}.excalidraw-hyperlinkContainer-input,.excalidraw-hyperlinkContainer-link{height:24px;padding:0 8px;line-height:24px;font-size:.9rem;font-weight:500;font-family:var(--ui-font)}.excalidraw-hyperlinkContainer-input{width:18rem;border:none;background-color:transparent;color:var(--text-primary-color);outline:none;border:none;box-shadow:none !important}.excalidraw-hyperlinkContainer-link{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:15rem}.excalidraw-hyperlinkContainer button{color:#228be6;background-color:transparent !important;font-weight:500}.excalidraw-hyperlinkContainer button.excalidraw-hyperlinkContainer--remove{color:#c92a2a}.excalidraw-hyperlinkContainer .d-none{display:none}.excalidraw-hyperlinkContainer--remove .ToolIcon__icon svg{color:#fa5252}.excalidraw-hyperlinkContainer .ToolIcon__icon{width:2rem;height:2rem}.excalidraw-hyperlinkContainer__buttons{flex:0 0 auto}",""]);const s=a},3645:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(a[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);r&&a[d[0]]||(void 0!==o&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=o),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),i&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=i):d[4]="".concat(i)),t.push(d))}},t}},1667:e=>{"use strict";e.exports=function(e,t){return t||(t={}),e?(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]|(%20)/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e):e}},8081:e=>{"use strict";e.exports=function(e){return e[1]}},8288:(e,t,n)=>{"use strict";n.d(t,{iC:()=>o,f:()=>a,qx:()=>s,Iw:()=>l,$e:()=>c,wZ:()=>d,ay:()=>u,oc:()=>h,Oh:()=>p,Ks:()=>g,Vi:()=>m,$C:()=>f,ut:()=>b,C6:()=>v,_D:()=>x,n5:()=>y,rk:()=>w,Hg:()=>k,hs:()=>_,k:()=>C,LO:()=>E,r8:()=>S,pb:()=>j,LL:()=>I,Gj:()=>T,nM:()=>M,Lg:()=>O,HM:()=>L,V4:()=>A,sA:()=>P,EH:()=>D,ZF:()=>z,UO:()=>R,ah:()=>H,cW:()=>N,kV:()=>B,sS:()=>F,Yx:()=>U,zK:()=>W,ZB:()=>K,qy:()=>V,h6:()=>G,jo:()=>Y,$n:()=>X,hR:()=>Z,Kr:()=>q,gK:()=>$,oX:()=>Q});var r=n(8635),i=n.n(r);const o="Excalidraw",a=10,s=8,l=5,c=1,d=30,u=Math.PI/12,h={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},p={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1};let g;!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",e.EXCALIDRAW_LINK="excalidraw-link"}(g||(g={}));const m={TEST:"test",DEVELOPMENT:"development"},f={SHAPE_ACTIONS_MENU:"App-menu__left"},b={Virgil:1,Helvetica:2,Cascadia:3},v={LIGHT:"light",DARK:"dark"},x="Segoe UI Emoji",y=20,w=b.Virgil,k="left",_="top",C=20,E={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"},S={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawLibrary:"excalidrawlib"},j=window.location.origin,I=500,T=300,M=500,O=5e3,L=100,A=.1,P=300,D={VIEW:"viewMode",ZEN:"zenMode",GRID:"gridMode"},z=i().themeFilter,R={addLibrary:"addLibrary"},H={addLibrary:"addLibrary"},N={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,theme:!0,saveAsImage:!0}},B=800,F=1e3,U=500,W=2,K=[1,2,3],V=10,G=1440,Y=[E.png,E.jpg,E.svg,E.gif],X=2097152,Z="http://www.w3.org/2000/svg",q={excalidraw:2,excalidrawLibrary:2},$=5,Q={TOP:"top",MIDDLE:"middle",BOTTOM:"bottom"}},1143:(e,t,n)=>{"use strict";n.r(t),n.d(t,{FONT_FAMILY:()=>o.ut,THEME:()=>o.C6,bumpVersion:()=>Pr,cleanAppStateForExport:()=>fn,clearAppStateForLocalStorage:()=>mn,default:()=>Lp,defaultLang:()=>c,exportToBlob:()=>Bh,exportToCanvas:()=>Nh,exportToClipboard:()=>Uh,exportToSvg:()=>Fh,getDefaultAppState:()=>hn,getFreeDrawSvgPath:()=>Er,getNonDeletedElements:()=>_l,getSceneVersion:()=>wl,isInvisiblySmallElement:()=>Dr,isLinearElement:()=>je,languages:()=>d,loadFromBlob:()=>md,loadLibraryFromBlob:()=>fd,mutateElement:()=>Lr,newElementWith:()=>Ar,restore:()=>cd,restoreAppState:()=>ld,restoreElements:()=>sd,serializeAsJSON:()=>_d});var r=n(9787),i=n.n(r),o=n(8288);const a=JSON.parse('{"u2":"@dwelle/excalidraw","i8":"0.3.48"}');"production"!==o.Vi.TEST&&(n.p=window.EXCALIDRAW_ASSET_PATH||"https://unpkg.com/".concat(a.u2,"@").concat(a.i8,"/dist/"));var s=n(1463);const l=JSON.parse('{"ar-SA":88,"bg-BG":61,"bn-BD":0,"ca-ES":95,"cs-CZ":24,"da-DK":16,"de-DE":99,"el-GR":87,"en":100,"es-ES":84,"eu-ES":96,"fa-IR":63,"fi-FI":98,"fr-FR":100,"he-IL":80,"hi-IN":55,"hu-HU":49,"id-ID":100,"it-IT":96,"ja-JP":98,"kab-KAB":95,"kk-KZ":23,"ko-KR":72,"lt-LT":24,"lv-LV":100,"my-MM":46,"nb-NO":100,"nl-NL":90,"nn-NO":83,"oc-FR":97,"pa-IN":87,"pl-PL":93,"pt-BR":98,"pt-PT":83,"ro-RO":100,"ru-RU":99,"si-LK":9,"sk-SK":100,"sv-SE":100,"ta-IN":99,"tr-TR":85,"uk-UA":82,"zh-CN":100,"zh-HK":28,"zh-TW":100}'),c={code:"en",label:"English"},d=[{code:"ar-SA",label:"العربية",rtl:!0},{code:"bg-BG",label:"Български"},{code:"ca-ES",label:"Català"},{code:"cs-CZ",label:"Česky"},{code:"de-DE",label:"Deutsch"},{code:"el-GR",label:"Ελληνικά"},{code:"es-ES",label:"Español"},{code:"eu-ES",label:"Euskara"},{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:"kk-KZ",label:"Қазақ тілі"},{code:"ko-KR",label:"한국어"},{code:"lt-LT",label:"Lietuvių"},{code:"lv-LV",label:"Latviešu"},{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:"繁體中文"}].concat([c]).sort(((e,t)=>e.label>t.label?1:-1)).filter((e=>l[e.code]>=85)),u="__test__";"production"===o.Vi.DEVELOPMENT&&d.unshift({code:u,label:"test language"},{code:"".concat(u,".rtl"),label:"test language (rtl)",rtl:!0});let h=c,p={};const g=async e=>{h=e,document.documentElement.dir=h.rtl?"rtl":"ltr",document.documentElement.lang=h.code,p=e.code.startsWith(u)?{}:await Promise.resolve().then(n.t.bind(n,1463,19))},m=()=>h,f=(e,t)=>{for(let n=0;n<t.length;++n){const r=t[n];if(void 0===e[r])return;e=e[r]}if("string"==typeof e)return e},b=(e,t)=>{if(h.code.startsWith(u)){const n=t?"".concat(e,"(").concat(JSON.stringify(t).slice(1,-1),")"):e;return"[[".concat(n,"]]")}const n=e.split(".");let r=f(p,n)||f(s,n);if(void 0===r)throw new Error("Can't find translation for ".concat(e));if(t)for(const e in t)r=r.replace("{{".concat(e,"}}"),String(t[e]));return r};var v=n(4512);const x=()=>(0,v.jsx)("div",{className:"LoadingMessage",children:(0,v.jsx)("span",{children:b("labels.loadingScene")})}),y=e=>{const[t,n]=(0,r.useState)(!0);return(0,r.useEffect)((()=>{const t=d.find((t=>t.code===e.langCode))||c;(async()=>{await g(t)})(),n(!1)}),[e.langCode]),t?(0,v.jsx)(x,{}):e.children};function w(e,t,n){if(e&&e.length){const[r,i]=t,o=Math.PI/180*n,a=Math.cos(o),s=Math.sin(o);e.forEach((e=>{const[t,n]=e;e[0]=(t-r)*a-(n-i)*s+r,e[1]=(t-r)*s+(n-i)*a+i}))}}function k(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 _(e,t){const n=t.hachureAngle+90;let r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);const i=[0,0];if(n)for(const t of e)w(t,i,n);const o=function(e,t){const n=[];for(const t of e){const e=[...t];e[0].join(",")!==e[e.length-1].join(",")&&e.push([e[0][0],e[0][1]]),e.length>2&&n.push(e)}const r=[];t=Math.max(t,.1);const i=[];for(const e of n)for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];if(n[1]!==r[1]){const e=Math.min(n[1],r[1]);i.push({ymin:e,ymax:Math.max(n[1],r[1]),x:e===n[1]?n[0]:r[0],islope:(r[0]-n[0])/(r[1]-n[1])})}}if(i.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))),!i.length)return r;let o=[],a=i[0].ymin;for(;o.length||i.length;){if(i.length){let e=-1;for(let t=0;t<i.length&&!(i[t].ymin>a);t++)e=t;i.splice(0,e+1).forEach((e=>{o.push({s:a,edge:e})}))}if(o=o.filter((e=>!(e.edge.ymax<=a))),o.sort(((e,t)=>e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x))),o.length>1)for(let e=0;e<o.length;e+=2){const t=e+1;if(t>=o.length)break;const n=o[e].edge,i=o[t].edge;r.push([[Math.round(n.x),a],[Math.round(i.x),a]])}a+=t,o.forEach((e=>{e.edge.x=e.edge.x+t*e.edge.islope}))}return r}(e,r);if(n){for(const t of e)w(t,i,-n);!function(e,t,n){const r=[];e.forEach((e=>r.push(...e))),w(r,t,n)}(o,i,-n)}return o}class C{constructor(e){this.helper=e}fillPolygons(e,t){return this._fillPolygons(e,t)}_fillPolygons(e,t){const n=_(e,t);return{type:"fillSketch",ops:this.renderLines(n,t)}}renderLines(e,t){const n=[];for(const r of e)n.push(...this.helper.doubleLineOps(r[0][0],r[0][1],r[1][0],r[1][1],t));return n}}class E extends C{fillPolygons(e,t){let n=t.hachureGap;n<0&&(n=4*t.strokeWidth),n=Math.max(n,.1);const r=_(e,Object.assign({},t,{hachureGap:n})),i=Math.PI/180*t.hachureAngle,o=[],a=.5*n*Math.cos(i),s=.5*n*Math.sin(i);for(const[e,t]of r)k([e,t])&&o.push([[e[0]-a,e[1]+s],[...t]],[[e[0]+a,e[1]-s],[...t]]);return{type:"fillSketch",ops:this.renderLines(o,t)}}}class S extends C{fillPolygons(e,t){const n=this._fillPolygons(e,t),r=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),i=this._fillPolygons(e,r);return n.ops=n.ops.concat(i.ops),n}}class j{constructor(e){this.helper=e}fillPolygons(e,t){const n=_(e,t=Object.assign({},t,{hachureAngle:0}));return this.dotsOnLines(n,t)}dotsOnLines(e,t){const n=[];let r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);let i=t.fillWeight;i<0&&(i=t.strokeWidth/2);const o=r/4;for(const a of e){const e=k(a),s=e/r,l=Math.ceil(s)-1,c=e-l*r,d=(a[0][0]+a[1][0])/2-r/4,u=Math.min(a[0][1],a[1][1]);for(let e=0;e<l;e++){const a=u+c+e*r,s=d-o+2*Math.random()*o,l=a-o+2*Math.random()*o,h=this.helper.ellipse(s,l,i,i,t);n.push(...h.ops)}}return{type:"fillSketch",ops:n}}}class I{constructor(e){this.helper=e}fillPolygons(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,i=[];return e.forEach((e=>{const o=k(e),a=Math.floor(o/(n+r)),s=(o+r-a*(n+r))/2;let l=e[0],c=e[1];l[0]>c[0]&&(l=e[1],c=e[0]);const d=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let e=0;e<a;e++){const o=e*(n+r),a=o+n,c=[l[0]+o*Math.cos(d)+s*Math.cos(d),l[1]+o*Math.sin(d)+s*Math.sin(d)],u=[l[0]+a*Math.cos(d)+s*Math.cos(d),l[1]+a*Math.sin(d)+s*Math.sin(d)];i.push(...this.helper.doubleLineOps(c[0],c[1],u[0],u[1],t))}})),i}}class T{constructor(e){this.helper=e}fillPolygons(e,t){const n=t.hachureGap<0?4*t.strokeWidth:t.hachureGap,r=t.zigzagOffset<0?n:t.zigzagOffset,i=_(e,t=Object.assign({},t,{hachureGap:n+r}));return{type:"fillSketch",ops:this.zigzagLines(i,r,t)}}zigzagLines(e,t,n){const r=[];return e.forEach((e=>{const i=k(e),o=Math.round(i/(2*t));let a=e[0],s=e[1];a[0]>s[0]&&(a=e[1],s=e[0]);const l=Math.atan((s[1]-a[1])/(s[0]-a[0]));for(let e=0;e<o;e++){const i=2*e*t,o=2*(e+1)*t,s=Math.sqrt(2*Math.pow(t,2)),c=[a[0]+i*Math.cos(l),a[1]+i*Math.sin(l)],d=[a[0]+o*Math.cos(l),a[1]+o*Math.sin(l)],u=[c[0]+s*Math.cos(l+Math.PI/4),c[1]+s*Math.sin(l+Math.PI/4)];r.push(...this.helper.doubleLineOps(c[0],c[1],u[0],u[1],n),...this.helper.doubleLineOps(u[0],u[1],d[0],d[1],n))}})),r}}const M={};class O{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const L={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 A(e,t){return e.type===t}function P(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",i=0,o=n[i];for(;!A(o,2);){let a=0;const s=[];if("BOD"===r){if("M"!==o.text&&"m"!==o.text)return P("M0,0"+e);i++,a=L[o.text],r=o.text}else A(o,1)?a=L[r]:(i++,a=L[o.text],r=o.text);if(!(i+a<n.length))throw new Error("Path data ended short");for(let e=i;e<i+a;e++){const t=n[e];if(!A(t,1))throw new Error("Param not a number: "+r+","+t.text);s[s.length]=+t.text}if("number"!=typeof L[r])throw new Error("Bad segment: "+r);{const e={key:r,data:s};t.push(e),i+=a,o=n[i],"M"===r&&(r="L"),"m"===r&&(r="l")}}return t}function D(e){let t=0,n=0,r=0,i=0;const o=[];for(const{key:a,data:s}of e)switch(a){case"M":o.push({key:"M",data:[...s]}),[t,n]=s,[r,i]=s;break;case"m":t+=s[0],n+=s[1],o.push({key:"M",data:[t,n]}),r=t,i=n;break;case"L":o.push({key:"L",data:[...s]}),[t,n]=s;break;case"l":t+=s[0],n+=s[1],o.push({key:"L",data:[t,n]});break;case"C":o.push({key:"C",data:[...s]}),t=s[4],n=s[5];break;case"c":{const e=s.map(((e,r)=>r%2?e+n:e+t));o.push({key:"C",data:e}),t=e[4],n=e[5];break}case"Q":o.push({key:"Q",data:[...s]}),t=s[2],n=s[3];break;case"q":{const e=s.map(((e,r)=>r%2?e+n:e+t));o.push({key:"Q",data:e}),t=e[2],n=e[3];break}case"A":o.push({key:"A",data:[...s]}),t=s[5],n=s[6];break;case"a":t+=s[5],n+=s[6],o.push({key:"A",data:[s[0],s[1],s[2],s[3],s[4],t,n]});break;case"H":o.push({key:"H",data:[...s]}),t=s[0];break;case"h":t+=s[0],o.push({key:"H",data:[t]});break;case"V":o.push({key:"V",data:[...s]}),n=s[0];break;case"v":n+=s[0],o.push({key:"V",data:[n]});break;case"S":o.push({key:"S",data:[...s]}),t=s[2],n=s[3];break;case"s":{const e=s.map(((e,r)=>r%2?e+n:e+t));o.push({key:"S",data:e}),t=e[2],n=e[3];break}case"T":o.push({key:"T",data:[...s]}),t=s[0],n=s[1];break;case"t":t+=s[0],n+=s[1],o.push({key:"T",data:[t,n]});break;case"Z":case"z":o.push({key:"Z",data:[]}),t=r,n=i}return o}function z(e){const t=[];let n="",r=0,i=0,o=0,a=0,s=0,l=0;for(const{key:c,data:d}of e){switch(c){case"M":t.push({key:"M",data:[...d]}),[r,i]=d,[o,a]=d;break;case"C":t.push({key:"C",data:[...d]}),r=d[4],i=d[5],s=d[2],l=d[3];break;case"L":t.push({key:"L",data:[...d]}),[r,i]=d;break;case"H":r=d[0],t.push({key:"L",data:[r,i]});break;case"V":i=d[0],t.push({key:"L",data:[r,i]});break;case"S":{let e=0,o=0;"C"===n||"S"===n?(e=r+(r-s),o=i+(i-l)):(e=r,o=i),t.push({key:"C",data:[e,o,...d]}),s=d[0],l=d[1],r=d[2],i=d[3];break}case"T":{const[e,o]=d;let a=0,c=0;"Q"===n||"T"===n?(a=r+(r-s),c=i+(i-l)):(a=r,c=i);const u=r+2*(a-r)/3,h=i+2*(c-i)/3,p=e+2*(a-e)/3,g=o+2*(c-o)/3;t.push({key:"C",data:[u,h,p,g,e,o]}),s=a,l=c,r=e,i=o;break}case"Q":{const[e,n,o,a]=d,c=r+2*(e-r)/3,u=i+2*(n-i)/3,h=o+2*(e-o)/3,p=a+2*(n-a)/3;t.push({key:"C",data:[c,u,h,p,o,a]}),s=e,l=n,r=o,i=a;break}case"A":{const e=Math.abs(d[0]),n=Math.abs(d[1]),o=d[2],a=d[3],s=d[4],l=d[5],c=d[6];if(0===e||0===n)t.push({key:"C",data:[r,i,l,c,l,c]}),r=l,i=c;else if(r!==l||i!==c){H(r,i,l,c,e,n,o,a,s).forEach((function(e){t.push({key:"C",data:e})})),r=l,i=c}break}case"Z":t.push({key:"Z",data:[]}),r=o,i=a}n=c}return t}function R(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function H(e,t,n,r,i,o,a,s,l,c){const d=(u=a,Math.PI*u/180);var u;let h=[],p=0,g=0,m=0,f=0;if(c)[p,g,m,f]=c;else{[e,t]=R(e,t,-d),[n,r]=R(n,r,-d);const a=(e-n)/2,c=(t-r)/2;let u=a*a/(i*i)+c*c/(o*o);u>1&&(u=Math.sqrt(u),i*=u,o*=u);const h=i*i,b=o*o,v=h*b-h*c*c-b*a*a,x=h*c*c+b*a*a,y=(s===l?-1:1)*Math.sqrt(Math.abs(v/x));m=y*i*c/o+(e+n)/2,f=y*-o*a/i+(t+r)/2,p=Math.asin(parseFloat(((t-f)/o).toFixed(9))),g=Math.asin(parseFloat(((r-f)/o).toFixed(9))),e<m&&(p=Math.PI-p),n<m&&(g=Math.PI-g),p<0&&(p=2*Math.PI+p),g<0&&(g=2*Math.PI+g),l&&p>g&&(p-=2*Math.PI),!l&&g>p&&(g-=2*Math.PI)}let b=g-p;if(Math.abs(b)>120*Math.PI/180){const e=g,t=n,s=r;g=l&&g>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,h=H(n=m+i*Math.cos(g),r=f+o*Math.sin(g),t,s,i,o,a,0,l,[g,e,m,f])}b=g-p;const v=Math.cos(p),x=Math.sin(p),y=Math.cos(g),w=Math.sin(g),k=Math.tan(b/4),_=4/3*i*k,C=4/3*o*k,E=[e,t],S=[e+_*x,t-C*v],j=[n+_*w,r-C*y],I=[n,r];if(S[0]=2*E[0]-S[0],S[1]=2*E[1]-S[1],c)return[S,j,I].concat(h);{h=[S,j,I].concat(h);const e=[];for(let t=0;t<h.length;t+=3){const n=R(h[t][0],h[t][1],d),r=R(h[t+1][0],h[t+1][1],d),i=R(h[t+2][0],h[t+2][1],d);e.push([n[0],n[1],r[0],r[1],i[0],i[1]])}return e}}const N={randOffset:function(e,t){return $(e,t)},randOffsetWithRange:function(e,t,n){return q(e,t,n)},ellipse:function(e,t,n,r,i){const o=K(n,r,i);return V(e,t,i,o).opset},doubleLineOps:function(e,t,n,r,i){return Q(e,t,n,r,i,!0)}};function B(e,t,n,r,i){return{type:"path",ops:Q(e,t,n,r,i)}}function F(e,t,n){const r=(e||[]).length;if(r>2){const i=[];for(let t=0;t<r-1;t++)i.push(...Q(e[t][0],e[t][1],e[t+1][0],e[t+1][1],n));return t&&i.push(...Q(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:"path",ops:i}}return 2===r?B(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:"path",ops:[]}}function U(e,t,n,r,i){return function(e,t){return F(e,!0,t)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],i)}function W(e,t){let n=ee(e,1*(1+.2*t.roughness),t);if(!t.disableMultiStroke){const r=ee(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 K(e,t,n){const r=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),i=Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r),o=2*Math.PI/i;let a=Math.abs(e/2),s=Math.abs(t/2);const l=1-n.curveFitting;return a+=$(a*l,n),s+=$(s*l,n),{increment:o,rx:a,ry:s}}function V(e,t,n,r){const[i,o]=ne(r.increment,e,t,r.rx,r.ry,1,r.increment*q(.1,q(.4,1,n),n),n);let a=te(i,null,n);if(!n.disableMultiStroke&&0!==n.roughness){const[i]=ne(r.increment,e,t,r.rx,r.ry,1.5,0,n),o=te(i,null,n);a=a.concat(o)}return{estimatedPoints:o,opset:{type:"path",ops:a}}}function G(e,t,n,r,i,o,a,s,l){const c=e,d=t;let u=Math.abs(n/2),h=Math.abs(r/2);u+=$(.01*u,l),h+=$(.01*h,l);let p=i,g=o;for(;p<0;)p+=2*Math.PI,g+=2*Math.PI;g-p>2*Math.PI&&(p=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,f=Math.min(m/2,(g-p)/2),b=re(f,c,d,u,h,p,g,1,l);if(!l.disableMultiStroke){const e=re(f,c,d,u,h,p,g,1.5,l);b.push(...e)}return a&&(s?b.push(...Q(c,d,c+u*Math.cos(p),d+h*Math.sin(p),l),...Q(c,d,c+u*Math.cos(g),d+h*Math.sin(g),l)):b.push({op:"lineTo",data:[c,d]},{op:"lineTo",data:[c+u*Math.cos(p),d+h*Math.sin(p)]})),{type:"path",ops:b}}function Y(e,t){const n=[];for(const r of e)if(r.length){const e=t.maxRandomnessOffset||0,i=r.length;if(i>2){n.push({op:"move",data:[r[0][0]+$(e,t),r[0][1]+$(e,t)]});for(let o=1;o<i;o++)n.push({op:"lineTo",data:[r[o][0]+$(e,t),r[o][1]+$(e,t)]})}}return{type:"fillPath",ops:n}}function X(e,t){return function(e,t){let n=e.fillStyle||"hachure";if(!M[n])switch(n){case"zigzag":M[n]||(M[n]=new E(t));break;case"cross-hatch":M[n]||(M[n]=new S(t));break;case"dots":M[n]||(M[n]=new j(t));break;case"dashed":M[n]||(M[n]=new I(t));break;case"zigzag-line":M[n]||(M[n]=new T(t));break;default:n="hachure",M[n]||(M[n]=new C(t))}return M[n]}(t,N).fillPolygons(e,t)}function Z(e){return e.randomizer||(e.randomizer=new O(e.seed||0)),e.randomizer.next()}function q(e,t,n,r=1){return n.roughness*r*(Z(n)*(t-e)+e)}function $(e,t,n=1){return q(-e,e,t,n)}function Q(e,t,n,r,i,o=!1){const a=o?i.disableMultiStrokeFill:i.disableMultiStroke,s=J(e,t,n,r,i,!0,!1);if(a)return s;const l=J(e,t,n,r,i,!0,!0);return s.concat(l)}function J(e,t,n,r,i,o,a){const s=Math.pow(e-n,2)+Math.pow(t-r,2),l=Math.sqrt(s);let c=1;c=l<200?1:l>500?.4:-.0016668*l+1.233334;let d=i.maxRandomnessOffset||0;d*d*100>s&&(d=l/10);const u=d/2,h=.2+.2*Z(i);let p=i.bowing*i.maxRandomnessOffset*(r-t)/200,g=i.bowing*i.maxRandomnessOffset*(e-n)/200;p=$(p,i,c),g=$(g,i,c);const m=[],f=()=>$(u,i,c),b=()=>$(d,i,c),v=i.preserveVertices;return o&&(a?m.push({op:"move",data:[e+(v?0:f()),t+(v?0:f())]}):m.push({op:"move",data:[e+(v?0:$(d,i,c)),t+(v?0:$(d,i,c))]})),a?m.push({op:"bcurveTo",data:[p+e+(n-e)*h+f(),g+t+(r-t)*h+f(),p+e+2*(n-e)*h+f(),g+t+2*(r-t)*h+f(),n+(v?0:f()),r+(v?0:f())]}):m.push({op:"bcurveTo",data:[p+e+(n-e)*h+b(),g+t+(r-t)*h+b(),p+e+2*(n-e)*h+b(),g+t+2*(r-t)*h+b(),n+(v?0:b()),r+(v?0:b())]}),m}function ee(e,t,n){const r=[];r.push([e[0][0]+$(t,n),e[0][1]+$(t,n)]),r.push([e[0][0]+$(t,n),e[0][1]+$(t,n)]);for(let i=1;i<e.length;i++)r.push([e[i][0]+$(t,n),e[i][1]+$(t,n)]),i===e.length-1&&r.push([e[i][0]+$(t,n),e[i][1]+$(t,n)]);return te(r,null,n)}function te(e,t,n){const r=e.length,i=[];if(r>3){const o=[],a=1-n.curveTightness;i.push({op:"move",data:[e[1][0],e[1][1]]});for(let t=1;t+2<r;t++){const n=e[t];o[0]=[n[0],n[1]],o[1]=[n[0]+(a*e[t+1][0]-a*e[t-1][0])/6,n[1]+(a*e[t+1][1]-a*e[t-1][1])/6],o[2]=[e[t+1][0]+(a*e[t][0]-a*e[t+2][0])/6,e[t+1][1]+(a*e[t][1]-a*e[t+2][1])/6],o[3]=[e[t+1][0],e[t+1][1]],i.push({op:"bcurveTo",data:[o[1][0],o[1][1],o[2][0],o[2][1],o[3][0],o[3][1]]})}if(t&&2===t.length){const e=n.maxRandomnessOffset;i.push({op:"lineTo",data:[t[0]+$(e,n),t[1]+$(e,n)]})}}else 3===r?(i.push({op:"move",data:[e[1][0],e[1][1]]}),i.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):2===r&&i.push(...Q(e[0][0],e[0][1],e[1][0],e[1][1],n));return i}function ne(e,t,n,r,i,o,a,s){const l=[],c=[],d=$(.5,s)-Math.PI/2,u=0===s.roughness;u||c.push([$(o,s)+t+.9*r*Math.cos(d-e),$(o,s)+n+.9*i*Math.sin(d-e)]);const h=2*Math.PI+(u?0:d-.01);for(let a=d;a<h;a+=e){const e=[$(o,s)+t+r*Math.cos(a),$(o,s)+n+i*Math.sin(a)];l.push(e),c.push(e)}return u||(c.push([$(o,s)+t+r*Math.cos(d+2*Math.PI+.5*a),$(o,s)+n+i*Math.sin(d+2*Math.PI+.5*a)]),c.push([$(o,s)+t+.98*r*Math.cos(d+a),$(o,s)+n+.98*i*Math.sin(d+a)]),c.push([$(o,s)+t+.9*r*Math.cos(d+.5*a),$(o,s)+n+.9*i*Math.sin(d+.5*a)])),[c,l]}function re(e,t,n,r,i,o,a,s,l){const c=o+$(.1,l),d=[];d.push([$(s,l)+t+.9*r*Math.cos(c-e),$(s,l)+n+.9*i*Math.sin(c-e)]);for(let o=c;o<=a;o+=e)d.push([$(s,l)+t+r*Math.cos(o),$(s,l)+n+i*Math.sin(o)]);return d.push([t+r*Math.cos(a),n+i*Math.sin(a)]),d.push([t+r*Math.cos(a),n+i*Math.sin(a)]),te(d,null,l)}function ie(e,t,n,r,i,o,a,s){const l=[],c=[s.maxRandomnessOffset||1,(s.maxRandomnessOffset||1)+.3];let d=[0,0];const u=s.disableMultiStroke?1:2,h=s.preserveVertices;for(let p=0;p<u;p++)0===p?l.push({op:"move",data:[a[0],a[1]]}):l.push({op:"move",data:[a[0]+(h?0:$(c[0],s)),a[1]+(h?0:$(c[0],s))]}),d=h?[i,o]:[i+$(c[p],s),o+$(c[p],s)],l.push({op:"bcurveTo",data:[e+$(c[p],s),t+$(c[p],s),n+$(c[p],s),r+$(c[p],s),d[0],d[1]]});return l}function oe(e){return[...e]}function ae(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function se(e,t,n){const r=ae(t,n);if(0===r)return ae(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return i=Math.max(0,Math.min(1,i)),ae(e,le(t,n,i))}function le(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function ce(e,t,n,r){const i=r||[];if(function(e,t){const n=e[t+0],r=e[t+1],i=e[t+2],o=e[t+3];let a=3*r[0]-2*n[0]-o[0];a*=a;let s=3*r[1]-2*n[1]-o[1];s*=s;let l=3*i[0]-2*o[0]-n[0];l*=l;let c=3*i[1]-2*o[1]-n[1];return c*=c,a<l&&(a=l),s<c&&(s=c),a+s}(e,t)<n){const n=e[t+0];if(i.length){(o=i[i.length-1],a=n,Math.sqrt(ae(o,a)))>1&&i.push(n)}else i.push(n);i.push(e[t+3])}else{const r=.5,o=e[t+0],a=e[t+1],s=e[t+2],l=e[t+3],c=le(o,a,r),d=le(a,s,r),u=le(s,l,r),h=le(c,d,r),p=le(d,u,r),g=le(h,p,r);ce([o,c,h,g],0,n,i),ce([g,p,u,l],0,n,i)}var o,a;return i}function de(e,t){return ue(e,0,e.length,t)}function ue(e,t,n,r,i){const o=i||[],a=e[t],s=e[n-1];let l=0,c=1;for(let r=t+1;r<n-1;++r){const t=se(e[r],a,s);t>l&&(l=t,c=r)}return Math.sqrt(l)>r?(ue(e,t,c+1,r,o),ue(e,c,n,r,o)):(o.length||o.push(a),o.push(s)),o}function he(e,t=.15,n){const r=[],i=(e.length-1)/3;for(let n=0;n<i;n++){ce(e,3*n,t,r)}return n&&n>0?ue(r,0,r.length,n):r}const pe="none";class ge{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,t,n){return{shape:e,sets:t||[],options:n||this.defaultOptions}}line(e,t,n,r,i){const o=this._o(i);return this._d("line",[B(e,t,n,r,o)],o)}rectangle(e,t,n,r,i){const o=this._o(i),a=[],s=U(e,t,n,r,o);if(o.fill){const i=[[e,t],[e+n,t],[e+n,t+r],[e,t+r]];"solid"===o.fillStyle?a.push(Y([i],o)):a.push(X([i],o))}return o.stroke!==pe&&a.push(s),this._d("rectangle",a,o)}ellipse(e,t,n,r,i){const o=this._o(i),a=[],s=K(n,r,o),l=V(e,t,o,s);if(o.fill)if("solid"===o.fillStyle){const n=V(e,t,o,s).opset;n.type="fillPath",a.push(n)}else a.push(X([l.estimatedPoints],o));return o.stroke!==pe&&a.push(l.opset),this._d("ellipse",a,o)}circle(e,t,n,r){const i=this.ellipse(e,t,n,n,r);return i.shape="circle",i}linearPath(e,t){const n=this._o(t);return this._d("linearPath",[F(e,!1,n)],n)}arc(e,t,n,r,i,o,a=!1,s){const l=this._o(s),c=[],d=G(e,t,n,r,i,o,a,!0,l);if(a&&l.fill)if("solid"===l.fillStyle){const a=Object.assign({},l);a.disableMultiStroke=!0;const s=G(e,t,n,r,i,o,!0,!1,a);s.type="fillPath",c.push(s)}else c.push(function(e,t,n,r,i,o,a){const s=e,l=t;let c=Math.abs(n/2),d=Math.abs(r/2);c+=$(.01*c,a),d+=$(.01*d,a);let u=i,h=o;for(;u<0;)u+=2*Math.PI,h+=2*Math.PI;h-u>2*Math.PI&&(u=0,h=2*Math.PI);const p=(h-u)/a.curveStepCount,g=[];for(let e=u;e<=h;e+=p)g.push([s+c*Math.cos(e),l+d*Math.sin(e)]);return g.push([s+c*Math.cos(h),l+d*Math.sin(h)]),g.push([s,l]),X([g],a)}(e,t,n,r,i,o,l));return l.stroke!==pe&&c.push(d),this._d("arc",c,l)}curve(e,t){const n=this._o(t),r=[],i=W(e,n);if(n.fill&&n.fill!==pe&&e.length>=3){const t=function(e,t=0){const n=e.length;if(n<3)throw new Error("A curve must have at least three points.");const r=[];if(3===n)r.push(oe(e[0]),oe(e[1]),oe(e[2]),oe(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 i=[],o=1-t;r.push(oe(n[0]));for(let e=1;e+2<n.length;e++){const t=n[e];i[0]=[t[0],t[1]],i[1]=[t[0]+(o*n[e+1][0]-o*n[e-1][0])/6,t[1]+(o*n[e+1][1]-o*n[e-1][1])/6],i[2]=[n[e+1][0]+(o*n[e][0]-o*n[e+2][0])/6,n[e+1][1]+(o*n[e][1]-o*n[e+2][1])/6],i[3]=[n[e+1][0],n[e+1][1]],r.push(i[1],i[2],i[3])}}return r}(e),i=he(t,10,(1+n.roughness)/2);"solid"===n.fillStyle?r.push(Y([i],n)):r.push(X([i],n))}return n.stroke!==pe&&r.push(i),this._d("curve",r,n)}polygon(e,t){const n=this._o(t),r=[],i=F(e,!0,n);return n.fill&&("solid"===n.fillStyle?r.push(Y([e],n)):r.push(X([e],n))),n.stroke!==pe&&r.push(i),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 i=n.fill&&"transparent"!==n.fill&&n.fill!==pe,o=n.stroke!==pe,a=!!(n.simplification&&n.simplification<1),s=function(e,t,n){const r=z(D(P(e))),i=[];let o=[],a=[0,0],s=[];const l=()=>{s.length>=4&&o.push(...he(s,t)),s=[]},c=()=>{l(),o.length&&(i.push(o),o=[])};for(const{key:e,data:t}of r)switch(e){case"M":c(),a=[t[0],t[1]],o.push(a);break;case"L":l(),o.push([t[0],t[1]]);break;case"C":if(!s.length){const e=o.length?o[o.length-1]:a;s.push([e[0],e[1]])}s.push([t[0],t[1]]),s.push([t[2],t[3]]),s.push([t[4],t[5]]);break;case"Z":l(),o.push([a[0],a[1]])}if(c(),!n)return i;const d=[];for(const e of i){const t=de(e,n);t.length&&d.push(t)}return d}(e,1,a?4-4*n.simplification:(1+n.roughness)/2);return i&&("solid"===n.fillStyle?r.push(Y(s,n)):r.push(X(s,n))),o&&(a?s.forEach((e=>{r.push(F(e,!1,n))})):r.push(function(e,t){const n=z(D(P(e))),r=[];let i=[0,0],o=[0,0];for(const{key:e,data:a}of n)switch(e){case"M":{const e=1*(t.maxRandomnessOffset||0),n=t.preserveVertices;r.push({op:"move",data:a.map((r=>r+(n?0:$(e,t))))}),o=[a[0],a[1]],i=[a[0],a[1]];break}case"L":r.push(...Q(o[0],o[1],a[0],a[1],t)),o=[a[0],a[1]];break;case"C":{const[e,n,i,s,l,c]=a;r.push(...ie(e,n,i,s,l,c,o,t)),o=[l,c];break}case"Z":r.push(...Q(o[0],o[1],i[0],i[1],t)),o=[i[0],i[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:pe};break;case"fillPath":t={d:this.opsToPath(e),stroke:pe,strokeWidth:0,fill:n.fill||pe};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||pe,strokeWidth:n,fill:pe}}}class me{constructor(e,t){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new ge(t)}draw(e){const t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.ctx,i=e.options.fixedDecimalPlaceDigits;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,i),r.restore();break;case"fillPath":{r.save(),r.fillStyle=n.fill||"";const t="curve"===e.shape||"polygon"===e.shape||"path"===e.shape?"evenodd":"nonzero";this._drawToContext(r,o,i,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,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,t,n,r="nonzero"){e.beginPath();for(const r of t.ops){const t="number"==typeof n&&n>=0?r.data.map((e=>+e.toFixed(n))):r.data;switch(r.op){case"move":e.moveTo(t[0],t[1]);break;case"bcurveTo":e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]);break;case"lineTo":e.lineTo(t[0],t[1])}}"fillPath"===t.type?e.fill(r):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,t,n,r,i){const o=this.gen.line(e,t,n,r,i);return this.draw(o),o}rectangle(e,t,n,r,i){const o=this.gen.rectangle(e,t,n,r,i);return this.draw(o),o}ellipse(e,t,n,r,i){const o=this.gen.ellipse(e,t,n,r,i);return this.draw(o),o}circle(e,t,n,r){const i=this.gen.circle(e,t,n,r);return this.draw(i),i}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,i,o,a=!1,s){const l=this.gen.arc(e,t,n,r,i,o,a,s);return this.draw(l),l}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 fe="http://www.w3.org/2000/svg";class be{constructor(e,t){this.svg=e,this.gen=new ge(t)}draw(e){const t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.svg.ownerDocument||window.document,i=r.createElementNS(fe,"g"),o=e.options.fixedDecimalPlaceDigits;for(const a of t){let t=null;switch(a.type){case"path":t=r.createElementNS(fe,"path"),t.setAttribute("d",this.opsToPath(a,o)),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(fe,"path"),t.setAttribute("d",this.opsToPath(a,o)),t.setAttribute("stroke","none"),t.setAttribute("stroke-width","0"),t.setAttribute("fill",n.fill||""),"curve"!==e.shape&&"polygon"!==e.shape||t.setAttribute("fill-rule","evenodd");break;case"fillSketch":t=this.fillSketch(r,a,n)}t&&i.appendChild(t)}return i}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2);const i=e.createElementNS(fe,"path");return i.setAttribute("d",this.opsToPath(t,n.fixedDecimalPlaceDigits)),i.setAttribute("stroke",n.fill||""),i.setAttribute("stroke-width",r+""),i.setAttribute("fill","none"),n.fillLineDash&&i.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&i.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),i}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,t){return this.gen.opsToPath(e,t)}line(e,t,n,r,i){const o=this.gen.line(e,t,n,r,i);return this.draw(o)}rectangle(e,t,n,r,i){const o=this.gen.rectangle(e,t,n,r,i);return this.draw(o)}ellipse(e,t,n,r,i){const o=this.gen.ellipse(e,t,n,r,i);return this.draw(o)}circle(e,t,n,r){const i=this.gen.circle(e,t,n,r);return this.draw(i)}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,i,o,a=!1,s){const l=this.gen.arc(e,t,n,r,i,o,a,s);return this.draw(l)}curve(e,t){const n=this.gen.curve(e,t);return this.draw(n)}path(e,t){const n=this.gen.path(e,t);return this.draw(n)}}const ve={canvas:(e,t)=>new me(e,t),svg:(e,t)=>new be(e,t),generator:e=>new ge(e),newSeed:()=>ge.newSeed()};function xe(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=xe(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=xe(e))&&(r&&(r+=" "),r+=t);return r}let we=(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};const ke=e=>!!e&&"image"===e.type&&!!e.fileId,_e=e=>!!e&&"image"===e.type,Ce=e=>null!=e&&"text"===e.type,Ee=e=>null!=e&&Se(e.type),Se=e=>"freedraw"===e,je=e=>null!=e&&Ie(e.type),Ie=e=>"arrow"===e||"line"===e,Te=e=>null!=e&&Me(e.type),Me=e=>"arrow"===e,Oe=e=>null!=e&&("rectangle"===e.type||"diamond"===e.type||"ellipse"===e.type||"image"===e.type||"text"===e.type&&!e.containerId),Le=e=>null!=e&&("rectangle"===e.type||"diamond"===e.type||"ellipse"===e.type||"image"===e.type),Ae=e=>{var t;return Oe(e)&&!(null===(t=e.boundElements)||void 0===t||!t.some((e=>{let{type:t}=e;return"text"===t})))},Pe=e=>null!==e&&Ce(e)&&null!==e.containerId,De=(e,t,n,r,i)=>[(e-n)*Math.cos(i)-(t-r)*Math.sin(i)+n,(e-n)*Math.sin(i)+(t-r)*Math.cos(i)+r],ze=(e,t,n)=>De(e[0],e[1],t[0],t[1],n),Re=(e,t,n,r,i,o,a,s)=>{const l=Math.cos(r),c=Math.sin(r);return e.e&&e.w?t+=i+a:e.e?(t+=i*(1+l),n+=i*c,t+=a*(1-l),n+=a*-c):e.w&&(t+=i*(1-l),n+=i*-c,t+=a*(1+l),n+=a*c),e.n&&e.s?n+=o+s:e.n?(t+=o*c,n+=o*(1-l),t+=s*-c,n+=s*(1+l)):e.s&&(t+=o*-c,n+=o*(1+l),t+=s*c,n+=s*(1-l)),[t,n]},He=(e,t,n,r)=>{const i=n-e,o=r-t;return Math.hypot(i,o)},Ne=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(e.length>=3){const[n,r]=[e[0],e[e.length-1]];return He(n[0],n[1],r[0],r[1])<=o.qx/t}return!1},Be=(e,t,n)=>{const r=e.length;if(r<3)return!1;const i=[Number.MAX_SAFE_INTEGER,n],o=[t,n];let a=0;for(let t=0;t<r;t++){const n=e[t],s=e[(t+1)%r];if(We(n,s,o,i)){if(0===Ue(n,o,s))return Fe(n,o,s);a++}}return a%2==1},Fe=(e,t,n)=>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]),Ue=(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},We=(e,t,n,r)=>{const i=Ue(e,t,n),o=Ue(e,t,r),a=Ue(n,r,e),s=Ue(n,r,t);return i!==o&&a!==s||(!(0!==i||!Fe(e,n,t))||(!(0!==o||!Fe(e,r,t))||(!(0!==a||!Fe(n,e,r))||!(0!==s||!Fe(n,t,r)))))},Ke=(e,t,n)=>n?[Math.round(e/n)*n,Math.round(t/n)*n]:[e,t],Ve=e=>{const t=e.map((e=>e[0])),n=e.map((e=>e[1]));return{width:Math.max(...t)-Math.min(...t),height:Math.max(...n)-Math.min(...n)}},Ge=(e,t,n)=>{const r=n.map((t=>t[e])),i=Math.max(...r),o=Math.min(...r),a=i-o,s=0===a?1:t/a;let l=1/0;const c=n.map((t=>t.map(((t,n)=>{if(n!==e)return t;const r=t*s;return l=Math.min(r,l),r}))));if(2===c.length)return c;const d=o-l;return c.map((t=>t.map(((t,n)=>n===e?t+d:t))))},Ye=e=>Ee(e)?$e(e):je(e)?Qe(e):[e.x,e.y,e.x+e.width,e.y+e.height],Xe=e=>{for(const t of e.sets)if("path"===t.type)return t.ops;return e.sets[0].ops},Ze=(e,t)=>{let n=[0,0];const{minX:r,minY:i,maxX:o,maxY:a}=e.reduce(((e,r)=>{let{op:i,data:o}=r;if("move"===i)n=o;else if("bcurveTo"===i){const r=[o[0],o[1]],i=[o[2],o[3]],a=[o[4],o[5]],s=n;n=a;const l=(e,t)=>Math.pow(1-e,3)*a[t]+3*e*Math.pow(1-e,2)*i[t]+3*Math.pow(e,2)*(1-e)*r[t]+s[t]*Math.pow(e,3);let c=0;for(;c<=1;){let n=l(c,0),r=l(c,1);t&&([n,r]=t(n,r)),e.minY=Math.min(e.minY,r),e.minX=Math.min(e.minX,n),e.maxX=Math.max(e.maxX,n),e.maxY=Math.max(e.maxY,r),c+=.1}}return e}),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return[r,i,o,a]},qe=e=>{let t=1/0,n=1/0,r=-1/0,i=-1/0;for(const[o,a]of e)t=Math.min(t,o),n=Math.min(n,a),r=Math.max(r,o),i=Math.max(i,a);return[t,n,r,i]},$e=e=>{const[t,n,r,i]=qe(e.points);return[t+e.x,n+e.y,r+e.x,i+e.y]},Qe=e=>{let t;if(e.points.length<2||!pr(e)){const{minX:n,minY:r,maxX:i,maxY:o}=e.points.reduce(((e,t)=>{let[n,r]=t;return e.minY=Math.min(e.minY,r),e.minX=Math.min(e.minX,n),e.maxX=Math.max(e.maxX,n),e.maxY=Math.max(e.maxY,r),e}),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});t=[n+e.x,r+e.y,i+e.x,o+e.y]}else{const n=pr(e),r=Xe(n[0]),[i,o,a,s]=Ze(r);t=[i+e.x,o+e.y,a+e.x,s+e.y]}return t},Je=e=>{let t;const[n,r,i,o]=Ye(e),a=(n+i)/2,s=(r+o)/2;if(Ee(e)){const[t,n,r,i]=qe(e.points.map((t=>{let[n,r]=t;return De(n,r,a-e.x,s-e.y,e.angle)})));return[t+e.x,n+e.y,r+e.x,i+e.y]}if(je(e))t=((e,t,n)=>{if(e.points.length<2||!pr(e)){const{minX:r,minY:i,maxX:o,maxY:a}=e.points.reduce(((r,i)=>{let[o,a]=i;return[o,a]=De(e.x+o,e.y+a,t,n,e.angle),r.minY=Math.min(r.minY,a),r.minX=Math.min(r.minX,o),r.maxX=Math.max(r.maxX,o),r.maxY=Math.max(r.maxY,a),r}),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return[r,i,o,a]}const r=pr(e),i=Xe(r[0]);return Ze(i,((r,i)=>De(e.x+r,e.y+i,t,n,e.angle)))})(e,a,s);else if("diamond"===e.type){const[l,c]=De(a,r,a,s,e.angle),[d,u]=De(a,o,a,s,e.angle),[h,p]=De(n,s,a,s,e.angle),[g,m]=De(i,s,a,s,e.angle);t=[Math.min(l,d,h,g),Math.min(c,u,p,m),Math.max(l,d,h,g),Math.max(c,u,p,m)]}else if("ellipse"===e.type){const l=(i-n)/2,c=(o-r)/2,d=Math.cos(e.angle),u=Math.sin(e.angle),h=Math.hypot(l*d,c*u),p=Math.hypot(c*d,l*u);t=[a-h,s-p,a+h,s+p]}else{const[l,c]=De(n,r,a,s,e.angle),[d,u]=De(n,o,a,s,e.angle),[h,p]=De(i,o,a,s,e.angle),[g,m]=De(i,r,a,s,e.angle);t=[Math.min(l,d,h,g),Math.min(c,u,p,m),Math.max(l,d,h,g),Math.max(c,u,p,m)]}return t},et=e=>{if(!e.length)return[0,0,0,0];let t=1/0,n=-1/0,r=1/0,i=-1/0;return e.forEach((e=>{const[o,a,s,l]=Je(e);t=Math.min(t,o),r=Math.min(r,a),n=Math.max(n,s),i=Math.max(i,l)})),[t,r,n,i]},tt=(e,t,n)=>{if(!je(e)&&!Ee(e))return[e.x,e.y,e.x+t,e.y+n];const r=Ge(0,t,Ge(1,n,e.points));let i;if(Ee(e))i=qe(r);else{const t=ve.generator(),n="sharp"===e.strokeSharpness?t.linearPath(r,fr(e)):t.curve(r,fr(e)),o=Xe(n);i=Ze(o)}const[o,a,s,l]=i;return[o+e.x,a+e.y,s+e.x,l+e.y]},nt=(e,t,n)=>{const r=ve.generator(),i="sharp"===n?r.linearPath(t,fr(e)):r.curve(t,fr(e)),o=Xe(i),[a,s,l,c]=Ze(o);return[a+e.x,s+e.y,l+e.x,c+e.y]},rt=e=>{const[t,n,r,i]=et(e);return{minX:t,minY:n,maxX:r,maxY:i,width:r-t,height:i-n,midX:(t+r)/2,midY:(n+i)/2}},it=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"]}'),ot=e=>[it.red[e],it.pink[e],it.grape[e],it.violet[e],it.indigo[e],it.blue[e],it.cyan[e],it.teal[e],it.green[e],it.lime[e],it.yellow[e],it.orange[e]],at={canvasBackground:[it.white,it.gray[0],it.gray[1],...ot(0)],elementBackground:["transparent",it.gray[4],it.gray[6],...ot(6)],elementStroke:[it.black,it.gray[8],it.gray[7],...ot(9)]};var st=n(5156);const lt=/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),ct=/^Win/.test(window.navigator.platform),dt=/\b(android)\b/i.test(navigator.userAgent),ut="Equal",ht="Minus",pt="NumpadAdd",gt="NumpadSubtract",mt="Numpad0",ft="BracketRight",bt="BracketLeft",vt="Digit1",xt="Digit2",yt="Quote",wt="Digit0",kt="Slash",_t="KeyC",Ct="KeyD",Et="KeyG",St="KeyF",jt="KeyH",It="KeyV",Tt="KeyX",Mt="KeyZ",Ot="KeyR",Lt={ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",BACKSPACE:"Backspace",ALT:"Alt",CTRL_OR_CMD:lt?"metaKey":"ctrlKey",DELETE:"Delete",ENTER:"Enter",ESCAPE:"Escape",QUESTION_MARK:"?",SPACE:" ",TAB:"Tab",CHEVRON_LEFT:"<",CHEVRON_RIGHT:">",PERIOD:".",COMMA:",",A:"a",D:"d",E:"e",G:"g",I:"i",L:"l",O:"o",P:"p",Q:"q",R:"r",S:"s",T:"t",V:"v",X:"x",Y:"y",Z:"z",K:"k"},At=e=>e===Lt.ARROW_LEFT||e===Lt.ARROW_RIGHT||e===Lt.ARROW_DOWN||e===Lt.ARROW_UP,Pt=e=>e.altKey,Dt=e=>e.shiftKey,zt=e=>e.shiftKey;let Rt=null;const Ht=()=>{if(Rt)return Rt;const e=new Date,t=e.getFullYear(),n="".concat(e.getMonth()+1).padStart(2,"0"),r="".concat(e.getDate()).padStart(2,"0"),i="".concat(e.getHours()).padStart(2,"0"),o="".concat(e.getMinutes()).padStart(2,"0");return"".concat(t,"-").concat(n,"-").concat(r,"-").concat(i).concat(o)},Nt=e=>e.charAt(0).toUpperCase()+e.slice(1),Bt=e=>e instanceof HTMLElement&&"wysiwyg"===e.dataset.type||e instanceof HTMLBRElement||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&("text"===e.type||"number"===e.type),Ft=e=>{let{fontFamily:t}=e;for(const[e,n]of Object.entries(o.ut))if(n===t)return"".concat(e,", ").concat(o._D);return o._D},Ut=e=>{let{fontSize:t,fontFamily:n}=e;return"".concat(t,"px ").concat(Ft({fontFamily:n}))},Wt=(e,t)=>{let n=0,r=null;const i=function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];r=o,clearTimeout(n),n=window.setTimeout((()=>{r=null,e(...o)}),t)};return i.flush=()=>{if(clearTimeout(n),r){const t=r;r=null,e(...t)}},i.cancel=()=>{r=null,clearTimeout(n)},i},Kt=(e,t)=>Math.abs(e-t),Vt=e=>{e&&(e.style.cursor="")},Gt=(e,t)=>{e&&(e.style.cursor=t)},Yt=(e,t)=>{e&&("selection"===t?Vt(e):"image"!==t&&(e.style.cursor=o.oc.CROSSHAIR))},Xt=()=>{var e;return"HTML"===(null===(e=document.fullscreenElement)||void 0===e?void 0:e.nodeName)},Zt=e=>(e=e.replace(/\bAlt\b/i,"Alt").replace(/\bShift\b/i,"Shift").replace(/\b(Enter|Return)\b/i,"Enter").replace(/\bDel\b/i,"Delete"),lt?e.replace(/\bCtrlOrCmd\b/i,"Cmd").replace(/\bAlt\b/i,"Option"):e.replace(/\bCtrlOrCmd\b/i,"Ctrl")),qt=(e,t)=>{let{clientX:n,clientY:r}=e,{zoom:i,offsetLeft:o,offsetTop:a,scrollX:s,scrollY:l}=t;const c=1/i.value;return{x:(n-o)*c-s,y:(r-a)*c-l}},$t=(e,t)=>{let{sceneX:n,sceneY:r}=e,{zoom:i,offsetLeft:o,offsetTop:a,scrollX:s,scrollY:l}=t;return{x:(n+s)*i.value+o,y:(r+l)*i.value+a}},Qt=e=>getComputedStyle(document.documentElement).getPropertyValue("--".concat(e)),Jt=new RegExp("^[^".concat("A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-﷾--","]*[").concat("֑-߿יִ-﷽ﹰ-ﻼ","]")),en=e=>Jt.test(e),tn=e=>{const[t,n]=e;return{x:t,y:n}},nn=e=>{if("AbortError"!==(null==e?void 0:e.name))throw e;console.warn(e)},rn=e=>{const 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]},on=e=>t=>{(0,st.unstable_batchedUpdates)(e,t)},an=e=>(e=>{let t=null,n=null,r=null;const i=function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];n=o,r=e,null===t&&(t=window.requestAnimationFrame((()=>{t=null,n=null,r=null,e(...o)})))};return i.flush=()=>{if(null!==t&&(cancelAnimationFrame(t),t=null),n){const e=n,t=r;n=null,r=null,null!==t&&t(...e)}},i.cancel=()=>{n=null,r=null,null!==t&&(cancelAnimationFrame(t),t=null)},i})((t=>{(0,st.unstable_batchedUpdates)(e,t)})),sn=()=>cn()?1:Date.now(),ln=e=>e.reduce(((e,t)=>(e.set("string"==typeof t?t:t.id,t),e)),new Map),cn=()=>{var e;return"undefined"!=typeof process&&"test"===(null===(e={REACT_APP_BACKEND_V2_GET_URL:"https://json.excalidraw.com/api/v2/",REACT_APP_BACKEND_V2_POST_URL:"https://json.excalidraw.com/api/v2/post/",REACT_APP_LIBRARY_URL:"https://libraries.excalidraw.com",REACT_APP_LIBRARY_BACKEND:"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries",REACT_APP_SOCKET_SERVER_URL:"https://oss-collab-us1.excalidraw.com",REACT_APP_FIREBASE_CONFIG:'{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}',REACT_APP_GOOGLE_ANALYTICS_ID:"UA-387204-13"})||void 0===e?void 0:e.NODE_ENV)},dn=(e,t)=>new CustomEvent(e,{detail:{nativeEvent:t},cancelable:!0}),un=o.ZB.includes(devicePixelRatio)?devicePixelRatio:1,hn=()=>({theme:o.C6.LIGHT,collaborators:new Map,currentChartType:"bar",currentItemBackgroundColor:"transparent",currentItemEndArrowhead:"arrow",currentItemFillStyle:"hachure",currentItemFontFamily:o.rk,currentItemFontSize:o.n5,currentItemLinearStrokeSharpness:"round",currentItemOpacity:100,currentItemRoughness:1,currentItemStartArrowhead:null,currentItemStrokeColor:it.black,currentItemStrokeSharpness:"sharp",currentItemStrokeStyle:"solid",currentItemStrokeWidth:1,currentItemTextAlign:o.Hg,cursorButton:"up",draggingElement:null,editingElement:null,editingGroupId:null,editingLinearElement:null,elementLocked:!1,elementType:"selection",penMode:!1,penDetected:!1,errorMessage:null,exportBackground:!0,exportScale:un,exportEmbedScene:!1,exportWithDarkMode:!1,fileHandle:null,gridSize:null,isBindingEnabled:!0,isLibraryOpen:!1,isLoading:!1,isResizing:!1,isRotating:!1,lastPointerDownWith:"mouse",multiElement:null,name:"".concat(b("labels.untitled"),"-").concat(Ht()),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:it.white,zenModeEnabled:!1,zoom:{value:1},viewModeEnabled:!1,pendingImageElement:null,showHyperlinkPopup:!1}),pn={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},penMode:{browser:!1,export:!1,server:!1},penDetected:{browser:!1,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},showHyperlinkPopup:{browser:!1,export:!1,server:!1}},gn=(e,t)=>{const n={};for(const r of Object.keys(e)){const i=pn[r];if(null!=i&&i[t]){const t=e[r];n[r]=t}}return n},mn=e=>gn(e,"browser"),fn=e=>gn(e,"export"),bn=e=>gn(e,"server");function vn(e,t,n,r=(e=>e)){return e*r(.5-t*(.5-n))}function xn(e,t){return[e[0]+t[0],e[1]+t[1]]}function yn(e,t){return[e[0]-t[0],e[1]-t[1]]}function wn(e,t){return[e[0]*t,e[1]*t]}function kn(e){return[e[1],-e[0]]}function _n(e,t){return e[0]*t[0]+e[1]*t[1]}function Cn(e,t){return e[0]===t[0]&&e[1]===t[1]}function En(e,t){return function(e){return e[0]*e[0]+e[1]*e[1]}(yn(e,t))}function Sn(e){return function(e,t){return[e[0]/t,e[1]/t]}(e,function(e){return Math.hypot(e[0],e[1])}(e))}function jn(e,t){return Math.hypot(e[1]-t[1],e[0]-t[0])}function In(e,t,n){let r=Math.sin(n),i=Math.cos(n),o=e[0]-t[0],a=e[1]-t[1],s=o*r+a*i;return[o*i-a*r+t[0],s+t[1]]}function Tn(e,t,n){return xn(e,wn(yn(t,e),n))}function Mn(e,t,n){return xn(e,wn(t,n))}var{min:On,PI:Ln}=Math,An=Ln+1e-4;function Pn(e,t={}){return function(e,t={}){let{size:n=16,smoothing:r=.5,thinning:i=.5,simulatePressure:o=!0,easing:a=(e=>e),start:s={},end:l={},last:c=!1}=t,{cap:d=!0,taper:u=0,easing:h=(e=>e*(2-e))}=s,{cap:p=!0,taper:g=0,easing:m=(e=>--e*e*e+1)}=l;if(0===e.length||n<=0)return[];let f,b=e[e.length-1].runningLength,v=Math.pow(n*r,2),x=[],y=[],w=e.slice(0,10).reduce(((e,t)=>{let r=t.pressure;if(o){let i=On(1,t.distance/n),o=On(1,1-i);r=On(1,e+.275*i*(o-e))}return(e+r)/2}),e[0].pressure),k=vn(n,i,e[e.length-1].pressure,a),_=e[0].vector,C=e[0].point,E=C,S=C,j=E;for(let t=0;t<e.length;t++){let{pressure:r}=e[t],{point:s,vector:l,distance:c,runningLength:d}=e[t];if(t<e.length-1&&b-d<3)continue;if(i){if(o){let e=On(1,c/n),t=On(1,1-e);r=On(1,w+.275*e*(t-w))}k=vn(n,i,r,a)}else k=n/2;void 0===f&&(f=k);let p=d<u?h(d/u):1,I=b-d<g?m((b-d)/g):1;if(k=Math.max(.01,k*Math.min(p,I)),t===e.length-1){let e=wn(kn(l),k);x.push(yn(s,e)),y.push(xn(s,e));continue}let T=e[t+1].vector,M=_n(l,T);if(M<0){let e=wn(kn(_),k);for(let t=1/13,n=0;n<=1;n+=t)S=In(yn(s,e),s,An*n),x.push(S),j=In(xn(s,e),s,An*-n),y.push(j);C=S,E=j;continue}let O=wn(kn(Tn(T,l,M)),k);S=yn(s,O),(t<=1||En(C,S)>v)&&(x.push(S),C=S),j=xn(s,O),(t<=1||En(E,j)>v)&&(y.push(j),E=j),w=r,_=l}let I=e[0].point.slice(0,2),T=e.length>1?e[e.length-1].point.slice(0,2):xn(e[0].point,[1,1]),M=[],O=[];if(1===e.length){if(!u&&!g||c){let e=Mn(I,Sn(kn(yn(I,T))),-(f||k)),t=[];for(let n=1/13,r=n;r<=1;r+=n)t.push(In(e,I,2*An*r));return t}}else{if(!(u||g&&1===e.length))if(d)for(let e=1/13,t=e;t<=1;t+=e){let e=In(y[0],I,An*t);M.push(e)}else{let e=yn(x[0],y[0]),t=wn(e,.5),n=wn(e,.51);M.push(yn(I,t),yn(I,n),xn(I,n),xn(I,t))}let t=kn(function(e){return[-e[0],-e[1]]}(e[e.length-1].vector));if(g||u&&1===e.length)O.push(T);else if(p){let e=Mn(T,t,k);for(let t=1/29,n=t;n<1;n+=t)O.push(In(e,T,3*An*n))}else O.push(xn(T,wn(t,k)),xn(T,wn(t,.99*k)),yn(T,wn(t,.99*k)),yn(T,wn(t,k)))}return x.concat(O,y.reverse(),M)}(function(e,t={}){var n;let{streamline:r=.5,size:i=16,last:o=!1}=t;if(0===e.length)return[];let a=.15+.85*(1-r),s=Array.isArray(e[0])?e:e.map((({x:e,y:t,pressure:n=.5})=>[e,t,n]));if(2===s.length){let e=s[1];s=s.slice(0,-1);for(let t=1;t<5;t++)s.push(Tn(s[0],e,t/4))}1===s.length&&(s=[...s,[...xn(s[0],[1,1]),...s[0].slice(2)]]);let l=[{point:[s[0][0],s[0][1]],pressure:s[0][2]>=0?s[0][2]:.25,vector:[1,1],distance:0,runningLength:0}],c=!1,d=0,u=l[0],h=s.length-1;for(let e=1;e<s.length;e++){let t=o&&e===h?s[e].slice(0,2):Tn(u.point,s[e],a);if(Cn(u.point,t))continue;let n=jn(t,u.point);if(d+=n,e<h&&!c){if(d<i)continue;c=!0}u={point:t,pressure:s[e][2]>=0?s[e][2]:.5,vector:Sn(yn(u.point,t)),distance:n,runningLength:d},l.push(u)}return l[0].vector=(null==(n=l[1])?void 0:n.vector)||[0,0],l}(e,t),t)}const Dn=e=>"string"==typeof e;class zn{constructor(){this.callbacks=new Set,this.nonDeletedElements=[],this.elements=[],this.elementsMap=new Map}static mapElementToScene(e,t){Dn(e)?this.sceneMapById.set(e,t):this.sceneMapByElement.set(e,t)}static getScene(e){return Dn(e)?this.sceneMapById.get(e)||null:this.sceneMapByElement.get(e)||null}getElementsIncludingDeleted(){return this.elements}getElements(){return this.nonDeletedElements}getElement(e){return this.elementsMap.get(e)||null}getNonDeletedElement(e){const t=this.getElement(e);return t&&Cl(t)?t:null}getNonDeletedElements(e){const t=[];return e.forEach((e=>{const n=this.getNonDeletedElement(e);null!=n&&t.push(n)})),t}replaceAllElements(e){this.elements=e,this.elementsMap.clear(),e.forEach((e=>{this.elementsMap.set(e.id,e),zn.mapElementToScene(e,this)})),this.nonDeletedElements=_l(this.elements),this.informMutation()}informMutation(){for(const e of Array.from(this.callbacks))e()}addCallback(e){if(this.callbacks.has(e))throw new Error;return this.callbacks.add(e),()=>{if(!this.callbacks.has(e))throw new Error;this.callbacks.delete(e)}}destroy(){zn.sceneMapById.forEach(((e,t)=>{e===this&&zn.sceneMapById.delete(t)})),this.callbacks.clear()}}zn.sceneMapByElement=new WeakMap,zn.sceneMapById=new Map;const Rn=zn,Hn=(e,t,n)=>{const r=t?t.width-2*o.gK:void 0;let i=e.text;t&&(i=Yn(e.originalText,Ut(e),t.width));const a=Fn(e.originalText,Ut(e),r);let s=e.y;if(t){let n=t.height;e.verticalAlign===o.oX.TOP?s=t.y+o.gK:e.verticalAlign===o.oX.BOTTOM?s=t.y+t.height-a.height-o.gK:(s=t.y+t.height/2-a.height/2,a.height>t.height-2*o.gK&&(n=a.height+2*o.gK,s=t.y+n/2-a.height/2)),Lr(t,{height:n})}Lr(e,{width:a.width,height:a.height,baseline:a.baseline,y:s,text:i})},Nn=(e,t,n)=>{const r=ln(e);t.forEach((e=>{const t=n.get(e.id),i=Qn(e);if(i){const a=n.get(i);if(a){const n=r.get(t);var o;if(n)Lr(n,{boundElements:null===(o=e.boundElements)||void 0===o?void 0:o.concat({type:"text",id:a})});const i=r.get(a);i&&Ce(i)&&Lr(i,{containerId:n?t:null})}}}))},Bn=(e,t)=>{const n=Qn(e);if(n){const r=Rn.getScene(e).getElement(n);if(r&&r.text){if(!e)return;let n,i=r.text,a=r.height,s=e.height,l=r.baseline;if("n"!==t&&"s"!==t){i&&(i=Yn(r.originalText,Ut(r),e.width));const t=Fn(i,Ut(r),e.width);a=t.height,l=t.baseline}if(a>e.height-2*o.gK){s=a+2*o.gK;const n=s-e.height,r="ne"===t||"nw"===t||"n"===t?e.y-n:e.y;Lr(e,{height:s,y:r})}n=r.verticalAlign===o.oX.TOP?e.y+o.gK:r.verticalAlign===o.oX.BOTTOM?e.y+e.height-a-o.gK:e.y+e.height/2-a/2,Lr(r,{text:i,width:e.width-2*o.gK,height:a,x:e.x+o.gK,y:n,baseline:l})}}},Fn=(e,t,n)=>{e=e.split("\n").map((e=>e||" ")).join("\n");const r=document.createElement("div");if(r.style.position="absolute",r.style.whiteSpace="pre",r.style.font=t,r.style.minHeight="1em",n){const e=Kn(t);r.style.width="".concat(String(n),"px"),r.style.maxWidth="".concat(String(n),"px"),r.style.overflow="hidden",r.style.wordBreak="break-word",r.style.lineHeight="".concat(String(e),"px"),r.style.whiteSpace="pre-wrap"}document.body.appendChild(r),r.innerText=e;const i=document.createElement("span");i.style.display="inline-block",i.style.overflow="hidden",i.style.width="1px",i.style.height="1px",r.appendChild(i);const o=i.offsetTop+i.offsetHeight,a=r.offsetWidth,s=r.offsetHeight;return document.body.removeChild(r),{width:a,height:s,baseline:o}},Un="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".toLocaleUpperCase(),Wn={},Kn=e=>(Wn[e]||(Wn[e]=Fn(Un,e,null).height),Wn[e]);let Vn;const Gn=(e,t)=>{Vn||(Vn=document.createElement("canvas"));const n=Vn.getContext("2d");n.font=t;const r=n.measureText(e);return cn()?10*r.width:r.width},Yn=(e,t,n)=>{const r=n-2*o.gK,i=[],a=e.split("\n"),s=Gn(" ",t);return a.forEach((e=>{const n=e.split(" ");if(1===n.length&&""===n[0])i.push(n[0]);else{let e="",o=0,a=0;for(;a<n.length;){if(Gn(n[a],t)>=r){for(e&&i.push(e),e="",o=0;n[a].length>0;){const s=n[a][0],l=Xn.calculate(s,t);o+=l,n[a]=n[a].slice(1),o>=r?(" "===e.slice(-1)&&(e=e.slice(0,-1)),i.push(e),e=s,o=l,o===r&&(e="",o=0)):e+=s}o+s>=r?(i.push(e),e="",o=0):(e+=" ",o+=s),a++}else{for(;o<r&&a<n.length;){const l=n[a];if(o=Gn(e+l,t),o>=r){i.push(e),o=0,e="";break}if(a++,e+="".concat(l," "),o+s>=r){i.push(e.slice(0,-1)),e="",o=0;break}}o===r&&(e="",o=0)}}e&&(" "===e.slice(-1)&&(e=e.slice(0,-1)),i.push(e))}})),i.join("\n")},Xn=(()=>{const e={};return{calculate:(t,n)=>{const r=t.charCodeAt(0);if(e[n]||(e[n]=[]),!e[n][r]){const i=Gn(t,n);e[n][r]=i}return e[n][r]},getCache:t=>e[t]}})(),Zn=e=>{const t=$n(e);return 0===t?Fn(Un.split("").join("\n"),e).width+2*o.gK:t+2*o.gK},qn=e=>Kn(e)+2*o.gK,$n=e=>{const t=Xn.getCache(e);if(!t)return 0;const n=t.filter((e=>void 0!==e));return Math.max(...n)},Qn=e=>{var t,n,r;return null!=e&&null!==(t=e.boundElements)&&void 0!==t&&t.length&&(null==e||null===(n=e.boundElements)||void 0===n||null===(r=n.filter((e=>"text"===e.type))[0])||void 0===r?void 0:r.id)||null},Jn=e=>{if(!e)return null;const t=Qn(e);var n;return t&&(null===(n=Rn.getScene(e))||void 0===n?void 0:n.getElement(t))||null},er=e=>{return e&&e.containerId&&(null===(t=Rn.getScene(e))||void 0===t?void 0:t.getElement(e.containerId))||null;var t},tr="invert(100%) hue-rotate(180deg) saturate(1.25)",nr=hn(),rr=(e,t)=>ke(e)&&!t.imageCache.has(e.fileId),ir=(e,t)=>{var n;return"dark"===t.theme&&ke(e)&&!rr(e,t)&&(null===(n=t.imageCache.get(e.fileId))||void 0===n?void 0:n.mimeType)!==o.LO.svg},or=e=>[8,8+e],ar=e=>[1.5,6+e],sr=e=>"freedraw"===e.type?12*e.strokeWidth:20,lr=document.createElement("img");lr.src="data:".concat(o.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>'));const cr=document.createElement("img");cr.src="data:".concat(o.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>'));const dr=(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(pr(e));break;case"arrow":case"line":n.lineJoin="round",n.lineCap="round",pr(e).forEach((e=>{t.draw(e)}));break;case"freedraw":{n.save(),n.fillStyle=e.strokeColor;const r=function(e){return _r.get(e)}(e),i=pr(e);i&&t.draw(i),n.fillStyle=e.strokeColor,n.fill(r),n.restore();break}case"image":{var i;const t=ke(e)?null===(i=r.imageCache.get(e.fileId))||void 0===i?void 0:i.image:void 0;null==t||t instanceof Promise?((e,t,n)=>{t.fillStyle="#E7E7E7",t.fillRect(0,0,e.width,e.height);const r=Math.min(e.width,e.height),i=Math.min(r,Math.min(.4*r,100));t.drawImage("error"===e.status?cr:lr,e.width/2-i/2,e.height/2-i/2,i,i)})(e,n,r.zoom.value):n.drawImage(t,0,0,e.width,e.height);break}default:if(!Ce(e))throw new Error("Unimplemented type ".concat(e.type));{const t=en(e.text),r=t&&!n.canvas.isConnected;r&&document.body.appendChild(n.canvas),n.canvas.setAttribute("dir",t?"rtl":"ltr"),n.save(),n.font=Ut(e),n.fillStyle=e.strokeColor,n.textAlign=e.textAlign;const i=e.text.replace(/\r\n?/g,"\n").split("\n"),a=e.containerId?Kn(Ut(e)):e.height/i.length;let s=e.height-e.baseline;e.verticalAlign===o.oX.BOTTOM&&(s=o.gK);const l="center"===e.textAlign?e.width/2:"right"===e.textAlign?e.width:0;for(let e=0;e<i.length;e++)n.fillText(i[e],l,(e+1)*a-s);n.restore(),r&&n.canvas.remove()}}n.globalAlpha=1};let ur=new WeakMap,hr=new WeakMap;const pr=e=>hr.get(e),gr=(e,t)=>hr.set(e,t),mr=e=>hr.delete(e),fr=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n={seed:e.seed,strokeLineDash:"dashed"===e.strokeStyle?or(e.strokeWidth):"dotted"===e.strokeStyle?ar(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"ellipse":return n.fillStyle=e.fillStyle,n.fill="transparent"===e.backgroundColor?void 0:e.backgroundColor,"ellipse"===e.type&&(n.curveFitting=1),n;case"line":case"freedraw":return Ne(e.points)&&(n.fillStyle=e.fillStyle,n.fill="transparent"===e.backgroundColor?void 0:e.backgroundColor),n;case"arrow":return n;default:throw new Error("Unimplemented type ".concat(e.type))}},br=(e,t)=>{let n=hr.get(e);if(void 0===n)switch(ur.delete(e),e.type){case"rectangle":if("round"===e.strokeSharpness){const r=e.width,i=e.height,o=.25*Math.min(r,i);n=t.path("M ".concat(o," 0 L ").concat(r-o," 0 Q ").concat(r," 0, ").concat(r," ").concat(o," L ").concat(r," ").concat(i-o," Q ").concat(r," ").concat(i,", ").concat(r-o," ").concat(i," L ").concat(o," ").concat(i," Q 0 ").concat(i,", 0 ").concat(i-o," L 0 ").concat(o," Q 0 0, ").concat(o," 0"),fr(e,!0))}else n=t.rectangle(0,0,e.width,e.height,fr(e));gr(e,n);break;case"diamond":{const[r,i,o,a,s,l,c,d]=(e=>{const 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);n="round"===e.strokeSharpness?t.path("M ".concat(r+.25*(o-r)," ").concat(i+.25*(a-i)," L ").concat(o-.25*(o-r)," ").concat(a-.25*(a-i),"\n C ").concat(o," ").concat(a,", ").concat(o," ").concat(a,", ").concat(o-.25*(o-s)," ").concat(a+.25*(l-a),"\n L ").concat(s+.25*(o-s)," ").concat(l-.25*(l-a),"\n C ").concat(s," ").concat(l,", ").concat(s," ").concat(l,", ").concat(s-.25*(s-c)," ").concat(l-.25*(l-d),"\n L ").concat(c+.25*(s-c)," ").concat(d+.25*(l-d),"\n C ").concat(c," ").concat(d,", ").concat(c," ").concat(d,", ").concat(c+.25*(r-c)," ").concat(d-.25*(d-i),"\n L ").concat(r-.25*(r-c)," ").concat(i+.25*(d-i),"\n C ").concat(r," ").concat(i,", ").concat(r," ").concat(i,", ").concat(r+.25*(o-r)," ").concat(i+.25*(a-i)),fr(e,!0)):t.polygon([[r,i],[o,a],[s,l],[c,d]],fr(e)),gr(e,n);break}case"ellipse":n=t.ellipse(e.width/2,e.height/2,e.width,e.height,fr(e)),gr(e,n);break;case"line":case"arrow":{const r=fr(e),i=e.points.length?e.points:[[0,0]];if(n="sharp"===e.strokeSharpness?r.fill?[t.polygon(i,r)]:[t.linearPath(i,r)]:[t.curve(i,r)],"arrow"===e.type){const{startArrowhead:i=null,endArrowhead:o="arrow"}=e,a=(e,n,i,o)=>{const a=((e,t,n,r)=>{const i=Xe(t[0]);if(i.length<1)return null;const o="start"===n?1:i.length-1,a=i[o].data,s=[a[4],a[5]],l=[a[2],a[3]],c=[a[0],a[1]],d=i[o-1];let u=[0,0];"move"===d.op?u=d.data:"bcurveTo"===d.op&&(u=[d.data[4],d.data[5]]);const h=(e,t)=>Math.pow(1-e,3)*s[t]+3*e*Math.pow(1-e,2)*l[t]+3*Math.pow(e,2)*(1-e)*c[t]+u[t]*Math.pow(e,3),[p,g]="start"===n?u:s,[m,f]=[h(.3,0),h(.3,1)],b=Math.hypot(p-m,g-f),v=(p-m)/b,x=(g-f)/b,y={arrow:30,bar:15,dot:15,triangle:15}[r];let w=0;if("arrow"===r){const[t,n]=e.points[e.points.length-1],[r,i]=e.points.length>1?e.points[e.points.length-2]:[0,0];w=Math.hypot(t-r,n-i)}else for(let t=0;t<e.points.length;t++){const[n,r]=e.points[t-1]||[0,0],[i,o]=e.points[t];w+=Math.hypot(i-n,o-r)}const k=Math.min(y,w/2),_=p-v*k,C=g-x*k;if("dot"===r)return[p,g,Math.hypot(C-g,_-p)+e.strokeWidth];const E={arrow:20,bar:90,triangle:25}[r],[S,j]=De(_,C,p,g,-E*Math.PI/180),[I,T]=De(_,C,p,g,E*Math.PI/180);return[p,g,S,j,I,T]})(e,n,i,o);if(null===a)return[];if("dot"===o){const[n,i,o]=a;return[t.circle(n,i,o,Object.assign(Object.assign({},r),{fill:e.strokeColor,fillStyle:"solid",stroke:"none"}))]}if("triangle"===o){const[n,i,o,s,l,c]=a;return delete r.strokeLineDash,[t.polygon([[n,i],[o,s],[l,c],[n,i]],Object.assign(Object.assign({},r),{fill:e.strokeColor,fillStyle:"solid"}))]}const[s,l,c,d,u,h]=a;if("dotted"===e.strokeStyle){const t=ar(e.strokeWidth-1);r.strokeLineDash=[t[0],t[1]-1]}else delete r.strokeLineDash;return[t.line(c,d,s,l,r),t.line(u,h,s,l,r)]};if(null!==i){const t=a(e,n,"start",i);n.push(...t)}if(null!==o){const t=a(e,n,"end",o);n.push(...t)}}gr(e,n);break}case"freedraw":Cr(e),n=Ne(e.points)?t.polygon(e.points,Object.assign(Object.assign({},fr(e)),{stroke:"none"})):null,gr(e,n);break;case"text":case"image":gr(e,null)}},vr=(e,t)=>{const n=t?t.zoom:nr.zoom,r=ur.get(e),i=r&&r.canvasZoom!==n.value&&!(null!=t&&t.shouldCacheIgnoreZoom);if(!r||i||r.theme!==t.theme){const r=((e,t,n)=>{const r=document.createElement("canvas"),i=r.getContext("2d"),o=sr(e);let a=0,s=0;if(je(e)||Ee(e)){const[n,l,c,d]=Ye(e);r.width=Kt(n,c)*window.devicePixelRatio*t.value+o*t.value*2,r.height=Kt(l,d)*window.devicePixelRatio*t.value+o*t.value*2,a=e.x>n?Kt(e.x,n)*window.devicePixelRatio*t.value:0,s=e.y>l?Kt(e.y,l)*window.devicePixelRatio*t.value:0,i.translate(a,s)}else r.width=e.width*window.devicePixelRatio*t.value+o*t.value*2,r.height=e.height*window.devicePixelRatio*t.value+o*t.value*2;i.save(),i.translate(o*t.value,o*t.value),i.scale(window.devicePixelRatio*t.value,window.devicePixelRatio*t.value);const l=ve.canvas(r);return ir(e,n)&&(i.filter=tr),dr(e,l,i,n),i.restore(),{element:e,canvas:r,theme:n.theme,canvasZoom:t.value,canvasOffsetX:a,canvasOffsetY:s}})(e,n,t);return ur.set(e,r),r}return r},xr=(e,t,n,r)=>{const i=e.element,o=sr(i);let[a,s,l,c]=Ye(i);Ee(i)&&(a=Math.floor(a),l=Math.ceil(l),s=Math.floor(s),c=Math.ceil(c));const d=((a+l)/2+r.scrollX)*window.devicePixelRatio,u=((s+c)/2+r.scrollY)*window.devicePixelRatio,h=rr(i,r),p="scale"in e.element&&!h?e.element.scale[0]:1,g="scale"in e.element&&!h?e.element.scale[1]:1;n.save(),n.scale(1/window.devicePixelRatio*p,1/window.devicePixelRatio*g),n.translate(d*p,u*g),n.rotate(i.angle*p*g),n.drawImage(e.canvas,-(l-a)/2*window.devicePixelRatio-o*e.canvasZoom/e.canvasZoom,-(c-s)/2*window.devicePixelRatio-o*e.canvasZoom/e.canvasZoom,e.canvas.width/e.canvasZoom,e.canvas.height/e.canvasZoom),n.restore()},yr=(e,t,n,r)=>{const i=t.generator;switch(e.type){case"selection":n.save(),n.translate(e.x+r.scrollX,e.y+r.scrollY),n.fillStyle="rgba(0, 0, 255, 0.10)",n.fillRect(0,0,e.width,e.height),n.restore();break;case"freedraw":if(br(e,i),r.isExporting){const t=vr(e,r);xr(t,0,n,r)}else{const[i,o,a,s]=Ye(e),l=(i+a)/2+r.scrollX,c=(o+s)/2+r.scrollY,d=(a-i)/2-(e.x-i),u=(s-o)/2-(e.y-o);n.save(),n.translate(l,c),n.rotate(e.angle),n.translate(-d,-u),dr(e,t,n,r),n.restore()}break;case"rectangle":case"diamond":case"ellipse":case"line":case"arrow":case"image":case"text":if(br(e,i),r.isExporting){const[i,o,a,s]=Ye(e),l=(i+a)/2+r.scrollX,c=(o+s)/2+r.scrollY,d=(a-i)/2-(e.x-i),u=(s-o)/2-(e.y-o);n.save(),n.translate(l,c),n.rotate(e.angle),n.translate(-d,-u),ir(e,r)&&(n.filter="none"),dr(e,t,n,r),n.restore()}else{const t=vr(e,r);xr(t,0,n,r)}break;default:throw new Error("Unimplemented type ".concat(e.type))}},wr=(e,t,n)=>{if(void 0===n)return e.draw(t);const r={sets:t.sets,shape:t.shape,options:Object.assign(Object.assign({},t.options),{fixedDecimalPlaceDigits:n})};return e.draw(r)},kr=(e,t,n,r,i,a,s)=>{const[l,c,d,u]=Ye(e),h=(d-l)/2-(e.x-l),p=(u-c)/2-(e.y-c),g=180*e.angle/Math.PI,m=t.generator;let f=n;if(e.link){const t=n.ownerDocument.createElementNS(o.hR,"a");t.setAttribute("href",e.link),f.appendChild(t),f=t}switch(e.type){case"selection":throw new Error("Selection rendering is not supported for SVG");case"rectangle":case"diamond":case"ellipse":{br(e,m);const n=wr(t,pr(e),o.zK),r=e.opacity/100;1!==r&&(n.setAttribute("stroke-opacity","".concat(r)),n.setAttribute("fill-opacity","".concat(r))),n.setAttribute("stroke-linecap","round"),n.setAttribute("transform","translate(".concat(i||0," ").concat(a||0,") rotate(").concat(g," ").concat(h," ").concat(p,")")),f.appendChild(n);break}case"line":case"arrow":{br(e,m);const r=n.ownerDocument.createElementNS(o.hR,"g"),s=e.opacity/100;r.setAttribute("stroke-linecap","round"),pr(e).forEach((n=>{const l=wr(t,n,o.zK);1!==s&&(l.setAttribute("stroke-opacity","".concat(s)),l.setAttribute("fill-opacity","".concat(s))),l.setAttribute("transform","translate(".concat(i||0," ").concat(a||0,") rotate(").concat(g," ").concat(h," ").concat(p,")")),"line"===e.type&&Ne(e.points)&&"transparent"!==e.backgroundColor&&l.setAttribute("fill-rule","evenodd"),r.appendChild(l)})),f.appendChild(r);break}case"freedraw":{Cr(e);const r=e.opacity/100,s=pr(e),l=s?wr(t,s,o.zK):n.ownerDocument.createElementNS(o.hR,"g");1!==r&&(l.setAttribute("stroke-opacity","".concat(r)),l.setAttribute("fill-opacity","".concat(r))),l.setAttribute("transform","translate(".concat(i||0," ").concat(a||0,") rotate(").concat(g," ").concat(h," ").concat(p,")")),l.setAttribute("stroke","none");const c=n.ownerDocument.createElementNS(o.hR,"path");c.setAttribute("fill",e.strokeColor),c.setAttribute("d",Er(e)),l.appendChild(c),f.appendChild(l);break}case"image":{const t=ke(e)&&r[e.fileId];if(t){const r="image-".concat(t.id);let l=n.querySelector("#".concat(r));if(!l){l=n.ownerDocument.createElementNS(o.hR,"symbol"),l.id=r;const e=n.ownerDocument.createElementNS(o.hR,"image");e.setAttribute("width","100%"),e.setAttribute("height","100%"),e.setAttribute("href",t.dataURL),l.appendChild(e),f.prepend(l)}const c=n.ownerDocument.createElementNS(o.hR,"use");c.setAttribute("href","#".concat(r)),s&&t.mimeType!==o.LO.svg&&c.setAttribute("filter",tr),c.setAttribute("width","".concat(Math.round(e.width))),c.setAttribute("height","".concat(Math.round(e.height))),c.setAttribute("transform","translate(".concat(i||0," ").concat(a||0,") rotate(").concat(g," ").concat(h," ").concat(p,")")),f.appendChild(c)}break}default:if(!Ce(e))throw new Error("Unimplemented type ".concat(e.type));{const t=e.opacity/100,r=n.ownerDocument.createElementNS(o.hR,"g");1!==t&&(r.setAttribute("stroke-opacity","".concat(t)),r.setAttribute("fill-opacity","".concat(t))),r.setAttribute("transform","translate(".concat(i||0," ").concat(a||0,") rotate(").concat(g," ").concat(h," ").concat(p,")"));const s=e.text.replace(/\r\n?/g,"\n").split("\n"),l=e.height/s.length,c=e.height-e.baseline,d="center"===e.textAlign?e.width/2:"right"===e.textAlign?e.width:0,u=en(e.text)?"rtl":"ltr",m="center"===e.textAlign?"middle":"right"===e.textAlign||"rtl"===u?"end":"start";for(let t=0;t<s.length;t++){const i=n.ownerDocument.createElementNS(o.hR,"text");i.textContent=s[t],i.setAttribute("x","".concat(d)),i.setAttribute("y","".concat((t+1)*l-c)),i.setAttribute("font-family",Ft(e)),i.setAttribute("font-size","".concat(e.fontSize,"px")),i.setAttribute("fill",e.strokeColor),i.setAttribute("text-anchor",m),i.setAttribute("style","white-space: pre;"),i.setAttribute("direction",u),r.appendChild(i)}f.appendChild(r)}}};let _r=new WeakMap([]);function Cr(e){const t=Er(e),n=new Path2D(t);return _r.set(e,n),n}function Er(e){const t=e.simulatePressure?e.points:e.points.length?e.points.map(((t,n)=>{let[r,i]=t;return[r,i,e.pressures[n]]})):[[0,0,.5]],n={simulatePressure:e.simulatePressure,size:4.25*e.strokeWidth,thinning:.6,smoothing:.5,streamline:.5,easing:e=>Math.sin(e*Math.PI/2),last:!!e.lastCommittedPoint};return function(e){if(!e.length)return"";const t=e.length-1;return e.reduce(((e,n,r,i)=>(r===t?e.push(n,Sr(n,i[0]),"L",i[0],"Z"):e.push(n,Sr(n,i[r+1])),e)),["M",e[0],"Q"]).join(" ").replace(jr,"$1")}(Pn(t,n))}function Sr(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}const jr=/(\s?[A-Z]?,?-?[0-9]*\.[0-9]{0,2})(([0-9]|e|-)*)/g;let Ir=new O(Date.now()),Tr=0;const Mr=()=>Math.floor(Ir.next()*2**31),Or=()=>cn()?"id".concat(Tr++):we(),Lr=function(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=!1;const{points:i,fileId:o}=t;void 0!==i&&(t=Object.assign(Object.assign({},Ve(i)),t));for(const n in t){const i=t[n];if(void 0!==i){if(e[n]===i&&("object"!=typeof i||null===i||"groupIds"===n||"scale"===n))continue;if("scale"===n){const t=e[n],r=i;if(t[0]===r[0]&&t[1]===r[1])continue}else if("points"===n){const t=e[n],r=i;if(t.length===r.length){let e=!1,n=t.length;for(;--n;){const i=t[n],o=r[n];if(i[0]!==o[0]||i[1]!==o[1]){e=!0;break}}if(!e)continue}}e[n]=i,r=!0}}if(!r)return e;var a;(void 0===t.height&&void 0===t.width&&void 0===o&&void 0===i||mr(e),e.version++,e.versionNonce=Mr(),e.updated=sn(),n)&&(null===(a=Rn.getScene(e))||void 0===a||a.informMutation());return e},Ar=(e,t)=>{let n=!1;for(const r in t){const i=t[r];if(void 0!==i){if(e[r]===i&&("object"!=typeof i||null===i))continue;n=!0}}return n?Object.assign(Object.assign(Object.assign({},e),t),{updated:sn(),version:e.version+1,versionNonce:Mr()}):e},Pr=(e,t)=>(e.version=(null!=t?t:e.version)+1,e.versionNonce=Mr(),e.updated=sn(),e),Dr=e=>je(e)||Ee(e)?e.points.length<2:0===e.width&&0===e.height,zr=(e,t,n)=>{const r=Math.abs(t),i=Math.abs(n);if("line"===e||"arrow"===e||"freedraw"===e){const e=Math.round(Math.atan(i/r)/o.ay)*o.ay;0===e?n=0:e===Math.PI/2?t=0:n=Math.round(r*Math.tan(e))*Math.sign(n)||n}else"selection"!==e&&(n=r*Math.sign(n));return{width:t,height:n}},Rr=e=>{const t={width:e.width,height:e.height,x:e.x,y:e.y};if(e.width<0){const n=Math.abs(e.width);t.width=n,t.x=e.x-n}if(e.height<0){const n=Math.abs(e.height);t.height=n,t.y=e.y-n}return t},Hr=(e,t,n)=>{const r=n.filter((t=>t.groupIds.includes(e)));return r.length<2?t.selectedGroupIds[e]||t.editingGroupId===e?Object.assign(Object.assign({},t),{selectedGroupIds:Object.assign(Object.assign({},t.selectedGroupIds),{[e]:!1}),editingGroupId:null}):t:Object.assign(Object.assign({},t),{selectedGroupIds:Object.assign(Object.assign({},t.selectedGroupIds),{[e]:!0}),selectedElementIds:Object.assign(Object.assign({},t.selectedElementIds),Object.fromEntries(r.map((e=>[e.id,!0]))))})},Nr=(e,t)=>null!=Br(e,t),Br=(e,t)=>t.groupIds.filter((t=>t!==e.editingGroupId)).find((t=>e.selectedGroupIds[t])),Fr=e=>Object.entries(e.selectedGroupIds).filter((e=>{let[t,n]=e;return n})).map((e=>{let[t,n]=e;return t})),Ur=(e,t)=>{let n=Object.assign(Object.assign({},e),{selectedGroupIds:{}});const r=Ol(t,e);if(!r.length)return Object.assign(Object.assign({},n),{editingGroupId:null});for(const i of r){let r=i.groupIds;if(e.editingGroupId){const t=r.indexOf(e.editingGroupId);t>-1&&(r=r.slice(0,t))}if(r.length>0){const e=r[r.length-1];n=Hr(e,n,t)}}return n},Wr=(e,t)=>e.groupIds.includes(t),Kr=(e,t)=>e.filter((e=>Wr(e,t))),Vr=(e,t,n)=>{const r=[...e],i=n?r.indexOf(n):-1,o=i>-1?i:r.length;return r.splice(o,0,t),r},Gr=e=>{const t=new Map;return e.forEach((e=>{const n=0===e.groupIds.length?e.id:e.groupIds[e.groupIds.length-1],r=t.get(n)||[],i=Jn(e);i&&r.push(i),t.set(n,[...r,e])})),Array.from(t.values())};var Yr=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const Xr=(e,t)=>{var n,r;let{x:i,y:o,strokeColor:a,backgroundColor:s,fillStyle:l,strokeWidth:c,strokeStyle:d,roughness:u,opacity:h,width:p=0,height:g=0,angle:m=0,groupIds:f=[],strokeSharpness:b,boundElements:v=null,link:x=null}=t,y=Yr(t,["x","y","strokeColor","backgroundColor","fillStyle","strokeWidth","strokeStyle","roughness","opacity","width","height","angle","groupIds","strokeSharpness","boundElements","link"]);return{id:y.id||Or(),type:e,x:i,y:o,width:p,height:g,angle:m,strokeColor:a,backgroundColor:s,fillStyle:l,strokeWidth:c,strokeStyle:d,roughness:u,opacity:h,groupIds:f,strokeSharpness:b,seed:null!==(n=y.seed)&&void 0!==n?n:Mr(),version:y.version||1,versionNonce:null!==(r=y.versionNonce)&&void 0!==r?r:0,isDeleted:!1,boundElements:v,updated:sn(),link:x}},Zr=e=>Xr(e.type,e),qr=(e,t)=>({x:"center"===e.textAlign?t.width/2:"right"===e.textAlign?t.width:0,y:"middle"===e.verticalAlign?t.height/2:0}),$r=e=>{const t=Fn(e.text,Ut(e)),n=qr(e,t);return Ar(Object.assign(Object.assign({},Xr("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,containerId:e.containerId||null,originalText:e.text}),{})},Qr=(e,t)=>{let{text:n,isDeleted:r,originalText:i}=t;const a=er(e);a&&(n=Yn(n,Ut(e),a.width));const s=((e,t)=>{let n=null;const r=er(e);r&&(n=r.width-2*o.gK);const{width:i,height:a,baseline:s}=Fn(t,Ut(e),n),{textAlign:l,verticalAlign:c}=e;let d,u;if("center"!==l||c!==o.oX.MIDDLE||e.containerId){const[t,n,r,o]=Ye(e),[s,c,h,p]=tt(e,i,a),g=(t-s)/2,m=(n-c)/2,f=(r-h)/2,b=(o-p)/2;[d,u]=Re({s:!0,e:"center"===l||"left"===l,w:"center"===l||"right"===l},e.x,e.y,e.angle,g,m,f,b)}else{const t=Fn(e.text,Ut(e),n),r=qr(e,{width:i-t.width,height:a-t.height});d=e.x-r.x,u=e.y-r.y}if(r){let e=r.height,t=r.width;a>e-2*o.gK&&(e=a+2*o.gK),i>t-2*o.gK&&(t=i+2*o.gK),e===r.height&&t===r.width||Lr(r,{height:e,width:t})}return{width:i,height:a,x:Number.isFinite(d)?d:e.x,y:Number.isFinite(u)?u:e.y,baseline:s}})(e,n);return Ar(e,Object.assign({text:n,originalText:i,isDeleted:null!=r?r:e.isDeleted},s))},Jr=e=>Object.assign(Object.assign({},Xr(e.type,e)),{points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:e.startArrowhead,endArrowhead:e.endArrowhead}),ei=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(null==e||"object"!=typeof e)return e;if("[object Object]"===Object.prototype.toString.call(e)){const n="function"==typeof e.constructor?Object.create(Object.getPrototypeOf(e)):{};for(const r in e)if(e.hasOwnProperty(r)){if(0===t&&("shape"===r||"canvas"===r))continue;n[r]=ei(e[r],t+1)}return n}if(Array.isArray(e)){let n=e.length;const r=new Array(n);for(;n--;)r[n]=ei(e[n],t+1);return r}return e},ti=(e,t,n,r)=>{let i=ei(n);var o,a;cn()?(i.id="".concat(i.id,"_copy"),null!==(o=window.h)&&void 0!==o&&null!==(a=o.app)&&void 0!==a&&a.getSceneElementsIncludingDeleted().find((e=>e.id===i.id))&&(i.id+="_copy")):i.id=Or();return i.updated=sn(),i.seed=Mr(),i.groupIds=((e,t,n)=>{const r=[...e],i=t?e.indexOf(t):-1,o=i>-1?i:e.length;for(let e=0;e<o;e++)r[e]=n(r[e]);return r})(i.groupIds,e,(e=>(t.has(e)||t.set(e,Or()),t.get(e)))),r&&(i=Object.assign(i,r)),i},ni={mouse:8,pen:16,touch:28},ri={e:!0,s:!0,n:!0,w:!0},ii={e:!0,s:!0,n:!0,w:!0},oi={e:!0,s:!0,n:!0,w:!0,nw:!0,se:!0},ai={e:!0,s:!0,n:!0,w:!0,ne:!0,sw:!0},si=(e,t,n,r,i,o,a)=>{const[s,l]=De(e+n/2,t+r/2,i,o,a);return[s-n/2,l-r/2,n,r]},li=function(e,t,n,r){let[i,o,a,s]=e,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const c=ni[r],d=c/n.value,u=c/n.value,h=c/n.value,p=c/n.value,g=a-i,m=s-o,f=(i+a)/2,b=(o+s)/2,v=4/n.value,x=(c-8)/(2*n.value),y={nw:l.nw?void 0:si(i-v-h+x,o-v-p+x,d,u,f,b,t),ne:l.ne?void 0:si(a+v-x,o-v-p+x,d,u,f,b,t),sw:l.sw?void 0:si(i-v-h+x,s+v-x,d,u,f,b,t),se:l.se?void 0:si(a+v-x,s+v-x,d,u,f,b,t),rotation:l.rotation?void 0:si(i+g/2-d/2,o-v-p+x-16/n.value,d,u,f,b,t)},w=5*ni.mouse/n.value;return Math.abs(g)>w&&(l.n||(y.n=si(i+g/2-d/2,o-v-p+x,d,u,f,b,t)),l.s||(y.s=si(i+g/2-d/2,s+v-x,d,u,f,b,t))),Math.abs(m)>w&&(l.w||(y.w=si(i-v-h+x,o+m/2-u/2,d,u,f,b,t)),l.e||(y.e=si(a+v-x,o+m/2-u/2,d,u,f,b,t))),y},ci=function(e,t){let 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){const[,t]=e.points;0===t[0]||0===t[1]?r=ai:t[0]>0&&t[1]<0?r=oi:t[0]>0&&t[1]>0?r=ai:t[0]<0&&t[1]>0?r=oi:t[0]<0&&t[1]<0&&(r=ai)}}else Ce(e)&&(r=ii);return li(Ye(e),e.angle,t,n,r)},di=(e,t)=>[0,0,0,0,t,e,1,0],ui=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=[0,0,0,0,0,0,0,0];if(t<0||t>7)throw new Error("Expected `index` between 0 and 7, got `".concat(t,"`"));return 0!==e&&(n[t]=e),n},hi=e=>[e[0],e[1],e[2],e[3],-e[4],-e[5],-e[6],-e[7]],pi=(e,t)=>wi(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]],gi=(e,t)=>wi(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]:[mi(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]],mi=(e,t)=>t[0]*e[0]+t[2]*e[2]+t[3]*e[3]-t[6]*e[6],fi=(e,t)=>[bi(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]],bi=(e,t)=>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],vi=e=>Math.sqrt(Math.abs(e[0]*e[0]-e[2]*e[2]-e[3]*e[3]+e[6]*e[6])),xi=e=>{const t=vi(e);if(0===t||1===t)return e;const n=e[6]<0?-1:1;return gi(e,n/t)},yi=e=>{const t=(e=>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:gi(e,1/t)},wi=e=>"number"==typeof e,ki=(ui(1,1),ui(1,2),ui(1,3),ui(1,4),ui(1,5),ui(1,6),ui(1,7),(e,t,n)=>xi([0,n,e,t,0,0,0,0])),_i=(e,t)=>xi(fi(t,e)),Ci=(e,t)=>((e,t)=>[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),Ei=e=>{let[t,n]=e;return[0,0,0,0,n,t,1,0]},Si=e=>[e[5],e[4]],ji=(e,t)=>xi(((e,t)=>[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)),Ii=(e,t)=>vi(fi(e,t)),Ti=(e,t)=>bi(e,t),Mi=e=>[0,0,0,0,e[4],e[5],0,0],Oi=(e,t)=>((e,t)=>wi(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]])(gi(e,Math.sin(t/2)),Math.cos(t/2)),Li=(e,t)=>xi(gi(gi(e,t),hi(e))),Ai=(e,t,n,r)=>{const i=10/t.zoom.value;return!Pi(e,t,[n,r])&&zi(e,[n,r],i)},Pi=(e,t,n)=>{const r=10/t.zoom.value,i=Ce(e)?Fi:(e=>{if("arrow"===e.type)return!1;if("freedraw"===e.type)return!0;const t=!rn(e.backgroundColor)||Ae(e);return"line"===e.type?t&&Ne(e.points):t||_e(e)})(e)?Ui:Wi;return Ni({element:e,point:n,threshold:r,check:i})},Di=(e,t)=>e.selectedElementIds[t.id],zi=(e,t,n)=>{let[r,i]=t;const[o,a,s,l]=Ye(e),c=(o+s)/2,d=(a+l)/2,[u,h]=De(r,i,c,d,-e.angle);return u>o-n&&u<s+n&&h>a-n&&h<l+n},Ri=(e,t)=>{let{x:n,y:r}=t;const i=Hi(e,e.width,e.height);return Ni({element:e,point:[n,r],threshold:i,check:Ki})},Hi=(e,t,n)=>{const r=("diamond"===e.type?1/Math.sqrt(2):1)*Math.min(t,n);return Math.max(16,Math.min(.25*r,32))},Ni=e=>{switch(e.element.type){case"rectangle":case"image":case"text":case"diamond":case"ellipse":const t=Bi(e.element,e.point);return e.check(t,e.threshold);case"freedraw":return!!e.check(Vi(e.element,e.point),e.threshold)&&Zi(e.element,e.point,e.threshold);case"arrow":case"line":return qi(e);case"selection":return console.warn("This should not happen, we need to investigate why it does."),!1}},Bi=(e,t)=>{switch(e.type){case"rectangle":case"image":case"text":return Vi(e,t);case"diamond":return Gi(e,t);case"ellipse":return Yi(e,t)}},Fi=(e,t)=>e<0,Ui=(e,t)=>e<t,Wi=(e,t)=>Math.abs(e)<t,Ki=(e,t)=>0<=e&&e<t,Vi=(e,t)=>{const[,n,r,i]=$i(e,t);return Math.max(Ti(n,ki(0,1,-i)),Ti(n,ki(1,0,-r)))},Gi=(e,t)=>{const[,n,r,i]=$i(e,t),o=ki(i,r,-i*r);return Ti(n,o)},Yi=(e,t)=>{const[n,r]=Xi(e,t);return-(e=>Math.sign(e[1]))(r)*Ti(n,r)},Xi=(e,t)=>{const[,n,r,i]=$i(e,t),[o,a]=Si(n);let s=.707,l=.707;const c=r,d=i;[0,1,2,3].forEach((e=>{const t=(c*c-d*d)*s**3/c,n=(d*d-c*c)*l**3/d,r=c*s-t,i=d*l-n,u=o-t,h=a-n,p=Math.hypot(i,r),g=Math.hypot(h,u);s=Math.min(1,Math.max(0,(u*p/g+t)/c)),l=Math.min(1,Math.max(0,(h*p/g+n)/d));const m=Math.hypot(l,s);s/=m,l/=m}));const u=di(c*s,d*l);var h;return[n,Ci(_i(n,h=u),h)]},Zi=(e,t,n)=>{let r,i;if(0===e.angle)r=t[0]-e.x,i=t[1]-e.y;else{const[n,o,a,s]=Ye(e),l=ze(t,[n+(a-n)/2,o+(s-o)/2],-e.angle);r=l[0]-e.x,i=l[1]-e.y}let o,[a,s]=e.points;if(He(a[0],a[1],r,i)<n||He(s[0],s[1],r,i)<n)return!0;for(let t=0;t<e.points.length;t++){const l=[s[0]-a[0],s[1]-a[1]],c=Math.hypot(l[1],l[0]),d=[l[0]/c,l[1]/c],u=[r-a[0],i-a[1]],h=(u[0]*d[0]+u[1]*d[1])/Math.hypot(d[1],d[0]);o=[a[0]+d[0]*h,a[1]+d[1]*h];const p=He(o[0],o[1],a[0],a[1]),g=He(o[0],o[1],s[0],s[1]);if(o=g<p&&p>c?s:p<g&&g>c?a:o,Math.hypot(i-o[1],r-o[0])<n)return!0;a=s,s=e.points[t+1]}const l=pr(e);return!(!l||!l.sets.length)&&uo(l,r,i,n)},qi=e=>{const{element:t,threshold:n}=e;if(!pr(t))return!1;const[r,i,o,a]=$i(e.element,e.point),s=ki(0,1,-a),l=ki(1,0,-o);if(!Ui(Ti(i,s),n)||!Ui(Ti(i,l),n))return!1;const[c,d]=Si(r),u=pr(t);if(!u)return!1;if(e.check===Ui){if(u.some((e=>co(e,c,d,t.strokeSharpness))))return!0}return u.some((e=>uo(e,c,d,n)))},$i=(e,t)=>{const n=Ei(t),r=Ye(e),i=Ji(r),o=Oi(i,e.angle),a=Li(o,n),s=(e=>[0,0,0,0,Math.abs(e[4]),Math.abs(e[5]),1,0])(pi(a,Mi(i))),l=((e,t)=>[0,0,0,0,t,e,0,0])(e.x,e.y),c=pi(a,l),[d,u,h,p]=r;return[c,s,(h-d)/2,(p-u)/2]},Qi=e=>{const t=Ye(e),n=Ji(t),r=Oi(n,e.angle),i=hi((e=>[1,0,0,0,-.5*e[5],.5*e[4],0,0])(Mi(n)));return gi(i,r)},Ji=e=>{let[t,n,r,i]=e;return di((t+r)/2,(n+i)/2)},eo=(e,t,n)=>{const r=Qi(e),i=Li(r,Ei(t)),o=Li(r,Ei(n)),a=_i(i,o),s=e.height/e.width,l=e.width/2,c=e.height/2,d=a[2],u=a[3],h=a[1],p=Math.abs(u),g=Math.abs(d);switch(e.type){case"rectangle":case"image":case"text":return h/(l*(g+s*p));case"diamond":return p<g?h/(g*l):h/(p*c);case"ellipse":return h/(l*Math.sqrt(d**2+s**2*u**2))}},to=function(e,t,n){let r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;switch(e.type){case"rectangle":case"image":case"text":case"diamond":const n=no(e);r=n.flatMap(((e,r)=>{const o=[e,n[(r+1)%4]];return ro(t,io(o,i))})).concat(n.flatMap((e=>ao(e,i,t))));break;case"ellipse":r=oo(e,i,t)}if(r.length<2)return[];const o=r.sort(((e,t)=>Ii(e,n)-Ii(t,n)));return[o[0],o[o.length-1]]},no=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const n=t*e.width/2,r=t*e.height/2;switch(e.type){case"rectangle":case"image":case"text":return[di(n,r),di(n,-r),di(-n,-r),di(-n,r)];case"diamond":return[di(0,r),di(n,0),di(0,-r),di(-n,0)]}},ro=(e,t)=>{const[n,r]=t;return Ti(n,e)*Ti(r,e)>=0?[]:[ji(e,_i(n,r))]},io=(e,t)=>{const[n,r]=e,i=((e,t)=>{const n=.5*t;return[1,0,0,0,n*e[4],n*e[5],0,0]})(((e,t)=>yi([0,0,0,0,t[4]-e[4],t[5]-e[5],0,0]))(n,r),t);return[Li(i,n),Li(i,r)]},oo=(e,t,n)=>{const r=e.width/2+t,i=e.height/2+t,o=n[2],a=n[3],s=n[1],l=r*r*o*o+i*i*a*a,c=l-s*s;if(0===l||c<=0)return[];const d=Math.sqrt(c),u=-r*r*o*s,h=-i*i*a*s;return[di((u+r*i*a*d)/l,(h-r*i*o*d)/l),di((u-r*i*a*d)/l,(h+r*i*o*d)/l)]},ao=(e,t,n)=>{if(0===t)return 0===Ti(n,e)?[e]:[];const r=n[2],i=n[3],o=n[1],[a,s]=Si(e),l=r*r+i*i,c=t*t*l-(r*a+i*s+o)**2;if(0===l||c<=0)return[];const d=Math.sqrt(c),u=a*i*i-s*r*i-r*o,h=s*r*r-a*r*i-i*o;return[di((u+i*d)/l,(h-r*d)/l),di((u-i*d)/l,(h+r*d)/l)]},so=(e,t,n)=>{const r=Math.abs(t),i=e.width*r/2,o=e.height*r/2,a=Math.sign(t),[s,l]=Si(n),c=0===l?1e-4:l,d=s**2*o**2+c**2*i**2,u=(-s*o**2+a*c*Math.sqrt(Math.max(0,d-i**2*o**2)))/d,h=(-u*s-1)/c,p=-(i**2)*u/(h**2*o**2+u**2*i**2);return di(p,(-u*p-1)/h)},lo=(e,t,n)=>{const r=Math.abs(t),i=Math.sign(t),o=no(e,r);let a=0,s=null;return o.forEach((e=>{const t=i*_i(n,e)[1];t>a&&(a=t,s=e)})),s},co=(e,t,n,r)=>{const i=Xe(e),o=[];let a=!1;for(const e of i)"move"===e.op?(a=!a,a&&o.push([e.data[0],e.data[1]])):"bcurveTo"===e.op?a&&(o.push([e.data[0],e.data[1]]),o.push([e.data[2],e.data[3]]),o.push([e.data[4],e.data[5]])):"lineTo"===e.op&&a&&o.push([e.data[0],e.data[1]]);if(o.length>=4){if("sharp"===r)return Be(o,t,n);const e=he(o,10,5);return Be(e,t,n)}return!1},uo=(e,t,n,r)=>{const i=Xe(e);let o=[0,0];return i.some(((i,a)=>{let{op:s,data:l}=i;if("move"===s)o=l;else{if("bcurveTo"===s){const e=[l[0],l[1]],i=[l[2],l[3]],a=[l[4],l[5]],s=o;o=a;const c=((e,t,n,r,i,o)=>{let[a,s]=i;const l=(i,o)=>Math.pow(1-i,3)*r[o]+3*i*Math.pow(1-i,2)*n[o]+3*Math.pow(i,2)*(1-i)*t[o]+e[o]*Math.pow(i,3);let c=0;for(;c<=1;){const e=l(c,0),t=l(c,1);if(Math.sqrt(Math.pow(e-a,2)+Math.pow(t-s,2))<o)return!0;c+=.01}return!1})(s,e,i,a,[t,n],r);return c}if("lineTo"===s)return co(e,t,n,"sharp");"qcurveTo"===s&&console.warn("qcurveTo is not implemented yet")}return!1}))};var ho=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const po=(e,t,n)=>t>=e[0]&&t<=e[0]+e[2]&&n>=e[1]&&n<=e[1]+e[3],go=(e,t,n,r,i,o)=>e.reduce(((e,a)=>{if(e)return e;const s=((e,t,n,r,i,o)=>{if(!t.selectedElementIds[e.id])return!1;const a=ci(e,i,o),{rotation:s}=a,l=ho(a,["rotation"]);if(s&&po(s,n,r))return"rotation";const c=Object.keys(l).filter((e=>{const t=l[e];return!!t&&po(t,n,r)}));return c.length>0&&c[0]})(a,t,n,r,i,o);return s?{element:a,transformHandleType:s}:null}),null),mo=(e,t,n,r,i)=>{let[o,a,s,l]=e;const c=li([o,a,s,l],0,r,i,ri);return Object.keys(c).find((e=>{const r=c[e];return r&&po(r,t,n)}))||!1},fo=["ns","nesw","ew","nwse"],bo=e=>{const{element:t,transformHandleType:n}=e,r=t&&Math.sign(t.height)*Math.sign(t.width)==-1;let i=null;switch(n){case"n":case"s":i="ns";break;case"w":case"e":i="ew";break;case"nw":case"se":i=r?"nesw":"nwse";break;case"ne":case"sw":i=r?"nwse":"nesw";break;case"rotation":return"grab"}return i&&t&&(i=((e,t)=>{const n=fo.indexOf(e);if(n>=0){const r=Math.round(t/(Math.PI/4));e=fo[(n+r)%fo.length]}return e})(i,t.angle)),i?"".concat(i,"-resize"):""};class vo{constructor(e,t){this.elementId=e.id,Rn.mapElementToScene(this.elementId,t),vo.normalizePoints(e),this.selectedPointsIndices=null,this.lastUncommittedPoint=null,this.isDragging=!1,this.pointerOffset={x:0,y:0},this.startBindingElement="keep",this.endBindingElement="keep",this.pointerDownState={prevSelectedPointsIndices:null,lastClickedPoint:-1}}static getElement(e){var t;const n=null===(t=Rn.getScene(e))||void 0===t?void 0:t.getNonDeletedElement(e);return n||null}static handleBoxSelection(e,t,n){var r;if(!t.editingLinearElement||"selection"!==(null===(r=t.draggingElement)||void 0===r?void 0:r.type))return!1;const{editingLinearElement:i}=t,{selectedPointsIndices:o,elementId:a}=i,s=vo.getElement(a);if(!s)return!1;const[l,c,d,u]=Ye(t.draggingElement),h=vo.getPointsGlobalCoordinates(s).reduce(((t,n,r)=>((n[0]>=l&&n[0]<=d&&n[1]>=c&&n[1]<=u||e.shiftKey&&null!=o&&o.includes(r))&&t.push(r),t)),[]);n({editingLinearElement:Object.assign(Object.assign({},i),{selectedPointsIndices:h.length?h:null})})}static handlePointDragging(e,t,n,r,i){if(!e.editingLinearElement)return!1;const{editingLinearElement:o}=e,{selectedPointsIndices:a,elementId:s,isDragging:l}=o,c=vo.getElement(s);if(!c)return!1;const d=c.points[o.pointerDownState.lastClickedPoint];if(a&&d){!1===l&&t({editingLinearElement:Object.assign(Object.assign({},o),{isDragging:!0})});const s=vo.createPointAt(c,n-o.pointerOffset.x,r-o.pointerOffset.y,e.gridSize),u=s[0]-d[0],h=s[1]-d[1];if(vo.movePoints(c,a.map((t=>({index:t,point:t===o.pointerDownState.lastClickedPoint?vo.createPointAt(c,n-o.pointerOffset.x,r-o.pointerOffset.y,e.gridSize):[c.points[t][0]+u,c.points[t][1]+h],isDragging:t===o.pointerDownState.lastClickedPoint})))),Te(c)){const e=[];0===a[0]&&e.push(tn(vo.getPointGlobalCoordinates(c,c.points[0])));const t=a[a.length-1];t===c.points.length-1&&e.push(tn(vo.getPointGlobalCoordinates(c,c.points[t]))),e.length&&i(c,e)}return!0}return!1}static handlePointerUp(e,t,n){var r;const{elementId:i,selectedPointsIndices:o,isDragging:a,pointerDownState:s}=t,l=vo.getElement(i);if(!l)return t;const c={};if(a&&o)for(const e of o)if(0===e||e===l.points.length-1){Ne(l.points,n.zoom.value)&&vo.movePoints(l,[{index:e,point:0===e?l.points[l.points.length-1]:l.points[0]}]);const t=yo(n)?Oo(tn(vo.getPointAtIndexGlobalCoordinates(l,e)),Rn.getScene(l)):null;c[0===e?"startBindingElement":"endBindingElement"]=t}return Object.assign(Object.assign(Object.assign({},t),c),{selectedPointsIndices:a||e.shiftKey?!a&&e.shiftKey&&null!==(r=s.prevSelectedPointsIndices)&&void 0!==r&&r.includes(s.lastClickedPoint)?o&&o.filter((e=>e!==s.lastClickedPoint)):o:null!=o&&o.includes(s.lastClickedPoint)?[s.lastClickedPoint]:o,isDragging:!1,pointerOffset:{x:0,y:0}})}static handlePointerDown(e,t,n,r,i){var o;const a={didAddPoint:!1,hitElement:null};if(!t.editingLinearElement)return a;const{elementId:s}=t.editingLinearElement,l=vo.getElement(s);if(!l)return a;if(e.altKey)return null==t.editingLinearElement.lastUncommittedPoint&&Lr(l,{points:[...l.points,vo.createPointAt(l,i.x,i.y,t.gridSize)]}),r.resumeRecording(),n({editingLinearElement:Object.assign(Object.assign({},t.editingLinearElement),{pointerDownState:{prevSelectedPointsIndices:t.editingLinearElement.selectedPointsIndices,lastClickedPoint:-1},selectedPointsIndices:[l.points.length-1],lastUncommittedPoint:null,endBindingElement:Oo(i,Rn.getScene(l))})}),a.didAddPoint=!0,a;const c=vo.getPointIndexUnderCursor(l,t.zoom,i.x,i.y);if(c>-1)a.hitElement=l;else{const{startBindingElement:e,endBindingElement:n}=t.editingLinearElement;yo(t)&&Te(l)&&wo(l,e,n)}const[d,u,h,p]=Ye(l),g=(d+h)/2,m=(u+p)/2,f=c>-1&&De(l.x+l.points[c][0],l.y+l.points[c][1],g,m,l.angle),b=c>-1||e.shiftKey?e.shiftKey||null!==(o=t.editingLinearElement.selectedPointsIndices)&&void 0!==o&&o.includes(c)?xo([...t.editingLinearElement.selectedPointsIndices||[],c]):[c]:null;return n({editingLinearElement:Object.assign(Object.assign({},t.editingLinearElement),{pointerDownState:{prevSelectedPointsIndices:t.editingLinearElement.selectedPointsIndices,lastClickedPoint:c},selectedPointsIndices:b,pointerOffset:f?{x:i.x-f[0],y:i.y-f[1]}:{x:0,y:0}})}),a}static handlePointerMove(e,t,n,r,i){const{elementId:o,lastUncommittedPoint:a}=r,s=vo.getElement(o);if(!s)return r;const{points:l}=s,c=l[l.length-1];if(!e.altKey)return c===a&&vo.deletePoints(s,[l.length-1]),Object.assign(Object.assign({},r),{lastUncommittedPoint:null});const d=vo.createPointAt(s,t-r.pointerOffset.x,n-r.pointerOffset.y,i);return c===a?vo.movePoints(s,[{index:s.points.length-1,point:d}]):vo.addPoints(s,[{point:d}]),Object.assign(Object.assign({},r),{lastUncommittedPoint:s.points[s.points.length-1]})}static getPointGlobalCoordinates(e,t){const[n,r,i,o]=Ye(e),a=(n+i)/2,s=(r+o)/2;let{x:l,y:c}=e;return[l,c]=De(l+t[0],c+t[1],a,s,e.angle),[l,c]}static getPointsGlobalCoordinates(e){const[t,n,r,i]=Ye(e),o=(t+r)/2,a=(n+i)/2;return e.points.map((t=>{let{x:n,y:r}=e;return[n,r]=De(n+t[0],r+t[1],o,a,e.angle),[n,r]}))}static getPointAtIndexGlobalCoordinates(e,t){const n=t<0?e.points.length+t:t,[r,i,o,a]=Ye(e),s=(r+o)/2,l=(i+a)/2,c=e.points[n],{x:d,y:u}=e;return De(d+c[0],u+c[1],s,l,e.angle)}static pointFromAbsoluteCoords(e,t){const[n,r,i,o]=Ye(e),a=(n+i)/2,s=(r+o)/2,[l,c]=De(t[0],t[1],a,s,-e.angle);return[l-e.x,c-e.y]}static getPointIndexUnderCursor(e,t,n,r){const i=this.getPointsGlobalCoordinates(e);let o=i.length;for(;--o>-1;){const e=i[o];if(He(n,r,e[0],e[1])*t.value<this.POINT_HANDLE_SIZE/2+1)return o}return-1}static createPointAt(e,t,n,r){const i=Ke(t,n,r),[o,a,s,l]=Ye(e),c=(o+s)/2,d=(a+l)/2,[u,h]=De(i[0],i[1],c,d,-e.angle);return[u-e.x,h-e.y]}static getNormalizedPoints(e){const{points:t}=e,n=t[0][0],r=t[0][1];return{points:t.map(((e,t)=>[e[0]-n,e[1]-r])),x:e.x+n,y:e.y+r}}static normalizePoints(e){Lr(e,vo.getNormalizedPoints(e))}static duplicateSelectedPoints(e){if(!e.editingLinearElement)return!1;const{selectedPointsIndices:t,elementId:n}=e.editingLinearElement,r=vo.getElement(n);if(!r||null===t)return!1;const{points:i}=r,o=[];let a=!1,s=-1;const l=i.reduce(((e,n,r)=>{++s,e.push(n);if(t.includes(r)){const t=i[r+1];t||(a=!0),e.push(t?[(n[0]+t[0])/2,(n[1]+t[1])/2]:[n[0],n[1]]),o.push(s+1),++s}return e}),[]);if(Lr(r,{points:l}),a){const e=r.points[r.points.length-1];vo.movePoints(r,[{index:r.points.length-1,point:[e[0]+30,e[1]+30]}])}return{appState:Object.assign(Object.assign({},e),{editingLinearElement:Object.assign(Object.assign({},e.editingLinearElement),{selectedPointsIndices:o})})}}static deletePoints(e,t){let n=0,r=0;if(t.includes(0)){const i=e.points.find(((e,n)=>!t.includes(n)));i&&(n=i[0],r=i[1])}const i=e.points.reduce(((e,i,o)=>(t.includes(o)||e.push(e.length?[i[0]-n,i[1]-r]:[0,0]),e)),[]);vo._updatePoints(e,i,n,r)}static addPoints(e,t){const n=[...e.points,...t.map((e=>e.point))];vo._updatePoints(e,n,0,0)}static movePoints(e,t,n){const{points:r}=e;let i=0,o=0;const a=t.find((e=>{let{index:t}=e;return 0===t}));a&&(i=a.point[0]-r[a.index][0],o=a.point[1]-r[a.index][1]);const s=r.map(((e,n)=>{const s=t.find((e=>e.index===n));if(s){if(a)return e;const t=s.point[0]-r[s.index][0],n=s.point[1]-r[s.index][1];return[e[0]+t,e[1]+n]}return i||o?[e[0]-i,e[1]-o]:e}));vo._updatePoints(e,s,i,o,n)}static _updatePoints(e,t,n,r,i){const o=nt(e,t,e.strokeSharpness||"round"),a=nt(e,e.points,e.strokeSharpness||"round"),s=(o[0]+o[2])/2,l=(o[1]+o[3])/2,c=(a[0]+a[2])/2,d=(a[1]+a[3])/2,u=De(n,r,c-s,d-l,e.angle);Lr(e,Object.assign(Object.assign({},i),{points:t,x:e.x+u[0],y:e.y+u[1]}))}}vo.POINT_HANDLE_SIZE=20;const xo=e=>{let t=[...new Set(e.filter((e=>null!==e&&-1!==e)))];return t=t.sort(((e,t)=>e-t)),t.length?t:null},yo=e=>e.isBindingEnabled,wo=(e,t,n)=>{const r=new Set,i=new Set;ko(e,t,n,"start",r,i),ko(e,n,t,"end",r,i);const o=Array.from(i).filter((e=>!r.has(e)));Rn.getScene(e).getNonDeletedElements(o).forEach((t=>{var n;Lr(t,{boundElements:null===(n=t.boundElements)||void 0===n?void 0:n.filter((t=>"arrow"!==t.type||t.id!==e.id))})}))},ko=(e,t,n,r,i,o)=>{if("keep"!==t)if(null!=t)null!=n&&("keep"===n?jo(e,t,r):"start"!==r&&n.id===t.id)||(So(e,t,r),i.add(t.id));else{const t=Mo(e,r);null!=t&&o.add(t)}},_o=e=>{e.forEach((e=>{Te(e)?wo(e,No(e,"start"),No(e,"end")):Oe(e)&&Co(e)}))},Co=e=>{Fo(e).forEach((t=>{let[n,r]=t;return wo(n,"end"===r?"keep":e,"start"===r?"keep":e)}))},Eo=(e,t,n,r)=>{null!=t.startBoundElement&&So(e,t.startBoundElement,"start");const i=Oo(r,n);null==i||jo(e,i,"end")||So(e,i,"end")},So=(e,t,n)=>{Lr(e,{["start"===n?"startBinding":"endBinding"]:Object.assign({elementId:t.id},Lo(e,t,n))});ln(t.boundElements||[]).has(e.id)||Lr(t,{boundElements:(t.boundElements||[]).concat({id:e.id,type:"arrow"})})},jo=(e,t,n)=>{const r=e["start"===n?"endBinding":"startBinding"];return Io(e,null==r?void 0:r.elementId,t)},Io=(e,t,n)=>t===n.id&&e.points.length<3,To=e=>{e.forEach((e=>{Te(e)&&wo(e,null,null)}))},Mo=(e,t)=>{const n="start"===t?"startBinding":"endBinding",r=e[n];return null==r?null:(Lr(e,{[n]:null}),r.elementId)},Oo=(e,t)=>Ns(t.getElements(),(t=>Oe(t)&&Ri(t,e))),Lo=(e,t,n)=>{const r="start"===n?-1:1,i=-1===r?0:e.points.length-1,o=i-r,a=vo.getPointAtIndexGlobalCoordinates(e,i),s=vo.getPointAtIndexGlobalCoordinates(e,o);return{focus:eo(t,s,a),gap:Math.max(1,Bi(t,a))}},Ao=(e,t)=>{var n;const r=(null!==(n=e.boundElements)&&void 0!==n?n:[]).filter((e=>"arrow"===e.type));if(0===r.length)return;const{newSize:i,simultaneouslyUpdated:o}=null!=t?t:{},a=Do(o);Rn.getScene(e).getNonDeletedElements(r.map((e=>e.id))).forEach((t=>{if(!je(t))return;const n=e;if(!Po(t,n))return;const r=Ro(n,t.startBinding,i),o=Ro(n,t.endBinding,i);a.has(t.id)?Lr(t,{startBinding:r,endBinding:o}):(zo(t,"start",r,e),zo(t,"end",o,e))}))},Po=(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},Do=e=>new Set((e||[]).map((e=>e.id))),zo=(e,t,n,r)=>{if(null==n||n.elementId!==r.id&&e.points.length>2)return;const i=Rn.getScene(e).getElement(n.elementId);if(null==i)return;const o="start"===t?-1:1,a=-1===o?0:e.points.length-1,s=a-o,l=vo.getPointAtIndexGlobalCoordinates(e,s),c=((e,t,n)=>{if(0===t){const t=Ye(e),n=Ji(t);return Si(n)}const r=Qi(e),i=Li(r,Ei(n)),o=hi(r);let a;switch(e.type){case"rectangle":case"image":case"text":case"diamond":a=lo(e,t,i);break;case"ellipse":a=so(e,t,i)}return Si(Li(o,a))})(i,n.focus,l);let d;if(0===n.gap)d=c;else{const e=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const i=Qi(e),o=Li(i,Ei(t)),a=Li(i,Ei(n)),s=_i(o,a),l=hi(i);return to(e,s,o,r).map((e=>Si(Li(l,e))))}(i,l,c,n.gap);d=0===e.length?c:e[0]}vo.movePoints(e,[{index:a,point:vo.pointFromAbsoluteCoords(e,d)}],{["start"===t?"startBinding":"endBinding"]:n})},Ro=(e,t,n)=>{if(null==t||null==n)return t;const{gap:r,focus:i,elementId:o}=t,{width:a,height:s}=n,{width:l,height:c}=e;return{elementId:o,gap:Math.max(1,Math.min(Hi(e,a,s),r*(a<s?a/l:s/c))),focus:i}},Ho=e=>[No(e,"start"),No(e,"end")].filter((e=>null!=e)),No=(e,t)=>Oo(Bo(e,t),Rn.getScene(e)),Bo=(e,t)=>{const n="start"===t?0:-1;return tn(vo.getPointAtIndexGlobalCoordinates(e,n))},Fo=e=>Rn.getScene(e).getElements().map((t=>{if(!Te(t))return null;const n=Uo(t,"start",e),r=Uo(t,"end",e);return n||r?[t,n&&r?"both":n?"start":"end",e]:null})).filter((e=>null!=e)),Uo=(e,t,n)=>null==e["start"===t?"startBinding":"endBinding"]&&!jo(e,n,t)&&Ri(n,Bo(e,t)),Wo=(e,t,n,r)=>{const i=new Set,o=new Set,a="duplicatesServeAsOld"===r;t.forEach((e=>{const{boundElements:t}=e;if(null!=t&&t.length>0&&(t.forEach((e=>{a&&!n.has(e.id)&&i.add(e.id)})),o.add(n.get(e.id))),Te(e)){if(null!=e.startBinding){const{elementId:t}=e.startBinding;a&&!n.has(t)&&o.add(t)}if(null!=e.endBinding){const{elementId:t}=e.endBinding;a&&!n.has(t)&&o.add(t)}null==e.startBinding&&null==e.endBinding||i.add(n.get(e.id))}})),e.filter((e=>{let{id:t}=e;return i.has(t)})).forEach((e=>{const{startBinding:t,endBinding:r}=e;Lr(e,{startBinding:Ko(t,n),endBinding:Ko(r,n)})})),e.filter((e=>{let{id:t}=e;return o.has(t)})).forEach((e=>{const{boundElements:t}=e;null!=t&&t.length>0&&Lr(e,{boundElements:t.map((e=>n.has(e.id)?{id:n.get(e.id),type:e.type}:e))})}))},Ko=(e,t)=>{var n;if(null==e)return null;const{elementId:r,focus:i,gap:o}=e;return{focus:i,gap:o,elementId:null!==(n=t.get(r))&&void 0!==n?n:r}},Vo=(e,t)=>{const n=new Set(t.map((e=>e.id))),r=new Set;t.forEach((e=>{var t;Oe(e)&&(null===(t=e.boundElements)||void 0===t||t.forEach((e=>{n.has(e.id)||r.add(e.id)})))})),e.filter((e=>{let{id:t}=e;return r.has(t)})).forEach((e=>{const{startBinding:t,endBinding:r}=e;Lr(e,{startBinding:Go(t,n),endBinding:Go(r,n)})}))},Go=(e,t)=>null==e||t.has(e.elementId)?null:e,Yo=e=>e>=2*Math.PI?e-2*Math.PI:e,Xo=(e,t,n,r)=>{const[i,a,s,l]=Ye(e),c=(i+s)/2,d=(a+l)/2;let u=5*Math.PI/2+Math.atan2(n-d,t-c);r&&(u+=o.ay/2,u-=u%o.ay),u=Yo(u),Lr(e,{angle:u});const h=Qn(e);if(h){const t=Rn.getScene(e).getElement(h);Lr(t,{angle:u})}},Zo=(e,t,n,r,i)=>{const[o,a,s,l]=Ye(e),c=(o+s)/2,d=(a+l)/2,[u,h]=De(r,i,c,d,-e.angle);let[p,g]="end"===t?[u-e.x,h-e.y]:[e.x+e.points[1][0]-u,e.y+e.points[1][1]-h];n&&([p,g]=((e,t,n,r)=>{const i=zr(e,...De(t,n,0,0,r));return De(i.width,i.height,0,0,-r)})(e.type,p,g,e.angle));const[m,f]=Re("end"===t?{s:!0,e:!0}:{n:!0,w:!0},e.x,e.y,e.angle,0,0,(e.points[1][0]-p)/2,(e.points[1][1]-g)/2);Lr(e,{x:m,y:f,points:[[0,0],[p,g]]})},qo=(e,t,n)=>je(e)||Ee(e)?{points:Ge(0,t,Ge(1,n,e.points))}:{},$o=(e,t,n)=>{const r=e.fontSize*(t/e.width);if(r<1)return null;const i=Fn(e.text,Ut({fontSize:r,fontFamily:e.fontFamily}),e.containerId?e.width:null);return{size:r,baseline:i.baseline+(n-i.height)}},Qo=(e,t,n,r,i)=>{const[o,a,s,l]=Ye(e),c=(o+s)/2,d=(a+l)/2,[u,h]=De(r,i,c,d,-e.angle);let p;switch(t){case"se":p=Math.max((u-o)/(s-o),(h-a)/(l-a));break;case"nw":p=Math.max((s-u)/(s-o),(l-h)/(l-a));break;case"ne":p=Math.max((u-o)/(s-o),(l-h)/(l-a));break;case"sw":p=Math.max((s-u)/(s-o),(h-a)/(l-a))}if(p>0){const r=e.width*p,i=e.height*p,c=$o(e,r,i);if(null===c)return;const[d,u,h,g]=tt(e,r,i),m=(o-d)/2,f=(a-u)/2,b=(s-h)/2,v=(l-g)/2,[x,y]=Re(((e,t)=>({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,m,f,b,v);Lr(e,{fontSize:c.size,width:r,height:i,baseline:c.baseline,x,y})}},Jo=(e,t,n,r,i,a,s)=>{const l=e.get(n.id),[c,d,u,h]=tt(l,l.width,l.height),p=[c,d],g=[u,h],m=((e,t)=>[(e[0]+t[0])/2,(e[1]+t[1])/2])(p,g),f=ze([a,s],m,-l.angle),[b,v,x,y]=tt(n,n.width,n.height),w=x-b,k=y-v;let _=(g[0]-p[0])/w,C=(g[1]-p[1])/k,E={};const S=Jn(n);r.includes("e")&&(_=(f[0]-p[0])/w),r.includes("s")&&(C=(f[1]-p[1])/k),r.includes("w")&&(_=(g[0]-f[0])/w),r.includes("n")&&(C=(g[1]-f[1])/k);const j=l.width,I=l.height;let T=n.width*_,M=n.height*C;if(i&&(T=2*T-j,M=2*M-I),t){const e=Math.abs(T)/j,t=Math.abs(M)/I;if(1===r.length&&(M*=e,T*=t),2===r.length){const n=Math.max(e,t);T=j*n*Math.sign(T),M=I*n*Math.sign(M)}}if(S){const n=e.get(S.id);if(n&&(E={fontSize:n.fontSize,baseline:n.baseline}),t){const e=$o(S,T-2*o.gK,M-2*o.gK);if(null===e)return;E={fontSize:e.size,baseline:e.baseline}}else{const e=Zn(Ut(S)),t=qn(Ut(S));T=Math.ceil(Math.max(T,e)),M=Math.ceil(Math.max(M,t))}}const[O,L,A,P]=tt(l,T,M),D=A-O,z=P-L;let R=[...p];if(["n","w","nw"].includes(r)&&(R=[g[0]-Math.abs(D),g[1]-Math.abs(z)]),"ne"===r){const e=[p[0],g[1]];R=[e[0],e[1]-Math.abs(z)]}if("sw"===r){const e=[g[0],p[1]];R=[e[0]-Math.abs(D),e[1]]}t&&(["s","n"].includes(r)&&(R[0]=m[0]-D/2),["e","w"].includes(r)&&(R[1]=m[1]-z/2)),T<0&&(r.includes("e")&&(R[0]-=Math.abs(D)),r.includes("w")&&(R[0]+=Math.abs(D))),M<0&&(r.includes("s")&&(R[1]-=Math.abs(z)),r.includes("n")&&(R[1]+=Math.abs(z))),i&&(R[0]=m[0]-Math.abs(D)/2,R[1]=m[1]-Math.abs(z)/2);const H=l.angle,N=ze(R,m,H),B=[R[0]+Math.abs(D)/2,R[1]+Math.abs(z)/2],F=ze(B,m,H);R=ze(N,F,-H);const U=qo(l,T,M),W=[...R];W[0]+=l.x-O,W[1]+=l.y-L;const K=Object.assign({width:Math.abs(T),height:Math.abs(M),x:W[0],y:W[1]},U);"scale"in n&&"scale"in l&&Lr(n,{scale:[(Math.sign(_)||l.scale[0])*l.scale[0],(Math.sign(C)||l.scale[1])*l.scale[1]]}),0!==K.width&&0!==K.height&&Number.isFinite(K.x)&&Number.isFinite(K.y)&&(Ao(n,{newSize:{width:K.width,height:K.height}}),Lr(n,K),S&&E&&Lr(S,{fontSize:E.fontSize}),Bn(n,r))},ea=(e,t,n,r)=>{const[i,a,s,l]=et(e);let c,d;switch(t){case"se":c=Math.max((n-i)/(s-i),(r-a)/(l-a)),d=(e,t,n)=>{let[r,o]=t,[s,l]=n;return{x:e.x+(r-i)*(c-1)+r-s,y:e.y+(o-a)*(c-1)+o-l}};break;case"nw":c=Math.max((s-n)/(s-i),(l-r)/(l-a)),d=(e,t,n)=>{let[,,r,i]=t,[,,o,a]=n;return{x:e.x-(s-r)*(c-1)+r-o,y:e.y-(l-i)*(c-1)+i-a}};break;case"ne":c=Math.max((n-i)/(s-i),(l-r)/(l-a)),d=(e,t,n)=>{let[r,,,o]=t,[a,,,s]=n;return{x:e.x+(r-i)*(c-1)+r-a,y:e.y-(l-o)*(c-1)+o-s}};break;case"sw":c=Math.max((s-n)/(s-i),(r-a)/(l-a)),d=(e,t,n)=>{let[,r,i]=t,[,o,l]=n;return{x:e.x-(s-i)*(c-1)+i-l,y:e.y+(r-a)*(c-1)+r-o}}}if(c>0){const n=e.reduce(((t,n)=>{if(!t)return t;const r=n.width*c,i=n.height*c,a=Jn(n);let s={};if(a){const e=$o(a,r-2*o.gK,i-2*o.gK);if(null===e)return null;s={fontSize:e.size,baseline:e.baseline}}if(Ce(n)){const e=$o(n,r,i);if(null===e)return null;s={fontSize:e.size,baseline:e.baseline}}const l=Ye(n),u=qo(n,r,i);Ao(n,{newSize:{width:r,height:i},simultaneouslyUpdated:e});const h=tt(Object.assign(Object.assign({},n),u),r,i),{x:p,y:g}=d(n,l,h);return[...t,Object.assign(Object.assign({width:r,height:i,x:p,y:g},u),s)]}),[]);n&&e.forEach(((e,r)=>{Lr(e,n[r]);const i=Jn(e);i&&(Lr(i,{fontSize:n[r].fontSize,baseline:n[r].baseline}),Bn(e,t))}))}},ta=(e,t,n,r,i,a,s)=>{let l=5*Math.PI/2+Math.atan2(r-s,n-a);i&&(l+=o.ay/2,l-=l%o.ay),t.forEach(((t,n)=>{var r,i;const[o,c,d,u]=Ye(t),h=(o+d)/2,p=(c+u)/2,g=null!==(r=null===(i=e.originalElements.get(t.id))||void 0===i?void 0:i.angle)&&void 0!==r?r:t.angle,[m,f]=De(h,p,a,s,l+g-t.angle);Lr(t,{x:t.x+(m-h),y:t.y+(f-p),angle:Yo(l+g)});const b=Qn(t);if(b){const e=Rn.getScene(t).getElement(b);Lr(e,{x:e.x+(m-h),y:e.y+(f-p),angle:Yo(l+g)})}}))},na=(e,t,n,r,i,o)=>{let a,s;if(e){const l=e&&t<n,c=e&&t>n,d=r.originalElements.get(i.id);a=l&&d?d.x:i.x+o.x,s=c&&d?d.y:i.y+o.y}else a=i.x+o.x,s=i.y+o.y;Lr(i,{x:a,y:s})},ra=(e,t,n,r,i,o,a,s,l,c,d)=>{l&&(d?s=a/d:(({width:a,height:s}=zr(t,a,o<r?-s:s)),s<0&&(s=-s)));let u=i<n?n-a:n,h=o<r?r-s:r;c&&(u=n-(a+=a)/2,h=r-(s+=s)/2),0!==a&&0!==s&&Lr(e,{x:u,y:h,width:a,height:s})},ia=e=>{let{options:t,value:n,onChange:r,group:i}=e;return(0,v.jsx)("div",{className:"buttonList buttonListIcon",children:t.map((e=>(0,v.jsxs)("label",{className:ye({active:n===e.value}),title:e.text,children:[(0,v.jsx)("input",{type:"radio",name:i,onChange:()=>r(e.value),checked:n===e.value,"data-testid":e.testId}),e.icon]},e.text)))})};n(4301);const oa=e=>{let{children:t,left:n,top:i,onCloseRequest:o,fitInViewport:a=!1,offsetLeft:s=0,offsetTop:l=0,viewportWidth:c=window.innerWidth,viewportHeight:d=window.innerHeight}=e;const u=(0,r.useRef)(null);return(0,r.useLayoutEffect)((()=>{if(a&&u.current){const e=u.current,{x:t,y:n,width:r,height:i}=e.getBoundingClientRect();t+r-s>c&&(e.style.left="".concat(c-r,"px")),n+i-l>d&&(e.style.top="".concat(d-i,"px"))}}),[a,c,d,s,l]),(0,r.useEffect)((()=>{if(o){const e=e=>{var t;null!==(t=u.current)&&void 0!==t&&t.contains(e.target)||(0,st.unstable_batchedUpdates)((()=>o(e)))};return document.addEventListener("pointerdown",e,!1),()=>document.removeEventListener("pointerdown",e,!1)}}),[o]),(0,v.jsx)("div",{className:"popover",style:{top:i,left:n},ref:u,children:t})};n(4220);const aa=(e,t)=>!at[t].includes(e),sa=e=>{const t=(new Option).style;return t.color=e,!!t.color},la=[["1","2","3","4","5"],["q","w","e","r","t"],["a","s","d","f","g"],["z","x","c","v","b"]].flat(),ca=e=>{let{colors:t,color:n,onChange:r,onClose:o,label:a,showInput:s=!0,type:l,elements:c}=e;const d=i().useRef(),u=i().useRef(),h=i().useRef(),p=i().useRef(),[g]=i().useState((()=>"canvasBackground"===l?[]:((e,t)=>{const n=[],r=e.filter((e=>!e.isDeleted)).sort(((e,t)=>t.updated-e.updated));let i=0;const o={elementBackground:"backgroundColor",elementStroke:"strokeColor"}[t];for(;i<r.length&&n.length<5;){const e=r[i];n.length<5&&aa(e[o],t)&&!n.includes(e[o])&&n.push(e[o]),i++}return n})(c,l)));i().useEffect((()=>{u.current?u.current.focus():p.current?p.current.focus():h.current&&h.current.focus()}),[]);const f=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e.map(((e,i)=>{const o=e.replace("#",""),a=t?la[i+15]:la[i],s=t?o:b("colors.".concat(o));return(0,v.jsxs)("button",{className:"color-picker-swatch",onClick:t=>{t.currentTarget.focus(),r(e)},title:"".concat(s).concat(rn(e)?"":" (".concat(e,")")," — ").concat(a.toUpperCase()),"aria-label":s,"aria-keyshortcuts":la[i],style:{color:e},ref:r=>{!t&&r&&0===i&&(d.current=r),r&&e===n&&(u.current=r)},onFocus:()=>{r(e)},children:[rn(e)?(0,v.jsx)("div",{className:"color-picker-transparent"}):void 0,(0,v.jsx)("span",{className:"color-picker-keybinding",children:a})]},e)}))};return(0,v.jsxs)("div",{className:"color-picker color-picker-type-".concat(l),role:"dialog","aria-modal":"true","aria-label":b("labels.colorPicker"),onKeyDown:e=>{if(e.key===Lt.TAB){const{activeElement:r}=document;var t;if(e.shiftKey){if(r===d.current)null===(t=p.current)||void 0===t||t.focus(),e.preventDefault()}else if(r===p.current){var n;null===(n=d.current)||void 0===n||n.focus(),e.preventDefault()}}else if(At(e.key)){const{activeElement:t}=document,n=m().rtl;let i=!1,o=Array.prototype.indexOf.call(h.current.querySelector(".color-picker-content--default").children,t);-1===o&&(o=Array.prototype.indexOf.call(h.current.querySelector(".color-picker-content--canvas-colors").children,t),-1!==o&&(i=!0));const a=i?h.current.querySelector(".color-picker-content--canvas-colors"):h.current.querySelector(".color-picker-content--default");if(-1!==o){var r;const t=a.children.length-(s?1:0),l=e.key===(n?Lt.ARROW_LEFT:Lt.ARROW_RIGHT)?(o+1)%t:e.key===(n?Lt.ARROW_RIGHT:Lt.ARROW_LEFT)?(t+o-1)%t:i||e.key!==Lt.ARROW_DOWN?i||e.key!==Lt.ARROW_UP?o:(t+o-5)%t:(o+5)%t;null===(r=a.children[l])||void 0===r||r.focus()}e.preventDefault()}else if(la.includes(e.key.toLowerCase())&&!Bt(e.target)){var i;const t=la.indexOf(e.key.toLowerCase()),n=t>=15,r=n?t-15:t;null===(i=(n?h.current.querySelector(".color-picker-content--canvas-colors"):h.current.querySelector(".color-picker-content--default")).children[r])||void 0===i||i.focus(),e.preventDefault()}else e.key!==Lt.ESCAPE&&e.key!==Lt.ENTER||(e.preventDefault(),o());e.nativeEvent.stopImmediatePropagation(),e.stopPropagation()},children:[(0,v.jsx)("div",{className:"color-picker-triangle color-picker-triangle-shadow"}),(0,v.jsx)("div",{className:"color-picker-triangle"}),(0,v.jsxs)("div",{className:"color-picker-content",ref:e=>{e&&(h.current=e)},tabIndex:0,children:[(0,v.jsx)("div",{className:"color-picker-content--default",children:f(t)}),!!g.length&&(0,v.jsxs)("div",{className:"color-picker-content--canvas",children:[(0,v.jsx)("span",{className:"color-picker-content--canvas-title",children:b("labels.canvasColors")}),(0,v.jsx)("div",{className:"color-picker-content--canvas-colors",children:f(g,!0)})]}),s&&(0,v.jsx)(da,{color:n,label:a,onChange:e=>{r(e)},ref:p})]})]})},da=i().forwardRef(((e,t)=>{let{color:n,onChange:r,label:o}=e;const[a,s]=i().useState(n),l=i().useRef(null);i().useEffect((()=>{s(n)}),[n]),i().useImperativeHandle(t,(()=>l.current));const c=i().useCallback((e=>{const t=e.toLowerCase(),n=(e=>rn(e)||sa(e)?e:sa("#".concat(e))?"#".concat(e):null)(t);n&&r(n),s(t)}),[r]);return(0,v.jsxs)("label",{className:"color-input-container",children:[(0,v.jsx)("div",{className:"color-picker-hash",children:"#"}),(0,v.jsx)("input",{spellCheck:!1,className:"color-picker-input","aria-label":o,onChange:e=>c(e.target.value),value:(a||"").replace(/^#/,""),onBlur:()=>s(n),ref:l})]})})),ua=e=>{let{type:t,color:n,onChange:r,label:o,isActive:a,setActive:s,elements:l,appState:c}=e;const d=i().useRef(null);return(0,v.jsxs)("div",{children:[(0,v.jsxs)("div",{className:"color-picker-control-container",children:[(0,v.jsx)("button",{className:"color-picker-label-swatch","aria-label":o,style:n?{"--swatch-color":n}:void 0,onClick:()=>s(!a),ref:d}),(0,v.jsx)(da,{color:n,label:o,onChange:e=>{r(e)}})]}),(0,v.jsx)(i().Suspense,{fallback:"",children:a?(0,v.jsx)(oa,{onCloseRequest:e=>e.target!==d.current&&s(!1),children:(0,v.jsx)(ca,{colors:at[t],color:n||null,onChange:e=>{r(e)},onClose:()=>{var e;s(!1),null===(e=d.current)||void 0===e||e.focus()},label:o,showInput:!1,type:t,elements:l})}):null})]})};n(7117);function ha(e){let{options:t,value:n,label:r,onChange:o,onClose:a}=e;const s=i().useRef(),l=i().useRef(),c=i().useRef(null);i().useEffect((()=>{l.current?l.current.focus():c.current&&c.current.focus()}),[]);return(0,v.jsx)("div",{className:"picker",role:"dialog","aria-modal":"true","aria-label":r,onKeyDown:e=>{const n=t.find((t=>t.keyBinding===e.key.toLowerCase()));if(e.metaKey||e.altKey||e.ctrlKey||!n)if(e.key===Lt.TAB)setTimeout((()=>{l.current!==document.activeElement&&a()}),0);else if(At(e.key)){const{activeElement:n}=document,r=m().rtl,i=Array.prototype.indexOf.call(c.current.children,n);if(-1!==i){const n=t.length;let o=i;switch(e.key){case r?Lt.ARROW_LEFT:Lt.ARROW_RIGHT:case Lt.ARROW_DOWN:o=(i+1)%n;break;case r?Lt.ARROW_RIGHT:Lt.ARROW_LEFT:case Lt.ARROW_UP:o=(n+i-1)%n}c.current.children[o].focus()}e.preventDefault()}else e.key!==Lt.ESCAPE&&e.key!==Lt.ENTER||(e.preventDefault(),a());else{const r=t.indexOf(n);c.current.children[r].focus(),e.preventDefault()}e.nativeEvent.stopImmediatePropagation(),e.stopPropagation()},children:(0,v.jsx)("div",{className:"picker-content",ref:c,children:t.map(((e,t)=>(0,v.jsxs)("button",{className:"picker-option",onClick: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:r=>{r&&0===t&&(s.current=r),r&&e.value===n&&(l.current=r)},onFocus:()=>{o(e.value)},children:[e.icon,(0,v.jsx)("span",{className:"picker-keybinding",children:e.keyBinding})]},e.text)))})})}function pa(e){var t;let{value:n,label:r,options:o,onChange:a,group:s=""}=e;const[l,c]=i().useState(!1),d=i().useRef(null),u=m().rtl;return(0,v.jsxs)("label",{className:"picker-container",children:[(0,v.jsx)("button",{name:s,className:l?"active":"","aria-label":r,onClick:()=>c(!l),ref:d,children:null===(t=o.find((e=>e.value===n)))||void 0===t?void 0:t.icon}),(0,v.jsx)(i().Suspense,{fallback:"",children:l?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(oa,Object.assign(Object.assign({onCloseRequest:e=>e.target!==d.current&&c(!1)},u?{right:5.5}:{left:-5.5}),{children:(0,v.jsx)(ha,{options:o,value:n,label:r,onChange:a,onClose:()=>{var e;c(!1),null===(e=d.current)||void 0===e||e.focus()}})})),(0,v.jsx)("div",{className:"picker-triangle"})]}):null})]})}const ga=e=>e===o.C6.LIGHT?it.orange[4]:it.orange[9],ma=e=>e===o.C6.LIGHT?it.white:"#1e1e1e",fa=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:512;const{width:n=512,height:r=n,mirror:i,style:o}="number"==typeof t?{width:t}:t;return(0,v.jsx)("svg",{"aria-hidden":"true",focusable:"false",role:"img",viewBox:"0 0 ".concat(n," ").concat(r),className:ye({"rtl-mirror":i}),style:o,children:"string"==typeof e?(0,v.jsx)("path",{fill:"currentColor",d:e}):e})},ba=fa((0,v.jsx)("polyline",{fill:"none",stroke:"currentColor",points:"20 6 9 17 4 12"}),{width:24,height:24}),va=fa("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}),xa=fa("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}),ya=fa("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}),wa=fa("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}),ka=fa("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}),_a=fa("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}),Ca=fa("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"),Ea=(fa("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}),fa((0,v.jsxs)(v.Fragment,{children:[(0,v.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,v.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})),Sa=fa("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}),ja=fa("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}),Ia=fa("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}),Ta=fa("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"),Ma=fa("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"),Oa=fa("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}),La=fa("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}),Aa=fa("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}),Pa=(fa("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}),fa("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}),fa((0,v.jsxs)(v.Fragment,{children:[(0,v.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,v.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}),fa((0,v.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}),i().memo((e=>{let{theme:t}=e;return fa((0,v.jsxs)(v.Fragment,{children:[(0,v.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:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2"}),(0,v.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:ga(t),stroke:ga(t),strokeWidth:"2"})]}),{width:24,mirror:!0})}))),Da=i().memo((e=>{let{theme:t}=e;return fa((0,v.jsxs)(v.Fragment,{children:[(0,v.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:ga(t),stroke:ga(t),strokeWidth:"2"}),(0,v.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:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2"})]}),{width:24,mirror:!0})})),za=i().memo((e=>{let{theme:t}=e;return fa((0,v.jsxs)(v.Fragment,{children:[(0,v.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:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2"}),(0,v.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:ga(t),stroke:ga(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),Ra=i().memo((e=>{let{theme:t}=e;return fa((0,v.jsxs)(v.Fragment,{children:[(0,v.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:ga(t),stroke:ga(t),strokeWidth:"2"}),(0,v.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:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2"})]}),{width:24,mirror:!0})})),Ha=i().memo((e=>{let{theme:t}=e;return fa((0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("path",{d:"M 2,5 H 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,v.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:ga(t),stroke:ga(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),Na=i().memo((e=>{let{theme:t}=e;return fa((0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("path",{d:"M 2,19 H 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,v.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:ga(t),stroke:ga(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),Ba=i().memo((e=>{let{theme:t}=e;return fa((0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("path",{d:"M 5,2 V 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,v.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:ga(t),stroke:ga(t),strokeWidth:"2"})]}),{width:24})})),Fa=i().memo((e=>{let{theme:t}=e;return fa((0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("path",{d:"M 19,2 V 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,v.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:ga(t),stroke:ga(t),strokeWidth:"2"})]}),{width:24})})),Ua=i().memo((e=>{let{theme:t}=e;return fa((0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("path",{d:"M19 5V19M5 5V19",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,v.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:ga(t),stroke:ga(t),strokeWidth:"2"})]}),{width:24})})),Wa=i().memo((e=>{let{theme:t}=e;return fa((0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("path",{d:"M5 5L19 5M5 19H19",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,v.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:ga(t),stroke:ga(t),strokeWidth:"2"})]}),{width:24})})),Ka=i().memo((e=>{let{theme:t}=e;return fa((0,v.jsxs)(v.Fragment,{children:[(0,v.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:ga(t),stroke:ga(t),strokeWidth:"2"}),(0,v.jsx)("path",{d:"M 2,12 H 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeDasharray:"1, 2.8",strokeLinecap:"round"})]}),{width:24,mirror:!0})})),Va=i().memo((e=>{let{theme:t}=e;return fa((0,v.jsxs)(v.Fragment,{children:[(0,v.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:ga(t),stroke:ga(t),strokeWidth:"2"}),(0,v.jsx)("path",{d:"M 12,2 V 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeDasharray:"1, 2.8",strokeLinecap:"round"})]}),{width:24})})),Ga=fa("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}),Ya=(fa("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"),fa("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"),fa("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})),Xa=fa("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}),Za=fa("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}),qa=(fa("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}),fa("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})),$a=i().memo((e=>{let{theme:t}=e;return fa((0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("path",{d:"M25 26H111V111H25",fill:"var(--icon-fill-color)"}),(0,v.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:"var(--icon-fill-color)",strokeWidth:"2"}),(0,v.jsx)("path",{d:"M100 100H160V160H100",fill:"var(--icon-fill-color)"}),(0,v.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:"var(--icon-fill-color)",strokeWidth:"2"}),(0,v.jsxs)("g",{fill:ma(t),stroke:"var(--icon-fill-color)",strokeWidth:"6",children:[(0,v.jsx)("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),(0,v.jsx)("rect",{x:"2.5",y:"149.5",width:"30",height:"30"}),(0,v.jsx)("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),(0,v.jsx)("rect",{x:"147.5",y:"2.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})})),Qa=i().memo((e=>{let{theme:t}=e;return fa((0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("path",{d:"M25 26H111V111H25",fill:"var(--icon-fill-color)"}),(0,v.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:"var(--icon-fill-color)",strokeWidth:"2"}),(0,v.jsx)("path",{d:"M100 100H160V160H100",fill:"var(--icon-fill-color)"}),(0,v.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:"var(--icon-fill-color)",strokeWidth:"2"}),(0,v.jsxs)("g",{fill:ma(t),stroke:"var(--icon-fill-color)",strokeWidth:"6",children:[(0,v.jsx)("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),(0,v.jsx)("rect",{x:"78.5",y:"149.5",width:"30",height:"30"}),(0,v.jsx)("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),(0,v.jsx)("rect",{x:"147.5",y:"78.5",width:"30",height:"30"}),(0,v.jsx)("rect",{x:"105.5",y:"2.5",width:"30",height:"30"}),(0,v.jsx)("rect",{x:"2.5",y:"102.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})})),Ja=i().memo((e=>{let{theme:t}=e;return fa((0,v.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:"var(--icon-fill-color)"}),{width:40,height:20})})),es=i().memo((e=>{let{theme:t}=e;return fa((0,v.jsxs)("g",{fill:"var(--icon-fill-color)",fillRule:"evenodd",clipRule:"evenodd",children:[(0,v.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,v.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})})),ts=i().memo((e=>{let{theme:t}=e;return fa((0,v.jsx)("path",{d:"M2 2H38V18H2V2Z",fill:"var(--icon-fill-color)"}),{width:40,height:20})})),ns=i().memo((e=>{let{theme:t,strokeWidth:n}=e;return fa((0,v.jsx)("path",{d:"M6 10H32",stroke:"var(--icon-fill-color)",strokeWidth:n,strokeLinecap:"round",fill:"none"}),{width:40,height:20})})),rs=i().memo((e=>{let{theme:t}=e;return fa((0,v.jsx)("path",{d:"M6 10H34",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none",strokeLinecap:"round"}),{width:40,height:20})})),is=i().memo((e=>{let{theme:t}=e;return fa((0,v.jsx)("path",{d:"M6 10H34",stroke:"var(--icon-fill-color)",strokeWidth:2.5,strokeDasharray:"10, 8",fill:"none",strokeLinecap:"round"}),{width:40,height:20})})),os=i().memo((e=>{let{theme:t}=e;return fa((0,v.jsx)("path",{d:"M6 10H36",stroke:"var(--icon-fill-color)",strokeWidth:2.5,strokeDasharray:"2, 4.5",fill:"none",strokeLinecap:"round"}),{width:40,height:20})})),as=i().memo((e=>{let{theme:t}=e;return fa((0,v.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:"var(--icon-fill-color)",strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),ss=i().memo((e=>{let{theme:t}=e;return fa((0,v.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:"var(--icon-fill-color)",strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),ls=i().memo((e=>{let{theme:t}=e;return fa((0,v.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:"var(--icon-fill-color)",strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),cs=i().memo((e=>{let{theme:t}=e;return fa((0,v.jsx)("path",{d:"M10 17L10 5L35 5",stroke:"var(--icon-fill-color)",strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),ds=i().memo((e=>{let{theme:t}=e;return fa((0,v.jsx)("path",{d:"M10 17V15C10 8 13 5 21 5L33.5 5",stroke:"var(--icon-fill-color)",strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),us=i().memo((e=>{let{theme:t}=e;return fa((0,v.jsx)("path",{d:"M6 10H34",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none"}),{width:40,height:20})})),hs=i().memo((e=>{let{theme:t,flip:n=!1}=e;return fa((0,v.jsxs)("g",{transform:n?"translate(40, 0) scale(-1, 1)":"",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none",children:[(0,v.jsx)("path",{d:"M34 10H6M34 10L27 5M34 10L27 15"}),(0,v.jsx)("path",{d:"M27.5 5L34.5 10L27.5 15"})]}),{width:40,height:20})})),ps=i().memo((e=>{let{theme:t,flip:n=!1}=e;return fa((0,v.jsxs)("g",{stroke:"var(--icon-fill-color)",fill:"var(--icon-fill-color)",transform:n?"translate(40, 0) scale(-1, 1)":"",children:[(0,v.jsx)("path",{d:"M32 10L6 10",strokeWidth:2}),(0,v.jsx)("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})})),gs=i().memo((e=>{let{theme:t,flip:n=!1}=e;return fa((0,v.jsx)("g",{transform:n?"translate(40, 0) scale(-1, 1)":"",children:(0,v.jsx)("path",{d:"M34 10H5.99996M34 10L34 5M34 10L34 15",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none"})}),{width:40,height:20})})),ms=i().memo((e=>{let{theme:t,flip:n=!1}=e;return fa((0,v.jsxs)("g",{stroke:"var(--icon-fill-color)",fill:"var(--icon-fill-color)",transform:n?"translate(40, 0) scale(-1, 1)":"",children:[(0,v.jsx)("path",{d:"M32 10L6 10",strokeWidth:2}),(0,v.jsx)("path",{d:"M27.5 5.5L34.5 10L27.5 14.5L27.5 5.5"})]}),{width:40,height:20})})),fs=i().memo((e=>{let{theme:t}=e;return fa((0,v.jsx)("path",{fill:"var(--icon-fill-color)",d:"M 0 69.092 L 0 55.03 A 124.24 124.24 0 0 0 4.706 57.02 Q 6.826 57.863 8.708 58.5 A 53.466 53.466 0 0 0 12.231 59.571 Q 17.236 60.889 21.387 60.889 A 20.909 20.909 0 0 0 24.265 60.704 Q 25.719 60.502 26.903 60.077 A 8.649 8.649 0 0 0 29.028 58.985 Q 31.689 57.08 31.689 53.321 Q 31.689 51.221 30.518 49.585 A 10.126 10.126 0 0 0 29.282 48.177 Q 28.352 47.287 27.075 46.436 A 23.719 23.719 0 0 0 25.752 45.627 Q 23.774 44.492 20.176 42.735 A 254.44 254.44 0 0 0 17.822 41.602 Q 11.503 38.631 8.236 35.888 A 19.742 19.742 0 0 1 8.008 35.694 A 22.18 22.18 0 0 1 2.783 29.102 Q 0.83 25.342 0.83 20.313 A 22.471 22.471 0 0 1 1.733 13.778 A 17.283 17.283 0 0 1 7.251 5.42 A 21.486 21.486 0 0 1 15.177 1.272 Q 18.361 0.338 22.166 0.09 A 43.573 43.573 0 0 1 25 0 A 42.399 42.399 0 0 1 34.349 1.01 A 39.075 39.075 0 0 1 35.62 1.319 A 67.407 67.407 0 0 1 42.108 3.382 A 83.357 83.357 0 0 1 46.191 5.03 L 41.309 16.797 Q 35.596 14.453 31.86 13.526 A 30.762 30.762 0 0 0 25.417 12.612 A 28.337 28.337 0 0 0 24.512 12.598 A 14.846 14.846 0 0 0 22.022 12.793 Q 19.498 13.224 17.92 14.6 Q 15.625 16.602 15.625 19.824 Q 15.625 21.826 16.553 23.316 Q 17.48 24.805 19.507 26.197 A 18.343 18.343 0 0 0 20.659 26.912 Q 22.596 28.035 26.516 29.953 A 299.99 299.99 0 0 0 29.102 31.201 Q 37.91 35.412 41.841 39.642 A 16.553 16.553 0 0 1 42.822 40.796 A 17.675 17.675 0 0 1 46.301 49.233 A 23.517 23.517 0 0 1 46.533 52.588 A 21.581 21.581 0 0 1 45.471 59.515 A 17.733 17.733 0 0 1 39.575 67.823 Q 33.745 72.486 24.094 73.243 A 49.683 49.683 0 0 1 20.215 73.389 A 51.712 51.712 0 0 1 9.448 72.315 A 40.672 40.672 0 0 1 0 69.092 Z"}),{width:47,height:77})})),bs=i().memo((e=>{let{theme:t}=e;return fa((0,v.jsx)("path",{fill:"var(--icon-fill-color)",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})})),vs=i().memo((e=>{let{theme:t}=e;return fa((0,v.jsx)("path",{fill:"var(--icon-fill-color)",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})})),xs=i().memo((e=>{let{theme:t}=e;return fa((0,v.jsx)("path",{fill:"var(--icon-fill-color)",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})})),ys=i().memo((e=>{let{theme:t}=e;return fa((0,v.jsx)("path",{fill:"var(--icon-fill-color)",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})})),ws=i().memo((e=>{let{theme:t}=e;return fa((0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("path",{fill:"var(--icon-fill-color)",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,v.jsx)("path",{fill:"var(--icon-fill-color)",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})})),ks=i().memo((e=>{let{theme:t}=e;return fa((0,v.jsx)(v.Fragment,{children:(0,v.jsx)("path",{fill:"var(--icon-fill-color)",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})})),_s=i().memo((e=>{let{theme:t}=e;return fa((0,v.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:"var(--icon-fill-color)",strokeLinecap:"round"}),{width:448,height:512})})),Cs=i().memo((e=>{let{theme:t}=e;return fa((0,v.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:"var(--icon-fill-color)"}),{width:448,height:512})})),Es=i().memo((e=>{let{theme:t}=e;return fa((0,v.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:"var(--icon-fill-color)",strokeLinecap:"round"}),{width:448,height:512})})),Ss=i().memo((e=>{let{theme:t}=e;return fa((0,v.jsx)("path",{d:"m16,132l416,0c8.837,0 16,-7.163 16,-16l0,-40c0,-8.837 -7.163,-16 -16,-16l-416,0c-8.837,0 -16,7.163 -16,16l0,40c0,8.837 7.163,16 16,16zm0,160l416,0c8.837,0 16,-7.163 16,-16l0,-40c0,-8.837 -7.163,-16 -16,-16l-416,0c-8.837,0 -16,7.163 -16,16l0,40c0,8.837 7.163,16 16,16z",fill:"var(--icon-fill-color)",strokeLinecap:"round"}),{width:448,height:512})})),js=i().memo((e=>{let{theme:t}=e;return fa((0,v.jsx)("path",{d:"M16,292L432,292C440.837,292 448,284.837 448,276L448,236C448,227.163 440.837,220 432,220L16,220C7.163,220 0,227.163 0,236L0,276C0,284.837 7.163,292 16,292ZM16,452L432,452C440.837,452 448,444.837 448,436L448,396C448,387.163 440.837,380 432,380L16,380C7.163,380 0,387.163 0,396L0,436C0,444.837 7.163,452 16,452Z",fill:"var(--icon-fill-color)",strokeLinecap:"round"}),{width:448,height:512})})),Is=i().memo((e=>{let{theme:t}=e;return fa((0,v.jsx)("path",{transform:"matrix(1,0,0,1,0,80)",d:"M16,132L432,132C440.837,132 448,124.837 448,116L448,76C448,67.163 440.837,60 432,60L16,60C7.163,60 0,67.163 0,76L0,116C0,124.837 7.163,132 16,132ZM16,292L432,292C440.837,292 448,284.837 448,276L448,236C448,227.163 440.837,220 432,220L16,220C7.163,220 0,227.163 0,236L0,276C0,284.837 7.163,292 16,292Z",fill:"var(--icon-fill-color)",strokeLinecap:"round"}),{width:448,height:512})})),Ts=fa((0,v.jsx)("path",{d:"M537.6 226.6c4.1-10.7 6.4-22.4 6.4-34.6 0-53-43-96-96-96-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32c-88.4 0-160 71.6-160 160 0 2.7.1 5.4.2 8.1C40.2 219.8 0 273.2 0 336c0 79.5 64.5 144 144 144h368c70.7 0 128-57.3 128-128 0-61.9-44-113.6-102.4-125.4zM393.4 288H328v112c0 8.8-7.2 16-16 16h-48c-8.8 0-16-7.2-16-16V288h-65.4c-14.3 0-21.4-17.2-11.3-27.3l105.4-105.4c6.2-6.2 16.4-6.2 22.6 0l105.4 105.4c10.1 10.1 2.9 27.3-11.3 27.3z",fill:"currentColor"}),{width:640,height:512}),Ms=fa((0,v.jsx)("path",{fill:"currentColor",d:"M402.3 344.9l32-32c5-5 13.7-1.5 13.7 5.7V464c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V112c0-26.5 21.5-48 48-48h273.5c7.1 0 10.7 8.6 5.7 13.7l-32 32c-1.5 1.5-3.5 2.3-5.7 2.3H48v352h352V350.5c0-2.1.8-4.1 2.3-5.6zm156.6-201.8L296.3 405.7l-90.4 10c-26.2 2.9-48.5-19.2-45.6-45.6l10-90.4L432.9 17.1c22.9-22.9 59.9-22.9 82.7 0l43.2 43.2c22.9 22.9 22.9 60 .1 82.8zM460.1 174L402 115.9 216.2 301.8l-7.3 65.3 65.3-7.3L460.1 174zm64.8-79.7l-43.2-43.2c-4.1-4.1-10.8-4.1-14.8 0L436 82l58.1 58.1 30.9-30.9c4-4.2 4-10.8-.1-14.9z"}),{width:640,height:512}),Os=fa("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"),Ls=e=>"rectangle"===e||"ellipse"===e||"diamond"===e||"line"===e||"freedraw"===e,As=e=>"image"!==e,Ps=e=>"rectangle"===e||"ellipse"===e||"diamond"===e||"freedraw"===e||"arrow"===e||"line"===e,Ds=e=>"rectangle"===e||"ellipse"===e||"diamond"===e||"arrow"===e||"line"===e,zs=e=>"rectangle"===e||"arrow"===e||"line"===e||"diamond"===e,Rs=e=>"text"===e,Hs=e=>"arrow"===e,Ns=(e,t)=>{let n=null;for(let r=e.length-1;r>=0;--r){const i=e[r];if(!i.isDeleted&&t(i)){n=i;break}}return n},Bs=(e,t,n)=>{let r=null;for(let i=e.length-1;i>=0;--i){if(e[i].isDeleted)continue;const[o,a,s,l]=Ye(e[i]);if(o<t&&t<s&&a<n&&n<l){r=e[i];break}}return Le(r)?r:null};let Fs=[];const Us=e=>(Fs=Fs.concat(e),e),Ws=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=ln(Ol(e,t,r));return e.map((e=>{var r;return i.get(e.id)||e.id===(null===(r=t.editingElement)||void 0===r?void 0:r.id)?n(e):e}))},Ks=function(e,t,n,r){var i,o;const a=t.editingElement,s=_l(e);return null!==(i=null!==(o=a&&n(a))&&void 0!==o?o:Tl(s,t)?Ml(s,t,n):r)&&void 0!==i?i:null},Vs=(e,t,n,r)=>{const i=new Set;return{elements:Ws(e,t,(e=>{if(Ce(e)){const o=n(e);i.add(o);let a=Ar(e,{fontSize:o});return Hn(a,er(e)),t=e,a=Pe(r=a)?r:Lr(r,{x:"left"===t.textAlign?t.x:t.x+(t.width-r.width)/("center"===t.textAlign?2:1),y:t.y+(t.height-r.height)/2},!1),a}var t,r;return e}),!0),appState:Object.assign(Object.assign({},t),{currentItemFontSize:1===i.size?[...i][0]:null!=r?r:t.currentItemFontSize}),commitToHistory:!0}},Gs=(Us({name:"changeStrokeColor",perform:(e,t,n)=>Object.assign(Object.assign({},n.currentItemStrokeColor&&{elements:Ws(e,t,(e=>As(e.type)?Ar(e,{strokeColor:n.currentItemStrokeColor}):e),!0)}),{appState:Object.assign(Object.assign({},t),n),commitToHistory:!!n.currentItemStrokeColor}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("h3",{"aria-hidden":"true",children:b("labels.stroke")}),(0,v.jsx)(ua,{type:"elementStroke",label:b("labels.stroke"),color:Ks(t,n,(e=>e.strokeColor),n.currentItemStrokeColor),onChange:e=>r({currentItemStrokeColor:e}),isActive:"strokeColorPicker"===n.openPopup,setActive:e=>r({openPopup:e?"strokeColorPicker":null}),elements:t,appState:n})]})}}),Us({name:"changeBackgroundColor",perform:(e,t,n)=>Object.assign(Object.assign({},n.currentItemBackgroundColor&&{elements:Ws(e,t,(e=>Ar(e,{backgroundColor:n.currentItemBackgroundColor})))}),{appState:Object.assign(Object.assign({},t),n),commitToHistory:!!n.currentItemBackgroundColor}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("h3",{"aria-hidden":"true",children:b("labels.background")}),(0,v.jsx)(ua,{type:"elementBackground",label:b("labels.background"),color:Ks(t,n,(e=>e.backgroundColor),n.currentItemBackgroundColor),onChange:e=>r({currentItemBackgroundColor:e}),isActive:"backgroundColorPicker"===n.openPopup,setActive:e=>r({openPopup:e?"backgroundColorPicker":null}),elements:t,appState:n})]})}}),Us({name:"changeFillStyle",perform:(e,t,n)=>({elements:Ws(e,t,(e=>Ar(e,{fillStyle:n}))),appState:Object.assign(Object.assign({},t),{currentItemFillStyle:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsxs)("fieldset",{children:[(0,v.jsx)("legend",{children:b("labels.fill")}),(0,v.jsx)(ia,{options:[{value:"hachure",text:b("labels.hachure"),icon:(0,v.jsx)(Ja,{theme:n.theme})},{value:"cross-hatch",text:b("labels.crossHatch"),icon:(0,v.jsx)(es,{theme:n.theme})},{value:"solid",text:b("labels.solid"),icon:(0,v.jsx)(ts,{theme:n.theme})}],group:"fill",value:Ks(t,n,(e=>e.fillStyle),n.currentItemFillStyle),onChange:e=>{r(e)}})]})}}),Us({name:"changeStrokeWidth",perform:(e,t,n)=>({elements:Ws(e,t,(e=>Ar(e,{strokeWidth:n}))),appState:Object.assign(Object.assign({},t),{currentItemStrokeWidth:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsxs)("fieldset",{children:[(0,v.jsx)("legend",{children:b("labels.strokeWidth")}),(0,v.jsx)(ia,{group:"stroke-width",options:[{value:1,text:b("labels.thin"),icon:(0,v.jsx)(ns,{theme:n.theme,strokeWidth:2})},{value:2,text:b("labels.bold"),icon:(0,v.jsx)(ns,{theme:n.theme,strokeWidth:6})},{value:4,text:b("labels.extraBold"),icon:(0,v.jsx)(ns,{theme:n.theme,strokeWidth:10})}],value:Ks(t,n,(e=>e.strokeWidth),n.currentItemStrokeWidth),onChange:e=>r(e)})]})}}),Us({name:"changeSloppiness",perform:(e,t,n)=>({elements:Ws(e,t,(e=>Ar(e,{seed:Mr(),roughness:n}))),appState:Object.assign(Object.assign({},t),{currentItemRoughness:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsxs)("fieldset",{children:[(0,v.jsx)("legend",{children:b("labels.sloppiness")}),(0,v.jsx)(ia,{group:"sloppiness",options:[{value:0,text:b("labels.architect"),icon:(0,v.jsx)(as,{theme:n.theme})},{value:1,text:b("labels.artist"),icon:(0,v.jsx)(ss,{theme:n.theme})},{value:2,text:b("labels.cartoonist"),icon:(0,v.jsx)(ls,{theme:n.theme})}],value:Ks(t,n,(e=>e.roughness),n.currentItemRoughness),onChange:e=>r(e)})]})}}),Us({name:"changeStrokeStyle",perform:(e,t,n)=>({elements:Ws(e,t,(e=>Ar(e,{strokeStyle:n}))),appState:Object.assign(Object.assign({},t),{currentItemStrokeStyle:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsxs)("fieldset",{children:[(0,v.jsx)("legend",{children:b("labels.strokeStyle")}),(0,v.jsx)(ia,{group:"strokeStyle",options:[{value:"solid",text:b("labels.strokeStyle_solid"),icon:(0,v.jsx)(rs,{theme:n.theme})},{value:"dashed",text:b("labels.strokeStyle_dashed"),icon:(0,v.jsx)(is,{theme:n.theme})},{value:"dotted",text:b("labels.strokeStyle_dotted"),icon:(0,v.jsx)(os,{theme:n.theme})}],value:Ks(t,n,(e=>e.strokeStyle),n.currentItemStrokeStyle),onChange:e=>r(e)})]})}}),Us({name:"changeOpacity",perform:(e,t,n)=>({elements:Ws(e,t,(e=>Ar(e,{opacity:n}))),appState:Object.assign(Object.assign({},t),{currentItemOpacity:n}),commitToHistory:!0}),PanelComponent:e=>{var t;let{elements:n,appState:r,updateData:i}=e;return(0,v.jsxs)("label",{className:"control-label",children:[b("labels.opacity"),(0,v.jsx)("input",{type:"range",min:"0",max:"100",step:"10",onChange:e=>i(+e.target.value),onWheel:e=>{e.stopPropagation();const t=+e.target.value;e.deltaY<0&&t<100?i(t+10):e.deltaY>0&&t>0&&i(t-10)},value:null!==(t=Ks(n,r,(e=>e.opacity),r.currentItemOpacity))&&void 0!==t?t:void 0})]})}}),Us({name:"changeFontSize",perform:(e,t,n)=>Vs(e,t,(()=>n),n),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsxs)("fieldset",{children:[(0,v.jsx)("legend",{children:b("labels.fontSize")}),(0,v.jsx)(ia,{group:"font-size",options:[{value:16,text:b("labels.small"),icon:(0,v.jsx)(fs,{theme:n.theme}),testId:"fontSize-small"},{value:20,text:b("labels.medium"),icon:(0,v.jsx)(bs,{theme:n.theme}),testId:"fontSize-medium"},{value:28,text:b("labels.large"),icon:(0,v.jsx)(vs,{theme:n.theme}),testId:"fontSize-large"},{value:36,text:b("labels.veryLarge"),icon:(0,v.jsx)(xs,{theme:n.theme}),testId:"fontSize-veryLarge"}],value:Ks(t,n,(e=>{if(Ce(e))return e.fontSize;const t=Jn(e);return t?t.fontSize:null}),n.currentItemFontSize||o.n5),onChange:e=>r(e)})]})}}),Us({name:"decreaseFontSize",perform:(e,t,n)=>Vs(e,t,(e=>Math.round(1/1.1*e.fontSize))),keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.shiftKey&&(e.key===Lt.CHEVRON_LEFT||e.key===Lt.COMMA)})),Ys=Us({name:"increaseFontSize",perform:(e,t,n)=>Vs(e,t,(e=>Math.round(1.1*e.fontSize))),keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.shiftKey&&(e.key===Lt.CHEVRON_RIGHT||e.key===Lt.PERIOD)});Us({name:"changeFontFamily",perform:(e,t,n)=>({elements:Ws(e,t,(e=>{if(Ce(e)){const t=Ar(e,{fontFamily:n});return Hn(t,er(e)),t}return e}),!0),appState:Object.assign(Object.assign({},t),{currentItemFontFamily:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;const i=[{value:o.ut.Virgil,text:b("labels.handDrawn"),icon:(0,v.jsx)(ys,{theme:n.theme})},{value:o.ut.Helvetica,text:b("labels.normal"),icon:(0,v.jsx)(ws,{theme:n.theme})},{value:o.ut.Cascadia,text:b("labels.code"),icon:(0,v.jsx)(ks,{theme:n.theme})}];return(0,v.jsxs)("fieldset",{children:[(0,v.jsx)("legend",{children:b("labels.fontFamily")}),(0,v.jsx)(ia,{group:"font-family",options:i,value:Ks(t,n,(e=>{if(Ce(e))return e.fontFamily;const t=Jn(e);return t?t.fontFamily:null}),n.currentItemFontFamily||o.rk),onChange:e=>r(e)})]})}}),Us({name:"changeTextAlign",perform:(e,t,n)=>({elements:Ws(e,t,(e=>{if(Ce(e)){const t=Ar(e,{textAlign:n});return Hn(t,er(e)),t}return e}),!0),appState:Object.assign(Object.assign({},t),{currentItemTextAlign:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsxs)("fieldset",{children:[(0,v.jsx)("legend",{children:b("labels.textAlign")}),(0,v.jsx)(ia,{group:"text-align",options:[{value:"left",text:b("labels.left"),icon:(0,v.jsx)(_s,{theme:n.theme})},{value:"center",text:b("labels.center"),icon:(0,v.jsx)(Cs,{theme:n.theme})},{value:"right",text:b("labels.right"),icon:(0,v.jsx)(Es,{theme:n.theme})}],value:Ks(t,n,(e=>{if(Ce(e))return e.textAlign;const t=Jn(e);return t?t.textAlign:null}),n.currentItemTextAlign),onChange:e=>r(e)})]})}}),Us({name:"changeVerticalAlign",perform:(e,t,n)=>({elements:Ws(e,t,(e=>{if(Ce(e)){const t=Ar(e,{verticalAlign:n});return Hn(t,er(e)),t}return e}),!0),appState:Object.assign({},t),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)("fieldset",{children:(0,v.jsx)(ia,{group:"text-align",options:[{value:o.oX.TOP,text:b("labels.alignTop"),icon:(0,v.jsx)(Ss,{theme:n.theme})},{value:o.oX.MIDDLE,text:b("labels.centerVertically"),icon:(0,v.jsx)(Is,{theme:n.theme})},{value:o.oX.BOTTOM,text:b("labels.alignBottom"),icon:(0,v.jsx)(js,{theme:n.theme})}],value:Ks(t,n,(e=>{if(Ce(e)&&e.containerId)return e.verticalAlign;const t=Jn(e);return t?t.verticalAlign:null})),onChange:e=>r(e)})})}}),Us({name:"changeSharpness",perform:(e,t,n)=>{const r=Ll(_l(e),t),i=r.length?r.every((e=>!je(e))):!Ie(t.elementType),o=r.length?r.every(je):Ie(t.elementType);return{elements:Ws(e,t,(e=>Ar(e,{strokeSharpness:n}))),appState:Object.assign(Object.assign({},t),{currentItemStrokeSharpness:i?n:t.currentItemStrokeSharpness,currentItemLinearStrokeSharpness:o?n:t.currentItemLinearStrokeSharpness}),commitToHistory:!0}},PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsxs)("fieldset",{children:[(0,v.jsx)("legend",{children:b("labels.edges")}),(0,v.jsx)(ia,{group:"edges",options:[{value:"sharp",text:b("labels.sharp"),icon:(0,v.jsx)(cs,{theme:n.theme})},{value:"round",text:b("labels.round"),icon:(0,v.jsx)(ds,{theme:n.theme})}],value:Ks(t,n,(e=>e.strokeSharpness),zs(n.elementType)&&(Ie(n.elementType)?n.currentItemLinearStrokeSharpness:n.currentItemStrokeSharpness)||null),onChange:e=>r(e)})]})}}),Us({name:"changeArrowhead",perform:(e,t,n)=>({elements:Ws(e,t,(e=>{if(je(e)){const{position:t,type:r}=n;if("start"===t){return Ar(e,{startArrowhead:r})}if("end"===t){return Ar(e,{endArrowhead:r})}}return e})),appState:Object.assign(Object.assign({},t),{["start"===n.position?"currentItemStartArrowhead":"currentItemEndArrowhead"]:n.type}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;const i=m().rtl;return(0,v.jsxs)("fieldset",{children:[(0,v.jsx)("legend",{children:b("labels.arrowheads")}),(0,v.jsxs)("div",{className:"iconSelectList",children:[(0,v.jsx)(pa,{label:"arrowhead_start",options:[{value:null,text:b("labels.arrowhead_none"),icon:(0,v.jsx)(us,{theme:n.theme}),keyBinding:"q"},{value:"arrow",text:b("labels.arrowhead_arrow"),icon:(0,v.jsx)(hs,{theme:n.theme,flip:!i}),keyBinding:"w"},{value:"bar",text:b("labels.arrowhead_bar"),icon:(0,v.jsx)(gs,{theme:n.theme,flip:!i}),keyBinding:"e"},{value:"dot",text:b("labels.arrowhead_dot"),icon:(0,v.jsx)(ps,{theme:n.theme,flip:!i}),keyBinding:"r"},{value:"triangle",text:b("labels.arrowhead_triangle"),icon:(0,v.jsx)(ms,{theme:n.theme,flip:!i}),keyBinding:"t"}],value:Ks(t,n,(e=>je(e)&&Hs(e.type)?e.startArrowhead:n.currentItemStartArrowhead),n.currentItemStartArrowhead),onChange:e=>r({position:"start",type:e})}),(0,v.jsx)(pa,{label:"arrowhead_end",group:"arrowheads",options:[{value:null,text:b("labels.arrowhead_none"),keyBinding:"q",icon:(0,v.jsx)(us,{theme:n.theme})},{value:"arrow",text:b("labels.arrowhead_arrow"),keyBinding:"w",icon:(0,v.jsx)(hs,{theme:n.theme,flip:i})},{value:"bar",text:b("labels.arrowhead_bar"),keyBinding:"e",icon:(0,v.jsx)(gs,{theme:n.theme,flip:i})},{value:"dot",text:b("labels.arrowhead_dot"),keyBinding:"r",icon:(0,v.jsx)(ps,{theme:n.theme,flip:i})},{value:"triangle",text:b("labels.arrowhead_triangle"),icon:(0,v.jsx)(ms,{theme:n.theme,flip:i}),keyBinding:"t"}],value:Ks(t,n,(e=>je(e)&&Hs(e.type)?e.endArrowhead:n.currentItemEndArrowhead),n.currentItemEndArrowhead),onChange:e=>r({position:"end",type:e})})]})]})}});n(5422);class Xs extends Error{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Couldn't export canvas.",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"CANVAS_ERROR";super(),this.name=t,this.message=e}}class Zs extends DOMException{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Request Aborted","AbortError")}}n(371);const qs=e=>{let{size:t="1em",circleWidth:n=8}=e;return(0,v.jsx)("div",{className:"Spinner",children:(0,v.jsx)("svg",{viewBox:"0 0 100 100",style:{width:t,height:t},children:(0,v.jsx)("circle",{cx:"50",cy:"50",r:50-n/2,strokeWidth:n,fill:"none",strokeMiterlimit:"10"})})})},$s=i().forwardRef(((e,t)=>{const{id:n}=up(),o=i().useRef(null);i().useImperativeHandle(t,(()=>o.current));const a="ToolIcon_size_".concat(e.size),[s,l]=(0,r.useState)(!1),c=(0,r.useRef)(!0),d=async t=>{var n;const r="onClick"in e&&(null===(n=e.onClick)||void 0===n?void 0:n.call(e,t));if(r&&"then"in r)try{l(!0),await r}catch(e){if(!(e instanceof Zs))throw e;console.warn(e)}finally{c.current&&l(!1)}};(0,r.useEffect)((()=>()=>{c.current=!1}),[]);const u=(0,r.useRef)(null);if("button"===e.type||"icon"===e.type||"submit"===e.type){const t="icon"===e.type?"button":e.type;return(0,v.jsxs)("button",{className:ye("ToolIcon_type_button",a,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:t,onClick:d,ref:o,disabled:s||e.isLoading,children:[(e.icon||e.label)&&(0,v.jsxs)("div",{className:"ToolIcon__icon","aria-hidden":"true",children:[e.icon||e.label,e.keyBindingLabel&&(0,v.jsx)("span",{className:"ToolIcon__keybinding",children:e.keyBindingLabel}),e.isLoading&&(0,v.jsx)(qs,{})]}),e.showAriaLabel&&(0,v.jsxs)("div",{className:"ToolIcon__label",children:[e["aria-label"]," ",s&&(0,v.jsx)(qs,{})]}),e.children]})}return(0,v.jsxs)("label",{className:ye("ToolIcon",e.className),title:e.title,onPointerDown:e=>{u.current=e.pointerType||null},onPointerUp:()=>{requestAnimationFrame((()=>{u.current=null}))},children:[(0,v.jsx)("input",{className:"ToolIcon_type_radio ".concat(a),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:()=>{var t;null===(t=e.onChange)||void 0===t||t.call(e,{pointerType:u.current})},checked:e.checked,ref:o}),(0,v.jsxs)("div",{className:"ToolIcon__icon",children:[e.icon,e.keyBindingLabel&&(0,v.jsx)("span",{className:"ToolIcon__keybinding",children:e.keyBindingLabel})]})]})}));$s.defaultProps={visible:!0,className:"",size:"medium"};const Qs=e=>{const t=e.title||("dark"===e.value?b("buttons.lightMode"):b("buttons.darkMode"));return(0,v.jsx)($s,{type:"icon",icon:e.value===o.C6.LIGHT?Js.MOON:Js.SUN,title:t,"aria-label":t,onClick:()=>e.onChange(e.value===o.C6.DARK?o.C6.LIGHT:o.C6.DARK),"data-testid":"toggle-dark-mode"})},Js={SUN:(0,v.jsx)("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:(0,v.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,v.jsx)("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:(0,v.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"})})},el=e=>{let{scenePoint:t,viewportDimensions:n,zoom:r}=e;return{scrollX:n.width/2*(1/r.value)-t.x,scrollY:n.height/2*(1/r.value)-t.y}},tl=(e,t,n)=>{if(!(e=kl(e)).length)return{scrollX:0,scrollY:0};let[r,i,o,a]=et(e);((e,t,n)=>{const[r,i,o,a]=n,{x:s,y:l}=$t({sceneX:r,sceneY:i},e),{x:c,y:d}=$t({sceneX:o,sceneY:a},e);return c-s>e.width||d-l>e.height})(t,0,[r,i,o,a])&&([r,i,o,a]=((e,t)=>{if(!e.length)return[0,0,0,0];let n=1/0,r=e[0];return e.forEach((e=>{const[i,o,a,s]=Je(e),l=He((i+a)/2,(o+s)/2,t.x,t.y);l<n&&(n=l,r=e)})),Je(r)})(e,qt({clientX:t.scrollX,clientY:t.scrollY},t)));return el({scenePoint:{x:(r+o)/2,y:(i+a)/2},viewportDimensions:{width:t.width,height:t.height},zoom:t.zoom})},nl=e=>Math.max(.1,Math.min(e,30)),rl=(e,t)=>{let{viewportX:n,viewportY:r,nextZoom:i}=e;const o=n-t.offsetLeft,a=r-t.offsetTop,s=t.zoom.value;return{scrollX:t.scrollX+(o-o/s)+-(o-o/i),scrollY:t.scrollY+(a-a/s)+-(a-a/i),zoom:{value:i}}};n(6781);const il=()=>{const e=document.querySelector(".excalidraw-tooltip");if(e)return e;const t=document.createElement("div");return document.body.appendChild(t),t.classList.add("excalidraw-tooltip"),t},ol=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"bottom";const r=e.getBoundingClientRect(),i=window.innerWidth,o=window.innerHeight,a=5;let s,l=t.left+t.width/2-r.width/2;l<0?l=a:l+r.width>=i&&(l=i-r.width-a),"bottom"===n?(s=t.top+t.height+a,s+r.height>=o&&(s=t.top-r.height-a)):(s=t.top-r.height-a,s<0&&(s=t.top+t.height+a)),Object.assign(e.style,{top:"".concat(s,"px"),left:"".concat(l,"px")})},al=e=>{let{children:t,label:n,long:i=!1,style:o}=e;return(0,r.useEffect)((()=>()=>il().classList.remove("excalidraw-tooltip--visible")),[]),(0,v.jsx)("div",{className:"excalidraw-tooltip-wrapper",onPointerEnter:e=>((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;const i=e.getBoundingClientRect();ol(t,i)})(e.currentTarget,il(),n,i),onPointerLeave:()=>il().classList.remove("excalidraw-tooltip--visible"),style:o,children:t})};n(196),n(1106);const sl=i().forwardRef(((e,t)=>{let{children:n,padding:r,className:i,style:o}=e;return(0,v.jsx)("div",{className:ye("Island",i),style:Object.assign({"--padding":r},o),ref:t,children:n})}));n(8328);const ll=e=>{const{theme:t=o.C6.LIGHT,closeOnClickOutside:n=!0}=e,r=cl(t);if(!r)return null;return(0,st.createPortal)((0,v.jsxs)("div",{className:ye("Modal",e.className),role:"dialog","aria-modal":"true",onKeyDown:t=>{t.key===Lt.ESCAPE&&(t.nativeEvent.stopImmediatePropagation(),t.stopPropagation(),e.onCloseRequest())},"aria-labelledby":e.labelledBy,children:[(0,v.jsx)("div",{className:"Modal__background",onClick:n?e.onCloseRequest:void 0}),(0,v.jsx)("div",{className:"Modal__content",style:{"--max-width":"".concat(e.maxWidth,"px")},tabIndex:0,children:e.children})]}),r)},cl=e=>{const[t,n]=(0,r.useState)(null),i=cp(),o=(0,r.useRef)(i);o.current=i;const{container:a}=up();return(0,r.useLayoutEffect)((()=>{t&&t.classList.toggle("excalidraw--mobile",i)}),[t,i]),(0,r.useLayoutEffect)((()=>{const t=!(null==a||!a.classList.contains("theme--dark"))||"dark"===e,r=document.createElement("div");return r.classList.add("excalidraw","excalidraw-modal-container"),r.classList.toggle("excalidraw--mobile",o.current),t&&(r.classList.add("theme--dark"),r.classList.add("theme--dark-background-none")),document.body.appendChild(r),n(r),()=>{document.body.removeChild(r)}}),[a,e]),t},dl=e=>{const[t,n]=(()=>{const[e,t]=(0,r.useState)(null);return[e,(0,r.useCallback)((e=>t(e)),[])]})(),[i]=(0,r.useState)(document.activeElement),{id:o}=up();(0,r.useEffect)((()=>{if(!t)return;const n=a(t);n.length>0&&!1!==e.autofocus&&(n[1]||n[0]).focus();const r=e=>{if(e.key===Lt.TAB){const n=a(t),{activeElement:r}=document,i=n.findIndex((e=>e===r));0===i&&e.shiftKey?(n[n.length-1].focus(),e.preventDefault()):i!==n.length-1||e.shiftKey||(n[0].focus(),e.preventDefault())}};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)}),[t,e.autofocus]);const a=e=>{const t=e.querySelectorAll("button, a, input, select, textarea, div[tabindex]");return t?Array.from(t):[]},s=()=>{i.focus(),e.onCloseRequest()};return(0,v.jsx)(ll,{className:ye("Dialog",e.className),labelledBy:"dialog-title",maxWidth:e.small?550:800,onCloseRequest:s,theme:e.theme,closeOnClickOutside:e.closeOnClickOutside,children:(0,v.jsxs)(sl,{ref:n,children:[(0,v.jsxs)("h2",{id:"".concat(o,"-dialog-title"),className:"Dialog__title",children:[(0,v.jsx)("span",{className:"Dialog__titleContent",children:e.title}),(0,v.jsx)("button",{className:"Modal__close",onClick:s,"aria-label":b("buttons.close"),children:cp()?Xa:Ya})]}),(0,v.jsx)("div",{className:"Dialog__content",children:e.children})]})})};n(4678);var ul=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const hl=e=>{const{onConfirm:t,onCancel:n,children:r,confirmText:i=b("buttons.confirm"),cancelText:o=b("buttons.cancel"),className:a=""}=e,s=ul(e,["onConfirm","onCancel","children","confirmText","cancelText","className"]);return(0,v.jsxs)(dl,Object.assign(Object.assign({onCloseRequest:n,small:!0},s),{className:"confirm-dialog ".concat(a),children:[r,(0,v.jsxs)("div",{className:"confirm-dialog-buttons",children:[(0,v.jsx)($s,{type:"button",title:o,"aria-label":o,label:o,onClick:n,className:"confirm-dialog--cancel"}),(0,v.jsx)($s,{type:"button",title:i,"aria-label":i,label:i,onClick:t,className:"confirm-dialog--confirm"})]})]}))},pl=e=>{let{onConfirm:t}=e;const[n,i]=(0,r.useState)(!1),o=()=>{i(!n)};return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)($s,{type:"button",icon:_a,title:b("buttons.clearReset"),"aria-label":b("buttons.clearReset"),showAriaLabel:cp(),onClick:o,"data-testid":"clear-canvas-button"}),n&&(0,v.jsx)(hl,{onConfirm:()=>{t(),o()},onCancel:o,title:b("clearCanvasDialog.title"),children:(0,v.jsxs)("p",{className:"clear-canvas__content",children:[" ",b("alerts.clearReset")]})})]})},gl=(Us({name:"changeViewBackgroundColor",perform:(e,t,n)=>({appState:Object.assign(Object.assign({},t),n),commitToHistory:!!n.viewBackgroundColor}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)("div",{style:{position:"relative"},children:(0,v.jsx)(ua,{label:b("labels.canvasBackground"),type:"canvasBackground",color:n.viewBackgroundColor,onChange:e=>r({viewBackgroundColor:e}),isActive:"canvasColorPicker"===n.openPopup,setActive:e=>r({openPopup:e?"canvasColorPicker":null}),"data-testid":"canvas-background-picker",elements:t,appState:n})})}}),Us({name:"clearCanvas",perform:(e,t,n,r)=>(r.imageCache.clear(),{elements:e.map((e=>Ar(e,{isDeleted:!0}))),appState:Object.assign(Object.assign({},hn()),{files:{},theme:t.theme,elementLocked:t.elementLocked,penMode:t.penMode,penDetected:t.penDetected,exportBackground:t.exportBackground,exportEmbedScene:t.exportEmbedScene,gridSize:t.gridSize,showStats:t.showStats,pasteDialog:t.pasteDialog,elementType:"image"===t.elementType?"selection":t.elementType}),commitToHistory:!0}),PanelComponent:e=>{let{updateData:t}=e;return(0,v.jsx)(pl,{onConfirm:t})}}),Us({name:"zoomIn",perform:(e,t,n,r)=>({appState:Object.assign(Object.assign({},t),rl({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:nl(t.zoom.value+o.V4)},t)),commitToHistory:!1}),PanelComponent:e=>{let{updateData:t}=e;return(0,v.jsx)($s,{type:"button",icon:ja,title:"".concat(b("buttons.zoomIn")," — ").concat(Zt("CtrlOrCmd++")),"aria-label":b("buttons.zoomIn"),onClick:()=>{t(null)},size:"small"})},keyTest:e=>(e.code===ut||e.code===pt)&&(e[Lt.CTRL_OR_CMD]||e.shiftKey)})),ml=Us({name:"zoomOut",perform:(e,t,n,r)=>({appState:Object.assign(Object.assign({},t),rl({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:nl(t.zoom.value-o.V4)},t)),commitToHistory:!1}),PanelComponent:e=>{let{updateData:t}=e;return(0,v.jsx)($s,{type:"button",icon:Ia,title:"".concat(b("buttons.zoomOut")," — ").concat(Zt("CtrlOrCmd+-")),"aria-label":b("buttons.zoomOut"),onClick:()=>{t(null)},size:"small"})},keyTest:e=>(e.code===ht||e.code===gt)&&(e[Lt.CTRL_OR_CMD]||e.shiftKey)}),fl=(Us({name:"resetZoom",perform:(e,t,n,r)=>({appState:Object.assign(Object.assign({},t),rl({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:nl(1)},t)),commitToHistory:!1}),PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,v.jsx)(al,{label:b("buttons.resetZoom"),style:{height:"100%"},children:(0,v.jsxs)($s,{type:"button",className:"reset-zoom-button",title:b("buttons.resetZoom"),"aria-label":b("buttons.resetZoom"),onClick:()=>{t(null)},size:"small",children:[(100*n.zoom.value).toFixed(0),"%"]})})},keyTest:e=>(e.code===wt||e.code===mt)&&(e[Lt.CTRL_OR_CMD]||e.shiftKey)}),(e,t)=>{const[n,r,i,a]=e,s=i-n,l=t.width/s,c=a-r,d=t.height/c,u=Math.min(l,d),h=Math.floor(u/o.V4)*o.V4;return Math.min(Math.max(h,o.V4),1)}),bl=(e,t,n)=>{const r=_l(e),i=Ol(r,t),o=n&&i.length>0?et(i):et(r),a={value:fl(o,{width:t.width,height:t.height})},[s,l,c,d]=o,u=(s+c)/2,h=(l+d)/2;return{appState:Object.assign(Object.assign(Object.assign({},t),el({scenePoint:{x:u,y:h},viewportDimensions:{width:t.width,height:t.height},zoom:a})),{zoom:a}),commitToHistory:!1}},vl=(Us({name:"zoomToSelection",perform:(e,t)=>bl(e,t,!0),keyTest:e=>e.code===xt&&e.shiftKey&&!e.altKey&&!e[Lt.CTRL_OR_CMD]}),Us({name:"zoomToFit",perform:(e,t)=>bl(e,t,!1),keyTest:e=>e.code===vt&&e.shiftKey&&!e.altKey&&!e[Lt.CTRL_OR_CMD]}),Us({name:"toggleTheme",perform:(e,t,n)=>({appState:Object.assign(Object.assign({},t),{theme:n||(t.theme===o.C6.LIGHT?o.C6.DARK:o.C6.LIGHT)}),commitToHistory:!1}),PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,v.jsx)("div",{style:{marginInlineStart:"0.25rem"},children:(0,v.jsx)(Qs,{value:t.theme,onChange:e=>{n(e)}})})},keyTest:e=>e.altKey&&e.shiftKey&&e.code===Ct}),(e,t,n,r,i,o)=>{const{zoom:a}=r,s=180*n/Math.PI;let l=e*(a.value-1)/2,c=t*(a.value-1)/2;return e>i&&1!==a.value&&(l=i*(a.value-1)/2),t>o&&1!==a.value&&(c=o*(a.value-1)/2),"translate(".concat(l,"px, ").concat(c,"px) scale(").concat(a.value,") rotate(").concat(s,"deg)")}),xl=e=>{let{id:t,onChange:n,onSubmit:r,getViewportCoords:i,element:a,canvas:s,excalidrawContainer:l,app:c}=e;let d;const u=()=>{var e;const n=c.state,r=null===(e=Rn.getScene(a))||void 0===e?void 0:e.getElement(t),{textAlign:s,verticalAlign:l}=r,u=Kn(Ut(r));if(r&&Ce(r)){let e=r.x,t=r.y;const a=er(r);let c=r.width,p=r.height,g=r.width,m=r.height;if(a&&r.containerId){const n=((e,t)=>{const n=t.style.fontFamily.replace(/"/g,"");return Ft({fontFamily:e.fontFamily})!==n||"".concat(e.fontSize,"px")!==t.style.fontSize})(r,h),i=Number(h.style.height.slice(0,-2));if(i>0&&(m=i),n&&(d=a.height,m=r.height),d||(d=a.height),c=a.width-2*o.gK,p=a.height-2*o.gK,g=c,e=a.x+o.gK,m>p){const e=Math.min(m-p,u);return void Lr(a,{height:a.height+e})}if(a.height>d&&m<p){const e=Math.min(p-m,u);Lr(a,{height:a.height-e})}else l===o.oX.MIDDLE&&(t=a.y+a.height/2-m/2),l===o.oX.BOTTOM&&(t=a.y+a.height-m-o.gK)}const[f,b]=i(e,t),v=h.selectionStart,x=h.selectionEnd,y=h.value.length;if(h.value=r.originalText,v===x&&x!==y){const e=y-x;h.selectionStart=h.value.length-e,h.selectionEnd=h.value.length-e}const w=r.originalText.split("\n"),k=r.containerId?u:r.height/w.length;a||(c=(n.width-8-f)/n.zoom.value);const _=(n.height-b)/n.zoom.value,C=a?a.angle:r.angle;Object.assign(h.style,{font:Ut(r),lineHeight:"".concat(k,"px"),width:"".concat(g,"px"),height:"".concat(m,"px"),left:"".concat(f,"px"),top:"".concat(b,"px"),transform:vl(g,m,C,n,c,_),textAlign:s,verticalAlign:l,color:r.strokeColor,opacity:r.opacity/100,filter:"var(--theme-filter)",maxWidth:"".concat(c,"px"),maxHeight:"".concat(_,"px")}),cn()&&(h.style.fontFamily=Ft(r)),Lr(r,{x:e,y:t})}},h=document.createElement("textarea");h.dir="auto",h.tabIndex=0,h.dataset.type="wysiwyg",h.wrap="off",h.classList.add("excalidraw-wysiwyg");let p="pre",g="normal";Pe(a)&&(p="pre-wrap",g="break-word"),Object.assign(h.style,{position:"absolute",display:"inline-block",minHeight:"1em",backfaceVisibility:"hidden",margin:0,padding:0,border:0,outline:0,resize:"none",background:"transparent",overflow:"hidden",zIndex:"var(--zIndex-wysiwyg)",wordBreak:g,whiteSpace:p,overflowWrap:"break-word"}),u(),n&&(h.oninput=()=>{var e;const r=null===(e=Rn.getScene(a))||void 0===e?void 0:e.getElement(t),i=Ut(r),o=h.scrollHeight/Kn(i);if(Pe(a)&&o>1){let e="auto";if(2===o){const t=er(a);1===Yn(h.value,i,t.width).split("\n").length&&(e="".concat(h.scrollHeight/2,"px"))}h.style.height=e,h.style.height="".concat(h.scrollHeight,"px")}n(h.value.replace(/\t/g," ").replace(/\r?\n|\r/g,"\n"))}),h.onkeydown=e=>{if(e.stopPropagation(),!e.shiftKey&&gl.keyTest(e))e.preventDefault(),c.actionManager.executeAction(gl),u();else if(!e.shiftKey&&ml.keyTest(e))e.preventDefault(),c.actionManager.executeAction(ml),u();else if(Gs.keyTest(e))c.actionManager.executeAction(Gs);else if(Ys.keyTest(e))c.actionManager.executeAction(Ys);else if(e.key===Lt.ESCAPE)e.preventDefault(),w=!0,k();else if(e.key===Lt.ENTER&&e[Lt.CTRL_OR_CMD]){if(e.preventDefault(),e.isComposing||229===e.keyCode)return;w=!0,k()}else(e.key===Lt.TAB||e[Lt.CTRL_OR_CMD]&&(e.code===bt||e.code===ft))&&(e.preventDefault(),e.shiftKey||e.code===bt?v():b(),h.dispatchEvent(new Event("input")))};const m=" ".repeat(4),f=new RegExp("^ {1,".concat(4,"}")),b=()=>{const{selectionStart:e,selectionEnd:t}=h,n=x();let r=h.value;n.forEach((e=>{const t=r.slice(0,e),n=r.slice(e);r="".concat(t).concat(m).concat(n)})),h.value=r,h.selectionStart=e+4,h.selectionEnd=t+4*n.length},v=()=>{const{selectionStart:e,selectionEnd:t}=h,n=x(),r=[];let i=h.value;n.forEach((e=>{const t=i.slice(e,e+4).match(f);if(t){const n=i.slice(0,e),o=i.slice(e+t[0].length);i="".concat(n).concat(o),r.push(e)}})),h.value=i,r.length&&(e>r[r.length-1]?h.selectionStart=Math.max(e-4,r[r.length-1]):h.selectionStart=e,h.selectionEnd=Math.max(h.selectionStart,t-4*r.length))},x=()=>{let{selectionStart:e,selectionEnd:t,value:n}=h;const r=n.slice(0,e).match(/[^\n]*$/)[0].length;e-=r;return n.slice(e,t).split("\n").reduce(((t,n,r,i)=>t.concat(r?t[r-1]+i[r-1].length+1:e)),[]).reverse()},y=e=>{e.preventDefault(),e.stopPropagation()};let w=!1;const k=()=>{var e;_();const t=null===(e=Rn.getScene(a))||void 0===e?void 0:e.getElement(a.id);if(!t)return;let n=h.value;const i=er(t);if(i)if(n=t.text,h.value){const e=Qn(i);e&&e===a.id||Lr(i,{boundElements:(i.boundElements||[]).concat({type:"text",id:a.id})})}else{var o;Lr(i,{boundElements:null===(o=i.boundElements)||void 0===o?void 0:o.filter((e=>!Ce(e)))})}r({text:n,viaKeyboard:w,originalText:h.value})},_=()=>{j||(j=!0,h.onblur=null,h.oninput=null,h.onkeydown=null,I&&I.disconnect(),window.removeEventListener("resize",u),window.removeEventListener("wheel",y,!0),window.removeEventListener("pointerdown",E),window.removeEventListener("pointerup",C),window.removeEventListener("blur",k),S(),h.remove())},C=e=>{window.removeEventListener("pointerup",C);const t=null==e?void 0:e.target,n=t instanceof HTMLInputElement&&t.closest(".color-picker-input")&&Bt(t);setTimeout((()=>{h.onblur=k,t&&n&&(t.onblur=()=>{h.focus()}),n||h.focus()}))},E=e=>{const t=e.target instanceof HTMLInputElement&&e.target.closest(".color-picker-input")&&Bt(e.target);((e.target instanceof HTMLElement||e.target instanceof SVGElement)&&e.target.closest(".".concat(o.$C.SHAPE_ACTIONS_MENU))&&!Bt(e.target)||t)&&(h.onblur=null,window.addEventListener("pointerup",C),window.addEventListener("blur",k))},S=Rn.getScene(a).addCallback((()=>{var e;u();!(null===(e=document.activeElement)||void 0===e||!e.closest(".color-picker-input"))||h.focus()}));let j=!1;h.select(),C();let I=null;s&&"ResizeObserver"in window?(I=new window.ResizeObserver((()=>{u()})),I.observe(s)):window.addEventListener("resize",u),window.addEventListener("pointerdown",E),window.addEventListener("wheel",y,{passive:!1,capture:!0}),null==l||l.querySelector(".excalidraw-textEditorContainer").appendChild(h)},yl=(e,t)=>Boolean(!e.viewModeEnabled&&(e.editingElement||Ol(t,e).length||"selection"!==e.elementType)),wl=e=>e.reduce(((e,t)=>e+t.version),0),kl=e=>e.filter((e=>!e.isDeleted&&!Dr(e))),_l=e=>e.filter((e=>!e.isDeleted)),Cl=e=>!e.isDeleted,El=e=>_l(e).map((e=>Ie(e.type)?Object.assign(Object.assign({},e),{lastCommittedPoint:null}):e)),Sl=e=>El(e),jl=e=>El(e),Il=(e,t,n)=>{const[r,i]=[e.horizontal,e.vertical].map((e=>null!=e&&e.x<=t&&t<=e.x+e.width&&e.y<=n&&n<=e.y+e.height));return{isOverEither:r||i,isOverHorizontal:r,isOverVertical:i}},Tl=(e,t)=>e.some((e=>t.selectedElementIds[e.id])),Ml=(e,t,n)=>{const r=Array.from(new Set(Ol(e,t).map((e=>n(e)))));return 1===r.length?r[0]:null},Ol=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return e.filter((e=>t.selectedElementIds[e.id]||n&&Pe(e)&&t.selectedElementIds[null==e?void 0:e.containerId]?e:null))},Ll=(e,t)=>t.editingElement?[t.editingElement]:Ol(e,t,!0),Al=(e,t)=>{if(e.editingGroupId){const n=Kr(_l(t),e.editingGroupId);if(n.length)return Object.assign(Object.assign({},e),{selectedElementIds:{[n[0].id]:!0}})}return e},Pl=Us({name:"deleteSelectedElements",perform:(e,t)=>{if(t.editingLinearElement){const{elementId:n,selectedPointsIndices:r,startBindingElement:i,endBindingElement:o}=t.editingLinearElement,a=vo.getElement(n);if(!a)return!1;if(null==r||a.points.length<2){const n=e.filter((e=>e.id!==a.id)),r=Al(t,n);return{elements:n,appState:Object.assign(Object.assign({},r),{editingLinearElement:null}),commitToHistory:!1}}const s={startBindingElement:null!=r&&r.includes(0)?null:i,endBindingElement:null!=r&&r.includes(a.points.length-1)?null:o};return vo.deletePoints(a,r),{elements:e,appState:Object.assign(Object.assign({},t),{editingLinearElement:Object.assign(Object.assign(Object.assign({},t.editingLinearElement),s),{selectedPointsIndices:(null==r?void 0:r[0])>0?[r[0]-1]:[0]})}),commitToHistory:!0}}let{elements:n,appState:r}=((e,t)=>({elements:e.map((e=>t.selectedElementIds[e.id]||Pe(e)&&t.selectedElementIds[e.containerId]?Ar(e,{isDeleted:!0}):e)),appState:Object.assign(Object.assign({},t),{selectedElementIds:{}})}))(e,t);return Vo(n,e.filter((e=>{let{id:n}=e;return t.selectedElementIds[n]}))),r=Al(r,n),{elements:n,appState:Object.assign(Object.assign({},r),{elementType:"selection",multiElement:null}),commitToHistory:Tl(_l(e),t)}},contextItemLabel:"labels.delete",keyTest:e=>e.key===Lt.BACKSPACE||e.key===Lt.DELETE,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)($s,{type:"button",icon:_a,title:b("labels.delete"),"aria-label":b("labels.delete"),onClick:()=>r(null),visible:Tl(_l(t),n)})}}),Dl=(e,t)=>{let n=[],r=[],i=null,o=-1;const a=ln(Ol(e,t,!0));for(;++o<e.length;)a.get(e[o].id)?(r.length&&(n=n.concat(r),r=[]),n.push(o),i=o+1):e[o].isDeleted&&i===o?(i=o+1,r.push(o)):r=[];return n},zl=(e,t,n)=>{if("containerId"in e&&e.containerId){if("left"!==n)return t.indexOf(e);{const n=Rn.getScene(e).getElement(e.containerId);if(n)return t.indexOf(n)}}else{var r,i;const o=null===(r=e.boundElements)||void 0===r||null===(i=r.find((e=>"arrow"!==e.type)))||void 0===i?void 0:i.id;if(o){if("left"===n)return t.indexOf(e);const r=Rn.getScene(e).getElement(o);if(r)return t.indexOf(r)}}},Rl=(e,t,n,r)=>{const i=t[n],o=t=>!t.isDeleted&&(!e.editingGroupId||t.groupIds.includes(e.editingGroupId)),a="left"===r?function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length-1;n<0&&(n=e.length+n),n=Math.min(e.length-1,Math.max(n,0));let r=n+1;for(;--r>-1;)if(t(e[r],r,e))return r;return-1}(t,o,Math.max(0,n-1)):function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;n<0&&(n=e.length+n),n=Math.min(e.length,Math.max(n,0));let r=n-1;for(;++r<e.length;)if(t(e[r],r,e))return r;return-1}(t,o,n+1),s=t[a];if(!s)return-1;if(e.editingGroupId){var l;if((null==i?void 0:i.groupIds.join(""))===(null==s?void 0:s.groupIds.join("")))return null!==(l=zl(s,t,r))&&void 0!==l?l:a;if(null==s||!s.groupIds.includes(e.editingGroupId))return-1}var c;if(!s.groupIds.length)return null!==(c=zl(s,t,r))&&void 0!==c?c:a;const d=e.editingGroupId?s.groupIds[s.groupIds.indexOf(e.editingGroupId)-1]:s.groupIds[s.groupIds.length-1],u=Kr(t,d);return u.length?"left"===r?t.indexOf(u[0]):t.indexOf(u[u.length-1]):a},Hl=(e,t)=>t.reduce(((t,n)=>{const r=e[n];return t[r.id]=r,t}),{}),Nl=(e,t,n)=>{const r=Dl(t,e),i=Hl(t,r);let o=(e=>{let t=0;return e.reduce(((n,r,i)=>(i>0&&e[i-1]!==r-1&&(t=++t),(n[t]||(n[t]=[])).push(r),n)),[])})(r);return"right"===n&&(o=o.reverse()),o.forEach(((r,i)=>{const o=r[0],a=r[r.length-1],s="left"===n?o:a,l=Rl(e,t,s,n);if(-1===l||s===l)return;const c="left"===n?t.slice(0,l):t.slice(0,o),d=t.slice(o,a+1),u="left"===n?t.slice(l,o):t.slice(a+1,l+1),h="left"===n?t.slice(a+1):t.slice(l+1);t="left"===n?[...c,...d,...u,...h]:[...c,...u,...d,...h]})),t.map((e=>i[e.id]?Pr(e):e))},Bl=(e,t,n)=>{const r=Dl(e,t),i=Hl(e,r),o=[];let a,s;if("left"===n){if(t.editingGroupId){const n=Kr(e,t.editingGroupId);if(!n.length)return e;a=e.indexOf(n[0])}else a=0;s=r[r.length-1]}else{if(t.editingGroupId){const n=Kr(e,t.editingGroupId);if(!n.length)return e;s=e.indexOf(n[n.length-1])}else s=e.length-1;a=r[0]}for(let t=a;t<s+1;t++)r.includes(t)||o.push(e[t]);const l=Object.values(i).map((e=>Pr(e))),c=e.slice(0,a),d=e.slice(s+1);return"left"===n?[...c,...l,...o,...d]:[...c,...o,...l,...d]},Fl=(e,t)=>Nl(t,e,"left"),Ul=(e,t)=>Nl(t,e,"right"),Wl=(e,t)=>Bl(e,t,"left"),Kl=(e,t)=>Bl(e,t,"right"),Vl=Us({name:"sendBackward",perform:(e,t)=>({elements:Fl(e,t),appState:t,commitToHistory:!0}),contextItemLabel:"labels.sendBackward",keyPriority:40,keyTest:e=>e[Lt.CTRL_OR_CMD]&&!e.shiftKey&&e.code===bt,PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,v.jsx)("button",{type:"button",className:"zIndexButton",onClick:()=>t(null),title:"".concat(b("labels.sendBackward")," — ").concat(Zt("CtrlOrCmd+[")),children:(0,v.jsx)(Da,{theme:n.theme})})}}),Gl=Us({name:"bringForward",perform:(e,t)=>({elements:Ul(e,t),appState:t,commitToHistory:!0}),contextItemLabel:"labels.bringForward",keyPriority:40,keyTest:e=>e[Lt.CTRL_OR_CMD]&&!e.shiftKey&&e.code===ft,PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,v.jsx)("button",{type:"button",className:"zIndexButton",onClick:()=>t(null),title:"".concat(b("labels.bringForward")," — ").concat(Zt("CtrlOrCmd+]")),children:(0,v.jsx)(Pa,{theme:n.theme})})}}),Yl=Us({name:"sendToBack",perform:(e,t)=>({elements:Wl(e,t),appState:t,commitToHistory:!0}),contextItemLabel:"labels.sendToBack",keyTest:e=>lt?e[Lt.CTRL_OR_CMD]&&e.altKey&&e.code===bt:e[Lt.CTRL_OR_CMD]&&e.shiftKey&&e.code===bt,PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,v.jsx)("button",{type:"button",className:"zIndexButton",onClick:()=>t(null),title:"".concat(b("labels.sendToBack")," — ").concat(Zt(lt?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")),children:(0,v.jsx)(Ra,{theme:n.theme})})}}),Xl=Us({name:"bringToFront",perform:(e,t)=>({elements:Kl(e,t),appState:t,commitToHistory:!0}),contextItemLabel:"labels.bringToFront",keyTest:e=>lt?e[Lt.CTRL_OR_CMD]&&e.altKey&&e.code===ft:e[Lt.CTRL_OR_CMD]&&e.shiftKey&&e.code===ft,PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,v.jsx)("button",{type:"button",className:"zIndexButton",onClick:e=>t(null),title:"".concat(b("labels.bringToFront")," — ").concat(Zt(lt?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")),children:(0,v.jsx)(za,{theme:n.theme})})}}),Zl=Us({name:"selectAll",perform:(e,t)=>!t.editingLinearElement&&{appState:Ur(Object.assign(Object.assign({},t),{editingGroupId:null,selectedElementIds:e.reduce(((e,t)=>(t.isDeleted||Ce(t)&&t.containerId||(e[t.id]=!0),e)),{})}),_l(e)),commitToHistory:!0},contextItemLabel:"labels.selectAll",keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.key===Lt.A}),ql=Us({name:"duplicateSelection",perform:(e,t)=>{if(t.editingLinearElement){const n=vo.duplicateSelectedPoints(t);return!!n&&{elements:e,appState:n.appState,commitToHistory:!0}}return Object.assign(Object.assign({},$l(e,t)),{commitToHistory:!0})},contextItemLabel:"labels.duplicateSelection",keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.key===Lt.D,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)($s,{type:"button",icon:Za,title:"".concat(b("labels.duplicateSelection")," — ").concat(Zt("CtrlOrCmd+D")),"aria-label":b("labels.duplicateSelection"),onClick:()=>r(null),visible:Tl(_l(t),n)})}}),$l=(e,t)=>{const n=new Map,r=[],i=[],a=new Map,s=e=>{const s=ti(t.editingGroupId,n,e,{x:e.x+o.k/2,y:e.y+o.k/2});return a.set(e.id,s.id),i.push(e),r.push(s),s},l=[];let c=0;const d=ln(Ol(e,t,!0));for(;c<e.length;){const n=e[c];if(d.get(n.id)){if(n.groupIds.length){const r=Br(t,n);if(r){const t=Kr(e,r);l.push(...t,...t.map((e=>s(e)))),c+=t.length;continue}}l.push(n,s(n))}else l.push(n);c++}return Nn(l,i,a),Wo(l,i,a),{elements:l,appState:Ur(Object.assign(Object.assign({},t),{selectedGroupIds:{},selectedElementIds:r.reduce(((e,t)=>(Pe(t)||(e[t.id]=!0),e)),{})}),_l(l))}},Ql=Us({name:"finalize",perform:(e,t,n,r)=>{var i;let{canvas:o,focusContainer:a}=r;if(t.editingLinearElement){const{elementId:n,startBindingElement:r,endBindingElement:i}=t.editingLinearElement,o=vo.getElement(n);if(o)return Te(o)&&wo(o,r,i),{elements:o.points.length<2||Dr(o)?e.filter((e=>e.id!==o.id)):void 0,appState:Object.assign(Object.assign({},t),{editingLinearElement:null}),commitToHistory:!0}}let s=e;t.pendingImageElement&&Lr(t.pendingImageElement,{isDeleted:!0},!1),window.document.activeElement instanceof HTMLElement&&a();const l=t.multiElement?t.multiElement:"freedraw"===(null===(i=t.editingElement)||void 0===i?void 0:i.type)?t.editingElement:null;if(l){if("freedraw"!==l.type&&"touch"!==t.lastPointerDownWith){const{points:e,lastCommittedPoint:t}=l;t&&e[e.length-1]===t||Lr(l,{points:l.points.slice(0,-1)})}Dr(l)&&(s=s.slice(0,-1));const e=Ne(l.points,t.zoom.value);if(("line"===l.type||"freedraw"===l.type)&&e){const e=l.points,t=e[0];Lr(l,{points:e.map(((n,r)=>r===e.length-1?[t[0],t[1]]:n))})}if(Te(l)&&!e&&l.points.length>1){const[e,n]=vo.getPointAtIndexGlobalCoordinates(l,-1);Eo(l,t,Rn.getScene(l),{x:e,y:n})}t.elementLocked||"freedraw"===t.elementType||(t.selectedElementIds[l.id]=!0)}return(t.elementLocked||"freedraw"===t.elementType)&&l||Vt(o),{elements:s,appState:Object.assign(Object.assign({},t),{elementType:(t.elementLocked||"freedraw"===t.elementType)&&l?t.elementType:"selection",draggingElement:null,multiElement:null,editingElement:null,startBoundElement:null,suggestedBindings:[],selectedElementIds:l&&!t.elementLocked&&"freedraw"!==t.elementType?Object.assign(Object.assign({},t.selectedElementIds),{[l.id]:!0}):t.selectedElementIds,pendingImageElement:null}),commitToHistory:"freedraw"===t.elementType}},keyTest:(e,t)=>e.key===Lt.ESCAPE&&(null!==t.editingLinearElement||!t.draggingElement&&null===t.multiElement)||(e.key===Lt.ESCAPE||e.key===Lt.ENTER)&&null!==t.multiElement,PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,v.jsx)($s,{type:"button",icon:Ta,title:b("buttons.done"),"aria-label":b("buttons.done"),onClick:n,visible:null!=t.multiElement})}});var Jl,ec;const tc="undefined"!=typeof process&&null!==(Jl={REACT_APP_BACKEND_V2_GET_URL:"https://json.excalidraw.com/api/v2/",REACT_APP_BACKEND_V2_POST_URL:"https://json.excalidraw.com/api/v2/post/",REACT_APP_LIBRARY_URL:"https://libraries.excalidraw.com",REACT_APP_LIBRARY_BACKEND:"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries",REACT_APP_SOCKET_SERVER_URL:"https://oss-collab-us1.excalidraw.com",REACT_APP_FIREBASE_CONFIG:'{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}',REACT_APP_GOOGLE_ANALYTICS_ID:"UA-387204-13"})&&void 0!==Jl&&Jl.REACT_APP_GOOGLE_ANALYTICS_ID&&"undefined"!=typeof window&&window.gtag?(e,t,n,r)=>{window.gtag("event",t,{event_category:e,event_label:n,value:r})}:("undefined"!=typeof process&&null!==(ec={REACT_APP_BACKEND_V2_GET_URL:"https://json.excalidraw.com/api/v2/",REACT_APP_BACKEND_V2_POST_URL:"https://json.excalidraw.com/api/v2/post/",REACT_APP_LIBRARY_URL:"https://libraries.excalidraw.com",REACT_APP_LIBRARY_BACKEND:"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries",REACT_APP_SOCKET_SERVER_URL:"https://oss-collab-us1.excalidraw.com",REACT_APP_FIREBASE_CONFIG:'{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}',REACT_APP_GOOGLE_ANALYTICS_ID:"UA-387204-13"})&&void 0!==ec&&ec.JEST_WORKER_ID,(e,t,n,r)=>{});n(518),n(9966);const nc=e=>{const{id:t}=up(),[n,i]=(0,r.useState)(e.value);return(0,v.jsxs)("div",{className:"ProjectName",children:[(0,v.jsx)("label",{className:"ProjectName-label",htmlFor:"filename",children:"".concat(e.label).concat(e.isNameEditable?"":":")}),e.isNameEditable?(0,v.jsx)("input",{type:"text",className:"TextInput",onBlur:t=>{(e=>{let t=e.parentElement;for(;t;){if(t.tabIndex>-1)return void t.focus();t=t.parentElement}})(t.target);const n=t.target.value;n!==e.value&&e.onChange(n)},onKeyDown:e=>{if("Enter"===e.key){if(e.preventDefault(),e.nativeEvent.isComposing||229===e.keyCode)return;e.currentTarget.blur()}},id:"".concat(t,"-filename"),value:n,onChange:e=>i(e.target.value)}):(0,v.jsx)("span",{className:"TextInput TextInput--readonly",id:"".concat(t,"-filename"),children:e.value})]})},rc=(e,t)=>{if(null!=t&&t.collaborators){const n=t.collaborators.get(e);if(null!=n&&n.color)return n.color}const n=e.split("").reduce(((e,t)=>e+t.charCodeAt(0)),0),r=at.elementBackground.slice(1),i=at.elementStroke.slice(1);return{background:r[n%r.length],stroke:i[n%i.length]}};let ic;!function(e){e.ACTIVE="active",e.AWAY="away",e.IDLE="idle"}(ic||(ic={}));n(4404);const oc=document.createElement("img");oc.src="data:".concat(o.LO.svg,", ").concat(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#1971c2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-external-link"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg>'));let ac=!1;const sc=e=>{let{element:t,appState:n,setAppState:i,onLinkOpen:a}=e;const s=t.link||"",[l,c]=(0,r.useState)(s),d=(0,r.useRef)(null),u="editor"===n.showHyperlinkPopup||!s,h=(0,r.useCallback)((()=>{if(!d.current)return;const e=cc(d.current.value);!t.link&&e&&tc("hyperlink","create"),Lr(t,{link:e}),i({showHyperlinkPopup:"info"})}),[t,i]);(0,r.useLayoutEffect)((()=>()=>{h()}),[h]),(0,r.useEffect)((()=>{let e=null;const r=r=>{if(u)return;e&&clearTimeout(e);bc(t,n,[r.clientX,r.clientY])&&(e=window.setTimeout((()=>{i({showHyperlinkPopup:!1})}),500))};return window.addEventListener(o.Ks.POINTER_MOVE,r,!1),()=>{window.removeEventListener(o.Ks.POINTER_MOVE,r,!1),e&&clearTimeout(e)}}),[n,t,u,i]);const p=(0,r.useCallback)((()=>{tc("hyperlink","delete"),Lr(t,{link:null}),u&&(d.current.value=""),i({showHyperlinkPopup:!1})}),[i,t,u]),{x:g,y:m}=lc(t,n);return n.draggingElement||n.resizingElement||n.isRotating||n.openMenu?null:(0,v.jsxs)("div",{className:"excalidraw-hyperlinkContainer",style:{top:"".concat(m,"px"),left:"".concat(g,"px"),width:320,padding:5},children:[u?(0,v.jsx)("input",{className:ye("excalidraw-hyperlinkContainer-input"),placeholder:"Type or paste your link here",ref:d,value:l,onChange:e=>c(e.target.value),autoFocus:!0,onKeyDown:e=>{e.stopPropagation(),e[Lt.CTRL_OR_CMD]&&e.key===Lt.K&&e.preventDefault(),e.key!==Lt.ENTER&&e.key!==Lt.ESCAPE||h()}}):(0,v.jsx)("a",{href:t.link||"",className:ye("excalidraw-hyperlinkContainer-link",{"d-none":u}),target:dc(t.link)?"_self":"_blank",onClick:e=>{if(t.link&&a){const n=dn(o.Ks.EXCALIDRAW_LINK,e.nativeEvent);a(t,n),n.defaultPrevented&&e.preventDefault()}},rel:"noopener noreferrer",children:t.link}),(0,v.jsxs)("div",{className:"excalidraw-hyperlinkContainer__buttons",children:[!u&&(0,v.jsx)($s,{type:"button",title:b("buttons.edit"),"aria-label":b("buttons.edit"),label:b("buttons.edit"),onClick:()=>{tc("hyperlink","edit","popup-ui"),i({showHyperlinkPopup:"editor"})},className:"excalidraw-hyperlinkContainer--edit",icon:Ms}),s&&(0,v.jsx)($s,{type:"button",title:b("buttons.remove"),"aria-label":b("buttons.remove"),label:b("buttons.remove"),onClick:p,className:"excalidraw-hyperlinkContainer--remove",icon:_a})]})]})},lc=(e,t)=>{const[n,r]=Ye(e),{x:i,y:o}=$t({sceneX:n+e.width/2,sceneY:r},t);return{x:i-t.offsetLeft-160,y:o-t.offsetTop-85}},cc=e=>((e=e.trim())&&(e.includes("://")||/^[[\\/]/.test(e)||(e="https://".concat(e))),e),dc=e=>!!(null!=e&&e.includes(location.origin)||null!=e&&e.startsWith("/")),uc=Us({name:"hyperlink",perform:(e,t)=>"editor"!==t.showHyperlinkPopup&&{elements:e,appState:Object.assign(Object.assign({},t),{showHyperlinkPopup:"editor",openMenu:null}),commitToHistory:!0},trackEvent:(e,t)=>{tc("hyperlink","edit",t)},keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.key===Lt.K,contextItemLabel:(e,t)=>hc(e,t),contextItemPredicate:(e,t)=>1===Ol(e,t).length,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;const i=Ol(t,n);return(0,v.jsx)($s,{type:"button",icon:va,"aria-label":b(hc(t,n)),title:"".concat(b("labels.link.label")," - ").concat(Zt("CtrlOrCmd+K")),onClick:()=>r(null),selected:1===i.length&&!!i[0].link})}}),hc=(e,t)=>Ol(e,t)[0].link?"labels.link.edit":"labels.link.create",pc=(e,t,n)=>{let[r,i,o,a]=e;const s=14/n.zoom.value,l=14/n.zoom.value,c=14/n.zoom.value,d=(r+o)/2,u=(i+a)/2,h=6/(2*n.zoom.value),p=4/n.zoom.value,g=o+p-h,m=i-p-c+h,[f,b]=De(g+s/2,m+l/2,d,u,t);return[f-s/2,b-l/2,s,l]},gc=(e,t,n,r)=>{let[i,o]=n;const a=4/t.zoom.value;if(!r&&t.viewModeEnabled&&zi(e,[i,o],a))return!0;const[s,l,c,d]=Ye(e),[u,h,p,g]=pc([s,l,c,d],e.angle,t);return i>u-a&&i<u+a+p&&o>h-a&&o<h+g+a};let mc=null;const fc=(e,t)=>{if(!e.link)return;const n=il();n.classList.add("excalidraw-tooltip--visible"),n.style.maxWidth="20rem",n.textContent=e.link;const[r,i,o,a]=Ye(e),[s,l,c,d]=pc([r,i,o,a],e.angle,t),u=$t({sceneX:s,sceneY:l},t);ol(n,{left:u.x,top:u.y,width:c,height:d},"top"),tc("hyperlink","tooltip","link-icon"),ac=!0},bc=(e,t,n)=>{let[r,i]=n;const{x:o,y:a}=qt({clientX:r,clientY:i},t),s=15/t.zoom.value;if(zi(e,[o,a],s))return!1;const[l,c,d]=Ye(e);if(o>=l&&o<=d&&a>=c-85&&a<=c)return!1;const{x:u,y:h}=lc(e,t);return!(r>=u-s&&r<=u+320+10+s&&i>=h-s&&i<=h+s+10+42)},vc=(()=>{const 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]})(),xc=function(e,t,n,r,i,o,a,s){let l=arguments.length>8&&void 0!==arguments[8]&&arguments[8];e.save(),e.translate(o,a),e.rotate(s),l&&e.fillRect(t-o,n-a,r,i),e.strokeRect(t-o,n-a,r,i),e.restore()},yc=(e,t,n,r)=>{e.beginPath(),e.arc(t,n,r,0,2*Math.PI),e.fill(),e.stroke()},wc=(e,t,n,r,i,a,s)=>{if(null===a)return{atLeastOneVisibleElement:!1};const{renderScrollbars:l=!0,renderSelection:c=!0,renderGrid:d=!0,isExporting:u}=s,h=a.getContext("2d");h.setTransform(1,0,0,1,0,0),h.save(),h.scale(r,r);const p=a.width/r,g=a.height/r;if(u&&"dark"===s.theme&&(h.filter=o.ZF),"string"==typeof s.viewBackgroundColor){("transparent"===s.viewBackgroundColor||5===s.viewBackgroundColor.length||9===s.viewBackgroundColor.length||/(hsla|rgba)\(/.test(s.viewBackgroundColor))&&h.clearRect(0,0,p,g),h.save(),h.fillStyle=s.viewBackgroundColor,h.fillRect(0,0,p,g),h.restore()}else h.clearRect(0,0,p,g);h.save(),h.scale(s.zoom.value,s.zoom.value),d&&t.gridSize&&((e,t,n,r,i,o)=>{e.save(),e.strokeStyle="rgba(0,0,0,0.1)",e.beginPath();for(let a=n;a<n+i+2*t;a+=t)e.moveTo(a,r-t),e.lineTo(a,r+o+2*t);for(let a=r;a<r+o+2*t;a+=t)e.moveTo(n-t,a),e.lineTo(n+i+2*t,a);e.stroke(),e.restore()})(h,t.gridSize,-Math.ceil(s.zoom.value/t.gridSize)*t.gridSize+s.scrollX%t.gridSize,-Math.ceil(s.zoom.value/t.gridSize)*t.gridSize+s.scrollY%t.gridSize,p/s.zoom.value,g/s.zoom.value);const f=e.filter((e=>Tc(e,p,g,{zoom:s.zoom,offsetLeft:t.offsetLeft,offsetTop:t.offsetTop,scrollX:s.scrollX,scrollY:s.scrollY})));if(f.forEach((e=>{try{yr(e,i,h,s),u||Ic(e,h,t)}catch(e){console.error(e)}})),t.editingLinearElement){const e=vo.getElement(t.editingLinearElement.elementId);e&&((e,t,n,r)=>{e.save(),e.translate(n.scrollX,n.scrollY),e.lineWidth=1/n.zoom.value,vo.getPointsGlobalCoordinates(r).forEach(((r,i)=>{var o,a;e.strokeStyle="red",e.setLineDash([]),e.fillStyle=null!==(o=t.editingLinearElement)&&void 0!==o&&null!==(a=o.selectedPointsIndices)&&void 0!==a&&a.includes(i)?"rgba(255, 127, 127, 0.9)":"rgba(255, 255, 255, 0.9)";const{POINT_HANDLE_SIZE:s}=vo;yc(e,r[0],r[1],s/2/n.zoom.value)})),e.restore()})(h,t,s,e)}if(n)try{yr(n,i,h,s)}catch(e){console.error(e)}if(yo(t)&&t.suggestedBindings.filter((e=>null!=e)).forEach((e=>{Cc(h,s,e)})),c&&!t.multiElement&&!t.editingLinearElement){const n=e.reduce(((e,n)=>{const r=[];if(t.selectedElementIds[n.id]&&!Nr(t,n)&&r.push(it.black),s.remoteSelectedElementIds[n.id]&&r.push(...s.remoteSelectedElementIds[n.id].map((e=>{var n;const r=null===(n=t.collaborators.get(e))||void 0===n?void 0:n.picture,{background:i}=rc(r||e,t);return i}))),r.length){const[t,i,o,a]=Ye(n);e.push({angle:n.angle,elementX1:t,elementY1:i,elementX2:o,elementY2:a,selectionColors:r})}return e}),[]),r=t=>{const r=Kr(e,t),[i,o,a,s]=et(r);n.push({angle:0,elementX1:i,elementX2:a,elementY1:o,elementY2:s,selectionColors:[it.black]})};for(const e of Fr(t))r(e);t.editingGroupId&&r(t.editingGroupId),n.forEach((e=>_c(h,s,e)));const i=Ol(e,t);if(h.save(),h.translate(s.scrollX,s.scrollY),1===i.length){h.fillStyle=it.white;const e=ci(i[0],s.zoom,"mouse");t.viewModeEnabled||kc(h,s,e,i[0].angle)}else if(i.length>1&&!t.isRotating){const e=4/s.zoom.value;h.fillStyle=it.white;const[t,n,r,o]=et(i),a=h.getLineDash();h.setLineDash([2/s.zoom.value]);const l=h.lineWidth;h.lineWidth=1/s.zoom.value,xc(h,t-e,n-e,r-t+2*e,o-n+2*e,(t+r)/2,(n+o)/2,0),h.lineWidth=l,h.setLineDash(a);const c=li([t,n,r,o],0,s.zoom,"mouse",ri);kc(h,s,c,0)}h.restore()}h.restore();for(const e in s.remotePointerViewportCoords){var b;let{x:n,y:r}=s.remotePointerViewportCoords[e];n-=t.offsetLeft,r-=t.offsetTop;const i=9,o=14,a=n<0||n>p-i||r<0||r>g-o;n=Math.max(n,0),n=Math.min(n,p-i),r=Math.max(r,0),r=Math.min(r,g-o);const l=null===(b=t.collaborators.get(e))||void 0===b?void 0:b.picture,{background:c,stroke:d}=rc(l||e,t);h.save(),h.strokeStyle=d,h.fillStyle=c;const u=s.remotePointerUserStates[e];(a||u===ic.AWAY)&&(h.globalAlpha=.48),s.remotePointerButton&&"down"===s.remotePointerButton[e]&&(h.beginPath(),h.arc(n,r,15,0,2*Math.PI,!1),h.lineWidth=3,h.strokeStyle="#ffffff88",h.stroke(),h.closePath(),h.beginPath(),h.arc(n,r,15,0,2*Math.PI,!1),h.lineWidth=1,h.strokeStyle=d,h.stroke(),h.closePath()),h.beginPath(),h.moveTo(n,r),h.lineTo(n+1,r+14),h.lineTo(n+4,r+9),h.lineTo(n+9,r+10),h.lineTo(n,r),h.fill(),h.stroke();const m=s.remotePointerUsernames[e];let f="";u===ic.AWAY?f=vc?"⚫️":" (".concat(ic.AWAY,")"):u===ic.IDLE?f=vc?"💤":" (".concat(ic.IDLE,")"):u===ic.ACTIVE&&(f=vc?"🟢":"");const v="".concat(m?"".concat(m," "):"").concat(f);if(!a&&v){const e=n+i,t=r+o,a=4,s=4,l=h.measureText(v),u=l.actualBoundingBoxDescent+l.actualBoundingBoxAscent;h.fillStyle=d,h.fillRect(e-1,t-1,l.width+2*a+2,u+2*s+2),h.fillStyle=c,h.fillRect(e,t,l.width+2*a,u+2*s),h.fillStyle=it.white,h.fillText(v,e+a,t+s+l.actualBoundingBoxAscent)}h.restore(),h.closePath()}let v;return l&&(v=((e,t,n,r)=>{let{scrollX:i,scrollY:o,zoom:a}=r;if(0===e.length)return{horizontal:null,vertical:null};const[s,l,c,d]=et(e),u=t/a.value,h=n/a.value,p=t-u,g=n-h,f={top:parseInt(Qt("sat")),bottom:parseInt(Qt("sab")),left:parseInt(Qt("sal")),right:parseInt(Qt("sar"))},b=m().rtl,v=p/2-i+f.left,x=g/2-o+f.top,y=v+u-f.right,w=x+h-f.bottom,k=Math.min(s,v),_=Math.min(l,x),C=Math.max(c,y),E=Math.max(d,w);return{horizontal:v===k&&y===C?null:{x:Math.max(f.left,4)+(v-k)/(C-k)*t,y:n-6-Math.max(4,f.bottom),width:(y-v)/(C-k)*t-Math.max(8,f.left+f.right),height:6},vertical:x===_&&w===E?null:{x:b?Math.max(f.left,4):t-6-Math.max(f.right,4),y:(x-_)/(E-_)*n+Math.max(f.top,4),width:6,height:(w-x)/(E-_)*n-Math.max(8,f.top+f.bottom)}}})(e,p,g,s),h.save(),h.fillStyle="rgba(0,0,0,0.3)",h.strokeStyle="rgba(255,255,255,0.8)",[v.horizontal,v.vertical].forEach((e=>{e&&((e,t,n,r,i,o)=>{e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-o,n),e.quadraticCurveTo(t+r,n,t+r,n+o),e.lineTo(t+r,n+i-o),e.quadraticCurveTo(t+r,n+i,t+r-o,n+i),e.lineTo(t+o,n+i),e.quadraticCurveTo(t,n+i,t,n+i-o),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath(),e.fill(),e.stroke()})(h,e.x,e.y,e.width,e.height,3)})),h.restore()),h.restore(),{atLeastOneVisibleElement:f.length>0,scrollBars:v}},kc=(e,t,n,r)=>{Object.keys(n).forEach((i=>{const o=n[i];void 0!==o&&(e.save(),e.lineWidth=1/t.zoom.value,"rotation"===i?yc(e,o[0]+o[2]/2,o[1]+o[3]/2,o[2]/2):xc(e,o[0],o[1],o[2],o[3],o[0]+o[2]/2,o[1]+o[3]/2,r,!0),e.restore())}))},_c=(e,t,n)=>{const{angle:r,elementX1:i,elementY1:o,elementX2:a,elementY2:s,selectionColors:l}=n,c=a-i,d=s-o,u=4/t.zoom.value,h=8/t.zoom.value,p=4/t.zoom.value;e.save(),e.translate(t.scrollX,t.scrollY),e.lineWidth=1/t.zoom.value;const g=l.length;for(let t=0;t<g;++t)e.strokeStyle=l[t],e.setLineDash([h,p+(h+p)*(g-1)]),e.lineDashOffset=(h+p)*t,xc(e,i-u,o-u,c+2*u,d+2*u,i+c/2,o+d/2,r);e.restore()},Cc=(e,t,n)=>{const r=Array.isArray(n)?Sc:Ec;e.save(),e.translate(t.scrollX,t.scrollY),r(e,n),e.restore()},Ec=(e,t)=>{const[n,r,i,o]=Ye(t),a=i-n,s=o-r,l=Hi(t,a,s);e.strokeStyle="rgba(0,0,0,.05)",e.lineWidth=l-4;const c=2+l/2;switch(t.type){case"rectangle":case"text":case"image":xc(e,n-c,r-c,a+2*c,s+2*c,n+a/2,r+s/2,t.angle);break;case"diamond":const i=Math.hypot(a,s);((e,t,n,r,i,o)=>{e.save(),e.translate(r,i),e.rotate(o),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*(c*i/s),s+2*(c*i/a),n+a/2,r+s/2,t.angle);break;case"ellipse":((e,t,n,r,i,o)=>{e.beginPath(),e.ellipse(r,i,t/2,n/2,o,0,2*Math.PI),e.stroke()})(e,a+2*c,s+2*c,n+a/2,r+s/2,t.angle)}},Sc=(e,t)=>{const[n,r,i]=t,o=Hi(i,i.width,i.height);e.strokeStyle="rgba(0,0,0,0)",e.fillStyle="rgba(0,0,0,.05)";("both"===r?[0,-1]:"start"===r?[0]:[-1]).forEach((t=>{const[r,i]=vo.getPointAtIndexGlobalCoordinates(n,t);yc(e,r,i,o)}))};let jc;const Ic=(e,t,n)=>{if(e.link&&!n.selectedElementIds[e.id]){const[r,i,o,a]=Ye(e),[s,l,c,d]=pc([r,i,o,a],e.angle,n),u=s+c/2,h=l+d/2;if(t.save(),t.translate(n.scrollX+u,n.scrollY+h),t.rotate(e.angle),jc&&jc.zoom===n.zoom.value)t.drawImage(jc,s-u,l-h,c,d);else{jc=document.createElement("canvas"),jc.zoom=n.zoom.value,jc.width=c*window.devicePixelRatio*n.zoom.value,jc.height=d*window.devicePixelRatio*n.zoom.value;const e=jc.getContext("2d");e.scale(window.devicePixelRatio*n.zoom.value,window.devicePixelRatio*n.zoom.value),e.fillStyle="#fff",e.fillRect(0,0,c,d),e.drawImage(oc,0,0,c,d),e.restore(),t.drawImage(jc,s-u,l-h,c,d)}t.restore()}},Tc=(e,t,n,r)=>{const[i,o,a,s]=Je(e),l=qt({clientX:r.offsetLeft,clientY:r.offsetTop},r),c=qt({clientX:r.offsetLeft+t,clientY:r.offsetTop+n},r);return l.x<=a&&l.y<=s&&c.x>=i&&c.y>=o};var Mc=Object.defineProperty,Oc=(e,t)=>()=>(e&&(t=e(e=0)),t),Lc=(e,t)=>{for(var n in(e=>{Mc(e,"__esModule",{value:!0})})(e),t)Mc(e,n,{get:t[n],enumerable:!0})},Ac={};Lc(Ac,{default:()=>Pc});var Pc,Dc=Oc((()=>{Pc=async(e=[{}])=>(Array.isArray(e)||(e=[e]),new Promise(((t,n)=>{let r=document.createElement("input");r.type="file";let i=[...e.map((e=>e.mimeTypes||[])).join(),e.map((e=>e.extensions||[])).join()].join();r.multiple=e[0].multiple||!1,r.accept=i||"";let o=e=>{"function"==typeof a&&a(),t(e)},a=e[0].legacySetup&&e[0].legacySetup(o,(()=>a(n)),r);r.addEventListener("change",(()=>{o(r.multiple?Array.from(r.files):r.files[0])})),r.click()})))})),zc={};Lc(zc,{default:()=>Hc});var Rc,Hc,Nc=Oc((()=>{Rc=async e=>{let t=await e.getFile();return t.handle=e,t},Hc=async(e=[{}])=>{Array.isArray(e)||(e=[e]);let t=[];e.forEach(((e,n)=>{t[n]={description:e.description||"",accept:{}},e.mimeTypes?e.mimeTypes.map((r=>{t[n].accept[r]=e.extensions||[]})):t[n].accept["*/*"]=e.extensions||[]}));let n=await window.showOpenFilePicker({id:e[0].id,startIn:e[0].startIn,types:t,multiple:e[0].multiple||!1,excludeAcceptAllOption:e[0].excludeAcceptAllOption||!1}),r=await Promise.all(n.map(Rc));return e[0].multiple?r:r[0]}})),Bc={};Lc(Bc,{default:()=>Fc});var Fc,Uc=Oc((()=>{Fc=async(e=[{}])=>(Array.isArray(e)||(e=[e]),e[0].recursive=e[0].recursive||!1,new Promise(((t,n)=>{let r=document.createElement("input");r.type="file",r.webkitdirectory=!0;let i=e=>{"function"==typeof o&&o(),t(e)},o=e[0].legacySetup&&e[0].legacySetup(i,(()=>o(n)),r);r.addEventListener("change",(()=>{let t=Array.from(r.files);e[0].recursive?e[0].recursive&&e[0].skipDirectory&&(t=t.filter((t=>t.webkitRelativePath.split("/").every((t=>!e[0].skipDirectory({name:t,kind:"directory"})))))):t=t.filter((e=>2===e.webkitRelativePath.split("/").length)),i(t)})),r.click()})))})),Wc={};Lc(Wc,{default:()=>Vc});var Kc,Vc,Gc=Oc((()=>{Kc=async(e,t,n=e.name,r)=>{let i=[],o=[];for await(let a of e.values()){let s=`${n}/${a.name}`;"file"===a.kind?o.push(a.getFile().then((t=>(t.directoryHandle=e,Object.defineProperty(t,"webkitRelativePath",{configurable:!0,enumerable:!0,get:()=>s}))))):"directory"===a.kind&&t&&(!r||!r(a))&&i.push(Kc(a,t,s,r))}return[...(await Promise.all(i)).flat(),...await Promise.all(o)]},Vc=async(e={})=>{e.recursive=e.recursive||!1;let t=await window.showDirectoryPicker({id:e.id,startIn:e.startIn});return Kc(t,e.recursive,void 0,e.skipDirectory)}})),Yc={};Lc(Yc,{default:()=>Xc});var Xc,Zc=Oc((()=>{Xc=async(e,t={})=>{Array.isArray(t)&&(t=t[0]);let n=document.createElement("a"),r=e;"body"in e&&(r=await async function(e,t){let n=e.getReader(),r=new ReadableStream({start:e=>async function t(){return n.read().then((({done:n,value:r})=>{if(!n)return e.enqueue(r),t();e.close()}))}()}),i=new Response(r);return n.releaseLock(),new Blob([await i.blob()],{type:t})}(e.body,e.headers.get("content-type"))),n.download=t.fileName||"Untitled",n.href=URL.createObjectURL(r);let i=()=>{"function"==typeof o&&o()},o=t.legacySetup&&t.legacySetup(i,(()=>o(reject)),n);return n.addEventListener("click",(()=>{setTimeout((()=>URL.revokeObjectURL(n.href)),3e4),i()})),n.click(),null}})),qc={};Lc(qc,{default:()=>$c});var $c,Qc=Oc((()=>{$c=async(e,t=[{}],n=null,r=!1)=>{Array.isArray(t)||(t=[t]),t[0].fileName=t[0].fileName||"Untitled";let i=[];if(t.forEach(((t,n)=>{i[n]={description:t.description||"",accept:{}},t.mimeTypes?(0===n&&(e.type?t.mimeTypes.push(e.type):e.headers&&e.headers.get("content-type")&&t.mimeTypes.push(e.headers.get("content-type"))),t.mimeTypes.map((e=>{i[n].accept[e]=t.extensions||[]}))):e.type&&(i[n].accept[e.type]=t.extensions||[])})),n)try{await n.getFile()}catch(e){if(n=null,r)throw e}let o=n||await window.showSaveFilePicker({suggestedName:t[0].fileName,id:t[0].id,startIn:t[0].startIn,types:i,excludeAcceptAllOption:t[0].excludeAcceptAllOption||!1}),a=await o.createWritable();return"stream"in e?(await e.stream().pipeTo(a),o):"body"in e?(await e.body.pipeTo(a),o):(await a.write(blob),await a.close(),o)}})),Jc=(()=>{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})(),ed=Jc?Promise.resolve().then((()=>(Nc(),zc))):Promise.resolve().then((()=>(Dc(),Ac)));Jc?Promise.resolve().then((()=>(Gc(),Wc))):Promise.resolve().then((()=>(Uc(),Bc)));var td=Jc?Promise.resolve().then((()=>(Qc(),qc))):Promise.resolve().then((()=>(Zc(),Yc)));const nd=e=>{var t,n,r;const i=null===(t=e.extensions)||void 0===t?void 0:t.reduce(((e,t)=>(e.push(o.LO[t]),e)),[]),a=null===(n=e.extensions)||void 0===n?void 0:n.reduce(((e,t)=>"jpg"===t?e.concat(".jpg",".jpeg"):e.concat(".".concat(t))),[]);return async function(...e){return(await ed).default(...e)}({description:e.description,extensions:a,mimeTypes:i,multiple:null!==(r=e.multiple)&&void 0!==r&&r,legacySetup:(t,n,r)=>{const i=Wt(n,500),a=()=>{s(),document.addEventListener(o.Ks.KEYUP,i),document.addEventListener(o.Ks.POINTER_UP,i),i()},s=()=>{var n;if(null!==(n=r.files)&&void 0!==n&&n.length){const n=e.multiple?[...r.files]:r.files[0];t(n)}};requestAnimationFrame((()=>{window.addEventListener(o.Ks.FOCUS,a)}));const l=window.setInterval((()=>{s()}),500);return e=>{clearInterval(l),i.cancel(),window.removeEventListener(o.Ks.FOCUS,a),document.removeEventListener(o.Ks.KEYUP,i),document.removeEventListener(o.Ks.POINTER_UP,i),e&&(console.warn("Opening the file was canceled (legacy-fs)."),e(new Zs))}}})},rd=(e,t)=>async function(...e){return(await td).default(...e)}(e,{fileName:"".concat(t.name,".").concat(t.extension),description:t.description,extensions:[".".concat(t.extension)]},t.fileHandle),id={selection:!0,text:!0,rectangle:!0,diamond:!0,ellipse:!0,line:!0,image:!0,arrow:!0,freedraw:!0},od=(e,t)=>{var n,r,i,o,a,s,l,c,d,u,h,p,g,m;const f={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||Or(),fillStyle:e.fillStyle||"hachure",strokeWidth:e.strokeWidth||1,strokeStyle:null!==(i=e.strokeStyle)&&void 0!==i?i:"solid",roughness:null!==(o=e.roughness)&&void 0!==o?o:1,opacity:null==e.opacity?100:e.opacity,angle:e.angle||0,x:null!==(a=null!==(s=t.x)&&void 0!==s?s:e.x)&&void 0!==a?a:0,y:null!==(l=null!==(c=t.y)&&void 0!==c?c:e.y)&&void 0!==l?l:0,strokeColor:e.strokeColor,backgroundColor:e.backgroundColor,width:e.width||0,height:e.height||0,seed:null!==(d=e.seed)&&void 0!==d?d:1,groupIds:null!==(u=e.groupIds)&&void 0!==u?u:[],strokeSharpness:null!==(h=e.strokeSharpness)&&void 0!==h?h:Ie(e.type)?"round":"sharp",boundElements:e.boundElementIds?e.boundElementIds.map((e=>({type:"arrow",id:e}))):null!==(p=e.boundElements)&&void 0!==p?p:[],updated:null!==(g=e.updated)&&void 0!==g?g:sn(),link:null!==(m=e.link)&&void 0!==m?m:null};return Object.assign(Object.assign(Object.assign({},f),Rr(f)),t)},ad=e=>{var t,n,r;switch(e.type){case"text":let i=e.fontSize,a=e.fontFamily;if("font"in e){const[t,n]=e.font.split(" ");i=parseInt(t,10),r=n,a=Object.keys(o.ut).includes(r)?o.ut[r]:o.rk}return od(e,{fontSize:i,fontFamily:a,text:null!==(t=e.text)&&void 0!==t?t:"",baseline:e.baseline,textAlign:e.textAlign||o.Hg,verticalAlign:e.verticalAlign||o.hs,containerId:null!==(n=e.containerId)&&void 0!==n?n:null,originalText:e.originalText||e.text});case"freedraw":return od(e,{points:e.points,lastCommittedPoint:null,simulatePressure:e.simulatePressure,pressures:e.pressures});case"image":return od(e,{status:e.status||"pending",fileId:e.fileId,scale:e.scale||[1,1]});case"line":case"draw":case"arrow":{const{startArrowhead:t=null,endArrowhead:n=("arrow"===e.type?"arrow":null)}=e;let r=e.x,i=e.y,o=!Array.isArray(e.points)||e.points.length<2?[[0,0],[e.width,e.height]]:e.points;return 0===o[0][0]&&0===o[0][1]||({points:o,x:r,y:i}=vo.getNormalizedPoints(e)),od(e,{type:"draw"===e.type?"line":e.type,startBinding:e.startBinding,endBinding:e.endBinding,lastCommittedPoint:null,startArrowhead:t,endArrowhead:n,points:o,x:r,y:i})}case"ellipse":case"rectangle":case"diamond":return od(e,{})}},sd=(e,t)=>{const n=t?ln(t):null;return(e||[]).reduce(((e,t)=>{if("selection"!==t.type&&!Dr(t)){let r=ad(t);if(r){const i=null==n?void 0:n.get(t.id);i&&i.version>r.version&&(r=Pr(r,i.version)),e.push(r)}}return e}),[])},ld=(e,t)=>{e=e||{};const n=hn(),r={};for(const[i,o]of Object.entries(n)){const n=e[i],a=t?t[i]:void 0;r[i]=void 0!==n?n:void 0!==a?a:o}return Object.assign(Object.assign({},r),{elementType:id[r.elementType]?r.elementType:"selection",zoom:"number"==typeof e.zoom?{value:e.zoom}:e.zoom||n.zoom})},cd=(e,t,n)=>({elements:sd(null==e?void 0:e.elements,n),appState:ld(null==e?void 0:e.appState,t||null),files:(null==e?void 0:e.files)||{}}),dd=(e,t)=>{const n=[];for(const r of e)if(Array.isArray(r))n.push({status:t,elements:r,id:Or(),created:Date.now()});else{const e=r;n.push(Object.assign(Object.assign({},e),{id:e.id||Or(),status:e.status||t,created:e.created||Date.now()}))}return n},ud=async e=>{let t;if(e.type===o.LO.png)try{return await(await Promise.all([n.e(736),n.e(9)]).then(n.bind(n,673))).decodePngMetadata(e)}catch(e){throw"INVALID"===e.message?new DOMException(b("alerts.imageDoesNotContainScene"),"EncodingError"):new DOMException(b("alerts.cannotRestoreFromImage"),"EncodingError")}else if(t="text"in Blob?await e.text():await new Promise((t=>{const n=new FileReader;n.readAsText(e,"utf8"),n.onloadend=()=>{n.readyState===FileReader.DONE&&t(n.result)}})),e.type===o.LO.svg)try{return await(await Promise.all([n.e(736),n.e(9)]).then(n.bind(n,673))).decodeSvgMetadata({svg:t})}catch(e){throw"INVALID"===e.message?new DOMException(b("alerts.imageDoesNotContainScene"),"EncodingError"):new DOMException(b("alerts.cannotRestoreFromImage"),"EncodingError")}return t},hd=e=>{var t;return e&&(null===(t=e.name.match(/\.(json|excalidraw|png|svg)$/))||void 0===t?void 0:t[1])||null},pd=e=>{const t=hd(e);return"png"===t||"svg"===t},gd=e=>{const{type:t}=e||{};return!!t&&o.jo.includes(t)},md=async(e,t,n)=>{const r=await ud(e);try{const i=JSON.parse(r);if(!Ed(i))throw new Error(b("alerts.couldNotLoadInvalidFile"));return cd({elements:jl(i.elements||[]),appState:Object.assign(Object.assign({theme:null==t?void 0:t.theme,fileHandle:e.handle||null},fn(i.appState||{})),t?tl(i.elements||[],t):{}),files:i.files},t,n)}catch(e){throw console.error(e.message),new Error(b("alerts.couldNotLoadInvalidFile"))}},fd=async e=>{const t=await ud(e),n=JSON.parse(t);if(n.type!==o.r8.excalidrawLibrary)throw new Error(b("alerts.couldNotLoadInvalidFile"));return n},bd=async e=>new Promise(((t,n)=>{try{e.toBlob((e=>{if(!e)return n(new Xs(b("canvasError.canvasTooBig"),"CANVAS_POSSIBLY_TOO_BIG"));t(e)}))}catch(e){n(e)}})),vd=async e=>{try{const n=await window.crypto.subtle.digest("SHA-1",await e.arrayBuffer());return t=new Uint8Array(n),Array.from(t).map((e=>"0".concat(e.toString(16)).slice(-2))).join("")}catch(e){return console.error(e),we(40)}var t},xd=async e=>new Promise(((t,n)=>{const r=new FileReader;r.onload=()=>{const e=r.result;t(e)},r.onerror=e=>n(e),r.readAsDataURL(e)})),yd=async(e,t)=>{if(e.type===o.LO.svg)return e;const[r,i]=await Promise.all([n.e(736).then(n.t.bind(n,4881,23)).then((e=>e.default)),n.e(736).then(n.bind(n,100)).then((e=>e.default))]),a=i({pica:r({features:["js","wasm"]})});if(t.outputType){const{outputType:e}=t;a._create_blob=function(t){return this.pica.toBlob(t.out_canvas,e,.8).then((e=>(t.out_blob=e,t)))}}if(!gd(e))throw new Error(b("errors.unsupportedFileType"));return new File([await a.toBlob(e,{max:t.maxWidthOrHeight})],e.name,{type:t.outputType||e.type})},wd=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return new File([(new TextEncoder).encode(e)],t,{type:o.LO.svg})},kd=(e,t)=>{const n={};for(const r of e)!r.isDeleted&&"fileId"in r&&r.fileId&&t[r.fileId]&&(n[r.fileId]=t[r.fileId]);return n},_d=(e,t,n,r)=>{const i={type:o.r8.excalidraw,version:o.Kr.excalidraw,source:o.pb,elements:"local"===r?jl(e):Sl(e),appState:"local"===r?fn(t):bn(t),files:"local"===r?kd(e,n):void 0};return JSON.stringify(i,null,2)},Cd=async(e,t,n)=>{const r=_d(e,t,n,"local"),i=new Blob([r],{type:o.LO.excalidraw});return{fileHandle:await rd(i,{name:t.name,extension:"excalidraw",description:"Excalidraw file",fileHandle:pd(t.fileHandle)?null:t.fileHandle})}},Ed=e=>(null==e?void 0:e.type)===o.r8.excalidraw&&(!e.elements||Array.isArray(e.elements)&&(!e.appState||"object"==typeof e.appState)),Sd=e=>new Promise(((t,n)=>{const r=new Image;r.onload=()=>{t(r)},r.onerror=e=>{n(e)},r.src=e})),jd=async e=>{let{fileIds:t,files:n,imageCache:r}=e;const i=new Map,a=new Map;return await Promise.all(t.reduce(((e,t)=>{const s=n[t];return s&&!i.has(t)?(i.set(t,!0),e.concat((async()=>{try{if(s.mimeType===o.LO.binary)throw new Error("Only images can be added to ImageCache");const e=Sd(s.dataURL),n={image:e,mimeType:s.mimeType};r.set(t,n);const i=await e;r.set(t,Object.assign(Object.assign({},n),{image:i}))}catch(e){a.set(t,!0)}})())):e}),[])),{imageCache:r,updatedFiles:i,erroredFiles:a}},Id=e=>e.filter((e=>ke(e))),Td="\x3c!-- svg-source:excalidraw --\x3e",Md=async function(e,t,n,r){let{exportBackground:i,exportPadding:a=o.qy,viewBackgroundColor:s}=r,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:(e,n)=>{const r=document.createElement("canvas");return r.width=e*t.exportScale,r.height=n*t.exportScale,{canvas:r,scale:t.exportScale}};const[c,d,u,h]=Ld(e,a),{canvas:p,scale:g=1}=l(u,h),m=hn(),{imageCache:f}=await jd({imageCache:new Map,fileIds:Id(e).map((e=>e.fileId)),files:n});return wc(e,t,null,g,ve.canvas(p),p,{viewBackgroundColor:i?s:null,scrollX:-c+a,scrollY:-d+a,zoom:m.zoom,remotePointerViewportCoords:{},remoteSelectedElementIds:{},shouldCacheIgnoreZoom:!1,remotePointerUsernames:{},remotePointerUserStates:{},theme:t.exportWithDarkMode?"dark":"light",imageCache:f,renderScrollbars:!1,renderSelection:!1,renderGrid:!1,isExporting:!0}),p},Od=async(e,t,r)=>{const{exportPadding:i=o.qy,viewBackgroundColor:a,exportScale:s=1,exportEmbedScene:l}=t;let c="";if(l)try{c=await(await Promise.all([n.e(736),n.e(9)]).then(n.bind(n,673))).encodeSvgMetadata({text:_d(e,t,r||{},"local")})}catch(e){console.error(e)}const[d,u,h,p]=Ld(e,i),g=document.createElementNS(o.hR,"svg");if(g.setAttribute("version","1.1"),g.setAttribute("xmlns",o.hR),g.setAttribute("viewBox","0 0 ".concat(h," ").concat(p)),g.setAttribute("width","".concat(h*s)),g.setAttribute("height","".concat(p*s)),t.exportWithDarkMode&&g.setAttribute("filter",o.ZF),g.innerHTML="\n ".concat(Td,"\n ").concat(c,'\n <defs>\n <style>\n @font-face {\n font-family: "Virgil";\n src: url("https://excalidraw.com/Virgil.woff2");\n }\n @font-face {\n font-family: "Cascadia";\n src: url("https://excalidraw.com/Cascadia.woff2");\n }\n </style>\n </defs>\n '),t.exportBackground&&a){const e=g.ownerDocument.createElementNS(o.hR,"rect");e.setAttribute("x","0"),e.setAttribute("y","0"),e.setAttribute("width","".concat(h)),e.setAttribute("height","".concat(p)),e.setAttribute("fill",a),g.appendChild(e)}return function(e,t,n,r){let{offsetX:i=0,offsetY:o=0,exportWithDarkMode:a=!1}=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};n&&e.forEach((e=>{if(!e.isDeleted)try{kr(e,t,n,r,e.x+i,e.y+o,a)}catch(e){console.error(e)}}))}(e,ve.svg(g),g,r||{},{offsetX:-d+i,offsetY:-u+i,exportWithDarkMode:t.exportWithDarkMode}),g},Ld=(e,t)=>{const[n,r,i,o]=et(e);return[n,r,Kt(n,i)+2*t,Kt(r,o)+t+t]},Ad=32,Pd=12,Dd=256,zd="NOT_SPREADSHEET",Rd="VALID_SPREADSHEET",Hd=e=>{const t=/^[$€£¥₩]?([0-9,]+(\.[0-9]+)?)$/.exec(e);return t?parseFloat(t[1].replace(/,/g,"")):null},Nd=(e,t)=>e.slice(1).every((e=>null!==Hd(e[t]))),Bd=e=>{const t=e[0].length;if(t>2)return{type:zd,reason:"More than 2 columns"};if(1===t){if(!Nd(e,0))return{type:zd,reason:"Value is not numeric"};const t=null===Hd(e[0][0]),n=(t?e.slice(1):e).map((e=>Hd(e[0])));return n.length<2?{type:zd,reason:"Less than two rows"}:{type:Rd,spreadsheet:{title:t?e[0][0]:null,labels:null,values:n}}}const n=Nd(e,0)?0:1;if(!Nd(e,n))return{type:zd,reason:"Value is not numeric"};const r=(n+1)%2,i=null===Hd(e[0][n]),o=i?e.slice(1):e;return o.length<2?{type:zd,reason:"Less than 2 rows"}:{type:Rd,spreadsheet:{title:i?e[0][n]:null,labels:o.map((e=>e[r])),values:o.map((e=>Hd(e[n])))}}},Fd=at.elementBackground.slice(2,at.elementBackground.length),Ud={fillStyle:"hachure",fontFamily:o.rk,fontSize:o.n5,opacity:100,roughness:1,strokeColor:at.elementStroke[0],strokeSharpness:"sharp",strokeStyle:"solid",strokeWidth:1,verticalAlign:o.oX.MIDDLE},Wd=e=>({chartWidth:44*e.values.length+Pd,chartHeight:280}),Kd=(e,t,n,r,i)=>{var o;return(null===(o=e.labels)||void 0===o?void 0:o.map(((e,o)=>$r(Object.assign(Object.assign({groupIds:[r],backgroundColor:i},Ud),{text:e.length>8?"".concat(e.slice(0,5),"..."):e,x:t+44*o+24,y:n+6,width:Ad,angle:5.87,fontSize:16,textAlign:"center",verticalAlign:"top"})))))||[]},Vd=(e,t,n,r,i)=>{const o=$r(Object.assign(Object.assign({groupIds:[r],backgroundColor:i},Ud),{x:t-Pd,y:n-Pd,text:"0",textAlign:"right"}));return[o,$r(Object.assign(Object.assign({groupIds:[r],backgroundColor:i},Ud),{x:t-Pd,y:n-Dd-o.height/2,text:Math.max(...e.values).toLocaleString(),textAlign:"right"}))]},Gd=(e,t,n,r,i)=>{const{chartWidth:o,chartHeight:a}=Wd(e);return[Jr(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Ud),{type:"line",x:t,y:n,startArrowhead:null,endArrowhead:null,width:o,points:[[0,0],[o,0]]})),Jr(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Ud),{type:"line",x:t,y:n,startArrowhead:null,endArrowhead:null,height:a,points:[[0,0],[0,-a]]})),Jr(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Ud),{type:"line",x:t,y:n-Dd-Pd,startArrowhead:null,endArrowhead:null,strokeStyle:"dotted",width:o,opacity:50,points:[[0,0],[o,0]]}))]},Yd=(e,t,n,r,i,a)=>{const{chartWidth:s,chartHeight:l}=Wd(e),c=e.title?$r(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Ud),{text:e.title,x:t+s/2,y:n-Dd-24-o.n5,strokeSharpness:"sharp",strokeStyle:"solid",textAlign:"center"})):null,d=a?Zr(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Ud),{type:"rectangle",x:t,y:n-l,width:s,height:l,strokeColor:at.elementStroke[0],fillStyle:"solid",opacity:6})):null;return[...d?[d]:[],...c?[c]:[],...Kd(e,t,n,r,i),...Vd(e,t,n,r,i),...Gd(e,t,n,r,i)]},Xd=(e,t,n,r)=>"line"===e?((e,t,n)=>{const r=Math.max(...e.values),i=Or(),a=Fd[Math.floor(Math.random()*Fd.length)];let s=0;const l=[];for(const t of e.values){const e=44*s,n=-t/r*Dd;l.push([e,n]),s++}const c=Math.max(...l.map((e=>e[0]))),d=Math.max(...l.map((e=>e[1]))),u=Math.min(...l.map((e=>e[0]))),h=Math.min(...l.map((e=>e[1]))),p=Jr(Object.assign(Object.assign({backgroundColor:a,groupIds:[i]},Ud),{type:"line",x:t+Pd+16,y:n-Pd,startArrowhead:null,endArrowhead:null,height:d-h,width:c-u,strokeWidth:2,points:l})),g=e.values.map(((e,o)=>{const s=44*o+6,l=-e/r*Dd+6;return Zr(Object.assign(Object.assign({backgroundColor:a,groupIds:[i]},Ud),{fillStyle:"solid",strokeWidth:2,type:"ellipse",x:t+s+16,y:n+l-24,width:Pd,height:Pd}))})),m=e.values.map(((e,o)=>{const s=44*o+6,l=e/r*Dd+6+Pd;return Jr(Object.assign(Object.assign({backgroundColor:a,groupIds:[i]},Ud),{type:"line",x:t+s+16+6,y:n-l,startArrowhead:null,endArrowhead:null,height:l,strokeStyle:"dotted",opacity:50,points:[[0,0],[0,l]]}))}));return[...Yd(e,t,n,i,a,"production"===o.Vi.DEVELOPMENT),p,...m,...g]})(t,n,r):((e,t,n)=>{const r=Math.max(...e.values),i=Or(),a=Fd[Math.floor(Math.random()*Fd.length)],s=e.values.map(((e,o)=>{const s=e/r*Dd;return Zr(Object.assign(Object.assign({backgroundColor:a,groupIds:[i]},Ud),{type:"rectangle",x:t+44*o+Pd,y:n-s-Pd,width:Ad,height:s}))}));return[...s,...Yd(e,t,n,i,a,"production"===o.Vi.DEVELOPMENT)]})(t,n,r);let Zd="",qd=!1;const $d="clipboard"in navigator&&"readText"in navigator.clipboard,Qd="clipboard"in navigator&&"writeText"in navigator.clipboard,Jd="clipboard"in navigator&&"write"in navigator.clipboard&&"ClipboardItem"in window&&"toBlob"in HTMLCanvasElement.prototype,eu=async(e,t,n)=>{const r=Ol(e,t,!0),i={type:o.r8.excalidrawClipboard,elements:r,files:r.reduce(((e,t)=>(ke(t)&&n[t.fileId]&&(e[t.fileId]=n[t.fileId]),e)),{})},a=JSON.stringify(i);Zd=a;try{qd=!1,await iu(a)}catch(e){qd=!0,console.error(e)}},tu=()=>{if(!Zd)return{};try{return JSON.parse(Zd)}catch(e){return console.error(e),{}}},nu=e=>{const t=(e=>{let t=e.trim().split("\n").map((e=>e.trim().split("\t")));if(t.length&&2!==t[0].length&&(t=e.trim().split("\n").map((e=>e.trim().split(",")))),0===t.length)return{type:zd,reason:"No values"};const n=t[0].length,r=t.every((e=>e.length===n));if(!r)return{type:zd,reason:"All rows don't have same number of columns"};const i=Bd(t);if(i.type!==Rd){const e=Bd((e=>{const t=[];for(let n=0;n<e[0].length;n++){const r=[];for(let t=0;t<e.length;t++)r.push(e[t][n]);t.push(r)}return t})(t));if(e.type===Rd)return e}return i})(e);return t.type===Rd?{spreadsheet:t.spreadsheet}:null},ru=async e=>{const t=await(async e=>{try{var t;return(e?null===(t=e.clipboardData)||void 0===t?void 0:t.getData("text/plain").trim():$d&&await navigator.clipboard.readText())||""}catch(e){return""}})(e);if(!t||t.includes(Td))return tu();const n=nu(t);if(n)return n;const r=tu();try{const e=JSON.parse(t);return i=e,[o.r8.excalidraw,o.r8.excalidrawClipboard].includes(null==i?void 0:i.type)&&Array.isArray(i.elements)?{elements:e.elements,files:e.files}:r}catch(e){return qd&&r.elements?r:{text:t}}var i},iu=async e=>{let t=!1;if(Qd)try{await navigator.clipboard.writeText(e||""),t=!0}catch(e){console.error(e)}if(!t&&!ou(e||" "))throw new Error("couldn't copy")},ou=e=>{const 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";const 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);let i=!1;try{n.select(),n.setSelectionRange(0,n.value.length),i=document.execCommand("copy")}catch(e){console.error(e)}return n.remove(),i},au=async(e,t,r,i,a)=>{let{exportBackground:s,exportPadding:l=o.qy,viewBackgroundColor:c,name:d,fileHandle:u=null}=a;if(0===t.length)throw new Error(b("alerts.cannotExportEmptyCanvas"));if("svg"===e||"clipboard-svg"===e){const n=await Od(t,{exportBackground:s,exportWithDarkMode:r.exportWithDarkMode,viewBackgroundColor:c,exportPadding:l,exportScale:r.exportScale,exportEmbedScene:r.exportEmbedScene&&"svg"===e},i);if("svg"===e)return await rd(new Blob([n.outerHTML],{type:o.LO.svg}),{description:"Export to SVG",name:d,extension:"svg",fileHandle:u});if("clipboard-svg"===e)return void await iu(n.outerHTML)}const h=await Md(t,r,i,{exportBackground:s,viewBackgroundColor:c,exportPadding:l});h.style.display="none",document.body.appendChild(h);let p=await bd(h);if(h.remove(),"png"===e)return r.exportEmbedScene&&(p=await(await Promise.all([n.e(736),n.e(9)]).then(n.bind(n,673))).encodePngMetadata({blob:p,metadata:_d(t,r,i,"local")})),await rd(p,{description:"Export to PNG",name:d,extension:"png",fileHandle:u});if("clipboard"===e)try{await(async e=>{await navigator.clipboard.write([new window.ClipboardItem({[o.LO.png]:e})])})(p)}catch(e){if("CANVAS_POSSIBLY_TOO_BIG"===e.name)throw e;throw new Error(b("alerts.couldNotCopyToClipboard"))}};n(7225);const su=e=>{let{children:t,checked:n,onChange:r,className:i}=e;return(0,v.jsxs)("div",{className:ye("Checkbox",i,{"is-checked":n}),onClick:e=>{r(!n,e),e.currentTarget.querySelector(".Checkbox-box").focus()},children:[(0,v.jsx)("button",{className:"Checkbox-box",role:"checkbox","aria-checked":n,children:ba}),(0,v.jsx)("div",{className:"Checkbox-label",children:t})]})};n(4623);const lu=e=>{let{children:t,gap:n,align:r,justifyContent:i,className:o,style:a}=e;return(0,v.jsx)("div",{className:ye("Stack Stack_horizontal",o),style:Object.assign({"--gap":n,alignItems:r,justifyContent:i},a),children:t})},cu=e=>{let{children:t,gap:n,align:r,justifyContent:i,className:o}=e;return(0,v.jsx)("div",{className:ye("Stack Stack_vertical",o),style:{"--gap":n,justifyItems:r,justifyContent:i},children:t})};n(554);const du=e=>{let{fileName:t,onSave:n}=e;return(0,v.jsxs)(lu,{className:"ActiveFile",gap:1,align:"center",children:[(0,v.jsxs)("span",{className:"ActiveFile__fileName",children:[qa,(0,v.jsx)("span",{children:t})]}),(0,v.jsx)($s,{type:"icon",icon:xa,title:b("buttons.save"),"aria-label":b("buttons.save"),onClick:n,"data-testid":"save-button"})]})},uu=(Us({name:"changeProjectName",perform:(e,t,n)=>(tc("change","title"),{appState:Object.assign(Object.assign({},t),{name:n}),commitToHistory:!1}),PanelComponent:e=>{let{appState:t,updateData:n,appProps:r}=e;return(0,v.jsx)(nc,{label:b("labels.fileTitle"),value:t.name||"Unnamed",onChange:e=>n(e),isNameEditable:void 0===r.name&&!t.viewModeEnabled})}}),Us({name:"changeExportScale",perform:(e,t,n)=>({appState:Object.assign(Object.assign({},t),{exportScale:n}),commitToHistory:!1}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;const i=_l(t),a=Tl(i,n)?Ol(i,n):i;return(0,v.jsx)(v.Fragment,{children:o.ZB.map((e=>{const[t,i]=((e,t,n)=>{const[,,r,i]=Ld(e,t).map((e=>Math.trunc(e*n)));return[r,i]})(a,o.qy,e),s="".concat(b("buttons.scale")," ").concat(e,"x (").concat(t,"x").concat(i,")");return(0,v.jsx)($s,{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:()=>r(e)},e)}))})}}),Us({name:"changeExportBackground",perform:(e,t,n)=>({appState:Object.assign(Object.assign({},t),{exportBackground:n}),commitToHistory:!1}),PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,v.jsx)(su,{checked:t.exportBackground,onChange:e=>n(e),children:b("labels.withBackground")})}}),Us({name:"changeExportEmbedScene",perform:(e,t,n)=>({appState:Object.assign(Object.assign({},t),{exportEmbedScene:n}),commitToHistory:!1}),PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,v.jsxs)(su,{checked:t.exportEmbedScene,onChange:e=>n(e),children:[b("labels.exportEmbedScene"),(0,v.jsx)(al,{label:b("labels.exportEmbedScene_details"),long:!0,children:(0,v.jsx)("div",{className:"excalidraw-tooltip-icon",children:Aa})})]})}}),Us({name:"saveToActiveFile",perform:async(e,t,n,r)=>{const i=!!t.fileHandle;try{const{fileHandle:n}=pd(t.fileHandle)?await(async(e,t,n)=>{const{exportBackground:r,viewBackgroundColor:i,name:o,fileHandle:a}=t,s=hd(a);if(!a||"png"!==(l=s)&&"svg"!==l)throw new Error("fileHandle should exist and should be of type svg or png when resaving");var l;return t=Object.assign(Object.assign({},t),{exportEmbedScene:!0}),await au(s,_l(e),t,n,{exportBackground:r,viewBackgroundColor:i,name:o,fileHandle:a}),{fileHandle:a}})(e,t,r.files):await Cd(e,t,r.files);return{commitToHistory:!1,appState:Object.assign(Object.assign({},t),{fileHandle:n,toastMessage:i?null!=n&&n.name?b("toast.fileSavedToFilename").replace("{filename}",'"'.concat(n.name,'"')):b("toast.fileSaved"):null})}}catch(e){return"AbortError"!==(null==e?void 0:e.name)?console.error(e):console.warn(e),{commitToHistory:!1}}},keyTest:e=>e.key===Lt.S&&e[Lt.CTRL_OR_CMD]&&!e.shiftKey,PanelComponent:e=>{var t;let{updateData:n,appState:r}=e;return(0,v.jsx)(du,{onSave:()=>n(null),fileName:null===(t=r.fileHandle)||void 0===t?void 0:t.name})}}),Us({name:"saveFileToDisk",perform:async(e,t,n,r)=>{try{const{fileHandle:n}=await Cd(e,Object.assign(Object.assign({},t),{fileHandle:null}),r.files);return{commitToHistory:!1,appState:Object.assign(Object.assign({},t),{fileHandle:n})}}catch(e){return"AbortError"!==(null==e?void 0:e.name)?console.error(e):console.warn(e),{commitToHistory:!1}}},keyTest:e=>e.key===Lt.S&&e.shiftKey&&e[Lt.CTRL_OR_CMD],PanelComponent:e=>{let{updateData:t}=e;return(0,v.jsx)($s,{type:"button",icon:ya,title:b("buttons.saveAs"),"aria-label":b("buttons.saveAs"),showAriaLabel:cp(),hidden:!Jc,onClick:()=>t(null),"data-testid":"save-as-button"})}}));Us({name:"loadScene",perform:async(e,t,n,r)=>{try{const{elements:n,appState:r,files:i}=await(async(e,t)=>{const n=await nd({description:"Excalidraw files"});return md(n,e,t)})(t,e);return{elements:n,appState:r,files:i,commitToHistory:!0}}catch(n){return"AbortError"===(null==n?void 0:n.name)?(console.warn(n),!1):{elements:e,appState:Object.assign(Object.assign({},t),{errorMessage:n.message}),files:r.files,commitToHistory:!1}}},keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.key===Lt.O,PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,v.jsx)($s,{type:"button",icon:wa,title:b("buttons.load"),"aria-label":b("buttons.load"),showAriaLabel:cp(),onClick:t,"data-testid":"load-button"})}}),Us({name:"exportWithDarkMode",perform:(e,t,n)=>({appState:Object.assign(Object.assign({},t),{exportWithDarkMode:n}),commitToHistory:!1}),PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,v.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"-45px",marginBottom:"10px"},children:(0,v.jsx)(Qs,{value:t.exportWithDarkMode?o.C6.DARK:o.C6.LIGHT,onChange:e=>{n(e===o.C6.DARK)},title:b("labels.toggleExportColorScheme")})})}});let hu="{}";const pu=Us({name:"copyStyles",perform:(e,t)=>{const n=e.find((e=>t.selectedElementIds[e.id]));return n&&(hu=JSON.stringify(n)),{appState:Object.assign(Object.assign({},t),{toastMessage:b("toast.copyStyles")}),commitToHistory:!1}},contextItemLabel:"labels.copyStyles",keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.altKey&&e.code===_t}),gu=Us({name:"pasteStyles",perform:(e,t)=>{const n=JSON.parse(hu);return"text"!==(null==(r=n)?void 0:r.type)&&"diamond"!==(null==r?void 0:r.type)&&"rectangle"!==(null==r?void 0:r.type)&&"ellipse"!==(null==r?void 0:r.type)&&"arrow"!==(null==r?void 0:r.type)&&"freedraw"!==(null==r?void 0:r.type)&&"line"!==(null==r?void 0:r.type)?{elements:e,commitToHistory:!1}:{elements:e.map((e=>{if(t.selectedElementIds[e.id]){const t=Ar(e,{backgroundColor:null==n?void 0:n.backgroundColor,strokeWidth:null==n?void 0:n.strokeWidth,strokeColor:null==n?void 0:n.strokeColor,strokeStyle:null==n?void 0:n.strokeStyle,fillStyle:null==n?void 0:n.fillStyle,opacity:null==n?void 0:n.opacity,roughness:null==n?void 0:n.roughness});return Ce(t)&&Ce(e)&&(Lr(t,{fontSize:(null==n?void 0:n.fontSize)||o.n5,fontFamily:(null==n?void 0:n.fontFamily)||o.rk,textAlign:(null==n?void 0:n.textAlign)||o.Hg}),Hn(t,er(t))),t}return e})),commitToHistory:!0};var r},contextItemLabel:"labels.pasteStyles",keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.altKey&&e.code===It}),mu=e=>(0,v.jsx)("button",{className:"help-icon",onClick:e.onClick,type:"button",title:"".concat(e.title," — ?"),"aria-label":e.title,children:Aa}),fu=(Us({name:"toggleCanvasMenu",perform:(e,t)=>({appState:Object.assign(Object.assign({},t),{openMenu:"canvas"===t.openMenu?null:"canvas"}),commitToHistory:!1}),PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,v.jsx)($s,{type:"button",icon:Ma,"aria-label":b("buttons.menu"),onClick:n,selected:"canvas"===t.openMenu})}}),Us({name:"toggleEditMenu",perform:(e,t)=>({appState:Object.assign(Object.assign({},t),{openMenu:"shape"===t.openMenu?null:"shape"}),commitToHistory:!1}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)($s,{visible:yl(n,_l(t)),type:"button",icon:Ca,"aria-label":b("buttons.edit"),onClick:r,selected:"shape"===n.openMenu})}}),Us({name:"toggleFullScreen",perform:()=>(Xt()||document.documentElement.requestFullscreen(),Xt()&&document.exitFullscreen(),{commitToHistory:!1}),keyTest:e=>e.code===St&&!e[Lt.CTRL_OR_CMD]}),Us({name:"toggleShortcuts",perform:(e,t,n,r)=>{let{focusContainer:i}=r;return t.showHelpDialog&&i(),{appState:Object.assign(Object.assign({},t),{showHelpDialog:!t.showHelpDialog}),commitToHistory:!1}},PanelComponent:e=>{let{updateData:t}=e;return(0,v.jsx)(mu,{title:b("helpDialog.title"),onClick:t})},keyTest:e=>e.key===Lt.QUESTION_MARK}),(e,t)=>{const n=Ol(_l(e),t,!0);return n.length>=2&&!(e=>{if(e.length>=2){const t=e[0].groupIds;for(const n of t)if(e.reduce(((e,t)=>e&&Wr(t,n)),!0))return!0}return!1})(n)}),bu=Us({name:"group",perform:(e,t)=>{const n=Ol(_l(e),t,!0);if(n.length<2)return{appState:t,elements:e,commitToHistory:!1};const r=Fr(t);if(1===r.length){const i=r[0],o=new Set(Kr(e,i).map((e=>e.id))),a=new Set(n.map((e=>e.id)));if(new Set([...Array.from(o),...Array.from(a)]).size===o.size)return{appState:t,elements:e,commitToHistory:!1}}const i=Or(),o=ln(n),a=e.map((e=>o.get(e.id)?Ar(e,{groupIds:Vr(e.groupIds,i,t.editingGroupId)}):e)),s=Kr(a,i),l=s[s.length-1],c=a.lastIndexOf(l),d=a.slice(c+1),u=[...a.slice(0,c).filter((e=>!Wr(e,i))),...s,...d];return{appState:Hr(i,Object.assign(Object.assign({},t),{selectedGroupIds:{}}),_l(u)),elements:u,commitToHistory:!0}},contextItemLabel:"labels.group",contextItemPredicate:(e,t)=>fu(e,t),keyTest:e=>!e.shiftKey&&e[Lt.CTRL_OR_CMD]&&e.code===Et,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)($s,{hidden:!fu(t,n),type:"button",icon:(0,v.jsx)($a,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.group")," — ").concat(Zt("CtrlOrCmd+G")),"aria-label":b("labels.group"),visible:Tl(_l(t),n)})}}),vu=Us({name:"ungroup",perform:(e,t)=>{if(0===Fr(t).length)return{appState:t,elements:e,commitToHistory:!1};const n=[],r=e.map((e=>{Pe(e)&&n.push(e.id);const r=((e,t)=>e.filter((e=>!t[e])))(e.groupIds,t.selectedGroupIds);return r.length===e.groupIds.length?e:Ar(e,{groupIds:r})})),i=Ur(Object.assign(Object.assign({},t),{selectedGroupIds:{}}),_l(r));return n.forEach((e=>i.selectedElementIds[e]=!1)),{appState:i,elements:r,commitToHistory:!0}},keyTest:e=>e.shiftKey&&e[Lt.CTRL_OR_CMD]&&e.code===Et,contextItemLabel:"labels.ungroup",contextItemPredicate:(e,t)=>Fr(t).length>0,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)($s,{type:"button",hidden:0===Fr(n).length,icon:(0,v.jsx)(Qa,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.ungroup")," — ").concat(Zt("CtrlOrCmd+Shift+G")),"aria-label":b("labels.ungroup"),visible:Tl(_l(t),n)})}});n(2789);const xu=e=>{let{children:t,color:n,border:r,onClick:i}=e;return(0,v.jsx)("div",{className:"Avatar",style:{background:n,border:"2px solid ".concat(r)},onClick:i,children:t})},yu=(Us({name:"goToCollaborator",perform:(e,t,n)=>{const r=n;return r?{appState:Object.assign(Object.assign(Object.assign({},t),el({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:e=>{let{appState:t,updateData:n,data:r}=e;const i=null==r?void 0:r.id;if(!i)return null;const o=t.collaborators.get(i);if(!o)return null;const{background:a,stroke:s}=rc(o.picture||i,t),l=o.picture,c=(e=>{if(!e)return"?";const t=e.trim().split(" ");if(t.length<2)return t[0].substring(0,2).toUpperCase();const n=t[0],r=t[t.length-1];return(n[0]+r[0]).toUpperCase()})(o.username);return(0,v.jsx)(xu,{color:a,border:l?"transparent":s,onClick:()=>n(o.pointer),children:l?(0,v.jsx)("img",{referrerPolicy:"no-referrer",src:l,alt:c}):c})}}),Us({name:"addToLibrary",perform:(e,t,n,r)=>{const i=Ol(_l(e),t,!0);return i.some((e=>"image"===e.type))?{commitToHistory:!1,appState:Object.assign(Object.assign({},t),{errorMessage:"Support for adding images to the library coming soon!"})}:r.library.loadLibrary().then((e=>r.library.saveLibrary([{id:Or(),status:"unpublished",elements:i.map(ei),created:Date.now()},...e]))).then((()=>({commitToHistory:!1,appState:Object.assign(Object.assign({},t),{toastMessage:b("toast.addedToLibrary")})}))).catch((e=>({commitToHistory:!1,appState:Object.assign(Object.assign({},t),{errorMessage:e.message})})))},contextItemLabel:"labels.addToLibrary"})),wu=(e,t,n)=>{let{axis:r,position:i}=n;const o=rt(e),[a,s]="x"===r?["minX","maxX"]:["minY","maxY"],l={x:0,y:0};return"start"===i?Object.assign(Object.assign({},l),{[r]:t[a]-o[a]}):"end"===i?Object.assign(Object.assign({},l),{[r]:t[s]-o[s]}):Object.assign(Object.assign({},l),{[r]:(t[a]+t[s])/2-(o[a]+o[s])/2})},ku=(e,t)=>Ol(_l(e),t).length>1,_u=(e,t,n)=>{const r=((e,t)=>{const n=Gr(e),r=rt(e);return n.flatMap((e=>{const n=wu(e,r,t);return e.map((e=>Ar(e,{x:e.x+n.x,y:e.y+n.y})))}))})(Ol(_l(e),t),n),i=ln(r);return e.map((e=>i.get(e.id)||e))},Cu=(Us({name:"alignTop",perform:(e,t)=>({appState:t,elements:_u(e,t,{position:"start",axis:"y"}),commitToHistory:!0}),keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.shiftKey&&e.key===Lt.ARROW_UP,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)($s,{hidden:!ku(t,n),type:"button",icon:(0,v.jsx)(Ha,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.alignTop")," — ").concat(Zt("CtrlOrCmd+Shift+Up")),"aria-label":b("labels.alignTop"),visible:Tl(_l(t),n)})}}),Us({name:"alignBottom",perform:(e,t)=>({appState:t,elements:_u(e,t,{position:"end",axis:"y"}),commitToHistory:!0}),keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.shiftKey&&e.key===Lt.ARROW_DOWN,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)($s,{hidden:!ku(t,n),type:"button",icon:(0,v.jsx)(Na,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.alignBottom")," — ").concat(Zt("CtrlOrCmd+Shift+Down")),"aria-label":b("labels.alignBottom"),visible:Tl(_l(t),n)})}}),Us({name:"alignLeft",perform:(e,t)=>({appState:t,elements:_u(e,t,{position:"start",axis:"x"}),commitToHistory:!0}),keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.shiftKey&&e.key===Lt.ARROW_LEFT,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)($s,{hidden:!ku(t,n),type:"button",icon:(0,v.jsx)(Ba,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.alignLeft")," — ").concat(Zt("CtrlOrCmd+Shift+Left")),"aria-label":b("labels.alignLeft"),visible:Tl(_l(t),n)})}}),Us({name:"alignRight",perform:(e,t)=>({appState:t,elements:_u(e,t,{position:"end",axis:"x"}),commitToHistory:!0}),keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.shiftKey&&e.key===Lt.ARROW_RIGHT,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)($s,{hidden:!ku(t,n),type:"button",icon:(0,v.jsx)(Fa,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.alignRight")," — ").concat(Zt("CtrlOrCmd+Shift+Right")),"aria-label":b("labels.alignRight"),visible:Tl(_l(t),n)})}}),Us({name:"alignVerticallyCentered",perform:(e,t)=>({appState:t,elements:_u(e,t,{position:"center",axis:"y"}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)($s,{hidden:!ku(t,n),type:"button",icon:(0,v.jsx)(Ka,{theme:n.theme}),onClick:()=>r(null),title:b("labels.centerVertically"),"aria-label":b("labels.centerVertically"),visible:Tl(_l(t),n)})}}),Us({name:"alignHorizontallyCentered",perform:(e,t)=>({appState:t,elements:_u(e,t,{position:"center",axis:"x"}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)($s,{hidden:!ku(t,n),type:"button",icon:(0,v.jsx)(Va,{theme:n.theme}),onClick:()=>r(null),title:b("labels.centerHorizontally"),"aria-label":b("labels.centerHorizontally"),visible:Tl(_l(t),n)})}}),(e,t)=>Ol(_l(e),t).length>1),Eu=(e,t,n)=>{const r=((e,t)=>{const[n,r,i,o]="x"===t.axis?["minX","midX","maxX","width"]:["minY","midY","maxY","height"],a=rt(e),s=Gr(e).map((e=>[e,rt(e)])).sort(((e,t)=>e[1][r]-t[1][r]));let l=0;for(const e of s)l+=e[1][o];const c=(a[o]-l)/(s.length-1);if(c<0){const e=s.findIndex((e=>e[1][n]===a[n])),o=s.findIndex((e=>e[1][i]===a[i])),l=(s[o][1][r]-s[e][1][r])/(s.length-1);let c=s[e][1][r];return s.flatMap(((n,i)=>{let[a,s]=n;const d={x:0,y:0};return i!==e&&i!==o&&(c+=l,d[t.axis]=c-s[r]),a.map((e=>Ar(e,{x:e.x+d.x,y:e.y+d.y})))}))}let d=a[n];return s.flatMap((e=>{let[r,i]=e;const a={x:0,y:0};return a[t.axis]=d-i[n],d+=c,d+=i[o],r.map((e=>Ar(e,{x:e.x+a.x,y:e.y+a.y})))}))})(Ol(_l(e),t),n),i=ln(r);return e.map((e=>i.get(e.id)||e))},Su=(Us({name:"distributeHorizontally",perform:(e,t)=>({appState:t,elements:Eu(e,t,{space:"between",axis:"x"}),commitToHistory:!0}),keyTest:e=>e.altKey&&e.code===jt,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)($s,{hidden:!Cu(t,n),type:"button",icon:(0,v.jsx)(Ua,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.distributeHorizontally")," — ").concat(Zt("Alt+H")),"aria-label":b("labels.distributeHorizontally"),visible:Tl(_l(t),n)})}}),Us({name:"distributeVertically",perform:(e,t)=>({appState:t,elements:Eu(e,t,{space:"between",axis:"y"}),commitToHistory:!0}),keyTest:e=>e.altKey&&e.code===It,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)($s,{hidden:!Cu(t,n),type:"button",icon:(0,v.jsx)(Wa,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.distributeVertically")," — ").concat(Zt("Alt+V")),"aria-label":b("labels.distributeVertically"),visible:Tl(_l(t),n)})}}),Us({name:"flipHorizontal",perform:(e,t)=>({elements:Iu(e,t,"horizontal"),appState:t,commitToHistory:!0}),keyTest:e=>e.shiftKey&&"KeyH"===e.code,contextItemLabel:"labels.flipHorizontal",contextItemPredicate:(e,t)=>((e,t)=>{const n=Ol(_l(e),t);return 1===n.length&&"text"!==n[0].type})(e,t)})),ju=Us({name:"flipVertical",perform:(e,t)=>({elements:Iu(e,t,"vertical"),appState:t,commitToHistory:!0}),keyTest:e=>e.shiftKey&&"KeyV"===e.code,contextItemLabel:"labels.flipVertical",contextItemPredicate:(e,t)=>((e,t)=>1===Ol(_l(e),t).length)(e,t)}),Iu=(e,t,n)=>{const r=Ol(_l(e),t);if(r.length>1)return e;const i=Tu(r,t,n),o=ln(i);return e.map((e=>o.get(e.id)||e))},Tu=(e,t,n)=>(e.forEach((e=>{Mu(e,t),"vertical"===n&&Ou(e,Math.PI)})),e),Mu=(e,t)=>{const n=e.x,r=e.y,i=e.width,o=e.height,a=Yo(e.angle);let s=0;(je(e)||Ee(e))&&(s=2*e.points.reduce(((e,t)=>Math.max(e,t[0])),0)-e.width),Lr(e,{angle:Yo(0)});const l=ci(e,t.zoom);let c=!0,d=0,u=l.nw;if(!u&&(c=!1,u=l.ne,!u))return void Lr(e,{angle:a});if(je(e)){for(let t=1;t<e.points.length;t++)vo.movePoints(e,[{index:t,point:[-e.points[t][0],e.points[t][1]]}]);vo.normalizePoints(e)}else d=c?e.x+2*i:e.x-2*i,Jo((new Map).set(e.id,e),!0,e,c?"nw":"ne",!1,d,u[1]),Lr(e,{width:i,height:o});let h=Yo(2*Math.PI-a);h<0&&(h=Yo(h+2*Math.PI)),Lr(e,{angle:h}),Lr(e,{x:n+s,y:r}),Ao(e)},Ou=(e,t)=>{const n=e.x,r=e.y;let i=Yo(e.angle+t);i<0&&(i=Yo(2*Math.PI+i)),Lr(e,{angle:i}),Lr(e,{x:n,y:r})},Lu=Us({name:"copy",perform:(e,t,n,r)=>(eu(_l(e),t,r.files),{commitToHistory:!1}),contextItemLabel:"labels.copy",keyTest:void 0}),Au=Us({name:"cut",perform:(e,t,n,r)=>(Lu.perform(e,t,n,r),Pl.perform(e,t)),contextItemLabel:"labels.cut",keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.code===Tt}),Pu=Us({name:"copyAsSvg",perform:async(e,t,n,r)=>{if(!r.canvas)return{commitToHistory:!1};const i=Ol(_l(e),t,!0);try{return await au("clipboard-svg",i.length?i:_l(e),t,r.files,t),{commitToHistory:!1}}catch(e){return console.error(e),{appState:Object.assign(Object.assign({},t),{errorMessage:e.message}),commitToHistory:!1}}},contextItemLabel:"labels.copyAsSvg"}),Du=Us({name:"copyAsPng",perform:async(e,t,n,r)=>{if(!r.canvas)return{commitToHistory:!1};const i=Ol(_l(e),t,!0);try{return await au("clipboard",i.length?i:_l(e),t,r.files,t),{appState:Object.assign(Object.assign({},t),{toastMessage:b("toast.copyToClipboardAsPng",{exportSelection:i.length?b("toast.selection"):b("toast.canvas"),exportColorScheme:t.exportWithDarkMode?b("buttons.darkMode"):b("buttons.lightMode")})}),commitToHistory:!1}}catch(e){return console.error(e),{appState:Object.assign(Object.assign({},t),{errorMessage:e.message}),commitToHistory:!1}}},contextItemLabel:"labels.copyAsPng",keyTest:e=>e.code===_t&&e.altKey&&e.shiftKey}),zu=Us({name:"gridMode",perform(e,t){return tc("view","mode","grid"),{appState:Object.assign(Object.assign({},t),{gridSize:this.checked(t)?null:o.k}),commitToHistory:!1}},checked:e=>null!==e.gridSize,contextItemLabel:"labels.showGrid",keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.code===yt}),Ru=Us({name:"zenMode",perform(e,t){return tc("view","mode","zen"),{appState:Object.assign(Object.assign({},t),{zenModeEnabled:!this.checked(t)}),commitToHistory:!1}},checked:e=>e.zenModeEnabled,contextItemLabel:"buttons.zenMode",keyTest:e=>!e[Lt.CTRL_OR_CMD]&&e.altKey&&e.code===Mt}),Hu=Us({name:"stats",perform(e,t){return{appState:Object.assign(Object.assign({},t),{showStats:!this.checked(t)}),commitToHistory:!1}},checked:e=>e.showStats,contextItemLabel:"stats.title",keyTest:e=>!e[Lt.CTRL_OR_CMD]&&e.altKey&&e.code===kt}),Nu=Us({name:"unbindText",contextItemLabel:"labels.unbindText",perform:(e,t)=>(Ol(_l(e),t).forEach((e=>{const t=Jn(e);if(t){var n;const{width:r,height:i,baseline:o}=Fn(t.originalText,Ut(t));Lr(t,{containerId:null,width:r,height:i,baseline:o,text:t.originalText}),Lr(e,{boundElements:null===(n=e.boundElements)||void 0===n?void 0:n.filter((e=>e.id!==t.id))})}})),{elements:e,appState:t,commitToHistory:!0})}),Bu=(e,t,n)=>{const r=!1;if(!(t.multiElement||t.resizingElement||t.editingElement||t.draggingElement)){const i=n();if(null===i)return{commitToHistory:r};const o=ln(e),a=i.elements,s=ln(a),l=e.filter((e=>!s.has(e.id))),c=a.map((e=>Ar(o.get(e.id)||e,e))).concat(l.map((e=>Ar(e,{isDeleted:!0}))));return Vo(c,l),{elements:c,appState:Object.assign(Object.assign({},t),i.appState),commitToHistory:r,syncHistory:!0}}return{commitToHistory:r}},Fu=(e,t,n)=>{if(!1!==e.trackEvent)try{var r;if(!0===e.trackEvent)tc(e.name,t,"number"==typeof n||"string"==typeof n?String(n):void 0);else null===(r=e.trackEvent)||void 0===r||r.call(e,e,t,n)}catch(e){console.error("error while logging action:",e)}};class Uu{constructor(e,t,n,r){this.actions={},this.renderAction=(e,t)=>{const n=this.app.props.UIOptions.canvasActions;if(this.actions[e]&&"PanelComponent"in this.actions[e]&&(!n||!(e in n)||n[e])){const n=this.actions[e],r=n.PanelComponent,i=e=>{this.updater(n.perform(this.getElementsIncludingDeleted(),this.getAppState(),e,this.app)),Fu(n,"ui",e)};return(0,v.jsx)(r,{elements:this.getElementsIncludingDeleted(),appState:this.getAppState(),updateData:i,appProps:this.app.props,data:t})}return null},this.updater=t=>{if(!t||!("then"in t))return e(t);t.then((t=>e(t)))},this.getAppState=t,this.getElementsIncludingDeleted=n,this.app=r}registerAction(e){this.actions[e.name]=e}registerAll(e){e.forEach((e=>this.registerAction(e)))}handleKeyDown(e){const t=this.app.props.UIOptions.canvasActions,n=Object.values(this.actions).sort(((e,t)=>(t.keyPriority||0)-(e.keyPriority||0))).filter((n=>(!t||!(n.name in t)||t[n.name])&&n.keyTest&&n.keyTest(e,this.getAppState(),this.getElementsIncludingDeleted())));if(1!==n.length)return!1;const r=n[0],{viewModeEnabled:i}=this.getAppState();return!(i&&!Object.values(o.EH).includes(n[0].name))&&(Fu(r,"keyboard",null),e.preventDefault(),this.updater(n[0].perform(this.getElementsIncludingDeleted(),this.getAppState(),null,this.app)),!0)}executeAction(e){this.updater(e.perform(this.getElementsIncludingDeleted(),this.getAppState(),null,this.app)),Fu(e,"api",null)}}const Wu=class{constructor(e){this.libraryCache=null,this.resetLibrary=async()=>{var e,t;await(null===(e=(t=this.app.props).onLibraryChange)||void 0===e?void 0:e.call(t,[])),this.libraryCache=[]},this.restoreLibraryItem=e=>{const t=_l(sd(e.elements,null));return t.length?Object.assign(Object.assign({},e),{elements:t}):null},this.loadLibrary=()=>new Promise((async e=>{if(this.libraryCache)return e(JSON.parse(JSON.stringify(this.libraryCache)));try{const t=this.app.libraryItemsFromStorage;if(!t)return e([]);const n=t.reduce(((e,t)=>(this.restoreLibraryItem(t)&&e.push(t),e)),[]);this.libraryCache=JSON.parse(JSON.stringify(n)),e(n)}catch(t){console.error(t),e([])}})),this.saveLibrary=async e=>{const t=this.libraryCache;try{var n,r;const t=JSON.stringify(e);this.libraryCache=JSON.parse(t),await(null===(n=(r=this.app.props).onLibraryChange)||void 0===n?void 0:n.call(r,e))}catch(e){throw this.libraryCache=t,e}},this.app=e}async importLibrary(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unpublished";const n=await fd(e);if(!n||!n.libraryItems&&!n.library)return;const r=(e,t)=>!e.find((e=>e.elements.length===t.elements.length&&e.elements.every(((e,n)=>e.id===t.elements[n].id&&e.versionNonce===t.elements[n].versionNonce)))),i=await this.loadLibrary(),o=n.libraryItems||n.library||[],a=dd(o,t),s=[];for(const e of a){const t=this.restoreLibraryItem(e);t&&r(i,t)&&s.push(t)}await this.saveLibrary([...s,...i])}},Ku=e=>{const t=Array.from(e.values());return{x:Gu(t,(e=>e.x))/t.length,y:Gu(t,(e=>e.y))/t.length}},Vu=e=>{let[t,n]=e;return Math.hypot(t.x-n.x,t.y-n.y)},Gu=(e,t)=>e.reduce(((e,n)=>e+t(n)),0),Yu=e=>({selectedElementIds:e.selectedElementIds,selectedGroupIds:e.selectedGroupIds,viewBackgroundColor:e.viewBackgroundColor,editingLinearElement:e.editingLinearElement,editingGroupId:e.editingGroupId,name:e.name});const Xu=class{constructor(){this.elementCache=new Map,this.recording=!0,this.stateHistory=[],this.redoStack=[],this.lastEntry=null,this.generateEntry=(e,t)=>this.dehydrateHistoryEntry({appState:Yu(e),elements:t.reduce(((t,n)=>{if(je(n)&&e.multiElement&&e.multiElement.id===n.id){if(e.multiElement&&e.multiElement.id===n.id&&n.points.length<2)return t;t.push(Object.assign(Object.assign({},n),{points:n.lastCommittedPoint!==n.points[n.points.length-1]?n.points.slice(0,-1):n.points}))}else t.push(n);return t}),[])})}hydrateHistoryEntry(e){let{appState:t,elements:n}=e;return{appState:JSON.parse(t),elements:n.map((e=>{var t;const n=null===(t=this.elementCache.get(e.id))||void 0===t?void 0:t.get(e.versionNonce);if(!n)throw new Error("Element not found: ".concat(e.id,":").concat(e.versionNonce));return n}))}}dehydrateHistoryEntry(e){let{appState:t,elements:n}=e;return{appState:JSON.stringify(t),elements:n.map((e=>{this.elementCache.has(e.id)||this.elementCache.set(e.id,new Map);const t=this.elementCache.get(e.id);return t.has(e.versionNonce)||t.set(e.versionNonce,ei(e)),{id:e.id,versionNonce:e.versionNonce}}))}}getSnapshotForTest(){return{recording:this.recording,stateHistory:this.stateHistory.map((e=>this.hydrateHistoryEntry(e))),redoStack:this.redoStack.map((e=>this.hydrateHistoryEntry(e)))}}clear(){this.stateHistory.length=0,this.redoStack.length=0,this.lastEntry=null,this.elementCache.clear()}shouldCreateEntry(e){const{lastEntry:t}=this;if(!t)return!0;if(e.elements.length!==t.elements.length)return!0;for(let n=e.elements.length-1;n>-1;n--){const r=e.elements[n],i=t.elements[n];if(!r||!i||r.id!==i.id||r.versionNonce!==i.versionNonce)return!0}let n;for(n in e.appState){var r,i;if("editingLinearElement"===n)if((null===(r=e.appState[n])||void 0===r?void 0:r.elementId)===(null===(i=t.appState[n])||void 0===i?void 0:i.elementId))continue;if("selectedElementIds"!==n&&"selectedGroupIds"!==n&&e.appState[n]!==t.appState[n])return!0}return!1}pushEntry(e,t){const 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()}}clearRedoStack(){this.redoStack.splice(0,this.redoStack.length)}redoOnce(){if(0===this.redoStack.length)return null;const e=this.redoStack.pop();return void 0!==e?(this.stateHistory.push(e),this.hydrateHistoryEntry(e)):null}undoOnce(){if(1===this.stateHistory.length)return null;const e=this.stateHistory.pop(),t=this.stateHistory[this.stateHistory.length-1];return void 0!==e?(this.redoStack.push(e),this.hydrateHistoryEntry(t)):null}setCurrentState(e,t){this.lastEntry=this.hydrateHistoryEntry(this.generateEntry(e,t))}resumeRecording(){this.recording=!0}record(e,t){this.recording&&(this.pushEntry(e,t),this.recording=!1)}},Zu=[{icon:(0,v.jsx)("svg",{viewBox:"0 0 320 512",className:"",children:(0,v.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:Lt.V},{icon:(0,v.jsx)("svg",{viewBox:"0 0 448 512",children:(0,v.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:Lt.R},{icon:(0,v.jsx)("svg",{viewBox:"0 0 223.646 223.646",children:(0,v.jsx)("path",{d:"M111.823 0L16.622 111.823 111.823 223.646 207.025 111.823z"})}),value:"diamond",key:Lt.D},{icon:(0,v.jsx)("svg",{viewBox:"0 0 512 512",children:(0,v.jsx)("path",{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"})}),value:"ellipse",key:Lt.E},{icon:(0,v.jsx)("svg",{viewBox:"0 0 448 512",className:"rtl-mirror",children:(0,v.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:Lt.A},{icon:(0,v.jsx)("svg",{viewBox:"0 0 6 6",children:(0,v.jsx)("line",{x1:"0",y1:"3",x2:"6",y2:"3",stroke:"currentColor",strokeLinecap:"round"})}),value:"line",key:[Lt.P,Lt.L]},{icon:(0,v.jsx)("svg",{viewBox:"0 0 512 512",children:(0,v.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:[Lt.X,Lt.P.toUpperCase()]},{icon:(0,v.jsx)("svg",{viewBox:"0 0 448 512",children:(0,v.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:Lt.T},{icon:(0,v.jsx)("svg",{viewBox:"0 0 512 512",children:(0,v.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}];n(1292);const qu={cut:[Zt("CtrlOrCmd+X")],copy:[Zt("CtrlOrCmd+C")],paste:[Zt("CtrlOrCmd+V")],copyStyles:[Zt("CtrlOrCmd+Alt+C")],pasteStyles:[Zt("CtrlOrCmd+Alt+V")],selectAll:[Zt("CtrlOrCmd+A")],deleteSelectedElements:[Zt("Del")],duplicateSelection:[Zt("CtrlOrCmd+D"),Zt("Alt+".concat(b("helpDialog.drag")))],sendBackward:[Zt("CtrlOrCmd+[")],bringForward:[Zt("CtrlOrCmd+]")],sendToBack:[Zt(lt?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")],bringToFront:[Zt(lt?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")],copyAsPng:[Zt("Shift+Alt+C")],copyAsSvg:[],group:[Zt("CtrlOrCmd+G")],ungroup:[Zt("CtrlOrCmd+Shift+G")],gridMode:[Zt("CtrlOrCmd+'")],zenMode:[Zt("Alt+Z")],stats:[Zt("Alt+/")],addToLibrary:[],flipHorizontal:[Zt("Shift+H")],flipVertical:[Zt("Shift+V")],viewMode:[Zt("Alt+R")],hyperlink:[Zt("CtrlOrCmd+K")]},$u=e=>{const t=qu[e];return t&&t.length>0?t[0]:""},Qu=e=>{let{options:t,onCloseRequest:n,top:r,left:i,actionManager:o,appState:a,elements:s}=e;return(0,v.jsx)(oa,{onCloseRequest:n,top:r,left:i,fitInViewport:!0,offsetLeft:a.offsetLeft,offsetTop:a.offsetTop,viewportWidth:a.width,viewportHeight:a.height,children:(0,v.jsx)("ul",{className:"context-menu",onContextMenu:e=>e.preventDefault(),children:t.map(((e,t)=>{var r;if("separator"===e)return(0,v.jsx)("hr",{className:"context-menu-option-separator"},t);const i=e.name;let l="";return e.contextItemLabel&&(l="function"==typeof e.contextItemLabel?b(e.contextItemLabel(s,a)):b(e.contextItemLabel)),(0,v.jsx)("li",{"data-testid":i,onClick:n,children:(0,v.jsxs)("button",{className:ye("context-menu-option",{dangerous:"deleteSelectedElements"===i,checkmark:null===(r=e.checked)||void 0===r?void 0:r.call(e,a)}),onClick:()=>o.executeAction(e),children:[(0,v.jsx)("div",{className:"context-menu-option__label",children:l}),(0,v.jsx)("kbd",{className:"context-menu-option__shortcut",children:i?$u(i):""})]})},t)}))})})},Ju=new WeakMap,eh={push(e){const t=Array.of();e.options.forEach((e=>{e&&t.push(e)})),t.length&&(0,st.render)((0,v.jsx)(Qu,{top:e.top,left:e.left,options:t,onCloseRequest:()=>(e=>{const t=Ju.get(e);t&&((0,st.unmountComponentAtNode)(t),t.remove(),Ju.delete(e))})(e.container),actionManager:e.actionManager,appState:e.appState,elements:e.elements}),(e=>{let t=Ju.get(e);return t||(t=document.createElement("div"),e.querySelector(".excalidraw-contextMenuContainer").appendChild(t),Ju.set(e,t),t)})(e.container))}},th=e=>{var t;let{appState:n,elements:r,renderAction:i,elementType:o}=e;const a=Ll(_l(r),n);let s=!1;2===a.length&&(Ae(a[0])||Ae(a[1]))&&(s=!0);const l=Boolean(n.editingElement),c=cp(),d="rtl"===document.documentElement.getAttribute("dir"),u=Ls(o)||a.some((e=>Ls(e.type)&&!rn(e.backgroundColor))),h=Ls(o)||a.some((e=>Ls(e.type)));let p=(null===(t=a[0])||void 0===t?void 0:t.type)||null;for(const e of a)if(e.type!==p){p=null;break}return(0,v.jsxs)("div",{className:"panelColumn",children:[(As(o)&&"image"!==o&&"image"!==p||a.some((e=>As(e.type))))&&i("changeStrokeColor"),h&&i("changeBackgroundColor"),u&&i("changeFillStyle"),(Ps(o)||a.some((e=>Ps(e.type))))&&i("changeStrokeWidth"),("freedraw"===o||a.some((e=>"freedraw"===e.type)))&&i("changeStrokeShape"),(Ds(o)||a.some((e=>Ds(e.type))))&&(0,v.jsxs)(v.Fragment,{children:[i("changeStrokeStyle"),i("changeSloppiness")]}),(zs(o)||a.some((e=>zs(e.type))))&&(0,v.jsx)(v.Fragment,{children:i("changeSharpness")}),(Rs(o)||a.some((e=>Rs(e.type))))&&(0,v.jsxs)(v.Fragment,{children:[i("changeFontSize"),i("changeFontFamily"),i("changeTextAlign")]}),a.some((e=>Ae(e)||Pe(e)))&&i("changeVerticalAlign"),(Hs(o)||a.some((e=>Hs(e.type))))&&(0,v.jsx)(v.Fragment,{children:i("changeArrowhead")}),i("changeOpacity"),(0,v.jsxs)("fieldset",{children:[(0,v.jsx)("legend",{children:b("labels.layers")}),(0,v.jsxs)("div",{className:"buttonList",children:[i("sendToBack"),i("sendBackward"),i("bringToFront"),i("bringForward")]})]}),a.length>1&&!s&&(0,v.jsxs)("fieldset",{children:[(0,v.jsx)("legend",{children:b("labels.align")}),(0,v.jsxs)("div",{className:"buttonList",children:[d?(0,v.jsxs)(v.Fragment,{children:[i("alignRight"),i("alignHorizontallyCentered"),i("alignLeft")]}):(0,v.jsxs)(v.Fragment,{children:[i("alignLeft"),i("alignHorizontallyCentered"),i("alignRight")]}),a.length>2&&i("distributeHorizontally"),(0,v.jsxs)("div",{className:"iconRow",children:[i("alignTop"),i("alignVerticallyCentered"),i("alignBottom"),a.length>2&&i("distributeVertically")]})]})]}),!l&&a.length>0&&(0,v.jsxs)("fieldset",{children:[(0,v.jsx)("legend",{children:b("labels.actions")}),(0,v.jsxs)("div",{className:"buttonList",children:[!c&&i("duplicateSelection"),!c&&i("deleteSelectedElements"),i("group"),i("ungroup"),1===a.length&&i("hyperlink")]})]})]})},nh=e=>{let{canvas:t,elementType:n,setAppState:r,onImageAction:i}=e;return(0,v.jsx)(v.Fragment,{children:Zu.map(((e,o)=>{let{value:a,icon:s,key:l}=e;const c=b("toolBar.".concat(a)),d=l&&("string"==typeof l?l:l[0]),u=d?"".concat(Nt(d)," ").concat(b("helpDialog.or")," ").concat(o+1):"".concat(o+1);return(0,v.jsx)($s,{className:"Shape",type:"radio",icon:s,checked:n===a,name:"editor-current-shape",title:"".concat(Nt(c)," — ").concat(u),keyBindingLabel:"".concat(o+1),"aria-label":Nt(c),"aria-keyshortcuts":u,"data-testid":a,onChange:e=>{let{pointerType:n}=e;r({elementType:a,multiElement:null,selectedElementIds:{}}),Yt(t,a),"image"===a&&i({pointerType:n})}},a)}))})},rh=e=>{let{renderAction:t,zoom:n}=e;return(0,v.jsx)(cu,{gap:1,children:(0,v.jsxs)(lu,{gap:1,align:"center",children:[t("zoomOut"),t("zoomIn"),t("resetZoom")]})})},ih=e=>{let{appState:t,setAppState:n,actionManager:r,showThemeBtn:i}=e;return(0,v.jsxs)("div",{style:{display:"flex"},children:[r.renderAction("changeViewBackgroundColor"),i&&r.renderAction("toggleTheme")]})};n(778);const oh=e=>{let{isCollaborating:t,collaboratorCount:n,onClick:r}=e;return(0,v.jsx)(v.Fragment,{children:(0,v.jsx)($s,{className:ye("CollabButton",{"is-collaborating":t}),onClick:r,icon:Ga,type:"button",title:b("labels.liveCollaboration"),"aria-label":b("labels.liveCollaboration"),showAriaLabel:cp()})})},ah=e=>{let{message:t,onClose:n}=e;const[o,a]=(0,r.useState)(!!t),{container:s}=up(),l=i().useCallback((()=>{a(!1),n&&n(),null==s||s.focus()}),[n,s]);return(0,v.jsx)(v.Fragment,{children:o&&(0,v.jsx)(dl,{small:!0,onCloseRequest:l,title:b("errorDialog.title"),children:(0,v.jsx)("div",{style:{whiteSpace:"pre-wrap"},children:t})})})};n(2205);const sh="filter"in document.createElement("canvas").getContext("2d"),lh=()=>(0,v.jsxs)("div",{children:[(0,v.jsx)("h3",{children:b("canvasError.cannotShowPreview")}),(0,v.jsx)("p",{children:(0,v.jsx)("span",{children:b("canvasError.canvasTooBig")})}),(0,v.jsxs)("em",{children:["(",b("canvasError.canvasTooBigTip"),")"]})]}),ch=(e,t)=>{(0,st.unmountComponentAtNode)(t),t.innerHTML="",e instanceof HTMLCanvasElement?t.appendChild(e):(0,st.render)((0,v.jsx)(lh,{}),t)},dh=e=>{let{children:t,title:n,onClick:r,color:i,shade:o=6}=e;return(0,v.jsx)("button",{className:"ExportDialog-imageExportButton",style:{"--button-color":it[i][o],"--button-color-darker":it[i][o+1],"--button-color-darkest":it[i][o+2]},title:n,"aria-label":n,onClick:r,children:t})},uh=e=>{let{elements:t,appState:n,files:i,exportPadding:a=o.qy,actionManager:s,onExportToPng:l,onExportToSvg:c,onExportToClipboard:d}=e;const u=Tl(t,n),[h,p]=(0,r.useState)(u),g=(0,r.useRef)(null),{exportBackground:m,viewBackgroundColor:f}=n,x=h?Ol(t,n,!0):t;return(0,r.useEffect)((()=>{p(u)}),[u]),(0,r.useEffect)((()=>{const e=g.current;e&&Md(x,n,i,{exportBackground:m,viewBackgroundColor:f,exportPadding:a}).then((t=>bd(t).then((()=>{ch(t,e)})))).catch((t=>{console.error(t),ch(new Xs,e)}))}),[n,i,x,m,a,f]),(0,v.jsxs)("div",{className:"ExportDialog",children:[(0,v.jsx)("div",{className:"ExportDialog__preview",ref:g}),sh&&s.renderAction("exportWithDarkMode"),(0,v.jsx)("div",{style:{display:"grid",gridTemplateColumns:"1fr"},children:(0,v.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(190px, 1fr))",overflow:"hidden"},children:[s.renderAction("changeExportBackground"),u&&(0,v.jsx)(su,{checked:h,onChange:e=>p(e),children:b("labels.onlySelected")}),s.renderAction("changeExportEmbedScene")]})}),(0,v.jsxs)("div",{style:{display:"flex",alignItems:"center",marginTop:".6em"},children:[(0,v.jsx)(lu,{gap:2,children:s.renderAction("changeExportScale")}),(0,v.jsx)("p",{style:{marginLeft:"1em",userSelect:"none"},children:"Scale"})]}),(0,v.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",margin:".6em 0"},children:!Jc&&s.renderAction("changeProjectName")}),(0,v.jsxs)(lu,{gap:2,justifyContent:"center",style:{margin:"2em 0"},children:[(0,v.jsx)(dh,{color:"indigo",title:b("buttons.exportToPng"),"aria-label":b("buttons.exportToPng"),onClick:()=>l(x),children:"PNG"}),(0,v.jsx)(dh,{color:"red",title:b("buttons.exportToSvg"),"aria-label":b("buttons.exportToSvg"),onClick:()=>c(x),children:"SVG"}),Jd&&(0,v.jsx)(dh,{title:b("buttons.copyPngToClipboard"),onClick:()=>d(x),color:"gray",shade:7,children:ka})]})]})},hh=e=>{let{elements:t,appState:n,files:a,exportPadding:s=o.qy,actionManager:l,onExportToPng:c,onExportToSvg:d,onExportToClipboard:u}=e;const[h,p]=(0,r.useState)(!1),g=i().useCallback((()=>{p(!1)}),[]);return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)($s,{onClick:()=>{p(!0)},"data-testid":"image-export-button",icon:Ea,type:"button","aria-label":b("buttons.exportImage"),showAriaLabel:cp(),title:b("buttons.exportImage")}),h&&(0,v.jsx)(dl,{onCloseRequest:g,title:b("buttons.exportImage"),children:(0,v.jsx)(uh,{elements:t,appState:n,files:a,exportPadding:s,actionManager:l,onExportToPng:c,onExportToSvg:d,onExportToClipboard:u,onCloseRequest:g})})]})};n(1310);const ph=e=>{let{children:t,side:n,className:r}=e;return(0,v.jsx)("div",{className:ye("FixedSideContainer","FixedSideContainer_side_".concat(n),r),children:t})};n(7096);const gh=e=>{let{appState:t,elements:n,isMobile:r}=e,i=(e=>{let{appState:t,elements:n,isMobile:r}=e;const{elementType:i,isResizing:o,isRotating:a,lastPointerDownWith:s}=t,l=null!==t.multiElement;if("arrow"===i||"line"===i)return b(l?"hints.linearElementMulti":"hints.linearElement");if("freedraw"===i)return b("hints.freeDraw");if("text"===i)return b("hints.text");if("image"===t.elementType&&t.pendingImageElement)return b("hints.placeImage");const c=Ol(n,t);if(o&&"mouse"===s&&1===c.length){const e=c[0];return je(e)&&2===e.points.length?b("hints.lockAngle"):_e(e)?b("hints.resizeImage"):b("hints.resize")}if(a&&"mouse"===s)return b("hints.rotate");if(1===c.length&&Ce(c[0]))return b("hints.text_selected");if(t.editingElement&&Ce(t.editingElement))return b("hints.text_editing");if("selection"===i){var d;if("selection"===(null===(d=t.draggingElement)||void 0===d?void 0:d.type)&&!t.editingElement&&!t.editingLinearElement)return b("hints.deepBoxSelect");if(!c.length&&!r)return b("hints.canvasPanning")}if(1===c.length){if(je(c[0]))return t.editingLinearElement?t.editingLinearElement.selectedPointsIndices?b("hints.lineEditor_pointSelected"):b("hints.lineEditor_nothingSelected"):b("hints.lineEditor_info");if(Le(c[0]))return b("hints.bindTextToElement")}return null})({appState:t,elements:n,isMobile:r});return i?(i=Zt(i),(0,v.jsx)("div",{className:"HintViewer",children:(0,v.jsx)("span",{children:i})})):null},mh={CHECKED:(0,v.jsx)("svg",{width:"1792",height:"1792",viewBox:"0 0 1792 1792",xmlns:"http://www.w3.org/2000/svg",children:(0,v.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,v.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,v.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"})})},fh=e=>(0,v.jsxs)("label",{className:ye("ToolIcon ToolIcon__lock ToolIcon_type_floating","ToolIcon_size_".concat("medium"),{"is-mobile":e.isMobile}),title:"".concat(e.title," — Q"),children:[(0,v.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title}),(0,v.jsx)("div",{className:"ToolIcon__icon",children:e.checked?mh.CHECKED:mh.UNCHECKED})]});var bh=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const vh=e=>{let{heading:t,children:n}=e,r=bh(e,["heading","children"]);const{id:i}=up(),o=(0,v.jsx)("h2",{className:"visually-hidden",id:"".concat(i,"-").concat(t,"-title"),children:b("headings.".concat(t))});return(0,v.jsx)("section",Object.assign(Object.assign({},r),{"aria-labelledby":"".concat(i,"-").concat(t,"-title"),children:"function"==typeof n?n(o):(0,v.jsxs)(v.Fragment,{children:[o,n]})}))};n(580);const xh=i().memo((e=>{let{className:t,mobile:n,collaborators:r=new Map,layout:i,actionManager:o}=e;const a="vertical"===i?6:3,s=r.size>a?-2*Math.min(r.size-a,15):4;return(0,v.jsx)("div",{className:ye("UserList layout-".concat(i),t,{UserList_mobile:n}),style:{"--itemOffset":"".concat(s,"px")},children:r.size>0&&Array.from(r).filter((e=>{let[t,n]=e;return 0!==Object.keys(n).length})).map((e=>{let[t,r]=e;return n?o.renderAction("goToCollaborator",{id:t}):(0,v.jsx)(al,{label:r.username||"Unknown user",children:o.renderAction("goToCollaborator",{id:t})},t)}))})})),yh=(0,v.jsx)("svg",{viewBox:"0 0 576 512",children:(0,v.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"})}),wh=e=>{let{appState:t,setAppState:n,isMobile:r}=e;return(0,v.jsxs)("label",{className:ye("ToolIcon ToolIcon_type_floating ToolIcon__library","ToolIcon_size_medium",{"is-mobile":r}),title:"".concat(Nt(b("toolBar.library"))," — 0"),children:[(0,v.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:"editor-library",onChange:e=>{n({isLibraryOpen:e.target.checked})},checked:t.isLibraryOpen,"aria-label":Nt(b("toolBar.library")),"aria-keyshortcuts":"0"}),(0,v.jsx)("div",{className:"ToolIcon__icon",children:yh})]})},kh="medium",_h={CHECKED:(0,v.jsxs)("svg",{width:"205",height:"205",viewBox:"0 0 205 205",xmlns:"http://www.w3.org/2000/svg",children:[(0,v.jsx)("path",{d:"m35 195-25-29.17V50h50v115l-25 30"}),(0,v.jsx)("path",{d:"M10 40V10h50v30H10"}),(0,v.jsx)("path",{d:"M125 145h70v50h-70"}),(0,v.jsx)("path",{d:"M190 145v-30l-10-20h-40l-10 20v30h15v-30l5-5h20l5 5v30h15"})]}),UNCHECKED:(0,v.jsxs)("svg",{width:"205",height:"205",viewBox:"0 0 205 205",xmlns:"http://www.w3.org/2000/svg",className:"unlocked-icon rtl-mirror",children:[(0,v.jsx)("path",{d:"m35 195-25-29.17V50h50v115l-25 30"}),(0,v.jsx)("path",{d:"M10 40V10h50v30H10"}),(0,v.jsx)("path",{d:"M125 145h70v50h-70"}),(0,v.jsx)("path",{d:"M145 145v-30l-10-20H95l-10 20v30h15v-30l5-5h20l5 5v30h15"})]})},Ch=e=>e.penDetected?(0,v.jsxs)("label",{className:ye("ToolIcon ToolIcon__penMode ToolIcon_type_floating","ToolIcon_size_".concat(kh),{"is-mobile":e.isMobile}),title:"".concat(e.title),children:[(0,v.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title}),(0,v.jsx)("div",{className:"ToolIcon__icon",children:e.checked?_h.CHECKED:_h.UNCHECKED})]}):e.isMobile?null:(0,v.jsx)("label",{className:ye("ToolIcon ToolIcon__penMode ToolIcon_type_floating","ToolIcon_size_".concat(kh),{"is-mobile":e.isMobile}),children:(0,v.jsx)("div",{className:"ToolIcon__icon ToolIcon__hidden"})}),Eh=e=>{let{onHomeButtonClick:t,appState:n,elements:r,libraryMenu:i,actionManager:o,renderJSONExportDialog:a,renderImageExportDialog:s,setAppState:l,onCollabButtonClick:c,onLockToggle:d,onPenModeToggle:u,canvas:h,isCollaborating:p,renderCustomFooter:g,viewModeEnabled:m,showThemeBtn:f,onImageAction:x,renderTopRightUI:y,UIOptions:w}=e;return(0,v.jsxs)(v.Fragment,{children:[!m&&(0,v.jsxs)(ph,{side:"top",className:"App-top-bar",children:[(0,v.jsx)("div",{}),(0,v.jsx)(vh,{heading:"shapes",children:e=>(0,v.jsxs)(cu,{gap:4,align:"center",children:[(0,v.jsxs)(lu,{gap:1,className:"App-toolbar-container",children:[(0,v.jsxs)(sl,{padding:1,className:"App-toolbar",children:[e,(0,v.jsx)(lu,{gap:1,children:(0,v.jsx)(nh,{canvas:h,elementType:n.elementType,setAppState:l,onImageAction:e=>{let{pointerType:t}=e;x({insertOnCanvasDirectly:"mouse"!==t})}})})]}),(0,v.jsx)($s,{type:"button",className:"HomeButton ToolIcon_type_floating",title:"Home","aria-label":"Home",icon:Os,onClick:t},"home"),(0,v.jsx)(fh,{checked:n.elementLocked,onChange:d,title:b("toolBar.lock"),isMobile:!0}),(0,v.jsx)(wh,{appState:n,setAppState:l,isMobile:!0}),(0,v.jsx)(Ch,{checked:n.penMode,onChange:u,title:b("toolBar.penMode"),isMobile:!0,penDetected:n.penDetected})]}),i]})}),(0,v.jsx)("div",{style:{display:"flex"},children:null==y?void 0:y(!0,n,h)})]}),(0,v.jsx)("div",{className:"App-bottom-bar",style:{marginBottom:14,marginLeft:14,marginRight:14},children:(0,v.jsxs)(sl,{padding:0,children:[w.canvasActions&&"canvas"===n.openMenu?(0,v.jsx)(vh,{className:"App-mobile-menu",heading:"canvasActions",children:(0,v.jsx)("div",{className:"panelColumn",children:(0,v.jsxs)(cu,{gap:4,children:[m?(0,v.jsxs)(v.Fragment,{children:[a(),s()]}):(0,v.jsxs)(v.Fragment,{children:[o.renderAction("clearCanvas"),o.renderAction("loadScene"),a(),s(),c&&(0,v.jsx)(oh,{isCollaborating:p,collaboratorCount:n.collaborators.size,onClick:c}),(0,v.jsx)(ih,{actionManager:o,appState:n,setAppState:l,showThemeBtn:f})]}),null==g?void 0:g(!0,n),n.collaborators.size>0&&(0,v.jsxs)("fieldset",{children:[(0,v.jsx)("legend",{children:b("labels.collaborators")}),(0,v.jsx)(xh,{mobile:!0,layout:"horizontal",collaborators:n.collaborators,actionManager:o})]})]})})}):"shape"===n.openMenu&&!m&&yl(n,r)?(0,v.jsx)(vh,{className:"App-mobile-menu",heading:"selectedShapeActions",children:(0,v.jsx)(th,{appState:n,elements:r,renderAction:o.renderAction,elementType:n.elementType})}):null,(0,v.jsxs)("footer",{className:"App-toolbar",children:[m?w.canvasActions?(0,v.jsx)("div",{className:"App-toolbar-content",children:o.renderAction("toggleCanvasMenu")}):(0,v.jsx)("div",{children:"Excalidraw"}):(0,v.jsxs)("div",{className:"App-toolbar-content",children:[w.canvasActions&&o.renderAction("toggleCanvasMenu"),o.renderAction("toggleEditMenu"),o.renderAction("undo"),o.renderAction("redo"),o.renderAction(n.multiElement?"finalize":"duplicateSelection"),o.renderAction("deleteSelectedElements")]}),n.scrolledOutside&&!n.openMenu&&(0,v.jsx)("button",{className:"scroll-back-to-content",onClick:()=>{l(Object.assign({},tl(r,n)))},children:b("buttons.scrollBackToContent")})]})]})})]})};n(8051);const Sh=e=>{const t=(0,r.useRef)(null),[n,i]=(0,r.useState)(null);return(0,r.useLayoutEffect)((()=>{if(!e.spreadsheet)return;const n=Xd(e.chartType,e.spreadsheet,0,0);let r;i(n);const o=t.current;return(async()=>{r=await Od(n,{exportBackground:!1,viewBackgroundColor:it.white},null),o.appendChild(r),e.selected&&o.parentNode.focus()})(),()=>{o.removeChild(r)}}),[e.spreadsheet,e.chartType,e.selected]),(0,v.jsx)("button",{className:"ChartPreview",onClick:()=>{n&&e.onClick(e.chartType,n)},children:(0,v.jsx)("div",{ref:t})})},jh=e=>{let{setAppState:t,appState:n,onClose:r,onInsertChart:o}=e;const a=i().useCallback((()=>{r&&r()}),[r]),s=(e,n)=>{o(n),tc("magic","chart",e),t({currentChartType:e,pasteDialog:{shown:!1,data:null}})};return(0,v.jsx)(dl,{small:!0,onCloseRequest:a,title:b("labels.pasteCharts"),className:"PasteChartDialog",autofocus:!1,children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(Sh,{chartType:"bar",spreadsheet:n.pasteDialog.data,selected:"bar"===n.currentChartType,onClick:s}),(0,v.jsx)(Sh,{chartType:"line",spreadsheet:n.pasteDialog.data,selected:"line"===n.currentChartType,onClick:s})]})})};n(3922);const Ih=()=>(0,v.jsxs)("div",{className:"HelpDialog--header",children:[(0,v.jsx)("a",{className:"HelpDialog--btn",href:"https://github.com/excalidraw/excalidraw#documentation",target:"_blank",rel:"noopener noreferrer",children:b("helpDialog.documentation")}),(0,v.jsx)("a",{className:"HelpDialog--btn",href:"https://blog.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:b("helpDialog.blog")}),(0,v.jsx)("a",{className:"HelpDialog--btn",href:"https://github.com/excalidraw/excalidraw/issues",target:"_blank",rel:"noopener noreferrer",children:b("helpDialog.github")})]}),Th=e=>(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("h3",{children:e.title}),e.children]}),Mh=e=>(0,v.jsx)("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"space-between"},children:e.children}),Oh=e=>(0,v.jsx)("div",{style:{width:"49%"},children:e.children}),Lh=e=>(0,v.jsxs)("div",{className:"HelpDialog--island",children:[(0,v.jsx)("h3",{className:"HelpDialog--island-title",children:e.caption}),e.children]}),Ah=e=>(0,v.jsx)("div",{className:"HelpDialog--shortcut",children:(0,v.jsxs)("div",{style:{display:"flex",margin:"0",padding:"4px 8px",alignItems:"center"},children:[(0,v.jsx)("div",{style:{lineHeight:1.4},children:e.label}),(0,v.jsx)("div",{style:{display:"flex",flex:"0 0 auto",justifyContent:"flex-end",marginInlineStart:"auto",minWidth:"30%"},children:e.shortcuts.map(((t,n)=>(0,v.jsxs)(i().Fragment,{children:[(0,v.jsx)(Ph,{children:t}),e.isOr&&n!==e.shortcuts.length-1&&b("helpDialog.or")]},n)))})]})});Ah.defaultProps={isOr:!0};const Ph=e=>(0,v.jsx)("kbd",Object.assign({className:"HelpDialog--key"},e)),Dh=e=>{let{onClose:t}=e;const n=i().useCallback((()=>{t&&t()}),[t]);return(0,v.jsx)(v.Fragment,{children:(0,v.jsxs)(dl,{onCloseRequest:n,title:b("helpDialog.title"),className:"HelpDialog",children:[(0,v.jsx)(Ih,{}),(0,v.jsx)(Th,{title:b("helpDialog.shortcuts"),children:(0,v.jsxs)(Mh,{children:[(0,v.jsxs)(Oh,{children:[(0,v.jsxs)(Lh,{caption:b("helpDialog.shapes"),children:[(0,v.jsx)(Ah,{label:b("toolBar.selection"),shortcuts:["V","1"]}),(0,v.jsx)(Ah,{label:b("toolBar.rectangle"),shortcuts:["R","2"]}),(0,v.jsx)(Ah,{label:b("toolBar.diamond"),shortcuts:["D","3"]}),(0,v.jsx)(Ah,{label:b("toolBar.ellipse"),shortcuts:["E","4"]}),(0,v.jsx)(Ah,{label:b("toolBar.arrow"),shortcuts:["A","5"]}),(0,v.jsx)(Ah,{label:b("toolBar.line"),shortcuts:["P","6"]}),(0,v.jsx)(Ah,{label:b("toolBar.freedraw"),shortcuts:["Shift + P","X","7"]}),(0,v.jsx)(Ah,{label:b("toolBar.text"),shortcuts:["T","8"]}),(0,v.jsx)(Ah,{label:b("toolBar.image"),shortcuts:["9"]}),(0,v.jsx)(Ah,{label:b("toolBar.library"),shortcuts:["0"]}),(0,v.jsx)(Ah,{label:b("helpDialog.editSelectedShape"),shortcuts:[Zt("Enter"),b("helpDialog.doubleClick")]}),(0,v.jsx)(Ah,{label:b("helpDialog.textNewLine"),shortcuts:[Zt("Enter"),Zt("Shift+Enter")]}),(0,v.jsx)(Ah,{label:b("helpDialog.textFinish"),shortcuts:[Zt("Esc"),Zt("CtrlOrCmd+Enter")]}),(0,v.jsx)(Ah,{label:b("helpDialog.curvedArrow"),shortcuts:["A",b("helpDialog.click"),b("helpDialog.click"),b("helpDialog.click")],isOr:!1}),(0,v.jsx)(Ah,{label:b("helpDialog.curvedLine"),shortcuts:["L",b("helpDialog.click"),b("helpDialog.click"),b("helpDialog.click")],isOr:!1}),(0,v.jsx)(Ah,{label:b("toolBar.lock"),shortcuts:["Q"]}),(0,v.jsx)(Ah,{label:b("helpDialog.preventBinding"),shortcuts:[Zt("CtrlOrCmd")]}),(0,v.jsx)(Ah,{label:b("toolBar.link"),shortcuts:[Zt("CtrlOrCmd+K")]})]}),(0,v.jsxs)(Lh,{caption:b("helpDialog.view"),children:[(0,v.jsx)(Ah,{label:b("buttons.zoomIn"),shortcuts:[Zt("CtrlOrCmd++")]}),(0,v.jsx)(Ah,{label:b("buttons.zoomOut"),shortcuts:[Zt("CtrlOrCmd+-")]}),(0,v.jsx)(Ah,{label:b("buttons.resetZoom"),shortcuts:[Zt("CtrlOrCmd+0")]}),(0,v.jsx)(Ah,{label:b("helpDialog.zoomToFit"),shortcuts:["Shift+1"]}),(0,v.jsx)(Ah,{label:b("helpDialog.zoomToSelection"),shortcuts:["Shift+2"]}),(0,v.jsx)(Ah,{label:b("buttons.fullScreen"),shortcuts:["F"]}),(0,v.jsx)(Ah,{label:b("buttons.zenMode"),shortcuts:[Zt("Alt+Z")]}),(0,v.jsx)(Ah,{label:b("labels.showGrid"),shortcuts:[Zt("CtrlOrCmd+'")]}),(0,v.jsx)(Ah,{label:b("labels.viewMode"),shortcuts:[Zt("Alt+R")]}),(0,v.jsx)(Ah,{label:b("labels.toggleTheme"),shortcuts:[Zt("Alt+Shift+D")]}),(0,v.jsx)(Ah,{label:b("stats.title"),shortcuts:[Zt("Alt+/")]})]})]}),(0,v.jsx)(Oh,{children:(0,v.jsxs)(Lh,{caption:b("helpDialog.editor"),children:[(0,v.jsx)(Ah,{label:b("labels.selectAll"),shortcuts:[Zt("CtrlOrCmd+A")]}),(0,v.jsx)(Ah,{label:b("labels.multiSelect"),shortcuts:[Zt("Shift+".concat(b("helpDialog.click")))]}),(0,v.jsx)(Ah,{label:b("helpDialog.deepSelect"),shortcuts:[Zt("CtrlOrCmd+".concat(b("helpDialog.click")))]}),(0,v.jsx)(Ah,{label:b("helpDialog.deepBoxSelect"),shortcuts:[Zt("CtrlOrCmd+".concat(b("helpDialog.drag")))]}),(0,v.jsx)(Ah,{label:b("labels.moveCanvas"),shortcuts:[Zt("Space+".concat(b("helpDialog.drag"))),Zt("Wheel+".concat(b("helpDialog.drag")))],isOr:!0}),(0,v.jsx)(Ah,{label:b("labels.cut"),shortcuts:[Zt("CtrlOrCmd+X")]}),(0,v.jsx)(Ah,{label:b("labels.copy"),shortcuts:[Zt("CtrlOrCmd+C")]}),(0,v.jsx)(Ah,{label:b("labels.paste"),shortcuts:[Zt("CtrlOrCmd+V")]}),(0,v.jsx)(Ah,{label:b("labels.copyAsPng"),shortcuts:[Zt("Shift+Alt+C")]}),(0,v.jsx)(Ah,{label:b("labels.copyStyles"),shortcuts:[Zt("CtrlOrCmd+Alt+C")]}),(0,v.jsx)(Ah,{label:b("labels.pasteStyles"),shortcuts:[Zt("CtrlOrCmd+Alt+V")]}),(0,v.jsx)(Ah,{label:b("labels.delete"),shortcuts:[Zt("Del")]}),(0,v.jsx)(Ah,{label:b("labels.sendToBack"),shortcuts:[Zt(lt?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")]}),(0,v.jsx)(Ah,{label:b("labels.bringToFront"),shortcuts:[Zt(lt?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")]}),(0,v.jsx)(Ah,{label:b("labels.sendBackward"),shortcuts:[Zt("CtrlOrCmd+[")]}),(0,v.jsx)(Ah,{label:b("labels.bringForward"),shortcuts:[Zt("CtrlOrCmd+]")]}),(0,v.jsx)(Ah,{label:b("labels.alignTop"),shortcuts:[Zt("CtrlOrCmd+Shift+Up")]}),(0,v.jsx)(Ah,{label:b("labels.alignBottom"),shortcuts:[Zt("CtrlOrCmd+Shift+Down")]}),(0,v.jsx)(Ah,{label:b("labels.alignLeft"),shortcuts:[Zt("CtrlOrCmd+Shift+Left")]}),(0,v.jsx)(Ah,{label:b("labels.alignRight"),shortcuts:[Zt("CtrlOrCmd+Shift+Right")]}),(0,v.jsx)(Ah,{label:b("labels.duplicateSelection"),shortcuts:[Zt("CtrlOrCmd+D"),Zt("Alt+".concat(b("helpDialog.drag")))]}),(0,v.jsx)(Ah,{label:b("buttons.undo"),shortcuts:[Zt("CtrlOrCmd+Z")]}),(0,v.jsx)(Ah,{label:b("buttons.redo"),shortcuts:ct?[Zt("CtrlOrCmd+Y"),Zt("CtrlOrCmd+Shift+Z")]:[Zt("CtrlOrCmd+Shift+Z")]}),(0,v.jsx)(Ah,{label:b("labels.group"),shortcuts:[Zt("CtrlOrCmd+G")]}),(0,v.jsx)(Ah,{label:b("labels.ungroup"),shortcuts:[Zt("CtrlOrCmd+Shift+G")]}),(0,v.jsx)(Ah,{label:b("labels.flipHorizontal"),shortcuts:[Zt("Shift+H")]}),(0,v.jsx)(Ah,{label:b("labels.flipVertical"),shortcuts:[Zt("Shift+V")]}),(0,v.jsx)(Ah,{label:b("labels.showStroke"),shortcuts:[Zt("S")]}),(0,v.jsx)(Ah,{label:b("labels.showBackground"),shortcuts:[Zt("G")]}),(0,v.jsx)(Ah,{label:b("labels.decreaseFontSize"),shortcuts:[Zt("CtrlOrCmd+Shift+<")]}),(0,v.jsx)(Ah,{label:b("labels.increaseFontSize"),shortcuts:[Zt("CtrlOrCmd+Shift+>")]})]})})]})})]})})};n(5080);const zh=e=>{let{children:t,color:n}=e;return(0,v.jsx)("div",{className:"Card",style:{"--card-color":"primary"===n?"var(--color-primary)":it[n][7],"--card-color-darker":"primary"===n?"var(--color-primary-darker)":it[n][8],"--card-color-darkest":"primary"===n?"var(--color-primary-darkest)":it[n][9]},children:t})},Rh=e=>{let{elements:t,appState:n,files:r,actionManager:i,exportOpts:o,canvas:a}=e;const{onExportToBackend:s}=o;return(0,v.jsx)("div",{className:"ExportDialog ExportDialog--json",children:(0,v.jsxs)("div",{className:"ExportDialog-cards",children:[o.saveFileToDisk&&(0,v.jsxs)(zh,{color:"lime",children:[(0,v.jsx)("div",{className:"Card-icon",children:Sa}),(0,v.jsx)("h2",{children:b("exportDialog.disk_title")}),(0,v.jsxs)("div",{className:"Card-details",children:[b("exportDialog.disk_details"),!Jc&&i.renderAction("changeProjectName")]}),(0,v.jsx)($s,{className:"Card-button",type:"button",title:b("exportDialog.disk_button"),"aria-label":b("exportDialog.disk_button"),showAriaLabel:!0,onClick:()=>{i.executeAction(uu)}})]}),s&&(0,v.jsxs)(zh,{color:"pink",children:[(0,v.jsx)("div",{className:"Card-icon",children:va}),(0,v.jsx)("h2",{children:b("exportDialog.link_title")}),(0,v.jsx)("div",{className:"Card-details",children:b("exportDialog.link_details")}),(0,v.jsx)($s,{className:"Card-button",type:"button",title:b("exportDialog.link_button"),"aria-label":b("exportDialog.link_button"),showAriaLabel:!0,onClick:()=>s(t,n,r,a)})]}),o.renderCustomUI&&o.renderCustomUI(t,n,r,a)]})})},Hh=e=>{let{elements:t,appState:n,files:o,actionManager:a,exportOpts:s,canvas:l}=e;const[c,d]=(0,r.useState)(!1),u=i().useCallback((()=>{d(!1)}),[]);return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)($s,{onClick:()=>{"function"==typeof s?a.executeAction(uu):d(!0)},"data-testid":"json-export-button",icon:Sa,type:"button","aria-label":b("buttons.export"),showAriaLabel:cp(),title:b("buttons.export")}),c&&s&&"function"!=typeof s&&(0,v.jsx)(dl,{onCloseRequest:u,title:b("buttons.export"),children:(0,v.jsx)(Rh,{elements:t,appState:n,files:o,actionManager:a,onCloseRequest:u,exportOpts:s,canvas:l})})]})},Nh=e=>{let{elements:t,appState:n,files:r,maxWidthOrHeight:i,getDimensions:o}=e;const{elements:a,appState:s}=cd({elements:t,appState:n},null,null),{exportBackground:l,viewBackgroundColor:c}=s;return Md(_l(a),Object.assign(Object.assign({},s),{offsetTop:0,offsetLeft:0,width:0,height:0}),r||{},{exportBackground:l,viewBackgroundColor:c},((e,t)=>{var n;const r=document.createElement("canvas");if(i){"function"==typeof o&&console.warn("`getDimensions()` is ignored when `maxWidthOrHeight` is supplied.");const n=Math.max(e,t),a=i/n;return r.width=e*a,r.height=t*a,{canvas:r,scale:a}}const a=(null==o?void 0:o(e,t))||{width:e,height:t};return r.width=a.width,r.height=a.height,{canvas:r,scale:null!==(n=a.scale)&&void 0!==n?n:1}}))},Bh=async e=>{var t;let{mimeType:n=o.LO.png,quality:r}=e;n===o.LO.png&&"number"==typeof r&&console.warn('"quality" will be ignored for "'.concat(o.LO.png,'" mimeType')),"image/jpg"===n&&(n=o.LO.jpg),n!==o.LO.jpg||null!==(t=e.appState)&&void 0!==t&&t.exportBackground||(console.warn('Defaulting "exportBackground" to "true" for "'.concat(o.LO.jpg,'" mimeType')),e=Object.assign(Object.assign({},e),{appState:Object.assign(Object.assign({},e.appState),{exportBackground:!0})}));const i=await Nh(e);return r=r||(/image\/jpe?g/.test(n)?.92:.8),new Promise((e=>{i.toBlob((t=>{e(t)}),n,r)}))},Fh=async e=>{let{elements:t,appState:n=hn(),files:r={},exportPadding:i}=e;const{elements:o,appState:a}=cd({elements:t,appState:n},null,null);return Od(_l(o),Object.assign(Object.assign({},a),{exportPadding:i}),r)},Uh=async e=>{const t=await Bh(e);if(!t)throw new Error("couldn't export to blob");await navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])};n(9295),n(9781);const Wh=e=>{let{libItem:t,appState:n,index:i,onChange:o,onRemove:a}=e;const s=(0,r.useRef)(null),l=(0,r.useRef)(null);return(0,r.useEffect)((()=>{const e=s.current;e&&(async()=>{const r=await Fh({elements:t.elements,appState:Object.assign(Object.assign({},n),{viewBackgroundColor:it.white,exportBackground:!0}),files:null});e.innerHTML=r.outerHTML})()}),[t.elements,n]),(0,v.jsxs)("div",{className:"single-library-item",children:[(0,v.jsx)("div",{ref:s,className:"single-library-item__svg"}),(0,v.jsx)($s,{"aria-label":b("buttons.remove"),type:"button",icon:Ya,className:"single-library-item--remove",onClick:a.bind(null,t.id),title:b("buttons.remove")}),(0,v.jsxs)("div",{style:{display:"flex",margin:"0.8rem 0.3rem",width:"100%",fontSize:"14px",fontWeight:500,flexDirection:"column"},children:[(0,v.jsxs)("label",{style:{display:"flex",justifyContent:"space-between",flexDirection:"column"},children:[(0,v.jsxs)("div",{style:{padding:"0.5em 0"},children:[(0,v.jsx)("span",{style:{fontWeight:500,color:it.gray[6]},children:b("publishDialog.itemName")}),(0,v.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,v.jsx)("input",{type:"text",ref:l,style:{width:"80%",padding:"0.2rem"},defaultValue:t.name,placeholder:"Item name",onChange:e=>{o(e.target.value,i)}})]}),(0,v.jsx)("span",{className:"error",children:t.error})]})]})},Kh="publish-library-data",Vh=async e=>{const t=128,n=Math.round(8),r=Math.max(Math.round(2),2),i=((e,t)=>{if(!e.length||t<1)return[];let n=0,r=0;const i=Array(Math.ceil(e.length/t));for(;n<e.length;)i[r++]=e.slice(n,n+=t);return i})(e,6),a=document.createElement("canvas");a.width=i[0].length*t+(i[0].length+1)*(2*n)-2*n,a.height=i.length*t+(i.length+1)*(2*n)-2*n;const s=a.getContext("2d");s.fillStyle=it.white,s.fillRect(0,0,a.width,a.height);for(const[i,o]of e.entries()){const e=await Nh({elements:o.elements,files:null,maxWidthOrHeight:t}),{width:a,height:l}=e,c=Math.floor(i/6)*(t+2*n),d=i%6*(t+2*n);s.drawImage(e,d+(t-a)/2+n,c+(t-l)/2+n),s.lineWidth=r,s.strokeStyle=it.gray[4],s.strokeRect(d+n/2,c+n/2,t+n,t+n)}return await yd(new File([await bd(a)],"preview",{type:o.LO.png}),{outputType:o.LO.jpg,maxWidthOrHeight:5e3})},Gh=e=>{let{onClose:t,libraryItems:n,appState:i,onSuccess:a,onError:s,updateItemsInStorage:l,onRemove:c}=e;const[d,u]=(0,r.useState)({authorName:"",githubHandle:"",name:"",description:"",twitterHandle:"",website:""}),[h,p]=(0,r.useState)(!1);(0,r.useEffect)((()=>{const e=(()=>{try{const e=localStorage.getItem(Kh);if(e)return JSON.parse(e)}catch(e){console.error(e)}return null})();e&&u(e)}),[]);const[g,m]=(0,r.useState)(n.slice());(0,r.useEffect)((()=>{m(n.slice())}),[n]);const f=e=>{u(Object.assign(Object.assign({},d),{[e.target.name]:e.target.value}))},x=(0,r.useCallback)((()=>{l(g),(e=>{try{localStorage.setItem(Kh,JSON.stringify(e))}catch(e){console.error(e)}})(d),t()}),[g,t,l,d]),y=!!n.length;return(0,v.jsx)(dl,{onCloseRequest:x,title:b("publishDialog.title"),className:"publish-library",children:y?(0,v.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),p(!0);const t=[];let n=!1;if(g.forEach((e=>{let r="";e.name||(r=b("publishDialog.errors.required"),n=!0),t.push(Object.assign(Object.assign({},e),{error:r}))})),n)return m(t),void p(!1);const r=await Vh(g),i={type:o.r8.excalidrawLibrary,version:o.Kr.excalidrawLibrary,source:o.pb,libraryItems:g},l=JSON.stringify(i,null,2),c=new Blob([l],{type:"application/json"}),u=new FormData;u.append("excalidrawLib",c),u.append("previewImage",r),u.append("previewImageType",r.type),u.append("title",d.name),u.append("authorName",d.authorName),u.append("githubHandle",d.githubHandle),u.append("name",d.name),u.append("description",d.description),u.append("twitterHandle",d.twitterHandle),u.append("website",d.website),fetch("https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries/submit",{method:"post",body:u}).then((e=>e.ok?e.json().then((e=>{let{url:t}=e;localStorage.removeItem(Kh),a({url:t,authorName:d.authorName,items:g})})):e.json().catch((()=>{throw new Error(e.statusText||"something went wrong")})).then((t=>{throw new Error(t.message||e.statusText||"something went wrong")}))),(e=>{console.error(e),s(e),p(!1)})).catch((e=>{console.error(e),s(e),p(!1)}))},children:[(0,v.jsxs)("div",{className:"publish-library-note",children:[b("publishDialog.noteDescription.pre"),(0,v.jsx)("a",{href:"https://libraries.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:b("publishDialog.noteDescription.link")})," ",b("publishDialog.noteDescription.post")]}),(0,v.jsxs)("span",{className:"publish-library-note",children:[b("publishDialog.noteGuidelines.pre"),(0,v.jsx)("a",{href:"https://github.com/excalidraw/excalidraw-libraries#guidelines",target:"_blank",rel:"noopener noreferrer",children:b("publishDialog.noteGuidelines.link")}),b("publishDialog.noteGuidelines.post")]}),(0,v.jsx)("div",{className:"publish-library-note",children:b("publishDialog.noteItems")}),(()=>{const e=[];return g.forEach(((t,n)=>{e.push((0,v.jsx)("div",{className:"single-library-item-wrapper",children:(0,v.jsx)(Wh,{libItem:t,appState:i,index:n,onChange:(e,t)=>{const n=g.slice();n[t].name=e,m(n)},onRemove:c})},n))})),(0,v.jsx)("div",{className:"selected-library-items",children:e})})(),(0,v.jsxs)("div",{className:"publish-library__fields",children:[(0,v.jsxs)("label",{children:[(0,v.jsxs)("div",{children:[(0,v.jsx)("span",{children:b("publishDialog.libraryName")}),(0,v.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,v.jsx)("input",{type:"text",name:"name",required:!0,value:d.name,onChange:f,placeholder:b("publishDialog.placeholder.libraryName")})]}),(0,v.jsxs)("label",{style:{alignItems:"flex-start"},children:[(0,v.jsxs)("div",{children:[(0,v.jsx)("span",{children:b("publishDialog.libraryDesc")}),(0,v.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,v.jsx)("textarea",{name:"description",rows:4,required:!0,value:d.description,onChange:f,placeholder:b("publishDialog.placeholder.libraryDesc")})]}),(0,v.jsxs)("label",{children:[(0,v.jsxs)("div",{children:[(0,v.jsx)("span",{children:b("publishDialog.authorName")}),(0,v.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,v.jsx)("input",{type:"text",name:"authorName",required:!0,value:d.authorName,onChange:f,placeholder:b("publishDialog.placeholder.authorName")})]}),(0,v.jsxs)("label",{children:[(0,v.jsx)("span",{children:b("publishDialog.githubUsername")}),(0,v.jsx)("input",{type:"text",name:"githubHandle",value:d.githubHandle,onChange:f,placeholder:b("publishDialog.placeholder.githubHandle")})]}),(0,v.jsxs)("label",{children:[(0,v.jsx)("span",{children:b("publishDialog.twitterUsername")}),(0,v.jsx)("input",{type:"text",name:"twitterHandle",value:d.twitterHandle,onChange:f,placeholder:b("publishDialog.placeholder.twitterHandle")})]}),(0,v.jsxs)("label",{children:[(0,v.jsx)("span",{children:b("publishDialog.website")}),(0,v.jsx)("input",{type:"text",name:"website",pattern:"https?://.+",title:b("publishDialog.errors.website"),value:d.website,onChange:f,placeholder:b("publishDialog.placeholder.website")})]}),(0,v.jsxs)("span",{className:"publish-library-note",children:[b("publishDialog.noteLicense.pre"),(0,v.jsx)("a",{href:"https://github.com/excalidraw/excalidraw-libraries/blob/main/LICENSE",target:"_blank",rel:"noopener noreferrer",children:b("publishDialog.noteLicense.link")}),b("publishDialog.noteLicense.post")]})]}),(0,v.jsxs)("div",{className:"publish-library__buttons",children:[(0,v.jsx)($s,{type:"button",title:b("buttons.cancel"),"aria-label":b("buttons.cancel"),label:b("buttons.cancel"),onClick:x,"data-testid":"cancel-clear-canvas-button",className:"publish-library__buttons--cancel"}),(0,v.jsx)($s,{type:"submit",title:b("buttons.submit"),"aria-label":b("buttons.submit"),label:b("buttons.submit"),className:"publish-library__buttons--confirm",isLoading:h})]})]}):(0,v.jsx)("p",{style:{padding:"1em",textAlign:"center",fontWeight:500},children:b("publishDialog.atleastOneLibItem")})})};n(4406);var Yh=n(2891);n(694);const Xh=(0,v.jsx)("svg",{viewBox:"0 0 1792 1792",children:(0,v.jsx)("path",{d:"M1600 736v192c0 26.667-9.33 49.333-28 68-18.67 18.67-41.33 28-68 28h-416v416c0 26.67-9.33 49.33-28 68s-41.33 28-68 28H800c-26.667 0-49.333-9.33-68-28s-28-41.33-28-68v-416H288c-26.667 0-49.333-9.33-68-28-18.667-18.667-28-41.333-28-68V736c0-26.667 9.333-49.333 28-68s41.333-28 68-28h416V224c0-26.667 9.333-49.333 28-68s41.333-28 68-28h192c26.67 0 49.33 9.333 68 28s28 41.333 28 68v416h416c26.67 0 49.33 9.333 68 28s28 41.333 28 68Z",style:{stroke:"#fff",strokeWidth:140},transform:"translate(0 64)"})}),Zh=e=>{let{id:t,elements:n,files:i,isPending:a,onClick:s,selected:l,onToggle:c}=e;const d=(0,r.useRef)(null);(0,r.useEffect)((()=>{const e=d.current;if(e)return(async()=>{if(!n)return;const t=await Od(n,{exportBackground:!1,viewBackgroundColor:it.white},i);e.innerHTML=t.outerHTML})(),()=>{e.innerHTML=""}}),[n,i]);const[u,h]=(0,r.useState)(!1),p=cp(),g=a&&(0,v.jsx)("div",{className:"library-unit__adder",children:Xh});return(0,v.jsxs)("div",{className:ye("library-unit",{"library-unit__active":n,"library-unit--hover":n&&u,"library-unit--selected":l}),onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[(0,v.jsx)("div",{className:ye("library-unit__dragger",{"library-unit__pulse":!!a}),ref:d,draggable:!!n,onClick:n||a?e=>{t&&e.shiftKey?c(t,e):s()}:void 0,onDragStart:e=>{h(!1),e.dataTransfer.setData(o.LO.excalidrawlib,JSON.stringify(n))}}),g,t&&n&&(u||p||l)&&(0,v.jsx)(su,{checked:l,onChange:(e,n)=>c(t,n),className:"library-unit__checkbox"})]})};n(6043);const qh=e=>{let{libraryItems:t,onRemoveFromLibrary:n,onAddToLibrary:i,onInsertShape:a,pendingElements:s,theme:l,setAppState:c,libraryReturnUrl:d,library:u,files:h,id:p,selectedItems:g,onToggle:m,onPublish:f,resetLibrary:x}=e;const y=(0,r.useCallback)((()=>{const e=g.length?b("alerts.removeItemsFromsLibrary",{count:g.length}):b("alerts.resetLibrary"),t=g.length?b("confirmDialog.removeItemsFromLib"):b("confirmDialog.resetLibrary");return(0,v.jsx)(hl,{onConfirm:()=>{g.length?n():x(),k(!1)},onCancel:()=>{k(!1)},title:t,children:(0,v.jsx)("p",{children:e})})}),[g,n,x]),[w,k]=(0,r.useState)(!1),_=cp(),C=_?4:6,E=d||window.location.origin+window.location.pathname,S=g.some((e=>{var n;return"published"===(null===(n=t.find((t=>t.id===e)))||void 0===n?void 0:n.status)})),j=e=>{var t,n,r,i,o;return(0,v.jsx)(cu,{children:(0,v.jsx)(Zh,{elements:null===(t=e.item)||void 0===t?void 0:t.elements,files:h,isPending:!(null!==(n=e.item)&&void 0!==n&&n.id||null===(r=e.item)||void 0===r||!r.elements),onClick:e.onClick||(()=>{}),id:(null===(i=e.item)||void 0===i?void 0:i.id)||null,selected:!(null===(o=e.item)||void 0===o||!o.id)&&g.includes(e.item.id),onToggle:(e,t)=>{m(e,t)}})},e.key)},I=e=>{const t=e.map((e=>e.id?j({item:e,onClick:()=>a(e.elements),key:e.id}):j({key:"__pending__item__",item:e,onClick:()=>i(s)})));let n=(0,Yh.chunk)(t,C);return n.length||(n=[[]]),n.map(((e,t,n)=>(t===n.length-1&&(e=e.concat(new Array(C-e.length).fill(null).map(((e,t)=>j({key:"empty_".concat(t),item:null}))))),(0,v.jsx)(lu,{align:"center",gap:1,children:e},t))))},T=t.filter((e=>"published"===e.status)),M=[...s.length?[{id:null,elements:s}]:[],...t.filter((e=>"published"!==e.status))];return(0,v.jsxs)("div",{className:"library-menu-items-container",children:[w&&y(),(0,v.jsxs)("div",{className:"layer-ui__library-header",children:[(()=>{const e=!!g.length,n=e?t.filter((e=>g.includes(e.id))):t,r=b(e?"buttons.remove":"buttons.resetLibrary");return(0,v.jsxs)("div",{className:"library-actions",children:[(!e||!_)&&(0,v.jsx)($s,{type:"button",title:b("buttons.load"),"aria-label":b("buttons.load"),icon:wa,onClick:()=>{(async e=>{const t=await nd({description:"Excalidraw library files"});await e.importLibrary(t)})(u).then((()=>{c({isLibraryOpen:!1}),c({isLibraryOpen:!0})})).catch(nn).catch((e=>{c({errorMessage:e.message})}))},className:"library-actions--load"},"import"),!!n.length&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)($s,{type:"button",title:b("buttons.export"),"aria-label":b("buttons.export"),icon:Sa,onClick:async()=>{(async e=>{const t={type:o.r8.excalidrawLibrary,version:o.Kr.excalidrawLibrary,source:o.pb,libraryItems:e},n=JSON.stringify(t,null,2);await rd(new Blob([n],{type:o.LO.excalidrawlib}),{name:"library",extension:"excalidrawlib",description:"Excalidraw library file"})})(e?n:await u.loadLibrary()).catch(nn).catch((e=>{c({errorMessage:e.message})}))},className:"library-actions--export",children:g.length>0&&(0,v.jsx)("span",{className:"library-actions-counter",children:g.length})},"export"),(0,v.jsx)($s,{type:"button",title:r,"aria-label":r,icon:_a,onClick:()=>k(!0),className:"library-actions--remove",children:g.length>0&&(0,v.jsx)("span",{className:"library-actions-counter",children:g.length})},"reset")]}),e&&!S&&(0,v.jsx)(al,{label:b("hints.publishLibrary"),children:(0,v.jsxs)($s,{type:"button","aria-label":b("buttons.publishLibrary"),label:b("buttons.publishLibrary"),icon:Ts,className:"library-actions--publish",onClick:f,children:[!_&&(0,v.jsx)("label",{children:b("buttons.publishLibrary")}),g.length>0&&(0,v.jsx)("span",{className:"library-actions-counter",children:g.length})]})})]})})(),(0,v.jsx)("a",{href:"https://libraries.excalidraw.com?target=".concat(window.name||"_blank","&referrer=").concat(E,"&useHash=true&token=").concat(p,"&theme=").concat(l,"&version=").concat(o.Kr.excalidrawLibrary),target:"_excalidraw_libraries",children:b("labels.libraries")})]},"library-header"),(0,v.jsxs)(cu,{className:"library-menu-items-container__items",align:"start",gap:1,children:[(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("div",{className:"separator",children:b("labels.personalLib")}),I(M)]}),(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)("div",{className:"separator",children:[b("labels.excalidrawLib")," "]}),I(T)]})]})]})},$h=(e,t)=>e.filter((e=>t.includes(e.id))),Qh=e=>{let{onClose:t,onInsertShape:n,pendingElements:i,onAddToLibrary:a,theme:s,setAppState:l,files:c,libraryReturnUrl:d,focusContainer:u,library:h,id:p,appState:g}=e;const m=(0,r.useRef)(null);((e,t)=>{(0,r.useEffect)((()=>{const n=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),()=>{document.removeEventListener("pointerdown",n)}}),[e,t])})(m,(e=>{e.target.closest(".ToolIcon__library")||t()})),(0,r.useEffect)((()=>{const e=e=>{e.key===Lt.ESCAPE&&t()};return document.addEventListener(o.Ks.KEYDOWN,e),()=>{document.removeEventListener(o.Ks.KEYDOWN,e)}}),[t]);const[f,x]=(0,r.useState)([]),[y,w]=(0,r.useState)("preloading"),[k,_]=(0,r.useState)([]),[C,E]=(0,r.useState)(!1),[S,j]=(0,r.useState)(null),I=(0,r.useRef)(null);(0,r.useEffect)((()=>(Promise.race([new Promise((e=>{I.current=window.setTimeout((()=>{e("loading")}),100)})),h.loadLibrary().then((e=>{x(e),w("ready")}))]).then((e=>{"loading"===e&&w("loading")})),()=>{clearTimeout(I.current)})),[h]);const T=(0,r.useCallback)((async()=>{const e=await h.loadLibrary(),t=e.filter((e=>!k.includes(e.id)));h.saveLibrary(t).catch((t=>{x(e),l({errorMessage:b("alerts.errorRemovingFromLibrary")})})),_([]),x(t)}),[h,l,k,_]),M=(0,r.useCallback)((()=>{h.resetLibrary(),x([]),u()}),[h,u]),O=(0,r.useCallback)((async e=>{if(e.some((e=>"image"===e.type)))return l({errorMessage:"Support for adding images to the library coming soon!"});const t=await h.loadLibrary(),n=[{status:"unpublished",elements:e,id:Or(),created:Date.now()},...t];a(),h.saveLibrary(n).catch((e=>{x(t),l({errorMessage:b("alerts.errorAddingToLibrary")})})),x(n)}),[a,h,l]),L=(0,r.useCallback)((()=>(0,v.jsxs)(dl,{onCloseRequest:()=>j(null),title:b("publishSuccessDialog.title"),className:"publish-library-success",small:!0,children:[(0,v.jsxs)("p",{children:[b("publishSuccessDialog.content",{authorName:S.authorName})," ",(0,v.jsx)("a",{href:null==S?void 0:S.url,target:"_blank",rel:"noopener noreferrer",children:b("publishSuccessDialog.link")})]}),(0,v.jsx)($s,{type:"button",title:b("buttons.close"),"aria-label":b("buttons.close"),label:b("buttons.close"),onClick:()=>j(null),"data-testid":"publish-library-success-close",className:"publish-library-success-close"})]})),[j,S]),A=(0,r.useCallback)((e=>{E(!1),j({url:e.url,authorName:e.authorName});const t=f.slice();t.forEach((e=>{k.includes(e.id)&&(e.status="published")})),h.saveLibrary(t),x(t)}),[E,j,f,k,h]),[P,D]=(0,r.useState)(null);return"preloading"===y?null:(0,v.jsxs)(sl,{padding:1,ref:m,className:"layer-ui__library",children:[C&&(0,v.jsx)(Gh,{onClose:()=>E(!1),libraryItems:$h(f,k),appState:g,onSuccess:A,onError:e=>window.alert(e),updateItemsInStorage:()=>h.saveLibrary(f),onRemove:e=>_(k.filter((t=>t!==e)))}),S&&L(),"loading"===y?(0,v.jsx)("div",{className:"layer-ui__library-message",children:b("labels.libraryLoadingMessage")}):(0,v.jsx)(qh,{libraryItems:f,onRemoveFromLibrary:T,onAddToLibrary:O,onInsertShape:n,pendingElements:i,setAppState:l,libraryReturnUrl:d,library:h,theme:s,files:c,id:p,selectedItems:k,onToggle:(e,t)=>{if(!k.includes(e)){if(t.shiftKey&&P){const t=f.findIndex((e=>e.id===P)),n=f.findIndex((t=>t.id===e));if(-1===t||-1===n)return void _([...k,e]);const r=ln(k),i=f.reduce(((e,i,o)=>((o>=t&&o<=n||r.has(i.id))&&e.push(i.id),e)),[]);_(i)}else _([...k,e]);D(e)}else D(null),_(k.filter((t=>t!==e)))},onPublish:()=>E(!0),resetLibrary:M})]})};n(3336),n(276);var Jh=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const ep=e=>{let{onHomeButtonClick:t,actionManager:n,appState:i,files:a,setAppState:s,canvas:l,elements:c,onCollabButtonClick:d,onLockToggle:u,onPenModeToggle:h,onInsertElements:p,zenModeEnabled:g,showExitZenModeBtn:m,showThemeBtn:f,toggleZenMode:y,isCollaborating:w,renderTopRightUI:k,renderCustomFooter:_,viewModeEnabled:C,libraryReturnUrl:E,UIOptions:S,focusContainer:j,library:I,id:T,onImageAction:M}=e;const O=cp(),L=()=>S.canvasActions&&S.canvasActions.export?(0,v.jsx)(Hh,{elements:c,appState:i,files:a,actionManager:n,exportOpts:S.canvasActions.export,canvas:l}):null,A=()=>{if(!S.canvasActions||!S.canvasActions.saveAsImage)return null;const e=e=>async t=>{const n=await au(e,t,i,a,{exportBackground:i.exportBackground,name:i.name,viewBackgroundColor:i.viewBackgroundColor}).catch(nn).catch((e=>{console.error(e),s({errorMessage:e.message})}));i.exportEmbedScene&&n&&pd(n)&&s({fileHandle:n})};return(0,v.jsx)(hh,{elements:c,appState:i,files:a,actionManager:n,onExportToPng:e("png"),onExportToSvg:e("svg"),onExportToClipboard:e("clipboard")})},P=(0,r.useCallback)((()=>{!!document.querySelector(".Dialog")||s({isLibraryOpen:!1})}),[s]),D=(0,r.useCallback)((()=>{s({selectedElementIds:{},selectedGroupIds:{}})}),[s]),z=i.isLibraryOpen?(0,v.jsx)(Qh,{pendingElements:Ol(c,i,!0),onClose:P,onInsertShape:p,onAddToLibrary:D,setAppState:s,libraryReturnUrl:E,focusContainer:j,library:I,theme:i.theme,files:a,id:T,appState:i}):null,R=(0,v.jsxs)(v.Fragment,{children:[i.isLoading&&(0,v.jsx)(x,{}),i.errorMessage&&(0,v.jsx)(ah,{message:i.errorMessage,onClose:()=>s({errorMessage:null})}),i.showHelpDialog&&(0,v.jsx)(Dh,{onClose:()=>{s({showHelpDialog:!1})}}),i.pasteDialog.shown&&(0,v.jsx)(jh,{setAppState:s,appState:i,onInsertChart:p,onClose:()=>s({pasteDialog:{shown:!1,data:null}})})]});return O?(0,v.jsxs)(v.Fragment,{children:[R,(0,v.jsx)(Eh,{onHomeButtonClick:t,appState:i,elements:c,actionManager:n,libraryMenu:z,renderJSONExportDialog:L,renderImageExportDialog:A,setAppState:s,onCollabButtonClick:d,onLockToggle:u,onPenModeToggle:h,canvas:l,isCollaborating:w,renderCustomFooter:_,viewModeEnabled:C,showThemeBtn:f,onImageAction:M,renderTopRightUI:k,UIOptions:S})]}):(0,v.jsxs)("div",{className:ye("layer-ui__wrapper",{"disable-pointerEvents":i.draggingElement||i.resizingElement||i.editingElement&&!Ce(i.editingElement)}),children:[R,(()=>{const e=yl(i,c);return(0,v.jsx)(ph,{side:"top",children:(0,v.jsxs)("div",{className:"App-menu App-menu_top",children:[(0,v.jsxs)(cu,{gap:4,className:ye({"disable-pointerEvents":g}),children:[S.canvasActions&&(C?(0,v.jsx)(vh,{heading:"canvasActions",className:ye("zen-mode-transition",{"transition-left":g}),children:(0,v.jsx)(sl,{padding:2,style:{zIndex:1},children:(0,v.jsx)(cu,{gap:4,children:(0,v.jsxs)(lu,{gap:1,justifyContent:"space-between",children:[L(),A()]})})})}):(0,v.jsx)(vh,{heading:"canvasActions",className:ye("zen-mode-transition",{"transition-left":g}),children:(0,v.jsx)(sl,{padding:2,style:{zIndex:1},children:(0,v.jsxs)(cu,{gap:4,children:[(0,v.jsxs)(lu,{gap:3,justifyContent:"space-between",children:[n.renderAction("clearCanvas"),n.renderAction("loadScene"),L(),A(),d&&(0,v.jsx)(oh,{isCollaborating:w,collaboratorCount:i.collaborators.size,onClick:d})]}),(0,v.jsx)(ih,{actionManager:n,appState:i,setAppState:s,showThemeBtn:f}),i.fileHandle&&(0,v.jsx)(v.Fragment,{children:n.renderAction("saveToActiveFile")})]})})})),e&&(0,v.jsx)(vh,{heading:"selectedShapeActions",className:ye("zen-mode-transition",{"transition-left":g}),children:(0,v.jsx)(sl,{className:o.$C.SHAPE_ACTIONS_MENU,padding:2,style:{maxHeight:"".concat(i.height-(i.fileHandle?248:200),"px")},children:(0,v.jsx)(th,{appState:i,elements:c,renderAction:n.renderAction,elementType:i.elementType})})})]}),!C&&(0,v.jsx)(vh,{heading:"shapes",children:e=>(0,v.jsxs)(cu,{gap:4,align:"start",children:[(0,v.jsxs)(lu,{gap:1,className:ye("App-toolbar-container",{"zen-mode":g}),children:[(0,v.jsx)(Ch,{zenModeEnabled:g,checked:i.penMode,onChange:h,title:b("toolBar.penMode"),penDetected:i.penDetected}),(0,v.jsx)(fh,{zenModeEnabled:g,checked:i.elementLocked,onChange:u,title:b("toolBar.lock")}),(0,v.jsxs)(sl,{padding:1,className:ye("App-toolbar",{"zen-mode":g}),children:[(0,v.jsx)(gh,{appState:i,elements:c,isMobile:O}),e,(0,v.jsx)(lu,{gap:1,children:(0,v.jsx)(nh,{canvas:l,elementType:i.elementType,setAppState:s,onImageAction:e=>{let{pointerType:t}=e;M({insertOnCanvasDirectly:"mouse"!==t})}})})]}),(0,v.jsx)(wh,{appState:i,setAppState:s})]}),z]})}),(0,v.jsx)("div",{className:ye("layer-ui__wrapper__top-right zen-mode-transition",{"transition-right":g}),children:null==k?void 0:k(O,i,l)}),(0,v.jsx)(xh,{className:ye("zen-mode-transition",{"transition-right":g}),layout:"vertical",collaborators:i.collaborators,actionManager:n})]})})})(),(0,v.jsxs)("footer",{role:"contentinfo",className:"layer-ui__wrapper__footer App-menu App-menu_bottom",children:[(0,v.jsx)("div",{className:ye("layer-ui__wrapper__footer-left zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":g}),children:(0,v.jsx)(cu,{gap:2,children:(0,v.jsxs)(vh,{heading:"canvasActions",children:[(0,v.jsx)(sl,{padding:1,children:(0,v.jsx)(rh,{renderAction:n.renderAction,zoom:i.zoom})}),!C&&(0,v.jsxs)("div",{className:ye("undo-redo-buttons zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":g}),children:[n.renderAction("undo",{size:"small"}),n.renderAction("redo",{size:"small"})]})]})})}),(0,v.jsx)("div",{className:ye("layer-ui__wrapper__footer-center zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":g}),children:null==_?void 0:_(!1,i)}),(0,v.jsx)("div",{className:ye("layer-ui__wrapper__footer-right zen-mode-transition",{"transition-right disable-pointerEvents":g}),children:n.renderAction("toggleShortcuts")}),(0,v.jsx)("button",{className:ye("disable-zen-mode",{"disable-zen-mode--visible":m}),onClick:y,children:b("buttons.exitZenMode")})]}),i.scrolledOutside&&(0,v.jsx)("button",{className:"scroll-back-to-content",onClick:()=>{s(Object.assign({},tl(c,i)))},children:b("buttons.scrollBackToContent")})]})},tp=(e,t)=>{const n=e=>{const{suggestedBindings:t,startBoundElement:n}=e;return Jh(e,["suggestedBindings","startBoundElement"])},r=n(e.appState),i=n(t.appState),o=Object.keys(r);return e.renderTopRightUI===t.renderTopRightUI&&e.renderCustomFooter===t.renderCustomFooter&&e.langCode===t.langCode&&e.elements===t.elements&&e.files===t.files&&o.every((e=>r[e]===i[e]))},np=i().memo(ep,tp);n(1528);const rp=e=>{var t;const n=cp(),r=et(e.elements),i=Ll(e.elements,e.appState),o=et(i);return n&&e.appState.openMenu?null:(0,v.jsx)("div",{className:"Stats",children:(0,v.jsxs)(sl,{padding:2,children:[(0,v.jsx)("div",{className:"close",onClick:e.onClose,children:Ya}),(0,v.jsx)("h3",{children:b("stats.title")}),(0,v.jsx)("table",{children:(0,v.jsxs)("tbody",{children:[(0,v.jsx)("tr",{children:(0,v.jsx)("th",{colSpan:2,children:b("stats.scene")})}),(0,v.jsxs)("tr",{children:[(0,v.jsx)("td",{children:b("stats.elements")}),(0,v.jsx)("td",{children:e.elements.length})]}),(0,v.jsxs)("tr",{children:[(0,v.jsx)("td",{children:b("stats.width")}),(0,v.jsx)("td",{children:Math.round(r[2])-Math.round(r[0])})]}),(0,v.jsxs)("tr",{children:[(0,v.jsx)("td",{children:b("stats.height")}),(0,v.jsx)("td",{children:Math.round(r[3])-Math.round(r[1])})]}),1===i.length&&(0,v.jsx)("tr",{children:(0,v.jsx)("th",{colSpan:2,children:b("stats.element")})}),i.length>1&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("tr",{children:(0,v.jsx)("th",{colSpan:2,children:b("stats.selected")})}),(0,v.jsxs)("tr",{children:[(0,v.jsx)("td",{children:b("stats.elements")}),(0,v.jsx)("td",{children:i.length})]})]}),i.length>0&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)("tr",{children:[(0,v.jsx)("td",{children:"x"}),(0,v.jsx)("td",{children:Math.round(o[0])})]}),(0,v.jsxs)("tr",{children:[(0,v.jsx)("td",{children:"y"}),(0,v.jsx)("td",{children:Math.round(o[1])})]}),(0,v.jsxs)("tr",{children:[(0,v.jsx)("td",{children:b("stats.width")}),(0,v.jsx)("td",{children:Math.round(o[2]-o[0])})]}),(0,v.jsxs)("tr",{children:[(0,v.jsx)("td",{children:b("stats.height")}),(0,v.jsx)("td",{children:Math.round(o[3]-o[1])})]})]}),1===i.length&&(0,v.jsxs)("tr",{children:[(0,v.jsx)("td",{children:b("stats.angle")}),(0,v.jsx)("td",{children:"".concat(Math.round(180*i[0].angle/Math.PI),"°")})]}),null===(t=e.renderCustomStats)||void 0===t?void 0:t.call(e,e.elements,e.appState)]})})]})})};n(9757);const ip=e=>{let{message:t,clearToast:n}=e;const i=(0,r.useRef)(0),a=(0,r.useCallback)((()=>i.current=window.setTimeout((()=>n()),o.Lg)),[n]);return(0,r.useEffect)((()=>(a(),()=>clearTimeout(i.current))),[a,t]),(0,v.jsx)("div",{className:"Toast",onMouseEnter:()=>clearTimeout(null==i?void 0:i.current),onMouseLeave:a,children:(0,v.jsx)("p",{className:"Toast__message",children:t})})},op=Us({name:"viewMode",perform(e,t){return tc("view","mode","view"),{appState:Object.assign(Object.assign({},t),{viewModeEnabled:!this.checked(t)}),commitToHistory:!1}},checked:e=>e.viewModeEnabled,contextItemLabel:"labels.viewMode",keyTest:e=>!e[Lt.CTRL_OR_CMD]&&e.altKey&&e.code===Ot});var ap=n(200),sp=n.n(ap);const lp=i().createContext(!1),cp=()=>(0,r.useContext)(lp),dp=i().createContext({container:null,id:null}),up=()=>(0,r.useContext)(dp);let hp=!1,pp=0,gp=0,mp=0,fp=!1,bp=!1,vp=!1,xp={horizontal:null,vertical:null},yp=0,wp=!1,kp=null;const _p={pointers:new Map,lastCenter:null,initialDistance:null,initialScale:null};class Cp extends i().Component{constructor(e){super(e),Ep.call(this);const t=hn(),{excalidrawRef:n,viewModeEnabled:r=!1,zenModeEnabled:i=!1,gridModeEnabled:a=!1,theme:s=t.theme,name:l=t.name}=e;if(this.state=Object.assign(Object.assign(Object.assign(Object.assign({},t),{theme:s,isLoading:!0}),this.getCanvasOffsets()),{viewModeEnabled:r,zenModeEnabled:i,gridSize:a?o.k:null,name:l,width:window.innerWidth,height:window.innerHeight,showHyperlinkPopup:!1}),this.id=we(),n){var c;const e="current"in n&&(null===(c=n.current)||void 0===c?void 0:c.readyPromise)||(()=>{let e,t;const n=new Promise(((n,r)=>{e=n,t=r}));return n.resolve=e,n.reject=t,n})(),t={ready:!0,readyPromise:e,updateScene:this.updateScene,addFiles:this.addFiles,resetScene:this.resetScene,getSceneElementsIncludingDeleted:this.getSceneElementsIncludingDeleted,history:{clear:this.resetHistory},scrollToContent:this.scrollToContent,getSceneElements:this.getSceneElements,getAppState:()=>this.state,getFiles:()=>this.files,refresh:this.refresh,importLibrary:this.importLibraryFromUrl,setToastMessage:this.setToastMessage,id:this.id,app:this};"function"==typeof n?n(t):n.current=t,e.resolve(t)}var d;this.excalidrawContainerValue={container:this.excalidrawContainerRef.current,id:this.id},this.scene=new Rn,this.library=new Wu(this),this.history=new Xu,this.actionManager=new Uu(this.syncActionResult,(()=>this.state),(()=>this.scene.getElementsIncludingDeleted()),this),this.actionManager.registerAll(Fs),this.actionManager.registerAction((d=this.history,{name:"undo",perform:(e,t)=>Bu(e,t,(()=>d.undoOnce())),keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.key.toLowerCase()===Lt.Z&&!e.shiftKey,PanelComponent:e=>{let{updateData:t,data:n}=e;return(0,v.jsx)($s,{type:"button",icon:Oa,"aria-label":b("buttons.undo"),onClick:t,size:(null==n?void 0:n.size)||"medium"})},commitToHistory:()=>!1})),this.actionManager.registerAction((e=>({name:"redo",perform:(t,n)=>Bu(t,n,(()=>e.redoOnce())),keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.shiftKey&&e.key.toLowerCase()===Lt.Z||ct&&e.ctrlKey&&!e.shiftKey&&e.key===Lt.Y,PanelComponent:e=>{let{updateData:t,data:n}=e;return(0,v.jsx)($s,{type:"button",icon:La,"aria-label":b("buttons.redo"),onClick:t,size:(null==n?void 0:n.size)||"medium"})},commitToHistory:()=>!1}))(this.history))}renderCanvas(){const e=window.devicePixelRatio,{width:t,height:n,viewModeEnabled:r}=this.state,i=t*e,a=n*e;return r?(0,v.jsx)("canvas",{className:"excalidraw__canvas",style:{width:t,height:n,cursor:o.oc.GRAB},width:i,height:a,ref:this.handleCanvasRef,onContextMenu:this.handleCanvasContextMenu,onPointerMove:this.handleCanvasPointerMove,onPointerUp:this.handleCanvasPointerUp,onPointerCancel:this.removePointer,onTouchMove:this.handleTouchMove,onPointerDown:this.handleCanvasPointerDown,children:b("labels.drawingCanvas")}):(0,v.jsx)("canvas",{className:"excalidraw__canvas",style:{width:t,height:n},width:i,height:a,ref:this.handleCanvasRef,onContextMenu:this.handleCanvasContextMenu,onPointerDown:this.handleCanvasPointerDown,onDoubleClick:this.handleCanvasDoubleClick,onPointerMove:this.handleCanvasPointerMove,onPointerUp:this.handleCanvasPointerUp,onPointerCancel:this.removePointer,onTouchMove:this.handleTouchMove,children:b("labels.drawingCanvas")})}render(){var e,t;const{zenModeEnabled:n,viewModeEnabled:r}=this.state,i=Ol(this.scene.getElements(),this.state),{onCollabButtonClick:o,renderTopRightUI:a,renderFooter:s,renderCustomStats:l}=this.props;return(0,v.jsx)("div",{className:ye("excalidraw excalidraw-container",{"excalidraw--zen-mode":n,"excalidraw--view-mode":r,"excalidraw--mobile":this.isMobile}),ref:this.excalidrawContainerRef,onDrop:this.handleAppOnDrop,tabIndex:0,onKeyDown:this.props.handleKeyboardGlobally?void 0:this.onKeyDown,children:(0,v.jsx)(dp.Provider,{value:this.excalidrawContainerValue,children:(0,v.jsxs)(lp.Provider,{value:this.isMobile,children:[(0,v.jsx)(np,{onHomeButtonClick:this.props.onHomeButtonClick,canvas:this.canvas,appState:this.state,files:this.files,setAppState:this.setAppState,actionManager:this.actionManager,elements:this.scene.getElements(),onCollabButtonClick:o,onLockToggle:this.toggleLock,onPenModeToggle:this.togglePenMode,onInsertElements:e=>this.addElementsFromPasteOrLibrary({elements:e,position:"center",files:null}),zenModeEnabled:n,toggleZenMode:this.toggleZenMode,langCode:m().code,isCollaborating:this.props.isCollaborating,renderTopRightUI:a,renderCustomFooter:s,viewModeEnabled:r,showExitZenModeBtn:void 0===(null===(e=this.props)||void 0===e?void 0:e.zenModeEnabled)&&n,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,v.jsx)("div",{className:"excalidraw-textEditorContainer"}),(0,v.jsx)("div",{className:"excalidraw-contextMenuContainer"}),1===i.length&&this.state.showHyperlinkPopup&&(0,v.jsx)(sc,{element:i[0],appState:this.state,setAppState:this.setAppState,onLinkOpen:this.props.onLinkOpen},i[0].id),this.state.showStats&&(0,v.jsx)(rp,{appState:this.state,setAppState:this.setAppState,elements:this.scene.getElements(),onClose:this.toggleStats,renderCustomStats:l}),null!==this.state.toastMessage&&(0,v.jsx)(ip,{message:this.state.toastMessage,clearToast:this.clearToast}),(0,v.jsx)("main",{children:this.renderCanvas()})]})})})}async componentDidMount(){var e,t,n=this;if(this.unmounted=!1,this.excalidrawContainerValue.container=this.excalidrawContainerRef.current,"production"===o.Vi.TEST||"production"===o.Vi.DEVELOPMENT){this.setState.bind(this);Object.defineProperties(window.h,{state:{configurable:!0,get:()=>this.state},setState:{configurable:!0,value:function(){return n.setState(...arguments)}},app:{configurable:!0,value:this},history:{configurable:!0,value:this.history}})}if(this.scene.addCallback(this.onSceneUpdated),this.addEventListeners(),this.excalidrawContainerRef.current&&this.focusContainer(),"ResizeObserver"in window&&null!==(e=this.excalidrawContainerRef)&&void 0!==e&&e.current)this.resizeObserver=new ResizeObserver((()=>{const{width:e,height:t}=this.excalidrawContainerRef.current.getBoundingClientRect();this.isMobile=e<o.kV||t<o.Yx&&e<o.sS,this.updateDOMRect()})),null===(t=this.resizeObserver)||void 0===t||t.observe(this.excalidrawContainerRef.current);else if(window.matchMedia){const e=window.matchMedia("(max-width: ".concat(o.kV,"px), (max-height: ").concat(o.Yx,"px) and (max-width: ").concat(o.sS,"px)")),t=()=>this.isMobile=e.matches;e.addListener(t),this.detachIsMobileMqHandler=()=>e.removeListener(t)}new URLSearchParams(window.location.search.slice(1)).has("web-share-target")?this.restoreFileFromShare():this.updateDOMRect(this.initializeScene)}componentWillUnmount(){var e;this.files={},this.imageCache.clear(),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.unmounted=!0,this.removeEventListeners(),this.scene.destroy(),ur=new WeakMap,hr=new WeakMap,_r=new WeakMap,this.scene=new Rn,this.history=new Xu,this.actionManager=new Uu(this.syncActionResult,(()=>this.state),(()=>this.scene.getElementsIncludingDeleted()),this),this.library=new Wu(this),this.canvas=null,this.rc=null,this.excalidrawContainerRef.current=void 0,this.nearestScrollableContainer=void 0,this.excalidrawContainerValue={container:null,id:"unmounted"},clearTimeout(yp),yp=0}removeEventListeners(){var e,t,n,r,i,a;document.removeEventListener(o.Ks.POINTER_UP,this.removePointer),document.removeEventListener(o.Ks.COPY,this.onCopy),document.removeEventListener(o.Ks.PASTE,this.pasteFromClipboard),document.removeEventListener(o.Ks.CUT,this.onCut),null===(e=this.nearestScrollableContainer)||void 0===e||e.removeEventListener(o.Ks.SCROLL,this.onScroll),document.removeEventListener(o.Ks.KEYDOWN,this.onKeyDown,!1),document.removeEventListener(o.Ks.MOUSE_MOVE,this.updateCurrentCursorPosition,!1),document.removeEventListener(o.Ks.KEYUP,this.onKeyUp),window.removeEventListener(o.Ks.RESIZE,this.onResize,!1),window.removeEventListener(o.Ks.UNLOAD,this.onUnload,!1),window.removeEventListener(o.Ks.BLUR,this.onBlur,!1),null===(t=this.excalidrawContainerRef.current)||void 0===t||t.removeEventListener(o.Ks.DRAG_OVER,this.disableEvent,!1),null===(n=this.excalidrawContainerRef.current)||void 0===n||n.removeEventListener(o.Ks.DROP,this.disableEvent,!1),null===(r=document.fonts)||void 0===r||null===(i=r.removeEventListener)||void 0===i||i.call(r,"loadingdone",this.onFontLoaded),document.removeEventListener(o.Ks.GESTURE_START,this.onGestureStart,!1),document.removeEventListener(o.Ks.GESTURE_CHANGE,this.onGestureChange,!1),document.removeEventListener(o.Ks.GESTURE_END,this.onGestureEnd,!1),null===(a=this.detachIsMobileMqHandler)||void 0===a||a.call(this)}addEventListeners(){var e,t,n,r;this.removeEventListeners(),document.addEventListener(o.Ks.POINTER_UP,this.removePointer),document.addEventListener(o.Ks.COPY,this.onCopy),this.props.handleKeyboardGlobally&&document.addEventListener(o.Ks.KEYDOWN,this.onKeyDown,!1),document.addEventListener(o.Ks.KEYUP,this.onKeyUp,{passive:!0}),document.addEventListener(o.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(o.Ks.GESTURE_START,this.onGestureStart,!1),document.addEventListener(o.Ks.GESTURE_CHANGE,this.onGestureChange,!1),document.addEventListener(o.Ks.GESTURE_END,this.onGestureEnd,!1),this.state.viewModeEnabled||(document.addEventListener(o.Ks.PASTE,this.pasteFromClipboard),document.addEventListener(o.Ks.CUT,this.onCut),this.props.detectScroll&&(this.nearestScrollableContainer=(e=>{let t=e.parentElement;for(;t;){if(t===document.body)return document;const{overflowY:e}=window.getComputedStyle(t);if(t.scrollHeight>t.clientHeight&&("auto"===e||"scroll"===e||"overlay"===e))return t;t=t.parentElement}return document})(this.excalidrawContainerRef.current),this.nearestScrollableContainer.addEventListener(o.Ks.SCROLL,this.onScroll)),window.addEventListener(o.Ks.RESIZE,this.onResize,!1),window.addEventListener(o.Ks.UNLOAD,this.onUnload,!1),window.addEventListener(o.Ks.BLUR,this.onBlur,!1),null===(n=this.excalidrawContainerRef.current)||void 0===n||n.addEventListener(o.Ks.DRAG_OVER,this.disableEvent,!1),null===(r=this.excalidrawContainerRef.current)||void 0===r||r.addEventListener(o.Ks.DROP,this.disableEvent,!1))}componentDidUpdate(e,t){var n;"selection"===t.elementType&&"selection"!==this.state.elementType&&this.state.showHyperlinkPopup&&this.setState({showHyperlinkPopup:!1}),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?o.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((()=>{this.actionManager.executeAction(Ql)}));const{multiElement:r}=t;t.elementType!==this.state.elementType&&null!=r&&yo(this.state)&&Te(r)&&Eo(r,this.state,this.scene,tn(vo.getPointAtIndexGlobalCoordinates(r,-1)));const i={},a={},s={},l={},c={};this.state.collaborators.forEach(((e,t)=>{if(e.selectedElementIds)for(const n of Object.keys(e.selectedElementIds))n in s||(s[n]=[]),s[n].push(t);e.pointer&&(e.username&&(l[t]=e.username),e.userState&&(c[t]=e.userState),a[t]=$t({sceneX:e.pointer.x,sceneY:e.pointer.y},this.state),i[t]=e.button)}));const d=this.scene.getElements().filter((e=>(!_e(e)||!this.state.pendingImageElement||e.id!==this.state.pendingImageElement.id)&&(!this.state.editingElement||"text"!==this.state.editingElement.type||e.id!==this.state.editingElement.id))),{atLeastOneVisibleElement:u,scrollBars:h}=wc(d,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:a,remotePointerButton:i,remoteSelectedElementIds:s,remotePointerUsernames:l,remotePointerUserStates:c,shouldCacheIgnoreZoom:this.state.shouldCacheIgnoreZoom,theme:this.state.theme,imageCache:this.imageCache,isExporting:!1,renderScrollbars:!this.isMobile});h&&(xp=h);const p=!Ce(this.state.editingElement)&&(!u&&d.length>0);var g,m;(this.state.scrolledOutside!==p&&this.setState({scrolledOutside:p}),this.history.record(this.state,this.scene.getElementsIncludingDeleted()),this.scheduleImageRefresh(),this.state.isLoading)||(null===(g=(m=this.props).onChange)||void 0===g||g.call(m,this.scene.getElementsIncludingDeleted(),this.state,this.files,this.props.id))}static resetTapTwice(){hp=!1}addTextFromPaste(e){const{x:t,y:n}=qt({clientX:gp,clientY:mp},this.state),r=$r({x:t,y:n,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:o.hs});this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),r]),this.setState({selectedElementIds:{[r.id]:!0}}),this.history.resumeRecording()}selectShapeTool(e){var t;fp||Yt(this.canvas,e),(t=document.activeElement)instanceof HTMLElement&&t.className.includes("ToolIcon")&&this.focusContainer(),Ie(e)||this.setState({suggestedBindings:[]}),"image"===e&&this.onImageAction(),"selection"!==e?this.setState({elementType:e,selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}):this.setState({elementType:e})}handleTextWysiwyg(e,t){let{isExistingElement:n=!1}=t;const r=(t,n,r)=>{this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted().map((i=>i.id===e.id&&Ce(i)?Qr(i,{text:t,isDeleted:r,originalText:n}):i))])};xl({id:e.id,canvas:this.canvas,getViewportCoords:(e,t)=>{const{x:n,y:r}=$t({sceneX:e,sceneY:t},this.state);return[n-this.state.offsetLeft,r-this.state.offsetTop]},onChange:on((t=>{r(t,t,!1),Cl(e)&&Ao(e)})),onSubmit:on((t=>{let{text:i,viaKeyboard:o,originalText:a}=t;const s=!i.trim();if(r(i,a,s),!s&&o){const t=e.containerId?e.containerId:e.id;this.setState((e=>({selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[t]:!0})})))}s&&Vo(this.scene.getElements(),[e]),s&&!n||this.history.resumeRecording(),this.setState({draggingElement:null,editingElement:null}),this.state.elementLocked&&Yt(this.canvas,this.state.elementType),this.focusContainer()})),element:e,excalidrawContainer:this.excalidrawContainerRef.current,app:this}),this.deselectElements(),r(e.text,e.originalText,!1)}deselectElements(){this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})}getTextElementAtPosition(e,t){const n=this.getElementAtPosition(e,t,{includeBoundTextElement:!0});return n&&Ce(n)&&!n.isDeleted?n:null}getElementAtPosition(e,t,n){const r=this.getElementsAtPosition(e,t,null==n?void 0:n.includeBoundTextElement);if(r.length>1){if(null!=n&&n.preferSelected)for(let e=r.length-1;e>-1;e--)if(this.state.selectedElementIds[r[e].id])return r[e];const i=r[r.length-1];return Ai(i,this.state,e,t)?r[r.length-2]:i}return 1===r.length?r[0]:null}getElementsAtPosition(e,t){return((e,t)=>e.filter((e=>!e.isDeleted&&t(e))))(arguments.length>2&&void 0!==arguments[2]&&arguments[2]?this.scene.getElements():this.scene.getElements().filter((e=>!(Ce(e)&&e.containerId))),(n=>((e,t,n,r)=>{const i=10/t.zoom.value,o=[n,r];return Di(t,e)?zi(e,o,i):Pi(e,t,o)})(n,this.state,e,t)))}maybeCleanupAfterMissingPointerUp(e){null!==kp&&kp(e)}updateGestureOnPointerDown(e){_p.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),2===_p.pointers.size&&(_p.lastCenter=Ku(_p.pointers),_p.initialScale=this.state.zoom.value,_p.initialDistance=Vu(Array.from(_p.pointers.values())))}initialPointerDownState(e){const t=qt(e,this.state),n=Ol(this.scene.getElements(),this.state),[r,i,o,a]=et(n);return{origin:t,withCmdOrCtrl:e[Lt.CTRL_OR_CMD],originInGrid:tn(Ke(t.x,t.y,this.state.gridSize)),scrollbars:Il(xp,e.clientX-this.state.offsetLeft,e.clientY-this.state.offsetTop),lastCoords:Object.assign({},t),originalElements:this.scene.getElements().reduce(((e,t)=>(e.set(t.id,ei(t)),e)),new Map),resize:{handleType:!1,isResizing:!1,offset:{x:0,y:0},arrowDirection:"origin",center:{x:(o+r)/2,y:(a+i)/2}},hit:{element:null,allHitElements:[],wasAddedToSelection:!1,hasBeenDuplicated:!1,hasHitCommonBoundingBoxOfSelectedElements:this.isHittingCommonBoundingBoxOfSelectedElements(t,n),hasHitElementInside:!1},drag:{hasOccurred:!1,offset:null},eventListeners:{onMove:null,onUp:null,onKeyUp:null,onKeyDown:null},boxSelection:{hasOccurred:!1}}}handleDraggingScrollBar(e,t){if(!t.scrollbars.isOverEither||this.state.multiElement)return!1;vp=!0,t.lastCoords.x=e.clientX,t.lastCoords.y=e.clientY;const n=an((e=>{e.target instanceof HTMLElement&&this.handlePointerMoveOverScrollbars(e,t)})),r=on((()=>{vp=!1,Yt(this.canvas,this.state.elementType),kp=null,this.setState({cursorButton:"up"}),this.savePointer(e.clientX,e.clientY,"up"),window.removeEventListener(o.Ks.POINTER_MOVE,n),window.removeEventListener(o.Ks.POINTER_UP,r),n.flush()}));return kp=r,window.addEventListener(o.Ks.POINTER_MOVE,n),window.addEventListener(o.Ks.POINTER_UP,r),!0}isASelectedElement(e){return null!=e&&this.state.selectedElementIds[e.id]}isHittingCommonBoundingBoxOfSelectedElements(e,t){if(t.length<2)return!1;const n=10/this.state.zoom.value,[r,i,o,a]=et(t);return e.x>r-n&&e.x<o+n&&e.y>i-n&&e.y<a+n}onKeyDownFromPointerDownHandler(e){return on((t=>{this.maybeHandleResize(e,t)||this.maybeDragNewGenericElement(e,t)}))}onKeyUpFromPointerDownHandler(e){return on((t=>{t.key===Lt.ALT&&t.preventDefault(),this.maybeHandleResize(e,t)||this.maybeDragNewGenericElement(e,t)}))}onPointerMoveFromPointerDownHandler(e){return an((t=>{var n,r;null===e.drag.offset&&(e.drag.offset=tn(((e,t,n)=>{const[r,i]=et(e);return[t-r,n-i]})(Ol(this.scene.getElements(),this.state),e.origin.x,e.origin.y)));if(!(t.target instanceof HTMLElement))return;if(this.handlePointerMoveOverScrollbars(t,e))return;const i=qt(t,this.state),[a,s]=Ke(i.x,i.y,this.state.gridSize);if(!e.drag.hasOccurred&&("arrow"===this.state.elementType||"line"===this.state.elementType)&&He(i.x,i.y,e.origin.x,e.origin.y)<o.f)return;if(e.resize.isResizing&&(e.lastCoords.x=i.x,e.lastCoords.y=i.y,this.maybeHandleResize(e,t)))return!0;if(this.state.editingLinearElement){if(vo.handlePointDragging(this.state,(e=>this.setState(e)),i.x,i.y,((e,t)=>{this.maybeSuggestBindingsForLinearElementAtCoords(e,t)})))return e.lastCoords.x=i.x,void(e.lastCoords.y=i.y)}if((e.hit.allHitElements.some((e=>this.isASelectedElement(e)))||e.hit.hasHitCommonBoundingBoxOfSelectedElements)&&(!this.state.editingLinearElement||!t.shiftKey)&&(!this.state.editingLinearElement||(null===(n=this.state.editingLinearElement)||void 0===n?void 0:n.elementId)!==(null===(r=e.hit.element)||void 0===r?void 0:r.id)||e.hit.hasHitElementInside)){e.drag.hasOccurred=!0;const n=Ol(this.scene.getElements(),this.state);if(n.length>0&&!e.withCmdOrCtrl){const[r,o]=Ke(i.x-e.drag.offset.x,i.y-e.drag.offset.y,this.state.gridSize),[a,s]=[Math.abs(i.x-e.origin.x),Math.abs(i.y-e.origin.y)],l=t.shiftKey;if(function(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7?arguments[7]:void 0;const[l,c]=et(t),d={x:n-l,y:r-c};t.forEach((n=>{if(na(i,o,a,e,n,d),!n.groupIds.length||s.editingGroupId&&!Nr(s,n)){const t=Jn(n);t&&na(i,o,a,e,t,d)}Ao(n,{simultaneouslyUpdated:t})}))}(e,n,r,o,l,a,s,this.state),this.maybeSuggestBindingForAll(n),t.altKey&&!e.hit.hasBeenDuplicated){e.hit.hasBeenDuplicated=!0;const t=[],n=[],i=new Map,a=new Map,s=e.hit.element,l=this.scene.getElementsIncludingDeleted(),c=Ol(l,this.state,!0).map((e=>e.id));for(const d of l)if(c.includes(d.id)||d.id===(null==s?void 0:s.id)&&e.hit.wasAddedToSelection){const s=ti(this.state.editingGroupId,i,d),[l,c]=Ke(e.origin.x-e.drag.offset.x,e.origin.y-e.drag.offset.y,this.state.gridSize);Lr(s,{x:s.x+(l-r),y:s.y+(c-o)}),t.push(s),n.push(d),a.set(d.id,s.id)}else t.push(d);const d=[...t,...n];Nn(t,n,a),Wo(d,n,a,"duplicatesServeAsOld"),this.scene.replaceAllElements(d)}return}}const l=this.state.draggingElement;if(l){if("freedraw"===l.type){const e=l.points,n=i.x-l.x,r=i.y-l.y,o=e.length>0&&e[e.length-1];if(!(o&&o[0]===n&&o[1]===r)){const i=l.simulatePressure?l.pressures:[...l.pressures,t.pressure];Lr(l,{points:[...e,[n,r]],pressures:i})}}else if(je(l)){e.drag.hasOccurred=!0;const n=l.points;let r=a-l.x,o=s-l.y;zt(t)&&2===n.length&&({width:r,height:o}=zr(this.state.elementType,r,o)),1===n.length?Lr(l,{points:[...n,[r,o]]}):n.length>1&&Lr(l,{points:[...n.slice(0,-1),[r,o]]}),Te(l)&&this.maybeSuggestBindingsForLinearElementAtCoords(l,[i],this.state.startBoundElement)}else e.lastCoords.x=i.x,e.lastCoords.y=i.y,this.maybeDragNewGenericElement(e,t);if("selection"===this.state.elementType){e.boxSelection.hasOccurred=!0;const n=this.scene.getElements();if(t.shiftKey||this.state.editingLinearElement||!Tl(n,this.state)||(e.withCmdOrCtrl&&e.hit.element?this.setState((t=>Ur(Object.assign(Object.assign({},t),{selectedElementIds:{[e.hit.element.id]:!0}}),this.scene.getElements()))):this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})),this.state.editingLinearElement)vo.handleBoxSelection(t,this.state,this.setState.bind(this));else{const t=((e,t)=>{const[n,r,i,o]=Ye(t);return e.filter((e=>{const[t,a,s,l]=Je(e);return"selection"!==e.type&&!Pe(e)&&n<=t&&r<=a&&i>=s&&o>=l}))})(n,l);this.setState((n=>Ur(Object.assign(Object.assign({},n),{selectedElementIds:Object.assign(Object.assign(Object.assign({},n.selectedElementIds),t.reduce(((e,t)=>(e[t.id]=!0,e)),{})),e.hit.element?{[e.hit.element.id]:!t.length}:null),showHyperlinkPopup:!(1!==t.length||!t[0].link)&&"info"}),this.scene.getElements())))}}}}))}handlePointerMoveOverScrollbars(e,t){if(t.scrollbars.isOverHorizontal){const 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){const n=e.clientY,r=n-t.lastCoords.y;return this.setState({scrollY:this.state.scrollY-r/this.state.zoom.value}),t.lastCoords.y=n,!0}return!1}onPointerUpFromPointerDownHandler(e){return on((t=>{const{draggingElement:n,resizingElement:r,multiElement:i,elementType:a,elementLocked:s,isResizing:l,isRotating:c}=this.state;var d,u;if(this.setState({isResizing:!1,isRotating:!1,resizingElement:null,selectionElement:null,cursorButton:"up",editingElement:i||Ce(this.state.editingElement)?this.state.editingElement:null}),this.savePointer(t.clientX,t.clientY,"up"),this.state.editingLinearElement)if(e.boxSelection.hasOccurred||(null===(d=e.hit)||void 0===d||null===(u=d.element)||void 0===u?void 0:u.id)===this.state.editingLinearElement.elementId&&e.hit.hasHitElementInside){const e=vo.handlePointerUp(t,this.state.editingLinearElement,this.state);e!==this.state.editingLinearElement&&this.setState({editingLinearElement:e,suggestedBindings:[]})}else this.actionManager.executeAction(Ql);if(kp=null,e.eventListeners.onMove&&e.eventListeners.onMove.flush(),window.removeEventListener(o.Ks.POINTER_MOVE,e.eventListeners.onMove),window.removeEventListener(o.Ks.POINTER_UP,e.eventListeners.onUp),window.removeEventListener(o.Ks.KEYDOWN,e.eventListeners.onKeyDown),window.removeEventListener(o.Ks.KEYUP,e.eventListeners.onKeyUp),this.state.pendingImageElement&&this.setState({pendingImageElement:null}),"freedraw"===(null==n?void 0:n.type)){const e=qt(t,this.state),r=n.points;let i=e.x-n.x,o=e.y-n.y;i===r[0][0]&&o===r[0][1]&&(o+=1e-4,i+=1e-4);const a=n.simulatePressure?[]:[...n.pressures,t.pressure];return Lr(n,{points:[...r,[i,o]],pressures:a,lastCommittedPoint:[i,o]}),void this.actionManager.executeAction(Ql)}if(_e(n)){const e=n;try{this.initializeImageDimensions(e),this.setState({selectedElementIds:{[e.id]:!0}},(()=>{this.actionManager.executeAction(Ql)}))}catch(t){console.error(t),this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().filter((t=>t.id!==e.id))),this.actionManager.executeAction(Ql)}return}if(je(n)){n.points.length>1&&this.history.resumeRecording();const r=qt(t,this.state);return void(e.drag.hasOccurred||!n||i?e.drag.hasOccurred&&!i&&(yo(this.state)&&Te(n)&&Eo(n,this.state,this.scene,r),this.setState({suggestedBindings:[],startBoundElement:null}),s?this.setState((e=>({draggingElement:null,selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[this.state.draggingElement.id]:!0})}))):(Vt(this.canvas),this.setState((e=>({draggingElement:null,elementType:"selection",selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[this.state.draggingElement.id]:!0})}))))):(Lr(n,{points:[...n.points,[r.x-n.x,r.y-n.y]]}),this.setState({multiElement:n,editingElement:this.state.draggingElement})))}if("selection"!==a&&n&&Dr(n))return this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().slice(0,-1)),void this.setState({draggingElement:null});n&&Lr(n,Rr(n)),r&&this.history.resumeRecording(),r&&Dr(r)&&this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().filter((e=>e.id!==r.id)));const h=e.hit.element;if(h&&!e.drag.hasOccurred&&!e.hit.wasAddedToSelection&&(!this.state.editingLinearElement||!e.boxSelection.hasOccurred))if(t.shiftKey&&!this.state.editingLinearElement)if(this.state.selectedElementIds[h.id])if(Nr(this.state,h)){const e=h.groupIds.flatMap((e=>Kr(this.scene.getElements(),e))).map((e=>({[e.id]:!1}))).reduce(((e,t)=>Object.assign(Object.assign({},e),t)),{});this.setState((t=>({selectedGroupIds:Object.assign(Object.assign({},t.selectedElementIds),h.groupIds.map((e=>({[e]:!1}))).reduce(((e,t)=>Object.assign(Object.assign({},e),t)),{})),selectedElementIds:Object.assign(Object.assign({},t.selectedElementIds),e)})))}else this.setState((e=>Ur(Object.assign(Object.assign({},e),{selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[h.id]:!1})}),this.scene.getElements())));else this.setState((e=>({selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[h.id]:!0})})));else this.setState((e=>Object.assign({},Ur(Object.assign(Object.assign({},e),{selectedElementIds:{[h.id]:!0}}),this.scene.getElements()))));this.state.editingLinearElement||e.drag.hasOccurred||this.state.isResizing||!(h&&Ai(h,this.state,e.origin.x,e.origin.y)||!h&&e.hit.hasHitCommonBoundingBoxOfSelectedElements)?(!s&&"freedraw"!==a&&n&&this.setState((e=>({selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[n.id]:!0})}))),("selection"!==a||Tl(this.scene.getElements(),this.state))&&this.history.resumeRecording(),(e.drag.hasOccurred||l||c)&&(yo(this.state)?_o:To)(Ol(this.scene.getElements(),this.state)),s||"freedraw"===a?this.setState({draggingElement:null,suggestedBindings:[]}):(Vt(this.canvas),this.setState({draggingElement:null,suggestedBindings:[],elementType:"selection"}))):this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})}))}maybeSuggestBindingForAll(e){const t=(e=>{const t=new Set(e.map((e=>{let{id:t}=e;return t})));return e.flatMap((e=>Te(e)?Ho(e).filter((e=>!t.has(e.id))):Oe(e)?Fo(e).filter((e=>!t.has(e[0].id))):[]))})(e);this.setState({suggestedBindings:t})}clearSelection(e){this.setState((t=>({selectedElementIds:{},selectedGroupIds:{},editingGroupId:t.editingGroupId&&null!=e&&Wr(e,t.editingGroupId)?t.editingGroupId:null}))),this.setState({selectedElementIds:{},previousSelectedElementIds:this.state.selectedElementIds})}getTextWysiwygSnappedToCenterPosition(e,t,n,r,i){const a=Bs(this.scene.getElementsIncludingDeleted().filter((e=>!Ce(e))),e,t);if(a){const r=a.x+a.width/2,i=a.y+a.height/2;if(Math.hypot(e-r,t-i)<o.wZ){const{x:e,y:t}=$t({sceneX:r,sceneY:i},n);return{viewportX:e,viewportY:t,elementCenterX:r,elementCenterY:i}}}}getCanvasOffsets(){var e;if(null!==(e=this.excalidrawContainerRef)&&void 0!==e&&e.current){const e=this.excalidrawContainerRef.current,{left:t,top:n}=e.getBoundingClientRect();return{offsetLeft:t,offsetTop:n}}return{offsetLeft:0,offsetTop:0}}async updateLanguage(){const e=d.find((e=>e.code===this.props.langCode))||c;await g(e),this.setAppState({})}}Cp.defaultProps={UIOptions:o.cW};var Ep=function(){var e=this;this.canvas=null,this.rc=null,this.unmounted=!1,this.isMobile=!1,this.excalidrawContainerRef=i().createRef(),this.files={},this.imageCache=new Map,this.lastPointerDown=null,this.lastPointerUp=null,this.contextMenuOpen=!1,this.focusContainer=()=>{var e;this.props.autoFocus&&(null===(e=this.excalidrawContainerRef.current)||void 0===e||e.focus())},this.getSceneElementsIncludingDeleted=()=>this.scene.getElementsIncludingDeleted(),this.getSceneElements=()=>this.scene.getElements(),this.syncActionResult=on((e=>{if(this.contextMenuOpen=!1,this.unmounted||!1===e)return;let t=null;if(e.elements&&(e.elements.forEach((e=>{var n;(null===(n=this.state.editingElement)||void 0===n?void 0:n.id)===e.id&&this.state.editingElement!==e&&Cl(e)&&(t=e)})),this.scene.replaceAllElements(e.elements),e.commitToHistory&&this.history.resumeRecording()),e.files&&(this.files=e.replaceFiles?e.files:Object.assign(Object.assign({},this.files),e.files),this.addNewImagesToImageCache()),e.appState||t){var n,r,i,a,s,l;e.commitToHistory&&this.history.resumeRecording();let c=(null==e||null===(n=e.appState)||void 0===n?void 0:n.viewModeEnabled)||!1,d=(null==e||null===(r=e.appState)||void 0===r?void 0:r.zenModeEnabled)||!1,u=(null==e||null===(i=e.appState)||void 0===i?void 0:i.gridSize)||null,h=(null==e||null===(a=e.appState)||void 0===a?void 0:a.theme)||o.C6.LIGHT,p=null!==(s=null==e||null===(l=e.appState)||void 0===l?void 0:l.name)&&void 0!==s?s:this.state.name;void 0!==this.props.viewModeEnabled&&(c=this.props.viewModeEnabled),void 0!==this.props.zenModeEnabled&&(d=this.props.zenModeEnabled),void 0!==this.props.gridModeEnabled&&(u=this.props.gridModeEnabled?o.k:null),void 0!==this.props.theme&&(h=this.props.theme),void 0!==this.props.name&&(p=this.props.name),this.setState((n=>{var r;return Object.assign(e.appState||{},{editingElement:t||(null===(r=e.appState)||void 0===r?void 0:r.editingElement)||null,viewModeEnabled:c,zenModeEnabled:d,gridSize:u,theme:h,name:p})}),(()=>{e.syncHistory&&this.history.setCurrentState(this.state,this.scene.getElementsIncludingDeleted())}))}})),this.onBlur=on((()=>{fp=!1,this.setState({isBindingEnabled:!0})})),this.onUnload=()=>{this.onBlur()},this.disableEvent=e=>{e.preventDefault()},this.onFontLoaded=()=>{this.scene.getElementsIncludingDeleted().forEach((e=>{Ce(e)&&mr(e)})),this.onSceneUpdated()},this.importLibraryFromUrl=async(e,t)=>{if(window.location.hash.includes(o.ah.addLibrary)){const e=new URLSearchParams(window.location.hash.slice(1));e.delete(o.ah.addLibrary),window.history.replaceState({},o.iC,"#".concat(e.toString()))}else if(window.location.search.includes(o.UO.addLibrary)){const e=new URLSearchParams(window.location.search);e.delete(o.UO.addLibrary),window.history.replaceState({},o.iC,"?".concat(e.toString()))}try{const n=await fetch(decodeURIComponent(e)),r=await n.blob(),i=JSON.parse(await r.text());if(!(e=>"object"==typeof e&&e&&e.type===o.r8.excalidrawLibrary&&(1===e.version||2===e.version))(i))throw new Error;(t===this.id||window.confirm(b("alerts.confirmAddLibrary",{numShapes:(i.libraryItems||i.library||[]).length})))&&(await this.library.importLibrary(r,"published"),this.state.isLibraryOpen&&this.setState({isLibraryOpen:!1}),this.setState({isLibraryOpen:!0}))}catch(e){window.alert(b("alerts.errorLoadingLibrary")),console.error(e)}finally{this.focusContainer()}},this.resetHistory=()=>{this.history.clear()},this.resetScene=on((e=>{this.scene.replaceAllElements([]),this.setState((t=>Object.assign(Object.assign({},hn()),{isLoading:(null==e||!e.resetLoadingState)&&t.isLoading,theme:this.state.theme}))),this.resetHistory()})),this.initializeScene=async()=>{var e,t,n;"launchQueue"in window&&"LaunchParams"in window&&window.launchQueue.setConsumer((async e=>{if(!e.files.length)return;const t=e.files[0],n=await t.getFile();n.handle=t,md(n,this.state,this.scene.getElementsIncludingDeleted()).then((e=>{this.syncActionResult(Object.assign(Object.assign({},e),{appState:Object.assign(Object.assign({},e.appState||this.state),{isLoading:!1}),commitToHistory:!0}))})).catch((e=>{this.setState({isLoading:!1,errorMessage:e.message})}))})),this.state.isLoading||this.setState({isLoading:!0});let r=null;try{var i;r=await this.props.initialData||null,null!==(i=r)&&void 0!==i&&i.libraryItems&&(this.libraryItemsFromStorage=dd(r.libraryItems,"unpublished"))}catch(e){console.error(e),r={appState:{errorMessage:e.message||"Encountered an error during importing or restoring scene data"}}}const a=cd(r,null,null);a.appState=Object.assign(Object.assign({},a.appState),{elementType:"image"===a.appState.elementType?"selection":a.appState.elementType,isLoading:!1}),null!==(e=r)&&void 0!==e&&e.scrollToContent&&(a.appState=Object.assign(Object.assign({},a.appState),tl(a.elements,Object.assign(Object.assign({},a.appState),{width:this.state.width,height:this.state.height,offsetTop:this.state.offsetTop,offsetLeft:this.state.offsetLeft})))),null!=(null===(t=r)||void 0===t?void 0:t.scrollX)&&(a.appState.scrollX=r.scrollX),null!=(null===(n=r)||void 0===n?void 0:n.scrollY)&&(a.appState.scrollY=r.scrollY),this.resetHistory(),this.syncActionResult(Object.assign(Object.assign({},a),{commitToHistory:!0}));const s=new URLSearchParams(window.location.hash.slice(1)).get(o.ah.addLibrary)||new URLSearchParams(window.location.search).get(o.UO.addLibrary);s&&await this.importLibraryFromUrl(s)},this.onResize=on((()=>{this.scene.getElementsIncludingDeleted().forEach((e=>mr(e))),this.setState({})})),this.onScroll=Wt((()=>{const{offsetTop:e,offsetLeft:t}=this.getCanvasOffsets();this.setState((n=>n.offsetLeft===t&&n.offsetTop===e?null:{offsetTop:e,offsetLeft:t}))}),o.HM),this.onCut=on((e=>{var t;(null===(t=this.excalidrawContainerRef.current)||void 0===t?void 0:t.contains(document.activeElement))&&!Bt(e.target)&&(this.cutAll(),e.preventDefault())})),this.onCopy=on((e=>{var t;(null===(t=this.excalidrawContainerRef.current)||void 0===t?void 0:t.contains(document.activeElement))&&!Bt(e.target)&&(this.copyAll(),e.preventDefault())})),this.cutAll=()=>{this.copyAll(),this.actionManager.executeAction(Pl)},this.copyAll=()=>{eu(this.scene.getElements(),this.state,this.files)},this.onTapStart=e=>{if(dt||e.preventDefault(),!hp)return hp=!0,clearTimeout(pp),void(pp=window.setTimeout(Cp.resetTapTwice,o.Gj));if(hp&&1===e.touches.length){const[t]=e.touches;this.handleCanvasDoubleClick({clientX:t.clientX,clientY:t.clientY}),hp=!1,clearTimeout(pp)}dt&&e.preventDefault(),2===e.touches.length&&this.setState({selectedElementIds:{}})},this.onTapEnd=e=>{this.resetContextMenuTimer(),e.touches.length>0?this.setState({previousSelectedElementIds:{},selectedElementIds:this.state.previousSelectedElementIds}):_p.pointers.clear()},this.pasteFromClipboard=on((async e=>{var t,n;const r=document.activeElement;if(!(null===(t=this.excalidrawContainerRef.current)||void 0===t?void 0:t.contains(r)))return;const i=document.elementFromPoint(gp,mp);if(e&&(!(i instanceof HTMLCanvasElement)||Bt(r)))return;let o=null==e||null===(n=e.clipboardData)||void 0===n?void 0:n.files[0];const a=await ru(e);if(!o&&a.text){const e=a.text.trim();e.startsWith("<svg")&&e.endsWith("</svg>")&&(o=wd(e))}if(gd(o)&&!a.spreadsheet){const{x:e,y:t}=qt({clientX:gp,clientY:mp},this.state),n=this.createImageElement({sceneX:e,sceneY:t});return this.insertImageElement(n,o),this.initializeImageDimensions(n),void this.setState({selectedElementIds:{[n.id]:!0}})}if(this.props.onPaste)try{if(!1===await this.props.onPaste(a,e))return}catch(e){console.error(e)}a.errorMessage?this.setState({errorMessage:a.errorMessage}):a.spreadsheet?this.setState({pasteDialog:{data:a.spreadsheet,shown:!0}}):a.elements?this.addElementsFromPasteOrLibrary({elements:a.elements,files:a.files||null,position:"cursor"}):a.text&&this.addTextFromPaste(a.text),this.selectShapeTool("selection"),null==e||e.preventDefault()})),this.addElementsFromPasteOrLibrary=e=>{const t=sd(e.elements,null),[n,r,i,o]=et(t),a=Kt(n,i)/2,s=Kt(r,o)/2,l="object"==typeof e.position?e.position.clientX:"cursor"===e.position?gp:this.state.width/2+this.state.offsetLeft,c="object"==typeof e.position?e.position.clientY:"cursor"===e.position?mp:this.state.height/2+this.state.offsetTop,{x:d,y:u}=qt({clientX:l,clientY:c},this.state),h=d-a,p=u-s,g=new Map,[m,f]=Ke(h,p,this.state.gridSize),b=new Map,v=t.map((e=>{const t=ti(this.state.editingGroupId,g,e,{x:e.x+m-n,y:e.y+f-r});return b.set(e.id,t.id),t}));Nn(v,t,b);const x=[...this.scene.getElementsIncludingDeleted(),...v];Wo(x,t,b),e.files&&(this.files=Object.assign(Object.assign({},this.files),e.files)),this.scene.replaceAllElements(x),this.history.resumeRecording(),this.setState(Ur(Object.assign(Object.assign({},this.state),{isLibraryOpen:!1,selectedElementIds:v.reduce(((e,t)=>(Pe(t)||(e[t.id]=!0),e)),{}),selectedGroupIds:{}}),this.scene.getElements()),(()=>{e.files&&this.addNewImagesToImageCache()})),this.selectShapeTool("selection")},this.setAppState=e=>{this.setState(e)},this.removePointer=e=>{yp&&this.resetContextMenuTimer(),_p.pointers.delete(e.pointerId)},this.toggleLock=()=>{this.setState((e=>({elementLocked:!e.elementLocked,elementType:e.elementLocked?"selection":e.elementType})))},this.togglePenMode=()=>{this.setState((e=>({penMode:!e.penMode})))},this.toggleZenMode=()=>{this.actionManager.executeAction(Ru)},this.toggleStats=()=>{this.state.showStats||tc("dialog","stats"),this.actionManager.executeAction(Hu)},this.scrollToContent=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.scene.getElements();e.setState(Object.assign({},tl(Array.isArray(t)?t:[t],e.state,e.canvas)))},this.clearToast=()=>{this.setState({toastMessage:null})},this.setToastMessage=e=>{this.setState({toastMessage:e})},this.restoreFileFromShare=async()=>{try{const e=await caches.open("web-share-target"),t=await e.match("shared-file");if(t){const n=await t.blob();this.loadFileToCanvas(n),await e.delete("shared-file"),window.history.replaceState(null,o.iC,window.location.pathname)}}catch(e){this.setState({errorMessage:e.message})}},this.addFiles=on((e=>{const t=e.reduce(((e,t)=>(e.set(t.id,t),e)),new Map);this.files=Object.assign(Object.assign({},this.files),Object.fromEntries(t)),this.scene.getElements().forEach((e=>{ke(e)&&t.has(e.fileId)&&(this.imageCache.delete(e.fileId),mr(e))})),this.scene.informMutation(),this.addNewImagesToImageCache()})),this.updateScene=on((e=>{e.commitToHistory&&this.history.resumeRecording(),e.appState&&this.setState(e.appState),e.elements&&this.scene.replaceAllElements(e.elements),e.collaborators&&this.setState({collaborators:e.collaborators}),e.libraryItems&&this.library.saveLibrary(dd(e.libraryItems,"unpublished"))})),this.onSceneUpdated=()=>{this.setState({})},this.updateCurrentCursorPosition=on((e=>{gp=e.clientX,mp=e.clientY})),this.onKeyDown=on((e=>{var t;if(("Proxy"in window&&(!e.shiftKey&&/^[A-Z]$/.test(e.key)||e.shiftKey&&/^[a-z]$/.test(e.key))&&(e=new Proxy(e,{get(t,n){const r=t[n];return"function"==typeof r?r.bind(t):"key"===n?e.shiftKey?t.key.toUpperCase():t.key.toLowerCase():r}})),!(Bt(e.target)&&e.key!==Lt.ESCAPE||At(e.key)&&(t=e.target,t instanceof HTMLElement&&"wysiwyg"===t.dataset.type||t instanceof HTMLBRElement||t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement)))&&(e.key===Lt.QUESTION_MARK&&this.setState({showHelpDialog:!0}),!this.actionManager.handleKeyDown(e)&&!this.state.viewModeEnabled)){if(e[Lt.CTRL_OR_CMD]&&this.state.isBindingEnabled&&this.setState({isBindingEnabled:!1}),e.code===wt&&this.setState({isLibraryOpen:!this.state.isLibraryOpen}),At(e.key)){const t=this.state.gridSize&&(e.shiftKey?o.$e:this.state.gridSize)||(e.shiftKey?o.Iw:o.$e),n=Ol(this.scene.getElements(),this.state,!0);let r=0,i=0;e.key===Lt.ARROW_LEFT?r=-t:e.key===Lt.ARROW_RIGHT?r=t:e.key===Lt.ARROW_UP?i=-t:e.key===Lt.ARROW_DOWN&&(i=t),n.forEach((e=>{Lr(e,{x:e.x+r,y:e.y+i}),Ao(e,{simultaneouslyUpdated:n})})),this.maybeSuggestBindingForAll(n),e.preventDefault()}else if(e.key===Lt.ENTER){const t=Ol(this.scene.getElements(),this.state);if(1===t.length&&je(t[0]))this.state.editingLinearElement&&this.state.editingLinearElement.elementId===t[0].id||(this.history.resumeRecording(),this.setState({editingLinearElement:new vo(t[0],this.scene)}));else if(1===t.length&&!je(t[0])){const n=t[0];return this.startTextEditing({sceneX:n.x+n.width/2,sceneY:n.y+n.height/2,shouldBind:!0}),void e.preventDefault()}}else if(!e.ctrlKey&&!e.altKey&&!e.metaKey&&null===this.state.draggingElement){const t=(e=>{const t=Zu.find(((t,n)=>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})(e.key);t?this.selectShapeTool(t):e.key===Lt.Q&&this.toggleLock()}if(e.key===Lt.SPACE&&0===_p.pointers.size&&(fp=!0,Gt(this.canvas,o.oc.GRABBING),e.preventDefault()),e.key===Lt.G||e.key===Lt.S){const t=Ol(this.scene.getElements(),this.state);if("selection"===this.state.elementType&&!t.length)return;e.key===Lt.G&&(Ls(this.state.elementType)||t.some((e=>Ls(e.type))))&&this.setState({openPopup:"backgroundColorPicker"}),e.key===Lt.S&&this.setState({openPopup:"strokeColorPicker"})}}})),this.onKeyUp=on((e=>{if(e.key===Lt.SPACE&&(this.state.viewModeEnabled?Gt(this.canvas,o.oc.GRAB):"selection"===this.state.elementType?Vt(this.canvas):(Yt(this.canvas,this.state.elementType),this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})),fp=!1),e[Lt.CTRL_OR_CMD]||this.state.isBindingEnabled||this.setState({isBindingEnabled:!0}),At(e.key)){const e=Ol(this.scene.getElements(),this.state);yo(this.state)?_o(e):To(e),this.setState({suggestedBindings:[]})}})),this.onGestureStart=on((e=>{e.preventDefault(),this.setState({selectedElementIds:{}}),_p.initialScale=this.state.zoom.value})),this.onGestureChange=on((e=>{if(e.preventDefault(),_p.pointers.size>=2)return;const t=_p.initialScale;t&&this.setState((n=>Object.assign({},rl({viewportX:gp,viewportY:mp,nextZoom:nl(t*e.scale)},n))))})),this.onGestureEnd=on((e=>{e.preventDefault(),this.setState({previousSelectedElementIds:{},selectedElementIds:this.state.previousSelectedElementIds}),_p.initialScale=null})),this.startTextEditing=e=>{var t,n,r,i,a;let{sceneX:s,sceneY:l,shouldBind:c,insertAtParentCenter:d=!0}=e,u=d&&this.getTextWysiwygSnappedToCenterPosition(s,l,this.state,this.canvas,window.devicePixelRatio),h=null,p=null;const g=Ol(this.scene.getElements(),this.state);if(1===g.length&&(Ce(g[0])?h=g[0]:Le(g[0])&&(p=g[0],h=Jn(p))),h=null!==(t=h)&&void 0!==t?t:this.getTextElementAtPosition(s,l),p||h||!c&&!u||(p=Bs(this.scene.getElements().filter((e=>!Ce(e))),s,l)),!h&&p){const e={fontSize:this.state.currentItemFontSize,fontFamily:this.state.currentItemFontFamily},t=Zn(Ut(e)),n=qn(Ut(e)),r=Math.max(p.height,n),i=Math.max(p.width,t);Lr(p,{height:r,width:i}),s=p.x+i/2,l=p.y+r/2,u&&(u=this.getTextWysiwygSnappedToCenterPosition(s,l,this.state,this.canvas,window.devicePixelRatio))}const m=h||$r({x:u?u.elementCenterX:s,y:u?u.elementCenterY:l,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:"",fontSize:this.state.currentItemFontSize,fontFamily:this.state.currentItemFontFamily,textAlign:u?"center":this.state.currentItemTextAlign,verticalAlign:u?o.oX.MIDDLE:o.hs,containerId:null!==(n=null===(r=p)||void 0===r?void 0:r.id)&&void 0!==n?n:void 0,groupIds:null!==(i=null===(a=p)||void 0===a?void 0:a.groupIds)&&void 0!==i?i:[]});this.setState({editingElement:m}),h||(this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),m]),u||Lr(m,{y:m.y-m.baseline/2})),this.setState({editingElement:m}),this.handleTextWysiwyg(m,{isExistingElement:!!h})},this.handleCanvasDoubleClick=e=>{if(this.state.multiElement)return;if("selection"!==this.state.elementType)return;const t=Ol(this.scene.getElements(),this.state);if(1===t.length&&je(t[0]))return void(this.state.editingLinearElement&&this.state.editingLinearElement.elementId===t[0].id||(this.history.resumeRecording(),this.setState({editingLinearElement:new vo(t[0],this.scene)})));Vt(this.canvas);let{x:n,y:r}=qt(e,this.state);if(Fr(this.state).length>0){const e=this.getElementAtPosition(n,r),t=e&&((e,t)=>e.groupIds.find((e=>t[e])))(e,this.state.selectedGroupIds);if(t)return void this.setState((n=>Ur(Object.assign(Object.assign({},n),{editingGroupId:t,selectedElementIds:{[e.id]:!0},selectedGroupIds:{}}),this.scene.getElements())))}if(Vt(this.canvas),!e[Lt.CTRL_OR_CMD]&&!this.state.viewModeEnabled){const t=Ol(this.scene.getElements(),this.state);if(1===t.length){const e=t[0];Ae(e)&&(n=e.x+e.width/2,r=e.y+e.height/2)}this.startTextEditing({sceneX:n,sceneY:r,shouldBind:!1,insertAtParentCenter:!e.altKey})}},this.getElementLinkAtPosition=(e,t)=>{const n=this.scene.getElements().slice().reverse();let r=1/0;return n.find(((n,i)=>(t&&n.id===t.id&&(r=i),n.link&&gc(n,this.state,[e.x,e.y],this.isMobile)&&i<=r)))},this.redirectToLink=(e,t)=>{const n=He(this.lastPointerDown.clientX,this.lastPointerDown.clientY,this.lastPointerUp.clientX,this.lastPointerUp.clientY);if(!this.hitLinkElement||t&&n>o.f||!t&&0!==n)return;const r=qt(this.lastPointerDown,this.state),i=gc(this.hitLinkElement,this.state,[r.x,r.y],this.isMobile),a=qt(this.lastPointerUp,this.state),s=gc(this.hitLinkElement,this.state,[a.x,a.y],this.isMobile);if(i&&s){const t=this.hitLinkElement.link;if(t){var l;let n;if(this.props.onLinkOpen&&(n=dn(o.Ks.EXCALIDRAW_LINK,e.nativeEvent),this.props.onLinkOpen(this.hitLinkElement,n)),null===(l=n)||void 0===l||!l.defaultPrevented){const e=dc(t)?"_self":"_blank",n=window.open(void 0,e);n&&(n.opener=null,n.location=cc(t))}}}},this.handleCanvasPointerMove=e=>{this.savePointer(e.clientX,e.clientY,this.state.cursorButton),_p.pointers.has(e.pointerId)&&_p.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY});const t=_p.initialScale;if(2===_p.pointers.size&&_p.lastCenter&&t&&_p.initialDistance){const e=Ku(_p.pointers),n=e.x-_p.lastCenter.x,r=e.y-_p.lastCenter.y;_p.lastCenter=e;const i=Vu(Array.from(_p.pointers.values())),o="freedraw"===this.state.elementType&&this.state.penMode?1:i/_p.initialDistance,a=o?nl(t*o):this.state.zoom.value;this.setState((t=>{const i=rl({viewportX:e.x,viewportY:e.y,nextZoom:a},t);return{zoom:i.zoom,scrollX:i.scrollX+n/a,scrollY:i.scrollY+r/a,shouldCacheIgnoreZoom:!0}})),this.resetShouldCacheIgnoreZoomDebounced()}else _p.lastCenter=_p.initialDistance=_p.initialScale=null;if(fp||bp||vp)return;const n=Il(xp,e.clientX-this.state.offsetLeft,e.clientY-this.state.offsetTop).isOverEither;this.state.draggingElement||this.state.multiElement||(n?Vt(this.canvas):Yt(this.canvas,this.state.elementType));const r=qt(e,this.state),{x:i,y:a}=r;if(this.state.editingLinearElement&&!this.state.editingLinearElement.isDragging){const t=vo.handlePointerMove(e,i,a,this.state.editingLinearElement,this.state.gridSize);t!==this.state.editingLinearElement&&this.setState({editingLinearElement:t}),null!=t.lastUncommittedPoint?this.maybeSuggestBindingAtCursor(r):this.setState({suggestedBindings:[]})}if(Me(this.state.elementType)){const{draggingElement:e}=this.state;Te(e)?this.maybeSuggestBindingsForLinearElementAtCoords(e,[r],this.state.startBoundElement):this.maybeSuggestBindingAtCursor(r)}if(this.state.multiElement){const{multiElement:e}=this.state,{x:t,y:n}=e,{points:r,lastCommittedPoint:s}=e,l=r[r.length-1];return Yt(this.canvas,this.state.elementType),void(l===s?He(i-t,a-n,l[0],l[1])>=o.qx?Lr(e,{points:[...r,[i-t,a-n]]}):Gt(this.canvas,o.oc.POINTER):r.length>2&&s&&He(i-t,a-n,s[0],s[1])<o.qx?(Gt(this.canvas,o.oc.POINTER),Lr(e,{points:r.slice(0,-1)})):(Ne(r,this.state.zoom.value)&&Gt(this.canvas,o.oc.POINTER),Lr(e,{points:[...r.slice(0,-1),[i-t,a-n]]})))}if(Boolean(e.buttons)||"selection"!==this.state.elementType&&"text"!==this.state.elementType)return;const s=this.scene.getElements(),l=Ol(s,this.state);if(1!==l.length||n||this.state.editingLinearElement){if(l.length>1&&!n){const t=mo(et(l),i,a,this.state.zoom,e.pointerType);if(t)return void Gt(this.canvas,bo({transformHandleType:t}))}}else{const t=go(s,this.state,i,a,this.state.zoom,e.pointerType);if(t&&t.transformHandleType)return void Gt(this.canvas,bo(t))}const c=this.getElementAtPosition(r.x,r.y);if(this.hitLinkElement=this.getElementLinkAtPosition(r,c),this.hitLinkElement&&!this.state.selectedElementIds[this.hitLinkElement.id])Gt(this.canvas,o.oc.POINTER),d=this.hitLinkElement,u=this.state,mc&&clearTimeout(mc),mc=window.setTimeout((()=>fc(d,u)),o.sA);else if(mc&&clearTimeout(mc),ac&&(ac=!1,il().classList.remove("excalidraw-tooltip--visible")),c&&c.link&&this.state.selectedElementIds[c.id]&&!this.contextMenuOpen&&!this.state.showHyperlinkPopup&&this.setState({showHyperlinkPopup:"info"}),"text"===this.state.elementType)Gt(this.canvas,Ce(c)?o.oc.TEXT:o.oc.CROSSHAIR);else if(this.state.viewModeEnabled)Gt(this.canvas,o.oc.GRAB);else if(n)Gt(this.canvas,o.oc.AUTO);else if(this.state.editingLinearElement){const e=vo.getElement(this.state.editingLinearElement.elementId);e&&Pi(e,this.state,[r.x,r.y])?Gt(this.canvas,o.oc.MOVE):Gt(this.canvas,o.oc.AUTO)}else e[Lt.CTRL_OR_CMD]||!c&&!this.isHittingCommonBoundingBoxOfSelectedElements(r,l)?Gt(this.canvas,o.oc.AUTO):Gt(this.canvas,o.oc.MOVE);var d,u},this.handleTouchMove=e=>{wp=!0},this.handleCanvasPointerDown=e=>{const t=document.getSelection();if(null!=t&&t.anchorNode&&t.removeAllRanges(),this.maybeOpenContextMenuAfterPointerDownOnTouchDevices(e),this.maybeCleanupAfterMissingPointerUp(e),this.state.penDetected||"pen"!==e.pointerType||this.setState((e=>({penMode:!0,penDetected:!0}))),bp)return;if(this.lastPointerDown=e,this.setState({lastPointerDownWith:e.pointerType,cursorButton:"down"}),this.savePointer(e.clientX,e.clientY,"down"),this.handleCanvasPanUsingWheelOrSpaceDrag(e))return;if(e.button!==o.Oh.MAIN&&e.button!==o.Oh.TOUCH)return;if(this.updateGestureOnPointerDown(e),_p.pointers.size>1)return;const n=this.initialPointerDownState(e);if(this.handleDraggingScrollBar(e,n))return;if(this.contextMenuOpen=!1,this.clearSelectionIfNotUsingSelection(),this.updateBindingEnabledOnPointerMove(e),this.handleSelectionOnPointerDown(e,n))return;if(!(!this.state.penMode||"touch"!==e.pointerType||"selection"===this.state.elementType||"text"===this.state.elementType||"image"===this.state.elementType))return;if("text"===this.state.elementType)return void this.handleTextOnPointerDown(e,n);if("arrow"===this.state.elementType||"line"===this.state.elementType)this.handleLinearElementOnPointerDown(e,this.state.elementType,n);else if("image"===this.state.elementType){if(Gt(this.canvas,o.oc.CROSSHAIR),!this.state.pendingImageElement)return;this.setState({draggingElement:this.state.pendingImageElement,editingElement:this.state.pendingImageElement,pendingImageElement:null,multiElement:null});const{x:t,y:n}=qt(e,this.state);Lr(this.state.pendingImageElement,{x:t,y:n})}else"freedraw"===this.state.elementType?this.handleFreeDrawElementOnPointerDown(e,this.state.elementType,n):this.createGenericElementOnPointerDown(this.state.elementType,n);const r=this.onPointerMoveFromPointerDownHandler(n),i=this.onPointerUpFromPointerDownHandler(n),a=this.onKeyDownFromPointerDownHandler(n),s=this.onKeyUpFromPointerDownHandler(n);kp=i,this.state.viewModeEnabled||(window.addEventListener(o.Ks.POINTER_MOVE,r),window.addEventListener(o.Ks.POINTER_UP,i),window.addEventListener(o.Ks.KEYDOWN,a),window.addEventListener(o.Ks.KEYUP,s),n.eventListeners.onMove=r,n.eventListeners.onUp=i,n.eventListeners.onKeyUp=s,n.eventListeners.onKeyDown=a)},this.handleCanvasPointerUp=e=>{this.lastPointerUp=e;const t=["pen","touch"].includes(e.pointerType);if(t){const t=qt({clientX:e.clientX,clientY:e.clientY},this.state),n=this.getElementAtPosition(t.x,t.y);this.hitLinkElement=this.getElementLinkAtPosition(t,n)}this.hitLinkElement&&!this.state.selectedElementIds[this.hitLinkElement.id]&&this.redirectToLink(e,t),this.removePointer(e)},this.maybeOpenContextMenuAfterPointerDownOnTouchDevices=e=>{"touch"===e.pointerType&&(wp=!1,yp?wp=!0:yp=window.setTimeout((()=>{yp=0,wp||this.handleCanvasContextMenu(e)}),o.nM))},this.resetContextMenuTimer=()=>{clearTimeout(yp),yp=0,wp=!1},this.handleCanvasPanUsingWheelOrSpaceDrag=e=>{if(0!==_p.pointers.size||!(e.button===o.Oh.WHEEL||e.button===o.Oh.MAIN&&fp||this.state.viewModeEnabled)||Ce(this.state.editingElement))return!1;bp=!0,e.preventDefault();let t=!1;const n=/Linux/.test(window.navigator.platform);Gt(this.canvas,o.oc.GRABBING);let{clientX:r,clientY:i}=e;const a=an((e=>{const a=r-e.clientX,s=i-e.clientY;if(r=e.clientX,i=e.clientY,n&&!t&&(Math.abs(a)>1||Math.abs(s)>1)){t=!0;const e=t=>{document.body.removeEventListener(o.Ks.PASTE,e),t.stopPropagation()},n=()=>{setTimeout((()=>{document.body.removeEventListener(o.Ks.PASTE,e),window.removeEventListener(o.Ks.POINTER_UP,n)}),100)};document.body.addEventListener(o.Ks.PASTE,e),window.addEventListener(o.Ks.POINTER_UP,n)}this.setState({scrollX:this.state.scrollX-a/this.state.zoom.value,scrollY:this.state.scrollY-s/this.state.zoom.value})})),s=on(kp=()=>{kp=null,bp=!1,fp||(this.state.viewModeEnabled?Gt(this.canvas,o.oc.GRAB):Yt(this.canvas,this.state.elementType)),this.setState({cursorButton:"up"}),this.savePointer(e.clientX,e.clientY,"up"),window.removeEventListener(o.Ks.POINTER_MOVE,a),window.removeEventListener(o.Ks.POINTER_UP,s),window.removeEventListener(o.Ks.BLUR,s),a.flush()});return window.addEventListener(o.Ks.BLUR,s),window.addEventListener(o.Ks.POINTER_MOVE,a,{passive:!0}),window.addEventListener(o.Ks.POINTER_UP,s),!0},this.clearSelectionIfNotUsingSelection=()=>{"selection"!==this.state.elementType&&this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})},this.handleSelectionOnPointerDown=(e,t)=>{if("selection"===this.state.elementType){const r=this.scene.getElements(),i=Ol(r,this.state);if(1!==i.length||this.state.editingLinearElement)i.length>1&&(t.resize.handleType=mo(et(i),t.origin.x,t.origin.y,this.state.zoom,e.pointerType));else{const n=go(r,this.state,t.origin.x,t.origin.y,this.state.zoom,e.pointerType);null!=n&&(this.setState({resizingElement:n.element}),t.resize.handleType=n.transformHandleType)}if(t.resize.handleType)Gt(this.canvas,bo({transformHandleType:t.resize.handleType})),t.resize.isResizing=!0,t.resize.offset=tn(((e,t,n,r)=>{const[i,o,a,s]=1===t.length?Ye(t[0]):et(t),l=(i+a)/2,c=(o+s)/2,d=1===t.length?t[0].angle:0;switch([n,r]=De(n,r,l,c,-d),e){case"n":return De(n-(i+a)/2,r-o,0,0,d);case"s":return De(n-(i+a)/2,r-s,0,0,d);case"w":return De(n-i,r-(o+s)/2,0,0,d);case"e":return De(n-a,r-(o+s)/2,0,0,d);case"nw":return De(n-i,r-o,0,0,d);case"ne":return De(n-a,r-o,0,0,d);case"sw":return De(n-i,r-s,0,0,d);case"se":return De(n-a,r-s,0,0,d);default:return[0,0]}})(t.resize.handleType,i,t.origin.x,t.origin.y)),1===i.length&&je(i[0])&&2===i[0].points.length&&(t.resize.arrowDirection=((e,t)=>{const[,[n,r]]=t.points;return"nw"===e&&(n<0||r<0)||"ne"===e&&n>=0||"sw"===e&&n<=0||"se"===e&&(n>0||r>0)?"end":"origin"})(t.resize.handleType,i[0]));else{var n;if(this.state.editingLinearElement){const n=vo.handlePointerDown(e,this.state,(e=>this.setState(e)),this.history,t.origin);if(n.hitElement&&(t.hit.element=n.hitElement),n.didAddPoint)return!0}if(t.hit.element=null!==(n=t.hit.element)&&void 0!==n?n:this.getElementAtPosition(t.origin.x,t.origin.y),t.hit.element){if(gc(t.hit.element,this.state,[t.origin.x,t.origin.y],this.isMobile))return!1;t.hit.hasHitElementInside=Pi(t.hit.element,this.state,[t.origin.x,t.origin.y])}t.hit.allHitElements=this.getElementsAtPosition(t.origin.x,t.origin.y);const r=t.hit.element,i=t.hit.allHitElements.some((e=>this.isASelectedElement(e)));if(null!==r&&i||e.shiftKey||t.hit.hasHitCommonBoundingBoxOfSelectedElements||this.clearSelection(r),this.state.editingLinearElement)this.setState({selectedElementIds:{[this.state.editingLinearElement.elementId]:!0}});else if(null!=r){if(e[Lt.CTRL_OR_CMD])return this.state.selectedElementIds[r.id]||(t.hit.wasAddedToSelection=!0),this.setState((e=>{return Object.assign(Object.assign({},(t=e,n=r,Object.assign(Object.assign({},t),{editingGroupId:n.groupIds.length?n.groupIds[0]:null,selectedGroupIds:{},selectedElementIds:{[n.id]:!0}}))),{previousSelectedElementIds:this.state.selectedElementIds});var t,n})),!1;this.state.selectedElementIds[r.id]||(this.state.editingGroupId&&!Wr(r,this.state.editingGroupId)&&this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}),i||t.hit.hasHitCommonBoundingBoxOfSelectedElements||(this.setState((e=>Ur(Object.assign(Object.assign({},e),{selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[r.id]:!0}),showHyperlinkPopup:!!r.link&&"info"}),this.scene.getElements()))),t.hit.wasAddedToSelection=!0))}this.setState({previousSelectedElementIds:this.state.selectedElementIds})}}return!1},this.handleTextOnPointerDown=(e,t)=>{if(Ce(this.state.editingElement))return;let n=t.origin.x,r=t.origin.y;const i=this.getElementAtPosition(n,r,{includeBoundTextElement:!0});Ae(i)&&(n=i.x+i.width/2,r=i.y+i.height/2),this.startTextEditing({sceneX:n,sceneY:r,shouldBind:!1,insertAtParentCenter:!e.altKey}),Vt(this.canvas),this.state.elementLocked||this.setState({elementType:"selection"})},this.handleFreeDrawElementOnPointerDown=(e,t,n)=>{const[r,i]=Ke(n.origin.x,n.origin.y,null),o=(a={type:t,x:r,y:i,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.currentItemLinearStrokeSharpness,simulatePressure:.5===e.pressure},Object.assign(Object.assign({},Xr(a.type,a)),{points:a.points||[],pressures:[],simulatePressure:a.simulatePressure,lastCommittedPoint:null}));var a;this.setState((e=>({selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[o.id]:!1})})));const s=o.simulatePressure?o.pressures:[...o.pressures,e.pressure];Lr(o,{points:[[0,0]],pressures:s});const l=Oo(n.origin,this.scene);this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),o]),this.setState({draggingElement:o,editingElement:o,startBoundElement:l,suggestedBindings:[]})},this.createImageElement=e=>{let{sceneX:t,sceneY:n}=e;const[r,i]=Ke(t,n,this.state.gridSize);var o;return o={type:"image",x:r,y:i,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.currentItemLinearStrokeSharpness},Object.assign(Object.assign({},Xr("image",o)),{strokeColor:"transparent",status:"pending",fileId:null,scale:[1,1]})},this.handleLinearElementOnPointerDown=(e,t,n)=>{if(this.state.multiElement){const{multiElement:e}=this.state;if("line"===e.type&&Ne(e.points,this.state.zoom.value))return Lr(e,{lastCommittedPoint:e.points[e.points.length-1]}),void this.actionManager.executeAction(Ql);const{x:t,y:r,lastCommittedPoint:i}=e;if(e.points.length>1&&i&&He(n.origin.x-t,n.origin.y-r,i[0],i[1])<o.qx)return void this.actionManager.executeAction(Ql);this.setState((t=>({selectedElementIds:Object.assign(Object.assign({},t.selectedElementIds),{[e.id]:!0})}))),Lr(e,{lastCommittedPoint:e.points[e.points.length-1]}),Gt(this.canvas,o.oc.POINTER)}else{const[e,r]=Ke(n.origin.x,n.origin.y,this.state.gridSize),{currentItemStartArrowhead:i,currentItemEndArrowhead:o}=this.state,[a,s]="arrow"===t?[i,o]:[null,null],l=Jr({type:t,x:e,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.currentItemLinearStrokeSharpness,startArrowhead:a,endArrowhead:s});this.setState((e=>({selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[l.id]:!1})}))),Lr(l,{points:[...l.points,[0,0]]});const c=Oo(n.origin,this.scene);this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),l]),this.setState({draggingElement:l,editingElement:l,startBoundElement:c,suggestedBindings:[]})}},this.createGenericElementOnPointerDown=(e,t)=>{const[n,r]=Ke(t.origin.x,t.origin.y,this.state.gridSize),i=Zr({type:e,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});"selection"===i.type?this.setState({selectionElement:i,draggingElement:i}):(this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),i]),this.setState({multiElement:null,draggingElement:i,editingElement:i}))},this.initializeImage=async e=>{var t,n,r;let{imageFile:i,imageElement:a,showCursorImagePreview:s=!1}=e;if(!gd(i))throw new Error(b("errors.unsupportedFileType"));const l=i.type;if(Gt(this.canvas,"wait"),l===o.LO.svg)try{i=wd(await(async e=>{const t=(new DOMParser).parseFromString(e,o.LO.svg),n=t.querySelector("svg");if(t.querySelector("parsererror")||"svg"!==(null==(r=n)?void 0:r.nodeName.toLowerCase()))throw new Error(b("errors.invalidSVGString"));return n.hasAttribute("xmlns")||n.setAttribute("xmlns",o.hR),n.outerHTML;var r})(await i.text()),i.name)}catch(e){throw console.warn(e),new Error(b("errors.svgImageInsertError"))}const c=await((null===(t=(n=this.props).generateIdForFile)||void 0===t?void 0:t.call(n,i))||vd(i));if(!c)throw console.warn("Couldn't generate file id or the supplied `generateIdForFile` didn't resolve to one."),new Error(b("errors.imageInsertError"));const d=this.files[c];if(null==d||!d.dataURL){try{i=await yd(i,{maxWidthOrHeight:o.h6})}catch(e){console.error("error trying to resing image file on insertion",e)}if(i.size>o.$n)throw new Error(b("errors.fileTooBig",{maxSize:"".concat(Math.trunc(o.$n/1024/1024),"MB")}))}if(s){var u;const e=null===(u=this.files[c])||void 0===u?void 0:u.dataURL,t=e&&function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=e.indexOf(","),r=atob(e.slice(n+1)),i=e.slice(0,n).split(":")[1].split(";")[0],o=new ArrayBuffer(r.length),a=new Uint8Array(o);for(let e=0;e<r.length;e++)a[e]=r.charCodeAt(e);return new File([o],t,{type:i})}(e);this.setImagePreviewCursor(t||i)}const h=(null===(r=this.files[c])||void 0===r?void 0:r.dataURL)||await xd(i),p=Lr(a,{fileId:c},!1);return new Promise((async(e,t)=>{try{var n,r;this.files=Object.assign(Object.assign({},this.files),{[c]:{mimeType:l,id:c,dataURL:h,created:Date.now()}});const t=this.imageCache.get(c);t||(this.addNewImagesToImageCache(),await this.updateImageCache([p])),(null==t?void 0:t.image)instanceof Promise&&await t.image,(null===(n=this.state.pendingImageElement)||void 0===n?void 0:n.id)!==p.id&&(null===(r=this.state.draggingElement)||void 0===r?void 0:r.id)!==p.id&&this.initializeImageDimensions(p,!0),e(p)}catch(e){console.error(e),t(new Error(b("errors.imageInsertError")))}finally{s||Vt(this.canvas)}}))},this.insertImageElement=async(e,t,n)=>{this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),e]);try{await this.initializeImage({imageFile:t,imageElement:e,showCursorImagePreview:n})}catch(t){Lr(e,{isDeleted:!0}),this.actionManager.executeAction(Ql),this.setState({errorMessage:t.message||b("errors.imageInsertError")})}},this.setImagePreviewCursor=async e=>{const t=await yd(e,{maxWidthOrHeight:96});let n=await xd(t);if(e.type===o.LO.svg){const e=await Sd(n);let t=Math.min(e.height,96),r=t*(e.width/e.height);r>96&&(r=96,t=r*(e.height/e.width));const i=document.createElement("canvas");i.height=t,i.width=r;i.getContext("2d").drawImage(e,0,0,r,t),n=i.toDataURL(o.LO.svg)}this.state.pendingImageElement&&Gt(this.canvas,"url(".concat(n,") 4 4, auto"))},this.onImageAction=async function(){let{insertOnCanvasDirectly:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{insertOnCanvasDirectly:!1};try{const n=e.state.width/2+e.state.offsetLeft,r=e.state.height/2+e.state.offsetTop,{x:i,y:o}=qt({clientX:n,clientY:r},e.state),a=await nd({description:"Image",extensions:["jpg","png","svg","gif"]}),s=e.createImageElement({sceneX:i,sceneY:o});t?(e.insertImageElement(s,a),e.initializeImageDimensions(s),e.setState({selectedElementIds:{[s.id]:!0}},(()=>{e.actionManager.executeAction(Ql)}))):e.setState({pendingImageElement:s},(()=>{e.insertImageElement(s,a,!0)}))}catch(t){"AbortError"!==t.name?console.error(t):console.warn(t),e.setState({pendingImageElement:null,editingElement:null,elementType:"selection"},(()=>{e.actionManager.executeAction(Ql)}))}},this.initializeImageDimensions=function(t){var n;let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=ke(t)&&(null===(n=e.imageCache.get(t.fileId))||void 0===n?void 0:n.image);if(!i||i instanceof Promise){if(t.width<o.f/e.state.zoom.value&&t.height<o.f/e.state.zoom.value){const n=100/e.state.zoom.value;Lr(t,{x:t.x-n/2,y:t.y-n/2,width:n,height:n})}}else if(r||t.width<o.f/e.state.zoom.value&&t.height<o.f/e.state.zoom.value){const n=Math.max(e.state.height-120,160),r=Math.min(n,Math.floor(.5*e.state.height)/e.state.zoom.value),o=Math.min(i.naturalHeight,r),a=o*(i.naturalWidth/i.naturalHeight),s=t.x+t.width/2-a/2,l=t.y+t.height/2-o/2;Lr(t,{x:s,y:l,width:a,height:o})}},this.updateImageCache=async function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.files;const{updatedFiles:r,erroredFiles:i}=await jd({imageCache:e.imageCache,fileIds:t.map((e=>e.fileId)),files:n});if(r.size||i.size)for(const e of t)r.has(e.fileId)&&mr(e);return i.size&&e.scene.replaceAllElements(e.scene.getElementsIncludingDeleted().map((e=>ke(e)&&i.has(e.fileId)?Ar(e,{status:"error"}):e))),{updatedFiles:r,erroredFiles:i}},this.addNewImagesToImageCache=async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Id(e.scene.getElements()),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.files;const r=t.filter((t=>!t.isDeleted&&!e.imageCache.has(t.fileId)));if(r.length){const{updatedFiles:t}=await e.updateImageCache(r,n);t.size&&e.scene.informMutation()}},this.scheduleImageRefresh=sp()((()=>{this.addNewImagesToImageCache()}),o.LL),this.updateBindingEnabledOnPointerMove=e=>{const t=(e=>!e[Lt.CTRL_OR_CMD])(e);this.state.isBindingEnabled!==t&&this.setState({isBindingEnabled:t})},this.maybeSuggestBindingAtCursor=e=>{const t=Oo(e,this.scene);this.setState({suggestedBindings:null!=t?[t]:[]})},this.maybeSuggestBindingsForLinearElementAtCoords=(e,t,n)=>{if(!t.length)return;const r=t.reduce(((t,r)=>{const i=Oo(r,this.scene);return null==i||Io(e,null==n?void 0:n.id,i)||t.push(i),t}),[]);this.setState({suggestedBindings:r})},this.handleCanvasRef=e=>{var t,n,r;null!==e?(this.canvas=e,this.rc=ve.canvas(this.canvas),this.canvas.addEventListener(o.Ks.WHEEL,this.handleWheel,{passive:!1}),this.canvas.addEventListener(o.Ks.TOUCH_START,this.onTapStart),this.canvas.addEventListener(o.Ks.TOUCH_END,this.onTapEnd)):(null===(t=this.canvas)||void 0===t||t.removeEventListener(o.Ks.WHEEL,this.handleWheel),null===(n=this.canvas)||void 0===n||n.removeEventListener(o.Ks.TOUCH_START,this.onTapStart),null===(r=this.canvas)||void 0===r||r.removeEventListener(o.Ks.TOUCH_END,this.onTapEnd))},this.handleAppOnDrop=async e=>{var t,n;try{const t=e.dataTransfer.files[0];if(gd(t)){if((null==t?void 0:t.type)===o.LO.png||(null==t?void 0:t.type)===o.LO.svg)try{if(Jc)try{const n=e.dataTransfer.items[0];t.handle=await n.getAsFileSystemHandle()}catch(e){console.warn(e.name,e.message)}const n=await md(t,this.state,this.scene.getElementsIncludingDeleted());return void this.syncActionResult(Object.assign(Object.assign({},n),{appState:Object.assign(Object.assign({},n.appState||this.state),{isLoading:!1}),replaceFiles:!0,commitToHistory:!0}))}catch(e){if("EncodingError"!==e.name)throw e}const{x:n,y:r}=qt(e,this.state),i=this.createImageElement({sceneX:n,sceneY:r});return this.insertImageElement(i,t),this.initializeImageDimensions(i),void this.setState({selectedElementIds:{[i.id]:!0}})}}catch(e){return this.setState({isLoading:!1,errorMessage:e.message})}const r=e.dataTransfer.getData(o.LO.excalidrawlib);if(""!==r)return void this.addElementsFromPasteOrLibrary({elements:JSON.parse(r),position:e,files:null});const i=null===(t=e.dataTransfer)||void 0===t?void 0:t.files[0];if((null==i?void 0:i.type)===o.LO.excalidrawlib||null!=i&&null!==(n=i.name)&&void 0!==n&&n.endsWith(".excalidrawlib"))this.library.importLibrary(i).then((()=>{this.setState({isLibraryOpen:!1}),this.setState({isLibraryOpen:!0})})).catch((e=>this.setState({isLoading:!1,errorMessage:e.message})));else{if(this.setState({isLoading:!0}),Jc)try{const t=e.dataTransfer.items[0];i.handle=await t.getAsFileSystemHandle()}catch(e){console.warn(e.name,e.message)}await this.loadFileToCanvas(i)}},this.loadFileToCanvas=e=>{md(e,this.state,this.scene.getElementsIncludingDeleted()).then((e=>{this.syncActionResult(Object.assign(Object.assign({},e),{appState:Object.assign(Object.assign({},e.appState||this.state),{isLoading:!1}),replaceFiles:!0,commitToHistory:!0}))})).catch((e=>{this.setState({isLoading:!1,errorMessage:e.message})}))},this.handleCanvasContextMenu=e=>{if(e.preventDefault(),("touch"===e.nativeEvent.pointerType||"pen"===e.nativeEvent.pointerType&&e.button!==o.Oh.SECONDARY)&&"selection"!==this.state.elementType)return;const{x:t,y:n}=qt(e,this.state),r=this.getElementAtPosition(t,n,{preferSelected:!0}),i=r?"element":"canvas",a=this.excalidrawContainerRef.current,{top:s,left:l}=a.getBoundingClientRect(),c=e.clientX-l,d=e.clientY-s;r&&!this.state.selectedElementIds[r.id]?this.setState({selectedElementIds:{[r.id]:!0}},(()=>{this._openContextMenu({top:d,left:c},i)})):this._openContextMenu({top:d,left:c},i)},this.maybeDragNewGenericElement=(e,t)=>{const n=this.state.draggingElement,r=e.lastCoords;if(n)if("selection"===n.type)ra(n,this.state.elementType,e.origin.x,e.origin.y,r.x,r.y,Kt(e.origin.x,r.x),Kt(e.origin.y,r.y),Dt(t),Pt(t));else{var i;const[o,a]=Ke(r.x,r.y,this.state.gridSize),s=ke(n)&&(null===(i=this.imageCache.get(n.fileId))||void 0===i?void 0:i.image),l=!s||s instanceof Promise?null:s.width/s.height;ra(n,this.state.elementType,e.originInGrid.x,e.originInGrid.y,o,a,Kt(e.originInGrid.x,o),Kt(e.originInGrid.y,a),_e(n)?!Dt(t):Dt(t),Pt(t),l),this.maybeSuggestBindingForAll([n])}},this.maybeHandleResize=(e,t)=>{const n=Ol(this.scene.getElements(),this.state),r=e.resize.handleType;this.setState({isResizing:r&&"rotation"!==r,isRotating:"rotation"===r});const i=e.lastCoords,[o,a]=Ke(i.x-e.resize.offset.x,i.y-e.resize.offset.y,this.state.gridSize);return!!((e,t,n,r,i,o,a,s,l,c,d)=>{if(1===n.length){const[c]=n;return"rotation"===t?(Xo(c,s,l,i),Ao(c)):!je(c)||2!==c.points.length||"nw"!==t&&"ne"!==t&&"sw"!==t&&"se"!==t?!Ce(c)||"nw"!==t&&"ne"!==t&&"sw"!==t&&"se"!==t?t&&Jo(e.originalElements,a,c,t,o,s,l):(Qo(c,t,o,s,l),Ao(c)):Zo(c,r,i,s,l),!0}if(n.length>1){if("rotation"===t)return ta(e,n,s,l,i,c,d),!0;if("nw"===t||"ne"===t||"sw"===t||"se"===t)return ea(n,t,s,l),!0}return!1})(e,r,n,e.resize.arrowDirection,zt(t),Pt(t),1===n.length&&_e(n[0])?!Dt(t):Dt(t),o,a,e.resize.center.x,e.resize.center.y)&&(this.maybeSuggestBindingForAll(n),!0)},this._openContextMenu=(e,t)=>{let{left:n,top:r}=e;this.state.showHyperlinkPopup&&this.setState({showHyperlinkPopup:!1}),this.contextMenuOpen=!0;const i=bu.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),o=vu.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),a=Su.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),s=ju.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),l="separator",c=this.scene.getElements(),d=[];if(Jd&&c.length>0&&d.push(Du),Qd&&c.length>0&&d.push(Pu),"canvas"===t){const e=[...d,void 0===this.props.gridModeEnabled&&zu,void 0===this.props.zenModeEnabled&&Ru,void 0===this.props.viewModeEnabled&&op,Hu];this.state.viewModeEnabled?eh.push({options:e,top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current,elements:c}):eh.push({options:[this.isMobile&&navigator.clipboard&&{name:"paste",perform:(e,t)=>(this.pasteFromClipboard(null),{commitToHistory:!1}),contextItemLabel:"labels.paste"},this.isMobile&&navigator.clipboard&&l,Jd&&c.length>0&&Du,Qd&&c.length>0&&Pu,(Jd&&c.length>0||Qd&&c.length>0)&&l,Zl,l,void 0===this.props.gridModeEnabled&&zu,void 0===this.props.zenModeEnabled&&Ru,void 0===this.props.viewModeEnabled&&op,Hu],top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current,elements:c})}else if("element"===t){const e=Ol(c,this.state).some((e=>!Ae(e)));this.state.viewModeEnabled?eh.push({options:[navigator.clipboard&&Lu,...d],top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current,elements:c}):eh.push({options:[this.isMobile&&Au,this.isMobile&&navigator.clipboard&&Lu,this.isMobile&&navigator.clipboard&&{name:"paste",perform:(e,t)=>(this.pasteFromClipboard(null),{commitToHistory:!1}),contextItemLabel:"labels.paste"},this.isMobile&&l,...d,l,pu,gu,l,i&&bu,!e&&Nu,o&&vu,(i||o)&&l,yu,l,Vl,Gl,Yl,Xl,l,a&&Su,s&&ju,(a||s)&&l,uc.contextItemPredicate(c,this.state)&&uc,ql,Pl],top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current,elements:c})}},this.handleWheel=on((e=>{if(e.preventDefault(),bp)return;const{deltaX:t,deltaY:n}=e,{selectedElementIds:r,previousSelectedElementIds:i}=this.state;if(e.metaKey||e.ctrlKey){const e=Math.sign(n),t=10;let a=Math.abs(n);a>t&&(a=t),a*=e,0!==Object.keys(i).length&&setTimeout((()=>{this.setState({selectedElementIds:i,previousSelectedElementIds:{}})}),1e3);let s=this.state.zoom.value-a/100;return s+=Math.log10(Math.max(1,this.state.zoom.value))*-e,s=Math.round(s*o.V4*100)/(100*o.V4),this.setState((e=>Object.assign(Object.assign({},rl({viewportX:gp,viewportY:mp,nextZoom:nl(s)},e)),{selectedElementIds:{},previousSelectedElementIds:0!==Object.keys(r).length?r:i,shouldCacheIgnoreZoom:!0}))),void this.resetShouldCacheIgnoreZoomDebounced()}e.shiftKey?this.setState((e=>{let{zoom:r,scrollX:i}=e;return{scrollX:i-(n||t)/r.value}})):this.setState((e=>{let{zoom:r,scrollX:i,scrollY:o}=e;return{scrollX:i-t/r.value,scrollY:o-n/r.value}}))})),this.savePointer=(e,t,n)=>{var r,i;if(!e||!t)return;const o=qt({clientX:e,clientY:t},this.state);isNaN(o.x)||isNaN(o.y),null===(r=(i=this.props).onPointerUpdate)||void 0===r||r.call(i,{pointer:o,button:n,pointersMap:_p.pointers})},this.resetShouldCacheIgnoreZoomDebounced=Wt((()=>{this.unmounted||this.setState({shouldCacheIgnoreZoom:!1})}),300),this.updateDOMRect=e=>{var t;if(null!==(t=this.excalidrawContainerRef)&&void 0!==t&&t.current){const t=this.excalidrawContainerRef.current,{width:n,height:r,left:i,top:o}=t.getBoundingClientRect(),{width:a,height:s,offsetTop:l,offsetLeft:c}=this.state;if(n===a&&r===s&&i===c&&o===l)return void(e&&e());this.setState({width:n,height:r,offsetLeft:i,offsetTop:o},(()=>{e&&e()}))}},this.refresh=()=>{this.setState(Object.assign({},this.getCanvasOffsets()))}};"production"!==o.Vi.TEST&&"production"!==o.Vi.DEVELOPMENT||(window.h=window.h||{},Object.defineProperties(window.h,{elements:{configurable:!0,get(){return this.app.scene.getElementsIncludingDeleted()},set(e){return this.app.scene.replaceAllElements(e)}}}));const Sp=Cp;n(4285),n(3313);var jp=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const Ip=e=>{var t;const{onHomeButtonClick:n,onChange:i,initialData:a,excalidrawRef:s,onCollabButtonClick:l,isCollaborating:d=!1,onPointerUpdate:u,renderTopRightUI:h,renderFooter:p,langCode:g=c.code,viewModeEnabled:m,zenModeEnabled:f,gridModeEnabled:b,libraryReturnUrl:x,theme:w,name:k,renderCustomStats:_,onPaste:C,detectScroll:E=!0,handleKeyboardGlobally:S=!1,onLibraryChange:j,autoFocus:I=!1,generateIdForFile:T,onLinkOpen:M,id:O}=e,L=null===(t=e.UIOptions)||void 0===t?void 0:t.canvasActions,A={canvasActions:!!L&&Object.assign(Object.assign({},o.cW.canvasActions),L)};var P;L&&"object"==typeof L.export&&(L.export.saveFileToDisk=(null===(P=L.export)||void 0===P?void 0:P.saveFileToDisk)||o.cW.canvasActions.export.saveFileToDisk);return(0,r.useEffect)((()=>{const e=e=>{"number"==typeof e.scale&&1!==e.scale&&e.preventDefault()};return document.addEventListener("touchmove",e,{passive:!1}),()=>{document.removeEventListener("touchmove",e)}}),[]),(0,v.jsx)(y,{langCode:g,children:(0,v.jsx)(Sp,{id:O,onHomeButtonClick:n,onChange:i,initialData:a,excalidrawRef:s,onCollabButtonClick:l,isCollaborating:d,onPointerUpdate:u,renderTopRightUI:h,renderFooter:p,langCode:g,viewModeEnabled:m,zenModeEnabled:f,gridModeEnabled:b,libraryReturnUrl:x,theme:w,name:k,renderCustomStats:_,UIOptions:A,onPaste:C,detectScroll:E,handleKeyboardGlobally:S,onLibraryChange:j,autoFocus:I,generateIdForFile:T,onLinkOpen:M})})},Tp=(e,t)=>{const{initialData:n,UIOptions:r={}}=e,i=jp(e,["initialData","UIOptions"]),{initialData:o,UIOptions:a={}}=t,s=jp(t,["initialData","UIOptions"]),l=Object.keys(r),c=Object.keys(a);if(l.length!==c.length)return!1;const d=l.every((e=>{if("canvasActions"===e){Object.keys(r.canvasActions).every((e=>{var t,n,i,o;return null!=r&&r.canvasActions&&null!=a&&a.canvasActions?"export"===e&&null!=r&&null!==(t=r.canvasActions)&&void 0!==t&&t.export&&null!=a&&null!==(n=a.canvasActions)&&void 0!==n&&n.export?"function"==typeof r.canvasActions.export||"function"==typeof a.canvasActions.export?r.canvasActions.export===a.canvasActions.export:r.canvasActions.export.saveFileToDisk===a.canvasActions.export.saveFileToDisk:(null==r||null===(i=r.canvasActions)||void 0===i?void 0:i[e])===(null==a||null===(o=a.canvasActions)||void 0===o?void 0:o[e]):(null==r?void 0:r.canvasActions)===(null==a?void 0:a.canvasActions)}))}return!0})),u=Object.keys(e),h=Object.keys(t);return d&&u.length===h.length&&u.every((e=>i[e]===s[e]))},Mp=(0,r.forwardRef)(((e,t)=>(0,v.jsx)(Ip,Object.assign(Object.assign({},e),{excalidrawRef:t})))),Op=i().memo(Mp,Tp);n(8336);const Lp=Op},9669:e=>{"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg=="},7984:e=>{"use strict";e.exports='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="292.4" height="292.4" viewBox="0 0 292 292"><path d="M287 197L159 69c-4-3-8-5-13-5s-9 2-13 5L5 197c-3 4-5 8-5 13s2 9 5 13c4 4 8 5 13 5h256c5 0 9-1 13-5s5-8 5-13-1-9-5-13z"/></svg>'},1639:e=>{"use strict";e.exports='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="292.4" height="292.4" viewBox="0 0 292 292"><path fill="%23ced4da" d="M287 197L159 69c-4-3-8-5-13-5s-9 2-13 5L5 197c-3 4-5 8-5 13s2 9 5 13c4 4 8 5 13 5h256c5 0 9-1 13-5s5-8 5-13-1-9-5-13z"/></svg>'},3147:(e,t,n)=>{"use strict";e.exports=n.p+"excalidraw-assets/Cascadia.woff2"},3940:(e,t,n)=>{"use strict";e.exports=n.p+"excalidraw-assets/Virgil.woff2"},9787:t=>{"use strict";t.exports=e},5156:e=>{"use strict";e.exports=t},1463:e=>{"use strict";e.exports=JSON.parse('{"labels":{"paste":"Paste","pasteCharts":"Paste charts","selectAll":"Select all","multiSelect":"Add element to selection","moveCanvas":"Move canvas","cut":"Cut","copy":"Copy","copyAsPng":"Copy to clipboard as PNG","copyAsSvg":"Copy to clipboard as SVG","bringForward":"Bring forward","sendToBack":"Send to back","bringToFront":"Bring to front","sendBackward":"Send backward","delete":"Delete","copyStyles":"Copy styles","pasteStyles":"Paste styles","stroke":"Stroke","background":"Background","fill":"Fill","strokeWidth":"Stroke width","strokeStyle":"Stroke style","strokeStyle_solid":"Solid","strokeStyle_dashed":"Dashed","strokeStyle_dotted":"Dotted","sloppiness":"Sloppiness","opacity":"Opacity","textAlign":"Text align","edges":"Edges","sharp":"Sharp","round":"Round","arrowheads":"Arrowheads","arrowhead_none":"None","arrowhead_arrow":"Arrow","arrowhead_bar":"Bar","arrowhead_dot":"Dot","arrowhead_triangle":"Triangle","fontSize":"Font size","fontFamily":"Font family","onlySelected":"Only selected","withBackground":"Background","exportEmbedScene":"Embed scene","exportEmbedScene_details":"Scene data will be saved into the exported PNG/SVG file so that the scene can be restored from it.\\nWill increase exported file size.","addWatermark":"Add \\"Made with Excalidraw\\"","handDrawn":"Hand-drawn","normal":"Normal","code":"Code","small":"Small","medium":"Medium","large":"Large","veryLarge":"Very large","solid":"Solid","hachure":"Hachure","crossHatch":"Cross-hatch","thin":"Thin","bold":"Bold","left":"Left","center":"Center","right":"Right","extraBold":"Extra bold","architect":"Architect","artist":"Artist","cartoonist":"Cartoonist","fileTitle":"File name","colorPicker":"Color picker","canvasColors":"Used on canvas","canvasBackground":"Canvas background","drawingCanvas":"Drawing canvas","layers":"Layers","actions":"Actions","language":"Language","liveCollaboration":"Live collaboration","duplicateSelection":"Duplicate","untitled":"Untitled","name":"Name","yourName":"Your name","madeWithExcalidraw":"Made with Excalidraw","group":"Group selection","ungroup":"Ungroup selection","collaborators":"Collaborators","showGrid":"Show grid","addToLibrary":"Add to library","removeFromLibrary":"Remove from library","libraryLoadingMessage":"Loading library…","libraries":"Browse libraries","loadingScene":"Loading scene…","align":"Align","alignTop":"Align top","alignBottom":"Align bottom","alignLeft":"Align left","alignRight":"Align right","centerVertically":"Center vertically","centerHorizontally":"Center horizontally","distributeHorizontally":"Distribute horizontally","distributeVertically":"Distribute vertically","flipHorizontal":"Flip horizontal","flipVertical":"Flip vertical","viewMode":"View mode","toggleExportColorScheme":"Toggle export color scheme","share":"Share","showStroke":"Show stroke color picker","showBackground":"Show background color picker","toggleTheme":"Toggle theme","personalLib":"Personal Library","excalidrawLib":"Excalidraw Library","decreaseFontSize":"Decrease font size","increaseFontSize":"Increase font size","unbindText":"Unbind text","link":{"edit":"Edit link","create":"Create link","label":"Link"}},"buttons":{"clearReset":"Reset the canvas","exportJSON":"Export to file","exportImage":"Save as image","export":"Export","exportToPng":"Export to PNG","exportToSvg":"Export to SVG","copyToClipboard":"Copy to clipboard","copyPngToClipboard":"Copy PNG to clipboard","scale":"Scale","save":"Save (to active file)","saveAs":"Save as","load":"Load","getShareableLink":"Get shareable link","close":"Close","selectLanguage":"Select language","scrollBackToContent":"Scroll back to content","zoomIn":"Zoom in","zoomOut":"Zoom out","resetZoom":"Reset zoom","menu":"Menu","done":"Done","edit":"Edit","undo":"Undo","redo":"Redo","resetLibrary":"Reset library","roomDialog":"Sharing","createNewRoom":"Create new room","fullScreen":"Full screen","darkMode":"Dark mode","lightMode":"Light mode","zenMode":"Zen mode","exitZenMode":"Exit zen mode","cancel":"Cancel","clear":"Clear","remove":"Remove","publishLibrary":"Publish","submit":"Submit","confirm":"Confirm"},"alerts":{"clearReset":"This will clear the whole canvas. Are you sure?","couldNotCreateShareableLink":"Couldn\'t create shareable link.","couldNotCreateShareableLinkTooBig":"Couldn\'t create shareable link: the scene is too big","couldNotLoadInvalidFile":"Couldn\'t load invalid file","importBackendFailed":"Importing from backend failed.","cannotExportEmptyCanvas":"Cannot export empty canvas.","couldNotCopyToClipboard":"Couldn\'t copy to clipboard. Try using Chrome browser.","decryptFailed":"Couldn\'t decrypt data.","uploadedSecurly":"The upload has been secured with end-to-end encryption, which means that Excalidraw server and third parties can\'t read the content.","loadSceneOverridePrompt":"Loading external drawing will replace your existing content. Do you wish to continue?","collabStopOverridePrompt":"Stopping the session will overwrite your previous, locally stored drawing. Are you sure?\\n\\n(If you want to keep your local drawing, simply close the browser tab instead.)","errorLoadingLibrary":"There was an error loading the third party library.","errorAddingToLibrary":"Couldn\'t add item to the library","errorRemovingFromLibrary":"Couldn\'t remove item from the library","confirmAddLibrary":"This will add {{numShapes}} shape(s) to your library. Are you sure?","imageDoesNotContainScene":"This image does not seem to contain any scene data. Have you enabled scene embedding during export?","cannotRestoreFromImage":"Scene couldn\'t be restored from this image file","invalidSceneUrl":"Couldn\'t import scene from the supplied URL. It\'s either malformed, or doesn\'t contain valid Excalidraw JSON data.","resetLibrary":"This will clear your library. Are you sure?","removeItemsFromsLibrary":"Delete {{count}} item(s) from library?","invalidEncryptionKey":"Encryption key must be of 22 characters. Live collaboration is disabled."},"errors":{"unsupportedFileType":"Unsupported file type.","imageInsertError":"Couldn\'t insert image. Try again later...","fileTooBig":"File is too big. Maximum allowed size is {{maxSize}}.","svgImageInsertError":"Couldn\'t insert SVG image. The SVG markup looks invalid.","invalidSVGString":"Invalid SVG."},"toolBar":{"selection":"Selection","image":"Insert image","rectangle":"Rectangle","diamond":"Diamond","ellipse":"Ellipse","arrow":"Arrow","line":"Line","freedraw":"Draw","text":"Text","library":"Library","lock":"Keep selected tool active after drawing","penMode":"Prevent pinch-zoom and accept freedraw input only from pen","link":"Add/ Update link for a selected shape"},"headings":{"canvasActions":"Canvas actions","selectedShapeActions":"Selected shape actions","shapes":"Shapes"},"hints":{"canvasPanning":"To move canvas, hold mouse wheel or spacebar while dragging","linearElement":"Click to start multiple points, drag for single line","freeDraw":"Click and drag, release when you\'re finished","text":"Tip: you can also add text by double-clicking anywhere with the selection tool","text_selected":"Double-click or press ENTER to edit text","text_editing":"Press Escape or CtrlOrCmd+ENTER to finish editing","linearElementMulti":"Click on last point or press Escape or Enter to finish","lockAngle":"You can constrain angle by holding SHIFT","resize":"You can constrain proportions by holding SHIFT while resizing,\\nhold ALT to resize from the center","resizeImage":"You can resize freely by holding SHIFT,\\nhold ALT to resize from the center","rotate":"You can constrain angles by holding SHIFT while rotating","lineEditor_info":"Double-click or press Enter to edit points","lineEditor_pointSelected":"Press Delete to remove point(s),\\nCtrlOrCmd+D to duplicate, or drag to move","lineEditor_nothingSelected":"Select a point to edit (hold SHIFT to select multiple),\\nor hold Alt and click to add new points","placeImage":"Click to place the image, or click and drag to set its size manually","publishLibrary":"Publish your own library","bindTextToElement":"Press enter to add text","deepBoxSelect":"Hold CtrlOrCmd to deep select, and to prevent dragging"},"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","deepSelect":"Deep select","deepBoxSelect":"Deep select within box, and prevent dragging","curvedArrow":"Curved arrow","curvedLine":"Curved line","documentation":"Documentation","doubleClick":"double-click","drag":"drag","editor":"Editor","editSelectedShape":"Edit selected shape (text/arrow/line)","github":"Found an issue? Submit","howto":"Follow our guides","or":"or","preventBinding":"Prevent arrow binding","shapes":"Shapes","shortcuts":"Keyboard shortcuts","textFinish":"Finish editing (text editor)","textNewLine":"Add new line (text editor)","title":"Help","view":"View","zoomToFit":"Zoom to fit all elements","zoomToSelection":"Zoom to selection"},"clearCanvasDialog":{"title":"Clear canvas"},"publishDialog":{"title":"Publish library","itemName":"Item name","authorName":"Author name","githubUsername":"GitHub username","twitterUsername":"Twitter username","libraryName":"Library name","libraryDesc":"Library description","website":"Website","placeholder":{"authorName":"Your name or username","libraryName":"Name of your library","libraryDesc":"Description of your library to help people understand its usage","githubHandle":"GitHub handle (optional), so you can edit the library once submitted for review","twitterHandle":"Twitter username (optional), so we know who to credit when promoting over Twitter","website":"Link to your personal website or elsewhere (optional)"},"errors":{"required":"Required","website":"Enter a valid URL"},"noteDescription":{"pre":"Submit your library to be included in the ","link":"public library repository","post":"for other people to use in their drawings."},"noteGuidelines":{"pre":"The library needs to be manually approved first. Please read the ","link":"guidelines","post":" before submitting. You will need a GitHub account to communicate and make changes if requested, but it is not strictly required."},"noteLicense":{"pre":"By submitting, you agree the library will be published under the ","link":"MIT License, ","post":"which in short means anyone can use them without restrictions."},"noteItems":"Each library item must have its own name so it\'s filterable. The following library items will be included:","atleastOneLibItem":"Please select at least one library item to get started"},"publishSuccessDialog":{"title":"Library submitted","content":"Thank you {{authorName}}. Your library has been submitted for review. You can track the status","link":"here"},"confirmDialog":{"resetLibrary":"Reset library","removeItemsFromLib":"Remove selected items from library"},"encrypted":{"tooltip":"Your drawings are end-to-end encrypted so Excalidraw\'s servers will never see them.","link":"Blog post on end-to-end encryption in Excalidraw"},"stats":{"angle":"Angle","element":"Element","elements":"Elements","height":"Height","scene":"Scene","selected":"Selected","storage":"Storage","title":"Stats for nerds","total":"Total","version":"Version","versionCopy":"Click to copy","versionNotAvailable":"Version not available","width":"Width"},"toast":{"addedToLibrary":"Added to library","copyStyles":"Copied styles.","copyToClipboard":"Copied to clipboard.","copyToClipboardAsPng":"Copied {{exportSelection}} to clipboard as PNG\\n({{exportColorScheme}})","fileSaved":"File saved.","fileSavedToFilename":"Saved to {filename}","canvas":"canvas","selection":"selection"},"colors":{"495057":"Gray 7","ffffff":"White","f8f9fa":"Gray 0","f1f3f5":"Gray 1","fff5f5":"Red 0","fff0f6":"Pink 0","f8f0fc":"Grape 0","f3f0ff":"Violet 0","edf2ff":"Indigo 0","e7f5ff":"Blue 0","e3fafc":"Cyan 0","e6fcf5":"Teal 0","ebfbee":"Green 0","f4fce3":"Lime 0","fff9db":"Yellow 0","fff4e6":"Orange 0","transparent":"Transparent","ced4da":"Gray 4","868e96":"Gray 6","fa5252":"Red 6","e64980":"Pink 6","be4bdb":"Grape 6","7950f2":"Violet 6","4c6ef5":"Indigo 6","228be6":"Blue 6","15aabf":"Cyan 6","12b886":"Teal 6","40c057":"Green 6","82c91e":"Lime 6","fab005":"Yellow 6","fd7e14":"Orange 6","000000":"Black","343a40":"Gray 8","c92a2a":"Red 9","a61e4d":"Pink 9","862e9c":"Grape 9","5f3dc4":"Violet 9","364fc7":"Indigo 9","1864ab":"Blue 9","0b7285":"Cyan 9","087f5b":"Teal 9","2b8a3e":"Green 9","5c940d":"Lime 9","e67700":"Yellow 9","d9480f":"Orange 9"}}')}},s={};function l(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={id:e,loaded:!1,exports:{}};return a[e].call(n.exports,n,n.exports,l),n.loaded=!0,n.exports}return l.m=a,l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,l.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 i=Object.create(null);l.r(i);var o={};n=n||[null,r({}),r([]),r(r)];for(var a=2&t&&e;"object"==typeof a&&!~n.indexOf(a);a=r(a))Object.getOwnPropertyNames(a).forEach((t=>o[t]=()=>e[t]));return o.default=()=>e,l.d(i,o),i},l.d=(e,t)=>{for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.f={},l.e=e=>Promise.all(Object.keys(l.f).reduce(((t,n)=>(l.f[n](e,t),t)),[])),l.u=e=>"excalidraw-assets/"+{9:"image",736:"vendor"}[e]+"-"+{9:"2be1c869cd5bacebdc3c",736:"8698157b56eb5e0ee549"}[e]+".js",l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i={},o="Excalidraw:",l.l=(e,t,n,r)=>{if(i[e])i[e].push(t);else{var a,s;if(void 0!==n)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var u=c[d];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==o+n){a=u;break}}a||(s=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,l.nc&&a.setAttribute("nonce",l.nc),a.setAttribute("data-webpack",o+n),a.src=e),i[e]=[t];var h=(t,n)=>{a.onerror=a.onload=null,clearTimeout(p);var r=i[e];if(delete i[e],a.parentNode&&a.parentNode.removeChild(a),r&&r.forEach((e=>e(n))),t)return t(n)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),s&&document.head.appendChild(a)}},l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),l.p="",(()=>{l.b=document.baseURI||self.location.href;var e={388:0};l.f.j=(t,n)=>{var r=l.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var i=new Promise(((n,i)=>r=e[t]=[n,i]));n.push(r[2]=i);var o=l.p+l.u(t),a=new Error;l.l(o,(n=>{if(l.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var i=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+i+": "+o+")",a.name="ChunkLoadError",a.type=i,a.request=o,r[1](a)}}),"chunk-"+t,t)}};var t=(t,n)=>{var r,i,[o,a,s]=n,c=0;if(o.some((t=>0!==e[t]))){for(r in a)l.o(a,r)&&(l.m[r]=a[r]);if(s)s(l)}for(t&&t(n);c<o.length;c++)i=o[c],l.o(e,i)&&e[i]&&e[i][0](),e[o[c]]=0},n=self.webpackChunkExcalidraw=self.webpackChunkExcalidraw||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),l(1143)})()}));
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.Excalidraw=t(require("react"),require("react-dom")):e.Excalidraw=t(e.React,e.ReactDOM)}(self,(function(e,t){return(()=>{var n,r,i,o,a={200:(e,t,n)=>{var r="Expected a function",i=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt,c="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,d="object"==typeof self&&self&&self.Object===Object&&self,u=c||d||Function("return this")(),h=Object.prototype.toString,p=Math.max,g=Math.min,m=function(){return u.Date.now()};function f(e,t,n){var i,o,a,s,l,c,d=0,u=!1,h=!1,f=!0;if("function"!=typeof e)throw new TypeError(r);function x(t){var n=i,r=o;return i=o=void 0,d=t,s=e.apply(r,n)}function y(e){return d=e,l=setTimeout(k,t),u?x(e):s}function w(e){var n=e-c;return void 0===c||n>=t||n<0||h&&e-d>=a}function k(){var e=m();if(w(e))return _(e);l=setTimeout(k,function(e){var n=t-(e-c);return h?g(n,a-(e-d)):n}(e))}function _(e){return l=void 0,f&&i?x(e):(i=o=void 0,s)}function C(){var e=m(),n=w(e);if(i=arguments,o=this,c=e,n){if(void 0===l)return y(c);if(h)return l=setTimeout(k,t),x(c)}return void 0===l&&(l=setTimeout(k,t)),s}return t=v(t)||0,b(n)&&(u=!!n.leading,a=(h="maxWait"in n)?p(v(n.maxWait)||0,t):a,f="trailing"in n?!!n.trailing:f),C.cancel=function(){void 0!==l&&clearTimeout(l),d=0,i=c=o=l=void 0},C.flush=function(){return void 0===l?s:_(m())},C}function b(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function v(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==h.call(e)}(e))return NaN;if(b(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=b(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var n=a.test(e);return n||s.test(e)?l(e.slice(2),n?2:8):o.test(e)?NaN:+e}e.exports=function(e,t,n){var i=!0,o=!0;if("function"!=typeof e)throw new TypeError(r);return b(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),f(e,t,{leading:i,maxWait:t,trailing:o})}},2891:function(e,t,n){var r;e=n.nmd(e),function(){var i,o="Expected a function",a="__lodash_hash_undefined__",s="__lodash_placeholder__",l=16,c=32,d=64,u=128,h=256,p=1/0,g=9007199254740991,m=NaN,f=4294967295,b=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",l],["flip",512],["partial",c],["partialRight",d],["rearg",h]],v="[object Arguments]",x="[object Array]",y="[object Boolean]",w="[object Date]",k="[object Error]",_="[object Function]",C="[object GeneratorFunction]",E="[object Map]",S="[object Number]",j="[object Object]",I="[object Promise]",T="[object RegExp]",M="[object Set]",O="[object String]",L="[object Symbol]",A="[object WeakMap]",P="[object ArrayBuffer]",D="[object DataView]",z="[object Float32Array]",R="[object Float64Array]",H="[object Int8Array]",N="[object Int16Array]",B="[object Int32Array]",F="[object Uint8Array]",U="[object Uint8ClampedArray]",W="[object Uint16Array]",K="[object Uint32Array]",V=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,Y=/(__e\(.*?\)|\b__t\)) \+\n'';/g,X=/&(?:amp|lt|gt|quot|#39);/g,Z=/[&<>"']/g,q=RegExp(X.source),$=RegExp(Z.source),Q=/<%-([\s\S]+?)%>/g,J=/<%([\s\S]+?)%>/g,ee=/<%=([\s\S]+?)%>/g,te=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ne=/^\w*$/,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ie=/[\\^$.*+?()[\]{}|]/g,oe=RegExp(ie.source),ae=/^\s+/,se=/\s/,le=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ce=/\{\n\/\* \[wrapped with (.+)\] \*/,de=/,? & /,ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,he=/[()=,{}\[\]\/\s]/,pe=/\\(\\)?/g,ge=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,me=/\w*$/,fe=/^[-+]0x[0-9a-f]+$/i,be=/^0b[01]+$/i,ve=/^\[object .+?Constructor\]$/,xe=/^0o[0-7]+$/i,ye=/^(?:0|[1-9]\d*)$/,we=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ke=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,Ce="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ee="\\u2700-\\u27bf",Se="a-z\\xdf-\\xf6\\xf8-\\xff",je="A-Z\\xc0-\\xd6\\xd8-\\xde",Ie="\\ufe0e\\ufe0f",Te="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Me="['’]",Oe="[\\ud800-\\udfff]",Le="["+Te+"]",Ae="["+Ce+"]",Pe="\\d+",De="[\\u2700-\\u27bf]",ze="["+Se+"]",Re="[^\\ud800-\\udfff"+Te+Pe+Ee+Se+je+"]",He="\\ud83c[\\udffb-\\udfff]",Ne="[^\\ud800-\\udfff]",Be="(?:\\ud83c[\\udde6-\\uddff]){2}",Fe="[\\ud800-\\udbff][\\udc00-\\udfff]",Ue="["+je+"]",We="(?:"+ze+"|"+Re+")",Ke="(?:"+Ue+"|"+Re+")",Ve="(?:['’](?:d|ll|m|re|s|t|ve))?",Ge="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ye="(?:"+Ae+"|"+He+")"+"?",Xe="[\\ufe0e\\ufe0f]?",Ze=Xe+Ye+("(?:\\u200d(?:"+[Ne,Be,Fe].join("|")+")"+Xe+Ye+")*"),qe="(?:"+[De,Be,Fe].join("|")+")"+Ze,$e="(?:"+[Ne+Ae+"?",Ae,Be,Fe,Oe].join("|")+")",Qe=RegExp(Me,"g"),Je=RegExp(Ae,"g"),et=RegExp(He+"(?="+He+")|"+$e+Ze,"g"),tt=RegExp([Ue+"?"+ze+"+"+Ve+"(?="+[Le,Ue,"$"].join("|")+")",Ke+"+"+Ge+"(?="+[Le,Ue+We,"$"].join("|")+")",Ue+"?"+We+"+"+Ve,Ue+"+"+Ge,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pe,qe].join("|"),"g"),nt=RegExp("[\\u200d\\ud800-\\udfff"+Ce+Ie+"]"),rt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,it=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ot=-1,at={};at[z]=at[R]=at[H]=at[N]=at[B]=at[F]=at[U]=at[W]=at[K]=!0,at[v]=at[x]=at[P]=at[y]=at[D]=at[w]=at[k]=at[_]=at[E]=at[S]=at[j]=at[T]=at[M]=at[O]=at[A]=!1;var st={};st[v]=st[x]=st[P]=st[D]=st[y]=st[w]=st[z]=st[R]=st[H]=st[N]=st[B]=st[E]=st[S]=st[j]=st[T]=st[M]=st[O]=st[L]=st[F]=st[U]=st[W]=st[K]=!0,st[k]=st[_]=st[A]=!1;var lt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ct=parseFloat,dt=parseInt,ut="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ht="object"==typeof self&&self&&self.Object===Object&&self,pt=ut||ht||Function("return this")(),gt=t&&!t.nodeType&&t,mt=gt&&e&&!e.nodeType&&e,ft=mt&&mt.exports===gt,bt=ft&&ut.process,vt=function(){try{var e=mt&&mt.require&&mt.require("util").types;return e||bt&&bt.binding&&bt.binding("util")}catch(e){}}(),xt=vt&&vt.isArrayBuffer,yt=vt&&vt.isDate,wt=vt&&vt.isMap,kt=vt&&vt.isRegExp,_t=vt&&vt.isSet,Ct=vt&&vt.isTypedArray;function Et(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function St(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(r,a,n(a),e)}return r}function jt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function It(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function Tt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function Mt(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function Ot(e,t){return!!(null==e?0:e.length)&&Ft(e,t,0)>-1}function Lt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function At(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function Pt(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function Dt(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function zt(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function Rt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Ht=Vt("length");function Nt(e,t,n){var r;return n(e,(function(e,n,i){if(t(e,n,i))return r=n,!1})),r}function Bt(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Ft(e,t,n){return t==t?function(e,t,n){var r=n-1,i=e.length;for(;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):Bt(e,Wt,n)}function Ut(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function Wt(e){return e!=e}function Kt(e,t){var n=null==e?0:e.length;return n?Xt(e,t)/n:m}function Vt(e){return function(t){return null==t?i:t[e]}}function Gt(e){return function(t){return null==e?i:e[t]}}function Yt(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}function Xt(e,t){for(var n,r=-1,o=e.length;++r<o;){var a=t(e[r]);a!==i&&(n=n===i?a:n+a)}return n}function Zt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function qt(e){return e?e.slice(0,mn(e)+1).replace(ae,""):e}function $t(e){return function(t){return e(t)}}function Qt(e,t){return At(t,(function(t){return e[t]}))}function Jt(e,t){return e.has(t)}function en(e,t){for(var n=-1,r=e.length;++n<r&&Ft(t,e[n],0)>-1;);return n}function tn(e,t){for(var n=e.length;n--&&Ft(t,e[n],0)>-1;);return n}function nn(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var rn=Gt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),on=Gt({"&":"&","<":"<",">":">",'"':""","'":"'"});function an(e){return"\\"+lt[e]}function sn(e){return nt.test(e)}function ln(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function cn(e,t){return function(n){return e(t(n))}}function dn(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n];a!==t&&a!==s||(e[n]=s,o[i++]=n)}return o}function un(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}function hn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}function pn(e){return sn(e)?function(e){var t=et.lastIndex=0;for(;et.test(e);)++t;return t}(e):Ht(e)}function gn(e){return sn(e)?function(e){return e.match(et)||[]}(e):function(e){return e.split("")}(e)}function mn(e){for(var t=e.length;t--&&se.test(e.charAt(t)););return t}var fn=Gt({"&":"&","<":"<",">":">",""":'"',"'":"'"});var bn=function e(t){var n,r=(t=null==t?pt:bn.defaults(pt.Object(),t,bn.pick(pt,it))).Array,se=t.Date,Ce=t.Error,Ee=t.Function,Se=t.Math,je=t.Object,Ie=t.RegExp,Te=t.String,Me=t.TypeError,Oe=r.prototype,Le=Ee.prototype,Ae=je.prototype,Pe=t["__core-js_shared__"],De=Le.toString,ze=Ae.hasOwnProperty,Re=0,He=(n=/[^.]+$/.exec(Pe&&Pe.keys&&Pe.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Ne=Ae.toString,Be=De.call(je),Fe=pt._,Ue=Ie("^"+De.call(ze).replace(ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),We=ft?t.Buffer:i,Ke=t.Symbol,Ve=t.Uint8Array,Ge=We?We.allocUnsafe:i,Ye=cn(je.getPrototypeOf,je),Xe=je.create,Ze=Ae.propertyIsEnumerable,qe=Oe.splice,$e=Ke?Ke.isConcatSpreadable:i,et=Ke?Ke.iterator:i,nt=Ke?Ke.toStringTag:i,lt=function(){try{var e=go(je,"defineProperty");return e({},"",{}),e}catch(e){}}(),ut=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,ht=se&&se.now!==pt.Date.now&&se.now,gt=t.setTimeout!==pt.setTimeout&&t.setTimeout,mt=Se.ceil,bt=Se.floor,vt=je.getOwnPropertySymbols,Ht=We?We.isBuffer:i,Gt=t.isFinite,vn=Oe.join,xn=cn(je.keys,je),yn=Se.max,wn=Se.min,kn=se.now,_n=t.parseInt,Cn=Se.random,En=Oe.reverse,Sn=go(t,"DataView"),jn=go(t,"Map"),In=go(t,"Promise"),Tn=go(t,"Set"),Mn=go(t,"WeakMap"),On=go(je,"create"),Ln=Mn&&new Mn,An={},Pn=Fo(Sn),Dn=Fo(jn),zn=Fo(In),Rn=Fo(Tn),Hn=Fo(Mn),Nn=Ke?Ke.prototype:i,Bn=Nn?Nn.valueOf:i,Fn=Nn?Nn.toString:i;function Un(e){if(is(e)&&!Ya(e)&&!(e instanceof Gn)){if(e instanceof Vn)return e;if(ze.call(e,"__wrapped__"))return Uo(e)}return new Vn(e)}var Wn=function(){function e(){}return function(t){if(!rs(t))return{};if(Xe)return Xe(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function Kn(){}function Vn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function Gn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f,this.__views__=[]}function Yn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Xn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Zn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function qn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Zn;++t<n;)this.add(e[t])}function $n(e){var t=this.__data__=new Xn(e);this.size=t.size}function Qn(e,t){var n=Ya(e),r=!n&&Ga(e),i=!n&&!r&&$a(e),o=!n&&!r&&!i&&hs(e),a=n||r||i||o,s=a?Zt(e.length,Te):[],l=s.length;for(var c in e)!t&&!ze.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||wo(c,l))||s.push(c);return s}function Jn(e){var t=e.length;return t?e[qr(0,t-1)]:i}function er(e,t){return Ho(Oi(e),cr(t,0,e.length))}function tr(e){return Ho(Oi(e))}function nr(e,t,n){(n!==i&&!Wa(e[t],n)||n===i&&!(t in e))&&sr(e,t,n)}function rr(e,t,n){var r=e[t];ze.call(e,t)&&Wa(r,n)&&(n!==i||t in e)||sr(e,t,n)}function ir(e,t){for(var n=e.length;n--;)if(Wa(e[n][0],t))return n;return-1}function or(e,t,n,r){return gr(e,(function(e,i,o){t(r,e,n(e),o)})),r}function ar(e,t){return e&&Li(t,Ps(t),e)}function sr(e,t,n){"__proto__"==t&<?lt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function lr(e,t){for(var n=-1,o=t.length,a=r(o),s=null==e;++n<o;)a[n]=s?i:Ts(e,t[n]);return a}function cr(e,t,n){return e==e&&(n!==i&&(e=e<=n?e:n),t!==i&&(e=e>=t?e:t)),e}function dr(e,t,n,r,o,a){var s,l=1&t,c=2&t,d=4&t;if(n&&(s=o?n(e,r,o,a):n(e)),s!==i)return s;if(!rs(e))return e;var u=Ya(e);if(u){if(s=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&ze.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!l)return Oi(e,s)}else{var h=bo(e),p=h==_||h==C;if($a(e))return Ei(e,l);if(h==j||h==v||p&&!o){if(s=c||p?{}:xo(e),!l)return c?function(e,t){return Li(e,fo(e),t)}(e,function(e,t){return e&&Li(t,Ds(t),e)}(s,e)):function(e,t){return Li(e,mo(e),t)}(e,ar(s,e))}else{if(!st[h])return o?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case P:return Si(e);case y:case w:return new r(+e);case D:return function(e,t){var n=t?Si(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case z:case R:case H:case N:case B:case F:case U:case W:case K:return ji(e,n);case E:case M:return new r;case S:case O:return new r(e);case T:return function(e){var t=new e.constructor(e.source,me.exec(e));return t.lastIndex=e.lastIndex,t}(e);case L:return i=e,Bn?je(Bn.call(i)):{}}var i}(e,h,l)}}a||(a=new $n);var g=a.get(e);if(g)return g;a.set(e,s),cs(e)?e.forEach((function(r){s.add(dr(r,t,n,r,e,a))})):os(e)&&e.forEach((function(r,i){s.set(i,dr(r,t,n,i,e,a))}));var m=u?i:(d?c?ao:oo:c?Ds:Ps)(e);return jt(m||e,(function(r,i){m&&(r=e[i=r]),rr(s,i,dr(r,t,n,i,e,a))})),s}function ur(e,t,n){var r=n.length;if(null==e)return!r;for(e=je(e);r--;){var o=n[r],a=t[o],s=e[o];if(s===i&&!(o in e)||!a(s))return!1}return!0}function hr(e,t,n){if("function"!=typeof e)throw new Me(o);return Po((function(){e.apply(i,n)}),t)}function pr(e,t,n,r){var i=-1,o=Ot,a=!0,s=e.length,l=[],c=t.length;if(!s)return l;n&&(t=At(t,$t(n))),r?(o=Lt,a=!1):t.length>=200&&(o=Jt,a=!1,t=new qn(t));e:for(;++i<s;){var d=e[i],u=null==n?d:n(d);if(d=r||0!==d?d:0,a&&u==u){for(var h=c;h--;)if(t[h]===u)continue e;l.push(d)}else o(t,u,r)||l.push(d)}return l}Un.templateSettings={escape:Q,evaluate:J,interpolate:ee,variable:"",imports:{_:Un}},Un.prototype=Kn.prototype,Un.prototype.constructor=Un,Vn.prototype=Wn(Kn.prototype),Vn.prototype.constructor=Vn,Gn.prototype=Wn(Kn.prototype),Gn.prototype.constructor=Gn,Yn.prototype.clear=function(){this.__data__=On?On(null):{},this.size=0},Yn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Yn.prototype.get=function(e){var t=this.__data__;if(On){var n=t[e];return n===a?i:n}return ze.call(t,e)?t[e]:i},Yn.prototype.has=function(e){var t=this.__data__;return On?t[e]!==i:ze.call(t,e)},Yn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=On&&t===i?a:t,this},Xn.prototype.clear=function(){this.__data__=[],this.size=0},Xn.prototype.delete=function(e){var t=this.__data__,n=ir(t,e);return!(n<0)&&(n==t.length-1?t.pop():qe.call(t,n,1),--this.size,!0)},Xn.prototype.get=function(e){var t=this.__data__,n=ir(t,e);return n<0?i:t[n][1]},Xn.prototype.has=function(e){return ir(this.__data__,e)>-1},Xn.prototype.set=function(e,t){var n=this.__data__,r=ir(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Zn.prototype.clear=function(){this.size=0,this.__data__={hash:new Yn,map:new(jn||Xn),string:new Yn}},Zn.prototype.delete=function(e){var t=ho(this,e).delete(e);return this.size-=t?1:0,t},Zn.prototype.get=function(e){return ho(this,e).get(e)},Zn.prototype.has=function(e){return ho(this,e).has(e)},Zn.prototype.set=function(e,t){var n=ho(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},qn.prototype.add=qn.prototype.push=function(e){return this.__data__.set(e,a),this},qn.prototype.has=function(e){return this.__data__.has(e)},$n.prototype.clear=function(){this.__data__=new Xn,this.size=0},$n.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},$n.prototype.get=function(e){return this.__data__.get(e)},$n.prototype.has=function(e){return this.__data__.has(e)},$n.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Xn){var r=n.__data__;if(!jn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Zn(r)}return n.set(e,t),this.size=n.size,this};var gr=Di(kr),mr=Di(_r,!0);function fr(e,t){var n=!0;return gr(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function br(e,t,n){for(var r=-1,o=e.length;++r<o;){var a=e[r],s=t(a);if(null!=s&&(l===i?s==s&&!us(s):n(s,l)))var l=s,c=a}return c}function vr(e,t){var n=[];return gr(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}function xr(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=yo),i||(i=[]);++o<a;){var s=e[o];t>0&&n(s)?t>1?xr(s,t-1,n,r,i):Pt(i,s):r||(i[i.length]=s)}return i}var yr=zi(),wr=zi(!0);function kr(e,t){return e&&yr(e,t,Ps)}function _r(e,t){return e&&wr(e,t,Ps)}function Cr(e,t){return Mt(t,(function(t){return es(e[t])}))}function Er(e,t){for(var n=0,r=(t=wi(t,e)).length;null!=e&&n<r;)e=e[Bo(t[n++])];return n&&n==r?e:i}function Sr(e,t,n){var r=t(e);return Ya(e)?r:Pt(r,n(e))}function jr(e){return null==e?e===i?"[object Undefined]":"[object Null]":nt&&nt in je(e)?function(e){var t=ze.call(e,nt),n=e[nt];try{e[nt]=i;var r=!0}catch(e){}var o=Ne.call(e);r&&(t?e[nt]=n:delete e[nt]);return o}(e):function(e){return Ne.call(e)}(e)}function Ir(e,t){return e>t}function Tr(e,t){return null!=e&&ze.call(e,t)}function Mr(e,t){return null!=e&&t in je(e)}function Or(e,t,n){for(var o=n?Lt:Ot,a=e[0].length,s=e.length,l=s,c=r(s),d=1/0,u=[];l--;){var h=e[l];l&&t&&(h=At(h,$t(t))),d=wn(h.length,d),c[l]=!n&&(t||a>=120&&h.length>=120)?new qn(l&&h):i}h=e[0];var p=-1,g=c[0];e:for(;++p<a&&u.length<d;){var m=h[p],f=t?t(m):m;if(m=n||0!==m?m:0,!(g?Jt(g,f):o(u,f,n))){for(l=s;--l;){var b=c[l];if(!(b?Jt(b,f):o(e[l],f,n)))continue e}g&&g.push(f),u.push(m)}}return u}function Lr(e,t,n){var r=null==(e=Mo(e,t=wi(t,e)))?e:e[Bo(Jo(t))];return null==r?i:Et(r,e,n)}function Ar(e){return is(e)&&jr(e)==v}function Pr(e,t,n,r,o){return e===t||(null==e||null==t||!is(e)&&!is(t)?e!=e&&t!=t:function(e,t,n,r,o,a){var s=Ya(e),l=Ya(t),c=s?x:bo(e),d=l?x:bo(t),u=(c=c==v?j:c)==j,h=(d=d==v?j:d)==j,p=c==d;if(p&&$a(e)){if(!$a(t))return!1;s=!0,u=!1}if(p&&!u)return a||(a=new $n),s||hs(e)?ro(e,t,n,r,o,a):function(e,t,n,r,i,o,a){switch(n){case D:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case P:return!(e.byteLength!=t.byteLength||!o(new Ve(e),new Ve(t)));case y:case w:case S:return Wa(+e,+t);case k:return e.name==t.name&&e.message==t.message;case T:case O:return e==t+"";case E:var s=ln;case M:var l=1&r;if(s||(s=un),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=2,a.set(e,t);var d=ro(s(e),s(t),r,i,o,a);return a.delete(e),d;case L:if(Bn)return Bn.call(e)==Bn.call(t)}return!1}(e,t,c,n,r,o,a);if(!(1&n)){var g=u&&ze.call(e,"__wrapped__"),m=h&&ze.call(t,"__wrapped__");if(g||m){var f=g?e.value():e,b=m?t.value():t;return a||(a=new $n),o(f,b,n,r,a)}}if(!p)return!1;return a||(a=new $n),function(e,t,n,r,o,a){var s=1&n,l=oo(e),c=l.length,d=oo(t).length;if(c!=d&&!s)return!1;var u=c;for(;u--;){var h=l[u];if(!(s?h in t:ze.call(t,h)))return!1}var p=a.get(e),g=a.get(t);if(p&&g)return p==t&&g==e;var m=!0;a.set(e,t),a.set(t,e);var f=s;for(;++u<c;){var b=e[h=l[u]],v=t[h];if(r)var x=s?r(v,b,h,t,e,a):r(b,v,h,e,t,a);if(!(x===i?b===v||o(b,v,n,r,a):x)){m=!1;break}f||(f="constructor"==h)}if(m&&!f){var y=e.constructor,w=t.constructor;y==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof w&&w instanceof w||(m=!1)}return a.delete(e),a.delete(t),m}(e,t,n,r,o,a)}(e,t,n,r,Pr,o))}function Dr(e,t,n,r){var o=n.length,a=o,s=!r;if(null==e)return!a;for(e=je(e);o--;){var l=n[o];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<a;){var c=(l=n[o])[0],d=e[c],u=l[1];if(s&&l[2]){if(d===i&&!(c in e))return!1}else{var h=new $n;if(r)var p=r(d,u,c,e,t,h);if(!(p===i?Pr(u,d,3,r,h):p))return!1}}return!0}function zr(e){return!(!rs(e)||(t=e,He&&He in t))&&(es(e)?Ue:ve).test(Fo(e));var t}function Rr(e){return"function"==typeof e?e:null==e?al:"object"==typeof e?Ya(e)?Wr(e[0],e[1]):Ur(e):ml(e)}function Hr(e){if(!So(e))return xn(e);var t=[];for(var n in je(e))ze.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Nr(e){if(!rs(e))return function(e){var t=[];if(null!=e)for(var n in je(e))t.push(n);return t}(e);var t=So(e),n=[];for(var r in e)("constructor"!=r||!t&&ze.call(e,r))&&n.push(r);return n}function Br(e,t){return e<t}function Fr(e,t){var n=-1,i=Za(e)?r(e.length):[];return gr(e,(function(e,r,o){i[++n]=t(e,r,o)})),i}function Ur(e){var t=po(e);return 1==t.length&&t[0][2]?Io(t[0][0],t[0][1]):function(n){return n===e||Dr(n,e,t)}}function Wr(e,t){return _o(e)&&jo(t)?Io(Bo(e),t):function(n){var r=Ts(n,e);return r===i&&r===t?Ms(n,e):Pr(t,r,3)}}function Kr(e,t,n,r,o){e!==t&&yr(t,(function(a,s){if(o||(o=new $n),rs(a))!function(e,t,n,r,o,a,s){var l=Lo(e,n),c=Lo(t,n),d=s.get(c);if(d)return void nr(e,n,d);var u=a?a(l,c,n+"",e,t,s):i,h=u===i;if(h){var p=Ya(c),g=!p&&$a(c),m=!p&&!g&&hs(c);u=c,p||g||m?Ya(l)?u=l:qa(l)?u=Oi(l):g?(h=!1,u=Ei(c,!0)):m?(h=!1,u=ji(c,!0)):u=[]:ss(c)||Ga(c)?(u=l,Ga(l)?u=ys(l):rs(l)&&!es(l)||(u=xo(c))):h=!1}h&&(s.set(c,u),o(u,c,r,a,s),s.delete(c));nr(e,n,u)}(e,t,s,n,Kr,r,o);else{var l=r?r(Lo(e,s),a,s+"",e,t,o):i;l===i&&(l=a),nr(e,s,l)}}),Ds)}function Vr(e,t){var n=e.length;if(n)return wo(t+=t<0?n:0,n)?e[t]:i}function Gr(e,t,n){t=t.length?At(t,(function(e){return Ya(e)?function(t){return Er(t,1===e.length?e[0]:e)}:e})):[al];var r=-1;t=At(t,$t(uo()));var i=Fr(e,(function(e,n,i){var o=At(t,(function(t){return t(e)}));return{criteria:o,index:++r,value:e}}));return function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(i,(function(e,t){return function(e,t,n){var r=-1,i=e.criteria,o=t.criteria,a=i.length,s=n.length;for(;++r<a;){var l=Ii(i[r],o[r]);if(l)return r>=s?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function Yr(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var a=t[r],s=Er(e,a);n(s,a)&&ti(o,wi(a,e),s)}return o}function Xr(e,t,n,r){var i=r?Ut:Ft,o=-1,a=t.length,s=e;for(e===t&&(t=Oi(t)),n&&(s=At(e,$t(n)));++o<a;)for(var l=0,c=t[o],d=n?n(c):c;(l=i(s,d,l,r))>-1;)s!==e&&qe.call(s,l,1),qe.call(e,l,1);return e}function Zr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;wo(i)?qe.call(e,i,1):pi(e,i)}}return e}function qr(e,t){return e+bt(Cn()*(t-e+1))}function $r(e,t){var n="";if(!e||t<1||t>g)return n;do{t%2&&(n+=e),(t=bt(t/2))&&(e+=e)}while(t);return n}function Qr(e,t){return Do(To(e,t,al),e+"")}function Jr(e){return Jn(Ws(e))}function ei(e,t){var n=Ws(e);return Ho(n,cr(t,0,n.length))}function ti(e,t,n,r){if(!rs(e))return e;for(var o=-1,a=(t=wi(t,e)).length,s=a-1,l=e;null!=l&&++o<a;){var c=Bo(t[o]),d=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=s){var u=l[c];(d=r?r(u,c,l):i)===i&&(d=rs(u)?u:wo(t[o+1])?[]:{})}rr(l,c,d),l=l[c]}return e}var ni=Ln?function(e,t){return Ln.set(e,t),e}:al,ri=lt?function(e,t){return lt(e,"toString",{configurable:!0,enumerable:!1,value:rl(t),writable:!0})}:al;function ii(e){return Ho(Ws(e))}function oi(e,t,n){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=r(o);++i<o;)a[i]=e[i+t];return a}function ai(e,t){var n;return gr(e,(function(e,r,i){return!(n=t(e,r,i))})),!!n}function si(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;r<i;){var o=r+i>>>1,a=e[o];null!==a&&!us(a)&&(n?a<=t:a<t)?r=o+1:i=o}return i}return li(e,t,al,n)}function li(e,t,n,r){var o=0,a=null==e?0:e.length;if(0===a)return 0;for(var s=(t=n(t))!=t,l=null===t,c=us(t),d=t===i;o<a;){var u=bt((o+a)/2),h=n(e[u]),p=h!==i,g=null===h,m=h==h,f=us(h);if(s)var b=r||m;else b=d?m&&(r||p):l?m&&p&&(r||!g):c?m&&p&&!g&&(r||!f):!g&&!f&&(r?h<=t:h<t);b?o=u+1:a=u}return wn(a,4294967294)}function ci(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n],s=t?t(a):a;if(!n||!Wa(s,l)){var l=s;o[i++]=0===a?0:a}}return o}function di(e){return"number"==typeof e?e:us(e)?m:+e}function ui(e){if("string"==typeof e)return e;if(Ya(e))return At(e,ui)+"";if(us(e))return Fn?Fn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function hi(e,t,n){var r=-1,i=Ot,o=e.length,a=!0,s=[],l=s;if(n)a=!1,i=Lt;else if(o>=200){var c=t?null:$i(e);if(c)return un(c);a=!1,i=Jt,l=new qn}else l=t?[]:s;e:for(;++r<o;){var d=e[r],u=t?t(d):d;if(d=n||0!==d?d:0,a&&u==u){for(var h=l.length;h--;)if(l[h]===u)continue e;t&&l.push(u),s.push(d)}else i(l,u,n)||(l!==s&&l.push(u),s.push(d))}return s}function pi(e,t){return null==(e=Mo(e,t=wi(t,e)))||delete e[Bo(Jo(t))]}function gi(e,t,n,r){return ti(e,t,n(Er(e,t)),r)}function mi(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?oi(e,r?0:o,r?o+1:i):oi(e,r?o+1:0,r?i:o)}function fi(e,t){var n=e;return n instanceof Gn&&(n=n.value()),Dt(t,(function(e,t){return t.func.apply(t.thisArg,Pt([e],t.args))}),n)}function bi(e,t,n){var i=e.length;if(i<2)return i?hi(e[0]):[];for(var o=-1,a=r(i);++o<i;)for(var s=e[o],l=-1;++l<i;)l!=o&&(a[o]=pr(a[o]||s,e[l],t,n));return hi(xr(a,1),t,n)}function vi(e,t,n){for(var r=-1,o=e.length,a=t.length,s={};++r<o;){var l=r<a?t[r]:i;n(s,e[r],l)}return s}function xi(e){return qa(e)?e:[]}function yi(e){return"function"==typeof e?e:al}function wi(e,t){return Ya(e)?e:_o(e,t)?[e]:No(ws(e))}var ki=Qr;function _i(e,t,n){var r=e.length;return n=n===i?r:n,!t&&n>=r?e:oi(e,t,n)}var Ci=ut||function(e){return pt.clearTimeout(e)};function Ei(e,t){if(t)return e.slice();var n=e.length,r=Ge?Ge(n):new e.constructor(n);return e.copy(r),r}function Si(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t}function ji(e,t){var n=t?Si(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ii(e,t){if(e!==t){var n=e!==i,r=null===e,o=e==e,a=us(e),s=t!==i,l=null===t,c=t==t,d=us(t);if(!l&&!d&&!a&&e>t||a&&s&&c&&!l&&!d||r&&s&&c||!n&&c||!o)return 1;if(!r&&!a&&!d&&e<t||d&&n&&o&&!r&&!a||l&&n&&o||!s&&o||!c)return-1}return 0}function Ti(e,t,n,i){for(var o=-1,a=e.length,s=n.length,l=-1,c=t.length,d=yn(a-s,0),u=r(c+d),h=!i;++l<c;)u[l]=t[l];for(;++o<s;)(h||o<a)&&(u[n[o]]=e[o]);for(;d--;)u[l++]=e[o++];return u}function Mi(e,t,n,i){for(var o=-1,a=e.length,s=-1,l=n.length,c=-1,d=t.length,u=yn(a-l,0),h=r(u+d),p=!i;++o<u;)h[o]=e[o];for(var g=o;++c<d;)h[g+c]=t[c];for(;++s<l;)(p||o<a)&&(h[g+n[s]]=e[o++]);return h}function Oi(e,t){var n=-1,i=e.length;for(t||(t=r(i));++n<i;)t[n]=e[n];return t}function Li(e,t,n,r){var o=!n;n||(n={});for(var a=-1,s=t.length;++a<s;){var l=t[a],c=r?r(n[l],e[l],l,n,e):i;c===i&&(c=e[l]),o?sr(n,l,c):rr(n,l,c)}return n}function Ai(e,t){return function(n,r){var i=Ya(n)?St:or,o=t?t():{};return i(n,e,uo(r,2),o)}}function Pi(e){return Qr((function(t,n){var r=-1,o=n.length,a=o>1?n[o-1]:i,s=o>2?n[2]:i;for(a=e.length>3&&"function"==typeof a?(o--,a):i,s&&ko(n[0],n[1],s)&&(a=o<3?i:a,o=1),t=je(t);++r<o;){var l=n[r];l&&e(t,l,r,a)}return t}))}function Di(e,t){return function(n,r){if(null==n)return n;if(!Za(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=je(n);(t?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function zi(e){return function(t,n,r){for(var i=-1,o=je(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(!1===n(o[l],l,o))break}return t}}function Ri(e){return function(t){var n=sn(t=ws(t))?gn(t):i,r=n?n[0]:t.charAt(0),o=n?_i(n,1).join(""):t.slice(1);return r[e]()+o}}function Hi(e){return function(t){return Dt(el(Gs(t).replace(Qe,"")),e,"")}}function Ni(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Wn(e.prototype),r=e.apply(n,t);return rs(r)?r:n}}function Bi(e){return function(t,n,r){var o=je(t);if(!Za(t)){var a=uo(n,3);t=Ps(t),n=function(e){return a(o[e],e,o)}}var s=e(t,n,r);return s>-1?o[a?t[s]:s]:i}}function Fi(e){return io((function(t){var n=t.length,r=n,a=Vn.prototype.thru;for(e&&t.reverse();r--;){var s=t[r];if("function"!=typeof s)throw new Me(o);if(a&&!l&&"wrapper"==lo(s))var l=new Vn([],!0)}for(r=l?r:n;++r<n;){var c=lo(s=t[r]),d="wrapper"==c?so(s):i;l=d&&Co(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?l[lo(d[0])].apply(l,d[3]):1==s.length&&Co(s)?l[c]():l.thru(s)}return function(){var e=arguments,r=e[0];if(l&&1==e.length&&Ya(r))return l.plant(r).value();for(var i=0,o=n?t[i].apply(this,e):r;++i<n;)o=t[i].call(this,o);return o}}))}function Ui(e,t,n,o,a,s,l,c,d,h){var p=t&u,g=1&t,m=2&t,f=24&t,b=512&t,v=m?i:Ni(e);return function i(){for(var u=arguments.length,x=r(u),y=u;y--;)x[y]=arguments[y];if(f)var w=co(i),k=nn(x,w);if(o&&(x=Ti(x,o,a,f)),s&&(x=Mi(x,s,l,f)),u-=k,f&&u<h){var _=dn(x,w);return Zi(e,t,Ui,i.placeholder,n,x,_,c,d,h-u)}var C=g?n:this,E=m?C[e]:e;return u=x.length,c?x=Oo(x,c):b&&u>1&&x.reverse(),p&&d<u&&(x.length=d),this&&this!==pt&&this instanceof i&&(E=v||Ni(E)),E.apply(C,x)}}function Wi(e,t){return function(n,r){return function(e,t,n,r){return kr(e,(function(e,i,o){t(r,n(e),i,o)})),r}(n,e,t(r),{})}}function Ki(e,t){return function(n,r){var o;if(n===i&&r===i)return t;if(n!==i&&(o=n),r!==i){if(o===i)return r;"string"==typeof n||"string"==typeof r?(n=ui(n),r=ui(r)):(n=di(n),r=di(r)),o=e(n,r)}return o}}function Vi(e){return io((function(t){return t=At(t,$t(uo())),Qr((function(n){var r=this;return e(t,(function(e){return Et(e,r,n)}))}))}))}function Gi(e,t){var n=(t=t===i?" ":ui(t)).length;if(n<2)return n?$r(t,e):t;var r=$r(t,mt(e/pn(t)));return sn(t)?_i(gn(r),0,e).join(""):r.slice(0,e)}function Yi(e){return function(t,n,o){return o&&"number"!=typeof o&&ko(t,n,o)&&(n=o=i),t=fs(t),n===i?(n=t,t=0):n=fs(n),function(e,t,n,i){for(var o=-1,a=yn(mt((t-e)/(n||1)),0),s=r(a);a--;)s[i?a:++o]=e,e+=n;return s}(t,n,o=o===i?t<n?1:-1:fs(o),e)}}function Xi(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=xs(t),n=xs(n)),e(t,n)}}function Zi(e,t,n,r,o,a,s,l,u,h){var p=8&t;t|=p?c:d,4&(t&=~(p?d:c))||(t&=-4);var g=[e,t,o,p?a:i,p?s:i,p?i:a,p?i:s,l,u,h],m=n.apply(i,g);return Co(e)&&Ao(m,g),m.placeholder=r,zo(m,e,t)}function qi(e){var t=Se[e];return function(e,n){if(e=xs(e),(n=null==n?0:wn(bs(n),292))&&Gt(e)){var r=(ws(e)+"e").split("e");return+((r=(ws(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var $i=Tn&&1/un(new Tn([,-0]))[1]==p?function(e){return new Tn(e)}:ul;function Qi(e){return function(t){var n=bo(t);return n==E?ln(t):n==M?hn(t):function(e,t){return At(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Ji(e,t,n,a,p,g,m,f){var b=2&t;if(!b&&"function"!=typeof e)throw new Me(o);var v=a?a.length:0;if(v||(t&=-97,a=p=i),m=m===i?m:yn(bs(m),0),f=f===i?f:bs(f),v-=p?p.length:0,t&d){var x=a,y=p;a=p=i}var w=b?i:so(e),k=[e,t,n,a,p,x,y,g,m,f];if(w&&function(e,t){var n=e[1],r=t[1],i=n|r,o=i<131,a=r==u&&8==n||r==u&&n==h&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!o&&!a)return e;1&r&&(e[2]=t[2],i|=1&n?0:4);var l=t[3];if(l){var c=e[3];e[3]=c?Ti(c,l,t[4]):l,e[4]=c?dn(e[3],s):t[4]}(l=t[5])&&(c=e[5],e[5]=c?Mi(c,l,t[6]):l,e[6]=c?dn(e[5],s):t[6]);(l=t[7])&&(e[7]=l);r&u&&(e[8]=null==e[8]?t[8]:wn(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=i}(k,w),e=k[0],t=k[1],n=k[2],a=k[3],p=k[4],!(f=k[9]=k[9]===i?b?0:e.length:yn(k[9]-v,0))&&24&t&&(t&=-25),t&&1!=t)_=8==t||t==l?function(e,t,n){var o=Ni(e);return function a(){for(var s=arguments.length,l=r(s),c=s,d=co(a);c--;)l[c]=arguments[c];var u=s<3&&l[0]!==d&&l[s-1]!==d?[]:dn(l,d);return(s-=u.length)<n?Zi(e,t,Ui,a.placeholder,i,l,u,i,i,n-s):Et(this&&this!==pt&&this instanceof a?o:e,this,l)}}(e,t,f):t!=c&&33!=t||p.length?Ui.apply(i,k):function(e,t,n,i){var o=1&t,a=Ni(e);return function t(){for(var s=-1,l=arguments.length,c=-1,d=i.length,u=r(d+l),h=this&&this!==pt&&this instanceof t?a:e;++c<d;)u[c]=i[c];for(;l--;)u[c++]=arguments[++s];return Et(h,o?n:this,u)}}(e,t,n,a);else var _=function(e,t,n){var r=1&t,i=Ni(e);return function t(){return(this&&this!==pt&&this instanceof t?i:e).apply(r?n:this,arguments)}}(e,t,n);return zo((w?ni:Ao)(_,k),e,t)}function eo(e,t,n,r){return e===i||Wa(e,Ae[n])&&!ze.call(r,n)?t:e}function to(e,t,n,r,o,a){return rs(e)&&rs(t)&&(a.set(t,e),Kr(e,t,i,to,a),a.delete(t)),e}function no(e){return ss(e)?i:e}function ro(e,t,n,r,o,a){var s=1&n,l=e.length,c=t.length;if(l!=c&&!(s&&c>l))return!1;var d=a.get(e),u=a.get(t);if(d&&u)return d==t&&u==e;var h=-1,p=!0,g=2&n?new qn:i;for(a.set(e,t),a.set(t,e);++h<l;){var m=e[h],f=t[h];if(r)var b=s?r(f,m,h,t,e,a):r(m,f,h,e,t,a);if(b!==i){if(b)continue;p=!1;break}if(g){if(!Rt(t,(function(e,t){if(!Jt(g,t)&&(m===e||o(m,e,n,r,a)))return g.push(t)}))){p=!1;break}}else if(m!==f&&!o(m,f,n,r,a)){p=!1;break}}return a.delete(e),a.delete(t),p}function io(e){return Do(To(e,i,Xo),e+"")}function oo(e){return Sr(e,Ps,mo)}function ao(e){return Sr(e,Ds,fo)}var so=Ln?function(e){return Ln.get(e)}:ul;function lo(e){for(var t=e.name+"",n=An[t],r=ze.call(An,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function co(e){return(ze.call(Un,"placeholder")?Un:e).placeholder}function uo(){var e=Un.iteratee||sl;return e=e===sl?Rr:e,arguments.length?e(arguments[0],arguments[1]):e}function ho(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function po(e){for(var t=Ps(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,jo(i)]}return t}function go(e,t){var n=function(e,t){return null==e?i:e[t]}(e,t);return zr(n)?n:i}var mo=vt?function(e){return null==e?[]:(e=je(e),Mt(vt(e),(function(t){return Ze.call(e,t)})))}:vl,fo=vt?function(e){for(var t=[];e;)Pt(t,mo(e)),e=Ye(e);return t}:vl,bo=jr;function vo(e,t,n){for(var r=-1,i=(t=wi(t,e)).length,o=!1;++r<i;){var a=Bo(t[r]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&ns(i)&&wo(a,i)&&(Ya(e)||Ga(e))}function xo(e){return"function"!=typeof e.constructor||So(e)?{}:Wn(Ye(e))}function yo(e){return Ya(e)||Ga(e)||!!($e&&e&&e[$e])}function wo(e,t){var n=typeof e;return!!(t=null==t?g:t)&&("number"==n||"symbol"!=n&&ye.test(e))&&e>-1&&e%1==0&&e<t}function ko(e,t,n){if(!rs(n))return!1;var r=typeof t;return!!("number"==r?Za(n)&&wo(t,n.length):"string"==r&&t in n)&&Wa(n[t],e)}function _o(e,t){if(Ya(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!us(e))||(ne.test(e)||!te.test(e)||null!=t&&e in je(t))}function Co(e){var t=lo(e),n=Un[t];if("function"!=typeof n||!(t in Gn.prototype))return!1;if(e===n)return!0;var r=so(n);return!!r&&e===r[0]}(Sn&&bo(new Sn(new ArrayBuffer(1)))!=D||jn&&bo(new jn)!=E||In&&bo(In.resolve())!=I||Tn&&bo(new Tn)!=M||Mn&&bo(new Mn)!=A)&&(bo=function(e){var t=jr(e),n=t==j?e.constructor:i,r=n?Fo(n):"";if(r)switch(r){case Pn:return D;case Dn:return E;case zn:return I;case Rn:return M;case Hn:return A}return t});var Eo=Pe?es:xl;function So(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ae)}function jo(e){return e==e&&!rs(e)}function Io(e,t){return function(n){return null!=n&&(n[e]===t&&(t!==i||e in je(n)))}}function To(e,t,n){return t=yn(t===i?e.length-1:t,0),function(){for(var i=arguments,o=-1,a=yn(i.length-t,0),s=r(a);++o<a;)s[o]=i[t+o];o=-1;for(var l=r(t+1);++o<t;)l[o]=i[o];return l[t]=n(s),Et(e,this,l)}}function Mo(e,t){return t.length<2?e:Er(e,oi(t,0,-1))}function Oo(e,t){for(var n=e.length,r=wn(t.length,n),o=Oi(e);r--;){var a=t[r];e[r]=wo(a,n)?o[a]:i}return e}function Lo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Ao=Ro(ni),Po=gt||function(e,t){return pt.setTimeout(e,t)},Do=Ro(ri);function zo(e,t,n){var r=t+"";return Do(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(le,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return jt(b,(function(n){var r="_."+n[0];t&n[1]&&!Ot(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(ce);return t?t[1].split(de):[]}(r),n)))}function Ro(e){var t=0,n=0;return function(){var r=kn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Ho(e,t){var n=-1,r=e.length,o=r-1;for(t=t===i?r:t;++n<t;){var a=qr(n,o),s=e[a];e[a]=e[n],e[n]=s}return e.length=t,e}var No=function(e){var t=Ra(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(re,(function(e,n,r,i){t.push(r?i.replace(pe,"$1"):n||e)})),t}));function Bo(e){if("string"==typeof e||us(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Fo(e){if(null!=e){try{return De.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Uo(e){if(e instanceof Gn)return e.clone();var t=new Vn(e.__wrapped__,e.__chain__);return t.__actions__=Oi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Wo=Qr((function(e,t){return qa(e)?pr(e,xr(t,1,qa,!0)):[]})),Ko=Qr((function(e,t){var n=Jo(t);return qa(n)&&(n=i),qa(e)?pr(e,xr(t,1,qa,!0),uo(n,2)):[]})),Vo=Qr((function(e,t){var n=Jo(t);return qa(n)&&(n=i),qa(e)?pr(e,xr(t,1,qa,!0),i,n):[]}));function Go(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:bs(n);return i<0&&(i=yn(r+i,0)),Bt(e,uo(t,3),i)}function Yo(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r-1;return n!==i&&(o=bs(n),o=n<0?yn(r+o,0):wn(o,r-1)),Bt(e,uo(t,3),o,!0)}function Xo(e){return(null==e?0:e.length)?xr(e,1):[]}function Zo(e){return e&&e.length?e[0]:i}var qo=Qr((function(e){var t=At(e,xi);return t.length&&t[0]===e[0]?Or(t):[]})),$o=Qr((function(e){var t=Jo(e),n=At(e,xi);return t===Jo(n)?t=i:n.pop(),n.length&&n[0]===e[0]?Or(n,uo(t,2)):[]})),Qo=Qr((function(e){var t=Jo(e),n=At(e,xi);return(t="function"==typeof t?t:i)&&n.pop(),n.length&&n[0]===e[0]?Or(n,i,t):[]}));function Jo(e){var t=null==e?0:e.length;return t?e[t-1]:i}var ea=Qr(ta);function ta(e,t){return e&&e.length&&t&&t.length?Xr(e,t):e}var na=io((function(e,t){var n=null==e?0:e.length,r=lr(e,t);return Zr(e,At(t,(function(e){return wo(e,n)?+e:e})).sort(Ii)),r}));function ra(e){return null==e?e:En.call(e)}var ia=Qr((function(e){return hi(xr(e,1,qa,!0))})),oa=Qr((function(e){var t=Jo(e);return qa(t)&&(t=i),hi(xr(e,1,qa,!0),uo(t,2))})),aa=Qr((function(e){var t=Jo(e);return t="function"==typeof t?t:i,hi(xr(e,1,qa,!0),i,t)}));function sa(e){if(!e||!e.length)return[];var t=0;return e=Mt(e,(function(e){if(qa(e))return t=yn(e.length,t),!0})),Zt(t,(function(t){return At(e,Vt(t))}))}function la(e,t){if(!e||!e.length)return[];var n=sa(e);return null==t?n:At(n,(function(e){return Et(t,i,e)}))}var ca=Qr((function(e,t){return qa(e)?pr(e,t):[]})),da=Qr((function(e){return bi(Mt(e,qa))})),ua=Qr((function(e){var t=Jo(e);return qa(t)&&(t=i),bi(Mt(e,qa),uo(t,2))})),ha=Qr((function(e){var t=Jo(e);return t="function"==typeof t?t:i,bi(Mt(e,qa),i,t)})),pa=Qr(sa);var ga=Qr((function(e){var t=e.length,n=t>1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,la(e,n)}));function ma(e){var t=Un(e);return t.__chain__=!0,t}function fa(e,t){return t(e)}var ba=io((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return lr(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Gn&&wo(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:fa,args:[o],thisArg:i}),new Vn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)}));var va=Ai((function(e,t,n){ze.call(e,n)?++e[n]:sr(e,n,1)}));var xa=Bi(Go),ya=Bi(Yo);function wa(e,t){return(Ya(e)?jt:gr)(e,uo(t,3))}function ka(e,t){return(Ya(e)?It:mr)(e,uo(t,3))}var _a=Ai((function(e,t,n){ze.call(e,n)?e[n].push(t):sr(e,n,[t])}));var Ca=Qr((function(e,t,n){var i=-1,o="function"==typeof t,a=Za(e)?r(e.length):[];return gr(e,(function(e){a[++i]=o?Et(t,e,n):Lr(e,t,n)})),a})),Ea=Ai((function(e,t,n){sr(e,n,t)}));function Sa(e,t){return(Ya(e)?At:Fr)(e,uo(t,3))}var ja=Ai((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var Ia=Qr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&ko(e,t[0],t[1])?t=[]:n>2&&ko(t[0],t[1],t[2])&&(t=[t[0]]),Gr(e,xr(t,1),[])})),Ta=ht||function(){return pt.Date.now()};function Ma(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,Ji(e,u,i,i,i,i,t)}function Oa(e,t){var n;if("function"!=typeof t)throw new Me(o);return e=bs(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var La=Qr((function(e,t,n){var r=1;if(n.length){var i=dn(n,co(La));r|=c}return Ji(e,r,t,n,i)})),Aa=Qr((function(e,t,n){var r=3;if(n.length){var i=dn(n,co(Aa));r|=c}return Ji(t,r,e,n,i)}));function Pa(e,t,n){var r,a,s,l,c,d,u=0,h=!1,p=!1,g=!0;if("function"!=typeof e)throw new Me(o);function m(t){var n=r,o=a;return r=a=i,u=t,l=e.apply(o,n)}function f(e){return u=e,c=Po(v,t),h?m(e):l}function b(e){var n=e-d;return d===i||n>=t||n<0||p&&e-u>=s}function v(){var e=Ta();if(b(e))return x(e);c=Po(v,function(e){var n=t-(e-d);return p?wn(n,s-(e-u)):n}(e))}function x(e){return c=i,g&&r?m(e):(r=a=i,l)}function y(){var e=Ta(),n=b(e);if(r=arguments,a=this,d=e,n){if(c===i)return f(d);if(p)return Ci(c),c=Po(v,t),m(d)}return c===i&&(c=Po(v,t)),l}return t=xs(t)||0,rs(n)&&(h=!!n.leading,s=(p="maxWait"in n)?yn(xs(n.maxWait)||0,t):s,g="trailing"in n?!!n.trailing:g),y.cancel=function(){c!==i&&Ci(c),u=0,r=d=a=c=i},y.flush=function(){return c===i?l:x(Ta())},y}var Da=Qr((function(e,t){return hr(e,1,t)})),za=Qr((function(e,t,n){return hr(e,xs(t)||0,n)}));function Ra(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Me(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Ra.Cache||Zn),n}function Ha(e){if("function"!=typeof e)throw new Me(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ra.Cache=Zn;var Na=ki((function(e,t){var n=(t=1==t.length&&Ya(t[0])?At(t[0],$t(uo())):At(xr(t,1),$t(uo()))).length;return Qr((function(r){for(var i=-1,o=wn(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return Et(e,this,r)}))})),Ba=Qr((function(e,t){var n=dn(t,co(Ba));return Ji(e,c,i,t,n)})),Fa=Qr((function(e,t){var n=dn(t,co(Fa));return Ji(e,d,i,t,n)})),Ua=io((function(e,t){return Ji(e,h,i,i,i,t)}));function Wa(e,t){return e===t||e!=e&&t!=t}var Ka=Xi(Ir),Va=Xi((function(e,t){return e>=t})),Ga=Ar(function(){return arguments}())?Ar:function(e){return is(e)&&ze.call(e,"callee")&&!Ze.call(e,"callee")},Ya=r.isArray,Xa=xt?$t(xt):function(e){return is(e)&&jr(e)==P};function Za(e){return null!=e&&ns(e.length)&&!es(e)}function qa(e){return is(e)&&Za(e)}var $a=Ht||xl,Qa=yt?$t(yt):function(e){return is(e)&&jr(e)==w};function Ja(e){if(!is(e))return!1;var t=jr(e);return t==k||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ss(e)}function es(e){if(!rs(e))return!1;var t=jr(e);return t==_||t==C||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ts(e){return"number"==typeof e&&e==bs(e)}function ns(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=g}function rs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function is(e){return null!=e&&"object"==typeof e}var os=wt?$t(wt):function(e){return is(e)&&bo(e)==E};function as(e){return"number"==typeof e||is(e)&&jr(e)==S}function ss(e){if(!is(e)||jr(e)!=j)return!1;var t=Ye(e);if(null===t)return!0;var n=ze.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&De.call(n)==Be}var ls=kt?$t(kt):function(e){return is(e)&&jr(e)==T};var cs=_t?$t(_t):function(e){return is(e)&&bo(e)==M};function ds(e){return"string"==typeof e||!Ya(e)&&is(e)&&jr(e)==O}function us(e){return"symbol"==typeof e||is(e)&&jr(e)==L}var hs=Ct?$t(Ct):function(e){return is(e)&&ns(e.length)&&!!at[jr(e)]};var ps=Xi(Br),gs=Xi((function(e,t){return e<=t}));function ms(e){if(!e)return[];if(Za(e))return ds(e)?gn(e):Oi(e);if(et&&e[et])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[et]());var t=bo(e);return(t==E?ln:t==M?un:Ws)(e)}function fs(e){return e?(e=xs(e))===p||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function bs(e){var t=fs(e),n=t%1;return t==t?n?t-n:t:0}function vs(e){return e?cr(bs(e),0,f):0}function xs(e){if("number"==typeof e)return e;if(us(e))return m;if(rs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=rs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=qt(e);var n=be.test(e);return n||xe.test(e)?dt(e.slice(2),n?2:8):fe.test(e)?m:+e}function ys(e){return Li(e,Ds(e))}function ws(e){return null==e?"":ui(e)}var ks=Pi((function(e,t){if(So(t)||Za(t))Li(t,Ps(t),e);else for(var n in t)ze.call(t,n)&&rr(e,n,t[n])})),_s=Pi((function(e,t){Li(t,Ds(t),e)})),Cs=Pi((function(e,t,n,r){Li(t,Ds(t),e,r)})),Es=Pi((function(e,t,n,r){Li(t,Ps(t),e,r)})),Ss=io(lr);var js=Qr((function(e,t){e=je(e);var n=-1,r=t.length,o=r>2?t[2]:i;for(o&&ko(t[0],t[1],o)&&(r=1);++n<r;)for(var a=t[n],s=Ds(a),l=-1,c=s.length;++l<c;){var d=s[l],u=e[d];(u===i||Wa(u,Ae[d])&&!ze.call(e,d))&&(e[d]=a[d])}return e})),Is=Qr((function(e){return e.push(i,to),Et(Rs,i,e)}));function Ts(e,t,n){var r=null==e?i:Er(e,t);return r===i?n:r}function Ms(e,t){return null!=e&&vo(e,t,Mr)}var Os=Wi((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),e[t]=n}),rl(al)),Ls=Wi((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),ze.call(e,t)?e[t].push(n):e[t]=[n]}),uo),As=Qr(Lr);function Ps(e){return Za(e)?Qn(e):Hr(e)}function Ds(e){return Za(e)?Qn(e,!0):Nr(e)}var zs=Pi((function(e,t,n){Kr(e,t,n)})),Rs=Pi((function(e,t,n,r){Kr(e,t,n,r)})),Hs=io((function(e,t){var n={};if(null==e)return n;var r=!1;t=At(t,(function(t){return t=wi(t,e),r||(r=t.length>1),t})),Li(e,ao(e),n),r&&(n=dr(n,7,no));for(var i=t.length;i--;)pi(n,t[i]);return n}));var Ns=io((function(e,t){return null==e?{}:function(e,t){return Yr(e,t,(function(t,n){return Ms(e,n)}))}(e,t)}));function Bs(e,t){if(null==e)return{};var n=At(ao(e),(function(e){return[e]}));return t=uo(t),Yr(e,n,(function(e,n){return t(e,n[0])}))}var Fs=Qi(Ps),Us=Qi(Ds);function Ws(e){return null==e?[]:Qt(e,Ps(e))}var Ks=Hi((function(e,t,n){return t=t.toLowerCase(),e+(n?Vs(t):t)}));function Vs(e){return Js(ws(e).toLowerCase())}function Gs(e){return(e=ws(e))&&e.replace(we,rn).replace(Je,"")}var Ys=Hi((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Xs=Hi((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Zs=Ri("toLowerCase");var qs=Hi((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var $s=Hi((function(e,t,n){return e+(n?" ":"")+Js(t)}));var Qs=Hi((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Js=Ri("toUpperCase");function el(e,t,n){return e=ws(e),(t=n?i:t)===i?function(e){return rt.test(e)}(e)?function(e){return e.match(tt)||[]}(e):function(e){return e.match(ue)||[]}(e):e.match(t)||[]}var tl=Qr((function(e,t){try{return Et(e,i,t)}catch(e){return Ja(e)?e:new Ce(e)}})),nl=io((function(e,t){return jt(t,(function(t){t=Bo(t),sr(e,t,La(e[t],e))})),e}));function rl(e){return function(){return e}}var il=Fi(),ol=Fi(!0);function al(e){return e}function sl(e){return Rr("function"==typeof e?e:dr(e,1))}var ll=Qr((function(e,t){return function(n){return Lr(n,e,t)}})),cl=Qr((function(e,t){return function(n){return Lr(e,n,t)}}));function dl(e,t,n){var r=Ps(t),i=Cr(t,r);null!=n||rs(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=Cr(t,Ps(t)));var o=!(rs(n)&&"chain"in n&&!n.chain),a=es(e);return jt(i,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=Oi(this.__actions__);return i.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Pt([this.value()],arguments))})})),e}function ul(){}var hl=Vi(At),pl=Vi(Tt),gl=Vi(Rt);function ml(e){return _o(e)?Vt(Bo(e)):function(e){return function(t){return Er(t,e)}}(e)}var fl=Yi(),bl=Yi(!0);function vl(){return[]}function xl(){return!1}var yl=Ki((function(e,t){return e+t}),0),wl=qi("ceil"),kl=Ki((function(e,t){return e/t}),1),_l=qi("floor");var Cl,El=Ki((function(e,t){return e*t}),1),Sl=qi("round"),jl=Ki((function(e,t){return e-t}),0);return Un.after=function(e,t){if("function"!=typeof t)throw new Me(o);return e=bs(e),function(){if(--e<1)return t.apply(this,arguments)}},Un.ary=Ma,Un.assign=ks,Un.assignIn=_s,Un.assignInWith=Cs,Un.assignWith=Es,Un.at=Ss,Un.before=Oa,Un.bind=La,Un.bindAll=nl,Un.bindKey=Aa,Un.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ya(e)?e:[e]},Un.chain=ma,Un.chunk=function(e,t,n){t=(n?ko(e,t,n):t===i)?1:yn(bs(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var a=0,s=0,l=r(mt(o/t));a<o;)l[s++]=oi(e,a,a+=t);return l},Un.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i},Un.concat=function(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],i=e;i--;)t[i-1]=arguments[i];return Pt(Ya(n)?Oi(n):[n],xr(t,1))},Un.cond=function(e){var t=null==e?0:e.length,n=uo();return e=t?At(e,(function(e){if("function"!=typeof e[1])throw new Me(o);return[n(e[0]),e[1]]})):[],Qr((function(n){for(var r=-1;++r<t;){var i=e[r];if(Et(i[0],this,n))return Et(i[1],this,n)}}))},Un.conforms=function(e){return function(e){var t=Ps(e);return function(n){return ur(n,e,t)}}(dr(e,1))},Un.constant=rl,Un.countBy=va,Un.create=function(e,t){var n=Wn(e);return null==t?n:ar(n,t)},Un.curry=function e(t,n,r){var o=Ji(t,8,i,i,i,i,i,n=r?i:n);return o.placeholder=e.placeholder,o},Un.curryRight=function e(t,n,r){var o=Ji(t,l,i,i,i,i,i,n=r?i:n);return o.placeholder=e.placeholder,o},Un.debounce=Pa,Un.defaults=js,Un.defaultsDeep=Is,Un.defer=Da,Un.delay=za,Un.difference=Wo,Un.differenceBy=Ko,Un.differenceWith=Vo,Un.drop=function(e,t,n){var r=null==e?0:e.length;return r?oi(e,(t=n||t===i?1:bs(t))<0?0:t,r):[]},Un.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?oi(e,0,(t=r-(t=n||t===i?1:bs(t)))<0?0:t):[]},Un.dropRightWhile=function(e,t){return e&&e.length?mi(e,uo(t,3),!0,!0):[]},Un.dropWhile=function(e,t){return e&&e.length?mi(e,uo(t,3),!0):[]},Un.fill=function(e,t,n,r){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&ko(e,t,n)&&(n=0,r=o),function(e,t,n,r){var o=e.length;for((n=bs(n))<0&&(n=-n>o?0:o+n),(r=r===i||r>o?o:bs(r))<0&&(r+=o),r=n>r?0:vs(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},Un.filter=function(e,t){return(Ya(e)?Mt:vr)(e,uo(t,3))},Un.flatMap=function(e,t){return xr(Sa(e,t),1)},Un.flatMapDeep=function(e,t){return xr(Sa(e,t),p)},Un.flatMapDepth=function(e,t,n){return n=n===i?1:bs(n),xr(Sa(e,t),n)},Un.flatten=Xo,Un.flattenDeep=function(e){return(null==e?0:e.length)?xr(e,p):[]},Un.flattenDepth=function(e,t){return(null==e?0:e.length)?xr(e,t=t===i?1:bs(t)):[]},Un.flip=function(e){return Ji(e,512)},Un.flow=il,Un.flowRight=ol,Un.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},Un.functions=function(e){return null==e?[]:Cr(e,Ps(e))},Un.functionsIn=function(e){return null==e?[]:Cr(e,Ds(e))},Un.groupBy=_a,Un.initial=function(e){return(null==e?0:e.length)?oi(e,0,-1):[]},Un.intersection=qo,Un.intersectionBy=$o,Un.intersectionWith=Qo,Un.invert=Os,Un.invertBy=Ls,Un.invokeMap=Ca,Un.iteratee=sl,Un.keyBy=Ea,Un.keys=Ps,Un.keysIn=Ds,Un.map=Sa,Un.mapKeys=function(e,t){var n={};return t=uo(t,3),kr(e,(function(e,r,i){sr(n,t(e,r,i),e)})),n},Un.mapValues=function(e,t){var n={};return t=uo(t,3),kr(e,(function(e,r,i){sr(n,r,t(e,r,i))})),n},Un.matches=function(e){return Ur(dr(e,1))},Un.matchesProperty=function(e,t){return Wr(e,dr(t,1))},Un.memoize=Ra,Un.merge=zs,Un.mergeWith=Rs,Un.method=ll,Un.methodOf=cl,Un.mixin=dl,Un.negate=Ha,Un.nthArg=function(e){return e=bs(e),Qr((function(t){return Vr(t,e)}))},Un.omit=Hs,Un.omitBy=function(e,t){return Bs(e,Ha(uo(t)))},Un.once=function(e){return Oa(2,e)},Un.orderBy=function(e,t,n,r){return null==e?[]:(Ya(t)||(t=null==t?[]:[t]),Ya(n=r?i:n)||(n=null==n?[]:[n]),Gr(e,t,n))},Un.over=hl,Un.overArgs=Na,Un.overEvery=pl,Un.overSome=gl,Un.partial=Ba,Un.partialRight=Fa,Un.partition=ja,Un.pick=Ns,Un.pickBy=Bs,Un.property=ml,Un.propertyOf=function(e){return function(t){return null==e?i:Er(e,t)}},Un.pull=ea,Un.pullAll=ta,Un.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Xr(e,t,uo(n,2)):e},Un.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Xr(e,t,i,n):e},Un.pullAt=na,Un.range=fl,Un.rangeRight=bl,Un.rearg=Ua,Un.reject=function(e,t){return(Ya(e)?Mt:vr)(e,Ha(uo(t,3)))},Un.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=uo(t,3);++r<o;){var a=e[r];t(a,r,e)&&(n.push(a),i.push(r))}return Zr(e,i),n},Un.rest=function(e,t){if("function"!=typeof e)throw new Me(o);return Qr(e,t=t===i?t:bs(t))},Un.reverse=ra,Un.sampleSize=function(e,t,n){return t=(n?ko(e,t,n):t===i)?1:bs(t),(Ya(e)?er:ei)(e,t)},Un.set=function(e,t,n){return null==e?e:ti(e,t,n)},Un.setWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:ti(e,t,n,r)},Un.shuffle=function(e){return(Ya(e)?tr:ii)(e)},Un.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&ko(e,t,n)?(t=0,n=r):(t=null==t?0:bs(t),n=n===i?r:bs(n)),oi(e,t,n)):[]},Un.sortBy=Ia,Un.sortedUniq=function(e){return e&&e.length?ci(e):[]},Un.sortedUniqBy=function(e,t){return e&&e.length?ci(e,uo(t,2)):[]},Un.split=function(e,t,n){return n&&"number"!=typeof n&&ko(e,t,n)&&(t=n=i),(n=n===i?f:n>>>0)?(e=ws(e))&&("string"==typeof t||null!=t&&!ls(t))&&!(t=ui(t))&&sn(e)?_i(gn(e),0,n):e.split(t,n):[]},Un.spread=function(e,t){if("function"!=typeof e)throw new Me(o);return t=null==t?0:yn(bs(t),0),Qr((function(n){var r=n[t],i=_i(n,0,t);return r&&Pt(i,r),Et(e,this,i)}))},Un.tail=function(e){var t=null==e?0:e.length;return t?oi(e,1,t):[]},Un.take=function(e,t,n){return e&&e.length?oi(e,0,(t=n||t===i?1:bs(t))<0?0:t):[]},Un.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?oi(e,(t=r-(t=n||t===i?1:bs(t)))<0?0:t,r):[]},Un.takeRightWhile=function(e,t){return e&&e.length?mi(e,uo(t,3),!1,!0):[]},Un.takeWhile=function(e,t){return e&&e.length?mi(e,uo(t,3)):[]},Un.tap=function(e,t){return t(e),e},Un.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new Me(o);return rs(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Pa(e,t,{leading:r,maxWait:t,trailing:i})},Un.thru=fa,Un.toArray=ms,Un.toPairs=Fs,Un.toPairsIn=Us,Un.toPath=function(e){return Ya(e)?At(e,Bo):us(e)?[e]:Oi(No(ws(e)))},Un.toPlainObject=ys,Un.transform=function(e,t,n){var r=Ya(e),i=r||$a(e)||hs(e);if(t=uo(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:rs(e)&&es(o)?Wn(Ye(e)):{}}return(i?jt:kr)(e,(function(e,r,i){return t(n,e,r,i)})),n},Un.unary=function(e){return Ma(e,1)},Un.union=ia,Un.unionBy=oa,Un.unionWith=aa,Un.uniq=function(e){return e&&e.length?hi(e):[]},Un.uniqBy=function(e,t){return e&&e.length?hi(e,uo(t,2)):[]},Un.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?hi(e,i,t):[]},Un.unset=function(e,t){return null==e||pi(e,t)},Un.unzip=sa,Un.unzipWith=la,Un.update=function(e,t,n){return null==e?e:gi(e,t,yi(n))},Un.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:gi(e,t,yi(n),r)},Un.values=Ws,Un.valuesIn=function(e){return null==e?[]:Qt(e,Ds(e))},Un.without=ca,Un.words=el,Un.wrap=function(e,t){return Ba(yi(t),e)},Un.xor=da,Un.xorBy=ua,Un.xorWith=ha,Un.zip=pa,Un.zipObject=function(e,t){return vi(e||[],t||[],rr)},Un.zipObjectDeep=function(e,t){return vi(e||[],t||[],ti)},Un.zipWith=ga,Un.entries=Fs,Un.entriesIn=Us,Un.extend=_s,Un.extendWith=Cs,dl(Un,Un),Un.add=yl,Un.attempt=tl,Un.camelCase=Ks,Un.capitalize=Vs,Un.ceil=wl,Un.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=xs(n))==n?n:0),t!==i&&(t=(t=xs(t))==t?t:0),cr(xs(e),t,n)},Un.clone=function(e){return dr(e,4)},Un.cloneDeep=function(e){return dr(e,5)},Un.cloneDeepWith=function(e,t){return dr(e,5,t="function"==typeof t?t:i)},Un.cloneWith=function(e,t){return dr(e,4,t="function"==typeof t?t:i)},Un.conformsTo=function(e,t){return null==t||ur(e,t,Ps(t))},Un.deburr=Gs,Un.defaultTo=function(e,t){return null==e||e!=e?t:e},Un.divide=kl,Un.endsWith=function(e,t,n){e=ws(e),t=ui(t);var r=e.length,o=n=n===i?r:cr(bs(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},Un.eq=Wa,Un.escape=function(e){return(e=ws(e))&&$.test(e)?e.replace(Z,on):e},Un.escapeRegExp=function(e){return(e=ws(e))&&oe.test(e)?e.replace(ie,"\\$&"):e},Un.every=function(e,t,n){var r=Ya(e)?Tt:fr;return n&&ko(e,t,n)&&(t=i),r(e,uo(t,3))},Un.find=xa,Un.findIndex=Go,Un.findKey=function(e,t){return Nt(e,uo(t,3),kr)},Un.findLast=ya,Un.findLastIndex=Yo,Un.findLastKey=function(e,t){return Nt(e,uo(t,3),_r)},Un.floor=_l,Un.forEach=wa,Un.forEachRight=ka,Un.forIn=function(e,t){return null==e?e:yr(e,uo(t,3),Ds)},Un.forInRight=function(e,t){return null==e?e:wr(e,uo(t,3),Ds)},Un.forOwn=function(e,t){return e&&kr(e,uo(t,3))},Un.forOwnRight=function(e,t){return e&&_r(e,uo(t,3))},Un.get=Ts,Un.gt=Ka,Un.gte=Va,Un.has=function(e,t){return null!=e&&vo(e,t,Tr)},Un.hasIn=Ms,Un.head=Zo,Un.identity=al,Un.includes=function(e,t,n,r){e=Za(e)?e:Ws(e),n=n&&!r?bs(n):0;var i=e.length;return n<0&&(n=yn(i+n,0)),ds(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Ft(e,t,n)>-1},Un.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:bs(n);return i<0&&(i=yn(r+i,0)),Ft(e,t,i)},Un.inRange=function(e,t,n){return t=fs(t),n===i?(n=t,t=0):n=fs(n),function(e,t,n){return e>=wn(t,n)&&e<yn(t,n)}(e=xs(e),t,n)},Un.invoke=As,Un.isArguments=Ga,Un.isArray=Ya,Un.isArrayBuffer=Xa,Un.isArrayLike=Za,Un.isArrayLikeObject=qa,Un.isBoolean=function(e){return!0===e||!1===e||is(e)&&jr(e)==y},Un.isBuffer=$a,Un.isDate=Qa,Un.isElement=function(e){return is(e)&&1===e.nodeType&&!ss(e)},Un.isEmpty=function(e){if(null==e)return!0;if(Za(e)&&(Ya(e)||"string"==typeof e||"function"==typeof e.splice||$a(e)||hs(e)||Ga(e)))return!e.length;var t=bo(e);if(t==E||t==M)return!e.size;if(So(e))return!Hr(e).length;for(var n in e)if(ze.call(e,n))return!1;return!0},Un.isEqual=function(e,t){return Pr(e,t)},Un.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:i)?n(e,t):i;return r===i?Pr(e,t,i,n):!!r},Un.isError=Ja,Un.isFinite=function(e){return"number"==typeof e&&Gt(e)},Un.isFunction=es,Un.isInteger=ts,Un.isLength=ns,Un.isMap=os,Un.isMatch=function(e,t){return e===t||Dr(e,t,po(t))},Un.isMatchWith=function(e,t,n){return n="function"==typeof n?n:i,Dr(e,t,po(t),n)},Un.isNaN=function(e){return as(e)&&e!=+e},Un.isNative=function(e){if(Eo(e))throw new Ce("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return zr(e)},Un.isNil=function(e){return null==e},Un.isNull=function(e){return null===e},Un.isNumber=as,Un.isObject=rs,Un.isObjectLike=is,Un.isPlainObject=ss,Un.isRegExp=ls,Un.isSafeInteger=function(e){return ts(e)&&e>=-9007199254740991&&e<=g},Un.isSet=cs,Un.isString=ds,Un.isSymbol=us,Un.isTypedArray=hs,Un.isUndefined=function(e){return e===i},Un.isWeakMap=function(e){return is(e)&&bo(e)==A},Un.isWeakSet=function(e){return is(e)&&"[object WeakSet]"==jr(e)},Un.join=function(e,t){return null==e?"":vn.call(e,t)},Un.kebabCase=Ys,Un.last=Jo,Un.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=bs(n))<0?yn(r+o,0):wn(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):Bt(e,Wt,o,!0)},Un.lowerCase=Xs,Un.lowerFirst=Zs,Un.lt=ps,Un.lte=gs,Un.max=function(e){return e&&e.length?br(e,al,Ir):i},Un.maxBy=function(e,t){return e&&e.length?br(e,uo(t,2),Ir):i},Un.mean=function(e){return Kt(e,al)},Un.meanBy=function(e,t){return Kt(e,uo(t,2))},Un.min=function(e){return e&&e.length?br(e,al,Br):i},Un.minBy=function(e,t){return e&&e.length?br(e,uo(t,2),Br):i},Un.stubArray=vl,Un.stubFalse=xl,Un.stubObject=function(){return{}},Un.stubString=function(){return""},Un.stubTrue=function(){return!0},Un.multiply=El,Un.nth=function(e,t){return e&&e.length?Vr(e,bs(t)):i},Un.noConflict=function(){return pt._===this&&(pt._=Fe),this},Un.noop=ul,Un.now=Ta,Un.pad=function(e,t,n){e=ws(e);var r=(t=bs(t))?pn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Gi(bt(i),n)+e+Gi(mt(i),n)},Un.padEnd=function(e,t,n){e=ws(e);var r=(t=bs(t))?pn(e):0;return t&&r<t?e+Gi(t-r,n):e},Un.padStart=function(e,t,n){e=ws(e);var r=(t=bs(t))?pn(e):0;return t&&r<t?Gi(t-r,n)+e:e},Un.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),_n(ws(e).replace(ae,""),t||0)},Un.random=function(e,t,n){if(n&&"boolean"!=typeof n&&ko(e,t,n)&&(t=n=i),n===i&&("boolean"==typeof t?(n=t,t=i):"boolean"==typeof e&&(n=e,e=i)),e===i&&t===i?(e=0,t=1):(e=fs(e),t===i?(t=e,e=0):t=fs(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var o=Cn();return wn(e+o*(t-e+ct("1e-"+((o+"").length-1))),t)}return qr(e,t)},Un.reduce=function(e,t,n){var r=Ya(e)?Dt:Yt,i=arguments.length<3;return r(e,uo(t,4),n,i,gr)},Un.reduceRight=function(e,t,n){var r=Ya(e)?zt:Yt,i=arguments.length<3;return r(e,uo(t,4),n,i,mr)},Un.repeat=function(e,t,n){return t=(n?ko(e,t,n):t===i)?1:bs(t),$r(ws(e),t)},Un.replace=function(){var e=arguments,t=ws(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Un.result=function(e,t,n){var r=-1,o=(t=wi(t,e)).length;for(o||(o=1,e=i);++r<o;){var a=null==e?i:e[Bo(t[r])];a===i&&(r=o,a=n),e=es(a)?a.call(e):a}return e},Un.round=Sl,Un.runInContext=e,Un.sample=function(e){return(Ya(e)?Jn:Jr)(e)},Un.size=function(e){if(null==e)return 0;if(Za(e))return ds(e)?pn(e):e.length;var t=bo(e);return t==E||t==M?e.size:Hr(e).length},Un.snakeCase=qs,Un.some=function(e,t,n){var r=Ya(e)?Rt:ai;return n&&ko(e,t,n)&&(t=i),r(e,uo(t,3))},Un.sortedIndex=function(e,t){return si(e,t)},Un.sortedIndexBy=function(e,t,n){return li(e,t,uo(n,2))},Un.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=si(e,t);if(r<n&&Wa(e[r],t))return r}return-1},Un.sortedLastIndex=function(e,t){return si(e,t,!0)},Un.sortedLastIndexBy=function(e,t,n){return li(e,t,uo(n,2),!0)},Un.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var n=si(e,t,!0)-1;if(Wa(e[n],t))return n}return-1},Un.startCase=$s,Un.startsWith=function(e,t,n){return e=ws(e),n=null==n?0:cr(bs(n),0,e.length),t=ui(t),e.slice(n,n+t.length)==t},Un.subtract=jl,Un.sum=function(e){return e&&e.length?Xt(e,al):0},Un.sumBy=function(e,t){return e&&e.length?Xt(e,uo(t,2)):0},Un.template=function(e,t,n){var r=Un.templateSettings;n&&ko(e,t,n)&&(t=i),e=ws(e),t=Cs({},t,r,eo);var o,a,s=Cs({},t.imports,r.imports,eo),l=Ps(s),c=Qt(s,l),d=0,u=t.interpolate||ke,h="__p += '",p=Ie((t.escape||ke).source+"|"+u.source+"|"+(u===ee?ge:ke).source+"|"+(t.evaluate||ke).source+"|$","g"),g="//# sourceURL="+(ze.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ot+"]")+"\n";e.replace(p,(function(t,n,r,i,s,l){return r||(r=i),h+=e.slice(d,l).replace(_e,an),n&&(o=!0,h+="' +\n__e("+n+") +\n'"),s&&(a=!0,h+="';\n"+s+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),d=l+t.length,t})),h+="';\n";var m=ze.call(t,"variable")&&t.variable;if(m){if(he.test(m))throw new Ce("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(a?h.replace(V,""):h).replace(G,"$1").replace(Y,"$1;"),h="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var f=tl((function(){return Ee(l,g+"return "+h).apply(i,c)}));if(f.source=h,Ja(f))throw f;return f},Un.times=function(e,t){if((e=bs(e))<1||e>g)return[];var n=f,r=wn(e,f);t=uo(t),e-=f;for(var i=Zt(r,t);++n<e;)t(n);return i},Un.toFinite=fs,Un.toInteger=bs,Un.toLength=vs,Un.toLower=function(e){return ws(e).toLowerCase()},Un.toNumber=xs,Un.toSafeInteger=function(e){return e?cr(bs(e),-9007199254740991,g):0===e?e:0},Un.toString=ws,Un.toUpper=function(e){return ws(e).toUpperCase()},Un.trim=function(e,t,n){if((e=ws(e))&&(n||t===i))return qt(e);if(!e||!(t=ui(t)))return e;var r=gn(e),o=gn(t);return _i(r,en(r,o),tn(r,o)+1).join("")},Un.trimEnd=function(e,t,n){if((e=ws(e))&&(n||t===i))return e.slice(0,mn(e)+1);if(!e||!(t=ui(t)))return e;var r=gn(e);return _i(r,0,tn(r,gn(t))+1).join("")},Un.trimStart=function(e,t,n){if((e=ws(e))&&(n||t===i))return e.replace(ae,"");if(!e||!(t=ui(t)))return e;var r=gn(e);return _i(r,en(r,gn(t))).join("")},Un.truncate=function(e,t){var n=30,r="...";if(rs(t)){var o="separator"in t?t.separator:o;n="length"in t?bs(t.length):n,r="omission"in t?ui(t.omission):r}var a=(e=ws(e)).length;if(sn(e)){var s=gn(e);a=s.length}if(n>=a)return e;var l=n-pn(r);if(l<1)return r;var c=s?_i(s,0,l).join(""):e.slice(0,l);if(o===i)return c+r;if(s&&(l+=c.length-l),ls(o)){if(e.slice(l).search(o)){var d,u=c;for(o.global||(o=Ie(o.source,ws(me.exec(o))+"g")),o.lastIndex=0;d=o.exec(u);)var h=d.index;c=c.slice(0,h===i?l:h)}}else if(e.indexOf(ui(o),l)!=l){var p=c.lastIndexOf(o);p>-1&&(c=c.slice(0,p))}return c+r},Un.unescape=function(e){return(e=ws(e))&&q.test(e)?e.replace(X,fn):e},Un.uniqueId=function(e){var t=++Re;return ws(e)+t},Un.upperCase=Qs,Un.upperFirst=Js,Un.each=wa,Un.eachRight=ka,Un.first=Zo,dl(Un,(Cl={},kr(Un,(function(e,t){ze.call(Un.prototype,t)||(Cl[t]=e)})),Cl),{chain:!1}),Un.VERSION="4.17.21",jt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Un[e].placeholder=Un})),jt(["drop","take"],(function(e,t){Gn.prototype[e]=function(n){n=n===i?1:yn(bs(n),0);var r=this.__filtered__&&!t?new Gn(this):this.clone();return r.__filtered__?r.__takeCount__=wn(n,r.__takeCount__):r.__views__.push({size:wn(n,f),type:e+(r.__dir__<0?"Right":"")}),r},Gn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),jt(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Gn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:uo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),jt(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Gn.prototype[e]=function(){return this[n](1).value()[0]}})),jt(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Gn.prototype[e]=function(){return this.__filtered__?new Gn(this):this[n](1)}})),Gn.prototype.compact=function(){return this.filter(al)},Gn.prototype.find=function(e){return this.filter(e).head()},Gn.prototype.findLast=function(e){return this.reverse().find(e)},Gn.prototype.invokeMap=Qr((function(e,t){return"function"==typeof e?new Gn(this):this.map((function(n){return Lr(n,e,t)}))})),Gn.prototype.reject=function(e){return this.filter(Ha(uo(e)))},Gn.prototype.slice=function(e,t){e=bs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Gn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=bs(t))<0?n.dropRight(-t):n.take(t-e)),n)},Gn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Gn.prototype.toArray=function(){return this.take(f)},kr(Gn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=Un[r?"take"+("last"==t?"Right":""):t],a=r||/^find/.test(t);o&&(Un.prototype[t]=function(){var t=this.__wrapped__,s=r?[1]:arguments,l=t instanceof Gn,c=s[0],d=l||Ya(t),u=function(e){var t=o.apply(Un,Pt([e],s));return r&&h?t[0]:t};d&&n&&"function"==typeof c&&1!=c.length&&(l=d=!1);var h=this.__chain__,p=!!this.__actions__.length,g=a&&!h,m=l&&!p;if(!a&&d){t=m?t:new Gn(this);var f=e.apply(t,s);return f.__actions__.push({func:fa,args:[u],thisArg:i}),new Vn(f,h)}return g&&m?e.apply(this,s):(f=this.thru(u),g?r?f.value()[0]:f.value():f)})})),jt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Oe[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Un.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ya(i)?i:[],e)}return this[n]((function(n){return t.apply(Ya(n)?n:[],e)}))}})),kr(Gn.prototype,(function(e,t){var n=Un[t];if(n){var r=n.name+"";ze.call(An,r)||(An[r]=[]),An[r].push({name:t,func:n})}})),An[Ui(i,2).name]=[{name:"wrapper",func:i}],Gn.prototype.clone=function(){var e=new Gn(this.__wrapped__);return e.__actions__=Oi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Oi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Oi(this.__views__),e},Gn.prototype.reverse=function(){if(this.__filtered__){var e=new Gn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Gn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ya(e),r=t<0,i=n?e.length:0,o=function(e,t,n){var r=-1,i=n.length;for(;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=wn(t,e+a);break;case"takeRight":e=yn(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,s=o.end,l=s-a,c=r?s:a-1,d=this.__iteratees__,u=d.length,h=0,p=wn(l,this.__takeCount__);if(!n||!r&&i==l&&p==l)return fi(e,this.__actions__);var g=[];e:for(;l--&&h<p;){for(var m=-1,f=e[c+=t];++m<u;){var b=d[m],v=b.iteratee,x=b.type,y=v(f);if(2==x)f=y;else if(!y){if(1==x)continue e;break e}}g[h++]=f}return g},Un.prototype.at=ba,Un.prototype.chain=function(){return ma(this)},Un.prototype.commit=function(){return new Vn(this.value(),this.__chain__)},Un.prototype.next=function(){this.__values__===i&&(this.__values__=ms(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Un.prototype.plant=function(e){for(var t,n=this;n instanceof Kn;){var r=Uo(n);r.__index__=0,r.__values__=i,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},Un.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Gn){var t=e;return this.__actions__.length&&(t=new Gn(this)),(t=t.reverse()).__actions__.push({func:fa,args:[ra],thisArg:i}),new Vn(t,this.__chain__)}return this.thru(ra)},Un.prototype.toJSON=Un.prototype.valueOf=Un.prototype.value=function(){return fi(this.__wrapped__,this.__actions__)},Un.prototype.first=Un.prototype.head,et&&(Un.prototype[et]=function(){return this}),Un}();pt._=bn,(r=function(){return bn}.call(t,n,t,e))===i||(e.exports=r)}.call(this)},4516:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function i(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,o){for(var a,s,l=i(e),c=1;c<arguments.length;c++){for(var d in a=Object(arguments[c]))n.call(a,d)&&(l[d]=a[d]);if(t){s=t(a);for(var u=0;u<s.length;u++)r.call(a,s[u])&&(l[s[u]]=a[s[u]])}}return l}},6094:(e,t,n)=>{"use strict";n(4516);var r=n(9787),i=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var o=Symbol.for;i=o("react.element"),t.Fragment=o("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s=Object.prototype.hasOwnProperty,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,o={},c=null,d=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(d=t.ref),t)s.call(t,r)&&!l.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:i,type:e,key:c,ref:d,props:o,_owner:a.current}}t.jsx=c,t.jsxs=c},4512:(e,t,n)=>{"use strict";e.exports=n(6094)},8336:(e,t,n)=>{var r=n(487),i=n(4295);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},554:(e,t,n)=>{var r=n(487),i=n(9135);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},2789:(e,t,n)=>{var r=n(487),i=n(3729);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},5080:(e,t,n)=>{var r=n(487),i=n(4241);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},7225:(e,t,n)=>{var r=n(487),i=n(6029);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},778:(e,t,n)=>{var r=n(487),i=n(9609);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},4220:(e,t,n)=>{var r=n(487),i=n(2345);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},4678:(e,t,n)=>{var r=n(487),i=n(9393);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},1292:(e,t,n)=>{var r=n(487),i=n(6578);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},196:(e,t,n)=>{var r=n(487),i=n(9482);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},2205:(e,t,n)=>{var r=n(487),i=n(7955);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},1310:(e,t,n)=>{var r=n(487),i=n(3195);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},3922:(e,t,n)=>{var r=n(487),i=n(2978);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},7096:(e,t,n)=>{var r=n(487),i=n(1587);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},7117:(e,t,n)=>{var r=n(487),i=n(9478);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},1106:(e,t,n)=>{var r=n(487),i=n(7369);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},3336:(e,t,n)=>{var r=n(487),i=n(1434);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},4406:(e,t,n)=>{var r=n(487),i=n(8923);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},6043:(e,t,n)=>{var r=n(487),i=n(5605);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},694:(e,t,n)=>{var r=n(487),i=n(5644);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},8328:(e,t,n)=>{var r=n(487),i=n(6843);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},8051:(e,t,n)=>{var r=n(487),i=n(8461);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},4301:(e,t,n)=>{var r=n(487),i=n(9935);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},9966:(e,t,n)=>{var r=n(487),i=n(532);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},9295:(e,t,n)=>{var r=n(487),i=n(7589);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},9781:(e,t,n)=>{var r=n(487),i=n(8465);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},371:(e,t,n)=>{var r=n(487),i=n(5892);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},4623:(e,t,n)=>{var r=n(487),i=n(3874);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},1528:(e,t,n)=>{var r=n(487),i=n(2681);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},518:(e,t,n)=>{var r=n(487),i=n(6759);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},9757:(e,t,n)=>{var r=n(487),i=n(9650);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},5422:(e,t,n)=>{var r=n(487),i=n(2044);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},276:(e,t,n)=>{var r=n(487),i=n(9144);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},6781:(e,t,n)=>{var r=n(487),i=n(6626);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},580:(e,t,n)=>{var r=n(487),i=n(6359);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},4285:(e,t,n)=>{var r=n(487),i=n(9915);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},3313:(e,t,n)=>{var r=n(487),i=n(9310);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},8635:(e,t,n)=>{var r=n(487),i=n(6464);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},4404:(e,t,n)=>{var r=n(487),i=n(5260);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.id,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},487:(e,t,n)=>{"use strict";var r,i=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},o=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),a=[];function s(e){for(var t=-1,n=0;n<a.length;n++)if(a[n].identifier===e){t=n;break}return t}function l(e,t){for(var n={},r=[],i=0;i<e.length;i++){var o=e[i],l=t.base?o[0]+t.base:o[0],c=n[l]||0,d="".concat(l," ").concat(c);n[l]=c+1;var u=s(d),h={css:o[1],media:o[2],sourceMap:o[3]};-1!==u?(a[u].references++,a[u].updater(h)):a.push({identifier:d,updater:f(h,t),references:1}),r.push(d)}return r}function c(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var i=n.nc;i&&(r.nonce=i)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var a=o(e.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(t)}return t}var d,u=(d=[],function(e,t){return d[e]=t,d.filter(Boolean).join("\n")});function h(e,t,n,r){var i=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=u(t,i);else{var o=document.createTextNode(i),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(o,a[t]):e.appendChild(o)}}function p(e,t,n){var r=n.css,i=n.media,o=n.sourceMap;if(i?e.setAttribute("media",i):e.removeAttribute("media"),o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var g=null,m=0;function f(e,t){var n,r,i;if(t.singleton){var o=m++;n=g||(g=c(t)),r=h.bind(null,n,o,!1),i=h.bind(null,n,o,!0)}else n=c(t),r=p.bind(null,n,t),i=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 i()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=i());var n=l(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 i=s(n[r]);a[i].references--}for(var o=l(e,t),c=0;c<n.length;c++){var d=s(n[c]);0===a[d].references&&(a[d].updater(),a.splice(d,1))}n=o}}}},4295:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>g});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o),s=n(1667),l=n.n(s),c=new URL(n(3940),n.b),d=new URL(n(3147),n.b),u=a()(i()),h=l()(c),p=l()(d);u.push([e.id,'@font-face{font-family:"Virgil";src:url('+h+');font-display:swap}@font-face{font-family:"Cascadia";src:url('+p+");font-display:swap}",""]);const g=u},9135:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .ActiveFile .ActiveFile__fileName{display:flex;align-items:center}.excalidraw .ActiveFile .ActiveFile__fileName span{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:9.3em}.excalidraw .ActiveFile .ActiveFile__fileName svg{width:1.15em;margin-inline-end:.3em;transform:scaleY(0.9)}",""]);const s=a},3729:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Avatar{width:2.5rem;height:2.5rem;border-radius:50%;display:flex;justify-content:center;align-items:center;color:#fff;cursor:pointer;font-size:.8rem;font-weight:500;overflow:hidden}.excalidraw .Avatar img{width:100%;height:100%}",""]);const s=a},4241:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Card{display:flex;flex-direction:column;align-items:center;max-width:290px;margin:1em;text-align:center}.excalidraw .Card .Card-icon{font-size:2.6em;display:flex;flex:0 0 auto;padding:1.4rem;border-radius:50%;background:var(--card-color);color:#fff}.excalidraw .Card .Card-icon svg{width:2.8rem;height:2.8rem}.excalidraw .Card .Card-details{font-size:.96em;min-height:90px;padding:0 1em;margin-bottom:auto}.excalidraw .Card .Card-button.ToolIcon_type_button{height:2.5rem;margin-top:1em;margin-bottom:.3em;background-color:var(--card-color)}.excalidraw .Card .Card-button.ToolIcon_type_button:hover{background-color:var(--card-color-darker)}.excalidraw .Card .Card-button.ToolIcon_type_button:active{background-color:var(--card-color-darkest)}.excalidraw .Card .Card-button.ToolIcon_type_button .ToolIcon__label{color:#fff}.excalidraw .Card .Card-button.ToolIcon_type_button .Spinner{--spinner-color: #fff}",""]);const s=a},6029:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Checkbox{margin:4px .3em;display:flex;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.excalidraw .Checkbox:hover:not(.is-checked) .Checkbox-box:not(:focus){box-shadow:0 0 0 2px #4dabf7}.excalidraw .Checkbox:hover:not(.is-checked) .Checkbox-box:not(:focus) svg{display:block;opacity:.3}.excalidraw .Checkbox:active .Checkbox-box{box-shadow:0 0 2px 1px inset #1c7ed6 !important}.excalidraw .Checkbox:hover .Checkbox-box{background-color:rgba(208,235,255,.2)}.excalidraw .Checkbox.is-checked .Checkbox-box{background-color:#d0ebff}.excalidraw .Checkbox.is-checked .Checkbox-box svg{display:block}.excalidraw .Checkbox.is-checked:hover .Checkbox-box{background-color:#a5d8ff}.excalidraw .Checkbox .Checkbox-box{width:22px;height:22px;padding:0;flex:0 0 auto;margin:0 1em;display:flex;align-items:center;justify-content:center;box-shadow:0 0 0 2px #1c7ed6;background-color:transparent;border-radius:4px;color:#1c7ed6}.excalidraw .Checkbox .Checkbox-box:focus{box-shadow:0 0 0 3px #1c7ed6}.excalidraw .Checkbox .Checkbox-box svg{display:none;width:16px;height:16px;stroke-width:3px}.excalidraw .Checkbox .Checkbox-label{display:flex;align-items:center}.excalidraw .Checkbox .excalidraw-tooltip-icon{width:1em;height:1em}",""]);const s=a},9609:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .CollabButton.is-collaborating{background-color:var(--button-special-active-bg-color)}.excalidraw .CollabButton.is-collaborating .ToolIcon__icon svg,.excalidraw .CollabButton.is-collaborating .ToolIcon__label{color:var(--icon-green-fill-color)}.excalidraw .CollabButton-collaborators{min-width:1em;position:absolute;bottom:-5px;padding:3px;border-radius:50%;background-color:#40c057;color:#fff;font-size:.7em;font-family:var(--ui-font)}:root[dir=ltr] .excalidraw .CollabButton-collaborators{right:-5px}:root[dir=rtl] .excalidraw .CollabButton-collaborators{left:-5px}",""]);const s=a},2345:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>h});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o),s=n(1667),l=n.n(s),c=new URL(n(9669),n.b),d=a()(i()),u=l()(c);d.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--default{padding:.5rem;display:grid;grid-template-columns:repeat(5, auto);grid-gap:.5rem;border-radius:4px}.excalidraw .color-picker-content--default:focus{outline:none;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .color-picker-content--canvas{display:flex;flex-direction:column;padding:.25rem}.excalidraw .color-picker-content--canvas-title{color:#868e96;font-size:12px;padding:0 .25rem}.excalidraw .color-picker-content--canvas-colors{padding:.5rem 0}.excalidraw .color-picker-content--canvas-colors .color-picker-swatch{margin:0 .25rem}.excalidraw .color-picker-content .color-input-container{grid-column:1/span 5}.excalidraw .color-picker-swatch{position:relative;height:1.875rem;width:1.875rem;cursor:pointer;border-radius:4px;margin:0;box-sizing:border-box;border:1px solid #ddd;background-color:currentColor !important;filter:var(--theme-filter)}.excalidraw .color-picker-swatch:focus{box-shadow:0 0 4px 1px currentColor;border-color:var(--select-highlight-color)}.excalidraw .color-picker-transparent{border-radius:4px;box-shadow:rgba(0,0,0,.1) 0 0 0 1px inset;position:absolute;top:0;right:0;bottom:0;left:0}.excalidraw .color-picker-transparent,.excalidraw .color-picker-label-swatch{background:url("+u+') left center}.excalidraw .color-picker-hash{background:var(--input-border-color);height:1.875rem;width:1.875rem;color:var(--input-label-color);display:flex;align-items:center;justify-content:center;position:relative}:root[dir=ltr] .excalidraw .color-picker-hash{border-radius:4px 0 0 4px}:root[dir=rtl] .excalidraw .color-picker-hash{border-radius:0 4px 4px 0}.excalidraw .color-input-container:focus-within .color-picker-hash{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .color-input-container:focus-within .color-picker-hash::before,.excalidraw .color-input-container:focus-within .color-picker-hash::after{content:"";width:1px;height:100%;position:absolute;top:0}.excalidraw .color-input-container:focus-within .color-picker-hash::before{background:var(--input-border-color)}:root[dir=ltr] .excalidraw .color-input-container:focus-within .color-picker-hash::before{right:-1px}:root[dir=rtl] .excalidraw .color-input-container:focus-within .color-picker-hash::before{left:-1px}.excalidraw .color-input-container:focus-within .color-picker-hash::after{background:var(--input-bg-color)}:root[dir=ltr] .excalidraw .color-input-container:focus-within .color-picker-hash::after{right:-2px}:root[dir=rtl] .excalidraw .color-input-container:focus-within .color-picker-hash::after{left:-2px}.excalidraw .color-input-container{display:flex}.excalidraw .color-picker-input{width:11ch;margin:0;font-size:1rem;background-color:var(--input-bg-color);color:var(--text-primary-color);border:0;outline:none;height:1.75em;box-shadow:var(--input-border-color) 0 0 0 1px inset;float:left;padding:1px;padding-inline-start:.5em;-webkit-appearance:none;appearance:none}:root[dir=ltr] .excalidraw .color-picker-input{border-radius:0 4px 4px 0}:root[dir=rtl] .excalidraw .color-picker-input{border-radius:4px 0 0 4px}.excalidraw .color-picker-label-swatch{height:1.875rem;width:1.875rem;margin-inline-end:.25rem;border:1px solid #dee2e6;position:relative;overflow:hidden;background-color:transparent !important;filter:var(--theme-filter)}.excalidraw .color-picker-label-swatch:after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;background:var(--swatch-color)}.excalidraw .color-picker-keybinding{position:absolute;bottom:2px;font-size:.7em}:root[dir=ltr] .excalidraw .color-picker-keybinding{right:2px}:root[dir=rtl] .excalidraw .color-picker-keybinding{left:2px}.excalidraw--mobile.excalidraw .color-picker-keybinding{display:none}.excalidraw .color-picker-type-canvasBackground .color-picker-keybinding{color:#aaa}.excalidraw .color-picker-type-elementBackground .color-picker-keybinding{color:#fff}.excalidraw .color-picker-swatch[aria-label=transparent] .color-picker-keybinding{color:#aaa}.excalidraw .color-picker-type-elementStroke .color-picker-keybinding{color:#d4d4d4}.excalidraw.theme--dark .color-picker-type-elementBackground .color-picker-keybinding{color:#000}.excalidraw.theme--dark .color-picker-swatch[aria-label=transparent] .color-picker-keybinding{color:#000}',""]);const h=d},9393:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .confirm-dialog-buttons{display:flex;padding:.2rem 0;justify-content:flex-end}.excalidraw .confirm-dialog .ToolIcon__icon{min-width:2.5rem;width:auto;font-size:1rem}.excalidraw .confirm-dialog .ToolIcon_type_button{margin-left:.8rem;padding:0 .5rem}.excalidraw .confirm-dialog__content{font-size:1rem}.excalidraw .confirm-dialog--confirm.ToolIcon_type_button{background-color:#fa5252}.excalidraw .confirm-dialog--confirm.ToolIcon_type_button:hover{background-color:#e03131}.excalidraw .confirm-dialog--confirm.ToolIcon_type_button .ToolIcon__icon{color:#fff}",""]);const s=a},6578:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,':export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .context-menu{position:relative;border-radius:4px;box-shadow:0 3px 10px rgba(0,0,0,.2);padding:0;list-style:none;-webkit-user-select:none;user-select:none;margin:-0.25rem 0 0 .125rem;padding:.5rem 0;background-color:var(--popup-secondary-bg-color);border:1px solid var(--button-gray-3);cursor:default}.excalidraw .context-menu button{color:var(--popup-text-color)}.excalidraw .context-menu-option{position:relative;width:100%;min-width:9.5rem;margin:0;padding:.25rem 1rem .25rem 1.25rem;text-align:start;border-radius:0;background-color:transparent;border:none;white-space:nowrap;display:grid;grid-template-columns:1fr .2fr;align-items:center}.excalidraw .context-menu-option.checkmark::before{position:absolute;left:6px;margin-bottom:1px;content:"✓"}.excalidraw .context-menu-option.dangerous .context-menu-option__label{color:#f03e3e}.excalidraw .context-menu-option .context-menu-option__label{justify-self:start;margin-inline-end:20px}.excalidraw .context-menu-option .context-menu-option__shortcut{justify-self:end;opacity:.6;font-family:inherit;font-size:.7rem}.excalidraw .context-menu-option:hover{color:var(--popup-bg-color);background-color:var(--select-highlight-color)}.excalidraw .context-menu-option:hover.dangerous{background-color:#fa5252}.excalidraw .context-menu-option:hover.dangerous .context-menu-option__label{color:var(--popup-bg-color)}.excalidraw .context-menu-option:focus{z-index:1}.excalidraw--mobile.excalidraw .context-menu-option{display:block}.excalidraw--mobile.excalidraw .context-menu-option .context-menu-option__label{margin-inline-end:0}.excalidraw--mobile.excalidraw .context-menu-option .context-menu-option__shortcut{display:none}.excalidraw .context-menu-option-separator{border:none;border-top:1px solid #adb5bd}',""]);const s=a},9482:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Dialog{-webkit-user-select:text;user-select:text;cursor:auto}.excalidraw .Dialog__title{display:grid;align-items:center;margin-top:0;grid-template-columns:1fr calc(var(--space-factor)*7);grid-gap:var(--metric);padding:calc(var(--space-factor)*2);text-align:center;font-variant:small-caps;font-size:1.2em}.excalidraw .Dialog__titleContent{flex:1}.excalidraw .Dialog .Modal__close{color:var(--icon-fill-color);margin:0}.excalidraw .Dialog__content{padding:0 16px 16px}.excalidraw--mobile.excalidraw .Dialog{--metric: calc(var(--space-factor) * 4);--inset-left: max(var(--metric), var(--sal));--inset-right: max(var(--metric), var(--sar))}.excalidraw--mobile.excalidraw .Dialog__title{grid-template-columns:calc(var(--space-factor)*7) 1fr calc(var(--space-factor)*7);position:-webkit-sticky;position:sticky;top:0;padding:calc(var(--space-factor)*2);background:var(--island-bg-color);font-size:1.25em;box-sizing:border-box;border-bottom:1px solid var(--button-gray-2);z-index:1}.excalidraw--mobile.excalidraw .Dialog__titleContent{text-align:center}.excalidraw--mobile.excalidraw .Dialog .Island{width:100vw;height:100%;box-sizing:border-box;overflow-y:auto;padding-left:max(calc(var(--padding) * var(--space-factor)), var(--sal));padding-right:max(calc(var(--padding) * var(--space-factor)), var(--sar));padding-bottom:max(calc(var(--padding) * var(--space-factor)), var(--sab))}.excalidraw--mobile.excalidraw .Dialog .Modal__close{order:-1}",""]);const s=a},7955:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>h});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o),s=n(1667),l=n.n(s),c=new URL(n(9669),n.b),d=a()(i()),u=l()(c);d.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .ExportDialog__preview{--preview-padding: calc(var(--space-factor) * 4);background:url("+u+") left center;text-align:center;padding:var(--preview-padding);margin-bottom:calc(var(--space-factor)*3)}.excalidraw .ExportDialog__preview canvas{max-width:calc(100% - var(--preview-padding)*2);max-height:25rem}.excalidraw.theme--dark .ExportDialog__preview canvas{filter:none}.excalidraw .ExportDialog__actions{width:100%;display:flex;grid-gap:calc(var(--space-factor)*2);align-items:top;justify-content:space-between}.excalidraw--mobile.excalidraw .ExportDialog{display:flex;flex-direction:column}.excalidraw--mobile.excalidraw .ExportDialog__actions{flex-direction:column;align-items:center}.excalidraw--mobile.excalidraw .ExportDialog__actions>*{margin-bottom:calc(var(--space-factor)*3)}.excalidraw--mobile.excalidraw .ExportDialog__preview canvas{max-height:30vh}.excalidraw--mobile.excalidraw .ExportDialog__dialog,.excalidraw--mobile.excalidraw .ExportDialog__dialog .Island{height:100%;box-sizing:border-box}.excalidraw--mobile.excalidraw .ExportDialog__dialog .Island{overflow-y:auto}.excalidraw .ExportDialog--json .ExportDialog-cards{display:grid;grid-template-columns:repeat(auto-fit, minmax(200px, 1fr));justify-items:center;row-gap:2em}@media(max-width: 460px){.excalidraw .ExportDialog--json .ExportDialog-cards{grid-template-columns:repeat(auto-fit, minmax(240px, 1fr))}.excalidraw .ExportDialog--json .ExportDialog-cards .Card-details{min-height:40px}}.excalidraw .ExportDialog--json .ExportDialog-cards .ProjectName{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;margin:1em auto;align-items:flex-start;flex-direction:column}.excalidraw .ExportDialog--json .ExportDialog-cards .ProjectName .TextInput{width:auto}.excalidraw .ExportDialog--json .ExportDialog-cards .ProjectName-label{margin:.625em 0;font-weight:bold}.excalidraw button.ExportDialog-imageExportButton{width:5rem;height:5rem;margin:0 .2em;border-radius:1rem;background-color:var(--button-color);box-shadow:0 3px 5px -1px rgba(0,0,0,.28),0 6px 10px 0 rgba(0,0,0,.14);font-family:Cascadia;font-size:1.8em;color:#fff}.excalidraw button.ExportDialog-imageExportButton:hover{background-color:var(--button-color-darker)}.excalidraw button.ExportDialog-imageExportButton:active{background-color:var(--button-color-darkest);box-shadow:none}.excalidraw button.ExportDialog-imageExportButton svg{width:.9em}",""]);const h=d},3195:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .FixedSideContainer{position:absolute;pointer-events:none}.excalidraw .FixedSideContainer>*{pointer-events:all}.excalidraw .FixedSideContainer_side_top{left:var(--space-factor);top:var(--space-factor);right:var(--space-factor);z-index:2}.excalidraw .FixedSideContainer_side_top.zen-mode{right:42px}",""]);const s=a},2978:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .HelpDialog h3{border-bottom:1px solid var(--button-gray-2);padding-bottom:4px}.excalidraw .HelpDialog--island{border:1px solid var(--button-gray-2);margin-bottom:16px}.excalidraw .HelpDialog--island-title{margin:0;padding:4px;background-color:var(--button-gray-1);text-align:center}.excalidraw .HelpDialog--shortcut{border-top:1px solid var(--button-gray-2)}.excalidraw .HelpDialog--key{word-break:keep-all;border:1px solid var(--button-gray-2);padding:2px 8px;margin:auto 4px;background-color:var(--button-gray-1);border-radius:2px;font-size:.8em;min-height:26px;box-sizing:border-box;display:flex;align-items:center;font-family:inherit}.excalidraw .HelpDialog--header{display:flex;flex-direction:row;justify-content:space-evenly;margin-bottom:32px;padding-bottom:16px}.excalidraw .HelpDialog--btn{border:1px solid var(--link-color);padding:8px 32px;border-radius:4px}.excalidraw .HelpDialog--btn:hover{text-decoration:none}",""]);const s=a},1587:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .HintViewer{pointer-events:none;box-sizing:border-box;position:absolute;display:flex;justify-content:center;left:0;top:100%;max-width:100%;width:100%;margin-top:6px;text-align:center;color:#868e96;font-size:.8rem}.excalidraw--mobile.excalidraw .HintViewer{position:static;padding-right:2em}.excalidraw .HintViewer>span{padding:.2rem .4rem;background-color:var(--overlay-bg-color);border-radius:4px}",""]);const s=a},9478:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,':export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .picker-container{display:inline-block;box-sizing:border-box;margin-right:.25rem}.excalidraw .picker{background:var(--popup-bg-color);border:0 solid rgba(255,255,255,.25);box-shadow:rgba(0,0,0,.25) 0 1px 4px;border-radius:4px;position:absolute}.excalidraw .picker-container button,.excalidraw .picker button{position:relative;display:flex;align-items:center;justify-content:center}.excalidraw .picker-container button:focus-visible,.excalidraw .picker button:focus-visible{outline:transparent;background-color:var(--button-gray-2)}.excalidraw .picker-container button:focus-visible svg,.excalidraw .picker button:focus-visible svg{opacity:1}.excalidraw .picker-container button:hover,.excalidraw .picker button:hover{background-color:var(--button-gray-2)}.excalidraw .picker-container button:active,.excalidraw .picker button:active{background-color:var(--button-gray-3)}.excalidraw .picker-container button:disabled,.excalidraw .picker button:disabled{cursor:not-allowed}.excalidraw .picker-container button svg,.excalidraw .picker button svg{margin:0;width:36px;height:18px;opacity:.6;pointer-events:none}.excalidraw .picker button{padding:.25rem .28rem .35rem .25rem}.excalidraw .picker-triangle{width:0;height:0;position:relative;top:-10px;z-index:10}:root[dir=ltr] .excalidraw .picker-triangle{left:12px}:root[dir=rtl] .excalidraw .picker-triangle{right:12px}.excalidraw .picker-triangle:before{content:"";position:absolute;border-style:solid;border-width:0 9px 10px;border-color:transparent transparent rgba(0,0,0,.1);top:-1px}.excalidraw .picker-triangle:after{content:"";position:absolute;border-style:solid;border-width:0 9px 10px;border-color:transparent transparent var(--popup-bg-color)}.excalidraw .picker-content{padding:.5rem;display:grid;grid-template-columns:repeat(3, auto);grid-gap:.5rem;border-radius:4px}:root[dir=rtl] .excalidraw .picker-content{padding:.4rem}.excalidraw .picker-keybinding{position:absolute;bottom:2px;font-size:.7em;color:var(--keybinding-color)}:root[dir=ltr] .excalidraw .picker-keybinding{right:2px}:root[dir=rtl] .excalidraw .picker-keybinding{left:2px}.excalidraw--mobile.excalidraw .picker-keybinding{display:none}.excalidraw .picker-type-canvasBackground .picker-keybinding{color:#aaa}.excalidraw .picker-type-elementBackground .picker-keybinding{color:#fff}.excalidraw .picker-swatch[aria-label=transparent] .picker-keybinding{color:#aaa}.excalidraw .picker-type-elementStroke .picker-keybinding{color:#d4d4d4}.excalidraw.theme--dark .picker-type-elementBackground .picker-keybinding{color:#000}.excalidraw.theme--dark .picker-swatch[aria-label=transparent] .picker-keybinding{color:#000}',""]);const s=a},7369:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .Island{--padding: 0;background-color:var(--island-bg-color);box-shadow:var(--shadow-island);border-radius:var(--border-radius-lg);padding:calc(var(--padding)*var(--space-factor));position:relative}.excalidraw .Island.zen-mode{box-shadow:none}.excalidraw .Island::-webkit-scrollbar{width:10px}.excalidraw .Island::-webkit-scrollbar-track{background-color:transparent}.excalidraw .Island::-webkit-scrollbar-thumb{background-color:var(--color-scrollbar-thumb)}.excalidraw .Island::-webkit-scrollbar-thumb:hover{background-color:var(--color-scrollbar-thumb-hover)}.excalidraw .Island::-webkit-scrollbar-thumb:active{background-color:var(--color-scrollbar-thumb-active)}.excalidraw .App-menu_top .Stack_vertical .Island{min-width:216px}.excalidraw .App-menu_top .Stack_vertical .Stack_horizontal{justify-content:center !important}.excalidraw.excalidraw--view-mode .App-menu_top .Stack_vertical .Island{min-width:auto}",""]);const s=a},1434:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .layer-ui__wrapper{z-index:var(--zIndex-layerUI)}.excalidraw .layer-ui__wrapper__top-right{display:flex}.excalidraw .layer-ui__wrapper__footer{width:100%}.excalidraw .layer-ui__wrapper__footer-right{z-index:100;display:flex}.excalidraw .layer-ui__wrapper .zen-mode-transition{transition:transform .5s ease-in-out}:root[dir=ltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-left{transform:translate(-999px, 0)}:root[dir=ltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-right{transform:translate(999px, 0)}:root[dir=rtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-left{transform:translate(999px, 0)}:root[dir=rtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-right{transform:translate(-999px, 0)}:root[dir=ltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-left{transform:translate(-76px, 0)}:root[dir=rtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-left{transform:translate(76px, 0)}.excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-bottom{transform:translate(0, 92px)}.excalidraw .layer-ui__wrapper .disable-zen-mode{height:30px;position:absolute;bottom:10px;font-size:10px;padding:10px;font-weight:500;opacity:0;visibility:hidden;transition:visibility 0s linear 0s,opacity .5s}[dir=ltr] .excalidraw .layer-ui__wrapper .disable-zen-mode{right:15px}[dir=rtl] .excalidraw .layer-ui__wrapper .disable-zen-mode{left:15px}.excalidraw .layer-ui__wrapper .disable-zen-mode--visible{opacity:1;visibility:visible;transition:visibility 0s linear 300ms,opacity .5s;transition-delay:.8s}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-center{pointer-events:none}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-center>*{pointer-events:all}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-left,.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-right,.excalidraw .layer-ui__wrapper .disable-zen-mode--visible{pointer-events:all}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-left{margin-bottom:.2em}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-right{margin-top:auto;margin-bottom:auto;margin-inline-end:1em}",""]);const s=a},8923:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .layer-ui__library{margin:auto;display:flex;align-items:center;justify-content:center}.excalidraw .layer-ui__library .layer-ui__library-header{display:flex;align-items:center;width:100%;margin:2px 0}.excalidraw .layer-ui__library .layer-ui__library-header button{margin:0 2px}.excalidraw .layer-ui__library .layer-ui__library-header a{margin-inline-start:auto;padding-inline-end:18px;white-space:nowrap}.excalidraw .layer-ui__library-message{padding:10px 20px;max-width:200px}.excalidraw .publish-library-success .Dialog__content{display:flex;flex-direction:column}.excalidraw .publish-library-success-close.ToolIcon_type_button{background-color:#228be6;align-self:flex-end}.excalidraw .publish-library-success-close.ToolIcon_type_button:hover{background-color:#1971c2}.excalidraw .publish-library-success-close.ToolIcon_type_button .ToolIcon__icon{width:auto;font-size:1rem;color:#fff;padding:0 .5rem}",""]);const s=a},5605:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .library-menu-items-container .library-actions{display:flex}.excalidraw .library-menu-items-container .library-actions button .library-actions-counter{position:absolute;right:2px;bottom:2px;border-radius:50%;width:1em;height:1em;padding:1px;font-size:.7rem;background:#fff}.excalidraw .library-menu-items-container .library-actions--remove{background-color:#f03e3e}.excalidraw .library-menu-items-container .library-actions--remove:hover{background-color:#e03131}.excalidraw .library-menu-items-container .library-actions--remove:active{background-color:#c92a2a}.excalidraw .library-menu-items-container .library-actions--remove svg{color:#fff}.excalidraw .library-menu-items-container .library-actions--remove .library-actions-counter{color:#f03e3e}.excalidraw .library-menu-items-container .library-actions--export{background-color:#94d82d}.excalidraw .library-menu-items-container .library-actions--export:hover{background-color:#74b816}.excalidraw .library-menu-items-container .library-actions--export:active{background-color:#66a80f}.excalidraw .library-menu-items-container .library-actions--export svg{color:#fff}.excalidraw .library-menu-items-container .library-actions--export .library-actions-counter{color:#94d82d}.excalidraw .library-menu-items-container .library-actions--publish{background-color:#15aabf}.excalidraw .library-menu-items-container .library-actions--publish:hover{background-color:#1098ad}.excalidraw .library-menu-items-container .library-actions--publish:active{background-color:#0b7285}.excalidraw .library-menu-items-container .library-actions--publish svg{color:#fff}.excalidraw .library-menu-items-container .library-actions--publish label{margin-left:-0.2em;margin-right:1.1em;color:#fff;font-size:.86em}.excalidraw .library-menu-items-container .library-actions--publish .library-actions-counter{color:#15aabf}.excalidraw .library-menu-items-container .library-actions--load{background-color:#228be6}.excalidraw .library-menu-items-container .library-actions--load:hover{background-color:#1c7ed6}.excalidraw .library-menu-items-container .library-actions--load:active{background-color:#1864ab}.excalidraw .library-menu-items-container .library-actions--load svg{color:#fff}.excalidraw .library-menu-items-container__items{max-height:50vh;overflow:auto;margin-top:.5rem}.excalidraw .library-menu-items-container .separator{font-weight:500;font-size:.9rem;margin:.6em .2em;color:var(--text-primary-color)}",""]);const s=a},5644:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .library-unit{align-items:center;border:1px solid var(--button-gray-2);display:flex;justify-content:center;position:relative;width:63px;height:63px}.excalidraw .library-unit--hover{box-shadow:inset 0px 0px 0px 2px #339af0;border-color:#339af0}.excalidraw .library-unit--selected{box-shadow:inset 0px 0px 0px 2px #1971c2;border-color:#1971c2}.excalidraw.theme--dark .library-unit{border-color:#303030}.excalidraw .library-unit__dragger{display:flex;align-items:center;justify-content:center;height:100%;width:100%}.excalidraw .library-unit__dragger>svg{filter:var(--theme-filter);flex-grow:1;max-height:100%;max-width:100%}.excalidraw .library-unit__checkbox-container,.excalidraw .library-unit__checkbox-container:hover,.excalidraw .library-unit__checkbox-container:active{align-items:center;background:none;border:none;color:var(--icon-fill-color);display:flex;justify-content:center;margin:0;padding:.5rem;position:absolute;left:2rem;bottom:2rem;cursor:pointer}.excalidraw .library-unit__checkbox-container input,.excalidraw .library-unit__checkbox-container:hover input,.excalidraw .library-unit__checkbox-container:active input{cursor:pointer}.excalidraw .library-unit__checkbox{position:absolute;left:2.3rem;bottom:2.3rem}.excalidraw .library-unit__checkbox .Checkbox-box{width:13px;height:13px;border-radius:2px;margin:.5em .5em .2em .2em;background-color:#d0ebff}.excalidraw .library-unit__checkbox.Checkbox:hover .Checkbox-box{background-color:#a5d8ff}.excalidraw .library-unit__removeFromLibrary>svg{height:16px;width:16px}.excalidraw .library-unit__adder{transform:scale(1);animation:library-unit__adder-animation 1s ease-in infinite}.excalidraw .library-unit__adder{position:absolute;left:40%;top:40%;width:2rem;height:2rem;margin-left:-10px;margin-top:-10px;pointer-events:none}.excalidraw .library-unit:hover .library-unit__adder{fill:#1c7ed6}.excalidraw .library-unit:active .library-unit__adder{animation:none;transform:scale(0.8);fill:#000}.excalidraw .library-unit__active{cursor:pointer}@keyframes library-unit__adder-animation{0%{transform:scale(0.85)}50%{transform:scale(1)}100%{transform:scale(0.85)}}",""]);const s=a},6843:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw.excalidraw-modal-container{position:absolute;z-index:10}.excalidraw .Modal{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;overflow:auto;padding:calc(var(--space-factor)*10)}.excalidraw .Modal__background{position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;background-color:rgba(0,0,0,.7)}.excalidraw .Modal__content{position:relative;z-index:2;width:100%;max-width:var(--max-width);max-height:100%;opacity:0;transform:translateY(10px);animation:Modal__content_fade-in .1s ease-out .05s forwards;position:relative;overflow-y:auto;background:var(--island-bg-color);border:1px solid var(--dialog-border-color);box-shadow:0 2px 10px rgba(0,0,0,.25);border-radius:6px;box-sizing:border-box}.excalidraw .Modal__content:focus{outline:none}.excalidraw--mobile.excalidraw .Modal__content{max-width:100%;border:0;border-radius:0}@keyframes Modal__content_fade-in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.excalidraw .Modal__close{width:calc(var(--space-factor)*7);height:calc(var(--space-factor)*7);display:flex;align-items:center;justify-content:center}.excalidraw .Modal__close svg{height:calc(var(--space-factor)*5)}.excalidraw--mobile.excalidraw .Modal{padding:0}.excalidraw--mobile.excalidraw .Modal__content{position:absolute;top:0;left:0;right:0;bottom:0}",""]);const s=a},8461:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw--mobile.excalidraw .PasteChartDialog .Island{display:flex;flex-direction:column}.excalidraw .PasteChartDialog .container{display:flex;align-items:center;justify-content:space-around;flex-wrap:wrap}.excalidraw--mobile.excalidraw .PasteChartDialog .container{flex-direction:column;justify-content:center}.excalidraw .PasteChartDialog .ChartPreview{margin:8px;text-align:center;width:192px;height:128px;border-radius:2px;padding:1px;border:1px solid #ced4da;display:flex;align-items:center;justify-content:center;background:transparent}.excalidraw .PasteChartDialog .ChartPreview div{display:inline-block}.excalidraw .PasteChartDialog .ChartPreview svg{max-height:120px;max-width:186px}.excalidraw .PasteChartDialog .ChartPreview:hover{padding:0;border:2px solid #339af0}",""]);const s=a},9935:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .popover{position:absolute;z-index:10}",""]);const s=a},532:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".ProjectName{margin:auto;display:flex;align-items:center}.ProjectName .TextInput{height:calc(1rem - 3px);width:200px;overflow:hidden;text-align:center;margin-left:8px;text-overflow:ellipsis}.ProjectName .TextInput--readonly{background:none;border:none;width:auto;max-width:200px;padding-left:2px}.ProjectName .TextInput--readonly:hover{background:none}",""]);const s=a},7589:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .publish-library__fields{display:flex;flex-direction:column}.excalidraw .publish-library__fields label{padding:1em;display:flex;justify-content:space-between;align-items:center}.excalidraw .publish-library__fields label span{font-weight:500;font-size:1rem;color:#868e96}.excalidraw .publish-library__fields label input,.excalidraw .publish-library__fields label textarea{width:70%;padding:.6em;font-family:var(--ui-font)}.excalidraw .publish-library__fields label .required{color:#e03131;margin:.2rem}.excalidraw .publish-library__buttons{display:flex;padding:.2rem 0;justify-content:flex-end}.excalidraw .publish-library__buttons .ToolIcon__icon{min-width:2.5rem;width:auto;font-size:1rem}.excalidraw .publish-library__buttons .ToolIcon_type_button{margin-left:1rem;padding:0 .5rem}.excalidraw .publish-library__buttons--confirm.ToolIcon_type_button{background-color:#228be6}.excalidraw .publish-library__buttons--confirm.ToolIcon_type_button:hover{background-color:#1971c2}.excalidraw .publish-library__buttons--cancel.ToolIcon_type_button{background-color:#adb5bd}.excalidraw .publish-library__buttons--cancel.ToolIcon_type_button:hover{background-color:#868e96}.excalidraw .publish-library__buttons .ToolIcon__icon{color:#fff}.excalidraw .publish-library__buttons .ToolIcon__icon .Spinner{--spinner-color: #fff}.excalidraw .publish-library__buttons .ToolIcon__icon .Spinner svg{padding:.5rem}.excalidraw .publish-library .selected-library-items{display:flex;padding:0 .8rem;flex-wrap:wrap}.excalidraw .publish-library .selected-library-items .single-library-item-wrapper{width:9rem}.excalidraw .publish-library-note{padding:1em;font-style:italic;font-size:14px;display:block}",""]);const s=a},8465:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .single-library-item{position:relative}.excalidraw .single-library-item__svg{width:7.5rem;height:7.5rem;border:1px solid var(--button-gray-2);margin:.3rem}.excalidraw .single-library-item__svg svg{width:100%;height:100%}.excalidraw .single-library-item .ToolIcon__icon{background-color:#fff;width:auto;height:auto;margin:0 .5rem}.excalidraw .single-library-item .ToolIcon,.excalidraw .single-library-item .ToolIcon_type_button:hover{background-color:#fff}.excalidraw .single-library-item .required,.excalidraw .single-library-item .error{color:#e03131;font-weight:bold;font-size:1rem;margin:.2rem}.excalidraw .single-library-item .error{font-weight:500;margin:0;padding:.3em 0}.excalidraw .single-library-item--remove{position:absolute;top:.2rem;right:1.3rem}.excalidraw .single-library-item--remove .ToolIcon__icon{margin:0}.excalidraw .single-library-item--remove .ToolIcon__icon{background-color:#fa5252}.excalidraw .single-library-item--remove .ToolIcon__icon:hover{background-color:#f03e3e}.excalidraw .single-library-item--remove .ToolIcon__icon:active{background-color:#e03131}.excalidraw .single-library-item--remove svg{color:#fff;padding:.26rem;border-radius:.3em;width:1rem;height:1rem}",""]);const s=a},5892:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .Spinner{display:flex;align-items:center;justify-content:center;height:100%;margin-left:auto;margin-right:auto;--spinner-color: var(--icon-fill-color)}.excalidraw .Spinner svg{animation:rotate 1.6s linear infinite;transform-origin:center center}.excalidraw .Spinner circle{stroke:var(--spinner-color);animation:dash 1.6s linear 0s infinite;stroke-linecap:round}@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,300;stroke-dashoffset:0}50%{stroke-dasharray:150,300;stroke-dashoffset:-200}100%{stroke-dasharray:1,300;stroke-dashoffset:-280}}",""]);const s=a},3874:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .Stack{--gap: 0;display:grid;gap:calc(var(--space-factor)*var(--gap))}.excalidraw .Stack_vertical{grid-template-columns:auto;grid-auto-flow:row;grid-auto-rows:-webkit-min-content;grid-auto-rows:min-content}.excalidraw .Stack_horizontal{grid-template-rows:auto;grid-auto-flow:column;grid-auto-columns:-webkit-min-content;grid-auto-columns:min-content}",""]);const s=a},2681:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Stats{position:absolute;top:64px;right:12px;font-size:12px;z-index:10}.excalidraw .Stats h3{margin:0 24px 8px 0;white-space:nowrap}.excalidraw .Stats .close{float:right;height:16px;width:16px;cursor:pointer}.excalidraw .Stats .close svg{width:100%;height:100%}.excalidraw .Stats table{width:100%}.excalidraw .Stats table th{border-bottom:1px solid var(--input-border-color);padding:4px}.excalidraw .Stats table tr td:nth-child(2){min-width:24px;text-align:right}:root[dir=rtl] .excalidraw .Stats{left:12px;right:initial}:root[dir=rtl] .excalidraw .Stats h3{margin:0 0 8px 24px}:root[dir=rtl] .excalidraw .Stats .close{float:left}",""]);const s=a},6759:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .TextInput{display:inline-block}",""]);const s=a},9650:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Toast{animation:fade-in .5s;background-color:var(--button-gray-1);border-radius:4px;bottom:10px;box-sizing:border-box;cursor:default;left:50%;margin-left:-150px;padding:4px 0;position:absolute;text-align:center;width:300px;z-index:999999}.excalidraw .Toast__message{color:var(--popup-text-color);white-space:pre-wrap}@keyframes fade-in{from{opacity:0}to{opacity:1}}",""]);const s=a},2044:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .ToolIcon{display:inline-flex;align-items:center;position:relative;cursor:pointer;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}.excalidraw .ToolIcon--plain{background-color:transparent}.excalidraw .ToolIcon--plain .ToolIcon__icon{width:2rem;height:2rem}.excalidraw .ToolIcon_type_radio+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox+.ToolIcon__icon{background-color:var(--button-gray-1)}.excalidraw .ToolIcon_type_radio+.ToolIcon__icon:hover,.excalidraw .ToolIcon_type_checkbox+.ToolIcon__icon:hover{background-color:var(--button-gray-2)}.excalidraw .ToolIcon_type_radio+.ToolIcon__icon:active,.excalidraw .ToolIcon_type_checkbox+.ToolIcon__icon:active{background-color:var(--button-gray-3)}.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(--border-radius-lg)}.excalidraw .ToolIcon__icon+.ToolIcon__label{margin-inline-start:0}.excalidraw .ToolIcon__icon svg{position:relative;height:1em;fill:var(--icon-fill-color);color:var(--icon-fill-color)}.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-visible,.excalidraw .Modal .ToolIcon_type_button:focus-visible,.excalidraw .ToolIcon_type_button:focus-visible{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-visible+.ToolIcon__icon,.excalidraw .ToolIcon_type_checkbox:focus-visible+.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 .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__keybinding{position:absolute;bottom:2px;right:3px;font-size:.5em;color:var(--keybinding-color);font-family:var(--ui-font);-webkit-user-select:none;user-select:none}@media(max-width: 425px){.excalidraw .Shape .ToolIcon__icon{width:2rem;height:2rem}.excalidraw .Shape .ToolIcon__icon svg{height:.8em}}@media(max-width: 760px){.excalidraw .ToolIcon.ToolIcon_type_floating{display:inline-block;position:absolute;right:calc(-2*var(--space-factor));margin-left:0;border-radius:20px 0 0 20px;z-index:1;background-color:var(--button-gray-1)}.excalidraw .ToolIcon.ToolIcon_type_floating:hover{background-color:var(--button-gray-1)}.excalidraw .ToolIcon.ToolIcon_type_floating:active{background-color:var(--button-gray-2)}.excalidraw .ToolIcon.ToolIcon_type_floating .ToolIcon__icon{border-radius:inherit}.excalidraw .ToolIcon.ToolIcon_type_floating svg{position:static}.excalidraw .ToolIcon.ToolIcon__library{top:100px}.excalidraw .ToolIcon.ToolIcon__lock{margin-inline-end:0;top:60px}.excalidraw .ToolIcon.ToolIcon__penMode{margin-inline-end:0;top:140px}}:root[dir=ltr] .excalidraw .unlocked-icon{left:2px}:root[dir=rtl] .excalidraw .unlocked-icon{right:2px}",""]);const s=a},9144:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_radio+.ToolIcon__icon:active,.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_checkbox+.ToolIcon__icon:active{background:var(--color-primary-light)}.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_radio:checked+.ToolIcon__icon,.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_checkbox:checked+.ToolIcon__icon{background:var(--color-primary);--icon-fill-color: #ffffff;--keybinding-color: #ffffff}.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_radio:checked+.ToolIcon__icon:active,.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_checkbox:checked+.ToolIcon__icon:active{background:var(--color-primary-darker)}.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon__keybinding{bottom:4px;right:4px}.excalidraw .App-toolbar-container .ToolIcon_type_floating:not(.is-mobile) .ToolIcon__icon{padding:1px;background-color:var(--island-bg-color);box-shadow:1px 3px 4px 0px rgba(0,0,0,.15);border-radius:50%;transition:box-shadow .5s ease,transform .5s ease}.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_radio:focus-within+.ToolIcon__icon,.excalidraw .App-toolbar-container .ToolIcon_type_floating .ToolIcon_type_checkbox:focus-within+.ToolIcon__icon{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .App-toolbar-container .ToolIcon__hidden{box-shadow:none !important;background-color:transparent !important;pointer-events:none !important}.excalidraw .App-toolbar-container .ToolIcon.ToolIcon__lock{margin-inline-end:var(--space-factor)}.excalidraw .App-toolbar-container .ToolIcon.ToolIcon__lock.ToolIcon_type_floating{margin-left:.1rem}.excalidraw .App-toolbar-container .ToolIcon__library{margin-inline-start:var(--space-factor)}.excalidraw .App-toolbar-container.zen-mode .ToolIcon_type_floating .ToolIcon__icon{box-shadow:none;transform:scale(0.9)}.excalidraw .App-toolbar-container.zen-mode .ToolIcon_type_floating .ToolIcon_type_checkbox:not(:checked):not(:hover):not(:active)+.ToolIcon__icon svg{fill:#adb5bd;color:#adb5bd}.excalidraw .App-toolbar{border-radius:var(--border-radius-lg);box-shadow:0 0 0 1px rgba(0,0,0,.01),1px 1px 5px rgba(0,0,0,.15)}.excalidraw .App-toolbar .ToolIcon:hover{--icon-fill-color: var( --color-primary-contrast-offset, var(--color-primary) );--keybinding-color: var( --color-primary-contrast-offset, var(--color-primary) )}.excalidraw .App-toolbar .ToolIcon:active{--icon-fill-color: #212529;--keybinding-color: #212529}.excalidraw .App-toolbar .ToolIcon .ToolIcon__icon{background:transparent;border-radius:var(--border-radius-lg)}.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_radio+.ToolIcon__icon:active,.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_checkbox+.ToolIcon__icon:active{background:var(--color-primary-light)}.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_radio:checked+.ToolIcon__icon,.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_checkbox:checked+.ToolIcon__icon{background:var(--color-primary);--icon-fill-color: #ffffff;--keybinding-color: #ffffff}.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_radio:checked+.ToolIcon__icon:active,.excalidraw .App-toolbar .ToolIcon .ToolIcon_type_checkbox:checked+.ToolIcon__icon:active{background:var(--color-primary-darker)}.excalidraw .App-toolbar .ToolIcon .ToolIcon__keybinding{bottom:4px;right:4px}.excalidraw .App-toolbar.zen-mode .ToolIcon__keybinding,.excalidraw .App-toolbar.zen-mode .HintViewer{display:none}.excalidraw.theme--dark .App-toolbar .ToolIcon:active{--icon-fill-color: #dee2e6;--keybinding-color: #dee2e6}",""]);const s=a},6626:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw-tooltip{position:absolute;z-index:1000;padding:8px;border-radius:6px;box-sizing:border-box;pointer-events:none;word-wrap:break-word;background:#000;line-height:1.5;text-align:center;font-size:13px;font-weight:500;color:#fff;display:none}.excalidraw-tooltip.excalidraw-tooltip--visible{display:block}.excalidraw-tooltip-wrapper{display:flex}.excalidraw-tooltip-icon{width:.9em;height:.9em;margin-left:5px;margin-top:1px;display:flex}.excalidraw--mobile.excalidraw-tooltip-icon{display:none}",""]);const s=a},6359:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".excalidraw .UserList{pointer-events:none;padding:var(--space-factor);display:flex;justify-content:flex-end;overflow:hidden;border-radius:60px}.excalidraw .UserList:empty{display:none}.excalidraw .UserList.layout-vertical{grid-column:3;flex-direction:column-reverse;position:absolute;top:60px;right:var(--space-factor);max-height:calc(\n 100vh - var(--space-factor) - 60px - 60px +\n var(--itemOffset)\n );padding-bottom:max(var(--itemOffset)*-1,0px)}.excalidraw .UserList.layout-vertical .Avatar{width:2.4rem;height:2.4rem}.excalidraw .UserList>*{pointer-events:all}.excalidraw .UserList.layout-vertical>*{margin-bottom:var(--itemOffset)}.excalidraw .UserList.layout-horizontal>*{margin-right:var(--itemOffset)}.excalidraw .UserList_mobile{padding:0;justify-content:normal}.excalidraw .UserList_mobile>*{margin:0 var(--space-factor) var(--space-factor) 0}",""]);const s=a},9915:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,".visually-hidden{position:absolute !important;height:1px;width:1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);white-space:nowrap;-webkit-user-select:none;user-select:none}.LoadingMessage{position:absolute;top:0;right:0;bottom:0;left:0;z-index:999;display:flex;align-items:center;justify-content:center;pointer-events:none}.LoadingMessage span{background-color:var(--button-gray-1);border-radius:5px;padding:.8em 1.2em;color:var(--popup-text-color);font-size:1.3em}",""]);const s=a},9310:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>g});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o),s=n(1667),l=n.n(s),c=new URL(n(7984),n.b),d=new URL(n(1639),n.b),u=a()(i()),h=l()(c),p=l()(d);u.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("+h+");--focus-highlight-color: #a5d8ff;--icon-fill-color: #212529;--icon-green-fill-color: #2b8a3e;--default-bg-color: #ffffff;--input-bg-color: #ffffff;--input-border-color: #ced4da;--input-hover-bg-color: #f1f3f5;--input-label-color: #495057;--island-bg-color: rgba(255, 255, 255, 0.96);--keybinding-color: #adb5bd;--link-color: #1c7ed6;--overlay-bg-color: rgba(255, 255, 255, 0.88);--popup-bg-color: #ffffff;--popup-secondary-bg-color: #f1f3f5;--popup-text-color: #000000;--popup-text-inverted-color: #ffffff;--sab: env(safe-area-inset-bottom);--sal: env(safe-area-inset-left);--sar: env(safe-area-inset-right);--sat: env(safe-area-inset-top);--select-highlight-color: #339af0;--shadow-island: 0 0 0 1px rgba(0, 0, 0, 0.01), 1px 1px 5px rgb(0 0 0 / 12%);--space-factor: 0.25rem;--text-primary-color: #343a40;--color-primary: #6965db;--color-primary-darker: #5b57d1;--color-primary-darkest: #4a47b1;--color-primary-light: #e2e1fc;--border-radius-md: 0.375rem;--border-radius-lg: 0.5rem}.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("+p+');--focus-highlight-color: #228be6;--icon-fill-color: #ced4da;--icon-green-fill-color: #69db7c;--default-bg-color: #121212;--input-bg-color: #121212;--input-border-color: #2e2e2e;--input-hover-bg-color: #181818;--input-label-color: #e9ecef;--island-bg-color: rgba(30, 30, 30, 0.98);--keybinding-color: #868e96;--link-color: #4dabf7;--overlay-bg-color: rgba(52, 58, 64, 0.12);--popup-bg-color: #2c2c2c;--popup-secondary-bg-color: #222;--popup-text-color: #ced4da;--popup-text-inverted-color: #635c5c;--select-highlight-color: #4dabf7;--shadow-island: 1px 1px 5px rgba(0, 0, 0, 0.3);--text-primary-color: #ced4da;--color-primary: #5650f0;--color-primary-darker: #4b46d8;--color-primary-darkest: #3e39be;--color-primary-light: #3f3d64}:root{--zIndex-canvas: 1;--zIndex-wysiwyg: 2;--zIndex-layerUI: 3}.excalidraw{position:relative;overflow:hidden;color:var(--text-primary-color);display:flex;top:0;bottom:0;left:0;right:0;height:100%;width:100%;-webkit-user-select:none;user-select:none}.excalidraw:focus{outline:none}.excalidraw a{font-weight:500;text-decoration:none;color:var(--link-color)}.excalidraw a:hover{text-decoration:underline}.excalidraw canvas{touch-action:none;image-rendering:pixelated;image-rendering:-moz-crisp-edges;z-index:var(--zIndex-canvas)}.excalidraw__canvas{position:absolute}.excalidraw.theme--dark canvas{filter:var(--theme-filter)}.excalidraw .FixedSideContainer{padding-top:var(--sat, 0);padding-right:var(--sar, 0);padding-bottom:var(--sab, 0);padding-left:var(--sal, 0)}.excalidraw .panelRow{display:flex;justify-content:space-between}.excalidraw .panelColumn{display:flex;flex-direction:column}.excalidraw .panelColumn h3,.excalidraw .panelColumn legend,.excalidraw .panelColumn .control-label{margin-top:.333rem;margin-bottom:.333rem;font-size:.75rem;color:var(--text-primary-color);font-weight:bold;display:block}.excalidraw .panelColumn .control-label input{display:block;width:100%}.excalidraw .panelColumn h3:first-child,.excalidraw .panelColumn legend:first-child,.excalidraw .panelColumn .control-label:first-child{margin-top:0}.excalidraw .panelColumn legend{padding:0}.excalidraw .panelColumn .iconSelectList{flex-wrap:wrap;position:relative}.excalidraw .panelColumn .buttonList{flex-wrap:wrap}.excalidraw .panelColumn .buttonList label{margin-right:.25rem;font-size:.75rem;display:inline-block}.excalidraw .panelColumn .buttonList input[type=radio],.excalidraw .panelColumn .buttonList input[type=button]{opacity:0;position:absolute;pointer-events:none}.excalidraw .panelColumn .buttonList .iconRow{margin-top:8px}.excalidraw .panelColumn .buttonList .ToolIcon{margin:0;margin-inline-end:8px}.excalidraw .panelColumn .buttonList .ToolIcon:focus{outline:transparent;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .panelColumn .buttonList .ToolIcon:hover{background-color:var(--button-gray-2)}.excalidraw .panelColumn .buttonList .ToolIcon:active{background-color:var(--button-gray-3)}.excalidraw .panelColumn .buttonList .ToolIcon:disabled{cursor:not-allowed}.excalidraw .panelColumn .buttonList .ToolIcon__icon{width:28px;height:28px}.excalidraw .panelColumn fieldset{margin:0;margin-top:.333rem;padding:0;border:none}.excalidraw .divider{width:1px;background-color:#e9ecef;margin:1px}.excalidraw .buttonList label:focus-within,.excalidraw input:focus-visible{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:var(--border-radius-md);margin:.125rem 0;padding:.25rem;white-space:nowrap;cursor:pointer}.excalidraw button:focus-visible,.excalidraw .buttonList label:focus-visible{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(--color-primary);--icon-fill-color: #ffffff}.excalidraw .active:hover,.excalidraw .buttonList label.active:hover{background-color:var(--color-primary-darker)}.excalidraw .active:active,.excalidraw .buttonList label.active:active{background-color:var(--color-primary-darkest)}.excalidraw .buttonList.buttonListIcon label{display:inline-flex;justify-content:center;align-items:center}.excalidraw .buttonList.buttonListIcon label svg{width:35px;height:14px;padding:2px;opacity:.6}.excalidraw .buttonList.buttonListIcon label.active svg{opacity:1}.excalidraw .App-top-bar{z-index:var(--zIndex-layerUI);display:grid;grid-template-columns:1fr -webkit-max-content 1fr;grid-template-columns:1fr max-content 1fr}.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 .eraser.ToolIcon:hover{--icon-fill-color: #fff;--keybinding-color: #fff}.excalidraw .App-toolbar .eraser.active{background-color:var(--color-primary)}.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:auto -webkit-max-content auto;grid-template-columns:auto max-content auto;grid-gap:4px;align-items:flex-start;cursor:default;pointer-events:none !important}.excalidraw .layer-ui__wrapper:not(.disable-pointerEvents) .App-menu_top>*{pointer-events:all}.excalidraw .App-menu_top>*:first-child{justify-self:flex-start}.excalidraw .App-menu_top>*:last-child{justify-self:flex-end}.excalidraw .App-menu_bottom{position:absolute;bottom:0;grid-template-columns:-webkit-min-content auto -webkit-min-content;grid-template-columns:min-content auto min-content;grid-gap:15px;align-items:flex-start;cursor:default;pointer-events:none !important;z-index:100}:root[dir=ltr] .excalidraw .App-menu_bottom{left:.25rem}:root[dir=rtl] .excalidraw .App-menu_bottom{right:.25rem}.excalidraw .App-menu_bottom--transition-left section{width:185px}.excalidraw .App-menu_bottom section{display:flex}.excalidraw .App-menu_bottom>*:first-child{justify-self:flex-start}.excalidraw .App-menu_bottom>*:last-child{justify-self:flex-end}.excalidraw .App-menu_left{grid-template-rows:1fr auto 1fr;height:100%}.excalidraw .App-menu_right{grid-template-rows:1fr;height:100%}.excalidraw .App-menu__left{overflow-y:auto}.excalidraw .dropdown-select{height:1.5rem;padding:0;padding-inline-start:.5rem;padding-inline-end:1.5rem;color:var(--icon-fill-color);background-color:var(--button-gray-1);border-radius:var(--space-factor);border:1px solid var(--button-gray-2);font-size:.8rem;outline:none;-webkit-appearance:none;appearance:none;background-image:var(--dropdown-icon);background-repeat:no-repeat;background-position:right .7rem top 50%,0 0;background-size:.65em auto,100%}:root[dir=rtl] .excalidraw .dropdown-select{background-position:left .7rem top 50%,0 0}.excalidraw .dropdown-select:focus{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .dropdown-select:hover{background-color:var(--button-gray-2)}.excalidraw .dropdown-select:active{background-color:var(--button-gray-2)}.excalidraw .zIndexButton{margin:0;margin-inline-end:8px;padding:5px;display:inline-flex;align-items:center;justify-content:center}.excalidraw .zIndexButton svg{width:18px;height:18px}.excalidraw .scroll-back-to-content{color:var(--popup-text-color);position:absolute;left:50%;bottom:30px;transform:translateX(-50%);padding:10px 20px}.excalidraw .help-icon{display:flex;cursor:pointer;fill:#868e96;padding:0;margin:0;background:none;color:var(--icon-fill-color)}.excalidraw .help-icon svg{width:1.5rem;height:1.5rem}.excalidraw .help-icon:hover{background:none}.excalidraw .reset-zoom-button{padding:.2em;background:transparent;color:var(--text-primary-color);font-family:var(--ui-font)}.excalidraw .undo-redo-buttons,.excalidraw .eraser-buttons{display:grid;grid-auto-flow:column;gap:.4em;margin-top:auto;margin-bottom:auto;margin-inline-start:.6em}.excalidraw--mobile.excalidraw aside{display:none}.excalidraw--mobile.excalidraw .scroll-back-to-content{bottom:calc(80px + var(--sab, 0));z-index:-1}:root[dir=rtl] .excalidraw .rtl-mirror{transform:scaleX(-1)}.excalidraw .zen-mode-visibility{visibility:visible;opacity:1;height:auto;width:auto;transition:opacity .5s}.excalidraw .zen-mode-visibility.zen-mode-visibility--hidden{visibility:hidden;opacity:0;height:0;width:0;transition:opacity .5s}.excalidraw .disable-pointerEvents{pointer-events:none !important}.excalidraw.excalidraw--view-mode .App-menu{display:flex;justify-content:space-between}.excalidraw input[type=text],.excalidraw textarea:not(.excalidraw-wysiwyg){color:var(--text-primary-color);border:1.5px solid var(--input-border-color);padding:.75rem;white-space:nowrap;border-radius:var(--space-factor);background-color:var(--input-bg-color)}.excalidraw input[type=text]:not(:focus):hover,.excalidraw textarea:not(.excalidraw-wysiwyg):not(:focus):hover{background-color:var(--input-hover-bg-color)}.excalidraw input[type=text]:focus,.excalidraw textarea:not(.excalidraw-wysiwyg):focus{outline:none;box-shadow:0 0 0 2px var(--focus-highlight-color)}@media print{.excalidraw .App-bottom-bar,.excalidraw .FixedSideContainer,.excalidraw .layer-ui__wrapper{display:none}}.excalidraw .HomeButton.ToolIcon.ToolIcon_type_floating{display:inline-block;position:absolute;top:60px;left:calc(-2*var(--space-factor));border-radius:0 20px 20px 0;background-color:var(--button-gray-1)}.excalidraw .HomeButton.ToolIcon.ToolIcon_type_floating:hover{background-color:var(--button-gray-1)}.excalidraw .HomeButton.ToolIcon.ToolIcon_type_floating:active{background-color:var(--button-gray-2)}.excalidraw .HomeButton.ToolIcon.ToolIcon_type_floating .ToolIcon__icon{border-radius:inherit}.excalidraw .HomeButton.ToolIcon.ToolIcon_type_floating svg{position:static}.ErrorSplash.excalidraw{min-height:100vh;padding:20px 0;overflow:auto;display:flex;align-items:center;justify-content:center;-webkit-user-select:text;user-select:text}.ErrorSplash.excalidraw .ErrorSplash-messageContainer{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px;background-color:#ffe3e3;border:3px solid #c92a2a}.ErrorSplash.excalidraw .ErrorSplash-paragraph{margin:15px 0;max-width:600px}.ErrorSplash.excalidraw .ErrorSplash-paragraph.align-center{text-align:center}.ErrorSplash.excalidraw .bigger,.ErrorSplash.excalidraw .bigger button{font-size:1.1em}.ErrorSplash.excalidraw .smaller,.ErrorSplash.excalidraw .smaller button{font-size:.9em}.ErrorSplash.excalidraw .ErrorSplash-details{display:flex;flex-direction:column;align-items:flex-start}.ErrorSplash.excalidraw .ErrorSplash-details textarea{width:100%;margin:10px 0;font-family:"Cascadia";font-size:.8em}',""]);const g=u},6464:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,"",""]),a.locals={themeFilter:"invert(93%) hue-rotate(180deg)"};const s=a},5260:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>s});var r=n(8081),i=n.n(r),o=n(3645),a=n.n(o)()(i());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw-hyperlinkContainer{display:flex;align-items:center;justify-content:space-between;position:absolute;box-shadow:0px 2px 4px 0 rgba(0,0,0,.3);z-index:100;background:var(--island-bg-color);border-radius:var(--border-radius-md);box-sizing:border-box;min-height:42px}.excalidraw-hyperlinkContainer-input,.excalidraw-hyperlinkContainer button{z-index:100}.excalidraw-hyperlinkContainer-input,.excalidraw-hyperlinkContainer-link{height:24px;padding:0 8px;line-height:24px;font-size:.9rem;font-weight:500;font-family:var(--ui-font)}.excalidraw-hyperlinkContainer-input{width:18rem;border:none;background-color:transparent;color:var(--text-primary-color);outline:none;border:none;box-shadow:none !important}.excalidraw-hyperlinkContainer-link{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:15rem}.excalidraw-hyperlinkContainer button{color:#228be6;background-color:transparent !important;font-weight:500}.excalidraw-hyperlinkContainer button.excalidraw-hyperlinkContainer--remove{color:#c92a2a}.excalidraw-hyperlinkContainer .d-none{display:none}.excalidraw-hyperlinkContainer--remove .ToolIcon__icon svg{color:#fa5252}.excalidraw-hyperlinkContainer .ToolIcon__icon{width:2rem;height:2rem}.excalidraw-hyperlinkContainer__buttons{flex:0 0 auto}",""]);const s=a},3645:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(a[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);r&&a[d[0]]||(void 0!==o&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=o),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),i&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=i):d[4]="".concat(i)),t.push(d))}},t}},1667:e=>{"use strict";e.exports=function(e,t){return t||(t={}),e?(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]|(%20)/.test(e)||t.needQuotes?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e):e}},8081:e=>{"use strict";e.exports=function(e){return e[1]}},8288:(e,t,n)=>{"use strict";n.d(t,{iC:()=>o,f:()=>a,qx:()=>s,Iw:()=>l,$e:()=>c,wZ:()=>d,ay:()=>u,oc:()=>h,Oh:()=>p,Ks:()=>g,Vi:()=>m,$C:()=>f,ut:()=>b,C6:()=>v,_D:()=>x,n5:()=>y,rk:()=>w,Hg:()=>k,hs:()=>_,k:()=>C,LO:()=>E,r8:()=>S,pb:()=>j,LL:()=>I,Gj:()=>T,nM:()=>M,Lg:()=>O,HM:()=>L,V4:()=>A,sA:()=>P,EH:()=>D,ZF:()=>z,UO:()=>R,ah:()=>H,cW:()=>N,kV:()=>B,sS:()=>F,Yx:()=>U,zK:()=>W,ZB:()=>K,qy:()=>V,h6:()=>G,jo:()=>Y,$n:()=>X,hR:()=>Z,Kr:()=>q,gK:()=>$,oX:()=>Q});var r=n(8635),i=n.n(r);const o="Excalidraw",a=10,s=8,l=5,c=1,d=30,u=Math.PI/12,h={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},p={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1};let g;!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",e.EXCALIDRAW_LINK="excalidraw-link"}(g||(g={}));const m={TEST:"test",DEVELOPMENT:"development"},f={SHAPE_ACTIONS_MENU:"App-menu__left"},b={Virgil:1,Helvetica:2,Cascadia:3},v={LIGHT:"light",DARK:"dark"},x="Segoe UI Emoji",y=20,w=b.Virgil,k="left",_="top",C=20,E={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"},S={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawLibrary:"excalidrawlib"},j=window.location.origin,I=500,T=300,M=500,O=5e3,L=100,A=.1,P=300,D={VIEW:"viewMode",ZEN:"zenMode",GRID:"gridMode"},z=i().themeFilter,R={addLibrary:"addLibrary"},H={addLibrary:"addLibrary"},N={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,theme:!0,saveAsImage:!0}},B=800,F=1e3,U=500,W=2,K=[1,2,3],V=10,G=1440,Y=[E.png,E.jpg,E.svg,E.gif],X=2097152,Z="http://www.w3.org/2000/svg",q={excalidraw:2,excalidrawLibrary:2},$=5,Q={TOP:"top",MIDDLE:"middle",BOTTOM:"bottom"}},1143:(e,t,n)=>{"use strict";n.r(t),n.d(t,{FONT_FAMILY:()=>o.ut,THEME:()=>o.C6,bumpVersion:()=>Dr,cleanAppStateForExport:()=>fn,clearAppStateForLocalStorage:()=>mn,default:()=>Pp,defaultLang:()=>c,exportToBlob:()=>Uh,exportToCanvas:()=>Fh,exportToClipboard:()=>Kh,exportToSvg:()=>Wh,getDefaultAppState:()=>hn,getFreeDrawSvgPath:()=>Sr,getNonDeletedElements:()=>El,getSceneVersion:()=>_l,isInvisiblySmallElement:()=>zr,isLinearElement:()=>je,languages:()=>d,loadFromBlob:()=>bd,loadLibraryFromBlob:()=>vd,mutateElement:()=>Ar,newElementWith:()=>Pr,restore:()=>ud,restoreAppState:()=>dd,restoreElements:()=>cd,serializeAsJSON:()=>Ed});var r=n(9787),i=n.n(r),o=n(8288);const a=JSON.parse('{"u2":"@dwelle/excalidraw","i8":"0.3.51"}');"production"!==o.Vi.TEST&&(n.p=window.EXCALIDRAW_ASSET_PATH||"https://unpkg.com/".concat(a.u2,"@").concat(a.i8,"/dist/"));var s=n(1463);const l=JSON.parse('{"ar-SA":94,"bg-BG":61,"bn-BD":0,"ca-ES":99,"cs-CZ":24,"da-DK":17,"de-DE":99,"el-GR":86,"en":100,"es-ES":99,"eu-ES":99,"fa-IR":63,"fi-FI":98,"fr-FR":99,"he-IL":80,"hi-IN":58,"hu-HU":99,"id-ID":100,"it-IT":100,"ja-JP":97,"kab-KAB":95,"kk-KZ":23,"ko-KR":72,"lt-LT":23,"lv-LV":100,"mr-IN":0,"my-MM":46,"nb-NO":100,"nl-NL":90,"nn-NO":83,"oc-FR":97,"pa-IN":86,"pl-PL":93,"pt-BR":99,"pt-PT":83,"ro-RO":100,"ru-RU":99,"si-LK":9,"sk-SK":99,"sv-SE":100,"ta-IN":99,"tr-TR":84,"uk-UA":81,"zh-CN":100,"zh-HK":28,"zh-TW":100}'),c={code:"en",label:"English"},d=[{code:"ar-SA",label:"العربية",rtl:!0},{code:"bg-BG",label:"Български"},{code:"ca-ES",label:"Català"},{code:"cs-CZ",label:"Česky"},{code:"de-DE",label:"Deutsch"},{code:"el-GR",label:"Ελληνικά"},{code:"es-ES",label:"Español"},{code:"eu-ES",label:"Euskara"},{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:"kk-KZ",label:"Қазақ тілі"},{code:"ko-KR",label:"한국어"},{code:"lt-LT",label:"Lietuvių"},{code:"lv-LV",label:"Latviešu"},{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:"繁體中文"}].concat([c]).sort(((e,t)=>e.label>t.label?1:-1)).filter((e=>l[e.code]>=85)),u="__test__";"production"===o.Vi.DEVELOPMENT&&d.unshift({code:u,label:"test language"},{code:"".concat(u,".rtl"),label:"test language (rtl)",rtl:!0});let h=c,p={};const g=async e=>{h=e,document.documentElement.dir=h.rtl?"rtl":"ltr",document.documentElement.lang=h.code,p=e.code.startsWith(u)?{}:await Promise.resolve().then(n.t.bind(n,1463,19))},m=()=>h,f=(e,t)=>{for(let n=0;n<t.length;++n){const r=t[n];if(void 0===e[r])return;e=e[r]}if("string"==typeof e)return e},b=(e,t)=>{if(h.code.startsWith(u)){const n=t?"".concat(e,"(").concat(JSON.stringify(t).slice(1,-1),")"):e;return"[[".concat(n,"]]")}const n=e.split(".");let r=f(p,n)||f(s,n);if(void 0===r)throw new Error("Can't find translation for ".concat(e));if(t)for(const e in t)r=r.replace("{{".concat(e,"}}"),String(t[e]));return r};var v=n(4512);const x=()=>(0,v.jsx)("div",{className:"LoadingMessage",children:(0,v.jsx)("span",{children:b("labels.loadingScene")})}),y=e=>{const[t,n]=(0,r.useState)(!0);return(0,r.useEffect)((()=>{const t=d.find((t=>t.code===e.langCode))||c;(async()=>{await g(t)})(),n(!1)}),[e.langCode]),t?(0,v.jsx)(x,{}):e.children};function w(e,t,n){if(e&&e.length){const[r,i]=t,o=Math.PI/180*n,a=Math.cos(o),s=Math.sin(o);e.forEach((e=>{const[t,n]=e;e[0]=(t-r)*a-(n-i)*s+r,e[1]=(t-r)*s+(n-i)*a+i}))}}function k(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 _(e,t){const n=t.hachureAngle+90;let r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);const i=[0,0];if(n)for(const t of e)w(t,i,n);const o=function(e,t){const n=[];for(const t of e){const e=[...t];e[0].join(",")!==e[e.length-1].join(",")&&e.push([e[0][0],e[0][1]]),e.length>2&&n.push(e)}const r=[];t=Math.max(t,.1);const i=[];for(const e of n)for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];if(n[1]!==r[1]){const e=Math.min(n[1],r[1]);i.push({ymin:e,ymax:Math.max(n[1],r[1]),x:e===n[1]?n[0]:r[0],islope:(r[0]-n[0])/(r[1]-n[1])})}}if(i.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))),!i.length)return r;let o=[],a=i[0].ymin;for(;o.length||i.length;){if(i.length){let e=-1;for(let t=0;t<i.length&&!(i[t].ymin>a);t++)e=t;i.splice(0,e+1).forEach((e=>{o.push({s:a,edge:e})}))}if(o=o.filter((e=>!(e.edge.ymax<=a))),o.sort(((e,t)=>e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x))),o.length>1)for(let e=0;e<o.length;e+=2){const t=e+1;if(t>=o.length)break;const n=o[e].edge,i=o[t].edge;r.push([[Math.round(n.x),a],[Math.round(i.x),a]])}a+=t,o.forEach((e=>{e.edge.x=e.edge.x+t*e.edge.islope}))}return r}(e,r);if(n){for(const t of e)w(t,i,-n);!function(e,t,n){const r=[];e.forEach((e=>r.push(...e))),w(r,t,n)}(o,i,-n)}return o}class C{constructor(e){this.helper=e}fillPolygons(e,t){return this._fillPolygons(e,t)}_fillPolygons(e,t){const n=_(e,t);return{type:"fillSketch",ops:this.renderLines(n,t)}}renderLines(e,t){const n=[];for(const r of e)n.push(...this.helper.doubleLineOps(r[0][0],r[0][1],r[1][0],r[1][1],t));return n}}class E extends C{fillPolygons(e,t){let n=t.hachureGap;n<0&&(n=4*t.strokeWidth),n=Math.max(n,.1);const r=_(e,Object.assign({},t,{hachureGap:n})),i=Math.PI/180*t.hachureAngle,o=[],a=.5*n*Math.cos(i),s=.5*n*Math.sin(i);for(const[e,t]of r)k([e,t])&&o.push([[e[0]-a,e[1]+s],[...t]],[[e[0]+a,e[1]-s],[...t]]);return{type:"fillSketch",ops:this.renderLines(o,t)}}}class S extends C{fillPolygons(e,t){const n=this._fillPolygons(e,t),r=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),i=this._fillPolygons(e,r);return n.ops=n.ops.concat(i.ops),n}}class j{constructor(e){this.helper=e}fillPolygons(e,t){const n=_(e,t=Object.assign({},t,{hachureAngle:0}));return this.dotsOnLines(n,t)}dotsOnLines(e,t){const n=[];let r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);let i=t.fillWeight;i<0&&(i=t.strokeWidth/2);const o=r/4;for(const a of e){const e=k(a),s=e/r,l=Math.ceil(s)-1,c=e-l*r,d=(a[0][0]+a[1][0])/2-r/4,u=Math.min(a[0][1],a[1][1]);for(let e=0;e<l;e++){const a=u+c+e*r,s=d-o+2*Math.random()*o,l=a-o+2*Math.random()*o,h=this.helper.ellipse(s,l,i,i,t);n.push(...h.ops)}}return{type:"fillSketch",ops:n}}}class I{constructor(e){this.helper=e}fillPolygons(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,i=[];return e.forEach((e=>{const o=k(e),a=Math.floor(o/(n+r)),s=(o+r-a*(n+r))/2;let l=e[0],c=e[1];l[0]>c[0]&&(l=e[1],c=e[0]);const d=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let e=0;e<a;e++){const o=e*(n+r),a=o+n,c=[l[0]+o*Math.cos(d)+s*Math.cos(d),l[1]+o*Math.sin(d)+s*Math.sin(d)],u=[l[0]+a*Math.cos(d)+s*Math.cos(d),l[1]+a*Math.sin(d)+s*Math.sin(d)];i.push(...this.helper.doubleLineOps(c[0],c[1],u[0],u[1],t))}})),i}}class T{constructor(e){this.helper=e}fillPolygons(e,t){const n=t.hachureGap<0?4*t.strokeWidth:t.hachureGap,r=t.zigzagOffset<0?n:t.zigzagOffset,i=_(e,t=Object.assign({},t,{hachureGap:n+r}));return{type:"fillSketch",ops:this.zigzagLines(i,r,t)}}zigzagLines(e,t,n){const r=[];return e.forEach((e=>{const i=k(e),o=Math.round(i/(2*t));let a=e[0],s=e[1];a[0]>s[0]&&(a=e[1],s=e[0]);const l=Math.atan((s[1]-a[1])/(s[0]-a[0]));for(let e=0;e<o;e++){const i=2*e*t,o=2*(e+1)*t,s=Math.sqrt(2*Math.pow(t,2)),c=[a[0]+i*Math.cos(l),a[1]+i*Math.sin(l)],d=[a[0]+o*Math.cos(l),a[1]+o*Math.sin(l)],u=[c[0]+s*Math.cos(l+Math.PI/4),c[1]+s*Math.sin(l+Math.PI/4)];r.push(...this.helper.doubleLineOps(c[0],c[1],u[0],u[1],n),...this.helper.doubleLineOps(u[0],u[1],d[0],d[1],n))}})),r}}const M={};class O{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const L={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 A(e,t){return e.type===t}function P(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",i=0,o=n[i];for(;!A(o,2);){let a=0;const s=[];if("BOD"===r){if("M"!==o.text&&"m"!==o.text)return P("M0,0"+e);i++,a=L[o.text],r=o.text}else A(o,1)?a=L[r]:(i++,a=L[o.text],r=o.text);if(!(i+a<n.length))throw new Error("Path data ended short");for(let e=i;e<i+a;e++){const t=n[e];if(!A(t,1))throw new Error("Param not a number: "+r+","+t.text);s[s.length]=+t.text}if("number"!=typeof L[r])throw new Error("Bad segment: "+r);{const e={key:r,data:s};t.push(e),i+=a,o=n[i],"M"===r&&(r="L"),"m"===r&&(r="l")}}return t}function D(e){let t=0,n=0,r=0,i=0;const o=[];for(const{key:a,data:s}of e)switch(a){case"M":o.push({key:"M",data:[...s]}),[t,n]=s,[r,i]=s;break;case"m":t+=s[0],n+=s[1],o.push({key:"M",data:[t,n]}),r=t,i=n;break;case"L":o.push({key:"L",data:[...s]}),[t,n]=s;break;case"l":t+=s[0],n+=s[1],o.push({key:"L",data:[t,n]});break;case"C":o.push({key:"C",data:[...s]}),t=s[4],n=s[5];break;case"c":{const e=s.map(((e,r)=>r%2?e+n:e+t));o.push({key:"C",data:e}),t=e[4],n=e[5];break}case"Q":o.push({key:"Q",data:[...s]}),t=s[2],n=s[3];break;case"q":{const e=s.map(((e,r)=>r%2?e+n:e+t));o.push({key:"Q",data:e}),t=e[2],n=e[3];break}case"A":o.push({key:"A",data:[...s]}),t=s[5],n=s[6];break;case"a":t+=s[5],n+=s[6],o.push({key:"A",data:[s[0],s[1],s[2],s[3],s[4],t,n]});break;case"H":o.push({key:"H",data:[...s]}),t=s[0];break;case"h":t+=s[0],o.push({key:"H",data:[t]});break;case"V":o.push({key:"V",data:[...s]}),n=s[0];break;case"v":n+=s[0],o.push({key:"V",data:[n]});break;case"S":o.push({key:"S",data:[...s]}),t=s[2],n=s[3];break;case"s":{const e=s.map(((e,r)=>r%2?e+n:e+t));o.push({key:"S",data:e}),t=e[2],n=e[3];break}case"T":o.push({key:"T",data:[...s]}),t=s[0],n=s[1];break;case"t":t+=s[0],n+=s[1],o.push({key:"T",data:[t,n]});break;case"Z":case"z":o.push({key:"Z",data:[]}),t=r,n=i}return o}function z(e){const t=[];let n="",r=0,i=0,o=0,a=0,s=0,l=0;for(const{key:c,data:d}of e){switch(c){case"M":t.push({key:"M",data:[...d]}),[r,i]=d,[o,a]=d;break;case"C":t.push({key:"C",data:[...d]}),r=d[4],i=d[5],s=d[2],l=d[3];break;case"L":t.push({key:"L",data:[...d]}),[r,i]=d;break;case"H":r=d[0],t.push({key:"L",data:[r,i]});break;case"V":i=d[0],t.push({key:"L",data:[r,i]});break;case"S":{let e=0,o=0;"C"===n||"S"===n?(e=r+(r-s),o=i+(i-l)):(e=r,o=i),t.push({key:"C",data:[e,o,...d]}),s=d[0],l=d[1],r=d[2],i=d[3];break}case"T":{const[e,o]=d;let a=0,c=0;"Q"===n||"T"===n?(a=r+(r-s),c=i+(i-l)):(a=r,c=i);const u=r+2*(a-r)/3,h=i+2*(c-i)/3,p=e+2*(a-e)/3,g=o+2*(c-o)/3;t.push({key:"C",data:[u,h,p,g,e,o]}),s=a,l=c,r=e,i=o;break}case"Q":{const[e,n,o,a]=d,c=r+2*(e-r)/3,u=i+2*(n-i)/3,h=o+2*(e-o)/3,p=a+2*(n-a)/3;t.push({key:"C",data:[c,u,h,p,o,a]}),s=e,l=n,r=o,i=a;break}case"A":{const e=Math.abs(d[0]),n=Math.abs(d[1]),o=d[2],a=d[3],s=d[4],l=d[5],c=d[6];if(0===e||0===n)t.push({key:"C",data:[r,i,l,c,l,c]}),r=l,i=c;else if(r!==l||i!==c){H(r,i,l,c,e,n,o,a,s).forEach((function(e){t.push({key:"C",data:e})})),r=l,i=c}break}case"Z":t.push({key:"Z",data:[]}),r=o,i=a}n=c}return t}function R(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function H(e,t,n,r,i,o,a,s,l,c){const d=(u=a,Math.PI*u/180);var u;let h=[],p=0,g=0,m=0,f=0;if(c)[p,g,m,f]=c;else{[e,t]=R(e,t,-d),[n,r]=R(n,r,-d);const a=(e-n)/2,c=(t-r)/2;let u=a*a/(i*i)+c*c/(o*o);u>1&&(u=Math.sqrt(u),i*=u,o*=u);const h=i*i,b=o*o,v=h*b-h*c*c-b*a*a,x=h*c*c+b*a*a,y=(s===l?-1:1)*Math.sqrt(Math.abs(v/x));m=y*i*c/o+(e+n)/2,f=y*-o*a/i+(t+r)/2,p=Math.asin(parseFloat(((t-f)/o).toFixed(9))),g=Math.asin(parseFloat(((r-f)/o).toFixed(9))),e<m&&(p=Math.PI-p),n<m&&(g=Math.PI-g),p<0&&(p=2*Math.PI+p),g<0&&(g=2*Math.PI+g),l&&p>g&&(p-=2*Math.PI),!l&&g>p&&(g-=2*Math.PI)}let b=g-p;if(Math.abs(b)>120*Math.PI/180){const e=g,t=n,s=r;g=l&&g>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,h=H(n=m+i*Math.cos(g),r=f+o*Math.sin(g),t,s,i,o,a,0,l,[g,e,m,f])}b=g-p;const v=Math.cos(p),x=Math.sin(p),y=Math.cos(g),w=Math.sin(g),k=Math.tan(b/4),_=4/3*i*k,C=4/3*o*k,E=[e,t],S=[e+_*x,t-C*v],j=[n+_*w,r-C*y],I=[n,r];if(S[0]=2*E[0]-S[0],S[1]=2*E[1]-S[1],c)return[S,j,I].concat(h);{h=[S,j,I].concat(h);const e=[];for(let t=0;t<h.length;t+=3){const n=R(h[t][0],h[t][1],d),r=R(h[t+1][0],h[t+1][1],d),i=R(h[t+2][0],h[t+2][1],d);e.push([n[0],n[1],r[0],r[1],i[0],i[1]])}return e}}const N={randOffset:function(e,t){return $(e,t)},randOffsetWithRange:function(e,t,n){return q(e,t,n)},ellipse:function(e,t,n,r,i){const o=K(n,r,i);return V(e,t,i,o).opset},doubleLineOps:function(e,t,n,r,i){return Q(e,t,n,r,i,!0)}};function B(e,t,n,r,i){return{type:"path",ops:Q(e,t,n,r,i)}}function F(e,t,n){const r=(e||[]).length;if(r>2){const i=[];for(let t=0;t<r-1;t++)i.push(...Q(e[t][0],e[t][1],e[t+1][0],e[t+1][1],n));return t&&i.push(...Q(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:"path",ops:i}}return 2===r?B(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:"path",ops:[]}}function U(e,t,n,r,i){return function(e,t){return F(e,!0,t)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],i)}function W(e,t){let n=ee(e,1*(1+.2*t.roughness),t);if(!t.disableMultiStroke){const r=ee(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 K(e,t,n){const r=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),i=Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r),o=2*Math.PI/i;let a=Math.abs(e/2),s=Math.abs(t/2);const l=1-n.curveFitting;return a+=$(a*l,n),s+=$(s*l,n),{increment:o,rx:a,ry:s}}function V(e,t,n,r){const[i,o]=ne(r.increment,e,t,r.rx,r.ry,1,r.increment*q(.1,q(.4,1,n),n),n);let a=te(i,null,n);if(!n.disableMultiStroke&&0!==n.roughness){const[i]=ne(r.increment,e,t,r.rx,r.ry,1.5,0,n),o=te(i,null,n);a=a.concat(o)}return{estimatedPoints:o,opset:{type:"path",ops:a}}}function G(e,t,n,r,i,o,a,s,l){const c=e,d=t;let u=Math.abs(n/2),h=Math.abs(r/2);u+=$(.01*u,l),h+=$(.01*h,l);let p=i,g=o;for(;p<0;)p+=2*Math.PI,g+=2*Math.PI;g-p>2*Math.PI&&(p=0,g=2*Math.PI);const m=2*Math.PI/l.curveStepCount,f=Math.min(m/2,(g-p)/2),b=re(f,c,d,u,h,p,g,1,l);if(!l.disableMultiStroke){const e=re(f,c,d,u,h,p,g,1.5,l);b.push(...e)}return a&&(s?b.push(...Q(c,d,c+u*Math.cos(p),d+h*Math.sin(p),l),...Q(c,d,c+u*Math.cos(g),d+h*Math.sin(g),l)):b.push({op:"lineTo",data:[c,d]},{op:"lineTo",data:[c+u*Math.cos(p),d+h*Math.sin(p)]})),{type:"path",ops:b}}function Y(e,t){const n=[];for(const r of e)if(r.length){const e=t.maxRandomnessOffset||0,i=r.length;if(i>2){n.push({op:"move",data:[r[0][0]+$(e,t),r[0][1]+$(e,t)]});for(let o=1;o<i;o++)n.push({op:"lineTo",data:[r[o][0]+$(e,t),r[o][1]+$(e,t)]})}}return{type:"fillPath",ops:n}}function X(e,t){return function(e,t){let n=e.fillStyle||"hachure";if(!M[n])switch(n){case"zigzag":M[n]||(M[n]=new E(t));break;case"cross-hatch":M[n]||(M[n]=new S(t));break;case"dots":M[n]||(M[n]=new j(t));break;case"dashed":M[n]||(M[n]=new I(t));break;case"zigzag-line":M[n]||(M[n]=new T(t));break;default:n="hachure",M[n]||(M[n]=new C(t))}return M[n]}(t,N).fillPolygons(e,t)}function Z(e){return e.randomizer||(e.randomizer=new O(e.seed||0)),e.randomizer.next()}function q(e,t,n,r=1){return n.roughness*r*(Z(n)*(t-e)+e)}function $(e,t,n=1){return q(-e,e,t,n)}function Q(e,t,n,r,i,o=!1){const a=o?i.disableMultiStrokeFill:i.disableMultiStroke,s=J(e,t,n,r,i,!0,!1);if(a)return s;const l=J(e,t,n,r,i,!0,!0);return s.concat(l)}function J(e,t,n,r,i,o,a){const s=Math.pow(e-n,2)+Math.pow(t-r,2),l=Math.sqrt(s);let c=1;c=l<200?1:l>500?.4:-.0016668*l+1.233334;let d=i.maxRandomnessOffset||0;d*d*100>s&&(d=l/10);const u=d/2,h=.2+.2*Z(i);let p=i.bowing*i.maxRandomnessOffset*(r-t)/200,g=i.bowing*i.maxRandomnessOffset*(e-n)/200;p=$(p,i,c),g=$(g,i,c);const m=[],f=()=>$(u,i,c),b=()=>$(d,i,c),v=i.preserveVertices;return o&&(a?m.push({op:"move",data:[e+(v?0:f()),t+(v?0:f())]}):m.push({op:"move",data:[e+(v?0:$(d,i,c)),t+(v?0:$(d,i,c))]})),a?m.push({op:"bcurveTo",data:[p+e+(n-e)*h+f(),g+t+(r-t)*h+f(),p+e+2*(n-e)*h+f(),g+t+2*(r-t)*h+f(),n+(v?0:f()),r+(v?0:f())]}):m.push({op:"bcurveTo",data:[p+e+(n-e)*h+b(),g+t+(r-t)*h+b(),p+e+2*(n-e)*h+b(),g+t+2*(r-t)*h+b(),n+(v?0:b()),r+(v?0:b())]}),m}function ee(e,t,n){const r=[];r.push([e[0][0]+$(t,n),e[0][1]+$(t,n)]),r.push([e[0][0]+$(t,n),e[0][1]+$(t,n)]);for(let i=1;i<e.length;i++)r.push([e[i][0]+$(t,n),e[i][1]+$(t,n)]),i===e.length-1&&r.push([e[i][0]+$(t,n),e[i][1]+$(t,n)]);return te(r,null,n)}function te(e,t,n){const r=e.length,i=[];if(r>3){const o=[],a=1-n.curveTightness;i.push({op:"move",data:[e[1][0],e[1][1]]});for(let t=1;t+2<r;t++){const n=e[t];o[0]=[n[0],n[1]],o[1]=[n[0]+(a*e[t+1][0]-a*e[t-1][0])/6,n[1]+(a*e[t+1][1]-a*e[t-1][1])/6],o[2]=[e[t+1][0]+(a*e[t][0]-a*e[t+2][0])/6,e[t+1][1]+(a*e[t][1]-a*e[t+2][1])/6],o[3]=[e[t+1][0],e[t+1][1]],i.push({op:"bcurveTo",data:[o[1][0],o[1][1],o[2][0],o[2][1],o[3][0],o[3][1]]})}if(t&&2===t.length){const e=n.maxRandomnessOffset;i.push({op:"lineTo",data:[t[0]+$(e,n),t[1]+$(e,n)]})}}else 3===r?(i.push({op:"move",data:[e[1][0],e[1][1]]}),i.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):2===r&&i.push(...Q(e[0][0],e[0][1],e[1][0],e[1][1],n));return i}function ne(e,t,n,r,i,o,a,s){const l=[],c=[],d=$(.5,s)-Math.PI/2,u=0===s.roughness;u||c.push([$(o,s)+t+.9*r*Math.cos(d-e),$(o,s)+n+.9*i*Math.sin(d-e)]);const h=2*Math.PI+(u?0:d-.01);for(let a=d;a<h;a+=e){const e=[$(o,s)+t+r*Math.cos(a),$(o,s)+n+i*Math.sin(a)];l.push(e),c.push(e)}return u||(c.push([$(o,s)+t+r*Math.cos(d+2*Math.PI+.5*a),$(o,s)+n+i*Math.sin(d+2*Math.PI+.5*a)]),c.push([$(o,s)+t+.98*r*Math.cos(d+a),$(o,s)+n+.98*i*Math.sin(d+a)]),c.push([$(o,s)+t+.9*r*Math.cos(d+.5*a),$(o,s)+n+.9*i*Math.sin(d+.5*a)])),[c,l]}function re(e,t,n,r,i,o,a,s,l){const c=o+$(.1,l),d=[];d.push([$(s,l)+t+.9*r*Math.cos(c-e),$(s,l)+n+.9*i*Math.sin(c-e)]);for(let o=c;o<=a;o+=e)d.push([$(s,l)+t+r*Math.cos(o),$(s,l)+n+i*Math.sin(o)]);return d.push([t+r*Math.cos(a),n+i*Math.sin(a)]),d.push([t+r*Math.cos(a),n+i*Math.sin(a)]),te(d,null,l)}function ie(e,t,n,r,i,o,a,s){const l=[],c=[s.maxRandomnessOffset||1,(s.maxRandomnessOffset||1)+.3];let d=[0,0];const u=s.disableMultiStroke?1:2,h=s.preserveVertices;for(let p=0;p<u;p++)0===p?l.push({op:"move",data:[a[0],a[1]]}):l.push({op:"move",data:[a[0]+(h?0:$(c[0],s)),a[1]+(h?0:$(c[0],s))]}),d=h?[i,o]:[i+$(c[p],s),o+$(c[p],s)],l.push({op:"bcurveTo",data:[e+$(c[p],s),t+$(c[p],s),n+$(c[p],s),r+$(c[p],s),d[0],d[1]]});return l}function oe(e){return[...e]}function ae(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function se(e,t,n){const r=ae(t,n);if(0===r)return ae(e,t);let i=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return i=Math.max(0,Math.min(1,i)),ae(e,le(t,n,i))}function le(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function ce(e,t,n,r){const i=r||[];if(function(e,t){const n=e[t+0],r=e[t+1],i=e[t+2],o=e[t+3];let a=3*r[0]-2*n[0]-o[0];a*=a;let s=3*r[1]-2*n[1]-o[1];s*=s;let l=3*i[0]-2*o[0]-n[0];l*=l;let c=3*i[1]-2*o[1]-n[1];return c*=c,a<l&&(a=l),s<c&&(s=c),a+s}(e,t)<n){const n=e[t+0];if(i.length){(o=i[i.length-1],a=n,Math.sqrt(ae(o,a)))>1&&i.push(n)}else i.push(n);i.push(e[t+3])}else{const r=.5,o=e[t+0],a=e[t+1],s=e[t+2],l=e[t+3],c=le(o,a,r),d=le(a,s,r),u=le(s,l,r),h=le(c,d,r),p=le(d,u,r),g=le(h,p,r);ce([o,c,h,g],0,n,i),ce([g,p,u,l],0,n,i)}var o,a;return i}function de(e,t){return ue(e,0,e.length,t)}function ue(e,t,n,r,i){const o=i||[],a=e[t],s=e[n-1];let l=0,c=1;for(let r=t+1;r<n-1;++r){const t=se(e[r],a,s);t>l&&(l=t,c=r)}return Math.sqrt(l)>r?(ue(e,t,c+1,r,o),ue(e,c,n,r,o)):(o.length||o.push(a),o.push(s)),o}function he(e,t=.15,n){const r=[],i=(e.length-1)/3;for(let n=0;n<i;n++){ce(e,3*n,t,r)}return n&&n>0?ue(r,0,r.length,n):r}const pe="none";class ge{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,t,n){return{shape:e,sets:t||[],options:n||this.defaultOptions}}line(e,t,n,r,i){const o=this._o(i);return this._d("line",[B(e,t,n,r,o)],o)}rectangle(e,t,n,r,i){const o=this._o(i),a=[],s=U(e,t,n,r,o);if(o.fill){const i=[[e,t],[e+n,t],[e+n,t+r],[e,t+r]];"solid"===o.fillStyle?a.push(Y([i],o)):a.push(X([i],o))}return o.stroke!==pe&&a.push(s),this._d("rectangle",a,o)}ellipse(e,t,n,r,i){const o=this._o(i),a=[],s=K(n,r,o),l=V(e,t,o,s);if(o.fill)if("solid"===o.fillStyle){const n=V(e,t,o,s).opset;n.type="fillPath",a.push(n)}else a.push(X([l.estimatedPoints],o));return o.stroke!==pe&&a.push(l.opset),this._d("ellipse",a,o)}circle(e,t,n,r){const i=this.ellipse(e,t,n,n,r);return i.shape="circle",i}linearPath(e,t){const n=this._o(t);return this._d("linearPath",[F(e,!1,n)],n)}arc(e,t,n,r,i,o,a=!1,s){const l=this._o(s),c=[],d=G(e,t,n,r,i,o,a,!0,l);if(a&&l.fill)if("solid"===l.fillStyle){const a=Object.assign({},l);a.disableMultiStroke=!0;const s=G(e,t,n,r,i,o,!0,!1,a);s.type="fillPath",c.push(s)}else c.push(function(e,t,n,r,i,o,a){const s=e,l=t;let c=Math.abs(n/2),d=Math.abs(r/2);c+=$(.01*c,a),d+=$(.01*d,a);let u=i,h=o;for(;u<0;)u+=2*Math.PI,h+=2*Math.PI;h-u>2*Math.PI&&(u=0,h=2*Math.PI);const p=(h-u)/a.curveStepCount,g=[];for(let e=u;e<=h;e+=p)g.push([s+c*Math.cos(e),l+d*Math.sin(e)]);return g.push([s+c*Math.cos(h),l+d*Math.sin(h)]),g.push([s,l]),X([g],a)}(e,t,n,r,i,o,l));return l.stroke!==pe&&c.push(d),this._d("arc",c,l)}curve(e,t){const n=this._o(t),r=[],i=W(e,n);if(n.fill&&n.fill!==pe&&e.length>=3){const t=function(e,t=0){const n=e.length;if(n<3)throw new Error("A curve must have at least three points.");const r=[];if(3===n)r.push(oe(e[0]),oe(e[1]),oe(e[2]),oe(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 i=[],o=1-t;r.push(oe(n[0]));for(let e=1;e+2<n.length;e++){const t=n[e];i[0]=[t[0],t[1]],i[1]=[t[0]+(o*n[e+1][0]-o*n[e-1][0])/6,t[1]+(o*n[e+1][1]-o*n[e-1][1])/6],i[2]=[n[e+1][0]+(o*n[e][0]-o*n[e+2][0])/6,n[e+1][1]+(o*n[e][1]-o*n[e+2][1])/6],i[3]=[n[e+1][0],n[e+1][1]],r.push(i[1],i[2],i[3])}}return r}(e),i=he(t,10,(1+n.roughness)/2);"solid"===n.fillStyle?r.push(Y([i],n)):r.push(X([i],n))}return n.stroke!==pe&&r.push(i),this._d("curve",r,n)}polygon(e,t){const n=this._o(t),r=[],i=F(e,!0,n);return n.fill&&("solid"===n.fillStyle?r.push(Y([e],n)):r.push(X([e],n))),n.stroke!==pe&&r.push(i),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 i=n.fill&&"transparent"!==n.fill&&n.fill!==pe,o=n.stroke!==pe,a=!!(n.simplification&&n.simplification<1),s=function(e,t,n){const r=z(D(P(e))),i=[];let o=[],a=[0,0],s=[];const l=()=>{s.length>=4&&o.push(...he(s,t)),s=[]},c=()=>{l(),o.length&&(i.push(o),o=[])};for(const{key:e,data:t}of r)switch(e){case"M":c(),a=[t[0],t[1]],o.push(a);break;case"L":l(),o.push([t[0],t[1]]);break;case"C":if(!s.length){const e=o.length?o[o.length-1]:a;s.push([e[0],e[1]])}s.push([t[0],t[1]]),s.push([t[2],t[3]]),s.push([t[4],t[5]]);break;case"Z":l(),o.push([a[0],a[1]])}if(c(),!n)return i;const d=[];for(const e of i){const t=de(e,n);t.length&&d.push(t)}return d}(e,1,a?4-4*n.simplification:(1+n.roughness)/2);return i&&("solid"===n.fillStyle?r.push(Y(s,n)):r.push(X(s,n))),o&&(a?s.forEach((e=>{r.push(F(e,!1,n))})):r.push(function(e,t){const n=z(D(P(e))),r=[];let i=[0,0],o=[0,0];for(const{key:e,data:a}of n)switch(e){case"M":{const e=1*(t.maxRandomnessOffset||0),n=t.preserveVertices;r.push({op:"move",data:a.map((r=>r+(n?0:$(e,t))))}),o=[a[0],a[1]],i=[a[0],a[1]];break}case"L":r.push(...Q(o[0],o[1],a[0],a[1],t)),o=[a[0],a[1]];break;case"C":{const[e,n,i,s,l,c]=a;r.push(...ie(e,n,i,s,l,c,o,t)),o=[l,c];break}case"Z":r.push(...Q(o[0],o[1],i[0],i[1],t)),o=[i[0],i[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:pe};break;case"fillPath":t={d:this.opsToPath(e),stroke:pe,strokeWidth:0,fill:n.fill||pe};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||pe,strokeWidth:n,fill:pe}}}class me{constructor(e,t){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new ge(t)}draw(e){const t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.ctx,i=e.options.fixedDecimalPlaceDigits;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,i),r.restore();break;case"fillPath":{r.save(),r.fillStyle=n.fill||"";const t="curve"===e.shape||"polygon"===e.shape||"path"===e.shape?"evenodd":"nonzero";this._drawToContext(r,o,i,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,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,t,n,r="nonzero"){e.beginPath();for(const r of t.ops){const t="number"==typeof n&&n>=0?r.data.map((e=>+e.toFixed(n))):r.data;switch(r.op){case"move":e.moveTo(t[0],t[1]);break;case"bcurveTo":e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]);break;case"lineTo":e.lineTo(t[0],t[1])}}"fillPath"===t.type?e.fill(r):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,t,n,r,i){const o=this.gen.line(e,t,n,r,i);return this.draw(o),o}rectangle(e,t,n,r,i){const o=this.gen.rectangle(e,t,n,r,i);return this.draw(o),o}ellipse(e,t,n,r,i){const o=this.gen.ellipse(e,t,n,r,i);return this.draw(o),o}circle(e,t,n,r){const i=this.gen.circle(e,t,n,r);return this.draw(i),i}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,i,o,a=!1,s){const l=this.gen.arc(e,t,n,r,i,o,a,s);return this.draw(l),l}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 fe="http://www.w3.org/2000/svg";class be{constructor(e,t){this.svg=e,this.gen=new ge(t)}draw(e){const t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.svg.ownerDocument||window.document,i=r.createElementNS(fe,"g"),o=e.options.fixedDecimalPlaceDigits;for(const a of t){let t=null;switch(a.type){case"path":t=r.createElementNS(fe,"path"),t.setAttribute("d",this.opsToPath(a,o)),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(fe,"path"),t.setAttribute("d",this.opsToPath(a,o)),t.setAttribute("stroke","none"),t.setAttribute("stroke-width","0"),t.setAttribute("fill",n.fill||""),"curve"!==e.shape&&"polygon"!==e.shape||t.setAttribute("fill-rule","evenodd");break;case"fillSketch":t=this.fillSketch(r,a,n)}t&&i.appendChild(t)}return i}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2);const i=e.createElementNS(fe,"path");return i.setAttribute("d",this.opsToPath(t,n.fixedDecimalPlaceDigits)),i.setAttribute("stroke",n.fill||""),i.setAttribute("stroke-width",r+""),i.setAttribute("fill","none"),n.fillLineDash&&i.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&i.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),i}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,t){return this.gen.opsToPath(e,t)}line(e,t,n,r,i){const o=this.gen.line(e,t,n,r,i);return this.draw(o)}rectangle(e,t,n,r,i){const o=this.gen.rectangle(e,t,n,r,i);return this.draw(o)}ellipse(e,t,n,r,i){const o=this.gen.ellipse(e,t,n,r,i);return this.draw(o)}circle(e,t,n,r){const i=this.gen.circle(e,t,n,r);return this.draw(i)}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,i,o,a=!1,s){const l=this.gen.arc(e,t,n,r,i,o,a,s);return this.draw(l)}curve(e,t){const n=this.gen.curve(e,t);return this.draw(n)}path(e,t){const n=this.gen.path(e,t);return this.draw(n)}}const ve={canvas:(e,t)=>new me(e,t),svg:(e,t)=>new be(e,t),generator:e=>new ge(e),newSeed:()=>ge.newSeed()};function xe(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=xe(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=xe(e))&&(r&&(r+=" "),r+=t);return r}let we=(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};const ke=e=>!!e&&"image"===e.type&&!!e.fileId,_e=e=>!!e&&"image"===e.type,Ce=e=>null!=e&&"text"===e.type,Ee=e=>null!=e&&Se(e.type),Se=e=>"freedraw"===e,je=e=>null!=e&&Ie(e.type),Ie=e=>"arrow"===e||"line"===e,Te=e=>null!=e&&Me(e.type),Me=e=>"arrow"===e,Oe=e=>null!=e&&("rectangle"===e.type||"diamond"===e.type||"ellipse"===e.type||"image"===e.type||"text"===e.type&&!e.containerId),Le=e=>null!=e&&("rectangle"===e.type||"diamond"===e.type||"ellipse"===e.type||"image"===e.type),Ae=e=>{var t;return Oe(e)&&!(null===(t=e.boundElements)||void 0===t||!t.some((e=>{let{type:t}=e;return"text"===t})))},Pe=e=>null!==e&&Ce(e)&&null!==e.containerId,De=(e,t,n,r,i)=>[(e-n)*Math.cos(i)-(t-r)*Math.sin(i)+n,(e-n)*Math.sin(i)+(t-r)*Math.cos(i)+r],ze=(e,t,n)=>De(e[0],e[1],t[0],t[1],n),Re=(e,t,n,r,i,o,a,s)=>{const l=Math.cos(r),c=Math.sin(r);return e.e&&e.w?t+=i+a:e.e?(t+=i*(1+l),n+=i*c,t+=a*(1-l),n+=a*-c):e.w&&(t+=i*(1-l),n+=i*-c,t+=a*(1+l),n+=a*c),e.n&&e.s?n+=o+s:e.n?(t+=o*c,n+=o*(1-l),t+=s*-c,n+=s*(1+l)):e.s&&(t+=o*-c,n+=o*(1+l),t+=s*c,n+=s*(1-l)),[t,n]},He=(e,t,n,r)=>{const i=n-e,o=r-t;return Math.hypot(i,o)},Ne=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(e.length>=3){const[n,r]=[e[0],e[e.length-1]];return He(n[0],n[1],r[0],r[1])<=o.qx/t}return!1},Be=(e,t,n)=>{const r=e.length;if(r<3)return!1;const i=[Number.MAX_SAFE_INTEGER,n],o=[t,n];let a=0;for(let t=0;t<r;t++){const n=e[t],s=e[(t+1)%r];if(We(n,s,o,i)){if(0===Ue(n,o,s))return Fe(n,o,s);a++}}return a%2==1},Fe=(e,t,n)=>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]),Ue=(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},We=(e,t,n,r)=>{const i=Ue(e,t,n),o=Ue(e,t,r),a=Ue(n,r,e),s=Ue(n,r,t);return i!==o&&a!==s||(!(0!==i||!Fe(e,n,t))||(!(0!==o||!Fe(e,r,t))||(!(0!==a||!Fe(n,e,r))||!(0!==s||!Fe(n,t,r)))))},Ke=(e,t,n)=>n?[Math.round(e/n)*n,Math.round(t/n)*n]:[e,t],Ve=e=>{const t=e.map((e=>e[0])),n=e.map((e=>e[1]));return{width:Math.max(...t)-Math.min(...t),height:Math.max(...n)-Math.min(...n)}},Ge=(e,t,n)=>{const r=n.map((t=>t[e])),i=Math.max(...r),o=Math.min(...r),a=i-o,s=0===a?1:t/a;let l=1/0;const c=n.map((t=>t.map(((t,n)=>{if(n!==e)return t;const r=t*s;return l=Math.min(r,l),r}))));if(2===c.length)return c;const d=o-l;return c.map((t=>t.map(((t,n)=>n===e?t+d:t))))},Ye=e=>Ee(e)?$e(e):je(e)?Qe(e):[e.x,e.y,e.x+e.width,e.y+e.height],Xe=e=>{for(const t of e.sets)if("path"===t.type)return t.ops;return e.sets[0].ops},Ze=(e,t)=>{let n=[0,0];const{minX:r,minY:i,maxX:o,maxY:a}=e.reduce(((e,r)=>{let{op:i,data:o}=r;if("move"===i)n=o;else if("bcurveTo"===i){const r=[o[0],o[1]],i=[o[2],o[3]],a=[o[4],o[5]],s=n;n=a;const l=(e,t)=>Math.pow(1-e,3)*a[t]+3*e*Math.pow(1-e,2)*i[t]+3*Math.pow(e,2)*(1-e)*r[t]+s[t]*Math.pow(e,3);let c=0;for(;c<=1;){let n=l(c,0),r=l(c,1);t&&([n,r]=t(n,r)),e.minY=Math.min(e.minY,r),e.minX=Math.min(e.minX,n),e.maxX=Math.max(e.maxX,n),e.maxY=Math.max(e.maxY,r),c+=.1}}return e}),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return[r,i,o,a]},qe=e=>{let t=1/0,n=1/0,r=-1/0,i=-1/0;for(const[o,a]of e)t=Math.min(t,o),n=Math.min(n,a),r=Math.max(r,o),i=Math.max(i,a);return[t,n,r,i]},$e=e=>{const[t,n,r,i]=qe(e.points);return[t+e.x,n+e.y,r+e.x,i+e.y]},Qe=e=>{let t;if(e.points.length<2||!gr(e)){const{minX:n,minY:r,maxX:i,maxY:o}=e.points.reduce(((e,t)=>{let[n,r]=t;return e.minY=Math.min(e.minY,r),e.minX=Math.min(e.minX,n),e.maxX=Math.max(e.maxX,n),e.maxY=Math.max(e.maxY,r),e}),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});t=[n+e.x,r+e.y,i+e.x,o+e.y]}else{const n=gr(e),r=Xe(n[0]),[i,o,a,s]=Ze(r);t=[i+e.x,o+e.y,a+e.x,s+e.y]}return t},Je=e=>{let t;const[n,r,i,o]=Ye(e),a=(n+i)/2,s=(r+o)/2;if(Ee(e)){const[t,n,r,i]=qe(e.points.map((t=>{let[n,r]=t;return De(n,r,a-e.x,s-e.y,e.angle)})));return[t+e.x,n+e.y,r+e.x,i+e.y]}if(je(e))t=((e,t,n)=>{if(e.points.length<2||!gr(e)){const{minX:r,minY:i,maxX:o,maxY:a}=e.points.reduce(((r,i)=>{let[o,a]=i;return[o,a]=De(e.x+o,e.y+a,t,n,e.angle),r.minY=Math.min(r.minY,a),r.minX=Math.min(r.minX,o),r.maxX=Math.max(r.maxX,o),r.maxY=Math.max(r.maxY,a),r}),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return[r,i,o,a]}const r=gr(e),i=Xe(r[0]);return Ze(i,((r,i)=>De(e.x+r,e.y+i,t,n,e.angle)))})(e,a,s);else if("diamond"===e.type){const[l,c]=De(a,r,a,s,e.angle),[d,u]=De(a,o,a,s,e.angle),[h,p]=De(n,s,a,s,e.angle),[g,m]=De(i,s,a,s,e.angle);t=[Math.min(l,d,h,g),Math.min(c,u,p,m),Math.max(l,d,h,g),Math.max(c,u,p,m)]}else if("ellipse"===e.type){const l=(i-n)/2,c=(o-r)/2,d=Math.cos(e.angle),u=Math.sin(e.angle),h=Math.hypot(l*d,c*u),p=Math.hypot(c*d,l*u);t=[a-h,s-p,a+h,s+p]}else{const[l,c]=De(n,r,a,s,e.angle),[d,u]=De(n,o,a,s,e.angle),[h,p]=De(i,o,a,s,e.angle),[g,m]=De(i,r,a,s,e.angle);t=[Math.min(l,d,h,g),Math.min(c,u,p,m),Math.max(l,d,h,g),Math.max(c,u,p,m)]}return t},et=e=>{if(!e.length)return[0,0,0,0];let t=1/0,n=-1/0,r=1/0,i=-1/0;return e.forEach((e=>{const[o,a,s,l]=Je(e);t=Math.min(t,o),r=Math.min(r,a),n=Math.max(n,s),i=Math.max(i,l)})),[t,r,n,i]},tt=(e,t,n)=>{if(!je(e)&&!Ee(e))return[e.x,e.y,e.x+t,e.y+n];const r=Ge(0,t,Ge(1,n,e.points));let i;if(Ee(e))i=qe(r);else{const t=ve.generator(),n="sharp"===e.strokeSharpness?t.linearPath(r,br(e)):t.curve(r,br(e)),o=Xe(n);i=Ze(o)}const[o,a,s,l]=i;return[o+e.x,a+e.y,s+e.x,l+e.y]},nt=(e,t,n)=>{const r=ve.generator(),i="sharp"===n?r.linearPath(t,br(e)):r.curve(t,br(e)),o=Xe(i),[a,s,l,c]=Ze(o);return[a+e.x,s+e.y,l+e.x,c+e.y]},rt=e=>{const[t,n,r,i]=et(e);return{minX:t,minY:n,maxX:r,maxY:i,width:r-t,height:i-n,midX:(t+r)/2,midY:(n+i)/2}},it=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"]}'),ot=e=>[it.red[e],it.pink[e],it.grape[e],it.violet[e],it.indigo[e],it.blue[e],it.cyan[e],it.teal[e],it.green[e],it.lime[e],it.yellow[e],it.orange[e]],at={canvasBackground:[it.white,it.gray[0],it.gray[1],...ot(0)],elementBackground:["transparent",it.gray[4],it.gray[6],...ot(6)],elementStroke:[it.black,it.gray[8],it.gray[7],...ot(9)]};var st=n(5156);const lt=/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),ct=/^Win/.test(window.navigator.platform),dt=/\b(android)\b/i.test(navigator.userAgent),ut="Equal",ht="Minus",pt="NumpadAdd",gt="NumpadSubtract",mt="Numpad0",ft="BracketRight",bt="BracketLeft",vt="Digit1",xt="Digit2",yt="Quote",wt="Digit0",kt="Slash",_t="KeyC",Ct="KeyD",Et="KeyG",St="KeyF",jt="KeyH",It="KeyV",Tt="KeyX",Mt="KeyZ",Ot="KeyR",Lt={ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",BACKSPACE:"Backspace",ALT:"Alt",CTRL_OR_CMD:lt?"metaKey":"ctrlKey",DELETE:"Delete",ENTER:"Enter",ESCAPE:"Escape",QUESTION_MARK:"?",SPACE:" ",TAB:"Tab",CHEVRON_LEFT:"<",CHEVRON_RIGHT:">",PERIOD:".",COMMA:",",A:"a",D:"d",E:"e",G:"g",I:"i",L:"l",O:"o",P:"p",Q:"q",R:"r",S:"s",T:"t",V:"v",X:"x",Y:"y",Z:"z",K:"k"},At=e=>e===Lt.ARROW_LEFT||e===Lt.ARROW_RIGHT||e===Lt.ARROW_DOWN||e===Lt.ARROW_UP,Pt=e=>e.altKey,Dt=e=>e.shiftKey,zt=e=>e.shiftKey;let Rt=null;const Ht=()=>{if(Rt)return Rt;const e=new Date,t=e.getFullYear(),n="".concat(e.getMonth()+1).padStart(2,"0"),r="".concat(e.getDate()).padStart(2,"0"),i="".concat(e.getHours()).padStart(2,"0"),o="".concat(e.getMinutes()).padStart(2,"0");return"".concat(t,"-").concat(n,"-").concat(r,"-").concat(i).concat(o)},Nt=e=>e.charAt(0).toUpperCase()+e.slice(1),Bt=e=>e instanceof HTMLElement&&"wysiwyg"===e.dataset.type||e instanceof HTMLBRElement||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&("text"===e.type||"number"===e.type),Ft=e=>{let{fontFamily:t}=e;for(const[e,n]of Object.entries(o.ut))if(n===t)return"".concat(e,", ").concat(o._D);return o._D},Ut=e=>{let{fontSize:t,fontFamily:n}=e;return"".concat(t,"px ").concat(Ft({fontFamily:n}))},Wt=(e,t)=>{let n=0,r=null;const i=function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];r=o,clearTimeout(n),n=window.setTimeout((()=>{r=null,e(...o)}),t)};return i.flush=()=>{if(clearTimeout(n),r){const t=r;r=null,e(...t)}},i.cancel=()=>{r=null,clearTimeout(n)},i},Kt=(e,t)=>Math.abs(e-t),Vt=e=>{e&&(e.style.cursor="")},Gt=(e,t)=>{e&&(e.style.cursor=t)},Yt=(e,t)=>{e&&("selection"===t||"eraser"===t?Vt(e):"image"!==t&&(e.style.cursor=o.oc.CROSSHAIR))},Xt=()=>{var e;return"HTML"===(null===(e=document.fullscreenElement)||void 0===e?void 0:e.nodeName)},Zt=e=>(e=e.replace(/\bAlt\b/i,"Alt").replace(/\bShift\b/i,"Shift").replace(/\b(Enter|Return)\b/i,"Enter").replace(/\bDel\b/i,"Delete"),lt?e.replace(/\bCtrlOrCmd\b/i,"Cmd").replace(/\bAlt\b/i,"Option"):e.replace(/\bCtrlOrCmd\b/i,"Ctrl")),qt=(e,t)=>{let{clientX:n,clientY:r}=e,{zoom:i,offsetLeft:o,offsetTop:a,scrollX:s,scrollY:l}=t;const c=1/i.value;return{x:(n-o)*c-s,y:(r-a)*c-l}},$t=(e,t)=>{let{sceneX:n,sceneY:r}=e,{zoom:i,offsetLeft:o,offsetTop:a,scrollX:s,scrollY:l}=t;return{x:(n+s)*i.value+o,y:(r+l)*i.value+a}},Qt=e=>getComputedStyle(document.documentElement).getPropertyValue("--".concat(e)),Jt=new RegExp("^[^".concat("A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-﷾--","]*[").concat("֑-߿יִ-﷽ﹰ-ﻼ","]")),en=e=>Jt.test(e),tn=e=>{const[t,n]=e;return{x:t,y:n}},nn=e=>{if("AbortError"!==(null==e?void 0:e.name))throw e;console.warn(e)},rn=e=>{const 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]},on=e=>t=>{(0,st.unstable_batchedUpdates)(e,t)},an=e=>(e=>{let t=null,n=null,r=null;const i=function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];n=o,r=e,null===t&&(t=window.requestAnimationFrame((()=>{t=null,n=null,r=null,e(...o)})))};return i.flush=()=>{if(null!==t&&(cancelAnimationFrame(t),t=null),n){const e=n,t=r;n=null,r=null,null!==t&&t(...e)}},i.cancel=()=>{n=null,r=null,null!==t&&(cancelAnimationFrame(t),t=null)},i})((t=>{(0,st.unstable_batchedUpdates)(e,t)})),sn=()=>cn()?1:Date.now(),ln=e=>e.reduce(((e,t)=>(e.set("string"==typeof t?t:t.id,t),e)),new Map),cn=()=>{var e;return"undefined"!=typeof process&&"test"===(null===(e={REACT_APP_BACKEND_V2_GET_URL:"https://json.excalidraw.com/api/v2/",REACT_APP_BACKEND_V2_POST_URL:"https://json.excalidraw.com/api/v2/post/",REACT_APP_LIBRARY_URL:"https://libraries.excalidraw.com",REACT_APP_LIBRARY_BACKEND:"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries",REACT_APP_PORTAL_URL:"https://portal.excalidraw.com",REACT_APP_WS_SERVER_URL:"",REACT_APP_FIREBASE_CONFIG:'{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}',REACT_APP_GOOGLE_ANALYTICS_ID:"UA-387204-13"})||void 0===e?void 0:e.NODE_ENV)},dn=(e,t)=>new CustomEvent(e,{detail:{nativeEvent:t},cancelable:!0}),un=o.ZB.includes(devicePixelRatio)?devicePixelRatio:1,hn=()=>({theme:o.C6.LIGHT,collaborators:new Map,currentChartType:"bar",currentItemBackgroundColor:"transparent",currentItemEndArrowhead:"arrow",currentItemFillStyle:"hachure",currentItemFontFamily:o.rk,currentItemFontSize:o.n5,currentItemLinearStrokeSharpness:"round",currentItemOpacity:100,currentItemRoughness:1,currentItemStartArrowhead:null,currentItemStrokeColor:it.black,currentItemStrokeSharpness:"sharp",currentItemStrokeStyle:"solid",currentItemStrokeWidth:1,currentItemTextAlign:o.Hg,cursorButton:"up",draggingElement:null,editingElement:null,editingGroupId:null,editingLinearElement:null,elementLocked:!1,elementType:"selection",penMode:!1,penDetected:!1,errorMessage:null,exportBackground:!0,exportScale:un,exportEmbedScene:!1,exportWithDarkMode:!1,fileHandle:null,gridSize:null,isBindingEnabled:!0,isLibraryOpen:!1,isLoading:!1,isResizing:!1,isRotating:!1,lastPointerDownWith:"mouse",multiElement:null,name:"".concat(b("labels.untitled"),"-").concat(Ht()),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:it.white,zenModeEnabled:!1,zoom:{value:1},viewModeEnabled:!1,pendingImageElement:null,showHyperlinkPopup:!1}),pn={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},penMode:{browser:!1,export:!1,server:!1},penDetected:{browser:!1,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},showHyperlinkPopup:{browser:!1,export:!1,server:!1}},gn=(e,t)=>{const n={};for(const r of Object.keys(e)){const i=pn[r];if(null!=i&&i[t]){const t=e[r];n[r]=t}}return n},mn=e=>gn(e,"browser"),fn=e=>gn(e,"export"),bn=e=>gn(e,"server"),vn=e=>{let{elementType:t}=e;return"eraser"===t};function xn(e,t,n,r=(e=>e)){return e*r(.5-t*(.5-n))}function yn(e,t){return[e[0]+t[0],e[1]+t[1]]}function wn(e,t){return[e[0]-t[0],e[1]-t[1]]}function kn(e,t){return[e[0]*t,e[1]*t]}function _n(e){return[e[1],-e[0]]}function Cn(e,t){return e[0]*t[0]+e[1]*t[1]}function En(e,t){return e[0]===t[0]&&e[1]===t[1]}function Sn(e,t){return function(e){return e[0]*e[0]+e[1]*e[1]}(wn(e,t))}function jn(e){return function(e,t){return[e[0]/t,e[1]/t]}(e,function(e){return Math.hypot(e[0],e[1])}(e))}function In(e,t){return Math.hypot(e[1]-t[1],e[0]-t[0])}function Tn(e,t,n){let r=Math.sin(n),i=Math.cos(n),o=e[0]-t[0],a=e[1]-t[1],s=o*r+a*i;return[o*i-a*r+t[0],s+t[1]]}function Mn(e,t,n){return yn(e,kn(wn(t,e),n))}function On(e,t,n){return yn(e,kn(t,n))}var{min:Ln,PI:An}=Math,Pn=An+1e-4;function Dn(e,t={}){return function(e,t={}){let{size:n=16,smoothing:r=.5,thinning:i=.5,simulatePressure:o=!0,easing:a=(e=>e),start:s={},end:l={},last:c=!1}=t,{cap:d=!0,taper:u=0,easing:h=(e=>e*(2-e))}=s,{cap:p=!0,taper:g=0,easing:m=(e=>--e*e*e+1)}=l;if(0===e.length||n<=0)return[];let f,b=e[e.length-1].runningLength,v=Math.pow(n*r,2),x=[],y=[],w=e.slice(0,10).reduce(((e,t)=>{let r=t.pressure;if(o){let i=Ln(1,t.distance/n),o=Ln(1,1-i);r=Ln(1,e+.275*i*(o-e))}return(e+r)/2}),e[0].pressure),k=xn(n,i,e[e.length-1].pressure,a),_=e[0].vector,C=e[0].point,E=C,S=C,j=E;for(let t=0;t<e.length;t++){let{pressure:r}=e[t],{point:s,vector:l,distance:c,runningLength:d}=e[t];if(t<e.length-1&&b-d<3)continue;if(i){if(o){let e=Ln(1,c/n),t=Ln(1,1-e);r=Ln(1,w+.275*e*(t-w))}k=xn(n,i,r,a)}else k=n/2;void 0===f&&(f=k);let p=d<u?h(d/u):1,I=b-d<g?m((b-d)/g):1;if(k=Math.max(.01,k*Math.min(p,I)),t===e.length-1){let e=kn(_n(l),k);x.push(wn(s,e)),y.push(yn(s,e));continue}let T=e[t+1].vector,M=Cn(l,T);if(M<0){let e=kn(_n(_),k);for(let t=1/13,n=0;n<=1;n+=t)S=Tn(wn(s,e),s,Pn*n),x.push(S),j=Tn(yn(s,e),s,Pn*-n),y.push(j);C=S,E=j;continue}let O=kn(_n(Mn(T,l,M)),k);S=wn(s,O),(t<=1||Sn(C,S)>v)&&(x.push(S),C=S),j=yn(s,O),(t<=1||Sn(E,j)>v)&&(y.push(j),E=j),w=r,_=l}let I=e[0].point.slice(0,2),T=e.length>1?e[e.length-1].point.slice(0,2):yn(e[0].point,[1,1]),M=[],O=[];if(1===e.length){if(!u&&!g||c){let e=On(I,jn(_n(wn(I,T))),-(f||k)),t=[];for(let n=1/13,r=n;r<=1;r+=n)t.push(Tn(e,I,2*Pn*r));return t}}else{if(!(u||g&&1===e.length))if(d)for(let e=1/13,t=e;t<=1;t+=e){let e=Tn(y[0],I,Pn*t);M.push(e)}else{let e=wn(x[0],y[0]),t=kn(e,.5),n=kn(e,.51);M.push(wn(I,t),wn(I,n),yn(I,n),yn(I,t))}let t=_n(function(e){return[-e[0],-e[1]]}(e[e.length-1].vector));if(g||u&&1===e.length)O.push(T);else if(p){let e=On(T,t,k);for(let t=1/29,n=t;n<1;n+=t)O.push(Tn(e,T,3*Pn*n))}else O.push(yn(T,kn(t,k)),yn(T,kn(t,.99*k)),wn(T,kn(t,.99*k)),wn(T,kn(t,k)))}return x.concat(O,y.reverse(),M)}(function(e,t={}){var n;let{streamline:r=.5,size:i=16,last:o=!1}=t;if(0===e.length)return[];let a=.15+.85*(1-r),s=Array.isArray(e[0])?e:e.map((({x:e,y:t,pressure:n=.5})=>[e,t,n]));if(2===s.length){let e=s[1];s=s.slice(0,-1);for(let t=1;t<5;t++)s.push(Mn(s[0],e,t/4))}1===s.length&&(s=[...s,[...yn(s[0],[1,1]),...s[0].slice(2)]]);let l=[{point:[s[0][0],s[0][1]],pressure:s[0][2]>=0?s[0][2]:.25,vector:[1,1],distance:0,runningLength:0}],c=!1,d=0,u=l[0],h=s.length-1;for(let e=1;e<s.length;e++){let t=o&&e===h?s[e].slice(0,2):Mn(u.point,s[e],a);if(En(u.point,t))continue;let n=In(t,u.point);if(d+=n,e<h&&!c){if(d<i)continue;c=!0}u={point:t,pressure:s[e][2]>=0?s[e][2]:.5,vector:jn(wn(u.point,t)),distance:n,runningLength:d},l.push(u)}return l[0].vector=(null==(n=l[1])?void 0:n.vector)||[0,0],l}(e,t),t)}const zn=e=>"string"==typeof e;class Rn{constructor(){this.callbacks=new Set,this.nonDeletedElements=[],this.elements=[],this.elementsMap=new Map}static mapElementToScene(e,t){zn(e)?this.sceneMapById.set(e,t):this.sceneMapByElement.set(e,t)}static getScene(e){return zn(e)?this.sceneMapById.get(e)||null:this.sceneMapByElement.get(e)||null}getElementsIncludingDeleted(){return this.elements}getElements(){return this.nonDeletedElements}getElement(e){return this.elementsMap.get(e)||null}getNonDeletedElement(e){const t=this.getElement(e);return t&&Sl(t)?t:null}getNonDeletedElements(e){const t=[];return e.forEach((e=>{const n=this.getNonDeletedElement(e);null!=n&&t.push(n)})),t}replaceAllElements(e){this.elements=e,this.elementsMap.clear(),e.forEach((e=>{this.elementsMap.set(e.id,e),Rn.mapElementToScene(e,this)})),this.nonDeletedElements=El(this.elements),this.informMutation()}informMutation(){for(const e of Array.from(this.callbacks))e()}addCallback(e){if(this.callbacks.has(e))throw new Error;return this.callbacks.add(e),()=>{if(!this.callbacks.has(e))throw new Error;this.callbacks.delete(e)}}destroy(){Rn.sceneMapById.forEach(((e,t)=>{e===this&&Rn.sceneMapById.delete(t)})),this.callbacks.clear()}}Rn.sceneMapByElement=new WeakMap,Rn.sceneMapById=new Map;const Hn=Rn,Nn=(e,t,n)=>{const r=t?t.width-2*o.gK:void 0;let i=e.text;t&&(i=Xn(e.originalText,Ut(e),t.width));const a=Un(e.originalText,Ut(e),r);let s=e.y;if(t){let n=t.height;e.verticalAlign===o.oX.TOP?s=t.y+o.gK:e.verticalAlign===o.oX.BOTTOM?s=t.y+t.height-a.height-o.gK:(s=t.y+t.height/2-a.height/2,a.height>t.height-2*o.gK&&(n=a.height+2*o.gK,s=t.y+n/2-a.height/2)),Ar(t,{height:n})}Ar(e,{width:a.width,height:a.height,baseline:a.baseline,y:s,text:i})},Bn=(e,t,n)=>{const r=ln(e);t.forEach((e=>{const t=n.get(e.id),i=Jn(e);if(i){const a=n.get(i);if(a){const n=r.get(t);var o;if(n)Ar(n,{boundElements:null===(o=e.boundElements)||void 0===o?void 0:o.concat({type:"text",id:a})});const i=r.get(a);i&&Ce(i)&&Ar(i,{containerId:n?t:null})}}}))},Fn=(e,t)=>{const n=Jn(e);if(n){const r=Hn.getScene(e).getElement(n);if(r&&r.text){if(!e)return;let n,i=r.text,a=r.height,s=e.height,l=r.baseline;if("n"!==t&&"s"!==t){i&&(i=Xn(r.originalText,Ut(r),e.width));const t=Un(i,Ut(r),e.width);a=t.height,l=t.baseline}if(a>e.height-2*o.gK){s=a+2*o.gK;const n=s-e.height,r="ne"===t||"nw"===t||"n"===t?e.y-n:e.y;Ar(e,{height:s,y:r})}n=r.verticalAlign===o.oX.TOP?e.y+o.gK:r.verticalAlign===o.oX.BOTTOM?e.y+e.height-a-o.gK:e.y+e.height/2-a/2,Ar(r,{text:i,width:e.width-2*o.gK,height:a,x:e.x+o.gK,y:n,baseline:l})}}},Un=(e,t,n)=>{e=e.split("\n").map((e=>e||" ")).join("\n");const r=document.createElement("div");if(r.style.position="absolute",r.style.whiteSpace="pre",r.style.font=t,r.style.minHeight="1em",n){const e=Vn(t);r.style.width="".concat(String(n),"px"),r.style.maxWidth="".concat(String(n),"px"),r.style.overflow="hidden",r.style.wordBreak="break-word",r.style.lineHeight="".concat(String(e),"px"),r.style.whiteSpace="pre-wrap"}document.body.appendChild(r),r.innerText=e;const i=document.createElement("span");i.style.display="inline-block",i.style.overflow="hidden",i.style.width="1px",i.style.height="1px",r.appendChild(i);const o=i.offsetTop+i.offsetHeight,a=r.offsetWidth,s=r.offsetHeight;return document.body.removeChild(r),{width:a,height:s,baseline:o}},Wn="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".toLocaleUpperCase(),Kn={},Vn=e=>(Kn[e]||(Kn[e]=Un(Wn,e,null).height),Kn[e]);let Gn;const Yn=(e,t)=>{Gn||(Gn=document.createElement("canvas"));const n=Gn.getContext("2d");n.font=t;const r=n.measureText(e);return cn()?10*r.width:r.width},Xn=(e,t,n)=>{const r=n-2*o.gK,i=[],a=e.split("\n"),s=Yn(" ",t);return a.forEach((e=>{const n=e.split(" ");if(1===n.length&&""===n[0])i.push(n[0]);else{let e="",o=0,a=0;for(;a<n.length;){if(Yn(n[a],t)>=r){for(e&&i.push(e),e="",o=0;n[a].length>0;){const s=n[a][0],l=Zn.calculate(s,t);o+=l,n[a]=n[a].slice(1),o>=r?(" "===e.slice(-1)&&(e=e.slice(0,-1)),i.push(e),e=s,o=l,o===r&&(e="",o=0)):e+=s}o+s>=r?(i.push(e),e="",o=0):(e+=" ",o+=s),a++}else{for(;o<r&&a<n.length;){const l=n[a];if(o=Yn(e+l,t),o>=r){i.push(e),o=0,e="";break}if(a++,e+="".concat(l," "),o+s>=r){i.push(e.slice(0,-1)),e="",o=0;break}}o===r&&(e="",o=0)}}e&&(" "===e.slice(-1)&&(e=e.slice(0,-1)),i.push(e))}})),i.join("\n")},Zn=(()=>{const e={};return{calculate:(t,n)=>{const r=t.charCodeAt(0);if(e[n]||(e[n]=[]),!e[n][r]){const i=Yn(t,n);e[n][r]=i}return e[n][r]},getCache:t=>e[t]}})(),qn=e=>{const t=Qn(e);return 0===t?Un(Wn.split("").join("\n"),e).width+2*o.gK:t+2*o.gK},$n=e=>Vn(e)+2*o.gK,Qn=e=>{const t=Zn.getCache(e);if(!t)return 0;const n=t.filter((e=>void 0!==e));return Math.max(...n)},Jn=e=>{var t,n,r;return null!=e&&null!==(t=e.boundElements)&&void 0!==t&&t.length&&(null==e||null===(n=e.boundElements)||void 0===n||null===(r=n.filter((e=>"text"===e.type))[0])||void 0===r?void 0:r.id)||null},er=e=>{if(!e)return null;const t=Jn(e);var n;return t&&(null===(n=Hn.getScene(e))||void 0===n?void 0:n.getElement(t))||null},tr=e=>{return e&&e.containerId&&(null===(t=Hn.getScene(e))||void 0===t?void 0:t.getElement(e.containerId))||null;var t},nr="invert(100%) hue-rotate(180deg) saturate(1.25)",rr=hn(),ir=(e,t)=>ke(e)&&!t.imageCache.has(e.fileId),or=(e,t)=>{var n;return"dark"===t.theme&&ke(e)&&!ir(e,t)&&(null===(n=t.imageCache.get(e.fileId))||void 0===n?void 0:n.mimeType)!==o.LO.svg},ar=e=>[8,8+e],sr=e=>[1.5,6+e],lr=e=>"freedraw"===e.type?12*e.strokeWidth:20,cr=document.createElement("img");cr.src="data:".concat(o.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>'));const dr=document.createElement("img");dr.src="data:".concat(o.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>'));const ur=(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(gr(e));break;case"arrow":case"line":n.lineJoin="round",n.lineCap="round",gr(e).forEach((e=>{t.draw(e)}));break;case"freedraw":{n.save(),n.fillStyle=e.strokeColor;const r=function(e){return Cr.get(e)}(e),i=gr(e);i&&t.draw(i),n.fillStyle=e.strokeColor,n.fill(r),n.restore();break}case"image":{var i;const t=ke(e)?null===(i=r.imageCache.get(e.fileId))||void 0===i?void 0:i.image:void 0;null==t||t instanceof Promise?((e,t,n)=>{t.fillStyle="#E7E7E7",t.fillRect(0,0,e.width,e.height);const r=Math.min(e.width,e.height),i=Math.min(r,Math.min(.4*r,100));t.drawImage("error"===e.status?dr:cr,e.width/2-i/2,e.height/2-i/2,i,i)})(e,n,r.zoom.value):n.drawImage(t,0,0,e.width,e.height);break}default:if(!Ce(e))throw new Error("Unimplemented type ".concat(e.type));{const t=en(e.text),r=t&&!n.canvas.isConnected;r&&document.body.appendChild(n.canvas),n.canvas.setAttribute("dir",t?"rtl":"ltr"),n.save(),n.font=Ut(e),n.fillStyle=e.strokeColor,n.textAlign=e.textAlign;const i=e.text.replace(/\r\n?/g,"\n").split("\n"),a=e.containerId?Vn(Ut(e)):e.height/i.length;let s=e.height-e.baseline;e.verticalAlign===o.oX.BOTTOM&&(s=o.gK);const l="center"===e.textAlign?e.width/2:"right"===e.textAlign?e.width:0;for(let e=0;e<i.length;e++)n.fillText(i[e],l,(e+1)*a-s);n.restore(),r&&n.canvas.remove()}}n.globalAlpha=1};let hr=new WeakMap,pr=new WeakMap;const gr=e=>pr.get(e),mr=(e,t)=>pr.set(e,t),fr=e=>pr.delete(e),br=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n={seed:e.seed,strokeLineDash:"dashed"===e.strokeStyle?ar(e.strokeWidth):"dotted"===e.strokeStyle?sr(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"ellipse":return n.fillStyle=e.fillStyle,n.fill="transparent"===e.backgroundColor?void 0:e.backgroundColor,"ellipse"===e.type&&(n.curveFitting=1),n;case"line":case"freedraw":return Ne(e.points)&&(n.fillStyle=e.fillStyle,n.fill="transparent"===e.backgroundColor?void 0:e.backgroundColor),n;case"arrow":return n;default:throw new Error("Unimplemented type ".concat(e.type))}},vr=(e,t)=>{let n=pr.get(e);if(void 0===n)switch(hr.delete(e),e.type){case"rectangle":if("round"===e.strokeSharpness){const r=e.width,i=e.height,o=.25*Math.min(r,i);n=t.path("M ".concat(o," 0 L ").concat(r-o," 0 Q ").concat(r," 0, ").concat(r," ").concat(o," L ").concat(r," ").concat(i-o," Q ").concat(r," ").concat(i,", ").concat(r-o," ").concat(i," L ").concat(o," ").concat(i," Q 0 ").concat(i,", 0 ").concat(i-o," L 0 ").concat(o," Q 0 0, ").concat(o," 0"),br(e,!0))}else n=t.rectangle(0,0,e.width,e.height,br(e));mr(e,n);break;case"diamond":{const[r,i,o,a,s,l,c,d]=(e=>{const 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);n="round"===e.strokeSharpness?t.path("M ".concat(r+.25*(o-r)," ").concat(i+.25*(a-i)," L ").concat(o-.25*(o-r)," ").concat(a-.25*(a-i),"\n C ").concat(o," ").concat(a,", ").concat(o," ").concat(a,", ").concat(o-.25*(o-s)," ").concat(a+.25*(l-a),"\n L ").concat(s+.25*(o-s)," ").concat(l-.25*(l-a),"\n C ").concat(s," ").concat(l,", ").concat(s," ").concat(l,", ").concat(s-.25*(s-c)," ").concat(l-.25*(l-d),"\n L ").concat(c+.25*(s-c)," ").concat(d+.25*(l-d),"\n C ").concat(c," ").concat(d,", ").concat(c," ").concat(d,", ").concat(c+.25*(r-c)," ").concat(d-.25*(d-i),"\n L ").concat(r-.25*(r-c)," ").concat(i+.25*(d-i),"\n C ").concat(r," ").concat(i,", ").concat(r," ").concat(i,", ").concat(r+.25*(o-r)," ").concat(i+.25*(a-i)),br(e,!0)):t.polygon([[r,i],[o,a],[s,l],[c,d]],br(e)),mr(e,n);break}case"ellipse":n=t.ellipse(e.width/2,e.height/2,e.width,e.height,br(e)),mr(e,n);break;case"line":case"arrow":{const r=br(e),i=e.points.length?e.points:[[0,0]];if(n="sharp"===e.strokeSharpness?r.fill?[t.polygon(i,r)]:[t.linearPath(i,r)]:[t.curve(i,r)],"arrow"===e.type){const{startArrowhead:i=null,endArrowhead:o="arrow"}=e,a=(e,n,i,o)=>{const a=((e,t,n,r)=>{const i=Xe(t[0]);if(i.length<1)return null;const o="start"===n?1:i.length-1,a=i[o].data,s=[a[4],a[5]],l=[a[2],a[3]],c=[a[0],a[1]],d=i[o-1];let u=[0,0];"move"===d.op?u=d.data:"bcurveTo"===d.op&&(u=[d.data[4],d.data[5]]);const h=(e,t)=>Math.pow(1-e,3)*s[t]+3*e*Math.pow(1-e,2)*l[t]+3*Math.pow(e,2)*(1-e)*c[t]+u[t]*Math.pow(e,3),[p,g]="start"===n?u:s,[m,f]=[h(.3,0),h(.3,1)],b=Math.hypot(p-m,g-f),v=(p-m)/b,x=(g-f)/b,y={arrow:30,bar:15,dot:15,triangle:15}[r];let w=0;if("arrow"===r){const[t,n]=e.points[e.points.length-1],[r,i]=e.points.length>1?e.points[e.points.length-2]:[0,0];w=Math.hypot(t-r,n-i)}else for(let t=0;t<e.points.length;t++){const[n,r]=e.points[t-1]||[0,0],[i,o]=e.points[t];w+=Math.hypot(i-n,o-r)}const k=Math.min(y,w/2),_=p-v*k,C=g-x*k;if("dot"===r)return[p,g,Math.hypot(C-g,_-p)+e.strokeWidth];const E={arrow:20,bar:90,triangle:25}[r],[S,j]=De(_,C,p,g,-E*Math.PI/180),[I,T]=De(_,C,p,g,E*Math.PI/180);return[p,g,S,j,I,T]})(e,n,i,o);if(null===a)return[];if("dot"===o){const[n,i,o]=a;return[t.circle(n,i,o,Object.assign(Object.assign({},r),{fill:e.strokeColor,fillStyle:"solid",stroke:"none"}))]}if("triangle"===o){const[n,i,o,s,l,c]=a;return delete r.strokeLineDash,[t.polygon([[n,i],[o,s],[l,c],[n,i]],Object.assign(Object.assign({},r),{fill:e.strokeColor,fillStyle:"solid"}))]}const[s,l,c,d,u,h]=a;if("dotted"===e.strokeStyle){const t=sr(e.strokeWidth-1);r.strokeLineDash=[t[0],t[1]-1]}else delete r.strokeLineDash;return[t.line(c,d,s,l,r),t.line(u,h,s,l,r)]};if(null!==i){const t=a(e,n,"start",i);n.push(...t)}if(null!==o){const t=a(e,n,"end",o);n.push(...t)}}mr(e,n);break}case"freedraw":Er(e),n=Ne(e.points)?t.polygon(e.points,Object.assign(Object.assign({},br(e)),{stroke:"none"})):null,mr(e,n);break;case"text":case"image":mr(e,null)}},xr=(e,t)=>{const n=t?t.zoom:rr.zoom,r=hr.get(e),i=r&&r.canvasZoom!==n.value&&!(null!=t&&t.shouldCacheIgnoreZoom);if(!r||i||r.theme!==t.theme){const r=((e,t,n)=>{const r=document.createElement("canvas"),i=r.getContext("2d"),o=lr(e);let a=0,s=0;if(je(e)||Ee(e)){const[n,l,c,d]=Ye(e);r.width=Kt(n,c)*window.devicePixelRatio*t.value+o*t.value*2,r.height=Kt(l,d)*window.devicePixelRatio*t.value+o*t.value*2,a=e.x>n?Kt(e.x,n)*window.devicePixelRatio*t.value:0,s=e.y>l?Kt(e.y,l)*window.devicePixelRatio*t.value:0,i.translate(a,s)}else r.width=e.width*window.devicePixelRatio*t.value+o*t.value*2,r.height=e.height*window.devicePixelRatio*t.value+o*t.value*2;i.save(),i.translate(o*t.value,o*t.value),i.scale(window.devicePixelRatio*t.value,window.devicePixelRatio*t.value);const l=ve.canvas(r);return or(e,n)&&(i.filter=nr),ur(e,l,i,n),i.restore(),{element:e,canvas:r,theme:n.theme,canvasZoom:t.value,canvasOffsetX:a,canvasOffsetY:s}})(e,n,t);return hr.set(e,r),r}return r},yr=(e,t,n,r)=>{const i=e.element,o=lr(i);let[a,s,l,c]=Ye(i);Ee(i)&&(a=Math.floor(a),l=Math.ceil(l),s=Math.floor(s),c=Math.ceil(c));const d=((a+l)/2+r.scrollX)*window.devicePixelRatio,u=((s+c)/2+r.scrollY)*window.devicePixelRatio,h=ir(i,r),p="scale"in e.element&&!h?e.element.scale[0]:1,g="scale"in e.element&&!h?e.element.scale[1]:1;n.save(),n.scale(1/window.devicePixelRatio*p,1/window.devicePixelRatio*g),n.translate(d*p,u*g),n.rotate(i.angle*p*g),n.drawImage(e.canvas,-(l-a)/2*window.devicePixelRatio-o*e.canvasZoom/e.canvasZoom,-(c-s)/2*window.devicePixelRatio-o*e.canvasZoom/e.canvasZoom,e.canvas.width/e.canvasZoom,e.canvas.height/e.canvasZoom),n.restore()},wr=(e,t,n,r)=>{const i=t.generator;switch(e.type){case"selection":n.save(),n.translate(e.x+r.scrollX,e.y+r.scrollY),n.fillStyle="rgba(0, 0, 255, 0.10)",n.fillRect(0,0,e.width,e.height),n.restore();break;case"freedraw":if(vr(e,i),r.isExporting){const t=xr(e,r);yr(t,0,n,r)}else{const[i,o,a,s]=Ye(e),l=(i+a)/2+r.scrollX,c=(o+s)/2+r.scrollY,d=(a-i)/2-(e.x-i),u=(s-o)/2-(e.y-o);n.save(),n.translate(l,c),n.rotate(e.angle),n.translate(-d,-u),ur(e,t,n,r),n.restore()}break;case"rectangle":case"diamond":case"ellipse":case"line":case"arrow":case"image":case"text":if(vr(e,i),r.isExporting){const[i,o,a,s]=Ye(e),l=(i+a)/2+r.scrollX,c=(o+s)/2+r.scrollY,d=(a-i)/2-(e.x-i),u=(s-o)/2-(e.y-o);n.save(),n.translate(l,c),n.rotate(e.angle),n.translate(-d,-u),or(e,r)&&(n.filter="none"),ur(e,t,n,r),n.restore()}else{const t=xr(e,r);yr(t,0,n,r)}break;default:throw new Error("Unimplemented type ".concat(e.type))}},kr=(e,t,n)=>{if(void 0===n)return e.draw(t);const r={sets:t.sets,shape:t.shape,options:Object.assign(Object.assign({},t.options),{fixedDecimalPlaceDigits:n})};return e.draw(r)},_r=(e,t,n,r,i,a,s)=>{const[l,c,d,u]=Ye(e),h=(d-l)/2-(e.x-l),p=(u-c)/2-(e.y-c),g=180*e.angle/Math.PI,m=t.generator;let f=n;if(e.link){const t=n.ownerDocument.createElementNS(o.hR,"a");t.setAttribute("href",e.link),f.appendChild(t),f=t}switch(e.type){case"selection":throw new Error("Selection rendering is not supported for SVG");case"rectangle":case"diamond":case"ellipse":{vr(e,m);const n=kr(t,gr(e),o.zK),r=e.opacity/100;1!==r&&(n.setAttribute("stroke-opacity","".concat(r)),n.setAttribute("fill-opacity","".concat(r))),n.setAttribute("stroke-linecap","round"),n.setAttribute("transform","translate(".concat(i||0," ").concat(a||0,") rotate(").concat(g," ").concat(h," ").concat(p,")")),f.appendChild(n);break}case"line":case"arrow":{vr(e,m);const r=n.ownerDocument.createElementNS(o.hR,"g"),s=e.opacity/100;r.setAttribute("stroke-linecap","round"),gr(e).forEach((n=>{const l=kr(t,n,o.zK);1!==s&&(l.setAttribute("stroke-opacity","".concat(s)),l.setAttribute("fill-opacity","".concat(s))),l.setAttribute("transform","translate(".concat(i||0," ").concat(a||0,") rotate(").concat(g," ").concat(h," ").concat(p,")")),"line"===e.type&&Ne(e.points)&&"transparent"!==e.backgroundColor&&l.setAttribute("fill-rule","evenodd"),r.appendChild(l)})),f.appendChild(r);break}case"freedraw":{vr(e,m),Er(e);const r=e.opacity/100,s=gr(e),l=s?kr(t,s,o.zK):n.ownerDocument.createElementNS(o.hR,"g");1!==r&&(l.setAttribute("stroke-opacity","".concat(r)),l.setAttribute("fill-opacity","".concat(r))),l.setAttribute("transform","translate(".concat(i||0," ").concat(a||0,") rotate(").concat(g," ").concat(h," ").concat(p,")")),l.setAttribute("stroke","none");const c=n.ownerDocument.createElementNS(o.hR,"path");c.setAttribute("fill",e.strokeColor),c.setAttribute("d",Sr(e)),l.appendChild(c),f.appendChild(l);break}case"image":{const t=ke(e)&&r[e.fileId];if(t){const r="image-".concat(t.id);let l=n.querySelector("#".concat(r));if(!l){l=n.ownerDocument.createElementNS(o.hR,"symbol"),l.id=r;const e=n.ownerDocument.createElementNS(o.hR,"image");e.setAttribute("width","100%"),e.setAttribute("height","100%"),e.setAttribute("href",t.dataURL),l.appendChild(e),f.prepend(l)}const c=n.ownerDocument.createElementNS(o.hR,"use");c.setAttribute("href","#".concat(r)),s&&t.mimeType!==o.LO.svg&&c.setAttribute("filter",nr),c.setAttribute("width","".concat(Math.round(e.width))),c.setAttribute("height","".concat(Math.round(e.height))),c.setAttribute("transform","translate(".concat(i||0," ").concat(a||0,") rotate(").concat(g," ").concat(h," ").concat(p,")")),f.appendChild(c)}break}default:if(!Ce(e))throw new Error("Unimplemented type ".concat(e.type));{const t=e.opacity/100,r=n.ownerDocument.createElementNS(o.hR,"g");1!==t&&(r.setAttribute("stroke-opacity","".concat(t)),r.setAttribute("fill-opacity","".concat(t))),r.setAttribute("transform","translate(".concat(i||0," ").concat(a||0,") rotate(").concat(g," ").concat(h," ").concat(p,")"));const s=e.text.replace(/\r\n?/g,"\n").split("\n"),l=e.height/s.length,c=e.height-e.baseline,d="center"===e.textAlign?e.width/2:"right"===e.textAlign?e.width:0,u=en(e.text)?"rtl":"ltr",m="center"===e.textAlign?"middle":"right"===e.textAlign||"rtl"===u?"end":"start";for(let t=0;t<s.length;t++){const i=n.ownerDocument.createElementNS(o.hR,"text");i.textContent=s[t],i.setAttribute("x","".concat(d)),i.setAttribute("y","".concat((t+1)*l-c)),i.setAttribute("font-family",Ft(e)),i.setAttribute("font-size","".concat(e.fontSize,"px")),i.setAttribute("fill",e.strokeColor),i.setAttribute("text-anchor",m),i.setAttribute("style","white-space: pre;"),i.setAttribute("direction",u),r.appendChild(i)}f.appendChild(r)}}};let Cr=new WeakMap([]);function Er(e){const t=Sr(e),n=new Path2D(t);return Cr.set(e,n),n}function Sr(e){const t=e.simulatePressure?e.points:e.points.length?e.points.map(((t,n)=>{let[r,i]=t;return[r,i,e.pressures[n]]})):[[0,0,.5]],n={simulatePressure:e.simulatePressure,size:4.25*e.strokeWidth,thinning:.6,smoothing:.5,streamline:.5,easing:e=>Math.sin(e*Math.PI/2),last:!!e.lastCommittedPoint};return function(e){if(!e.length)return"";const t=e.length-1;return e.reduce(((e,n,r,i)=>(r===t?e.push(n,jr(n,i[0]),"L",i[0],"Z"):e.push(n,jr(n,i[r+1])),e)),["M",e[0],"Q"]).join(" ").replace(Ir,"$1")}(Dn(t,n))}function jr(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}const Ir=/(\s?[A-Z]?,?-?[0-9]*\.[0-9]{0,2})(([0-9]|e|-)*)/g;let Tr=new O(Date.now()),Mr=0;const Or=()=>Math.floor(Tr.next()*2**31),Lr=()=>cn()?"id".concat(Mr++):we(),Ar=function(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=!1;const{points:i,fileId:o}=t;void 0!==i&&(t=Object.assign(Object.assign({},Ve(i)),t));for(const n in t){const i=t[n];if(void 0!==i){if(e[n]===i&&("object"!=typeof i||null===i||"groupIds"===n||"scale"===n))continue;if("scale"===n){const t=e[n],r=i;if(t[0]===r[0]&&t[1]===r[1])continue}else if("points"===n){const t=e[n],r=i;if(t.length===r.length){let e=!1,n=t.length;for(;--n;){const i=t[n],o=r[n];if(i[0]!==o[0]||i[1]!==o[1]){e=!0;break}}if(!e)continue}}e[n]=i,r=!0}}if(!r)return e;var a;(void 0===t.height&&void 0===t.width&&void 0===o&&void 0===i||fr(e),e.version++,e.versionNonce=Or(),e.updated=sn(),n)&&(null===(a=Hn.getScene(e))||void 0===a||a.informMutation());return e},Pr=(e,t)=>{let n=!1;for(const r in t){const i=t[r];if(void 0!==i){if(e[r]===i&&("object"!=typeof i||null===i))continue;n=!0}}return n?Object.assign(Object.assign(Object.assign({},e),t),{updated:sn(),version:e.version+1,versionNonce:Or()}):e},Dr=(e,t)=>(e.version=(null!=t?t:e.version)+1,e.versionNonce=Or(),e.updated=sn(),e),zr=e=>je(e)||Ee(e)?e.points.length<2:0===e.width&&0===e.height,Rr=(e,t,n)=>{const r=Math.abs(t),i=Math.abs(n);if("line"===e||"arrow"===e||"freedraw"===e){const e=Math.round(Math.atan(i/r)/o.ay)*o.ay;0===e?n=0:e===Math.PI/2?t=0:n=Math.round(r*Math.tan(e))*Math.sign(n)||n}else"selection"!==e&&(n=r*Math.sign(n));return{width:t,height:n}},Hr=e=>{const t={width:e.width,height:e.height,x:e.x,y:e.y};if(e.width<0){const n=Math.abs(e.width);t.width=n,t.x=e.x-n}if(e.height<0){const n=Math.abs(e.height);t.height=n,t.y=e.y-n}return t},Nr=(e,t,n)=>{const r=n.filter((t=>t.groupIds.includes(e)));return r.length<2?t.selectedGroupIds[e]||t.editingGroupId===e?Object.assign(Object.assign({},t),{selectedGroupIds:Object.assign(Object.assign({},t.selectedGroupIds),{[e]:!1}),editingGroupId:null}):t:Object.assign(Object.assign({},t),{selectedGroupIds:Object.assign(Object.assign({},t.selectedGroupIds),{[e]:!0}),selectedElementIds:Object.assign(Object.assign({},t.selectedElementIds),Object.fromEntries(r.map((e=>[e.id,!0]))))})},Br=(e,t)=>null!=Fr(e,t),Fr=(e,t)=>t.groupIds.filter((t=>t!==e.editingGroupId)).find((t=>e.selectedGroupIds[t])),Ur=e=>Object.entries(e.selectedGroupIds).filter((e=>{let[t,n]=e;return n})).map((e=>{let[t,n]=e;return t})),Wr=(e,t)=>{let n=Object.assign(Object.assign({},e),{selectedGroupIds:{}});const r=Al(t,e);if(!r.length)return Object.assign(Object.assign({},n),{editingGroupId:null});for(const i of r){let r=i.groupIds;if(e.editingGroupId){const t=r.indexOf(e.editingGroupId);t>-1&&(r=r.slice(0,t))}if(r.length>0){const e=r[r.length-1];n=Nr(e,n,t)}}return n},Kr=(e,t)=>e.groupIds.includes(t),Vr=(e,t)=>e.filter((e=>Kr(e,t))),Gr=(e,t,n)=>{const r=[...e],i=n?r.indexOf(n):-1,o=i>-1?i:r.length;return r.splice(o,0,t),r},Yr=e=>{const t=new Map;return e.forEach((e=>{const n=0===e.groupIds.length?e.id:e.groupIds[e.groupIds.length-1],r=t.get(n)||[],i=er(e);i&&r.push(i),t.set(n,[...r,e])})),Array.from(t.values())};var Xr=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const Zr=(e,t)=>{var n,r;let{x:i,y:o,strokeColor:a,backgroundColor:s,fillStyle:l,strokeWidth:c,strokeStyle:d,roughness:u,opacity:h,width:p=0,height:g=0,angle:m=0,groupIds:f=[],strokeSharpness:b,boundElements:v=null,link:x=null}=t,y=Xr(t,["x","y","strokeColor","backgroundColor","fillStyle","strokeWidth","strokeStyle","roughness","opacity","width","height","angle","groupIds","strokeSharpness","boundElements","link"]);return{id:y.id||Lr(),type:e,x:i,y:o,width:p,height:g,angle:m,strokeColor:a,backgroundColor:s,fillStyle:l,strokeWidth:c,strokeStyle:d,roughness:u,opacity:h,groupIds:f,strokeSharpness:b,seed:null!==(n=y.seed)&&void 0!==n?n:Or(),version:y.version||1,versionNonce:null!==(r=y.versionNonce)&&void 0!==r?r:0,isDeleted:!1,boundElements:v,updated:sn(),link:x}},qr=e=>Zr(e.type,e),$r=(e,t)=>({x:"center"===e.textAlign?t.width/2:"right"===e.textAlign?t.width:0,y:"middle"===e.verticalAlign?t.height/2:0}),Qr=e=>{const t=Un(e.text,Ut(e)),n=$r(e,t);return Pr(Object.assign(Object.assign({},Zr("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,containerId:e.containerId||null,originalText:e.text}),{})},Jr=(e,t)=>{let{text:n,isDeleted:r,originalText:i}=t;const a=tr(e);a&&(n=Xn(n,Ut(e),a.width));const s=((e,t)=>{let n=null;const r=tr(e);r&&(n=r.width-2*o.gK);const{width:i,height:a,baseline:s}=Un(t,Ut(e),n),{textAlign:l,verticalAlign:c}=e;let d,u;if("center"!==l||c!==o.oX.MIDDLE||e.containerId){const[t,n,r,o]=Ye(e),[s,c,h,p]=tt(e,i,a),g=(t-s)/2,m=(n-c)/2,f=(r-h)/2,b=(o-p)/2;[d,u]=Re({s:!0,e:"center"===l||"left"===l,w:"center"===l||"right"===l},e.x,e.y,e.angle,g,m,f,b)}else{const t=Un(e.text,Ut(e),n),r=$r(e,{width:i-t.width,height:a-t.height});d=e.x-r.x,u=e.y-r.y}if(r){let e=r.height,t=r.width;a>e-2*o.gK&&(e=a+2*o.gK),i>t-2*o.gK&&(t=i+2*o.gK),e===r.height&&t===r.width||Ar(r,{height:e,width:t})}return{width:i,height:a,x:Number.isFinite(d)?d:e.x,y:Number.isFinite(u)?u:e.y,baseline:s}})(e,n);return Pr(e,Object.assign({text:n,originalText:i,isDeleted:null!=r?r:e.isDeleted},s))},ei=e=>Object.assign(Object.assign({},Zr(e.type,e)),{points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:e.startArrowhead,endArrowhead:e.endArrowhead}),ti=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(null==e||"object"!=typeof e)return e;if("[object Object]"===Object.prototype.toString.call(e)){const n="function"==typeof e.constructor?Object.create(Object.getPrototypeOf(e)):{};for(const r in e)if(e.hasOwnProperty(r)){if(0===t&&("shape"===r||"canvas"===r))continue;n[r]=ti(e[r],t+1)}return n}if(Array.isArray(e)){let n=e.length;const r=new Array(n);for(;n--;)r[n]=ti(e[n],t+1);return r}return e},ni=(e,t,n,r)=>{let i=ti(n);var o,a;cn()?(i.id="".concat(i.id,"_copy"),null!==(o=window.h)&&void 0!==o&&null!==(a=o.app)&&void 0!==a&&a.getSceneElementsIncludingDeleted().find((e=>e.id===i.id))&&(i.id+="_copy")):i.id=Lr();return i.updated=sn(),i.seed=Or(),i.groupIds=((e,t,n)=>{const r=[...e],i=t?e.indexOf(t):-1,o=i>-1?i:e.length;for(let e=0;e<o;e++)r[e]=n(r[e]);return r})(i.groupIds,e,(e=>(t.has(e)||t.set(e,Lr()),t.get(e)))),r&&(i=Object.assign(i,r)),i},ri={mouse:8,pen:16,touch:28},ii={e:!0,s:!0,n:!0,w:!0},oi={e:!0,s:!0,n:!0,w:!0},ai={e:!0,s:!0,n:!0,w:!0,nw:!0,se:!0},si={e:!0,s:!0,n:!0,w:!0,ne:!0,sw:!0},li=(e,t,n,r,i,o,a)=>{const[s,l]=De(e+n/2,t+r/2,i,o,a);return[s-n/2,l-r/2,n,r]},ci=function(e,t,n,r){let[i,o,a,s]=e,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const c=ri[r],d=c/n.value,u=c/n.value,h=c/n.value,p=c/n.value,g=a-i,m=s-o,f=(i+a)/2,b=(o+s)/2,v=4/n.value,x=(c-8)/(2*n.value),y={nw:l.nw?void 0:li(i-v-h+x,o-v-p+x,d,u,f,b,t),ne:l.ne?void 0:li(a+v-x,o-v-p+x,d,u,f,b,t),sw:l.sw?void 0:li(i-v-h+x,s+v-x,d,u,f,b,t),se:l.se?void 0:li(a+v-x,s+v-x,d,u,f,b,t),rotation:l.rotation?void 0:li(i+g/2-d/2,o-v-p+x-16/n.value,d,u,f,b,t)},w=5*ri.mouse/n.value;return Math.abs(g)>w&&(l.n||(y.n=li(i+g/2-d/2,o-v-p+x,d,u,f,b,t)),l.s||(y.s=li(i+g/2-d/2,s+v-x,d,u,f,b,t))),Math.abs(m)>w&&(l.w||(y.w=li(i-v-h+x,o+m/2-u/2,d,u,f,b,t)),l.e||(y.e=li(a+v-x,o+m/2-u/2,d,u,f,b,t))),y},di=function(e,t){let 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){const[,t]=e.points;0===t[0]||0===t[1]?r=si:t[0]>0&&t[1]<0?r=ai:t[0]>0&&t[1]>0?r=si:t[0]<0&&t[1]>0?r=ai:t[0]<0&&t[1]<0&&(r=si)}}else Ce(e)&&(r=oi);return ci(Ye(e),e.angle,t,n,r)},ui=(e,t)=>[0,0,0,0,t,e,1,0],hi=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=[0,0,0,0,0,0,0,0];if(t<0||t>7)throw new Error("Expected `index` between 0 and 7, got `".concat(t,"`"));return 0!==e&&(n[t]=e),n},pi=e=>[e[0],e[1],e[2],e[3],-e[4],-e[5],-e[6],-e[7]],gi=(e,t)=>ki(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]],mi=(e,t)=>ki(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]:[fi(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]],fi=(e,t)=>t[0]*e[0]+t[2]*e[2]+t[3]*e[3]-t[6]*e[6],bi=(e,t)=>[vi(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]],vi=(e,t)=>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],xi=e=>Math.sqrt(Math.abs(e[0]*e[0]-e[2]*e[2]-e[3]*e[3]+e[6]*e[6])),yi=e=>{const t=xi(e);if(0===t||1===t)return e;const n=e[6]<0?-1:1;return mi(e,n/t)},wi=e=>{const t=(e=>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:mi(e,1/t)},ki=e=>"number"==typeof e,_i=(hi(1,1),hi(1,2),hi(1,3),hi(1,4),hi(1,5),hi(1,6),hi(1,7),(e,t,n)=>yi([0,n,e,t,0,0,0,0])),Ci=(e,t)=>yi(bi(t,e)),Ei=(e,t)=>((e,t)=>[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),Si=e=>{let[t,n]=e;return[0,0,0,0,n,t,1,0]},ji=e=>[e[5],e[4]],Ii=(e,t)=>yi(((e,t)=>[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)),Ti=(e,t)=>xi(bi(e,t)),Mi=(e,t)=>vi(e,t),Oi=e=>[0,0,0,0,e[4],e[5],0,0],Li=(e,t)=>((e,t)=>ki(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]])(mi(e,Math.sin(t/2)),Math.cos(t/2)),Ai=(e,t)=>yi(mi(mi(e,t),pi(e))),Pi=(e,t,n,r)=>{const i=10/t.zoom.value;return!Di(e,t,[n,r])&&Ri(e,[n,r],i)},Di=(e,t,n)=>{const r=10/t.zoom.value,i=Ce(e)?Ui:(e=>{if("arrow"===e.type)return!1;if("freedraw"===e.type)return!0;const t=!rn(e.backgroundColor)||Ae(e);return"line"===e.type?t&&Ne(e.points):t||_e(e)})(e)?Wi:Ki;return Bi({element:e,point:n,threshold:r,check:i})},zi=(e,t)=>e.selectedElementIds[t.id],Ri=(e,t,n)=>{let[r,i]=t;const[o,a,s,l]=Ye(e),c=(o+s)/2,d=(a+l)/2,[u,h]=De(r,i,c,d,-e.angle);return u>o-n&&u<s+n&&h>a-n&&h<l+n},Hi=(e,t)=>{let{x:n,y:r}=t;const i=Ni(e,e.width,e.height);return Bi({element:e,point:[n,r],threshold:i,check:Vi})},Ni=(e,t,n)=>{const r=("diamond"===e.type?1/Math.sqrt(2):1)*Math.min(t,n);return Math.max(16,Math.min(.25*r,32))},Bi=e=>{switch(e.element.type){case"rectangle":case"image":case"text":case"diamond":case"ellipse":const t=Fi(e.element,e.point);return e.check(t,e.threshold);case"freedraw":return!!e.check(Gi(e.element,e.point),e.threshold)&&qi(e.element,e.point,e.threshold);case"arrow":case"line":return $i(e);case"selection":return console.warn("This should not happen, we need to investigate why it does."),!1}},Fi=(e,t)=>{switch(e.type){case"rectangle":case"image":case"text":return Gi(e,t);case"diamond":return Yi(e,t);case"ellipse":return Xi(e,t)}},Ui=(e,t)=>e<0,Wi=(e,t)=>e<t,Ki=(e,t)=>Math.abs(e)<t,Vi=(e,t)=>0<=e&&e<t,Gi=(e,t)=>{const[,n,r,i]=Qi(e,t);return Math.max(Mi(n,_i(0,1,-i)),Mi(n,_i(1,0,-r)))},Yi=(e,t)=>{const[,n,r,i]=Qi(e,t),o=_i(i,r,-i*r);return Mi(n,o)},Xi=(e,t)=>{const[n,r]=Zi(e,t);return-(e=>Math.sign(e[1]))(r)*Mi(n,r)},Zi=(e,t)=>{const[,n,r,i]=Qi(e,t),[o,a]=ji(n);let s=.707,l=.707;const c=r,d=i;[0,1,2,3].forEach((e=>{const t=(c*c-d*d)*s**3/c,n=(d*d-c*c)*l**3/d,r=c*s-t,i=d*l-n,u=o-t,h=a-n,p=Math.hypot(i,r),g=Math.hypot(h,u);s=Math.min(1,Math.max(0,(u*p/g+t)/c)),l=Math.min(1,Math.max(0,(h*p/g+n)/d));const m=Math.hypot(l,s);s/=m,l/=m}));const u=ui(c*s,d*l);var h;return[n,Ei(Ci(n,h=u),h)]},qi=(e,t,n)=>{let r,i;if(0===e.angle)r=t[0]-e.x,i=t[1]-e.y;else{const[n,o,a,s]=Ye(e),l=ze(t,[n+(a-n)/2,o+(s-o)/2],-e.angle);r=l[0]-e.x,i=l[1]-e.y}let o,[a,s]=e.points;if(He(a[0],a[1],r,i)<n||He(s[0],s[1],r,i)<n)return!0;for(let t=0;t<e.points.length;t++){const l=[s[0]-a[0],s[1]-a[1]],c=Math.hypot(l[1],l[0]),d=[l[0]/c,l[1]/c],u=[r-a[0],i-a[1]],h=(u[0]*d[0]+u[1]*d[1])/Math.hypot(d[1],d[0]);o=[a[0]+d[0]*h,a[1]+d[1]*h];const p=He(o[0],o[1],a[0],a[1]),g=He(o[0],o[1],s[0],s[1]);if(o=g<p&&p>c?s:p<g&&g>c?a:o,Math.hypot(i-o[1],r-o[0])<n)return!0;a=s,s=e.points[t+1]}const l=gr(e);return!(!l||!l.sets.length)&&ho(l,r,i,n)},$i=e=>{const{element:t,threshold:n}=e;if(!gr(t))return!1;const[r,i,o,a]=Qi(e.element,e.point),s=_i(0,1,-a),l=_i(1,0,-o);if(!Wi(Mi(i,s),n)||!Wi(Mi(i,l),n))return!1;const[c,d]=ji(r),u=gr(t);if(!u)return!1;if(e.check===Wi){if(u.some((e=>uo(e,c,d,t.strokeSharpness))))return!0}return u.some((e=>ho(e,c,d,n)))},Qi=(e,t)=>{const n=Si(t),r=Ye(e),i=eo(r),o=Li(i,e.angle),a=Ai(o,n),s=(e=>[0,0,0,0,Math.abs(e[4]),Math.abs(e[5]),1,0])(gi(a,Oi(i))),l=((e,t)=>[0,0,0,0,t,e,0,0])(e.x,e.y),c=gi(a,l),[d,u,h,p]=r;return[c,s,(h-d)/2,(p-u)/2]},Ji=e=>{const t=Ye(e),n=eo(t),r=Li(n,e.angle),i=pi((e=>[1,0,0,0,-.5*e[5],.5*e[4],0,0])(Oi(n)));return mi(i,r)},eo=e=>{let[t,n,r,i]=e;return ui((t+r)/2,(n+i)/2)},to=(e,t,n)=>{const r=Ji(e),i=Ai(r,Si(t)),o=Ai(r,Si(n)),a=Ci(i,o),s=e.height/e.width,l=e.width/2,c=e.height/2,d=a[2],u=a[3],h=a[1],p=Math.abs(u),g=Math.abs(d);switch(e.type){case"rectangle":case"image":case"text":return h/(l*(g+s*p));case"diamond":return p<g?h/(g*l):h/(p*c);case"ellipse":return h/(l*Math.sqrt(d**2+s**2*u**2))}},no=function(e,t,n){let r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;switch(e.type){case"rectangle":case"image":case"text":case"diamond":const n=ro(e);r=n.flatMap(((e,r)=>{const o=[e,n[(r+1)%4]];return io(t,oo(o,i))})).concat(n.flatMap((e=>so(e,i,t))));break;case"ellipse":r=ao(e,i,t)}if(r.length<2)return[];const o=r.sort(((e,t)=>Ti(e,n)-Ti(t,n)));return[o[0],o[o.length-1]]},ro=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const n=t*e.width/2,r=t*e.height/2;switch(e.type){case"rectangle":case"image":case"text":return[ui(n,r),ui(n,-r),ui(-n,-r),ui(-n,r)];case"diamond":return[ui(0,r),ui(n,0),ui(0,-r),ui(-n,0)]}},io=(e,t)=>{const[n,r]=t;return Mi(n,e)*Mi(r,e)>=0?[]:[Ii(e,Ci(n,r))]},oo=(e,t)=>{const[n,r]=e,i=((e,t)=>{const n=.5*t;return[1,0,0,0,n*e[4],n*e[5],0,0]})(((e,t)=>wi([0,0,0,0,t[4]-e[4],t[5]-e[5],0,0]))(n,r),t);return[Ai(i,n),Ai(i,r)]},ao=(e,t,n)=>{const r=e.width/2+t,i=e.height/2+t,o=n[2],a=n[3],s=n[1],l=r*r*o*o+i*i*a*a,c=l-s*s;if(0===l||c<=0)return[];const d=Math.sqrt(c),u=-r*r*o*s,h=-i*i*a*s;return[ui((u+r*i*a*d)/l,(h-r*i*o*d)/l),ui((u-r*i*a*d)/l,(h+r*i*o*d)/l)]},so=(e,t,n)=>{if(0===t)return 0===Mi(n,e)?[e]:[];const r=n[2],i=n[3],o=n[1],[a,s]=ji(e),l=r*r+i*i,c=t*t*l-(r*a+i*s+o)**2;if(0===l||c<=0)return[];const d=Math.sqrt(c),u=a*i*i-s*r*i-r*o,h=s*r*r-a*r*i-i*o;return[ui((u+i*d)/l,(h-r*d)/l),ui((u-i*d)/l,(h+r*d)/l)]},lo=(e,t,n)=>{const r=Math.abs(t),i=e.width*r/2,o=e.height*r/2,a=Math.sign(t),[s,l]=ji(n),c=0===l?1e-4:l,d=s**2*o**2+c**2*i**2,u=(-s*o**2+a*c*Math.sqrt(Math.max(0,d-i**2*o**2)))/d,h=(-u*s-1)/c,p=-(i**2)*u/(h**2*o**2+u**2*i**2);return ui(p,(-u*p-1)/h)},co=(e,t,n)=>{const r=Math.abs(t),i=Math.sign(t),o=ro(e,r);let a=0,s=null;return o.forEach((e=>{const t=i*Ci(n,e)[1];t>a&&(a=t,s=e)})),s},uo=(e,t,n,r)=>{const i=Xe(e),o=[];let a=!1;for(const e of i)"move"===e.op?(a=!a,a&&o.push([e.data[0],e.data[1]])):"bcurveTo"===e.op?a&&(o.push([e.data[0],e.data[1]]),o.push([e.data[2],e.data[3]]),o.push([e.data[4],e.data[5]])):"lineTo"===e.op&&a&&o.push([e.data[0],e.data[1]]);if(o.length>=4){if("sharp"===r)return Be(o,t,n);const e=he(o,10,5);return Be(e,t,n)}return!1},ho=(e,t,n,r)=>{const i=Xe(e);let o=[0,0];return i.some(((i,a)=>{let{op:s,data:l}=i;if("move"===s)o=l;else{if("bcurveTo"===s){const e=[l[0],l[1]],i=[l[2],l[3]],a=[l[4],l[5]],s=o;o=a;const c=((e,t,n,r,i,o)=>{let[a,s]=i;const l=(i,o)=>Math.pow(1-i,3)*r[o]+3*i*Math.pow(1-i,2)*n[o]+3*Math.pow(i,2)*(1-i)*t[o]+e[o]*Math.pow(i,3);let c=0;for(;c<=1;){const e=l(c,0),t=l(c,1);if(Math.sqrt(Math.pow(e-a,2)+Math.pow(t-s,2))<o)return!0;c+=.01}return!1})(s,e,i,a,[t,n],r);return c}if("lineTo"===s)return uo(e,t,n,"sharp");"qcurveTo"===s&&console.warn("qcurveTo is not implemented yet")}return!1}))};var po=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const go=(e,t,n)=>t>=e[0]&&t<=e[0]+e[2]&&n>=e[1]&&n<=e[1]+e[3],mo=(e,t,n,r,i,o)=>e.reduce(((e,a)=>{if(e)return e;const s=((e,t,n,r,i,o)=>{if(!t.selectedElementIds[e.id])return!1;const a=di(e,i,o),{rotation:s}=a,l=po(a,["rotation"]);if(s&&go(s,n,r))return"rotation";const c=Object.keys(l).filter((e=>{const t=l[e];return!!t&&go(t,n,r)}));return c.length>0&&c[0]})(a,t,n,r,i,o);return s?{element:a,transformHandleType:s}:null}),null),fo=(e,t,n,r,i)=>{let[o,a,s,l]=e;const c=ci([o,a,s,l],0,r,i,ii);return Object.keys(c).find((e=>{const r=c[e];return r&&go(r,t,n)}))||!1},bo=["ns","nesw","ew","nwse"],vo=e=>{const{element:t,transformHandleType:n}=e,r=t&&Math.sign(t.height)*Math.sign(t.width)==-1;let i=null;switch(n){case"n":case"s":i="ns";break;case"w":case"e":i="ew";break;case"nw":case"se":i=r?"nesw":"nwse";break;case"ne":case"sw":i=r?"nwse":"nesw";break;case"rotation":return"grab"}return i&&t&&(i=((e,t)=>{const n=bo.indexOf(e);if(n>=0){const r=Math.round(t/(Math.PI/4));e=bo[(n+r)%bo.length]}return e})(i,t.angle)),i?"".concat(i,"-resize"):""};class xo{constructor(e,t){this.elementId=e.id,Hn.mapElementToScene(this.elementId,t),xo.normalizePoints(e),this.selectedPointsIndices=null,this.lastUncommittedPoint=null,this.isDragging=!1,this.pointerOffset={x:0,y:0},this.startBindingElement="keep",this.endBindingElement="keep",this.pointerDownState={prevSelectedPointsIndices:null,lastClickedPoint:-1}}static getElement(e){var t;const n=null===(t=Hn.getScene(e))||void 0===t?void 0:t.getNonDeletedElement(e);return n||null}static handleBoxSelection(e,t,n){var r;if(!t.editingLinearElement||"selection"!==(null===(r=t.draggingElement)||void 0===r?void 0:r.type))return!1;const{editingLinearElement:i}=t,{selectedPointsIndices:o,elementId:a}=i,s=xo.getElement(a);if(!s)return!1;const[l,c,d,u]=Ye(t.draggingElement),h=xo.getPointsGlobalCoordinates(s).reduce(((t,n,r)=>((n[0]>=l&&n[0]<=d&&n[1]>=c&&n[1]<=u||e.shiftKey&&null!=o&&o.includes(r))&&t.push(r),t)),[]);n({editingLinearElement:Object.assign(Object.assign({},i),{selectedPointsIndices:h.length?h:null})})}static handlePointDragging(e,t,n,r,i){if(!e.editingLinearElement)return!1;const{editingLinearElement:o}=e,{selectedPointsIndices:a,elementId:s,isDragging:l}=o,c=xo.getElement(s);if(!c)return!1;const d=c.points[o.pointerDownState.lastClickedPoint];if(a&&d){!1===l&&t({editingLinearElement:Object.assign(Object.assign({},o),{isDragging:!0})});const s=xo.createPointAt(c,n-o.pointerOffset.x,r-o.pointerOffset.y,e.gridSize),u=s[0]-d[0],h=s[1]-d[1];if(xo.movePoints(c,a.map((t=>({index:t,point:t===o.pointerDownState.lastClickedPoint?xo.createPointAt(c,n-o.pointerOffset.x,r-o.pointerOffset.y,e.gridSize):[c.points[t][0]+u,c.points[t][1]+h],isDragging:t===o.pointerDownState.lastClickedPoint})))),Te(c)){const e=[];0===a[0]&&e.push(tn(xo.getPointGlobalCoordinates(c,c.points[0])));const t=a[a.length-1];t===c.points.length-1&&e.push(tn(xo.getPointGlobalCoordinates(c,c.points[t]))),e.length&&i(c,e)}return!0}return!1}static handlePointerUp(e,t,n){var r;const{elementId:i,selectedPointsIndices:o,isDragging:a,pointerDownState:s}=t,l=xo.getElement(i);if(!l)return t;const c={};if(a&&o)for(const e of o)if(0===e||e===l.points.length-1){Ne(l.points,n.zoom.value)&&xo.movePoints(l,[{index:e,point:0===e?l.points[l.points.length-1]:l.points[0]}]);const t=wo(n)?Lo(tn(xo.getPointAtIndexGlobalCoordinates(l,e)),Hn.getScene(l)):null;c[0===e?"startBindingElement":"endBindingElement"]=t}return Object.assign(Object.assign(Object.assign({},t),c),{selectedPointsIndices:a||e.shiftKey?!a&&e.shiftKey&&null!==(r=s.prevSelectedPointsIndices)&&void 0!==r&&r.includes(s.lastClickedPoint)?o&&o.filter((e=>e!==s.lastClickedPoint)):o:null!=o&&o.includes(s.lastClickedPoint)?[s.lastClickedPoint]:o,isDragging:!1,pointerOffset:{x:0,y:0}})}static handlePointerDown(e,t,n,r,i){var o;const a={didAddPoint:!1,hitElement:null};if(!t.editingLinearElement)return a;const{elementId:s}=t.editingLinearElement,l=xo.getElement(s);if(!l)return a;if(e.altKey)return null==t.editingLinearElement.lastUncommittedPoint&&Ar(l,{points:[...l.points,xo.createPointAt(l,i.x,i.y,t.gridSize)]}),r.resumeRecording(),n({editingLinearElement:Object.assign(Object.assign({},t.editingLinearElement),{pointerDownState:{prevSelectedPointsIndices:t.editingLinearElement.selectedPointsIndices,lastClickedPoint:-1},selectedPointsIndices:[l.points.length-1],lastUncommittedPoint:null,endBindingElement:Lo(i,Hn.getScene(l))})}),a.didAddPoint=!0,a;const c=xo.getPointIndexUnderCursor(l,t.zoom,i.x,i.y);if(c>-1)a.hitElement=l;else{const{startBindingElement:e,endBindingElement:n}=t.editingLinearElement;wo(t)&&Te(l)&&ko(l,e,n)}const[d,u,h,p]=Ye(l),g=(d+h)/2,m=(u+p)/2,f=c>-1&&De(l.x+l.points[c][0],l.y+l.points[c][1],g,m,l.angle),b=c>-1||e.shiftKey?e.shiftKey||null!==(o=t.editingLinearElement.selectedPointsIndices)&&void 0!==o&&o.includes(c)?yo([...t.editingLinearElement.selectedPointsIndices||[],c]):[c]:null;return n({editingLinearElement:Object.assign(Object.assign({},t.editingLinearElement),{pointerDownState:{prevSelectedPointsIndices:t.editingLinearElement.selectedPointsIndices,lastClickedPoint:c},selectedPointsIndices:b,pointerOffset:f?{x:i.x-f[0],y:i.y-f[1]}:{x:0,y:0}})}),a}static handlePointerMove(e,t,n,r,i){const{elementId:o,lastUncommittedPoint:a}=r,s=xo.getElement(o);if(!s)return r;const{points:l}=s,c=l[l.length-1];if(!e.altKey)return c===a&&xo.deletePoints(s,[l.length-1]),Object.assign(Object.assign({},r),{lastUncommittedPoint:null});const d=xo.createPointAt(s,t-r.pointerOffset.x,n-r.pointerOffset.y,i);return c===a?xo.movePoints(s,[{index:s.points.length-1,point:d}]):xo.addPoints(s,[{point:d}]),Object.assign(Object.assign({},r),{lastUncommittedPoint:s.points[s.points.length-1]})}static getPointGlobalCoordinates(e,t){const[n,r,i,o]=Ye(e),a=(n+i)/2,s=(r+o)/2;let{x:l,y:c}=e;return[l,c]=De(l+t[0],c+t[1],a,s,e.angle),[l,c]}static getPointsGlobalCoordinates(e){const[t,n,r,i]=Ye(e),o=(t+r)/2,a=(n+i)/2;return e.points.map((t=>{let{x:n,y:r}=e;return[n,r]=De(n+t[0],r+t[1],o,a,e.angle),[n,r]}))}static getPointAtIndexGlobalCoordinates(e,t){const n=t<0?e.points.length+t:t,[r,i,o,a]=Ye(e),s=(r+o)/2,l=(i+a)/2,c=e.points[n],{x:d,y:u}=e;return De(d+c[0],u+c[1],s,l,e.angle)}static pointFromAbsoluteCoords(e,t){const[n,r,i,o]=Ye(e),a=(n+i)/2,s=(r+o)/2,[l,c]=De(t[0],t[1],a,s,-e.angle);return[l-e.x,c-e.y]}static getPointIndexUnderCursor(e,t,n,r){const i=this.getPointsGlobalCoordinates(e);let o=i.length;for(;--o>-1;){const e=i[o];if(He(n,r,e[0],e[1])*t.value<this.POINT_HANDLE_SIZE/2+1)return o}return-1}static createPointAt(e,t,n,r){const i=Ke(t,n,r),[o,a,s,l]=Ye(e),c=(o+s)/2,d=(a+l)/2,[u,h]=De(i[0],i[1],c,d,-e.angle);return[u-e.x,h-e.y]}static getNormalizedPoints(e){const{points:t}=e,n=t[0][0],r=t[0][1];return{points:t.map(((e,t)=>[e[0]-n,e[1]-r])),x:e.x+n,y:e.y+r}}static normalizePoints(e){Ar(e,xo.getNormalizedPoints(e))}static duplicateSelectedPoints(e){if(!e.editingLinearElement)return!1;const{selectedPointsIndices:t,elementId:n}=e.editingLinearElement,r=xo.getElement(n);if(!r||null===t)return!1;const{points:i}=r,o=[];let a=!1,s=-1;const l=i.reduce(((e,n,r)=>{++s,e.push(n);if(t.includes(r)){const t=i[r+1];t||(a=!0),e.push(t?[(n[0]+t[0])/2,(n[1]+t[1])/2]:[n[0],n[1]]),o.push(s+1),++s}return e}),[]);if(Ar(r,{points:l}),a){const e=r.points[r.points.length-1];xo.movePoints(r,[{index:r.points.length-1,point:[e[0]+30,e[1]+30]}])}return{appState:Object.assign(Object.assign({},e),{editingLinearElement:Object.assign(Object.assign({},e.editingLinearElement),{selectedPointsIndices:o})})}}static deletePoints(e,t){let n=0,r=0;if(t.includes(0)){const i=e.points.find(((e,n)=>!t.includes(n)));i&&(n=i[0],r=i[1])}const i=e.points.reduce(((e,i,o)=>(t.includes(o)||e.push(e.length?[i[0]-n,i[1]-r]:[0,0]),e)),[]);xo._updatePoints(e,i,n,r)}static addPoints(e,t){const n=[...e.points,...t.map((e=>e.point))];xo._updatePoints(e,n,0,0)}static movePoints(e,t,n){const{points:r}=e;let i=0,o=0;const a=t.find((e=>{let{index:t}=e;return 0===t}));a&&(i=a.point[0]-r[a.index][0],o=a.point[1]-r[a.index][1]);const s=r.map(((e,n)=>{const s=t.find((e=>e.index===n));if(s){if(a)return e;const t=s.point[0]-r[s.index][0],n=s.point[1]-r[s.index][1];return[e[0]+t,e[1]+n]}return i||o?[e[0]-i,e[1]-o]:e}));xo._updatePoints(e,s,i,o,n)}static _updatePoints(e,t,n,r,i){const o=nt(e,t,e.strokeSharpness||"round"),a=nt(e,e.points,e.strokeSharpness||"round"),s=(o[0]+o[2])/2,l=(o[1]+o[3])/2,c=(a[0]+a[2])/2,d=(a[1]+a[3])/2,u=De(n,r,c-s,d-l,e.angle);Ar(e,Object.assign(Object.assign({},i),{points:t,x:e.x+u[0],y:e.y+u[1]}))}}xo.POINT_HANDLE_SIZE=20;const yo=e=>{let t=[...new Set(e.filter((e=>null!==e&&-1!==e)))];return t=t.sort(((e,t)=>e-t)),t.length?t:null},wo=e=>e.isBindingEnabled,ko=(e,t,n)=>{const r=new Set,i=new Set;_o(e,t,n,"start",r,i),_o(e,n,t,"end",r,i);const o=Array.from(i).filter((e=>!r.has(e)));Hn.getScene(e).getNonDeletedElements(o).forEach((t=>{var n;Ar(t,{boundElements:null===(n=t.boundElements)||void 0===n?void 0:n.filter((t=>"arrow"!==t.type||t.id!==e.id))})}))},_o=(e,t,n,r,i,o)=>{if("keep"!==t)if(null!=t)null!=n&&("keep"===n?Io(e,t,r):"start"!==r&&n.id===t.id)||(jo(e,t,r),i.add(t.id));else{const t=Oo(e,r);null!=t&&o.add(t)}},Co=e=>{e.forEach((e=>{Te(e)?ko(e,Bo(e,"start"),Bo(e,"end")):Oe(e)&&Eo(e)}))},Eo=e=>{Uo(e).forEach((t=>{let[n,r]=t;return ko(n,"end"===r?"keep":e,"start"===r?"keep":e)}))},So=(e,t,n,r)=>{null!=t.startBoundElement&&jo(e,t.startBoundElement,"start");const i=Lo(r,n);null==i||Io(e,i,"end")||jo(e,i,"end")},jo=(e,t,n)=>{Ar(e,{["start"===n?"startBinding":"endBinding"]:Object.assign({elementId:t.id},Ao(e,t,n))});ln(t.boundElements||[]).has(e.id)||Ar(t,{boundElements:(t.boundElements||[]).concat({id:e.id,type:"arrow"})})},Io=(e,t,n)=>{const r=e["start"===n?"endBinding":"startBinding"];return To(e,null==r?void 0:r.elementId,t)},To=(e,t,n)=>t===n.id&&e.points.length<3,Mo=e=>{e.forEach((e=>{Te(e)&&ko(e,null,null)}))},Oo=(e,t)=>{const n="start"===t?"startBinding":"endBinding",r=e[n];return null==r?null:(Ar(e,{[n]:null}),r.elementId)},Lo=(e,t)=>Fs(t.getElements(),(t=>Oe(t)&&Hi(t,e))),Ao=(e,t,n)=>{const r="start"===n?-1:1,i=-1===r?0:e.points.length-1,o=i-r,a=xo.getPointAtIndexGlobalCoordinates(e,i),s=xo.getPointAtIndexGlobalCoordinates(e,o);return{focus:to(t,s,a),gap:Math.max(1,Fi(t,a))}},Po=(e,t)=>{var n;const r=(null!==(n=e.boundElements)&&void 0!==n?n:[]).filter((e=>"arrow"===e.type));if(0===r.length)return;const{newSize:i,simultaneouslyUpdated:o}=null!=t?t:{},a=zo(o);Hn.getScene(e).getNonDeletedElements(r.map((e=>e.id))).forEach((t=>{if(!je(t))return;const n=e;if(!Do(t,n))return;const r=Ho(n,t.startBinding,i),o=Ho(n,t.endBinding,i);a.has(t.id)?Ar(t,{startBinding:r,endBinding:o}):(Ro(t,"start",r,e),Ro(t,"end",o,e))}))},Do=(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},zo=e=>new Set((e||[]).map((e=>e.id))),Ro=(e,t,n,r)=>{if(null==n||n.elementId!==r.id&&e.points.length>2)return;const i=Hn.getScene(e).getElement(n.elementId);if(null==i)return;const o="start"===t?-1:1,a=-1===o?0:e.points.length-1,s=a-o,l=xo.getPointAtIndexGlobalCoordinates(e,s),c=((e,t,n)=>{if(0===t){const t=Ye(e),n=eo(t);return ji(n)}const r=Ji(e),i=Ai(r,Si(n)),o=pi(r);let a;switch(e.type){case"rectangle":case"image":case"text":case"diamond":a=co(e,t,i);break;case"ellipse":a=lo(e,t,i)}return ji(Ai(o,a))})(i,n.focus,l);let d;if(0===n.gap)d=c;else{const e=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const i=Ji(e),o=Ai(i,Si(t)),a=Ai(i,Si(n)),s=Ci(o,a),l=pi(i);return no(e,s,o,r).map((e=>ji(Ai(l,e))))}(i,l,c,n.gap);d=0===e.length?c:e[0]}xo.movePoints(e,[{index:a,point:xo.pointFromAbsoluteCoords(e,d)}],{["start"===t?"startBinding":"endBinding"]:n})},Ho=(e,t,n)=>{if(null==t||null==n)return t;const{gap:r,focus:i,elementId:o}=t,{width:a,height:s}=n,{width:l,height:c}=e;return{elementId:o,gap:Math.max(1,Math.min(Ni(e,a,s),r*(a<s?a/l:s/c))),focus:i}},No=e=>[Bo(e,"start"),Bo(e,"end")].filter((e=>null!=e)),Bo=(e,t)=>Lo(Fo(e,t),Hn.getScene(e)),Fo=(e,t)=>{const n="start"===t?0:-1;return tn(xo.getPointAtIndexGlobalCoordinates(e,n))},Uo=e=>Hn.getScene(e).getElements().map((t=>{if(!Te(t))return null;const n=Wo(t,"start",e),r=Wo(t,"end",e);return n||r?[t,n&&r?"both":n?"start":"end",e]:null})).filter((e=>null!=e)),Wo=(e,t,n)=>null==e["start"===t?"startBinding":"endBinding"]&&!Io(e,n,t)&&Hi(n,Fo(e,t)),Ko=(e,t,n,r)=>{const i=new Set,o=new Set,a="duplicatesServeAsOld"===r;t.forEach((e=>{const{boundElements:t}=e;if(null!=t&&t.length>0&&(t.forEach((e=>{a&&!n.has(e.id)&&i.add(e.id)})),o.add(n.get(e.id))),Te(e)){if(null!=e.startBinding){const{elementId:t}=e.startBinding;a&&!n.has(t)&&o.add(t)}if(null!=e.endBinding){const{elementId:t}=e.endBinding;a&&!n.has(t)&&o.add(t)}null==e.startBinding&&null==e.endBinding||i.add(n.get(e.id))}})),e.filter((e=>{let{id:t}=e;return i.has(t)})).forEach((e=>{const{startBinding:t,endBinding:r}=e;Ar(e,{startBinding:Vo(t,n),endBinding:Vo(r,n)})})),e.filter((e=>{let{id:t}=e;return o.has(t)})).forEach((e=>{const{boundElements:t}=e;null!=t&&t.length>0&&Ar(e,{boundElements:t.map((e=>n.has(e.id)?{id:n.get(e.id),type:e.type}:e))})}))},Vo=(e,t)=>{var n;if(null==e)return null;const{elementId:r,focus:i,gap:o}=e;return{focus:i,gap:o,elementId:null!==(n=t.get(r))&&void 0!==n?n:r}},Go=(e,t)=>{const n=new Set(t.map((e=>e.id))),r=new Set;t.forEach((e=>{var t;Oe(e)&&(null===(t=e.boundElements)||void 0===t||t.forEach((e=>{n.has(e.id)||r.add(e.id)})))})),e.filter((e=>{let{id:t}=e;return r.has(t)})).forEach((e=>{const{startBinding:t,endBinding:r}=e;Ar(e,{startBinding:Yo(t,n),endBinding:Yo(r,n)})}))},Yo=(e,t)=>null==e||t.has(e.elementId)?null:e,Xo=e=>e>=2*Math.PI?e-2*Math.PI:e,Zo=(e,t,n,r)=>{const[i,a,s,l]=Ye(e),c=(i+s)/2,d=(a+l)/2;let u=5*Math.PI/2+Math.atan2(n-d,t-c);r&&(u+=o.ay/2,u-=u%o.ay),u=Xo(u),Ar(e,{angle:u});const h=Jn(e);if(h){const t=Hn.getScene(e).getElement(h);Ar(t,{angle:u})}},qo=(e,t,n,r,i)=>{const[o,a,s,l]=Ye(e),c=(o+s)/2,d=(a+l)/2,[u,h]=De(r,i,c,d,-e.angle);let[p,g]="end"===t?[u-e.x,h-e.y]:[e.x+e.points[1][0]-u,e.y+e.points[1][1]-h];n&&([p,g]=((e,t,n,r)=>{const i=Rr(e,...De(t,n,0,0,r));return De(i.width,i.height,0,0,-r)})(e.type,p,g,e.angle));const[m,f]=Re("end"===t?{s:!0,e:!0}:{n:!0,w:!0},e.x,e.y,e.angle,0,0,(e.points[1][0]-p)/2,(e.points[1][1]-g)/2);Ar(e,{x:m,y:f,points:[[0,0],[p,g]]})},$o=(e,t,n)=>je(e)||Ee(e)?{points:Ge(0,t,Ge(1,n,e.points))}:{},Qo=(e,t,n)=>{const r=e.fontSize*(t/e.width);if(r<1)return null;const i=Un(e.text,Ut({fontSize:r,fontFamily:e.fontFamily}),e.containerId?e.width:null);return{size:r,baseline:i.baseline+(n-i.height)}},Jo=(e,t,n,r,i)=>{const[o,a,s,l]=Ye(e),c=(o+s)/2,d=(a+l)/2,[u,h]=De(r,i,c,d,-e.angle);let p;switch(t){case"se":p=Math.max((u-o)/(s-o),(h-a)/(l-a));break;case"nw":p=Math.max((s-u)/(s-o),(l-h)/(l-a));break;case"ne":p=Math.max((u-o)/(s-o),(l-h)/(l-a));break;case"sw":p=Math.max((s-u)/(s-o),(h-a)/(l-a))}if(p>0){const r=e.width*p,i=e.height*p,c=Qo(e,r,i);if(null===c)return;const[d,u,h,g]=tt(e,r,i),m=(o-d)/2,f=(a-u)/2,b=(s-h)/2,v=(l-g)/2,[x,y]=Re(((e,t)=>({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,m,f,b,v);Ar(e,{fontSize:c.size,width:r,height:i,baseline:c.baseline,x,y})}},ea=(e,t,n,r,i,a,s)=>{const l=e.get(n.id),[c,d,u,h]=tt(l,l.width,l.height),p=[c,d],g=[u,h],m=((e,t)=>[(e[0]+t[0])/2,(e[1]+t[1])/2])(p,g),f=ze([a,s],m,-l.angle),[b,v,x,y]=tt(n,n.width,n.height),w=x-b,k=y-v;let _=(g[0]-p[0])/w,C=(g[1]-p[1])/k,E={};const S=er(n);r.includes("e")&&(_=(f[0]-p[0])/w),r.includes("s")&&(C=(f[1]-p[1])/k),r.includes("w")&&(_=(g[0]-f[0])/w),r.includes("n")&&(C=(g[1]-f[1])/k);const j=l.width,I=l.height;let T=n.width*_,M=n.height*C;if(i&&(T=2*T-j,M=2*M-I),t){const e=Math.abs(T)/j,t=Math.abs(M)/I;if(1===r.length&&(M*=e,T*=t),2===r.length){const n=Math.max(e,t);T=j*n*Math.sign(T),M=I*n*Math.sign(M)}}if(S){const n=e.get(S.id);if(n&&(E={fontSize:n.fontSize,baseline:n.baseline}),t){const e=Qo(S,T-2*o.gK,M-2*o.gK);if(null===e)return;E={fontSize:e.size,baseline:e.baseline}}else{const e=qn(Ut(S)),t=$n(Ut(S));T=Math.ceil(Math.max(T,e)),M=Math.ceil(Math.max(M,t))}}const[O,L,A,P]=tt(l,T,M),D=A-O,z=P-L;let R=[...p];if(["n","w","nw"].includes(r)&&(R=[g[0]-Math.abs(D),g[1]-Math.abs(z)]),"ne"===r){const e=[p[0],g[1]];R=[e[0],e[1]-Math.abs(z)]}if("sw"===r){const e=[g[0],p[1]];R=[e[0]-Math.abs(D),e[1]]}t&&(["s","n"].includes(r)&&(R[0]=m[0]-D/2),["e","w"].includes(r)&&(R[1]=m[1]-z/2)),T<0&&(r.includes("e")&&(R[0]-=Math.abs(D)),r.includes("w")&&(R[0]+=Math.abs(D))),M<0&&(r.includes("s")&&(R[1]-=Math.abs(z)),r.includes("n")&&(R[1]+=Math.abs(z))),i&&(R[0]=m[0]-Math.abs(D)/2,R[1]=m[1]-Math.abs(z)/2);const H=l.angle,N=ze(R,m,H),B=[R[0]+Math.abs(D)/2,R[1]+Math.abs(z)/2],F=ze(B,m,H);R=ze(N,F,-H);const U=$o(l,T,M),W=[...R];W[0]+=l.x-O,W[1]+=l.y-L;const K=Object.assign({width:Math.abs(T),height:Math.abs(M),x:W[0],y:W[1]},U);"scale"in n&&"scale"in l&&Ar(n,{scale:[(Math.sign(_)||l.scale[0])*l.scale[0],(Math.sign(C)||l.scale[1])*l.scale[1]]}),0!==K.width&&0!==K.height&&Number.isFinite(K.x)&&Number.isFinite(K.y)&&(Po(n,{newSize:{width:K.width,height:K.height}}),Ar(n,K),S&&E&&Ar(S,{fontSize:E.fontSize}),Fn(n,r))},ta=(e,t,n,r)=>{const[i,a,s,l]=et(e);let c,d;switch(t){case"se":c=Math.max((n-i)/(s-i),(r-a)/(l-a)),d=(e,t,n)=>{let[r,o]=t,[s,l]=n;return{x:e.x+(r-i)*(c-1)+r-s,y:e.y+(o-a)*(c-1)+o-l}};break;case"nw":c=Math.max((s-n)/(s-i),(l-r)/(l-a)),d=(e,t,n)=>{let[,,r,i]=t,[,,o,a]=n;return{x:e.x-(s-r)*(c-1)+r-o,y:e.y-(l-i)*(c-1)+i-a}};break;case"ne":c=Math.max((n-i)/(s-i),(l-r)/(l-a)),d=(e,t,n)=>{let[r,,,o]=t,[a,,,s]=n;return{x:e.x+(r-i)*(c-1)+r-a,y:e.y-(l-o)*(c-1)+o-s}};break;case"sw":c=Math.max((s-n)/(s-i),(r-a)/(l-a)),d=(e,t,n)=>{let[,r,i]=t,[,o,l]=n;return{x:e.x-(s-i)*(c-1)+i-l,y:e.y+(r-a)*(c-1)+r-o}}}if(c>0){const n=e.reduce(((t,n)=>{if(!t)return t;const r=n.width*c,i=n.height*c,a=er(n);let s={};if(a){const e=Qo(a,r-2*o.gK,i-2*o.gK);if(null===e)return null;s={fontSize:e.size,baseline:e.baseline}}if(Ce(n)){const e=Qo(n,r,i);if(null===e)return null;s={fontSize:e.size,baseline:e.baseline}}const l=Ye(n),u=$o(n,r,i);Po(n,{newSize:{width:r,height:i},simultaneouslyUpdated:e});const h=tt(Object.assign(Object.assign({},n),u),r,i),{x:p,y:g}=d(n,l,h);return[...t,Object.assign(Object.assign({width:r,height:i,x:p,y:g},u),s)]}),[]);n&&e.forEach(((e,r)=>{Ar(e,n[r]);const i=er(e);i&&(Ar(i,{fontSize:n[r].fontSize,baseline:n[r].baseline}),Fn(e,t))}))}},na=(e,t,n,r,i,a,s)=>{let l=5*Math.PI/2+Math.atan2(r-s,n-a);i&&(l+=o.ay/2,l-=l%o.ay),t.forEach(((t,n)=>{var r,i;const[o,c,d,u]=Ye(t),h=(o+d)/2,p=(c+u)/2,g=null!==(r=null===(i=e.originalElements.get(t.id))||void 0===i?void 0:i.angle)&&void 0!==r?r:t.angle,[m,f]=De(h,p,a,s,l+g-t.angle);Ar(t,{x:t.x+(m-h),y:t.y+(f-p),angle:Xo(l+g)});const b=Jn(t);if(b){const e=Hn.getScene(t).getElement(b);Ar(e,{x:e.x+(m-h),y:e.y+(f-p),angle:Xo(l+g)})}}))},ra=(e,t,n,r,i,o)=>{let a,s;if(e){const l=e&&t<n,c=e&&t>n,d=r.originalElements.get(i.id);a=l&&d?d.x:i.x+o.x,s=c&&d?d.y:i.y+o.y}else a=i.x+o.x,s=i.y+o.y;Ar(i,{x:a,y:s})},ia=(e,t,n,r,i,o,a,s,l,c,d)=>{l&&(d?s=a/d:(({width:a,height:s}=Rr(t,a,o<r?-s:s)),s<0&&(s=-s)));let u=i<n?n-a:n,h=o<r?r-s:r;c&&(u=n-(a+=a)/2,h=r-(s+=s)/2),0!==a&&0!==s&&Ar(e,{x:u,y:h,width:a,height:s})},oa=e=>{let{options:t,value:n,onChange:r,group:i}=e;return(0,v.jsx)("div",{className:"buttonList buttonListIcon",children:t.map((e=>(0,v.jsxs)("label",{className:ye({active:n===e.value}),title:e.text,children:[(0,v.jsx)("input",{type:"radio",name:i,onChange:()=>r(e.value),checked:n===e.value,"data-testid":e.testId}),e.icon]},e.text)))})};n(4301);const aa=e=>{let{children:t,left:n,top:i,onCloseRequest:o,fitInViewport:a=!1,offsetLeft:s=0,offsetTop:l=0,viewportWidth:c=window.innerWidth,viewportHeight:d=window.innerHeight}=e;const u=(0,r.useRef)(null);return(0,r.useLayoutEffect)((()=>{if(a&&u.current){const e=u.current,{x:t,y:n,width:r,height:i}=e.getBoundingClientRect();t+r-s>c&&(e.style.left="".concat(c-r,"px")),n+i-l>d&&(e.style.top="".concat(d-i,"px"))}}),[a,c,d,s,l]),(0,r.useEffect)((()=>{if(o){const e=e=>{var t;null!==(t=u.current)&&void 0!==t&&t.contains(e.target)||(0,st.unstable_batchedUpdates)((()=>o(e)))};return document.addEventListener("pointerdown",e,!1),()=>document.removeEventListener("pointerdown",e,!1)}}),[o]),(0,v.jsx)("div",{className:"popover",style:{top:i,left:n},ref:u,children:t})};n(4220);const sa=(e,t)=>!at[t].includes(e),la=e=>{const t=(new Option).style;return t.color=e,!!t.color},ca=[["1","2","3","4","5"],["q","w","e","r","t"],["a","s","d","f","g"],["z","x","c","v","b"]].flat(),da=e=>{let{colors:t,color:n,onChange:r,onClose:o,label:a,showInput:s=!0,type:l,elements:c}=e;const d=i().useRef(),u=i().useRef(),h=i().useRef(),p=i().useRef(),[g]=i().useState((()=>"canvasBackground"===l?[]:((e,t)=>{const n=[],r=e.filter((e=>!e.isDeleted)).sort(((e,t)=>t.updated-e.updated));let i=0;const o={elementBackground:"backgroundColor",elementStroke:"strokeColor"}[t];for(;i<r.length&&n.length<5;){const e=r[i];n.length<5&&sa(e[o],t)&&!n.includes(e[o])&&n.push(e[o]),i++}return n})(c,l)));i().useEffect((()=>{u.current?u.current.focus():p.current?p.current.focus():h.current&&h.current.focus()}),[]);const f=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e.map(((e,i)=>{const o=e.replace("#",""),a=t?ca[i+15]:ca[i],s=t?o:b("colors.".concat(o));return(0,v.jsxs)("button",{className:"color-picker-swatch",onClick:t=>{t.currentTarget.focus(),r(e)},title:"".concat(s).concat(rn(e)?"":" (".concat(e,")")," — ").concat(a.toUpperCase()),"aria-label":s,"aria-keyshortcuts":ca[i],style:{color:e},ref:r=>{!t&&r&&0===i&&(d.current=r),r&&e===n&&(u.current=r)},onFocus:()=>{r(e)},children:[rn(e)?(0,v.jsx)("div",{className:"color-picker-transparent"}):void 0,(0,v.jsx)("span",{className:"color-picker-keybinding",children:a})]},e)}))};return(0,v.jsxs)("div",{className:"color-picker color-picker-type-".concat(l),role:"dialog","aria-modal":"true","aria-label":b("labels.colorPicker"),onKeyDown:e=>{if(e.key===Lt.TAB){const{activeElement:r}=document;var t;if(e.shiftKey){if(r===d.current)null===(t=p.current)||void 0===t||t.focus(),e.preventDefault()}else if(r===p.current){var n;null===(n=d.current)||void 0===n||n.focus(),e.preventDefault()}}else if(At(e.key)){const{activeElement:t}=document,n=m().rtl;let i=!1,o=Array.prototype.indexOf.call(h.current.querySelector(".color-picker-content--default").children,t);-1===o&&(o=Array.prototype.indexOf.call(h.current.querySelector(".color-picker-content--canvas-colors").children,t),-1!==o&&(i=!0));const a=i?h.current.querySelector(".color-picker-content--canvas-colors"):h.current.querySelector(".color-picker-content--default");if(-1!==o){var r;const t=a.children.length-(s?1:0),l=e.key===(n?Lt.ARROW_LEFT:Lt.ARROW_RIGHT)?(o+1)%t:e.key===(n?Lt.ARROW_RIGHT:Lt.ARROW_LEFT)?(t+o-1)%t:i||e.key!==Lt.ARROW_DOWN?i||e.key!==Lt.ARROW_UP?o:(t+o-5)%t:(o+5)%t;null===(r=a.children[l])||void 0===r||r.focus()}e.preventDefault()}else if(ca.includes(e.key.toLowerCase())&&!Bt(e.target)){var i;const t=ca.indexOf(e.key.toLowerCase()),n=t>=15,r=n?t-15:t;null===(i=(n?h.current.querySelector(".color-picker-content--canvas-colors"):h.current.querySelector(".color-picker-content--default")).children[r])||void 0===i||i.focus(),e.preventDefault()}else e.key!==Lt.ESCAPE&&e.key!==Lt.ENTER||(e.preventDefault(),o());e.nativeEvent.stopImmediatePropagation(),e.stopPropagation()},children:[(0,v.jsx)("div",{className:"color-picker-triangle color-picker-triangle-shadow"}),(0,v.jsx)("div",{className:"color-picker-triangle"}),(0,v.jsxs)("div",{className:"color-picker-content",ref:e=>{e&&(h.current=e)},tabIndex:0,children:[(0,v.jsx)("div",{className:"color-picker-content--default",children:f(t)}),!!g.length&&(0,v.jsxs)("div",{className:"color-picker-content--canvas",children:[(0,v.jsx)("span",{className:"color-picker-content--canvas-title",children:b("labels.canvasColors")}),(0,v.jsx)("div",{className:"color-picker-content--canvas-colors",children:f(g,!0)})]}),s&&(0,v.jsx)(ua,{color:n,label:a,onChange:e=>{r(e)},ref:p})]})]})},ua=i().forwardRef(((e,t)=>{let{color:n,onChange:r,label:o}=e;const[a,s]=i().useState(n),l=i().useRef(null);i().useEffect((()=>{s(n)}),[n]),i().useImperativeHandle(t,(()=>l.current));const c=i().useCallback((e=>{const t=e.toLowerCase(),n=(e=>rn(e)||la(e)?e:la("#".concat(e))?"#".concat(e):null)(t);n&&r(n),s(t)}),[r]);return(0,v.jsxs)("label",{className:"color-input-container",children:[(0,v.jsx)("div",{className:"color-picker-hash",children:"#"}),(0,v.jsx)("input",{spellCheck:!1,className:"color-picker-input","aria-label":o,onChange:e=>c(e.target.value),value:(a||"").replace(/^#/,""),onBlur:()=>s(n),ref:l})]})})),ha=e=>{let{type:t,color:n,onChange:r,label:o,isActive:a,setActive:s,elements:l,appState:c}=e;const d=i().useRef(null);return(0,v.jsxs)("div",{children:[(0,v.jsxs)("div",{className:"color-picker-control-container",children:[(0,v.jsx)("button",{className:"color-picker-label-swatch","aria-label":o,style:n?{"--swatch-color":n}:void 0,onClick:()=>s(!a),ref:d}),(0,v.jsx)(ua,{color:n,label:o,onChange:e=>{r(e)}})]}),(0,v.jsx)(i().Suspense,{fallback:"",children:a?(0,v.jsx)(aa,{onCloseRequest:e=>e.target!==d.current&&s(!1),children:(0,v.jsx)(da,{colors:at[t],color:n||null,onChange:e=>{r(e)},onClose:()=>{var e;s(!1),null===(e=d.current)||void 0===e||e.focus()},label:o,showInput:!1,type:t,elements:l})}):null})]})};n(7117);function pa(e){let{options:t,value:n,label:r,onChange:o,onClose:a}=e;const s=i().useRef(),l=i().useRef(),c=i().useRef(null);i().useEffect((()=>{l.current?l.current.focus():c.current&&c.current.focus()}),[]);return(0,v.jsx)("div",{className:"picker",role:"dialog","aria-modal":"true","aria-label":r,onKeyDown:e=>{const n=t.find((t=>t.keyBinding===e.key.toLowerCase()));if(e.metaKey||e.altKey||e.ctrlKey||!n)if(e.key===Lt.TAB)setTimeout((()=>{l.current!==document.activeElement&&a()}),0);else if(At(e.key)){const{activeElement:n}=document,r=m().rtl,i=Array.prototype.indexOf.call(c.current.children,n);if(-1!==i){const n=t.length;let o=i;switch(e.key){case r?Lt.ARROW_LEFT:Lt.ARROW_RIGHT:case Lt.ARROW_DOWN:o=(i+1)%n;break;case r?Lt.ARROW_RIGHT:Lt.ARROW_LEFT:case Lt.ARROW_UP:o=(n+i-1)%n}c.current.children[o].focus()}e.preventDefault()}else e.key!==Lt.ESCAPE&&e.key!==Lt.ENTER||(e.preventDefault(),a());else{const r=t.indexOf(n);c.current.children[r].focus(),e.preventDefault()}e.nativeEvent.stopImmediatePropagation(),e.stopPropagation()},children:(0,v.jsx)("div",{className:"picker-content",ref:c,children:t.map(((e,t)=>(0,v.jsxs)("button",{className:"picker-option",onClick: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:r=>{r&&0===t&&(s.current=r),r&&e.value===n&&(l.current=r)},onFocus:()=>{o(e.value)},children:[e.icon,(0,v.jsx)("span",{className:"picker-keybinding",children:e.keyBinding})]},e.text)))})})}function ga(e){var t;let{value:n,label:r,options:o,onChange:a,group:s=""}=e;const[l,c]=i().useState(!1),d=i().useRef(null),u=m().rtl;return(0,v.jsxs)("label",{className:"picker-container",children:[(0,v.jsx)("button",{name:s,className:l?"active":"","aria-label":r,onClick:()=>c(!l),ref:d,children:null===(t=o.find((e=>e.value===n)))||void 0===t?void 0:t.icon}),(0,v.jsx)(i().Suspense,{fallback:"",children:l?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(aa,Object.assign(Object.assign({onCloseRequest:e=>e.target!==d.current&&c(!1)},u?{right:5.5}:{left:-5.5}),{children:(0,v.jsx)(pa,{options:o,value:n,label:r,onChange:a,onClose:()=>{var e;c(!1),null===(e=d.current)||void 0===e||e.focus()}})})),(0,v.jsx)("div",{className:"picker-triangle"})]}):null})]})}const ma=e=>e===o.C6.LIGHT?it.orange[4]:it.orange[9],fa=e=>e===o.C6.LIGHT?it.white:"#1e1e1e",ba=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:512;const{width:n=512,height:r=n,mirror:i,style:o}="number"==typeof t?{width:t}:t;return(0,v.jsx)("svg",{"aria-hidden":"true",focusable:"false",role:"img",viewBox:"0 0 ".concat(n," ").concat(r),className:ye({"rtl-mirror":i}),style:o,children:"string"==typeof e?(0,v.jsx)("path",{fill:"currentColor",d:e}):e})},va=ba((0,v.jsx)("polyline",{fill:"none",stroke:"currentColor",points:"20 6 9 17 4 12"}),{width:24,height:24}),xa=ba("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}),ya=ba("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}),wa=ba("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}),ka=ba("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}),_a=ba("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}),Ca=ba("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}),Ea=ba("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"),Sa=(ba("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}),ba((0,v.jsxs)(v.Fragment,{children:[(0,v.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,v.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})),ja=ba("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}),Ia=ba("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}),Ta=ba("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}),Ma=ba("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"),Oa=ba("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"),La=ba("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}),Aa=ba("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}),Pa=ba("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}),Da=(ba("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}),ba("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}),ba((0,v.jsxs)(v.Fragment,{children:[(0,v.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,v.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}),ba((0,v.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}),i().memo((e=>{let{theme:t}=e;return ba((0,v.jsxs)(v.Fragment,{children:[(0,v.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:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2"}),(0,v.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:ma(t),stroke:ma(t),strokeWidth:"2"})]}),{width:24,mirror:!0})}))),za=i().memo((e=>{let{theme:t}=e;return ba((0,v.jsxs)(v.Fragment,{children:[(0,v.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:ma(t),stroke:ma(t),strokeWidth:"2"}),(0,v.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:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2"})]}),{width:24,mirror:!0})})),Ra=i().memo((e=>{let{theme:t}=e;return ba((0,v.jsxs)(v.Fragment,{children:[(0,v.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:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2"}),(0,v.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:ma(t),stroke:ma(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),Ha=i().memo((e=>{let{theme:t}=e;return ba((0,v.jsxs)(v.Fragment,{children:[(0,v.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:ma(t),stroke:ma(t),strokeWidth:"2"}),(0,v.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:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2"})]}),{width:24,mirror:!0})})),Na=i().memo((e=>{let{theme:t}=e;return ba((0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("path",{d:"M 2,5 H 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,v.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:ma(t),stroke:ma(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),Ba=i().memo((e=>{let{theme:t}=e;return ba((0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("path",{d:"M 2,19 H 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,v.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:ma(t),stroke:ma(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),Fa=i().memo((e=>{let{theme:t}=e;return ba((0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("path",{d:"M 5,2 V 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,v.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:ma(t),stroke:ma(t),strokeWidth:"2"})]}),{width:24})})),Ua=i().memo((e=>{let{theme:t}=e;return ba((0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("path",{d:"M 19,2 V 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,v.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:ma(t),stroke:ma(t),strokeWidth:"2"})]}),{width:24})})),Wa=i().memo((e=>{let{theme:t}=e;return ba((0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("path",{d:"M19 5V19M5 5V19",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,v.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:ma(t),stroke:ma(t),strokeWidth:"2"})]}),{width:24})})),Ka=i().memo((e=>{let{theme:t}=e;return ba((0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("path",{d:"M5 5L19 5M5 19H19",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,v.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:ma(t),stroke:ma(t),strokeWidth:"2"})]}),{width:24})})),Va=i().memo((e=>{let{theme:t}=e;return ba((0,v.jsxs)(v.Fragment,{children:[(0,v.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:ma(t),stroke:ma(t),strokeWidth:"2"}),(0,v.jsx)("path",{d:"M 2,12 H 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeDasharray:"1, 2.8",strokeLinecap:"round"})]}),{width:24,mirror:!0})})),Ga=i().memo((e=>{let{theme:t}=e;return ba((0,v.jsxs)(v.Fragment,{children:[(0,v.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:ma(t),stroke:ma(t),strokeWidth:"2"}),(0,v.jsx)("path",{d:"M 12,2 V 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeDasharray:"1, 2.8",strokeLinecap:"round"})]}),{width:24})})),Ya=ba("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}),Xa=(ba("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"),ba("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"),ba("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})),Za=ba("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}),qa=ba("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}),$a=(ba("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}),ba("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})),Qa=i().memo((e=>{let{theme:t}=e;return ba((0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("path",{d:"M25 26H111V111H25",fill:"var(--icon-fill-color)"}),(0,v.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:"var(--icon-fill-color)",strokeWidth:"2"}),(0,v.jsx)("path",{d:"M100 100H160V160H100",fill:"var(--icon-fill-color)"}),(0,v.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:"var(--icon-fill-color)",strokeWidth:"2"}),(0,v.jsxs)("g",{fill:fa(t),stroke:"var(--icon-fill-color)",strokeWidth:"6",children:[(0,v.jsx)("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),(0,v.jsx)("rect",{x:"2.5",y:"149.5",width:"30",height:"30"}),(0,v.jsx)("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),(0,v.jsx)("rect",{x:"147.5",y:"2.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})})),Ja=i().memo((e=>{let{theme:t}=e;return ba((0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("path",{d:"M25 26H111V111H25",fill:"var(--icon-fill-color)"}),(0,v.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:"var(--icon-fill-color)",strokeWidth:"2"}),(0,v.jsx)("path",{d:"M100 100H160V160H100",fill:"var(--icon-fill-color)"}),(0,v.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:"var(--icon-fill-color)",strokeWidth:"2"}),(0,v.jsxs)("g",{fill:fa(t),stroke:"var(--icon-fill-color)",strokeWidth:"6",children:[(0,v.jsx)("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),(0,v.jsx)("rect",{x:"78.5",y:"149.5",width:"30",height:"30"}),(0,v.jsx)("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),(0,v.jsx)("rect",{x:"147.5",y:"78.5",width:"30",height:"30"}),(0,v.jsx)("rect",{x:"105.5",y:"2.5",width:"30",height:"30"}),(0,v.jsx)("rect",{x:"2.5",y:"102.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})})),es=i().memo((e=>{let{theme:t}=e;return ba((0,v.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:"var(--icon-fill-color)"}),{width:40,height:20})})),ts=i().memo((e=>{let{theme:t}=e;return ba((0,v.jsxs)("g",{fill:"var(--icon-fill-color)",fillRule:"evenodd",clipRule:"evenodd",children:[(0,v.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,v.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})})),ns=i().memo((e=>{let{theme:t}=e;return ba((0,v.jsx)("path",{d:"M2 2H38V18H2V2Z",fill:"var(--icon-fill-color)"}),{width:40,height:20})})),rs=i().memo((e=>{let{theme:t,strokeWidth:n}=e;return ba((0,v.jsx)("path",{d:"M6 10H32",stroke:"var(--icon-fill-color)",strokeWidth:n,strokeLinecap:"round",fill:"none"}),{width:40,height:20})})),is=i().memo((e=>{let{theme:t}=e;return ba((0,v.jsx)("path",{d:"M6 10H34",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none",strokeLinecap:"round"}),{width:40,height:20})})),os=i().memo((e=>{let{theme:t}=e;return ba((0,v.jsx)("path",{d:"M6 10H34",stroke:"var(--icon-fill-color)",strokeWidth:2.5,strokeDasharray:"10, 8",fill:"none",strokeLinecap:"round"}),{width:40,height:20})})),as=i().memo((e=>{let{theme:t}=e;return ba((0,v.jsx)("path",{d:"M6 10H36",stroke:"var(--icon-fill-color)",strokeWidth:2.5,strokeDasharray:"2, 4.5",fill:"none",strokeLinecap:"round"}),{width:40,height:20})})),ss=i().memo((e=>{let{theme:t}=e;return ba((0,v.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:"var(--icon-fill-color)",strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),ls=i().memo((e=>{let{theme:t}=e;return ba((0,v.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:"var(--icon-fill-color)",strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),cs=i().memo((e=>{let{theme:t}=e;return ba((0,v.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:"var(--icon-fill-color)",strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),ds=i().memo((e=>{let{theme:t}=e;return ba((0,v.jsx)("path",{d:"M10 17L10 5L35 5",stroke:"var(--icon-fill-color)",strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),us=i().memo((e=>{let{theme:t}=e;return ba((0,v.jsx)("path",{d:"M10 17V15C10 8 13 5 21 5L33.5 5",stroke:"var(--icon-fill-color)",strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),hs=i().memo((e=>{let{theme:t}=e;return ba((0,v.jsx)("path",{d:"M6 10H34",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none"}),{width:40,height:20})})),ps=i().memo((e=>{let{theme:t,flip:n=!1}=e;return ba((0,v.jsxs)("g",{transform:n?"translate(40, 0) scale(-1, 1)":"",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none",children:[(0,v.jsx)("path",{d:"M34 10H6M34 10L27 5M34 10L27 15"}),(0,v.jsx)("path",{d:"M27.5 5L34.5 10L27.5 15"})]}),{width:40,height:20})})),gs=i().memo((e=>{let{theme:t,flip:n=!1}=e;return ba((0,v.jsxs)("g",{stroke:"var(--icon-fill-color)",fill:"var(--icon-fill-color)",transform:n?"translate(40, 0) scale(-1, 1)":"",children:[(0,v.jsx)("path",{d:"M32 10L6 10",strokeWidth:2}),(0,v.jsx)("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})})),ms=i().memo((e=>{let{theme:t,flip:n=!1}=e;return ba((0,v.jsx)("g",{transform:n?"translate(40, 0) scale(-1, 1)":"",children:(0,v.jsx)("path",{d:"M34 10H5.99996M34 10L34 5M34 10L34 15",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none"})}),{width:40,height:20})})),fs=i().memo((e=>{let{theme:t,flip:n=!1}=e;return ba((0,v.jsxs)("g",{stroke:"var(--icon-fill-color)",fill:"var(--icon-fill-color)",transform:n?"translate(40, 0) scale(-1, 1)":"",children:[(0,v.jsx)("path",{d:"M32 10L6 10",strokeWidth:2}),(0,v.jsx)("path",{d:"M27.5 5.5L34.5 10L27.5 14.5L27.5 5.5"})]}),{width:40,height:20})})),bs=i().memo((e=>{let{theme:t}=e;return ba((0,v.jsx)("path",{fill:"var(--icon-fill-color)",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})})),vs=i().memo((e=>{let{theme:t}=e;return ba((0,v.jsx)("path",{fill:"var(--icon-fill-color)",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})})),xs=i().memo((e=>{let{theme:t}=e;return ba((0,v.jsx)("path",{fill:"var(--icon-fill-color)",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})})),ys=i().memo((e=>{let{theme:t}=e;return ba((0,v.jsx)("path",{fill:"var(--icon-fill-color)",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})})),ws=i().memo((e=>{let{theme:t}=e;return ba((0,v.jsx)("path",{fill:"var(--icon-fill-color)",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})})),ks=i().memo((e=>{let{theme:t}=e;return ba((0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("path",{fill:"var(--icon-fill-color)",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,v.jsx)("path",{fill:"var(--icon-fill-color)",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})})),_s=i().memo((e=>{let{theme:t}=e;return ba((0,v.jsx)(v.Fragment,{children:(0,v.jsx)("path",{fill:"var(--icon-fill-color)",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})})),Cs=i().memo((e=>{let{theme:t}=e;return ba((0,v.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:"var(--icon-fill-color)",strokeLinecap:"round"}),{width:448,height:512})})),Es=i().memo((e=>{let{theme:t}=e;return ba((0,v.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:"var(--icon-fill-color)"}),{width:448,height:512})})),Ss=i().memo((e=>{let{theme:t}=e;return ba((0,v.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:"var(--icon-fill-color)",strokeLinecap:"round"}),{width:448,height:512})})),js=i().memo((e=>{let{theme:t}=e;return ba((0,v.jsx)("path",{d:"m16,132l416,0c8.837,0 16,-7.163 16,-16l0,-40c0,-8.837 -7.163,-16 -16,-16l-416,0c-8.837,0 -16,7.163 -16,16l0,40c0,8.837 7.163,16 16,16zm0,160l416,0c8.837,0 16,-7.163 16,-16l0,-40c0,-8.837 -7.163,-16 -16,-16l-416,0c-8.837,0 -16,7.163 -16,16l0,40c0,8.837 7.163,16 16,16z",fill:"var(--icon-fill-color)",strokeLinecap:"round"}),{width:448,height:512})})),Is=i().memo((e=>{let{theme:t}=e;return ba((0,v.jsx)("path",{d:"M16,292L432,292C440.837,292 448,284.837 448,276L448,236C448,227.163 440.837,220 432,220L16,220C7.163,220 0,227.163 0,236L0,276C0,284.837 7.163,292 16,292ZM16,452L432,452C440.837,452 448,444.837 448,436L448,396C448,387.163 440.837,380 432,380L16,380C7.163,380 0,387.163 0,396L0,436C0,444.837 7.163,452 16,452Z",fill:"var(--icon-fill-color)",strokeLinecap:"round"}),{width:448,height:512})})),Ts=i().memo((e=>{let{theme:t}=e;return ba((0,v.jsx)("path",{transform:"matrix(1,0,0,1,0,80)",d:"M16,132L432,132C440.837,132 448,124.837 448,116L448,76C448,67.163 440.837,60 432,60L16,60C7.163,60 0,67.163 0,76L0,116C0,124.837 7.163,132 16,132ZM16,292L432,292C440.837,292 448,284.837 448,276L448,236C448,227.163 440.837,220 432,220L16,220C7.163,220 0,227.163 0,236L0,276C0,284.837 7.163,292 16,292Z",fill:"var(--icon-fill-color)",strokeLinecap:"round"}),{width:448,height:512})})),Ms=ba((0,v.jsx)("path",{d:"M537.6 226.6c4.1-10.7 6.4-22.4 6.4-34.6 0-53-43-96-96-96-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32c-88.4 0-160 71.6-160 160 0 2.7.1 5.4.2 8.1C40.2 219.8 0 273.2 0 336c0 79.5 64.5 144 144 144h368c70.7 0 128-57.3 128-128 0-61.9-44-113.6-102.4-125.4zM393.4 288H328v112c0 8.8-7.2 16-16 16h-48c-8.8 0-16-7.2-16-16V288h-65.4c-14.3 0-21.4-17.2-11.3-27.3l105.4-105.4c6.2-6.2 16.4-6.2 22.6 0l105.4 105.4c10.1 10.1 2.9 27.3-11.3 27.3z",fill:"currentColor"}),{width:640,height:512}),Os=ba((0,v.jsx)("path",{fill:"currentColor",d:"M402.3 344.9l32-32c5-5 13.7-1.5 13.7 5.7V464c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V112c0-26.5 21.5-48 48-48h273.5c7.1 0 10.7 8.6 5.7 13.7l-32 32c-1.5 1.5-3.5 2.3-5.7 2.3H48v352h352V350.5c0-2.1.8-4.1 2.3-5.6zm156.6-201.8L296.3 405.7l-90.4 10c-26.2 2.9-48.5-19.2-45.6-45.6l10-90.4L432.9 17.1c22.9-22.9 59.9-22.9 82.7 0l43.2 43.2c22.9 22.9 22.9 60 .1 82.8zM460.1 174L402 115.9 216.2 301.8l-7.3 65.3 65.3-7.3L460.1 174zm64.8-79.7l-43.2-43.2c-4.1-4.1-10.8-4.1-14.8 0L436 82l58.1 58.1 30.9-30.9c4-4.2 4-10.8-.1-14.9z"}),{width:640,height:512}),Ls=ba((0,v.jsx)("path",{d:"M480 416C497.7 416 512 430.3 512 448C512 465.7 497.7 480 480 480H150.6C133.7 480 117.4 473.3 105.4 461.3L25.37 381.3C.3786 356.3 .3786 315.7 25.37 290.7L258.7 57.37C283.7 32.38 324.3 32.38 349.3 57.37L486.6 194.7C511.6 219.7 511.6 260.3 486.6 285.3L355.9 416H480zM265.4 416L332.7 348.7L195.3 211.3L70.63 336L150.6 416L265.4 416z"})),As=ba("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"),Ps=e=>"rectangle"===e||"ellipse"===e||"diamond"===e||"line"===e||"freedraw"===e,Ds=e=>"image"!==e,zs=e=>"rectangle"===e||"ellipse"===e||"diamond"===e||"freedraw"===e||"arrow"===e||"line"===e,Rs=e=>"rectangle"===e||"ellipse"===e||"diamond"===e||"arrow"===e||"line"===e,Hs=e=>"rectangle"===e||"arrow"===e||"line"===e||"diamond"===e,Ns=e=>"text"===e,Bs=e=>"arrow"===e,Fs=(e,t)=>{let n=null;for(let r=e.length-1;r>=0;--r){const i=e[r];if(!i.isDeleted&&t(i)){n=i;break}}return n},Us=(e,t,n)=>{let r=null;for(let i=e.length-1;i>=0;--i){if(e[i].isDeleted)continue;const[o,a,s,l]=Ye(e[i]);if(o<t&&t<s&&a<n&&n<l){r=e[i];break}}return Le(r)?r:null};let Ws=[];const Ks=e=>(Ws=Ws.concat(e),e),Vs=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=ln(Al(e,t,r));return e.map((e=>{var r;return i.get(e.id)||e.id===(null===(r=t.editingElement)||void 0===r?void 0:r.id)?n(e):e}))},Gs=function(e,t,n,r){var i,o;const a=t.editingElement,s=El(e);return null!==(i=null!==(o=a&&n(a))&&void 0!==o?o:Ol(s,t)?Ll(s,t,n):r)&&void 0!==i?i:null},Ys=(e,t,n,r)=>{const i=new Set;return{elements:Vs(e,t,(e=>{if(Ce(e)){const o=n(e);i.add(o);let a=Pr(e,{fontSize:o});return Nn(a,tr(e)),t=e,a=Pe(r=a)?r:Ar(r,{x:"left"===t.textAlign?t.x:t.x+(t.width-r.width)/("center"===t.textAlign?2:1),y:t.y+(t.height-r.height)/2},!1),a}var t,r;return e}),!0),appState:Object.assign(Object.assign({},t),{currentItemFontSize:1===i.size?[...i][0]:null!=r?r:t.currentItemFontSize}),commitToHistory:!0}},Xs=(Ks({name:"changeStrokeColor",perform:(e,t,n)=>Object.assign(Object.assign({},n.currentItemStrokeColor&&{elements:Vs(e,t,(e=>Ds(e.type)?Pr(e,{strokeColor:n.currentItemStrokeColor}):e),!0)}),{appState:Object.assign(Object.assign({},t),n),commitToHistory:!!n.currentItemStrokeColor}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("h3",{"aria-hidden":"true",children:b("labels.stroke")}),(0,v.jsx)(ha,{type:"elementStroke",label:b("labels.stroke"),color:Gs(t,n,(e=>e.strokeColor),n.currentItemStrokeColor),onChange:e=>r({currentItemStrokeColor:e}),isActive:"strokeColorPicker"===n.openPopup,setActive:e=>r({openPopup:e?"strokeColorPicker":null}),elements:t,appState:n})]})}}),Ks({name:"changeBackgroundColor",perform:(e,t,n)=>Object.assign(Object.assign({},n.currentItemBackgroundColor&&{elements:Vs(e,t,(e=>Pr(e,{backgroundColor:n.currentItemBackgroundColor})))}),{appState:Object.assign(Object.assign({},t),n),commitToHistory:!!n.currentItemBackgroundColor}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("h3",{"aria-hidden":"true",children:b("labels.background")}),(0,v.jsx)(ha,{type:"elementBackground",label:b("labels.background"),color:Gs(t,n,(e=>e.backgroundColor),n.currentItemBackgroundColor),onChange:e=>r({currentItemBackgroundColor:e}),isActive:"backgroundColorPicker"===n.openPopup,setActive:e=>r({openPopup:e?"backgroundColorPicker":null}),elements:t,appState:n})]})}}),Ks({name:"changeFillStyle",perform:(e,t,n)=>({elements:Vs(e,t,(e=>Pr(e,{fillStyle:n}))),appState:Object.assign(Object.assign({},t),{currentItemFillStyle:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsxs)("fieldset",{children:[(0,v.jsx)("legend",{children:b("labels.fill")}),(0,v.jsx)(oa,{options:[{value:"hachure",text:b("labels.hachure"),icon:(0,v.jsx)(es,{theme:n.theme})},{value:"cross-hatch",text:b("labels.crossHatch"),icon:(0,v.jsx)(ts,{theme:n.theme})},{value:"solid",text:b("labels.solid"),icon:(0,v.jsx)(ns,{theme:n.theme})}],group:"fill",value:Gs(t,n,(e=>e.fillStyle),n.currentItemFillStyle),onChange:e=>{r(e)}})]})}}),Ks({name:"changeStrokeWidth",perform:(e,t,n)=>({elements:Vs(e,t,(e=>Pr(e,{strokeWidth:n}))),appState:Object.assign(Object.assign({},t),{currentItemStrokeWidth:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsxs)("fieldset",{children:[(0,v.jsx)("legend",{children:b("labels.strokeWidth")}),(0,v.jsx)(oa,{group:"stroke-width",options:[{value:1,text:b("labels.thin"),icon:(0,v.jsx)(rs,{theme:n.theme,strokeWidth:2})},{value:2,text:b("labels.bold"),icon:(0,v.jsx)(rs,{theme:n.theme,strokeWidth:6})},{value:4,text:b("labels.extraBold"),icon:(0,v.jsx)(rs,{theme:n.theme,strokeWidth:10})}],value:Gs(t,n,(e=>e.strokeWidth),n.currentItemStrokeWidth),onChange:e=>r(e)})]})}}),Ks({name:"changeSloppiness",perform:(e,t,n)=>({elements:Vs(e,t,(e=>Pr(e,{seed:Or(),roughness:n}))),appState:Object.assign(Object.assign({},t),{currentItemRoughness:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsxs)("fieldset",{children:[(0,v.jsx)("legend",{children:b("labels.sloppiness")}),(0,v.jsx)(oa,{group:"sloppiness",options:[{value:0,text:b("labels.architect"),icon:(0,v.jsx)(ss,{theme:n.theme})},{value:1,text:b("labels.artist"),icon:(0,v.jsx)(ls,{theme:n.theme})},{value:2,text:b("labels.cartoonist"),icon:(0,v.jsx)(cs,{theme:n.theme})}],value:Gs(t,n,(e=>e.roughness),n.currentItemRoughness),onChange:e=>r(e)})]})}}),Ks({name:"changeStrokeStyle",perform:(e,t,n)=>({elements:Vs(e,t,(e=>Pr(e,{strokeStyle:n}))),appState:Object.assign(Object.assign({},t),{currentItemStrokeStyle:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsxs)("fieldset",{children:[(0,v.jsx)("legend",{children:b("labels.strokeStyle")}),(0,v.jsx)(oa,{group:"strokeStyle",options:[{value:"solid",text:b("labels.strokeStyle_solid"),icon:(0,v.jsx)(is,{theme:n.theme})},{value:"dashed",text:b("labels.strokeStyle_dashed"),icon:(0,v.jsx)(os,{theme:n.theme})},{value:"dotted",text:b("labels.strokeStyle_dotted"),icon:(0,v.jsx)(as,{theme:n.theme})}],value:Gs(t,n,(e=>e.strokeStyle),n.currentItemStrokeStyle),onChange:e=>r(e)})]})}}),Ks({name:"changeOpacity",perform:(e,t,n)=>({elements:Vs(e,t,(e=>Pr(e,{opacity:n}))),appState:Object.assign(Object.assign({},t),{currentItemOpacity:n}),commitToHistory:!0}),PanelComponent:e=>{var t;let{elements:n,appState:r,updateData:i}=e;return(0,v.jsxs)("label",{className:"control-label",children:[b("labels.opacity"),(0,v.jsx)("input",{type:"range",min:"0",max:"100",step:"10",onChange:e=>i(+e.target.value),onWheel:e=>{e.stopPropagation();const t=+e.target.value;e.deltaY<0&&t<100?i(t+10):e.deltaY>0&&t>0&&i(t-10)},value:null!==(t=Gs(n,r,(e=>e.opacity),r.currentItemOpacity))&&void 0!==t?t:void 0})]})}}),Ks({name:"changeFontSize",perform:(e,t,n)=>Ys(e,t,(()=>n),n),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsxs)("fieldset",{children:[(0,v.jsx)("legend",{children:b("labels.fontSize")}),(0,v.jsx)(oa,{group:"font-size",options:[{value:16,text:b("labels.small"),icon:(0,v.jsx)(bs,{theme:n.theme}),testId:"fontSize-small"},{value:20,text:b("labels.medium"),icon:(0,v.jsx)(vs,{theme:n.theme}),testId:"fontSize-medium"},{value:28,text:b("labels.large"),icon:(0,v.jsx)(xs,{theme:n.theme}),testId:"fontSize-large"},{value:36,text:b("labels.veryLarge"),icon:(0,v.jsx)(ys,{theme:n.theme}),testId:"fontSize-veryLarge"}],value:Gs(t,n,(e=>{if(Ce(e))return e.fontSize;const t=er(e);return t?t.fontSize:null}),n.currentItemFontSize||o.n5),onChange:e=>r(e)})]})}}),Ks({name:"decreaseFontSize",perform:(e,t,n)=>Ys(e,t,(e=>Math.round(1/1.1*e.fontSize))),keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.shiftKey&&(e.key===Lt.CHEVRON_LEFT||e.key===Lt.COMMA)})),Zs=Ks({name:"increaseFontSize",perform:(e,t,n)=>Ys(e,t,(e=>Math.round(1.1*e.fontSize))),keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.shiftKey&&(e.key===Lt.CHEVRON_RIGHT||e.key===Lt.PERIOD)});Ks({name:"changeFontFamily",perform:(e,t,n)=>({elements:Vs(e,t,(e=>{if(Ce(e)){const t=Pr(e,{fontFamily:n});return Nn(t,tr(e)),t}return e}),!0),appState:Object.assign(Object.assign({},t),{currentItemFontFamily:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;const i=[{value:o.ut.Virgil,text:b("labels.handDrawn"),icon:(0,v.jsx)(ws,{theme:n.theme})},{value:o.ut.Helvetica,text:b("labels.normal"),icon:(0,v.jsx)(ks,{theme:n.theme})},{value:o.ut.Cascadia,text:b("labels.code"),icon:(0,v.jsx)(_s,{theme:n.theme})}];return(0,v.jsxs)("fieldset",{children:[(0,v.jsx)("legend",{children:b("labels.fontFamily")}),(0,v.jsx)(oa,{group:"font-family",options:i,value:Gs(t,n,(e=>{if(Ce(e))return e.fontFamily;const t=er(e);return t?t.fontFamily:null}),n.currentItemFontFamily||o.rk),onChange:e=>r(e)})]})}}),Ks({name:"changeTextAlign",perform:(e,t,n)=>({elements:Vs(e,t,(e=>{if(Ce(e)){const t=Pr(e,{textAlign:n});return Nn(t,tr(e)),t}return e}),!0),appState:Object.assign(Object.assign({},t),{currentItemTextAlign:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsxs)("fieldset",{children:[(0,v.jsx)("legend",{children:b("labels.textAlign")}),(0,v.jsx)(oa,{group:"text-align",options:[{value:"left",text:b("labels.left"),icon:(0,v.jsx)(Cs,{theme:n.theme})},{value:"center",text:b("labels.center"),icon:(0,v.jsx)(Es,{theme:n.theme})},{value:"right",text:b("labels.right"),icon:(0,v.jsx)(Ss,{theme:n.theme})}],value:Gs(t,n,(e=>{if(Ce(e))return e.textAlign;const t=er(e);return t?t.textAlign:null}),n.currentItemTextAlign),onChange:e=>r(e)})]})}}),Ks({name:"changeVerticalAlign",perform:(e,t,n)=>({elements:Vs(e,t,(e=>{if(Ce(e)){const t=Pr(e,{verticalAlign:n});return Nn(t,tr(e)),t}return e}),!0),appState:Object.assign({},t),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)("fieldset",{children:(0,v.jsx)(oa,{group:"text-align",options:[{value:o.oX.TOP,text:b("labels.alignTop"),icon:(0,v.jsx)(js,{theme:n.theme})},{value:o.oX.MIDDLE,text:b("labels.centerVertically"),icon:(0,v.jsx)(Ts,{theme:n.theme})},{value:o.oX.BOTTOM,text:b("labels.alignBottom"),icon:(0,v.jsx)(Is,{theme:n.theme})}],value:Gs(t,n,(e=>{if(Ce(e)&&e.containerId)return e.verticalAlign;const t=er(e);return t?t.verticalAlign:null})),onChange:e=>r(e)})})}}),Ks({name:"changeSharpness",perform:(e,t,n)=>{const r=Pl(El(e),t),i=r.length?r.every((e=>!je(e))):!Ie(t.elementType),o=r.length?r.every(je):Ie(t.elementType);return{elements:Vs(e,t,(e=>Pr(e,{strokeSharpness:n}))),appState:Object.assign(Object.assign({},t),{currentItemStrokeSharpness:i?n:t.currentItemStrokeSharpness,currentItemLinearStrokeSharpness:o?n:t.currentItemLinearStrokeSharpness}),commitToHistory:!0}},PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsxs)("fieldset",{children:[(0,v.jsx)("legend",{children:b("labels.edges")}),(0,v.jsx)(oa,{group:"edges",options:[{value:"sharp",text:b("labels.sharp"),icon:(0,v.jsx)(ds,{theme:n.theme})},{value:"round",text:b("labels.round"),icon:(0,v.jsx)(us,{theme:n.theme})}],value:Gs(t,n,(e=>e.strokeSharpness),Hs(n.elementType)&&(Ie(n.elementType)?n.currentItemLinearStrokeSharpness:n.currentItemStrokeSharpness)||null),onChange:e=>r(e)})]})}}),Ks({name:"changeArrowhead",perform:(e,t,n)=>({elements:Vs(e,t,(e=>{if(je(e)){const{position:t,type:r}=n;if("start"===t){return Pr(e,{startArrowhead:r})}if("end"===t){return Pr(e,{endArrowhead:r})}}return e})),appState:Object.assign(Object.assign({},t),{["start"===n.position?"currentItemStartArrowhead":"currentItemEndArrowhead"]:n.type}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;const i=m().rtl;return(0,v.jsxs)("fieldset",{children:[(0,v.jsx)("legend",{children:b("labels.arrowheads")}),(0,v.jsxs)("div",{className:"iconSelectList",children:[(0,v.jsx)(ga,{label:"arrowhead_start",options:[{value:null,text:b("labels.arrowhead_none"),icon:(0,v.jsx)(hs,{theme:n.theme}),keyBinding:"q"},{value:"arrow",text:b("labels.arrowhead_arrow"),icon:(0,v.jsx)(ps,{theme:n.theme,flip:!i}),keyBinding:"w"},{value:"bar",text:b("labels.arrowhead_bar"),icon:(0,v.jsx)(ms,{theme:n.theme,flip:!i}),keyBinding:"e"},{value:"dot",text:b("labels.arrowhead_dot"),icon:(0,v.jsx)(gs,{theme:n.theme,flip:!i}),keyBinding:"r"},{value:"triangle",text:b("labels.arrowhead_triangle"),icon:(0,v.jsx)(fs,{theme:n.theme,flip:!i}),keyBinding:"t"}],value:Gs(t,n,(e=>je(e)&&Bs(e.type)?e.startArrowhead:n.currentItemStartArrowhead),n.currentItemStartArrowhead),onChange:e=>r({position:"start",type:e})}),(0,v.jsx)(ga,{label:"arrowhead_end",group:"arrowheads",options:[{value:null,text:b("labels.arrowhead_none"),keyBinding:"q",icon:(0,v.jsx)(hs,{theme:n.theme})},{value:"arrow",text:b("labels.arrowhead_arrow"),keyBinding:"w",icon:(0,v.jsx)(ps,{theme:n.theme,flip:i})},{value:"bar",text:b("labels.arrowhead_bar"),keyBinding:"e",icon:(0,v.jsx)(ms,{theme:n.theme,flip:i})},{value:"dot",text:b("labels.arrowhead_dot"),keyBinding:"r",icon:(0,v.jsx)(gs,{theme:n.theme,flip:i})},{value:"triangle",text:b("labels.arrowhead_triangle"),icon:(0,v.jsx)(fs,{theme:n.theme,flip:i}),keyBinding:"t"}],value:Gs(t,n,(e=>je(e)&&Bs(e.type)?e.endArrowhead:n.currentItemEndArrowhead),n.currentItemEndArrowhead),onChange:e=>r({position:"end",type:e})})]})]})}});n(5422);class qs extends Error{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Couldn't export canvas.",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"CANVAS_ERROR";super(),this.name=t,this.message=e}}class $s extends DOMException{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Request Aborted","AbortError")}}n(371);const Qs=e=>{let{size:t="1em",circleWidth:n=8}=e;return(0,v.jsx)("div",{className:"Spinner",children:(0,v.jsx)("svg",{viewBox:"0 0 100 100",style:{width:t,height:t},children:(0,v.jsx)("circle",{cx:"50",cy:"50",r:50-n/2,strokeWidth:n,fill:"none",strokeMiterlimit:"10"})})})},Js=i().forwardRef(((e,t)=>{const{id:n}=pp(),o=i().useRef(null);i().useImperativeHandle(t,(()=>o.current));const a="ToolIcon_size_".concat(e.size),[s,l]=(0,r.useState)(!1),c=(0,r.useRef)(!0),d=async t=>{var n;const r="onClick"in e&&(null===(n=e.onClick)||void 0===n?void 0:n.call(e,t));if(r&&"then"in r)try{l(!0),await r}catch(e){if(!(e instanceof $s))throw e;console.warn(e)}finally{c.current&&l(!1)}};(0,r.useEffect)((()=>()=>{c.current=!1}),[]);const u=(0,r.useRef)(null);if("button"===e.type||"icon"===e.type||"submit"===e.type){const t="icon"===e.type?"button":e.type;return(0,v.jsxs)("button",{className:ye("ToolIcon_type_button",a,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:t,onClick:d,ref:o,disabled:s||e.isLoading,children:[(e.icon||e.label)&&(0,v.jsxs)("div",{className:"ToolIcon__icon","aria-hidden":"true",children:[e.icon||e.label,e.keyBindingLabel&&(0,v.jsx)("span",{className:"ToolIcon__keybinding",children:e.keyBindingLabel}),e.isLoading&&(0,v.jsx)(Qs,{})]}),e.showAriaLabel&&(0,v.jsxs)("div",{className:"ToolIcon__label",children:[e["aria-label"]," ",s&&(0,v.jsx)(Qs,{})]}),e.children]})}return(0,v.jsxs)("label",{className:ye("ToolIcon",e.className),title:e.title,onPointerDown:e=>{u.current=e.pointerType||null},onPointerUp:()=>{requestAnimationFrame((()=>{u.current=null}))},children:[(0,v.jsx)("input",{className:"ToolIcon_type_radio ".concat(a),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:()=>{var t;null===(t=e.onChange)||void 0===t||t.call(e,{pointerType:u.current})},checked:e.checked,ref:o}),(0,v.jsxs)("div",{className:"ToolIcon__icon",children:[e.icon,e.keyBindingLabel&&(0,v.jsx)("span",{className:"ToolIcon__keybinding",children:e.keyBindingLabel})]})]})}));Js.defaultProps={visible:!0,className:"",size:"medium"};const el=e=>{const t=e.title||("dark"===e.value?b("buttons.lightMode"):b("buttons.darkMode"));return(0,v.jsx)(Js,{type:"icon",icon:e.value===o.C6.LIGHT?tl.MOON:tl.SUN,title:t,"aria-label":t,onClick:()=>e.onChange(e.value===o.C6.DARK?o.C6.LIGHT:o.C6.DARK),"data-testid":"toggle-dark-mode"})},tl={SUN:(0,v.jsx)("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:(0,v.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,v.jsx)("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:(0,v.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"})})},nl=e=>{let{scenePoint:t,viewportDimensions:n,zoom:r}=e;return{scrollX:n.width/2*(1/r.value)-t.x,scrollY:n.height/2*(1/r.value)-t.y}},rl=(e,t,n)=>{if(!(e=Cl(e)).length)return{scrollX:0,scrollY:0};let[r,i,o,a]=et(e);((e,t,n)=>{const[r,i,o,a]=n,{x:s,y:l}=$t({sceneX:r,sceneY:i},e),{x:c,y:d}=$t({sceneX:o,sceneY:a},e);return c-s>e.width||d-l>e.height})(t,0,[r,i,o,a])&&([r,i,o,a]=((e,t)=>{if(!e.length)return[0,0,0,0];let n=1/0,r=e[0];return e.forEach((e=>{const[i,o,a,s]=Je(e),l=He((i+a)/2,(o+s)/2,t.x,t.y);l<n&&(n=l,r=e)})),Je(r)})(e,qt({clientX:t.scrollX,clientY:t.scrollY},t)));return nl({scenePoint:{x:(r+o)/2,y:(i+a)/2},viewportDimensions:{width:t.width,height:t.height},zoom:t.zoom})},il=e=>Math.max(.1,Math.min(e,30)),ol=(e,t)=>{let{viewportX:n,viewportY:r,nextZoom:i}=e;const o=n-t.offsetLeft,a=r-t.offsetTop,s=t.zoom.value;return{scrollX:t.scrollX+(o-o/s)+-(o-o/i),scrollY:t.scrollY+(a-a/s)+-(a-a/i),zoom:{value:i}}};n(6781);const al=()=>{const e=document.querySelector(".excalidraw-tooltip");if(e)return e;const t=document.createElement("div");return document.body.appendChild(t),t.classList.add("excalidraw-tooltip"),t},sl=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"bottom";const r=e.getBoundingClientRect(),i=window.innerWidth,o=window.innerHeight,a=5;let s,l=t.left+t.width/2-r.width/2;l<0?l=a:l+r.width>=i&&(l=i-r.width-a),"bottom"===n?(s=t.top+t.height+a,s+r.height>=o&&(s=t.top-r.height-a)):(s=t.top-r.height-a,s<0&&(s=t.top+t.height+a)),Object.assign(e.style,{top:"".concat(s,"px"),left:"".concat(l,"px")})},ll=e=>{let{children:t,label:n,long:i=!1,style:o}=e;return(0,r.useEffect)((()=>()=>al().classList.remove("excalidraw-tooltip--visible")),[]),(0,v.jsx)("div",{className:"excalidraw-tooltip-wrapper",onPointerEnter:e=>((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;const i=e.getBoundingClientRect();sl(t,i)})(e.currentTarget,al(),n,i),onPointerLeave:()=>al().classList.remove("excalidraw-tooltip--visible"),style:o,children:t})};n(196),n(1106);const cl=i().forwardRef(((e,t)=>{let{children:n,padding:r,className:i,style:o}=e;return(0,v.jsx)("div",{className:ye("Island",i),style:Object.assign({"--padding":r},o),ref:t,children:n})}));n(8328);const dl=e=>{const{theme:t=o.C6.LIGHT,closeOnClickOutside:n=!0}=e,r=ul(t);if(!r)return null;return(0,st.createPortal)((0,v.jsxs)("div",{className:ye("Modal",e.className),role:"dialog","aria-modal":"true",onKeyDown:t=>{t.key===Lt.ESCAPE&&(t.nativeEvent.stopImmediatePropagation(),t.stopPropagation(),e.onCloseRequest())},"aria-labelledby":e.labelledBy,children:[(0,v.jsx)("div",{className:"Modal__background",onClick:n?e.onCloseRequest:void 0}),(0,v.jsx)("div",{className:"Modal__content",style:{"--max-width":"".concat(e.maxWidth,"px")},tabIndex:0,children:e.children})]}),r)},ul=e=>{const[t,n]=(0,r.useState)(null),i=up(),o=(0,r.useRef)(i);o.current=i;const{container:a}=pp();return(0,r.useLayoutEffect)((()=>{t&&t.classList.toggle("excalidraw--mobile",i)}),[t,i]),(0,r.useLayoutEffect)((()=>{const t=!(null==a||!a.classList.contains("theme--dark"))||"dark"===e,r=document.createElement("div");return r.classList.add("excalidraw","excalidraw-modal-container"),r.classList.toggle("excalidraw--mobile",o.current),t&&(r.classList.add("theme--dark"),r.classList.add("theme--dark-background-none")),document.body.appendChild(r),n(r),()=>{document.body.removeChild(r)}}),[a,e]),t},hl=e=>{const[t,n]=(()=>{const[e,t]=(0,r.useState)(null);return[e,(0,r.useCallback)((e=>t(e)),[])]})(),[i]=(0,r.useState)(document.activeElement),{id:o}=pp();(0,r.useEffect)((()=>{if(!t)return;const n=a(t);n.length>0&&!1!==e.autofocus&&(n[1]||n[0]).focus();const r=e=>{if(e.key===Lt.TAB){const n=a(t),{activeElement:r}=document,i=n.findIndex((e=>e===r));0===i&&e.shiftKey?(n[n.length-1].focus(),e.preventDefault()):i!==n.length-1||e.shiftKey||(n[0].focus(),e.preventDefault())}};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)}),[t,e.autofocus]);const a=e=>{const t=e.querySelectorAll("button, a, input, select, textarea, div[tabindex]");return t?Array.from(t):[]},s=()=>{i.focus(),e.onCloseRequest()};return(0,v.jsx)(dl,{className:ye("Dialog",e.className),labelledBy:"dialog-title",maxWidth:e.small?550:800,onCloseRequest:s,theme:e.theme,closeOnClickOutside:e.closeOnClickOutside,children:(0,v.jsxs)(cl,{ref:n,children:[(0,v.jsxs)("h2",{id:"".concat(o,"-dialog-title"),className:"Dialog__title",children:[(0,v.jsx)("span",{className:"Dialog__titleContent",children:e.title}),(0,v.jsx)("button",{className:"Modal__close",onClick:s,"aria-label":b("buttons.close"),children:up()?Za:Xa})]}),(0,v.jsx)("div",{className:"Dialog__content",children:e.children})]})})};n(4678);var pl=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const gl=e=>{const{onConfirm:t,onCancel:n,children:r,confirmText:i=b("buttons.confirm"),cancelText:o=b("buttons.cancel"),className:a=""}=e,s=pl(e,["onConfirm","onCancel","children","confirmText","cancelText","className"]);return(0,v.jsxs)(hl,Object.assign(Object.assign({onCloseRequest:n,small:!0},s),{className:"confirm-dialog ".concat(a),children:[r,(0,v.jsxs)("div",{className:"confirm-dialog-buttons",children:[(0,v.jsx)(Js,{type:"button",title:o,"aria-label":o,label:o,onClick:n,className:"confirm-dialog--cancel"}),(0,v.jsx)(Js,{type:"button",title:i,"aria-label":i,label:i,onClick:t,className:"confirm-dialog--confirm"})]})]}))},ml=e=>{let{onConfirm:t}=e;const[n,i]=(0,r.useState)(!1),o=()=>{i(!n)};return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(Js,{type:"button",icon:Ca,title:b("buttons.clearReset"),"aria-label":b("buttons.clearReset"),showAriaLabel:up(),onClick:o,"data-testid":"clear-canvas-button"}),n&&(0,v.jsx)(gl,{onConfirm:()=>{t(),o()},onCancel:o,title:b("clearCanvasDialog.title"),children:(0,v.jsxs)("p",{className:"clear-canvas__content",children:[" ",b("alerts.clearReset")]})})]})},fl=(Ks({name:"changeViewBackgroundColor",perform:(e,t,n)=>({appState:Object.assign(Object.assign({},t),n),commitToHistory:!!n.viewBackgroundColor}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)("div",{style:{position:"relative"},children:(0,v.jsx)(ha,{label:b("labels.canvasBackground"),type:"canvasBackground",color:n.viewBackgroundColor,onChange:e=>r({viewBackgroundColor:e}),isActive:"canvasColorPicker"===n.openPopup,setActive:e=>r({openPopup:e?"canvasColorPicker":null}),"data-testid":"canvas-background-picker",elements:t,appState:n})})}}),Ks({name:"clearCanvas",perform:(e,t,n,r)=>(r.imageCache.clear(),{elements:e.map((e=>Pr(e,{isDeleted:!0}))),appState:Object.assign(Object.assign({},hn()),{files:{},theme:t.theme,elementLocked:t.elementLocked,penMode:t.penMode,penDetected:t.penDetected,exportBackground:t.exportBackground,exportEmbedScene:t.exportEmbedScene,gridSize:t.gridSize,showStats:t.showStats,pasteDialog:t.pasteDialog,elementType:"image"===t.elementType?"selection":t.elementType}),commitToHistory:!0}),PanelComponent:e=>{let{updateData:t}=e;return(0,v.jsx)(ml,{onConfirm:t})}}),Ks({name:"zoomIn",perform:(e,t,n,r)=>({appState:Object.assign(Object.assign({},t),ol({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:il(t.zoom.value+o.V4)},t)),commitToHistory:!1}),PanelComponent:e=>{let{updateData:t}=e;return(0,v.jsx)(Js,{type:"button",icon:Ia,title:"".concat(b("buttons.zoomIn")," — ").concat(Zt("CtrlOrCmd++")),"aria-label":b("buttons.zoomIn"),onClick:()=>{t(null)},size:"small"})},keyTest:e=>(e.code===ut||e.code===pt)&&(e[Lt.CTRL_OR_CMD]||e.shiftKey)})),bl=Ks({name:"zoomOut",perform:(e,t,n,r)=>({appState:Object.assign(Object.assign({},t),ol({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:il(t.zoom.value-o.V4)},t)),commitToHistory:!1}),PanelComponent:e=>{let{updateData:t}=e;return(0,v.jsx)(Js,{type:"button",icon:Ta,title:"".concat(b("buttons.zoomOut")," — ").concat(Zt("CtrlOrCmd+-")),"aria-label":b("buttons.zoomOut"),onClick:()=>{t(null)},size:"small"})},keyTest:e=>(e.code===ht||e.code===gt)&&(e[Lt.CTRL_OR_CMD]||e.shiftKey)}),vl=(Ks({name:"resetZoom",perform:(e,t,n,r)=>({appState:Object.assign(Object.assign({},t),ol({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:il(1)},t)),commitToHistory:!1}),PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,v.jsx)(ll,{label:b("buttons.resetZoom"),style:{height:"100%"},children:(0,v.jsxs)(Js,{type:"button",className:"reset-zoom-button",title:b("buttons.resetZoom"),"aria-label":b("buttons.resetZoom"),onClick:()=>{t(null)},size:"small",children:[(100*n.zoom.value).toFixed(0),"%"]})})},keyTest:e=>(e.code===wt||e.code===mt)&&(e[Lt.CTRL_OR_CMD]||e.shiftKey)}),(e,t)=>{const[n,r,i,a]=e,s=i-n,l=t.width/s,c=a-r,d=t.height/c,u=Math.min(l,d),h=Math.floor(u/o.V4)*o.V4;return Math.min(Math.max(h,o.V4),1)}),xl=(e,t,n)=>{const r=El(e),i=Al(r,t),o=n&&i.length>0?et(i):et(r),a={value:vl(o,{width:t.width,height:t.height})},[s,l,c,d]=o,u=(s+c)/2,h=(l+d)/2;return{appState:Object.assign(Object.assign(Object.assign({},t),nl({scenePoint:{x:u,y:h},viewportDimensions:{width:t.width,height:t.height},zoom:a})),{zoom:a}),commitToHistory:!1}},yl=(Ks({name:"zoomToSelection",perform:(e,t)=>xl(e,t,!0),keyTest:e=>e.code===xt&&e.shiftKey&&!e.altKey&&!e[Lt.CTRL_OR_CMD]}),Ks({name:"zoomToFit",perform:(e,t)=>xl(e,t,!1),keyTest:e=>e.code===vt&&e.shiftKey&&!e.altKey&&!e[Lt.CTRL_OR_CMD]}),Ks({name:"toggleTheme",perform:(e,t,n)=>({appState:Object.assign(Object.assign({},t),{theme:n||(t.theme===o.C6.LIGHT?o.C6.DARK:o.C6.LIGHT)}),commitToHistory:!1}),PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,v.jsx)("div",{style:{marginInlineStart:"0.25rem"},children:(0,v.jsx)(el,{value:t.theme,onChange:e=>{n(e)}})})},keyTest:e=>e.altKey&&e.shiftKey&&e.code===Ct}),Ks({name:"eraser",perform:(e,t)=>({appState:Object.assign(Object.assign({},t),{selectedElementIds:{},selectedGroupIds:{},elementType:vn(t)?"selection":"eraser"}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r,data:i}=e;return(0,v.jsx)(Js,{type:"button",icon:Ls,className:ye("eraser",{active:vn(n)}),title:b("toolBar.eraser"),"aria-label":b("toolBar.eraser"),onClick:()=>{r(null)},size:(null==i?void 0:i.size)||"medium"})}}),(e,t,n,r,i,o)=>{const{zoom:a}=r,s=180*n/Math.PI;let l=e*(a.value-1)/2,c=t*(a.value-1)/2;return e>i&&1!==a.value&&(l=i*(a.value-1)/2),t>o&&1!==a.value&&(c=o*(a.value-1)/2),"translate(".concat(l,"px, ").concat(c,"px) scale(").concat(a.value,") rotate(").concat(s,"deg)")}),wl=e=>{let{id:t,onChange:n,onSubmit:r,getViewportCoords:i,element:a,canvas:s,excalidrawContainer:l,app:c}=e;let d;const u=()=>{var e;const n=c.state,r=null===(e=Hn.getScene(a))||void 0===e?void 0:e.getElement(t),{textAlign:s,verticalAlign:l}=r,u=Vn(Ut(r));if(r&&Ce(r)){let e=r.x,t=r.y;const a=tr(r);let c=r.width,p=r.height,g=r.width,m=r.height;if(a&&r.containerId){const n=((e,t)=>{const n=t.style.fontFamily.replace(/"/g,"");return Ft({fontFamily:e.fontFamily})!==n||"".concat(e.fontSize,"px")!==t.style.fontSize})(r,h),i=Number(h.style.height.slice(0,-2));if(i>0&&(m=i),n&&(d=a.height,m=r.height),d||(d=a.height),c=a.width-2*o.gK,p=a.height-2*o.gK,g=c,e=a.x+o.gK,m>p){const e=Math.min(m-p,u);return void Ar(a,{height:a.height+e})}if(a.height>d&&m<p){const e=Math.min(p-m,u);Ar(a,{height:a.height-e})}else l===o.oX.MIDDLE&&(t=a.y+a.height/2-m/2),l===o.oX.BOTTOM&&(t=a.y+a.height-m-o.gK)}const[f,b]=i(e,t),v=h.selectionStart,x=h.selectionEnd,y=h.value.length;if(h.value=r.originalText,v===x&&x!==y){const e=y-x;h.selectionStart=h.value.length-e,h.selectionEnd=h.value.length-e}const w=r.originalText.split("\n"),k=r.containerId?u:r.height/w.length;a||(c=(n.width-8-f)/n.zoom.value);const _=(n.height-b)/n.zoom.value,C=a?a.angle:r.angle;Object.assign(h.style,{font:Ut(r),lineHeight:"".concat(k,"px"),width:"".concat(g,"px"),height:"".concat(m,"px"),left:"".concat(f,"px"),top:"".concat(b,"px"),transform:yl(g,m,C,n,c,_),textAlign:s,verticalAlign:l,color:r.strokeColor,opacity:r.opacity/100,filter:"var(--theme-filter)",maxWidth:"".concat(c,"px"),maxHeight:"".concat(_,"px")}),cn()&&(h.style.fontFamily=Ft(r)),Ar(r,{x:e,y:t})}},h=document.createElement("textarea");h.dir="auto",h.tabIndex=0,h.dataset.type="wysiwyg",h.wrap="off",h.classList.add("excalidraw-wysiwyg");let p="pre",g="normal";Pe(a)&&(p="pre-wrap",g="break-word"),Object.assign(h.style,{position:"absolute",display:"inline-block",minHeight:"1em",backfaceVisibility:"hidden",margin:0,padding:0,border:0,outline:0,resize:"none",background:"transparent",overflow:"hidden",zIndex:"var(--zIndex-wysiwyg)",wordBreak:g,whiteSpace:p,overflowWrap:"break-word"}),u(),n&&(h.oninput=()=>{var e;const r=null===(e=Hn.getScene(a))||void 0===e?void 0:e.getElement(t),i=Ut(r),o=h.scrollHeight/Vn(i);if(Pe(a)&&o>1){let e="auto";if(2===o){const t=tr(a);1===Xn(h.value,i,t.width).split("\n").length&&(e="".concat(h.scrollHeight/2,"px"))}h.style.height=e,h.style.height="".concat(h.scrollHeight,"px")}n(h.value.replace(/\t/g," ").replace(/\r?\n|\r/g,"\n"))}),h.onkeydown=e=>{if(e.stopPropagation(),!e.shiftKey&&fl.keyTest(e))e.preventDefault(),c.actionManager.executeAction(fl),u();else if(!e.shiftKey&&bl.keyTest(e))e.preventDefault(),c.actionManager.executeAction(bl),u();else if(Xs.keyTest(e))c.actionManager.executeAction(Xs);else if(Zs.keyTest(e))c.actionManager.executeAction(Zs);else if(e.key===Lt.ESCAPE)e.preventDefault(),w=!0,k();else if(e.key===Lt.ENTER&&e[Lt.CTRL_OR_CMD]){if(e.preventDefault(),e.isComposing||229===e.keyCode)return;w=!0,k()}else(e.key===Lt.TAB||e[Lt.CTRL_OR_CMD]&&(e.code===bt||e.code===ft))&&(e.preventDefault(),e.shiftKey||e.code===bt?v():b(),h.dispatchEvent(new Event("input")))};const m=" ".repeat(4),f=new RegExp("^ {1,".concat(4,"}")),b=()=>{const{selectionStart:e,selectionEnd:t}=h,n=x();let r=h.value;n.forEach((e=>{const t=r.slice(0,e),n=r.slice(e);r="".concat(t).concat(m).concat(n)})),h.value=r,h.selectionStart=e+4,h.selectionEnd=t+4*n.length},v=()=>{const{selectionStart:e,selectionEnd:t}=h,n=x(),r=[];let i=h.value;n.forEach((e=>{const t=i.slice(e,e+4).match(f);if(t){const n=i.slice(0,e),o=i.slice(e+t[0].length);i="".concat(n).concat(o),r.push(e)}})),h.value=i,r.length&&(e>r[r.length-1]?h.selectionStart=Math.max(e-4,r[r.length-1]):h.selectionStart=e,h.selectionEnd=Math.max(h.selectionStart,t-4*r.length))},x=()=>{let{selectionStart:e,selectionEnd:t,value:n}=h;const r=n.slice(0,e).match(/[^\n]*$/)[0].length;e-=r;return n.slice(e,t).split("\n").reduce(((t,n,r,i)=>t.concat(r?t[r-1]+i[r-1].length+1:e)),[]).reverse()},y=e=>{e.preventDefault(),e.stopPropagation()};let w=!1;const k=()=>{var e;_();const t=null===(e=Hn.getScene(a))||void 0===e?void 0:e.getElement(a.id);if(!t)return;let n=h.value;const i=tr(t);if(i)if(n=t.text,h.value){const e=Jn(i);e&&e===a.id||Ar(i,{boundElements:(i.boundElements||[]).concat({type:"text",id:a.id})})}else{var o;Ar(i,{boundElements:null===(o=i.boundElements)||void 0===o?void 0:o.filter((e=>!Ce(e)))})}r({text:n,viaKeyboard:w,originalText:h.value})},_=()=>{j||(j=!0,h.onblur=null,h.oninput=null,h.onkeydown=null,I&&I.disconnect(),window.removeEventListener("resize",u),window.removeEventListener("wheel",y,!0),window.removeEventListener("pointerdown",E),window.removeEventListener("pointerup",C),window.removeEventListener("blur",k),S(),h.remove())},C=e=>{window.removeEventListener("pointerup",C);const t=null==e?void 0:e.target,n=t instanceof HTMLInputElement&&t.closest(".color-picker-input")&&Bt(t);setTimeout((()=>{h.onblur=k,t&&n&&(t.onblur=()=>{h.focus()}),n||h.focus()}))},E=e=>{const t=e.target instanceof HTMLInputElement&&e.target.closest(".color-picker-input")&&Bt(e.target);((e.target instanceof HTMLElement||e.target instanceof SVGElement)&&e.target.closest(".".concat(o.$C.SHAPE_ACTIONS_MENU))&&!Bt(e.target)||t)&&(h.onblur=null,window.addEventListener("pointerup",C),window.addEventListener("blur",k))},S=Hn.getScene(a).addCallback((()=>{var e;u();!(null===(e=document.activeElement)||void 0===e||!e.closest(".color-picker-input"))||h.focus()}));let j=!1;h.select(),C();let I=null;s&&"ResizeObserver"in window?(I=new window.ResizeObserver((()=>{u()})),I.observe(s)):window.addEventListener("resize",u),window.addEventListener("pointerdown",E),window.addEventListener("wheel",y,{passive:!1,capture:!0}),null==l||l.querySelector(".excalidraw-textEditorContainer").appendChild(h)},kl=(e,t)=>Boolean(!e.viewModeEnabled&&(e.editingElement||Al(t,e).length||"selection"!==e.elementType&&"eraser"!==e.elementType)),_l=e=>e.reduce(((e,t)=>e+t.version),0),Cl=e=>e.filter((e=>!e.isDeleted&&!zr(e))),El=e=>e.filter((e=>!e.isDeleted)),Sl=e=>!e.isDeleted,jl=e=>El(e).map((e=>Ie(e.type)?Object.assign(Object.assign({},e),{lastCommittedPoint:null}):e)),Il=e=>jl(e),Tl=e=>jl(e),Ml=(e,t,n)=>{const[r,i]=[e.horizontal,e.vertical].map((e=>null!=e&&e.x<=t&&t<=e.x+e.width&&e.y<=n&&n<=e.y+e.height));return{isOverEither:r||i,isOverHorizontal:r,isOverVertical:i}},Ol=(e,t)=>e.some((e=>t.selectedElementIds[e.id])),Ll=(e,t,n)=>{const r=Array.from(new Set(Al(e,t).map((e=>n(e)))));return 1===r.length?r[0]:null},Al=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return e.filter((e=>t.selectedElementIds[e.id]||n&&Pe(e)&&t.selectedElementIds[null==e?void 0:e.containerId]?e:null))},Pl=(e,t)=>t.editingElement?[t.editingElement]:Al(e,t,!0),Dl=(e,t)=>{if(e.editingGroupId){const n=Vr(El(t),e.editingGroupId);if(n.length)return Object.assign(Object.assign({},e),{selectedElementIds:{[n[0].id]:!0}})}return e},zl=Ks({name:"deleteSelectedElements",perform:(e,t)=>{if(t.editingLinearElement){const{elementId:n,selectedPointsIndices:r,startBindingElement:i,endBindingElement:o}=t.editingLinearElement,a=xo.getElement(n);if(!a)return!1;if(null==r||a.points.length<2){const n=e.filter((e=>e.id!==a.id)),r=Dl(t,n);return{elements:n,appState:Object.assign(Object.assign({},r),{editingLinearElement:null}),commitToHistory:!1}}const s={startBindingElement:null!=r&&r.includes(0)?null:i,endBindingElement:null!=r&&r.includes(a.points.length-1)?null:o};return xo.deletePoints(a,r),{elements:e,appState:Object.assign(Object.assign({},t),{editingLinearElement:Object.assign(Object.assign(Object.assign({},t.editingLinearElement),s),{selectedPointsIndices:(null==r?void 0:r[0])>0?[r[0]-1]:[0]})}),commitToHistory:!0}}let{elements:n,appState:r}=((e,t)=>({elements:e.map((e=>t.selectedElementIds[e.id]||Pe(e)&&t.selectedElementIds[e.containerId]?Pr(e,{isDeleted:!0}):e)),appState:Object.assign(Object.assign({},t),{selectedElementIds:{}})}))(e,t);return Go(n,e.filter((e=>{let{id:n}=e;return t.selectedElementIds[n]}))),r=Dl(r,n),{elements:n,appState:Object.assign(Object.assign({},r),{elementType:"selection",multiElement:null}),commitToHistory:Ol(El(e),t)}},contextItemLabel:"labels.delete",keyTest:e=>e.key===Lt.BACKSPACE||e.key===Lt.DELETE,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)(Js,{type:"button",icon:Ca,title:b("labels.delete"),"aria-label":b("labels.delete"),onClick:()=>r(null),visible:Ol(El(t),n)})}}),Rl=(e,t)=>{let n=[],r=[],i=null,o=-1;const a=ln(Al(e,t,!0));for(;++o<e.length;)a.get(e[o].id)?(r.length&&(n=n.concat(r),r=[]),n.push(o),i=o+1):e[o].isDeleted&&i===o?(i=o+1,r.push(o)):r=[];return n},Hl=(e,t,n)=>{if("containerId"in e&&e.containerId){if("left"!==n)return t.indexOf(e);{const n=Hn.getScene(e).getElement(e.containerId);if(n)return t.indexOf(n)}}else{var r,i;const o=null===(r=e.boundElements)||void 0===r||null===(i=r.find((e=>"arrow"!==e.type)))||void 0===i?void 0:i.id;if(o){if("left"===n)return t.indexOf(e);const r=Hn.getScene(e).getElement(o);if(r)return t.indexOf(r)}}},Nl=(e,t,n,r)=>{const i=t[n],o=t=>!t.isDeleted&&(!e.editingGroupId||t.groupIds.includes(e.editingGroupId)),a="left"===r?function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length-1;n<0&&(n=e.length+n),n=Math.min(e.length-1,Math.max(n,0));let r=n+1;for(;--r>-1;)if(t(e[r],r,e))return r;return-1}(t,o,Math.max(0,n-1)):function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;n<0&&(n=e.length+n),n=Math.min(e.length,Math.max(n,0));let r=n-1;for(;++r<e.length;)if(t(e[r],r,e))return r;return-1}(t,o,n+1),s=t[a];if(!s)return-1;if(e.editingGroupId){var l;if((null==i?void 0:i.groupIds.join(""))===(null==s?void 0:s.groupIds.join("")))return null!==(l=Hl(s,t,r))&&void 0!==l?l:a;if(null==s||!s.groupIds.includes(e.editingGroupId))return-1}var c;if(!s.groupIds.length)return null!==(c=Hl(s,t,r))&&void 0!==c?c:a;const d=e.editingGroupId?s.groupIds[s.groupIds.indexOf(e.editingGroupId)-1]:s.groupIds[s.groupIds.length-1],u=Vr(t,d);return u.length?"left"===r?t.indexOf(u[0]):t.indexOf(u[u.length-1]):a},Bl=(e,t)=>t.reduce(((t,n)=>{const r=e[n];return t[r.id]=r,t}),{}),Fl=(e,t,n)=>{const r=Rl(t,e),i=Bl(t,r);let o=(e=>{let t=0;return e.reduce(((n,r,i)=>(i>0&&e[i-1]!==r-1&&(t=++t),(n[t]||(n[t]=[])).push(r),n)),[])})(r);return"right"===n&&(o=o.reverse()),o.forEach(((r,i)=>{const o=r[0],a=r[r.length-1],s="left"===n?o:a,l=Nl(e,t,s,n);if(-1===l||s===l)return;const c="left"===n?t.slice(0,l):t.slice(0,o),d=t.slice(o,a+1),u="left"===n?t.slice(l,o):t.slice(a+1,l+1),h="left"===n?t.slice(a+1):t.slice(l+1);t="left"===n?[...c,...d,...u,...h]:[...c,...u,...d,...h]})),t.map((e=>i[e.id]?Dr(e):e))},Ul=(e,t,n)=>{const r=Rl(e,t),i=Bl(e,r),o=[];let a,s;if("left"===n){if(t.editingGroupId){const n=Vr(e,t.editingGroupId);if(!n.length)return e;a=e.indexOf(n[0])}else a=0;s=r[r.length-1]}else{if(t.editingGroupId){const n=Vr(e,t.editingGroupId);if(!n.length)return e;s=e.indexOf(n[n.length-1])}else s=e.length-1;a=r[0]}for(let t=a;t<s+1;t++)r.includes(t)||o.push(e[t]);const l=Object.values(i).map((e=>Dr(e))),c=e.slice(0,a),d=e.slice(s+1);return"left"===n?[...c,...l,...o,...d]:[...c,...o,...l,...d]},Wl=(e,t)=>Fl(t,e,"left"),Kl=(e,t)=>Fl(t,e,"right"),Vl=(e,t)=>Ul(e,t,"left"),Gl=(e,t)=>Ul(e,t,"right"),Yl=Ks({name:"sendBackward",perform:(e,t)=>({elements:Wl(e,t),appState:t,commitToHistory:!0}),contextItemLabel:"labels.sendBackward",keyPriority:40,keyTest:e=>e[Lt.CTRL_OR_CMD]&&!e.shiftKey&&e.code===bt,PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,v.jsx)("button",{type:"button",className:"zIndexButton",onClick:()=>t(null),title:"".concat(b("labels.sendBackward")," — ").concat(Zt("CtrlOrCmd+[")),children:(0,v.jsx)(za,{theme:n.theme})})}}),Xl=Ks({name:"bringForward",perform:(e,t)=>({elements:Kl(e,t),appState:t,commitToHistory:!0}),contextItemLabel:"labels.bringForward",keyPriority:40,keyTest:e=>e[Lt.CTRL_OR_CMD]&&!e.shiftKey&&e.code===ft,PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,v.jsx)("button",{type:"button",className:"zIndexButton",onClick:()=>t(null),title:"".concat(b("labels.bringForward")," — ").concat(Zt("CtrlOrCmd+]")),children:(0,v.jsx)(Da,{theme:n.theme})})}}),Zl=Ks({name:"sendToBack",perform:(e,t)=>({elements:Vl(e,t),appState:t,commitToHistory:!0}),contextItemLabel:"labels.sendToBack",keyTest:e=>lt?e[Lt.CTRL_OR_CMD]&&e.altKey&&e.code===bt:e[Lt.CTRL_OR_CMD]&&e.shiftKey&&e.code===bt,PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,v.jsx)("button",{type:"button",className:"zIndexButton",onClick:()=>t(null),title:"".concat(b("labels.sendToBack")," — ").concat(Zt(lt?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")),children:(0,v.jsx)(Ha,{theme:n.theme})})}}),ql=Ks({name:"bringToFront",perform:(e,t)=>({elements:Gl(e,t),appState:t,commitToHistory:!0}),contextItemLabel:"labels.bringToFront",keyTest:e=>lt?e[Lt.CTRL_OR_CMD]&&e.altKey&&e.code===ft:e[Lt.CTRL_OR_CMD]&&e.shiftKey&&e.code===ft,PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,v.jsx)("button",{type:"button",className:"zIndexButton",onClick:e=>t(null),title:"".concat(b("labels.bringToFront")," — ").concat(Zt(lt?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")),children:(0,v.jsx)(Ra,{theme:n.theme})})}}),$l=Ks({name:"selectAll",perform:(e,t)=>!t.editingLinearElement&&{appState:Wr(Object.assign(Object.assign({},t),{editingGroupId:null,selectedElementIds:e.reduce(((e,t)=>(t.isDeleted||Ce(t)&&t.containerId||(e[t.id]=!0),e)),{})}),El(e)),commitToHistory:!0},contextItemLabel:"labels.selectAll",keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.key===Lt.A}),Ql=Ks({name:"duplicateSelection",perform:(e,t)=>{if(t.editingLinearElement){const n=xo.duplicateSelectedPoints(t);return!!n&&{elements:e,appState:n.appState,commitToHistory:!0}}return Object.assign(Object.assign({},Jl(e,t)),{commitToHistory:!0})},contextItemLabel:"labels.duplicateSelection",keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.key===Lt.D,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)(Js,{type:"button",icon:qa,title:"".concat(b("labels.duplicateSelection")," — ").concat(Zt("CtrlOrCmd+D")),"aria-label":b("labels.duplicateSelection"),onClick:()=>r(null),visible:Ol(El(t),n)})}}),Jl=(e,t)=>{const n=new Map,r=[],i=[],a=new Map,s=e=>{const s=ni(t.editingGroupId,n,e,{x:e.x+o.k/2,y:e.y+o.k/2});return a.set(e.id,s.id),i.push(e),r.push(s),s},l=[];let c=0;const d=ln(Al(e,t,!0));for(;c<e.length;){const n=e[c];if(d.get(n.id)){if(n.groupIds.length){const r=Fr(t,n);if(r){const t=Vr(e,r);l.push(...t,...t.map((e=>s(e)))),c+=t.length;continue}}l.push(n,s(n))}else l.push(n);c++}return Bn(l,i,a),Ko(l,i,a),{elements:l,appState:Wr(Object.assign(Object.assign({},t),{selectedGroupIds:{},selectedElementIds:r.reduce(((e,t)=>(Pe(t)||(e[t.id]=!0),e)),{})}),El(l))}},ec=Ks({name:"finalize",perform:(e,t,n,r)=>{var i;let{canvas:o,focusContainer:a}=r;if(t.editingLinearElement){const{elementId:n,startBindingElement:r,endBindingElement:i}=t.editingLinearElement,o=xo.getElement(n);if(o)return Te(o)&&ko(o,r,i),{elements:o.points.length<2||zr(o)?e.filter((e=>e.id!==o.id)):void 0,appState:Object.assign(Object.assign({},t),{editingLinearElement:null}),commitToHistory:!0}}let s=e;t.pendingImageElement&&Ar(t.pendingImageElement,{isDeleted:!0},!1),window.document.activeElement instanceof HTMLElement&&a();const l=t.multiElement?t.multiElement:"freedraw"===(null===(i=t.editingElement)||void 0===i?void 0:i.type)?t.editingElement:null;if(l){if("freedraw"!==l.type&&"touch"!==t.lastPointerDownWith){const{points:e,lastCommittedPoint:t}=l;t&&e[e.length-1]===t||Ar(l,{points:l.points.slice(0,-1)})}zr(l)&&(s=s.slice(0,-1));const e=Ne(l.points,t.zoom.value);if(("line"===l.type||"freedraw"===l.type)&&e){const e=l.points,t=e[0];Ar(l,{points:e.map(((n,r)=>r===e.length-1?[t[0],t[1]]:n))})}if(Te(l)&&!e&&l.points.length>1){const[e,n]=xo.getPointAtIndexGlobalCoordinates(l,-1);So(l,t,Hn.getScene(l),{x:e,y:n})}t.elementLocked||"freedraw"===t.elementType||(t.selectedElementIds[l.id]=!0)}return(t.elementLocked||"freedraw"===t.elementType)&&l||Vt(o),{elements:s,appState:Object.assign(Object.assign({},t),{elementType:(t.elementLocked||"freedraw"===t.elementType)&&l?t.elementType:"selection",draggingElement:null,multiElement:null,editingElement:null,startBoundElement:null,suggestedBindings:[],selectedElementIds:l&&!t.elementLocked&&"freedraw"!==t.elementType?Object.assign(Object.assign({},t.selectedElementIds),{[l.id]:!0}):t.selectedElementIds,pendingImageElement:null}),commitToHistory:"freedraw"===t.elementType}},keyTest:(e,t)=>e.key===Lt.ESCAPE&&(null!==t.editingLinearElement||!t.draggingElement&&null===t.multiElement)||(e.key===Lt.ESCAPE||e.key===Lt.ENTER)&&null!==t.multiElement,PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,v.jsx)(Js,{type:"button",icon:Ma,title:b("buttons.done"),"aria-label":b("buttons.done"),onClick:n,visible:null!=t.multiElement})}});var tc,nc;const rc="undefined"!=typeof process&&null!==(tc={REACT_APP_BACKEND_V2_GET_URL:"https://json.excalidraw.com/api/v2/",REACT_APP_BACKEND_V2_POST_URL:"https://json.excalidraw.com/api/v2/post/",REACT_APP_LIBRARY_URL:"https://libraries.excalidraw.com",REACT_APP_LIBRARY_BACKEND:"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries",REACT_APP_PORTAL_URL:"https://portal.excalidraw.com",REACT_APP_WS_SERVER_URL:"",REACT_APP_FIREBASE_CONFIG:'{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}',REACT_APP_GOOGLE_ANALYTICS_ID:"UA-387204-13"})&&void 0!==tc&&tc.REACT_APP_GOOGLE_ANALYTICS_ID&&"undefined"!=typeof window&&window.gtag?(e,t,n,r)=>{window.gtag("event",t,{event_category:e,event_label:n,value:r})}:("undefined"!=typeof process&&null!==(nc={REACT_APP_BACKEND_V2_GET_URL:"https://json.excalidraw.com/api/v2/",REACT_APP_BACKEND_V2_POST_URL:"https://json.excalidraw.com/api/v2/post/",REACT_APP_LIBRARY_URL:"https://libraries.excalidraw.com",REACT_APP_LIBRARY_BACKEND:"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries",REACT_APP_PORTAL_URL:"https://portal.excalidraw.com",REACT_APP_WS_SERVER_URL:"",REACT_APP_FIREBASE_CONFIG:'{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}',REACT_APP_GOOGLE_ANALYTICS_ID:"UA-387204-13"})&&void 0!==nc&&nc.JEST_WORKER_ID,(e,t,n,r)=>{});n(518),n(9966);const ic=e=>{const{id:t}=pp(),[n,i]=(0,r.useState)(e.value);return(0,v.jsxs)("div",{className:"ProjectName",children:[(0,v.jsx)("label",{className:"ProjectName-label",htmlFor:"filename",children:"".concat(e.label).concat(e.isNameEditable?"":":")}),e.isNameEditable?(0,v.jsx)("input",{type:"text",className:"TextInput",onBlur:t=>{(e=>{let t=e.parentElement;for(;t;){if(t.tabIndex>-1)return void t.focus();t=t.parentElement}})(t.target);const n=t.target.value;n!==e.value&&e.onChange(n)},onKeyDown:e=>{if("Enter"===e.key){if(e.preventDefault(),e.nativeEvent.isComposing||229===e.keyCode)return;e.currentTarget.blur()}},id:"".concat(t,"-filename"),value:n,onChange:e=>i(e.target.value)}):(0,v.jsx)("span",{className:"TextInput TextInput--readonly",id:"".concat(t,"-filename"),children:e.value})]})},oc=(e,t)=>{if(null!=t&&t.collaborators){const n=t.collaborators.get(e);if(null!=n&&n.color)return n.color}const n=e.split("").reduce(((e,t)=>e+t.charCodeAt(0)),0),r=at.elementBackground.slice(1),i=at.elementStroke.slice(1);return{background:r[n%r.length],stroke:i[n%i.length]}};let ac;!function(e){e.ACTIVE="active",e.AWAY="away",e.IDLE="idle"}(ac||(ac={}));n(4404);const sc=document.createElement("img");sc.src="data:".concat(o.LO.svg,", ").concat(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#1971c2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-external-link"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg>'));let lc=!1;const cc=e=>{let{element:t,appState:n,setAppState:i,onLinkOpen:a}=e;const s=t.link||"",[l,c]=(0,r.useState)(s),d=(0,r.useRef)(null),u="editor"===n.showHyperlinkPopup||!s,h=(0,r.useCallback)((()=>{if(!d.current)return;const e=uc(d.current.value);!t.link&&e&&rc("hyperlink","create"),Ar(t,{link:e}),i({showHyperlinkPopup:"info"})}),[t,i]);(0,r.useLayoutEffect)((()=>()=>{h()}),[h]),(0,r.useEffect)((()=>{let e=null;const r=r=>{if(u)return;e&&clearTimeout(e);xc(t,n,[r.clientX,r.clientY])&&(e=window.setTimeout((()=>{i({showHyperlinkPopup:!1})}),500))};return window.addEventListener(o.Ks.POINTER_MOVE,r,!1),()=>{window.removeEventListener(o.Ks.POINTER_MOVE,r,!1),e&&clearTimeout(e)}}),[n,t,u,i]);const p=(0,r.useCallback)((()=>{rc("hyperlink","delete"),Ar(t,{link:null}),u&&(d.current.value=""),i({showHyperlinkPopup:!1})}),[i,t,u]),{x:g,y:m}=dc(t,n);return n.draggingElement||n.resizingElement||n.isRotating||n.openMenu?null:(0,v.jsxs)("div",{className:"excalidraw-hyperlinkContainer",style:{top:"".concat(m,"px"),left:"".concat(g,"px"),width:320,padding:5},children:[u?(0,v.jsx)("input",{className:ye("excalidraw-hyperlinkContainer-input"),placeholder:"Type or paste your link here",ref:d,value:l,onChange:e=>c(e.target.value),autoFocus:!0,onKeyDown:e=>{e.stopPropagation(),e[Lt.CTRL_OR_CMD]&&e.key===Lt.K&&e.preventDefault(),e.key!==Lt.ENTER&&e.key!==Lt.ESCAPE||h()}}):(0,v.jsx)("a",{href:t.link||"",className:ye("excalidraw-hyperlinkContainer-link",{"d-none":u}),target:hc(t.link)?"_self":"_blank",onClick:e=>{if(t.link&&a){const n=dn(o.Ks.EXCALIDRAW_LINK,e.nativeEvent);a(t,n),n.defaultPrevented&&e.preventDefault()}},rel:"noopener noreferrer",children:t.link}),(0,v.jsxs)("div",{className:"excalidraw-hyperlinkContainer__buttons",children:[!u&&(0,v.jsx)(Js,{type:"button",title:b("buttons.edit"),"aria-label":b("buttons.edit"),label:b("buttons.edit"),onClick:()=>{rc("hyperlink","edit","popup-ui"),i({showHyperlinkPopup:"editor"})},className:"excalidraw-hyperlinkContainer--edit",icon:Os}),s&&(0,v.jsx)(Js,{type:"button",title:b("buttons.remove"),"aria-label":b("buttons.remove"),label:b("buttons.remove"),onClick:p,className:"excalidraw-hyperlinkContainer--remove",icon:Ca})]})]})},dc=(e,t)=>{const[n,r]=Ye(e),{x:i,y:o}=$t({sceneX:n+e.width/2,sceneY:r},t);return{x:i-t.offsetLeft-160,y:o-t.offsetTop-85}},uc=e=>((e=e.trim())&&(e.includes("://")||/^[[\\/]/.test(e)||(e="https://".concat(e))),e),hc=e=>!!(null!=e&&e.includes(location.origin)||null!=e&&e.startsWith("/")),pc=Ks({name:"hyperlink",perform:(e,t)=>"editor"!==t.showHyperlinkPopup&&{elements:e,appState:Object.assign(Object.assign({},t),{showHyperlinkPopup:"editor",openMenu:null}),commitToHistory:!0},trackEvent:(e,t)=>{rc("hyperlink","edit",t)},keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.key===Lt.K,contextItemLabel:(e,t)=>gc(e,t),contextItemPredicate:(e,t)=>1===Al(e,t).length,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;const i=Al(t,n);return(0,v.jsx)(Js,{type:"button",icon:xa,"aria-label":b(gc(t,n)),title:"".concat(b("labels.link.label")," - ").concat(Zt("CtrlOrCmd+K")),onClick:()=>r(null),selected:1===i.length&&!!i[0].link})}}),gc=(e,t)=>Al(e,t)[0].link?"labels.link.edit":"labels.link.create",mc=(e,t,n)=>{let[r,i,o,a]=e;const s=14/n.zoom.value,l=14/n.zoom.value,c=14/n.zoom.value,d=(r+o)/2,u=(i+a)/2,h=6/(2*n.zoom.value),p=4/n.zoom.value,g=o+p-h,m=i-p-c+h,[f,b]=De(g+s/2,m+l/2,d,u,t);return[f-s/2,b-l/2,s,l]},fc=(e,t,n,r)=>{let[i,o]=n;const a=4/t.zoom.value;if(!r&&t.viewModeEnabled&&Ri(e,[i,o],a))return!0;const[s,l,c,d]=Ye(e),[u,h,p,g]=mc([s,l,c,d],e.angle,t);return i>u-a&&i<u+a+p&&o>h-a&&o<h+g+a};let bc=null;const vc=(e,t)=>{if(!e.link)return;const n=al();n.classList.add("excalidraw-tooltip--visible"),n.style.maxWidth="20rem",n.textContent=e.link;const[r,i,o,a]=Ye(e),[s,l,c,d]=mc([r,i,o,a],e.angle,t),u=$t({sceneX:s,sceneY:l},t);sl(n,{left:u.x,top:u.y,width:c,height:d},"top"),rc("hyperlink","tooltip","link-icon"),lc=!0},xc=(e,t,n)=>{let[r,i]=n;const{x:o,y:a}=qt({clientX:r,clientY:i},t),s=15/t.zoom.value;if(Ri(e,[o,a],s))return!1;const[l,c,d]=Ye(e);if(o>=l&&o<=d&&a>=c-85&&a<=c)return!1;const{x:u,y:h}=dc(e,t);return!(r>=u-s&&r<=u+320+10+s&&i>=h-s&&i<=h+s+10+42)},yc=(()=>{const 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]})(),wc=function(e,t,n,r,i,o,a,s){let l=arguments.length>8&&void 0!==arguments[8]&&arguments[8];e.save(),e.translate(o,a),e.rotate(s),l&&e.fillRect(t-o,n-a,r,i),e.strokeRect(t-o,n-a,r,i),e.restore()},kc=(e,t,n,r)=>{e.beginPath(),e.arc(t,n,r,0,2*Math.PI),e.fill(),e.stroke()},_c=(e,t,n,r,i,a,s)=>{if(null===a)return{atLeastOneVisibleElement:!1};const{renderScrollbars:l=!0,renderSelection:c=!0,renderGrid:d=!0,isExporting:u}=s,h=a.getContext("2d");h.setTransform(1,0,0,1,0,0),h.save(),h.scale(r,r);const p=a.width/r,g=a.height/r;if(u&&"dark"===s.theme&&(h.filter=o.ZF),"string"==typeof s.viewBackgroundColor){("transparent"===s.viewBackgroundColor||5===s.viewBackgroundColor.length||9===s.viewBackgroundColor.length||/(hsla|rgba)\(/.test(s.viewBackgroundColor))&&h.clearRect(0,0,p,g),h.save(),h.fillStyle=s.viewBackgroundColor,h.fillRect(0,0,p,g),h.restore()}else h.clearRect(0,0,p,g);h.save(),h.scale(s.zoom.value,s.zoom.value),d&&t.gridSize&&((e,t,n,r,i,o)=>{e.save(),e.strokeStyle="rgba(0,0,0,0.1)",e.beginPath();for(let a=n;a<n+i+2*t;a+=t)e.moveTo(a,r-t),e.lineTo(a,r+o+2*t);for(let a=r;a<r+o+2*t;a+=t)e.moveTo(n-t,a),e.lineTo(n+i+2*t,a);e.stroke(),e.restore()})(h,t.gridSize,-Math.ceil(s.zoom.value/t.gridSize)*t.gridSize+s.scrollX%t.gridSize,-Math.ceil(s.zoom.value/t.gridSize)*t.gridSize+s.scrollY%t.gridSize,p/s.zoom.value,g/s.zoom.value);const f=e.filter((e=>Oc(e,p,g,{zoom:s.zoom,offsetLeft:t.offsetLeft,offsetTop:t.offsetTop,scrollX:s.scrollX,scrollY:s.scrollY})));if(f.forEach((e=>{try{wr(e,i,h,s),u||Mc(e,h,t)}catch(e){console.error(e)}})),t.editingLinearElement){const e=xo.getElement(t.editingLinearElement.elementId);e&&((e,t,n,r)=>{e.save(),e.translate(n.scrollX,n.scrollY),e.lineWidth=1/n.zoom.value,xo.getPointsGlobalCoordinates(r).forEach(((r,i)=>{var o,a;e.strokeStyle="red",e.setLineDash([]),e.fillStyle=null!==(o=t.editingLinearElement)&&void 0!==o&&null!==(a=o.selectedPointsIndices)&&void 0!==a&&a.includes(i)?"rgba(255, 127, 127, 0.9)":"rgba(255, 255, 255, 0.9)";const{POINT_HANDLE_SIZE:s}=xo;kc(e,r[0],r[1],s/2/n.zoom.value)})),e.restore()})(h,t,s,e)}if(n)try{wr(n,i,h,s)}catch(e){console.error(e)}if(wo(t)&&t.suggestedBindings.filter((e=>null!=e)).forEach((e=>{Sc(h,s,e)})),c&&!t.multiElement&&!t.editingLinearElement){const n=e.reduce(((e,n)=>{const r=[];if(t.selectedElementIds[n.id]&&!Br(t,n)&&r.push(it.black),s.remoteSelectedElementIds[n.id]&&r.push(...s.remoteSelectedElementIds[n.id].map((e=>{var n;const r=null===(n=t.collaborators.get(e))||void 0===n?void 0:n.picture,{background:i}=oc(r||e,t);return i}))),r.length){const[t,i,o,a]=Ye(n);e.push({angle:n.angle,elementX1:t,elementY1:i,elementX2:o,elementY2:a,selectionColors:r})}return e}),[]),r=t=>{const r=Vr(e,t),[i,o,a,s]=et(r);n.push({angle:0,elementX1:i,elementX2:a,elementY1:o,elementY2:s,selectionColors:[it.black]})};for(const e of Ur(t))r(e);t.editingGroupId&&r(t.editingGroupId),n.forEach((e=>Ec(h,s,e)));const i=Al(e,t);if(h.save(),h.translate(s.scrollX,s.scrollY),1===i.length){h.fillStyle=it.white;const e=di(i[0],s.zoom,"mouse");t.viewModeEnabled||Cc(h,s,e,i[0].angle)}else if(i.length>1&&!t.isRotating){const e=4/s.zoom.value;h.fillStyle=it.white;const[t,n,r,o]=et(i),a=h.getLineDash();h.setLineDash([2/s.zoom.value]);const l=h.lineWidth;h.lineWidth=1/s.zoom.value,wc(h,t-e,n-e,r-t+2*e,o-n+2*e,(t+r)/2,(n+o)/2,0),h.lineWidth=l,h.setLineDash(a);const c=ci([t,n,r,o],0,s.zoom,"mouse",ii);Cc(h,s,c,0)}h.restore()}h.restore();for(const e in s.remotePointerViewportCoords){var b;let{x:n,y:r}=s.remotePointerViewportCoords[e];n-=t.offsetLeft,r-=t.offsetTop;const i=9,o=14,a=n<0||n>p-i||r<0||r>g-o;n=Math.max(n,0),n=Math.min(n,p-i),r=Math.max(r,0),r=Math.min(r,g-o);const l=null===(b=t.collaborators.get(e))||void 0===b?void 0:b.picture,{background:c,stroke:d}=oc(l||e,t);h.save(),h.strokeStyle=d,h.fillStyle=c;const u=s.remotePointerUserStates[e];(a||u===ac.AWAY)&&(h.globalAlpha=.48),s.remotePointerButton&&"down"===s.remotePointerButton[e]&&(h.beginPath(),h.arc(n,r,15,0,2*Math.PI,!1),h.lineWidth=3,h.strokeStyle="#ffffff88",h.stroke(),h.closePath(),h.beginPath(),h.arc(n,r,15,0,2*Math.PI,!1),h.lineWidth=1,h.strokeStyle=d,h.stroke(),h.closePath()),h.beginPath(),h.moveTo(n,r),h.lineTo(n+1,r+14),h.lineTo(n+4,r+9),h.lineTo(n+9,r+10),h.lineTo(n,r),h.fill(),h.stroke();const m=s.remotePointerUsernames[e];let f="";u===ac.AWAY?f=yc?"⚫️":" (".concat(ac.AWAY,")"):u===ac.IDLE?f=yc?"💤":" (".concat(ac.IDLE,")"):u===ac.ACTIVE&&(f=yc?"🟢":"");const v="".concat(m?"".concat(m," "):"").concat(f);if(!a&&v){const e=n+i,t=r+o,a=4,s=4,l=h.measureText(v),u=l.actualBoundingBoxDescent+l.actualBoundingBoxAscent;h.fillStyle=d,h.fillRect(e-1,t-1,l.width+2*a+2,u+2*s+2),h.fillStyle=c,h.fillRect(e,t,l.width+2*a,u+2*s),h.fillStyle=it.white,h.fillText(v,e+a,t+s+l.actualBoundingBoxAscent)}h.restore(),h.closePath()}let v;return l&&(v=((e,t,n,r)=>{let{scrollX:i,scrollY:o,zoom:a}=r;if(0===e.length)return{horizontal:null,vertical:null};const[s,l,c,d]=et(e),u=t/a.value,h=n/a.value,p=t-u,g=n-h,f={top:parseInt(Qt("sat")),bottom:parseInt(Qt("sab")),left:parseInt(Qt("sal")),right:parseInt(Qt("sar"))},b=m().rtl,v=p/2-i+f.left,x=g/2-o+f.top,y=v+u-f.right,w=x+h-f.bottom,k=Math.min(s,v),_=Math.min(l,x),C=Math.max(c,y),E=Math.max(d,w);return{horizontal:v===k&&y===C?null:{x:Math.max(f.left,4)+(v-k)/(C-k)*t,y:n-6-Math.max(4,f.bottom),width:(y-v)/(C-k)*t-Math.max(8,f.left+f.right),height:6},vertical:x===_&&w===E?null:{x:b?Math.max(f.left,4):t-6-Math.max(f.right,4),y:(x-_)/(E-_)*n+Math.max(f.top,4),width:6,height:(w-x)/(E-_)*n-Math.max(8,f.top+f.bottom)}}})(e,p,g,s),h.save(),h.fillStyle="rgba(0,0,0,0.3)",h.strokeStyle="rgba(255,255,255,0.8)",[v.horizontal,v.vertical].forEach((e=>{e&&((e,t,n,r,i,o)=>{e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-o,n),e.quadraticCurveTo(t+r,n,t+r,n+o),e.lineTo(t+r,n+i-o),e.quadraticCurveTo(t+r,n+i,t+r-o,n+i),e.lineTo(t+o,n+i),e.quadraticCurveTo(t,n+i,t,n+i-o),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath(),e.fill(),e.stroke()})(h,e.x,e.y,e.width,e.height,3)})),h.restore()),h.restore(),{atLeastOneVisibleElement:f.length>0,scrollBars:v}},Cc=(e,t,n,r)=>{Object.keys(n).forEach((i=>{const o=n[i];void 0!==o&&(e.save(),e.lineWidth=1/t.zoom.value,"rotation"===i?kc(e,o[0]+o[2]/2,o[1]+o[3]/2,o[2]/2):wc(e,o[0],o[1],o[2],o[3],o[0]+o[2]/2,o[1]+o[3]/2,r,!0),e.restore())}))},Ec=(e,t,n)=>{const{angle:r,elementX1:i,elementY1:o,elementX2:a,elementY2:s,selectionColors:l}=n,c=a-i,d=s-o,u=4/t.zoom.value,h=8/t.zoom.value,p=4/t.zoom.value;e.save(),e.translate(t.scrollX,t.scrollY),e.lineWidth=1/t.zoom.value;const g=l.length;for(let t=0;t<g;++t)e.strokeStyle=l[t],e.setLineDash([h,p+(h+p)*(g-1)]),e.lineDashOffset=(h+p)*t,wc(e,i-u,o-u,c+2*u,d+2*u,i+c/2,o+d/2,r);e.restore()},Sc=(e,t,n)=>{const r=Array.isArray(n)?Ic:jc;e.save(),e.translate(t.scrollX,t.scrollY),r(e,n),e.restore()},jc=(e,t)=>{const[n,r,i,o]=Ye(t),a=i-n,s=o-r,l=Ni(t,a,s);e.strokeStyle="rgba(0,0,0,.05)",e.lineWidth=l-4;const c=2+l/2;switch(t.type){case"rectangle":case"text":case"image":wc(e,n-c,r-c,a+2*c,s+2*c,n+a/2,r+s/2,t.angle);break;case"diamond":const i=Math.hypot(a,s);((e,t,n,r,i,o)=>{e.save(),e.translate(r,i),e.rotate(o),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*(c*i/s),s+2*(c*i/a),n+a/2,r+s/2,t.angle);break;case"ellipse":((e,t,n,r,i,o)=>{e.beginPath(),e.ellipse(r,i,t/2,n/2,o,0,2*Math.PI),e.stroke()})(e,a+2*c,s+2*c,n+a/2,r+s/2,t.angle)}},Ic=(e,t)=>{const[n,r,i]=t,o=Ni(i,i.width,i.height);e.strokeStyle="rgba(0,0,0,0)",e.fillStyle="rgba(0,0,0,.05)";("both"===r?[0,-1]:"start"===r?[0]:[-1]).forEach((t=>{const[r,i]=xo.getPointAtIndexGlobalCoordinates(n,t);kc(e,r,i,o)}))};let Tc;const Mc=(e,t,n)=>{if(e.link&&!n.selectedElementIds[e.id]){const[r,i,o,a]=Ye(e),[s,l,c,d]=mc([r,i,o,a],e.angle,n),u=s+c/2,h=l+d/2;if(t.save(),t.translate(n.scrollX+u,n.scrollY+h),t.rotate(e.angle),Tc&&Tc.zoom===n.zoom.value)t.drawImage(Tc,s-u,l-h,c,d);else{Tc=document.createElement("canvas"),Tc.zoom=n.zoom.value,Tc.width=c*window.devicePixelRatio*n.zoom.value,Tc.height=d*window.devicePixelRatio*n.zoom.value;const e=Tc.getContext("2d");e.scale(window.devicePixelRatio*n.zoom.value,window.devicePixelRatio*n.zoom.value),e.fillStyle="#fff",e.fillRect(0,0,c,d),e.drawImage(sc,0,0,c,d),e.restore(),t.drawImage(Tc,s-u,l-h,c,d)}t.restore()}},Oc=(e,t,n,r)=>{const[i,o,a,s]=Je(e),l=qt({clientX:r.offsetLeft,clientY:r.offsetTop},r),c=qt({clientX:r.offsetLeft+t,clientY:r.offsetTop+n},r);return l.x<=a&&l.y<=s&&c.x>=i&&c.y>=o};var Lc=Object.defineProperty,Ac=(e,t)=>()=>(e&&(t=e(e=0)),t),Pc=(e,t)=>{for(var n in(e=>{Lc(e,"__esModule",{value:!0})})(e),t)Lc(e,n,{get:t[n],enumerable:!0})},Dc={};Pc(Dc,{default:()=>zc});var zc,Rc=Ac((()=>{zc=async(e=[{}])=>(Array.isArray(e)||(e=[e]),new Promise(((t,n)=>{let r=document.createElement("input");r.type="file";let i=[...e.map((e=>e.mimeTypes||[])).join(),e.map((e=>e.extensions||[])).join()].join();r.multiple=e[0].multiple||!1,r.accept=i||"";let o=e=>{"function"==typeof a&&a(),t(e)},a=e[0].legacySetup&&e[0].legacySetup(o,(()=>a(n)),r);r.addEventListener("change",(()=>{o(r.multiple?Array.from(r.files):r.files[0])})),r.click()})))})),Hc={};Pc(Hc,{default:()=>Bc});var Nc,Bc,Fc=Ac((()=>{Nc=async e=>{let t=await e.getFile();return t.handle=e,t},Bc=async(e=[{}])=>{Array.isArray(e)||(e=[e]);let t=[];e.forEach(((e,n)=>{t[n]={description:e.description||"",accept:{}},e.mimeTypes?e.mimeTypes.map((r=>{t[n].accept[r]=e.extensions||[]})):t[n].accept["*/*"]=e.extensions||[]}));let n=await window.showOpenFilePicker({id:e[0].id,startIn:e[0].startIn,types:t,multiple:e[0].multiple||!1,excludeAcceptAllOption:e[0].excludeAcceptAllOption||!1}),r=await Promise.all(n.map(Nc));return e[0].multiple?r:r[0]}})),Uc={};Pc(Uc,{default:()=>Wc});var Wc,Kc=Ac((()=>{Wc=async(e=[{}])=>(Array.isArray(e)||(e=[e]),e[0].recursive=e[0].recursive||!1,new Promise(((t,n)=>{let r=document.createElement("input");r.type="file",r.webkitdirectory=!0;let i=e=>{"function"==typeof o&&o(),t(e)},o=e[0].legacySetup&&e[0].legacySetup(i,(()=>o(n)),r);r.addEventListener("change",(()=>{let t=Array.from(r.files);e[0].recursive?e[0].recursive&&e[0].skipDirectory&&(t=t.filter((t=>t.webkitRelativePath.split("/").every((t=>!e[0].skipDirectory({name:t,kind:"directory"})))))):t=t.filter((e=>2===e.webkitRelativePath.split("/").length)),i(t)})),r.click()})))})),Vc={};Pc(Vc,{default:()=>Yc});var Gc,Yc,Xc=Ac((()=>{Gc=async(e,t,n=e.name,r)=>{let i=[],o=[];for await(let a of e.values()){let s=`${n}/${a.name}`;"file"===a.kind?o.push(a.getFile().then((t=>(t.directoryHandle=e,Object.defineProperty(t,"webkitRelativePath",{configurable:!0,enumerable:!0,get:()=>s}))))):"directory"===a.kind&&t&&(!r||!r(a))&&i.push(Gc(a,t,s,r))}return[...(await Promise.all(i)).flat(),...await Promise.all(o)]},Yc=async(e={})=>{e.recursive=e.recursive||!1;let t=await window.showDirectoryPicker({id:e.id,startIn:e.startIn});return Gc(t,e.recursive,void 0,e.skipDirectory)}})),Zc={};Pc(Zc,{default:()=>qc});var qc,$c=Ac((()=>{qc=async(e,t={})=>{Array.isArray(t)&&(t=t[0]);let n=document.createElement("a"),r=e;"body"in e&&(r=await async function(e,t){let n=e.getReader(),r=new ReadableStream({start:e=>async function t(){return n.read().then((({done:n,value:r})=>{if(!n)return e.enqueue(r),t();e.close()}))}()}),i=new Response(r);return n.releaseLock(),new Blob([await i.blob()],{type:t})}(e.body,e.headers.get("content-type"))),n.download=t.fileName||"Untitled",n.href=URL.createObjectURL(r);let i=()=>{"function"==typeof o&&o()},o=t.legacySetup&&t.legacySetup(i,(()=>o(reject)),n);return n.addEventListener("click",(()=>{setTimeout((()=>URL.revokeObjectURL(n.href)),3e4),i()})),n.click(),null}})),Qc={};Pc(Qc,{default:()=>Jc});var Jc,ed=Ac((()=>{Jc=async(e,t=[{}],n=null,r=!1)=>{Array.isArray(t)||(t=[t]),t[0].fileName=t[0].fileName||"Untitled";let i=[];if(t.forEach(((t,n)=>{i[n]={description:t.description||"",accept:{}},t.mimeTypes?(0===n&&(e.type?t.mimeTypes.push(e.type):e.headers&&e.headers.get("content-type")&&t.mimeTypes.push(e.headers.get("content-type"))),t.mimeTypes.map((e=>{i[n].accept[e]=t.extensions||[]}))):e.type&&(i[n].accept[e.type]=t.extensions||[])})),n)try{await n.getFile()}catch(e){if(n=null,r)throw e}let o=n||await window.showSaveFilePicker({suggestedName:t[0].fileName,id:t[0].id,startIn:t[0].startIn,types:i,excludeAcceptAllOption:t[0].excludeAcceptAllOption||!1}),a=await o.createWritable();return"stream"in e?(await e.stream().pipeTo(a),o):"body"in e?(await e.body.pipeTo(a),o):(await a.write(blob),await a.close(),o)}})),td=(()=>{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})(),nd=td?Promise.resolve().then((()=>(Fc(),Hc))):Promise.resolve().then((()=>(Rc(),Dc)));td?Promise.resolve().then((()=>(Xc(),Vc))):Promise.resolve().then((()=>(Kc(),Uc)));var rd=td?Promise.resolve().then((()=>(ed(),Qc))):Promise.resolve().then((()=>($c(),Zc)));const id=e=>{var t,n,r;const i=null===(t=e.extensions)||void 0===t?void 0:t.reduce(((e,t)=>(e.push(o.LO[t]),e)),[]),a=null===(n=e.extensions)||void 0===n?void 0:n.reduce(((e,t)=>"jpg"===t?e.concat(".jpg",".jpeg"):e.concat(".".concat(t))),[]);return async function(...e){return(await nd).default(...e)}({description:e.description,extensions:a,mimeTypes:i,multiple:null!==(r=e.multiple)&&void 0!==r&&r,legacySetup:(t,n,r)=>{const i=Wt(n,500),a=()=>{s(),document.addEventListener(o.Ks.KEYUP,i),document.addEventListener(o.Ks.POINTER_UP,i),i()},s=()=>{var n;if(null!==(n=r.files)&&void 0!==n&&n.length){const n=e.multiple?[...r.files]:r.files[0];t(n)}};requestAnimationFrame((()=>{window.addEventListener(o.Ks.FOCUS,a)}));const l=window.setInterval((()=>{s()}),500);return e=>{clearInterval(l),i.cancel(),window.removeEventListener(o.Ks.FOCUS,a),document.removeEventListener(o.Ks.KEYUP,i),document.removeEventListener(o.Ks.POINTER_UP,i),e&&(console.warn("Opening the file was canceled (legacy-fs)."),e(new $s))}}})},od=(e,t)=>async function(...e){return(await rd).default(...e)}(e,{fileName:"".concat(t.name,".").concat(t.extension),description:t.description,extensions:[".".concat(t.extension)]},t.fileHandle),ad={selection:!0,text:!0,rectangle:!0,diamond:!0,ellipse:!0,line:!0,image:!0,arrow:!0,freedraw:!0,eraser:!1},sd=(e,t)=>{var n,r,i,o,a,s,l,c,d,u,h,p,g,m;const f={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||Lr(),fillStyle:e.fillStyle||"hachure",strokeWidth:e.strokeWidth||1,strokeStyle:null!==(i=e.strokeStyle)&&void 0!==i?i:"solid",roughness:null!==(o=e.roughness)&&void 0!==o?o:1,opacity:null==e.opacity?100:e.opacity,angle:e.angle||0,x:null!==(a=null!==(s=t.x)&&void 0!==s?s:e.x)&&void 0!==a?a:0,y:null!==(l=null!==(c=t.y)&&void 0!==c?c:e.y)&&void 0!==l?l:0,strokeColor:e.strokeColor,backgroundColor:e.backgroundColor,width:e.width||0,height:e.height||0,seed:null!==(d=e.seed)&&void 0!==d?d:1,groupIds:null!==(u=e.groupIds)&&void 0!==u?u:[],strokeSharpness:null!==(h=e.strokeSharpness)&&void 0!==h?h:Ie(e.type)?"round":"sharp",boundElements:e.boundElementIds?e.boundElementIds.map((e=>({type:"arrow",id:e}))):null!==(p=e.boundElements)&&void 0!==p?p:[],updated:null!==(g=e.updated)&&void 0!==g?g:sn(),link:null!==(m=e.link)&&void 0!==m?m:null};return Object.assign(Object.assign(Object.assign({},f),Hr(f)),t)},ld=e=>{var t,n,r;switch(e.type){case"text":let i=e.fontSize,a=e.fontFamily;if("font"in e){const[t,n]=e.font.split(" ");i=parseInt(t,10),r=n,a=Object.keys(o.ut).includes(r)?o.ut[r]:o.rk}return sd(e,{fontSize:i,fontFamily:a,text:null!==(t=e.text)&&void 0!==t?t:"",baseline:e.baseline,textAlign:e.textAlign||o.Hg,verticalAlign:e.verticalAlign||o.hs,containerId:null!==(n=e.containerId)&&void 0!==n?n:null,originalText:e.originalText||e.text});case"freedraw":return sd(e,{points:e.points,lastCommittedPoint:null,simulatePressure:e.simulatePressure,pressures:e.pressures});case"image":return sd(e,{status:e.status||"pending",fileId:e.fileId,scale:e.scale||[1,1]});case"line":case"draw":case"arrow":{const{startArrowhead:t=null,endArrowhead:n=("arrow"===e.type?"arrow":null)}=e;let r=e.x,i=e.y,o=!Array.isArray(e.points)||e.points.length<2?[[0,0],[e.width,e.height]]:e.points;return 0===o[0][0]&&0===o[0][1]||({points:o,x:r,y:i}=xo.getNormalizedPoints(e)),sd(e,{type:"draw"===e.type?"line":e.type,startBinding:e.startBinding,endBinding:e.endBinding,lastCommittedPoint:null,startArrowhead:t,endArrowhead:n,points:o,x:r,y:i})}case"ellipse":case"rectangle":case"diamond":return sd(e,{})}},cd=(e,t)=>{const n=t?ln(t):null;return(e||[]).reduce(((e,t)=>{if("selection"!==t.type&&!zr(t)){let r=ld(t);if(r){const i=null==n?void 0:n.get(t.id);i&&i.version>r.version&&(r=Dr(r,i.version)),e.push(r)}}return e}),[])},dd=(e,t)=>{e=e||{};const n=hn(),r={};for(const[i,o]of Object.entries(n)){const n=e[i],a=t?t[i]:void 0;r[i]=void 0!==n?n:void 0!==a?a:o}return Object.assign(Object.assign({},r),{elementType:ad[r.elementType]?r.elementType:"selection",zoom:"number"==typeof e.zoom?{value:e.zoom}:e.zoom||n.zoom})},ud=(e,t,n)=>({elements:cd(null==e?void 0:e.elements,n),appState:dd(null==e?void 0:e.appState,t||null),files:(null==e?void 0:e.files)||{}}),hd=(e,t)=>{const n=[];for(const r of e)if(Array.isArray(r))n.push({status:t,elements:r,id:Lr(),created:Date.now()});else{const e=r;n.push(Object.assign(Object.assign({},e),{id:e.id||Lr(),status:e.status||t,created:e.created||Date.now()}))}return n},pd=async e=>{let t;if(e.type===o.LO.png)try{return await(await Promise.all([n.e(736),n.e(9)]).then(n.bind(n,673))).decodePngMetadata(e)}catch(e){throw"INVALID"===e.message?new DOMException(b("alerts.imageDoesNotContainScene"),"EncodingError"):new DOMException(b("alerts.cannotRestoreFromImage"),"EncodingError")}else if(t="text"in Blob?await e.text():await new Promise((t=>{const n=new FileReader;n.readAsText(e,"utf8"),n.onloadend=()=>{n.readyState===FileReader.DONE&&t(n.result)}})),e.type===o.LO.svg)try{return await(await Promise.all([n.e(736),n.e(9)]).then(n.bind(n,673))).decodeSvgMetadata({svg:t})}catch(e){throw"INVALID"===e.message?new DOMException(b("alerts.imageDoesNotContainScene"),"EncodingError"):new DOMException(b("alerts.cannotRestoreFromImage"),"EncodingError")}return t},gd=e=>{var t;return e&&(null===(t=e.name.match(/\.(json|excalidraw|png|svg)$/))||void 0===t?void 0:t[1])||null},md=e=>{const t=gd(e);return"png"===t||"svg"===t},fd=e=>{const{type:t}=e||{};return!!t&&o.jo.includes(t)},bd=async(e,t,n)=>{const r=await pd(e);try{const i=JSON.parse(r);if(!jd(i))throw new Error(b("alerts.couldNotLoadInvalidFile"));return ud({elements:Tl(i.elements||[]),appState:Object.assign(Object.assign({theme:null==t?void 0:t.theme,fileHandle:e.handle||null},fn(i.appState||{})),t?rl(i.elements||[],t):{}),files:i.files},t,n)}catch(e){throw console.error(e.message),new Error(b("alerts.couldNotLoadInvalidFile"))}},vd=async e=>{const t=await pd(e),n=JSON.parse(t);if(n.type!==o.r8.excalidrawLibrary)throw new Error(b("alerts.couldNotLoadInvalidFile"));return n},xd=async e=>new Promise(((t,n)=>{try{e.toBlob((e=>{if(!e)return n(new qs(b("canvasError.canvasTooBig"),"CANVAS_POSSIBLY_TOO_BIG"));t(e)}))}catch(e){n(e)}})),yd=async e=>{try{const n=await window.crypto.subtle.digest("SHA-1",await e.arrayBuffer());return t=new Uint8Array(n),Array.from(t).map((e=>"0".concat(e.toString(16)).slice(-2))).join("")}catch(e){return console.error(e),we(40)}var t},wd=async e=>new Promise(((t,n)=>{const r=new FileReader;r.onload=()=>{const e=r.result;t(e)},r.onerror=e=>n(e),r.readAsDataURL(e)})),kd=async(e,t)=>{if(e.type===o.LO.svg)return e;const[r,i]=await Promise.all([n.e(736).then(n.t.bind(n,4881,23)).then((e=>e.default)),n.e(736).then(n.bind(n,100)).then((e=>e.default))]),a=i({pica:r({features:["js","wasm"]})});if(t.outputType){const{outputType:e}=t;a._create_blob=function(t){return this.pica.toBlob(t.out_canvas,e,.8).then((e=>(t.out_blob=e,t)))}}if(!fd(e))throw new Error(b("errors.unsupportedFileType"));return new File([await a.toBlob(e,{max:t.maxWidthOrHeight})],e.name,{type:t.outputType||e.type})},_d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return new File([(new TextEncoder).encode(e)],t,{type:o.LO.svg})},Cd=(e,t)=>{const n={};for(const r of e)!r.isDeleted&&"fileId"in r&&r.fileId&&t[r.fileId]&&(n[r.fileId]=t[r.fileId]);return n},Ed=(e,t,n,r)=>{const i={type:o.r8.excalidraw,version:o.Kr.excalidraw,source:o.pb,elements:"local"===r?Tl(e):Il(e),appState:"local"===r?fn(t):bn(t),files:"local"===r?Cd(e,n):void 0};return JSON.stringify(i,null,2)},Sd=async(e,t,n)=>{const r=Ed(e,t,n,"local"),i=new Blob([r],{type:o.LO.excalidraw});return{fileHandle:await od(i,{name:t.name,extension:"excalidraw",description:"Excalidraw file",fileHandle:md(t.fileHandle)?null:t.fileHandle})}},jd=e=>(null==e?void 0:e.type)===o.r8.excalidraw&&(!e.elements||Array.isArray(e.elements)&&(!e.appState||"object"==typeof e.appState)),Id=e=>new Promise(((t,n)=>{const r=new Image;r.onload=()=>{t(r)},r.onerror=e=>{n(e)},r.src=e})),Td=async e=>{let{fileIds:t,files:n,imageCache:r}=e;const i=new Map,a=new Map;return await Promise.all(t.reduce(((e,t)=>{const s=n[t];return s&&!i.has(t)?(i.set(t,!0),e.concat((async()=>{try{if(s.mimeType===o.LO.binary)throw new Error("Only images can be added to ImageCache");const e=Id(s.dataURL),n={image:e,mimeType:s.mimeType};r.set(t,n);const i=await e;r.set(t,Object.assign(Object.assign({},n),{image:i}))}catch(e){a.set(t,!0)}})())):e}),[])),{imageCache:r,updatedFiles:i,erroredFiles:a}},Md=e=>e.filter((e=>ke(e))),Od="\x3c!-- svg-source:excalidraw --\x3e",Ld=async function(e,t,n,r){let{exportBackground:i,exportPadding:a=o.qy,viewBackgroundColor:s}=r,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:(e,n)=>{const r=document.createElement("canvas");return r.width=e*t.exportScale,r.height=n*t.exportScale,{canvas:r,scale:t.exportScale}};const[c,d,u,h]=Pd(e,a),{canvas:p,scale:g=1}=l(u,h),m=hn(),{imageCache:f}=await Td({imageCache:new Map,fileIds:Md(e).map((e=>e.fileId)),files:n});return _c(e,t,null,g,ve.canvas(p),p,{viewBackgroundColor:i?s:null,scrollX:-c+a,scrollY:-d+a,zoom:m.zoom,remotePointerViewportCoords:{},remoteSelectedElementIds:{},shouldCacheIgnoreZoom:!1,remotePointerUsernames:{},remotePointerUserStates:{},theme:t.exportWithDarkMode?"dark":"light",imageCache:f,renderScrollbars:!1,renderSelection:!1,renderGrid:!1,isExporting:!0}),p},Ad=async(e,t,r)=>{const{exportPadding:i=o.qy,viewBackgroundColor:a,exportScale:s=1,exportEmbedScene:l}=t;let c="";if(l)try{c=await(await Promise.all([n.e(736),n.e(9)]).then(n.bind(n,673))).encodeSvgMetadata({text:Ed(e,t,r||{},"local")})}catch(e){console.error(e)}const[d,u,h,p]=Pd(e,i),g=document.createElementNS(o.hR,"svg");if(g.setAttribute("version","1.1"),g.setAttribute("xmlns",o.hR),g.setAttribute("viewBox","0 0 ".concat(h," ").concat(p)),g.setAttribute("width","".concat(h*s)),g.setAttribute("height","".concat(p*s)),t.exportWithDarkMode&&g.setAttribute("filter",o.ZF),g.innerHTML="\n ".concat(Od,"\n ").concat(c,'\n <defs>\n <style>\n @font-face {\n font-family: "Virgil";\n src: url("https://excalidraw.com/Virgil.woff2");\n }\n @font-face {\n font-family: "Cascadia";\n src: url("https://excalidraw.com/Cascadia.woff2");\n }\n </style>\n </defs>\n '),t.exportBackground&&a){const e=g.ownerDocument.createElementNS(o.hR,"rect");e.setAttribute("x","0"),e.setAttribute("y","0"),e.setAttribute("width","".concat(h)),e.setAttribute("height","".concat(p)),e.setAttribute("fill",a),g.appendChild(e)}return function(e,t,n,r){let{offsetX:i=0,offsetY:o=0,exportWithDarkMode:a=!1}=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};n&&e.forEach((e=>{if(!e.isDeleted)try{_r(e,t,n,r,e.x+i,e.y+o,a)}catch(e){console.error(e)}}))}(e,ve.svg(g),g,r||{},{offsetX:-d+i,offsetY:-u+i,exportWithDarkMode:t.exportWithDarkMode}),g},Pd=(e,t)=>{const[n,r,i,o]=et(e);return[n,r,Kt(n,i)+2*t,Kt(r,o)+t+t]},Dd=32,zd=12,Rd=256,Hd="NOT_SPREADSHEET",Nd="VALID_SPREADSHEET",Bd=e=>{const t=/^[$€£¥₩]?([0-9,]+(\.[0-9]+)?)$/.exec(e);return t?parseFloat(t[1].replace(/,/g,"")):null},Fd=(e,t)=>e.slice(1).every((e=>null!==Bd(e[t]))),Ud=e=>{const t=e[0].length;if(t>2)return{type:Hd,reason:"More than 2 columns"};if(1===t){if(!Fd(e,0))return{type:Hd,reason:"Value is not numeric"};const t=null===Bd(e[0][0]),n=(t?e.slice(1):e).map((e=>Bd(e[0])));return n.length<2?{type:Hd,reason:"Less than two rows"}:{type:Nd,spreadsheet:{title:t?e[0][0]:null,labels:null,values:n}}}const n=Fd(e,0)?0:1;if(!Fd(e,n))return{type:Hd,reason:"Value is not numeric"};const r=(n+1)%2,i=null===Bd(e[0][n]),o=i?e.slice(1):e;return o.length<2?{type:Hd,reason:"Less than 2 rows"}:{type:Nd,spreadsheet:{title:i?e[0][n]:null,labels:o.map((e=>e[r])),values:o.map((e=>Bd(e[n])))}}},Wd=at.elementBackground.slice(2,at.elementBackground.length),Kd={fillStyle:"hachure",fontFamily:o.rk,fontSize:o.n5,opacity:100,roughness:1,strokeColor:at.elementStroke[0],strokeSharpness:"sharp",strokeStyle:"solid",strokeWidth:1,verticalAlign:o.oX.MIDDLE},Vd=e=>({chartWidth:44*e.values.length+zd,chartHeight:280}),Gd=(e,t,n,r,i)=>{var o;return(null===(o=e.labels)||void 0===o?void 0:o.map(((e,o)=>Qr(Object.assign(Object.assign({groupIds:[r],backgroundColor:i},Kd),{text:e.length>8?"".concat(e.slice(0,5),"..."):e,x:t+44*o+24,y:n+6,width:Dd,angle:5.87,fontSize:16,textAlign:"center",verticalAlign:"top"})))))||[]},Yd=(e,t,n,r,i)=>{const o=Qr(Object.assign(Object.assign({groupIds:[r],backgroundColor:i},Kd),{x:t-zd,y:n-zd,text:"0",textAlign:"right"}));return[o,Qr(Object.assign(Object.assign({groupIds:[r],backgroundColor:i},Kd),{x:t-zd,y:n-Rd-o.height/2,text:Math.max(...e.values).toLocaleString(),textAlign:"right"}))]},Xd=(e,t,n,r,i)=>{const{chartWidth:o,chartHeight:a}=Vd(e);return[ei(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Kd),{type:"line",x:t,y:n,startArrowhead:null,endArrowhead:null,width:o,points:[[0,0],[o,0]]})),ei(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Kd),{type:"line",x:t,y:n,startArrowhead:null,endArrowhead:null,height:a,points:[[0,0],[0,-a]]})),ei(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Kd),{type:"line",x:t,y:n-Rd-zd,startArrowhead:null,endArrowhead:null,strokeStyle:"dotted",width:o,opacity:50,points:[[0,0],[o,0]]}))]},Zd=(e,t,n,r,i,a)=>{const{chartWidth:s,chartHeight:l}=Vd(e),c=e.title?Qr(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Kd),{text:e.title,x:t+s/2,y:n-Rd-24-o.n5,strokeSharpness:"sharp",strokeStyle:"solid",textAlign:"center"})):null,d=a?qr(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Kd),{type:"rectangle",x:t,y:n-l,width:s,height:l,strokeColor:at.elementStroke[0],fillStyle:"solid",opacity:6})):null;return[...d?[d]:[],...c?[c]:[],...Gd(e,t,n,r,i),...Yd(e,t,n,r,i),...Xd(e,t,n,r,i)]},qd=(e,t,n,r)=>"line"===e?((e,t,n)=>{const r=Math.max(...e.values),i=Lr(),a=Wd[Math.floor(Math.random()*Wd.length)];let s=0;const l=[];for(const t of e.values){const e=44*s,n=-t/r*Rd;l.push([e,n]),s++}const c=Math.max(...l.map((e=>e[0]))),d=Math.max(...l.map((e=>e[1]))),u=Math.min(...l.map((e=>e[0]))),h=Math.min(...l.map((e=>e[1]))),p=ei(Object.assign(Object.assign({backgroundColor:a,groupIds:[i]},Kd),{type:"line",x:t+zd+16,y:n-zd,startArrowhead:null,endArrowhead:null,height:d-h,width:c-u,strokeWidth:2,points:l})),g=e.values.map(((e,o)=>{const s=44*o+6,l=-e/r*Rd+6;return qr(Object.assign(Object.assign({backgroundColor:a,groupIds:[i]},Kd),{fillStyle:"solid",strokeWidth:2,type:"ellipse",x:t+s+16,y:n+l-24,width:zd,height:zd}))})),m=e.values.map(((e,o)=>{const s=44*o+6,l=e/r*Rd+6+zd;return ei(Object.assign(Object.assign({backgroundColor:a,groupIds:[i]},Kd),{type:"line",x:t+s+16+6,y:n-l,startArrowhead:null,endArrowhead:null,height:l,strokeStyle:"dotted",opacity:50,points:[[0,0],[0,l]]}))}));return[...Zd(e,t,n,i,a,"production"===o.Vi.DEVELOPMENT),p,...m,...g]})(t,n,r):((e,t,n)=>{const r=Math.max(...e.values),i=Lr(),a=Wd[Math.floor(Math.random()*Wd.length)],s=e.values.map(((e,o)=>{const s=e/r*Rd;return qr(Object.assign(Object.assign({backgroundColor:a,groupIds:[i]},Kd),{type:"rectangle",x:t+44*o+zd,y:n-s-zd,width:Dd,height:s}))}));return[...s,...Zd(e,t,n,i,a,"production"===o.Vi.DEVELOPMENT)]})(t,n,r);let $d="",Qd=!1;const Jd="clipboard"in navigator&&"readText"in navigator.clipboard,eu="clipboard"in navigator&&"writeText"in navigator.clipboard,tu="clipboard"in navigator&&"write"in navigator.clipboard&&"ClipboardItem"in window&&"toBlob"in HTMLCanvasElement.prototype,nu=async(e,t,n)=>{const r=Al(e,t,!0),i={type:o.r8.excalidrawClipboard,elements:r,files:r.reduce(((e,t)=>(ke(t)&&n[t.fileId]&&(e[t.fileId]=n[t.fileId]),e)),{})},a=JSON.stringify(i);$d=a;try{Qd=!1,await au(a)}catch(e){Qd=!0,console.error(e)}},ru=()=>{if(!$d)return{};try{return JSON.parse($d)}catch(e){return console.error(e),{}}},iu=e=>{const t=(e=>{let t=e.trim().split("\n").map((e=>e.trim().split("\t")));if(t.length&&2!==t[0].length&&(t=e.trim().split("\n").map((e=>e.trim().split(",")))),0===t.length)return{type:Hd,reason:"No values"};const n=t[0].length,r=t.every((e=>e.length===n));if(!r)return{type:Hd,reason:"All rows don't have same number of columns"};const i=Ud(t);if(i.type!==Nd){const e=Ud((e=>{const t=[];for(let n=0;n<e[0].length;n++){const r=[];for(let t=0;t<e.length;t++)r.push(e[t][n]);t.push(r)}return t})(t));if(e.type===Nd)return e}return i})(e);return t.type===Nd?{spreadsheet:t.spreadsheet}:null},ou=async e=>{const t=await(async e=>{try{var t;return(e?null===(t=e.clipboardData)||void 0===t?void 0:t.getData("text/plain").trim():Jd&&await navigator.clipboard.readText())||""}catch(e){return""}})(e);if(!t||t.includes(Od))return ru();const n=iu(t);if(n)return n;const r=ru();try{const e=JSON.parse(t);return i=e,[o.r8.excalidraw,o.r8.excalidrawClipboard].includes(null==i?void 0:i.type)&&Array.isArray(i.elements)?{elements:e.elements,files:e.files}:r}catch(e){return Qd&&r.elements?r:{text:t}}var i},au=async e=>{let t=!1;if(eu)try{await navigator.clipboard.writeText(e||""),t=!0}catch(e){console.error(e)}if(!t&&!su(e||" "))throw new Error("couldn't copy")},su=e=>{const 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";const 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);let i=!1;try{n.select(),n.setSelectionRange(0,n.value.length),i=document.execCommand("copy")}catch(e){console.error(e)}return n.remove(),i},lu=async(e,t,r,i,a)=>{let{exportBackground:s,exportPadding:l=o.qy,viewBackgroundColor:c,name:d,fileHandle:u=null}=a;if(0===t.length)throw new Error(b("alerts.cannotExportEmptyCanvas"));if("svg"===e||"clipboard-svg"===e){const n=await Ad(t,{exportBackground:s,exportWithDarkMode:r.exportWithDarkMode,viewBackgroundColor:c,exportPadding:l,exportScale:r.exportScale,exportEmbedScene:r.exportEmbedScene&&"svg"===e},i);if("svg"===e)return await od(new Blob([n.outerHTML],{type:o.LO.svg}),{description:"Export to SVG",name:d,extension:"svg",fileHandle:u});if("clipboard-svg"===e)return void await au(n.outerHTML)}const h=await Ld(t,r,i,{exportBackground:s,viewBackgroundColor:c,exportPadding:l});h.style.display="none",document.body.appendChild(h);let p=await xd(h);if(h.remove(),"png"===e)return r.exportEmbedScene&&(p=await(await Promise.all([n.e(736),n.e(9)]).then(n.bind(n,673))).encodePngMetadata({blob:p,metadata:Ed(t,r,i,"local")})),await od(p,{description:"Export to PNG",name:d,extension:"png",fileHandle:u});if("clipboard"===e)try{await(async e=>{await navigator.clipboard.write([new window.ClipboardItem({[o.LO.png]:e})])})(p)}catch(e){if("CANVAS_POSSIBLY_TOO_BIG"===e.name)throw e;throw new Error(b("alerts.couldNotCopyToClipboard"))}};n(7225);const cu=e=>{let{children:t,checked:n,onChange:r,className:i}=e;return(0,v.jsxs)("div",{className:ye("Checkbox",i,{"is-checked":n}),onClick:e=>{r(!n,e),e.currentTarget.querySelector(".Checkbox-box").focus()},children:[(0,v.jsx)("button",{className:"Checkbox-box",role:"checkbox","aria-checked":n,children:va}),(0,v.jsx)("div",{className:"Checkbox-label",children:t})]})};n(4623);const du=e=>{let{children:t,gap:n,align:r,justifyContent:i,className:o,style:a}=e;return(0,v.jsx)("div",{className:ye("Stack Stack_horizontal",o),style:Object.assign({"--gap":n,alignItems:r,justifyContent:i},a),children:t})},uu=e=>{let{children:t,gap:n,align:r,justifyContent:i,className:o}=e;return(0,v.jsx)("div",{className:ye("Stack Stack_vertical",o),style:{"--gap":n,justifyItems:r,justifyContent:i},children:t})};n(554);const hu=e=>{let{fileName:t,onSave:n}=e;return(0,v.jsxs)(du,{className:"ActiveFile",gap:1,align:"center",children:[(0,v.jsxs)("span",{className:"ActiveFile__fileName",children:[$a,(0,v.jsx)("span",{children:t})]}),(0,v.jsx)(Js,{type:"icon",icon:ya,title:b("buttons.save"),"aria-label":b("buttons.save"),onClick:n,"data-testid":"save-button"})]})},pu=(Ks({name:"changeProjectName",perform:(e,t,n)=>(rc("change","title"),{appState:Object.assign(Object.assign({},t),{name:n}),commitToHistory:!1}),PanelComponent:e=>{let{appState:t,updateData:n,appProps:r}=e;return(0,v.jsx)(ic,{label:b("labels.fileTitle"),value:t.name||"Unnamed",onChange:e=>n(e),isNameEditable:void 0===r.name&&!t.viewModeEnabled})}}),Ks({name:"changeExportScale",perform:(e,t,n)=>({appState:Object.assign(Object.assign({},t),{exportScale:n}),commitToHistory:!1}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;const i=El(t),a=Ol(i,n)?Al(i,n):i;return(0,v.jsx)(v.Fragment,{children:o.ZB.map((e=>{const[t,i]=((e,t,n)=>{const[,,r,i]=Pd(e,t).map((e=>Math.trunc(e*n)));return[r,i]})(a,o.qy,e),s="".concat(b("buttons.scale")," ").concat(e,"x (").concat(t,"x").concat(i,")");return(0,v.jsx)(Js,{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:()=>r(e)},e)}))})}}),Ks({name:"changeExportBackground",perform:(e,t,n)=>({appState:Object.assign(Object.assign({},t),{exportBackground:n}),commitToHistory:!1}),PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,v.jsx)(cu,{checked:t.exportBackground,onChange:e=>n(e),children:b("labels.withBackground")})}}),Ks({name:"changeExportEmbedScene",perform:(e,t,n)=>({appState:Object.assign(Object.assign({},t),{exportEmbedScene:n}),commitToHistory:!1}),PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,v.jsxs)(cu,{checked:t.exportEmbedScene,onChange:e=>n(e),children:[b("labels.exportEmbedScene"),(0,v.jsx)(ll,{label:b("labels.exportEmbedScene_details"),long:!0,children:(0,v.jsx)("div",{className:"excalidraw-tooltip-icon",children:Pa})})]})}}),Ks({name:"saveToActiveFile",perform:async(e,t,n,r)=>{const i=!!t.fileHandle;try{const{fileHandle:n}=md(t.fileHandle)?await(async(e,t,n)=>{const{exportBackground:r,viewBackgroundColor:i,name:o,fileHandle:a}=t,s=gd(a);if(!a||"png"!==(l=s)&&"svg"!==l)throw new Error("fileHandle should exist and should be of type svg or png when resaving");var l;return t=Object.assign(Object.assign({},t),{exportEmbedScene:!0}),await lu(s,El(e),t,n,{exportBackground:r,viewBackgroundColor:i,name:o,fileHandle:a}),{fileHandle:a}})(e,t,r.files):await Sd(e,t,r.files);return{commitToHistory:!1,appState:Object.assign(Object.assign({},t),{fileHandle:n,toastMessage:i?null!=n&&n.name?b("toast.fileSavedToFilename").replace("{filename}",'"'.concat(n.name,'"')):b("toast.fileSaved"):null})}}catch(e){return"AbortError"!==(null==e?void 0:e.name)?console.error(e):console.warn(e),{commitToHistory:!1}}},keyTest:e=>e.key===Lt.S&&e[Lt.CTRL_OR_CMD]&&!e.shiftKey,PanelComponent:e=>{var t;let{updateData:n,appState:r}=e;return(0,v.jsx)(hu,{onSave:()=>n(null),fileName:null===(t=r.fileHandle)||void 0===t?void 0:t.name})}}),Ks({name:"saveFileToDisk",perform:async(e,t,n,r)=>{try{const{fileHandle:n}=await Sd(e,Object.assign(Object.assign({},t),{fileHandle:null}),r.files);return{commitToHistory:!1,appState:Object.assign(Object.assign({},t),{fileHandle:n})}}catch(e){return"AbortError"!==(null==e?void 0:e.name)?console.error(e):console.warn(e),{commitToHistory:!1}}},keyTest:e=>e.key===Lt.S&&e.shiftKey&&e[Lt.CTRL_OR_CMD],PanelComponent:e=>{let{updateData:t}=e;return(0,v.jsx)(Js,{type:"button",icon:wa,title:b("buttons.saveAs"),"aria-label":b("buttons.saveAs"),showAriaLabel:up(),hidden:!td,onClick:()=>t(null),"data-testid":"save-as-button"})}}));Ks({name:"loadScene",perform:async(e,t,n,r)=>{try{const{elements:n,appState:r,files:i}=await(async(e,t)=>{const n=await id({description:"Excalidraw files"});return bd(n,e,t)})(t,e);return{elements:n,appState:r,files:i,commitToHistory:!0}}catch(n){return"AbortError"===(null==n?void 0:n.name)?(console.warn(n),!1):{elements:e,appState:Object.assign(Object.assign({},t),{errorMessage:n.message}),files:r.files,commitToHistory:!1}}},keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.key===Lt.O,PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,v.jsx)(Js,{type:"button",icon:ka,title:b("buttons.load"),"aria-label":b("buttons.load"),showAriaLabel:up(),onClick:t,"data-testid":"load-button"})}}),Ks({name:"exportWithDarkMode",perform:(e,t,n)=>({appState:Object.assign(Object.assign({},t),{exportWithDarkMode:n}),commitToHistory:!1}),PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,v.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"-45px",marginBottom:"10px"},children:(0,v.jsx)(el,{value:t.exportWithDarkMode?o.C6.DARK:o.C6.LIGHT,onChange:e=>{n(e===o.C6.DARK)},title:b("labels.toggleExportColorScheme")})})}});let gu="{}";const mu=Ks({name:"copyStyles",perform:(e,t)=>{const n=e.find((e=>t.selectedElementIds[e.id]));return n&&(gu=JSON.stringify(n)),{appState:Object.assign(Object.assign({},t),{toastMessage:b("toast.copyStyles")}),commitToHistory:!1}},contextItemLabel:"labels.copyStyles",keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.altKey&&e.code===_t}),fu=Ks({name:"pasteStyles",perform:(e,t)=>{const n=JSON.parse(gu);return"text"!==(null==(r=n)?void 0:r.type)&&"diamond"!==(null==r?void 0:r.type)&&"rectangle"!==(null==r?void 0:r.type)&&"ellipse"!==(null==r?void 0:r.type)&&"arrow"!==(null==r?void 0:r.type)&&"freedraw"!==(null==r?void 0:r.type)&&"line"!==(null==r?void 0:r.type)?{elements:e,commitToHistory:!1}:{elements:e.map((e=>{if(t.selectedElementIds[e.id]){const t=Pr(e,{backgroundColor:null==n?void 0:n.backgroundColor,strokeWidth:null==n?void 0:n.strokeWidth,strokeColor:null==n?void 0:n.strokeColor,strokeStyle:null==n?void 0:n.strokeStyle,fillStyle:null==n?void 0:n.fillStyle,opacity:null==n?void 0:n.opacity,roughness:null==n?void 0:n.roughness});return Ce(t)&&Ce(e)&&(Ar(t,{fontSize:(null==n?void 0:n.fontSize)||o.n5,fontFamily:(null==n?void 0:n.fontFamily)||o.rk,textAlign:(null==n?void 0:n.textAlign)||o.Hg}),Nn(t,tr(t))),t}return e})),commitToHistory:!0};var r},contextItemLabel:"labels.pasteStyles",keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.altKey&&e.code===It}),bu=e=>(0,v.jsx)("button",{className:"help-icon",onClick:e.onClick,type:"button",title:"".concat(e.title," — ?"),"aria-label":e.title,children:Pa}),vu=(Ks({name:"toggleCanvasMenu",perform:(e,t)=>({appState:Object.assign(Object.assign({},t),{openMenu:"canvas"===t.openMenu?null:"canvas"}),commitToHistory:!1}),PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,v.jsx)(Js,{type:"button",icon:Oa,"aria-label":b("buttons.menu"),onClick:n,selected:"canvas"===t.openMenu})}}),Ks({name:"toggleEditMenu",perform:(e,t)=>({appState:Object.assign(Object.assign({},t),{openMenu:"shape"===t.openMenu?null:"shape"}),commitToHistory:!1}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)(Js,{visible:kl(n,El(t)),type:"button",icon:Ea,"aria-label":b("buttons.edit"),onClick:r,selected:"shape"===n.openMenu})}}),Ks({name:"toggleFullScreen",perform:()=>(Xt()||document.documentElement.requestFullscreen(),Xt()&&document.exitFullscreen(),{commitToHistory:!1}),keyTest:e=>e.code===St&&!e[Lt.CTRL_OR_CMD]}),Ks({name:"toggleShortcuts",perform:(e,t,n,r)=>{let{focusContainer:i}=r;return t.showHelpDialog&&i(),{appState:Object.assign(Object.assign({},t),{showHelpDialog:!t.showHelpDialog}),commitToHistory:!1}},PanelComponent:e=>{let{updateData:t}=e;return(0,v.jsx)(bu,{title:b("helpDialog.title"),onClick:t})},keyTest:e=>e.key===Lt.QUESTION_MARK}),(e,t)=>{const n=Al(El(e),t,!0);return n.length>=2&&!(e=>{if(e.length>=2){const t=e[0].groupIds;for(const n of t)if(e.reduce(((e,t)=>e&&Kr(t,n)),!0))return!0}return!1})(n)}),xu=Ks({name:"group",perform:(e,t)=>{const n=Al(El(e),t,!0);if(n.length<2)return{appState:t,elements:e,commitToHistory:!1};const r=Ur(t);if(1===r.length){const i=r[0],o=new Set(Vr(e,i).map((e=>e.id))),a=new Set(n.map((e=>e.id)));if(new Set([...Array.from(o),...Array.from(a)]).size===o.size)return{appState:t,elements:e,commitToHistory:!1}}const i=Lr(),o=ln(n),a=e.map((e=>o.get(e.id)?Pr(e,{groupIds:Gr(e.groupIds,i,t.editingGroupId)}):e)),s=Vr(a,i),l=s[s.length-1],c=a.lastIndexOf(l),d=a.slice(c+1),u=[...a.slice(0,c).filter((e=>!Kr(e,i))),...s,...d];return{appState:Nr(i,Object.assign(Object.assign({},t),{selectedGroupIds:{}}),El(u)),elements:u,commitToHistory:!0}},contextItemLabel:"labels.group",contextItemPredicate:(e,t)=>vu(e,t),keyTest:e=>!e.shiftKey&&e[Lt.CTRL_OR_CMD]&&e.code===Et,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)(Js,{hidden:!vu(t,n),type:"button",icon:(0,v.jsx)(Qa,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.group")," — ").concat(Zt("CtrlOrCmd+G")),"aria-label":b("labels.group"),visible:Ol(El(t),n)})}}),yu=Ks({name:"ungroup",perform:(e,t)=>{if(0===Ur(t).length)return{appState:t,elements:e,commitToHistory:!1};const n=[],r=e.map((e=>{Pe(e)&&n.push(e.id);const r=((e,t)=>e.filter((e=>!t[e])))(e.groupIds,t.selectedGroupIds);return r.length===e.groupIds.length?e:Pr(e,{groupIds:r})})),i=Wr(Object.assign(Object.assign({},t),{selectedGroupIds:{}}),El(r));return n.forEach((e=>i.selectedElementIds[e]=!1)),{appState:i,elements:r,commitToHistory:!0}},keyTest:e=>e.shiftKey&&e[Lt.CTRL_OR_CMD]&&e.code===Et,contextItemLabel:"labels.ungroup",contextItemPredicate:(e,t)=>Ur(t).length>0,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)(Js,{type:"button",hidden:0===Ur(n).length,icon:(0,v.jsx)(Ja,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.ungroup")," — ").concat(Zt("CtrlOrCmd+Shift+G")),"aria-label":b("labels.ungroup"),visible:Ol(El(t),n)})}});n(2789);const wu=e=>{let{children:t,color:n,border:r,onClick:i}=e;return(0,v.jsx)("div",{className:"Avatar",style:{background:n,border:"2px solid ".concat(r)},onClick:i,children:t})},ku=(Ks({name:"goToCollaborator",perform:(e,t,n)=>{const r=n;return r?{appState:Object.assign(Object.assign(Object.assign({},t),nl({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:e=>{let{appState:t,updateData:n,data:r}=e;const i=null==r?void 0:r.id;if(!i)return null;const o=t.collaborators.get(i);if(!o)return null;const{background:a,stroke:s}=oc(o.picture||i,t),l=o.picture,c=(e=>{if(!e)return"?";const t=e.trim().split(" ");if(t.length<2)return t[0].substring(0,2).toUpperCase();const n=t[0],r=t[t.length-1];return(n[0]+r[0]).toUpperCase()})(o.username);return(0,v.jsx)(wu,{color:a,border:l?"transparent":s,onClick:()=>n(o.pointer),children:l?(0,v.jsx)("img",{referrerPolicy:"no-referrer",src:l,alt:c}):c})}}),Ks({name:"addToLibrary",perform:(e,t,n,r)=>{const i=Al(El(e),t,!0);return i.some((e=>"image"===e.type))?{commitToHistory:!1,appState:Object.assign(Object.assign({},t),{errorMessage:"Support for adding images to the library coming soon!"})}:r.library.loadLibrary().then((e=>r.library.saveLibrary([{id:Lr(),status:"unpublished",elements:i.map(ti),created:Date.now()},...e]))).then((()=>({commitToHistory:!1,appState:Object.assign(Object.assign({},t),{toastMessage:b("toast.addedToLibrary")})}))).catch((e=>({commitToHistory:!1,appState:Object.assign(Object.assign({},t),{errorMessage:e.message})})))},contextItemLabel:"labels.addToLibrary"})),_u=(e,t,n)=>{let{axis:r,position:i}=n;const o=rt(e),[a,s]="x"===r?["minX","maxX"]:["minY","maxY"],l={x:0,y:0};return"start"===i?Object.assign(Object.assign({},l),{[r]:t[a]-o[a]}):"end"===i?Object.assign(Object.assign({},l),{[r]:t[s]-o[s]}):Object.assign(Object.assign({},l),{[r]:(t[a]+t[s])/2-(o[a]+o[s])/2})},Cu=(e,t)=>Al(El(e),t).length>1,Eu=(e,t,n)=>{const r=((e,t)=>{const n=Yr(e),r=rt(e);return n.flatMap((e=>{const n=_u(e,r,t);return e.map((e=>Pr(e,{x:e.x+n.x,y:e.y+n.y})))}))})(Al(El(e),t),n),i=ln(r);return e.map((e=>i.get(e.id)||e))},Su=(Ks({name:"alignTop",perform:(e,t)=>({appState:t,elements:Eu(e,t,{position:"start",axis:"y"}),commitToHistory:!0}),keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.shiftKey&&e.key===Lt.ARROW_UP,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)(Js,{hidden:!Cu(t,n),type:"button",icon:(0,v.jsx)(Na,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.alignTop")," — ").concat(Zt("CtrlOrCmd+Shift+Up")),"aria-label":b("labels.alignTop"),visible:Ol(El(t),n)})}}),Ks({name:"alignBottom",perform:(e,t)=>({appState:t,elements:Eu(e,t,{position:"end",axis:"y"}),commitToHistory:!0}),keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.shiftKey&&e.key===Lt.ARROW_DOWN,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)(Js,{hidden:!Cu(t,n),type:"button",icon:(0,v.jsx)(Ba,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.alignBottom")," — ").concat(Zt("CtrlOrCmd+Shift+Down")),"aria-label":b("labels.alignBottom"),visible:Ol(El(t),n)})}}),Ks({name:"alignLeft",perform:(e,t)=>({appState:t,elements:Eu(e,t,{position:"start",axis:"x"}),commitToHistory:!0}),keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.shiftKey&&e.key===Lt.ARROW_LEFT,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)(Js,{hidden:!Cu(t,n),type:"button",icon:(0,v.jsx)(Fa,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.alignLeft")," — ").concat(Zt("CtrlOrCmd+Shift+Left")),"aria-label":b("labels.alignLeft"),visible:Ol(El(t),n)})}}),Ks({name:"alignRight",perform:(e,t)=>({appState:t,elements:Eu(e,t,{position:"end",axis:"x"}),commitToHistory:!0}),keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.shiftKey&&e.key===Lt.ARROW_RIGHT,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)(Js,{hidden:!Cu(t,n),type:"button",icon:(0,v.jsx)(Ua,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.alignRight")," — ").concat(Zt("CtrlOrCmd+Shift+Right")),"aria-label":b("labels.alignRight"),visible:Ol(El(t),n)})}}),Ks({name:"alignVerticallyCentered",perform:(e,t)=>({appState:t,elements:Eu(e,t,{position:"center",axis:"y"}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)(Js,{hidden:!Cu(t,n),type:"button",icon:(0,v.jsx)(Va,{theme:n.theme}),onClick:()=>r(null),title:b("labels.centerVertically"),"aria-label":b("labels.centerVertically"),visible:Ol(El(t),n)})}}),Ks({name:"alignHorizontallyCentered",perform:(e,t)=>({appState:t,elements:Eu(e,t,{position:"center",axis:"x"}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)(Js,{hidden:!Cu(t,n),type:"button",icon:(0,v.jsx)(Ga,{theme:n.theme}),onClick:()=>r(null),title:b("labels.centerHorizontally"),"aria-label":b("labels.centerHorizontally"),visible:Ol(El(t),n)})}}),(e,t)=>Al(El(e),t).length>1),ju=(e,t,n)=>{const r=((e,t)=>{const[n,r,i,o]="x"===t.axis?["minX","midX","maxX","width"]:["minY","midY","maxY","height"],a=rt(e),s=Yr(e).map((e=>[e,rt(e)])).sort(((e,t)=>e[1][r]-t[1][r]));let l=0;for(const e of s)l+=e[1][o];const c=(a[o]-l)/(s.length-1);if(c<0){const e=s.findIndex((e=>e[1][n]===a[n])),o=s.findIndex((e=>e[1][i]===a[i])),l=(s[o][1][r]-s[e][1][r])/(s.length-1);let c=s[e][1][r];return s.flatMap(((n,i)=>{let[a,s]=n;const d={x:0,y:0};return i!==e&&i!==o&&(c+=l,d[t.axis]=c-s[r]),a.map((e=>Pr(e,{x:e.x+d.x,y:e.y+d.y})))}))}let d=a[n];return s.flatMap((e=>{let[r,i]=e;const a={x:0,y:0};return a[t.axis]=d-i[n],d+=c,d+=i[o],r.map((e=>Pr(e,{x:e.x+a.x,y:e.y+a.y})))}))})(Al(El(e),t),n),i=ln(r);return e.map((e=>i.get(e.id)||e))},Iu=(Ks({name:"distributeHorizontally",perform:(e,t)=>({appState:t,elements:ju(e,t,{space:"between",axis:"x"}),commitToHistory:!0}),keyTest:e=>!e[Lt.CTRL_OR_CMD]&&e.altKey&&e.code===jt,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)(Js,{hidden:!Su(t,n),type:"button",icon:(0,v.jsx)(Wa,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.distributeHorizontally")," — ").concat(Zt("Alt+H")),"aria-label":b("labels.distributeHorizontally"),visible:Ol(El(t),n)})}}),Ks({name:"distributeVertically",perform:(e,t)=>({appState:t,elements:ju(e,t,{space:"between",axis:"y"}),commitToHistory:!0}),keyTest:e=>!e[Lt.CTRL_OR_CMD]&&e.altKey&&e.code===It,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)(Js,{hidden:!Su(t,n),type:"button",icon:(0,v.jsx)(Ka,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.distributeVertically")," — ").concat(Zt("Alt+V")),"aria-label":b("labels.distributeVertically"),visible:Ol(El(t),n)})}}),Ks({name:"flipHorizontal",perform:(e,t)=>({elements:Mu(e,t,"horizontal"),appState:t,commitToHistory:!0}),keyTest:e=>e.shiftKey&&"KeyH"===e.code,contextItemLabel:"labels.flipHorizontal",contextItemPredicate:(e,t)=>((e,t)=>{const n=Al(El(e),t);return 1===n.length&&"text"!==n[0].type})(e,t)})),Tu=Ks({name:"flipVertical",perform:(e,t)=>({elements:Mu(e,t,"vertical"),appState:t,commitToHistory:!0}),keyTest:e=>e.shiftKey&&"KeyV"===e.code,contextItemLabel:"labels.flipVertical",contextItemPredicate:(e,t)=>((e,t)=>1===Al(El(e),t).length)(e,t)}),Mu=(e,t,n)=>{const r=Al(El(e),t);if(r.length>1)return e;const i=Ou(r,t,n),o=ln(i);return e.map((e=>o.get(e.id)||e))},Ou=(e,t,n)=>(e.forEach((e=>{Lu(e,t),"vertical"===n&&Au(e,Math.PI)})),e),Lu=(e,t)=>{const n=e.x,r=e.y,i=e.width,o=e.height,a=Xo(e.angle);let s=0;(je(e)||Ee(e))&&(s=2*e.points.reduce(((e,t)=>Math.max(e,t[0])),0)-e.width),Ar(e,{angle:Xo(0)});const l=di(e,t.zoom);let c=!0,d=0,u=l.nw;if(!u&&(c=!1,u=l.ne,!u))return void Ar(e,{angle:a});if(je(e)){for(let t=1;t<e.points.length;t++)xo.movePoints(e,[{index:t,point:[-e.points[t][0],e.points[t][1]]}]);xo.normalizePoints(e)}else d=c?e.x+2*i:e.x-2*i,ea((new Map).set(e.id,e),!0,e,c?"nw":"ne",!1,d,u[1]),Ar(e,{width:i,height:o});let h=Xo(2*Math.PI-a);h<0&&(h=Xo(h+2*Math.PI)),Ar(e,{angle:h}),Ar(e,{x:n+s,y:r}),Po(e)},Au=(e,t)=>{const n=e.x,r=e.y;let i=Xo(e.angle+t);i<0&&(i=Xo(2*Math.PI+i)),Ar(e,{angle:i}),Ar(e,{x:n,y:r})},Pu=Ks({name:"copy",perform:(e,t,n,r)=>(nu(El(e),t,r.files),{commitToHistory:!1}),contextItemLabel:"labels.copy",keyTest:void 0}),Du=Ks({name:"cut",perform:(e,t,n,r)=>(Pu.perform(e,t,n,r),zl.perform(e,t)),contextItemLabel:"labels.cut",keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.code===Tt}),zu=Ks({name:"copyAsSvg",perform:async(e,t,n,r)=>{if(!r.canvas)return{commitToHistory:!1};const i=Al(El(e),t,!0);try{return await lu("clipboard-svg",i.length?i:El(e),t,r.files,t),{commitToHistory:!1}}catch(e){return console.error(e),{appState:Object.assign(Object.assign({},t),{errorMessage:e.message}),commitToHistory:!1}}},contextItemLabel:"labels.copyAsSvg"}),Ru=Ks({name:"copyAsPng",perform:async(e,t,n,r)=>{if(!r.canvas)return{commitToHistory:!1};const i=Al(El(e),t,!0);try{return await lu("clipboard",i.length?i:El(e),t,r.files,t),{appState:Object.assign(Object.assign({},t),{toastMessage:b("toast.copyToClipboardAsPng",{exportSelection:i.length?b("toast.selection"):b("toast.canvas"),exportColorScheme:t.exportWithDarkMode?b("buttons.darkMode"):b("buttons.lightMode")})}),commitToHistory:!1}}catch(e){return console.error(e),{appState:Object.assign(Object.assign({},t),{errorMessage:e.message}),commitToHistory:!1}}},contextItemLabel:"labels.copyAsPng",keyTest:e=>e.code===_t&&e.altKey&&e.shiftKey}),Hu=Ks({name:"gridMode",perform(e,t){return rc("view","mode","grid"),{appState:Object.assign(Object.assign({},t),{gridSize:this.checked(t)?null:o.k}),commitToHistory:!1}},checked:e=>null!==e.gridSize,contextItemLabel:"labels.showGrid",keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.code===yt}),Nu=Ks({name:"zenMode",perform(e,t){return rc("view","mode","zen"),{appState:Object.assign(Object.assign({},t),{zenModeEnabled:!this.checked(t)}),commitToHistory:!1}},checked:e=>e.zenModeEnabled,contextItemLabel:"buttons.zenMode",keyTest:e=>!e[Lt.CTRL_OR_CMD]&&e.altKey&&e.code===Mt}),Bu=Ks({name:"stats",perform(e,t){return{appState:Object.assign(Object.assign({},t),{showStats:!this.checked(t)}),commitToHistory:!1}},checked:e=>e.showStats,contextItemLabel:"stats.title",keyTest:e=>!e[Lt.CTRL_OR_CMD]&&e.altKey&&e.code===kt}),Fu=Ks({name:"unbindText",contextItemLabel:"labels.unbindText",perform:(e,t)=>(Al(El(e),t).forEach((e=>{const t=er(e);if(t){var n;const{width:r,height:i,baseline:o}=Un(t.originalText,Ut(t));Ar(t,{containerId:null,width:r,height:i,baseline:o,text:t.originalText}),Ar(e,{boundElements:null===(n=e.boundElements)||void 0===n?void 0:n.filter((e=>e.id!==t.id))})}})),{elements:e,appState:t,commitToHistory:!0})}),Uu=(e,t,n)=>{const r=!1;if(!(t.multiElement||t.resizingElement||t.editingElement||t.draggingElement)){const i=n();if(null===i)return{commitToHistory:r};const o=ln(e),a=i.elements,s=ln(a),l=e.filter((e=>!s.has(e.id))),c=a.map((e=>Pr(o.get(e.id)||e,e))).concat(l.map((e=>Pr(e,{isDeleted:!0}))));return Go(c,l),{elements:c,appState:Object.assign(Object.assign({},t),i.appState),commitToHistory:r,syncHistory:!0}}return{commitToHistory:r}},Wu=(e,t,n)=>{if(!1!==e.trackEvent)try{var r;if(!0===e.trackEvent)rc(e.name,t,"number"==typeof n||"string"==typeof n?String(n):void 0);else null===(r=e.trackEvent)||void 0===r||r.call(e,e,t,n)}catch(e){console.error("error while logging action:",e)}};class Ku{constructor(e,t,n,r){this.actions={},this.renderAction=(e,t)=>{const n=this.app.props.UIOptions.canvasActions;if(this.actions[e]&&"PanelComponent"in this.actions[e]&&(!n||!(e in n)||n[e])){const n=this.actions[e],r=n.PanelComponent,i=e=>{this.updater(n.perform(this.getElementsIncludingDeleted(),this.getAppState(),e,this.app)),Wu(n,"ui",e)};return(0,v.jsx)(r,{elements:this.getElementsIncludingDeleted(),appState:this.getAppState(),updateData:i,appProps:this.app.props,data:t})}return null},this.updater=t=>{if(!t||!("then"in t))return e(t);t.then((t=>e(t)))},this.getAppState=t,this.getElementsIncludingDeleted=n,this.app=r}registerAction(e){this.actions[e.name]=e}registerAll(e){e.forEach((e=>this.registerAction(e)))}handleKeyDown(e){const t=this.app.props.UIOptions.canvasActions,n=Object.values(this.actions).sort(((e,t)=>(t.keyPriority||0)-(e.keyPriority||0))).filter((n=>(!t||!(n.name in t)||t[n.name])&&n.keyTest&&n.keyTest(e,this.getAppState(),this.getElementsIncludingDeleted())));if(1!==n.length)return n.length>1&&console.warn("Canceling as multiple actions match this shortcut",n),!1;const r=n[0],{viewModeEnabled:i}=this.getAppState();return!(i&&!Object.values(o.EH).includes(n[0].name))&&(Wu(r,"keyboard",null),e.preventDefault(),this.updater(n[0].perform(this.getElementsIncludingDeleted(),this.getAppState(),null,this.app)),!0)}executeAction(e){this.updater(e.perform(this.getElementsIncludingDeleted(),this.getAppState(),null,this.app)),Wu(e,"api",null)}}const Vu=class{constructor(e){this.libraryCache=null,this.resetLibrary=async()=>{var e,t;await(null===(e=(t=this.app.props).onLibraryChange)||void 0===e?void 0:e.call(t,[])),this.libraryCache=[]},this.restoreLibraryItem=e=>{const t=El(cd(e.elements,null));return t.length?Object.assign(Object.assign({},e),{elements:t}):null},this.loadLibrary=()=>new Promise((async e=>{if(this.libraryCache)return e(JSON.parse(JSON.stringify(this.libraryCache)));try{const t=this.app.libraryItemsFromStorage;if(!t)return e([]);const n=t.reduce(((e,t)=>(this.restoreLibraryItem(t)&&e.push(t),e)),[]);this.libraryCache=JSON.parse(JSON.stringify(n)),e(n)}catch(t){console.error(t),e([])}})),this.saveLibrary=async e=>{const t=this.libraryCache;try{var n,r;const t=JSON.stringify(e);this.libraryCache=JSON.parse(t),await(null===(n=(r=this.app.props).onLibraryChange)||void 0===n?void 0:n.call(r,e))}catch(e){throw this.libraryCache=t,e}},this.app=e}async importLibrary(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unpublished";const n=await vd(e);if(!n||!n.libraryItems&&!n.library)return;const r=(e,t)=>!e.find((e=>e.elements.length===t.elements.length&&e.elements.every(((e,n)=>e.id===t.elements[n].id&&e.versionNonce===t.elements[n].versionNonce)))),i=await this.loadLibrary(),o=n.libraryItems||n.library||[],a=hd(o,t),s=[];for(const e of a){const t=this.restoreLibraryItem(e);t&&r(i,t)&&s.push(t)}await this.saveLibrary([...s,...i])}},Gu=e=>{const t=Array.from(e.values());return{x:Xu(t,(e=>e.x))/t.length,y:Xu(t,(e=>e.y))/t.length}},Yu=e=>{let[t,n]=e;return Math.hypot(t.x-n.x,t.y-n.y)},Xu=(e,t)=>e.reduce(((e,n)=>e+t(n)),0),Zu=e=>({selectedElementIds:e.selectedElementIds,selectedGroupIds:e.selectedGroupIds,viewBackgroundColor:e.viewBackgroundColor,editingLinearElement:e.editingLinearElement,editingGroupId:e.editingGroupId,name:e.name});const qu=class{constructor(){this.elementCache=new Map,this.recording=!0,this.stateHistory=[],this.redoStack=[],this.lastEntry=null,this.generateEntry=(e,t)=>this.dehydrateHistoryEntry({appState:Zu(e),elements:t.reduce(((t,n)=>{if(je(n)&&e.multiElement&&e.multiElement.id===n.id){if(e.multiElement&&e.multiElement.id===n.id&&n.points.length<2)return t;t.push(Object.assign(Object.assign({},n),{points:n.lastCommittedPoint!==n.points[n.points.length-1]?n.points.slice(0,-1):n.points}))}else t.push(n);return t}),[])})}hydrateHistoryEntry(e){let{appState:t,elements:n}=e;return{appState:JSON.parse(t),elements:n.map((e=>{var t;const n=null===(t=this.elementCache.get(e.id))||void 0===t?void 0:t.get(e.versionNonce);if(!n)throw new Error("Element not found: ".concat(e.id,":").concat(e.versionNonce));return n}))}}dehydrateHistoryEntry(e){let{appState:t,elements:n}=e;return{appState:JSON.stringify(t),elements:n.map((e=>{this.elementCache.has(e.id)||this.elementCache.set(e.id,new Map);const t=this.elementCache.get(e.id);return t.has(e.versionNonce)||t.set(e.versionNonce,ti(e)),{id:e.id,versionNonce:e.versionNonce}}))}}getSnapshotForTest(){return{recording:this.recording,stateHistory:this.stateHistory.map((e=>this.hydrateHistoryEntry(e))),redoStack:this.redoStack.map((e=>this.hydrateHistoryEntry(e)))}}clear(){this.stateHistory.length=0,this.redoStack.length=0,this.lastEntry=null,this.elementCache.clear()}shouldCreateEntry(e){const{lastEntry:t}=this;if(!t)return!0;if(e.elements.length!==t.elements.length)return!0;for(let n=e.elements.length-1;n>-1;n--){const r=e.elements[n],i=t.elements[n];if(!r||!i||r.id!==i.id||r.versionNonce!==i.versionNonce)return!0}let n;for(n in e.appState){var r,i;if("editingLinearElement"===n)if((null===(r=e.appState[n])||void 0===r?void 0:r.elementId)===(null===(i=t.appState[n])||void 0===i?void 0:i.elementId))continue;if("selectedElementIds"!==n&&"selectedGroupIds"!==n&&e.appState[n]!==t.appState[n])return!0}return!1}pushEntry(e,t){const 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()}}clearRedoStack(){this.redoStack.splice(0,this.redoStack.length)}redoOnce(){if(0===this.redoStack.length)return null;const e=this.redoStack.pop();return void 0!==e?(this.stateHistory.push(e),this.hydrateHistoryEntry(e)):null}undoOnce(){if(1===this.stateHistory.length)return null;const e=this.stateHistory.pop(),t=this.stateHistory[this.stateHistory.length-1];return void 0!==e?(this.redoStack.push(e),this.hydrateHistoryEntry(t)):null}setCurrentState(e,t){this.lastEntry=this.hydrateHistoryEntry(this.generateEntry(e,t))}resumeRecording(){this.recording=!0}record(e,t){this.recording&&(this.pushEntry(e,t),this.recording=!1)}},$u=[{icon:(0,v.jsx)("svg",{viewBox:"0 0 320 512",className:"",children:(0,v.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:Lt.V},{icon:(0,v.jsx)("svg",{viewBox:"0 0 448 512",children:(0,v.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:Lt.R},{icon:(0,v.jsx)("svg",{viewBox:"0 0 223.646 223.646",children:(0,v.jsx)("path",{d:"M111.823 0L16.622 111.823 111.823 223.646 207.025 111.823z"})}),value:"diamond",key:Lt.D},{icon:(0,v.jsx)("svg",{viewBox:"0 0 512 512",children:(0,v.jsx)("path",{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"})}),value:"ellipse",key:Lt.E},{icon:(0,v.jsx)("svg",{viewBox:"0 0 448 512",className:"rtl-mirror",children:(0,v.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:Lt.A},{icon:(0,v.jsx)("svg",{viewBox:"0 0 6 6",children:(0,v.jsx)("line",{x1:"0",y1:"3",x2:"6",y2:"3",stroke:"currentColor",strokeLinecap:"round"})}),value:"line",key:[Lt.P,Lt.L]},{icon:(0,v.jsx)("svg",{viewBox:"0 0 512 512",children:(0,v.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:[Lt.X,Lt.P.toUpperCase()]},{icon:(0,v.jsx)("svg",{viewBox:"0 0 448 512",children:(0,v.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:Lt.T},{icon:(0,v.jsx)("svg",{viewBox:"0 0 512 512",children:(0,v.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}];n(1292);const Qu={cut:[Zt("CtrlOrCmd+X")],copy:[Zt("CtrlOrCmd+C")],paste:[Zt("CtrlOrCmd+V")],copyStyles:[Zt("CtrlOrCmd+Alt+C")],pasteStyles:[Zt("CtrlOrCmd+Alt+V")],selectAll:[Zt("CtrlOrCmd+A")],deleteSelectedElements:[Zt("Del")],duplicateSelection:[Zt("CtrlOrCmd+D"),Zt("Alt+".concat(b("helpDialog.drag")))],sendBackward:[Zt("CtrlOrCmd+[")],bringForward:[Zt("CtrlOrCmd+]")],sendToBack:[Zt(lt?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")],bringToFront:[Zt(lt?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")],copyAsPng:[Zt("Shift+Alt+C")],copyAsSvg:[],group:[Zt("CtrlOrCmd+G")],ungroup:[Zt("CtrlOrCmd+Shift+G")],gridMode:[Zt("CtrlOrCmd+'")],zenMode:[Zt("Alt+Z")],stats:[Zt("Alt+/")],addToLibrary:[],flipHorizontal:[Zt("Shift+H")],flipVertical:[Zt("Shift+V")],viewMode:[Zt("Alt+R")],hyperlink:[Zt("CtrlOrCmd+K")]},Ju=e=>{const t=Qu[e];return t&&t.length>0?t[0]:""},eh=e=>{let{options:t,onCloseRequest:n,top:r,left:i,actionManager:o,appState:a,elements:s}=e;return(0,v.jsx)(aa,{onCloseRequest:n,top:r,left:i,fitInViewport:!0,offsetLeft:a.offsetLeft,offsetTop:a.offsetTop,viewportWidth:a.width,viewportHeight:a.height,children:(0,v.jsx)("ul",{className:"context-menu",onContextMenu:e=>e.preventDefault(),children:t.map(((e,t)=>{var r;if("separator"===e)return(0,v.jsx)("hr",{className:"context-menu-option-separator"},t);const i=e.name;let l="";return e.contextItemLabel&&(l="function"==typeof e.contextItemLabel?b(e.contextItemLabel(s,a)):b(e.contextItemLabel)),(0,v.jsx)("li",{"data-testid":i,onClick:n,children:(0,v.jsxs)("button",{className:ye("context-menu-option",{dangerous:"deleteSelectedElements"===i,checkmark:null===(r=e.checked)||void 0===r?void 0:r.call(e,a)}),onClick:()=>o.executeAction(e),children:[(0,v.jsx)("div",{className:"context-menu-option__label",children:l}),(0,v.jsx)("kbd",{className:"context-menu-option__shortcut",children:i?Ju(i):""})]})},t)}))})})},th=new WeakMap,nh={push(e){const t=Array.of();e.options.forEach((e=>{e&&t.push(e)})),t.length&&(0,st.render)((0,v.jsx)(eh,{top:e.top,left:e.left,options:t,onCloseRequest:()=>(e=>{const t=th.get(e);t&&((0,st.unmountComponentAtNode)(t),t.remove(),th.delete(e))})(e.container),actionManager:e.actionManager,appState:e.appState,elements:e.elements}),(e=>{let t=th.get(e);return t||(t=document.createElement("div"),e.querySelector(".excalidraw-contextMenuContainer").appendChild(t),th.set(e,t),t)})(e.container))}},rh=e=>{var t;let{appState:n,elements:r,renderAction:i,elementType:o}=e;const a=Pl(El(r),n);let s=!1;2===a.length&&(Ae(a[0])||Ae(a[1]))&&(s=!0);const l=Boolean(n.editingElement),c=up(),d="rtl"===document.documentElement.getAttribute("dir"),u=Ps(o)||a.some((e=>Ps(e.type)&&!rn(e.backgroundColor))),h=Ps(o)||a.some((e=>Ps(e.type)));let p=(null===(t=a[0])||void 0===t?void 0:t.type)||null;for(const e of a)if(e.type!==p){p=null;break}return(0,v.jsxs)("div",{className:"panelColumn",children:[(Ds(o)&&"image"!==o&&"image"!==p||a.some((e=>Ds(e.type))))&&i("changeStrokeColor"),h&&i("changeBackgroundColor"),u&&i("changeFillStyle"),(zs(o)||a.some((e=>zs(e.type))))&&i("changeStrokeWidth"),("freedraw"===o||a.some((e=>"freedraw"===e.type)))&&i("changeStrokeShape"),(Rs(o)||a.some((e=>Rs(e.type))))&&(0,v.jsxs)(v.Fragment,{children:[i("changeStrokeStyle"),i("changeSloppiness")]}),(Hs(o)||a.some((e=>Hs(e.type))))&&(0,v.jsx)(v.Fragment,{children:i("changeSharpness")}),(Ns(o)||a.some((e=>Ns(e.type))))&&(0,v.jsxs)(v.Fragment,{children:[i("changeFontSize"),i("changeFontFamily"),i("changeTextAlign")]}),a.some((e=>Ae(e)||Pe(e)))&&i("changeVerticalAlign"),(Bs(o)||a.some((e=>Bs(e.type))))&&(0,v.jsx)(v.Fragment,{children:i("changeArrowhead")}),i("changeOpacity"),(0,v.jsxs)("fieldset",{children:[(0,v.jsx)("legend",{children:b("labels.layers")}),(0,v.jsxs)("div",{className:"buttonList",children:[i("sendToBack"),i("sendBackward"),i("bringToFront"),i("bringForward")]})]}),a.length>1&&!s&&(0,v.jsxs)("fieldset",{children:[(0,v.jsx)("legend",{children:b("labels.align")}),(0,v.jsxs)("div",{className:"buttonList",children:[d?(0,v.jsxs)(v.Fragment,{children:[i("alignRight"),i("alignHorizontallyCentered"),i("alignLeft")]}):(0,v.jsxs)(v.Fragment,{children:[i("alignLeft"),i("alignHorizontallyCentered"),i("alignRight")]}),a.length>2&&i("distributeHorizontally"),(0,v.jsxs)("div",{className:"iconRow",children:[i("alignTop"),i("alignVerticallyCentered"),i("alignBottom"),a.length>2&&i("distributeVertically")]})]})]}),!l&&a.length>0&&(0,v.jsxs)("fieldset",{children:[(0,v.jsx)("legend",{children:b("labels.actions")}),(0,v.jsxs)("div",{className:"buttonList",children:[!c&&i("duplicateSelection"),!c&&i("deleteSelectedElements"),i("group"),i("ungroup"),1===a.length&&i("hyperlink")]})]})]})},ih=e=>{let{canvas:t,elementType:n,setAppState:r,onImageAction:i}=e;return(0,v.jsx)(v.Fragment,{children:$u.map(((e,o)=>{let{value:a,icon:s,key:l}=e;const c=b("toolBar.".concat(a)),d=l&&("string"==typeof l?l:l[0]),u=d?"".concat(Nt(d)," ").concat(b("helpDialog.or")," ").concat(o+1):"".concat(o+1);return(0,v.jsx)(Js,{className:"Shape",type:"radio",icon:s,checked:n===a,name:"editor-current-shape",title:"".concat(Nt(c)," — ").concat(u),keyBindingLabel:"".concat(o+1),"aria-label":Nt(c),"aria-keyshortcuts":u,"data-testid":a,onChange:e=>{let{pointerType:n}=e;r({elementType:a,multiElement:null,selectedElementIds:{}}),Yt(t,a),"image"===a&&i({pointerType:n})}},a)}))})},oh=e=>{let{renderAction:t,zoom:n}=e;return(0,v.jsx)(uu,{gap:1,children:(0,v.jsxs)(du,{gap:1,align:"center",children:[t("zoomOut"),t("zoomIn"),t("resetZoom")]})})},ah=e=>{let{appState:t,setAppState:n,actionManager:r,showThemeBtn:i}=e;return(0,v.jsxs)("div",{style:{display:"flex"},children:[r.renderAction("changeViewBackgroundColor"),i&&r.renderAction("toggleTheme")]})};n(778);const sh=e=>{let{isCollaborating:t,collaboratorCount:n,onClick:r}=e;return(0,v.jsx)(v.Fragment,{children:(0,v.jsx)(Js,{className:ye("CollabButton",{"is-collaborating":t}),onClick:r,icon:Ya,type:"button",title:b("labels.liveCollaboration"),"aria-label":b("labels.liveCollaboration"),showAriaLabel:up()})})},lh=e=>{let{message:t,onClose:n}=e;const[o,a]=(0,r.useState)(!!t),{container:s}=pp(),l=i().useCallback((()=>{a(!1),n&&n(),null==s||s.focus()}),[n,s]);return(0,v.jsx)(v.Fragment,{children:o&&(0,v.jsx)(hl,{small:!0,onCloseRequest:l,title:b("errorDialog.title"),children:(0,v.jsx)("div",{style:{whiteSpace:"pre-wrap"},children:t})})})};n(2205);const ch="filter"in document.createElement("canvas").getContext("2d"),dh=()=>(0,v.jsxs)("div",{children:[(0,v.jsx)("h3",{children:b("canvasError.cannotShowPreview")}),(0,v.jsx)("p",{children:(0,v.jsx)("span",{children:b("canvasError.canvasTooBig")})}),(0,v.jsxs)("em",{children:["(",b("canvasError.canvasTooBigTip"),")"]})]}),uh=(e,t)=>{(0,st.unmountComponentAtNode)(t),t.innerHTML="",e instanceof HTMLCanvasElement?t.appendChild(e):(0,st.render)((0,v.jsx)(dh,{}),t)},hh=e=>{let{children:t,title:n,onClick:r,color:i,shade:o=6}=e;return(0,v.jsx)("button",{className:"ExportDialog-imageExportButton",style:{"--button-color":it[i][o],"--button-color-darker":it[i][o+1],"--button-color-darkest":it[i][o+2]},title:n,"aria-label":n,onClick:r,children:t})},ph=e=>{let{elements:t,appState:n,files:i,exportPadding:a=o.qy,actionManager:s,onExportToPng:l,onExportToSvg:c,onExportToClipboard:d}=e;const u=Ol(t,n),[h,p]=(0,r.useState)(u),g=(0,r.useRef)(null),{exportBackground:m,viewBackgroundColor:f}=n,x=h?Al(t,n,!0):t;return(0,r.useEffect)((()=>{p(u)}),[u]),(0,r.useEffect)((()=>{const e=g.current;e&&Ld(x,n,i,{exportBackground:m,viewBackgroundColor:f,exportPadding:a}).then((t=>xd(t).then((()=>{uh(t,e)})))).catch((t=>{console.error(t),uh(new qs,e)}))}),[n,i,x,m,a,f]),(0,v.jsxs)("div",{className:"ExportDialog",children:[(0,v.jsx)("div",{className:"ExportDialog__preview",ref:g}),ch&&s.renderAction("exportWithDarkMode"),(0,v.jsx)("div",{style:{display:"grid",gridTemplateColumns:"1fr"},children:(0,v.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(190px, 1fr))",overflow:"hidden"},children:[s.renderAction("changeExportBackground"),u&&(0,v.jsx)(cu,{checked:h,onChange:e=>p(e),children:b("labels.onlySelected")}),s.renderAction("changeExportEmbedScene")]})}),(0,v.jsxs)("div",{style:{display:"flex",alignItems:"center",marginTop:".6em"},children:[(0,v.jsx)(du,{gap:2,children:s.renderAction("changeExportScale")}),(0,v.jsx)("p",{style:{marginLeft:"1em",userSelect:"none"},children:"Scale"})]}),(0,v.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",margin:".6em 0"},children:!td&&s.renderAction("changeProjectName")}),(0,v.jsxs)(du,{gap:2,justifyContent:"center",style:{margin:"2em 0"},children:[(0,v.jsx)(hh,{color:"indigo",title:b("buttons.exportToPng"),"aria-label":b("buttons.exportToPng"),onClick:()=>l(x),children:"PNG"}),(0,v.jsx)(hh,{color:"red",title:b("buttons.exportToSvg"),"aria-label":b("buttons.exportToSvg"),onClick:()=>c(x),children:"SVG"}),tu&&(0,v.jsx)(hh,{title:b("buttons.copyPngToClipboard"),onClick:()=>d(x),color:"gray",shade:7,children:_a})]})]})},gh=e=>{let{elements:t,appState:n,files:a,exportPadding:s=o.qy,actionManager:l,onExportToPng:c,onExportToSvg:d,onExportToClipboard:u}=e;const[h,p]=(0,r.useState)(!1),g=i().useCallback((()=>{p(!1)}),[]);return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(Js,{onClick:()=>{p(!0)},"data-testid":"image-export-button",icon:Sa,type:"button","aria-label":b("buttons.exportImage"),showAriaLabel:up(),title:b("buttons.exportImage")}),h&&(0,v.jsx)(hl,{onCloseRequest:g,title:b("buttons.exportImage"),children:(0,v.jsx)(ph,{elements:t,appState:n,files:a,exportPadding:s,actionManager:l,onExportToPng:c,onExportToSvg:d,onExportToClipboard:u,onCloseRequest:g})})]})};n(1310);const mh=e=>{let{children:t,side:n,className:r}=e;return(0,v.jsx)("div",{className:ye("FixedSideContainer","FixedSideContainer_side_".concat(n),r),children:t})};n(7096);const fh=e=>{let{appState:t,elements:n,isMobile:r}=e,i=(e=>{let{appState:t,elements:n,isMobile:r}=e;const{elementType:i,isResizing:o,isRotating:a,lastPointerDownWith:s}=t,l=null!==t.multiElement;if(vn(t))return b("hints.eraserRevert");if("arrow"===i||"line"===i)return b(l?"hints.linearElementMulti":"hints.linearElement");if("freedraw"===i)return b("hints.freeDraw");if("text"===i)return b("hints.text");if("image"===t.elementType&&t.pendingImageElement)return b("hints.placeImage");const c=Al(n,t);if(o&&"mouse"===s&&1===c.length){const e=c[0];return je(e)&&2===e.points.length?b("hints.lockAngle"):_e(e)?b("hints.resizeImage"):b("hints.resize")}if(a&&"mouse"===s)return b("hints.rotate");if(1===c.length&&Ce(c[0]))return b("hints.text_selected");if(t.editingElement&&Ce(t.editingElement))return b("hints.text_editing");if("selection"===i){var d;if("selection"===(null===(d=t.draggingElement)||void 0===d?void 0:d.type)&&!t.editingElement&&!t.editingLinearElement)return b("hints.deepBoxSelect");if(!c.length&&!r)return b("hints.canvasPanning")}if(1===c.length){if(je(c[0]))return t.editingLinearElement?t.editingLinearElement.selectedPointsIndices?b("hints.lineEditor_pointSelected"):b("hints.lineEditor_nothingSelected"):b("hints.lineEditor_info");if(Le(c[0]))return b("hints.bindTextToElement")}return null})({appState:t,elements:n,isMobile:r});return i?(i=Zt(i),(0,v.jsx)("div",{className:"HintViewer",children:(0,v.jsx)("span",{children:i})})):null},bh={CHECKED:(0,v.jsx)("svg",{width:"1792",height:"1792",viewBox:"0 0 1792 1792",xmlns:"http://www.w3.org/2000/svg",children:(0,v.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,v.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,v.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"})})},vh=e=>(0,v.jsxs)("label",{className:ye("ToolIcon ToolIcon__lock ToolIcon_type_floating","ToolIcon_size_".concat("medium"),{"is-mobile":e.isMobile}),title:"".concat(e.title," — Q"),children:[(0,v.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title}),(0,v.jsx)("div",{className:"ToolIcon__icon",children:e.checked?bh.CHECKED:bh.UNCHECKED})]});var xh=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const yh=e=>{let{heading:t,children:n}=e,r=xh(e,["heading","children"]);const{id:i}=pp(),o=(0,v.jsx)("h2",{className:"visually-hidden",id:"".concat(i,"-").concat(t,"-title"),children:b("headings.".concat(t))});return(0,v.jsx)("section",Object.assign(Object.assign({},r),{"aria-labelledby":"".concat(i,"-").concat(t,"-title"),children:"function"==typeof n?n(o):(0,v.jsxs)(v.Fragment,{children:[o,n]})}))};n(580);const wh=i().memo((e=>{let{className:t,mobile:n,collaborators:r=new Map,layout:i,actionManager:o}=e;const a="vertical"===i?6:3,s=r.size>a?-2*Math.min(r.size-a,15):4;return(0,v.jsx)("div",{className:ye("UserList layout-".concat(i),t,{UserList_mobile:n}),style:{"--itemOffset":"".concat(s,"px")},children:r.size>0&&Array.from(r).filter((e=>{let[t,n]=e;return 0!==Object.keys(n).length})).map((e=>{let[t,r]=e;return n?o.renderAction("goToCollaborator",{id:t}):(0,v.jsx)(ll,{label:r.username||"Unknown user",children:o.renderAction("goToCollaborator",{id:t})},t)}))})})),kh=(0,v.jsx)("svg",{viewBox:"0 0 576 512",children:(0,v.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"})}),_h=e=>{let{appState:t,setAppState:n,isMobile:r}=e;return(0,v.jsxs)("label",{className:ye("ToolIcon ToolIcon_type_floating ToolIcon__library","ToolIcon_size_medium",{"is-mobile":r}),title:"".concat(Nt(b("toolBar.library"))," — 0"),children:[(0,v.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:"editor-library",onChange:e=>{n({isLibraryOpen:e.target.checked})},checked:t.isLibraryOpen,"aria-label":Nt(b("toolBar.library")),"aria-keyshortcuts":"0"}),(0,v.jsx)("div",{className:"ToolIcon__icon",children:kh})]})},Ch="medium",Eh={CHECKED:(0,v.jsxs)("svg",{width:"205",height:"205",viewBox:"0 0 205 205",xmlns:"http://www.w3.org/2000/svg",children:[(0,v.jsx)("path",{d:"m35 195-25-29.17V50h50v115l-25 30"}),(0,v.jsx)("path",{d:"M10 40V10h50v30H10"}),(0,v.jsx)("path",{d:"M125 145h70v50h-70"}),(0,v.jsx)("path",{d:"M190 145v-30l-10-20h-40l-10 20v30h15v-30l5-5h20l5 5v30h15"})]}),UNCHECKED:(0,v.jsxs)("svg",{width:"205",height:"205",viewBox:"0 0 205 205",xmlns:"http://www.w3.org/2000/svg",className:"unlocked-icon rtl-mirror",children:[(0,v.jsx)("path",{d:"m35 195-25-29.17V50h50v115l-25 30"}),(0,v.jsx)("path",{d:"M10 40V10h50v30H10"}),(0,v.jsx)("path",{d:"M125 145h70v50h-70"}),(0,v.jsx)("path",{d:"M145 145v-30l-10-20H95l-10 20v30h15v-30l5-5h20l5 5v30h15"})]})},Sh=e=>e.penDetected?(0,v.jsxs)("label",{className:ye("ToolIcon ToolIcon__penMode ToolIcon_type_floating","ToolIcon_size_".concat(Ch),{"is-mobile":e.isMobile}),title:"".concat(e.title),children:[(0,v.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title}),(0,v.jsx)("div",{className:"ToolIcon__icon",children:e.checked?Eh.CHECKED:Eh.UNCHECKED})]}):e.isMobile?null:(0,v.jsx)("label",{className:ye("ToolIcon ToolIcon__penMode ToolIcon_type_floating","ToolIcon_size_".concat(Ch),{"is-mobile":e.isMobile}),children:(0,v.jsx)("div",{className:"ToolIcon__icon ToolIcon__hidden"})}),jh=e=>{let{onHomeButtonClick:t,appState:n,elements:r,libraryMenu:i,actionManager:o,renderJSONExportDialog:a,renderImageExportDialog:s,setAppState:l,onCollabButtonClick:c,onLockToggle:d,onPenModeToggle:u,canvas:h,isCollaborating:p,renderCustomFooter:g,viewModeEnabled:m,showThemeBtn:f,onImageAction:x,renderTopRightUI:y,UIOptions:w}=e;return(0,v.jsxs)(v.Fragment,{children:[!m&&(0,v.jsxs)(mh,{side:"top",className:"App-top-bar",children:[(0,v.jsx)("div",{}),(0,v.jsx)(yh,{heading:"shapes",children:e=>(0,v.jsxs)(uu,{gap:4,align:"center",children:[(0,v.jsxs)(du,{gap:1,className:"App-toolbar-container",children:[(0,v.jsxs)(cl,{padding:1,className:"App-toolbar",children:[e,(0,v.jsx)(du,{gap:1,children:(0,v.jsx)(ih,{canvas:h,elementType:n.elementType,setAppState:l,onImageAction:e=>{let{pointerType:t}=e;x({insertOnCanvasDirectly:"mouse"!==t})}})})]}),(0,v.jsx)(Js,{type:"button",className:"HomeButton ToolIcon_type_floating",title:"Home","aria-label":"Home",icon:As,onClick:t},"home"),(0,v.jsx)(vh,{checked:n.elementLocked,onChange:d,title:b("toolBar.lock"),isMobile:!0}),(0,v.jsx)(_h,{appState:n,setAppState:l,isMobile:!0}),(0,v.jsx)(Sh,{checked:n.penMode,onChange:u,title:b("toolBar.penMode"),isMobile:!0,penDetected:n.penDetected})]}),i]})}),(0,v.jsx)("div",{style:{display:"flex"},children:null==y?void 0:y(!0,n,h)})]}),(0,v.jsx)("div",{className:"App-bottom-bar",style:{marginBottom:14,marginLeft:14,marginRight:14},children:(0,v.jsxs)(cl,{padding:0,children:[w.canvasActions&&"canvas"===n.openMenu?(0,v.jsx)(yh,{className:"App-mobile-menu",heading:"canvasActions",children:(0,v.jsx)("div",{className:"panelColumn",children:(0,v.jsxs)(uu,{gap:4,children:[m?(0,v.jsxs)(v.Fragment,{children:[a(),s()]}):(0,v.jsxs)(v.Fragment,{children:[o.renderAction("clearCanvas"),o.renderAction("loadScene"),a(),s(),c&&(0,v.jsx)(sh,{isCollaborating:p,collaboratorCount:n.collaborators.size,onClick:c}),(0,v.jsx)(ah,{actionManager:o,appState:n,setAppState:l,showThemeBtn:f})]}),null==g?void 0:g(!0,n),n.collaborators.size>0&&(0,v.jsxs)("fieldset",{children:[(0,v.jsx)("legend",{children:b("labels.collaborators")}),(0,v.jsx)(wh,{mobile:!0,layout:"horizontal",collaborators:n.collaborators,actionManager:o})]})]})})}):"shape"===n.openMenu&&!m&&kl(n,r)?(0,v.jsx)(yh,{className:"App-mobile-menu",heading:"selectedShapeActions",children:(0,v.jsx)(rh,{appState:n,elements:r,renderAction:o.renderAction,elementType:n.elementType})}):null,(0,v.jsxs)("footer",{className:"App-toolbar",children:[(()=>{const e=!n.viewModeEnabled&&!n.editingElement&&0===Al(r,n).length;return m?w.canvasActions?(0,v.jsx)("div",{className:"App-toolbar-content",children:o.renderAction("toggleCanvasMenu")}):(0,v.jsx)("div",{children:"Excalidraw"}):(0,v.jsxs)("div",{className:"App-toolbar-content",children:[w.canvasActions&&o.renderAction("toggleCanvasMenu"),o.renderAction("toggleEditMenu"),o.renderAction("undo"),o.renderAction("redo"),e&&o.renderAction("eraser"),o.renderAction(n.multiElement?"finalize":"duplicateSelection"),o.renderAction("deleteSelectedElements")]})})(),n.scrolledOutside&&!n.openMenu&&(0,v.jsx)("button",{className:"scroll-back-to-content",onClick:()=>{l(Object.assign({},rl(r,n)))},children:b("buttons.scrollBackToContent")})]})]})})]})};n(8051);const Ih=e=>{const t=(0,r.useRef)(null),[n,i]=(0,r.useState)(null);return(0,r.useLayoutEffect)((()=>{if(!e.spreadsheet)return;const n=qd(e.chartType,e.spreadsheet,0,0);let r;i(n);const o=t.current;return(async()=>{r=await Ad(n,{exportBackground:!1,viewBackgroundColor:it.white},null),o.appendChild(r),e.selected&&o.parentNode.focus()})(),()=>{o.removeChild(r)}}),[e.spreadsheet,e.chartType,e.selected]),(0,v.jsx)("button",{className:"ChartPreview",onClick:()=>{n&&e.onClick(e.chartType,n)},children:(0,v.jsx)("div",{ref:t})})},Th=e=>{let{setAppState:t,appState:n,onClose:r,onInsertChart:o}=e;const a=i().useCallback((()=>{r&&r()}),[r]),s=(e,n)=>{o(n),rc("magic","chart",e),t({currentChartType:e,pasteDialog:{shown:!1,data:null}})};return(0,v.jsx)(hl,{small:!0,onCloseRequest:a,title:b("labels.pasteCharts"),className:"PasteChartDialog",autofocus:!1,children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(Ih,{chartType:"bar",spreadsheet:n.pasteDialog.data,selected:"bar"===n.currentChartType,onClick:s}),(0,v.jsx)(Ih,{chartType:"line",spreadsheet:n.pasteDialog.data,selected:"line"===n.currentChartType,onClick:s})]})})};n(3922);const Mh=()=>(0,v.jsxs)("div",{className:"HelpDialog--header",children:[(0,v.jsx)("a",{className:"HelpDialog--btn",href:"https://github.com/excalidraw/excalidraw#documentation",target:"_blank",rel:"noopener noreferrer",children:b("helpDialog.documentation")}),(0,v.jsx)("a",{className:"HelpDialog--btn",href:"https://blog.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:b("helpDialog.blog")}),(0,v.jsx)("a",{className:"HelpDialog--btn",href:"https://github.com/excalidraw/excalidraw/issues",target:"_blank",rel:"noopener noreferrer",children:b("helpDialog.github")})]}),Oh=e=>(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("h3",{children:e.title}),e.children]}),Lh=e=>(0,v.jsx)("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"space-between"},children:e.children}),Ah=e=>(0,v.jsx)("div",{style:{width:"49%"},children:e.children}),Ph=e=>(0,v.jsxs)("div",{className:"HelpDialog--island",children:[(0,v.jsx)("h3",{className:"HelpDialog--island-title",children:e.caption}),e.children]}),Dh=e=>(0,v.jsx)("div",{className:"HelpDialog--shortcut",children:(0,v.jsxs)("div",{style:{display:"flex",margin:"0",padding:"4px 8px",alignItems:"center"},children:[(0,v.jsx)("div",{style:{lineHeight:1.4},children:e.label}),(0,v.jsx)("div",{style:{display:"flex",flex:"0 0 auto",justifyContent:"flex-end",marginInlineStart:"auto",minWidth:"30%"},children:e.shortcuts.map(((t,n)=>(0,v.jsxs)(i().Fragment,{children:[(0,v.jsx)(zh,{children:t}),e.isOr&&n!==e.shortcuts.length-1&&b("helpDialog.or")]},n)))})]})});Dh.defaultProps={isOr:!0};const zh=e=>(0,v.jsx)("kbd",Object.assign({className:"HelpDialog--key"},e)),Rh=e=>{let{onClose:t}=e;const n=i().useCallback((()=>{t&&t()}),[t]);return(0,v.jsx)(v.Fragment,{children:(0,v.jsxs)(hl,{onCloseRequest:n,title:b("helpDialog.title"),className:"HelpDialog",children:[(0,v.jsx)(Mh,{}),(0,v.jsx)(Oh,{title:b("helpDialog.shortcuts"),children:(0,v.jsxs)(Lh,{children:[(0,v.jsxs)(Ah,{children:[(0,v.jsxs)(Ph,{caption:b("helpDialog.shapes"),children:[(0,v.jsx)(Dh,{label:b("toolBar.selection"),shortcuts:["V","1"]}),(0,v.jsx)(Dh,{label:b("toolBar.rectangle"),shortcuts:["R","2"]}),(0,v.jsx)(Dh,{label:b("toolBar.diamond"),shortcuts:["D","3"]}),(0,v.jsx)(Dh,{label:b("toolBar.ellipse"),shortcuts:["E","4"]}),(0,v.jsx)(Dh,{label:b("toolBar.arrow"),shortcuts:["A","5"]}),(0,v.jsx)(Dh,{label:b("toolBar.line"),shortcuts:["P","6"]}),(0,v.jsx)(Dh,{label:b("toolBar.freedraw"),shortcuts:["Shift + P","X","7"]}),(0,v.jsx)(Dh,{label:b("toolBar.text"),shortcuts:["T","8"]}),(0,v.jsx)(Dh,{label:b("toolBar.image"),shortcuts:["9"]}),(0,v.jsx)(Dh,{label:b("toolBar.library"),shortcuts:["0"]}),(0,v.jsx)(Dh,{label:b("helpDialog.editSelectedShape"),shortcuts:[Zt("Enter"),b("helpDialog.doubleClick")]}),(0,v.jsx)(Dh,{label:b("helpDialog.textNewLine"),shortcuts:[Zt("Enter"),Zt("Shift+Enter")]}),(0,v.jsx)(Dh,{label:b("helpDialog.textFinish"),shortcuts:[Zt("Esc"),Zt("CtrlOrCmd+Enter")]}),(0,v.jsx)(Dh,{label:b("helpDialog.curvedArrow"),shortcuts:["A",b("helpDialog.click"),b("helpDialog.click"),b("helpDialog.click")],isOr:!1}),(0,v.jsx)(Dh,{label:b("helpDialog.curvedLine"),shortcuts:["L",b("helpDialog.click"),b("helpDialog.click"),b("helpDialog.click")],isOr:!1}),(0,v.jsx)(Dh,{label:b("toolBar.lock"),shortcuts:["Q"]}),(0,v.jsx)(Dh,{label:b("helpDialog.preventBinding"),shortcuts:[Zt("CtrlOrCmd")]}),(0,v.jsx)(Dh,{label:b("toolBar.link"),shortcuts:[Zt("CtrlOrCmd+K")]})]}),(0,v.jsxs)(Ph,{caption:b("helpDialog.view"),children:[(0,v.jsx)(Dh,{label:b("buttons.zoomIn"),shortcuts:[Zt("CtrlOrCmd++")]}),(0,v.jsx)(Dh,{label:b("buttons.zoomOut"),shortcuts:[Zt("CtrlOrCmd+-")]}),(0,v.jsx)(Dh,{label:b("buttons.resetZoom"),shortcuts:[Zt("CtrlOrCmd+0")]}),(0,v.jsx)(Dh,{label:b("helpDialog.zoomToFit"),shortcuts:["Shift+1"]}),(0,v.jsx)(Dh,{label:b("helpDialog.zoomToSelection"),shortcuts:["Shift+2"]}),(0,v.jsx)(Dh,{label:b("buttons.fullScreen"),shortcuts:["F"]}),(0,v.jsx)(Dh,{label:b("buttons.zenMode"),shortcuts:[Zt("Alt+Z")]}),(0,v.jsx)(Dh,{label:b("labels.showGrid"),shortcuts:[Zt("CtrlOrCmd+'")]}),(0,v.jsx)(Dh,{label:b("labels.viewMode"),shortcuts:[Zt("Alt+R")]}),(0,v.jsx)(Dh,{label:b("labels.toggleTheme"),shortcuts:[Zt("Alt+Shift+D")]}),(0,v.jsx)(Dh,{label:b("stats.title"),shortcuts:[Zt("Alt+/")]})]})]}),(0,v.jsx)(Ah,{children:(0,v.jsxs)(Ph,{caption:b("helpDialog.editor"),children:[(0,v.jsx)(Dh,{label:b("labels.selectAll"),shortcuts:[Zt("CtrlOrCmd+A")]}),(0,v.jsx)(Dh,{label:b("labels.multiSelect"),shortcuts:[Zt("Shift+".concat(b("helpDialog.click")))]}),(0,v.jsx)(Dh,{label:b("helpDialog.deepSelect"),shortcuts:[Zt("CtrlOrCmd+".concat(b("helpDialog.click")))]}),(0,v.jsx)(Dh,{label:b("helpDialog.deepBoxSelect"),shortcuts:[Zt("CtrlOrCmd+".concat(b("helpDialog.drag")))]}),(0,v.jsx)(Dh,{label:b("labels.moveCanvas"),shortcuts:[Zt("Space+".concat(b("helpDialog.drag"))),Zt("Wheel+".concat(b("helpDialog.drag")))],isOr:!0}),(0,v.jsx)(Dh,{label:b("labels.cut"),shortcuts:[Zt("CtrlOrCmd+X")]}),(0,v.jsx)(Dh,{label:b("labels.copy"),shortcuts:[Zt("CtrlOrCmd+C")]}),(0,v.jsx)(Dh,{label:b("labels.paste"),shortcuts:[Zt("CtrlOrCmd+V")]}),(0,v.jsx)(Dh,{label:b("labels.copyAsPng"),shortcuts:[Zt("Shift+Alt+C")]}),(0,v.jsx)(Dh,{label:b("labels.copyStyles"),shortcuts:[Zt("CtrlOrCmd+Alt+C")]}),(0,v.jsx)(Dh,{label:b("labels.pasteStyles"),shortcuts:[Zt("CtrlOrCmd+Alt+V")]}),(0,v.jsx)(Dh,{label:b("labels.delete"),shortcuts:[Zt("Del")]}),(0,v.jsx)(Dh,{label:b("labels.sendToBack"),shortcuts:[Zt(lt?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")]}),(0,v.jsx)(Dh,{label:b("labels.bringToFront"),shortcuts:[Zt(lt?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")]}),(0,v.jsx)(Dh,{label:b("labels.sendBackward"),shortcuts:[Zt("CtrlOrCmd+[")]}),(0,v.jsx)(Dh,{label:b("labels.bringForward"),shortcuts:[Zt("CtrlOrCmd+]")]}),(0,v.jsx)(Dh,{label:b("labels.alignTop"),shortcuts:[Zt("CtrlOrCmd+Shift+Up")]}),(0,v.jsx)(Dh,{label:b("labels.alignBottom"),shortcuts:[Zt("CtrlOrCmd+Shift+Down")]}),(0,v.jsx)(Dh,{label:b("labels.alignLeft"),shortcuts:[Zt("CtrlOrCmd+Shift+Left")]}),(0,v.jsx)(Dh,{label:b("labels.alignRight"),shortcuts:[Zt("CtrlOrCmd+Shift+Right")]}),(0,v.jsx)(Dh,{label:b("labels.duplicateSelection"),shortcuts:[Zt("CtrlOrCmd+D"),Zt("Alt+".concat(b("helpDialog.drag")))]}),(0,v.jsx)(Dh,{label:b("buttons.undo"),shortcuts:[Zt("CtrlOrCmd+Z")]}),(0,v.jsx)(Dh,{label:b("buttons.redo"),shortcuts:ct?[Zt("CtrlOrCmd+Y"),Zt("CtrlOrCmd+Shift+Z")]:[Zt("CtrlOrCmd+Shift+Z")]}),(0,v.jsx)(Dh,{label:b("labels.group"),shortcuts:[Zt("CtrlOrCmd+G")]}),(0,v.jsx)(Dh,{label:b("labels.ungroup"),shortcuts:[Zt("CtrlOrCmd+Shift+G")]}),(0,v.jsx)(Dh,{label:b("labels.flipHorizontal"),shortcuts:[Zt("Shift+H")]}),(0,v.jsx)(Dh,{label:b("labels.flipVertical"),shortcuts:[Zt("Shift+V")]}),(0,v.jsx)(Dh,{label:b("labels.showStroke"),shortcuts:[Zt("S")]}),(0,v.jsx)(Dh,{label:b("labels.showBackground"),shortcuts:[Zt("G")]}),(0,v.jsx)(Dh,{label:b("labels.decreaseFontSize"),shortcuts:[Zt("CtrlOrCmd+Shift+<")]}),(0,v.jsx)(Dh,{label:b("labels.increaseFontSize"),shortcuts:[Zt("CtrlOrCmd+Shift+>")]})]})})]})})]})})};n(5080);const Hh=e=>{let{children:t,color:n}=e;return(0,v.jsx)("div",{className:"Card",style:{"--card-color":"primary"===n?"var(--color-primary)":it[n][7],"--card-color-darker":"primary"===n?"var(--color-primary-darker)":it[n][8],"--card-color-darkest":"primary"===n?"var(--color-primary-darkest)":it[n][9]},children:t})},Nh=e=>{let{elements:t,appState:n,files:r,actionManager:i,exportOpts:o,canvas:a}=e;const{onExportToBackend:s}=o;return(0,v.jsx)("div",{className:"ExportDialog ExportDialog--json",children:(0,v.jsxs)("div",{className:"ExportDialog-cards",children:[o.saveFileToDisk&&(0,v.jsxs)(Hh,{color:"lime",children:[(0,v.jsx)("div",{className:"Card-icon",children:ja}),(0,v.jsx)("h2",{children:b("exportDialog.disk_title")}),(0,v.jsxs)("div",{className:"Card-details",children:[b("exportDialog.disk_details"),!td&&i.renderAction("changeProjectName")]}),(0,v.jsx)(Js,{className:"Card-button",type:"button",title:b("exportDialog.disk_button"),"aria-label":b("exportDialog.disk_button"),showAriaLabel:!0,onClick:()=>{i.executeAction(pu)}})]}),s&&(0,v.jsxs)(Hh,{color:"pink",children:[(0,v.jsx)("div",{className:"Card-icon",children:xa}),(0,v.jsx)("h2",{children:b("exportDialog.link_title")}),(0,v.jsx)("div",{className:"Card-details",children:b("exportDialog.link_details")}),(0,v.jsx)(Js,{className:"Card-button",type:"button",title:b("exportDialog.link_button"),"aria-label":b("exportDialog.link_button"),showAriaLabel:!0,onClick:()=>s(t,n,r,a)})]}),o.renderCustomUI&&o.renderCustomUI(t,n,r,a)]})})},Bh=e=>{let{elements:t,appState:n,files:o,actionManager:a,exportOpts:s,canvas:l}=e;const[c,d]=(0,r.useState)(!1),u=i().useCallback((()=>{d(!1)}),[]);return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(Js,{onClick:()=>{"function"==typeof s?a.executeAction(pu):d(!0)},"data-testid":"json-export-button",icon:ja,type:"button","aria-label":b("buttons.export"),showAriaLabel:up(),title:b("buttons.export")}),c&&s&&"function"!=typeof s&&(0,v.jsx)(hl,{onCloseRequest:u,title:b("buttons.export"),children:(0,v.jsx)(Nh,{elements:t,appState:n,files:o,actionManager:a,onCloseRequest:u,exportOpts:s,canvas:l})})]})},Fh=e=>{let{elements:t,appState:n,files:r,maxWidthOrHeight:i,getDimensions:o}=e;const{elements:a,appState:s}=ud({elements:t,appState:n},null,null),{exportBackground:l,viewBackgroundColor:c}=s;return Ld(El(a),Object.assign(Object.assign({},s),{offsetTop:0,offsetLeft:0,width:0,height:0}),r||{},{exportBackground:l,viewBackgroundColor:c},((e,t)=>{var n;const r=document.createElement("canvas");if(i){"function"==typeof o&&console.warn("`getDimensions()` is ignored when `maxWidthOrHeight` is supplied.");const n=Math.max(e,t),a=i/n;return r.width=e*a,r.height=t*a,{canvas:r,scale:a}}const a=(null==o?void 0:o(e,t))||{width:e,height:t};return r.width=a.width,r.height=a.height,{canvas:r,scale:null!==(n=a.scale)&&void 0!==n?n:1}}))},Uh=async e=>{var t;let{mimeType:n=o.LO.png,quality:r}=e;n===o.LO.png&&"number"==typeof r&&console.warn('"quality" will be ignored for "'.concat(o.LO.png,'" mimeType')),"image/jpg"===n&&(n=o.LO.jpg),n!==o.LO.jpg||null!==(t=e.appState)&&void 0!==t&&t.exportBackground||(console.warn('Defaulting "exportBackground" to "true" for "'.concat(o.LO.jpg,'" mimeType')),e=Object.assign(Object.assign({},e),{appState:Object.assign(Object.assign({},e.appState),{exportBackground:!0})}));const i=await Fh(e);return r=r||(/image\/jpe?g/.test(n)?.92:.8),new Promise((e=>{i.toBlob((t=>{e(t)}),n,r)}))},Wh=async e=>{let{elements:t,appState:n=hn(),files:r={},exportPadding:i}=e;const{elements:o,appState:a}=ud({elements:t,appState:n},null,null);return Ad(El(o),Object.assign(Object.assign({},a),{exportPadding:i}),r)},Kh=async e=>{const t=await Uh(e);if(!t)throw new Error("couldn't export to blob");await navigator.clipboard.write([new window.ClipboardItem({"image/png":t})])};n(9295),n(9781);const Vh=e=>{let{libItem:t,appState:n,index:i,onChange:o,onRemove:a}=e;const s=(0,r.useRef)(null),l=(0,r.useRef)(null);return(0,r.useEffect)((()=>{const e=s.current;e&&(async()=>{const r=await Wh({elements:t.elements,appState:Object.assign(Object.assign({},n),{viewBackgroundColor:it.white,exportBackground:!0}),files:null});e.innerHTML=r.outerHTML})()}),[t.elements,n]),(0,v.jsxs)("div",{className:"single-library-item",children:[(0,v.jsx)("div",{ref:s,className:"single-library-item__svg"}),(0,v.jsx)(Js,{"aria-label":b("buttons.remove"),type:"button",icon:Xa,className:"single-library-item--remove",onClick:a.bind(null,t.id),title:b("buttons.remove")}),(0,v.jsxs)("div",{style:{display:"flex",margin:"0.8rem 0.3rem",width:"100%",fontSize:"14px",fontWeight:500,flexDirection:"column"},children:[(0,v.jsxs)("label",{style:{display:"flex",justifyContent:"space-between",flexDirection:"column"},children:[(0,v.jsxs)("div",{style:{padding:"0.5em 0"},children:[(0,v.jsx)("span",{style:{fontWeight:500,color:it.gray[6]},children:b("publishDialog.itemName")}),(0,v.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,v.jsx)("input",{type:"text",ref:l,style:{width:"80%",padding:"0.2rem"},defaultValue:t.name,placeholder:"Item name",onChange:e=>{o(e.target.value,i)}})]}),(0,v.jsx)("span",{className:"error",children:t.error})]})]})},Gh="publish-library-data",Yh=async e=>{const t=128,n=Math.round(8),r=Math.max(Math.round(2),2),i=((e,t)=>{if(!e.length||t<1)return[];let n=0,r=0;const i=Array(Math.ceil(e.length/t));for(;n<e.length;)i[r++]=e.slice(n,n+=t);return i})(e,6),a=document.createElement("canvas");a.width=i[0].length*t+(i[0].length+1)*(2*n)-2*n,a.height=i.length*t+(i.length+1)*(2*n)-2*n;const s=a.getContext("2d");s.fillStyle=it.white,s.fillRect(0,0,a.width,a.height);for(const[i,o]of e.entries()){const e=await Fh({elements:o.elements,files:null,maxWidthOrHeight:t}),{width:a,height:l}=e,c=Math.floor(i/6)*(t+2*n),d=i%6*(t+2*n);s.drawImage(e,d+(t-a)/2+n,c+(t-l)/2+n),s.lineWidth=r,s.strokeStyle=it.gray[4],s.strokeRect(d+n/2,c+n/2,t+n,t+n)}return await kd(new File([await xd(a)],"preview",{type:o.LO.png}),{outputType:o.LO.jpg,maxWidthOrHeight:5e3})},Xh=e=>{let{onClose:t,libraryItems:n,appState:i,onSuccess:a,onError:s,updateItemsInStorage:l,onRemove:c}=e;const[d,u]=(0,r.useState)({authorName:"",githubHandle:"",name:"",description:"",twitterHandle:"",website:""}),[h,p]=(0,r.useState)(!1);(0,r.useEffect)((()=>{const e=(()=>{try{const e=localStorage.getItem(Gh);if(e)return JSON.parse(e)}catch(e){console.error(e)}return null})();e&&u(e)}),[]);const[g,m]=(0,r.useState)(n.slice());(0,r.useEffect)((()=>{m(n.slice())}),[n]);const f=e=>{u(Object.assign(Object.assign({},d),{[e.target.name]:e.target.value}))},x=(0,r.useCallback)((()=>{l(g),(e=>{try{localStorage.setItem(Gh,JSON.stringify(e))}catch(e){console.error(e)}})(d),t()}),[g,t,l,d]),y=!!n.length;return(0,v.jsx)(hl,{onCloseRequest:x,title:b("publishDialog.title"),className:"publish-library",children:y?(0,v.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),p(!0);const t=[];let n=!1;if(g.forEach((e=>{let r="";e.name||(r=b("publishDialog.errors.required"),n=!0),t.push(Object.assign(Object.assign({},e),{error:r}))})),n)return m(t),void p(!1);const r=await Yh(g),i={type:o.r8.excalidrawLibrary,version:o.Kr.excalidrawLibrary,source:o.pb,libraryItems:g},l=JSON.stringify(i,null,2),c=new Blob([l],{type:"application/json"}),u=new FormData;u.append("excalidrawLib",c),u.append("previewImage",r),u.append("previewImageType",r.type),u.append("title",d.name),u.append("authorName",d.authorName),u.append("githubHandle",d.githubHandle),u.append("name",d.name),u.append("description",d.description),u.append("twitterHandle",d.twitterHandle),u.append("website",d.website),fetch("https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries/submit",{method:"post",body:u}).then((e=>e.ok?e.json().then((e=>{let{url:t}=e;localStorage.removeItem(Gh),a({url:t,authorName:d.authorName,items:g})})):e.json().catch((()=>{throw new Error(e.statusText||"something went wrong")})).then((t=>{throw new Error(t.message||e.statusText||"something went wrong")}))),(e=>{console.error(e),s(e),p(!1)})).catch((e=>{console.error(e),s(e),p(!1)}))},children:[(0,v.jsxs)("div",{className:"publish-library-note",children:[b("publishDialog.noteDescription.pre"),(0,v.jsx)("a",{href:"https://libraries.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:b("publishDialog.noteDescription.link")})," ",b("publishDialog.noteDescription.post")]}),(0,v.jsxs)("span",{className:"publish-library-note",children:[b("publishDialog.noteGuidelines.pre"),(0,v.jsx)("a",{href:"https://github.com/excalidraw/excalidraw-libraries#guidelines",target:"_blank",rel:"noopener noreferrer",children:b("publishDialog.noteGuidelines.link")}),b("publishDialog.noteGuidelines.post")]}),(0,v.jsx)("div",{className:"publish-library-note",children:b("publishDialog.noteItems")}),(()=>{const e=[];return g.forEach(((t,n)=>{e.push((0,v.jsx)("div",{className:"single-library-item-wrapper",children:(0,v.jsx)(Vh,{libItem:t,appState:i,index:n,onChange:(e,t)=>{const n=g.slice();n[t].name=e,m(n)},onRemove:c})},n))})),(0,v.jsx)("div",{className:"selected-library-items",children:e})})(),(0,v.jsxs)("div",{className:"publish-library__fields",children:[(0,v.jsxs)("label",{children:[(0,v.jsxs)("div",{children:[(0,v.jsx)("span",{children:b("publishDialog.libraryName")}),(0,v.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,v.jsx)("input",{type:"text",name:"name",required:!0,value:d.name,onChange:f,placeholder:b("publishDialog.placeholder.libraryName")})]}),(0,v.jsxs)("label",{style:{alignItems:"flex-start"},children:[(0,v.jsxs)("div",{children:[(0,v.jsx)("span",{children:b("publishDialog.libraryDesc")}),(0,v.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,v.jsx)("textarea",{name:"description",rows:4,required:!0,value:d.description,onChange:f,placeholder:b("publishDialog.placeholder.libraryDesc")})]}),(0,v.jsxs)("label",{children:[(0,v.jsxs)("div",{children:[(0,v.jsx)("span",{children:b("publishDialog.authorName")}),(0,v.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,v.jsx)("input",{type:"text",name:"authorName",required:!0,value:d.authorName,onChange:f,placeholder:b("publishDialog.placeholder.authorName")})]}),(0,v.jsxs)("label",{children:[(0,v.jsx)("span",{children:b("publishDialog.githubUsername")}),(0,v.jsx)("input",{type:"text",name:"githubHandle",value:d.githubHandle,onChange:f,placeholder:b("publishDialog.placeholder.githubHandle")})]}),(0,v.jsxs)("label",{children:[(0,v.jsx)("span",{children:b("publishDialog.twitterUsername")}),(0,v.jsx)("input",{type:"text",name:"twitterHandle",value:d.twitterHandle,onChange:f,placeholder:b("publishDialog.placeholder.twitterHandle")})]}),(0,v.jsxs)("label",{children:[(0,v.jsx)("span",{children:b("publishDialog.website")}),(0,v.jsx)("input",{type:"text",name:"website",pattern:"https?://.+",title:b("publishDialog.errors.website"),value:d.website,onChange:f,placeholder:b("publishDialog.placeholder.website")})]}),(0,v.jsxs)("span",{className:"publish-library-note",children:[b("publishDialog.noteLicense.pre"),(0,v.jsx)("a",{href:"https://github.com/excalidraw/excalidraw-libraries/blob/main/LICENSE",target:"_blank",rel:"noopener noreferrer",children:b("publishDialog.noteLicense.link")}),b("publishDialog.noteLicense.post")]})]}),(0,v.jsxs)("div",{className:"publish-library__buttons",children:[(0,v.jsx)(Js,{type:"button",title:b("buttons.cancel"),"aria-label":b("buttons.cancel"),label:b("buttons.cancel"),onClick:x,"data-testid":"cancel-clear-canvas-button",className:"publish-library__buttons--cancel"}),(0,v.jsx)(Js,{type:"submit",title:b("buttons.submit"),"aria-label":b("buttons.submit"),label:b("buttons.submit"),className:"publish-library__buttons--confirm",isLoading:h})]})]}):(0,v.jsx)("p",{style:{padding:"1em",textAlign:"center",fontWeight:500},children:b("publishDialog.atleastOneLibItem")})})};n(4406);var Zh=n(2891);n(694);const qh=(0,v.jsx)("svg",{viewBox:"0 0 1792 1792",children:(0,v.jsx)("path",{d:"M1600 736v192c0 26.667-9.33 49.333-28 68-18.67 18.67-41.33 28-68 28h-416v416c0 26.67-9.33 49.33-28 68s-41.33 28-68 28H800c-26.667 0-49.333-9.33-68-28s-28-41.33-28-68v-416H288c-26.667 0-49.333-9.33-68-28-18.667-18.667-28-41.333-28-68V736c0-26.667 9.333-49.333 28-68s41.333-28 68-28h416V224c0-26.667 9.333-49.333 28-68s41.333-28 68-28h192c26.67 0 49.33 9.333 68 28s28 41.333 28 68v416h416c26.67 0 49.33 9.333 68 28s28 41.333 28 68Z",style:{stroke:"#fff",strokeWidth:140},transform:"translate(0 64)"})}),$h=e=>{let{id:t,elements:n,files:i,isPending:a,onClick:s,selected:l,onToggle:c}=e;const d=(0,r.useRef)(null);(0,r.useEffect)((()=>{const e=d.current;if(e)return(async()=>{if(!n)return;const t=await Ad(n,{exportBackground:!1,viewBackgroundColor:it.white},i);e.innerHTML=t.outerHTML})(),()=>{e.innerHTML=""}}),[n,i]);const[u,h]=(0,r.useState)(!1),p=up(),g=a&&(0,v.jsx)("div",{className:"library-unit__adder",children:qh});return(0,v.jsxs)("div",{className:ye("library-unit",{"library-unit__active":n,"library-unit--hover":n&&u,"library-unit--selected":l}),onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[(0,v.jsx)("div",{className:ye("library-unit__dragger",{"library-unit__pulse":!!a}),ref:d,draggable:!!n,onClick:n||a?e=>{t&&e.shiftKey?c(t,e):s()}:void 0,onDragStart:e=>{h(!1),e.dataTransfer.setData(o.LO.excalidrawlib,JSON.stringify(n))}}),g,t&&n&&(u||p||l)&&(0,v.jsx)(cu,{checked:l,onChange:(e,n)=>c(t,n),className:"library-unit__checkbox"})]})};n(6043);const Qh=e=>{let{libraryItems:t,onRemoveFromLibrary:n,onAddToLibrary:i,onInsertShape:a,pendingElements:s,theme:l,setAppState:c,libraryReturnUrl:d,library:u,files:h,id:p,selectedItems:g,onToggle:m,onPublish:f,resetLibrary:x}=e;const y=(0,r.useCallback)((()=>{const e=g.length?b("alerts.removeItemsFromsLibrary",{count:g.length}):b("alerts.resetLibrary"),t=g.length?b("confirmDialog.removeItemsFromLib"):b("confirmDialog.resetLibrary");return(0,v.jsx)(gl,{onConfirm:()=>{g.length?n():x(),k(!1)},onCancel:()=>{k(!1)},title:t,children:(0,v.jsx)("p",{children:e})})}),[g,n,x]),[w,k]=(0,r.useState)(!1),_=up(),C=_?4:6,E=d||window.location.origin+window.location.pathname,S=g.some((e=>{var n;return"published"===(null===(n=t.find((t=>t.id===e)))||void 0===n?void 0:n.status)})),j=e=>{var t,n,r,i,o;return(0,v.jsx)(uu,{children:(0,v.jsx)($h,{elements:null===(t=e.item)||void 0===t?void 0:t.elements,files:h,isPending:!(null!==(n=e.item)&&void 0!==n&&n.id||null===(r=e.item)||void 0===r||!r.elements),onClick:e.onClick||(()=>{}),id:(null===(i=e.item)||void 0===i?void 0:i.id)||null,selected:!(null===(o=e.item)||void 0===o||!o.id)&&g.includes(e.item.id),onToggle:(e,t)=>{m(e,t)}})},e.key)},I=e=>{const t=e.map((e=>e.id?j({item:e,onClick:()=>a(e.elements),key:e.id}):j({key:"__pending__item__",item:e,onClick:()=>i(s)})));let n=(0,Zh.chunk)(t,C);return n.length||(n=[[]]),n.map(((e,t,n)=>(t===n.length-1&&(e=e.concat(new Array(C-e.length).fill(null).map(((e,t)=>j({key:"empty_".concat(t),item:null}))))),(0,v.jsx)(du,{align:"center",gap:1,children:e},t))))},T=t.filter((e=>"published"===e.status)),M=[...s.length?[{id:null,elements:s}]:[],...t.filter((e=>"published"!==e.status))];return(0,v.jsxs)("div",{className:"library-menu-items-container",children:[w&&y(),(0,v.jsxs)("div",{className:"layer-ui__library-header",children:[(()=>{const e=!!g.length,n=e?t.filter((e=>g.includes(e.id))):t,r=b(e?"buttons.remove":"buttons.resetLibrary");return(0,v.jsxs)("div",{className:"library-actions",children:[(!e||!_)&&(0,v.jsx)(Js,{type:"button",title:b("buttons.load"),"aria-label":b("buttons.load"),icon:ka,onClick:()=>{(async e=>{const t=await id({description:"Excalidraw library files"});await e.importLibrary(t)})(u).then((()=>{c({isLibraryOpen:!1}),c({isLibraryOpen:!0})})).catch(nn).catch((e=>{c({errorMessage:e.message})}))},className:"library-actions--load"},"import"),!!n.length&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(Js,{type:"button",title:b("buttons.export"),"aria-label":b("buttons.export"),icon:ja,onClick:async()=>{(async e=>{const t={type:o.r8.excalidrawLibrary,version:o.Kr.excalidrawLibrary,source:o.pb,libraryItems:e},n=JSON.stringify(t,null,2);await od(new Blob([n],{type:o.LO.excalidrawlib}),{name:"library",extension:"excalidrawlib",description:"Excalidraw library file"})})(e?n:await u.loadLibrary()).catch(nn).catch((e=>{c({errorMessage:e.message})}))},className:"library-actions--export",children:g.length>0&&(0,v.jsx)("span",{className:"library-actions-counter",children:g.length})},"export"),(0,v.jsx)(Js,{type:"button",title:r,"aria-label":r,icon:Ca,onClick:()=>k(!0),className:"library-actions--remove",children:g.length>0&&(0,v.jsx)("span",{className:"library-actions-counter",children:g.length})},"reset")]}),e&&!S&&(0,v.jsx)(ll,{label:b("hints.publishLibrary"),children:(0,v.jsxs)(Js,{type:"button","aria-label":b("buttons.publishLibrary"),label:b("buttons.publishLibrary"),icon:Ms,className:"library-actions--publish",onClick:f,children:[!_&&(0,v.jsx)("label",{children:b("buttons.publishLibrary")}),g.length>0&&(0,v.jsx)("span",{className:"library-actions-counter",children:g.length})]})})]})})(),(0,v.jsx)("a",{href:"https://libraries.excalidraw.com?target=".concat(window.name||"_blank","&referrer=").concat(E,"&useHash=true&token=").concat(p,"&theme=").concat(l,"&version=").concat(o.Kr.excalidrawLibrary),target:"_excalidraw_libraries",children:b("labels.libraries")})]},"library-header"),(0,v.jsxs)(uu,{className:"library-menu-items-container__items",align:"start",gap:1,children:[(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("div",{className:"separator",children:b("labels.personalLib")}),I(M)]}),(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)("div",{className:"separator",children:[b("labels.excalidrawLib")," "]}),I(T)]})]})]})},Jh=(e,t)=>e.filter((e=>t.includes(e.id))),ep=e=>{let{onClose:t,onInsertShape:n,pendingElements:i,onAddToLibrary:a,theme:s,setAppState:l,files:c,libraryReturnUrl:d,focusContainer:u,library:h,id:p,appState:g}=e;const m=(0,r.useRef)(null);((e,t)=>{(0,r.useEffect)((()=>{const n=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),()=>{document.removeEventListener("pointerdown",n)}}),[e,t])})(m,(e=>{e.target.closest(".ToolIcon__library")||t()})),(0,r.useEffect)((()=>{const e=e=>{e.key===Lt.ESCAPE&&t()};return document.addEventListener(o.Ks.KEYDOWN,e),()=>{document.removeEventListener(o.Ks.KEYDOWN,e)}}),[t]);const[f,x]=(0,r.useState)([]),[y,w]=(0,r.useState)("preloading"),[k,_]=(0,r.useState)([]),[C,E]=(0,r.useState)(!1),[S,j]=(0,r.useState)(null),I=(0,r.useRef)(null);(0,r.useEffect)((()=>(Promise.race([new Promise((e=>{I.current=window.setTimeout((()=>{e("loading")}),100)})),h.loadLibrary().then((e=>{x(e),w("ready")}))]).then((e=>{"loading"===e&&w("loading")})),()=>{clearTimeout(I.current)})),[h]);const T=(0,r.useCallback)((async()=>{const e=await h.loadLibrary(),t=e.filter((e=>!k.includes(e.id)));h.saveLibrary(t).catch((t=>{x(e),l({errorMessage:b("alerts.errorRemovingFromLibrary")})})),_([]),x(t)}),[h,l,k,_]),M=(0,r.useCallback)((()=>{h.resetLibrary(),x([]),u()}),[h,u]),O=(0,r.useCallback)((async e=>{if(e.some((e=>"image"===e.type)))return l({errorMessage:"Support for adding images to the library coming soon!"});const t=await h.loadLibrary(),n=[{status:"unpublished",elements:e,id:Lr(),created:Date.now()},...t];a(),h.saveLibrary(n).catch((e=>{x(t),l({errorMessage:b("alerts.errorAddingToLibrary")})})),x(n)}),[a,h,l]),L=(0,r.useCallback)((()=>(0,v.jsxs)(hl,{onCloseRequest:()=>j(null),title:b("publishSuccessDialog.title"),className:"publish-library-success",small:!0,children:[(0,v.jsxs)("p",{children:[b("publishSuccessDialog.content",{authorName:S.authorName})," ",(0,v.jsx)("a",{href:null==S?void 0:S.url,target:"_blank",rel:"noopener noreferrer",children:b("publishSuccessDialog.link")})]}),(0,v.jsx)(Js,{type:"button",title:b("buttons.close"),"aria-label":b("buttons.close"),label:b("buttons.close"),onClick:()=>j(null),"data-testid":"publish-library-success-close",className:"publish-library-success-close"})]})),[j,S]),A=(0,r.useCallback)((e=>{E(!1),j({url:e.url,authorName:e.authorName});const t=f.slice();t.forEach((e=>{k.includes(e.id)&&(e.status="published")})),h.saveLibrary(t),x(t)}),[E,j,f,k,h]),[P,D]=(0,r.useState)(null);return"preloading"===y?null:(0,v.jsxs)(cl,{padding:1,ref:m,className:"layer-ui__library",children:[C&&(0,v.jsx)(Xh,{onClose:()=>E(!1),libraryItems:Jh(f,k),appState:g,onSuccess:A,onError:e=>window.alert(e),updateItemsInStorage:()=>h.saveLibrary(f),onRemove:e=>_(k.filter((t=>t!==e)))}),S&&L(),"loading"===y?(0,v.jsx)("div",{className:"layer-ui__library-message",children:b("labels.libraryLoadingMessage")}):(0,v.jsx)(Qh,{libraryItems:f,onRemoveFromLibrary:T,onAddToLibrary:O,onInsertShape:n,pendingElements:i,setAppState:l,libraryReturnUrl:d,library:h,theme:s,files:c,id:p,selectedItems:k,onToggle:(e,t)=>{if(!k.includes(e)){if(t.shiftKey&&P){const t=f.findIndex((e=>e.id===P)),n=f.findIndex((t=>t.id===e));if(-1===t||-1===n)return void _([...k,e]);const r=ln(k),i=f.reduce(((e,i,o)=>((o>=t&&o<=n||r.has(i.id))&&e.push(i.id),e)),[]);_(i)}else _([...k,e]);D(e)}else D(null),_(k.filter((t=>t!==e)))},onPublish:()=>E(!0),resetLibrary:M})]})};n(3336),n(276);var tp=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const np=e=>{let{onHomeButtonClick:t,actionManager:n,appState:i,files:a,setAppState:s,canvas:l,elements:c,onCollabButtonClick:d,onLockToggle:u,onPenModeToggle:h,onInsertElements:p,zenModeEnabled:g,showExitZenModeBtn:m,showThemeBtn:f,toggleZenMode:y,isCollaborating:w,renderTopRightUI:k,renderCustomFooter:_,viewModeEnabled:C,libraryReturnUrl:E,UIOptions:S,focusContainer:j,library:I,id:T,onImageAction:M}=e;const O=up(),L=()=>S.canvasActions&&S.canvasActions.export?(0,v.jsx)(Bh,{elements:c,appState:i,files:a,actionManager:n,exportOpts:S.canvasActions.export,canvas:l}):null,A=()=>{if(!S.canvasActions||!S.canvasActions.saveAsImage)return null;const e=e=>async t=>{const n=await lu(e,t,i,a,{exportBackground:i.exportBackground,name:i.name,viewBackgroundColor:i.viewBackgroundColor}).catch(nn).catch((e=>{console.error(e),s({errorMessage:e.message})}));i.exportEmbedScene&&n&&md(n)&&s({fileHandle:n})};return(0,v.jsx)(gh,{elements:c,appState:i,files:a,actionManager:n,onExportToPng:e("png"),onExportToSvg:e("svg"),onExportToClipboard:e("clipboard")})},P=(0,r.useCallback)((()=>{!!document.querySelector(".Dialog")||s({isLibraryOpen:!1})}),[s]),D=(0,r.useCallback)((()=>{s({selectedElementIds:{},selectedGroupIds:{}})}),[s]),z=i.isLibraryOpen?(0,v.jsx)(ep,{pendingElements:Al(c,i,!0),onClose:P,onInsertShape:p,onAddToLibrary:D,setAppState:s,libraryReturnUrl:E,focusContainer:j,library:I,theme:i.theme,files:a,id:T,appState:i}):null,R=(0,v.jsxs)(v.Fragment,{children:[i.isLoading&&(0,v.jsx)(x,{}),i.errorMessage&&(0,v.jsx)(lh,{message:i.errorMessage,onClose:()=>s({errorMessage:null})}),i.showHelpDialog&&(0,v.jsx)(Rh,{onClose:()=>{s({showHelpDialog:!1})}}),i.pasteDialog.shown&&(0,v.jsx)(Th,{setAppState:s,appState:i,onInsertChart:p,onClose:()=>s({pasteDialog:{shown:!1,data:null}})})]});return O?(0,v.jsxs)(v.Fragment,{children:[R,(0,v.jsx)(jh,{onHomeButtonClick:t,appState:i,elements:c,actionManager:n,libraryMenu:z,renderJSONExportDialog:L,renderImageExportDialog:A,setAppState:s,onCollabButtonClick:d,onLockToggle:u,onPenModeToggle:h,canvas:l,isCollaborating:w,renderCustomFooter:_,viewModeEnabled:C,showThemeBtn:f,onImageAction:M,renderTopRightUI:k,UIOptions:S})]}):(0,v.jsxs)("div",{className:ye("layer-ui__wrapper",{"disable-pointerEvents":i.draggingElement||i.resizingElement||i.editingElement&&!Ce(i.editingElement)}),children:[R,(()=>{const e=kl(i,c);return(0,v.jsx)(mh,{side:"top",children:(0,v.jsxs)("div",{className:"App-menu App-menu_top",children:[(0,v.jsxs)(uu,{gap:4,className:ye({"disable-pointerEvents":g}),children:[S.canvasActions&&(C?(0,v.jsx)(yh,{heading:"canvasActions",className:ye("zen-mode-transition",{"transition-left":g}),children:(0,v.jsx)(cl,{padding:2,style:{zIndex:1},children:(0,v.jsx)(uu,{gap:4,children:(0,v.jsxs)(du,{gap:1,justifyContent:"space-between",children:[L(),A()]})})})}):(0,v.jsx)(yh,{heading:"canvasActions",className:ye("zen-mode-transition",{"transition-left":g}),children:(0,v.jsx)(cl,{padding:2,style:{zIndex:1},children:(0,v.jsxs)(uu,{gap:4,children:[(0,v.jsxs)(du,{gap:3,justifyContent:"space-between",children:[n.renderAction("clearCanvas"),n.renderAction("loadScene"),L(),A(),d&&(0,v.jsx)(sh,{isCollaborating:w,collaboratorCount:i.collaborators.size,onClick:d})]}),(0,v.jsx)(ah,{actionManager:n,appState:i,setAppState:s,showThemeBtn:f}),i.fileHandle&&(0,v.jsx)(v.Fragment,{children:n.renderAction("saveToActiveFile")})]})})})),e&&(0,v.jsx)(yh,{heading:"selectedShapeActions",className:ye("zen-mode-transition",{"transition-left":g}),children:(0,v.jsx)(cl,{className:o.$C.SHAPE_ACTIONS_MENU,padding:2,style:{maxHeight:"".concat(i.height-(i.fileHandle?248:200),"px")},children:(0,v.jsx)(rh,{appState:i,elements:c,renderAction:n.renderAction,elementType:i.elementType})})})]}),!C&&(0,v.jsx)(yh,{heading:"shapes",children:e=>(0,v.jsxs)(uu,{gap:4,align:"start",children:[(0,v.jsxs)(du,{gap:1,className:ye("App-toolbar-container",{"zen-mode":g}),children:[(0,v.jsx)(Sh,{zenModeEnabled:g,checked:i.penMode,onChange:h,title:b("toolBar.penMode"),penDetected:i.penDetected}),(0,v.jsx)(vh,{zenModeEnabled:g,checked:i.elementLocked,onChange:u,title:b("toolBar.lock")}),(0,v.jsxs)(cl,{padding:1,className:ye("App-toolbar",{"zen-mode":g}),children:[(0,v.jsx)(fh,{appState:i,elements:c,isMobile:O}),e,(0,v.jsx)(du,{gap:1,children:(0,v.jsx)(ih,{canvas:l,elementType:i.elementType,setAppState:s,onImageAction:e=>{let{pointerType:t}=e;M({insertOnCanvasDirectly:"mouse"!==t})}})})]}),(0,v.jsx)(_h,{appState:i,setAppState:s})]}),z]})}),(0,v.jsx)("div",{className:ye("layer-ui__wrapper__top-right zen-mode-transition",{"transition-right":g}),children:null==k?void 0:k(O,i,l)}),(0,v.jsx)(wh,{className:ye("zen-mode-transition",{"transition-right":g}),layout:"vertical",collaborators:i.collaborators,actionManager:n})]})})})(),(0,v.jsxs)("footer",{role:"contentinfo",className:"layer-ui__wrapper__footer App-menu App-menu_bottom",children:[(0,v.jsx)("div",{className:ye("layer-ui__wrapper__footer-left zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":g}),children:(0,v.jsx)(uu,{gap:2,children:(0,v.jsxs)(yh,{heading:"canvasActions",children:[(0,v.jsx)(cl,{padding:1,children:(0,v.jsx)(oh,{renderAction:n.renderAction,zoom:i.zoom})}),!C&&(0,v.jsxs)("div",{className:ye("undo-redo-buttons zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":g}),children:[n.renderAction("undo",{size:"small"}),n.renderAction("redo",{size:"small"})]}),(0,v.jsx)("div",{className:ye("eraser-buttons zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":g}),children:n.renderAction("eraser",{size:"small"})})]})})}),(0,v.jsx)("div",{className:ye("layer-ui__wrapper__footer-center zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":g}),children:null==_?void 0:_(!1,i)}),(0,v.jsx)("div",{className:ye("layer-ui__wrapper__footer-right zen-mode-transition",{"transition-right disable-pointerEvents":g}),children:n.renderAction("toggleShortcuts")}),(0,v.jsx)("button",{className:ye("disable-zen-mode",{"disable-zen-mode--visible":m}),onClick:y,children:b("buttons.exitZenMode")})]}),i.scrolledOutside&&(0,v.jsx)("button",{className:"scroll-back-to-content",onClick:()=>{s(Object.assign({},rl(c,i)))},children:b("buttons.scrollBackToContent")})]})},rp=(e,t)=>{const n=e=>{const{suggestedBindings:t,startBoundElement:n}=e;return tp(e,["suggestedBindings","startBoundElement"])},r=n(e.appState),i=n(t.appState),o=Object.keys(r);return e.renderTopRightUI===t.renderTopRightUI&&e.renderCustomFooter===t.renderCustomFooter&&e.langCode===t.langCode&&e.elements===t.elements&&e.files===t.files&&o.every((e=>r[e]===i[e]))},ip=i().memo(np,rp);n(1528);const op=e=>{var t;const n=up(),r=et(e.elements),i=Pl(e.elements,e.appState),o=et(i);return n&&e.appState.openMenu?null:(0,v.jsx)("div",{className:"Stats",children:(0,v.jsxs)(cl,{padding:2,children:[(0,v.jsx)("div",{className:"close",onClick:e.onClose,children:Xa}),(0,v.jsx)("h3",{children:b("stats.title")}),(0,v.jsx)("table",{children:(0,v.jsxs)("tbody",{children:[(0,v.jsx)("tr",{children:(0,v.jsx)("th",{colSpan:2,children:b("stats.scene")})}),(0,v.jsxs)("tr",{children:[(0,v.jsx)("td",{children:b("stats.elements")}),(0,v.jsx)("td",{children:e.elements.length})]}),(0,v.jsxs)("tr",{children:[(0,v.jsx)("td",{children:b("stats.width")}),(0,v.jsx)("td",{children:Math.round(r[2])-Math.round(r[0])})]}),(0,v.jsxs)("tr",{children:[(0,v.jsx)("td",{children:b("stats.height")}),(0,v.jsx)("td",{children:Math.round(r[3])-Math.round(r[1])})]}),1===i.length&&(0,v.jsx)("tr",{children:(0,v.jsx)("th",{colSpan:2,children:b("stats.element")})}),i.length>1&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("tr",{children:(0,v.jsx)("th",{colSpan:2,children:b("stats.selected")})}),(0,v.jsxs)("tr",{children:[(0,v.jsx)("td",{children:b("stats.elements")}),(0,v.jsx)("td",{children:i.length})]})]}),i.length>0&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)("tr",{children:[(0,v.jsx)("td",{children:"x"}),(0,v.jsx)("td",{children:Math.round(o[0])})]}),(0,v.jsxs)("tr",{children:[(0,v.jsx)("td",{children:"y"}),(0,v.jsx)("td",{children:Math.round(o[1])})]}),(0,v.jsxs)("tr",{children:[(0,v.jsx)("td",{children:b("stats.width")}),(0,v.jsx)("td",{children:Math.round(o[2]-o[0])})]}),(0,v.jsxs)("tr",{children:[(0,v.jsx)("td",{children:b("stats.height")}),(0,v.jsx)("td",{children:Math.round(o[3]-o[1])})]})]}),1===i.length&&(0,v.jsxs)("tr",{children:[(0,v.jsx)("td",{children:b("stats.angle")}),(0,v.jsx)("td",{children:"".concat(Math.round(180*i[0].angle/Math.PI),"°")})]}),null===(t=e.renderCustomStats)||void 0===t?void 0:t.call(e,e.elements,e.appState)]})})]})})};n(9757);const ap=e=>{let{message:t,clearToast:n}=e;const i=(0,r.useRef)(0),a=(0,r.useCallback)((()=>i.current=window.setTimeout((()=>n()),o.Lg)),[n]);return(0,r.useEffect)((()=>(a(),()=>clearTimeout(i.current))),[a,t]),(0,v.jsx)("div",{className:"Toast",onMouseEnter:()=>clearTimeout(null==i?void 0:i.current),onMouseLeave:a,children:(0,v.jsx)("p",{className:"Toast__message",children:t})})},sp=Ks({name:"viewMode",perform(e,t){return rc("view","mode","view"),{appState:Object.assign(Object.assign({},t),{viewModeEnabled:!this.checked(t)}),commitToHistory:!1}},checked:e=>e.viewModeEnabled,contextItemLabel:"labels.viewMode",keyTest:e=>!e[Lt.CTRL_OR_CMD]&&e.altKey&&e.code===Ot});var lp=n(200),cp=n.n(lp);const dp=i().createContext(!1),up=()=>(0,r.useContext)(dp),hp=i().createContext({container:null,id:null}),pp=()=>(0,r.useContext)(hp);let gp=!1,mp=0,fp=0,bp=0,vp=!1,xp=!1,yp=!1,wp={horizontal:null,vertical:null},kp=0,_p=!1,Cp=null;const Ep={pointers:new Map,lastCenter:null,initialDistance:null,initialScale:null};class Sp extends i().Component{constructor(e){super(e),jp.call(this);const t=hn(),{excalidrawRef:n,viewModeEnabled:r=!1,zenModeEnabled:i=!1,gridModeEnabled:a=!1,theme:s=t.theme,name:l=t.name}=e;if(this.state=Object.assign(Object.assign(Object.assign(Object.assign({},t),{theme:s,isLoading:!0}),this.getCanvasOffsets()),{viewModeEnabled:r,zenModeEnabled:i,gridSize:a?o.k:null,name:l,width:window.innerWidth,height:window.innerHeight,showHyperlinkPopup:!1}),this.id=we(),n){var c;const e="current"in n&&(null===(c=n.current)||void 0===c?void 0:c.readyPromise)||(()=>{let e,t;const n=new Promise(((n,r)=>{e=n,t=r}));return n.resolve=e,n.reject=t,n})(),t={ready:!0,readyPromise:e,updateScene:this.updateScene,addFiles:this.addFiles,resetScene:this.resetScene,getSceneElementsIncludingDeleted:this.getSceneElementsIncludingDeleted,history:{clear:this.resetHistory},scrollToContent:this.scrollToContent,getSceneElements:this.getSceneElements,getAppState:()=>this.state,getFiles:()=>this.files,refresh:this.refresh,importLibrary:this.importLibraryFromUrl,setToastMessage:this.setToastMessage,id:this.id,app:this};"function"==typeof n?n(t):n.current=t,e.resolve(t)}var d;this.excalidrawContainerValue={container:this.excalidrawContainerRef.current,id:this.id},this.scene=new Hn,this.library=new Vu(this),this.history=new qu,this.actionManager=new Ku(this.syncActionResult,(()=>this.state),(()=>this.scene.getElementsIncludingDeleted()),this),this.actionManager.registerAll(Ws),this.actionManager.registerAction((d=this.history,{name:"undo",perform:(e,t)=>Uu(e,t,(()=>d.undoOnce())),keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.key.toLowerCase()===Lt.Z&&!e.shiftKey,PanelComponent:e=>{let{updateData:t,data:n}=e;return(0,v.jsx)(Js,{type:"button",icon:La,"aria-label":b("buttons.undo"),onClick:t,size:(null==n?void 0:n.size)||"medium"})},commitToHistory:()=>!1})),this.actionManager.registerAction((e=>({name:"redo",perform:(t,n)=>Uu(t,n,(()=>e.redoOnce())),keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.shiftKey&&e.key.toLowerCase()===Lt.Z||ct&&e.ctrlKey&&!e.shiftKey&&e.key===Lt.Y,PanelComponent:e=>{let{updateData:t,data:n}=e;return(0,v.jsx)(Js,{type:"button",icon:Aa,"aria-label":b("buttons.redo"),onClick:t,size:(null==n?void 0:n.size)||"medium"})},commitToHistory:()=>!1}))(this.history))}renderCanvas(){const e=window.devicePixelRatio,{width:t,height:n,viewModeEnabled:r}=this.state,i=t*e,a=n*e;return r?(0,v.jsx)("canvas",{className:"excalidraw__canvas",style:{width:t,height:n,cursor:o.oc.GRAB},width:i,height:a,ref:this.handleCanvasRef,onContextMenu:this.handleCanvasContextMenu,onPointerMove:this.handleCanvasPointerMove,onPointerUp:this.handleCanvasPointerUp,onPointerCancel:this.removePointer,onTouchMove:this.handleTouchMove,onPointerDown:this.handleCanvasPointerDown,children:b("labels.drawingCanvas")}):(0,v.jsx)("canvas",{className:"excalidraw__canvas",style:{width:t,height:n},width:i,height:a,ref:this.handleCanvasRef,onContextMenu:this.handleCanvasContextMenu,onPointerDown:this.handleCanvasPointerDown,onDoubleClick:this.handleCanvasDoubleClick,onPointerMove:this.handleCanvasPointerMove,onPointerUp:this.handleCanvasPointerUp,onPointerCancel:this.removePointer,onTouchMove:this.handleTouchMove,children:b("labels.drawingCanvas")})}render(){var e,t;const{zenModeEnabled:n,viewModeEnabled:r}=this.state,i=Al(this.scene.getElements(),this.state),{onCollabButtonClick:o,renderTopRightUI:a,renderFooter:s,renderCustomStats:l}=this.props;return(0,v.jsx)("div",{className:ye("excalidraw excalidraw-container",{"excalidraw--zen-mode":n,"excalidraw--view-mode":r,"excalidraw--mobile":this.isMobile}),ref:this.excalidrawContainerRef,onDrop:this.handleAppOnDrop,tabIndex:0,onKeyDown:this.props.handleKeyboardGlobally?void 0:this.onKeyDown,children:(0,v.jsx)(hp.Provider,{value:this.excalidrawContainerValue,children:(0,v.jsxs)(dp.Provider,{value:this.isMobile,children:[(0,v.jsx)(ip,{onHomeButtonClick:this.props.onHomeButtonClick,canvas:this.canvas,appState:this.state,files:this.files,setAppState:this.setAppState,actionManager:this.actionManager,elements:this.scene.getElements(),onCollabButtonClick:o,onLockToggle:this.toggleLock,onPenModeToggle:this.togglePenMode,onInsertElements:e=>this.addElementsFromPasteOrLibrary({elements:e,position:"center",files:null}),zenModeEnabled:n,toggleZenMode:this.toggleZenMode,langCode:m().code,isCollaborating:this.props.isCollaborating,renderTopRightUI:a,renderCustomFooter:s,viewModeEnabled:r,showExitZenModeBtn:void 0===(null===(e=this.props)||void 0===e?void 0:e.zenModeEnabled)&&n,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,v.jsx)("div",{className:"excalidraw-textEditorContainer"}),(0,v.jsx)("div",{className:"excalidraw-contextMenuContainer"}),1===i.length&&this.state.showHyperlinkPopup&&(0,v.jsx)(cc,{element:i[0],appState:this.state,setAppState:this.setAppState,onLinkOpen:this.props.onLinkOpen},i[0].id),this.state.showStats&&(0,v.jsx)(op,{appState:this.state,setAppState:this.setAppState,elements:this.scene.getElements(),onClose:this.toggleStats,renderCustomStats:l}),null!==this.state.toastMessage&&(0,v.jsx)(ap,{message:this.state.toastMessage,clearToast:this.clearToast}),(0,v.jsx)("main",{children:this.renderCanvas()})]})})})}async componentDidMount(){var e,t,n=this;if(this.unmounted=!1,this.excalidrawContainerValue.container=this.excalidrawContainerRef.current,"production"===o.Vi.TEST||"production"===o.Vi.DEVELOPMENT){this.setState.bind(this);Object.defineProperties(window.h,{state:{configurable:!0,get:()=>this.state},setState:{configurable:!0,value:function(){return n.setState(...arguments)}},app:{configurable:!0,value:this},history:{configurable:!0,value:this.history}})}if(this.scene.addCallback(this.onSceneUpdated),this.addEventListeners(),this.excalidrawContainerRef.current&&this.focusContainer(),"ResizeObserver"in window&&null!==(e=this.excalidrawContainerRef)&&void 0!==e&&e.current)this.resizeObserver=new ResizeObserver((()=>{const{width:e,height:t}=this.excalidrawContainerRef.current.getBoundingClientRect();this.isMobile=e<o.kV||t<o.Yx&&e<o.sS,this.updateDOMRect()})),null===(t=this.resizeObserver)||void 0===t||t.observe(this.excalidrawContainerRef.current);else if(window.matchMedia){const e=window.matchMedia("(max-width: ".concat(o.kV,"px), (max-height: ").concat(o.Yx,"px) and (max-width: ").concat(o.sS,"px)")),t=()=>this.isMobile=e.matches;e.addListener(t),this.detachIsMobileMqHandler=()=>e.removeListener(t)}new URLSearchParams(window.location.search.slice(1)).has("web-share-target")?this.restoreFileFromShare():this.updateDOMRect(this.initializeScene)}componentWillUnmount(){var e;this.files={},this.imageCache.clear(),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.unmounted=!0,this.removeEventListeners(),this.scene.destroy(),hr=new WeakMap,pr=new WeakMap,Cr=new WeakMap,this.scene=new Hn,this.history=new qu,this.actionManager=new Ku(this.syncActionResult,(()=>this.state),(()=>this.scene.getElementsIncludingDeleted()),this),this.library=new Vu(this),this.canvas=null,this.rc=null,this.excalidrawContainerRef.current=void 0,this.nearestScrollableContainer=void 0,this.excalidrawContainerValue={container:null,id:"unmounted"},clearTimeout(kp),kp=0}removeEventListeners(){var e,t,n,r,i,a;document.removeEventListener(o.Ks.POINTER_UP,this.removePointer),document.removeEventListener(o.Ks.COPY,this.onCopy),document.removeEventListener(o.Ks.PASTE,this.pasteFromClipboard),document.removeEventListener(o.Ks.CUT,this.onCut),null===(e=this.nearestScrollableContainer)||void 0===e||e.removeEventListener(o.Ks.SCROLL,this.onScroll),document.removeEventListener(o.Ks.KEYDOWN,this.onKeyDown,!1),document.removeEventListener(o.Ks.MOUSE_MOVE,this.updateCurrentCursorPosition,!1),document.removeEventListener(o.Ks.KEYUP,this.onKeyUp),window.removeEventListener(o.Ks.RESIZE,this.onResize,!1),window.removeEventListener(o.Ks.UNLOAD,this.onUnload,!1),window.removeEventListener(o.Ks.BLUR,this.onBlur,!1),null===(t=this.excalidrawContainerRef.current)||void 0===t||t.removeEventListener(o.Ks.DRAG_OVER,this.disableEvent,!1),null===(n=this.excalidrawContainerRef.current)||void 0===n||n.removeEventListener(o.Ks.DROP,this.disableEvent,!1),null===(r=document.fonts)||void 0===r||null===(i=r.removeEventListener)||void 0===i||i.call(r,"loadingdone",this.onFontLoaded),document.removeEventListener(o.Ks.GESTURE_START,this.onGestureStart,!1),document.removeEventListener(o.Ks.GESTURE_CHANGE,this.onGestureChange,!1),document.removeEventListener(o.Ks.GESTURE_END,this.onGestureEnd,!1),null===(a=this.detachIsMobileMqHandler)||void 0===a||a.call(this)}addEventListeners(){var e,t,n,r;this.removeEventListeners(),document.addEventListener(o.Ks.POINTER_UP,this.removePointer),document.addEventListener(o.Ks.COPY,this.onCopy),this.props.handleKeyboardGlobally&&document.addEventListener(o.Ks.KEYDOWN,this.onKeyDown,!1),document.addEventListener(o.Ks.KEYUP,this.onKeyUp,{passive:!0}),document.addEventListener(o.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(o.Ks.GESTURE_START,this.onGestureStart,!1),document.addEventListener(o.Ks.GESTURE_CHANGE,this.onGestureChange,!1),document.addEventListener(o.Ks.GESTURE_END,this.onGestureEnd,!1),this.state.viewModeEnabled||(document.addEventListener(o.Ks.PASTE,this.pasteFromClipboard),document.addEventListener(o.Ks.CUT,this.onCut),this.props.detectScroll&&(this.nearestScrollableContainer=(e=>{let t=e.parentElement;for(;t;){if(t===document.body)return document;const{overflowY:e}=window.getComputedStyle(t);if(t.scrollHeight>t.clientHeight&&("auto"===e||"scroll"===e||"overlay"===e))return t;t=t.parentElement}return document})(this.excalidrawContainerRef.current),this.nearestScrollableContainer.addEventListener(o.Ks.SCROLL,this.onScroll)),window.addEventListener(o.Ks.RESIZE,this.onResize,!1),window.addEventListener(o.Ks.UNLOAD,this.onUnload,!1),window.addEventListener(o.Ks.BLUR,this.onBlur,!1),null===(n=this.excalidrawContainerRef.current)||void 0===n||n.addEventListener(o.Ks.DRAG_OVER,this.disableEvent,!1),null===(r=this.excalidrawContainerRef.current)||void 0===r||r.addEventListener(o.Ks.DROP,this.disableEvent,!1))}componentDidUpdate(e,t){var n;Object.keys(this.state.selectedElementIds).length&&vn(this.state)&&this.setState({elementType:"selection"}),"selection"===t.elementType&&"selection"!==this.state.elementType&&this.state.showHyperlinkPopup&&this.setState({showHyperlinkPopup:!1}),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?o.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((()=>{this.actionManager.executeAction(ec)}));const{multiElement:r}=t;t.elementType!==this.state.elementType&&null!=r&&wo(this.state)&&Te(r)&&So(r,this.state,this.scene,tn(xo.getPointAtIndexGlobalCoordinates(r,-1)));const i={},a={},s={},l={},c={};this.state.collaborators.forEach(((e,t)=>{if(e.selectedElementIds)for(const n of Object.keys(e.selectedElementIds))n in s||(s[n]=[]),s[n].push(t);e.pointer&&(e.username&&(l[t]=e.username),e.userState&&(c[t]=e.userState),a[t]=$t({sceneX:e.pointer.x,sceneY:e.pointer.y},this.state),i[t]=e.button)}));const d=this.scene.getElements().filter((e=>(!_e(e)||!this.state.pendingImageElement||e.id!==this.state.pendingImageElement.id)&&(!this.state.editingElement||"text"!==this.state.editingElement.type||e.id!==this.state.editingElement.id))),{atLeastOneVisibleElement:u,scrollBars:h}=_c(d,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:a,remotePointerButton:i,remoteSelectedElementIds:s,remotePointerUsernames:l,remotePointerUserStates:c,shouldCacheIgnoreZoom:this.state.shouldCacheIgnoreZoom,theme:this.state.theme,imageCache:this.imageCache,isExporting:!1,renderScrollbars:!this.isMobile});h&&(wp=h);const p=!Ce(this.state.editingElement)&&(!u&&d.length>0);var g,m;(this.state.scrolledOutside!==p&&this.setState({scrolledOutside:p}),this.history.record(this.state,this.scene.getElementsIncludingDeleted()),this.scheduleImageRefresh(),this.state.isLoading)||(null===(g=(m=this.props).onChange)||void 0===g||g.call(m,this.scene.getElementsIncludingDeleted(),this.state,this.files,this.props.id))}static resetTapTwice(){gp=!1}addTextFromPaste(e){const{x:t,y:n}=qt({clientX:fp,clientY:bp},this.state),r=Qr({x:t,y:n,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:o.hs});this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),r]),this.setState({selectedElementIds:{[r.id]:!0}}),this.history.resumeRecording()}selectShapeTool(e){var t;vp||Yt(this.canvas,e),(t=document.activeElement)instanceof HTMLElement&&t.className.includes("ToolIcon")&&this.focusContainer(),Ie(e)||this.setState({suggestedBindings:[]}),"image"===e&&this.onImageAction(),"selection"!==e?this.setState({elementType:e,selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}):this.setState({elementType:e})}handleTextWysiwyg(e,t){let{isExistingElement:n=!1}=t;const r=(t,n,r)=>{this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted().map((i=>i.id===e.id&&Ce(i)?Jr(i,{text:t,isDeleted:r,originalText:n}):i))])};wl({id:e.id,canvas:this.canvas,getViewportCoords:(e,t)=>{const{x:n,y:r}=$t({sceneX:e,sceneY:t},this.state);return[n-this.state.offsetLeft,r-this.state.offsetTop]},onChange:on((t=>{r(t,t,!1),Sl(e)&&Po(e)})),onSubmit:on((t=>{let{text:i,viaKeyboard:o,originalText:a}=t;const s=!i.trim();if(r(i,a,s),!s&&o){const t=e.containerId?e.containerId:e.id;this.setState((e=>({selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[t]:!0})})))}s&&Go(this.scene.getElements(),[e]),s&&!n||this.history.resumeRecording(),this.setState({draggingElement:null,editingElement:null}),this.state.elementLocked&&Yt(this.canvas,this.state.elementType),this.focusContainer()})),element:e,excalidrawContainer:this.excalidrawContainerRef.current,app:this}),this.deselectElements(),r(e.text,e.originalText,!1)}deselectElements(){this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})}getTextElementAtPosition(e,t){const n=this.getElementAtPosition(e,t,{includeBoundTextElement:!0});return n&&Ce(n)&&!n.isDeleted?n:null}getElementAtPosition(e,t,n){const r=this.getElementsAtPosition(e,t,null==n?void 0:n.includeBoundTextElement);if(r.length>1){if(null!=n&&n.preferSelected)for(let e=r.length-1;e>-1;e--)if(this.state.selectedElementIds[r[e].id])return r[e];const i=r[r.length-1];return Pi(i,this.state,e,t)?r[r.length-2]:i}return 1===r.length?r[0]:null}getElementsAtPosition(e,t){return((e,t)=>e.filter((e=>!e.isDeleted&&t(e))))(arguments.length>2&&void 0!==arguments[2]&&arguments[2]?this.scene.getElements():this.scene.getElements().filter((e=>!(Ce(e)&&e.containerId))),(n=>((e,t,n,r)=>{const i=10/t.zoom.value,o=[n,r];return zi(t,e)?Ri(e,o,i):Di(e,t,o)})(n,this.state,e,t)))}maybeCleanupAfterMissingPointerUp(e){null!==Cp&&Cp(e)}updateGestureOnPointerDown(e){Ep.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),2===Ep.pointers.size&&(Ep.lastCenter=Gu(Ep.pointers),Ep.initialScale=this.state.zoom.value,Ep.initialDistance=Yu(Array.from(Ep.pointers.values())))}initialPointerDownState(e){const t=qt(e,this.state),n=Al(this.scene.getElements(),this.state),[r,i,o,a]=et(n);return{origin:t,withCmdOrCtrl:e[Lt.CTRL_OR_CMD],originInGrid:tn(Ke(t.x,t.y,this.state.gridSize)),scrollbars:Ml(wp,e.clientX-this.state.offsetLeft,e.clientY-this.state.offsetTop),lastCoords:Object.assign({},t),originalElements:this.scene.getElements().reduce(((e,t)=>(e.set(t.id,ti(t)),e)),new Map),resize:{handleType:!1,isResizing:!1,offset:{x:0,y:0},arrowDirection:"origin",center:{x:(o+r)/2,y:(a+i)/2}},hit:{element:null,allHitElements:[],wasAddedToSelection:!1,hasBeenDuplicated:!1,hasHitCommonBoundingBoxOfSelectedElements:this.isHittingCommonBoundingBoxOfSelectedElements(t,n),hasHitElementInside:!1},drag:{hasOccurred:!1,offset:null},eventListeners:{onMove:null,onUp:null,onKeyUp:null,onKeyDown:null},boxSelection:{hasOccurred:!1},elementIdsToErase:{}}}handleDraggingScrollBar(e,t){if(!t.scrollbars.isOverEither||this.state.multiElement)return!1;yp=!0,t.lastCoords.x=e.clientX,t.lastCoords.y=e.clientY;const n=an((e=>{e.target instanceof HTMLElement&&this.handlePointerMoveOverScrollbars(e,t)})),r=on((()=>{yp=!1,Yt(this.canvas,this.state.elementType),Cp=null,this.setState({cursorButton:"up"}),this.savePointer(e.clientX,e.clientY,"up"),window.removeEventListener(o.Ks.POINTER_MOVE,n),window.removeEventListener(o.Ks.POINTER_UP,r),n.flush()}));return Cp=r,window.addEventListener(o.Ks.POINTER_MOVE,n),window.addEventListener(o.Ks.POINTER_UP,r),!0}isASelectedElement(e){return null!=e&&this.state.selectedElementIds[e.id]}isHittingCommonBoundingBoxOfSelectedElements(e,t){if(t.length<2)return!1;const n=10/this.state.zoom.value,[r,i,o,a]=et(t);return e.x>r-n&&e.x<o+n&&e.y>i-n&&e.y<a+n}onKeyDownFromPointerDownHandler(e){return on((t=>{this.maybeHandleResize(e,t)||this.maybeDragNewGenericElement(e,t)}))}onKeyUpFromPointerDownHandler(e){return on((t=>{t.key===Lt.ALT&&t.preventDefault(),this.maybeHandleResize(e,t)||this.maybeDragNewGenericElement(e,t)}))}onPointerMoveFromPointerDownHandler(e){return an((t=>{var n,r;null===e.drag.offset&&(e.drag.offset=tn(((e,t,n)=>{const[r,i]=et(e);return[t-r,n-i]})(Al(this.scene.getElements(),this.state),e.origin.x,e.origin.y)));if(!(t.target instanceof HTMLElement))return;if(this.handlePointerMoveOverScrollbars(t,e))return;const i=qt(t,this.state);if(vn(this.state))return void this.handleEraser(t,e,i);const[a,s]=Ke(i.x,i.y,this.state.gridSize);if(!e.drag.hasOccurred&&("arrow"===this.state.elementType||"line"===this.state.elementType)&&He(i.x,i.y,e.origin.x,e.origin.y)<o.f)return;if(e.resize.isResizing&&(e.lastCoords.x=i.x,e.lastCoords.y=i.y,this.maybeHandleResize(e,t)))return!0;if(this.state.editingLinearElement){if(xo.handlePointDragging(this.state,(e=>this.setState(e)),i.x,i.y,((e,t)=>{this.maybeSuggestBindingsForLinearElementAtCoords(e,t)})))return e.lastCoords.x=i.x,void(e.lastCoords.y=i.y)}if((e.hit.allHitElements.some((e=>this.isASelectedElement(e)))||e.hit.hasHitCommonBoundingBoxOfSelectedElements)&&(!this.state.editingLinearElement||!t.shiftKey)&&(!this.state.editingLinearElement||(null===(n=this.state.editingLinearElement)||void 0===n?void 0:n.elementId)!==(null===(r=e.hit.element)||void 0===r?void 0:r.id)||e.hit.hasHitElementInside)){e.drag.hasOccurred=!0;const n=Al(this.scene.getElements(),this.state);if(n.length>0&&!e.withCmdOrCtrl){const[r,o]=Ke(i.x-e.drag.offset.x,i.y-e.drag.offset.y,this.state.gridSize),[a,s]=[Math.abs(i.x-e.origin.x),Math.abs(i.y-e.origin.y)],l=t.shiftKey;if(function(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=arguments.length>7?arguments[7]:void 0;const[l,c]=et(t),d={x:n-l,y:r-c};t.forEach((n=>{if(ra(i,o,a,e,n,d),!n.groupIds.length||s.editingGroupId&&!Br(s,n)){const t=er(n);t&&ra(i,o,a,e,t,d)}Po(n,{simultaneouslyUpdated:t})}))}(e,n,r,o,l,a,s,this.state),this.maybeSuggestBindingForAll(n),t.altKey&&!e.hit.hasBeenDuplicated){e.hit.hasBeenDuplicated=!0;const t=[],n=[],i=new Map,a=new Map,s=e.hit.element,l=this.scene.getElementsIncludingDeleted(),c=Al(l,this.state,!0).map((e=>e.id));for(const d of l)if(c.includes(d.id)||d.id===(null==s?void 0:s.id)&&e.hit.wasAddedToSelection){const s=ni(this.state.editingGroupId,i,d),[l,c]=Ke(e.origin.x-e.drag.offset.x,e.origin.y-e.drag.offset.y,this.state.gridSize);Ar(s,{x:s.x+(l-r),y:s.y+(c-o)}),t.push(s),n.push(d),a.set(d.id,s.id)}else t.push(d);const d=[...t,...n];Bn(t,n,a),Ko(d,n,a,"duplicatesServeAsOld"),this.scene.replaceAllElements(d)}return}}const l=this.state.draggingElement;if(l){if("freedraw"===l.type){const e=l.points,n=i.x-l.x,r=i.y-l.y,o=e.length>0&&e[e.length-1];if(!(o&&o[0]===n&&o[1]===r)){const i=l.simulatePressure?l.pressures:[...l.pressures,t.pressure];Ar(l,{points:[...e,[n,r]],pressures:i})}}else if(je(l)){e.drag.hasOccurred=!0;const n=l.points;let r=a-l.x,o=s-l.y;zt(t)&&2===n.length&&({width:r,height:o}=Rr(this.state.elementType,r,o)),1===n.length?Ar(l,{points:[...n,[r,o]]}):n.length>1&&Ar(l,{points:[...n.slice(0,-1),[r,o]]}),Te(l)&&this.maybeSuggestBindingsForLinearElementAtCoords(l,[i],this.state.startBoundElement)}else e.lastCoords.x=i.x,e.lastCoords.y=i.y,this.maybeDragNewGenericElement(e,t);if("selection"===this.state.elementType){e.boxSelection.hasOccurred=!0;const n=this.scene.getElements();if(t.shiftKey||this.state.editingLinearElement||!Ol(n,this.state)||(e.withCmdOrCtrl&&e.hit.element?this.setState((t=>Wr(Object.assign(Object.assign({},t),{selectedElementIds:{[e.hit.element.id]:!0}}),this.scene.getElements()))):this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})),this.state.editingLinearElement)xo.handleBoxSelection(t,this.state,this.setState.bind(this));else{const t=((e,t)=>{const[n,r,i,o]=Ye(t);return e.filter((e=>{const[t,a,s,l]=Je(e);return"selection"!==e.type&&!Pe(e)&&n<=t&&r<=a&&i>=s&&o>=l}))})(n,l);this.setState((n=>Wr(Object.assign(Object.assign({},n),{selectedElementIds:Object.assign(Object.assign(Object.assign({},n.selectedElementIds),t.reduce(((e,t)=>(e[t.id]=!0,e)),{})),e.hit.element?{[e.hit.element.id]:!t.length}:null),showHyperlinkPopup:!(1!==t.length||!t[0].link)&&"info"}),this.scene.getElements())))}}}}))}handlePointerMoveOverScrollbars(e,t){if(t.scrollbars.isOverHorizontal){const 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){const n=e.clientY,r=n-t.lastCoords.y;return this.setState({scrollY:this.state.scrollY-r/this.state.zoom.value}),t.lastCoords.y=n,!0}return!1}onPointerUpFromPointerDownHandler(e){return on((t=>{const{draggingElement:n,resizingElement:r,multiElement:i,elementType:a,elementLocked:s,isResizing:l,isRotating:c}=this.state;var d,u;if(this.setState({isResizing:!1,isRotating:!1,resizingElement:null,selectionElement:null,cursorButton:"up",editingElement:i||Ce(this.state.editingElement)?this.state.editingElement:null}),this.savePointer(t.clientX,t.clientY,"up"),this.state.editingLinearElement)if(e.boxSelection.hasOccurred||(null===(d=e.hit)||void 0===d||null===(u=d.element)||void 0===u?void 0:u.id)===this.state.editingLinearElement.elementId&&e.hit.hasHitElementInside){const e=xo.handlePointerUp(t,this.state.editingLinearElement,this.state);e!==this.state.editingLinearElement&&this.setState({editingLinearElement:e,suggestedBindings:[]})}else this.actionManager.executeAction(ec);if(Cp=null,e.eventListeners.onMove&&e.eventListeners.onMove.flush(),window.removeEventListener(o.Ks.POINTER_MOVE,e.eventListeners.onMove),window.removeEventListener(o.Ks.POINTER_UP,e.eventListeners.onUp),window.removeEventListener(o.Ks.KEYDOWN,e.eventListeners.onKeyDown),window.removeEventListener(o.Ks.KEYUP,e.eventListeners.onKeyUp),this.state.pendingImageElement&&this.setState({pendingImageElement:null}),"freedraw"===(null==n?void 0:n.type)){const e=qt(t,this.state),r=n.points;let i=e.x-n.x,o=e.y-n.y;i===r[0][0]&&o===r[0][1]&&(o+=1e-4,i+=1e-4);const a=n.simulatePressure?[]:[...n.pressures,t.pressure];return Ar(n,{points:[...r,[i,o]],pressures:a,lastCommittedPoint:[i,o]}),void this.actionManager.executeAction(ec)}if(_e(n)){const e=n;try{this.initializeImageDimensions(e),this.setState({selectedElementIds:{[e.id]:!0}},(()=>{this.actionManager.executeAction(ec)}))}catch(t){console.error(t),this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().filter((t=>t.id!==e.id))),this.actionManager.executeAction(ec)}return}if(je(n)){n.points.length>1&&this.history.resumeRecording();const r=qt(t,this.state);return void(e.drag.hasOccurred||!n||i?e.drag.hasOccurred&&!i&&(wo(this.state)&&Te(n)&&So(n,this.state,this.scene,r),this.setState({suggestedBindings:[],startBoundElement:null}),s?this.setState((e=>({draggingElement:null,selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[this.state.draggingElement.id]:!0})}))):(Vt(this.canvas),this.setState((e=>({draggingElement:null,elementType:"selection",selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[this.state.draggingElement.id]:!0})}))))):(Ar(n,{points:[...n.points,[r.x-n.x,r.y-n.y]]}),this.setState({multiElement:n,editingElement:this.state.draggingElement})))}if("selection"!==a&&n&&zr(n))return this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().slice(0,-1)),void this.setState({draggingElement:null});n&&Ar(n,Hr(n)),r&&this.history.resumeRecording(),r&&zr(r)&&this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().filter((e=>e.id!==r.id)));const h=e.hit.element;if(vn(this.state))this.eraseElements(e);else{if(h&&!e.drag.hasOccurred&&!e.hit.wasAddedToSelection&&(!this.state.editingLinearElement||!e.boxSelection.hasOccurred))if(t.shiftKey&&!this.state.editingLinearElement)if(this.state.selectedElementIds[h.id])if(Br(this.state,h)){const e=h.groupIds.flatMap((e=>Vr(this.scene.getElements(),e))).map((e=>({[e.id]:!1}))).reduce(((e,t)=>Object.assign(Object.assign({},e),t)),{});this.setState((t=>({selectedGroupIds:Object.assign(Object.assign({},t.selectedElementIds),h.groupIds.map((e=>({[e]:!1}))).reduce(((e,t)=>Object.assign(Object.assign({},e),t)),{})),selectedElementIds:Object.assign(Object.assign({},t.selectedElementIds),e)})))}else this.setState((e=>Wr(Object.assign(Object.assign({},e),{selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[h.id]:!1})}),this.scene.getElements())));else this.setState((e=>({selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[h.id]:!0})})));else this.setState((e=>Object.assign({},Wr(Object.assign(Object.assign({},e),{selectedElementIds:{[h.id]:!0}}),this.scene.getElements()))));this.state.editingLinearElement||e.drag.hasOccurred||this.state.isResizing||!(h&&Pi(h,this.state,e.origin.x,e.origin.y)||!h&&e.hit.hasHitCommonBoundingBoxOfSelectedElements)?(!s&&"freedraw"!==a&&n&&this.setState((e=>({selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[n.id]:!0})}))),("selection"!==a||Ol(this.scene.getElements(),this.state))&&this.history.resumeRecording(),(e.drag.hasOccurred||l||c)&&(wo(this.state)?Co:Mo)(Al(this.scene.getElements(),this.state)),s||"freedraw"===a?this.setState({draggingElement:null,suggestedBindings:[]}):(Vt(this.canvas),this.setState({draggingElement:null,suggestedBindings:[],elementType:"selection"}))):this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})}}))}maybeSuggestBindingForAll(e){const t=(e=>{const t=new Set(e.map((e=>{let{id:t}=e;return t})));return e.flatMap((e=>Te(e)?No(e).filter((e=>!t.has(e.id))):Oe(e)?Uo(e).filter((e=>!t.has(e[0].id))):[]))})(e);this.setState({suggestedBindings:t})}clearSelection(e){this.setState((t=>({selectedElementIds:{},selectedGroupIds:{},editingGroupId:t.editingGroupId&&null!=e&&Kr(e,t.editingGroupId)?t.editingGroupId:null}))),this.setState({selectedElementIds:{},previousSelectedElementIds:this.state.selectedElementIds})}getTextWysiwygSnappedToCenterPosition(e,t,n,r,i){const a=Us(this.scene.getElementsIncludingDeleted().filter((e=>!Ce(e))),e,t);if(a){const r=a.x+a.width/2,i=a.y+a.height/2;if(Math.hypot(e-r,t-i)<o.wZ){const{x:e,y:t}=$t({sceneX:r,sceneY:i},n);return{viewportX:e,viewportY:t,elementCenterX:r,elementCenterY:i}}}}getCanvasOffsets(){var e;if(null!==(e=this.excalidrawContainerRef)&&void 0!==e&&e.current){const e=this.excalidrawContainerRef.current,{left:t,top:n}=e.getBoundingClientRect();return{offsetLeft:t,offsetTop:n}}return{offsetLeft:0,offsetTop:0}}async updateLanguage(){const e=d.find((e=>e.code===this.props.langCode))||c;await g(e),this.setAppState({})}}Sp.defaultProps={UIOptions:o.cW};var jp=function(){var e=this;this.canvas=null,this.rc=null,this.unmounted=!1,this.isMobile=!1,this.excalidrawContainerRef=i().createRef(),this.files={},this.imageCache=new Map,this.lastPointerDown=null,this.lastPointerUp=null,this.contextMenuOpen=!1,this.lastScenePointer=null,this.focusContainer=()=>{var e;this.props.autoFocus&&(null===(e=this.excalidrawContainerRef.current)||void 0===e||e.focus())},this.getSceneElementsIncludingDeleted=()=>this.scene.getElementsIncludingDeleted(),this.getSceneElements=()=>this.scene.getElements(),this.syncActionResult=on((e=>{if(this.contextMenuOpen=!1,this.unmounted||!1===e)return;let t=null;if(e.elements&&(e.elements.forEach((e=>{var n;(null===(n=this.state.editingElement)||void 0===n?void 0:n.id)===e.id&&this.state.editingElement!==e&&Sl(e)&&(t=e)})),this.scene.replaceAllElements(e.elements),e.commitToHistory&&this.history.resumeRecording()),e.files&&(this.files=e.replaceFiles?e.files:Object.assign(Object.assign({},this.files),e.files),this.addNewImagesToImageCache()),e.appState||t){var n,r,i,a,s,l;e.commitToHistory&&this.history.resumeRecording();let c=(null==e||null===(n=e.appState)||void 0===n?void 0:n.viewModeEnabled)||!1,d=(null==e||null===(r=e.appState)||void 0===r?void 0:r.zenModeEnabled)||!1,u=(null==e||null===(i=e.appState)||void 0===i?void 0:i.gridSize)||null,h=(null==e||null===(a=e.appState)||void 0===a?void 0:a.theme)||o.C6.LIGHT,p=null!==(s=null==e||null===(l=e.appState)||void 0===l?void 0:l.name)&&void 0!==s?s:this.state.name;void 0!==this.props.viewModeEnabled&&(c=this.props.viewModeEnabled),void 0!==this.props.zenModeEnabled&&(d=this.props.zenModeEnabled),void 0!==this.props.gridModeEnabled&&(u=this.props.gridModeEnabled?o.k:null),void 0!==this.props.theme&&(h=this.props.theme),void 0!==this.props.name&&(p=this.props.name),this.setState((n=>{var r;return Object.assign(e.appState||{},{editingElement:t||(null===(r=e.appState)||void 0===r?void 0:r.editingElement)||null,viewModeEnabled:c,zenModeEnabled:d,gridSize:u,theme:h,name:p})}),(()=>{e.syncHistory&&this.history.setCurrentState(this.state,this.scene.getElementsIncludingDeleted())}))}})),this.onBlur=on((()=>{vp=!1,this.setState({isBindingEnabled:!0})})),this.onUnload=()=>{this.onBlur()},this.disableEvent=e=>{e.preventDefault()},this.onFontLoaded=()=>{this.scene.getElementsIncludingDeleted().forEach((e=>{Ce(e)&&fr(e)})),this.onSceneUpdated()},this.importLibraryFromUrl=async(e,t)=>{if(window.location.hash.includes(o.ah.addLibrary)){const e=new URLSearchParams(window.location.hash.slice(1));e.delete(o.ah.addLibrary),window.history.replaceState({},o.iC,"#".concat(e.toString()))}else if(window.location.search.includes(o.UO.addLibrary)){const e=new URLSearchParams(window.location.search);e.delete(o.UO.addLibrary),window.history.replaceState({},o.iC,"?".concat(e.toString()))}try{const n=await fetch(decodeURIComponent(e)),r=await n.blob(),i=JSON.parse(await r.text());if(!(e=>"object"==typeof e&&e&&e.type===o.r8.excalidrawLibrary&&(1===e.version||2===e.version))(i))throw new Error;(t===this.id||window.confirm(b("alerts.confirmAddLibrary",{numShapes:(i.libraryItems||i.library||[]).length})))&&(await this.library.importLibrary(r,"published"),this.state.isLibraryOpen&&this.setState({isLibraryOpen:!1}),this.setState({isLibraryOpen:!0}))}catch(e){window.alert(b("alerts.errorLoadingLibrary")),console.error(e)}finally{this.focusContainer()}},this.resetHistory=()=>{this.history.clear()},this.resetScene=on((e=>{this.scene.replaceAllElements([]),this.setState((t=>Object.assign(Object.assign({},hn()),{isLoading:(null==e||!e.resetLoadingState)&&t.isLoading,theme:this.state.theme}))),this.resetHistory()})),this.initializeScene=async()=>{var e,t,n;"launchQueue"in window&&"LaunchParams"in window&&window.launchQueue.setConsumer((async e=>{if(!e.files.length)return;const t=e.files[0],n=await t.getFile();n.handle=t,bd(n,this.state,this.scene.getElementsIncludingDeleted()).then((e=>{this.syncActionResult(Object.assign(Object.assign({},e),{appState:Object.assign(Object.assign({},e.appState||this.state),{isLoading:!1}),commitToHistory:!0}))})).catch((e=>{this.setState({isLoading:!1,errorMessage:e.message})}))})),this.state.isLoading||this.setState({isLoading:!0});let r=null;try{var i;r=await this.props.initialData||null,null!==(i=r)&&void 0!==i&&i.libraryItems&&(this.libraryItemsFromStorage=hd(r.libraryItems,"unpublished"))}catch(e){console.error(e),r={appState:{errorMessage:e.message||"Encountered an error during importing or restoring scene data"}}}const a=ud(r,null,null);a.appState=Object.assign(Object.assign({},a.appState),{elementType:"image"===a.appState.elementType?"selection":a.appState.elementType,isLoading:!1}),null!==(e=r)&&void 0!==e&&e.scrollToContent&&(a.appState=Object.assign(Object.assign({},a.appState),rl(a.elements,Object.assign(Object.assign({},a.appState),{width:this.state.width,height:this.state.height,offsetTop:this.state.offsetTop,offsetLeft:this.state.offsetLeft})))),null!=(null===(t=r)||void 0===t?void 0:t.scrollX)&&(a.appState.scrollX=r.scrollX),null!=(null===(n=r)||void 0===n?void 0:n.scrollY)&&(a.appState.scrollY=r.scrollY),this.resetHistory(),this.syncActionResult(Object.assign(Object.assign({},a),{commitToHistory:!0}));const s=new URLSearchParams(window.location.hash.slice(1)).get(o.ah.addLibrary)||new URLSearchParams(window.location.search).get(o.UO.addLibrary);s&&await this.importLibraryFromUrl(s)},this.onResize=on((()=>{this.scene.getElementsIncludingDeleted().forEach((e=>fr(e))),this.setState({})})),this.onScroll=Wt((()=>{const{offsetTop:e,offsetLeft:t}=this.getCanvasOffsets();this.setState((n=>n.offsetLeft===t&&n.offsetTop===e?null:{offsetTop:e,offsetLeft:t}))}),o.HM),this.onCut=on((e=>{var t;(null===(t=this.excalidrawContainerRef.current)||void 0===t?void 0:t.contains(document.activeElement))&&!Bt(e.target)&&(this.cutAll(),e.preventDefault())})),this.onCopy=on((e=>{var t;(null===(t=this.excalidrawContainerRef.current)||void 0===t?void 0:t.contains(document.activeElement))&&!Bt(e.target)&&(this.copyAll(),e.preventDefault())})),this.cutAll=()=>{this.copyAll(),this.actionManager.executeAction(zl)},this.copyAll=()=>{nu(this.scene.getElements(),this.state,this.files)},this.onTapStart=e=>{if(dt||e.preventDefault(),!gp)return gp=!0,clearTimeout(mp),void(mp=window.setTimeout(Sp.resetTapTwice,o.Gj));if(gp&&1===e.touches.length){const[t]=e.touches;this.handleCanvasDoubleClick({clientX:t.clientX,clientY:t.clientY}),gp=!1,clearTimeout(mp)}dt&&e.preventDefault(),2===e.touches.length&&this.setState({selectedElementIds:{}})},this.onTapEnd=e=>{this.resetContextMenuTimer(),e.touches.length>0?this.setState({previousSelectedElementIds:{},selectedElementIds:this.state.previousSelectedElementIds}):Ep.pointers.clear()},this.pasteFromClipboard=on((async e=>{var t,n;const r=document.activeElement;if(!(null===(t=this.excalidrawContainerRef.current)||void 0===t?void 0:t.contains(r)))return;const i=document.elementFromPoint(fp,bp);if(e&&(!(i instanceof HTMLCanvasElement)||Bt(r)))return;let o=null==e||null===(n=e.clipboardData)||void 0===n?void 0:n.files[0];const a=await ou(e);if(!o&&a.text){const e=a.text.trim();e.startsWith("<svg")&&e.endsWith("</svg>")&&(o=_d(e))}if(fd(o)&&!a.spreadsheet){const{x:e,y:t}=qt({clientX:fp,clientY:bp},this.state),n=this.createImageElement({sceneX:e,sceneY:t});return this.insertImageElement(n,o),this.initializeImageDimensions(n),void this.setState({selectedElementIds:{[n.id]:!0}})}if(this.props.onPaste)try{if(!1===await this.props.onPaste(a,e))return}catch(e){console.error(e)}a.errorMessage?this.setState({errorMessage:a.errorMessage}):a.spreadsheet?this.setState({pasteDialog:{data:a.spreadsheet,shown:!0}}):a.elements?this.addElementsFromPasteOrLibrary({elements:a.elements,files:a.files||null,position:"cursor"}):a.text&&this.addTextFromPaste(a.text),this.selectShapeTool("selection"),null==e||e.preventDefault()})),this.addElementsFromPasteOrLibrary=e=>{const t=cd(e.elements,null),[n,r,i,o]=et(t),a=Kt(n,i)/2,s=Kt(r,o)/2,l="object"==typeof e.position?e.position.clientX:"cursor"===e.position?fp:this.state.width/2+this.state.offsetLeft,c="object"==typeof e.position?e.position.clientY:"cursor"===e.position?bp:this.state.height/2+this.state.offsetTop,{x:d,y:u}=qt({clientX:l,clientY:c},this.state),h=d-a,p=u-s,g=new Map,[m,f]=Ke(h,p,this.state.gridSize),b=new Map,v=t.map((e=>{const t=ni(this.state.editingGroupId,g,e,{x:e.x+m-n,y:e.y+f-r});return b.set(e.id,t.id),t}));Bn(v,t,b);const x=[...this.scene.getElementsIncludingDeleted(),...v];Ko(x,t,b),e.files&&(this.files=Object.assign(Object.assign({},this.files),e.files)),this.scene.replaceAllElements(x),this.history.resumeRecording(),this.setState(Wr(Object.assign(Object.assign({},this.state),{isLibraryOpen:!1,selectedElementIds:v.reduce(((e,t)=>(Pe(t)||(e[t.id]=!0),e)),{}),selectedGroupIds:{}}),this.scene.getElements()),(()=>{e.files&&this.addNewImagesToImageCache()})),this.selectShapeTool("selection")},this.setAppState=e=>{this.setState(e)},this.removePointer=e=>{kp&&this.resetContextMenuTimer(),Ep.pointers.delete(e.pointerId)},this.toggleLock=()=>{this.setState((e=>({elementLocked:!e.elementLocked,elementType:e.elementLocked?"selection":e.elementType})))},this.togglePenMode=()=>{this.setState((e=>({penMode:!e.penMode})))},this.toggleZenMode=()=>{this.actionManager.executeAction(Nu)},this.toggleStats=()=>{this.state.showStats||rc("dialog","stats"),this.actionManager.executeAction(Bu)},this.scrollToContent=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.scene.getElements();e.setState(Object.assign({},rl(Array.isArray(t)?t:[t],e.state,e.canvas)))},this.clearToast=()=>{this.setState({toastMessage:null})},this.setToastMessage=e=>{this.setState({toastMessage:e})},this.restoreFileFromShare=async()=>{try{const e=await caches.open("web-share-target"),t=await e.match("shared-file");if(t){const n=await t.blob();this.loadFileToCanvas(n),await e.delete("shared-file"),window.history.replaceState(null,o.iC,window.location.pathname)}}catch(e){this.setState({errorMessage:e.message})}},this.addFiles=on((e=>{const t=e.reduce(((e,t)=>(e.set(t.id,t),e)),new Map);this.files=Object.assign(Object.assign({},this.files),Object.fromEntries(t)),this.scene.getElements().forEach((e=>{ke(e)&&t.has(e.fileId)&&(this.imageCache.delete(e.fileId),fr(e))})),this.scene.informMutation(),this.addNewImagesToImageCache()})),this.updateScene=on((e=>{e.commitToHistory&&this.history.resumeRecording(),e.appState&&this.setState(e.appState),e.elements&&this.scene.replaceAllElements(e.elements),e.collaborators&&this.setState({collaborators:e.collaborators}),e.libraryItems&&this.library.saveLibrary(hd(e.libraryItems,"unpublished"))})),this.onSceneUpdated=()=>{this.setState({})},this.updateCurrentCursorPosition=on((e=>{fp=e.clientX,bp=e.clientY})),this.onKeyDown=on((e=>{var t;if(("Proxy"in window&&(!e.shiftKey&&/^[A-Z]$/.test(e.key)||e.shiftKey&&/^[a-z]$/.test(e.key))&&(e=new Proxy(e,{get(t,n){const r=t[n];return"function"==typeof r?r.bind(t):"key"===n?e.shiftKey?t.key.toUpperCase():t.key.toLowerCase():r}})),!(Bt(e.target)&&e.key!==Lt.ESCAPE||At(e.key)&&(t=e.target,t instanceof HTMLElement&&"wysiwyg"===t.dataset.type||t instanceof HTMLBRElement||t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement)))&&(e.key===Lt.QUESTION_MARK&&this.setState({showHelpDialog:!0}),!this.actionManager.handleKeyDown(e)&&!this.state.viewModeEnabled)){if(e[Lt.CTRL_OR_CMD]&&this.state.isBindingEnabled&&this.setState({isBindingEnabled:!1}),e.code===wt&&this.setState({isLibraryOpen:!this.state.isLibraryOpen}),At(e.key)){const t=this.state.gridSize&&(e.shiftKey?o.$e:this.state.gridSize)||(e.shiftKey?o.Iw:o.$e),n=Al(this.scene.getElements(),this.state,!0);let r=0,i=0;e.key===Lt.ARROW_LEFT?r=-t:e.key===Lt.ARROW_RIGHT?r=t:e.key===Lt.ARROW_UP?i=-t:e.key===Lt.ARROW_DOWN&&(i=t),n.forEach((e=>{Ar(e,{x:e.x+r,y:e.y+i}),Po(e,{simultaneouslyUpdated:n})})),this.maybeSuggestBindingForAll(n),e.preventDefault()}else if(e.key===Lt.ENTER){const t=Al(this.scene.getElements(),this.state);if(1===t.length&&je(t[0]))this.state.editingLinearElement&&this.state.editingLinearElement.elementId===t[0].id||(this.history.resumeRecording(),this.setState({editingLinearElement:new xo(t[0],this.scene)}));else if(1===t.length&&!je(t[0])){const n=t[0];return this.startTextEditing({sceneX:n.x+n.width/2,sceneY:n.y+n.height/2,shouldBind:!0}),void e.preventDefault()}}else if(!e.ctrlKey&&!e.altKey&&!e.metaKey&&null===this.state.draggingElement){const t=(e=>{const t=$u.find(((t,n)=>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})(e.key);t?this.selectShapeTool(t):e.key===Lt.Q&&this.toggleLock()}if(e.key===Lt.SPACE&&0===Ep.pointers.size&&(vp=!0,Gt(this.canvas,o.oc.GRABBING),e.preventDefault()),e.key===Lt.G||e.key===Lt.S){const t=Al(this.scene.getElements(),this.state);if("selection"===this.state.elementType&&!t.length)return;e.key===Lt.G&&(Ps(this.state.elementType)||t.some((e=>Ps(e.type))))&&this.setState({openPopup:"backgroundColorPicker"}),e.key===Lt.S&&this.setState({openPopup:"strokeColorPicker"})}}})),this.onKeyUp=on((e=>{if(e.key===Lt.SPACE&&(this.state.viewModeEnabled?Gt(this.canvas,o.oc.GRAB):"selection"===this.state.elementType?Vt(this.canvas):(Yt(this.canvas,this.state.elementType),this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})),vp=!1),e[Lt.CTRL_OR_CMD]||this.state.isBindingEnabled||this.setState({isBindingEnabled:!0}),At(e.key)){const e=Al(this.scene.getElements(),this.state);wo(this.state)?Co(e):Mo(e),this.setState({suggestedBindings:[]})}})),this.onGestureStart=on((e=>{e.preventDefault(),this.setState({selectedElementIds:{}}),Ep.initialScale=this.state.zoom.value})),this.onGestureChange=on((e=>{if(e.preventDefault(),Ep.pointers.size>=2)return;const t=Ep.initialScale;t&&this.setState((n=>Object.assign({},ol({viewportX:fp,viewportY:bp,nextZoom:il(t*e.scale)},n))))})),this.onGestureEnd=on((e=>{e.preventDefault(),this.setState({previousSelectedElementIds:{},selectedElementIds:this.state.previousSelectedElementIds}),Ep.initialScale=null})),this.startTextEditing=e=>{var t,n,r,i,a;let{sceneX:s,sceneY:l,shouldBind:c,insertAtParentCenter:d=!0}=e,u=d&&this.getTextWysiwygSnappedToCenterPosition(s,l,this.state,this.canvas,window.devicePixelRatio),h=null,p=null;const g=Al(this.scene.getElements(),this.state);if(1===g.length&&(Ce(g[0])?h=g[0]:Le(g[0])&&(p=g[0],h=er(p))),h=null!==(t=h)&&void 0!==t?t:this.getTextElementAtPosition(s,l),p||h||!c&&!u||(p=Us(this.scene.getElements().filter((e=>!Ce(e))),s,l)),!h&&p){const e={fontSize:this.state.currentItemFontSize,fontFamily:this.state.currentItemFontFamily},t=qn(Ut(e)),n=$n(Ut(e)),r=Math.max(p.height,n),i=Math.max(p.width,t);Ar(p,{height:r,width:i}),s=p.x+i/2,l=p.y+r/2,u&&(u=this.getTextWysiwygSnappedToCenterPosition(s,l,this.state,this.canvas,window.devicePixelRatio))}const m=h||Qr({x:u?u.elementCenterX:s,y:u?u.elementCenterY:l,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:"",fontSize:this.state.currentItemFontSize,fontFamily:this.state.currentItemFontFamily,textAlign:u?"center":this.state.currentItemTextAlign,verticalAlign:u?o.oX.MIDDLE:o.hs,containerId:null!==(n=null===(r=p)||void 0===r?void 0:r.id)&&void 0!==n?n:void 0,groupIds:null!==(i=null===(a=p)||void 0===a?void 0:a.groupIds)&&void 0!==i?i:[]});this.setState({editingElement:m}),h||(this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),m]),u||Ar(m,{y:m.y-m.baseline/2})),this.setState({editingElement:m}),this.handleTextWysiwyg(m,{isExistingElement:!!h})},this.handleCanvasDoubleClick=e=>{if(this.state.multiElement)return;if("selection"!==this.state.elementType)return;const t=Al(this.scene.getElements(),this.state);if(1===t.length&&je(t[0]))return void(this.state.editingLinearElement&&this.state.editingLinearElement.elementId===t[0].id||(this.history.resumeRecording(),this.setState({editingLinearElement:new xo(t[0],this.scene)})));Vt(this.canvas);let{x:n,y:r}=qt(e,this.state);if(Ur(this.state).length>0){const e=this.getElementAtPosition(n,r),t=e&&((e,t)=>e.groupIds.find((e=>t[e])))(e,this.state.selectedGroupIds);if(t)return void this.setState((n=>Wr(Object.assign(Object.assign({},n),{editingGroupId:t,selectedElementIds:{[e.id]:!0},selectedGroupIds:{}}),this.scene.getElements())))}if(Vt(this.canvas),!e[Lt.CTRL_OR_CMD]&&!this.state.viewModeEnabled){const t=Al(this.scene.getElements(),this.state);if(1===t.length){const e=t[0];Ae(e)&&(n=e.x+e.width/2,r=e.y+e.height/2)}this.startTextEditing({sceneX:n,sceneY:r,shouldBind:!1,insertAtParentCenter:!e.altKey})}},this.getElementLinkAtPosition=(e,t)=>{const n=this.scene.getElements().slice().reverse();let r=1/0;return n.find(((n,i)=>(t&&n.id===t.id&&(r=i),n.link&&fc(n,this.state,[e.x,e.y],this.isMobile)&&i<=r)))},this.redirectToLink=(e,t)=>{const n=He(this.lastPointerDown.clientX,this.lastPointerDown.clientY,this.lastPointerUp.clientX,this.lastPointerUp.clientY);if(!this.hitLinkElement||t&&n>o.f||!t&&0!==n)return;const r=qt(this.lastPointerDown,this.state),i=fc(this.hitLinkElement,this.state,[r.x,r.y],this.isMobile),a=qt(this.lastPointerUp,this.state),s=fc(this.hitLinkElement,this.state,[a.x,a.y],this.isMobile);if(i&&s){const t=this.hitLinkElement.link;if(t){var l;let n;if(this.props.onLinkOpen&&(n=dn(o.Ks.EXCALIDRAW_LINK,e.nativeEvent),this.props.onLinkOpen(this.hitLinkElement,n)),null===(l=n)||void 0===l||!l.defaultPrevented){const e=hc(t)?"_self":"_blank",n=window.open(void 0,e);n&&(n.opener=null,n.location=uc(t))}}}},this.handleCanvasPointerMove=e=>{this.savePointer(e.clientX,e.clientY,this.state.cursorButton),Ep.pointers.has(e.pointerId)&&Ep.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY});const t=Ep.initialScale;if(2===Ep.pointers.size&&Ep.lastCenter&&t&&Ep.initialDistance){const e=Gu(Ep.pointers),n=e.x-Ep.lastCenter.x,r=e.y-Ep.lastCenter.y;Ep.lastCenter=e;const i=Yu(Array.from(Ep.pointers.values())),o="freedraw"===this.state.elementType&&this.state.penMode?1:i/Ep.initialDistance,a=o?il(t*o):this.state.zoom.value;this.setState((t=>{const i=ol({viewportX:e.x,viewportY:e.y,nextZoom:a},t);return{zoom:i.zoom,scrollX:i.scrollX+n/a,scrollY:i.scrollY+r/a,shouldCacheIgnoreZoom:!0}})),this.resetShouldCacheIgnoreZoomDebounced()}else Ep.lastCenter=Ep.initialDistance=Ep.initialScale=null;if(vp||xp||yp)return;const n=Ml(wp,e.clientX-this.state.offsetLeft,e.clientY-this.state.offsetTop).isOverEither;this.state.draggingElement||this.state.multiElement||(n?Vt(this.canvas):Yt(this.canvas,this.state.elementType));const r=qt(e,this.state),{x:i,y:a}=r;if(this.state.editingLinearElement&&!this.state.editingLinearElement.isDragging){const t=xo.handlePointerMove(e,i,a,this.state.editingLinearElement,this.state.gridSize);t!==this.state.editingLinearElement&&this.setState({editingLinearElement:t}),null!=t.lastUncommittedPoint?this.maybeSuggestBindingAtCursor(r):this.setState({suggestedBindings:[]})}if(Me(this.state.elementType)){const{draggingElement:e}=this.state;Te(e)?this.maybeSuggestBindingsForLinearElementAtCoords(e,[r],this.state.startBoundElement):this.maybeSuggestBindingAtCursor(r)}if(this.state.multiElement){const{multiElement:e}=this.state,{x:t,y:n}=e,{points:r,lastCommittedPoint:s}=e,l=r[r.length-1];return Yt(this.canvas,this.state.elementType),void(l===s?He(i-t,a-n,l[0],l[1])>=o.qx?Ar(e,{points:[...r,[i-t,a-n]]}):Gt(this.canvas,o.oc.POINTER):r.length>2&&s&&He(i-t,a-n,s[0],s[1])<o.qx?(Gt(this.canvas,o.oc.POINTER),Ar(e,{points:r.slice(0,-1)})):(Ne(r,this.state.zoom.value)&&Gt(this.canvas,o.oc.POINTER),Ar(e,{points:[...r.slice(0,-1),[i-t,a-n]]})))}if(Boolean(e.buttons)||"selection"!==this.state.elementType&&"text"!==this.state.elementType&&"eraser"!==this.state.elementType)return;const s=this.scene.getElements(),l=Al(s,this.state);if(1!==l.length||n||this.state.editingLinearElement){if(l.length>1&&!n){const t=fo(et(l),i,a,this.state.zoom,e.pointerType);if(t)return void Gt(this.canvas,vo({transformHandleType:t}))}}else{const t=mo(s,this.state,i,a,this.state.zoom,e.pointerType);if(t&&t.transformHandleType)return void Gt(this.canvas,vo(t))}const c=this.getElementAtPosition(r.x,r.y);if(this.hitLinkElement=this.getElementLinkAtPosition(r,c),this.hitLinkElement&&!this.state.selectedElementIds[this.hitLinkElement.id])Gt(this.canvas,o.oc.POINTER),d=this.hitLinkElement,u=this.state,bc&&clearTimeout(bc),bc=window.setTimeout((()=>vc(d,u)),o.sA);else if(bc&&clearTimeout(bc),lc&&(lc=!1,al().classList.remove("excalidraw-tooltip--visible")),c&&c.link&&this.state.selectedElementIds[c.id]&&!this.contextMenuOpen&&!this.state.showHyperlinkPopup)this.setState({showHyperlinkPopup:"info"});else if(vn(this.state))Gt(this.canvas,o.oc.AUTO);else if("text"===this.state.elementType)Gt(this.canvas,Ce(c)?o.oc.TEXT:o.oc.CROSSHAIR);else if(this.state.viewModeEnabled)Gt(this.canvas,o.oc.GRAB);else if(n)Gt(this.canvas,o.oc.AUTO);else if(this.state.editingLinearElement){const e=xo.getElement(this.state.editingLinearElement.elementId);e&&Di(e,this.state,[r.x,r.y])?Gt(this.canvas,o.oc.MOVE):Gt(this.canvas,o.oc.AUTO)}else e[Lt.CTRL_OR_CMD]||!c&&!this.isHittingCommonBoundingBoxOfSelectedElements(r,l)?Gt(this.canvas,o.oc.AUTO):Gt(this.canvas,o.oc.MOVE);var d,u},this.handleEraser=(e,t,n)=>{const r=n=>{n.forEach((n=>{i.push(n.id),e.altKey?t.elementIdsToErase[n.id]&&(t.elementIdsToErase[n.id]=!1):t.elementIdsToErase[n.id]=!0}))},i=[],o=He(t.lastCoords.x,t.lastCoords.y,n.x,n.y),a=10/this.state.zoom.value,s=Object.assign({},t.lastCoords);let l=0;for(;l<=o;){if(r(this.getElementsAtPosition(s.x,s.y)),l===o)break;l=Math.min(l+a,o);const e=l/o,t=(1-e)*s.x+e*n.x,i=(1-e)*s.y+e*n.y;s.x=t,s.y=i}const c=this.scene.getElements().map((n=>{const r=Pe(n)&&i.includes(n.containerId)?n.containerId:n.id;if(i.includes(r)){if(!e.altKey)return Pr(n,{opacity:20});if(!1===t.elementIdsToErase[r])return Pr(n,{opacity:this.state.currentItemOpacity})}return n}));this.scene.replaceAllElements(c),t.lastCoords.x=n.x,t.lastCoords.y=n.y},this.handleTouchMove=e=>{_p=!0},this.handleCanvasPointerDown=e=>{const t=document.getSelection();if(null!=t&&t.anchorNode&&t.removeAllRanges(),this.maybeOpenContextMenuAfterPointerDownOnTouchDevices(e),this.maybeCleanupAfterMissingPointerUp(e),this.state.penDetected||"pen"!==e.pointerType||this.setState((e=>({penMode:!0,penDetected:!0}))),xp)return;if(this.lastPointerDown=e,this.setState({lastPointerDownWith:e.pointerType,cursorButton:"down"}),this.savePointer(e.clientX,e.clientY,"down"),this.handleCanvasPanUsingWheelOrSpaceDrag(e))return;if(e.button!==o.Oh.MAIN&&e.button!==o.Oh.TOUCH)return;if(this.updateGestureOnPointerDown(e),Ep.pointers.size>1)return;const n=this.initialPointerDownState(e);if(this.handleDraggingScrollBar(e,n))return;if(this.contextMenuOpen=!1,this.clearSelectionIfNotUsingSelection(),this.updateBindingEnabledOnPointerMove(e),this.handleSelectionOnPointerDown(e,n))return;if(!(!this.state.penMode||"touch"!==e.pointerType||"selection"===this.state.elementType||"text"===this.state.elementType||"image"===this.state.elementType))return;if("text"===this.state.elementType)return void this.handleTextOnPointerDown(e,n);if("arrow"===this.state.elementType||"line"===this.state.elementType)this.handleLinearElementOnPointerDown(e,this.state.elementType,n);else if("image"===this.state.elementType){if(Gt(this.canvas,o.oc.CROSSHAIR),!this.state.pendingImageElement)return;this.setState({draggingElement:this.state.pendingImageElement,editingElement:this.state.pendingImageElement,pendingImageElement:null,multiElement:null});const{x:t,y:n}=qt(e,this.state);Ar(this.state.pendingImageElement,{x:t,y:n})}else"freedraw"===this.state.elementType?this.handleFreeDrawElementOnPointerDown(e,this.state.elementType,n):"eraser"!==this.state.elementType&&this.createGenericElementOnPointerDown(this.state.elementType,n);const r=this.onPointerMoveFromPointerDownHandler(n),i=this.onPointerUpFromPointerDownHandler(n),a=this.onKeyDownFromPointerDownHandler(n),s=this.onKeyUpFromPointerDownHandler(n);Cp=i,this.state.viewModeEnabled||(window.addEventListener(o.Ks.POINTER_MOVE,r),window.addEventListener(o.Ks.POINTER_UP,i),window.addEventListener(o.Ks.KEYDOWN,a),window.addEventListener(o.Ks.KEYUP,s),n.eventListeners.onMove=r,n.eventListeners.onUp=i,n.eventListeners.onKeyUp=s,n.eventListeners.onKeyDown=a)},this.handleCanvasPointerUp=e=>{this.lastPointerUp=e;const t=["pen","touch"].includes(e.pointerType);if(t){const t=qt({clientX:e.clientX,clientY:e.clientY},this.state),n=this.getElementAtPosition(t.x,t.y);this.hitLinkElement=this.getElementLinkAtPosition(t,n)}if(vn(this.state)){if(0===He(this.lastPointerDown.clientX,this.lastPointerDown.clientY,this.lastPointerUp.clientX,this.lastPointerUp.clientY)){const t=qt({clientX:e.clientX,clientY:e.clientY},this.state),n=this.getElementAtPosition(t.x,t.y),r=this.initialPointerDownState(e);r.hit.element=n,this.eraseElements(r)}}this.hitLinkElement&&!this.state.selectedElementIds[this.hitLinkElement.id]&&this.redirectToLink(e,t),this.removePointer(e)},this.maybeOpenContextMenuAfterPointerDownOnTouchDevices=e=>{"touch"===e.pointerType&&(_p=!1,kp?_p=!0:kp=window.setTimeout((()=>{kp=0,_p||this.handleCanvasContextMenu(e)}),o.nM))},this.resetContextMenuTimer=()=>{clearTimeout(kp),kp=0,_p=!1},this.handleCanvasPanUsingWheelOrSpaceDrag=e=>{if(0!==Ep.pointers.size||!(e.button===o.Oh.WHEEL||e.button===o.Oh.MAIN&&vp||this.state.viewModeEnabled)||Ce(this.state.editingElement))return!1;xp=!0,e.preventDefault();let t=!1;const n=/Linux/.test(window.navigator.platform);Gt(this.canvas,o.oc.GRABBING);let{clientX:r,clientY:i}=e;const a=an((e=>{const a=r-e.clientX,s=i-e.clientY;if(r=e.clientX,i=e.clientY,n&&!t&&(Math.abs(a)>1||Math.abs(s)>1)){t=!0;const e=t=>{document.body.removeEventListener(o.Ks.PASTE,e),t.stopPropagation()},n=()=>{setTimeout((()=>{document.body.removeEventListener(o.Ks.PASTE,e),window.removeEventListener(o.Ks.POINTER_UP,n)}),100)};document.body.addEventListener(o.Ks.PASTE,e),window.addEventListener(o.Ks.POINTER_UP,n)}this.setState({scrollX:this.state.scrollX-a/this.state.zoom.value,scrollY:this.state.scrollY-s/this.state.zoom.value})})),s=on(Cp=()=>{Cp=null,xp=!1,vp||(this.state.viewModeEnabled?Gt(this.canvas,o.oc.GRAB):Yt(this.canvas,this.state.elementType)),this.setState({cursorButton:"up"}),this.savePointer(e.clientX,e.clientY,"up"),window.removeEventListener(o.Ks.POINTER_MOVE,a),window.removeEventListener(o.Ks.POINTER_UP,s),window.removeEventListener(o.Ks.BLUR,s),a.flush()});return window.addEventListener(o.Ks.BLUR,s),window.addEventListener(o.Ks.POINTER_MOVE,a,{passive:!0}),window.addEventListener(o.Ks.POINTER_UP,s),!0},this.clearSelectionIfNotUsingSelection=()=>{"selection"!==this.state.elementType&&this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})},this.handleSelectionOnPointerDown=(e,t)=>{if("selection"===this.state.elementType){const r=this.scene.getElements(),i=Al(r,this.state);if(1!==i.length||this.state.editingLinearElement)i.length>1&&(t.resize.handleType=fo(et(i),t.origin.x,t.origin.y,this.state.zoom,e.pointerType));else{const n=mo(r,this.state,t.origin.x,t.origin.y,this.state.zoom,e.pointerType);null!=n&&(this.setState({resizingElement:n.element}),t.resize.handleType=n.transformHandleType)}if(t.resize.handleType)Gt(this.canvas,vo({transformHandleType:t.resize.handleType})),t.resize.isResizing=!0,t.resize.offset=tn(((e,t,n,r)=>{const[i,o,a,s]=1===t.length?Ye(t[0]):et(t),l=(i+a)/2,c=(o+s)/2,d=1===t.length?t[0].angle:0;switch([n,r]=De(n,r,l,c,-d),e){case"n":return De(n-(i+a)/2,r-o,0,0,d);case"s":return De(n-(i+a)/2,r-s,0,0,d);case"w":return De(n-i,r-(o+s)/2,0,0,d);case"e":return De(n-a,r-(o+s)/2,0,0,d);case"nw":return De(n-i,r-o,0,0,d);case"ne":return De(n-a,r-o,0,0,d);case"sw":return De(n-i,r-s,0,0,d);case"se":return De(n-a,r-s,0,0,d);default:return[0,0]}})(t.resize.handleType,i,t.origin.x,t.origin.y)),1===i.length&&je(i[0])&&2===i[0].points.length&&(t.resize.arrowDirection=((e,t)=>{const[,[n,r]]=t.points;return"nw"===e&&(n<0||r<0)||"ne"===e&&n>=0||"sw"===e&&n<=0||"se"===e&&(n>0||r>0)?"end":"origin"})(t.resize.handleType,i[0]));else{var n;if(this.state.editingLinearElement){const n=xo.handlePointerDown(e,this.state,(e=>this.setState(e)),this.history,t.origin);if(n.hitElement&&(t.hit.element=n.hitElement),n.didAddPoint)return!0}if(t.hit.element=null!==(n=t.hit.element)&&void 0!==n?n:this.getElementAtPosition(t.origin.x,t.origin.y),t.hit.element){if(fc(t.hit.element,this.state,[t.origin.x,t.origin.y],this.isMobile))return!1;t.hit.hasHitElementInside=Di(t.hit.element,this.state,[t.origin.x,t.origin.y])}t.hit.allHitElements=this.getElementsAtPosition(t.origin.x,t.origin.y);const r=t.hit.element,i=t.hit.allHitElements.some((e=>this.isASelectedElement(e)));if(null!==r&&i||e.shiftKey||t.hit.hasHitCommonBoundingBoxOfSelectedElements||this.clearSelection(r),this.state.editingLinearElement)this.setState({selectedElementIds:{[this.state.editingLinearElement.elementId]:!0}});else if(null!=r){if(e[Lt.CTRL_OR_CMD])return this.state.selectedElementIds[r.id]||(t.hit.wasAddedToSelection=!0),this.setState((e=>{return Object.assign(Object.assign({},(t=e,n=r,Object.assign(Object.assign({},t),{editingGroupId:n.groupIds.length?n.groupIds[0]:null,selectedGroupIds:{},selectedElementIds:{[n.id]:!0}}))),{previousSelectedElementIds:this.state.selectedElementIds});var t,n})),!1;this.state.selectedElementIds[r.id]||(this.state.editingGroupId&&!Kr(r,this.state.editingGroupId)&&this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}),i||t.hit.hasHitCommonBoundingBoxOfSelectedElements||(this.setState((e=>Wr(Object.assign(Object.assign({},e),{selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[r.id]:!0}),showHyperlinkPopup:!!r.link&&"info"}),this.scene.getElements()))),t.hit.wasAddedToSelection=!0))}this.setState({previousSelectedElementIds:this.state.selectedElementIds})}}return!1},this.handleTextOnPointerDown=(e,t)=>{if(Ce(this.state.editingElement))return;let n=t.origin.x,r=t.origin.y;const i=this.getElementAtPosition(n,r,{includeBoundTextElement:!0});Ae(i)&&(n=i.x+i.width/2,r=i.y+i.height/2),this.startTextEditing({sceneX:n,sceneY:r,shouldBind:!1,insertAtParentCenter:!e.altKey}),Vt(this.canvas),this.state.elementLocked||this.setState({elementType:"selection"})},this.handleFreeDrawElementOnPointerDown=(e,t,n)=>{const[r,i]=Ke(n.origin.x,n.origin.y,null),o=(a={type:t,x:r,y:i,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.currentItemLinearStrokeSharpness,simulatePressure:.5===e.pressure},Object.assign(Object.assign({},Zr(a.type,a)),{points:a.points||[],pressures:[],simulatePressure:a.simulatePressure,lastCommittedPoint:null}));var a;this.setState((e=>({selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[o.id]:!1})})));const s=o.simulatePressure?o.pressures:[...o.pressures,e.pressure];Ar(o,{points:[[0,0]],pressures:s});const l=Lo(n.origin,this.scene);this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),o]),this.setState({draggingElement:o,editingElement:o,startBoundElement:l,suggestedBindings:[]})},this.createImageElement=e=>{let{sceneX:t,sceneY:n}=e;const[r,i]=Ke(t,n,this.state.gridSize);var o;return o={type:"image",x:r,y:i,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.currentItemLinearStrokeSharpness},Object.assign(Object.assign({},Zr("image",o)),{strokeColor:"transparent",status:"pending",fileId:null,scale:[1,1]})},this.handleLinearElementOnPointerDown=(e,t,n)=>{if(this.state.multiElement){const{multiElement:e}=this.state;if("line"===e.type&&Ne(e.points,this.state.zoom.value))return Ar(e,{lastCommittedPoint:e.points[e.points.length-1]}),void this.actionManager.executeAction(ec);const{x:t,y:r,lastCommittedPoint:i}=e;if(e.points.length>1&&i&&He(n.origin.x-t,n.origin.y-r,i[0],i[1])<o.qx)return void this.actionManager.executeAction(ec);this.setState((t=>({selectedElementIds:Object.assign(Object.assign({},t.selectedElementIds),{[e.id]:!0})}))),Ar(e,{lastCommittedPoint:e.points[e.points.length-1]}),Gt(this.canvas,o.oc.POINTER)}else{const[e,r]=Ke(n.origin.x,n.origin.y,this.state.gridSize),{currentItemStartArrowhead:i,currentItemEndArrowhead:o}=this.state,[a,s]="arrow"===t?[i,o]:[null,null],l=ei({type:t,x:e,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.currentItemLinearStrokeSharpness,startArrowhead:a,endArrowhead:s});this.setState((e=>({selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[l.id]:!1})}))),Ar(l,{points:[...l.points,[0,0]]});const c=Lo(n.origin,this.scene);this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),l]),this.setState({draggingElement:l,editingElement:l,startBoundElement:c,suggestedBindings:[]})}},this.createGenericElementOnPointerDown=(e,t)=>{const[n,r]=Ke(t.origin.x,t.origin.y,this.state.gridSize),i=qr({type:e,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});"selection"===i.type?this.setState({selectionElement:i,draggingElement:i}):(this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),i]),this.setState({multiElement:null,draggingElement:i,editingElement:i}))},this.eraseElements=e=>{const t=e.hit.element,n=this.scene.getElements().map((n=>e.elementIdsToErase[n.id]||t&&n.id===t.id||Pe(n)&&(e.elementIdsToErase[n.containerId]||t&&n.containerId===t.id)?Pr(n,{isDeleted:!0}):n));this.history.resumeRecording(),this.scene.replaceAllElements(n)},this.initializeImage=async e=>{var t,n,r;let{imageFile:i,imageElement:a,showCursorImagePreview:s=!1}=e;if(!fd(i))throw new Error(b("errors.unsupportedFileType"));const l=i.type;if(Gt(this.canvas,"wait"),l===o.LO.svg)try{i=_d(await(async e=>{const t=(new DOMParser).parseFromString(e,o.LO.svg),n=t.querySelector("svg");if(t.querySelector("parsererror")||"svg"!==(null==(r=n)?void 0:r.nodeName.toLowerCase()))throw new Error(b("errors.invalidSVGString"));return n.hasAttribute("xmlns")||n.setAttribute("xmlns",o.hR),n.outerHTML;var r})(await i.text()),i.name)}catch(e){throw console.warn(e),new Error(b("errors.svgImageInsertError"))}const c=await((null===(t=(n=this.props).generateIdForFile)||void 0===t?void 0:t.call(n,i))||yd(i));if(!c)throw console.warn("Couldn't generate file id or the supplied `generateIdForFile` didn't resolve to one."),new Error(b("errors.imageInsertError"));const d=this.files[c];if(null==d||!d.dataURL){try{i=await kd(i,{maxWidthOrHeight:o.h6})}catch(e){console.error("error trying to resing image file on insertion",e)}if(i.size>o.$n)throw new Error(b("errors.fileTooBig",{maxSize:"".concat(Math.trunc(o.$n/1024/1024),"MB")}))}if(s){var u;const e=null===(u=this.files[c])||void 0===u?void 0:u.dataURL,t=e&&function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=e.indexOf(","),r=atob(e.slice(n+1)),i=e.slice(0,n).split(":")[1].split(";")[0],o=new ArrayBuffer(r.length),a=new Uint8Array(o);for(let e=0;e<r.length;e++)a[e]=r.charCodeAt(e);return new File([o],t,{type:i})}(e);this.setImagePreviewCursor(t||i)}const h=(null===(r=this.files[c])||void 0===r?void 0:r.dataURL)||await wd(i),p=Ar(a,{fileId:c},!1);return new Promise((async(e,t)=>{try{var n,r;this.files=Object.assign(Object.assign({},this.files),{[c]:{mimeType:l,id:c,dataURL:h,created:Date.now()}});const t=this.imageCache.get(c);t||(this.addNewImagesToImageCache(),await this.updateImageCache([p])),(null==t?void 0:t.image)instanceof Promise&&await t.image,(null===(n=this.state.pendingImageElement)||void 0===n?void 0:n.id)!==p.id&&(null===(r=this.state.draggingElement)||void 0===r?void 0:r.id)!==p.id&&this.initializeImageDimensions(p,!0),e(p)}catch(e){console.error(e),t(new Error(b("errors.imageInsertError")))}finally{s||Vt(this.canvas)}}))},this.insertImageElement=async(e,t,n)=>{this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),e]);try{await this.initializeImage({imageFile:t,imageElement:e,showCursorImagePreview:n})}catch(t){Ar(e,{isDeleted:!0}),this.actionManager.executeAction(ec),this.setState({errorMessage:t.message||b("errors.imageInsertError")})}},this.setImagePreviewCursor=async e=>{const t=await kd(e,{maxWidthOrHeight:96});let n=await wd(t);if(e.type===o.LO.svg){const e=await Id(n);let t=Math.min(e.height,96),r=t*(e.width/e.height);r>96&&(r=96,t=r*(e.height/e.width));const i=document.createElement("canvas");i.height=t,i.width=r;i.getContext("2d").drawImage(e,0,0,r,t),n=i.toDataURL(o.LO.svg)}this.state.pendingImageElement&&Gt(this.canvas,"url(".concat(n,") 4 4, auto"))},this.onImageAction=async function(){let{insertOnCanvasDirectly:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{insertOnCanvasDirectly:!1};try{const n=e.state.width/2+e.state.offsetLeft,r=e.state.height/2+e.state.offsetTop,{x:i,y:o}=qt({clientX:n,clientY:r},e.state),a=await id({description:"Image",extensions:["jpg","png","svg","gif"]}),s=e.createImageElement({sceneX:i,sceneY:o});t?(e.insertImageElement(s,a),e.initializeImageDimensions(s),e.setState({selectedElementIds:{[s.id]:!0}},(()=>{e.actionManager.executeAction(ec)}))):e.setState({pendingImageElement:s},(()=>{e.insertImageElement(s,a,!0)}))}catch(t){"AbortError"!==t.name?console.error(t):console.warn(t),e.setState({pendingImageElement:null,editingElement:null,elementType:"selection"},(()=>{e.actionManager.executeAction(ec)}))}},this.initializeImageDimensions=function(t){var n;let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=ke(t)&&(null===(n=e.imageCache.get(t.fileId))||void 0===n?void 0:n.image);if(!i||i instanceof Promise){if(t.width<o.f/e.state.zoom.value&&t.height<o.f/e.state.zoom.value){const n=100/e.state.zoom.value;Ar(t,{x:t.x-n/2,y:t.y-n/2,width:n,height:n})}}else if(r||t.width<o.f/e.state.zoom.value&&t.height<o.f/e.state.zoom.value){const n=Math.max(e.state.height-120,160),r=Math.min(n,Math.floor(.5*e.state.height)/e.state.zoom.value),o=Math.min(i.naturalHeight,r),a=o*(i.naturalWidth/i.naturalHeight),s=t.x+t.width/2-a/2,l=t.y+t.height/2-o/2;Ar(t,{x:s,y:l,width:a,height:o})}},this.updateImageCache=async function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.files;const{updatedFiles:r,erroredFiles:i}=await Td({imageCache:e.imageCache,fileIds:t.map((e=>e.fileId)),files:n});if(r.size||i.size)for(const e of t)r.has(e.fileId)&&fr(e);return i.size&&e.scene.replaceAllElements(e.scene.getElementsIncludingDeleted().map((e=>ke(e)&&i.has(e.fileId)?Pr(e,{status:"error"}):e))),{updatedFiles:r,erroredFiles:i}},this.addNewImagesToImageCache=async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Md(e.scene.getElements()),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.files;const r=t.filter((t=>!t.isDeleted&&!e.imageCache.has(t.fileId)));if(r.length){const{updatedFiles:t}=await e.updateImageCache(r,n);t.size&&e.scene.informMutation()}},this.scheduleImageRefresh=cp()((()=>{this.addNewImagesToImageCache()}),o.LL),this.updateBindingEnabledOnPointerMove=e=>{const t=(e=>!e[Lt.CTRL_OR_CMD])(e);this.state.isBindingEnabled!==t&&this.setState({isBindingEnabled:t})},this.maybeSuggestBindingAtCursor=e=>{const t=Lo(e,this.scene);this.setState({suggestedBindings:null!=t?[t]:[]})},this.maybeSuggestBindingsForLinearElementAtCoords=(e,t,n)=>{if(!t.length)return;const r=t.reduce(((t,r)=>{const i=Lo(r,this.scene);return null==i||To(e,null==n?void 0:n.id,i)||t.push(i),t}),[]);this.setState({suggestedBindings:r})},this.handleCanvasRef=e=>{var t,n,r;null!==e?(this.canvas=e,this.rc=ve.canvas(this.canvas),this.canvas.addEventListener(o.Ks.WHEEL,this.handleWheel,{passive:!1}),this.canvas.addEventListener(o.Ks.TOUCH_START,this.onTapStart),this.canvas.addEventListener(o.Ks.TOUCH_END,this.onTapEnd)):(null===(t=this.canvas)||void 0===t||t.removeEventListener(o.Ks.WHEEL,this.handleWheel),null===(n=this.canvas)||void 0===n||n.removeEventListener(o.Ks.TOUCH_START,this.onTapStart),null===(r=this.canvas)||void 0===r||r.removeEventListener(o.Ks.TOUCH_END,this.onTapEnd))},this.handleAppOnDrop=async e=>{var t,n;try{const t=e.dataTransfer.files.item(0);if(fd(t)){if((null==t?void 0:t.type)===o.LO.png||(null==t?void 0:t.type)===o.LO.svg)try{if(td)try{const n=e.dataTransfer.items[0];t.handle=await n.getAsFileSystemHandle()}catch(e){console.warn(e.name,e.message)}const n=await bd(t,this.state,this.scene.getElementsIncludingDeleted());return void this.syncActionResult(Object.assign(Object.assign({},n),{appState:Object.assign(Object.assign({},n.appState||this.state),{isLoading:!1}),replaceFiles:!0,commitToHistory:!0}))}catch(e){if("EncodingError"!==e.name)throw e}const{x:n,y:r}=qt(e,this.state),i=this.createImageElement({sceneX:n,sceneY:r});return this.insertImageElement(i,t),this.initializeImageDimensions(i),void this.setState({selectedElementIds:{[i.id]:!0}})}}catch(e){return this.setState({isLoading:!1,errorMessage:e.message})}const r=e.dataTransfer.getData(o.LO.excalidrawlib);if(""!==r)return void this.addElementsFromPasteOrLibrary({elements:JSON.parse(r),position:e,files:null});const i=null===(t=e.dataTransfer)||void 0===t?void 0:t.files.item(0);if((null==i?void 0:i.type)===o.LO.excalidrawlib||null!=i&&null!==(n=i.name)&&void 0!==n&&n.endsWith(".excalidrawlib"))this.library.importLibrary(i).then((()=>{this.setState({isLibraryOpen:!1}),this.setState({isLibraryOpen:!0})})).catch((e=>this.setState({isLoading:!1,errorMessage:e.message})));else if(i){if(this.setState({isLoading:!0}),td)try{const t=e.dataTransfer.items[0];i.handle=await t.getAsFileSystemHandle()}catch(e){console.warn(e.name,e.message)}await this.loadFileToCanvas(i)}},this.loadFileToCanvas=e=>{bd(e,this.state,this.scene.getElementsIncludingDeleted()).then((e=>{this.syncActionResult(Object.assign(Object.assign({},e),{appState:Object.assign(Object.assign({},e.appState||this.state),{isLoading:!1}),replaceFiles:!0,commitToHistory:!0}))})).catch((e=>{this.setState({isLoading:!1,errorMessage:e.message})}))},this.handleCanvasContextMenu=e=>{if(e.preventDefault(),("touch"===e.nativeEvent.pointerType||"pen"===e.nativeEvent.pointerType&&e.button!==o.Oh.SECONDARY)&&"selection"!==this.state.elementType)return;const{x:t,y:n}=qt(e,this.state),r=this.getElementAtPosition(t,n,{preferSelected:!0}),i=r?"element":"canvas",a=this.excalidrawContainerRef.current,{top:s,left:l}=a.getBoundingClientRect(),c=e.clientX-l,d=e.clientY-s;r&&!this.state.selectedElementIds[r.id]?this.setState({selectedElementIds:{[r.id]:!0}},(()=>{this._openContextMenu({top:d,left:c},i)})):this._openContextMenu({top:d,left:c},i)},this.maybeDragNewGenericElement=(e,t)=>{const n=this.state.draggingElement,r=e.lastCoords;if(n)if("selection"===n.type)ia(n,this.state.elementType,e.origin.x,e.origin.y,r.x,r.y,Kt(e.origin.x,r.x),Kt(e.origin.y,r.y),Dt(t),Pt(t));else{var i;const[o,a]=Ke(r.x,r.y,this.state.gridSize),s=ke(n)&&(null===(i=this.imageCache.get(n.fileId))||void 0===i?void 0:i.image),l=!s||s instanceof Promise?null:s.width/s.height;ia(n,this.state.elementType,e.originInGrid.x,e.originInGrid.y,o,a,Kt(e.originInGrid.x,o),Kt(e.originInGrid.y,a),_e(n)?!Dt(t):Dt(t),Pt(t),l),this.maybeSuggestBindingForAll([n])}},this.maybeHandleResize=(e,t)=>{const n=Al(this.scene.getElements(),this.state),r=e.resize.handleType;this.setState({isResizing:r&&"rotation"!==r,isRotating:"rotation"===r});const i=e.lastCoords,[o,a]=Ke(i.x-e.resize.offset.x,i.y-e.resize.offset.y,this.state.gridSize);return!!((e,t,n,r,i,o,a,s,l,c,d)=>{if(1===n.length){const[c]=n;return"rotation"===t?(Zo(c,s,l,i),Po(c)):!je(c)||2!==c.points.length||"nw"!==t&&"ne"!==t&&"sw"!==t&&"se"!==t?!Ce(c)||"nw"!==t&&"ne"!==t&&"sw"!==t&&"se"!==t?t&&ea(e.originalElements,a,c,t,o,s,l):(Jo(c,t,o,s,l),Po(c)):qo(c,r,i,s,l),!0}if(n.length>1){if("rotation"===t)return na(e,n,s,l,i,c,d),!0;if("nw"===t||"ne"===t||"sw"===t||"se"===t)return ta(n,t,s,l),!0}return!1})(e,r,n,e.resize.arrowDirection,zt(t),Pt(t),1===n.length&&_e(n[0])?!Dt(t):Dt(t),o,a,e.resize.center.x,e.resize.center.y)&&(this.maybeSuggestBindingForAll(n),!0)},this._openContextMenu=(e,t)=>{let{left:n,top:r}=e;this.state.showHyperlinkPopup&&this.setState({showHyperlinkPopup:!1}),this.contextMenuOpen=!0;const i=xu.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),o=yu.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),a=Iu.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),s=Tu.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),l="separator",c=this.scene.getElements(),d=[];if(tu&&c.length>0&&d.push(Ru),eu&&c.length>0&&d.push(zu),"canvas"===t){const e=[...d,void 0===this.props.gridModeEnabled&&Hu,void 0===this.props.zenModeEnabled&&Nu,void 0===this.props.viewModeEnabled&&sp,Bu];this.state.viewModeEnabled?nh.push({options:e,top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current,elements:c}):nh.push({options:[this.isMobile&&navigator.clipboard&&{name:"paste",perform:(e,t)=>(this.pasteFromClipboard(null),{commitToHistory:!1}),contextItemLabel:"labels.paste"},this.isMobile&&navigator.clipboard&&l,tu&&c.length>0&&Ru,eu&&c.length>0&&zu,(tu&&c.length>0||eu&&c.length>0)&&l,$l,l,void 0===this.props.gridModeEnabled&&Hu,void 0===this.props.zenModeEnabled&&Nu,void 0===this.props.viewModeEnabled&&sp,Bu],top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current,elements:c})}else if("element"===t){const e=Al(c,this.state).some((e=>!Ae(e)));this.state.viewModeEnabled?nh.push({options:[navigator.clipboard&&Pu,...d],top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current,elements:c}):nh.push({options:[this.isMobile&&Du,this.isMobile&&navigator.clipboard&&Pu,this.isMobile&&navigator.clipboard&&{name:"paste",perform:(e,t)=>(this.pasteFromClipboard(null),{commitToHistory:!1}),contextItemLabel:"labels.paste"},this.isMobile&&l,...d,l,mu,fu,l,i&&xu,!e&&Fu,o&&yu,(i||o)&&l,ku,l,Yl,Xl,Zl,ql,l,a&&Iu,s&&Tu,(a||s)&&l,pc.contextItemPredicate(c,this.state)&&pc,Ql,zl],top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current,elements:c})}},this.handleWheel=on((e=>{if(e.preventDefault(),xp)return;const{deltaX:t,deltaY:n}=e,{selectedElementIds:r,previousSelectedElementIds:i}=this.state;if(e.metaKey||e.ctrlKey){const e=Math.sign(n),t=10;let a=Math.abs(n);a>t&&(a=t),a*=e,0!==Object.keys(i).length&&setTimeout((()=>{this.setState({selectedElementIds:i,previousSelectedElementIds:{}})}),1e3);let s=this.state.zoom.value-a/100;return s+=Math.log10(Math.max(1,this.state.zoom.value))*-e,s=Math.round(s*o.V4*100)/(100*o.V4),this.setState((e=>Object.assign(Object.assign({},ol({viewportX:fp,viewportY:bp,nextZoom:il(s)},e)),{selectedElementIds:{},previousSelectedElementIds:0!==Object.keys(r).length?r:i,shouldCacheIgnoreZoom:!0}))),void this.resetShouldCacheIgnoreZoomDebounced()}e.shiftKey?this.setState((e=>{let{zoom:r,scrollX:i}=e;return{scrollX:i-(n||t)/r.value}})):this.setState((e=>{let{zoom:r,scrollX:i,scrollY:o}=e;return{scrollX:i-t/r.value,scrollY:o-n/r.value}}))})),this.savePointer=(e,t,n)=>{var r,i;if(!e||!t)return;const o=qt({clientX:e,clientY:t},this.state);isNaN(o.x)||isNaN(o.y),null===(r=(i=this.props).onPointerUpdate)||void 0===r||r.call(i,{pointer:o,button:n,pointersMap:Ep.pointers})},this.resetShouldCacheIgnoreZoomDebounced=Wt((()=>{this.unmounted||this.setState({shouldCacheIgnoreZoom:!1})}),300),this.updateDOMRect=e=>{var t;if(null!==(t=this.excalidrawContainerRef)&&void 0!==t&&t.current){const t=this.excalidrawContainerRef.current,{width:n,height:r,left:i,top:o}=t.getBoundingClientRect(),{width:a,height:s,offsetTop:l,offsetLeft:c}=this.state;if(n===a&&r===s&&i===c&&o===l)return void(e&&e());this.setState({width:n,height:r,offsetLeft:i,offsetTop:o},(()=>{e&&e()}))}},this.refresh=()=>{this.setState(Object.assign({},this.getCanvasOffsets()))}};"production"!==o.Vi.TEST&&"production"!==o.Vi.DEVELOPMENT||(window.h=window.h||{},Object.defineProperties(window.h,{elements:{configurable:!0,get(){return this.app.scene.getElementsIncludingDeleted()},set(e){return this.app.scene.replaceAllElements(e)}}}));const Ip=Sp;n(4285),n(3313);var Tp=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};const Mp=e=>{var t;const{onHomeButtonClick:n,onChange:i,initialData:a,excalidrawRef:s,onCollabButtonClick:l,isCollaborating:d=!1,onPointerUpdate:u,renderTopRightUI:h,renderFooter:p,langCode:g=c.code,viewModeEnabled:m,zenModeEnabled:f,gridModeEnabled:b,libraryReturnUrl:x,theme:w,name:k,renderCustomStats:_,onPaste:C,detectScroll:E=!0,handleKeyboardGlobally:S=!1,onLibraryChange:j,autoFocus:I=!1,generateIdForFile:T,onLinkOpen:M,id:O}=e,L=null===(t=e.UIOptions)||void 0===t?void 0:t.canvasActions,A={canvasActions:!!L&&Object.assign(Object.assign({},o.cW.canvasActions),L)};var P;L&&"object"==typeof L.export&&(L.export.saveFileToDisk=(null===(P=L.export)||void 0===P?void 0:P.saveFileToDisk)||o.cW.canvasActions.export.saveFileToDisk);return(0,r.useEffect)((()=>{const e=e=>{"number"==typeof e.scale&&1!==e.scale&&e.preventDefault()};return document.addEventListener("touchmove",e,{passive:!1}),()=>{document.removeEventListener("touchmove",e)}}),[]),(0,v.jsx)(y,{langCode:g,children:(0,v.jsx)(Ip,{id:O,onHomeButtonClick:n,onChange:i,initialData:a,excalidrawRef:s,onCollabButtonClick:l,isCollaborating:d,onPointerUpdate:u,renderTopRightUI:h,renderFooter:p,langCode:g,viewModeEnabled:m,zenModeEnabled:f,gridModeEnabled:b,libraryReturnUrl:x,theme:w,name:k,renderCustomStats:_,UIOptions:A,onPaste:C,detectScroll:E,handleKeyboardGlobally:S,onLibraryChange:j,autoFocus:I,generateIdForFile:T,onLinkOpen:M})})},Op=(e,t)=>{const{initialData:n,UIOptions:r={}}=e,i=Tp(e,["initialData","UIOptions"]),{initialData:o,UIOptions:a={}}=t,s=Tp(t,["initialData","UIOptions"]),l=Object.keys(r),c=Object.keys(a);if(l.length!==c.length)return!1;const d=l.every((e=>{if("canvasActions"===e){Object.keys(r.canvasActions).every((e=>{var t,n,i,o;return null!=r&&r.canvasActions&&null!=a&&a.canvasActions?"export"===e&&null!=r&&null!==(t=r.canvasActions)&&void 0!==t&&t.export&&null!=a&&null!==(n=a.canvasActions)&&void 0!==n&&n.export?"function"==typeof r.canvasActions.export||"function"==typeof a.canvasActions.export?r.canvasActions.export===a.canvasActions.export:r.canvasActions.export.saveFileToDisk===a.canvasActions.export.saveFileToDisk:(null==r||null===(i=r.canvasActions)||void 0===i?void 0:i[e])===(null==a||null===(o=a.canvasActions)||void 0===o?void 0:o[e]):(null==r?void 0:r.canvasActions)===(null==a?void 0:a.canvasActions)}))}return!0})),u=Object.keys(e),h=Object.keys(t);return d&&u.length===h.length&&u.every((e=>i[e]===s[e]))},Lp=(0,r.forwardRef)(((e,t)=>(0,v.jsx)(Mp,Object.assign(Object.assign({},e),{excalidrawRef:t})))),Ap=i().memo(Lp,Op);n(8336);const Pp=Ap},9669:e=>{"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg=="},7984:e=>{"use strict";e.exports='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="292.4" height="292.4" viewBox="0 0 292 292"><path d="M287 197L159 69c-4-3-8-5-13-5s-9 2-13 5L5 197c-3 4-5 8-5 13s2 9 5 13c4 4 8 5 13 5h256c5 0 9-1 13-5s5-8 5-13-1-9-5-13z"/></svg>'},1639:e=>{"use strict";e.exports='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="292.4" height="292.4" viewBox="0 0 292 292"><path fill="%23ced4da" d="M287 197L159 69c-4-3-8-5-13-5s-9 2-13 5L5 197c-3 4-5 8-5 13s2 9 5 13c4 4 8 5 13 5h256c5 0 9-1 13-5s5-8 5-13-1-9-5-13z"/></svg>'},3147:(e,t,n)=>{"use strict";e.exports=n.p+"excalidraw-assets/Cascadia.woff2"},3940:(e,t,n)=>{"use strict";e.exports=n.p+"excalidraw-assets/Virgil.woff2"},9787:t=>{"use strict";t.exports=e},5156:e=>{"use strict";e.exports=t},1463:e=>{"use strict";e.exports=JSON.parse('{"labels":{"paste":"Paste","pasteCharts":"Paste charts","selectAll":"Select all","multiSelect":"Add element to selection","moveCanvas":"Move canvas","cut":"Cut","copy":"Copy","copyAsPng":"Copy to clipboard as PNG","copyAsSvg":"Copy to clipboard as SVG","bringForward":"Bring forward","sendToBack":"Send to back","bringToFront":"Bring to front","sendBackward":"Send backward","delete":"Delete","copyStyles":"Copy styles","pasteStyles":"Paste styles","stroke":"Stroke","background":"Background","fill":"Fill","strokeWidth":"Stroke width","strokeStyle":"Stroke style","strokeStyle_solid":"Solid","strokeStyle_dashed":"Dashed","strokeStyle_dotted":"Dotted","sloppiness":"Sloppiness","opacity":"Opacity","textAlign":"Text align","edges":"Edges","sharp":"Sharp","round":"Round","arrowheads":"Arrowheads","arrowhead_none":"None","arrowhead_arrow":"Arrow","arrowhead_bar":"Bar","arrowhead_dot":"Dot","arrowhead_triangle":"Triangle","fontSize":"Font size","fontFamily":"Font family","onlySelected":"Only selected","withBackground":"Background","exportEmbedScene":"Embed scene","exportEmbedScene_details":"Scene data will be saved into the exported PNG/SVG file so that the scene can be restored from it.\\nWill increase exported file size.","addWatermark":"Add \\"Made with Excalidraw\\"","handDrawn":"Hand-drawn","normal":"Normal","code":"Code","small":"Small","medium":"Medium","large":"Large","veryLarge":"Very large","solid":"Solid","hachure":"Hachure","crossHatch":"Cross-hatch","thin":"Thin","bold":"Bold","left":"Left","center":"Center","right":"Right","extraBold":"Extra bold","architect":"Architect","artist":"Artist","cartoonist":"Cartoonist","fileTitle":"File name","colorPicker":"Color picker","canvasColors":"Used on canvas","canvasBackground":"Canvas background","drawingCanvas":"Drawing canvas","layers":"Layers","actions":"Actions","language":"Language","liveCollaboration":"Live collaboration","duplicateSelection":"Duplicate","untitled":"Untitled","name":"Name","yourName":"Your name","madeWithExcalidraw":"Made with Excalidraw","group":"Group selection","ungroup":"Ungroup selection","collaborators":"Collaborators","showGrid":"Show grid","addToLibrary":"Add to library","removeFromLibrary":"Remove from library","libraryLoadingMessage":"Loading library…","libraries":"Browse libraries","loadingScene":"Loading scene…","align":"Align","alignTop":"Align top","alignBottom":"Align bottom","alignLeft":"Align left","alignRight":"Align right","centerVertically":"Center vertically","centerHorizontally":"Center horizontally","distributeHorizontally":"Distribute horizontally","distributeVertically":"Distribute vertically","flipHorizontal":"Flip horizontal","flipVertical":"Flip vertical","viewMode":"View mode","toggleExportColorScheme":"Toggle export color scheme","share":"Share","showStroke":"Show stroke color picker","showBackground":"Show background color picker","toggleTheme":"Toggle theme","personalLib":"Personal Library","excalidrawLib":"Excalidraw Library","decreaseFontSize":"Decrease font size","increaseFontSize":"Increase font size","unbindText":"Unbind text","link":{"edit":"Edit link","create":"Create link","label":"Link"}},"buttons":{"clearReset":"Reset the canvas","exportJSON":"Export to file","exportImage":"Save as image","export":"Export","exportToPng":"Export to PNG","exportToSvg":"Export to SVG","copyToClipboard":"Copy to clipboard","copyPngToClipboard":"Copy PNG to clipboard","scale":"Scale","save":"Save (to active file)","saveAs":"Save as","load":"Load","getShareableLink":"Get shareable link","close":"Close","selectLanguage":"Select language","scrollBackToContent":"Scroll back to content","zoomIn":"Zoom in","zoomOut":"Zoom out","resetZoom":"Reset zoom","menu":"Menu","done":"Done","edit":"Edit","undo":"Undo","redo":"Redo","resetLibrary":"Reset library","roomDialog":"Sharing","createNewRoom":"Create new room","fullScreen":"Full screen","darkMode":"Dark mode","lightMode":"Light mode","zenMode":"Zen mode","exitZenMode":"Exit zen mode","cancel":"Cancel","clear":"Clear","remove":"Remove","publishLibrary":"Publish","submit":"Submit","confirm":"Confirm"},"alerts":{"clearReset":"This will clear the whole canvas. Are you sure?","couldNotCreateShareableLink":"Couldn\'t create shareable link.","couldNotCreateShareableLinkTooBig":"Couldn\'t create shareable link: the scene is too big","couldNotLoadInvalidFile":"Couldn\'t load invalid file","importBackendFailed":"Importing from backend failed.","cannotExportEmptyCanvas":"Cannot export empty canvas.","couldNotCopyToClipboard":"Couldn\'t copy to clipboard. Try using Chrome browser.","decryptFailed":"Couldn\'t decrypt data.","uploadedSecurly":"The upload has been secured with end-to-end encryption, which means that Excalidraw server and third parties can\'t read the content.","loadSceneOverridePrompt":"Loading external drawing will replace your existing content. Do you wish to continue?","collabStopOverridePrompt":"Stopping the session will overwrite your previous, locally stored drawing. Are you sure?\\n\\n(If you want to keep your local drawing, simply close the browser tab instead.)","errorLoadingLibrary":"There was an error loading the third party library.","errorAddingToLibrary":"Couldn\'t add item to the library","errorRemovingFromLibrary":"Couldn\'t remove item from the library","confirmAddLibrary":"This will add {{numShapes}} shape(s) to your library. Are you sure?","imageDoesNotContainScene":"This image does not seem to contain any scene data. Have you enabled scene embedding during export?","cannotRestoreFromImage":"Scene couldn\'t be restored from this image file","invalidSceneUrl":"Couldn\'t import scene from the supplied URL. It\'s either malformed, or doesn\'t contain valid Excalidraw JSON data.","resetLibrary":"This will clear your library. Are you sure?","removeItemsFromsLibrary":"Delete {{count}} item(s) from library?","invalidEncryptionKey":"Encryption key must be of 22 characters. Live collaboration is disabled."},"errors":{"unsupportedFileType":"Unsupported file type.","imageInsertError":"Couldn\'t insert image. Try again later...","fileTooBig":"File is too big. Maximum allowed size is {{maxSize}}.","svgImageInsertError":"Couldn\'t insert SVG image. The SVG markup looks invalid.","invalidSVGString":"Invalid SVG.","cannotResolveCollabServer":"Couldn\'t connect to the collab server. Please reload the page and try again."},"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","penMode":"Prevent pinch-zoom and accept freedraw input only from pen","link":"Add/ Update link for a selected shape","eraser":"Eraser"},"headings":{"canvasActions":"Canvas actions","selectedShapeActions":"Selected shape actions","shapes":"Shapes"},"hints":{"canvasPanning":"To move canvas, hold mouse wheel or spacebar while dragging","linearElement":"Click to start multiple points, drag for single line","freeDraw":"Click and drag, release when you\'re finished","text":"Tip: you can also add text by double-clicking anywhere with the selection tool","text_selected":"Double-click or press ENTER to edit text","text_editing":"Press Escape or CtrlOrCmd+ENTER to finish editing","linearElementMulti":"Click on last point or press Escape or Enter to finish","lockAngle":"You can constrain angle by holding SHIFT","resize":"You can constrain proportions by holding SHIFT while resizing,\\nhold ALT to resize from the center","resizeImage":"You can resize freely by holding SHIFT,\\nhold ALT to resize from the center","rotate":"You can constrain angles by holding SHIFT while rotating","lineEditor_info":"Double-click or press Enter to edit points","lineEditor_pointSelected":"Press Delete to remove point(s),\\nCtrlOrCmd+D to duplicate, or drag to move","lineEditor_nothingSelected":"Select a point to edit (hold SHIFT to select multiple),\\nor hold Alt and click to add new points","placeImage":"Click to place the image, or click and drag to set its size manually","publishLibrary":"Publish your own library","bindTextToElement":"Press enter to add text","deepBoxSelect":"Hold CtrlOrCmd to deep select, and to prevent dragging","eraserRevert":"Hold Alt to revert the elements marked for deletion"},"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","deepSelect":"Deep select","deepBoxSelect":"Deep select within box, and prevent dragging","curvedArrow":"Curved arrow","curvedLine":"Curved line","documentation":"Documentation","doubleClick":"double-click","drag":"drag","editor":"Editor","editSelectedShape":"Edit selected shape (text/arrow/line)","github":"Found an issue? Submit","howto":"Follow our guides","or":"or","preventBinding":"Prevent arrow binding","shapes":"Shapes","shortcuts":"Keyboard shortcuts","textFinish":"Finish editing (text editor)","textNewLine":"Add new line (text editor)","title":"Help","view":"View","zoomToFit":"Zoom to fit all elements","zoomToSelection":"Zoom to selection"},"clearCanvasDialog":{"title":"Clear canvas"},"publishDialog":{"title":"Publish library","itemName":"Item name","authorName":"Author name","githubUsername":"GitHub username","twitterUsername":"Twitter username","libraryName":"Library name","libraryDesc":"Library description","website":"Website","placeholder":{"authorName":"Your name or username","libraryName":"Name of your library","libraryDesc":"Description of your library to help people understand its usage","githubHandle":"GitHub handle (optional), so you can edit the library once submitted for review","twitterHandle":"Twitter username (optional), so we know who to credit when promoting over Twitter","website":"Link to your personal website or elsewhere (optional)"},"errors":{"required":"Required","website":"Enter a valid URL"},"noteDescription":{"pre":"Submit your library to be included in the ","link":"public library repository","post":"for other people to use in their drawings."},"noteGuidelines":{"pre":"The library needs to be manually approved first. Please read the ","link":"guidelines","post":" before submitting. You will need a GitHub account to communicate and make changes if requested, but it is not strictly required."},"noteLicense":{"pre":"By submitting, you agree the library will be published under the ","link":"MIT License, ","post":"which in short means anyone can use them without restrictions."},"noteItems":"Each library item must have its own name so it\'s filterable. The following library items will be included:","atleastOneLibItem":"Please select at least one library item to get started"},"publishSuccessDialog":{"title":"Library submitted","content":"Thank you {{authorName}}. Your library has been submitted for review. You can track the status","link":"here"},"confirmDialog":{"resetLibrary":"Reset library","removeItemsFromLib":"Remove selected items from library"},"encrypted":{"tooltip":"Your drawings are end-to-end encrypted so Excalidraw\'s servers will never see them.","link":"Blog post on end-to-end encryption in Excalidraw"},"stats":{"angle":"Angle","element":"Element","elements":"Elements","height":"Height","scene":"Scene","selected":"Selected","storage":"Storage","title":"Stats for nerds","total":"Total","version":"Version","versionCopy":"Click to copy","versionNotAvailable":"Version not available","width":"Width"},"toast":{"addedToLibrary":"Added to library","copyStyles":"Copied styles.","copyToClipboard":"Copied to clipboard.","copyToClipboardAsPng":"Copied {{exportSelection}} to clipboard as PNG\\n({{exportColorScheme}})","fileSaved":"File saved.","fileSavedToFilename":"Saved to {filename}","canvas":"canvas","selection":"selection"},"colors":{"495057":"Gray 7","ffffff":"White","f8f9fa":"Gray 0","f1f3f5":"Gray 1","fff5f5":"Red 0","fff0f6":"Pink 0","f8f0fc":"Grape 0","f3f0ff":"Violet 0","edf2ff":"Indigo 0","e7f5ff":"Blue 0","e3fafc":"Cyan 0","e6fcf5":"Teal 0","ebfbee":"Green 0","f4fce3":"Lime 0","fff9db":"Yellow 0","fff4e6":"Orange 0","transparent":"Transparent","ced4da":"Gray 4","868e96":"Gray 6","fa5252":"Red 6","e64980":"Pink 6","be4bdb":"Grape 6","7950f2":"Violet 6","4c6ef5":"Indigo 6","228be6":"Blue 6","15aabf":"Cyan 6","12b886":"Teal 6","40c057":"Green 6","82c91e":"Lime 6","fab005":"Yellow 6","fd7e14":"Orange 6","000000":"Black","343a40":"Gray 8","c92a2a":"Red 9","a61e4d":"Pink 9","862e9c":"Grape 9","5f3dc4":"Violet 9","364fc7":"Indigo 9","1864ab":"Blue 9","0b7285":"Cyan 9","087f5b":"Teal 9","2b8a3e":"Green 9","5c940d":"Lime 9","e67700":"Yellow 9","d9480f":"Orange 9"}}')}},s={};function l(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={id:e,loaded:!1,exports:{}};return a[e].call(n.exports,n,n.exports,l),n.loaded=!0,n.exports}return l.m=a,l.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return l.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,l.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 i=Object.create(null);l.r(i);var o={};n=n||[null,r({}),r([]),r(r)];for(var a=2&t&&e;"object"==typeof a&&!~n.indexOf(a);a=r(a))Object.getOwnPropertyNames(a).forEach((t=>o[t]=()=>e[t]));return o.default=()=>e,l.d(i,o),i},l.d=(e,t)=>{for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.f={},l.e=e=>Promise.all(Object.keys(l.f).reduce(((t,n)=>(l.f[n](e,t),t)),[])),l.u=e=>"excalidraw-assets/"+{9:"image",736:"vendor"}[e]+"-"+{9:"2be1c869cd5bacebdc3c",736:"8698157b56eb5e0ee549"}[e]+".js",l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i={},o="Excalidraw:",l.l=(e,t,n,r)=>{if(i[e])i[e].push(t);else{var a,s;if(void 0!==n)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var u=c[d];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==o+n){a=u;break}}a||(s=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,l.nc&&a.setAttribute("nonce",l.nc),a.setAttribute("data-webpack",o+n),a.src=e),i[e]=[t];var h=(t,n)=>{a.onerror=a.onload=null,clearTimeout(p);var r=i[e];if(delete i[e],a.parentNode&&a.parentNode.removeChild(a),r&&r.forEach((e=>e(n))),t)return t(n)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),s&&document.head.appendChild(a)}},l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),l.p="",(()=>{l.b=document.baseURI||self.location.href;var e={388:0};l.f.j=(t,n)=>{var r=l.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var i=new Promise(((n,i)=>r=e[t]=[n,i]));n.push(r[2]=i);var o=l.p+l.u(t),a=new Error;l.l(o,(n=>{if(l.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var i=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+i+": "+o+")",a.name="ChunkLoadError",a.type=i,a.request=o,r[1](a)}}),"chunk-"+t,t)}};var t=(t,n)=>{var r,i,[o,a,s]=n,c=0;if(o.some((t=>0!==e[t]))){for(r in a)l.o(a,r)&&(l.m[r]=a[r]);if(s)s(l)}for(t&&t(n);c<o.length;c++)i=o[c],l.o(e,i)&&e[i]&&e[i][0](),e[o[c]]=0},n=self.webpackChunkExcalidraw=self.webpackChunkExcalidraw||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),l(1143)})()}));
|