@dwelle/excalidraw 0.3.62 → 0.3.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see excalidraw.production.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.ExcalidrawLib=t(require("react"),require("react-dom")):e.ExcalidrawLib=t(e.React,e.ReactDOM)}(self,(function(e,t){return(()=>{var n,r,i,o,a={6233:(e,t)=>{var n;n=function(e){e.version="0.3.0";var t=function(){for(var e=0,t=new Array(256),n=0;256!=n;++n)e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=n)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1,t[n]=e;return"undefined"!=typeof Int32Array?new Int32Array(t):t}(),n="undefined"!=typeof Buffer;function r(e){for(var n=-1,r=0,i=e.length-7;r<i;)n=(n=(n=(n=(n=(n=(n=(n=n>>>8^t[255&(n^e[r++])])>>>8^t[255&(n^e[r++])])>>>8^t[255&(n^e[r++])])>>>8^t[255&(n^e[r++])])>>>8^t[255&(n^e[r++])])>>>8^t[255&(n^e[r++])])>>>8^t[255&(n^e[r++])])>>>8^t[255&(n^e[r++])];for(;r<i+7;)n=n>>>8^t[255&(n^e[r++])];return-1^n}e.table=t,e.bstr=function(e){if(e.length>32768&&n)return r(new Buffer(e));for(var i=-1,o=e.length-1,a=0;a<o;)i=t[255&(i^e.charCodeAt(a++))]^i>>>8,i=t[255&(i^e.charCodeAt(a++))]^i>>>8;return a===o&&(i=i>>>8^t[255&(i^e.charCodeAt(a))]),-1^i},e.buf=function(e){if(e.length>1e4)return r(e);for(var n=-1,i=0,o=e.length-3;i<o;)n=(n=(n=(n=n>>>8^t[255&(n^e[i++])])>>>8^t[255&(n^e[i++])])>>>8^t[255&(n^e[i++])])>>>8^t[255&(n^e[i++])];for(;i<o+3;)n=n>>>8^t[255&(n^e[i++])];return-1^n},e.str=function(e){for(var n,r,i=-1,o=0,a=e.length;o<a;)(n=e.charCodeAt(o++))<128?i=i>>>8^t[255&(i^n)]:n<2048?i=(i=i>>>8^t[255&(i^(192|n>>6&31))])>>>8^t[255&(i^(128|63&n))]:n>=55296&&n<57344?(n=64+(1023&n),r=1023&e.charCodeAt(o++),i=(i=(i=(i=i>>>8^t[255&(i^(240|n>>8&7))])>>>8^t[255&(i^(128|n>>2&63))])>>>8^t[255&(i^(128|r>>6&15|3&n))])>>>8^t[255&(i^(128|63&r))]):i=(i=(i=i>>>8^t[255&(i^(224|n>>12&15))])>>>8^t[255&(i^(128|n>>6&63))])>>>8^t[255&(i^(128|63&n))];return-1^i}},"undefined"==typeof DO_NOT_EXPORT_CRC?n(t):n({})},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,f=function(){return u.Date.now()};function m(e,t,n){var i,o,a,s,l,c,d=0,u=!1,h=!1,m=!0;if("function"!=typeof e)throw new TypeError(r);function y(t){var n=i,r=o;return i=o=void 0,d=t,s=e.apply(r,n)}function x(e){return d=e,l=setTimeout(_,t),u?y(e):s}function w(e){var n=e-c;return void 0===c||n>=t||n<0||h&&e-d>=a}function _(){var e=f();if(w(e))return k(e);l=setTimeout(_,function(e){var n=t-(e-c);return h?g(n,a-(e-d)):n}(e))}function k(e){return l=void 0,m&&i?y(e):(i=o=void 0,s)}function E(){var e=f(),n=w(e);if(i=arguments,o=this,c=e,n){if(void 0===l)return x(c);if(h)return l=setTimeout(_,t),y(c)}return void 0===l&&(l=setTimeout(_,t)),s}return t=v(t)||0,b(n)&&(u=!!n.leading,a=(h="maxWait"in n)?p(v(n.maxWait)||0,t):a,m="trailing"in n?!!n.trailing:m),E.cancel=function(){void 0!==l&&clearTimeout(l),d=0,i=c=o=l=void 0},E.flush=function(){return void 0===l?s:k(f())},E}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),m(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,f=NaN,m=4294967295,b=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",l],["flip",512],["partial",c],["partialRight",d],["rearg",h]],v="[object Arguments]",y="[object Array]",x="[object Boolean]",w="[object Date]",_="[object Error]",k="[object Function]",E="[object GeneratorFunction]",C="[object Map]",S="[object Number]",I="[object Object]",j="[object Promise]",T="[object RegExp]",M="[object Set]",O="[object String]",A="[object Symbol]",L="[object WeakMap]",P="[object ArrayBuffer]",z="[object DataView]",D="[object Float32Array]",R="[object Float64Array]",B="[object Int8Array]",N="[object Int16Array]",H="[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,Z=/&(?:amp|lt|gt|quot|#39);/g,X=/[&<>"']/g,q=RegExp(Z.source),$=RegExp(X.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,fe=/\w*$/,me=/^[-+]0x[0-9a-f]+$/i,be=/^0b[01]+$/i,ve=/^\[object .+?Constructor\]$/,ye=/^0o[0-7]+$/i,xe=/^(?:0|[1-9]\d*)$/,we=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_e=/($^)/,ke=/['\n\r\u2028\u2029\\]/g,Ee="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ce="\\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]",Ae="["+Te+"]",Le="["+Ee+"]",Pe="\\d+",ze="[\\u2700-\\u27bf]",De="["+Se+"]",Re="[^\\ud800-\\udfff"+Te+Pe+Ce+Se+Ie+"]",Be="\\ud83c[\\udffb-\\udfff]",Ne="[^\\ud800-\\udfff]",He="(?:\\ud83c[\\udde6-\\uddff]){2}",Fe="[\\ud800-\\udbff][\\udc00-\\udfff]",Ue="["+Ie+"]",We="(?:"+De+"|"+Re+")",Ke="(?:"+Ue+"|"+Re+")",Ve="(?:['’](?:d|ll|m|re|s|t|ve))?",Ge="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ye="(?:"+Le+"|"+Be+")"+"?",Ze="[\\ufe0e\\ufe0f]?",Xe=Ze+Ye+("(?:\\u200d(?:"+[Ne,He,Fe].join("|")+")"+Ze+Ye+")*"),qe="(?:"+[ze,He,Fe].join("|")+")"+Xe,$e="(?:"+[Ne+Le+"?",Le,He,Fe,Oe].join("|")+")",Qe=RegExp(Me,"g"),Je=RegExp(Le,"g"),et=RegExp(Be+"(?="+Be+")|"+$e+Xe,"g"),tt=RegExp([Ue+"?"+De+"+"+Ve+"(?="+[Ae,Ue,"$"].join("|")+")",Ke+"+"+Ge+"(?="+[Ae,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"+Ee+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[D]=at[R]=at[B]=at[N]=at[H]=at[F]=at[U]=at[W]=at[K]=!0,at[v]=at[y]=at[P]=at[x]=at[z]=at[w]=at[_]=at[k]=at[C]=at[S]=at[I]=at[T]=at[M]=at[O]=at[L]=!1;var st={};st[v]=st[y]=st[P]=st[z]=st[x]=st[w]=st[D]=st[R]=st[B]=st[N]=st[H]=st[C]=st[S]=st[I]=st[T]=st[M]=st[O]=st[A]=st[F]=st[U]=st[W]=st[K]=!0,st[_]=st[k]=st[L]=!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,ft=gt&&e&&!e.nodeType&&e,mt=ft&&ft.exports===gt,bt=mt&&ut.process,vt=function(){try{var e=ft&&ft.require&&ft.require("util").types;return e||bt&&bt.binding&&bt.binding("util")}catch(e){}}(),yt=vt&&vt.isArrayBuffer,xt=vt&&vt.isDate,wt=vt&&vt.isMap,_t=vt&&vt.isRegExp,kt=vt&&vt.isSet,Et=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 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 At(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 Lt(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 zt(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 Dt(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 Bt=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 Ht(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):Ht(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?Zt(e,t)/n:f}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 Zt(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 Xt(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,fn(e)+1).replace(ae,""):e}function $t(e){return function(t){return e(t)}}function Qt(e,t){return Lt(t,(function(t){return e[t]}))}function Jt(e,t){return e.has(t)}function en(e,t){for(var n=-1,r=e.length;++n<r&&Ft(t,e[n],0)>-1;);return n}function tn(e,t){for(var n=e.length;n--&&Ft(t,e[n],0)>-1;);return n}function nn(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var rn=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):Bt(e)}function gn(e){return sn(e)?function(e){return e.match(et)||[]}(e):function(e){return e.split("")}(e)}function fn(e){for(var t=e.length;t--&&se.test(e.charAt(t)););return t}var mn=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,Ee=t.Error,Ce=t.Function,Se=t.Math,Ie=t.Object,je=t.RegExp,Te=t.String,Me=t.TypeError,Oe=r.prototype,Ae=Ce.prototype,Le=Ie.prototype,Pe=t["__core-js_shared__"],ze=Ae.toString,De=Le.hasOwnProperty,Re=0,Be=(n=/[^.]+$/.exec(Pe&&Pe.keys&&Pe.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Ne=Le.toString,He=ze.call(Ie),Fe=pt._,Ue=je("^"+ze.call(De).replace(ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),We=mt?t.Buffer:i,Ke=t.Symbol,Ve=t.Uint8Array,Ge=We?We.allocUnsafe:i,Ye=cn(Ie.getPrototypeOf,Ie),Ze=Ie.create,Xe=Le.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,ft=Se.ceil,bt=Se.floor,vt=Ie.getOwnPropertySymbols,Bt=We?We.isBuffer:i,Gt=t.isFinite,vn=Oe.join,yn=cn(Ie.keys,Ie),xn=Se.max,wn=Se.min,_n=se.now,kn=t.parseInt,En=Se.random,Cn=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"),An=Mn&&new Mn,Ln={},Pn=Fo(Sn),zn=Fo(In),Dn=Fo(jn),Rn=Fo(Tn),Bn=Fo(Mn),Nn=Ke?Ke.prototype:i,Hn=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(De.call(e,"__wrapped__"))return Uo(e)}return new Vn(e)}var Wn=function(){function e(){}return function(t){if(!rs(t))return{};if(Ze)return Ze(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__=m,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 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 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 qn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Xn;++t<n;)this.add(e[t])}function $n(e){var t=this.__data__=new Zn(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?Xt(e.length,Te):[],l=s.length;for(var c in e)!t&&!De.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 Bo(Oi(e),cr(t,0,e.length))}function tr(e){return Bo(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];De.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&&Ai(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]&&De.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==k||h==E;if($a(e))return Ci(e,l);if(h==I||h==v||p&&!o){if(s=c||p?{}:yo(e),!l)return c?function(e,t){return Ai(e,mo(e),t)}(e,function(e,t){return e&&Ai(t,zs(t),e)}(s,e)):function(e,t){return Ai(e,fo(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 x:case w:return new r(+e);case z:return function(e,t){var n=t?Si(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case D:case R:case B:case N:case H:case F:case U:case W:case K:return Ii(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,fe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case A:return i=e,Hn?Ie(Hn.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 f=u?i:(d?c?ao:oo:c?zs:Ps)(e);return It(f||e,(function(r,i){f&&(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=Lt(t,$t(n))),r?(o=At,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 De.call(t,e)?t[e]:i},Yn.prototype.has=function(e){var t=this.__data__;return On?t[e]!==i:De.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},Zn.prototype.clear=function(){this.__data__=[],this.size=0},Zn.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)},Zn.prototype.get=function(e){var t=this.__data__,n=ir(t,e);return n<0?i:t[n][1]},Zn.prototype.has=function(e){return ir(this.__data__,e)>-1},Zn.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},Xn.prototype.clear=function(){this.size=0,this.__data__={hash:new Yn,map:new(In||Zn),string:new Yn}},Xn.prototype.delete=function(e){var t=ho(this,e).delete(e);return this.size-=t?1:0,t},Xn.prototype.get=function(e){return ho(this,e).get(e)},Xn.prototype.has=function(e){return ho(this,e).has(e)},Xn.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 Zn,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 Zn){var r=n.__data__;if(!In||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Xn(r)}return n.set(e,t),this.size=n.size,this};var gr=zi(_r),fr=zi(kr,!0);function mr(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 yr(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=xo),i||(i=[]);++o<a;){var s=e[o];t>0&&n(s)?t>1?yr(s,t-1,n,r,i):Pt(i,s):r||(i[i.length]=s)}return i}var xr=Di(),wr=Di(!0);function _r(e,t){return e&&xr(e,t,Ps)}function kr(e,t){return e&&wr(e,t,Ps)}function Er(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[Ho(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=De.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&&De.call(e,t)}function Mr(e,t){return null!=e&&t in Ie(e)}function Or(e,t,n){for(var o=n?At: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=Lt(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 f=h[p],m=t?t(f):f;if(f=n||0!==f?f:0,!(g?Jt(g,m):o(u,m,n))){for(l=s;--l;){var b=c[l];if(!(b?Jt(b,m):o(e[l],m,n)))continue e}g&&g.push(m),u.push(f)}}return u}function Ar(e,t,n){var r=null==(e=Mo(e,t=wi(t,e)))?e:e[Ho(Jo(t))];return null==r?i:Ct(r,e,n)}function Lr(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?y:bo(e),d=l?y: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 z: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 x:case w:case S:return Wa(+e,+t);case _: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 A:if(Hn)return Hn.call(e)==Hn.call(t)}return!1}(e,t,c,n,r,o,a);if(!(1&n)){var g=u&&De.call(e,"__wrapped__"),f=h&&De.call(t,"__wrapped__");if(g||f){var m=g?e.value():e,b=f?t.value():t;return a||(a=new $n),o(m,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:De.call(t,h)))return!1}var p=a.get(e),g=a.get(t);if(p&&g)return p==t&&g==e;var f=!0;a.set(e,t),a.set(t,e);var m=s;for(;++u<c;){var b=e[h=l[u]],v=t[h];if(r)var y=s?r(v,b,h,t,e,a):r(b,v,h,e,t,a);if(!(y===i?b===v||o(b,v,n,r,a):y)){f=!1;break}m||(m="constructor"==h)}if(f&&!m){var x=e.constructor,w=t.constructor;x==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof x&&x instanceof x&&"function"==typeof w&&w instanceof w||(f=!1)}return a.delete(e),a.delete(t),f}(e,t,n,r,o,a)}(e,t,n,r,Pr,o))}function zr(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 Dr(e){return!(!rs(e)||(t=e,Be&&Be 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):fl(e)}function Br(e){if(!So(e))return yn(e);var t=[];for(var n in Ie(e))De.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&&De.call(e,r))&&n.push(r);return n}function Hr(e,t){return e<t}function Fr(e,t){var n=-1,i=Xa(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||zr(n,e,t)}}function Wr(e,t){return ko(e)&&Io(t)?jo(Ho(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&&xr(t,(function(a,s){if(o||(o=new $n),rs(a))!function(e,t,n,r,o,a,s){var l=Ao(e,n),c=Ao(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),f=!p&&!g&&hs(c);u=c,p||g||f?Ya(l)?u=l:qa(l)?u=Oi(l):g?(h=!1,u=Ci(c,!0)):f?(h=!1,u=Ii(c,!0)):u=[]:ss(c)||Ga(c)?(u=l,Ga(l)?u=xs(l):rs(l)&&!es(l)||(u=yo(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(Ao(e,s),a,s+"",e,t,o):i;l===i&&(l=a),nr(e,s,l)}}),zs)}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?Lt(t,(function(e){return Ya(e)?function(t){return Cr(t,1===e.length?e[0]:e)}:e})):[al];var r=-1;t=Lt(t,$t(uo()));var i=Fr(e,(function(e,n,i){var o=Lt(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=Cr(e,a);n(s,a)&&ti(o,wi(a,e),s)}return o}function Zr(e,t,n,r){var i=r?Ut:Ft,o=-1,a=t.length,s=e;for(e===t&&(t=Oi(t)),n&&(s=Lt(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 Xr(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(En()*(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 zo(To(e,t,al),e+"")}function Jr(e){return Jn(Ws(e))}function ei(e,t){var n=Ws(e);return Bo(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=Ho(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=An?function(e,t){return An.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 Bo(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,f=h==h,m=us(h);if(s)var b=r||f;else b=d?f&&(r||p):l?f&&p&&(r||!g):c?f&&p&&!g&&(r||!m):!g&&!m&&(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)?f:+e}function ui(e){if("string"==typeof e)return e;if(Ya(e))return Lt(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=At;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[Ho(Jo(t))]}function gi(e,t,n,r){return ti(e,t,n(Cr(e,t)),r)}function fi(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 mi(e,t){var n=e;return n instanceof Gn&&(n=n.value()),zt(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(yr(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 yi(e){return qa(e)?e:[]}function xi(e){return"function"==typeof e?e:al}function wi(e,t){return Ya(e)?e:ko(e,t)?[e]:No(ws(e))}var _i=Qr;function ki(e,t,n){var r=e.length;return n=n===i?r:n,!t&&n>=r?e:oi(e,t,n)}var Ei=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 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=xn(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=xn(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 Ai(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 Li(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&&_o(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 zi(e,t){return function(n,r){if(null==n)return n;if(!Xa(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 Di(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?ki(n,1).join(""):t.slice(1);return r[e]()+o}}function Bi(e){return function(t){return zt(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 Hi(e){return function(t,n,r){var o=Ie(t);if(!Xa(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&&Eo(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?l[lo(d[0])].apply(l,d[3]):1==s.length&&Eo(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,f=2&t,m=24&t,b=512&t,v=f?i:Ni(e);return function i(){for(var u=arguments.length,y=r(u),x=u;x--;)y[x]=arguments[x];if(m)var w=co(i),_=nn(y,w);if(o&&(y=Ti(y,o,a,m)),s&&(y=Mi(y,s,l,m)),u-=_,m&&u<h){var k=dn(y,w);return Xi(e,t,Ui,i.placeholder,n,y,k,c,d,h-u)}var E=g?n:this,C=f?E[e]:e;return u=y.length,c?y=Oo(y,c):b&&u>1&&y.reverse(),p&&d<u&&(y.length=d),this&&this!==pt&&this instanceof i&&(C=v||Ni(C)),C.apply(E,y)}}function Wi(e,t){return function(n,r){return function(e,t,n,r){return _r(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=Lt(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,ft(e/pn(t)));return sn(t)?ki(gn(r),0,e).join(""):r.slice(0,e)}function Yi(e){return function(t,n,o){return o&&"number"!=typeof o&&_o(t,n,o)&&(n=o=i),t=ms(t),n===i?(n=t,t=0):n=ms(n),function(e,t,n,i){for(var o=-1,a=xn(ft((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:ms(o),e)}}function Zi(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ys(t),n=ys(n)),e(t,n)}}function Xi(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],f=n.apply(i,g);return Eo(e)&&Lo(f,g),f.placeholder=r,Do(f,e,t)}function qi(e){var t=Se[e];return function(e,n){if(e=ys(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 Lt(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Ji(e,t,n,a,p,g,f,m){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),f=f===i?f:xn(bs(f),0),m=m===i?m:bs(m),v-=p?p.length:0,t&d){var y=a,x=p;a=p=i}var w=b?i:so(e),_=[e,t,n,a,p,y,x,g,f,m];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}(_,w),e=_[0],t=_[1],n=_[2],a=_[3],p=_[4],!(m=_[9]=_[9]===i?b?0:e.length:xn(_[9]-v,0))&&24&t&&(t&=-25),t&&1!=t)k=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?Xi(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,m):t!=c&&33!=t||p.length?Ui.apply(i,_):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 k=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 Do((w?ni:Lo)(k,_),e,t)}function eo(e,t,n,r){return e===i||Wa(e,Le[n])&&!De.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 f=e[h],m=t[h];if(r)var b=s?r(m,f,h,t,e,a):r(f,m,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)&&(f===e||o(f,e,n,r,a)))return g.push(t)}))){p=!1;break}}else if(f!==m&&!o(f,m,n,r,a)){p=!1;break}}return a.delete(e),a.delete(t),p}function io(e){return zo(To(e,i,Zo),e+"")}function oo(e){return Sr(e,Ps,fo)}function ao(e){return Sr(e,zs,mo)}var so=An?function(e){return An.get(e)}:ul;function lo(e){for(var t=e.name+"",n=Ln[t],r=De.call(Ln,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(De.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 Dr(n)?n:i}var fo=vt?function(e){return null==e?[]:(e=Ie(e),Mt(vt(e),(function(t){return Xe.call(e,t)})))}:vl,mo=vt?function(e){for(var t=[];e;)Pt(t,fo(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=Ho(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 yo(e){return"function"!=typeof e.constructor||So(e)?{}:Wn(Ye(e))}function xo(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&&xe.test(e))&&e>-1&&e%1==0&&e<t}function _o(e,t,n){if(!rs(n))return!1;var r=typeof t;return!!("number"==r?Xa(n)&&wo(t,n.length):"string"==r&&t in n)&&Wa(n[t],e)}function ko(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 Eo(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)))!=z||In&&bo(new In)!=C||jn&&bo(jn.resolve())!=j||Tn&&bo(new Tn)!=M||Mn&&bo(new Mn)!=L)&&(bo=function(e){var t=Ir(e),n=t==I?e.constructor:i,r=n?Fo(n):"";if(r)switch(r){case Pn:return z;case zn:return C;case Dn:return j;case Rn:return M;case Bn:return L}return t});var Co=Pe?es:yl;function So(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Le)}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=xn(t===i?e.length-1:t,0),function(){for(var i=arguments,o=-1,a=xn(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 Ao(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Lo=Ro(ni),Po=gt||function(e,t){return pt.setTimeout(e,t)},zo=Ro(ri);function Do(e,t,n){var r=t+"";return zo(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=_n(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Bo(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 Ho(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 ze.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,yr(t,1,qa,!0)):[]})),Ko=Qr((function(e,t){var n=Jo(t);return qa(n)&&(n=i),qa(e)?pr(e,yr(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,yr(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=xn(r+i,0)),Ht(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?xn(r+o,0):wn(o,r-1)),Ht(e,uo(t,3),o,!0)}function Zo(e){return(null==e?0:e.length)?yr(e,1):[]}function Xo(e){return e&&e.length?e[0]:i}var qo=Qr((function(e){var t=Lt(e,yi);return t.length&&t[0]===e[0]?Or(t):[]})),$o=Qr((function(e){var t=Jo(e),n=Lt(e,yi);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=Lt(e,yi);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?Zr(e,t):e}var na=io((function(e,t){var n=null==e?0:e.length,r=lr(e,t);return Xr(e,Lt(t,(function(e){return wo(e,n)?+e:e})).sort(ji)),r}));function ra(e){return null==e?e:Cn.call(e)}var ia=Qr((function(e){return hi(yr(e,1,qa,!0))})),oa=Qr((function(e){var t=Jo(e);return qa(t)&&(t=i),hi(yr(e,1,qa,!0),uo(t,2))})),aa=Qr((function(e){var t=Jo(e);return t="function"==typeof t?t:i,hi(yr(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=xn(e.length,t),!0})),Xt(t,(function(t){return Lt(e,Vt(t))}))}function la(e,t){if(!e||!e.length)return[];var n=sa(e);return null==t?n:Lt(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 fa(e){var t=Un(e);return t.__chain__=!0,t}function ma(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:ma,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=Li((function(e,t,n){De.call(e,n)?++e[n]:sr(e,n,1)}));var ya=Hi(Go),xa=Hi(Yo);function wa(e,t){return(Ya(e)?It:gr)(e,uo(t,3))}function _a(e,t){return(Ya(e)?jt:fr)(e,uo(t,3))}var ka=Li((function(e,t,n){De.call(e,n)?e[n].push(t):sr(e,n,[t])}));var Ea=Qr((function(e,t,n){var i=-1,o="function"==typeof t,a=Xa(e)?r(e.length):[];return gr(e,(function(e){a[++i]=o?Ct(t,e,n):Ar(e,t,n)})),a})),Ca=Li((function(e,t,n){sr(e,n,t)}));function Sa(e,t){return(Ya(e)?Lt:Fr)(e,uo(t,3))}var Ia=Li((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&&_o(e,t[0],t[1])?t=[]:n>2&&_o(t[0],t[1],t[2])&&(t=[t[0]]),Gr(e,yr(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 Aa=Qr((function(e,t,n){var r=1;if(n.length){var i=dn(n,co(Aa));r|=c}return Ji(e,r,t,n,i)})),La=Qr((function(e,t,n){var r=3;if(n.length){var i=dn(n,co(La));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 f(t){var n=r,o=a;return r=a=i,u=t,l=e.apply(o,n)}function m(e){return u=e,c=Po(v,t),h?f(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 y(e);c=Po(v,function(e){var n=t-(e-d);return p?wn(n,s-(e-u)):n}(e))}function y(e){return c=i,g&&r?f(e):(r=a=i,l)}function x(){var e=Ta(),n=b(e);if(r=arguments,a=this,d=e,n){if(c===i)return m(d);if(p)return Ei(c),c=Po(v,t),f(d)}return c===i&&(c=Po(v,t)),l}return t=ys(t)||0,rs(n)&&(h=!!n.leading,s=(p="maxWait"in n)?xn(ys(n.maxWait)||0,t):s,g="trailing"in n?!!n.trailing:g),x.cancel=function(){c!==i&&Ei(c),u=0,r=d=a=c=i},x.flush=function(){return c===i?l:y(Ta())},x}var za=Qr((function(e,t){return hr(e,1,t)})),Da=Qr((function(e,t,n){return hr(e,ys(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||Xn),n}function Ba(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=Xn;var Na=_i((function(e,t){var n=(t=1==t.length&&Ya(t[0])?Lt(t[0],$t(uo())):Lt(yr(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)}))})),Ha=Qr((function(e,t){var n=dn(t,co(Ha));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=Zi(jr),Va=Zi((function(e,t){return e>=t})),Ga=Lr(function(){return arguments}())?Lr:function(e){return is(e)&&De.call(e,"callee")&&!Xe.call(e,"callee")},Ya=r.isArray,Za=yt?$t(yt):function(e){return is(e)&&Ir(e)==P};function Xa(e){return null!=e&&ns(e.length)&&!es(e)}function qa(e){return is(e)&&Xa(e)}var $a=Bt||yl,Qa=xt?$t(xt):function(e){return is(e)&&Ir(e)==w};function Ja(e){if(!is(e))return!1;var t=Ir(e);return t==_||"[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==k||t==E||"[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)&&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=De.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&ze.call(n)==He}var ls=_t?$t(_t):function(e){return is(e)&&Ir(e)==T};var cs=kt?$t(kt):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)==A}var hs=Et?$t(Et):function(e){return is(e)&&ns(e.length)&&!!at[Ir(e)]};var ps=Zi(Hr),gs=Zi((function(e,t){return e<=t}));function fs(e){if(!e)return[];if(Xa(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 ms(e){return e?(e=ys(e))===p||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function bs(e){var t=ms(e),n=t%1;return t==t?n?t-n:t:0}function vs(e){return e?cr(bs(e),0,m):0}function ys(e){if("number"==typeof e)return e;if(us(e))return f;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||ye.test(e)?dt(e.slice(2),n?2:8):me.test(e)?f:+e}function xs(e){return Ai(e,zs(e))}function ws(e){return null==e?"":ui(e)}var _s=Pi((function(e,t){if(So(t)||Xa(t))Ai(t,Ps(t),e);else for(var n in t)De.call(t,n)&&rr(e,n,t[n])})),ks=Pi((function(e,t){Ai(t,zs(t),e)})),Es=Pi((function(e,t,n,r){Ai(t,zs(t),e,r)})),Cs=Pi((function(e,t,n,r){Ai(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&&_o(t[0],t[1],o)&&(r=1);++n<r;)for(var a=t[n],s=zs(a),l=-1,c=s.length;++l<c;){var d=s[l],u=e[d];(u===i||Wa(u,Le[d])&&!De.call(e,d))&&(e[d]=a[d])}return e})),js=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)),As=Wi((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),De.call(e,t)?e[t].push(n):e[t]=[n]}),uo),Ls=Qr(Ar);function Ps(e){return Xa(e)?Qn(e):Br(e)}function zs(e){return Xa(e)?Qn(e,!0):Nr(e)}var Ds=Pi((function(e,t,n){Kr(e,t,n)})),Rs=Pi((function(e,t,n,r){Kr(e,t,n,r)})),Bs=io((function(e,t){var n={};if(null==e)return n;var r=!1;t=Lt(t,(function(t){return t=wi(t,e),r||(r=t.length>1),t})),Ai(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 Hs(e,t){if(null==e)return{};var n=Lt(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(zs);function Ws(e){return null==e?[]:Qt(e,Ps(e))}var Ks=Bi((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=Bi((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Zs=Bi((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Xs=Ri("toLowerCase");var qs=Bi((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var $s=Bi((function(e,t,n){return e+(n?" ":"")+Js(t)}));var Qs=Bi((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 Ee(e)}})),nl=io((function(e,t){return It(t,(function(t){t=Ho(t),sr(e,t,Aa(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 Ar(n,e,t)}})),cl=Qr((function(e,t){return function(n){return Ar(e,n,t)}}));function dl(e,t,n){var r=Ps(t),i=Er(t,r);null!=n||rs(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=Er(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(Lt),pl=Vi(Tt),gl=Vi(Rt);function fl(e){return ko(e)?Vt(Ho(e)):function(e){return function(t){return Cr(t,e)}}(e)}var ml=Yi(),bl=Yi(!0);function vl(){return[]}function yl(){return!1}var xl=Ki((function(e,t){return e+t}),0),wl=qi("ceil"),_l=Ki((function(e,t){return e/t}),1),kl=qi("floor");var El,Cl=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=_s,Un.assignIn=ks,Un.assignInWith=Es,Un.assignWith=Cs,Un.at=Ss,Un.before=Oa,Un.bind=Aa,Un.bindAll=nl,Un.bindKey=La,Un.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ya(e)?e:[e]},Un.chain=fa,Un.chunk=function(e,t,n){t=(n?_o(e,t,n):t===i)?1:xn(bs(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var a=0,s=0,l=r(ft(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],yr(t,1))},Un.cond=function(e){var t=null==e?0:e.length,n=uo();return e=t?Lt(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=Is,Un.defaultsDeep=js,Un.defer=za,Un.delay=Da,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?fi(e,uo(t,3),!0,!0):[]},Un.dropWhile=function(e,t){return e&&e.length?fi(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&&_o(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 yr(Sa(e,t),1)},Un.flatMapDeep=function(e,t){return yr(Sa(e,t),p)},Un.flatMapDepth=function(e,t,n){return n=n===i?1:bs(n),yr(Sa(e,t),n)},Un.flatten=Zo,Un.flattenDeep=function(e){return(null==e?0:e.length)?yr(e,p):[]},Un.flattenDepth=function(e,t){return(null==e?0:e.length)?yr(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?[]:Er(e,Ps(e))},Un.functionsIn=function(e){return null==e?[]:Er(e,zs(e))},Un.groupBy=ka,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=As,Un.invokeMap=Ea,Un.iteratee=sl,Un.keyBy=Ca,Un.keys=Ps,Un.keysIn=zs,Un.map=Sa,Un.mapKeys=function(e,t){var n={};return t=uo(t,3),_r(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),_r(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=Ds,Un.mergeWith=Rs,Un.method=ll,Un.methodOf=cl,Un.mixin=dl,Un.negate=Ba,Un.nthArg=function(e){return e=bs(e),Qr((function(t){return Vr(t,e)}))},Un.omit=Bs,Un.omitBy=function(e,t){return Hs(e,Ba(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=Ha,Un.partialRight=Fa,Un.partition=Ia,Un.pick=Ns,Un.pickBy=Hs,Un.property=fl,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?Zr(e,t,uo(n,2)):e},Un.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Zr(e,t,i,n):e},Un.pullAt=na,Un.range=ml,Un.rangeRight=bl,Un.rearg=Ua,Un.reject=function(e,t){return(Ya(e)?Mt:vr)(e,Ba(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 Xr(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?_o(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&&_o(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&&_o(e,t,n)&&(t=n=i),(n=n===i?m:n>>>0)?(e=ws(e))&&("string"==typeof t||null!=t&&!ls(t))&&!(t=ui(t))&&sn(e)?ki(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:xn(bs(t),0),Qr((function(n){var r=n[t],i=ki(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?fi(e,uo(t,3),!1,!0):[]},Un.takeWhile=function(e,t){return e&&e.length?fi(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=ma,Un.toArray=fs,Un.toPairs=Fs,Un.toPairsIn=Us,Un.toPath=function(e){return Ya(e)?Lt(e,Ho):us(e)?[e]:Oi(No(ws(e)))},Un.toPlainObject=xs,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:_r)(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,xi(n))},Un.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:gi(e,t,xi(n),r)},Un.values=Ws,Un.valuesIn=function(e){return null==e?[]:Qt(e,zs(e))},Un.without=ca,Un.words=el,Un.wrap=function(e,t){return Ha(xi(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=ks,Un.extendWith=Es,dl(Un,Un),Un.add=xl,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=ys(n))==n?n:0),t!==i&&(t=(t=ys(t))==t?t:0),cr(ys(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=_l,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(X,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:mr;return n&&_o(e,t,n)&&(t=i),r(e,uo(t,3))},Un.find=ya,Un.findIndex=Go,Un.findKey=function(e,t){return Nt(e,uo(t,3),_r)},Un.findLast=xa,Un.findLastIndex=Yo,Un.findLastKey=function(e,t){return Nt(e,uo(t,3),kr)},Un.floor=kl,Un.forEach=wa,Un.forEachRight=_a,Un.forIn=function(e,t){return null==e?e:xr(e,uo(t,3),zs)},Un.forInRight=function(e,t){return null==e?e:wr(e,uo(t,3),zs)},Un.forOwn=function(e,t){return e&&_r(e,uo(t,3))},Un.forOwnRight=function(e,t){return e&&kr(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=Xo,Un.identity=al,Un.includes=function(e,t,n,r){e=Xa(e)?e:Ws(e),n=n&&!r?bs(n):0;var i=e.length;return n<0&&(n=xn(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=xn(r+i,0)),Ft(e,t,i)},Un.inRange=function(e,t,n){return t=ms(t),n===i?(n=t,t=0):n=ms(n),function(e,t,n){return e>=wn(t,n)&&e<xn(t,n)}(e=ys(e),t,n)},Un.invoke=Ls,Un.isArguments=Ga,Un.isArray=Ya,Un.isArrayBuffer=Za,Un.isArrayLike=Xa,Un.isArrayLikeObject=qa,Un.isBoolean=function(e){return!0===e||!1===e||is(e)&&Ir(e)==x},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(Xa(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!Br(e).length;for(var n in e)if(De.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||zr(e,t,po(t))},Un.isMatchWith=function(e,t,n){return n="function"==typeof n?n:i,zr(e,t,po(t),n)},Un.isNaN=function(e){return as(e)&&e!=+e},Un.isNative=function(e){if(Co(e))throw new Ee("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Dr(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)==L},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?xn(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):Ht(e,Wt,o,!0)},Un.lowerCase=Zs,Un.lowerFirst=Xs,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,Hr):i},Un.minBy=function(e,t){return e&&e.length?br(e,uo(t,2),Hr):i},Un.stubArray=vl,Un.stubFalse=yl,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(ft(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),kn(ws(e).replace(ae,""),t||0)},Un.random=function(e,t,n){if(n&&"boolean"!=typeof n&&_o(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=ms(e),t===i?(t=e,e=0):t=ms(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var o=En();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)?zt:Yt,i=arguments.length<3;return r(e,uo(t,4),n,i,gr)},Un.reduceRight=function(e,t,n){var r=Ya(e)?Dt:Yt,i=arguments.length<3;return r(e,uo(t,4),n,i,fr)},Un.repeat=function(e,t,n){return t=(n?_o(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[Ho(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(Xa(e))return ds(e)?pn(e):e.length;var t=bo(e);return t==C||t==M?e.size:Br(e).length},Un.snakeCase=qs,Un.some=function(e,t,n){var r=Ya(e)?Rt:ai;return n&&_o(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?Zt(e,al):0},Un.sumBy=function(e,t){return e&&e.length?Zt(e,uo(t,2)):0},Un.template=function(e,t,n){var r=Un.templateSettings;n&&_o(e,t,n)&&(t=i),e=ws(e),t=Es({},t,r,eo);var o,a,s=Es({},t.imports,r.imports,eo),l=Ps(s),c=Qt(s,l),d=0,u=t.interpolate||_e,h="__p += '",p=je((t.escape||_e).source+"|"+u.source+"|"+(u===ee?ge:_e).source+"|"+(t.evaluate||_e).source+"|$","g"),g="//# sourceURL="+(De.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(ke,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 f=De.call(t,"variable")&&t.variable;if(f){if(he.test(f))throw new Ee("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("+(f||"obj")+") {\n"+(f?"":"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 m=tl((function(){return Ce(l,g+"return "+h).apply(i,c)}));if(m.source=h,Ja(m))throw m;return m},Un.times=function(e,t){if((e=bs(e))<1||e>g)return[];var n=m,r=wn(e,m);t=uo(t),e-=m;for(var i=Xt(r,t);++n<e;)t(n);return i},Un.toFinite=ms,Un.toInteger=bs,Un.toLength=vs,Un.toLower=function(e){return ws(e).toLowerCase()},Un.toNumber=ys,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 ki(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,fn(e)+1);if(!e||!(t=ui(t)))return e;var r=gn(e);return ki(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 ki(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?ki(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(fe.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(Z,mn):e},Un.uniqueId=function(e){var t=++Re;return ws(e)+t},Un.upperCase=Qs,Un.upperFirst=Js,Un.each=wa,Un.eachRight=_a,Un.first=Xo,dl(Un,(El={},_r(Un,(function(e,t){De.call(Un.prototype,t)||(El[t]=e)})),El),{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:xn(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,m),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 Ar(n,e,t)}))})),Gn.prototype.reject=function(e){return this.filter(Ba(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(m)},_r(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,f=l&&!p;if(!a&&d){t=f?t:new Gn(this);var m=e.apply(t,s);return m.__actions__.push({func:ma,args:[u],thisArg:i}),new Vn(m,h)}return g&&f?e.apply(this,s):(m=this.thru(u),g?r?m.value()[0]:m.value():m)})})),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)}))}})),_r(Gn.prototype,(function(e,t){var n=Un[t];if(n){var r=n.name+"";De.call(Ln,r)||(Ln[r]=[]),Ln[r].push({name:t,func:n})}})),Ln[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=xn(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 mi(e,this.__actions__);var g=[];e:for(;l--&&h<p;){for(var f=-1,m=e[c+=t];++f<u;){var b=d[f],v=b.iteratee,y=b.type,x=v(m);if(2==y)m=x;else if(!x){if(1==y)continue e;break e}}g[h++]=m}return g},Un.prototype.at=ba,Un.prototype.chain=function(){return fa(this)},Un.prototype.commit=function(){return new Vn(this.value(),this.__chain__)},Un.prototype.next=function(){this.__values__===i&&(this.__values__=fs(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:ma,args:[ra],thisArg:i}),new Vn(t,this.__chain__)}return this.thru(ra)},Un.prototype.toJSON=Un.prototype.valueOf=Un.prototype.value=function(){return mi(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}},2744:(e,t,n)=>{"use strict";var r={};(0,n(9187).assign)(r,n(4395),n(578),n(2684)),e.exports=r},4395:(e,t,n)=>{"use strict";var r=n(7651),i=n(9187),o=n(8592),a=n(5604),s=n(249),l=Object.prototype.toString;function c(e){if(!(this instanceof c))return new c(e);this.options=i.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var n=r.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw new Error(a[n]);if(t.header&&r.deflateSetHeader(this.strm,t.header),t.dictionary){var d;if(d="string"==typeof t.dictionary?o.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=r.deflateSetDictionary(this.strm,d)))throw new Error(a[n]);this._dict_set=!0}}function d(e,t){var n=new c(t);if(n.push(e,!0),n.err)throw n.msg||a[n.err];return n.result}c.prototype.push=function(e,t){var n,a,s=this.strm,c=this.options.chunkSize;if(this.ended)return!1;a=t===~~t?t:!0===t?4:0,"string"==typeof e?s.input=o.string2buf(e):"[object ArrayBuffer]"===l.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new i.Buf8(c),s.next_out=0,s.avail_out=c),1!==(n=r.deflate(s,a))&&0!==n)return this.onEnd(n),this.ended=!0,!1;0!==s.avail_out&&(0!==s.avail_in||4!==a&&2!==a)||("string"===this.options.to?this.onData(o.buf2binstring(i.shrinkBuf(s.output,s.next_out))):this.onData(i.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&1!==n);return 4===a?(n=r.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,0===n):2!==a||(this.onEnd(0),s.avail_out=0,!0)},c.prototype.onData=function(e){this.chunks.push(e)},c.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Deflate=c,t.deflate=d,t.deflateRaw=function(e,t){return(t=t||{}).raw=!0,d(e,t)},t.gzip=function(e,t){return(t=t||{}).gzip=!0,d(e,t)}},578:(e,t,n)=>{"use strict";var r=n(7823),i=n(9187),o=n(8592),a=n(2684),s=n(5604),l=n(249),c=n(9968),d=Object.prototype.toString;function u(e){if(!(this instanceof u))return new u(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var n=r.inflateInit2(this.strm,t.windowBits);if(n!==a.Z_OK)throw new Error(s[n]);if(this.header=new c,r.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=o.string2buf(t.dictionary):"[object ArrayBuffer]"===d.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=r.inflateSetDictionary(this.strm,t.dictionary))!==a.Z_OK))throw new Error(s[n])}function h(e,t){var n=new u(t);if(n.push(e,!0),n.err)throw n.msg||s[n.err];return n.result}u.prototype.push=function(e,t){var n,s,l,c,u,h=this.strm,p=this.options.chunkSize,g=this.options.dictionary,f=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof e?h.input=o.binstring2buf(e):"[object ArrayBuffer]"===d.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new i.Buf8(p),h.next_out=0,h.avail_out=p),(n=r.inflate(h,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&g&&(n=r.inflateSetDictionary(this.strm,g)),n===a.Z_BUF_ERROR&&!0===f&&(n=a.Z_OK,f=!1),n!==a.Z_STREAM_END&&n!==a.Z_OK)return this.onEnd(n),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&n!==a.Z_STREAM_END&&(0!==h.avail_in||s!==a.Z_FINISH&&s!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(l=o.utf8border(h.output,h.next_out),c=h.next_out-l,u=o.buf2string(h.output,l),h.next_out=c,h.avail_out=p-c,c&&i.arraySet(h.output,h.output,l,c,0),this.onData(u)):this.onData(i.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(f=!0)}while((h.avail_in>0||0===h.avail_out)&&n!==a.Z_STREAM_END);return n===a.Z_STREAM_END&&(s=a.Z_FINISH),s===a.Z_FINISH?(n=r.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===a.Z_OK):s!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),h.avail_out=0,!0)},u.prototype.onData=function(e){this.chunks.push(e)},u.prototype.onEnd=function(e){e===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=u,t.inflate=h,t.inflateRaw=function(e,t){return(t=t||{}).raw=!0,h(e,t)},t.ungzip=h},9187:(e,t)=>{"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var i in n)r(n,i)&&(e[i]=n[i])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,n,r,i){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+r),i);else for(var o=0;o<r;o++)e[i+o]=t[n+o]},flattenChunks:function(e){var t,n,r,i,o,a;for(r=0,t=0,n=e.length;t<n;t++)r+=e[t].length;for(a=new Uint8Array(r),i=0,t=0,n=e.length;t<n;t++)o=e[t],a.set(o,i),i+=o.length;return a}},o={arraySet:function(e,t,n,r,i){for(var o=0;o<r;o++)e[i+o]=t[n+o]},flattenChunks:function(e){return[].concat.apply([],e)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,i)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,o))},t.setTyped(n)},8592:(e,t,n)=>{"use strict";var r=n(9187),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){o=!1}for(var a=new r.Buf8(256),s=0;s<256;s++)a[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function l(e,t){if(t<65534&&(e.subarray&&o||!e.subarray&&i))return String.fromCharCode.apply(null,r.shrinkBuf(e,t));for(var n="",a=0;a<t;a++)n+=String.fromCharCode(e[a]);return n}a[254]=a[254]=1,t.string2buf=function(e){var t,n,i,o,a,s=e.length,l=0;for(o=0;o<s;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(i=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(i-56320),o++),l+=n<128?1:n<2048?2:n<65536?3:4;for(t=new r.Buf8(l),a=0,o=0;a<l;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(i=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(i-56320),o++),n<128?t[a++]=n:n<2048?(t[a++]=192|n>>>6,t[a++]=128|63&n):n<65536?(t[a++]=224|n>>>12,t[a++]=128|n>>>6&63,t[a++]=128|63&n):(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63,t[a++]=128|n>>>6&63,t[a++]=128|63&n);return t},t.buf2binstring=function(e){return l(e,e.length)},t.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,i=t.length;n<i;n++)t[n]=e.charCodeAt(n);return t},t.buf2string=function(e,t){var n,r,i,o,s=t||e.length,c=new Array(2*s);for(r=0,n=0;n<s;)if((i=e[n++])<128)c[r++]=i;else if((o=a[i])>4)c[r++]=65533,n+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&n<s;)i=i<<6|63&e[n++],o--;o>1?c[r++]=65533:i<65536?c[r++]=i:(i-=65536,c[r++]=55296|i>>10&1023,c[r++]=56320|1023&i)}return l(c,r)},t.utf8border=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+a[e[n]]>t?n:t}},3693:e=>{"use strict";e.exports=function(e,t,n,r){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==n;){n-=a=n>2e3?2e3:n;do{o=o+(i=i+t[r++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0}},2684:e=>{"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},8464:e=>{"use strict";var t=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();e.exports=function(e,n,r,i){var o=t,a=i+r;e^=-1;for(var s=i;s<a;s++)e=e>>>8^o[255&(e^n[s])];return-1^e}},7651:(e,t,n)=>{"use strict";var r,i=n(9187),o=n(8676),a=n(3693),s=n(8464),l=n(5604),c=-2,d=258,u=262,h=103,p=113,g=666;function f(e,t){return e.msg=l[t],t}function m(e){return(e<<1)-(e>4?9:0)}function b(e){for(var t=e.length;--t>=0;)e[t]=0}function v(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(i.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))}function y(e,t){o._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,v(e.strm)}function x(e,t){e.pending_buf[e.pending++]=t}function w(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function _(e,t){var n,r,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-u?e.strstart-(e.w_size-u):0,c=e.window,h=e.w_mask,p=e.prev,g=e.strstart+d,f=c[o+a-1],m=c[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(c[(n=t)+a]===m&&c[n+a-1]===f&&c[n]===c[o]&&c[++n]===c[o+1]){o+=2,n++;do{}while(c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&o<g);if(r=d-(g-o),o=g-d,r>a){if(e.match_start=t,a=r,r>=s)break;f=c[o+a-1],m=c[o+a]}}}while((t=p[t&h])>l&&0!=--i);return a<=e.lookahead?a:e.lookahead}function k(e){var t,n,r,o,l,c,d,h,p,g,f=e.w_size;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=f+(f-u)){i.arraySet(e.window,e.window,f,f,0),e.match_start-=f,e.strstart-=f,e.block_start-=f,t=n=e.hash_size;do{r=e.head[--t],e.head[t]=r>=f?r-f:0}while(--n);t=n=f;do{r=e.prev[--t],e.prev[t]=r>=f?r-f:0}while(--n);o+=f}if(0===e.strm.avail_in)break;if(c=e.strm,d=e.window,h=e.strstart+e.lookahead,p=o,g=void 0,(g=c.avail_in)>p&&(g=p),n=0===g?0:(c.avail_in-=g,i.arraySet(d,c.input,c.next_in,g,h),1===c.state.wrap?c.adler=a(c.adler,d,g,h):2===c.state.wrap&&(c.adler=s(c.adler,d,g,h)),c.next_in+=g,c.total_in+=g,g),e.lookahead+=n,e.lookahead+e.insert>=3)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+3-1])&e.hash_mask,e.prev[l&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=l,l++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<u&&0!==e.strm.avail_in)}function E(e,t){for(var n,r;;){if(e.lookahead<u){if(k(e),e.lookahead<u&&0===t)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-u&&(e.match_length=_(e,n)),e.match_length>=3)if(r=o._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(y(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(y(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(y(e,!1),0===e.strm.avail_out)?1:2}function C(e,t){for(var n,r,i;;){if(e.lookahead<u){if(k(e),e.lookahead<u&&0===t)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==n&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-u&&(e.match_length=_(e,n),e.match_length<=5&&(1===e.strategy||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,r=o._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(y(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((r=o._tr_tally(e,0,e.window[e.strstart-1]))&&y(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=o._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(y(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(y(e,!1),0===e.strm.avail_out)?1:2}function S(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}function I(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(1146),this.dyn_dtree=new i.Buf16(122),this.bl_tree=new i.Buf16(78),b(this.dyn_ltree),b(this.dyn_dtree),b(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(16),this.heap=new i.Buf16(573),b(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(573),b(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function j(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:p,e.adler=2===t.wrap?0:1,t.last_flush=0,o._tr_init(t),0):f(e,c)}function T(e){var t,n=j(e);return 0===n&&((t=e.state).window_size=2*t.w_size,b(t.head),t.max_lazy_match=r[t.level].max_lazy,t.good_match=r[t.level].good_length,t.nice_match=r[t.level].nice_length,t.max_chain_length=r[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0),n}function M(e,t,n,r,o,a){if(!e)return c;var s=1;if(-1===t&&(t=6),r<0?(s=0,r=-r):r>15&&(s=2,r-=16),o<1||o>9||8!==n||r<8||r>15||t<0||t>9||a<0||a>4)return f(e,c);8===r&&(r=9);var l=new I;return e.state=l,l.strm=e,l.wrap=s,l.gzhead=null,l.w_bits=r,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=o+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+3-1)/3),l.window=new i.Buf8(2*l.w_size),l.head=new i.Buf16(l.hash_size),l.prev=new i.Buf16(l.w_size),l.lit_bufsize=1<<o+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new i.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=t,l.strategy=a,l.method=n,T(e)}r=[new S(0,0,0,0,(function(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(k(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((0===e.strstart||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,y(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-u&&(y(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(y(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(y(e,!1),e.strm.avail_out),1)})),new S(4,4,8,4,E),new S(4,5,16,8,E),new S(4,6,32,32,E),new S(4,4,16,16,C),new S(8,16,32,32,C),new S(8,16,128,128,C),new S(8,32,128,256,C),new S(32,128,258,1024,C),new S(32,258,258,4096,C)],t.deflateInit=function(e,t){return M(e,t,8,15,8,0)},t.deflateInit2=M,t.deflateReset=T,t.deflateResetKeep=j,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?c:(e.state.gzhead=t,0):c},t.deflate=function(e,t){var n,i,a,l;if(!e||!e.state||t>5||t<0)return e?f(e,c):c;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||i.status===g&&4!==t)return f(e,0===e.avail_out?-5:c);if(i.strm=e,n=i.last_flush,i.last_flush=t,42===i.status)if(2===i.wrap)e.adler=0,x(i,31),x(i,139),x(i,8),i.gzhead?(x(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),x(i,255&i.gzhead.time),x(i,i.gzhead.time>>8&255),x(i,i.gzhead.time>>16&255),x(i,i.gzhead.time>>24&255),x(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),x(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(x(i,255&i.gzhead.extra.length),x(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(x(i,0),x(i,0),x(i,0),x(i,0),x(i,0),x(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),x(i,3),i.status=p);else{var u=8+(i.w_bits-8<<4)<<8;u|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(u|=32),u+=31-u%31,i.status=p,w(i,u),0!==i.strstart&&(w(i,e.adler>>>16),w(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),v(e),a=i.pending,i.pending!==i.pending_buf_size));)x(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),v(e),a=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,x(i,l)}while(0!==l);i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===l&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),v(e),a=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,x(i,l)}while(0!==l);i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===l&&(i.status=h)}else i.status=h;if(i.status===h&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&v(e),i.pending+2<=i.pending_buf_size&&(x(i,255&e.adler),x(i,e.adler>>8&255),e.adler=0,i.status=p)):i.status=p),0!==i.pending){if(v(e),0===e.avail_out)return i.last_flush=-1,0}else if(0===e.avail_in&&m(t)<=m(n)&&4!==t)return f(e,-5);if(i.status===g&&0!==e.avail_in)return f(e,-5);if(0!==e.avail_in||0!==i.lookahead||0!==t&&i.status!==g){var _=2===i.strategy?function(e,t){for(var n;;){if(0===e.lookahead&&(k(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,n=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(y(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(y(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(y(e,!1),0===e.strm.avail_out)?1:2}(i,t):3===i.strategy?function(e,t){for(var n,r,i,a,s=e.window;;){if(e.lookahead<=d){if(k(e),e.lookahead<=d&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(r=s[i=e.strstart-1])===s[++i]&&r===s[++i]&&r===s[++i]){a=e.strstart+d;do{}while(r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&i<a);e.match_length=d-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=o._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(y(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(y(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(y(e,!1),0===e.strm.avail_out)?1:2}(i,t):r[i.level].func(i,t);if(3!==_&&4!==_||(i.status=g),1===_||3===_)return 0===e.avail_out&&(i.last_flush=-1),0;if(2===_&&(1===t?o._tr_align(i):5!==t&&(o._tr_stored_block(i,0,0,!1),3===t&&(b(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),v(e),0===e.avail_out))return i.last_flush=-1,0}return 4!==t?0:i.wrap<=0?1:(2===i.wrap?(x(i,255&e.adler),x(i,e.adler>>8&255),x(i,e.adler>>16&255),x(i,e.adler>>24&255),x(i,255&e.total_in),x(i,e.total_in>>8&255),x(i,e.total_in>>16&255),x(i,e.total_in>>24&255)):(w(i,e.adler>>>16),w(i,65535&e.adler)),v(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?0:1)},t.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&t!==h&&t!==p&&t!==g?f(e,c):(e.state=null,t===p?f(e,-3):0):c},t.deflateSetDictionary=function(e,t){var n,r,o,s,l,d,u,h,p=t.length;if(!e||!e.state)return c;if(2===(s=(n=e.state).wrap)||1===s&&42!==n.status||n.lookahead)return c;for(1===s&&(e.adler=a(e.adler,t,p,0)),n.wrap=0,p>=n.w_size&&(0===s&&(b(n.head),n.strstart=0,n.block_start=0,n.insert=0),h=new i.Buf8(n.w_size),i.arraySet(h,t,p-n.w_size,n.w_size,0),t=h,p=n.w_size),l=e.avail_in,d=e.next_in,u=e.input,e.avail_in=p,e.next_in=0,e.input=t,k(n);n.lookahead>=3;){r=n.strstart,o=n.lookahead-2;do{n.ins_h=(n.ins_h<<n.hash_shift^n.window[r+3-1])&n.hash_mask,n.prev[r&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=r,r++}while(--o);n.strstart=r,n.lookahead=2,k(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,e.next_in=d,e.input=u,e.avail_in=l,n.wrap=s,0},t.deflateInfo="pako deflate (from Nodeca project)"},9968:e=>{"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},9365:e=>{"use strict";e.exports=function(e,t){var n,r,i,o,a,s,l,c,d,u,h,p,g,f,m,b,v,y,x,w,_,k,E,C,S;n=e.state,r=e.next_in,C=e.input,i=r+(e.avail_in-5),o=e.next_out,S=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),l=n.dmax,c=n.wsize,d=n.whave,u=n.wnext,h=n.window,p=n.hold,g=n.bits,f=n.lencode,m=n.distcode,b=(1<<n.lenbits)-1,v=(1<<n.distbits)-1;e:do{g<15&&(p+=C[r++]<<g,g+=8,p+=C[r++]<<g,g+=8),y=f[p&b];t:for(;;){if(p>>>=x=y>>>24,g-=x,0===(x=y>>>16&255))S[o++]=65535&y;else{if(!(16&x)){if(0==(64&x)){y=f[(65535&y)+(p&(1<<x)-1)];continue t}if(32&x){n.mode=12;break e}e.msg="invalid literal/length code",n.mode=30;break e}w=65535&y,(x&=15)&&(g<x&&(p+=C[r++]<<g,g+=8),w+=p&(1<<x)-1,p>>>=x,g-=x),g<15&&(p+=C[r++]<<g,g+=8,p+=C[r++]<<g,g+=8),y=m[p&v];n:for(;;){if(p>>>=x=y>>>24,g-=x,!(16&(x=y>>>16&255))){if(0==(64&x)){y=m[(65535&y)+(p&(1<<x)-1)];continue n}e.msg="invalid distance code",n.mode=30;break e}if(_=65535&y,g<(x&=15)&&(p+=C[r++]<<g,(g+=8)<x&&(p+=C[r++]<<g,g+=8)),(_+=p&(1<<x)-1)>l){e.msg="invalid distance too far back",n.mode=30;break e}if(p>>>=x,g-=x,_>(x=o-a)){if((x=_-x)>d&&n.sane){e.msg="invalid distance too far back",n.mode=30;break e}if(k=0,E=h,0===u){if(k+=c-x,x<w){w-=x;do{S[o++]=h[k++]}while(--x);k=o-_,E=S}}else if(u<x){if(k+=c+u-x,(x-=u)<w){w-=x;do{S[o++]=h[k++]}while(--x);if(k=0,u<w){w-=x=u;do{S[o++]=h[k++]}while(--x);k=o-_,E=S}}}else if(k+=u-x,x<w){w-=x;do{S[o++]=h[k++]}while(--x);k=o-_,E=S}for(;w>2;)S[o++]=E[k++],S[o++]=E[k++],S[o++]=E[k++],w-=3;w&&(S[o++]=E[k++],w>1&&(S[o++]=E[k++]))}else{k=o-_;do{S[o++]=S[k++],S[o++]=S[k++],S[o++]=S[k++],w-=3}while(w>2);w&&(S[o++]=S[k++],w>1&&(S[o++]=S[k++]))}break}}break}}while(r<i&&o<s);r-=w=g>>3,p&=(1<<(g-=w<<3))-1,e.next_in=r,e.next_out=o,e.avail_in=r<i?i-r+5:5-(r-i),e.avail_out=o<s?s-o+257:257-(o-s),n.hold=p,n.bits=g}},7823:(e,t,n)=>{"use strict";var r=n(9187),i=n(3693),o=n(8464),a=n(9365),s=n(6446),l=-2,c=12,d=30;function u(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function h(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function p(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new r.Buf32(852),t.distcode=t.distdyn=new r.Buf32(592),t.sane=1,t.back=-1,0):l}function g(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,p(e)):l}function f(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?l:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,g(e))):l}function m(e,t){var n,r;return e?(r=new h,e.state=r,r.window=null,0!==(n=f(e,t))&&(e.state=null),n):l}var b,v,y=!0;function x(e){if(y){var t;for(b=new r.Buf32(512),v=new r.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(1,e.lens,0,288,b,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(2,e.lens,0,32,v,0,e.work,{bits:5}),y=!1}e.lencode=b,e.lenbits=9,e.distcode=v,e.distbits=5}function w(e,t,n,i){var o,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new r.Buf8(a.wsize)),i>=a.wsize?(r.arraySet(a.window,t,n-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((o=a.wsize-a.wnext)>i&&(o=i),r.arraySet(a.window,t,n-i,o,a.wnext),(i-=o)?(r.arraySet(a.window,t,n-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=o))),0}t.inflateReset=g,t.inflateReset2=f,t.inflateResetKeep=p,t.inflateInit=function(e){return m(e,15)},t.inflateInit2=m,t.inflate=function(e,t){var n,h,p,g,f,m,b,v,y,_,k,E,C,S,I,j,T,M,O,A,L,P,z,D,R=0,B=new r.Buf8(4),N=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return l;(n=e.state).mode===c&&(n.mode=13),f=e.next_out,p=e.output,b=e.avail_out,g=e.next_in,h=e.input,m=e.avail_in,v=n.hold,y=n.bits,_=m,k=b,P=0;e:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;y<16;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}if(2&n.wrap&&35615===v){n.check=0,B[0]=255&v,B[1]=v>>>8&255,n.check=o(n.check,B,2,0),v=0,y=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&v)<<8)+(v>>8))%31){e.msg="incorrect header check",n.mode=d;break}if(8!=(15&v)){e.msg="unknown compression method",n.mode=d;break}if(y-=4,L=8+(15&(v>>>=4)),0===n.wbits)n.wbits=L;else if(L>n.wbits){e.msg="invalid window size",n.mode=d;break}n.dmax=1<<L,e.adler=n.check=1,n.mode=512&v?10:c,v=0,y=0;break;case 2:for(;y<16;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}if(n.flags=v,8!=(255&n.flags)){e.msg="unknown compression method",n.mode=d;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=d;break}n.head&&(n.head.text=v>>8&1),512&n.flags&&(B[0]=255&v,B[1]=v>>>8&255,n.check=o(n.check,B,2,0)),v=0,y=0,n.mode=3;case 3:for(;y<32;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}n.head&&(n.head.time=v),512&n.flags&&(B[0]=255&v,B[1]=v>>>8&255,B[2]=v>>>16&255,B[3]=v>>>24&255,n.check=o(n.check,B,4,0)),v=0,y=0,n.mode=4;case 4:for(;y<16;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}n.head&&(n.head.xflags=255&v,n.head.os=v>>8),512&n.flags&&(B[0]=255&v,B[1]=v>>>8&255,n.check=o(n.check,B,2,0)),v=0,y=0,n.mode=5;case 5:if(1024&n.flags){for(;y<16;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}n.length=v,n.head&&(n.head.extra_len=v),512&n.flags&&(B[0]=255&v,B[1]=v>>>8&255,n.check=o(n.check,B,2,0)),v=0,y=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((E=n.length)>m&&(E=m),E&&(n.head&&(L=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),r.arraySet(n.head.extra,h,g,E,L)),512&n.flags&&(n.check=o(n.check,h,E,g)),m-=E,g+=E,n.length-=E),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===m)break e;E=0;do{L=h[g+E++],n.head&&L&&n.length<65536&&(n.head.name+=String.fromCharCode(L))}while(L&&E<m);if(512&n.flags&&(n.check=o(n.check,h,E,g)),m-=E,g+=E,L)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===m)break e;E=0;do{L=h[g+E++],n.head&&L&&n.length<65536&&(n.head.comment+=String.fromCharCode(L))}while(L&&E<m);if(512&n.flags&&(n.check=o(n.check,h,E,g)),m-=E,g+=E,L)break e}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;y<16;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}if(v!==(65535&n.check)){e.msg="header crc mismatch",n.mode=d;break}v=0,y=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=c;break;case 10:for(;y<32;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}e.adler=n.check=u(v),v=0,y=0,n.mode=11;case 11:if(0===n.havedict)return e.next_out=f,e.avail_out=b,e.next_in=g,e.avail_in=m,n.hold=v,n.bits=y,2;e.adler=n.check=1,n.mode=c;case c:if(5===t||6===t)break e;case 13:if(n.last){v>>>=7&y,y-=7&y,n.mode=27;break}for(;y<3;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}switch(n.last=1&v,y-=1,3&(v>>>=1)){case 0:n.mode=14;break;case 1:if(x(n),n.mode=20,6===t){v>>>=2,y-=2;break e}break;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=d}v>>>=2,y-=2;break;case 14:for(v>>>=7&y,y-=7&y;y<32;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}if((65535&v)!=(v>>>16^65535)){e.msg="invalid stored block lengths",n.mode=d;break}if(n.length=65535&v,v=0,y=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(E=n.length){if(E>m&&(E=m),E>b&&(E=b),0===E)break e;r.arraySet(p,h,g,E,f),m-=E,g+=E,b-=E,f+=E,n.length-=E;break}n.mode=c;break;case 17:for(;y<14;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}if(n.nlen=257+(31&v),v>>>=5,y-=5,n.ndist=1+(31&v),v>>>=5,y-=5,n.ncode=4+(15&v),v>>>=4,y-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=d;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;y<3;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}n.lens[N[n.have++]]=7&v,v>>>=3,y-=3}for(;n.have<19;)n.lens[N[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,z={bits:n.lenbits},P=s(0,n.lens,0,19,n.lencode,0,n.work,z),n.lenbits=z.bits,P){e.msg="invalid code lengths set",n.mode=d;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;j=(R=n.lencode[v&(1<<n.lenbits)-1])>>>16&255,T=65535&R,!((I=R>>>24)<=y);){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}if(T<16)v>>>=I,y-=I,n.lens[n.have++]=T;else{if(16===T){for(D=I+2;y<D;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}if(v>>>=I,y-=I,0===n.have){e.msg="invalid bit length repeat",n.mode=d;break}L=n.lens[n.have-1],E=3+(3&v),v>>>=2,y-=2}else if(17===T){for(D=I+3;y<D;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}y-=I,L=0,E=3+(7&(v>>>=I)),v>>>=3,y-=3}else{for(D=I+7;y<D;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}y-=I,L=0,E=11+(127&(v>>>=I)),v>>>=7,y-=7}if(n.have+E>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=d;break}for(;E--;)n.lens[n.have++]=L}}if(n.mode===d)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=d;break}if(n.lenbits=9,z={bits:n.lenbits},P=s(1,n.lens,0,n.nlen,n.lencode,0,n.work,z),n.lenbits=z.bits,P){e.msg="invalid literal/lengths set",n.mode=d;break}if(n.distbits=6,n.distcode=n.distdyn,z={bits:n.distbits},P=s(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,z),n.distbits=z.bits,P){e.msg="invalid distances set",n.mode=d;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(m>=6&&b>=258){e.next_out=f,e.avail_out=b,e.next_in=g,e.avail_in=m,n.hold=v,n.bits=y,a(e,k),f=e.next_out,p=e.output,b=e.avail_out,g=e.next_in,h=e.input,m=e.avail_in,v=n.hold,y=n.bits,n.mode===c&&(n.back=-1);break}for(n.back=0;j=(R=n.lencode[v&(1<<n.lenbits)-1])>>>16&255,T=65535&R,!((I=R>>>24)<=y);){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}if(j&&0==(240&j)){for(M=I,O=j,A=T;j=(R=n.lencode[A+((v&(1<<M+O)-1)>>M)])>>>16&255,T=65535&R,!(M+(I=R>>>24)<=y);){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}v>>>=M,y-=M,n.back+=M}if(v>>>=I,y-=I,n.back+=I,n.length=T,0===j){n.mode=26;break}if(32&j){n.back=-1,n.mode=c;break}if(64&j){e.msg="invalid literal/length code",n.mode=d;break}n.extra=15&j,n.mode=22;case 22:if(n.extra){for(D=n.extra;y<D;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}n.length+=v&(1<<n.extra)-1,v>>>=n.extra,y-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;j=(R=n.distcode[v&(1<<n.distbits)-1])>>>16&255,T=65535&R,!((I=R>>>24)<=y);){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}if(0==(240&j)){for(M=I,O=j,A=T;j=(R=n.distcode[A+((v&(1<<M+O)-1)>>M)])>>>16&255,T=65535&R,!(M+(I=R>>>24)<=y);){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}v>>>=M,y-=M,n.back+=M}if(v>>>=I,y-=I,n.back+=I,64&j){e.msg="invalid distance code",n.mode=d;break}n.offset=T,n.extra=15&j,n.mode=24;case 24:if(n.extra){for(D=n.extra;y<D;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}n.offset+=v&(1<<n.extra)-1,v>>>=n.extra,y-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=d;break}n.mode=25;case 25:if(0===b)break e;if(E=k-b,n.offset>E){if((E=n.offset-E)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=d;break}E>n.wnext?(E-=n.wnext,C=n.wsize-E):C=n.wnext-E,E>n.length&&(E=n.length),S=n.window}else S=p,C=f-n.offset,E=n.length;E>b&&(E=b),b-=E,n.length-=E;do{p[f++]=S[C++]}while(--E);0===n.length&&(n.mode=21);break;case 26:if(0===b)break e;p[f++]=n.length,b--,n.mode=21;break;case 27:if(n.wrap){for(;y<32;){if(0===m)break e;m--,v|=h[g++]<<y,y+=8}if(k-=b,e.total_out+=k,n.total+=k,k&&(e.adler=n.check=n.flags?o(n.check,p,k,f-k):i(n.check,p,k,f-k)),k=b,(n.flags?v:u(v))!==n.check){e.msg="incorrect data check",n.mode=d;break}v=0,y=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;y<32;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}if(v!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=d;break}v=0,y=0}n.mode=29;case 29:P=1;break e;case d:P=-3;break e;case 31:return-4;default:return l}return e.next_out=f,e.avail_out=b,e.next_in=g,e.avail_in=m,n.hold=v,n.bits=y,(n.wsize||k!==e.avail_out&&n.mode<d&&(n.mode<27||4!==t))&&w(e,e.output,e.next_out,k-e.avail_out)?(n.mode=31,-4):(_-=e.avail_in,k-=e.avail_out,e.total_in+=_,e.total_out+=k,n.total+=k,n.wrap&&k&&(e.adler=n.check=n.flags?o(n.check,p,k,e.next_out-k):i(n.check,p,k,e.next_out-k)),e.data_type=n.bits+(n.last?64:0)+(n.mode===c?128:0)+(20===n.mode||15===n.mode?256:0),(0===_&&0===k||4===t)&&0===P&&(P=-5),P)},t.inflateEnd=function(e){if(!e||!e.state)return l;var t=e.state;return t.window&&(t.window=null),e.state=null,0},t.inflateGetHeader=function(e,t){var n;return e&&e.state?0==(2&(n=e.state).wrap)?l:(n.head=t,t.done=!1,0):l},t.inflateSetDictionary=function(e,t){var n,r=t.length;return e&&e.state?0!==(n=e.state).wrap&&11!==n.mode?l:11===n.mode&&i(1,t,r,0)!==n.check?-3:w(e,t,r,r)?(n.mode=31,-4):(n.havedict=1,0):l},t.inflateInfo="pako inflate (from Nodeca project)"},6446:(e,t,n)=>{"use strict";var r=n(9187),i=15,o=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],s=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],l=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(e,t,n,c,d,u,h,p){var g,f,m,b,v,y,x,w,_,k=p.bits,E=0,C=0,S=0,I=0,j=0,T=0,M=0,O=0,A=0,L=0,P=null,z=0,D=new r.Buf16(16),R=new r.Buf16(16),B=null,N=0;for(E=0;E<=i;E++)D[E]=0;for(C=0;C<c;C++)D[t[n+C]]++;for(j=k,I=i;I>=1&&0===D[I];I--);if(j>I&&(j=I),0===I)return d[u++]=20971520,d[u++]=20971520,p.bits=1,0;for(S=1;S<I&&0===D[S];S++);for(j<S&&(j=S),O=1,E=1;E<=i;E++)if(O<<=1,(O-=D[E])<0)return-1;if(O>0&&(0===e||1!==I))return-1;for(R[1]=0,E=1;E<i;E++)R[E+1]=R[E]+D[E];for(C=0;C<c;C++)0!==t[n+C]&&(h[R[t[n+C]]++]=C);if(0===e?(P=B=h,y=19):1===e?(P=o,z-=257,B=a,N-=257,y=256):(P=s,B=l,y=-1),L=0,C=0,E=S,v=u,T=j,M=0,m=-1,b=(A=1<<j)-1,1===e&&A>852||2===e&&A>592)return 1;for(;;){x=E-M,h[C]<y?(w=0,_=h[C]):h[C]>y?(w=B[N+h[C]],_=P[z+h[C]]):(w=96,_=0),g=1<<E-M,S=f=1<<T;do{d[v+(L>>M)+(f-=g)]=x<<24|w<<16|_|0}while(0!==f);for(g=1<<E-1;L&g;)g>>=1;if(0!==g?(L&=g-1,L+=g):L=0,C++,0==--D[E]){if(E===I)break;E=t[n+h[C]]}if(E>j&&(L&b)!==m){for(0===M&&(M=j),v+=S,O=1<<(T=E-M);T+M<I&&!((O-=D[T+M])<=0);)T++,O<<=1;if(A+=1<<T,1===e&&A>852||2===e&&A>592)return 1;d[m=L&b]=j<<24|T<<16|v-u|0}}return 0!==L&&(d[v+L]=E-M<<24|64<<16|0),p.bits=j,0}},5604:e=>{"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},8676:(e,t,n)=>{"use strict";var r=n(9187);function i(e){for(var t=e.length;--t>=0;)e[t]=0}var o=256,a=286,s=30,l=15,c=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],d=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],u=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],h=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],p=new Array(576);i(p);var g=new Array(60);i(g);var f=new Array(512);i(f);var m=new Array(256);i(m);var b=new Array(29);i(b);var v,y,x,w=new Array(s);function _(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}function k(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function E(e){return e<256?f[e]:f[256+(e>>>7)]}function C(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function S(e,t,n){e.bi_valid>16-n?(e.bi_buf|=t<<e.bi_valid&65535,C(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function I(e,t,n){S(e,n[2*t],n[2*t+1])}function j(e,t){var n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1}function T(e,t,n){var r,i,o=new Array(16),a=0;for(r=1;r<=l;r++)o[r]=a=a+n[r-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=j(o[s]++,s))}}function M(e){var t;for(t=0;t<a;t++)e.dyn_ltree[2*t]=0;for(t=0;t<s;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function O(e){e.bi_valid>8?C(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function A(e,t,n,r){var i=2*t,o=2*n;return e[i]<e[o]||e[i]===e[o]&&r[t]<=r[n]}function L(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&A(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!A(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function P(e,t,n){var r,i,a,s,l=0;if(0!==e.last_lit)do{r=e.pending_buf[e.d_buf+2*l]<<8|e.pending_buf[e.d_buf+2*l+1],i=e.pending_buf[e.l_buf+l],l++,0===r?I(e,i,t):(I(e,(a=m[i])+o+1,t),0!==(s=c[a])&&S(e,i-=b[a],s),I(e,a=E(--r),n),0!==(s=d[a])&&S(e,r-=w[a],s))}while(l<e.last_lit);I(e,256,t)}function z(e,t){var n,r,i,o=t.dyn_tree,a=t.stat_desc.static_tree,s=t.stat_desc.has_stree,c=t.stat_desc.elems,d=-1;for(e.heap_len=0,e.heap_max=573,n=0;n<c;n++)0!==o[2*n]?(e.heap[++e.heap_len]=d=n,e.depth[n]=0):o[2*n+1]=0;for(;e.heap_len<2;)o[2*(i=e.heap[++e.heap_len]=d<2?++d:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=a[2*i+1]);for(t.max_code=d,n=e.heap_len>>1;n>=1;n--)L(e,o,n);i=c;do{n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],L(e,o,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,o[2*i]=o[2*n]+o[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,o[2*n+1]=o[2*r+1]=i,e.heap[1]=i++,L(e,o,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,i,o,a,s,c=t.dyn_tree,d=t.max_code,u=t.stat_desc.static_tree,h=t.stat_desc.has_stree,p=t.stat_desc.extra_bits,g=t.stat_desc.extra_base,f=t.stat_desc.max_length,m=0;for(o=0;o<=l;o++)e.bl_count[o]=0;for(c[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n<573;n++)(o=c[2*c[2*(r=e.heap[n])+1]+1]+1)>f&&(o=f,m++),c[2*r+1]=o,r>d||(e.bl_count[o]++,a=0,r>=g&&(a=p[r-g]),s=c[2*r],e.opt_len+=s*(o+a),h&&(e.static_len+=s*(u[2*r+1]+a)));if(0!==m){do{for(o=f-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[f]--,m-=2}while(m>0);for(o=f;0!==o;o--)for(r=e.bl_count[o];0!==r;)(i=e.heap[--n])>d||(c[2*i+1]!==o&&(e.opt_len+=(o-c[2*i+1])*c[2*i],c[2*i+1]=o),r--)}}(e,t),T(o,d,e.bl_count)}function D(e,t,n){var r,i,o=-1,a=t[1],s=0,l=7,c=4;for(0===a&&(l=138,c=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=a,a=t[2*(r+1)+1],++s<l&&i===a||(s<c?e.bl_tree[2*i]+=s:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,o=i,0===a?(l=138,c=3):i===a?(l=6,c=3):(l=7,c=4))}function R(e,t,n){var r,i,o=-1,a=t[1],s=0,l=7,c=4;for(0===a&&(l=138,c=3),r=0;r<=n;r++)if(i=a,a=t[2*(r+1)+1],!(++s<l&&i===a)){if(s<c)do{I(e,i,e.bl_tree)}while(0!=--s);else 0!==i?(i!==o&&(I(e,i,e.bl_tree),s--),I(e,16,e.bl_tree),S(e,s-3,2)):s<=10?(I(e,17,e.bl_tree),S(e,s-3,3)):(I(e,18,e.bl_tree),S(e,s-11,7));s=0,o=i,0===a?(l=138,c=3):i===a?(l=6,c=3):(l=7,c=4)}}i(w);var B=!1;function N(e,t,n,i){S(e,0+(i?1:0),3),function(e,t,n,i){O(e),i&&(C(e,n),C(e,~n)),r.arraySet(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}(e,t,n,!0)}t._tr_init=function(e){B||(!function(){var e,t,n,r,i,o=new Array(16);for(n=0,r=0;r<28;r++)for(b[r]=n,e=0;e<1<<c[r];e++)m[n++]=r;for(m[n-1]=r,i=0,r=0;r<16;r++)for(w[r]=i,e=0;e<1<<d[r];e++)f[i++]=r;for(i>>=7;r<s;r++)for(w[r]=i<<7,e=0;e<1<<d[r]-7;e++)f[256+i++]=r;for(t=0;t<=l;t++)o[t]=0;for(e=0;e<=143;)p[2*e+1]=8,e++,o[8]++;for(;e<=255;)p[2*e+1]=9,e++,o[9]++;for(;e<=279;)p[2*e+1]=7,e++,o[7]++;for(;e<=287;)p[2*e+1]=8,e++,o[8]++;for(T(p,287,o),e=0;e<s;e++)g[2*e+1]=5,g[2*e]=j(e,5);v=new _(p,c,257,a,l),y=new _(g,d,0,s,l),x=new _(new Array(0),u,0,19,7)}(),B=!0),e.l_desc=new k(e.dyn_ltree,v),e.d_desc=new k(e.dyn_dtree,y),e.bl_desc=new k(e.bl_tree,x),e.bi_buf=0,e.bi_valid=0,M(e)},t._tr_stored_block=N,t._tr_flush_block=function(e,t,n,r){var i,a,s=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<o;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),z(e,e.l_desc),z(e,e.d_desc),s=function(e){var t;for(D(e,e.dyn_ltree,e.l_desc.max_code),D(e,e.dyn_dtree,e.d_desc.max_code),z(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*h[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(a=e.static_len+3+7>>>3)<=i&&(i=a)):i=a=n+5,n+4<=i&&-1!==t?N(e,t,n,r):4===e.strategy||a===i?(S(e,2+(r?1:0),3),P(e,p,g)):(S(e,4+(r?1:0),3),function(e,t,n,r){var i;for(S(e,t-257,5),S(e,n-1,5),S(e,r-4,4),i=0;i<r;i++)S(e,e.bl_tree[2*h[i]+1],3);R(e,e.dyn_ltree,t-1),R(e,e.dyn_dtree,n-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),P(e,e.dyn_ltree,e.dyn_dtree)),M(e),r&&O(e)},t._tr_tally=function(e,t,n){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(m[n]+o+1)]++,e.dyn_dtree[2*E(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){S(e,2,3),I(e,256,p),function(e){16===e.bi_valid?(C(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},249:e=>{"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},9066:e=>{e.exports=function(e){e.data&&e.name&&(e=e.data);for(var t=!0,n="",r="",i=0;i<e.length;i++){var o=e[i];if(t)o?r+=String.fromCharCode(o):t=!1;else{if(!o)throw new Error("Invalid NULL character found. 0x00 character is not permitted in tEXt content");n+=String.fromCharCode(o)}}return{keyword:r,text:n}}},9686:e=>{e.exports=function(e,t){if(e=String(e),t=String(t),!/^[\x00-\xFF]+$/.test(e)||!/^[\x00-\xFF]+$/.test(t))throw new Error("Only Latin-1 characters are permitted in PNG tEXt chunks. You might want to consider base64 encoding and/or zEXt compression");if(e.length>=80)throw new Error('Keyword "'+e+'" is longer than the 79-character limit imposed by the PNG specification');for(var n,r=e.length+t.length+1,i=new Uint8Array(r),o=0,a=0;a<e.length;a++){if(!(n=e.charCodeAt(a)))throw new Error("0x00 character is not permitted in tEXt keywords");i[o++]=n}i[o++]=0;for(var s=0;s<t.length;s++){if(!(n=t.charCodeAt(s)))throw new Error("0x00 character is not permitted in tEXt content");i[o++]=n}return{name:"tEXt",data:i}}},1194:(e,t,n)=>{t.encode=n(9686),t.decode=n(9066)},3434:(e,t,n)=>{var r=n(5714),i=n(6233);e.exports=function(e){var t,n=8,l=n;for(t=0;t<e.length;t++)n+=e[t].data.length,n+=12;var c=new Uint8Array(n);for(c[0]=137,c[1]=80,c[2]=78,c[3]=71,c[4]=13,c[5]=10,c[6]=26,c[7]=10,t=0;t<e.length;t++){var d=e[t],u=d.name,h=d.data,p=h.length,g=[u.charCodeAt(0),u.charCodeAt(1),u.charCodeAt(2),u.charCodeAt(3)];s[0]=p,c[l++]=o[3],c[l++]=o[2],c[l++]=o[1],c[l++]=o[0],c[l++]=g[0],c[l++]=g[1],c[l++]=g[2],c[l++]=g[3];for(var f=0;f<p;)c[l++]=h[f++];var m=g.concat(r(h)),b=i.buf(m);a[0]=b,c[l++]=o[3],c[l++]=o[2],c[l++]=o[1],c[l++]=o[0]}return c};var o=new Uint8Array(4),a=new Int32Array(o.buffer),s=new Uint32Array(o.buffer)},2983:(e,t,n)=>{var r=n(6233);e.exports=function(e){if(137!==e[0])throw new Error("Invalid .png file header");if(80!==e[1])throw new Error("Invalid .png file header");if(78!==e[2])throw new Error("Invalid .png file header");if(71!==e[3])throw new Error("Invalid .png file header");if(13!==e[4])throw new Error("Invalid .png file header: possibly caused by DOS-Unix line ending conversion?");if(10!==e[5])throw new Error("Invalid .png file header: possibly caused by DOS-Unix line ending conversion?");if(26!==e[6])throw new Error("Invalid .png file header");if(10!==e[7])throw new Error("Invalid .png file header: possibly caused by DOS-Unix line ending conversion?");var t=!1,n=[],s=8;for(;s<e.length;){i[3]=e[s++],i[2]=e[s++],i[1]=e[s++],i[0]=e[s++];var l=a[0]+4,c=new Uint8Array(l);c[0]=e[s++],c[1]=e[s++],c[2]=e[s++],c[3]=e[s++];var d=String.fromCharCode(c[0])+String.fromCharCode(c[1])+String.fromCharCode(c[2])+String.fromCharCode(c[3]);if(!n.length&&"IHDR"!==d)throw new Error("IHDR header missing");if("IEND"===d){t=!0,n.push({name:d,data:new Uint8Array(0)});break}for(var u=4;u<l;u++)c[u]=e[s++];i[3]=e[s++],i[2]=e[s++],i[1]=e[s++],i[0]=e[s++];var h=o[0];if(r.buf(c)!==h)throw new Error("CRC values for "+d+" header do not match, PNG file is likely corrupted");var p=new Uint8Array(c.buffer.slice(4));n.push({name:d,data:p})}if(!t)throw new Error(".png file ended prematurely: no IEND header was found");return n};var i=new Uint8Array(4),o=new Int32Array(i.buffer),a=new Uint32Array(i.buffer)},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)},5714:e=>{e.exports=function(e,t,n){var r=[],i=e.length;if(0===i)return r;var o=t<0?Math.max(0,t+i):t||0;for(void 0!==n&&(i=n<0?n+i:n);i-- >o;)r[i-o]=e[i];return r}},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:m(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,f=0;function m(e,t){var n,r,i;if(t.singleton){var o=f++;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:2em 4em;min-width:200px;display:flex;flex-direction:column;align-items:center}.excalidraw .layer-ui__library-message .Spinner{margin-bottom:1em}.excalidraw .layer-ui__library-message span{font-size:.8em}.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;flex-direction:column;align-items:center;justify-content:center;pointer-events:none}.LoadingMessage .Spinner{font-size:2.8em}.LoadingMessage .LoadingMessage-text{margin-top:1em;font-size:.8em}",""]);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:()=>f,$C:()=>m,ut:()=>b,C6:()=>v,_D:()=>y,n5:()=>x,rk:()=>w,Hg:()=>_,hs:()=>k,k:()=>E,LO:()=>C,r8:()=>S,pb:()=>I,LL:()=>j,Gj:()=>T,nM:()=>M,Lg:()=>O,HM:()=>A,V4:()=>L,sA:()=>P,EH:()=>z,ZF:()=>D,UO:()=>R,ah:()=>B,cW:()=>N,kV:()=>H,sS:()=>F,Yx:()=>U,zK:()=>W,ZB:()=>K,qy:()=>V,h6:()=>G,jo:()=>Y,$n:()=>Z,hR:()=>X,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 f={TEST:"test",DEVELOPMENT:"development"},m={SHAPE_ACTIONS_MENU:"App-menu__left"},b={Virgil:1,Helvetica:2,Cascadia:3},v={LIGHT:"light",DARK:"dark"},y="Segoe UI Emoji",x=20,w=b.Virgil,_="left",k="top",E=20,C={excalidraw:"application/vnd.excalidraw+json",excalidrawlib:"application/vnd.excalidrawlib+json",json:"application/json",svg:"image/svg+xml","excalidraw.svg":"image/svg+xml",png:"image/png","excalidraw.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,A=100,L=.1,P=300,z={VIEW:"viewMode",ZEN:"zenMode",GRID:"gridMode"},D=i().themeFilter,R={addLibrary:"addLibrary"},B={addLibrary:"addLibrary"},N={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,theme:!0,saveAsImage:!0}},H=800,F=1e3,U=500,W=2,K=[1,2,3],V=10,G=1440,Y=[C.png,C.jpg,C.svg,C.gif],Z=2097152,X="http://www.w3.org/2000/svg",q={excalidraw:2,excalidrawLibrary:2},$=5,Q={TOP:"top",MIDDLE:"middle",BOTTOM:"bottom"},J=20},673:(e,t,n)=>{"use strict";n.r(t),n.d(t,{decodePngMetadata:()=>v,decodeSvgMetadata:()=>x,encodePngMetadata:()=>b,encodeSvgMetadata:()=>y,getTEXtChunk:()=>m});var r=n(2983),i=n.n(r),o=n(1194),a=n(3434),s=n.n(a),l=n(2744),c=n(8288);const d=e=>new Promise(((t,n)=>{const r="string"==typeof e?new Blob([(new TextEncoder).encode(e)]):new Blob([e instanceof Uint8Array?e:new Uint8Array(e)]),i=new FileReader;i.onload=e=>{if(!e.target||"string"!=typeof e.target.result)return n(new Error("couldn't convert to byte string"));t(e.target.result)},i.readAsBinaryString(r)})),u=e=>{const t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let t=0,r=e.length;t<r;t++)n[t]=e.charCodeAt(t);return t},h=e=>new TextDecoder("utf-8").decode(u(e)),p=async e=>{let t,{text:n,compress:r}=e;if(!1!==r)try{t=await d((0,l.deflate)(n))}catch(e){console.error("encode: cannot deflate",e)}return{version:"1",encoding:"bstring",compressed:!!t,encoded:t||await d(n)}},g=async e=>{let t;if("bstring"!==e.encoding)throw new Error('decode: unknown encoding "'.concat(e.encoding,'"'));return t=e.compressed?e.encoded:await h(e.encoded),e.compressed?(0,l.inflate)(new Uint8Array(u(t)),{to:"string"}):t};const f=e=>"arrayBuffer"in e?e.arrayBuffer():new Promise(((t,n)=>{const r=new FileReader;r.onload=e=>{var r;if(null===(r=e.target)||void 0===r||!r.result)return n(new Error("couldn't convert blob to ArrayBuffer"));t(e.target.result)},r.readAsArrayBuffer(e)})),m=async e=>{const t=i()(new Uint8Array(await f(e))).find((e=>"tEXt"===e.name));return t?o.decode(t.data):null},b=async e=>{let{blob:t,metadata:n}=e;const r=i()(new Uint8Array(await f(t))),a=o.encode(c.LO.excalidraw,JSON.stringify(await p({text:n,compress:!0})));return r.splice(-1,0,a),new Blob([s()(r)],{type:c.LO.png})},v=async e=>{const t=await m(e);if((null==t?void 0:t.keyword)===c.LO.excalidraw)try{const e=JSON.parse(t.text);if(!("encoded"in e)){if("type"in e&&e.type===c.r8.excalidraw)return t.text;throw new Error("FAILED")}return await g(e)}catch(e){throw console.error(e),new Error("FAILED")}throw new Error("INVALID")},y=async e=>{let{text:t}=e;const n=await async function(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?window.btoa(e):window.btoa(await d(e))}(JSON.stringify(await p({text:t})),!0);let r="";return r+="\x3c!-- payload-type:".concat(c.LO.excalidraw," --\x3e"),r+="\x3c!-- payload-version:2 --\x3e",r+="\x3c!-- payload-start --\x3e",r+=n,r+="\x3c!-- payload-end --\x3e",r},x=async e=>{let{svg:t}=e;if(t.includes("payload-type:".concat(c.LO.excalidraw))){const e=t.match(/<!-- payload-start -->\s*(.+?)\s*<!-- payload-end -->/);if(!e)throw new Error("INVALID");const n=t.match(/<!-- payload-version:(\d+) -->/),r="1"!==((null==n?void 0:n[1])||"1");try{const t=await async function(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?window.atob(e):h(window.atob(e))}(e[1],r),n=JSON.parse(t);if(!("encoded"in n)){if("type"in n&&n.type===c.r8.excalidraw)return t;throw new Error("FAILED")}return await g(n)}catch(e){throw console.error(e),new Error("FAILED")}}throw new Error("INVALID")}},5295:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Excalidraw:()=>zg,FONT_FAMILY:()=>o.ut,THEME:()=>o.C6,bumpVersion:()=>Fr,cleanAppStateForExport:()=>_n,clearAppStateForLocalStorage:()=>wn,defaultLang:()=>c,exportToBlob:()=>Up,exportToCanvas:()=>Fp,exportToClipboard:()=>Kp,exportToSvg:()=>Wp,getDefaultAppState:()=>vn,getFreeDrawSvgPath:()=>Ar,getNonDeletedElements:()=>Ol,getSceneVersion:()=>Tl,isInvisiblySmallElement:()=>Ur,isLinearElement:()=>je,jotaiScope:()=>Nh,jotaiStore:()=>Hh,languages:()=>d,libraryItemsAtom:()=>Fh,loadFromBlob:()=>Ed,loadLibraryFromBlob:()=>Cd,mutateElement:()=>Nr,newElementWith:()=>Hr,restore:()=>bd,restoreAppState:()=>md,restoreElements:()=>fd,restoreLibraryItems:()=>yd,serializeAsJSON:()=>Ad,serializeLibraryAsJSON:()=>Dd});n(8336);var r=n(9787),i=n.n(r),o=n(8288);const a=JSON.parse('{"u2":"@dwelle/excalidraw","i8":"0.3.60"}');"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":93,"bg-BG":59,"bn-BD":0,"ca-ES":96,"cs-CZ":23,"da-DK":16,"de-DE":100,"el-GR":83,"en":100,"es-ES":98,"eu-ES":98,"fa-IR":61,"fi-FI":98,"fr-FR":100,"he-IL":77,"hi-IN":61,"hu-HU":96,"id-ID":100,"it-IT":100,"ja-JP":99,"kab-KAB":94,"kk-KZ":22,"ko-KR":69,"lt-LT":23,"lv-LV":100,"mr-IN":100,"my-MM":45,"nb-NO":100,"nl-NL":87,"nn-NO":97,"oc-FR":96,"pa-IN":89,"pl-PL":90,"pt-BR":97,"pt-PT":80,"ro-RO":100,"ru-RU":100,"si-LK":9,"sk-SK":100,"sl-SI":34,"sv-SE":98,"ta-IN":98,"tr-TR":100,"uk-UA":91,"zh-CN":100,"zh-HK":27,"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))},f=()=>h,m=(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=m(p,n)||m(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};n(371);var v=n(4512);const y=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"})})})},x=e=>{let{delay:t}=e;const[n,i]=(0,r.useState)(!!t);return(0,r.useEffect)((()=>{if(!t)return;const e=setTimeout((()=>{i(!1)}),t);return()=>clearTimeout(e)}),[t]),n?null:(0,v.jsxs)("div",{className:"LoadingMessage",children:[(0,v.jsx)("div",{children:(0,v.jsx)(y,{})}),(0,v.jsx)("div",{className:"LoadingMessage-text",children:b("labels.loadingScene")})]})},w=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 _(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)_(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)_(t,i,-n);!function(e,t,n){const r=[];e.forEach((e=>r.push(...e))),_(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(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 S extends C{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 I extends C{fillPolygons(e,t){const n=this._fillPolygons(e,t),r=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),i=this._fillPolygons(e,r);return n.ops=n.ops.concat(i.ops),n}}class j{constructor(e){this.helper=e}fillPolygons(e,t){const n=E(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 T{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 M{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 O={};class A{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 P(e,t){return e.type===t}function z(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(;!P(o,2);){let a=0;const s=[];if("BOD"===r){if("M"!==o.text&&"m"!==o.text)return z("M0,0"+e);i++,a=L[o.text],r=o.text}else P(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(!P(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 R(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){N(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 B(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function N(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,f=0,m=0;if(c)[p,g,f,m]=c;else{[e,t]=B(e,t,-d),[n,r]=B(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,y=h*c*c+b*a*a,x=(s===l?-1:1)*Math.sqrt(Math.abs(v/y));f=x*i*c/o+(e+n)/2,m=x*-o*a/i+(t+r)/2,p=Math.asin(parseFloat(((t-m)/o).toFixed(9))),g=Math.asin(parseFloat(((r-m)/o).toFixed(9))),e<f&&(p=Math.PI-p),n<f&&(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=N(n=f+i*Math.cos(g),r=m+o*Math.sin(g),t,s,i,o,a,0,l,[g,e,f,m])}b=g-p;const v=Math.cos(p),y=Math.sin(p),x=Math.cos(g),w=Math.sin(g),_=Math.tan(b/4),k=4/3*i*_,E=4/3*o*_,C=[e,t],S=[e+k*y,t-E*v],I=[n+k*w,r-E*x],j=[n,r];if(S[0]=2*C[0]-S[0],S[1]=2*C[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=B(h[t][0],h[t][1],d),r=B(h[t+1][0],h[t+1][1],d),i=B(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 H={randOffset:function(e,t){return Q(e,t)},randOffsetWithRange:function(e,t,n){return $(e,t,n)},ellipse:function(e,t,n,r,i){const o=V(n,r,i);return G(e,t,i,o).opset},doubleLineOps:function(e,t,n,r,i){return J(e,t,n,r,i,!0)}};function F(e,t,n,r,i){return{type:"path",ops:J(e,t,n,r,i)}}function U(e,t,n){const r=(e||[]).length;if(r>2){const i=[];for(let t=0;t<r-1;t++)i.push(...J(e[t][0],e[t][1],e[t+1][0],e[t+1][1],n));return t&&i.push(...J(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:"path",ops:i}}return 2===r?F(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:"path",ops:[]}}function W(e,t,n,r,i){return function(e,t){return U(e,!0,t)}([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],i)}function K(e,t){let n=te(e,1*(1+.2*t.roughness),t);if(!t.disableMultiStroke){const r=te(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 V(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.ceil(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+=Q(a*l,n),s+=Q(s*l,n),{increment:o,rx:a,ry:s}}function G(e,t,n,r){const[i,o]=re(r.increment,e,t,r.rx,r.ry,1,r.increment*$(.1,$(.4,1,n),n),n);let a=ne(i,null,n);if(!n.disableMultiStroke&&0!==n.roughness){const[i]=re(r.increment,e,t,r.rx,r.ry,1.5,0,n),o=ne(i,null,n);a=a.concat(o)}return{estimatedPoints:o,opset:{type:"path",ops:a}}}function Y(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+=Q(.01*u,l),h+=Q(.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 f=2*Math.PI/l.curveStepCount,m=Math.min(f/2,(g-p)/2),b=ie(m,c,d,u,h,p,g,1,l);if(!l.disableMultiStroke){const e=ie(m,c,d,u,h,p,g,1.5,l);b.push(...e)}return a&&(s?b.push(...J(c,d,c+u*Math.cos(p),d+h*Math.sin(p),l),...J(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 Z(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]+Q(e,t),r[0][1]+Q(e,t)]});for(let o=1;o<i;o++)n.push({op:"lineTo",data:[r[o][0]+Q(e,t),r[o][1]+Q(e,t)]})}}return{type:"fillPath",ops:n}}function X(e,t){return function(e,t){let n=e.fillStyle||"hachure";if(!O[n])switch(n){case"zigzag":O[n]||(O[n]=new S(t));break;case"cross-hatch":O[n]||(O[n]=new I(t));break;case"dots":O[n]||(O[n]=new j(t));break;case"dashed":O[n]||(O[n]=new T(t));break;case"zigzag-line":O[n]||(O[n]=new M(t));break;default:n="hachure",O[n]||(O[n]=new C(t))}return O[n]}(t,H).fillPolygons(e,t)}function q(e){return e.randomizer||(e.randomizer=new A(e.seed||0)),e.randomizer.next()}function $(e,t,n,r=1){return n.roughness*r*(q(n)*(t-e)+e)}function Q(e,t,n=1){return $(-e,e,t,n)}function J(e,t,n,r,i,o=!1){const a=o?i.disableMultiStrokeFill:i.disableMultiStroke,s=ee(e,t,n,r,i,!0,!1);if(a)return s;const l=ee(e,t,n,r,i,!0,!0);return s.concat(l)}function ee(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*q(i);let p=i.bowing*i.maxRandomnessOffset*(r-t)/200,g=i.bowing*i.maxRandomnessOffset*(e-n)/200;p=Q(p,i,c),g=Q(g,i,c);const f=[],m=()=>Q(u,i,c),b=()=>Q(d,i,c),v=i.preserveVertices;return o&&(a?f.push({op:"move",data:[e+(v?0:m()),t+(v?0:m())]}):f.push({op:"move",data:[e+(v?0:Q(d,i,c)),t+(v?0:Q(d,i,c))]})),a?f.push({op:"bcurveTo",data:[p+e+(n-e)*h+m(),g+t+(r-t)*h+m(),p+e+2*(n-e)*h+m(),g+t+2*(r-t)*h+m(),n+(v?0:m()),r+(v?0:m())]}):f.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())]}),f}function te(e,t,n){const r=[];r.push([e[0][0]+Q(t,n),e[0][1]+Q(t,n)]),r.push([e[0][0]+Q(t,n),e[0][1]+Q(t,n)]);for(let i=1;i<e.length;i++)r.push([e[i][0]+Q(t,n),e[i][1]+Q(t,n)]),i===e.length-1&&r.push([e[i][0]+Q(t,n),e[i][1]+Q(t,n)]);return ne(r,null,n)}function ne(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]+Q(e,n),t[1]+Q(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(...J(e[0][0],e[0][1],e[1][0],e[1][1],n));return i}function re(e,t,n,r,i,o,a,s){const l=[],c=[];if(0===s.roughness){e/=4,c.push([t+r*Math.cos(-e),n+i*Math.sin(-e)]);for(let o=0;o<=2*Math.PI;o+=e){const e=[t+r*Math.cos(o),n+i*Math.sin(o)];l.push(e),c.push(e)}c.push([t+r*Math.cos(0),n+i*Math.sin(0)]),c.push([t+r*Math.cos(e),n+i*Math.sin(e)])}else{const d=Q(.5,s)-Math.PI/2;c.push([Q(o,s)+t+.9*r*Math.cos(d-e),Q(o,s)+n+.9*i*Math.sin(d-e)]);const u=2*Math.PI+d-.01;for(let a=d;a<u;a+=e){const e=[Q(o,s)+t+r*Math.cos(a),Q(o,s)+n+i*Math.sin(a)];l.push(e),c.push(e)}c.push([Q(o,s)+t+r*Math.cos(d+2*Math.PI+.5*a),Q(o,s)+n+i*Math.sin(d+2*Math.PI+.5*a)]),c.push([Q(o,s)+t+.98*r*Math.cos(d+a),Q(o,s)+n+.98*i*Math.sin(d+a)]),c.push([Q(o,s)+t+.9*r*Math.cos(d+.5*a),Q(o,s)+n+.9*i*Math.sin(d+.5*a)])}return[c,l]}function ie(e,t,n,r,i,o,a,s,l){const c=o+Q(.1,l),d=[];d.push([Q(s,l)+t+.9*r*Math.cos(c-e),Q(s,l)+n+.9*i*Math.sin(c-e)]);for(let o=c;o<=a;o+=e)d.push([Q(s,l)+t+r*Math.cos(o),Q(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)]),ne(d,null,l)}function oe(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:Q(c[0],s)),a[1]+(h?0:Q(c[0],s))]}),d=h?[i,o]:[i+Q(c[p],s),o+Q(c[p],s)],l.push({op:"bcurveTo",data:[e+Q(c[p],s),t+Q(c[p],s),n+Q(c[p],s),r+Q(c[p],s),d[0],d[1]]});return l}function ae(e){return[...e]}function se(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function le(e,t,n){const r=se(t,n);if(0===r)return se(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)),se(e,ce(t,n,i))}function ce(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function de(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(se(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=ce(o,a,r),d=ce(a,s,r),u=ce(s,l,r),h=ce(c,d,r),p=ce(d,u,r),g=ce(h,p,r);de([o,c,h,g],0,n,i),de([g,p,u,l],0,n,i)}var o,a;return i}function ue(e,t){return he(e,0,e.length,t)}function he(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=le(e[r],a,s);t>l&&(l=t,c=r)}return Math.sqrt(l)>r?(he(e,t,c+1,r,o),he(e,c,n,r,o)):(o.length||o.push(a),o.push(s)),o}function pe(e,t=.15,n){const r=[],i=(e.length-1)/3;for(let n=0;n<i;n++){de(e,3*n,t,r)}return n&&n>0?he(r,0,r.length,n):r}const ge="none";class fe{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",[F(e,t,n,r,o)],o)}rectangle(e,t,n,r,i){const o=this._o(i),a=[],s=W(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(Z([i],o)):a.push(X([i],o))}return o.stroke!==ge&&a.push(s),this._d("rectangle",a,o)}ellipse(e,t,n,r,i){const o=this._o(i),a=[],s=V(n,r,o),l=G(e,t,o,s);if(o.fill)if("solid"===o.fillStyle){const n=G(e,t,o,s).opset;n.type="fillPath",a.push(n)}else a.push(X([l.estimatedPoints],o));return o.stroke!==ge&&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",[U(e,!1,n)],n)}arc(e,t,n,r,i,o,a=!1,s){const l=this._o(s),c=[],d=Y(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=Y(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+=Q(.01*c,a),d+=Q(.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!==ge&&c.push(d),this._d("arc",c,l)}curve(e,t){const n=this._o(t),r=[],i=K(e,n);if(n.fill&&n.fill!==ge&&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(ae(e[0]),ae(e[1]),ae(e[2]),ae(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(ae(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=pe(t,10,(1+n.roughness)/2);"solid"===n.fillStyle?r.push(Z([i],n)):r.push(X([i],n))}return n.stroke!==ge&&r.push(i),this._d("curve",r,n)}polygon(e,t){const n=this._o(t),r=[],i=U(e,!0,n);return n.fill&&("solid"===n.fillStyle?r.push(Z([e],n)):r.push(X([e],n))),n.stroke!==ge&&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!==ge,o=n.stroke!==ge,a=!!(n.simplification&&n.simplification<1),s=function(e,t,n){const r=R(D(z(e))),i=[];let o=[],a=[0,0],s=[];const l=()=>{s.length>=4&&o.push(...pe(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=ue(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(Z(s,n)):r.push(X(s,n))),o&&(a?s.forEach((e=>{r.push(U(e,!1,n))})):r.push(function(e,t){const n=R(D(z(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:Q(e,t))))}),o=[a[0],a[1]],i=[a[0],a[1]];break}case"L":r.push(...J(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(...oe(e,n,i,s,l,c,o,t)),o=[l,c];break}case"Z":r.push(...J(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:ge};break;case"fillPath":t={d:this.opsToPath(e),stroke:ge,strokeWidth:0,fill:n.fill||ge};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||ge,strokeWidth:n,fill:ge}}}class me{constructor(e,t){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new fe(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 be="http://www.w3.org/2000/svg";class ve{constructor(e,t){this.svg=e,this.gen=new fe(t)}draw(e){const t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.svg.ownerDocument||window.document,i=r.createElementNS(be,"g"),o=e.options.fixedDecimalPlaceDigits;for(const a of t){let t=null;switch(a.type){case"path":t=r.createElementNS(be,"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(be,"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(be,"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 ye={canvas:(e,t)=>new me(e,t),svg:(e,t)=>new ve(e,t),generator:e=>new fe(e),newSeed:()=>fe.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 we(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=xe(e))&&(r&&(r+=" "),r+=t);return r}let _e=(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,Ce=e=>null!=e&&"text"===e.type,Se=e=>null!=e&&Ie(e.type),Ie=e=>"freedraw"===e,je=e=>null!=e&&Te(e.type),Te=e=>"arrow"===e||"line"===e,Me=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return null!=e&&(!e.locked||!0===t)&&Oe(e.type)},Oe=e=>"arrow"===e,Ae=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!(null==e||e.locked&&!0!==t||"rectangle"!==e.type&&"diamond"!==e.type&&"ellipse"!==e.type&&"image"!==e.type&&("text"!==e.type||e.containerId))},Le=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!(null==e||e.locked&&!0!==t||"rectangle"!==e.type&&"diamond"!==e.type&&"ellipse"!==e.type&&"image"!==e.type)},Pe=e=>{var t;return Ae(e)&&!(null===(t=e.boundElements)||void 0===t||!t.some((e=>{let{type:t}=e;return"text"===t})))},ze=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],Re=(e,t,n)=>De(e[0],e[1],t[0],t[1],n),Be=(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]},Ne=(e,t,n,r)=>{const i=n-e,o=r-t;return Math.hypot(i,o)},He=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 Ne(n[0],n[1],r[0],r[1])<=o.qx/t}return!1},Fe=(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(Ke(n,s,o,i)){if(0===We(n,o,s))return Ue(n,o,s);a++}}return a%2==1},Ue=(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]),We=(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},Ke=(e,t,n,r)=>{const i=We(e,t,n),o=We(e,t,r),a=We(n,r,e),s=We(n,r,t);return i!==o&&a!==s||(!(0!==i||!Ue(e,n,t))||(!(0!==o||!Ue(e,r,t))||(!(0!==a||!Ue(n,e,r))||!(0!==s||!Ue(n,t,r)))))},Ve=(e,t,n)=>n?[Math.round(e/n)*n,Math.round(t/n)*n]:[e,t],Ge=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)}},Ye=(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))))},Ze=e=>Se(e)?Qe(e):je(e)?Je(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},qe=(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]},$e=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]},Qe=e=>{const[t,n,r,i]=$e(e.points);return[t+e.x,n+e.y,r+e.x,i+e.y]},Je=e=>{let t;if(e.points.length<2||!xr(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=xr(e),r=Xe(n[0]),[i,o,a,s]=qe(r);t=[i+e.x,o+e.y,a+e.x,s+e.y]}return t},et=e=>{let t;const[n,r,i,o]=Ze(e),a=(n+i)/2,s=(r+o)/2;if(Se(e)){const[t,n,r,i]=$e(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||!xr(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=xr(e),i=Xe(r[0]);return qe(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,f]=De(i,s,a,s,e.angle);t=[Math.min(l,d,h,g),Math.min(c,u,p,f),Math.max(l,d,h,g),Math.max(c,u,p,f)]}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,f]=De(i,r,a,s,e.angle);t=[Math.min(l,d,h,g),Math.min(c,u,p,f),Math.max(l,d,h,g),Math.max(c,u,p,f)]}return t},tt=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]=et(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]},nt=(e,t,n)=>{if(!je(e)&&!Se(e))return[e.x,e.y,e.x+t,e.y+n];const r=Ye(0,t,Ye(1,n,e.points));let i;if(Se(e))i=$e(r);else{const t=ye.generator(),n="sharp"===e.strokeSharpness?t.linearPath(r,kr(e)):t.curve(r,kr(e)),o=Xe(n);i=qe(o)}const[o,a,s,l]=i;return[o+e.x,a+e.y,s+e.x,l+e.y]},rt=(e,t,n)=>{const r=ye.generator(),i="sharp"===n?r.linearPath(t,kr(e)):r.curve(t,kr(e)),o=Xe(i),[a,s,l,c]=qe(o);return[a+e.x,s+e.y,l+e.x,c+e.y]},it=e=>{const[t,n,r,i]=tt(e);return{minX:t,minY:n,maxX:r,maxY:i,width:r-t,height:i-n,midX:(t+r)/2,midY:(n+i)/2}},ot=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"]}'),at=e=>[ot.red[e],ot.pink[e],ot.grape[e],ot.violet[e],ot.indigo[e],ot.blue[e],ot.cyan[e],ot.teal[e],ot.green[e],ot.lime[e],ot.yellow[e],ot.orange[e]],st={canvasBackground:[ot.white,ot.gray[0],ot.gray[1],...at(0)],elementBackground:["transparent",ot.gray[4],ot.gray[6],...at(6)],elementStroke:[ot.black,ot.gray[8],ot.gray[7],...at(9)]};var lt=n(5156);const ct=/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),dt=/^Win/.test(window.navigator.platform),ut=/\b(android)\b/i.test(navigator.userAgent),ht="Equal",pt="Minus",gt="NumpadAdd",ft="NumpadSubtract",mt="Numpad0",bt="BracketRight",vt="BracketLeft",yt="Digit1",xt="Digit2",wt="Quote",_t="Digit0",kt="Slash",Et="KeyC",Ct="KeyD",St="KeyG",It="KeyF",jt="KeyH",Tt="KeyV",Mt="KeyX",Ot="KeyZ",At="KeyR",Lt={ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",BACKSPACE:"Backspace",ALT:"Alt",CTRL_OR_CMD:ct?"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"},Pt=e=>e===Lt.ARROW_LEFT||e===Lt.ARROW_RIGHT||e===Lt.ARROW_DOWN||e===Lt.ARROW_UP,zt=e=>e.altKey,Dt=e=>e.shiftKey,Rt=e=>e.shiftKey;let Bt=null;const Nt=()=>{if(Bt)return Bt;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)},Ht=e=>e.charAt(0).toUpperCase()+e.slice(1),Ft=e=>e instanceof HTMLElement&&"wysiwyg"===e.dataset.type||e instanceof HTMLBRElement||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&("text"===e.type||"number"===e.type),Ut=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},Wt=e=>{let{fontSize:t,fontFamily:n}=e;return"".concat(t,"px ").concat(Ut({fontFamily:n}))},Kt=(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},Vt=(e,t)=>Math.abs(e-t),Gt=e=>{e&&(e.style.cursor="")},Yt=(e,t)=>{e&&(e.style.cursor=t)};let Zt,Xt;const qt=(e,t)=>{Zt&&Zt.theme===t||(()=>{const e=t===o.C6.DARK;Zt=document.createElement("canvas"),Zt.theme=t,Zt.height=20,Zt.width=20;const n=Zt.getContext("2d");n.lineWidth=1,n.beginPath(),n.arc(Zt.width/2,Zt.height/2,5,0,2*Math.PI),n.fillStyle=e?ot.black:ot.white,n.fill(),n.strokeStyle=e?ot.white:ot.black,n.stroke(),Xt=Zt.toDataURL(o.LO.svg)})(),Yt(e,"url(".concat(Xt,") ").concat(10," ").concat(10,", auto"))},$t=(e,t)=>{e&&("selection"===t.activeTool.type?Gt(e):"eraser"===t.activeTool.type?qt(e,t.theme):"image"!==t.activeTool.type&&(e.style.cursor=o.oc.CROSSHAIR))},Qt=()=>{var e;return"HTML"===(null===(e=document.fullscreenElement)||void 0===e?void 0:e.nodeName)},Jt=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"),ct?e.replace(/\bCtrlOrCmd\b/i,"Cmd").replace(/\bAlt\b/i,"Option"):e.replace(/\bCtrlOrCmd\b/i,"Ctrl")),en=(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}},tn=(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}},nn=e=>getComputedStyle(document.documentElement).getPropertyValue("--".concat(e)),rn=new RegExp("^[^".concat("A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-﷾--","]*[").concat("֑-߿יִ-﷽ﹰ-ﻼ","]")),on=e=>rn.test(e),an=e=>{const[t,n]=e;return{x:t,y:n}},sn=e=>{if("AbortError"!==(null==e?void 0:e.name))throw e;console.warn(e)},ln=e=>{const t=5===e.length&&"0"===e.substr(4,1),n=9===e.length&&"00"===e.substr(7,2);return t||n||e===st.elementBackground[0]},cn=e=>t=>{(0,lt.unstable_batchedUpdates)(e,t)},dn=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,lt.unstable_batchedUpdates)(e,t)})),un=()=>pn()?1:Date.now(),hn=e=>e.reduce(((e,t)=>(e.set("string"==typeof t?t:t.id,t),e)),new Map),pn=()=>{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)},gn=(e,t)=>new CustomEvent(e,{detail:{nativeEvent:t},cancelable:!0}),fn=(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=e=>!!e&&"object"==typeof e&&"then"in e&&"catch"in e&&"finally"in e,bn=o.ZB.includes(devicePixelRatio)?devicePixelRatio:1,vn=()=>({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:ot.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:bn,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(Nt()),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:ot.white,zenModeEnabled:!1,zoom:{value:1},viewModeEnabled:!1,pendingImageElement:null,showHyperlinkPopup:!1}),yn={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}},xn=(e,t)=>{const n={};for(const r of Object.keys(e)){const i=yn[r];if(null!=i&&i[t]){const t=e[r];n[r]=t}}return n},wn=e=>xn(e,"browser"),_n=e=>xn(e,"export"),kn=e=>xn(e,"server"),En=e=>{let{activeTool:t}=e;return"eraser"===t.type};function Cn(e,t,n,r=(e=>e)){return e*r(.5-t*(.5-n))}function Sn(e,t){return[e[0]+t[0],e[1]+t[1]]}function In(e,t){return[e[0]-t[0],e[1]-t[1]]}function jn(e,t){return[e[0]*t,e[1]*t]}function Tn(e){return[e[1],-e[0]]}function Mn(e,t){return e[0]*t[0]+e[1]*t[1]}function On(e,t){return e[0]===t[0]&&e[1]===t[1]}function An(e,t){return function(e){return e[0]*e[0]+e[1]*e[1]}(In(e,t))}function Ln(e){return function(e,t){return[e[0]/t,e[1]/t]}(e,function(e){return Math.hypot(e[0],e[1])}(e))}function Pn(e,t){return Math.hypot(e[1]-t[1],e[0]-t[0])}function zn(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 Dn(e,t,n){return Sn(e,jn(In(t,e),n))}function Rn(e,t,n){return Sn(e,jn(t,n))}var{min:Bn,PI:Nn}=Math,Hn=Nn+1e-4;function Fn(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:f=(e=>--e*e*e+1)}=l;if(0===e.length||n<=0)return[];let m,b=e[e.length-1].runningLength,v=Math.pow(n*r,2),y=[],x=[],w=e.slice(0,10).reduce(((e,t)=>{let r=t.pressure;if(o){let i=Bn(1,t.distance/n),o=Bn(1,1-i);r=Bn(1,e+.275*i*(o-e))}return(e+r)/2}),e[0].pressure),_=Cn(n,i,e[e.length-1].pressure,a),k=e[0].vector,E=e[0].point,C=E,S=E,I=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=Bn(1,c/n),t=Bn(1,1-e);r=Bn(1,w+.275*e*(t-w))}_=Cn(n,i,r,a)}else _=n/2;void 0===m&&(m=_);let p=d<u?h(d/u):1,j=b-d<g?f((b-d)/g):1;if(_=Math.max(.01,_*Math.min(p,j)),t===e.length-1){let e=jn(Tn(l),_);y.push(In(s,e)),x.push(Sn(s,e));continue}let T=e[t+1].vector,M=Mn(l,T);if(M<0){let e=jn(Tn(k),_);for(let t=1/13,n=0;n<=1;n+=t)S=zn(In(s,e),s,Hn*n),y.push(S),I=zn(Sn(s,e),s,Hn*-n),x.push(I);E=S,C=I;continue}let O=jn(Tn(Dn(T,l,M)),_);S=In(s,O),(t<=1||An(E,S)>v)&&(y.push(S),E=S),I=Sn(s,O),(t<=1||An(C,I)>v)&&(x.push(I),C=I),w=r,k=l}let j=e[0].point.slice(0,2),T=e.length>1?e[e.length-1].point.slice(0,2):Sn(e[0].point,[1,1]),M=[],O=[];if(1===e.length){if(!u&&!g||c){let e=Rn(j,Ln(Tn(In(j,T))),-(m||_)),t=[];for(let n=1/13,r=n;r<=1;r+=n)t.push(zn(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=zn(x[0],j,Hn*t);M.push(e)}else{let e=In(y[0],x[0]),t=jn(e,.5),n=jn(e,.51);M.push(In(j,t),In(j,n),Sn(j,n),Sn(j,t))}let t=Tn(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=Rn(T,t,_);for(let t=1/29,n=t;n<1;n+=t)O.push(zn(e,T,3*Hn*n))}else O.push(Sn(T,jn(t,_)),Sn(T,jn(t,.99*_)),In(T,jn(t,.99*_)),In(T,jn(t,_)))}return y.concat(O,x.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(Dn(s[0],e,t/4))}1===s.length&&(s=[...s,[...Sn(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):Dn(u.point,s[e],a);if(On(u.point,t))continue;let n=Pn(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:Ln(In(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 Un=e=>"string"==typeof e;class Wn{constructor(){this.callbacks=new Set,this.nonDeletedElements=[],this.elements=[],this.elementsMap=new Map}static mapElementToScene(e,t){Un(e)?this.sceneMapById.set(e,t):this.sceneMapByElement.set(e,t)}static getScene(e){return Un(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&&Al(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),Wn.mapElementToScene(e,this)})),this.nonDeletedElements=Ol(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(){Wn.sceneMapById.forEach(((e,t)=>{e===this&&Wn.sceneMapById.delete(t)})),this.callbacks.clear()}}Wn.sceneMapByElement=new WeakMap,Wn.sceneMapById=new Map;const Kn=Wn,Vn=(e,t)=>{const n=t?t.width-2*o.gK:void 0;let r=e.text;t&&(r=er(e.originalText,Wt(e),t.width));const i=Zn(e.originalText,Wt(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)),Nr(t,{height:n})}Nr(e,{width:i.width,height:i.height,baseline:i.baseline,y:a,x:s,text:r})},Gn=(e,t,n)=>{const r=hn(e);t.forEach((e=>{const t=n.get(e.id),i=or(e);if(i){const a=n.get(i);if(a){const n=r.get(t);var o;if(n)Nr(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)&&Nr(i,{containerId:n?t:null})}}}))},Yn=(e,t)=>{const n=or(e);if(n){const r=Kn.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=er(r.originalText,Wt(r),e.width));const t=Zn(i,Wt(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;Nr(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,Nr(r,{text:i,width:e.width-2*o.gK,height:a,x:e.x+o.gK,y:n,baseline:l})}}},Zn=(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=$n(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}},Xn="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".toLocaleUpperCase(),qn={},$n=e=>(qn[e]||(qn[e]=Zn(Xn,e,null).height),qn[e]);let Qn;const Jn=(e,t)=>{Qn||(Qn=document.createElement("canvas"));const n=Qn.getContext("2d");n.font=t;const r=n.measureText(e);return pn()?10*r.width:r.width},er=(e,t,n)=>{const r=n-2*o.gK,i=[],a=e.split("\n"),s=Jn(" ",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(Jn(n[a],t)>=r){for(e&&i.push(e),e="",o=0;n[a].length>0;){const s=n[a][0],l=tr.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=Jn(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")},tr=(()=>{const e={};return{calculate:(t,n)=>{const r=t.charCodeAt(0);if(e[n]||(e[n]=[]),!e[n][r]){const i=Jn(t,n);e[n][r]=i}return e[n][r]},getCache:t=>e[t]}})(),nr=e=>{const t=ir(e);return 0===t?Zn(Xn.split("").join("\n"),e).width+2*o.gK:t+2*o.gK},rr=e=>$n(e)+2*o.gK,ir=e=>{const t=tr.getCache(e);if(!t)return 0;const n=t.filter((e=>void 0!==e));return Math.max(...n)},or=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},ar=e=>{if(!e)return null;const t=or(e);var n;return t&&(null===(n=Kn.getScene(e))||void 0===n?void 0:n.getElement(t))||null},sr=e=>{return e&&e.containerId&&(null===(t=Kn.getScene(e))||void 0===t?void 0:t.getElement(e.containerId))||null;var t},lr="invert(100%) hue-rotate(180deg) saturate(1.25)",cr=vn(),dr=(e,t)=>ke(e)&&!t.imageCache.has(e.fileId),ur=(e,t)=>{var n;return"dark"===t.theme&&ke(e)&&!dr(e,t)&&(null===(n=t.imageCache.get(e.fileId))||void 0===n?void 0:n.mimeType)!==o.LO.svg},hr=e=>[8,8+e],pr=e=>[1.5,6+e],gr=e=>"freedraw"===e.type?12*e.strokeWidth:20,fr=document.createElement("img");fr.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 mr=document.createElement("img");mr.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 br=(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(xr(e));break;case"arrow":case"line":n.lineJoin="round",n.lineCap="round",xr(e).forEach((e=>{t.draw(e)}));break;case"freedraw":{n.save(),n.fillStyle=e.strokeColor;const r=function(e){return Mr.get(e)}(e),i=xr(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?mr:fr,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=on(e.text),r=t&&!n.canvas.isConnected;r&&document.body.appendChild(n.canvas),n.canvas.setAttribute("dir",t?"rtl":"ltr"),n.save(),n.font=Wt(e),n.fillStyle=e.strokeColor,n.textAlign=e.textAlign;const i=e.text.replace(/\r\n?/g,"\n").split("\n"),a=e.containerId?$n(Wt(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 vr=new WeakMap,yr=new WeakMap;const xr=e=>yr.get(e),wr=(e,t)=>yr.set(e,t),_r=e=>yr.delete(e),kr=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n={seed:e.seed,strokeLineDash:"dashed"===e.strokeStyle?hr(e.strokeWidth):"dotted"===e.strokeStyle?pr(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 He(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))}},Er=(e,t)=>{let n=yr.get(e);if(void 0===n)switch(vr.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"),kr(e,!0))}else n=t.rectangle(0,0,e.width,e.height,kr(e));wr(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)),kr(e,!0)):t.polygon([[r,i],[o,a],[s,l],[c,d]],kr(e)),wr(e,n);break}case"ellipse":n=t.ellipse(e.width/2,e.height/2,e.width,e.height,kr(e)),wr(e,n);break;case"line":case"arrow":{const r=kr(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,[f,m]=[h(.3,0),h(.3,1)],b=Math.hypot(p-f,g-m),v=(p-f)/b,y=(g-m)/b,x={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 _=Math.min(x,w/2),k=p-v*_,E=g-y*_;if("dot"===r)return[p,g,Math.hypot(E-g,k-p)+e.strokeWidth];const C={arrow:20,bar:90,triangle:25}[r],[S,I]=De(k,E,p,g,-C*Math.PI/180),[j,T]=De(k,E,p,g,C*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=pr(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)}}wr(e,n);break}case"freedraw":Or(e),n=He(e.points)?t.polygon(e.points,Object.assign(Object.assign({},kr(e)),{stroke:"none"})):null,wr(e,n);break;case"text":case"image":wr(e,null)}},Cr=(e,t)=>{const n=t?t.zoom:cr.zoom,r=vr.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=gr(e);let a=0,s=0;if(je(e)||Se(e)){const[n,l,c,d]=Ze(e);r.width=Vt(n,c)*window.devicePixelRatio*t.value+o*t.value*2,r.height=Vt(l,d)*window.devicePixelRatio*t.value+o*t.value*2,a=e.x>n?Vt(e.x,n)*window.devicePixelRatio*t.value:0,s=e.y>l?Vt(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=ye.canvas(r);return ur(e,n)&&(i.filter=lr),br(e,l,i,n),i.restore(),{element:e,canvas:r,theme:n.theme,canvasZoom:t.value,canvasOffsetX:a,canvasOffsetY:s}})(e,n,t);return vr.set(e,r),r}return r},Sr=(e,t,n,r)=>{const i=e.element,o=gr(i);let[a,s,l,c]=Ze(i);Se(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=dr(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()},Ir=(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(Er(e,i),r.isExporting){const t=Cr(e,r);Sr(t,0,n,r)}else{const[i,o,a,s]=Ze(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),br(e,t,n,r),n.restore()}break;case"rectangle":case"diamond":case"ellipse":case"line":case"arrow":case"image":case"text":if(Er(e,i),r.isExporting){const[i,o,a,s]=Ze(e),l=(i+a)/2+r.scrollX,c=(o+s)/2+r.scrollY,d=(a-i)/2-(e.x-i),u=(s-o)/2-(e.y-o);n.save(),n.translate(l,c),n.rotate(e.angle),n.translate(-d,-u),ur(e,r)&&(n.filter="none"),br(e,t,n,r),n.restore()}else{const t=Cr(e,r);Sr(t,0,n,r)}break;default:throw new Error("Unimplemented type ".concat(e.type))}},jr=(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)},Tr=(e,t,n,r,i,a,s)=>{const[l,c,d,u]=Ze(e),h=(d-l)/2-(e.x-l),p=(u-c)/2-(e.y-c),g=180*e.angle/Math.PI,f=t.generator;let m=n;if(e.link){const t=n.ownerDocument.createElementNS(o.hR,"a");t.setAttribute("href",e.link),m.appendChild(t),m=t}switch(e.type){case"selection":throw new Error("Selection rendering is not supported for SVG");case"rectangle":case"diamond":case"ellipse":{Er(e,f);const n=jr(t,xr(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,")")),m.appendChild(n);break}case"line":case"arrow":{Er(e,f);const r=n.ownerDocument.createElementNS(o.hR,"g"),s=e.opacity/100;r.setAttribute("stroke-linecap","round"),xr(e).forEach((n=>{const l=jr(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&&He(e.points)&&"transparent"!==e.backgroundColor&&l.setAttribute("fill-rule","evenodd"),r.appendChild(l)})),m.appendChild(r);break}case"freedraw":{Er(e,f),Or(e);const r=e.opacity/100,s=xr(e),l=s?jr(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",Ar(e)),l.appendChild(c),m.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),m.prepend(l)}const c=n.ownerDocument.createElementNS(o.hR,"use");c.setAttribute("href","#".concat(r)),s&&t.mimeType!==o.LO.svg&&c.setAttribute("filter",lr),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,")")),m.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=on(e.text)?"rtl":"ltr",f="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",Ut(e)),i.setAttribute("font-size","".concat(e.fontSize,"px")),i.setAttribute("fill",e.strokeColor),i.setAttribute("text-anchor",f),i.setAttribute("style","white-space: pre;"),i.setAttribute("direction",u),r.appendChild(i)}m.appendChild(r)}}};let Mr=new WeakMap([]);function Or(e){const t=Ar(e),n=new Path2D(t);return Mr.set(e,n),n}function Ar(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,Lr(n,i[0]),"L",i[0],"Z"):e.push(n,Lr(n,i[r+1])),e)),["M",e[0],"Q"]).join(" ").replace(Pr,"$1")}(Fn(t,n))}function Lr(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}const Pr=/(\s?[A-Z]?,?-?[0-9]*\.[0-9]{0,2})(([0-9]|e|-)*)/g;let zr=new A(Date.now()),Dr=0;const Rr=()=>Math.floor(zr.next()*2**31),Br=()=>pn()?"id".concat(Dr++):_e(),Nr=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({},Ge(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||_r(e),e.version++,e.versionNonce=Rr(),e.updated=un(),n)&&(null===(a=Kn.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:un(),version:e.version+1,versionNonce:Rr()}):e},Fr=(e,t)=>(e.version=(null!=t?t:e.version)+1,e.versionNonce=Rr(),e.updated=un(),e),Ur=e=>je(e)||Se(e)?e.points.length<2:0===e.width&&0===e.height,Wr=(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}},Kr=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},Vr=(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]))))})},Gr=(e,t)=>null!=Yr(e,t),Yr=(e,t)=>t.groupIds.filter((t=>t!==e.editingGroupId)).find((t=>e.selectedGroupIds[t])),Zr=e=>Object.entries(e.selectedGroupIds).filter((e=>{let[t,n]=e;return n})).map((e=>{let[t,n]=e;return t})),Xr=(e,t)=>{let n=Object.assign(Object.assign({},e),{selectedGroupIds:{}});const r=Nl(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=Vr(e,n,t)}}return n},qr=(e,t)=>e.groupIds.includes(t),$r=(e,t)=>e.filter((e=>qr(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},Jr=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=ar(e);i&&r.push(i),t.set(n,[...r,e])})),Array.from(t.values())};var ei=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 ti=(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:f=0,groupIds:m=[],strokeSharpness:b,boundElements:v=null,link:y=null,locked:x}=t,w=ei(t,["x","y","strokeColor","backgroundColor","fillStyle","strokeWidth","strokeStyle","roughness","opacity","width","height","angle","groupIds","strokeSharpness","boundElements","link","locked"]);return{id:w.id||Br(),type:e,x:i,y:o,width:p,height:g,angle:f,strokeColor:a,backgroundColor:s,fillStyle:l,strokeWidth:c,strokeStyle:d,roughness:u,opacity:h,groupIds:m,strokeSharpness:b,seed:null!==(n=w.seed)&&void 0!==n?n:Rr(),version:w.version||1,versionNonce:null!==(r=w.versionNonce)&&void 0!==r?r:0,isDeleted:!1,boundElements:v,updated:un(),link:y,locked:x}},ni=e=>ti(e.type,e),ri=(e,t)=>({x:"center"===e.textAlign?t.width/2:"right"===e.textAlign?t.width:0,y:"middle"===e.verticalAlign?t.height/2:0}),ii=e=>{const t=Zn(e.text,Wt(e)),n=ri(e,t);return Hr(Object.assign(Object.assign({},ti("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}),{})},oi=(e,t)=>{let{text:n,isDeleted:r,originalText:i}=t;const a=sr(e);a&&(n=er(n,Wt(e),a.width));const s=((e,t)=>{let n=null;const r=sr(e);r&&(n=r.width-2*o.gK);const{width:i,height:a,baseline:s}=Zn(t,Wt(e),n),{textAlign:l,verticalAlign:c}=e;let d,u;if("center"!==l||c!==o.oX.MIDDLE||e.containerId){const[t,n,r,o]=Ze(e),[s,c,h,p]=nt(e,i,a),g=(t-s)/2,f=(n-c)/2,m=(r-h)/2,b=(o-p)/2;[d,u]=Be({s:!0,e:"center"===l||"left"===l,w:"center"===l||"right"===l},e.x,e.y,e.angle,g,f,m,b)}else{const t=Zn(e.text,Wt(e),n),r=ri(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||Nr(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))},ai=e=>Object.assign(Object.assign({},ti(e.type,e)),{points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:e.startArrowhead,endArrowhead:e.endArrowhead}),si=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]=si(e[r],t+1)}return n}if(Array.isArray(e)){let n=e.length;const r=new Array(n);for(;n--;)r[n]=si(e[n],t+1);return r}return e},li=(e,t,n,r)=>{let i=si(n);var o,a;pn()?(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=Br();return i.updated=un(),i.seed=Rr(),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,Br()),t.get(e)))),r&&(i=Object.assign(i,r)),i},ci={mouse:8,pen:16,touch:28},di={e:!0,s:!0,n:!0,w:!0},ui={e:!0,s:!0,n:!0,w:!0},hi={e:!0,s:!0,n:!0,w:!0,nw:!0,se:!0},pi={e:!0,s:!0,n:!0,w:!0,ne:!0,sw:!0},gi=(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]},fi=function(e,t,n,r){let[i,o,a,s]=e,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const c=ci[r],d=c/n.value,u=c/n.value,h=c/n.value,p=c/n.value,g=a-i,f=s-o,m=(i+a)/2,b=(o+s)/2,v=4/n.value,y=(c-8)/(2*n.value),x={nw:l.nw?void 0:gi(i-v-h+y,o-v-p+y,d,u,m,b,t),ne:l.ne?void 0:gi(a+v-y,o-v-p+y,d,u,m,b,t),sw:l.sw?void 0:gi(i-v-h+y,s+v-y,d,u,m,b,t),se:l.se?void 0:gi(a+v-y,s+v-y,d,u,m,b,t),rotation:l.rotation?void 0:gi(i+g/2-d/2,o-v-p+y-16/n.value,d,u,m,b,t)},w=5*ci.mouse/n.value;return Math.abs(g)>w&&(l.n||(x.n=gi(i+g/2-d/2,o-v-p+y,d,u,m,b,t)),l.s||(x.s=gi(i+g/2-d/2,s+v-y,d,u,m,b,t))),Math.abs(f)>w&&(l.w||(x.w=gi(i-v-h+y,o+f/2-u/2,d,u,m,b,t)),l.e||(x.e=gi(a+v-y,o+f/2-u/2,d,u,m,b,t))),x},mi=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"mouse";if(e.locked)return{};let 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=pi:t[0]>0&&t[1]<0?r=hi:t[0]>0&&t[1]>0?r=pi:t[0]<0&&t[1]>0?r=hi:t[0]<0&&t[1]<0&&(r=pi)}}else Ce(e)&&(r=ui);return fi(Ze(e),e.angle,t,n,r)},bi=(e,t)=>[0,0,0,0,t,e,1,0],vi=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},yi=e=>[e[0],e[1],e[2],e[3],-e[4],-e[5],-e[6],-e[7]],xi=(e,t)=>ji(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]],wi=(e,t)=>ji(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]:[_i(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]],_i=(e,t)=>t[0]*e[0]+t[2]*e[2]+t[3]*e[3]-t[6]*e[6],ki=(e,t)=>[Ei(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]],Ei=(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],Ci=e=>Math.sqrt(Math.abs(e[0]*e[0]-e[2]*e[2]-e[3]*e[3]+e[6]*e[6])),Si=e=>{const t=Ci(e);if(0===t||1===t)return e;const n=e[6]<0?-1:1;return wi(e,n/t)},Ii=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:wi(e,1/t)},ji=e=>"number"==typeof e,Ti=(vi(1,1),vi(1,2),vi(1,3),vi(1,4),vi(1,5),vi(1,6),vi(1,7),(e,t,n)=>Si([0,n,e,t,0,0,0,0])),Mi=(e,t)=>Si(ki(t,e)),Oi=(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),Ai=e=>{let[t,n]=e;return[0,0,0,0,n,t,1,0]},Li=e=>[e[5],e[4]],Pi=(e,t)=>Si(((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)),zi=(e,t)=>Ci(ki(e,t)),Di=(e,t)=>Ei(e,t),Ri=e=>[0,0,0,0,e[4],e[5],0,0],Bi=(e,t)=>((e,t)=>ji(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]])(wi(e,Math.sin(t/2)),Math.cos(t/2)),Ni=(e,t)=>Si(wi(wi(e,t),yi(e))),Hi=(e,t,n,r)=>{const i=10/t.zoom.value;return!Fi(e,t,[n,r])&&Wi(e,[n,r],i)},Fi=(e,t,n)=>{const r=10/t.zoom.value,i=Ce(e)?Zi:(e=>{if("arrow"===e.type)return!1;if("freedraw"===e.type)return!0;const t=!ln(e.backgroundColor)||Pe(e);return"line"===e.type?t&&He(e.points):t||Ee(e)})(e)?Xi:qi;return Gi({element:e,point:n,threshold:r,check:i})},Ui=(e,t)=>e.selectedElementIds[t.id],Wi=(e,t,n)=>{let[r,i]=t;const[o,a,s,l]=Ze(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},Ki=(e,t)=>{let{x:n,y:r}=t;const i=Vi(e,e.width,e.height);return Gi({element:e,point:[n,r],threshold:i,check:$i})},Vi=(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))},Gi=e=>{switch(e.element.type){case"rectangle":case"image":case"text":case"diamond":case"ellipse":const t=Yi(e.element,e.point);return e.check(t,e.threshold);case"freedraw":return!!e.check(Qi(e.element,e.point),e.threshold)&&no(e.element,e.point,e.threshold);case"arrow":case"line":return ro(e);case"selection":return console.warn("This should not happen, we need to investigate why it does."),!1}},Yi=(e,t)=>{switch(e.type){case"rectangle":case"image":case"text":return Qi(e,t);case"diamond":return Ji(e,t);case"ellipse":return eo(e,t)}},Zi=(e,t)=>e<0,Xi=(e,t)=>e<t,qi=(e,t)=>Math.abs(e)<t,$i=(e,t)=>0<=e&&e<t,Qi=(e,t)=>{const[,n,r,i]=io(e,t);return Math.max(Di(n,Ti(0,1,-i)),Di(n,Ti(1,0,-r)))},Ji=(e,t)=>{const[,n,r,i]=io(e,t),o=Ti(i,r,-i*r);return Di(n,o)},eo=(e,t)=>{const[n,r]=to(e,t);return-(e=>Math.sign(e[1]))(r)*Di(n,r)},to=(e,t)=>{const[,n,r,i]=io(e,t),[o,a]=Li(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 f=Math.hypot(l,s);s/=f,l/=f}));const u=bi(c*s,d*l);var h;return[n,Oi(Mi(n,h=u),h)]},no=(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]=Ze(e),l=Re(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(Ne(a[0],a[1],r,i)<n||Ne(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=Ne(o[0],o[1],a[0],a[1]),g=Ne(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=xr(e);return!(!l||!l.sets.length)&&vo(l,r,i,n)},ro=e=>{const{element:t,threshold:n}=e;if(!xr(t))return!1;const[r,i,o,a]=io(e.element,e.point),s=Ti(0,1,-a),l=Ti(1,0,-o);if(!Xi(Di(i,s),n)||!Xi(Di(i,l),n))return!1;const[c,d]=Li(r),u=xr(t);if(!u)return!1;if(e.check===Xi){if(u.some((e=>bo(e,c,d,t.strokeSharpness))))return!0}return u.some((e=>vo(e,c,d,n)))},io=(e,t)=>{const n=Ai(t),r=Ze(e),i=ao(r),o=Bi(i,e.angle),a=Ni(o,n),s=(e=>[0,0,0,0,Math.abs(e[4]),Math.abs(e[5]),1,0])(xi(a,Ri(i))),l=((e,t)=>[0,0,0,0,t,e,0,0])(e.x,e.y),c=xi(a,l),[d,u,h,p]=r;return[c,s,(h-d)/2,(p-u)/2]},oo=e=>{const t=Ze(e),n=ao(t),r=Bi(n,e.angle),i=yi((e=>[1,0,0,0,-.5*e[5],.5*e[4],0,0])(Ri(n)));return wi(i,r)},ao=e=>{let[t,n,r,i]=e;return bi((t+r)/2,(n+i)/2)},so=(e,t,n)=>{const r=oo(e),i=Ni(r,Ai(t)),o=Ni(r,Ai(n)),a=Mi(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))}},lo=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=co(e);r=n.flatMap(((e,r)=>{const o=[e,n[(r+1)%4]];return uo(t,ho(o,i))})).concat(n.flatMap((e=>go(e,i,t))));break;case"ellipse":r=po(e,i,t)}if(r.length<2)return[];const o=r.sort(((e,t)=>zi(e,n)-zi(t,n)));return[o[0],o[o.length-1]]},co=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[bi(n,r),bi(n,-r),bi(-n,-r),bi(-n,r)];case"diamond":return[bi(0,r),bi(n,0),bi(0,-r),bi(-n,0)]}},uo=(e,t)=>{const[n,r]=t;return Di(n,e)*Di(r,e)>=0?[]:[Pi(e,Mi(n,r))]},ho=(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)=>Ii([0,0,0,0,t[4]-e[4],t[5]-e[5],0,0]))(n,r),t);return[Ni(i,n),Ni(i,r)]},po=(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[bi((u+r*i*a*d)/l,(h-r*i*o*d)/l),bi((u-r*i*a*d)/l,(h+r*i*o*d)/l)]},go=(e,t,n)=>{if(0===t)return 0===Di(n,e)?[e]:[];const r=n[2],i=n[3],o=n[1],[a,s]=Li(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[bi((u+i*d)/l,(h-r*d)/l),bi((u-i*d)/l,(h+r*d)/l)]},fo=(e,t,n)=>{const r=Math.abs(t),i=e.width*r/2,o=e.height*r/2,a=Math.sign(t),[s,l]=Li(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 bi(p,(-u*p-1)/h)},mo=(e,t,n)=>{const r=Math.abs(t),i=Math.sign(t),o=co(e,r);let a=0,s=null;return o.forEach((e=>{const t=i*Mi(n,e)[1];t>a&&(a=t,s=e)})),s},bo=(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 Fe(o,t,n);const e=pe(o,10,5);return Fe(e,t,n)}return!1},vo=(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 bo(e,t,n,"sharp");"qcurveTo"===s&&console.warn("qcurveTo is not implemented yet")}return!1}))};var yo=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 xo=(e,t,n)=>t>=e[0]&&t<=e[0]+e[2]&&n>=e[1]&&n<=e[1]+e[3],wo=(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=mi(e,i,o),{rotation:s}=a,l=yo(a,["rotation"]);if(s&&xo(s,n,r))return"rotation";const c=Object.keys(l).filter((e=>{const t=l[e];return!!t&&xo(t,n,r)}));return c.length>0&&c[0]})(a,t,n,r,i,o);return s?{element:a,transformHandleType:s}:null}),null),_o=(e,t,n,r,i)=>{let[o,a,s,l]=e;const c=fi([o,a,s,l],0,r,i,di);return Object.keys(c).find((e=>{const r=c[e];return r&&xo(r,t,n)}))||!1},ko=["ns","nesw","ew","nwse"],Eo=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=ko.indexOf(e);if(n>=0){const r=Math.round(t/(Math.PI/4));e=ko[(n+r)%ko.length]}return e})(i,t.angle)),i?"".concat(i,"-resize"):""};class Co{constructor(e,t){this.elementId=e.id,Kn.mapElementToScene(this.elementId,t),Co.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=Kn.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=Co.getElement(a);if(!s)return!1;const[l,c,d,u]=Ze(t.draggingElement),h=Co.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=Co.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=Co.createPointAt(c,n-o.pointerOffset.x,r-o.pointerOffset.y,e.gridSize),u=s[0]-d[0],h=s[1]-d[1];if(Co.movePoints(c,a.map((t=>({index:t,point:t===o.pointerDownState.lastClickedPoint?Co.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})))),Me(c,!1)){const e=[];0===a[0]&&e.push(an(Co.getPointGlobalCoordinates(c,c.points[0])));const t=a[a.length-1];t===c.points.length-1&&e.push(an(Co.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=Co.getElement(i);if(!l)return t;const c={};if(a&&o)for(const e of o)if(0===e||e===l.points.length-1){He(l.points,n.zoom.value)&&Co.movePoints(l,[{index:e,point:0===e?l.points[l.points.length-1]:l.points[0]}]);const t=Io(n)?Bo(an(Co.getPointAtIndexGlobalCoordinates(l,e)),Kn.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=Co.getElement(s);if(!l)return a;if(e.altKey)return null==t.editingLinearElement.lastUncommittedPoint&&Nr(l,{points:[...l.points,Co.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:Bo(i,Kn.getScene(l))})}),a.didAddPoint=!0,a;const c=Co.getPointIndexUnderCursor(l,t.zoom,i.x,i.y);if(c>-1)a.hitElement=l;else{const{startBindingElement:e,endBindingElement:n}=t.editingLinearElement;Io(t)&&Me(l)&&jo(l,e,n)}const[d,u,h,p]=Ze(l),g=(d+h)/2,f=(u+p)/2,m=c>-1&&De(l.x+l.points[c][0],l.y+l.points[c][1],g,f,l.angle),b=c>-1||e.shiftKey?e.shiftKey||null!==(o=t.editingLinearElement.selectedPointsIndices)&&void 0!==o&&o.includes(c)?So([...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:m?{x:i.x-m[0],y:i.y-m[1]}:{x:0,y:0}})}),a}static handlePointerMove(e,t,n,r,i){const{elementId:o,lastUncommittedPoint:a}=r,s=Co.getElement(o);if(!s)return r;const{points:l}=s,c=l[l.length-1];if(!e.altKey)return c===a&&Co.deletePoints(s,[l.length-1]),Object.assign(Object.assign({},r),{lastUncommittedPoint:null});const d=Co.createPointAt(s,t-r.pointerOffset.x,n-r.pointerOffset.y,i);return c===a?Co.movePoints(s,[{index:s.points.length-1,point:d}]):Co.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]=Ze(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]=Ze(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]=Ze(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]=Ze(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(Ne(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=Ve(t,n,r),[o,a,s,l]=Ze(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){Nr(e,Co.getNormalizedPoints(e))}static duplicateSelectedPoints(e){if(!e.editingLinearElement)return!1;const{selectedPointsIndices:t,elementId:n}=e.editingLinearElement,r=Co.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(Nr(r,{points:l}),a){const e=r.points[r.points.length-1];Co.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)),[]);Co._updatePoints(e,i,n,r)}static addPoints(e,t){const n=[...e.points,...t.map((e=>e.point))];Co._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}));Co._updatePoints(e,s,i,o,n)}static _updatePoints(e,t,n,r,i){const o=rt(e,t,e.strokeSharpness||"round"),a=rt(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);Nr(e,Object.assign(Object.assign({},i),{points:t,x:e.x+u[0],y:e.y+u[1]}))}}Co.POINT_HANDLE_SIZE=20;const So=e=>{let t=[...new Set(e.filter((e=>null!==e&&-1!==e)))];return t=t.sort(((e,t)=>e-t)),t.length?t:null},Io=e=>e.isBindingEnabled,jo=(e,t,n)=>{const r=new Set,i=new Set;To(e,t,n,"start",r,i),To(e,n,t,"end",r,i);const o=Array.from(i).filter((e=>!r.has(e)));Kn.getScene(e).getNonDeletedElements(o).forEach((t=>{var n;Nr(t,{boundElements:null===(n=t.boundElements)||void 0===n?void 0:n.filter((t=>"arrow"!==t.type||t.id!==e.id))})}))},To=(e,t,n,r,i,o)=>{if("keep"!==t)if(null!=t)null!=n&&("keep"===n?Po(e,t,r):"start"!==r&&n.id===t.id)||(Lo(e,t,r),i.add(t.id));else{const t=Ro(e,r);null!=t&&o.add(t)}},Mo=e=>{e.forEach((e=>{Me(e)?jo(e,Go(e,"start"),Go(e,"end")):Ae(e)&&Oo(e)}))},Oo=e=>{Zo(e).forEach((t=>{let[n,r]=t;return jo(n,"end"===r?"keep":e,"start"===r?"keep":e)}))},Ao=(e,t,n,r)=>{null!=t.startBoundElement&&Lo(e,t.startBoundElement,"start");const i=Bo(r,n);null==i||Po(e,i,"end")||Lo(e,i,"end")},Lo=(e,t,n)=>{Nr(e,{["start"===n?"startBinding":"endBinding"]:Object.assign({elementId:t.id},No(e,t,n))});hn(t.boundElements||[]).has(e.id)||Nr(t,{boundElements:(t.boundElements||[]).concat({id:e.id,type:"arrow"})})},Po=(e,t,n)=>{const r=e["start"===n?"endBinding":"startBinding"];return zo(e,null==r?void 0:r.elementId,t)},zo=(e,t,n)=>t===n.id&&e.points.length<3,Do=e=>{e.forEach((e=>{Me(e)&&jo(e,null,null)}))},Ro=(e,t)=>{const n="start"===t?"startBinding":"endBinding",r=e[n];return null==r?null:(Nr(e,{[n]:null}),r.elementId)},Bo=(e,t)=>Zs(t.getElements(),(t=>Ae(t,!1)&&Ki(t,e))),No=(e,t,n)=>{const r="start"===n?-1:1,i=-1===r?0:e.points.length-1,o=i-r,a=Co.getPointAtIndexGlobalCoordinates(e,i),s=Co.getPointAtIndexGlobalCoordinates(e,o);return{focus:so(t,s,a),gap:Math.max(1,Yi(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=Uo(o);Kn.getScene(e).getNonDeletedElements(r.map((e=>e.id))).forEach((t=>{if(!je(t))return;const n=e;if(!Fo(t,n))return;const r=Ko(n,t.startBinding,i),o=Ko(n,t.endBinding,i);a.has(t.id)?Nr(t,{startBinding:r,endBinding:o}):(Wo(t,"start",r,e),Wo(t,"end",o,e))}))},Fo=(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},Uo=e=>new Set((e||[]).map((e=>e.id))),Wo=(e,t,n,r)=>{if(null==n||n.elementId!==r.id&&e.points.length>2)return;const i=Kn.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=Co.getPointAtIndexGlobalCoordinates(e,s),c=((e,t,n)=>{if(0===t){const t=Ze(e),n=ao(t);return Li(n)}const r=oo(e),i=Ni(r,Ai(n)),o=yi(r);let a;switch(e.type){case"rectangle":case"image":case"text":case"diamond":a=mo(e,t,i);break;case"ellipse":a=fo(e,t,i)}return Li(Ni(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=oo(e),o=Ni(i,Ai(t)),a=Ni(i,Ai(n)),s=Mi(o,a),l=yi(i);return lo(e,s,o,r).map((e=>Li(Ni(l,e))))}(i,l,c,n.gap);d=0===e.length?c:e[0]}Co.movePoints(e,[{index:a,point:Co.pointFromAbsoluteCoords(e,d)}],{["start"===t?"startBinding":"endBinding"]:n})},Ko=(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(Vi(e,a,s),r*(a<s?a/l:s/c))),focus:i}},Vo=e=>[Go(e,"start"),Go(e,"end")].filter((e=>null!=e)),Go=(e,t)=>Bo(Yo(e,t),Kn.getScene(e)),Yo=(e,t)=>{const n="start"===t?0:-1;return an(Co.getPointAtIndexGlobalCoordinates(e,n))},Zo=e=>Kn.getScene(e).getElements().map((t=>{if(!Me(t,!1))return null;const n=Xo(t,"start",e),r=Xo(t,"end",e);return n||r?[t,n&&r?"both":n?"start":"end",e]:null})).filter((e=>null!=e)),Xo=(e,t,n)=>null==e["start"===t?"startBinding":"endBinding"]&&!Po(e,n,t)&&Ki(n,Yo(e,t)),qo=(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))),Me(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;Nr(e,{startBinding:$o(t,n),endBinding:$o(r,n)})})),e.filter((e=>{let{id:t}=e;return o.has(t)})).forEach((e=>{const{boundElements:t}=e;null!=t&&t.length>0&&Nr(e,{boundElements:t.map((e=>n.has(e.id)?{id:n.get(e.id),type:e.type}:e))})}))},$o=(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;Ae(e)?null===(t=e.boundElements)||void 0===t||t.forEach((e=>{n.has(e.id)||r.add(e.id)})):Me(e)&&(e.startBinding&&r.add(e.startBinding.elementId),e.endBinding&&r.add(e.endBinding.elementId))})),e.filter((e=>{let{id:t}=e;return r.has(t)})).forEach((e=>{Ae(e)?Nr(e,{boundElements:ea(e.boundElements,n)}):Me(e)&&Nr(e,{startBinding:Jo(e.startBinding,n),endBinding:Jo(e.endBinding,n)})}))},Jo=(e,t)=>null==e||t.has(e.elementId)?null:e,ea=(e,t)=>e?e.filter((e=>!t.has(e.id))):null,ta=e=>e>=2*Math.PI?e-2*Math.PI:e,na=(e,t,n,r)=>{const[i,a,s,l]=Ze(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=ta(u),Nr(e,{angle:u});const h=or(e);if(h){const t=Kn.getScene(e).getElement(h);Nr(t,{angle:u})}},ra=(e,t,n,r,i)=>{const[o,a,s,l]=Ze(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=Wr(e,...De(t,n,0,0,r));return De(i.width,i.height,0,0,-r)})(e.type,p,g,e.angle));const[f,m]=Be("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);Nr(e,{x:f,y:m,points:[[0,0],[p,g]]})},ia=(e,t,n)=>je(e)||Se(e)?{points:Ye(0,t,Ye(1,n,e.points))}:{},oa=(e,t,n)=>{const r=e.fontSize*(t/e.width);if(r<1)return null;const i=Zn(e.text,Wt({fontSize:r,fontFamily:e.fontFamily}),e.containerId?e.width:null);return{size:r,baseline:i.baseline+(n-i.height)}},aa=(e,t,n,r,i)=>{const[o,a,s,l]=Ze(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=oa(e,r,i);if(null===c)return;const[d,u,h,g]=nt(e,r,i),f=(o-d)/2,m=(a-u)/2,b=(s-h)/2,v=(l-g)/2,[y,x]=Be(((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,f,m,b,v);Nr(e,{fontSize:c.size,width:r,height:i,baseline:c.baseline,x:y,y:x})}},sa=(e,t,n,r,i,a,s)=>{const l=e.get(n.id),[c,d,u,h]=nt(l,l.width,l.height),p=[c,d],g=[u,h],f=((e,t)=>[(e[0]+t[0])/2,(e[1]+t[1])/2])(p,g),m=Re([a,s],f,-l.angle),[b,v,y,x]=nt(n,n.width,n.height),w=y-b,_=x-v;let k=(g[0]-p[0])/w,E=(g[1]-p[1])/_,C={};const S=ar(n);r.includes("e")&&(k=(m[0]-p[0])/w),r.includes("s")&&(E=(m[1]-p[1])/_),r.includes("w")&&(k=(g[0]-m[0])/w),r.includes("n")&&(E=(g[1]-m[1])/_);const I=l.width,j=l.height;let T=n.width*k,M=n.height*E;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&&(C={fontSize:n.fontSize,baseline:n.baseline}),t){const e=oa(S,T-2*o.gK,M-2*o.gK);if(null===e)return;C={fontSize:e.size,baseline:e.baseline}}else{const e=nr(Wt(S)),t=rr(Wt(S));T=Math.ceil(Math.max(T,e)),M=Math.ceil(Math.max(M,t))}}const[O,A,L,P]=nt(l,T,M),z=L-O,D=P-A;let R=[...p];if(["n","w","nw"].includes(r)&&(R=[g[0]-Math.abs(z),g[1]-Math.abs(D)]),"ne"===r){const e=[p[0],g[1]];R=[e[0],e[1]-Math.abs(D)]}if("sw"===r){const e=[g[0],p[1]];R=[e[0]-Math.abs(z),e[1]]}t&&(["s","n"].includes(r)&&(R[0]=f[0]-z/2),["e","w"].includes(r)&&(R[1]=f[1]-D/2)),T<0&&(r.includes("e")&&(R[0]-=Math.abs(z)),r.includes("w")&&(R[0]+=Math.abs(z))),M<0&&(r.includes("s")&&(R[1]-=Math.abs(D)),r.includes("n")&&(R[1]+=Math.abs(D))),i&&(R[0]=f[0]-Math.abs(z)/2,R[1]=f[1]-Math.abs(D)/2);const B=l.angle,N=Re(R,f,B),H=[R[0]+Math.abs(z)/2,R[1]+Math.abs(D)/2],F=Re(H,f,B);R=Re(N,F,-B);const U=ia(l,T,M),W=[...R];W[0]+=l.x-O,W[1]+=l.y-A;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&&Nr(n,{scale:[(Math.sign(k)||l.scale[0])*l.scale[0],(Math.sign(E)||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}}),Nr(n,K),S&&C&&Nr(S,{fontSize:C.fontSize}),Yn(n,r))},la=(e,t,n,r)=>{const[i,a,s,l]=tt(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=ar(n);let s={};if(a){const e=oa(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=oa(n,r,i);if(null===e)return null;s={fontSize:e.size,baseline:e.baseline}}const l=Ze(n),u=ia(n,r,i);Ho(n,{newSize:{width:r,height:i},simultaneouslyUpdated:e});const h=nt(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)=>{Nr(e,n[r]);const i=ar(e);i&&(Nr(i,{fontSize:n[r].fontSize,baseline:n[r].baseline}),Yn(e,t))}))}},ca=(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]=Ze(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,[f,m]=De(h,p,a,s,l+g-t.angle);Nr(t,{x:t.x+(f-h),y:t.y+(m-p),angle:ta(l+g)});const b=or(t);if(b){const e=Kn.getScene(t).getElement(b);Nr(e,{x:e.x+(f-h),y:e.y+(m-p),angle:ta(l+g)})}}))},da=(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;Nr(i,{x:a,y:s})},ua=(e,t,n,r,i,o,a,s,l,c,d)=>{l&&(d?s=a/d:(({width:a,height:s}=Wr(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&&Nr(e,{x:u,y:h,width:a,height:s})},ha=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:we({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 pa=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,lt.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 ga=(e,t)=>!st[t].includes(e),fa=e=>{const t=(new Option).style;return t.color=e,!!t.color},ma=[["1","2","3","4","5"],["q","w","e","r","t"],["a","s","d","f","g"],["z","x","c","v","b"]].flat(),ba=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&&ga(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 m=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e.map(((e,i)=>{const o=e.replace("#",""),a=t?ma[i+15]:ma[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(ln(e)?"":" (".concat(e,")")," — ").concat(a.toUpperCase()),"aria-label":s,"aria-keyshortcuts":ma[i],style:{color:e},ref:r=>{!t&&r&&0===i&&(d.current=r),r&&e===n&&(u.current=r)},onFocus:()=>{r(e)},children:[ln(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(Pt(e.key)){const{activeElement:t}=document,n=f().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(ma.includes(e.key.toLowerCase())&&!Ft(e.target)){var i;const t=ma.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:m(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:m(g,!0)})]}),s&&(0,v.jsx)(va,{color:n,label:a,onChange:e=>{r(e)},ref:p})]})]})},va=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=>ln(e)||fa(e)?e:fa("#".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})]})})),ya=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)(va,{color:n,label:o,onChange:e=>{r(e)}})]}),(0,v.jsx)(i().Suspense,{fallback:"",children:a?(0,v.jsx)(pa,{onCloseRequest:e=>e.target!==d.current&&s(!1),children:(0,v.jsx)(ba,{colors:st[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 xa(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(Pt(e.key)){const{activeElement:n}=document,r=f().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 wa(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=f().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)(pa,Object.assign(Object.assign({onCloseRequest:e=>e.target!==d.current&&c(!1)},u?{right:5.5}:{left:-5.5}),{children:(0,v.jsx)(xa,{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 _a=e=>e===o.C6.LIGHT?ot.orange[4]:ot.orange[9],ka=e=>e===o.C6.LIGHT?ot.white:"#1e1e1e",Ea=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:we({"rtl-mirror":i}),style:o,children:"string"==typeof e?(0,v.jsx)("path",{fill:"currentColor",d:e}):e})},Ca=Ea((0,v.jsx)("polyline",{fill:"none",stroke:"currentColor",points:"20 6 9 17 4 12"}),{width:24,height:24}),Sa=Ea("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}),Ia=Ea("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}),ja=Ea("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}),Ta=Ea("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}),Ma=Ea("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}),Oa=Ea("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}),Aa=Ea("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"),La=(Ea("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}),Ea((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})),Pa=Ea("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}),za=Ea("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}),Da=Ea("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}),Ra=Ea("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"),Ba=Ea("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"),Na=Ea("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}),Ha=Ea("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}),Fa=Ea("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}),Ua=(Ea("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}),Ea("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}),Ea((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}),Ea((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 Ea((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:_a(t),stroke:_a(t),strokeWidth:"2"})]}),{width:24,mirror:!0})}))),Wa=i().memo((e=>{let{theme:t}=e;return Ea((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:_a(t),stroke:_a(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})})),Ka=i().memo((e=>{let{theme:t}=e;return Ea((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:_a(t),stroke:_a(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),Va=i().memo((e=>{let{theme:t}=e;return Ea((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:_a(t),stroke:_a(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})})),Ga=i().memo((e=>{let{theme:t}=e;return Ea((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:_a(t),stroke:_a(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),Ya=i().memo((e=>{let{theme:t}=e;return Ea((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:_a(t),stroke:_a(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),Za=i().memo((e=>{let{theme:t}=e;return Ea((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:_a(t),stroke:_a(t),strokeWidth:"2"})]}),{width:24})})),Xa=i().memo((e=>{let{theme:t}=e;return Ea((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:_a(t),stroke:_a(t),strokeWidth:"2"})]}),{width:24})})),qa=i().memo((e=>{let{theme:t}=e;return Ea((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:_a(t),stroke:_a(t),strokeWidth:"2"})]}),{width:24})})),$a=i().memo((e=>{let{theme:t}=e;return Ea((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:_a(t),stroke:_a(t),strokeWidth:"2"})]}),{width:24})})),Qa=i().memo((e=>{let{theme:t}=e;return Ea((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:_a(t),stroke:_a(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})})),Ja=i().memo((e=>{let{theme:t}=e;return Ea((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:_a(t),stroke:_a(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})})),es=Ea("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}),ts=(Ea("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"),Ea("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"),Ea("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})),ns=Ea("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}),rs=Ea("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}),is=(Ea("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}),Ea("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})),os=i().memo((e=>{let{theme:t}=e;return Ea((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:ka(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})})),as=i().memo((e=>{let{theme:t}=e;return Ea((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:ka(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})})),ss=i().memo((e=>{let{theme:t}=e;return Ea((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})})),ls=i().memo((e=>{let{theme:t}=e;return Ea((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})})),cs=i().memo((e=>{let{theme:t}=e;return Ea((0,v.jsx)("path",{d:"M2 2H38V18H2V2Z",fill:"var(--icon-fill-color)"}),{width:40,height:20})})),ds=i().memo((e=>{let{theme:t,strokeWidth:n}=e;return Ea((0,v.jsx)("path",{d:"M6 10H32",stroke:"var(--icon-fill-color)",strokeWidth:n,strokeLinecap:"round",fill:"none"}),{width:40,height:20})})),us=i().memo((e=>{let{theme:t}=e;return Ea((0,v.jsx)("path",{d:"M6 10H34",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none",strokeLinecap:"round"}),{width:40,height:20})})),hs=i().memo((e=>{let{theme:t}=e;return Ea((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})})),ps=i().memo((e=>{let{theme:t}=e;return Ea((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})})),gs=i().memo((e=>{let{theme:t}=e;return Ea((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})})),fs=i().memo((e=>{let{theme:t}=e;return Ea((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})})),ms=i().memo((e=>{let{theme:t}=e;return Ea((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})})),bs=i().memo((e=>{let{theme:t}=e;return Ea((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})})),vs=i().memo((e=>{let{theme:t}=e;return Ea((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})})),ys=i().memo((e=>{let{theme:t}=e;return Ea((0,v.jsx)("path",{d:"M6 10H34",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none"}),{width:40,height:20})})),xs=i().memo((e=>{let{theme:t,flip:n=!1}=e;return Ea((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})})),ws=i().memo((e=>{let{theme:t,flip:n=!1}=e;return Ea((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})})),_s=i().memo((e=>{let{theme:t,flip:n=!1}=e;return Ea((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})})),ks=i().memo((e=>{let{theme:t,flip:n=!1}=e;return Ea((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})})),Es=i().memo((e=>{let{theme:t}=e;return Ea((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})})),Cs=i().memo((e=>{let{theme:t}=e;return Ea((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})})),Ss=i().memo((e=>{let{theme:t}=e;return Ea((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})})),Is=i().memo((e=>{let{theme:t}=e;return Ea((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})})),js=i().memo((e=>{let{theme:t}=e;return Ea((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})})),Ts=i().memo((e=>{let{theme:t}=e;return Ea((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})})),Ms=i().memo((e=>{let{theme:t}=e;return Ea((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})})),Os=i().memo((e=>{let{theme:t}=e;return Ea((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})})),As=i().memo((e=>{let{theme:t}=e;return Ea((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})})),Ls=i().memo((e=>{let{theme:t}=e;return Ea((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})})),Ps=i().memo((e=>{let{theme:t}=e;return Ea((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})})),zs=i().memo((e=>{let{theme:t}=e;return Ea((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})})),Ds=i().memo((e=>{let{theme:t}=e;return Ea((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})})),Rs=Ea((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}),Bs=Ea((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}),Ns=Ea((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"})),Hs=Ea("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"),Fs=e=>"rectangle"===e||"ellipse"===e||"diamond"===e||"line"===e||"freedraw"===e,Us=e=>"image"!==e,Ws=e=>"rectangle"===e||"ellipse"===e||"diamond"===e||"freedraw"===e||"arrow"===e||"line"===e,Ks=e=>"rectangle"===e||"ellipse"===e||"diamond"===e||"arrow"===e||"line"===e,Vs=e=>"rectangle"===e||"arrow"===e||"line"===e||"diamond"===e,Gs=e=>"text"===e,Ys=e=>"arrow"===e,Zs=(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},Xs=(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]=Ze(e[i]);if(o<t&&t<s&&a<n&&n<l){r=e[i];break}}return Le(r,!1)?r:null};let qs=[];const $s=e=>(qs=qs.concat(e),e),Qs=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=hn(Nl(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}))},Js=function(e,t,n,r){var i,o;const a=t.editingElement,s=Ol(e);return null!==(i=null!==(o=a&&n(a))&&void 0!==o?o:Rl(s,t)?Bl(s,t,n):r)&&void 0!==i?i:null},el=(e,t,n,r)=>{const i=new Set;return{elements:Qs(e,t,(e=>{if(Ce(e)){const o=n(e);i.add(o);let a=Hr(e,{fontSize:o});return Vn(a,sr(e)),t=e,a=ze(r=a)?r:Nr(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}},tl=($s({name:"changeStrokeColor",trackEvent:!1,perform:(e,t,n)=>Object.assign(Object.assign({},n.currentItemStrokeColor&&{elements:Qs(e,t,(e=>Us(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)(ya,{type:"elementStroke",label:b("labels.stroke"),color:Js(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})]})}}),$s({name:"changeBackgroundColor",trackEvent:!1,perform:(e,t,n)=>Object.assign(Object.assign({},n.currentItemBackgroundColor&&{elements:Qs(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)(ya,{type:"elementBackground",label:b("labels.background"),color:Js(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})]})}}),$s({name:"changeFillStyle",trackEvent:!1,perform:(e,t,n)=>({elements:Qs(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)(ha,{options:[{value:"hachure",text:b("labels.hachure"),icon:(0,v.jsx)(ss,{theme:n.theme})},{value:"cross-hatch",text:b("labels.crossHatch"),icon:(0,v.jsx)(ls,{theme:n.theme})},{value:"solid",text:b("labels.solid"),icon:(0,v.jsx)(cs,{theme:n.theme})}],group:"fill",value:Js(t,n,(e=>e.fillStyle),n.currentItemFillStyle),onChange:e=>{r(e)}})]})}}),$s({name:"changeStrokeWidth",trackEvent:!1,perform:(e,t,n)=>({elements:Qs(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)(ha,{group:"stroke-width",options:[{value:1,text:b("labels.thin"),icon:(0,v.jsx)(ds,{theme:n.theme,strokeWidth:2})},{value:2,text:b("labels.bold"),icon:(0,v.jsx)(ds,{theme:n.theme,strokeWidth:6})},{value:4,text:b("labels.extraBold"),icon:(0,v.jsx)(ds,{theme:n.theme,strokeWidth:10})}],value:Js(t,n,(e=>e.strokeWidth),n.currentItemStrokeWidth),onChange:e=>r(e)})]})}}),$s({name:"changeSloppiness",trackEvent:!1,perform:(e,t,n)=>({elements:Qs(e,t,(e=>Hr(e,{seed:Rr(),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)(ha,{group:"sloppiness",options:[{value:0,text:b("labels.architect"),icon:(0,v.jsx)(gs,{theme:n.theme})},{value:1,text:b("labels.artist"),icon:(0,v.jsx)(fs,{theme:n.theme})},{value:2,text:b("labels.cartoonist"),icon:(0,v.jsx)(ms,{theme:n.theme})}],value:Js(t,n,(e=>e.roughness),n.currentItemRoughness),onChange:e=>r(e)})]})}}),$s({name:"changeStrokeStyle",trackEvent:!1,perform:(e,t,n)=>({elements:Qs(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)(ha,{group:"strokeStyle",options:[{value:"solid",text:b("labels.strokeStyle_solid"),icon:(0,v.jsx)(us,{theme:n.theme})},{value:"dashed",text:b("labels.strokeStyle_dashed"),icon:(0,v.jsx)(hs,{theme:n.theme})},{value:"dotted",text:b("labels.strokeStyle_dotted"),icon:(0,v.jsx)(ps,{theme:n.theme})}],value:Js(t,n,(e=>e.strokeStyle),n.currentItemStrokeStyle),onChange:e=>r(e)})]})}}),$s({name:"changeOpacity",trackEvent:!1,perform:(e,t,n)=>({elements:Qs(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=Js(n,r,(e=>e.opacity),r.currentItemOpacity))&&void 0!==t?t:void 0})]})}}),$s({name:"changeFontSize",trackEvent:!1,perform:(e,t,n)=>el(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)(ha,{group:"font-size",options:[{value:16,text:b("labels.small"),icon:(0,v.jsx)(Es,{theme:n.theme}),testId:"fontSize-small"},{value:20,text:b("labels.medium"),icon:(0,v.jsx)(Cs,{theme:n.theme}),testId:"fontSize-medium"},{value:28,text:b("labels.large"),icon:(0,v.jsx)(Ss,{theme:n.theme}),testId:"fontSize-large"},{value:36,text:b("labels.veryLarge"),icon:(0,v.jsx)(Is,{theme:n.theme}),testId:"fontSize-veryLarge"}],value:Js(t,n,(e=>{if(Ce(e))return e.fontSize;const t=ar(e);return t?t.fontSize:null}),n.currentItemFontSize||o.n5),onChange:e=>r(e)})]})}}),$s({name:"decreaseFontSize",trackEvent:!1,perform:(e,t,n)=>el(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)})),nl=$s({name:"increaseFontSize",trackEvent:!1,perform:(e,t,n)=>el(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)});$s({name:"changeFontFamily",trackEvent:!1,perform:(e,t,n)=>({elements:Qs(e,t,(e=>{if(Ce(e)){const t=Hr(e,{fontFamily:n});return Vn(t,sr(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)(js,{theme:n.theme})},{value:o.ut.Helvetica,text:b("labels.normal"),icon:(0,v.jsx)(Ts,{theme:n.theme})},{value:o.ut.Cascadia,text:b("labels.code"),icon:(0,v.jsx)(Ms,{theme:n.theme})}];return(0,v.jsxs)("fieldset",{children:[(0,v.jsx)("legend",{children:b("labels.fontFamily")}),(0,v.jsx)(ha,{group:"font-family",options:i,value:Js(t,n,(e=>{if(Ce(e))return e.fontFamily;const t=ar(e);return t?t.fontFamily:null}),n.currentItemFontFamily||o.rk),onChange:e=>r(e)})]})}}),$s({name:"changeTextAlign",trackEvent:!1,perform:(e,t,n)=>({elements:Qs(e,t,(e=>{if(Ce(e)){const t=Hr(e,{textAlign:n});return Vn(t,sr(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)(ha,{group:"text-align",options:[{value:"left",text:b("labels.left"),icon:(0,v.jsx)(Os,{theme:n.theme})},{value:"center",text:b("labels.center"),icon:(0,v.jsx)(As,{theme:n.theme})},{value:"right",text:b("labels.right"),icon:(0,v.jsx)(Ls,{theme:n.theme})}],value:Js(t,n,(e=>{if(Ce(e))return e.textAlign;const t=ar(e);return t?t.textAlign:null}),n.currentItemTextAlign),onChange:e=>r(e)})]})}}),$s({name:"changeVerticalAlign",trackEvent:{category:"element"},perform:(e,t,n)=>({elements:Qs(e,t,(e=>{if(Ce(e)){const t=Hr(e,{verticalAlign:n});return Vn(t,sr(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)(ha,{group:"text-align",options:[{value:o.oX.TOP,text:b("labels.alignTop"),icon:(0,v.jsx)(Ps,{theme:n.theme})},{value:o.oX.MIDDLE,text:b("labels.centerVertically"),icon:(0,v.jsx)(Ds,{theme:n.theme})},{value:o.oX.BOTTOM,text:b("labels.alignBottom"),icon:(0,v.jsx)(zs,{theme:n.theme})}],value:Js(t,n,(e=>{if(Ce(e)&&e.containerId)return e.verticalAlign;const t=ar(e);return t?t.verticalAlign:null})),onChange:e=>r(e)})})}}),$s({name:"changeSharpness",trackEvent:!1,perform:(e,t,n)=>{const r=Hl(Ol(e),t),i=r.length?r.every((e=>!je(e))):!Te(t.activeTool.type),o=r.length?r.every(je):Te(t.activeTool.type);return{elements:Qs(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)(ha,{group:"edges",options:[{value:"sharp",text:b("labels.sharp"),icon:(0,v.jsx)(bs,{theme:n.theme})},{value:"round",text:b("labels.round"),icon:(0,v.jsx)(vs,{theme:n.theme})}],value:Js(t,n,(e=>e.strokeSharpness),Vs(n.activeTool.type)&&(Te(n.activeTool.type)?n.currentItemLinearStrokeSharpness:n.currentItemStrokeSharpness)||null),onChange:e=>r(e)})]})}}),$s({name:"changeArrowhead",trackEvent:!1,perform:(e,t,n)=>({elements:Qs(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=f().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)(wa,{label:"arrowhead_start",options:[{value:null,text:b("labels.arrowhead_none"),icon:(0,v.jsx)(ys,{theme:n.theme}),keyBinding:"q"},{value:"arrow",text:b("labels.arrowhead_arrow"),icon:(0,v.jsx)(xs,{theme:n.theme,flip:!i}),keyBinding:"w"},{value:"bar",text:b("labels.arrowhead_bar"),icon:(0,v.jsx)(_s,{theme:n.theme,flip:!i}),keyBinding:"e"},{value:"dot",text:b("labels.arrowhead_dot"),icon:(0,v.jsx)(ws,{theme:n.theme,flip:!i}),keyBinding:"r"},{value:"triangle",text:b("labels.arrowhead_triangle"),icon:(0,v.jsx)(ks,{theme:n.theme,flip:!i}),keyBinding:"t"}],value:Js(t,n,(e=>je(e)&&Ys(e.type)?e.startArrowhead:n.currentItemStartArrowhead),n.currentItemStartArrowhead),onChange:e=>r({position:"start",type:e})}),(0,v.jsx)(wa,{label:"arrowhead_end",group:"arrowheads",options:[{value:null,text:b("labels.arrowhead_none"),keyBinding:"q",icon:(0,v.jsx)(ys,{theme:n.theme})},{value:"arrow",text:b("labels.arrowhead_arrow"),keyBinding:"w",icon:(0,v.jsx)(xs,{theme:n.theme,flip:i})},{value:"bar",text:b("labels.arrowhead_bar"),keyBinding:"e",icon:(0,v.jsx)(_s,{theme:n.theme,flip:i})},{value:"dot",text:b("labels.arrowhead_dot"),keyBinding:"r",icon:(0,v.jsx)(ws,{theme:n.theme,flip:i})},{value:"triangle",text:b("labels.arrowhead_triangle"),icon:(0,v.jsx)(ks,{theme:n.theme,flip:i}),keyBinding:"t"}],value:Js(t,n,(e=>je(e)&&Ys(e.type)?e.endArrowhead:n.currentItemEndArrowhead),n.currentItemEndArrowhead),onChange:e=>r({position:"end",type:e})})]})]})}});n(5422);class rl 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 il extends DOMException{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Request Aborted","AbortError")}}const ol=i().forwardRef(((e,t)=>{const{id:n}=fg(),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 il))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:we("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)(y,{})]}),e.showAriaLabel&&(0,v.jsxs)("div",{className:"ToolIcon__label",children:[e["aria-label"]," ",s&&(0,v.jsx)(y,{})]}),e.children]})}return(0,v.jsxs)("label",{className:we("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})]})]})}));ol.defaultProps={visible:!0,className:"",size:"medium"};const al=e=>{const t=e.title||("dark"===e.value?b("buttons.lightMode"):b("buttons.darkMode"));return(0,v.jsx)(ol,{type:"icon",icon:e.value===o.C6.LIGHT?sl.MOON:sl.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"})},sl={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"})})},ll=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}},cl=(e,t,n)=>{if(!(e=Ml(e)).length)return{scrollX:0,scrollY:0};let[r,i,o,a]=tt(e);((e,t,n)=>{const[r,i,o,a]=n,{x:s,y:l}=tn({sceneX:r,sceneY:i},e),{x:c,y:d}=tn({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]=et(e),l=Ne((i+a)/2,(o+s)/2,t.x,t.y);l<n&&(n=l,r=e)})),et(r)})(e,en({clientX:t.scrollX,clientY:t.scrollY},t)));return ll({scenePoint:{x:(r+o)/2,y:(i+a)/2},viewportDimensions:{width:t.width,height:t.height},zoom:t.zoom})},dl=e=>Math.max(.1,Math.min(e,30)),ul=(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 hl=()=>{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},pl=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")})},gl=e=>{let{children:t,label:n,long:i=!1,style:o}=e;return(0,r.useEffect)((()=>()=>hl().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();pl(t,i)})(e.currentTarget,hl(),n,i),onPointerLeave:()=>hl().classList.remove("excalidraw-tooltip--visible"),style:o,children:t})};n(196),n(1106);const fl=i().forwardRef(((e,t)=>{let{children:n,padding:r,className:i,style:o}=e;return(0,v.jsx)("div",{className:we("Island",i),style:Object.assign({"--padding":r},o),ref:t,children:n})}));n(8328);const ml=e=>{const{theme:t=o.C6.LIGHT,closeOnClickOutside:n=!0}=e,r=bl(t);if(!r)return null;return(0,lt.createPortal)((0,v.jsxs)("div",{className:we("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)},bl=e=>{const[t,n]=(0,r.useState)(null),i=pg(),o=(0,r.useRef)(i.isMobile);o.current=i.isMobile;const{container:a}=fg();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},vl=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}=fg();(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)(ml,{className:we("Dialog",e.className),labelledBy:"dialog-title",maxWidth:e.small?550:800,onCloseRequest:s,theme:e.theme,closeOnClickOutside:e.closeOnClickOutside,children:(0,v.jsxs)(fl,{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:pg().isMobile?ns:ts})]}),(0,v.jsx)("div",{className:"Dialog__content",children:e.children})]})})};n(4678);var yl=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 xl=e=>{const{onConfirm:t,onCancel:n,children:r,confirmText:i=b("buttons.confirm"),cancelText:o=b("buttons.cancel"),className:a=""}=e,s=yl(e,["onConfirm","onCancel","children","confirmText","cancelText","className"]);return(0,v.jsxs)(vl,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)(ol,{type:"button",title:o,"aria-label":o,label:o,onClick:n,className:"confirm-dialog--cancel"}),(0,v.jsx)(ol,{type:"button",title:i,"aria-label":i,label:i,onClick:t,className:"confirm-dialog--confirm"})]})]}))},wl=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)(ol,{type:"button",icon:Oa,title:b("buttons.clearReset"),"aria-label":b("buttons.clearReset"),showAriaLabel:pg().isMobile,onClick:o,"data-testid":"clear-canvas-button"}),n&&(0,v.jsx)(xl,{onConfirm:()=>{t(),o()},onCancel:o,title:b("clearCanvasDialog.title"),children:(0,v.jsxs)("p",{className:"clear-canvas__content",children:[" ",b("alerts.clearReset")]})})]})},_l=($s({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)(ya,{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})})}}),$s({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({},vn()),{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)(wl,{onConfirm:t})}}),$s({name:"zoomIn",trackEvent:{category:"canvas"},perform:(e,t,n,r)=>({appState:Object.assign(Object.assign({},t),ul({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:dl(t.zoom.value+o.V4)},t)),commitToHistory:!1}),PanelComponent:e=>{let{updateData:t}=e;return(0,v.jsx)(ol,{type:"button",icon:za,title:"".concat(b("buttons.zoomIn")," — ").concat(Jt("CtrlOrCmd++")),"aria-label":b("buttons.zoomIn"),onClick:()=>{t(null)},size:"small"})},keyTest:e=>(e.code===ht||e.code===gt)&&(e[Lt.CTRL_OR_CMD]||e.shiftKey)})),kl=$s({name:"zoomOut",trackEvent:{category:"canvas"},perform:(e,t,n,r)=>({appState:Object.assign(Object.assign({},t),ul({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:dl(t.zoom.value-o.V4)},t)),commitToHistory:!1}),PanelComponent:e=>{let{updateData:t}=e;return(0,v.jsx)(ol,{type:"button",icon:Da,title:"".concat(b("buttons.zoomOut")," — ").concat(Jt("CtrlOrCmd+-")),"aria-label":b("buttons.zoomOut"),onClick:()=>{t(null)},size:"small"})},keyTest:e=>(e.code===pt||e.code===ft)&&(e[Lt.CTRL_OR_CMD]||e.shiftKey)}),El=($s({name:"resetZoom",trackEvent:{category:"canvas"},perform:(e,t,n,r)=>({appState:Object.assign(Object.assign({},t),ul({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:dl(1)},t)),commitToHistory:!1}),PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,v.jsx)(gl,{label:b("buttons.resetZoom"),style:{height:"100%"},children:(0,v.jsxs)(ol,{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===_t||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)}),Cl=(e,t,n)=>{const r=Ol(e),i=Nl(r,t),o=n&&i.length>0?tt(i):tt(r),a={value:El(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),ll({scenePoint:{x:u,y:h},viewportDimensions:{width:t.width,height:t.height},zoom:a})),{zoom:a}),commitToHistory:!1}},Sl=($s({name:"zoomToSelection",trackEvent:{category:"canvas"},perform:(e,t)=>Cl(e,t,!0),keyTest:e=>e.code===xt&&e.shiftKey&&!e.altKey&&!e[Lt.CTRL_OR_CMD]}),$s({name:"zoomToFit",trackEvent:{category:"canvas"},perform:(e,t)=>Cl(e,t,!1),keyTest:e=>e.code===yt&&e.shiftKey&&!e.altKey&&!e[Lt.CTRL_OR_CMD]}),$s({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)(al,{value:t.theme,onChange:e=>{n(e)}})})},keyTest:e=>e.altKey&&e.shiftKey&&e.code===Ct}),$s({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:En(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)(ol,{type:"button",icon:Ns,className:we("eraser",{active:En(n)}),title:"".concat(b("toolBar.eraser"),"-").concat(Jt("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)")}),Il=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=Kn.getScene(a))||void 0===e?void 0:e.getElement(t);if(!r)return;const{textAlign:s,verticalAlign:l}=r,u=$n(Wt(r));if(r&&Ce(r)){let e=r.x,t=r.y;const a=sr(r);let c=r.width,p=r.height,g=r.width,f=r.height;if(a&&r.containerId){const n=((e,t)=>{const n=t.style.fontFamily.replace(/"/g,"");return Ut({fontFamily:e.fontFamily})!==n||"".concat(e.fontSize,"px")!==t.style.fontSize})(r,h),i=Number(h.style.height.slice(0,-2));if(i>0&&(f=i),n&&(d=a.height,f=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,f>p){const e=Math.min(f-p,u);return void Nr(a,{height:a.height+e})}if(a.height>d&&f<p){const e=Math.min(p-f,u);Nr(a,{height:a.height-e})}else l===o.oX.MIDDLE&&(t=a.y+a.height/2-f/2),l===o.oX.BOTTOM&&(t=a.y+a.height-f-o.gK)}const[m,b]=i(e,t),v=h.selectionStart,y=h.selectionEnd,x=h.value.length;if(h.value=r.originalText,v===y&&y!==x){const e=x-y;h.selectionStart=h.value.length-e,h.selectionEnd=h.value.length-e}const w=r.originalText.split("\n"),_=r.containerId?u:r.height/w.length;a||(c=(n.width-8-m)/n.zoom.value);const k=(n.height-b)/n.zoom.value,E=a?a.angle:r.angle;Object.assign(h.style,{font:Wt(r),lineHeight:"".concat(_,"px"),width:"".concat(g,"px"),height:"".concat(f,"px"),left:"".concat(m,"px"),top:"".concat(b,"px"),transform:Sl(g,f,E,n,c,k),textAlign:s,verticalAlign:l,color:r.strokeColor,opacity:r.opacity/100,filter:"var(--theme-filter)",maxWidth:"".concat(c,"px"),maxHeight:"".concat(k,"px")}),pn()&&(h.style.fontFamily=Ut(r)),Nr(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";ze(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=Kn.getScene(a))||void 0===e?void 0:e.getElement(t),i=Wt(r),o=h.scrollHeight/$n(i);if(ze(a)&&o>1){let e="auto";if(2===o){const t=sr(a);1===er(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&&_l.keyTest(e))e.preventDefault(),c.actionManager.executeAction(_l),u();else if(!e.shiftKey&&kl.keyTest(e))e.preventDefault(),c.actionManager.executeAction(kl),u();else if(tl.keyTest(e))c.actionManager.executeAction(tl);else if(nl.keyTest(e))c.actionManager.executeAction(nl);else if(e.key===Lt.ESCAPE)e.preventDefault(),w=!0,_();else if(e.key===Lt.ENTER&&e[Lt.CTRL_OR_CMD]){if(e.preventDefault(),e.isComposing||229===e.keyCode)return;w=!0,_()}else(e.key===Lt.TAB||e[Lt.CTRL_OR_CMD]&&(e.code===vt||e.code===bt))&&(e.preventDefault(),e.shiftKey||e.code===vt?v():b(),h.dispatchEvent(new Event("input")))};const f=" ".repeat(4),m=new RegExp("^ {1,".concat(4,"}")),b=()=>{const{selectionStart:e,selectionEnd:t}=h,n=y();let r=h.value;n.forEach((e=>{const t=r.slice(0,e),n=r.slice(e);r="".concat(t).concat(f).concat(n)})),h.value=r,h.selectionStart=e+4,h.selectionEnd=t+4*n.length},v=()=>{const{selectionStart:e,selectionEnd:t}=h,n=y(),r=[];let i=h.value;n.forEach((e=>{const t=i.slice(e,e+4).match(m);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))},y=()=>{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()},x=e=>{e.preventDefault(),e.stopPropagation()};let w=!1;const _=()=>{var e;k();const t=null===(e=Kn.getScene(a))||void 0===e?void 0:e.getElement(a.id);if(!t)return;let n=h.value;const i=sr(t);if(i)if(n=t.text,h.value){const e=or(i);e&&e===a.id||Nr(i,{boundElements:(i.boundElements||[]).concat({type:"text",id:a.id})})}else{var o;Nr(i,{boundElements:null===(o=i.boundElements)||void 0===o?void 0:o.filter((e=>!Ce(e)))})}r({text:n,viaKeyboard:w,originalText:h.value})},k=()=>{I||(I=!0,h.onblur=null,h.oninput=null,h.onkeydown=null,j&&j.disconnect(),window.removeEventListener("resize",u),window.removeEventListener("wheel",x,!0),window.removeEventListener("pointerdown",C),window.removeEventListener("pointerup",E),window.removeEventListener("blur",_),S(),h.remove())},E=e=>{window.removeEventListener("pointerup",E);const t=null==e?void 0:e.target,n=t instanceof HTMLInputElement&&t.closest(".color-picker-input")&&Ft(t);setTimeout((()=>{h.onblur=_,t&&n&&(t.onblur=()=>{h.focus()}),n||h.focus()}))},C=e=>{const t=e.target instanceof HTMLInputElement&&e.target.closest(".color-picker-input")&&Ft(e.target);((e.target instanceof HTMLElement||e.target instanceof SVGElement)&&e.target.closest(".".concat(o.$C.SHAPE_ACTIONS_MENU))&&!Ft(e.target)||t)&&(h.onblur=null,window.addEventListener("pointerup",E),window.addEventListener("blur",_))},S=Kn.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(),E();let j=null;s&&"ResizeObserver"in window?(j=new window.ResizeObserver((()=>{u()})),j.observe(s)):window.addEventListener("resize",u),window.addEventListener("pointerdown",C),window.addEventListener("wheel",x,{passive:!1,capture:!0}),null==l||l.querySelector(".excalidraw-textEditorContainer").appendChild(h)},jl=(e,t)=>Boolean(!e.viewModeEnabled&&(e.editingElement||Nl(t,e).length||"selection"!==e.activeTool.type&&"eraser"!==e.activeTool.type)),Tl=e=>e.reduce(((e,t)=>e+t.version),0),Ml=e=>e.filter((e=>!e.isDeleted&&!Ur(e))),Ol=e=>e.filter((e=>!e.isDeleted)),Al=e=>!e.isDeleted,Ll=e=>Ol(e).map((e=>Te(e.type)?Object.assign(Object.assign({},e),{lastCommittedPoint:null}):e)),Pl=e=>Ll(e),zl=e=>Ll(e),Dl=(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}},Rl=(e,t)=>e.some((e=>t.selectedElementIds[e.id])),Bl=(e,t,n)=>{const r=Array.from(new Set(Nl(e,t).map((e=>n(e)))));return 1===r.length?r[0]:null},Nl=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return e.filter((e=>t.selectedElementIds[e.id]||n&&ze(e)&&t.selectedElementIds[null==e?void 0:e.containerId]?e:null))},Hl=(e,t)=>t.editingElement?[t.editingElement]:Nl(e,t,!0),Fl=(e,t)=>{if(e.editingGroupId){const n=$r(Ol(t),e.editingGroupId);if(n.length)return Object.assign(Object.assign({},e),{selectedElementIds:{[n[0].id]:!0}})}return e},Ul=$s({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=Co.getElement(n);if(!a)return!1;if(null==r||a.points.length<2){const n=e.filter((e=>e.id!==a.id)),r=Fl(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 Co.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]||ze(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=Fl(r,n),{elements:n,appState:Object.assign(Object.assign({},r),{activeTool:Object.assign(Object.assign({},t.activeTool),{type:"selection"}),multiElement:null}),commitToHistory:Rl(Ol(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)(ol,{type:"button",icon:Oa,title:b("labels.delete"),"aria-label":b("labels.delete"),onClick:()=>r(null),visible:Rl(Ol(t),n)})}}),Wl=(e,t)=>{let n=[],r=[],i=null,o=-1;const a=hn(Nl(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},Kl=(e,t,n)=>{if("containerId"in e&&e.containerId){if("left"!==n)return t.indexOf(e);{const n=Kn.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=Kn.getScene(e).getElement(o);if(r)return t.indexOf(r)}}},Vl=(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=Kl(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=Kl(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=$r(t,d);return u.length?"left"===r?t.indexOf(u[0]):t.indexOf(u[u.length-1]):a},Gl=(e,t)=>t.reduce(((t,n)=>{const r=e[n];return t[r.id]=r,t}),{}),Yl=(e,t,n)=>{const r=Wl(t,e),i=Gl(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=Vl(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]?Fr(e):e))},Zl=(e,t,n)=>{const r=Wl(e,t),i=Gl(e,r),o=[];let a,s;if("left"===n){if(t.editingGroupId){const n=$r(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=$r(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=>Fr(e))),c=e.slice(0,a),d=e.slice(s+1);return"left"===n?[...c,...l,...o,...d]:[...c,...o,...l,...d]},Xl=(e,t)=>Yl(t,e,"left"),ql=(e,t)=>Yl(t,e,"right"),$l=(e,t)=>Zl(e,t,"left"),Ql=(e,t)=>Zl(e,t,"right"),Jl=$s({name:"sendBackward",trackEvent:{category:"element"},perform:(e,t)=>({elements:Xl(e,t),appState:t,commitToHistory:!0}),contextItemLabel:"labels.sendBackward",keyPriority:40,keyTest:e=>e[Lt.CTRL_OR_CMD]&&!e.shiftKey&&e.code===vt,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(Jt("CtrlOrCmd+[")),children:(0,v.jsx)(Wa,{theme:n.theme})})}}),ec=$s({name:"bringForward",trackEvent:{category:"element"},perform:(e,t)=>({elements:ql(e,t),appState:t,commitToHistory:!0}),contextItemLabel:"labels.bringForward",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.bringForward")," — ").concat(Jt("CtrlOrCmd+]")),children:(0,v.jsx)(Ua,{theme:n.theme})})}}),tc=$s({name:"sendToBack",trackEvent:{category:"element"},perform:(e,t)=>({elements:$l(e,t),appState:t,commitToHistory:!0}),contextItemLabel:"labels.sendToBack",keyTest:e=>ct?e[Lt.CTRL_OR_CMD]&&e.altKey&&e.code===vt:e[Lt.CTRL_OR_CMD]&&e.shiftKey&&e.code===vt,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(Jt(ct?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")),children:(0,v.jsx)(Va,{theme:n.theme})})}}),nc=$s({name:"bringToFront",trackEvent:{category:"element"},perform:(e,t)=>({elements:Ql(e,t),appState:t,commitToHistory:!0}),contextItemLabel:"labels.bringToFront",keyTest:e=>ct?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:e=>t(null),title:"".concat(b("labels.bringToFront")," — ").concat(Jt(ct?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")),children:(0,v.jsx)(Ka,{theme:n.theme})})}}),rc=$s({name:"selectAll",trackEvent:{category:"canvas"},perform:(e,t)=>!t.editingLinearElement&&{appState:Xr(Object.assign(Object.assign({},t),{editingGroupId:null,selectedElementIds:e.reduce(((e,t)=>(t.isDeleted||Ce(t)&&t.containerId||!1!==t.locked||(e[t.id]=!0),e)),{})}),Ol(e)),commitToHistory:!0},contextItemLabel:"labels.selectAll",keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.key===Lt.A}),ic=$s({name:"duplicateSelection",trackEvent:{category:"element"},perform:(e,t)=>{if(t.editingLinearElement){const n=Co.duplicateSelectedPoints(t);return!!n&&{elements:e,appState:n.appState,commitToHistory:!0}}return Object.assign(Object.assign({},oc(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)(ol,{type:"button",icon:rs,title:"".concat(b("labels.duplicateSelection")," — ").concat(Jt("CtrlOrCmd+D")),"aria-label":b("labels.duplicateSelection"),onClick:()=>r(null),visible:Rl(Ol(t),n)})}}),oc=(e,t)=>{const n=new Map,r=[],i=[],a=new Map,s=e=>{const s=li(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=hn(Nl(e,t,!0));for(;c<e.length;){const n=e[c];if(d.get(n.id)){if(n.groupIds.length){const r=Yr(t,n);if(r){const t=$r(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 Gn(l,i,a),qo(l,i,a),{elements:l,appState:Xr(Object.assign(Object.assign({},t),{selectedGroupIds:{},selectedElementIds:r.reduce(((e,t)=>(ze(t)||(e[t.id]=!0),e)),{})}),Ol(l))}},ac=$s({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=Co.getElement(n);if(o)return Me(o)&&jo(o,r,i),{elements:o.points.length<2||Ur(o)?e.filter((e=>e.id!==o.id)):void 0,appState:Object.assign(Object.assign({},t),{cursorButton:"up",editingLinearElement:null}),commitToHistory:!0}}let s=e;t.pendingImageElement&&Nr(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||Nr(l,{points:l.points.slice(0,-1)})}Ur(l)&&(s=s.slice(0,-1));const e=He(l.points,t.zoom.value);if(("line"===l.type||"freedraw"===l.type)&&e){const e=l.points,t=e[0];Nr(l,{points:e.map(((n,r)=>r===e.length-1?[t[0],t[1]]:n))})}if(Me(l)&&!e&&l.points.length>1){const[e,n]=Co.getPointAtIndexGlobalCoordinates(l,-1);Ao(l,t,Kn.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||Gt(o),{elements:s,appState:Object.assign(Object.assign({},t),{cursorButton:"up",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)(ol,{type:"button",icon:Ra,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 sc=e=>{const{id:t}=fg(),[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})]})},lc=(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=st.elementBackground.slice(1),i=st.elementStroke.slice(1);return{background:r[n%r.length],stroke:i[n%i.length]}};let cc;!function(e){e.ACTIVE="active",e.AWAY="away",e.IDLE="idle"}(cc||(cc={}));var dc,uc;n(4404);const hc="undefined"!=typeof process&&null!==(dc={REACT_APP_BACKEND_V2_GET_URL:"https://json.excalidraw.com/api/v2/",REACT_APP_BACKEND_V2_POST_URL:"https://json.excalidraw.com/api/v2/post/",REACT_APP_LIBRARY_URL:"https://libraries.excalidraw.com",REACT_APP_LIBRARY_BACKEND:"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries",REACT_APP_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!==dc&&dc.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!==(uc={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!==uc&&uc.JEST_WORKER_ID,(e,t,n,r)=>{}),pc=document.createElement("img");pc.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 gc=!1;const fc=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=bc(d.current.value);!t.link&&e&&hc("hyperlink","create"),Nr(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);Cc(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)((()=>{hc("hyperlink","delete"),Nr(t,{link:null}),u&&(d.current.value=""),i({showHyperlinkPopup:!1})}),[i,t,u]),{x:g,y:f}=mc(t,n);return n.draggingElement||n.resizingElement||n.isRotating||n.openMenu?null:(0,v.jsxs)("div",{className:"excalidraw-hyperlinkContainer",style:{top:"".concat(f,"px"),left:"".concat(g,"px"),width:320,padding:5},children:[u?(0,v.jsx)("input",{className:we("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:we("excalidraw-hyperlinkContainer-link",{"d-none":u}),target:vc(t.link)?"_self":"_blank",onClick:e=>{if(t.link&&a){const n=gn(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)(ol,{type:"button",title:b("buttons.edit"),"aria-label":b("buttons.edit"),label:b("buttons.edit"),onClick:()=>{hc("hyperlink","edit","popup-ui"),i({showHyperlinkPopup:"editor"})},className:"excalidraw-hyperlinkContainer--edit",icon:Bs}),s&&(0,v.jsx)(ol,{type:"button",title:b("buttons.remove"),"aria-label":b("buttons.remove"),label:b("buttons.remove"),onClick:p,className:"excalidraw-hyperlinkContainer--remove",icon:Oa})]})]})},mc=(e,t)=>{const[n,r]=Ze(e),{x:i,y:o}=tn({sceneX:n+e.width/2,sceneY:r},t);return{x:i-t.offsetLeft-160,y:o-t.offsetTop-85}},bc=e=>((e=e.trim())&&(e.includes("://")||/^[[\\/]/.test(e)||(e="https://".concat(e))),e),vc=e=>!!(null!=e&&e.includes(location.origin)||null!=e&&e.startsWith("/")),yc=$s({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)=>xc(e,t),contextItemPredicate:(e,t)=>1===Nl(e,t).length,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;const i=Nl(t,n);return(0,v.jsx)(ol,{type:"button",icon:Sa,"aria-label":b(xc(t,n)),title:"".concat(b("labels.link.label")," - ").concat(Jt("CtrlOrCmd+K")),onClick:()=>r(null),selected:1===i.length&&!!i[0].link})}}),xc=(e,t)=>Nl(e,t)[0].link?"labels.link.edit":"labels.link.create",wc=(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,f=i-p-c+h,[m,b]=De(g+s/2,f+l/2,d,u,t);return[m-s/2,b-l/2,s,l]},_c=(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&&Wi(e,[i,o],a))return!0;const[s,l,c,d]=Ze(e),[u,h,p,g]=wc([s,l,c,d],e.angle,t);return i>u-a&&i<u+a+p&&o>h-a&&o<h+g+a};let kc=null;const Ec=(e,t)=>{if(!e.link)return;const n=hl();n.classList.add("excalidraw-tooltip--visible"),n.style.maxWidth="20rem",n.textContent=e.link;const[r,i,o,a]=Ze(e),[s,l,c,d]=wc([r,i,o,a],e.angle,t),u=tn({sceneX:s,sceneY:l},t);pl(n,{left:u.x,top:u.y,width:c,height:d},"top"),hc("hyperlink","tooltip","link-icon"),gc=!0},Cc=(e,t,n)=>{let[r,i]=n;const{x:o,y:a}=en({clientX:r,clientY:i},t),s=15/t.zoom.value;if(Wi(e,[o,a],s))return!1;const[l,c,d]=Ze(e);if(o>=l&&o<=d&&a>=c-85&&a<=c)return!1;const{x:u,y:h}=mc(e,t);return!(r>=u-s&&r<=u+320+10+s&&i>=h-s&&i<=h+s+10+42)},Sc=(()=>{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]})(),Ic=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()},jc=(e,t,n,r)=>{e.beginPath(),e.arc(t,n,r,0,2*Math.PI),e.fill(),e.stroke()},Tc=(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 m=e.filter((e=>Rc(e,p,g,{zoom:s.zoom,offsetLeft:t.offsetLeft,offsetTop:t.offsetTop,scrollX:s.scrollX,scrollY:s.scrollY})));if(m.forEach((e=>{try{Ir(e,i,h,s),u||Dc(e,h,t)}catch(e){console.error(e)}})),t.editingLinearElement){const e=Co.getElement(t.editingLinearElement.elementId);e&&((e,t,n,r)=>{e.save(),e.translate(n.scrollX,n.scrollY),e.lineWidth=1/n.zoom.value,Co.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}=Co;jc(e,r[0],r[1],s/2/n.zoom.value)})),e.restore()})(h,t,s,e)}if(n)try{Ir(n,i,h,s)}catch(e){console.error(e)}if(Io(t)&&t.suggestedBindings.filter((e=>null!=e)).forEach((e=>{Ac(h,s,e)})),c&&!t.multiElement&&!t.editingLinearElement){const n=e.reduce(((e,n)=>{const r=[];if(t.selectedElementIds[n.id]&&!Gr(t,n)&&r.push(ot.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}=lc(r||e,t);return i}))),r.length){const[t,i,o,a]=Ze(n);e.push({angle:n.angle,elementX1:t,elementY1:i,elementX2:o,elementY2:a,selectionColors:r})}return e}),[]),r=t=>{const r=$r(e,t),[i,o,a,s]=tt(r);n.push({angle:0,elementX1:i,elementX2:a,elementY1:o,elementY2:s,selectionColors:[ot.black]})};for(const e of Zr(t))r(e);t.editingGroupId&&r(t.editingGroupId),n.forEach((e=>Oc(h,s,e)));const i=Nl(e,t);if(h.save(),h.translate(s.scrollX,s.scrollY),1===i.length){h.fillStyle=ot.white;const e=mi(i[0],s.zoom,"mouse");t.viewModeEnabled||Mc(h,s,e,i[0].angle)}else if(i.length>1&&!t.isRotating){const e=4/s.zoom.value;h.fillStyle=ot.white;const[t,n,r,o]=tt(i),a=h.getLineDash();h.setLineDash([2/s.zoom.value]);const l=h.lineWidth;h.lineWidth=1/s.zoom.value,Ic(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=fi([t,n,r,o],0,s.zoom,"mouse",di);i.some((e=>!e.locked))&&Mc(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}=lc(l||e,t);h.save(),h.strokeStyle=d,h.fillStyle=c;const u=s.remotePointerUserStates[e];(a||u===cc.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 f=s.remotePointerUsernames[e];let m="";u===cc.AWAY?m=Sc?"⚫️":" (".concat(cc.AWAY,")"):u===cc.IDLE?m=Sc?"💤":" (".concat(cc.IDLE,")"):u===cc.ACTIVE&&(m=Sc?"🟢":"");const v="".concat(f?"".concat(f," "):"").concat(m);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=ot.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]=tt(e),u=t/a.value,h=n/a.value,p=t-u,g=n-h,m={top:parseInt(nn("sat")),bottom:parseInt(nn("sab")),left:parseInt(nn("sal")),right:parseInt(nn("sar"))},b=f().rtl,v=p/2-i+m.left,y=g/2-o+m.top,x=v+u-m.right,w=y+h-m.bottom,_=Math.min(s,v),k=Math.min(l,y),E=Math.max(c,x),C=Math.max(d,w);return{horizontal:v===_&&x===E?null:{x:Math.max(m.left,4)+(v-_)/(E-_)*t,y:n-6-Math.max(4,m.bottom),width:(x-v)/(E-_)*t-Math.max(8,m.left+m.right),height:6},vertical:y===k&&w===C?null:{x:b?Math.max(m.left,4):t-6-Math.max(m.right,4),y:(y-k)/(C-k)*n+Math.max(m.top,4),width:6,height:(w-y)/(C-k)*n-Math.max(8,m.top+m.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:m.length>0,scrollBars:v}},Mc=(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?jc(e,o[0]+o[2]/2,o[1]+o[3]/2,o[2]/2):Ic(e,o[0],o[1],o[2],o[3],o[0]+o[2]/2,o[1]+o[3]/2,r,!0),e.restore())}))},Oc=(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,Ic(e,i-u,o-u,c+2*u,d+2*u,i+c/2,o+d/2,r);e.restore()},Ac=(e,t,n)=>{const r=Array.isArray(n)?Pc:Lc;e.save(),e.translate(t.scrollX,t.scrollY),r(e,n),e.restore()},Lc=(e,t)=>{const[n,r,i,o]=Ze(t),a=i-n,s=o-r,l=Vi(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":Ic(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)}},Pc=(e,t)=>{const[n,r,i]=t,o=Vi(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]=Co.getPointAtIndexGlobalCoordinates(n,t);jc(e,r,i,o)}))};let zc;const Dc=(e,t,n)=>{if(e.link&&!n.selectedElementIds[e.id]){const[r,i,o,a]=Ze(e),[s,l,c,d]=wc([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),zc&&zc.zoom===n.zoom.value)t.drawImage(zc,s-u,l-h,c,d);else{zc=document.createElement("canvas"),zc.zoom=n.zoom.value,zc.width=c*window.devicePixelRatio*n.zoom.value,zc.height=d*window.devicePixelRatio*n.zoom.value;const e=zc.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(pc,0,0,c,d),e.restore(),t.drawImage(zc,s-u,l-h,c,d)}t.restore()}},Rc=(e,t,n,r)=>{const[i,o,a,s]=et(e),l=en({clientX:r.offsetLeft,clientY:r.offsetTop},r),c=en({clientX:r.offsetLeft+t,clientY:r.offsetTop+n},r);return l.x<=a&&l.y<=s&&c.x>=i&&c.y>=o};var Bc=Object.defineProperty,Nc=(e,t)=>()=>(e&&(t=e(e=0)),t),Hc=(e,t)=>{for(var n in t)Bc(e,n,{get:t[n],enumerable:!0})},Fc={};Hc(Fc,{default:()=>Uc});var Uc,Wc=Nc((()=>{Uc=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()})))})),Kc={};Hc(Kc,{default:()=>Gc});var Vc,Gc,Yc=Nc((()=>{Vc=async e=>{let t=await e.getFile();return t.handle=e,t},Gc=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(Vc));return e[0].multiple?r:r[0]}})),Zc={};Hc(Zc,{default:()=>Xc});var Xc,qc=Nc((()=>{Xc=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()})))})),$c={};Hc($c,{default:()=>Jc});var Qc,Jc,ed=Nc((()=>{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,t.handle=a,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)]},Jc=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)}})),td={};Hc(td,{default:()=>nd});var nd,rd=Nc((()=>{nd=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}})),id={};Hc(id,{default:()=>od});var od,ad=Nc((()=>{od=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)}})),sd=(()=>{if(typeof self>"u")return!1;if("top"in self&&self!==top)try{top.location}catch{return!1}else if("showOpenFilePicker"in self)return"showOpenFilePicker";return!1})(),ld=sd?Promise.resolve().then((()=>(Yc(),Kc))):Promise.resolve().then((()=>(Wc(),Fc)));sd?Promise.resolve().then((()=>(ed(),$c))):Promise.resolve().then((()=>(qc(),Zc)));var cd=sd?Promise.resolve().then((()=>(ad(),id))):Promise.resolve().then((()=>(rd(),td)));const dd=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 ld).default(...e)}({description:e.description,extensions:a,mimeTypes:i,multiple:null!==(r=e.multiple)&&void 0!==r&&r,legacySetup:(t,n,r)=>{const i=Kt(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 il))}}})},ud=(e,t)=>async function(...e){return(await cd).default(...e)}(e,{fileName:"".concat(t.name,".").concat(t.extension),description:t.description,extensions:[".".concat(t.extension)]},t.fileHandle),hd={selection:!0,text:!0,rectangle:!0,diamond:!0,ellipse:!0,line:!0,image:!0,arrow:!0,freedraw:!0,eraser:!1},pd=(e,t)=>{var n,r,i,o,a,s,l,c,d,u,h,p,g,f,m;const b={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||Br(),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:Te(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:un(),link:null!==(f=e.link)&&void 0!==f?f:null,locked:null!==(m=e.locked)&&void 0!==m&&m};return Object.assign(Object.assign(Object.assign({},b),Kr(b)),t)},gd=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 pd(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 pd(e,{points:e.points,lastCommittedPoint:null,simulatePressure:e.simulatePressure,pressures:e.pressures});case"image":return pd(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}=Co.getNormalizedPoints(e)),pd(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 pd(e,{})}},fd=(e,t)=>{const n=t?hn(t):null;return(e||[]).reduce(((e,t)=>{if("selection"!==t.type&&!Ur(t)){let r=gd(t);if(r){const i=null==n?void 0:n.get(t.id);i&&i.version>r.version&&(r=Fr(r,i.version)),e.push(r)}}return e}),[])},md=(e,t)=>{var n,r,i,o;e=e||{};const a=vn(),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),{cursorButton:(null==t?void 0:t.cursorButton)||"up",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:hd[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})},bd=(e,t,n)=>({elements:fd(null==e?void 0:e.elements,n),appState:md(null==e?void 0:e.appState,t||null),files:(null==e?void 0:e.files)||{}}),vd=e=>{const t=fd(Ol(e.elements),null);return t.length?Object.assign(Object.assign({},e),{elements:t}):null},yd=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;const n=[];for(const r of e)if(Array.isArray(r)){const e=vd({status:t,elements:r,id:Br(),created:Date.now()});e&&n.push(e)}else{const e=r,i=vd(Object.assign(Object.assign({},e),{id:e.id||Br(),status:e.status||t,created:e.created||Date.now()}));i&&n.push(i)}return n},xd=async e=>{let t;if(e.type===o.LO.png)try{return await(await Promise.resolve().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.resolve().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},wd=e=>{var t;return e&&(null===(t=e.name.match(/\.(json|excalidraw|png|svg)$/))||void 0===t?void 0:t[1])||null},_d=e=>{const t=wd(e);return"png"===t||"svg"===t},kd=e=>{const{type:t}=e||{};return!!t&&o.jo.includes(t)},Ed=async(e,t,n)=>{const r=await xd(e);try{const i=JSON.parse(r);if(!Pd(i))throw new Error(b("alerts.couldNotLoadInvalidFile"));return bd({elements:zl(i.elements||[]),appState:Object.assign(Object.assign({theme:null==t?void 0:t.theme,fileHandle:e.handle||null},_n(i.appState||{})),t?cl(i.elements||[],t):{}),files:i.files},t,n)}catch(e){throw console.error(e.message),new Error(b("alerts.couldNotLoadInvalidFile"))}},Cd=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unpublished";const n=await xd(e),r=JSON.parse(n);if(!zd(r))throw new Error("Invalid library");const i=r.libraryItems||r.library;return yd(i,t)},Sd=async e=>new Promise(((t,n)=>{try{e.toBlob((e=>{if(!e)return n(new rl(b("canvasError.canvasTooBig"),"CANVAS_POSSIBLY_TOO_BIG"));t(e)}))}catch(e){n(e)}})),Id=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),_e(40)}var t},jd=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)})),Td=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(!kd(e))throw new Error(b("errors.unsupportedFileType"));return new File([await a.toBlob(e,{max:t.maxWidthOrHeight})],e.name,{type:t.outputType||e.type})},Md=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})},Od=(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},Ad=(e,t,n,r)=>{const i={type:o.r8.excalidraw,version:o.Kr.excalidraw,source:o.pb,elements:"local"===r?zl(e):Pl(e),appState:"local"===r?_n(t):kn(t),files:"local"===r?Od(e,n):void 0};return JSON.stringify(i,null,2)},Ld=async(e,t,n)=>{const r=Ad(e,t,n,"local"),i=new Blob([r],{type:o.LO.excalidraw});return{fileHandle:await ud(i,{name:t.name,extension:"excalidraw",description:"Excalidraw file",fileHandle:_d(t.fileHandle)?null:t.fileHandle})}},Pd=e=>(null==e?void 0:e.type)===o.r8.excalidraw&&(!e.elements||Array.isArray(e.elements)&&(!e.appState||"object"==typeof e.appState)),zd=e=>"object"==typeof e&&e&&e.type===o.r8.excalidrawLibrary&&(1===e.version||2===e.version),Dd=e=>{const t={type:o.r8.excalidrawLibrary,version:o.Kr.excalidrawLibrary,source:o.pb,libraryItems:e};return JSON.stringify(t,null,2)},Rd=e=>new Promise(((t,n)=>{const r=new Image;r.onload=()=>{t(r)},r.onerror=e=>{n(e)},r.src=e})),Bd=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=Rd(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}},Nd=e=>e.filter((e=>ke(e))),Hd="\x3c!-- svg-source:excalidraw --\x3e",Fd=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]=Wd(e,a),{canvas:p,scale:g=1}=l(u,h),f=vn(),{imageCache:m}=await Bd({imageCache:new Map,fileIds:Nd(e).map((e=>e.fileId)),files:n});return Tc(e,t,null,g,ye.canvas(p),p,{viewBackgroundColor:i?s:null,scrollX:-c+a,scrollY:-d+a,zoom:f.zoom,remotePointerViewportCoords:{},remoteSelectedElementIds:{},shouldCacheIgnoreZoom:!1,remotePointerUsernames:{},remotePointerUserStates:{},theme:t.exportWithDarkMode?"dark":"light",imageCache:m,renderScrollbars:!1,renderSelection:!1,renderGrid:!1,isExporting:!0}),p},Ud=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.resolve().then(n.bind(n,673))).encodeSvgMetadata({text:Ad(e,t,r||{},"local")})}catch(e){console.error(e)}const[d,u,h,p]=Wd(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(Hd,"\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{Tr(e,t,n,r,e.x+i,e.y+o,a)}catch(e){console.error(e)}}))}(e,ye.svg(g),g,r||{},{offsetX:-d+i,offsetY:-u+i,exportWithDarkMode:t.exportWithDarkMode}),g},Wd=(e,t)=>{const[n,r,i,o]=tt(e);return[n,r,Vt(n,i)+2*t,Vt(r,o)+t+t]},Kd=32,Vd=12,Gd=256,Yd="NOT_SPREADSHEET",Zd="VALID_SPREADSHEET",Xd=e=>{const t=/^[$€£¥₩]?([0-9,]+(\.[0-9]+)?)$/.exec(e);return t?parseFloat(t[1].replace(/,/g,"")):null},qd=(e,t)=>e.slice(1).every((e=>null!==Xd(e[t]))),$d=e=>{const t=e[0].length;if(t>2)return{type:Yd,reason:"More than 2 columns"};if(1===t){if(!qd(e,0))return{type:Yd,reason:"Value is not numeric"};const t=null===Xd(e[0][0]),n=(t?e.slice(1):e).map((e=>Xd(e[0])));return n.length<2?{type:Yd,reason:"Less than two rows"}:{type:Zd,spreadsheet:{title:t?e[0][0]:null,labels:null,values:n}}}const n=qd(e,0)?0:1;if(!qd(e,n))return{type:Yd,reason:"Value is not numeric"};const r=(n+1)%2,i=null===Xd(e[0][n]),o=i?e.slice(1):e;return o.length<2?{type:Yd,reason:"Less than 2 rows"}:{type:Zd,spreadsheet:{title:i?e[0][n]:null,labels:o.map((e=>e[r])),values:o.map((e=>Xd(e[n])))}}},Qd=st.elementBackground.slice(2,st.elementBackground.length),Jd={fillStyle:"hachure",fontFamily:o.rk,fontSize:o.n5,opacity:100,roughness:1,strokeColor:st.elementStroke[0],strokeSharpness:"sharp",strokeStyle:"solid",strokeWidth:1,verticalAlign:o.oX.MIDDLE,locked:!1},eu=e=>({chartWidth:44*e.values.length+Vd,chartHeight:280}),tu=(e,t,n,r,i)=>{var o;return(null===(o=e.labels)||void 0===o?void 0:o.map(((e,o)=>ii(Object.assign(Object.assign({groupIds:[r],backgroundColor:i},Jd),{text:e.length>8?"".concat(e.slice(0,5),"..."):e,x:t+44*o+24,y:n+6,width:Kd,angle:5.87,fontSize:16,textAlign:"center",verticalAlign:"top"})))))||[]},nu=(e,t,n,r,i)=>{const o=ii(Object.assign(Object.assign({groupIds:[r],backgroundColor:i},Jd),{x:t-Vd,y:n-Vd,text:"0",textAlign:"right"}));return[o,ii(Object.assign(Object.assign({groupIds:[r],backgroundColor:i},Jd),{x:t-Vd,y:n-Gd-o.height/2,text:Math.max(...e.values).toLocaleString(),textAlign:"right"}))]},ru=(e,t,n,r,i)=>{const{chartWidth:o,chartHeight:a}=eu(e);return[ai(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Jd),{type:"line",x:t,y:n,startArrowhead:null,endArrowhead:null,width:o,points:[[0,0],[o,0]]})),ai(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Jd),{type:"line",x:t,y:n,startArrowhead:null,endArrowhead:null,height:a,points:[[0,0],[0,-a]]})),ai(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Jd),{type:"line",x:t,y:n-Gd-Vd,startArrowhead:null,endArrowhead:null,strokeStyle:"dotted",width:o,opacity:50,points:[[0,0],[o,0]]}))]},iu=(e,t,n,r,i,a)=>{const{chartWidth:s,chartHeight:l}=eu(e),c=e.title?ii(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Jd),{text:e.title,x:t+s/2,y:n-Gd-24-o.n5,strokeSharpness:"sharp",strokeStyle:"solid",textAlign:"center"})):null,d=a?ni(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Jd),{type:"rectangle",x:t,y:n-l,width:s,height:l,strokeColor:st.elementStroke[0],fillStyle:"solid",opacity:6})):null;return[...d?[d]:[],...c?[c]:[],...tu(e,t,n,r,i),...nu(e,t,n,r,i),...ru(e,t,n,r,i)]},ou=(e,t,n,r)=>"line"===e?((e,t,n)=>{const r=Math.max(...e.values),i=Br(),a=Qd[Math.floor(Math.random()*Qd.length)];let s=0;const l=[];for(const t of e.values){const e=44*s,n=-t/r*Gd;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=ai(Object.assign(Object.assign({backgroundColor:a,groupIds:[i]},Jd),{type:"line",x:t+Vd+16,y:n-Vd,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*Gd+6;return ni(Object.assign(Object.assign({backgroundColor:a,groupIds:[i]},Jd),{fillStyle:"solid",strokeWidth:2,type:"ellipse",x:t+s+16,y:n+l-24,width:Vd,height:Vd}))})),f=e.values.map(((e,o)=>{const s=44*o+6,l=e/r*Gd+6+Vd;return ai(Object.assign(Object.assign({backgroundColor:a,groupIds:[i]},Jd),{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[...iu(e,t,n,i,a,"production"===o.Vi.DEVELOPMENT),p,...f,...g]})(t,n,r):((e,t,n)=>{const r=Math.max(...e.values),i=Br(),a=Qd[Math.floor(Math.random()*Qd.length)];return[...e.values.map(((e,o)=>{const s=e/r*Gd;return ni(Object.assign(Object.assign({backgroundColor:a,groupIds:[i]},Jd),{type:"rectangle",x:t+44*o+Vd,y:n-s-Vd,width:Kd,height:s}))})),...iu(e,t,n,i,a,"production"===o.Vi.DEVELOPMENT)]})(t,n,r);let au="",su=!1;const lu="clipboard"in navigator&&"readText"in navigator.clipboard,cu="clipboard"in navigator&&"writeText"in navigator.clipboard,du="clipboard"in navigator&&"write"in navigator.clipboard&&"ClipboardItem"in window&&"toBlob"in HTMLCanvasElement.prototype,uu=()=>{if(!au)return{};try{return JSON.parse(au)}catch(e){return console.error(e),{}}},hu=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:Yd,reason:"No values"};const n=t[0].length,r=t.every((e=>e.length===n));if(!r)return{type:Yd,reason:"All rows don't have same number of columns"};const i=$d(t);if(i.type!==Zd){const e=$d((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===Zd)return e}return i})(e);return t.type===Zd?{spreadsheet:t.spreadsheet}:null},pu=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():lu&&await navigator.clipboard.readText())||""}catch(e){return""}})(e);if(!t||t.includes(Hd))return uu();const n=hu(t);if(n)return n;const r=uu();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 su&&r.elements?r:{text:t}}var i},gu=async e=>{let t=!1;if(cu)try{await navigator.clipboard.writeText(e||""),t=!0}catch(e){console.error(e)}if(!t&&!fu(e||" "))throw new Error("couldn't copy")},fu=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},mu=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 Ud(t,{exportBackground:s,exportWithDarkMode:r.exportWithDarkMode,viewBackgroundColor:c,exportPadding:l,exportScale:r.exportScale,exportEmbedScene:r.exportEmbedScene&&"svg"===e},i);if("svg"===e)return await ud(new Blob([n.outerHTML],{type:o.LO.svg}),{description:"Export to SVG",name:d,extension:r.exportEmbedScene?"excalidraw.svg":"svg",fileHandle:u});if("clipboard-svg"===e)return void await gu(n.outerHTML)}const h=await Fd(t,r,i,{exportBackground:s,viewBackgroundColor:c,exportPadding:l});if(h.style.display="none",document.body.appendChild(h),"png"===e){let e=await Sd(h);return h.remove(),r.exportEmbedScene&&(e=await(await Promise.resolve().then(n.bind(n,673))).encodePngMetadata({blob:e,metadata:Ad(t,r,i,"local")})),await ud(e,{description:"Export to PNG",name:d,extension:r.exportEmbedScene?"excalidraw.png":"png",fileHandle:u})}if("clipboard"!==e)throw h.remove(),new Error("Unsupported export type");try{const e=Sd(h);await(async e=>{let t;try{t=navigator.clipboard.write([new window.ClipboardItem({[o.LO.png]:e})])}catch(t){if(!mn(e))throw t;await navigator.clipboard.write([new window.ClipboardItem({[o.LO.png]:await e})])}await t})(e)}catch(e){if("CANVAS_POSSIBLY_TOO_BIG"===e.name)throw e;throw new Error(b("alerts.couldNotCopyToClipboard"))}finally{h.remove()}};n(7225);const bu=e=>{let{children:t,checked:n,onChange:r,className:i}=e;return(0,v.jsxs)("div",{className:we("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:Ca}),(0,v.jsx)("div",{className:"Checkbox-label",children:t})]})};n(4623);const vu=e=>{let{children:t,gap:n,align:r,justifyContent:i,className:o,style:a}=e;return(0,v.jsx)("div",{className:we("Stack Stack_horizontal",o),style:Object.assign({"--gap":n,alignItems:r,justifyContent:i},a),children:t})},yu=e=>{let{children:t,gap:n,align:r,justifyContent:i,className:o}=e;return(0,v.jsx)("div",{className:we("Stack Stack_vertical",o),style:{"--gap":n,justifyItems:r,justifyContent:i},children:t})};n(554);const xu=e=>{let{fileName:t,onSave:n}=e;return(0,v.jsxs)(vu,{className:"ActiveFile",gap:1,align:"center",children:[(0,v.jsxs)("span",{className:"ActiveFile__fileName",children:[is,(0,v.jsx)("span",{children:t})]}),(0,v.jsx)(ol,{type:"icon",icon:Ia,title:b("buttons.save"),"aria-label":b("buttons.save"),onClick:n,"data-testid":"save-button"})]})},wu=($s({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)(sc,{label:b("labels.fileTitle"),value:t.name||"Unnamed",onChange:e=>n(e),isNameEditable:void 0===r.name&&!t.viewModeEnabled})}}),$s({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=Ol(t),a=Rl(i,n)?Nl(i,n):i;return(0,v.jsx)(v.Fragment,{children:o.ZB.map((e=>{const[t,i]=((e,t,n)=>{const[,,r,i]=Wd(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)(ol,{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)}))})}}),$s({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)(bu,{checked:t.exportBackground,onChange:e=>n(e),children:b("labels.withBackground")})}}),$s({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)(bu,{checked:t.exportEmbedScene,onChange:e=>n(e),children:[b("labels.exportEmbedScene"),(0,v.jsx)(gl,{label:b("labels.exportEmbedScene_details"),long:!0,children:(0,v.jsx)("div",{className:"excalidraw-tooltip-icon",children:Fa})})]})}}),$s({name:"saveToActiveFile",trackEvent:{category:"export"},perform:async(e,t,n,r)=>{const i=!!t.fileHandle;try{const{fileHandle:n}=_d(t.fileHandle)?await(async(e,t,n)=>{const{exportBackground:r,viewBackgroundColor:i,name:o,fileHandle:a}=t,s=wd(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 mu(s,Ol(e),t,n,{exportBackground:r,viewBackgroundColor:i,name:o,fileHandle:a}),{fileHandle:a}})(e,t,r.files):await Ld(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)(xu,{onSave:()=>n(null),fileName:null===(t=r.fileHandle)||void 0===t?void 0:t.name})}}),$s({name:"saveFileToDisk",trackEvent:{category:"export"},perform:async(e,t,n,r)=>{try{const{fileHandle:n}=await Ld(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)(ol,{type:"button",icon:ja,title:b("buttons.saveAs"),"aria-label":b("buttons.saveAs"),showAriaLabel:pg().isMobile,hidden:!sd,onClick:()=>t(null),"data-testid":"save-as-button"})}}));$s({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 dd({description:"Excalidraw files"});return Ed(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)(ol,{type:"button",icon:Ta,title:b("buttons.load"),"aria-label":b("buttons.load"),showAriaLabel:pg().isMobile,onClick:t,"data-testid":"load-button"})}}),$s({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)(al,{value:t.exportWithDarkMode?o.C6.DARK:o.C6.LIGHT,onChange:e=>{n(e===o.C6.DARK)},title:b("labels.toggleExportColorScheme")})})}});let _u="{}";const ku=$s({name:"copyStyles",trackEvent:{category:"element"},perform:(e,t)=>{const n=e.find((e=>t.selectedElementIds[e.id]));return n&&(_u=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}),Eu=$s({name:"pasteStyles",trackEvent:{category:"element"},perform:(e,t)=>{const n=JSON.parse(_u);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)&&(Nr(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}),Vn(t,sr(t))),t}return e})),commitToHistory:!0};var r},contextItemLabel:"labels.pasteStyles",keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.altKey&&e.code===Tt}),Cu=e=>(0,v.jsx)("button",{className:"help-icon",onClick:e.onClick,type:"button",title:"".concat(e.title," — ?"),"aria-label":e.title,children:Fa}),Su=($s({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)(ol,{type:"button",icon:Ba,"aria-label":b("buttons.menu"),onClick:n,selected:"canvas"===t.openMenu})}}),$s({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)(ol,{visible:jl(n,Ol(t)),type:"button",icon:Aa,"aria-label":b("buttons.edit"),onClick:r,selected:"shape"===n.openMenu})}}),$s({name:"toggleFullScreen",trackEvent:{category:"canvas",predicate:e=>!Qt()},perform:()=>(Qt()||document.documentElement.requestFullscreen(),Qt()&&document.exitFullscreen(),{commitToHistory:!1}),keyTest:e=>e.code===It&&!e[Lt.CTRL_OR_CMD]}),$s({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)(Cu,{title:b("helpDialog.title"),onClick:t})},keyTest:e=>e.key===Lt.QUESTION_MARK}),(e,t)=>{const n=Nl(Ol(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&&qr(t,n)),!0))return!0}return!1})(n)}),Iu=$s({name:"group",trackEvent:{category:"element"},perform:(e,t)=>{const n=Nl(Ol(e),t,!0);if(n.length<2)return{appState:t,elements:e,commitToHistory:!1};const r=Zr(t);if(1===r.length){const i=r[0],o=new Set($r(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=Br(),o=hn(n),a=e.map((e=>o.get(e.id)?Hr(e,{groupIds:Qr(e.groupIds,i,t.editingGroupId)}):e)),s=$r(a,i),l=s[s.length-1],c=a.lastIndexOf(l),d=a.slice(c+1),u=[...a.slice(0,c).filter((e=>!qr(e,i))),...s,...d];return{appState:Vr(i,Object.assign(Object.assign({},t),{selectedGroupIds:{}}),Ol(u)),elements:u,commitToHistory:!0}},contextItemLabel:"labels.group",contextItemPredicate:(e,t)=>Su(e,t),keyTest:e=>!e.shiftKey&&e[Lt.CTRL_OR_CMD]&&e.code===St,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)(ol,{hidden:!Su(t,n),type:"button",icon:(0,v.jsx)(os,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.group")," — ").concat(Jt("CtrlOrCmd+G")),"aria-label":b("labels.group"),visible:Rl(Ol(t),n)})}}),ju=$s({name:"ungroup",trackEvent:{category:"element"},perform:(e,t)=>{if(0===Zr(t).length)return{appState:t,elements:e,commitToHistory:!1};const n=[],r=e.map((e=>{ze(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=Xr(Object.assign(Object.assign({},t),{selectedGroupIds:{}}),Ol(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===St,contextItemLabel:"labels.ungroup",contextItemPredicate:(e,t)=>Zr(t).length>0,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)(ol,{type:"button",hidden:0===Zr(n).length,icon:(0,v.jsx)(as,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.ungroup")," — ").concat(Jt("CtrlOrCmd+Shift+G")),"aria-label":b("labels.ungroup"),visible:Rl(Ol(t),n)})}});n(2789);const Tu=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})},Mu=($s({name:"goToCollaborator",trackEvent:{category:"collab"},perform:(e,t,n)=>{const r=n;return r?{appState:Object.assign(Object.assign(Object.assign({},t),ll({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}=lc(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)(Tu,{color:a,border:l?"transparent":s,onClick:()=>n(o.pointer),children:l?(0,v.jsx)("img",{referrerPolicy:"no-referrer",src:l,alt:c}):c})}}),$s({name:"addToLibrary",trackEvent:{category:"element"},perform:(e,t,n,r)=>{const i=Nl(Ol(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:Br(),status:"unpublished",elements:i.map(si),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"})),Ou=(e,t,n)=>{let{axis:r,position:i}=n;const o=it(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})},Au=(e,t)=>Nl(Ol(e),t).length>1,Lu=(e,t,n)=>{const r=((e,t)=>{const n=Jr(e),r=it(e);return n.flatMap((e=>{const n=Ou(e,r,t);return e.map((e=>Hr(e,{x:e.x+n.x,y:e.y+n.y})))}))})(Nl(Ol(e),t),n),i=hn(r);return e.map((e=>i.get(e.id)||e))},Pu=($s({name:"alignTop",trackEvent:{category:"element"},perform:(e,t)=>({appState:t,elements:Lu(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)(ol,{hidden:!Au(t,n),type:"button",icon:(0,v.jsx)(Ga,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.alignTop")," — ").concat(Jt("CtrlOrCmd+Shift+Up")),"aria-label":b("labels.alignTop"),visible:Rl(Ol(t),n)})}}),$s({name:"alignBottom",trackEvent:{category:"element"},perform:(e,t)=>({appState:t,elements:Lu(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)(ol,{hidden:!Au(t,n),type:"button",icon:(0,v.jsx)(Ya,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.alignBottom")," — ").concat(Jt("CtrlOrCmd+Shift+Down")),"aria-label":b("labels.alignBottom"),visible:Rl(Ol(t),n)})}}),$s({name:"alignLeft",trackEvent:{category:"element"},perform:(e,t)=>({appState:t,elements:Lu(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)(ol,{hidden:!Au(t,n),type:"button",icon:(0,v.jsx)(Za,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.alignLeft")," — ").concat(Jt("CtrlOrCmd+Shift+Left")),"aria-label":b("labels.alignLeft"),visible:Rl(Ol(t),n)})}}),$s({name:"alignRight",trackEvent:{category:"element"},perform:(e,t)=>({appState:t,elements:Lu(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)(ol,{hidden:!Au(t,n),type:"button",icon:(0,v.jsx)(Xa,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.alignRight")," — ").concat(Jt("CtrlOrCmd+Shift+Right")),"aria-label":b("labels.alignRight"),visible:Rl(Ol(t),n)})}}),$s({name:"alignVerticallyCentered",trackEvent:{category:"element"},perform:(e,t)=>({appState:t,elements:Lu(e,t,{position:"center",axis:"y"}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)(ol,{hidden:!Au(t,n),type:"button",icon:(0,v.jsx)(Qa,{theme:n.theme}),onClick:()=>r(null),title:b("labels.centerVertically"),"aria-label":b("labels.centerVertically"),visible:Rl(Ol(t),n)})}}),$s({name:"alignHorizontallyCentered",trackEvent:{category:"element"},perform:(e,t)=>({appState:t,elements:Lu(e,t,{position:"center",axis:"x"}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)(ol,{hidden:!Au(t,n),type:"button",icon:(0,v.jsx)(Ja,{theme:n.theme}),onClick:()=>r(null),title:b("labels.centerHorizontally"),"aria-label":b("labels.centerHorizontally"),visible:Rl(Ol(t),n)})}}),(e,t)=>Nl(Ol(e),t).length>1),zu=(e,t,n)=>{const r=((e,t)=>{const[n,r,i,o]="x"===t.axis?["minX","midX","maxX","width"]:["minY","midY","maxY","height"],a=it(e),s=Jr(e).map((e=>[e,it(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})))}))})(Nl(Ol(e),t),n),i=hn(r);return e.map((e=>i.get(e.id)||e))},Du=($s({name:"distributeHorizontally",trackEvent:{category:"element"},perform:(e,t)=>({appState:t,elements:zu(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)(ol,{hidden:!Pu(t,n),type:"button",icon:(0,v.jsx)(qa,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.distributeHorizontally")," — ").concat(Jt("Alt+H")),"aria-label":b("labels.distributeHorizontally"),visible:Rl(Ol(t),n)})}}),$s({name:"distributeVertically",trackEvent:{category:"element"},perform:(e,t)=>({appState:t,elements:zu(e,t,{space:"between",axis:"y"}),commitToHistory:!0}),keyTest:e=>!e[Lt.CTRL_OR_CMD]&&e.altKey&&e.code===Tt,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,v.jsx)(ol,{hidden:!Pu(t,n),type:"button",icon:(0,v.jsx)($a,{theme:n.theme}),onClick:()=>r(null),title:"".concat(b("labels.distributeVertically")," — ").concat(Jt("Alt+V")),"aria-label":b("labels.distributeVertically"),visible:Rl(Ol(t),n)})}}),$s({name:"flipHorizontal",trackEvent:{category:"element"},perform:(e,t)=>({elements:Bu(e,t,"horizontal"),appState:t,commitToHistory:!0}),keyTest:e=>e.shiftKey&&"KeyH"===e.code,contextItemLabel:"labels.flipHorizontal",contextItemPredicate:(e,t)=>((e,t)=>{const n=Nl(Ol(e),t);return 1===n.length&&"text"!==n[0].type})(e,t)})),Ru=$s({name:"flipVertical",trackEvent:{category:"element"},perform:(e,t)=>({elements:Bu(e,t,"vertical"),appState:t,commitToHistory:!0}),keyTest:e=>e.shiftKey&&"KeyV"===e.code,contextItemLabel:"labels.flipVertical",contextItemPredicate:(e,t)=>((e,t)=>1===Nl(Ol(e),t).length)(e,t)}),Bu=(e,t,n)=>{const r=Nl(Ol(e),t);if(r.length>1)return e;const i=Nu(r,t,n),o=hn(i);return e.map((e=>o.get(e.id)||e))},Nu=(e,t,n)=>(e.forEach((e=>{Hu(e,t),"vertical"===n&&Fu(e,Math.PI)})),e),Hu=(e,t)=>{const n=e.x,r=e.y,i=e.width,o=e.height,a=ta(e.angle);let s=0;(je(e)||Se(e))&&(s=2*e.points.reduce(((e,t)=>Math.max(e,t[0])),0)-e.width),Nr(e,{angle:ta(0)});const l=mi(e,t.zoom);let c=!0,d=0,u=l.nw;if(!u&&(c=!1,u=l.ne,!u))return void Nr(e,{angle:a});if(je(e)){for(let t=1;t<e.points.length;t++)Co.movePoints(e,[{index:t,point:[-e.points[t][0],e.points[t][1]]}]);Co.normalizePoints(e)}else d=c?e.x+2*i:e.x-2*i,sa((new Map).set(e.id,e),!0,e,c?"nw":"ne",!1,d,u[1]),Nr(e,{width:i,height:o});let h=ta(2*Math.PI-a);h<0&&(h=ta(h+2*Math.PI)),Nr(e,{angle:h}),Nr(e,{x:n+s,y:r}),Ho(e)},Fu=(e,t)=>{const n=e.x,r=e.y;let i=ta(e.angle+t);i<0&&(i=ta(2*Math.PI+i)),Nr(e,{angle:i}),Nr(e,{x:n,y:r})},Uu=$s({name:"copy",trackEvent:{category:"element"},perform:(e,t,n,r)=>((async(e,t,n)=>{const r=Nl(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);au=a;try{su=!1,await gu(a)}catch(e){su=!0,console.error(e)}})(Ol(e),t,r.files),{commitToHistory:!1}),contextItemLabel:"labels.copy",keyTest:void 0}),Wu=$s({name:"cut",trackEvent:{category:"element"},perform:(e,t,n,r)=>(Uu.perform(e,t,n,r),Ul.perform(e,t)),contextItemLabel:"labels.cut",keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.code===Mt}),Ku=$s({name:"copyAsSvg",trackEvent:{category:"element"},perform:async(e,t,n,r)=>{if(!r.canvas)return{commitToHistory:!1};const i=Nl(Ol(e),t,!0);try{return await mu("clipboard-svg",i.length?i:Ol(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"}),Vu=$s({name:"copyAsPng",trackEvent:{category:"element"},perform:async(e,t,n,r)=>{if(!r.canvas)return{commitToHistory:!1};const i=Nl(Ol(e),t,!0);try{return await mu("clipboard",i.length?i:Ol(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}),Gu=$s({name:"copyText",trackEvent:{category:"element"},perform:(e,t)=>{const n=Nl(Ol(e),t,!0).reduce(((e,t)=>(Ce(t)&&e.push(t.text),e)),[]).join("\n\n");return gu(n),{commitToHistory:!1}},contextItemPredicate:(e,t)=>cu&&Nl(e,t,!0).some(Ce),contextItemLabel:"labels.copyText"}),Yu=$s({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===wt}),Zu=$s({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===Ot}),Xu=$s({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}),qu=$s({name:"unbindText",contextItemLabel:"labels.unbindText",trackEvent:{category:"element"},contextItemPredicate:(e,t)=>Nl(e,t).some((e=>Pe(e))),perform:(e,t)=>(Nl(Ol(e),t).forEach((e=>{const t=ar(e);if(t){var n;const{width:r,height:i,baseline:o}=Zn(t.originalText,Wt(t));Nr(t,{containerId:null,width:r,height:i,baseline:o,text:t.originalText}),Nr(e,{boundElements:null===(n=e.boundElements)||void 0===n?void 0:n.filter((e=>e.id!==t.id))})}})),{elements:e,appState:t,commitToHistory:!0})}),$u=$s({name:"bindText",contextItemLabel:"labels.bindText",trackEvent:{category:"element"},contextItemPredicate:(e,t)=>{const n=Nl(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===ar(t))return!0}return!1},perform:(e,t)=>{const n=Nl(Ol(e),t);let r,i;Ce(n[0])&&Le(n[1])?(r=n[0],i=n[1]):(r=n[1],i=n[0]),Nr(r,{containerId:i.id,verticalAlign:o.oX.MIDDLE}),Nr(i,{boundElements:(i.boundElements||[]).concat({type:"text",id:r.id})}),Vn(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}}}),Qu=$s({name:"toggleLock",trackEvent:{category:"element"},perform:(e,t)=>{const n=Nl(e,t,!0);if(!n.length)return!1;const r=Ju(n),i=hn(n);return{elements:e.map((e=>i.has(e.id)?Hr(e,{locked:"lock"===r}):e)),appState:t,commitToHistory:!0}},contextItemLabel:(e,t)=>{const n=Nl(e,t,!1);if(1===n.length)return n[0].locked?"labels.elementLock.unlock":"labels.elementLock.lock";if(n.length>1)return"lock"===Ju(n)?"labels.elementLock.lockAll":"labels.elementLock.unlockAll";throw new Error("Unexpected zero elements to lock/unlock. This should never happen.")},keyTest:(e,t,n)=>e.key.toLocaleLowerCase()===Lt.L&&e[Lt.CTRL_OR_CMD]&&e.shiftKey&&Nl(n,t,!1).length>0}),Ju=e=>e.some((e=>!e.locked))?"lock":"unlock",eh=(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=hn(e),a=i.elements,s=hn(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}},th=(e,t,n,r,i,o)=>{if(e.trackEvent)try{if("object"==typeof e.trackEvent){(!e.trackEvent.predicate||e.trackEvent.predicate(n,r,o))&&hc(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 nh{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=>{th(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 th(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();th(e,t,r,n,this.app,null),this.updater(e.perform(n,r,null,this.app))}}const rh=Symbol(),ih=e=>!!e[rh],oh=e=>{var t,n;null==(n=(t=e[rh]).c)||n.call(t)},ah=(e,t)=>{const n=e[rh].o,r=t[rh].o;return n===r||e===r||ih(n)&&ah(n,t)},sh=e=>{const t={o:e,c:null},n=new Promise((n=>{t.c=()=>{t.c=null,n()},e.then(t.c,t.c)}));return n[rh]=t,n};var lh=Object.defineProperty,ch=Object.defineProperties,dh=Object.getOwnPropertyDescriptors,uh=Object.getOwnPropertySymbols,hh=Object.prototype.hasOwnProperty,ph=Object.prototype.propertyIsEnumerable,gh=(e,t,n)=>t in e?lh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const fh=e=>"init"in e,mh="r",bh="w",vh="c",yh="s",xh=e=>{const t=new WeakMap,n=new WeakMap,r=new Map;let i,o;if(i=new Set,o=new Set,e)for(const[n,r]of e){const e={v:r,r:0,d:new Map};Object.freeze(e),fh(n)||console.warn("Found initial value for derived atom which can cause unexpected behavior",n),t.set(n,e)}const a=new WeakMap,s=new WeakMap,l=e=>{let t=s.get(e);return t||(t=new Map,s.set(e,t)),t},c=(e,n)=>{if(e){const t=l(e);let r=t.get(n);return r||(r=c(e.p,n),r&&("p"in r&&r.p.then((()=>t.delete(n))),t.set(n,r))),r}return t.get(n)},d=(e,n,i)=>{if(Object.freeze(i),e){l(e).set(n,i)}else{const e=t.get(n);t.set(n,i),r.has(n)||r.set(n,e)}},u=(e,t=new Map,n)=>{if(!n)return t;const r=new Map;let i=!1;return n.forEach((n=>{var o;const a=(null==(o=c(e,n))?void 0:o.r)||0;r.set(n,a),t.get(n)!==a&&(i=!0)})),t.size!==r.size||i?r:t},h=(e,t,n,r,i)=>{const o=c(e,t);if(o){if(i&&(!("p"in o)||!ah(o.p,i)))return o;"p"in o&&oh(o.p)}const a={v:n,r:(null==o?void 0:o.r)||0,d:u(e,null==o?void 0:o.d,r)};return o&&"v"in o&&Object.is(o.v,n)?a.d===o.d||a.d.size===o.d.size&&Array.from(a.d.keys()).every((e=>o.d.has(e)))||Promise.resolve().then((()=>{S(e)})):(++a.r,a.d.has(t)&&(a.d=new Map(a.d).set(t,a.r))),d(e,t,a),a},p=(e,t,n,r,i)=>{const o=c(e,t);if(o){if(i&&(!("p"in o)||!ah(o.p,i)))return o;"p"in o&&oh(o.p)}const a={e:n,r:(null==o?void 0:o.r)||0,d:u(e,null==o?void 0:o.d,r)};return d(e,t,a),a},g=(e,t,n,r)=>{const i=c(e,t);if(i&&"p"in i){if(ah(i.p,n))return i;oh(i.p)}((e,t,n)=>{let r=a.get(t);r||(r=new Map,a.set(t,r)),n.then((()=>{r.get(e)===n&&(r.delete(e),r.size||a.delete(t))})),r.set(e,n)})(e,t,n);const o={p:n,r:(null==i?void 0:i.r)||0,d:u(e,null==i?void 0:i.d,r)};return d(e,t,o),o},f=(e,t,n,r)=>{if(n instanceof Promise){const i=sh(n.then((n=>{h(e,t,n,r,i),S(e)})).catch((n=>{if(n instanceof Promise)return ih(n)?n.then((()=>{b(e,t,!0)})):n;p(e,t,n,r,i),S(e)})));return g(e,t,i,r)}return h(e,t,n,r)},m=(e,t)=>{const n=c(e,t);if(n){"p"in n&&oh(n.p);const r=((e,t)=>ch(e,dh(t)))(((e,t)=>{for(var n in t||(t={}))hh.call(t,n)&&gh(e,n,t[n]);if(uh)for(var n of uh(t))ph.call(t,n)&&gh(e,n,t[n]);return e})({},n),{i:n.r});d(e,t,r)}else console.warn("[Bug] could not invalidate non existing atom",t)},b=(e,t,r)=>{if(!r){const r=c(e,t);if(r){if(r.r!==r.i&&"p"in r&&r.p[rh].c)return r;if(r.d.forEach(((r,i)=>{if(i!==t)if(n.has(i)){const t=c(e,i);t&&t.r===t.i&&b(e,i)}else b(e,i)})),Array.from(r.d).every((([t,n])=>{const r=c(e,t);return r&&"v"in r&&r.r===n})))return r}}const i=new Set;try{const n=t.read((n=>{i.add(n);const r=n===t?c(e,n):b(e,n);if(r){if("e"in r)throw r.e;if("p"in r)throw r.p;return r.v}if(fh(n))return n.init;throw new Error("no atom init")}));return f(e,t,n,i)}catch(n){if(n instanceof Promise){const r=sh(n);return g(e,t,r,i)}return p(e,t,n,i)}},v=(e,t)=>b(t,e),y=(e,t)=>!t.l.size&&(!t.t.size||1===t.t.size&&t.t.has(e)),x=(e,t)=>{const r=n.get(t);null==r||r.t.forEach((n=>{n!==t&&(m(e,n),x(e,n))}))},w=(e,t,n)=>{let r=!0;const i=(t,n)=>{const r=b(e,t);if("e"in r)throw r.e;if("p"in r){if(null==n?void 0:n.unstable_promise)return r.p.then((()=>i(t,n)));throw console.info("Reading pending atom state in write operation. We throw a promise for now.",t),r.p}if("v"in r)return r.v;throw console.warn("[Bug] no value found while reading atom in write operation. This is probably a bug.",t),new Error("no value found")},o=t.write(i,((n,i)=>{let o;if(n===t){if(!fh(n))throw new Error("atom not writable");const t=(e=>{const t=new Set,n=a.get(e);return n&&(a.delete(e),n.forEach(((e,n)=>{oh(e),t.add(n)}))),t})(n);t.forEach((t=>{t!==e&&f(t,n,i)})),f(e,n,i),x(e,n)}else o=w(e,n,i);return r||S(e),o}),n);return r=!1,e=void 0,o},_=(e,t,n)=>{const r=w(n,e,t);return S(n),r},k=(e,t)=>{const r={t:new Set(t&&[t]),l:new Set};n.set(e,r),o.add(e);if(b(void 0,e).d.forEach(((t,r)=>{const i=n.get(r);i?i.t.add(e):r!==e&&k(r,e)})),(e=>!!e.write)(e)&&e.onMount){const t=t=>_(e,t),n=e.onMount(t);n&&(r.u=n)}return r},E=e=>{var t;const r=null==(t=n.get(e))?void 0:t.u;r&&r(),n.delete(e),o.delete(e);const i=c(void 0,e);i?i.d.forEach(((t,r)=>{if(r!==e){const t=n.get(r);t&&(t.t.delete(e),y(r,t)&&E(r))}})):console.warn("[Bug] could not find atom state to unmount",e)},C=(e,t,r)=>{const i=new Set(t.d.keys());null==r||r.forEach(((t,r)=>{if(i.has(r))return void i.delete(r);const o=n.get(r);o&&(o.t.delete(e),y(r,o)&&E(r))})),i.forEach((t=>{const r=n.get(t);r?r.t.add(e):n.has(e)&&k(t,e)}))},S=e=>{if(e){l(e).forEach(((r,i)=>{if(r!==t.get(i)){const t=n.get(i);null==t||t.l.forEach((t=>t(e)))}}))}else{for(;r.size;){const e=Array.from(r);r.clear(),e.forEach((([e,t])=>{const r=c(void 0,e);r&&r.d!==(null==t?void 0:t.d)&&C(e,r,null==t?void 0:t.d);const i=n.get(e);null==i||i.l.forEach((e=>e()))}))}i.forEach((e=>e()))}},I=(e,n)=>{n&&(e=>{l(e).forEach(((e,n)=>{const r=t.get(n);(e.r>((null==r?void 0:r.r)||0)||"v"in e&&e.r===(null==r?void 0:r.r)&&e.d!==(null==r?void 0:r.d))&&(t.set(n,e),e.d!==(null==r?void 0:r.d)&&C(n,e,null==r?void 0:r.d))}))})(n),S(void 0)},j=(e,t)=>{const r=(e=>{let t=n.get(e);return t||(t=k(e)),t})(e).l;return r.add(t),()=>{r.delete(t),(e=>{const t=n.get(e);t&&y(e,t)&&E(e)})(e)}},T=(e,t)=>{for(const[n,r]of e)fh(n)&&(f(t,n,r),x(t,n));S(t)};return{[mh]:v,[bh]:_,[vh]:I,[yh]:j,h:T,n:e=>(i.add(e),()=>{i.delete(e)}),l:()=>o.values(),a:e=>t.get(e),m:e=>n.get(e)}},wh=(e,t)=>({s:t?t(e).SECRET_INTERNAL_store:xh(e)}),_h=new Map,kh=e=>(_h.has(e)||_h.set(e,(0,r.createContext)(wh())),_h.get(e));var Eh=Object.defineProperty,Ch=Object.defineProperties,Sh=Object.getOwnPropertyDescriptors,Ih=Object.getOwnPropertySymbols,jh=Object.prototype.hasOwnProperty,Th=Object.prototype.propertyIsEnumerable,Mh=(e,t,n)=>t in e?Eh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Oh=(e,t)=>{for(var n in t||(t={}))jh.call(t,n)&&Mh(e,n,t[n]);if(Ih)for(var n of Ih(t))Th.call(t,n)&&Mh(e,n,t[n]);return e},Ah=(e,t)=>Ch(e,Sh(t));const Lh=e=>e.debugLabel||e.toString(),Ph=([e,t])=>Object.fromEntries(t.flatMap((t=>{var n,r;const i=null==(n=e.m)?void 0:n.call(e,t);if(!i)return[];const o=i.t,a=(null==(r=e.a)?void 0:r.call(e,t))||{};return[[Lh(t),Ah(Oh(Oh(Oh({},"e"in a&&{error:a.e}),"p"in a&&{promise:a.p}),"v"in a&&{value:a.v}),{dependents:Array.from(o).map(Lh)})]]}))),zh=({children:e,initialValues:t,scope:n,unstable_createStore:i,unstable_enableVersionedWrite:o})=>{const[a,s]=(0,r.useState)();(0,r.useEffect)((()=>{a&&(l.current.s.c(null,a),delete a.p)}),[a]);const l=(0,r.useRef)();l.current||(l.current=wh(t,i),o&&(l.current.w=e=>{s((t=>{const n=t?{p:t}:{};return e(n),n}))})),o||(e=>{const{s:t}=e,[n,i]=(0,r.useState)([]);(0,r.useEffect)((()=>{var e;const n=()=>{var e;i(Array.from((null==(e=t.l)?void 0:e.call(t))||[]))},r=null==(e=t.n)?void 0:e.call(t,n);return n(),r}),[t]),(0,r.useDebugValue)([t,n],Ph)})(l.current);const c=kh(n);return(0,r.createElement)(c.Provider,{value:l.current},e)};let Dh=0;function Rh(e,t){const n=kh(t),{s:i}=(0,r.useContext)(n),o=(0,r.useCallback)((t=>{const n=i.r(e,t);if("e"in n)throw n.e;if("p"in n)throw n.p;if("v"in n)return n.v;throw new Error("no atom value")}),[i,e]),[[a,s,l],c]=(0,r.useReducer)((0,r.useCallback)(((t,n)=>{const r=o(n);return Object.is(t[1],r)&&t[2]===e?t:[n,r,e]}),[o,e]),void 0,(()=>{const t=void 0;return[t,o(t),e]}));return l!==e&&c(void 0),(0,r.useEffect)((()=>{const t=i.s(e,c);return c(void 0),t}),[i,e]),(0,r.useEffect)((()=>{i.c(e,a)})),(0,r.useDebugValue)(s),s}function Bh(e,t){const n=kh(t),{s:i,w:o}=(0,r.useContext)(n);return(0,r.useCallback)((t=>{if(!("write"in e))throw new Error("not writable atom");const n=n=>i.w(e,t,n);return o?o(n):n()}),[i,o,e])}const Nh=Symbol(),Hh=(e=>{const t=xh(e),n=e=>new Promise(((r,i)=>{const o=t.r(e);"e"in o?i(o.e):r("p"in o?o.p.then((()=>n(e))):o.v)}));return{get:e=>{const n=t.r(e);if("e"in n)throw n.e;if(!("p"in n))return n.v},asyncGet:n,set:(e,n)=>t.w(e,n),sub:(e,n)=>t.s(e,n),SECRET_INTERNAL_store:t}})(),Fh=function(e,t){const n="atom"+ ++Dh,r={toString:()=>n};return"function"==typeof e?r.read=e:(r.init=e,r.read=e=>e(r),r.write=(e,t,n)=>t(r,"function"==typeof n?n(e(r)):n)),t&&(r.write=t),r}({status:"loaded",libraryItems:[]}),Uh=e=>JSON.parse(JSON.stringify(e)),Wh=(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))));const Kh=class{constructor(e){this.libraryItemsPromise=null,this.lastLibraryItems=[],this.resetLibrary=async()=>{this.saveLibrary([])},this.loadLibrary=()=>new Promise((async e=>{try{e(Uh(await(this.libraryItemsPromise||this.lastLibraryItems)))}catch(t){return e(this.lastLibraryItems)}})),this.saveLibrary=async e=>{const t=this.lastLibraryItems;try{var n,r;let t;if(mn(e)){const n=e.then((e=>Uh(e)));this.libraryItemsPromise=n,Hh.set(Fh,{status:"loading",promise:n,libraryItems:null}),t=await n}else t=Uh(e);this.lastLibraryItems=t,this.libraryItemsPromise=null,Hh.set(Fh,{status:"loaded",libraryItems:t}),await(null===(n=(r=this.app.props).onLibraryChange)||void 0===n?void 0:n.call(r,Uh(t)))}catch(e){throw this.lastLibraryItems=t,this.libraryItemsPromise=null,Hh.set(Fh,{status:"loaded",libraryItems:t}),e}},this.app=e}async importLibrary(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unpublished";return this.saveLibrary(new Promise((async(n,r)=>{try{let r;r=e instanceof Blob?await Cd(e,t):yd(await e,t);const i=this.lastLibraryItems,o=[];for(const e of r)Wh(i,e)&&o.push(e);n([...o,...i])}catch(e){r(new Error(b("errors.importLibraryError")))}})))}},Vh=e=>{const t=Array.from(e.values());return{x:Yh(t,(e=>e.x))/t.length,y:Yh(t,(e=>e.y))/t.length}},Gh=e=>{let[t,n]=e;return Math.hypot(t.x-n.x,t.y-n.y)},Yh=(e,t)=>e.reduce(((e,n)=>e+t(n)),0),Zh=e=>({selectedElementIds:e.selectedElementIds,selectedGroupIds:e.selectedGroupIds,viewBackgroundColor:e.viewBackgroundColor,editingLinearElement:e.editingLinearElement,editingGroupId:e.editingGroupId,name:e.name});const Xh=class{constructor(){this.elementCache=new Map,this.recording=!0,this.stateHistory=[],this.redoStack=[],this.lastEntry=null,this.generateEntry=(e,t)=>this.dehydrateHistoryEntry({appState:Zh(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,si(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)}},qh=[{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 $h={cut:[Jt("CtrlOrCmd+X")],copy:[Jt("CtrlOrCmd+C")],paste:[Jt("CtrlOrCmd+V")],copyStyles:[Jt("CtrlOrCmd+Alt+C")],pasteStyles:[Jt("CtrlOrCmd+Alt+V")],selectAll:[Jt("CtrlOrCmd+A")],deleteSelectedElements:[Jt("Del")],duplicateSelection:[Jt("CtrlOrCmd+D"),Jt("Alt+".concat(b("helpDialog.drag")))],sendBackward:[Jt("CtrlOrCmd+[")],bringForward:[Jt("CtrlOrCmd+]")],sendToBack:[Jt(ct?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")],bringToFront:[Jt(ct?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")],copyAsPng:[Jt("Shift+Alt+C")],copyAsSvg:[],group:[Jt("CtrlOrCmd+G")],ungroup:[Jt("CtrlOrCmd+Shift+G")],gridMode:[Jt("CtrlOrCmd+'")],zenMode:[Jt("Alt+Z")],stats:[Jt("Alt+/")],addToLibrary:[],flipHorizontal:[Jt("Shift+H")],flipVertical:[Jt("Shift+V")],viewMode:[Jt("Alt+R")],hyperlink:[Jt("CtrlOrCmd+K")],toggleLock:[Jt("CtrlOrCmd+Shift+L")]},Qh=e=>{const t=$h[e];return t&&t.length>0?t[0]:""},Jh=e=>{let{options:t,onCloseRequest:n,top:r,left:i,actionManager:o,appState:a,elements:s}=e;return(0,v.jsx)(pa,{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:we("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?Qh(i):""})]})},t)}))})})},ep=new WeakMap,tp={push(e){const t=Array.of();e.options.forEach((e=>{e&&t.push(e)})),t.length&&(0,lt.render)((0,v.jsx)(Jh,{top:e.top,left:e.left,options:t,onCloseRequest:()=>(e=>{const t=ep.get(e);t&&((0,lt.unmountComponentAtNode)(t),t.remove(),ep.delete(e))})(e.container),actionManager:e.actionManager,appState:e.appState,elements:e.elements}),(e=>{let t=ep.get(e);return t||(t=document.createElement("div"),e.querySelector(".excalidraw-contextMenuContainer").appendChild(t),ep.set(e,t),t)})(e.container))}},np=e=>{var t;let{appState:n,elements:r,renderAction:i,activeTool:o}=e;const a=Hl(Ol(r),n);let s=!1;2===a.length&&(Pe(a[0])||Pe(a[1]))&&(s=!0);const l=Boolean(n.editingElement),c=pg(),d="rtl"===document.documentElement.getAttribute("dir"),u=Fs(o)||a.some((e=>Fs(e.type)&&!ln(e.backgroundColor))),h=Fs(o)||a.some((e=>Fs(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:[(Us(o)&&"image"!==o&&"image"!==g||a.some((e=>Us(e.type))))&&i("changeStrokeColor"),h&&i("changeBackgroundColor"),u&&i("changeFillStyle"),(Ws(o)||a.some((e=>Ws(e.type))))&&i("changeStrokeWidth"),("freedraw"===o||a.some((e=>"freedraw"===e.type)))&&i("changeStrokeShape"),(Ks(o)||a.some((e=>Ks(e.type))))&&(0,v.jsxs)(v.Fragment,{children:[i("changeStrokeStyle"),i("changeSloppiness")]}),(Vs(o)||a.some((e=>Vs(e.type))))&&(0,v.jsx)(v.Fragment,{children:i("changeSharpness")}),(Gs(o)||a.some((e=>Gs(e.type))))&&(0,v.jsxs)(v.Fragment,{children:[i("changeFontSize"),i("changeFontFamily"),i("changeTextAlign")]}),a.some((e=>Pe(e)||ze(e)))&&i("changeVerticalAlign"),(Ys(o)||a.some((e=>Ys(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")]})]})]})},rp=e=>{let{canvas:t,activeTool:n,setAppState:r,onImageAction:i,appState:o}=e;return(0,v.jsx)(v.Fragment,{children:qh.map(((e,a)=>{let{value:s,icon:l,key:c}=e;const d=b("toolBar.".concat(s)),u=c&&("string"==typeof c?c:c[0]),h=u?"".concat(Ht(u)," ").concat(b("helpDialog.or")," ").concat(a+1):"".concat(a+1);return(0,v.jsx)(ol,{className:"Shape",type:"radio",icon:l,checked:n.type===s,name:"editor-current-shape",title:"".concat(Ht(d)," — ").concat(h),keyBindingLabel:"".concat(a+1),"aria-label":Ht(d),"aria-keyshortcuts":h,"data-testid":s,onPointerDown:e=>{let{pointerType:t}=e;o.penDetected||"pen"!==t||r({penDetected:!0,penMode:!0})},onChange:e=>{let{pointerType:a}=e;o.activeTool.type!==s&&hc("toolbar",s,"ui");const l=Object.assign(Object.assign({},n),{type:s});r({activeTool:l,multiElement:null,selectedElementIds:{}}),$t(t,Object.assign(Object.assign({},o),{activeTool:l})),"image"===s&&i({pointerType:a})}},s)}))})},ip=e=>{let{renderAction:t,zoom:n}=e;return(0,v.jsx)(yu,{gap:1,children:(0,v.jsxs)(vu,{gap:1,align:"center",children:[t("zoomOut"),t("zoomIn"),t("resetZoom")]})})},op=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 ap=e=>{let{isCollaborating:t,collaboratorCount:n,onClick:r}=e;return(0,v.jsx)(v.Fragment,{children:(0,v.jsx)(ol,{className:we("CollabButton",{"is-collaborating":t}),onClick:r,icon:es,type:"button",title:b("labels.liveCollaboration"),"aria-label":b("labels.liveCollaboration"),showAriaLabel:pg().isMobile,children:n>0&&(0,v.jsx)("div",{className:"CollabButton-collaborators",children:n})})})},sp=e=>{let{message:t,onClose:n}=e;const[o,a]=(0,r.useState)(!!t),{container:s}=fg(),l=i().useCallback((()=>{a(!1),n&&n(),null==s||s.focus()}),[n,s]);return(0,v.jsx)(v.Fragment,{children:o&&(0,v.jsx)(vl,{small:!0,onCloseRequest:l,title:b("errorDialog.title"),children:(0,v.jsx)("div",{style:{whiteSpace:"pre-wrap"},children:t})})})};n(2205);const lp="filter"in document.createElement("canvas").getContext("2d"),cp=()=>(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"),")"]})]}),dp=(e,t)=>{(0,lt.unmountComponentAtNode)(t),t.innerHTML="",e instanceof HTMLCanvasElement?t.appendChild(e):(0,lt.render)((0,v.jsx)(cp,{}),t)},up=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":ot[i][o],"--button-color-darker":ot[i][o+1],"--button-color-darkest":ot[i][o+2]},title:n,"aria-label":n,onClick:r,children:t})},hp=e=>{let{elements:t,appState:n,files:i,exportPadding:a=o.qy,actionManager:s,onExportToPng:l,onExportToSvg:c,onExportToClipboard:d}=e;const u=Rl(t,n),[h,p]=(0,r.useState)(u),g=(0,r.useRef)(null),{exportBackground:f,viewBackgroundColor:m}=n,y=h?Nl(t,n,!0):t;return(0,r.useEffect)((()=>{p(u)}),[u]),(0,r.useEffect)((()=>{const e=g.current;e&&Fd(y,n,i,{exportBackground:f,viewBackgroundColor:m,exportPadding:a}).then((t=>Sd(t).then((()=>{dp(t,e)})))).catch((t=>{console.error(t),dp(new rl,e)}))}),[n,i,y,f,a,m]),(0,v.jsxs)("div",{className:"ExportDialog",children:[(0,v.jsx)("div",{className:"ExportDialog__preview",ref:g}),lp&&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)(bu,{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)(vu,{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:!sd&&s.renderAction("changeProjectName")}),(0,v.jsxs)(vu,{gap:2,justifyContent:"center",style:{margin:"2em 0"},children:[(0,v.jsx)(up,{color:"indigo",title:b("buttons.exportToPng"),"aria-label":b("buttons.exportToPng"),onClick:()=>l(y),children:"PNG"}),(0,v.jsx)(up,{color:"red",title:b("buttons.exportToSvg"),"aria-label":b("buttons.exportToSvg"),onClick:()=>c(y),children:"SVG"}),du&&(0,v.jsx)(up,{title:b("buttons.copyPngToClipboard"),onClick:()=>d(y),color:"gray",shade:7,children:Ma})]})]})},pp=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)(ol,{onClick:()=>{p(!0)},"data-testid":"image-export-button",icon:La,type:"button","aria-label":b("buttons.exportImage"),showAriaLabel:pg().isMobile,title:b("buttons.exportImage")}),h&&(0,v.jsx)(vl,{onCloseRequest:g,title:b("buttons.exportImage"),children:(0,v.jsx)(hp,{elements:t,appState:n,files:a,exportPadding:s,actionManager:l,onExportToPng:c,onExportToSvg:d,onExportToClipboard:u,onCloseRequest:g})})]})};n(1310);const gp=e=>{let{children:t,side:n,className:r}=e;return(0,v.jsx)("div",{className:we("FixedSideContainer","FixedSideContainer_side_".concat(n),r),children:t})};n(7096);const fp=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(t.isLibraryOpen)return null;if(En(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=Nl(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&&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(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=Jt(i),(0,v.jsx)("div",{className:"HintViewer",children:(0,v.jsx)("span",{children:i})})):null},mp={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"})})},bp=e=>(0,v.jsxs)("label",{className:we("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?mp.CHECKED:mp.UNCHECKED})]});var vp=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 yp=e=>{let{heading:t,children:n}=e,r=vp(e,["heading","children"]);const{id:i}=fg(),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 xp=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:we("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)(gl,{label:r.username||"Unknown user",children:o.renderAction("goToCollaborator",{id:t})},t)}))})})),wp=(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"})}),_p=e=>{let{appState:t,setAppState:n,isMobile:r}=e;return(0,v.jsxs)("label",{className:we("ToolIcon ToolIcon_type_floating ToolIcon__library","ToolIcon_size_medium",{"is-mobile":r}),title:"".concat(Ht(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":Ht(b("toolBar.library")),"aria-keyshortcuts":"0"}),(0,v.jsx)("div",{className:"ToolIcon__icon",children:wp})]})},kp="medium",Ep={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"})]})},Cp=e=>e.penDetected?(0,v.jsxs)("label",{className:we("ToolIcon ToolIcon__penMode ToolIcon_type_floating","ToolIcon_size_".concat(kp),{"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?Ep.CHECKED:Ep.UNCHECKED})]}):e.isMobile?null:(0,v.jsx)("label",{className:we("ToolIcon ToolIcon__penMode ToolIcon_type_floating","ToolIcon_size_".concat(kp),{"is-mobile":e.isMobile}),children:(0,v.jsx)("div",{className:"ToolIcon__icon ToolIcon__hidden"})}),Sp=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:f,showThemeBtn:m,onImageAction:y,renderTopRightUI:x,UIOptions:w}=e;return(0,v.jsxs)(v.Fragment,{children:[!f&&(0,v.jsxs)(gp,{side:"top",className:"App-top-bar",children:[(0,v.jsx)("div",{}),(0,v.jsx)(yp,{heading:"shapes",children:e=>(0,v.jsxs)(yu,{gap:4,align:"center",children:[(0,v.jsxs)(vu,{gap:1,className:"App-toolbar-container",children:[(0,v.jsxs)(fl,{padding:1,className:"App-toolbar",children:[e,(0,v.jsx)(vu,{gap:1,children:(0,v.jsx)(rp,{appState:n,canvas:h,activeTool:n.activeTool,setAppState:l,onImageAction:e=>{let{pointerType:t}=e;y({insertOnCanvasDirectly:"mouse"!==t})}})})]}),(0,v.jsx)(ol,{type:"button",className:"HomeButton ToolIcon_type_floating",title:"Home","aria-label":"Home",icon:Hs,onClick:t},"home"),(0,v.jsx)(bp,{checked:n.activeTool.locked,onChange:d,title:b("toolBar.lock"),isMobile:!0}),(0,v.jsx)(_p,{appState:n,setAppState:l,isMobile:!0}),(0,v.jsx)(Cp,{checked:n.penMode,onChange:u,title:b("toolBar.penMode"),isMobile:!0,penDetected:n.penDetected})]}),i]})}),(0,v.jsx)("div",{style:{display:"flex"},children:null==x?void 0:x(!0,n,h)})]}),(0,v.jsx)("div",{className:"App-bottom-bar",style:{marginBottom:14,marginLeft:14,marginRight:14},children:(0,v.jsxs)(fl,{padding:0,children:[w.canvasActions&&"canvas"===n.openMenu?(0,v.jsx)(yp,{className:"App-mobile-menu",heading:"canvasActions",children:(0,v.jsx)("div",{className:"panelColumn",children:(0,v.jsxs)(yu,{gap:4,children:[f?(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)(ap,{isCollaborating:p,collaboratorCount:n.collaborators.size,onClick:c}),(0,v.jsx)(op,{actionManager:o,appState:n,setAppState:l,showThemeBtn:m})]}),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)(xp,{mobile:!0,layout:"horizontal",collaborators:n.collaborators,actionManager:o})]})]})})}):"shape"===n.openMenu&&!f&&jl(n,r)?(0,v.jsx)(yp,{className:"App-mobile-menu",heading:"selectedShapeActions",children:(0,v.jsx)(np,{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===Nl(r,n).length;return f?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({},cl(r,n)))},children:b("buttons.scrollBackToContent")})]})]})})]})};n(8051);const Ip=e=>{const t=(0,r.useRef)(null),[n,i]=(0,r.useState)(null);return(0,r.useLayoutEffect)((()=>{if(!e.spreadsheet)return;const n=ou(e.chartType,e.spreadsheet,0,0);let r;i(n);const o=t.current;return(async()=>{r=await Ud(n,{exportBackground:!1,viewBackgroundColor:ot.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})})},jp=e=>{let{setAppState:t,appState:n,onClose:r,onInsertChart:o}=e;const a=i().useCallback((()=>{r&&r()}),[r]),s=(e,n)=>{o(n),hc("magic","chart",e),t({currentChartType:e,pasteDialog:{shown:!1,data:null}})};return(0,v.jsx)(vl,{small:!0,onCloseRequest:a,title:b("labels.pasteCharts"),className:"PasteChartDialog",autofocus:!1,children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(Ip,{chartType:"bar",spreadsheet:n.pasteDialog.data,selected:"bar"===n.currentChartType,onClick:s}),(0,v.jsx)(Ip,{chartType:"line",spreadsheet:n.pasteDialog.data,selected:"line"===n.currentChartType,onClick:s})]})})};n(3922);const Tp=()=>(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")})]}),Mp=e=>(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("h3",{children:e.title}),e.children]}),Op=e=>(0,v.jsx)("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"space-between"},children:e.children}),Ap=e=>(0,v.jsx)("div",{style:{width:"49%"},children:e.children}),Lp=e=>(0,v.jsxs)("div",{className:"HelpDialog--island",children:[(0,v.jsx)("h3",{className:"HelpDialog--island-title",children:e.caption}),e.children]}),Pp=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)(zp,{children:t}),e.isOr&&n!==e.shortcuts.length-1&&b("helpDialog.or")]},n)))})]})});Pp.defaultProps={isOr:!0};const zp=e=>(0,v.jsx)("kbd",Object.assign({className:"HelpDialog--key"},e)),Dp=e=>{let{onClose:t}=e;const n=i().useCallback((()=>{t&&t()}),[t]);return(0,v.jsx)(v.Fragment,{children:(0,v.jsxs)(vl,{onCloseRequest:n,title:b("helpDialog.title"),className:"HelpDialog",children:[(0,v.jsx)(Tp,{}),(0,v.jsx)(Mp,{title:b("helpDialog.shortcuts"),children:(0,v.jsxs)(Op,{children:[(0,v.jsxs)(Ap,{children:[(0,v.jsxs)(Lp,{caption:b("helpDialog.tools"),children:[(0,v.jsx)(Pp,{label:b("toolBar.selection"),shortcuts:["V","1"]}),(0,v.jsx)(Pp,{label:b("toolBar.rectangle"),shortcuts:["R","2"]}),(0,v.jsx)(Pp,{label:b("toolBar.diamond"),shortcuts:["D","3"]}),(0,v.jsx)(Pp,{label:b("toolBar.ellipse"),shortcuts:["O","4"]}),(0,v.jsx)(Pp,{label:b("toolBar.arrow"),shortcuts:["A","5"]}),(0,v.jsx)(Pp,{label:b("toolBar.line"),shortcuts:["P","6"]}),(0,v.jsx)(Pp,{label:b("toolBar.freedraw"),shortcuts:["Shift + P","X","7"]}),(0,v.jsx)(Pp,{label:b("toolBar.text"),shortcuts:["T","8"]}),(0,v.jsx)(Pp,{label:b("toolBar.image"),shortcuts:["9"]}),(0,v.jsx)(Pp,{label:b("toolBar.library"),shortcuts:["0"]}),(0,v.jsx)(Pp,{label:b("toolBar.eraser"),shortcuts:[Jt("E")]}),(0,v.jsx)(Pp,{label:b("helpDialog.editSelectedShape"),shortcuts:[Jt("Enter"),b("helpDialog.doubleClick")]}),(0,v.jsx)(Pp,{label:b("helpDialog.textNewLine"),shortcuts:[Jt("Enter"),Jt("Shift+Enter")]}),(0,v.jsx)(Pp,{label:b("helpDialog.textFinish"),shortcuts:[Jt("Esc"),Jt("CtrlOrCmd+Enter")]}),(0,v.jsx)(Pp,{label:b("helpDialog.curvedArrow"),shortcuts:["A",b("helpDialog.click"),b("helpDialog.click"),b("helpDialog.click")],isOr:!1}),(0,v.jsx)(Pp,{label:b("helpDialog.curvedLine"),shortcuts:["L",b("helpDialog.click"),b("helpDialog.click"),b("helpDialog.click")],isOr:!1}),(0,v.jsx)(Pp,{label:b("toolBar.lock"),shortcuts:["Q"]}),(0,v.jsx)(Pp,{label:b("helpDialog.preventBinding"),shortcuts:[Jt("CtrlOrCmd")]}),(0,v.jsx)(Pp,{label:b("toolBar.link"),shortcuts:[Jt("CtrlOrCmd+K")]})]}),(0,v.jsxs)(Lp,{caption:b("helpDialog.view"),children:[(0,v.jsx)(Pp,{label:b("buttons.zoomIn"),shortcuts:[Jt("CtrlOrCmd++")]}),(0,v.jsx)(Pp,{label:b("buttons.zoomOut"),shortcuts:[Jt("CtrlOrCmd+-")]}),(0,v.jsx)(Pp,{label:b("buttons.resetZoom"),shortcuts:[Jt("CtrlOrCmd+0")]}),(0,v.jsx)(Pp,{label:b("helpDialog.zoomToFit"),shortcuts:["Shift+1"]}),(0,v.jsx)(Pp,{label:b("helpDialog.zoomToSelection"),shortcuts:["Shift+2"]}),(0,v.jsx)(Pp,{label:b("buttons.fullScreen"),shortcuts:["F"]}),(0,v.jsx)(Pp,{label:b("buttons.zenMode"),shortcuts:[Jt("Alt+Z")]}),(0,v.jsx)(Pp,{label:b("labels.showGrid"),shortcuts:[Jt("CtrlOrCmd+'")]}),(0,v.jsx)(Pp,{label:b("labels.viewMode"),shortcuts:[Jt("Alt+R")]}),(0,v.jsx)(Pp,{label:b("labels.toggleTheme"),shortcuts:[Jt("Alt+Shift+D")]}),(0,v.jsx)(Pp,{label:b("stats.title"),shortcuts:[Jt("Alt+/")]})]})]}),(0,v.jsx)(Ap,{children:(0,v.jsxs)(Lp,{caption:b("helpDialog.editor"),children:[(0,v.jsx)(Pp,{label:b("labels.selectAll"),shortcuts:[Jt("CtrlOrCmd+A")]}),(0,v.jsx)(Pp,{label:b("labels.multiSelect"),shortcuts:[Jt("Shift+".concat(b("helpDialog.click")))]}),(0,v.jsx)(Pp,{label:b("helpDialog.deepSelect"),shortcuts:[Jt("CtrlOrCmd+".concat(b("helpDialog.click")))]}),(0,v.jsx)(Pp,{label:b("helpDialog.deepBoxSelect"),shortcuts:[Jt("CtrlOrCmd+".concat(b("helpDialog.drag")))]}),(0,v.jsx)(Pp,{label:b("labels.moveCanvas"),shortcuts:[Jt("Space+".concat(b("helpDialog.drag"))),Jt("Wheel+".concat(b("helpDialog.drag")))],isOr:!0}),(0,v.jsx)(Pp,{label:b("labels.cut"),shortcuts:[Jt("CtrlOrCmd+X")]}),(0,v.jsx)(Pp,{label:b("labels.copy"),shortcuts:[Jt("CtrlOrCmd+C")]}),(0,v.jsx)(Pp,{label:b("labels.paste"),shortcuts:[Jt("CtrlOrCmd+V")]}),(0,v.jsx)(Pp,{label:b("labels.copyAsPng"),shortcuts:[Jt("Shift+Alt+C")]}),(0,v.jsx)(Pp,{label:b("labels.copyStyles"),shortcuts:[Jt("CtrlOrCmd+Alt+C")]}),(0,v.jsx)(Pp,{label:b("labels.pasteStyles"),shortcuts:[Jt("CtrlOrCmd+Alt+V")]}),(0,v.jsx)(Pp,{label:b("labels.delete"),shortcuts:[Jt("Del")]}),(0,v.jsx)(Pp,{label:b("labels.sendToBack"),shortcuts:[Jt(ct?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")]}),(0,v.jsx)(Pp,{label:b("labels.bringToFront"),shortcuts:[Jt(ct?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")]}),(0,v.jsx)(Pp,{label:b("labels.sendBackward"),shortcuts:[Jt("CtrlOrCmd+[")]}),(0,v.jsx)(Pp,{label:b("labels.bringForward"),shortcuts:[Jt("CtrlOrCmd+]")]}),(0,v.jsx)(Pp,{label:b("labels.alignTop"),shortcuts:[Jt("CtrlOrCmd+Shift+Up")]}),(0,v.jsx)(Pp,{label:b("labels.alignBottom"),shortcuts:[Jt("CtrlOrCmd+Shift+Down")]}),(0,v.jsx)(Pp,{label:b("labels.alignLeft"),shortcuts:[Jt("CtrlOrCmd+Shift+Left")]}),(0,v.jsx)(Pp,{label:b("labels.alignRight"),shortcuts:[Jt("CtrlOrCmd+Shift+Right")]}),(0,v.jsx)(Pp,{label:b("labels.duplicateSelection"),shortcuts:[Jt("CtrlOrCmd+D"),Jt("Alt+".concat(b("helpDialog.drag")))]}),(0,v.jsx)(Pp,{label:b("helpDialog.toggleElementLock"),shortcuts:[Jt("CtrlOrCmd+Shift+L")]}),(0,v.jsx)(Pp,{label:b("buttons.undo"),shortcuts:[Jt("CtrlOrCmd+Z")]}),(0,v.jsx)(Pp,{label:b("buttons.redo"),shortcuts:dt?[Jt("CtrlOrCmd+Y"),Jt("CtrlOrCmd+Shift+Z")]:[Jt("CtrlOrCmd+Shift+Z")]}),(0,v.jsx)(Pp,{label:b("labels.group"),shortcuts:[Jt("CtrlOrCmd+G")]}),(0,v.jsx)(Pp,{label:b("labels.ungroup"),shortcuts:[Jt("CtrlOrCmd+Shift+G")]}),(0,v.jsx)(Pp,{label:b("labels.flipHorizontal"),shortcuts:[Jt("Shift+H")]}),(0,v.jsx)(Pp,{label:b("labels.flipVertical"),shortcuts:[Jt("Shift+V")]}),(0,v.jsx)(Pp,{label:b("labels.showStroke"),shortcuts:[Jt("S")]}),(0,v.jsx)(Pp,{label:b("labels.showBackground"),shortcuts:[Jt("G")]}),(0,v.jsx)(Pp,{label:b("labels.decreaseFontSize"),shortcuts:[Jt("CtrlOrCmd+Shift+<")]}),(0,v.jsx)(Pp,{label:b("labels.increaseFontSize"),shortcuts:[Jt("CtrlOrCmd+Shift+>")]})]})})]})})]})})};n(5080);const Rp=e=>{let{children:t,color:n}=e;return(0,v.jsx)("div",{className:"Card",style:{"--card-color":"primary"===n?"var(--color-primary)":ot[n][7],"--card-color-darker":"primary"===n?"var(--color-primary-darker)":ot[n][8],"--card-color-darkest":"primary"===n?"var(--color-primary-darkest)":ot[n][9]},children:t})},Bp=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)(Rp,{color:"lime",children:[(0,v.jsx)("div",{className:"Card-icon",children:Pa}),(0,v.jsx)("h2",{children:b("exportDialog.disk_title")}),(0,v.jsxs)("div",{className:"Card-details",children:[b("exportDialog.disk_details"),!sd&&i.renderAction("changeProjectName")]}),(0,v.jsx)(ol,{className:"Card-button",type:"button",title:b("exportDialog.disk_button"),"aria-label":b("exportDialog.disk_button"),showAriaLabel:!0,onClick:()=>{i.executeAction(wu,"ui")}})]}),s&&(0,v.jsxs)(Rp,{color:"pink",children:[(0,v.jsx)("div",{className:"Card-icon",children:Sa}),(0,v.jsx)("h2",{children:b("exportDialog.link_title")}),(0,v.jsx)("div",{className:"Card-details",children:b("exportDialog.link_details")}),(0,v.jsx)(ol,{className:"Card-button",type:"button",title:b("exportDialog.link_button"),"aria-label":b("exportDialog.link_button"),showAriaLabel:!0,onClick:()=>{s(t,n,r,a),hc("export","link","ui (".concat((()=>{try{return window.self===window.top?"top":"iframe"}catch(e){return"iframe"}})(),")"))}})]}),o.renderCustomUI&&o.renderCustomUI(t,n,r,a)]})})},Np=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)(ol,{onClick:()=>{"function"==typeof s?a.executeAction(wu):d(!0)},"data-testid":"json-export-button",icon:Pa,type:"button","aria-label":b("buttons.export"),showAriaLabel:pg().isMobile,title:b("buttons.export")}),c&&s&&"function"!=typeof s&&(0,v.jsx)(vl,{onCloseRequest:u,title:b("buttons.export"),children:(0,v.jsx)(Bp,{elements:t,appState:n,files:o,actionManager:a,onCloseRequest:u,exportOpts:s,canvas:l})})]})};var Hp=n(673);const Fp=e=>{let{elements:t,appState:n,files:r,maxWidthOrHeight:i,getDimensions:o}=e;const{elements:a,appState:s}=bd({elements:t,appState:n},null,null),{exportBackground:l,viewBackgroundColor:c}=s;return Fd(Ol(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}}))},Up=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 Fp(e);return r=r||(/image\/jpe?g/.test(n)?.92:.8),new Promise((t=>{i.toBlob((async r=>{var i;r&&n===o.LO.png&&null!==(i=e.appState)&&void 0!==i&&i.exportEmbedScene&&(r=await(0,Hp.encodePngMetadata)({blob:r,metadata:Ad(e.elements,e.appState,e.files||{},"local")})),t(r)}),n,r)}))},Wp=async e=>{let{elements:t,appState:n=vn(),files:r={},exportPadding:i}=e;const{elements:o,appState:a}=bd({elements:t,appState:n},null,null);return Ud(Ol(o),Object.assign(Object.assign({},a),{exportPadding:i}),r)},Kp=async e=>{const t=await Up(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 Vp=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 Wp({elements:t.elements,appState:Object.assign(Object.assign({},n),{viewBackgroundColor:ot.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)(ol,{"aria-label":b("buttons.remove"),type:"button",icon:ts,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:ot.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})]})]})},Gp="publish-library-data",Yp=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=ot.white,s.fillRect(0,0,a.width,a.height);for(const[i,o]of e.entries()){const e=await Fp({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=ot.gray[4],s.strokeRect(d+n/2,c+n/2,t+n,t+n)}return await Td(new File([await Sd(a)],"preview",{type:o.LO.png}),{outputType:o.LO.jpg,maxWidthOrHeight:5e3})},Zp=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(Gp);if(e)return JSON.parse(e)}catch(e){console.error(e)}return null})();e&&u(e)}),[]);const[g,f]=(0,r.useState)(n.slice());(0,r.useEffect)((()=>{f(n.slice())}),[n]);const m=e=>{u(Object.assign(Object.assign({},d),{[e.target.name]:e.target.value}))},y=(0,r.useCallback)((()=>{l(g),(e=>{try{localStorage.setItem(Gp,JSON.stringify(e))}catch(e){console.error(e)}})(d),t()}),[g,t,l,d]),x=!!n.length;return(0,v.jsx)(vl,{onCloseRequest:y,title:b("publishDialog.title"),className:"publish-library",children:x?(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 f(t),void p(!1);const r=await Yp(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(Gp),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)(Vp,{libItem:t,appState:i,index:n,onChange:(e,t)=>{const n=g.slice();n[t].name=e,f(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:m,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:m,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:m,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:m,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:m,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:m,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)(ol,{type:"button",title:b("buttons.cancel"),"aria-label":b("buttons.cancel"),label:b("buttons.cancel"),onClick:y,"data-testid":"cancel-clear-canvas-button",className:"publish-library__buttons--cancel"}),(0,v.jsx)(ol,{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 Xp=n(2891);n(694);const qp=(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)"})}),$p=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 Ud(n,{exportBackground:!1,viewBackgroundColor:ot.white},i);e.innerHTML=t.outerHTML})(),()=>{e.innerHTML=""}}),[n,i]);const[u,h]=(0,r.useState)(!1),p=pg().isMobile,g=a&&(0,v.jsx)("div",{className:"library-unit__adder",children:qp});return(0,v.jsxs)("div",{className:we("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:we("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)(bu,{checked:l,onChange:(e,n)=>c(t,n),className:"library-unit__checkbox"})]})};n(6043);const Qp=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:f,onPublish:m,resetLibrary:y}=e;const x=(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)(xl,{onConfirm:()=>{g.length?n():y(),_(!1)},onCancel:()=>{_(!1)},title:t,children:(0,v.jsx)("p",{children:e})})}),[g,n,y]),[w,_]=(0,r.useState)(!1),k=pg().isMobile,E=k?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)})),I=e=>{var t,n,r,i,o;return(0,v.jsx)(yu,{children:(0,v.jsx)($p,{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)=>{f(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,Xp.chunk)(t,E);return n.length||(n=[[]]),n.map(((e,t,n)=>(t===n.length-1&&(e=e.concat(new Array(E-e.length).fill(null).map(((e,t)=>I({key:"empty_".concat(t),item:null}))))),(0,v.jsx)(vu,{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&&x(),(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||!k)&&(0,v.jsx)(ol,{type:"button",title:b("buttons.load"),"aria-label":b("buttons.load"),icon:Ta,onClick:()=>{(async e=>{const t=await dd({description:"Excalidraw library files"});await e.importLibrary(t)})(u).catch(sn).catch((e=>{c({errorMessage:e.message})}))},className:"library-actions--load"},"import"),!!n.length&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(ol,{type:"button",title:b("buttons.export"),"aria-label":b("buttons.export"),icon:Pa,onClick:async()=>{(async e=>{const t=Dd(e);await ud(new Blob([t],{type:o.LO.excalidrawlib}),{name:"library",extension:"excalidrawlib",description:"Excalidraw library file"})})(e?n:await u.loadLibrary()).catch(sn).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)(ol,{type:"button",title:r,"aria-label":r,icon:Oa,onClick:()=>_(!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)(gl,{label:b("hints.publishLibrary"),children:(0,v.jsxs)(ol,{type:"button","aria-label":b("buttons.publishLibrary"),label:b("buttons.publishLibrary"),icon:Rs,className:"library-actions--publish",onClick:m,children:[!k&&(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)(yu,{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)]})]})]})},Jp=(e,t)=>e.filter((e=>t.includes(e.id))),eg=(0,r.forwardRef)(((e,t)=>{let{children:n}=e;return(0,v.jsx)(fl,{padding:1,ref:t,className:"layer-ui__library",children:n})})),tg=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 f=(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])})(f,(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[m,x]=(0,r.useState)([]),[w,_]=(0,r.useState)(!1),[k,E]=(0,r.useState)(null),[C]=function(e,t){return"scope"in e&&(console.warn("atom.scope is deprecated. Please do useAtom(atom, scope) instead."),t=e.scope),[Rh(e,t),Bh(e,t)]}(Fh,Nh),S=(0,r.useCallback)((async e=>{const t=e.filter((e=>!m.includes(e.id)));h.saveLibrary(t).catch((()=>{l({errorMessage:b("alerts.errorRemovingFromLibrary")})})),x([])}),[h,l,m,x]),I=(0,r.useCallback)((()=>{h.resetLibrary(),u()}),[h,u]),j=(0,r.useCallback)((async(e,t)=>{if(hc("element","addToLibrary","ui"),e.some((e=>"image"===e.type)))return l({errorMessage:"Support for adding images to the library coming soon!"});const n=[{status:"unpublished",elements:e,id:Br(),created:Date.now()},...t];a(),h.saveLibrary(n).catch((()=>{l({errorMessage:b("alerts.errorAddingToLibrary")})}))}),[a,h,l]),T=(0,r.useCallback)((()=>(0,v.jsxs)(vl,{onCloseRequest:()=>E(null),title:b("publishSuccessDialog.title"),className:"publish-library-success",small:!0,children:[(0,v.jsxs)("p",{children:[b("publishSuccessDialog.content",{authorName:k.authorName})," ",(0,v.jsx)("a",{href:null==k?void 0:k.url,target:"_blank",rel:"noopener noreferrer",children:b("publishSuccessDialog.link")})]}),(0,v.jsx)(ol,{type:"button",title:b("buttons.close"),"aria-label":b("buttons.close"),label:b("buttons.close"),onClick:()=>E(null),"data-testid":"publish-library-success-close",className:"publish-library-success-close"})]})),[E,k]),M=(0,r.useCallback)(((e,t)=>{_(!1),E({url:e.url,authorName:e.authorName});const n=t.slice();n.forEach((e=>{m.includes(e.id)&&(e.status="published")})),h.saveLibrary(n)}),[_,E,m,h]),[O,A]=(0,r.useState)(null);return"loading"===C.status?(0,v.jsx)(eg,{ref:f,children:(0,v.jsxs)("div",{className:"layer-ui__library-message",children:[(0,v.jsx)(y,{size:"2em"}),(0,v.jsx)("span",{children:b("labels.libraryLoadingMessage")})]})}):(0,v.jsxs)(eg,{ref:f,children:[w&&(0,v.jsx)(Zp,{onClose:()=>_(!1),libraryItems:Jp(C.libraryItems,m),appState:g,onSuccess:e=>M(e,C.libraryItems),onError:e=>window.alert(e),updateItemsInStorage:()=>h.saveLibrary(C.libraryItems),onRemove:e=>x(m.filter((t=>t!==e)))}),k&&T(),(0,v.jsx)(Qp,{libraryItems:C.libraryItems,onRemoveFromLibrary:()=>S(C.libraryItems),onAddToLibrary:e=>j(e,C.libraryItems),onInsertShape:n,pendingElements:i,setAppState:l,libraryReturnUrl:d,library:h,theme:s,files:c,id:p,selectedItems:m,onToggle:(e,t)=>{if(!m.includes(e)){if(t.shiftKey&&O){const t=C.libraryItems.findIndex((e=>e.id===O)),n=C.libraryItems.findIndex((t=>t.id===e));if(-1===t||-1===n)return void x([...m,e]);const r=hn(m),i=C.libraryItems.reduce(((e,i,o)=>((o>=t&&o<=n||r.has(i.id))&&e.push(i.id),e)),[]);x(i)}else x([...m,e]);A(e)}else A(null),x(m.filter((t=>t!==e)))},onPublish:()=>_(!0),resetLibrary:I})]})};n(3336),n(276);var ng=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 rg=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:f,showThemeBtn:m,toggleZenMode:y,isCollaborating:w,renderTopRightUI:_,renderCustomFooter:k,viewModeEnabled:E,libraryReturnUrl:C,UIOptions:S,focusContainer:I,library:j,id:T,onImageAction:M}=e;const O=pg(),A=()=>S.canvasActions&&S.canvasActions.export?(0,v.jsx)(Np,{elements:c,appState:i,files:a,actionManager:n,exportOpts:S.canvasActions.export,canvas:l}):null,L=()=>{if(!S.canvasActions||!S.canvasActions.saveAsImage)return null;const e=e=>async t=>{hc("export",e,"ui");const n=await mu(e,t,i,a,{exportBackground:i.exportBackground,name:i.name,viewBackgroundColor:i.viewBackgroundColor}).catch(sn).catch((e=>{console.error(e),s({errorMessage:e.message})}));i.exportEmbedScene&&n&&_d(n)&&s({fileHandle:n})};return(0,v.jsx)(pp,{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]),z=(0,r.useCallback)((()=>{s({selectedElementIds:{},selectedGroupIds:{}})}),[s]),D=i.isLibraryOpen?(0,v.jsx)(tg,{pendingElements:Nl(c,i,!0),onClose:P,onInsertShape:p,onAddToLibrary:z,setAppState:s,libraryReturnUrl:C,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,{delay:250}),i.errorMessage&&(0,v.jsx)(sp,{message:i.errorMessage,onClose:()=>s({errorMessage:null})}),i.showHelpDialog&&(0,v.jsx)(Dp,{onClose:()=>{s({showHelpDialog:!1})}}),i.pasteDialog.shown&&(0,v.jsx)(jp,{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)(Sp,{onHomeButtonClick:t,appState:i,elements:c,actionManager:n,libraryMenu:D,renderJSONExportDialog:A,renderImageExportDialog:L,setAppState:s,onCollabButtonClick:d,onLockToggle:()=>u(),onPenModeToggle:h,canvas:l,isCollaborating:w,renderCustomFooter:k,viewModeEnabled:E,showThemeBtn:m,onImageAction:M,renderTopRightUI:_,UIOptions:S})]}):(0,v.jsxs)("div",{className:we("layer-ui__wrapper",{"disable-pointerEvents":i.draggingElement||i.resizingElement||i.editingElement&&!Ce(i.editingElement)}),children:[R,(()=>{const e=jl(i,c);return(0,v.jsx)(gp,{side:"top",children:(0,v.jsxs)("div",{className:"App-menu App-menu_top",children:[(0,v.jsxs)(yu,{gap:4,className:we({"disable-pointerEvents":g}),children:[S.canvasActions&&(E?(0,v.jsx)(yp,{heading:"canvasActions",className:we("zen-mode-transition",{"transition-left":g}),children:(0,v.jsx)(fl,{padding:2,style:{zIndex:1},children:(0,v.jsx)(yu,{gap:4,children:(0,v.jsxs)(vu,{gap:1,justifyContent:"space-between",children:[A(),L()]})})})}):(0,v.jsx)(yp,{heading:"canvasActions",className:we("zen-mode-transition",{"transition-left":g}),children:(0,v.jsx)(fl,{padding:2,style:{zIndex:1},children:(0,v.jsxs)(yu,{gap:4,children:[(0,v.jsxs)(vu,{gap:3,justifyContent:"space-between",children:[n.renderAction("clearCanvas"),n.renderAction("loadScene"),A(),L(),d&&(0,v.jsx)(ap,{isCollaborating:w,collaboratorCount:i.collaborators.size,onClick:d})]}),(0,v.jsx)(op,{actionManager:n,appState:i,setAppState:s,showThemeBtn:m}),i.fileHandle&&(0,v.jsx)(v.Fragment,{children:n.renderAction("saveToActiveFile")})]})})})),e&&(0,v.jsx)(yp,{heading:"selectedShapeActions",className:we("zen-mode-transition",{"transition-left":g}),children:(0,v.jsx)(fl,{className:o.$C.SHAPE_ACTIONS_MENU,padding:2,style:{maxHeight:"".concat(i.height-(i.fileHandle?248:200),"px")},children:(0,v.jsx)(np,{appState:i,elements:c,renderAction:n.renderAction,activeTool:i.activeTool.type})})})]}),!E&&(0,v.jsx)(yp,{heading:"shapes",children:e=>(0,v.jsxs)(yu,{gap:4,align:"start",children:[(0,v.jsxs)(vu,{gap:1,className:we("App-toolbar-container",{"zen-mode":g}),children:[(0,v.jsx)(Cp,{zenModeEnabled:g,checked:i.penMode,onChange:h,title:b("toolBar.penMode"),penDetected:i.penDetected}),(0,v.jsx)(bp,{zenModeEnabled:g,checked:i.activeTool.locked,onChange:()=>u(),title:b("toolBar.lock")}),(0,v.jsxs)(fl,{padding:1,className:we("App-toolbar",{"zen-mode":g}),children:[(0,v.jsx)(fp,{appState:i,elements:c,isMobile:O.isMobile}),e,(0,v.jsx)(vu,{gap:1,children:(0,v.jsx)(rp,{appState:i,canvas:l,activeTool:i.activeTool,setAppState:s,onImageAction:e=>{let{pointerType:t}=e;M({insertOnCanvasDirectly:"mouse"!==t})}})})]}),(0,v.jsx)(_p,{appState:i,setAppState:s})]}),D]})}),(0,v.jsx)("div",{className:we("layer-ui__wrapper__top-right zen-mode-transition",{"transition-right":g}),children:null==_?void 0:_(O.isMobile,i,l)}),(0,v.jsx)(xp,{className:we("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:we("layer-ui__wrapper__footer-left zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":g}),children:(0,v.jsx)(yu,{gap:2,children:(0,v.jsxs)(yp,{heading:"canvasActions",children:[(0,v.jsx)(fl,{padding:1,children:(0,v.jsx)(ip,{renderAction:n.renderAction,zoom:i.zoom})}),!E&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)("div",{className:we("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:we("eraser-buttons zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":g}),children:n.renderAction("eraser",{size:"small"})})]}),!E&&i.multiElement&&O.isTouchScreen&&(0,v.jsx)("div",{className:we("finalize-button zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":g}),children:n.renderAction("finalize",{size:"small"})})]})})}),(0,v.jsx)("div",{className:we("layer-ui__wrapper__footer-center zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":g}),children:null==k?void 0:k(!1,i)}),(0,v.jsx)("div",{className:we("layer-ui__wrapper__footer-right zen-mode-transition",{"transition-right disable-pointerEvents":g}),children:n.renderAction("toggleShortcuts")}),(0,v.jsx)("button",{className:we("disable-zen-mode",{"disable-zen-mode--visible":f}),onClick:y,children:b("buttons.exitZenMode")})]}),i.scrolledOutside&&(0,v.jsx)("button",{className:"scroll-back-to-content",onClick:()=>{s(Object.assign({},cl(c,i)))},children:b("buttons.scrollBackToContent")})]})},ig=(e,t)=>{const n=e=>{const{suggestedBindings:t,startBoundElement:n}=e;return ng(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]))},og=i().memo(rg,ig);n(1528);const ag=e=>{var t;const n=pg(),r=tt(e.elements),i=Hl(e.elements,e.appState),o=tt(i);return n.isMobile&&e.appState.openMenu?null:(0,v.jsx)("div",{className:"Stats",children:(0,v.jsxs)(fl,{padding:2,children:[(0,v.jsx)("div",{className:"close",onClick:e.onClose,children:ts}),(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 sg=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})})},lg=$s({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===At});var cg=n(200),dg=n.n(cg);const ug={isMobile:!1,isTouchScreen:!1},hg=i().createContext(ug),pg=()=>(0,r.useContext)(hg),gg=i().createContext({container:null,id:null}),fg=()=>(0,r.useContext)(gg);let mg=!1,bg=0,vg=0,yg=0,xg=!1,wg=!1,_g=!1,kg={horizontal:null,vertical:null},Eg=0,Cg=!1,Sg=null;const Ig={pointers:new Map,lastCenter:null,initialDistance:null,initialScale:null};class jg extends i().Component{constructor(e){super(e),Tg.call(this);const t=vn(),{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=_e(),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 Kn,this.library=new Kh(this),this.history=new Xh,this.actionManager=new nh(this.syncActionResult,(()=>this.state),(()=>this.scene.getElementsIncludingDeleted()),this),this.actionManager.registerAll(qs),this.actionManager.registerAction((d=this.history,{name:"undo",trackEvent:{category:"history"},perform:(e,t)=>eh(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)(ol,{type:"button",icon:Na,"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)=>eh(t,n,(()=>e.redoOnce())),keyTest:e=>e[Lt.CTRL_OR_CMD]&&e.shiftKey&&e.key.toLowerCase()===Lt.Z||dt&&e.ctrlKey&&!e.shiftKey&&e.key===Lt.Y,PanelComponent:e=>{let{updateData:t,data:n}=e;return(0,v.jsx)(ol,{type:"button",icon:Ha,"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=Nl(this.scene.getElements(),this.state),{onCollabButtonClick:o,renderTopRightUI:a,renderFooter:s,renderCustomStats:l}=this.props;return(0,v.jsx)("div",{className:we("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)(gg.Provider,{value:this.excalidrawContainerValue,children:(0,v.jsxs)(hg.Provider,{value:this.deviceType,children:[(0,v.jsx)(og,{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:f().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)(fc,{element:i[0],appState:this.state,setAppState:this.setAppState,onLinkOpen:this.props.onLinkOpen},i[0].id),this.state.showStats&&(0,v.jsx)(ag,{appState:this.state,setAppState:this.setAppState,elements:this.scene.getElements(),onClose:this.toggleStats,renderCustomStats:l}),null!==this.state.toastMessage&&(0,v.jsx)(sg,{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=fn(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=fn(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(),vr=new WeakMap,yr=new WeakMap,Mr=new WeakMap,this.scene=new Kn,this.history=new Xh,this.actionManager=new nh(this.syncActionResult,(()=>this.state),(()=>this.scene.getElementsIncludingDeleted()),this),this.library=new Kh(this),this.canvas=null,this.rc=null,this.excalidrawContainerRef.current=void 0,this.nearestScrollableContainer=void 0,this.excalidrawContainerValue={container:null,id:"unmounted"},clearTimeout(Eg),Eg=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&&En(this.state)&&this.setState({activeTool:Object.assign(Object.assign({},this.state.activeTool),{type:"selection"})}),"eraser"===this.state.activeTool.type&&t.theme!==this.state.theme&&qt(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(ac)}));const{multiElement:r}=t;t.activeTool!==this.state.activeTool&&null!=r&&Io(this.state)&&Me(r,!1)&&Ao(r,this.state,this.scene,an(Co.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]=tn({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}=Tc(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&&(kg=h);const p=!Ce(this.state.editingElement)&&(!u&&d.length>0);var g,f;(this.state.scrolledOutside!==p&&this.setState({scrolledOutside:p}),this.history.record(this.state,this.scene.getElementsIncludingDeleted()),this.scheduleImageRefresh(),this.state.isLoading)||(null===(g=(f=this.props).onChange)||void 0===g||g.call(f,this.scene.getElementsIncludingDeleted(),this.state,this.files,this.props.id))}static resetTapTwice(){mg=!1}addTextFromPaste(e){const{x:t,y:n}=en({clientX:vg,clientY:yg},this.state),r=ii({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,locked:!1});this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),r]),this.setState({selectedElementIds:{[r.id]:!0}}),this.history.resumeRecording()}setActiveTool(e){var t;xg||$t(this.canvas,this.state),(t=document.activeElement)instanceof HTMLElement&&t.className.includes("ToolIcon")&&this.focusContainer(),Te(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)?oi(i,{text:t,isDeleted:r,originalText:n}):i))])};Il({id:e.id,canvas:this.canvas,getViewportCoords:(e,t)=>{const{x:n,y:r}=tn({sceneX:e,sceneY:t},this.state);return[n-this.state.offsetLeft,r-this.state.offsetTop]},onChange:cn((t=>{r(t,t,!1),Al(e)&&Ho(e)})),onSubmit:cn((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&&$t(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,null==n?void 0:n.includeLockedElements);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){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return((e,t)=>e.filter((e=>!e.isDeleted&&t(e))))(n&&r?this.scene.getElements():this.scene.getElements().filter((e=>(r||!e.locked)&&(n||!(Ce(e)&&e.containerId)))),(n=>((e,t,n,r)=>{const i=10/t.zoom.value,o=[n,r];return Ui(t,e)?Wi(e,o,i):Fi(e,t,o)})(n,this.state,e,t)))}maybeCleanupAfterMissingPointerUp(e){null!==Sg&&Sg(e)}updateGestureOnPointerDown(e){Ig.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),2===Ig.pointers.size&&(Ig.lastCenter=Vh(Ig.pointers),Ig.initialScale=this.state.zoom.value,Ig.initialDistance=Gh(Array.from(Ig.pointers.values())))}initialPointerDownState(e){const t=en(e,this.state),n=Nl(this.scene.getElements(),this.state),[r,i,o,a]=tt(n);return{origin:t,withCmdOrCtrl:e[Lt.CTRL_OR_CMD],originInGrid:an(Ve(t.x,t.y,this.state.gridSize)),scrollbars:Dl(kg,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,si(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;_g=!0,t.lastCoords.x=e.clientX,t.lastCoords.y=e.clientY;const n=dn((e=>{e.target instanceof HTMLElement&&this.handlePointerMoveOverScrollbars(e,t)})),r=cn((()=>{_g=!1,$t(this.canvas,this.state),Sg=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 Sg=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]=tt(t);return e.x>r-n&&e.x<o+n&&e.y>i-n&&e.y<a+n}onKeyDownFromPointerDownHandler(e){return cn((t=>{this.maybeHandleResize(e,t)||this.maybeDragNewGenericElement(e,t)}))}onKeyUpFromPointerDownHandler(e){return cn((t=>{t.key===Lt.ALT&&t.preventDefault(),this.maybeHandleResize(e,t)||this.maybeDragNewGenericElement(e,t)}))}onPointerMoveFromPointerDownHandler(e){return dn((t=>{var n,r;null===e.drag.offset&&(e.drag.offset=an(((e,t,n)=>{const[r,i]=tt(e);return[t-r,n-i]})(Nl(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=en(t,this.state);if(En(this.state))return void this.handleEraser(t,e,i);const[a,s]=Ve(i.x,i.y,this.state.gridSize);if(!e.drag.hasOccurred&&("arrow"===this.state.activeTool.type||"line"===this.state.activeTool.type)&&Ne(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(Co.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)){const n=Nl(this.scene.getElements(),this.state);if(n.every((e=>e.locked)))return;if(e.drag.hasOccurred=!0,n.length>0&&!e.withCmdOrCtrl){const[r,o]=Ve(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]=tt(t),d={x:n-l,y:r-c};t.forEach((n=>{if(da(i,o,a,e,n,d),!n.groupIds.length||s.editingGroupId&&!Gr(s,n)){const t=ar(n);t&&da(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=Nl(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=li(this.state.editingGroupId,i,d),[l,c]=Ve(e.origin.x-e.drag.offset.x,e.origin.y-e.drag.offset.y,this.state.gridSize);Nr(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];Gn(t,n,a),qo(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];Nr(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;Rt(t)&&2===n.length&&({width:r,height:o}=Wr(this.state.activeTool.type,r,o)),1===n.length?Nr(l,{points:[...n,[r,o]]}):n.length>1&&Nr(l,{points:[...n.slice(0,-1),[r,o]]}),Me(l,!1)&&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||!Rl(n,this.state)||(e.withCmdOrCtrl&&e.hit.element?this.setState((t=>Xr(Object.assign(Object.assign({},t),{selectedElementIds:{[e.hit.element.id]:!0}}),this.scene.getElements()))):this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})),this.state.editingLinearElement)Co.handleBoxSelection(t,this.state,this.setState.bind(this));else{const t=((e,t)=>{const[n,r,i,o]=Ze(t);return e.filter((e=>{const[t,a,s,l]=et(e);return!1===e.locked&&"selection"!==e.type&&!ze(e)&&n<=t&&r<=a&&i>=s&&o>=l}))})(n,l);this.setState((n=>Xr(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 cn((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||Ce(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=Co.handlePointerUp(t,this.state.editingLinearElement,this.state);e!==this.state.editingLinearElement&&this.setState({editingLinearElement:e,suggestedBindings:[]})}else this.actionManager.executeAction(ac);if(Sg=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=en(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 Nr(n,{points:[...r,[i,o]],pressures:a,lastCommittedPoint:[i,o]}),void this.actionManager.executeAction(ac)}if(Ee(n)){const e=n;try{this.initializeImageDimensions(e),this.setState({selectedElementIds:{[e.id]:!0}},(()=>{this.actionManager.executeAction(ac)}))}catch(t){console.error(t),this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().filter((t=>t.id!==e.id))),this.actionManager.executeAction(ac)}return}if(je(n)){n.points.length>1&&this.history.resumeRecording();const r=en(t,this.state);return void(e.drag.hasOccurred||!n||i?e.drag.hasOccurred&&!i&&(Io(this.state)&&Me(n,!1)&&Ao(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})}))):(Gt(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})}))))):(Nr(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&&Ur(n))return this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().slice(0,-1)),void this.setState({draggingElement:null});n&&Nr(n,Kr(n)),r&&this.history.resumeRecording(),r&&Ur(r)&&this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().filter((e=>e.id!==r.id)));const u=e.hit.element;if(En(this.state)){if(0===Ne(this.lastPointerDown.clientX,this.lastPointerDown.clientY,this.lastPointerUp.clientX,this.lastPointerUp.clientY)){const t=en({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(Gr(this.state,u)){const e=u.groupIds.flatMap((e=>$r(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=>Xr(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({},Xr(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||Rl(this.scene.getElements(),this.state))&&this.history.resumeRecording(),(e.drag.hasOccurred||s||l)&&(Io(this.state)?Mo:Do)(Nl(this.scene.getElements(),this.state)),a.locked||"freedraw"===a.type?this.setState({draggingElement:null,suggestedBindings:[]}):(Gt(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=>Me(e,!1)?Vo(e).filter((e=>!t.has(e.id))):Ae(e,!1)?Zo(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&&qr(e,t.editingGroupId)?t.editingGroupId:null}))),this.setState({selectedElementIds:{},previousSelectedElementIds:this.state.selectedElementIds})}getTextWysiwygSnappedToCenterPosition(e,t,n,r,i){const a=Xs(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}=tn({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({})}}jg.defaultProps={UIOptions:o.cW};var Tg=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=cn((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&&Al(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=cn((()=>{xg=!1,this.setState({isBindingEnabled:!0})})),this.onUnload=()=>{this.onBlur()},this.disableEvent=e=>{e.preventDefault()},this.onFontLoaded=()=>{this.scene.getElementsIncludingDeleted().forEach((e=>{Ce(e)&&_r(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="published",o=await Cd(r,i);(t===this.id||window.confirm(b("alerts.confirmAddLibrary",{numShapes:o.length})))&&await this.library.importLibrary(o,i)}catch(e){console.error(e),this.setState({errorMessage:b("errors.importLibraryError")})}finally{this.focusContainer()}},this.resetHistory=()=>{this.history.clear()},this.resetScene=cn((e=>{this.scene.replaceAllElements([]),this.setState((t=>Object.assign(Object.assign({},vn()),{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,Ed(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.library.importLibrary(r.libraryItems,"unpublished")}catch(e){console.error(e),r={appState:{errorMessage:e.message||"Encountered an error during importing or restoring scene data"}}}const a=bd(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),cl(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=cn((()=>{this.scene.getElementsIncludingDeleted().forEach((e=>_r(e))),this.setState({})})),this.onScroll=Kt((()=>{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=cn((e=>{var t;(null===(t=this.excalidrawContainerRef.current)||void 0===t?void 0:t.contains(document.activeElement))&&!Ft(e.target)&&(this.cutAll(),e.preventDefault())})),this.onCopy=cn((e=>{var t;(null===(t=this.excalidrawContainerRef.current)||void 0===t?void 0:t.contains(document.activeElement))&&!Ft(e.target)&&(this.copyAll(),e.preventDefault())})),this.cutAll=()=>{this.actionManager.executeAction(Wu,"keyboard")},this.copyAll=()=>{this.actionManager.executeAction(Uu,"keyboard")},this.onTapStart=e=>{if(ut||e.preventDefault(),!mg)return mg=!0,clearTimeout(bg),void(bg=window.setTimeout(jg.resetTapTwice,o.Gj));if(mg&&1===e.touches.length){const[t]=e.touches;this.handleCanvasDoubleClick({clientX:t.clientX,clientY:t.clientY}),mg=!1,clearTimeout(bg)}ut&&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}):Ig.pointers.clear()},this.pasteFromClipboard=cn((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(vg,yg);if(e&&(!(i instanceof HTMLCanvasElement)||Ft(r)))return;let o=null==e||null===(n=e.clipboardData)||void 0===n?void 0:n.files[0];const a=await pu(e);if(!o&&a.text){const e=a.text.trim();e.startsWith("<svg")&&e.endsWith("</svg>")&&(o=Md(e))}if(kd(o)&&!a.spreadsheet){const{x:e,y:t}=en({clientX:vg,clientY:yg},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=fd(e.elements,null),[n,r,i,o]=tt(t),a=Vt(n,i)/2,s=Vt(r,o)/2,l="object"==typeof e.position?e.position.clientX:"cursor"===e.position?vg:this.state.width/2+this.state.offsetLeft,c="object"==typeof e.position?e.position.clientY:"cursor"===e.position?yg:this.state.height/2+this.state.offsetTop,{x:d,y:u}=en({clientX:l,clientY:c},this.state),h=d-a,p=u-s,g=new Map,[f,m]=Ve(h,p,this.state.gridSize),b=new Map,v=t.map((e=>{const t=li(this.state.editingGroupId,g,e,{x:e.x+f-n,y:e.y+m-r});return b.set(e.id,t.id),t}));Gn(v,t,b);const y=[...this.scene.getElementsIncludingDeleted(),...v];qo(y,t,b),e.files&&(this.files=Object.assign(Object.assign({},this.files),e.files)),this.scene.replaceAllElements(y),this.history.resumeRecording(),this.setState(Xr(Object.assign(Object.assign({},this.state),{isLibraryOpen:!1,selectedElementIds:v.reduce(((e,t)=>(ze(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=>{Eg&&this.resetContextMenuTimer(),Ig.pointers.delete(e.pointerId)},this.toggleLock=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"ui";e.state.activeTool.locked||hc("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(Zu)},this.toggleStats=()=>{this.actionManager.executeAction(Xu)},this.scrollToContent=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.scene.getElements();e.setState(Object.assign({},cl(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=cn((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),_r(e))})),this.scene.informMutation(),this.addNewImagesToImageCache()})),this.updateScene=cn((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(new Promise((async(t,n)=>{try{t(yd(await e.libraryItems,"unpublished"))}catch(e){n(new Error(b("errors.importLibraryError")))}})))})),this.onSceneUpdated=()=>{this.setState({})},this.updateCurrentCursorPosition=cn((e=>{vg=e.clientX,yg=e.clientY})),this.onKeyDown=cn((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}})),!(Ft(e.target)&&e.key!==Lt.ESCAPE||Pt(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===_t&&this.setState({isLibraryOpen:!this.state.isLibraryOpen}),Pt(e.key)){const t=this.state.gridSize&&(e.shiftKey?o.$e:this.state.gridSize)||(e.shiftKey?o.Iw:o.$e),n=Nl(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=>{Nr(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=Nl(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 Co(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=qh.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&&hc("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===Ig.pointers.size&&(xg=!0,Yt(this.canvas,o.oc.GRABBING),e.preventDefault()),e.key===Lt.G||e.key===Lt.S){const t=Nl(this.scene.getElements(),this.state);if("selection"===this.state.activeTool.type&&!t.length)return;e.key===Lt.G&&(Fs(this.state.activeTool.type)||t.some((e=>Fs(e.type))))&&this.setState({openPopup:"backgroundColorPicker"}),e.key===Lt.S&&this.setState({openPopup:"strokeColorPicker"})}}})),this.onKeyUp=cn((e=>{if(e.key===Lt.SPACE&&(this.state.viewModeEnabled?Yt(this.canvas,o.oc.GRAB):"selection"===this.state.activeTool.type?Gt(this.canvas):($t(this.canvas,this.state),this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})),xg=!1),e[Lt.CTRL_OR_CMD]||this.state.isBindingEnabled||this.setState({isBindingEnabled:!0}),Pt(e.key)){const e=Nl(this.scene.getElements(),this.state);Io(this.state)?Mo(e):Do(e),this.setState({suggestedBindings:[]})}})),this.onGestureStart=cn((e=>{e.preventDefault(),this.setState({selectedElementIds:{}}),Ig.initialScale=this.state.zoom.value})),this.onGestureChange=cn((e=>{if(e.preventDefault(),Ig.pointers.size>=2)return;const t=Ig.initialScale;t&&this.setState((n=>Object.assign({},ul({viewportX:vg,viewportY:yg,nextZoom:dl(t*e.scale)},n))))})),this.onGestureEnd=cn((e=>{e.preventDefault(),this.setState({previousSelectedElementIds:{},selectedElementIds:this.state.previousSelectedElementIds}),Ig.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=Nl(this.scene.getElements(),this.state);if(1===g.length&&(Ce(g[0])?h=g[0]:Le(g[0],!1)&&(p=g[0],h=ar(p))),h=null!==(t=h)&&void 0!==t?t:this.getTextElementAtPosition(s,l),p||h||!c&&!u||(p=Xs(this.scene.getElements().filter((e=>Le(e,!1)&&!ar(e))),s,l)),!h&&p){const e={fontSize:this.state.currentItemFontSize,fontFamily:this.state.currentItemFontFamily},t=nr(Wt(e)),n=rr(Wt(e)),r=Math.max(p.height,n),i=Math.max(p.width,t);Nr(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 f=h||ii({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:[],locked:!1});this.setState({editingElement:f}),h||(this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),f]),u||Nr(f,{y:f.y-f.baseline/2})),this.setState({editingElement:f}),this.handleTextWysiwyg(f,{isExistingElement:!!h})},this.handleCanvasDoubleClick=e=>{if(this.state.multiElement)return;if("selection"!==this.state.activeTool.type)return;const t=Nl(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 Co(t[0],this.scene)})));Gt(this.canvas);let{x:n,y:r}=en(e,this.state);if(Zr(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=>Xr(Object.assign(Object.assign({},n),{editingGroupId:t,selectedElementIds:{[e.id]:!0},selectedGroupIds:{}}),this.scene.getElements())))}if(Gt(this.canvas),!e[Lt.CTRL_OR_CMD]&&!this.state.viewModeEnabled){const t=Nl(this.scene.getElements(),this.state);if(1===t.length){const e=t[0];Pe(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&&_c(n,this.state,[e.x,e.y],this.deviceType.isMobile))))},this.redirectToLink=(e,t)=>{const n=Ne(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=en(this.lastPointerDown,this.state),i=_c(this.hitLinkElement,this.state,[r.x,r.y],this.deviceType.isMobile),a=en(this.lastPointerUp,this.state),s=_c(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=gn(o.Ks.EXCALIDRAW_LINK,e.nativeEvent),this.props.onLinkOpen(this.hitLinkElement,n)),null===(l=n)||void 0===l||!l.defaultPrevented){const e=vc(t)?"_self":"_blank",n=window.open(void 0,e);n&&(n.opener=null,n.location=bc(t))}}}},this.handleCanvasPointerMove=e=>{this.savePointer(e.clientX,e.clientY,this.state.cursorButton),Ig.pointers.has(e.pointerId)&&Ig.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY});const t=Ig.initialScale;if(2===Ig.pointers.size&&Ig.lastCenter&&t&&Ig.initialDistance){const e=Vh(Ig.pointers),n=e.x-Ig.lastCenter.x,r=e.y-Ig.lastCenter.y;Ig.lastCenter=e;const i=Gh(Array.from(Ig.pointers.values())),o="freedraw"===this.state.activeTool.type&&this.state.penMode?1:i/Ig.initialDistance,a=o?dl(t*o):this.state.zoom.value;this.setState((t=>{const i=ul({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 Ig.lastCenter=Ig.initialDistance=Ig.initialScale=null;if(xg||wg||_g)return;const n=Dl(kg,e.clientX-this.state.offsetLeft,e.clientY-this.state.offsetTop).isOverEither;this.state.draggingElement||this.state.multiElement||(n?Gt(this.canvas):$t(this.canvas,this.state));const r=en(e,this.state),{x:i,y:a}=r;if(this.state.editingLinearElement&&!this.state.editingLinearElement.isDragging){const t=Co.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(Oe(this.state.activeTool.type)){const{draggingElement:e}=this.state;Me(e,!1)?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 $t(this.canvas,this.state),void(l===s?Ne(i-t,a-n,l[0],l[1])>=o.qx?Nr(e,{points:[...r,[i-t,a-n]]}):Yt(this.canvas,o.oc.POINTER):r.length>2&&s&&Ne(i-t,a-n,s[0],s[1])<o.qx?(Yt(this.canvas,o.oc.POINTER),Nr(e,{points:r.slice(0,-1)})):(He(r,this.state.zoom.value)&&Yt(this.canvas,o.oc.POINTER),Nr(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=Nl(s,this.state);if(1!==l.length||n||this.state.editingLinearElement){if(l.length>1&&!n){const t=_o(tt(l),i,a,this.state.zoom,e.pointerType);if(t)return void Yt(this.canvas,Eo({transformHandleType:t}))}}else{const t=wo(s,this.state,i,a,this.state.zoom,e.pointerType);if(t&&t.transformHandleType)return void Yt(this.canvas,Eo(t))}const c=this.getElementAtPosition(r.x,r.y);var d,u;if(this.hitLinkElement=this.getElementLinkAtPosition(r,c),!En(this.state))if(this.hitLinkElement&&!this.state.selectedElementIds[this.hitLinkElement.id])Yt(this.canvas,o.oc.POINTER),d=this.hitLinkElement,u=this.state,kc&&clearTimeout(kc),kc=window.setTimeout((()=>Ec(d,u)),o.sA);else if(kc&&clearTimeout(kc),gc&&(gc=!1,hl().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)Yt(this.canvas,Ce(c)?o.oc.TEXT:o.oc.CROSSHAIR);else if(this.state.viewModeEnabled)Yt(this.canvas,o.oc.GRAB);else if(n)Yt(this.canvas,o.oc.AUTO);else if(this.state.editingLinearElement){const e=Co.getElement(this.state.editingLinearElement.elementId);e&&Fi(e,this.state,[r.x,r.y])?Yt(this.canvas,o.oc.MOVE):Yt(this.canvas,o.oc.AUTO)}else e[Lt.CTRL_OR_CMD]||!c&&!this.isHittingCommonBoundingBoxOfSelectedElements(r,l)||null!=c&&c.locked?Yt(this.canvas,o.oc.AUTO):Yt(this.canvas,o.oc.MOVE)},this.handleEraser=(e,t,n)=>{const r=n=>{n.forEach((n=>{n.locked||(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=Ne(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=ze(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=>{Cg=!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=fn(this.deviceType,{isTouchScreen:!0})),wg)return;if(this.lastPointerDown=e,this.setState({lastPointerDownWith:e.pointerType,cursorButton:"down"}),this.savePointer(e.clientX,e.clientY,"down"),this.updateGestureOnPointerDown(e),this.handleCanvasPanUsingWheelOrSpaceDrag(e))return;if(e.button!==o.Oh.MAIN&&e.button!==o.Oh.TOUCH)return;if(Ig.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(Yt(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}=en(e,this.state);Nr(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);Sg=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=en({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&&(Cg=!1,Eg?Cg=!0:Eg=window.setTimeout((()=>{Eg=0,Cg||this.handleCanvasContextMenu(e)}),o.nM))},this.resetContextMenuTimer=()=>{clearTimeout(Eg),Eg=0,Cg=!1},this.handleCanvasPanUsingWheelOrSpaceDrag=e=>{if(!(Ig.pointers.size<=1&&(e.button===o.Oh.WHEEL||e.button===o.Oh.MAIN&&xg||this.state.viewModeEnabled))||Ce(this.state.editingElement))return!1;wg=!0,e.preventDefault();let t=!1;const n=/Linux/.test(window.navigator.platform);Yt(this.canvas,o.oc.GRABBING);let{clientX:r,clientY:i}=e;const a=dn((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=cn(Sg=()=>{Sg=null,wg=!1,xg||(this.state.viewModeEnabled?Yt(this.canvas,o.oc.GRAB):$t(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=Nl(r,this.state);if(1!==i.length||this.state.editingLinearElement)i.length>1&&(t.resize.handleType=_o(tt(i),t.origin.x,t.origin.y,this.state.zoom,e.pointerType));else{const n=wo(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)Yt(this.canvas,Eo({transformHandleType:t.resize.handleType})),t.resize.isResizing=!0,t.resize.offset=an(((e,t,n,r)=>{const[i,o,a,s]=1===t.length?Ze(t[0]):tt(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=Co.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(_c(t.hit.element,this.state,[t.origin.x,t.origin.y],this.deviceType.isMobile))return!1;t.hit.hasHitElementInside=Fi(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&&!qr(r,this.state.editingGroupId)&&this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}),i||t.hit.hasHitCommonBoundingBoxOfSelectedElements||(this.setState((e=>Xr(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});Pe(i)&&(n=i.x+i.width/2,r=i.y+i.height/2),this.startTextEditing({sceneX:n,sceneY:r,shouldBind:!1,insertAtParentCenter:!e.altKey}),Gt(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]=Ve(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,locked:!1},Object.assign(Object.assign({},ti(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];Nr(o,{points:[[0,0]],pressures:s});const l=Bo(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]=Ve(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,locked:!1},Object.assign(Object.assign({},ti("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&&He(e.points,this.state.zoom.value))return Nr(e,{lastCommittedPoint:e.points[e.points.length-1]}),void this.actionManager.executeAction(ac);const{x:t,y:r,lastCommittedPoint:i}=e;if(e.points.length>1&&i&&Ne(n.origin.x-t,n.origin.y-r,i[0],i[1])<o.qx)return void this.actionManager.executeAction(ac);this.setState((t=>({selectedElementIds:Object.assign(Object.assign({},t.selectedElementIds),{[e.id]:!0})}))),Nr(e,{lastCommittedPoint:e.points[e.points.length-1]}),Yt(this.canvas,o.oc.POINTER)}else{const[e,r]=Ve(n.origin.x,n.origin.y,this.state.gridSize),{currentItemStartArrowhead:i,currentItemEndArrowhead:o}=this.state,[a,s]="arrow"===t?[i,o]:[null,null],l=ai({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,locked:!1});this.setState((e=>({selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[l.id]:!1})}))),Nr(l,{points:[...l.points,[0,0]]});const c=Bo(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]=Ve(t.origin.x,t.origin.y,this.state.gridSize),i=ni({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,locked:!1});"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}):ze(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||ze(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(!kd(i))throw new Error(b("errors.unsupportedFileType"));const l=i.type;if(Yt(this.canvas,"wait"),l===o.LO.svg)try{i=Md(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"));if(n.hasAttribute("xmlns")||n.setAttribute("xmlns",o.hR),!n.hasAttribute("width")||!n.hasAttribute("height")){const e=n.getAttribute("viewBox");let t=n.getAttribute("width")||"50",r=n.getAttribute("height")||"50";if(e){const n=e.match(/\d+ +\d+ +(\d+) +(\d+)/);n&&([,t,r]=n)}n.setAttribute("width",t),n.setAttribute("height",r)}return 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))||Id(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 Td(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 jd(i),p=Nr(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||Gt(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){Nr(e,{isDeleted:!0}),this.actionManager.executeAction(ac),this.setState({errorMessage:t.message||b("errors.imageInsertError")})}},this.setImagePreviewCursor=async e=>{const t=await Td(e,{maxWidthOrHeight:96});let n=await jd(t);if(e.type===o.LO.svg){const e=await Rd(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&&Yt(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}=en({clientX:n,clientY:r},e.state),a=await dd({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(ac)}))):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(ac)}))}},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;Nr(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;Nr(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 Bd({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)&&_r(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]:Nd(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=dg()((()=>{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=Bo(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=Bo(r,this.scene);return null==i||zo(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=ye.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(kd(t)){if((null==t?void 0:t.type)===o.LO.png||(null==t?void 0:t.type)===o.LO.svg)try{if(sd)try{const n=e.dataTransfer.items[0];t.handle=await n.getAsFileSystemHandle()}catch(e){console.warn(e.name,e.message)}const n=await Ed(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}=en(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).catch((e=>this.setState({isLoading:!1,errorMessage:e.message})));else if(i){if(this.setState({isLoading:!0}),sd)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=>{Ed(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}=en(e,this.state),r=this.getElementAtPosition(t,n,{preferSelected:!0,includeLockedElements:!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(Xr(Object.assign(Object.assign({},this.state),{selectedElementIds:{[r.id]:!0}}),this.scene.getElements()),(()=>{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)ua(n,this.state.activeTool.type,e.origin.x,e.origin.y,r.x,r.y,Vt(e.origin.x,r.x),Vt(e.origin.y,r.y),Dt(t),zt(t));else{var i;const[o,a]=Ve(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;ua(n,this.state.activeTool.type,e.originInGrid.x,e.originInGrid.y,o,a,Vt(e.originInGrid.x,o),Vt(e.originInGrid.y,a),Ee(n)?!Dt(t):Dt(t),zt(t),l),this.maybeSuggestBindingForAll([n])}},this.maybeHandleResize=(e,t)=>{const n=Nl(this.scene.getElements(),this.state),r=e.resize.handleType;this.setState({isResizing:r&&"rotation"!==r,isRotating:"rotation"===r});const i=e.lastCoords,[o,a]=Ve(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?(na(c,s,l,i),Ho(c)):!je(c)||2!==c.points.length||"nw"!==t&&"ne"!==t&&"sw"!==t&&"se"!==t?!Ce(c)||"nw"!==t&&"ne"!==t&&"sw"!==t&&"se"!==t?t&&sa(e.originalElements,a,c,t,o,s,l):(aa(c,t,o,s,l),Ho(c)):ra(c,r,i,s,l),!0}if(n.length>1){if("rotation"===t)return ca(e,n,s,l,i,c,d),!0;if("nw"===t||"ne"===t||"sw"===t||"se"===t)return la(n,t,s,l),!0}return!1})(e,r,n,e.resize.arrowDirection,Rt(t),zt(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=Iu.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),o=ju.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),a=Du.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),s=Ru.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),l=qu.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),c=$u.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),d="separator",u=this.scene.getElements(),h=Nl(this.scene.getElements(),this.state),p=[];if(du&&u.length>0&&p.push(Vu),cu&&u.length>0&&p.push(Ku),"element"===t&&Gu.contextItemPredicate(u,this.state)&&cu&&p.push(Gu),"canvas"===t){const e=[...p,void 0===this.props.gridModeEnabled&&Yu,void 0===this.props.zenModeEnabled&&Zu,void 0===this.props.viewModeEnabled&&lg,Xu];this.state.viewModeEnabled?tp.push({options:e,top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current,elements:u}):tp.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,du&&u.length>0&&Vu,cu&&u.length>0&&Ku,cu&&h.length>0&&Gu,(du&&u.length>0||cu&&u.length>0)&&d,rc,d,void 0===this.props.gridModeEnabled&&Yu,void 0===this.props.zenModeEnabled&&Zu,void 0===this.props.viewModeEnabled&&lg,Xu],top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current,elements:u})}else"element"===t&&(this.state.viewModeEnabled?tp.push({options:[navigator.clipboard&&Uu,...p],top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current,elements:u}):tp.push({options:[this.deviceType.isMobile&&Wu,this.deviceType.isMobile&&navigator.clipboard&&Uu,this.deviceType.isMobile&&navigator.clipboard&&{name:"paste",trackEvent:!1,perform:(e,t)=>(this.pasteFromClipboard(null),{commitToHistory:!1}),contextItemLabel:"labels.paste"},this.deviceType.isMobile&&d,...p,d,ku,Eu,d,i&&Iu,l&&qu,c&&$u,o&&ju,(i||o)&&d,Mu,d,Jl,ec,tc,nc,d,a&&Du,s&&Ru,(a||s)&&d,yc.contextItemPredicate(u,this.state)&&yc,ic,Qu,d,Ul],top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current,elements:u}))},this.handleWheel=cn((e=>{if(e.preventDefault(),wg)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({},ul({viewportX:vg,viewportY:yg,nextZoom:dl(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=en({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:Ig.pointers})},this.resetShouldCacheIgnoreZoomDebounced=Kt((()=>{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 Mg=jg;n(4285),n(3313);var Og=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 Ag=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:f,zenModeEnabled:m,gridModeEnabled:b,libraryReturnUrl:y,theme:x,name:_,renderCustomStats:k,onPaste:E,detectScroll:C=!0,handleKeyboardGlobally:S=!1,onLibraryChange:I,autoFocus:j=!1,generateIdForFile:T,onLinkOpen:M,id:O}=e,A=null===(t=e.UIOptions)||void 0===t?void 0:t.canvasActions,L={canvasActions:!!A&&Object.assign(Object.assign({},o.cW.canvasActions),A)};var P;A&&"object"==typeof A.export&&(A.export.saveFileToDisk=(null===(P=A.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)(w,{langCode:g,children:(0,v.jsx)(zh,{unstable_createStore:()=>Hh,scope:Nh,children:(0,v.jsx)(Mg,{id:O,onHomeButtonClick:n,onChange:i,initialData:a,excalidrawRef:s,onCollabButtonClick:l,isCollaborating:d,onPointerUpdate:u,renderTopRightUI:h,renderFooter:p,langCode:g,viewModeEnabled:f,zenModeEnabled:m,gridModeEnabled:b,libraryReturnUrl:y,theme:x,name:_,renderCustomStats:k,UIOptions:L,onPaste:E,detectScroll:C,handleKeyboardGlobally:S,onLibraryChange:I,autoFocus:j,generateIdForFile:T,onLinkOpen:M})})})},Lg=(e,t)=>{const{initialData:n,UIOptions:r={}}=e,i=Og(e,["initialData","UIOptions"]),{initialData:o,UIOptions:a={}}=t,s=Og(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]))},Pg=(0,r.forwardRef)(((e,t)=>(0,v.jsx)(Ag,Object.assign(Object.assign({},e),{excalidrawRef:t})))),zg=i().memo(Pg,Lg)},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","copyText":"Copy to clipboard as text","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"},"elementLock":{"lock":"Lock","unlock":"Unlock","lockAll":"Lock all","unlockAll":"Unlock all"}},"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.","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.)","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.","importLibraryError":"Couldn\'t load library"},"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","toggleElementLock":"Lock/unlock 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/vendor-0e2ecbd1f46fc190ec01.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="ExcalidrawLib:",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.webpackChunkExcalidrawLib=self.webpackChunkExcalidrawLib||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),l(5295)})()}));
|
|
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.ExcalidrawLib=t(require("react"),require("react-dom")):e.ExcalidrawLib=t(e.React,e.ReactDOM)}(self,(function(e,t){return(()=>{var n,r,i,o,a={6233:(e,t)=>{var n;n=function(e){e.version="0.3.0";var t=function(){for(var e=0,t=new Array(256),n=0;256!=n;++n)e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=n)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1,t[n]=e;return"undefined"!=typeof Int32Array?new Int32Array(t):t}(),n="undefined"!=typeof Buffer;function r(e){for(var n=-1,r=0,i=e.length-7;r<i;)n=(n=(n=(n=(n=(n=(n=(n=n>>>8^t[255&(n^e[r++])])>>>8^t[255&(n^e[r++])])>>>8^t[255&(n^e[r++])])>>>8^t[255&(n^e[r++])])>>>8^t[255&(n^e[r++])])>>>8^t[255&(n^e[r++])])>>>8^t[255&(n^e[r++])])>>>8^t[255&(n^e[r++])];for(;r<i+7;)n=n>>>8^t[255&(n^e[r++])];return-1^n}e.table=t,e.bstr=function(e){if(e.length>32768&&n)return r(new Buffer(e));for(var i=-1,o=e.length-1,a=0;a<o;)i=t[255&(i^e.charCodeAt(a++))]^i>>>8,i=t[255&(i^e.charCodeAt(a++))]^i>>>8;return a===o&&(i=i>>>8^t[255&(i^e.charCodeAt(a))]),-1^i},e.buf=function(e){if(e.length>1e4)return r(e);for(var n=-1,i=0,o=e.length-3;i<o;)n=(n=(n=(n=n>>>8^t[255&(n^e[i++])])>>>8^t[255&(n^e[i++])])>>>8^t[255&(n^e[i++])])>>>8^t[255&(n^e[i++])];for(;i<o+3;)n=n>>>8^t[255&(n^e[i++])];return-1^n},e.str=function(e){for(var n,r,i=-1,o=0,a=e.length;o<a;)(n=e.charCodeAt(o++))<128?i=i>>>8^t[255&(i^n)]:n<2048?i=(i=i>>>8^t[255&(i^(192|n>>6&31))])>>>8^t[255&(i^(128|63&n))]:n>=55296&&n<57344?(n=64+(1023&n),r=1023&e.charCodeAt(o++),i=(i=(i=(i=i>>>8^t[255&(i^(240|n>>8&7))])>>>8^t[255&(i^(128|n>>2&63))])>>>8^t[255&(i^(128|r>>6&15|3&n))])>>>8^t[255&(i^(128|63&r))]):i=(i=(i=i>>>8^t[255&(i^(224|n>>12&15))])>>>8^t[255&(i^(128|n>>6&63))])>>>8^t[255&(i^(128|63&n))];return-1^i}},"undefined"==typeof DO_NOT_EXPORT_CRC?n(t):n({})},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,f=function(){return u.Date.now()};function m(e,t,n){var i,o,a,s,l,c,d=0,u=!1,h=!1,m=!0;if("function"!=typeof e)throw new TypeError(r);function y(t){var n=i,r=o;return i=o=void 0,d=t,s=e.apply(r,n)}function x(e){return d=e,l=setTimeout(_,t),u?y(e):s}function w(e){var n=e-c;return void 0===c||n>=t||n<0||h&&e-d>=a}function _(){var e=f();if(w(e))return k(e);l=setTimeout(_,function(e){var n=t-(e-c);return h?g(n,a-(e-d)):n}(e))}function k(e){return l=void 0,m&&i?y(e):(i=o=void 0,s)}function E(){var e=f(),n=w(e);if(i=arguments,o=this,c=e,n){if(void 0===l)return x(c);if(h)return l=setTimeout(_,t),y(c)}return void 0===l&&(l=setTimeout(_,t)),s}return t=v(t)||0,b(n)&&(u=!!n.leading,a=(h="maxWait"in n)?p(v(n.maxWait)||0,t):a,m="trailing"in n?!!n.trailing:m),E.cancel=function(){void 0!==l&&clearTimeout(l),d=0,i=c=o=l=void 0},E.flush=function(){return void 0===l?s:k(f())},E}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),m(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,f=NaN,m=4294967295,b=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",l],["flip",512],["partial",c],["partialRight",d],["rearg",h]],v="[object Arguments]",y="[object Array]",x="[object Boolean]",w="[object Date]",_="[object Error]",k="[object Function]",E="[object GeneratorFunction]",C="[object Map]",S="[object Number]",I="[object Object]",j="[object Promise]",T="[object RegExp]",M="[object Set]",O="[object String]",A="[object Symbol]",L="[object WeakMap]",P="[object ArrayBuffer]",D="[object DataView]",z="[object Float32Array]",R="[object Float64Array]",B="[object Int8Array]",N="[object Int16Array]",H="[object Int32Array]",F="[object Uint8Array]",U="[object Uint8ClampedArray]",K="[object Uint16Array]",W="[object Uint32Array]",V=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,Y=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Z=/&(?:amp|lt|gt|quot|#39);/g,X=/[&<>"']/g,q=RegExp(Z.source),$=RegExp(X.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,fe=/\w*$/,me=/^[-+]0x[0-9a-f]+$/i,be=/^0b[01]+$/i,ve=/^\[object .+?Constructor\]$/,ye=/^0o[0-7]+$/i,xe=/^(?:0|[1-9]\d*)$/,we=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_e=/($^)/,ke=/['\n\r\u2028\u2029\\]/g,Ee="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ce="\\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]",Ae="["+Te+"]",Le="["+Ee+"]",Pe="\\d+",De="[\\u2700-\\u27bf]",ze="["+Se+"]",Re="[^\\ud800-\\udfff"+Te+Pe+Ce+Se+Ie+"]",Be="\\ud83c[\\udffb-\\udfff]",Ne="[^\\ud800-\\udfff]",He="(?:\\ud83c[\\udde6-\\uddff]){2}",Fe="[\\ud800-\\udbff][\\udc00-\\udfff]",Ue="["+Ie+"]",Ke="(?:"+ze+"|"+Re+")",We="(?:"+Ue+"|"+Re+")",Ve="(?:['’](?:d|ll|m|re|s|t|ve))?",Ge="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ye="(?:"+Le+"|"+Be+")"+"?",Ze="[\\ufe0e\\ufe0f]?",Xe=Ze+Ye+("(?:\\u200d(?:"+[Ne,He,Fe].join("|")+")"+Ze+Ye+")*"),qe="(?:"+[De,He,Fe].join("|")+")"+Xe,$e="(?:"+[Ne+Le+"?",Le,He,Fe,Oe].join("|")+")",Qe=RegExp(Me,"g"),Je=RegExp(Le,"g"),et=RegExp(Be+"(?="+Be+")|"+$e+Xe,"g"),tt=RegExp([Ue+"?"+ze+"+"+Ve+"(?="+[Ae,Ue,"$"].join("|")+")",We+"+"+Ge+"(?="+[Ae,Ue+Ke,"$"].join("|")+")",Ue+"?"+Ke+"+"+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"+Ee+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[B]=at[N]=at[H]=at[F]=at[U]=at[K]=at[W]=!0,at[v]=at[y]=at[P]=at[x]=at[D]=at[w]=at[_]=at[k]=at[C]=at[S]=at[I]=at[T]=at[M]=at[O]=at[L]=!1;var st={};st[v]=st[y]=st[P]=st[D]=st[x]=st[w]=st[z]=st[R]=st[B]=st[N]=st[H]=st[C]=st[S]=st[I]=st[T]=st[M]=st[O]=st[A]=st[F]=st[U]=st[K]=st[W]=!0,st[_]=st[k]=st[L]=!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,ft=gt&&e&&!e.nodeType&&e,mt=ft&&ft.exports===gt,bt=mt&&ut.process,vt=function(){try{var e=ft&&ft.require&&ft.require("util").types;return e||bt&&bt.binding&&bt.binding("util")}catch(e){}}(),yt=vt&&vt.isArrayBuffer,xt=vt&&vt.isDate,wt=vt&&vt.isMap,_t=vt&&vt.isRegExp,kt=vt&&vt.isSet,Et=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 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 At(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 Lt(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 Bt=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 Ht(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):Ht(e,Kt,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 Kt(e){return e!=e}function Wt(e,t){var n=null==e?0:e.length;return n?Zt(e,t)/n:f}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 Zt(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 Xt(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,fn(e)+1).replace(ae,""):e}function $t(e){return function(t){return e(t)}}function Qt(e,t){return Lt(t,(function(t){return e[t]}))}function Jt(e,t){return e.has(t)}function en(e,t){for(var n=-1,r=e.length;++n<r&&Ft(t,e[n],0)>-1;);return n}function tn(e,t){for(var n=e.length;n--&&Ft(t,e[n],0)>-1;);return n}function nn(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var rn=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):Bt(e)}function gn(e){return sn(e)?function(e){return e.match(et)||[]}(e):function(e){return e.split("")}(e)}function fn(e){for(var t=e.length;t--&&se.test(e.charAt(t)););return t}var mn=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,Ee=t.Error,Ce=t.Function,Se=t.Math,Ie=t.Object,je=t.RegExp,Te=t.String,Me=t.TypeError,Oe=r.prototype,Ae=Ce.prototype,Le=Ie.prototype,Pe=t["__core-js_shared__"],De=Ae.toString,ze=Le.hasOwnProperty,Re=0,Be=(n=/[^.]+$/.exec(Pe&&Pe.keys&&Pe.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Ne=Le.toString,He=De.call(Ie),Fe=pt._,Ue=je("^"+De.call(ze).replace(ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ke=mt?t.Buffer:i,We=t.Symbol,Ve=t.Uint8Array,Ge=Ke?Ke.allocUnsafe:i,Ye=cn(Ie.getPrototypeOf,Ie),Ze=Ie.create,Xe=Le.propertyIsEnumerable,qe=Oe.splice,$e=We?We.isConcatSpreadable:i,et=We?We.iterator:i,nt=We?We.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,ft=Se.ceil,bt=Se.floor,vt=Ie.getOwnPropertySymbols,Bt=Ke?Ke.isBuffer:i,Gt=t.isFinite,vn=Oe.join,yn=cn(Ie.keys,Ie),xn=Se.max,wn=Se.min,_n=se.now,kn=t.parseInt,En=Se.random,Cn=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"),An=Mn&&new Mn,Ln={},Pn=Fo(Sn),Dn=Fo(In),zn=Fo(jn),Rn=Fo(Tn),Bn=Fo(Mn),Nn=We?We.prototype:i,Hn=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 Kn=function(){function e(){}return function(t){if(!rs(t))return{};if(Ze)return Ze(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function Wn(){}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__=m,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 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 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 qn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Xn;++t<n;)this.add(e[t])}function $n(e){var t=this.__data__=new Zn(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?Xt(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 Bo(Oi(e),cr(t,0,e.length))}function tr(e){return Bo(Oi(e))}function nr(e,t,n){(n!==i&&!Ka(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)&&Ka(r,n)&&(n!==i||t in e)||sr(e,t,n)}function ir(e,t){for(var n=e.length;n--;)if(Ka(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&&Ai(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==k||h==E;if($a(e))return Ci(e,l);if(h==I||h==v||p&&!o){if(s=c||p?{}:yo(e),!l)return c?function(e,t){return Ai(e,mo(e),t)}(e,function(e,t){return e&&Ai(t,Ds(t),e)}(s,e)):function(e,t){return Ai(e,fo(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 x: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 B:case N:case H:case F:case U:case K:case W:return Ii(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,fe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case A:return i=e,Hn?Ie(Hn.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 f=u?i:(d?c?ao:oo:c?Ds:Ps)(e);return It(f||e,(function(r,i){f&&(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=Lt(t,$t(n))),r?(o=At,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=Wn.prototype,Un.prototype.constructor=Un,Vn.prototype=Kn(Wn.prototype),Vn.prototype.constructor=Vn,Gn.prototype=Kn(Wn.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},Zn.prototype.clear=function(){this.__data__=[],this.size=0},Zn.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)},Zn.prototype.get=function(e){var t=this.__data__,n=ir(t,e);return n<0?i:t[n][1]},Zn.prototype.has=function(e){return ir(this.__data__,e)>-1},Zn.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},Xn.prototype.clear=function(){this.size=0,this.__data__={hash:new Yn,map:new(In||Zn),string:new Yn}},Xn.prototype.delete=function(e){var t=ho(this,e).delete(e);return this.size-=t?1:0,t},Xn.prototype.get=function(e){return ho(this,e).get(e)},Xn.prototype.has=function(e){return ho(this,e).has(e)},Xn.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 Zn,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 Zn){var r=n.__data__;if(!In||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Xn(r)}return n.set(e,t),this.size=n.size,this};var gr=Di(_r),fr=Di(kr,!0);function mr(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 yr(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=xo),i||(i=[]);++o<a;){var s=e[o];t>0&&n(s)?t>1?yr(s,t-1,n,r,i):Pt(i,s):r||(i[i.length]=s)}return i}var xr=zi(),wr=zi(!0);function _r(e,t){return e&&xr(e,t,Ps)}function kr(e,t){return e&&wr(e,t,Ps)}function Er(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[Ho(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?At: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=Lt(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 f=h[p],m=t?t(f):f;if(f=n||0!==f?f:0,!(g?Jt(g,m):o(u,m,n))){for(l=s;--l;){var b=c[l];if(!(b?Jt(b,m):o(e[l],m,n)))continue e}g&&g.push(m),u.push(f)}}return u}function Ar(e,t,n){var r=null==(e=Mo(e,t=wi(t,e)))?e:e[Ho(Jo(t))];return null==r?i:Ct(r,e,n)}function Lr(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?y:bo(e),d=l?y: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 x:case w:case S:return Ka(+e,+t);case _: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 A:if(Hn)return Hn.call(e)==Hn.call(t)}return!1}(e,t,c,n,r,o,a);if(!(1&n)){var g=u&&ze.call(e,"__wrapped__"),f=h&&ze.call(t,"__wrapped__");if(g||f){var m=g?e.value():e,b=f?t.value():t;return a||(a=new $n),o(m,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 f=!0;a.set(e,t),a.set(t,e);var m=s;for(;++u<c;){var b=e[h=l[u]],v=t[h];if(r)var y=s?r(v,b,h,t,e,a):r(b,v,h,e,t,a);if(!(y===i?b===v||o(b,v,n,r,a):y)){f=!1;break}m||(m="constructor"==h)}if(f&&!m){var x=e.constructor,w=t.constructor;x==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof x&&x instanceof x&&"function"==typeof w&&w instanceof w||(f=!1)}return a.delete(e),a.delete(t),f}(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,Be&&Be 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)?Kr(e[0],e[1]):Ur(e):fl(e)}function Br(e){if(!So(e))return yn(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 Hr(e,t){return e<t}function Fr(e,t){var n=-1,i=Xa(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 Kr(e,t){return ko(e)&&Io(t)?jo(Ho(e),t):function(n){var r=Ts(n,e);return r===i&&r===t?Ms(n,e):Pr(t,r,3)}}function Wr(e,t,n,r,o){e!==t&&xr(t,(function(a,s){if(o||(o=new $n),rs(a))!function(e,t,n,r,o,a,s){var l=Ao(e,n),c=Ao(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),f=!p&&!g&&hs(c);u=c,p||g||f?Ya(l)?u=l:qa(l)?u=Oi(l):g?(h=!1,u=Ci(c,!0)):f?(h=!1,u=Ii(c,!0)):u=[]:ss(c)||Ga(c)?(u=l,Ga(l)?u=xs(l):rs(l)&&!es(l)||(u=yo(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,Wr,r,o);else{var l=r?r(Ao(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?Lt(t,(function(e){return Ya(e)?function(t){return Cr(t,1===e.length?e[0]:e)}:e})):[al];var r=-1;t=Lt(t,$t(uo()));var i=Fr(e,(function(e,n,i){var o=Lt(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=Cr(e,a);n(s,a)&&ti(o,wi(a,e),s)}return o}function Zr(e,t,n,r){var i=r?Ut:Ft,o=-1,a=t.length,s=e;for(e===t&&(t=Oi(t)),n&&(s=Lt(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 Xr(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(En()*(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(Ks(e))}function ei(e,t){var n=Ks(e);return Bo(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=Ho(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=An?function(e,t){return An.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 Bo(Ks(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,f=h==h,m=us(h);if(s)var b=r||f;else b=d?f&&(r||p):l?f&&p&&(r||!g):c?f&&p&&!g&&(r||!m):!g&&!m&&(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||!Ka(s,l)){var l=s;o[i++]=0===a?0:a}}return o}function di(e){return"number"==typeof e?e:us(e)?f:+e}function ui(e){if("string"==typeof e)return e;if(Ya(e))return Lt(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=At;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[Ho(Jo(t))]}function gi(e,t,n,r){return ti(e,t,n(Cr(e,t)),r)}function fi(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 mi(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(yr(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 yi(e){return qa(e)?e:[]}function xi(e){return"function"==typeof e?e:al}function wi(e,t){return Ya(e)?e:ko(e,t)?[e]:No(ws(e))}var _i=Qr;function ki(e,t,n){var r=e.length;return n=n===i?r:n,!t&&n>=r?e:oi(e,t,n)}var Ei=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 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=xn(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=xn(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 Ai(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 Li(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&&_o(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(!Xa(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?ki(n,1).join(""):t.slice(1);return r[e]()+o}}function Bi(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=Kn(e.prototype),r=e.apply(n,t);return rs(r)?r:n}}function Hi(e){return function(t,n,r){var o=Ie(t);if(!Xa(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&&Eo(d[0])&&424==d[1]&&!d[4].length&&1==d[9]?l[lo(d[0])].apply(l,d[3]):1==s.length&&Eo(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,f=2&t,m=24&t,b=512&t,v=f?i:Ni(e);return function i(){for(var u=arguments.length,y=r(u),x=u;x--;)y[x]=arguments[x];if(m)var w=co(i),_=nn(y,w);if(o&&(y=Ti(y,o,a,m)),s&&(y=Mi(y,s,l,m)),u-=_,m&&u<h){var k=dn(y,w);return Xi(e,t,Ui,i.placeholder,n,y,k,c,d,h-u)}var E=g?n:this,C=f?E[e]:e;return u=y.length,c?y=Oo(y,c):b&&u>1&&y.reverse(),p&&d<u&&(y.length=d),this&&this!==pt&&this instanceof i&&(C=v||Ni(C)),C.apply(E,y)}}function Ki(e,t){return function(n,r){return function(e,t,n,r){return _r(e,(function(e,i,o){t(r,n(e),i,o)})),r}(n,e,t(r),{})}}function Wi(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=Lt(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,ft(e/pn(t)));return sn(t)?ki(gn(r),0,e).join(""):r.slice(0,e)}function Yi(e){return function(t,n,o){return o&&"number"!=typeof o&&_o(t,n,o)&&(n=o=i),t=ms(t),n===i?(n=t,t=0):n=ms(n),function(e,t,n,i){for(var o=-1,a=xn(ft((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:ms(o),e)}}function Zi(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=ys(t),n=ys(n)),e(t,n)}}function Xi(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],f=n.apply(i,g);return Eo(e)&&Lo(f,g),f.placeholder=r,zo(f,e,t)}function qi(e){var t=Se[e];return function(e,n){if(e=ys(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 Lt(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Ji(e,t,n,a,p,g,f,m){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),f=f===i?f:xn(bs(f),0),m=m===i?m:bs(m),v-=p?p.length:0,t&d){var y=a,x=p;a=p=i}var w=b?i:so(e),_=[e,t,n,a,p,y,x,g,f,m];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}(_,w),e=_[0],t=_[1],n=_[2],a=_[3],p=_[4],!(m=_[9]=_[9]===i?b?0:e.length:xn(_[9]-v,0))&&24&t&&(t&=-25),t&&1!=t)k=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?Xi(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,m):t!=c&&33!=t||p.length?Ui.apply(i,_):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 k=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:Lo)(k,_),e,t)}function eo(e,t,n,r){return e===i||Ka(e,Le[n])&&!ze.call(r,n)?t:e}function to(e,t,n,r,o,a){return rs(e)&&rs(t)&&(a.set(t,e),Wr(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 f=e[h],m=t[h];if(r)var b=s?r(m,f,h,t,e,a):r(f,m,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)&&(f===e||o(f,e,n,r,a)))return g.push(t)}))){p=!1;break}}else if(f!==m&&!o(f,m,n,r,a)){p=!1;break}}return a.delete(e),a.delete(t),p}function io(e){return Do(To(e,i,Zo),e+"")}function oo(e){return Sr(e,Ps,fo)}function ao(e){return Sr(e,Ds,mo)}var so=An?function(e){return An.get(e)}:ul;function lo(e){for(var t=e.name+"",n=Ln[t],r=ze.call(Ln,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 fo=vt?function(e){return null==e?[]:(e=Ie(e),Mt(vt(e),(function(t){return Xe.call(e,t)})))}:vl,mo=vt?function(e){for(var t=[];e;)Pt(t,fo(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=Ho(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 yo(e){return"function"!=typeof e.constructor||So(e)?{}:Kn(Ye(e))}function xo(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&&xe.test(e))&&e>-1&&e%1==0&&e<t}function _o(e,t,n){if(!rs(n))return!1;var r=typeof t;return!!("number"==r?Xa(n)&&wo(t,n.length):"string"==r&&t in n)&&Ka(n[t],e)}function ko(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 Eo(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)!=C||jn&&bo(jn.resolve())!=j||Tn&&bo(new Tn)!=M||Mn&&bo(new Mn)!=L)&&(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 C;case zn:return j;case Rn:return M;case Bn:return L}return t});var Co=Pe?es:yl;function So(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Le)}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=xn(t===i?e.length-1:t,0),function(){for(var i=arguments,o=-1,a=xn(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 Ao(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Lo=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=_n(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Bo(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 Ho(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 Ko=Qr((function(e,t){return qa(e)?pr(e,yr(t,1,qa,!0)):[]})),Wo=Qr((function(e,t){var n=Jo(t);return qa(n)&&(n=i),qa(e)?pr(e,yr(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,yr(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=xn(r+i,0)),Ht(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?xn(r+o,0):wn(o,r-1)),Ht(e,uo(t,3),o,!0)}function Zo(e){return(null==e?0:e.length)?yr(e,1):[]}function Xo(e){return e&&e.length?e[0]:i}var qo=Qr((function(e){var t=Lt(e,yi);return t.length&&t[0]===e[0]?Or(t):[]})),$o=Qr((function(e){var t=Jo(e),n=Lt(e,yi);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=Lt(e,yi);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?Zr(e,t):e}var na=io((function(e,t){var n=null==e?0:e.length,r=lr(e,t);return Xr(e,Lt(t,(function(e){return wo(e,n)?+e:e})).sort(ji)),r}));function ra(e){return null==e?e:Cn.call(e)}var ia=Qr((function(e){return hi(yr(e,1,qa,!0))})),oa=Qr((function(e){var t=Jo(e);return qa(t)&&(t=i),hi(yr(e,1,qa,!0),uo(t,2))})),aa=Qr((function(e){var t=Jo(e);return t="function"==typeof t?t:i,hi(yr(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=xn(e.length,t),!0})),Xt(t,(function(t){return Lt(e,Vt(t))}))}function la(e,t){if(!e||!e.length)return[];var n=sa(e);return null==t?n:Lt(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 fa(e){var t=Un(e);return t.__chain__=!0,t}function ma(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:ma,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=Li((function(e,t,n){ze.call(e,n)?++e[n]:sr(e,n,1)}));var ya=Hi(Go),xa=Hi(Yo);function wa(e,t){return(Ya(e)?It:gr)(e,uo(t,3))}function _a(e,t){return(Ya(e)?jt:fr)(e,uo(t,3))}var ka=Li((function(e,t,n){ze.call(e,n)?e[n].push(t):sr(e,n,[t])}));var Ea=Qr((function(e,t,n){var i=-1,o="function"==typeof t,a=Xa(e)?r(e.length):[];return gr(e,(function(e){a[++i]=o?Ct(t,e,n):Ar(e,t,n)})),a})),Ca=Li((function(e,t,n){sr(e,n,t)}));function Sa(e,t){return(Ya(e)?Lt:Fr)(e,uo(t,3))}var Ia=Li((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&&_o(e,t[0],t[1])?t=[]:n>2&&_o(t[0],t[1],t[2])&&(t=[t[0]]),Gr(e,yr(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 Aa=Qr((function(e,t,n){var r=1;if(n.length){var i=dn(n,co(Aa));r|=c}return Ji(e,r,t,n,i)})),La=Qr((function(e,t,n){var r=3;if(n.length){var i=dn(n,co(La));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 f(t){var n=r,o=a;return r=a=i,u=t,l=e.apply(o,n)}function m(e){return u=e,c=Po(v,t),h?f(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 y(e);c=Po(v,function(e){var n=t-(e-d);return p?wn(n,s-(e-u)):n}(e))}function y(e){return c=i,g&&r?f(e):(r=a=i,l)}function x(){var e=Ta(),n=b(e);if(r=arguments,a=this,d=e,n){if(c===i)return m(d);if(p)return Ei(c),c=Po(v,t),f(d)}return c===i&&(c=Po(v,t)),l}return t=ys(t)||0,rs(n)&&(h=!!n.leading,s=(p="maxWait"in n)?xn(ys(n.maxWait)||0,t):s,g="trailing"in n?!!n.trailing:g),x.cancel=function(){c!==i&&Ei(c),u=0,r=d=a=c=i},x.flush=function(){return c===i?l:y(Ta())},x}var Da=Qr((function(e,t){return hr(e,1,t)})),za=Qr((function(e,t,n){return hr(e,ys(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||Xn),n}function Ba(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=Xn;var Na=_i((function(e,t){var n=(t=1==t.length&&Ya(t[0])?Lt(t[0],$t(uo())):Lt(yr(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)}))})),Ha=Qr((function(e,t){var n=dn(t,co(Ha));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 Ka(e,t){return e===t||e!=e&&t!=t}var Wa=Zi(jr),Va=Zi((function(e,t){return e>=t})),Ga=Lr(function(){return arguments}())?Lr:function(e){return is(e)&&ze.call(e,"callee")&&!Xe.call(e,"callee")},Ya=r.isArray,Za=yt?$t(yt):function(e){return is(e)&&Ir(e)==P};function Xa(e){return null!=e&&ns(e.length)&&!es(e)}function qa(e){return is(e)&&Xa(e)}var $a=Bt||yl,Qa=xt?$t(xt):function(e){return is(e)&&Ir(e)==w};function Ja(e){if(!is(e))return!1;var t=Ir(e);return t==_||"[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==k||t==E||"[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)&&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)==He}var ls=_t?$t(_t):function(e){return is(e)&&Ir(e)==T};var cs=kt?$t(kt):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)==A}var hs=Et?$t(Et):function(e){return is(e)&&ns(e.length)&&!!at[Ir(e)]};var ps=Zi(Hr),gs=Zi((function(e,t){return e<=t}));function fs(e){if(!e)return[];if(Xa(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:Ks)(e)}function ms(e){return e?(e=ys(e))===p||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function bs(e){var t=ms(e),n=t%1;return t==t?n?t-n:t:0}function vs(e){return e?cr(bs(e),0,m):0}function ys(e){if("number"==typeof e)return e;if(us(e))return f;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||ye.test(e)?dt(e.slice(2),n?2:8):me.test(e)?f:+e}function xs(e){return Ai(e,Ds(e))}function ws(e){return null==e?"":ui(e)}var _s=Pi((function(e,t){if(So(t)||Xa(t))Ai(t,Ps(t),e);else for(var n in t)ze.call(t,n)&&rr(e,n,t[n])})),ks=Pi((function(e,t){Ai(t,Ds(t),e)})),Es=Pi((function(e,t,n,r){Ai(t,Ds(t),e,r)})),Cs=Pi((function(e,t,n,r){Ai(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&&_o(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||Ka(u,Le[d])&&!ze.call(e,d))&&(e[d]=a[d])}return e})),js=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=Ki((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ne.call(t)),e[t]=n}),rl(al)),As=Ki((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),Ls=Qr(Ar);function Ps(e){return Xa(e)?Qn(e):Br(e)}function Ds(e){return Xa(e)?Qn(e,!0):Nr(e)}var zs=Pi((function(e,t,n){Wr(e,t,n)})),Rs=Pi((function(e,t,n,r){Wr(e,t,n,r)})),Bs=io((function(e,t){var n={};if(null==e)return n;var r=!1;t=Lt(t,(function(t){return t=wi(t,e),r||(r=t.length>1),t})),Ai(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 Hs(e,t){if(null==e)return{};var n=Lt(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 Ks(e){return null==e?[]:Qt(e,Ps(e))}var Ws=Bi((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=Bi((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Zs=Bi((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Xs=Ri("toLowerCase");var qs=Bi((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var $s=Bi((function(e,t,n){return e+(n?" ":"")+Js(t)}));var Qs=Bi((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 Ee(e)}})),nl=io((function(e,t){return It(t,(function(t){t=Ho(t),sr(e,t,Aa(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 Ar(n,e,t)}})),cl=Qr((function(e,t){return function(n){return Ar(e,n,t)}}));function dl(e,t,n){var r=Ps(t),i=Er(t,r);null!=n||rs(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=Er(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(Lt),pl=Vi(Tt),gl=Vi(Rt);function fl(e){return ko(e)?Vt(Ho(e)):function(e){return function(t){return Cr(t,e)}}(e)}var ml=Yi(),bl=Yi(!0);function vl(){return[]}function yl(){return!1}var xl=Wi((function(e,t){return e+t}),0),wl=qi("ceil"),_l=Wi((function(e,t){return e/t}),1),kl=qi("floor");var El,Cl=Wi((function(e,t){return e*t}),1),Sl=qi("round"),Il=Wi((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=_s,Un.assignIn=ks,Un.assignInWith=Es,Un.assignWith=Cs,Un.at=Ss,Un.before=Oa,Un.bind=Aa,Un.bindAll=nl,Un.bindKey=La,Un.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ya(e)?e:[e]},Un.chain=fa,Un.chunk=function(e,t,n){t=(n?_o(e,t,n):t===i)?1:xn(bs(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var a=0,s=0,l=r(ft(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],yr(t,1))},Un.cond=function(e){var t=null==e?0:e.length,n=uo();return e=t?Lt(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=Kn(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=Ko,Un.differenceBy=Wo,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?fi(e,uo(t,3),!0,!0):[]},Un.dropWhile=function(e,t){return e&&e.length?fi(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&&_o(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 yr(Sa(e,t),1)},Un.flatMapDeep=function(e,t){return yr(Sa(e,t),p)},Un.flatMapDepth=function(e,t,n){return n=n===i?1:bs(n),yr(Sa(e,t),n)},Un.flatten=Zo,Un.flattenDeep=function(e){return(null==e?0:e.length)?yr(e,p):[]},Un.flattenDepth=function(e,t){return(null==e?0:e.length)?yr(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?[]:Er(e,Ps(e))},Un.functionsIn=function(e){return null==e?[]:Er(e,Ds(e))},Un.groupBy=ka,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=As,Un.invokeMap=Ea,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),_r(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),_r(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 Kr(e,dr(t,1))},Un.memoize=Ra,Un.merge=zs,Un.mergeWith=Rs,Un.method=ll,Un.methodOf=cl,Un.mixin=dl,Un.negate=Ba,Un.nthArg=function(e){return e=bs(e),Qr((function(t){return Vr(t,e)}))},Un.omit=Bs,Un.omitBy=function(e,t){return Hs(e,Ba(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=Ha,Un.partialRight=Fa,Un.partition=Ia,Un.pick=Ns,Un.pickBy=Hs,Un.property=fl,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?Zr(e,t,uo(n,2)):e},Un.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Zr(e,t,i,n):e},Un.pullAt=na,Un.range=ml,Un.rangeRight=bl,Un.rearg=Ua,Un.reject=function(e,t){return(Ya(e)?Mt:vr)(e,Ba(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 Xr(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?_o(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&&_o(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&&_o(e,t,n)&&(t=n=i),(n=n===i?m:n>>>0)?(e=ws(e))&&("string"==typeof t||null!=t&&!ls(t))&&!(t=ui(t))&&sn(e)?ki(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:xn(bs(t),0),Qr((function(n){var r=n[t],i=ki(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?fi(e,uo(t,3),!1,!0):[]},Un.takeWhile=function(e,t){return e&&e.length?fi(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=ma,Un.toArray=fs,Un.toPairs=Fs,Un.toPairsIn=Us,Un.toPath=function(e){return Ya(e)?Lt(e,Ho):us(e)?[e]:Oi(No(ws(e)))},Un.toPlainObject=xs,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)?Kn(Ye(e)):{}}return(i?It:_r)(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,xi(n))},Un.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:gi(e,t,xi(n),r)},Un.values=Ks,Un.valuesIn=function(e){return null==e?[]:Qt(e,Ds(e))},Un.without=ca,Un.words=el,Un.wrap=function(e,t){return Ha(xi(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=ks,Un.extendWith=Es,dl(Un,Un),Un.add=xl,Un.attempt=tl,Un.camelCase=Ws,Un.capitalize=Vs,Un.ceil=wl,Un.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=ys(n))==n?n:0),t!==i&&(t=(t=ys(t))==t?t:0),cr(ys(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=_l,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=Ka,Un.escape=function(e){return(e=ws(e))&&$.test(e)?e.replace(X,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:mr;return n&&_o(e,t,n)&&(t=i),r(e,uo(t,3))},Un.find=ya,Un.findIndex=Go,Un.findKey=function(e,t){return Nt(e,uo(t,3),_r)},Un.findLast=xa,Un.findLastIndex=Yo,Un.findLastKey=function(e,t){return Nt(e,uo(t,3),kr)},Un.floor=kl,Un.forEach=wa,Un.forEachRight=_a,Un.forIn=function(e,t){return null==e?e:xr(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&&_r(e,uo(t,3))},Un.forOwnRight=function(e,t){return e&&kr(e,uo(t,3))},Un.get=Ts,Un.gt=Wa,Un.gte=Va,Un.has=function(e,t){return null!=e&&vo(e,t,Tr)},Un.hasIn=Ms,Un.head=Xo,Un.identity=al,Un.includes=function(e,t,n,r){e=Xa(e)?e:Ks(e),n=n&&!r?bs(n):0;var i=e.length;return n<0&&(n=xn(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=xn(r+i,0)),Ft(e,t,i)},Un.inRange=function(e,t,n){return t=ms(t),n===i?(n=t,t=0):n=ms(n),function(e,t,n){return e>=wn(t,n)&&e<xn(t,n)}(e=ys(e),t,n)},Un.invoke=Ls,Un.isArguments=Ga,Un.isArray=Ya,Un.isArrayBuffer=Za,Un.isArrayLike=Xa,Un.isArrayLikeObject=qa,Un.isBoolean=function(e){return!0===e||!1===e||is(e)&&Ir(e)==x},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(Xa(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!Br(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 Ee("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return zr(e)},Un.isNil=function(e){return null==e},Un.isNull=function(e){return null===e},Un.isNumber=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)==L},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?xn(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):Ht(e,Kt,o,!0)},Un.lowerCase=Zs,Un.lowerFirst=Xs,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 Wt(e,al)},Un.meanBy=function(e,t){return Wt(e,uo(t,2))},Un.min=function(e){return e&&e.length?br(e,al,Hr):i},Un.minBy=function(e,t){return e&&e.length?br(e,uo(t,2),Hr):i},Un.stubArray=vl,Un.stubFalse=yl,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(ft(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),kn(ws(e).replace(ae,""),t||0)},Un.random=function(e,t,n){if(n&&"boolean"!=typeof n&&_o(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=ms(e),t===i?(t=e,e=0):t=ms(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var o=En();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,fr)},Un.repeat=function(e,t,n){return t=(n?_o(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[Ho(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(Xa(e))return ds(e)?pn(e):e.length;var t=bo(e);return t==C||t==M?e.size:Br(e).length},Un.snakeCase=qs,Un.some=function(e,t,n){var r=Ya(e)?Rt:ai;return n&&_o(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&&Ka(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(Ka(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?Zt(e,al):0},Un.sumBy=function(e,t){return e&&e.length?Zt(e,uo(t,2)):0},Un.template=function(e,t,n){var r=Un.templateSettings;n&&_o(e,t,n)&&(t=i),e=ws(e),t=Es({},t,r,eo);var o,a,s=Es({},t.imports,r.imports,eo),l=Ps(s),c=Qt(s,l),d=0,u=t.interpolate||_e,h="__p += '",p=je((t.escape||_e).source+"|"+u.source+"|"+(u===ee?ge:_e).source+"|"+(t.evaluate||_e).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(ke,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 f=ze.call(t,"variable")&&t.variable;if(f){if(he.test(f))throw new Ee("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("+(f||"obj")+") {\n"+(f?"":"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 m=tl((function(){return Ce(l,g+"return "+h).apply(i,c)}));if(m.source=h,Ja(m))throw m;return m},Un.times=function(e,t){if((e=bs(e))<1||e>g)return[];var n=m,r=wn(e,m);t=uo(t),e-=m;for(var i=Xt(r,t);++n<e;)t(n);return i},Un.toFinite=ms,Un.toInteger=bs,Un.toLength=vs,Un.toLower=function(e){return ws(e).toLowerCase()},Un.toNumber=ys,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 ki(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,fn(e)+1);if(!e||!(t=ui(t)))return e;var r=gn(e);return ki(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 ki(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?ki(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(fe.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(Z,mn):e},Un.uniqueId=function(e){var t=++Re;return ws(e)+t},Un.upperCase=Qs,Un.upperFirst=Js,Un.each=wa,Un.eachRight=_a,Un.first=Xo,dl(Un,(El={},_r(Un,(function(e,t){ze.call(Un.prototype,t)||(El[t]=e)})),El),{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:xn(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,m),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 Ar(n,e,t)}))})),Gn.prototype.reject=function(e){return this.filter(Ba(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(m)},_r(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,f=l&&!p;if(!a&&d){t=f?t:new Gn(this);var m=e.apply(t,s);return m.__actions__.push({func:ma,args:[u],thisArg:i}),new Vn(m,h)}return g&&f?e.apply(this,s):(m=this.thru(u),g?r?m.value()[0]:m.value():m)})})),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)}))}})),_r(Gn.prototype,(function(e,t){var n=Un[t];if(n){var r=n.name+"";ze.call(Ln,r)||(Ln[r]=[]),Ln[r].push({name:t,func:n})}})),Ln[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=xn(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 mi(e,this.__actions__);var g=[];e:for(;l--&&h<p;){for(var f=-1,m=e[c+=t];++f<u;){var b=d[f],v=b.iteratee,y=b.type,x=v(m);if(2==y)m=x;else if(!x){if(1==y)continue e;break e}}g[h++]=m}return g},Un.prototype.at=ba,Un.prototype.chain=function(){return fa(this)},Un.prototype.commit=function(){return new Vn(this.value(),this.__chain__)},Un.prototype.next=function(){this.__values__===i&&(this.__values__=fs(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 Wn;){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:ma,args:[ra],thisArg:i}),new Vn(t,this.__chain__)}return this.thru(ra)},Un.prototype.toJSON=Un.prototype.valueOf=Un.prototype.value=function(){return mi(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}},2744:(e,t,n)=>{"use strict";var r={};(0,n(9187).assign)(r,n(4395),n(578),n(2684)),e.exports=r},4395:(e,t,n)=>{"use strict";var r=n(7651),i=n(9187),o=n(8592),a=n(5604),s=n(249),l=Object.prototype.toString;function c(e){if(!(this instanceof c))return new c(e);this.options=i.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var n=r.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw new Error(a[n]);if(t.header&&r.deflateSetHeader(this.strm,t.header),t.dictionary){var d;if(d="string"==typeof t.dictionary?o.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=r.deflateSetDictionary(this.strm,d)))throw new Error(a[n]);this._dict_set=!0}}function d(e,t){var n=new c(t);if(n.push(e,!0),n.err)throw n.msg||a[n.err];return n.result}c.prototype.push=function(e,t){var n,a,s=this.strm,c=this.options.chunkSize;if(this.ended)return!1;a=t===~~t?t:!0===t?4:0,"string"==typeof e?s.input=o.string2buf(e):"[object ArrayBuffer]"===l.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new i.Buf8(c),s.next_out=0,s.avail_out=c),1!==(n=r.deflate(s,a))&&0!==n)return this.onEnd(n),this.ended=!0,!1;0!==s.avail_out&&(0!==s.avail_in||4!==a&&2!==a)||("string"===this.options.to?this.onData(o.buf2binstring(i.shrinkBuf(s.output,s.next_out))):this.onData(i.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&1!==n);return 4===a?(n=r.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,0===n):2!==a||(this.onEnd(0),s.avail_out=0,!0)},c.prototype.onData=function(e){this.chunks.push(e)},c.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Deflate=c,t.deflate=d,t.deflateRaw=function(e,t){return(t=t||{}).raw=!0,d(e,t)},t.gzip=function(e,t){return(t=t||{}).gzip=!0,d(e,t)}},578:(e,t,n)=>{"use strict";var r=n(7823),i=n(9187),o=n(8592),a=n(2684),s=n(5604),l=n(249),c=n(9968),d=Object.prototype.toString;function u(e){if(!(this instanceof u))return new u(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var n=r.inflateInit2(this.strm,t.windowBits);if(n!==a.Z_OK)throw new Error(s[n]);if(this.header=new c,r.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=o.string2buf(t.dictionary):"[object ArrayBuffer]"===d.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=r.inflateSetDictionary(this.strm,t.dictionary))!==a.Z_OK))throw new Error(s[n])}function h(e,t){var n=new u(t);if(n.push(e,!0),n.err)throw n.msg||s[n.err];return n.result}u.prototype.push=function(e,t){var n,s,l,c,u,h=this.strm,p=this.options.chunkSize,g=this.options.dictionary,f=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof e?h.input=o.binstring2buf(e):"[object ArrayBuffer]"===d.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new i.Buf8(p),h.next_out=0,h.avail_out=p),(n=r.inflate(h,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&g&&(n=r.inflateSetDictionary(this.strm,g)),n===a.Z_BUF_ERROR&&!0===f&&(n=a.Z_OK,f=!1),n!==a.Z_STREAM_END&&n!==a.Z_OK)return this.onEnd(n),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&n!==a.Z_STREAM_END&&(0!==h.avail_in||s!==a.Z_FINISH&&s!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(l=o.utf8border(h.output,h.next_out),c=h.next_out-l,u=o.buf2string(h.output,l),h.next_out=c,h.avail_out=p-c,c&&i.arraySet(h.output,h.output,l,c,0),this.onData(u)):this.onData(i.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(f=!0)}while((h.avail_in>0||0===h.avail_out)&&n!==a.Z_STREAM_END);return n===a.Z_STREAM_END&&(s=a.Z_FINISH),s===a.Z_FINISH?(n=r.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===a.Z_OK):s!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),h.avail_out=0,!0)},u.prototype.onData=function(e){this.chunks.push(e)},u.prototype.onEnd=function(e){e===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=u,t.inflate=h,t.inflateRaw=function(e,t){return(t=t||{}).raw=!0,h(e,t)},t.ungzip=h},9187:(e,t)=>{"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var i in n)r(n,i)&&(e[i]=n[i])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,n,r,i){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+r),i);else for(var o=0;o<r;o++)e[i+o]=t[n+o]},flattenChunks:function(e){var t,n,r,i,o,a;for(r=0,t=0,n=e.length;t<n;t++)r+=e[t].length;for(a=new Uint8Array(r),i=0,t=0,n=e.length;t<n;t++)o=e[t],a.set(o,i),i+=o.length;return a}},o={arraySet:function(e,t,n,r,i){for(var o=0;o<r;o++)e[i+o]=t[n+o]},flattenChunks:function(e){return[].concat.apply([],e)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,i)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,o))},t.setTyped(n)},8592:(e,t,n)=>{"use strict";var r=n(9187),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){o=!1}for(var a=new r.Buf8(256),s=0;s<256;s++)a[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function l(e,t){if(t<65534&&(e.subarray&&o||!e.subarray&&i))return String.fromCharCode.apply(null,r.shrinkBuf(e,t));for(var n="",a=0;a<t;a++)n+=String.fromCharCode(e[a]);return n}a[254]=a[254]=1,t.string2buf=function(e){var t,n,i,o,a,s=e.length,l=0;for(o=0;o<s;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(i=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(i-56320),o++),l+=n<128?1:n<2048?2:n<65536?3:4;for(t=new r.Buf8(l),a=0,o=0;a<l;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(i=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(i-56320),o++),n<128?t[a++]=n:n<2048?(t[a++]=192|n>>>6,t[a++]=128|63&n):n<65536?(t[a++]=224|n>>>12,t[a++]=128|n>>>6&63,t[a++]=128|63&n):(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63,t[a++]=128|n>>>6&63,t[a++]=128|63&n);return t},t.buf2binstring=function(e){return l(e,e.length)},t.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,i=t.length;n<i;n++)t[n]=e.charCodeAt(n);return t},t.buf2string=function(e,t){var n,r,i,o,s=t||e.length,c=new Array(2*s);for(r=0,n=0;n<s;)if((i=e[n++])<128)c[r++]=i;else if((o=a[i])>4)c[r++]=65533,n+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&n<s;)i=i<<6|63&e[n++],o--;o>1?c[r++]=65533:i<65536?c[r++]=i:(i-=65536,c[r++]=55296|i>>10&1023,c[r++]=56320|1023&i)}return l(c,r)},t.utf8border=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+a[e[n]]>t?n:t}},3693:e=>{"use strict";e.exports=function(e,t,n,r){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==n;){n-=a=n>2e3?2e3:n;do{o=o+(i=i+t[r++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0}},2684:e=>{"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},8464:e=>{"use strict";var t=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();e.exports=function(e,n,r,i){var o=t,a=i+r;e^=-1;for(var s=i;s<a;s++)e=e>>>8^o[255&(e^n[s])];return-1^e}},7651:(e,t,n)=>{"use strict";var r,i=n(9187),o=n(8676),a=n(3693),s=n(8464),l=n(5604),c=-2,d=258,u=262,h=103,p=113,g=666;function f(e,t){return e.msg=l[t],t}function m(e){return(e<<1)-(e>4?9:0)}function b(e){for(var t=e.length;--t>=0;)e[t]=0}function v(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(i.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))}function y(e,t){o._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,v(e.strm)}function x(e,t){e.pending_buf[e.pending++]=t}function w(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function _(e,t){var n,r,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-u?e.strstart-(e.w_size-u):0,c=e.window,h=e.w_mask,p=e.prev,g=e.strstart+d,f=c[o+a-1],m=c[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(c[(n=t)+a]===m&&c[n+a-1]===f&&c[n]===c[o]&&c[++n]===c[o+1]){o+=2,n++;do{}while(c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&o<g);if(r=d-(g-o),o=g-d,r>a){if(e.match_start=t,a=r,r>=s)break;f=c[o+a-1],m=c[o+a]}}}while((t=p[t&h])>l&&0!=--i);return a<=e.lookahead?a:e.lookahead}function k(e){var t,n,r,o,l,c,d,h,p,g,f=e.w_size;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=f+(f-u)){i.arraySet(e.window,e.window,f,f,0),e.match_start-=f,e.strstart-=f,e.block_start-=f,t=n=e.hash_size;do{r=e.head[--t],e.head[t]=r>=f?r-f:0}while(--n);t=n=f;do{r=e.prev[--t],e.prev[t]=r>=f?r-f:0}while(--n);o+=f}if(0===e.strm.avail_in)break;if(c=e.strm,d=e.window,h=e.strstart+e.lookahead,p=o,g=void 0,(g=c.avail_in)>p&&(g=p),n=0===g?0:(c.avail_in-=g,i.arraySet(d,c.input,c.next_in,g,h),1===c.state.wrap?c.adler=a(c.adler,d,g,h):2===c.state.wrap&&(c.adler=s(c.adler,d,g,h)),c.next_in+=g,c.total_in+=g,g),e.lookahead+=n,e.lookahead+e.insert>=3)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+3-1])&e.hash_mask,e.prev[l&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=l,l++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<u&&0!==e.strm.avail_in)}function E(e,t){for(var n,r;;){if(e.lookahead<u){if(k(e),e.lookahead<u&&0===t)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-u&&(e.match_length=_(e,n)),e.match_length>=3)if(r=o._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(y(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(y(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(y(e,!1),0===e.strm.avail_out)?1:2}function C(e,t){for(var n,r,i;;){if(e.lookahead<u){if(k(e),e.lookahead<u&&0===t)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==n&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-u&&(e.match_length=_(e,n),e.match_length<=5&&(1===e.strategy||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,r=o._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(y(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((r=o._tr_tally(e,0,e.window[e.strstart-1]))&&y(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=o._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(y(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(y(e,!1),0===e.strm.avail_out)?1:2}function S(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}function I(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(1146),this.dyn_dtree=new i.Buf16(122),this.bl_tree=new i.Buf16(78),b(this.dyn_ltree),b(this.dyn_dtree),b(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(16),this.heap=new i.Buf16(573),b(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(573),b(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function j(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:p,e.adler=2===t.wrap?0:1,t.last_flush=0,o._tr_init(t),0):f(e,c)}function T(e){var t,n=j(e);return 0===n&&((t=e.state).window_size=2*t.w_size,b(t.head),t.max_lazy_match=r[t.level].max_lazy,t.good_match=r[t.level].good_length,t.nice_match=r[t.level].nice_length,t.max_chain_length=r[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0),n}function M(e,t,n,r,o,a){if(!e)return c;var s=1;if(-1===t&&(t=6),r<0?(s=0,r=-r):r>15&&(s=2,r-=16),o<1||o>9||8!==n||r<8||r>15||t<0||t>9||a<0||a>4)return f(e,c);8===r&&(r=9);var l=new I;return e.state=l,l.strm=e,l.wrap=s,l.gzhead=null,l.w_bits=r,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=o+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+3-1)/3),l.window=new i.Buf8(2*l.w_size),l.head=new i.Buf16(l.hash_size),l.prev=new i.Buf16(l.w_size),l.lit_bufsize=1<<o+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new i.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=t,l.strategy=a,l.method=n,T(e)}r=[new S(0,0,0,0,(function(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(k(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((0===e.strstart||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,y(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-u&&(y(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(y(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(y(e,!1),e.strm.avail_out),1)})),new S(4,4,8,4,E),new S(4,5,16,8,E),new S(4,6,32,32,E),new S(4,4,16,16,C),new S(8,16,32,32,C),new S(8,16,128,128,C),new S(8,32,128,256,C),new S(32,128,258,1024,C),new S(32,258,258,4096,C)],t.deflateInit=function(e,t){return M(e,t,8,15,8,0)},t.deflateInit2=M,t.deflateReset=T,t.deflateResetKeep=j,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?c:(e.state.gzhead=t,0):c},t.deflate=function(e,t){var n,i,a,l;if(!e||!e.state||t>5||t<0)return e?f(e,c):c;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||i.status===g&&4!==t)return f(e,0===e.avail_out?-5:c);if(i.strm=e,n=i.last_flush,i.last_flush=t,42===i.status)if(2===i.wrap)e.adler=0,x(i,31),x(i,139),x(i,8),i.gzhead?(x(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),x(i,255&i.gzhead.time),x(i,i.gzhead.time>>8&255),x(i,i.gzhead.time>>16&255),x(i,i.gzhead.time>>24&255),x(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),x(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(x(i,255&i.gzhead.extra.length),x(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(x(i,0),x(i,0),x(i,0),x(i,0),x(i,0),x(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),x(i,3),i.status=p);else{var u=8+(i.w_bits-8<<4)<<8;u|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(u|=32),u+=31-u%31,i.status=p,w(i,u),0!==i.strstart&&(w(i,e.adler>>>16),w(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),v(e),a=i.pending,i.pending!==i.pending_buf_size));)x(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),v(e),a=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,x(i,l)}while(0!==l);i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===l&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),v(e),a=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,x(i,l)}while(0!==l);i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===l&&(i.status=h)}else i.status=h;if(i.status===h&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&v(e),i.pending+2<=i.pending_buf_size&&(x(i,255&e.adler),x(i,e.adler>>8&255),e.adler=0,i.status=p)):i.status=p),0!==i.pending){if(v(e),0===e.avail_out)return i.last_flush=-1,0}else if(0===e.avail_in&&m(t)<=m(n)&&4!==t)return f(e,-5);if(i.status===g&&0!==e.avail_in)return f(e,-5);if(0!==e.avail_in||0!==i.lookahead||0!==t&&i.status!==g){var _=2===i.strategy?function(e,t){for(var n;;){if(0===e.lookahead&&(k(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,n=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(y(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(y(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(y(e,!1),0===e.strm.avail_out)?1:2}(i,t):3===i.strategy?function(e,t){for(var n,r,i,a,s=e.window;;){if(e.lookahead<=d){if(k(e),e.lookahead<=d&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(r=s[i=e.strstart-1])===s[++i]&&r===s[++i]&&r===s[++i]){a=e.strstart+d;do{}while(r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&i<a);e.match_length=d-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=o._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(y(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(y(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(y(e,!1),0===e.strm.avail_out)?1:2}(i,t):r[i.level].func(i,t);if(3!==_&&4!==_||(i.status=g),1===_||3===_)return 0===e.avail_out&&(i.last_flush=-1),0;if(2===_&&(1===t?o._tr_align(i):5!==t&&(o._tr_stored_block(i,0,0,!1),3===t&&(b(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),v(e),0===e.avail_out))return i.last_flush=-1,0}return 4!==t?0:i.wrap<=0?1:(2===i.wrap?(x(i,255&e.adler),x(i,e.adler>>8&255),x(i,e.adler>>16&255),x(i,e.adler>>24&255),x(i,255&e.total_in),x(i,e.total_in>>8&255),x(i,e.total_in>>16&255),x(i,e.total_in>>24&255)):(w(i,e.adler>>>16),w(i,65535&e.adler)),v(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?0:1)},t.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&t!==h&&t!==p&&t!==g?f(e,c):(e.state=null,t===p?f(e,-3):0):c},t.deflateSetDictionary=function(e,t){var n,r,o,s,l,d,u,h,p=t.length;if(!e||!e.state)return c;if(2===(s=(n=e.state).wrap)||1===s&&42!==n.status||n.lookahead)return c;for(1===s&&(e.adler=a(e.adler,t,p,0)),n.wrap=0,p>=n.w_size&&(0===s&&(b(n.head),n.strstart=0,n.block_start=0,n.insert=0),h=new i.Buf8(n.w_size),i.arraySet(h,t,p-n.w_size,n.w_size,0),t=h,p=n.w_size),l=e.avail_in,d=e.next_in,u=e.input,e.avail_in=p,e.next_in=0,e.input=t,k(n);n.lookahead>=3;){r=n.strstart,o=n.lookahead-2;do{n.ins_h=(n.ins_h<<n.hash_shift^n.window[r+3-1])&n.hash_mask,n.prev[r&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=r,r++}while(--o);n.strstart=r,n.lookahead=2,k(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,e.next_in=d,e.input=u,e.avail_in=l,n.wrap=s,0},t.deflateInfo="pako deflate (from Nodeca project)"},9968:e=>{"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},9365:e=>{"use strict";e.exports=function(e,t){var n,r,i,o,a,s,l,c,d,u,h,p,g,f,m,b,v,y,x,w,_,k,E,C,S;n=e.state,r=e.next_in,C=e.input,i=r+(e.avail_in-5),o=e.next_out,S=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),l=n.dmax,c=n.wsize,d=n.whave,u=n.wnext,h=n.window,p=n.hold,g=n.bits,f=n.lencode,m=n.distcode,b=(1<<n.lenbits)-1,v=(1<<n.distbits)-1;e:do{g<15&&(p+=C[r++]<<g,g+=8,p+=C[r++]<<g,g+=8),y=f[p&b];t:for(;;){if(p>>>=x=y>>>24,g-=x,0===(x=y>>>16&255))S[o++]=65535&y;else{if(!(16&x)){if(0==(64&x)){y=f[(65535&y)+(p&(1<<x)-1)];continue t}if(32&x){n.mode=12;break e}e.msg="invalid literal/length code",n.mode=30;break e}w=65535&y,(x&=15)&&(g<x&&(p+=C[r++]<<g,g+=8),w+=p&(1<<x)-1,p>>>=x,g-=x),g<15&&(p+=C[r++]<<g,g+=8,p+=C[r++]<<g,g+=8),y=m[p&v];n:for(;;){if(p>>>=x=y>>>24,g-=x,!(16&(x=y>>>16&255))){if(0==(64&x)){y=m[(65535&y)+(p&(1<<x)-1)];continue n}e.msg="invalid distance code",n.mode=30;break e}if(_=65535&y,g<(x&=15)&&(p+=C[r++]<<g,(g+=8)<x&&(p+=C[r++]<<g,g+=8)),(_+=p&(1<<x)-1)>l){e.msg="invalid distance too far back",n.mode=30;break e}if(p>>>=x,g-=x,_>(x=o-a)){if((x=_-x)>d&&n.sane){e.msg="invalid distance too far back",n.mode=30;break e}if(k=0,E=h,0===u){if(k+=c-x,x<w){w-=x;do{S[o++]=h[k++]}while(--x);k=o-_,E=S}}else if(u<x){if(k+=c+u-x,(x-=u)<w){w-=x;do{S[o++]=h[k++]}while(--x);if(k=0,u<w){w-=x=u;do{S[o++]=h[k++]}while(--x);k=o-_,E=S}}}else if(k+=u-x,x<w){w-=x;do{S[o++]=h[k++]}while(--x);k=o-_,E=S}for(;w>2;)S[o++]=E[k++],S[o++]=E[k++],S[o++]=E[k++],w-=3;w&&(S[o++]=E[k++],w>1&&(S[o++]=E[k++]))}else{k=o-_;do{S[o++]=S[k++],S[o++]=S[k++],S[o++]=S[k++],w-=3}while(w>2);w&&(S[o++]=S[k++],w>1&&(S[o++]=S[k++]))}break}}break}}while(r<i&&o<s);r-=w=g>>3,p&=(1<<(g-=w<<3))-1,e.next_in=r,e.next_out=o,e.avail_in=r<i?i-r+5:5-(r-i),e.avail_out=o<s?s-o+257:257-(o-s),n.hold=p,n.bits=g}},7823:(e,t,n)=>{"use strict";var r=n(9187),i=n(3693),o=n(8464),a=n(9365),s=n(6446),l=-2,c=12,d=30;function u(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function h(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function p(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new r.Buf32(852),t.distcode=t.distdyn=new r.Buf32(592),t.sane=1,t.back=-1,0):l}function g(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,p(e)):l}function f(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?l:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,g(e))):l}function m(e,t){var n,r;return e?(r=new h,e.state=r,r.window=null,0!==(n=f(e,t))&&(e.state=null),n):l}var b,v,y=!0;function x(e){if(y){var t;for(b=new r.Buf32(512),v=new r.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(1,e.lens,0,288,b,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(2,e.lens,0,32,v,0,e.work,{bits:5}),y=!1}e.lencode=b,e.lenbits=9,e.distcode=v,e.distbits=5}function w(e,t,n,i){var o,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new r.Buf8(a.wsize)),i>=a.wsize?(r.arraySet(a.window,t,n-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((o=a.wsize-a.wnext)>i&&(o=i),r.arraySet(a.window,t,n-i,o,a.wnext),(i-=o)?(r.arraySet(a.window,t,n-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=o))),0}t.inflateReset=g,t.inflateReset2=f,t.inflateResetKeep=p,t.inflateInit=function(e){return m(e,15)},t.inflateInit2=m,t.inflate=function(e,t){var n,h,p,g,f,m,b,v,y,_,k,E,C,S,I,j,T,M,O,A,L,P,D,z,R=0,B=new r.Buf8(4),N=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return l;(n=e.state).mode===c&&(n.mode=13),f=e.next_out,p=e.output,b=e.avail_out,g=e.next_in,h=e.input,m=e.avail_in,v=n.hold,y=n.bits,_=m,k=b,P=0;e:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;y<16;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}if(2&n.wrap&&35615===v){n.check=0,B[0]=255&v,B[1]=v>>>8&255,n.check=o(n.check,B,2,0),v=0,y=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&v)<<8)+(v>>8))%31){e.msg="incorrect header check",n.mode=d;break}if(8!=(15&v)){e.msg="unknown compression method",n.mode=d;break}if(y-=4,L=8+(15&(v>>>=4)),0===n.wbits)n.wbits=L;else if(L>n.wbits){e.msg="invalid window size",n.mode=d;break}n.dmax=1<<L,e.adler=n.check=1,n.mode=512&v?10:c,v=0,y=0;break;case 2:for(;y<16;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}if(n.flags=v,8!=(255&n.flags)){e.msg="unknown compression method",n.mode=d;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=d;break}n.head&&(n.head.text=v>>8&1),512&n.flags&&(B[0]=255&v,B[1]=v>>>8&255,n.check=o(n.check,B,2,0)),v=0,y=0,n.mode=3;case 3:for(;y<32;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}n.head&&(n.head.time=v),512&n.flags&&(B[0]=255&v,B[1]=v>>>8&255,B[2]=v>>>16&255,B[3]=v>>>24&255,n.check=o(n.check,B,4,0)),v=0,y=0,n.mode=4;case 4:for(;y<16;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}n.head&&(n.head.xflags=255&v,n.head.os=v>>8),512&n.flags&&(B[0]=255&v,B[1]=v>>>8&255,n.check=o(n.check,B,2,0)),v=0,y=0,n.mode=5;case 5:if(1024&n.flags){for(;y<16;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}n.length=v,n.head&&(n.head.extra_len=v),512&n.flags&&(B[0]=255&v,B[1]=v>>>8&255,n.check=o(n.check,B,2,0)),v=0,y=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((E=n.length)>m&&(E=m),E&&(n.head&&(L=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),r.arraySet(n.head.extra,h,g,E,L)),512&n.flags&&(n.check=o(n.check,h,E,g)),m-=E,g+=E,n.length-=E),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===m)break e;E=0;do{L=h[g+E++],n.head&&L&&n.length<65536&&(n.head.name+=String.fromCharCode(L))}while(L&&E<m);if(512&n.flags&&(n.check=o(n.check,h,E,g)),m-=E,g+=E,L)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===m)break e;E=0;do{L=h[g+E++],n.head&&L&&n.length<65536&&(n.head.comment+=String.fromCharCode(L))}while(L&&E<m);if(512&n.flags&&(n.check=o(n.check,h,E,g)),m-=E,g+=E,L)break e}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;y<16;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}if(v!==(65535&n.check)){e.msg="header crc mismatch",n.mode=d;break}v=0,y=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=c;break;case 10:for(;y<32;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}e.adler=n.check=u(v),v=0,y=0,n.mode=11;case 11:if(0===n.havedict)return e.next_out=f,e.avail_out=b,e.next_in=g,e.avail_in=m,n.hold=v,n.bits=y,2;e.adler=n.check=1,n.mode=c;case c:if(5===t||6===t)break e;case 13:if(n.last){v>>>=7&y,y-=7&y,n.mode=27;break}for(;y<3;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}switch(n.last=1&v,y-=1,3&(v>>>=1)){case 0:n.mode=14;break;case 1:if(x(n),n.mode=20,6===t){v>>>=2,y-=2;break e}break;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=d}v>>>=2,y-=2;break;case 14:for(v>>>=7&y,y-=7&y;y<32;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}if((65535&v)!=(v>>>16^65535)){e.msg="invalid stored block lengths",n.mode=d;break}if(n.length=65535&v,v=0,y=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(E=n.length){if(E>m&&(E=m),E>b&&(E=b),0===E)break e;r.arraySet(p,h,g,E,f),m-=E,g+=E,b-=E,f+=E,n.length-=E;break}n.mode=c;break;case 17:for(;y<14;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}if(n.nlen=257+(31&v),v>>>=5,y-=5,n.ndist=1+(31&v),v>>>=5,y-=5,n.ncode=4+(15&v),v>>>=4,y-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=d;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;y<3;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}n.lens[N[n.have++]]=7&v,v>>>=3,y-=3}for(;n.have<19;)n.lens[N[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,D={bits:n.lenbits},P=s(0,n.lens,0,19,n.lencode,0,n.work,D),n.lenbits=D.bits,P){e.msg="invalid code lengths set",n.mode=d;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;j=(R=n.lencode[v&(1<<n.lenbits)-1])>>>16&255,T=65535&R,!((I=R>>>24)<=y);){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}if(T<16)v>>>=I,y-=I,n.lens[n.have++]=T;else{if(16===T){for(z=I+2;y<z;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}if(v>>>=I,y-=I,0===n.have){e.msg="invalid bit length repeat",n.mode=d;break}L=n.lens[n.have-1],E=3+(3&v),v>>>=2,y-=2}else if(17===T){for(z=I+3;y<z;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}y-=I,L=0,E=3+(7&(v>>>=I)),v>>>=3,y-=3}else{for(z=I+7;y<z;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}y-=I,L=0,E=11+(127&(v>>>=I)),v>>>=7,y-=7}if(n.have+E>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=d;break}for(;E--;)n.lens[n.have++]=L}}if(n.mode===d)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=d;break}if(n.lenbits=9,D={bits:n.lenbits},P=s(1,n.lens,0,n.nlen,n.lencode,0,n.work,D),n.lenbits=D.bits,P){e.msg="invalid literal/lengths set",n.mode=d;break}if(n.distbits=6,n.distcode=n.distdyn,D={bits:n.distbits},P=s(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,D),n.distbits=D.bits,P){e.msg="invalid distances set",n.mode=d;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(m>=6&&b>=258){e.next_out=f,e.avail_out=b,e.next_in=g,e.avail_in=m,n.hold=v,n.bits=y,a(e,k),f=e.next_out,p=e.output,b=e.avail_out,g=e.next_in,h=e.input,m=e.avail_in,v=n.hold,y=n.bits,n.mode===c&&(n.back=-1);break}for(n.back=0;j=(R=n.lencode[v&(1<<n.lenbits)-1])>>>16&255,T=65535&R,!((I=R>>>24)<=y);){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}if(j&&0==(240&j)){for(M=I,O=j,A=T;j=(R=n.lencode[A+((v&(1<<M+O)-1)>>M)])>>>16&255,T=65535&R,!(M+(I=R>>>24)<=y);){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}v>>>=M,y-=M,n.back+=M}if(v>>>=I,y-=I,n.back+=I,n.length=T,0===j){n.mode=26;break}if(32&j){n.back=-1,n.mode=c;break}if(64&j){e.msg="invalid literal/length code",n.mode=d;break}n.extra=15&j,n.mode=22;case 22:if(n.extra){for(z=n.extra;y<z;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}n.length+=v&(1<<n.extra)-1,v>>>=n.extra,y-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;j=(R=n.distcode[v&(1<<n.distbits)-1])>>>16&255,T=65535&R,!((I=R>>>24)<=y);){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}if(0==(240&j)){for(M=I,O=j,A=T;j=(R=n.distcode[A+((v&(1<<M+O)-1)>>M)])>>>16&255,T=65535&R,!(M+(I=R>>>24)<=y);){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}v>>>=M,y-=M,n.back+=M}if(v>>>=I,y-=I,n.back+=I,64&j){e.msg="invalid distance code",n.mode=d;break}n.offset=T,n.extra=15&j,n.mode=24;case 24:if(n.extra){for(z=n.extra;y<z;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}n.offset+=v&(1<<n.extra)-1,v>>>=n.extra,y-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=d;break}n.mode=25;case 25:if(0===b)break e;if(E=k-b,n.offset>E){if((E=n.offset-E)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=d;break}E>n.wnext?(E-=n.wnext,C=n.wsize-E):C=n.wnext-E,E>n.length&&(E=n.length),S=n.window}else S=p,C=f-n.offset,E=n.length;E>b&&(E=b),b-=E,n.length-=E;do{p[f++]=S[C++]}while(--E);0===n.length&&(n.mode=21);break;case 26:if(0===b)break e;p[f++]=n.length,b--,n.mode=21;break;case 27:if(n.wrap){for(;y<32;){if(0===m)break e;m--,v|=h[g++]<<y,y+=8}if(k-=b,e.total_out+=k,n.total+=k,k&&(e.adler=n.check=n.flags?o(n.check,p,k,f-k):i(n.check,p,k,f-k)),k=b,(n.flags?v:u(v))!==n.check){e.msg="incorrect data check",n.mode=d;break}v=0,y=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;y<32;){if(0===m)break e;m--,v+=h[g++]<<y,y+=8}if(v!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=d;break}v=0,y=0}n.mode=29;case 29:P=1;break e;case d:P=-3;break e;case 31:return-4;default:return l}return e.next_out=f,e.avail_out=b,e.next_in=g,e.avail_in=m,n.hold=v,n.bits=y,(n.wsize||k!==e.avail_out&&n.mode<d&&(n.mode<27||4!==t))&&w(e,e.output,e.next_out,k-e.avail_out)?(n.mode=31,-4):(_-=e.avail_in,k-=e.avail_out,e.total_in+=_,e.total_out+=k,n.total+=k,n.wrap&&k&&(e.adler=n.check=n.flags?o(n.check,p,k,e.next_out-k):i(n.check,p,k,e.next_out-k)),e.data_type=n.bits+(n.last?64:0)+(n.mode===c?128:0)+(20===n.mode||15===n.mode?256:0),(0===_&&0===k||4===t)&&0===P&&(P=-5),P)},t.inflateEnd=function(e){if(!e||!e.state)return l;var t=e.state;return t.window&&(t.window=null),e.state=null,0},t.inflateGetHeader=function(e,t){var n;return e&&e.state?0==(2&(n=e.state).wrap)?l:(n.head=t,t.done=!1,0):l},t.inflateSetDictionary=function(e,t){var n,r=t.length;return e&&e.state?0!==(n=e.state).wrap&&11!==n.mode?l:11===n.mode&&i(1,t,r,0)!==n.check?-3:w(e,t,r,r)?(n.mode=31,-4):(n.havedict=1,0):l},t.inflateInfo="pako inflate (from Nodeca project)"},6446:(e,t,n)=>{"use strict";var r=n(9187),i=15,o=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],s=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],l=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(e,t,n,c,d,u,h,p){var g,f,m,b,v,y,x,w,_,k=p.bits,E=0,C=0,S=0,I=0,j=0,T=0,M=0,O=0,A=0,L=0,P=null,D=0,z=new r.Buf16(16),R=new r.Buf16(16),B=null,N=0;for(E=0;E<=i;E++)z[E]=0;for(C=0;C<c;C++)z[t[n+C]]++;for(j=k,I=i;I>=1&&0===z[I];I--);if(j>I&&(j=I),0===I)return d[u++]=20971520,d[u++]=20971520,p.bits=1,0;for(S=1;S<I&&0===z[S];S++);for(j<S&&(j=S),O=1,E=1;E<=i;E++)if(O<<=1,(O-=z[E])<0)return-1;if(O>0&&(0===e||1!==I))return-1;for(R[1]=0,E=1;E<i;E++)R[E+1]=R[E]+z[E];for(C=0;C<c;C++)0!==t[n+C]&&(h[R[t[n+C]]++]=C);if(0===e?(P=B=h,y=19):1===e?(P=o,D-=257,B=a,N-=257,y=256):(P=s,B=l,y=-1),L=0,C=0,E=S,v=u,T=j,M=0,m=-1,b=(A=1<<j)-1,1===e&&A>852||2===e&&A>592)return 1;for(;;){x=E-M,h[C]<y?(w=0,_=h[C]):h[C]>y?(w=B[N+h[C]],_=P[D+h[C]]):(w=96,_=0),g=1<<E-M,S=f=1<<T;do{d[v+(L>>M)+(f-=g)]=x<<24|w<<16|_|0}while(0!==f);for(g=1<<E-1;L&g;)g>>=1;if(0!==g?(L&=g-1,L+=g):L=0,C++,0==--z[E]){if(E===I)break;E=t[n+h[C]]}if(E>j&&(L&b)!==m){for(0===M&&(M=j),v+=S,O=1<<(T=E-M);T+M<I&&!((O-=z[T+M])<=0);)T++,O<<=1;if(A+=1<<T,1===e&&A>852||2===e&&A>592)return 1;d[m=L&b]=j<<24|T<<16|v-u|0}}return 0!==L&&(d[v+L]=E-M<<24|64<<16|0),p.bits=j,0}},5604:e=>{"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},8676:(e,t,n)=>{"use strict";var r=n(9187);function i(e){for(var t=e.length;--t>=0;)e[t]=0}var o=256,a=286,s=30,l=15,c=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],d=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],u=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],h=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],p=new Array(576);i(p);var g=new Array(60);i(g);var f=new Array(512);i(f);var m=new Array(256);i(m);var b=new Array(29);i(b);var v,y,x,w=new Array(s);function _(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}function k(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function E(e){return e<256?f[e]:f[256+(e>>>7)]}function C(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function S(e,t,n){e.bi_valid>16-n?(e.bi_buf|=t<<e.bi_valid&65535,C(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function I(e,t,n){S(e,n[2*t],n[2*t+1])}function j(e,t){var n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1}function T(e,t,n){var r,i,o=new Array(16),a=0;for(r=1;r<=l;r++)o[r]=a=a+n[r-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=j(o[s]++,s))}}function M(e){var t;for(t=0;t<a;t++)e.dyn_ltree[2*t]=0;for(t=0;t<s;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function O(e){e.bi_valid>8?C(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function A(e,t,n,r){var i=2*t,o=2*n;return e[i]<e[o]||e[i]===e[o]&&r[t]<=r[n]}function L(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&A(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!A(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function P(e,t,n){var r,i,a,s,l=0;if(0!==e.last_lit)do{r=e.pending_buf[e.d_buf+2*l]<<8|e.pending_buf[e.d_buf+2*l+1],i=e.pending_buf[e.l_buf+l],l++,0===r?I(e,i,t):(I(e,(a=m[i])+o+1,t),0!==(s=c[a])&&S(e,i-=b[a],s),I(e,a=E(--r),n),0!==(s=d[a])&&S(e,r-=w[a],s))}while(l<e.last_lit);I(e,256,t)}function D(e,t){var n,r,i,o=t.dyn_tree,a=t.stat_desc.static_tree,s=t.stat_desc.has_stree,c=t.stat_desc.elems,d=-1;for(e.heap_len=0,e.heap_max=573,n=0;n<c;n++)0!==o[2*n]?(e.heap[++e.heap_len]=d=n,e.depth[n]=0):o[2*n+1]=0;for(;e.heap_len<2;)o[2*(i=e.heap[++e.heap_len]=d<2?++d:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=a[2*i+1]);for(t.max_code=d,n=e.heap_len>>1;n>=1;n--)L(e,o,n);i=c;do{n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],L(e,o,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,o[2*i]=o[2*n]+o[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,o[2*n+1]=o[2*r+1]=i,e.heap[1]=i++,L(e,o,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,i,o,a,s,c=t.dyn_tree,d=t.max_code,u=t.stat_desc.static_tree,h=t.stat_desc.has_stree,p=t.stat_desc.extra_bits,g=t.stat_desc.extra_base,f=t.stat_desc.max_length,m=0;for(o=0;o<=l;o++)e.bl_count[o]=0;for(c[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n<573;n++)(o=c[2*c[2*(r=e.heap[n])+1]+1]+1)>f&&(o=f,m++),c[2*r+1]=o,r>d||(e.bl_count[o]++,a=0,r>=g&&(a=p[r-g]),s=c[2*r],e.opt_len+=s*(o+a),h&&(e.static_len+=s*(u[2*r+1]+a)));if(0!==m){do{for(o=f-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[f]--,m-=2}while(m>0);for(o=f;0!==o;o--)for(r=e.bl_count[o];0!==r;)(i=e.heap[--n])>d||(c[2*i+1]!==o&&(e.opt_len+=(o-c[2*i+1])*c[2*i],c[2*i+1]=o),r--)}}(e,t),T(o,d,e.bl_count)}function z(e,t,n){var r,i,o=-1,a=t[1],s=0,l=7,c=4;for(0===a&&(l=138,c=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=a,a=t[2*(r+1)+1],++s<l&&i===a||(s<c?e.bl_tree[2*i]+=s:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,o=i,0===a?(l=138,c=3):i===a?(l=6,c=3):(l=7,c=4))}function R(e,t,n){var r,i,o=-1,a=t[1],s=0,l=7,c=4;for(0===a&&(l=138,c=3),r=0;r<=n;r++)if(i=a,a=t[2*(r+1)+1],!(++s<l&&i===a)){if(s<c)do{I(e,i,e.bl_tree)}while(0!=--s);else 0!==i?(i!==o&&(I(e,i,e.bl_tree),s--),I(e,16,e.bl_tree),S(e,s-3,2)):s<=10?(I(e,17,e.bl_tree),S(e,s-3,3)):(I(e,18,e.bl_tree),S(e,s-11,7));s=0,o=i,0===a?(l=138,c=3):i===a?(l=6,c=3):(l=7,c=4)}}i(w);var B=!1;function N(e,t,n,i){S(e,0+(i?1:0),3),function(e,t,n,i){O(e),i&&(C(e,n),C(e,~n)),r.arraySet(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}(e,t,n,!0)}t._tr_init=function(e){B||(!function(){var e,t,n,r,i,o=new Array(16);for(n=0,r=0;r<28;r++)for(b[r]=n,e=0;e<1<<c[r];e++)m[n++]=r;for(m[n-1]=r,i=0,r=0;r<16;r++)for(w[r]=i,e=0;e<1<<d[r];e++)f[i++]=r;for(i>>=7;r<s;r++)for(w[r]=i<<7,e=0;e<1<<d[r]-7;e++)f[256+i++]=r;for(t=0;t<=l;t++)o[t]=0;for(e=0;e<=143;)p[2*e+1]=8,e++,o[8]++;for(;e<=255;)p[2*e+1]=9,e++,o[9]++;for(;e<=279;)p[2*e+1]=7,e++,o[7]++;for(;e<=287;)p[2*e+1]=8,e++,o[8]++;for(T(p,287,o),e=0;e<s;e++)g[2*e+1]=5,g[2*e]=j(e,5);v=new _(p,c,257,a,l),y=new _(g,d,0,s,l),x=new _(new Array(0),u,0,19,7)}(),B=!0),e.l_desc=new k(e.dyn_ltree,v),e.d_desc=new k(e.dyn_dtree,y),e.bl_desc=new k(e.bl_tree,x),e.bi_buf=0,e.bi_valid=0,M(e)},t._tr_stored_block=N,t._tr_flush_block=function(e,t,n,r){var i,a,s=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<o;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),D(e,e.l_desc),D(e,e.d_desc),s=function(e){var t;for(z(e,e.dyn_ltree,e.l_desc.max_code),z(e,e.dyn_dtree,e.d_desc.max_code),D(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*h[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(a=e.static_len+3+7>>>3)<=i&&(i=a)):i=a=n+5,n+4<=i&&-1!==t?N(e,t,n,r):4===e.strategy||a===i?(S(e,2+(r?1:0),3),P(e,p,g)):(S(e,4+(r?1:0),3),function(e,t,n,r){var i;for(S(e,t-257,5),S(e,n-1,5),S(e,r-4,4),i=0;i<r;i++)S(e,e.bl_tree[2*h[i]+1],3);R(e,e.dyn_ltree,t-1),R(e,e.dyn_dtree,n-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),P(e,e.dyn_ltree,e.dyn_dtree)),M(e),r&&O(e)},t._tr_tally=function(e,t,n){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(m[n]+o+1)]++,e.dyn_dtree[2*E(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){S(e,2,3),I(e,256,p),function(e){16===e.bi_valid?(C(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},249:e=>{"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},9066:e=>{e.exports=function(e){e.data&&e.name&&(e=e.data);for(var t=!0,n="",r="",i=0;i<e.length;i++){var o=e[i];if(t)o?r+=String.fromCharCode(o):t=!1;else{if(!o)throw new Error("Invalid NULL character found. 0x00 character is not permitted in tEXt content");n+=String.fromCharCode(o)}}return{keyword:r,text:n}}},9686:e=>{e.exports=function(e,t){if(e=String(e),t=String(t),!/^[\x00-\xFF]+$/.test(e)||!/^[\x00-\xFF]+$/.test(t))throw new Error("Only Latin-1 characters are permitted in PNG tEXt chunks. You might want to consider base64 encoding and/or zEXt compression");if(e.length>=80)throw new Error('Keyword "'+e+'" is longer than the 79-character limit imposed by the PNG specification');for(var n,r=e.length+t.length+1,i=new Uint8Array(r),o=0,a=0;a<e.length;a++){if(!(n=e.charCodeAt(a)))throw new Error("0x00 character is not permitted in tEXt keywords");i[o++]=n}i[o++]=0;for(var s=0;s<t.length;s++){if(!(n=t.charCodeAt(s)))throw new Error("0x00 character is not permitted in tEXt content");i[o++]=n}return{name:"tEXt",data:i}}},1194:(e,t,n)=>{t.encode=n(9686),t.decode=n(9066)},3434:(e,t,n)=>{var r=n(5714),i=n(6233);e.exports=function(e){var t,n=8,l=n;for(t=0;t<e.length;t++)n+=e[t].data.length,n+=12;var c=new Uint8Array(n);for(c[0]=137,c[1]=80,c[2]=78,c[3]=71,c[4]=13,c[5]=10,c[6]=26,c[7]=10,t=0;t<e.length;t++){var d=e[t],u=d.name,h=d.data,p=h.length,g=[u.charCodeAt(0),u.charCodeAt(1),u.charCodeAt(2),u.charCodeAt(3)];s[0]=p,c[l++]=o[3],c[l++]=o[2],c[l++]=o[1],c[l++]=o[0],c[l++]=g[0],c[l++]=g[1],c[l++]=g[2],c[l++]=g[3];for(var f=0;f<p;)c[l++]=h[f++];var m=g.concat(r(h)),b=i.buf(m);a[0]=b,c[l++]=o[3],c[l++]=o[2],c[l++]=o[1],c[l++]=o[0]}return c};var o=new Uint8Array(4),a=new Int32Array(o.buffer),s=new Uint32Array(o.buffer)},2983:(e,t,n)=>{var r=n(6233);e.exports=function(e){if(137!==e[0])throw new Error("Invalid .png file header");if(80!==e[1])throw new Error("Invalid .png file header");if(78!==e[2])throw new Error("Invalid .png file header");if(71!==e[3])throw new Error("Invalid .png file header");if(13!==e[4])throw new Error("Invalid .png file header: possibly caused by DOS-Unix line ending conversion?");if(10!==e[5])throw new Error("Invalid .png file header: possibly caused by DOS-Unix line ending conversion?");if(26!==e[6])throw new Error("Invalid .png file header");if(10!==e[7])throw new Error("Invalid .png file header: possibly caused by DOS-Unix line ending conversion?");var t=!1,n=[],s=8;for(;s<e.length;){i[3]=e[s++],i[2]=e[s++],i[1]=e[s++],i[0]=e[s++];var l=a[0]+4,c=new Uint8Array(l);c[0]=e[s++],c[1]=e[s++],c[2]=e[s++],c[3]=e[s++];var d=String.fromCharCode(c[0])+String.fromCharCode(c[1])+String.fromCharCode(c[2])+String.fromCharCode(c[3]);if(!n.length&&"IHDR"!==d)throw new Error("IHDR header missing");if("IEND"===d){t=!0,n.push({name:d,data:new Uint8Array(0)});break}for(var u=4;u<l;u++)c[u]=e[s++];i[3]=e[s++],i[2]=e[s++],i[1]=e[s++],i[0]=e[s++];var h=o[0];if(r.buf(c)!==h)throw new Error("CRC values for "+d+" header do not match, PNG file is likely corrupted");var p=new Uint8Array(c.buffer.slice(4));n.push({name:d,data:p})}if(!t)throw new Error(".png file ended prematurely: no IEND header was found");return n};var i=new Uint8Array(4),o=new Int32Array(i.buffer),a=new Uint32Array(i.buffer)},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)},5714:e=>{e.exports=function(e,t,n){var r=[],i=e.length;if(0===i)return r;var o=t<0?Math.max(0,t+i):t||0;for(void 0!==n&&(i=n<0?n+i:n);i-- >o;)r[i-o]=e[i];return r}},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:m(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,f=0;function m(e,t){var n,r,i;if(t.singleton){var o=f++;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:2em 4em;min-width:200px;display:flex;flex-direction:column;align-items:center}.excalidraw .layer-ui__library-message .Spinner{margin-bottom:1em}.excalidraw .layer-ui__library-message span{font-size:.8em}.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:2rem}.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;flex-direction:column;align-items:center;justify-content:center;pointer-events:none}.LoadingMessage .Spinner{font-size:2.8em}.LoadingMessage .LoadingMessage-text{margin-top:1em;font-size:.8em}",""]);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:()=>f,$C:()=>m,ut:()=>b,C6:()=>v,_D:()=>y,n5:()=>x,rk:()=>w,Hg:()=>_,hs:()=>k,k:()=>E,LO:()=>C,r8:()=>S,pb:()=>I,LL:()=>j,Gj:()=>T,nM:()=>M,Lg:()=>O,HM:()=>A,V4:()=>L,sA:()=>P,EH:()=>D,ZF:()=>z,UO:()=>R,ah:()=>B,cW:()=>N,kV:()=>H,sS:()=>F,Yx:()=>U,zK:()=>K,ZB:()=>W,qy:()=>V,h6:()=>G,jo:()=>Y,$n:()=>Z,hR:()=>X,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 f={TEST:"test",DEVELOPMENT:"development"},m={SHAPE_ACTIONS_MENU:"App-menu__left"},b={Virgil:1,Helvetica:2,Cascadia:3},v={LIGHT:"light",DARK:"dark"},y="Segoe UI Emoji",x=20,w=b.Virgil,_="left",k="top",E=20,C={excalidraw:"application/vnd.excalidraw+json",excalidrawlib:"application/vnd.excalidrawlib+json",json:"application/json",svg:"image/svg+xml","excalidraw.svg":"image/svg+xml",png:"image/png","excalidraw.png":"image/png",jpg:"image/jpeg",gif:"image/gif",binary:"application/octet-stream"},S={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawLibrary:"excalidrawlib"},I=window.EXCALIDRAW_EXPORT_SOURCE||window.location.origin,j=500,T=300,M=500,O=5e3,A=100,L=.1,P=300,D={VIEW:"viewMode",ZEN:"zenMode",GRID:"gridMode"},z=i().themeFilter,R={addLibrary:"addLibrary"},B={addLibrary:"addLibrary"},N={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,theme:!0,saveAsImage:!0}},H=800,F=1e3,U=500,K=2,W=[1,2,3],V=10,G=1440,Y=[C.png,C.jpg,C.svg,C.gif],Z=2097152,X="http://www.w3.org/2000/svg",q={excalidraw:2,excalidrawLibrary:2},$=5,Q={TOP:"top",MIDDLE:"middle",BOTTOM:"bottom"},J=20},673:(e,t,n)=>{"use strict";n.r(t),n.d(t,{decodePngMetadata:()=>v,decodeSvgMetadata:()=>x,encodePngMetadata:()=>b,encodeSvgMetadata:()=>y,getTEXtChunk:()=>m});var r=n(2983),i=n.n(r),o=n(1194),a=n(3434),s=n.n(a),l=n(2744),c=n(8288);const d=e=>new Promise(((t,n)=>{const r="string"==typeof e?new Blob([(new TextEncoder).encode(e)]):new Blob([e instanceof Uint8Array?e:new Uint8Array(e)]),i=new FileReader;i.onload=e=>{if(!e.target||"string"!=typeof e.target.result)return n(new Error("couldn't convert to byte string"));t(e.target.result)},i.readAsBinaryString(r)})),u=e=>{const t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let t=0,r=e.length;t<r;t++)n[t]=e.charCodeAt(t);return t},h=e=>new TextDecoder("utf-8").decode(u(e)),p=async e=>{let t,{text:n,compress:r}=e;if(!1!==r)try{t=await d((0,l.deflate)(n))}catch(e){console.error("encode: cannot deflate",e)}return{version:"1",encoding:"bstring",compressed:!!t,encoded:t||await d(n)}},g=async e=>{let t;if("bstring"!==e.encoding)throw new Error('decode: unknown encoding "'.concat(e.encoding,'"'));return t=e.compressed?e.encoded:await h(e.encoded),e.compressed?(0,l.inflate)(new Uint8Array(u(t)),{to:"string"}):t};const f=e=>"arrayBuffer"in e?e.arrayBuffer():new Promise(((t,n)=>{const r=new FileReader;r.onload=e=>{var r;if(null===(r=e.target)||void 0===r||!r.result)return n(new Error("couldn't convert blob to ArrayBuffer"));t(e.target.result)},r.readAsArrayBuffer(e)})),m=async e=>{const t=i()(new Uint8Array(await f(e))).find((e=>"tEXt"===e.name));return t?o.decode(t.data):null},b=async e=>{let{blob:t,metadata:n}=e;const r=i()(new Uint8Array(await f(t))),a=o.encode(c.LO.excalidraw,JSON.stringify(await p({text:n,compress:!0})));return r.splice(-1,0,a),new Blob([s()(r)],{type:c.LO.png})},v=async e=>{const t=await m(e);if((null==t?void 0:t.keyword)===c.LO.excalidraw)try{const e=JSON.parse(t.text);if(!("encoded"in e)){if("type"in e&&e.type===c.r8.excalidraw)return t.text;throw new Error("FAILED")}return await g(e)}catch(e){throw console.error(e),new Error("FAILED")}throw new Error("INVALID")},y=async e=>{let{text:t}=e;const n=await async function(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?window.btoa(e):window.btoa(await d(e))}(JSON.stringify(await p({text:t})),!0);let r="";return r+="\x3c!-- payload-type:".concat(c.LO.excalidraw," --\x3e"),r+="\x3c!-- payload-version:2 --\x3e",r+="\x3c!-- payload-start --\x3e",r+=n,r+="\x3c!-- payload-end --\x3e",r},x=async e=>{let{svg:t}=e;if(t.includes("payload-type:".concat(c.LO.excalidraw))){const e=t.match(/<!-- payload-start -->\s*(.+?)\s*<!-- payload-end -->/);if(!e)throw new Error("INVALID");const n=t.match(/<!-- payload-version:(\d+) -->/),r="1"!==((null==n?void 0:n[1])||"1");try{const t=await async function(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?window.atob(e):h(window.atob(e))}(e[1],r),n=JSON.parse(t);if(!("encoded"in n)){if("type"in n&&n.type===c.r8.excalidraw)return t;throw new Error("FAILED")}return await g(n)}catch(e){throw console.error(e),new Error("FAILED")}}throw new Error("INVALID")}},9498:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Excalidraw:()=>Pg,FONT_FAMILY:()=>r.ut,THEME:()=>r.C6,bumpVersion:()=>Hr,cleanAppStateForExport:()=>wn,clearAppStateForLocalStorage:()=>xn,defaultLang:()=>l,exportToBlob:()=>Fp,exportToCanvas:()=>Hp,exportToClipboard:()=>Kp,exportToSvg:()=>Up,getDefaultAppState:()=>bn,getFreeDrawSvgPath:()=>Or,getNonDeletedElements:()=>Ml,getSceneVersion:()=>jl,isInvisiblySmallElement:()=>Fr,isLinearElement:()=>Ie,jotaiScope:()=>Bh,jotaiStore:()=>Nh,languages:()=>c,libraryItemsAtom:()=>Hh,loadFromBlob:()=>kd,loadLibraryFromBlob:()=>Ed,mutateElement:()=>Br,newElementWith:()=>Nr,restore:()=>md,restoreAppState:()=>fd,restoreElements:()=>gd,restoreLibraryItems:()=>vd,serializeAsJSON:()=>Od,serializeLibraryAsJSON:()=>Dd});var r=n(8288);"production"!==r.Vi.TEST&&(n.p=window.EXCALIDRAW_ASSET_PATH||"https://unpkg.com/".concat("@dwelle/excalidraw","@").concat("0.3.62","/dist/"));n(8336);var i=n(9787),o=n.n(i),a=n(1463);const s=JSON.parse('{"ar-SA":93,"bg-BG":59,"bn-BD":0,"ca-ES":96,"cs-CZ":23,"da-DK":16,"de-DE":100,"el-GR":83,"en":100,"es-ES":98,"eu-ES":98,"fa-IR":61,"fi-FI":98,"fr-FR":100,"he-IL":77,"hi-IN":61,"hu-HU":96,"id-ID":100,"it-IT":100,"ja-JP":99,"kab-KAB":94,"kk-KZ":22,"ko-KR":69,"lt-LT":23,"lv-LV":100,"mr-IN":100,"my-MM":45,"nb-NO":100,"nl-NL":87,"nn-NO":97,"oc-FR":96,"pa-IN":89,"pl-PL":90,"pt-BR":97,"pt-PT":80,"ro-RO":100,"ru-RU":100,"si-LK":9,"sk-SK":100,"sl-SI":34,"sv-SE":98,"ta-IN":98,"tr-TR":100,"uk-UA":91,"zh-CN":100,"zh-HK":27,"zh-TW":100}'),l={code:"en",label:"English"},c=[{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([l]).sort(((e,t)=>e.label>t.label?1:-1)).filter((e=>s[e.code]>=85)),d="__test__";"production"===r.Vi.DEVELOPMENT&&c.unshift({code:d,label:"test language"},{code:"".concat(d,".rtl"),label:"test language (rtl)",rtl:!0});let u=l,h={};const p=async e=>{u=e,document.documentElement.dir=u.rtl?"rtl":"ltr",document.documentElement.lang=u.code,h=e.code.startsWith(d)?{}:await Promise.resolve().then(n.t.bind(n,1463,19))},g=()=>u,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},m=(e,t)=>{if(u.code.startsWith(d)){const n=t?"".concat(e,"(").concat(JSON.stringify(t).slice(1,-1),")"):e;return"[[".concat(n,"]]")}const n=e.split(".");let r=f(h,n)||f(a,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};n(371);var b=n(4512);const v=e=>{let{size:t="1em",circleWidth:n=8}=e;return(0,b.jsx)("div",{className:"Spinner",children:(0,b.jsx)("svg",{viewBox:"0 0 100 100",style:{width:t,height:t},children:(0,b.jsx)("circle",{cx:"50",cy:"50",r:50-n/2,strokeWidth:n,fill:"none",strokeMiterlimit:"10"})})})},y=e=>{let{delay:t}=e;const[n,r]=(0,i.useState)(!!t);return(0,i.useEffect)((()=>{if(!t)return;const e=setTimeout((()=>{r(!1)}),t);return()=>clearTimeout(e)}),[t]),n?null:(0,b.jsxs)("div",{className:"LoadingMessage",children:[(0,b.jsx)("div",{children:(0,b.jsx)(v,{})}),(0,b.jsx)("div",{className:"LoadingMessage-text",children:m("labels.loadingScene")})]})},x=e=>{const[t,n]=(0,i.useState)(!0);return(0,i.useEffect)((()=>{const t=c.find((t=>t.code===e.langCode))||l;(async()=>{await p(t)})(),n(!1)}),[e.langCode]),t?(0,b.jsx)(y,{}):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 _(e){const t=e[0],n=e[1];return Math.sqrt(Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2))}function k(e,t){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 E{constructor(e){this.helper=e}fillPolygons(e,t){return this._fillPolygons(e,t)}_fillPolygons(e,t){const n=k(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 E{fillPolygons(e,t){let n=t.hachureGap;n<0&&(n=4*t.strokeWidth),n=Math.max(n,.1);const r=k(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)_([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 E{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=k(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=_(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=k(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=_(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=k(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=_(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 A={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 L(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(;!L(o,2);){let a=0;const s=[];if("BOD"===r){if("M"!==o.text&&"m"!==o.text)return P("M0,0"+e);i++,a=A[o.text],r=o.text}else L(o,1)?a=A[r]:(i++,a=A[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(!L(t,1))throw new Error("Param not a number: "+r+","+t.text);s[s.length]=+t.text}if("number"!=typeof A[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){B(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 B(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,f=0,m=0;if(c)[p,g,f,m]=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,y=h*c*c+b*a*a,x=(s===l?-1:1)*Math.sqrt(Math.abs(v/y));f=x*i*c/o+(e+n)/2,m=x*-o*a/i+(t+r)/2,p=Math.asin(parseFloat(((t-m)/o).toFixed(9))),g=Math.asin(parseFloat(((r-m)/o).toFixed(9))),e<f&&(p=Math.PI-p),n<f&&(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=B(n=f+i*Math.cos(g),r=m+o*Math.sin(g),t,s,i,o,a,0,l,[g,e,f,m])}b=g-p;const v=Math.cos(p),y=Math.sin(p),x=Math.cos(g),w=Math.sin(g),_=Math.tan(b/4),k=4/3*i*_,E=4/3*o*_,C=[e,t],S=[e+k*y,t-E*v],I=[n+k*w,r-E*x],j=[n,r];if(S[0]=2*C[0]-S[0],S[1]=2*C[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=W(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 H(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?H(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 K(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 W(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.ceil(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 f=2*Math.PI/l.curveStepCount,m=Math.min(f/2,(g-p)/2),b=re(m,c,d,u,h,p,g,1,l);if(!l.disableMultiStroke){const e=re(m,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 Z(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 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 E(t))}return M[n]}(t,N).fillPolygons(e,t)}function X(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*(X(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*X(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 f=[],m=()=>$(u,i,c),b=()=>$(d,i,c),v=i.preserveVertices;return o&&(a?f.push({op:"move",data:[e+(v?0:m()),t+(v?0:m())]}):f.push({op:"move",data:[e+(v?0:$(d,i,c)),t+(v?0:$(d,i,c))]})),a?f.push({op:"bcurveTo",data:[p+e+(n-e)*h+m(),g+t+(r-t)*h+m(),p+e+2*(n-e)*h+m(),g+t+2*(r-t)*h+m(),n+(v?0:m()),r+(v?0:m())]}):f.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())]}),f}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=[];if(0===s.roughness){e/=4,c.push([t+r*Math.cos(-e),n+i*Math.sin(-e)]);for(let o=0;o<=2*Math.PI;o+=e){const e=[t+r*Math.cos(o),n+i*Math.sin(o)];l.push(e),c.push(e)}c.push([t+r*Math.cos(0),n+i*Math.sin(0)]),c.push([t+r*Math.cos(e),n+i*Math.sin(e)])}else{const d=$(.5,s)-Math.PI/2;c.push([$(o,s)+t+.9*r*Math.cos(d-e),$(o,s)+n+.9*i*Math.sin(d-e)]);const u=2*Math.PI+d-.01;for(let a=d;a<u;a+=e){const e=[$(o,s)+t+r*Math.cos(a),$(o,s)+n+i*Math.sin(a)];l.push(e),c.push(e)}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)])}return[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",[H(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(Z([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=W(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(Z([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]),Z([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=K(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(Z([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(Z([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(Z(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 fe{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 me="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(me,"g"),o=e.options.fixedDecimalPlaceDigits;for(const a of t){let t=null;switch(a.type){case"path":t=r.createElementNS(me,"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(me,"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(me,"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 fe(e,t),svg:(e,t)=>new be(e,t),generator:e=>new ge(e),newSeed:()=>ge.newSeed()};function ye(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=ye(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function xe(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=ye(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 _e=e=>!!e&&"image"===e.type&&!!e.fileId,ke=e=>!!e&&"image"===e.type,Ee=e=>null!=e&&"text"===e.type,Ce=e=>null!=e&&Se(e.type),Se=e=>"freedraw"===e,Ie=e=>null!=e&&je(e.type),je=e=>"arrow"===e||"line"===e,Te=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return null!=e&&(!e.locked||!0===t)&&Me(e.type)},Me=e=>"arrow"===e,Oe=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!(null==e||e.locked&&!0!==t||"rectangle"!==e.type&&"diamond"!==e.type&&"ellipse"!==e.type&&"image"!==e.type&&("text"!==e.type||e.containerId))},Ae=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!(null==e||e.locked&&!0!==t||"rectangle"!==e.type&&"diamond"!==e.type&&"ellipse"!==e.type&&"image"!==e.type)},Le=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&&Ee(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]},Be=(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,i]=[e[0],e[e.length-1]];return Be(n[0],n[1],i[0],i[1])<=r.qx/t}return!1},He=(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(Ke(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},Ke=(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)))))},We=(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):Ie(e)?Qe(e):[e.x,e.y,e.x+e.width,e.y+e.height],Ze=e=>{for(const t of e.sets)if("path"===t.type)return t.ops;return e.sets[0].ops},Xe=(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||!yr(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=yr(e),r=Ze(n[0]),[i,o,a,s]=Xe(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(Ie(e))t=((e,t,n)=>{if(e.points.length<2||!yr(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=yr(e),i=Ze(r[0]);return Xe(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,f]=De(i,s,a,s,e.angle);t=[Math.min(l,d,h,g),Math.min(c,u,p,f),Math.max(l,d,h,g),Math.max(c,u,p,f)]}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,f]=De(i,r,a,s,e.angle);t=[Math.min(l,d,h,g),Math.min(c,u,p,f),Math.max(l,d,h,g),Math.max(c,u,p,f)]}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)&&!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,_r(e)):t.curve(r,_r(e)),o=Ze(n);i=Xe(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,_r(e)):r.curve(t,_r(e)),o=Ze(i),[a,s,l,c]=Xe(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",ft="Numpad0",mt="BracketRight",bt="BracketLeft",vt="Digit1",yt="Digit2",xt="Quote",wt="Digit0",_t="Slash",kt="KeyC",Et="KeyD",Ct="KeyG",St="KeyF",It="KeyH",jt="KeyV",Tt="KeyX",Mt="KeyZ",Ot="KeyR",At={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"},Lt=e=>e===At.ARROW_LEFT||e===At.ARROW_RIGHT||e===At.ARROW_DOWN||e===At.ARROW_UP,Pt=e=>e.altKey,Dt=e=>e.shiftKey,zt=e=>e.shiftKey;let Rt=null;const Bt=()=>{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),Ht=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(r.ut))if(n===t)return"".concat(e,", ").concat(r._D);return r._D},Ut=e=>{let{fontSize:t,fontFamily:n}=e;return"".concat(t,"px ").concat(Ft({fontFamily:n}))},Kt=(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},Wt=(e,t)=>Math.abs(e-t),Vt=e=>{e&&(e.style.cursor="")},Gt=(e,t)=>{e&&(e.style.cursor=t)};let Yt,Zt;const Xt=(e,t)=>{Yt&&Yt.theme===t||(()=>{const e=t===r.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(),Zt=Yt.toDataURL(r.LO.svg)})(),Gt(e,"url(".concat(Zt,") ").concat(10," ").concat(10,", auto"))},qt=(e,t)=>{e&&("selection"===t.activeTool.type?Vt(e):"eraser"===t.activeTool.type?Xt(e,t.theme):"image"!==t.activeTool.type&&(e.style.cursor=r.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",PKG_NAME:"@dwelle/excalidraw",PKG_VERSION:"0.3.62",IS_EXCALIDRAW_NPM_PACKAGE:!0})||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},fn=e=>!!e&&"object"==typeof e&&"then"in e&&"catch"in e&&"finally"in e,mn=r.ZB.includes(devicePixelRatio)?devicePixelRatio:1,bn=()=>({theme:r.C6.LIGHT,collaborators:new Map,currentChartType:"bar",currentItemBackgroundColor:"transparent",currentItemEndArrowhead:"arrow",currentItemFillStyle:"hachure",currentItemFontFamily:r.rk,currentItemFontSize:r.n5,currentItemLinearStrokeSharpness:"round",currentItemOpacity:100,currentItemRoughness:1,currentItemStartArrowhead:null,currentItemStrokeColor:it.black,currentItemStrokeSharpness:"sharp",currentItemStrokeStyle:"solid",currentItemStrokeWidth:1,currentItemTextAlign:r.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(m("labels.untitled"),"-").concat(Bt()),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}),vn={theme:{browser:!0,export:!1,server:!1},collaborators:{browser:!1,export:!1,server:!1},currentChartType:{browser:!0,export:!1,server:!1},currentItemBackgroundColor:{browser:!0,export:!1,server:!1},currentItemEndArrowhead:{browser:!0,export:!1,server:!1},currentItemFillStyle:{browser:!0,export:!1,server:!1},currentItemFontFamily:{browser:!0,export:!1,server:!1},currentItemFontSize:{browser:!0,export:!1,server:!1},currentItemLinearStrokeSharpness:{browser:!0,export:!1,server:!1},currentItemOpacity:{browser:!0,export:!1,server:!1},currentItemRoughness:{browser:!0,export:!1,server:!1},currentItemStartArrowhead:{browser:!0,export:!1,server:!1},currentItemStrokeColor:{browser:!0,export:!1,server:!1},currentItemStrokeSharpness:{browser:!0,export:!1,server:!1},currentItemStrokeStyle:{browser:!0,export:!1,server:!1},currentItemStrokeWidth:{browser:!0,export:!1,server:!1},currentItemTextAlign:{browser:!0,export:!1,server:!1},cursorButton:{browser:!0,export:!1,server:!1},draggingElement:{browser:!1,export:!1,server:!1},editingElement:{browser:!1,export:!1,server:!1},editingGroupId:{browser:!0,export:!1,server:!1},editingLinearElement:{browser:!1,export:!1,server:!1},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}},yn=(e,t)=>{const n={};for(const r of Object.keys(e)){const i=vn[r];if(null!=i&&i[t]){const t=e[r];n[r]=t}}return n},xn=e=>yn(e,"browser"),wn=e=>yn(e,"export"),_n=e=>yn(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 Cn(e,t){return[e[0]+t[0],e[1]+t[1]]}function Sn(e,t){return[e[0]-t[0],e[1]-t[1]]}function In(e,t){return[e[0]*t,e[1]*t]}function jn(e){return[e[1],-e[0]]}function Tn(e,t){return e[0]*t[0]+e[1]*t[1]}function Mn(e,t){return e[0]===t[0]&&e[1]===t[1]}function On(e,t){return function(e){return e[0]*e[0]+e[1]*e[1]}(Sn(e,t))}function An(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 Pn(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 Dn(e,t,n){return Cn(e,In(Sn(t,e),n))}function zn(e,t,n){return Cn(e,In(t,n))}var{min:Rn,PI:Bn}=Math,Nn=Bn+1e-4;function Hn(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:f=(e=>--e*e*e+1)}=l;if(0===e.length||n<=0)return[];let m,b=e[e.length-1].runningLength,v=Math.pow(n*r,2),y=[],x=[],w=e.slice(0,10).reduce(((e,t)=>{let r=t.pressure;if(o){let i=Rn(1,t.distance/n),o=Rn(1,1-i);r=Rn(1,e+.275*i*(o-e))}return(e+r)/2}),e[0].pressure),_=En(n,i,e[e.length-1].pressure,a),k=e[0].vector,E=e[0].point,C=E,S=E,I=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=Rn(1,c/n),t=Rn(1,1-e);r=Rn(1,w+.275*e*(t-w))}_=En(n,i,r,a)}else _=n/2;void 0===m&&(m=_);let p=d<u?h(d/u):1,j=b-d<g?f((b-d)/g):1;if(_=Math.max(.01,_*Math.min(p,j)),t===e.length-1){let e=In(jn(l),_);y.push(Sn(s,e)),x.push(Cn(s,e));continue}let T=e[t+1].vector,M=Tn(l,T);if(M<0){let e=In(jn(k),_);for(let t=1/13,n=0;n<=1;n+=t)S=Pn(Sn(s,e),s,Nn*n),y.push(S),I=Pn(Cn(s,e),s,Nn*-n),x.push(I);E=S,C=I;continue}let O=In(jn(Dn(T,l,M)),_);S=Sn(s,O),(t<=1||On(E,S)>v)&&(y.push(S),E=S),I=Cn(s,O),(t<=1||On(C,I)>v)&&(x.push(I),C=I),w=r,k=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=zn(j,An(jn(Sn(j,T))),-(m||_)),t=[];for(let n=1/13,r=n;r<=1;r+=n)t.push(Pn(e,j,2*Nn*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=Pn(x[0],j,Nn*t);M.push(e)}else{let e=Sn(y[0],x[0]),t=In(e,.5),n=In(e,.51);M.push(Sn(j,t),Sn(j,n),Cn(j,n),Cn(j,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=zn(T,t,_);for(let t=1/29,n=t;n<1;n+=t)O.push(Pn(e,T,3*Nn*n))}else O.push(Cn(T,In(t,_)),Cn(T,In(t,.99*_)),Sn(T,In(t,.99*_)),Sn(T,In(t,_)))}return y.concat(O,x.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(Dn(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):Dn(u.point,s[e],a);if(Mn(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:An(Sn(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 Fn=e=>"string"==typeof e;class Un{constructor(){this.callbacks=new Set,this.nonDeletedElements=[],this.elements=[],this.elementsMap=new Map}static mapElementToScene(e,t){Fn(e)?this.sceneMapById.set(e,t):this.sceneMapByElement.set(e,t)}static getScene(e){return Fn(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&&Ol(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),Un.mapElementToScene(e,this)})),this.nonDeletedElements=Ml(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(){Un.sceneMapById.forEach(((e,t)=>{e===this&&Un.sceneMapById.delete(t)})),this.callbacks.clear()}}Un.sceneMapByElement=new WeakMap,Un.sceneMapById=new Map;const Kn=Un,Wn=(e,t)=>{const n=t?t.width-2*r.gK:void 0;let i=e.text;t&&(i=Jn(e.originalText,Ut(e),t.width));const o=Yn(e.originalText,Ut(e),n);let a=e.y,s=e.x;if(t){let n=t.height;s=t.x+r.gK,e.verticalAlign===r.oX.TOP?a=t.y+r.gK:e.verticalAlign===r.oX.BOTTOM?a=t.y+t.height-o.height-r.gK:(a=t.y+t.height/2-o.height/2,o.height>t.height-2*r.gK&&(n=o.height+2*r.gK,a=t.y+n/2-o.height/2)),Br(t,{height:n})}Br(e,{width:o.width,height:o.height,baseline:o.baseline,y:a,x:s,text:i})},Vn=(e,t,n)=>{const r=un(e);t.forEach((e=>{const t=n.get(e.id),i=ir(e);if(i){const a=n.get(i);if(a){const n=r.get(t);var o;if(n)Br(n,{boundElements:null===(o=e.boundElements)||void 0===o?void 0:o.concat({type:"text",id:a})});const i=r.get(a);i&&Ee(i)&&Br(i,{containerId:n?t:null})}}}))},Gn=(e,t)=>{const n=ir(e);if(n){const i=Kn.getScene(e).getElement(n);if(i&&i.text){if(!e)return;let n,o=i.text,a=i.height,s=e.height,l=i.baseline;if("n"!==t&&"s"!==t){o&&(o=Jn(i.originalText,Ut(i),e.width));const t=Yn(o,Ut(i),e.width);a=t.height,l=t.baseline}if(a>e.height-2*r.gK){s=a+2*r.gK;const n=s-e.height,i="ne"===t||"nw"===t||"n"===t?e.y-n:e.y;Br(e,{height:s,y:i})}n=i.verticalAlign===r.oX.TOP?e.y+r.gK:i.verticalAlign===r.oX.BOTTOM?e.y+e.height-a-r.gK:e.y+e.height/2-a/2,Br(i,{text:o,width:e.width-2*r.gK,height:a,x:e.x+r.gK,y:n,baseline:l})}}},Yn=(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=qn(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}},Zn="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".toLocaleUpperCase(),Xn={},qn=e=>(Xn[e]||(Xn[e]=Yn(Zn,e,null).height),Xn[e]);let $n;const Qn=(e,t)=>{$n||($n=document.createElement("canvas"));const n=$n.getContext("2d");n.font=t;const r=n.measureText(e);return hn()?10*r.width:r.width},Jn=(e,t,n)=>{const i=n-2*r.gK,o=[],a=e.split("\n"),s=Qn(" ",t);return a.forEach((e=>{const n=e.split(" ");if(1===n.length&&""===n[0])o.push(n[0]);else{let e="",r=0,a=0;for(;a<n.length;){if(Qn(n[a],t)>=i){for(e&&o.push(e),e="",r=0;n[a].length>0;){const s=n[a][0],l=er.calculate(s,t);r+=l,n[a]=n[a].slice(1),r>=i?(" "===e.slice(-1)&&(e=e.slice(0,-1)),o.push(e),e=s,r=l,r===i&&(e="",r=0)):e+=s}r+s>=i?(o.push(e),e="",r=0):(e+=" ",r+=s),a++}else{for(;r<i&&a<n.length;){const l=n[a];if(r=Qn(e+l,t),r>=i){o.push(e),r=0,e="";break}if(a++,e+="".concat(l," "),r+s>=i){o.push(e.slice(0,-1)),e="",r=0;break}}r===i&&(e="",r=0)}}e&&(" "===e.slice(-1)&&(e=e.slice(0,-1)),o.push(e))}})),o.join("\n")},er=(()=>{const e={};return{calculate:(t,n)=>{const r=t.charCodeAt(0);if(e[n]||(e[n]=[]),!e[n][r]){const i=Qn(t,n);e[n][r]=i}return e[n][r]},getCache:t=>e[t]}})(),tr=e=>{const t=rr(e);return 0===t?Yn(Zn.split("").join("\n"),e).width+2*r.gK:t+2*r.gK},nr=e=>qn(e)+2*r.gK,rr=e=>{const t=er.getCache(e);if(!t)return 0;const n=t.filter((e=>void 0!==e));return Math.max(...n)},ir=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},or=e=>{if(!e)return null;const t=ir(e);var n;return t&&(null===(n=Kn.getScene(e))||void 0===n?void 0:n.getElement(t))||null},ar=e=>{return e&&e.containerId&&(null===(t=Kn.getScene(e))||void 0===t?void 0:t.getElement(e.containerId))||null;var t},sr="invert(100%) hue-rotate(180deg) saturate(1.25)",lr=bn(),cr=(e,t)=>_e(e)&&!t.imageCache.has(e.fileId),dr=(e,t)=>{var n;return"dark"===t.theme&&_e(e)&&!cr(e,t)&&(null===(n=t.imageCache.get(e.fileId))||void 0===n?void 0:n.mimeType)!==r.LO.svg},ur=e=>[8,8+e],hr=e=>[1.5,6+e],pr=e=>"freedraw"===e.type?12*e.strokeWidth:20,gr=document.createElement("img");gr.src="data:".concat(r.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 fr=document.createElement("img");fr.src="data:".concat(r.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,i)=>{switch(n.globalAlpha=e.opacity/100,e.type){case"rectangle":case"diamond":case"ellipse":n.lineJoin="round",n.lineCap="round",t.draw(yr(e));break;case"arrow":case"line":n.lineJoin="round",n.lineCap="round",yr(e).forEach((e=>{t.draw(e)}));break;case"freedraw":{n.save(),n.fillStyle=e.strokeColor;const r=function(e){return Tr.get(e)}(e),i=yr(e);i&&t.draw(i),n.fillStyle=e.strokeColor,n.fill(r),n.restore();break}case"image":{var o;const t=_e(e)?null===(o=i.imageCache.get(e.fileId))||void 0===o?void 0:o.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?fr:gr,e.width/2-i/2,e.height/2-i/2,i,i)})(e,n,i.zoom.value):n.drawImage(t,0,0,e.width,e.height);break}default:if(!Ee(e))throw new Error("Unimplemented type ".concat(e.type));{const t=rn(e.text),i=t&&!n.canvas.isConnected;i&&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 o=e.text.replace(/\r\n?/g,"\n").split("\n"),a=e.containerId?qn(Ut(e)):e.height/o.length;let s=e.height-e.baseline;e.verticalAlign===r.oX.BOTTOM&&(s=r.gK);const l="center"===e.textAlign?e.width/2:"right"===e.textAlign?e.width:0;for(let e=0;e<o.length;e++)n.fillText(o[e],l,(e+1)*a-s);n.restore(),i&&n.canvas.remove()}}n.globalAlpha=1};let br=new WeakMap,vr=new WeakMap;const yr=e=>vr.get(e),xr=(e,t)=>vr.set(e,t),wr=e=>vr.delete(e),_r=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n={seed:e.seed,strokeLineDash:"dashed"===e.strokeStyle?ur(e.strokeWidth):"dotted"===e.strokeStyle?hr(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=vr.get(e);if(void 0===n)switch(br.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"),_r(e,!0))}else n=t.rectangle(0,0,e.width,e.height,_r(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)),_r(e,!0)):t.polygon([[r,i],[o,a],[s,l],[c,d]],_r(e)),xr(e,n);break}case"ellipse":n=t.ellipse(e.width/2,e.height/2,e.width,e.height,_r(e)),xr(e,n);break;case"line":case"arrow":{const r=_r(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=Ze(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,[f,m]=[h(.3,0),h(.3,1)],b=Math.hypot(p-f,g-m),v=(p-f)/b,y=(g-m)/b,x={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 _=Math.min(x,w/2),k=p-v*_,E=g-y*_;if("dot"===r)return[p,g,Math.hypot(E-g,k-p)+e.strokeWidth];const C={arrow:20,bar:90,triangle:25}[r],[S,I]=De(k,E,p,g,-C*Math.PI/180),[j,T]=De(k,E,p,g,C*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=hr(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":Mr(e),n=Ne(e.points)?t.polygon(e.points,Object.assign(Object.assign({},_r(e)),{stroke:"none"})):null,xr(e,n);break;case"text":case"image":xr(e,null)}},Er=(e,t)=>{const n=t?t.zoom:lr.zoom,r=br.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=pr(e);let a=0,s=0;if(Ie(e)||Ce(e)){const[n,l,c,d]=Ye(e);r.width=Wt(n,c)*window.devicePixelRatio*t.value+o*t.value*2,r.height=Wt(l,d)*window.devicePixelRatio*t.value+o*t.value*2,a=e.x>n?Wt(e.x,n)*window.devicePixelRatio*t.value:0,s=e.y>l?Wt(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 dr(e,n)&&(i.filter=sr),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 br.set(e,r),r}return r},Cr=(e,t,n,r)=>{const i=e.element,o=pr(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=cr(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()},Sr=(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);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),dr(e,r)&&(n.filter="none"),mr(e,t,n,r),n.restore()}else{const t=Er(e,r);Cr(t,0,n,r)}break;default:throw new Error("Unimplemented type ".concat(e.type))}},Ir=(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,i,o,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,f=t.generator;let m=n;if(e.link){const t=n.ownerDocument.createElementNS(r.hR,"a");t.setAttribute("href",e.link),m.appendChild(t),m=t}switch(e.type){case"selection":throw new Error("Selection rendering is not supported for SVG");case"rectangle":case"diamond":case"ellipse":{kr(e,f);const n=Ir(t,yr(e),r.zK),i=e.opacity/100;1!==i&&(n.setAttribute("stroke-opacity","".concat(i)),n.setAttribute("fill-opacity","".concat(i))),n.setAttribute("stroke-linecap","round"),n.setAttribute("transform","translate(".concat(o||0," ").concat(a||0,") rotate(").concat(g," ").concat(h," ").concat(p,")")),m.appendChild(n);break}case"line":case"arrow":{kr(e,f);const i=n.ownerDocument.createElementNS(r.hR,"g"),s=e.opacity/100;i.setAttribute("stroke-linecap","round"),yr(e).forEach((n=>{const l=Ir(t,n,r.zK);1!==s&&(l.setAttribute("stroke-opacity","".concat(s)),l.setAttribute("fill-opacity","".concat(s))),l.setAttribute("transform","translate(".concat(o||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"),i.appendChild(l)})),m.appendChild(i);break}case"freedraw":{kr(e,f),Mr(e);const i=e.opacity/100,s=yr(e),l=s?Ir(t,s,r.zK):n.ownerDocument.createElementNS(r.hR,"g");1!==i&&(l.setAttribute("stroke-opacity","".concat(i)),l.setAttribute("fill-opacity","".concat(i))),l.setAttribute("transform","translate(".concat(o||0," ").concat(a||0,") rotate(").concat(g," ").concat(h," ").concat(p,")")),l.setAttribute("stroke","none");const c=n.ownerDocument.createElementNS(r.hR,"path");c.setAttribute("fill",e.strokeColor),c.setAttribute("d",Or(e)),l.appendChild(c),m.appendChild(l);break}case"image":{const t=_e(e)&&i[e.fileId];if(t){const i="image-".concat(t.id);let l=n.querySelector("#".concat(i));if(!l){l=n.ownerDocument.createElementNS(r.hR,"symbol"),l.id=i;const e=n.ownerDocument.createElementNS(r.hR,"image");e.setAttribute("width","100%"),e.setAttribute("height","100%"),e.setAttribute("href",t.dataURL),l.appendChild(e),m.prepend(l)}const c=n.ownerDocument.createElementNS(r.hR,"use");c.setAttribute("href","#".concat(i)),s&&t.mimeType!==r.LO.svg&&c.setAttribute("filter",sr),c.setAttribute("width","".concat(Math.round(e.width))),c.setAttribute("height","".concat(Math.round(e.height))),c.setAttribute("transform","translate(".concat(o||0," ").concat(a||0,") rotate(").concat(g," ").concat(h," ").concat(p,")")),m.appendChild(c)}break}default:if(!Ee(e))throw new Error("Unimplemented type ".concat(e.type));{const t=e.opacity/100,i=n.ownerDocument.createElementNS(r.hR,"g");1!==t&&(i.setAttribute("stroke-opacity","".concat(t)),i.setAttribute("fill-opacity","".concat(t))),i.setAttribute("transform","translate(".concat(o||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",f="center"===e.textAlign?"middle":"right"===e.textAlign||"rtl"===u?"end":"start";for(let t=0;t<s.length;t++){const o=n.ownerDocument.createElementNS(r.hR,"text");o.textContent=s[t],o.setAttribute("x","".concat(d)),o.setAttribute("y","".concat((t+1)*l-c)),o.setAttribute("font-family",Ft(e)),o.setAttribute("font-size","".concat(e.fontSize,"px")),o.setAttribute("fill",e.strokeColor),o.setAttribute("text-anchor",f),o.setAttribute("style","white-space: pre;"),o.setAttribute("direction",u),i.appendChild(o)}m.appendChild(i)}}};let Tr=new WeakMap([]);function Mr(e){const t=Or(e),n=new Path2D(t);return Tr.set(e,n),n}function Or(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,Ar(n,i[0]),"L",i[0],"Z"):e.push(n,Ar(n,i[r+1])),e)),["M",e[0],"Q"]).join(" ").replace(Lr,"$1")}(Hn(t,n))}function Ar(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 Pr=new O(Date.now()),Dr=0;const zr=()=>Math.floor(Pr.next()*2**31),Rr=()=>hn()?"id".concat(Dr++):we(),Br=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||wr(e),e.version++,e.versionNonce=zr(),e.updated=dn(),n)&&(null===(a=Kn.getScene(e))||void 0===a||a.informMutation());return e},Nr=(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:zr()}):e},Hr=(e,t)=>(e.version=(null!=t?t:e.version)+1,e.versionNonce=zr(),e.updated=dn(),e),Fr=e=>Ie(e)||Ce(e)?e.points.length<2:0===e.width&&0===e.height,Ur=(e,t,n)=>{const i=Math.abs(t),o=Math.abs(n);if("line"===e||"arrow"===e||"freedraw"===e){const e=Math.round(Math.atan(o/i)/r.ay)*r.ay;0===e?n=0:e===Math.PI/2?t=0:n=Math.round(i*Math.tan(e))*Math.sign(n)||n}else"selection"!==e&&(n=i*Math.sign(n));return{width:t,height:n}},Kr=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]))))})},Vr=(e,t)=>null!=Gr(e,t),Gr=(e,t)=>t.groupIds.filter((t=>t!==e.editingGroupId)).find((t=>e.selectedGroupIds[t])),Yr=e=>Object.entries(e.selectedGroupIds).filter((e=>{let[t,n]=e;return n})).map((e=>{let[t,n]=e;return t})),Zr=(e,t)=>{let n=Object.assign(Object.assign({},e),{selectedGroupIds:{}});const r=Bl(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),qr=(e,t)=>e.filter((e=>Xr(e,t))),$r=(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},Qr=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=or(e);i&&r.push(i),t.set(n,[...r,e])})),Array.from(t.values())};var Jr=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 ei=(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:f=0,groupIds:m=[],strokeSharpness:b,boundElements:v=null,link:y=null,locked:x}=t,w=Jr(t,["x","y","strokeColor","backgroundColor","fillStyle","strokeWidth","strokeStyle","roughness","opacity","width","height","angle","groupIds","strokeSharpness","boundElements","link","locked"]);return{id:w.id||Rr(),type:e,x:i,y:o,width:p,height:g,angle:f,strokeColor:a,backgroundColor:s,fillStyle:l,strokeWidth:c,strokeStyle:d,roughness:u,opacity:h,groupIds:m,strokeSharpness:b,seed:null!==(n=w.seed)&&void 0!==n?n:zr(),version:w.version||1,versionNonce:null!==(r=w.versionNonce)&&void 0!==r?r:0,isDeleted:!1,boundElements:v,updated:dn(),link:y,locked:x}},ti=e=>ei(e.type,e),ni=(e,t)=>({x:"center"===e.textAlign?t.width/2:"right"===e.textAlign?t.width:0,y:"middle"===e.verticalAlign?t.height/2:0}),ri=e=>{const t=Yn(e.text,Ut(e)),n=ni(e,t);return Nr(Object.assign(Object.assign({},ei("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}),{})},ii=(e,t)=>{let{text:n,isDeleted:i,originalText:o}=t;const a=ar(e);a&&(n=Jn(n,Ut(e),a.width));const s=((e,t)=>{let n=null;const i=ar(e);i&&(n=i.width-2*r.gK);const{width:o,height:a,baseline:s}=Yn(t,Ut(e),n),{textAlign:l,verticalAlign:c}=e;let d,u;if("center"!==l||c!==r.oX.MIDDLE||e.containerId){const[t,n,r,i]=Ye(e),[s,c,h,p]=tt(e,o,a),g=(t-s)/2,f=(n-c)/2,m=(r-h)/2,b=(i-p)/2;[d,u]=Re({s:!0,e:"center"===l||"left"===l,w:"center"===l||"right"===l},e.x,e.y,e.angle,g,f,m,b)}else{const t=Yn(e.text,Ut(e),n),r=ni(e,{width:o-t.width,height:a-t.height});d=e.x-r.x,u=e.y-r.y}if(i){let e=i.height,t=i.width;a>e-2*r.gK&&(e=a+2*r.gK),o>t-2*r.gK&&(t=o+2*r.gK),e===i.height&&t===i.width||Br(i,{height:e,width:t})}return{width:o,height:a,x:Number.isFinite(d)?d:e.x,y:Number.isFinite(u)?u:e.y,baseline:s}})(e,n);return Nr(e,Object.assign({text:n,originalText:o,isDeleted:null!=i?i:e.isDeleted},s))},oi=e=>Object.assign(Object.assign({},ei(e.type,e)),{points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:e.startArrowhead,endArrowhead:e.endArrowhead}),ai=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]=ai(e[r],t+1)}return n}if(Array.isArray(e)){let n=e.length;const r=new Array(n);for(;n--;)r[n]=ai(e[n],t+1);return r}return e},si=(e,t,n,r)=>{let i=ai(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=Rr();return i.updated=dn(),i.seed=zr(),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,Rr()),t.get(e)))),r&&(i=Object.assign(i,r)),i},li={mouse:8,pen:16,touch:28},ci={e:!0,s:!0,n:!0,w:!0},di={e:!0,s:!0,n:!0,w:!0},ui={e:!0,s:!0,n:!0,w:!0,nw:!0,se:!0},hi={e:!0,s:!0,n:!0,w:!0,ne:!0,sw:!0},pi=(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]},gi=function(e,t,n,r){let[i,o,a,s]=e,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const c=li[r],d=c/n.value,u=c/n.value,h=c/n.value,p=c/n.value,g=a-i,f=s-o,m=(i+a)/2,b=(o+s)/2,v=4/n.value,y=(c-8)/(2*n.value),x={nw:l.nw?void 0:pi(i-v-h+y,o-v-p+y,d,u,m,b,t),ne:l.ne?void 0:pi(a+v-y,o-v-p+y,d,u,m,b,t),sw:l.sw?void 0:pi(i-v-h+y,s+v-y,d,u,m,b,t),se:l.se?void 0:pi(a+v-y,s+v-y,d,u,m,b,t),rotation:l.rotation?void 0:pi(i+g/2-d/2,o-v-p+y-16/n.value,d,u,m,b,t)},w=5*li.mouse/n.value;return Math.abs(g)>w&&(l.n||(x.n=pi(i+g/2-d/2,o-v-p+y,d,u,m,b,t)),l.s||(x.s=pi(i+g/2-d/2,s+v-y,d,u,m,b,t))),Math.abs(f)>w&&(l.w||(x.w=pi(i-v-h+y,o+f/2-u/2,d,u,m,b,t)),l.e||(x.e=pi(a+v-y,o+f/2-u/2,d,u,m,b,t))),x},fi=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"mouse";if(e.locked)return{};let 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=hi:t[0]>0&&t[1]<0?r=ui:t[0]>0&&t[1]>0?r=hi:t[0]<0&&t[1]>0?r=ui:t[0]<0&&t[1]<0&&(r=hi)}}else Ee(e)&&(r=di);return gi(Ye(e),e.angle,t,n,r)},mi=(e,t)=>[0,0,0,0,t,e,1,0],bi=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},vi=e=>[e[0],e[1],e[2],e[3],-e[4],-e[5],-e[6],-e[7]],yi=(e,t)=>Ii(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)=>Ii(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]:[wi(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]],wi=(e,t)=>t[0]*e[0]+t[2]*e[2]+t[3]*e[3]-t[6]*e[6],_i=(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])),Ci=e=>{const t=Ei(e);if(0===t||1===t)return e;const n=e[6]<0?-1:1;return xi(e,n/t)},Si=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)},Ii=e=>"number"==typeof e,ji=(bi(1,1),bi(1,2),bi(1,3),bi(1,4),bi(1,5),bi(1,6),bi(1,7),(e,t,n)=>Ci([0,n,e,t,0,0,0,0])),Ti=(e,t)=>Ci(_i(t,e)),Mi=(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),Oi=e=>{let[t,n]=e;return[0,0,0,0,n,t,1,0]},Ai=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)),Pi=(e,t)=>Ei(_i(e,t)),Di=(e,t)=>ki(e,t),zi=e=>[0,0,0,0,e[4],e[5],0,0],Ri=(e,t)=>((e,t)=>Ii(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)),Bi=(e,t)=>Ci(xi(xi(e,t),vi(e))),Ni=(e,t,n,r)=>{const i=10/t.zoom.value;return!Hi(e,t,[n,r])&&Ui(e,[n,r],i)},Hi=(e,t,n)=>{const r=10/t.zoom.value,i=Ee(e)?Yi:(e=>{if("arrow"===e.type)return!1;if("freedraw"===e.type)return!0;const t=!sn(e.backgroundColor)||Le(e);return"line"===e.type?t&&Ne(e.points):t||ke(e)})(e)?Zi:Xi;return Vi({element:e,point:n,threshold:r,check:i})},Fi=(e,t)=>e.selectedElementIds[t.id],Ui=(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},Ki=(e,t)=>{let{x:n,y:r}=t;const i=Wi(e,e.width,e.height);return Vi({element:e,point:[n,r],threshold:i,check:qi})},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))},Vi=e=>{switch(e.element.type){case"rectangle":case"image":case"text":case"diamond":case"ellipse":const t=Gi(e.element,e.point);return e.check(t,e.threshold);case"freedraw":return!!e.check($i(e.element,e.point),e.threshold)&&to(e.element,e.point,e.threshold);case"arrow":case"line":return no(e);case"selection":return console.warn("This should not happen, we need to investigate why it does."),!1}},Gi=(e,t)=>{switch(e.type){case"rectangle":case"image":case"text":return $i(e,t);case"diamond":return Qi(e,t);case"ellipse":return Ji(e,t)}},Yi=(e,t)=>e<0,Zi=(e,t)=>e<t,Xi=(e,t)=>Math.abs(e)<t,qi=(e,t)=>0<=e&&e<t,$i=(e,t)=>{const[,n,r,i]=ro(e,t);return Math.max(Di(n,ji(0,1,-i)),Di(n,ji(1,0,-r)))},Qi=(e,t)=>{const[,n,r,i]=ro(e,t),o=ji(i,r,-i*r);return Di(n,o)},Ji=(e,t)=>{const[n,r]=eo(e,t);return-(e=>Math.sign(e[1]))(r)*Di(n,r)},eo=(e,t)=>{const[,n,r,i]=ro(e,t),[o,a]=Ai(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 f=Math.hypot(l,s);s/=f,l/=f}));const u=mi(c*s,d*l);var h;return[n,Mi(Ti(n,h=u),h)]},to=(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(Be(a[0],a[1],r,i)<n||Be(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=Be(o[0],o[1],a[0],a[1]),g=Be(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=yr(e);return!(!l||!l.sets.length)&&bo(l,r,i,n)},no=e=>{const{element:t,threshold:n}=e;if(!yr(t))return!1;const[r,i,o,a]=ro(e.element,e.point),s=ji(0,1,-a),l=ji(1,0,-o);if(!Zi(Di(i,s),n)||!Zi(Di(i,l),n))return!1;const[c,d]=Ai(r),u=yr(t);if(!u)return!1;if(e.check===Zi){if(u.some((e=>mo(e,c,d,t.strokeSharpness))))return!0}return u.some((e=>bo(e,c,d,n)))},ro=(e,t)=>{const n=Oi(t),r=Ye(e),i=oo(r),o=Ri(i,e.angle),a=Bi(o,n),s=(e=>[0,0,0,0,Math.abs(e[4]),Math.abs(e[5]),1,0])(yi(a,zi(i))),l=((e,t)=>[0,0,0,0,t,e,0,0])(e.x,e.y),c=yi(a,l),[d,u,h,p]=r;return[c,s,(h-d)/2,(p-u)/2]},io=e=>{const t=Ye(e),n=oo(t),r=Ri(n,e.angle),i=vi((e=>[1,0,0,0,-.5*e[5],.5*e[4],0,0])(zi(n)));return xi(i,r)},oo=e=>{let[t,n,r,i]=e;return mi((t+r)/2,(n+i)/2)},ao=(e,t,n)=>{const r=io(e),i=Bi(r,Oi(t)),o=Bi(r,Oi(n)),a=Ti(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))}},so=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=lo(e);r=n.flatMap(((e,r)=>{const o=[e,n[(r+1)%4]];return co(t,uo(o,i))})).concat(n.flatMap((e=>po(e,i,t))));break;case"ellipse":r=ho(e,i,t)}if(r.length<2)return[];const o=r.sort(((e,t)=>Pi(e,n)-Pi(t,n)));return[o[0],o[o.length-1]]},lo=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)]}},co=(e,t)=>{const[n,r]=t;return Di(n,e)*Di(r,e)>=0?[]:[Li(e,Ti(n,r))]},uo=(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)=>Si([0,0,0,0,t[4]-e[4],t[5]-e[5],0,0]))(n,r),t);return[Bi(i,n),Bi(i,r)]},ho=(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)]},po=(e,t,n)=>{if(0===t)return 0===Di(n,e)?[e]:[];const r=n[2],i=n[3],o=n[1],[a,s]=Ai(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)]},go=(e,t,n)=>{const r=Math.abs(t),i=e.width*r/2,o=e.height*r/2,a=Math.sign(t),[s,l]=Ai(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)},fo=(e,t,n)=>{const r=Math.abs(t),i=Math.sign(t),o=lo(e,r);let a=0,s=null;return o.forEach((e=>{const t=i*Ti(n,e)[1];t>a&&(a=t,s=e)})),s},mo=(e,t,n,r)=>{const i=Ze(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 He(o,t,n);const e=he(o,10,5);return He(e,t,n)}return!1},bo=(e,t,n,r)=>{const i=Ze(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 vo=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 yo=(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=fi(e,i,o),{rotation:s}=a,l=vo(a,["rotation"]);if(s&&yo(s,n,r))return"rotation";const c=Object.keys(l).filter((e=>{const t=l[e];return!!t&&yo(t,n,r)}));return c.length>0&&c[0]})(a,t,n,r,i,o);return s?{element:a,transformHandleType:s}:null}),null),wo=(e,t,n,r,i)=>{let[o,a,s,l]=e;const c=gi([o,a,s,l],0,r,i,ci);return Object.keys(c).find((e=>{const r=c[e];return r&&yo(r,t,n)}))||!1},_o=["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=_o.indexOf(e);if(n>=0){const r=Math.round(t/(Math.PI/4));e=_o[(n+r)%_o.length]}return e})(i,t.angle)),i?"".concat(i,"-resize"):""};class Eo{constructor(e,t){this.elementId=e.id,Kn.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=Kn.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,!1)){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=So(n)?Ro(on(Eo.getPointAtIndexGlobalCoordinates(l,e)),Kn.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&&Br(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:Ro(i,Kn.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;So(t)&&Te(l)&&Io(l,e,n)}const[d,u,h,p]=Ye(l),g=(d+h)/2,f=(u+p)/2,m=c>-1&&De(l.x+l.points[c][0],l.y+l.points[c][1],g,f,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:m?{x:i.x-m[0],y:i.y-m[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(Be(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=We(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){Br(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(Br(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);Br(e,Object.assign(Object.assign({},i),{points:t,x:e.x+u[0],y:e.y+u[1]}))}}Eo.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},So=e=>e.isBindingEnabled,Io=(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)));Kn.getScene(e).getNonDeletedElements(o).forEach((t=>{var n;Br(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)||(Ao(e,t,r),i.add(t.id));else{const t=zo(e,r);null!=t&&o.add(t)}},To=e=>{e.forEach((e=>{Te(e)?Io(e,Vo(e,"start"),Vo(e,"end")):Oe(e)&&Mo(e)}))},Mo=e=>{Yo(e).forEach((t=>{let[n,r]=t;return Io(n,"end"===r?"keep":e,"start"===r?"keep":e)}))},Oo=(e,t,n,r)=>{null!=t.startBoundElement&&Ao(e,t.startBoundElement,"start");const i=Ro(r,n);null==i||Lo(e,i,"end")||Ao(e,i,"end")},Ao=(e,t,n)=>{Br(e,{["start"===n?"startBinding":"endBinding"]:Object.assign({elementId:t.id},Bo(e,t,n))});un(t.boundElements||[]).has(e.id)||Br(t,{boundElements:(t.boundElements||[]).concat({id:e.id,type:"arrow"})})},Lo=(e,t,n)=>{const r=e["start"===n?"endBinding":"startBinding"];return Po(e,null==r?void 0:r.elementId,t)},Po=(e,t,n)=>t===n.id&&e.points.length<3,Do=e=>{e.forEach((e=>{Te(e)&&Io(e,null,null)}))},zo=(e,t)=>{const n="start"===t?"startBinding":"endBinding",r=e[n];return null==r?null:(Br(e,{[n]:null}),r.elementId)},Ro=(e,t)=>Ys(t.getElements(),(t=>Oe(t,!1)&&Ki(t,e))),Bo=(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:ao(t,s,a),gap:Math.max(1,Gi(t,a))}},No=(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=Fo(o);Kn.getScene(e).getNonDeletedElements(r.map((e=>e.id))).forEach((t=>{if(!Ie(t))return;const n=e;if(!Ho(t,n))return;const r=Ko(n,t.startBinding,i),o=Ko(n,t.endBinding,i);a.has(t.id)?Br(t,{startBinding:r,endBinding:o}):(Uo(t,"start",r,e),Uo(t,"end",o,e))}))},Ho=(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},Fo=e=>new Set((e||[]).map((e=>e.id))),Uo=(e,t,n,r)=>{if(null==n||n.elementId!==r.id&&e.points.length>2)return;const i=Kn.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=oo(t);return Ai(n)}const r=io(e),i=Bi(r,Oi(n)),o=vi(r);let a;switch(e.type){case"rectangle":case"image":case"text":case"diamond":a=fo(e,t,i);break;case"ellipse":a=go(e,t,i)}return Ai(Bi(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=io(e),o=Bi(i,Oi(t)),a=Bi(i,Oi(n)),s=Ti(o,a),l=vi(i);return so(e,s,o,r).map((e=>Ai(Bi(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})},Ko=(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=>[Vo(e,"start"),Vo(e,"end")].filter((e=>null!=e)),Vo=(e,t)=>Ro(Go(e,t),Kn.getScene(e)),Go=(e,t)=>{const n="start"===t?0:-1;return on(Eo.getPointAtIndexGlobalCoordinates(e,n))},Yo=e=>Kn.getScene(e).getElements().map((t=>{if(!Te(t,!1))return null;const n=Zo(t,"start",e),r=Zo(t,"end",e);return n||r?[t,n&&r?"both":n?"start":"end",e]:null})).filter((e=>null!=e)),Zo=(e,t,n)=>null==e["start"===t?"startBinding":"endBinding"]&&!Lo(e,n,t)&&Ki(n,Go(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;Br(e,{startBinding:qo(t,n),endBinding:qo(r,n)})})),e.filter((e=>{let{id:t}=e;return o.has(t)})).forEach((e=>{const{boundElements:t}=e;null!=t&&t.length>0&&Br(e,{boundElements:t.map((e=>n.has(e.id)?{id:n.get(e.id),type:e.type}:e))})}))},qo=(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}},$o=(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)})):Te(e)&&(e.startBinding&&r.add(e.startBinding.elementId),e.endBinding&&r.add(e.endBinding.elementId))})),e.filter((e=>{let{id:t}=e;return r.has(t)})).forEach((e=>{Oe(e)?Br(e,{boundElements:Jo(e.boundElements,n)}):Te(e)&&Br(e,{startBinding:Qo(e.startBinding,n),endBinding:Qo(e.endBinding,n)})}))},Qo=(e,t)=>null==e||t.has(e.elementId)?null:e,Jo=(e,t)=>e?e.filter((e=>!t.has(e.id))):null,ea=e=>e>=2*Math.PI?e-2*Math.PI:e,ta=(e,t,n,i)=>{const[o,a,s,l]=Ye(e),c=(o+s)/2,d=(a+l)/2;let u=5*Math.PI/2+Math.atan2(n-d,t-c);i&&(u+=r.ay/2,u-=u%r.ay),u=ea(u),Br(e,{angle:u});const h=ir(e);if(h){const t=Kn.getScene(e).getElement(h);Br(t,{angle:u})}},na=(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=Ur(e,...De(t,n,0,0,r));return De(i.width,i.height,0,0,-r)})(e.type,p,g,e.angle));const[f,m]=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);Br(e,{x:f,y:m,points:[[0,0],[p,g]]})},ra=(e,t,n)=>Ie(e)||Ce(e)?{points:Ge(0,t,Ge(1,n,e.points))}:{},ia=(e,t,n)=>{const r=e.fontSize*(t/e.width);if(r<1)return null;const i=Yn(e.text,Ut({fontSize:r,fontFamily:e.fontFamily}),e.containerId?e.width:null);return{size:r,baseline:i.baseline+(n-i.height)}},oa=(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=ia(e,r,i);if(null===c)return;const[d,u,h,g]=tt(e,r,i),f=(o-d)/2,m=(a-u)/2,b=(s-h)/2,v=(l-g)/2,[y,x]=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,f,m,b,v);Br(e,{fontSize:c.size,width:r,height:i,baseline:c.baseline,x:y,y:x})}},aa=(e,t,n,i,o,a,s)=>{const l=e.get(n.id),[c,d,u,h]=tt(l,l.width,l.height),p=[c,d],g=[u,h],f=((e,t)=>[(e[0]+t[0])/2,(e[1]+t[1])/2])(p,g),m=ze([a,s],f,-l.angle),[b,v,y,x]=tt(n,n.width,n.height),w=y-b,_=x-v;let k=(g[0]-p[0])/w,E=(g[1]-p[1])/_,C={};const S=or(n);i.includes("e")&&(k=(m[0]-p[0])/w),i.includes("s")&&(E=(m[1]-p[1])/_),i.includes("w")&&(k=(g[0]-m[0])/w),i.includes("n")&&(E=(g[1]-m[1])/_);const I=l.width,j=l.height;let T=n.width*k,M=n.height*E;if(o&&(T=2*T-I,M=2*M-j),t){const e=Math.abs(T)/I,t=Math.abs(M)/j;if(1===i.length&&(M*=e,T*=t),2===i.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&&(C={fontSize:n.fontSize,baseline:n.baseline}),t){const e=ia(S,T-2*r.gK,M-2*r.gK);if(null===e)return;C={fontSize:e.size,baseline:e.baseline}}else{const e=tr(Ut(S)),t=nr(Ut(S));T=Math.ceil(Math.max(T,e)),M=Math.ceil(Math.max(M,t))}}const[O,A,L,P]=tt(l,T,M),D=L-O,z=P-A;let R=[...p];if(["n","w","nw"].includes(i)&&(R=[g[0]-Math.abs(D),g[1]-Math.abs(z)]),"ne"===i){const e=[p[0],g[1]];R=[e[0],e[1]-Math.abs(z)]}if("sw"===i){const e=[g[0],p[1]];R=[e[0]-Math.abs(D),e[1]]}t&&(["s","n"].includes(i)&&(R[0]=f[0]-D/2),["e","w"].includes(i)&&(R[1]=f[1]-z/2)),T<0&&(i.includes("e")&&(R[0]-=Math.abs(D)),i.includes("w")&&(R[0]+=Math.abs(D))),M<0&&(i.includes("s")&&(R[1]-=Math.abs(z)),i.includes("n")&&(R[1]+=Math.abs(z))),o&&(R[0]=f[0]-Math.abs(D)/2,R[1]=f[1]-Math.abs(z)/2);const B=l.angle,N=ze(R,f,B),H=[R[0]+Math.abs(D)/2,R[1]+Math.abs(z)/2],F=ze(H,f,B);R=ze(N,F,-B);const U=ra(l,T,M),K=[...R];K[0]+=l.x-O,K[1]+=l.y-A;const W=Object.assign({width:Math.abs(T),height:Math.abs(M),x:K[0],y:K[1]},U);"scale"in n&&"scale"in l&&Br(n,{scale:[(Math.sign(k)||l.scale[0])*l.scale[0],(Math.sign(E)||l.scale[1])*l.scale[1]]}),0!==W.width&&0!==W.height&&Number.isFinite(W.x)&&Number.isFinite(W.y)&&(No(n,{newSize:{width:W.width,height:W.height}}),Br(n,W),S&&C&&Br(S,{fontSize:C.fontSize}),Gn(n,i))},sa=(e,t,n,i)=>{const[o,a,s,l]=et(e);let c,d;switch(t){case"se":c=Math.max((n-o)/(s-o),(i-a)/(l-a)),d=(e,t,n)=>{let[r,i]=t,[s,l]=n;return{x:e.x+(r-o)*(c-1)+r-s,y:e.y+(i-a)*(c-1)+i-l}};break;case"nw":c=Math.max((s-n)/(s-o),(l-i)/(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-o)/(s-o),(l-i)/(l-a)),d=(e,t,n)=>{let[r,,,i]=t,[a,,,s]=n;return{x:e.x+(r-o)*(c-1)+r-a,y:e.y-(l-i)*(c-1)+i-s}};break;case"sw":c=Math.max((s-n)/(s-o),(i-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 i=n.width*c,o=n.height*c,a=or(n);let s={};if(a){const e=ia(a,i-2*r.gK,o-2*r.gK);if(null===e)return null;s={fontSize:e.size,baseline:e.baseline}}if(Ee(n)){const e=ia(n,i,o);if(null===e)return null;s={fontSize:e.size,baseline:e.baseline}}const l=Ye(n),u=ra(n,i,o);No(n,{newSize:{width:i,height:o},simultaneouslyUpdated:e});const h=tt(Object.assign(Object.assign({},n),u),i,o),{x:p,y:g}=d(n,l,h);return[...t,Object.assign(Object.assign({width:i,height:o,x:p,y:g},u),s)]}),[]);n&&e.forEach(((e,r)=>{Br(e,n[r]);const i=or(e);i&&(Br(i,{fontSize:n[r].fontSize,baseline:n[r].baseline}),Gn(e,t))}))}},la=(e,t,n,i,o,a,s)=>{let l=5*Math.PI/2+Math.atan2(i-s,n-a);o&&(l+=r.ay/2,l-=l%r.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,[f,m]=De(h,p,a,s,l+g-t.angle);Br(t,{x:t.x+(f-h),y:t.y+(m-p),angle:ea(l+g)});const b=ir(t);if(b){const e=Kn.getScene(t).getElement(b);Br(e,{x:e.x+(f-h),y:e.y+(m-p),angle:ea(l+g)})}}))},ca=(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;Br(i,{x:a,y:s})},da=(e,t,n,r,i,o,a,s,l,c,d)=>{l&&(d?s=a/d:(({width:a,height:s}=Ur(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&&Br(e,{x:u,y:h,width:a,height:s})},ua=e=>{let{options:t,value:n,onChange:r,group:i}=e;return(0,b.jsx)("div",{className:"buttonList buttonListIcon",children:t.map((e=>(0,b.jsxs)("label",{className:xe({active:n===e.value}),title:e.text,children:[(0,b.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 ha=e=>{let{children:t,left:n,top:r,onCloseRequest:o,fitInViewport:a=!1,offsetLeft:s=0,offsetTop:l=0,viewportWidth:c=window.innerWidth,viewportHeight:d=window.innerHeight}=e;const u=(0,i.useRef)(null);return(0,i.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,i.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,b.jsx)("div",{className:"popover",style:{top:r,left:n},ref:u,children:t})};n(4220);const pa=(e,t)=>!at[t].includes(e),ga=e=>{const t=(new Option).style;return t.color=e,!!t.color},fa=[["1","2","3","4","5"],["q","w","e","r","t"],["a","s","d","f","g"],["z","x","c","v","b"]].flat(),ma=e=>{let{colors:t,color:n,onChange:r,onClose:i,label:a,showInput:s=!0,type:l,elements:c}=e;const d=o().useRef(),u=o().useRef(),h=o().useRef(),p=o().useRef(),[f]=o().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&&pa(e[o],t)&&!n.includes(e[o])&&n.push(e[o]),i++}return n})(c,l)));o().useEffect((()=>{u.current?u.current.focus():p.current?p.current.focus():h.current&&h.current.focus()}),[]);const v=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e.map(((e,i)=>{const o=e.replace("#",""),a=t?fa[i+15]:fa[i],s=t?o:m("colors.".concat(o));return(0,b.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":fa[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,b.jsx)("div",{className:"color-picker-transparent"}):void 0,(0,b.jsx)("span",{className:"color-picker-keybinding",children:a})]},e)}))};return(0,b.jsxs)("div",{className:"color-picker color-picker-type-".concat(l),role:"dialog","aria-modal":"true","aria-label":m("labels.colorPicker"),onKeyDown:e=>{if(e.key===At.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(Lt(e.key)){const{activeElement:t}=document,n=g().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?At.ARROW_LEFT:At.ARROW_RIGHT)?(o+1)%t:e.key===(n?At.ARROW_RIGHT:At.ARROW_LEFT)?(t+o-1)%t:i||e.key!==At.ARROW_DOWN?i||e.key!==At.ARROW_UP?o:(t+o-5)%t:(o+5)%t;null===(r=a.children[l])||void 0===r||r.focus()}e.preventDefault()}else if(fa.includes(e.key.toLowerCase())&&!Ht(e.target)){var o;const t=fa.indexOf(e.key.toLowerCase()),n=t>=15,r=n?t-15:t;null===(o=(n?h.current.querySelector(".color-picker-content--canvas-colors"):h.current.querySelector(".color-picker-content--default")).children[r])||void 0===o||o.focus(),e.preventDefault()}else e.key!==At.ESCAPE&&e.key!==At.ENTER||(e.preventDefault(),i());e.nativeEvent.stopImmediatePropagation(),e.stopPropagation()},children:[(0,b.jsx)("div",{className:"color-picker-triangle color-picker-triangle-shadow"}),(0,b.jsx)("div",{className:"color-picker-triangle"}),(0,b.jsxs)("div",{className:"color-picker-content",ref:e=>{e&&(h.current=e)},tabIndex:0,children:[(0,b.jsx)("div",{className:"color-picker-content--default",children:v(t)}),!!f.length&&(0,b.jsxs)("div",{className:"color-picker-content--canvas",children:[(0,b.jsx)("span",{className:"color-picker-content--canvas-title",children:m("labels.canvasColors")}),(0,b.jsx)("div",{className:"color-picker-content--canvas-colors",children:v(f,!0)})]}),s&&(0,b.jsx)(ba,{color:n,label:a,onChange:e=>{r(e)},ref:p})]})]})},ba=o().forwardRef(((e,t)=>{let{color:n,onChange:r,label:i}=e;const[a,s]=o().useState(n),l=o().useRef(null);o().useEffect((()=>{s(n)}),[n]),o().useImperativeHandle(t,(()=>l.current));const c=o().useCallback((e=>{const t=e.toLowerCase(),n=(e=>sn(e)||ga(e)?e:ga("#".concat(e))?"#".concat(e):null)(t);n&&r(n),s(t)}),[r]);return(0,b.jsxs)("label",{className:"color-input-container",children:[(0,b.jsx)("div",{className:"color-picker-hash",children:"#"}),(0,b.jsx)("input",{spellCheck:!1,className:"color-picker-input","aria-label":i,onChange:e=>c(e.target.value),value:(a||"").replace(/^#/,""),onBlur:()=>s(n),ref:l})]})})),va=e=>{let{type:t,color:n,onChange:r,label:i,isActive:a,setActive:s,elements:l,appState:c}=e;const d=o().useRef(null);return(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"color-picker-control-container",children:[(0,b.jsx)("button",{className:"color-picker-label-swatch","aria-label":i,style:n?{"--swatch-color":n}:void 0,onClick:()=>s(!a),ref:d}),(0,b.jsx)(ba,{color:n,label:i,onChange:e=>{r(e)}})]}),(0,b.jsx)(o().Suspense,{fallback:"",children:a?(0,b.jsx)(ha,{onCloseRequest:e=>e.target!==d.current&&s(!1),children:(0,b.jsx)(ma,{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:i,showInput:!1,type:t,elements:l})}):null})]})};n(7117);function ya(e){let{options:t,value:n,label:r,onChange:i,onClose:a}=e;const s=o().useRef(),l=o().useRef(),c=o().useRef(null);o().useEffect((()=>{l.current?l.current.focus():c.current&&c.current.focus()}),[]);return(0,b.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===At.TAB)setTimeout((()=>{l.current!==document.activeElement&&a()}),0);else if(Lt(e.key)){const{activeElement:n}=document,r=g().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?At.ARROW_LEFT:At.ARROW_RIGHT:case At.ARROW_DOWN:o=(i+1)%n;break;case r?At.ARROW_RIGHT:At.ARROW_LEFT:case At.ARROW_UP:o=(n+i-1)%n}c.current.children[o].focus()}e.preventDefault()}else e.key!==At.ESCAPE&&e.key!==At.ENTER||(e.preventDefault(),a());else{const r=t.indexOf(n);c.current.children[r].focus(),e.preventDefault()}e.nativeEvent.stopImmediatePropagation(),e.stopPropagation()},children:(0,b.jsx)("div",{className:"picker-content",ref:c,children:t.map(((e,t)=>(0,b.jsxs)("button",{className:"picker-option",onClick:t=>{t.currentTarget.focus(),i(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:()=>{i(e.value)},children:[e.icon,(0,b.jsx)("span",{className:"picker-keybinding",children:e.keyBinding})]},e.text)))})})}function xa(e){var t;let{value:n,label:r,options:i,onChange:a,group:s=""}=e;const[l,c]=o().useState(!1),d=o().useRef(null),u=g().rtl;return(0,b.jsxs)("label",{className:"picker-container",children:[(0,b.jsx)("button",{name:s,className:l?"active":"","aria-label":r,onClick:()=>c(!l),ref:d,children:null===(t=i.find((e=>e.value===n)))||void 0===t?void 0:t.icon}),(0,b.jsx)(o().Suspense,{fallback:"",children:l?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(ha,Object.assign(Object.assign({onCloseRequest:e=>e.target!==d.current&&c(!1)},u?{right:5.5}:{left:-5.5}),{children:(0,b.jsx)(ya,{options:i,value:n,label:r,onChange:a,onClose:()=>{var e;c(!1),null===(e=d.current)||void 0===e||e.focus()}})})),(0,b.jsx)("div",{className:"picker-triangle"})]}):null})]})}const wa=e=>e===r.C6.LIGHT?it.orange[4]:it.orange[9],_a=e=>e===r.C6.LIGHT?it.white:"#1e1e1e",ka=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,b.jsx)("svg",{"aria-hidden":"true",focusable:"false",role:"img",viewBox:"0 0 ".concat(n," ").concat(r),className:xe({"rtl-mirror":i}),style:o,children:"string"==typeof e?(0,b.jsx)("path",{fill:"currentColor",d:e}):e})},Ea=ka((0,b.jsx)("polyline",{fill:"none",stroke:"currentColor",points:"20 6 9 17 4 12"}),{width:24,height:24}),Ca=ka("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}),Sa=ka("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}),Ia=ka("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}),ja=ka("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}),Ta=ka("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}),Ma=ka("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}),Oa=ka("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"),Aa=(ka("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}),ka((0,b.jsxs)(b.Fragment,{children:[(0,b.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,b.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})),La=ka("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}),Pa=ka("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}),Da=ka("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}),za=ka("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"),Ra=ka("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"),Ba=ka("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}),Na=ka("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=ka("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}),Fa=(ka("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}),ka("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}),ka((0,b.jsxs)(b.Fragment,{children:[(0,b.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,b.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}),ka((0,b.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}),o().memo((e=>{let{theme:t}=e;return ka((0,b.jsxs)(b.Fragment,{children:[(0,b.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,b.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:wa(t),stroke:wa(t),strokeWidth:"2"})]}),{width:24,mirror:!0})}))),Ua=o().memo((e=>{let{theme:t}=e;return ka((0,b.jsxs)(b.Fragment,{children:[(0,b.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:wa(t),stroke:wa(t),strokeWidth:"2"}),(0,b.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})})),Ka=o().memo((e=>{let{theme:t}=e;return ka((0,b.jsxs)(b.Fragment,{children:[(0,b.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,b.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:wa(t),stroke:wa(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),Wa=o().memo((e=>{let{theme:t}=e;return ka((0,b.jsxs)(b.Fragment,{children:[(0,b.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:wa(t),stroke:wa(t),strokeWidth:"2"}),(0,b.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})})),Va=o().memo((e=>{let{theme:t}=e;return ka((0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("path",{d:"M 2,5 H 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,b.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:wa(t),stroke:wa(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),Ga=o().memo((e=>{let{theme:t}=e;return ka((0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("path",{d:"M 2,19 H 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,b.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:wa(t),stroke:wa(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),Ya=o().memo((e=>{let{theme:t}=e;return ka((0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("path",{d:"M 5,2 V 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,b.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:wa(t),stroke:wa(t),strokeWidth:"2"})]}),{width:24})})),Za=o().memo((e=>{let{theme:t}=e;return ka((0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("path",{d:"M 19,2 V 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,b.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:wa(t),stroke:wa(t),strokeWidth:"2"})]}),{width:24})})),Xa=o().memo((e=>{let{theme:t}=e;return ka((0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("path",{d:"M19 5V19M5 5V19",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,b.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:wa(t),stroke:wa(t),strokeWidth:"2"})]}),{width:24})})),qa=o().memo((e=>{let{theme:t}=e;return ka((0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("path",{d:"M5 5L19 5M5 19H19",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,b.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:wa(t),stroke:wa(t),strokeWidth:"2"})]}),{width:24})})),$a=o().memo((e=>{let{theme:t}=e;return ka((0,b.jsxs)(b.Fragment,{children:[(0,b.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:wa(t),stroke:wa(t),strokeWidth:"2"}),(0,b.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=o().memo((e=>{let{theme:t}=e;return ka((0,b.jsxs)(b.Fragment,{children:[(0,b.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:wa(t),stroke:wa(t),strokeWidth:"2"}),(0,b.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})})),Ja=ka("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}),es=(ka("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"),ka("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"),ka("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})),ts=ka("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}),ns=ka("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}),rs=(ka("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}),ka("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})),is=o().memo((e=>{let{theme:t}=e;return ka((0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("path",{d:"M25 26H111V111H25",fill:"var(--icon-fill-color)"}),(0,b.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,b.jsx)("path",{d:"M100 100H160V160H100",fill:"var(--icon-fill-color)"}),(0,b.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,b.jsxs)("g",{fill:_a(t),stroke:"var(--icon-fill-color)",strokeWidth:"6",children:[(0,b.jsx)("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),(0,b.jsx)("rect",{x:"2.5",y:"149.5",width:"30",height:"30"}),(0,b.jsx)("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),(0,b.jsx)("rect",{x:"147.5",y:"2.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})})),os=o().memo((e=>{let{theme:t}=e;return ka((0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("path",{d:"M25 26H111V111H25",fill:"var(--icon-fill-color)"}),(0,b.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,b.jsx)("path",{d:"M100 100H160V160H100",fill:"var(--icon-fill-color)"}),(0,b.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,b.jsxs)("g",{fill:_a(t),stroke:"var(--icon-fill-color)",strokeWidth:"6",children:[(0,b.jsx)("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),(0,b.jsx)("rect",{x:"78.5",y:"149.5",width:"30",height:"30"}),(0,b.jsx)("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),(0,b.jsx)("rect",{x:"147.5",y:"78.5",width:"30",height:"30"}),(0,b.jsx)("rect",{x:"105.5",y:"2.5",width:"30",height:"30"}),(0,b.jsx)("rect",{x:"2.5",y:"102.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})})),as=o().memo((e=>{let{theme:t}=e;return ka((0,b.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})})),ss=o().memo((e=>{let{theme:t}=e;return ka((0,b.jsxs)("g",{fill:"var(--icon-fill-color)",fillRule:"evenodd",clipRule:"evenodd",children:[(0,b.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,b.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})})),ls=o().memo((e=>{let{theme:t}=e;return ka((0,b.jsx)("path",{d:"M2 2H38V18H2V2Z",fill:"var(--icon-fill-color)"}),{width:40,height:20})})),cs=o().memo((e=>{let{theme:t,strokeWidth:n}=e;return ka((0,b.jsx)("path",{d:"M6 10H32",stroke:"var(--icon-fill-color)",strokeWidth:n,strokeLinecap:"round",fill:"none"}),{width:40,height:20})})),ds=o().memo((e=>{let{theme:t}=e;return ka((0,b.jsx)("path",{d:"M6 10H34",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none",strokeLinecap:"round"}),{width:40,height:20})})),us=o().memo((e=>{let{theme:t}=e;return ka((0,b.jsx)("path",{d:"M6 10H34",stroke:"var(--icon-fill-color)",strokeWidth:2.5,strokeDasharray:"10, 8",fill:"none",strokeLinecap:"round"}),{width:40,height:20})})),hs=o().memo((e=>{let{theme:t}=e;return ka((0,b.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})})),ps=o().memo((e=>{let{theme:t}=e;return ka((0,b.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})})),gs=o().memo((e=>{let{theme:t}=e;return ka((0,b.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})})),fs=o().memo((e=>{let{theme:t}=e;return ka((0,b.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})})),ms=o().memo((e=>{let{theme:t}=e;return ka((0,b.jsx)("path",{d:"M10 17L10 5L35 5",stroke:"var(--icon-fill-color)",strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),bs=o().memo((e=>{let{theme:t}=e;return ka((0,b.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})})),vs=o().memo((e=>{let{theme:t}=e;return ka((0,b.jsx)("path",{d:"M6 10H34",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none"}),{width:40,height:20})})),ys=o().memo((e=>{let{theme:t,flip:n=!1}=e;return ka((0,b.jsxs)("g",{transform:n?"translate(40, 0) scale(-1, 1)":"",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none",children:[(0,b.jsx)("path",{d:"M34 10H6M34 10L27 5M34 10L27 15"}),(0,b.jsx)("path",{d:"M27.5 5L34.5 10L27.5 15"})]}),{width:40,height:20})})),xs=o().memo((e=>{let{theme:t,flip:n=!1}=e;return ka((0,b.jsxs)("g",{stroke:"var(--icon-fill-color)",fill:"var(--icon-fill-color)",transform:n?"translate(40, 0) scale(-1, 1)":"",children:[(0,b.jsx)("path",{d:"M32 10L6 10",strokeWidth:2}),(0,b.jsx)("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})})),ws=o().memo((e=>{let{theme:t,flip:n=!1}=e;return ka((0,b.jsx)("g",{transform:n?"translate(40, 0) scale(-1, 1)":"",children:(0,b.jsx)("path",{d:"M34 10H5.99996M34 10L34 5M34 10L34 15",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none"})}),{width:40,height:20})})),_s=o().memo((e=>{let{theme:t,flip:n=!1}=e;return ka((0,b.jsxs)("g",{stroke:"var(--icon-fill-color)",fill:"var(--icon-fill-color)",transform:n?"translate(40, 0) scale(-1, 1)":"",children:[(0,b.jsx)("path",{d:"M32 10L6 10",strokeWidth:2}),(0,b.jsx)("path",{d:"M27.5 5.5L34.5 10L27.5 14.5L27.5 5.5"})]}),{width:40,height:20})})),ks=o().memo((e=>{let{theme:t}=e;return ka((0,b.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})})),Es=o().memo((e=>{let{theme:t}=e;return ka((0,b.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})})),Cs=o().memo((e=>{let{theme:t}=e;return ka((0,b.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})})),Ss=o().memo((e=>{let{theme:t}=e;return ka((0,b.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})})),Is=o().memo((e=>{let{theme:t}=e;return ka((0,b.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})})),js=o().memo((e=>{let{theme:t}=e;return ka((0,b.jsxs)(b.Fragment,{children:[(0,b.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,b.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})})),Ts=o().memo((e=>{let{theme:t}=e;return ka((0,b.jsx)(b.Fragment,{children:(0,b.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})})),Ms=o().memo((e=>{let{theme:t}=e;return ka((0,b.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})})),Os=o().memo((e=>{let{theme:t}=e;return ka((0,b.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})})),As=o().memo((e=>{let{theme:t}=e;return ka((0,b.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})})),Ls=o().memo((e=>{let{theme:t}=e;return ka((0,b.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})})),Ps=o().memo((e=>{let{theme:t}=e;return ka((0,b.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})})),Ds=o().memo((e=>{let{theme:t}=e;return ka((0,b.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})})),zs=ka((0,b.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}),Rs=ka((0,b.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}),Bs=ka((0,b.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"})),Ns=ka("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,Fs=e=>"image"!==e,Us=e=>"rectangle"===e||"ellipse"===e||"diamond"===e||"freedraw"===e||"arrow"===e||"line"===e,Ks=e=>"rectangle"===e||"ellipse"===e||"diamond"===e||"arrow"===e||"line"===e,Ws=e=>"rectangle"===e||"arrow"===e||"line"===e||"diamond"===e,Vs=e=>"text"===e,Gs=e=>"arrow"===e,Ys=(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},Zs=(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 Ae(r,!1)?r:null};let Xs=[];const qs=e=>(Xs=Xs.concat(e),e),$s=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=un(Bl(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=Ml(e);return null!==(i=null!==(o=a&&n(a))&&void 0!==o?o:zl(s,t)?Rl(s,t,n):r)&&void 0!==i?i:null},Js=(e,t,n,r)=>{const i=new Set;return{elements:$s(e,t,(e=>{if(Ee(e)){const o=n(e);i.add(o);let a=Nr(e,{fontSize:o});return Wn(a,ar(e)),t=e,a=Pe(r=a)?r:Br(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}},el=(qs({name:"changeStrokeColor",trackEvent:!1,perform:(e,t,n)=>Object.assign(Object.assign({},n.currentItemStrokeColor&&{elements:$s(e,t,(e=>Fs(e.type)?Nr(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,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("h3",{"aria-hidden":"true",children:m("labels.stroke")}),(0,b.jsx)(va,{type:"elementStroke",label:m("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})]})}}),qs({name:"changeBackgroundColor",trackEvent:!1,perform:(e,t,n)=>Object.assign(Object.assign({},n.currentItemBackgroundColor&&{elements:$s(e,t,(e=>Nr(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,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("h3",{"aria-hidden":"true",children:m("labels.background")}),(0,b.jsx)(va,{type:"elementBackground",label:m("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})]})}}),qs({name:"changeFillStyle",trackEvent:!1,perform:(e,t,n)=>({elements:$s(e,t,(e=>Nr(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,b.jsxs)("fieldset",{children:[(0,b.jsx)("legend",{children:m("labels.fill")}),(0,b.jsx)(ua,{options:[{value:"hachure",text:m("labels.hachure"),icon:(0,b.jsx)(as,{theme:n.theme})},{value:"cross-hatch",text:m("labels.crossHatch"),icon:(0,b.jsx)(ss,{theme:n.theme})},{value:"solid",text:m("labels.solid"),icon:(0,b.jsx)(ls,{theme:n.theme})}],group:"fill",value:Qs(t,n,(e=>e.fillStyle),n.currentItemFillStyle),onChange:e=>{r(e)}})]})}}),qs({name:"changeStrokeWidth",trackEvent:!1,perform:(e,t,n)=>({elements:$s(e,t,(e=>Nr(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,b.jsxs)("fieldset",{children:[(0,b.jsx)("legend",{children:m("labels.strokeWidth")}),(0,b.jsx)(ua,{group:"stroke-width",options:[{value:1,text:m("labels.thin"),icon:(0,b.jsx)(cs,{theme:n.theme,strokeWidth:2})},{value:2,text:m("labels.bold"),icon:(0,b.jsx)(cs,{theme:n.theme,strokeWidth:6})},{value:4,text:m("labels.extraBold"),icon:(0,b.jsx)(cs,{theme:n.theme,strokeWidth:10})}],value:Qs(t,n,(e=>e.strokeWidth),n.currentItemStrokeWidth),onChange:e=>r(e)})]})}}),qs({name:"changeSloppiness",trackEvent:!1,perform:(e,t,n)=>({elements:$s(e,t,(e=>Nr(e,{seed:zr(),roughness:n}))),appState:Object.assign(Object.assign({},t),{currentItemRoughness:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,b.jsxs)("fieldset",{children:[(0,b.jsx)("legend",{children:m("labels.sloppiness")}),(0,b.jsx)(ua,{group:"sloppiness",options:[{value:0,text:m("labels.architect"),icon:(0,b.jsx)(ps,{theme:n.theme})},{value:1,text:m("labels.artist"),icon:(0,b.jsx)(gs,{theme:n.theme})},{value:2,text:m("labels.cartoonist"),icon:(0,b.jsx)(fs,{theme:n.theme})}],value:Qs(t,n,(e=>e.roughness),n.currentItemRoughness),onChange:e=>r(e)})]})}}),qs({name:"changeStrokeStyle",trackEvent:!1,perform:(e,t,n)=>({elements:$s(e,t,(e=>Nr(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,b.jsxs)("fieldset",{children:[(0,b.jsx)("legend",{children:m("labels.strokeStyle")}),(0,b.jsx)(ua,{group:"strokeStyle",options:[{value:"solid",text:m("labels.strokeStyle_solid"),icon:(0,b.jsx)(ds,{theme:n.theme})},{value:"dashed",text:m("labels.strokeStyle_dashed"),icon:(0,b.jsx)(us,{theme:n.theme})},{value:"dotted",text:m("labels.strokeStyle_dotted"),icon:(0,b.jsx)(hs,{theme:n.theme})}],value:Qs(t,n,(e=>e.strokeStyle),n.currentItemStrokeStyle),onChange:e=>r(e)})]})}}),qs({name:"changeOpacity",trackEvent:!1,perform:(e,t,n)=>({elements:$s(e,t,(e=>Nr(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,b.jsxs)("label",{className:"control-label",children:[m("labels.opacity"),(0,b.jsx)("input",{type:"range",min:"0",max:"100",step:"10",onChange:e=>i(+e.target.value),value:null!==(t=Qs(n,r,(e=>e.opacity),r.currentItemOpacity))&&void 0!==t?t:void 0})]})}}),qs({name:"changeFontSize",trackEvent:!1,perform:(e,t,n)=>Js(e,t,(()=>n),n),PanelComponent:e=>{let{elements:t,appState:n,updateData:i}=e;return(0,b.jsxs)("fieldset",{children:[(0,b.jsx)("legend",{children:m("labels.fontSize")}),(0,b.jsx)(ua,{group:"font-size",options:[{value:16,text:m("labels.small"),icon:(0,b.jsx)(ks,{theme:n.theme}),testId:"fontSize-small"},{value:20,text:m("labels.medium"),icon:(0,b.jsx)(Es,{theme:n.theme}),testId:"fontSize-medium"},{value:28,text:m("labels.large"),icon:(0,b.jsx)(Cs,{theme:n.theme}),testId:"fontSize-large"},{value:36,text:m("labels.veryLarge"),icon:(0,b.jsx)(Ss,{theme:n.theme}),testId:"fontSize-veryLarge"}],value:Qs(t,n,(e=>{if(Ee(e))return e.fontSize;const t=or(e);return t?t.fontSize:null}),n.currentItemFontSize||r.n5),onChange:e=>i(e)})]})}}),qs({name:"decreaseFontSize",trackEvent:!1,perform:(e,t,n)=>Js(e,t,(e=>Math.round(1/1.1*e.fontSize))),keyTest:e=>e[At.CTRL_OR_CMD]&&e.shiftKey&&(e.key===At.CHEVRON_LEFT||e.key===At.COMMA)})),tl=qs({name:"increaseFontSize",trackEvent:!1,perform:(e,t,n)=>Js(e,t,(e=>Math.round(1.1*e.fontSize))),keyTest:e=>e[At.CTRL_OR_CMD]&&e.shiftKey&&(e.key===At.CHEVRON_RIGHT||e.key===At.PERIOD)});qs({name:"changeFontFamily",trackEvent:!1,perform:(e,t,n)=>({elements:$s(e,t,(e=>{if(Ee(e)){const t=Nr(e,{fontFamily:n});return Wn(t,ar(e)),t}return e}),!0),appState:Object.assign(Object.assign({},t),{currentItemFontFamily:n}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:i}=e;const o=[{value:r.ut.Virgil,text:m("labels.handDrawn"),icon:(0,b.jsx)(Is,{theme:n.theme})},{value:r.ut.Helvetica,text:m("labels.normal"),icon:(0,b.jsx)(js,{theme:n.theme})},{value:r.ut.Cascadia,text:m("labels.code"),icon:(0,b.jsx)(Ts,{theme:n.theme})}];return(0,b.jsxs)("fieldset",{children:[(0,b.jsx)("legend",{children:m("labels.fontFamily")}),(0,b.jsx)(ua,{group:"font-family",options:o,value:Qs(t,n,(e=>{if(Ee(e))return e.fontFamily;const t=or(e);return t?t.fontFamily:null}),n.currentItemFontFamily||r.rk),onChange:e=>i(e)})]})}}),qs({name:"changeTextAlign",trackEvent:!1,perform:(e,t,n)=>({elements:$s(e,t,(e=>{if(Ee(e)){const t=Nr(e,{textAlign:n});return Wn(t,ar(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,b.jsxs)("fieldset",{children:[(0,b.jsx)("legend",{children:m("labels.textAlign")}),(0,b.jsx)(ua,{group:"text-align",options:[{value:"left",text:m("labels.left"),icon:(0,b.jsx)(Ms,{theme:n.theme})},{value:"center",text:m("labels.center"),icon:(0,b.jsx)(Os,{theme:n.theme})},{value:"right",text:m("labels.right"),icon:(0,b.jsx)(As,{theme:n.theme})}],value:Qs(t,n,(e=>{if(Ee(e))return e.textAlign;const t=or(e);return t?t.textAlign:null}),n.currentItemTextAlign),onChange:e=>r(e)})]})}}),qs({name:"changeVerticalAlign",trackEvent:{category:"element"},perform:(e,t,n)=>({elements:$s(e,t,(e=>{if(Ee(e)){const t=Nr(e,{verticalAlign:n});return Wn(t,ar(e)),t}return e}),!0),appState:Object.assign({},t),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:i}=e;return(0,b.jsx)("fieldset",{children:(0,b.jsx)(ua,{group:"text-align",options:[{value:r.oX.TOP,text:m("labels.alignTop"),icon:(0,b.jsx)(Ls,{theme:n.theme})},{value:r.oX.MIDDLE,text:m("labels.centerVertically"),icon:(0,b.jsx)(Ds,{theme:n.theme})},{value:r.oX.BOTTOM,text:m("labels.alignBottom"),icon:(0,b.jsx)(Ps,{theme:n.theme})}],value:Qs(t,n,(e=>{if(Ee(e)&&e.containerId)return e.verticalAlign;const t=or(e);return t?t.verticalAlign:null})),onChange:e=>i(e)})})}}),qs({name:"changeSharpness",trackEvent:!1,perform:(e,t,n)=>{const r=Nl(Ml(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:$s(e,t,(e=>Nr(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,b.jsxs)("fieldset",{children:[(0,b.jsx)("legend",{children:m("labels.edges")}),(0,b.jsx)(ua,{group:"edges",options:[{value:"sharp",text:m("labels.sharp"),icon:(0,b.jsx)(ms,{theme:n.theme})},{value:"round",text:m("labels.round"),icon:(0,b.jsx)(bs,{theme:n.theme})}],value:Qs(t,n,(e=>e.strokeSharpness),Ws(n.activeTool.type)&&(je(n.activeTool.type)?n.currentItemLinearStrokeSharpness:n.currentItemStrokeSharpness)||null),onChange:e=>r(e)})]})}}),qs({name:"changeArrowhead",trackEvent:!1,perform:(e,t,n)=>({elements:$s(e,t,(e=>{if(Ie(e)){const{position:t,type:r}=n;if("start"===t){return Nr(e,{startArrowhead:r})}if("end"===t){return Nr(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=g().rtl;return(0,b.jsxs)("fieldset",{children:[(0,b.jsx)("legend",{children:m("labels.arrowheads")}),(0,b.jsxs)("div",{className:"iconSelectList",children:[(0,b.jsx)(xa,{label:"arrowhead_start",options:[{value:null,text:m("labels.arrowhead_none"),icon:(0,b.jsx)(vs,{theme:n.theme}),keyBinding:"q"},{value:"arrow",text:m("labels.arrowhead_arrow"),icon:(0,b.jsx)(ys,{theme:n.theme,flip:!i}),keyBinding:"w"},{value:"bar",text:m("labels.arrowhead_bar"),icon:(0,b.jsx)(ws,{theme:n.theme,flip:!i}),keyBinding:"e"},{value:"dot",text:m("labels.arrowhead_dot"),icon:(0,b.jsx)(xs,{theme:n.theme,flip:!i}),keyBinding:"r"},{value:"triangle",text:m("labels.arrowhead_triangle"),icon:(0,b.jsx)(_s,{theme:n.theme,flip:!i}),keyBinding:"t"}],value:Qs(t,n,(e=>Ie(e)&&Gs(e.type)?e.startArrowhead:n.currentItemStartArrowhead),n.currentItemStartArrowhead),onChange:e=>r({position:"start",type:e})}),(0,b.jsx)(xa,{label:"arrowhead_end",group:"arrowheads",options:[{value:null,text:m("labels.arrowhead_none"),keyBinding:"q",icon:(0,b.jsx)(vs,{theme:n.theme})},{value:"arrow",text:m("labels.arrowhead_arrow"),keyBinding:"w",icon:(0,b.jsx)(ys,{theme:n.theme,flip:i})},{value:"bar",text:m("labels.arrowhead_bar"),keyBinding:"e",icon:(0,b.jsx)(ws,{theme:n.theme,flip:i})},{value:"dot",text:m("labels.arrowhead_dot"),keyBinding:"r",icon:(0,b.jsx)(xs,{theme:n.theme,flip:i})},{value:"triangle",text:m("labels.arrowhead_triangle"),icon:(0,b.jsx)(_s,{theme:n.theme,flip:i}),keyBinding:"t"}],value:Qs(t,n,(e=>Ie(e)&&Gs(e.type)?e.endArrowhead:n.currentItemEndArrowhead),n.currentItemEndArrowhead),onChange:e=>r({position:"end",type:e})})]})]})}});n(5422);class nl 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 rl extends DOMException{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Request Aborted","AbortError")}}const il=o().forwardRef(((e,t)=>{const{id:n}=gg(),r=o().useRef(null);o().useImperativeHandle(t,(()=>r.current));const a="ToolIcon_size_".concat(e.size),[s,l]=(0,i.useState)(!1),c=(0,i.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 rl))throw e;console.warn(e)}finally{c.current&&l(!1)}};(0,i.useEffect)((()=>()=>{c.current=!1}),[]);const u=(0,i.useRef)(null);if("button"===e.type||"icon"===e.type||"submit"===e.type){const t="icon"===e.type?"button":e.type;return(0,b.jsxs)("button",{className:xe("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:r,disabled:s||e.isLoading,children:[(e.icon||e.label)&&(0,b.jsxs)("div",{className:"ToolIcon__icon","aria-hidden":"true",children:[e.icon||e.label,e.keyBindingLabel&&(0,b.jsx)("span",{className:"ToolIcon__keybinding",children:e.keyBindingLabel}),e.isLoading&&(0,b.jsx)(v,{})]}),e.showAriaLabel&&(0,b.jsxs)("div",{className:"ToolIcon__label",children:[e["aria-label"]," ",s&&(0,b.jsx)(v,{})]}),e.children]})}return(0,b.jsxs)("label",{className:xe("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,b.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:r}),(0,b.jsxs)("div",{className:"ToolIcon__icon",children:[e.icon,e.keyBindingLabel&&(0,b.jsx)("span",{className:"ToolIcon__keybinding",children:e.keyBindingLabel})]})]})}));il.defaultProps={visible:!0,className:"",size:"medium"};const ol=e=>{const t=e.title||("dark"===e.value?m("buttons.lightMode"):m("buttons.darkMode"));return(0,b.jsx)(il,{type:"icon",icon:e.value===r.C6.LIGHT?al.MOON:al.SUN,title:t,"aria-label":t,onClick:()=>e.onChange(e.value===r.C6.DARK?r.C6.LIGHT:r.C6.DARK),"data-testid":"toggle-dark-mode"})},al={SUN:(0,b.jsx)("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:(0,b.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,b.jsx)("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:(0,b.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"})})},sl=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}},ll=(e,t,n)=>{if(!(e=Tl(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=Be((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 sl({scenePoint:{x:(r+o)/2,y:(i+a)/2},viewportDimensions:{width:t.width,height:t.height},zoom:t.zoom})},cl=e=>Math.max(.1,Math.min(e,30)),dl=(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 ul=()=>{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},hl=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")})},pl=e=>{let{children:t,label:n,long:r=!1,style:o}=e;return(0,i.useEffect)((()=>()=>ul().classList.remove("excalidraw-tooltip--visible")),[]),(0,b.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();hl(t,i)})(e.currentTarget,ul(),n,r),onPointerLeave:()=>ul().classList.remove("excalidraw-tooltip--visible"),style:o,children:t})};n(196),n(1106);const gl=o().forwardRef(((e,t)=>{let{children:n,padding:r,className:i,style:o}=e;return(0,b.jsx)("div",{className:xe("Island",i),style:Object.assign({"--padding":r},o),ref:t,children:n})}));n(8328);const fl=e=>{const{theme:t=r.C6.LIGHT,closeOnClickOutside:n=!0}=e,i=ml(t);if(!i)return null;return(0,st.createPortal)((0,b.jsxs)("div",{className:xe("Modal",e.className),role:"dialog","aria-modal":"true",onKeyDown:t=>{t.key===At.ESCAPE&&(t.nativeEvent.stopImmediatePropagation(),t.stopPropagation(),e.onCloseRequest())},"aria-labelledby":e.labelledBy,children:[(0,b.jsx)("div",{className:"Modal__background",onClick:n?e.onCloseRequest:void 0}),(0,b.jsx)("div",{className:"Modal__content",style:{"--max-width":"".concat(e.maxWidth,"px")},tabIndex:0,children:e.children})]}),i)},ml=e=>{const[t,n]=(0,i.useState)(null),r=hg(),o=(0,i.useRef)(r.isMobile);o.current=r.isMobile;const{container:a}=gg();return(0,i.useLayoutEffect)((()=>{t&&t.classList.toggle("excalidraw--mobile",r.isMobile)}),[t,r.isMobile]),(0,i.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},bl=e=>{const[t,n]=(()=>{const[e,t]=(0,i.useState)(null);return[e,(0,i.useCallback)((e=>t(e)),[])]})(),[r]=(0,i.useState)(document.activeElement),{id:o}=gg();(0,i.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===At.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=()=>{r.focus(),e.onCloseRequest()};return(0,b.jsx)(fl,{className:xe("Dialog",e.className),labelledBy:"dialog-title",maxWidth:e.small?550:800,onCloseRequest:s,theme:e.theme,closeOnClickOutside:e.closeOnClickOutside,children:(0,b.jsxs)(gl,{ref:n,children:[(0,b.jsxs)("h2",{id:"".concat(o,"-dialog-title"),className:"Dialog__title",children:[(0,b.jsx)("span",{className:"Dialog__titleContent",children:e.title}),(0,b.jsx)("button",{className:"Modal__close",onClick:s,"aria-label":m("buttons.close"),children:hg().isMobile?ts:es})]}),(0,b.jsx)("div",{className:"Dialog__content",children:e.children})]})})};n(4678);var vl=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 yl=e=>{const{onConfirm:t,onCancel:n,children:r,confirmText:i=m("buttons.confirm"),cancelText:o=m("buttons.cancel"),className:a=""}=e,s=vl(e,["onConfirm","onCancel","children","confirmText","cancelText","className"]);return(0,b.jsxs)(bl,Object.assign(Object.assign({onCloseRequest:n,small:!0},s),{className:"confirm-dialog ".concat(a),children:[r,(0,b.jsxs)("div",{className:"confirm-dialog-buttons",children:[(0,b.jsx)(il,{type:"button",title:o,"aria-label":o,label:o,onClick:n,className:"confirm-dialog--cancel"}),(0,b.jsx)(il,{type:"button",title:i,"aria-label":i,label:i,onClick:t,className:"confirm-dialog--confirm"})]})]}))},xl=e=>{let{onConfirm:t}=e;const[n,r]=(0,i.useState)(!1),o=()=>{r(!n)};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(il,{type:"button",icon:Ma,title:m("buttons.clearReset"),"aria-label":m("buttons.clearReset"),showAriaLabel:hg().isMobile,onClick:o,"data-testid":"clear-canvas-button"}),n&&(0,b.jsx)(yl,{onConfirm:()=>{t(),o()},onCancel:o,title:m("clearCanvasDialog.title"),children:(0,b.jsxs)("p",{className:"clear-canvas__content",children:[" ",m("alerts.clearReset")]})})]})},wl=(qs({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,b.jsx)("div",{style:{position:"relative"},children:(0,b.jsx)(va,{label:m("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})})}}),qs({name:"clearCanvas",trackEvent:{category:"canvas"},perform:(e,t,n,r)=>(r.imageCache.clear(),{elements:e.map((e=>Nr(e,{isDeleted:!0}))),appState:Object.assign(Object.assign({},bn()),{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,b.jsx)(xl,{onConfirm:t})}}),qs({name:"zoomIn",trackEvent:{category:"canvas"},perform:(e,t,n,i)=>({appState:Object.assign(Object.assign({},t),dl({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:cl(t.zoom.value+r.V4)},t)),commitToHistory:!1}),PanelComponent:e=>{let{updateData:t}=e;return(0,b.jsx)(il,{type:"button",icon:Pa,title:"".concat(m("buttons.zoomIn")," — ").concat(Qt("CtrlOrCmd++")),"aria-label":m("buttons.zoomIn"),onClick:()=>{t(null)},size:"small"})},keyTest:e=>(e.code===ut||e.code===pt)&&(e[At.CTRL_OR_CMD]||e.shiftKey)})),_l=qs({name:"zoomOut",trackEvent:{category:"canvas"},perform:(e,t,n,i)=>({appState:Object.assign(Object.assign({},t),dl({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:cl(t.zoom.value-r.V4)},t)),commitToHistory:!1}),PanelComponent:e=>{let{updateData:t}=e;return(0,b.jsx)(il,{type:"button",icon:Da,title:"".concat(m("buttons.zoomOut")," — ").concat(Qt("CtrlOrCmd+-")),"aria-label":m("buttons.zoomOut"),onClick:()=>{t(null)},size:"small"})},keyTest:e=>(e.code===ht||e.code===gt)&&(e[At.CTRL_OR_CMD]||e.shiftKey)}),kl=(qs({name:"resetZoom",trackEvent:{category:"canvas"},perform:(e,t,n,r)=>({appState:Object.assign(Object.assign({},t),dl({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:cl(1)},t)),commitToHistory:!1}),PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,b.jsx)(pl,{label:m("buttons.resetZoom"),style:{height:"100%"},children:(0,b.jsxs)(il,{type:"button",className:"reset-zoom-button",title:m("buttons.resetZoom"),"aria-label":m("buttons.resetZoom"),onClick:()=>{t(null)},size:"small",children:[(100*n.zoom.value).toFixed(0),"%"]})})},keyTest:e=>(e.code===wt||e.code===ft)&&(e[At.CTRL_OR_CMD]||e.shiftKey)}),(e,t)=>{const[n,i,o,a]=e,s=o-n,l=t.width/s,c=a-i,d=t.height/c,u=Math.min(l,d),h=Math.floor(u/r.V4)*r.V4;return Math.min(Math.max(h,r.V4),1)}),El=(e,t,n)=>{const r=Ml(e),i=Bl(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),sl({scenePoint:{x:u,y:h},viewportDimensions:{width:t.width,height:t.height},zoom:a})),{zoom:a}),commitToHistory:!1}},Cl=(qs({name:"zoomToSelection",trackEvent:{category:"canvas"},perform:(e,t)=>El(e,t,!0),keyTest:e=>e.code===yt&&e.shiftKey&&!e.altKey&&!e[At.CTRL_OR_CMD]}),qs({name:"zoomToFit",trackEvent:{category:"canvas"},perform:(e,t)=>El(e,t,!1),keyTest:e=>e.code===vt&&e.shiftKey&&!e.altKey&&!e[At.CTRL_OR_CMD]}),qs({name:"toggleTheme",trackEvent:{category:"canvas"},perform:(e,t,n)=>({appState:Object.assign(Object.assign({},t),{theme:n||(t.theme===r.C6.LIGHT?r.C6.DARK:r.C6.LIGHT)}),commitToHistory:!1}),PanelComponent:e=>{let{appState:t,updateData:n}=e;return(0,b.jsx)("div",{style:{marginInlineStart:"0.25rem"},children:(0,b.jsx)(ol,{value:t.theme,onChange:e=>{n(e)}})})},keyTest:e=>e.altKey&&e.shiftKey&&e.code===Et}),qs({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===At.E,PanelComponent:e=>{let{elements:t,appState:n,updateData:r,data:i}=e;return(0,b.jsx)(il,{type:"button",icon:Bs,className:xe("eraser",{active:kn(n)}),title:"".concat(m("toolBar.eraser"),"-").concat(Qt("E")),"aria-label":m("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)")}),Sl=e=>{let{id:t,onChange:n,onSubmit:i,getViewportCoords:o,element:a,canvas:s,excalidrawContainer:l,app:c}=e;let d;const u=()=>{var e;const n=c.state,i=null===(e=Kn.getScene(a))||void 0===e?void 0:e.getElement(t);if(!i)return;const{textAlign:s,verticalAlign:l}=i,u=qn(Ut(i));if(i&&Ee(i)){let e=i.x,t=i.y;const a=ar(i);let c=i.width,p=i.height,g=i.width,f=i.height;if(a&&i.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})(i,h),o=Number(h.style.height.slice(0,-2));if(o>0&&(f=o),n&&(d=a.height,f=i.height),d||(d=a.height),c=a.width-2*r.gK,p=a.height-2*r.gK,g=c,e=a.x+r.gK,f>p){const e=Math.min(f-p,u);return void Br(a,{height:a.height+e})}if(a.height>d&&f<p){const e=Math.min(p-f,u);Br(a,{height:a.height-e})}else l===r.oX.MIDDLE&&(t=a.y+a.height/2-f/2),l===r.oX.BOTTOM&&(t=a.y+a.height-f-r.gK)}const[m,b]=o(e,t),v=h.selectionStart,y=h.selectionEnd,x=h.value.length;if(h.value=i.originalText,v===y&&y!==x){const e=x-y;h.selectionStart=h.value.length-e,h.selectionEnd=h.value.length-e}const w=i.originalText.split("\n"),_=i.containerId?u:i.height/w.length;a||(c=(n.width-8-m)/n.zoom.value);const k=(n.height-b)/n.zoom.value,E=a?a.angle:i.angle;Object.assign(h.style,{font:Ut(i),lineHeight:"".concat(_,"px"),width:"".concat(g,"px"),height:"".concat(f,"px"),left:"".concat(m,"px"),top:"".concat(b,"px"),transform:Cl(g,f,E,n,c,k),textAlign:s,verticalAlign:l,color:i.strokeColor,opacity:i.opacity/100,filter:"var(--theme-filter)",maxWidth:"".concat(c,"px"),maxHeight:"".concat(k,"px")}),hn()&&(h.style.fontFamily=Ft(i)),Br(i,{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=Kn.getScene(a))||void 0===e?void 0:e.getElement(t),i=Ut(r),o=h.scrollHeight/qn(i);if(Pe(a)&&o>1){let e="auto";if(2===o){const t=ar(a);1===Jn(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.shiftKey&&wl.keyTest(e))e.preventDefault(),c.actionManager.executeAction(wl),u();else if(!e.shiftKey&&_l.keyTest(e))e.preventDefault(),c.actionManager.executeAction(_l),u();else if(el.keyTest(e))c.actionManager.executeAction(el);else if(tl.keyTest(e))c.actionManager.executeAction(tl);else if(e.key===At.ESCAPE)e.preventDefault(),w=!0,_();else if(e.key===At.ENTER&&e[At.CTRL_OR_CMD]){if(e.preventDefault(),e.isComposing||229===e.keyCode)return;w=!0,_()}else(e.key===At.TAB||e[At.CTRL_OR_CMD]&&(e.code===bt||e.code===mt))&&(e.preventDefault(),e.shiftKey||e.code===bt?v():b(),h.dispatchEvent(new Event("input")))};const f=" ".repeat(4),m=new RegExp("^ {1,".concat(4,"}")),b=()=>{const{selectionStart:e,selectionEnd:t}=h,n=y();let r=h.value;n.forEach((e=>{const t=r.slice(0,e),n=r.slice(e);r="".concat(t).concat(f).concat(n)})),h.value=r,h.selectionStart=e+4,h.selectionEnd=t+4*n.length},v=()=>{const{selectionStart:e,selectionEnd:t}=h,n=y(),r=[];let i=h.value;n.forEach((e=>{const t=i.slice(e,e+4).match(m);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))},y=()=>{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()},x=e=>{e.preventDefault(),e.stopPropagation()};let w=!1;const _=()=>{var e;k();const t=null===(e=Kn.getScene(a))||void 0===e?void 0:e.getElement(a.id);if(!t)return;let n=h.value;const r=ar(t);if(r)if(n=t.text,h.value){const e=ir(r);e&&e===a.id||Br(r,{boundElements:(r.boundElements||[]).concat({type:"text",id:a.id})})}else{var o;Br(r,{boundElements:null===(o=r.boundElements)||void 0===o?void 0:o.filter((e=>!Ee(e)))})}i({text:n,viaKeyboard:w,originalText:h.value})},k=()=>{I||(I=!0,h.onblur=null,h.oninput=null,h.onkeydown=null,j&&j.disconnect(),window.removeEventListener("resize",u),window.removeEventListener("wheel",x,!0),window.removeEventListener("pointerdown",C),window.removeEventListener("pointerup",E),window.removeEventListener("blur",_),S(),h.remove())},E=e=>{window.removeEventListener("pointerup",E);const t=null==e?void 0:e.target,n=t instanceof HTMLInputElement&&t.closest(".color-picker-input")&&Ht(t);setTimeout((()=>{h.onblur=_,t&&n&&(t.onblur=()=>{h.focus()}),n||h.focus()}))},C=e=>{const t=e.target instanceof HTMLInputElement&&e.target.closest(".color-picker-input")&&Ht(e.target);((e.target instanceof HTMLElement||e.target instanceof SVGElement)&&e.target.closest(".".concat(r.$C.SHAPE_ACTIONS_MENU))&&!Ht(e.target)||t)&&(h.onblur=null,window.addEventListener("pointerup",E),window.addEventListener("blur",_))},S=Kn.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(),E();let j=null;s&&"ResizeObserver"in window?(j=new window.ResizeObserver((()=>{u()})),j.observe(s)):window.addEventListener("resize",u),window.addEventListener("pointerdown",C),window.addEventListener("wheel",x,{passive:!1,capture:!0}),null==l||l.querySelector(".excalidraw-textEditorContainer").appendChild(h)},Il=(e,t)=>Boolean(!e.viewModeEnabled&&(e.editingElement||Bl(t,e).length||"selection"!==e.activeTool.type&&"eraser"!==e.activeTool.type)),jl=e=>e.reduce(((e,t)=>e+t.version),0),Tl=e=>e.filter((e=>!e.isDeleted&&!Fr(e))),Ml=e=>e.filter((e=>!e.isDeleted)),Ol=e=>!e.isDeleted,Al=e=>Ml(e).map((e=>je(e.type)?Object.assign(Object.assign({},e),{lastCommittedPoint:null}):e)),Ll=e=>Al(e),Pl=e=>Al(e),Dl=(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}},zl=(e,t)=>e.some((e=>t.selectedElementIds[e.id])),Rl=(e,t,n)=>{const r=Array.from(new Set(Bl(e,t).map((e=>n(e)))));return 1===r.length?r[0]:null},Bl=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))},Nl=(e,t)=>t.editingElement?[t.editingElement]:Bl(e,t,!0),Hl=(e,t)=>{if(e.editingGroupId){const n=qr(Ml(t),e.editingGroupId);if(n.length)return Object.assign(Object.assign({},e),{selectedElementIds:{[n[0].id]:!0}})}return e},Fl=qs({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=Hl(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]?Nr(e,{isDeleted:!0}):e)),appState:Object.assign(Object.assign({},t),{selectedElementIds:{}})}))(e,t);return $o(n,e.filter((e=>{let{id:n}=e;return t.selectedElementIds[n]}))),r=Hl(r,n),{elements:n,appState:Object.assign(Object.assign({},r),{activeTool:Object.assign(Object.assign({},t.activeTool),{type:"selection"}),multiElement:null}),commitToHistory:zl(Ml(e),t)}},contextItemLabel:"labels.delete",keyTest:e=>e.key===At.BACKSPACE||e.key===At.DELETE,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,b.jsx)(il,{type:"button",icon:Ma,title:m("labels.delete"),"aria-label":m("labels.delete"),onClick:()=>r(null),visible:zl(Ml(t),n)})}}),Ul=(e,t)=>{let n=[],r=[],i=null,o=-1;const a=un(Bl(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},Kl=(e,t,n)=>{if("containerId"in e&&e.containerId){if("left"!==n)return t.indexOf(e);{const n=Kn.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=Kn.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=Kl(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=Kl(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=qr(t,d);return u.length?"left"===r?t.indexOf(u[0]):t.indexOf(u[u.length-1]):a},Vl=(e,t)=>t.reduce(((t,n)=>{const r=e[n];return t[r.id]=r,t}),{}),Gl=(e,t,n)=>{const r=Ul(t,e),i=Vl(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]?Hr(e):e))},Yl=(e,t,n)=>{const r=Ul(e,t),i=Vl(e,r),o=[];let a,s;if("left"===n){if(t.editingGroupId){const n=qr(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=qr(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=>Hr(e))),c=e.slice(0,a),d=e.slice(s+1);return"left"===n?[...c,...l,...o,...d]:[...c,...o,...l,...d]},Zl=(e,t)=>Gl(t,e,"left"),Xl=(e,t)=>Gl(t,e,"right"),ql=(e,t)=>Yl(e,t,"left"),$l=(e,t)=>Yl(e,t,"right"),Ql=qs({name:"sendBackward",trackEvent:{category:"element"},perform:(e,t)=>({elements:Zl(e,t),appState:t,commitToHistory:!0}),contextItemLabel:"labels.sendBackward",keyPriority:40,keyTest:e=>e[At.CTRL_OR_CMD]&&!e.shiftKey&&e.code===bt,PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,b.jsx)("button",{type:"button",className:"zIndexButton",onClick:()=>t(null),title:"".concat(m("labels.sendBackward")," — ").concat(Qt("CtrlOrCmd+[")),children:(0,b.jsx)(Ua,{theme:n.theme})})}}),Jl=qs({name:"bringForward",trackEvent:{category:"element"},perform:(e,t)=>({elements:Xl(e,t),appState:t,commitToHistory:!0}),contextItemLabel:"labels.bringForward",keyPriority:40,keyTest:e=>e[At.CTRL_OR_CMD]&&!e.shiftKey&&e.code===mt,PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,b.jsx)("button",{type:"button",className:"zIndexButton",onClick:()=>t(null),title:"".concat(m("labels.bringForward")," — ").concat(Qt("CtrlOrCmd+]")),children:(0,b.jsx)(Fa,{theme:n.theme})})}}),ec=qs({name:"sendToBack",trackEvent:{category:"element"},perform:(e,t)=>({elements:ql(e,t),appState:t,commitToHistory:!0}),contextItemLabel:"labels.sendToBack",keyTest:e=>lt?e[At.CTRL_OR_CMD]&&e.altKey&&e.code===bt:e[At.CTRL_OR_CMD]&&e.shiftKey&&e.code===bt,PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,b.jsx)("button",{type:"button",className:"zIndexButton",onClick:()=>t(null),title:"".concat(m("labels.sendToBack")," — ").concat(Qt(lt?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")),children:(0,b.jsx)(Wa,{theme:n.theme})})}}),tc=qs({name:"bringToFront",trackEvent:{category:"element"},perform:(e,t)=>({elements:$l(e,t),appState:t,commitToHistory:!0}),contextItemLabel:"labels.bringToFront",keyTest:e=>lt?e[At.CTRL_OR_CMD]&&e.altKey&&e.code===mt:e[At.CTRL_OR_CMD]&&e.shiftKey&&e.code===mt,PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,b.jsx)("button",{type:"button",className:"zIndexButton",onClick:e=>t(null),title:"".concat(m("labels.bringToFront")," — ").concat(Qt(lt?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")),children:(0,b.jsx)(Ka,{theme:n.theme})})}}),nc=qs({name:"selectAll",trackEvent:{category:"canvas"},perform:(e,t)=>!t.editingLinearElement&&{appState:Zr(Object.assign(Object.assign({},t),{editingGroupId:null,selectedElementIds:e.reduce(((e,t)=>(t.isDeleted||Ee(t)&&t.containerId||!1!==t.locked||(e[t.id]=!0),e)),{})}),Ml(e)),commitToHistory:!0},contextItemLabel:"labels.selectAll",keyTest:e=>e[At.CTRL_OR_CMD]&&e.key===At.A}),rc=qs({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({},ic(e,t)),{commitToHistory:!0})},contextItemLabel:"labels.duplicateSelection",keyTest:e=>e[At.CTRL_OR_CMD]&&e.key===At.D,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,b.jsx)(il,{type:"button",icon:ns,title:"".concat(m("labels.duplicateSelection")," — ").concat(Qt("CtrlOrCmd+D")),"aria-label":m("labels.duplicateSelection"),onClick:()=>r(null),visible:zl(Ml(t),n)})}}),ic=(e,t)=>{const n=new Map,i=[],o=[],a=new Map,s=e=>{const s=si(t.editingGroupId,n,e,{x:e.x+r.k/2,y:e.y+r.k/2});return a.set(e.id,s.id),o.push(e),i.push(s),s},l=[];let c=0;const d=un(Bl(e,t,!0));for(;c<e.length;){const n=e[c];if(d.get(n.id)){if(n.groupIds.length){const r=Gr(t,n);if(r){const t=qr(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 Vn(l,o,a),Xo(l,o,a),{elements:l,appState:Zr(Object.assign(Object.assign({},t),{selectedGroupIds:{},selectedElementIds:i.reduce(((e,t)=>(Pe(t)||(e[t.id]=!0),e)),{})}),Ml(l))}},oc=qs({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)&&Io(o,r,i),{elements:o.points.length<2||Fr(o)?e.filter((e=>e.id!==o.id)):void 0,appState:Object.assign(Object.assign({},t),{cursorButton:"up",editingLinearElement:null}),commitToHistory:!0}}let s=e;t.pendingImageElement&&Br(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||Br(l,{points:l.points.slice(0,-1)})}Fr(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];Br(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);Oo(l,t,Kn.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),{cursorButton:"up",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===At.ESCAPE&&(null!==t.editingLinearElement||!t.draggingElement&&null===t.multiElement)||(e.key===At.ESCAPE||e.key===At.ENTER)&&null!==t.multiElement,PanelComponent:e=>{let{appState:t,updateData:n,data:r}=e;return(0,b.jsx)(il,{type:"button",icon:za,title:m("buttons.done"),"aria-label":m("buttons.done"),onClick:n,visible:null!=t.multiElement,size:(null==r?void 0:r.size)||"medium"})}});n(518),n(9966);const ac=e=>{const{id:t}=gg(),[n,r]=(0,i.useState)(e.value);return(0,b.jsxs)("div",{className:"ProjectName",children:[(0,b.jsx)("label",{className:"ProjectName-label",htmlFor:"filename",children:"".concat(e.label).concat(e.isNameEditable?"":":")}),e.isNameEditable?(0,b.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=>r(e.target.value)}):(0,b.jsx)("span",{className:"TextInput TextInput--readonly",id:"".concat(t,"-filename"),children:e.value})]})},sc=(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 lc;!function(e){e.ACTIVE="active",e.AWAY="away",e.IDLE="idle"}(lc||(lc={}));var cc,dc;n(4404);const uc="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",PKG_NAME:"@dwelle/excalidraw",PKG_VERSION:"0.3.62",IS_EXCALIDRAW_NPM_PACKAGE:!0})&&void 0!==cc&&cc.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!==(dc={REACT_APP_BACKEND_V2_GET_URL:"https://json.excalidraw.com/api/v2/",REACT_APP_BACKEND_V2_POST_URL:"https://json.excalidraw.com/api/v2/post/",REACT_APP_LIBRARY_URL:"https://libraries.excalidraw.com",REACT_APP_LIBRARY_BACKEND:"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries",REACT_APP_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",PKG_NAME:"@dwelle/excalidraw",PKG_VERSION:"0.3.62",IS_EXCALIDRAW_NPM_PACKAGE:!0})&&void 0!==dc&&dc.JEST_WORKER_ID,(e,t,n,r)=>{}),hc=document.createElement("img");hc.src="data:".concat(r.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 pc=!1;const gc=e=>{let{element:t,appState:n,setAppState:o,onLinkOpen:a}=e;const s=t.link||"",[l,c]=(0,i.useState)(s),d=(0,i.useRef)(null),u="editor"===n.showHyperlinkPopup||!s,h=(0,i.useCallback)((()=>{if(!d.current)return;const e=mc(d.current.value);!t.link&&e&&uc("hyperlink","create"),Br(t,{link:e}),o({showHyperlinkPopup:"info"})}),[t,o]);(0,i.useLayoutEffect)((()=>()=>{h()}),[h]),(0,i.useEffect)((()=>{let e=null;const i=r=>{if(u)return;e&&clearTimeout(e);Ec(t,n,[r.clientX,r.clientY])&&(e=window.setTimeout((()=>{o({showHyperlinkPopup:!1})}),500))};return window.addEventListener(r.Ks.POINTER_MOVE,i,!1),()=>{window.removeEventListener(r.Ks.POINTER_MOVE,i,!1),e&&clearTimeout(e)}}),[n,t,u,o]);const p=(0,i.useCallback)((()=>{uc("hyperlink","delete"),Br(t,{link:null}),u&&(d.current.value=""),o({showHyperlinkPopup:!1})}),[o,t,u]),{x:g,y:f}=fc(t,n);return n.draggingElement||n.resizingElement||n.isRotating||n.openMenu?null:(0,b.jsxs)("div",{className:"excalidraw-hyperlinkContainer",style:{top:"".concat(f,"px"),left:"".concat(g,"px"),width:320,padding:5},children:[u?(0,b.jsx)("input",{className:xe("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[At.CTRL_OR_CMD]&&e.key===At.K&&e.preventDefault(),e.key!==At.ENTER&&e.key!==At.ESCAPE||h()}}):(0,b.jsx)("a",{href:t.link||"",className:xe("excalidraw-hyperlinkContainer-link",{"d-none":u}),target:bc(t.link)?"_self":"_blank",onClick:e=>{if(t.link&&a){const n=pn(r.Ks.EXCALIDRAW_LINK,e.nativeEvent);a(t,n),n.defaultPrevented&&e.preventDefault()}},rel:"noopener noreferrer",children:t.link}),(0,b.jsxs)("div",{className:"excalidraw-hyperlinkContainer__buttons",children:[!u&&(0,b.jsx)(il,{type:"button",title:m("buttons.edit"),"aria-label":m("buttons.edit"),label:m("buttons.edit"),onClick:()=>{uc("hyperlink","edit","popup-ui"),o({showHyperlinkPopup:"editor"})},className:"excalidraw-hyperlinkContainer--edit",icon:Rs}),s&&(0,b.jsx)(il,{type:"button",title:m("buttons.remove"),"aria-label":m("buttons.remove"),label:m("buttons.remove"),onClick:p,className:"excalidraw-hyperlinkContainer--remove",icon:Ma})]})]})},fc=(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),bc=e=>!!(null!=e&&e.includes(location.origin)||null!=e&&e.startsWith("/")),vc=qs({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[At.CTRL_OR_CMD]&&e.key===At.K,contextItemLabel:(e,t)=>yc(e,t),contextItemPredicate:(e,t)=>1===Bl(e,t).length,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;const i=Bl(t,n);return(0,b.jsx)(il,{type:"button",icon:Ca,"aria-label":m(yc(t,n)),title:"".concat(m("labels.link.label")," - ").concat(Qt("CtrlOrCmd+K")),onClick:()=>r(null),selected:1===i.length&&!!i[0].link})}}),yc=(e,t)=>Bl(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,f=i-p-c+h,[m,b]=De(g+s/2,f+l/2,d,u,t);return[m-s/2,b-l/2,s,l]},wc=(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&&Ui(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 _c=null;const kc=(e,t)=>{if(!e.link)return;const n=ul();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);hl(n,{left:u.x,top:u.y,width:c,height:d},"top"),uc("hyperlink","tooltip","link-icon"),pc=!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(Ui(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}=fc(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]})(),Sc=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()},Ic=(e,t,n,r)=>{e.beginPath(),e.arc(t,n,r,0,2*Math.PI),e.fill(),e.stroke()},jc=(e,t,n,i,o,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(i,i);const p=a.width/i,f=a.height/i;if(u&&"dark"===s.theme&&(h.filter=r.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,f),h.save(),h.fillStyle=s.viewBackgroundColor,h.fillRect(0,0,p,f),h.restore()}else h.clearRect(0,0,p,f);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,f/s.zoom.value);const m=e.filter((e=>zc(e,p,f,{zoom:s.zoom,offsetLeft:t.offsetLeft,offsetTop:t.offsetTop,scrollX:s.scrollX,scrollY:s.scrollY})));if(m.forEach((e=>{try{Sr(e,o,h,s),u||Dc(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;Ic(e,r[0],r[1],s/2/n.zoom.value)})),e.restore()})(h,t,s,e)}if(n)try{Sr(n,o,h,s)}catch(e){console.error(e)}if(So(t)&&t.suggestedBindings.filter((e=>null!=e)).forEach((e=>{Oc(h,s,e)})),c&&!t.multiElement&&!t.editingLinearElement){const n=e.reduce(((e,n)=>{const r=[];if(t.selectedElementIds[n.id]&&!Vr(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}=sc(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=qr(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 Yr(t))r(e);t.editingGroupId&&r(t.editingGroupId),n.forEach((e=>Mc(h,s,e)));const i=Bl(e,t);if(h.save(),h.translate(s.scrollX,s.scrollY),1===i.length){h.fillStyle=it.white;const e=fi(i[0],s.zoom,"mouse");t.viewModeEnabled||Tc(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,Sc(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=gi([t,n,r,o],0,s.zoom,"mouse",ci);i.some((e=>!e.locked))&&Tc(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>f-o;n=Math.max(n,0),n=Math.min(n,p-i),r=Math.max(r,0),r=Math.min(r,f-o);const l=null===(b=t.collaborators.get(e))||void 0===b?void 0:b.picture,{background:c,stroke:d}=sc(l||e,t);h.save(),h.strokeStyle=d,h.fillStyle=c;const u=s.remotePointerUserStates[e];(a||u===lc.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 g=s.remotePointerUsernames[e];let m="";u===lc.AWAY?m=Cc?"⚫️":" (".concat(lc.AWAY,")"):u===lc.IDLE?m=Cc?"💤":" (".concat(lc.IDLE,")"):u===lc.ACTIVE&&(m=Cc?"🟢":"");const v="".concat(g?"".concat(g," "):"").concat(m);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,f=n-h,m={top:parseInt(tn("sat")),bottom:parseInt(tn("sab")),left:parseInt(tn("sal")),right:parseInt(tn("sar"))},b=g().rtl,v=p/2-i+m.left,y=f/2-o+m.top,x=v+u-m.right,w=y+h-m.bottom,_=Math.min(s,v),k=Math.min(l,y),E=Math.max(c,x),C=Math.max(d,w);return{horizontal:v===_&&x===E?null:{x:Math.max(m.left,4)+(v-_)/(E-_)*t,y:n-6-Math.max(4,m.bottom),width:(x-v)/(E-_)*t-Math.max(8,m.left+m.right),height:6},vertical:y===k&&w===C?null:{x:b?Math.max(m.left,4):t-6-Math.max(m.right,4),y:(y-k)/(C-k)*n+Math.max(m.top,4),width:6,height:(w-y)/(C-k)*n-Math.max(8,m.top+m.bottom)}}})(e,p,f,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:m.length>0,scrollBars:v}},Tc=(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?Ic(e,o[0]+o[2]/2,o[1]+o[3]/2,o[2]/2):Sc(e,o[0],o[1],o[2],o[3],o[0]+o[2]/2,o[1]+o[3]/2,r,!0),e.restore())}))},Mc=(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,Sc(e,i-u,o-u,c+2*u,d+2*u,i+c/2,o+d/2,r);e.restore()},Oc=(e,t,n)=>{const r=Array.isArray(n)?Lc:Ac;e.save(),e.translate(t.scrollX,t.scrollY),r(e,n),e.restore()},Ac=(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":Sc(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);Ic(e,r,i,o)}))};let Pc;const Dc=(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),Pc&&Pc.zoom===n.zoom.value)t.drawImage(Pc,s-u,l-h,c,d);else{Pc=document.createElement("canvas"),Pc.zoom=n.zoom.value,Pc.width=c*window.devicePixelRatio*n.zoom.value,Pc.height=d*window.devicePixelRatio*n.zoom.value;const e=Pc.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(hc,0,0,c,d),e.restore(),t.drawImage(Pc,s-u,l-h,c,d)}t.restore()}},zc=(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 Rc=Object.defineProperty,Bc=(e,t)=>()=>(e&&(t=e(e=0)),t),Nc=(e,t)=>{for(var n in t)Rc(e,n,{get:t[n],enumerable:!0})},Hc={};Nc(Hc,{default:()=>Fc});var Fc,Uc=Bc((()=>{Fc=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()})))})),Kc={};Nc(Kc,{default:()=>Vc});var Wc,Vc,Gc=Bc((()=>{Wc=async e=>{let t=await e.getFile();return t.handle=e,t},Vc=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]}})),Yc={};Nc(Yc,{default:()=>Zc});var Zc,Xc=Bc((()=>{Zc=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()})))})),qc={};Nc(qc,{default:()=>Qc});var $c,Qc,Jc=Bc((()=>{$c=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,t.handle=a,Object.defineProperty(t,"webkitRelativePath",{configurable:!0,enumerable:!0,get:()=>s}))))):"directory"===a.kind&&t&&(!r||!r(a))&&i.push($c(a,t,s,r))}return[...(await Promise.all(i)).flat(),...await Promise.all(o)]},Qc=async(e={})=>{e.recursive=e.recursive||!1;let t=await window.showDirectoryPicker({id:e.id,startIn:e.startIn});return $c(t,e.recursive,void 0,e.skipDirectory)}})),ed={};Nc(ed,{default:()=>td});var td,nd=Bc((()=>{td=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}})),rd={};Nc(rd,{default:()=>id});var id,od=Bc((()=>{id=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)}})),ad=(()=>{if(typeof self>"u")return!1;if("top"in self&&self!==top)try{top.location}catch{return!1}else if("showOpenFilePicker"in self)return"showOpenFilePicker";return!1})(),sd=ad?Promise.resolve().then((()=>(Gc(),Kc))):Promise.resolve().then((()=>(Uc(),Hc)));ad?Promise.resolve().then((()=>(Jc(),qc))):Promise.resolve().then((()=>(Xc(),Yc)));var ld=ad?Promise.resolve().then((()=>(od(),rd))):Promise.resolve().then((()=>(nd(),ed)));const cd=e=>{var t,n,i;const o=null===(t=e.extensions)||void 0===t?void 0:t.reduce(((e,t)=>(e.push(r.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 sd).default(...e)}({description:e.description,extensions:a,mimeTypes:o,multiple:null!==(i=e.multiple)&&void 0!==i&&i,legacySetup:(t,n,i)=>{const o=Kt(n,500),a=()=>{s(),document.addEventListener(r.Ks.KEYUP,o),document.addEventListener(r.Ks.POINTER_UP,o),o()},s=()=>{var n;if(null!==(n=i.files)&&void 0!==n&&n.length){const n=e.multiple?[...i.files]:i.files[0];t(n)}};requestAnimationFrame((()=>{window.addEventListener(r.Ks.FOCUS,a)}));const l=window.setInterval((()=>{s()}),500);return e=>{clearInterval(l),o.cancel(),window.removeEventListener(r.Ks.FOCUS,a),document.removeEventListener(r.Ks.KEYUP,o),document.removeEventListener(r.Ks.POINTER_UP,o),e&&(console.warn("Opening the file was canceled (legacy-fs)."),e(new rl))}}})},dd=(e,t)=>async function(...e){return(await ld).default(...e)}(e,{fileName:"".concat(t.name,".").concat(t.extension),description:t.description,extensions:[".".concat(t.extension)]},t.fileHandle),ud={selection:!0,text:!0,rectangle:!0,diamond:!0,ellipse:!0,line:!0,image:!0,arrow:!0,freedraw:!0,eraser:!1},hd=(e,t)=>{var n,r,i,o,a,s,l,c,d,u,h,p,g,f,m;const b={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||Rr(),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!==(f=e.link)&&void 0!==f?f:null,locked:null!==(m=e.locked)&&void 0!==m&&m};return Object.assign(Object.assign(Object.assign({},b),Kr(b)),t)},pd=e=>{var t,n,i;switch(e.type){case"text":let o=e.fontSize,a=e.fontFamily;if("font"in e){const[t,n]=e.font.split(" ");o=parseInt(t,10),i=n,a=Object.keys(r.ut).includes(i)?r.ut[i]:r.rk}return hd(e,{fontSize:o,fontFamily:a,text:null!==(t=e.text)&&void 0!==t?t:"",baseline:e.baseline,textAlign:e.textAlign||r.Hg,verticalAlign:e.verticalAlign||r.hs,containerId:null!==(n=e.containerId)&&void 0!==n?n:null,originalText:e.originalText||e.text});case"freedraw":return hd(e,{points:e.points,lastCommittedPoint:null,simulatePressure:e.simulatePressure,pressures:e.pressures});case"image":return hd(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)),hd(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 hd(e,{})}},gd=(e,t)=>{const n=t?un(t):null;return(e||[]).reduce(((e,t)=>{if("selection"!==t.type&&!Fr(t)){let r=pd(t);if(r){const i=null==n?void 0:n.get(t.id);i&&i.version>r.version&&(r=Hr(r,i.version)),e.push(r)}}return e}),[])},fd=(e,t)=>{var n,r,i,o;e=e||{};const a=bn(),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),{cursorButton:(null==t?void 0:t.cursorButton)||"up",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:ud[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:gd(null==e?void 0:e.elements,n),appState:fd(null==e?void 0:e.appState,t||null),files:(null==e?void 0:e.files)||{}}),bd=e=>{const t=gd(Ml(e.elements),null);return t.length?Object.assign(Object.assign({},e),{elements:t}):null},vd=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;const n=[];for(const r of e)if(Array.isArray(r)){const e=bd({status:t,elements:r,id:Rr(),created:Date.now()});e&&n.push(e)}else{const e=r,i=bd(Object.assign(Object.assign({},e),{id:e.id||Rr(),status:e.status||t,created:e.created||Date.now()}));i&&n.push(i)}return n},yd=async e=>{let t;if(e.type===r.LO.png)try{return await(await Promise.resolve().then(n.bind(n,673))).decodePngMetadata(e)}catch(e){throw"INVALID"===e.message?new DOMException(m("alerts.imageDoesNotContainScene"),"EncodingError"):new DOMException(m("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===r.LO.svg)try{return await(await Promise.resolve().then(n.bind(n,673))).decodeSvgMetadata({svg:t})}catch(e){throw"INVALID"===e.message?new DOMException(m("alerts.imageDoesNotContainScene"),"EncodingError"):new DOMException(m("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},wd=e=>{const t=xd(e);return"png"===t||"svg"===t},_d=e=>{const{type:t}=e||{};return!!t&&r.jo.includes(t)},kd=async(e,t,n)=>{const r=await yd(e);try{const i=JSON.parse(r);if(!Ld(i))throw new Error(m("alerts.couldNotLoadInvalidFile"));return md({elements:Pl(i.elements||[]),appState:Object.assign(Object.assign({theme:null==t?void 0:t.theme,fileHandle:e.handle||null},wn(i.appState||{})),t?ll(i.elements||[],t):{}),files:i.files},t,n)}catch(e){throw console.error(e.message),new Error(m("alerts.couldNotLoadInvalidFile"))}},Ed=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unpublished";const n=await yd(e),r=JSON.parse(n);if(!Pd(r))throw new Error("Invalid library");const i=r.libraryItems||r.library;return vd(i,t)},Cd=async e=>new Promise(((t,n)=>{try{e.toBlob((e=>{if(!e)return n(new nl(m("canvasError.canvasTooBig"),"CANVAS_POSSIBLY_TOO_BIG"));t(e)}))}catch(e){n(e)}})),Sd=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},Id=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===r.LO.svg)return e;const[i,o]=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=o({pica:i({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(!_d(e))throw new Error(m("errors.unsupportedFileType"));return new File([await a.toBlob(e,{max:t.maxWidthOrHeight})],e.name,{type:t.outputType||e.type})},Td=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return new File([(new TextEncoder).encode(e)],t,{type:r.LO.svg})},Md=(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},Od=(e,t,n,i)=>{const o={type:r.r8.excalidraw,version:r.Kr.excalidraw,source:r.pb,elements:"local"===i?Pl(e):Ll(e),appState:"local"===i?wn(t):_n(t),files:"local"===i?Md(e,n):void 0};return JSON.stringify(o,null,2)},Ad=async(e,t,n)=>{const i=Od(e,t,n,"local"),o=new Blob([i],{type:r.LO.excalidraw});return{fileHandle:await dd(o,{name:t.name,extension:"excalidraw",description:"Excalidraw file",fileHandle:wd(t.fileHandle)?null:t.fileHandle})}},Ld=e=>(null==e?void 0:e.type)===r.r8.excalidraw&&(!e.elements||Array.isArray(e.elements)&&(!e.appState||"object"==typeof e.appState)),Pd=e=>"object"==typeof e&&e&&e.type===r.r8.excalidrawLibrary&&(1===e.version||2===e.version),Dd=e=>{const t={type:r.r8.excalidrawLibrary,version:r.Kr.excalidrawLibrary,source:r.pb,libraryItems:e};return JSON.stringify(t,null,2)},zd=e=>new Promise(((t,n)=>{const r=new Image;r.onload=()=>{t(r)},r.onerror=e=>{n(e)},r.src=e})),Rd=async e=>{let{fileIds:t,files:n,imageCache:i}=e;const o=new Map,a=new Map;return await Promise.all(t.reduce(((e,t)=>{const s=n[t];return s&&!o.has(t)?(o.set(t,!0),e.concat((async()=>{try{if(s.mimeType===r.LO.binary)throw new Error("Only images can be added to ImageCache");const e=zd(s.dataURL),n={image:e,mimeType:s.mimeType};i.set(t,n);const o=await e;i.set(t,Object.assign(Object.assign({},n),{image:o}))}catch(e){a.set(t,!0)}})())):e}),[])),{imageCache:i,updatedFiles:o,erroredFiles:a}},Bd=e=>e.filter((e=>_e(e))),Nd="\x3c!-- svg-source:excalidraw --\x3e",Hd=async function(e,t,n,i){let{exportBackground:o,exportPadding:a=r.qy,viewBackgroundColor:s}=i,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]=Ud(e,a),{canvas:p,scale:g=1}=l(u,h),f=bn(),{imageCache:m}=await Rd({imageCache:new Map,fileIds:Bd(e).map((e=>e.fileId)),files:n});return jc(e,t,null,g,ve.canvas(p),p,{viewBackgroundColor:o?s:null,scrollX:-c+a,scrollY:-d+a,zoom:f.zoom,remotePointerViewportCoords:{},remoteSelectedElementIds:{},shouldCacheIgnoreZoom:!1,remotePointerUsernames:{},remotePointerUserStates:{},theme:t.exportWithDarkMode?"dark":"light",imageCache:m,renderScrollbars:!1,renderSelection:!1,renderGrid:!1,isExporting:!0}),p},Fd=async(e,t,i)=>{const{exportPadding:o=r.qy,viewBackgroundColor:a,exportScale:s=1,exportEmbedScene:l}=t;let c="";if(l)try{c=await(await Promise.resolve().then(n.bind(n,673))).encodeSvgMetadata({text:Od(e,t,i||{},"local")})}catch(e){console.error(e)}const[d,u,h,p]=Ud(e,o),g=document.createElementNS(r.hR,"svg");g.setAttribute("version","1.1"),g.setAttribute("xmlns",r.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",r.ZF);let f="https://excalidraw.com/";var m;if(f=window.EXCALIDRAW_ASSET_PATH||"https://unpkg.com/".concat("@dwelle/excalidraw","@").concat("0.3.62"),null!==(m=f)&&void 0!==m&&m.startsWith("/")&&(f=f.replace("/","".concat(window.location.origin,"/"))),f="".concat(f,"/dist/excalidraw-assets/"),g.innerHTML="\n ".concat(Nd,"\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(r.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,i||{},{offsetX:-d+o,offsetY:-u+o,exportWithDarkMode:t.exportWithDarkMode}),g},Ud=(e,t)=>{const[n,r,i,o]=et(e);return[n,r,Wt(n,i)+2*t,Wt(r,o)+t+t]},Kd=32,Wd=12,Vd=256,Gd="NOT_SPREADSHEET",Yd="VALID_SPREADSHEET",Zd=e=>{const t=/^[$€£¥₩]?([0-9,]+(\.[0-9]+)?)$/.exec(e);return t?parseFloat(t[1].replace(/,/g,"")):null},Xd=(e,t)=>e.slice(1).every((e=>null!==Zd(e[t]))),qd=e=>{const t=e[0].length;if(t>2)return{type:Gd,reason:"More than 2 columns"};if(1===t){if(!Xd(e,0))return{type:Gd,reason:"Value is not numeric"};const t=null===Zd(e[0][0]),n=(t?e.slice(1):e).map((e=>Zd(e[0])));return n.length<2?{type:Gd,reason:"Less than two rows"}:{type:Yd,spreadsheet:{title:t?e[0][0]:null,labels:null,values:n}}}const n=Xd(e,0)?0:1;if(!Xd(e,n))return{type:Gd,reason:"Value is not numeric"};const r=(n+1)%2,i=null===Zd(e[0][n]),o=i?e.slice(1):e;return o.length<2?{type:Gd,reason:"Less than 2 rows"}:{type:Yd,spreadsheet:{title:i?e[0][n]:null,labels:o.map((e=>e[r])),values:o.map((e=>Zd(e[n])))}}},$d=at.elementBackground.slice(2,at.elementBackground.length),Qd={fillStyle:"hachure",fontFamily:r.rk,fontSize:r.n5,opacity:100,roughness:1,strokeColor:at.elementStroke[0],strokeSharpness:"sharp",strokeStyle:"solid",strokeWidth:1,verticalAlign:r.oX.MIDDLE,locked:!1},Jd=e=>({chartWidth:44*e.values.length+Wd,chartHeight:280}),eu=(e,t,n,r,i)=>{var o;return(null===(o=e.labels)||void 0===o?void 0:o.map(((e,o)=>ri(Object.assign(Object.assign({groupIds:[r],backgroundColor:i},Qd),{text:e.length>8?"".concat(e.slice(0,5),"..."):e,x:t+44*o+24,y:n+6,width:Kd,angle:5.87,fontSize:16,textAlign:"center",verticalAlign:"top"})))))||[]},tu=(e,t,n,r,i)=>{const o=ri(Object.assign(Object.assign({groupIds:[r],backgroundColor:i},Qd),{x:t-Wd,y:n-Wd,text:"0",textAlign:"right"}));return[o,ri(Object.assign(Object.assign({groupIds:[r],backgroundColor:i},Qd),{x:t-Wd,y:n-Vd-o.height/2,text:Math.max(...e.values).toLocaleString(),textAlign:"right"}))]},nu=(e,t,n,r,i)=>{const{chartWidth:o,chartHeight:a}=Jd(e);return[oi(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Qd),{type:"line",x:t,y:n,startArrowhead:null,endArrowhead:null,width:o,points:[[0,0],[o,0]]})),oi(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Qd),{type:"line",x:t,y:n,startArrowhead:null,endArrowhead:null,height:a,points:[[0,0],[0,-a]]})),oi(Object.assign(Object.assign({backgroundColor:i,groupIds:[r]},Qd),{type:"line",x:t,y:n-Vd-Wd,startArrowhead:null,endArrowhead:null,strokeStyle:"dotted",width:o,opacity:50,points:[[0,0],[o,0]]}))]},ru=(e,t,n,i,o,a)=>{const{chartWidth:s,chartHeight:l}=Jd(e),c=e.title?ri(Object.assign(Object.assign({backgroundColor:o,groupIds:[i]},Qd),{text:e.title,x:t+s/2,y:n-Vd-24-r.n5,strokeSharpness:"sharp",strokeStyle:"solid",textAlign:"center"})):null,d=a?ti(Object.assign(Object.assign({backgroundColor:o,groupIds:[i]},Qd),{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]:[],...eu(e,t,n,i,o),...tu(e,t,n,i,o),...nu(e,t,n,i,o)]},iu=(e,t,n,i)=>"line"===e?((e,t,n)=>{const i=Math.max(...e.values),o=Rr(),a=$d[Math.floor(Math.random()*$d.length)];let s=0;const l=[];for(const t of e.values){const e=44*s,n=-t/i*Vd;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=oi(Object.assign(Object.assign({backgroundColor:a,groupIds:[o]},Qd),{type:"line",x:t+Wd+16,y:n-Wd,startArrowhead:null,endArrowhead:null,height:d-h,width:c-u,strokeWidth:2,points:l})),g=e.values.map(((e,r)=>{const s=44*r+6,l=-e/i*Vd+6;return ti(Object.assign(Object.assign({backgroundColor:a,groupIds:[o]},Qd),{fillStyle:"solid",strokeWidth:2,type:"ellipse",x:t+s+16,y:n+l-24,width:Wd,height:Wd}))})),f=e.values.map(((e,r)=>{const s=44*r+6,l=e/i*Vd+6+Wd;return oi(Object.assign(Object.assign({backgroundColor:a,groupIds:[o]},Qd),{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[...ru(e,t,n,o,a,"production"===r.Vi.DEVELOPMENT),p,...f,...g]})(t,n,i):((e,t,n)=>{const i=Math.max(...e.values),o=Rr(),a=$d[Math.floor(Math.random()*$d.length)];return[...e.values.map(((e,r)=>{const s=e/i*Vd;return ti(Object.assign(Object.assign({backgroundColor:a,groupIds:[o]},Qd),{type:"rectangle",x:t+44*r+Wd,y:n-s-Wd,width:Kd,height:s}))})),...ru(e,t,n,o,a,"production"===r.Vi.DEVELOPMENT)]})(t,n,i);let ou="",au=!1;const su="clipboard"in navigator&&"readText"in navigator.clipboard,lu="clipboard"in navigator&&"writeText"in navigator.clipboard,cu="clipboard"in navigator&&"write"in navigator.clipboard&&"ClipboardItem"in window&&"toBlob"in HTMLCanvasElement.prototype,du=()=>{if(!ou)return{};try{return JSON.parse(ou)}catch(e){return console.error(e),{}}},uu=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:Gd,reason:"No values"};const n=t[0].length,r=t.every((e=>e.length===n));if(!r)return{type:Gd,reason:"All rows don't have same number of columns"};const i=qd(t);if(i.type!==Yd){const e=qd((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===Yd)return e}return i})(e);return t.type===Yd?{spreadsheet:t.spreadsheet}:null},hu=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():su&&await navigator.clipboard.readText())||""}catch(e){return""}})(e);if(!t||t.includes(Nd))return du();const n=uu(t);if(n)return n;const i=du();try{const e=JSON.parse(t);return o=e,[r.r8.excalidraw,r.r8.excalidrawClipboard].includes(null==o?void 0:o.type)&&Array.isArray(o.elements)?{elements:e.elements,files:e.files}:i}catch(e){return au&&i.elements?i:{text:t}}var o},pu=async e=>{let t=!1;if(lu)try{await navigator.clipboard.writeText(e||""),t=!0}catch(e){console.error(e)}if(!t&&!gu(e||" "))throw new Error("couldn't copy")},gu=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},fu=async(e,t,i,o,a)=>{let{exportBackground:s,exportPadding:l=r.qy,viewBackgroundColor:c,name:d,fileHandle:u=null}=a;if(0===t.length)throw new Error(m("alerts.cannotExportEmptyCanvas"));if("svg"===e||"clipboard-svg"===e){const n=await Fd(t,{exportBackground:s,exportWithDarkMode:i.exportWithDarkMode,viewBackgroundColor:c,exportPadding:l,exportScale:i.exportScale,exportEmbedScene:i.exportEmbedScene&&"svg"===e},o);if("svg"===e)return await dd(new Blob([n.outerHTML],{type:r.LO.svg}),{description:"Export to SVG",name:d,extension:i.exportEmbedScene?"excalidraw.svg":"svg",fileHandle:u});if("clipboard-svg"===e)return void await pu(n.outerHTML)}const h=await Hd(t,i,o,{exportBackground:s,viewBackgroundColor:c,exportPadding:l});if(h.style.display="none",document.body.appendChild(h),"png"===e){let e=await Cd(h);return h.remove(),i.exportEmbedScene&&(e=await(await Promise.resolve().then(n.bind(n,673))).encodePngMetadata({blob:e,metadata:Od(t,i,o,"local")})),await dd(e,{description:"Export to PNG",name:d,extension:i.exportEmbedScene?"excalidraw.png":"png",fileHandle:u})}if("clipboard"!==e)throw h.remove(),new Error("Unsupported export type");try{const e=Cd(h);await(async e=>{let t;try{t=navigator.clipboard.write([new window.ClipboardItem({[r.LO.png]:e})])}catch(t){if(!fn(e))throw t;await navigator.clipboard.write([new window.ClipboardItem({[r.LO.png]:await e})])}await t})(e)}catch(e){if("CANVAS_POSSIBLY_TOO_BIG"===e.name)throw e;throw new Error(m("alerts.couldNotCopyToClipboard"))}finally{h.remove()}};n(7225);const mu=e=>{let{children:t,checked:n,onChange:r,className:i}=e;return(0,b.jsxs)("div",{className:xe("Checkbox",i,{"is-checked":n}),onClick:e=>{r(!n,e),e.currentTarget.querySelector(".Checkbox-box").focus()},children:[(0,b.jsx)("button",{className:"Checkbox-box",role:"checkbox","aria-checked":n,children:Ea}),(0,b.jsx)("div",{className:"Checkbox-label",children:t})]})};n(4623);const bu=e=>{let{children:t,gap:n,align:r,justifyContent:i,className:o,style:a}=e;return(0,b.jsx)("div",{className:xe("Stack Stack_horizontal",o),style:Object.assign({"--gap":n,alignItems:r,justifyContent:i},a),children:t})},vu=e=>{let{children:t,gap:n,align:r,justifyContent:i,className:o}=e;return(0,b.jsx)("div",{className:xe("Stack Stack_vertical",o),style:{"--gap":n,justifyItems:r,justifyContent:i},children:t})};n(554);const yu=e=>{let{fileName:t,onSave:n}=e;return(0,b.jsxs)(bu,{className:"ActiveFile",gap:1,align:"center",children:[(0,b.jsxs)("span",{className:"ActiveFile__fileName",children:[rs,(0,b.jsx)("span",{children:t})]}),(0,b.jsx)(il,{type:"icon",icon:Sa,title:m("buttons.save"),"aria-label":m("buttons.save"),onClick:n,"data-testid":"save-button"})]})},xu=(qs({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,b.jsx)(ac,{label:m("labels.fileTitle"),value:t.name||"Unnamed",onChange:e=>n(e),isNameEditable:void 0===r.name&&!t.viewModeEnabled})}}),qs({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:i}=e;const o=Ml(t),a=zl(o,n)?Bl(o,n):o;return(0,b.jsx)(b.Fragment,{children:r.ZB.map((e=>{const[t,o]=((e,t,n)=>{const[,,r,i]=Ud(e,t).map((e=>Math.trunc(e*n)));return[r,i]})(a,r.qy,e),s="".concat(m("buttons.scale")," ").concat(e,"x (").concat(t,"x").concat(o,")");return(0,b.jsx)(il,{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:()=>i(e)},e)}))})}}),qs({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,b.jsx)(mu,{checked:t.exportBackground,onChange:e=>n(e),children:m("labels.withBackground")})}}),qs({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,b.jsxs)(mu,{checked:t.exportEmbedScene,onChange:e=>n(e),children:[m("labels.exportEmbedScene"),(0,b.jsx)(pl,{label:m("labels.exportEmbedScene_details"),long:!0,children:(0,b.jsx)("div",{className:"excalidraw-tooltip-icon",children:Ha})})]})}}),qs({name:"saveToActiveFile",trackEvent:{category:"export"},perform:async(e,t,n,r)=>{const i=!!t.fileHandle;try{const{fileHandle:n}=wd(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 fu(s,Ml(e),t,n,{exportBackground:r,viewBackgroundColor:i,name:o,fileHandle:a}),{fileHandle:a}})(e,t,r.files):await Ad(e,t,r.files);return{commitToHistory:!1,appState:Object.assign(Object.assign({},t),{fileHandle:n,toastMessage:i?null!=n&&n.name?m("toast.fileSavedToFilename").replace("{filename}",'"'.concat(n.name,'"')):m("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===At.S&&e[At.CTRL_OR_CMD]&&!e.shiftKey,PanelComponent:e=>{var t;let{updateData:n,appState:r}=e;return(0,b.jsx)(yu,{onSave:()=>n(null),fileName:null===(t=r.fileHandle)||void 0===t?void 0:t.name})}}),qs({name:"saveFileToDisk",trackEvent:{category:"export"},perform:async(e,t,n,r)=>{try{const{fileHandle:n}=await Ad(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===At.S&&e.shiftKey&&e[At.CTRL_OR_CMD],PanelComponent:e=>{let{updateData:t}=e;return(0,b.jsx)(il,{type:"button",icon:Ia,title:m("buttons.saveAs"),"aria-label":m("buttons.saveAs"),showAriaLabel:hg().isMobile,hidden:!ad,onClick:()=>t(null),"data-testid":"save-as-button"})}}));qs({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 cd({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[At.CTRL_OR_CMD]&&e.key===At.O,PanelComponent:e=>{let{updateData:t,appState:n}=e;return(0,b.jsx)(il,{type:"button",icon:ja,title:m("buttons.load"),"aria-label":m("buttons.load"),showAriaLabel:hg().isMobile,onClick:t,"data-testid":"load-button"})}}),qs({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,b.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"-45px",marginBottom:"10px"},children:(0,b.jsx)(ol,{value:t.exportWithDarkMode?r.C6.DARK:r.C6.LIGHT,onChange:e=>{n(e===r.C6.DARK)},title:m("labels.toggleExportColorScheme")})})}});let wu="{}";const _u=qs({name:"copyStyles",trackEvent:{category:"element"},perform:(e,t)=>{const n=e.find((e=>t.selectedElementIds[e.id]));return n&&(wu=JSON.stringify(n)),{appState:Object.assign(Object.assign({},t),{toastMessage:m("toast.copyStyles")}),commitToHistory:!1}},contextItemLabel:"labels.copyStyles",keyTest:e=>e[At.CTRL_OR_CMD]&&e.altKey&&e.code===kt}),ku=qs({name:"pasteStyles",trackEvent:{category:"element"},perform:(e,t)=>{const n=JSON.parse(wu);return"text"!==(null==(i=n)?void 0:i.type)&&"diamond"!==(null==i?void 0:i.type)&&"rectangle"!==(null==i?void 0:i.type)&&"ellipse"!==(null==i?void 0:i.type)&&"arrow"!==(null==i?void 0:i.type)&&"freedraw"!==(null==i?void 0:i.type)&&"line"!==(null==i?void 0:i.type)?{elements:e,commitToHistory:!1}:{elements:e.map((e=>{if(t.selectedElementIds[e.id]){const t=Nr(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 Ee(t)&&Ee(e)&&(Br(t,{fontSize:(null==n?void 0:n.fontSize)||r.n5,fontFamily:(null==n?void 0:n.fontFamily)||r.rk,textAlign:(null==n?void 0:n.textAlign)||r.Hg}),Wn(t,ar(t))),t}return e})),commitToHistory:!0};var i},contextItemLabel:"labels.pasteStyles",keyTest:e=>e[At.CTRL_OR_CMD]&&e.altKey&&e.code===jt}),Eu=e=>(0,b.jsx)("button",{className:"help-icon",onClick:e.onClick,type:"button",title:"".concat(e.title," — ?"),"aria-label":e.title,children:Ha}),Cu=(qs({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,b.jsx)(il,{type:"button",icon:Ra,"aria-label":m("buttons.menu"),onClick:n,selected:"canvas"===t.openMenu})}}),qs({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,b.jsx)(il,{visible:Il(n,Ml(t)),type:"button",icon:Oa,"aria-label":m("buttons.edit"),onClick:r,selected:"shape"===n.openMenu})}}),qs({name:"toggleFullScreen",trackEvent:{category:"canvas",predicate:e=>!$t()},perform:()=>($t()||document.documentElement.requestFullscreen(),$t()&&document.exitFullscreen(),{commitToHistory:!1}),keyTest:e=>e.code===St&&!e[At.CTRL_OR_CMD]}),qs({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,b.jsx)(Eu,{title:m("helpDialog.title"),onClick:t})},keyTest:e=>e.key===At.QUESTION_MARK}),(e,t)=>{const n=Bl(Ml(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)}),Su=qs({name:"group",trackEvent:{category:"element"},perform:(e,t)=>{const n=Bl(Ml(e),t,!0);if(n.length<2)return{appState:t,elements:e,commitToHistory:!1};const r=Yr(t);if(1===r.length){const i=r[0],o=new Set(qr(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=Rr(),o=un(n),a=e.map((e=>o.get(e.id)?Nr(e,{groupIds:$r(e.groupIds,i,t.editingGroupId)}):e)),s=qr(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:{}}),Ml(u)),elements:u,commitToHistory:!0}},contextItemLabel:"labels.group",contextItemPredicate:(e,t)=>Cu(e,t),keyTest:e=>!e.shiftKey&&e[At.CTRL_OR_CMD]&&e.code===Ct,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,b.jsx)(il,{hidden:!Cu(t,n),type:"button",icon:(0,b.jsx)(is,{theme:n.theme}),onClick:()=>r(null),title:"".concat(m("labels.group")," — ").concat(Qt("CtrlOrCmd+G")),"aria-label":m("labels.group"),visible:zl(Ml(t),n)})}}),Iu=qs({name:"ungroup",trackEvent:{category:"element"},perform:(e,t)=>{if(0===Yr(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:Nr(e,{groupIds:r})})),i=Zr(Object.assign(Object.assign({},t),{selectedGroupIds:{}}),Ml(r));return n.forEach((e=>i.selectedElementIds[e]=!1)),{appState:i,elements:r,commitToHistory:!0}},keyTest:e=>e.shiftKey&&e[At.CTRL_OR_CMD]&&e.code===Ct,contextItemLabel:"labels.ungroup",contextItemPredicate:(e,t)=>Yr(t).length>0,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,b.jsx)(il,{type:"button",hidden:0===Yr(n).length,icon:(0,b.jsx)(os,{theme:n.theme}),onClick:()=>r(null),title:"".concat(m("labels.ungroup")," — ").concat(Qt("CtrlOrCmd+Shift+G")),"aria-label":m("labels.ungroup"),visible:zl(Ml(t),n)})}});n(2789);const ju=e=>{let{children:t,color:n,border:r,onClick:i}=e;return(0,b.jsx)("div",{className:"Avatar",style:{background:n,border:"2px solid ".concat(r)},onClick:i,children:t})},Tu=(qs({name:"goToCollaborator",trackEvent:{category:"collab"},perform:(e,t,n)=>{const r=n;return r?{appState:Object.assign(Object.assign(Object.assign({},t),sl({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}=sc(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,b.jsx)(ju,{color:a,border:l?"transparent":s,onClick:()=>n(o.pointer),children:l?(0,b.jsx)("img",{referrerPolicy:"no-referrer",src:l,alt:c}):c})}}),qs({name:"addToLibrary",trackEvent:{category:"element"},perform:(e,t,n,r)=>{const i=Bl(Ml(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:Rr(),status:"unpublished",elements:i.map(ai),created:Date.now()},...e]))).then((()=>({commitToHistory:!1,appState:Object.assign(Object.assign({},t),{toastMessage:m("toast.addedToLibrary")})}))).catch((e=>({commitToHistory:!1,appState:Object.assign(Object.assign({},t),{errorMessage:e.message})})))},contextItemLabel:"labels.addToLibrary"})),Mu=(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})},Ou=(e,t)=>Bl(Ml(e),t).length>1,Au=(e,t,n)=>{const r=((e,t)=>{const n=Qr(e),r=rt(e);return n.flatMap((e=>{const n=Mu(e,r,t);return e.map((e=>Nr(e,{x:e.x+n.x,y:e.y+n.y})))}))})(Bl(Ml(e),t),n),i=un(r);return e.map((e=>i.get(e.id)||e))},Lu=(qs({name:"alignTop",trackEvent:{category:"element"},perform:(e,t)=>({appState:t,elements:Au(e,t,{position:"start",axis:"y"}),commitToHistory:!0}),keyTest:e=>e[At.CTRL_OR_CMD]&&e.shiftKey&&e.key===At.ARROW_UP,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,b.jsx)(il,{hidden:!Ou(t,n),type:"button",icon:(0,b.jsx)(Va,{theme:n.theme}),onClick:()=>r(null),title:"".concat(m("labels.alignTop")," — ").concat(Qt("CtrlOrCmd+Shift+Up")),"aria-label":m("labels.alignTop"),visible:zl(Ml(t),n)})}}),qs({name:"alignBottom",trackEvent:{category:"element"},perform:(e,t)=>({appState:t,elements:Au(e,t,{position:"end",axis:"y"}),commitToHistory:!0}),keyTest:e=>e[At.CTRL_OR_CMD]&&e.shiftKey&&e.key===At.ARROW_DOWN,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,b.jsx)(il,{hidden:!Ou(t,n),type:"button",icon:(0,b.jsx)(Ga,{theme:n.theme}),onClick:()=>r(null),title:"".concat(m("labels.alignBottom")," — ").concat(Qt("CtrlOrCmd+Shift+Down")),"aria-label":m("labels.alignBottom"),visible:zl(Ml(t),n)})}}),qs({name:"alignLeft",trackEvent:{category:"element"},perform:(e,t)=>({appState:t,elements:Au(e,t,{position:"start",axis:"x"}),commitToHistory:!0}),keyTest:e=>e[At.CTRL_OR_CMD]&&e.shiftKey&&e.key===At.ARROW_LEFT,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,b.jsx)(il,{hidden:!Ou(t,n),type:"button",icon:(0,b.jsx)(Ya,{theme:n.theme}),onClick:()=>r(null),title:"".concat(m("labels.alignLeft")," — ").concat(Qt("CtrlOrCmd+Shift+Left")),"aria-label":m("labels.alignLeft"),visible:zl(Ml(t),n)})}}),qs({name:"alignRight",trackEvent:{category:"element"},perform:(e,t)=>({appState:t,elements:Au(e,t,{position:"end",axis:"x"}),commitToHistory:!0}),keyTest:e=>e[At.CTRL_OR_CMD]&&e.shiftKey&&e.key===At.ARROW_RIGHT,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,b.jsx)(il,{hidden:!Ou(t,n),type:"button",icon:(0,b.jsx)(Za,{theme:n.theme}),onClick:()=>r(null),title:"".concat(m("labels.alignRight")," — ").concat(Qt("CtrlOrCmd+Shift+Right")),"aria-label":m("labels.alignRight"),visible:zl(Ml(t),n)})}}),qs({name:"alignVerticallyCentered",trackEvent:{category:"element"},perform:(e,t)=>({appState:t,elements:Au(e,t,{position:"center",axis:"y"}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,b.jsx)(il,{hidden:!Ou(t,n),type:"button",icon:(0,b.jsx)($a,{theme:n.theme}),onClick:()=>r(null),title:m("labels.centerVertically"),"aria-label":m("labels.centerVertically"),visible:zl(Ml(t),n)})}}),qs({name:"alignHorizontallyCentered",trackEvent:{category:"element"},perform:(e,t)=>({appState:t,elements:Au(e,t,{position:"center",axis:"x"}),commitToHistory:!0}),PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,b.jsx)(il,{hidden:!Ou(t,n),type:"button",icon:(0,b.jsx)(Qa,{theme:n.theme}),onClick:()=>r(null),title:m("labels.centerHorizontally"),"aria-label":m("labels.centerHorizontally"),visible:zl(Ml(t),n)})}}),(e,t)=>Bl(Ml(e),t).length>1),Pu=(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=Qr(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=>Nr(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=>Nr(e,{x:e.x+a.x,y:e.y+a.y})))}))})(Bl(Ml(e),t),n),i=un(r);return e.map((e=>i.get(e.id)||e))},Du=(qs({name:"distributeHorizontally",trackEvent:{category:"element"},perform:(e,t)=>({appState:t,elements:Pu(e,t,{space:"between",axis:"x"}),commitToHistory:!0}),keyTest:e=>!e[At.CTRL_OR_CMD]&&e.altKey&&e.code===It,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,b.jsx)(il,{hidden:!Lu(t,n),type:"button",icon:(0,b.jsx)(Xa,{theme:n.theme}),onClick:()=>r(null),title:"".concat(m("labels.distributeHorizontally")," — ").concat(Qt("Alt+H")),"aria-label":m("labels.distributeHorizontally"),visible:zl(Ml(t),n)})}}),qs({name:"distributeVertically",trackEvent:{category:"element"},perform:(e,t)=>({appState:t,elements:Pu(e,t,{space:"between",axis:"y"}),commitToHistory:!0}),keyTest:e=>!e[At.CTRL_OR_CMD]&&e.altKey&&e.code===jt,PanelComponent:e=>{let{elements:t,appState:n,updateData:r}=e;return(0,b.jsx)(il,{hidden:!Lu(t,n),type:"button",icon:(0,b.jsx)(qa,{theme:n.theme}),onClick:()=>r(null),title:"".concat(m("labels.distributeVertically")," — ").concat(Qt("Alt+V")),"aria-label":m("labels.distributeVertically"),visible:zl(Ml(t),n)})}}),qs({name:"flipHorizontal",trackEvent:{category:"element"},perform:(e,t)=>({elements:Ru(e,t,"horizontal"),appState:t,commitToHistory:!0}),keyTest:e=>e.shiftKey&&"KeyH"===e.code,contextItemLabel:"labels.flipHorizontal",contextItemPredicate:(e,t)=>((e,t)=>{const n=Bl(Ml(e),t);return 1===n.length&&"text"!==n[0].type})(e,t)})),zu=qs({name:"flipVertical",trackEvent:{category:"element"},perform:(e,t)=>({elements:Ru(e,t,"vertical"),appState:t,commitToHistory:!0}),keyTest:e=>e.shiftKey&&"KeyV"===e.code,contextItemLabel:"labels.flipVertical",contextItemPredicate:(e,t)=>((e,t)=>1===Bl(Ml(e),t).length)(e,t)}),Ru=(e,t,n)=>{const r=Bl(Ml(e),t);if(r.length>1)return e;const i=Bu(r,t,n),o=un(i);return e.map((e=>o.get(e.id)||e))},Bu=(e,t,n)=>(e.forEach((e=>{Nu(e,t),"vertical"===n&&Hu(e,Math.PI)})),e),Nu=(e,t)=>{const n=e.x,r=e.y,i=e.width,o=e.height,a=ea(e.angle);let s=0;(Ie(e)||Ce(e))&&(s=2*e.points.reduce(((e,t)=>Math.max(e,t[0])),0)-e.width),Br(e,{angle:ea(0)});const l=fi(e,t.zoom);let c=!0,d=0,u=l.nw;if(!u&&(c=!1,u=l.ne,!u))return void Br(e,{angle:a});if(Ie(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,aa((new Map).set(e.id,e),!0,e,c?"nw":"ne",!1,d,u[1]),Br(e,{width:i,height:o});let h=ea(2*Math.PI-a);h<0&&(h=ea(h+2*Math.PI)),Br(e,{angle:h}),Br(e,{x:n+s,y:r}),No(e)},Hu=(e,t)=>{const n=e.x,r=e.y;let i=ea(e.angle+t);i<0&&(i=ea(2*Math.PI+i)),Br(e,{angle:i}),Br(e,{x:n,y:r})},Fu=qs({name:"copy",trackEvent:{category:"element"},perform:(e,t,n,i)=>((async(e,t,n)=>{const i=Bl(e,t,!0),o={type:r.r8.excalidrawClipboard,elements:i,files:i.reduce(((e,t)=>(_e(t)&&n[t.fileId]&&(e[t.fileId]=n[t.fileId]),e)),{})},a=JSON.stringify(o);ou=a;try{au=!1,await pu(a)}catch(e){au=!0,console.error(e)}})(Ml(e),t,i.files),{commitToHistory:!1}),contextItemLabel:"labels.copy",keyTest:void 0}),Uu=qs({name:"cut",trackEvent:{category:"element"},perform:(e,t,n,r)=>(Fu.perform(e,t,n,r),Fl.perform(e,t)),contextItemLabel:"labels.cut",keyTest:e=>e[At.CTRL_OR_CMD]&&e.code===Tt}),Ku=qs({name:"copyAsSvg",trackEvent:{category:"element"},perform:async(e,t,n,r)=>{if(!r.canvas)return{commitToHistory:!1};const i=Bl(Ml(e),t,!0);try{return await fu("clipboard-svg",i.length?i:Ml(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"}),Wu=qs({name:"copyAsPng",trackEvent:{category:"element"},perform:async(e,t,n,r)=>{if(!r.canvas)return{commitToHistory:!1};const i=Bl(Ml(e),t,!0);try{return await fu("clipboard",i.length?i:Ml(e),t,r.files,t),{appState:Object.assign(Object.assign({},t),{toastMessage:m("toast.copyToClipboardAsPng",{exportSelection:i.length?m("toast.selection"):m("toast.canvas"),exportColorScheme:t.exportWithDarkMode?m("buttons.darkMode"):m("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===kt&&e.altKey&&e.shiftKey}),Vu=qs({name:"copyText",trackEvent:{category:"element"},perform:(e,t)=>{const n=Bl(Ml(e),t,!0).reduce(((e,t)=>(Ee(t)&&e.push(t.text),e)),[]).join("\n\n");return pu(n),{commitToHistory:!1}},contextItemPredicate:(e,t)=>lu&&Bl(e,t,!0).some(Ee),contextItemLabel:"labels.copyText"}),Gu=qs({name:"gridMode",trackEvent:{category:"canvas",predicate:e=>!e.gridSize},perform(e,t){return{appState:Object.assign(Object.assign({},t),{gridSize:this.checked(t)?null:r.k}),commitToHistory:!1}},checked:e=>null!==e.gridSize,contextItemLabel:"labels.showGrid",keyTest:e=>e[At.CTRL_OR_CMD]&&e.code===xt}),Yu=qs({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[At.CTRL_OR_CMD]&&e.altKey&&e.code===Mt}),Zu=qs({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[At.CTRL_OR_CMD]&&e.altKey&&e.code===_t}),Xu=qs({name:"unbindText",contextItemLabel:"labels.unbindText",trackEvent:{category:"element"},contextItemPredicate:(e,t)=>Bl(e,t).some((e=>Le(e))),perform:(e,t)=>(Bl(Ml(e),t).forEach((e=>{const t=or(e);if(t){var n;const{width:r,height:i,baseline:o}=Yn(t.originalText,Ut(t));Br(t,{containerId:null,width:r,height:i,baseline:o,text:t.originalText}),Br(e,{boundElements:null===(n=e.boundElements)||void 0===n?void 0:n.filter((e=>e.id!==t.id))})}})),{elements:e,appState:t,commitToHistory:!0})}),qu=qs({name:"bindText",contextItemLabel:"labels.bindText",trackEvent:{category:"element"},contextItemPredicate:(e,t)=>{const n=Bl(e,t);if(2===n.length){const e=Ee(n[0])||Ee(n[1]);let t;if(Ae(n[0])?t=n[0]:Ae(n[1])&&(t=n[1]),e&&t&&null===or(t))return!0}return!1},perform:(e,t)=>{const n=Bl(Ml(e),t);let i,o;Ee(n[0])&&Ae(n[1])?(i=n[0],o=n[1]):(i=n[1],o=n[0]),Br(i,{containerId:o.id,verticalAlign:r.oX.MIDDLE}),Br(o,{boundElements:(o.boundElements||[]).concat({type:"text",id:i.id})}),Wn(i,o);const a=e.slice(),s=a.findIndex((e=>e.id===i.id));a.splice(s,1);const l=a.findIndex((e=>e.id===o.id));return a.splice(l+1,0,i),{elements:a,appState:Object.assign(Object.assign({},t),{selectedElementIds:{[o.id]:!0}}),commitToHistory:!0}}}),$u=qs({name:"toggleLock",trackEvent:{category:"element"},perform:(e,t)=>{const n=Bl(e,t,!0);if(!n.length)return!1;const r=Qu(n),i=un(n);return{elements:e.map((e=>i.has(e.id)?Nr(e,{locked:"lock"===r}):e)),appState:t,commitToHistory:!0}},contextItemLabel:(e,t)=>{const n=Bl(e,t,!1);if(1===n.length)return n[0].locked?"labels.elementLock.unlock":"labels.elementLock.lock";if(n.length>1)return"lock"===Qu(n)?"labels.elementLock.lockAll":"labels.elementLock.unlockAll";throw new Error("Unexpected zero elements to lock/unlock. This should never happen.")},keyTest:(e,t,n)=>e.key.toLocaleLowerCase()===At.L&&e[At.CTRL_OR_CMD]&&e.shiftKey&&Bl(n,t,!1).length>0}),Qu=e=>e.some((e=>!e.locked))?"lock":"unlock",Ju=(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=>Nr(o.get(e.id)||e,e))).concat(l.map((e=>Nr(e,{isDeleted:!0}))));return $o(c,l),{elements:c,appState:Object.assign(Object.assign({},t),i.appState),commitToHistory:r,syncHistory:!0}}return{commitToHistory:r}},eh=(e,t,n,r,i,o)=>{if(e.trackEvent)try{if("object"==typeof e.trackEvent){(!e.trackEvent.predicate||e.trackEvent.predicate(n,r,o))&&uc(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 th{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=>{eh(n,"ui",o,i,this.app,e),this.updater(n.perform(this.getElementsIncludingDeleted(),this.getAppState(),e,this.app))};return(0,b.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 i=n[0],{viewModeEnabled:o}=this.getAppState();if(o&&!Object.values(r.EH).includes(n[0].name))return!1;const a=this.getElementsIncludingDeleted(),s=this.getAppState();return eh(i,"keyboard",s,a,this.app,null),e.preventDefault(),e.stopPropagation(),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();eh(e,t,r,n,this.app,null),this.updater(e.perform(n,r,null,this.app))}}const nh=Symbol(),rh=e=>!!e[nh],ih=e=>{var t,n;null==(n=(t=e[nh]).c)||n.call(t)},oh=(e,t)=>{const n=e[nh].o,r=t[nh].o;return n===r||e===r||rh(n)&&oh(n,t)},ah=e=>{const t={o:e,c:null},n=new Promise((n=>{t.c=()=>{t.c=null,n()},e.then(t.c,t.c)}));return n[nh]=t,n};var sh=Object.defineProperty,lh=Object.defineProperties,ch=Object.getOwnPropertyDescriptors,dh=Object.getOwnPropertySymbols,uh=Object.prototype.hasOwnProperty,hh=Object.prototype.propertyIsEnumerable,ph=(e,t,n)=>t in e?sh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const gh=e=>"init"in e,fh="r",mh="w",bh="c",vh="s",yh=e=>{const t=new WeakMap,n=new WeakMap,r=new Map;let i,o;if(i=new Set,o=new Set,e)for(const[n,r]of e){const e={v:r,r:0,d:new Map};Object.freeze(e),gh(n)||console.warn("Found initial value for derived atom which can cause unexpected behavior",n),t.set(n,e)}const a=new WeakMap,s=new WeakMap,l=e=>{let t=s.get(e);return t||(t=new Map,s.set(e,t)),t},c=(e,n)=>{if(e){const t=l(e);let r=t.get(n);return r||(r=c(e.p,n),r&&("p"in r&&r.p.then((()=>t.delete(n))),t.set(n,r))),r}return t.get(n)},d=(e,n,i)=>{if(Object.freeze(i),e){l(e).set(n,i)}else{const e=t.get(n);t.set(n,i),r.has(n)||r.set(n,e)}},u=(e,t=new Map,n)=>{if(!n)return t;const r=new Map;let i=!1;return n.forEach((n=>{var o;const a=(null==(o=c(e,n))?void 0:o.r)||0;r.set(n,a),t.get(n)!==a&&(i=!0)})),t.size!==r.size||i?r:t},h=(e,t,n,r,i)=>{const o=c(e,t);if(o){if(i&&(!("p"in o)||!oh(o.p,i)))return o;"p"in o&&ih(o.p)}const a={v:n,r:(null==o?void 0:o.r)||0,d:u(e,null==o?void 0:o.d,r)};return o&&"v"in o&&Object.is(o.v,n)?a.d===o.d||a.d.size===o.d.size&&Array.from(a.d.keys()).every((e=>o.d.has(e)))||Promise.resolve().then((()=>{S(e)})):(++a.r,a.d.has(t)&&(a.d=new Map(a.d).set(t,a.r))),d(e,t,a),a},p=(e,t,n,r,i)=>{const o=c(e,t);if(o){if(i&&(!("p"in o)||!oh(o.p,i)))return o;"p"in o&&ih(o.p)}const a={e:n,r:(null==o?void 0:o.r)||0,d:u(e,null==o?void 0:o.d,r)};return d(e,t,a),a},g=(e,t,n,r)=>{const i=c(e,t);if(i&&"p"in i){if(oh(i.p,n))return i;ih(i.p)}((e,t,n)=>{let r=a.get(t);r||(r=new Map,a.set(t,r)),n.then((()=>{r.get(e)===n&&(r.delete(e),r.size||a.delete(t))})),r.set(e,n)})(e,t,n);const o={p:n,r:(null==i?void 0:i.r)||0,d:u(e,null==i?void 0:i.d,r)};return d(e,t,o),o},f=(e,t,n,r)=>{if(n instanceof Promise){const i=ah(n.then((n=>{h(e,t,n,r,i),S(e)})).catch((n=>{if(n instanceof Promise)return rh(n)?n.then((()=>{b(e,t,!0)})):n;p(e,t,n,r,i),S(e)})));return g(e,t,i,r)}return h(e,t,n,r)},m=(e,t)=>{const n=c(e,t);if(n){"p"in n&&ih(n.p);const r=((e,t)=>lh(e,ch(t)))(((e,t)=>{for(var n in t||(t={}))uh.call(t,n)&&ph(e,n,t[n]);if(dh)for(var n of dh(t))hh.call(t,n)&&ph(e,n,t[n]);return e})({},n),{i:n.r});d(e,t,r)}else console.warn("[Bug] could not invalidate non existing atom",t)},b=(e,t,r)=>{if(!r){const r=c(e,t);if(r){if(r.r!==r.i&&"p"in r&&r.p[nh].c)return r;if(r.d.forEach(((r,i)=>{if(i!==t)if(n.has(i)){const t=c(e,i);t&&t.r===t.i&&b(e,i)}else b(e,i)})),Array.from(r.d).every((([t,n])=>{const r=c(e,t);return r&&"v"in r&&r.r===n})))return r}}const i=new Set;try{const n=t.read((n=>{i.add(n);const r=n===t?c(e,n):b(e,n);if(r){if("e"in r)throw r.e;if("p"in r)throw r.p;return r.v}if(gh(n))return n.init;throw new Error("no atom init")}));return f(e,t,n,i)}catch(n){if(n instanceof Promise){const r=ah(n);return g(e,t,r,i)}return p(e,t,n,i)}},v=(e,t)=>b(t,e),y=(e,t)=>!t.l.size&&(!t.t.size||1===t.t.size&&t.t.has(e)),x=(e,t)=>{const r=n.get(t);null==r||r.t.forEach((n=>{n!==t&&(m(e,n),x(e,n))}))},w=(e,t,n)=>{let r=!0;const i=(t,n)=>{const r=b(e,t);if("e"in r)throw r.e;if("p"in r){if(null==n?void 0:n.unstable_promise)return r.p.then((()=>i(t,n)));throw console.info("Reading pending atom state in write operation. We throw a promise for now.",t),r.p}if("v"in r)return r.v;throw console.warn("[Bug] no value found while reading atom in write operation. This is probably a bug.",t),new Error("no value found")},o=t.write(i,((n,i)=>{let o;if(n===t){if(!gh(n))throw new Error("atom not writable");const t=(e=>{const t=new Set,n=a.get(e);return n&&(a.delete(e),n.forEach(((e,n)=>{ih(e),t.add(n)}))),t})(n);t.forEach((t=>{t!==e&&f(t,n,i)})),f(e,n,i),x(e,n)}else o=w(e,n,i);return r||S(e),o}),n);return r=!1,e=void 0,o},_=(e,t,n)=>{const r=w(n,e,t);return S(n),r},k=(e,t)=>{const r={t:new Set(t&&[t]),l:new Set};n.set(e,r),o.add(e);if(b(void 0,e).d.forEach(((t,r)=>{const i=n.get(r);i?i.t.add(e):r!==e&&k(r,e)})),(e=>!!e.write)(e)&&e.onMount){const t=t=>_(e,t),n=e.onMount(t);n&&(r.u=n)}return r},E=e=>{var t;const r=null==(t=n.get(e))?void 0:t.u;r&&r(),n.delete(e),o.delete(e);const i=c(void 0,e);i?i.d.forEach(((t,r)=>{if(r!==e){const t=n.get(r);t&&(t.t.delete(e),y(r,t)&&E(r))}})):console.warn("[Bug] could not find atom state to unmount",e)},C=(e,t,r)=>{const i=new Set(t.d.keys());null==r||r.forEach(((t,r)=>{if(i.has(r))return void i.delete(r);const o=n.get(r);o&&(o.t.delete(e),y(r,o)&&E(r))})),i.forEach((t=>{const r=n.get(t);r?r.t.add(e):n.has(e)&&k(t,e)}))},S=e=>{if(e){l(e).forEach(((r,i)=>{if(r!==t.get(i)){const t=n.get(i);null==t||t.l.forEach((t=>t(e)))}}))}else{for(;r.size;){const e=Array.from(r);r.clear(),e.forEach((([e,t])=>{const r=c(void 0,e);r&&r.d!==(null==t?void 0:t.d)&&C(e,r,null==t?void 0:t.d);const i=n.get(e);null==i||i.l.forEach((e=>e()))}))}i.forEach((e=>e()))}},I=(e,n)=>{n&&(e=>{l(e).forEach(((e,n)=>{const r=t.get(n);(e.r>((null==r?void 0:r.r)||0)||"v"in e&&e.r===(null==r?void 0:r.r)&&e.d!==(null==r?void 0:r.d))&&(t.set(n,e),e.d!==(null==r?void 0:r.d)&&C(n,e,null==r?void 0:r.d))}))})(n),S(void 0)},j=(e,t)=>{const r=(e=>{let t=n.get(e);return t||(t=k(e)),t})(e).l;return r.add(t),()=>{r.delete(t),(e=>{const t=n.get(e);t&&y(e,t)&&E(e)})(e)}},T=(e,t)=>{for(const[n,r]of e)gh(n)&&(f(t,n,r),x(t,n));S(t)};return{[fh]:v,[mh]:_,[bh]:I,[vh]:j,h:T,n:e=>(i.add(e),()=>{i.delete(e)}),l:()=>o.values(),a:e=>t.get(e),m:e=>n.get(e)}},xh=(e,t)=>({s:t?t(e).SECRET_INTERNAL_store:yh(e)}),wh=new Map,_h=e=>(wh.has(e)||wh.set(e,(0,i.createContext)(xh())),wh.get(e));var kh=Object.defineProperty,Eh=Object.defineProperties,Ch=Object.getOwnPropertyDescriptors,Sh=Object.getOwnPropertySymbols,Ih=Object.prototype.hasOwnProperty,jh=Object.prototype.propertyIsEnumerable,Th=(e,t,n)=>t in e?kh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mh=(e,t)=>{for(var n in t||(t={}))Ih.call(t,n)&&Th(e,n,t[n]);if(Sh)for(var n of Sh(t))jh.call(t,n)&&Th(e,n,t[n]);return e},Oh=(e,t)=>Eh(e,Ch(t));const Ah=e=>e.debugLabel||e.toString(),Lh=([e,t])=>Object.fromEntries(t.flatMap((t=>{var n,r;const i=null==(n=e.m)?void 0:n.call(e,t);if(!i)return[];const o=i.t,a=(null==(r=e.a)?void 0:r.call(e,t))||{};return[[Ah(t),Oh(Mh(Mh(Mh({},"e"in a&&{error:a.e}),"p"in a&&{promise:a.p}),"v"in a&&{value:a.v}),{dependents:Array.from(o).map(Ah)})]]}))),Ph=({children:e,initialValues:t,scope:n,unstable_createStore:r,unstable_enableVersionedWrite:o})=>{const[a,s]=(0,i.useState)();(0,i.useEffect)((()=>{a&&(l.current.s.c(null,a),delete a.p)}),[a]);const l=(0,i.useRef)();l.current||(l.current=xh(t,r),o&&(l.current.w=e=>{s((t=>{const n=t?{p:t}:{};return e(n),n}))})),o||(e=>{const{s:t}=e,[n,r]=(0,i.useState)([]);(0,i.useEffect)((()=>{var e;const n=()=>{var e;r(Array.from((null==(e=t.l)?void 0:e.call(t))||[]))},i=null==(e=t.n)?void 0:e.call(t,n);return n(),i}),[t]),(0,i.useDebugValue)([t,n],Lh)})(l.current);const c=_h(n);return(0,i.createElement)(c.Provider,{value:l.current},e)};let Dh=0;function zh(e,t){const n=_h(t),{s:r}=(0,i.useContext)(n),o=(0,i.useCallback)((t=>{const n=r.r(e,t);if("e"in n)throw n.e;if("p"in n)throw n.p;if("v"in n)return n.v;throw new Error("no atom value")}),[r,e]),[[a,s,l],c]=(0,i.useReducer)((0,i.useCallback)(((t,n)=>{const r=o(n);return Object.is(t[1],r)&&t[2]===e?t:[n,r,e]}),[o,e]),void 0,(()=>{const t=void 0;return[t,o(t),e]}));return l!==e&&c(void 0),(0,i.useEffect)((()=>{const t=r.s(e,c);return c(void 0),t}),[r,e]),(0,i.useEffect)((()=>{r.c(e,a)})),(0,i.useDebugValue)(s),s}function Rh(e,t){const n=_h(t),{s:r,w:o}=(0,i.useContext)(n);return(0,i.useCallback)((t=>{if(!("write"in e))throw new Error("not writable atom");const n=n=>r.w(e,t,n);return o?o(n):n()}),[r,o,e])}const Bh=Symbol(),Nh=(e=>{const t=yh(e),n=e=>new Promise(((r,i)=>{const o=t.r(e);"e"in o?i(o.e):r("p"in o?o.p.then((()=>n(e))):o.v)}));return{get:e=>{const n=t.r(e);if("e"in n)throw n.e;if(!("p"in n))return n.v},asyncGet:n,set:(e,n)=>t.w(e,n),sub:(e,n)=>t.s(e,n),SECRET_INTERNAL_store:t}})(),Hh=function(e,t){const n="atom"+ ++Dh,r={toString:()=>n};return"function"==typeof e?r.read=e:(r.init=e,r.read=e=>e(r),r.write=(e,t,n)=>t(r,"function"==typeof n?n(e(r)):n)),t&&(r.write=t),r}({status:"loaded",libraryItems:[]}),Fh=e=>JSON.parse(JSON.stringify(e)),Uh=(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))));const Kh=class{constructor(e){this.libraryItemsPromise=null,this.lastLibraryItems=[],this.resetLibrary=async()=>{this.saveLibrary([])},this.loadLibrary=()=>new Promise((async e=>{try{e(Fh(await(this.libraryItemsPromise||this.lastLibraryItems)))}catch(t){return e(this.lastLibraryItems)}})),this.saveLibrary=async e=>{const t=this.lastLibraryItems;try{var n,r;let t;if(fn(e)){const n=e.then((e=>Fh(e)));this.libraryItemsPromise=n,Nh.set(Hh,{status:"loading",promise:n,libraryItems:null}),t=await n}else t=Fh(e);this.lastLibraryItems=t,this.libraryItemsPromise=null,Nh.set(Hh,{status:"loaded",libraryItems:t}),await(null===(n=(r=this.app.props).onLibraryChange)||void 0===n?void 0:n.call(r,Fh(t)))}catch(e){throw this.lastLibraryItems=t,this.libraryItemsPromise=null,Nh.set(Hh,{status:"loaded",libraryItems:t}),e}},this.app=e}async importLibrary(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unpublished";return this.saveLibrary(new Promise((async(n,r)=>{try{let r;r=e instanceof Blob?await Ed(e,t):vd(await e,t);const i=this.lastLibraryItems,o=[];for(const e of r)Uh(i,e)&&o.push(e);n([...o,...i])}catch(e){r(new Error(m("errors.importLibraryError")))}})))}},Wh=e=>{const t=Array.from(e.values());return{x:Gh(t,(e=>e.x))/t.length,y:Gh(t,(e=>e.y))/t.length}},Vh=e=>{let[t,n]=e;return Math.hypot(t.x-n.x,t.y-n.y)},Gh=(e,t)=>e.reduce(((e,n)=>e+t(n)),0),Yh=e=>({selectedElementIds:e.selectedElementIds,selectedGroupIds:e.selectedGroupIds,viewBackgroundColor:e.viewBackgroundColor,editingLinearElement:e.editingLinearElement,editingGroupId:e.editingGroupId,name:e.name});const Zh=class{constructor(){this.elementCache=new Map,this.recording=!0,this.stateHistory=[],this.redoStack=[],this.lastEntry=null,this.generateEntry=(e,t)=>this.dehydrateHistoryEntry({appState:Yh(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,ai(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)}},Xh=[{icon:(0,b.jsx)("svg",{viewBox:"0 0 320 512",className:"",children:(0,b.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:At.V},{icon:(0,b.jsx)("svg",{viewBox:"0 0 448 512",children:(0,b.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:At.R},{icon:(0,b.jsx)("svg",{viewBox:"0 0 223.646 223.646",children:(0,b.jsx)("path",{d:"M111.823 0L16.622 111.823 111.823 223.646 207.025 111.823z"})}),value:"diamond",key:At.D},{icon:(0,b.jsx)("svg",{viewBox:"0 0 512 512",children:(0,b.jsx)("path",{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"})}),value:"ellipse",key:At.O},{icon:(0,b.jsx)("svg",{viewBox:"0 0 448 512",className:"rtl-mirror",children:(0,b.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:At.A},{icon:(0,b.jsx)("svg",{viewBox:"0 0 6 6",children:(0,b.jsx)("line",{x1:"0",y1:"3",x2:"6",y2:"3",stroke:"currentColor",strokeLinecap:"round"})}),value:"line",key:[At.P,At.L]},{icon:(0,b.jsx)("svg",{viewBox:"0 0 512 512",children:(0,b.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:[At.X,At.P.toUpperCase()]},{icon:(0,b.jsx)("svg",{viewBox:"0 0 448 512",children:(0,b.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:At.T},{icon:(0,b.jsx)("svg",{viewBox:"0 0 512 512",children:(0,b.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 qh={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(m("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")],toggleLock:[Qt("CtrlOrCmd+Shift+L")]},$h=e=>{const t=qh[e];return t&&t.length>0?t[0]:""},Qh=e=>{let{options:t,onCloseRequest:n,top:r,left:i,actionManager:o,appState:a,elements:s}=e;return(0,b.jsx)(ha,{onCloseRequest:n,top:r,left:i,fitInViewport:!0,offsetLeft:a.offsetLeft,offsetTop:a.offsetTop,viewportWidth:a.width,viewportHeight:a.height,children:(0,b.jsx)("ul",{className:"context-menu",onContextMenu:e=>e.preventDefault(),children:t.map(((e,t)=>{var r;if("separator"===e)return(0,b.jsx)("hr",{className:"context-menu-option-separator"},t);const i=e.name;let l="";return e.contextItemLabel&&(l="function"==typeof e.contextItemLabel?m(e.contextItemLabel(s,a)):m(e.contextItemLabel)),(0,b.jsx)("li",{"data-testid":i,onClick:n,children:(0,b.jsxs)("button",{className:xe("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,b.jsx)("div",{className:"context-menu-option__label",children:l}),(0,b.jsx)("kbd",{className:"context-menu-option__shortcut",children:i?$h(i):""})]})},t)}))})})},Jh=new WeakMap,ep={push(e){const t=Array.of();e.options.forEach((e=>{e&&t.push(e)})),t.length&&(0,st.render)((0,b.jsx)(Qh,{top:e.top,left:e.left,options:t,onCloseRequest:()=>(e=>{const t=Jh.get(e);t&&((0,st.unmountComponentAtNode)(t),t.remove(),Jh.delete(e))})(e.container),actionManager:e.actionManager,appState:e.appState,elements:e.elements}),(e=>{let t=Jh.get(e);return t||(t=document.createElement("div"),e.querySelector(".excalidraw-contextMenuContainer").appendChild(t),Jh.set(e,t),t)})(e.container))}},tp=e=>{var t;let{appState:n,elements:r,renderAction:i,activeTool:o}=e;const a=Nl(Ml(r),n);let s=!1;2===a.length&&(Le(a[0])||Le(a[1]))&&(s=!0);const l=Boolean(n.editingElement),c=hg(),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,b.jsxs)("div",{className:"panelColumn",children:[(Fs(o)&&"image"!==o&&"image"!==g||a.some((e=>Fs(e.type))))&&i("changeStrokeColor"),h&&i("changeBackgroundColor"),u&&i("changeFillStyle"),(Us(o)||a.some((e=>Us(e.type))))&&i("changeStrokeWidth"),("freedraw"===o||a.some((e=>"freedraw"===e.type)))&&i("changeStrokeShape"),(Ks(o)||a.some((e=>Ks(e.type))))&&(0,b.jsxs)(b.Fragment,{children:[i("changeStrokeStyle"),i("changeSloppiness")]}),(Ws(o)||a.some((e=>Ws(e.type))))&&(0,b.jsx)(b.Fragment,{children:i("changeSharpness")}),(Vs(o)||a.some((e=>Vs(e.type))))&&(0,b.jsxs)(b.Fragment,{children:[i("changeFontSize"),i("changeFontFamily"),i("changeTextAlign")]}),a.some((e=>Le(e)||Pe(e)))&&i("changeVerticalAlign"),(Gs(o)||a.some((e=>Gs(e.type))))&&(0,b.jsx)(b.Fragment,{children:i("changeArrowhead")}),i("changeOpacity"),(0,b.jsxs)("fieldset",{children:[(0,b.jsx)("legend",{children:m("labels.layers")}),(0,b.jsxs)("div",{className:"buttonList",children:[i("sendToBack"),i("sendBackward"),i("bringToFront"),i("bringForward")]})]}),a.length>1&&!s&&(0,b.jsxs)("fieldset",{children:[(0,b.jsx)("legend",{children:m("labels.align")}),(0,b.jsxs)("div",{className:"buttonList",children:[d?(0,b.jsxs)(b.Fragment,{children:[i("alignRight"),i("alignHorizontallyCentered"),i("alignLeft")]}):(0,b.jsxs)(b.Fragment,{children:[i("alignLeft"),i("alignHorizontallyCentered"),i("alignRight")]}),a.length>2&&i("distributeHorizontally"),(0,b.jsxs)("div",{className:"iconRow",children:[i("alignTop"),i("alignVerticallyCentered"),i("alignBottom"),a.length>2&&i("distributeVertically")]})]})]}),!l&&a.length>0&&(0,b.jsxs)("fieldset",{children:[(0,b.jsx)("legend",{children:m("labels.actions")}),(0,b.jsxs)("div",{className:"buttonList",children:[!c.isMobile&&i("duplicateSelection"),!c.isMobile&&i("deleteSelectedElements"),i("group"),i("ungroup"),p&&i("hyperlink")]})]})]})},np=e=>{let{canvas:t,activeTool:n,setAppState:r,onImageAction:i,appState:o}=e;return(0,b.jsx)(b.Fragment,{children:Xh.map(((e,a)=>{let{value:s,icon:l,key:c}=e;const d=m("toolBar.".concat(s)),u=c&&("string"==typeof c?c:c[0]),h=u?"".concat(Nt(u)," ").concat(m("helpDialog.or")," ").concat(a+1):"".concat(a+1);return(0,b.jsx)(il,{className:"Shape",type:"radio",icon:l,checked:n.type===s,name:"editor-current-shape",title:"".concat(Nt(d)," — ").concat(h),keyBindingLabel:"".concat(a+1),"aria-label":Nt(d),"aria-keyshortcuts":h,"data-testid":s,onPointerDown:e=>{let{pointerType:t}=e;o.penDetected||"pen"!==t||r({penDetected:!0,penMode:!0})},onChange:e=>{let{pointerType:a}=e;o.activeTool.type!==s&&uc("toolbar",s,"ui");const l=Object.assign(Object.assign({},n),{type:s});r({activeTool:l,multiElement:null,selectedElementIds:{}}),qt(t,Object.assign(Object.assign({},o),{activeTool:l})),"image"===s&&i({pointerType:a})}},s)}))})},rp=e=>{let{renderAction:t,zoom:n}=e;return(0,b.jsx)(vu,{gap:1,children:(0,b.jsxs)(bu,{gap:1,align:"center",children:[t("zoomOut"),t("zoomIn"),t("resetZoom")]})})},ip=e=>{let{appState:t,setAppState:n,actionManager:r,showThemeBtn:i}=e;return(0,b.jsxs)("div",{style:{display:"flex"},children:[r.renderAction("changeViewBackgroundColor"),i&&r.renderAction("toggleTheme")]})};n(778);const op=e=>{let{isCollaborating:t,collaboratorCount:n,onClick:r}=e;return(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(il,{className:xe("CollabButton",{"is-collaborating":t}),onClick:r,icon:Ja,type:"button",title:m("labels.liveCollaboration"),"aria-label":m("labels.liveCollaboration"),showAriaLabel:hg().isMobile,children:n>0&&(0,b.jsx)("div",{className:"CollabButton-collaborators",children:n})})})},ap=e=>{let{message:t,onClose:n}=e;const[r,a]=(0,i.useState)(!!t),{container:s}=gg(),l=o().useCallback((()=>{a(!1),n&&n(),null==s||s.focus()}),[n,s]);return(0,b.jsx)(b.Fragment,{children:r&&(0,b.jsx)(bl,{small:!0,onCloseRequest:l,title:m("errorDialog.title"),children:(0,b.jsx)("div",{style:{whiteSpace:"pre-wrap"},children:t})})})};n(2205);const sp="filter"in document.createElement("canvas").getContext("2d"),lp=()=>(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{children:m("canvasError.cannotShowPreview")}),(0,b.jsx)("p",{children:(0,b.jsx)("span",{children:m("canvasError.canvasTooBig")})}),(0,b.jsxs)("em",{children:["(",m("canvasError.canvasTooBigTip"),")"]})]}),cp=(e,t)=>{(0,st.unmountComponentAtNode)(t),t.innerHTML="",e instanceof HTMLCanvasElement?t.appendChild(e):(0,st.render)((0,b.jsx)(lp,{}),t)},dp=e=>{let{children:t,title:n,onClick:r,color:i,shade:o=6}=e;return(0,b.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})},up=e=>{let{elements:t,appState:n,files:o,exportPadding:a=r.qy,actionManager:s,onExportToPng:l,onExportToSvg:c,onExportToClipboard:d}=e;const u=zl(t,n),[h,p]=(0,i.useState)(u),g=(0,i.useRef)(null),{exportBackground:f,viewBackgroundColor:v}=n,y=h?Bl(t,n,!0):t;return(0,i.useEffect)((()=>{p(u)}),[u]),(0,i.useEffect)((()=>{const e=g.current;e&&Hd(y,n,o,{exportBackground:f,viewBackgroundColor:v,exportPadding:a}).then((t=>Cd(t).then((()=>{cp(t,e)})))).catch((t=>{console.error(t),cp(new nl,e)}))}),[n,o,y,f,a,v]),(0,b.jsxs)("div",{className:"ExportDialog",children:[(0,b.jsx)("div",{className:"ExportDialog__preview",ref:g}),sp&&s.renderAction("exportWithDarkMode"),(0,b.jsx)("div",{style:{display:"grid",gridTemplateColumns:"1fr"},children:(0,b.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(190px, 1fr))",overflow:"hidden"},children:[s.renderAction("changeExportBackground"),u&&(0,b.jsx)(mu,{checked:h,onChange:e=>p(e),children:m("labels.onlySelected")}),s.renderAction("changeExportEmbedScene")]})}),(0,b.jsxs)("div",{style:{display:"flex",alignItems:"center",marginTop:".6em"},children:[(0,b.jsx)(bu,{gap:2,children:s.renderAction("changeExportScale")}),(0,b.jsx)("p",{style:{marginLeft:"1em",userSelect:"none"},children:"Scale"})]}),(0,b.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",margin:".6em 0"},children:!ad&&s.renderAction("changeProjectName")}),(0,b.jsxs)(bu,{gap:2,justifyContent:"center",style:{margin:"2em 0"},children:[(0,b.jsx)(dp,{color:"indigo",title:m("buttons.exportToPng"),"aria-label":m("buttons.exportToPng"),onClick:()=>l(y),children:"PNG"}),(0,b.jsx)(dp,{color:"red",title:m("buttons.exportToSvg"),"aria-label":m("buttons.exportToSvg"),onClick:()=>c(y),children:"SVG"}),cu&&(0,b.jsx)(dp,{title:m("buttons.copyPngToClipboard"),onClick:()=>d(y),color:"gray",shade:7,children:Ta})]})]})},hp=e=>{let{elements:t,appState:n,files:a,exportPadding:s=r.qy,actionManager:l,onExportToPng:c,onExportToSvg:d,onExportToClipboard:u}=e;const[h,p]=(0,i.useState)(!1),g=o().useCallback((()=>{p(!1)}),[]);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(il,{onClick:()=>{p(!0)},"data-testid":"image-export-button",icon:Aa,type:"button","aria-label":m("buttons.exportImage"),showAriaLabel:hg().isMobile,title:m("buttons.exportImage")}),h&&(0,b.jsx)(bl,{onCloseRequest:g,title:m("buttons.exportImage"),children:(0,b.jsx)(up,{elements:t,appState:n,files:a,exportPadding:s,actionManager:l,onExportToPng:c,onExportToSvg:d,onExportToClipboard:u,onCloseRequest:g})})]})};n(1310);const pp=e=>{let{children:t,side:n,className:r}=e;return(0,b.jsx)("div",{className:xe("FixedSideContainer","FixedSideContainer_side_".concat(n),r),children:t})};n(7096);const gp=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(t.isLibraryOpen)return null;if(kn(t))return m("hints.eraserRevert");if("arrow"===i.type||"line"===i.type)return m(l?"hints.linearElementMulti":"hints.linearElement");if("freedraw"===i.type)return m("hints.freeDraw");if("text"===i.type)return m("hints.text");if("image"===t.activeTool.type&&t.pendingImageElement)return m("hints.placeImage");const c=Bl(n,t);if(o&&"mouse"===s&&1===c.length){const e=c[0];return Ie(e)&&2===e.points.length?m("hints.lockAngle"):ke(e)?m("hints.resizeImage"):m("hints.resize")}if(a&&"mouse"===s)return m("hints.rotate");if(1===c.length&&Ee(c[0]))return m("hints.text_selected");if(t.editingElement&&Ee(t.editingElement))return m("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 m("hints.deepBoxSelect");if(!c.length&&!r)return m("hints.canvasPanning")}if(1===c.length){if(Ie(c[0]))return t.editingLinearElement?t.editingLinearElement.selectedPointsIndices?m("hints.lineEditor_pointSelected"):m("hints.lineEditor_nothingSelected"):m("hints.lineEditor_info");if(Ae(c[0]))return m("hints.bindTextToElement")}return null})({appState:t,elements:n,isMobile:r});return i?(i=Qt(i),(0,b.jsx)("div",{className:"HintViewer",children:(0,b.jsx)("span",{children:i})})):null},fp={CHECKED:(0,b.jsx)("svg",{width:"1792",height:"1792",viewBox:"0 0 1792 1792",xmlns:"http://www.w3.org/2000/svg",children:(0,b.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,b.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,b.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"})})},mp=e=>(0,b.jsxs)("label",{className:xe("ToolIcon ToolIcon__lock ToolIcon_type_floating","ToolIcon_size_".concat("medium"),{"is-mobile":e.isMobile}),title:"".concat(e.title," — Q"),children:[(0,b.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title}),(0,b.jsx)("div",{className:"ToolIcon__icon",children:e.checked?fp.CHECKED:fp.UNCHECKED})]});var bp=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 vp=e=>{let{heading:t,children:n}=e,r=bp(e,["heading","children"]);const{id:i}=gg(),o=(0,b.jsx)("h2",{className:"visually-hidden",id:"".concat(i,"-").concat(t,"-title"),children:m("headings.".concat(t))});return(0,b.jsx)("section",Object.assign(Object.assign({},r),{"aria-labelledby":"".concat(i,"-").concat(t,"-title"),children:"function"==typeof n?n(o):(0,b.jsxs)(b.Fragment,{children:[o,n]})}))};n(580);const yp=o().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,b.jsx)("div",{className:xe("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,b.jsx)(pl,{label:r.username||"Unknown user",children:o.renderAction("goToCollaborator",{id:t})},t)}))})})),xp=(0,b.jsx)("svg",{viewBox:"0 0 576 512",children:(0,b.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"})}),wp=e=>{let{appState:t,setAppState:n,isMobile:r}=e;return(0,b.jsxs)("label",{className:xe("ToolIcon ToolIcon_type_floating ToolIcon__library","ToolIcon_size_medium",{"is-mobile":r}),title:"".concat(Nt(m("toolBar.library"))," — 0"),children:[(0,b.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:"editor-library",onChange:e=>{n({isLibraryOpen:e.target.checked})},checked:t.isLibraryOpen,"aria-label":Nt(m("toolBar.library")),"aria-keyshortcuts":"0"}),(0,b.jsx)("div",{className:"ToolIcon__icon",children:xp})]})},_p="medium",kp={CHECKED:(0,b.jsxs)("svg",{width:"205",height:"205",viewBox:"0 0 205 205",xmlns:"http://www.w3.org/2000/svg",children:[(0,b.jsx)("path",{d:"m35 195-25-29.17V50h50v115l-25 30"}),(0,b.jsx)("path",{d:"M10 40V10h50v30H10"}),(0,b.jsx)("path",{d:"M125 145h70v50h-70"}),(0,b.jsx)("path",{d:"M190 145v-30l-10-20h-40l-10 20v30h15v-30l5-5h20l5 5v30h15"})]}),UNCHECKED:(0,b.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,b.jsx)("path",{d:"m35 195-25-29.17V50h50v115l-25 30"}),(0,b.jsx)("path",{d:"M10 40V10h50v30H10"}),(0,b.jsx)("path",{d:"M125 145h70v50h-70"}),(0,b.jsx)("path",{d:"M145 145v-30l-10-20H95l-10 20v30h15v-30l5-5h20l5 5v30h15"})]})},Ep=e=>e.penDetected?(0,b.jsxs)("label",{className:xe("ToolIcon ToolIcon__penMode ToolIcon_type_floating","ToolIcon_size_".concat(_p),{"is-mobile":e.isMobile}),title:"".concat(e.title),children:[(0,b.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title}),(0,b.jsx)("div",{className:"ToolIcon__icon",children:e.checked?kp.CHECKED:kp.UNCHECKED})]}):e.isMobile?null:(0,b.jsx)("label",{className:xe("ToolIcon ToolIcon__penMode ToolIcon_type_floating","ToolIcon_size_".concat(_p),{"is-mobile":e.isMobile}),children:(0,b.jsx)("div",{className:"ToolIcon__icon ToolIcon__hidden"})}),Cp=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:f,showThemeBtn:v,onImageAction:y,renderTopRightUI:x,UIOptions:w}=e;return(0,b.jsxs)(b.Fragment,{children:[!f&&(0,b.jsxs)(pp,{side:"top",className:"App-top-bar",children:[(0,b.jsx)("div",{}),(0,b.jsx)(vp,{heading:"shapes",children:e=>(0,b.jsxs)(vu,{gap:4,align:"center",children:[(0,b.jsxs)(bu,{gap:1,className:"App-toolbar-container",children:[(0,b.jsxs)(gl,{padding:1,className:"App-toolbar",children:[e,(0,b.jsx)(bu,{gap:1,children:(0,b.jsx)(np,{appState:n,canvas:h,activeTool:n.activeTool,setAppState:l,onImageAction:e=>{let{pointerType:t}=e;y({insertOnCanvasDirectly:"mouse"!==t})}})})]}),(0,b.jsx)(il,{type:"button",className:"HomeButton ToolIcon_type_floating",title:"Home","aria-label":"Home",icon:Ns,onClick:t},"home"),(0,b.jsx)(mp,{checked:n.activeTool.locked,onChange:d,title:m("toolBar.lock"),isMobile:!0}),(0,b.jsx)(wp,{appState:n,setAppState:l,isMobile:!0}),(0,b.jsx)(Ep,{checked:n.penMode,onChange:u,title:m("toolBar.penMode"),isMobile:!0,penDetected:n.penDetected})]}),i]})}),(0,b.jsx)("div",{style:{display:"flex"},children:null==x?void 0:x(!0,n,h)})]}),(0,b.jsx)("div",{className:"App-bottom-bar",style:{marginBottom:14,marginLeft:14,marginRight:14},children:(0,b.jsxs)(gl,{padding:0,children:[w.canvasActions&&"canvas"===n.openMenu?(0,b.jsx)(vp,{className:"App-mobile-menu",heading:"canvasActions",children:(0,b.jsx)("div",{className:"panelColumn",children:(0,b.jsxs)(vu,{gap:4,children:[f?(0,b.jsxs)(b.Fragment,{children:[a(),s()]}):(0,b.jsxs)(b.Fragment,{children:[o.renderAction("clearCanvas"),o.renderAction("loadScene"),a(),s(),c&&(0,b.jsx)(op,{isCollaborating:p,collaboratorCount:n.collaborators.size,onClick:c}),(0,b.jsx)(ip,{actionManager:o,appState:n,setAppState:l,showThemeBtn:v})]}),null==g?void 0:g(!0,n),n.collaborators.size>0&&(0,b.jsxs)("fieldset",{children:[(0,b.jsx)("legend",{children:m("labels.collaborators")}),(0,b.jsx)(yp,{mobile:!0,layout:"horizontal",collaborators:n.collaborators,actionManager:o})]})]})})}):"shape"===n.openMenu&&!f&&Il(n,r)?(0,b.jsx)(vp,{className:"App-mobile-menu",heading:"selectedShapeActions",children:(0,b.jsx)(tp,{appState:n,elements:r,renderAction:o.renderAction,activeTool:n.activeTool.type})}):null,(0,b.jsxs)("footer",{className:"App-toolbar",children:[(()=>{const e=!n.viewModeEnabled&&!n.editingElement&&0===Bl(r,n).length;return f?w.canvasActions?(0,b.jsx)("div",{className:"App-toolbar-content",children:o.renderAction("toggleCanvasMenu")}):(0,b.jsx)("div",{children:"Excalidraw"}):(0,b.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,b.jsx)("button",{className:"scroll-back-to-content",onClick:()=>{l(Object.assign({},ll(r,n)))},children:m("buttons.scrollBackToContent")})]})]})})]})};n(8051);const Sp=e=>{const t=(0,i.useRef)(null),[n,r]=(0,i.useState)(null);return(0,i.useLayoutEffect)((()=>{if(!e.spreadsheet)return;const n=iu(e.chartType,e.spreadsheet,0,0);let i;r(n);const o=t.current;return(async()=>{i=await Fd(n,{exportBackground:!1,viewBackgroundColor:it.white},null),o.appendChild(i),e.selected&&o.parentNode.focus()})(),()=>{o.removeChild(i)}}),[e.spreadsheet,e.chartType,e.selected]),(0,b.jsx)("button",{className:"ChartPreview",onClick:()=>{n&&e.onClick(e.chartType,n)},children:(0,b.jsx)("div",{ref:t})})},Ip=e=>{let{setAppState:t,appState:n,onClose:r,onInsertChart:i}=e;const a=o().useCallback((()=>{r&&r()}),[r]),s=(e,n)=>{i(n),uc("magic","chart",e),t({currentChartType:e,pasteDialog:{shown:!1,data:null}})};return(0,b.jsx)(bl,{small:!0,onCloseRequest:a,title:m("labels.pasteCharts"),className:"PasteChartDialog",autofocus:!1,children:(0,b.jsxs)("div",{className:"container",children:[(0,b.jsx)(Sp,{chartType:"bar",spreadsheet:n.pasteDialog.data,selected:"bar"===n.currentChartType,onClick:s}),(0,b.jsx)(Sp,{chartType:"line",spreadsheet:n.pasteDialog.data,selected:"line"===n.currentChartType,onClick:s})]})})};n(3922);const jp=()=>(0,b.jsxs)("div",{className:"HelpDialog--header",children:[(0,b.jsx)("a",{className:"HelpDialog--btn",href:"https://github.com/excalidraw/excalidraw#documentation",target:"_blank",rel:"noopener noreferrer",children:m("helpDialog.documentation")}),(0,b.jsx)("a",{className:"HelpDialog--btn",href:"https://blog.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:m("helpDialog.blog")}),(0,b.jsx)("a",{className:"HelpDialog--btn",href:"https://github.com/excalidraw/excalidraw/issues",target:"_blank",rel:"noopener noreferrer",children:m("helpDialog.github")})]}),Tp=e=>(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("h3",{children:e.title}),e.children]}),Mp=e=>(0,b.jsx)("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"space-between"},children:e.children}),Op=e=>(0,b.jsx)("div",{style:{width:"49%"},children:e.children}),Ap=e=>(0,b.jsxs)("div",{className:"HelpDialog--island",children:[(0,b.jsx)("h3",{className:"HelpDialog--island-title",children:e.caption}),e.children]}),Lp=e=>(0,b.jsx)("div",{className:"HelpDialog--shortcut",children:(0,b.jsxs)("div",{style:{display:"flex",margin:"0",padding:"4px 8px",alignItems:"center"},children:[(0,b.jsx)("div",{style:{lineHeight:1.4},children:e.label}),(0,b.jsx)("div",{style:{display:"flex",flex:"0 0 auto",justifyContent:"flex-end",marginInlineStart:"auto",minWidth:"30%"},children:e.shortcuts.map(((t,n)=>(0,b.jsxs)(o().Fragment,{children:[(0,b.jsx)(Pp,{children:t}),e.isOr&&n!==e.shortcuts.length-1&&m("helpDialog.or")]},n)))})]})});Lp.defaultProps={isOr:!0};const Pp=e=>(0,b.jsx)("kbd",Object.assign({className:"HelpDialog--key"},e)),Dp=e=>{let{onClose:t}=e;const n=o().useCallback((()=>{t&&t()}),[t]);return(0,b.jsx)(b.Fragment,{children:(0,b.jsxs)(bl,{onCloseRequest:n,title:m("helpDialog.title"),className:"HelpDialog",children:[(0,b.jsx)(jp,{}),(0,b.jsx)(Tp,{title:m("helpDialog.shortcuts"),children:(0,b.jsxs)(Mp,{children:[(0,b.jsxs)(Op,{children:[(0,b.jsxs)(Ap,{caption:m("helpDialog.tools"),children:[(0,b.jsx)(Lp,{label:m("toolBar.selection"),shortcuts:["V","1"]}),(0,b.jsx)(Lp,{label:m("toolBar.rectangle"),shortcuts:["R","2"]}),(0,b.jsx)(Lp,{label:m("toolBar.diamond"),shortcuts:["D","3"]}),(0,b.jsx)(Lp,{label:m("toolBar.ellipse"),shortcuts:["O","4"]}),(0,b.jsx)(Lp,{label:m("toolBar.arrow"),shortcuts:["A","5"]}),(0,b.jsx)(Lp,{label:m("toolBar.line"),shortcuts:["P","6"]}),(0,b.jsx)(Lp,{label:m("toolBar.freedraw"),shortcuts:["Shift + P","X","7"]}),(0,b.jsx)(Lp,{label:m("toolBar.text"),shortcuts:["T","8"]}),(0,b.jsx)(Lp,{label:m("toolBar.image"),shortcuts:["9"]}),(0,b.jsx)(Lp,{label:m("toolBar.library"),shortcuts:["0"]}),(0,b.jsx)(Lp,{label:m("toolBar.eraser"),shortcuts:[Qt("E")]}),(0,b.jsx)(Lp,{label:m("helpDialog.editSelectedShape"),shortcuts:[Qt("Enter"),m("helpDialog.doubleClick")]}),(0,b.jsx)(Lp,{label:m("helpDialog.textNewLine"),shortcuts:[Qt("Enter"),Qt("Shift+Enter")]}),(0,b.jsx)(Lp,{label:m("helpDialog.textFinish"),shortcuts:[Qt("Esc"),Qt("CtrlOrCmd+Enter")]}),(0,b.jsx)(Lp,{label:m("helpDialog.curvedArrow"),shortcuts:["A",m("helpDialog.click"),m("helpDialog.click"),m("helpDialog.click")],isOr:!1}),(0,b.jsx)(Lp,{label:m("helpDialog.curvedLine"),shortcuts:["L",m("helpDialog.click"),m("helpDialog.click"),m("helpDialog.click")],isOr:!1}),(0,b.jsx)(Lp,{label:m("toolBar.lock"),shortcuts:["Q"]}),(0,b.jsx)(Lp,{label:m("helpDialog.preventBinding"),shortcuts:[Qt("CtrlOrCmd")]}),(0,b.jsx)(Lp,{label:m("toolBar.link"),shortcuts:[Qt("CtrlOrCmd+K")]})]}),(0,b.jsxs)(Ap,{caption:m("helpDialog.view"),children:[(0,b.jsx)(Lp,{label:m("buttons.zoomIn"),shortcuts:[Qt("CtrlOrCmd++")]}),(0,b.jsx)(Lp,{label:m("buttons.zoomOut"),shortcuts:[Qt("CtrlOrCmd+-")]}),(0,b.jsx)(Lp,{label:m("buttons.resetZoom"),shortcuts:[Qt("CtrlOrCmd+0")]}),(0,b.jsx)(Lp,{label:m("helpDialog.zoomToFit"),shortcuts:["Shift+1"]}),(0,b.jsx)(Lp,{label:m("helpDialog.zoomToSelection"),shortcuts:["Shift+2"]}),(0,b.jsx)(Lp,{label:m("buttons.fullScreen"),shortcuts:["F"]}),(0,b.jsx)(Lp,{label:m("buttons.zenMode"),shortcuts:[Qt("Alt+Z")]}),(0,b.jsx)(Lp,{label:m("labels.showGrid"),shortcuts:[Qt("CtrlOrCmd+'")]}),(0,b.jsx)(Lp,{label:m("labels.viewMode"),shortcuts:[Qt("Alt+R")]}),(0,b.jsx)(Lp,{label:m("labels.toggleTheme"),shortcuts:[Qt("Alt+Shift+D")]}),(0,b.jsx)(Lp,{label:m("stats.title"),shortcuts:[Qt("Alt+/")]})]})]}),(0,b.jsx)(Op,{children:(0,b.jsxs)(Ap,{caption:m("helpDialog.editor"),children:[(0,b.jsx)(Lp,{label:m("labels.selectAll"),shortcuts:[Qt("CtrlOrCmd+A")]}),(0,b.jsx)(Lp,{label:m("labels.multiSelect"),shortcuts:[Qt("Shift+".concat(m("helpDialog.click")))]}),(0,b.jsx)(Lp,{label:m("helpDialog.deepSelect"),shortcuts:[Qt("CtrlOrCmd+".concat(m("helpDialog.click")))]}),(0,b.jsx)(Lp,{label:m("helpDialog.deepBoxSelect"),shortcuts:[Qt("CtrlOrCmd+".concat(m("helpDialog.drag")))]}),(0,b.jsx)(Lp,{label:m("labels.moveCanvas"),shortcuts:[Qt("Space+".concat(m("helpDialog.drag"))),Qt("Wheel+".concat(m("helpDialog.drag")))],isOr:!0}),(0,b.jsx)(Lp,{label:m("labels.cut"),shortcuts:[Qt("CtrlOrCmd+X")]}),(0,b.jsx)(Lp,{label:m("labels.copy"),shortcuts:[Qt("CtrlOrCmd+C")]}),(0,b.jsx)(Lp,{label:m("labels.paste"),shortcuts:[Qt("CtrlOrCmd+V")]}),(0,b.jsx)(Lp,{label:m("labels.copyAsPng"),shortcuts:[Qt("Shift+Alt+C")]}),(0,b.jsx)(Lp,{label:m("labels.copyStyles"),shortcuts:[Qt("CtrlOrCmd+Alt+C")]}),(0,b.jsx)(Lp,{label:m("labels.pasteStyles"),shortcuts:[Qt("CtrlOrCmd+Alt+V")]}),(0,b.jsx)(Lp,{label:m("labels.delete"),shortcuts:[Qt("Del")]}),(0,b.jsx)(Lp,{label:m("labels.sendToBack"),shortcuts:[Qt(lt?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")]}),(0,b.jsx)(Lp,{label:m("labels.bringToFront"),shortcuts:[Qt(lt?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")]}),(0,b.jsx)(Lp,{label:m("labels.sendBackward"),shortcuts:[Qt("CtrlOrCmd+[")]}),(0,b.jsx)(Lp,{label:m("labels.bringForward"),shortcuts:[Qt("CtrlOrCmd+]")]}),(0,b.jsx)(Lp,{label:m("labels.alignTop"),shortcuts:[Qt("CtrlOrCmd+Shift+Up")]}),(0,b.jsx)(Lp,{label:m("labels.alignBottom"),shortcuts:[Qt("CtrlOrCmd+Shift+Down")]}),(0,b.jsx)(Lp,{label:m("labels.alignLeft"),shortcuts:[Qt("CtrlOrCmd+Shift+Left")]}),(0,b.jsx)(Lp,{label:m("labels.alignRight"),shortcuts:[Qt("CtrlOrCmd+Shift+Right")]}),(0,b.jsx)(Lp,{label:m("labels.duplicateSelection"),shortcuts:[Qt("CtrlOrCmd+D"),Qt("Alt+".concat(m("helpDialog.drag")))]}),(0,b.jsx)(Lp,{label:m("helpDialog.toggleElementLock"),shortcuts:[Qt("CtrlOrCmd+Shift+L")]}),(0,b.jsx)(Lp,{label:m("buttons.undo"),shortcuts:[Qt("CtrlOrCmd+Z")]}),(0,b.jsx)(Lp,{label:m("buttons.redo"),shortcuts:ct?[Qt("CtrlOrCmd+Y"),Qt("CtrlOrCmd+Shift+Z")]:[Qt("CtrlOrCmd+Shift+Z")]}),(0,b.jsx)(Lp,{label:m("labels.group"),shortcuts:[Qt("CtrlOrCmd+G")]}),(0,b.jsx)(Lp,{label:m("labels.ungroup"),shortcuts:[Qt("CtrlOrCmd+Shift+G")]}),(0,b.jsx)(Lp,{label:m("labels.flipHorizontal"),shortcuts:[Qt("Shift+H")]}),(0,b.jsx)(Lp,{label:m("labels.flipVertical"),shortcuts:[Qt("Shift+V")]}),(0,b.jsx)(Lp,{label:m("labels.showStroke"),shortcuts:[Qt("S")]}),(0,b.jsx)(Lp,{label:m("labels.showBackground"),shortcuts:[Qt("G")]}),(0,b.jsx)(Lp,{label:m("labels.decreaseFontSize"),shortcuts:[Qt("CtrlOrCmd+Shift+<")]}),(0,b.jsx)(Lp,{label:m("labels.increaseFontSize"),shortcuts:[Qt("CtrlOrCmd+Shift+>")]})]})})]})})]})})};n(5080);const zp=e=>{let{children:t,color:n}=e;return(0,b.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})},Rp=e=>{let{elements:t,appState:n,files:r,actionManager:i,exportOpts:o,canvas:a}=e;const{onExportToBackend:s}=o;return(0,b.jsx)("div",{className:"ExportDialog ExportDialog--json",children:(0,b.jsxs)("div",{className:"ExportDialog-cards",children:[o.saveFileToDisk&&(0,b.jsxs)(zp,{color:"lime",children:[(0,b.jsx)("div",{className:"Card-icon",children:La}),(0,b.jsx)("h2",{children:m("exportDialog.disk_title")}),(0,b.jsxs)("div",{className:"Card-details",children:[m("exportDialog.disk_details"),!ad&&i.renderAction("changeProjectName")]}),(0,b.jsx)(il,{className:"Card-button",type:"button",title:m("exportDialog.disk_button"),"aria-label":m("exportDialog.disk_button"),showAriaLabel:!0,onClick:()=>{i.executeAction(xu,"ui")}})]}),s&&(0,b.jsxs)(zp,{color:"pink",children:[(0,b.jsx)("div",{className:"Card-icon",children:Ca}),(0,b.jsx)("h2",{children:m("exportDialog.link_title")}),(0,b.jsx)("div",{className:"Card-details",children:m("exportDialog.link_details")}),(0,b.jsx)(il,{className:"Card-button",type:"button",title:m("exportDialog.link_button"),"aria-label":m("exportDialog.link_button"),showAriaLabel:!0,onClick:()=>{s(t,n,r,a),uc("export","link","ui (".concat((()=>{try{return window.self===window.top?"top":"iframe"}catch(e){return"iframe"}})(),")"))}})]}),o.renderCustomUI&&o.renderCustomUI(t,n,r,a)]})})},Bp=e=>{let{elements:t,appState:n,files:r,actionManager:a,exportOpts:s,canvas:l}=e;const[c,d]=(0,i.useState)(!1),u=o().useCallback((()=>{d(!1)}),[]);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(il,{onClick:()=>{"function"==typeof s?a.executeAction(xu):d(!0)},"data-testid":"json-export-button",icon:La,type:"button","aria-label":m("buttons.export"),showAriaLabel:hg().isMobile,title:m("buttons.export")}),c&&s&&"function"!=typeof s&&(0,b.jsx)(bl,{onCloseRequest:u,title:m("buttons.export"),children:(0,b.jsx)(Rp,{elements:t,appState:n,files:r,actionManager:a,onCloseRequest:u,exportOpts:s,canvas:l})})]})};var Np=n(673);const Hp=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 Hd(Ml(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}}))},Fp=async e=>{var t;let{mimeType:n=r.LO.png,quality:i}=e;n===r.LO.png&&"number"==typeof i&&console.warn('"quality" will be ignored for "'.concat(r.LO.png,'" mimeType')),"image/jpg"===n&&(n=r.LO.jpg),n!==r.LO.jpg||null!==(t=e.appState)&&void 0!==t&&t.exportBackground||(console.warn('Defaulting "exportBackground" to "true" for "'.concat(r.LO.jpg,'" mimeType')),e=Object.assign(Object.assign({},e),{appState:Object.assign(Object.assign({},e.appState),{exportBackground:!0})}));const o=await Hp(e);return i=i||(/image\/jpe?g/.test(n)?.92:.8),new Promise((t=>{o.toBlob((async i=>{var o;i&&n===r.LO.png&&null!==(o=e.appState)&&void 0!==o&&o.exportEmbedScene&&(i=await(0,Np.encodePngMetadata)({blob:i,metadata:Od(e.elements,e.appState,e.files||{},"local")})),t(i)}),n,i)}))},Up=async e=>{let{elements:t,appState:n=bn(),files:r={},exportPadding:i}=e;const{elements:o,appState:a}=md({elements:t,appState:n},null,null);return Fd(Ml(o),Object.assign(Object.assign({},a),{exportPadding:i}),r)},Kp=async e=>{const t=await Fp(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 Wp=e=>{let{libItem:t,appState:n,index:r,onChange:o,onRemove:a}=e;const s=(0,i.useRef)(null),l=(0,i.useRef)(null);return(0,i.useEffect)((()=>{const e=s.current;e&&(async()=>{const r=await Up({elements:t.elements,appState:Object.assign(Object.assign({},n),{viewBackgroundColor:it.white,exportBackground:!0}),files:null});e.innerHTML=r.outerHTML})()}),[t.elements,n]),(0,b.jsxs)("div",{className:"single-library-item",children:[(0,b.jsx)("div",{ref:s,className:"single-library-item__svg"}),(0,b.jsx)(il,{"aria-label":m("buttons.remove"),type:"button",icon:es,className:"single-library-item--remove",onClick:a.bind(null,t.id),title:m("buttons.remove")}),(0,b.jsxs)("div",{style:{display:"flex",margin:"0.8rem 0.3rem",width:"100%",fontSize:"14px",fontWeight:500,flexDirection:"column"},children:[(0,b.jsxs)("label",{style:{display:"flex",justifyContent:"space-between",flexDirection:"column"},children:[(0,b.jsxs)("div",{style:{padding:"0.5em 0"},children:[(0,b.jsx)("span",{style:{fontWeight:500,color:it.gray[6]},children:m("publishDialog.itemName")}),(0,b.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,b.jsx)("input",{type:"text",ref:l,style:{width:"80%",padding:"0.2rem"},defaultValue:t.name,placeholder:"Item name",onChange:e=>{o(e.target.value,r)}})]}),(0,b.jsx)("span",{className:"error",children:t.error})]})]})},Vp="publish-library-data",Gp=async e=>{const t=128,n=Math.round(8),i=Math.max(Math.round(2),2),o=((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=o[0].length*t+(o[0].length+1)*(2*n)-2*n,a.height=o.length*t+(o.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[r,o]of e.entries()){const e=await Hp({elements:o.elements,files:null,maxWidthOrHeight:t}),{width:a,height:l}=e,c=Math.floor(r/6)*(t+2*n),d=r%6*(t+2*n);s.drawImage(e,d+(t-a)/2+n,c+(t-l)/2+n),s.lineWidth=i,s.strokeStyle=it.gray[4],s.strokeRect(d+n/2,c+n/2,t+n,t+n)}return await jd(new File([await Cd(a)],"preview",{type:r.LO.png}),{outputType:r.LO.jpg,maxWidthOrHeight:5e3})},Yp=e=>{let{onClose:t,libraryItems:n,appState:o,onSuccess:a,onError:s,updateItemsInStorage:l,onRemove:c}=e;const[d,u]=(0,i.useState)({authorName:"",githubHandle:"",name:"",description:"",twitterHandle:"",website:""}),[h,p]=(0,i.useState)(!1);(0,i.useEffect)((()=>{const e=(()=>{try{const e=localStorage.getItem(Vp);if(e)return JSON.parse(e)}catch(e){console.error(e)}return null})();e&&u(e)}),[]);const[g,f]=(0,i.useState)(n.slice());(0,i.useEffect)((()=>{f(n.slice())}),[n]);const v=e=>{u(Object.assign(Object.assign({},d),{[e.target.name]:e.target.value}))},y=(0,i.useCallback)((()=>{l(g),(e=>{try{localStorage.setItem(Vp,JSON.stringify(e))}catch(e){console.error(e)}})(d),t()}),[g,t,l,d]),x=!!n.length;return(0,b.jsx)(bl,{onCloseRequest:y,title:m("publishDialog.title"),className:"publish-library",children:x?(0,b.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),p(!0);const t=[];let n=!1;if(g.forEach((e=>{let r="";e.name||(r=m("publishDialog.errors.required"),n=!0),t.push(Object.assign(Object.assign({},e),{error:r}))})),n)return f(t),void p(!1);const i=await Gp(g),o={type:r.r8.excalidrawLibrary,version:r.Kr.excalidrawLibrary,source:r.pb,libraryItems:g},l=JSON.stringify(o,null,2),c=new Blob([l],{type:"application/json"}),u=new FormData;u.append("excalidrawLib",c),u.append("previewImage",i),u.append("previewImageType",i.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(Vp),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,b.jsxs)("div",{className:"publish-library-note",children:[m("publishDialog.noteDescription.pre"),(0,b.jsx)("a",{href:"https://libraries.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:m("publishDialog.noteDescription.link")})," ",m("publishDialog.noteDescription.post")]}),(0,b.jsxs)("span",{className:"publish-library-note",children:[m("publishDialog.noteGuidelines.pre"),(0,b.jsx)("a",{href:"https://github.com/excalidraw/excalidraw-libraries#guidelines",target:"_blank",rel:"noopener noreferrer",children:m("publishDialog.noteGuidelines.link")}),m("publishDialog.noteGuidelines.post")]}),(0,b.jsx)("div",{className:"publish-library-note",children:m("publishDialog.noteItems")}),(()=>{const e=[];return g.forEach(((t,n)=>{e.push((0,b.jsx)("div",{className:"single-library-item-wrapper",children:(0,b.jsx)(Wp,{libItem:t,appState:o,index:n,onChange:(e,t)=>{const n=g.slice();n[t].name=e,f(n)},onRemove:c})},n))})),(0,b.jsx)("div",{className:"selected-library-items",children:e})})(),(0,b.jsxs)("div",{className:"publish-library__fields",children:[(0,b.jsxs)("label",{children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{children:m("publishDialog.libraryName")}),(0,b.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,b.jsx)("input",{type:"text",name:"name",required:!0,value:d.name,onChange:v,placeholder:m("publishDialog.placeholder.libraryName")})]}),(0,b.jsxs)("label",{style:{alignItems:"flex-start"},children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{children:m("publishDialog.libraryDesc")}),(0,b.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,b.jsx)("textarea",{name:"description",rows:4,required:!0,value:d.description,onChange:v,placeholder:m("publishDialog.placeholder.libraryDesc")})]}),(0,b.jsxs)("label",{children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{children:m("publishDialog.authorName")}),(0,b.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,b.jsx)("input",{type:"text",name:"authorName",required:!0,value:d.authorName,onChange:v,placeholder:m("publishDialog.placeholder.authorName")})]}),(0,b.jsxs)("label",{children:[(0,b.jsx)("span",{children:m("publishDialog.githubUsername")}),(0,b.jsx)("input",{type:"text",name:"githubHandle",value:d.githubHandle,onChange:v,placeholder:m("publishDialog.placeholder.githubHandle")})]}),(0,b.jsxs)("label",{children:[(0,b.jsx)("span",{children:m("publishDialog.twitterUsername")}),(0,b.jsx)("input",{type:"text",name:"twitterHandle",value:d.twitterHandle,onChange:v,placeholder:m("publishDialog.placeholder.twitterHandle")})]}),(0,b.jsxs)("label",{children:[(0,b.jsx)("span",{children:m("publishDialog.website")}),(0,b.jsx)("input",{type:"text",name:"website",pattern:"https?://.+",title:m("publishDialog.errors.website"),value:d.website,onChange:v,placeholder:m("publishDialog.placeholder.website")})]}),(0,b.jsxs)("span",{className:"publish-library-note",children:[m("publishDialog.noteLicense.pre"),(0,b.jsx)("a",{href:"https://github.com/excalidraw/excalidraw-libraries/blob/main/LICENSE",target:"_blank",rel:"noopener noreferrer",children:m("publishDialog.noteLicense.link")}),m("publishDialog.noteLicense.post")]})]}),(0,b.jsxs)("div",{className:"publish-library__buttons",children:[(0,b.jsx)(il,{type:"button",title:m("buttons.cancel"),"aria-label":m("buttons.cancel"),label:m("buttons.cancel"),onClick:y,"data-testid":"cancel-clear-canvas-button",className:"publish-library__buttons--cancel"}),(0,b.jsx)(il,{type:"submit",title:m("buttons.submit"),"aria-label":m("buttons.submit"),label:m("buttons.submit"),className:"publish-library__buttons--confirm",isLoading:h})]})]}):(0,b.jsx)("p",{style:{padding:"1em",textAlign:"center",fontWeight:500},children:m("publishDialog.atleastOneLibItem")})})};n(4406);var Zp=n(2891);n(694);const Xp=(0,b.jsx)("svg",{viewBox:"0 0 1792 1792",children:(0,b.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)"})}),qp=e=>{let{id:t,elements:n,files:o,isPending:a,onClick:s,selected:l,onToggle:c}=e;const d=(0,i.useRef)(null);(0,i.useEffect)((()=>{const e=d.current;if(e)return(async()=>{if(!n)return;const t=await Fd(n,{exportBackground:!1,viewBackgroundColor:it.white},o);e.innerHTML=t.outerHTML})(),()=>{e.innerHTML=""}}),[n,o]);const[u,h]=(0,i.useState)(!1),p=hg().isMobile,g=a&&(0,b.jsx)("div",{className:"library-unit__adder",children:Xp});return(0,b.jsxs)("div",{className:xe("library-unit",{"library-unit__active":n,"library-unit--hover":n&&u,"library-unit--selected":l}),onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),children:[(0,b.jsx)("div",{className:xe("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(r.LO.excalidrawlib,JSON.stringify(n))}}),g,t&&n&&(u||p||l)&&(0,b.jsx)(mu,{checked:l,onChange:(e,n)=>c(t,n),className:"library-unit__checkbox"})]})};n(6043);const $p=e=>{let{libraryItems:t,onRemoveFromLibrary:n,onAddToLibrary:o,onInsertShape:a,pendingElements:s,theme:l,setAppState:c,libraryReturnUrl:d,library:u,files:h,id:p,selectedItems:g,onToggle:f,onPublish:v,resetLibrary:y}=e;const x=(0,i.useCallback)((()=>{const e=g.length?m("alerts.removeItemsFromsLibrary",{count:g.length}):m("alerts.resetLibrary"),t=g.length?m("confirmDialog.removeItemsFromLib"):m("confirmDialog.resetLibrary");return(0,b.jsx)(yl,{onConfirm:()=>{g.length?n():y(),_(!1)},onCancel:()=>{_(!1)},title:t,children:(0,b.jsx)("p",{children:e})})}),[g,n,y]),[w,_]=(0,i.useState)(!1),k=hg().isMobile,E=k?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)})),I=e=>{var t,n,r,i,o;return(0,b.jsx)(vu,{children:(0,b.jsx)(qp,{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)=>{f(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:()=>o(s)})));let n=(0,Zp.chunk)(t,E);return n.length||(n=[[]]),n.map(((e,t,n)=>(t===n.length-1&&(e=e.concat(new Array(E-e.length).fill(null).map(((e,t)=>I({key:"empty_".concat(t),item:null}))))),(0,b.jsx)(bu,{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,b.jsxs)("div",{className:"library-menu-items-container",children:[w&&x(),(0,b.jsxs)("div",{className:"layer-ui__library-header",children:[(()=>{const e=!!g.length,n=e?t.filter((e=>g.includes(e.id))):t,i=m(e?"buttons.remove":"buttons.resetLibrary");return(0,b.jsxs)("div",{className:"library-actions",children:[(!e||!k)&&(0,b.jsx)(il,{type:"button",title:m("buttons.load"),"aria-label":m("buttons.load"),icon:ja,onClick:()=>{(async e=>{const t=await cd({description:"Excalidraw library files"});await e.importLibrary(t)})(u).catch(an).catch((e=>{c({errorMessage:e.message})}))},className:"library-actions--load"},"import"),!!n.length&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(il,{type:"button",title:m("buttons.export"),"aria-label":m("buttons.export"),icon:La,onClick:async()=>{(async e=>{const t=Dd(e);await dd(new Blob([t],{type:r.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,b.jsx)("span",{className:"library-actions-counter",children:g.length})},"export"),(0,b.jsx)(il,{type:"button",title:i,"aria-label":i,icon:Ma,onClick:()=>_(!0),className:"library-actions--remove",children:g.length>0&&(0,b.jsx)("span",{className:"library-actions-counter",children:g.length})},"reset")]}),e&&!S&&(0,b.jsx)(pl,{label:m("hints.publishLibrary"),children:(0,b.jsxs)(il,{type:"button","aria-label":m("buttons.publishLibrary"),label:m("buttons.publishLibrary"),icon:zs,className:"library-actions--publish",onClick:v,children:[!k&&(0,b.jsx)("label",{children:m("buttons.publishLibrary")}),g.length>0&&(0,b.jsx)("span",{className:"library-actions-counter",children:g.length})]})})]})})(),(0,b.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(r.Kr.excalidrawLibrary),target:"_excalidraw_libraries",children:m("labels.libraries")})]},"library-header"),(0,b.jsxs)(vu,{className:"library-menu-items-container__items",align:"start",gap:1,children:[(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"separator",children:m("labels.personalLib")}),j(M)]}),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"separator",children:[m("labels.excalidrawLib")," "]}),j(T)]})]})]})},Qp=(e,t)=>e.filter((e=>t.includes(e.id))),Jp=(0,i.forwardRef)(((e,t)=>{let{children:n}=e;return(0,b.jsx)(gl,{padding:1,ref:t,className:"layer-ui__library",children:n})})),eg=e=>{let{onClose:t,onInsertShape:n,pendingElements:o,onAddToLibrary:a,theme:s,setAppState:l,files:c,libraryReturnUrl:d,focusContainer:u,library:h,id:p,appState:g}=e;const f=(0,i.useRef)(null);((e,t)=>{(0,i.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])})(f,(e=>{e.target.closest(".ToolIcon__library")||t()})),(0,i.useEffect)((()=>{const e=e=>{e.key===At.ESCAPE&&t()};return document.addEventListener(r.Ks.KEYDOWN,e),()=>{document.removeEventListener(r.Ks.KEYDOWN,e)}}),[t]);const[y,x]=(0,i.useState)([]),[w,_]=(0,i.useState)(!1),[k,E]=(0,i.useState)(null),[C]=function(e,t){return"scope"in e&&(console.warn("atom.scope is deprecated. Please do useAtom(atom, scope) instead."),t=e.scope),[zh(e,t),Rh(e,t)]}(Hh,Bh),S=(0,i.useCallback)((async e=>{const t=e.filter((e=>!y.includes(e.id)));h.saveLibrary(t).catch((()=>{l({errorMessage:m("alerts.errorRemovingFromLibrary")})})),x([])}),[h,l,y,x]),I=(0,i.useCallback)((()=>{h.resetLibrary(),u()}),[h,u]),j=(0,i.useCallback)((async(e,t)=>{if(uc("element","addToLibrary","ui"),e.some((e=>"image"===e.type)))return l({errorMessage:"Support for adding images to the library coming soon!"});const n=[{status:"unpublished",elements:e,id:Rr(),created:Date.now()},...t];a(),h.saveLibrary(n).catch((()=>{l({errorMessage:m("alerts.errorAddingToLibrary")})}))}),[a,h,l]),T=(0,i.useCallback)((()=>(0,b.jsxs)(bl,{onCloseRequest:()=>E(null),title:m("publishSuccessDialog.title"),className:"publish-library-success",small:!0,children:[(0,b.jsxs)("p",{children:[m("publishSuccessDialog.content",{authorName:k.authorName})," ",(0,b.jsx)("a",{href:null==k?void 0:k.url,target:"_blank",rel:"noopener noreferrer",children:m("publishSuccessDialog.link")})]}),(0,b.jsx)(il,{type:"button",title:m("buttons.close"),"aria-label":m("buttons.close"),label:m("buttons.close"),onClick:()=>E(null),"data-testid":"publish-library-success-close",className:"publish-library-success-close"})]})),[E,k]),M=(0,i.useCallback)(((e,t)=>{_(!1),E({url:e.url,authorName:e.authorName});const n=t.slice();n.forEach((e=>{y.includes(e.id)&&(e.status="published")})),h.saveLibrary(n)}),[_,E,y,h]),[O,A]=(0,i.useState)(null);return"loading"===C.status?(0,b.jsx)(Jp,{ref:f,children:(0,b.jsxs)("div",{className:"layer-ui__library-message",children:[(0,b.jsx)(v,{size:"2em"}),(0,b.jsx)("span",{children:m("labels.libraryLoadingMessage")})]})}):(0,b.jsxs)(Jp,{ref:f,children:[w&&(0,b.jsx)(Yp,{onClose:()=>_(!1),libraryItems:Qp(C.libraryItems,y),appState:g,onSuccess:e=>M(e,C.libraryItems),onError:e=>window.alert(e),updateItemsInStorage:()=>h.saveLibrary(C.libraryItems),onRemove:e=>x(y.filter((t=>t!==e)))}),k&&T(),(0,b.jsx)($p,{libraryItems:C.libraryItems,onRemoveFromLibrary:()=>S(C.libraryItems),onAddToLibrary:e=>j(e,C.libraryItems),onInsertShape:n,pendingElements:o,setAppState:l,libraryReturnUrl:d,library:h,theme:s,files:c,id:p,selectedItems:y,onToggle:(e,t)=>{if(!y.includes(e)){if(t.shiftKey&&O){const t=C.libraryItems.findIndex((e=>e.id===O)),n=C.libraryItems.findIndex((t=>t.id===e));if(-1===t||-1===n)return void x([...y,e]);const r=un(y),i=C.libraryItems.reduce(((e,i,o)=>((o>=t&&o<=n||r.has(i.id))&&e.push(i.id),e)),[]);x(i)}else x([...y,e]);A(e)}else A(null),x(y.filter((t=>t!==e)))},onPublish:()=>_(!0),resetLibrary:I})]})};n(3336),n(276);var tg=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 ng=e=>{let{onHomeButtonClick:t,actionManager:n,appState:o,files:a,setAppState:s,canvas:l,elements:c,onCollabButtonClick:d,onLockToggle:u,onPenModeToggle:h,onInsertElements:p,zenModeEnabled:g,showExitZenModeBtn:f,showThemeBtn:v,toggleZenMode:x,isCollaborating:w,renderTopRightUI:_,renderCustomFooter:k,viewModeEnabled:E,libraryReturnUrl:C,UIOptions:S,focusContainer:I,library:j,id:T,onImageAction:M}=e;const O=hg(),A=()=>S.canvasActions&&S.canvasActions.export?(0,b.jsx)(Bp,{elements:c,appState:o,files:a,actionManager:n,exportOpts:S.canvasActions.export,canvas:l}):null,L=()=>{if(!S.canvasActions||!S.canvasActions.saveAsImage)return null;const e=e=>async t=>{uc("export",e,"ui");const n=await fu(e,t,o,a,{exportBackground:o.exportBackground,name:o.name,viewBackgroundColor:o.viewBackgroundColor}).catch(an).catch((e=>{console.error(e),s({errorMessage:e.message})}));o.exportEmbedScene&&n&&wd(n)&&s({fileHandle:n})};return(0,b.jsx)(hp,{elements:c,appState:o,files:a,actionManager:n,onExportToPng:e("png"),onExportToSvg:e("svg"),onExportToClipboard:e("clipboard")})},P=(0,i.useCallback)((()=>{!!document.querySelector(".Dialog")||s({isLibraryOpen:!1})}),[s]),D=(0,i.useCallback)((()=>{s({selectedElementIds:{},selectedGroupIds:{}})}),[s]),z=o.isLibraryOpen?(0,b.jsx)(eg,{pendingElements:Bl(c,o,!0),onClose:P,onInsertShape:p,onAddToLibrary:D,setAppState:s,libraryReturnUrl:C,focusContainer:I,library:j,theme:o.theme,files:a,id:T,appState:o}):null,R=(0,b.jsxs)(b.Fragment,{children:[o.isLoading&&(0,b.jsx)(y,{delay:250}),o.errorMessage&&(0,b.jsx)(ap,{message:o.errorMessage,onClose:()=>s({errorMessage:null})}),o.showHelpDialog&&(0,b.jsx)(Dp,{onClose:()=>{s({showHelpDialog:!1})}}),o.pasteDialog.shown&&(0,b.jsx)(Ip,{setAppState:s,appState:o,onInsertChart:p,onClose:()=>s({pasteDialog:{shown:!1,data:null}})})]});return O.isMobile?(0,b.jsxs)(b.Fragment,{children:[R,(0,b.jsx)(Cp,{onHomeButtonClick:t,appState:o,elements:c,actionManager:n,libraryMenu:z,renderJSONExportDialog:A,renderImageExportDialog:L,setAppState:s,onCollabButtonClick:d,onLockToggle:()=>u(),onPenModeToggle:h,canvas:l,isCollaborating:w,renderCustomFooter:k,viewModeEnabled:E,showThemeBtn:v,onImageAction:M,renderTopRightUI:_,UIOptions:S})]}):(0,b.jsxs)("div",{className:xe("layer-ui__wrapper",{"disable-pointerEvents":o.draggingElement||o.resizingElement||o.editingElement&&!Ee(o.editingElement)}),children:[R,(()=>{const e=Il(o,c);return(0,b.jsx)(pp,{side:"top",children:(0,b.jsxs)("div",{className:"App-menu App-menu_top",children:[(0,b.jsxs)(vu,{gap:4,className:xe({"disable-pointerEvents":g}),children:[S.canvasActions&&(E?(0,b.jsx)(vp,{heading:"canvasActions",className:xe("zen-mode-transition",{"transition-left":g}),children:(0,b.jsx)(gl,{padding:2,style:{zIndex:1},children:(0,b.jsx)(vu,{gap:4,children:(0,b.jsxs)(bu,{gap:1,justifyContent:"space-between",children:[A(),L()]})})})}):(0,b.jsx)(vp,{heading:"canvasActions",className:xe("zen-mode-transition",{"transition-left":g}),children:(0,b.jsx)(gl,{padding:2,style:{zIndex:1},children:(0,b.jsxs)(vu,{gap:4,children:[(0,b.jsxs)(bu,{gap:3,justifyContent:"space-between",children:[n.renderAction("clearCanvas"),n.renderAction("loadScene"),A(),L(),d&&(0,b.jsx)(op,{isCollaborating:w,collaboratorCount:o.collaborators.size,onClick:d})]}),(0,b.jsx)(ip,{actionManager:n,appState:o,setAppState:s,showThemeBtn:v}),o.fileHandle&&(0,b.jsx)(b.Fragment,{children:n.renderAction("saveToActiveFile")})]})})})),e&&(0,b.jsx)(vp,{heading:"selectedShapeActions",className:xe("zen-mode-transition",{"transition-left":g}),children:(0,b.jsx)(gl,{className:r.$C.SHAPE_ACTIONS_MENU,padding:2,style:{maxHeight:"".concat(o.height-(o.fileHandle?248:200),"px")},children:(0,b.jsx)(tp,{appState:o,elements:c,renderAction:n.renderAction,activeTool:o.activeTool.type})})})]}),!E&&(0,b.jsx)(vp,{heading:"shapes",children:e=>(0,b.jsxs)(vu,{gap:4,align:"start",children:[(0,b.jsxs)(bu,{gap:1,className:xe("App-toolbar-container",{"zen-mode":g}),children:[(0,b.jsx)(Ep,{zenModeEnabled:g,checked:o.penMode,onChange:h,title:m("toolBar.penMode"),penDetected:o.penDetected}),(0,b.jsx)(mp,{zenModeEnabled:g,checked:o.activeTool.locked,onChange:()=>u(),title:m("toolBar.lock")}),(0,b.jsxs)(gl,{padding:1,className:xe("App-toolbar",{"zen-mode":g}),children:[(0,b.jsx)(gp,{appState:o,elements:c,isMobile:O.isMobile}),e,(0,b.jsx)(bu,{gap:1,children:(0,b.jsx)(np,{appState:o,canvas:l,activeTool:o.activeTool,setAppState:s,onImageAction:e=>{let{pointerType:t}=e;M({insertOnCanvasDirectly:"mouse"!==t})}})})]}),(0,b.jsx)(wp,{appState:o,setAppState:s})]}),z]})}),(0,b.jsx)("div",{className:xe("layer-ui__wrapper__top-right zen-mode-transition",{"transition-right":g}),children:null==_?void 0:_(O.isMobile,o,l)}),(0,b.jsx)(yp,{className:xe("zen-mode-transition",{"transition-right":g}),layout:"vertical",collaborators:o.collaborators,actionManager:n})]})})})(),(0,b.jsxs)("footer",{role:"contentinfo",className:"layer-ui__wrapper__footer App-menu App-menu_bottom",children:[(0,b.jsx)("div",{className:xe("layer-ui__wrapper__footer-left zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":g}),children:(0,b.jsx)(vu,{gap:2,children:(0,b.jsxs)(vp,{heading:"canvasActions",children:[(0,b.jsx)(gl,{padding:1,children:(0,b.jsx)(rp,{renderAction:n.renderAction,zoom:o.zoom})}),!E&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:xe("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,b.jsx)("div",{className:xe("eraser-buttons zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":g}),children:n.renderAction("eraser",{size:"small"})})]}),!E&&o.multiElement&&O.isTouchScreen&&(0,b.jsx)("div",{className:xe("finalize-button zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":g}),children:n.renderAction("finalize",{size:"small"})})]})})}),(0,b.jsx)("div",{className:xe("layer-ui__wrapper__footer-center zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":g}),children:null==k?void 0:k(!1,o)}),(0,b.jsx)("div",{className:xe("layer-ui__wrapper__footer-right zen-mode-transition",{"transition-right disable-pointerEvents":g}),children:n.renderAction("toggleShortcuts")}),(0,b.jsx)("button",{className:xe("disable-zen-mode",{"disable-zen-mode--visible":f}),onClick:x,children:m("buttons.exitZenMode")})]}),o.scrolledOutside&&(0,b.jsx)("button",{className:"scroll-back-to-content",onClick:()=>{s(Object.assign({},ll(c,o)))},children:m("buttons.scrollBackToContent")})]})},rg=(e,t)=>{const n=e=>{const{suggestedBindings:t,startBoundElement:n}=e;return tg(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]))},ig=o().memo(ng,rg);n(1528);const og=e=>{var t;const n=hg(),r=et(e.elements),i=Nl(e.elements,e.appState),o=et(i);return n.isMobile&&e.appState.openMenu?null:(0,b.jsx)("div",{className:"Stats",children:(0,b.jsxs)(gl,{padding:2,children:[(0,b.jsx)("div",{className:"close",onClick:e.onClose,children:es}),(0,b.jsx)("h3",{children:m("stats.title")}),(0,b.jsx)("table",{children:(0,b.jsxs)("tbody",{children:[(0,b.jsx)("tr",{children:(0,b.jsx)("th",{colSpan:2,children:m("stats.scene")})}),(0,b.jsxs)("tr",{children:[(0,b.jsx)("td",{children:m("stats.elements")}),(0,b.jsx)("td",{children:e.elements.length})]}),(0,b.jsxs)("tr",{children:[(0,b.jsx)("td",{children:m("stats.width")}),(0,b.jsx)("td",{children:Math.round(r[2])-Math.round(r[0])})]}),(0,b.jsxs)("tr",{children:[(0,b.jsx)("td",{children:m("stats.height")}),(0,b.jsx)("td",{children:Math.round(r[3])-Math.round(r[1])})]}),1===i.length&&(0,b.jsx)("tr",{children:(0,b.jsx)("th",{colSpan:2,children:m("stats.element")})}),i.length>1&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("tr",{children:(0,b.jsx)("th",{colSpan:2,children:m("stats.selected")})}),(0,b.jsxs)("tr",{children:[(0,b.jsx)("td",{children:m("stats.elements")}),(0,b.jsx)("td",{children:i.length})]})]}),i.length>0&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("tr",{children:[(0,b.jsx)("td",{children:"x"}),(0,b.jsx)("td",{children:Math.round(o[0])})]}),(0,b.jsxs)("tr",{children:[(0,b.jsx)("td",{children:"y"}),(0,b.jsx)("td",{children:Math.round(o[1])})]}),(0,b.jsxs)("tr",{children:[(0,b.jsx)("td",{children:m("stats.width")}),(0,b.jsx)("td",{children:Math.round(o[2]-o[0])})]}),(0,b.jsxs)("tr",{children:[(0,b.jsx)("td",{children:m("stats.height")}),(0,b.jsx)("td",{children:Math.round(o[3]-o[1])})]})]}),1===i.length&&(0,b.jsxs)("tr",{children:[(0,b.jsx)("td",{children:m("stats.angle")}),(0,b.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 ag=e=>{let{message:t,clearToast:n}=e;const o=(0,i.useRef)(0),a=(0,i.useCallback)((()=>o.current=window.setTimeout((()=>n()),r.Lg)),[n]);return(0,i.useEffect)((()=>(a(),()=>clearTimeout(o.current))),[a,t]),(0,b.jsx)("div",{className:"Toast",onMouseEnter:()=>clearTimeout(null==o?void 0:o.current),onMouseLeave:a,children:(0,b.jsx)("p",{className:"Toast__message",children:t})})},sg=qs({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[At.CTRL_OR_CMD]&&e.altKey&&e.code===Ot});var lg=n(200),cg=n.n(lg);const dg={isMobile:!1,isTouchScreen:!1},ug=o().createContext(dg),hg=()=>(0,i.useContext)(ug),pg=o().createContext({container:null,id:null}),gg=()=>(0,i.useContext)(pg);let fg=!1,mg=0,bg=0,vg=0,yg=!1,xg=!1,wg=!1,_g={horizontal:null,vertical:null},kg=0,Eg=!1,Cg=null;const Sg={pointers:new Map,lastCenter:null,initialDistance:null,initialScale:null};class Ig extends o().Component{constructor(e){super(e),jg.call(this);const t=bn(),{excalidrawRef:n,viewModeEnabled:i=!1,zenModeEnabled:o=!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:i,zenModeEnabled:o,gridSize:a?r.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 Kn,this.library=new Kh(this),this.history=new Zh,this.actionManager=new th(this.syncActionResult,(()=>this.state),(()=>this.scene.getElementsIncludingDeleted()),this),this.actionManager.registerAll(Xs),this.actionManager.registerAction((d=this.history,{name:"undo",trackEvent:{category:"history"},perform:(e,t)=>Ju(e,t,(()=>d.undoOnce())),keyTest:e=>e[At.CTRL_OR_CMD]&&e.key.toLowerCase()===At.Z&&!e.shiftKey,PanelComponent:e=>{let{updateData:t,data:n}=e;return(0,b.jsx)(il,{type:"button",icon:Ba,"aria-label":m("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)=>Ju(t,n,(()=>e.redoOnce())),keyTest:e=>e[At.CTRL_OR_CMD]&&e.shiftKey&&e.key.toLowerCase()===At.Z||ct&&e.ctrlKey&&!e.shiftKey&&e.key===At.Y,PanelComponent:e=>{let{updateData:t,data:n}=e;return(0,b.jsx)(il,{type:"button",icon:Na,"aria-label":m("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:i}=this.state,o=t*e,a=n*e;return i?(0,b.jsx)("canvas",{className:"excalidraw__canvas",style:{width:t,height:n,cursor:r.oc.GRAB},width:o,height:a,ref:this.handleCanvasRef,onContextMenu:this.handleCanvasContextMenu,onPointerMove:this.handleCanvasPointerMove,onPointerUp:this.handleCanvasPointerUp,onPointerCancel:this.removePointer,onTouchMove:this.handleTouchMove,onPointerDown:this.handleCanvasPointerDown,children:m("labels.drawingCanvas")}):(0,b.jsx)("canvas",{className:"excalidraw__canvas",style:{width:t,height:n},width:o,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:m("labels.drawingCanvas")})}render(){var e,t;const{zenModeEnabled:n,viewModeEnabled:r}=this.state,i=Bl(this.scene.getElements(),this.state),{onCollabButtonClick:o,renderTopRightUI:a,renderFooter:s,renderCustomStats:l}=this.props;return(0,b.jsx)("div",{className:xe("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,b.jsx)(pg.Provider,{value:this.excalidrawContainerValue,children:(0,b.jsxs)(ug.Provider,{value:this.deviceType,children:[(0,b.jsx)(ig,{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:g().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,b.jsx)("div",{className:"excalidraw-textEditorContainer"}),(0,b.jsx)("div",{className:"excalidraw-contextMenuContainer"}),1===i.length&&this.state.showHyperlinkPopup&&(0,b.jsx)(gc,{element:i[0],appState:this.state,setAppState:this.setAppState,onLinkOpen:this.props.onLinkOpen},i[0].id),this.state.showStats&&(0,b.jsx)(og,{appState:this.state,setAppState:this.setAppState,elements:this.scene.getElements(),onClose:this.toggleStats,renderCustomStats:l}),null!==this.state.toastMessage&&(0,b.jsx)(ag,{message:this.state.toastMessage,clearToast:this.clearToast}),(0,b.jsx)("main",{children:this.renderCanvas()})]})})})}async componentDidMount(){var e,t,n=this;if(this.unmounted=!1,this.excalidrawContainerValue.container=this.excalidrawContainerRef.current,"production"===r.Vi.TEST||"production"===r.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<r.kV||t<r.Yx&&e<r.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(r.kV,"px), (max-height: ").concat(r.Yx,"px) and (max-width: ").concat(r.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(),br=new WeakMap,vr=new WeakMap,Tr=new WeakMap,this.scene=new Kn,this.history=new Zh,this.actionManager=new th(this.syncActionResult,(()=>this.state),(()=>this.scene.getElementsIncludingDeleted()),this),this.library=new Kh(this),this.canvas=null,this.rc=null,this.excalidrawContainerRef.current=void 0,this.nearestScrollableContainer=void 0,this.excalidrawContainerValue={container:null,id:"unmounted"},clearTimeout(kg),kg=0}removeEventListeners(){var e,t,n,i,o,a;document.removeEventListener(r.Ks.POINTER_UP,this.removePointer),document.removeEventListener(r.Ks.COPY,this.onCopy),document.removeEventListener(r.Ks.PASTE,this.pasteFromClipboard),document.removeEventListener(r.Ks.CUT,this.onCut),null===(e=this.nearestScrollableContainer)||void 0===e||e.removeEventListener(r.Ks.SCROLL,this.onScroll),document.removeEventListener(r.Ks.KEYDOWN,this.onKeyDown,!1),document.removeEventListener(r.Ks.MOUSE_MOVE,this.updateCurrentCursorPosition,!1),document.removeEventListener(r.Ks.KEYUP,this.onKeyUp),window.removeEventListener(r.Ks.RESIZE,this.onResize,!1),window.removeEventListener(r.Ks.UNLOAD,this.onUnload,!1),window.removeEventListener(r.Ks.BLUR,this.onBlur,!1),null===(t=this.excalidrawContainerRef.current)||void 0===t||t.removeEventListener(r.Ks.DRAG_OVER,this.disableEvent,!1),null===(n=this.excalidrawContainerRef.current)||void 0===n||n.removeEventListener(r.Ks.DROP,this.disableEvent,!1),null===(i=document.fonts)||void 0===i||null===(o=i.removeEventListener)||void 0===o||o.call(i,"loadingdone",this.onFontLoaded),document.removeEventListener(r.Ks.GESTURE_START,this.onGestureStart,!1),document.removeEventListener(r.Ks.GESTURE_CHANGE,this.onGestureChange,!1),document.removeEventListener(r.Ks.GESTURE_END,this.onGestureEnd,!1),null===(a=this.detachIsMobileMqHandler)||void 0===a||a.call(this)}addEventListeners(){var e,t,n,i;this.removeEventListeners(),document.addEventListener(r.Ks.POINTER_UP,this.removePointer),document.addEventListener(r.Ks.COPY,this.onCopy),this.props.handleKeyboardGlobally&&document.addEventListener(r.Ks.KEYDOWN,this.onKeyDown,!1),document.addEventListener(r.Ks.KEYUP,this.onKeyUp,{passive:!0}),document.addEventListener(r.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(r.Ks.GESTURE_START,this.onGestureStart,!1),document.addEventListener(r.Ks.GESTURE_CHANGE,this.onGestureChange,!1),document.addEventListener(r.Ks.GESTURE_END,this.onGestureEnd,!1),this.state.viewModeEnabled||(document.addEventListener(r.Ks.PASTE,this.pasteFromClipboard),document.addEventListener(r.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(r.Ks.SCROLL,this.onScroll)),window.addEventListener(r.Ks.RESIZE,this.onResize,!1),window.addEventListener(r.Ks.UNLOAD,this.onUnload,!1),window.addEventListener(r.Ks.BLUR,this.onBlur,!1),null===(n=this.excalidrawContainerRef.current)||void 0===n||n.addEventListener(r.Ks.DRAG_OVER,this.disableEvent,!1),null===(i=this.excalidrawContainerRef.current)||void 0===i||i.addEventListener(r.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"})}),"eraser"===this.state.activeTool.type&&t.theme!==this.state.theme&&Xt(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?r.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(oc)}));const{multiElement:i}=t;t.activeTool!==this.state.activeTool&&null!=i&&So(this.state)&&Te(i,!1)&&Oo(i,this.state,this.scene,on(Eo.getPointAtIndexGlobalCoordinates(i,-1)));const o={},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),o[t]=e.button)}));const d=this.scene.getElements().filter((e=>(!ke(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:o,remoteSelectedElementIds:s,remotePointerUsernames:l,remotePointerUserStates:c,shouldCacheIgnoreZoom:this.state.shouldCacheIgnoreZoom,theme:this.state.theme,imageCache:this.imageCache,isExporting:!1,renderScrollbars:!this.deviceType.isMobile});h&&(_g=h);const p=!Ee(this.state.editingElement)&&(!u&&d.length>0);var g,f;(this.state.scrolledOutside!==p&&this.setState({scrolledOutside:p}),this.history.record(this.state,this.scene.getElementsIncludingDeleted()),this.scheduleImageRefresh(),this.state.isLoading)||(null===(g=(f=this.props).onChange)||void 0===g||g.call(f,this.scene.getElementsIncludingDeleted(),this.state,this.files,this.props.id))}static resetTapTwice(){fg=!1}addTextFromPaste(e){const{x:t,y:n}=Jt({clientX:bg,clientY:vg},this.state),i=ri({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:r.hs,locked:!1});this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),i]),this.setState({selectedElementIds:{[i.id]:!0}}),this.history.resumeRecording()}setActiveTool(e){var t;yg||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&&Ee(i)?ii(i,{text:t,isDeleted:r,originalText:n}):i))])};Sl({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),Ol(e)&&No(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&&$o(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&&Ee(n)&&!n.isDeleted?n:null}getElementAtPosition(e,t,n){const r=this.getElementsAtPosition(e,t,null==n?void 0:n.includeBoundTextElement,null==n?void 0:n.includeLockedElements);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 Ni(i,this.state,e,t)?r[r.length-2]:i}return 1===r.length?r[0]:null}getElementsAtPosition(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return((e,t)=>e.filter((e=>!e.isDeleted&&t(e))))(n&&r?this.scene.getElements():this.scene.getElements().filter((e=>(r||!e.locked)&&(n||!(Ee(e)&&e.containerId)))),(n=>((e,t,n,r)=>{const i=10/t.zoom.value,o=[n,r];return Fi(t,e)?Ui(e,o,i):Hi(e,t,o)})(n,this.state,e,t)))}maybeCleanupAfterMissingPointerUp(e){null!==Cg&&Cg(e)}updateGestureOnPointerDown(e){Sg.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),2===Sg.pointers.size&&(Sg.lastCenter=Wh(Sg.pointers),Sg.initialScale=this.state.zoom.value,Sg.initialDistance=Vh(Array.from(Sg.pointers.values())))}initialPointerDownState(e){const t=Jt(e,this.state),n=Bl(this.scene.getElements(),this.state),[r,i,o,a]=et(n);return{origin:t,withCmdOrCtrl:e[At.CTRL_OR_CMD],originInGrid:on(We(t.x,t.y,this.state.gridSize)),scrollbars:Dl(_g,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,ai(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;wg=!0,t.lastCoords.x=e.clientX,t.lastCoords.y=e.clientY;const n=cn((e=>{e.target instanceof HTMLElement&&this.handlePointerMoveOverScrollbars(e,t)})),i=ln((()=>{wg=!1,qt(this.canvas,this.state),Cg=null,this.setState({cursorButton:"up"}),this.savePointer(e.clientX,e.clientY,"up"),window.removeEventListener(r.Ks.POINTER_MOVE,n),window.removeEventListener(r.Ks.POINTER_UP,i),n.flush()}));return Cg=i,window.addEventListener(r.Ks.POINTER_MOVE,n),window.addEventListener(r.Ks.POINTER_UP,i),!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===At.ALT&&t.preventDefault(),this.maybeHandleResize(e,t)||this.maybeDragNewGenericElement(e,t)}))}onPointerMoveFromPointerDownHandler(e){return cn((t=>{var n,i;null===e.drag.offset&&(e.drag.offset=on(((e,t,n)=>{const[r,i]=et(e);return[t-r,n-i]})(Bl(this.scene.getElements(),this.state),e.origin.x,e.origin.y)));if(!(t.target instanceof HTMLElement))return;if(this.handlePointerMoveOverScrollbars(t,e))return;const o=Jt(t,this.state);if(kn(this.state))return void this.handleEraser(t,e,o);const[a,s]=We(o.x,o.y,this.state.gridSize);if(!e.drag.hasOccurred&&("arrow"===this.state.activeTool.type||"line"===this.state.activeTool.type)&&Be(o.x,o.y,e.origin.x,e.origin.y)<r.f)return;if(e.resize.isResizing&&(e.lastCoords.x=o.x,e.lastCoords.y=o.y,this.maybeHandleResize(e,t)))return!0;if(this.state.editingLinearElement){if(Eo.handlePointDragging(this.state,(e=>this.setState(e)),o.x,o.y,((e,t)=>{this.maybeSuggestBindingsForLinearElementAtCoords(e,t)})))return e.lastCoords.x=o.x,void(e.lastCoords.y=o.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===(i=e.hit.element)||void 0===i?void 0:i.id)||e.hit.hasHitElementInside)){const n=Bl(this.scene.getElements(),this.state);if(n.every((e=>e.locked)))return;if(e.drag.hasOccurred=!0,n.length>0&&!e.withCmdOrCtrl){const[r,i]=We(o.x-e.drag.offset.x,o.y-e.drag.offset.y,this.state.gridSize),[a,s]=[Math.abs(o.x-e.origin.x),Math.abs(o.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(ca(i,o,a,e,n,d),!n.groupIds.length||s.editingGroupId&&!Vr(s,n)){const t=or(n);t&&ca(i,o,a,e,t,d)}No(n,{simultaneouslyUpdated:t})}))}(e,n,r,i,l,a,s,this.state),this.maybeSuggestBindingForAll(n),t.altKey&&!e.hit.hasBeenDuplicated){e.hit.hasBeenDuplicated=!0;const t=[],n=[],o=new Map,a=new Map,s=e.hit.element,l=this.scene.getElementsIncludingDeleted(),c=Bl(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=si(this.state.editingGroupId,o,d),[l,c]=We(e.origin.x-e.drag.offset.x,e.origin.y-e.drag.offset.y,this.state.gridSize);Br(s,{x:s.x+(l-r),y:s.y+(c-i)}),t.push(s),n.push(d),a.set(d.id,s.id)}else t.push(d);const d=[...t,...n];Vn(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=o.x-l.x,r=o.y-l.y,i=e.length>0&&e[e.length-1];if(!(i&&i[0]===n&&i[1]===r)){const i=l.simulatePressure?l.pressures:[...l.pressures,t.pressure];Br(l,{points:[...e,[n,r]],pressures:i})}}else if(Ie(l)){e.drag.hasOccurred=!0;const n=l.points;let r=a-l.x,i=s-l.y;zt(t)&&2===n.length&&({width:r,height:i}=Ur(this.state.activeTool.type,r,i)),1===n.length?Br(l,{points:[...n,[r,i]]}):n.length>1&&Br(l,{points:[...n.slice(0,-1),[r,i]]}),Te(l,!1)&&this.maybeSuggestBindingsForLinearElementAtCoords(l,[o],this.state.startBoundElement)}else e.lastCoords.x=o.x,e.lastCoords.y=o.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||!zl(n,this.state)||(e.withCmdOrCtrl&&e.hit.element?this.setState((t=>Zr(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!1===e.locked&&"selection"!==e.type&&!Pe(e)&&n<=t&&r<=a&&i>=s&&o>=l}))})(n,l);this.setState((n=>Zr(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:i,multiElement:o,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:o||Ee(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(oc);if(Cg=null,e.eventListeners.onMove&&e.eventListeners.onMove.flush(),window.removeEventListener(r.Ks.POINTER_MOVE,e.eventListeners.onMove),window.removeEventListener(r.Ks.POINTER_UP,e.eventListeners.onUp),window.removeEventListener(r.Ks.KEYDOWN,e.eventListeners.onKeyDown),window.removeEventListener(r.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 Br(n,{points:[...r,[i,o]],pressures:a,lastCommittedPoint:[i,o]}),void this.actionManager.executeAction(oc)}if(ke(n)){const e=n;try{this.initializeImageDimensions(e),this.setState({selectedElementIds:{[e.id]:!0}},(()=>{this.actionManager.executeAction(oc)}))}catch(t){console.error(t),this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().filter((t=>t.id!==e.id))),this.actionManager.executeAction(oc)}return}if(Ie(n)){n.points.length>1&&this.history.resumeRecording();const r=Jt(t,this.state);return void(e.drag.hasOccurred||!n||o?e.drag.hasOccurred&&!o&&(So(this.state)&&Te(n,!1)&&Oo(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})}))))):(Br(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&&Fr(n))return this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().slice(0,-1)),void this.setState({draggingElement:null});n&&Br(n,Kr(n)),i&&this.history.resumeRecording(),i&&Fr(i)&&this.scene.replaceAllElements(this.scene.getElementsIncludingDeleted().filter((e=>e.id!==i.id)));const u=e.hit.element;if(kn(this.state)){if(0===Be(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(Vr(this.state,u)){const e=u.groupIds.flatMap((e=>qr(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=>Zr(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({},Zr(Object.assign(Object.assign({},e),{selectedElementIds:{[u.id]:!0}}),this.scene.getElements()))));this.state.editingLinearElement||e.drag.hasOccurred||this.state.isResizing||!(u&&Ni(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||zl(this.scene.getElements(),this.state))&&this.history.resumeRecording(),(e.drag.hasOccurred||s||l)&&(So(this.state)?To:Do)(Bl(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,!1)?Wo(e).filter((e=>!t.has(e.id))):Oe(e,!1)?Yo(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,i,o){const a=Zs(this.scene.getElementsIncludingDeleted().filter((e=>!Ee(e))),e,t);if(a){const i=a.x+a.width/2,o=a.y+a.height/2;if(Math.hypot(e-i,t-o)<r.wZ){const{x:e,y:t}=en({sceneX:i,sceneY:o},n);return{viewportX:e,viewportY:t,elementCenterX:i,elementCenterY:o}}}}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=c.find((e=>e.code===this.props.langCode))||l;await p(e),this.setAppState({})}}Ig.defaultProps={UIOptions:r.cW};var jg=function(){var e=this;this.canvas=null,this.rc=null,this.unmounted=!1,this.deviceType={isMobile:!1,isTouchScreen:!1},this.excalidrawContainerRef=o().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&&Ol(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,i,o,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===(i=e.appState)||void 0===i?void 0:i.zenModeEnabled)||!1,u=(null==e||null===(o=e.appState)||void 0===o?void 0:o.gridSize)||null,h=(null==e||null===(a=e.appState)||void 0===a?void 0:a.theme)||r.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?r.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((()=>{yg=!1,this.setState({isBindingEnabled:!0})})),this.onUnload=()=>{this.onBlur()},this.disableEvent=e=>{e.preventDefault()},this.onFontLoaded=()=>{this.scene.getElementsIncludingDeleted().forEach((e=>{Ee(e)&&wr(e)})),this.onSceneUpdated()},this.importLibraryFromUrl=async(e,t)=>{if(window.location.hash.includes(r.ah.addLibrary)){const e=new URLSearchParams(window.location.hash.slice(1));e.delete(r.ah.addLibrary),window.history.replaceState({},r.iC,"#".concat(e.toString()))}else if(window.location.search.includes(r.UO.addLibrary)){const e=new URLSearchParams(window.location.search);e.delete(r.UO.addLibrary),window.history.replaceState({},r.iC,"?".concat(e.toString()))}try{const n=await fetch(decodeURIComponent(e)),r=await n.blob(),i="published",o=await Ed(r,i);(t===this.id||window.confirm(m("alerts.confirmAddLibrary",{numShapes:o.length})))&&await this.library.importLibrary(o,i)}catch(e){console.error(e),this.setState({errorMessage:m("errors.importLibraryError")})}finally{this.focusContainer()}},this.resetHistory=()=>{this.history.clear()},this.resetScene=ln((e=>{this.scene.replaceAllElements([]),this.setState((t=>Object.assign(Object.assign({},bn()),{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 i=null;try{var o;i=await this.props.initialData||null,null!==(o=i)&&void 0!==o&&o.libraryItems&&this.library.importLibrary(i.libraryItems,"unpublished")}catch(e){console.error(e),i={appState:{errorMessage:e.message||"Encountered an error during importing or restoring scene data"}}}const a=md(i,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=i)&&void 0!==e&&e.scrollToContent&&(a.appState=Object.assign(Object.assign({},a.appState),ll(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=i)||void 0===t?void 0:t.scrollX)&&(a.appState.scrollX=i.scrollX),null!=(null===(n=i)||void 0===n?void 0:n.scrollY)&&(a.appState.scrollY=i.scrollY),this.resetHistory(),this.syncActionResult(Object.assign(Object.assign({},a),{commitToHistory:!0}));const s=new URLSearchParams(window.location.hash.slice(1)).get(r.ah.addLibrary)||new URLSearchParams(window.location.search).get(r.UO.addLibrary);s&&await this.importLibraryFromUrl(s)},this.onResize=ln((()=>{this.scene.getElementsIncludingDeleted().forEach((e=>wr(e))),this.setState({})})),this.onScroll=Kt((()=>{const{offsetTop:e,offsetLeft:t}=this.getCanvasOffsets();this.setState((n=>n.offsetLeft===t&&n.offsetTop===e?null:{offsetTop:e,offsetLeft:t}))}),r.HM),this.onCut=ln((e=>{var t;(null===(t=this.excalidrawContainerRef.current)||void 0===t?void 0:t.contains(document.activeElement))&&!Ht(e.target)&&(this.cutAll(),e.preventDefault(),e.stopPropagation())})),this.onCopy=ln((e=>{var t;(null===(t=this.excalidrawContainerRef.current)||void 0===t?void 0:t.contains(document.activeElement))&&!Ht(e.target)&&(this.copyAll(),e.preventDefault(),e.stopPropagation())})),this.cutAll=()=>{this.actionManager.executeAction(Uu,"keyboard")},this.copyAll=()=>{this.actionManager.executeAction(Fu,"keyboard")},this.onTapStart=e=>{if(dt||e.preventDefault(),!fg)return fg=!0,clearTimeout(mg),void(mg=window.setTimeout(Ig.resetTapTwice,r.Gj));if(fg&&1===e.touches.length){const[t]=e.touches;this.handleCanvasDoubleClick({clientX:t.clientX,clientY:t.clientY}),fg=!1,clearTimeout(mg)}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}):Sg.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(bg,vg);if(e&&(!(i instanceof HTMLCanvasElement)||Ht(r)))return;let o=null==e||null===(n=e.clipboardData)||void 0===n?void 0:n.files[0];const a=await hu(e);if(!o&&a.text){const e=a.text.trim();e.startsWith("<svg")&&e.endsWith("</svg>")&&(o=Td(e))}if(_d(o)&&!a.spreadsheet){const{x:e,y:t}=Jt({clientX:bg,clientY:vg},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=gd(e.elements,null),[n,r,i,o]=et(t),a=Wt(n,i)/2,s=Wt(r,o)/2,l="object"==typeof e.position?e.position.clientX:"cursor"===e.position?bg:this.state.width/2+this.state.offsetLeft,c="object"==typeof e.position?e.position.clientY:"cursor"===e.position?vg: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,[f,m]=We(h,p,this.state.gridSize),b=new Map,v=t.map((e=>{const t=si(this.state.editingGroupId,g,e,{x:e.x+f-n,y:e.y+m-r});return b.set(e.id,t.id),t}));Vn(v,t,b);const y=[...this.scene.getElementsIncludingDeleted(),...v];Xo(y,t,b),e.files&&(this.files=Object.assign(Object.assign({},this.files),e.files)),this.scene.replaceAllElements(y),this.history.resumeRecording(),this.setState(Zr(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=>{kg&&this.resetContextMenuTimer(),Sg.pointers.delete(e.pointerId)},this.toggleLock=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"ui";e.state.activeTool.locked||uc("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(Yu)},this.toggleStats=()=>{this.actionManager.executeAction(Zu)},this.scrollToContent=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.scene.getElements();e.setState(Object.assign({},ll(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,r.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=>{_e(e)&&t.has(e.fileId)&&(this.imageCache.delete(e.fileId),wr(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(new Promise((async(t,n)=>{try{t(vd(await e.libraryItems,"unpublished"))}catch(e){n(new Error(m("errors.importLibraryError")))}})))})),this.onSceneUpdated=()=>{this.setState({})},this.updateCurrentCursorPosition=ln((e=>{bg=e.clientX,vg=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}})),!(Ht(e.target)&&e.key!==At.ESCAPE||Lt(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===At.QUESTION_MARK&&this.setState({showHelpDialog:!0}),!this.actionManager.handleKeyDown(e)&&!this.state.viewModeEnabled)){if(e[At.CTRL_OR_CMD]&&this.state.isBindingEnabled&&this.setState({isBindingEnabled:!1}),e.code===wt&&this.setState({isLibraryOpen:!this.state.isLibraryOpen}),Lt(e.key)){const t=this.state.gridSize&&(e.shiftKey?r.$e:this.state.gridSize)||(e.shiftKey?r.Iw:r.$e),n=Bl(this.scene.getElements(),this.state,!0);let i=0,o=0;e.key===At.ARROW_LEFT?i=-t:e.key===At.ARROW_RIGHT?i=t:e.key===At.ARROW_UP?o=-t:e.key===At.ARROW_DOWN&&(o=t),n.forEach((e=>{Br(e,{x:e.x+i,y:e.y+o}),No(e,{simultaneouslyUpdated:n})})),this.maybeSuggestBindingForAll(n),e.preventDefault()}else if(e.key===At.ENTER){const t=Bl(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 Eo(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=Xh.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&&uc("toolbar",t,"keyboard (".concat(this.deviceType.isMobile?"mobile":"desktop",")")),this.setActiveTool(Object.assign(Object.assign({},this.state.activeTool),{type:t})),e.stopPropagation()):e.key===At.Q&&(this.toggleLock("keyboard"),e.stopPropagation())}if(e.key===At.SPACE&&0===Sg.pointers.size&&(yg=!0,Gt(this.canvas,r.oc.GRABBING),e.preventDefault()),!(e.key!==At.G&&e.key!==At.S||e.altKey||e[At.CTRL_OR_CMD])){const t=Bl(this.scene.getElements(),this.state);if("selection"===this.state.activeTool.type&&!t.length)return;e.key===At.G&&(Hs(this.state.activeTool.type)||t.some((e=>Hs(e.type))))&&(this.setState({openPopup:"backgroundColorPicker"}),e.stopPropagation()),e.key===At.S&&(this.setState({openPopup:"strokeColorPicker"}),e.stopPropagation())}}})),this.onKeyUp=ln((e=>{if(e.key===At.SPACE&&(this.state.viewModeEnabled?Gt(this.canvas,r.oc.GRAB):"selection"===this.state.activeTool.type?Vt(this.canvas):(qt(this.canvas,this.state),this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})),yg=!1),e[At.CTRL_OR_CMD]||this.state.isBindingEnabled||this.setState({isBindingEnabled:!0}),Lt(e.key)){const e=Bl(this.scene.getElements(),this.state);So(this.state)?To(e):Do(e),this.setState({suggestedBindings:[]})}})),this.onGestureStart=ln((e=>{e.preventDefault(),this.setState({selectedElementIds:{}}),Sg.initialScale=this.state.zoom.value})),this.onGestureChange=ln((e=>{if(e.preventDefault(),Sg.pointers.size>=2)return;const t=Sg.initialScale;t&&this.setState((n=>Object.assign({},dl({viewportX:bg,viewportY:vg,nextZoom:cl(t*e.scale)},n))))})),this.onGestureEnd=ln((e=>{e.preventDefault(),this.setState({previousSelectedElementIds:{},selectedElementIds:this.state.previousSelectedElementIds}),Sg.initialScale=null})),this.startTextEditing=e=>{var t,n,i,o,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=Bl(this.scene.getElements(),this.state);if(1===g.length&&(Ee(g[0])?h=g[0]:Ae(g[0],!1)&&(h=or(g[0]))),h=null!==(t=h)&&void 0!==t?t:this.getTextElementAtPosition(s,l),p||h||!c&&!u||(p=Zs(this.scene.getElements().filter((e=>Ae(e,!1)&&!or(e))),s,l)),!h&&p){const e={fontSize:this.state.currentItemFontSize,fontFamily:this.state.currentItemFontFamily},t=tr(Ut(e)),n=nr(Ut(e)),r=Math.max(p.height,n),i=Math.max(p.width,t);Br(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 f=h||ri({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?r.oX.MIDDLE:r.hs,containerId:null!==(n=null===(i=p)||void 0===i?void 0:i.id)&&void 0!==n?n:void 0,groupIds:null!==(o=null===(a=p)||void 0===a?void 0:a.groupIds)&&void 0!==o?o:[],locked:!1});this.setState({editingElement:f}),h||(this.scene.replaceAllElements([...this.scene.getElementsIncludingDeleted(),f]),u||Br(f,{y:f.y-f.baseline/2})),this.setState({editingElement:f}),this.handleTextWysiwyg(f,{isExistingElement:!!h})},this.handleCanvasDoubleClick=e=>{if(this.state.multiElement)return;if("selection"!==this.state.activeTool.type)return;const t=Bl(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 Eo(t[0],this.scene)})));Vt(this.canvas);let{x:n,y:r}=Jt(e,this.state);if(Yr(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=>Zr(Object.assign(Object.assign({},n),{editingGroupId:t,selectedElementIds:{[e.id]:!0},selectedGroupIds:{}}),this.scene.getElements())))}if(Vt(this.canvas),!e[At.CTRL_OR_CMD]&&!this.state.viewModeEnabled){const t=Bl(this.scene.getElements(),this.state);if(1===t.length){const e=t[0];Le(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&&wc(n,this.state,[e.x,e.y],this.deviceType.isMobile))))},this.redirectToLink=(e,t)=>{const n=Be(this.lastPointerDown.clientX,this.lastPointerDown.clientY,this.lastPointerUp.clientX,this.lastPointerUp.clientY);if(!this.hitLinkElement||t&&n>r.f||!t&&0!==n)return;const i=Jt(this.lastPointerDown,this.state),o=wc(this.hitLinkElement,this.state,[i.x,i.y],this.deviceType.isMobile),a=Jt(this.lastPointerUp,this.state),s=wc(this.hitLinkElement,this.state,[a.x,a.y],this.deviceType.isMobile);if(o&&s){const t=this.hitLinkElement.link;if(t){var l;let n;if(this.props.onLinkOpen&&(n=pn(r.Ks.EXCALIDRAW_LINK,e.nativeEvent),this.props.onLinkOpen(this.hitLinkElement,n)),null===(l=n)||void 0===l||!l.defaultPrevented){const e=bc(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),Sg.pointers.has(e.pointerId)&&Sg.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY});const t=Sg.initialScale;if(2===Sg.pointers.size&&Sg.lastCenter&&t&&Sg.initialDistance){const e=Wh(Sg.pointers),n=e.x-Sg.lastCenter.x,r=e.y-Sg.lastCenter.y;Sg.lastCenter=e;const i=Vh(Array.from(Sg.pointers.values())),o="freedraw"===this.state.activeTool.type&&this.state.penMode?1:i/Sg.initialDistance,a=o?cl(t*o):this.state.zoom.value;this.setState((t=>{const i=dl({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 Sg.lastCenter=Sg.initialDistance=Sg.initialScale=null;if(yg||xg||wg)return;const n=Dl(_g,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 i=Jt(e,this.state),{x:o,y:a}=i;if(this.state.editingLinearElement&&!this.state.editingLinearElement.isDragging){const t=Eo.handlePointerMove(e,o,a,this.state.editingLinearElement,this.state.gridSize);t!==this.state.editingLinearElement&&this.setState({editingLinearElement:t}),null!=t.lastUncommittedPoint?this.maybeSuggestBindingAtCursor(i):this.setState({suggestedBindings:[]})}if(Me(this.state.activeTool.type)){const{draggingElement:e}=this.state;Te(e,!1)?this.maybeSuggestBindingsForLinearElementAtCoords(e,[i],this.state.startBoundElement):this.maybeSuggestBindingAtCursor(i)}if(this.state.multiElement){const{multiElement:e}=this.state,{x:t,y:n}=e,{points:i,lastCommittedPoint:s}=e,l=i[i.length-1];return qt(this.canvas,this.state),void(l===s?Be(o-t,a-n,l[0],l[1])>=r.qx?Br(e,{points:[...i,[o-t,a-n]]}):Gt(this.canvas,r.oc.POINTER):i.length>2&&s&&Be(o-t,a-n,s[0],s[1])<r.qx?(Gt(this.canvas,r.oc.POINTER),Br(e,{points:i.slice(0,-1)})):(Ne(i,this.state.zoom.value)&&Gt(this.canvas,r.oc.POINTER),Br(e,{points:[...i.slice(0,-1),[o-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=Bl(s,this.state);if(1!==l.length||n||this.state.editingLinearElement){if(l.length>1&&!n){const t=wo(et(l),o,a,this.state.zoom,e.pointerType);if(t)return void Gt(this.canvas,ko({transformHandleType:t}))}}else{const t=xo(s,this.state,o,a,this.state.zoom,e.pointerType);if(t&&t.transformHandleType)return void Gt(this.canvas,ko(t))}const c=this.getElementAtPosition(i.x,i.y);var d,u;if(this.hitLinkElement=this.getElementLinkAtPosition(i,c),!kn(this.state))if(this.hitLinkElement&&!this.state.selectedElementIds[this.hitLinkElement.id])Gt(this.canvas,r.oc.POINTER),d=this.hitLinkElement,u=this.state,_c&&clearTimeout(_c),_c=window.setTimeout((()=>kc(d,u)),r.sA);else if(_c&&clearTimeout(_c),pc&&(pc=!1,ul().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,Ee(c)?r.oc.TEXT:r.oc.CROSSHAIR);else if(this.state.viewModeEnabled)Gt(this.canvas,r.oc.GRAB);else if(n)Gt(this.canvas,r.oc.AUTO);else if(this.state.editingLinearElement){const e=Eo.getElement(this.state.editingLinearElement.elementId);e&&Hi(e,this.state,[i.x,i.y])?Gt(this.canvas,r.oc.MOVE):Gt(this.canvas,r.oc.AUTO)}else e[At.CTRL_OR_CMD]||!c&&!this.isHittingCommonBoundingBoxOfSelectedElements(i,l)||null!=c&&c.locked?Gt(this.canvas,r.oc.AUTO):Gt(this.canvas,r.oc.MOVE)},this.handleEraser=(e,t,n)=>{const i=n=>{n.forEach((n=>{n.locked||(o.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}))}))},o=[],a=Be(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(i(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,r=(1-e)*l.y+e*n.y;l.x=t,l.y=r}const d=this.scene.getElements().map((n=>{const i=Pe(n)&&o.includes(n.containerId)?n.containerId:n.id;if(o.includes(i)){if(!e.altKey)return Nr(n,{opacity:r.xY});if(t.elementIdsToErase[i]&&!1===t.elementIdsToErase[i].erase)return Nr(n,{opacity:t.elementIdsToErase[i].opacity})}return n}));this.scene.replaceAllElements(d),t.lastCoords.x=n.x,t.lastCoords.y=n.y},this.handleTouchMove=e=>{Eg=!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})),xg)return;if(this.lastPointerDown=e,this.setState({lastPointerDownWith:e.pointerType,cursorButton:"down"}),this.savePointer(e.clientX,e.clientY,"down"),this.updateGestureOnPointerDown(e),this.handleCanvasPanUsingWheelOrSpaceDrag(e))return;if(e.button!==r.Oh.MAIN&&e.button!==r.Oh.TOUCH)return;if(Sg.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,r.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);Br(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 i=this.onPointerMoveFromPointerDownHandler(n),o=this.onPointerUpFromPointerDownHandler(n),a=this.onKeyDownFromPointerDownHandler(n),s=this.onKeyUpFromPointerDownHandler(n);Cg=o,this.state.viewModeEnabled||(window.addEventListener(r.Ks.POINTER_MOVE,i),window.addEventListener(r.Ks.POINTER_UP,o),window.addEventListener(r.Ks.KEYDOWN,a),window.addEventListener(r.Ks.KEYUP,s),n.eventListeners.onMove=i,n.eventListeners.onUp=o,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&&(Eg=!1,kg?Eg=!0:kg=window.setTimeout((()=>{kg=0,Eg||this.handleCanvasContextMenu(e)}),r.nM))},this.resetContextMenuTimer=()=>{clearTimeout(kg),kg=0,Eg=!1},this.handleCanvasPanUsingWheelOrSpaceDrag=e=>{if(!(Sg.pointers.size<=1&&(e.button===r.Oh.WHEEL||e.button===r.Oh.MAIN&&yg||this.state.viewModeEnabled))||Ee(this.state.editingElement))return!1;xg=!0,e.preventDefault();let t=!1;const n=/Linux/.test(window.navigator.platform);Gt(this.canvas,r.oc.GRABBING);let{clientX:i,clientY:o}=e;const a=cn((e=>{const a=i-e.clientX,s=o-e.clientY;if(i=e.clientX,o=e.clientY,n&&!t&&(Math.abs(a)>1||Math.abs(s)>1)){t=!0;const e=t=>{document.body.removeEventListener(r.Ks.PASTE,e),t.stopPropagation()},n=()=>{setTimeout((()=>{document.body.removeEventListener(r.Ks.PASTE,e),window.removeEventListener(r.Ks.POINTER_UP,n)}),100)};document.body.addEventListener(r.Ks.PASTE,e),window.addEventListener(r.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(Cg=()=>{Cg=null,xg=!1,yg||(this.state.viewModeEnabled?Gt(this.canvas,r.oc.GRAB):qt(this.canvas,this.state)),this.setState({cursorButton:"up"}),this.savePointer(e.clientX,e.clientY,"up"),window.removeEventListener(r.Ks.POINTER_MOVE,a),window.removeEventListener(r.Ks.POINTER_UP,s),window.removeEventListener(r.Ks.BLUR,s),a.flush()});return window.addEventListener(r.Ks.BLUR,s),window.addEventListener(r.Ks.POINTER_MOVE,a,{passive:!0}),window.addEventListener(r.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=Bl(r,this.state);if(1!==i.length||this.state.editingLinearElement)i.length>1&&(t.resize.handleType=wo(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=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(wc(t.hit.element,this.state,[t.origin.x,t.origin.y],this.deviceType.isMobile))return!1;t.hit.hasHitElementInside=Hi(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[At.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=>Zr(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(Ee(this.state.editingElement))return;let n=t.origin.x,r=t.origin.y;const i=this.getElementAtPosition(n,r,{includeBoundTextElement:!0});Le(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]=We(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,locked:!1},Object.assign(Object.assign({},ei(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];Br(o,{points:[[0,0]],pressures:s});const l=Ro(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]=We(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,locked:!1},Object.assign(Object.assign({},ei("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 Br(e,{lastCommittedPoint:e.points[e.points.length-1]}),void this.actionManager.executeAction(oc);const{x:t,y:i,lastCommittedPoint:o}=e;if(e.points.length>1&&o&&Be(n.origin.x-t,n.origin.y-i,o[0],o[1])<r.qx)return void this.actionManager.executeAction(oc);this.setState((t=>({selectedElementIds:Object.assign(Object.assign({},t.selectedElementIds),{[e.id]:!0})}))),Br(e,{lastCommittedPoint:e.points[e.points.length-1]}),Gt(this.canvas,r.oc.POINTER)}else{const[e,r]=We(n.origin.x,n.origin.y,this.state.gridSize),{currentItemStartArrowhead:i,currentItemEndArrowhead:o}=this.state,[a,s]="arrow"===t?[i,o]:[null,null],l=oi({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,locked:!1});this.setState((e=>({selectedElementIds:Object.assign(Object.assign({},e.selectedElementIds),{[l.id]:!1})}))),Br(l,{points:[...l.points,[0,0]]});const c=Ro(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]=We(t.origin.x,t.origin.y,this.state.gridSize),i=ti({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,locked:!1});"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?Nr(t,{opacity:e.elementIdsToErase[t.id].opacity}):Pe(t)&&e.elementIdsToErase[t.containerId]&&e.elementIdsToErase[t.containerId].erase?Nr(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?Nr(t,{isDeleted:!0}):t));this.history.resumeRecording(),this.scene.replaceAllElements(t)},this.initializeImage=async e=>{var t,n,i;let{imageFile:o,imageElement:a,showCursorImagePreview:s=!1}=e;if(!_d(o))throw new Error(m("errors.unsupportedFileType"));const l=o.type;if(Gt(this.canvas,"wait"),l===r.LO.svg)try{o=Td(await(async e=>{const t=(new DOMParser).parseFromString(e,r.LO.svg),n=t.querySelector("svg");if(t.querySelector("parsererror")||"svg"!==(null==(i=n)?void 0:i.nodeName.toLowerCase()))throw new Error(m("errors.invalidSVGString"));if(n.hasAttribute("xmlns")||n.setAttribute("xmlns",r.hR),!n.hasAttribute("width")||!n.hasAttribute("height")){const e=n.getAttribute("viewBox");let t=n.getAttribute("width")||"50",r=n.getAttribute("height")||"50";if(e){const n=e.match(/\d+ +\d+ +(\d+) +(\d+)/);n&&([,t,r]=n)}n.setAttribute("width",t),n.setAttribute("height",r)}return n.outerHTML;var i})(await o.text()),o.name)}catch(e){throw console.warn(e),new Error(m("errors.svgImageInsertError"))}const c=await((null===(t=(n=this.props).generateIdForFile)||void 0===t?void 0:t.call(n,o))||Sd(o));if(!c)throw console.warn("Couldn't generate file id or the supplied `generateIdForFile` didn't resolve to one."),new Error(m("errors.imageInsertError"));const d=this.files[c];if(null==d||!d.dataURL){try{o=await jd(o,{maxWidthOrHeight:r.h6})}catch(e){console.error("error trying to resing image file on insertion",e)}if(o.size>r.$n)throw new Error(m("errors.fileTooBig",{maxSize:"".concat(Math.trunc(r.$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||o)}const h=(null===(i=this.files[c])||void 0===i?void 0:i.dataURL)||await Id(o),p=Br(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(m("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){Br(e,{isDeleted:!0}),this.actionManager.executeAction(oc),this.setState({errorMessage:t.message||m("errors.imageInsertError")})}},this.setImagePreviewCursor=async e=>{const t=await jd(e,{maxWidthOrHeight:96});let n=await Id(t);if(e.type===r.LO.svg){const e=await zd(n);let t=Math.min(e.height,96),i=t*(e.width/e.height);i>96&&(i=96,t=i*(e.height/e.width));const o=document.createElement("canvas");o.height=t,o.width=i;o.getContext("2d").drawImage(e,0,0,i,t),n=o.toDataURL(r.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 cd({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(oc)}))):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(oc)}))}},this.initializeImageDimensions=function(t){var n;let i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const o=_e(t)&&(null===(n=e.imageCache.get(t.fileId))||void 0===n?void 0:n.image);if(!o||o instanceof Promise){if(t.width<r.f/e.state.zoom.value&&t.height<r.f/e.state.zoom.value){const n=100/e.state.zoom.value;Br(t,{x:t.x-n/2,y:t.y-n/2,width:n,height:n})}}else if(i||t.width<r.f/e.state.zoom.value&&t.height<r.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),i=Math.min(o.naturalHeight,r),a=i*(o.naturalWidth/o.naturalHeight),s=t.x+t.width/2-a/2,l=t.y+t.height/2-i/2;Br(t,{x:s,y:l,width:a,height:i})}},this.updateImageCache=async function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.files;const{updatedFiles:r,erroredFiles:i}=await Rd({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)&&wr(e);return i.size&&e.scene.replaceAllElements(e.scene.getElementsIncludingDeleted().map((e=>_e(e)&&i.has(e.fileId)?Nr(e,{status:"error"}):e))),{updatedFiles:r,erroredFiles:i}},this.addNewImagesToImageCache=async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Bd(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=cg()((()=>{this.addNewImagesToImageCache()}),r.LL),this.updateBindingEnabledOnPointerMove=e=>{const t=(e=>!e[At.CTRL_OR_CMD])(e);this.state.isBindingEnabled!==t&&this.setState({isBindingEnabled:t})},this.maybeSuggestBindingAtCursor=e=>{const t=Ro(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=Ro(r,this.scene);return null==i||Po(e,null==n?void 0:n.id,i)||t.push(i),t}),[]);this.setState({suggestedBindings:r})},this.handleCanvasRef=e=>{var t,n,i;null!==e?(this.canvas=e,this.rc=ve.canvas(this.canvas),this.canvas.addEventListener(r.Ks.WHEEL,this.handleWheel,{passive:!1}),this.canvas.addEventListener(r.Ks.TOUCH_START,this.onTapStart),this.canvas.addEventListener(r.Ks.TOUCH_END,this.onTapEnd)):(null===(t=this.canvas)||void 0===t||t.removeEventListener(r.Ks.WHEEL,this.handleWheel),null===(n=this.canvas)||void 0===n||n.removeEventListener(r.Ks.TOUCH_START,this.onTapStart),null===(i=this.canvas)||void 0===i||i.removeEventListener(r.Ks.TOUCH_END,this.onTapEnd))},this.handleAppOnDrop=async e=>{var t,n;try{const t=e.dataTransfer.files.item(0);if(_d(t)){if((null==t?void 0:t.type)===r.LO.png||(null==t?void 0:t.type)===r.LO.svg)try{if(ad)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:i}=Jt(e,this.state),o=this.createImageElement({sceneX:n,sceneY:i});return this.insertImageElement(o,t),this.initializeImageDimensions(o),void this.setState({selectedElementIds:{[o.id]:!0}})}}catch(e){return this.setState({isLoading:!1,errorMessage:e.message})}const i=e.dataTransfer.getData(r.LO.excalidrawlib);if(""!==i)return void this.addElementsFromPasteOrLibrary({elements:JSON.parse(i),position:e,files:null});const o=null===(t=e.dataTransfer)||void 0===t?void 0:t.files.item(0);if((null==o?void 0:o.type)===r.LO.excalidrawlib||null!=o&&null!==(n=o.name)&&void 0!==n&&n.endsWith(".excalidrawlib"))this.library.importLibrary(o).catch((e=>this.setState({isLoading:!1,errorMessage:e.message})));else if(o){if(this.setState({isLoading:!0}),ad)try{const t=e.dataTransfer.items[0];o.handle=await t.getAsFileSystemHandle()}catch(e){console.warn(e.name,e.message)}await this.loadFileToCanvas(o)}},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!==r.Oh.SECONDARY)&&"selection"!==this.state.activeTool.type)return;const{x:t,y:n}=Jt(e,this.state),i=this.getElementAtPosition(t,n,{preferSelected:!0,includeLockedElements:!0}),o=i?"element":"canvas",a=this.excalidrawContainerRef.current,{top:s,left:l}=a.getBoundingClientRect(),c=e.clientX-l,d=e.clientY-s;i&&!this.state.selectedElementIds[i.id]?this.setState(Zr(Object.assign(Object.assign({},this.state),{selectedElementIds:{[i.id]:!0}}),this.scene.getElements()),(()=>{this._openContextMenu({top:d,left:c},o)})):this._openContextMenu({top:d,left:c},o)},this.maybeDragNewGenericElement=(e,t)=>{const n=this.state.draggingElement,r=e.lastCoords;if(n)if("selection"===n.type&&"eraser"!==this.state.activeTool.type)da(n,this.state.activeTool.type,e.origin.x,e.origin.y,r.x,r.y,Wt(e.origin.x,r.x),Wt(e.origin.y,r.y),Dt(t),Pt(t));else{var i;const[o,a]=We(r.x,r.y,this.state.gridSize),s=_e(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;da(n,this.state.activeTool.type,e.originInGrid.x,e.originInGrid.y,o,a,Wt(e.originInGrid.x,o),Wt(e.originInGrid.y,a),ke(n)?!Dt(t):Dt(t),Pt(t),l),this.maybeSuggestBindingForAll([n])}},this.maybeHandleResize=(e,t)=>{const n=Bl(this.scene.getElements(),this.state),r=e.resize.handleType;this.setState({isResizing:r&&"rotation"!==r,isRotating:"rotation"===r});const i=e.lastCoords,[o,a]=We(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?(ta(c,s,l,i),No(c)):!Ie(c)||2!==c.points.length||"nw"!==t&&"ne"!==t&&"sw"!==t&&"se"!==t?!Ee(c)||"nw"!==t&&"ne"!==t&&"sw"!==t&&"se"!==t?t&&aa(e.originalElements,a,c,t,o,s,l):(oa(c,t,o,s,l),No(c)):na(c,r,i,s,l),!0}if(n.length>1){if("rotation"===t)return la(e,n,s,l,i,c,d),!0;if("nw"===t||"ne"===t||"sw"===t||"se"===t)return sa(n,t,s,l),!0}return!1})(e,r,n,e.resize.arrowDirection,zt(t),Pt(t),1===n.length&&ke(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=Su.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),o=Iu.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),a=Du.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),s=zu.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),l=Xu.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),c=qu.contextItemPredicate(this.actionManager.getElementsIncludingDeleted(),this.actionManager.getAppState()),d="separator",u=this.scene.getElements(),h=Bl(this.scene.getElements(),this.state),p=[];if(cu&&u.length>0&&p.push(Wu),lu&&u.length>0&&p.push(Ku),"element"===t&&Vu.contextItemPredicate(u,this.state)&&lu&&p.push(Vu),"canvas"===t){const e=[...p,void 0===this.props.gridModeEnabled&&Gu,void 0===this.props.zenModeEnabled&&Yu,void 0===this.props.viewModeEnabled&&sg,Zu];this.state.viewModeEnabled?ep.push({options:e,top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current,elements:u}):ep.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,cu&&u.length>0&&Wu,lu&&u.length>0&&Ku,lu&&h.length>0&&Vu,(cu&&u.length>0||lu&&u.length>0)&&d,nc,d,void 0===this.props.gridModeEnabled&&Gu,void 0===this.props.zenModeEnabled&&Yu,void 0===this.props.viewModeEnabled&&sg,Zu],top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current,elements:u})}else"element"===t&&(this.state.viewModeEnabled?ep.push({options:[navigator.clipboard&&Fu,...p],top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current,elements:u}):ep.push({options:[this.deviceType.isMobile&&Uu,this.deviceType.isMobile&&navigator.clipboard&&Fu,this.deviceType.isMobile&&navigator.clipboard&&{name:"paste",trackEvent:!1,perform:(e,t)=>(this.pasteFromClipboard(null),{commitToHistory:!1}),contextItemLabel:"labels.paste"},this.deviceType.isMobile&&d,...p,d,_u,ku,d,i&&Su,l&&Xu,c&&qu,o&&Iu,(i||o)&&d,Tu,d,Ql,Jl,ec,tc,d,a&&Du,s&&zu,(a||s)&&d,vc.contextItemPredicate(u,this.state)&&vc,rc,$u,d,Fl],top:r,left:n,actionManager:this.actionManager,appState:this.state,container:this.excalidrawContainerRef.current,elements:u}))},this.handleWheel=ln((e=>{if(e.preventDefault(),xg)return;const{deltaX:t,deltaY:n}=e,{selectedElementIds:i,previousSelectedElementIds:o}=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(o).length&&setTimeout((()=>{this.setState({selectedElementIds:o,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*r.V4*100)/(100*r.V4),this.setState((e=>Object.assign(Object.assign({},dl({viewportX:bg,viewportY:vg,nextZoom:cl(s)},e)),{selectedElementIds:{},previousSelectedElementIds:0!==Object.keys(i).length?i:o,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:Sg.pointers})},this.resetShouldCacheIgnoreZoomDebounced=Kt((()=>{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"!==r.Vi.TEST&&"production"!==r.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 Tg=Ig;n(4285),n(3313);var Mg=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 Og=e=>{var t;const{onHomeButtonClick:n,onChange:o,initialData:a,excalidrawRef:s,onCollabButtonClick:c,isCollaborating:d=!1,onPointerUpdate:u,renderTopRightUI:h,renderFooter:p,langCode:g=l.code,viewModeEnabled:f,zenModeEnabled:m,gridModeEnabled:v,libraryReturnUrl:y,theme:w,name:_,renderCustomStats:k,onPaste:E,detectScroll:C=!0,handleKeyboardGlobally:S=!1,onLibraryChange:I,autoFocus:j=!1,generateIdForFile:T,onLinkOpen:M,id:O}=e,A=null===(t=e.UIOptions)||void 0===t?void 0:t.canvasActions,L={canvasActions:!!A&&Object.assign(Object.assign({},r.cW.canvasActions),A)};var P;A&&"object"==typeof A.export&&(A.export.saveFileToDisk=(null===(P=A.export)||void 0===P?void 0:P.saveFileToDisk)||r.cW.canvasActions.export.saveFileToDisk);return(0,i.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,b.jsx)(x,{langCode:g,children:(0,b.jsx)(Ph,{unstable_createStore:()=>Nh,scope:Bh,children:(0,b.jsx)(Tg,{id:O,onHomeButtonClick:n,onChange:o,initialData:a,excalidrawRef:s,onCollabButtonClick:c,isCollaborating:d,onPointerUpdate:u,renderTopRightUI:h,renderFooter:p,langCode:g,viewModeEnabled:f,zenModeEnabled:m,gridModeEnabled:v,libraryReturnUrl:y,theme:w,name:_,renderCustomStats:k,UIOptions:L,onPaste:E,detectScroll:C,handleKeyboardGlobally:S,onLibraryChange:I,autoFocus:j,generateIdForFile:T,onLinkOpen:M})})})},Ag=(e,t)=>{const{initialData:n,UIOptions:r={}}=e,i=Mg(e,["initialData","UIOptions"]),{initialData:o,UIOptions:a={}}=t,s=Mg(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]))},Lg=(0,i.forwardRef)(((e,t)=>(0,b.jsx)(Og,Object.assign(Object.assign({},e),{excalidrawRef:t})))),Pg=o().memo(Lg,Ag)},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","copyText":"Copy to clipboard as text","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"},"elementLock":{"lock":"Lock","unlock":"Unlock","lockAll":"Lock all","unlockAll":"Unlock all"}},"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.","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.)","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.","importLibraryError":"Couldn\'t load library"},"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","toggleElementLock":"Lock/unlock 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/vendor-0e2ecbd1f46fc190ec01.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="ExcalidrawLib:",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.webpackChunkExcalidrawLib=self.webpackChunkExcalidrawLib||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),l(9498)})()}));
|