@dwelle/excalidraw 0.3.56 → 0.3.59-restoreLibraryItems
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -1
- package/README_NEXT.md +18 -0
- package/dist/excalidraw.development.js +44 -44
- package/dist/excalidraw.production.min.js +1 -1
- package/package.json +1 -1
- package/types/actions/actionAddToLibrary.d.ts +9 -3
- package/types/actions/actionAlign.d.ts +18 -0
- package/types/actions/actionBoundText.d.ts +8 -1
- package/types/actions/actionCanvas.d.ts +42 -9
- package/types/actions/actionClipboard.d.ts +22 -5
- package/types/actions/actionDeleteSelected.d.ts +10 -3
- package/types/actions/actionDistribute.d.ts +6 -0
- package/types/actions/actionDuplicateSelection.d.ts +3 -0
- package/types/actions/actionExport.d.ts +44 -9
- package/types/actions/actionFinalize.d.ts +5 -2
- package/types/actions/actionFlip.d.ts +6 -0
- package/types/actions/actionGroup.d.ts +6 -0
- package/types/actions/actionMenu.d.ts +20 -3
- package/types/actions/actionNavigate.d.ts +3 -0
- package/types/actions/actionProperties.d.ts +43 -13
- package/types/actions/actionSelectAll.d.ts +3 -0
- package/types/actions/actionStyles.d.ts +8 -1
- package/types/actions/actionToggleGridMode.d.ts +6 -1
- package/types/actions/actionToggleStats.d.ts +5 -1
- package/types/actions/actionToggleViewMode.d.ts +6 -1
- package/types/actions/actionToggleZenMode.d.ts +6 -1
- package/types/actions/actionZindex.d.ts +12 -0
- package/types/actions/manager.d.ts +3 -3
- package/types/actions/types.d.ts +6 -8
- package/types/appState.d.ts +2 -1
- package/types/components/App.d.ts +1 -1
- package/types/components/ImageExportDialog.d.ts +2 -2
- package/types/components/JSONExportDialog.d.ts +2 -2
- package/types/data/library.d.ts +1 -2
- package/types/element/Hyperlink.d.ts +6 -2
- package/types/element/linearElementEditor.d.ts +2 -1
- package/types/packages/excalidraw/index.d.ts +1 -1
- package/types/scene/Scene.d.ts +1 -1
- package/types/types.d.ts +3 -1
- package/types/utils.d.ts +2 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see excalidraw.production.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.Excalidraw=t(require("react"),require("react-dom")):e.Excalidraw=t(e.React,e.ReactDOM)}(self,(function(e,t){return(()=>{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]",I="[object Object]",j="[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",Ie="A-Z\\xc0-\\xd6\\xd8-\\xde",je="\\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+Ie+"]",He="\\ud83c[\\udffb-\\udfff]",Ne="[^\\ud800-\\udfff]",Be="(?:\\ud83c[\\udde6-\\uddff]){2}",Fe="[\\ud800-\\udbff][\\udc00-\\udfff]",Ue="["+Ie+"]",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+je+"]"),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[I]=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[I]=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 It(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function jt(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,Ie=t.Object,je=t.RegExp,Te=t.String,Me=t.TypeError,Oe=r.prototype,Le=Ee.prototype,Ae=Ie.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(Ie),Fe=pt._,Ue=je("^"+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(Ie.getPrototypeOf,Ie),Xe=Ie.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(Ie,"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=Ie.getOwnPropertySymbols,Ht=We?We.isBuffer:i,Gt=t.isFinite,vn=Oe.join,xn=cn(Ie.keys,Ie),yn=Se.max,wn=Se.min,kn=se.now,_n=t.parseInt,Cn=Se.random,En=Oe.reverse,Sn=go(t,"DataView"),In=go(t,"Map"),jn=go(t,"Promise"),Tn=go(t,"Set"),Mn=go(t,"WeakMap"),On=go(Ie,"create"),Ln=Mn&&new Mn,An={},Pn=Fo(Sn),Dn=Fo(In),zn=Fo(jn),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==I||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 Ii(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?Ie(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 It(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=Ie(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(In||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(!In||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 Ir(e){return null==e?e===i?"[object Undefined]":"[object Null]":nt&&nt in Ie(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 jr(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 Ie(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)&&Ir(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?I:c)==I,h=(d=d==v?I:d)==I,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=Ie(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 Ie(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 Ie(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]?jo(t[0][0],t[0][1]):function(n){return n===e||Dr(n,e,t)}}function Wr(e,t){return _o(e)&&Io(t)?jo(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=Ii(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=ji(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 Ii(e,t){var n=t?Si(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function ji(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=Ie(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=Ie(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=Ie(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=Ie(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,Io(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=Ie(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=Ir;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 Ie(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||In&&bo(new In)!=E||jn&&bo(jn.resolve())!=j||Tn&&bo(new Tn)!=M||Mn&&bo(new Mn)!=A)&&(bo=function(e){var t=Ir(e),n=t==I?e.constructor:i,r=n?Fo(n):"";if(r)switch(r){case Pn:return D;case Dn:return E;case zn:return j;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 Io(e){return e==e&&!rs(e)}function jo(e,t){return function(n){return null!=n&&(n[e]===t&&(t!==i||e in Ie(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 It(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(ji)),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)?It:gr)(e,uo(t,3))}function ka(e,t){return(Ya(e)?jt: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 Ia=Ai((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var ja=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(jr),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)&&Ir(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)&&Ir(e)==w};function Ja(e){if(!is(e))return!1;var t=Ir(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=Ir(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)&&Ir(e)==S}function ss(e){if(!is(e)||Ir(e)!=I)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)&&Ir(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)&&Ir(e)==O}function us(e){return"symbol"==typeof e||is(e)&&Ir(e)==L}var hs=Ct?$t(Ct):function(e){return is(e)&&ns(e.length)&&!!at[Ir(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 Is=Qr((function(e,t){e=Ie(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})),js=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 It(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 It(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"),Il=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=Is,Un.defaultsDeep=js,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=Ia,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=ja,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?It: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)&&Ir(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]"==Ir(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,jr):i},Un.maxBy=function(e,t){return e&&e.length?br(e,uo(t,2),jr):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=Il,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=je((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=je(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",It(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Un[e].placeholder=Un})),It(["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()}})),It(["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}})),It(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Gn.prototype[e]=function(){return this[n](1).value()[0]}})),It(["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)})})),It(["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 .finalize-button{display:grid;grid-auto-flow:column;gap:.4em;margin-top:auto;margin-bottom:auto;margin-inline-start:.6em}.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:()=>I,LL:()=>j,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,xY:()=>J});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"},I=window.location.origin,j=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"},J=20},6439:(e,t,n)=>{"use strict";n.r(t),n.d(t,{FONT_FAMILY:()=>o.ut,THEME:()=>o.C6,bumpVersion:()=>Nr,cleanAppStateForExport:()=>yn,clearAppStateForLocalStorage:()=>xn,default:()=>Bp,defaultLang:()=>c,exportToBlob:()=>Yh,exportToCanvas:()=>Gh,exportToClipboard:()=>Zh,exportToSvg:()=>Xh,getDefaultAppState:()=>fn,getFreeDrawSvgPath:()=>Mr,getNonDeletedElements:()=>Tl,getSceneVersion:()=>Il,isInvisiblySmallElement:()=>Br,isLinearElement:()=>Ie,languages:()=>d,loadFromBlob:()=>wd,loadLibraryFromBlob:()=>kd,mutateElement:()=>Rr,newElementWith:()=>Hr,restore:()=>md,restoreAppState:()=>gd,restoreElements:()=>pd,serializeAsJSON:()=>Td});var r=n(9787),i=n.n(r),o=n(8288);const a=JSON.parse('{"u2":"@dwelle/excalidraw","i8":"0.3.55"}');"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 I{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 j{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],I=[n+_*w,r-C*y],j=[n,r];if(S[0]=2*E[0]-S[0],S[1]=2*E[1]-S[1],c)return[S,I,j].concat(h);{h=[S,I,j].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 I(t));break;case"dashed":M[n]||(M[n]=new j(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,Ie=e=>null!=e&&je(e.type),je=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):Ie(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||!vr(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=vr(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(Ie(e))t=((e,t,n)=>{if(e.points.length<2||!vr(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=vr(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(!Ie(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,wr(e)):t.curve(r,wr(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,wr(e)):r.curve(t,wr(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",It="KeyH",jt="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)};let Yt,Xt;const Zt=(e,t)=>{Yt&&Yt.theme===t||(()=>{const e=t===o.C6.DARK;Yt=document.createElement("canvas"),Yt.theme=t,Yt.height=20,Yt.width=20;const n=Yt.getContext("2d");n.lineWidth=1,n.beginPath(),n.arc(Yt.width/2,Yt.height/2,5,0,2*Math.PI),n.fillStyle=e?it.black:it.white,n.fill(),n.strokeStyle=e?it.white:it.black,n.stroke(),Xt=Yt.toDataURL(o.LO.svg)})(),Gt(e,"url(".concat(Xt,") ").concat(10," ").concat(10,", auto"))},qt=(e,t)=>{e&&("selection"===t.activeTool.type?Vt(e):"eraser"===t.activeTool.type?Zt(e,t.theme):"image"!==t.activeTool.type&&(e.style.cursor=o.oc.CROSSHAIR))},$t=()=>{var e;return"HTML"===(null===(e=document.fullscreenElement)||void 0===e?void 0:e.nodeName)},Qt=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")),Jt=(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}},en=(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}},tn=e=>getComputedStyle(document.documentElement).getPropertyValue("--".concat(e)),nn=new RegExp("^[^".concat("A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-﷾--","]*[").concat("֑-߿יִ-﷽ﹰ-ﻼ","]")),rn=e=>nn.test(e),on=e=>{const[t,n]=e;return{x:t,y:n}},an=e=>{if("AbortError"!==(null==e?void 0:e.name))throw e;console.warn(e)},sn=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]},ln=e=>t=>{(0,st.unstable_batchedUpdates)(e,t)},cn=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)})),dn=()=>hn()?1:Date.now(),un=e=>e.reduce(((e,t)=>(e.set("string"==typeof t?t:t.id,t),e)),new Map),hn=()=>{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)},pn=(e,t)=>new CustomEvent(e,{detail:{nativeEvent:t},cancelable:!0}),gn=(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({},e),t):e},mn=o.ZB.includes(devicePixelRatio)?devicePixelRatio:1,fn=()=>({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,activeTool:{type:"selection"},penMode:!1,penDetected:!1,errorMessage:null,exportBackground:!0,exportScale:mn,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}),bn={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},activeTool:{browser:!0,export:!1,server:!1},penMode:{browser:!0,export:!1,server:!1},penDetected:{browser:!0,export:!1,server:!1},errorMessage:{browser:!1,export:!1,server:!1},exportBackground:{browser:!0,export:!1,server:!1},exportEmbedScene:{browser:!0,export:!1,server:!1},exportScale:{browser:!0,export:!1,server:!1},exportWithDarkMode:{browser:!0,export:!1,server:!1},fileHandle:{browser:!1,export:!1,server:!1},gridSize:{browser:!0,export:!0,server:!0},height:{browser:!1,export:!1,server:!1},isBindingEnabled:{browser:!1,export:!1,server:!1},isLibraryOpen:{browser:!1,export:!1,server:!1},isLoading:{browser:!1,export:!1,server:!1},isResizing:{browser:!1,export:!1,server:!1},isRotating:{browser:!1,export:!1,server:!1},lastPointerDownWith:{browser:!0,export:!1,server:!1},multiElement:{browser:!1,export:!1,server:!1},name:{browser:!0,export:!1,server:!1},offsetLeft:{browser:!1,export:!1,server:!1},offsetTop:{browser:!1,export:!1,server:!1},openMenu:{browser:!0,export:!1,server:!1},openPopup:{browser:!1,export:!1,server:!1},pasteDialog:{browser:!1,export:!1,server:!1},previousSelectedElementIds:{browser:!0,export:!1,server:!1},resizingElement:{browser:!1,export:!1,server:!1},scrolledOutside:{browser:!0,export:!1,server:!1},scrollX:{browser:!0,export:!1,server:!1},scrollY:{browser:!0,export:!1,server:!1},selectedElementIds:{browser:!0,export:!1,server:!1},selectedGroupIds:{browser:!0,export:!1,server:!1},selectionElement:{browser:!1,export:!1,server:!1},shouldCacheIgnoreZoom:{browser:!0,export:!1,server:!1},showHelpDialog:{browser:!1,export:!1,server:!1},showStats:{browser:!0,export:!1,server:!1},startBoundElement:{browser:!1,export:!1,server:!1},suggestedBindings:{browser:!1,export:!1,server:!1},toastMessage:{browser:!1,export:!1,server:!1},viewBackgroundColor:{browser:!0,export:!0,server:!0},width:{browser:!1,export:!1,server:!1},zenModeEnabled:{browser:!0,export:!1,server:!1},zoom:{browser:!0,export:!1,server:!1},viewModeEnabled:{browser:!1,export:!1,server:!1},pendingImageElement:{browser:!1,export:!1,server:!1},showHyperlinkPopup:{browser:!1,export:!1,server:!1}},vn=(e,t)=>{const n={};for(const r of Object.keys(e)){const i=bn[r];if(null!=i&&i[t]){const t=e[r];n[r]=t}}return n},xn=e=>vn(e,"browser"),yn=e=>vn(e,"export"),wn=e=>vn(e,"server"),kn=e=>{let{activeTool:t}=e;return"eraser"===t.type};function _n(e,t,n,r=(e=>e)){return e*r(.5-t*(.5-n))}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[e[0]*t,e[1]*t]}function In(e){return[e[1],-e[0]]}function jn(e,t){return e[0]*t[0]+e[1]*t[1]}function Tn(e,t){return e[0]===t[0]&&e[1]===t[1]}function Mn(e,t){return function(e){return e[0]*e[0]+e[1]*e[1]}(En(e,t))}function On(e){return function(e,t){return[e[0]/t,e[1]/t]}(e,function(e){return Math.hypot(e[0],e[1])}(e))}function Ln(e,t){return Math.hypot(e[1]-t[1],e[0]-t[0])}function An(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 Pn(e,t,n){return Cn(e,Sn(En(t,e),n))}function Dn(e,t,n){return Cn(e,Sn(t,n))}var{min:zn,PI:Rn}=Math,Hn=Rn+1e-4;function Nn(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=zn(1,t.distance/n),o=zn(1,1-i);r=zn(1,e+.275*i*(o-e))}return(e+r)/2}),e[0].pressure),k=_n(n,i,e[e.length-1].pressure,a),_=e[0].vector,C=e[0].point,E=C,S=C,I=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=zn(1,c/n),t=zn(1,1-e);r=zn(1,w+.275*e*(t-w))}k=_n(n,i,r,a)}else k=n/2;void 0===f&&(f=k);let p=d<u?h(d/u):1,j=b-d<g?m((b-d)/g):1;if(k=Math.max(.01,k*Math.min(p,j)),t===e.length-1){let e=Sn(In(l),k);x.push(En(s,e)),y.push(Cn(s,e));continue}let T=e[t+1].vector,M=jn(l,T);if(M<0){let e=Sn(In(_),k);for(let t=1/13,n=0;n<=1;n+=t)S=An(En(s,e),s,Hn*n),x.push(S),I=An(Cn(s,e),s,Hn*-n),y.push(I);C=S,E=I;continue}let O=Sn(In(Pn(T,l,M)),k);S=En(s,O),(t<=1||Mn(C,S)>v)&&(x.push(S),C=S),I=Cn(s,O),(t<=1||Mn(E,I)>v)&&(y.push(I),E=I),w=r,_=l}let j=e[0].point.slice(0,2),T=e.length>1?e[e.length-1].point.slice(0,2):Cn(e[0].point,[1,1]),M=[],O=[];if(1===e.length){if(!u&&!g||c){let e=Dn(j,On(In(En(j,T))),-(f||k)),t=[];for(let n=1/13,r=n;r<=1;r+=n)t.push(An(e,j,2*Hn*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=An(y[0],j,Hn*t);M.push(e)}else{let e=En(x[0],y[0]),t=Sn(e,.5),n=Sn(e,.51);M.push(En(j,t),En(j,n),Cn(j,n),Cn(j,t))}let t=In(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=Dn(T,t,k);for(let t=1/29,n=t;n<1;n+=t)O.push(An(e,T,3*Hn*n))}else O.push(Cn(T,Sn(t,k)),Cn(T,Sn(t,.99*k)),En(T,Sn(t,.99*k)),En(T,Sn(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(Pn(s[0],e,t/4))}1===s.length&&(s=[...s,[...Cn(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):Pn(u.point,s[e],a);if(Tn(u.point,t))continue;let n=Ln(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:On(En(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 Bn=e=>"string"==typeof e;class Fn{constructor(){this.callbacks=new Set,this.nonDeletedElements=[],this.elements=[],this.elementsMap=new Map}static mapElementToScene(e,t){Bn(e)?this.sceneMapById.set(e,t):this.sceneMapByElement.set(e,t)}static getScene(e){return Bn(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&&Ml(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),Fn.mapElementToScene(e,this)})),this.nonDeletedElements=Tl(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(){Fn.sceneMapById.forEach(((e,t)=>{e===this&&Fn.sceneMapById.delete(t)})),this.callbacks.clear()}}Fn.sceneMapByElement=new WeakMap,Fn.sceneMapById=new Map;const Un=Fn,Wn=(e,t)=>{const n=t?t.width-2*o.gK:void 0;let r=e.text;t&&(r=Qn(e.originalText,Ut(e),t.width));const i=Gn(e.originalText,Ut(e),n);let a=e.y,s=e.x;if(t){let n=t.height;s=t.x+o.gK,e.verticalAlign===o.oX.TOP?a=t.y+o.gK:e.verticalAlign===o.oX.BOTTOM?a=t.y+t.height-i.height-o.gK:(a=t.y+t.height/2-i.height/2,i.height>t.height-2*o.gK&&(n=i.height+2*o.gK,a=t.y+n/2-i.height/2)),Rr(t,{height:n})}Rr(e,{width:i.width,height:i.height,baseline:i.baseline,y:a,x:s,text:r})},Kn=(e,t,n)=>{const r=un(e);t.forEach((e=>{const t=n.get(e.id),i=rr(e);if(i){const a=n.get(i);if(a){const n=r.get(t);var o;if(n)Rr(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)&&Rr(i,{containerId:n?t:null})}}}))},Vn=(e,t)=>{const n=rr(e);if(n){const r=Un.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=Qn(r.originalText,Ut(r),e.width));const t=Gn(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;Rr(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,Rr(r,{text:i,width:e.width-2*o.gK,height:a,x:e.x+o.gK,y:n,baseline:l})}}},Gn=(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=Zn(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}},Yn="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".toLocaleUpperCase(),Xn={},Zn=e=>(Xn[e]||(Xn[e]=Gn(Yn,e,null).height),Xn[e]);let qn;const $n=(e,t)=>{qn||(qn=document.createElement("canvas"));const n=qn.getContext("2d");n.font=t;const r=n.measureText(e);return hn()?10*r.width:r.width},Qn=(e,t,n)=>{const r=n-2*o.gK,i=[],a=e.split("\n"),s=$n(" ",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($n(n[a],t)>=r){for(e&&i.push(e),e="",o=0;n[a].length>0;){const s=n[a][0],l=Jn.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=$n(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")},Jn=(()=>{const e={};return{calculate:(t,n)=>{const r=t.charCodeAt(0);if(e[n]||(e[n]=[]),!e[n][r]){const i=$n(t,n);e[n][r]=i}return e[n][r]},getCache:t=>e[t]}})(),er=e=>{const t=nr(e);return 0===t?Gn(Yn.split("").join("\n"),e).width+2*o.gK:t+2*o.gK},tr=e=>Zn(e)+2*o.gK,nr=e=>{const t=Jn.getCache(e);if(!t)return 0;const n=t.filter((e=>void 0!==e));return Math.max(...n)},rr=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},ir=e=>{if(!e)return null;const t=rr(e);var n;return t&&(null===(n=Un.getScene(e))||void 0===n?void 0:n.getElement(t))||null},or=e=>{return e&&e.containerId&&(null===(t=Un.getScene(e))||void 0===t?void 0:t.getElement(e.containerId))||null;var t},ar="invert(100%) hue-rotate(180deg) saturate(1.25)",sr=fn(),lr=(e,t)=>ke(e)&&!t.imageCache.has(e.fileId),cr=(e,t)=>{var n;return"dark"===t.theme&&ke(e)&&!lr(e,t)&&(null===(n=t.imageCache.get(e.fileId))||void 0===n?void 0:n.mimeType)!==o.LO.svg},dr=e=>[8,8+e],ur=e=>[1.5,6+e],hr=e=>"freedraw"===e.type?12*e.strokeWidth:20,pr=document.createElement("img");pr.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 gr=document.createElement("img");gr.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 mr=(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(vr(e));break;case"arrow":case"line":n.lineJoin="round",n.lineCap="round",vr(e).forEach((e=>{t.draw(e)}));break;case"freedraw":{n.save(),n.fillStyle=e.strokeColor;const r=function(e){return jr.get(e)}(e),i=vr(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?gr:pr,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=rn(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?Zn(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 fr=new WeakMap,br=new WeakMap;const vr=e=>br.get(e),xr=(e,t)=>br.set(e,t),yr=e=>br.delete(e),wr=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n={seed:e.seed,strokeLineDash:"dashed"===e.strokeStyle?dr(e.strokeWidth):"dotted"===e.strokeStyle?ur(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))}},kr=(e,t)=>{let n=br.get(e);if(void 0===n)switch(fr.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"),wr(e,!0))}else n=t.rectangle(0,0,e.width,e.height,wr(e));xr(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)),wr(e,!0)):t.polygon([[r,i],[o,a],[s,l],[c,d]],wr(e)),xr(e,n);break}case"ellipse":n=t.ellipse(e.width/2,e.height/2,e.width,e.height,wr(e)),xr(e,n);break;case"line":case"arrow":{const r=wr(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,I]=De(_,C,p,g,-E*Math.PI/180),[j,T]=De(_,C,p,g,E*Math.PI/180);return[p,g,S,I,j,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=ur(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)}}xr(e,n);break}case"freedraw":Tr(e),n=Ne(e.points)?t.polygon(e.points,Object.assign(Object.assign({},wr(e)),{stroke:"none"})):null,xr(e,n);break;case"text":case"image":xr(e,null)}},_r=(e,t)=>{const n=t?t.zoom:sr.zoom,r=fr.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=hr(e);let a=0,s=0;if(Ie(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 cr(e,n)&&(i.filter=ar),mr(e,l,i,n),i.restore(),{element:e,canvas:r,theme:n.theme,canvasZoom:t.value,canvasOffsetX:a,canvasOffsetY:s}})(e,n,t);return fr.set(e,r),r}return r},Cr=(e,t,n,r)=>{const i=e.element,o=hr(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=lr(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()},Er=(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(kr(e,i),r.isExporting){const t=_r(e,r);Cr(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),mr(e,t,n,r),n.restore()}break;case"rectangle":case"diamond":case"ellipse":case"line":case"arrow":case"image":case"text":if(kr(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),cr(e,r)&&(n.filter="none"),mr(e,t,n,r),n.restore()}else{const t=_r(e,r);Cr(t,0,n,r)}break;default:throw new Error("Unimplemented type ".concat(e.type))}},Sr=(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)},Ir=(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":{kr(e,m);const n=Sr(t,vr(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":{kr(e,m);const r=n.ownerDocument.createElementNS(o.hR,"g"),s=e.opacity/100;r.setAttribute("stroke-linecap","round"),vr(e).forEach((n=>{const l=Sr(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":{kr(e,m),Tr(e);const r=e.opacity/100,s=vr(e),l=s?Sr(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",Mr(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",ar),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=rn(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 jr=new WeakMap([]);function Tr(e){const t=Mr(e),n=new Path2D(t);return jr.set(e,n),n}function Mr(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,Or(n,i[0]),"L",i[0],"Z"):e.push(n,Or(n,i[r+1])),e)),["M",e[0],"Q"]).join(" ").replace(Lr,"$1")}(Nn(t,n))}function Or(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}const Lr=/(\s?[A-Z]?,?-?[0-9]*\.[0-9]{0,2})(([0-9]|e|-)*)/g;let Ar=new O(Date.now()),Pr=0;const Dr=()=>Math.floor(Ar.next()*2**31),zr=()=>hn()?"id".concat(Pr++):we(),Rr=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||yr(e),e.version++,e.versionNonce=Dr(),e.updated=dn(),n)&&(null===(a=Un.getScene(e))||void 0===a||a.informMutation());return e},Hr=(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:dn(),version:e.version+1,versionNonce:Dr()}):e},Nr=(e,t)=>(e.version=(null!=t?t:e.version)+1,e.versionNonce=Dr(),e.updated=dn(),e),Br=e=>Ie(e)||Ee(e)?e.points.length<2:0===e.width&&0===e.height,Fr=(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}},Ur=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},Wr=(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]))))})},Kr=(e,t)=>null!=Vr(e,t),Vr=(e,t)=>t.groupIds.filter((t=>t!==e.editingGroupId)).find((t=>e.selectedGroupIds[t])),Gr=e=>Object.entries(e.selectedGroupIds).filter((e=>{let[t,n]=e;return n})).map((e=>{let[t,n]=e;return t})),Yr=(e,t)=>{let n=Object.assign(Object.assign({},e),{selectedGroupIds:{}});const r=Rl(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=Wr(e,n,t)}}return n},Xr=(e,t)=>e.groupIds.includes(t),Zr=(e,t)=>e.filter((e=>Xr(e,t))),qr=(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},$r=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=ir(e);i&&r.push(i),t.set(n,[...r,e])})),Array.from(t.values())};var Qr=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 Jr=(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=Qr(t,["x","y","strokeColor","backgroundColor","fillStyle","strokeWidth","strokeStyle","roughness","opacity","width","height","angle","groupIds","strokeSharpness","boundElements","link"]);return{id:y.id||zr(),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:Dr(),version:y.version||1,versionNonce:null!==(r=y.versionNonce)&&void 0!==r?r:0,isDeleted:!1,boundElements:v,updated:dn(),link:x}},ei=e=>Jr(e.type,e),ti=(e,t)=>({x:"center"===e.textAlign?t.width/2:"right"===e.textAlign?t.width:0,y:"middle"===e.verticalAlign?t.height/2:0}),ni=e=>{const t=Gn(e.text,Ut(e)),n=ti(e,t);return Hr(Object.assign(Object.assign({},Jr("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}),{})},ri=(e,t)=>{let{text:n,isDeleted:r,originalText:i}=t;const a=or(e);a&&(n=Qn(n,Ut(e),a.width));const s=((e,t)=>{let n=null;const r=or(e);r&&(n=r.width-2*o.gK);const{width:i,height:a,baseline:s}=Gn(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=Gn(e.text,Ut(e),n),r=ti(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||Rr(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 Hr(e,Object.assign({text:n,originalText:i,isDeleted:null!=r?r:e.isDeleted},s))},ii=e=>Object.assign(Object.assign({},Jr(e.type,e)),{points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:e.startArrowhead,endArrowhead:e.endArrowhead}),oi=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]=oi(e[r],t+1)}return n}if(Array.isArray(e)){let n=e.length;const r=new Array(n);for(;n--;)r[n]=oi(e[n],t+1);return r}return e},ai=(e,t,n,r)=>{let i=oi(n);var o,a;hn()?(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=zr();return i.updated=dn(),i.seed=Dr(),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,zr()),t.get(e)))),r&&(i=Object.assign(i,r)),i},si={mouse:8,pen:16,touch:28},li={e:!0,s:!0,n:!0,w:!0},ci={e:!0,s:!0,n:!0,w:!0},di={e:!0,s:!0,n:!0,w:!0,nw:!0,se:!0},ui={e:!0,s:!0,n:!0,w:!0,ne:!0,sw:!0},hi=(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]},pi=function(e,t,n,r){let[i,o,a,s]=e,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const c=si[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:hi(i-v-h+x,o-v-p+x,d,u,f,b,t),ne:l.ne?void 0:hi(a+v-x,o-v-p+x,d,u,f,b,t),sw:l.sw?void 0:hi(i-v-h+x,s+v-x,d,u,f,b,t),se:l.se?void 0:hi(a+v-x,s+v-x,d,u,f,b,t),rotation:l.rotation?void 0:hi(i+g/2-d/2,o-v-p+x-16/n.value,d,u,f,b,t)},w=5*si.mouse/n.value;return Math.abs(g)>w&&(l.n||(y.n=hi(i+g/2-d/2,o-v-p+x,d,u,f,b,t)),l.s||(y.s=hi(i+g/2-d/2,s+v-x,d,u,f,b,t))),Math.abs(m)>w&&(l.w||(y.w=hi(i-v-h+x,o+m/2-u/2,d,u,f,b,t)),l.e||(y.e=hi(a+v-x,o+m/2-u/2,d,u,f,b,t))),y},gi=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=ui:t[0]>0&&t[1]<0?r=di:t[0]>0&&t[1]>0?r=ui:t[0]<0&&t[1]>0?r=di:t[0]<0&&t[1]<0&&(r=ui)}}else Ce(e)&&(r=ci);return pi(Ye(e),e.angle,t,n,r)},mi=(e,t)=>[0,0,0,0,t,e,1,0],fi=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},bi=e=>[e[0],e[1],e[2],e[3],-e[4],-e[5],-e[6],-e[7]],vi=(e,t)=>Si(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]],xi=(e,t)=>Si(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]:[yi(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]],yi=(e,t)=>t[0]*e[0]+t[2]*e[2]+t[3]*e[3]-t[6]*e[6],wi=(e,t)=>[ki(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]],ki=(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],_i=e=>Math.sqrt(Math.abs(e[0]*e[0]-e[2]*e[2]-e[3]*e[3]+e[6]*e[6])),Ci=e=>{const t=_i(e);if(0===t||1===t)return e;const n=e[6]<0?-1:1;return xi(e,n/t)},Ei=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:xi(e,1/t)},Si=e=>"number"==typeof e,Ii=(fi(1,1),fi(1,2),fi(1,3),fi(1,4),fi(1,5),fi(1,6),fi(1,7),(e,t,n)=>Ci([0,n,e,t,0,0,0,0])),ji=(e,t)=>Ci(wi(t,e)),Ti=(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),Mi=e=>{let[t,n]=e;return[0,0,0,0,n,t,1,0]},Oi=e=>[e[5],e[4]],Li=(e,t)=>Ci(((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)),Ai=(e,t)=>_i(wi(e,t)),Pi=(e,t)=>ki(e,t),Di=e=>[0,0,0,0,e[4],e[5],0,0],zi=(e,t)=>((e,t)=>Si(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]])(xi(e,Math.sin(t/2)),Math.cos(t/2)),Ri=(e,t)=>Ci(xi(xi(e,t),bi(e))),Hi=(e,t,n,r)=>{const i=10/t.zoom.value;return!Ni(e,t,[n,r])&&Fi(e,[n,r],i)},Ni=(e,t,n)=>{const r=10/t.zoom.value,i=Ce(e)?Gi:(e=>{if("arrow"===e.type)return!1;if("freedraw"===e.type)return!0;const t=!sn(e.backgroundColor)||Ae(e);return"line"===e.type?t&&Ne(e.points):t||_e(e)})(e)?Yi:Xi;return Ki({element:e,point:n,threshold:r,check:i})},Bi=(e,t)=>e.selectedElementIds[t.id],Fi=(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},Ui=(e,t)=>{let{x:n,y:r}=t;const i=Wi(e,e.width,e.height);return Ki({element:e,point:[n,r],threshold:i,check:Zi})},Wi=(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))},Ki=e=>{switch(e.element.type){case"rectangle":case"image":case"text":case"diamond":case"ellipse":const t=Vi(e.element,e.point);return e.check(t,e.threshold);case"freedraw":return!!e.check(qi(e.element,e.point),e.threshold)&&eo(e.element,e.point,e.threshold);case"arrow":case"line":return to(e);case"selection":return console.warn("This should not happen, we need to investigate why it does."),!1}},Vi=(e,t)=>{switch(e.type){case"rectangle":case"image":case"text":return qi(e,t);case"diamond":return $i(e,t);case"ellipse":return Qi(e,t)}},Gi=(e,t)=>e<0,Yi=(e,t)=>e<t,Xi=(e,t)=>Math.abs(e)<t,Zi=(e,t)=>0<=e&&e<t,qi=(e,t)=>{const[,n,r,i]=no(e,t);return Math.max(Pi(n,Ii(0,1,-i)),Pi(n,Ii(1,0,-r)))},$i=(e,t)=>{const[,n,r,i]=no(e,t),o=Ii(i,r,-i*r);return Pi(n,o)},Qi=(e,t)=>{const[n,r]=Ji(e,t);return-(e=>Math.sign(e[1]))(r)*Pi(n,r)},Ji=(e,t)=>{const[,n,r,i]=no(e,t),[o,a]=Oi(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=mi(c*s,d*l);var h;return[n,Ti(ji(n,h=u),h)]},eo=(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=vr(e);return!(!l||!l.sets.length)&&fo(l,r,i,n)},to=e=>{const{element:t,threshold:n}=e;if(!vr(t))return!1;const[r,i,o,a]=no(e.element,e.point),s=Ii(0,1,-a),l=Ii(1,0,-o);if(!Yi(Pi(i,s),n)||!Yi(Pi(i,l),n))return!1;const[c,d]=Oi(r),u=vr(t);if(!u)return!1;if(e.check===Yi){if(u.some((e=>mo(e,c,d,t.strokeSharpness))))return!0}return u.some((e=>fo(e,c,d,n)))},no=(e,t)=>{const n=Mi(t),r=Ye(e),i=io(r),o=zi(i,e.angle),a=Ri(o,n),s=(e=>[0,0,0,0,Math.abs(e[4]),Math.abs(e[5]),1,0])(vi(a,Di(i))),l=((e,t)=>[0,0,0,0,t,e,0,0])(e.x,e.y),c=vi(a,l),[d,u,h,p]=r;return[c,s,(h-d)/2,(p-u)/2]},ro=e=>{const t=Ye(e),n=io(t),r=zi(n,e.angle),i=bi((e=>[1,0,0,0,-.5*e[5],.5*e[4],0,0])(Di(n)));return xi(i,r)},io=e=>{let[t,n,r,i]=e;return mi((t+r)/2,(n+i)/2)},oo=(e,t,n)=>{const r=ro(e),i=Ri(r,Mi(t)),o=Ri(r,Mi(n)),a=ji(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))}},ao=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=so(e);r=n.flatMap(((e,r)=>{const o=[e,n[(r+1)%4]];return lo(t,co(o,i))})).concat(n.flatMap((e=>ho(e,i,t))));break;case"ellipse":r=uo(e,i,t)}if(r.length<2)return[];const o=r.sort(((e,t)=>Ai(e,n)-Ai(t,n)));return[o[0],o[o.length-1]]},so=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[mi(n,r),mi(n,-r),mi(-n,-r),mi(-n,r)];case"diamond":return[mi(0,r),mi(n,0),mi(0,-r),mi(-n,0)]}},lo=(e,t)=>{const[n,r]=t;return Pi(n,e)*Pi(r,e)>=0?[]:[Li(e,ji(n,r))]},co=(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)=>Ei([0,0,0,0,t[4]-e[4],t[5]-e[5],0,0]))(n,r),t);return[Ri(i,n),Ri(i,r)]},uo=(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[mi((u+r*i*a*d)/l,(h-r*i*o*d)/l),mi((u-r*i*a*d)/l,(h+r*i*o*d)/l)]},ho=(e,t,n)=>{if(0===t)return 0===Pi(n,e)?[e]:[];const r=n[2],i=n[3],o=n[1],[a,s]=Oi(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[mi((u+i*d)/l,(h-r*d)/l),mi((u-i*d)/l,(h+r*d)/l)]},po=(e,t,n)=>{const r=Math.abs(t),i=e.width*r/2,o=e.height*r/2,a=Math.sign(t),[s,l]=Oi(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 mi(p,(-u*p-1)/h)},go=(e,t,n)=>{const r=Math.abs(t),i=Math.sign(t),o=so(e,r);let a=0,s=null;return o.forEach((e=>{const t=i*ji(n,e)[1];t>a&&(a=t,s=e)})),s},mo=(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},fo=(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 mo(e,t,n,"sharp");"qcurveTo"===s&&console.warn("qcurveTo is not implemented yet")}return!1}))};var bo=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 vo=(e,t,n)=>t>=e[0]&&t<=e[0]+e[2]&&n>=e[1]&&n<=e[1]+e[3],xo=(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=gi(e,i,o),{rotation:s}=a,l=bo(a,["rotation"]);if(s&&vo(s,n,r))return"rotation";const c=Object.keys(l).filter((e=>{const t=l[e];return!!t&&vo(t,n,r)}));return c.length>0&&c[0]})(a,t,n,r,i,o);return s?{element:a,transformHandleType:s}:null}),null),yo=(e,t,n,r,i)=>{let[o,a,s,l]=e;const c=pi([o,a,s,l],0,r,i,li);return Object.keys(c).find((e=>{const r=c[e];return r&&vo(r,t,n)}))||!1},wo=["ns","nesw","ew","nwse"],ko=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=wo.indexOf(e);if(n>=0){const r=Math.round(t/(Math.PI/4));e=wo[(n+r)%wo.length]}return e})(i,t.angle)),i?"".concat(i,"-resize"):""};class _o{constructor(e,t){this.elementId=e.id,Un.mapElementToScene(this.elementId,t),_o.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=Un.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=_o.getElement(a);if(!s)return!1;const[l,c,d,u]=Ye(t.draggingElement),h=_o.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=_o.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=_o.createPointAt(c,n-o.pointerOffset.x,r-o.pointerOffset.y,e.gridSize),u=s[0]-d[0],h=s[1]-d[1];if(_o.movePoints(c,a.map((t=>({index:t,point:t===o.pointerDownState.lastClickedPoint?_o.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(on(_o.getPointGlobalCoordinates(c,c.points[0])));const t=a[a.length-1];t===c.points.length-1&&e.push(on(_o.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=_o.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)&&_o.movePoints(l,[{index:e,point:0===e?l.points[l.points.length-1]:l.points[0]}]);const t=Eo(n)?zo(on(_o.getPointAtIndexGlobalCoordinates(l,e)),Un.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=_o.getElement(s);if(!l)return a;if(e.altKey)return null==t.editingLinearElement.lastUncommittedPoint&&Rr(l,{points:[...l.points,_o.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:zo(i,Un.getScene(l))})}),a.didAddPoint=!0,a;const c=_o.getPointIndexUnderCursor(l,t.zoom,i.x,i.y);if(c>-1)a.hitElement=l;else{const{startBindingElement:e,endBindingElement:n}=t.editingLinearElement;Eo(t)&&Te(l)&&So(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)?Co([...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=_o.getElement(o);if(!s)return r;const{points:l}=s,c=l[l.length-1];if(!e.altKey)return c===a&&_o.deletePoints(s,[l.length-1]),Object.assign(Object.assign({},r),{lastUncommittedPoint:null});const d=_o.createPointAt(s,t-r.pointerOffset.x,n-r.pointerOffset.y,i);return c===a?_o.movePoints(s,[{index:s.points.length-1,point:d}]):_o.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){Rr(e,_o.getNormalizedPoints(e))}static duplicateSelectedPoints(e){if(!e.editingLinearElement)return!1;const{selectedPointsIndices:t,elementId:n}=e.editingLinearElement,r=_o.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(Rr(r,{points:l}),a){const e=r.points[r.points.length-1];_o.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)),[]);_o._updatePoints(e,i,n,r)}static addPoints(e,t){const n=[...e.points,...t.map((e=>e.point))];_o._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}));_o._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);Rr(e,Object.assign(Object.assign({},i),{points:t,x:e.x+u[0],y:e.y+u[1]}))}}_o.POINT_HANDLE_SIZE=20;const Co=e=>{let t=[...new Set(e.filter((e=>null!==e&&-1!==e)))];return t=t.sort(((e,t)=>e-t)),t.length?t:null},Eo=e=>e.isBindingEnabled,So=(e,t,n)=>{const r=new Set,i=new Set;Io(e,t,n,"start",r,i),Io(e,n,t,"end",r,i);const o=Array.from(i).filter((e=>!r.has(e)));Un.getScene(e).getNonDeletedElements(o).forEach((t=>{var n;Rr(t,{boundElements:null===(n=t.boundElements)||void 0===n?void 0:n.filter((t=>"arrow"!==t.type||t.id!==e.id))})}))},Io=(e,t,n,r,i,o)=>{if("keep"!==t)if(null!=t)null!=n&&("keep"===n?Lo(e,t,r):"start"!==r&&n.id===t.id)||(Oo(e,t,r),i.add(t.id));else{const t=Do(e,r);null!=t&&o.add(t)}},jo=e=>{e.forEach((e=>{Te(e)?So(e,Ko(e,"start"),Ko(e,"end")):Oe(e)&&To(e)}))},To=e=>{Go(e).forEach((t=>{let[n,r]=t;return So(n,"end"===r?"keep":e,"start"===r?"keep":e)}))},Mo=(e,t,n,r)=>{null!=t.startBoundElement&&Oo(e,t.startBoundElement,"start");const i=zo(r,n);null==i||Lo(e,i,"end")||Oo(e,i,"end")},Oo=(e,t,n)=>{Rr(e,{["start"===n?"startBinding":"endBinding"]:Object.assign({elementId:t.id},Ro(e,t,n))});un(t.boundElements||[]).has(e.id)||Rr(t,{boundElements:(t.boundElements||[]).concat({id:e.id,type:"arrow"})})},Lo=(e,t,n)=>{const r=e["start"===n?"endBinding":"startBinding"];return Ao(e,null==r?void 0:r.elementId,t)},Ao=(e,t,n)=>t===n.id&&e.points.length<3,Po=e=>{e.forEach((e=>{Te(e)&&So(e,null,null)}))},Do=(e,t)=>{const n="start"===t?"startBinding":"endBinding",r=e[n];return null==r?null:(Rr(e,{[n]:null}),r.elementId)},zo=(e,t)=>Vs(t.getElements(),(t=>Oe(t)&&Ui(t,e))),Ro=(e,t,n)=>{const r="start"===n?-1:1,i=-1===r?0:e.points.length-1,o=i-r,a=_o.getPointAtIndexGlobalCoordinates(e,i),s=_o.getPointAtIndexGlobalCoordinates(e,o);return{focus:oo(t,s,a),gap:Math.max(1,Vi(t,a))}},Ho=(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=Bo(o);Un.getScene(e).getNonDeletedElements(r.map((e=>e.id))).forEach((t=>{if(!Ie(t))return;const n=e;if(!No(t,n))return;const r=Uo(n,t.startBinding,i),o=Uo(n,t.endBinding,i);a.has(t.id)?Rr(t,{startBinding:r,endBinding:o}):(Fo(t,"start",r,e),Fo(t,"end",o,e))}))},No=(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},Bo=e=>new Set((e||[]).map((e=>e.id))),Fo=(e,t,n,r)=>{if(null==n||n.elementId!==r.id&&e.points.length>2)return;const i=Un.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=_o.getPointAtIndexGlobalCoordinates(e,s),c=((e,t,n)=>{if(0===t){const t=Ye(e),n=io(t);return Oi(n)}const r=ro(e),i=Ri(r,Mi(n)),o=bi(r);let a;switch(e.type){case"rectangle":case"image":case"text":case"diamond":a=go(e,t,i);break;case"ellipse":a=po(e,t,i)}return Oi(Ri(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=ro(e),o=Ri(i,Mi(t)),a=Ri(i,Mi(n)),s=ji(o,a),l=bi(i);return ao(e,s,o,r).map((e=>Oi(Ri(l,e))))}(i,l,c,n.gap);d=0===e.length?c:e[0]}_o.movePoints(e,[{index:a,point:_o.pointFromAbsoluteCoords(e,d)}],{["start"===t?"startBinding":"endBinding"]:n})},Uo=(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(Wi(e,a,s),r*(a<s?a/l:s/c))),focus:i}},Wo=e=>[Ko(e,"start"),Ko(e,"end")].filter((e=>null!=e)),Ko=(e,t)=>zo(Vo(e,t),Un.getScene(e)),Vo=(e,t)=>{const n="start"===t?0:-1;return on(_o.getPointAtIndexGlobalCoordinates(e,n))},Go=e=>Un.getScene(e).getElements().map((t=>{if(!Te(t))return null;const n=Yo(t,"start",e),r=Yo(t,"end",e);return n||r?[t,n&&r?"both":n?"start":"end",e]:null})).filter((e=>null!=e)),Yo=(e,t,n)=>null==e["start"===t?"startBinding":"endBinding"]&&!Lo(e,n,t)&&Ui(n,Vo(e,t)),Xo=(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;Rr(e,{startBinding:Zo(t,n),endBinding:Zo(r,n)})})),e.filter((e=>{let{id:t}=e;return o.has(t)})).forEach((e=>{const{boundElements:t}=e;null!=t&&t.length>0&&Rr(e,{boundElements:t.map((e=>n.has(e.id)?{id:n.get(e.id),type:e.type}:e))})}))},Zo=(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}},qo=(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;Rr(e,{startBinding:$o(t,n),endBinding:$o(r,n)})}))},$o=(e,t)=>null==e||t.has(e.elementId)?null:e,Qo=e=>e>=2*Math.PI?e-2*Math.PI:e,Jo=(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=Qo(u),Rr(e,{angle:u});const h=rr(e);if(h){const t=Un.getScene(e).getElement(h);Rr(t,{angle:u})}},ea=(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=Fr(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);Rr(e,{x:m,y:f,points:[[0,0],[p,g]]})},ta=(e,t,n)=>Ie(e)||Ee(e)?{points:Ge(0,t,Ge(1,n,e.points))}:{},na=(e,t,n)=>{const r=e.fontSize*(t/e.width);if(r<1)return null;const i=Gn(e.text,Ut({fontSize:r,fontFamily:e.fontFamily}),e.containerId?e.width:null);return{size:r,baseline:i.baseline+(n-i.height)}},ra=(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=na(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);Rr(e,{fontSize:c.size,width:r,height:i,baseline:c.baseline,x,y})}},ia=(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=ir(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 I=l.width,j=l.height;let T=n.width*_,M=n.height*C;if(i&&(T=2*T-I,M=2*M-j),t){const e=Math.abs(T)/I,t=Math.abs(M)/j;if(1===r.length&&(M*=e,T*=t),2===r.length){const n=Math.max(e,t);T=I*n*Math.sign(T),M=j*n*Math.sign(M)}}if(S){const n=e.get(S.id);if(n&&(E={fontSize:n.fontSize,baseline:n.baseline}),t){const e=na(S,T-2*o.gK,M-2*o.gK);if(null===e)return;E={fontSize:e.size,baseline:e.baseline}}else{const e=er(Ut(S)),t=tr(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=ta(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&&Rr(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)&&(Ho(n,{newSize:{width:K.width,height:K.height}}),Rr(n,K),S&&E&&Rr(S,{fontSize:E.fontSize}),Vn(n,r))},oa=(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=ir(n);let s={};if(a){const e=na(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=na(n,r,i);if(null===e)return null;s={fontSize:e.size,baseline:e.baseline}}const l=Ye(n),u=ta(n,r,i);Ho(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)=>{Rr(e,n[r]);const i=ir(e);i&&(Rr(i,{fontSize:n[r].fontSize,baseline:n[r].baseline}),Vn(e,t))}))}},aa=(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);Rr(t,{x:t.x+(m-h),y:t.y+(f-p),angle:Qo(l+g)});const b=rr(t);if(b){const e=Un.getScene(t).getElement(b);Rr(e,{x:e.x+(m-h),y:e.y+(f-p),angle:Qo(l+g)})}}))},sa=(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;Rr(i,{x:a,y:s})},la=(e,t,n,r,i,o,a,s,l,c,d)=>{l&&(d?s=a/d:(({width:a,height:s}=Fr(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&&Rr(e,{x:u,y:h,width:a,height:s})},ca=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 da=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 ua=(e,t)=>!at[t].includes(e),ha=e=>{const t=(new Option).style;return t.color=e,!!t.color},pa=[["1","2","3","4","5"],["q","w","e","r","t"],["a","s","d","f","g"],["z","x","c","v","b"]].flat(),ga=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&&ua(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?pa[i+15]:pa[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(sn(e)?"":" (".concat(e,")")," — ").concat(a.toUpperCase()),"aria-label":s,"aria-keyshortcuts":pa[i],style:{color:e},ref:r=>{!t&&r&&0===i&&(d.current=r),r&&e===n&&(u.current=r)},onFocus:()=>{r(e)},children:[sn(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(pa.includes(e.key.toLowerCase())&&!Bt(e.target)){var i;const t=pa.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)(ma,{color:n,label:a,onChange:e=>{r(e)},ref:p})]})]})},ma=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=>sn(e)||ha(e)?e:ha("#".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})]})})),fa=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)(ma,{color:n,label:o,onChange:e=>{r(e)}})]}),(0,v.jsx)(i().Suspense,{fallback:"",children:a?(0,v.jsx)(da,{onCloseRequest:e=>e.target!==d.current&&s(!1),children:(0,v.jsx)(ga,{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 ba(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 va(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)(da,Object.assign(Object.assign({onCloseRequest:e=>e.target!==d.current&&c(!1)},u?{right:5.5}:{left:-5.5}),{children:(0,v.jsx)(ba,{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 xa=e=>e===o.C6.LIGHT?it.orange[4]:it.orange[9],ya=e=>e===o.C6.LIGHT?it.white:"#1e1e1e",wa=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})},ka=wa((0,v.jsx)("polyline",{fill:"none",stroke:"currentColor",points:"20 6 9 17 4 12"}),{width:24,height:24}),_a=wa("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}),Ca=wa("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}),Ea=wa("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}),Sa=wa("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}),Ia=wa("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}),ja=wa("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}),Ta=wa("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"),Ma=(wa("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}),wa((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})),Oa=wa("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}),La=wa("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}),Aa=wa("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}),Pa=wa("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"),Da=wa("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"),za=wa("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}),Ra=wa("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}),Ha=wa("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}),Na=(wa("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}),wa("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}),wa((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}),wa((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 wa((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:xa(t),stroke:xa(t),strokeWidth:"2"})]}),{width:24,mirror:!0})}))),Ba=i().memo((e=>{let{theme:t}=e;return wa((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:xa(t),stroke:xa(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})})),Fa=i().memo((e=>{let{theme:t}=e;return wa((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:xa(t),stroke:xa(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),Ua=i().memo((e=>{let{theme:t}=e;return wa((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:xa(t),stroke:xa(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})})),Wa=i().memo((e=>{let{theme:t}=e;return wa((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:xa(t),stroke:xa(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),Ka=i().memo((e=>{let{theme:t}=e;return wa((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:xa(t),stroke:xa(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),Va=i().memo((e=>{let{theme:t}=e;return wa((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:xa(t),stroke:xa(t),strokeWidth:"2"})]}),{width:24})})),Ga=i().memo((e=>{let{theme:t}=e;return wa((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:xa(t),stroke:xa(t),strokeWidth:"2"})]}),{width:24})})),Ya=i().memo((e=>{let{theme:t}=e;return wa((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:xa(t),stroke:xa(t),strokeWidth:"2"})]}),{width:24})})),Xa=i().memo((e=>{let{theme:t}=e;return wa((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:xa(t),stroke:xa(t),strokeWidth:"2"})]}),{width:24})})),Za=i().memo((e=>{let{theme:t}=e;return wa((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:xa(t),stroke:xa(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})})),qa=i().memo((e=>{let{theme:t}=e;return wa((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:xa(t),stroke:xa(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})})),$a=wa("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}),Qa=(wa("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"),wa("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"),wa("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})),Ja=wa("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}),es=wa("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}),ts=(wa("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}),wa("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})),ns=i().memo((e=>{let{theme:t}=e;return wa((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:ya(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})})),rs=i().memo((e=>{let{theme:t}=e;return wa((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:ya(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})})),is=i().memo((e=>{let{theme:t}=e;return wa((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})})),os=i().memo((e=>{let{theme:t}=e;return wa((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})})),as=i().memo((e=>{let{theme:t}=e;return wa((0,v.jsx)("path",{d:"M2 2H38V18H2V2Z",fill:"var(--icon-fill-color)"}),{width:40,height:20})})),ss=i().memo((e=>{let{theme:t,strokeWidth:n}=e;return wa((0,v.jsx)("path",{d:"M6 10H32",stroke:"var(--icon-fill-color)",strokeWidth:n,strokeLinecap:"round",fill:"none"}),{width:40,height:20})})),ls=i().memo((e=>{let{theme:t}=e;return wa((0,v.jsx)("path",{d:"M6 10H34",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none",strokeLinecap:"round"}),{width:40,height:20})})),cs=i().memo((e=>{let{theme:t}=e;return wa((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})})),ds=i().memo((e=>{let{theme:t}=e;return wa((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})})),us=i().memo((e=>{let{theme:t}=e;return wa((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})})),hs=i().memo((e=>{let{theme:t}=e;return wa((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})})),ps=i().memo((e=>{let{theme:t}=e;return wa((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})})),gs=i().memo((e=>{let{theme:t}=e;return wa((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})})),ms=i().memo((e=>{let{theme:t}=e;return wa((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})})),fs=i().memo((e=>{let{theme:t}=e;return wa((0,v.jsx)("path",{d:"M6 10H34",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none"}),{width:40,height:20})})),bs=i().memo((e=>{let{theme:t,flip:n=!1}=e;return wa((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})})),vs=i().memo((e=>{let{theme:t,flip:n=!1}=e;return wa((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})})),xs=i().memo((e=>{let{theme:t,flip:n=!1}=e;return wa((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})})),ys=i().memo((e=>{let{theme:t,flip:n=!1}=e;return wa((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})})),ws=i().memo((e=>{let{theme:t}=e;return wa((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})})),ks=i().memo((e=>{let{theme:t}=e;return wa((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})})),_s=i().memo((e=>{let{theme:t}=e;return wa((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})})),Cs=i().memo((e=>{let{theme:t}=e;return wa((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})})),Es=i().memo((e=>{let{theme:t}=e;return wa((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})})),Ss=i().memo((e=>{let{theme:t}=e;return wa((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})})),Is=i().memo((e=>{let{theme:t}=e;return wa((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})})),js=i().memo((e=>{let{theme:t}=e;return wa((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})})),Ts=i().memo((e=>{let{theme:t}=e;return wa((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})})),Ms=i().memo((e=>{let{theme:t}=e;return wa((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})})),Os=i().memo((e=>{let{theme:t}=e;return wa((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})})),Ls=i().memo((e=>{let{theme:t}=e;return wa((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})})),As=i().memo((e=>{let{theme:t}=e;return wa((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})})),Ps=wa((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}),Ds=wa((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}),zs=wa((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"})),Rs=wa("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"),Hs=e=>"rectangle"===e||"ellipse"===e||"diamond"===e||"line"===e||"freedraw"===e,Ns=e=>"image"!==e,Bs=e=>"rectangle"===e||"ellipse"===e||"diamond"===e||"freedraw"===e||"arrow"===e||"line"===e,Fs=e=>"rectangle"===e||"ellipse"===e||"diamond"===e||"arrow"===e||"line"===e,Us=e=>"rectangle"===e||"arrow"===e||"line"===e||"diamond"===e,Ws=e=>"text"===e,Ks=e=>"arrow"===e,Vs=(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},Gs=(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 Ys=[];const Xs=e=>(Ys=Ys.concat(e),e),Zs=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=un(Rl(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}))},qs=function(e,t,n,r){var i,o;const a=t.editingElement,s=Tl(e);return null!==(i=null!==(o=a&&n(a))&&void 0!==o?o:Dl(s,t)?zl(s,t,n):r)&&void 0!==i?i:null},$s=(e,t,n,r)=>{const i=new Set;return{elements:Zs(e,t,(e=>{if(Ce(e)){const o=n(e);i.add(o);let a=Hr(e,{fontSize:o});return Wn(a,or(e)),t=e,a=Pe(r=a)?r:Rr(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}},Qs=(Xs({name:"changeStrokeColor",perform:(e,t,n)=>Object.assign(Object.assign({},n.currentItemStrokeColor&&{elements:Zs(e,t,(e=>Ns(e.type)?Hr(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)(fa,{type:"elementStroke",label:b("labels.stroke"),color:qs(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})]})}}),Xs({name:"changeBackgroundColor",perform:(e,t,n)=>Object.assign(Object.assign({},n.currentItemBackgroundColor&&{elements:Zs(e,t,(e=>Hr(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)(fa,{type:"elementBackground",label:b("labels.background"),color:qs(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})]})}}),Xs({name:"changeFillStyle",perform:(e,t,n)=>({elements:Zs(e,t,(e=>Hr(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)(ca,{options:[{value:"hachure",text:b("labels.hachure"),icon:(0,v.jsx)(is,{theme:n.theme})},{value:"cross-hatch",text:b("labels.crossHatch"),icon:(0,v.jsx)(os,{theme:n.theme})},{value:"solid",text:b("labels.solid"),icon:(0,v.jsx)(as,{theme:n.theme})}],group:"fill",value:qs(t,n,(e=>e.fillStyle),n.currentItemFillStyle),onChange:e=>{r(e)}})]})}}),Xs({name:"changeStrokeWidth",perform:(e,t,n)=>({elements:Zs(e,t,(e=>Hr(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)(ca,{group:"stroke-width",options:[{value:1,text:b("labels.thin"),icon:(0,v.jsx)(ss,{theme:n.theme,strokeWidth:2})},{value:2,text:b("labels.bold"),icon:(0,v.jsx)(ss,{theme:n.theme,strokeWidth:6})},{value:4,text:b("labels.extraBold"),icon:(0,v.jsx)(ss,{theme:n.theme,strokeWidth:10})}],value:qs(t,n,(e=>e.strokeWidth),n.currentItemStrokeWidth),onChange:e=>r(e)})]})}}),Xs({name:"changeSloppiness",perform:(e,t,n)=>({elements:Zs(e,t,(e=>Hr(e,{seed:Dr(),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)(ca,{group:"sloppiness",options:[{value:0,text:b("labels.architect"),icon:(0,v.jsx)(us,{theme:n.theme})},{value:1,text:b("labels.artist"),icon:(0,v.jsx)(hs,{theme:n.theme})},{value:2,text:b("labels.cartoonist"),icon:(0,v.jsx)(ps,{theme:n.theme})}],value:qs(t,n,(e=>e.roughness),n.currentItemRoughness),onChange:e=>r(e)})]})}}),Xs({name:"changeStrokeStyle",perform:(e,t,n)=>({elements:Zs(e,t,(e=>Hr(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)(ca,{group:"strokeStyle",options:[{value:"solid",text:b("labels.strokeStyle_solid"),icon:(0,v.jsx)(ls,{theme:n.theme})},{value:"dashed",text:b("labels.strokeStyle_dashed"),icon:(0,v.jsx)(cs,{theme:n.theme})},{value:"dotted",text:b("labels.strokeStyle_dotted"),icon:(0,v.jsx)(ds,{theme:n.theme})}],value:qs(t,n,(e=>e.strokeStyle),n.currentItemStrokeStyle),onChange:e=>r(e)})]})}}),Xs({name:"changeOpacity",perform:(e,t,n)=>({elements:Zs(e,t,(e=>Hr(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=qs(n,r,(e=>e.opacity),r.currentItemOpacity))&&void 0!==t?t:void 0})]})}}),Xs({name:"changeFontSize",perform:(e,t,n)=>$s(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)(ca,{group:"font-size",options:[{value:16,text:b("labels.small"),icon:(0,v.jsx)(ws,{theme:n.theme}),testId:"fontSize-small"},{value:20,text:b("labels.medium"),icon:(0,v.jsx)(ks,{theme:n.theme}),testId:"fontSize-medium"},{value:28,text:b("labels.large"),icon:(0,v.jsx)(_s,{theme:n.theme}),testId:"fontSize-large"},{value:36,text:b("labels.veryLarge"),icon:(0,v.jsx)(Cs,{theme:n.theme}),testId:"fontSize-veryLarge"}],value:qs(t,n,(e=>{if(Ce(e))return e.fontSize;const t=ir(e);return t?t.fontSize:null}),n.currentItemFontSize||o.n5),onChange:e=>r(e)})]})}}),Xs({name:"decreaseFontSize",perform:(e,t,n)=>$s(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)})),Js=Xs({name:"increaseFontSize",perform:(e,t,n)=>$s(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)});Xs({name:"changeFontFamily",perform:(e,t,n)=>({elements:Zs(e,t,(e=>{if(Ce(e)){const t=Hr(e,{fontFamily:n});return Wn(t,or(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)(Es,{theme:n.theme})},{value:o.ut.Helvetica,text:b("labels.normal"),icon:(0,v.jsx)(Ss,{theme:n.theme})},{value:o.ut.Cascadia,text:b("labels.code"),icon:(0,v.jsx)(Is,{theme:n.theme})}];return(0,v.jsxs)("fieldset",{children:[(0,v.jsx)("legend",{children:b("labels.fontFamily")}),(0,v.jsx)(ca,{group:"font-family",options:i,value:qs(t,n,(e=>{if(Ce(e))return e.fontFamily;const t=ir(e);return t?t.fontFamily:null}),n.currentItemFontFamily||o.rk),onChange:e=>r(e)})]})}}),Xs({name:"changeTextAlign",perform:(e,t,n)=>({elements:Zs(e,t,(e=>{if(Ce(e)){const t=Hr(e,{textAlign:n});return Wn(t,or(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)(ca,{group:"text-align",options:[{value:"left",text:b("labels.left"),icon:(0,v.jsx)(js,{theme:n.theme})},{value:"center",text:b("labels.center"),icon:(0,v.jsx)(Ts,{theme:n.theme})},{value:"right",text:b("labels.right"),icon:(0,v.jsx)(Ms,{theme:n.theme})}],value:qs(t,n,(e=>{if(Ce(e))return e.textAlign;const t=ir(e);return t?t.textAlign:null}),n.currentItemTextAlign),onChange:e=>r(e)})]})}}),Xs({name:"changeVerticalAlign",perform:(e,t,n)=>({elements:Zs(e,t,(e=>{if(Ce(e)){const t=Hr(e,{verticalAlign:n});return Wn(t,or(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)(ca,{group:"text-align",options:[{value:o.oX.TOP,text:b("labels.alignTop"),icon:(0,v.jsx)(Os,{theme:n.theme})},{value:o.oX.MIDDLE,text:b("labels.centerVertically"),icon:(0,v.jsx)(As,{theme:n.theme})},{value:o.oX.BOTTOM,text:b("labels.alignBottom"),icon:(0,v.jsx)(Ls,{theme:n.theme})}],value:qs(t,n,(e=>{if(Ce(e)&&e.containerId)return e.verticalAlign;const t=ir(e);return t?t.verticalAlign:null})),onChange:e=>r(e)})})}}),Xs({name:"changeSharpness",perform:(e,t,n)=>{const r=Hl(Tl(e),t),i=r.length?r.every((e=>!Ie(e))):!je(t.activeTool.type),o=r.length?r.every(Ie):je(t.activeTool.type);return{elements:Zs(e,t,(e=>Hr(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)(ca,{group:"edges",options:[{value:"sharp",text:b("labels.sharp"),icon:(0,v.jsx)(gs,{theme:n.theme})},{value:"round",text:b("labels.round"),icon:(0,v.jsx)(ms,{theme:n.theme})}],value:qs(t,n,(e=>e.strokeSharpness),Us(n.activeTool.type)&&(je(n.activeTool.type)?n.currentItemLinearStrokeSharpness:n.currentItemStrokeSharpness)||null),onChange:e=>r(e)})]})}}),Xs({name:"changeArrowhead",perform:(e,t,n)=>({elements:Zs(e,t,(e=>{if(Ie(e)){const{position:t,type:r}=n;if("start"===t){return Hr(e,{startArrowhead:r})}if("end"===t){return Hr(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)(va,{label:"arrowhead_start",options:[{value:null,text:b("labels.arrowhead_none"),icon:(0,v.jsx)(fs,{theme:n.theme}),keyBinding:"q"},{value:"arrow",text:b("labels.arrowhead_arrow"),icon:(0,v.jsx)(bs,{theme:n.theme,flip:!i}),keyBinding:"w"},{value:"bar",text:b("labels.arrowhead_bar"),icon:(0,v.jsx)(xs,{theme:n.theme,flip:!i}),keyBinding:"e"},{value:"dot",text:b("labels.arrowhead_dot"),icon:(0,v.jsx)(vs,{theme:n.theme,flip:!i}),keyBinding:"r"},{value:"triangle",text:b("labels.arrowhead_triangle"),icon:(0,v.jsx)(ys,{theme:n.theme,flip:!i}),keyBinding:"t"}],value:qs(t,n,(e=>Ie(e)&&Ks(e.type)?e.startArrowhead:n.currentItemStartArrowhead),n.currentItemStartArrowhead),onChange:e=>r({position:"start",type:e})}),(0,v.jsx)(va,{label:"arrowhead_end",group:"arrowheads",options:[{value:null,text:b("labels.arrowhead_none"),keyBinding:"q",icon:(0,v.jsx)(fs,{theme:n.theme})},{value:"arrow",text:b("labels.arrowhead_arrow"),keyBinding:"w",icon:(0,v.jsx)(bs,{theme:n.theme,flip:i})},{value:"bar",text:b("labels.arrowhead_bar"),keyBinding:"e",icon:(0,v.jsx)(xs,{theme:n.theme,flip:i})},{value:"dot",text:b("labels.arrowhead_dot"),keyBinding:"r",icon:(0,v.jsx)(vs,{theme:n.theme,flip:i})},{value:"triangle",text:b("labels.arrowhead_triangle"),icon:(0,v.jsx)(ys,{theme:n.theme,flip:i}),keyBinding:"t"}],value:qs(t,n,(e=>Ie(e)&&Ks(e.type)?e.endArrowhead:n.currentItemEndArrowhead),n.currentItemEndArrowhead),onChange:e=>r({position:"end",type:e})})]})]})}});n(5422);class el 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 tl extends DOMException{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Request Aborted","AbortError")}}n(371);const nl=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"})})})},rl=i().forwardRef(((e,t)=>{const{id:n}=xp(),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 tl))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)(nl,{})]}),e.showAriaLabel&&(0,v.jsxs)("div",{className:"ToolIcon__label",children:[e["aria-label"]," ",s&&(0,v.jsx)(nl,{})]}),e.children]})}return(0,v.jsxs)("label",{className:ye("ToolIcon",e.className),title:e.title,onPointerDown:t=>{var n;u.current=t.pointerType||null,null===(n=e.onPointerDown)||void 0===n||n.call(e,{pointerType:t.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})]})]})}));rl.defaultProps={visible:!0,className:"",size:"medium"};const il=e=>{const t=e.title||("dark"===e.value?b("buttons.lightMode"):b("buttons.darkMode"));return(0,v.jsx)(rl,{type:"icon",icon:e.value===o.C6.LIGHT?ol.MOON:ol.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"})},ol={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"})})},al=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}},sl=(e,t,n)=>{if(!(e=jl(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}=en({sceneX:r,sceneY:i},e),{x:c,y:d}=en({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,Jt({clientX:t.scrollX,clientY:t.scrollY},t)));return al({scenePoint:{x:(r+o)/2,y:(i+a)/2},viewportDimensions:{width:t.width,height:t.height},zoom:t.zoom})},ll=e=>Math.max(.1,Math.min(e,30)),cl=(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 dl=()=>{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},ul=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")})},hl=e=>{let{children:t,label:n,long:i=!1,style:o}=e;return(0,r.useEffect)((()=>()=>dl().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();ul(t,i)})(e.currentTarget,dl(),n,i),onPointerLeave:()=>dl().classList.remove("excalidraw-tooltip--visible"),style:o,children:t})};n(196),n(1106);const pl=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 gl=e=>{const{theme:t=o.C6.LIGHT,closeOnClickOutside:n=!0}=e,r=ml(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)},ml=e=>{const[t,n]=(0,r.useState)(null),i=bp(),o=(0,r.useRef)(i.isMobile);o.current=i.isMobile;const{container:a}=xp();return(0,r.useLayoutEffect)((()=>{t&&t.classList.toggle("excalidraw--mobile",i.isMobile)}),[t,i.isMobile]),(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},fl=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}=xp();(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)(gl,{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)(pl,{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:bp().isMobile?Ja:Qa})]}),(0,v.jsx)("div",{className:"Dialog__content",children:e.children})]})})};n(4678);var bl=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 vl=e=>{const{onConfirm:t,onCancel:n,children:r,confirmText:i=b("buttons.confirm"),cancelText:o=b("buttons.cancel"),className:a=""}=e,s=bl(e,["onConfirm","onCancel","children","confirmText","cancelText","className"]);return(0,v.jsxs)(fl,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)(rl,{type:"button",title:o,"aria-label":o,label:o,onClick:n,className:"confirm-dialog--cancel"}),(0,v.jsx)(rl,{type:"button",title:i,"aria-label":i,label:i,onClick:t,className:"confirm-dialog--confirm"})]})]}))},xl=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)(rl,{type:"button",icon:ja,title:b("buttons.clearReset"),"aria-label":b("buttons.clearReset"),showAriaLabel:bp().isMobile,onClick:o,"data-testid":"clear-canvas-button"}),n&&(0,v.jsx)(vl,{onConfirm:()=>{t(),o()},onCancel:o,title:b("clearCanvasDialog.title"),children:(0,v.jsxs)("p",{className:"clear-canvas__content",children:[" ",b("alerts.clearReset")]})})]})},yl=(Xs({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)(fa,{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})})}}),Xs({name:"clearCanvas",perform:(e,t,n,r)=>(r.imageCache.clear(),{elements:e.map((e=>Hr(e,{isDeleted:!0}))),appState:Object.assign(Object.assign({},fn()),{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,activeTool:"image"===t.activeTool.type?{type:"selection"}:t.activeTool}),commitToHistory:!0}),PanelComponent:e=>{let{updateData:t}=e;return(0,v.jsx)(xl,{onConfirm:t})}}),Xs({name:"zoomIn",perform:(e,t,n,r)=>({appState:Object.assign(Object.assign({},t),cl({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:ll(t.zoom.value+o.V4)},t)),commitToHistory:!1}),PanelComponent:e=>{let{updateData:t}=e;return(0,v.jsx)(rl,{type:"button",icon:La,title:"".concat(b("buttons.zoomIn")," — ").concat(Qt("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)})),wl=Xs({name:"zoomOut",perform:(e,t,n,r)=>({appState:Object.assign(Object.assign({},t),cl({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:ll(t.zoom.value-o.V4)},t)),commitToHistory:!1}),PanelComponent:e=>{let{updateData:t}=e;return(0,v.jsx)(rl,{type:"button",icon:Aa,title:"".concat(b("buttons.zoomOut")," — ").concat(Qt("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)}),kl=(Xs({name:"resetZoom",perform:(e,t,n,r)=>({appState:Object.assign(Object.assign({},t),cl({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:ll(1)},t)),commitToHistory:!1}),PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,v.jsx)(hl,{label:b("buttons.resetZoom"),style:{height:"100%"},children:(0,v.jsxs)(rl,{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)}),_l=(e,t,n)=>{const r=Tl(e),i=Rl(r,t),o=n&&i.length>0?et(i):et(r),a={value:kl(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),al({scenePoint:{x:u,y:h},viewportDimensions:{width:t.width,height:t.height},zoom:a})),{zoom:a}),commitToHistory:!1}},Cl=(Xs({name:"zoomToSelection",perform:(e,t)=>_l(e,t,!0),keyTest:e=>e.code===xt&&e.shiftKey&&!e.altKey&&!e[Lt.CTRL_OR_CMD]}),Xs({name:"zoomToFit",perform:(e,t)=>_l(e,t,!1),keyTest:e=>e.code===vt&&e.shiftKey&&!e.altKey&&!e[Lt.CTRL_OR_CMD]}),Xs({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)(il,{value:t.theme,onChange:e=>{n(e)}})})},keyTest:e=>e.altKey&&e.shiftKey&&e.code===Ct}),Xs({name:"eraser",perform:(e,t)=>({appState:Object.assign(Object.assign({},t),{selectedElementIds:{},selectedGroupIds:{},activeTool:{type:kn(t)?"selection":"eraser"}}),commitToHistory:!0}),keyTest:e=>e.key===Lt.E,PanelComponent:e=>{let{elements:t,appState:n,updateData:r,data:i}=e;return(0,v.jsx)(rl,{type:"button",icon:zs,className:ye("eraser",{active:kn(n)}),title:"".concat(b("toolBar.eraser"),"-").concat(Qt("E")),"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)")}),El=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=Un.getScene(a))||void 0===e?void 0:e.getElement(t),{textAlign:s,verticalAlign:l}=r,u=Zn(Ut(r));if(r&&Ce(r)){let e=r.x,t=r.y;const a=or(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 Rr(a,{height:a.height+e})}if(a.height>d&&m<p){const e=Math.min(p-m,u);Rr(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:Cl(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")}),hn()&&(h.style.fontFamily=Ft(r)),Rr(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=Un.getScene(a))||void 0===e?void 0:e.getElement(t),i=Ut(r),o=h.scrollHeight/Zn(i);if(Pe(a)&&o>1){let e="auto";if(2===o){const t=or(a);1===Qn(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&&yl.keyTest(e))e.preventDefault(),c.actionManager.executeAction(yl),u();else if(!e.shiftKey&&wl.keyTest(e))e.preventDefault(),c.actionManager.executeAction(wl),u();else if(Qs.keyTest(e))c.actionManager.executeAction(Qs);else if(Js.keyTest(e))c.actionManager.executeAction(Js);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=Un.getScene(a))||void 0===e?void 0:e.getElement(a.id);if(!t)return;let n=h.value;const i=or(t);if(i)if(n=t.text,h.value){const e=rr(i);e&&e===a.id||Rr(i,{boundElements:(i.boundElements||[]).concat({type:"text",id:a.id})})}else{var o;Rr(i,{boundElements:null===(o=i.boundElements)||void 0===o?void 0:o.filter((e=>!Ce(e)))})}r({text:n,viaKeyboard:w,originalText:h.value})},_=()=>{I||(I=!0,h.onblur=null,h.oninput=null,h.onkeydown=null,j&&j.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=Un.getScene(a).addCallback((()=>{var e;u();!(null===(e=document.activeElement)||void 0===e||!e.closest(".color-picker-input"))||h.focus()}));let I=!1;h.select(),C();let j=null;s&&"ResizeObserver"in window?(j=new window.ResizeObserver((()=>{u()})),j.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)},Sl=(e,t)=>Boolean(!e.viewModeEnabled&&(e.editingElement||Rl(t,e).length||"selection"!==e.activeTool.type&&"eraser"!==e.activeTool.type)),Il=e=>e.reduce(((e,t)=>e+t.version),0),jl=e=>e.filter((e=>!e.isDeleted&&!Br(e))),Tl=e=>e.filter((e=>!e.isDeleted)),Ml=e=>!e.isDeleted,Ol=e=>Tl(e).map((e=>je(e.type)?Object.assign(Object.assign({},e),{lastCommittedPoint:null}):e)),Ll=e=>Ol(e),Al=e=>Ol(e),Pl=(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}},Dl=(e,t)=>e.some((e=>t.selectedElementIds[e.id])),zl=(e,t,n)=>{const r=Array.from(new Set(Rl(e,t).map((e=>n(e)))));return 1===r.length?r[0]:null},Rl=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))},Hl=(e,t)=>t.editingElement?[t.editingElement]:Rl(e,t,!0),Nl=(e,t)=>{if(e.editingGroupId){const n=Zr(Tl(t),e.editingGroupId);if(n.length)return Object.assign(Object.assign({},e),{selectedElementIds:{[n[0].id]:!0}})}return e},Bl=Xs({name:"deleteSelectedElements",perform:(e,t)=>{if(t.editingLinearElement){const{elementId:n,selectedPointsIndices:r,startBindingElement:i,endBindingElement:o}=t.editingLinearElement,a=_o.getElement(n);if(!a)return!1;if(null==r||a.points.length<2){const n=e.filter((e=>e.id!==a.id)),r=Nl(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 _o.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]?Hr(e,{isDeleted:!0}):e)),appState:Object.assign(Object.assign({},t),{selectedElementIds:{}})}))(e,t);return qo(n,e.filter((e=>{let{id:n}=e;return t.selectedElementIds[n]}))),r=Nl(r,n),{elements:n,appState:Object.assign(Object.assign({},r),{activeTool:{type:"selection"},multiElement:null}),commitToHistory:Dl(Tl(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)(rl,{type:"button",icon:ja,title:b("labels.delete"),"aria-label":b("labels.delete"),onClick:()=>r(null),visible:Dl(Tl(t),n)})}}),Fl=(e,t)=>{let n=[],r=[],i=null,o=-1;const a=un(Rl(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},Ul=(e,t,n)=>{if("containerId"in e&&e.containerId){if("left"!==n)return t.indexOf(e);{const n=Un.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=Un.getScene(e).getElement(o);if(r)return t.indexOf(r)}}},Wl=(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=Ul(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=Ul(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=Zr(t,d);return u.length?"left"===r?t.indexOf(u[0]):t.indexOf(u[u.length-1]):a},Kl=(e,t)=>t.reduce(((t,n)=>{const r=e[n];return t[r.id]=r,t}),{}),Vl=(e,t,n)=>{const r=Fl(t,e),i=Kl(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=Wl(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]?Nr(e):e))},Gl=(e,t,n)=>{const r=Fl(e,t),i=Kl(e,r),o=[];let a,s;if("left"===n){if(t.editingGroupId){const n=Zr(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=Zr(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=>Nr(e))),c=e.slice(0,a),d=e.slice(s+1);return"left"===n?[...c,...l,...o,...d]:[...c,...o,...l,...d]},Yl=(e,t)=>Vl(t,e,"left"),Xl=(e,t)=>Vl(t,e,"right"),Zl=(e,t)=>Gl(e,t,"left"),ql=(e,t)=>Gl(e,t,"right"),$l=Xs({name:"sendBackward",perform:(e,t)=>({elements:Yl(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(Qt("CtrlOrCmd+[")),children:(0,v.jsx)(Ba,{theme:n.theme})})}}),Ql=Xs({name:"bringForward",perform:(e,t)=>({elements:Xl(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(Qt("CtrlOrCmd+]")),children:(0,v.jsx)(Na,{theme:n.theme})})}}),Jl=Xs({name:"sendToBack",perform:(e,t)=>({elements:Zl(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(Qt(lt?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")),children:(0,v.jsx)(Ua,{theme:n.theme})})}}),ec=Xs({name:"bringToFront",perform:(e,t)=>({elements:ql(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(Qt(lt?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")),children:(0,v.jsx)(Fa,{theme:n.theme})})}}),tc=Xs({name:"selectAll",perform:(e,t)=>!t.editingLinearElement&&{appState:Yr(Object.assign(Object.assign({},t),{editingGroupId:null,selectedElementIds:e.reduce(((e,t)=>(t.isDeleted||Ce(t)&&t.containerId||(e[t.id]=!0),e)),{})}),Tl(e)),commitToHistory:!0},contextItemLabel:"labels.selectAll",keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.key===Lt.A}),nc=Xs({name:"duplicateSelection",perform:(e,t)=>{if(t.editingLinearElement){const n=_o.duplicateSelectedPoints(t);return!!n&&{elements:e,appState:n.appState,commitToHistory:!0}}return Object.assign(Object.assign({},rc(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)(rl,{type:"button",icon:es,title:"".concat(b("labels.duplicateSelection")," — ").concat(Qt("CtrlOrCmd+D")),"aria-label":b("labels.duplicateSelection"),onClick:()=>r(null),visible:Dl(Tl(t),n)})}}),rc=(e,t)=>{const n=new Map,r=[],i=[],a=new Map,s=e=>{const s=ai(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=un(Rl(e,t,!0));for(;c<e.length;){const n=e[c];if(d.get(n.id)){if(n.groupIds.length){const r=Vr(t,n);if(r){const t=Zr(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 Kn(l,i,a),Xo(l,i,a),{elements:l,appState:Yr(Object.assign(Object.assign({},t),{selectedGroupIds:{},selectedElementIds:r.reduce(((e,t)=>(Pe(t)||(e[t.id]=!0),e)),{})}),Tl(l))}},ic=Xs({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=_o.getElement(n);if(o)return Te(o)&&So(o,r,i),{elements:o.points.length<2||Br(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&&Rr(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||Rr(l,{points:l.points.slice(0,-1)})}Br(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];Rr(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]=_o.getPointAtIndexGlobalCoordinates(l,-1);Mo(l,t,Un.getScene(l),{x:e,y:n})}t.elementLocked||"freedraw"===t.activeTool.type||(t.selectedElementIds[l.id]=!0)}return(t.elementLocked||"freedraw"===t.activeTool.type)&&l||Vt(o),{elements:s,appState:Object.assign(Object.assign({},t),{activeTool:(t.elementLocked||"freedraw"===t.activeTool.type)&&l?t.activeTool:{type:"selection"},draggingElement:null,multiElement:null,editingElement:null,startBoundElement:null,suggestedBindings:[],selectedElementIds:l&&!t.elementLocked&&"freedraw"!==t.activeTool.type?Object.assign(Object.assign({},t.selectedElementIds),{[l.id]:!0}):t.selectedElementIds,pendingImageElement:null}),commitToHistory:"freedraw"===t.activeTool.type}},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,data:r}=e;return(0,v.jsx)(rl,{type:"button",icon:Pa,title:b("buttons.done"),"aria-label":b("buttons.done"),onClick:n,visible:null!=t.multiElement,size:(null==r?void 0:r.size)||"medium"})}});var oc,ac;const sc="undefined"!=typeof process&&null!==(oc={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!==oc&&oc.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!==(ac={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!==ac&&ac.JEST_WORKER_ID,(e,t,n,r)=>{});n(518),n(9966);const lc=e=>{const{id:t}=xp(),[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})]})},cc=(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 dc;!function(e){e.ACTIVE="active",e.AWAY="away",e.IDLE="idle"}(dc||(dc={}));n(4404);const uc=document.createElement("img");uc.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 hc=!1;const pc=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=mc(d.current.value);!t.link&&e&&sc("hyperlink","create"),Rr(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);_c(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)((()=>{sc("hyperlink","delete"),Rr(t,{link:null}),u&&(d.current.value=""),i({showHyperlinkPopup:!1})}),[i,t,u]),{x:g,y:m}=gc(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:fc(t.link)?"_self":"_blank",onClick:e=>{if(t.link&&a){const n=pn(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)(rl,{type:"button",title:b("buttons.edit"),"aria-label":b("buttons.edit"),label:b("buttons.edit"),onClick:()=>{sc("hyperlink","edit","popup-ui"),i({showHyperlinkPopup:"editor"})},className:"excalidraw-hyperlinkContainer--edit",icon:Ds}),s&&(0,v.jsx)(rl,{type:"button",title:b("buttons.remove"),"aria-label":b("buttons.remove"),label:b("buttons.remove"),onClick:p,className:"excalidraw-hyperlinkContainer--remove",icon:ja})]})]})},gc=(e,t)=>{const[n,r]=Ye(e),{x:i,y:o}=en({sceneX:n+e.width/2,sceneY:r},t);return{x:i-t.offsetLeft-160,y:o-t.offsetTop-85}},mc=e=>((e=e.trim())&&(e.includes("://")||/^[[\\/]/.test(e)||(e="https://".concat(e))),e),fc=e=>!!(null!=e&&e.includes(location.origin)||null!=e&&e.startsWith("/")),bc=Xs({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)=>{sc("hyperlink","edit",t)},keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.key===Lt.K,contextItemLabel:(e,t)=>vc(e,t),contextItemPredicate:(e,t)=>1===Rl(e,t).length,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;const i=Rl(t,n);return(0,v.jsx)(rl,{type:"button",icon:_a,"aria-label":b(vc(t,n)),title:"".concat(b("labels.link.label")," - ").concat(Qt("CtrlOrCmd+K")),onClick:()=>r(null),selected:1===i.length&&!!i[0].link})}}),vc=(e,t)=>Rl(e,t)[0].link?"labels.link.edit":"labels.link.create",xc=(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]},yc=(e,t,n,r)=>{let[i,o]=n;if(!e.link||t.selectedElementIds[e.id])return!1;const a=4/t.zoom.value;if(!r&&t.viewModeEnabled&&Fi(e,[i,o],a))return!0;const[s,l,c,d]=Ye(e),[u,h,p,g]=xc([s,l,c,d],e.angle,t);return i>u-a&&i<u+a+p&&o>h-a&&o<h+g+a};let wc=null;const kc=(e,t)=>{if(!e.link)return;const n=dl();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]=xc([r,i,o,a],e.angle,t),u=en({sceneX:s,sceneY:l},t);ul(n,{left:u.x,top:u.y,width:c,height:d},"top"),sc("hyperlink","tooltip","link-icon"),hc=!0},_c=(e,t,n)=>{let[r,i]=n;const{x:o,y:a}=Jt({clientX:r,clientY:i},t),s=15/t.zoom.value;if(Fi(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}=gc(e,t);return!(r>=u-s&&r<=u+320+10+s&&i>=h-s&&i<=h+s+10+42)},Cc=(()=>{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]})(),Ec=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()},Sc=(e,t,n,r)=>{e.beginPath(),e.arc(t,n,r,0,2*Math.PI),e.fill(),e.stroke()},Ic=(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=>Dc(e,p,g,{zoom:s.zoom,offsetLeft:t.offsetLeft,offsetTop:t.offsetTop,scrollX:s.scrollX,scrollY:s.scrollY})));if(f.forEach((e=>{try{Er(e,i,h,s),u||Pc(e,h,t)}catch(e){console.error(e)}})),t.editingLinearElement){const e=_o.getElement(t.editingLinearElement.elementId);e&&((e,t,n,r)=>{e.save(),e.translate(n.scrollX,n.scrollY),e.lineWidth=1/n.zoom.value,_o.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}=_o;Sc(e,r[0],r[1],s/2/n.zoom.value)})),e.restore()})(h,t,s,e)}if(n)try{Er(n,i,h,s)}catch(e){console.error(e)}if(Eo(t)&&t.suggestedBindings.filter((e=>null!=e)).forEach((e=>{Mc(h,s,e)})),c&&!t.multiElement&&!t.editingLinearElement){const n=e.reduce(((e,n)=>{const r=[];if(t.selectedElementIds[n.id]&&!Kr(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}=cc(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=Zr(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 Gr(t))r(e);t.editingGroupId&&r(t.editingGroupId),n.forEach((e=>Tc(h,s,e)));const i=Rl(e,t);if(h.save(),h.translate(s.scrollX,s.scrollY),1===i.length){h.fillStyle=it.white;const e=gi(i[0],s.zoom,"mouse");t.viewModeEnabled||jc(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,Ec(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=pi([t,n,r,o],0,s.zoom,"mouse",li);jc(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}=cc(l||e,t);h.save(),h.strokeStyle=d,h.fillStyle=c;const u=s.remotePointerUserStates[e];(a||u===dc.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===dc.AWAY?f=Cc?"⚫️":" (".concat(dc.AWAY,")"):u===dc.IDLE?f=Cc?"💤":" (".concat(dc.IDLE,")"):u===dc.ACTIVE&&(f=Cc?"🟢":"");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(tn("sat")),bottom:parseInt(tn("sab")),left:parseInt(tn("sal")),right:parseInt(tn("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}},jc=(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?Sc(e,o[0]+o[2]/2,o[1]+o[3]/2,o[2]/2):Ec(e,o[0],o[1],o[2],o[3],o[0]+o[2]/2,o[1]+o[3]/2,r,!0),e.restore())}))},Tc=(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,Ec(e,i-u,o-u,c+2*u,d+2*u,i+c/2,o+d/2,r);e.restore()},Mc=(e,t,n)=>{const r=Array.isArray(n)?Lc:Oc;e.save(),e.translate(t.scrollX,t.scrollY),r(e,n),e.restore()},Oc=(e,t)=>{const[n,r,i,o]=Ye(t),a=i-n,s=o-r,l=Wi(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":Ec(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)}},Lc=(e,t)=>{const[n,r,i]=t,o=Wi(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]=_o.getPointAtIndexGlobalCoordinates(n,t);Sc(e,r,i,o)}))};let Ac;const Pc=(e,t,n)=>{if(e.link&&!n.selectedElementIds[e.id]){const[r,i,o,a]=Ye(e),[s,l,c,d]=xc([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),Ac&&Ac.zoom===n.zoom.value)t.drawImage(Ac,s-u,l-h,c,d);else{Ac=document.createElement("canvas"),Ac.zoom=n.zoom.value,Ac.width=c*window.devicePixelRatio*n.zoom.value,Ac.height=d*window.devicePixelRatio*n.zoom.value;const e=Ac.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(uc,0,0,c,d),e.restore(),t.drawImage(Ac,s-u,l-h,c,d)}t.restore()}},Dc=(e,t,n,r)=>{const[i,o,a,s]=Je(e),l=Jt({clientX:r.offsetLeft,clientY:r.offsetTop},r),c=Jt({clientX:r.offsetLeft+t,clientY:r.offsetTop+n},r);return l.x<=a&&l.y<=s&&c.x>=i&&c.y>=o};var zc=Object.defineProperty,Rc=(e,t)=>()=>(e&&(t=e(e=0)),t),Hc=(e,t)=>{for(var n in(e=>{zc(e,"__esModule",{value:!0})})(e),t)zc(e,n,{get:t[n],enumerable:!0})},Nc={};Hc(Nc,{default:()=>Bc});var Bc,Fc=Rc((()=>{Bc=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()})))})),Uc={};Hc(Uc,{default:()=>Kc});var Wc,Kc,Vc=Rc((()=>{Wc=async e=>{let t=await e.getFile();return t.handle=e,t},Kc=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(Wc));return e[0].multiple?r:r[0]}})),Gc={};Hc(Gc,{default:()=>Yc});var Yc,Xc=Rc((()=>{Yc=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()})))})),Zc={};Hc(Zc,{default:()=>$c});var qc,$c,Qc=Rc((()=>{qc=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(qc(a,t,s,r))}return[...(await Promise.all(i)).flat(),...await Promise.all(o)]},$c=async(e={})=>{e.recursive=e.recursive||!1;let t=await window.showDirectoryPicker({id:e.id,startIn:e.startIn});return qc(t,e.recursive,void 0,e.skipDirectory)}})),Jc={};Hc(Jc,{default:()=>ed});var ed,td=Rc((()=>{ed=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}})),nd={};Hc(nd,{default:()=>rd});var rd,id=Rc((()=>{rd=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)}})),od=(()=>{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})(),ad=od?Promise.resolve().then((()=>(Vc(),Uc))):Promise.resolve().then((()=>(Fc(),Nc)));od?Promise.resolve().then((()=>(Qc(),Zc))):Promise.resolve().then((()=>(Xc(),Gc)));var sd=od?Promise.resolve().then((()=>(id(),nd))):Promise.resolve().then((()=>(td(),Jc)));const ld=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 ad).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 tl))}}})},cd=(e,t)=>async function(...e){return(await sd).default(...e)}(e,{fileName:"".concat(t.name,".").concat(t.extension),description:t.description,extensions:[".".concat(t.extension)]},t.fileHandle),dd={selection:!0,text:!0,rectangle:!0,diamond:!0,ellipse:!0,line:!0,image:!0,arrow:!0,freedraw:!0,eraser:!1},ud=(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||zr(),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:je(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:dn(),link:null!==(m=e.link)&&void 0!==m?m:null};return Object.assign(Object.assign(Object.assign({},f),Ur(f)),t)},hd=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 ud(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 ud(e,{points:e.points,lastCommittedPoint:null,simulatePressure:e.simulatePressure,pressures:e.pressures});case"image":return ud(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}=_o.getNormalizedPoints(e)),ud(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 ud(e,{})}},pd=(e,t)=>{const n=t?un(t):null;return(e||[]).reduce(((e,t)=>{if("selection"!==t.type&&!Br(t)){let r=hd(t);if(r){const i=null==n?void 0:n.get(t.id);i&&i.version>r.version&&(r=Nr(r,i.version)),e.push(r)}}return e}),[])},gd=(e,t)=>{e=e||{};const n=fn(),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),{activeTool:dd[r.activeTool.type]?r.activeTool:{type:"selection"},zoom:"number"==typeof e.zoom?{value:e.zoom}:e.zoom||n.zoom})},md=(e,t,n)=>({elements:pd(null==e?void 0:e.elements,n),appState:gd(null==e?void 0:e.appState,t||null),files:(null==e?void 0:e.files)||{}}),fd=(e,t)=>{const n=[];for(const r of e)if(Array.isArray(r))n.push({status:t,elements:r,id:zr(),created:Date.now()});else{const e=r;n.push(Object.assign(Object.assign({},e),{id:e.id||zr(),status:e.status||t,created:e.created||Date.now()}))}return n},bd=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},vd=e=>{var t;return e&&(null===(t=e.name.match(/\.(json|excalidraw|png|svg)$/))||void 0===t?void 0:t[1])||null},xd=e=>{const t=vd(e);return"png"===t||"svg"===t},yd=e=>{const{type:t}=e||{};return!!t&&o.jo.includes(t)},wd=async(e,t,n)=>{const r=await bd(e);try{const i=JSON.parse(r);if(!Od(i))throw new Error(b("alerts.couldNotLoadInvalidFile"));return md({elements:Al(i.elements||[]),appState:Object.assign(Object.assign({theme:null==t?void 0:t.theme,fileHandle:e.handle||null},yn(i.appState||{})),t?sl(i.elements||[],t):{}),files:i.files},t,n)}catch(e){throw console.error(e.message),new Error(b("alerts.couldNotLoadInvalidFile"))}},kd=async e=>{const t=await bd(e),n=JSON.parse(t);if(n.type!==o.r8.excalidrawLibrary)throw new Error(b("alerts.couldNotLoadInvalidFile"));return n},_d=async e=>new Promise(((t,n)=>{try{e.toBlob((e=>{if(!e)return n(new el(b("canvasError.canvasTooBig"),"CANVAS_POSSIBLY_TOO_BIG"));t(e)}))}catch(e){n(e)}})),Cd=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},Ed=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)})),Sd=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(!yd(e))throw new Error(b("errors.unsupportedFileType"));return new File([await a.toBlob(e,{max:t.maxWidthOrHeight})],e.name,{type:t.outputType||e.type})},Id=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})},jd=(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},Td=(e,t,n,r)=>{const i={type:o.r8.excalidraw,version:o.Kr.excalidraw,source:o.pb,elements:"local"===r?Al(e):Ll(e),appState:"local"===r?yn(t):wn(t),files:"local"===r?jd(e,n):void 0};return JSON.stringify(i,null,2)},Md=async(e,t,n)=>{const r=Td(e,t,n,"local"),i=new Blob([r],{type:o.LO.excalidraw});return{fileHandle:await cd(i,{name:t.name,extension:"excalidraw",description:"Excalidraw file",fileHandle:xd(t.fileHandle)?null:t.fileHandle})}},Od=e=>(null==e?void 0:e.type)===o.r8.excalidraw&&(!e.elements||Array.isArray(e.elements)&&(!e.appState||"object"==typeof e.appState)),Ld=e=>new Promise(((t,n)=>{const r=new Image;r.onload=()=>{t(r)},r.onerror=e=>{n(e)},r.src=e})),Ad=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=Ld(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}},Pd=e=>e.filter((e=>ke(e))),Dd="\x3c!-- svg-source:excalidraw --\x3e",zd=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]=Hd(e,a),{canvas:p,scale:g=1}=l(u,h),m=fn(),{imageCache:f}=await Ad({imageCache:new Map,fileIds:Pd(e).map((e=>e.fileId)),files:n});return Ic(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},Rd=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:Td(e,t,r||{},"local")})}catch(e){console.error(e)}const[d,u,h,p]=Hd(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(Dd,"\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{Ir(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},Hd=(e,t)=>{const[n,r,i,o]=et(e);return[n,r,Kt(n,i)+2*t,Kt(r,o)+t+t]},Nd=32,Bd=12,Fd=256,Ud="NOT_SPREADSHEET",Wd="VALID_SPREADSHEET",Kd=e=>{const t=/^[$€£¥₩]?([0-9,]+(\.[0-9]+)?)$/.exec(e);return t?parseFloat(t[1].replace(/,/g,"")):null},Vd=(e,t)=>e.slice(1).every((e=>null!==Kd(e[t]))),Gd=e=>{const t=e[0].length;if(t>2)return{type:Ud,reason:"More than 2 columns"};if(1===t){if(!Vd(e,0))return{type:Ud,reason:"Value is not numeric"};const t=null===Kd(e[0][0]),n=(t?e.slice(1):e).map((e=>Kd(e[0])));return n.length<2?{type:Ud,reason:"Less than two rows"}:{type:Wd,spreadsheet:{title:t?e[0][0]:null,labels:null,values:n}}}const n=Vd(e,0)?0:1;if(!Vd(e,n))return{type:Ud,reason:"Value is not numeric"};const r=(n+1)%2,i=null===Kd(e[0][n]),o=i?e.slice(1):e;return o.length<2?{type:Ud,reason:"Less than 2 rows"}:{type:Wd,spreadsheet:{title:i?e[0][n]:null,labels:o.map((e=>e[r])),values:o.map((e=>Kd(e[n])))}}},Yd=at.elementBackground.slice(2,at.elementBackground.length),Xd={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},Zd=e=>({chartWidth:44*e.values.length+Bd,chartHeight:280}),qd=(e,t,n,r,i)=>{var o;return(null===(o=e.labels)||void 0===o?void 0:o.map(((e,o)=>ni(Object.assign(Object.assign({groupIds:[r],backgroundColor:i},Xd),{text:e.length>8?"".concat(e.slice(0,5),"..."):e,x:t+44*o+24,y:n+6,width:Nd,angle:5.87,fontSize:16,textAlign:"center",verticalAlign:"top"})))))||[]},$d=(e,t,n,r,i)=>{const o=ni(Object.assign(Object.assign({groupIds:[r],backgroundColor:i},Xd),{x:t-Bd,y:n-Bd,text:"0",textAlign:"right"}));return[o,ni(Object.assign(Object.assign({groupIds:[r],backgroundColor:i},Xd),{x:t-Bd,y:n-Fd-o.height/2,text:Math.max(...e.values).toLocaleString(),textAlign:"right"}))]},Qd=(e,t,n,r,i)=>{const{chartWidth:o,chartHeight:a}=Zd(e);return[ii(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Xd),{type:"line",x:t,y:n,startArrowhead:null,endArrowhead:null,width:o,points:[[0,0],[o,0]]})),ii(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Xd),{type:"line",x:t,y:n,startArrowhead:null,endArrowhead:null,height:a,points:[[0,0],[0,-a]]})),ii(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Xd),{type:"line",x:t,y:n-Fd-Bd,startArrowhead:null,endArrowhead:null,strokeStyle:"dotted",width:o,opacity:50,points:[[0,0],[o,0]]}))]},Jd=(e,t,n,r,i,a)=>{const{chartWidth:s,chartHeight:l}=Zd(e),c=e.title?ni(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Xd),{text:e.title,x:t+s/2,y:n-Fd-24-o.n5,strokeSharpness:"sharp",strokeStyle:"solid",textAlign:"center"})):null,d=a?ei(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Xd),{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]:[],...qd(e,t,n,r,i),...$d(e,t,n,r,i),...Qd(e,t,n,r,i)]},eu=(e,t,n,r)=>"line"===e?((e,t,n)=>{const r=Math.max(...e.values),i=zr(),a=Yd[Math.floor(Math.random()*Yd.length)];let s=0;const l=[];for(const t of e.values){const e=44*s,n=-t/r*Fd;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=ii(Object.assign(Object.assign({backgroundColor:a,groupIds:[i]},Xd),{type:"line",x:t+Bd+16,y:n-Bd,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*Fd+6;return ei(Object.assign(Object.assign({backgroundColor:a,groupIds:[i]},Xd),{fillStyle:"solid",strokeWidth:2,type:"ellipse",x:t+s+16,y:n+l-24,width:Bd,height:Bd}))})),m=e.values.map(((e,o)=>{const s=44*o+6,l=e/r*Fd+6+Bd;return ii(Object.assign(Object.assign({backgroundColor:a,groupIds:[i]},Xd),{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[...Jd(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=zr(),a=Yd[Math.floor(Math.random()*Yd.length)],s=e.values.map(((e,o)=>{const s=e/r*Fd;return ei(Object.assign(Object.assign({backgroundColor:a,groupIds:[i]},Xd),{type:"rectangle",x:t+44*o+Bd,y:n-s-Bd,width:Nd,height:s}))}));return[...s,...Jd(e,t,n,i,a,"production"===o.Vi.DEVELOPMENT)]})(t,n,r);let tu="",nu=!1;const ru="clipboard"in navigator&&"readText"in navigator.clipboard,iu="clipboard"in navigator&&"writeText"in navigator.clipboard,ou="clipboard"in navigator&&"write"in navigator.clipboard&&"ClipboardItem"in window&&"toBlob"in HTMLCanvasElement.prototype,au=async(e,t,n)=>{const r=Rl(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);tu=a;try{nu=!1,await du(a)}catch(e){nu=!0,console.error(e)}},su=()=>{if(!tu)return{};try{return JSON.parse(tu)}catch(e){return console.error(e),{}}},lu=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:Ud,reason:"No values"};const n=t[0].length,r=t.every((e=>e.length===n));if(!r)return{type:Ud,reason:"All rows don't have same number of columns"};const i=Gd(t);if(i.type!==Wd){const e=Gd((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===Wd)return e}return i})(e);return t.type===Wd?{spreadsheet:t.spreadsheet}:null},cu=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():ru&&await navigator.clipboard.readText())||""}catch(e){return""}})(e);if(!t||t.includes(Dd))return su();const n=lu(t);if(n)return n;const r=su();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 nu&&r.elements?r:{text:t}}var i},du=async e=>{let t=!1;if(iu)try{await navigator.clipboard.writeText(e||""),t=!0}catch(e){console.error(e)}if(!t&&!uu(e||" "))throw new Error("couldn't copy")},uu=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},hu=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 Rd(t,{exportBackground:s,exportWithDarkMode:r.exportWithDarkMode,viewBackgroundColor:c,exportPadding:l,exportScale:r.exportScale,exportEmbedScene:r.exportEmbedScene&&"svg"===e},i);if("svg"===e)return await cd(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 du(n.outerHTML)}const h=await zd(t,r,i,{exportBackground:s,viewBackgroundColor:c,exportPadding:l});h.style.display="none",document.body.appendChild(h);let p=await _d(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:Td(t,r,i,"local")})),await cd(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 pu=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:ka}),(0,v.jsx)("div",{className:"Checkbox-label",children:t})]})};n(4623);const gu=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})},mu=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 fu=e=>{let{fileName:t,onSave:n}=e;return(0,v.jsxs)(gu,{className:"ActiveFile",gap:1,align:"center",children:[(0,v.jsxs)("span",{className:"ActiveFile__fileName",children:[ts,(0,v.jsx)("span",{children:t})]}),(0,v.jsx)(rl,{type:"icon",icon:Ca,title:b("buttons.save"),"aria-label":b("buttons.save"),onClick:n,"data-testid":"save-button"})]})},bu=(Xs({name:"changeProjectName",perform:(e,t,n)=>(sc("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)(lc,{label:b("labels.fileTitle"),value:t.name||"Unnamed",onChange:e=>n(e),isNameEditable:void 0===r.name&&!t.viewModeEnabled})}}),Xs({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=Tl(t),a=Dl(i,n)?Rl(i,n):i;return(0,v.jsx)(v.Fragment,{children:o.ZB.map((e=>{const[t,i]=((e,t,n)=>{const[,,r,i]=Hd(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)(rl,{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)}))})}}),Xs({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)(pu,{checked:t.exportBackground,onChange:e=>n(e),children:b("labels.withBackground")})}}),Xs({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)(pu,{checked:t.exportEmbedScene,onChange:e=>n(e),children:[b("labels.exportEmbedScene"),(0,v.jsx)(hl,{label:b("labels.exportEmbedScene_details"),long:!0,children:(0,v.jsx)("div",{className:"excalidraw-tooltip-icon",children:Ha})})]})}}),Xs({name:"saveToActiveFile",perform:async(e,t,n,r)=>{const i=!!t.fileHandle;try{const{fileHandle:n}=xd(t.fileHandle)?await(async(e,t,n)=>{const{exportBackground:r,viewBackgroundColor:i,name:o,fileHandle:a}=t,s=vd(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 hu(s,Tl(e),t,n,{exportBackground:r,viewBackgroundColor:i,name:o,fileHandle:a}),{fileHandle:a}})(e,t,r.files):await Md(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)(fu,{onSave:()=>n(null),fileName:null===(t=r.fileHandle)||void 0===t?void 0:t.name})}}),Xs({name:"saveFileToDisk",perform:async(e,t,n,r)=>{try{const{fileHandle:n}=await Md(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)(rl,{type:"button",icon:Ea,title:b("buttons.saveAs"),"aria-label":b("buttons.saveAs"),showAriaLabel:bp().isMobile,hidden:!od,onClick:()=>t(null),"data-testid":"save-as-button"})}}));Xs({name:"loadScene",perform:async(e,t,n,r)=>{try{const{elements:n,appState:r,files:i}=await(async(e,t)=>{const n=await ld({description:"Excalidraw files"});return wd(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)(rl,{type:"button",icon:Sa,title:b("buttons.load"),"aria-label":b("buttons.load"),showAriaLabel:bp().isMobile,onClick:t,"data-testid":"load-button"})}}),Xs({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)(il,{value:t.exportWithDarkMode?o.C6.DARK:o.C6.LIGHT,onChange:e=>{n(e===o.C6.DARK)},title:b("labels.toggleExportColorScheme")})})}});let vu="{}";const xu=Xs({name:"copyStyles",perform:(e,t)=>{const n=e.find((e=>t.selectedElementIds[e.id]));return n&&(vu=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}),yu=Xs({name:"pasteStyles",perform:(e,t)=>{const n=JSON.parse(vu);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=Hr(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)&&(Rr(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}),Wn(t,or(t))),t}return e})),commitToHistory:!0};var r},contextItemLabel:"labels.pasteStyles",keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.altKey&&e.code===jt}),wu=e=>(0,v.jsx)("button",{className:"help-icon",onClick:e.onClick,type:"button",title:"".concat(e.title," — ?"),"aria-label":e.title,children:Ha}),ku=(Xs({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)(rl,{type:"button",icon:Da,"aria-label":b("buttons.menu"),onClick:n,selected:"canvas"===t.openMenu})}}),Xs({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)(rl,{visible:Sl(n,Tl(t)),type:"button",icon:Ta,"aria-label":b("buttons.edit"),onClick:r,selected:"shape"===n.openMenu})}}),Xs({name:"toggleFullScreen",perform:()=>($t()||document.documentElement.requestFullscreen(),$t()&&document.exitFullscreen(),{commitToHistory:!1}),keyTest:e=>e.code===St&&!e[Lt.CTRL_OR_CMD]}),Xs({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)(wu,{title:b("helpDialog.title"),onClick:t})},keyTest:e=>e.key===Lt.QUESTION_MARK}),(e,t)=>{const n=Rl(Tl(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&&Xr(t,n)),!0))return!0}return!1})(n)}),_u=Xs({name:"group",perform:(e,t)=>{const n=Rl(Tl(e),t,!0);if(n.length<2)return{appState:t,elements:e,commitToHistory:!1};const r=Gr(t);if(1===r.length){const i=r[0],o=new Set(Zr(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=zr(),o=un(n),a=e.map((e=>o.get(e.id)?Hr(e,{groupIds:qr(e.groupIds,i,t.editingGroupId)}):e)),s=Zr(a,i),l=s[s.length-1],c=a.lastIndexOf(l),d=a.slice(c+1),u=[...a.slice(0,c).filter((e=>!Xr(e,i))),...s,...d];return{appState:Wr(i,Object.assign(Object.assign({},t),{selectedGroupIds:{}}),Tl(u)),elements:u,commitToHistory:!0}},contextItemLabel:"labels.group",contextItemPredicate:(e,t)=>ku(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)(rl,{hidden:!ku(t,n),type:"button",icon:(0,v.jsx)(ns,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.group")," — ").concat(Qt("CtrlOrCmd+G")),"aria-label":b("labels.group"),visible:Dl(Tl(t),n)})}}),Cu=Xs({name:"ungroup",perform:(e,t)=>{if(0===Gr(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:Hr(e,{groupIds:r})})),i=Yr(Object.assign(Object.assign({},t),{selectedGroupIds:{}}),Tl(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)=>Gr(t).length>0,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)(rl,{type:"button",hidden:0===Gr(n).length,icon:(0,v.jsx)(rs,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.ungroup")," — ").concat(Qt("CtrlOrCmd+Shift+G")),"aria-label":b("labels.ungroup"),visible:Dl(Tl(t),n)})}});n(2789);const Eu=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})},Su=(Xs({name:"goToCollaborator",perform:(e,t,n)=>{const r=n;return r?{appState:Object.assign(Object.assign(Object.assign({},t),al({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}=cc(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)(Eu,{color:a,border:l?"transparent":s,onClick:()=>n(o.pointer),children:l?(0,v.jsx)("img",{referrerPolicy:"no-referrer",src:l,alt:c}):c})}}),Xs({name:"addToLibrary",perform:(e,t,n,r)=>{const i=Rl(Tl(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:zr(),status:"unpublished",elements:i.map(oi),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"})),Iu=(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})},ju=(e,t)=>Rl(Tl(e),t).length>1,Tu=(e,t,n)=>{const r=((e,t)=>{const n=$r(e),r=rt(e);return n.flatMap((e=>{const n=Iu(e,r,t);return e.map((e=>Hr(e,{x:e.x+n.x,y:e.y+n.y})))}))})(Rl(Tl(e),t),n),i=un(r);return e.map((e=>i.get(e.id)||e))},Mu=(Xs({name:"alignTop",perform:(e,t)=>({appState:t,elements:Tu(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)(rl,{hidden:!ju(t,n),type:"button",icon:(0,v.jsx)(Wa,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.alignTop")," — ").concat(Qt("CtrlOrCmd+Shift+Up")),"aria-label":b("labels.alignTop"),visible:Dl(Tl(t),n)})}}),Xs({name:"alignBottom",perform:(e,t)=>({appState:t,elements:Tu(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)(rl,{hidden:!ju(t,n),type:"button",icon:(0,v.jsx)(Ka,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.alignBottom")," — ").concat(Qt("CtrlOrCmd+Shift+Down")),"aria-label":b("labels.alignBottom"),visible:Dl(Tl(t),n)})}}),Xs({name:"alignLeft",perform:(e,t)=>({appState:t,elements:Tu(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)(rl,{hidden:!ju(t,n),type:"button",icon:(0,v.jsx)(Va,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.alignLeft")," — ").concat(Qt("CtrlOrCmd+Shift+Left")),"aria-label":b("labels.alignLeft"),visible:Dl(Tl(t),n)})}}),Xs({name:"alignRight",perform:(e,t)=>({appState:t,elements:Tu(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)(rl,{hidden:!ju(t,n),type:"button",icon:(0,v.jsx)(Ga,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.alignRight")," — ").concat(Qt("CtrlOrCmd+Shift+Right")),"aria-label":b("labels.alignRight"),visible:Dl(Tl(t),n)})}}),Xs({name:"alignVerticallyCentered",perform:(e,t)=>({appState:t,elements:Tu(e,t,{position:"center",axis:"y"}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)(rl,{hidden:!ju(t,n),type:"button",icon:(0,v.jsx)(Za,{theme:n.theme}),onClick:()=>r(null),title:b("labels.centerVertically"),"aria-label":b("labels.centerVertically"),visible:Dl(Tl(t),n)})}}),Xs({name:"alignHorizontallyCentered",perform:(e,t)=>({appState:t,elements:Tu(e,t,{position:"center",axis:"x"}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)(rl,{hidden:!ju(t,n),type:"button",icon:(0,v.jsx)(qa,{theme:n.theme}),onClick:()=>r(null),title:b("labels.centerHorizontally"),"aria-label":b("labels.centerHorizontally"),visible:Dl(Tl(t),n)})}}),(e,t)=>Rl(Tl(e),t).length>1),Ou=(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=$r(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=>Hr(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=>Hr(e,{x:e.x+a.x,y:e.y+a.y})))}))})(Rl(Tl(e),t),n),i=un(r);return e.map((e=>i.get(e.id)||e))},Lu=(Xs({name:"distributeHorizontally",perform:(e,t)=>({appState:t,elements:Ou(e,t,{space:"between",axis:"x"}),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)(rl,{hidden:!Mu(t,n),type:"button",icon:(0,v.jsx)(Ya,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.distributeHorizontally")," — ").concat(Qt("Alt+H")),"aria-label":b("labels.distributeHorizontally"),visible:Dl(Tl(t),n)})}}),Xs({name:"distributeVertically",perform:(e,t)=>({appState:t,elements:Ou(e,t,{space:"between",axis:"y"}),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)(rl,{hidden:!Mu(t,n),type:"button",icon:(0,v.jsx)(Xa,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.distributeVertically")," — ").concat(Qt("Alt+V")),"aria-label":b("labels.distributeVertically"),visible:Dl(Tl(t),n)})}}),Xs({name:"flipHorizontal",perform:(e,t)=>({elements:Pu(e,t,"horizontal"),appState:t,commitToHistory:!0}),keyTest:e=>e.shiftKey&&"KeyH"===e.code,contextItemLabel:"labels.flipHorizontal",contextItemPredicate:(e,t)=>((e,t)=>{const n=Rl(Tl(e),t);return 1===n.length&&"text"!==n[0].type})(e,t)})),Au=Xs({name:"flipVertical",perform:(e,t)=>({elements:Pu(e,t,"vertical"),appState:t,commitToHistory:!0}),keyTest:e=>e.shiftKey&&"KeyV"===e.code,contextItemLabel:"labels.flipVertical",contextItemPredicate:(e,t)=>((e,t)=>1===Rl(Tl(e),t).length)(e,t)}),Pu=(e,t,n)=>{const r=Rl(Tl(e),t);if(r.length>1)return e;const i=Du(r,t,n),o=un(i);return e.map((e=>o.get(e.id)||e))},Du=(e,t,n)=>(e.forEach((e=>{zu(e,t),"vertical"===n&&Ru(e,Math.PI)})),e),zu=(e,t)=>{const n=e.x,r=e.y,i=e.width,o=e.height,a=Qo(e.angle);let s=0;(Ie(e)||Ee(e))&&(s=2*e.points.reduce(((e,t)=>Math.max(e,t[0])),0)-e.width),Rr(e,{angle:Qo(0)});const l=gi(e,t.zoom);let c=!0,d=0,u=l.nw;if(!u&&(c=!1,u=l.ne,!u))return void Rr(e,{angle:a});if(Ie(e)){for(let t=1;t<e.points.length;t++)_o.movePoints(e,[{index:t,point:[-e.points[t][0],e.points[t][1]]}]);_o.normalizePoints(e)}else d=c?e.x+2*i:e.x-2*i,ia((new Map).set(e.id,e),!0,e,c?"nw":"ne",!1,d,u[1]),Rr(e,{width:i,height:o});let h=Qo(2*Math.PI-a);h<0&&(h=Qo(h+2*Math.PI)),Rr(e,{angle:h}),Rr(e,{x:n+s,y:r}),Ho(e)},Ru=(e,t)=>{const n=e.x,r=e.y;let i=Qo(e.angle+t);i<0&&(i=Qo(2*Math.PI+i)),Rr(e,{angle:i}),Rr(e,{x:n,y:r})},Hu=Xs({name:"copy",perform:(e,t,n,r)=>(au(Tl(e),t,r.files),{commitToHistory:!1}),contextItemLabel:"labels.copy",keyTest:void 0}),Nu=Xs({name:"cut",perform:(e,t,n,r)=>(Hu.perform(e,t,n,r),Bl.perform(e,t)),contextItemLabel:"labels.cut",keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.code===Tt}),Bu=Xs({name:"copyAsSvg",perform:async(e,t,n,r)=>{if(!r.canvas)return{commitToHistory:!1};const i=Rl(Tl(e),t,!0);try{return await hu("clipboard-svg",i.length?i:Tl(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"}),Fu=Xs({name:"copyAsPng",perform:async(e,t,n,r)=>{if(!r.canvas)return{commitToHistory:!1};const i=Rl(Tl(e),t,!0);try{return await hu("clipboard",i.length?i:Tl(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}),Uu=Xs({name:"gridMode",perform(e,t){return sc("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}),Wu=Xs({name:"zenMode",perform(e,t){return sc("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}),Ku=Xs({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}),Vu=Xs({name:"unbindText",contextItemLabel:"labels.unbindText",contextItemPredicate:(e,t)=>Rl(e,t).some((e=>Ae(e))),perform:(e,t)=>(Rl(Tl(e),t).forEach((e=>{const t=ir(e);if(t){var n;const{width:r,height:i,baseline:o}=Gn(t.originalText,Ut(t));Rr(t,{containerId:null,width:r,height:i,baseline:o,text:t.originalText}),Rr(e,{boundElements:null===(n=e.boundElements)||void 0===n?void 0:n.filter((e=>e.id!==t.id))})}})),{elements:e,appState:t,commitToHistory:!0})}),Gu=Xs({name:"bindText",contextItemLabel:"labels.bindText",contextItemPredicate:(e,t)=>{const n=Rl(e,t);if(2===n.length){const e=Ce(n[0])||Ce(n[1]);let t;if(Le(n[0])?t=n[0]:Le(n[1])&&(t=n[1]),e&&t&&null===ir(t))return!0}return!1},perform:(e,t)=>{const n=Rl(Tl(e),t);let r,i;Ce(n[0])&&Le(n[1])?(r=n[0],i=n[1]):(r=n[1],i=n[0]),Rr(r,{containerId:i.id,verticalAlign:o.oX.MIDDLE}),Rr(i,{boundElements:(i.boundElements||[]).concat({type:"text",id:r.id})}),Wn(r,i);const a=e.slice(),s=a.findIndex((e=>e.id===r.id));a.splice(s,1);const l=a.findIndex((e=>e.id===i.id));return a.splice(l+1,0,r),{elements:a,appState:Object.assign(Object.assign({},t),{selectedElementIds:{[i.id]:!0}}),commitToHistory:!0}}}),Yu=(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=un(e),a=i.elements,s=un(a),l=e.filter((e=>!s.has(e.id))),c=a.map((e=>Hr(o.get(e.id)||e,e))).concat(l.map((e=>Hr(e,{isDeleted:!0}))));return qo(c,l),{elements:c,appState:Object.assign(Object.assign({},t),i.appState),commitToHistory:r,syncHistory:!0}}return{commitToHistory:r}},Xu=(e,t,n)=>{if(!1!==e.trackEvent)try{var r;if(!0===e.trackEvent)sc(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 Zu{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)),Xu(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))&&(Xu(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)),Xu(e,"api",null)}}const qu=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=Tl(pd(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 kd(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=fd(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])}},$u=e=>{const t=Array.from(e.values());return{x:Ju(t,(e=>e.x))/t.length,y:Ju(t,(e=>e.y))/t.length}},Qu=e=>{let[t,n]=e;return Math.hypot(t.x-n.x,t.y-n.y)},Ju=(e,t)=>e.reduce(((e,n)=>e+t(n)),0),eh=e=>({selectedElementIds:e.selectedElementIds,selectedGroupIds:e.selectedGroupIds,viewBackgroundColor:e.viewBackgroundColor,editingLinearElement:e.editingLinearElement,editingGroupId:e.editingGroupId,name:e.name});const th=class{constructor(){this.elementCache=new Map,this.recording=!0,this.stateHistory=[],this.redoStack=[],this.lastEntry=null,this.generateEntry=(e,t)=>this.dehydrateHistoryEntry({appState:eh(e),elements:t.reduce(((t,n)=>{if(Ie(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,oi(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)}},nh=[{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.O},{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 rh={cut:[Qt("CtrlOrCmd+X")],copy:[Qt("CtrlOrCmd+C")],paste:[Qt("CtrlOrCmd+V")],copyStyles:[Qt("CtrlOrCmd+Alt+C")],pasteStyles:[Qt("CtrlOrCmd+Alt+V")],selectAll:[Qt("CtrlOrCmd+A")],deleteSelectedElements:[Qt("Del")],duplicateSelection:[Qt("CtrlOrCmd+D"),Qt("Alt+".concat(b("helpDialog.drag")))],sendBackward:[Qt("CtrlOrCmd+[")],bringForward:[Qt("CtrlOrCmd+]")],sendToBack:[Qt(lt?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")],bringToFront:[Qt(lt?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")],copyAsPng:[Qt("Shift+Alt+C")],copyAsSvg:[],group:[Qt("CtrlOrCmd+G")],ungroup:[Qt("CtrlOrCmd+Shift+G")],gridMode:[Qt("CtrlOrCmd+'")],zenMode:[Qt("Alt+Z")],stats:[Qt("Alt+/")],addToLibrary:[],flipHorizontal:[Qt("Shift+H")],flipVertical:[Qt("Shift+V")],viewMode:[Qt("Alt+R")],hyperlink:[Qt("CtrlOrCmd+K")]},ih=e=>{const t=rh[e];return t&&t.length>0?t[0]:""},oh=e=>{let{options:t,onCloseRequest:n,top:r,left:i,actionManager:o,appState:a,elements:s}=e;return(0,v.jsx)(da,{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?ih(i):""})]})},t)}))})})},ah=new WeakMap,sh={push(e){const t=Array.of();e.options.forEach((e=>{e&&t.push(e)})),t.length&&(0,st.render)((0,v.jsx)(oh,{top:e.top,left:e.left,options:t,onCloseRequest:()=>(e=>{const t=ah.get(e);t&&((0,st.unmountComponentAtNode)(t),t.remove(),ah.delete(e))})(e.container),actionManager:e.actionManager,appState:e.appState,elements:e.elements}),(e=>{let t=ah.get(e);return t||(t=document.createElement("div"),e.querySelector(".excalidraw-contextMenuContainer").appendChild(t),ah.set(e,t),t)})(e.container))}},lh=e=>{var t;let{appState:n,elements:r,renderAction:i,activeTool:o}=e;const a=Hl(Tl(r),n);let s=!1;2===a.length&&(Ae(a[0])||Ae(a[1]))&&(s=!0);const l=Boolean(n.editingElement),c=bp(),d="rtl"===document.documentElement.getAttribute("dir"),u=Hs(o)||a.some((e=>Hs(e.type)&&!sn(e.backgroundColor))),h=Hs(o)||a.some((e=>Hs(e.type))),p=1===a.length||s;let g=(null===(t=a[0])||void 0===t?void 0:t.type)||null;for(const e of a)if(e.type!==g){g=null;break}return(0,v.jsxs)("div",{className:"panelColumn",children:[(Ns(o)&&"image"!==o&&"image"!==g||a.some((e=>Ns(e.type))))&&i("changeStrokeColor"),h&&i("changeBackgroundColor"),u&&i("changeFillStyle"),(Bs(o)||a.some((e=>Bs(e.type))))&&i("changeStrokeWidth"),("freedraw"===o||a.some((e=>"freedraw"===e.type)))&&i("changeStrokeShape"),(Fs(o)||a.some((e=>Fs(e.type))))&&(0,v.jsxs)(v.Fragment,{children:[i("changeStrokeStyle"),i("changeSloppiness")]}),(Us(o)||a.some((e=>Us(e.type))))&&(0,v.jsx)(v.Fragment,{children:i("changeSharpness")}),(Ws(o)||a.some((e=>Ws(e.type))))&&(0,v.jsxs)(v.Fragment,{children:[i("changeFontSize"),i("changeFontFamily"),i("changeTextAlign")]}),a.some((e=>Ae(e)||Pe(e)))&&i("changeVerticalAlign"),(Ks(o)||a.some((e=>Ks(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.isMobile&&i("duplicateSelection"),!c.isMobile&&i("deleteSelectedElements"),i("group"),i("ungroup"),p&&i("hyperlink")]})]})]})},ch=e=>{let{canvas:t,activeTool:n,setAppState:r,onImageAction:i,appState:o}=e;const a=ln((e=>{let{activeToolType:a,pointerType:s}=e;o.penDetected||"pen"!==s||r({penDetected:!0,penMode:!0}),r({activeTool:{type:a},multiElement:null,selectedElementIds:{}}),qt(t,Object.assign(Object.assign({},o),{activeTool:n})),"image"===n.type&&i({pointerType:s})}));return(0,v.jsx)(v.Fragment,{children:nh.map(((e,t)=>{let{value:r,icon:i,key:o}=e;const s=b("toolBar.".concat(r)),l=o&&("string"==typeof o?o:o[0]),c=l?"".concat(Nt(l)," ").concat(b("helpDialog.or")," ").concat(t+1):"".concat(t+1);return(0,v.jsx)(rl,{className:"Shape",type:"radio",icon:i,checked:n.type===r,name:"editor-current-shape",title:"".concat(Nt(s)," — ").concat(c),keyBindingLabel:"".concat(t+1),"aria-label":Nt(s),"aria-keyshortcuts":c,"data-testid":r,onPointerDown:e=>{let{pointerType:t}=e;a({activeToolType:r,pointerType:t})},onChange:e=>{let{pointerType:t}=e;a({activeToolType:r,pointerType:t})}},r)}))})},dh=e=>{let{renderAction:t,zoom:n}=e;return(0,v.jsx)(mu,{gap:1,children:(0,v.jsxs)(gu,{gap:1,align:"center",children:[t("zoomOut"),t("zoomIn"),t("resetZoom")]})})},uh=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 hh=e=>{let{isCollaborating:t,collaboratorCount:n,onClick:r}=e;return(0,v.jsx)(v.Fragment,{children:(0,v.jsx)(rl,{className:ye("CollabButton",{"is-collaborating":t}),onClick:r,icon:$a,type:"button",title:b("labels.liveCollaboration"),"aria-label":b("labels.liveCollaboration"),showAriaLabel:bp().isMobile,children:n>0&&(0,v.jsx)("div",{className:"CollabButton-collaborators",children:n})})})},ph=e=>{let{message:t,onClose:n}=e;const[o,a]=(0,r.useState)(!!t),{container:s}=xp(),l=i().useCallback((()=>{a(!1),n&&n(),null==s||s.focus()}),[n,s]);return(0,v.jsx)(v.Fragment,{children:o&&(0,v.jsx)(fl,{small:!0,onCloseRequest:l,title:b("errorDialog.title"),children:(0,v.jsx)("div",{style:{whiteSpace:"pre-wrap"},children:t})})})};n(2205);const gh="filter"in document.createElement("canvas").getContext("2d"),mh=()=>(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"),")"]})]}),fh=(e,t)=>{(0,st.unmountComponentAtNode)(t),t.innerHTML="",e instanceof HTMLCanvasElement?t.appendChild(e):(0,st.render)((0,v.jsx)(mh,{}),t)},bh=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})},vh=e=>{let{elements:t,appState:n,files:i,exportPadding:a=o.qy,actionManager:s,onExportToPng:l,onExportToSvg:c,onExportToClipboard:d}=e;const u=Dl(t,n),[h,p]=(0,r.useState)(u),g=(0,r.useRef)(null),{exportBackground:m,viewBackgroundColor:f}=n,x=h?Rl(t,n,!0):t;return(0,r.useEffect)((()=>{p(u)}),[u]),(0,r.useEffect)((()=>{const e=g.current;e&&zd(x,n,i,{exportBackground:m,viewBackgroundColor:f,exportPadding:a}).then((t=>_d(t).then((()=>{fh(t,e)})))).catch((t=>{console.error(t),fh(new el,e)}))}),[n,i,x,m,a,f]),(0,v.jsxs)("div",{className:"ExportDialog",children:[(0,v.jsx)("div",{className:"ExportDialog__preview",ref:g}),gh&&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)(pu,{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)(gu,{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:!od&&s.renderAction("changeProjectName")}),(0,v.jsxs)(gu,{gap:2,justifyContent:"center",style:{margin:"2em 0"},children:[(0,v.jsx)(bh,{color:"indigo",title:b("buttons.exportToPng"),"aria-label":b("buttons.exportToPng"),onClick:()=>l(x),children:"PNG"}),(0,v.jsx)(bh,{color:"red",title:b("buttons.exportToSvg"),"aria-label":b("buttons.exportToSvg"),onClick:()=>c(x),children:"SVG"}),ou&&(0,v.jsx)(bh,{title:b("buttons.copyPngToClipboard"),onClick:()=>d(x),color:"gray",shade:7,children:Ia})]})]})},xh=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)(rl,{onClick:()=>{p(!0)},"data-testid":"image-export-button",icon:Ma,type:"button","aria-label":b("buttons.exportImage"),showAriaLabel:bp().isMobile,title:b("buttons.exportImage")}),h&&(0,v.jsx)(fl,{onCloseRequest:g,title:b("buttons.exportImage"),children:(0,v.jsx)(vh,{elements:t,appState:n,files:a,exportPadding:s,actionManager:l,onExportToPng:c,onExportToSvg:d,onExportToClipboard:u,onCloseRequest:g})})]})};n(1310);const yh=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 wh=e=>{let{appState:t,elements:n,isMobile:r}=e,i=(e=>{let{appState:t,elements:n,isMobile:r}=e;const{activeTool:i,isResizing:o,isRotating:a,lastPointerDownWith:s}=t,l=null!==t.multiElement;if(kn(t))return b("hints.eraserRevert");if("arrow"===i.type||"line"===i.type)return b(l?"hints.linearElementMulti":"hints.linearElement");if("freedraw"===i.type)return b("hints.freeDraw");if("text"===i.type)return b("hints.text");if("image"===t.activeTool.type&&t.pendingImageElement)return b("hints.placeImage");const c=Rl(n,t);if(o&&"mouse"===s&&1===c.length){const e=c[0];return Ie(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.type){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(Ie(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=Qt(i),(0,v.jsx)("div",{className:"HintViewer",children:(0,v.jsx)("span",{children:i})})):null},kh={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"})})},_h=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?kh.CHECKED:kh.UNCHECKED})]});var Ch=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 Eh=e=>{let{heading:t,children:n}=e,r=Ch(e,["heading","children"]);const{id:i}=xp(),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 Sh=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)(hl,{label:r.username||"Unknown user",children:o.renderAction("goToCollaborator",{id:t})},t)}))})})),Ih=(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"})}),jh=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:Ih})]})},Th="medium",Mh={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"})]})},Oh=e=>e.penDetected?(0,v.jsxs)("label",{className:ye("ToolIcon ToolIcon__penMode ToolIcon_type_floating","ToolIcon_size_".concat(Th),{"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?Mh.CHECKED:Mh.UNCHECKED})]}):e.isMobile?null:(0,v.jsx)("label",{className:ye("ToolIcon ToolIcon__penMode ToolIcon_type_floating","ToolIcon_size_".concat(Th),{"is-mobile":e.isMobile}),children:(0,v.jsx)("div",{className:"ToolIcon__icon ToolIcon__hidden"})}),Lh=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)(yh,{side:"top",className:"App-top-bar",children:[(0,v.jsx)("div",{}),(0,v.jsx)(Eh,{heading:"shapes",children:e=>(0,v.jsxs)(mu,{gap:4,align:"center",children:[(0,v.jsxs)(gu,{gap:1,className:"App-toolbar-container",children:[(0,v.jsxs)(pl,{padding:1,className:"App-toolbar",children:[e,(0,v.jsx)(gu,{gap:1,children:(0,v.jsx)(ch,{appState:n,canvas:h,activeTool:n.activeTool,setAppState:l,onImageAction:e=>{let{pointerType:t}=e;x({insertOnCanvasDirectly:"mouse"!==t})}})})]}),(0,v.jsx)(rl,{type:"button",className:"HomeButton ToolIcon_type_floating",title:"Home","aria-label":"Home",icon:Rs,onClick:t},"home"),(0,v.jsx)(_h,{checked:n.elementLocked,onChange:d,title:b("toolBar.lock"),isMobile:!0}),(0,v.jsx)(jh,{appState:n,setAppState:l,isMobile:!0}),(0,v.jsx)(Oh,{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)(pl,{padding:0,children:[w.canvasActions&&"canvas"===n.openMenu?(0,v.jsx)(Eh,{className:"App-mobile-menu",heading:"canvasActions",children:(0,v.jsx)("div",{className:"panelColumn",children:(0,v.jsxs)(mu,{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)(hh,{isCollaborating:p,collaboratorCount:n.collaborators.size,onClick:c}),(0,v.jsx)(uh,{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)(Sh,{mobile:!0,layout:"horizontal",collaborators:n.collaborators,actionManager:o})]})]})})}):"shape"===n.openMenu&&!m&&Sl(n,r)?(0,v.jsx)(Eh,{className:"App-mobile-menu",heading:"selectedShapeActions",children:(0,v.jsx)(lh,{appState:n,elements:r,renderAction:o.renderAction,activeTool:n.activeTool.type})}):null,(0,v.jsxs)("footer",{className:"App-toolbar",children:[(()=>{const e=!n.viewModeEnabled&&!n.editingElement&&0===Rl(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({},sl(r,n)))},children:b("buttons.scrollBackToContent")})]})]})})]})};n(8051);const Ah=e=>{const t=(0,r.useRef)(null),[n,i]=(0,r.useState)(null);return(0,r.useLayoutEffect)((()=>{if(!e.spreadsheet)return;const n=eu(e.chartType,e.spreadsheet,0,0);let r;i(n);const o=t.current;return(async()=>{r=await Rd(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})})},Ph=e=>{let{setAppState:t,appState:n,onClose:r,onInsertChart:o}=e;const a=i().useCallback((()=>{r&&r()}),[r]),s=(e,n)=>{o(n),sc("magic","chart",e),t({currentChartType:e,pasteDialog:{shown:!1,data:null}})};return(0,v.jsx)(fl,{small:!0,onCloseRequest:a,title:b("labels.pasteCharts"),className:"PasteChartDialog",autofocus:!1,children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(Ah,{chartType:"bar",spreadsheet:n.pasteDialog.data,selected:"bar"===n.currentChartType,onClick:s}),(0,v.jsx)(Ah,{chartType:"line",spreadsheet:n.pasteDialog.data,selected:"line"===n.currentChartType,onClick:s})]})})};n(3922);const Dh=()=>(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")})]}),zh=e=>(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("h3",{children:e.title}),e.children]}),Rh=e=>(0,v.jsx)("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"space-between"},children:e.children}),Hh=e=>(0,v.jsx)("div",{style:{width:"49%"},children:e.children}),Nh=e=>(0,v.jsxs)("div",{className:"HelpDialog--island",children:[(0,v.jsx)("h3",{className:"HelpDialog--island-title",children:e.caption}),e.children]}),Bh=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)(Fh,{children:t}),e.isOr&&n!==e.shortcuts.length-1&&b("helpDialog.or")]},n)))})]})});Bh.defaultProps={isOr:!0};const Fh=e=>(0,v.jsx)("kbd",Object.assign({className:"HelpDialog--key"},e)),Uh=e=>{let{onClose:t}=e;const n=i().useCallback((()=>{t&&t()}),[t]);return(0,v.jsx)(v.Fragment,{children:(0,v.jsxs)(fl,{onCloseRequest:n,title:b("helpDialog.title"),className:"HelpDialog",children:[(0,v.jsx)(Dh,{}),(0,v.jsx)(zh,{title:b("helpDialog.shortcuts"),children:(0,v.jsxs)(Rh,{children:[(0,v.jsxs)(Hh,{children:[(0,v.jsxs)(Nh,{caption:b("helpDialog.tools"),children:[(0,v.jsx)(Bh,{label:b("toolBar.selection"),shortcuts:["V","1"]}),(0,v.jsx)(Bh,{label:b("toolBar.rectangle"),shortcuts:["R","2"]}),(0,v.jsx)(Bh,{label:b("toolBar.diamond"),shortcuts:["D","3"]}),(0,v.jsx)(Bh,{label:b("toolBar.ellipse"),shortcuts:["O","4"]}),(0,v.jsx)(Bh,{label:b("toolBar.arrow"),shortcuts:["A","5"]}),(0,v.jsx)(Bh,{label:b("toolBar.line"),shortcuts:["P","6"]}),(0,v.jsx)(Bh,{label:b("toolBar.freedraw"),shortcuts:["Shift + P","X","7"]}),(0,v.jsx)(Bh,{label:b("toolBar.text"),shortcuts:["T","8"]}),(0,v.jsx)(Bh,{label:b("toolBar.image"),shortcuts:["9"]}),(0,v.jsx)(Bh,{label:b("toolBar.library"),shortcuts:["0"]}),(0,v.jsx)(Bh,{label:b("toolBar.eraser"),shortcuts:[Qt("E")]}),(0,v.jsx)(Bh,{label:b("helpDialog.editSelectedShape"),shortcuts:[Qt("Enter"),b("helpDialog.doubleClick")]}),(0,v.jsx)(Bh,{label:b("helpDialog.textNewLine"),shortcuts:[Qt("Enter"),Qt("Shift+Enter")]}),(0,v.jsx)(Bh,{label:b("helpDialog.textFinish"),shortcuts:[Qt("Esc"),Qt("CtrlOrCmd+Enter")]}),(0,v.jsx)(Bh,{label:b("helpDialog.curvedArrow"),shortcuts:["A",b("helpDialog.click"),b("helpDialog.click"),b("helpDialog.click")],isOr:!1}),(0,v.jsx)(Bh,{label:b("helpDialog.curvedLine"),shortcuts:["L",b("helpDialog.click"),b("helpDialog.click"),b("helpDialog.click")],isOr:!1}),(0,v.jsx)(Bh,{label:b("toolBar.lock"),shortcuts:["Q"]}),(0,v.jsx)(Bh,{label:b("helpDialog.preventBinding"),shortcuts:[Qt("CtrlOrCmd")]}),(0,v.jsx)(Bh,{label:b("toolBar.link"),shortcuts:[Qt("CtrlOrCmd+K")]})]}),(0,v.jsxs)(Nh,{caption:b("helpDialog.view"),children:[(0,v.jsx)(Bh,{label:b("buttons.zoomIn"),shortcuts:[Qt("CtrlOrCmd++")]}),(0,v.jsx)(Bh,{label:b("buttons.zoomOut"),shortcuts:[Qt("CtrlOrCmd+-")]}),(0,v.jsx)(Bh,{label:b("buttons.resetZoom"),shortcuts:[Qt("CtrlOrCmd+0")]}),(0,v.jsx)(Bh,{label:b("helpDialog.zoomToFit"),shortcuts:["Shift+1"]}),(0,v.jsx)(Bh,{label:b("helpDialog.zoomToSelection"),shortcuts:["Shift+2"]}),(0,v.jsx)(Bh,{label:b("buttons.fullScreen"),shortcuts:["F"]}),(0,v.jsx)(Bh,{label:b("buttons.zenMode"),shortcuts:[Qt("Alt+Z")]}),(0,v.jsx)(Bh,{label:b("labels.showGrid"),shortcuts:[Qt("CtrlOrCmd+'")]}),(0,v.jsx)(Bh,{label:b("labels.viewMode"),shortcuts:[Qt("Alt+R")]}),(0,v.jsx)(Bh,{label:b("labels.toggleTheme"),shortcuts:[Qt("Alt+Shift+D")]}),(0,v.jsx)(Bh,{label:b("stats.title"),shortcuts:[Qt("Alt+/")]})]})]}),(0,v.jsx)(Hh,{children:(0,v.jsxs)(Nh,{caption:b("helpDialog.editor"),children:[(0,v.jsx)(Bh,{label:b("labels.selectAll"),shortcuts:[Qt("CtrlOrCmd+A")]}),(0,v.jsx)(Bh,{label:b("labels.multiSelect"),shortcuts:[Qt("Shift+".concat(b("helpDialog.click")))]}),(0,v.jsx)(Bh,{label:b("helpDialog.deepSelect"),shortcuts:[Qt("CtrlOrCmd+".concat(b("helpDialog.click")))]}),(0,v.jsx)(Bh,{label:b("helpDialog.deepBoxSelect"),shortcuts:[Qt("CtrlOrCmd+".concat(b("helpDialog.drag")))]}),(0,v.jsx)(Bh,{label:b("labels.moveCanvas"),shortcuts:[Qt("Space+".concat(b("helpDialog.drag"))),Qt("Wheel+".concat(b("helpDialog.drag")))],isOr:!0}),(0,v.jsx)(Bh,{label:b("labels.cut"),shortcuts:[Qt("CtrlOrCmd+X")]}),(0,v.jsx)(Bh,{label:b("labels.copy"),shortcuts:[Qt("CtrlOrCmd+C")]}),(0,v.jsx)(Bh,{label:b("labels.paste"),shortcuts:[Qt("CtrlOrCmd+V")]}),(0,v.jsx)(Bh,{label:b("labels.copyAsPng"),shortcuts:[Qt("Shift+Alt+C")]}),(0,v.jsx)(Bh,{label:b("labels.copyStyles"),shortcuts:[Qt("CtrlOrCmd+Alt+C")]}),(0,v.jsx)(Bh,{label:b("labels.pasteStyles"),shortcuts:[Qt("CtrlOrCmd+Alt+V")]}),(0,v.jsx)(Bh,{label:b("labels.delete"),shortcuts:[Qt("Del")]}),(0,v.jsx)(Bh,{label:b("labels.sendToBack"),shortcuts:[Qt(lt?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")]}),(0,v.jsx)(Bh,{label:b("labels.bringToFront"),shortcuts:[Qt(lt?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")]}),(0,v.jsx)(Bh,{label:b("labels.sendBackward"),shortcuts:[Qt("CtrlOrCmd+[")]}),(0,v.jsx)(Bh,{label:b("labels.bringForward"),shortcuts:[Qt("CtrlOrCmd+]")]}),(0,v.jsx)(Bh,{label:b("labels.alignTop"),shortcuts:[Qt("CtrlOrCmd+Shift+Up")]}),(0,v.jsx)(Bh,{label:b("labels.alignBottom"),shortcuts:[Qt("CtrlOrCmd+Shift+Down")]}),(0,v.jsx)(Bh,{label:b("labels.alignLeft"),shortcuts:[Qt("CtrlOrCmd+Shift+Left")]}),(0,v.jsx)(Bh,{label:b("labels.alignRight"),shortcuts:[Qt("CtrlOrCmd+Shift+Right")]}),(0,v.jsx)(Bh,{label:b("labels.duplicateSelection"),shortcuts:[Qt("CtrlOrCmd+D"),Qt("Alt+".concat(b("helpDialog.drag")))]}),(0,v.jsx)(Bh,{label:b("buttons.undo"),shortcuts:[Qt("CtrlOrCmd+Z")]}),(0,v.jsx)(Bh,{label:b("buttons.redo"),shortcuts:ct?[Qt("CtrlOrCmd+Y"),Qt("CtrlOrCmd+Shift+Z")]:[Qt("CtrlOrCmd+Shift+Z")]}),(0,v.jsx)(Bh,{label:b("labels.group"),shortcuts:[Qt("CtrlOrCmd+G")]}),(0,v.jsx)(Bh,{label:b("labels.ungroup"),shortcuts:[Qt("CtrlOrCmd+Shift+G")]}),(0,v.jsx)(Bh,{label:b("labels.flipHorizontal"),shortcuts:[Qt("Shift+H")]}),(0,v.jsx)(Bh,{label:b("labels.flipVertical"),shortcuts:[Qt("Shift+V")]}),(0,v.jsx)(Bh,{label:b("labels.showStroke"),shortcuts:[Qt("S")]}),(0,v.jsx)(Bh,{label:b("labels.showBackground"),shortcuts:[Qt("G")]}),(0,v.jsx)(Bh,{label:b("labels.decreaseFontSize"),shortcuts:[Qt("CtrlOrCmd+Shift+<")]}),(0,v.jsx)(Bh,{label:b("labels.increaseFontSize"),shortcuts:[Qt("CtrlOrCmd+Shift+>")]})]})})]})})]})})};n(5080);const Wh=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})},Kh=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)(Wh,{color:"lime",children:[(0,v.jsx)("div",{className:"Card-icon",children:Oa}),(0,v.jsx)("h2",{children:b("exportDialog.disk_title")}),(0,v.jsxs)("div",{className:"Card-details",children:[b("exportDialog.disk_details"),!od&&i.renderAction("changeProjectName")]}),(0,v.jsx)(rl,{className:"Card-button",type:"button",title:b("exportDialog.disk_button"),"aria-label":b("exportDialog.disk_button"),showAriaLabel:!0,onClick:()=>{i.executeAction(bu)}})]}),s&&(0,v.jsxs)(Wh,{color:"pink",children:[(0,v.jsx)("div",{className:"Card-icon",children:_a}),(0,v.jsx)("h2",{children:b("exportDialog.link_title")}),(0,v.jsx)("div",{className:"Card-details",children:b("exportDialog.link_details")}),(0,v.jsx)(rl,{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)]})})},Vh=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)(rl,{onClick:()=>{"function"==typeof s?a.executeAction(bu):d(!0)},"data-testid":"json-export-button",icon:Oa,type:"button","aria-label":b("buttons.export"),showAriaLabel:bp().isMobile,title:b("buttons.export")}),c&&s&&"function"!=typeof s&&(0,v.jsx)(fl,{onCloseRequest:u,title:b("buttons.export"),children:(0,v.jsx)(Kh,{elements:t,appState:n,files:o,actionManager:a,onCloseRequest:u,exportOpts:s,canvas:l})})]})},Gh=e=>{let{elements:t,appState:n,files:r,maxWidthOrHeight:i,getDimensions:o}=e;const{elements:a,appState:s}=md({elements:t,appState:n},null,null),{exportBackground:l,viewBackgroundColor:c}=s;return zd(Tl(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}}))},Yh=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 Gh(e);return r=r||(/image\/jpe?g/.test(n)?.92:.8),new Promise((e=>{i.toBlob((t=>{e(t)}),n,r)}))},Xh=async e=>{let{elements:t,appState:n=fn(),files:r={},exportPadding:i}=e;const{elements:o,appState:a}=md({elements:t,appState:n},null,null);return Rd(Tl(o),Object.assign(Object.assign({},a),{exportPadding:i}),r)},Zh=async e=>{const t=await Yh(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 qh=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 Xh({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)(rl,{"aria-label":b("buttons.remove"),type:"button",icon:Qa,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})]})]})},$h="publish-library-data",Qh=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 Gh({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 Sd(new File([await _d(a)],"preview",{type:o.LO.png}),{outputType:o.LO.jpg,maxWidthOrHeight:5e3})},Jh=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($h);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($h,JSON.stringify(e))}catch(e){console.error(e)}})(d),t()}),[g,t,l,d]),y=!!n.length;return(0,v.jsx)(fl,{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 Qh(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($h),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)(qh,{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)(rl,{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)(rl,{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 ep=n(2891);n(694);const tp=(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)"})}),np=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 Rd(n,{exportBackground:!1,viewBackgroundColor:it.white},i);e.innerHTML=t.outerHTML})(),()=>{e.innerHTML=""}}),[n,i]);const[u,h]=(0,r.useState)(!1),p=bp().isMobile,g=a&&(0,v.jsx)("div",{className:"library-unit__adder",children:tp});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)(pu,{checked:l,onChange:(e,n)=>c(t,n),className:"library-unit__checkbox"})]})};n(6043);const rp=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)(vl,{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),_=bp().isMobile,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)})),I=e=>{var t,n,r,i,o;return(0,v.jsx)(mu,{children:(0,v.jsx)(np,{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)},j=e=>{const t=e.map((e=>e.id?I({item:e,onClick:()=>a(e.elements),key:e.id}):I({key:"__pending__item__",item:e,onClick:()=>i(s)})));let n=(0,ep.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)=>I({key:"empty_".concat(t),item:null}))))),(0,v.jsx)(gu,{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)(rl,{type:"button",title:b("buttons.load"),"aria-label":b("buttons.load"),icon:Sa,onClick:()=>{(async e=>{const t=await ld({description:"Excalidraw library files"});await e.importLibrary(t)})(u).then((()=>{c({isLibraryOpen:!1}),c({isLibraryOpen:!0})})).catch(an).catch((e=>{c({errorMessage:e.message})}))},className:"library-actions--load"},"import"),!!n.length&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(rl,{type:"button",title:b("buttons.export"),"aria-label":b("buttons.export"),icon:Oa,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 cd(new Blob([n],{type:o.LO.excalidrawlib}),{name:"library",extension:"excalidrawlib",description:"Excalidraw library file"})})(e?n:await u.loadLibrary()).catch(an).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)(rl,{type:"button",title:r,"aria-label":r,icon:ja,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)(hl,{label:b("hints.publishLibrary"),children:(0,v.jsxs)(rl,{type:"button","aria-label":b("buttons.publishLibrary"),label:b("buttons.publishLibrary"),icon:Ps,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)(mu,{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")}),j(M)]}),(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)("div",{className:"separator",children:[b("labels.excalidrawLib")," "]}),j(T)]})]})]})},ip=(e,t)=>e.filter((e=>t.includes(e.id))),op=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,I]=(0,r.useState)(null),j=(0,r.useRef)(null);(0,r.useEffect)((()=>(Promise.race([new Promise((e=>{j.current=window.setTimeout((()=>{e("loading")}),100)})),h.loadLibrary().then((e=>{x(e),w("ready")}))]).then((e=>{"loading"===e&&w("loading")})),()=>{clearTimeout(j.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:zr(),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)(fl,{onCloseRequest:()=>I(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)(rl,{type:"button",title:b("buttons.close"),"aria-label":b("buttons.close"),label:b("buttons.close"),onClick:()=>I(null),"data-testid":"publish-library-success-close",className:"publish-library-success-close"})]})),[I,S]),A=(0,r.useCallback)((e=>{E(!1),I({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,I,f,k,h]),[P,D]=(0,r.useState)(null);return"preloading"===y?null:(0,v.jsxs)(pl,{padding:1,ref:m,className:"layer-ui__library",children:[C&&(0,v.jsx)(Jh,{onClose:()=>E(!1),libraryItems:ip(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)(rp,{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=un(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 ap=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 sp=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:I,library:j,id:T,onImageAction:M}=e;const O=bp(),L=()=>S.canvasActions&&S.canvasActions.export?(0,v.jsx)(Vh,{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 hu(e,t,i,a,{exportBackground:i.exportBackground,name:i.name,viewBackgroundColor:i.viewBackgroundColor}).catch(an).catch((e=>{console.error(e),s({errorMessage:e.message})}));i.exportEmbedScene&&n&&xd(n)&&s({fileHandle:n})};return(0,v.jsx)(xh,{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)(op,{pendingElements:Rl(c,i,!0),onClose:P,onInsertShape:p,onAddToLibrary:D,setAppState:s,libraryReturnUrl:E,focusContainer:I,library:j,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)(ph,{message:i.errorMessage,onClose:()=>s({errorMessage:null})}),i.showHelpDialog&&(0,v.jsx)(Uh,{onClose:()=>{s({showHelpDialog:!1})}}),i.pasteDialog.shown&&(0,v.jsx)(Ph,{setAppState:s,appState:i,onInsertChart:p,onClose:()=>s({pasteDialog:{shown:!1,data:null}})})]});return O.isMobile?(0,v.jsxs)(v.Fragment,{children:[R,(0,v.jsx)(Lh,{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=Sl(i,c);return(0,v.jsx)(yh,{side:"top",children:(0,v.jsxs)("div",{className:"App-menu App-menu_top",children:[(0,v.jsxs)(mu,{gap:4,className:ye({"disable-pointerEvents":g}),children:[S.canvasActions&&(C?(0,v.jsx)(Eh,{heading:"canvasActions",className:ye("zen-mode-transition",{"transition-left":g}),children:(0,v.jsx)(pl,{padding:2,style:{zIndex:1},children:(0,v.jsx)(mu,{gap:4,children:(0,v.jsxs)(gu,{gap:1,justifyContent:"space-between",children:[L(),A()]})})})}):(0,v.jsx)(Eh,{heading:"canvasActions",className:ye("zen-mode-transition",{"transition-left":g}),children:(0,v.jsx)(pl,{padding:2,style:{zIndex:1},children:(0,v.jsxs)(mu,{gap:4,children:[(0,v.jsxs)(gu,{gap:3,justifyContent:"space-between",children:[n.renderAction("clearCanvas"),n.renderAction("loadScene"),L(),A(),d&&(0,v.jsx)(hh,{isCollaborating:w,collaboratorCount:i.collaborators.size,onClick:d})]}),(0,v.jsx)(uh,{actionManager:n,appState:i,setAppState:s,showThemeBtn:f}),i.fileHandle&&(0,v.jsx)(v.Fragment,{children:n.renderAction("saveToActiveFile")})]})})})),e&&(0,v.jsx)(Eh,{heading:"selectedShapeActions",className:ye("zen-mode-transition",{"transition-left":g}),children:(0,v.jsx)(pl,{className:o.$C.SHAPE_ACTIONS_MENU,padding:2,style:{maxHeight:"".concat(i.height-(i.fileHandle?248:200),"px")},children:(0,v.jsx)(lh,{appState:i,elements:c,renderAction:n.renderAction,activeTool:i.activeTool.type})})})]}),!C&&(0,v.jsx)(Eh,{heading:"shapes",children:e=>(0,v.jsxs)(mu,{gap:4,align:"start",children:[(0,v.jsxs)(gu,{gap:1,className:ye("App-toolbar-container",{"zen-mode":g}),children:[(0,v.jsx)(Oh,{zenModeEnabled:g,checked:i.penMode,onChange:h,title:b("toolBar.penMode"),penDetected:i.penDetected}),(0,v.jsx)(_h,{zenModeEnabled:g,checked:i.elementLocked,onChange:u,title:b("toolBar.lock")}),(0,v.jsxs)(pl,{padding:1,className:ye("App-toolbar",{"zen-mode":g}),children:[(0,v.jsx)(wh,{appState:i,elements:c,isMobile:O.isMobile}),e,(0,v.jsx)(gu,{gap:1,children:(0,v.jsx)(ch,{appState:i,canvas:l,activeTool:i.activeTool,setAppState:s,onImageAction:e=>{let{pointerType:t}=e;M({insertOnCanvasDirectly:"mouse"!==t})}})})]}),(0,v.jsx)(jh,{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.isMobile,i,l)}),(0,v.jsx)(Sh,{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)(mu,{gap:2,children:(0,v.jsxs)(Eh,{heading:"canvasActions",children:[(0,v.jsx)(pl,{padding:1,children:(0,v.jsx)(dh,{renderAction:n.renderAction,zoom:i.zoom})}),!C&&(0,v.jsxs)(v.Fragment,{children:[(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"})})]}),!C&&i.multiElement&&O.isTouchScreen&&(0,v.jsx)("div",{className:ye("finalize-button zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":g}),children:n.renderAction("finalize",{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({},sl(c,i)))},children:b("buttons.scrollBackToContent")})]})},lp=(e,t)=>{const n=e=>{const{suggestedBindings:t,startBoundElement:n}=e;return ap(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]))},cp=i().memo(sp,lp);n(1528);const dp=e=>{var t;const n=bp(),r=et(e.elements),i=Hl(e.elements,e.appState),o=et(i);return n.isMobile&&e.appState.openMenu?null:(0,v.jsx)("div",{className:"Stats",children:(0,v.jsxs)(pl,{padding:2,children:[(0,v.jsx)("div",{className:"close",onClick:e.onClose,children:Qa}),(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 up=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})})},hp=Xs({name:"viewMode",perform(e,t){return sc("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 pp=n(200),gp=n.n(pp);const mp={isMobile:!1,isTouchScreen:!1},fp=i().createContext(mp),bp=()=>(0,r.useContext)(fp),vp=i().createContext({container:null,id:null}),xp=()=>(0,r.useContext)(vp);let yp=!1,wp=0,kp=0,_p=0,Cp=!1,Ep=!1,Sp=!1,Ip={horizontal:null,vertical:null},jp=0,Tp=!1,Mp=null;const Op={pointers:new Map,lastCenter:null,initialDistance:null,initialScale:null};class Lp extends i().Component{constructor(e){super(e),Ap.call(this);const t=fn(),{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 Un,this.library=new qu(this),this.history=new th,this.actionManager=new Zu(this.syncActionResult,(()=>this.state),(()=>this.scene.getElementsIncludingDeleted()),this),this.actionManager.registerAll(Ys),this.actionManager.registerAction((d=this.history,{name:"undo",perform:(e,t)=>Yu(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)(rl,{type:"button",icon:za,"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)=>Yu(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)(rl,{type:"button",icon:Ra,"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=Rl(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.deviceType.isMobile}),ref:this.excalidrawContainerRef,onDrop:this.handleAppOnDrop,tabIndex:0,onKeyDown:this.props.handleKeyboardGlobally?void 0:this.onKeyDown,children:(0,v.jsx)(vp.Provider,{value:this.excalidrawContainerValue,children:(0,v.jsxs)(fp.Provider,{value:this.deviceType,children:[(0,v.jsx)(cp,{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)(pc,{element:i[0],appState:this.state,setAppState:this.setAppState,onLinkOpen:this.props.onLinkOpen},i[0].id),this.state.showStats&&(0,v.jsx)(dp,{appState:this.state,setAppState:this.setAppState,elements:this.scene.getElements(),onClose:this.toggleStats,renderCustomStats:l}),null!==this.state.toastMessage&&(0,v.jsx)(up,{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.deviceType=gn(this.deviceType,{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.deviceType=gn(this.deviceType,{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(),fr=new WeakMap,br=new WeakMap,jr=new WeakMap,this.scene=new Un,this.history=new th,this.actionManager=new Zu(this.syncActionResult,(()=>this.state),(()=>this.scene.getElementsIncludingDeleted()),this),this.library=new qu(this),this.canvas=null,this.rc=null,this.excalidrawContainerRef.current=void 0,this.nearestScrollableContainer=void 0,this.excalidrawContainerValue={container:null,id:"unmounted"},clearTimeout(jp),jp=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&&kn(this.state)&&this.setState({activeTool:{type:"selection"}}),t.theme!==this.state.theme&&Zt(this.canvas,this.state.theme),"selection"===t.activeTool.type&&"selection"!==this.state.activeTool.type&&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(ic)}));const{multiElement:r}=t;t.activeTool!==this.state.activeTool&&null!=r&&Eo(this.state)&&Te(r)&&Mo(r,this.state,this.scene,on(_o.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]=en({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}=Ic(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.deviceType.isMobile});h&&(Ip=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(){yp=!1}addTextFromPaste(e){const{x:t,y:n}=Jt({clientX:kp,clientY:_p},this.state),r=ni({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()}setActiveTool(e){var t;Cp||qt(this.canvas,this.state),(t=document.activeElement)instanceof HTMLElement&&t.className.includes("ToolIcon")&&this.focusContainer(),je(e.type)||this.setState({suggestedBindings:[]}),"image"===e.type&&this.onImageAction(),"selection"!==e.type?this.setState({activeTool:e,selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}):this.setState({activeTool: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)?ri(i,{text:t,isDeleted:r,originalText:n}):i))])};El({id:e.id,canvas:this.canvas,getViewportCoords:(e,t)=>{const{x:n,y:r}=en({sceneX:e,sceneY:t},this.state);return[n-this.state.offsetLeft,r-this.state.offsetTop]},onChange:ln((t=>{r(t,t,!1),Ml(e)&&Ho(e)})),onSubmit:ln((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&&qo(this.scene.getElements(),[e]),s&&!n||this.history.resumeRecording(),this.setState({draggingElement:null,editingElement:null}),this.state.elementLocked&&qt(this.canvas,this.state),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 Hi(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 Bi(t,e)?Fi(e,o,i):Ni(e,t,o)})(n,this.state,e,t)))}maybeCleanupAfterMissingPointerUp(e){null!==Mp&&Mp(e)}updateGestureOnPointerDown(e){Op.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),2===Op.pointers.size&&(Op.lastCenter=$u(Op.pointers),Op.initialScale=this.state.zoom.value,Op.initialDistance=Qu(Array.from(Op.pointers.values())))}initialPointerDownState(e){const t=Jt(e,this.state),n=Rl(this.scene.getElements(),this.state),[r,i,o,a]=et(n);return{origin:t,withCmdOrCtrl:e[Lt.CTRL_OR_CMD],originInGrid:on(Ke(t.x,t.y,this.state.gridSize)),scrollbars:Pl(Ip,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,oi(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;Sp=!0,t.lastCoords.x=e.clientX,t.lastCoords.y=e.clientY;const n=cn((e=>{e.target instanceof HTMLElement&&this.handlePointerMoveOverScrollbars(e,t)})),r=ln((()=>{Sp=!1,qt(this.canvas,this.state),Mp=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 Mp=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 ln((t=>{this.maybeHandleResize(e,t)||this.maybeDragNewGenericElement(e,t)}))}onKeyUpFromPointerDownHandler(e){return ln((t=>{t.key===Lt.ALT&&t.preventDefault(),this.maybeHandleResize(e,t)||this.maybeDragNewGenericElement(e,t)}))}onPointerMoveFromPointerDownHandler(e){return cn((t=>{var n,r;null===e.drag.offset&&(e.drag.offset=on(((e,t,n)=>{const[r,i]=et(e);return[t-r,n-i]})(Rl(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=Jt(t,this.state);if(kn(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.activeTool.type||"line"===this.state.activeTool.type)&&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(_o.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=Rl(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(sa(i,o,a,e,n,d),!n.groupIds.length||s.editingGroupId&&!Kr(s,n)){const t=ir(n);t&&sa(i,o,a,e,t,d)}Ho(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=Rl(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=ai(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);Rr(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];Kn(t,n,a),Xo(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];Rr(l,{points:[...e,[n,r]],pressures:i})}}else if(Ie(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}=Fr(this.state.activeTool.type,r,o)),1===n.length?Rr(l,{points:[...n,[r,o]]}):n.length>1&&Rr(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.activeTool.type){e.boxSelection.hasOccurred=!0;const n=this.scene.getElements();if(t.shiftKey||this.state.editingLinearElement||!Dl(n,this.state)||(e.withCmdOrCtrl&&e.hit.element?this.setState((t=>Yr(Object.assign(Object.assign({},t),{selectedElementIds:{[e.hit.element.id]:!0}}),this.scene.getElements()))):this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})),this.state.editingLinearElement)_o.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=>Yr(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 ln((t=>{const{draggingElement:n,resizingElement:r,multiElement:i,activeTool: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=_o.handlePointerUp(t,this.state.editingLinearElement,this.state);e!==this.state.editingLinearElement&&this.setState({editingLinearElement:e,suggestedBindings:[]})}else this.actionManager.executeAction(ic);if(Mp=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=Jt(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 Rr(n,{points:[...r,[i,o]],pressures:a,lastCommittedPoint:[i,o]}),void this.actionManager.executeAction(ic)}if(_e(n)){const e=n;try{this.initializeImageDimensions(e),this.setState({selectedElementIds:{[e.id]:!0}},(()=>{this.actionManager.executeAction(ic)}))}catch(t){console.error(t),this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().filter((t=>t.id!==e.id))),this.actionManager.executeAction(ic)}return}if(Ie(n)){n.points.length>1&&this.history.resumeRecording();const r=Jt(t,this.state);return void(e.drag.hasOccurred||!n||i?e.drag.hasOccurred&&!i&&(Eo(this.state)&&Te(n)&&Mo(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,activeTool:{type:"selection"},selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[this.state.draggingElement.id]:!0})}))))):(Rr(n,{points:[...n.points,[r.x-n.x,r.y-n.y]]}),this.setState({multiElement:n,editingElement:this.state.draggingElement})))}if("selection"!==a.type&&n&&Br(n))return this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().slice(0,-1)),void this.setState({draggingElement:null});n&&Rr(n,Ur(n)),r&&this.history.resumeRecording(),r&&Br(r)&&this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().filter((e=>e.id!==r.id)));const h=e.hit.element;if(kn(this.state)){if(0===He(this.lastPointerDown.clientX,this.lastPointerDown.clientY,this.lastPointerUp.clientX,this.lastPointerUp.clientY)){const t=Jt({clientX:this.lastPointerUp.clientX,clientY:this.lastPointerUp.clientY},this.state);this.getElementsAtPosition(t.x,t.y).forEach((t=>e.elementIdsToErase[t.id]={erase:!0,opacity:t.opacity}))}this.eraseElements(e)}else{if(Object.keys(e.elementIdsToErase).length&&this.restoreReadyToEraseElements(e),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(Kr(this.state,h)){const e=h.groupIds.flatMap((e=>Zr(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=>Yr(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({},Yr(Object.assign(Object.assign({},e),{selectedElementIds:{[h.id]:!0}}),this.scene.getElements()))));this.state.editingLinearElement||e.drag.hasOccurred||this.state.isResizing||!(h&&Hi(h,this.state,e.origin.x,e.origin.y)||!h&&e.hit.hasHitCommonBoundingBoxOfSelectedElements)?(!s&&"freedraw"!==a.type&&n&&this.setState((e=>({selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[n.id]:!0})}))),("selection"!==a.type||Dl(this.scene.getElements(),this.state))&&this.history.resumeRecording(),(e.drag.hasOccurred||l||c)&&(Eo(this.state)?jo:Po)(Rl(this.scene.getElements(),this.state)),s||"freedraw"===a.type?this.setState({draggingElement:null,suggestedBindings:[]}):(Vt(this.canvas),this.setState({draggingElement:null,suggestedBindings:[],activeTool:{type:"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)?Wo(e).filter((e=>!t.has(e.id))):Oe(e)?Go(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&&Xr(e,t.editingGroupId)?t.editingGroupId:null}))),this.setState({selectedElementIds:{},previousSelectedElementIds:this.state.selectedElementIds})}getTextWysiwygSnappedToCenterPosition(e,t,n,r,i){const a=Gs(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}=en({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({})}}Lp.defaultProps={UIOptions:o.cW};var Ap=function(){var e=this;this.canvas=null,this.rc=null,this.unmounted=!1,this.deviceType={isMobile:!1,isTouchScreen:!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=ln((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&&Ml(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=ln((()=>{Cp=!1,this.setState({isBindingEnabled:!0})})),this.onUnload=()=>{this.onBlur()},this.disableEvent=e=>{e.preventDefault()},this.onFontLoaded=()=>{this.scene.getElementsIncludingDeleted().forEach((e=>{Ce(e)&&yr(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=ln((e=>{this.scene.replaceAllElements([]),this.setState((t=>Object.assign(Object.assign({},fn()),{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,wd(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=fd(r.libraryItems,"unpublished"))}catch(e){console.error(e),r={appState:{errorMessage:e.message||"Encountered an error during importing or restoring scene data"}}}const a=md(r,null,null);a.appState=Object.assign(Object.assign({},a.appState),{activeTool:"image"===a.appState.activeTool.type?{type:"selection"}:a.appState.activeTool,isLoading:!1}),null!==(e=r)&&void 0!==e&&e.scrollToContent&&(a.appState=Object.assign(Object.assign({},a.appState),sl(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=ln((()=>{this.scene.getElementsIncludingDeleted().forEach((e=>yr(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=ln((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=ln((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(Bl)},this.copyAll=()=>{au(this.scene.getElements(),this.state,this.files)},this.onTapStart=e=>{if(dt||e.preventDefault(),!yp)return yp=!0,clearTimeout(wp),void(wp=window.setTimeout(Lp.resetTapTwice,o.Gj));if(yp&&1===e.touches.length){const[t]=e.touches;this.handleCanvasDoubleClick({clientX:t.clientX,clientY:t.clientY}),yp=!1,clearTimeout(wp)}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}):Op.pointers.clear()},this.pasteFromClipboard=ln((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(kp,_p);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 cu(e);if(!o&&a.text){const e=a.text.trim();e.startsWith("<svg")&&e.endsWith("</svg>")&&(o=Id(e))}if(yd(o)&&!a.spreadsheet){const{x:e,y:t}=Jt({clientX:kp,clientY:_p},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.setActiveTool({type:"selection"}),null==e||e.preventDefault()})),this.addElementsFromPasteOrLibrary=e=>{const t=pd(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?kp:this.state.width/2+this.state.offsetLeft,c="object"==typeof e.position?e.position.clientY:"cursor"===e.position?_p:this.state.height/2+this.state.offsetTop,{x:d,y:u}=Jt({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=ai(this.state.editingGroupId,g,e,{x:e.x+m-n,y:e.y+f-r});return b.set(e.id,t.id),t}));Kn(v,t,b);const x=[...this.scene.getElementsIncludingDeleted(),...v];Xo(x,t,b),e.files&&(this.files=Object.assign(Object.assign({},this.files),e.files)),this.scene.replaceAllElements(x),this.history.resumeRecording(),this.setState(Yr(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.setActiveTool({type:"selection"})},this.setAppState=e=>{this.setState(e)},this.removePointer=e=>{jp&&this.resetContextMenuTimer(),Op.pointers.delete(e.pointerId)},this.toggleLock=()=>{this.setState((e=>({elementLocked:!e.elementLocked,activeTool:e.elementLocked?{type:"selection"}:e.activeTool})))},this.togglePenMode=()=>{this.setState((e=>({penMode:!e.penMode})))},this.toggleZenMode=()=>{this.actionManager.executeAction(Wu)},this.toggleStats=()=>{this.state.showStats||sc("dialog","stats"),this.actionManager.executeAction(Ku)},this.scrollToContent=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.scene.getElements();e.setState(Object.assign({},sl(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=ln((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),yr(e))})),this.scene.informMutation(),this.addNewImagesToImageCache()})),this.updateScene=ln((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(fd(e.libraryItems,"unpublished"))})),this.onSceneUpdated=()=>{this.setState({})},this.updateCurrentCursorPosition=ln((e=>{kp=e.clientX,_p=e.clientY})),this.onKeyDown=ln((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=Rl(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=>{Rr(e,{x:e.x+r,y:e.y+i}),Ho(e,{simultaneouslyUpdated:n})})),this.maybeSuggestBindingForAll(n),e.preventDefault()}else if(e.key===Lt.ENTER){const t=Rl(this.scene.getElements(),this.state);if(1===t.length&&Ie(t[0]))this.state.editingLinearElement&&this.state.editingLinearElement.elementId===t[0].id||(this.history.resumeRecording(),this.setState({editingLinearElement:new _o(t[0],this.scene)}));else if(1===t.length&&!Ie(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=nh.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.setActiveTool({type:t}):e.key===Lt.Q&&this.toggleLock()}if(e.key===Lt.SPACE&&0===Op.pointers.size&&(Cp=!0,Gt(this.canvas,o.oc.GRABBING),e.preventDefault()),e.key===Lt.G||e.key===Lt.S){const t=Rl(this.scene.getElements(),this.state);if("selection"===this.state.activeTool.type&&!t.length)return;e.key===Lt.G&&(Hs(this.state.activeTool.type)||t.some((e=>Hs(e.type))))&&this.setState({openPopup:"backgroundColorPicker"}),e.key===Lt.S&&this.setState({openPopup:"strokeColorPicker"})}}})),this.onKeyUp=ln((e=>{if(e.key===Lt.SPACE&&(this.state.viewModeEnabled?Gt(this.canvas,o.oc.GRAB):"selection"===this.state.activeTool.type?Vt(this.canvas):(qt(this.canvas,this.state),this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})),Cp=!1),e[Lt.CTRL_OR_CMD]||this.state.isBindingEnabled||this.setState({isBindingEnabled:!0}),At(e.key)){const e=Rl(this.scene.getElements(),this.state);Eo(this.state)?jo(e):Po(e),this.setState({suggestedBindings:[]})}})),this.onGestureStart=ln((e=>{e.preventDefault(),this.setState({selectedElementIds:{}}),Op.initialScale=this.state.zoom.value})),this.onGestureChange=ln((e=>{if(e.preventDefault(),Op.pointers.size>=2)return;const t=Op.initialScale;t&&this.setState((n=>Object.assign({},cl({viewportX:kp,viewportY:_p,nextZoom:ll(t*e.scale)},n))))})),this.onGestureEnd=ln((e=>{e.preventDefault(),this.setState({previousSelectedElementIds:{},selectedElementIds:this.state.previousSelectedElementIds}),Op.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=Rl(this.scene.getElements(),this.state);if(1===g.length&&(Ce(g[0])?h=g[0]:Le(g[0])&&(p=g[0],h=ir(p))),h=null!==(t=h)&&void 0!==t?t:this.getTextElementAtPosition(s,l),p||h||!c&&!u||(p=Gs(this.scene.getElements().filter((e=>Le(e)&&!ir(e))),s,l)),!h&&p){const e={fontSize:this.state.currentItemFontSize,fontFamily:this.state.currentItemFontFamily},t=er(Ut(e)),n=tr(Ut(e)),r=Math.max(p.height,n),i=Math.max(p.width,t);Rr(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||ni({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||Rr(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.activeTool.type)return;const t=Rl(this.scene.getElements(),this.state);if(1===t.length&&Ie(t[0]))return void(this.state.editingLinearElement&&this.state.editingLinearElement.elementId===t[0].id||(this.history.resumeRecording(),this.setState({editingLinearElement:new _o(t[0],this.scene)})));Vt(this.canvas);let{x:n,y:r}=Jt(e,this.state);if(Gr(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=>Yr(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=Rl(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&&i<=r&&yc(n,this.state,[e.x,e.y],this.deviceType.isMobile))))},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=Jt(this.lastPointerDown,this.state),i=yc(this.hitLinkElement,this.state,[r.x,r.y],this.deviceType.isMobile),a=Jt(this.lastPointerUp,this.state),s=yc(this.hitLinkElement,this.state,[a.x,a.y],this.deviceType.isMobile);if(i&&s){const t=this.hitLinkElement.link;if(t){var l;let n;if(this.props.onLinkOpen&&(n=pn(o.Ks.EXCALIDRAW_LINK,e.nativeEvent),this.props.onLinkOpen(this.hitLinkElement,n)),null===(l=n)||void 0===l||!l.defaultPrevented){const e=fc(t)?"_self":"_blank",n=window.open(void 0,e);n&&(n.opener=null,n.location=mc(t))}}}},this.handleCanvasPointerMove=e=>{this.savePointer(e.clientX,e.clientY,this.state.cursorButton),Op.pointers.has(e.pointerId)&&Op.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY});const t=Op.initialScale;if(2===Op.pointers.size&&Op.lastCenter&&t&&Op.initialDistance){const e=$u(Op.pointers),n=e.x-Op.lastCenter.x,r=e.y-Op.lastCenter.y;Op.lastCenter=e;const i=Qu(Array.from(Op.pointers.values())),o="freedraw"===this.state.activeTool.type&&this.state.penMode?1:i/Op.initialDistance,a=o?ll(t*o):this.state.zoom.value;this.setState((t=>{const i=cl({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 Op.lastCenter=Op.initialDistance=Op.initialScale=null;if(Cp||Ep||Sp)return;const n=Pl(Ip,e.clientX-this.state.offsetLeft,e.clientY-this.state.offsetTop).isOverEither;this.state.draggingElement||this.state.multiElement||(n?Vt(this.canvas):qt(this.canvas,this.state));const r=Jt(e,this.state),{x:i,y:a}=r;if(this.state.editingLinearElement&&!this.state.editingLinearElement.isDragging){const t=_o.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.activeTool.type)){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 qt(this.canvas,this.state),void(l===s?He(i-t,a-n,l[0],l[1])>=o.qx?Rr(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),Rr(e,{points:r.slice(0,-1)})):(Ne(r,this.state.zoom.value)&&Gt(this.canvas,o.oc.POINTER),Rr(e,{points:[...r.slice(0,-1),[i-t,a-n]]})))}if(Boolean(e.buttons)||"selection"!==this.state.activeTool.type&&"text"!==this.state.activeTool.type&&"eraser"!==this.state.activeTool.type)return;const s=this.scene.getElements(),l=Rl(s,this.state);if(1!==l.length||n||this.state.editingLinearElement){if(l.length>1&&!n){const t=yo(et(l),i,a,this.state.zoom,e.pointerType);if(t)return void Gt(this.canvas,ko({transformHandleType:t}))}}else{const t=xo(s,this.state,i,a,this.state.zoom,e.pointerType);if(t&&t.transformHandleType)return void Gt(this.canvas,ko(t))}const c=this.getElementAtPosition(r.x,r.y);var d,u;if(this.hitLinkElement=this.getElementLinkAtPosition(r,c),!kn(this.state))if(this.hitLinkElement&&!this.state.selectedElementIds[this.hitLinkElement.id])Gt(this.canvas,o.oc.POINTER),d=this.hitLinkElement,u=this.state,wc&&clearTimeout(wc),wc=window.setTimeout((()=>kc(d,u)),o.sA);else if(wc&&clearTimeout(wc),hc&&(hc=!1,dl().classList.remove("excalidraw-tooltip--visible")),c&&c.link&&this.state.selectedElementIds[c.id]&&!this.contextMenuOpen&&!this.state.showHyperlinkPopup)this.setState({showHyperlinkPopup:"info"});else if("text"===this.state.activeTool.type)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=_o.getElement(this.state.editingLinearElement.elementId);e&&Ni(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)},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].erase&&(t.elementIdsToErase[n.id].erase=!1):t.elementIdsToErase[n.id]||(t.elementIdsToErase[n.id]={erase:!0,opacity:n.opacity})}))},i=[],a=He(t.lastCoords.x,t.lastCoords.y,n.x,n.y),s=10/this.state.zoom.value,l=Object.assign({},t.lastCoords);let c=0;for(;c<=a;){if(r(this.getElementsAtPosition(l.x,l.y)),c===a)break;c=Math.min(c+s,a);const e=c/a,t=(1-e)*l.x+e*n.x,i=(1-e)*l.y+e*n.y;l.x=t,l.y=i}const d=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 Hr(n,{opacity:o.xY});if(t.elementIdsToErase[r]&&!1===t.elementIdsToErase[r].erase)return Hr(n,{opacity:t.elementIdsToErase[r].opacity})}return n}));this.scene.replaceAllElements(d),t.lastCoords.x=n.x,t.lastCoords.y=n.y},this.handleTouchMove=e=>{Tp=!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}))),!this.deviceType.isTouchScreen&&["pen","touch"].includes(e.pointerType)&&(this.deviceType=gn(this.deviceType,{isTouchScreen:!0})),Ep)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),Op.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.activeTool.type||"text"===this.state.activeTool.type||"image"===this.state.activeTool.type))return;if("text"===this.state.activeTool.type)return void this.handleTextOnPointerDown(e,n);if("arrow"===this.state.activeTool.type||"line"===this.state.activeTool.type)this.handleLinearElementOnPointerDown(e,this.state.activeTool.type,n);else if("image"===this.state.activeTool.type){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}=Jt(e,this.state);Rr(this.state.pendingImageElement,{x:t,y:n})}else"freedraw"===this.state.activeTool.type?this.handleFreeDrawElementOnPointerDown(e,this.state.activeTool.type,n):"eraser"!==this.state.activeTool.type&&this.createGenericElementOnPointerDown(this.state.activeTool.type,n);const r=this.onPointerMoveFromPointerDownHandler(n),i=this.onPointerUpFromPointerDownHandler(n),a=this.onKeyDownFromPointerDownHandler(n),s=this.onKeyUpFromPointerDownHandler(n);Mp=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=>{if(this.lastPointerUp=e,this.deviceType.isTouchScreen){const t=Jt({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,this.deviceType.isTouchScreen),this.removePointer(e)},this.maybeOpenContextMenuAfterPointerDownOnTouchDevices=e=>{"touch"===e.pointerType&&(Tp=!1,jp?Tp=!0:jp=window.setTimeout((()=>{jp=0,Tp||this.handleCanvasContextMenu(e)}),o.nM))},this.resetContextMenuTimer=()=>{clearTimeout(jp),jp=0,Tp=!1},this.handleCanvasPanUsingWheelOrSpaceDrag=e=>{if(0!==Op.pointers.size||!(e.button===o.Oh.WHEEL||e.button===o.Oh.MAIN&&Cp||this.state.viewModeEnabled)||Ce(this.state.editingElement))return!1;Ep=!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=cn((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=ln(Mp=()=>{Mp=null,Ep=!1,Cp||(this.state.viewModeEnabled?Gt(this.canvas,o.oc.GRAB):qt(this.canvas,this.state)),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.activeTool.type&&this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})},this.handleSelectionOnPointerDown=(e,t)=>{if("selection"===this.state.activeTool.type){const r=this.scene.getElements(),i=Rl(r,this.state);if(1!==i.length||this.state.editingLinearElement)i.length>1&&(t.resize.handleType=yo(et(i),t.origin.x,t.origin.y,this.state.zoom,e.pointerType));else{const n=xo(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,ko({transformHandleType:t.resize.handleType})),t.resize.isResizing=!0,t.resize.offset=on(((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&&Ie(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=_o.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(yc(t.hit.element,this.state,[t.origin.x,t.origin.y],this.deviceType.isMobile))return!1;t.hit.hasHitElementInside=Ni(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&&!Xr(r,this.state.editingGroupId)&&this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}),i||t.hit.hasHitCommonBoundingBoxOfSelectedElements||(this.setState((e=>Yr(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({activeTool:{type:"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({},Jr(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];Rr(o,{points:[[0,0]],pressures:s});const l=zo(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({},Jr("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 Rr(e,{lastCommittedPoint:e.points[e.points.length-1]}),void this.actionManager.executeAction(ic);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(ic);this.setState((t=>({selectedElementIds:Object.assign(Object.assign({},t.selectedElementIds),{[e.id]:!0})}))),Rr(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=ii({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})}))),Rr(l,{points:[...l.points,[0,0]]});const c=zo(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=ei({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.restoreReadyToEraseElements=e=>{const t=this.scene.getElements().map((t=>e.elementIdsToErase[t.id]&&e.elementIdsToErase[t.id].erase?Hr(t,{opacity:e.elementIdsToErase[t.id].opacity}):Pe(t)&&e.elementIdsToErase[t.containerId]&&e.elementIdsToErase[t.containerId].erase?Hr(t,{opacity:e.elementIdsToErase[t.containerId].opacity}):t));this.scene.replaceAllElements(t)},this.eraseElements=e=>{const t=this.scene.getElements().map((t=>e.elementIdsToErase[t.id]&&e.elementIdsToErase[t.id].erase||Pe(t)&&e.elementIdsToErase[t.containerId]&&e.elementIdsToErase[t.containerId].erase?Hr(t,{isDeleted:!0}):t));this.history.resumeRecording(),this.scene.replaceAllElements(t)},this.initializeImage=async e=>{var t,n,r;let{imageFile:i,imageElement:a,showCursorImagePreview:s=!1}=e;if(!yd(i))throw new Error(b("errors.unsupportedFileType"));const l=i.type;if(Gt(this.canvas,"wait"),l===o.LO.svg)try{i=Id(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))||Cd(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 Sd(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 Ed(i),p=Rr(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){Rr(e,{isDeleted:!0}),this.actionManager.executeAction(ic),this.setState({errorMessage:t.message||b("errors.imageInsertError")})}},this.setImagePreviewCursor=async e=>{const t=await Sd(e,{maxWidthOrHeight:96});let n=await Ed(t);if(e.type===o.LO.svg){const e=await Ld(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}=Jt({clientX:n,clientY:r},e.state),a=await ld({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(ic)}))):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,activeTool:{type:"selection"}},(()=>{e.actionManager.executeAction(ic)}))}},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;Rr(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;Rr(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 Ad({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)&&yr(e);return i.size&&e.scene.replaceAllElements(e.scene.getElementsIncludingDeleted().map((e=>ke(e)&&i.has(e.fileId)?Hr(e,{status:"error"}):e))),{updatedFiles:r,erroredFiles:i}},this.addNewImagesToImageCache=async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Pd(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=gp()((()=>{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=zo(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=zo(r,this.scene);return null==i||Ao(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(yd(t)){if((null==t?void 0:t.type)===o.LO.png||(null==t?void 0:t.type)===o.LO.svg)try{if(od)try{const n=e.dataTransfer.items[0];t.handle=await n.getAsFileSystemHandle()}catch(e){console.warn(e.name,e.message)}const n=await wd(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}=Jt(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}),od)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=>{wd(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.activeTool.type)return;const{x:t,y:n}=Jt(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&&"eraser"!==this.state.activeTool.type)la(n,this.state.activeTool.type,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;la(n,this.state.activeTool.type,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=Rl(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?(Jo(c,s,l,i),Ho(c)):!Ie(c)||2!==c.points.length||"nw"!==t&&"ne"!==t&&"sw"!==t&&"se"!==t?!Ce(c)||"nw"!==t&&"ne"!==t&&"sw"!==t&&"se"!==t?t&&ia(e.originalElements,a,c,t,o,s,l):(ra(c,t,o,s,l),Ho(c)):ea(c,r,i,s,l),!0}if(n.length>1){if("rotation"===t)return aa(e,n,s,l,i,c,d),!0;if("nw"===t||"ne"===t||"sw"===t||"se"===t)return oa(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=_u.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),o=Cu.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),a=Lu.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),s=Au.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),l=Vu.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),c=Gu.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),d="separator",u=this.scene.getElements(),h=[];if(ou&&u.length>0&&h.push(Fu),iu&&u.length>0&&h.push(Bu),"canvas"===t){const e=[...h,void 0===this.props.gridModeEnabled&&Uu,void 0===this.props.zenModeEnabled&&Wu,void 0===this.props.viewModeEnabled&&hp,Ku];this.state.viewModeEnabled?sh.push({options:e,top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current,elements:u}):sh.push({options:[this.deviceType.isMobile&&navigator.clipboard&&{name:"paste",perform:(e,t)=>(this.pasteFromClipboard(null),{commitToHistory:!1}),contextItemLabel:"labels.paste"},this.deviceType.isMobile&&navigator.clipboard&&d,ou&&u.length>0&&Fu,iu&&u.length>0&&Bu,(ou&&u.length>0||iu&&u.length>0)&&d,tc,d,void 0===this.props.gridModeEnabled&&Uu,void 0===this.props.zenModeEnabled&&Wu,void 0===this.props.viewModeEnabled&&hp,Ku],top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current,elements:u})}else"element"===t&&(this.state.viewModeEnabled?sh.push({options:[navigator.clipboard&&Hu,...h],top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current,elements:u}):sh.push({options:[this.deviceType.isMobile&&Nu,this.deviceType.isMobile&&navigator.clipboard&&Hu,this.deviceType.isMobile&&navigator.clipboard&&{name:"paste",perform:(e,t)=>(this.pasteFromClipboard(null),{commitToHistory:!1}),contextItemLabel:"labels.paste"},this.deviceType.isMobile&&d,...h,d,xu,yu,d,i&&_u,l&&Vu,c&&Gu,o&&Cu,(i||o)&&d,Su,d,$l,Ql,Jl,ec,d,a&&Lu,s&&Au,(a||s)&&d,bc.contextItemPredicate(u,this.state)&&bc,nc,Bl],top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current,elements:u}))},this.handleWheel=ln((e=>{if(e.preventDefault(),Ep)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({},cl({viewportX:kp,viewportY:_p,nextZoom:ll(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=Jt({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:Op.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 Pp=Lp;n(4285),n(3313);var Dp=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 zp=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:I,autoFocus:j=!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)(Pp,{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:I,autoFocus:j,generateIdForFile:T,onLinkOpen:M})})},Rp=(e,t)=>{const{initialData:n,UIOptions:r={}}=e,i=Dp(e,["initialData","UIOptions"]),{initialData:o,UIOptions:a={}}=t,s=Dp(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]))},Hp=(0,r.forwardRef)(((e,t)=>(0,v.jsx)(zp,Object.assign(Object.assign({},e),{excalidrawRef:t})))),Np=i().memo(Hp,Rp);n(8336);const Bp=Np},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":"Sharing","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","bindText":"Bind text to the container","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","tools":"Tools","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(6439)})()}));
|
|
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(e);l=setTimeout(k,function(e){var n=t-(e-c);return h?g(n,a-(e-d)):n}(e))}function E(e){return l=void 0,f&&i?x(e):(i=o=void 0,s)}function _(){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),_.cancel=function(){void 0!==l&&clearTimeout(l),d=0,i=c=o=l=void 0},_.flush=function(){return void 0===l?s:E(m())},_}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]",E="[object Function]",_="[object GeneratorFunction]",C="[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=/($^)/,Ee=/['\n\r\u2028\u2029\\]/g,_e="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ce="\\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="["+_e+"]",Pe="\\d+",De="[\\u2700-\\u27bf]",ze="["+Se+"]",Re="[^\\ud800-\\udfff"+Te+Pe+Ce+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"+_e+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[E]=at[C]=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[C]=st[S]=st[j]=st[T]=st[M]=st[O]=st[L]=st[F]=st[U]=st[W]=st[K]=!0,st[k]=st[E]=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,Et=vt&&vt.isSet,_t=vt&&vt.isTypedArray;function Ct(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,_e=t.Error,Ce=t.Function,Se=t.Math,je=t.Object,Ie=t.RegExp,Te=t.String,Me=t.TypeError,Oe=r.prototype,Le=Ce.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,En=t.parseInt,_n=Se.random,Cn=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==E||h==_;if($a(e))return Ci(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 C: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(Er,!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 Er(e,t){return e&&wr(e,t,Ps)}function _r(e,t){return Mt(t,(function(t){return es(e[t])}))}function Cr(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:Ct(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 C: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 Eo(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=Ci(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 Cr(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=Cr(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(_n()*(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(Cr(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:Eo(e,t)?[e]:No(ws(e))}var ki=Qr;function Ei(e,t,n){var r=e.length;return n=n===i?r:n,!t&&n>=r?e:oi(e,t,n)}var _i=ut||function(e){return pt.clearTimeout(e)};function Ci(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?Ei(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&&_o(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?l[lo(d[0])].apply(l,d[3]):1==s.length&&_o(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 E=dn(x,w);return Zi(e,t,Ui,i.placeholder,n,x,E,c,d,h-u)}var _=g?n:this,C=m?_[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&&(C=v||Ni(C)),C.apply(_,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 Ct(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)?Ei(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 _o(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==C?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)E=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):Ct(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 Ct(h,o?n:this,u)}}(e,t,n,a);else var E=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)(E,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 Eo(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 _o(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)!=C||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 C;case zn:return I;case Rn:return M;case Hn:return A}return t});var Co=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),Ct(e,this,l)}}function Mo(e,t){return t.length<2?e:Cr(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:Cn.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 Ct(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 Ea=Ai((function(e,t,n){ze.call(e,n)?e[n].push(t):sr(e,n,[t])}));var _a=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?Ct(t,e,n):Lr(e,t,n)})),a})),Ca=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 _i(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&&_i(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 Ct(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==E||t==_||"[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)==C};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=Et?$t(Et):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=_t?$t(_t):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==C?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])})),Es=Pi((function(e,t){Li(t,Ds(t),e)})),_s=Pi((function(e,t,n,r){Li(t,Ds(t),e,r)})),Cs=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),Ct(Rs,i,e)}));function Ts(e,t,n){var r=null==e?i:Cr(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 Ct(e,i,t)}catch(e){return Ja(e)?e:new _e(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=_r(t,r);null!=n||rs(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=_r(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 Eo(e)?Vt(Bo(e)):function(e){return function(t){return Cr(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),El=qi("floor");var _l,Cl=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=Es,Un.assignInWith=_s,Un.assignWith=Cs,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(Ct(i[0],this,n))return Ct(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?[]:_r(e,Ps(e))},Un.functionsIn=function(e){return null==e?[]:_r(e,Ds(e))},Un.groupBy=Ea,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=_a,Un.iteratee=sl,Un.keyBy=Ca,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:Cr(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)?Ei(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=Ei(n,0,t);return r&&Pt(i,r),Ct(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=Es,Un.extendWith=_s,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),Er)},Un.floor=El,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&&Er(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==C||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(Co(e))throw new _e("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=Cl,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),En(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=_n();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==C||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=_s({},t,r,eo);var o,a,s=_s({},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(Ee,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 _e("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 Ce(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 Ei(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 Ei(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 Ei(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?Ei(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,(_l={},kr(Un,(function(e,t){ze.call(Un.prototype,t)||(_l[t]=e)})),_l),{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 .finalize-button{display:grid;grid-auto-flow:column;gap:.4em;margin-top:auto;margin-bottom:auto;margin-inline-start:.6em}.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:()=>E,k:()=>_,LO:()=>C,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,xY:()=>J});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",E="top",_=20,C={excalidraw:"application/vnd.excalidraw+json",excalidrawlib:"application/vnd.excalidrawlib+json",json:"application/json",svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",gif:"image/gif",binary:"application/octet-stream"},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=[C.png,C.jpg,C.svg,C.gif],X=2097152,Z="http://www.w3.org/2000/svg",q={excalidraw:2,excalidrawLibrary:2},$=5,Q={TOP:"top",MIDDLE:"middle",BOTTOM:"bottom"},J=20},6439:(e,t,n)=>{"use strict";n.r(t),n.d(t,{FONT_FAMILY:()=>o.ut,THEME:()=>o.C6,bumpVersion:()=>Nr,cleanAppStateForExport:()=>yn,clearAppStateForLocalStorage:()=>xn,default:()=>Bp,defaultLang:()=>c,exportToBlob:()=>Yh,exportToCanvas:()=>Gh,exportToClipboard:()=>Zh,exportToSvg:()=>Xh,getDefaultAppState:()=>fn,getFreeDrawSvgPath:()=>Mr,getNonDeletedElements:()=>Tl,getSceneVersion:()=>jl,isInvisiblySmallElement:()=>Br,isLinearElement:()=>je,languages:()=>d,loadFromBlob:()=>kd,loadLibraryFromBlob:()=>Ed,mutateElement:()=>Rr,newElementWith:()=>Hr,restore:()=>md,restoreAppState:()=>gd,restoreElements:()=>pd,restoreLibraryItems:()=>bd,serializeAsJSON:()=>Md});var r=n(9787),i=n.n(r),o=n(8288);const a=JSON.parse('{"u2":"@dwelle/excalidraw","i8":"0.3.58"}');"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(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 _{constructor(e){this.helper=e}fillPolygons(e,t){return this._fillPolygons(e,t)}_fillPolygons(e,t){const n=E(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 C extends _{fillPolygons(e,t){let n=t.hachureGap;n<0&&(n=4*t.strokeWidth),n=Math.max(n,.1);const r=E(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 _{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(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(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(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),E=4/3*i*k,_=4/3*o*k,C=[e,t],S=[e+E*x,t-_*v],j=[n+E*w,r-_*y],I=[n,r];if(S[0]=2*C[0]-S[0],S[1]=2*C[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 C(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 _(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,Ee=e=>!!e&&"image"===e.type,_e=e=>null!=e&&"text"===e.type,Ce=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&&_e(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=>Ce(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||!vr(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=vr(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(Ce(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||!vr(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=vr(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)&&!Ce(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(Ce(e))i=qe(r);else{const t=ve.generator(),n="sharp"===e.strokeSharpness?t.linearPath(r,wr(e)):t.curve(r,wr(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,wr(e)):r.curve(t,wr(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",Et="KeyC",_t="KeyD",Ct="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)};let Yt,Xt;const Zt=(e,t)=>{Yt&&Yt.theme===t||(()=>{const e=t===o.C6.DARK;Yt=document.createElement("canvas"),Yt.theme=t,Yt.height=20,Yt.width=20;const n=Yt.getContext("2d");n.lineWidth=1,n.beginPath(),n.arc(Yt.width/2,Yt.height/2,5,0,2*Math.PI),n.fillStyle=e?it.black:it.white,n.fill(),n.strokeStyle=e?it.white:it.black,n.stroke(),Xt=Yt.toDataURL(o.LO.svg)})(),Gt(e,"url(".concat(Xt,") ").concat(10," ").concat(10,", auto"))},qt=(e,t)=>{e&&("selection"===t.activeTool.type?Vt(e):"eraser"===t.activeTool.type?Zt(e,t.theme):"image"!==t.activeTool.type&&(e.style.cursor=o.oc.CROSSHAIR))},$t=()=>{var e;return"HTML"===(null===(e=document.fullscreenElement)||void 0===e?void 0:e.nodeName)},Qt=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")),Jt=(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}},en=(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}},tn=e=>getComputedStyle(document.documentElement).getPropertyValue("--".concat(e)),nn=new RegExp("^[^".concat("A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-﷾--","]*[").concat("֑-߿יִ-﷽ﹰ-ﻼ","]")),rn=e=>nn.test(e),on=e=>{const[t,n]=e;return{x:t,y:n}},an=e=>{if("AbortError"!==(null==e?void 0:e.name))throw e;console.warn(e)},sn=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]},ln=e=>t=>{(0,st.unstable_batchedUpdates)(e,t)},cn=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)})),dn=()=>hn()?1:Date.now(),un=e=>e.reduce(((e,t)=>(e.set("string"==typeof t?t:t.id,t),e)),new Map),hn=()=>{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)},pn=(e,t)=>new CustomEvent(e,{detail:{nativeEvent:t},cancelable:!0}),gn=(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({},e),t):e},mn=o.ZB.includes(devicePixelRatio)?devicePixelRatio:1,fn=()=>({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,activeTool:{type:"selection",locked:!1,lastActiveToolBeforeEraser:null},penMode:!1,penDetected:!1,errorMessage:null,exportBackground:!0,exportScale:mn,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}),bn={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},activeTool:{browser:!0,export:!1,server:!1},penMode:{browser:!0,export:!1,server:!1},penDetected:{browser:!0,export:!1,server:!1},errorMessage:{browser:!1,export:!1,server:!1},exportBackground:{browser:!0,export:!1,server:!1},exportEmbedScene:{browser:!0,export:!1,server:!1},exportScale:{browser:!0,export:!1,server:!1},exportWithDarkMode:{browser:!0,export:!1,server:!1},fileHandle:{browser:!1,export:!1,server:!1},gridSize:{browser:!0,export:!0,server:!0},height:{browser:!1,export:!1,server:!1},isBindingEnabled:{browser:!1,export:!1,server:!1},isLibraryOpen:{browser:!1,export:!1,server:!1},isLoading:{browser:!1,export:!1,server:!1},isResizing:{browser:!1,export:!1,server:!1},isRotating:{browser:!1,export:!1,server:!1},lastPointerDownWith:{browser:!0,export:!1,server:!1},multiElement:{browser:!1,export:!1,server:!1},name:{browser:!0,export:!1,server:!1},offsetLeft:{browser:!1,export:!1,server:!1},offsetTop:{browser:!1,export:!1,server:!1},openMenu:{browser:!0,export:!1,server:!1},openPopup:{browser:!1,export:!1,server:!1},pasteDialog:{browser:!1,export:!1,server:!1},previousSelectedElementIds:{browser:!0,export:!1,server:!1},resizingElement:{browser:!1,export:!1,server:!1},scrolledOutside:{browser:!0,export:!1,server:!1},scrollX:{browser:!0,export:!1,server:!1},scrollY:{browser:!0,export:!1,server:!1},selectedElementIds:{browser:!0,export:!1,server:!1},selectedGroupIds:{browser:!0,export:!1,server:!1},selectionElement:{browser:!1,export:!1,server:!1},shouldCacheIgnoreZoom:{browser:!0,export:!1,server:!1},showHelpDialog:{browser:!1,export:!1,server:!1},showStats:{browser:!0,export:!1,server:!1},startBoundElement:{browser:!1,export:!1,server:!1},suggestedBindings:{browser:!1,export:!1,server:!1},toastMessage:{browser:!1,export:!1,server:!1},viewBackgroundColor:{browser:!0,export:!0,server:!0},width:{browser:!1,export:!1,server:!1},zenModeEnabled:{browser:!0,export:!1,server:!1},zoom:{browser:!0,export:!1,server:!1},viewModeEnabled:{browser:!1,export:!1,server:!1},pendingImageElement:{browser:!1,export:!1,server:!1},showHyperlinkPopup:{browser:!1,export:!1,server:!1}},vn=(e,t)=>{const n={};for(const r of Object.keys(e)){const i=bn[r];if(null!=i&&i[t]){const t=e[r];n[r]=t}}return n},xn=e=>vn(e,"browser"),yn=e=>vn(e,"export"),wn=e=>vn(e,"server"),kn=e=>{let{activeTool:t}=e;return"eraser"===t.type};function En(e,t,n,r=(e=>e)){return e*r(.5-t*(.5-n))}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 Sn(e,t){return[e[0]*t,e[1]*t]}function jn(e){return[e[1],-e[0]]}function In(e,t){return e[0]*t[0]+e[1]*t[1]}function Tn(e,t){return e[0]===t[0]&&e[1]===t[1]}function Mn(e,t){return function(e){return e[0]*e[0]+e[1]*e[1]}(Cn(e,t))}function On(e){return function(e,t){return[e[0]/t,e[1]/t]}(e,function(e){return Math.hypot(e[0],e[1])}(e))}function Ln(e,t){return Math.hypot(e[1]-t[1],e[0]-t[0])}function An(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 Pn(e,t,n){return _n(e,Sn(Cn(t,e),n))}function Dn(e,t,n){return _n(e,Sn(t,n))}var{min:zn,PI:Rn}=Math,Hn=Rn+1e-4;function Nn(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=zn(1,t.distance/n),o=zn(1,1-i);r=zn(1,e+.275*i*(o-e))}return(e+r)/2}),e[0].pressure),k=En(n,i,e[e.length-1].pressure,a),E=e[0].vector,_=e[0].point,C=_,S=_,j=C;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=zn(1,c/n),t=zn(1,1-e);r=zn(1,w+.275*e*(t-w))}k=En(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=Sn(jn(l),k);x.push(Cn(s,e)),y.push(_n(s,e));continue}let T=e[t+1].vector,M=In(l,T);if(M<0){let e=Sn(jn(E),k);for(let t=1/13,n=0;n<=1;n+=t)S=An(Cn(s,e),s,Hn*n),x.push(S),j=An(_n(s,e),s,Hn*-n),y.push(j);_=S,C=j;continue}let O=Sn(jn(Pn(T,l,M)),k);S=Cn(s,O),(t<=1||Mn(_,S)>v)&&(x.push(S),_=S),j=_n(s,O),(t<=1||Mn(C,j)>v)&&(y.push(j),C=j),w=r,E=l}let I=e[0].point.slice(0,2),T=e.length>1?e[e.length-1].point.slice(0,2):_n(e[0].point,[1,1]),M=[],O=[];if(1===e.length){if(!u&&!g||c){let e=Dn(I,On(jn(Cn(I,T))),-(f||k)),t=[];for(let n=1/13,r=n;r<=1;r+=n)t.push(An(e,I,2*Hn*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=An(y[0],I,Hn*t);M.push(e)}else{let e=Cn(x[0],y[0]),t=Sn(e,.5),n=Sn(e,.51);M.push(Cn(I,t),Cn(I,n),_n(I,n),_n(I,t))}let t=jn(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=Dn(T,t,k);for(let t=1/29,n=t;n<1;n+=t)O.push(An(e,T,3*Hn*n))}else O.push(_n(T,Sn(t,k)),_n(T,Sn(t,.99*k)),Cn(T,Sn(t,.99*k)),Cn(T,Sn(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(Pn(s[0],e,t/4))}1===s.length&&(s=[...s,[..._n(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):Pn(u.point,s[e],a);if(Tn(u.point,t))continue;let n=Ln(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:On(Cn(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 Bn=e=>"string"==typeof e;class Fn{constructor(){this.callbacks=new Set,this.nonDeletedElements=[],this.elements=[],this.elementsMap=new Map}static mapElementToScene(e,t){Bn(e)?this.sceneMapById.set(e,t):this.sceneMapByElement.set(e,t)}static getScene(e){return Bn(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&&Ml(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),Fn.mapElementToScene(e,this)})),this.nonDeletedElements=Tl(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(){Fn.sceneMapById.forEach(((e,t)=>{e===this&&Fn.sceneMapById.delete(t)})),this.callbacks.clear()}}Fn.sceneMapByElement=new WeakMap,Fn.sceneMapById=new Map;const Un=Fn,Wn=(e,t)=>{const n=t?t.width-2*o.gK:void 0;let r=e.text;t&&(r=Qn(e.originalText,Ut(e),t.width));const i=Gn(e.originalText,Ut(e),n);let a=e.y,s=e.x;if(t){let n=t.height;s=t.x+o.gK,e.verticalAlign===o.oX.TOP?a=t.y+o.gK:e.verticalAlign===o.oX.BOTTOM?a=t.y+t.height-i.height-o.gK:(a=t.y+t.height/2-i.height/2,i.height>t.height-2*o.gK&&(n=i.height+2*o.gK,a=t.y+n/2-i.height/2)),Rr(t,{height:n})}Rr(e,{width:i.width,height:i.height,baseline:i.baseline,y:a,x:s,text:r})},Kn=(e,t,n)=>{const r=un(e);t.forEach((e=>{const t=n.get(e.id),i=rr(e);if(i){const a=n.get(i);if(a){const n=r.get(t);var o;if(n)Rr(n,{boundElements:null===(o=e.boundElements)||void 0===o?void 0:o.concat({type:"text",id:a})});const i=r.get(a);i&&_e(i)&&Rr(i,{containerId:n?t:null})}}}))},Vn=(e,t)=>{const n=rr(e);if(n){const r=Un.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=Qn(r.originalText,Ut(r),e.width));const t=Gn(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;Rr(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,Rr(r,{text:i,width:e.width-2*o.gK,height:a,x:e.x+o.gK,y:n,baseline:l})}}},Gn=(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=Zn(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}},Yn="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".toLocaleUpperCase(),Xn={},Zn=e=>(Xn[e]||(Xn[e]=Gn(Yn,e,null).height),Xn[e]);let qn;const $n=(e,t)=>{qn||(qn=document.createElement("canvas"));const n=qn.getContext("2d");n.font=t;const r=n.measureText(e);return hn()?10*r.width:r.width},Qn=(e,t,n)=>{const r=n-2*o.gK,i=[],a=e.split("\n"),s=$n(" ",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($n(n[a],t)>=r){for(e&&i.push(e),e="",o=0;n[a].length>0;){const s=n[a][0],l=Jn.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=$n(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")},Jn=(()=>{const e={};return{calculate:(t,n)=>{const r=t.charCodeAt(0);if(e[n]||(e[n]=[]),!e[n][r]){const i=$n(t,n);e[n][r]=i}return e[n][r]},getCache:t=>e[t]}})(),er=e=>{const t=nr(e);return 0===t?Gn(Yn.split("").join("\n"),e).width+2*o.gK:t+2*o.gK},tr=e=>Zn(e)+2*o.gK,nr=e=>{const t=Jn.getCache(e);if(!t)return 0;const n=t.filter((e=>void 0!==e));return Math.max(...n)},rr=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},ir=e=>{if(!e)return null;const t=rr(e);var n;return t&&(null===(n=Un.getScene(e))||void 0===n?void 0:n.getElement(t))||null},or=e=>{return e&&e.containerId&&(null===(t=Un.getScene(e))||void 0===t?void 0:t.getElement(e.containerId))||null;var t},ar="invert(100%) hue-rotate(180deg) saturate(1.25)",sr=fn(),lr=(e,t)=>ke(e)&&!t.imageCache.has(e.fileId),cr=(e,t)=>{var n;return"dark"===t.theme&&ke(e)&&!lr(e,t)&&(null===(n=t.imageCache.get(e.fileId))||void 0===n?void 0:n.mimeType)!==o.LO.svg},dr=e=>[8,8+e],ur=e=>[1.5,6+e],hr=e=>"freedraw"===e.type?12*e.strokeWidth:20,pr=document.createElement("img");pr.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 gr=document.createElement("img");gr.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 mr=(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(vr(e));break;case"arrow":case"line":n.lineJoin="round",n.lineCap="round",vr(e).forEach((e=>{t.draw(e)}));break;case"freedraw":{n.save(),n.fillStyle=e.strokeColor;const r=function(e){return Ir.get(e)}(e),i=vr(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?gr:pr,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(!_e(e))throw new Error("Unimplemented type ".concat(e.type));{const t=rn(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?Zn(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 fr=new WeakMap,br=new WeakMap;const vr=e=>br.get(e),xr=(e,t)=>br.set(e,t),yr=e=>br.delete(e),wr=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n={seed:e.seed,strokeLineDash:"dashed"===e.strokeStyle?dr(e.strokeWidth):"dotted"===e.strokeStyle?ur(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))}},kr=(e,t)=>{let n=br.get(e);if(void 0===n)switch(fr.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"),wr(e,!0))}else n=t.rectangle(0,0,e.width,e.height,wr(e));xr(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)),wr(e,!0)):t.polygon([[r,i],[o,a],[s,l],[c,d]],wr(e)),xr(e,n);break}case"ellipse":n=t.ellipse(e.width/2,e.height/2,e.width,e.height,wr(e)),xr(e,n);break;case"line":case"arrow":{const r=wr(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),E=p-v*k,_=g-x*k;if("dot"===r)return[p,g,Math.hypot(_-g,E-p)+e.strokeWidth];const C={arrow:20,bar:90,triangle:25}[r],[S,j]=De(E,_,p,g,-C*Math.PI/180),[I,T]=De(E,_,p,g,C*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=ur(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)}}xr(e,n);break}case"freedraw":Tr(e),n=Ne(e.points)?t.polygon(e.points,Object.assign(Object.assign({},wr(e)),{stroke:"none"})):null,xr(e,n);break;case"text":case"image":xr(e,null)}},Er=(e,t)=>{const n=t?t.zoom:sr.zoom,r=fr.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=hr(e);let a=0,s=0;if(je(e)||Ce(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 cr(e,n)&&(i.filter=ar),mr(e,l,i,n),i.restore(),{element:e,canvas:r,theme:n.theme,canvasZoom:t.value,canvasOffsetX:a,canvasOffsetY:s}})(e,n,t);return fr.set(e,r),r}return r},_r=(e,t,n,r)=>{const i=e.element,o=hr(i);let[a,s,l,c]=Ye(i);Ce(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=lr(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()},Cr=(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(kr(e,i),r.isExporting){const t=Er(e,r);_r(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),mr(e,t,n,r),n.restore()}break;case"rectangle":case"diamond":case"ellipse":case"line":case"arrow":case"image":case"text":if(kr(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),cr(e,r)&&(n.filter="none"),mr(e,t,n,r),n.restore()}else{const t=Er(e,r);_r(t,0,n,r)}break;default:throw new Error("Unimplemented type ".concat(e.type))}},Sr=(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)},jr=(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":{kr(e,m);const n=Sr(t,vr(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":{kr(e,m);const r=n.ownerDocument.createElementNS(o.hR,"g"),s=e.opacity/100;r.setAttribute("stroke-linecap","round"),vr(e).forEach((n=>{const l=Sr(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":{kr(e,m),Tr(e);const r=e.opacity/100,s=vr(e),l=s?Sr(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",Mr(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",ar),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(!_e(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=rn(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 Ir=new WeakMap([]);function Tr(e){const t=Mr(e),n=new Path2D(t);return Ir.set(e,n),n}function Mr(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,Or(n,i[0]),"L",i[0],"Z"):e.push(n,Or(n,i[r+1])),e)),["M",e[0],"Q"]).join(" ").replace(Lr,"$1")}(Nn(t,n))}function Or(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}const Lr=/(\s?[A-Z]?,?-?[0-9]*\.[0-9]{0,2})(([0-9]|e|-)*)/g;let Ar=new O(Date.now()),Pr=0;const Dr=()=>Math.floor(Ar.next()*2**31),zr=()=>hn()?"id".concat(Pr++):we(),Rr=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||yr(e),e.version++,e.versionNonce=Dr(),e.updated=dn(),n)&&(null===(a=Un.getScene(e))||void 0===a||a.informMutation());return e},Hr=(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:dn(),version:e.version+1,versionNonce:Dr()}):e},Nr=(e,t)=>(e.version=(null!=t?t:e.version)+1,e.versionNonce=Dr(),e.updated=dn(),e),Br=e=>je(e)||Ce(e)?e.points.length<2:0===e.width&&0===e.height,Fr=(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}},Ur=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},Wr=(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]))))})},Kr=(e,t)=>null!=Vr(e,t),Vr=(e,t)=>t.groupIds.filter((t=>t!==e.editingGroupId)).find((t=>e.selectedGroupIds[t])),Gr=e=>Object.entries(e.selectedGroupIds).filter((e=>{let[t,n]=e;return n})).map((e=>{let[t,n]=e;return t})),Yr=(e,t)=>{let n=Object.assign(Object.assign({},e),{selectedGroupIds:{}});const r=Rl(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=Wr(e,n,t)}}return n},Xr=(e,t)=>e.groupIds.includes(t),Zr=(e,t)=>e.filter((e=>Xr(e,t))),qr=(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},$r=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=ir(e);i&&r.push(i),t.set(n,[...r,e])})),Array.from(t.values())};var Qr=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 Jr=(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=Qr(t,["x","y","strokeColor","backgroundColor","fillStyle","strokeWidth","strokeStyle","roughness","opacity","width","height","angle","groupIds","strokeSharpness","boundElements","link"]);return{id:y.id||zr(),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:Dr(),version:y.version||1,versionNonce:null!==(r=y.versionNonce)&&void 0!==r?r:0,isDeleted:!1,boundElements:v,updated:dn(),link:x}},ei=e=>Jr(e.type,e),ti=(e,t)=>({x:"center"===e.textAlign?t.width/2:"right"===e.textAlign?t.width:0,y:"middle"===e.verticalAlign?t.height/2:0}),ni=e=>{const t=Gn(e.text,Ut(e)),n=ti(e,t);return Hr(Object.assign(Object.assign({},Jr("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}),{})},ri=(e,t)=>{let{text:n,isDeleted:r,originalText:i}=t;const a=or(e);a&&(n=Qn(n,Ut(e),a.width));const s=((e,t)=>{let n=null;const r=or(e);r&&(n=r.width-2*o.gK);const{width:i,height:a,baseline:s}=Gn(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=Gn(e.text,Ut(e),n),r=ti(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||Rr(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 Hr(e,Object.assign({text:n,originalText:i,isDeleted:null!=r?r:e.isDeleted},s))},ii=e=>Object.assign(Object.assign({},Jr(e.type,e)),{points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:e.startArrowhead,endArrowhead:e.endArrowhead}),oi=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]=oi(e[r],t+1)}return n}if(Array.isArray(e)){let n=e.length;const r=new Array(n);for(;n--;)r[n]=oi(e[n],t+1);return r}return e},ai=(e,t,n,r)=>{let i=oi(n);var o,a;hn()?(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=zr();return i.updated=dn(),i.seed=Dr(),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,zr()),t.get(e)))),r&&(i=Object.assign(i,r)),i},si={mouse:8,pen:16,touch:28},li={e:!0,s:!0,n:!0,w:!0},ci={e:!0,s:!0,n:!0,w:!0},di={e:!0,s:!0,n:!0,w:!0,nw:!0,se:!0},ui={e:!0,s:!0,n:!0,w:!0,ne:!0,sw:!0},hi=(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]},pi=function(e,t,n,r){let[i,o,a,s]=e,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const c=si[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:hi(i-v-h+x,o-v-p+x,d,u,f,b,t),ne:l.ne?void 0:hi(a+v-x,o-v-p+x,d,u,f,b,t),sw:l.sw?void 0:hi(i-v-h+x,s+v-x,d,u,f,b,t),se:l.se?void 0:hi(a+v-x,s+v-x,d,u,f,b,t),rotation:l.rotation?void 0:hi(i+g/2-d/2,o-v-p+x-16/n.value,d,u,f,b,t)},w=5*si.mouse/n.value;return Math.abs(g)>w&&(l.n||(y.n=hi(i+g/2-d/2,o-v-p+x,d,u,f,b,t)),l.s||(y.s=hi(i+g/2-d/2,s+v-x,d,u,f,b,t))),Math.abs(m)>w&&(l.w||(y.w=hi(i-v-h+x,o+m/2-u/2,d,u,f,b,t)),l.e||(y.e=hi(a+v-x,o+m/2-u/2,d,u,f,b,t))),y},gi=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=ui:t[0]>0&&t[1]<0?r=di:t[0]>0&&t[1]>0?r=ui:t[0]<0&&t[1]>0?r=di:t[0]<0&&t[1]<0&&(r=ui)}}else _e(e)&&(r=ci);return pi(Ye(e),e.angle,t,n,r)},mi=(e,t)=>[0,0,0,0,t,e,1,0],fi=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},bi=e=>[e[0],e[1],e[2],e[3],-e[4],-e[5],-e[6],-e[7]],vi=(e,t)=>Si(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]],xi=(e,t)=>Si(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]:[yi(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]],yi=(e,t)=>t[0]*e[0]+t[2]*e[2]+t[3]*e[3]-t[6]*e[6],wi=(e,t)=>[ki(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]],ki=(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],Ei=e=>Math.sqrt(Math.abs(e[0]*e[0]-e[2]*e[2]-e[3]*e[3]+e[6]*e[6])),_i=e=>{const t=Ei(e);if(0===t||1===t)return e;const n=e[6]<0?-1:1;return xi(e,n/t)},Ci=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:xi(e,1/t)},Si=e=>"number"==typeof e,ji=(fi(1,1),fi(1,2),fi(1,3),fi(1,4),fi(1,5),fi(1,6),fi(1,7),(e,t,n)=>_i([0,n,e,t,0,0,0,0])),Ii=(e,t)=>_i(wi(t,e)),Ti=(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),Mi=e=>{let[t,n]=e;return[0,0,0,0,n,t,1,0]},Oi=e=>[e[5],e[4]],Li=(e,t)=>_i(((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)),Ai=(e,t)=>Ei(wi(e,t)),Pi=(e,t)=>ki(e,t),Di=e=>[0,0,0,0,e[4],e[5],0,0],zi=(e,t)=>((e,t)=>Si(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]])(xi(e,Math.sin(t/2)),Math.cos(t/2)),Ri=(e,t)=>_i(xi(xi(e,t),bi(e))),Hi=(e,t,n,r)=>{const i=10/t.zoom.value;return!Ni(e,t,[n,r])&&Fi(e,[n,r],i)},Ni=(e,t,n)=>{const r=10/t.zoom.value,i=_e(e)?Gi:(e=>{if("arrow"===e.type)return!1;if("freedraw"===e.type)return!0;const t=!sn(e.backgroundColor)||Ae(e);return"line"===e.type?t&&Ne(e.points):t||Ee(e)})(e)?Yi:Xi;return Ki({element:e,point:n,threshold:r,check:i})},Bi=(e,t)=>e.selectedElementIds[t.id],Fi=(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},Ui=(e,t)=>{let{x:n,y:r}=t;const i=Wi(e,e.width,e.height);return Ki({element:e,point:[n,r],threshold:i,check:Zi})},Wi=(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))},Ki=e=>{switch(e.element.type){case"rectangle":case"image":case"text":case"diamond":case"ellipse":const t=Vi(e.element,e.point);return e.check(t,e.threshold);case"freedraw":return!!e.check(qi(e.element,e.point),e.threshold)&&eo(e.element,e.point,e.threshold);case"arrow":case"line":return to(e);case"selection":return console.warn("This should not happen, we need to investigate why it does."),!1}},Vi=(e,t)=>{switch(e.type){case"rectangle":case"image":case"text":return qi(e,t);case"diamond":return $i(e,t);case"ellipse":return Qi(e,t)}},Gi=(e,t)=>e<0,Yi=(e,t)=>e<t,Xi=(e,t)=>Math.abs(e)<t,Zi=(e,t)=>0<=e&&e<t,qi=(e,t)=>{const[,n,r,i]=no(e,t);return Math.max(Pi(n,ji(0,1,-i)),Pi(n,ji(1,0,-r)))},$i=(e,t)=>{const[,n,r,i]=no(e,t),o=ji(i,r,-i*r);return Pi(n,o)},Qi=(e,t)=>{const[n,r]=Ji(e,t);return-(e=>Math.sign(e[1]))(r)*Pi(n,r)},Ji=(e,t)=>{const[,n,r,i]=no(e,t),[o,a]=Oi(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=mi(c*s,d*l);var h;return[n,Ti(Ii(n,h=u),h)]},eo=(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=vr(e);return!(!l||!l.sets.length)&&fo(l,r,i,n)},to=e=>{const{element:t,threshold:n}=e;if(!vr(t))return!1;const[r,i,o,a]=no(e.element,e.point),s=ji(0,1,-a),l=ji(1,0,-o);if(!Yi(Pi(i,s),n)||!Yi(Pi(i,l),n))return!1;const[c,d]=Oi(r),u=vr(t);if(!u)return!1;if(e.check===Yi){if(u.some((e=>mo(e,c,d,t.strokeSharpness))))return!0}return u.some((e=>fo(e,c,d,n)))},no=(e,t)=>{const n=Mi(t),r=Ye(e),i=io(r),o=zi(i,e.angle),a=Ri(o,n),s=(e=>[0,0,0,0,Math.abs(e[4]),Math.abs(e[5]),1,0])(vi(a,Di(i))),l=((e,t)=>[0,0,0,0,t,e,0,0])(e.x,e.y),c=vi(a,l),[d,u,h,p]=r;return[c,s,(h-d)/2,(p-u)/2]},ro=e=>{const t=Ye(e),n=io(t),r=zi(n,e.angle),i=bi((e=>[1,0,0,0,-.5*e[5],.5*e[4],0,0])(Di(n)));return xi(i,r)},io=e=>{let[t,n,r,i]=e;return mi((t+r)/2,(n+i)/2)},oo=(e,t,n)=>{const r=ro(e),i=Ri(r,Mi(t)),o=Ri(r,Mi(n)),a=Ii(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))}},ao=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=so(e);r=n.flatMap(((e,r)=>{const o=[e,n[(r+1)%4]];return lo(t,co(o,i))})).concat(n.flatMap((e=>ho(e,i,t))));break;case"ellipse":r=uo(e,i,t)}if(r.length<2)return[];const o=r.sort(((e,t)=>Ai(e,n)-Ai(t,n)));return[o[0],o[o.length-1]]},so=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[mi(n,r),mi(n,-r),mi(-n,-r),mi(-n,r)];case"diamond":return[mi(0,r),mi(n,0),mi(0,-r),mi(-n,0)]}},lo=(e,t)=>{const[n,r]=t;return Pi(n,e)*Pi(r,e)>=0?[]:[Li(e,Ii(n,r))]},co=(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)=>Ci([0,0,0,0,t[4]-e[4],t[5]-e[5],0,0]))(n,r),t);return[Ri(i,n),Ri(i,r)]},uo=(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[mi((u+r*i*a*d)/l,(h-r*i*o*d)/l),mi((u-r*i*a*d)/l,(h+r*i*o*d)/l)]},ho=(e,t,n)=>{if(0===t)return 0===Pi(n,e)?[e]:[];const r=n[2],i=n[3],o=n[1],[a,s]=Oi(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[mi((u+i*d)/l,(h-r*d)/l),mi((u-i*d)/l,(h+r*d)/l)]},po=(e,t,n)=>{const r=Math.abs(t),i=e.width*r/2,o=e.height*r/2,a=Math.sign(t),[s,l]=Oi(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 mi(p,(-u*p-1)/h)},go=(e,t,n)=>{const r=Math.abs(t),i=Math.sign(t),o=so(e,r);let a=0,s=null;return o.forEach((e=>{const t=i*Ii(n,e)[1];t>a&&(a=t,s=e)})),s},mo=(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},fo=(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 mo(e,t,n,"sharp");"qcurveTo"===s&&console.warn("qcurveTo is not implemented yet")}return!1}))};var bo=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 vo=(e,t,n)=>t>=e[0]&&t<=e[0]+e[2]&&n>=e[1]&&n<=e[1]+e[3],xo=(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=gi(e,i,o),{rotation:s}=a,l=bo(a,["rotation"]);if(s&&vo(s,n,r))return"rotation";const c=Object.keys(l).filter((e=>{const t=l[e];return!!t&&vo(t,n,r)}));return c.length>0&&c[0]})(a,t,n,r,i,o);return s?{element:a,transformHandleType:s}:null}),null),yo=(e,t,n,r,i)=>{let[o,a,s,l]=e;const c=pi([o,a,s,l],0,r,i,li);return Object.keys(c).find((e=>{const r=c[e];return r&&vo(r,t,n)}))||!1},wo=["ns","nesw","ew","nwse"],ko=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=wo.indexOf(e);if(n>=0){const r=Math.round(t/(Math.PI/4));e=wo[(n+r)%wo.length]}return e})(i,t.angle)),i?"".concat(i,"-resize"):""};class Eo{constructor(e,t){this.elementId=e.id,Un.mapElementToScene(this.elementId,t),Eo.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=Un.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=Eo.getElement(a);if(!s)return!1;const[l,c,d,u]=Ye(t.draggingElement),h=Eo.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=Eo.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=Eo.createPointAt(c,n-o.pointerOffset.x,r-o.pointerOffset.y,e.gridSize),u=s[0]-d[0],h=s[1]-d[1];if(Eo.movePoints(c,a.map((t=>({index:t,point:t===o.pointerDownState.lastClickedPoint?Eo.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(on(Eo.getPointGlobalCoordinates(c,c.points[0])));const t=a[a.length-1];t===c.points.length-1&&e.push(on(Eo.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=Eo.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)&&Eo.movePoints(l,[{index:e,point:0===e?l.points[l.points.length-1]:l.points[0]}]);const t=Co(n)?zo(on(Eo.getPointAtIndexGlobalCoordinates(l,e)),Un.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=Eo.getElement(s);if(!l)return a;if(e.altKey)return null==t.editingLinearElement.lastUncommittedPoint&&Rr(l,{points:[...l.points,Eo.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:zo(i,Un.getScene(l))})}),a.didAddPoint=!0,a;const c=Eo.getPointIndexUnderCursor(l,t.zoom,i.x,i.y);if(c>-1)a.hitElement=l;else{const{startBindingElement:e,endBindingElement:n}=t.editingLinearElement;Co(t)&&Te(l)&&So(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)?_o([...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=Eo.getElement(o);if(!s)return r;const{points:l}=s,c=l[l.length-1];if(!e.altKey)return c===a&&Eo.deletePoints(s,[l.length-1]),Object.assign(Object.assign({},r),{lastUncommittedPoint:null});const d=Eo.createPointAt(s,t-r.pointerOffset.x,n-r.pointerOffset.y,i);return c===a?Eo.movePoints(s,[{index:s.points.length-1,point:d}]):Eo.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){Rr(e,Eo.getNormalizedPoints(e))}static duplicateSelectedPoints(e){if(!e.editingLinearElement)return!1;const{selectedPointsIndices:t,elementId:n}=e.editingLinearElement,r=Eo.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(Rr(r,{points:l}),a){const e=r.points[r.points.length-1];Eo.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)),[]);Eo._updatePoints(e,i,n,r)}static addPoints(e,t){const n=[...e.points,...t.map((e=>e.point))];Eo._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}));Eo._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);Rr(e,Object.assign(Object.assign({},i),{points:t,x:e.x+u[0],y:e.y+u[1]}))}}Eo.POINT_HANDLE_SIZE=20;const _o=e=>{let t=[...new Set(e.filter((e=>null!==e&&-1!==e)))];return t=t.sort(((e,t)=>e-t)),t.length?t:null},Co=e=>e.isBindingEnabled,So=(e,t,n)=>{const r=new Set,i=new Set;jo(e,t,n,"start",r,i),jo(e,n,t,"end",r,i);const o=Array.from(i).filter((e=>!r.has(e)));Un.getScene(e).getNonDeletedElements(o).forEach((t=>{var n;Rr(t,{boundElements:null===(n=t.boundElements)||void 0===n?void 0:n.filter((t=>"arrow"!==t.type||t.id!==e.id))})}))},jo=(e,t,n,r,i,o)=>{if("keep"!==t)if(null!=t)null!=n&&("keep"===n?Lo(e,t,r):"start"!==r&&n.id===t.id)||(Oo(e,t,r),i.add(t.id));else{const t=Do(e,r);null!=t&&o.add(t)}},Io=e=>{e.forEach((e=>{Te(e)?So(e,Ko(e,"start"),Ko(e,"end")):Oe(e)&&To(e)}))},To=e=>{Go(e).forEach((t=>{let[n,r]=t;return So(n,"end"===r?"keep":e,"start"===r?"keep":e)}))},Mo=(e,t,n,r)=>{null!=t.startBoundElement&&Oo(e,t.startBoundElement,"start");const i=zo(r,n);null==i||Lo(e,i,"end")||Oo(e,i,"end")},Oo=(e,t,n)=>{Rr(e,{["start"===n?"startBinding":"endBinding"]:Object.assign({elementId:t.id},Ro(e,t,n))});un(t.boundElements||[]).has(e.id)||Rr(t,{boundElements:(t.boundElements||[]).concat({id:e.id,type:"arrow"})})},Lo=(e,t,n)=>{const r=e["start"===n?"endBinding":"startBinding"];return Ao(e,null==r?void 0:r.elementId,t)},Ao=(e,t,n)=>t===n.id&&e.points.length<3,Po=e=>{e.forEach((e=>{Te(e)&&So(e,null,null)}))},Do=(e,t)=>{const n="start"===t?"startBinding":"endBinding",r=e[n];return null==r?null:(Rr(e,{[n]:null}),r.elementId)},zo=(e,t)=>Vs(t.getElements(),(t=>Oe(t)&&Ui(t,e))),Ro=(e,t,n)=>{const r="start"===n?-1:1,i=-1===r?0:e.points.length-1,o=i-r,a=Eo.getPointAtIndexGlobalCoordinates(e,i),s=Eo.getPointAtIndexGlobalCoordinates(e,o);return{focus:oo(t,s,a),gap:Math.max(1,Vi(t,a))}},Ho=(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=Bo(o);Un.getScene(e).getNonDeletedElements(r.map((e=>e.id))).forEach((t=>{if(!je(t))return;const n=e;if(!No(t,n))return;const r=Uo(n,t.startBinding,i),o=Uo(n,t.endBinding,i);a.has(t.id)?Rr(t,{startBinding:r,endBinding:o}):(Fo(t,"start",r,e),Fo(t,"end",o,e))}))},No=(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},Bo=e=>new Set((e||[]).map((e=>e.id))),Fo=(e,t,n,r)=>{if(null==n||n.elementId!==r.id&&e.points.length>2)return;const i=Un.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=Eo.getPointAtIndexGlobalCoordinates(e,s),c=((e,t,n)=>{if(0===t){const t=Ye(e),n=io(t);return Oi(n)}const r=ro(e),i=Ri(r,Mi(n)),o=bi(r);let a;switch(e.type){case"rectangle":case"image":case"text":case"diamond":a=go(e,t,i);break;case"ellipse":a=po(e,t,i)}return Oi(Ri(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=ro(e),o=Ri(i,Mi(t)),a=Ri(i,Mi(n)),s=Ii(o,a),l=bi(i);return ao(e,s,o,r).map((e=>Oi(Ri(l,e))))}(i,l,c,n.gap);d=0===e.length?c:e[0]}Eo.movePoints(e,[{index:a,point:Eo.pointFromAbsoluteCoords(e,d)}],{["start"===t?"startBinding":"endBinding"]:n})},Uo=(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(Wi(e,a,s),r*(a<s?a/l:s/c))),focus:i}},Wo=e=>[Ko(e,"start"),Ko(e,"end")].filter((e=>null!=e)),Ko=(e,t)=>zo(Vo(e,t),Un.getScene(e)),Vo=(e,t)=>{const n="start"===t?0:-1;return on(Eo.getPointAtIndexGlobalCoordinates(e,n))},Go=e=>Un.getScene(e).getElements().map((t=>{if(!Te(t))return null;const n=Yo(t,"start",e),r=Yo(t,"end",e);return n||r?[t,n&&r?"both":n?"start":"end",e]:null})).filter((e=>null!=e)),Yo=(e,t,n)=>null==e["start"===t?"startBinding":"endBinding"]&&!Lo(e,n,t)&&Ui(n,Vo(e,t)),Xo=(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;Rr(e,{startBinding:Zo(t,n),endBinding:Zo(r,n)})})),e.filter((e=>{let{id:t}=e;return o.has(t)})).forEach((e=>{const{boundElements:t}=e;null!=t&&t.length>0&&Rr(e,{boundElements:t.map((e=>n.has(e.id)?{id:n.get(e.id),type:e.type}:e))})}))},Zo=(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}},qo=(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;Rr(e,{startBinding:$o(t,n),endBinding:$o(r,n)})}))},$o=(e,t)=>null==e||t.has(e.elementId)?null:e,Qo=e=>e>=2*Math.PI?e-2*Math.PI:e,Jo=(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=Qo(u),Rr(e,{angle:u});const h=rr(e);if(h){const t=Un.getScene(e).getElement(h);Rr(t,{angle:u})}},ea=(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=Fr(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);Rr(e,{x:m,y:f,points:[[0,0],[p,g]]})},ta=(e,t,n)=>je(e)||Ce(e)?{points:Ge(0,t,Ge(1,n,e.points))}:{},na=(e,t,n)=>{const r=e.fontSize*(t/e.width);if(r<1)return null;const i=Gn(e.text,Ut({fontSize:r,fontFamily:e.fontFamily}),e.containerId?e.width:null);return{size:r,baseline:i.baseline+(n-i.height)}},ra=(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=na(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);Rr(e,{fontSize:c.size,width:r,height:i,baseline:c.baseline,x,y})}},ia=(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 E=(g[0]-p[0])/w,_=(g[1]-p[1])/k,C={};const S=ir(n);r.includes("e")&&(E=(f[0]-p[0])/w),r.includes("s")&&(_=(f[1]-p[1])/k),r.includes("w")&&(E=(g[0]-f[0])/w),r.includes("n")&&(_=(g[1]-f[1])/k);const j=l.width,I=l.height;let T=n.width*E,M=n.height*_;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&&(C={fontSize:n.fontSize,baseline:n.baseline}),t){const e=na(S,T-2*o.gK,M-2*o.gK);if(null===e)return;C={fontSize:e.size,baseline:e.baseline}}else{const e=er(Ut(S)),t=tr(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=ta(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&&Rr(n,{scale:[(Math.sign(E)||l.scale[0])*l.scale[0],(Math.sign(_)||l.scale[1])*l.scale[1]]}),0!==K.width&&0!==K.height&&Number.isFinite(K.x)&&Number.isFinite(K.y)&&(Ho(n,{newSize:{width:K.width,height:K.height}}),Rr(n,K),S&&C&&Rr(S,{fontSize:C.fontSize}),Vn(n,r))},oa=(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=ir(n);let s={};if(a){const e=na(a,r-2*o.gK,i-2*o.gK);if(null===e)return null;s={fontSize:e.size,baseline:e.baseline}}if(_e(n)){const e=na(n,r,i);if(null===e)return null;s={fontSize:e.size,baseline:e.baseline}}const l=Ye(n),u=ta(n,r,i);Ho(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)=>{Rr(e,n[r]);const i=ir(e);i&&(Rr(i,{fontSize:n[r].fontSize,baseline:n[r].baseline}),Vn(e,t))}))}},aa=(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);Rr(t,{x:t.x+(m-h),y:t.y+(f-p),angle:Qo(l+g)});const b=rr(t);if(b){const e=Un.getScene(t).getElement(b);Rr(e,{x:e.x+(m-h),y:e.y+(f-p),angle:Qo(l+g)})}}))},sa=(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;Rr(i,{x:a,y:s})},la=(e,t,n,r,i,o,a,s,l,c,d)=>{l&&(d?s=a/d:(({width:a,height:s}=Fr(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&&Rr(e,{x:u,y:h,width:a,height:s})},ca=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 da=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 ua=(e,t)=>!at[t].includes(e),ha=e=>{const t=(new Option).style;return t.color=e,!!t.color},pa=[["1","2","3","4","5"],["q","w","e","r","t"],["a","s","d","f","g"],["z","x","c","v","b"]].flat(),ga=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&&ua(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?pa[i+15]:pa[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(sn(e)?"":" (".concat(e,")")," — ").concat(a.toUpperCase()),"aria-label":s,"aria-keyshortcuts":pa[i],style:{color:e},ref:r=>{!t&&r&&0===i&&(d.current=r),r&&e===n&&(u.current=r)},onFocus:()=>{r(e)},children:[sn(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(pa.includes(e.key.toLowerCase())&&!Bt(e.target)){var i;const t=pa.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)(ma,{color:n,label:a,onChange:e=>{r(e)},ref:p})]})]})},ma=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=>sn(e)||ha(e)?e:ha("#".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})]})})),fa=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)(ma,{color:n,label:o,onChange:e=>{r(e)}})]}),(0,v.jsx)(i().Suspense,{fallback:"",children:a?(0,v.jsx)(da,{onCloseRequest:e=>e.target!==d.current&&s(!1),children:(0,v.jsx)(ga,{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 ba(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 va(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)(da,Object.assign(Object.assign({onCloseRequest:e=>e.target!==d.current&&c(!1)},u?{right:5.5}:{left:-5.5}),{children:(0,v.jsx)(ba,{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 xa=e=>e===o.C6.LIGHT?it.orange[4]:it.orange[9],ya=e=>e===o.C6.LIGHT?it.white:"#1e1e1e",wa=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})},ka=wa((0,v.jsx)("polyline",{fill:"none",stroke:"currentColor",points:"20 6 9 17 4 12"}),{width:24,height:24}),Ea=wa("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}),_a=wa("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}),Ca=wa("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}),Sa=wa("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}),ja=wa("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}),Ia=wa("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}),Ta=wa("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"),Ma=(wa("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}),wa((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})),Oa=wa("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}),La=wa("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}),Aa=wa("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}),Pa=wa("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"),Da=wa("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"),za=wa("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}),Ra=wa("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}),Ha=wa("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}),Na=(wa("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}),wa("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}),wa((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}),wa((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 wa((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:xa(t),stroke:xa(t),strokeWidth:"2"})]}),{width:24,mirror:!0})}))),Ba=i().memo((e=>{let{theme:t}=e;return wa((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:xa(t),stroke:xa(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})})),Fa=i().memo((e=>{let{theme:t}=e;return wa((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:xa(t),stroke:xa(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),Ua=i().memo((e=>{let{theme:t}=e;return wa((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:xa(t),stroke:xa(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})})),Wa=i().memo((e=>{let{theme:t}=e;return wa((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:xa(t),stroke:xa(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),Ka=i().memo((e=>{let{theme:t}=e;return wa((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:xa(t),stroke:xa(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),Va=i().memo((e=>{let{theme:t}=e;return wa((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:xa(t),stroke:xa(t),strokeWidth:"2"})]}),{width:24})})),Ga=i().memo((e=>{let{theme:t}=e;return wa((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:xa(t),stroke:xa(t),strokeWidth:"2"})]}),{width:24})})),Ya=i().memo((e=>{let{theme:t}=e;return wa((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:xa(t),stroke:xa(t),strokeWidth:"2"})]}),{width:24})})),Xa=i().memo((e=>{let{theme:t}=e;return wa((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:xa(t),stroke:xa(t),strokeWidth:"2"})]}),{width:24})})),Za=i().memo((e=>{let{theme:t}=e;return wa((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:xa(t),stroke:xa(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})})),qa=i().memo((e=>{let{theme:t}=e;return wa((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:xa(t),stroke:xa(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})})),$a=wa("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}),Qa=(wa("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"),wa("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"),wa("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})),Ja=wa("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}),es=wa("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}),ts=(wa("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}),wa("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})),ns=i().memo((e=>{let{theme:t}=e;return wa((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:ya(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})})),rs=i().memo((e=>{let{theme:t}=e;return wa((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:ya(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})})),is=i().memo((e=>{let{theme:t}=e;return wa((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})})),os=i().memo((e=>{let{theme:t}=e;return wa((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})})),as=i().memo((e=>{let{theme:t}=e;return wa((0,v.jsx)("path",{d:"M2 2H38V18H2V2Z",fill:"var(--icon-fill-color)"}),{width:40,height:20})})),ss=i().memo((e=>{let{theme:t,strokeWidth:n}=e;return wa((0,v.jsx)("path",{d:"M6 10H32",stroke:"var(--icon-fill-color)",strokeWidth:n,strokeLinecap:"round",fill:"none"}),{width:40,height:20})})),ls=i().memo((e=>{let{theme:t}=e;return wa((0,v.jsx)("path",{d:"M6 10H34",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none",strokeLinecap:"round"}),{width:40,height:20})})),cs=i().memo((e=>{let{theme:t}=e;return wa((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})})),ds=i().memo((e=>{let{theme:t}=e;return wa((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})})),us=i().memo((e=>{let{theme:t}=e;return wa((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})})),hs=i().memo((e=>{let{theme:t}=e;return wa((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})})),ps=i().memo((e=>{let{theme:t}=e;return wa((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})})),gs=i().memo((e=>{let{theme:t}=e;return wa((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})})),ms=i().memo((e=>{let{theme:t}=e;return wa((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})})),fs=i().memo((e=>{let{theme:t}=e;return wa((0,v.jsx)("path",{d:"M6 10H34",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none"}),{width:40,height:20})})),bs=i().memo((e=>{let{theme:t,flip:n=!1}=e;return wa((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})})),vs=i().memo((e=>{let{theme:t,flip:n=!1}=e;return wa((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})})),xs=i().memo((e=>{let{theme:t,flip:n=!1}=e;return wa((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})})),ys=i().memo((e=>{let{theme:t,flip:n=!1}=e;return wa((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})})),ws=i().memo((e=>{let{theme:t}=e;return wa((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})})),ks=i().memo((e=>{let{theme:t}=e;return wa((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})})),Es=i().memo((e=>{let{theme:t}=e;return wa((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})})),_s=i().memo((e=>{let{theme:t}=e;return wa((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})})),Cs=i().memo((e=>{let{theme:t}=e;return wa((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})})),Ss=i().memo((e=>{let{theme:t}=e;return wa((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})})),js=i().memo((e=>{let{theme:t}=e;return wa((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})})),Is=i().memo((e=>{let{theme:t}=e;return wa((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})})),Ts=i().memo((e=>{let{theme:t}=e;return wa((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})})),Ms=i().memo((e=>{let{theme:t}=e;return wa((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})})),Os=i().memo((e=>{let{theme:t}=e;return wa((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})})),Ls=i().memo((e=>{let{theme:t}=e;return wa((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})})),As=i().memo((e=>{let{theme:t}=e;return wa((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})})),Ps=wa((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}),Ds=wa((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}),zs=wa((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"})),Rs=wa("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"),Hs=e=>"rectangle"===e||"ellipse"===e||"diamond"===e||"line"===e||"freedraw"===e,Ns=e=>"image"!==e,Bs=e=>"rectangle"===e||"ellipse"===e||"diamond"===e||"freedraw"===e||"arrow"===e||"line"===e,Fs=e=>"rectangle"===e||"ellipse"===e||"diamond"===e||"arrow"===e||"line"===e,Us=e=>"rectangle"===e||"arrow"===e||"line"===e||"diamond"===e,Ws=e=>"text"===e,Ks=e=>"arrow"===e,Vs=(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},Gs=(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 Ys=[];const Xs=e=>(Ys=Ys.concat(e),e),Zs=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=un(Rl(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}))},qs=function(e,t,n,r){var i,o;const a=t.editingElement,s=Tl(e);return null!==(i=null!==(o=a&&n(a))&&void 0!==o?o:Dl(s,t)?zl(s,t,n):r)&&void 0!==i?i:null},$s=(e,t,n,r)=>{const i=new Set;return{elements:Zs(e,t,(e=>{if(_e(e)){const o=n(e);i.add(o);let a=Hr(e,{fontSize:o});return Wn(a,or(e)),t=e,a=Pe(r=a)?r:Rr(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}},Qs=(Xs({name:"changeStrokeColor",trackEvent:!1,perform:(e,t,n)=>Object.assign(Object.assign({},n.currentItemStrokeColor&&{elements:Zs(e,t,(e=>Ns(e.type)?Hr(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)(fa,{type:"elementStroke",label:b("labels.stroke"),color:qs(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})]})}}),Xs({name:"changeBackgroundColor",trackEvent:!1,perform:(e,t,n)=>Object.assign(Object.assign({},n.currentItemBackgroundColor&&{elements:Zs(e,t,(e=>Hr(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)(fa,{type:"elementBackground",label:b("labels.background"),color:qs(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})]})}}),Xs({name:"changeFillStyle",trackEvent:!1,perform:(e,t,n)=>({elements:Zs(e,t,(e=>Hr(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)(ca,{options:[{value:"hachure",text:b("labels.hachure"),icon:(0,v.jsx)(is,{theme:n.theme})},{value:"cross-hatch",text:b("labels.crossHatch"),icon:(0,v.jsx)(os,{theme:n.theme})},{value:"solid",text:b("labels.solid"),icon:(0,v.jsx)(as,{theme:n.theme})}],group:"fill",value:qs(t,n,(e=>e.fillStyle),n.currentItemFillStyle),onChange:e=>{r(e)}})]})}}),Xs({name:"changeStrokeWidth",trackEvent:!1,perform:(e,t,n)=>({elements:Zs(e,t,(e=>Hr(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)(ca,{group:"stroke-width",options:[{value:1,text:b("labels.thin"),icon:(0,v.jsx)(ss,{theme:n.theme,strokeWidth:2})},{value:2,text:b("labels.bold"),icon:(0,v.jsx)(ss,{theme:n.theme,strokeWidth:6})},{value:4,text:b("labels.extraBold"),icon:(0,v.jsx)(ss,{theme:n.theme,strokeWidth:10})}],value:qs(t,n,(e=>e.strokeWidth),n.currentItemStrokeWidth),onChange:e=>r(e)})]})}}),Xs({name:"changeSloppiness",trackEvent:!1,perform:(e,t,n)=>({elements:Zs(e,t,(e=>Hr(e,{seed:Dr(),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)(ca,{group:"sloppiness",options:[{value:0,text:b("labels.architect"),icon:(0,v.jsx)(us,{theme:n.theme})},{value:1,text:b("labels.artist"),icon:(0,v.jsx)(hs,{theme:n.theme})},{value:2,text:b("labels.cartoonist"),icon:(0,v.jsx)(ps,{theme:n.theme})}],value:qs(t,n,(e=>e.roughness),n.currentItemRoughness),onChange:e=>r(e)})]})}}),Xs({name:"changeStrokeStyle",trackEvent:!1,perform:(e,t,n)=>({elements:Zs(e,t,(e=>Hr(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)(ca,{group:"strokeStyle",options:[{value:"solid",text:b("labels.strokeStyle_solid"),icon:(0,v.jsx)(ls,{theme:n.theme})},{value:"dashed",text:b("labels.strokeStyle_dashed"),icon:(0,v.jsx)(cs,{theme:n.theme})},{value:"dotted",text:b("labels.strokeStyle_dotted"),icon:(0,v.jsx)(ds,{theme:n.theme})}],value:qs(t,n,(e=>e.strokeStyle),n.currentItemStrokeStyle),onChange:e=>r(e)})]})}}),Xs({name:"changeOpacity",trackEvent:!1,perform:(e,t,n)=>({elements:Zs(e,t,(e=>Hr(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=qs(n,r,(e=>e.opacity),r.currentItemOpacity))&&void 0!==t?t:void 0})]})}}),Xs({name:"changeFontSize",trackEvent:!1,perform:(e,t,n)=>$s(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)(ca,{group:"font-size",options:[{value:16,text:b("labels.small"),icon:(0,v.jsx)(ws,{theme:n.theme}),testId:"fontSize-small"},{value:20,text:b("labels.medium"),icon:(0,v.jsx)(ks,{theme:n.theme}),testId:"fontSize-medium"},{value:28,text:b("labels.large"),icon:(0,v.jsx)(Es,{theme:n.theme}),testId:"fontSize-large"},{value:36,text:b("labels.veryLarge"),icon:(0,v.jsx)(_s,{theme:n.theme}),testId:"fontSize-veryLarge"}],value:qs(t,n,(e=>{if(_e(e))return e.fontSize;const t=ir(e);return t?t.fontSize:null}),n.currentItemFontSize||o.n5),onChange:e=>r(e)})]})}}),Xs({name:"decreaseFontSize",trackEvent:!1,perform:(e,t,n)=>$s(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)})),Js=Xs({name:"increaseFontSize",trackEvent:!1,perform:(e,t,n)=>$s(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)});Xs({name:"changeFontFamily",trackEvent:!1,perform:(e,t,n)=>({elements:Zs(e,t,(e=>{if(_e(e)){const t=Hr(e,{fontFamily:n});return Wn(t,or(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)(Cs,{theme:n.theme})},{value:o.ut.Helvetica,text:b("labels.normal"),icon:(0,v.jsx)(Ss,{theme:n.theme})},{value:o.ut.Cascadia,text:b("labels.code"),icon:(0,v.jsx)(js,{theme:n.theme})}];return(0,v.jsxs)("fieldset",{children:[(0,v.jsx)("legend",{children:b("labels.fontFamily")}),(0,v.jsx)(ca,{group:"font-family",options:i,value:qs(t,n,(e=>{if(_e(e))return e.fontFamily;const t=ir(e);return t?t.fontFamily:null}),n.currentItemFontFamily||o.rk),onChange:e=>r(e)})]})}}),Xs({name:"changeTextAlign",trackEvent:!1,perform:(e,t,n)=>({elements:Zs(e,t,(e=>{if(_e(e)){const t=Hr(e,{textAlign:n});return Wn(t,or(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)(ca,{group:"text-align",options:[{value:"left",text:b("labels.left"),icon:(0,v.jsx)(Is,{theme:n.theme})},{value:"center",text:b("labels.center"),icon:(0,v.jsx)(Ts,{theme:n.theme})},{value:"right",text:b("labels.right"),icon:(0,v.jsx)(Ms,{theme:n.theme})}],value:qs(t,n,(e=>{if(_e(e))return e.textAlign;const t=ir(e);return t?t.textAlign:null}),n.currentItemTextAlign),onChange:e=>r(e)})]})}}),Xs({name:"changeVerticalAlign",trackEvent:{category:"element"},perform:(e,t,n)=>({elements:Zs(e,t,(e=>{if(_e(e)){const t=Hr(e,{verticalAlign:n});return Wn(t,or(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)(ca,{group:"text-align",options:[{value:o.oX.TOP,text:b("labels.alignTop"),icon:(0,v.jsx)(Os,{theme:n.theme})},{value:o.oX.MIDDLE,text:b("labels.centerVertically"),icon:(0,v.jsx)(As,{theme:n.theme})},{value:o.oX.BOTTOM,text:b("labels.alignBottom"),icon:(0,v.jsx)(Ls,{theme:n.theme})}],value:qs(t,n,(e=>{if(_e(e)&&e.containerId)return e.verticalAlign;const t=ir(e);return t?t.verticalAlign:null})),onChange:e=>r(e)})})}}),Xs({name:"changeSharpness",trackEvent:!1,perform:(e,t,n)=>{const r=Hl(Tl(e),t),i=r.length?r.every((e=>!je(e))):!Ie(t.activeTool.type),o=r.length?r.every(je):Ie(t.activeTool.type);return{elements:Zs(e,t,(e=>Hr(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)(ca,{group:"edges",options:[{value:"sharp",text:b("labels.sharp"),icon:(0,v.jsx)(gs,{theme:n.theme})},{value:"round",text:b("labels.round"),icon:(0,v.jsx)(ms,{theme:n.theme})}],value:qs(t,n,(e=>e.strokeSharpness),Us(n.activeTool.type)&&(Ie(n.activeTool.type)?n.currentItemLinearStrokeSharpness:n.currentItemStrokeSharpness)||null),onChange:e=>r(e)})]})}}),Xs({name:"changeArrowhead",trackEvent:!1,perform:(e,t,n)=>({elements:Zs(e,t,(e=>{if(je(e)){const{position:t,type:r}=n;if("start"===t){return Hr(e,{startArrowhead:r})}if("end"===t){return Hr(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)(va,{label:"arrowhead_start",options:[{value:null,text:b("labels.arrowhead_none"),icon:(0,v.jsx)(fs,{theme:n.theme}),keyBinding:"q"},{value:"arrow",text:b("labels.arrowhead_arrow"),icon:(0,v.jsx)(bs,{theme:n.theme,flip:!i}),keyBinding:"w"},{value:"bar",text:b("labels.arrowhead_bar"),icon:(0,v.jsx)(xs,{theme:n.theme,flip:!i}),keyBinding:"e"},{value:"dot",text:b("labels.arrowhead_dot"),icon:(0,v.jsx)(vs,{theme:n.theme,flip:!i}),keyBinding:"r"},{value:"triangle",text:b("labels.arrowhead_triangle"),icon:(0,v.jsx)(ys,{theme:n.theme,flip:!i}),keyBinding:"t"}],value:qs(t,n,(e=>je(e)&&Ks(e.type)?e.startArrowhead:n.currentItemStartArrowhead),n.currentItemStartArrowhead),onChange:e=>r({position:"start",type:e})}),(0,v.jsx)(va,{label:"arrowhead_end",group:"arrowheads",options:[{value:null,text:b("labels.arrowhead_none"),keyBinding:"q",icon:(0,v.jsx)(fs,{theme:n.theme})},{value:"arrow",text:b("labels.arrowhead_arrow"),keyBinding:"w",icon:(0,v.jsx)(bs,{theme:n.theme,flip:i})},{value:"bar",text:b("labels.arrowhead_bar"),keyBinding:"e",icon:(0,v.jsx)(xs,{theme:n.theme,flip:i})},{value:"dot",text:b("labels.arrowhead_dot"),keyBinding:"r",icon:(0,v.jsx)(vs,{theme:n.theme,flip:i})},{value:"triangle",text:b("labels.arrowhead_triangle"),icon:(0,v.jsx)(ys,{theme:n.theme,flip:i}),keyBinding:"t"}],value:qs(t,n,(e=>je(e)&&Ks(e.type)?e.endArrowhead:n.currentItemEndArrowhead),n.currentItemEndArrowhead),onChange:e=>r({position:"end",type:e})})]})]})}});n(5422);class el 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 tl extends DOMException{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Request Aborted","AbortError")}}n(371);const nl=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"})})})},rl=i().forwardRef(((e,t)=>{const{id:n}=xp(),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 tl))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)(nl,{})]}),e.showAriaLabel&&(0,v.jsxs)("div",{className:"ToolIcon__label",children:[e["aria-label"]," ",s&&(0,v.jsx)(nl,{})]}),e.children]})}return(0,v.jsxs)("label",{className:ye("ToolIcon",e.className),title:e.title,onPointerDown:t=>{var n;u.current=t.pointerType||null,null===(n=e.onPointerDown)||void 0===n||n.call(e,{pointerType:t.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})]})]})}));rl.defaultProps={visible:!0,className:"",size:"medium"};const il=e=>{const t=e.title||("dark"===e.value?b("buttons.lightMode"):b("buttons.darkMode"));return(0,v.jsx)(rl,{type:"icon",icon:e.value===o.C6.LIGHT?ol.MOON:ol.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"})},ol={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"})})},al=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}},sl=(e,t,n)=>{if(!(e=Il(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}=en({sceneX:r,sceneY:i},e),{x:c,y:d}=en({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,Jt({clientX:t.scrollX,clientY:t.scrollY},t)));return al({scenePoint:{x:(r+o)/2,y:(i+a)/2},viewportDimensions:{width:t.width,height:t.height},zoom:t.zoom})},ll=e=>Math.max(.1,Math.min(e,30)),cl=(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 dl=()=>{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},ul=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")})},hl=e=>{let{children:t,label:n,long:i=!1,style:o}=e;return(0,r.useEffect)((()=>()=>dl().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();ul(t,i)})(e.currentTarget,dl(),n,i),onPointerLeave:()=>dl().classList.remove("excalidraw-tooltip--visible"),style:o,children:t})};n(196),n(1106);const pl=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 gl=e=>{const{theme:t=o.C6.LIGHT,closeOnClickOutside:n=!0}=e,r=ml(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)},ml=e=>{const[t,n]=(0,r.useState)(null),i=bp(),o=(0,r.useRef)(i.isMobile);o.current=i.isMobile;const{container:a}=xp();return(0,r.useLayoutEffect)((()=>{t&&t.classList.toggle("excalidraw--mobile",i.isMobile)}),[t,i.isMobile]),(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},fl=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}=xp();(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)(gl,{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)(pl,{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:bp().isMobile?Ja:Qa})]}),(0,v.jsx)("div",{className:"Dialog__content",children:e.children})]})})};n(4678);var bl=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 vl=e=>{const{onConfirm:t,onCancel:n,children:r,confirmText:i=b("buttons.confirm"),cancelText:o=b("buttons.cancel"),className:a=""}=e,s=bl(e,["onConfirm","onCancel","children","confirmText","cancelText","className"]);return(0,v.jsxs)(fl,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)(rl,{type:"button",title:o,"aria-label":o,label:o,onClick:n,className:"confirm-dialog--cancel"}),(0,v.jsx)(rl,{type:"button",title:i,"aria-label":i,label:i,onClick:t,className:"confirm-dialog--confirm"})]})]}))},xl=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)(rl,{type:"button",icon:Ia,title:b("buttons.clearReset"),"aria-label":b("buttons.clearReset"),showAriaLabel:bp().isMobile,onClick:o,"data-testid":"clear-canvas-button"}),n&&(0,v.jsx)(vl,{onConfirm:()=>{t(),o()},onCancel:o,title:b("clearCanvasDialog.title"),children:(0,v.jsxs)("p",{className:"clear-canvas__content",children:[" ",b("alerts.clearReset")]})})]})},yl=(Xs({name:"changeViewBackgroundColor",trackEvent:!1,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)(fa,{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})})}}),Xs({name:"clearCanvas",trackEvent:{category:"canvas"},perform:(e,t,n,r)=>(r.imageCache.clear(),{elements:e.map((e=>Hr(e,{isDeleted:!0}))),appState:Object.assign(Object.assign({},fn()),{files:{},theme:t.theme,penMode:t.penMode,penDetected:t.penDetected,exportBackground:t.exportBackground,exportEmbedScene:t.exportEmbedScene,gridSize:t.gridSize,showStats:t.showStats,pasteDialog:t.pasteDialog,activeTool:"image"===t.activeTool.type?Object.assign(Object.assign({},t.activeTool),{type:"selection"}):t.activeTool}),commitToHistory:!0}),PanelComponent:e=>{let{updateData:t}=e;return(0,v.jsx)(xl,{onConfirm:t})}}),Xs({name:"zoomIn",trackEvent:{category:"canvas"},perform:(e,t,n,r)=>({appState:Object.assign(Object.assign({},t),cl({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:ll(t.zoom.value+o.V4)},t)),commitToHistory:!1}),PanelComponent:e=>{let{updateData:t}=e;return(0,v.jsx)(rl,{type:"button",icon:La,title:"".concat(b("buttons.zoomIn")," — ").concat(Qt("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)})),wl=Xs({name:"zoomOut",trackEvent:{category:"canvas"},perform:(e,t,n,r)=>({appState:Object.assign(Object.assign({},t),cl({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:ll(t.zoom.value-o.V4)},t)),commitToHistory:!1}),PanelComponent:e=>{let{updateData:t}=e;return(0,v.jsx)(rl,{type:"button",icon:Aa,title:"".concat(b("buttons.zoomOut")," — ").concat(Qt("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)}),kl=(Xs({name:"resetZoom",trackEvent:{category:"canvas"},perform:(e,t,n,r)=>({appState:Object.assign(Object.assign({},t),cl({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:ll(1)},t)),commitToHistory:!1}),PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,v.jsx)(hl,{label:b("buttons.resetZoom"),style:{height:"100%"},children:(0,v.jsxs)(rl,{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)}),El=(e,t,n)=>{const r=Tl(e),i=Rl(r,t),o=n&&i.length>0?et(i):et(r),a={value:kl(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),al({scenePoint:{x:u,y:h},viewportDimensions:{width:t.width,height:t.height},zoom:a})),{zoom:a}),commitToHistory:!1}},_l=(Xs({name:"zoomToSelection",trackEvent:{category:"canvas"},perform:(e,t)=>El(e,t,!0),keyTest:e=>e.code===xt&&e.shiftKey&&!e.altKey&&!e[Lt.CTRL_OR_CMD]}),Xs({name:"zoomToFit",trackEvent:{category:"canvas"},perform:(e,t)=>El(e,t,!1),keyTest:e=>e.code===vt&&e.shiftKey&&!e.altKey&&!e[Lt.CTRL_OR_CMD]}),Xs({name:"toggleTheme",trackEvent:{category:"canvas"},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)(il,{value:t.theme,onChange:e=>{n(e)}})})},keyTest:e=>e.altKey&&e.shiftKey&&e.code===_t}),Xs({name:"eraser",trackEvent:{category:"toolbar"},perform:(e,t)=>{var n;return{appState:Object.assign(Object.assign({},t),{selectedElementIds:{},selectedGroupIds:{},activeTool:Object.assign(Object.assign({},t.activeTool),{type:kn(t)?null!==(n=t.activeTool.lastActiveToolBeforeEraser)&&void 0!==n?n:"selection":"eraser",lastActiveToolBeforeEraser:"eraser"===t.activeTool.type?null:t.activeTool.type})}),commitToHistory:!0}},keyTest:e=>e.key===Lt.E,PanelComponent:e=>{let{elements:t,appState:n,updateData:r,data:i}=e;return(0,v.jsx)(rl,{type:"button",icon:zs,className:ye("eraser",{active:kn(n)}),title:"".concat(b("toolBar.eraser"),"-").concat(Qt("E")),"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)")}),Cl=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=Un.getScene(a))||void 0===e?void 0:e.getElement(t);if(!r)return;const{textAlign:s,verticalAlign:l}=r,u=Zn(Ut(r));if(r&&_e(r)){let e=r.x,t=r.y;const a=or(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 Rr(a,{height:a.height+e})}if(a.height>d&&m<p){const e=Math.min(p-m,u);Rr(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 E=(n.height-b)/n.zoom.value,_=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:_l(g,m,_,n,c,E),textAlign:s,verticalAlign:l,color:r.strokeColor,opacity:r.opacity/100,filter:"var(--theme-filter)",maxWidth:"".concat(c,"px"),maxHeight:"".concat(E,"px")}),hn()&&(h.style.fontFamily=Ft(r)),Rr(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=Un.getScene(a))||void 0===e?void 0:e.getElement(t),i=Ut(r),o=h.scrollHeight/Zn(i);if(Pe(a)&&o>1){let e="auto";if(2===o){const t=or(a);1===Qn(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&&yl.keyTest(e))e.preventDefault(),c.actionManager.executeAction(yl),u();else if(!e.shiftKey&&wl.keyTest(e))e.preventDefault(),c.actionManager.executeAction(wl),u();else if(Qs.keyTest(e))c.actionManager.executeAction(Qs);else if(Js.keyTest(e))c.actionManager.executeAction(Js);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;E();const t=null===(e=Un.getScene(a))||void 0===e?void 0:e.getElement(a.id);if(!t)return;let n=h.value;const i=or(t);if(i)if(n=t.text,h.value){const e=rr(i);e&&e===a.id||Rr(i,{boundElements:(i.boundElements||[]).concat({type:"text",id:a.id})})}else{var o;Rr(i,{boundElements:null===(o=i.boundElements)||void 0===o?void 0:o.filter((e=>!_e(e)))})}r({text:n,viaKeyboard:w,originalText:h.value})},E=()=>{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",C),window.removeEventListener("pointerup",_),window.removeEventListener("blur",k),S(),h.remove())},_=e=>{window.removeEventListener("pointerup",_);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()}))},C=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",_),window.addEventListener("blur",k))},S=Un.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(),_();let I=null;s&&"ResizeObserver"in window?(I=new window.ResizeObserver((()=>{u()})),I.observe(s)):window.addEventListener("resize",u),window.addEventListener("pointerdown",C),window.addEventListener("wheel",y,{passive:!1,capture:!0}),null==l||l.querySelector(".excalidraw-textEditorContainer").appendChild(h)},Sl=(e,t)=>Boolean(!e.viewModeEnabled&&(e.editingElement||Rl(t,e).length||"selection"!==e.activeTool.type&&"eraser"!==e.activeTool.type)),jl=e=>e.reduce(((e,t)=>e+t.version),0),Il=e=>e.filter((e=>!e.isDeleted&&!Br(e))),Tl=e=>e.filter((e=>!e.isDeleted)),Ml=e=>!e.isDeleted,Ol=e=>Tl(e).map((e=>Ie(e.type)?Object.assign(Object.assign({},e),{lastCommittedPoint:null}):e)),Ll=e=>Ol(e),Al=e=>Ol(e),Pl=(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}},Dl=(e,t)=>e.some((e=>t.selectedElementIds[e.id])),zl=(e,t,n)=>{const r=Array.from(new Set(Rl(e,t).map((e=>n(e)))));return 1===r.length?r[0]:null},Rl=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))},Hl=(e,t)=>t.editingElement?[t.editingElement]:Rl(e,t,!0),Nl=(e,t)=>{if(e.editingGroupId){const n=Zr(Tl(t),e.editingGroupId);if(n.length)return Object.assign(Object.assign({},e),{selectedElementIds:{[n[0].id]:!0}})}return e},Bl=Xs({name:"deleteSelectedElements",trackEvent:{category:"element",action:"delete"},perform:(e,t)=>{if(t.editingLinearElement){const{elementId:n,selectedPointsIndices:r,startBindingElement:i,endBindingElement:o}=t.editingLinearElement,a=Eo.getElement(n);if(!a)return!1;if(null==r||a.points.length<2){const n=e.filter((e=>e.id!==a.id)),r=Nl(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 Eo.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]?Hr(e,{isDeleted:!0}):e)),appState:Object.assign(Object.assign({},t),{selectedElementIds:{}})}))(e,t);return qo(n,e.filter((e=>{let{id:n}=e;return t.selectedElementIds[n]}))),r=Nl(r,n),{elements:n,appState:Object.assign(Object.assign({},r),{activeTool:Object.assign(Object.assign({},t.activeTool),{type:"selection"}),multiElement:null}),commitToHistory:Dl(Tl(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)(rl,{type:"button",icon:Ia,title:b("labels.delete"),"aria-label":b("labels.delete"),onClick:()=>r(null),visible:Dl(Tl(t),n)})}}),Fl=(e,t)=>{let n=[],r=[],i=null,o=-1;const a=un(Rl(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},Ul=(e,t,n)=>{if("containerId"in e&&e.containerId){if("left"!==n)return t.indexOf(e);{const n=Un.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=Un.getScene(e).getElement(o);if(r)return t.indexOf(r)}}},Wl=(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=Ul(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=Ul(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=Zr(t,d);return u.length?"left"===r?t.indexOf(u[0]):t.indexOf(u[u.length-1]):a},Kl=(e,t)=>t.reduce(((t,n)=>{const r=e[n];return t[r.id]=r,t}),{}),Vl=(e,t,n)=>{const r=Fl(t,e),i=Kl(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=Wl(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]?Nr(e):e))},Gl=(e,t,n)=>{const r=Fl(e,t),i=Kl(e,r),o=[];let a,s;if("left"===n){if(t.editingGroupId){const n=Zr(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=Zr(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=>Nr(e))),c=e.slice(0,a),d=e.slice(s+1);return"left"===n?[...c,...l,...o,...d]:[...c,...o,...l,...d]},Yl=(e,t)=>Vl(t,e,"left"),Xl=(e,t)=>Vl(t,e,"right"),Zl=(e,t)=>Gl(e,t,"left"),ql=(e,t)=>Gl(e,t,"right"),$l=Xs({name:"sendBackward",trackEvent:{category:"element"},perform:(e,t)=>({elements:Yl(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(Qt("CtrlOrCmd+[")),children:(0,v.jsx)(Ba,{theme:n.theme})})}}),Ql=Xs({name:"bringForward",trackEvent:{category:"element"},perform:(e,t)=>({elements:Xl(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(Qt("CtrlOrCmd+]")),children:(0,v.jsx)(Na,{theme:n.theme})})}}),Jl=Xs({name:"sendToBack",trackEvent:{category:"element"},perform:(e,t)=>({elements:Zl(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(Qt(lt?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")),children:(0,v.jsx)(Ua,{theme:n.theme})})}}),ec=Xs({name:"bringToFront",trackEvent:{category:"element"},perform:(e,t)=>({elements:ql(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(Qt(lt?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")),children:(0,v.jsx)(Fa,{theme:n.theme})})}}),tc=Xs({name:"selectAll",trackEvent:{category:"canvas"},perform:(e,t)=>!t.editingLinearElement&&{appState:Yr(Object.assign(Object.assign({},t),{editingGroupId:null,selectedElementIds:e.reduce(((e,t)=>(t.isDeleted||_e(t)&&t.containerId||(e[t.id]=!0),e)),{})}),Tl(e)),commitToHistory:!0},contextItemLabel:"labels.selectAll",keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.key===Lt.A}),nc=Xs({name:"duplicateSelection",trackEvent:{category:"element"},perform:(e,t)=>{if(t.editingLinearElement){const n=Eo.duplicateSelectedPoints(t);return!!n&&{elements:e,appState:n.appState,commitToHistory:!0}}return Object.assign(Object.assign({},rc(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)(rl,{type:"button",icon:es,title:"".concat(b("labels.duplicateSelection")," — ").concat(Qt("CtrlOrCmd+D")),"aria-label":b("labels.duplicateSelection"),onClick:()=>r(null),visible:Dl(Tl(t),n)})}}),rc=(e,t)=>{const n=new Map,r=[],i=[],a=new Map,s=e=>{const s=ai(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=un(Rl(e,t,!0));for(;c<e.length;){const n=e[c];if(d.get(n.id)){if(n.groupIds.length){const r=Vr(t,n);if(r){const t=Zr(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 Kn(l,i,a),Xo(l,i,a),{elements:l,appState:Yr(Object.assign(Object.assign({},t),{selectedGroupIds:{},selectedElementIds:r.reduce(((e,t)=>(Pe(t)||(e[t.id]=!0),e)),{})}),Tl(l))}},ic=Xs({name:"finalize",trackEvent:!1,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=Eo.getElement(n);if(o)return Te(o)&&So(o,r,i),{elements:o.points.length<2||Br(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&&Rr(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||Rr(l,{points:l.points.slice(0,-1)})}Br(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];Rr(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]=Eo.getPointAtIndexGlobalCoordinates(l,-1);Mo(l,t,Un.getScene(l),{x:e,y:n})}t.activeTool.locked||"freedraw"===t.activeTool.type||(t.selectedElementIds[l.id]=!0)}return(t.activeTool.locked||"freedraw"===t.activeTool.type)&&l||Vt(o),{elements:s,appState:Object.assign(Object.assign({},t),{activeTool:(t.activeTool.locked||"freedraw"===t.activeTool.type)&&l?t.activeTool:Object.assign(Object.assign({},t.activeTool),{type:"eraser"===t.activeTool.type&&t.activeTool.lastActiveToolBeforeEraser?t.activeTool.lastActiveToolBeforeEraser:"selection"}),draggingElement:null,multiElement:null,editingElement:null,startBoundElement:null,suggestedBindings:[],selectedElementIds:l&&!t.activeTool.locked&&"freedraw"!==t.activeTool.type?Object.assign(Object.assign({},t.selectedElementIds),{[l.id]:!0}):t.selectedElementIds,pendingImageElement:null}),commitToHistory:"freedraw"===t.activeTool.type}},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,data:r}=e;return(0,v.jsx)(rl,{type:"button",icon:Pa,title:b("buttons.done"),"aria-label":b("buttons.done"),onClick:n,visible:null!=t.multiElement,size:(null==r?void 0:r.size)||"medium"})}});n(518),n(9966);const oc=e=>{const{id:t}=xp(),[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})]})},ac=(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 sc;!function(e){e.ACTIVE="active",e.AWAY="away",e.IDLE="idle"}(sc||(sc={}));var lc,cc;n(4404);const dc="undefined"!=typeof process&&null!==(lc={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!==lc&&lc.REACT_APP_GOOGLE_ANALYTICS_ID&&"undefined"!=typeof window&&window.gtag?(e,t,n,r)=>{try{window.gtag("event",t,{event_category:e,event_label:n,value:r})}catch(e){console.error("error logging to ga",e)}}:("undefined"!=typeof process&&null!==(cc={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!==cc&&cc.JEST_WORKER_ID,(e,t,n,r)=>{}),uc=document.createElement("img");uc.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 hc=!1;const pc=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=mc(d.current.value);!t.link&&e&&dc("hyperlink","create"),Rr(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);Ec(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)((()=>{dc("hyperlink","delete"),Rr(t,{link:null}),u&&(d.current.value=""),i({showHyperlinkPopup:!1})}),[i,t,u]),{x:g,y:m}=gc(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:fc(t.link)?"_self":"_blank",onClick:e=>{if(t.link&&a){const n=pn(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)(rl,{type:"button",title:b("buttons.edit"),"aria-label":b("buttons.edit"),label:b("buttons.edit"),onClick:()=>{dc("hyperlink","edit","popup-ui"),i({showHyperlinkPopup:"editor"})},className:"excalidraw-hyperlinkContainer--edit",icon:Ds}),s&&(0,v.jsx)(rl,{type:"button",title:b("buttons.remove"),"aria-label":b("buttons.remove"),label:b("buttons.remove"),onClick:p,className:"excalidraw-hyperlinkContainer--remove",icon:Ia})]})]})},gc=(e,t)=>{const[n,r]=Ye(e),{x:i,y:o}=en({sceneX:n+e.width/2,sceneY:r},t);return{x:i-t.offsetLeft-160,y:o-t.offsetTop-85}},mc=e=>((e=e.trim())&&(e.includes("://")||/^[[\\/]/.test(e)||(e="https://".concat(e))),e),fc=e=>!!(null!=e&&e.includes(location.origin)||null!=e&&e.startsWith("/")),bc=Xs({name:"hyperlink",perform:(e,t)=>"editor"!==t.showHyperlinkPopup&&{elements:e,appState:Object.assign(Object.assign({},t),{showHyperlinkPopup:"editor",openMenu:null}),commitToHistory:!0},trackEvent:{category:"hyperlink",action:"click"},keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.key===Lt.K,contextItemLabel:(e,t)=>vc(e,t),contextItemPredicate:(e,t)=>1===Rl(e,t).length,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;const i=Rl(t,n);return(0,v.jsx)(rl,{type:"button",icon:Ea,"aria-label":b(vc(t,n)),title:"".concat(b("labels.link.label")," - ").concat(Qt("CtrlOrCmd+K")),onClick:()=>r(null),selected:1===i.length&&!!i[0].link})}}),vc=(e,t)=>Rl(e,t)[0].link?"labels.link.edit":"labels.link.create",xc=(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]},yc=(e,t,n,r)=>{let[i,o]=n;if(!e.link||t.selectedElementIds[e.id])return!1;const a=4/t.zoom.value;if(!r&&t.viewModeEnabled&&Fi(e,[i,o],a))return!0;const[s,l,c,d]=Ye(e),[u,h,p,g]=xc([s,l,c,d],e.angle,t);return i>u-a&&i<u+a+p&&o>h-a&&o<h+g+a};let wc=null;const kc=(e,t)=>{if(!e.link)return;const n=dl();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]=xc([r,i,o,a],e.angle,t),u=en({sceneX:s,sceneY:l},t);ul(n,{left:u.x,top:u.y,width:c,height:d},"top"),dc("hyperlink","tooltip","link-icon"),hc=!0},Ec=(e,t,n)=>{let[r,i]=n;const{x:o,y:a}=Jt({clientX:r,clientY:i},t),s=15/t.zoom.value;if(Fi(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}=gc(e,t);return!(r>=u-s&&r<=u+320+10+s&&i>=h-s&&i<=h+s+10+42)},_c=(()=>{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]})(),Cc=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()},Sc=(e,t,n,r)=>{e.beginPath(),e.arc(t,n,r,0,2*Math.PI),e.fill(),e.stroke()},jc=(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=>Dc(e,p,g,{zoom:s.zoom,offsetLeft:t.offsetLeft,offsetTop:t.offsetTop,scrollX:s.scrollX,scrollY:s.scrollY})));if(f.forEach((e=>{try{Cr(e,i,h,s),u||Pc(e,h,t)}catch(e){console.error(e)}})),t.editingLinearElement){const e=Eo.getElement(t.editingLinearElement.elementId);e&&((e,t,n,r)=>{e.save(),e.translate(n.scrollX,n.scrollY),e.lineWidth=1/n.zoom.value,Eo.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}=Eo;Sc(e,r[0],r[1],s/2/n.zoom.value)})),e.restore()})(h,t,s,e)}if(n)try{Cr(n,i,h,s)}catch(e){console.error(e)}if(Co(t)&&t.suggestedBindings.filter((e=>null!=e)).forEach((e=>{Mc(h,s,e)})),c&&!t.multiElement&&!t.editingLinearElement){const n=e.reduce(((e,n)=>{const r=[];if(t.selectedElementIds[n.id]&&!Kr(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}=ac(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=Zr(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 Gr(t))r(e);t.editingGroupId&&r(t.editingGroupId),n.forEach((e=>Tc(h,s,e)));const i=Rl(e,t);if(h.save(),h.translate(s.scrollX,s.scrollY),1===i.length){h.fillStyle=it.white;const e=gi(i[0],s.zoom,"mouse");t.viewModeEnabled||Ic(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,Cc(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=pi([t,n,r,o],0,s.zoom,"mouse",li);Ic(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}=ac(l||e,t);h.save(),h.strokeStyle=d,h.fillStyle=c;const u=s.remotePointerUserStates[e];(a||u===sc.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===sc.AWAY?f=_c?"⚫️":" (".concat(sc.AWAY,")"):u===sc.IDLE?f=_c?"💤":" (".concat(sc.IDLE,")"):u===sc.ACTIVE&&(f=_c?"🟢":"");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(tn("sat")),bottom:parseInt(tn("sab")),left:parseInt(tn("sal")),right:parseInt(tn("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),E=Math.min(l,x),_=Math.max(c,y),C=Math.max(d,w);return{horizontal:v===k&&y===_?null:{x:Math.max(f.left,4)+(v-k)/(_-k)*t,y:n-6-Math.max(4,f.bottom),width:(y-v)/(_-k)*t-Math.max(8,f.left+f.right),height:6},vertical:x===E&&w===C?null:{x:b?Math.max(f.left,4):t-6-Math.max(f.right,4),y:(x-E)/(C-E)*n+Math.max(f.top,4),width:6,height:(w-x)/(C-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}},Ic=(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?Sc(e,o[0]+o[2]/2,o[1]+o[3]/2,o[2]/2):Cc(e,o[0],o[1],o[2],o[3],o[0]+o[2]/2,o[1]+o[3]/2,r,!0),e.restore())}))},Tc=(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,Cc(e,i-u,o-u,c+2*u,d+2*u,i+c/2,o+d/2,r);e.restore()},Mc=(e,t,n)=>{const r=Array.isArray(n)?Lc:Oc;e.save(),e.translate(t.scrollX,t.scrollY),r(e,n),e.restore()},Oc=(e,t)=>{const[n,r,i,o]=Ye(t),a=i-n,s=o-r,l=Wi(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":Cc(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)}},Lc=(e,t)=>{const[n,r,i]=t,o=Wi(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]=Eo.getPointAtIndexGlobalCoordinates(n,t);Sc(e,r,i,o)}))};let Ac;const Pc=(e,t,n)=>{if(e.link&&!n.selectedElementIds[e.id]){const[r,i,o,a]=Ye(e),[s,l,c,d]=xc([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),Ac&&Ac.zoom===n.zoom.value)t.drawImage(Ac,s-u,l-h,c,d);else{Ac=document.createElement("canvas"),Ac.zoom=n.zoom.value,Ac.width=c*window.devicePixelRatio*n.zoom.value,Ac.height=d*window.devicePixelRatio*n.zoom.value;const e=Ac.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(uc,0,0,c,d),e.restore(),t.drawImage(Ac,s-u,l-h,c,d)}t.restore()}},Dc=(e,t,n,r)=>{const[i,o,a,s]=Je(e),l=Jt({clientX:r.offsetLeft,clientY:r.offsetTop},r),c=Jt({clientX:r.offsetLeft+t,clientY:r.offsetTop+n},r);return l.x<=a&&l.y<=s&&c.x>=i&&c.y>=o};var zc=Object.defineProperty,Rc=(e,t)=>()=>(e&&(t=e(e=0)),t),Hc=(e,t)=>{for(var n in(e=>{zc(e,"__esModule",{value:!0})})(e),t)zc(e,n,{get:t[n],enumerable:!0})},Nc={};Hc(Nc,{default:()=>Bc});var Bc,Fc=Rc((()=>{Bc=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()})))})),Uc={};Hc(Uc,{default:()=>Kc});var Wc,Kc,Vc=Rc((()=>{Wc=async e=>{let t=await e.getFile();return t.handle=e,t},Kc=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(Wc));return e[0].multiple?r:r[0]}})),Gc={};Hc(Gc,{default:()=>Yc});var Yc,Xc=Rc((()=>{Yc=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()})))})),Zc={};Hc(Zc,{default:()=>$c});var qc,$c,Qc=Rc((()=>{qc=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(qc(a,t,s,r))}return[...(await Promise.all(i)).flat(),...await Promise.all(o)]},$c=async(e={})=>{e.recursive=e.recursive||!1;let t=await window.showDirectoryPicker({id:e.id,startIn:e.startIn});return qc(t,e.recursive,void 0,e.skipDirectory)}})),Jc={};Hc(Jc,{default:()=>ed});var ed,td=Rc((()=>{ed=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}})),nd={};Hc(nd,{default:()=>rd});var rd,id=Rc((()=>{rd=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)}})),od=(()=>{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})(),ad=od?Promise.resolve().then((()=>(Vc(),Uc))):Promise.resolve().then((()=>(Fc(),Nc)));od?Promise.resolve().then((()=>(Qc(),Zc))):Promise.resolve().then((()=>(Xc(),Gc)));var sd=od?Promise.resolve().then((()=>(id(),nd))):Promise.resolve().then((()=>(td(),Jc)));const ld=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 ad).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 tl))}}})},cd=(e,t)=>async function(...e){return(await sd).default(...e)}(e,{fileName:"".concat(t.name,".").concat(t.extension),description:t.description,extensions:[".".concat(t.extension)]},t.fileHandle),dd={selection:!0,text:!0,rectangle:!0,diamond:!0,ellipse:!0,line:!0,image:!0,arrow:!0,freedraw:!0,eraser:!1},ud=(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||zr(),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:dn(),link:null!==(m=e.link)&&void 0!==m?m:null};return Object.assign(Object.assign(Object.assign({},f),Ur(f)),t)},hd=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 ud(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 ud(e,{points:e.points,lastCommittedPoint:null,simulatePressure:e.simulatePressure,pressures:e.pressures});case"image":return ud(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}=Eo.getNormalizedPoints(e)),ud(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 ud(e,{})}},pd=(e,t)=>{const n=t?un(t):null;return(e||[]).reduce(((e,t)=>{if("selection"!==t.type&&!Br(t)){let r=hd(t);if(r){const i=null==n?void 0:n.get(t.id);i&&i.version>r.version&&(r=Nr(r,i.version)),e.push(r)}}return e}),[])},gd=(e,t)=>{var n,r,i,o;e=e||{};const a=fn(),s={};for(const[n,r]of Object.entries(a)){const i=e[n],o=t?t[n]:void 0;s[n]=void 0!==i?i:void 0!==o?o:r}return Object.assign(Object.assign({},s),{penDetected:null!==(n=null==t?void 0:t.penDetected)&&void 0!==n?n:!!e.penMode&&(null!==(r=e.penDetected)&&void 0!==r&&r),activeTool:{lastActiveToolBeforeEraser:null,locked:null!==(i=s.activeTool.locked)&&void 0!==i&&i,type:dd[s.activeTool.type]&&null!==(o=s.activeTool.type)&&void 0!==o?o:"selection"},zoom:"number"==typeof e.zoom?{value:e.zoom}:e.zoom||a.zoom})},md=(e,t,n)=>({elements:pd(null==e?void 0:e.elements,n),appState:gd(null==e?void 0:e.appState,t||null),files:(null==e?void 0:e.files)||{}}),fd=e=>{const t=pd(Tl(e.elements),null);return t.length?Object.assign(Object.assign({},e),{elements:t}):null},bd=(e,t)=>{const n=[];for(const r of e)if(Array.isArray(r)){const e=fd({status:t,elements:r,id:zr(),created:Date.now()});e&&n.push(e)}else{const e=r,i=fd(Object.assign(Object.assign({},e),{id:e.id||zr(),status:e.status||t,created:e.created||Date.now()}));i&&n.push(i)}return n},vd=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},xd=e=>{var t;return e&&(null===(t=e.name.match(/\.(json|excalidraw|png|svg)$/))||void 0===t?void 0:t[1])||null},yd=e=>{const t=xd(e);return"png"===t||"svg"===t},wd=e=>{const{type:t}=e||{};return!!t&&o.jo.includes(t)},kd=async(e,t,n)=>{const r=await vd(e);try{const i=JSON.parse(r);if(!Ld(i))throw new Error(b("alerts.couldNotLoadInvalidFile"));return md({elements:Al(i.elements||[]),appState:Object.assign(Object.assign({theme:null==t?void 0:t.theme,fileHandle:e.handle||null},yn(i.appState||{})),t?sl(i.elements||[],t):{}),files:i.files},t,n)}catch(e){throw console.error(e.message),new Error(b("alerts.couldNotLoadInvalidFile"))}},Ed=async e=>{const t=await vd(e),n=JSON.parse(t);if(n.type!==o.r8.excalidrawLibrary)throw new Error(b("alerts.couldNotLoadInvalidFile"));return n},_d=async e=>new Promise(((t,n)=>{try{e.toBlob((e=>{if(!e)return n(new el(b("canvasError.canvasTooBig"),"CANVAS_POSSIBLY_TOO_BIG"));t(e)}))}catch(e){n(e)}})),Cd=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},Sd=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)})),jd=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(!wd(e))throw new Error(b("errors.unsupportedFileType"));return new File([await a.toBlob(e,{max:t.maxWidthOrHeight})],e.name,{type:t.outputType||e.type})},Id=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})},Td=(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},Md=(e,t,n,r)=>{const i={type:o.r8.excalidraw,version:o.Kr.excalidraw,source:o.pb,elements:"local"===r?Al(e):Ll(e),appState:"local"===r?yn(t):wn(t),files:"local"===r?Td(e,n):void 0};return JSON.stringify(i,null,2)},Od=async(e,t,n)=>{const r=Md(e,t,n,"local"),i=new Blob([r],{type:o.LO.excalidraw});return{fileHandle:await cd(i,{name:t.name,extension:"excalidraw",description:"Excalidraw file",fileHandle:yd(t.fileHandle)?null:t.fileHandle})}},Ld=e=>(null==e?void 0:e.type)===o.r8.excalidraw&&(!e.elements||Array.isArray(e.elements)&&(!e.appState||"object"==typeof e.appState)),Ad=e=>new Promise(((t,n)=>{const r=new Image;r.onload=()=>{t(r)},r.onerror=e=>{n(e)},r.src=e})),Pd=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=Ad(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}},Dd=e=>e.filter((e=>ke(e))),zd="\x3c!-- svg-source:excalidraw --\x3e",Rd=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]=Nd(e,a),{canvas:p,scale:g=1}=l(u,h),m=fn(),{imageCache:f}=await Pd({imageCache:new Map,fileIds:Dd(e).map((e=>e.fileId)),files:n});return jc(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},Hd=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:Md(e,t,r||{},"local")})}catch(e){console.error(e)}const[d,u,h,p]=Nd(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(zd,"\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{jr(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},Nd=(e,t)=>{const[n,r,i,o]=et(e);return[n,r,Kt(n,i)+2*t,Kt(r,o)+t+t]},Bd=32,Fd=12,Ud=256,Wd="NOT_SPREADSHEET",Kd="VALID_SPREADSHEET",Vd=e=>{const t=/^[$€£¥₩]?([0-9,]+(\.[0-9]+)?)$/.exec(e);return t?parseFloat(t[1].replace(/,/g,"")):null},Gd=(e,t)=>e.slice(1).every((e=>null!==Vd(e[t]))),Yd=e=>{const t=e[0].length;if(t>2)return{type:Wd,reason:"More than 2 columns"};if(1===t){if(!Gd(e,0))return{type:Wd,reason:"Value is not numeric"};const t=null===Vd(e[0][0]),n=(t?e.slice(1):e).map((e=>Vd(e[0])));return n.length<2?{type:Wd,reason:"Less than two rows"}:{type:Kd,spreadsheet:{title:t?e[0][0]:null,labels:null,values:n}}}const n=Gd(e,0)?0:1;if(!Gd(e,n))return{type:Wd,reason:"Value is not numeric"};const r=(n+1)%2,i=null===Vd(e[0][n]),o=i?e.slice(1):e;return o.length<2?{type:Wd,reason:"Less than 2 rows"}:{type:Kd,spreadsheet:{title:i?e[0][n]:null,labels:o.map((e=>e[r])),values:o.map((e=>Vd(e[n])))}}},Xd=at.elementBackground.slice(2,at.elementBackground.length),Zd={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},qd=e=>({chartWidth:44*e.values.length+Fd,chartHeight:280}),$d=(e,t,n,r,i)=>{var o;return(null===(o=e.labels)||void 0===o?void 0:o.map(((e,o)=>ni(Object.assign(Object.assign({groupIds:[r],backgroundColor:i},Zd),{text:e.length>8?"".concat(e.slice(0,5),"..."):e,x:t+44*o+24,y:n+6,width:Bd,angle:5.87,fontSize:16,textAlign:"center",verticalAlign:"top"})))))||[]},Qd=(e,t,n,r,i)=>{const o=ni(Object.assign(Object.assign({groupIds:[r],backgroundColor:i},Zd),{x:t-Fd,y:n-Fd,text:"0",textAlign:"right"}));return[o,ni(Object.assign(Object.assign({groupIds:[r],backgroundColor:i},Zd),{x:t-Fd,y:n-Ud-o.height/2,text:Math.max(...e.values).toLocaleString(),textAlign:"right"}))]},Jd=(e,t,n,r,i)=>{const{chartWidth:o,chartHeight:a}=qd(e);return[ii(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Zd),{type:"line",x:t,y:n,startArrowhead:null,endArrowhead:null,width:o,points:[[0,0],[o,0]]})),ii(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Zd),{type:"line",x:t,y:n,startArrowhead:null,endArrowhead:null,height:a,points:[[0,0],[0,-a]]})),ii(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Zd),{type:"line",x:t,y:n-Ud-Fd,startArrowhead:null,endArrowhead:null,strokeStyle:"dotted",width:o,opacity:50,points:[[0,0],[o,0]]}))]},eu=(e,t,n,r,i,a)=>{const{chartWidth:s,chartHeight:l}=qd(e),c=e.title?ni(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Zd),{text:e.title,x:t+s/2,y:n-Ud-24-o.n5,strokeSharpness:"sharp",strokeStyle:"solid",textAlign:"center"})):null,d=a?ei(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Zd),{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]:[],...$d(e,t,n,r,i),...Qd(e,t,n,r,i),...Jd(e,t,n,r,i)]},tu=(e,t,n,r)=>"line"===e?((e,t,n)=>{const r=Math.max(...e.values),i=zr(),a=Xd[Math.floor(Math.random()*Xd.length)];let s=0;const l=[];for(const t of e.values){const e=44*s,n=-t/r*Ud;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=ii(Object.assign(Object.assign({backgroundColor:a,groupIds:[i]},Zd),{type:"line",x:t+Fd+16,y:n-Fd,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*Ud+6;return ei(Object.assign(Object.assign({backgroundColor:a,groupIds:[i]},Zd),{fillStyle:"solid",strokeWidth:2,type:"ellipse",x:t+s+16,y:n+l-24,width:Fd,height:Fd}))})),m=e.values.map(((e,o)=>{const s=44*o+6,l=e/r*Ud+6+Fd;return ii(Object.assign(Object.assign({backgroundColor:a,groupIds:[i]},Zd),{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[...eu(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=zr(),a=Xd[Math.floor(Math.random()*Xd.length)],s=e.values.map(((e,o)=>{const s=e/r*Ud;return ei(Object.assign(Object.assign({backgroundColor:a,groupIds:[i]},Zd),{type:"rectangle",x:t+44*o+Fd,y:n-s-Fd,width:Bd,height:s}))}));return[...s,...eu(e,t,n,i,a,"production"===o.Vi.DEVELOPMENT)]})(t,n,r);let nu="",ru=!1;const iu="clipboard"in navigator&&"readText"in navigator.clipboard,ou="clipboard"in navigator&&"writeText"in navigator.clipboard,au="clipboard"in navigator&&"write"in navigator.clipboard&&"ClipboardItem"in window&&"toBlob"in HTMLCanvasElement.prototype,su=()=>{if(!nu)return{};try{return JSON.parse(nu)}catch(e){return console.error(e),{}}},lu=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:Wd,reason:"No values"};const n=t[0].length,r=t.every((e=>e.length===n));if(!r)return{type:Wd,reason:"All rows don't have same number of columns"};const i=Yd(t);if(i.type!==Kd){const e=Yd((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===Kd)return e}return i})(e);return t.type===Kd?{spreadsheet:t.spreadsheet}:null},cu=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():iu&&await navigator.clipboard.readText())||""}catch(e){return""}})(e);if(!t||t.includes(zd))return su();const n=lu(t);if(n)return n;const r=su();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 ru&&r.elements?r:{text:t}}var i},du=async e=>{let t=!1;if(ou)try{await navigator.clipboard.writeText(e||""),t=!0}catch(e){console.error(e)}if(!t&&!uu(e||" "))throw new Error("couldn't copy")},uu=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},hu=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 Hd(t,{exportBackground:s,exportWithDarkMode:r.exportWithDarkMode,viewBackgroundColor:c,exportPadding:l,exportScale:r.exportScale,exportEmbedScene:r.exportEmbedScene&&"svg"===e},i);if("svg"===e)return await cd(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 du(n.outerHTML)}const h=await Rd(t,r,i,{exportBackground:s,viewBackgroundColor:c,exportPadding:l});h.style.display="none",document.body.appendChild(h);let p=await _d(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:Md(t,r,i,"local")})),await cd(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 pu=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:ka}),(0,v.jsx)("div",{className:"Checkbox-label",children:t})]})};n(4623);const gu=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})},mu=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 fu=e=>{let{fileName:t,onSave:n}=e;return(0,v.jsxs)(gu,{className:"ActiveFile",gap:1,align:"center",children:[(0,v.jsxs)("span",{className:"ActiveFile__fileName",children:[ts,(0,v.jsx)("span",{children:t})]}),(0,v.jsx)(rl,{type:"icon",icon:_a,title:b("buttons.save"),"aria-label":b("buttons.save"),onClick:n,"data-testid":"save-button"})]})},bu=(Xs({name:"changeProjectName",trackEvent:!1,perform:(e,t,n)=>({appState:Object.assign(Object.assign({},t),{name:n}),commitToHistory:!1}),PanelComponent:e=>{let{appState:t,updateData:n,appProps:r}=e;return(0,v.jsx)(oc,{label:b("labels.fileTitle"),value:t.name||"Unnamed",onChange:e=>n(e),isNameEditable:void 0===r.name&&!t.viewModeEnabled})}}),Xs({name:"changeExportScale",trackEvent:{category:"export",action:"scale"},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=Tl(t),a=Dl(i,n)?Rl(i,n):i;return(0,v.jsx)(v.Fragment,{children:o.ZB.map((e=>{const[t,i]=((e,t,n)=>{const[,,r,i]=Nd(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)(rl,{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)}))})}}),Xs({name:"changeExportBackground",trackEvent:{category:"export",action:"toggleBackground"},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)(pu,{checked:t.exportBackground,onChange:e=>n(e),children:b("labels.withBackground")})}}),Xs({name:"changeExportEmbedScene",trackEvent:{category:"export",action:"embedScene"},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)(pu,{checked:t.exportEmbedScene,onChange:e=>n(e),children:[b("labels.exportEmbedScene"),(0,v.jsx)(hl,{label:b("labels.exportEmbedScene_details"),long:!0,children:(0,v.jsx)("div",{className:"excalidraw-tooltip-icon",children:Ha})})]})}}),Xs({name:"saveToActiveFile",trackEvent:{category:"export"},perform:async(e,t,n,r)=>{const i=!!t.fileHandle;try{const{fileHandle:n}=yd(t.fileHandle)?await(async(e,t,n)=>{const{exportBackground:r,viewBackgroundColor:i,name:o,fileHandle:a}=t,s=xd(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 hu(s,Tl(e),t,n,{exportBackground:r,viewBackgroundColor:i,name:o,fileHandle:a}),{fileHandle:a}})(e,t,r.files):await Od(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)(fu,{onSave:()=>n(null),fileName:null===(t=r.fileHandle)||void 0===t?void 0:t.name})}}),Xs({name:"saveFileToDisk",trackEvent:{category:"export"},perform:async(e,t,n,r)=>{try{const{fileHandle:n}=await Od(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)(rl,{type:"button",icon:Ca,title:b("buttons.saveAs"),"aria-label":b("buttons.saveAs"),showAriaLabel:bp().isMobile,hidden:!od,onClick:()=>t(null),"data-testid":"save-as-button"})}}));Xs({name:"loadScene",trackEvent:{category:"export"},perform:async(e,t,n,r)=>{try{const{elements:n,appState:r,files:i}=await(async(e,t)=>{const n=await ld({description:"Excalidraw files"});return kd(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)(rl,{type:"button",icon:Sa,title:b("buttons.load"),"aria-label":b("buttons.load"),showAriaLabel:bp().isMobile,onClick:t,"data-testid":"load-button"})}}),Xs({name:"exportWithDarkMode",trackEvent:{category:"export",action:"toggleTheme"},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)(il,{value:t.exportWithDarkMode?o.C6.DARK:o.C6.LIGHT,onChange:e=>{n(e===o.C6.DARK)},title:b("labels.toggleExportColorScheme")})})}});let vu="{}";const xu=Xs({name:"copyStyles",trackEvent:{category:"element"},perform:(e,t)=>{const n=e.find((e=>t.selectedElementIds[e.id]));return n&&(vu=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===Et}),yu=Xs({name:"pasteStyles",trackEvent:{category:"element"},perform:(e,t)=>{const n=JSON.parse(vu);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=Hr(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 _e(t)&&_e(e)&&(Rr(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}),Wn(t,or(t))),t}return e})),commitToHistory:!0};var r},contextItemLabel:"labels.pasteStyles",keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.altKey&&e.code===It}),wu=e=>(0,v.jsx)("button",{className:"help-icon",onClick:e.onClick,type:"button",title:"".concat(e.title," — ?"),"aria-label":e.title,children:Ha}),ku=(Xs({name:"toggleCanvasMenu",trackEvent:{category:"menu"},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)(rl,{type:"button",icon:Da,"aria-label":b("buttons.menu"),onClick:n,selected:"canvas"===t.openMenu})}}),Xs({name:"toggleEditMenu",trackEvent:{category:"menu"},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)(rl,{visible:Sl(n,Tl(t)),type:"button",icon:Ta,"aria-label":b("buttons.edit"),onClick:r,selected:"shape"===n.openMenu})}}),Xs({name:"toggleFullScreen",trackEvent:{category:"canvas",predicate:e=>!$t()},perform:()=>($t()||document.documentElement.requestFullscreen(),$t()&&document.exitFullscreen(),{commitToHistory:!1}),keyTest:e=>e.code===St&&!e[Lt.CTRL_OR_CMD]}),Xs({name:"toggleShortcuts",trackEvent:{category:"menu",action:"toggleHelpDialog"},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)(wu,{title:b("helpDialog.title"),onClick:t})},keyTest:e=>e.key===Lt.QUESTION_MARK}),(e,t)=>{const n=Rl(Tl(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&&Xr(t,n)),!0))return!0}return!1})(n)}),Eu=Xs({name:"group",trackEvent:{category:"element"},perform:(e,t)=>{const n=Rl(Tl(e),t,!0);if(n.length<2)return{appState:t,elements:e,commitToHistory:!1};const r=Gr(t);if(1===r.length){const i=r[0],o=new Set(Zr(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=zr(),o=un(n),a=e.map((e=>o.get(e.id)?Hr(e,{groupIds:qr(e.groupIds,i,t.editingGroupId)}):e)),s=Zr(a,i),l=s[s.length-1],c=a.lastIndexOf(l),d=a.slice(c+1),u=[...a.slice(0,c).filter((e=>!Xr(e,i))),...s,...d];return{appState:Wr(i,Object.assign(Object.assign({},t),{selectedGroupIds:{}}),Tl(u)),elements:u,commitToHistory:!0}},contextItemLabel:"labels.group",contextItemPredicate:(e,t)=>ku(e,t),keyTest:e=>!e.shiftKey&&e[Lt.CTRL_OR_CMD]&&e.code===Ct,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)(rl,{hidden:!ku(t,n),type:"button",icon:(0,v.jsx)(ns,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.group")," — ").concat(Qt("CtrlOrCmd+G")),"aria-label":b("labels.group"),visible:Dl(Tl(t),n)})}}),_u=Xs({name:"ungroup",trackEvent:{category:"element"},perform:(e,t)=>{if(0===Gr(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:Hr(e,{groupIds:r})})),i=Yr(Object.assign(Object.assign({},t),{selectedGroupIds:{}}),Tl(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===Ct,contextItemLabel:"labels.ungroup",contextItemPredicate:(e,t)=>Gr(t).length>0,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)(rl,{type:"button",hidden:0===Gr(n).length,icon:(0,v.jsx)(rs,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.ungroup")," — ").concat(Qt("CtrlOrCmd+Shift+G")),"aria-label":b("labels.ungroup"),visible:Dl(Tl(t),n)})}});n(2789);const Cu=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})},Su=(Xs({name:"goToCollaborator",trackEvent:{category:"collab"},perform:(e,t,n)=>{const r=n;return r?{appState:Object.assign(Object.assign(Object.assign({},t),al({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}=ac(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)(Cu,{color:a,border:l?"transparent":s,onClick:()=>n(o.pointer),children:l?(0,v.jsx)("img",{referrerPolicy:"no-referrer",src:l,alt:c}):c})}}),Xs({name:"addToLibrary",trackEvent:{category:"element"},perform:(e,t,n,r)=>{const i=Rl(Tl(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:zr(),status:"unpublished",elements:i.map(oi),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"})),ju=(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})},Iu=(e,t)=>Rl(Tl(e),t).length>1,Tu=(e,t,n)=>{const r=((e,t)=>{const n=$r(e),r=rt(e);return n.flatMap((e=>{const n=ju(e,r,t);return e.map((e=>Hr(e,{x:e.x+n.x,y:e.y+n.y})))}))})(Rl(Tl(e),t),n),i=un(r);return e.map((e=>i.get(e.id)||e))},Mu=(Xs({name:"alignTop",trackEvent:{category:"element"},perform:(e,t)=>({appState:t,elements:Tu(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)(rl,{hidden:!Iu(t,n),type:"button",icon:(0,v.jsx)(Wa,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.alignTop")," — ").concat(Qt("CtrlOrCmd+Shift+Up")),"aria-label":b("labels.alignTop"),visible:Dl(Tl(t),n)})}}),Xs({name:"alignBottom",trackEvent:{category:"element"},perform:(e,t)=>({appState:t,elements:Tu(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)(rl,{hidden:!Iu(t,n),type:"button",icon:(0,v.jsx)(Ka,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.alignBottom")," — ").concat(Qt("CtrlOrCmd+Shift+Down")),"aria-label":b("labels.alignBottom"),visible:Dl(Tl(t),n)})}}),Xs({name:"alignLeft",trackEvent:{category:"element"},perform:(e,t)=>({appState:t,elements:Tu(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)(rl,{hidden:!Iu(t,n),type:"button",icon:(0,v.jsx)(Va,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.alignLeft")," — ").concat(Qt("CtrlOrCmd+Shift+Left")),"aria-label":b("labels.alignLeft"),visible:Dl(Tl(t),n)})}}),Xs({name:"alignRight",trackEvent:{category:"element"},perform:(e,t)=>({appState:t,elements:Tu(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)(rl,{hidden:!Iu(t,n),type:"button",icon:(0,v.jsx)(Ga,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.alignRight")," — ").concat(Qt("CtrlOrCmd+Shift+Right")),"aria-label":b("labels.alignRight"),visible:Dl(Tl(t),n)})}}),Xs({name:"alignVerticallyCentered",trackEvent:{category:"element"},perform:(e,t)=>({appState:t,elements:Tu(e,t,{position:"center",axis:"y"}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)(rl,{hidden:!Iu(t,n),type:"button",icon:(0,v.jsx)(Za,{theme:n.theme}),onClick:()=>r(null),title:b("labels.centerVertically"),"aria-label":b("labels.centerVertically"),visible:Dl(Tl(t),n)})}}),Xs({name:"alignHorizontallyCentered",trackEvent:{category:"element"},perform:(e,t)=>({appState:t,elements:Tu(e,t,{position:"center",axis:"x"}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)(rl,{hidden:!Iu(t,n),type:"button",icon:(0,v.jsx)(qa,{theme:n.theme}),onClick:()=>r(null),title:b("labels.centerHorizontally"),"aria-label":b("labels.centerHorizontally"),visible:Dl(Tl(t),n)})}}),(e,t)=>Rl(Tl(e),t).length>1),Ou=(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=$r(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=>Hr(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=>Hr(e,{x:e.x+a.x,y:e.y+a.y})))}))})(Rl(Tl(e),t),n),i=un(r);return e.map((e=>i.get(e.id)||e))},Lu=(Xs({name:"distributeHorizontally",trackEvent:{category:"element"},perform:(e,t)=>({appState:t,elements:Ou(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)(rl,{hidden:!Mu(t,n),type:"button",icon:(0,v.jsx)(Ya,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.distributeHorizontally")," — ").concat(Qt("Alt+H")),"aria-label":b("labels.distributeHorizontally"),visible:Dl(Tl(t),n)})}}),Xs({name:"distributeVertically",trackEvent:{category:"element"},perform:(e,t)=>({appState:t,elements:Ou(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)(rl,{hidden:!Mu(t,n),type:"button",icon:(0,v.jsx)(Xa,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.distributeVertically")," — ").concat(Qt("Alt+V")),"aria-label":b("labels.distributeVertically"),visible:Dl(Tl(t),n)})}}),Xs({name:"flipHorizontal",trackEvent:{category:"element"},perform:(e,t)=>({elements:Pu(e,t,"horizontal"),appState:t,commitToHistory:!0}),keyTest:e=>e.shiftKey&&"KeyH"===e.code,contextItemLabel:"labels.flipHorizontal",contextItemPredicate:(e,t)=>((e,t)=>{const n=Rl(Tl(e),t);return 1===n.length&&"text"!==n[0].type})(e,t)})),Au=Xs({name:"flipVertical",trackEvent:{category:"element"},perform:(e,t)=>({elements:Pu(e,t,"vertical"),appState:t,commitToHistory:!0}),keyTest:e=>e.shiftKey&&"KeyV"===e.code,contextItemLabel:"labels.flipVertical",contextItemPredicate:(e,t)=>((e,t)=>1===Rl(Tl(e),t).length)(e,t)}),Pu=(e,t,n)=>{const r=Rl(Tl(e),t);if(r.length>1)return e;const i=Du(r,t,n),o=un(i);return e.map((e=>o.get(e.id)||e))},Du=(e,t,n)=>(e.forEach((e=>{zu(e,t),"vertical"===n&&Ru(e,Math.PI)})),e),zu=(e,t)=>{const n=e.x,r=e.y,i=e.width,o=e.height,a=Qo(e.angle);let s=0;(je(e)||Ce(e))&&(s=2*e.points.reduce(((e,t)=>Math.max(e,t[0])),0)-e.width),Rr(e,{angle:Qo(0)});const l=gi(e,t.zoom);let c=!0,d=0,u=l.nw;if(!u&&(c=!1,u=l.ne,!u))return void Rr(e,{angle:a});if(je(e)){for(let t=1;t<e.points.length;t++)Eo.movePoints(e,[{index:t,point:[-e.points[t][0],e.points[t][1]]}]);Eo.normalizePoints(e)}else d=c?e.x+2*i:e.x-2*i,ia((new Map).set(e.id,e),!0,e,c?"nw":"ne",!1,d,u[1]),Rr(e,{width:i,height:o});let h=Qo(2*Math.PI-a);h<0&&(h=Qo(h+2*Math.PI)),Rr(e,{angle:h}),Rr(e,{x:n+s,y:r}),Ho(e)},Ru=(e,t)=>{const n=e.x,r=e.y;let i=Qo(e.angle+t);i<0&&(i=Qo(2*Math.PI+i)),Rr(e,{angle:i}),Rr(e,{x:n,y:r})},Hu=Xs({name:"copy",trackEvent:{category:"element"},perform:(e,t,n,r)=>((async(e,t,n)=>{const r=Rl(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);nu=a;try{ru=!1,await du(a)}catch(e){ru=!0,console.error(e)}})(Tl(e),t,r.files),{commitToHistory:!1}),contextItemLabel:"labels.copy",keyTest:void 0}),Nu=Xs({name:"cut",trackEvent:{category:"element"},perform:(e,t,n,r)=>(Hu.perform(e,t,n,r),Bl.perform(e,t)),contextItemLabel:"labels.cut",keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.code===Tt}),Bu=Xs({name:"copyAsSvg",trackEvent:{category:"element"},perform:async(e,t,n,r)=>{if(!r.canvas)return{commitToHistory:!1};const i=Rl(Tl(e),t,!0);try{return await hu("clipboard-svg",i.length?i:Tl(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"}),Fu=Xs({name:"copyAsPng",trackEvent:{category:"element"},perform:async(e,t,n,r)=>{if(!r.canvas)return{commitToHistory:!1};const i=Rl(Tl(e),t,!0);try{return await hu("clipboard",i.length?i:Tl(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===Et&&e.altKey&&e.shiftKey}),Uu=Xs({name:"gridMode",trackEvent:{category:"canvas",predicate:e=>!e.gridSize},perform(e,t){return{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}),Wu=Xs({name:"zenMode",trackEvent:{category:"canvas",predicate:e=>!e.zenModeEnabled},perform(e,t){return{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}),Ku=Xs({name:"stats",trackEvent:{category:"menu"},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}),Vu=Xs({name:"unbindText",contextItemLabel:"labels.unbindText",trackEvent:{category:"element"},contextItemPredicate:(e,t)=>Rl(e,t).some((e=>Ae(e))),perform:(e,t)=>(Rl(Tl(e),t).forEach((e=>{const t=ir(e);if(t){var n;const{width:r,height:i,baseline:o}=Gn(t.originalText,Ut(t));Rr(t,{containerId:null,width:r,height:i,baseline:o,text:t.originalText}),Rr(e,{boundElements:null===(n=e.boundElements)||void 0===n?void 0:n.filter((e=>e.id!==t.id))})}})),{elements:e,appState:t,commitToHistory:!0})}),Gu=Xs({name:"bindText",contextItemLabel:"labels.bindText",trackEvent:{category:"element"},contextItemPredicate:(e,t)=>{const n=Rl(e,t);if(2===n.length){const e=_e(n[0])||_e(n[1]);let t;if(Le(n[0])?t=n[0]:Le(n[1])&&(t=n[1]),e&&t&&null===ir(t))return!0}return!1},perform:(e,t)=>{const n=Rl(Tl(e),t);let r,i;_e(n[0])&&Le(n[1])?(r=n[0],i=n[1]):(r=n[1],i=n[0]),Rr(r,{containerId:i.id,verticalAlign:o.oX.MIDDLE}),Rr(i,{boundElements:(i.boundElements||[]).concat({type:"text",id:r.id})}),Wn(r,i);const a=e.slice(),s=a.findIndex((e=>e.id===r.id));a.splice(s,1);const l=a.findIndex((e=>e.id===i.id));return a.splice(l+1,0,r),{elements:a,appState:Object.assign(Object.assign({},t),{selectedElementIds:{[i.id]:!0}}),commitToHistory:!0}}}),Yu=(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=un(e),a=i.elements,s=un(a),l=e.filter((e=>!s.has(e.id))),c=a.map((e=>Hr(o.get(e.id)||e,e))).concat(l.map((e=>Hr(e,{isDeleted:!0}))));return qo(c,l),{elements:c,appState:Object.assign(Object.assign({},t),i.appState),commitToHistory:r,syncHistory:!0}}return{commitToHistory:r}},Xu=(e,t,n,r,i,o)=>{if(e.trackEvent)try{if("object"==typeof e.trackEvent){(!e.trackEvent.predicate||e.trackEvent.predicate(n,r,o))&&dc(e.trackEvent.category,e.trackEvent.action||e.name,"".concat(t," (").concat(i.deviceType.isMobile?"mobile":"desktop",")"))}}catch(e){console.error("error while logging action:",e)}};class Zu{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=this.getElementsIncludingDeleted(),o=this.getAppState(),a=e=>{Xu(n,"ui",o,i,this.app,e),this.updater(n.perform(this.getElementsIncludingDeleted(),this.getAppState(),e,this.app))};return(0,v.jsx)(r,{elements:this.getElementsIncludingDeleted(),appState:this.getAppState(),updateData:a,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();if(i&&!Object.values(o.EH).includes(n[0].name))return!1;const a=this.getElementsIncludingDeleted(),s=this.getAppState();return Xu(r,"keyboard",s,a,this.app,null),e.preventDefault(),this.updater(n[0].perform(a,s,null,this.app)),!0}executeAction(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"api";const n=this.getElementsIncludingDeleted(),r=this.getAppState();Xu(e,t,r,n,this.app,null),this.updater(e.perform(n,r,null,this.app))}}const qu=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.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=bd(t,"unpublished");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 Ed(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=bd(o,t),s=[];for(const e of a)r(i,e)&&s.push(e);await this.saveLibrary([...s,...i])}},$u=e=>{const t=Array.from(e.values());return{x:Ju(t,(e=>e.x))/t.length,y:Ju(t,(e=>e.y))/t.length}},Qu=e=>{let[t,n]=e;return Math.hypot(t.x-n.x,t.y-n.y)},Ju=(e,t)=>e.reduce(((e,n)=>e+t(n)),0),eh=e=>({selectedElementIds:e.selectedElementIds,selectedGroupIds:e.selectedGroupIds,viewBackgroundColor:e.viewBackgroundColor,editingLinearElement:e.editingLinearElement,editingGroupId:e.editingGroupId,name:e.name});const th=class{constructor(){this.elementCache=new Map,this.recording=!0,this.stateHistory=[],this.redoStack=[],this.lastEntry=null,this.generateEntry=(e,t)=>this.dehydrateHistoryEntry({appState:eh(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,oi(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)}},nh=[{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.O},{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 rh={cut:[Qt("CtrlOrCmd+X")],copy:[Qt("CtrlOrCmd+C")],paste:[Qt("CtrlOrCmd+V")],copyStyles:[Qt("CtrlOrCmd+Alt+C")],pasteStyles:[Qt("CtrlOrCmd+Alt+V")],selectAll:[Qt("CtrlOrCmd+A")],deleteSelectedElements:[Qt("Del")],duplicateSelection:[Qt("CtrlOrCmd+D"),Qt("Alt+".concat(b("helpDialog.drag")))],sendBackward:[Qt("CtrlOrCmd+[")],bringForward:[Qt("CtrlOrCmd+]")],sendToBack:[Qt(lt?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")],bringToFront:[Qt(lt?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")],copyAsPng:[Qt("Shift+Alt+C")],copyAsSvg:[],group:[Qt("CtrlOrCmd+G")],ungroup:[Qt("CtrlOrCmd+Shift+G")],gridMode:[Qt("CtrlOrCmd+'")],zenMode:[Qt("Alt+Z")],stats:[Qt("Alt+/")],addToLibrary:[],flipHorizontal:[Qt("Shift+H")],flipVertical:[Qt("Shift+V")],viewMode:[Qt("Alt+R")],hyperlink:[Qt("CtrlOrCmd+K")]},ih=e=>{const t=rh[e];return t&&t.length>0?t[0]:""},oh=e=>{let{options:t,onCloseRequest:n,top:r,left:i,actionManager:o,appState:a,elements:s}=e;return(0,v.jsx)(da,{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,"contextMenu"),children:[(0,v.jsx)("div",{className:"context-menu-option__label",children:l}),(0,v.jsx)("kbd",{className:"context-menu-option__shortcut",children:i?ih(i):""})]})},t)}))})})},ah=new WeakMap,sh={push(e){const t=Array.of();e.options.forEach((e=>{e&&t.push(e)})),t.length&&(0,st.render)((0,v.jsx)(oh,{top:e.top,left:e.left,options:t,onCloseRequest:()=>(e=>{const t=ah.get(e);t&&((0,st.unmountComponentAtNode)(t),t.remove(),ah.delete(e))})(e.container),actionManager:e.actionManager,appState:e.appState,elements:e.elements}),(e=>{let t=ah.get(e);return t||(t=document.createElement("div"),e.querySelector(".excalidraw-contextMenuContainer").appendChild(t),ah.set(e,t),t)})(e.container))}},lh=e=>{var t;let{appState:n,elements:r,renderAction:i,activeTool:o}=e;const a=Hl(Tl(r),n);let s=!1;2===a.length&&(Ae(a[0])||Ae(a[1]))&&(s=!0);const l=Boolean(n.editingElement),c=bp(),d="rtl"===document.documentElement.getAttribute("dir"),u=Hs(o)||a.some((e=>Hs(e.type)&&!sn(e.backgroundColor))),h=Hs(o)||a.some((e=>Hs(e.type))),p=1===a.length||s;let g=(null===(t=a[0])||void 0===t?void 0:t.type)||null;for(const e of a)if(e.type!==g){g=null;break}return(0,v.jsxs)("div",{className:"panelColumn",children:[(Ns(o)&&"image"!==o&&"image"!==g||a.some((e=>Ns(e.type))))&&i("changeStrokeColor"),h&&i("changeBackgroundColor"),u&&i("changeFillStyle"),(Bs(o)||a.some((e=>Bs(e.type))))&&i("changeStrokeWidth"),("freedraw"===o||a.some((e=>"freedraw"===e.type)))&&i("changeStrokeShape"),(Fs(o)||a.some((e=>Fs(e.type))))&&(0,v.jsxs)(v.Fragment,{children:[i("changeStrokeStyle"),i("changeSloppiness")]}),(Us(o)||a.some((e=>Us(e.type))))&&(0,v.jsx)(v.Fragment,{children:i("changeSharpness")}),(Ws(o)||a.some((e=>Ws(e.type))))&&(0,v.jsxs)(v.Fragment,{children:[i("changeFontSize"),i("changeFontFamily"),i("changeTextAlign")]}),a.some((e=>Ae(e)||Pe(e)))&&i("changeVerticalAlign"),(Ks(o)||a.some((e=>Ks(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.isMobile&&i("duplicateSelection"),!c.isMobile&&i("deleteSelectedElements"),i("group"),i("ungroup"),p&&i("hyperlink")]})]})]})},ch=e=>{let{canvas:t,activeTool:n,setAppState:r,onImageAction:i,appState:o}=e;const a=ln((e=>{let{activeToolType:a,pointerType:s}=e;o.activeTool.type!==a&&dc("toolbar",a,"ui"),o.penDetected||"pen"!==s||r({penDetected:!0,penMode:!0});const l=Object.assign(Object.assign({},n),{type:a});r({activeTool:l,multiElement:null,selectedElementIds:{}}),qt(t,Object.assign(Object.assign({},o),{activeTool:l})),"image"===a&&i({pointerType:s})}));return(0,v.jsx)(v.Fragment,{children:nh.map(((e,t)=>{let{value:r,icon:i,key:o}=e;const s=b("toolBar.".concat(r)),l=o&&("string"==typeof o?o:o[0]),c=l?"".concat(Nt(l)," ").concat(b("helpDialog.or")," ").concat(t+1):"".concat(t+1);return(0,v.jsx)(rl,{className:"Shape",type:"radio",icon:i,checked:n.type===r,name:"editor-current-shape",title:"".concat(Nt(s)," — ").concat(c),keyBindingLabel:"".concat(t+1),"aria-label":Nt(s),"aria-keyshortcuts":c,"data-testid":r,onPointerDown:e=>{let{pointerType:t}=e;a({activeToolType:r,pointerType:t})},onChange:e=>{let{pointerType:t}=e;a({activeToolType:r,pointerType:t})}},r)}))})},dh=e=>{let{renderAction:t,zoom:n}=e;return(0,v.jsx)(mu,{gap:1,children:(0,v.jsxs)(gu,{gap:1,align:"center",children:[t("zoomOut"),t("zoomIn"),t("resetZoom")]})})},uh=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 hh=e=>{let{isCollaborating:t,collaboratorCount:n,onClick:r}=e;return(0,v.jsx)(v.Fragment,{children:(0,v.jsx)(rl,{className:ye("CollabButton",{"is-collaborating":t}),onClick:r,icon:$a,type:"button",title:b("labels.liveCollaboration"),"aria-label":b("labels.liveCollaboration"),showAriaLabel:bp().isMobile,children:n>0&&(0,v.jsx)("div",{className:"CollabButton-collaborators",children:n})})})},ph=e=>{let{message:t,onClose:n}=e;const[o,a]=(0,r.useState)(!!t),{container:s}=xp(),l=i().useCallback((()=>{a(!1),n&&n(),null==s||s.focus()}),[n,s]);return(0,v.jsx)(v.Fragment,{children:o&&(0,v.jsx)(fl,{small:!0,onCloseRequest:l,title:b("errorDialog.title"),children:(0,v.jsx)("div",{style:{whiteSpace:"pre-wrap"},children:t})})})};n(2205);const gh="filter"in document.createElement("canvas").getContext("2d"),mh=()=>(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"),")"]})]}),fh=(e,t)=>{(0,st.unmountComponentAtNode)(t),t.innerHTML="",e instanceof HTMLCanvasElement?t.appendChild(e):(0,st.render)((0,v.jsx)(mh,{}),t)},bh=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})},vh=e=>{let{elements:t,appState:n,files:i,exportPadding:a=o.qy,actionManager:s,onExportToPng:l,onExportToSvg:c,onExportToClipboard:d}=e;const u=Dl(t,n),[h,p]=(0,r.useState)(u),g=(0,r.useRef)(null),{exportBackground:m,viewBackgroundColor:f}=n,x=h?Rl(t,n,!0):t;return(0,r.useEffect)((()=>{p(u)}),[u]),(0,r.useEffect)((()=>{const e=g.current;e&&Rd(x,n,i,{exportBackground:m,viewBackgroundColor:f,exportPadding:a}).then((t=>_d(t).then((()=>{fh(t,e)})))).catch((t=>{console.error(t),fh(new el,e)}))}),[n,i,x,m,a,f]),(0,v.jsxs)("div",{className:"ExportDialog",children:[(0,v.jsx)("div",{className:"ExportDialog__preview",ref:g}),gh&&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)(pu,{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)(gu,{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:!od&&s.renderAction("changeProjectName")}),(0,v.jsxs)(gu,{gap:2,justifyContent:"center",style:{margin:"2em 0"},children:[(0,v.jsx)(bh,{color:"indigo",title:b("buttons.exportToPng"),"aria-label":b("buttons.exportToPng"),onClick:()=>l(x),children:"PNG"}),(0,v.jsx)(bh,{color:"red",title:b("buttons.exportToSvg"),"aria-label":b("buttons.exportToSvg"),onClick:()=>c(x),children:"SVG"}),au&&(0,v.jsx)(bh,{title:b("buttons.copyPngToClipboard"),onClick:()=>d(x),color:"gray",shade:7,children:ja})]})]})},xh=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)(rl,{onClick:()=>{p(!0)},"data-testid":"image-export-button",icon:Ma,type:"button","aria-label":b("buttons.exportImage"),showAriaLabel:bp().isMobile,title:b("buttons.exportImage")}),h&&(0,v.jsx)(fl,{onCloseRequest:g,title:b("buttons.exportImage"),children:(0,v.jsx)(vh,{elements:t,appState:n,files:a,exportPadding:s,actionManager:l,onExportToPng:c,onExportToSvg:d,onExportToClipboard:u,onCloseRequest:g})})]})};n(1310);const yh=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 wh=e=>{let{appState:t,elements:n,isMobile:r}=e,i=(e=>{let{appState:t,elements:n,isMobile:r}=e;const{activeTool:i,isResizing:o,isRotating:a,lastPointerDownWith:s}=t,l=null!==t.multiElement;if(kn(t))return b("hints.eraserRevert");if("arrow"===i.type||"line"===i.type)return b(l?"hints.linearElementMulti":"hints.linearElement");if("freedraw"===i.type)return b("hints.freeDraw");if("text"===i.type)return b("hints.text");if("image"===t.activeTool.type&&t.pendingImageElement)return b("hints.placeImage");const c=Rl(n,t);if(o&&"mouse"===s&&1===c.length){const e=c[0];return je(e)&&2===e.points.length?b("hints.lockAngle"):Ee(e)?b("hints.resizeImage"):b("hints.resize")}if(a&&"mouse"===s)return b("hints.rotate");if(1===c.length&&_e(c[0]))return b("hints.text_selected");if(t.editingElement&&_e(t.editingElement))return b("hints.text_editing");if("selection"===i.type){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=Qt(i),(0,v.jsx)("div",{className:"HintViewer",children:(0,v.jsx)("span",{children:i})})):null},kh={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"})})},Eh=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?kh.CHECKED:kh.UNCHECKED})]});var _h=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 Ch=e=>{let{heading:t,children:n}=e,r=_h(e,["heading","children"]);const{id:i}=xp(),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 Sh=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)(hl,{label:r.username||"Unknown user",children:o.renderAction("goToCollaborator",{id:t})},t)}))})})),jh=(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"})}),Ih=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:jh})]})},Th="medium",Mh={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"})]})},Oh=e=>e.penDetected?(0,v.jsxs)("label",{className:ye("ToolIcon ToolIcon__penMode ToolIcon_type_floating","ToolIcon_size_".concat(Th),{"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?Mh.CHECKED:Mh.UNCHECKED})]}):e.isMobile?null:(0,v.jsx)("label",{className:ye("ToolIcon ToolIcon__penMode ToolIcon_type_floating","ToolIcon_size_".concat(Th),{"is-mobile":e.isMobile}),children:(0,v.jsx)("div",{className:"ToolIcon__icon ToolIcon__hidden"})}),Lh=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)(yh,{side:"top",className:"App-top-bar",children:[(0,v.jsx)("div",{}),(0,v.jsx)(Ch,{heading:"shapes",children:e=>(0,v.jsxs)(mu,{gap:4,align:"center",children:[(0,v.jsxs)(gu,{gap:1,className:"App-toolbar-container",children:[(0,v.jsxs)(pl,{padding:1,className:"App-toolbar",children:[e,(0,v.jsx)(gu,{gap:1,children:(0,v.jsx)(ch,{appState:n,canvas:h,activeTool:n.activeTool,setAppState:l,onImageAction:e=>{let{pointerType:t}=e;x({insertOnCanvasDirectly:"mouse"!==t})}})})]}),(0,v.jsx)(rl,{type:"button",className:"HomeButton ToolIcon_type_floating",title:"Home","aria-label":"Home",icon:Rs,onClick:t},"home"),(0,v.jsx)(Eh,{checked:n.activeTool.locked,onChange:d,title:b("toolBar.lock"),isMobile:!0}),(0,v.jsx)(Ih,{appState:n,setAppState:l,isMobile:!0}),(0,v.jsx)(Oh,{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)(pl,{padding:0,children:[w.canvasActions&&"canvas"===n.openMenu?(0,v.jsx)(Ch,{className:"App-mobile-menu",heading:"canvasActions",children:(0,v.jsx)("div",{className:"panelColumn",children:(0,v.jsxs)(mu,{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)(hh,{isCollaborating:p,collaboratorCount:n.collaborators.size,onClick:c}),(0,v.jsx)(uh,{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)(Sh,{mobile:!0,layout:"horizontal",collaborators:n.collaborators,actionManager:o})]})]})})}):"shape"===n.openMenu&&!m&&Sl(n,r)?(0,v.jsx)(Ch,{className:"App-mobile-menu",heading:"selectedShapeActions",children:(0,v.jsx)(lh,{appState:n,elements:r,renderAction:o.renderAction,activeTool:n.activeTool.type})}):null,(0,v.jsxs)("footer",{className:"App-toolbar",children:[(()=>{const e=!n.viewModeEnabled&&!n.editingElement&&0===Rl(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({},sl(r,n)))},children:b("buttons.scrollBackToContent")})]})]})})]})};n(8051);const Ah=e=>{const t=(0,r.useRef)(null),[n,i]=(0,r.useState)(null);return(0,r.useLayoutEffect)((()=>{if(!e.spreadsheet)return;const n=tu(e.chartType,e.spreadsheet,0,0);let r;i(n);const o=t.current;return(async()=>{r=await Hd(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})})},Ph=e=>{let{setAppState:t,appState:n,onClose:r,onInsertChart:o}=e;const a=i().useCallback((()=>{r&&r()}),[r]),s=(e,n)=>{o(n),dc("magic","chart",e),t({currentChartType:e,pasteDialog:{shown:!1,data:null}})};return(0,v.jsx)(fl,{small:!0,onCloseRequest:a,title:b("labels.pasteCharts"),className:"PasteChartDialog",autofocus:!1,children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(Ah,{chartType:"bar",spreadsheet:n.pasteDialog.data,selected:"bar"===n.currentChartType,onClick:s}),(0,v.jsx)(Ah,{chartType:"line",spreadsheet:n.pasteDialog.data,selected:"line"===n.currentChartType,onClick:s})]})})};n(3922);const Dh=()=>(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")})]}),zh=e=>(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("h3",{children:e.title}),e.children]}),Rh=e=>(0,v.jsx)("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"space-between"},children:e.children}),Hh=e=>(0,v.jsx)("div",{style:{width:"49%"},children:e.children}),Nh=e=>(0,v.jsxs)("div",{className:"HelpDialog--island",children:[(0,v.jsx)("h3",{className:"HelpDialog--island-title",children:e.caption}),e.children]}),Bh=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)(Fh,{children:t}),e.isOr&&n!==e.shortcuts.length-1&&b("helpDialog.or")]},n)))})]})});Bh.defaultProps={isOr:!0};const Fh=e=>(0,v.jsx)("kbd",Object.assign({className:"HelpDialog--key"},e)),Uh=e=>{let{onClose:t}=e;const n=i().useCallback((()=>{t&&t()}),[t]);return(0,v.jsx)(v.Fragment,{children:(0,v.jsxs)(fl,{onCloseRequest:n,title:b("helpDialog.title"),className:"HelpDialog",children:[(0,v.jsx)(Dh,{}),(0,v.jsx)(zh,{title:b("helpDialog.shortcuts"),children:(0,v.jsxs)(Rh,{children:[(0,v.jsxs)(Hh,{children:[(0,v.jsxs)(Nh,{caption:b("helpDialog.tools"),children:[(0,v.jsx)(Bh,{label:b("toolBar.selection"),shortcuts:["V","1"]}),(0,v.jsx)(Bh,{label:b("toolBar.rectangle"),shortcuts:["R","2"]}),(0,v.jsx)(Bh,{label:b("toolBar.diamond"),shortcuts:["D","3"]}),(0,v.jsx)(Bh,{label:b("toolBar.ellipse"),shortcuts:["O","4"]}),(0,v.jsx)(Bh,{label:b("toolBar.arrow"),shortcuts:["A","5"]}),(0,v.jsx)(Bh,{label:b("toolBar.line"),shortcuts:["P","6"]}),(0,v.jsx)(Bh,{label:b("toolBar.freedraw"),shortcuts:["Shift + P","X","7"]}),(0,v.jsx)(Bh,{label:b("toolBar.text"),shortcuts:["T","8"]}),(0,v.jsx)(Bh,{label:b("toolBar.image"),shortcuts:["9"]}),(0,v.jsx)(Bh,{label:b("toolBar.library"),shortcuts:["0"]}),(0,v.jsx)(Bh,{label:b("toolBar.eraser"),shortcuts:[Qt("E")]}),(0,v.jsx)(Bh,{label:b("helpDialog.editSelectedShape"),shortcuts:[Qt("Enter"),b("helpDialog.doubleClick")]}),(0,v.jsx)(Bh,{label:b("helpDialog.textNewLine"),shortcuts:[Qt("Enter"),Qt("Shift+Enter")]}),(0,v.jsx)(Bh,{label:b("helpDialog.textFinish"),shortcuts:[Qt("Esc"),Qt("CtrlOrCmd+Enter")]}),(0,v.jsx)(Bh,{label:b("helpDialog.curvedArrow"),shortcuts:["A",b("helpDialog.click"),b("helpDialog.click"),b("helpDialog.click")],isOr:!1}),(0,v.jsx)(Bh,{label:b("helpDialog.curvedLine"),shortcuts:["L",b("helpDialog.click"),b("helpDialog.click"),b("helpDialog.click")],isOr:!1}),(0,v.jsx)(Bh,{label:b("toolBar.lock"),shortcuts:["Q"]}),(0,v.jsx)(Bh,{label:b("helpDialog.preventBinding"),shortcuts:[Qt("CtrlOrCmd")]}),(0,v.jsx)(Bh,{label:b("toolBar.link"),shortcuts:[Qt("CtrlOrCmd+K")]})]}),(0,v.jsxs)(Nh,{caption:b("helpDialog.view"),children:[(0,v.jsx)(Bh,{label:b("buttons.zoomIn"),shortcuts:[Qt("CtrlOrCmd++")]}),(0,v.jsx)(Bh,{label:b("buttons.zoomOut"),shortcuts:[Qt("CtrlOrCmd+-")]}),(0,v.jsx)(Bh,{label:b("buttons.resetZoom"),shortcuts:[Qt("CtrlOrCmd+0")]}),(0,v.jsx)(Bh,{label:b("helpDialog.zoomToFit"),shortcuts:["Shift+1"]}),(0,v.jsx)(Bh,{label:b("helpDialog.zoomToSelection"),shortcuts:["Shift+2"]}),(0,v.jsx)(Bh,{label:b("buttons.fullScreen"),shortcuts:["F"]}),(0,v.jsx)(Bh,{label:b("buttons.zenMode"),shortcuts:[Qt("Alt+Z")]}),(0,v.jsx)(Bh,{label:b("labels.showGrid"),shortcuts:[Qt("CtrlOrCmd+'")]}),(0,v.jsx)(Bh,{label:b("labels.viewMode"),shortcuts:[Qt("Alt+R")]}),(0,v.jsx)(Bh,{label:b("labels.toggleTheme"),shortcuts:[Qt("Alt+Shift+D")]}),(0,v.jsx)(Bh,{label:b("stats.title"),shortcuts:[Qt("Alt+/")]})]})]}),(0,v.jsx)(Hh,{children:(0,v.jsxs)(Nh,{caption:b("helpDialog.editor"),children:[(0,v.jsx)(Bh,{label:b("labels.selectAll"),shortcuts:[Qt("CtrlOrCmd+A")]}),(0,v.jsx)(Bh,{label:b("labels.multiSelect"),shortcuts:[Qt("Shift+".concat(b("helpDialog.click")))]}),(0,v.jsx)(Bh,{label:b("helpDialog.deepSelect"),shortcuts:[Qt("CtrlOrCmd+".concat(b("helpDialog.click")))]}),(0,v.jsx)(Bh,{label:b("helpDialog.deepBoxSelect"),shortcuts:[Qt("CtrlOrCmd+".concat(b("helpDialog.drag")))]}),(0,v.jsx)(Bh,{label:b("labels.moveCanvas"),shortcuts:[Qt("Space+".concat(b("helpDialog.drag"))),Qt("Wheel+".concat(b("helpDialog.drag")))],isOr:!0}),(0,v.jsx)(Bh,{label:b("labels.cut"),shortcuts:[Qt("CtrlOrCmd+X")]}),(0,v.jsx)(Bh,{label:b("labels.copy"),shortcuts:[Qt("CtrlOrCmd+C")]}),(0,v.jsx)(Bh,{label:b("labels.paste"),shortcuts:[Qt("CtrlOrCmd+V")]}),(0,v.jsx)(Bh,{label:b("labels.copyAsPng"),shortcuts:[Qt("Shift+Alt+C")]}),(0,v.jsx)(Bh,{label:b("labels.copyStyles"),shortcuts:[Qt("CtrlOrCmd+Alt+C")]}),(0,v.jsx)(Bh,{label:b("labels.pasteStyles"),shortcuts:[Qt("CtrlOrCmd+Alt+V")]}),(0,v.jsx)(Bh,{label:b("labels.delete"),shortcuts:[Qt("Del")]}),(0,v.jsx)(Bh,{label:b("labels.sendToBack"),shortcuts:[Qt(lt?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")]}),(0,v.jsx)(Bh,{label:b("labels.bringToFront"),shortcuts:[Qt(lt?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")]}),(0,v.jsx)(Bh,{label:b("labels.sendBackward"),shortcuts:[Qt("CtrlOrCmd+[")]}),(0,v.jsx)(Bh,{label:b("labels.bringForward"),shortcuts:[Qt("CtrlOrCmd+]")]}),(0,v.jsx)(Bh,{label:b("labels.alignTop"),shortcuts:[Qt("CtrlOrCmd+Shift+Up")]}),(0,v.jsx)(Bh,{label:b("labels.alignBottom"),shortcuts:[Qt("CtrlOrCmd+Shift+Down")]}),(0,v.jsx)(Bh,{label:b("labels.alignLeft"),shortcuts:[Qt("CtrlOrCmd+Shift+Left")]}),(0,v.jsx)(Bh,{label:b("labels.alignRight"),shortcuts:[Qt("CtrlOrCmd+Shift+Right")]}),(0,v.jsx)(Bh,{label:b("labels.duplicateSelection"),shortcuts:[Qt("CtrlOrCmd+D"),Qt("Alt+".concat(b("helpDialog.drag")))]}),(0,v.jsx)(Bh,{label:b("buttons.undo"),shortcuts:[Qt("CtrlOrCmd+Z")]}),(0,v.jsx)(Bh,{label:b("buttons.redo"),shortcuts:ct?[Qt("CtrlOrCmd+Y"),Qt("CtrlOrCmd+Shift+Z")]:[Qt("CtrlOrCmd+Shift+Z")]}),(0,v.jsx)(Bh,{label:b("labels.group"),shortcuts:[Qt("CtrlOrCmd+G")]}),(0,v.jsx)(Bh,{label:b("labels.ungroup"),shortcuts:[Qt("CtrlOrCmd+Shift+G")]}),(0,v.jsx)(Bh,{label:b("labels.flipHorizontal"),shortcuts:[Qt("Shift+H")]}),(0,v.jsx)(Bh,{label:b("labels.flipVertical"),shortcuts:[Qt("Shift+V")]}),(0,v.jsx)(Bh,{label:b("labels.showStroke"),shortcuts:[Qt("S")]}),(0,v.jsx)(Bh,{label:b("labels.showBackground"),shortcuts:[Qt("G")]}),(0,v.jsx)(Bh,{label:b("labels.decreaseFontSize"),shortcuts:[Qt("CtrlOrCmd+Shift+<")]}),(0,v.jsx)(Bh,{label:b("labels.increaseFontSize"),shortcuts:[Qt("CtrlOrCmd+Shift+>")]})]})})]})})]})})};n(5080);const Wh=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})},Kh=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)(Wh,{color:"lime",children:[(0,v.jsx)("div",{className:"Card-icon",children:Oa}),(0,v.jsx)("h2",{children:b("exportDialog.disk_title")}),(0,v.jsxs)("div",{className:"Card-details",children:[b("exportDialog.disk_details"),!od&&i.renderAction("changeProjectName")]}),(0,v.jsx)(rl,{className:"Card-button",type:"button",title:b("exportDialog.disk_button"),"aria-label":b("exportDialog.disk_button"),showAriaLabel:!0,onClick:()=>{i.executeAction(bu,"ui")}})]}),s&&(0,v.jsxs)(Wh,{color:"pink",children:[(0,v.jsx)("div",{className:"Card-icon",children:Ea}),(0,v.jsx)("h2",{children:b("exportDialog.link_title")}),(0,v.jsx)("div",{className:"Card-details",children:b("exportDialog.link_details")}),(0,v.jsx)(rl,{className:"Card-button",type:"button",title:b("exportDialog.link_button"),"aria-label":b("exportDialog.link_button"),showAriaLabel:!0,onClick:()=>{s(t,n,r,a),dc("export","link","ui (".concat((()=>{try{return window.self===window.top?"top":"iframe"}catch(e){return"iframe"}})(),")"))}})]}),o.renderCustomUI&&o.renderCustomUI(t,n,r,a)]})})},Vh=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)(rl,{onClick:()=>{"function"==typeof s?a.executeAction(bu):d(!0)},"data-testid":"json-export-button",icon:Oa,type:"button","aria-label":b("buttons.export"),showAriaLabel:bp().isMobile,title:b("buttons.export")}),c&&s&&"function"!=typeof s&&(0,v.jsx)(fl,{onCloseRequest:u,title:b("buttons.export"),children:(0,v.jsx)(Kh,{elements:t,appState:n,files:o,actionManager:a,onCloseRequest:u,exportOpts:s,canvas:l})})]})},Gh=e=>{let{elements:t,appState:n,files:r,maxWidthOrHeight:i,getDimensions:o}=e;const{elements:a,appState:s}=md({elements:t,appState:n},null,null),{exportBackground:l,viewBackgroundColor:c}=s;return Rd(Tl(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}}))},Yh=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 Gh(e);return r=r||(/image\/jpe?g/.test(n)?.92:.8),new Promise((e=>{i.toBlob((t=>{e(t)}),n,r)}))},Xh=async e=>{let{elements:t,appState:n=fn(),files:r={},exportPadding:i}=e;const{elements:o,appState:a}=md({elements:t,appState:n},null,null);return Hd(Tl(o),Object.assign(Object.assign({},a),{exportPadding:i}),r)},Zh=async e=>{const t=await Yh(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 qh=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 Xh({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)(rl,{"aria-label":b("buttons.remove"),type:"button",icon:Qa,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})]})]})},$h="publish-library-data",Qh=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 Gh({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 jd(new File([await _d(a)],"preview",{type:o.LO.png}),{outputType:o.LO.jpg,maxWidthOrHeight:5e3})},Jh=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($h);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($h,JSON.stringify(e))}catch(e){console.error(e)}})(d),t()}),[g,t,l,d]),y=!!n.length;return(0,v.jsx)(fl,{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 Qh(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($h),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)(qh,{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)(rl,{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)(rl,{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 ep=n(2891);n(694);const tp=(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)"})}),np=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 Hd(n,{exportBackground:!1,viewBackgroundColor:it.white},i);e.innerHTML=t.outerHTML})(),()=>{e.innerHTML=""}}),[n,i]);const[u,h]=(0,r.useState)(!1),p=bp().isMobile,g=a&&(0,v.jsx)("div",{className:"library-unit__adder",children:tp});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)(pu,{checked:l,onChange:(e,n)=>c(t,n),className:"library-unit__checkbox"})]})};n(6043);const rp=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)(vl,{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),E=bp().isMobile,_=E?4:6,C=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)(mu,{children:(0,v.jsx)(np,{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,ep.chunk)(t,_);return n.length||(n=[[]]),n.map(((e,t,n)=>(t===n.length-1&&(e=e.concat(new Array(_-e.length).fill(null).map(((e,t)=>j({key:"empty_".concat(t),item:null}))))),(0,v.jsx)(gu,{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||!E)&&(0,v.jsx)(rl,{type:"button",title:b("buttons.load"),"aria-label":b("buttons.load"),icon:Sa,onClick:()=>{(async e=>{const t=await ld({description:"Excalidraw library files"});await e.importLibrary(t)})(u).then((()=>{c({isLibraryOpen:!1}),c({isLibraryOpen:!0})})).catch(an).catch((e=>{c({errorMessage:e.message})}))},className:"library-actions--load"},"import"),!!n.length&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(rl,{type:"button",title:b("buttons.export"),"aria-label":b("buttons.export"),icon:Oa,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 cd(new Blob([n],{type:o.LO.excalidrawlib}),{name:"library",extension:"excalidrawlib",description:"Excalidraw library file"})})(e?n:await u.loadLibrary()).catch(an).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)(rl,{type:"button",title:r,"aria-label":r,icon:Ia,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)(hl,{label:b("hints.publishLibrary"),children:(0,v.jsxs)(rl,{type:"button","aria-label":b("buttons.publishLibrary"),label:b("buttons.publishLibrary"),icon:Ps,className:"library-actions--publish",onClick:f,children:[!E&&(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(C,"&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)(mu,{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)]})]})]})},ip=(e,t)=>e.filter((e=>t.includes(e.id))),op=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,E]=(0,r.useState)([]),[_,C]=(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")})})),E([]),x(t)}),[h,l,k,E]),M=(0,r.useCallback)((()=>{h.resetLibrary(),x([]),u()}),[h,u]),O=(0,r.useCallback)((async e=>{if(dc("element","addToLibrary","ui"),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:zr(),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)(fl,{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)(rl,{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=>{C(!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)}),[C,j,f,k,h]),[P,D]=(0,r.useState)(null);return"preloading"===y?null:(0,v.jsxs)(pl,{padding:1,ref:m,className:"layer-ui__library",children:[_&&(0,v.jsx)(Jh,{onClose:()=>C(!1),libraryItems:ip(f,k),appState:g,onSuccess:A,onError:e=>window.alert(e),updateItemsInStorage:()=>h.saveLibrary(f),onRemove:e=>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)(rp,{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 E([...k,e]);const r=un(k),i=f.reduce(((e,i,o)=>((o>=t&&o<=n||r.has(i.id))&&e.push(i.id),e)),[]);E(i)}else E([...k,e]);D(e)}else D(null),E(k.filter((t=>t!==e)))},onPublish:()=>C(!0),resetLibrary:M})]})};n(3336),n(276);var ap=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 sp=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:E,viewModeEnabled:_,libraryReturnUrl:C,UIOptions:S,focusContainer:j,library:I,id:T,onImageAction:M}=e;const O=bp(),L=()=>S.canvasActions&&S.canvasActions.export?(0,v.jsx)(Vh,{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=>{dc("export",e,"ui");const n=await hu(e,t,i,a,{exportBackground:i.exportBackground,name:i.name,viewBackgroundColor:i.viewBackgroundColor}).catch(an).catch((e=>{console.error(e),s({errorMessage:e.message})}));i.exportEmbedScene&&n&&yd(n)&&s({fileHandle:n})};return(0,v.jsx)(xh,{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)(op,{pendingElements:Rl(c,i,!0),onClose:P,onInsertShape:p,onAddToLibrary:D,setAppState:s,libraryReturnUrl:C,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)(ph,{message:i.errorMessage,onClose:()=>s({errorMessage:null})}),i.showHelpDialog&&(0,v.jsx)(Uh,{onClose:()=>{s({showHelpDialog:!1})}}),i.pasteDialog.shown&&(0,v.jsx)(Ph,{setAppState:s,appState:i,onInsertChart:p,onClose:()=>s({pasteDialog:{shown:!1,data:null}})})]});return O.isMobile?(0,v.jsxs)(v.Fragment,{children:[R,(0,v.jsx)(Lh,{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:E,viewModeEnabled:_,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&&!_e(i.editingElement)}),children:[R,(()=>{const e=Sl(i,c);return(0,v.jsx)(yh,{side:"top",children:(0,v.jsxs)("div",{className:"App-menu App-menu_top",children:[(0,v.jsxs)(mu,{gap:4,className:ye({"disable-pointerEvents":g}),children:[S.canvasActions&&(_?(0,v.jsx)(Ch,{heading:"canvasActions",className:ye("zen-mode-transition",{"transition-left":g}),children:(0,v.jsx)(pl,{padding:2,style:{zIndex:1},children:(0,v.jsx)(mu,{gap:4,children:(0,v.jsxs)(gu,{gap:1,justifyContent:"space-between",children:[L(),A()]})})})}):(0,v.jsx)(Ch,{heading:"canvasActions",className:ye("zen-mode-transition",{"transition-left":g}),children:(0,v.jsx)(pl,{padding:2,style:{zIndex:1},children:(0,v.jsxs)(mu,{gap:4,children:[(0,v.jsxs)(gu,{gap:3,justifyContent:"space-between",children:[n.renderAction("clearCanvas"),n.renderAction("loadScene"),L(),A(),d&&(0,v.jsx)(hh,{isCollaborating:w,collaboratorCount:i.collaborators.size,onClick:d})]}),(0,v.jsx)(uh,{actionManager:n,appState:i,setAppState:s,showThemeBtn:f}),i.fileHandle&&(0,v.jsx)(v.Fragment,{children:n.renderAction("saveToActiveFile")})]})})})),e&&(0,v.jsx)(Ch,{heading:"selectedShapeActions",className:ye("zen-mode-transition",{"transition-left":g}),children:(0,v.jsx)(pl,{className:o.$C.SHAPE_ACTIONS_MENU,padding:2,style:{maxHeight:"".concat(i.height-(i.fileHandle?248:200),"px")},children:(0,v.jsx)(lh,{appState:i,elements:c,renderAction:n.renderAction,activeTool:i.activeTool.type})})})]}),!_&&(0,v.jsx)(Ch,{heading:"shapes",children:e=>(0,v.jsxs)(mu,{gap:4,align:"start",children:[(0,v.jsxs)(gu,{gap:1,className:ye("App-toolbar-container",{"zen-mode":g}),children:[(0,v.jsx)(Oh,{zenModeEnabled:g,checked:i.penMode,onChange:h,title:b("toolBar.penMode"),penDetected:i.penDetected}),(0,v.jsx)(Eh,{zenModeEnabled:g,checked:i.activeTool.locked,onChange:()=>u(),title:b("toolBar.lock")}),(0,v.jsxs)(pl,{padding:1,className:ye("App-toolbar",{"zen-mode":g}),children:[(0,v.jsx)(wh,{appState:i,elements:c,isMobile:O.isMobile}),e,(0,v.jsx)(gu,{gap:1,children:(0,v.jsx)(ch,{appState:i,canvas:l,activeTool:i.activeTool,setAppState:s,onImageAction:e=>{let{pointerType:t}=e;M({insertOnCanvasDirectly:"mouse"!==t})}})})]}),(0,v.jsx)(Ih,{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.isMobile,i,l)}),(0,v.jsx)(Sh,{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)(mu,{gap:2,children:(0,v.jsxs)(Ch,{heading:"canvasActions",children:[(0,v.jsx)(pl,{padding:1,children:(0,v.jsx)(dh,{renderAction:n.renderAction,zoom:i.zoom})}),!_&&(0,v.jsxs)(v.Fragment,{children:[(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"})})]}),!_&&i.multiElement&&O.isTouchScreen&&(0,v.jsx)("div",{className:ye("finalize-button zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":g}),children:n.renderAction("finalize",{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==E?void 0:E(!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({},sl(c,i)))},children:b("buttons.scrollBackToContent")})]})},lp=(e,t)=>{const n=e=>{const{suggestedBindings:t,startBoundElement:n}=e;return ap(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]))},cp=i().memo(sp,lp);n(1528);const dp=e=>{var t;const n=bp(),r=et(e.elements),i=Hl(e.elements,e.appState),o=et(i);return n.isMobile&&e.appState.openMenu?null:(0,v.jsx)("div",{className:"Stats",children:(0,v.jsxs)(pl,{padding:2,children:[(0,v.jsx)("div",{className:"close",onClick:e.onClose,children:Qa}),(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 up=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})})},hp=Xs({name:"viewMode",trackEvent:{category:"canvas",predicate:e=>!e.viewModeEnabled},perform(e,t){return{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 pp=n(200),gp=n.n(pp);const mp={isMobile:!1,isTouchScreen:!1},fp=i().createContext(mp),bp=()=>(0,r.useContext)(fp),vp=i().createContext({container:null,id:null}),xp=()=>(0,r.useContext)(vp);let yp=!1,wp=0,kp=0,Ep=0,_p=!1,Cp=!1,Sp=!1,jp={horizontal:null,vertical:null},Ip=0,Tp=!1,Mp=null;const Op={pointers:new Map,lastCenter:null,initialDistance:null,initialScale:null};class Lp extends i().Component{constructor(e){super(e),Ap.call(this);const t=fn(),{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 Un,this.library=new qu(this),this.history=new th,this.actionManager=new Zu(this.syncActionResult,(()=>this.state),(()=>this.scene.getElementsIncludingDeleted()),this),this.actionManager.registerAll(Ys),this.actionManager.registerAction((d=this.history,{name:"undo",trackEvent:{category:"history"},perform:(e,t)=>Yu(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)(rl,{type:"button",icon:za,"aria-label":b("buttons.undo"),onClick:t,size:(null==n?void 0:n.size)||"medium"})},commitToHistory:()=>!1})),this.actionManager.registerAction((e=>({name:"redo",trackEvent:{category:"history"},perform:(t,n)=>Yu(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)(rl,{type:"button",icon:Ra,"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=Rl(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.deviceType.isMobile}),ref:this.excalidrawContainerRef,onDrop:this.handleAppOnDrop,tabIndex:0,onKeyDown:this.props.handleKeyboardGlobally?void 0:this.onKeyDown,children:(0,v.jsx)(vp.Provider,{value:this.excalidrawContainerValue,children:(0,v.jsxs)(fp.Provider,{value:this.deviceType,children:[(0,v.jsx)(cp,{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)(pc,{element:i[0],appState:this.state,setAppState:this.setAppState,onLinkOpen:this.props.onLinkOpen},i[0].id),this.state.showStats&&(0,v.jsx)(dp,{appState:this.state,setAppState:this.setAppState,elements:this.scene.getElements(),onClose:this.toggleStats,renderCustomStats:l}),null!==this.state.toastMessage&&(0,v.jsx)(up,{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.deviceType=gn(this.deviceType,{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.deviceType=gn(this.deviceType,{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(),fr=new WeakMap,br=new WeakMap,Ir=new WeakMap,this.scene=new Un,this.history=new th,this.actionManager=new Zu(this.syncActionResult,(()=>this.state),(()=>this.scene.getElementsIncludingDeleted()),this),this.library=new qu(this),this.canvas=null,this.rc=null,this.excalidrawContainerRef.current=void 0,this.nearestScrollableContainer=void 0,this.excalidrawContainerValue={container:null,id:"unmounted"},clearTimeout(Ip),Ip=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&&kn(this.state)&&this.setState({activeTool:Object.assign(Object.assign({},this.state.activeTool),{type:"selection"})}),t.theme!==this.state.theme&&Zt(this.canvas,this.state.theme),"selection"===t.activeTool.type&&"selection"!==this.state.activeTool.type&&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(ic)}));const{multiElement:r}=t;t.activeTool!==this.state.activeTool&&null!=r&&Co(this.state)&&Te(r)&&Mo(r,this.state,this.scene,on(Eo.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]=en({sceneX:e.pointer.x,sceneY:e.pointer.y},this.state),i[t]=e.button)}));const d=this.scene.getElements().filter((e=>(!Ee(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}=jc(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.deviceType.isMobile});h&&(jp=h);const p=!_e(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(){yp=!1}addTextFromPaste(e){const{x:t,y:n}=Jt({clientX:kp,clientY:Ep},this.state),r=ni({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()}setActiveTool(e){var t;_p||qt(this.canvas,this.state),(t=document.activeElement)instanceof HTMLElement&&t.className.includes("ToolIcon")&&this.focusContainer(),Ie(e.type)||this.setState({suggestedBindings:[]}),"image"===e.type&&this.onImageAction(),"selection"!==e.type?this.setState({activeTool:e,selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}):this.setState({activeTool: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&&_e(i)?ri(i,{text:t,isDeleted:r,originalText:n}):i))])};Cl({id:e.id,canvas:this.canvas,getViewportCoords:(e,t)=>{const{x:n,y:r}=en({sceneX:e,sceneY:t},this.state);return[n-this.state.offsetLeft,r-this.state.offsetTop]},onChange:ln((t=>{r(t,t,!1),Ml(e)&&Ho(e)})),onSubmit:ln((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&&qo(this.scene.getElements(),[e]),s&&!n||this.history.resumeRecording(),this.setState({draggingElement:null,editingElement:null}),this.state.activeTool.locked&&qt(this.canvas,this.state),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&&_e(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 Hi(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=>!(_e(e)&&e.containerId))),(n=>((e,t,n,r)=>{const i=10/t.zoom.value,o=[n,r];return Bi(t,e)?Fi(e,o,i):Ni(e,t,o)})(n,this.state,e,t)))}maybeCleanupAfterMissingPointerUp(e){null!==Mp&&Mp(e)}updateGestureOnPointerDown(e){Op.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),2===Op.pointers.size&&(Op.lastCenter=$u(Op.pointers),Op.initialScale=this.state.zoom.value,Op.initialDistance=Qu(Array.from(Op.pointers.values())))}initialPointerDownState(e){const t=Jt(e,this.state),n=Rl(this.scene.getElements(),this.state),[r,i,o,a]=et(n);return{origin:t,withCmdOrCtrl:e[Lt.CTRL_OR_CMD],originInGrid:on(Ke(t.x,t.y,this.state.gridSize)),scrollbars:Pl(jp,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,oi(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;Sp=!0,t.lastCoords.x=e.clientX,t.lastCoords.y=e.clientY;const n=cn((e=>{e.target instanceof HTMLElement&&this.handlePointerMoveOverScrollbars(e,t)})),r=ln((()=>{Sp=!1,qt(this.canvas,this.state),Mp=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 Mp=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 ln((t=>{this.maybeHandleResize(e,t)||this.maybeDragNewGenericElement(e,t)}))}onKeyUpFromPointerDownHandler(e){return ln((t=>{t.key===Lt.ALT&&t.preventDefault(),this.maybeHandleResize(e,t)||this.maybeDragNewGenericElement(e,t)}))}onPointerMoveFromPointerDownHandler(e){return cn((t=>{var n,r;null===e.drag.offset&&(e.drag.offset=on(((e,t,n)=>{const[r,i]=et(e);return[t-r,n-i]})(Rl(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=Jt(t,this.state);if(kn(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.activeTool.type||"line"===this.state.activeTool.type)&&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(Eo.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=Rl(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(sa(i,o,a,e,n,d),!n.groupIds.length||s.editingGroupId&&!Kr(s,n)){const t=ir(n);t&&sa(i,o,a,e,t,d)}Ho(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=Rl(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=ai(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);Rr(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];Kn(t,n,a),Xo(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];Rr(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}=Fr(this.state.activeTool.type,r,o)),1===n.length?Rr(l,{points:[...n,[r,o]]}):n.length>1&&Rr(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.activeTool.type){e.boxSelection.hasOccurred=!0;const n=this.scene.getElements();if(t.shiftKey||this.state.editingLinearElement||!Dl(n,this.state)||(e.withCmdOrCtrl&&e.hit.element?this.setState((t=>Yr(Object.assign(Object.assign({},t),{selectedElementIds:{[e.hit.element.id]:!0}}),this.scene.getElements()))):this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})),this.state.editingLinearElement)Eo.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=>Yr(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 ln((t=>{const{draggingElement:n,resizingElement:r,multiElement:i,activeTool:a,isResizing:s,isRotating:l}=this.state;var c,d;if(this.setState({isResizing:!1,isRotating:!1,resizingElement:null,selectionElement:null,cursorButton:"up",editingElement:i||_e(this.state.editingElement)?this.state.editingElement:null}),this.savePointer(t.clientX,t.clientY,"up"),this.state.editingLinearElement)if(e.boxSelection.hasOccurred||(null===(c=e.hit)||void 0===c||null===(d=c.element)||void 0===d?void 0:d.id)===this.state.editingLinearElement.elementId&&e.hit.hasHitElementInside){const e=Eo.handlePointerUp(t,this.state.editingLinearElement,this.state);e!==this.state.editingLinearElement&&this.setState({editingLinearElement:e,suggestedBindings:[]})}else this.actionManager.executeAction(ic);if(Mp=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=Jt(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 Rr(n,{points:[...r,[i,o]],pressures:a,lastCommittedPoint:[i,o]}),void this.actionManager.executeAction(ic)}if(Ee(n)){const e=n;try{this.initializeImageDimensions(e),this.setState({selectedElementIds:{[e.id]:!0}},(()=>{this.actionManager.executeAction(ic)}))}catch(t){console.error(t),this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().filter((t=>t.id!==e.id))),this.actionManager.executeAction(ic)}return}if(je(n)){n.points.length>1&&this.history.resumeRecording();const r=Jt(t,this.state);return void(e.drag.hasOccurred||!n||i?e.drag.hasOccurred&&!i&&(Co(this.state)&&Te(n)&&Mo(n,this.state,this.scene,r),this.setState({suggestedBindings:[],startBoundElement:null}),a.locked?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,activeTool:Object.assign(Object.assign({},e.activeTool),{type:"selection"}),selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[this.state.draggingElement.id]:!0})}))))):(Rr(n,{points:[...n.points,[r.x-n.x,r.y-n.y]]}),this.setState({multiElement:n,editingElement:this.state.draggingElement})))}if("selection"!==a.type&&n&&Br(n))return this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().slice(0,-1)),void this.setState({draggingElement:null});n&&Rr(n,Ur(n)),r&&this.history.resumeRecording(),r&&Br(r)&&this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().filter((e=>e.id!==r.id)));const u=e.hit.element;if(kn(this.state)){if(0===He(this.lastPointerDown.clientX,this.lastPointerDown.clientY,this.lastPointerUp.clientX,this.lastPointerUp.clientY)){const t=Jt({clientX:this.lastPointerUp.clientX,clientY:this.lastPointerUp.clientY},this.state);this.getElementsAtPosition(t.x,t.y).forEach((t=>e.elementIdsToErase[t.id]={erase:!0,opacity:t.opacity}))}this.eraseElements(e)}else{if(Object.keys(e.elementIdsToErase).length&&this.restoreReadyToEraseElements(e),u&&!e.drag.hasOccurred&&!e.hit.wasAddedToSelection&&(!this.state.editingLinearElement||!e.boxSelection.hasOccurred))if(t.shiftKey&&!this.state.editingLinearElement)if(this.state.selectedElementIds[u.id])if(Kr(this.state,u)){const e=u.groupIds.flatMap((e=>Zr(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),u.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=>Yr(Object.assign(Object.assign({},e),{selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[u.id]:!1})}),this.scene.getElements())));else this.setState((e=>({selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[u.id]:!0})})));else this.setState((e=>Object.assign({},Yr(Object.assign(Object.assign({},e),{selectedElementIds:{[u.id]:!0}}),this.scene.getElements()))));this.state.editingLinearElement||e.drag.hasOccurred||this.state.isResizing||!(u&&Hi(u,this.state,e.origin.x,e.origin.y)||!u&&e.hit.hasHitCommonBoundingBoxOfSelectedElements)?(!a.locked&&"freedraw"!==a.type&&n&&this.setState((e=>({selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[n.id]:!0})}))),("selection"!==a.type||Dl(this.scene.getElements(),this.state))&&this.history.resumeRecording(),(e.drag.hasOccurred||s||l)&&(Co(this.state)?Io:Po)(Rl(this.scene.getElements(),this.state)),a.locked||"freedraw"===a.type?this.setState({draggingElement:null,suggestedBindings:[]}):(Vt(this.canvas),this.setState({draggingElement:null,suggestedBindings:[],activeTool:Object.assign(Object.assign({},a),{type:"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)?Wo(e).filter((e=>!t.has(e.id))):Oe(e)?Go(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&&Xr(e,t.editingGroupId)?t.editingGroupId:null}))),this.setState({selectedElementIds:{},previousSelectedElementIds:this.state.selectedElementIds})}getTextWysiwygSnappedToCenterPosition(e,t,n,r,i){const a=Gs(this.scene.getElementsIncludingDeleted().filter((e=>!_e(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}=en({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({})}}Lp.defaultProps={UIOptions:o.cW};var Ap=function(){var e=this;this.canvas=null,this.rc=null,this.unmounted=!1,this.deviceType={isMobile:!1,isTouchScreen:!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=ln((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&&Ml(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=ln((()=>{_p=!1,this.setState({isBindingEnabled:!0})})),this.onUnload=()=>{this.onBlur()},this.disableEvent=e=>{e.preventDefault()},this.onFontLoaded=()=>{this.scene.getElementsIncludingDeleted().forEach((e=>{_e(e)&&yr(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=ln((e=>{this.scene.replaceAllElements([]),this.setState((t=>Object.assign(Object.assign({},fn()),{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,kd(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=bd(r.libraryItems,"unpublished"))}catch(e){console.error(e),r={appState:{errorMessage:e.message||"Encountered an error during importing or restoring scene data"}}}const a=md(r,null,null);a.appState=Object.assign(Object.assign({},a.appState),{activeTool:"image"===a.appState.activeTool.type?Object.assign(Object.assign({},a.appState.activeTool),{type:"selection"}):a.appState.activeTool,isLoading:!1}),null!==(e=r)&&void 0!==e&&e.scrollToContent&&(a.appState=Object.assign(Object.assign({},a.appState),sl(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=ln((()=>{this.scene.getElementsIncludingDeleted().forEach((e=>yr(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=ln((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=ln((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.actionManager.executeAction(Nu,"keyboard")},this.copyAll=()=>{this.actionManager.executeAction(Hu,"keyboard")},this.onTapStart=e=>{if(dt||e.preventDefault(),!yp)return yp=!0,clearTimeout(wp),void(wp=window.setTimeout(Lp.resetTapTwice,o.Gj));if(yp&&1===e.touches.length){const[t]=e.touches;this.handleCanvasDoubleClick({clientX:t.clientX,clientY:t.clientY}),yp=!1,clearTimeout(wp)}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}):Op.pointers.clear()},this.pasteFromClipboard=ln((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(kp,Ep);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 cu(e);if(!o&&a.text){const e=a.text.trim();e.startsWith("<svg")&&e.endsWith("</svg>")&&(o=Id(e))}if(wd(o)&&!a.spreadsheet){const{x:e,y:t}=Jt({clientX:kp,clientY:Ep},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.setActiveTool(Object.assign(Object.assign({},this.state.activeTool),{type:"selection"})),null==e||e.preventDefault()})),this.addElementsFromPasteOrLibrary=e=>{const t=pd(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?kp:this.state.width/2+this.state.offsetLeft,c="object"==typeof e.position?e.position.clientY:"cursor"===e.position?Ep:this.state.height/2+this.state.offsetTop,{x:d,y:u}=Jt({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=ai(this.state.editingGroupId,g,e,{x:e.x+m-n,y:e.y+f-r});return b.set(e.id,t.id),t}));Kn(v,t,b);const x=[...this.scene.getElementsIncludingDeleted(),...v];Xo(x,t,b),e.files&&(this.files=Object.assign(Object.assign({},this.files),e.files)),this.scene.replaceAllElements(x),this.history.resumeRecording(),this.setState(Yr(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.setActiveTool(Object.assign(Object.assign({},this.state.activeTool),{type:"selection"}))},this.setAppState=e=>{this.setState(e)},this.removePointer=e=>{Ip&&this.resetContextMenuTimer(),Op.pointers.delete(e.pointerId)},this.toggleLock=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"ui";e.state.activeTool.locked||dc("toolbar","toggleLock","".concat(t," (").concat(e.deviceType.isMobile?"mobile":"desktop",")")),e.setState((e=>({activeTool:Object.assign(Object.assign({},e.activeTool),{locked:!e.activeTool.locked,type:e.activeTool.locked?"selection":e.activeTool.type})})))},this.togglePenMode=()=>{this.setState((e=>({penMode:!e.penMode})))},this.toggleZenMode=()=>{this.actionManager.executeAction(Wu)},this.toggleStats=()=>{this.actionManager.executeAction(Ku)},this.scrollToContent=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.scene.getElements();e.setState(Object.assign({},sl(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=ln((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),yr(e))})),this.scene.informMutation(),this.addNewImagesToImageCache()})),this.updateScene=ln((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(bd(e.libraryItems,"unpublished")),this.state.isLibraryOpen&&this.setState({isLibraryOpen:!1},(()=>{this.setState({isLibraryOpen:!0})})))})),this.onSceneUpdated=()=>{this.setState({})},this.updateCurrentCursorPosition=ln((e=>{kp=e.clientX,Ep=e.clientY})),this.onKeyDown=ln((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=Rl(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=>{Rr(e,{x:e.x+r,y:e.y+i}),Ho(e,{simultaneouslyUpdated:n})})),this.maybeSuggestBindingForAll(n),e.preventDefault()}else if(e.key===Lt.ENTER){const t=Rl(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 Eo(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=nh.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.state.activeTool.type!==t&&dc("toolbar",t,"keyboard (".concat(this.deviceType.isMobile?"mobile":"desktop",")")),this.setActiveTool(Object.assign(Object.assign({},this.state.activeTool),{type:t}))):e.key===Lt.Q&&this.toggleLock("keyboard")}if(e.key===Lt.SPACE&&0===Op.pointers.size&&(_p=!0,Gt(this.canvas,o.oc.GRABBING),e.preventDefault()),e.key===Lt.G||e.key===Lt.S){const t=Rl(this.scene.getElements(),this.state);if("selection"===this.state.activeTool.type&&!t.length)return;e.key===Lt.G&&(Hs(this.state.activeTool.type)||t.some((e=>Hs(e.type))))&&this.setState({openPopup:"backgroundColorPicker"}),e.key===Lt.S&&this.setState({openPopup:"strokeColorPicker"})}}})),this.onKeyUp=ln((e=>{if(e.key===Lt.SPACE&&(this.state.viewModeEnabled?Gt(this.canvas,o.oc.GRAB):"selection"===this.state.activeTool.type?Vt(this.canvas):(qt(this.canvas,this.state),this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})),_p=!1),e[Lt.CTRL_OR_CMD]||this.state.isBindingEnabled||this.setState({isBindingEnabled:!0}),At(e.key)){const e=Rl(this.scene.getElements(),this.state);Co(this.state)?Io(e):Po(e),this.setState({suggestedBindings:[]})}})),this.onGestureStart=ln((e=>{e.preventDefault(),this.setState({selectedElementIds:{}}),Op.initialScale=this.state.zoom.value})),this.onGestureChange=ln((e=>{if(e.preventDefault(),Op.pointers.size>=2)return;const t=Op.initialScale;t&&this.setState((n=>Object.assign({},cl({viewportX:kp,viewportY:Ep,nextZoom:ll(t*e.scale)},n))))})),this.onGestureEnd=ln((e=>{e.preventDefault(),this.setState({previousSelectedElementIds:{},selectedElementIds:this.state.previousSelectedElementIds}),Op.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=Rl(this.scene.getElements(),this.state);if(1===g.length&&(_e(g[0])?h=g[0]:Le(g[0])&&(p=g[0],h=ir(p))),h=null!==(t=h)&&void 0!==t?t:this.getTextElementAtPosition(s,l),p||h||!c&&!u||(p=Gs(this.scene.getElements().filter((e=>Le(e)&&!ir(e))),s,l)),!h&&p){const e={fontSize:this.state.currentItemFontSize,fontFamily:this.state.currentItemFontFamily},t=er(Ut(e)),n=tr(Ut(e)),r=Math.max(p.height,n),i=Math.max(p.width,t);Rr(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||ni({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||Rr(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.activeTool.type)return;const t=Rl(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 Eo(t[0],this.scene)})));Vt(this.canvas);let{x:n,y:r}=Jt(e,this.state);if(Gr(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=>Yr(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=Rl(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&&i<=r&&yc(n,this.state,[e.x,e.y],this.deviceType.isMobile))))},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=Jt(this.lastPointerDown,this.state),i=yc(this.hitLinkElement,this.state,[r.x,r.y],this.deviceType.isMobile),a=Jt(this.lastPointerUp,this.state),s=yc(this.hitLinkElement,this.state,[a.x,a.y],this.deviceType.isMobile);if(i&&s){const t=this.hitLinkElement.link;if(t){var l;let n;if(this.props.onLinkOpen&&(n=pn(o.Ks.EXCALIDRAW_LINK,e.nativeEvent),this.props.onLinkOpen(this.hitLinkElement,n)),null===(l=n)||void 0===l||!l.defaultPrevented){const e=fc(t)?"_self":"_blank",n=window.open(void 0,e);n&&(n.opener=null,n.location=mc(t))}}}},this.handleCanvasPointerMove=e=>{this.savePointer(e.clientX,e.clientY,this.state.cursorButton),Op.pointers.has(e.pointerId)&&Op.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY});const t=Op.initialScale;if(2===Op.pointers.size&&Op.lastCenter&&t&&Op.initialDistance){const e=$u(Op.pointers),n=e.x-Op.lastCenter.x,r=e.y-Op.lastCenter.y;Op.lastCenter=e;const i=Qu(Array.from(Op.pointers.values())),o="freedraw"===this.state.activeTool.type&&this.state.penMode?1:i/Op.initialDistance,a=o?ll(t*o):this.state.zoom.value;this.setState((t=>{const i=cl({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 Op.lastCenter=Op.initialDistance=Op.initialScale=null;if(_p||Cp||Sp)return;const n=Pl(jp,e.clientX-this.state.offsetLeft,e.clientY-this.state.offsetTop).isOverEither;this.state.draggingElement||this.state.multiElement||(n?Vt(this.canvas):qt(this.canvas,this.state));const r=Jt(e,this.state),{x:i,y:a}=r;if(this.state.editingLinearElement&&!this.state.editingLinearElement.isDragging){const t=Eo.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.activeTool.type)){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 qt(this.canvas,this.state),void(l===s?He(i-t,a-n,l[0],l[1])>=o.qx?Rr(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),Rr(e,{points:r.slice(0,-1)})):(Ne(r,this.state.zoom.value)&&Gt(this.canvas,o.oc.POINTER),Rr(e,{points:[...r.slice(0,-1),[i-t,a-n]]})))}if(Boolean(e.buttons)||"selection"!==this.state.activeTool.type&&"text"!==this.state.activeTool.type&&"eraser"!==this.state.activeTool.type)return;const s=this.scene.getElements(),l=Rl(s,this.state);if(1!==l.length||n||this.state.editingLinearElement){if(l.length>1&&!n){const t=yo(et(l),i,a,this.state.zoom,e.pointerType);if(t)return void Gt(this.canvas,ko({transformHandleType:t}))}}else{const t=xo(s,this.state,i,a,this.state.zoom,e.pointerType);if(t&&t.transformHandleType)return void Gt(this.canvas,ko(t))}const c=this.getElementAtPosition(r.x,r.y);var d,u;if(this.hitLinkElement=this.getElementLinkAtPosition(r,c),!kn(this.state))if(this.hitLinkElement&&!this.state.selectedElementIds[this.hitLinkElement.id])Gt(this.canvas,o.oc.POINTER),d=this.hitLinkElement,u=this.state,wc&&clearTimeout(wc),wc=window.setTimeout((()=>kc(d,u)),o.sA);else if(wc&&clearTimeout(wc),hc&&(hc=!1,dl().classList.remove("excalidraw-tooltip--visible")),c&&c.link&&this.state.selectedElementIds[c.id]&&!this.contextMenuOpen&&!this.state.showHyperlinkPopup)this.setState({showHyperlinkPopup:"info"});else if("text"===this.state.activeTool.type)Gt(this.canvas,_e(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=Eo.getElement(this.state.editingLinearElement.elementId);e&&Ni(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)},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].erase&&(t.elementIdsToErase[n.id].erase=!1):t.elementIdsToErase[n.id]||(t.elementIdsToErase[n.id]={erase:!0,opacity:n.opacity})}))},i=[],a=He(t.lastCoords.x,t.lastCoords.y,n.x,n.y),s=10/this.state.zoom.value,l=Object.assign({},t.lastCoords);let c=0;for(;c<=a;){if(r(this.getElementsAtPosition(l.x,l.y)),c===a)break;c=Math.min(c+s,a);const e=c/a,t=(1-e)*l.x+e*n.x,i=(1-e)*l.y+e*n.y;l.x=t,l.y=i}const d=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 Hr(n,{opacity:o.xY});if(t.elementIdsToErase[r]&&!1===t.elementIdsToErase[r].erase)return Hr(n,{opacity:t.elementIdsToErase[r].opacity})}return n}));this.scene.replaceAllElements(d),t.lastCoords.x=n.x,t.lastCoords.y=n.y},this.handleTouchMove=e=>{Tp=!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}))),!this.deviceType.isTouchScreen&&["pen","touch"].includes(e.pointerType)&&(this.deviceType=gn(this.deviceType,{isTouchScreen:!0})),Cp)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),Op.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.activeTool.type||"text"===this.state.activeTool.type||"image"===this.state.activeTool.type))return;if("text"===this.state.activeTool.type)return void this.handleTextOnPointerDown(e,n);if("arrow"===this.state.activeTool.type||"line"===this.state.activeTool.type)this.handleLinearElementOnPointerDown(e,this.state.activeTool.type,n);else if("image"===this.state.activeTool.type){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}=Jt(e,this.state);Rr(this.state.pendingImageElement,{x:t,y:n})}else"freedraw"===this.state.activeTool.type?this.handleFreeDrawElementOnPointerDown(e,this.state.activeTool.type,n):"eraser"!==this.state.activeTool.type&&this.createGenericElementOnPointerDown(this.state.activeTool.type,n);const r=this.onPointerMoveFromPointerDownHandler(n),i=this.onPointerUpFromPointerDownHandler(n),a=this.onKeyDownFromPointerDownHandler(n),s=this.onKeyUpFromPointerDownHandler(n);Mp=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=>{if(this.lastPointerUp=e,this.deviceType.isTouchScreen){const t=Jt({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,this.deviceType.isTouchScreen),this.removePointer(e)},this.maybeOpenContextMenuAfterPointerDownOnTouchDevices=e=>{"touch"===e.pointerType&&(Tp=!1,Ip?Tp=!0:Ip=window.setTimeout((()=>{Ip=0,Tp||this.handleCanvasContextMenu(e)}),o.nM))},this.resetContextMenuTimer=()=>{clearTimeout(Ip),Ip=0,Tp=!1},this.handleCanvasPanUsingWheelOrSpaceDrag=e=>{if(0!==Op.pointers.size||!(e.button===o.Oh.WHEEL||e.button===o.Oh.MAIN&&_p||this.state.viewModeEnabled)||_e(this.state.editingElement))return!1;Cp=!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=cn((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=ln(Mp=()=>{Mp=null,Cp=!1,_p||(this.state.viewModeEnabled?Gt(this.canvas,o.oc.GRAB):qt(this.canvas,this.state)),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.activeTool.type&&this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})},this.handleSelectionOnPointerDown=(e,t)=>{if("selection"===this.state.activeTool.type){const r=this.scene.getElements(),i=Rl(r,this.state);if(1!==i.length||this.state.editingLinearElement)i.length>1&&(t.resize.handleType=yo(et(i),t.origin.x,t.origin.y,this.state.zoom,e.pointerType));else{const n=xo(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,ko({transformHandleType:t.resize.handleType})),t.resize.isResizing=!0,t.resize.offset=on(((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=Eo.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(yc(t.hit.element,this.state,[t.origin.x,t.origin.y],this.deviceType.isMobile))return!1;t.hit.hasHitElementInside=Ni(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&&!Xr(r,this.state.editingGroupId)&&this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}),i||t.hit.hasHitCommonBoundingBoxOfSelectedElements||(this.setState((e=>Yr(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(_e(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.activeTool.locked||this.setState({activeTool:Object.assign(Object.assign({},this.state.activeTool),{type:"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({},Jr(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];Rr(o,{points:[[0,0]],pressures:s});const l=zo(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({},Jr("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 Rr(e,{lastCommittedPoint:e.points[e.points.length-1]}),void this.actionManager.executeAction(ic);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(ic);this.setState((t=>({selectedElementIds:Object.assign(Object.assign({},t.selectedElementIds),{[e.id]:!0})}))),Rr(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=ii({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})}))),Rr(l,{points:[...l.points,[0,0]]});const c=zo(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=ei({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.restoreReadyToEraseElements=e=>{const t=this.scene.getElements().map((t=>e.elementIdsToErase[t.id]&&e.elementIdsToErase[t.id].erase?Hr(t,{opacity:e.elementIdsToErase[t.id].opacity}):Pe(t)&&e.elementIdsToErase[t.containerId]&&e.elementIdsToErase[t.containerId].erase?Hr(t,{opacity:e.elementIdsToErase[t.containerId].opacity}):t));this.scene.replaceAllElements(t)},this.eraseElements=e=>{const t=this.scene.getElements().map((t=>e.elementIdsToErase[t.id]&&e.elementIdsToErase[t.id].erase||Pe(t)&&e.elementIdsToErase[t.containerId]&&e.elementIdsToErase[t.containerId].erase?Hr(t,{isDeleted:!0}):t));this.history.resumeRecording(),this.scene.replaceAllElements(t)},this.initializeImage=async e=>{var t,n,r;let{imageFile:i,imageElement:a,showCursorImagePreview:s=!1}=e;if(!wd(i))throw new Error(b("errors.unsupportedFileType"));const l=i.type;if(Gt(this.canvas,"wait"),l===o.LO.svg)try{i=Id(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))||Cd(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 jd(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 Sd(i),p=Rr(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){Rr(e,{isDeleted:!0}),this.actionManager.executeAction(ic),this.setState({errorMessage:t.message||b("errors.imageInsertError")})}},this.setImagePreviewCursor=async e=>{const t=await jd(e,{maxWidthOrHeight:96});let n=await Sd(t);if(e.type===o.LO.svg){const e=await Ad(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}=Jt({clientX:n,clientY:r},e.state),a=await ld({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(ic)}))):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,activeTool:Object.assign(Object.assign({},e.state.activeTool),{type:"selection"})},(()=>{e.actionManager.executeAction(ic)}))}},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;Rr(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;Rr(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 Pd({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)&&yr(e);return i.size&&e.scene.replaceAllElements(e.scene.getElementsIncludingDeleted().map((e=>ke(e)&&i.has(e.fileId)?Hr(e,{status:"error"}):e))),{updatedFiles:r,erroredFiles:i}},this.addNewImagesToImageCache=async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Dd(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=gp()((()=>{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=zo(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=zo(r,this.scene);return null==i||Ao(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(wd(t)){if((null==t?void 0:t.type)===o.LO.png||(null==t?void 0:t.type)===o.LO.svg)try{if(od)try{const n=e.dataTransfer.items[0];t.handle=await n.getAsFileSystemHandle()}catch(e){console.warn(e.name,e.message)}const n=await kd(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}=Jt(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}),od)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=>{kd(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.activeTool.type)return;const{x:t,y:n}=Jt(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&&"eraser"!==this.state.activeTool.type)la(n,this.state.activeTool.type,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;la(n,this.state.activeTool.type,e.originInGrid.x,e.originInGrid.y,o,a,Kt(e.originInGrid.x,o),Kt(e.originInGrid.y,a),Ee(n)?!Dt(t):Dt(t),Pt(t),l),this.maybeSuggestBindingForAll([n])}},this.maybeHandleResize=(e,t)=>{const n=Rl(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?(Jo(c,s,l,i),Ho(c)):!je(c)||2!==c.points.length||"nw"!==t&&"ne"!==t&&"sw"!==t&&"se"!==t?!_e(c)||"nw"!==t&&"ne"!==t&&"sw"!==t&&"se"!==t?t&&ia(e.originalElements,a,c,t,o,s,l):(ra(c,t,o,s,l),Ho(c)):ea(c,r,i,s,l),!0}if(n.length>1){if("rotation"===t)return aa(e,n,s,l,i,c,d),!0;if("nw"===t||"ne"===t||"sw"===t||"se"===t)return oa(n,t,s,l),!0}return!1})(e,r,n,e.resize.arrowDirection,zt(t),Pt(t),1===n.length&&Ee(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=Eu.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),o=_u.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),a=Lu.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),s=Au.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),l=Vu.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),c=Gu.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),d="separator",u=this.scene.getElements(),h=[];if(au&&u.length>0&&h.push(Fu),ou&&u.length>0&&h.push(Bu),"canvas"===t){const e=[...h,void 0===this.props.gridModeEnabled&&Uu,void 0===this.props.zenModeEnabled&&Wu,void 0===this.props.viewModeEnabled&&hp,Ku];this.state.viewModeEnabled?sh.push({options:e,top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current,elements:u}):sh.push({options:[this.deviceType.isMobile&&navigator.clipboard&&{trackEvent:!1,name:"paste",perform:(e,t)=>(this.pasteFromClipboard(null),{commitToHistory:!1}),contextItemLabel:"labels.paste"},this.deviceType.isMobile&&navigator.clipboard&&d,au&&u.length>0&&Fu,ou&&u.length>0&&Bu,(au&&u.length>0||ou&&u.length>0)&&d,tc,d,void 0===this.props.gridModeEnabled&&Uu,void 0===this.props.zenModeEnabled&&Wu,void 0===this.props.viewModeEnabled&&hp,Ku],top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current,elements:u})}else"element"===t&&(this.state.viewModeEnabled?sh.push({options:[navigator.clipboard&&Hu,...h],top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current,elements:u}):sh.push({options:[this.deviceType.isMobile&&Nu,this.deviceType.isMobile&&navigator.clipboard&&Hu,this.deviceType.isMobile&&navigator.clipboard&&{name:"paste",trackEvent:!1,perform:(e,t)=>(this.pasteFromClipboard(null),{commitToHistory:!1}),contextItemLabel:"labels.paste"},this.deviceType.isMobile&&d,...h,d,xu,yu,d,i&&Eu,l&&Vu,c&&Gu,o&&_u,(i||o)&&d,Su,d,$l,Ql,Jl,ec,d,a&&Lu,s&&Au,(a||s)&&d,bc.contextItemPredicate(u,this.state)&&bc,nc,Bl],top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current,elements:u}))},this.handleWheel=ln((e=>{if(e.preventDefault(),Cp)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({},cl({viewportX:kp,viewportY:Ep,nextZoom:ll(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=Jt({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:Op.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 Pp=Lp;n(4285),n(3313);var Dp=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 zp=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:E,onPaste:_,detectScroll:C=!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)(Pp,{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:E,UIOptions:A,onPaste:_,detectScroll:C,handleKeyboardGlobally:S,onLibraryChange:j,autoFocus:I,generateIdForFile:T,onLinkOpen:M})})},Rp=(e,t)=>{const{initialData:n,UIOptions:r={}}=e,i=Dp(e,["initialData","UIOptions"]),{initialData:o,UIOptions:a={}}=t,s=Dp(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]))},Hp=(0,r.forwardRef)(((e,t)=>(0,v.jsx)(zp,Object.assign(Object.assign({},e),{excalidrawRef:t})))),Np=i().memo(Hp,Rp);n(8336);const Bp=Np},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":"Sharing","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","bindText":"Bind text to the container","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","tools":"Tools","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(6439)})()}));
|