@things-factory/lexical-editor 6.0.22

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.
Files changed (179) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/assets/EquationComponent.2ae445bf.css +1 -0
  3. package/assets/EquationComponent.6db6bfa0.js +1 -0
  4. package/assets/ExcalidrawComponent.09670137.css +1 -0
  5. package/assets/ExcalidrawComponent.c66e3028.js +1 -0
  6. package/assets/ImageComponent.00db88d9.js +1 -0
  7. package/assets/ImageComponent.faf47ab5.css +1 -0
  8. package/assets/ImageResizer.9cd447ab.js +1 -0
  9. package/assets/KaTeX_AMS-Regular.0cdd387c.woff2 +0 -0
  10. package/assets/KaTeX_AMS-Regular.30da91e8.woff +0 -0
  11. package/assets/KaTeX_AMS-Regular.68534840.ttf +0 -0
  12. package/assets/KaTeX_Caligraphic-Bold.07d8e303.ttf +0 -0
  13. package/assets/KaTeX_Caligraphic-Bold.1ae6bd74.woff +0 -0
  14. package/assets/KaTeX_Caligraphic-Bold.de7701e4.woff2 +0 -0
  15. package/assets/KaTeX_Caligraphic-Regular.3398dd02.woff +0 -0
  16. package/assets/KaTeX_Caligraphic-Regular.5d53e70a.woff2 +0 -0
  17. package/assets/KaTeX_Caligraphic-Regular.ed0b7437.ttf +0 -0
  18. package/assets/KaTeX_Fraktur-Bold.74444efd.woff2 +0 -0
  19. package/assets/KaTeX_Fraktur-Bold.9163df9c.ttf +0 -0
  20. package/assets/KaTeX_Fraktur-Bold.9be7ceb8.woff +0 -0
  21. package/assets/KaTeX_Fraktur-Regular.1e6f9579.ttf +0 -0
  22. package/assets/KaTeX_Fraktur-Regular.51814d27.woff2 +0 -0
  23. package/assets/KaTeX_Fraktur-Regular.5e28753b.woff +0 -0
  24. package/assets/KaTeX_Main-Bold.0f60d1b8.woff2 +0 -0
  25. package/assets/KaTeX_Main-Bold.138ac28d.ttf +0 -0
  26. package/assets/KaTeX_Main-Bold.c76c5d69.woff +0 -0
  27. package/assets/KaTeX_Main-BoldItalic.70ee1f64.ttf +0 -0
  28. package/assets/KaTeX_Main-BoldItalic.99cd42a3.woff2 +0 -0
  29. package/assets/KaTeX_Main-BoldItalic.a6f7ec0d.woff +0 -0
  30. package/assets/KaTeX_Main-Italic.0d85ae7c.ttf +0 -0
  31. package/assets/KaTeX_Main-Italic.97479ca6.woff2 +0 -0
  32. package/assets/KaTeX_Main-Italic.f1d6ef86.woff +0 -0
  33. package/assets/KaTeX_Main-Regular.c2342cd8.woff2 +0 -0
  34. package/assets/KaTeX_Main-Regular.c6368d87.woff +0 -0
  35. package/assets/KaTeX_Main-Regular.d0332f52.ttf +0 -0
  36. package/assets/KaTeX_Math-BoldItalic.850c0af5.woff +0 -0
  37. package/assets/KaTeX_Math-BoldItalic.dc47344d.woff2 +0 -0
  38. package/assets/KaTeX_Math-BoldItalic.f9377ab0.ttf +0 -0
  39. package/assets/KaTeX_Math-Italic.08ce98e5.ttf +0 -0
  40. package/assets/KaTeX_Math-Italic.7af58c5e.woff2 +0 -0
  41. package/assets/KaTeX_Math-Italic.8a8d2445.woff +0 -0
  42. package/assets/KaTeX_SansSerif-Bold.1ece03f7.ttf +0 -0
  43. package/assets/KaTeX_SansSerif-Bold.e99ae511.woff2 +0 -0
  44. package/assets/KaTeX_SansSerif-Bold.ece03cfd.woff +0 -0
  45. package/assets/KaTeX_SansSerif-Italic.00b26ac8.woff2 +0 -0
  46. package/assets/KaTeX_SansSerif-Italic.3931dd81.ttf +0 -0
  47. package/assets/KaTeX_SansSerif-Italic.91ee6750.woff +0 -0
  48. package/assets/KaTeX_SansSerif-Regular.11e4dc8a.woff +0 -0
  49. package/assets/KaTeX_SansSerif-Regular.68e8c73e.woff2 +0 -0
  50. package/assets/KaTeX_SansSerif-Regular.f36ea897.ttf +0 -0
  51. package/assets/KaTeX_Script-Regular.036d4e95.woff2 +0 -0
  52. package/assets/KaTeX_Script-Regular.1c67f068.ttf +0 -0
  53. package/assets/KaTeX_Script-Regular.d96cdf2b.woff +0 -0
  54. package/assets/KaTeX_Size1-Regular.6b47c401.woff2 +0 -0
  55. package/assets/KaTeX_Size1-Regular.95b6d2f1.ttf +0 -0
  56. package/assets/KaTeX_Size1-Regular.c943cc98.woff +0 -0
  57. package/assets/KaTeX_Size2-Regular.2014c523.woff +0 -0
  58. package/assets/KaTeX_Size2-Regular.a6b2099f.ttf +0 -0
  59. package/assets/KaTeX_Size2-Regular.d04c5421.woff2 +0 -0
  60. package/assets/KaTeX_Size3-Regular.500e04d5.ttf +0 -0
  61. package/assets/KaTeX_Size3-Regular.6ab6b62e.woff +0 -0
  62. package/assets/KaTeX_Size4-Regular.99f9c675.woff +0 -0
  63. package/assets/KaTeX_Size4-Regular.a4af7d41.woff2 +0 -0
  64. package/assets/KaTeX_Size4-Regular.c647367d.ttf +0 -0
  65. package/assets/KaTeX_Typewriter-Regular.71d517d6.woff2 +0 -0
  66. package/assets/KaTeX_Typewriter-Regular.e14fed02.woff +0 -0
  67. package/assets/KaTeX_Typewriter-Regular.f01f3e87.ttf +0 -0
  68. package/assets/LexicalNestedComposer.412b5854.js +1 -0
  69. package/assets/PollComponent.7b32c9d1.js +1 -0
  70. package/assets/PollComponent.e519dbaf.css +1 -0
  71. package/assets/StickyComponent.64376704.css +1 -0
  72. package/assets/StickyComponent.821e162d.js +1 -0
  73. package/assets/TableComponent.b31a076f.js +1 -0
  74. package/assets/arrow-clockwise.2a5cb240.svg +1 -0
  75. package/assets/arrow-counterclockwise.7bfcc198.svg +1 -0
  76. package/assets/bg-color.507cd4d9.svg +1 -0
  77. package/assets/camera.30598594.svg +1 -0
  78. package/assets/card-checklist.4b2c9bb6.svg +1 -0
  79. package/assets/caret-right-fill.a00c19e8.svg +1 -0
  80. package/assets/cat-typing.29244fe9.gif +0 -0
  81. package/assets/chat-left-text.6b95a11e.svg +1 -0
  82. package/assets/chat-square-quote.11c47cee.svg +1 -0
  83. package/assets/chevron-down.7ab1bec2.svg +1 -0
  84. package/assets/clipboard.af70d3df.svg +1 -0
  85. package/assets/close.5a175ff6.svg +1 -0
  86. package/assets/code.211c00f3.svg +1 -0
  87. package/assets/comments.832aaea0.svg +1 -0
  88. package/assets/copy.0a348586.svg +1 -0
  89. package/assets/diagram-2.109ff72d.svg +1 -0
  90. package/assets/download.86c52f35.svg +1 -0
  91. package/assets/draggable-block-menu.a5121e96.svg +1 -0
  92. package/assets/dropdown-more.e77cf0f5.svg +1 -0
  93. package/assets/emoji-list.81a5609c.js +1 -0
  94. package/assets/figma.73378f91.svg +1 -0
  95. package/assets/file-earmark-text.ca11f66a.svg +4 -0
  96. package/assets/file-image.92c4290c.svg +1 -0
  97. package/assets/filetype-gif.6c82f677.svg +1 -0
  98. package/assets/font-color.babef7e0.svg +1 -0
  99. package/assets/font-family.6d11828a.svg +1 -0
  100. package/assets/gear.9752af63.svg +1 -0
  101. package/assets/horizontal-rule.f2611cd6.svg +1 -0
  102. package/assets/indent.9b11e20c.svg +1 -0
  103. package/assets/journal-code.281f8e59.svg +1 -0
  104. package/assets/justify.e3d375bb.svg +1 -0
  105. package/assets/landscape.21352c66.jpg +0 -0
  106. package/assets/link.dabc7da5.svg +1 -0
  107. package/assets/list-ol.03c2349b.svg +1 -0
  108. package/assets/list-ul.d6a7f4ba.svg +1 -0
  109. package/assets/lock-fill.b10c3357.svg +1 -0
  110. package/assets/lock.9d41d1f2.svg +1 -0
  111. package/assets/main.0e0c1acb.css +1 -0
  112. package/assets/main.df10c180.js +21 -0
  113. package/assets/markdown.5082cb8f.svg +1 -0
  114. package/assets/mic.507b1f72.svg +1 -0
  115. package/assets/outdent.b795c01f.svg +1 -0
  116. package/assets/paint-bucket.407066ee.svg +1 -0
  117. package/assets/palette.a72cd2c3.svg +1 -0
  118. package/assets/parser-babel.6f804a7c.js +1 -0
  119. package/assets/parser-html.66e60782.js +22 -0
  120. package/assets/parser-markdown.3f44829c.js +22 -0
  121. package/assets/parser-postcss.16fcf3bd.js +1 -0
  122. package/assets/pencil-fill.633b2c8d.svg +1 -0
  123. package/assets/plug-fill.0098ed23.svg +1 -0
  124. package/assets/plug.d8731872.svg +1 -0
  125. package/assets/plus-slash-minus.6e1f16e9.svg +1 -0
  126. package/assets/plus.cc33d039.svg +1 -0
  127. package/assets/prettier-error.0ed0d492.svg +1 -0
  128. package/assets/prettier.6c905155.svg +1 -0
  129. package/assets/send.3616a219.svg +1 -0
  130. package/assets/square-check.f4543561.svg +1 -0
  131. package/assets/standalone.07cb14af.js +22 -0
  132. package/assets/sticky.35cbc445.svg +1 -0
  133. package/assets/success-alt.33b01110.svg +1 -0
  134. package/assets/success.e7e6caa5.svg +1 -0
  135. package/assets/table.5b346097.svg +1 -0
  136. package/assets/text-center.3b97a1ce.svg +1 -0
  137. package/assets/text-left.37eb3c07.svg +1 -0
  138. package/assets/text-paragraph.f17ec370.svg +1 -0
  139. package/assets/text-right.69b7b3bf.svg +1 -0
  140. package/assets/trash.e93c6b1b.svg +1 -0
  141. package/assets/trash3.0a864fe5.svg +1 -0
  142. package/assets/tweet.9fbf1564.svg +1 -0
  143. package/assets/type-bold.1f17e5da.svg +1 -0
  144. package/assets/type-h1.83dd5e3b.svg +1 -0
  145. package/assets/type-h2.bb6b6d69.svg +1 -0
  146. package/assets/type-h3.27eb870e.svg +1 -0
  147. package/assets/type-h4.b9ba31db.svg +1 -0
  148. package/assets/type-h5.f6d2d205.svg +1 -0
  149. package/assets/type-h6.34dc2c46.svg +1 -0
  150. package/assets/type-italic.f9cdcec5.svg +1 -0
  151. package/assets/type-strikethrough.ea22e2f6.svg +1 -0
  152. package/assets/type-subscript.84ecc6bb.svg +1 -0
  153. package/assets/type-superscript.fd5795bc.svg +1 -0
  154. package/assets/type-underline.9639e1cd.svg +1 -0
  155. package/assets/upload.0365f49c.svg +1 -0
  156. package/assets/user.085d4653.svg +1 -0
  157. package/assets/yellow-flower.a2a7c7a2.jpg +0 -0
  158. package/assets/youtube.42d173dd.svg +1 -0
  159. package/client/bootstrap.ts +1 -0
  160. package/client/index.ts +0 -0
  161. package/client/tsconfig.json +11 -0
  162. package/dist-client/bootstrap.d.ts +1 -0
  163. package/dist-client/bootstrap.js +2 -0
  164. package/dist-client/bootstrap.js.map +1 -0
  165. package/dist-client/index.d.ts +0 -0
  166. package/dist-client/index.js +2 -0
  167. package/dist-client/index.js.map +1 -0
  168. package/dist-client/tsconfig.tsbuildinfo +1 -0
  169. package/dist-server/index.js +4 -0
  170. package/dist-server/index.js.map +1 -0
  171. package/dist-server/routes.js +28 -0
  172. package/dist-server/routes.js.map +1 -0
  173. package/dist-server/tsconfig.tsbuildinfo +1 -0
  174. package/package.json +32 -0
  175. package/server/index.ts +1 -0
  176. package/server/routes.ts +31 -0
  177. package/server/tsconfig.json +10 -0
  178. package/things-factory.config.js +1 -0
  179. package/views/public/html-editor-lexical.html +34 -0
@@ -0,0 +1 @@
1
+ import{r as e,f as t,a as n,j as r,M as o,B as i,u as a,g as l,d as s,c,$ as u,h as d,m as f,i as p,k as h,l as m,n as g,F as v}from"./main.df10c180.js";import{I as b}from"./ImageResizer.9cd447ab.js";var y,x,w={exports:{}},k={exports:{}};self,k.exports=(y=e.exports,x=t.exports,function(){var e,t,n,r,o={7945:function(e,t,n){e.exports=n(1602)},200:function(e,t,n){var r="Expected a function",o=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,l=/^0o[0-7]+$/i,s=parseInt,c="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,u="object"==typeof self&&self&&self.Object===Object&&self,d=c||u||Function("return this")(),f=Object.prototype.toString,p=Math.max,h=Math.min,m=function(){return d.Date.now()};function g(e,t,n){var o,i,a,l,s,c,u=0,d=!1,f=!1,g=!0;if("function"!=typeof e)throw new TypeError(r);function y(t){var n=o,r=i;return o=i=void 0,u=t,l=e.apply(r,n)}function x(e){return u=e,s=setTimeout(k,t),d?y(e):l}function w(e){var n=e-c;return void 0===c||n>=t||n<0||f&&e-u>=a}function k(){var e,n,r=m();if(w(r))return E(r);s=setTimeout(k,(n=t-((e=r)-c),f?h(n,a-(e-u)):n))}function E(e){return s=void 0,g&&o?y(e):(o=i=void 0,l)}function _(){var e=m(),n=w(e);if(o=arguments,i=this,c=e,n){if(void 0===s)return x(c);if(f)return s=setTimeout(k,t),y(c)}return void 0===s&&(s=setTimeout(k,t)),l}return t=b(t)||0,v(n)&&(d=!!n.leading,a=(f="maxWait"in n)?p(b(n.maxWait)||0,t):a,g="trailing"in n?!!n.trailing:g),_.cancel=function(){void 0!==s&&clearTimeout(s),u=0,o=c=i=s=void 0},_.flush=function(){return void 0===s?l:E(m())},_}function v(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function b(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||(n=t)&&"object"==typeof n&&"[object Symbol]"==f.call(t))return NaN;var t,n;if(v(e)){var r="function"==typeof e.valueOf?e.valueOf():e;e=v(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var c=a.test(e);return c||l.test(e)?s(e.slice(2),c?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var o=!0,i=!0;if("function"!=typeof e)throw new TypeError(r);return v(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),g(e,t,{leading:o,maxWait:t,trailing:i})}},2891:function(e,t,n){var r;e=n.nmd(e),function(){var o,i="Expected a function",a="__lodash_hash_undefined__",l="__lodash_placeholder__",s=16,c=32,u=64,d=128,f=256,p=1/0,h=9007199254740991,m=NaN,g=4294967295,v=[["ary",d],["bind",1],["bindKey",2],["curry",8],["curryRight",s],["flip",512],["partial",c],["partialRight",u],["rearg",f]],b="[object Arguments]",y="[object Array]",x="[object Boolean]",w="[object Date]",k="[object Error]",E="[object Function]",_="[object GeneratorFunction]",S="[object Map]",C="[object Number]",j="[object Object]",O="[object Promise]",I="[object RegExp]",M="[object Set]",T="[object String]",P="[object Symbol]",A="[object WeakMap]",L="[object ArrayBuffer]",D="[object DataView]",R="[object Float32Array]",z="[object Float64Array]",N="[object Int8Array]",H="[object Int16Array]",B="[object Int32Array]",F="[object Uint8Array]",U="[object Uint8ClampedArray]",K="[object Uint16Array]",W="[object Uint32Array]",V=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,Z=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Y=/&(?:amp|lt|gt|quot|#39);/g,X=/[&<>"']/g,q=RegExp(Y.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,oe=/[\\^$.*+?()[\]{}|]/g,ie=RegExp(oe.source),ae=/^\s+/,le=/\s/,se=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ce=/\{\n\/\* \[wrapped with (.+)\] \*/,ue=/,? & /,de=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,fe=/[()=,{}\[\]\/\s]/,pe=/\\(\\)?/g,he=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,me=/\w*$/,ge=/^[-+]0x[0-9a-f]+$/i,ve=/^0b[01]+$/i,be=/^\[object .+?Constructor\]$/,ye=/^0o[0-7]+$/i,xe=/^(?:0|[1-9]\d*)$/,we=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ke=/($^)/,Ee=/['\n\r\u2028\u2029\\]/g,_e="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Se="a-z\\xdf-\\xf6\\xf8-\\xff",Ce="A-Z\\xc0-\\xd6\\xd8-\\xde",je="\\ufe0e\\ufe0f",Oe="\\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",Ie="['’]",Me="[\\ud800-\\udfff]",Te="["+Oe+"]",Pe="["+_e+"]",Ae="\\d+",Le="[\\u2700-\\u27bf]",De="["+Se+"]",Re="[^\\ud800-\\udfff"+Oe+Ae+"\\u2700-\\u27bf"+Se+Ce+"]",ze="\\ud83c[\\udffb-\\udfff]",Ne="[^\\ud800-\\udfff]",He="(?:\\ud83c[\\udde6-\\uddff]){2}",Be="[\\ud800-\\udbff][\\udc00-\\udfff]",Fe="["+Ce+"]",Ue="(?:"+De+"|"+Re+")",Ke="(?:"+Fe+"|"+Re+")",We="(?:['’](?:d|ll|m|re|s|t|ve))?",Ve="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ge="(?:"+Pe+"|"+ze+")?",Ze="[\\ufe0e\\ufe0f]?",Ye=Ze+Ge+"(?:\\u200d(?:"+[Ne,He,Be].join("|")+")"+Ze+Ge+")*",Xe="(?:"+[Le,He,Be].join("|")+")"+Ye,qe="(?:"+[Ne+Pe+"?",Pe,He,Be,Me].join("|")+")",$e=RegExp(Ie,"g"),Qe=RegExp(Pe,"g"),Je=RegExp(ze+"(?="+ze+")|"+qe+Ye,"g"),et=RegExp([Fe+"?"+De+"+"+We+"(?="+[Te,Fe,"$"].join("|")+")",Ke+"+"+Ve+"(?="+[Te,Fe+Ue,"$"].join("|")+")",Fe+"?"+Ue+"+"+We,Fe+"+"+Ve,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ae,Xe].join("|"),"g"),tt=RegExp("[\\u200d\\ud800-\\udfff"+_e+je+"]"),nt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rt=["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,it={};it[R]=it[z]=it[N]=it[H]=it[B]=it[F]=it[U]=it[K]=it[W]=!0,it[b]=it[y]=it[L]=it[x]=it[D]=it[w]=it[k]=it[E]=it[S]=it[C]=it[j]=it[I]=it[M]=it[T]=it[A]=!1;var at={};at[b]=at[y]=at[L]=at[D]=at[x]=at[w]=at[R]=at[z]=at[N]=at[H]=at[B]=at[S]=at[C]=at[j]=at[I]=at[M]=at[T]=at[P]=at[F]=at[U]=at[K]=at[W]=!0,at[k]=at[E]=at[A]=!1;var lt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},st=parseFloat,ct=parseInt,ut="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,dt="object"==typeof self&&self&&self.Object===Object&&self,ft=ut||dt||Function("return this")(),pt=t&&!t.nodeType&&t,ht=pt&&e&&!e.nodeType&&e,mt=ht&&ht.exports===pt,gt=mt&&ut.process,vt=function(){try{return ht&&ht.require&&ht.require("util").types||gt&&gt.binding&&gt.binding("util")}catch(e){}}(),bt=vt&&vt.isArrayBuffer,yt=vt&&vt.isDate,xt=vt&&vt.isMap,wt=vt&&vt.isRegExp,kt=vt&&vt.isSet,Et=vt&&vt.isTypedArray;function _t(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 o=-1,i=null==e?0:e.length;++o<i;){var a=e[o];t(r,a,n(a),e)}return r}function Ct(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function jt(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function Ot(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 It(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}function Mt(e,t){return!(null==e||!e.length)&&Bt(e,t,0)>-1}function Tt(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}function Pt(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}function At(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function Lt(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function Dt(e,t,n,r){var o=null==e?0:e.length;for(r&&o&&(n=e[--o]);o--;)n=t(n,e[o],o,e);return n}function 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 zt=Wt("length");function Nt(e,t,n){var r;return n(e,(function(e,n,o){if(t(e,n,o))return r=n,!1})),r}function Ht(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}function Bt(e,t,n){return t==t?function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}(e,t,n):Ht(e,Ut,n)}function Ft(e,t,n,r){for(var o=n-1,i=e.length;++o<i;)if(r(e[o],t))return o;return-1}function Ut(e){return e!=e}function Kt(e,t){var n=null==e?0:e.length;return n?Zt(e,t)/n:m}function Wt(e){return function(t){return null==t?o:t[e]}}function Vt(e){return function(t){return null==e?o:e[t]}}function Gt(e,t,n,r,o){return o(e,(function(e,o,i){n=r?(r=!1,e):t(n,e,o,i)})),n}function Zt(e,t){for(var n,r=-1,i=e.length;++r<i;){var a=t(e[r]);a!==o&&(n=n===o?a:n+a)}return n}function Yt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Xt(e){return e?e.slice(0,hn(e)+1).replace(ae,""):e}function qt(e){return function(t){return e(t)}}function $t(e,t){return Pt(t,(function(t){return e[t]}))}function Qt(e,t){return e.has(t)}function Jt(e,t){for(var n=-1,r=e.length;++n<r&&Bt(t,e[n],0)>-1;);return n}function en(e,t){for(var n=e.length;n--&&Bt(t,e[n],0)>-1;);return n}function tn(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var nn=Vt({"À":"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"}),rn=Vt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function on(e){return"\\"+lt[e]}function an(e){return tt.test(e)}function ln(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function sn(e,t){return function(n){return e(t(n))}}function cn(e,t){for(var n=-1,r=e.length,o=0,i=[];++n<r;){var a=e[n];a!==t&&a!==l||(e[n]=l,i[o++]=n)}return i}function un(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}function dn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}function fn(e){return an(e)?function(e){for(var t=Je.lastIndex=0;Je.test(e);)++t;return t}(e):zt(e)}function pn(e){return an(e)?e.match(Je)||[]:function(e){return e.split("")}(e)}function hn(e){for(var t=e.length;t--&&le.test(e.charAt(t)););return t}var mn=Vt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),gn=function e(t){var n,r=(t=null==t?ft:gn.defaults(ft.Object(),t,gn.pick(ft,rt))).Array,le=t.Date,_e=t.Error,Se=t.Function,Ce=t.Math,je=t.Object,Oe=t.RegExp,Ie=t.String,Me=t.TypeError,Te=r.prototype,Pe=Se.prototype,Ae=je.prototype,Le=t["__core-js_shared__"],De=Pe.toString,Re=Ae.hasOwnProperty,ze=0,Ne=(n=/[^.]+$/.exec(Le&&Le.keys&&Le.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",He=Ae.toString,Be=De.call(je),Fe=ft._,Ue=Oe("^"+De.call(Re).replace(oe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ke=mt?t.Buffer:o,We=t.Symbol,Ve=t.Uint8Array,Ge=Ke?Ke.allocUnsafe:o,Ze=sn(je.getPrototypeOf,je),Ye=je.create,Xe=Ae.propertyIsEnumerable,qe=Te.splice,Je=We?We.isConcatSpreadable:o,tt=We?We.iterator:o,lt=We?We.toStringTag:o,ut=function(){try{var e=hi(je,"defineProperty");return e({},"",{}),e}catch(t){}}(),dt=t.clearTimeout!==ft.clearTimeout&&t.clearTimeout,pt=le&&le.now!==ft.Date.now&&le.now,ht=t.setTimeout!==ft.setTimeout&&t.setTimeout,gt=Ce.ceil,vt=Ce.floor,zt=je.getOwnPropertySymbols,Vt=Ke?Ke.isBuffer:o,vn=t.isFinite,bn=Te.join,yn=sn(je.keys,je),xn=Ce.max,wn=Ce.min,kn=le.now,En=t.parseInt,_n=Ce.random,Sn=Te.reverse,Cn=hi(t,"DataView"),jn=hi(t,"Map"),On=hi(t,"Promise"),In=hi(t,"Set"),Mn=hi(t,"WeakMap"),Tn=hi(je,"create"),Pn=Mn&&new Mn,An={},Ln=Wi(Cn),Dn=Wi(jn),Rn=Wi(On),zn=Wi(In),Nn=Wi(Mn),Hn=We?We.prototype:o,Bn=Hn?Hn.valueOf:o,Fn=Hn?Hn.toString:o;function Un(e){if(ll(e)&&!qa(e)&&!(e instanceof Gn)){if(e instanceof Vn)return e;if(Re.call(e,"__wrapped__"))return Vi(e)}return new Vn(e)}var Kn=function(){function e(){}return function(t){if(!al(t))return{};if(Ye)return Ye(t);e.prototype=t;var n=new e;return e.prototype=o,n}}();function Wn(){}function Vn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=o}function Gn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}function Zn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Yn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function 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 Yn(e);this.size=t.size}function Qn(e,t){var n=qa(e),r=!n&&Xa(e),o=!n&&!r&&el(e),i=!n&&!r&&!o&&ml(e),a=n||r||o||i,l=a?Yt(e.length,Ie):[],s=l.length;for(var c in e)!t&&!Re.call(e,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||wi(c,s))||l.push(c);return l}function Jn(e){var t=e.length;return t?e[qr(0,t-1)]:o}function er(e,t){return Ni(Po(e),cr(t,0,e.length))}function tr(e){return Ni(Po(e))}function nr(e,t,n){(n!==o&&!Ga(e[t],n)||n===o&&!(t in e))&&lr(e,t,n)}function rr(e,t,n){var r=e[t];Re.call(e,t)&&Ga(r,n)&&(n!==o||t in e)||lr(e,t,n)}function or(e,t){for(var n=e.length;n--;)if(Ga(e[n][0],t))return n;return-1}function ir(e,t,n,r){return hr(e,(function(e,o,i){t(r,e,n(e),i)})),r}function ar(e,t){return e&&Ao(t,zl(t),e)}function lr(e,t,n){"__proto__"==t&&ut?ut(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function sr(e,t){for(var n=-1,i=t.length,a=r(i),l=null==e;++n<i;)a[n]=l?o:Pl(e,t[n]);return a}function cr(e,t,n){return e==e&&(n!==o&&(e=e<=n?e:n),t!==o&&(e=e>=t?e:t)),e}function ur(e,t,n,r,i,a){var l,s=1&t,c=2&t,u=4&t;if(n&&(l=i?n(e,r,i,a):n(e)),l!==o)return l;if(!al(e))return e;var d,f,p,h=qa(e);if(h){if(f=(d=e).length,p=new d.constructor(f),f&&"string"==typeof d[0]&&Re.call(d,"index")&&(p.index=d.index,p.input=d.input),l=p,!s)return Po(e,l)}else{var m=vi(e),g=m==E||m==_;if(el(e))return Co(e,s);if(m==j||m==b||g&&!i){if(l=c||g?{}:yi(e),!s)return c?function(e,t){return Ao(e,gi(e),t)}(e,function(e,t){return e&&Ao(t,Nl(t),e)}(l,e)):function(e,t){return Ao(e,mi(e),t)}(e,ar(l,e))}else{if(!at[m])return i?e:{};l=function(e,t,n){var r,o,i,a=e.constructor;switch(t){case L:return jo(e);case x:case w:return new a(+e);case D:return r=e,o=n?jo(r.buffer):r.buffer,new r.constructor(o,r.byteOffset,r.byteLength);case R:case z:case N:case H:case B:case F:case U:case K:case W:return Oo(e,n);case S:case M:return new a;case C:case T:return new a(e);case I:return function(e){var t=new e.constructor(e.source,me.exec(e));return t.lastIndex=e.lastIndex,t}(e);case P:return i=e,Bn?je(Bn.call(i)):{}}}(e,m,s)}}a||(a=new $n);var v=a.get(e);if(v)return v;a.set(e,l),fl(e)?e.forEach((function(r){l.add(ur(r,t,n,r,e,a))})):sl(e)&&e.forEach((function(r,o){l.set(o,ur(r,t,n,o,e,a))}));var y=h?o:(u?c?li:ai:c?Nl:zl)(e);return Ct(y||e,(function(r,o){y&&(r=e[o=r]),rr(l,o,ur(r,t,n,o,e,a))})),l}function dr(e,t,n){var r=n.length;if(null==e)return!r;for(e=je(e);r--;){var i=n[r],a=t[i],l=e[i];if(l===o&&!(i in e)||!a(l))return!1}return!0}function fr(e,t,n){if("function"!=typeof e)throw new Me(i);return Li((function(){e.apply(o,n)}),t)}function pr(e,t,n,r){var o=-1,i=Mt,a=!0,l=e.length,s=[],c=t.length;if(!l)return s;n&&(t=Pt(t,qt(n))),r?(i=Tt,a=!1):t.length>=200&&(i=Qt,a=!1,t=new qn(t));e:for(;++o<l;){var u=e[o],d=null==n?u:n(u);if(u=r||0!==u?u:0,a&&d==d){for(var f=c;f--;)if(t[f]===d)continue e;s.push(u)}else i(t,d,r)||s.push(u)}return s}Un.templateSettings={escape:Q,evaluate:J,interpolate:ee,variable:"",imports:{_:Un}},Un.prototype=Wn.prototype,Un.prototype.constructor=Un,Vn.prototype=Kn(Wn.prototype),Vn.prototype.constructor=Vn,Gn.prototype=Kn(Wn.prototype),Gn.prototype.constructor=Gn,Zn.prototype.clear=function(){this.__data__=Tn?Tn(null):{},this.size=0},Zn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Zn.prototype.get=function(e){var t=this.__data__;if(Tn){var n=t[e];return n===a?o:n}return Re.call(t,e)?t[e]:o},Zn.prototype.has=function(e){var t=this.__data__;return Tn?t[e]!==o:Re.call(t,e)},Zn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Tn&&t===o?a:t,this},Yn.prototype.clear=function(){this.__data__=[],this.size=0},Yn.prototype.delete=function(e){var t=this.__data__,n=or(t,e);return!(n<0||(n==t.length-1?t.pop():qe.call(t,n,1),--this.size,0))},Yn.prototype.get=function(e){var t=this.__data__,n=or(t,e);return n<0?o:t[n][1]},Yn.prototype.has=function(e){return or(this.__data__,e)>-1},Yn.prototype.set=function(e,t){var n=this.__data__,r=or(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Xn.prototype.clear=function(){this.size=0,this.__data__={hash:new Zn,map:new(jn||Yn),string:new Zn}},Xn.prototype.delete=function(e){var t=fi(this,e).delete(e);return this.size-=t?1:0,t},Xn.prototype.get=function(e){return fi(this,e).get(e)},Xn.prototype.has=function(e){return fi(this,e).has(e)},Xn.prototype.set=function(e,t){var n=fi(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 Yn,this.size=0},$n.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},$n.prototype.get=function(e){return this.__data__.get(e)},$n.prototype.has=function(e){return this.__data__.has(e)},$n.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Yn){var r=n.__data__;if(!jn||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 hr=Ro(kr),mr=Ro(Er,!0);function gr(e,t){var n=!0;return hr(e,(function(e,r,o){return n=!!t(e,r,o)})),n}function vr(e,t,n){for(var r=-1,i=e.length;++r<i;){var a=e[r],l=t(a);if(null!=l&&(s===o?l==l&&!hl(l):n(l,s)))var s=l,c=a}return c}function br(e,t){var n=[];return hr(e,(function(e,r,o){t(e,r,o)&&n.push(e)})),n}function yr(e,t,n,r,o){var i=-1,a=e.length;for(n||(n=xi),o||(o=[]);++i<a;){var l=e[i];t>0&&n(l)?t>1?yr(l,t-1,n,r,o):At(o,l):r||(o[o.length]=l)}return o}var xr=zo(),wr=zo(!0);function kr(e,t){return e&&xr(e,t,zl)}function Er(e,t){return e&&wr(e,t,zl)}function _r(e,t){return It(t,(function(t){return rl(e[t])}))}function Sr(e,t){for(var n=0,r=(t=ko(t,e)).length;null!=e&&n<r;)e=e[Ki(t[n++])];return n&&n==r?e:o}function Cr(e,t,n){var r=t(e);return qa(e)?r:At(r,n(e))}function jr(e){return null==e?e===o?"[object Undefined]":"[object Null]":lt&&lt in je(e)?function(e){var t=Re.call(e,lt),n=e[lt];try{e[lt]=o;var r=!0}catch(a){}var i=He.call(e);return r&&(t?e[lt]=n:delete e[lt]),i}(e):(t=e,He.call(t));var t}function Or(e,t){return e>t}function Ir(e,t){return null!=e&&Re.call(e,t)}function Mr(e,t){return null!=e&&t in je(e)}function Tr(e,t,n){for(var i=n?Tt:Mt,a=e[0].length,l=e.length,s=l,c=r(l),u=1/0,d=[];s--;){var f=e[s];s&&t&&(f=Pt(f,qt(t))),u=wn(f.length,u),c[s]=!n&&(t||a>=120&&f.length>=120)?new qn(s&&f):o}f=e[0];var p=-1,h=c[0];e:for(;++p<a&&d.length<u;){var m=f[p],g=t?t(m):m;if(m=n||0!==m?m:0,!(h?Qt(h,g):i(d,g,n))){for(s=l;--s;){var v=c[s];if(!(v?Qt(v,g):i(e[s],g,n)))continue e}h&&h.push(g),d.push(m)}}return d}function Pr(e,t,n){var r=null==(e=Mi(e,t=ko(t,e)))?e:e[Ki(na(t))];return null==r?o:_t(r,e,n)}function Ar(e){return ll(e)&&jr(e)==b}function Lr(e,t,n,r,i){return e===t||(null==e||null==t||!ll(e)&&!ll(t)?e!=e&&t!=t:function(e,t,n,r,i,a){var l=qa(e),s=qa(t),c=l?y:vi(e),u=s?y:vi(t),d=(c=c==b?j:c)==j,f=(u=u==b?j:u)==j,p=c==u;if(p&&el(e)){if(!el(t))return!1;l=!0,d=!1}if(p&&!d)return a||(a=new $n),l||ml(e)?oi(e,t,n,r,i,a):function(e,t,n,r,o,i,a){switch(n){case D:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case L:return!(e.byteLength!=t.byteLength||!i(new Ve(e),new Ve(t)));case x:case w:case C:return Ga(+e,+t);case k:return e.name==t.name&&e.message==t.message;case I:case T:return e==t+"";case S:var l=ln;case M:var s=1&r;if(l||(l=un),e.size!=t.size&&!s)return!1;var c=a.get(e);if(c)return c==t;r|=2,a.set(e,t);var u=oi(l(e),l(t),r,o,i,a);return a.delete(e),u;case P:if(Bn)return Bn.call(e)==Bn.call(t)}return!1}(e,t,c,n,r,i,a);if(!(1&n)){var h=d&&Re.call(e,"__wrapped__"),m=f&&Re.call(t,"__wrapped__");if(h||m){var g=h?e.value():e,v=m?t.value():t;return a||(a=new $n),i(g,v,n,r,a)}}return!!p&&(a||(a=new $n),function(e,t,n,r,i,a){var l=1&n,s=ai(e),c=s.length;if(c!=ai(t).length&&!l)return!1;for(var u=c;u--;){var d=s[u];if(!(l?d in t:Re.call(t,d)))return!1}var f=a.get(e),p=a.get(t);if(f&&p)return f==t&&p==e;var h=!0;a.set(e,t),a.set(t,e);for(var m=l;++u<c;){var g=e[d=s[u]],v=t[d];if(r)var b=l?r(v,g,d,t,e,a):r(g,v,d,e,t,a);if(!(b===o?g===v||i(g,v,n,r,a):b)){h=!1;break}m||(m="constructor"==d)}if(h&&!m){var y=e.constructor,x=t.constructor;y==x||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof x&&x instanceof x||(h=!1)}return a.delete(e),a.delete(t),h}(e,t,n,r,i,a))}(e,t,n,r,Lr,i))}function Dr(e,t,n,r){var i=n.length,a=i,l=!r;if(null==e)return!a;for(e=je(e);i--;){var s=n[i];if(l&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){var c=(s=n[i])[0],u=e[c],d=s[1];if(l&&s[2]){if(u===o&&!(c in e))return!1}else{var f=new $n;if(r)var p=r(u,d,c,e,t,f);if(!(p===o?Lr(d,u,3,r,f):p))return!1}}return!0}function Rr(e){return!(!al(e)||(t=e,Ne&&Ne in t))&&(rl(e)?Ue:be).test(Wi(e));var t}function zr(e){return"function"==typeof e?e:null==e?cs:"object"==typeof e?qa(e)?Kr(e[0],e[1]):Ur(e):bs(e)}function Nr(e){if(!Ci(e))return yn(e);var t=[];for(var n in je(e))Re.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Hr(e){if(!al(e))return function(e){var t=[];if(null!=e)for(var n in je(e))t.push(n);return t}(e);var t=Ci(e),n=[];for(var r in e)("constructor"!=r||!t&&Re.call(e,r))&&n.push(r);return n}function Br(e,t){return e<t}function Fr(e,t){var n=-1,o=Qa(e)?r(e.length):[];return hr(e,(function(e,r,i){o[++n]=t(e,r,i)})),o}function Ur(e){var t=pi(e);return 1==t.length&&t[0][2]?Oi(t[0][0],t[0][1]):function(n){return n===e||Dr(n,e,t)}}function Kr(e,t){return Ei(e)&&ji(t)?Oi(Ki(e),t):function(n){var r=Pl(n,e);return r===o&&r===t?Al(n,e):Lr(t,r,3)}}function Wr(e,t,n,r,i){e!==t&&xr(t,(function(a,l){if(i||(i=new $n),al(a))!function(e,t,n,r,i,a,l){var s=Pi(e,n),c=Pi(t,n),u=l.get(c);if(u)nr(e,n,u);else{var d=a?a(s,c,n+"",e,t,l):o,f=d===o;if(f){var p=qa(c),h=!p&&el(c),m=!p&&!h&&ml(c);d=c,p||h||m?qa(s)?d=s:Ja(s)?d=Po(s):h?(f=!1,d=Co(c,!0)):m?(f=!1,d=Oo(c,!0)):d=[]:ul(c)||Xa(c)?(d=s,Xa(s)?d=El(s):al(s)&&!rl(s)||(d=yi(c))):f=!1}f&&(l.set(c,d),i(d,c,r,a,l),l.delete(c)),nr(e,n,d)}}(e,t,l,n,Wr,r,i);else{var s=r?r(Pi(e,l),a,l+"",e,t,i):o;s===o&&(s=a),nr(e,l,s)}}),Nl)}function Vr(e,t){var n=e.length;if(n)return wi(t+=t<0?n:0,n)?e[t]:o}function Gr(e,t,n){t=t.length?Pt(t,(function(e){return qa(e)?function(t){return Sr(t,1===e.length?e[0]:e)}:e})):[cs];var r=-1;return t=Pt(t,qt(di())),function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(Fr(e,(function(e,n,o){return{criteria:Pt(t,(function(t){return t(e)})),index:++r,value:e}})),(function(e,t){return function(e,t,n){for(var r=-1,o=e.criteria,i=t.criteria,a=o.length,l=n.length;++r<a;){var s=Io(o[r],i[r]);if(s)return r>=l?s:s*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function Zr(e,t,n){for(var r=-1,o=t.length,i={};++r<o;){var a=t[r],l=Sr(e,a);n(l,a)&&to(i,ko(a,e),l)}return i}function Yr(e,t,n,r){var o=r?Ft:Bt,i=-1,a=t.length,l=e;for(e===t&&(t=Po(t)),n&&(l=Pt(e,qt(n)));++i<a;)for(var s=0,c=t[i],u=n?n(c):c;(s=o(l,u,s,r))>-1;)l!==e&&qe.call(l,s,1),qe.call(e,s,1);return e}function Xr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(n==r||o!==i){var i=o;wi(o)?qe.call(e,o,1):ho(e,o)}}return e}function qr(e,t){return e+vt(_n()*(t-e+1))}function $r(e,t){var n="";if(!e||t<1||t>h)return n;do{t%2&&(n+=e),(t=vt(t/2))&&(e+=e)}while(t);return n}function Qr(e,t){return Di(Ii(e,t,cs),e+"")}function Jr(e){return Jn(Gl(e))}function eo(e,t){var n=Gl(e);return Ni(n,cr(t,0,n.length))}function to(e,t,n,r){if(!al(e))return e;for(var i=-1,a=(t=ko(t,e)).length,l=a-1,s=e;null!=s&&++i<a;){var c=Ki(t[i]),u=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(i!=l){var d=s[c];(u=r?r(d,c,s):o)===o&&(u=al(d)?d:wi(t[i+1])?[]:{})}rr(s,c,u),s=s[c]}return e}var no=Pn?function(e,t){return Pn.set(e,t),e}:cs,ro=ut?function(e,t){return ut(e,"toString",{configurable:!0,enumerable:!1,value:as(t),writable:!0})}:cs;function oo(e){return Ni(Gl(e))}function io(e,t,n){var o=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=r(i);++o<i;)a[o]=e[o+t];return a}function ao(e,t){var n;return hr(e,(function(e,r,o){return!(n=t(e,r,o))})),!!n}function lo(e,t,n){var r=0,o=null==e?r:e.length;if("number"==typeof t&&t==t&&o<=2147483647){for(;r<o;){var i=r+o>>>1,a=e[i];null!==a&&!hl(a)&&(n?a<=t:a<t)?r=i+1:o=i}return o}return so(e,t,cs,n)}function so(e,t,n,r){var i=0,a=null==e?0:e.length;if(0===a)return 0;for(var l=(t=n(t))!=t,s=null===t,c=hl(t),u=t===o;i<a;){var d=vt((i+a)/2),f=n(e[d]),p=f!==o,h=null===f,m=f==f,g=hl(f);if(l)var v=r||m;else v=u?m&&(r||p):s?m&&p&&(r||!h):c?m&&p&&!h&&(r||!g):!h&&!g&&(r?f<=t:f<t);v?i=d+1:a=d}return wn(a,4294967294)}function co(e,t){for(var n=-1,r=e.length,o=0,i=[];++n<r;){var a=e[n],l=t?t(a):a;if(!n||!Ga(l,s)){var s=l;i[o++]=0===a?0:a}}return i}function uo(e){return"number"==typeof e?e:hl(e)?m:+e}function fo(e){if("string"==typeof e)return e;if(qa(e))return Pt(e,fo)+"";if(hl(e))return Fn?Fn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function po(e,t,n){var r=-1,o=Mt,i=e.length,a=!0,l=[],s=l;if(n)a=!1,o=Tt;else if(i>=200){var c=t?null:Qo(e);if(c)return un(c);a=!1,o=Qt,s=new qn}else s=t?[]:l;e:for(;++r<i;){var u=e[r],d=t?t(u):u;if(u=n||0!==u?u:0,a&&d==d){for(var f=s.length;f--;)if(s[f]===d)continue e;t&&s.push(d),l.push(u)}else o(s,d,n)||(s!==l&&s.push(d),l.push(u))}return l}function ho(e,t){return null==(e=Mi(e,t=ko(t,e)))||delete e[Ki(na(t))]}function mo(e,t,n,r){return to(e,t,n(Sr(e,t)),r)}function go(e,t,n,r){for(var o=e.length,i=r?o:-1;(r?i--:++i<o)&&t(e[i],i,e););return n?io(e,r?0:i,r?i+1:o):io(e,r?i+1:0,r?o:i)}function vo(e,t){var n=e;return n instanceof Gn&&(n=n.value()),Lt(t,(function(e,t){return t.func.apply(t.thisArg,At([e],t.args))}),n)}function bo(e,t,n){var o=e.length;if(o<2)return o?po(e[0]):[];for(var i=-1,a=r(o);++i<o;)for(var l=e[i],s=-1;++s<o;)s!=i&&(a[i]=pr(a[i]||l,e[s],t,n));return po(yr(a,1),t,n)}function yo(e,t,n){for(var r=-1,i=e.length,a=t.length,l={};++r<i;){var s=r<a?t[r]:o;n(l,e[r],s)}return l}function xo(e){return Ja(e)?e:[]}function wo(e){return"function"==typeof e?e:cs}function ko(e,t){return qa(e)?e:Ei(e,t)?[e]:Ui(_l(e))}var Eo=Qr;function _o(e,t,n){var r=e.length;return n=n===o?r:n,!t&&n>=r?e:io(e,t,n)}var So=dt||function(e){return ft.clearTimeout(e)};function Co(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 jo(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t}function Oo(e,t){var n=t?jo(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Io(e,t){if(e!==t){var n=e!==o,r=null===e,i=e==e,a=hl(e),l=t!==o,s=null===t,c=t==t,u=hl(t);if(!s&&!u&&!a&&e>t||a&&l&&c&&!s&&!u||r&&l&&c||!n&&c||!i)return 1;if(!r&&!a&&!u&&e<t||u&&n&&i&&!r&&!a||s&&n&&i||!l&&i||!c)return-1}return 0}function Mo(e,t,n,o){for(var i=-1,a=e.length,l=n.length,s=-1,c=t.length,u=xn(a-l,0),d=r(c+u),f=!o;++s<c;)d[s]=t[s];for(;++i<l;)(f||i<a)&&(d[n[i]]=e[i]);for(;u--;)d[s++]=e[i++];return d}function To(e,t,n,o){for(var i=-1,a=e.length,l=-1,s=n.length,c=-1,u=t.length,d=xn(a-s,0),f=r(d+u),p=!o;++i<d;)f[i]=e[i];for(var h=i;++c<u;)f[h+c]=t[c];for(;++l<s;)(p||i<a)&&(f[h+n[l]]=e[i++]);return f}function Po(e,t){var n=-1,o=e.length;for(t||(t=r(o));++n<o;)t[n]=e[n];return t}function Ao(e,t,n,r){var i=!n;n||(n={});for(var a=-1,l=t.length;++a<l;){var s=t[a],c=r?r(n[s],e[s],s,n,e):o;c===o&&(c=e[s]),i?lr(n,s,c):rr(n,s,c)}return n}function Lo(e,t){return function(n,r){var o=qa(n)?St:ir,i=t?t():{};return o(n,e,di(r,2),i)}}function Do(e){return Qr((function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:o,l=i>2?n[2]:o;for(a=e.length>3&&"function"==typeof a?(i--,a):o,l&&ki(n[0],n[1],l)&&(a=i<3?o:a,i=1),t=je(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t}))}function Ro(e,t){return function(n,r){if(null==n)return n;if(!Qa(n))return e(n,r);for(var o=n.length,i=t?o:-1,a=je(n);(t?i--:++i<o)&&!1!==r(a[i],i,a););return n}}function zo(e){return function(t,n,r){for(var o=-1,i=je(t),a=r(t),l=a.length;l--;){var s=a[e?l:++o];if(!1===n(i[s],s,i))break}return t}}function No(e){return function(t){var n=an(t=_l(t))?pn(t):o,r=n?n[0]:t.charAt(0),i=n?_o(n,1).join(""):t.slice(1);return r[e]()+i}}function Ho(e){return function(t){return Lt(rs(Xl(t).replace($e,"")),e,"")}}function Bo(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Kn(e.prototype),r=e.apply(n,t);return al(r)?r:n}}function Fo(e){return function(t,n,r){var i=je(t);if(!Qa(t)){var a=di(n,3);t=zl(t),n=function(e){return a(i[e],e,i)}}var l=e(t,n,r);return l>-1?i[a?t[l]:l]:o}}function Uo(e){return ii((function(t){var n=t.length,r=n,a=Vn.prototype.thru;for(e&&t.reverse();r--;){var l=t[r];if("function"!=typeof l)throw new Me(i);if(a&&!s&&"wrapper"==ci(l))var s=new Vn([],!0)}for(r=s?r:n;++r<n;){var c=ci(l=t[r]),u="wrapper"==c?si(l):o;s=u&&_i(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?s[ci(u[0])].apply(s,u[3]):1==l.length&&_i(l)?s[c]():s.thru(l)}return function(){var e=arguments,r=e[0];if(s&&1==e.length&&qa(r))return s.plant(r).value();for(var o=0,i=n?t[o].apply(this,e):r;++o<n;)i=t[o].call(this,i);return i}}))}function Ko(e,t,n,i,a,l,s,c,u,f){var p=t&d,h=1&t,m=2&t,g=24&t,v=512&t,b=m?o:Bo(e);return function o(){for(var d=arguments.length,y=r(d),x=d;x--;)y[x]=arguments[x];if(g)var w=ui(o),k=tn(y,w);if(i&&(y=Mo(y,i,a,g)),l&&(y=To(y,l,s,g)),d-=k,g&&d<f){var E=cn(y,w);return qo(e,t,Ko,o.placeholder,n,y,E,c,u,f-d)}var _=h?n:this,S=m?_[e]:e;return d=y.length,c?y=Ti(y,c):v&&d>1&&y.reverse(),p&&u<d&&(y.length=u),this&&this!==ft&&this instanceof o&&(S=b||Bo(S)),S.apply(_,y)}}function Wo(e,t){return function(n,r){return o=n,i=e,a=t(r),l={},kr(o,(function(e,t,n){i(l,a(e),t,n)})),l;var o,i,a,l}}function Vo(e,t){return function(n,r){var i;if(n===o&&r===o)return t;if(n!==o&&(i=n),r!==o){if(i===o)return r;"string"==typeof n||"string"==typeof r?(n=fo(n),r=fo(r)):(n=uo(n),r=uo(r)),i=e(n,r)}return i}}function Go(e){return ii((function(t){return t=Pt(t,qt(di())),Qr((function(n){var r=this;return e(t,(function(e){return _t(e,r,n)}))}))}))}function Zo(e,t){var n=(t=t===o?" ":fo(t)).length;if(n<2)return n?$r(t,e):t;var r=$r(t,gt(e/fn(t)));return an(t)?_o(pn(r),0,e).join(""):r.slice(0,e)}function Yo(e){return function(t,n,i){return i&&"number"!=typeof i&&ki(t,n,i)&&(n=i=o),t=yl(t),n===o?(n=t,t=0):n=yl(n),function(e,t,n,o){for(var i=-1,a=xn(gt((t-e)/(n||1)),0),l=r(a);a--;)l[o?a:++i]=e,e+=n;return l}(t,n,i=i===o?t<n?1:-1:yl(i),e)}}function Xo(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=kl(t),n=kl(n)),e(t,n)}}function qo(e,t,n,r,i,a,l,s,d,f){var p=8&t;t|=p?c:u,4&(t&=~(p?u:c))||(t&=-4);var h=[e,t,i,p?a:o,p?l:o,p?o:a,p?o:l,s,d,f],m=n.apply(o,h);return _i(e)&&Ai(m,h),m.placeholder=r,Ri(m,e,t)}function $o(e){var t=Ce[e];return function(e,n){if(e=kl(e),(n=null==n?0:wn(xl(n),292))&&vn(e)){var r=(_l(e)+"e").split("e");return+((r=(_l(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Qo=In&&1/un(new In([,-0]))[1]==p?function(e){return new In(e)}:hs;function Jo(e){return function(t){var n,r=vi(t);return r==S?ln(t):r==M?dn(t):(n=t,Pt(e(t),(function(e){return[e,n[e]]})))}}function ei(e,t,n,a,p,h,m,g){var v=2&t;if(!v&&"function"!=typeof e)throw new Me(i);var b=a?a.length:0;if(b||(t&=-97,a=p=o),m=m===o?m:xn(xl(m),0),g=g===o?g:xl(g),b-=p?p.length:0,t&u){var y=a,x=p;a=p=o}var w,k,E,_,S=v?o:si(e),C=[e,t,n,a,p,y,x,h,m,g];if(S&&function(e,t){var n=e[1],r=t[1],o=n|r,i=o<131,a=r==d&&8==n||r==d&&n==f&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!i&&!a)return e;1&r&&(e[2]=t[2],o|=1&n?0:4);var s=t[3];if(s){var c=e[3];e[3]=c?Mo(c,s,t[4]):s,e[4]=c?cn(e[3],l):t[4]}(s=t[5])&&(c=e[5],e[5]=c?To(c,s,t[6]):s,e[6]=c?cn(e[5],l):t[6]),(s=t[7])&&(e[7]=s),r&d&&(e[8]=null==e[8]?t[8]:wn(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(C,S),e=C[0],t=C[1],n=C[2],a=C[3],p=C[4],!(g=C[9]=C[9]===o?v?0:e.length:xn(C[9]-b,0))&&24&t&&(t&=-25),t&&1!=t)j=8==t||t==s?(k=t,E=g,_=Bo(w=e),function e(){for(var t=arguments.length,n=r(t),i=t,a=ui(e);i--;)n[i]=arguments[i];var l=t<3&&n[0]!==a&&n[t-1]!==a?[]:cn(n,a);return(t-=l.length)<E?qo(w,k,Ko,e.placeholder,o,n,l,o,o,E-t):_t(this&&this!==ft&&this instanceof e?_:w,this,n)}):t!=c&&33!=t||p.length?Ko.apply(o,C):function(e,t,n,o){var i=1&t,a=Bo(e);return function t(){for(var l=-1,s=arguments.length,c=-1,u=o.length,d=r(u+s),f=this&&this!==ft&&this instanceof t?a:e;++c<u;)d[c]=o[c];for(;s--;)d[c++]=arguments[++l];return _t(f,i?n:this,d)}}(e,t,n,a);else var j=function(e,t,n){var r=1&t,o=Bo(e);return function t(){return(this&&this!==ft&&this instanceof t?o:e).apply(r?n:this,arguments)}}(e,t,n);return Ri((S?no:Ai)(j,C),e,t)}function ti(e,t,n,r){return e===o||Ga(e,Ae[n])&&!Re.call(r,n)?t:e}function ni(e,t,n,r,i,a){return al(e)&&al(t)&&(a.set(t,e),Wr(e,t,o,ni,a),a.delete(t)),e}function ri(e){return ul(e)?o:e}function oi(e,t,n,r,i,a){var l=1&n,s=e.length,c=t.length;if(s!=c&&!(l&&c>s))return!1;var u=a.get(e),d=a.get(t);if(u&&d)return u==t&&d==e;var f=-1,p=!0,h=2&n?new qn:o;for(a.set(e,t),a.set(t,e);++f<s;){var m=e[f],g=t[f];if(r)var v=l?r(g,m,f,t,e,a):r(m,g,f,e,t,a);if(v!==o){if(v)continue;p=!1;break}if(h){if(!Rt(t,(function(e,t){if(!Qt(h,t)&&(m===e||i(m,e,n,r,a)))return h.push(t)}))){p=!1;break}}else if(m!==g&&!i(m,g,n,r,a)){p=!1;break}}return a.delete(e),a.delete(t),p}function ii(e){return Di(Ii(e,o,$i),e+"")}function ai(e){return Cr(e,zl,mi)}function li(e){return Cr(e,Nl,gi)}var si=Pn?function(e){return Pn.get(e)}:hs;function ci(e){for(var t=e.name+"",n=An[t],r=Re.call(An,t)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==e)return o.name}return t}function ui(e){return(Re.call(Un,"placeholder")?Un:e).placeholder}function di(){var e=Un.iteratee||us;return e=e===us?zr:e,arguments.length?e(arguments[0],arguments[1]):e}function fi(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function pi(e){for(var t=zl(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,ji(o)]}return t}function hi(e,t){var n,r,i=(r=t,null==(n=e)?o:n[r]);return Rr(i)?i:o}var mi=zt?function(e){return null==e?[]:(e=je(e),It(zt(e),(function(t){return Xe.call(e,t)})))}:ws,gi=zt?function(e){for(var t=[];e;)At(t,mi(e)),e=Ze(e);return t}:ws,vi=jr;function bi(e,t,n){for(var r=-1,o=(t=ko(t,e)).length,i=!1;++r<o;){var a=Ki(t[r]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&il(o)&&wi(a,o)&&(qa(e)||Xa(e))}function yi(e){return"function"!=typeof e.constructor||Ci(e)?{}:Kn(Ze(e))}function xi(e){return qa(e)||Xa(e)||!!(Je&&e&&e[Je])}function wi(e,t){var n=typeof e;return!!(t=null==t?h:t)&&("number"==n||"symbol"!=n&&xe.test(e))&&e>-1&&e%1==0&&e<t}function ki(e,t,n){if(!al(n))return!1;var r=typeof t;return!!("number"==r?Qa(n)&&wi(t,n.length):"string"==r&&t in n)&&Ga(n[t],e)}function Ei(e,t){if(qa(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!hl(e))||ne.test(e)||!te.test(e)||null!=t&&e in je(t)}function _i(e){var t=ci(e),n=Un[t];if("function"!=typeof n||!(t in Gn.prototype))return!1;if(e===n)return!0;var r=si(n);return!!r&&e===r[0]}(Cn&&vi(new Cn(new ArrayBuffer(1)))!=D||jn&&vi(new jn)!=S||On&&vi(On.resolve())!=O||In&&vi(new In)!=M||Mn&&vi(new Mn)!=A)&&(vi=function(e){var t=jr(e),n=t==j?e.constructor:o,r=n?Wi(n):"";if(r)switch(r){case Ln:return D;case Dn:return S;case Rn:return O;case zn:return M;case Nn:return A}return t});var Si=Le?rl:ks;function Ci(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ae)}function ji(e){return e==e&&!al(e)}function Oi(e,t){return function(n){return null!=n&&n[e]===t&&(t!==o||e in je(n))}}function Ii(e,t,n){return t=xn(t===o?e.length-1:t,0),function(){for(var o=arguments,i=-1,a=xn(o.length-t,0),l=r(a);++i<a;)l[i]=o[t+i];i=-1;for(var s=r(t+1);++i<t;)s[i]=o[i];return s[t]=n(l),_t(e,this,s)}}function Mi(e,t){return t.length<2?e:Sr(e,io(t,0,-1))}function Ti(e,t){for(var n=e.length,r=wn(t.length,n),i=Po(e);r--;){var a=t[r];e[r]=wi(a,n)?i[a]:o}return e}function Pi(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Ai=zi(no),Li=ht||function(e,t){return ft.setTimeout(e,t)},Di=zi(ro);function Ri(e,t,n){var r,o=t+"";return Di(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(se,"{\n/* [wrapped with "+t+"] */\n")}(o,function(e,t){return Ct(v,(function(n){var r="_."+n[0];t&n[1]&&!Mt(e,r)&&e.push(r)})),e.sort()}((r=o.match(ce))?r[1].split(ue):[],n)))}function zi(e){var t=0,n=0;return function(){var r=kn(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(o,arguments)}}function Ni(e,t){var n=-1,r=e.length,i=r-1;for(t=t===o?r:t;++n<t;){var a=qr(n,i),l=e[a];e[a]=e[n],e[n]=l}return e.length=t,e}var Hi,Bi,Fi,Ui=(Hi=function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(re,(function(e,n,r,o){t.push(r?o.replace(pe,"$1"):n||e)})),t},Bi=Ba(Hi,(function(e){return 500===Fi.size&&Fi.clear(),e})),Fi=Bi.cache,Bi);function Ki(e){if("string"==typeof e||hl(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Wi(e){if(null!=e){try{return De.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Vi(e){if(e instanceof Gn)return e.clone();var t=new Vn(e.__wrapped__,e.__chain__);return t.__actions__=Po(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Gi=Qr((function(e,t){return Ja(e)?pr(e,yr(t,1,Ja,!0)):[]})),Zi=Qr((function(e,t){var n=na(t);return Ja(n)&&(n=o),Ja(e)?pr(e,yr(t,1,Ja,!0),di(n,2)):[]})),Yi=Qr((function(e,t){var n=na(t);return Ja(n)&&(n=o),Ja(e)?pr(e,yr(t,1,Ja,!0),o,n):[]}));function Xi(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:xl(n);return o<0&&(o=xn(r+o,0)),Ht(e,di(t,3),o)}function qi(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r-1;return n!==o&&(i=xl(n),i=n<0?xn(r+i,0):wn(i,r-1)),Ht(e,di(t,3),i,!0)}function $i(e){return null!=e&&e.length?yr(e,1):[]}function Qi(e){return e&&e.length?e[0]:o}var Ji=Qr((function(e){var t=Pt(e,xo);return t.length&&t[0]===e[0]?Tr(t):[]})),ea=Qr((function(e){var t=na(e),n=Pt(e,xo);return t===na(n)?t=o:n.pop(),n.length&&n[0]===e[0]?Tr(n,di(t,2)):[]})),ta=Qr((function(e){var t=na(e),n=Pt(e,xo);return(t="function"==typeof t?t:o)&&n.pop(),n.length&&n[0]===e[0]?Tr(n,o,t):[]}));function na(e){var t=null==e?0:e.length;return t?e[t-1]:o}var ra=Qr(oa);function oa(e,t){return e&&e.length&&t&&t.length?Yr(e,t):e}var ia=ii((function(e,t){var n=null==e?0:e.length,r=sr(e,t);return Xr(e,Pt(t,(function(e){return wi(e,n)?+e:e})).sort(Io)),r}));function aa(e){return null==e?e:Sn.call(e)}var la=Qr((function(e){return po(yr(e,1,Ja,!0))})),sa=Qr((function(e){var t=na(e);return Ja(t)&&(t=o),po(yr(e,1,Ja,!0),di(t,2))})),ca=Qr((function(e){var t=na(e);return t="function"==typeof t?t:o,po(yr(e,1,Ja,!0),o,t)}));function ua(e){if(!e||!e.length)return[];var t=0;return e=It(e,(function(e){if(Ja(e))return t=xn(e.length,t),!0})),Yt(t,(function(t){return Pt(e,Wt(t))}))}function da(e,t){if(!e||!e.length)return[];var n=ua(e);return null==t?n:Pt(n,(function(e){return _t(t,o,e)}))}var fa=Qr((function(e,t){return Ja(e)?pr(e,t):[]})),pa=Qr((function(e){return bo(It(e,Ja))})),ha=Qr((function(e){var t=na(e);return Ja(t)&&(t=o),bo(It(e,Ja),di(t,2))})),ma=Qr((function(e){var t=na(e);return t="function"==typeof t?t:o,bo(It(e,Ja),o,t)})),ga=Qr(ua),va=Qr((function(e){var t=e.length,n=t>1?e[t-1]:o;return n="function"==typeof n?(e.pop(),n):o,da(e,n)}));function ba(e){var t=Un(e);return t.__chain__=!0,t}function ya(e,t){return t(e)}var xa=ii((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,i=function(t){return sr(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Gn&&wi(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:ya,args:[i],thisArg:o}),new Vn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(o),e}))):this.thru(i)})),wa=Lo((function(e,t,n){Re.call(e,n)?++e[n]:lr(e,n,1)})),ka=Fo(Xi),Ea=Fo(qi);function _a(e,t){return(qa(e)?Ct:hr)(e,di(t,3))}function Sa(e,t){return(qa(e)?jt:mr)(e,di(t,3))}var Ca=Lo((function(e,t,n){Re.call(e,n)?e[n].push(t):lr(e,n,[t])})),ja=Qr((function(e,t,n){var o=-1,i="function"==typeof t,a=Qa(e)?r(e.length):[];return hr(e,(function(e){a[++o]=i?_t(t,e,n):Pr(e,t,n)})),a})),Oa=Lo((function(e,t,n){lr(e,n,t)}));function Ia(e,t){return(qa(e)?Pt:Fr)(e,di(t,3))}var Ma=Lo((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]})),Ta=Qr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&ki(e,t[0],t[1])?t=[]:n>2&&ki(t[0],t[1],t[2])&&(t=[t[0]]),Gr(e,yr(t,1),[])})),Pa=pt||function(){return ft.Date.now()};function Aa(e,t,n){return t=n?o:t,t=e&&null==t?e.length:t,ei(e,d,o,o,o,o,t)}function La(e,t){var n;if("function"!=typeof t)throw new Me(i);return e=xl(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=o),n}}var Da=Qr((function(e,t,n){var r=1;if(n.length){var o=cn(n,ui(Da));r|=c}return ei(e,r,t,n,o)})),Ra=Qr((function(e,t,n){var r=3;if(n.length){var o=cn(n,ui(Ra));r|=c}return ei(t,r,e,n,o)}));function za(e,t,n){var r,a,l,s,c,u,d=0,f=!1,p=!1,h=!0;if("function"!=typeof e)throw new Me(i);function m(t){var n=r,i=a;return r=a=o,d=t,s=e.apply(i,n)}function g(e){return d=e,c=Li(b,t),f?m(e):s}function v(e){var n=e-u;return u===o||n>=t||n<0||p&&e-d>=l}function b(){var e,n,r=Pa();if(v(r))return y(r);c=Li(b,(n=t-((e=r)-u),p?wn(n,l-(e-d)):n))}function y(e){return c=o,h&&r?m(e):(r=a=o,s)}function x(){var e=Pa(),n=v(e);if(r=arguments,a=this,u=e,n){if(c===o)return g(u);if(p)return So(c),c=Li(b,t),m(u)}return c===o&&(c=Li(b,t)),s}return t=kl(t)||0,al(n)&&(f=!!n.leading,l=(p="maxWait"in n)?xn(kl(n.maxWait)||0,t):l,h="trailing"in n?!!n.trailing:h),x.cancel=function(){c!==o&&So(c),d=0,r=u=a=c=o},x.flush=function(){return c===o?s:y(Pa())},x}var Na=Qr((function(e,t){return fr(e,1,t)})),Ha=Qr((function(e,t,n){return fr(e,kl(t)||0,n)}));function Ba(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Me(i);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(Ba.Cache||Xn),n}function Fa(e){if("function"!=typeof e)throw new Me(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ba.Cache=Xn;var Ua=Eo((function(e,t){var n=(t=1==t.length&&qa(t[0])?Pt(t[0],qt(di())):Pt(yr(t,1),qt(di()))).length;return Qr((function(r){for(var o=-1,i=wn(r.length,n);++o<i;)r[o]=t[o].call(this,r[o]);return _t(e,this,r)}))})),Ka=Qr((function(e,t){var n=cn(t,ui(Ka));return ei(e,c,o,t,n)})),Wa=Qr((function(e,t){var n=cn(t,ui(Wa));return ei(e,u,o,t,n)})),Va=ii((function(e,t){return ei(e,f,o,o,o,t)}));function Ga(e,t){return e===t||e!=e&&t!=t}var Za=Xo(Or),Ya=Xo((function(e,t){return e>=t})),Xa=Ar(function(){return arguments}())?Ar:function(e){return ll(e)&&Re.call(e,"callee")&&!Xe.call(e,"callee")},qa=r.isArray,$a=bt?qt(bt):function(e){return ll(e)&&jr(e)==L};function Qa(e){return null!=e&&il(e.length)&&!rl(e)}function Ja(e){return ll(e)&&Qa(e)}var el=Vt||ks,tl=yt?qt(yt):function(e){return ll(e)&&jr(e)==w};function nl(e){if(!ll(e))return!1;var t=jr(e);return t==k||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ul(e)}function rl(e){if(!al(e))return!1;var t=jr(e);return t==E||t==_||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ol(e){return"number"==typeof e&&e==xl(e)}function il(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=h}function al(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ll(e){return null!=e&&"object"==typeof e}var sl=xt?qt(xt):function(e){return ll(e)&&vi(e)==S};function cl(e){return"number"==typeof e||ll(e)&&jr(e)==C}function ul(e){if(!ll(e)||jr(e)!=j)return!1;var t=Ze(e);if(null===t)return!0;var n=Re.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&De.call(n)==Be}var dl=wt?qt(wt):function(e){return ll(e)&&jr(e)==I},fl=kt?qt(kt):function(e){return ll(e)&&vi(e)==M};function pl(e){return"string"==typeof e||!qa(e)&&ll(e)&&jr(e)==T}function hl(e){return"symbol"==typeof e||ll(e)&&jr(e)==P}var ml=Et?qt(Et):function(e){return ll(e)&&il(e.length)&&!!it[jr(e)]},gl=Xo(Br),vl=Xo((function(e,t){return e<=t}));function bl(e){if(!e)return[];if(Qa(e))return pl(e)?pn(e):Po(e);if(tt&&e[tt])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[tt]());var t=vi(e);return(t==S?ln:t==M?un:Gl)(e)}function yl(e){return e?(e=kl(e))===p||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function xl(e){var t=yl(e),n=t%1;return t==t?n?t-n:t:0}function wl(e){return e?cr(xl(e),0,g):0}function kl(e){if("number"==typeof e)return e;if(hl(e))return m;if(al(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=al(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Xt(e);var n=ve.test(e);return n||ye.test(e)?ct(e.slice(2),n?2:8):ge.test(e)?m:+e}function El(e){return Ao(e,Nl(e))}function _l(e){return null==e?"":fo(e)}var Sl=Do((function(e,t){if(Ci(t)||Qa(t))Ao(t,zl(t),e);else for(var n in t)Re.call(t,n)&&rr(e,n,t[n])})),Cl=Do((function(e,t){Ao(t,Nl(t),e)})),jl=Do((function(e,t,n,r){Ao(t,Nl(t),e,r)})),Ol=Do((function(e,t,n,r){Ao(t,zl(t),e,r)})),Il=ii(sr),Ml=Qr((function(e,t){e=je(e);var n=-1,r=t.length,i=r>2?t[2]:o;for(i&&ki(t[0],t[1],i)&&(r=1);++n<r;)for(var a=t[n],l=Nl(a),s=-1,c=l.length;++s<c;){var u=l[s],d=e[u];(d===o||Ga(d,Ae[u])&&!Re.call(e,u))&&(e[u]=a[u])}return e})),Tl=Qr((function(e){return e.push(o,ni),_t(Bl,o,e)}));function Pl(e,t,n){var r=null==e?o:Sr(e,t);return r===o?n:r}function Al(e,t){return null!=e&&bi(e,t,Mr)}var Ll=Wo((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=He.call(t)),e[t]=n}),as(cs)),Dl=Wo((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=He.call(t)),Re.call(e,t)?e[t].push(n):e[t]=[n]}),di),Rl=Qr(Pr);function zl(e){return Qa(e)?Qn(e):Nr(e)}function Nl(e){return Qa(e)?Qn(e,!0):Hr(e)}var Hl=Do((function(e,t,n){Wr(e,t,n)})),Bl=Do((function(e,t,n,r){Wr(e,t,n,r)})),Fl=ii((function(e,t){var n={};if(null==e)return n;var r=!1;t=Pt(t,(function(t){return t=ko(t,e),r||(r=t.length>1),t})),Ao(e,li(e),n),r&&(n=ur(n,7,ri));for(var o=t.length;o--;)ho(n,t[o]);return n})),Ul=ii((function(e,t){return null==e?{}:Zr(n=e,t,(function(e,t){return Al(n,t)}));var n}));function Kl(e,t){if(null==e)return{};var n=Pt(li(e),(function(e){return[e]}));return t=di(t),Zr(e,n,(function(e,n){return t(e,n[0])}))}var Wl=Jo(zl),Vl=Jo(Nl);function Gl(e){return null==e?[]:$t(e,zl(e))}var Zl=Ho((function(e,t,n){return t=t.toLowerCase(),e+(n?Yl(t):t)}));function Yl(e){return ns(_l(e).toLowerCase())}function Xl(e){return(e=_l(e))&&e.replace(we,nn).replace(Qe,"")}var ql=Ho((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),$l=Ho((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Ql=No("toLowerCase"),Jl=Ho((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()})),es=Ho((function(e,t,n){return e+(n?" ":"")+ns(t)})),ts=Ho((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),ns=No("toUpperCase");function rs(e,t,n){return e=_l(e),(t=n?o:t)===o?(r=e,nt.test(r)?function(e){return e.match(et)||[]}(e):function(e){return e.match(de)||[]}(e)):e.match(t)||[];var r}var os=Qr((function(e,t){try{return _t(e,o,t)}catch(n){return nl(n)?n:new _e(n)}})),is=ii((function(e,t){return Ct(t,(function(t){t=Ki(t),lr(e,t,Da(e[t],e))})),e}));function as(e){return function(){return e}}var ls=Uo(),ss=Uo(!0);function cs(e){return e}function us(e){return zr("function"==typeof e?e:ur(e,1))}var ds=Qr((function(e,t){return function(n){return Pr(n,e,t)}})),fs=Qr((function(e,t){return function(n){return Pr(e,n,t)}}));function ps(e,t,n){var r=zl(t),o=_r(t,r);null!=n||al(t)&&(o.length||!r.length)||(n=t,t=e,e=this,o=_r(t,zl(t)));var i=!(al(n)&&"chain"in n&&!n.chain),a=rl(e);return Ct(o,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__);return(n.__actions__=Po(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,At([this.value()],arguments))})})),e}function hs(){}var ms=Go(Pt),gs=Go(Ot),vs=Go(Rt);function bs(e){return Ei(e)?Wt(Ki(e)):(t=e,function(e){return Sr(e,t)});var t}var ys=Yo(),xs=Yo(!0);function ws(){return[]}function ks(){return!1}var Es,_s=Vo((function(e,t){return e+t}),0),Ss=$o("ceil"),Cs=Vo((function(e,t){return e/t}),1),js=$o("floor"),Os=Vo((function(e,t){return e*t}),1),Is=$o("round"),Ms=Vo((function(e,t){return e-t}),0);return Un.after=function(e,t){if("function"!=typeof t)throw new Me(i);return e=xl(e),function(){if(--e<1)return t.apply(this,arguments)}},Un.ary=Aa,Un.assign=Sl,Un.assignIn=Cl,Un.assignInWith=jl,Un.assignWith=Ol,Un.at=Il,Un.before=La,Un.bind=Da,Un.bindAll=is,Un.bindKey=Ra,Un.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return qa(e)?e:[e]},Un.chain=ba,Un.chunk=function(e,t,n){t=(n?ki(e,t,n):t===o)?1:xn(xl(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var a=0,l=0,s=r(gt(i/t));a<i;)s[l++]=io(e,a,a+=t);return s},Un.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,o=[];++t<n;){var i=e[t];i&&(o[r++]=i)}return o},Un.concat=function(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],o=e;o--;)t[o-1]=arguments[o];return At(qa(n)?Po(n):[n],yr(t,1))},Un.cond=function(e){var t=null==e?0:e.length,n=di();return e=t?Pt(e,(function(e){if("function"!=typeof e[1])throw new Me(i);return[n(e[0]),e[1]]})):[],Qr((function(n){for(var r=-1;++r<t;){var o=e[r];if(_t(o[0],this,n))return _t(o[1],this,n)}}))},Un.conforms=function(e){return function(e){var t=zl(e);return function(n){return dr(n,e,t)}}(ur(e,1))},Un.constant=as,Un.countBy=wa,Un.create=function(e,t){var n=Kn(e);return null==t?n:ar(n,t)},Un.curry=function e(t,n,r){var i=ei(t,8,o,o,o,o,o,n=r?o:n);return i.placeholder=e.placeholder,i},Un.curryRight=function e(t,n,r){var i=ei(t,s,o,o,o,o,o,n=r?o:n);return i.placeholder=e.placeholder,i},Un.debounce=za,Un.defaults=Ml,Un.defaultsDeep=Tl,Un.defer=Na,Un.delay=Ha,Un.difference=Gi,Un.differenceBy=Zi,Un.differenceWith=Yi,Un.drop=function(e,t,n){var r=null==e?0:e.length;return r?io(e,(t=n||t===o?1:xl(t))<0?0:t,r):[]},Un.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?io(e,0,(t=r-(t=n||t===o?1:xl(t)))<0?0:t):[]},Un.dropRightWhile=function(e,t){return e&&e.length?go(e,di(t,3),!0,!0):[]},Un.dropWhile=function(e,t){return e&&e.length?go(e,di(t,3),!0):[]},Un.fill=function(e,t,n,r){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&ki(e,t,n)&&(n=0,r=i),function(e,t,n,r){var i=e.length;for((n=xl(n))<0&&(n=-n>i?0:i+n),(r=r===o||r>i?i:xl(r))<0&&(r+=i),r=n>r?0:wl(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},Un.filter=function(e,t){return(qa(e)?It:br)(e,di(t,3))},Un.flatMap=function(e,t){return yr(Ia(e,t),1)},Un.flatMapDeep=function(e,t){return yr(Ia(e,t),p)},Un.flatMapDepth=function(e,t,n){return n=n===o?1:xl(n),yr(Ia(e,t),n)},Un.flatten=$i,Un.flattenDeep=function(e){return null!=e&&e.length?yr(e,p):[]},Un.flattenDepth=function(e,t){return null!=e&&e.length?yr(e,t=t===o?1:xl(t)):[]},Un.flip=function(e){return ei(e,512)},Un.flow=ls,Un.flowRight=ss,Un.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var o=e[t];r[o[0]]=o[1]}return r},Un.functions=function(e){return null==e?[]:_r(e,zl(e))},Un.functionsIn=function(e){return null==e?[]:_r(e,Nl(e))},Un.groupBy=Ca,Un.initial=function(e){return null!=e&&e.length?io(e,0,-1):[]},Un.intersection=Ji,Un.intersectionBy=ea,Un.intersectionWith=ta,Un.invert=Ll,Un.invertBy=Dl,Un.invokeMap=ja,Un.iteratee=us,Un.keyBy=Oa,Un.keys=zl,Un.keysIn=Nl,Un.map=Ia,Un.mapKeys=function(e,t){var n={};return t=di(t,3),kr(e,(function(e,r,o){lr(n,t(e,r,o),e)})),n},Un.mapValues=function(e,t){var n={};return t=di(t,3),kr(e,(function(e,r,o){lr(n,r,t(e,r,o))})),n},Un.matches=function(e){return Ur(ur(e,1))},Un.matchesProperty=function(e,t){return Kr(e,ur(t,1))},Un.memoize=Ba,Un.merge=Hl,Un.mergeWith=Bl,Un.method=ds,Un.methodOf=fs,Un.mixin=ps,Un.negate=Fa,Un.nthArg=function(e){return e=xl(e),Qr((function(t){return Vr(t,e)}))},Un.omit=Fl,Un.omitBy=function(e,t){return Kl(e,Fa(di(t)))},Un.once=function(e){return La(2,e)},Un.orderBy=function(e,t,n,r){return null==e?[]:(qa(t)||(t=null==t?[]:[t]),qa(n=r?o:n)||(n=null==n?[]:[n]),Gr(e,t,n))},Un.over=ms,Un.overArgs=Ua,Un.overEvery=gs,Un.overSome=vs,Un.partial=Ka,Un.partialRight=Wa,Un.partition=Ma,Un.pick=Ul,Un.pickBy=Kl,Un.property=bs,Un.propertyOf=function(e){return function(t){return null==e?o:Sr(e,t)}},Un.pull=ra,Un.pullAll=oa,Un.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Yr(e,t,di(n,2)):e},Un.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Yr(e,t,o,n):e},Un.pullAt=ia,Un.range=ys,Un.rangeRight=xs,Un.rearg=Va,Un.reject=function(e,t){return(qa(e)?It:br)(e,Fa(di(t,3)))},Un.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,o=[],i=e.length;for(t=di(t,3);++r<i;){var a=e[r];t(a,r,e)&&(n.push(a),o.push(r))}return Xr(e,o),n},Un.rest=function(e,t){if("function"!=typeof e)throw new Me(i);return Qr(e,t=t===o?t:xl(t))},Un.reverse=aa,Un.sampleSize=function(e,t,n){return t=(n?ki(e,t,n):t===o)?1:xl(t),(qa(e)?er:eo)(e,t)},Un.set=function(e,t,n){return null==e?e:to(e,t,n)},Un.setWith=function(e,t,n,r){return r="function"==typeof r?r:o,null==e?e:to(e,t,n,r)},Un.shuffle=function(e){return(qa(e)?tr:oo)(e)},Un.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&ki(e,t,n)?(t=0,n=r):(t=null==t?0:xl(t),n=n===o?r:xl(n)),io(e,t,n)):[]},Un.sortBy=Ta,Un.sortedUniq=function(e){return e&&e.length?co(e):[]},Un.sortedUniqBy=function(e,t){return e&&e.length?co(e,di(t,2)):[]},Un.split=function(e,t,n){return n&&"number"!=typeof n&&ki(e,t,n)&&(t=n=o),(n=n===o?g:n>>>0)?(e=_l(e))&&("string"==typeof t||null!=t&&!dl(t))&&!(t=fo(t))&&an(e)?_o(pn(e),0,n):e.split(t,n):[]},Un.spread=function(e,t){if("function"!=typeof e)throw new Me(i);return t=null==t?0:xn(xl(t),0),Qr((function(n){var r=n[t],o=_o(n,0,t);return r&&At(o,r),_t(e,this,o)}))},Un.tail=function(e){var t=null==e?0:e.length;return t?io(e,1,t):[]},Un.take=function(e,t,n){return e&&e.length?io(e,0,(t=n||t===o?1:xl(t))<0?0:t):[]},Un.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?io(e,(t=r-(t=n||t===o?1:xl(t)))<0?0:t,r):[]},Un.takeRightWhile=function(e,t){return e&&e.length?go(e,di(t,3),!1,!0):[]},Un.takeWhile=function(e,t){return e&&e.length?go(e,di(t,3)):[]},Un.tap=function(e,t){return t(e),e},Un.throttle=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new Me(i);return al(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),za(e,t,{leading:r,maxWait:t,trailing:o})},Un.thru=ya,Un.toArray=bl,Un.toPairs=Wl,Un.toPairsIn=Vl,Un.toPath=function(e){return qa(e)?Pt(e,Ki):hl(e)?[e]:Po(Ui(_l(e)))},Un.toPlainObject=El,Un.transform=function(e,t,n){var r=qa(e),o=r||el(e)||ml(e);if(t=di(t,4),null==n){var i=e&&e.constructor;n=o?r?new i:[]:al(e)&&rl(i)?Kn(Ze(e)):{}}return(o?Ct:kr)(e,(function(e,r,o){return t(n,e,r,o)})),n},Un.unary=function(e){return Aa(e,1)},Un.union=la,Un.unionBy=sa,Un.unionWith=ca,Un.uniq=function(e){return e&&e.length?po(e):[]},Un.uniqBy=function(e,t){return e&&e.length?po(e,di(t,2)):[]},Un.uniqWith=function(e,t){return t="function"==typeof t?t:o,e&&e.length?po(e,o,t):[]},Un.unset=function(e,t){return null==e||ho(e,t)},Un.unzip=ua,Un.unzipWith=da,Un.update=function(e,t,n){return null==e?e:mo(e,t,wo(n))},Un.updateWith=function(e,t,n,r){return r="function"==typeof r?r:o,null==e?e:mo(e,t,wo(n),r)},Un.values=Gl,Un.valuesIn=function(e){return null==e?[]:$t(e,Nl(e))},Un.without=fa,Un.words=rs,Un.wrap=function(e,t){return Ka(wo(t),e)},Un.xor=pa,Un.xorBy=ha,Un.xorWith=ma,Un.zip=ga,Un.zipObject=function(e,t){return yo(e||[],t||[],rr)},Un.zipObjectDeep=function(e,t){return yo(e||[],t||[],to)},Un.zipWith=va,Un.entries=Wl,Un.entriesIn=Vl,Un.extend=Cl,Un.extendWith=jl,ps(Un,Un),Un.add=_s,Un.attempt=os,Un.camelCase=Zl,Un.capitalize=Yl,Un.ceil=Ss,Un.clamp=function(e,t,n){return n===o&&(n=t,t=o),n!==o&&(n=(n=kl(n))==n?n:0),t!==o&&(t=(t=kl(t))==t?t:0),cr(kl(e),t,n)},Un.clone=function(e){return ur(e,4)},Un.cloneDeep=function(e){return ur(e,5)},Un.cloneDeepWith=function(e,t){return ur(e,5,t="function"==typeof t?t:o)},Un.cloneWith=function(e,t){return ur(e,4,t="function"==typeof t?t:o)},Un.conformsTo=function(e,t){return null==t||dr(e,t,zl(t))},Un.deburr=Xl,Un.defaultTo=function(e,t){return null==e||e!=e?t:e},Un.divide=Cs,Un.endsWith=function(e,t,n){e=_l(e),t=fo(t);var r=e.length,i=n=n===o?r:cr(xl(n),0,r);return(n-=t.length)>=0&&e.slice(n,i)==t},Un.eq=Ga,Un.escape=function(e){return(e=_l(e))&&$.test(e)?e.replace(X,rn):e},Un.escapeRegExp=function(e){return(e=_l(e))&&ie.test(e)?e.replace(oe,"\\$&"):e},Un.every=function(e,t,n){var r=qa(e)?Ot:gr;return n&&ki(e,t,n)&&(t=o),r(e,di(t,3))},Un.find=ka,Un.findIndex=Xi,Un.findKey=function(e,t){return Nt(e,di(t,3),kr)},Un.findLast=Ea,Un.findLastIndex=qi,Un.findLastKey=function(e,t){return Nt(e,di(t,3),Er)},Un.floor=js,Un.forEach=_a,Un.forEachRight=Sa,Un.forIn=function(e,t){return null==e?e:xr(e,di(t,3),Nl)},Un.forInRight=function(e,t){return null==e?e:wr(e,di(t,3),Nl)},Un.forOwn=function(e,t){return e&&kr(e,di(t,3))},Un.forOwnRight=function(e,t){return e&&Er(e,di(t,3))},Un.get=Pl,Un.gt=Za,Un.gte=Ya,Un.has=function(e,t){return null!=e&&bi(e,t,Ir)},Un.hasIn=Al,Un.head=Qi,Un.identity=cs,Un.includes=function(e,t,n,r){e=Qa(e)?e:Gl(e),n=n&&!r?xl(n):0;var o=e.length;return n<0&&(n=xn(o+n,0)),pl(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&Bt(e,t,n)>-1},Un.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:xl(n);return o<0&&(o=xn(r+o,0)),Bt(e,t,o)},Un.inRange=function(e,t,n){return t=yl(t),n===o?(n=t,t=0):n=yl(n),(r=e=kl(e))>=wn(i=t,a=n)&&r<xn(i,a);var r,i,a},Un.invoke=Rl,Un.isArguments=Xa,Un.isArray=qa,Un.isArrayBuffer=$a,Un.isArrayLike=Qa,Un.isArrayLikeObject=Ja,Un.isBoolean=function(e){return!0===e||!1===e||ll(e)&&jr(e)==x},Un.isBuffer=el,Un.isDate=tl,Un.isElement=function(e){return ll(e)&&1===e.nodeType&&!ul(e)},Un.isEmpty=function(e){if(null==e)return!0;if(Qa(e)&&(qa(e)||"string"==typeof e||"function"==typeof e.splice||el(e)||ml(e)||Xa(e)))return!e.length;var t=vi(e);if(t==S||t==M)return!e.size;if(Ci(e))return!Nr(e).length;for(var n in e)if(Re.call(e,n))return!1;return!0},Un.isEqual=function(e,t){return Lr(e,t)},Un.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:o)?n(e,t):o;return r===o?Lr(e,t,o,n):!!r},Un.isError=nl,Un.isFinite=function(e){return"number"==typeof e&&vn(e)},Un.isFunction=rl,Un.isInteger=ol,Un.isLength=il,Un.isMap=sl,Un.isMatch=function(e,t){return e===t||Dr(e,t,pi(t))},Un.isMatchWith=function(e,t,n){return n="function"==typeof n?n:o,Dr(e,t,pi(t),n)},Un.isNaN=function(e){return cl(e)&&e!=+e},Un.isNative=function(e){if(Si(e))throw new _e("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Rr(e)},Un.isNil=function(e){return null==e},Un.isNull=function(e){return null===e},Un.isNumber=cl,Un.isObject=al,Un.isObjectLike=ll,Un.isPlainObject=ul,Un.isRegExp=dl,Un.isSafeInteger=function(e){return ol(e)&&e>=-9007199254740991&&e<=h},Un.isSet=fl,Un.isString=pl,Un.isSymbol=hl,Un.isTypedArray=ml,Un.isUndefined=function(e){return e===o},Un.isWeakMap=function(e){return ll(e)&&vi(e)==A},Un.isWeakSet=function(e){return ll(e)&&"[object WeakSet]"==jr(e)},Un.join=function(e,t){return null==e?"":bn.call(e,t)},Un.kebabCase=ql,Un.last=na,Un.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r;return n!==o&&(i=(i=xl(n))<0?xn(r+i,0):wn(i,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):Ht(e,Ut,i,!0)},Un.lowerCase=$l,Un.lowerFirst=Ql,Un.lt=gl,Un.lte=vl,Un.max=function(e){return e&&e.length?vr(e,cs,Or):o},Un.maxBy=function(e,t){return e&&e.length?vr(e,di(t,2),Or):o},Un.mean=function(e){return Kt(e,cs)},Un.meanBy=function(e,t){return Kt(e,di(t,2))},Un.min=function(e){return e&&e.length?vr(e,cs,Br):o},Un.minBy=function(e,t){return e&&e.length?vr(e,di(t,2),Br):o},Un.stubArray=ws,Un.stubFalse=ks,Un.stubObject=function(){return{}},Un.stubString=function(){return""},Un.stubTrue=function(){return!0},Un.multiply=Os,Un.nth=function(e,t){return e&&e.length?Vr(e,xl(t)):o},Un.noConflict=function(){return ft._===this&&(ft._=Fe),this},Un.noop=hs,Un.now=Pa,Un.pad=function(e,t,n){e=_l(e);var r=(t=xl(t))?fn(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return Zo(vt(o),n)+e+Zo(gt(o),n)},Un.padEnd=function(e,t,n){e=_l(e);var r=(t=xl(t))?fn(e):0;return t&&r<t?e+Zo(t-r,n):e},Un.padStart=function(e,t,n){e=_l(e);var r=(t=xl(t))?fn(e):0;return t&&r<t?Zo(t-r,n)+e:e},Un.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),En(_l(e).replace(ae,""),t||0)},Un.random=function(e,t,n){if(n&&"boolean"!=typeof n&&ki(e,t,n)&&(t=n=o),n===o&&("boolean"==typeof t?(n=t,t=o):"boolean"==typeof e&&(n=e,e=o)),e===o&&t===o?(e=0,t=1):(e=yl(e),t===o?(t=e,e=0):t=yl(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var i=_n();return wn(e+i*(t-e+st("1e-"+((i+"").length-1))),t)}return qr(e,t)},Un.reduce=function(e,t,n){var r=qa(e)?Lt:Gt,o=arguments.length<3;return r(e,di(t,4),n,o,hr)},Un.reduceRight=function(e,t,n){var r=qa(e)?Dt:Gt,o=arguments.length<3;return r(e,di(t,4),n,o,mr)},Un.repeat=function(e,t,n){return t=(n?ki(e,t,n):t===o)?1:xl(t),$r(_l(e),t)},Un.replace=function(){var e=arguments,t=_l(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Un.result=function(e,t,n){var r=-1,i=(t=ko(t,e)).length;for(i||(i=1,e=o);++r<i;){var a=null==e?o:e[Ki(t[r])];a===o&&(r=i,a=n),e=rl(a)?a.call(e):a}return e},Un.round=Is,Un.runInContext=e,Un.sample=function(e){return(qa(e)?Jn:Jr)(e)},Un.size=function(e){if(null==e)return 0;if(Qa(e))return pl(e)?fn(e):e.length;var t=vi(e);return t==S||t==M?e.size:Nr(e).length},Un.snakeCase=Jl,Un.some=function(e,t,n){var r=qa(e)?Rt:ao;return n&&ki(e,t,n)&&(t=o),r(e,di(t,3))},Un.sortedIndex=function(e,t){return lo(e,t)},Un.sortedIndexBy=function(e,t,n){return so(e,t,di(n,2))},Un.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=lo(e,t);if(r<n&&Ga(e[r],t))return r}return-1},Un.sortedLastIndex=function(e,t){return lo(e,t,!0)},Un.sortedLastIndexBy=function(e,t,n){return so(e,t,di(n,2),!0)},Un.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=lo(e,t,!0)-1;if(Ga(e[n],t))return n}return-1},Un.startCase=es,Un.startsWith=function(e,t,n){return e=_l(e),n=null==n?0:cr(xl(n),0,e.length),t=fo(t),e.slice(n,n+t.length)==t},Un.subtract=Ms,Un.sum=function(e){return e&&e.length?Zt(e,cs):0},Un.sumBy=function(e,t){return e&&e.length?Zt(e,di(t,2)):0},Un.template=function(e,t,n){var r=Un.templateSettings;n&&ki(e,t,n)&&(t=o),e=_l(e),t=jl({},t,r,ti);var i,a,l=jl({},t.imports,r.imports,ti),s=zl(l),c=$t(l,s),u=0,d=t.interpolate||ke,f="__p += '",p=Oe((t.escape||ke).source+"|"+d.source+"|"+(d===ee?he:ke).source+"|"+(t.evaluate||ke).source+"|$","g"),h="//# sourceURL="+(Re.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ot+"]")+"\n";e.replace(p,(function(t,n,r,o,l,s){return r||(r=o),f+=e.slice(u,s).replace(Ee,on),n&&(i=!0,f+="' +\n__e("+n+") +\n'"),l&&(a=!0,f+="';\n"+l+";\n__p += '"),r&&(f+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),u=s+t.length,t})),f+="';\n";var m=Re.call(t,"variable")&&t.variable;if(m){if(fe.test(m))throw new _e("Invalid `variable` option passed into `_.template`")}else f="with (obj) {\n"+f+"\n}\n";f=(a?f.replace(V,""):f).replace(G,"$1").replace(Z,"$1;"),f="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var g=os((function(){return Se(s,h+"return "+f).apply(o,c)}));if(g.source=f,nl(g))throw g;return g},Un.times=function(e,t){if((e=xl(e))<1||e>h)return[];var n=g,r=wn(e,g);t=di(t),e-=g;for(var o=Yt(r,t);++n<e;)t(n);return o},Un.toFinite=yl,Un.toInteger=xl,Un.toLength=wl,Un.toLower=function(e){return _l(e).toLowerCase()},Un.toNumber=kl,Un.toSafeInteger=function(e){return e?cr(xl(e),-9007199254740991,h):0===e?e:0},Un.toString=_l,Un.toUpper=function(e){return _l(e).toUpperCase()},Un.trim=function(e,t,n){if((e=_l(e))&&(n||t===o))return Xt(e);if(!e||!(t=fo(t)))return e;var r=pn(e),i=pn(t);return _o(r,Jt(r,i),en(r,i)+1).join("")},Un.trimEnd=function(e,t,n){if((e=_l(e))&&(n||t===o))return e.slice(0,hn(e)+1);if(!e||!(t=fo(t)))return e;var r=pn(e);return _o(r,0,en(r,pn(t))+1).join("")},Un.trimStart=function(e,t,n){if((e=_l(e))&&(n||t===o))return e.replace(ae,"");if(!e||!(t=fo(t)))return e;var r=pn(e);return _o(r,Jt(r,pn(t))).join("")},Un.truncate=function(e,t){var n=30,r="...";if(al(t)){var i="separator"in t?t.separator:i;n="length"in t?xl(t.length):n,r="omission"in t?fo(t.omission):r}var a=(e=_l(e)).length;if(an(e)){var l=pn(e);a=l.length}if(n>=a)return e;var s=n-fn(r);if(s<1)return r;var c=l?_o(l,0,s).join(""):e.slice(0,s);if(i===o)return c+r;if(l&&(s+=c.length-s),dl(i)){if(e.slice(s).search(i)){var u,d=c;for(i.global||(i=Oe(i.source,_l(me.exec(i))+"g")),i.lastIndex=0;u=i.exec(d);)var f=u.index;c=c.slice(0,f===o?s:f)}}else if(e.indexOf(fo(i),s)!=s){var p=c.lastIndexOf(i);p>-1&&(c=c.slice(0,p))}return c+r},Un.unescape=function(e){return(e=_l(e))&&q.test(e)?e.replace(Y,mn):e},Un.uniqueId=function(e){var t=++ze;return _l(e)+t},Un.upperCase=ts,Un.upperFirst=ns,Un.each=_a,Un.eachRight=Sa,Un.first=Qi,ps(Un,(Es={},kr(Un,(function(e,t){Re.call(Un.prototype,t)||(Es[t]=e)})),Es),{chain:!1}),Un.VERSION="4.17.21",Ct(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Un[e].placeholder=Un})),Ct(["drop","take"],(function(e,t){Gn.prototype[e]=function(n){n=n===o?1:xn(xl(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,g),type:e+(r.__dir__<0?"Right":"")}),r},Gn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Ct(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;Gn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:di(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),Ct(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Gn.prototype[e]=function(){return this[n](1).value()[0]}})),Ct(["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(cs)},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 Pr(n,e,t)}))})),Gn.prototype.reject=function(e){return this.filter(Fa(di(e)))},Gn.prototype.slice=function(e,t){e=xl(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!==o&&(n=(t=xl(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(g)},kr(Gn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=Un[r?"take"+("last"==t?"Right":""):t],a=r||/^find/.test(t);i&&(Un.prototype[t]=function(){var t=this.__wrapped__,l=r?[1]:arguments,s=t instanceof Gn,c=l[0],u=s||qa(t),d=function(e){var t=i.apply(Un,At([e],l));return r&&f?t[0]:t};u&&n&&"function"==typeof c&&1!=c.length&&(s=u=!1);var f=this.__chain__,p=!!this.__actions__.length,h=a&&!f,m=s&&!p;if(!a&&u){t=m?t:new Gn(this);var g=e.apply(t,l);return g.__actions__.push({func:ya,args:[d],thisArg:o}),new Vn(g,f)}return h&&m?e.apply(this,l):(g=this.thru(d),h?r?g.value()[0]:g.value():g)})})),Ct(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Te[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Un.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(qa(o)?o:[],e)}return this[n]((function(n){return t.apply(qa(n)?n:[],e)}))}})),kr(Gn.prototype,(function(e,t){var n=Un[t];if(n){var r=n.name+"";Re.call(An,r)||(An[r]=[]),An[r].push({name:t,func:n})}})),An[Ko(o,2).name]=[{name:"wrapper",func:o}],Gn.prototype.clone=function(){var e=new Gn(this.__wrapped__);return e.__actions__=Po(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Po(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Po(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=qa(e),r=t<0,o=n?e.length:0,i=function(e,t,n){for(var r=-1,o=n.length;++r<o;){var i=n[r],a=i.size;switch(i.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=wn(t,e+a);break;case"takeRight":e=xn(e,t-a)}}return{start:e,end:t}}(0,o,this.__views__),a=i.start,l=i.end,s=l-a,c=r?l:a-1,u=this.__iteratees__,d=u.length,f=0,p=wn(s,this.__takeCount__);if(!n||!r&&o==s&&p==s)return vo(e,this.__actions__);var h=[];e:for(;s--&&f<p;){for(var m=-1,g=e[c+=t];++m<d;){var v=u[m],b=v.iteratee,y=v.type,x=b(g);if(2==y)g=x;else if(!x){if(1==y)continue e;break e}}h[f++]=g}return h},Un.prototype.at=xa,Un.prototype.chain=function(){return ba(this)},Un.prototype.commit=function(){return new Vn(this.value(),this.__chain__)},Un.prototype.next=function(){this.__values__===o&&(this.__values__=bl(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?o:this.__values__[this.__index__++]}},Un.prototype.plant=function(e){for(var t,n=this;n instanceof Wn;){var r=Vi(n);r.__index__=0,r.__values__=o,t?i.__wrapped__=r:t=r;var i=r;n=n.__wrapped__}return i.__wrapped__=e,t},Un.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Gn){var t=e;return this.__actions__.length&&(t=new Gn(this)),(t=t.reverse()).__actions__.push({func:ya,args:[aa],thisArg:o}),new Vn(t,this.__chain__)}return this.thru(aa)},Un.prototype.toJSON=Un.prototype.valueOf=Un.prototype.value=function(){return vo(this.__wrapped__,this.__actions__)},Un.prototype.first=Un.prototype.head,tt&&(Un.prototype[tt]=function(){return this}),Un}();ft._=gn,(r=function(){return gn}.call(t,n,t,e))===o||(e.exports=r)}.call(this)},4516:function(e){var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(o){return!1}}()?Object.assign:function(e,i){for(var a,l,s=o(e),c=1;c<arguments.length;c++){for(var u in a=Object(arguments[c]))n.call(a,u)&&(s[u]=a[u]);if(t){l=t(a);for(var d=0;d<l.length;d++)r.call(a,l[d])&&(s[l[d]]=a[l[d]])}}return s}},6094:function(e,t,n){n(4516);var r=n(9787),o=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var i=Symbol.for;o=i("react.element"),t.Fragment=i("react.fragment")}var a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l=Object.prototype.hasOwnProperty,s={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,i={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)l.call(t,r)&&!s.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:u,props:i,_owner:a.current}}t.jsx=c,t.jsxs=c},4512:function(e,t,n){e.exports=n(6094)},1602:function(e){var t=function(e){var t,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(T){s=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var o,i,a,l,s=t&&t.prototype instanceof g?t:g,c=Object.create(s.prototype),v=new O(r||[]);return c._invoke=(o=e,i=n,a=v,l=d,function(e,t){if(l===p)throw new Error("Generator is already running");if(l===h){if("throw"===e)throw t;return M()}for(a.method=e,a.arg=t;;){var n=a.delegate;if(n){var r=S(n,a);if(r){if(r===m)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(l===d)throw l=h,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);l=p;var s=u(o,i,a);if("normal"===s.type){if(l=a.done?h:f,s.arg===m)continue;return{value:s.arg,done:a.done}}"throw"===s.type&&(l=h,a.method="throw",a.arg=s.arg)}}),c}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(r){return{type:"throw",arg:r}}}e.wrap=c;var d="suspendedStart",f="suspendedYield",p="executing",h="completed",m={};function g(){}function v(){}function b(){}var y={};y[i]=function(){return this};var x=Object.getPrototypeOf,w=x&&x(x(I([])));w&&w!==n&&r.call(w,i)&&(y=w);var k=b.prototype=g.prototype=Object.create(y);function E(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function _(e,t){function n(o,i,a,l){var s=u(e[o],e,i);if("throw"!==s.type){var c=s.arg,d=c.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,a,l)}),(function(e){n("throw",e,a,l)})):t.resolve(d).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,l)}))}l(s.arg)}var o;this._invoke=function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}}function S(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,S(e,n),"throw"===n.method))return m;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var o=u(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,m;var i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function j(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function I(e){if(e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}return{next:M}}function M(){return{value:t,done:!0}}return v.prototype=k.constructor=b,b.constructor=v,v.displayName=s(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,s(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},e.awrap=function(e){return{__await:e}},E(_.prototype),_.prototype[a]=function(){return this},e.AsyncIterator=_,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new _(c(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},E(k),s(k,l,"Generator"),k[i]=function(){return this},k.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=I,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return l.type="throw",l.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),j(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;j(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:I(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=t}catch(n){Function("r","regeneratorRuntime = r")(t)}},8336:function(e,t,n){var r=n(487),o=n(4295);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},554:function(e,t,n){var r=n(487),o=n(9135);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},2789:function(e,t,n){var r=n(487),o=n(3729);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},5080:function(e,t,n){var r=n(487),o=n(4241);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},7225:function(e,t,n){var r=n(487),o=n(6029);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},778:function(e,t,n){var r=n(487),o=n(9609);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},4220:function(e,t,n){var r=n(487),o=n(2345);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},4678:function(e,t,n){var r=n(487),o=n(9393);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},1292:function(e,t,n){var r=n(487),o=n(6578);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},196:function(e,t,n){var r=n(487),o=n(9482);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},2205:function(e,t,n){var r=n(487),o=n(7955);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},1310:function(e,t,n){var r=n(487),o=n(3195);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},3922:function(e,t,n){var r=n(487),o=n(2978);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},7096:function(e,t,n){var r=n(487),o=n(1587);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},7117:function(e,t,n){var r=n(487),o=n(9478);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},1106:function(e,t,n){var r=n(487),o=n(7369);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},3336:function(e,t,n){var r=n(487),o=n(1434);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},4406:function(e,t,n){var r=n(487),o=n(8923);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},6043:function(e,t,n){var r=n(487),o=n(5605);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},694:function(e,t,n){var r=n(487),o=n(5644);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},8328:function(e,t,n){var r=n(487),o=n(6843);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},8051:function(e,t,n){var r=n(487),o=n(8461);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},4301:function(e,t,n){var r=n(487),o=n(9935);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},9966:function(e,t,n){var r=n(487),o=n(532);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},9295:function(e,t,n){var r=n(487),o=n(7589);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},9781:function(e,t,n){var r=n(487),o=n(8465);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},371:function(e,t,n){var r=n(487),o=n(5892);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},4623:function(e,t,n){var r=n(487),o=n(3874);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},1528:function(e,t,n){var r=n(487),o=n(2681);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},518:function(e,t,n){var r=n(487),o=n(6759);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},9757:function(e,t,n){var r=n(487),o=n(9650);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},5422:function(e,t,n){var r=n(487),o=n(2044);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},276:function(e,t,n){var r=n(487),o=n(9144);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},6781:function(e,t,n){var r=n(487),o=n(6626);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},580:function(e,t,n){var r=n(487),o=n(6359);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},4285:function(e,t,n){var r=n(487),o=n(9915);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},3313:function(e,t,n){var r=n(487),o=n(9310);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},8635:function(e,t,n){var r=n(487),o=n(6464);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},4404:function(e,t,n){var r=n(487),o=n(5260);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[e.id,o,""]]),r(o,{insert:"head",singleton:!1}),e.exports=o.locals||{}},487:function(e,t,n){var r,o,i=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},a=(o={},function(e){if(void 0===o[e]){var t=document.querySelector(e);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(n){t=null}o[e]=t}return o[e]}),l=[];function s(e){for(var t=-1,n=0;n<l.length;n++)if(l[n].identifier===e){t=n;break}return t}function c(e,t){for(var n={},r=[],o=0;o<e.length;o++){var i=e[o],a=t.base?i[0]+t.base:i[0],c=n[a]||0,u="".concat(a," ").concat(c);n[a]=c+1;var d=s(u),f={css:i[1],media:i[2],sourceMap:i[3]};-1!==d?(l[d].references++,l[d].updater(f)):l.push({identifier:u,updater:v(f,t),references:1}),r.push(u)}return r}function u(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var o=n.nc;o&&(r.nonce=o)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var i=a(e.insert||"head");if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(t)}return t}var d,f=(d=[],function(e,t){return d[e]=t,d.filter(Boolean).join("\n")});function p(e,t,n,r){var o=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=f(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}function h(e,t,n){var r=n.css,o=n.media,i=n.sourceMap;if(o?e.setAttribute("media",o):e.removeAttribute("media"),i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var m=null,g=0;function v(e,t){var n,r,o;if(t.singleton){var i=g++;n=m||(m=u(t)),r=p.bind(null,n,i,!1),o=p.bind(null,n,i,!0)}else n=u(t),r=h.bind(null,n,t),o=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=i());var n=c(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var o=s(n[r]);l[o].references--}for(var i=c(e,t),a=0;a<n.length;a++){var u=s(n[a]);0===l[u].references&&(l[u].updater(),l.splice(u,1))}n=i}}}},788:function(e,t,n){var r={"./ar-SA.json":[7822,558],"./bg-BG.json":[1203,384],"./bn-BD.json":[8525,603],"./ca-ES.json":[510,351],"./cs-CZ.json":[7605,387],"./da-DK.json":[2392,617],"./de-DE.json":[2853,43],"./el-GR.json":[9876,526],"./en.json":[1463],"./es-ES.json":[2264,317],"./eu-ES.json":[5658,431],"./fa-IR.json":[3747,710],"./fi-FI.json":[9490,472],"./fr-FR.json":[7830,364],"./he-IL.json":[1994,262],"./hi-IN.json":[4646,933],"./hu-HU.json":[6373,661],"./id-ID.json":[3247,491],"./it-IT.json":[3257,465],"./ja-JP.json":[198,137],"./kab-KAB.json":[228,164],"./kk-KZ.json":[8972,649],"./ko-KR.json":[7596,60],"./lt-LT.json":[3755,58],"./lv-LV.json":[2327,899],"./my-MM.json":[7704,242],"./nb-NO.json":[1167,246],"./nl-NL.json":[290,196],"./nn-NO.json":[4481,920],"./oc-FR.json":[2284,565],"./pa-IN.json":[6773,280],"./percentages.json":[4451],"./pl-PL.json":[3661,852],"./pt-BR.json":[8881,381],"./pt-PT.json":[5622,149],"./ro-RO.json":[2013,752],"./ru-RU.json":[2253,869],"./si-LK.json":[5497,90],"./sk-SK.json":[4570,401],"./sv-SE.json":[6006,698],"./ta-IN.json":[3952,395],"./tr-TR.json":[7315,213],"./uk-UA.json":[334,583],"./zh-CN.json":[1037,304],"./zh-HK.json":[5334,9],"./zh-TW.json":[931,62]};function o(e){if(!n.o(r,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=r[e],o=t[0];return Promise.all(t.slice(1).map(n.e)).then((function(){return n.t(o,19)}))}o.keys=function(){return Object.keys(r)},o.id=788,e.exports=o},9713:function(e){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},6479:function(e,t,n){var r=n(7316);e.exports=function(e,t){if(null==e)return{};var n,o,i=r(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}},7316:function(e){e.exports=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}},4295:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i),l=n(1667),s=n.n(l),c=new URL(n(3940),n.b),u=new URL(n(3147),n.b),d=a()(o()),f=s()(c),p=s()(u);d.push([e.id,'@font-face{font-family:"Virgil";src:url('+f+');font-display:swap}@font-face{font-family:"Cascadia";src:url('+p+");font-display:swap}",""]),t.default=d},9135:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".excalidraw .ActiveFile .ActiveFile__fileName{display:flex;align-items:center}.excalidraw .ActiveFile .ActiveFile__fileName span{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:9.3em}.excalidraw .ActiveFile .ActiveFile__fileName svg{width:1.15em;-webkit-margin-end:.3em;margin-inline-end:.3em;-webkit-transform:scaleY(0.9);transform:scaleY(0.9)}",""]),t.default=a},3729:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Avatar{width:2.5rem;height:2.5rem;border-radius:1.25rem;display:flex;justify-content:center;align-items:center;color:#fff;cursor:pointer;font-size:.8rem;font-weight:500}",""]),t.default=a},4241:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Card{display:flex;flex-direction:column;align-items:center;max-width:290px;margin:1em;text-align:center}.excalidraw .Card .Card-icon{font-size:2.6em;display:flex;flex:0 0 auto;padding:1.4rem;border-radius:50%;background:var(--card-color);color:#fff}.excalidraw .Card .Card-icon svg{width:2.8rem;height:2.8rem}.excalidraw .Card .Card-details{font-size:.96em;min-height:90px;padding:0 1em;margin-bottom:auto}.excalidraw .Card .Card-button.ToolIcon_type_button{height:2.5rem;margin-top:1em;margin-bottom:.3em;background-color:var(--card-color)}.excalidraw .Card .Card-button.ToolIcon_type_button:hover{background-color:var(--card-color-darker)}.excalidraw .Card .Card-button.ToolIcon_type_button:active{background-color:var(--card-color-darkest)}.excalidraw .Card .Card-button.ToolIcon_type_button .ToolIcon__label{color:#fff}.excalidraw .Card .Card-button.ToolIcon_type_button .Spinner{--spinner-color: #fff}",""]),t.default=a},6029:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Checkbox{margin:4px .3em;display:flex;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.excalidraw .Checkbox:hover:not(.is-checked) .Checkbox-box:not(:focus){box-shadow:0 0 0 2px #4dabf7}.excalidraw .Checkbox:hover:not(.is-checked) .Checkbox-box:not(:focus) svg{display:block;opacity:.3}.excalidraw .Checkbox:active .Checkbox-box{box-shadow:0 0 2px 1px inset #1c7ed6 !important}.excalidraw .Checkbox:hover .Checkbox-box{background-color:rgba(208,235,255,.2)}.excalidraw .Checkbox.is-checked .Checkbox-box{background-color:#d0ebff}.excalidraw .Checkbox.is-checked .Checkbox-box svg{display:block}.excalidraw .Checkbox.is-checked:hover .Checkbox-box{background-color:#a5d8ff}.excalidraw .Checkbox .Checkbox-box{width:22px;height:22px;padding:0;flex:0 0 auto;margin:0 1em;display:flex;align-items:center;justify-content:center;box-shadow:0 0 0 2px #1c7ed6;background-color:transparent;border-radius:4px;color:#1c7ed6}.excalidraw .Checkbox .Checkbox-box:focus{box-shadow:0 0 0 3px #1c7ed6}.excalidraw .Checkbox .Checkbox-box svg{display:none;width:16px;height:16px;stroke-width:3px}.excalidraw .Checkbox .Checkbox-label{display:flex;align-items:center}.excalidraw .Checkbox .excalidraw-tooltip-icon{width:1em;height:1em}",""]),t.default=a},9609:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .CollabButton.is-collaborating{background-color:var(--button-special-active-bg-color)}.excalidraw .CollabButton.is-collaborating .ToolIcon__icon svg,.excalidraw .CollabButton.is-collaborating .ToolIcon__label{color:var(--icon-green-fill-color)}.excalidraw .CollabButton-collaborators{min-width:1em;position:absolute;bottom:-5px;padding:3px;border-radius:50%;background-color:#40c057;color:#fff;font-size:.7em;font-family:var(--ui-font)}:root[dir=ltr] .excalidraw .CollabButton-collaborators{right:-5px}:root[dir=rtl] .excalidraw .CollabButton-collaborators{left:-5px}",""]),t.default=a},2345:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i),l=n(1667),s=n.n(l),c=new URL(n(9669),n.b),u=a()(o()),d=s()(c);u.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .color-picker{background:var(--popup-bg-color);border:0 solid rgba(255,255,255,.25);box-shadow:rgba(0,0,0,.25) 0 1px 4px;border-radius:4px;position:absolute}:root[dir=ltr] .excalidraw .color-picker{left:-5.5px}:root[dir=rtl] .excalidraw .color-picker{right:-5.5px}.excalidraw .color-picker-control-container{display:grid;grid-template-columns:auto 1fr;align-items:center}.excalidraw .color-picker-triangle{width:0;height:0;border-style:solid;border-width:0 9px 10px;border-color:transparent transparent var(--popup-bg-color);position:absolute;top:-10px}:root[dir=ltr] .excalidraw .color-picker-triangle{left:12px}:root[dir=rtl] .excalidraw .color-picker-triangle{right:12px}.excalidraw .color-picker-triangle-shadow{border-color:transparent transparent rgba(0,0,0,.1);top:-11px}.excalidraw .color-picker-content{padding:.5rem;display:grid;grid-template-columns:repeat(5, auto);grid-gap:.5rem;border-radius:4px}.excalidraw .color-picker-content:focus{outline:none;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .color-picker-content .color-input-container{grid-column:1/span 5}.excalidraw .color-picker-swatch{position:relative;height:1.875rem;width:1.875rem;cursor:pointer;border-radius:4px;margin:0;box-sizing:border-box;border:1px solid #ddd;background-color:currentColor !important;-webkit-filter:var(--theme-filter);filter:var(--theme-filter)}.excalidraw .color-picker-swatch:focus{box-shadow:0 0 4px 1px currentColor;border-color:var(--select-highlight-color)}.excalidraw .color-picker-transparent{border-radius:4px;box-shadow:rgba(0,0,0,.1) 0 0 0 1px inset;position:absolute;top:0;right:0;bottom:0;left:0}.excalidraw .color-picker-transparent,.excalidraw .color-picker-label-swatch{background:url("+d+') left center}.excalidraw .color-picker-hash{background:var(--input-border-color);height:1.875rem;width:1.875rem;color:var(--input-label-color);display:flex;align-items:center;justify-content:center;position:relative}:root[dir=ltr] .excalidraw .color-picker-hash{border-radius:4px 0 0 4px}:root[dir=rtl] .excalidraw .color-picker-hash{border-radius:0 4px 4px 0}.excalidraw .color-input-container:focus-within .color-picker-hash{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .color-input-container:focus-within .color-picker-hash::before,.excalidraw .color-input-container:focus-within .color-picker-hash::after{content:"";width:1px;height:100%;position:absolute;top:0}.excalidraw .color-input-container:focus-within .color-picker-hash::before{background:var(--input-border-color)}:root[dir=ltr] .excalidraw .color-input-container:focus-within .color-picker-hash::before{right:-1px}:root[dir=rtl] .excalidraw .color-input-container:focus-within .color-picker-hash::before{left:-1px}.excalidraw .color-input-container:focus-within .color-picker-hash::after{background:var(--input-bg-color)}:root[dir=ltr] .excalidraw .color-input-container:focus-within .color-picker-hash::after{right:-2px}:root[dir=rtl] .excalidraw .color-input-container:focus-within .color-picker-hash::after{left:-2px}.excalidraw .color-input-container{display:flex}.excalidraw .color-picker-input{width:11ch;margin:0;font-size:1rem;background-color:var(--input-bg-color);color:var(--text-primary-color);border:0;outline:none;height:1.75em;box-shadow:var(--input-border-color) 0 0 0 1px inset;float:left;padding:1px;-webkit-padding-start:.5em;padding-inline-start:.5em;-webkit-appearance:none;appearance:none}:root[dir=ltr] .excalidraw .color-picker-input{border-radius:0 4px 4px 0}:root[dir=rtl] .excalidraw .color-picker-input{border-radius:4px 0 0 4px}.excalidraw .color-picker-label-swatch{height:1.875rem;width:1.875rem;-webkit-margin-end:.25rem;margin-inline-end:.25rem;border:1px solid #dee2e6;position:relative;overflow:hidden;background-color:transparent !important;-webkit-filter:var(--theme-filter);filter:var(--theme-filter)}.excalidraw .color-picker-label-swatch:after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;background:var(--swatch-color)}.excalidraw .color-picker-keybinding{position:absolute;bottom:2px;font-size:.7em}:root[dir=ltr] .excalidraw .color-picker-keybinding{right:2px}:root[dir=rtl] .excalidraw .color-picker-keybinding{left:2px}.excalidraw--mobile.excalidraw .color-picker-keybinding{display:none}.excalidraw .color-picker-type-canvasBackground .color-picker-keybinding{color:#aaa}.excalidraw .color-picker-type-elementBackground .color-picker-keybinding{color:#fff}.excalidraw .color-picker-swatch[aria-label=transparent] .color-picker-keybinding{color:#aaa}.excalidraw .color-picker-type-elementStroke .color-picker-keybinding{color:#d4d4d4}.excalidraw.theme--dark .color-picker-type-elementBackground .color-picker-keybinding{color:#000}.excalidraw.theme--dark .color-picker-swatch[aria-label=transparent] .color-picker-keybinding{color:#000}',""]),t.default=u},9393:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .confirm-dialog-buttons{display:flex;padding:.2rem 0;justify-content:flex-end}.excalidraw .confirm-dialog .ToolIcon__icon{min-width:2.5rem;width:auto;font-size:1rem}.excalidraw .confirm-dialog .ToolIcon_type_button{margin-left:.8rem;padding:0 .5rem}.excalidraw .confirm-dialog__content{font-size:1rem}.excalidraw .confirm-dialog--confirm.ToolIcon_type_button{background-color:#fa5252}.excalidraw .confirm-dialog--confirm.ToolIcon_type_button:hover{background-color:#e03131}.excalidraw .confirm-dialog--confirm.ToolIcon_type_button .ToolIcon__icon{color:#fff}",""]),t.default=a},6578:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,':export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .context-menu{position:relative;border-radius:4px;box-shadow:0 3px 10px rgba(0,0,0,.2);padding:0;list-style:none;-webkit-user-select:none;user-select:none;margin:-0.25rem 0 0 .125rem;padding:.5rem 0;background-color:var(--popup-secondary-bg-color);border:1px solid var(--button-gray-3);cursor:default}.excalidraw .context-menu button{color:var(--popup-text-color)}.excalidraw .context-menu-option{position:relative;width:100%;min-width:9.5rem;margin:0;padding:.25rem 1rem .25rem 1.25rem;text-align:start;border-radius:0;background-color:transparent;border:none;white-space:nowrap;display:grid;grid-template-columns:1fr .2fr;align-items:center}.excalidraw .context-menu-option.checkmark::before{position:absolute;left:6px;margin-bottom:1px;content:"✓"}.excalidraw .context-menu-option.dangerous .context-menu-option__label{color:#f03e3e}.excalidraw .context-menu-option .context-menu-option__label{justify-self:start;-webkit-margin-end:20px;margin-inline-end:20px}.excalidraw .context-menu-option .context-menu-option__shortcut{justify-self:end;opacity:.6;font-family:inherit;font-size:.7rem}.excalidraw .context-menu-option:hover{color:var(--popup-bg-color);background-color:var(--select-highlight-color)}.excalidraw .context-menu-option:hover.dangerous{background-color:#fa5252}.excalidraw .context-menu-option:hover.dangerous .context-menu-option__label{color:var(--popup-bg-color)}.excalidraw .context-menu-option:focus{z-index:1}.excalidraw--mobile.excalidraw .context-menu-option{display:block}.excalidraw--mobile.excalidraw .context-menu-option .context-menu-option__label{-webkit-margin-end:0;margin-inline-end:0}.excalidraw--mobile.excalidraw .context-menu-option .context-menu-option__shortcut{display:none}.excalidraw .context-menu-option-separator{border:none;border-top:1px solid #adb5bd}',""]),t.default=a},9482:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Dialog{-webkit-user-select:text;user-select:text;cursor:auto}.excalidraw .Dialog__title{display:grid;align-items:center;margin-top:0;grid-template-columns:1fr calc(var(--space-factor)*7);grid-gap:var(--metric);padding:calc(var(--space-factor)*2);text-align:center;font-variant:small-caps;font-size:1.2em}.excalidraw .Dialog__titleContent{flex:1}.excalidraw .Dialog .Modal__close{color:var(--icon-fill-color);margin:0}.excalidraw .Dialog__content{padding:0 16px 16px}.excalidraw--mobile.excalidraw .Dialog{--metric: calc(var(--space-factor) * 4);--inset-left: max(var(--metric), var(--sal));--inset-right: max(var(--metric), var(--sar))}.excalidraw--mobile.excalidraw .Dialog__title{grid-template-columns:calc(var(--space-factor)*7) 1fr calc(var(--space-factor)*7);position:-webkit-sticky;position:sticky;top:0;padding:calc(var(--space-factor)*2);background:var(--island-bg-color);font-size:1.25em;box-sizing:border-box;border-bottom:1px solid var(--button-gray-2);z-index:1}.excalidraw--mobile.excalidraw .Dialog__titleContent{text-align:center}.excalidraw--mobile.excalidraw .Dialog .Island{width:100vw;height:100%;box-sizing:border-box;overflow-y:auto;padding-left:max(calc(var(--padding) * var(--space-factor)), var(--sal));padding-right:max(calc(var(--padding) * var(--space-factor)), var(--sar));padding-bottom:max(calc(var(--padding) * var(--space-factor)), var(--sab))}.excalidraw--mobile.excalidraw .Dialog .Modal__close{order:-1}",""]),t.default=a},7955:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i),l=n(1667),s=n.n(l),c=new URL(n(9669),n.b),u=a()(o()),d=s()(c);u.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .ExportDialog__preview{--preview-padding: calc(var(--space-factor) * 4);background:url("+d+") left center;text-align:center;padding:var(--preview-padding);margin-bottom:calc(var(--space-factor)*3)}.excalidraw .ExportDialog__preview canvas{max-width:calc(100% - var(--preview-padding)*2);max-height:25rem}.excalidraw.theme--dark .ExportDialog__preview canvas{-webkit-filter:none;filter:none}.excalidraw .ExportDialog__actions{width:100%;display:flex;grid-gap:calc(var(--space-factor)*2);align-items:top;justify-content:space-between}.excalidraw--mobile.excalidraw .ExportDialog{display:flex;flex-direction:column}.excalidraw--mobile.excalidraw .ExportDialog__actions{flex-direction:column;align-items:center}.excalidraw--mobile.excalidraw .ExportDialog__actions>*{margin-bottom:calc(var(--space-factor)*3)}.excalidraw--mobile.excalidraw .ExportDialog__preview canvas{max-height:30vh}.excalidraw--mobile.excalidraw .ExportDialog__dialog,.excalidraw--mobile.excalidraw .ExportDialog__dialog .Island{height:100%;box-sizing:border-box}.excalidraw--mobile.excalidraw .ExportDialog__dialog .Island{overflow-y:auto}.excalidraw .ExportDialog--json .ExportDialog-cards{display:grid;grid-template-columns:repeat(auto-fit, minmax(200px, 1fr));justify-items:center;row-gap:2em}@media(max-width: 460px){.excalidraw .ExportDialog--json .ExportDialog-cards{grid-template-columns:repeat(auto-fit, minmax(240px, 1fr))}.excalidraw .ExportDialog--json .ExportDialog-cards .Card-details{min-height:40px}}.excalidraw .ExportDialog--json .ExportDialog-cards .ProjectName{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;margin:1em auto;align-items:flex-start;flex-direction:column}.excalidraw .ExportDialog--json .ExportDialog-cards .ProjectName .TextInput{width:auto}.excalidraw .ExportDialog--json .ExportDialog-cards .ProjectName-label{margin:.625em 0;font-weight:bold}.excalidraw button.ExportDialog-imageExportButton{width:5rem;height:5rem;margin:0 .2em;border-radius:1rem;background-color:var(--button-color);box-shadow:0 3px 5px -1px rgba(0,0,0,.28),0 6px 10px 0 rgba(0,0,0,.14);font-family:Cascadia;font-size:1.8em;color:#fff}.excalidraw button.ExportDialog-imageExportButton:hover{background-color:var(--button-color-darker)}.excalidraw button.ExportDialog-imageExportButton:active{background-color:var(--button-color-darkest);box-shadow:none}.excalidraw button.ExportDialog-imageExportButton svg{width:.9em}",""]),t.default=u},3195:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".excalidraw .FixedSideContainer{position:absolute;pointer-events:none}.excalidraw .FixedSideContainer>*{pointer-events:all}.excalidraw .FixedSideContainer_side_top{left:var(--space-factor);top:var(--space-factor);right:var(--space-factor);z-index:2}.excalidraw .FixedSideContainer_side_top.zen-mode{right:42px}",""]),t.default=a},2978:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .HelpDialog h3{border-bottom:1px solid var(--button-gray-2);padding-bottom:4px}.excalidraw .HelpDialog--island{border:1px solid var(--button-gray-2);margin-bottom:16px}.excalidraw .HelpDialog--island-title{margin:0;padding:4px;background-color:var(--button-gray-1);text-align:center}.excalidraw .HelpDialog--shortcut{border-top:1px solid var(--button-gray-2)}.excalidraw .HelpDialog--key{word-break:keep-all;border:1px solid var(--button-gray-2);padding:2px 8px;margin:auto 4px;background-color:var(--button-gray-1);border-radius:2px;font-size:.8em;min-height:26px;box-sizing:border-box;display:flex;align-items:center;font-family:inherit}.excalidraw .HelpDialog--header{display:flex;flex-direction:row;justify-content:space-evenly;margin-bottom:32px;padding-bottom:16px}.excalidraw .HelpDialog--btn{border:1px solid var(--link-color);padding:8px 32px;border-radius:4px}.excalidraw .HelpDialog--btn:hover{text-decoration:none}",""]),t.default=a},1587:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .HintViewer{pointer-events:none;box-sizing:border-box;position:absolute;display:flex;justify-content:center;left:0;top:100%;max-width:100%;width:100%;margin-top:6px;text-align:center;color:#868e96;font-size:.8rem}.excalidraw--mobile.excalidraw .HintViewer{position:static;padding-right:2em}.excalidraw .HintViewer>span{padding:.2rem .4rem;background-color:var(--overlay-bg-color);border-radius:4px}",""]),t.default=a},9478:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,':export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .picker-container{display:inline-block;box-sizing:border-box;margin-right:.25rem}.excalidraw .picker{background:var(--popup-bg-color);border:0 solid rgba(255,255,255,.25);box-shadow:rgba(0,0,0,.25) 0 1px 4px;border-radius:4px;position:absolute}.excalidraw .picker-container button,.excalidraw .picker button{position:relative;display:flex;align-items:center;justify-content:center}.excalidraw .picker-container button:focus-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}',""]),t.default=a},7369:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".excalidraw .Island{--padding: 0;background-color:var(--island-bg-color);box-shadow:var(--shadow-island);border-radius:var(--border-radius-lg);padding:calc(var(--padding)*var(--space-factor));position:relative;transition:box-shadow .5s ease-in-out}.excalidraw .Island.zen-mode{box-shadow:none}",""]),t.default=a},1434:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".excalidraw .layer-ui__wrapper{z-index:var(--zIndex-layerUI)}.excalidraw .layer-ui__wrapper__top-right{display:flex}.excalidraw .layer-ui__wrapper__footer{width:100%}.excalidraw .layer-ui__wrapper__footer-right{z-index:100;display:flex}.excalidraw .layer-ui__wrapper .zen-mode-transition{transition:-webkit-transform .5s ease-in-out;transition:transform .5s ease-in-out;transition:transform .5s ease-in-out, -webkit-transform .5s ease-in-out}:root[dir=ltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-left{-webkit-transform:translate(-999px, 0);transform:translate(-999px, 0)}:root[dir=ltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-right{-webkit-transform:translate(999px, 0);transform:translate(999px, 0)}:root[dir=rtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-left{-webkit-transform:translate(999px, 0);transform:translate(999px, 0)}:root[dir=rtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.transition-right{-webkit-transform:translate(-999px, 0);transform:translate(-999px, 0)}:root[dir=ltr] .excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-left{-webkit-transform:translate(-76px, 0);transform:translate(-76px, 0)}:root[dir=rtl] .excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-left{-webkit-transform:translate(76px, 0);transform:translate(76px, 0)}.excalidraw .layer-ui__wrapper .zen-mode-transition.layer-ui__wrapper__footer-left--transition-bottom{-webkit-transform:translate(0, 92px);transform:translate(0, 92px)}.excalidraw .layer-ui__wrapper .disable-zen-mode{height:30px;position:absolute;bottom:10px;font-size:10px;padding:10px;font-weight:500;opacity:0;visibility:hidden;transition:visibility 0s linear 0s,opacity .5s}[dir=ltr] .excalidraw .layer-ui__wrapper .disable-zen-mode{right:15px}[dir=rtl] .excalidraw .layer-ui__wrapper .disable-zen-mode{left:15px}.excalidraw .layer-ui__wrapper .disable-zen-mode--visible{opacity:1;visibility:visible;transition:visibility 0s linear 300ms,opacity .5s;transition-delay:.8s}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-center{pointer-events:none}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-center>*{pointer-events:all}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-left,.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-right,.excalidraw .layer-ui__wrapper .disable-zen-mode--visible{pointer-events:all}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-left{margin-bottom:.2em}.excalidraw .layer-ui__wrapper .layer-ui__wrapper__footer-right{margin-top:auto;margin-bottom:auto;-webkit-margin-end:1em;margin-inline-end:1em}",""]),t.default=a},8923:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".excalidraw .layer-ui__library{margin:auto;display:flex;align-items:center;justify-content:center}.excalidraw .layer-ui__library .layer-ui__library-header{display:flex;align-items:center;width:100%;margin:2px 0}.excalidraw .layer-ui__library .layer-ui__library-header button{margin:0 2px}.excalidraw .layer-ui__library .layer-ui__library-header a{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-padding-end:18px;padding-inline-end:18px;white-space:nowrap}.excalidraw .layer-ui__library-message{padding:10px 20px;max-width:200px}.excalidraw .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}",""]),t.default=a},5605:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".excalidraw .library-menu-items-container .library-actions{display:flex}.excalidraw .library-menu-items-container .library-actions button .library-actions-counter{position:absolute;right:2px;bottom:2px;border-radius:50%;width:1em;height:1em;padding:1px;font-size:.7rem;background:#fff}.excalidraw .library-menu-items-container .library-actions--remove{background-color:#f03e3e}.excalidraw .library-menu-items-container .library-actions--remove:hover{background-color:#e03131}.excalidraw .library-menu-items-container .library-actions--remove:active{background-color:#c92a2a}.excalidraw .library-menu-items-container .library-actions--remove svg{color:#fff}.excalidraw .library-menu-items-container .library-actions--remove .library-actions-counter{color:#f03e3e}.excalidraw .library-menu-items-container .library-actions--export{background-color:#94d82d}.excalidraw .library-menu-items-container .library-actions--export:hover{background-color:#74b816}.excalidraw .library-menu-items-container .library-actions--export:active{background-color:#66a80f}.excalidraw .library-menu-items-container .library-actions--export svg{color:#fff}.excalidraw .library-menu-items-container .library-actions--export .library-actions-counter{color:#94d82d}.excalidraw .library-menu-items-container .library-actions--publish{background-color:#15aabf}.excalidraw .library-menu-items-container .library-actions--publish:hover{background-color:#1098ad}.excalidraw .library-menu-items-container .library-actions--publish:active{background-color:#0b7285}.excalidraw .library-menu-items-container .library-actions--publish svg{color:#fff}.excalidraw .library-menu-items-container .library-actions--publish label{margin-left:-0.2em;margin-right:1.1em;color:#fff;font-size:.86em}.excalidraw .library-menu-items-container .library-actions--publish .library-actions-counter{color:#15aabf}.excalidraw .library-menu-items-container .library-actions--load{background-color:#228be6}.excalidraw .library-menu-items-container .library-actions--load:hover{background-color:#1c7ed6}.excalidraw .library-menu-items-container .library-actions--load:active{background-color:#1864ab}.excalidraw .library-menu-items-container .library-actions--load svg{color:#fff}.excalidraw .library-menu-items-container__items{max-height:50vh;overflow:auto;margin-top:.5rem}.excalidraw .library-menu-items-container .separator{font-weight:500;font-size:.9rem;margin:.6em .2em;color:var(--text-primary-color)}",""]),t.default=a},5644:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .library-unit{align-items:center;border:1px solid var(--button-gray-2);display:flex;justify-content:center;position:relative;width:63px;height:63px}.excalidraw .library-unit--hover{box-shadow:inset 0px 0px 0px 2px #339af0;border-color:#339af0}.excalidraw .library-unit--selected{box-shadow:inset 0px 0px 0px 2px #1971c2;border-color:#1971c2}.excalidraw.theme--dark .library-unit{border-color:#303030}.excalidraw .library-unit__dragger{display:flex;align-items:center;justify-content:center;height:100%;width:100%}.excalidraw .library-unit__dragger>svg{-webkit-filter:var(--theme-filter);filter:var(--theme-filter);flex-grow:1;max-height:100%;max-width:100%}.excalidraw .library-unit__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{-webkit-transform:scale(1);transform:scale(1);-webkit-animation:library-unit__adder-animation 1s ease-in infinite;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{-webkit-animation:none;animation:none;-webkit-transform:scale(0.8);transform:scale(0.8);fill:#000}.excalidraw .library-unit__active{cursor:pointer}@-webkit-keyframes library-unit__adder-animation{0%{-webkit-transform:scale(0.85);transform:scale(0.85)}50%{-webkit-transform:scale(1);transform:scale(1)}100%{-webkit-transform:scale(0.85);transform:scale(0.85)}}@keyframes library-unit__adder-animation{0%{-webkit-transform:scale(0.85);transform:scale(0.85)}50%{-webkit-transform:scale(1);transform:scale(1)}100%{-webkit-transform:scale(0.85);transform:scale(0.85)}}",""]),t.default=a},6843:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw.excalidraw-modal-container{position:absolute;z-index:10}.excalidraw .Modal{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;overflow:auto;padding:calc(var(--space-factor)*10)}.excalidraw .Modal__background{position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;background-color:rgba(0,0,0,.7)}.excalidraw .Modal__content{position:relative;z-index:2;width:100%;max-width:var(--max-width);max-height:100%;opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px);-webkit-animation:Modal__content_fade-in .1s ease-out .05s forwards;animation:Modal__content_fade-in .1s ease-out .05s forwards;position:relative;overflow-y:auto;background:var(--island-bg-color);border:1px solid var(--dialog-border-color);box-shadow:0 2px 10px rgba(0,0,0,.25);border-radius:6px;box-sizing:border-box}.excalidraw .Modal__content:focus{outline:none}.excalidraw--mobile.excalidraw .Modal__content{max-width:100%;border:0;border-radius:0}@-webkit-keyframes Modal__content_fade-in{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes Modal__content_fade-in{from{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}to{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}}.excalidraw .Modal__close{width:calc(var(--space-factor)*7);height:calc(var(--space-factor)*7);display:flex;align-items:center;justify-content:center}.excalidraw .Modal__close svg{height:calc(var(--space-factor)*5)}.excalidraw--mobile.excalidraw .Modal{padding:0}.excalidraw--mobile.excalidraw .Modal__content{position:absolute;top:0;left:0;right:0;bottom:0}",""]),t.default=a},8461:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw--mobile.excalidraw .PasteChartDialog .Island{display:flex;flex-direction:column}.excalidraw .PasteChartDialog .container{display:flex;align-items:center;justify-content:space-around;flex-wrap:wrap}.excalidraw--mobile.excalidraw .PasteChartDialog .container{flex-direction:column;justify-content:center}.excalidraw .PasteChartDialog .ChartPreview{margin:8px;text-align:center;width:192px;height:128px;border-radius:2px;padding:1px;border:1px solid #ced4da;display:flex;align-items:center;justify-content:center;background:transparent}.excalidraw .PasteChartDialog .ChartPreview div{display:inline-block}.excalidraw .PasteChartDialog .ChartPreview svg{max-height:120px;max-width:186px}.excalidraw .PasteChartDialog .ChartPreview:hover{padding:0;border:2px solid #339af0}",""]),t.default=a},9935:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".excalidraw .popover{position:absolute;z-index:10}",""]),t.default=a},532:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".ProjectName{margin:auto;display:flex;align-items:center}.ProjectName .TextInput{height:calc(1rem - 3px);width:200px;overflow:hidden;text-align:center;margin-left:8px;text-overflow:ellipsis}.ProjectName .TextInput--readonly{background:none;border:none;width:auto;max-width:200px;padding-left:2px}.ProjectName .TextInput--readonly:hover{background:none}",""]),t.default=a},7589:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .publish-library__fields{display:flex;flex-direction:column}.excalidraw .publish-library__fields label{padding:1em;display:flex;justify-content:space-between;align-items:center}.excalidraw .publish-library__fields label span{font-weight:500;font-size:1rem;color:#868e96}.excalidraw .publish-library__fields label input,.excalidraw .publish-library__fields label textarea{width:70%;padding:.6em;font-family:var(--ui-font)}.excalidraw .publish-library__fields label .required{color:#e03131;margin:.2rem}.excalidraw .publish-library__buttons{display:flex;padding:.2rem 0;justify-content:flex-end}.excalidraw .publish-library__buttons .ToolIcon__icon{min-width:2.5rem;width:auto;font-size:1rem}.excalidraw .publish-library__buttons .ToolIcon_type_button{margin-left:1rem;padding:0 .5rem}.excalidraw .publish-library__buttons--confirm.ToolIcon_type_button{background-color:#228be6}.excalidraw .publish-library__buttons--confirm.ToolIcon_type_button:hover{background-color:#1971c2}.excalidraw .publish-library__buttons--cancel.ToolIcon_type_button{background-color:#adb5bd}.excalidraw .publish-library__buttons--cancel.ToolIcon_type_button:hover{background-color:#868e96}.excalidraw .publish-library__buttons .ToolIcon__icon{color:#fff}.excalidraw .publish-library__buttons .ToolIcon__icon .Spinner{--spinner-color: #fff}.excalidraw .publish-library__buttons .ToolIcon__icon .Spinner svg{padding:.5rem}.excalidraw .publish-library .selected-library-items{display:flex;padding:0 .8rem;flex-wrap:wrap}.excalidraw .publish-library .selected-library-items .single-library-item-wrapper{width:9rem}.excalidraw .publish-library-note{padding:1em;font-style:italic;font-size:14px;display:block}",""]),t.default=a},8465:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .single-library-item{position:relative}.excalidraw .single-library-item__svg{width:7.5rem;height:7.5rem;border:1px solid var(--button-gray-2);margin:.3rem}.excalidraw .single-library-item__svg svg{width:100%;height:100%}.excalidraw .single-library-item .ToolIcon__icon{background-color:#fff;width:auto;height:auto;margin:0 .5rem}.excalidraw .single-library-item .ToolIcon,.excalidraw .single-library-item .ToolIcon_type_button:hover{background-color:#fff}.excalidraw .single-library-item .required,.excalidraw .single-library-item .error{color:#e03131;font-weight:bold;font-size:1rem;margin:.2rem}.excalidraw .single-library-item .error{font-weight:500;margin:0;padding:.3em 0}.excalidraw .single-library-item--remove{position:absolute;top:.2rem;right:1.3rem}.excalidraw .single-library-item--remove .ToolIcon__icon{margin:0}.excalidraw .single-library-item--remove .ToolIcon__icon{background-color:#fa5252}.excalidraw .single-library-item--remove .ToolIcon__icon:hover{background-color:#f03e3e}.excalidraw .single-library-item--remove .ToolIcon__icon:active{background-color:#e03131}.excalidraw .single-library-item--remove svg{color:#fff;padding:.26rem;border-radius:.3em;width:1rem;height:1rem}",""]),t.default=a},5892:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".excalidraw .Spinner{display:flex;align-items:center;justify-content:center;height:100%;margin-left:auto;margin-right:auto;--spinner-color: var(--icon-fill-color)}.excalidraw .Spinner svg{-webkit-animation:rotate 1.6s linear infinite;animation:rotate 1.6s linear infinite;-webkit-transform-origin:center center;transform-origin:center center}.excalidraw .Spinner circle{stroke:var(--spinner-color);-webkit-animation:dash 1.6s linear 0s infinite;animation:dash 1.6s linear 0s infinite;stroke-linecap:round}@-webkit-keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes dash{0%{stroke-dasharray:1,300;stroke-dashoffset:0}50%{stroke-dasharray:150,300;stroke-dashoffset:-200}100%{stroke-dasharray:1,300;stroke-dashoffset:-280}}@keyframes dash{0%{stroke-dasharray:1,300;stroke-dashoffset:0}50%{stroke-dasharray:150,300;stroke-dashoffset:-200}100%{stroke-dasharray:1,300;stroke-dashoffset:-280}}",""]),t.default=a},3874:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".excalidraw .Stack{--gap: 0;display:grid;gap:calc(var(--space-factor)*var(--gap))}.excalidraw .Stack_vertical{grid-template-columns:auto;grid-auto-flow:row;grid-auto-rows:-webkit-min-content;grid-auto-rows:min-content}.excalidraw .Stack_horizontal{grid-template-rows:auto;grid-auto-flow:column;grid-auto-columns:-webkit-min-content;grid-auto-columns:min-content}",""]),t.default=a},2681:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Stats{position:absolute;top:64px;right:12px;font-size:12px;z-index:10}.excalidraw .Stats h3{margin:0 24px 8px 0;white-space:nowrap}.excalidraw .Stats .close{float:right;height:16px;width:16px;cursor:pointer}.excalidraw .Stats .close svg{width:100%;height:100%}.excalidraw .Stats table{width:100%}.excalidraw .Stats table th{border-bottom:1px solid var(--input-border-color);padding:4px}.excalidraw .Stats table tr td:nth-child(2){min-width:24px;text-align:right}:root[dir=rtl] .excalidraw .Stats{left:12px;right:initial}:root[dir=rtl] .excalidraw .Stats h3{margin:0 0 8px 24px}:root[dir=rtl] .excalidraw .Stats .close{float:left}",""]),t.default=a},6759:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .TextInput{display:inline-block}",""]),t.default=a},9650:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .Toast{-webkit-animation:fade-in .5s;animation:fade-in .5s;background-color:var(--button-gray-1);border-radius:4px;bottom:10px;box-sizing:border-box;cursor:default;left:50%;margin-left:-150px;padding:4px 0;position:absolute;text-align:center;width:300px;z-index:999999}.excalidraw .Toast__message{color:var(--popup-text-color);white-space:pre-wrap}@-webkit-keyframes fade-in{from{opacity:0}to{opacity:1}}@keyframes fade-in{from{opacity:0}to{opacity:1}}",""]),t.default=a},2044:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw .ToolIcon{display:inline-flex;align-items:center;position:relative;cursor:pointer;-webkit-tap-highlight-color:transparent;-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{-webkit-margin-start:0;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:-8px;margin-left:0;border-radius:20px 0 0 20px;z-index:1;background-color:var(--button-gray-1)}.excalidraw .ToolIcon.ToolIcon_type_floating:hover{background-color:var(--button-gray-1)}.excalidraw .ToolIcon.ToolIcon_type_floating:active{background-color:var(--button-gray-2)}.excalidraw .ToolIcon.ToolIcon_type_floating .ToolIcon__icon{border-radius:inherit}.excalidraw .ToolIcon.ToolIcon_type_floating svg{position:static}.excalidraw .ToolIcon.ToolIcon__library{top:100px}.excalidraw .ToolIcon.ToolIcon__lock{-webkit-margin-end:0;margin-inline-end:0;top:60px}.excalidraw .ToolIcon.ToolIcon__penMode{-webkit-margin-end:0;margin-inline-end:0;top:140px}}:root[dir=ltr] .excalidraw .unlocked-icon{left:2px}:root[dir=rtl] .excalidraw .unlocked-icon{right:2px}",""]),t.default=a},9144:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());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,-webkit-transform .5s ease;transition:box-shadow .5s ease,transform .5s ease;transition:box-shadow .5s ease,transform .5s ease,-webkit-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{-webkit-margin-end:var(--space-factor);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{-webkit-margin-start:var(--space-factor);margin-inline-start:var(--space-factor)}.excalidraw .App-toolbar-container.zen-mode .ToolIcon_type_floating .ToolIcon__icon{box-shadow:none;-webkit-transform:scale(0.9);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}",""]),t.default=a},6626:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw-tooltip{position:absolute;z-index:1000;padding:8px;border-radius:6px;box-sizing:border-box;pointer-events:none;word-wrap:break-word;background:#000;line-height:1.5;text-align:center;font-size:13px;font-weight:500;color:#fff;display:none}.excalidraw-tooltip.excalidraw-tooltip--visible{display:block}.excalidraw-tooltip-wrapper{display:flex}.excalidraw-tooltip-icon{width:.9em;height:.9em;margin-left:5px;margin-top:1px;display:flex}.excalidraw--mobile.excalidraw-tooltip-icon{display:none}",""]),t.default=a},6359:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".excalidraw .UserList{pointer-events:none;padding:var(--space-factor) var(--space-factor) var(--space-factor) var(--space-factor);display:flex;flex-wrap:wrap;justify-content:flex-end}.excalidraw .UserList:empty{display:none}.excalidraw .UserList>*{pointer-events:all;margin:0 0 var(--space-factor) var(--space-factor)}.excalidraw .UserList_mobile{padding:0;justify-content:normal}.excalidraw .UserList_mobile>*{margin:0 var(--space-factor) var(--space-factor) 0}",""]),t.default=a},9915:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,".visually-hidden{position:absolute !important;height:1px;width:1px;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);white-space:nowrap;-webkit-user-select:none;user-select:none}.LoadingMessage{position:absolute;top:0;right:0;bottom:0;left:0;z-index:999;display:flex;align-items:center;justify-content:center;pointer-events:none}.LoadingMessage span{background-color:var(--button-gray-1);border-radius:5px;padding:.8em 1.2em;color:var(--popup-text-color);font-size:1.3em}",""]),t.default=a},9310:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i),l=n(1667),s=n.n(l),c=new URL(n(7984),n.b),u=new URL(n(1639),n.b),d=a()(o()),f=s()(c),p=s()(u);d.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}:export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw{--theme-filter: none;--button-destructive-bg-color: #ffe3e3;--button-destructive-color: #c92a2a;--button-gray-1: #e9ecef;--button-gray-2: #ced4da;--button-gray-3: #adb5bd;--button-special-active-bg-color: #ebfbee;--dialog-border-color: #868e96;--dropdown-icon: url("+f+");--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: #2c2c2c;--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{-webkit-filter:var(--theme-filter);filter:var(--theme-filter)}.excalidraw .FixedSideContainer{padding-top:var(--sat, 0);padding-right:var(--sar, 0);padding-bottom:var(--sab, 0);padding-left:var(--sal, 0)}.excalidraw .panelRow{display:flex;justify-content:space-between}.excalidraw .panelColumn{display:flex;flex-direction:column}.excalidraw .panelColumn h3,.excalidraw .panelColumn legend,.excalidraw .panelColumn .control-label{margin-top:.333rem;margin-bottom:.333rem;font-size:.75rem;color:var(--text-primary-color);font-weight:bold;display:block}.excalidraw .panelColumn .control-label input{display:block;width:100%}.excalidraw .panelColumn h3:first-child,.excalidraw .panelColumn legend:first-child,.excalidraw .panelColumn .control-label:first-child{margin-top:0}.excalidraw .panelColumn legend{padding:0}.excalidraw .panelColumn .iconSelectList{flex-wrap:wrap;position:relative}.excalidraw .panelColumn .buttonList{flex-wrap:wrap}.excalidraw .panelColumn .buttonList label{margin-right:.25rem;font-size:.75rem;display:inline-block}.excalidraw .panelColumn .buttonList input[type=radio],.excalidraw .panelColumn .buttonList input[type=button]{opacity:0;position:absolute;pointer-events:none}.excalidraw .panelColumn .buttonList .iconRow{margin-top:8px}.excalidraw .panelColumn .buttonList .ToolIcon{margin:0;-webkit-margin-end:8px;margin-inline-end:8px}.excalidraw .panelColumn .buttonList .ToolIcon:focus{outline:transparent;box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .panelColumn .buttonList .ToolIcon:hover{background-color:var(--button-gray-2)}.excalidraw .panelColumn .buttonList .ToolIcon:active{background-color:var(--button-gray-3)}.excalidraw .panelColumn .buttonList .ToolIcon:disabled{cursor:not-allowed}.excalidraw .panelColumn .buttonList .ToolIcon__icon{width:28px;height:28px}.excalidraw .panelColumn fieldset{margin:0;margin-top:.333rem;padding:0;border:none}.excalidraw .divider{width:1px;background-color:#e9ecef;margin:1px}.excalidraw .buttonList label:focus-within,.excalidraw input:focus-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:flex;flex-direction:column;align-items:center}.excalidraw .App-bottom-bar{position:absolute;top:0;bottom:0;left:0;right:0;--bar-padding: calc(4 * var(--space-factor));padding-top:max(var(--bar-padding), var(--sat,0));padding-right:var(--sar, 0);padding-bottom:var(--sab, 0);padding-left:var(--sal, 0);z-index:4;display:flex;align-items:flex-end;pointer-events:none}.excalidraw .App-bottom-bar>.Island{width:100%;max-width:100%;min-width:100%;box-sizing:border-box;max-height:100%;display:flex;flex-direction:column;pointer-events:initial}.excalidraw .App-bottom-bar>.Island .panelColumn{padding:8px 8px 0 8px}.excalidraw .App-toolbar{width:100%;box-sizing:border-box}.excalidraw .App-toolbar-content{display:flex;align-items:center;justify-content:space-between;padding:8px}.excalidraw .App-mobile-menu{width:100%;overflow-x:visible;overflow-y:auto;box-sizing:border-box;margin-bottom:var(--bar-padding)}.excalidraw .App-menu{display:grid;color:var(--icon-fill-color)}.excalidraw .App-menu_top{grid-template-columns: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;-webkit-padding-start:.5rem;padding-inline-start:.5rem;-webkit-padding-end:1.5rem;padding-inline-end:1.5rem;color:var(--icon-fill-color);background-color:var(--button-gray-1);border-radius:var(--space-factor);border:1px solid var(--button-gray-2);font-size:.8rem;outline:none;-webkit-appearance:none;appearance:none;background-image:var(--dropdown-icon);background-repeat:no-repeat;background-position:right .7rem top 50%,0 0;background-size:.65em auto,100%}:root[dir=rtl] .excalidraw .dropdown-select{background-position:left .7rem top 50%,0 0}.excalidraw .dropdown-select:focus{box-shadow:0 0 0 2px var(--focus-highlight-color)}.excalidraw .dropdown-select:hover{background-color:var(--button-gray-2)}.excalidraw .dropdown-select:active{background-color:var(--button-gray-2)}.excalidraw .zIndexButton{margin:0;-webkit-margin-end:8px;margin-inline-end:8px;padding:5px;display:inline-flex;align-items:center;justify-content:center}.excalidraw .zIndexButton svg{width:18px;height:18px}.excalidraw .scroll-back-to-content{color:var(--popup-text-color);position:absolute;left:50%;bottom:30px;-webkit-transform:translateX(-50%);transform:translateX(-50%);padding:10px 20px}.excalidraw .help-icon{display:flex;cursor:pointer;fill:#868e96;padding:0;margin:0;background:none;color:var(--icon-fill-color)}.excalidraw .help-icon svg{width:1.5rem;height:1.5rem}.excalidraw .help-icon:hover{background:none}.excalidraw .reset-zoom-button{padding:.2em;background:transparent;color:var(--text-primary-color);font-family:var(--ui-font)}.excalidraw .undo-redo-buttons{display:grid;grid-auto-flow:column;gap:.4em;margin-top:auto;margin-bottom:auto;-webkit-margin-start:.6em;margin-inline-start:.6em}.excalidraw--mobile.excalidraw aside{display:none}.excalidraw--mobile.excalidraw .scroll-back-to-content{bottom:calc(80px + var(--sab, 0));z-index:-1}:root[dir=rtl] .excalidraw .rtl-mirror{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.excalidraw .zen-mode-visibility{visibility:visible;opacity:1;height:auto;width:auto;transition:opacity .5s}.excalidraw .zen-mode-visibility.zen-mode-visibility--hidden{visibility:hidden;opacity:0;height:0;width:0;transition:opacity .5s}.excalidraw .disable-pointerEvents{pointer-events:none !important}.excalidraw.excalidraw--view-mode .App-menu{display:flex;justify-content:space-between}.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}}.ErrorSplash.excalidraw{min-height:100vh;padding:20px 0;overflow:auto;display:flex;align-items:center;justify-content:center;-webkit-user-select:text;user-select:text}.ErrorSplash.excalidraw .ErrorSplash-messageContainer{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px;background-color:#ffe3e3;border:3px solid #c92a2a}.ErrorSplash.excalidraw .ErrorSplash-paragraph{margin:15px 0;max-width:600px}.ErrorSplash.excalidraw .ErrorSplash-paragraph.align-center{text-align:center}.ErrorSplash.excalidraw .bigger,.ErrorSplash.excalidraw .bigger button{font-size:1.1em}.ErrorSplash.excalidraw .smaller,.ErrorSplash.excalidraw .smaller button{font-size:.9em}.ErrorSplash.excalidraw .ErrorSplash-details{display:flex;flex-direction:column;align-items:flex-start}.ErrorSplash.excalidraw .ErrorSplash-details textarea{width:100%;margin:10px 0;font-family:"Cascadia";font-size:.8em}',""]),t.default=d},6464:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,"",""]),a.locals={themeFilter:"invert(93%) hue-rotate(180deg)"},t.default=a},5260:function(e,t,n){n.r(t);var r=n(8081),o=n.n(r),i=n(3645),a=n.n(i)()(o());a.push([e.id,":export{themeFilter:invert(93%) hue-rotate(180deg)}.excalidraw-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}",""]),t.default=a},3645:function(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,o,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var l=0;l<this.length;l++){var s=this[l][0];null!=s&&(a[s]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);r&&a[u[0]]||(void 0!==i&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=i),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),t.push(u))}},t}},1667:function(e){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:function(e){e.exports=function(e){return e[1]}},8288:function(e,t,n){n.d(t,{iC:function(){return l},f:function(){return s},qx:function(){return c},Iw:function(){return u},$e:function(){return d},wZ:function(){return f},ay:function(){return p},oc:function(){return h},Oh:function(){return m},Ks:function(){return r},Vi:function(){return g},$C:function(){return v},ut:function(){return b},C6:function(){return y},_D:function(){return x},n5:function(){return w},rk:function(){return k},Hg:function(){return E},hs:function(){return _},k:function(){return S},LO:function(){return C},r8:function(){return j},pb:function(){return O},LL:function(){return I},Gj:function(){return M},nM:function(){return T},Lg:function(){return P},HM:function(){return A},V4:function(){return L},sA:function(){return D},EH:function(){return R},ZF:function(){return z},UO:function(){return N},ah:function(){return H},cW:function(){return B},kV:function(){return F},sS:function(){return U},Yx:function(){return K},zK:function(){return W},ZB:function(){return V},qy:function(){return G},h6:function(){return Z},jo:function(){return Y},$n:function(){return X},hR:function(){return q},Kr:function(){return $},gK:function(){return Q}});var r,o,i=n(8635),a=n.n(i),l="Excalidraw",s=10,c=8,u=5,d=1,f=30,p=Math.PI/12,h={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},m={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1};(o=r||(r={})).COPY="copy",o.PASTE="paste",o.CUT="cut",o.KEYDOWN="keydown",o.KEYUP="keyup",o.MOUSE_MOVE="mousemove",o.RESIZE="resize",o.UNLOAD="unload",o.FOCUS="focus",o.BLUR="blur",o.DRAG_OVER="dragover",o.DROP="drop",o.GESTURE_END="gestureend",o.BEFORE_UNLOAD="beforeunload",o.GESTURE_START="gesturestart",o.GESTURE_CHANGE="gesturechange",o.POINTER_MOVE="pointermove",o.POINTER_UP="pointerup",o.STATE_CHANGE="statechange",o.WHEEL="wheel",o.TOUCH_START="touchstart",o.TOUCH_END="touchend",o.HASHCHANGE="hashchange",o.VISIBILITY_CHANGE="visibilitychange",o.SCROLL="scroll",o.EXCALIDRAW_LINK="excalidraw-link";var g={TEST:"test",DEVELOPMENT:"development"},v={SHAPE_ACTIONS_MENU:"App-menu__left"},b={Virgil:1,Helvetica:2,Cascadia:3},y={LIGHT:"light",DARK:"dark"},x="Segoe UI Emoji",w=20,k=b.Virgil,E="left",_="top",S=20,C={excalidraw:"application/vnd.excalidraw+json",excalidrawlib:"application/vnd.excalidrawlib+json",json:"application/json",svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",gif:"image/gif",binary:"application/octet-stream"},j={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawLibrary:"excalidrawlib"},O=window.location.origin,I=500,M=300,T=500,P=5e3,A=100,L=.1,D=300,R={VIEW:"viewMode",ZEN:"zenMode",GRID:"gridMode"},z=a().themeFilter,N={addLibrary:"addLibrary"},H={addLibrary:"addLibrary"},B={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,theme:!0,saveAsImage:!0}},F=730,U=1e3,K=500,W=2,V=[1,2,3],G=10,Z=1440,Y=[C.png,C.jpg,C.svg,C.gif],X=2097152,q="http://www.w3.org/2000/svg",$={excalidraw:2,excalidrawLibrary:2},Q=5},7314:function(e,t,n){n.r(t),n.d(t,{FONT_FAMILY:function(){return c.ut},THEME:function(){return c.C6},bumpVersion:function(){return so},default:function(){return Cg},defaultLang:function(){return y},exportToBlob:function(){return bm},exportToCanvas:function(){return vm},exportToSvg:function(){return ym},getFreeDrawSvgPath:function(){return $r},getNonDeletedElements:function(){return jc},getSceneVersion:function(){return Sc},isInvisiblySmallElement:function(){return co},isLinearElement:function(){return Xe},languages:function(){return x},loadFromBlob:function(){return Nd},loadLibraryFromBlob:function(){return Hd},mutateElement:function(){return ao},newElementWith:function(){return lo},restore:function(){return Md},restoreAppState:function(){return Id},restoreElements:function(){return Od},serializeAsJSON:function(){return Xd}});var r=n(6479),o=n.n(r),i=n(9713),a=n.n(i),l=n(9787),s=n.n(l),c=n(8288),u=JSON.parse('{"u2":"@excalidraw/excalidraw","i8":"0.11.0"}');"production"!==c.Vi.TEST&&(n.p=window.EXCALIDRAW_ASSET_PATH||"https://unpkg.com/".concat(u.u2,"@").concat(u.i8,"/dist/"));var d=n(8950);function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function p(e,t){if(e){if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,l=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(s){l=!0,o=s}finally{try{a||null==n.return||n.return()}finally{if(l)throw o}}return i}}(e,t)||p(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var m=n(7945),g=n.n(m),v=n(1463),b=n(4451),y={code:"en",label:"English"},x=[{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([y]).sort((function(e,t){return e.label>t.label?1:-1})).filter((function(e){return b[e.code]>=85})),w="__test__";"production"===c.Vi.DEVELOPMENT&&x.unshift({code:w,label:"test language"},{code:"".concat(w,".rtl"),label:"‪test language (rtl)‬",rtl:!0});var k,E=y,_={},S=(k=(0,d.Z)(g().mark((function e(t){return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(E=t,document.documentElement.dir=E.rtl?"rtl":"ltr",document.documentElement.lang=E.code,!t.code.startsWith(w)){e.next=7;break}_={},e.next=10;break;case 7:return e.next=9,n(788)("./".concat(E.code,".json"));case 9:_=e.sent;case 10:case"end":return e.stop()}}),e)}))),function(e){return k.apply(this,arguments)}),C=function(){return E},j=function(e,t){for(var n=0;n<t.length;++n){var r=t[n];if(void 0===e[r])return;e=e[r]}if("string"==typeof e)return e},O=function(e,t){if(E.code.startsWith(w)){var n=t?"".concat(e,"(").concat(JSON.stringify(t).slice(1,-1),")"):e;return"‪[[".concat(n,"]]‬")}var r=e.split("."),o=j(_,r)||j(v,r);if(void 0===o)throw new Error("Can't find translation for ".concat(e));if(t)for(var i in t)o=o.replace("{{".concat(i,"}}"),String(t[i]));return o},I=n(4512),M=function(){return(0,I.jsx)("div",{className:"LoadingMessage",children:(0,I.jsx)("span",{children:O("labels.loadingScene")})})},T=function(e){var t=h((0,l.useState)(!0),2),n=t[0],r=t[1];return(0,l.useEffect)((function(){var t,n=(t=(0,d.Z)(g().mark((function e(){return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,S(o);case 2:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)}),o=x.find((function(t){return t.code===e.langCode}))||y;n(),r(!1)}),[e.langCode]),n?(0,I.jsx)(M,{}):e.children};function P(e){return(P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function A(e){return function(e){if(Array.isArray(e))return f(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||p(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function L(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function D(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function R(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function z(e,t,n){return t&&R(e.prototype,t),n&&R(e,n),e}function N(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function H(e,t){return(H=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function B(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&H(e,t)}function F(e,t){if(t&&("object"===P(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return N(e)}function U(e){return(U=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function K(e,t,n){if(e&&e.length){const[r,o]=t,i=Math.PI/180*n,a=Math.cos(i),l=Math.sin(i);e.forEach((e=>{const[t,n]=e;e[0]=(t-r)*a-(n-o)*l+r,e[1]=(t-r)*l+(n-o)*a+o}))}}function W(e){const t=e[0],n=e[1];return Math.sqrt(Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2))}function V(e,t){const n=t.hachureAngle+90;let r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);const o=[0,0];if(n)for(const a of e)K(a,o,n);const i=function(e,t){const n=[];for(const l of e){const e=[...l];e[0].join(",")!==e[e.length-1].join(",")&&e.push([e[0][0],e[0][1]]),e.length>2&&n.push(e)}const r=[];t=Math.max(t,.1);const o=[];for(const l of n)for(let e=0;e<l.length-1;e++){const t=l[e],n=l[e+1];if(t[1]!==n[1]){const e=Math.min(t[1],n[1]);o.push({ymin:e,ymax:Math.max(t[1],n[1]),x:e===t[1]?t[0]:n[0],islope:(n[0]-t[0])/(n[1]-t[1])})}}if(o.sort(((e,t)=>e.ymin<t.ymin?-1:e.ymin>t.ymin?1:e.x<t.x?-1:e.x>t.x?1:e.ymax===t.ymax?0:(e.ymax-t.ymax)/Math.abs(e.ymax-t.ymax))),!o.length)return r;let i=[],a=o[0].ymin;for(;i.length||o.length;){if(o.length){let e=-1;for(let t=0;t<o.length&&!(o[t].ymin>a);t++)e=t;o.splice(0,e+1).forEach((e=>{i.push({s:a,edge:e})}))}if(i=i.filter((e=>!(e.edge.ymax<=a))),i.sort(((e,t)=>e.edge.x===t.edge.x?0:(e.edge.x-t.edge.x)/Math.abs(e.edge.x-t.edge.x))),i.length>1)for(let e=0;e<i.length;e+=2){const t=e+1;if(t>=i.length)break;const n=i[e].edge,o=i[t].edge;r.push([[Math.round(n.x),a],[Math.round(o.x),a]])}a+=t,i.forEach((e=>{e.edge.x=e.edge.x+t*e.edge.islope}))}return r}(e,r);if(n){for(const t of e)K(t,o,-n);!function(e,t,n){const r=[];e.forEach((e=>r.push(...e))),K(r,t,n)}(i,o,-n)}return i}class G{constructor(e){this.helper=e}fillPolygons(e,t){return this._fillPolygons(e,t)}_fillPolygons(e,t){const n=V(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 Z extends G{fillPolygons(e,t){let n=t.hachureGap;n<0&&(n=4*t.strokeWidth),n=Math.max(n,.1);const r=V(e,Object.assign({},t,{hachureGap:n})),o=Math.PI/180*t.hachureAngle,i=[],a=.5*n*Math.cos(o),l=.5*n*Math.sin(o);for(const[s,c]of r)W([s,c])&&i.push([[s[0]-a,s[1]+l],[...c]],[[s[0]+a,s[1]-l],[...c]]);return{type:"fillSketch",ops:this.renderLines(i,t)}}}class Y extends G{fillPolygons(e,t){const n=this._fillPolygons(e,t),r=Object.assign({},t,{hachureAngle:t.hachureAngle+90}),o=this._fillPolygons(e,r);return n.ops=n.ops.concat(o.ops),n}}class X{constructor(e){this.helper=e}fillPolygons(e,t){const n=V(e,t=Object.assign({},t,{hachureAngle:0}));return this.dotsOnLines(n,t)}dotsOnLines(e,t){const n=[];let r=t.hachureGap;r<0&&(r=4*t.strokeWidth),r=Math.max(r,.1);let o=t.fillWeight;o<0&&(o=t.strokeWidth/2);const i=r/4;for(const a of e){const e=W(a),l=e/r,s=Math.ceil(l)-1,c=e-s*r,u=(a[0][0]+a[1][0])/2-r/4,d=Math.min(a[0][1],a[1][1]);for(let a=0;a<s;a++){const e=d+c+a*r,l=u-i+2*Math.random()*i,s=e-i+2*Math.random()*i,f=this.helper.ellipse(l,s,o,o,t);n.push(...f.ops)}}return{type:"fillSketch",ops:n}}}class q{constructor(e){this.helper=e}fillPolygons(e,t){const n=V(e,t);return{type:"fillSketch",ops:this.dashedLine(n,t)}}dashedLine(e,t){const n=t.dashOffset<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashOffset,r=t.dashGap<0?t.hachureGap<0?4*t.strokeWidth:t.hachureGap:t.dashGap,o=[];return e.forEach((e=>{const i=W(e),a=Math.floor(i/(n+r)),l=(i+r-a*(n+r))/2;let s=e[0],c=e[1];s[0]>c[0]&&(s=e[1],c=e[0]);const u=Math.atan((c[1]-s[1])/(c[0]-s[0]));for(let d=0;d<a;d++){const e=d*(n+r),i=e+n,a=[s[0]+e*Math.cos(u)+l*Math.cos(u),s[1]+e*Math.sin(u)+l*Math.sin(u)],c=[s[0]+i*Math.cos(u)+l*Math.cos(u),s[1]+i*Math.sin(u)+l*Math.sin(u)];o.push(...this.helper.doubleLineOps(a[0],a[1],c[0],c[1],t))}})),o}}class ${constructor(e){this.helper=e}fillPolygons(e,t){const n=t.hachureGap<0?4*t.strokeWidth:t.hachureGap,r=t.zigzagOffset<0?n:t.zigzagOffset,o=V(e,t=Object.assign({},t,{hachureGap:n+r}));return{type:"fillSketch",ops:this.zigzagLines(o,r,t)}}zigzagLines(e,t,n){const r=[];return e.forEach((e=>{const o=W(e),i=Math.round(o/(2*t));let a=e[0],l=e[1];a[0]>l[0]&&(a=e[1],l=e[0]);const s=Math.atan((l[1]-a[1])/(l[0]-a[0]));for(let c=0;c<i;c++){const e=2*c*t,o=2*(c+1)*t,i=Math.sqrt(2*Math.pow(t,2)),l=[a[0]+e*Math.cos(s),a[1]+e*Math.sin(s)],u=[a[0]+o*Math.cos(s),a[1]+o*Math.sin(s)],d=[l[0]+i*Math.cos(s+Math.PI/4),l[1]+i*Math.sin(s+Math.PI/4)];r.push(...this.helper.doubleLineOps(l[0],l[1],d[0],d[1],n),...this.helper.doubleLineOps(d[0],d[1],u[0],u[1],n))}})),r}}const Q={};class J{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const ee={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 te(e,t){return e.type===t}function ne(e){const t=[],n=function(e){const t=new Array;for(;""!==e;)if(e.match(/^([ \t\r\n,]+)/))e=e.substr(RegExp.$1.length);else if(e.match(/^([aAcChHlLmMqQsStTvVzZ])/))t[t.length]={type:0,text:RegExp.$1},e=e.substr(RegExp.$1.length);else{if(!e.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];t[t.length]={type:1,text:`${parseFloat(RegExp.$1)}`},e=e.substr(RegExp.$1.length)}return t[t.length]={type:2,text:""},t}(e);let r="BOD",o=0,i=n[o];for(;!te(i,2);){let a=0;const l=[];if("BOD"===r){if("M"!==i.text&&"m"!==i.text)return ne("M0,0"+e);o++,a=ee[i.text],r=i.text}else te(i,1)?a=ee[r]:(o++,a=ee[i.text],r=i.text);if(!(o+a<n.length))throw new Error("Path data ended short");for(let e=o;e<o+a;e++){const t=n[e];if(!te(t,1))throw new Error("Param not a number: "+r+","+t.text);l[l.length]=+t.text}if("number"!=typeof ee[r])throw new Error("Bad segment: "+r);{const e={key:r,data:l};t.push(e),o+=a,i=n[o],"M"===r&&(r="L"),"m"===r&&(r="l")}}return t}function re(e){let t=0,n=0,r=0,o=0;const i=[];for(const{key:a,data:l}of e)switch(a){case"M":i.push({key:"M",data:[...l]}),[t,n]=l,[r,o]=l;break;case"m":t+=l[0],n+=l[1],i.push({key:"M",data:[t,n]}),r=t,o=n;break;case"L":i.push({key:"L",data:[...l]}),[t,n]=l;break;case"l":t+=l[0],n+=l[1],i.push({key:"L",data:[t,n]});break;case"C":i.push({key:"C",data:[...l]}),t=l[4],n=l[5];break;case"c":{const e=l.map(((e,r)=>r%2?e+n:e+t));i.push({key:"C",data:e}),t=e[4],n=e[5];break}case"Q":i.push({key:"Q",data:[...l]}),t=l[2],n=l[3];break;case"q":{const e=l.map(((e,r)=>r%2?e+n:e+t));i.push({key:"Q",data:e}),t=e[2],n=e[3];break}case"A":i.push({key:"A",data:[...l]}),t=l[5],n=l[6];break;case"a":t+=l[5],n+=l[6],i.push({key:"A",data:[l[0],l[1],l[2],l[3],l[4],t,n]});break;case"H":i.push({key:"H",data:[...l]}),t=l[0];break;case"h":t+=l[0],i.push({key:"H",data:[t]});break;case"V":i.push({key:"V",data:[...l]}),n=l[0];break;case"v":n+=l[0],i.push({key:"V",data:[n]});break;case"S":i.push({key:"S",data:[...l]}),t=l[2],n=l[3];break;case"s":{const e=l.map(((e,r)=>r%2?e+n:e+t));i.push({key:"S",data:e}),t=e[2],n=e[3];break}case"T":i.push({key:"T",data:[...l]}),t=l[0],n=l[1];break;case"t":t+=l[0],n+=l[1],i.push({key:"T",data:[t,n]});break;case"Z":case"z":i.push({key:"Z",data:[]}),t=r,n=o}return i}function oe(e){const t=[];let n="",r=0,o=0,i=0,a=0,l=0,s=0;for(const{key:c,data:u}of e){switch(c){case"M":t.push({key:"M",data:[...u]}),[r,o]=u,[i,a]=u;break;case"C":t.push({key:"C",data:[...u]}),r=u[4],o=u[5],l=u[2],s=u[3];break;case"L":t.push({key:"L",data:[...u]}),[r,o]=u;break;case"H":r=u[0],t.push({key:"L",data:[r,o]});break;case"V":o=u[0],t.push({key:"L",data:[r,o]});break;case"S":{let e=0,i=0;"C"===n||"S"===n?(e=r+(r-l),i=o+(o-s)):(e=r,i=o),t.push({key:"C",data:[e,i,...u]}),l=u[0],s=u[1],r=u[2],o=u[3];break}case"T":{const[e,i]=u;let a=0,c=0;"Q"===n||"T"===n?(a=r+(r-l),c=o+(o-s)):(a=r,c=o);const d=r+2*(a-r)/3,f=o+2*(c-o)/3,p=e+2*(a-e)/3,h=i+2*(c-i)/3;t.push({key:"C",data:[d,f,p,h,e,i]}),l=a,s=c,r=e,o=i;break}case"Q":{const[e,n,i,a]=u,c=r+2*(e-r)/3,d=o+2*(n-o)/3,f=i+2*(e-i)/3,p=a+2*(n-a)/3;t.push({key:"C",data:[c,d,f,p,i,a]}),l=e,s=n,r=i,o=a;break}case"A":{const e=Math.abs(u[0]),n=Math.abs(u[1]),i=u[2],a=u[3],l=u[4],s=u[5],c=u[6];0===e||0===n?(t.push({key:"C",data:[r,o,s,c,s,c]}),r=s,o=c):r===s&&o===c||(ae(r,o,s,c,e,n,i,a,l).forEach((function(e){t.push({key:"C",data:e})})),r=s,o=c);break}case"Z":t.push({key:"Z",data:[]}),r=i,o=a}n=c}return t}function ie(e,t,n){return[e*Math.cos(n)-t*Math.sin(n),e*Math.sin(n)+t*Math.cos(n)]}function ae(e,t,n,r,o,i,a,l,s,c){const u=(d=a,Math.PI*d/180);var d;let f=[],p=0,h=0,m=0,g=0;if(c)[p,h,m,g]=c;else{[e,t]=ie(e,t,-u),[n,r]=ie(n,r,-u);const a=(e-n)/2,c=(t-r)/2;let d=a*a/(o*o)+c*c/(i*i);d>1&&(d=Math.sqrt(d),o*=d,i*=d);const f=o*o,v=i*i,b=f*v-f*c*c-v*a*a,y=f*c*c+v*a*a,x=(l===s?-1:1)*Math.sqrt(Math.abs(b/y));m=x*o*c/i+(e+n)/2,g=x*-i*a/o+(t+r)/2,p=Math.asin(parseFloat(((t-g)/i).toFixed(9))),h=Math.asin(parseFloat(((r-g)/i).toFixed(9))),e<m&&(p=Math.PI-p),n<m&&(h=Math.PI-h),p<0&&(p=2*Math.PI+p),h<0&&(h=2*Math.PI+h),s&&p>h&&(p-=2*Math.PI),!s&&h>p&&(h-=2*Math.PI)}let v=h-p;if(Math.abs(v)>120*Math.PI/180){const e=h,t=n,l=r;h=s&&h>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,f=ae(n=m+o*Math.cos(h),r=g+i*Math.sin(h),t,l,o,i,a,0,s,[h,e,m,g])}v=h-p;const b=Math.cos(p),y=Math.sin(p),x=Math.cos(h),w=Math.sin(h),k=Math.tan(v/4),E=4/3*o*k,_=4/3*i*k,S=[e,t],C=[e+E*y,t-_*b],j=[n+E*w,r-_*x],O=[n,r];if(C[0]=2*S[0]-C[0],C[1]=2*S[1]-C[1],c)return[C,j,O].concat(f);{f=[C,j,O].concat(f);const e=[];for(let t=0;t<f.length;t+=3){const n=ie(f[t][0],f[t][1],u),r=ie(f[t+1][0],f[t+1][1],u),o=ie(f[t+2][0],f[t+2][1],u);e.push([n[0],n[1],r[0],r[1],o[0],o[1]])}return e}}const le={randOffset:function(e,t){return ye(e,t)},randOffsetWithRange:function(e,t,n){return be(e,t,n)},ellipse:function(e,t,n,r,o){return pe(e,t,o,fe(n,r,o)).opset},doubleLineOps:function(e,t,n,r,o){return xe(e,t,n,r,o,!0)}};function se(e,t,n,r,o){return{type:"path",ops:xe(e,t,n,r,o)}}function ce(e,t,n){const r=(e||[]).length;if(r>2){const o=[];for(let t=0;t<r-1;t++)o.push(...xe(e[t][0],e[t][1],e[t+1][0],e[t+1][1],n));return t&&o.push(...xe(e[r-1][0],e[r-1][1],e[0][0],e[0][1],n)),{type:"path",ops:o}}return 2===r?se(e[0][0],e[0][1],e[1][0],e[1][1],n):{type:"path",ops:[]}}function ue(e,t,n,r,o){return ce([[e,t],[e+n,t],[e+n,t+r],[e,t+r]],!0,o)}function de(e,t){let n=ke(e,1*(1+.2*t.roughness),t);if(!t.disableMultiStroke){const r=ke(e,1.5*(1+.22*t.roughness),function(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}(t));n=n.concat(r)}return{type:"path",ops:n}}function fe(e,t,n){const r=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),o=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r)),i=2*Math.PI/o;let a=Math.abs(e/2),l=Math.abs(t/2);const s=1-n.curveFitting;return a+=ye(a*s,n),l+=ye(l*s,n),{increment:i,rx:a,ry:l}}function pe(e,t,n,r){const[o,i]=_e(r.increment,e,t,r.rx,r.ry,1,r.increment*be(.1,be(.4,1,n),n),n);let a=Ee(o,null,n);if(!n.disableMultiStroke&&0!==n.roughness){const[o]=_e(r.increment,e,t,r.rx,r.ry,1.5,0,n),i=Ee(o,null,n);a=a.concat(i)}return{estimatedPoints:i,opset:{type:"path",ops:a}}}function he(e,t,n,r,o,i,a,l,s){const c=e,u=t;let d=Math.abs(n/2),f=Math.abs(r/2);d+=ye(.01*d,s),f+=ye(.01*f,s);let p=o,h=i;for(;p<0;)p+=2*Math.PI,h+=2*Math.PI;h-p>2*Math.PI&&(p=0,h=2*Math.PI);const m=2*Math.PI/s.curveStepCount,g=Math.min(m/2,(h-p)/2),v=Se(g,c,u,d,f,p,h,1,s);if(!s.disableMultiStroke){const e=Se(g,c,u,d,f,p,h,1.5,s);v.push(...e)}return a&&(l?v.push(...xe(c,u,c+d*Math.cos(p),u+f*Math.sin(p),s),...xe(c,u,c+d*Math.cos(h),u+f*Math.sin(h),s)):v.push({op:"lineTo",data:[c,u]},{op:"lineTo",data:[c+d*Math.cos(p),u+f*Math.sin(p)]})),{type:"path",ops:v}}function me(e,t){const n=[];for(const r of e)if(r.length){const e=t.maxRandomnessOffset||0,o=r.length;if(o>2){n.push({op:"move",data:[r[0][0]+ye(e,t),r[0][1]+ye(e,t)]});for(let i=1;i<o;i++)n.push({op:"lineTo",data:[r[i][0]+ye(e,t),r[i][1]+ye(e,t)]})}}return{type:"fillPath",ops:n}}function ge(e,t){return function(e,t){let n=e.fillStyle||"hachure";if(!Q[n])switch(n){case"zigzag":Q[n]||(Q[n]=new Z(t));break;case"cross-hatch":Q[n]||(Q[n]=new Y(t));break;case"dots":Q[n]||(Q[n]=new X(t));break;case"dashed":Q[n]||(Q[n]=new q(t));break;case"zigzag-line":Q[n]||(Q[n]=new $(t));break;default:n="hachure",Q[n]||(Q[n]=new G(t))}return Q[n]}(t,le).fillPolygons(e,t)}function ve(e){return e.randomizer||(e.randomizer=new J(e.seed||0)),e.randomizer.next()}function be(e,t,n,r=1){return n.roughness*r*(ve(n)*(t-e)+e)}function ye(e,t,n=1){return be(-e,e,t,n)}function xe(e,t,n,r,o,i=!1){const a=i?o.disableMultiStrokeFill:o.disableMultiStroke,l=we(e,t,n,r,o,!0,!1);if(a)return l;const s=we(e,t,n,r,o,!0,!0);return l.concat(s)}function we(e,t,n,r,o,i,a){const l=Math.pow(e-n,2)+Math.pow(t-r,2),s=Math.sqrt(l);let c=1;c=s<200?1:s>500?.4:-.0016668*s+1.233334;let u=o.maxRandomnessOffset||0;u*u*100>l&&(u=s/10);const d=u/2,f=.2+.2*ve(o);let p=o.bowing*o.maxRandomnessOffset*(r-t)/200,h=o.bowing*o.maxRandomnessOffset*(e-n)/200;p=ye(p,o,c),h=ye(h,o,c);const m=[],g=()=>ye(d,o,c),v=()=>ye(u,o,c),b=o.preserveVertices;return i&&(a?m.push({op:"move",data:[e+(b?0:g()),t+(b?0:g())]}):m.push({op:"move",data:[e+(b?0:ye(u,o,c)),t+(b?0:ye(u,o,c))]})),a?m.push({op:"bcurveTo",data:[p+e+(n-e)*f+g(),h+t+(r-t)*f+g(),p+e+2*(n-e)*f+g(),h+t+2*(r-t)*f+g(),n+(b?0:g()),r+(b?0:g())]}):m.push({op:"bcurveTo",data:[p+e+(n-e)*f+v(),h+t+(r-t)*f+v(),p+e+2*(n-e)*f+v(),h+t+2*(r-t)*f+v(),n+(b?0:v()),r+(b?0:v())]}),m}function ke(e,t,n){const r=[];r.push([e[0][0]+ye(t,n),e[0][1]+ye(t,n)]),r.push([e[0][0]+ye(t,n),e[0][1]+ye(t,n)]);for(let o=1;o<e.length;o++)r.push([e[o][0]+ye(t,n),e[o][1]+ye(t,n)]),o===e.length-1&&r.push([e[o][0]+ye(t,n),e[o][1]+ye(t,n)]);return Ee(r,null,n)}function Ee(e,t,n){const r=e.length,o=[];if(r>3){const i=[],a=1-n.curveTightness;o.push({op:"move",data:[e[1][0],e[1][1]]});for(let t=1;t+2<r;t++){const n=e[t];i[0]=[n[0],n[1]],i[1]=[n[0]+(a*e[t+1][0]-a*e[t-1][0])/6,n[1]+(a*e[t+1][1]-a*e[t-1][1])/6],i[2]=[e[t+1][0]+(a*e[t][0]-a*e[t+2][0])/6,e[t+1][1]+(a*e[t][1]-a*e[t+2][1])/6],i[3]=[e[t+1][0],e[t+1][1]],o.push({op:"bcurveTo",data:[i[1][0],i[1][1],i[2][0],i[2][1],i[3][0],i[3][1]]})}if(t&&2===t.length){const e=n.maxRandomnessOffset;o.push({op:"lineTo",data:[t[0]+ye(e,n),t[1]+ye(e,n)]})}}else 3===r?(o.push({op:"move",data:[e[1][0],e[1][1]]}),o.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):2===r&&o.push(...xe(e[0][0],e[0][1],e[1][0],e[1][1],n));return o}function _e(e,t,n,r,o,i,a,l){const s=[],c=[];if(0===l.roughness){e/=4,c.push([t+r*Math.cos(-e),n+o*Math.sin(-e)]);for(let i=0;i<=2*Math.PI;i+=e){const e=[t+r*Math.cos(i),n+o*Math.sin(i)];s.push(e),c.push(e)}c.push([t+r*Math.cos(0),n+o*Math.sin(0)]),c.push([t+r*Math.cos(e),n+o*Math.sin(e)])}else{const u=ye(.5,l)-Math.PI/2;c.push([ye(i,l)+t+.9*r*Math.cos(u-e),ye(i,l)+n+.9*o*Math.sin(u-e)]);const d=2*Math.PI+u-.01;for(let a=u;a<d;a+=e){const e=[ye(i,l)+t+r*Math.cos(a),ye(i,l)+n+o*Math.sin(a)];s.push(e),c.push(e)}c.push([ye(i,l)+t+r*Math.cos(u+2*Math.PI+.5*a),ye(i,l)+n+o*Math.sin(u+2*Math.PI+.5*a)]),c.push([ye(i,l)+t+.98*r*Math.cos(u+a),ye(i,l)+n+.98*o*Math.sin(u+a)]),c.push([ye(i,l)+t+.9*r*Math.cos(u+.5*a),ye(i,l)+n+.9*o*Math.sin(u+.5*a)])}return[c,s]}function Se(e,t,n,r,o,i,a,l,s){const c=i+ye(.1,s),u=[];u.push([ye(l,s)+t+.9*r*Math.cos(c-e),ye(l,s)+n+.9*o*Math.sin(c-e)]);for(let d=c;d<=a;d+=e)u.push([ye(l,s)+t+r*Math.cos(d),ye(l,s)+n+o*Math.sin(d)]);return u.push([t+r*Math.cos(a),n+o*Math.sin(a)]),u.push([t+r*Math.cos(a),n+o*Math.sin(a)]),Ee(u,null,s)}function Ce(e,t,n,r,o,i,a,l){const s=[],c=[l.maxRandomnessOffset||1,(l.maxRandomnessOffset||1)+.3];let u=[0,0];const d=l.disableMultiStroke?1:2,f=l.preserveVertices;for(let p=0;p<d;p++)0===p?s.push({op:"move",data:[a[0],a[1]]}):s.push({op:"move",data:[a[0]+(f?0:ye(c[0],l)),a[1]+(f?0:ye(c[0],l))]}),u=f?[o,i]:[o+ye(c[p],l),i+ye(c[p],l)],s.push({op:"bcurveTo",data:[e+ye(c[p],l),t+ye(c[p],l),n+ye(c[p],l),r+ye(c[p],l),u[0],u[1]]});return s}function je(e){return[...e]}function Oe(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function Ie(e,t,n){const r=Oe(t,n);if(0===r)return Oe(e,t);let o=((e[0]-t[0])*(n[0]-t[0])+(e[1]-t[1])*(n[1]-t[1]))/r;return o=Math.max(0,Math.min(1,o)),Oe(e,Me(t,n,o))}function Me(e,t,n){return[e[0]+(t[0]-e[0])*n,e[1]+(t[1]-e[1])*n]}function Te(e,t,n,r){const o=r||[];if(function(e,t){const n=e[t+0],r=e[t+1],o=e[t+2],i=e[t+3];let a=3*r[0]-2*n[0]-i[0];a*=a;let l=3*r[1]-2*n[1]-i[1];l*=l;let s=3*o[0]-2*i[0]-n[0];s*=s;let c=3*o[1]-2*i[1]-n[1];return c*=c,a<s&&(a=s),l<c&&(l=c),a+l}(e,t)<n){const n=e[t+0];o.length?(i=o[o.length-1],a=n,Math.sqrt(Oe(i,a))>1&&o.push(n)):o.push(n),o.push(e[t+3])}else{const r=.5,i=e[t+0],a=e[t+1],l=e[t+2],s=e[t+3],c=Me(i,a,r),u=Me(a,l,r),d=Me(l,s,r),f=Me(c,u,r),p=Me(u,d,r),h=Me(f,p,r);Te([i,c,f,h],0,n,o),Te([h,p,d,s],0,n,o)}var i,a;return o}function Pe(e,t){return Ae(e,0,e.length,t)}function Ae(e,t,n,r,o){const i=o||[],a=e[t],l=e[n-1];let s=0,c=1;for(let u=t+1;u<n-1;++u){const t=Ie(e[u],a,l);t>s&&(s=t,c=u)}return Math.sqrt(s)>r?(Ae(e,t,c+1,r,i),Ae(e,c,n,r,i)):(i.length||i.push(a),i.push(l)),i}function Le(e,t=.15,n){const r=[],o=(e.length-1)/3;for(let i=0;i<o;i++)Te(e,3*i,t,r);return n&&n>0?Ae(r,0,r.length,n):r}const De="none";class Re{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,t,n){return{shape:e,sets:t||[],options:n||this.defaultOptions}}line(e,t,n,r,o){const i=this._o(o);return this._d("line",[se(e,t,n,r,i)],i)}rectangle(e,t,n,r,o){const i=this._o(o),a=[],l=ue(e,t,n,r,i);if(i.fill){const o=[[e,t],[e+n,t],[e+n,t+r],[e,t+r]];"solid"===i.fillStyle?a.push(me([o],i)):a.push(ge([o],i))}return i.stroke!==De&&a.push(l),this._d("rectangle",a,i)}ellipse(e,t,n,r,o){const i=this._o(o),a=[],l=fe(n,r,i),s=pe(e,t,i,l);if(i.fill)if("solid"===i.fillStyle){const n=pe(e,t,i,l).opset;n.type="fillPath",a.push(n)}else a.push(ge([s.estimatedPoints],i));return i.stroke!==De&&a.push(s.opset),this._d("ellipse",a,i)}circle(e,t,n,r){const o=this.ellipse(e,t,n,n,r);return o.shape="circle",o}linearPath(e,t){const n=this._o(t);return this._d("linearPath",[ce(e,!1,n)],n)}arc(e,t,n,r,o,i,a=!1,l){const s=this._o(l),c=[],u=he(e,t,n,r,o,i,a,!0,s);if(a&&s.fill)if("solid"===s.fillStyle){const a=Object.assign({},s);a.disableMultiStroke=!0;const l=he(e,t,n,r,o,i,!0,!1,a);l.type="fillPath",c.push(l)}else c.push(function(e,t,n,r,o,i,a){const l=e,s=t;let c=Math.abs(n/2),u=Math.abs(r/2);c+=ye(.01*c,a),u+=ye(.01*u,a);let d=o,f=i;for(;d<0;)d+=2*Math.PI,f+=2*Math.PI;f-d>2*Math.PI&&(d=0,f=2*Math.PI);const p=(f-d)/a.curveStepCount,h=[];for(let m=d;m<=f;m+=p)h.push([l+c*Math.cos(m),s+u*Math.sin(m)]);return h.push([l+c*Math.cos(f),s+u*Math.sin(f)]),h.push([l,s]),ge([h],a)}(e,t,n,r,o,i,s));return s.stroke!==De&&c.push(u),this._d("arc",c,s)}curve(e,t){const n=this._o(t),r=[],o=de(e,n);if(n.fill&&n.fill!==De&&e.length>=3){const t=Le(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(je(e[0]),je(e[1]),je(e[2]),je(e[2]));else{const n=[];n.push(e[0],e[0]);for(let t=1;t<e.length;t++)n.push(e[t]),t===e.length-1&&n.push(e[t]);const o=[],i=1-t;r.push(je(n[0]));for(let e=1;e+2<n.length;e++){const t=n[e];o[0]=[t[0],t[1]],o[1]=[t[0]+(i*n[e+1][0]-i*n[e-1][0])/6,t[1]+(i*n[e+1][1]-i*n[e-1][1])/6],o[2]=[n[e+1][0]+(i*n[e][0]-i*n[e+2][0])/6,n[e+1][1]+(i*n[e][1]-i*n[e+2][1])/6],o[3]=[n[e+1][0],n[e+1][1]],r.push(o[1],o[2],o[3])}}return r}(e),10,(1+n.roughness)/2);"solid"===n.fillStyle?r.push(me([t],n)):r.push(ge([t],n))}return n.stroke!==De&&r.push(o),this._d("curve",r,n)}polygon(e,t){const n=this._o(t),r=[],o=ce(e,!0,n);return n.fill&&("solid"===n.fillStyle?r.push(me([e],n)):r.push(ge([e],n))),n.stroke!==De&&r.push(o),this._d("polygon",r,n)}path(e,t){const n=this._o(t),r=[];if(!e)return this._d("path",r,n);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const o=n.fill&&"transparent"!==n.fill&&n.fill!==De,i=n.stroke!==De,a=!!(n.simplification&&n.simplification<1),l=function(e,t,n){const r=oe(re(ne(e))),o=[];let i=[],a=[0,0],l=[];const s=()=>{l.length>=4&&i.push(...Le(l,t)),l=[]},c=()=>{s(),i.length&&(o.push(i),i=[])};for(const{key:d,data:f}of r)switch(d){case"M":c(),a=[f[0],f[1]],i.push(a);break;case"L":s(),i.push([f[0],f[1]]);break;case"C":if(!l.length){const e=i.length?i[i.length-1]:a;l.push([e[0],e[1]])}l.push([f[0],f[1]]),l.push([f[2],f[3]]),l.push([f[4],f[5]]);break;case"Z":s(),i.push([a[0],a[1]])}if(c(),!n)return o;const u=[];for(const d of o){const e=Pe(d,n);e.length&&u.push(e)}return u}(e,1,a?4-4*n.simplification:(1+n.roughness)/2);return o&&("solid"===n.fillStyle?r.push(me(l,n)):r.push(ge(l,n))),i&&(a?l.forEach((e=>{r.push(ce(e,!1,n))})):r.push(function(e,t){const n=oe(re(ne(e))),r=[];let o=[0,0],i=[0,0];for(const{key:a,data:l}of n)switch(a){case"M":{const e=1*(t.maxRandomnessOffset||0),n=t.preserveVertices;r.push({op:"move",data:l.map((r=>r+(n?0:ye(e,t))))}),i=[l[0],l[1]],o=[l[0],l[1]];break}case"L":r.push(...xe(i[0],i[1],l[0],l[1],t)),i=[l[0],l[1]];break;case"C":{const[e,n,o,a,s,c]=l;r.push(...Ce(e,n,o,a,s,c,i,t)),i=[s,c];break}case"Z":r.push(...xe(i[0],i[1],o[0],o[1],t)),i=[o[0],o[1]]}return{type:"path",ops:r}}(e,n))),this._d("path",r,n)}opsToPath(e,t){let n="";for(const r of e.ops){const e="number"==typeof t&&t>=0?r.data.map((e=>+e.toFixed(t))):r.data;switch(r.op){case"move":n+=`M${e[0]} ${e[1]} `;break;case"bcurveTo":n+=`C${e[0]} ${e[1]}, ${e[2]} ${e[3]}, ${e[4]} ${e[5]} `;break;case"lineTo":n+=`L${e[0]} ${e[1]} `}}return n.trim()}toPaths(e){const t=e.sets||[],n=e.options||this.defaultOptions,r=[];for(const o of t){let e=null;switch(o.type){case"path":e={d:this.opsToPath(o),stroke:n.stroke,strokeWidth:n.strokeWidth,fill:De};break;case"fillPath":e={d:this.opsToPath(o),stroke:De,strokeWidth:0,fill:n.fill||De};break;case"fillSketch":e=this.fillSketch(o,n)}e&&r.push(e)}return r}fillSketch(e,t){let n=t.fillWeight;return n<0&&(n=t.strokeWidth/2),{d:this.opsToPath(e),stroke:t.fill||De,strokeWidth:n,fill:De}}}class ze{constructor(e,t){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new Re(t)}draw(e){const t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.ctx,o=e.options.fixedDecimalPlaceDigits;for(const i of t)switch(i.type){case"path":r.save(),r.strokeStyle="none"===n.stroke?"transparent":n.stroke,r.lineWidth=n.strokeWidth,n.strokeLineDash&&r.setLineDash(n.strokeLineDash),n.strokeLineDashOffset&&(r.lineDashOffset=n.strokeLineDashOffset),this._drawToContext(r,i,o),r.restore();break;case"fillPath":{r.save(),r.fillStyle=n.fill||"";const t="curve"===e.shape||"polygon"===e.shape||"path"===e.shape?"evenodd":"nonzero";this._drawToContext(r,i,o,t),r.restore();break}case"fillSketch":this.fillSketch(r,i,n)}}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2),e.save(),n.fillLineDash&&e.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(e.lineDashOffset=n.fillLineDashOffset),e.strokeStyle=n.fill||"",e.lineWidth=r,this._drawToContext(e,t,n.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,t,n,r="nonzero"){e.beginPath();for(const o of t.ops){const t="number"==typeof n&&n>=0?o.data.map((e=>+e.toFixed(n))):o.data;switch(o.op){case"move":e.moveTo(t[0],t[1]);break;case"bcurveTo":e.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]);break;case"lineTo":e.lineTo(t[0],t[1])}}"fillPath"===t.type?e.fill(r):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,t,n,r,o){const i=this.gen.line(e,t,n,r,o);return this.draw(i),i}rectangle(e,t,n,r,o){const i=this.gen.rectangle(e,t,n,r,o);return this.draw(i),i}ellipse(e,t,n,r,o){const i=this.gen.ellipse(e,t,n,r,o);return this.draw(i),i}circle(e,t,n,r){const o=this.gen.circle(e,t,n,r);return this.draw(o),o}linearPath(e,t){const n=this.gen.linearPath(e,t);return this.draw(n),n}polygon(e,t){const n=this.gen.polygon(e,t);return this.draw(n),n}arc(e,t,n,r,o,i,a=!1,l){const s=this.gen.arc(e,t,n,r,o,i,a,l);return this.draw(s),s}curve(e,t){const n=this.gen.curve(e,t);return this.draw(n),n}path(e,t){const n=this.gen.path(e,t);return this.draw(n),n}}const Ne="http://www.w3.org/2000/svg";class He{constructor(e,t){this.svg=e,this.gen=new Re(t)}draw(e){const t=e.sets||[],n=e.options||this.getDefaultOptions(),r=this.svg.ownerDocument||window.document,o=r.createElementNS(Ne,"g"),i=e.options.fixedDecimalPlaceDigits;for(const a of t){let t=null;switch(a.type){case"path":t=r.createElementNS(Ne,"path"),t.setAttribute("d",this.opsToPath(a,i)),t.setAttribute("stroke",n.stroke),t.setAttribute("stroke-width",n.strokeWidth+""),t.setAttribute("fill","none"),n.strokeLineDash&&t.setAttribute("stroke-dasharray",n.strokeLineDash.join(" ").trim()),n.strokeLineDashOffset&&t.setAttribute("stroke-dashoffset",`${n.strokeLineDashOffset}`);break;case"fillPath":t=r.createElementNS(Ne,"path"),t.setAttribute("d",this.opsToPath(a,i)),t.setAttribute("stroke","none"),t.setAttribute("stroke-width","0"),t.setAttribute("fill",n.fill||""),"curve"!==e.shape&&"polygon"!==e.shape||t.setAttribute("fill-rule","evenodd");break;case"fillSketch":t=this.fillSketch(r,a,n)}t&&o.appendChild(t)}return o}fillSketch(e,t,n){let r=n.fillWeight;r<0&&(r=n.strokeWidth/2);const o=e.createElementNS(Ne,"path");return o.setAttribute("d",this.opsToPath(t,n.fixedDecimalPlaceDigits)),o.setAttribute("stroke",n.fill||""),o.setAttribute("stroke-width",r+""),o.setAttribute("fill","none"),n.fillLineDash&&o.setAttribute("stroke-dasharray",n.fillLineDash.join(" ").trim()),n.fillLineDashOffset&&o.setAttribute("stroke-dashoffset",`${n.fillLineDashOffset}`),o}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,t){return this.gen.opsToPath(e,t)}line(e,t,n,r,o){const i=this.gen.line(e,t,n,r,o);return this.draw(i)}rectangle(e,t,n,r,o){const i=this.gen.rectangle(e,t,n,r,o);return this.draw(i)}ellipse(e,t,n,r,o){const i=this.gen.ellipse(e,t,n,r,o);return this.draw(i)}circle(e,t,n,r){const o=this.gen.circle(e,t,n,r);return this.draw(o)}linearPath(e,t){const n=this.gen.linearPath(e,t);return this.draw(n)}polygon(e,t){const n=this.gen.polygon(e,t);return this.draw(n)}arc(e,t,n,r,o,i,a=!1,l){const s=this.gen.arc(e,t,n,r,o,i,a,l);return this.draw(s)}curve(e,t){const n=this.gen.curve(e,t);return this.draw(n)}path(e,t){const n=this.gen.path(e,t);return this.draw(n)}}var Be={canvas:(e,t)=>new ze(e,t),svg:(e,t)=>new He(e,t),generator:e=>new Re(e),newSeed:()=>Re.newSeed()};function Fe(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=Fe(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Ue(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Fe(e))&&(r&&(r+=" "),r+=t);return r}let Ke=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;){let r=63&n[e];t+=r<36?r.toString(36):r<62?(r-26).toString(36).toUpperCase():r<63?"_":"-"}return t};var We=function(e){return!!e&&"image"===e.type&&!!e.fileId},Ve=function(e){return!!e&&"image"===e.type},Ge=function(e){return null!=e&&"text"===e.type},Ze=function(e){return null!=e&&Ye(e.type)},Ye=function(e){return"freedraw"===e},Xe=function(e){return null!=e&&qe(e.type)},qe=function(e){return"arrow"===e||"line"===e},$e=function(e){return null!=e&&Qe(e.type)},Qe=function(e){return"arrow"===e},Je=function(e){return null!=e&&("rectangle"===e.type||"diamond"===e.type||"ellipse"===e.type||"image"===e.type||"text"===e.type&&!e.containerId)},et=function(e){var t;return Je(e)&&!(null===(t=e.boundElements)||void 0===t||!t.some((function(e){return"text"===e.type})))},tt=function(e){return null!==e&&Ge(e)&&null!==e.containerId},nt=function(e,t,n,r,o){return[(e-n)*Math.cos(o)-(t-r)*Math.sin(o)+n,(e-n)*Math.sin(o)+(t-r)*Math.cos(o)+r]},rt=function(e,t,n){return nt(e[0],e[1],t[0],t[1],n)},ot=function(e,t,n,r,o,i,a,l){var s=Math.cos(r),c=Math.sin(r);return e.e&&e.w?t+=o+a:e.e?(t+=o*(1+s),n+=o*c,t+=a*(1-s),n+=a*-c):e.w&&(t+=o*(1-s),n+=o*-c,t+=a*(1+s),n+=a*c),e.n&&e.s?n+=i+l:e.n?(t+=i*c,n+=i*(1-s),t+=l*-c,n+=l*(1+s)):e.s&&(t+=i*-c,n+=i*(1+s),t+=l*c,n+=l*(1-s)),[t,n]},it=function(e,t,n,r){var o=n-e,i=r-t;return Math.hypot(o,i)},at=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(e.length>=3){var n=[e[0],e[e.length-1]],r=n[0],o=n[1];return it(r[0],r[1],o[0],o[1])<=c.qx/t}return!1},lt=function(e,t,n){var r=e.length;if(r<3)return!1;for(var o=[Number.MAX_SAFE_INTEGER,n],i=[t,n],a=0,l=0;l<r;l++){var s=e[l],c=e[(l+1)%r];if(ut(s,c,i,o)){if(0===ct(s,i,c))return st(s,i,c);a++}}return a%2==1},st=function(e,t,n){return t[0]<=Math.max(e[0],n[0])&&t[0]>=Math.min(e[0],n[0])&&t[1]<=Math.max(e[1],n[1])&&t[1]>=Math.min(e[1],n[1])},ct=function(e,t,n){var r=(t[1]-e[1])*(n[0]-t[0])-(t[0]-e[0])*(n[1]-t[1]);return 0===r?0:r>0?1:2},ut=function(e,t,n,r){var o=ct(e,t,n),i=ct(e,t,r),a=ct(n,r,e),l=ct(n,r,t);return o!==i&&a!==l||!(0!==o||!st(e,n,t))||!(0!==i||!st(e,r,t))||!(0!==a||!st(n,e,r))||!(0!==l||!st(n,t,r))},dt=function(e,t,n){return n?[Math.round(e/n)*n,Math.round(t/n)*n]:[e,t]},ft=function(e){var t=e.map((function(e){return e[0]})),n=e.map((function(e){return e[1]}));return{width:Math.max.apply(Math,A(t))-Math.min.apply(Math,A(t)),height:Math.max.apply(Math,A(n))-Math.min.apply(Math,A(n))}},pt=function(e,t,n){var r=n.map((function(t){return t[e]})),o=Math.max.apply(Math,A(r)),i=Math.min.apply(Math,A(r)),a=o-i,l=0===a?1:t/a,s=1/0,c=n.map((function(t){return t.map((function(t,n){if(n!==e)return t;var r=t*l;return s=Math.min(r,s),r}))}));if(2===c.length)return c;var u=i-s;return c.map((function(t){return t.map((function(t,n){return n===e?t+u:t}))}))};function ht(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return mt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mt(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function mt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var gt=function(e){return Ze(e)?xt(e):Xe(e)?wt(e):[e.x,e.y,e.x+e.width,e.y+e.height]},vt=function(e){var t,n=ht(e.sets);try{for(n.s();!(t=n.n()).done;){var r=t.value;if("path"===r.type)return r.ops}}catch(o){n.e(o)}finally{n.f()}return e.sets[0].ops},bt=function(e,t){var n=[0,0],r=e.reduce((function(e,r){var o=r.op,i=r.data;if("move"===o)n=i;else if("bcurveTo"===o){var a=[i[0],i[1]],l=[i[2],i[3]],s=[i[4],i[5]],c=n;n=s;for(var u=function(e,t){return Math.pow(1-e,3)*s[t]+3*e*Math.pow(1-e,2)*l[t]+3*Math.pow(e,2)*(1-e)*a[t]+c[t]*Math.pow(e,3)},d=0;d<=1;){var f=u(d,0),p=u(d,1);if(t){var m=h(t(f,p),2);f=m[0],p=m[1]}e.minY=Math.min(e.minY,p),e.minX=Math.min(e.minX,f),e.maxX=Math.max(e.maxX,f),e.maxY=Math.max(e.maxY,p),d+=.1}}return e}),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return[r.minX,r.minY,r.maxX,r.maxY]},yt=function(e){var t,n=1/0,r=1/0,o=-1/0,i=-1/0,a=ht(e);try{for(a.s();!(t=a.n()).done;){var l=h(t.value,2),s=l[0],c=l[1];n=Math.min(n,s),r=Math.min(r,c),o=Math.max(o,s),i=Math.max(i,c)}}catch(u){a.e(u)}finally{a.f()}return[n,r,o,i]},xt=function(e){var t=h(yt(e.points),4),n=t[0],r=t[1],o=t[2],i=t[3];return[n+e.x,r+e.y,o+e.x,i+e.y]},wt=function(e){var t;if(e.points.length<2||!Hr(e)){var n=e.points.reduce((function(e,t){var n=h(t,2),r=n[0],o=n[1];return e.minY=Math.min(e.minY,o),e.minX=Math.min(e.minX,r),e.maxX=Math.max(e.maxX,r),e.maxY=Math.max(e.maxY,o),e}),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}),r=n.minX,o=n.minY,i=n.maxX,a=n.maxY;t=[r+e.x,o+e.y,i+e.x,a+e.y]}else{var l=Hr(e),s=vt(l[0]),c=h(bt(s),4),u=c[0],d=c[1],f=c[2],p=c[3];t=[u+e.x,d+e.y,f+e.x,p+e.y]}return t},kt=function(e){var t,n=h(gt(e),4),r=n[0],o=n[1],i=n[2],a=n[3],l=(r+i)/2,s=(o+a)/2;if(Ze(e)){var c=yt(e.points.map((function(t){var n=h(t,2),r=n[0],o=n[1];return nt(r,o,l-e.x,s-e.y,e.angle)}))),u=h(c,4),d=u[0],f=u[1],p=u[2],m=u[3];return[d+e.x,f+e.y,p+e.x,m+e.y]}if(Xe(e))t=function(e,t,n){if(e.points.length<2||!Hr(e)){var r=e.points.reduce((function(r,o){var i=h(o,2),a=i[0],l=i[1],s=h(nt(e.x+a,e.y+l,t,n,e.angle),2);return a=s[0],l=s[1],r.minY=Math.min(r.minY,l),r.minX=Math.min(r.minX,a),r.maxX=Math.max(r.maxX,a),r.maxY=Math.max(r.maxY,l),r}),{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0});return[r.minX,r.minY,r.maxX,r.maxY]}var o=Hr(e),i=vt(o[0]);return bt(i,(function(r,o){return nt(e.x+r,e.y+o,t,n,e.angle)}))}(e,l,s);else if("diamond"===e.type){var g=h(nt(l,o,l,s,e.angle),2),v=g[0],b=g[1],y=h(nt(l,a,l,s,e.angle),2),x=y[0],w=y[1],k=h(nt(r,s,l,s,e.angle),2),E=k[0],_=k[1],S=h(nt(i,s,l,s,e.angle),2),C=S[0],j=S[1];t=[Math.min(v,x,E,C),Math.min(b,w,_,j),Math.max(v,x,E,C),Math.max(b,w,_,j)]}else if("ellipse"===e.type){var O=(i-r)/2,I=(a-o)/2,M=Math.cos(e.angle),T=Math.sin(e.angle),P=Math.hypot(O*M,I*T),A=Math.hypot(I*M,O*T);t=[l-P,s-A,l+P,s+A]}else{var L=h(nt(r,o,l,s,e.angle),2),D=L[0],R=L[1],z=h(nt(r,a,l,s,e.angle),2),N=z[0],H=z[1],B=h(nt(i,a,l,s,e.angle),2),F=B[0],U=B[1],K=h(nt(i,o,l,s,e.angle),2),W=K[0],V=K[1];t=[Math.min(D,N,F,W),Math.min(R,H,U,V),Math.max(D,N,F,W),Math.max(R,H,U,V)]}return t},Et=function(e){if(!e.length)return[0,0,0,0];var t=1/0,n=-1/0,r=1/0,o=-1/0;return e.forEach((function(e){var i=h(kt(e),4),a=i[0],l=i[1],s=i[2],c=i[3];t=Math.min(t,a),r=Math.min(r,l),n=Math.max(n,s),o=Math.max(o,c)})),[t,r,n,o]},_t=function(e,t,n){if(!Xe(e)&&!Ze(e))return[e.x,e.y,e.x+t,e.y+n];var r,o=pt(0,t,pt(1,n,e.points));if(Ze(e))r=yt(o);else{var i=Be.generator(),a="sharp"===e.strokeSharpness?i.linearPath(o,Ur(e)):i.curve(o,Ur(e)),l=vt(a);r=bt(l)}var s=h(r,4),c=s[0],u=s[1],d=s[2],f=s[3];return[c+e.x,u+e.y,d+e.x,f+e.y]},St=function(e,t,n){var r=Be.generator(),o="sharp"===n?r.linearPath(t,Ur(e)):r.curve(t,Ur(e)),i=vt(o),a=h(bt(i),4),l=a[0],s=a[1],c=a[2],u=a[3];return[l+e.x,s+e.y,c+e.x,u+e.y]},Ct=function(e){var t=h(Et(e),4),n=t[0],r=t[1],o=t[2],i=t[3];return{minX:n,minY:r,maxX:o,maxY:i,width:o-n,height:i-r,midX:(n+o)/2,midY:(r+i)/2}},jt=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=function(e){return[jt.red[e],jt.pink[e],jt.grape[e],jt.violet[e],jt.indigo[e],jt.blue[e],jt.cyan[e],jt.teal[e],jt.green[e],jt.lime[e],jt.yellow[e],jt.orange[e]]},It={canvasBackground:[jt.white,jt.gray[0],jt.gray[1]].concat(A(Ot(0))),elementBackground:["transparent",jt.gray[4],jt.gray[6]].concat(A(Ot(6))),elementStroke:[jt.black,jt.gray[8],jt.gray[7]].concat(A(Ot(9)))},Mt=n(5156),Tt=/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),Pt=/^Win/.test(window.navigator.platform),At=/\b(android)\b/i.test(navigator.userAgent),Lt="Equal",Dt="Minus",Rt="NumpadAdd",zt="NumpadSubtract",Nt="Numpad0",Ht="BracketRight",Bt="BracketLeft",Ft="Digit1",Ut="Digit2",Kt="Quote",Wt="Digit0",Vt="Slash",Gt="KeyC",Zt="KeyD",Yt="KeyG",Xt="KeyF",qt="KeyH",$t="KeyV",Qt="KeyX",Jt="KeyZ",en="KeyR",tn={ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",BACKSPACE:"Backspace",ALT:"Alt",CTRL_OR_CMD:Tt?"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"},nn=function(e){return e===tn.ARROW_LEFT||e===tn.ARROW_RIGHT||e===tn.ARROW_DOWN||e===tn.ARROW_UP},rn=function(e){return e.altKey},on=function(e){return e.shiftKey},an=function(e){return e.shiftKey},ln=function(){var e=new Date,t=e.getFullYear(),n="".concat(e.getMonth()+1).padStart(2,"0"),r="".concat(e.getDate()).padStart(2,"0"),o="".concat(e.getHours()).padStart(2,"0"),i="".concat(e.getMinutes()).padStart(2,"0");return"".concat(t,"-").concat(n,"-").concat(r,"-").concat(o).concat(i)},sn=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},cn=function(e){return e instanceof HTMLElement&&"wysiwyg"===e.dataset.type||e instanceof HTMLBRElement||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&("text"===e.type||"number"===e.type)},un=function(e){for(var t=e.fontFamily,n=0,r=Object.entries(c.ut);n<r.length;n++){var o=h(r[n],2),i=o[0];if(o[1]===t)return"".concat(i,", ").concat(c._D)}return c._D},dn=function(e){var t=e.fontSize,n=e.fontFamily;return"".concat(t,"px ").concat(un({fontFamily:n}))},fn=function(e,t){var n=0,r=null,o=function(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];r=i,clearTimeout(n),n=window.setTimeout((function(){r=null,e.apply(void 0,i)}),t)};return o.flush=function(){if(clearTimeout(n),r){var t=r;r=null,e.apply(void 0,A(t))}},o.cancel=function(){r=null,clearTimeout(n)},o},pn=function(e,t){if(!e.length||t<1)return[];for(var n=0,r=0,o=Array(Math.ceil(e.length/t));n<e.length;)o[r++]=e.slice(n,n+=t);return o},hn=function(e,t){return Math.abs(e-t)},mn=function(e){e&&(e.style.cursor="")},gn=function(e,t){e&&(e.style.cursor=t)},vn=function(e,t){e&&("selection"===t?mn(e):"image"!==t&&(e.style.cursor=c.oc.CROSSHAIR))},bn=function(){var e;return"HTML"===(null===(e=document.fullscreenElement)||void 0===e?void 0:e.nodeName)},yn=function(e){return e=e.replace(/\bAlt\b/i,"Alt").replace(/\bShift\b/i,"Shift").replace(/\b(Enter|Return)\b/i,"Enter").replace(/\bDel\b/i,"Delete"),Tt?e.replace(/\bCtrlOrCmd\b/i,"Cmd").replace(/\bAlt\b/i,"Option"):e.replace(/\bCtrlOrCmd\b/i,"Ctrl")},xn=function(e,t){var n=e.clientX,r=e.clientY,o=t.zoom,i=t.offsetLeft,a=t.offsetTop,l=t.scrollX,s=t.scrollY,c=1/o.value;return{x:(n-i)*c-l,y:(r-a)*c-s}},wn=function(e,t){var n=e.sceneX,r=e.sceneY,o=t.zoom,i=t.offsetLeft,a=t.offsetTop,l=t.scrollX,s=t.scrollY;return{x:(n+l)*o.value+i,y:(r+s)*o.value+a}},kn=function(e){return getComputedStyle(document.documentElement).getPropertyValue("--".concat(e))},En=new RegExp("^[^".concat("A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿Ⰰ-﬜﷾-﹯﻽-￿","]*[").concat("֑-߿יִ-﷽ﹰ-ﻼ","]")),_n=function(e){return En.test(e)},Sn=function(e){var t=h(e,2);return{x:t[0],y:t[1]}},Cn=function(e){if("AbortError"!==(null==e?void 0:e.name))throw e;console.warn(e)},jn=function(e){var t=5===e.length&&"0"===e.substr(4,1),n=9===e.length&&"00"===e.substr(7,2);return t||n||e===It.elementBackground[0]},On=function(e){return function(t){(0,Mt.unstable_batchedUpdates)(e,t)}},In=function(e){return t=function(t){(0,Mt.unstable_batchedUpdates)(e,t)},n=null,r=null,o=null,i=function(){for(var e=arguments.length,i=new Array(e),a=0;a<e;a++)i[a]=arguments[a];r=i,o=t,null===n&&(n=window.requestAnimationFrame((function(){n=null,r=null,o=null,t.apply(void 0,i)})))},i.flush=function(){if(null!==n&&(cancelAnimationFrame(n),n=null),r){var e=r,t=o;r=null,o=null,null!==t&&t.apply(void 0,A(e))}},i.cancel=function(){r=null,o=null,null!==n&&(cancelAnimationFrame(n),n=null)},i;var t,n,r,o,i},Mn=function(){return Pn()?1:Date.now()},Tn=function(e){return e.reduce((function(e,t){return e.set("string"==typeof t?t:t.id,t),e}),new Map)},Pn=function(){var e;return"undefined"!=typeof process&&"test"===(null===(e={REACT_APP_BACKEND_V2_GET_URL:"https://json.excalidraw.com/api/v2/",REACT_APP_BACKEND_V2_POST_URL:"https://json.excalidraw.com/api/v2/post/",REACT_APP_LIBRARY_URL:"https://libraries.excalidraw.com",REACT_APP_LIBRARY_BACKEND:"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries",REACT_APP_SOCKET_SERVER_URL:"https://oss-collab-us1.excalidraw.com",REACT_APP_FIREBASE_CONFIG:'{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}',REACT_APP_GOOGLE_ANALYTICS_ID:"UA-387204-13"})||void 0===e?void 0:e.NODE_ENV)},An=function(e,t){return new CustomEvent(e,{detail:{nativeEvent:t},cancelable:!0})};function Ln(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Dn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Dn(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function Dn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Rn=c.ZB.includes(devicePixelRatio)?devicePixelRatio:1,zn=function(){return{theme:c.C6.LIGHT,collaborators:new Map,currentChartType:"bar",currentItemBackgroundColor:"transparent",currentItemEndArrowhead:"arrow",currentItemFillStyle:"hachure",currentItemFontFamily:c.rk,currentItemFontSize:c.n5,currentItemLinearStrokeSharpness:"round",currentItemOpacity:100,currentItemRoughness:1,currentItemStartArrowhead:null,currentItemStrokeColor:jt.black,currentItemStrokeSharpness:"sharp",currentItemStrokeStyle:"solid",currentItemStrokeWidth:1,currentItemTextAlign:c.Hg,cursorButton:"up",draggingElement:null,editingElement:null,editingGroupId:null,editingLinearElement:null,elementLocked:!1,elementType:"selection",penMode:!1,penDetected:!1,errorMessage:null,exportBackground:!0,exportScale:Rn,exportEmbedScene:!1,exportWithDarkMode:!1,fileHandle:null,gridSize:null,isBindingEnabled:!0,isLibraryOpen:!1,isLoading:!1,isResizing:!1,isRotating:!1,lastPointerDownWith:"mouse",multiElement:null,name:"".concat(O("labels.untitled"),"-").concat(ln()),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:jt.white,zenModeEnabled:!1,zoom:{value:1},viewModeEnabled:!1,pendingImageElement:null,showHyperlinkPopup:!1}},Nn={theme:{browser:!0,export:!1,server:!1},collaborators:{browser:!1,export:!1,server:!1},currentChartType:{browser:!0,export:!1,server:!1},currentItemBackgroundColor:{browser:!0,export:!1,server:!1},currentItemEndArrowhead:{browser:!0,export:!1,server:!1},currentItemFillStyle:{browser:!0,export:!1,server:!1},currentItemFontFamily:{browser:!0,export:!1,server:!1},currentItemFontSize:{browser:!0,export:!1,server:!1},currentItemLinearStrokeSharpness:{browser:!0,export:!1,server:!1},currentItemOpacity:{browser:!0,export:!1,server:!1},currentItemRoughness:{browser:!0,export:!1,server:!1},currentItemStartArrowhead:{browser:!0,export:!1,server:!1},currentItemStrokeColor:{browser:!0,export:!1,server:!1},currentItemStrokeSharpness:{browser:!0,export:!1,server:!1},currentItemStrokeStyle:{browser:!0,export:!1,server:!1},currentItemStrokeWidth:{browser:!0,export:!1,server:!1},currentItemTextAlign:{browser:!0,export:!1,server:!1},cursorButton:{browser:!0,export:!1,server:!1},draggingElement:{browser:!1,export:!1,server:!1},editingElement:{browser:!1,export:!1,server:!1},editingGroupId:{browser:!0,export:!1,server:!1},editingLinearElement:{browser:!1,export:!1,server:!1},elementLocked:{browser:!0,export:!1,server:!1},elementType:{browser:!0,export:!1,server:!1},penMode:{browser:!1,export:!1,server:!1},penDetected:{browser:!1,export:!1,server:!1},errorMessage:{browser:!1,export:!1,server:!1},exportBackground:{browser:!0,export:!1,server:!1},exportEmbedScene:{browser:!0,export:!1,server:!1},exportScale:{browser:!0,export:!1,server:!1},exportWithDarkMode:{browser:!0,export:!1,server:!1},fileHandle:{browser:!1,export:!1,server:!1},gridSize:{browser:!0,export:!0,server:!0},height:{browser:!1,export:!1,server:!1},isBindingEnabled:{browser:!1,export:!1,server:!1},isLibraryOpen:{browser:!1,export:!1,server:!1},isLoading:{browser:!1,export:!1,server:!1},isResizing:{browser:!1,export:!1,server:!1},isRotating:{browser:!1,export:!1,server:!1},lastPointerDownWith:{browser:!0,export:!1,server:!1},multiElement:{browser:!1,export:!1,server:!1},name:{browser:!0,export:!1,server:!1},offsetLeft:{browser:!1,export:!1,server:!1},offsetTop:{browser:!1,export:!1,server:!1},openMenu:{browser:!0,export:!1,server:!1},openPopup:{browser:!1,export:!1,server:!1},pasteDialog:{browser:!1,export:!1,server:!1},previousSelectedElementIds:{browser:!0,export:!1,server:!1},resizingElement:{browser:!1,export:!1,server:!1},scrolledOutside:{browser:!0,export:!1,server:!1},scrollX:{browser:!0,export:!1,server:!1},scrollY:{browser:!0,export:!1,server:!1},selectedElementIds:{browser:!0,export:!1,server:!1},selectedGroupIds:{browser:!0,export:!1,server:!1},selectionElement:{browser:!1,export:!1,server:!1},shouldCacheIgnoreZoom:{browser:!0,export:!1,server:!1},showHelpDialog:{browser:!1,export:!1,server:!1},showStats:{browser:!0,export:!1,server:!1},startBoundElement:{browser:!1,export:!1,server:!1},suggestedBindings:{browser:!1,export:!1,server:!1},toastMessage:{browser:!1,export:!1,server:!1},viewBackgroundColor:{browser:!0,export:!0,server:!0},width:{browser:!1,export:!1,server:!1},zenModeEnabled:{browser:!0,export:!1,server:!1},zoom:{browser:!0,export:!1,server:!1},viewModeEnabled:{browser:!1,export:!1,server:!1},pendingImageElement:{browser:!1,export:!1,server:!1},showHyperlinkPopup:{browser:!1,export:!1,server:!1}},Hn=function(e,t){var n,r={},o=Ln(Object.keys(e));try{for(o.s();!(n=o.n()).done;){var i=n.value,a=Nn[i];if(null!=a&&a[t]){var l=e[i];r[i]=l}}}catch(s){o.e(s)}finally{o.f()}return r},Bn=function(e){return Hn(e,"export")},Fn=function(e){return Hn(e,"server")};function Un(e,t,n,r=(e=>e)){return e*r(.5-t*(.5-n))}function Kn(e,t){return[e[0]+t[0],e[1]+t[1]]}function Wn(e,t){return[e[0]-t[0],e[1]-t[1]]}function Vn(e,t){return[e[0]*t,e[1]*t]}function Gn(e){return[e[1],-e[0]]}function Zn(e,t){return e[0]*t[0]+e[1]*t[1]}function Yn(e,t){return e[0]===t[0]&&e[1]===t[1]}function Xn(e,t){return(n=Wn(e,t))[0]*n[0]+n[1]*n[1];var n}function qn(e){return function(e,t){return[e[0]/t,e[1]/t]}(e,(t=e,Math.hypot(t[0],t[1])));var t}function $n(e,t){return Math.hypot(e[1]-t[1],e[0]-t[0])}function Qn(e,t,n){let r=Math.sin(n),o=Math.cos(n),i=e[0]-t[0],a=e[1]-t[1],l=i*r+a*o;return[i*o-a*r+t[0],l+t[1]]}function Jn(e,t,n){return Kn(e,Vn(Wn(t,e),n))}function er(e,t,n){return Kn(e,Vn(t,n))}var{min:tr,PI:nr}=Math,rr=nr+1e-4;function or(e,t={}){return function(e,t={}){let{size:n=16,smoothing:r=.5,thinning:o=.5,simulatePressure:i=!0,easing:a=(e=>e),start:l={},end:s={},last:c=!1}=t,{cap:u=!0,taper:d=0,easing:f=(e=>e*(2-e))}=l,{cap:p=!0,taper:h=0,easing:m=(e=>--e*e*e+1)}=s;if(0===e.length||n<=0)return[];let g,v=e[e.length-1].runningLength,b=Math.pow(n*r,2),y=[],x=[],w=e.slice(0,10).reduce(((e,t)=>{let r=t.pressure;if(i){let o=tr(1,t.distance/n),i=tr(1,1-o);r=tr(1,e+.275*o*(i-e))}return(e+r)/2}),e[0].pressure),k=Un(n,o,e[e.length-1].pressure,a),E=e[0].vector,_=e[0].point,S=_,C=_,j=S;for(let A=0;A<e.length;A++){let{pressure:t}=e[A],{point:r,vector:l,distance:s,runningLength:c}=e[A];if(A<e.length-1&&v-c<3)continue;if(o){if(i){let e=tr(1,s/n),r=tr(1,1-e);t=tr(1,w+.275*e*(r-w))}k=Un(n,o,t,a)}else k=n/2;void 0===g&&(g=k);let u=c<d?f(c/d):1,p=v-c<h?m((v-c)/h):1;if(k=Math.max(.01,k*Math.min(u,p)),A===e.length-1){let e=Vn(Gn(l),k);y.push(Wn(r,e)),x.push(Kn(r,e));continue}let O=e[A+1].vector,I=Zn(l,O);if(I<0){let e=Vn(Gn(E),k);for(let t=1/13,n=0;n<=1;n+=t)C=Qn(Wn(r,e),r,rr*n),y.push(C),j=Qn(Kn(r,e),r,rr*-n),x.push(j);_=C,S=j;continue}let M=Vn(Gn(Jn(O,l,I)),k);C=Wn(r,M),(A<=1||Xn(_,C)>b)&&(y.push(C),_=C),j=Kn(r,M),(A<=1||Xn(S,j)>b)&&(x.push(j),S=j),w=t,E=l}let O=e[0].point.slice(0,2),I=e.length>1?e[e.length-1].point.slice(0,2):Kn(e[0].point,[1,1]),M=[],T=[];if(1===e.length){if(!d&&!h||c){let e=er(O,qn(Gn(Wn(O,I))),-(g||k)),t=[];for(let n=1/13,r=n;r<=1;r+=n)t.push(Qn(e,O,2*rr*r));return t}}else{if(!(d||h&&1===e.length))if(u)for(let e=1/13,n=e;n<=1;n+=e){let e=Qn(x[0],O,rr*n);M.push(e)}else{let e=Wn(y[0],x[0]),t=Vn(e,.5),n=Vn(e,.51);M.push(Wn(O,t),Wn(O,n),Kn(O,n),Kn(O,t))}let t=Gn([-(P=e[e.length-1].vector)[0],-P[1]]);if(h||d&&1===e.length)T.push(I);else if(p){let e=er(I,t,k);for(let t=1/29,n=t;n<1;n+=t)T.push(Qn(e,I,3*rr*n))}else T.push(Kn(I,Vn(t,k)),Kn(I,Vn(t,.99*k)),Wn(I,Vn(t,.99*k)),Wn(I,Vn(t,k)))}var P;return y.concat(T,x.reverse(),M)}(function(e,t={}){var n;let{streamline:r=.5,size:o=16,last:i=!1}=t;if(0===e.length)return[];let a=.15+.85*(1-r),l=Array.isArray(e[0])?e:e.map((({x:e,y:t,pressure:n=.5})=>[e,t,n]));if(2===l.length){let e=l[1];l=l.slice(0,-1);for(let t=1;t<5;t++)l.push(Jn(l[0],e,t/4))}1===l.length&&(l=[...l,[...Kn(l[0],[1,1]),...l[0].slice(2)]]);let s=[{point:[l[0][0],l[0][1]],pressure:l[0][2]>=0?l[0][2]:.25,vector:[1,1],distance:0,runningLength:0}],c=!1,u=0,d=s[0],f=l.length-1;for(let p=1;p<l.length;p++){let e=i&&p===f?l[p].slice(0,2):Jn(d.point,l[p],a);if(Yn(d.point,e))continue;let t=$n(e,d.point);if(u+=t,p<f&&!c){if(u<o)continue;c=!0}d={point:e,pressure:l[p][2]>=0?l[p][2]:.5,vector:qn(Wn(d.point,e)),distance:t,runningLength:u},s.push(d)}return s[0].vector=(null==(n=s[1])?void 0:n.vector)||[0,0],s}(e,t),t)}var ir=function(e){return"string"==typeof e},ar=function(){function e(){D(this,e),this.callbacks=new Set,this.nonDeletedElements=[],this.elements=[],this.elementsMap=new Map}return z(e,[{key:"getElementsIncludingDeleted",value:function(){return this.elements}},{key:"getElements",value:function(){return this.nonDeletedElements}},{key:"getElement",value:function(e){return this.elementsMap.get(e)||null}},{key:"getNonDeletedElement",value:function(e){var t=this.getElement(e);return t&&Oc(t)?t:null}},{key:"getNonDeletedElements",value:function(e){var t=this,n=[];return e.forEach((function(e){var r=t.getNonDeletedElement(e);null!=r&&n.push(r)})),n}},{key:"replaceAllElements",value:function(t){var n=this;this.elements=t,this.elementsMap.clear(),t.forEach((function(t){n.elementsMap.set(t.id,t),e.mapElementToScene(t,n)})),this.nonDeletedElements=jc(this.elements),this.informMutation()}},{key:"informMutation",value:function(){for(var e=0,t=Array.from(this.callbacks);e<t.length;e++)(0,t[e])()}},{key:"addCallback",value:function(e){var t=this;if(this.callbacks.has(e))throw new Error;return this.callbacks.add(e),function(){if(!t.callbacks.has(e))throw new Error;t.callbacks.delete(e)}}},{key:"destroy",value:function(){var t=this;e.sceneMapById.forEach((function(n,r){n===t&&e.sceneMapById.delete(r)})),this.callbacks.clear()}}],[{key:"mapElementToScene",value:function(e,t){ir(e)?this.sceneMapById.set(e,t):this.sceneMapByElement.set(e,t)}},{key:"getScene",value:function(e){return ir(e)?this.sceneMapById.get(e)||null:this.sceneMapByElement.get(e)||null}}]),e}();ar.sceneMapByElement=new WeakMap,ar.sceneMapById=new Map;var lr,sr,cr=ar,ur=function(e,t,n){var r=t?t.width-2*c.gK:void 0,o=e.text;t&&(o=br(e.originalText,dn(e),t.width));var i=pr(e.originalText,dn(e),r),a=e.y;if(t){a=t.y+t.height/2-i.height/2;var l=t.height;i.height>t.height-2*c.gK&&(l=i.height+2*c.gK,a=t.y+l/2-i.height/2),ao(t,{height:l})}ao(e,{width:i.width,height:i.height,baseline:i.baseline,y:a,text:o})},dr=function(e,t,n){var r=Tn(e);t.forEach((function(e){var t=n.get(e.id),o=kr(e);if(o){var i,a=n.get(o);ao(r.get(t),{boundElements:null===(i=e.boundElements)||void 0===i?void 0:i.concat({type:"text",id:a})}),ao(r.get(a),{containerId:t})}}))},fr=function(e,t){e.forEach((function(e){var n=kr(e);if(n){var r=cr.getScene(e).getElement(n);if(r&&r.text){if(!e)return;var o=r.text,i=r.height,a=e.height,l=r.baseline;if("n"!==t&&"s"!==t){o&&(o=br(r.originalText,dn(r),e.width));var s=pr(o,dn(r),e.width);i=s.height,l=s.baseline}if(i>e.height-2*c.gK){var u=(a=i+2*c.gK)-e.height,d="ne"===t||"nw"===t||"n"===t?e.y-u:e.y;ao(e,{height:a,y:d})}var f=e.y+a/2-i/2;ao(r,{text:o,width:e.width-2*c.gK,height:i,x:e.x+c.gK,y:f,baseline:l})}}}))},pr=function(e,t,n){e=e.split("\n").map((function(e){return e||" "})).join("\n");var r=document.createElement("div");if(r.style.position="absolute",r.style.whiteSpace="pre",r.style.font=t,r.style.minHeight="1em",n){var o=gr(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(o),"px"),r.style.whiteSpace="pre-wrap"}document.body.appendChild(r),r.innerText=e;var i=document.createElement("span");i.style.display="inline-block",i.style.overflow="hidden",i.style.width="1px",i.style.height="1px",r.appendChild(i);var a=i.offsetTop+i.offsetHeight,l=r.offsetWidth,s=r.offsetHeight;return document.body.removeChild(r),{width:l,height:s,baseline:a}},hr="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".toLocaleUpperCase(),mr={},gr=function(e){return mr[e]||(mr[e]=pr(hr,e,null).height),mr[e]},vr=function(e,t){lr||(lr=document.createElement("canvas"));var n=lr.getContext("2d");n.font=t;var r=n.measureText(e);return Pn()?10*r.width:r.width},br=function(e,t,n){var r=n-2*c.gK,o=[],i=e.split("\n"),a=vr(" ",t);return i.forEach((function(e){var n=e.split(" ");if(1===n.length&&""===n[0])o.push(n[0]);else{for(var i="",l=0,s=0;s<n.length;)if(vr(n[s],t)>=r){for(i&&o.push(i),i="",l=0;n[s].length>0;){var c=n[s][0],u=yr.calculate(c,t);l+=u,n[s]=n[s].slice(1),l>=r?(" "===i.slice(-1)&&(i=i.slice(0,-1)),o.push(i),i=c,(l=u)===r&&(i="",l=0)):i+=c}l+a>=r?(o.push(i),i="",l=0):(i+=" ",l+=a),s++}else{for(;l<r&&s<n.length;){var d=n[s];if((l=vr(i+d,t))>=r){o.push(i),l=0,i="";break}if(s++,i+="".concat(d," "),l+a>=r){o.push(i.slice(0,-1)),i="",l=0;break}}l===r&&(i="",l=0)}i&&(" "===i.slice(-1)&&(i=i.slice(0,-1)),o.push(i))}})),o.join("\n")},yr=(sr={},{calculate:function(e,t){var n=e.charCodeAt(0);if(sr[t]||(sr[t]=[]),!sr[t][n]){var r=vr(e,t);sr[t][n]=r}return sr[t][n]},getCache:function(e){return sr[e]}}),xr=function(e){var t=wr(e);return 0===t?pr(hr.split("").join("\n"),e).width+2*c.gK:t+2*c.gK},wr=function(e){var t=yr.getCache(e);if(!t)return 0;var n=t.filter((function(e){return void 0!==e}));return Math.min.apply(Math,A(n))},kr=function(e){var t,n;return null==e||null===(t=e.boundElements)||void 0===t||null===(n=t.filter((function(e){return"text"===e.type}))[0])||void 0===n?void 0:n.id},Er=function(e){if(!e)return null;var t,n=kr(e);return n&&(null===(t=cr.getScene(e))||void 0===t?void 0:t.getElement(n))||null},_r=function(e){return e&&e.containerId&&(null===(t=cr.getScene(e))||void 0===t?void 0:t.getElement(e.containerId))||null;var t};function Sr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Cr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Sr(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var jr="invert(100%) hue-rotate(180deg) saturate(1.25)",Or=zn(),Ir=function(e,t){return We(e)&&!t.imageCache.has(e.fileId)},Mr=function(e,t){var n;return"dark"===t.theme&&We(e)&&!Ir(e,t)&&(null===(n=t.imageCache.get(e.fileId))||void 0===n?void 0:n.mimeType)!==c.LO.svg},Tr=function(e){return[8,8+e]},Pr=function(e){return[1.5,6+e]},Ar=function(e){return"freedraw"===e.type?12*e.strokeWidth:20},Lr=document.createElement("img");Lr.src="data:".concat(c.LO.svg,",").concat(encodeURIComponent('<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="image" class="svg-inline--fa fa-image fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="#888" d="M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48zM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56zM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48z"></path></svg>'));var Dr=document.createElement("img");Dr.src="data:".concat(c.LO.svg,",").concat(encodeURIComponent('<svg viewBox="0 0 668 668" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2"><path d="M464 448H48c-26.51 0-48-21.49-48-48V112c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v288c0 26.51-21.49 48-48 48ZM112 120c-30.928 0-56 25.072-56 56s25.072 56 56 56 56-25.072 56-56-25.072-56-56-56ZM64 384h384V272l-87.515-87.515c-4.686-4.686-12.284-4.686-16.971 0L208 320l-55.515-55.515c-4.686-4.686-12.284-4.686-16.971 0L64 336v48Z" style="fill:#888;fill-rule:nonzero" transform="matrix(.81709 0 0 .81709 124.825 145.825)"/><path d="M256 8C119.034 8 8 119.033 8 256c0 136.967 111.034 248 248 248s248-111.034 248-248S392.967 8 256 8Zm130.108 117.892c65.448 65.448 70 165.481 20.677 235.637L150.47 105.216c70.204-49.356 170.226-44.735 235.638 20.676ZM125.892 386.108c-65.448-65.448-70-165.481-20.677-235.637L361.53 406.784c-70.203 49.356-170.226 44.736-235.638-20.676Z" style="fill:#888;fill-rule:nonzero" transform="matrix(.30366 0 0 .30366 506.822 60.065)"/></svg>'));var Rr=function(e,t,n,r){switch(n.globalAlpha=e.opacity/100,e.type){case"rectangle":case"diamond":case"ellipse":n.lineJoin="round",n.lineCap="round",t.draw(Hr(e));break;case"arrow":case"line":n.lineJoin="round",n.lineCap="round",Hr(e).forEach((function(e){t.draw(e)}));break;case"freedraw":n.save(),n.fillStyle=e.strokeColor;var o=(m=e,Xr.get(m)),i=Hr(e);i&&t.draw(i),n.fillStyle=e.strokeColor,n.fill(o),n.restore();break;case"image":var a,l=We(e)?null===(a=r.imageCache.get(e.fileId))||void 0===a?void 0:a.image:void 0;null==l||l instanceof Promise?function(e,t,n){t.fillStyle="#E7E7E7",t.fillRect(0,0,e.width,e.height);var r=Math.min(e.width,e.height),o=Math.min(r,Math.min(.4*r,100));t.drawImage("error"===e.status?Dr:Lr,e.width/2-o/2,e.height/2-o/2,o,o)}(e,n,r.zoom.value):n.drawImage(l,0,0,e.width,e.height);break;default:if(!Ge(e))throw new Error("Unimplemented type ".concat(e.type));var s=_n(e.text),c=s&&!n.canvas.isConnected;c&&document.body.appendChild(n.canvas),n.canvas.setAttribute("dir",s?"rtl":"ltr"),n.save(),n.font=dn(e),n.fillStyle=e.strokeColor,n.textAlign=e.textAlign;for(var u=e.text.replace(/\r\n?/g,"\n").split("\n"),d=e.containerId?gr(dn(e)):e.height/u.length,f=e.height-e.baseline,p="center"===e.textAlign?e.width/2:"right"===e.textAlign?e.width:0,h=0;h<u.length;h++)n.fillText(u[h],p,(h+1)*d-f);n.restore(),c&&n.canvas.remove()}var m;n.globalAlpha=1},zr=new WeakMap,Nr=new WeakMap,Hr=function(e){return Nr.get(e)},Br=function(e,t){return Nr.set(e,t)},Fr=function(e){return Nr.delete(e)},Ur=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n={seed:e.seed,strokeLineDash:"dashed"===e.strokeStyle?Tr(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 at(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=function(e,t){var n,r,o,i,a=Nr.get(e);if(void 0===a)switch(zr.delete(e),e.type){case"rectangle":if("round"===e.strokeSharpness){var l=e.width,s=e.height,c=.25*Math.min(l,s);a=t.path("M ".concat(c," 0 L ").concat(l-c," 0 Q ").concat(l," 0, ").concat(l," ").concat(c," L ").concat(l," ").concat(s-c," Q ").concat(l," ").concat(s,", ").concat(l-c," ").concat(s," L ").concat(c," ").concat(s," Q 0 ").concat(s,", 0 ").concat(s-c," L 0 ").concat(c," Q 0 0, ").concat(c," 0"),Ur(e,!0))}else a=t.rectangle(0,0,e.width,e.height,Ur(e));Br(e,a);break;case"diamond":var u=h((n=e,r=Math.floor(n.width/2)+1,o=n.width,i=Math.floor(n.height/2)+1,[r,0,o,i,r,n.height,0,i]),8),d=u[0],f=u[1],p=u[2],m=u[3],g=u[4],v=u[5],b=u[6],y=u[7];a="round"===e.strokeSharpness?t.path("M ".concat(d+.25*(p-d)," ").concat(f+.25*(m-f)," L ").concat(p-.25*(p-d)," ").concat(m-.25*(m-f),"\n C ").concat(p," ").concat(m,", ").concat(p," ").concat(m,", ").concat(p-.25*(p-g)," ").concat(m+.25*(v-m),"\n L ").concat(g+.25*(p-g)," ").concat(v-.25*(v-m),"\n C ").concat(g," ").concat(v,", ").concat(g," ").concat(v,", ").concat(g-.25*(g-b)," ").concat(v-.25*(v-y),"\n L ").concat(b+.25*(g-b)," ").concat(y+.25*(v-y),"\n C ").concat(b," ").concat(y,", ").concat(b," ").concat(y,", ").concat(b+.25*(d-b)," ").concat(y-.25*(y-f),"\n L ").concat(d-.25*(d-b)," ").concat(f+.25*(y-f),"\n C ").concat(d," ").concat(f,", ").concat(d," ").concat(f,", ").concat(d+.25*(p-d)," ").concat(f+.25*(m-f)),Ur(e,!0)):t.polygon([[d,f],[p,m],[g,v],[b,y]],Ur(e)),Br(e,a);break;case"ellipse":a=t.ellipse(e.width/2,e.height/2,e.width,e.height,Ur(e)),Br(e,a);break;case"line":case"arrow":var x=Ur(e),w=e.points.length?e.points:[[0,0]];if(a="sharp"===e.strokeSharpness?x.fill?[t.polygon(w,x)]:[t.linearPath(w,x)]:[t.curve(w,x)],"arrow"===e.type){var k=e.startArrowhead,E=void 0===k?null:k,_=e.endArrowhead,S=void 0===_?"arrow":_,C=function(e,n,r,o){var i=function(e,t,n,r){var o=vt(t[0]);if(o.length<1)return null;var i="start"===n?1:o.length-1,a=o[i].data,l=[a[4],a[5]],s=[a[2],a[3]],c=[a[0],a[1]],u=o[i-1],d=[0,0];"move"===u.op?d=u.data:"bcurveTo"===u.op&&(d=[u.data[4],u.data[5]]);var f=function(e,t){return Math.pow(1-e,3)*l[t]+3*e*Math.pow(1-e,2)*s[t]+3*Math.pow(e,2)*(1-e)*c[t]+d[t]*Math.pow(e,3)},p=h("start"===n?d:l,2),m=p[0],g=p[1],v=[f(.3,0),f(.3,1)],b=v[0],y=v[1],x=Math.hypot(m-b,g-y),w=(m-b)/x,k=(g-y)/x,E={arrow:30,bar:15,dot:15,triangle:15}[r],_=0;if("arrow"===r){var S=h(e.points[e.points.length-1],2),C=S[0],j=S[1],O=h(e.points.length>1?e.points[e.points.length-2]:[0,0],2),I=O[0],M=O[1];_=Math.hypot(C-I,j-M)}else for(var T=0;T<e.points.length;T++){var P=h(e.points[T-1]||[0,0],2),A=P[0],L=P[1],D=h(e.points[T],2),R=D[0],z=D[1];_+=Math.hypot(R-A,z-L)}var N=Math.min(E,_/2),H=m-w*N,B=g-k*N;if("dot"===r)return[m,g,Math.hypot(B-g,H-m)+e.strokeWidth];var F={arrow:20,bar:90,triangle:25}[r],U=h(nt(H,B,m,g,-F*Math.PI/180),2),K=U[0],W=U[1],V=h(nt(H,B,m,g,F*Math.PI/180),2);return[m,g,K,W,V[0],V[1]]}(e,n,r,o);if(null===i)return[];if("dot"===o){var a=h(i,3),l=a[0],s=a[1],c=a[2];return[t.circle(l,s,c,Cr(Cr({},x),{},{fill:e.strokeColor,fillStyle:"solid",stroke:"none"}))]}if("triangle"===o){var u=h(i,6),d=u[0],f=u[1],p=u[2],m=u[3],g=u[4],v=u[5];return delete x.strokeLineDash,[t.polygon([[d,f],[p,m],[g,v],[d,f]],Cr(Cr({},x),{},{fill:e.strokeColor,fillStyle:"solid"}))]}var b=h(i,6),y=b[0],w=b[1],k=b[2],E=b[3],_=b[4],S=b[5];if("dotted"===e.strokeStyle){var C=Pr(e.strokeWidth-1);x.strokeLineDash=[C[0],C[1]-1]}else delete x.strokeLineDash;return[t.line(k,E,y,w,x),t.line(_,S,y,w,x)]};if(null!==E){var j,O=C(e,a,"start",E);(j=a).push.apply(j,A(O))}if(null!==S){var I,M=C(e,a,"end",S);(I=a).push.apply(I,A(M))}}Br(e,a);break;case"freedraw":qr(e),a=at(e.points)?t.polygon(e.points,Cr(Cr({},Ur(e)),{},{stroke:"none"})):null,Br(e,a);break;case"text":case"image":Br(e,null)}},Wr=function(e,t){var n=t?t.zoom:Or.zoom,r=zr.get(e),o=r&&r.canvasZoom!==n.value&&!(null!=t&&t.shouldCacheIgnoreZoom);if(!r||o||r.theme!==t.theme){var i=function(e,t,n){var r=document.createElement("canvas"),o=r.getContext("2d"),i=Ar(e),a=0,l=0;if(Xe(e)||Ze(e)){var s=h(gt(e),4),c=s[0],u=s[1],d=s[2],f=s[3];r.width=hn(c,d)*window.devicePixelRatio*t.value+i*t.value*2,r.height=hn(u,f)*window.devicePixelRatio*t.value+i*t.value*2,a=e.x>c?hn(e.x,c)*window.devicePixelRatio*t.value:0,l=e.y>u?hn(e.y,u)*window.devicePixelRatio*t.value:0,o.translate(a,l)}else r.width=e.width*window.devicePixelRatio*t.value+i*t.value*2,r.height=e.height*window.devicePixelRatio*t.value+i*t.value*2;o.save(),o.translate(i*t.value,i*t.value),o.scale(window.devicePixelRatio*t.value,window.devicePixelRatio*t.value);var p=Be.canvas(r);return Mr(e,n)&&(o.filter=jr),Rr(e,p,o,n),o.restore(),{element:e,canvas:r,theme:n.theme,canvasZoom:t.value,canvasOffsetX:a,canvasOffsetY:l}}(e,n,t);return zr.set(e,i),i}return r},Vr=function(e,t,n,r){var o=e.element,i=Ar(o),a=h(gt(o),4),l=a[0],s=a[1],c=a[2],u=a[3];Ze(o)&&(l=Math.floor(l),c=Math.ceil(c),s=Math.floor(s),u=Math.ceil(u));var d=((l+c)/2+r.scrollX)*window.devicePixelRatio,f=((s+u)/2+r.scrollY)*window.devicePixelRatio,p=Ir(o,r),m="scale"in e.element&&!p?e.element.scale[0]:1,g="scale"in e.element&&!p?e.element.scale[1]:1;n.save(),n.scale(1/window.devicePixelRatio*m,1/window.devicePixelRatio*g),n.translate(d*m,f*g),n.rotate(o.angle*m*g),n.drawImage(e.canvas,-(c-l)/2*window.devicePixelRatio-i*e.canvasZoom/e.canvasZoom,-(u-s)/2*window.devicePixelRatio-i*e.canvasZoom/e.canvasZoom,e.canvas.width/e.canvasZoom,e.canvas.height/e.canvasZoom),n.restore()},Gr=function(e,t,n,r){var o=t.generator;switch(e.type){case"selection":n.save(),n.translate(e.x+r.scrollX,e.y+r.scrollY),n.fillStyle="rgba(0, 0, 255, 0.10)",n.fillRect(0,0,e.width,e.height),n.restore();break;case"freedraw":if(Kr(e,o),r.isExporting){var i=Wr(e,r);Vr(i,0,n,r)}else{var a=h(gt(e),4),l=a[0],s=a[1],c=a[2],u=a[3],d=(l+c)/2+r.scrollX,f=(s+u)/2+r.scrollY,p=(c-l)/2-(e.x-l),m=(u-s)/2-(e.y-s);n.save(),n.translate(d,f),n.rotate(e.angle),n.translate(-p,-m),Rr(e,t,n,r),n.restore()}break;case"rectangle":case"diamond":case"ellipse":case"line":case"arrow":case"image":case"text":if(Kr(e,o),r.isExporting){var g=h(gt(e),4),v=g[0],b=g[1],y=g[2],x=g[3],w=(v+y)/2+r.scrollX,k=(b+x)/2+r.scrollY,E=(y-v)/2-(e.x-v),_=(x-b)/2-(e.y-b);n.save(),n.translate(w,k),n.rotate(e.angle),n.translate(-E,-_),Mr(e,r)&&(n.filter="none"),Rr(e,t,n,r),n.restore()}else{var S=Wr(e,r);Vr(S,0,n,r)}break;default:throw new Error("Unimplemented type ".concat(e.type))}},Zr=function(e,t,n){if(void 0===n)return e.draw(t);var r={sets:t.sets,shape:t.shape,options:Cr(Cr({},t.options),{},{fixedDecimalPlaceDigits:n})};return e.draw(r)},Yr=function(e,t,n,r,o,i,a){var l=h(gt(e),4),s=l[0],u=l[1],d=l[2],f=l[3],p=(d-s)/2-(e.x-s),m=(f-u)/2-(e.y-u),g=180*e.angle/Math.PI,v=t.generator;switch(e.type){case"selection":throw new Error("Selection rendering is not supported for SVG");case"rectangle":case"diamond":case"ellipse":Kr(e,v);var b=Zr(t,Hr(e),c.zK),y=e.opacity/100;1!==y&&(b.setAttribute("stroke-opacity","".concat(y)),b.setAttribute("fill-opacity","".concat(y))),b.setAttribute("stroke-linecap","round"),b.setAttribute("transform","translate(".concat(o||0," ").concat(i||0,") rotate(").concat(g," ").concat(p," ").concat(m,")")),n.appendChild(b);break;case"line":case"arrow":Kr(e,v);var x=n.ownerDocument.createElementNS(c.hR,"g"),w=e.opacity/100;x.setAttribute("stroke-linecap","round"),Hr(e).forEach((function(n){var r=Zr(t,n,c.zK);1!==w&&(r.setAttribute("stroke-opacity","".concat(w)),r.setAttribute("fill-opacity","".concat(w))),r.setAttribute("transform","translate(".concat(o||0," ").concat(i||0,") rotate(").concat(g," ").concat(p," ").concat(m,")")),"line"===e.type&&at(e.points)&&"transparent"!==e.backgroundColor&&r.setAttribute("fill-rule","evenodd"),x.appendChild(r)})),n.appendChild(x);break;case"freedraw":qr(e);var k=e.opacity/100,E=Hr(e),_=E?Zr(t,E,c.zK):n.ownerDocument.createElementNS(c.hR,"g");1!==k&&(_.setAttribute("stroke-opacity","".concat(k)),_.setAttribute("fill-opacity","".concat(k))),_.setAttribute("transform","translate(".concat(o||0," ").concat(i||0,") rotate(").concat(g," ").concat(p," ").concat(m,")")),_.setAttribute("stroke","none");var S=n.ownerDocument.createElementNS(c.hR,"path");S.setAttribute("fill",e.strokeColor),S.setAttribute("d",$r(e)),_.appendChild(S),n.appendChild(_);break;case"image":var C=We(e)&&r[e.fileId];if(C){var j="image-".concat(C.id),O=n.querySelector("#".concat(j));if(!O){(O=n.ownerDocument.createElementNS(c.hR,"symbol")).id=j;var I=n.ownerDocument.createElementNS(c.hR,"image");I.setAttribute("width","100%"),I.setAttribute("height","100%"),I.setAttribute("href",C.dataURL),O.appendChild(I),n.prepend(O)}var M=n.ownerDocument.createElementNS(c.hR,"use");M.setAttribute("href","#".concat(j)),a&&C.mimeType!==c.LO.svg&&M.setAttribute("filter",jr),M.setAttribute("width","".concat(Math.round(e.width))),M.setAttribute("height","".concat(Math.round(e.height))),M.setAttribute("transform","translate(".concat(o||0," ").concat(i||0,") rotate(").concat(g," ").concat(p," ").concat(m,")")),n.appendChild(M)}break;default:if(!Ge(e))throw new Error("Unimplemented type ".concat(e.type));var T=e.opacity/100,P=n.ownerDocument.createElementNS(c.hR,"g");1!==T&&(P.setAttribute("stroke-opacity","".concat(T)),P.setAttribute("fill-opacity","".concat(T))),P.setAttribute("transform","translate(".concat(o||0," ").concat(i||0,") rotate(").concat(g," ").concat(p," ").concat(m,")"));for(var A=e.text.replace(/\r\n?/g,"\n").split("\n"),L=e.height/A.length,D=e.height-e.baseline,R="center"===e.textAlign?e.width/2:"right"===e.textAlign?e.width:0,z=_n(e.text)?"rtl":"ltr",N="center"===e.textAlign?"middle":"right"===e.textAlign||"rtl"===z?"end":"start",H=0;H<A.length;H++){var B=n.ownerDocument.createElementNS(c.hR,"text");B.textContent=A[H],B.setAttribute("x","".concat(R)),B.setAttribute("y","".concat((H+1)*L-D)),B.setAttribute("font-family",un(e)),B.setAttribute("font-size","".concat(e.fontSize,"px")),B.setAttribute("fill",e.strokeColor),B.setAttribute("text-anchor",N),B.setAttribute("style","white-space: pre;"),B.setAttribute("direction",z),P.appendChild(B)}n.appendChild(P)}},Xr=new WeakMap([]);function qr(e){var t=$r(e),n=new Path2D(t);return Xr.set(e,n),n}function $r(e){return function(e){if(!e.length)return"";var t=e.length-1;return e.reduce((function(e,n,r,o){return r===t?e.push(n,Qr(n,o[0]),"L",o[0],"Z"):e.push(n,Qr(n,o[r+1])),e}),["M",e[0],"Q"]).join(" ").replace(Jr,"$1")}(or(e.simulatePressure?e.points:e.points.length?e.points.map((function(t,n){var r=h(t,2);return[r[0],r[1],e.pressures[n]]})):[[0,0,.5]],{simulatePressure:e.simulatePressure,size:4.25*e.strokeWidth,thinning:.6,smoothing:.5,streamline:.5,easing:function(e){return Math.sin(e*Math.PI/2)},last:!!e.lastCommittedPoint}))}function Qr(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}var Jr=/(\s?[A-Z]?,?-?[0-9]*\.[0-9]{0,2})(([0-9]|e|-)*)/g,eo=new J(Date.now()),to=0,no=function(){return Math.floor(eo.next()*Math.pow(2,31))},ro=function(){return Pn()?"id".concat(to++):Ke()};function oo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function io(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oo(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ao=function(e,t){var n,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=!1,i=t,a=i.points,l=i.fileId;for(var s in void 0!==a&&(t=io(io({},ft(a)),t)),t){var c=t[s];if(void 0!==c){if(e[s]===c&&("object"!==P(c)||null===c||"groupIds"===s||"scale"===s))continue;if("scale"===s){var u=e[s],d=c;if(u[0]===d[0]&&u[1]===d[1])continue}else if("points"===s){var f=e[s],p=c;if(f.length===p.length){for(var h=!1,m=f.length;--m;){var g=f[m],v=p[m];if(g[0]!==v[0]||g[1]!==v[1]){h=!0;break}}if(!h)continue}}e[s]=c,o=!0}}return o?(void 0===t.height&&void 0===t.width&&void 0===l&&void 0===a||Fr(e),e.version++,e.versionNonce=no(),e.updated=Mn(),r&&(null===(n=cr.getScene(e))||void 0===n||n.informMutation()),e):e},lo=function(e,t){var n=!1;for(var r in t){var o=t[r];if(void 0!==o){if(e[r]===o&&("object"!==P(o)||null===o))continue;n=!0}}return n?io(io(io({},e),t),{},{updated:Mn(),version:e.version+1,versionNonce:no()}):e},so=function(e,t){return e.version=(null!=t?t:e.version)+1,e.versionNonce=no(),e.updated=Mn(),e},co=function(e){return Xe(e)||Ze(e)?e.points.length<2:0===e.width&&0===e.height},uo=function(e,t,n){var r=Math.abs(t),o=Math.abs(n);if("line"===e||"arrow"===e||"freedraw"===e){var i=Math.round(Math.atan(o/r)/c.ay)*c.ay;0===i?n=0:i===Math.PI/2?t=0:n=Math.round(r*Math.tan(i))*Math.sign(n)||n}else"selection"!==e&&(n=r*Math.sign(n));return{width:t,height:n}},fo=function(e){var t={width:e.width,height:e.height,x:e.x,y:e.y};if(e.width<0){var n=Math.abs(e.width);t.width=n,t.x=e.x-n}if(e.height<0){var r=Math.abs(e.height);t.height=r,t.y=e.y-r}return t};function po(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function ho(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return mo(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mo(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function mo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function go(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?go(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):go(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var bo=function(e,t,n){var r=n.filter((function(t){return t.groupIds.includes(e)}));return r.length<2?t.selectedGroupIds[e]||t.editingGroupId===e?vo(vo({},t),{},{selectedGroupIds:vo(vo({},t.selectedGroupIds),{},L({},e,!1)),editingGroupId:null}):t:vo(vo({},t),{},{selectedGroupIds:vo(vo({},t.selectedGroupIds),{},L({},e,!0)),selectedElementIds:vo(vo({},t.selectedElementIds),Object.fromEntries(r.map((function(e){return[e.id,!0]}))))})},yo=function(e,t){return null!=xo(e,t)},xo=function(e,t){return t.groupIds.filter((function(t){return t!==e.editingGroupId})).find((function(t){return e.selectedGroupIds[t]}))},wo=function(e){return Object.entries(e.selectedGroupIds).filter((function(e){var t=h(e,2);return t[0],t[1]})).map((function(e){var t=h(e,2),n=t[0];return t[1],n}))},ko=function(e,t){var n=vo(vo({},e),{},{selectedGroupIds:{}}),r=Dc(t,e);if(!r.length)return vo(vo({},n),{},{editingGroupId:null});var o,i=ho(r);try{for(i.s();!(o=i.n()).done;){var a=o.value.groupIds;if(e.editingGroupId){var l=a.indexOf(e.editingGroupId);l>-1&&(a=a.slice(0,l))}if(a.length>0){var s=a[a.length-1];n=bo(s,n,t)}}}catch(c){i.e(c)}finally{i.f()}return n},Eo=function(e,t){return e.groupIds.includes(t)},_o=function(e,t){return e.filter((function(e){return Eo(e,t)}))},So=function(e,t,n){var r=A(e),o=n?r.indexOf(n):-1,i=o>-1?o:r.length;return r.splice(i,0,t),r},Co=function(e){var t=new Map;return e.forEach((function(e){var n=0===e.groupIds.length?e.id:e.groupIds[e.groupIds.length-1],r=t.get(n)||[],o=kr(e);if(o){var i=cr.getScene(e).getElement(o);r.push(i)}t.set(n,[].concat(A(r),[e]))})),Array.from(t.values())},jo=["x","y","strokeColor","backgroundColor","fillStyle","strokeWidth","strokeStyle","roughness","opacity","width","height","angle","groupIds","strokeSharpness","boundElements","link"];function Oo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Io(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Oo(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Mo=function(e,t){var n,r,o=t.x,i=t.y,a=t.strokeColor,l=t.backgroundColor,s=t.fillStyle,c=t.strokeWidth,u=t.strokeStyle,d=t.roughness,f=t.opacity,p=t.width,h=void 0===p?0:p,m=t.height,g=void 0===m?0:m,v=t.angle,b=void 0===v?0:v,y=t.groupIds,x=void 0===y?[]:y,w=t.strokeSharpness,k=t.boundElements,E=void 0===k?null:k,_=t.link,S=void 0===_?null:_,C=po(t,jo);return{id:C.id||ro(),type:e,x:o,y:i,width:h,height:g,angle:b,strokeColor:a,backgroundColor:l,fillStyle:s,strokeWidth:c,strokeStyle:u,roughness:d,opacity:f,groupIds:x,strokeSharpness:w,seed:null!==(n=C.seed)&&void 0!==n?n:no(),version:C.version||1,versionNonce:null!==(r=C.versionNonce)&&void 0!==r?r:0,isDeleted:!1,boundElements:E,updated:Mn(),link:S}},To=function(e){return Mo(e.type,e)},Po=function(e,t){return{x:"center"===e.textAlign?t.width/2:"right"===e.textAlign?t.width:0,y:"middle"===e.verticalAlign?t.height/2:0}},Ao=function(e){var t=pr(e.text,dn(e)),n=Po(e,t);return lo(Io(Io({},Mo("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}),{})},Lo=function(e,t){var n=t.text,r=t.isDeleted,o=t.originalText,i=_r(e);i&&(n=br(n,dn(e),i.width));var a=function(e,t){var n=null,r=_r(e);r&&(n=r.width-2*c.gK);var o,i,a=pr(t,dn(e),n),l=a.width,s=a.height,u=a.baseline,d=e.textAlign,f=e.verticalAlign;if("center"!==d||"middle"!==f||e.containerId){var p=h(gt(e),4),m=p[0],g=p[1],v=p[2],b=p[3],y=h(_t(e,l,s),4),x=(m-y[0])/2,w=(g-y[1])/2,k=(v-y[2])/2,E=(b-y[3])/2,_=h(ot({s:!0,e:"center"===d||"left"===d,w:"center"===d||"right"===d},e.x,e.y,e.angle,x,w,k,E),2);o=_[0],i=_[1]}else{var S=pr(e.text,dn(e),n),C=Po(e,{width:l-S.width,height:s-S.height});o=e.x-C.x,i=e.y-C.y}if(tt(e)){var j=_r(e),O=j.height,I=j.width;s>O-2*c.gK&&(O=s+2*c.gK),l>I-2*c.gK&&(I=l+2*c.gK),O===j.height&&I===j.width||ao(j,{height:O,width:I})}return{width:l,height:s,x:Number.isFinite(o)?o:e.x,y:Number.isFinite(i)?i:e.y,baseline:u}}(e,n);return lo(e,Io({text:n,originalText:o,isDeleted:null!=r?r:e.isDeleted},a))},Do=function(e){return Io(Io({},Mo(e.type,e)),{},{points:e.points||[],lastCommittedPoint:null,startBinding:null,endBinding:null,startArrowhead:e.startArrowhead,endArrowhead:e.endArrowhead})},Ro=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(null==t||"object"!==P(t))return t;if("[object Object]"===Object.prototype.toString.call(t)){var r="function"==typeof t.constructor?Object.create(Object.getPrototypeOf(t)):{};for(var o in t)if(t.hasOwnProperty(o)){if(0===n&&("shape"===o||"canvas"===o))continue;r[o]=e(t[o],n+1)}return r}if(Array.isArray(t)){for(var i=t.length,a=new Array(i);i--;)a[i]=e(t[i],n+1);return a}return t},zo=function(e,t,n,r){var o,i,a=Ro(n);return Pn()?(a.id="".concat(a.id,"_copy"),null!==(o=window.h)&&void 0!==o&&null!==(i=o.app)&&void 0!==i&&i.getSceneElementsIncludingDeleted().find((function(e){return e.id===a.id}))&&(a.id+="_copy")):a.id=ro(),a.updated=Mn(),a.seed=no(),a.groupIds=function(e,t,n){for(var r=A(e),o=t?e.indexOf(t):-1,i=o>-1?o:e.length,a=0;a<i;a++)r[a]=n(r[a]);return r}(a.groupIds,e,(function(e){return t.has(e)||t.set(e,ro()),t.get(e)})),r&&(a=Object.assign(a,r)),a},No={mouse:8,pen:16,touch:28},Ho={e:!0,s:!0,n:!0,w:!0},Bo={e:!0,s:!0,n:!0,w:!0},Fo={e:!0,s:!0,n:!0,w:!0,nw:!0,se:!0},Uo={e:!0,s:!0,n:!0,w:!0,ne:!0,sw:!0},Ko=function(e,t,n,r,o,i,a){var l=h(nt(e+n/2,t+r/2,o,i,a),2);return[l[0]-n/2,l[1]-r/2,n,r]},Wo=function(e,t,n,r){var o=h(e,4),i=o[0],a=o[1],l=o[2],s=o[3],c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},u=No[r],d=u/n.value,f=u/n.value,p=u/n.value,m=u/n.value,g=l-i,v=s-a,b=(i+l)/2,y=(a+s)/2,x=4/n.value,w=(u-8)/(2*n.value),k={nw:c.nw?void 0:Ko(i-x-p+w,a-x-m+w,d,f,b,y,t),ne:c.ne?void 0:Ko(l+x-w,a-x-m+w,d,f,b,y,t),sw:c.sw?void 0:Ko(i-x-p+w,s+x-w,d,f,b,y,t),se:c.se?void 0:Ko(l+x-w,s+x-w,d,f,b,y,t),rotation:c.rotation?void 0:Ko(i+g/2-d/2,a-x-m+w-16/n.value,d,f,b,y,t)},E=5*No.mouse/n.value;return Math.abs(g)>E&&(c.n||(k.n=Ko(i+g/2-d/2,a-x-m+w,d,f,b,y,t)),c.s||(k.s=Ko(i+g/2-d/2,s+x-w,d,f,b,y,t))),Math.abs(v)>E&&(c.w||(k.w=Ko(i-x-p+w,a+v/2-f/2,d,f,b,y,t)),c.e||(k.e=Ko(l+x-w,a+v/2-f/2,d,f,b,y,t))),k},Vo=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"mouse",r={};if("arrow"===e.type||"line"===e.type||"freedraw"===e.type){if(2===e.points.length){var o=h(e.points,2)[1];0===o[0]||0===o[1]?r=Uo:o[0]>0&&o[1]<0?r=Fo:o[0]>0&&o[1]>0?r=Uo:o[0]<0&&o[1]>0?r=Fo:o[0]<0&&o[1]<0&&(r=Uo)}}else Ge(e)&&(r=Bo);return Wo(gt(e),e.angle,t,n,r)},Go=function(e,t){return[0,0,0,0,t,e,1,0]},Zo=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[0,0,0,0,0,0,0,0];if(t<0||t>7)throw new Error("Expected `index` betwen 0 and 7, got `".concat(t,"`"));return 0!==e&&(n[t]=e),n},Yo=function(e){return[e[0],e[1],e[2],e[3],-e[4],-e[5],-e[6],-e[7]]},Xo=function(e,t){return ri(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]]},qo=function(e,t){return ri(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]:[$o(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]]},$o=function(e,t){return t[0]*e[0]+t[2]*e[2]+t[3]*e[3]-t[6]*e[6]},Qo=function(e,t){return[Jo(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]]},Jo=function(e,t){return e[0]*t[7]+e[1]*t[6]+e[2]*t[5]+e[3]*t[4]+e[4]*t[3]+e[5]*t[2]+e[6]*t[1]+e[7]*t[0]},ei=function(e){return Math.sqrt(Math.abs(e[0]*e[0]-e[2]*e[2]-e[3]*e[3]+e[6]*e[6]))},ti=function(e){var t=ei(e);if(0===t||1===t)return e;var n=e[6]<0?-1:1;return qo(e,n/t)},ni=function(e){var t,n=(t=e,Math.sqrt(Math.abs(t[7]*t[7]-t[5]*t[5]-t[4]*t[4]+t[1]*t[1])));return 0===n||1===n?e:qo(e,1/n)},ri=function(e){return"number"==typeof e},oi=(Zo(1,1),Zo(1,2),Zo(1,3),Zo(1,4),Zo(1,5),Zo(1,6),Zo(1,7),function(e,t,n){return ti([0,n,e,t,0,0,0,0])}),ii=function(e,t){return ti(Qo(t,e))},ai=function(e,t){return n=e,[(r=t)[0]*n[0]+r[2]*n[2]+r[3]*n[3]-r[6]*n[6],r[1]*n[0]+r[0]*n[1]-r[4]*n[2]+r[5]*n[3]+r[2]*n[4]-r[3]*n[5]-r[7]*n[6]-r[6]*n[7],r[2]*n[0]+r[0]*n[2]-r[6]*n[3]+r[3]*n[6],r[3]*n[0]+r[6]*n[2]+r[0]*n[3]-r[2]*n[6],r[4]*n[0]+r[7]*n[3]+r[0]*n[4]+r[3]*n[7],r[5]*n[0]+r[7]*n[2]+r[0]*n[5]+r[2]*n[7],r[6]*n[0]+r[0]*n[6],r[7]*n[0]+r[0]*n[7]];var n,r},li=function(e){var t=h(e,2),n=t[0];return[0,0,0,0,t[1],n,1,0]},si=function(e){return[e[5],e[4]]},ci=function(e,t){return ti((n=e,[(r=t)[0]*n[0],r[1]*n[0]+r[0]*n[1],r[2]*n[0]+r[0]*n[2],r[3]*n[0]+r[0]*n[3],r[4]*n[0]+r[2]*n[1]-r[1]*n[2]+r[0]*n[4],r[5]*n[0]-r[3]*n[1]+r[1]*n[3]+r[0]*n[5],r[6]*n[0]+r[3]*n[2]-r[2]*n[3]+r[0]*n[6],r[7]*n[0]+r[6]*n[1]+r[5]*n[2]+r[4]*n[3]+r[3]*n[4]+r[2]*n[5]+r[1]*n[6]]));var n,r},ui=function(e,t){return ei(Qo(e,t))},di=function(e,t){return Jo(e,t)},fi=function(e){return[0,0,0,0,e[4],e[5],0,0]},pi=function(e,t){return n=qo(e,Math.sin(t/2)),r=Math.cos(t/2),ri(r)?[n[0]+r,n[1],n[2],n[3],n[4],n[5],n[6],n[7]]:[n[0]+r[0],n[1]+r[1],n[2]+r[2],n[3]+r[3],n[4]+r[4],n[5]+r[5],n[6]+r[6],n[7]+r[7]];var n,r},hi=function(e,t){return ti(qo(qo(e,t),Yo(e)))};function mi(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return gi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gi(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function gi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var vi=function(e,t,n,r){var o=10/t.zoom.value,i=[n,r];return xi(t,e)?wi(e,i,o):yi(e,t,i)},bi=function(e,t,n,r){var o=10/t.zoom.value;return!yi(e,t,[n,r])&&wi(e,[n,r],o)},yi=function(e,t,n){var r=10/t.zoom.value,o=Ge(e)?Ci:function(e){if("arrow"===e.type)return!1;if("freedraw"===e.type)return!0;var t=!jn(e.backgroundColor)||et(e);return"line"===e.type?t&&at(e.points):t||Ve(e)}(e)?ji:Oi;return _i({element:e,point:n,threshold:r,check:o})},xi=function(e,t){return e.selectedElementIds[t.id]},wi=function(e,t,n){var r=h(t,2),o=r[0],i=r[1],a=h(gt(e),4),l=a[0],s=a[1],c=a[2],u=a[3],d=h(nt(o,i,(l+c)/2,(s+u)/2,-e.angle),2),f=d[0],p=d[1];return f>l-n&&f<c+n&&p>s-n&&p<u+n},ki=function(e,t){var n=t.x,r=t.y,o=Ei(e,e.width,e.height);return _i({element:e,point:[n,r],threshold:o,check:Ii})},Ei=function(e,t,n){var r=("diamond"===e.type?1/Math.sqrt(2):1)*Math.min(t,n);return Math.max(16,Math.min(.25*r,32))},_i=function(e){switch(e.element.type){case"rectangle":case"image":case"text":case"diamond":case"ellipse":var t=Si(e.element,e.point);return e.check(t,e.threshold);case"freedraw":return!!e.check(Mi(e.element,e.point),e.threshold)&&Li(e.element,e.point,e.threshold);case"arrow":case"line":return Di(e);case"selection":return console.warn("This should not happen, we need to investigate why it does."),!1}},Si=function(e,t){switch(e.type){case"rectangle":case"image":case"text":return Mi(e,t);case"diamond":return Ti(e,t);case"ellipse":return Pi(e,t)}},Ci=function(e,t){return e<0},ji=function(e,t){return e<t},Oi=function(e,t){return Math.abs(e)<t},Ii=function(e,t){return 0<=e&&e<t},Mi=function(e,t){var n=h(Ri(e,t),4),r=n[1],o=n[2],i=n[3];return Math.max(di(r,oi(0,1,-i)),di(r,oi(1,0,-o)))},Ti=function(e,t){var n=h(Ri(e,t),4),r=n[1],o=n[2],i=n[3],a=oi(i,o,-i*o);return di(r,a)},Pi=function(e,t){var n,r=h(Ai(e,t),2),o=r[0],i=r[1];return n=i,-Math.sign(n[1])*di(o,i)},Ai=function(e,t){var n=h(Ri(e,t),4),r=n[1],o=n[2],i=n[3],a=h(si(r),2),l=a[0],s=a[1],c=.707,u=.707,d=o,f=i;[0,1,2,3].forEach((function(e){var t=d*c,n=f*u,r=(d*d-f*f)*Math.pow(c,3)/d,o=(f*f-d*d)*Math.pow(u,3)/f,i=t-r,a=n-o,p=l-r,h=s-o,m=Math.hypot(a,i),g=Math.hypot(h,p);c=Math.min(1,Math.max(0,(p*m/g+r)/d)),u=Math.min(1,Math.max(0,(h*m/g+o)/f));var v=Math.hypot(u,c);c/=v,u/=v}));var p,m=Go(d*c,f*u);return[r,ai(ii(r,p=m),p)]},Li=function(e,t,n){var r,o;if(0===e.angle)r=t[0]-e.x,o=t[1]-e.y;else{var i=h(gt(e),4),a=i[0],l=i[1],s=i[2],c=i[3],u=rt(t,[a+(s-a)/2,l+(c-l)/2],-e.angle);r=u[0]-e.x,o=u[1]-e.y}var d,f=h(e.points,2),p=f[0],m=f[1];if(it(p[0],p[1],r,o)<n||it(m[0],m[1],r,o)<n)return!0;for(var g=0;g<e.points.length;g++){var v=[m[0]-p[0],m[1]-p[1]],b=Math.hypot(v[1],v[0]),y=[v[0]/b,v[1]/b],x=[r-p[0],o-p[1]],w=(x[0]*y[0]+x[1]*y[1])/Math.hypot(y[1],y[0]);d=[p[0]+y[0]*w,p[1]+y[1]*w];var k=it(d[0],d[1],p[0],p[1]),E=it(d[0],d[1],m[0],m[1]);if(d=E<k&&k>b?m:k<E&&E>b?p:d,Math.hypot(o-d[1],r-d[0])<n)return!0;p=m,m=e.points[g+1]}var _=Hr(e);return!(!_||!_.sets.length)&&Xi(_,r,o,n)},Di=function(e){var t=e.element,n=e.threshold;if(!Hr(t))return!1;var r=h(Ri(e.element,e.point),4),o=r[0],i=r[1],a=r[2],l=r[3],s=oi(0,1,-l),c=oi(1,0,-a);if(!ji(di(i,s),n)||!ji(di(i,c),n))return!1;var u=h(si(o),2),d=u[0],f=u[1],p=Hr(t);return!!p&&(!(e.check!==ji||!p.some((function(e){return Yi(e,d,f,t.strokeSharpness)})))||p.some((function(e){return Xi(e,d,f,n)})))},Ri=function(e,t){var n,r=li(t),o=gt(e),i=Ni(o),a=pi(i,e.angle),l=hi(a,r),s=(n=Xo(l,fi(i)),[0,0,0,0,Math.abs(n[4]),Math.abs(n[5]),1,0]),c=function(e,t){return[0,0,0,0,t,e,0,0]}(e.x,e.y),u=Xo(l,c),d=h(o,4),f=d[0],p=d[1];return[u,s,(d[2]-f)/2,(d[3]-p)/2]},zi=function(e){var t,n=gt(e),r=Ni(n),o=pi(r,e.angle),i=Yo([1,0,0,0,-.5*(t=fi(r))[5],.5*t[4],0,0]);return qo(i,o)},Ni=function(e){var t=h(e,4),n=t[0],r=t[1],o=t[2],i=t[3];return Go((n+o)/2,(r+i)/2)},Hi=function(e,t,n){var r=zi(e),o=hi(r,li(t)),i=hi(r,li(n)),a=ii(o,i),l=e.height/e.width,s=e.width/2,c=e.height/2,u=a[2],d=a[3],f=a[1],p=Math.abs(d),h=Math.abs(u);switch(e.type){case"rectangle":case"image":case"text":return f/(s*(h+l*p));case"diamond":return p<h?f/(h*s):f/(p*c);case"ellipse":return f/(s*Math.sqrt(Math.pow(u,2)+Math.pow(l,2)*Math.pow(d,2)))}},Bi=function(e,t,n){var r,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;switch(e.type){case"rectangle":case"image":case"text":case"diamond":var i=Fi(e);r=i.flatMap((function(e,n){var r=[e,i[(n+1)%4]];return Ui(t,Ki(r,o))})).concat(i.flatMap((function(e){return Vi(e,o,t)})));break;case"ellipse":r=Wi(e,o,t)}if(r.length<2)return[];var a=r.sort((function(e,t){return ui(e,n)-ui(t,n)}));return[a[0],a[a.length-1]]},Fi=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=t*e.width/2,r=t*e.height/2;switch(e.type){case"rectangle":case"image":case"text":return[Go(n,r),Go(n,-r),Go(-n,-r),Go(-n,r)];case"diamond":return[Go(0,r),Go(n,0),Go(0,-r),Go(-n,0)]}},Ui=function(e,t){var n=h(t,2),r=n[0],o=n[1];return di(r,e)*di(o,e)>=0?[]:[ci(e,ii(r,o))]},Ki=function(e,t){var n,r,o=h(e,2),i=o[0],a=o[1],l=function(e,t){var n=.5*t;return[1,0,0,0,n*e[4],n*e[5],0,0]}((n=i,ni([0,0,0,0,(r=a)[4]-n[4],r[5]-n[5],0,0])),t);return[hi(l,i),hi(l,a)]},Wi=function(e,t,n){var r=e.width/2+t,o=e.height/2+t,i=n[2],a=n[3],l=n[1],s=r*r*i*i+o*o*a*a,c=s-l*l;if(0===s||c<=0)return[];var u=Math.sqrt(c),d=-r*r*i*l,f=-o*o*a*l;return[Go((d+r*o*a*u)/s,(f-r*o*i*u)/s),Go((d-r*o*a*u)/s,(f+r*o*i*u)/s)]},Vi=function(e,t,n){if(0===t)return 0===di(n,e)?[e]:[];var r=n[2],o=n[3],i=n[1],a=h(si(e),2),l=a[0],s=a[1],c=r*r+o*o,u=t*t*c-Math.pow(r*l+o*s+i,2);if(0===c||u<=0)return[];var d=Math.sqrt(u),f=l*o*o-s*r*o-r*i,p=s*r*r-l*r*o-o*i;return[Go((f+o*d)/c,(p-r*d)/c),Go((f-o*d)/c,(p+r*d)/c)]},Gi=function(e,t,n){var r=Math.abs(t),o=e.width*r/2,i=e.height*r/2,a=Math.sign(t),l=h(si(n),2),s=l[0],c=l[1],u=0===c?1e-4:c,d=Math.pow(s,2)*Math.pow(i,2)+Math.pow(u,2)*Math.pow(o,2),f=(-s*Math.pow(i,2)+a*u*Math.sqrt(Math.max(0,d-Math.pow(o,2)*Math.pow(i,2))))/d,p=(-f*s-1)/u,m=-Math.pow(o,2)*f/(Math.pow(p,2)*Math.pow(i,2)+Math.pow(f,2)*Math.pow(o,2));return Go(m,(-f*m-1)/p)},Zi=function(e,t,n){var r=Math.abs(t),o=Math.sign(t),i=Fi(e,r),a=0,l=null;return i.forEach((function(e){var t=o*ii(n,e)[1];t>a&&(a=t,l=e)})),l},Yi=function(e,t,n,r){var o,i=[],a=!1,l=mi(vt(e));try{for(l.s();!(o=l.n()).done;){var s=o.value;"move"===s.op?(a=!a)&&i.push([s.data[0],s.data[1]]):"bcurveTo"===s.op?a&&(i.push([s.data[0],s.data[1]]),i.push([s.data[2],s.data[3]]),i.push([s.data[4],s.data[5]])):"lineTo"===s.op&&a&&i.push([s.data[0],s.data[1]])}}catch(u){l.e(u)}finally{l.f()}if(i.length>=4){if("sharp"===r)return lt(i,t,n);var c=Le(i,10,5);return lt(c,t,n)}return!1},Xi=function(e,t,n,r){var o=vt(e),i=[0,0];return o.some((function(o,a){var l=o.op,s=o.data;if("move"===l)i=s;else{if("bcurveTo"===l){var c=[s[0],s[1]],u=[s[2],s[3]],d=[s[4],s[5]],f=i;return i=d,function(e,t,n,r,o,i){for(var a=h(o,2),l=a[0],s=a[1],c=function(o,i){return Math.pow(1-o,3)*r[i]+3*o*Math.pow(1-o,2)*n[i]+3*Math.pow(o,2)*(1-o)*t[i]+e[i]*Math.pow(o,3)},u=0;u<=1;){var d=c(u,0),f=c(u,1);if(Math.sqrt(Math.pow(d-l,2)+Math.pow(f-s,2))<i)return!0;u+=.01}return!1}(f,c,u,d,[t,n],r)}if("lineTo"===l)return Yi(e,t,n,"sharp");"qcurveTo"===l&&console.warn("qcurveTo is not implemented yet")}return!1}))},qi=["rotation"],$i=function(e,t,n){return t>=e[0]&&t<=e[0]+e[2]&&n>=e[1]&&n<=e[1]+e[3]},Qi=function(e,t,n,r,o,i){return e.reduce((function(e,a){if(e)return e;var l=function(e,t,n,r,o,i){if(!t.selectedElementIds[e.id])return!1;var a=Vo(e,o,i),l=a.rotation,s=po(a,qi);if(l&&$i(l,n,r))return"rotation";var c=Object.keys(s).filter((function(e){var t=s[e];return!!t&&$i(t,n,r)}));return c.length>0&&c[0]}(a,t,n,r,o,i);return l?{element:a,transformHandleType:l}:null}),null)},Ji=function(e,t,n,r,o){var i=h(e,4),a=i[0],l=i[1],s=i[2],c=i[3],u=Wo([a,l,s,c],0,r,o,Ho);return Object.keys(u).find((function(e){var r=u[e];return r&&$i(r,t,n)}))||!1},ea=["ns","nesw","ew","nwse"],ta=function(e){var t=e.element,n=e.transformHandleType,r=t&&Math.sign(t.height)*Math.sign(t.width)==-1,o=null;switch(n){case"n":case"s":o="ns";break;case"w":case"e":o="ew";break;case"nw":case"se":o=r?"nesw":"nwse";break;case"ne":case"sw":o=r?"nwse":"nesw";break;case"rotation":return"grab"}return o&&t&&(o=function(e,t){var n=ea.indexOf(e);if(n>=0){var r=Math.round(t/(Math.PI/4));e=ea[(n+r)%ea.length]}return e}(o,t.angle)),o?"".concat(o,"-resize"):""};function na(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ra(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ra(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function ra(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function oa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ia(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oa(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oa(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var aa=function(){function e(t,n){D(this,e),this.elementId=t.id,cr.mapElementToScene(this.elementId,n),e.normalizePoints(t),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}}return z(e,null,[{key:"getElement",value:function(e){var t;return(null===(t=cr.getScene(e))||void 0===t?void 0:t.getNonDeletedElement(e))||null}},{key:"handleBoxSelection",value:function(t,n,r){var o;if(!n.editingLinearElement||"selection"!==(null===(o=n.draggingElement)||void 0===o?void 0:o.type))return!1;var i=n.editingLinearElement,a=i.selectedPointsIndices,l=i.elementId,s=e.getElement(l);if(!s)return!1;var c=h(gt(n.draggingElement),4),u=c[0],d=c[1],f=c[2],p=c[3],m=e.getPointsGlobalCoordinates(s).reduce((function(e,n,r){return(n[0]>=u&&n[0]<=f&&n[1]>=d&&n[1]<=p||t.shiftKey&&null!=a&&a.includes(r))&&e.push(r),e}),[]);r({editingLinearElement:ia(ia({},i),{},{selectedPointsIndices:m.length?m:null})})}},{key:"handlePointDragging",value:function(t,n,r,o,i){if(!t.editingLinearElement)return!1;var a=t.editingLinearElement,l=a.selectedPointsIndices,s=a.elementId,c=a.isDragging,u=e.getElement(s);if(!u)return!1;var d=u.points[a.pointerDownState.lastClickedPoint];if(l&&d){!1===c&&n({editingLinearElement:ia(ia({},a),{},{isDragging:!0})});var f=e.createPointAt(u,r-a.pointerOffset.x,o-a.pointerOffset.y,t.gridSize),p=f[0]-d[0],h=f[1]-d[1];if(e.movePoints(u,l.map((function(n){return{index:n,point:n===a.pointerDownState.lastClickedPoint?e.createPointAt(u,r-a.pointerOffset.x,o-a.pointerOffset.y,t.gridSize):[u.points[n][0]+p,u.points[n][1]+h],isDragging:n===a.pointerDownState.lastClickedPoint}}))),$e(u)){var m=[];0===l[0]&&m.push(Sn(e.getPointGlobalCoordinates(u,u.points[0])));var g=l[l.length-1];g===u.points.length-1&&m.push(Sn(e.getPointGlobalCoordinates(u,u.points[g]))),m.length&&i(u,m)}return!0}return!1}},{key:"handlePointerUp",value:function(t,n,r){var o,i=n.elementId,a=n.selectedPointsIndices,l=n.isDragging,s=n.pointerDownState,c=e.getElement(i);if(!c)return n;var u={};if(l&&a){var d,f=na(a);try{for(f.s();!(d=f.n()).done;){var p=d.value;if(0===p||p===c.points.length-1){at(c.points,r.zoom.value)&&e.movePoints(c,[{index:p,point:0===p?c.points[c.points.length-1]:c.points[0]}]);var h=ca(r)?xa(Sn(e.getPointAtIndexGlobalCoordinates(c,p)),cr.getScene(c)):null;u[0===p?"startBindingElement":"endBindingElement"]=h}}}catch(m){f.e(m)}finally{f.f()}}return ia(ia(ia({},n),u),{},{selectedPointsIndices:l||t.shiftKey?!l&&t.shiftKey&&null!==(o=s.prevSelectedPointsIndices)&&void 0!==o&&o.includes(s.lastClickedPoint)?a&&a.filter((function(e){return e!==s.lastClickedPoint})):a:null!=a&&a.includes(s.lastClickedPoint)?[s.lastClickedPoint]:a,isDragging:!1,pointerOffset:{x:0,y:0}})}},{key:"handlePointerDown",value:function(t,n,r,o,i){var a,l={didAddPoint:!1,hitElement:null};if(!n.editingLinearElement)return l;var s=n.editingLinearElement.elementId,c=e.getElement(s);if(!c)return l;if(t.altKey)return null==n.editingLinearElement.lastUncommittedPoint&&ao(c,{points:[].concat(A(c.points),[e.createPointAt(c,i.x,i.y,n.gridSize)])}),o.resumeRecording(),r({editingLinearElement:ia(ia({},n.editingLinearElement),{},{pointerDownState:{prevSelectedPointsIndices:n.editingLinearElement.selectedPointsIndices,lastClickedPoint:-1},selectedPointsIndices:[c.points.length-1],lastUncommittedPoint:null,endBindingElement:xa(i,cr.getScene(c))})}),l.didAddPoint=!0,l;var u=e.getPointIndexUnderCursor(c,n.zoom,i.x,i.y);if(u>-1)l.hitElement=c;else{var d=n.editingLinearElement,f=d.startBindingElement,p=d.endBindingElement;ca(n)&&$e(c)&&ua(c,f,p)}var m=h(gt(c),4),g=m[0],v=m[1],b=(g+m[2])/2,y=(v+m[3])/2,x=u>-1&&nt(c.x+c.points[u][0],c.y+c.points[u][1],b,y,c.angle),w=u>-1||t.shiftKey?t.shiftKey||null!==(a=n.editingLinearElement.selectedPointsIndices)&&void 0!==a&&a.includes(u)?la([].concat(A(n.editingLinearElement.selectedPointsIndices||[]),[u])):[u]:null;return r({editingLinearElement:ia(ia({},n.editingLinearElement),{},{pointerDownState:{prevSelectedPointsIndices:n.editingLinearElement.selectedPointsIndices,lastClickedPoint:u},selectedPointsIndices:w,pointerOffset:x?{x:i.x-x[0],y:i.y-x[1]}:{x:0,y:0}})}),l}},{key:"handlePointerMove",value:function(t,n,r,o,i){var a=o.elementId,l=o.lastUncommittedPoint,s=e.getElement(a);if(!s)return o;var c=s.points,u=c[c.length-1];if(!t.altKey)return u===l&&e.deletePoints(s,[c.length-1]),ia(ia({},o),{},{lastUncommittedPoint:null});var d=e.createPointAt(s,n-o.pointerOffset.x,r-o.pointerOffset.y,i);return u===l?e.movePoints(s,[{index:s.points.length-1,point:d}]):e.addPoints(s,[{point:d}]),ia(ia({},o),{},{lastUncommittedPoint:s.points[s.points.length-1]})}},{key:"getPointGlobalCoordinates",value:function(e,t){var n=h(gt(e),4),r=n[0],o=n[1],i=(r+n[2])/2,a=(o+n[3])/2,l=e.x,s=e.y,c=h(nt(l+t[0],s+t[1],i,a,e.angle),2);return[l=c[0],s=c[1]]}},{key:"getPointsGlobalCoordinates",value:function(e){var t=h(gt(e),4),n=t[0],r=t[1],o=t[2],i=t[3],a=(n+o)/2,l=(r+i)/2;return e.points.map((function(t){var n=e.x,r=e.y,o=h(nt(n+t[0],r+t[1],a,l,e.angle),2);return[n=o[0],r=o[1]]}))}},{key:"getPointAtIndexGlobalCoordinates",value:function(e,t){var n=t<0?e.points.length+t:t,r=h(gt(e),4),o=r[0],i=r[1],a=(o+r[2])/2,l=(i+r[3])/2,s=e.points[n],c=e.x,u=e.y;return nt(c+s[0],u+s[1],a,l,e.angle)}},{key:"pointFromAbsoluteCoords",value:function(e,t){var n=h(gt(e),4),r=n[0],o=n[1],i=(r+n[2])/2,a=(o+n[3])/2,l=h(nt(t[0],t[1],i,a,-e.angle),2),s=l[0],c=l[1];return[s-e.x,c-e.y]}},{key:"getPointIndexUnderCursor",value:function(e,t,n,r){for(var o=this.getPointsGlobalCoordinates(e),i=o.length;--i>-1;){var a=o[i];if(it(n,r,a[0],a[1])*t.value<this.POINT_HANDLE_SIZE/2+1)return i}return-1}},{key:"createPointAt",value:function(e,t,n,r){var o=dt(t,n,r),i=h(gt(e),4),a=i[0],l=i[1],s=(a+i[2])/2,c=(l+i[3])/2,u=h(nt(o[0],o[1],s,c,-e.angle),2),d=u[0],f=u[1];return[d-e.x,f-e.y]}},{key:"getNormalizedPoints",value:function(e){var t=e.points,n=t[0][0],r=t[0][1];return{points:t.map((function(e,t){return[e[0]-n,e[1]-r]})),x:e.x+n,y:e.y+r}}},{key:"normalizePoints",value:function(t){ao(t,e.getNormalizedPoints(t))}},{key:"duplicateSelectedPoints",value:function(t){if(!t.editingLinearElement)return!1;var n=t.editingLinearElement,r=n.selectedPointsIndices,o=n.elementId,i=e.getElement(o);if(!i||null===r)return!1;var a=i.points,l=[],s=!1,c=-1,u=a.reduce((function(e,t,n){if(++c,e.push(t),r.includes(n)){var o=a[n+1];o||(s=!0),e.push(o?[(t[0]+o[0])/2,(t[1]+o[1])/2]:[t[0],t[1]]),l.push(c+1),++c}return e}),[]);if(ao(i,{points:u}),s){var d=i.points[i.points.length-1];e.movePoints(i,[{index:i.points.length-1,point:[d[0]+30,d[1]+30]}])}return{appState:ia(ia({},t),{},{editingLinearElement:ia(ia({},t.editingLinearElement),{},{selectedPointsIndices:l})})}}},{key:"deletePoints",value:function(t,n){var r=0,o=0;if(n.includes(0)){var i=t.points.find((function(e,t){return!n.includes(t)}));i&&(r=i[0],o=i[1])}var a=t.points.reduce((function(e,t,i){return n.includes(i)||e.push(e.length?[t[0]-r,t[1]-o]:[0,0]),e}),[]);e._updatePoints(t,a,r,o)}},{key:"addPoints",value:function(t,n){var r=[].concat(A(t.points),A(n.map((function(e){return e.point}))));e._updatePoints(t,r,0,0)}},{key:"movePoints",value:function(t,n,r){var o=t.points,i=0,a=0,l=n.find((function(e){return 0===e.index}));l&&(i=l.point[0]-o[l.index][0],a=l.point[1]-o[l.index][1]);var s=o.map((function(e,t){var r=n.find((function(e){return e.index===t}));if(r){if(l)return e;var s=r.point[0]-o[r.index][0],c=r.point[1]-o[r.index][1];return[e[0]+s,e[1]+c]}return i||a?[e[0]-i,e[1]-a]:e}));e._updatePoints(t,s,i,a,r)}},{key:"_updatePoints",value:function(e,t,n,r,o){var i=St(e,t,e.strokeSharpness||"round"),a=St(e,e.points,e.strokeSharpness||"round"),l=(i[0]+i[2])/2,s=(i[1]+i[3])/2,c=(a[0]+a[2])/2,u=(a[1]+a[3])/2,d=nt(n,r,c-l,u-s,e.angle);ao(e,ia(ia({},o),{},{points:t,x:e.x+d[0],y:e.y+d[1]}))}}]),e}();aa.POINT_HANDLE_SIZE=20;var la=function(e){var t=A(new Set(e.filter((function(e){return null!==e&&-1!==e}))));return(t=t.sort((function(e,t){return e-t}))).length?t:null};function sa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var ca=function(e){return e.isBindingEnabled},ua=function(e,t,n){var r=new Set,o=new Set;da(e,t,n,"start",r,o),da(e,n,t,"end",r,o);var i=Array.from(o).filter((function(e){return!r.has(e)}));cr.getScene(e).getNonDeletedElements(i).forEach((function(t){var n;ao(t,{boundElements:null===(n=t.boundElements)||void 0===n?void 0:n.filter((function(t){return"arrow"!==t.type||t.id!==e.id}))})}))},da=function(e,t,n,r,o,i){if("keep"!==t)if(null!=t)null!=n&&("keep"===n?ga(e,t,r):"start"!==r&&n.id===t.id)||(ma(e,t,r),o.add(t.id));else{var a=ya(e,r);null!=a&&i.add(a)}},fa=function(e){e.forEach((function(e){$e(e)?ua(e,Oa(e,"start"),Oa(e,"end")):Je(e)&&pa(e)}))},pa=function(e){Ma(e).forEach((function(t){var n=h(t,2),r=n[0],o=n[1];return ua(r,"end"===o?"keep":e,"start"===o?"keep":e)}))},ha=function(e,t,n,r){null!=t.startBoundElement&&ma(e,t.startBoundElement,"start");var o=xa(r,n);null==o||ga(e,o,"end")||ma(e,o,"end")},ma=function(e,t,n){ao(e,L({},"start"===n?"startBinding":"endBinding",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sa(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sa(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({elementId:t.id},wa(e,t,n)))),Tn(t.boundElements||[]).has(e.id)||ao(t,{boundElements:(t.boundElements||[]).concat({id:e.id,type:"arrow"})})},ga=function(e,t,n){var r=e["start"===n?"endBinding":"startBinding"];return va(e,null==r?void 0:r.elementId,t)},va=function(e,t,n){return t===n.id&&e.points.length<3},ba=function(e){e.forEach((function(e){$e(e)&&ua(e,null,null)}))},ya=function(e,t){var n="start"===t?"startBinding":"endBinding",r=e[n];return null==r?null:(ao(e,L({},n,null)),r.elementId)},xa=function(e,t){return Os(t.getElements(),(function(t){return Je(t)&&ki(t,e)}))},wa=function(e,t,n){var r="start"===n?-1:1,o=-1===r?0:e.points.length-1,i=o-r,a=aa.getPointAtIndexGlobalCoordinates(e,o),l=aa.getPointAtIndexGlobalCoordinates(e,i);return{focus:Hi(t,l,a),gap:Math.max(1,Si(t,a))}},ka=function(e,t){var n,r=(null!==(n=e.boundElements)&&void 0!==n?n:[]).filter((function(e){return"arrow"===e.type}));if(0!==r.length){var o=null!=t?t:{},i=o.newSize,a=o.simultaneouslyUpdated,l=_a(a);cr.getScene(e).getNonDeletedElements(r.map((function(e){return e.id}))).forEach((function(t){if(Xe(t)){var n=e;if(Ea(t,n)){var r=Ca(n,t.startBinding,i),o=Ca(n,t.endBinding,i);l.has(t.id)?ao(t,{startBinding:r,endBinding:o}):(Sa(t,"start",r,e),Sa(t,"end",o,e))}}}))}},Ea=function(e,t){var n,r;return(null===(n=e.startBinding)||void 0===n?void 0:n.elementId)===t.id||(null===(r=e.endBinding)||void 0===r?void 0:r.elementId)===t.id},_a=function(e){return new Set((e||[]).map((function(e){return e.id})))},Sa=function(e,t,n,r){if(!(null==n||n.elementId!==r.id&&e.points.length>2)){var o=cr.getScene(e).getElement(n.elementId);if(null!=o){var i,a="start"===t?-1:1,l=-1===a?0:e.points.length-1,s=l-a,c=aa.getPointAtIndexGlobalCoordinates(e,s),u=function(e,t,n){if(0===t){var r=gt(e),o=Ni(r);return si(o)}var i,a=zi(e),l=hi(a,li(n)),s=Yo(a);switch(e.type){case"rectangle":case"image":case"text":case"diamond":i=Zi(e,t,l);break;case"ellipse":i=Gi(e,t,l)}return si(hi(s,i))}(o,n.focus,c);if(0===n.gap)i=u;else{var d=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=zi(e),i=hi(o,li(t)),a=hi(o,li(n)),l=ii(i,a),s=Yo(o);return Bi(e,l,i,r).map((function(e){return si(hi(s,e))}))}(o,c,u,n.gap);i=0===d.length?u:d[0]}aa.movePoints(e,[{index:l,point:aa.pointFromAbsoluteCoords(e,i)}],L({},"start"===t?"startBinding":"endBinding",n))}}},Ca=function(e,t,n){if(null==t||null==n)return t;var r=t.gap,o=t.focus,i=t.elementId,a=n.width,l=n.height,s=e.width,c=e.height;return{elementId:i,gap:Math.max(1,Math.min(Ei(e,a,l),r*(a<l?a/s:l/c))),focus:o}},ja=function(e){return[Oa(e,"start"),Oa(e,"end")].filter((function(e){return null!=e}))},Oa=function(e,t){return xa(Ia(e,t),cr.getScene(e))},Ia=function(e,t){var n="start"===t?0:-1;return Sn(aa.getPointAtIndexGlobalCoordinates(e,n))},Ma=function(e){return cr.getScene(e).getElements().map((function(t){if(!$e(t))return null;var n=Ta(t,"start",e),r=Ta(t,"end",e);return n||r?[t,n&&r?"both":n?"start":"end",e]:null})).filter((function(e){return null!=e}))},Ta=function(e,t,n){return null==e["start"===t?"startBinding":"endBinding"]&&!ga(e,n,t)&&ki(n,Ia(e,t))},Pa=function(e,t,n,r){var o=new Set,i=new Set,a="duplicatesServeAsOld"===r;t.forEach((function(e){var t=e.boundElements;if(null!=t&&t.length>0&&(t.forEach((function(e){a&&!n.has(e.id)&&o.add(e.id)})),i.add(n.get(e.id))),$e(e)){if(null!=e.startBinding){var r=e.startBinding.elementId;a&&!n.has(r)&&i.add(r)}if(null!=e.endBinding){var l=e.endBinding.elementId;a&&!n.has(l)&&i.add(l)}null==e.startBinding&&null==e.endBinding||o.add(n.get(e.id))}})),e.filter((function(e){var t=e.id;return o.has(t)})).forEach((function(e){var t=e.startBinding,r=e.endBinding;ao(e,{startBinding:Aa(t,n),endBinding:Aa(r,n)})})),e.filter((function(e){var t=e.id;return i.has(t)})).forEach((function(e){var t=e.boundElements;null!=t&&t.length>0&&ao(e,{boundElements:t.map((function(e){return n.has(e.id)?{id:n.get(e.id),type:e.type}:e}))})}))},Aa=function(e,t){var n;if(null==e)return null;var r=e.elementId;return{focus:e.focus,gap:e.gap,elementId:null!==(n=t.get(r))&&void 0!==n?n:r}},La=function(e,t){var n=new Set(t.map((function(e){return e.id}))),r=new Set;t.forEach((function(e){var t;Je(e)&&(null===(t=e.boundElements)||void 0===t||t.forEach((function(e){n.has(e.id)||r.add(e.id)})))})),e.filter((function(e){var t=e.id;return r.has(t)})).forEach((function(e){var t=e.startBinding,r=e.endBinding;ao(e,{startBinding:Da(t,n),endBinding:Da(r,n)})}))},Da=function(e,t){return null==e||t.has(e.elementId)?null:e};function Ra(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function za(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ra(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ra(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Na=function(e){return e>=2*Math.PI?e-2*Math.PI:e},Ha=function(e,t,n,r){var o=h(gt(e),4),i=o[0],a=o[1],l=(i+o[2])/2,s=(a+o[3])/2,u=5*Math.PI/2+Math.atan2(n-s,t-l);r&&(u+=c.ay/2,u-=u%c.ay),u=Na(u),ao(e,{angle:u});var d=kr(e);if(d){var f=cr.getScene(e).getElement(d);ao(f,{angle:u})}},Ba=function(e,t,n,r,o){var i,a,l,s,c,u=h(gt(e),4),d=u[0],f=u[1],p=u[2],m=u[3],g=h(nt(r,o,(d+p)/2,(f+m)/2,-e.angle),2),v=g[0],b=g[1],y=h("end"===t?[v-e.x,b-e.y]:[e.x+e.points[1][0]-v,e.y+e.points[1][1]-b],2),x=y[0],w=y[1];if(n){var k=h((i=e.type,a=x,l=w,s=e.angle,c=uo.apply(void 0,[i].concat(A(nt(a,l,0,0,s)))),nt(c.width,c.height,0,0,-s)),2);x=k[0],w=k[1]}var E=h(ot("end"===t?{s:!0,e:!0}:{n:!0,w:!0},e.x,e.y,e.angle,0,0,(e.points[1][0]-x)/2,(e.points[1][1]-w)/2),2),_=E[0],S=E[1];ao(e,{x:_,y:S,points:[[0,0],[x,w]]})},Fa=function(e,t,n){return Xe(e)||Ze(e)?{points:pt(0,t,pt(1,n,e.points))}:{}},Ua=function(e,t,n){var r=e.fontSize*(t/e.width);if(r<1)return null;var o=pr(e.text,dn({fontSize:r,fontFamily:e.fontFamily}),e.containerId?e.width:null);return{size:r,baseline:o.baseline+(n-o.height)}},Ka=function(e,t,n,r,o){var i,a,l,s=h(gt(e),4),c=s[0],u=s[1],d=s[2],f=s[3],p=h(nt(r,o,(c+d)/2,(u+f)/2,-e.angle),2),m=p[0],g=p[1];switch(t){case"se":i=Math.max((m-c)/(d-c),(g-u)/(f-u));break;case"nw":i=Math.max((d-m)/(d-c),(f-g)/(f-u));break;case"ne":i=Math.max((m-c)/(d-c),(f-g)/(f-u));break;case"sw":i=Math.max((d-m)/(d-c),(g-u)/(f-u))}if(i>0){var v=e.width*i,b=e.height*i,y=Ua(e,v,b);if(null===y)return;var x=h(_t(e,v,b),4),w=(c-x[0])/2,k=(u-x[1])/2,E=(d-x[2])/2,_=(f-x[3])/2,S=h(ot((l=n,{n:/^(n|ne|nw)$/.test(a=t)||l&&/^(s|se|sw)$/.test(a),s:/^(s|se|sw)$/.test(a)||l&&/^(n|ne|nw)$/.test(a),w:/^(w|nw|sw)$/.test(a)||l&&/^(e|ne|se)$/.test(a),e:/^(e|ne|se)$/.test(a)||l&&/^(w|nw|sw)$/.test(a)}),e.x,e.y,e.angle,w,k,E,_),2),C=S[0],j=S[1];ao(e,{fontSize:y.size,width:v,height:b,baseline:y.baseline,x:C,y:j})}},Wa=function(e,t,n,r,o,i,a){var l,s,c=h(_t(e,e.width,e.height),4),u=[c[0],c[1]],d=[c[2],c[3]],f=(s=d,[((l=u)[0]+s[0])/2,(l[1]+s[1])/2]),p=rt([i,a],f,-e.angle),m=h(_t(n,n.width,n.height),4),g=m[0],v=m[1],b=m[2],y=m[3],x=kr(n),w=b-g,k=y-v,E=(d[0]-u[0])/w,_=(d[1]-u[1])/k;r.includes("e")&&(E=(p[0]-u[0])/w),r.includes("s")&&(_=(p[1]-u[1])/k),r.includes("w")&&(E=(d[0]-p[0])/w),r.includes("n")&&(_=(d[1]-p[1])/k);var S=e.width,C=e.height,j=n.width*E,O=n.height*_;if(o&&(j=2*j-S,O=2*O-C),t){var I=Math.abs(j)/S,M=Math.abs(O)/C;if(1===r.length&&(O*=I,j*=M),2===r.length){var T=Math.max(I,M);j=S*T*Math.sign(j),O=C*T*Math.sign(O)}}var P=h(_t(e,j,O),4),L=P[0],D=P[1],R=P[2]-L,z=P[3]-D;if(!(R<0||z<0)||!x){var N=[].concat(u);if(["n","w","nw"].includes(r)&&(N=[d[0]-Math.abs(R),d[1]-Math.abs(z)]),"ne"===r){var H=[u[0],d[1]];N=[H[0],H[1]-Math.abs(z)]}if("sw"===r){var B=[d[0],u[1]];N=[B[0]-Math.abs(R),B[1]]}t&&(["s","n"].includes(r)&&(N[0]=f[0]-R/2),["e","w"].includes(r)&&(N[1]=f[1]-z/2)),j<0&&(r.includes("e")&&(N[0]-=Math.abs(R)),r.includes("w")&&(N[0]+=Math.abs(R))),O<0&&(r.includes("s")&&(N[1]-=Math.abs(z)),r.includes("n")&&(N[1]+=Math.abs(z))),o&&(N[0]=f[0]-Math.abs(R)/2,N[1]=f[1]-Math.abs(z)/2);var F=e.angle,U=rt(N,f,F),K=[N[0]+Math.abs(R)/2,N[1]+Math.abs(z)/2],W=rt(K,f,F);N=rt(U,W,-F);var V=Fa(e,j,O),G=A(N);G[0]+=e.x-L,G[1]+=e.y-D;var Z=za({width:Math.abs(j),height:Math.abs(O),x:G[0],y:G[1]},V);"scale"in n&&"scale"in e&&ao(n,{scale:[(Math.sign(E)||e.scale[0])*e.scale[0],(Math.sign(_)||e.scale[1])*e.scale[1]]});var Y=0,X=Er(n);X&&(Y=xr(dn(X))),Z.width>=Y&&0!==Z.height&&Number.isFinite(Z.x)&&Number.isFinite(Z.y)&&(ka(n,{newSize:{width:Z.width,height:Z.height}}),ao(n,Z),fr([n],r))}},Va=function(e,t,n,r){var o,i,a=h(Et(e),4),l=a[0],s=a[1],c=a[2],u=a[3];switch(t){case"se":o=Math.max((n-l)/(c-l),(r-s)/(u-s)),i=function(e,t,n){var r=h(t,2),i=r[0],a=r[1],c=h(n,2),u=c[0],d=c[1];return{x:e.x+(i-l)*(o-1)+i-u,y:e.y+(a-s)*(o-1)+a-d}};break;case"nw":o=Math.max((c-n)/(c-l),(u-r)/(u-s)),i=function(e,t,n){var r=h(t,4),i=r[2],a=r[3],l=h(n,4),s=l[2],d=l[3];return{x:e.x-(c-i)*(o-1)+i-s,y:e.y-(u-a)*(o-1)+a-d}};break;case"ne":o=Math.max((n-l)/(c-l),(u-r)/(u-s)),i=function(e,t,n){var r=h(t,4),i=r[0],a=r[3],s=h(n,4),c=s[0],d=s[3];return{x:e.x+(i-l)*(o-1)+i-c,y:e.y-(u-a)*(o-1)+a-d}};break;case"sw":o=Math.max((c-n)/(c-l),(r-s)/(u-s)),i=function(e,t,n){var r=h(t,3),i=r[1],a=r[2],l=h(n,3),u=l[1],d=l[2];return{x:e.x-(c-a)*(o-1)+a-d,y:e.y+(i-s)*(o-1)+i-u}}}if(o>0){var d=e.reduce((function(t,n){if(!t)return t;var r=n.width*o,a=n.height*o,l={};if(Ge(n)){var s=Ua(n,r,a);if(null===s)return null;l={fontSize:s.size,baseline:s.baseline}}var c=gt(n),u=Fa(n,r,a);ka(n,{newSize:{width:r,height:a},simultaneouslyUpdated:e});var d=_t(za(za({},n),u),r,a),f=i(n,c,d),p=f.x,h=f.y;return[].concat(A(t),[za(za({width:r,height:a,x:p,y:h},u),l)])}),[]);d&&e.forEach((function(e,t){ao(e,d[t])}))}},Ga=function(e,t,n,r,o,i,a){var l=5*Math.PI/2+Math.atan2(r-a,n-i);o&&(l+=c.ay/2,l-=l%c.ay),t.forEach((function(t,n){var r,o,s=h(gt(t),4),c=s[0],u=s[1],d=(c+s[2])/2,f=(u+s[3])/2,p=null!==(r=null===(o=e.originalElements.get(t.id))||void 0===o?void 0:o.angle)&&void 0!==r?r:t.angle,m=h(nt(d,f,i,a,l+p-t.angle),2),g=m[0],v=m[1];ao(t,{x:t.x+(g-d),y:t.y+(v-f),angle:Na(l+p)});var b=kr(t);if(b){var y=cr.getScene(t).getElement(b);ao(y,{x:y.x+(g-d),y:y.y+(v-f),angle:Na(l+p)})}}))},Za=function(e,t,n,r,o,i){var a,l;if(e){var s=e&&t<n,c=e&&t>n,u=r.originalElements.get(o.id);a=s&&u?u.x:o.x+i.x,l=c&&u?u.y:o.y+i.y}else a=o.x+i.x,l=o.y+i.y;ao(o,{x:a,y:l})},Ya=function(e,t,n,r,o,i,a,l,s,c,u){if(s)if(u)l=a/u;else{var d=uo(t,a,i<r?-l:l);a=d.width,(l=d.height)<0&&(l=-l)}var f=o<n?n-a:n,p=i<r?r-l:r;c&&(f=n-(a+=a)/2,p=r-(l+=l)/2),0!==a&&0!==l&&ao(e,{x:f,y:p,width:a,height:l})},Xa=function(e){var t=e.options,n=e.value,r=e.onChange,o=e.group;return(0,I.jsx)("div",{className:"buttonList buttonListIcon",children:t.map((function(e){return(0,I.jsxs)("label",{className:Ue({active:n===e.value}),title:e.text,children:[(0,I.jsx)("input",{type:"radio",name:o,onChange:function(){return r(e.value)},checked:n===e.value,"data-testid":e.testId}),e.icon]},e.text)}))})},qa=(n(4301),function(e){var t=e.children,n=e.left,r=e.top,o=e.onCloseRequest,i=e.fitInViewport,a=void 0!==i&&i,s=e.offsetLeft,c=void 0===s?0:s,u=e.offsetTop,d=void 0===u?0:u,f=e.viewportWidth,p=void 0===f?window.innerWidth:f,h=e.viewportHeight,m=void 0===h?window.innerHeight:h,g=(0,l.useRef)(null);return(0,l.useLayoutEffect)((function(){if(a&&g.current){var e=g.current,t=e.getBoundingClientRect(),n=t.x,r=t.y,o=t.width,i=t.height;n+o-c>p&&(e.style.left="".concat(p-o,"px")),r+i-d>m&&(e.style.top="".concat(m-i,"px"))}}),[a,p,m,c,d]),(0,l.useEffect)((function(){if(o){var e=function(e){var t;null!==(t=g.current)&&void 0!==t&&t.contains(e.target)||(0,Mt.unstable_batchedUpdates)((function(){return o(e)}))};return document.addEventListener("pointerdown",e,!1),function(){return document.removeEventListener("pointerdown",e,!1)}}}),[o]),(0,I.jsx)("div",{className:"popover",style:{top:r,left:n},ref:g,children:t})}),$a=(n(4220),function(e){var t=(new Option).style;return t.color=e,!!t.color}),Qa=[["1","2","3","4","5"],["q","w","e","r","t"],["a","s","d","f","g"]].flat(),Ja=function(e){var t=e.colors,n=e.color,r=e.onChange,o=e.onClose,i=e.label,a=e.showInput,l=void 0===a||a,c=e.type,u=s().useRef(),d=s().useRef(),f=s().useRef(),p=s().useRef();return s().useEffect((function(){d.current?d.current.focus():p.current?p.current.focus():f.current&&f.current.focus()}),[]),(0,I.jsxs)("div",{className:"color-picker color-picker-type-".concat(c),role:"dialog","aria-modal":"true","aria-label":O("labels.colorPicker"),onKeyDown:function(e){if(e.key===tn.TAB){var t,n=document.activeElement;if(e.shiftKey)n===u.current&&(null===(t=p.current)||void 0===t||t.focus(),e.preventDefault());else if(n===p.current){var r;null===(r=u.current)||void 0===r||r.focus(),e.preventDefault()}}else if(nn(e.key)){var i=document.activeElement,a=C().rtl,s=Array.prototype.indexOf.call(f.current.children,i);if(-1!==s){var c=f.current.children.length-(l?1:0),d=e.key===(a?tn.ARROW_LEFT:tn.ARROW_RIGHT)?(s+1)%c:e.key===(a?tn.ARROW_RIGHT:tn.ARROW_LEFT)?(c+s-1)%c:e.key===tn.ARROW_DOWN?(s+5)%c:e.key===tn.ARROW_UP?(c+s-5)%c:s;f.current.children[d].focus()}e.preventDefault()}else if(Qa.includes(e.key.toLowerCase())&&!cn(e.target)){var h=Qa.indexOf(e.key.toLowerCase());f.current.children[h].focus(),e.preventDefault()}else e.key!==tn.ESCAPE&&e.key!==tn.ENTER||(e.preventDefault(),o());e.nativeEvent.stopImmediatePropagation(),e.stopPropagation()},children:[(0,I.jsx)("div",{className:"color-picker-triangle color-picker-triangle-shadow"}),(0,I.jsx)("div",{className:"color-picker-triangle"}),(0,I.jsxs)("div",{className:"color-picker-content",ref:function(e){e&&(f.current=e)},tabIndex:0,children:[t.map((function(e,t){var o=e.replace("#","");return(0,I.jsxs)("button",{className:"color-picker-swatch",onClick:function(t){t.currentTarget.focus(),r(e)},title:"".concat(O("colors.".concat(o))).concat(jn(e)?"":" (".concat(e,")")," — ").concat(Qa[t].toUpperCase()),"aria-label":O("colors.".concat(o)),"aria-keyshortcuts":Qa[t],style:{color:e},ref:function(r){r&&0===t&&(u.current=r),r&&e===n&&(d.current=r)},onFocus:function(){r(e)},children:[jn(e)?(0,I.jsx)("div",{className:"color-picker-transparent"}):void 0,(0,I.jsx)("span",{className:"color-picker-keybinding",children:Qa[t]})]},e)})),l&&(0,I.jsx)(el,{color:n,label:i,onChange:function(e){r(e)},ref:p})]})]})},el=s().forwardRef((function(e,t){var n=e.color,r=e.onChange,o=e.label,i=h(s().useState(n),2),a=i[0],l=i[1],c=s().useRef(null);s().useEffect((function(){l(n)}),[n]),s().useImperativeHandle(t,(function(){return c.current}));var u=s().useCallback((function(e){var t,n=e.toLowerCase(),o=jn(t=n)||$a(t)?t:$a("#".concat(t))?"#".concat(t):null;o&&r(o),l(n)}),[r]);return(0,I.jsxs)("label",{className:"color-input-container",children:[(0,I.jsx)("div",{className:"color-picker-hash",children:"#"}),(0,I.jsx)("input",{spellCheck:!1,className:"color-picker-input","aria-label":o,onChange:function(e){return u(e.target.value)},value:(a||"").replace(/^#/,""),onBlur:function(){return l(n)},ref:c})]})})),tl=function(e){var t=e.type,n=e.color,r=e.onChange,o=e.label,i=e.isActive,a=e.setActive,l=s().useRef(null);return(0,I.jsxs)("div",{children:[(0,I.jsxs)("div",{className:"color-picker-control-container",children:[(0,I.jsx)("button",{className:"color-picker-label-swatch","aria-label":o,style:n?{"--swatch-color":n}:void 0,onClick:function(){return a(!i)},ref:l}),(0,I.jsx)(el,{color:n,label:o,onChange:function(e){r(e)}})]}),(0,I.jsx)(s().Suspense,{fallback:"",children:i?(0,I.jsx)(qa,{onCloseRequest:function(e){return e.target!==l.current&&a(!1)},children:(0,I.jsx)(Ja,{colors:It[t],color:n||null,onChange:function(e){r(e)},onClose:function(){var e;a(!1),null===(e=l.current)||void 0===e||e.focus()},label:o,showInput:!1,type:t})}):null})]})};function nl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nl(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ol(e){var t=e.options,n=e.value,r=e.label,o=e.onChange,i=e.onClose,a=s().useRef(),l=s().useRef(),c=s().useRef(null);return s().useEffect((function(){l.current?l.current.focus():c.current&&c.current.focus()}),[]),(0,I.jsx)("div",{className:"picker",role:"dialog","aria-modal":"true","aria-label":r,onKeyDown:function(e){var n=t.find((function(t){return t.keyBinding===e.key.toLowerCase()}));if(e.metaKey||e.altKey||e.ctrlKey||!n)if(e.key===tn.TAB)setTimeout((function(){l.current!==document.activeElement&&i()}),0);else if(nn(e.key)){var r=document.activeElement,o=C().rtl,a=Array.prototype.indexOf.call(c.current.children,r);if(-1!==a){var s=t.length,u=a;switch(e.key){case o?tn.ARROW_LEFT:tn.ARROW_RIGHT:case tn.ARROW_DOWN:u=(a+1)%s;break;case o?tn.ARROW_RIGHT:tn.ARROW_LEFT:case tn.ARROW_UP:u=(s+a-1)%s}c.current.children[u].focus()}e.preventDefault()}else e.key!==tn.ESCAPE&&e.key!==tn.ENTER||(e.preventDefault(),i());else{var d=t.indexOf(n);c.current.children[d].focus(),e.preventDefault()}e.nativeEvent.stopImmediatePropagation(),e.stopPropagation()},children:(0,I.jsx)("div",{className:"picker-content",ref:c,children:t.map((function(e,t){return(0,I.jsxs)("button",{className:"picker-option",onClick:function(t){t.currentTarget.focus(),o(e.value)},title:"".concat(e.text," — ").concat(e.keyBinding.toUpperCase()),"aria-label":e.text||"none","aria-keyshortcuts":e.keyBinding,ref:function(r){r&&0===t&&(a.current=r),r&&e.value===n&&(l.current=r)},onFocus:function(){o(e.value)},children:[e.icon,(0,I.jsx)("span",{className:"picker-keybinding",children:e.keyBinding})]},e.text)}))})})}function il(e){var t,n=e.value,r=e.label,o=e.options,i=e.onChange,a=e.group,l=void 0===a?"":a,c=h(s().useState(!1),2),u=c[0],d=c[1],f=s().useRef(null),p=C().rtl;return(0,I.jsxs)("label",{className:"picker-container",children:[(0,I.jsx)("button",{name:l,className:u?"active":"","aria-label":r,onClick:function(){return d(!u)},ref:f,children:null===(t=o.find((function(e){return e.value===n})))||void 0===t?void 0:t.icon}),(0,I.jsx)(s().Suspense,{fallback:"",children:u?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(qa,rl(rl({onCloseRequest:function(e){return e.target!==f.current&&d(!1)}},p?{right:5.5}:{left:-5.5}),{},{children:(0,I.jsx)(ol,{options:o,value:n,label:r,onChange:i,onClose:function(){var e;d(!1),null===(e=f.current)||void 0===e||e.focus()}})})),(0,I.jsx)("div",{className:"picker-triangle"})]}):null})]})}n(7117);var al=function(e){return e===c.C6.LIGHT?jt.orange[4]:jt.orange[9]},ll=function(e){return e===c.C6.LIGHT?jt.white:"#1e1e1e"},sl=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:512,n="number"==typeof t?{width:t}:t,r=n.width,o=void 0===r?512:r,i=n.height,a=void 0===i?o:i,l=n.mirror,s=n.style;return(0,I.jsx)("svg",{"aria-hidden":"true",focusable:"false",role:"img",viewBox:"0 0 ".concat(o," ").concat(a),className:Ue({"rtl-mirror":l}),style:s,children:"string"==typeof e?(0,I.jsx)("path",{fill:"currentColor",d:e}):e})},cl=sl((0,I.jsx)("polyline",{fill:"none",stroke:"currentColor",points:"20 6 9 17 4 12"}),{width:24,height:24}),ul=sl("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}),dl=sl("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}),fl=sl("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}),pl=sl("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}),hl=sl("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}),ml=sl("M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z",{width:448,height:512}),gl=sl("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"),vl=sl("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}),bl=sl((0,I.jsxs)(I.Fragment,{children:[(0,I.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,I.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}),yl=sl("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}),xl=sl("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}),wl=sl("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}),kl=sl("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"),El=sl("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"),_l=sl("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}),Sl=sl("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}),Cl=sl("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}),jl=(sl("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}),sl("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}),sl((0,I.jsxs)(I.Fragment,{children:[(0,I.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,I.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}),sl((0,I.jsx)("path",{stroke:"currentColor",strokeWidth:"40",fill:"currentColor",d:"M148 560a318 318 0 0 0 522 110 316 316 0 0 0 0-450 316 316 0 0 0-450 0c-11 11-21 22-30 34v4h47c25 0 46 21 46 46s-21 45-46 45H90c-13 0-25-6-33-14-9-9-14-20-14-33V156c0-25 20-45 45-45s45 20 45 45v32l1 1a401 401 0 0 1 623 509l212 212a42 42 0 0 1-59 59L698 757A401 401 0 0 1 65 570a42 42 0 0 1 83-10z"}),{width:1024}),s().memo((function(e){var t=e.theme;return sl((0,I.jsxs)(I.Fragment,{children:[(0,I.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,I.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:al(t),stroke:al(t),strokeWidth:"2"})]}),{width:24,mirror:!0})}))),Ol=s().memo((function(e){var t=e.theme;return sl((0,I.jsxs)(I.Fragment,{children:[(0,I.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:al(t),stroke:al(t),strokeWidth:"2"}),(0,I.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})})),Il=s().memo((function(e){var t=e.theme;return sl((0,I.jsxs)(I.Fragment,{children:[(0,I.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,I.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:al(t),stroke:al(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),Ml=s().memo((function(e){var t=e.theme;return sl((0,I.jsxs)(I.Fragment,{children:[(0,I.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:al(t),stroke:al(t),strokeWidth:"2"}),(0,I.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})})),Tl=s().memo((function(e){var t=e.theme;return sl((0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("path",{d:"M 2,5 H 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,I.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:al(t),stroke:al(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),Pl=s().memo((function(e){var t=e.theme;return sl((0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("path",{d:"M 2,19 H 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,I.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:al(t),stroke:al(t),strokeWidth:"2"})]}),{width:24,mirror:!0})})),Al=s().memo((function(e){var t=e.theme;return sl((0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("path",{d:"M 5,2 V 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,I.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:al(t),stroke:al(t),strokeWidth:"2"})]}),{width:24})})),Ll=s().memo((function(e){var t=e.theme;return sl((0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("path",{d:"M 19,2 V 22",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,I.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:al(t),stroke:al(t),strokeWidth:"2"})]}),{width:24})})),Dl=s().memo((function(e){var t=e.theme;return sl((0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("path",{d:"M19 5V19M5 5V19",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,I.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:al(t),stroke:al(t),strokeWidth:"2"})]}),{width:24})})),Rl=s().memo((function(e){var t=e.theme;return sl((0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("path",{d:"M5 5L19 5M5 19H19",fill:"var(--icon-fill-color)",stroke:"var(--icon-fill-color)",strokeWidth:"2",strokeLinecap:"round"}),(0,I.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:al(t),stroke:al(t),strokeWidth:"2"})]}),{width:24})})),zl=s().memo((function(e){var t=e.theme;return sl((0,I.jsxs)(I.Fragment,{children:[(0,I.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:al(t),stroke:al(t),strokeWidth:"2"}),(0,I.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})})),Nl=s().memo((function(e){var t=e.theme;return sl((0,I.jsxs)(I.Fragment,{children:[(0,I.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:al(t),stroke:al(t),strokeWidth:"2"}),(0,I.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})})),Hl=sl("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}),Bl=(sl("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"),sl("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"),sl("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})),Fl=sl("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}),Ul=sl("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}),Kl=(sl("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}),sl("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})),Wl=s().memo((function(e){var t=e.theme;return sl((0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("path",{d:"M25 26H111V111H25",fill:"var(--icon-fill-color)"}),(0,I.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,I.jsx)("path",{d:"M100 100H160V160H100",fill:"var(--icon-fill-color)"}),(0,I.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,I.jsxs)("g",{fill:ll(t),stroke:"var(--icon-fill-color)",strokeWidth:"6",children:[(0,I.jsx)("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),(0,I.jsx)("rect",{x:"2.5",y:"149.5",width:"30",height:"30"}),(0,I.jsx)("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),(0,I.jsx)("rect",{x:"147.5",y:"2.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})})),Vl=s().memo((function(e){var t=e.theme;return sl((0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("path",{d:"M25 26H111V111H25",fill:"var(--icon-fill-color)"}),(0,I.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,I.jsx)("path",{d:"M100 100H160V160H100",fill:"var(--icon-fill-color)"}),(0,I.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,I.jsxs)("g",{fill:ll(t),stroke:"var(--icon-fill-color)",strokeWidth:"6",children:[(0,I.jsx)("rect",{x:"2.5",y:"2.5",width:"30",height:"30"}),(0,I.jsx)("rect",{x:"78.5",y:"149.5",width:"30",height:"30"}),(0,I.jsx)("rect",{x:"147.5",y:"149.5",width:"30",height:"30"}),(0,I.jsx)("rect",{x:"147.5",y:"78.5",width:"30",height:"30"}),(0,I.jsx)("rect",{x:"105.5",y:"2.5",width:"30",height:"30"}),(0,I.jsx)("rect",{x:"2.5",y:"102.5",width:"30",height:"30"})]})]}),{width:182,height:182,mirror:!0})})),Gl=s().memo((function(e){return e.theme,sl((0,I.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})})),Zl=s().memo((function(e){return e.theme,sl((0,I.jsxs)("g",{fill:"var(--icon-fill-color)",fillRule:"evenodd",clipRule:"evenodd",children:[(0,I.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,I.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})})),Yl=s().memo((function(e){return e.theme,sl((0,I.jsx)("path",{d:"M2 2H38V18H2V2Z",fill:"var(--icon-fill-color)"}),{width:40,height:20})})),Xl=s().memo((function(e){e.theme;var t=e.strokeWidth;return sl((0,I.jsx)("path",{d:"M6 10H32",stroke:"var(--icon-fill-color)",strokeWidth:t,strokeLinecap:"round",fill:"none"}),{width:40,height:20})})),ql=s().memo((function(e){return e.theme,sl((0,I.jsx)("path",{d:"M6 10H34",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none",strokeLinecap:"round"}),{width:40,height:20})})),$l=s().memo((function(e){return e.theme,sl((0,I.jsx)("path",{d:"M6 10H34",stroke:"var(--icon-fill-color)",strokeWidth:2.5,strokeDasharray:"10, 8",fill:"none",strokeLinecap:"round"}),{width:40,height:20})})),Ql=s().memo((function(e){return e.theme,sl((0,I.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})})),Jl=s().memo((function(e){return e.theme,sl((0,I.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})})),es=s().memo((function(e){return e.theme,sl((0,I.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})})),ts=s().memo((function(e){return e.theme,sl((0,I.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})})),ns=s().memo((function(e){return e.theme,sl((0,I.jsx)("path",{d:"M10 17L10 5L35 5",stroke:"var(--icon-fill-color)",strokeWidth:2,strokeLinecap:"round",fill:"none"}),{width:40,height:20,mirror:!0})})),rs=s().memo((function(e){return e.theme,sl((0,I.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})})),os=s().memo((function(e){return e.theme,sl((0,I.jsx)("path",{d:"M6 10H34",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none"}),{width:40,height:20})})),is=s().memo((function(e){e.theme;var t=e.flip,n=void 0!==t&&t;return sl((0,I.jsxs)("g",{transform:n?"translate(40, 0) scale(-1, 1)":"",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none",children:[(0,I.jsx)("path",{d:"M34 10H6M34 10L27 5M34 10L27 15"}),(0,I.jsx)("path",{d:"M27.5 5L34.5 10L27.5 15"})]}),{width:40,height:20})})),as=s().memo((function(e){e.theme;var t=e.flip,n=void 0!==t&&t;return sl((0,I.jsxs)("g",{stroke:"var(--icon-fill-color)",fill:"var(--icon-fill-color)",transform:n?"translate(40, 0) scale(-1, 1)":"",children:[(0,I.jsx)("path",{d:"M32 10L6 10",strokeWidth:2}),(0,I.jsx)("circle",{r:"4",transform:"matrix(-1 0 0 1 30 10)"})]}),{width:40,height:20})})),ls=s().memo((function(e){e.theme;var t=e.flip,n=void 0!==t&&t;return sl((0,I.jsx)("g",{transform:n?"translate(40, 0) scale(-1, 1)":"",children:(0,I.jsx)("path",{d:"M34 10H5.99996M34 10L34 5M34 10L34 15",stroke:"var(--icon-fill-color)",strokeWidth:2,fill:"none"})}),{width:40,height:20})})),ss=s().memo((function(e){e.theme;var t=e.flip,n=void 0!==t&&t;return sl((0,I.jsxs)("g",{stroke:"var(--icon-fill-color)",fill:"var(--icon-fill-color)",transform:n?"translate(40, 0) scale(-1, 1)":"",children:[(0,I.jsx)("path",{d:"M32 10L6 10",strokeWidth:2}),(0,I.jsx)("path",{d:"M27.5 5.5L34.5 10L27.5 14.5L27.5 5.5"})]}),{width:40,height:20})})),cs=s().memo((function(e){return e.theme,sl((0,I.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})})),us=s().memo((function(e){return e.theme,sl((0,I.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})})),ds=s().memo((function(e){return e.theme,sl((0,I.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})})),fs=s().memo((function(e){return e.theme,sl((0,I.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})})),ps=s().memo((function(e){return e.theme,sl((0,I.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})})),hs=s().memo((function(e){return e.theme,sl((0,I.jsxs)(I.Fragment,{children:[(0,I.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,I.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=s().memo((function(e){return e.theme,sl((0,I.jsx)(I.Fragment,{children:(0,I.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})})),gs=s().memo((function(e){return e.theme,sl((0,I.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})})),vs=s().memo((function(e){return e.theme,sl((0,I.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})})),bs=s().memo((function(e){return e.theme,sl((0,I.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})})),ys=sl((0,I.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}),xs=sl((0,I.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}),ws=function(e){return"rectangle"===e||"ellipse"===e||"diamond"===e||"line"===e||"freedraw"===e},ks=function(e){return"image"!==e},Es=function(e){return"rectangle"===e||"ellipse"===e||"diamond"===e||"freedraw"===e||"arrow"===e||"line"===e},_s=function(e){return"rectangle"===e||"ellipse"===e||"diamond"===e||"arrow"===e||"line"===e},Ss=function(e){return"rectangle"===e||"arrow"===e||"line"===e||"diamond"===e},Cs=function(e){return"text"===e},js=function(e){return"arrow"===e},Os=function(e,t){for(var n=null,r=e.length-1;r>=0;--r){var o=e[r];if(!o.isDeleted&&t(o)){n=o;break}}return n},Is=function(e,t){return e.filter((function(e){return!e.isDeleted&&t(e)}))},Ms=function(e,t,n){for(var r=null,o=e.length-1;o>=0;--o)if(!e[o].isDeleted){var i=h(gt(e[o]),4),a=i[0],l=i[1],s=i[2],c=i[3];if(a<t&&t<s&&l<n&&n<c){r=e[o];break}}return r},Ts=[],Ps=function(e){return Ts=Ts.concat(e),e};function As(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ls(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?As(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):As(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ds=function(e,t,n){var r=Tn(Dc(e,t,arguments.length>3&&void 0!==arguments[3]&&arguments[3]));return e.map((function(e){var o;return r.get(e.id)||e.id===(null===(o=t.editingElement)||void 0===o?void 0:o.id)?n(e):e}))},Rs=function(e,t,n,r){var o,i,a=t.editingElement,l=jc(e);return null!==(o=null!==(i=a&&n(a))&&void 0!==i?i:Ac(l,t)?Lc(l,t,n):r)&&void 0!==o?o:null},zs=function(e,t,n,r){var o=new Set;return{elements:Ds(e,t,(function(e){if(Ge(e)){var t=n(e);o.add(t);var r=lo(e,{fontSize:t});return ur(r,_r(e)),i=e,tt(a=r)?a:ao(a,{x:"left"===i.textAlign?i.x:i.x+(i.width-a.width)/("center"===i.textAlign?2:1),y:i.y+(i.height-a.height)/2},!1)}var i,a;return e}),!0),appState:Ls(Ls({},t),{},{currentItemFontSize:1===o.size?A(o)[0]:null!=r?r:t.currentItemFontSize}),commitToHistory:!0}},Ns=(Ps({name:"changeStrokeColor",perform:function(e,t,n){return Ls(Ls({},n.currentItemStrokeColor&&{elements:Ds(e,t,(function(e){return ks(e.type)?lo(e,{strokeColor:n.currentItemStrokeColor}):e}),!0)}),{},{appState:Ls(Ls({},t),n),commitToHistory:!!n.currentItemStrokeColor})},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("h3",{"aria-hidden":"true",children:O("labels.stroke")}),(0,I.jsx)(tl,{type:"elementStroke",label:O("labels.stroke"),color:Rs(t,n,(function(e){return e.strokeColor}),n.currentItemStrokeColor),onChange:function(e){return r({currentItemStrokeColor:e})},isActive:"strokeColorPicker"===n.openPopup,setActive:function(e){return r({openPopup:e?"strokeColorPicker":null})}})]})}}),Ps({name:"changeBackgroundColor",perform:function(e,t,n){return Ls(Ls({},n.currentItemBackgroundColor&&{elements:Ds(e,t,(function(e){return lo(e,{backgroundColor:n.currentItemBackgroundColor})}))}),{},{appState:Ls(Ls({},t),n),commitToHistory:!!n.currentItemBackgroundColor})},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("h3",{"aria-hidden":"true",children:O("labels.background")}),(0,I.jsx)(tl,{type:"elementBackground",label:O("labels.background"),color:Rs(t,n,(function(e){return e.backgroundColor}),n.currentItemBackgroundColor),onChange:function(e){return r({currentItemBackgroundColor:e})},isActive:"backgroundColorPicker"===n.openPopup,setActive:function(e){return r({openPopup:e?"backgroundColorPicker":null})}})]})}}),Ps({name:"changeFillStyle",perform:function(e,t,n){return{elements:Ds(e,t,(function(e){return lo(e,{fillStyle:n})})),appState:Ls(Ls({},t),{},{currentItemFillStyle:n}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,I.jsxs)("fieldset",{children:[(0,I.jsx)("legend",{children:O("labels.fill")}),(0,I.jsx)(Xa,{options:[{value:"hachure",text:O("labels.hachure"),icon:(0,I.jsx)(Gl,{theme:n.theme})},{value:"cross-hatch",text:O("labels.crossHatch"),icon:(0,I.jsx)(Zl,{theme:n.theme})},{value:"solid",text:O("labels.solid"),icon:(0,I.jsx)(Yl,{theme:n.theme})}],group:"fill",value:Rs(t,n,(function(e){return e.fillStyle}),n.currentItemFillStyle),onChange:function(e){r(e)}})]})}}),Ps({name:"changeStrokeWidth",perform:function(e,t,n){return{elements:Ds(e,t,(function(e){return lo(e,{strokeWidth:n})})),appState:Ls(Ls({},t),{},{currentItemStrokeWidth:n}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,I.jsxs)("fieldset",{children:[(0,I.jsx)("legend",{children:O("labels.strokeWidth")}),(0,I.jsx)(Xa,{group:"stroke-width",options:[{value:1,text:O("labels.thin"),icon:(0,I.jsx)(Xl,{theme:n.theme,strokeWidth:2})},{value:2,text:O("labels.bold"),icon:(0,I.jsx)(Xl,{theme:n.theme,strokeWidth:6})},{value:4,text:O("labels.extraBold"),icon:(0,I.jsx)(Xl,{theme:n.theme,strokeWidth:10})}],value:Rs(t,n,(function(e){return e.strokeWidth}),n.currentItemStrokeWidth),onChange:function(e){return r(e)}})]})}}),Ps({name:"changeSloppiness",perform:function(e,t,n){return{elements:Ds(e,t,(function(e){return lo(e,{seed:no(),roughness:n})})),appState:Ls(Ls({},t),{},{currentItemRoughness:n}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,I.jsxs)("fieldset",{children:[(0,I.jsx)("legend",{children:O("labels.sloppiness")}),(0,I.jsx)(Xa,{group:"sloppiness",options:[{value:0,text:O("labels.architect"),icon:(0,I.jsx)(Jl,{theme:n.theme})},{value:1,text:O("labels.artist"),icon:(0,I.jsx)(es,{theme:n.theme})},{value:2,text:O("labels.cartoonist"),icon:(0,I.jsx)(ts,{theme:n.theme})}],value:Rs(t,n,(function(e){return e.roughness}),n.currentItemRoughness),onChange:function(e){return r(e)}})]})}}),Ps({name:"changeStrokeStyle",perform:function(e,t,n){return{elements:Ds(e,t,(function(e){return lo(e,{strokeStyle:n})})),appState:Ls(Ls({},t),{},{currentItemStrokeStyle:n}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,I.jsxs)("fieldset",{children:[(0,I.jsx)("legend",{children:O("labels.strokeStyle")}),(0,I.jsx)(Xa,{group:"strokeStyle",options:[{value:"solid",text:O("labels.strokeStyle_solid"),icon:(0,I.jsx)(ql,{theme:n.theme})},{value:"dashed",text:O("labels.strokeStyle_dashed"),icon:(0,I.jsx)($l,{theme:n.theme})},{value:"dotted",text:O("labels.strokeStyle_dotted"),icon:(0,I.jsx)(Ql,{theme:n.theme})}],value:Rs(t,n,(function(e){return e.strokeStyle}),n.currentItemStrokeStyle),onChange:function(e){return r(e)}})]})}}),Ps({name:"changeOpacity",perform:function(e,t,n){return{elements:Ds(e,t,(function(e){return lo(e,{opacity:n})})),appState:Ls(Ls({},t),{},{currentItemOpacity:n}),commitToHistory:!0}},PanelComponent:function(e){var t,n=e.elements,r=e.appState,o=e.updateData;return(0,I.jsxs)("label",{className:"control-label",children:[O("labels.opacity"),(0,I.jsx)("input",{type:"range",min:"0",max:"100",step:"10",onChange:function(e){return o(+e.target.value)},onWheel:function(e){e.stopPropagation();var t=+e.target.value;e.deltaY<0&&t<100?o(t+10):e.deltaY>0&&t>0&&o(t-10)},value:null!==(t=Rs(n,r,(function(e){return e.opacity}),r.currentItemOpacity))&&void 0!==t?t:void 0})]})}}),Ps({name:"changeFontSize",perform:function(e,t,n){return zs(e,t,(function(){return n}),n)},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,I.jsxs)("fieldset",{children:[(0,I.jsx)("legend",{children:O("labels.fontSize")}),(0,I.jsx)(Xa,{group:"font-size",options:[{value:16,text:O("labels.small"),icon:(0,I.jsx)(cs,{theme:n.theme}),testId:"fontSize-small"},{value:20,text:O("labels.medium"),icon:(0,I.jsx)(us,{theme:n.theme}),testId:"fontSize-medium"},{value:28,text:O("labels.large"),icon:(0,I.jsx)(ds,{theme:n.theme}),testId:"fontSize-large"},{value:36,text:O("labels.veryLarge"),icon:(0,I.jsx)(fs,{theme:n.theme}),testId:"fontSize-veryLarge"}],value:Rs(t,n,(function(e){if(Ge(e))return e.fontSize;var t=Er(e);return t?t.fontSize:null}),n.currentItemFontSize||c.n5),onChange:function(e){return r(e)}})]})}}),Ps({name:"decreaseFontSize",perform:function(e,t,n){return zs(e,t,(function(e){return Math.round(1/1.1*e.fontSize)}))},keyTest:function(e){return e[tn.CTRL_OR_CMD]&&e.shiftKey&&(e.key===tn.CHEVRON_LEFT||e.key===tn.COMMA)}})),Hs=Ps({name:"increaseFontSize",perform:function(e,t,n){return zs(e,t,(function(e){return Math.round(1.1*e.fontSize)}))},keyTest:function(e){return e[tn.CTRL_OR_CMD]&&e.shiftKey&&(e.key===tn.CHEVRON_RIGHT||e.key===tn.PERIOD)}});function Bs(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(k){return!1}}function Fs(e,t,n){return(Fs=Bs()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&H(o,n.prototype),o}).apply(null,arguments)}function Us(e){var t="function"==typeof Map?new Map:void 0;return Us=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return Fs(e,arguments,U(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),H(r,e)},Us(e)}function Ks(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=U(e);if(t){var o=U(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return F(this,n)}}Ps({name:"changeFontFamily",perform:function(e,t,n){return{elements:Ds(e,t,(function(e){if(Ge(e)){var t=lo(e,{fontFamily:n});return ur(t,_r(e)),t}return e}),!0),appState:Ls(Ls({},t),{},{currentItemFontFamily:n}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData,o=[{value:c.ut.Virgil,text:O("labels.handDrawn"),icon:(0,I.jsx)(ps,{theme:n.theme})},{value:c.ut.Helvetica,text:O("labels.normal"),icon:(0,I.jsx)(hs,{theme:n.theme})},{value:c.ut.Cascadia,text:O("labels.code"),icon:(0,I.jsx)(ms,{theme:n.theme})}];return(0,I.jsxs)("fieldset",{children:[(0,I.jsx)("legend",{children:O("labels.fontFamily")}),(0,I.jsx)(Xa,{group:"font-family",options:o,value:Rs(t,n,(function(e){if(Ge(e))return e.fontFamily;var t=Er(e);return t?t.fontFamily:null}),n.currentItemFontFamily||c.rk),onChange:function(e){return r(e)}})]})}}),Ps({name:"changeTextAlign",perform:function(e,t,n){return{elements:Ds(e,t,(function(e){if(Ge(e)){var t=lo(e,{textAlign:n});return ur(t,_r(e)),t}return e}),!0),appState:Ls(Ls({},t),{},{currentItemTextAlign:n}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,I.jsxs)("fieldset",{children:[(0,I.jsx)("legend",{children:O("labels.textAlign")}),(0,I.jsx)(Xa,{group:"text-align",options:[{value:"left",text:O("labels.left"),icon:(0,I.jsx)(gs,{theme:n.theme})},{value:"center",text:O("labels.center"),icon:(0,I.jsx)(vs,{theme:n.theme})},{value:"right",text:O("labels.right"),icon:(0,I.jsx)(bs,{theme:n.theme})}],value:Rs(t,n,(function(e){if(Ge(e))return e.textAlign;var t=Er(e);return t?t.textAlign:null}),n.currentItemTextAlign),onChange:function(e){return r(e)}})]})}}),Ps({name:"changeSharpness",perform:function(e,t,n){var r=Rc(jc(e),t),o=r.length?r.every((function(e){return!Xe(e)})):!qe(t.elementType),i=r.length?r.every(Xe):qe(t.elementType);return{elements:Ds(e,t,(function(e){return lo(e,{strokeSharpness:n})})),appState:Ls(Ls({},t),{},{currentItemStrokeSharpness:o?n:t.currentItemStrokeSharpness,currentItemLinearStrokeSharpness:i?n:t.currentItemLinearStrokeSharpness}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,I.jsxs)("fieldset",{children:[(0,I.jsx)("legend",{children:O("labels.edges")}),(0,I.jsx)(Xa,{group:"edges",options:[{value:"sharp",text:O("labels.sharp"),icon:(0,I.jsx)(ns,{theme:n.theme})},{value:"round",text:O("labels.round"),icon:(0,I.jsx)(rs,{theme:n.theme})}],value:Rs(t,n,(function(e){return e.strokeSharpness}),Ss(n.elementType)&&(qe(n.elementType)?n.currentItemLinearStrokeSharpness:n.currentItemStrokeSharpness)||null),onChange:function(e){return r(e)}})]})}}),Ps({name:"changeArrowhead",perform:function(e,t,n){return{elements:Ds(e,t,(function(e){if(Xe(e)){var t=n.position,r=n.type;if("start"===t)return lo(e,{startArrowhead:r});if("end"===t)return lo(e,{endArrowhead:r})}return e})),appState:Ls(Ls({},t),{},L({},"start"===n.position?"currentItemStartArrowhead":"currentItemEndArrowhead",n.type)),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData,o=C().rtl;return(0,I.jsxs)("fieldset",{children:[(0,I.jsx)("legend",{children:O("labels.arrowheads")}),(0,I.jsxs)("div",{className:"iconSelectList",children:[(0,I.jsx)(il,{label:"arrowhead_start",options:[{value:null,text:O("labels.arrowhead_none"),icon:(0,I.jsx)(os,{theme:n.theme}),keyBinding:"q"},{value:"arrow",text:O("labels.arrowhead_arrow"),icon:(0,I.jsx)(is,{theme:n.theme,flip:!o}),keyBinding:"w"},{value:"bar",text:O("labels.arrowhead_bar"),icon:(0,I.jsx)(ls,{theme:n.theme,flip:!o}),keyBinding:"e"},{value:"dot",text:O("labels.arrowhead_dot"),icon:(0,I.jsx)(as,{theme:n.theme,flip:!o}),keyBinding:"r"},{value:"triangle",text:O("labels.arrowhead_triangle"),icon:(0,I.jsx)(ss,{theme:n.theme,flip:!o}),keyBinding:"t"}],value:Rs(t,n,(function(e){return Xe(e)&&js(e.type)?e.startArrowhead:n.currentItemStartArrowhead}),n.currentItemStartArrowhead),onChange:function(e){return r({position:"start",type:e})}}),(0,I.jsx)(il,{label:"arrowhead_end",group:"arrowheads",options:[{value:null,text:O("labels.arrowhead_none"),keyBinding:"q",icon:(0,I.jsx)(os,{theme:n.theme})},{value:"arrow",text:O("labels.arrowhead_arrow"),keyBinding:"w",icon:(0,I.jsx)(is,{theme:n.theme,flip:o})},{value:"bar",text:O("labels.arrowhead_bar"),keyBinding:"e",icon:(0,I.jsx)(ls,{theme:n.theme,flip:o})},{value:"dot",text:O("labels.arrowhead_dot"),keyBinding:"r",icon:(0,I.jsx)(as,{theme:n.theme,flip:o})},{value:"triangle",text:O("labels.arrowhead_triangle"),icon:(0,I.jsx)(ss,{theme:n.theme,flip:o}),keyBinding:"t"}],value:Rs(t,n,(function(e){return Xe(e)&&js(e.type)?e.endArrowhead:n.currentItemEndArrowhead}),n.currentItemEndArrowhead),onChange:function(e){return r({position:"end",type:e})}})]})]})}}),n(5422);var Ws=function(e){B(n,e);var t=Ks(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Couldn't export canvas.",o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"CANVAS_ERROR";return D(this,n),(e=t.call(this)).name=o,e.message=r,e}return z(n)}(Us(Error)),Vs=function(e){B(n,e);var t=Ks(n);function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Request Aborted";return D(this,n),t.call(this,e,"AbortError")}return z(n)}(Us(DOMException)),Gs=(n(371),function(e){var t=e.size,n=void 0===t?"1em":t,r=e.circleWidth,o=void 0===r?8:r;return(0,I.jsx)("div",{className:"Spinner",children:(0,I.jsx)("svg",{viewBox:"0 0 100 100",style:{width:n,height:n},children:(0,I.jsx)("circle",{cx:"50",cy:"50",r:50-o/2,strokeWidth:o,fill:"none",strokeMiterlimit:"10"})})})}),Zs=s().forwardRef((function(e,t){var n=ng().id,r=s().useRef(null);s().useImperativeHandle(t,(function(){return r.current}));var o,i="ToolIcon_size_".concat(e.size),a=h((0,l.useState)(!1),2),c=a[0],u=a[1],f=(0,l.useRef)(!0),p=(o=(0,d.Z)(g().mark((function t(n){var r,o;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(o="onClick"in e&&(null===(r=e.onClick)||void 0===r?void 0:r.call(e,n)))||!("then"in o)){t.next=18;break}return t.prev=2,u(!0),t.next=6,o;case 6:t.next=15;break;case 8:if(t.prev=8,t.t0=t.catch(2),t.t0 instanceof Vs){t.next=14;break}throw t.t0;case 14:console.warn(t.t0);case 15:return t.prev=15,f.current&&u(!1),t.finish(15);case 18:case"end":return t.stop()}}),t,null,[[2,8,15,18]])}))),function(e){return o.apply(this,arguments)});(0,l.useEffect)((function(){return function(){f.current=!1}}),[]);var m=(0,l.useRef)(null);if("button"===e.type||"icon"===e.type||"submit"===e.type){var v="icon"===e.type?"button":e.type;return(0,I.jsxs)("button",{className:Ue("ToolIcon_type_button",i,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:v,onClick:p,ref:r,disabled:c||e.isLoading,children:[(e.icon||e.label)&&(0,I.jsxs)("div",{className:"ToolIcon__icon","aria-hidden":"true",children:[e.icon||e.label,e.keyBindingLabel&&(0,I.jsx)("span",{className:"ToolIcon__keybinding",children:e.keyBindingLabel}),e.isLoading&&(0,I.jsx)(Gs,{})]}),e.showAriaLabel&&(0,I.jsxs)("div",{className:"ToolIcon__label",children:[e["aria-label"]," ",c&&(0,I.jsx)(Gs,{})]}),e.children]})}return(0,I.jsxs)("label",{className:Ue("ToolIcon",e.className),title:e.title,onPointerDown:function(e){m.current=e.pointerType||null},onPointerUp:function(){requestAnimationFrame((function(){m.current=null}))},children:[(0,I.jsx)("input",{className:"ToolIcon_type_radio ".concat(i),type:"radio",name:e.name,"aria-label":e["aria-label"],"aria-keyshortcuts":e["aria-keyshortcuts"],"data-testid":e["data-testid"],id:"".concat(n,"-").concat(e.id),onChange:function(){var t;null===(t=e.onChange)||void 0===t||t.call(e,{pointerType:m.current})},checked:e.checked,ref:r}),(0,I.jsxs)("div",{className:"ToolIcon__icon",children:[e.icon,e.keyBindingLabel&&(0,I.jsx)("span",{className:"ToolIcon__keybinding",children:e.keyBindingLabel})]})]})}));Zs.defaultProps={visible:!0,className:"",size:"medium"};var Ys=function(e){var t=e.title||("dark"===e.value?O("buttons.lightMode"):O("buttons.darkMode"));return(0,I.jsx)(Zs,{type:"icon",icon:e.value===c.C6.LIGHT?Xs.MOON:Xs.SUN,title:t,"aria-label":t,onClick:function(){return e.onChange(e.value===c.C6.DARK?c.C6.LIGHT:c.C6.DARK)},"data-testid":"toggle-dark-mode"})},Xs={SUN:(0,I.jsx)("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:(0,I.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,I.jsx)("svg",{width:"512",height:"512",className:"rtl-mirror",viewBox:"0 0 512 512",children:(0,I.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"})})},qs=function(e){var t=e.scenePoint,n=e.viewportDimensions,r=e.zoom;return{scrollX:n.width/2*(1/r.value)-t.x,scrollY:n.height/2*(1/r.value)-t.y}},$s=function(e,t,n){if(!(e=Cc(e)).length)return{scrollX:0,scrollY:0};var r,o,i,a,l,s,c,u,d,f,p,m,g=h(Et(e),4),v=g[0],b=g[1],y=g[2],x=g[3];if(r=t,o=h([v,b,y,x],4),i=o[0],a=o[1],l=o[2],s=o[3],c=wn({sceneX:i,sceneY:a},r),u=c.x,d=c.y,f=wn({sceneX:l,sceneY:s},r),p=f.x,m=f.y,p-u>r.width||m-d>r.height){var w=function(e,t){if(!e.length)return[0,0,0,0];var n=1/0,r=e[0];return e.forEach((function(e){var o=h(kt(e),4),i=o[0],a=o[1],l=o[2],s=o[3],c=it((i+l)/2,(a+s)/2,t.x,t.y);c<n&&(n=c,r=e)})),kt(r)}(e,xn({clientX:t.scrollX,clientY:t.scrollY},t)),k=h(w,4);v=k[0],b=k[1],y=k[2],x=k[3]}return qs({scenePoint:{x:(v+y)/2,y:(b+x)/2},viewportDimensions:{width:t.width,height:t.height},zoom:t.zoom})},Qs=function(e){return Math.max(.1,Math.min(e,30))},Js=function(e,t){var n=e.viewportX,r=e.viewportY,o=e.nextZoom,i=n-t.offsetLeft,a=r-t.offsetTop,l=t.zoom.value;return{scrollX:t.scrollX+(i-i/l)+-(i-i/o),scrollY:t.scrollY+(a-a/l)+-(a-a/o),zoom:{value:o}}},ec=(n(6781),function(){var e=document.querySelector(".excalidraw-tooltip");if(e)return e;var t=document.createElement("div");return document.body.appendChild(t),t.classList.add("excalidraw-tooltip"),t}),tc=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"bottom",o=e.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight,l=5,s=t.left+t.width/2-o.width/2;s<0?s=l:s+o.width>=i&&(s=i-o.width-l),"bottom"===r?(n=t.top+t.height+l)+o.height>=a&&(n=t.top-o.height-l):(n=t.top-o.height-l)<0&&(n=t.top+t.height+l),Object.assign(e.style,{top:"".concat(n,"px"),left:"".concat(s,"px")})},nc=function(e){var t=e.children,n=e.label,r=e.long,o=void 0!==r&&r,i=e.style;return(0,l.useEffect)((function(){return function(){return ec().classList.remove("excalidraw-tooltip--visible")}}),[]),(0,I.jsx)("div",{className:"excalidraw-tooltip-wrapper",onPointerEnter:function(e){return function(e,t,n,r){t.classList.add("excalidraw-tooltip--visible"),t.style.minWidth=r?"50ch":"10ch",t.style.maxWidth=r?"50ch":"15ch",t.textContent=n;var o=e.getBoundingClientRect();tc(t,o)}(e.currentTarget,ec(),n,o)},onPointerLeave:function(){return ec().classList.remove("excalidraw-tooltip--visible")},style:i,children:t})};function rc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rc(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n(196),n(1106);var ic=s().forwardRef((function(e,t){var n=e.children,r=e.padding,o=e.className,i=e.style;return(0,I.jsx)("div",{className:Ue("Island",o),style:oc({"--padding":r},i),ref:t,children:n})})),ac=(n(8328),function(e){var t=e.theme,n=void 0===t?c.C6.LIGHT:t,r=e.closeOnClickOutside,o=void 0===r||r,i=lc(n);return i?(0,Mt.createPortal)((0,I.jsxs)("div",{className:Ue("Modal",e.className),role:"dialog","aria-modal":"true",onKeyDown:function(t){t.key===tn.ESCAPE&&(t.nativeEvent.stopImmediatePropagation(),t.stopPropagation(),e.onCloseRequest())},"aria-labelledby":e.labelledBy,children:[(0,I.jsx)("div",{className:"Modal__background",onClick:o?e.onCloseRequest:void 0}),(0,I.jsx)("div",{className:"Modal__content",style:{"--max-width":"".concat(e.maxWidth,"px")},tabIndex:0,children:e.children})]}),i):null}),lc=function(e){var t=h((0,l.useState)(null),2),n=t[0],r=t[1],o=eg(),i=(0,l.useRef)(o);i.current=o;var a=ng().container;return(0,l.useLayoutEffect)((function(){n&&n.classList.toggle("excalidraw--mobile",o)}),[n,o]),(0,l.useLayoutEffect)((function(){var t=!(null==a||!a.classList.contains("theme--dark"))||"dark"===e,n=document.createElement("div");return n.classList.add("excalidraw","excalidraw-modal-container"),n.classList.toggle("excalidraw--mobile",i.current),t&&(n.classList.add("theme--dark"),n.classList.add("theme--dark-background-none")),document.body.appendChild(n),r(n),function(){document.body.removeChild(n)}}),[a,e]),n},sc=function(e){var t,n,r,o=(t=h((0,l.useState)(null),2),n=t[0],r=t[1],[n,(0,l.useCallback)((function(e){return r(e)}),[])]),i=h(o,2),a=i[0],s=i[1],c=h((0,l.useState)(document.activeElement),1)[0],u=ng().id;(0,l.useEffect)((function(){if(a){var t=d(a);t.length>0&&!1!==e.autofocus&&(t[1]||t[0]).focus();var n=function(e){if(e.key===tn.TAB){var t=d(a),n=document.activeElement,r=t.findIndex((function(e){return e===n}));0===r&&e.shiftKey?(t[t.length-1].focus(),e.preventDefault()):r!==t.length-1||e.shiftKey||(t[0].focus(),e.preventDefault())}};return a.addEventListener("keydown",n),function(){return a.removeEventListener("keydown",n)}}}),[a,e.autofocus]);var d=function(e){var t=e.querySelectorAll("button, a, input, select, textarea, div[tabindex]");return t?Array.from(t):[]},f=function(){c.focus(),e.onCloseRequest()};return(0,I.jsx)(ac,{className:Ue("Dialog",e.className),labelledBy:"dialog-title",maxWidth:e.small?550:800,onCloseRequest:f,theme:e.theme,closeOnClickOutside:e.closeOnClickOutside,children:(0,I.jsxs)(ic,{ref:s,children:[(0,I.jsxs)("h2",{id:"".concat(u,"-dialog-title"),className:"Dialog__title",children:[(0,I.jsx)("span",{className:"Dialog__titleContent",children:e.title}),(0,I.jsx)("button",{className:"Modal__close",onClick:f,"aria-label":O("buttons.close"),children:eg()?Fl:Bl})]}),(0,I.jsx)("div",{className:"Dialog__content",children:e.children})]})})},cc=(n(4678),["onConfirm","onCancel","children","confirmText","cancelText","className"]);function uc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function dc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uc(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var fc=function(e){var t=e.onConfirm,n=e.onCancel,r=e.children,o=e.confirmText,i=void 0===o?O("buttons.confirm"):o,a=e.cancelText,l=void 0===a?O("buttons.cancel"):a,s=e.className,c=void 0===s?"":s,u=po(e,cc);return(0,I.jsxs)(sc,dc(dc({onCloseRequest:n,small:!0},u),{},{className:"confirm-dialog ".concat(c),children:[r,(0,I.jsxs)("div",{className:"confirm-dialog-buttons",children:[(0,I.jsx)(Zs,{type:"button",title:l,"aria-label":l,label:l,onClick:n,className:"confirm-dialog--cancel"}),(0,I.jsx)(Zs,{type:"button",title:i,"aria-label":i,label:i,onClick:t,className:"confirm-dialog--confirm"})]})]}))},pc=function(e){var t=e.onConfirm,n=h((0,l.useState)(!1),2),r=n[0],o=n[1],i=function(){o(!r)};return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Zs,{type:"button",icon:ml,title:O("buttons.clearReset"),"aria-label":O("buttons.clearReset"),showAriaLabel:eg(),onClick:i,"data-testid":"clear-canvas-button"}),r&&(0,I.jsx)(fc,{onConfirm:function(){t(),i()},onCancel:i,title:O("clearCanvasDialog.title"),children:(0,I.jsxs)("p",{className:"clear-canvas__content",children:[" ",O("alerts.clearReset")]})})]})};function hc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function mc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hc(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Ps({name:"changeViewBackgroundColor",perform:function(e,t,n){return{appState:mc(mc({},t),n),commitToHistory:!!n.viewBackgroundColor}},PanelComponent:function(e){var t=e.appState,n=e.updateData;return(0,I.jsx)("div",{style:{position:"relative"},children:(0,I.jsx)(tl,{label:O("labels.canvasBackground"),type:"canvasBackground",color:t.viewBackgroundColor,onChange:function(e){return n({viewBackgroundColor:e})},isActive:"canvasColorPicker"===t.openPopup,setActive:function(e){return n({openPopup:e?"canvasColorPicker":null})},"data-testid":"canvas-background-picker"})})}}),Ps({name:"clearCanvas",perform:function(e,t,n,r){return r.imageCache.clear(),{elements:e.map((function(e){return lo(e,{isDeleted:!0})})),appState:mc(mc({},zn()),{},{files:{},theme:t.theme,elementLocked:t.elementLocked,penMode:t.penMode,penDetected:t.penDetected,exportBackground:t.exportBackground,exportEmbedScene:t.exportEmbedScene,gridSize:t.gridSize,showStats:t.showStats,pasteDialog:t.pasteDialog,elementType:"image"===t.elementType?"selection":t.elementType}),commitToHistory:!0}},PanelComponent:function(e){var t=e.updateData;return(0,I.jsx)(pc,{onConfirm:t})}});var gc=Ps({name:"zoomIn",perform:function(e,t,n,r){return{appState:mc(mc({},t),Js({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Qs(t.zoom.value+c.V4)},t)),commitToHistory:!1}},PanelComponent:function(e){var t=e.updateData;return(0,I.jsx)(Zs,{type:"button",icon:xl,title:"".concat(O("buttons.zoomIn")," — ").concat(yn("CtrlOrCmd++")),"aria-label":O("buttons.zoomIn"),onClick:function(){t(null)},size:"small"})},keyTest:function(e){return(e.code===Lt||e.code===Rt)&&(e[tn.CTRL_OR_CMD]||e.shiftKey)}}),vc=Ps({name:"zoomOut",perform:function(e,t,n,r){return{appState:mc(mc({},t),Js({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Qs(t.zoom.value-c.V4)},t)),commitToHistory:!1}},PanelComponent:function(e){var t=e.updateData;return(0,I.jsx)(Zs,{type:"button",icon:wl,title:"".concat(O("buttons.zoomOut")," — ").concat(yn("CtrlOrCmd+-")),"aria-label":O("buttons.zoomOut"),onClick:function(){t(null)},size:"small"})},keyTest:function(e){return(e.code===Dt||e.code===zt)&&(e[tn.CTRL_OR_CMD]||e.shiftKey)}}),bc=(Ps({name:"resetZoom",perform:function(e,t,n,r){return{appState:mc(mc({},t),Js({viewportX:t.width/2+t.offsetLeft,viewportY:t.height/2+t.offsetTop,nextZoom:Qs(1)},t)),commitToHistory:!1}},PanelComponent:function(e){var t=e.updateData,n=e.appState;return(0,I.jsx)(nc,{label:O("buttons.resetZoom"),style:{height:"100%"},children:(0,I.jsxs)(Zs,{type:"button",className:"reset-zoom-button",title:O("buttons.resetZoom"),"aria-label":O("buttons.resetZoom"),onClick:function(){t(null)},size:"small",children:[(100*n.zoom.value).toFixed(0),"%"]})})},keyTest:function(e){return(e.code===Wt||e.code===Nt)&&(e[tn.CTRL_OR_CMD]||e.shiftKey)}}),function(e,t){var n=h(e,4),r=n[0],o=n[1],i=n[2],a=n[3],l=i-r,s=t.width/l,u=a-o,d=t.height/u,f=Math.min(s,d),p=Math.floor(f/c.V4)*c.V4;return Math.min(Math.max(p,c.V4),1)}),yc=function(e,t,n){var r=jc(e),o=Dc(r,t),i=n&&o.length>0?Et(o):Et(r),a={value:bc(i,{width:t.width,height:t.height})},l=h(i,4),s=l[0],c=l[1],u=(s+l[2])/2,d=(c+l[3])/2;return{appState:mc(mc(mc({},t),qs({scenePoint:{x:u,y:d},viewportDimensions:{width:t.width,height:t.height},zoom:a})),{},{zoom:a}),commitToHistory:!1}},xc=(Ps({name:"zoomToSelection",perform:function(e,t){return yc(e,t,!0)},keyTest:function(e){return e.code===Ut&&e.shiftKey&&!e.altKey&&!e[tn.CTRL_OR_CMD]}}),Ps({name:"zoomToFit",perform:function(e,t){return yc(e,t,!1)},keyTest:function(e){return e.code===Ft&&e.shiftKey&&!e.altKey&&!e[tn.CTRL_OR_CMD]}}),Ps({name:"toggleTheme",perform:function(e,t,n){return{appState:mc(mc({},t),{},{theme:n||(t.theme===c.C6.LIGHT?c.C6.DARK:c.C6.LIGHT)}),commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData;return(0,I.jsx)("div",{style:{marginInlineStart:"0.25rem"},children:(0,I.jsx)(Ys,{value:t.theme,onChange:function(e){n(e)}})})},keyTest:function(e){return e.altKey&&e.shiftKey&&e.code===Zt}}),function(e,t,n,r,o,i){var a=r.zoom,l=180*n/Math.PI,s=e*(a.value-1)/2,c=t*(a.value-1)/2;return e>o&&1!==a.value&&(s=o*(a.value-1)/2),t>i&&1!==a.value&&(c=i*(a.value-1)/2),"translate(".concat(s,"px, ").concat(c,"px) scale(").concat(a.value,") rotate(").concat(l,"deg)")}),wc=function(e){var t,n=e.id,r=e.onChange,o=e.onSubmit,i=e.getViewportCoords,a=e.element,l=e.canvas,s=e.excalidrawContainer,u=e.app,d=function(){var e,r,o,l,s=u.state,d=null===(e=cr.getScene(a))||void 0===e?void 0:e.getElement(n),p=gr(dn(d));if(d&&Ge(d)){var m=d.x,g=d.y,v=_r(d),b=d.width,y=d.height,x=d.width,w=d.height;if(v&&d.containerId){var k=(r=d,l=(o=f).style.fontFamily.replace(/"/g,""),un({fontFamily:r.fontFamily})!==l||"".concat(r.fontSize,"px")!==o.style.fontSize),E=Number(f.style.height.slice(0,-2));if(E>0&&(w=E),k&&(t=v.height,w=d.height),t||(t=v.height),b=v.width-2*c.gK,y=v.height-2*c.gK,x=b,m=v.x+c.gK,w>y){var _=Math.min(w-y,p);return void ao(v,{height:v.height+_})}if(v.height>t&&w<y){var S=Math.min(y-w,p);ao(v,{height:v.height-S})}else g=v.y+v.height/2-w/2}var C=h(i(m,g),2),j=C[0],O=C[1],I=d.textAlign;f.value=d.originalText;var M=d.originalText.split("\n"),T=d.containerId?p:d.height/M.length;v||(b=(s.width-8-j)/s.zoom.value);var P=(s.height-O)/s.zoom.value,A=v?v.angle:d.angle;Object.assign(f.style,{font:dn(d),lineHeight:"".concat(T,"px"),width:"".concat(x,"px"),height:"".concat(w,"px"),left:"".concat(j,"px"),top:"".concat(O,"px"),transform:xc(x,w,A,s,b,P),textAlign:I,color:d.strokeColor,opacity:d.opacity/100,filter:"var(--theme-filter)",maxWidth:"".concat(b,"px"),maxHeight:"".concat(P,"px")}),Pn()&&(f.style.fontFamily=un(d)),ao(d,{x:m,y:g})}},f=document.createElement("textarea");f.dir="auto",f.tabIndex=0,f.dataset.type="wysiwyg",f.wrap="off",f.classList.add("excalidraw-wysiwyg");var p="pre",m="normal";tt(a)&&(p="pre-wrap",m="break-word"),Object.assign(f.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:m,whiteSpace:p,overflowWrap:"break-word"}),d(),r&&(f.oninput=function(){var e,t=null===(e=cr.getScene(a))||void 0===e?void 0:e.getElement(n),o=dn(t),i=f.scrollHeight/gr(o);if(tt(a)&&i>1){var l="auto";if(2===i){var s=_r(a);1===br(f.value,o,s.width).split("\n").length&&(l="".concat(f.scrollHeight/2,"px"))}f.style.height=l,f.style.height="".concat(f.scrollHeight,"px")}r(f.value.replace(/\t/g," ").replace(/\r?\n|\r/g,"\n"))}),f.onkeydown=function(e){if(e.stopPropagation(),!e.shiftKey&&gc.keyTest(e))e.preventDefault(),u.actionManager.executeAction(gc),d();else if(!e.shiftKey&&vc.keyTest(e))e.preventDefault(),u.actionManager.executeAction(vc),d();else if(Ns.keyTest(e))u.actionManager.executeAction(Ns);else if(Hs.keyTest(e))u.actionManager.executeAction(Hs);else if(e.key===tn.ESCAPE)e.preventDefault(),k=!0,E();else if(e.key===tn.ENTER&&e[tn.CTRL_OR_CMD]){if(e.preventDefault(),e.isComposing||229===e.keyCode)return;k=!0,E()}else(e.key===tn.TAB||e[tn.CTRL_OR_CMD]&&(e.code===Bt||e.code===Ht))&&(e.preventDefault(),e.shiftKey||e.code===Bt?y():b(),f.dispatchEvent(new Event("input")))};var g=" ".repeat(4),v=new RegExp("^ {1,".concat(4,"}")),b=function(){var e=f.selectionStart,t=f.selectionEnd,n=x(),r=f.value;n.forEach((function(e){var t=r.slice(0,e),n=r.slice(e);r="".concat(t).concat(g).concat(n)})),f.value=r,f.selectionStart=e+4,f.selectionEnd=t+4*n.length},y=function(){var e=f.selectionStart,t=f.selectionEnd,n=x(),r=[],o=f.value;n.forEach((function(e){var t=o.slice(e,e+4).match(v);if(t){var n=o.slice(0,e),i=o.slice(e+t[0].length);o="".concat(n).concat(i),r.push(e)}})),f.value=o,r.length&&(e>r[r.length-1]?f.selectionStart=Math.max(e-4,r[r.length-1]):f.selectionStart=e,f.selectionEnd=Math.max(f.selectionStart,t-4*r.length))},x=function(){var e=f.selectionStart,t=f.selectionEnd,n=f.value,r=n.slice(0,e).match(/[^\n]*$/)[0].length;return e-=r,n.slice(e,t).split("\n").reduce((function(t,n,r,o){return t.concat(r?t[r-1]+o[r-1].length+1:e)}),[]).reverse()},w=function(e){e.preventDefault(),e.stopPropagation()},k=!1,E=function(){var e;_();var t=null===(e=cr.getScene(a))||void 0===e?void 0:e.getElement(a.id);if(t){var n=f.value,r=_r(t);if(r)if(n=t.text,f.value){var i=kr(r);i&&i===a.id||ao(r,{boundElements:(r.boundElements||[]).concat({type:"text",id:a.id})})}else{var l;ao(r,{boundElements:null===(l=r.boundElements)||void 0===l?void 0:l.filter((function(e){return!Ge(e)}))})}o({text:n,viaKeyboard:k,originalText:f.value})}},_=function(){O||(O=!0,f.onblur=null,f.oninput=null,f.onkeydown=null,I&&I.disconnect(),window.removeEventListener("resize",d),window.removeEventListener("wheel",w,!0),window.removeEventListener("pointerdown",C),window.removeEventListener("pointerup",S),window.removeEventListener("blur",E),j(),f.remove())},S=function e(t){window.removeEventListener("pointerup",e);var n=null==t?void 0:t.target,r=n instanceof HTMLInputElement&&n.closest(".color-picker-input")&&cn(n);setTimeout((function(){f.onblur=E,n&&r&&(n.onblur=function(){f.focus()}),r||f.focus()}))},C=function(e){var t=e.target instanceof HTMLInputElement&&e.target.closest(".color-picker-input")&&cn(e.target);((e.target instanceof HTMLElement||e.target instanceof SVGElement)&&e.target.closest(".".concat(c.$C.SHAPE_ACTIONS_MENU))&&!cn(e.target)||t)&&(f.onblur=null,window.addEventListener("pointerup",S),window.addEventListener("blur",E))},j=cr.getScene(a).addCallback((function(){var e;d(),null!==(e=document.activeElement)&&void 0!==e&&e.closest(".color-picker-input")||f.focus()})),O=!1;f.select(),S();var I=null;l&&"ResizeObserver"in window?(I=new window.ResizeObserver((function(){d()}))).observe(l):window.addEventListener("resize",d),window.addEventListener("pointerdown",C),window.addEventListener("wheel",w,{passive:!1,capture:!0}),null==s||s.querySelector(".excalidraw-textEditorContainer").appendChild(f)},kc=function(e,t){return Boolean(!e.viewModeEnabled&&(e.editingElement||Dc(t,e).length||"selection"!==e.elementType))};function Ec(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ec(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ec(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Sc=function(e){return e.reduce((function(e,t){return e+t.version}),0)},Cc=function(e){return e.filter((function(e){return!e.isDeleted&&!co(e)}))},jc=function(e){return e.filter((function(e){return!e.isDeleted}))},Oc=function(e){return!e.isDeleted},Ic=function(e){return jc(e).map((function(e){return qe(e.type)?_c(_c({},e),{},{lastCommittedPoint:null}):e}))},Mc=function(e){return Ic(e)},Tc=function(e){return Ic(e)},Pc=function(e,t,n){var r=h([e.horizontal,e.vertical].map((function(e){return null!=e&&e.x<=t&&t<=e.x+e.width&&e.y<=n&&n<=e.y+e.height})),2),o=r[0],i=r[1];return{isOverEither:o||i,isOverHorizontal:o,isOverVertical:i}},Ac=function(e,t){return e.some((function(e){return t.selectedElementIds[e.id]}))},Lc=function(e,t,n){var r=Array.from(new Set(Dc(e,t).map((function(e){return n(e)}))));return 1===r.length?r[0]:null},Dc=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return e.filter((function(e){return t.selectedElementIds[e.id]||n&&tt(e)&&t.selectedElementIds[null==e?void 0:e.containerId]?e:null}))},Rc=function(e,t){return t.editingElement?[t.editingElement]:Dc(e,t,!0)};function zc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Nc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zc(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Hc=function(e,t){if(e.editingGroupId){var n=_o(jc(t),e.editingGroupId);if(n.length)return Nc(Nc({},e),{},{selectedElementIds:L({},n[0].id,!0)})}return e},Bc=Ps({name:"deleteSelectedElements",perform:function(e,t){if(t.editingLinearElement){var n=t.editingLinearElement,r=n.elementId,o=n.selectedPointsIndices,i=n.startBindingElement,a=n.endBindingElement,l=aa.getElement(r);if(!l)return!1;if(null==o||l.points.length<2){var s=e.filter((function(e){return e.id!==l.id}));return{elements:s,appState:Nc(Nc({},Hc(t,s)),{},{editingLinearElement:null}),commitToHistory:!1}}var c={startBindingElement:null!=o&&o.includes(0)?null:i,endBindingElement:null!=o&&o.includes(l.points.length-1)?null:a};return aa.deletePoints(l,o),{elements:e,appState:Nc(Nc({},t),{},{editingLinearElement:Nc(Nc(Nc({},t.editingLinearElement),c),{},{selectedPointsIndices:(null==o?void 0:o[0])>0?[o[0]-1]:[0]})}),commitToHistory:!0}}var u,d=(u=t,{elements:e.map((function(e){return u.selectedElementIds[e.id]||tt(e)&&u.selectedElementIds[e.containerId]?lo(e,{isDeleted:!0}):e})),appState:Nc(Nc({},u),{},{selectedElementIds:{}})}),f=d.elements,p=d.appState;return La(f,e.filter((function(e){var n=e.id;return t.selectedElementIds[n]}))),{elements:f,appState:Nc(Nc({},p=Hc(p,f)),{},{elementType:"selection",multiElement:null}),commitToHistory:Ac(jc(e),t)}},contextItemLabel:"labels.delete",keyTest:function(e){return e.key===tn.BACKSPACE||e.key===tn.DELETE},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,I.jsx)(Zs,{type:"button",icon:ml,title:O("labels.delete"),"aria-label":O("labels.delete"),onClick:function(){return r(null)},visible:Ac(jc(t),n)})}}),Fc=function(e,t){for(var n=[],r=[],o=null,i=-1,a=Tn(Dc(e,t,!0));++i<e.length;)a.get(e[i].id)?(r.length&&(n=n.concat(r),r=[]),n.push(i),o=i+1):e[i].isDeleted&&o===i?(o=i+1,r.push(i)):r=[];return n},Uc=function(e,t,n){if("containerId"in e&&e.containerId){if("left"!==n)return t.indexOf(e);var r=cr.getScene(e).getElement(e.containerId);if(r)return t.indexOf(r)}else{var o,i,a=null===(o=e.boundElements)||void 0===o||null===(i=o.find((function(e){return"arrow"!==e.type})))||void 0===i?void 0:i.id;if(a){if("left"===n)return t.indexOf(e);var l=cr.getScene(e).getElement(a);if(l)return t.indexOf(l)}}},Kc=function(e,t,n,r){var o,i=t[n],a=function(t){return!t.isDeleted&&(!e.editingGroupId||t.groupIds.includes(e.editingGroupId))},l="left"===r?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length-1;n<0&&(n=e.length+n);for(var r=(n=Math.min(e.length-1,Math.max(n,0)))+1;--r>-1;)if(t(e[r],r,e))return r;return-1}(t,a,Math.max(0,n-1)):function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;n<0&&(n=e.length+n);for(var r=(n=Math.min(e.length,Math.max(n,0)))-1;++r<e.length;)if(t(e[r],r,e))return r;return-1}(t,a,n+1),s=t[l];if(!s)return-1;if(e.editingGroupId){var c;if((null==i?void 0:i.groupIds.join(""))===(null==s?void 0:s.groupIds.join("")))return null!==(c=Uc(s,t,r))&&void 0!==c?c:l;if(null==s||!s.groupIds.includes(e.editingGroupId))return-1}if(!s.groupIds.length)return null!==(o=Uc(s,t,r))&&void 0!==o?o:l;var u=e.editingGroupId?s.groupIds[s.groupIds.indexOf(e.editingGroupId)-1]:s.groupIds[s.groupIds.length-1],d=_o(t,u);return d.length?"left"===r?t.indexOf(d[0]):t.indexOf(d[d.length-1]):l},Wc=function(e,t){return t.reduce((function(t,n){var r=e[n];return t[r.id]=r,t}),{})},Vc=function(e,t,n){var r,o,i=Fc(t,e),a=Wc(t,i),l=(o=0,(r=i).reduce((function(e,t,n){return n>0&&r[n-1]!==t-1&&(o=++o),(e[o]||(e[o]=[])).push(t),e}),[]));return"right"===n&&(l=l.reverse()),l.forEach((function(r,o){var i=r[0],a=r[r.length-1],l="left"===n?i:a,s=Kc(e,t,l,n);if(-1!==s&&l!==s){var c="left"===n?t.slice(0,s):t.slice(0,i),u=t.slice(i,a+1),d="left"===n?t.slice(s,i):t.slice(a+1,s+1),f="left"===n?t.slice(a+1):t.slice(s+1);t="left"===n?[].concat(A(c),A(u),A(d),A(f)):[].concat(A(c),A(d),A(u),A(f))}})),t.map((function(e){return a[e.id]?so(e):e}))},Gc=function(e,t,n){var r,o,i=Fc(e,t),a=Wc(e,i),l=[];if("left"===n){if(t.editingGroupId){var s=_o(e,t.editingGroupId);if(!s.length)return e;r=e.indexOf(s[0])}else r=0;o=i[i.length-1]}else{if(t.editingGroupId){var c=_o(e,t.editingGroupId);if(!c.length)return e;o=e.indexOf(c[c.length-1])}else o=e.length-1;r=i[0]}for(var u=r;u<o+1;u++)i.includes(u)||l.push(e[u]);var d=Object.values(a).map((function(e){return so(e)})),f=e.slice(0,r),p=e.slice(o+1);return"left"===n?[].concat(A(f),A(d),l,A(p)):[].concat(A(f),l,A(d),A(p))},Zc=function(e,t){return Vc(t,e,"left")},Yc=function(e,t){return Vc(t,e,"right")},Xc=function(e,t){return Gc(e,t,"left")},qc=function(e,t){return Gc(e,t,"right")},$c=Ps({name:"sendBackward",perform:function(e,t){return{elements:Zc(e,t),appState:t,commitToHistory:!0}},contextItemLabel:"labels.sendBackward",keyPriority:40,keyTest:function(e){return e[tn.CTRL_OR_CMD]&&!e.shiftKey&&e.code===Bt},PanelComponent:function(e){var t=e.updateData,n=e.appState;return(0,I.jsx)("button",{type:"button",className:"zIndexButton",onClick:function(){return t(null)},title:"".concat(O("labels.sendBackward")," — ").concat(yn("CtrlOrCmd+[")),children:(0,I.jsx)(Ol,{theme:n.theme})})}}),Qc=Ps({name:"bringForward",perform:function(e,t){return{elements:Yc(e,t),appState:t,commitToHistory:!0}},contextItemLabel:"labels.bringForward",keyPriority:40,keyTest:function(e){return e[tn.CTRL_OR_CMD]&&!e.shiftKey&&e.code===Ht},PanelComponent:function(e){var t=e.updateData,n=e.appState;return(0,I.jsx)("button",{type:"button",className:"zIndexButton",onClick:function(){return t(null)},title:"".concat(O("labels.bringForward")," — ").concat(yn("CtrlOrCmd+]")),children:(0,I.jsx)(jl,{theme:n.theme})})}}),Jc=Ps({name:"sendToBack",perform:function(e,t){return{elements:Xc(e,t),appState:t,commitToHistory:!0}},contextItemLabel:"labels.sendToBack",keyTest:function(e){return Tt?e[tn.CTRL_OR_CMD]&&e.altKey&&e.code===Bt:e[tn.CTRL_OR_CMD]&&e.shiftKey&&e.code===Bt},PanelComponent:function(e){var t=e.updateData,n=e.appState;return(0,I.jsx)("button",{type:"button",className:"zIndexButton",onClick:function(){return t(null)},title:"".concat(O("labels.sendToBack")," — ").concat(yn(Tt?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")),children:(0,I.jsx)(Ml,{theme:n.theme})})}}),eu=Ps({name:"bringToFront",perform:function(e,t){return{elements:qc(e,t),appState:t,commitToHistory:!0}},contextItemLabel:"labels.bringToFront",keyTest:function(e){return Tt?e[tn.CTRL_OR_CMD]&&e.altKey&&e.code===Ht:e[tn.CTRL_OR_CMD]&&e.shiftKey&&e.code===Ht},PanelComponent:function(e){var t=e.updateData,n=e.appState;return(0,I.jsx)("button",{type:"button",className:"zIndexButton",onClick:function(e){return t(null)},title:"".concat(O("labels.bringToFront")," — ").concat(yn(Tt?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")),children:(0,I.jsx)(Il,{theme:n.theme})})}});function tu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function nu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tu(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ru=Ps({name:"selectAll",perform:function(e,t){return!t.editingLinearElement&&{appState:ko(nu(nu({},t),{},{editingGroupId:null,selectedElementIds:e.reduce((function(e,t){return t.isDeleted||Ge(t)&&t.containerId||(e[t.id]=!0),e}),{})}),jc(e)),commitToHistory:!0}},contextItemLabel:"labels.selectAll",keyTest:function(e){return e[tn.CTRL_OR_CMD]&&e.key===tn.A}});function ou(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function iu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ou(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ou(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var au=Ps({name:"duplicateSelection",perform:function(e,t){if(t.editingLinearElement){var n=aa.duplicateSelectedPoints(t);return!!n&&{elements:e,appState:n.appState,commitToHistory:!0}}return iu(iu({},lu(e,t)),{},{commitToHistory:!0})},contextItemLabel:"labels.duplicateSelection",keyTest:function(e){return e[tn.CTRL_OR_CMD]&&e.key===tn.D},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,I.jsx)(Zs,{type:"button",icon:Ul,title:"".concat(O("labels.duplicateSelection")," — ").concat(yn("CtrlOrCmd+D")),"aria-label":O("labels.duplicateSelection"),onClick:function(){return r(null)},visible:Ac(jc(t),n)})}}),lu=function(e,t){for(var n=new Map,r=[],o=[],i=new Map,a=function(e){var a=zo(t.editingGroupId,n,e,{x:e.x+c.k/2,y:e.y+c.k/2});return i.set(e.id,a.id),o.push(e),r.push(a),a},l=[],s=0,u=Tn(Dc(e,t,!0));s<e.length;){var d=e[s];if(u.get(d.id)){if(d.groupIds.length){var f=xo(t,d);if(f){var p=_o(e,f);l.push.apply(l,A(p).concat(A(p.map((function(e){return a(e)}))))),s+=p.length;continue}}l.push(d,a(d))}else l.push(d);s++}return dr(l,o,i),Pa(l,o,i),{elements:l,appState:ko(iu(iu({},t),{},{selectedGroupIds:{},selectedElementIds:r.reduce((function(e,t){return tt(t)||(e[t.id]=!0),e}),{})}),jc(l))}};function su(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?su(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):su(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var uu,du,fu,pu=Ps({name:"finalize",perform:function(e,t,n,r){var o,i=r.canvas,a=r.focusContainer;if(t.editingLinearElement){var l=t.editingLinearElement,s=l.elementId,c=l.startBindingElement,u=l.endBindingElement,d=aa.getElement(s);if(d)return $e(d)&&ua(d,c,u),{elements:d.points.length<2||co(d)?e.filter((function(e){return e.id!==d.id})):void 0,appState:cu(cu({},t),{},{editingLinearElement:null}),commitToHistory:!0}}var f=e;t.pendingImageElement&&ao(t.pendingImageElement,{isDeleted:!0},!1),window.document.activeElement instanceof HTMLElement&&a();var p=t.multiElement?t.multiElement:"freedraw"===(null===(o=t.editingElement)||void 0===o?void 0:o.type)?t.editingElement:null;if(p){if("freedraw"!==p.type&&"touch"!==t.lastPointerDownWith){var m=p.points,g=p.lastCommittedPoint;g&&m[m.length-1]===g||ao(p,{points:p.points.slice(0,-1)})}co(p)&&(f=f.slice(0,-1));var v=at(p.points,t.zoom.value);if(("line"===p.type||"freedraw"===p.type)&&v){var b=p.points,y=b[0];ao(p,{points:b.map((function(e,t){return t===b.length-1?[y[0],y[1]]:e}))})}if($e(p)&&!v&&p.points.length>1){var x=h(aa.getPointAtIndexGlobalCoordinates(p,-1),2),w=x[0],k=x[1];ha(p,t,cr.getScene(p),{x:w,y:k})}t.elementLocked||"freedraw"===t.elementType||(t.selectedElementIds[p.id]=!0)}return(t.elementLocked||"freedraw"===t.elementType)&&p||mn(i),{elements:f,appState:cu(cu({},t),{},{elementType:(t.elementLocked||"freedraw"===t.elementType)&&p?t.elementType:"selection",draggingElement:null,multiElement:null,editingElement:null,startBoundElement:null,suggestedBindings:[],selectedElementIds:p&&!t.elementLocked&&"freedraw"!==t.elementType?cu(cu({},t.selectedElementIds),{},L({},p.id,!0)):t.selectedElementIds,pendingImageElement:null}),commitToHistory:"freedraw"===t.elementType}},keyTest:function(e,t){return e.key===tn.ESCAPE&&(null!==t.editingLinearElement||!t.draggingElement&&null===t.multiElement)||(e.key===tn.ESCAPE||e.key===tn.ENTER)&&null!==t.multiElement},PanelComponent:function(e){var t=e.appState,n=e.updateData;return(0,I.jsx)(Zs,{type:"button",icon:kl,title:O("buttons.done"),"aria-label":O("buttons.done"),onClick:n,visible:null!=t.multiElement})}}),hu="undefined"!=typeof process&&null!==(uu={REACT_APP_BACKEND_V2_GET_URL:"https://json.excalidraw.com/api/v2/",REACT_APP_BACKEND_V2_POST_URL:"https://json.excalidraw.com/api/v2/post/",REACT_APP_LIBRARY_URL:"https://libraries.excalidraw.com",REACT_APP_LIBRARY_BACKEND:"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries",REACT_APP_SOCKET_SERVER_URL:"https://oss-collab-us1.excalidraw.com",REACT_APP_FIREBASE_CONFIG:'{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}',REACT_APP_GOOGLE_ANALYTICS_ID:"UA-387204-13"})&&void 0!==uu&&uu.REACT_APP_GOOGLE_ANALYTICS_ID&&"undefined"!=typeof window&&window.gtag?function(e,t,n,r){window.gtag("event",t,{event_category:e,event_label:n,value:r})}:("undefined"!=typeof process&&null!==(du={REACT_APP_BACKEND_V2_GET_URL:"https://json.excalidraw.com/api/v2/",REACT_APP_BACKEND_V2_POST_URL:"https://json.excalidraw.com/api/v2/post/",REACT_APP_LIBRARY_URL:"https://libraries.excalidraw.com",REACT_APP_LIBRARY_BACKEND:"https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries",REACT_APP_SOCKET_SERVER_URL:"https://oss-collab-us1.excalidraw.com",REACT_APP_FIREBASE_CONFIG:'{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}',REACT_APP_GOOGLE_ANALYTICS_ID:"UA-387204-13"})&&void 0!==du&&du.JEST_WORKER_ID,function(e,t,n,r){}),mu=(n(518),n(9966),function(e){var t=ng().id,n=h((0,l.useState)(e.value),2),r=n[0],o=n[1];return(0,I.jsxs)("div",{className:"ProjectName",children:[(0,I.jsx)("label",{className:"ProjectName-label",htmlFor:"filename",children:"".concat(e.label).concat(e.isNameEditable?"":":")}),e.isNameEditable?(0,I.jsx)("input",{type:"text",className:"TextInput",onBlur:function(t){!function(e){for(var t=e.parentElement;t;){if(t.tabIndex>-1)return void t.focus();t=t.parentElement}}(t.target);var n=t.target.value;n!==e.value&&e.onChange(n)},onKeyDown:function(e){if("Enter"===e.key){if(e.preventDefault(),e.nativeEvent.isComposing||229===e.keyCode)return;e.currentTarget.blur()}},id:"".concat(t,"-filename"),value:r,onChange:function(e){return o(e.target.value)}}):(0,I.jsx)("span",{className:"TextInput TextInput--readonly",id:"".concat(t,"-filename"),children:e.value})]})}),gu=function(e,t){if(null!=t&&t.collaborators){var n=t.collaborators.get(e);if(null!=n&&n.color)return n.color}var r=e.split("").reduce((function(e,t){return e+t.charCodeAt(0)}),0),o=It.elementBackground.slice(1),i=It.elementStroke.slice(1);return{background:o[r%o.length],stroke:i[r%i.length]}};function vu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vu(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}!function(e){e.ACTIVE="active",e.AWAY="away",e.IDLE="idle"}(fu||(fu={})),n(4404);var yu=document.createElement("img");yu.src="data:".concat(c.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>'));var xu=!1,wu=function(e){var t=e.element,n=e.appState,r=e.setAppState,o=e.onLinkOpen,i=t.link||"",a=h((0,l.useState)(i),2),s=a[0],u=a[1],d=(0,l.useRef)(null),f="editor"===n.showHyperlinkPopup||!i,p=(0,l.useCallback)((function(){if(d.current){var e=Eu(d.current.value);ao(t,{link:e}),r({showHyperlinkPopup:"info"})}}),[t,r]);(0,l.useLayoutEffect)((function(){return function(){p()}}),[p]),(0,l.useEffect)((function(){var e=null,o=function(o){f||(e&&clearTimeout(e),Tu(t,n,[o.clientX,o.clientY])&&(e=window.setTimeout((function(){r({showHyperlinkPopup:!1})}),500)))};return window.addEventListener(c.Ks.POINTER_MOVE,o,!1),function(){window.removeEventListener(c.Ks.POINTER_MOVE,o,!1),e&&clearTimeout(e)}}),[n,t,f,r]);var m=(0,l.useCallback)((function(){ao(t,{link:null}),f&&(d.current.value=""),r({showHyperlinkPopup:!1})}),[r,t,f]),g=ku(t,n),v=g.x,b=g.y;return n.draggingElement||n.resizingElement||n.isRotating||n.openMenu?null:(0,I.jsxs)("div",{className:"excalidraw-hyperlinkContainer",style:{top:"".concat(b,"px"),left:"".concat(v,"px"),width:320,padding:5},children:[f?(0,I.jsx)("input",{className:Ue("excalidraw-hyperlinkContainer-input"),placeholder:"Type or paste your link here",ref:d,value:s,onChange:function(e){return u(e.target.value)},autoFocus:!0,onKeyDown:function(e){e.stopPropagation(),e[tn.CTRL_OR_CMD]&&e.key===tn.K&&e.preventDefault(),e.key!==tn.ENTER&&e.key!==tn.ESCAPE||p()}}):(0,I.jsx)("a",{href:t.link||"",className:Ue("excalidraw-hyperlinkContainer-link",{"d-none":f}),target:_u(t.link)?"_self":"_blank",onClick:function(e){if(t.link&&o){var n=An(c.Ks.EXCALIDRAW_LINK,e.nativeEvent);o(t,n),n.defaultPrevented&&e.preventDefault()}},rel:"noopener noreferrer",children:t.link}),(0,I.jsxs)("div",{className:"excalidraw-hyperlinkContainer__buttons",children:[!f&&(0,I.jsx)(Zs,{type:"button",title:O("buttons.edit"),"aria-label":O("buttons.edit"),label:O("buttons.edit"),onClick:function(){r({showHyperlinkPopup:"editor"})},className:"excalidraw-hyperlinkContainer--edit",icon:xs}),i&&(0,I.jsx)(Zs,{type:"button",title:O("buttons.remove"),"aria-label":O("buttons.remove"),label:O("buttons.remove"),onClick:m,className:"excalidraw-hyperlinkContainer--remove",icon:ml})]})]})},ku=function(e,t){var n=h(gt(e),2),r=n[0],o=n[1],i=wn({sceneX:r+e.width/2,sceneY:o},t),a=i.x,l=i.y;return{x:a-t.offsetLeft-160,y:l-t.offsetTop-85}},Eu=function(e){return(e=e.trim())&&(e.includes("://")||/^[[\\/]/.test(e)||(e="https://".concat(e))),e},_u=function(e){return!!(null!=e&&e.includes(location.origin)||null!=e&&e.startsWith("/"))},Su=Ps({name:"link",perform:function(e,t){return"editor"!==t.showHyperlinkPopup&&{elements:e,appState:bu(bu({},t),{},{showHyperlinkPopup:"editor",openMenu:null}),commitToHistory:!0}},keyTest:function(e){return e[tn.CTRL_OR_CMD]&&e.key===tn.K},contextItemLabel:function(e,t){return Cu(e,t)},contextItemPredicate:function(e,t){return 1===Dc(e,t).length},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData,o=Dc(t,n);return(0,I.jsx)(Zs,{type:"button",icon:ul,"aria-label":O(Cu(t,n)),title:"".concat(O("labels.link.label")," - ").concat(yn("CtrlOrCmd+K")),onClick:function(){return r(null)},selected:1===o.length&&!!o[0].link})}}),Cu=function(e,t){return Dc(e,t)[0].link?"labels.link.edit":"labels.link.create"},ju=function(e,t,n){var r=h(e,4),o=r[0],i=r[1],a=r[2],l=r[3],s=14/n.zoom.value,c=14/n.zoom.value,u=14/n.zoom.value,d=(o+a)/2,f=(i+l)/2,p=6/(2*n.zoom.value),m=4/n.zoom.value,g=h(nt(a+m-p+s/2,i-m-u+p+c/2,d,f,t),2);return[g[0]-s/2,g[1]-c/2,s,c]},Ou=function(e,t,n,r){var o=h(n,2),i=o[0],a=o[1],l=4/t.zoom.value;if(!r&&t.viewModeEnabled&&wi(e,[i,a],l))return!0;var s=h(gt(e),4),c=s[0],u=s[1],d=s[2],f=s[3],p=h(ju([c,u,d,f],e.angle,t),4),m=p[0],g=p[1],v=p[2],b=p[3];return i>m-l&&i<m+l+v&&a>g-l&&a<g+b+l},Iu=null,Mu=function(e,t){if(e.link){var n=ec();n.classList.add("excalidraw-tooltip--visible"),n.style.maxWidth="20rem",n.textContent=e.link;var r=h(gt(e),4),o=r[0],i=r[1],a=r[2],l=r[3],s=h(ju([o,i,a,l],e.angle,t),4),c=s[0],u=s[1],d=s[2],f=s[3],p=wn({sceneX:c,sceneY:u},t);tc(n,{left:p.x,top:p.y,width:d,height:f},"top"),xu=!0}},Tu=function(e,t,n){var r=h(n,2),o=r[0],i=r[1],a=xn({clientX:o,clientY:i},t),l=a.x,s=a.y,c=15/t.zoom.value;if(wi(e,[l,s],c))return!1;var u=h(gt(e),3),d=u[0],f=u[1],p=u[2];if(l>=d&&l<=p&&s>=f-85&&s<=f)return!1;var m=ku(e,t),g=m.x,v=m.y;return!(o>=g-c&&o<=g+320+10+c&&i>=v-c&&i<=v+c+10+42)};function Pu(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Au(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Au(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function Au(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Lu,Du=function(){var e=document.createElement("canvas").getContext("2d");return!!e&&(e.fillStyle="#f00",e.textBaseline="top",e.font="32px Arial",e.fillText("😀",0,0),0!==e.getImageData(12,12,1,1).data[0])}(),Ru=function(e,t,n,r,o,i,a,l){var s=arguments.length>8&&void 0!==arguments[8]&&arguments[8];e.save(),e.translate(i,a),e.rotate(l),s&&e.fillRect(t-i,n-a,r,o),e.strokeRect(t-i,n-a,r,o),e.restore()},zu=function(e,t,n,r){e.beginPath(),e.arc(t,n,r,0,2*Math.PI),e.fill(),e.stroke()},Nu=function(e,t,n,r,o,i,a){if(null===i)return{atLeastOneVisibleElement:!1};var l=a.renderScrollbars,s=void 0===l||l,u=a.renderSelection,d=void 0===u||u,f=a.renderGrid,p=void 0===f||f,m=a.isExporting,g=i.getContext("2d");g.setTransform(1,0,0,1,0,0),g.save(),g.scale(r,r);var v=i.width/r,b=i.height/r;m&&"dark"===a.theme&&(g.filter=c.ZF),"string"==typeof a.viewBackgroundColor?(("transparent"===a.viewBackgroundColor||5===a.viewBackgroundColor.length||9===a.viewBackgroundColor.length||/(hsla|rgba)\(/.test(a.viewBackgroundColor))&&g.clearRect(0,0,v,b),g.save(),g.fillStyle=a.viewBackgroundColor,g.fillRect(0,0,v,b),g.restore()):g.clearRect(0,0,v,b),g.save(),g.scale(a.zoom.value,a.zoom.value),p&&t.gridSize&&function(e,t,n,r,o,i){e.save(),e.strokeStyle="rgba(0,0,0,0.1)",e.beginPath();for(var a=n;a<n+o+2*t;a+=t)e.moveTo(a,r-t),e.lineTo(a,r+i+2*t);for(var l=r;l<r+i+2*t;l+=t)e.moveTo(n-t,l),e.lineTo(n+o+2*t,l);e.stroke(),e.restore()}(g,t.gridSize,-Math.ceil(a.zoom.value/t.gridSize)*t.gridSize+a.scrollX%t.gridSize,-Math.ceil(a.zoom.value/t.gridSize)*t.gridSize+a.scrollY%t.gridSize,v/a.zoom.value,b/a.zoom.value);var y,x,w,k,E,_=e.filter((function(e){return Vu(e,v,b,{zoom:a.zoom,offsetLeft:t.offsetLeft,offsetTop:t.offsetTop,scrollX:a.scrollX,scrollY:a.scrollY})}));if(_.forEach((function(e){try{Gr(e,o,g,a),m||Wu(e,g,t)}catch(n){console.error(n)}})),t.editingLinearElement){var S=aa.getElement(t.editingLinearElement.elementId);S&&(w=t,k=a,E=S,(x=g).save(),x.translate(k.scrollX,k.scrollY),x.lineWidth=1/k.zoom.value,aa.getPointsGlobalCoordinates(E).forEach((function(e,t){var n,r;x.strokeStyle="red",x.setLineDash([]),x.fillStyle=null!==(n=w.editingLinearElement)&&void 0!==n&&null!==(r=n.selectedPointsIndices)&&void 0!==r&&r.includes(t)?"rgba(255, 127, 127, 0.9)":"rgba(255, 255, 255, 0.9)";var o=aa.POINT_HANDLE_SIZE;zu(x,e[0],e[1],o/2/k.zoom.value)})),x.restore())}if(n)try{Gr(n,o,g,a)}catch(x){console.error(x)}if(ca(t)&&t.suggestedBindings.filter((function(e){return null!=e})).forEach((function(e){Fu(g,a,e)})),d&&!t.multiElement&&!t.editingLinearElement){var j,O=e.reduce((function(e,n){var r=[];if(t.selectedElementIds[n.id]&&!yo(t,n)&&r.push(jt.black),a.remoteSelectedElementIds[n.id]&&r.push.apply(r,A(a.remoteSelectedElementIds[n.id].map((function(e){return gu(e,t).background})))),r.length){var o=h(gt(n),4),i=o[0],l=o[1],s=o[2],c=o[3];e.push({angle:n.angle,elementX1:i,elementY1:l,elementX2:s,elementY2:c,selectionColors:r})}return e}),[]),I=function(t){var n=_o(e,t),r=h(Et(n),4),o=r[0],i=r[1],a=r[2],l=r[3];O.push({angle:0,elementX1:o,elementX2:a,elementY1:i,elementY2:l,selectionColors:[jt.black]})},M=Pu(wo(t));try{for(M.s();!(j=M.n()).done;)I(j.value)}catch(x){M.e(x)}finally{M.f()}t.editingGroupId&&I(t.editingGroupId),O.forEach((function(e){return Bu(g,a,e)}));var T=Dc(e,t);if(g.save(),g.translate(a.scrollX,a.scrollY),1===T.length){g.fillStyle=jt.white;var P=Vo(T[0],a.zoom,"mouse");t.viewModeEnabled||Hu(g,a,P,T[0].angle)}else if(T.length>1&&!t.isRotating){var L=4/a.zoom.value;g.fillStyle=jt.white;var D=h(Et(T),4),R=D[0],z=D[1],N=D[2],H=D[3],B=g.getLineDash();g.setLineDash([2/a.zoom.value]);var F=g.lineWidth;g.lineWidth=1/a.zoom.value,Ru(g,R-L,z-L,N-R+2*L,H-z+2*L,(R+N)/2,(z+H)/2,0),g.lineWidth=F,g.setLineDash(B);var U=Wo([R,z,N,H],0,a.zoom,"mouse",Ho);Hu(g,a,U,0)}g.restore()}for(var K in g.restore(),a.remotePointerViewportCoords){var W=a.remotePointerViewportCoords[K],V=W.x,G=W.y;V-=t.offsetLeft,G-=t.offsetTop;var Z=V<0||V>v-9||G<0||G>b-14;V=Math.max(V,0),V=Math.min(V,v-9),G=Math.max(G,0),G=Math.min(G,b-14);var Y=gu(K,t),X=Y.background,q=Y.stroke;g.save(),g.strokeStyle=q,g.fillStyle=X;var $=a.remotePointerUserStates[K];(Z||$===fu.AWAY)&&(g.globalAlpha=.48),a.remotePointerButton&&"down"===a.remotePointerButton[K]&&(g.beginPath(),g.arc(V,G,15,0,2*Math.PI,!1),g.lineWidth=3,g.strokeStyle="#ffffff88",g.stroke(),g.closePath(),g.beginPath(),g.arc(V,G,15,0,2*Math.PI,!1),g.lineWidth=1,g.strokeStyle=q,g.stroke(),g.closePath()),g.beginPath(),g.moveTo(V,G),g.lineTo(V+1,G+14),g.lineTo(V+4,G+9),g.lineTo(V+9,G+10),g.lineTo(V,G),g.fill(),g.stroke();var Q=a.remotePointerUsernames[K],J="";$===fu.AWAY?J=Du?"⚫️":" (".concat(fu.AWAY,")"):$===fu.IDLE?J=Du?"💤":" (".concat(fu.IDLE,")"):$===fu.ACTIVE&&(J=Du?"🟢":"");var ee="".concat(Q?"".concat(Q," "):"").concat(J);if(!Z&&ee){var te=V+9,ne=G+14,re=g.measureText(ee),oe=re.actualBoundingBoxDescent+re.actualBoundingBoxAscent;g.fillStyle=q,g.fillRect(te-1,ne-1,re.width+8+2,oe+8+2),g.fillStyle=X,g.fillRect(te,ne,re.width+8,oe+8),g.fillStyle=jt.white,g.fillText(ee,te+4,ne+4+re.actualBoundingBoxAscent)}g.restore(),g.closePath()}return s&&(y=function(e,t,n,r){var o=r.scrollX,i=r.scrollY,a=r.zoom;if(0===e.length)return{horizontal:null,vertical:null};var l=h(Et(e),4),s=l[0],c=l[1],u=l[2],d=l[3],f=t/a.value,p=n/a.value,m=t-f,g=n-p,v={top:parseInt(kn("sat")),bottom:parseInt(kn("sab")),left:parseInt(kn("sal")),right:parseInt(kn("sar"))},b=C().rtl,y=m/2-o+v.left,x=g/2-i+v.top,w=y+f-v.right,k=x+p-v.bottom,E=Math.min(s,y),_=Math.min(c,x),S=Math.max(u,w),j=Math.max(d,k);return{horizontal:y===E&&w===S?null:{x:Math.max(v.left,4)+(y-E)/(S-E)*t,y:n-6-Math.max(4,v.bottom),width:(w-y)/(S-E)*t-Math.max(8,v.left+v.right),height:6},vertical:x===_&&k===j?null:{x:b?Math.max(v.left,4):t-6-Math.max(v.right,4),y:(x-_)/(j-_)*n+Math.max(v.top,4),width:6,height:(k-x)/(j-_)*n-Math.max(8,v.top+v.bottom)}}}(e,v,b,a),g.save(),g.fillStyle="rgba(0,0,0,0.3)",g.strokeStyle="rgba(255,255,255,0.8)",[y.horizontal,y.vertical].forEach((function(e){e&&function(e,t,n,r,o,i){e.beginPath(),e.moveTo(t+i,n),e.lineTo(t+r-i,n),e.quadraticCurveTo(t+r,n,t+r,n+i),e.lineTo(t+r,n+o-i),e.quadraticCurveTo(t+r,n+o,t+r-i,n+o),e.lineTo(t+i,n+o),e.quadraticCurveTo(t,n+o,t,n+o-i),e.lineTo(t,n+i),e.quadraticCurveTo(t,n,t+i,n),e.closePath(),e.fill(),e.stroke()}(g,e.x,e.y,e.width,e.height,3)})),g.restore()),g.restore(),{atLeastOneVisibleElement:_.length>0,scrollBars:y}},Hu=function(e,t,n,r){Object.keys(n).forEach((function(o){var i=n[o];void 0!==i&&(e.save(),e.lineWidth=1/t.zoom.value,"rotation"===o?zu(e,i[0]+i[2]/2,i[1]+i[3]/2,i[2]/2):Ru(e,i[0],i[1],i[2],i[3],i[0]+i[2]/2,i[1]+i[3]/2,r,!0),e.restore())}))},Bu=function(e,t,n){var r=n.angle,o=n.elementX1,i=n.elementY1,a=n.elementX2,l=n.elementY2,s=n.selectionColors,c=a-o,u=l-i,d=4/t.zoom.value,f=8/t.zoom.value,p=4/t.zoom.value;e.save(),e.translate(t.scrollX,t.scrollY),e.lineWidth=1/t.zoom.value;for(var h=s.length,m=0;m<h;++m)e.strokeStyle=s[m],e.setLineDash([f,p+(f+p)*(h-1)]),e.lineDashOffset=(f+p)*m,Ru(e,o-d,i-d,c+2*d,u+2*d,o+c/2,i+u/2,r);e.restore()},Fu=function(e,t,n){var r=Array.isArray(n)?Ku:Uu;e.save(),e.translate(t.scrollX,t.scrollY),r(e,n),e.restore()},Uu=function(e,t){var n=h(gt(t),4),r=n[0],o=n[1],i=n[2]-r,a=n[3]-o,l=Ei(t,i,a);e.strokeStyle="rgba(0,0,0,.05)",e.lineWidth=l-4;var s,c,u,d,f,p,m=2+l/2;switch(t.type){case"rectangle":case"text":case"image":Ru(e,r-m,o-m,i+2*m,a+2*m,r+i/2,o+a/2,t.angle);break;case"diamond":var g=Math.hypot(i,a);s=e,c=i+m*g/a*2,u=a+m*g/i*2,d=r+i/2,f=o+a/2,p=t.angle,s.save(),s.translate(d,f),s.rotate(p),s.beginPath(),s.moveTo(0,u/2),s.lineTo(c/2,0),s.lineTo(0,-u/2),s.lineTo(-c/2,0),s.closePath(),s.stroke(),s.restore();break;case"ellipse":!function(e,t,n,r,o,i){e.beginPath(),e.ellipse(r,o,t/2,n/2,i,0,2*Math.PI),e.stroke()}(e,i+2*m,a+2*m,r+i/2,o+a/2,t.angle)}},Ku=function(e,t){var n=h(t,3),r=n[0],o=n[1],i=n[2],a=Ei(i,i.width,i.height);e.strokeStyle="rgba(0,0,0,0)",e.fillStyle="rgba(0,0,0,.05)",("both"===o?[0,-1]:"start"===o?[0]:[-1]).forEach((function(t){var n=h(aa.getPointAtIndexGlobalCoordinates(r,t),2),o=n[0],i=n[1];zu(e,o,i,a)}))},Wu=function(e,t,n){if(e.link&&!n.selectedElementIds[e.id]){var r=h(gt(e),4),o=r[0],i=r[1],a=r[2],l=r[3],s=h(ju([o,i,a,l],e.angle,n),4),c=s[0],u=s[1],d=s[2],f=s[3],p=c+d/2,m=u+f/2;if(t.save(),t.translate(n.scrollX+p,n.scrollY+m),t.rotate(e.angle),Lu&&Lu.zoom===n.zoom.value)t.drawImage(Lu,c-p,u-m,d,f);else{(Lu=document.createElement("canvas")).zoom=n.zoom.value,Lu.width=d*window.devicePixelRatio*n.zoom.value,Lu.height=f*window.devicePixelRatio*n.zoom.value;var g=Lu.getContext("2d");g.scale(window.devicePixelRatio*n.zoom.value,window.devicePixelRatio*n.zoom.value),g.fillStyle="#fff",g.fillRect(0,0,d,f),g.drawImage(yu,0,0,d,f),g.restore(),t.drawImage(Lu,c-p,u-m,d,f)}t.restore()}},Vu=function(e,t,n,r){var o=h(kt(e),4),i=o[0],a=o[1],l=o[2],s=o[3],c=xn({clientX:r.offsetLeft,clientY:r.offsetTop},r),u=xn({clientX:r.offsetLeft+t,clientY:r.offsetTop+n},r);return c.x<=l&&c.y<=s&&u.x>=i&&u.y>=a},Gu=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i=o.offsetX,a=void 0===i?0:i,l=o.offsetY,s=void 0===l?0:l,c=o.exportWithDarkMode,u=void 0!==c&&c;n&&e.forEach((function(e){if(!e.isDeleted)try{Yr(e,t,n,r,e.x+a,e.y+s,u)}catch(o){console.error(o)}}))},Zu=Object.defineProperty,Yu=(e,t)=>()=>(e&&(t=e(e=0)),t),Xu=(e,t)=>{for(var n in Zu(e,"__esModule",{value:!0}),t)Zu(e,n,{get:t[n],enumerable:!0})},qu={};Xu(qu,{default:()=>$u});var $u,Qu=Yu((()=>{$u=async(e=[{}])=>(Array.isArray(e)||(e=[e]),new Promise(((t,n)=>{let r=document.createElement("input");r.type="file";let o=[...e.map((e=>e.mimeTypes||[])).join(),e.map((e=>e.extensions||[])).join()].join();r.multiple=e[0].multiple||!1,r.accept=o||"";let i=e=>{"function"==typeof a&&a(),t(e)},a=e[0].legacySetup&&e[0].legacySetup(i,(()=>a(n)),r);r.addEventListener("change",(()=>{i(r.multiple?Array.from(r.files):r.files[0])})),r.click()})))})),Ju={};Xu(Ju,{default:()=>td});var ed,td,nd=Yu((()=>{ed=async e=>{let t=await e.getFile();return t.handle=e,t},td=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(ed));return e[0].multiple?r:r[0]}})),rd={};Xu(rd,{default:()=>od});var od,id=Yu((()=>{od=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 o=e=>{"function"==typeof i&&i(),t(e)},i=e[0].legacySetup&&e[0].legacySetup(o,(()=>i(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)),o(t)})),r.click()})))})),ad={};Xu(ad,{default:()=>sd});var ld,sd,cd=Yu((()=>{ld=async(e,t,n=e.name,r)=>{let o=[],i=[];for await(let a of e.values()){let l=`${n}/${a.name}`;"file"===a.kind?i.push(a.getFile().then((t=>(t.directoryHandle=e,Object.defineProperty(t,"webkitRelativePath",{configurable:!0,enumerable:!0,get:()=>l}))))):"directory"===a.kind&&t&&(!r||!r(a))&&o.push(ld(a,t,l,r))}return[...(await Promise.all(o)).flat(),...await Promise.all(i)]},sd=async(e={})=>{e.recursive=e.recursive||!1;let t=await window.showDirectoryPicker({id:e.id,startIn:e.startIn});return ld(t,e.recursive,void 0,e.skipDirectory)}})),ud={};Xu(ud,{default:()=>dd});var dd,fd=Yu((()=>{dd=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()}))}()}),o=new Response(r);return n.releaseLock(),new Blob([await o.blob()],{type:t})}(e.body,e.headers.get("content-type"))),n.download=t.fileName||"Untitled",n.href=URL.createObjectURL(r);let o=()=>{"function"==typeof i&&i()},i=t.legacySetup&&t.legacySetup(o,(()=>i(reject)),n);return n.addEventListener("click",(()=>{setTimeout((()=>URL.revokeObjectURL(n.href)),3e4),o()})),n.click(),null}})),pd={};Xu(pd,{default:()=>hd});var hd,md=Yu((()=>{hd=async(e,t=[{}],n=null,r=!1)=>{Array.isArray(t)||(t=[t]),t[0].fileName=t[0].fileName||"Untitled";let o=[];if(t.forEach(((t,n)=>{o[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=>{o[n].accept[e]=t.extensions||[]}))):e.type&&(o[n].accept[e.type]=t.extensions||[])})),n)try{await n.getFile()}catch(l){if(n=null,r)throw l}let i=n||await window.showSaveFilePicker({suggestedName:t[0].fileName,id:t[0].id,startIn:t[0].startIn,types:o,excludeAcceptAllOption:t[0].excludeAcceptAllOption||!1}),a=await i.createWritable();return"stream"in e?(await e.stream().pipeTo(a),i):"body"in e?(await e.body.pipeTo(a),i):(await a.write(blob),await a.close(),i)}})),gd=(()=>{if("undefined"==typeof self)return!1;if("top"in self&&self!==top)try{top.location}catch{return!1}else if("showOpenFilePicker"in self)return"showOpenFilePicker";return!1})(),vd=gd?Promise.resolve().then((()=>(nd(),Ju))):Promise.resolve().then((()=>(Qu(),qu)));gd?Promise.resolve().then((()=>(cd(),ad))):Promise.resolve().then((()=>(id(),rd)));var bd=gd?Promise.resolve().then((()=>(md(),pd))):Promise.resolve().then((()=>(fd(),ud))),yd=function(e){var t,n,r,o=null===(t=e.extensions)||void 0===t?void 0:t.reduce((function(e,t){return e.push(c.LO[t]),e}),[]),i=null===(n=e.extensions)||void 0===n?void 0:n.reduce((function(e,t){return"jpg"===t?e.concat(".jpg",".jpeg"):e.concat(".".concat(t))}),[]);return async function(...e){return(await vd).default(...e)}({description:e.description,extensions:i,mimeTypes:o,multiple:null!==(r=e.multiple)&&void 0!==r&&r,legacySetup:function(t,n,r){var o=fn(n,500),i=function(){a(),document.addEventListener(c.Ks.KEYUP,o),document.addEventListener(c.Ks.POINTER_UP,o),o()},a=function(){var n;if(null!==(n=r.files)&&void 0!==n&&n.length){var o=e.multiple?A(r.files):r.files[0];t(o)}};requestAnimationFrame((function(){window.addEventListener(c.Ks.FOCUS,i)}));var l=window.setInterval((function(){a()}),500);return function(e){clearInterval(l),o.cancel(),window.removeEventListener(c.Ks.FOCUS,i),document.removeEventListener(c.Ks.KEYUP,o),document.removeEventListener(c.Ks.POINTER_UP,o),e&&(console.warn("Opening the file was canceled (legacy-fs)."),e(new Vs))}}})},xd=function(e,t){return async function(...e){return(await bd).default(...e)}(e,{fileName:"".concat(t.name,".").concat(t.extension),description:t.description,extensions:[".".concat(t.extension)]},t.fileHandle)};function wd(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return kd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kd(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function kd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ed(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ed(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ed(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Sd={selection:!0,text:!0,rectangle:!0,diamond:!0,ellipse:!0,line:!0,image:!0,arrow:!0,freedraw:!0},Cd=function(e,t){var n,r,o,i,a,l,s,c,u,d,f,p,h,m,g={type:t.type||e.type,version:e.version||1,versionNonce:null!==(n=e.versionNonce)&&void 0!==n?n:0,isDeleted:null!==(r=e.isDeleted)&&void 0!==r&&r,id:e.id||ro(),fillStyle:e.fillStyle||"hachure",strokeWidth:e.strokeWidth||1,strokeStyle:null!==(o=e.strokeStyle)&&void 0!==o?o:"solid",roughness:null!==(i=e.roughness)&&void 0!==i?i:1,opacity:null==e.opacity?100:e.opacity,angle:e.angle||0,x:null!==(a=null!==(l=t.x)&&void 0!==l?l:e.x)&&void 0!==a?a:0,y:null!==(s=null!==(c=t.y)&&void 0!==c?c:e.y)&&void 0!==s?s:0,strokeColor:e.strokeColor,backgroundColor:e.backgroundColor,width:e.width||0,height:e.height||0,seed:null!==(u=e.seed)&&void 0!==u?u:1,groupIds:null!==(d=e.groupIds)&&void 0!==d?d:[],strokeSharpness:null!==(f=e.strokeSharpness)&&void 0!==f?f:qe(e.type)?"round":"sharp",boundElements:e.boundElementIds?e.boundElementIds.map((function(e){return{type:"arrow",id:e}})):null!==(p=e.boundElements)&&void 0!==p?p:[],updated:null!==(h=e.updated)&&void 0!==h?h:Mn(),link:null!==(m=e.link)&&void 0!==m?m:null};return _d(_d(_d({},g),fo(g)),t)},jd=function(e){var t,n,r;switch(e.type){case"text":var o=e.fontSize,i=e.fontFamily;if("font"in e){var a=h(e.font.split(" "),2),l=a[0],s=a[1];o=parseInt(l,10),r=s,i=Object.keys(c.ut).includes(r)?c.ut[r]:c.rk}return Cd(e,{fontSize:o,fontFamily:i,text:null!==(t=e.text)&&void 0!==t?t:"",baseline:e.baseline,textAlign:e.textAlign||c.Hg,verticalAlign:e.verticalAlign||c.hs,containerId:null!==(n=e.containerId)&&void 0!==n?n:null,originalText:e.originalText||e.text});case"freedraw":return Cd(e,{points:e.points,lastCommittedPoint:null,simulatePressure:e.simulatePressure,pressures:e.pressures});case"image":return Cd(e,{status:e.status||"pending",fileId:e.fileId,scale:e.scale||[1,1]});case"line":case"draw":case"arrow":var u=e.startArrowhead,d=void 0===u?null:u,f=e.endArrowhead,p=void 0===f?"arrow"===e.type?"arrow":null:f,m=e.x,g=e.y,v=!Array.isArray(e.points)||e.points.length<2?[[0,0],[e.width,e.height]]:e.points;if(0!==v[0][0]||0!==v[0][1]){var b=aa.getNormalizedPoints(e);v=b.points,m=b.x,g=b.y}return Cd(e,{type:"draw"===e.type?"line":e.type,startBinding:e.startBinding,endBinding:e.endBinding,lastCommittedPoint:null,startArrowhead:d,endArrowhead:p,points:v,x:m,y:g});case"ellipse":case"rectangle":case"diamond":return Cd(e,{})}},Od=function(e,t){var n=t?Tn(t):null;return(e||[]).reduce((function(e,t){if("selection"!==t.type&&!co(t)){var r=jd(t);if(r){var o=null==n?void 0:n.get(t.id);o&&o.version>r.version&&(r=so(r,o.version)),e.push(r)}}return e}),[])},Id=function(e,t){e=e||{};var n,r=zn(),o={},i=wd(Object.entries(r));try{for(i.s();!(n=i.n()).done;){var a=h(n.value,2),l=a[0],s=a[1],c=e[l],u=t?t[l]:void 0;o[l]=void 0!==c?c:void 0!==u?u:s}}catch(d){i.e(d)}finally{i.f()}return _d(_d({},o),{},{elementType:Sd[o.elementType]?o.elementType:"selection",zoom:"number"==typeof e.zoom?{value:e.zoom}:e.zoom||r.zoom})},Md=function(e,t,n){return{elements:Od(null==e?void 0:e.elements,n),appState:Id(null==e?void 0:e.appState,t||null),files:(null==e?void 0:e.files)||{}}},Td=function(e,t){var n,r=[],o=wd(e);try{for(o.s();!(n=o.n()).done;){var i=n.value;if(Array.isArray(i))r.push({status:t,elements:i,id:ro(),created:Date.now()});else{var a=i;r.push(_d(_d({},a),{},{id:a.id||ro(),status:a.status||t,created:a.created||Date.now()}))}}}catch(l){o.e(l)}finally{o.f()}return r};function Pd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ad(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pd(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pd(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ld=function(){var e=(0,d.Z)(g().mark((function e(t){var r;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.type!==c.LO.png){e.next=18;break}return e.prev=1,e.next=4,Promise.all([n.e(736),n.e(499)]).then(n.bind(n,673));case 4:return e.next=6,e.sent.decodePngMetadata(t);case 6:return e.abrupt("return",e.sent);case 9:if(e.prev=9,e.t0=e.catch(1),"INVALID"!==e.t0.message){e.next=15;break}throw new DOMException(O("alerts.imageDoesNotContainScene"),"EncodingError");case 15:throw new DOMException(O("alerts.cannotRestoreFromImage"),"EncodingError");case 16:e.next=43;break;case 18:if(!("text"in Blob)){e.next=24;break}return e.next=21,t.text();case 21:r=e.sent,e.next=27;break;case 24:return e.next=26,new Promise((function(e){var n=new FileReader;n.readAsText(t,"utf8"),n.onloadend=function(){n.readyState===FileReader.DONE&&e(n.result)}}));case 26:r=e.sent;case 27:if(t.type!==c.LO.svg){e.next=43;break}return e.prev=28,e.next=31,Promise.all([n.e(736),n.e(499)]).then(n.bind(n,673));case 31:return e.next=33,e.sent.decodeSvgMetadata({svg:r});case 33:return e.abrupt("return",e.sent);case 36:if(e.prev=36,e.t1=e.catch(28),"INVALID"!==e.t1.message){e.next=42;break}throw new DOMException(O("alerts.imageDoesNotContainScene"),"EncodingError");case 42:throw new DOMException(O("alerts.cannotRestoreFromImage"),"EncodingError");case 43:return e.abrupt("return",r);case 44:case"end":return e.stop()}}),e,null,[[1,9],[28,36]])})));return function(t){return e.apply(this,arguments)}}(),Dd=function(e){var t;return e&&(null===(t=e.name.match(/\.(json|excalidraw|png|svg)$/))||void 0===t?void 0:t[1])||null},Rd=function(e){var t=Dd(e);return"png"===t||"svg"===t},zd=function(e){var t=(e||{}).type;return!!t&&c.jo.includes(t)},Nd=function(){var e=(0,d.Z)(g().mark((function e(t,n,r){var o,i,a;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ld(t);case 2:if(o=e.sent,e.prev=3,i=JSON.parse(o),Qd(i)){e.next=7;break}throw new Error(O("alerts.couldNotLoadInvalidFile"));case 7:return a=Md({elements:Tc(i.elements||[]),appState:Ad(Ad({theme:null==n?void 0:n.theme,fileHandle:t.handle||null},Bn(i.appState||{})),n?$s(i.elements||[],n):{}),files:i.files},n,r),e.abrupt("return",a);case 11:throw e.prev=11,e.t0=e.catch(3),console.error(e.t0.message),new Error(O("alerts.couldNotLoadInvalidFile"));case 15:case"end":return e.stop()}}),e,null,[[3,11]])})));return function(t,n,r){return e.apply(this,arguments)}}(),Hd=function(){var e=(0,d.Z)(g().mark((function e(t){var n,r;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ld(t);case 2:if(n=e.sent,(r=JSON.parse(n)).type===c.r8.excalidrawLibrary){e.next=6;break}throw new Error(O("alerts.couldNotLoadInvalidFile"));case 6:return e.abrupt("return",r);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Bd=function(){var e=(0,d.Z)(g().mark((function e(t){return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){try{t.toBlob((function(t){if(!t)return n(new Ws(O("canvasError.canvasTooBig"),"CANVAS_POSSIBLY_TOO_BIG"));e(t)}))}catch(r){n(r)}})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Fd=function(){var e=(0,d.Z)(g().mark((function e(t){var n;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.t0=window.crypto.subtle,e.next=4,t.arrayBuffer();case 4:return e.t1=e.sent,e.next=7,e.t0.digest.call(e.t0,"SHA-1",e.t1);case 7:return n=e.sent,e.abrupt("return",(r=new Uint8Array(n),Array.from(r).map((function(e){return"0".concat(e.toString(16)).slice(-2)})).join("")));case 11:return e.prev=11,e.t2=e.catch(0),console.error(e.t2),e.abrupt("return",Ke(40));case 15:case"end":return e.stop()}var r}),e,null,[[0,11]])})));return function(t){return e.apply(this,arguments)}}(),Ud=function(){var e=(0,d.Z)(g().mark((function e(t){return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){var r=new FileReader;r.onload=function(){var t=r.result;e(t)},r.onerror=function(e){return n(e)},r.readAsDataURL(t)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Kd=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e.indexOf(","),r=atob(e.slice(n+1)),o=e.slice(0,n).split(":")[1].split(";")[0],i=new ArrayBuffer(r.length),a=new Uint8Array(i),l=0;l<r.length;l++)a[l]=r.charCodeAt(l);return new File([i],t,{type:o})},Wd=function(){var e=(0,d.Z)(g().mark((function e(t,r){var o,i,a,l,s,u;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.type!==c.LO.svg){e.next=2;break}return e.abrupt("return",t);case 2:return e.next=4,Promise.all([n.e(736).then(n.t.bind(n,4881,23)).then((function(e){return e.default})),n.e(736).then(n.bind(n,100)).then((function(e){return e.default}))]);case 4:if(o=e.sent,i=h(o,2),a=i[0],l=i[1],s=l({pica:a({features:["js","wasm"]})}),r.outputType&&(u=r.outputType,s._create_blob=function(e){return this.pica.toBlob(e.out_canvas,u,.8).then((function(t){return e.out_blob=t,e}))}),zd(t)){e.next=12;break}throw new Error(O("errors.unsupportedFileType"));case 12:return e.t0=File,e.next=15,s.toBlob(t,{max:r.maxWidthOrHeight});case 15:return e.t1=e.sent,e.t2=[e.t1],e.t3=t.name,e.t4={type:r.outputType||t.type},e.abrupt("return",new e.t0(e.t2,e.t3,e.t4));case 20:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),Vd=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return new File([(new TextEncoder).encode(e)],t,{type:c.LO.svg})};function Gd(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Zd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Zd(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function Zd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Yd=function(e,t){var n,r={},o=Gd(e);try{for(o.s();!(n=o.n()).done;){var i=n.value;!i.isDeleted&&"fileId"in i&&i.fileId&&t[i.fileId]&&(r[i.fileId]=t[i.fileId])}}catch(a){o.e(a)}finally{o.f()}return r},Xd=function(e,t,n,r){var o={type:c.r8.excalidraw,version:c.Kr.excalidraw,source:c.pb,elements:"local"===r?Tc(e):Mc(e),appState:"local"===r?Bn(t):Fn(t),files:"local"===r?Yd(e,n):void 0};return JSON.stringify(o,null,2)},qd=function(){var e=(0,d.Z)(g().mark((function e(t,n,r){var o,i,a;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=Xd(t,n,r,"local"),i=new Blob([o],{type:c.LO.excalidraw}),e.next=4,xd(i,{name:n.name,extension:"excalidraw",description:"Excalidraw file",fileHandle:Rd(n.fileHandle)?null:n.fileHandle});case 4:return a=e.sent,e.abrupt("return",{fileHandle:a});case 6:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),$d=function(){var e=(0,d.Z)(g().mark((function e(t,n){var r;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,yd({description:"Excalidraw files"});case 2:return r=e.sent,e.abrupt("return",Nd(r,t,n));case 4:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),Qd=function(e){return(null==e?void 0:e.type)===c.r8.excalidraw&&(!e.elements||Array.isArray(e.elements)&&(!e.appState||"object"===P(e.appState)))},Jd=function(e){return"object"===P(e)&&e&&e.type===c.r8.excalidrawLibrary&&(1===e.version||2===e.version)},ef=function(){var e=(0,d.Z)(g().mark((function e(t){var n,r;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={type:c.r8.excalidrawLibrary,version:c.Kr.excalidrawLibrary,source:c.pb,libraryItems:t},r=JSON.stringify(n,null,2),e.next=4,xd(new Blob([r],{type:c.LO.excalidrawlib}),{name:"library",extension:"excalidrawlib",description:"Excalidraw library file"});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),tf=function(){var e=(0,d.Z)(g().mark((function e(t){var n;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,yd({description:"Excalidraw library files"});case 2:return n=e.sent,e.next=5,t.importLibrary(n);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function nf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nf(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var of=function(e){return new Promise((function(t,n){var r=new Image;r.onload=function(){t(r)},r.onerror=function(e){n(e)},r.src=e}))},af=function(){var e=(0,d.Z)(g().mark((function e(t){var n,r,o,i,a;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.fileIds,r=t.files,o=t.imageCache,i=new Map,a=new Map,e.next=5,Promise.all(n.reduce((function(e,t){var n=r[t];return n&&!i.has(t)?(i.set(t,!0),e.concat((0,d.Z)(g().mark((function e(){var r,i,l;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,n.mimeType!==c.LO.binary){e.next=3;break}throw new Error("Only images can be added to ImageCache");case 3:return r=of(n.dataURL),i={image:r,mimeType:n.mimeType},o.set(t,i),e.next=8,r;case 8:l=e.sent,o.set(t,rf(rf({},i),{},{image:l})),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),a.set(t,!0);case 15:case"end":return e.stop()}}),e,null,[[0,12]])})))())):e}),[]));case 5:return e.abrupt("return",{imageCache:o,updatedFiles:i,erroredFiles:a});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),lf=function(e){return e.filter((function(e){return We(e)}))},sf=function(){var e=(0,d.Z)(g().mark((function e(t){var n,r;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(new DOMParser).parseFromString(t,c.LO.svg),r=n.querySelector("svg"),!n.querySelector("parsererror")&&"svg"===(null==(o=r)?void 0:o.nodeName.toLowerCase())){e.next=7;break}throw new Error(O("errors.invalidSVGString"));case 7:return r.hasAttribute("xmlns")||r.setAttribute("xmlns",c.hR),e.abrupt("return",r.outerHTML);case 9:case"end":return e.stop()}var o}),e)})));return function(t){return e.apply(this,arguments)}}(),cf="\x3c!-- svg-source:excalidraw --\x3e",uf=function(){var e=(0,d.Z)(g().mark((function e(t,n,r,o){var i,a,l,s,u,d,f,p,m,v,b,y,x,w,k,E,_,S,C=arguments;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=o.exportBackground,a=o.exportPadding,l=void 0===a?c.qy:a,s=o.viewBackgroundColor,u=C.length>4&&void 0!==C[4]?C[4]:function(e,t){var r=document.createElement("canvas");return r.width=e*n.exportScale,r.height=t*n.exportScale,{canvas:r,scale:n.exportScale}},d=ff(t,l),f=h(d,4),p=f[0],m=f[1],v=f[2],b=f[3],y=u(v,b),x=y.canvas,w=y.scale,k=void 0===w?1:w,E=zn(),e.next=7,af({imageCache:new Map,fileIds:lf(t).map((function(e){return e.fileId})),files:r});case 7:return _=e.sent,S=_.imageCache,Nu(t,n,null,k,Be.canvas(x),x,{viewBackgroundColor:i?s:null,scrollX:-p+l,scrollY:-m+l,zoom:E.zoom,remotePointerViewportCoords:{},remoteSelectedElementIds:{},shouldCacheIgnoreZoom:!1,remotePointerUsernames:{},remotePointerUserStates:{},theme:n.exportWithDarkMode?"dark":"light",imageCache:S,renderScrollbars:!1,renderSelection:!1,renderGrid:!1,isExporting:!0}),e.abrupt("return",x);case 11:case"end":return e.stop()}}),e)})));return function(t,n,r,o){return e.apply(this,arguments)}}(),df=function(){var e=(0,d.Z)(g().mark((function e(t,r,o){var i,a,l,s,u,d,f,p,m,v,b,y,x,w,k,E;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=r.exportPadding,a=void 0===i?c.qy:i,l=r.viewBackgroundColor,s=r.exportScale,u=void 0===s?1:s,d=r.exportEmbedScene,f="",!d){e.next=14;break}return e.prev=3,e.next=6,Promise.all([n.e(736),n.e(499)]).then(n.bind(n,673));case 6:return e.next=8,e.sent.encodeSvgMetadata({text:Xd(t,r,o||{},"local")});case 8:f=e.sent,e.next=14;break;case 11:e.prev=11,e.t0=e.catch(3),console.error(e.t0);case 14:return p=ff(t,a),m=h(p,4),v=m[0],b=m[1],y=m[2],x=m[3],(w=document.createElementNS(c.hR,"svg")).setAttribute("version","1.1"),w.setAttribute("xmlns",c.hR),w.setAttribute("viewBox","0 0 ".concat(y," ").concat(x)),w.setAttribute("width","".concat(y*u)),w.setAttribute("height","".concat(x*u)),r.exportWithDarkMode&&w.setAttribute("filter",c.ZF),w.innerHTML="\n ".concat(cf,"\n ").concat(f,'\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 '),r.exportBackground&&l&&((k=w.ownerDocument.createElementNS(c.hR,"rect")).setAttribute("x","0"),k.setAttribute("y","0"),k.setAttribute("width","".concat(y)),k.setAttribute("height","".concat(x)),k.setAttribute("fill",l),w.appendChild(k)),E=Be.svg(w),Gu(t,E,w,o||{},{offsetX:-v+a,offsetY:-b+a,exportWithDarkMode:r.exportWithDarkMode}),e.abrupt("return",w);case 27:case"end":return e.stop()}}),e,null,[[3,11]])})));return function(t,n,r){return e.apply(this,arguments)}}(),ff=function(e,t){var n=h(Et(e),4),r=n[0],o=n[1],i=n[2],a=n[3];return[r,o,hn(r,i)+2*t,hn(o,a)+t+t]};function pf(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return hf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hf(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function hf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function mf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mf(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var vf=32,bf=12,yf=256,xf="NOT_SPREADSHEET",wf="VALID_SPREADSHEET",kf=function(e){var t=/^[$€£¥₩]?([0-9,]+(\.[0-9]+)?)$/.exec(e);return t?parseFloat(t[1].replace(/,/g,"")):null},Ef=function(e,t){return e.slice(1).every((function(e){return null!==kf(e[t])}))},_f=function(e){var t=e[0].length;if(t>2)return{type:xf,reason:"More than 2 columns"};if(1===t){if(!Ef(e,0))return{type:xf,reason:"Value is not numeric"};var n=null===kf(e[0][0]),r=(n?e.slice(1):e).map((function(e){return kf(e[0])}));return r.length<2?{type:xf,reason:"Less than two rows"}:{type:wf,spreadsheet:{title:n?e[0][0]:null,labels:null,values:r}}}var o=Ef(e,0)?0:1;if(!Ef(e,o))return{type:xf,reason:"Value is not numeric"};var i=(o+1)%2,a=null===kf(e[0][o]),l=a?e.slice(1):e;return l.length<2?{type:xf,reason:"Less than 2 rows"}:{type:wf,spreadsheet:{title:a?e[0][o]:null,labels:l.map((function(e){return e[i]})),values:l.map((function(e){return kf(e[o])}))}}},Sf=It.elementBackground.slice(2,It.elementBackground.length),Cf={fillStyle:"hachure",fontFamily:c.rk,fontSize:c.n5,opacity:100,roughness:1,strokeColor:It.elementStroke[0],strokeSharpness:"sharp",strokeStyle:"solid",strokeWidth:1,verticalAlign:"middle"},jf=function(e){return{chartWidth:44*e.values.length+bf,chartHeight:280}},Of=function(e,t,n,r,o,i){var a,l,s,u,d,f=jf(e),p=f.chartWidth,h=f.chartHeight,m=e.title?Ao(gf(gf({backgroundColor:o,groupIds:[r]},Cf),{},{text:e.title,x:t+p/2,y:n-yf-24-c.n5,strokeSharpness:"sharp",strokeStyle:"solid",textAlign:"center"})):null,g=i?To(gf(gf({backgroundColor:o,groupIds:[r]},Cf),{},{type:"rectangle",x:t,y:n-h,width:p,height:h,strokeColor:It.elementStroke[0],fillStyle:"solid",opacity:6})):null;return[].concat(A(g?[g]:[]),A(m?[m]:[]),A((a=t,l=n,s=r,u=o,(null===(d=e.labels)||void 0===d?void 0:d.map((function(e,t){return Ao(gf(gf({groupIds:[s],backgroundColor:u},Cf),{},{text:e.length>8?"".concat(e.slice(0,5),"..."):e,x:a+44*t+24,y:l+6,width:vf,angle:5.87,fontSize:16,textAlign:"center",verticalAlign:"top"}))})))||[])),A(function(e,t,n,r,o){var i=Ao(gf(gf({groupIds:[r],backgroundColor:o},Cf),{},{x:t-bf,y:n-bf,text:"0",textAlign:"right"}));return[i,Ao(gf(gf({groupIds:[r],backgroundColor:o},Cf),{},{x:t-bf,y:n-yf-i.height/2,text:Math.max.apply(Math,A(e.values)).toLocaleString(),textAlign:"right"}))]}(e,t,n,r,o)),A(function(e,t,n,r,o){var i=jf(e),a=i.chartWidth,l=i.chartHeight;return[Do(gf(gf({backgroundColor:o,groupIds:[r]},Cf),{},{type:"line",x:t,y:n,startArrowhead:null,endArrowhead:null,width:a,points:[[0,0],[a,0]]})),Do(gf(gf({backgroundColor:o,groupIds:[r]},Cf),{},{type:"line",x:t,y:n,startArrowhead:null,endArrowhead:null,height:l,points:[[0,0],[0,-l]]})),Do(gf(gf({backgroundColor:o,groupIds:[r]},Cf),{},{type:"line",x:t,y:n-yf-bf,startArrowhead:null,endArrowhead:null,strokeStyle:"dotted",width:a,opacity:50,points:[[0,0],[a,0]]}))]}(e,t,n,r,o)))},If=function(e,t,n,r){return"line"===e?function(e,t,n){var r,o=Math.max.apply(Math,A(e.values)),i=ro(),a=Sf[Math.floor(Math.random()*Sf.length)],l=0,s=[],u=pf(e.values);try{for(u.s();!(r=u.n()).done;){var d=r.value,f=44*l,p=-d/o*yf;s.push([f,p]),l++}}catch(w){u.e(w)}finally{u.f()}var h=Math.max.apply(Math,A(s.map((function(e){return e[0]})))),m=Math.max.apply(Math,A(s.map((function(e){return e[1]})))),g=Math.min.apply(Math,A(s.map((function(e){return e[0]})))),v=Math.min.apply(Math,A(s.map((function(e){return e[1]})))),b=Do(gf(gf({backgroundColor:a,groupIds:[i]},Cf),{},{type:"line",x:t+bf+16,y:n-bf,startArrowhead:null,endArrowhead:null,height:m-v,width:h-g,strokeWidth:2,points:s})),y=e.values.map((function(e,r){var l=44*r+6,s=-e/o*yf+6;return To(gf(gf({backgroundColor:a,groupIds:[i]},Cf),{},{fillStyle:"solid",strokeWidth:2,type:"ellipse",x:t+l+16,y:n+s-24,width:bf,height:bf}))})),x=e.values.map((function(e,r){var l=44*r+6,s=e/o*yf+6+bf;return Do(gf(gf({backgroundColor:a,groupIds:[i]},Cf),{},{type:"line",x:t+l+16+6,y:n-s,startArrowhead:null,endArrowhead:null,height:s,strokeStyle:"dotted",opacity:50,points:[[0,0],[0,s]]}))}));return[].concat(A(Of(e,t,n,i,a,"production"===c.Vi.DEVELOPMENT)),[b],A(x),A(y))}(t,n,r):(o=t,i=n,a=r,l=Math.max.apply(Math,A(o.values)),s=ro(),u=Sf[Math.floor(Math.random()*Sf.length)],d=o.values.map((function(e,t){var n=e/l*yf;return To(gf(gf({backgroundColor:u,groupIds:[s]},Cf),{},{type:"rectangle",x:i+44*t+bf,y:a-n-bf,width:vf,height:n}))})),[].concat(A(d),A(Of(o,i,a,s,u,"production"===c.Vi.DEVELOPMENT))));var o,i,a,l,s,u,d},Mf="",Tf=!1,Pf="clipboard"in navigator&&"readText"in navigator.clipboard,Af="clipboard"in navigator&&"writeText"in navigator.clipboard,Lf="clipboard"in navigator&&"write"in navigator.clipboard&&"ClipboardItem"in window&&"toBlob"in HTMLCanvasElement.prototype,Df=function(){var e=(0,d.Z)(g().mark((function e(t,n,r){var o,i,a;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=Dc(t,n,!0),i={type:c.r8.excalidrawClipboard,elements:o,files:o.reduce((function(e,t){return We(t)&&r[t.fileId]&&(e[t.fileId]=r[t.fileId]),e}),{})},a=JSON.stringify(i),Mf=a,e.prev=4,Tf=!1,e.next=8,Ff(a);case 8:e.next=14;break;case 10:e.prev=10,e.t0=e.catch(4),Tf=!0,console.error(e.t0);case 14:case"end":return e.stop()}}),e,null,[[4,10]])})));return function(t,n,r){return e.apply(this,arguments)}}(),Rf=function(){if(!Mf)return{};try{return JSON.parse(Mf)}catch(k){return console.error(k),{}}},zf=function(e){var t=function(e){var t=e.trim().split("\n").map((function(e){return e.trim().split("\t")}));if(t.length&&2!==t[0].length&&(t=e.trim().split("\n").map((function(e){return e.trim().split(",")}))),0===t.length)return{type:xf,reason:"No values"};var n=t[0].length;if(!t.every((function(e){return e.length===n})))return{type:xf,reason:"All rows don't have same number of columns"};var r=_f(t);if(r.type!==wf){var o=_f(function(e){for(var t=[],n=0;n<e[0].length;n++){for(var r=[],o=0;o<e.length;o++)r.push(e[o][n]);t.push(r)}return t}(t));if(o.type===wf)return o}return r}(e);return t.type===wf?{spreadsheet:t.spreadsheet}:null},Nf=function(){var e=(0,d.Z)(g().mark((function e(t){var n,r;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!t){e.next=5;break}e.t0=null===(n=t.clipboardData)||void 0===n?void 0:n.getData("text/plain").trim(),e.next=11;break;case 5:if(e.t1=Pf,!e.t1){e.next=10;break}return e.next=9,navigator.clipboard.readText();case 9:e.t1=e.sent;case 10:e.t0=e.t1;case 11:return r=e.t0,e.abrupt("return",r||"");case 15:return e.prev=15,e.t2=e.catch(0),e.abrupt("return","");case 18:case"end":return e.stop()}}),e,null,[[0,15]])})));return function(t){return e.apply(this,arguments)}}(),Hf=function(){var e=(0,d.Z)(g().mark((function e(t){var n,r,o,i;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Nf(t);case 2:if((n=e.sent)&&!n.includes(cf)){e.next=5;break}return e.abrupt("return",Rf());case 5:if(!(r=zf(n))){e.next=8;break}return e.abrupt("return",r);case 8:if(o=Rf(),e.prev=9,a=i=JSON.parse(n),![c.r8.excalidraw,c.r8.excalidrawClipboard].includes(null==a?void 0:a.type)||!Array.isArray(a.elements)){e.next=13;break}return e.abrupt("return",{elements:i.elements,files:i.files});case 13:return e.abrupt("return",o);case 16:return e.prev=16,e.t0=e.catch(9),e.abrupt("return",Tf&&o.elements?o:{text:n});case 19:case"end":return e.stop()}var a}),e,null,[[9,16]])})));return function(t){return e.apply(this,arguments)}}(),Bf=function(){var e=(0,d.Z)(g().mark((function e(t){return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,navigator.clipboard.write([new window.ClipboardItem(L({},c.LO.png,t))]);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ff=function(){var e=(0,d.Z)(g().mark((function e(t){var n;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=!1,!Af){e.next=11;break}return e.prev=2,e.next=5,navigator.clipboard.writeText(t||"");case 5:n=!0,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(2),console.error(e.t0);case 11:if(n||Uf(t||" ")){e.next=13;break}throw new Error("couldn't copy");case 13:case"end":return e.stop()}}),e,null,[[2,8]])})));return function(t){return e.apply(this,arguments)}}(),Uf=function(e){var t="rtl"===document.documentElement.getAttribute("dir"),n=document.createElement("textarea");n.style.border="0",n.style.padding="0",n.style.margin="0",n.style.position="absolute",n.style[t?"right":"left"]="-9999px";var r=window.pageYOffset||document.documentElement.scrollTop;n.style.top="".concat(r,"px"),n.style.fontSize="12pt",n.setAttribute("readonly",""),n.value=e,document.body.appendChild(n);var o=!1;try{n.select(),n.setSelectionRange(0,n.value.length),o=document.execCommand("copy")}catch(i){console.error(i)}return n.remove(),o},Kf=function(){var e=(0,d.Z)(g().mark((function e(t,r,o,i,a){var l,s,u,d,f,p,h,m,v,b;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l=a.exportBackground,s=a.exportPadding,u=void 0===s?c.qy:s,d=a.viewBackgroundColor,f=a.name,p=a.fileHandle,h=void 0===p?null:p,0!==r.length){e.next=3;break}throw new Error(O("alerts.cannotExportEmptyCanvas"));case 3:if("svg"!==t&&"clipboard-svg"!==t){e.next=17;break}return e.next=6,df(r,{exportBackground:l,exportWithDarkMode:o.exportWithDarkMode,viewBackgroundColor:d,exportPadding:u,exportScale:o.exportScale,exportEmbedScene:o.exportEmbedScene&&"svg"===t},i);case 6:if(m=e.sent,"svg"!==t){e.next=13;break}return e.next=10,xd(new Blob([m.outerHTML],{type:c.LO.svg}),{description:"Export to SVG",name:f,extension:"svg",fileHandle:h});case 10:return e.abrupt("return",e.sent);case 13:if("clipboard-svg"!==t){e.next=17;break}return e.next=16,Ff(m.outerHTML);case 16:return e.abrupt("return");case 17:return e.next=19,uf(r,o,i,{exportBackground:l,viewBackgroundColor:d,exportPadding:u});case 19:return(v=e.sent).style.display="none",document.body.appendChild(v),e.next=24,Bd(v);case 24:if(b=e.sent,v.remove(),"png"!==t){e.next=38;break}if(!o.exportEmbedScene){e.next=33;break}return e.next=30,Promise.all([n.e(736),n.e(499)]).then(n.bind(n,673));case 30:return e.next=32,e.sent.encodePngMetadata({blob:b,metadata:Xd(r,o,i,"local")});case 32:b=e.sent;case 33:return e.next=35,xd(b,{description:"Export to PNG",name:f,extension:"png",fileHandle:h});case 35:return e.abrupt("return",e.sent);case 38:if("clipboard"!==t){e.next=49;break}return e.prev=39,e.next=42,Bf(b);case 42:e.next=49;break;case 44:if(e.prev=44,e.t0=e.catch(39),"CANVAS_POSSIBLY_TOO_BIG"!==e.t0.name){e.next=48;break}throw e.t0;case 48:throw new Error(O("alerts.couldNotCopyToClipboard"));case 49:case"end":return e.stop()}}),e,null,[[39,44]])})));return function(t,n,r,o,i){return e.apply(this,arguments)}}();function Wf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Vf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wf(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Gf=function(){var e=(0,d.Z)(g().mark((function e(t,n,r){var o,i,a,l,s,c;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=(o=n).exportBackground,a=o.viewBackgroundColor,l=o.name,s=o.fileHandle,c=Dd(s),s&&("png"===(u=c)||"svg"===u)){e.next=4;break}throw new Error("fileHandle should exist and should be of type svg or png when resaving");case 4:return n=Vf(Vf({},n),{},{exportEmbedScene:!0}),e.next=7,Kf(c,jc(t),n,r,{exportBackground:i,viewBackgroundColor:a,name:l,fileHandle:s});case 7:return e.abrupt("return",{fileHandle:s});case 8:case"end":return e.stop()}var u}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),Zf=(n(7225),function(e){var t=e.children,n=e.checked,r=e.onChange,o=e.className;return(0,I.jsxs)("div",{className:Ue("Checkbox",o,{"is-checked":n}),onClick:function(e){r(!n,e),e.currentTarget.querySelector(".Checkbox-box").focus()},children:[(0,I.jsx)("button",{className:"Checkbox-box",role:"checkbox","aria-checked":n,children:cl}),(0,I.jsx)("div",{className:"Checkbox-label",children:t})]})});function Yf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yf(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n(4623);var qf=function(e){var t=e.children,n=e.gap,r=e.align,o=e.justifyContent,i=e.className,a=e.style;return(0,I.jsx)("div",{className:Ue("Stack Stack_horizontal",i),style:Xf({"--gap":n,alignItems:r,justifyContent:o},a),children:t})},$f=function(e){var t=e.children,n=e.gap,r=e.align,o=e.justifyContent,i=e.className;return(0,I.jsx)("div",{className:Ue("Stack Stack_vertical",i),style:{"--gap":n,justifyItems:r,justifyContent:o},children:t})},Qf=(n(554),function(e){var t=e.fileName,n=e.onSave;return(0,I.jsxs)(qf,{className:"ActiveFile",gap:1,align:"center",children:[(0,I.jsxs)("span",{className:"ActiveFile__fileName",children:[Kl,(0,I.jsx)("span",{children:t})]}),(0,I.jsx)(Zs,{type:"icon",icon:dl,title:O("buttons.save"),"aria-label":O("buttons.save"),onClick:n,"data-testid":"save-button"})]})});function Jf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ep(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Jf(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Ps({name:"changeProjectName",perform:function(e,t,n){return hu("change","title"),{appState:ep(ep({},t),{},{name:n}),commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData,r=e.appProps;return(0,I.jsx)(mu,{label:O("labels.fileTitle"),value:t.name||"Unnamed",onChange:function(e){return n(e)},isNameEditable:void 0===r.name&&!t.viewModeEnabled})}}),Ps({name:"changeExportScale",perform:function(e,t,n){return{appState:ep(ep({},t),{},{exportScale:n}),commitToHistory:!1}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData,o=jc(t),i=Ac(o,n)?Dc(o,n):o;return(0,I.jsx)(I.Fragment,{children:c.ZB.map((function(e){var t,o,a,l,s=(t=i,o=c.qy,a=e,[(l=h(ff(t,o).map((function(e){return Math.trunc(e*a)})),4))[2],l[3]]),u=h(s,2),d=u[0],f=u[1],p="".concat(O("buttons.scale")," ").concat(e,"x (").concat(d,"x").concat(f,")");return(0,I.jsx)(Zs,{size:"small",type:"radio",icon:"".concat(e,"x"),name:"export-canvas-scale",title:p,"aria-label":p,id:"export-canvas-scale",checked:e===n.exportScale,onChange:function(){return r(e)}},e)}))})}}),Ps({name:"changeExportBackground",perform:function(e,t,n){return{appState:ep(ep({},t),{},{exportBackground:n}),commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData;return(0,I.jsx)(Zf,{checked:t.exportBackground,onChange:function(e){return n(e)},children:O("labels.withBackground")})}}),Ps({name:"changeExportEmbedScene",perform:function(e,t,n){return{appState:ep(ep({},t),{},{exportEmbedScene:n}),commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData;return(0,I.jsxs)(Zf,{checked:t.exportEmbedScene,onChange:function(e){return n(e)},children:[O("labels.exportEmbedScene"),(0,I.jsx)(nc,{label:O("labels.exportEmbedScene_details"),long:!0,children:(0,I.jsx)("div",{className:"excalidraw-tooltip-icon",children:Cl})})]})}}),Ps({name:"saveToActiveFile",perform:(tp=(0,d.Z)(g().mark((function e(t,n,r,o){var i,a,l;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=!!n.fileHandle,e.prev=1,!Rd(n.fileHandle)){e.next=8;break}return e.next=5,Gf(t,n,o.files);case 5:e.t0=e.sent,e.next=11;break;case 8:return e.next=10,qd(t,n,o.files);case 10:e.t0=e.sent;case 11:return a=e.t0,l=a.fileHandle,e.abrupt("return",{commitToHistory:!1,appState:ep(ep({},n),{},{fileHandle:l,toastMessage:i?null!=l&&l.name?O("toast.fileSavedToFilename").replace("{filename}",'"'.concat(l.name,'"')):O("toast.fileSaved"):null})});case 16:return e.prev=16,e.t1=e.catch(1),"AbortError"!==(null===e.t1||void 0===e.t1?void 0:e.t1.name)?console.error(e.t1):console.warn(e.t1),e.abrupt("return",{commitToHistory:!1});case 20:case"end":return e.stop()}}),e,null,[[1,16]])}))),function(e,t,n,r){return tp.apply(this,arguments)}),keyTest:function(e){return e.key===tn.S&&e[tn.CTRL_OR_CMD]&&!e.shiftKey},PanelComponent:function(e){var t,n=e.updateData,r=e.appState;return(0,I.jsx)(Qf,{onSave:function(){return n(null)},fileName:null===(t=r.fileHandle)||void 0===t?void 0:t.name})}});var tp,np,rp,op=Ps({name:"saveFileToDisk",perform:(np=(0,d.Z)(g().mark((function e(t,n,r,o){var i,a;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,qd(t,ep(ep({},n),{},{fileHandle:null}),o.files);case 3:return i=e.sent,a=i.fileHandle,e.abrupt("return",{commitToHistory:!1,appState:ep(ep({},n),{},{fileHandle:a})});case 8:return e.prev=8,e.t0=e.catch(0),"AbortError"!==(null===e.t0||void 0===e.t0?void 0:e.t0.name)?console.error(e.t0):console.warn(e.t0),e.abrupt("return",{commitToHistory:!1});case 12:case"end":return e.stop()}}),e,null,[[0,8]])}))),function(e,t,n,r){return np.apply(this,arguments)}),keyTest:function(e){return e.key===tn.S&&e.shiftKey&&e[tn.CTRL_OR_CMD]},PanelComponent:function(e){var t=e.updateData;return(0,I.jsx)(Zs,{type:"button",icon:fl,title:O("buttons.saveAs"),"aria-label":O("buttons.saveAs"),showAriaLabel:eg(),hidden:!gd,onClick:function(){return t(null)},"data-testid":"save-as-button"})}});function ip(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ap(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ip(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ip(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Ps({name:"loadScene",perform:(rp=(0,d.Z)(g().mark((function e(t,n,r,o){var i,a,l,s;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,$d(n,t);case 3:return i=e.sent,a=i.elements,l=i.appState,s=i.files,e.abrupt("return",{elements:a,appState:l,files:s,commitToHistory:!0});case 10:if(e.prev=10,e.t0=e.catch(0),"AbortError"!==(null===e.t0||void 0===e.t0?void 0:e.t0.name)){e.next=15;break}return console.warn(e.t0),e.abrupt("return",!1);case 15:return e.abrupt("return",{elements:t,appState:ep(ep({},n),{},{errorMessage:e.t0.message}),files:o.files,commitToHistory:!1});case 16:case"end":return e.stop()}}),e,null,[[0,10]])}))),function(e,t,n,r){return rp.apply(this,arguments)}),keyTest:function(e){return e[tn.CTRL_OR_CMD]&&e.key===tn.O},PanelComponent:function(e){var t=e.updateData;return e.appState,(0,I.jsx)(Zs,{type:"button",icon:pl,title:O("buttons.load"),"aria-label":O("buttons.load"),showAriaLabel:eg(),onClick:t,"data-testid":"load-button"})}}),Ps({name:"exportWithDarkMode",perform:function(e,t,n){return{appState:ep(ep({},t),{},{exportWithDarkMode:n}),commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData;return(0,I.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"-45px",marginBottom:"10px"},children:(0,I.jsx)(Ys,{value:t.exportWithDarkMode?c.C6.DARK:c.C6.LIGHT,onChange:function(e){n(e===c.C6.DARK)},title:O("labels.toggleExportColorScheme")})})}});var lp="{}",sp=Ps({name:"copyStyles",perform:function(e,t){var n=e.find((function(e){return t.selectedElementIds[e.id]}));return n&&(lp=JSON.stringify(n)),{appState:ap(ap({},t),{},{toastMessage:O("toast.copyStyles")}),commitToHistory:!1}},contextItemLabel:"labels.copyStyles",keyTest:function(e){return e[tn.CTRL_OR_CMD]&&e.altKey&&e.code===Gt}}),cp=Ps({name:"pasteStyles",perform:function(e,t){var n,r=JSON.parse(lp);return"text"!==(null==(n=r)?void 0:n.type)&&"diamond"!==(null==n?void 0:n.type)&&"rectangle"!==(null==n?void 0:n.type)&&"ellipse"!==(null==n?void 0:n.type)&&"arrow"!==(null==n?void 0:n.type)&&"freedraw"!==(null==n?void 0:n.type)&&"line"!==(null==n?void 0:n.type)?{elements:e,commitToHistory:!1}:{elements:e.map((function(e){if(t.selectedElementIds[e.id]){var n=lo(e,{backgroundColor:null==r?void 0:r.backgroundColor,strokeWidth:null==r?void 0:r.strokeWidth,strokeColor:null==r?void 0:r.strokeColor,strokeStyle:null==r?void 0:r.strokeStyle,fillStyle:null==r?void 0:r.fillStyle,opacity:null==r?void 0:r.opacity,roughness:null==r?void 0:r.roughness});return Ge(n)&&Ge(e)&&(ao(n,{fontSize:(null==r?void 0:r.fontSize)||c.n5,fontFamily:(null==r?void 0:r.fontFamily)||c.rk,textAlign:(null==r?void 0:r.textAlign)||c.Hg}),ur(e,_r(e))),n}return e})),commitToHistory:!0}},contextItemLabel:"labels.pasteStyles",keyTest:function(e){return e[tn.CTRL_OR_CMD]&&e.altKey&&e.code===$t}}),up=function(e){return(0,I.jsx)("button",{className:"help-icon",onClick:e.onClick,type:"button",title:"".concat(e.title," — ?"),"aria-label":e.title,children:Cl})};function dp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dp(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function pp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function hp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pp(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function mp(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return gp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gp(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function gp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Ps({name:"toggleCanvasMenu",perform:function(e,t){return{appState:fp(fp({},t),{},{openMenu:"canvas"===t.openMenu?null:"canvas"}),commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData;return(0,I.jsx)(Zs,{type:"button",icon:El,"aria-label":O("buttons.menu"),onClick:n,selected:"canvas"===t.openMenu})}}),Ps({name:"toggleEditMenu",perform:function(e,t){return{appState:fp(fp({},t),{},{openMenu:"shape"===t.openMenu?null:"shape"}),commitToHistory:!1}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,I.jsx)(Zs,{visible:kc(n,jc(t)),type:"button",icon:gl,"aria-label":O("buttons.edit"),onClick:r,selected:"shape"===n.openMenu})}}),Ps({name:"toggleFullScreen",perform:function(){return bn()||document.documentElement.requestFullscreen(),bn()&&document.exitFullscreen(),{commitToHistory:!1}},keyTest:function(e){return e.code===Xt&&!e[tn.CTRL_OR_CMD]}}),Ps({name:"toggleShortcuts",perform:function(e,t,n,r){var o=r.focusContainer;return t.showHelpDialog&&o(),{appState:fp(fp({},t),{},{showHelpDialog:!t.showHelpDialog}),commitToHistory:!1}},PanelComponent:function(e){var t=e.updateData;return(0,I.jsx)(up,{title:O("helpDialog.title"),onClick:t})},keyTest:function(e){return e.key===tn.QUESTION_MARK}});var vp=function(e,t){var n=Dc(jc(e),t,!0);return n.length>=2&&!function(e){if(e.length>=2){var t,n=mp(e[0].groupIds);try{var r=function(){var n=t.value;if(e.reduce((function(e,t){return e&&Eo(t,n)}),!0))return{v:!0}};for(n.s();!(t=n.n()).done;){var o=r();if("object"===P(o))return o.v}}catch(i){n.e(i)}finally{n.f()}}return!1}(n)},bp=Ps({name:"group",perform:function(e,t){var n=Dc(jc(e),t,!0);if(n.length<2)return{appState:t,elements:e,commitToHistory:!1};var r=wo(t);if(1===r.length){var o=r[0],i=new Set(_o(e,o).map((function(e){return e.id}))),a=new Set(n.map((function(e){return e.id})));if(new Set([].concat(A(Array.from(i)),A(Array.from(a)))).size===i.size)return{appState:t,elements:e,commitToHistory:!1}}var l=ro(),s=Tn(n),c=e.map((function(e){return s.get(e.id)?lo(e,{groupIds:So(e.groupIds,l,t.editingGroupId)}):e})),u=_o(c,l),d=u[u.length-1],f=c.lastIndexOf(d),p=c.slice(f+1),h=c.slice(0,f).filter((function(e){return!Eo(e,l)})),m=[].concat(A(h),A(u),A(p));return{appState:bo(l,hp(hp({},t),{},{selectedGroupIds:{}}),jc(m)),elements:m,commitToHistory:!0}},contextItemLabel:"labels.group",contextItemPredicate:function(e,t){return vp(e,t)},keyTest:function(e){return!e.shiftKey&&e[tn.CTRL_OR_CMD]&&e.code===Yt},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,I.jsx)(Zs,{hidden:!vp(t,n),type:"button",icon:(0,I.jsx)(Wl,{theme:n.theme}),onClick:function(){return r(null)},title:"".concat(O("labels.group")," — ").concat(yn("CtrlOrCmd+G")),"aria-label":O("labels.group"),visible:Ac(jc(t),n)})}}),yp=Ps({name:"ungroup",perform:function(e,t){if(0===wo(t).length)return{appState:t,elements:e,commitToHistory:!1};var n=[],r=e.map((function(e){tt(e)&&n.push(e.id);var r,o,i=(r=e.groupIds,o=t.selectedGroupIds,r.filter((function(e){return!o[e]})));return i.length===e.groupIds.length?e:lo(e,{groupIds:i})})),o=ko(hp(hp({},t),{},{selectedGroupIds:{}}),jc(r));return n.forEach((function(e){return o.selectedElementIds[e]=!1})),{appState:o,elements:r,commitToHistory:!0}},keyTest:function(e){return e.shiftKey&&e[tn.CTRL_OR_CMD]&&e.code===Yt},contextItemLabel:"labels.ungroup",contextItemPredicate:function(e,t){return wo(t).length>0},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,I.jsx)(Zs,{type:"button",hidden:0===wo(n).length,icon:(0,I.jsx)(Vl,{theme:n.theme}),onClick:function(){return r(null)},title:"".concat(O("labels.ungroup")," — ").concat(yn("CtrlOrCmd+Shift+G")),"aria-label":O("labels.ungroup"),visible:Ac(jc(t),n)})}}),xp=(n(2789),function(e){var t=e.children,n=e.color,r=e.border,o=e.onClick;return(0,I.jsx)("div",{className:"Avatar",style:{background:n,border:"1px solid ".concat(r)},onClick:o,children:t})});function wp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function kp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wp(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ep(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ep(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ep(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Ps({name:"goToCollaborator",perform:function(e,t,n){var r=n;return r?{appState:kp(kp(kp({},t),qs({scenePoint:r,viewportDimensions:{width:t.width,height:t.height},zoom:t.zoom})),{},{openMenu:"canvas"===t.openMenu?null:t.openMenu}),commitToHistory:!1}:{appState:t,commitToHistory:!1}},PanelComponent:function(e){var t=e.appState,n=e.updateData,r=e.data,o=null==r?void 0:r.id;if(!o)return null;var i=t.collaborators.get(o);if(!i)return null;var a=gu(o,t),l=a.background,s=a.stroke,c=function(e){if(!e)return"?";var t=e.trim().split(" ");if(t.length<2)return t[0].substring(0,2).toUpperCase();var n=t[0],r=t[t.length-1];return(n[0]+r[0]).toUpperCase()}(i.username);return(0,I.jsx)(xp,{color:l,border:s,onClick:function(){return n(i.pointer)},children:c})}});var Sp=Ps({name:"addToLibrary",perform:function(e,t,n,r){var o=Dc(jc(e),t,!0);return o.some((function(e){return"image"===e.type}))?{commitToHistory:!1,appState:_p(_p({},t),{},{errorMessage:"Support for adding images to the library coming soon!"})}:r.library.loadLibrary().then((function(e){return r.library.saveLibrary([{id:ro(),status:"unpublished",elements:o.map(Ro),created:Date.now()}].concat(A(e)))})).then((function(){return{commitToHistory:!1,appState:_p(_p({},t),{},{toastMessage:O("toast.addedToLibrary")})}})).catch((function(e){return{commitToHistory:!1,appState:_p(_p({},t),{},{errorMessage:e.message})}}))},contextItemLabel:"labels.addToLibrary"});function Cp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function jp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Cp(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Op=function(e,t,n){var r=n.axis,o=n.position,i=Ct(e),a=h("x"===r?["minX","maxX"]:["minY","maxY"],2),l=a[0],s=a[1];return jp(jp({},{x:0,y:0}),{},L({},r,"start"===o?t[l]-i[l]:"end"===o?t[s]-i[s]:(t[l]+t[s])/2-(i[l]+i[s])/2))},Ip=function(e,t){return Dc(jc(e),t).length>1},Mp=function(e,t,n){var r,o,i,a,l=(r=Dc(jc(e),t),o=n,i=Co(r),a=Ct(r),i.flatMap((function(e){var t=Op(e,a,o);return e.map((function(e){return lo(e,{x:e.x+t.x,y:e.y+t.y})}))}))),s=Tn(l);return e.map((function(e){return s.get(e.id)||e}))};function Tp(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Pp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pp(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function Pp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Ps({name:"alignTop",perform:function(e,t){return{appState:t,elements:Mp(e,t,{position:"start",axis:"y"}),commitToHistory:!0}},keyTest:function(e){return e[tn.CTRL_OR_CMD]&&e.shiftKey&&e.key===tn.ARROW_UP},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,I.jsx)(Zs,{hidden:!Ip(t,n),type:"button",icon:(0,I.jsx)(Tl,{theme:n.theme}),onClick:function(){return r(null)},title:"".concat(O("labels.alignTop")," — ").concat(yn("CtrlOrCmd+Shift+Up")),"aria-label":O("labels.alignTop"),visible:Ac(jc(t),n)})}}),Ps({name:"alignBottom",perform:function(e,t){return{appState:t,elements:Mp(e,t,{position:"end",axis:"y"}),commitToHistory:!0}},keyTest:function(e){return e[tn.CTRL_OR_CMD]&&e.shiftKey&&e.key===tn.ARROW_DOWN},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,I.jsx)(Zs,{hidden:!Ip(t,n),type:"button",icon:(0,I.jsx)(Pl,{theme:n.theme}),onClick:function(){return r(null)},title:"".concat(O("labels.alignBottom")," — ").concat(yn("CtrlOrCmd+Shift+Down")),"aria-label":O("labels.alignBottom"),visible:Ac(jc(t),n)})}}),Ps({name:"alignLeft",perform:function(e,t){return{appState:t,elements:Mp(e,t,{position:"start",axis:"x"}),commitToHistory:!0}},keyTest:function(e){return e[tn.CTRL_OR_CMD]&&e.shiftKey&&e.key===tn.ARROW_LEFT},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,I.jsx)(Zs,{hidden:!Ip(t,n),type:"button",icon:(0,I.jsx)(Al,{theme:n.theme}),onClick:function(){return r(null)},title:"".concat(O("labels.alignLeft")," — ").concat(yn("CtrlOrCmd+Shift+Left")),"aria-label":O("labels.alignLeft"),visible:Ac(jc(t),n)})}}),Ps({name:"alignRight",perform:function(e,t){return{appState:t,elements:Mp(e,t,{position:"end",axis:"x"}),commitToHistory:!0}},keyTest:function(e){return e[tn.CTRL_OR_CMD]&&e.shiftKey&&e.key===tn.ARROW_RIGHT},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,I.jsx)(Zs,{hidden:!Ip(t,n),type:"button",icon:(0,I.jsx)(Ll,{theme:n.theme}),onClick:function(){return r(null)},title:"".concat(O("labels.alignRight")," — ").concat(yn("CtrlOrCmd+Shift+Right")),"aria-label":O("labels.alignRight"),visible:Ac(jc(t),n)})}}),Ps({name:"alignVerticallyCentered",perform:function(e,t){return{appState:t,elements:Mp(e,t,{position:"center",axis:"y"}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,I.jsx)(Zs,{hidden:!Ip(t,n),type:"button",icon:(0,I.jsx)(zl,{theme:n.theme}),onClick:function(){return r(null)},title:O("labels.centerVertically"),"aria-label":O("labels.centerVertically"),visible:Ac(jc(t),n)})}}),Ps({name:"alignHorizontallyCentered",perform:function(e,t){return{appState:t,elements:Mp(e,t,{position:"center",axis:"x"}),commitToHistory:!0}},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,I.jsx)(Zs,{hidden:!Ip(t,n),type:"button",icon:(0,I.jsx)(Nl,{theme:n.theme}),onClick:function(){return r(null)},title:O("labels.centerHorizontally"),"aria-label":O("labels.centerHorizontally"),visible:Ac(jc(t),n)})}});var Ap=function(e,t){return Dc(jc(e),t).length>1},Lp=function(e,t,n){var r=function(e,t){var n,r=h("x"===t.axis?["minX","midX","maxX","width"]:["minY","midY","maxY","height"],4),o=r[0],i=r[1],a=r[2],l=r[3],s=Ct(e),c=Co(e).map((function(e){return[e,Ct(e)]})).sort((function(e,t){return e[1][i]-t[1][i]})),u=0,d=Tp(c);try{for(d.s();!(n=d.n()).done;)u+=n.value[1][l]}catch(y){d.e(y)}finally{d.f()}var f=(s[l]-u)/(c.length-1);if(f<0){var p=c.findIndex((function(e){return e[1][o]===s[o]})),m=c.findIndex((function(e){return e[1][a]===s[a]})),g=(c[m][1][i]-c[p][1][i])/(c.length-1),v=c[p][1][i];return c.flatMap((function(e,n){var r=h(e,2),o=r[0],a=r[1],l={x:0,y:0};return n!==p&&n!==m&&(v+=g,l[t.axis]=v-a[i]),o.map((function(e){return lo(e,{x:e.x+l.x,y:e.y+l.y})}))}))}var b=s[o];return c.flatMap((function(e){var n=h(e,2),r=n[0],i=n[1],a={x:0,y:0};return a[t.axis]=b-i[o],b+=f,b+=i[l],r.map((function(e){return lo(e,{x:e.x+a.x,y:e.y+a.y})}))}))}(Dc(jc(e),t),n),o=Tn(r);return e.map((function(e){return o.get(e.id)||e}))},Dp=(Ps({name:"distributeHorizontally",perform:function(e,t){return{appState:t,elements:Lp(e,t,{space:"between",axis:"x"}),commitToHistory:!0}},keyTest:function(e){return e.altKey&&e.code===qt},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,I.jsx)(Zs,{hidden:!Ap(t,n),type:"button",icon:(0,I.jsx)(Dl,{theme:n.theme}),onClick:function(){return r(null)},title:"".concat(O("labels.distributeHorizontally")," — ").concat(yn("Alt+H")),"aria-label":O("labels.distributeHorizontally"),visible:Ac(jc(t),n)})}}),Ps({name:"distributeVertically",perform:function(e,t){return{appState:t,elements:Lp(e,t,{space:"between",axis:"y"}),commitToHistory:!0}},keyTest:function(e){return e.altKey&&e.code===$t},PanelComponent:function(e){var t=e.elements,n=e.appState,r=e.updateData;return(0,I.jsx)(Zs,{hidden:!Ap(t,n),type:"button",icon:(0,I.jsx)(Rl,{theme:n.theme}),onClick:function(){return r(null)},title:"".concat(O("labels.distributeVertically")," — ").concat(yn("Alt+V")),"aria-label":O("labels.distributeVertically"),visible:Ac(jc(t),n)})}}),Ps({name:"flipHorizontal",perform:function(e,t){return{elements:zp(e,t,"horizontal"),appState:t,commitToHistory:!0}},keyTest:function(e){return e.shiftKey&&"KeyH"===e.code},contextItemLabel:"labels.flipHorizontal",contextItemPredicate:function(e,t){return n=t,1===(r=Dc(jc(e),n)).length&&"text"!==r[0].type;var n,r}})),Rp=Ps({name:"flipVertical",perform:function(e,t){return{elements:zp(e,t,"vertical"),appState:t,commitToHistory:!0}},keyTest:function(e){return e.shiftKey&&"KeyV"===e.code},contextItemLabel:"labels.flipVertical",contextItemPredicate:function(e,t){return n=t,1===Dc(jc(e),n).length;var n}}),zp=function(e,t,n){var r=Dc(jc(e),t);if(r.length>1)return e;var o=Np(r,t,n),i=Tn(o);return e.map((function(e){return i.get(e.id)||e}))},Np=function(e,t,n){return e.forEach((function(e){Hp(e,t),"vertical"===n&&Bp(e,Math.PI)})),e},Hp=function(e,t){var n=e.x,r=e.y,o=e.width,i=e.height,a=Na(e.angle),l=0;(Xe(e)||Ze(e))&&(l=2*e.points.reduce((function(e,t){return Math.max(e,t[0])}),0)-e.width),ao(e,{angle:Na(0)});var s=Vo(e,t.zoom),c=!0,u=0,d=s.nw;if(d||(c=!1,d=s.ne)){if(Xe(e)){for(var f=1;f<e.points.length;f++)aa.movePoints(e,[{index:f,point:[-e.points[f][0],e.points[f][1]]}]);aa.normalizePoints(e)}else u=c?e.x+2*o:e.x-2*o,Wa(e,!0,e,c?"nw":"ne",!1,u,d[1]),ao(e,{width:o,height:i});var p=Na(2*Math.PI-a);p<0&&(p=Na(p+2*Math.PI)),ao(e,{angle:p}),ao(e,{x:n+l,y:r}),ka(e)}else ao(e,{angle:a})},Bp=function(e,t){var n=e.x,r=e.y,o=Na(e.angle+t);o<0&&(o=Na(2*Math.PI+o)),ao(e,{angle:o}),ao(e,{x:n,y:r})};function Fp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Up(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fp(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Kp=Ps({name:"copy",perform:function(e,t,n,r){return Df(jc(e),t,r.files),{commitToHistory:!1}},contextItemLabel:"labels.copy",keyTest:void 0}),Wp=Ps({name:"cut",perform:function(e,t,n,r){return Kp.perform(e,t,n,r),Bc.perform(e,t)},contextItemLabel:"labels.cut",keyTest:function(e){return e[tn.CTRL_OR_CMD]&&e.code===Qt}}),Vp=Ps({name:"copyAsSvg",perform:function(){var e=(0,d.Z)(g().mark((function e(t,n,r,o){var i;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o.canvas){e.next=2;break}return e.abrupt("return",{commitToHistory:!1});case 2:return i=Dc(jc(t),n,!0),e.prev=3,e.next=6,Kf("clipboard-svg",i.length?i:jc(t),n,o.files,n);case 6:return e.abrupt("return",{commitToHistory:!1});case 9:return e.prev=9,e.t0=e.catch(3),console.error(e.t0),e.abrupt("return",{appState:Up(Up({},n),{},{errorMessage:e.t0.message}),commitToHistory:!1});case 13:case"end":return e.stop()}}),e,null,[[3,9]])})));return function(t,n,r,o){return e.apply(this,arguments)}}(),contextItemLabel:"labels.copyAsSvg"}),Gp=Ps({name:"copyAsPng",perform:function(){var e=(0,d.Z)(g().mark((function e(t,n,r,o){var i;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o.canvas){e.next=2;break}return e.abrupt("return",{commitToHistory:!1});case 2:return i=Dc(jc(t),n,!0),e.prev=3,e.next=6,Kf("clipboard",i.length?i:jc(t),n,o.files,n);case 6:return e.abrupt("return",{appState:Up(Up({},n),{},{toastMessage:O("toast.copyToClipboardAsPng",{exportSelection:i.length?O("toast.selection"):O("toast.canvas"),exportColorScheme:n.exportWithDarkMode?O("buttons.darkMode"):O("buttons.lightMode")})}),commitToHistory:!1});case 9:return e.prev=9,e.t0=e.catch(3),console.error(e.t0),e.abrupt("return",{appState:Up(Up({},n),{},{errorMessage:e.t0.message}),commitToHistory:!1});case 13:case"end":return e.stop()}}),e,null,[[3,9]])})));return function(t,n,r,o){return e.apply(this,arguments)}}(),contextItemLabel:"labels.copyAsPng",keyTest:function(e){return e.code===Gt&&e.altKey&&e.shiftKey}});function Zp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zp(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Xp=Ps({name:"gridMode",perform:function(e,t){return hu("view","mode","grid"),{appState:Yp(Yp({},t),{},{gridSize:this.checked(t)?null:c.k}),commitToHistory:!1}},checked:function(e){return null!==e.gridSize},contextItemLabel:"labels.showGrid",keyTest:function(e){return e[tn.CTRL_OR_CMD]&&e.code===Kt}});function qp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qp(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Qp=Ps({name:"zenMode",perform:function(e,t){return hu("view","mode","zen"),{appState:$p($p({},t),{},{zenModeEnabled:!this.checked(t)}),commitToHistory:!1}},checked:function(e){return e.zenModeEnabled},contextItemLabel:"buttons.zenMode",keyTest:function(e){return!e[tn.CTRL_OR_CMD]&&e.altKey&&e.code===Jt}});function Jp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function eh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Jp(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var th=Ps({name:"stats",perform:function(e,t){return{appState:eh(eh({},t),{},{showStats:!this.checked(t)}),commitToHistory:!1}},checked:function(e){return e.showStats},contextItemLabel:"stats.title",keyTest:function(e){return!e[tn.CTRL_OR_CMD]&&e.altKey&&e.code===Vt}}),nh=Ps({name:"unbindText",contextItemLabel:"labels.unbindText",perform:function(e,t){return Dc(jc(e),t).forEach((function(e){var t=Er(e);if(t){var n,r=pr(t.originalText,dn(t)),o=r.width,i=r.height,a=r.baseline;ao(t,{containerId:null,width:o,height:i,baseline:a,text:t.originalText}),ao(e,{boundElements:null===(n=e.boundElements)||void 0===n?void 0:n.filter((function(e){return e.id!==t.id}))})}})),{elements:e,appState:t,commitToHistory:!0}}});function rh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rh(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ih=function(e,t,n){var r=!1;if(!(t.multiElement||t.resizingElement||t.editingElement||t.draggingElement)){var o=n();if(null===o)return{commitToHistory:r};var i=Tn(e),a=o.elements,l=Tn(a),s=e.filter((function(e){return!l.has(e.id)})),c=a.map((function(e){return lo(i.get(e.id)||e,e)})).concat(s.map((function(e){return lo(e,{isDeleted:!0})})));return La(c,s),{elements:c,appState:oh(oh({},t),o.appState),commitToHistory:r,syncHistory:!0}}return{commitToHistory:r}},ah=function(){function e(t,n,r,o){var i=this;D(this,e),this.actions={},this.renderAction=function(e,t){var n=i.app.props.UIOptions.canvasActions;if(i.actions[e]&&"PanelComponent"in i.actions[e]&&(!(e in n)||n[e])){var r=i.actions[e],o=r.PanelComponent;return(0,I.jsx)(o,{elements:i.getElementsIncludingDeleted(),appState:i.getAppState(),updateData:function(e){i.updater(r.perform(i.getElementsIncludingDeleted(),i.getAppState(),e,i.app))},appProps:i.app.props,data:t})}return null},this.updater=function(e){if(!e||!("then"in e))return t(e);e.then((function(e){return t(e)}))},this.getAppState=n,this.getElementsIncludingDeleted=r,this.app=o}return z(e,[{key:"registerAction",value:function(e){this.actions[e.name]=e}},{key:"registerAll",value:function(e){var t=this;e.forEach((function(e){return t.registerAction(e)}))}},{key:"handleKeyDown",value:function(e){var t=this,n=this.app.props.UIOptions.canvasActions,r=Object.values(this.actions).sort((function(e,t){return(t.keyPriority||0)-(e.keyPriority||0)})).filter((function(r){return(!(r.name in n)||n[r.name])&&r.keyTest&&r.keyTest(e,t.getAppState(),t.getElementsIncludingDeleted())}));return!(0===r.length||this.getAppState().viewModeEnabled&&!Object.values(c.EH).includes(r[0].name)||(e.preventDefault(),this.updater(r[0].perform(this.getElementsIncludingDeleted(),this.getAppState(),null,this.app)),0))}},{key:"executeAction",value:function(e){this.updater(e.perform(this.getElementsIncludingDeleted(),this.getAppState(),null,this.app))}}]),e}();function lh(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return sh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sh(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function sh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ch(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function uh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ch(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ch(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var dh=function(){function e(t){var n,r=this;D(this,e),this.libraryCache=null,this.resetLibrary=(0,d.Z)(g().mark((function e(){var t,n;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null===(t=(n=r.app.props).onLibraryChange)||void 0===t?void 0:t.call(n,[]);case 2:r.libraryCache=[];case 3:case"end":return e.stop()}}),e)}))),this.restoreLibraryItem=function(e){var t=jc(Od(e.elements,null));return t.length?uh(uh({},e),{},{elements:t}):null},this.loadLibrary=function(){return new Promise((e=(0,d.Z)(g().mark((function e(t){var n,o;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r.libraryCache){e.next=2;break}return e.abrupt("return",t(JSON.parse(JSON.stringify(r.libraryCache))));case 2:if(e.prev=2,n=r.app.libraryItemsFromStorage){e.next=6;break}return e.abrupt("return",t([]));case 6:o=n.reduce((function(e,t){return r.restoreLibraryItem(t)&&e.push(t),e}),[]),r.libraryCache=JSON.parse(JSON.stringify(o)),t(o),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(2),console.error(e.t0),t([]);case 15:case"end":return e.stop()}}),e,null,[[2,11]])}))),function(t){return e.apply(this,arguments)}));var e},this.saveLibrary=(n=(0,d.Z)(g().mark((function e(t){var n,o,i,a;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.libraryCache,e.prev=1,a=JSON.stringify(t),r.libraryCache=JSON.parse(a),e.next=6,null===(o=(i=r.app.props).onLibraryChange)||void 0===o?void 0:o.call(i,t);case 6:e.next=12;break;case 8:throw e.prev=8,e.t0=e.catch(1),r.libraryCache=n,e.t0;case 12:case"end":return e.stop()}}),e,null,[[1,8]])}))),function(e){return n.apply(this,arguments)}),this.app=t}var t;return z(e,[{key:"importLibrary",value:(t=(0,d.Z)(g().mark((function e(t){var n,r,o,i,a,l,s,c,u,d,f,p=arguments;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=p.length>1&&void 0!==p[1]?p[1]:"unpublished",e.next=3,Hd(t);case 3:if((r=e.sent)&&(r.libraryItems||r.library)){e.next=6;break}return e.abrupt("return");case 6:return o=function(e,t){return!e.find((function(e){return e.elements.length===t.elements.length&&e.elements.every((function(e,n){return e.id===t.elements[n].id&&e.versionNonce===t.elements[n].versionNonce}))}))},e.next=9,this.loadLibrary();case 9:i=e.sent,a=r.libraryItems||r.library||[],l=Td(a,n),s=[],c=lh(l);try{for(c.s();!(u=c.n()).done;)d=u.value,(f=this.restoreLibraryItem(d))&&o(i,f)&&s.push(f)}catch(h){c.e(h)}finally{c.f()}return e.next=17,this.saveLibrary([].concat(s,A(i)));case 17:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}(),fh=dh,ph=function(e){var t=Array.from(e.values());return{x:mh(t,(function(e){return e.x}))/t.length,y:mh(t,(function(e){return e.y}))/t.length}},hh=function(e){var t=h(e,2),n=t[0],r=t[1];return Math.hypot(n.x-r.x,n.y-r.y)},mh=function(e,t){return e.reduce((function(e,n){return e+t(n)}),0)};function gh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gh(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var bh=function(e){return{selectedElementIds:e.selectedElementIds,selectedGroupIds:e.selectedGroupIds,viewBackgroundColor:e.viewBackgroundColor,editingLinearElement:e.editingLinearElement,editingGroupId:e.editingGroupId,name:e.name}},yh=function(){function e(){var t=this;D(this,e),this.elementCache=new Map,this.recording=!0,this.stateHistory=[],this.redoStack=[],this.lastEntry=null,this.generateEntry=function(e,n){return t.dehydrateHistoryEntry({appState:bh(e),elements:n.reduce((function(t,n){if(Xe(n)&&e.multiElement&&e.multiElement.id===n.id){if(e.multiElement&&e.multiElement.id===n.id&&n.points.length<2)return t;t.push(vh(vh({},n),{},{points:n.lastCommittedPoint!==n.points[n.points.length-1]?n.points.slice(0,-1):n.points}))}else t.push(n);return t}),[])})}}return z(e,[{key:"hydrateHistoryEntry",value:function(e){var t=this,n=e.appState,r=e.elements;return{appState:JSON.parse(n),elements:r.map((function(e){var n,r=null===(n=t.elementCache.get(e.id))||void 0===n?void 0:n.get(e.versionNonce);if(!r)throw new Error("Element not found: ".concat(e.id,":").concat(e.versionNonce));return r}))}}},{key:"dehydrateHistoryEntry",value:function(e){var t=this,n=e.appState,r=e.elements;return{appState:JSON.stringify(n),elements:r.map((function(e){t.elementCache.has(e.id)||t.elementCache.set(e.id,new Map);var n=t.elementCache.get(e.id);return n.has(e.versionNonce)||n.set(e.versionNonce,Ro(e)),{id:e.id,versionNonce:e.versionNonce}}))}}},{key:"getSnapshotForTest",value:function(){var e=this;return{recording:this.recording,stateHistory:this.stateHistory.map((function(t){return e.hydrateHistoryEntry(t)})),redoStack:this.redoStack.map((function(t){return e.hydrateHistoryEntry(t)}))}}},{key:"clear",value:function(){this.stateHistory.length=0,this.redoStack.length=0,this.lastEntry=null,this.elementCache.clear()}},{key:"shouldCreateEntry",value:function(e){var t,n=this.lastEntry;if(!n)return!0;if(e.elements.length!==n.elements.length)return!0;for(var r=e.elements.length-1;r>-1;r--){var o=e.elements[r],i=n.elements[r];if(!o||!i||o.id!==i.id||o.versionNonce!==i.versionNonce)return!0}for(t in e.appState){var a,l;if(("editingLinearElement"!==t||(null===(a=e.appState[t])||void 0===a?void 0:a.elementId)!==(null===(l=n.appState[t])||void 0===l?void 0:l.elementId))&&"selectedElementIds"!==t&&"selectedGroupIds"!==t&&e.appState[t]!==n.appState[t])return!0}return!1}},{key:"pushEntry",value:function(e,t){var n=this.generateEntry(e,t),r=this.hydrateHistoryEntry(n);if(r){if(!this.shouldCreateEntry(r))return;this.stateHistory.push(n),this.lastEntry=r,this.clearRedoStack()}}},{key:"clearRedoStack",value:function(){this.redoStack.splice(0,this.redoStack.length)}},{key:"redoOnce",value:function(){if(0===this.redoStack.length)return null;var e=this.redoStack.pop();return void 0!==e?(this.stateHistory.push(e),this.hydrateHistoryEntry(e)):null}},{key:"undoOnce",value:function(){if(1===this.stateHistory.length)return null;var e=this.stateHistory.pop(),t=this.stateHistory[this.stateHistory.length-1];return void 0!==e?(this.redoStack.push(e),this.hydrateHistoryEntry(t)):null}},{key:"setCurrentState",value:function(e,t){this.lastEntry=this.hydrateHistoryEntry(this.generateEntry(e,t))}},{key:"resumeRecording",value:function(){this.recording=!0}},{key:"record",value:function(e,t){this.recording&&(this.pushEntry(e,t),this.recording=!1)}}]),e}(),xh=[{icon:(0,I.jsx)("svg",{viewBox:"0 0 320 512",className:"",children:(0,I.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:tn.V},{icon:(0,I.jsx)("svg",{viewBox:"0 0 448 512",children:(0,I.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:tn.R},{icon:(0,I.jsx)("svg",{viewBox:"0 0 223.646 223.646",children:(0,I.jsx)("path",{d:"M111.823 0L16.622 111.823 111.823 223.646 207.025 111.823z"})}),value:"diamond",key:tn.D},{icon:(0,I.jsx)("svg",{viewBox:"0 0 512 512",children:(0,I.jsx)("path",{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"})}),value:"ellipse",key:tn.E},{icon:(0,I.jsx)("svg",{viewBox:"0 0 448 512",className:"rtl-mirror",children:(0,I.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:tn.A},{icon:(0,I.jsx)("svg",{viewBox:"0 0 6 6",children:(0,I.jsx)("line",{x1:"0",y1:"3",x2:"6",y2:"3",stroke:"currentColor",strokeLinecap:"round"})}),value:"line",key:[tn.P,tn.L]},{icon:(0,I.jsx)("svg",{viewBox:"0 0 512 512",children:(0,I.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:[tn.X,tn.P.toUpperCase()]},{icon:(0,I.jsx)("svg",{viewBox:"0 0 448 512",children:(0,I.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:tn.T},{icon:(0,I.jsx)("svg",{viewBox:"0 0 512 512",children:(0,I.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}],wh=(n(1292),{cut:[yn("CtrlOrCmd+X")],copy:[yn("CtrlOrCmd+C")],paste:[yn("CtrlOrCmd+V")],copyStyles:[yn("CtrlOrCmd+Alt+C")],pasteStyles:[yn("CtrlOrCmd+Alt+V")],selectAll:[yn("CtrlOrCmd+A")],deleteSelectedElements:[yn("Del")],duplicateSelection:[yn("CtrlOrCmd+D"),yn("Alt+".concat(O("helpDialog.drag")))],sendBackward:[yn("CtrlOrCmd+[")],bringForward:[yn("CtrlOrCmd+]")],sendToBack:[yn(Tt?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")],bringToFront:[yn(Tt?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")],copyAsPng:[yn("Shift+Alt+C")],copyAsSvg:[],group:[yn("CtrlOrCmd+G")],ungroup:[yn("CtrlOrCmd+Shift+G")],gridMode:[yn("CtrlOrCmd+'")],zenMode:[yn("Alt+Z")],stats:[yn("Alt+/")],addToLibrary:[],flipHorizontal:[yn("Shift+H")],flipVertical:[yn("Shift+V")],viewMode:[yn("Alt+R")],link:[yn("CtrlOrCmd+K")]}),kh=function(e){var t=e.options,n=e.onCloseRequest,r=e.top,o=e.left,i=e.actionManager,a=e.appState,l=e.elements;return(0,I.jsx)(qa,{onCloseRequest:n,top:r,left:o,fitInViewport:!0,offsetLeft:a.offsetLeft,offsetTop:a.offsetTop,viewportWidth:a.width,viewportHeight:a.height,children:(0,I.jsx)("ul",{className:"context-menu",onContextMenu:function(e){return e.preventDefault()},children:t.map((function(e,t){var r;if("separator"===e)return(0,I.jsx)("hr",{className:"context-menu-option-separator"},t);var o,s,c=e.name,u="";return e.contextItemLabel&&(u="function"==typeof e.contextItemLabel?O(e.contextItemLabel(l,a)):O(e.contextItemLabel)),(0,I.jsx)("li",{"data-testid":c,onClick:n,children:(0,I.jsxs)("button",{className:Ue("context-menu-option",{dangerous:"deleteSelectedElements"===c,checkmark:null===(r=e.checked)||void 0===r?void 0:r.call(e,a)}),onClick:function(){return i.executeAction(e)},children:[(0,I.jsx)("div",{className:"context-menu-option__label",children:u}),(0,I.jsx)("kbd",{className:"context-menu-option__shortcut",children:c?(o=c,s=wh[o],s&&s.length>0?s[0]:""):""})]})},t)}))})})},Eh=new WeakMap,_h=function(e){var t,n,r=Array.of();e.options.forEach((function(e){e&&r.push(e)})),r.length&&(0,Mt.render)((0,I.jsx)(kh,{top:e.top,left:e.left,options:r,onCloseRequest:function(){return t=e.container,void((n=Eh.get(t))&&((0,Mt.unmountComponentAtNode)(n),n.remove(),Eh.delete(t)));var t,n},actionManager:e.actionManager,appState:e.appState,elements:e.elements}),(t=e.container,(n=Eh.get(t))||(n=document.createElement("div"),t.querySelector(".excalidraw-contextMenuContainer").appendChild(n),Eh.set(t,n),n)))};function Sh(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ch(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ch(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function Ch(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var jh=function(e){var t,n,r=e.appState,o=e.elements,i=e.renderAction,a=e.elementType,l=Rc(jc(o),r),s=Boolean(r.editingElement),c=eg(),u="rtl"===document.documentElement.getAttribute("dir"),d=ws(a)||l.some((function(e){return ws(e.type)&&!jn(e.backgroundColor)})),f=ws(a)||l.some((function(e){return ws(e.type)})),p=(null===(t=l[0])||void 0===t?void 0:t.type)||null,h=Sh(l);try{for(h.s();!(n=h.n()).done;)if(n.value.type!==p){p=null;break}}catch(m){h.e(m)}finally{h.f()}return(0,I.jsxs)("div",{className:"panelColumn",children:[(ks(a)&&"image"!==a&&"image"!==p||l.some((function(e){return ks(e.type)})))&&i("changeStrokeColor"),f&&i("changeBackgroundColor"),d&&i("changeFillStyle"),(Es(a)||l.some((function(e){return Es(e.type)})))&&i("changeStrokeWidth"),("freedraw"===a||l.some((function(e){return"freedraw"===e.type})))&&i("changeStrokeShape"),(_s(a)||l.some((function(e){return _s(e.type)})))&&(0,I.jsxs)(I.Fragment,{children:[i("changeStrokeStyle"),i("changeSloppiness")]}),(Ss(a)||l.some((function(e){return Ss(e.type)})))&&(0,I.jsx)(I.Fragment,{children:i("changeSharpness")}),(Cs(a)||l.some((function(e){return Cs(e.type)})))&&(0,I.jsxs)(I.Fragment,{children:[i("changeFontSize"),i("changeFontFamily"),i("changeTextAlign")]}),(js(a)||l.some((function(e){return js(e.type)})))&&(0,I.jsx)(I.Fragment,{children:i("changeArrowhead")}),i("changeOpacity"),(0,I.jsxs)("fieldset",{children:[(0,I.jsx)("legend",{children:O("labels.layers")}),(0,I.jsxs)("div",{className:"buttonList",children:[i("sendToBack"),i("sendBackward"),i("bringToFront"),i("bringForward")]})]}),l.length>1&&(0,I.jsxs)("fieldset",{children:[(0,I.jsx)("legend",{children:O("labels.align")}),(0,I.jsxs)("div",{className:"buttonList",children:[u?(0,I.jsxs)(I.Fragment,{children:[i("alignRight"),i("alignHorizontallyCentered"),i("alignLeft")]}):(0,I.jsxs)(I.Fragment,{children:[i("alignLeft"),i("alignHorizontallyCentered"),i("alignRight")]}),l.length>2&&i("distributeHorizontally"),(0,I.jsxs)("div",{className:"iconRow",children:[i("alignTop"),i("alignVerticallyCentered"),i("alignBottom"),l.length>2&&i("distributeVertically")]})]})]}),!s&&l.length>0&&(0,I.jsxs)("fieldset",{children:[(0,I.jsx)("legend",{children:O("labels.actions")}),(0,I.jsxs)("div",{className:"buttonList",children:[!c&&i("duplicateSelection"),!c&&i("deleteSelectedElements"),i("group"),i("ungroup"),1===l.length&&i("link")]})]})]})},Oh=function(e){var t=e.canvas,n=e.elementType,r=e.setAppState,o=e.onImageAction;return(0,I.jsx)(I.Fragment,{children:xh.map((function(e,i){var a=e.value,l=e.icon,s=e.key,c=O("toolBar.".concat(a)),u=s&&("string"==typeof s?s:s[0]),d=u?"".concat(sn(u)," ").concat(O("helpDialog.or")," ").concat(i+1):"".concat(i+1);return(0,I.jsx)(Zs,{className:"Shape",type:"radio",icon:l,checked:n===a,name:"editor-current-shape",title:"".concat(sn(c)," — ").concat(d),keyBindingLabel:"".concat(i+1),"aria-label":sn(c),"aria-keyshortcuts":d,"data-testid":a,onChange:function(e){var n=e.pointerType;r({elementType:a,multiElement:null,selectedElementIds:{}}),vn(t,a),"image"===a&&o({pointerType:n})}},a)}))})},Ih=function(e){var t=e.renderAction;return e.zoom,(0,I.jsx)($f,{gap:1,children:(0,I.jsxs)(qf,{gap:1,align:"center",children:[t("zoomOut"),t("zoomIn"),t("resetZoom")]})})},Mh=function(e){e.appState,e.setAppState;var t=e.actionManager,n=e.showThemeBtn;return(0,I.jsxs)("div",{style:{display:"flex"},children:[t.renderAction("changeViewBackgroundColor"),n&&t.renderAction("toggleTheme")]})},Th=(n(778),function(e){var t=e.isCollaborating,n=e.collaboratorCount,r=e.onClick;return(0,I.jsx)(I.Fragment,{children:(0,I.jsx)(Zs,{className:Ue("CollabButton",{"is-collaborating":t}),onClick:r,icon:Hl,type:"button",title:O("labels.liveCollaboration"),"aria-label":O("labels.liveCollaboration"),showAriaLabel:eg(),children:n>0&&(0,I.jsx)("div",{className:"CollabButton-collaborators",children:n})})})}),Ph=function(e){var t=e.message,n=e.onClose,r=h((0,l.useState)(!!t),2),o=r[0],i=r[1],a=ng().container,c=s().useCallback((function(){i(!1),n&&n(),null==a||a.focus()}),[n,a]);return(0,I.jsx)(I.Fragment,{children:o&&(0,I.jsx)(sc,{small:!0,onCloseRequest:c,title:O("errorDialog.title"),children:(0,I.jsx)("div",{style:{whiteSpace:"pre-wrap"},children:t})})})},Ah=(n(2205),"filter"in document.createElement("canvas").getContext("2d")),Lh=function(){return(0,I.jsxs)("div",{children:[(0,I.jsx)("h3",{children:O("canvasError.cannotShowPreview")}),(0,I.jsx)("p",{children:(0,I.jsx)("span",{children:O("canvasError.canvasTooBig")})}),(0,I.jsxs)("em",{children:["(",O("canvasError.canvasTooBigTip"),")"]})]})},Dh=function(e,t){(0,Mt.unmountComponentAtNode)(t),t.innerHTML="",e instanceof HTMLCanvasElement?t.appendChild(e):(0,Mt.render)((0,I.jsx)(Lh,{}),t)},Rh=function(e){var t,n=e.children,r=e.title,o=e.onClick,i=e.color,a=e.shade,l=void 0===a?6:a;return(0,I.jsx)("button",{className:"ExportDialog-imageExportButton",style:(t={},L(t,"--button-color",jt[i][l]),L(t,"--button-color-darker",jt[i][l+1]),L(t,"--button-color-darkest",jt[i][l+2]),t),title:r,"aria-label":r,onClick:o,children:n})},zh=function(e){var t=e.elements,n=e.appState,r=e.files,o=e.exportPadding,i=void 0===o?c.qy:o,a=e.actionManager,s=e.onExportToPng,u=e.onExportToSvg,d=e.onExportToClipboard,f=Ac(t,n),p=h((0,l.useState)(f),2),m=p[0],g=p[1],v=(0,l.useRef)(null),b=n.exportBackground,y=n.viewBackgroundColor,x=m?Dc(t,n,!0):t;return(0,l.useEffect)((function(){g(f)}),[f]),(0,l.useEffect)((function(){var e=v.current;e&&uf(x,n,r,{exportBackground:b,viewBackgroundColor:y,exportPadding:i}).then((function(t){return Bd(t).then((function(){Dh(t,e)}))})).catch((function(t){console.error(t),Dh(new Ws,e)}))}),[n,r,x,b,i,y]),(0,I.jsxs)("div",{className:"ExportDialog",children:[(0,I.jsx)("div",{className:"ExportDialog__preview",ref:v}),Ah&&a.renderAction("exportWithDarkMode"),(0,I.jsx)("div",{style:{display:"grid",gridTemplateColumns:"1fr"},children:(0,I.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(190px, 1fr))",overflow:"hidden"},children:[a.renderAction("changeExportBackground"),f&&(0,I.jsx)(Zf,{checked:m,onChange:function(e){return g(e)},children:O("labels.onlySelected")}),a.renderAction("changeExportEmbedScene")]})}),(0,I.jsxs)("div",{style:{display:"flex",alignItems:"center",marginTop:".6em"},children:[(0,I.jsx)(qf,{gap:2,children:a.renderAction("changeExportScale")}),(0,I.jsx)("p",{style:{marginLeft:"1em",userSelect:"none"},children:"Scale"})]}),(0,I.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",margin:".6em 0"},children:!gd&&a.renderAction("changeProjectName")}),(0,I.jsxs)(qf,{gap:2,justifyContent:"center",style:{margin:"2em 0"},children:[(0,I.jsx)(Rh,{color:"indigo",title:O("buttons.exportToPng"),"aria-label":O("buttons.exportToPng"),onClick:function(){return s(x)},children:"PNG"}),(0,I.jsx)(Rh,{color:"red",title:O("buttons.exportToSvg"),"aria-label":O("buttons.exportToSvg"),onClick:function(){return u(x)},children:"SVG"}),Lf&&(0,I.jsx)(Rh,{title:O("buttons.copyPngToClipboard"),onClick:function(){return d(x)},color:"gray",shade:7,children:hl})]})]})},Nh=function(e){var t=e.elements,n=e.appState,r=e.files,o=e.exportPadding,i=void 0===o?c.qy:o,a=e.actionManager,u=e.onExportToPng,d=e.onExportToSvg,f=e.onExportToClipboard,p=h((0,l.useState)(!1),2),m=p[0],g=p[1],v=s().useCallback((function(){g(!1)}),[]);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Zs,{onClick:function(){g(!0)},"data-testid":"image-export-button",icon:bl,type:"button","aria-label":O("buttons.exportImage"),showAriaLabel:eg(),title:O("buttons.exportImage")}),m&&(0,I.jsx)(sc,{onCloseRequest:v,title:O("buttons.exportImage"),children:(0,I.jsx)(zh,{elements:t,appState:n,files:r,exportPadding:i,actionManager:a,onExportToPng:u,onExportToSvg:d,onExportToClipboard:f,onCloseRequest:v})})]})},Hh=(n(1310),function(e){var t=e.children,n=e.side,r=e.className;return(0,I.jsx)("div",{className:Ue("FixedSideContainer","FixedSideContainer_side_".concat(n),r),children:t})}),Bh=(n(7096),function(e){var t=function(e){var t=e.appState,n=e.elements,r=e.isMobile,o=t.elementType,i=t.isResizing,a=t.isRotating,l=t.lastPointerDownWith,s=null!==t.multiElement;if("arrow"===o||"line"===o)return O(s?"hints.linearElementMulti":"hints.linearElement");if("freedraw"===o)return O("hints.freeDraw");if("text"===o)return O("hints.text");if("image"===t.elementType&&t.pendingImageElement)return O("hints.placeImage");var c,u=Dc(n,t);if(i&&"mouse"===l&&1===u.length){var d=u[0];return Xe(d)&&2===d.points.length?O("hints.lockAngle"):Ve(d)?O("hints.resizeImage"):O("hints.resize")}if(a&&"mouse"===l)return O("hints.rotate");if(1===u.length&&Ge(u[0]))return O("hints.text_selected");if(t.editingElement&&Ge(t.editingElement))return O("hints.text_editing");if("selection"===o){var f;if("selection"===(null===(f=t.draggingElement)||void 0===f?void 0:f.type)&&!t.editingElement&&!t.editingLinearElement)return O("hints.deepBoxSelect");if(!u.length&&!r)return O("hints.canvasPanning")}if(1===u.length){if(Xe(u[0]))return t.editingLinearElement?t.editingLinearElement.selectedPointsIndices?O("hints.lineEditor_pointSelected"):O("hints.lineEditor_nothingSelected"):O("hints.lineEditor_info");if(null!=(c=u[0])&&("rectangle"===c.type||"diamond"===c.type||"ellipse"===c.type||"image"===c.type))return O("hints.bindTextToElement")}return null}({appState:e.appState,elements:e.elements,isMobile:e.isMobile});return t?(t=yn(t),(0,I.jsx)("div",{className:"HintViewer",children:(0,I.jsx)("span",{children:t})})):null}),Fh={CHECKED:(0,I.jsx)("svg",{width:"1792",height:"1792",viewBox:"0 0 1792 1792",xmlns:"http://www.w3.org/2000/svg",children:(0,I.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,I.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,I.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"})})},Uh=function(e){return(0,I.jsxs)("label",{className:Ue("ToolIcon ToolIcon__lock ToolIcon_type_floating","ToolIcon_size_".concat("medium"),{"is-mobile":e.isMobile}),title:"".concat(e.title," — Q"),children:[(0,I.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title}),(0,I.jsx)("div",{className:"ToolIcon__icon",children:e.checked?Fh.CHECKED:Fh.UNCHECKED})]})},Kh=["heading","children"];function Wh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Vh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wh(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Gh=function(e){var t=e.heading,n=e.children,r=po(e,Kh),o=ng().id,i=(0,I.jsx)("h2",{className:"visually-hidden",id:"".concat(o,"-").concat(t,"-title"),children:O("headings.".concat(t))});return(0,I.jsx)("section",Vh(Vh({},r),{},{"aria-labelledby":"".concat(o,"-").concat(t,"-title"),children:"function"==typeof n?n(i):(0,I.jsxs)(I.Fragment,{children:[i,n]})}))},Zh=(n(580),function(e){var t=e.children,n=e.className,r=e.mobile;return(0,I.jsx)("div",{className:Ue("UserList",n,{UserList_mobile:r}),children:t})}),Yh=(0,I.jsx)("svg",{viewBox:"0 0 576 512",children:(0,I.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"})}),Xh=function(e){var t=e.appState,n=e.setAppState,r=e.isMobile;return(0,I.jsxs)("label",{className:Ue("ToolIcon ToolIcon_type_floating ToolIcon__library","ToolIcon_size_medium",{"is-mobile":r}),title:"".concat(sn(O("toolBar.library"))," — 0"),children:[(0,I.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:"editor-library",onChange:function(e){n({isLibraryOpen:e.target.checked})},checked:t.isLibraryOpen,"aria-label":sn(O("toolBar.library")),"aria-keyshortcuts":"0"}),(0,I.jsx)("div",{className:"ToolIcon__icon",children:Yh})]})},qh="medium",$h={CHECKED:(0,I.jsxs)("svg",{width:"205",height:"205",viewBox:"0 0 205 205",xmlns:"http://www.w3.org/2000/svg",children:[(0,I.jsx)("path",{d:"m35 195-25-29.17V50h50v115l-25 30"}),(0,I.jsx)("path",{d:"M10 40V10h50v30H10"}),(0,I.jsx)("path",{d:"M125 145h70v50h-70"}),(0,I.jsx)("path",{d:"M190 145v-30l-10-20h-40l-10 20v30h15v-30l5-5h20l5 5v30h15"})]}),UNCHECKED:(0,I.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,I.jsx)("path",{d:"m35 195-25-29.17V50h50v115l-25 30"}),(0,I.jsx)("path",{d:"M10 40V10h50v30H10"}),(0,I.jsx)("path",{d:"M125 145h70v50h-70"}),(0,I.jsx)("path",{d:"M145 145v-30l-10-20H95l-10 20v30h15v-30l5-5h20l5 5v30h15"})]})},Qh=function(e){return e.penDetected?(0,I.jsxs)("label",{className:Ue("ToolIcon ToolIcon__penMode ToolIcon_type_floating","ToolIcon_size_".concat(qh),{"is-mobile":e.isMobile}),title:"".concat(e.title),children:[(0,I.jsx)("input",{className:"ToolIcon_type_checkbox",type:"checkbox",name:e.name,onChange:e.onChange,checked:e.checked,"aria-label":e.title}),(0,I.jsx)("div",{className:"ToolIcon__icon",children:e.checked?$h.CHECKED:$h.UNCHECKED})]}):e.isMobile?null:(0,I.jsx)("label",{className:Ue("ToolIcon ToolIcon__penMode ToolIcon_type_floating","ToolIcon_size_".concat(qh),{"is-mobile":e.isMobile}),children:(0,I.jsx)("div",{className:"ToolIcon__icon ToolIcon__hidden"})})};function Jh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var em=function(e){var t=e.appState,n=e.elements,r=e.libraryMenu,o=e.actionManager,i=e.renderJSONExportDialog,a=e.renderImageExportDialog,l=e.setAppState,c=e.onCollabButtonClick,u=e.onLockToggle,d=e.onPenModeToggle,f=e.canvas,p=e.isCollaborating,m=e.renderCustomFooter,g=e.viewModeEnabled,v=e.showThemeBtn,b=e.onImageAction,y=e.renderTopRightUI;return(0,I.jsxs)(I.Fragment,{children:[!g&&(0,I.jsxs)(Hh,{side:"top",className:"App-top-bar",children:[(0,I.jsx)(Gh,{heading:"shapes",children:function(e){return(0,I.jsxs)($f,{gap:4,align:"center",children:[(0,I.jsxs)(qf,{gap:1,className:"App-toolbar-container",children:[(0,I.jsxs)(ic,{padding:1,className:"App-toolbar",children:[e,(0,I.jsx)(qf,{gap:1,children:(0,I.jsx)(Oh,{canvas:f,elementType:t.elementType,setAppState:l,onImageAction:function(e){var t=e.pointerType;b({insertOnCanvasDirectly:"mouse"!==t})}})})]}),y&&y(!0,t),(0,I.jsx)(Uh,{checked:t.elementLocked,onChange:u,title:O("toolBar.lock"),isMobile:!0}),(0,I.jsx)(Xh,{appState:t,setAppState:l,isMobile:!0}),(0,I.jsx)(Qh,{checked:t.penMode,onChange:d,title:O("toolBar.penMode"),isMobile:!0,penDetected:t.penDetected})]}),r]})}}),(0,I.jsx)(Bh,{appState:t,elements:n,isMobile:!0})]}),(0,I.jsx)("div",{className:"App-bottom-bar",style:{marginBottom:14,marginLeft:14,marginRight:14},children:(0,I.jsxs)(ic,{padding:0,children:["canvas"===t.openMenu?(0,I.jsx)(Gh,{className:"App-mobile-menu",heading:"canvasActions",children:(0,I.jsx)("div",{className:"panelColumn",children:(0,I.jsxs)($f,{gap:4,children:[g?(0,I.jsxs)(I.Fragment,{children:[i(),a()]}):(0,I.jsxs)(I.Fragment,{children:[o.renderAction("clearCanvas"),o.renderAction("loadScene"),i(),a(),c&&(0,I.jsx)(Th,{isCollaborating:p,collaboratorCount:t.collaborators.size,onClick:c}),(0,I.jsx)(Mh,{actionManager:o,appState:t,setAppState:l,showThemeBtn:v})]}),null==m?void 0:m(!0,t),t.collaborators.size>0&&(0,I.jsxs)("fieldset",{children:[(0,I.jsx)("legend",{children:O("labels.collaborators")}),(0,I.jsx)(Zh,{mobile:!0,children:Array.from(t.collaborators).filter((function(e){var t=h(e,2),n=(t[0],t[1]);return 0!==Object.keys(n).length})).map((function(e){var t=h(e,2),n=t[0];return t[1],(0,I.jsx)(s().Fragment,{children:o.renderAction("goToCollaborator",{id:n})},n)}))})]})]})})}):"shape"===t.openMenu&&!g&&kc(t,n)?(0,I.jsx)(Gh,{className:"App-mobile-menu",heading:"selectedShapeActions",children:(0,I.jsx)(jh,{appState:t,elements:n,renderAction:o.renderAction,elementType:t.elementType})}):null,(0,I.jsxs)("footer",{className:"App-toolbar",children:[g?(0,I.jsx)("div",{className:"App-toolbar-content",children:o.renderAction("toggleCanvasMenu")}):(0,I.jsxs)("div",{className:"App-toolbar-content",children:[o.renderAction("toggleCanvasMenu"),o.renderAction("toggleEditMenu"),o.renderAction("undo"),o.renderAction("redo"),o.renderAction(t.multiElement?"finalize":"duplicateSelection"),o.renderAction("deleteSelectedElements")]}),t.scrolledOutside&&!t.openMenu&&(0,I.jsx)("button",{className:"scroll-back-to-content",onClick:function(){l(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Jh(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},$s(n,t)))},children:O("buttons.scrollBackToContent")})]})]})})]})},tm=(n(8051),function(e){var t=(0,l.useRef)(null),n=h((0,l.useState)(null),2),r=n[0],o=n[1];return(0,l.useLayoutEffect)((function(){if(e.spreadsheet){var n,r=If(e.chartType,e.spreadsheet,0,0);o(r);var i=t.current;return(0,d.Z)(g().mark((function t(){return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,df(r,{exportBackground:!1,viewBackgroundColor:jt.white},null);case 2:n=t.sent,i.appendChild(n),e.selected&&i.parentNode.focus();case 5:case"end":return t.stop()}}),t)})))(),function(){i.removeChild(n)}}}),[e.spreadsheet,e.chartType,e.selected]),(0,I.jsx)("button",{className:"ChartPreview",onClick:function(){r&&e.onClick(e.chartType,r)},children:(0,I.jsx)("div",{ref:t})})}),nm=function(e){var t=e.setAppState,n=e.appState,r=e.onClose,o=e.onInsertChart,i=s().useCallback((function(){r&&r()}),[r]),a=function(e,n){o(n),hu("magic","chart",e),t({currentChartType:e,pasteDialog:{shown:!1,data:null}})};return(0,I.jsx)(sc,{small:!0,onCloseRequest:i,title:O("labels.pasteCharts"),className:"PasteChartDialog",autofocus:!1,children:(0,I.jsxs)("div",{className:"container",children:[(0,I.jsx)(tm,{chartType:"bar",spreadsheet:n.pasteDialog.data,selected:"bar"===n.currentChartType,onClick:a}),(0,I.jsx)(tm,{chartType:"line",spreadsheet:n.pasteDialog.data,selected:"line"===n.currentChartType,onClick:a})]})})};function rm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}n(3922);var om=function(){return(0,I.jsxs)("div",{className:"HelpDialog--header",children:[(0,I.jsx)("a",{className:"HelpDialog--btn",href:"https://github.com/excalidraw/excalidraw#documentation",target:"_blank",rel:"noopener noreferrer",children:O("helpDialog.documentation")}),(0,I.jsx)("a",{className:"HelpDialog--btn",href:"https://blog.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:O("helpDialog.blog")}),(0,I.jsx)("a",{className:"HelpDialog--btn",href:"https://github.com/excalidraw/excalidraw/issues",target:"_blank",rel:"noopener noreferrer",children:O("helpDialog.github")})]})},im=function(e){return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("h3",{children:e.title}),e.children]})},am=function(e){return(0,I.jsx)("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"space-between"},children:e.children})},lm=function(e){return(0,I.jsx)("div",{style:{width:"49%"},children:e.children})},sm=function(e){return(0,I.jsxs)("div",{className:"HelpDialog--island",children:[(0,I.jsx)("h3",{className:"HelpDialog--island-title",children:e.caption}),e.children]})},cm=function(e){return(0,I.jsx)("div",{className:"HelpDialog--shortcut",children:(0,I.jsxs)("div",{style:{display:"flex",margin:"0",padding:"4px 8px",alignItems:"center"},children:[(0,I.jsx)("div",{style:{lineHeight:1.4},children:e.label}),(0,I.jsx)("div",{style:{display:"flex",flex:"0 0 auto",justifyContent:"flex-end",marginInlineStart:"auto",minWidth:"30%"},children:e.shortcuts.map((function(t,n){return(0,I.jsxs)(s().Fragment,{children:[(0,I.jsx)(um,{children:t}),e.isOr&&n!==e.shortcuts.length-1&&O("helpDialog.or")]},n)}))})]})})};cm.defaultProps={isOr:!0};var um=function(e){return(0,I.jsx)("kbd",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rm(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({className:"HelpDialog--key"},e))},dm=function(e){var t=e.onClose,n=s().useCallback((function(){t&&t()}),[t]);return(0,I.jsx)(I.Fragment,{children:(0,I.jsxs)(sc,{onCloseRequest:n,title:O("helpDialog.title"),className:"HelpDialog",children:[(0,I.jsx)(om,{}),(0,I.jsx)(im,{title:O("helpDialog.shortcuts"),children:(0,I.jsxs)(am,{children:[(0,I.jsxs)(lm,{children:[(0,I.jsxs)(sm,{caption:O("helpDialog.shapes"),children:[(0,I.jsx)(cm,{label:O("toolBar.selection"),shortcuts:["V","1"]}),(0,I.jsx)(cm,{label:O("toolBar.rectangle"),shortcuts:["R","2"]}),(0,I.jsx)(cm,{label:O("toolBar.diamond"),shortcuts:["D","3"]}),(0,I.jsx)(cm,{label:O("toolBar.ellipse"),shortcuts:["E","4"]}),(0,I.jsx)(cm,{label:O("toolBar.arrow"),shortcuts:["A","5"]}),(0,I.jsx)(cm,{label:O("toolBar.line"),shortcuts:["P","6"]}),(0,I.jsx)(cm,{label:O("toolBar.freedraw"),shortcuts:["Shift + P","X","7"]}),(0,I.jsx)(cm,{label:O("toolBar.text"),shortcuts:["T","8"]}),(0,I.jsx)(cm,{label:O("toolBar.image"),shortcuts:["9"]}),(0,I.jsx)(cm,{label:O("toolBar.library"),shortcuts:["0"]}),(0,I.jsx)(cm,{label:O("helpDialog.editSelectedShape"),shortcuts:[yn("Enter"),O("helpDialog.doubleClick")]}),(0,I.jsx)(cm,{label:O("helpDialog.textNewLine"),shortcuts:[yn("Enter"),yn("Shift+Enter")]}),(0,I.jsx)(cm,{label:O("helpDialog.textFinish"),shortcuts:[yn("Esc"),yn("CtrlOrCmd+Enter")]}),(0,I.jsx)(cm,{label:O("helpDialog.curvedArrow"),shortcuts:["A",O("helpDialog.click"),O("helpDialog.click"),O("helpDialog.click")],isOr:!1}),(0,I.jsx)(cm,{label:O("helpDialog.curvedLine"),shortcuts:["L",O("helpDialog.click"),O("helpDialog.click"),O("helpDialog.click")],isOr:!1}),(0,I.jsx)(cm,{label:O("toolBar.lock"),shortcuts:["Q"]}),(0,I.jsx)(cm,{label:O("helpDialog.preventBinding"),shortcuts:[yn("CtrlOrCmd")]}),(0,I.jsx)(cm,{label:O("toolBar.link"),shortcuts:[yn("CtrlOrCmd+K")]})]}),(0,I.jsxs)(sm,{caption:O("helpDialog.view"),children:[(0,I.jsx)(cm,{label:O("buttons.zoomIn"),shortcuts:[yn("CtrlOrCmd++")]}),(0,I.jsx)(cm,{label:O("buttons.zoomOut"),shortcuts:[yn("CtrlOrCmd+-")]}),(0,I.jsx)(cm,{label:O("buttons.resetZoom"),shortcuts:[yn("CtrlOrCmd+0")]}),(0,I.jsx)(cm,{label:O("helpDialog.zoomToFit"),shortcuts:["Shift+1"]}),(0,I.jsx)(cm,{label:O("helpDialog.zoomToSelection"),shortcuts:["Shift+2"]}),(0,I.jsx)(cm,{label:O("buttons.fullScreen"),shortcuts:["F"]}),(0,I.jsx)(cm,{label:O("buttons.zenMode"),shortcuts:[yn("Alt+Z")]}),(0,I.jsx)(cm,{label:O("labels.showGrid"),shortcuts:[yn("CtrlOrCmd+'")]}),(0,I.jsx)(cm,{label:O("labels.viewMode"),shortcuts:[yn("Alt+R")]}),(0,I.jsx)(cm,{label:O("labels.toggleTheme"),shortcuts:[yn("Alt+Shift+D")]}),(0,I.jsx)(cm,{label:O("stats.title"),shortcuts:[yn("Alt+/")]})]})]}),(0,I.jsx)(lm,{children:(0,I.jsxs)(sm,{caption:O("helpDialog.editor"),children:[(0,I.jsx)(cm,{label:O("labels.selectAll"),shortcuts:[yn("CtrlOrCmd+A")]}),(0,I.jsx)(cm,{label:O("labels.multiSelect"),shortcuts:[yn("Shift+".concat(O("helpDialog.click")))]}),(0,I.jsx)(cm,{label:O("helpDialog.deepSelect"),shortcuts:[yn("CtrlOrCmd+".concat(O("helpDialog.click")))]}),(0,I.jsx)(cm,{label:O("helpDialog.deepBoxSelect"),shortcuts:[yn("CtrlOrCmd+".concat(O("helpDialog.drag")))]}),(0,I.jsx)(cm,{label:O("labels.moveCanvas"),shortcuts:[yn("Space+".concat(O("helpDialog.drag"))),yn("Wheel+".concat(O("helpDialog.drag")))],isOr:!0}),(0,I.jsx)(cm,{label:O("labels.cut"),shortcuts:[yn("CtrlOrCmd+X")]}),(0,I.jsx)(cm,{label:O("labels.copy"),shortcuts:[yn("CtrlOrCmd+C")]}),(0,I.jsx)(cm,{label:O("labels.paste"),shortcuts:[yn("CtrlOrCmd+V")]}),(0,I.jsx)(cm,{label:O("labels.copyAsPng"),shortcuts:[yn("Shift+Alt+C")]}),(0,I.jsx)(cm,{label:O("labels.copyStyles"),shortcuts:[yn("CtrlOrCmd+Alt+C")]}),(0,I.jsx)(cm,{label:O("labels.pasteStyles"),shortcuts:[yn("CtrlOrCmd+Alt+V")]}),(0,I.jsx)(cm,{label:O("labels.delete"),shortcuts:[yn("Del")]}),(0,I.jsx)(cm,{label:O("labels.sendToBack"),shortcuts:[yn(Tt?"CtrlOrCmd+Alt+[":"CtrlOrCmd+Shift+[")]}),(0,I.jsx)(cm,{label:O("labels.bringToFront"),shortcuts:[yn(Tt?"CtrlOrCmd+Alt+]":"CtrlOrCmd+Shift+]")]}),(0,I.jsx)(cm,{label:O("labels.sendBackward"),shortcuts:[yn("CtrlOrCmd+[")]}),(0,I.jsx)(cm,{label:O("labels.bringForward"),shortcuts:[yn("CtrlOrCmd+]")]}),(0,I.jsx)(cm,{label:O("labels.alignTop"),shortcuts:[yn("CtrlOrCmd+Shift+Up")]}),(0,I.jsx)(cm,{label:O("labels.alignBottom"),shortcuts:[yn("CtrlOrCmd+Shift+Down")]}),(0,I.jsx)(cm,{label:O("labels.alignLeft"),shortcuts:[yn("CtrlOrCmd+Shift+Left")]}),(0,I.jsx)(cm,{label:O("labels.alignRight"),shortcuts:[yn("CtrlOrCmd+Shift+Right")]}),(0,I.jsx)(cm,{label:O("labels.duplicateSelection"),shortcuts:[yn("CtrlOrCmd+D"),yn("Alt+".concat(O("helpDialog.drag")))]}),(0,I.jsx)(cm,{label:O("buttons.undo"),shortcuts:[yn("CtrlOrCmd+Z")]}),(0,I.jsx)(cm,{label:O("buttons.redo"),shortcuts:Pt?[yn("CtrlOrCmd+Y"),yn("CtrlOrCmd+Shift+Z")]:[yn("CtrlOrCmd+Shift+Z")]}),(0,I.jsx)(cm,{label:O("labels.group"),shortcuts:[yn("CtrlOrCmd+G")]}),(0,I.jsx)(cm,{label:O("labels.ungroup"),shortcuts:[yn("CtrlOrCmd+Shift+G")]}),(0,I.jsx)(cm,{label:O("labels.flipHorizontal"),shortcuts:[yn("Shift+H")]}),(0,I.jsx)(cm,{label:O("labels.flipVertical"),shortcuts:[yn("Shift+V")]}),(0,I.jsx)(cm,{label:O("labels.showStroke"),shortcuts:[yn("S")]}),(0,I.jsx)(cm,{label:O("labels.showBackground"),shortcuts:[yn("G")]}),(0,I.jsx)(cm,{label:O("labels.decreaseFontSize"),shortcuts:[yn("CtrlOrCmd+Shift+<")]}),(0,I.jsx)(cm,{label:O("labels.increaseFontSize"),shortcuts:[yn("CtrlOrCmd+Shift+>")]})]})})]})})]})})},fm=(n(5080),function(e){var t,n=e.children,r=e.color;return(0,I.jsx)("div",{className:"Card",style:(t={},L(t,"--card-color","primary"===r?"var(--color-primary)":jt[r][7]),L(t,"--card-color-darker","primary"===r?"var(--color-primary-darker)":jt[r][8]),L(t,"--card-color-darkest","primary"===r?"var(--color-primary-darkest)":jt[r][9]),t),children:n})}),pm=function(e){var t=e.elements,n=e.appState,r=e.files,o=e.actionManager,i=e.exportOpts,a=e.canvas,l=i.onExportToBackend;return(0,I.jsx)("div",{className:"ExportDialog ExportDialog--json",children:(0,I.jsxs)("div",{className:"ExportDialog-cards",children:[i.saveFileToDisk&&(0,I.jsxs)(fm,{color:"lime",children:[(0,I.jsx)("div",{className:"Card-icon",children:yl}),(0,I.jsx)("h2",{children:O("exportDialog.disk_title")}),(0,I.jsxs)("div",{className:"Card-details",children:[O("exportDialog.disk_details"),!gd&&o.renderAction("changeProjectName")]}),(0,I.jsx)(Zs,{className:"Card-button",type:"button",title:O("exportDialog.disk_button"),"aria-label":O("exportDialog.disk_button"),showAriaLabel:!0,onClick:function(){o.executeAction(op)}})]}),l&&(0,I.jsxs)(fm,{color:"pink",children:[(0,I.jsx)("div",{className:"Card-icon",children:ul}),(0,I.jsx)("h2",{children:O("exportDialog.link_title")}),(0,I.jsx)("div",{className:"Card-details",children:O("exportDialog.link_details")}),(0,I.jsx)(Zs,{className:"Card-button",type:"button",title:O("exportDialog.link_button"),"aria-label":O("exportDialog.link_button"),showAriaLabel:!0,onClick:function(){return l(t,n,r,a)}})]}),i.renderCustomUI&&i.renderCustomUI(t,n,r,a)]})})},hm=function(e){var t=e.elements,n=e.appState,r=e.files,o=e.actionManager,i=e.exportOpts,a=e.canvas,c=h((0,l.useState)(!1),2),u=c[0],d=c[1],f=s().useCallback((function(){d(!1)}),[]);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Zs,{onClick:function(){d(!0)},"data-testid":"json-export-button",icon:vl,type:"button","aria-label":O("buttons.export"),showAriaLabel:eg(),title:O("buttons.export")}),u&&(0,I.jsx)(sc,{onCloseRequest:f,title:O("buttons.export"),children:(0,I.jsx)(pm,{elements:t,appState:n,files:r,actionManager:o,onCloseRequest:f,exportOpts:i,canvas:a})})]})};function mm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mm(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var vm=function(e){var t=e.elements,n=e.appState,r=e.files,o=e.maxWidthOrHeight,i=e.getDimensions,a=Md({elements:t,appState:n},null,null),l=a.elements,s=a.appState,c=s.exportBackground,u=s.viewBackgroundColor;return uf(jc(l),gm(gm({},s),{},{offsetTop:0,offsetLeft:0,width:0,height:0}),r||{},{exportBackground:c,viewBackgroundColor:u},(function(e,t){var n,r=document.createElement("canvas");if(o){"function"==typeof i&&console.warn("`getDimensions()` is ignored when `maxWidthOrHeight` is supplied.");var a=Math.max(e,t),l=o/a;return r.width=e*l,r.height=t*l,{canvas:r,scale:l}}var s=(null==i?void 0:i(e,t))||{width:e,height:t};return r.width=s.width,r.height=s.height,{canvas:r,scale:null!==(n=s.scale)&&void 0!==n?n:1}}))},bm=function(){var e=(0,d.Z)(g().mark((function e(t){var n,r,o,i,a,l;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=(r=t).mimeType,i=void 0===o?c.LO.png:o,a=r.quality,i===c.LO.png&&"number"==typeof a&&console.warn('"quality" will be ignored for "'.concat(c.LO.png,'" mimeType')),"image/jpg"===i&&(i=c.LO.jpg),i!==c.LO.jpg||null!==(n=t.appState)&&void 0!==n&&n.exportBackground||(console.warn('Defaulting "exportBackground" to "true" for "'.concat(c.LO.jpg,'" mimeType')),t=gm(gm({},t),{},{appState:gm(gm({},t.appState),{},{exportBackground:!0})})),e.next=6,vm(t);case 6:return l=e.sent,a=a||(/image\/jpe?g/.test(i)?.92:.8),e.abrupt("return",new Promise((function(e){l.toBlob((function(t){e(t)}),i,a)})));case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ym=function(){var e=(0,d.Z)(g().mark((function e(t){var n,r,o,i,a,l,s,c,u;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.elements,r=t.appState,o=void 0===r?zn():r,i=t.files,a=void 0===i?{}:i,l=t.exportPadding,s=Md({elements:n,appState:o},null,null),c=s.elements,u=s.appState,e.abrupt("return",df(jc(c),gm(gm({},u),{},{exportPadding:l}),a));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function xm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xm(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n(9295),n(9781);var km=function(e){var t=e.libItem,n=e.appState,r=e.index,o=e.onChange,i=e.onRemove,a=(0,l.useRef)(null),s=(0,l.useRef)(null);return(0,l.useEffect)((function(){var e=a.current;e&&(0,d.Z)(g().mark((function r(){var o;return g().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,ym({elements:t.elements,appState:wm(wm({},n),{},{viewBackgroundColor:jt.white,exportBackground:!0}),files:null});case 2:o=r.sent,e.innerHTML=o.outerHTML;case 4:case"end":return r.stop()}}),r)})))()}),[t.elements,n]),(0,I.jsxs)("div",{className:"single-library-item",children:[(0,I.jsx)("div",{ref:a,className:"single-library-item__svg"}),(0,I.jsx)(Zs,{"aria-label":O("buttons.remove"),type:"button",icon:Bl,className:"single-library-item--remove",onClick:i.bind(null,t.id),title:O("buttons.remove")}),(0,I.jsxs)("div",{style:{display:"flex",margin:"0.8rem 0.3rem",width:"100%",fontSize:"14px",fontWeight:500,flexDirection:"column"},children:[(0,I.jsxs)("label",{style:{display:"flex",justifyContent:"space-between",flexDirection:"column"},children:[(0,I.jsxs)("div",{style:{padding:"0.5em 0"},children:[(0,I.jsx)("span",{style:{fontWeight:500,color:jt.gray[6]},children:O("publishDialog.itemName")}),(0,I.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,I.jsx)("input",{type:"text",ref:s,style:{width:"80%",padding:"0.2rem"},defaultValue:t.name,placeholder:"Item name",onChange:function(e){o(e.target.value,r)}})]}),(0,I.jsx)("span",{className:"error",children:t.error})]})]})};function Em(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Em(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Em(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Sm(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Cm(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cm(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function Cm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var jm="publish-library-data",Om=function(){var e=(0,d.Z)(g().mark((function e(t){var n,r,o,i,a,l,s,u,d,f,p,m,v,b,y,x,w;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=6,r=128,o=Math.round(r/16),i=Math.max(Math.round(r/64),2),a=pn(t,n),(l=document.createElement("canvas")).width=a[0].length*r+(a[0].length+1)*(2*o)-2*o,l.height=a.length*r+(a.length+1)*(2*o)-2*o,(s=l.getContext("2d")).fillStyle=jt.white,s.fillRect(0,0,l.width,l.height),u=Sm(t.entries()),e.prev=12,u.s();case 14:if((d=u.n()).done){e.next=28;break}return f=h(d.value,2),p=f[0],m=f[1],e.next=18,vm({elements:m.elements,files:null,maxWidthOrHeight:r});case 18:v=e.sent,b=v.width,y=v.height,x=Math.floor(p/n)*(r+2*o),w=p%n*(r+2*o),s.drawImage(v,w+(r-b)/2+o,x+(r-y)/2+o),s.lineWidth=i,s.strokeStyle=jt.gray[4],s.strokeRect(w+o/2,x+o/2,r+o,r+o);case 26:e.next=14;break;case 28:e.next=33;break;case 30:e.prev=30,e.t0=e.catch(12),u.e(e.t0);case 33:return e.prev=33,u.f(),e.finish(33);case 36:return e.t1=Wd,e.t2=File,e.next=40,Bd(l);case 40:return e.t3=e.sent,e.t4=[e.t3],e.t5={type:c.LO.png},e.t6=new e.t2(e.t4,"preview",e.t5),e.t7={outputType:c.LO.jpg,maxWidthOrHeight:5e3},e.next=47,(0,e.t1)(e.t6,e.t7);case 47:return e.abrupt("return",e.sent);case 48:case"end":return e.stop()}}),e,null,[[12,30,33,36]])})));return function(t){return e.apply(this,arguments)}}(),Im=function(e){var t=e.onClose,n=e.libraryItems,r=e.appState,o=e.onSuccess,i=e.onError,a=e.updateItemsInStorage,s=e.onRemove,u=h((0,l.useState)({authorName:"",githubHandle:"",name:"",description:"",twitterHandle:"",website:""}),2),f=u[0],p=u[1],m=h((0,l.useState)(!1),2),v=m[0],b=m[1];(0,l.useEffect)((function(){var e=function(){try{var e=localStorage.getItem(jm);if(e)return JSON.parse(e)}catch(t){console.error(t)}return null}();e&&p(e)}),[]);var y=h((0,l.useState)(n.slice()),2),x=y[0],w=y[1];(0,l.useEffect)((function(){w(n.slice())}),[n]);var k,E,_=function(e){p(_m(_m({},f),{},L({},e.target.name,e.target.value)))},S=(E=(0,d.Z)(g().mark((function e(t){var n,r,a,l,s,u,d;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.preventDefault(),b(!0),n=[],r=!1,x.forEach((function(e){var t="";e.name||(t=O("publishDialog.errors.required"),r=!0),n.push(_m(_m({},e),{},{error:t}))})),!r){e.next=9;break}return w(n),b(!1),e.abrupt("return");case 9:return e.next=11,Om(x);case 11:a=e.sent,l={type:c.r8.excalidrawLibrary,version:c.Kr.excalidrawLibrary,source:c.pb,libraryItems:x},s=JSON.stringify(l,null,2),u=new Blob([s],{type:"application/json"}),(d=new FormData).append("excalidrawLib",u),d.append("previewImage",a),d.append("previewImageType",a.type),d.append("title",f.name),d.append("authorName",f.authorName),d.append("githubHandle",f.githubHandle),d.append("name",f.name),d.append("description",f.description),d.append("twitterHandle",f.twitterHandle),d.append("website",f.website),fetch("".concat("https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries","/submit"),{method:"post",body:d}).then((function(e){return e.ok?e.json().then((function(e){var t=e.url;localStorage.removeItem(jm),o({url:t,authorName:f.authorName,items:x})})):e.json().catch((function(){throw new Error(e.statusText||"something went wrong")})).then((function(t){throw new Error(t.message||e.statusText||"something went wrong")}))}),(function(e){console.error(e),i(e),b(!1)})).catch((function(e){console.error(e),i(e),b(!1)}));case 27:case"end":return e.stop()}}),e)}))),function(e){return E.apply(this,arguments)}),C=(0,l.useCallback)((function(){a(x),function(e){try{localStorage.setItem(jm,JSON.stringify(e))}catch(t){console.error(t)}}(f),t()}),[x,t,a,f]),j=!!n.length;return(0,I.jsx)(sc,{onCloseRequest:C,title:O("publishDialog.title"),className:"publish-library",children:j?(0,I.jsxs)("form",{onSubmit:S,children:[(0,I.jsxs)("div",{className:"publish-library-note",children:[O("publishDialog.noteDescription.pre"),(0,I.jsx)("a",{href:"https://libraries.excalidraw.com",target:"_blank",rel:"noopener noreferrer",children:O("publishDialog.noteDescription.link")})," ",O("publishDialog.noteDescription.post")]}),(0,I.jsxs)("span",{className:"publish-library-note",children:[O("publishDialog.noteGuidelines.pre"),(0,I.jsx)("a",{href:"https://github.com/excalidraw/excalidraw-libraries#guidelines",target:"_blank",rel:"noopener noreferrer",children:O("publishDialog.noteGuidelines.link")}),O("publishDialog.noteGuidelines.post")]}),(0,I.jsx)("div",{className:"publish-library-note",children:O("publishDialog.noteItems")}),(k=[],x.forEach((function(e,t){k.push((0,I.jsx)("div",{className:"single-library-item-wrapper",children:(0,I.jsx)(km,{libItem:e,appState:r,index:t,onChange:function(e,t){var n=x.slice();n[t].name=e,w(n)},onRemove:s})},t))})),(0,I.jsx)("div",{className:"selected-library-items",children:k})),(0,I.jsxs)("div",{className:"publish-library__fields",children:[(0,I.jsxs)("label",{children:[(0,I.jsxs)("div",{children:[(0,I.jsx)("span",{children:O("publishDialog.libraryName")}),(0,I.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,I.jsx)("input",{type:"text",name:"name",required:!0,value:f.name,onChange:_,placeholder:O("publishDialog.placeholder.libraryName")})]}),(0,I.jsxs)("label",{style:{alignItems:"flex-start"},children:[(0,I.jsxs)("div",{children:[(0,I.jsx)("span",{children:O("publishDialog.libraryDesc")}),(0,I.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,I.jsx)("textarea",{name:"description",rows:4,required:!0,value:f.description,onChange:_,placeholder:O("publishDialog.placeholder.libraryDesc")})]}),(0,I.jsxs)("label",{children:[(0,I.jsxs)("div",{children:[(0,I.jsx)("span",{children:O("publishDialog.authorName")}),(0,I.jsx)("span",{"aria-hidden":"true",className:"required",children:"*"})]}),(0,I.jsx)("input",{type:"text",name:"authorName",required:!0,value:f.authorName,onChange:_,placeholder:O("publishDialog.placeholder.authorName")})]}),(0,I.jsxs)("label",{children:[(0,I.jsx)("span",{children:O("publishDialog.githubUsername")}),(0,I.jsx)("input",{type:"text",name:"githubHandle",value:f.githubHandle,onChange:_,placeholder:O("publishDialog.placeholder.githubHandle")})]}),(0,I.jsxs)("label",{children:[(0,I.jsx)("span",{children:O("publishDialog.twitterUsername")}),(0,I.jsx)("input",{type:"text",name:"twitterHandle",value:f.twitterHandle,onChange:_,placeholder:O("publishDialog.placeholder.twitterHandle")})]}),(0,I.jsxs)("label",{children:[(0,I.jsx)("span",{children:O("publishDialog.website")}),(0,I.jsx)("input",{type:"text",name:"website",pattern:"https?://.+",title:O("publishDialog.errors.website"),value:f.website,onChange:_,placeholder:O("publishDialog.placeholder.website")})]}),(0,I.jsxs)("span",{className:"publish-library-note",children:[O("publishDialog.noteLicense.pre"),(0,I.jsx)("a",{href:"https://github.com/excalidraw/excalidraw-libraries/blob/main/LICENSE",target:"_blank",rel:"noopener noreferrer",children:O("publishDialog.noteLicense.link")}),O("publishDialog.noteLicense.post")]})]}),(0,I.jsxs)("div",{className:"publish-library__buttons",children:[(0,I.jsx)(Zs,{type:"button",title:O("buttons.cancel"),"aria-label":O("buttons.cancel"),label:O("buttons.cancel"),onClick:C,"data-testid":"cancel-clear-canvas-button",className:"publish-library__buttons--cancel"}),(0,I.jsx)(Zs,{type:"submit",title:O("buttons.submit"),"aria-label":O("buttons.submit"),label:O("buttons.submit"),className:"publish-library__buttons--confirm",isLoading:v})]})]}):(0,I.jsx)("p",{style:{padding:"1em",textAlign:"center",fontWeight:500},children:O("publishDialog.atleastOneLibItem")})})},Mm=(n(4406),n(2891)),Tm=(n(694),(0,I.jsx)("svg",{viewBox:"0 0 1792 1792",children:(0,I.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)"})})),Pm=function(e){var t=e.id,n=e.elements,r=e.files,o=e.isPending,i=e.onClick,a=e.selected,s=e.onToggle,u=(0,l.useRef)(null);(0,l.useEffect)((function(){var e=u.current;if(e)return(0,d.Z)(g().mark((function t(){var o;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,df(n,{exportBackground:!1,viewBackgroundColor:jt.white},r);case 4:o=t.sent,e.innerHTML=o.outerHTML;case 6:case"end":return t.stop()}}),t)})))(),function(){e.innerHTML=""}}),[n,r]);var f=h((0,l.useState)(!1),2),p=f[0],m=f[1],v=eg(),b=o&&(0,I.jsx)("div",{className:"library-unit__adder",children:Tm});return(0,I.jsxs)("div",{className:Ue("library-unit",{"library-unit__active":n,"library-unit--hover":n&&p,"library-unit--selected":a}),onMouseEnter:function(){return m(!0)},onMouseLeave:function(){return m(!1)},children:[(0,I.jsx)("div",{className:Ue("library-unit__dragger",{"library-unit__pulse":!!o}),ref:u,draggable:!!n,onClick:n||o?function(e){t&&e.shiftKey?s(t,e):i()}:void 0,onDragStart:function(e){m(!1),e.dataTransfer.setData(c.LO.excalidrawlib,JSON.stringify(n))}}),b,t&&n&&(p||v||a)&&(0,I.jsx)(Zf,{checked:a,onChange:function(e,n){return s(t,n)},className:"library-unit__checkbox"})]})},Am=(n(6043),function(e){var t,n,r,o=e.libraryItems,i=e.onRemoveFromLibrary,a=e.onAddToLibrary,s=e.onInsertShape,u=e.pendingElements,f=e.theme,p=e.setAppState,m=e.libraryReturnUrl,v=e.library,b=e.files,y=e.id,x=e.selectedItems,w=e.onToggle,k=e.onPublish,E=e.resetLibrary,_=(0,l.useCallback)((function(){var e=x.length?O("alerts.removeItemsFromsLibrary",{count:x.length}):O("alerts.resetLibrary"),t=x.length?O("confirmDialog.removeItemsFromLib"):O("confirmDialog.resetLibrary");return(0,I.jsx)(fc,{onConfirm:function(){x.length?i():E(),j(!1)},onCancel:function(){j(!1)},title:t,children:(0,I.jsx)("p",{children:e})})}),[x,i,E]),S=h((0,l.useState)(!1),2),C=S[0],j=S[1],M=eg(),T=M?4:6,P=m||window.location.origin+window.location.pathname,L=x.some((function(e){var t;return"published"===(null===(t=o.find((function(t){return t.id===e})))||void 0===t?void 0:t.status)})),D=function(e){var t,n,r,o,i;return(0,I.jsx)($f,{children:(0,I.jsx)(Pm,{elements:null===(t=e.item)||void 0===t?void 0:t.elements,files:b,isPending:!(null!==(n=e.item)&&void 0!==n&&n.id||null===(r=e.item)||void 0===r||!r.elements),onClick:e.onClick||function(){},id:(null===(o=e.item)||void 0===o?void 0:o.id)||null,selected:!(null===(i=e.item)||void 0===i||!i.id)&&x.includes(e.item.id),onToggle:function(e,t){w(e,t)}})},e.key)},R=function(e){var t=e.map((function(e){return e.id?D({item:e,onClick:function(){return s(e.elements)},key:e.id}):D({key:"__pending__item__",item:e,onClick:function(){return a(u)}})})),n=(0,Mm.chunk)(t,T);return n.length||(n=[[]]),n.map((function(e,t,n){return t===n.length-1&&(e=e.concat(new Array(T-e.length).fill(null).map((function(e,t){return D({key:"empty_".concat(t),item:null})})))),(0,I.jsx)(qf,{align:"center",gap:1,children:e},t)}))},z=o.filter((function(e){return"published"===e.status})),N=[].concat(A(u.length?[{id:null,elements:u}]:[]),A(o.filter((function(e){return"published"!==e.status}))));return(0,I.jsxs)("div",{className:"library-menu-items-container",children:[C&&_(),(0,I.jsxs)("div",{className:"layer-ui__library-header",children:[(t=!!x.length,n=t?o.filter((function(e){return x.includes(e.id)})):o,r=O(t?"buttons.remove":"buttons.resetLibrary"),(0,I.jsxs)("div",{className:"library-actions",children:[(!t||!M)&&(0,I.jsx)(Zs,{type:"button",title:O("buttons.load"),"aria-label":O("buttons.load"),icon:pl,onClick:function(){tf(v).then((function(){p({isLibraryOpen:!1}),p({isLibraryOpen:!0})})).catch(Cn).catch((function(e){p({errorMessage:e.message})}))},className:"library-actions--load"},"import"),!!n.length&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Zs,{type:"button",title:O("buttons.export"),"aria-label":O("buttons.export"),icon:yl,onClick:(0,d.Z)(g().mark((function e(){var r;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=4;break}e.t0=n,e.next=7;break;case 4:return e.next=6,v.loadLibrary();case 6:e.t0=e.sent;case 7:r=e.t0,ef(r).catch(Cn).catch((function(e){p({errorMessage:e.message})}));case 9:case"end":return e.stop()}}),e)}))),className:"library-actions--export",children:x.length>0&&(0,I.jsx)("span",{className:"library-actions-counter",children:x.length})},"export"),(0,I.jsx)(Zs,{type:"button",title:r,"aria-label":r,icon:ml,onClick:function(){return j(!0)},className:"library-actions--remove",children:x.length>0&&(0,I.jsx)("span",{className:"library-actions-counter",children:x.length})},"reset")]}),t&&!L&&(0,I.jsx)(nc,{label:O("hints.publishLibrary"),children:(0,I.jsxs)(Zs,{type:"button","aria-label":O("buttons.publishLibrary"),label:O("buttons.publishLibrary"),icon:ys,className:"library-actions--publish",onClick:k,children:[!M&&(0,I.jsx)("label",{children:O("buttons.publishLibrary")}),x.length>0&&(0,I.jsx)("span",{className:"library-actions-counter",children:x.length})]})})]})),(0,I.jsx)("a",{href:"".concat("https://libraries.excalidraw.com","?target=").concat(window.name||"_blank","&referrer=").concat(P,"&useHash=true&token=").concat(y,"&theme=").concat(f,"&version=").concat(c.Kr.excalidrawLibrary),target:"_excalidraw_libraries",children:O("labels.libraries")})]},"library-header"),(0,I.jsxs)($f,{className:"library-menu-items-container__items",align:"start",gap:1,children:[(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("div",{className:"separator",children:O("labels.personalLib")}),R(N)]}),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)("div",{className:"separator",children:[O("labels.excalidrawLib")," "]}),R(z)]})]})]})}),Lm=function(e,t){return e.filter((function(e){return t.includes(e.id)}))},Dm=function(e){var t,n,r=e.onClose,o=e.onInsertShape,i=e.pendingElements,a=e.onAddToLibrary,s=e.theme,u=e.setAppState,f=e.files,p=e.libraryReturnUrl,m=e.focusContainer,v=e.library,b=e.id,y=e.appState,x=(0,l.useRef)(null);t=x,n=function(e){e.target.closest(".ToolIcon__library")||r()},(0,l.useEffect)((function(){var e=function(e){t.current&&(e.target instanceof Element&&(t.current.contains(e.target)||!document.body.contains(e.target))||n(e))};return document.addEventListener("pointerdown",e,!1),function(){document.removeEventListener("pointerdown",e)}}),[t,n]),(0,l.useEffect)((function(){var e=function(e){e.key===tn.ESCAPE&&r()};return document.addEventListener(c.Ks.KEYDOWN,e),function(){document.removeEventListener(c.Ks.KEYDOWN,e)}}),[r]);var w=h((0,l.useState)([]),2),k=w[0],E=w[1],_=h((0,l.useState)("preloading"),2),S=_[0],C=_[1],j=h((0,l.useState)([]),2),M=j[0],T=j[1],P=h((0,l.useState)(!1),2),L=P[0],D=P[1],R=h((0,l.useState)(null),2),z=R[0],N=R[1],H=(0,l.useRef)(null);(0,l.useEffect)((function(){return Promise.race([new Promise((function(e){H.current=window.setTimeout((function(){e("loading")}),100)})),v.loadLibrary().then((function(e){E(e),C("ready")}))]).then((function(e){"loading"===e&&C("loading")})),function(){clearTimeout(H.current)}}),[v]);var B=(0,l.useCallback)((0,d.Z)(g().mark((function e(){var t,n;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v.loadLibrary();case 2:t=e.sent,n=t.filter((function(e){return!M.includes(e.id)})),v.saveLibrary(n).catch((function(e){E(t),u({errorMessage:O("alerts.errorRemovingFromLibrary")})})),T([]),E(n);case 7:case"end":return e.stop()}}),e)}))),[v,u,M,T]),F=(0,l.useCallback)((function(){v.resetLibrary(),E([]),m()}),[v,m]),U=(0,l.useCallback)(function(){var e=(0,d.Z)(g().mark((function e(t){var n,r;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.some((function(e){return"image"===e.type}))){e.next=2;break}return e.abrupt("return",u({errorMessage:"Support for adding images to the library coming soon!"}));case 2:return e.next=4,v.loadLibrary();case 4:n=e.sent,r=[{status:"unpublished",elements:t,id:ro(),created:Date.now()}].concat(A(n)),a(),v.saveLibrary(r).catch((function(e){E(n),u({errorMessage:O("alerts.errorAddingToLibrary")})})),E(r);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[a,v,u]),K=(0,l.useCallback)((function(){return(0,I.jsxs)(sc,{onCloseRequest:function(){return N(null)},title:O("publishSuccessDialog.title"),className:"publish-library-success",small:!0,children:[(0,I.jsxs)("p",{children:[O("publishSuccessDialog.content",{authorName:z.authorName})," ",(0,I.jsx)("a",{href:null==z?void 0:z.url,target:"_blank",rel:"noopener noreferrer",children:O("publishSuccessDialog.link")})]}),(0,I.jsx)(Zs,{type:"button",title:O("buttons.close"),"aria-label":O("buttons.close"),label:O("buttons.close"),onClick:function(){return N(null)},"data-testid":"publish-library-success-close",className:"publish-library-success-close"})]})}),[N,z]),W=(0,l.useCallback)((function(e){D(!1),N({url:e.url,authorName:e.authorName});var t=k.slice();t.forEach((function(e){M.includes(e.id)&&(e.status="published")})),v.saveLibrary(t),E(t)}),[D,N,k,M,v]),V=h((0,l.useState)(null),2),G=V[0],Z=V[1];return"preloading"===S?null:(0,I.jsxs)(ic,{padding:1,ref:x,className:"layer-ui__library",children:[L&&(0,I.jsx)(Im,{onClose:function(){return D(!1)},libraryItems:Lm(k,M),appState:y,onSuccess:W,onError:function(e){return window.alert(e)},updateItemsInStorage:function(){return v.saveLibrary(k)},onRemove:function(e){return T(M.filter((function(t){return t!==e})))}}),z&&K(),"loading"===S?(0,I.jsx)("div",{className:"layer-ui__library-message",children:O("labels.libraryLoadingMessage")}):(0,I.jsx)(Am,{libraryItems:k,onRemoveFromLibrary:B,onAddToLibrary:U,onInsertShape:o,pendingElements:i,setAppState:u,libraryReturnUrl:p,library:v,theme:s,files:f,id:b,selectedItems:M,onToggle:function(e,t){if(M.includes(e))Z(null),T(M.filter((function(t){return t!==e})));else{if(t.shiftKey&&G){var n=k.findIndex((function(e){return e.id===G})),r=k.findIndex((function(t){return t.id===e}));if(-1===n||-1===r)return void T([].concat(A(M),[e]));var o=Tn(M),i=k.reduce((function(e,t,i){return(i>=n&&i<=r||o.has(t.id))&&e.push(t.id),e}),[]);T(i)}else T([].concat(A(M),[e]));Z(e)}},onPublish:function(){return D(!0)},resetLibrary:F})]})},Rm=(n(3336),n(276),["suggestedBindings","startBoundElement"]);function zm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Nm=function(e){var t,n=e.actionManager,r=e.appState,o=e.files,i=e.setAppState,a=e.canvas,s=e.elements,u=e.onCollabButtonClick,f=e.onLockToggle,p=e.onPenModeToggle,m=e.onInsertElements,v=e.zenModeEnabled,b=e.showExitZenModeBtn,y=e.showThemeBtn,x=e.toggleZenMode,w=e.isCollaborating,k=e.renderTopRightUI,E=e.renderCustomFooter,_=e.viewModeEnabled,S=e.libraryReturnUrl,C=e.UIOptions,j=e.focusContainer,T=e.library,P=e.id,A=e.onImageAction,D=eg(),R=function(){return C.canvasActions.export?(0,I.jsx)(hm,{elements:s,appState:r,files:o,actionManager:n,exportOpts:C.canvasActions.export,canvas:a}):null},z=function(){if(!C.canvasActions.saveAsImage)return null;var e=function(e){return t=(0,d.Z)(g().mark((function t(n){var a;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Kf(e,n,r,o,{exportBackground:r.exportBackground,name:r.name,viewBackgroundColor:r.viewBackgroundColor}).catch(Cn).catch((function(e){console.error(e),i({errorMessage:e.message})}));case 2:a=t.sent,r.exportEmbedScene&&a&&Rd(a)&&i({fileHandle:a});case 4:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)};var t};return(0,I.jsx)(Nh,{elements:s,appState:r,files:o,actionManager:n,onExportToPng:e("png"),onExportToSvg:e("svg"),onExportToClipboard:e("clipboard")})},N=function(){return(0,I.jsx)("div",{style:{width:".625em"}})},H=(0,l.useCallback)((function(){document.querySelector(".Dialog")||i({isLibraryOpen:!1})}),[i]),B=(0,l.useCallback)((function(){i({selectedElementIds:{},selectedGroupIds:{}})}),[i]),F=r.isLibraryOpen?(0,I.jsx)(Dm,{pendingElements:Dc(s,r,!0),onClose:H,onInsertShape:m,onAddToLibrary:B,setAppState:i,libraryReturnUrl:S,focusContainer:j,library:T,theme:r.theme,files:o,id:P,appState:r}):null,U=(0,I.jsxs)(I.Fragment,{children:[r.isLoading&&(0,I.jsx)(M,{}),r.errorMessage&&(0,I.jsx)(Ph,{message:r.errorMessage,onClose:function(){return i({errorMessage:null})}}),r.showHelpDialog&&(0,I.jsx)(dm,{onClose:function(){i({showHelpDialog:!1})}}),r.pasteDialog.shown&&(0,I.jsx)(nm,{setAppState:i,appState:r,onInsertChart:m,onClose:function(){return i({pasteDialog:{shown:!1,data:null}})}})]});return D?(0,I.jsxs)(I.Fragment,{children:[U,(0,I.jsx)(em,{appState:r,elements:s,actionManager:n,libraryMenu:F,renderJSONExportDialog:R,renderImageExportDialog:z,setAppState:i,onCollabButtonClick:u,onLockToggle:f,onPenModeToggle:p,canvas:a,isCollaborating:w,renderCustomFooter:E,viewModeEnabled:_,showThemeBtn:y,onImageAction:A,renderTopRightUI:k})]}):(0,I.jsxs)("div",{className:Ue("layer-ui__wrapper",{"disable-pointerEvents":r.draggingElement||r.resizingElement||r.editingElement&&!Ge(r.editingElement)}),children:[U,(t=kc(r,s),(0,I.jsx)(Hh,{side:"top",children:(0,I.jsxs)("div",{className:"App-menu App-menu_top",children:[(0,I.jsxs)($f,{gap:4,className:Ue({"disable-pointerEvents":v}),children:[_?(0,I.jsx)(Gh,{heading:"canvasActions",className:Ue("zen-mode-transition",{"transition-left":v}),children:(0,I.jsx)(ic,{padding:2,style:{zIndex:1},children:(0,I.jsx)($f,{gap:4,children:(0,I.jsxs)(qf,{gap:1,justifyContent:"space-between",children:[R(),z()]})})})}):(0,I.jsx)(Gh,{heading:"canvasActions",className:Ue("zen-mode-transition",{"transition-left":v}),children:(0,I.jsx)(ic,{padding:2,style:{zIndex:1},children:(0,I.jsxs)($f,{gap:4,children:[(0,I.jsxs)(qf,{gap:1,justifyContent:"space-between",children:[n.renderAction("clearCanvas"),(0,I.jsx)(N,{}),n.renderAction("loadScene"),R(),z(),(0,I.jsx)(N,{}),u&&(0,I.jsx)(Th,{isCollaborating:w,collaboratorCount:r.collaborators.size,onClick:u})]}),(0,I.jsx)(Mh,{actionManager:n,appState:r,setAppState:i,showThemeBtn:y}),r.fileHandle&&(0,I.jsx)(I.Fragment,{children:n.renderAction("saveToActiveFile")})]})})}),t&&(0,I.jsx)(Gh,{heading:"selectedShapeActions",className:Ue("zen-mode-transition",{"transition-left":v}),children:(0,I.jsx)(ic,{className:c.$C.SHAPE_ACTIONS_MENU,padding:2,style:{maxHeight:"".concat(r.height-(r.fileHandle?248:200),"px")},children:(0,I.jsx)(jh,{appState:r,elements:s,renderAction:n.renderAction,elementType:r.elementType})})})]}),!_&&(0,I.jsx)(Gh,{heading:"shapes",children:function(e){return(0,I.jsxs)($f,{gap:4,align:"start",children:[(0,I.jsxs)(qf,{gap:1,className:Ue("App-toolbar-container",{"zen-mode":v}),children:[(0,I.jsx)(Qh,{zenModeEnabled:v,checked:r.penMode,onChange:p,title:O("toolBar.penMode"),penDetected:r.penDetected}),(0,I.jsx)(Uh,{zenModeEnabled:v,checked:r.elementLocked,onChange:f,title:O("toolBar.lock")}),(0,I.jsxs)(ic,{padding:1,className:Ue("App-toolbar",{"zen-mode":v}),children:[(0,I.jsx)(Bh,{appState:r,elements:s,isMobile:D}),e,(0,I.jsx)(qf,{gap:1,children:(0,I.jsx)(Oh,{canvas:a,elementType:r.elementType,setAppState:i,onImageAction:function(e){var t=e.pointerType;A({insertOnCanvasDirectly:"mouse"!==t})}})})]}),(0,I.jsx)(Xh,{appState:r,setAppState:i})]}),F]})}}),(0,I.jsxs)("div",{className:Ue("layer-ui__wrapper__top-right zen-mode-transition",{"transition-right":v}),children:[(0,I.jsx)(Zh,{children:r.collaborators.size>0&&Array.from(r.collaborators).filter((function(e){var t=h(e,2),n=(t[0],t[1]);return 0!==Object.keys(n).length})).map((function(e){var t=h(e,2),r=t[0],o=t[1];return(0,I.jsx)(nc,{label:o.username||"Unknown user",children:n.renderAction("goToCollaborator",{id:r})},r)}))}),null==k?void 0:k(D,r)]})]})})),(0,I.jsxs)("footer",{role:"contentinfo",className:"layer-ui__wrapper__footer App-menu App-menu_bottom",children:[(0,I.jsx)("div",{className:Ue("layer-ui__wrapper__footer-left zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-left":v}),children:(0,I.jsx)($f,{gap:2,children:(0,I.jsxs)(Gh,{heading:"canvasActions",children:[(0,I.jsx)(ic,{padding:1,children:(0,I.jsx)(Ih,{renderAction:n.renderAction,zoom:r.zoom})}),!_&&(0,I.jsxs)("div",{className:Ue("undo-redo-buttons zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":v}),children:[n.renderAction("undo",{size:"small"}),n.renderAction("redo",{size:"small"})]})]})})}),(0,I.jsx)("div",{className:Ue("layer-ui__wrapper__footer-center zen-mode-transition",{"layer-ui__wrapper__footer-left--transition-bottom":v}),children:null==E?void 0:E(!1,r)}),(0,I.jsx)("div",{className:Ue("layer-ui__wrapper__footer-right zen-mode-transition",{"transition-right disable-pointerEvents":v}),children:n.renderAction("toggleShortcuts")}),(0,I.jsx)("button",{className:Ue("disable-zen-mode",{"disable-zen-mode--visible":b}),onClick:x,children:O("buttons.exitZenMode")})]}),r.scrolledOutside&&(0,I.jsx)("button",{className:"scroll-back-to-content",onClick:function(){i(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zm(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},$s(s,r)))},children:O("buttons.scrollBackToContent")})]})},Hm=function(e,t){var n=function(e){return e.suggestedBindings,e.startBoundElement,po(e,Rm)},r=n(e.appState),o=n(t.appState),i=Object.keys(r);return e.renderCustomFooter===t.renderCustomFooter&&e.langCode===t.langCode&&e.elements===t.elements&&e.files===t.files&&i.every((function(e){return r[e]===o[e]}))},Bm=s().memo(Nm,Hm),Fm=(n(1528),function(e){var t,n=eg(),r=Et(e.elements),o=Rc(e.elements,e.appState),i=Et(o);return n&&e.appState.openMenu?null:(0,I.jsx)("div",{className:"Stats",children:(0,I.jsxs)(ic,{padding:2,children:[(0,I.jsx)("div",{className:"close",onClick:e.onClose,children:Bl}),(0,I.jsx)("h3",{children:O("stats.title")}),(0,I.jsx)("table",{children:(0,I.jsxs)("tbody",{children:[(0,I.jsx)("tr",{children:(0,I.jsx)("th",{colSpan:2,children:O("stats.scene")})}),(0,I.jsxs)("tr",{children:[(0,I.jsx)("td",{children:O("stats.elements")}),(0,I.jsx)("td",{children:e.elements.length})]}),(0,I.jsxs)("tr",{children:[(0,I.jsx)("td",{children:O("stats.width")}),(0,I.jsx)("td",{children:Math.round(r[2])-Math.round(r[0])})]}),(0,I.jsxs)("tr",{children:[(0,I.jsx)("td",{children:O("stats.height")}),(0,I.jsx)("td",{children:Math.round(r[3])-Math.round(r[1])})]}),1===o.length&&(0,I.jsx)("tr",{children:(0,I.jsx)("th",{colSpan:2,children:O("stats.element")})}),o.length>1&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("tr",{children:(0,I.jsx)("th",{colSpan:2,children:O("stats.selected")})}),(0,I.jsxs)("tr",{children:[(0,I.jsx)("td",{children:O("stats.elements")}),(0,I.jsx)("td",{children:o.length})]})]}),o.length>0&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)("tr",{children:[(0,I.jsx)("td",{children:"x"}),(0,I.jsx)("td",{children:Math.round(i[0])})]}),(0,I.jsxs)("tr",{children:[(0,I.jsx)("td",{children:"y"}),(0,I.jsx)("td",{children:Math.round(i[1])})]}),(0,I.jsxs)("tr",{children:[(0,I.jsx)("td",{children:O("stats.width")}),(0,I.jsx)("td",{children:Math.round(i[2]-i[0])})]}),(0,I.jsxs)("tr",{children:[(0,I.jsx)("td",{children:O("stats.height")}),(0,I.jsx)("td",{children:Math.round(i[3]-i[1])})]})]}),1===o.length&&(0,I.jsxs)("tr",{children:[(0,I.jsx)("td",{children:O("stats.angle")}),(0,I.jsx)("td",{children:"".concat(Math.round(180*o[0].angle/Math.PI),"°")})]}),null===(t=e.renderCustomStats)||void 0===t?void 0:t.call(e,e.elements,e.appState)]})})]})})}),Um=(n(9757),function(e){var t=e.message,n=e.clearToast,r=(0,l.useRef)(0),o=(0,l.useCallback)((function(){return r.current=window.setTimeout((function(){return n()}),c.Lg)}),[n]);return(0,l.useEffect)((function(){return o(),function(){return clearTimeout(r.current)}}),[o,t]),(0,I.jsx)("div",{className:"Toast",onMouseEnter:function(){return clearTimeout(null==r?void 0:r.current)},onMouseLeave:o,children:(0,I.jsx)("p",{className:"Toast__message",children:t})})});function Km(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Wm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Km(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Km(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Vm=Ps({name:"viewMode",perform:function(e,t){return hu("view","mode","view"),{appState:Wm(Wm({},t),{},{viewModeEnabled:!this.checked(t)}),commitToHistory:!1}},checked:function(e){return e.viewModeEnabled},contextItemLabel:"labels.viewMode",keyTest:function(e){return!e[tn.CTRL_OR_CMD]&&e.altKey&&e.code===en}}),Gm=n(200),Zm=n.n(Gm);function Ym(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Xm(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xm(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function Xm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function qm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qm(Object(n),!0).forEach((function(t){L(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Qm(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=U(e);if(t){var o=U(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return F(this,n)}}var Jm=s().createContext(!1),eg=function(){return(0,l.useContext)(Jm)},tg=s().createContext({container:null,id:null}),ng=function(){return(0,l.useContext)(tg)},rg=!1,og=0,ig=0,ag=0,lg=!1,sg=!1,cg=!1,ug={horizontal:null,vertical:null},dg=0,fg=!1,pg=null,hg={pointers:new Map,lastCenter:null,initialDistance:null,initialScale:null},mg=function(e){B(o,e);var t,n,r=Qm(o);function o(e){var t;D(this,o),t=r.call(this,e),gg.call(N(t));var n,i,a,l,s=zn(),u=e.excalidrawRef,d=e.viewModeEnabled,f=void 0!==d&&d,p=e.zenModeEnabled,h=void 0!==p&&p,m=e.gridModeEnabled,g=void 0!==m&&m,v=e.theme,b=void 0===v?s.theme:v,y=e.name,x=void 0===y?s.name:y;if(t.state=$m($m($m({},s),{},{theme:b,isLoading:!0},t.getCanvasOffsets()),{},{viewModeEnabled:f,zenModeEnabled:h,gridSize:g?c.k:null,name:x,width:window.innerWidth,height:window.innerHeight,showHyperlinkPopup:!1}),t.id=Ke(),u){var w,k="current"in u&&(null===(w=u.current)||void 0===w?void 0:w.readyPromise)||((l=new Promise((function(e,t){i=e,a=t}))).resolve=i,l.reject=a,l),E={ready:!0,readyPromise:k,updateScene:t.updateScene,addFiles:t.addFiles,resetScene:t.resetScene,getSceneElementsIncludingDeleted:t.getSceneElementsIncludingDeleted,history:{clear:t.resetHistory},scrollToContent:t.scrollToContent,getSceneElements:t.getSceneElements,getAppState:function(){return t.state},getFiles:function(){return t.files},refresh:t.refresh,importLibrary:t.importLibraryFromUrl,setToastMessage:t.setToastMessage,id:t.id};"function"==typeof u?u(E):u.current=E,k.resolve(E)}return t.excalidrawContainerValue={container:t.excalidrawContainerRef.current,id:t.id},t.scene=new cr,t.library=new fh(N(t)),t.history=new yh,t.actionManager=new ah(t.syncActionResult,(function(){return t.state}),(function(){return t.scene.getElementsIncludingDeleted()}),N(t)),t.actionManager.registerAll(Ts),t.actionManager.registerAction((n=t.history,{name:"undo",perform:function(e,t){return ih(e,t,(function(){return n.undoOnce()}))},keyTest:function(e){return e[tn.CTRL_OR_CMD]&&e.key.toLowerCase()===tn.Z&&!e.shiftKey},PanelComponent:function(e){var t=e.updateData,n=e.data;return(0,I.jsx)(Zs,{type:"button",icon:_l,"aria-label":O("buttons.undo"),onClick:t,size:(null==n?void 0:n.size)||"medium"})},commitToHistory:function(){return!1}})),t.actionManager.registerAction(function(e){return{name:"redo",perform:function(t,n){return ih(t,n,(function(){return e.redoOnce()}))},keyTest:function(e){return e[tn.CTRL_OR_CMD]&&e.shiftKey&&e.key.toLowerCase()===tn.Z||Pt&&e.ctrlKey&&!e.shiftKey&&e.key===tn.Y},PanelComponent:function(e){var t=e.updateData,n=e.data;return(0,I.jsx)(Zs,{type:"button",icon:Sl,"aria-label":O("buttons.redo"),onClick:t,size:(null==n?void 0:n.size)||"medium"})},commitToHistory:function(){return!1}}}(t.history)),t}return z(o,[{key:"renderCanvas",value:function(){var e=window.devicePixelRatio,t=this.state,n=t.width,r=t.height,o=n*e,i=r*e;return t.viewModeEnabled?(0,I.jsx)("canvas",{className:"excalidraw__canvas",style:{width:n,height:r,cursor:c.oc.GRAB},width:o,height:i,ref:this.handleCanvasRef,onContextMenu:this.handleCanvasContextMenu,onPointerMove:this.handleCanvasPointerMove,onPointerUp:this.handleCanvasPointerUp,onPointerCancel:this.removePointer,onTouchMove:this.handleTouchMove,onPointerDown:this.handleCanvasPointerDown,children:O("labels.drawingCanvas")}):(0,I.jsx)("canvas",{className:"excalidraw__canvas",style:{width:n,height:r},width:o,height:i,ref:this.handleCanvasRef,onContextMenu:this.handleCanvasContextMenu,onPointerDown:this.handleCanvasPointerDown,onDoubleClick:this.handleCanvasDoubleClick,onPointerMove:this.handleCanvasPointerMove,onPointerUp:this.handleCanvasPointerUp,onPointerCancel:this.removePointer,onTouchMove:this.handleTouchMove,children:O("labels.drawingCanvas")})}},{key:"render",value:function(){var e,t,n=this,r=this.state,o=r.zenModeEnabled,i=r.viewModeEnabled,a=Dc(this.scene.getElements(),this.state),l=this.props,s=l.onCollabButtonClick,c=l.renderTopRightUI,u=l.renderFooter,d=l.renderCustomStats;return(0,I.jsx)("div",{className:Ue("excalidraw excalidraw-container",{"excalidraw--view-mode":i,"excalidraw--mobile":this.isMobile}),ref:this.excalidrawContainerRef,onDrop:this.handleAppOnDrop,tabIndex:0,onKeyDown:this.props.handleKeyboardGlobally?void 0:this.onKeyDown,children:(0,I.jsx)(tg.Provider,{value:this.excalidrawContainerValue,children:(0,I.jsxs)(Jm.Provider,{value:this.isMobile,children:[(0,I.jsx)(Bm,{canvas:this.canvas,appState:this.state,files:this.files,setAppState:this.setAppState,actionManager:this.actionManager,elements:this.scene.getElements(),onCollabButtonClick:s,onLockToggle:this.toggleLock,onPenModeToggle:this.togglePenMode,onInsertElements:function(e){return n.addElementsFromPasteOrLibrary({elements:e,position:"center",files:null})},zenModeEnabled:o,toggleZenMode:this.toggleZenMode,langCode:C().code,isCollaborating:this.props.isCollaborating,renderTopRightUI:c,renderCustomFooter:u,viewModeEnabled:i,showExitZenModeBtn:void 0===(null===(e=this.props)||void 0===e?void 0:e.zenModeEnabled)&&o,showThemeBtn:void 0===(null===(t=this.props)||void 0===t?void 0:t.theme)&&this.props.UIOptions.canvasActions.theme,libraryReturnUrl:this.props.libraryReturnUrl,UIOptions:this.props.UIOptions,focusContainer:this.focusContainer,library:this.library,id:this.id,onImageAction:this.onImageAction}),(0,I.jsx)("div",{className:"excalidraw-textEditorContainer"}),(0,I.jsx)("div",{className:"excalidraw-contextMenuContainer"}),1===a.length&&this.state.showHyperlinkPopup&&(0,I.jsx)(wu,{element:a[0],appState:this.state,setAppState:this.setAppState,onLinkOpen:this.props.onLinkOpen},a[0].id),this.state.showStats&&(0,I.jsx)(Fm,{appState:this.state,setAppState:this.setAppState,elements:this.scene.getElements(),onClose:this.toggleStats,renderCustomStats:d}),null!==this.state.toastMessage&&(0,I.jsx)(Um,{message:this.state.toastMessage,clearToast:this.clearToast}),(0,I.jsx)("main",{children:this.renderCanvas()})]})})})}},{key:"componentDidMount",value:(n=(0,d.Z)(g().mark((function e(){var t,n,r,o,i=this;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.unmounted=!1,this.excalidrawContainerValue.container=this.excalidrawContainerRef.current,"production"!==c.Vi.TEST&&"production"!==c.Vi.DEVELOPMENT||(this.setState.bind(this),Object.defineProperties(window.h,{state:{configurable:!0,get:function(){return i.state}},setState:{configurable:!0,value:function(){return i.setState.apply(i,arguments)}},app:{configurable:!0,value:this},history:{configurable:!0,value:this.history}})),this.scene.addCallback(this.onSceneUpdated),this.addEventListeners(),this.excalidrawContainerRef.current&&this.focusContainer(),"ResizeObserver"in window&&null!==(t=this.excalidrawContainerRef)&&void 0!==t&&t.current?(this.resizeObserver=new ResizeObserver((function(){var e=i.excalidrawContainerRef.current.getBoundingClientRect(),t=e.width,n=e.height;i.isMobile=t<c.kV||n<c.Yx&&t<c.sS,i.updateDOMRect()})),null===(n=this.resizeObserver)||void 0===n||n.observe(this.excalidrawContainerRef.current)):window.matchMedia&&(r=window.matchMedia("(max-width: ".concat(c.kV,"px), (max-height: ").concat(c.Yx,"px) and (max-width: ").concat(c.sS,"px)")),o=function(){return i.isMobile=r.matches},r.addListener(o),this.detachIsMobileMqHandler=function(){return r.removeListener(o)}),new URLSearchParams(window.location.search.slice(1)).has("web-share-target")?this.restoreFileFromShare():this.updateDOMRect(this.initializeScene);case 9:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"componentWillUnmount",value:function(){var e;this.files={},this.imageCache.clear(),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.unmounted=!0,this.removeEventListeners(),this.scene.destroy(),clearTimeout(dg),dg=0}},{key:"removeEventListeners",value:function(){var e,t,n,r;document.removeEventListener(c.Ks.POINTER_UP,this.removePointer),document.removeEventListener(c.Ks.COPY,this.onCopy),document.removeEventListener(c.Ks.PASTE,this.pasteFromClipboard),document.removeEventListener(c.Ks.CUT,this.onCut),null===(e=this.nearestScrollableContainer)||void 0===e||e.removeEventListener(c.Ks.SCROLL,this.onScroll),document.removeEventListener(c.Ks.KEYDOWN,this.onKeyDown,!1),document.removeEventListener(c.Ks.MOUSE_MOVE,this.updateCurrentCursorPosition,!1),document.removeEventListener(c.Ks.KEYUP,this.onKeyUp),window.removeEventListener(c.Ks.RESIZE,this.onResize,!1),window.removeEventListener(c.Ks.UNLOAD,this.onUnload,!1),window.removeEventListener(c.Ks.BLUR,this.onBlur,!1),null===(t=this.excalidrawContainerRef.current)||void 0===t||t.removeEventListener(c.Ks.DRAG_OVER,this.disableEvent,!1),null===(n=this.excalidrawContainerRef.current)||void 0===n||n.removeEventListener(c.Ks.DROP,this.disableEvent,!1),document.removeEventListener(c.Ks.GESTURE_START,this.onGestureStart,!1),document.removeEventListener(c.Ks.GESTURE_CHANGE,this.onGestureChange,!1),document.removeEventListener(c.Ks.GESTURE_END,this.onGestureEnd,!1),null===(r=this.detachIsMobileMqHandler)||void 0===r||r.call(this)}},{key:"addEventListeners",value:function(){var e,t,n,r;this.removeEventListeners(),document.addEventListener(c.Ks.POINTER_UP,this.removePointer),document.addEventListener(c.Ks.COPY,this.onCopy),this.props.handleKeyboardGlobally&&document.addEventListener(c.Ks.KEYDOWN,this.onKeyDown,!1),document.addEventListener(c.Ks.KEYUP,this.onKeyUp,{passive:!0}),document.addEventListener(c.Ks.MOUSE_MOVE,this.updateCurrentCursorPosition),null===(e=document.fonts)||void 0===e||null===(t=e.addEventListener)||void 0===t||t.call(e,"loadingdone",this.onFontLoaded),document.addEventListener(c.Ks.GESTURE_START,this.onGestureStart,!1),document.addEventListener(c.Ks.GESTURE_CHANGE,this.onGestureChange,!1),document.addEventListener(c.Ks.GESTURE_END,this.onGestureEnd,!1),this.state.viewModeEnabled||(document.addEventListener(c.Ks.PASTE,this.pasteFromClipboard),document.addEventListener(c.Ks.CUT,this.onCut),this.props.detectScroll&&(this.nearestScrollableContainer=function(e){for(var t=e.parentElement;t;){if(t===document.body)return document;var n=window.getComputedStyle(t).overflowY;if(t.scrollHeight>t.clientHeight&&("auto"===n||"scroll"===n))return t;t=t.parentElement}return document}(this.excalidrawContainerRef.current),this.nearestScrollableContainer.addEventListener(c.Ks.SCROLL,this.onScroll)),window.addEventListener(c.Ks.RESIZE,this.onResize,!1),window.addEventListener(c.Ks.UNLOAD,this.onUnload,!1),window.addEventListener(c.Ks.BLUR,this.onBlur,!1),null===(n=this.excalidrawContainerRef.current)||void 0===n||n.addEventListener(c.Ks.DRAG_OVER,this.disableEvent,!1),null===(r=this.excalidrawContainerRef.current)||void 0===r||r.addEventListener(c.Ks.DROP,this.disableEvent,!1))}},{key:"componentDidUpdate",value:function(e,t){var n,r=this;"selection"===t.elementType&&"selection"!==this.state.elementType&&this.state.showHyperlinkPopup&&this.setState({showHyperlinkPopup:!1}),e.langCode!==this.props.langCode&&this.updateLanguage(),e.viewModeEnabled!==this.props.viewModeEnabled&&this.setState({viewModeEnabled:!!this.props.viewModeEnabled}),t.viewModeEnabled!==this.state.viewModeEnabled&&(this.addEventListeners(),this.deselectElements()),e.zenModeEnabled!==this.props.zenModeEnabled&&this.setState({zenModeEnabled:!!this.props.zenModeEnabled}),e.theme!==this.props.theme&&this.props.theme&&this.setState({theme:this.props.theme}),e.gridModeEnabled!==this.props.gridModeEnabled&&this.setState({gridSize:this.props.gridModeEnabled?c.k:null}),this.props.name&&e.name!==this.props.name&&this.setState({name:this.props.name}),null===(n=this.excalidrawContainerRef.current)||void 0===n||n.classList.toggle("theme--dark","dark"===this.state.theme),this.state.editingLinearElement&&!this.state.selectedElementIds[this.state.editingLinearElement.elementId]&&setTimeout((function(){r.actionManager.executeAction(pu)}));var o=t.multiElement;t.elementType!==this.state.elementType&&null!=o&&ca(this.state)&&$e(o)&&ha(o,this.state,this.scene,Sn(aa.getPointAtIndexGlobalCoordinates(o,-1)));var i={},a={},l={},s={},u={};this.state.collaborators.forEach((function(e,t){if(e.selectedElementIds)for(var n=0,o=Object.keys(e.selectedElementIds);n<o.length;n++){var c=o[n];c in l||(l[c]=[]),l[c].push(t)}e.pointer&&(e.username&&(s[t]=e.username),e.userState&&(u[t]=e.userState),a[t]=wn({sceneX:e.pointer.x,sceneY:e.pointer.y},r.state),i[t]=e.button)}));var d=this.scene.getElements().filter((function(e){return!(Ve(e)&&r.state.pendingImageElement&&e.id===r.state.pendingImageElement.id||r.state.editingElement&&"text"===r.state.editingElement.type&&e.id===r.state.editingElement.id)})),f=Nu(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:l,remotePointerUsernames:s,remotePointerUserStates:u,shouldCacheIgnoreZoom:this.state.shouldCacheIgnoreZoom,theme:this.state.theme,imageCache:this.imageCache,isExporting:!1,renderScrollbars:!this.isMobile}),p=f.atLeastOneVisibleElement,h=f.scrollBars;h&&(ug=h);var m,g,v=!Ge(this.state.editingElement)&&!p&&d.length>0;this.state.scrolledOutside!==v&&this.setState({scrolledOutside:v}),this.history.record(this.state,this.scene.getElementsIncludingDeleted()),this.scheduleImageRefresh(),this.state.isLoading||null===(m=(g=this.props).onChange)||void 0===m||m.call(g,this.scene.getElementsIncludingDeleted(),this.state,this.files)}},{key:"addTextFromPaste",value:function(e){var t=xn({clientX:ig,clientY:ag},this.state),n=t.x,r=t.y,o=Ao({x:n,y:r,strokeColor:this.state.currentItemStrokeColor,backgroundColor:this.state.currentItemBackgroundColor,fillStyle:this.state.currentItemFillStyle,strokeWidth:this.state.currentItemStrokeWidth,strokeStyle:this.state.currentItemStrokeStyle,roughness:this.state.currentItemRoughness,opacity:this.state.currentItemOpacity,strokeSharpness:this.state.currentItemStrokeSharpness,text:e,fontSize:this.state.currentItemFontSize,fontFamily:this.state.currentItemFontFamily,textAlign:this.state.currentItemTextAlign,verticalAlign:c.hs});this.scene.replaceAllElements([].concat(A(this.scene.getElementsIncludingDeleted()),[o])),this.setState({selectedElementIds:L({},o.id,!0)}),this.history.resumeRecording()}},{key:"selectShapeTool",value:function(e){var t;lg||vn(this.canvas,e),(t=document.activeElement)instanceof HTMLElement&&t.className.includes("ToolIcon")&&this.focusContainer(),qe(e)||this.setState({suggestedBindings:[]}),"image"===e&&this.onImageAction(),"selection"!==e?this.setState({elementType:e,selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}):this.setState({elementType:e})}},{key:"handleTextWysiwyg",value:function(e,t){var n=this,r=t.isExistingElement,o=void 0!==r&&r,i=function(t,r,o){n.scene.replaceAllElements(A(n.scene.getElementsIncludingDeleted().map((function(n){return n.id===e.id&&Ge(n)?Lo(n,{text:t,isDeleted:o,originalText:r}):n}))))};wc({id:e.id,canvas:this.canvas,getViewportCoords:function(e,t){var r=wn({sceneX:e,sceneY:t},n.state),o=r.x,i=r.y;return[o-n.state.offsetLeft,i-n.state.offsetTop]},onChange:On((function(t){i(t,t,!1),Oc(e)&&ka(e)})),onSubmit:On((function(t){var r=t.text,a=t.viaKeyboard,l=t.originalText,s=!r.trim();if(i(r,l,s),!s&&a){var c=e.containerId?e.containerId:e.id;n.setState((function(e){return{selectedElementIds:$m($m({},e.selectedElementIds),{},L({},c,!0))}}))}s&&La(n.scene.getElements(),[e]),s&&!o||n.history.resumeRecording(),n.setState({draggingElement:null,editingElement:null}),n.state.elementLocked&&vn(n.canvas,n.state.elementType),n.focusContainer()})),element:e,excalidrawContainer:this.excalidrawContainerRef.current,app:this}),this.deselectElements(),i(e.text,e.originalText,!1)}},{key:"deselectElements",value:function(){this.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})}},{key:"getTextElementAtPosition",value:function(e,t){var n=this.getElementAtPosition(e,t,{includeBoundTextElement:!0});return n&&Ge(n)&&!n.isDeleted?n:null}},{key:"getElementAtPosition",value:function(e,t,n){var r=this.getElementsAtPosition(e,t,null==n?void 0:n.includeBoundTextElement);if(r.length>1){if(null!=n&&n.preferSelected)for(var o=r.length-1;o>-1;o--)if(this.state.selectedElementIds[r[o].id])return r[o];var i=r[r.length-1];return bi(i,this.state,e,t)?r[r.length-2]:i}return 1===r.length?r[0]:null}},{key:"getElementsAtPosition",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2]?this.scene.getElements():this.scene.getElements().filter((function(e){return!(Ge(e)&&e.containerId)}));return Is(r,(function(r){return vi(r,n.state,e,t)}))}},{key:"maybeCleanupAfterMissingPointerUp",value:function(e){null!==pg&&pg(e)}},{key:"updateGestureOnPointerDown",value:function(e){hg.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),2===hg.pointers.size&&(hg.lastCenter=ph(hg.pointers),hg.initialScale=this.state.zoom.value,hg.initialDistance=hh(Array.from(hg.pointers.values())))}},{key:"initialPointerDownState",value:function(e){var t=xn(e,this.state),n=Dc(this.scene.getElements(),this.state),r=h(Et(n),4),o=r[0],i=r[1],a=r[2],l=r[3];return{origin:t,withCmdOrCtrl:e[tn.CTRL_OR_CMD],originInGrid:Sn(dt(t.x,t.y,this.state.gridSize)),scrollbars:Pc(ug,e.clientX-this.state.offsetLeft,e.clientY-this.state.offsetTop),lastCoords:$m({},t),originalElements:this.scene.getElements().reduce((function(e,t){return e.set(t.id,Ro(t)),e}),new Map),resize:{handleType:!1,isResizing:!1,offset:{x:0,y:0},arrowDirection:"origin",center:{x:(a+o)/2,y:(l+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}}}},{key:"handleDraggingScrollBar",value:function(e,t){var n=this;if(!t.scrollbars.isOverEither||this.state.multiElement)return!1;cg=!0,t.lastCoords.x=e.clientX,t.lastCoords.y=e.clientY;var r=In((function(e){e.target instanceof HTMLElement&&n.handlePointerMoveOverScrollbars(e,t)})),o=On((function(){cg=!1,vn(n.canvas,n.state.elementType),pg=null,n.setState({cursorButton:"up"}),n.savePointer(e.clientX,e.clientY,"up"),window.removeEventListener(c.Ks.POINTER_MOVE,r),window.removeEventListener(c.Ks.POINTER_UP,o),r.flush()}));return pg=o,window.addEventListener(c.Ks.POINTER_MOVE,r),window.addEventListener(c.Ks.POINTER_UP,o),!0}},{key:"isASelectedElement",value:function(e){return null!=e&&this.state.selectedElementIds[e.id]}},{key:"isHittingCommonBoundingBoxOfSelectedElements",value:function(e,t){if(t.length<2)return!1;var n=10/this.state.zoom.value,r=h(Et(t),4),o=r[0],i=r[1],a=r[2],l=r[3];return e.x>o-n&&e.x<a+n&&e.y>i-n&&e.y<l+n}},{key:"onKeyDownFromPointerDownHandler",value:function(e){var t=this;return On((function(n){t.maybeHandleResize(e,n)||t.maybeDragNewGenericElement(e,n)}))}},{key:"onKeyUpFromPointerDownHandler",value:function(e){var t=this;return On((function(n){n.key===tn.ALT&&n.preventDefault(),t.maybeHandleResize(e,n)||t.maybeDragNewGenericElement(e,n)}))}},{key:"onPointerMoveFromPointerDownHandler",value:function(e){var t=this;return In((function(n){var r,o,i,a,l,s;if(null===e.drag.offset&&(e.drag.offset=Sn((i=Dc(t.scene.getElements(),t.state),a=e.origin.x,l=e.origin.y,s=h(Et(i),2),[a-s[0],l-s[1]]))),n.target instanceof HTMLElement&&!t.handlePointerMoveOverScrollbars(n,e)){var u=xn(n,t.state),d=h(dt(u.x,u.y,t.state.gridSize),2),f=d[0],p=d[1];if(e.drag.hasOccurred||"arrow"!==t.state.elementType&&"line"!==t.state.elementType||!(it(u.x,u.y,e.origin.x,e.origin.y)<c.f)){if(e.resize.isResizing&&(e.lastCoords.x=u.x,e.lastCoords.y=u.y,t.maybeHandleResize(e,n)))return!0;if(t.state.editingLinearElement){var m=aa.handlePointDragging(t.state,(function(e){return t.setState(e)}),u.x,u.y,(function(e,n){t.maybeSuggestBindingsForLinearElementAtCoords(e,n)}));if(m)return e.lastCoords.x=u.x,void(e.lastCoords.y=u.y)}var g=e.hit.allHitElements.some((function(e){return t.isASelectedElement(e)}));if((g||e.hit.hasHitCommonBoundingBoxOfSelectedElements)&&(!t.state.editingLinearElement||!n.shiftKey)&&(!t.state.editingLinearElement||(null===(r=t.state.editingLinearElement)||void 0===r?void 0:r.elementId)!==(null===(o=e.hit.element)||void 0===o?void 0:o.id)||e.hit.hasHitElementInside)){e.drag.hasOccurred=!0;var v=Dc(t.scene.getElements(),t.state);if(v.length>0&&!e.withCmdOrCtrl){var b=h(dt(u.x-e.drag.offset.x,u.y-e.drag.offset.y,t.state.gridSize),2),y=b[0],x=b[1],w=[Math.abs(u.x-e.origin.x),Math.abs(u.y-e.origin.y)],k=w[0],E=w[1],_=n.shiftKey;if(function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,l=arguments.length>7?arguments[7]:void 0,s=h(Et(t),2),c={x:n-s[0],y:r-s[1]};t.forEach((function(n){if(Za(o,i,a,e,n,c),!n.groupIds.length||l.editingGroupId&&!yo(l,n)){var r=kr(n);if(r){var s=cr.getScene(n).getElement(r);Za(o,i,a,e,s,c)}}ka(n,{simultaneouslyUpdated:t})}))}(e,v,y,x,_,k,E,t.state),t.maybeSuggestBindingForAll(v),n.altKey&&!e.hit.hasBeenDuplicated){e.hit.hasBeenDuplicated=!0;var S,C=[],j=[],O=new Map,I=new Map,M=e.hit.element,T=t.scene.getElementsIncludingDeleted(),P=Dc(T,t.state,!0).map((function(e){return e.id})),D=Ym(T);try{for(D.s();!(S=D.n()).done;){var R=S.value;if(P.includes(R.id)||R.id===(null==M?void 0:M.id)&&e.hit.wasAddedToSelection){var z=zo(t.state.editingGroupId,O,R),N=h(dt(e.origin.x-e.drag.offset.x,e.origin.y-e.drag.offset.y,t.state.gridSize),2),H=N[0],B=N[1];ao(z,{x:z.x+(H-y),y:z.y+(B-x)}),C.push(z),j.push(R),I.set(R.id,z.id)}else C.push(R)}}catch(i){D.e(i)}finally{D.f()}var F=[].concat(C,j);dr(C,j,I),Pa(F,j,I,"duplicatesServeAsOld"),t.scene.replaceAllElements(F)}return}}var U=t.state.draggingElement;if(U){if("freedraw"===U.type){var K=U.points,W=u.x-U.x,V=u.y-U.y,G=K.length>0&&K[K.length-1];if(!G||G[0]!==W||G[1]!==V){var Z=U.simulatePressure?U.pressures:[].concat(A(U.pressures),[n.pressure]);ao(U,{points:[].concat(A(K),[[W,V]]),pressures:Z})}}else if(Xe(U)){e.drag.hasOccurred=!0;var Y=U.points,X=f-U.x,q=p-U.y;if(an(n)&&2===Y.length){var $=uo(t.state.elementType,X,q);X=$.width,q=$.height}1===Y.length?ao(U,{points:[].concat(A(Y),[[X,q]])}):Y.length>1&&ao(U,{points:[].concat(A(Y.slice(0,-1)),[[X,q]])}),$e(U)&&t.maybeSuggestBindingsForLinearElementAtCoords(U,[u],t.state.startBoundElement)}else e.lastCoords.x=u.x,e.lastCoords.y=u.y,t.maybeDragNewGenericElement(e,n);if("selection"===t.state.elementType){e.boxSelection.hasOccurred=!0;var Q=t.scene.getElements();if(n.shiftKey||t.state.editingLinearElement||!Ac(Q,t.state)||(e.withCmdOrCtrl&&e.hit.element?t.setState((function(n){return ko($m($m({},n),{},{selectedElementIds:L({},e.hit.element.id,!0)}),t.scene.getElements())})):t.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})),t.state.editingLinearElement)aa.handleBoxSelection(n,t.state,t.setState.bind(t));else{var J=function(e,t){var n=h(gt(t),4),r=n[0],o=n[1],i=n[2],a=n[3];return e.filter((function(e){var t=h(kt(e),4),n=t[0],l=t[1],s=t[2],c=t[3];return"selection"!==e.type&&!tt(e)&&r<=n&&o<=l&&i>=s&&a>=c}))}(Q,U);t.setState((function(n){return ko($m($m({},n),{},{selectedElementIds:$m($m($m({},n.selectedElementIds),J.reduce((function(e,t){return e[t.id]=!0,e}),{})),e.hit.element?L({},e.hit.element.id,!J.length):null),showHyperlinkPopup:!(1!==J.length||!J[0].link)&&"info"}),t.scene.getElements())}))}}}}}}))}},{key:"handlePointerMoveOverScrollbars",value:function(e,t){if(t.scrollbars.isOverHorizontal){var n=e.clientX,r=n-t.lastCoords.x;return this.setState({scrollX:this.state.scrollX-r/this.state.zoom.value}),t.lastCoords.x=n,!0}if(t.scrollbars.isOverVertical){var o=e.clientY,i=o-t.lastCoords.y;return this.setState({scrollY:this.state.scrollY-i/this.state.zoom.value}),t.lastCoords.y=o,!0}return!1}},{key:"onPointerUpFromPointerDownHandler",value:function(e){var t=this;return On((function(n){var r,o,i=t.state,a=i.draggingElement,l=i.resizingElement,s=i.multiElement,u=i.elementType,d=i.elementLocked,f=i.isResizing,p=i.isRotating;if(t.setState({isResizing:!1,isRotating:!1,resizingElement:null,selectionElement:null,cursorButton:"up",editingElement:s||Ge(t.state.editingElement)?t.state.editingElement:null}),t.savePointer(n.clientX,n.clientY,"up"),t.state.editingLinearElement)if(e.boxSelection.hasOccurred||(null===(r=e.hit)||void 0===r||null===(o=r.element)||void 0===o?void 0:o.id)===t.state.editingLinearElement.elementId&&e.hit.hasHitElementInside){var h=aa.handlePointerUp(n,t.state.editingLinearElement,t.state);h!==t.state.editingLinearElement&&t.setState({editingLinearElement:h,suggestedBindings:[]})}else t.actionManager.executeAction(pu);if(pg=null,e.eventListeners.onMove&&e.eventListeners.onMove.flush(),window.removeEventListener(c.Ks.POINTER_MOVE,e.eventListeners.onMove),window.removeEventListener(c.Ks.POINTER_UP,e.eventListeners.onUp),window.removeEventListener(c.Ks.KEYDOWN,e.eventListeners.onKeyDown),window.removeEventListener(c.Ks.KEYUP,e.eventListeners.onKeyUp),t.state.pendingImageElement&&t.setState({pendingImageElement:null}),"freedraw"===(null==a?void 0:a.type)){var m=xn(n,t.state),g=a.points,v=m.x-a.x,b=m.y-a.y;v===g[0][0]&&b===g[0][1]&&(b+=1e-4,v+=1e-4);var y=a.simulatePressure?[]:[].concat(A(a.pressures),[n.pressure]);return ao(a,{points:[].concat(A(g),[[v,b]]),pressures:y,lastCommittedPoint:[v,b]}),void t.actionManager.executeAction(pu)}if(Ve(a)){var x=a;try{t.initializeImageDimensions(x),t.setState({selectedElementIds:L({},x.id,!0)},(function(){t.actionManager.executeAction(pu)}))}catch(_){console.error(_),t.scene.replaceAllElements(t.scene.getElementsIncludingDeleted().filter((function(e){return e.id!==x.id}))),t.actionManager.executeAction(pu)}}else if(Xe(a)){a.points.length>1&&t.history.resumeRecording();var w=xn(n,t.state);e.drag.hasOccurred||!a||s?e.drag.hasOccurred&&!s&&(ca(t.state)&&$e(a)&&ha(a,t.state,t.scene,w),t.setState({suggestedBindings:[],startBoundElement:null}),d?t.setState((function(e){return{draggingElement:null,selectedElementIds:$m($m({},e.selectedElementIds),{},L({},t.state.draggingElement.id,!0))}})):(mn(t.canvas),t.setState((function(e){return{draggingElement:null,elementType:"selection",selectedElementIds:$m($m({},e.selectedElementIds),{},L({},t.state.draggingElement.id,!0))}})))):(ao(a,{points:[].concat(A(a.points),[[w.x-a.x,w.y-a.y]])}),t.setState({multiElement:a,editingElement:t.state.draggingElement}))}else{if("selection"!==u&&a&&co(a))return t.scene.replaceAllElements(t.scene.getElementsIncludingDeleted().slice(0,-1)),void t.setState({draggingElement:null});a&&ao(a,fo(a)),l&&t.history.resumeRecording(),l&&co(l)&&t.scene.replaceAllElements(t.scene.getElementsIncludingDeleted().filter((function(e){return e.id!==l.id})));var k=e.hit.element;if(k&&!e.drag.hasOccurred&&!e.hit.wasAddedToSelection&&(!t.state.editingLinearElement||!e.boxSelection.hasOccurred))if(n.shiftKey&&!t.state.editingLinearElement)if(t.state.selectedElementIds[k.id])if(yo(t.state,k)){var E=k.groupIds.flatMap((function(e){return _o(t.scene.getElements(),e)})).map((function(e){return L({},e.id,!1)})).reduce((function(e,t){return $m($m({},e),t)}),{});t.setState((function(e){return{selectedGroupIds:$m($m({},e.selectedElementIds),k.groupIds.map((function(e){return L({},e,!1)})).reduce((function(e,t){return $m($m({},e),t)}),{})),selectedElementIds:$m($m({},e.selectedElementIds),E)}}))}else t.setState((function(e){return ko($m($m({},e),{},{selectedElementIds:$m($m({},e.selectedElementIds),{},L({},k.id,!1))}),t.scene.getElements())}));else t.setState((function(e){return{selectedElementIds:$m($m({},e.selectedElementIds),{},L({},k.id,!0))}}));else t.setState((function(e){return $m({},ko($m($m({},e),{},{selectedElementIds:L({},k.id,!0)}),t.scene.getElements()))}));t.state.editingLinearElement||e.drag.hasOccurred||t.state.isResizing||!(k&&bi(k,t.state,e.origin.x,e.origin.y)||!k&&e.hit.hasHitCommonBoundingBoxOfSelectedElements)?(!d&&"freedraw"!==u&&a&&t.setState((function(e){return{selectedElementIds:$m($m({},e.selectedElementIds),{},L({},a.id,!0))}})),("selection"!==u||Ac(t.scene.getElements(),t.state))&&t.history.resumeRecording(),(e.drag.hasOccurred||f||p)&&(ca(t.state)?fa:ba)(Dc(t.scene.getElements(),t.state)),d||"freedraw"===u?t.setState({draggingElement:null,suggestedBindings:[]}):(mn(t.canvas),t.setState({draggingElement:null,suggestedBindings:[],elementType:"selection"}))):t.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})}}))}},{key:"maybeSuggestBindingForAll",value:function(e){var t,n,r=(t=e,n=new Set(t.map((function(e){return e.id}))),t.flatMap((function(e){return $e(e)?ja(e).filter((function(e){return!n.has(e.id)})):Je(e)?Ma(e).filter((function(e){return!n.has(e[0].id)})):[]})));this.setState({suggestedBindings:r})}},{key:"clearSelection",value:function(e){this.setState((function(t){return{selectedElementIds:{},selectedGroupIds:{},editingGroupId:t.editingGroupId&&null!=e&&Eo(e,t.editingGroupId)?t.editingGroupId:null}})),this.setState({selectedElementIds:{},previousSelectedElementIds:this.state.selectedElementIds})}},{key:"getTextWysiwygSnappedToCenterPosition",value:function(e,t,n,r,o){var i=Ms(this.scene.getElementsIncludingDeleted().filter((function(e){return!Ge(e)})),e,t);if(i){var a=i.x+i.width/2,l=i.y+i.height/2;if(Math.hypot(e-a,t-l)<c.wZ){var s=wn({sceneX:a,sceneY:l},n);return{viewportX:s.x,viewportY:s.y,elementCenterX:a,elementCenterY:l}}}}},{key:"getCanvasOffsets",value:function(){var e;if(null!==(e=this.excalidrawContainerRef)&&void 0!==e&&e.current){var t=this.excalidrawContainerRef.current.getBoundingClientRect();return{offsetLeft:t.left,offsetTop:t.top}}return{offsetLeft:0,offsetTop:0}}},{key:"updateLanguage",value:(t=(0,d.Z)(g().mark((function e(){var t,n=this;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=x.find((function(e){return e.code===n.props.langCode}))||y,e.next=3,S(t);case 3:this.setAppState({});case 4:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}],[{key:"resetTapTwice",value:function(){rg=!1}}]),o}(s().Component);mg.defaultProps={UIOptions:c.cW};var gg=function(){var e,t=this;this.canvas=null,this.rc=null,this.unmounted=!1,this.isMobile=!1,this.excalidrawContainerRef=s().createRef(),this.files={},this.imageCache=new Map,this.lastPointerDown=null,this.lastPointerUp=null,this.contextMenuOpen=!1,this.focusContainer=function(){var e;t.props.autoFocus&&(null===(e=t.excalidrawContainerRef.current)||void 0===e||e.focus())},this.getSceneElementsIncludingDeleted=function(){return t.scene.getElementsIncludingDeleted()},this.getSceneElements=function(){return t.scene.getElements()},this.syncActionResult=On((function(e){if(t.contextMenuOpen=!1,!t.unmounted&&!1!==e){var n=null;if(e.elements&&(e.elements.forEach((function(e){var r;(null===(r=t.state.editingElement)||void 0===r?void 0:r.id)===e.id&&t.state.editingElement!==e&&Oc(e)&&(n=e)})),t.scene.replaceAllElements(e.elements),e.commitToHistory&&t.history.resumeRecording()),e.files&&(t.files=e.replaceFiles?e.files:$m($m({},t.files),e.files),t.addNewImagesToImageCache()),e.appState||n){var r,o,i,a,l,s;e.commitToHistory&&t.history.resumeRecording();var u=(null==e||null===(r=e.appState)||void 0===r?void 0:r.viewModeEnabled)||!1,d=(null==e||null===(o=e.appState)||void 0===o?void 0:o.zenModeEnabled)||!1,f=(null==e||null===(i=e.appState)||void 0===i?void 0:i.gridSize)||null,p=(null==e||null===(a=e.appState)||void 0===a?void 0:a.theme)||c.C6.LIGHT,h=null!==(l=null==e||null===(s=e.appState)||void 0===s?void 0:s.name)&&void 0!==l?l:t.state.name;void 0!==t.props.viewModeEnabled&&(u=t.props.viewModeEnabled),void 0!==t.props.zenModeEnabled&&(d=t.props.zenModeEnabled),void 0!==t.props.gridModeEnabled&&(f=t.props.gridModeEnabled?c.k:null),void 0!==t.props.theme&&(p=t.props.theme),void 0!==t.props.name&&(h=t.props.name),t.setState((function(t){var r;return Object.assign(e.appState||{},{editingElement:n||(null===(r=e.appState)||void 0===r?void 0:r.editingElement)||null,viewModeEnabled:u,zenModeEnabled:d,gridSize:f,theme:p,name:h})}),(function(){e.syncHistory&&t.history.setCurrentState(t.state,t.scene.getElementsIncludingDeleted())}))}}})),this.onBlur=On((function(){lg=!1,t.setState({isBindingEnabled:!0})})),this.onUnload=function(){t.onBlur()},this.disableEvent=function(e){e.preventDefault()},this.onFontLoaded=function(){t.scene.getElementsIncludingDeleted().forEach((function(e){Ge(e)&&Fr(e)})),t.onSceneUpdated()},this.importLibraryFromUrl=(e=(0,d.Z)(g().mark((function e(n,r){var o,i,a,l,s;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return window.location.hash.includes(c.ah.addLibrary)?((o=new URLSearchParams(window.location.hash.slice(1))).delete(c.ah.addLibrary),window.history.replaceState({},c.iC,"#".concat(o.toString()))):window.location.search.includes(c.UO.addLibrary)&&((i=new URLSearchParams(window.location.search)).delete(c.UO.addLibrary),window.history.replaceState({},c.iC,"?".concat(i.toString()))),e.prev=1,e.next=4,fetch(decodeURIComponent(n));case 4:return a=e.sent,e.next=7,a.blob();case 7:return l=e.sent,e.t0=JSON,e.next=11,l.text();case 11:if(e.t1=e.sent,s=e.t0.parse.call(e.t0,e.t1),Jd(s)){e.next=15;break}throw new Error;case 15:if(r!==t.id&&!window.confirm(O("alerts.confirmAddLibrary",{numShapes:(s.libraryItems||s.library||[]).length}))){e.next=20;break}return e.next=18,t.library.importLibrary(l,"published");case 18:t.state.isLibraryOpen&&t.setState({isLibraryOpen:!1}),t.setState({isLibraryOpen:!0});case 20:e.next=26;break;case 22:e.prev=22,e.t2=e.catch(1),window.alert(O("alerts.errorLoadingLibrary")),console.error(e.t2);case 26:return e.prev=26,t.focusContainer(),e.finish(26);case 29:case"end":return e.stop()}}),e,null,[[1,22,26,29]])}))),function(t,n){return e.apply(this,arguments)}),this.resetHistory=function(){t.history.clear()},this.resetScene=On((function(e){t.scene.replaceAllElements([]),t.setState((function(n){return $m($m({},zn()),{},{isLoading:(null==e||!e.resetLoadingState)&&n.isLoading,theme:t.state.theme})})),t.resetHistory()})),this.initializeScene=(0,d.Z)(g().mark((function e(){var n,r,o,i,a;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"launchQueue"in window&&"LaunchParams"in window&&window.launchQueue.setConsumer(function(){var e=(0,d.Z)(g().mark((function e(n){var r,o;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.files.length){e.next=2;break}return e.abrupt("return");case 2:return r=n.files[0],e.next=5,r.getFile();case 5:(o=e.sent).handle=r,Nd(o,t.state,t.scene.getElementsIncludingDeleted()).then((function(e){t.syncActionResult($m($m({},e),{},{appState:$m($m({},e.appState||t.state),{},{isLoading:!1}),commitToHistory:!0}))})).catch((function(e){t.setState({isLoading:!1,errorMessage:e.message})}));case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),t.state.isLoading||t.setState({isLoading:!0}),r=null,e.prev=3,e.next=6,t.props.initialData;case 6:if(e.t0=e.sent,e.t0){e.next=9;break}e.t0=null;case 9:r=e.t0,null!==(o=r)&&void 0!==o&&o.libraryItems&&(t.libraryItemsFromStorage=Td(r.libraryItems,"unpublished")),e.next=17;break;case 13:e.prev=13,e.t1=e.catch(3),console.error(e.t1),r={appState:{errorMessage:e.t1.message||"Encountered an error during importing or restoring scene data"}};case 17:if((i=Md(r,null,null)).appState=$m($m({},i.appState),{},{elementType:"image"===i.appState.elementType?"selection":i.appState.elementType,isLoading:!1}),null!==(n=r)&&void 0!==n&&n.scrollToContent&&(i.appState=$m($m({},i.appState),$s(i.elements,$m($m({},i.appState),{},{width:t.state.width,height:t.state.height,offsetTop:t.state.offsetTop,offsetLeft:t.state.offsetLeft})))),t.resetHistory(),t.syncActionResult($m($m({},i),{},{commitToHistory:!0})),!(a=new URLSearchParams(window.location.hash.slice(1)).get(c.ah.addLibrary)||new URLSearchParams(window.location.search).get(c.UO.addLibrary))){e.next=26;break}return e.next=26,t.importLibraryFromUrl(a);case 26:case"end":return e.stop()}}),e,null,[[3,13]])}))),this.onResize=On((function(){t.scene.getElementsIncludingDeleted().forEach((function(e){return Fr(e)})),t.setState({})})),this.onScroll=fn((function(){var e=t.getCanvasOffsets(),n=e.offsetTop,r=e.offsetLeft;t.setState((function(e){return e.offsetLeft===r&&e.offsetTop===n?null:{offsetTop:n,offsetLeft:r}}))}),c.HM),this.onCut=On((function(e){var n;(null===(n=t.excalidrawContainerRef.current)||void 0===n?void 0:n.contains(document.activeElement))&&!cn(e.target)&&(t.cutAll(),e.preventDefault())})),this.onCopy=On((function(e){var n;(null===(n=t.excalidrawContainerRef.current)||void 0===n?void 0:n.contains(document.activeElement))&&!cn(e.target)&&(t.copyAll(),e.preventDefault())})),this.cutAll=function(){t.copyAll(),t.actionManager.executeAction(Bc)},this.copyAll=function(){Df(t.scene.getElements(),t.state,t.files)},this.onTapStart=function(e){if(At||e.preventDefault(),!rg)return rg=!0,clearTimeout(og),void(og=window.setTimeout(mg.resetTapTwice,c.Gj));if(rg&&1===e.touches.length){var n=h(e.touches,1)[0];t.handleCanvasDoubleClick({clientX:n.clientX,clientY:n.clientY}),rg=!1,clearTimeout(og)}At&&e.preventDefault(),2===e.touches.length&&t.setState({selectedElementIds:{}})},this.onTapEnd=function(e){t.resetContextMenuTimer(),e.touches.length>0?t.setState({previousSelectedElementIds:{},selectedElementIds:t.state.previousSelectedElementIds}):hg.pointers.clear()},this.pasteFromClipboard=On(function(){var e=(0,d.Z)(g().mark((function e(n){var r,o,i,a,l,s,c,u,d,f,p;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=document.activeElement,null===(r=t.excalidrawContainerRef.current)||void 0===r?void 0:r.contains(i)){e.next=4;break}return e.abrupt("return");case 4:if(a=document.elementFromPoint(ig,ag),!n||a instanceof HTMLCanvasElement&&!cn(i)){e.next=7;break}return e.abrupt("return");case 7:return l=null==n||null===(o=n.clipboardData)||void 0===o?void 0:o.files[0],e.next=10,Hf(n);case 10:if(s=e.sent,!l&&s.text&&(c=s.text.trim()).startsWith("<svg")&&c.endsWith("</svg>")&&(l=Vd(c)),!zd(l)||s.spreadsheet){e.next=19;break}return u=xn({clientX:ig,clientY:ag},t.state),d=u.x,f=u.y,p=t.createImageElement({sceneX:d,sceneY:f}),t.insertImageElement(p,l),t.initializeImageDimensions(p),t.setState({selectedElementIds:L({},p.id,!0)}),e.abrupt("return");case 19:if(!t.props.onPaste){e.next=31;break}return e.prev=20,e.next=23,t.props.onPaste(s,n);case 23:if(e.t0=e.sent,!1!==e.t0){e.next=26;break}return e.abrupt("return");case 26:e.next=31;break;case 28:e.prev=28,e.t1=e.catch(20),console.error(e.t1);case 31:s.errorMessage?t.setState({errorMessage:s.errorMessage}):s.spreadsheet?t.setState({pasteDialog:{data:s.spreadsheet,shown:!0}}):s.elements?t.addElementsFromPasteOrLibrary({elements:s.elements,files:s.files||null,position:"cursor"}):s.text&&t.addTextFromPaste(s.text),t.selectShapeTool("selection"),null==n||n.preventDefault();case 34:case"end":return e.stop()}}),e,null,[[20,28]])})));return function(t){return e.apply(this,arguments)}}()),this.addElementsFromPasteOrLibrary=function(e){var n=Od(e.elements,null),r=h(Et(n),4),o=r[0],i=r[1],a=r[2],l=r[3],s=hn(o,a)/2,c=hn(i,l)/2,u="object"===P(e.position)?e.position.clientX:"cursor"===e.position?ig:t.state.width/2+t.state.offsetLeft,d="object"===P(e.position)?e.position.clientY:"cursor"===e.position?ag:t.state.height/2+t.state.offsetTop,f=xn({clientX:u,clientY:d},t.state),p=f.x-s,m=f.y-c,g=new Map,v=h(dt(p,m,t.state.gridSize),2),b=v[0],y=v[1],x=new Map,w=n.map((function(e){var n=zo(t.state.editingGroupId,g,e,{x:e.x+b-o,y:e.y+y-i});return x.set(e.id,n.id),n}));dr(w,n,x);var k=[].concat(A(t.scene.getElementsIncludingDeleted()),A(w));Pa(k,n,x),e.files&&(t.files=$m($m({},t.files),e.files)),t.scene.replaceAllElements(k),t.history.resumeRecording(),t.setState(ko($m($m({},t.state),{},{isLibraryOpen:!1,selectedElementIds:w.reduce((function(e,t){return tt(t)||(e[t.id]=!0),e}),{}),selectedGroupIds:{}}),t.scene.getElements()),(function(){e.files&&t.addNewImagesToImageCache()})),t.selectShapeTool("selection")},this.setAppState=function(e){t.setState(e)},this.removePointer=function(e){dg&&t.resetContextMenuTimer(),hg.pointers.delete(e.pointerId)},this.toggleLock=function(){t.setState((function(e){return{elementLocked:!e.elementLocked,elementType:e.elementLocked?"selection":e.elementType}}))},this.togglePenMode=function(){t.setState((function(e){return{penMode:!e.penMode}}))},this.toggleZenMode=function(){t.actionManager.executeAction(Qp)},this.toggleStats=function(){t.state.showStats||hu("dialog","stats"),t.actionManager.executeAction(th)},this.scrollToContent=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.scene.getElements();t.setState($m({},$s(Array.isArray(e)?e:[e],t.state,t.canvas)))},this.clearToast=function(){t.setState({toastMessage:null})},this.setToastMessage=function(e){t.setState({toastMessage:e})},this.restoreFileFromShare=(0,d.Z)(g().mark((function e(){var n,r,o;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,caches.open("web-share-target");case 3:return n=e.sent,e.next=6,n.match("shared-file");case 6:if(!(r=e.sent)){e.next=15;break}return e.next=10,r.blob();case 10:return o=e.sent,t.loadFileToCanvas(o),e.next=14,n.delete("shared-file");case 14:window.history.replaceState(null,c.iC,window.location.pathname);case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(0),t.setState({errorMessage:e.t0.message});case 20:case"end":return e.stop()}}),e,null,[[0,17]])}))),this.addFiles=On((function(e){var n=e.reduce((function(e,t){return e.set(t.id,t),e}),new Map);t.files=$m($m({},t.files),Object.fromEntries(n)),t.scene.getElements().forEach((function(e){We(e)&&n.has(e.fileId)&&(t.imageCache.delete(e.fileId),Fr(e))})),t.scene.informMutation(),t.addNewImagesToImageCache()})),this.updateScene=On((function(e){e.commitToHistory&&t.history.resumeRecording(),e.appState&&t.setState(e.appState),e.elements&&t.scene.replaceAllElements(e.elements),e.collaborators&&t.setState({collaborators:e.collaborators}),e.libraryItems&&t.library.saveLibrary(Td(e.libraryItems,"unpublished"))})),this.onSceneUpdated=function(){t.setState({})},this.updateCurrentCursorPosition=On((function(e){ig=e.clientX,ag=e.clientY})),this.onKeyDown=On((function(e){var n,r,o;if("Proxy"in window&&(!e.shiftKey&&/^[A-Z]$/.test(e.key)||e.shiftKey&&/^[a-z]$/.test(e.key))&&(e=new Proxy(e,{get:function(t,n){var r=t[n];return"function"==typeof r?r.bind(t):"key"===n?e.shiftKey?t.key.toUpperCase():t.key.toLowerCase():r}})),!(cn(e.target)&&e.key!==tn.ESCAPE||nn(e.key)&&(n=e.target,n instanceof HTMLElement&&"wysiwyg"===n.dataset.type||n instanceof HTMLBRElement||n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement)||(e.key===tn.QUESTION_MARK&&t.setState({showHelpDialog:!0}),t.actionManager.handleKeyDown(e)||t.state.viewModeEnabled))){if(e[tn.CTRL_OR_CMD]&&t.state.isBindingEnabled&&t.setState({isBindingEnabled:!1}),e.code===Wt&&t.setState({isLibraryOpen:!t.state.isLibraryOpen}),nn(e.key)){var i=t.state.gridSize&&(e.shiftKey?c.$e:t.state.gridSize)||(e.shiftKey?c.Iw:c.$e),a=Dc(t.scene.getElements(),t.state,!0),l=0,s=0;e.key===tn.ARROW_LEFT?l=-i:e.key===tn.ARROW_RIGHT?l=i:e.key===tn.ARROW_UP?s=-i:e.key===tn.ARROW_DOWN&&(s=i),a.forEach((function(e){ao(e,{x:e.x+l,y:e.y+s}),ka(e,{simultaneouslyUpdated:a})})),t.maybeSuggestBindingForAll(a),e.preventDefault()}else if(e.key===tn.ENTER){var u=Dc(t.scene.getElements(),t.state);if(1===u.length&&Xe(u[0]))t.state.editingLinearElement&&t.state.editingLinearElement.elementId===u[0].id||(t.history.resumeRecording(),t.setState({editingLinearElement:new aa(u[0],t.scene)}));else if(1===u.length&&!Xe(u[0])){var d=u[0];return t.startTextEditing({sceneX:d.x+d.width/2,sceneY:d.y+d.height/2,shouldBind:!0}),void e.preventDefault()}}else if(!e.ctrlKey&&!e.altKey&&!e.metaKey&&null===t.state.draggingElement){var f=(r=e.key,(null==(o=xh.find((function(e,t){return r===(t+1).toString()||e.key&&("string"==typeof e.key?e.key===r:e.key.includes(r))})))?void 0:o.value)||null);f?t.selectShapeTool(f):e.key===tn.Q&&t.toggleLock()}if(e.key===tn.SPACE&&0===hg.pointers.size&&(lg=!0,gn(t.canvas,c.oc.GRABBING),e.preventDefault()),e.key===tn.G||e.key===tn.S){var p=Dc(t.scene.getElements(),t.state);if("selection"===t.state.elementType&&!p.length)return;e.key===tn.G&&(ws(t.state.elementType)||p.some((function(e){return ws(e.type)})))&&t.setState({openPopup:"backgroundColorPicker"}),e.key===tn.S&&t.setState({openPopup:"strokeColorPicker"})}}})),this.onKeyUp=On((function(e){if(e.key===tn.SPACE&&(t.state.viewModeEnabled?gn(t.canvas,c.oc.GRAB):"selection"===t.state.elementType?mn(t.canvas):(vn(t.canvas,t.state.elementType),t.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})),lg=!1),e[tn.CTRL_OR_CMD]||t.state.isBindingEnabled||t.setState({isBindingEnabled:!0}),nn(e.key)){var n=Dc(t.scene.getElements(),t.state);ca(t.state)?fa(n):ba(n),t.setState({suggestedBindings:[]})}})),this.onGestureStart=On((function(e){e.preventDefault(),t.setState({selectedElementIds:{}}),hg.initialScale=t.state.zoom.value})),this.onGestureChange=On((function(e){if(e.preventDefault(),!(hg.pointers.size>=2)){var n=hg.initialScale;n&&t.setState((function(t){return $m({},Js({viewportX:ig,viewportY:ag,nextZoom:Qs(n*e.scale)},t))}))}})),this.onGestureEnd=On((function(e){e.preventDefault(),t.setState({previousSelectedElementIds:{},selectedElementIds:t.state.previousSelectedElementIds}),hg.initialScale=null})),this.startTextEditing=function(e){var n,r,o,i=e.sceneX,a=e.sceneY,l=e.shouldBind,s=e.insertAtParentCenter,u=(void 0===s||s)&&t.getTextWysiwygSnappedToCenterPosition(i,a,t.state,t.canvas,window.devicePixelRatio),d=l||u?Ms(t.scene.getElements().filter((function(e){return!Ge(e)})),i,a):null,f=t.getTextElementAtPosition(i,a);if(d){var p=kr(d);p&&(f=t.scene.getElement(p))}if(!f&&d){var h={fontSize:t.state.currentItemFontSize,fontFamily:t.state.currentItemFontFamily},m=xr(dn(h)),g=(o=dn(h),gr(o)+2*c.gK),v=Math.max(d.height,g),b=Math.max(d.width,m);ao(d,{height:v,width:b}),i=d.x+b/2,a=d.y+v/2,u&&(u=t.getTextWysiwygSnappedToCenterPosition(i,a,t.state,t.canvas,window.devicePixelRatio))}var y=f||Ao({x:u?u.elementCenterX:i,y:u?u.elementCenterY:a,strokeColor:t.state.currentItemStrokeColor,backgroundColor:t.state.currentItemBackgroundColor,fillStyle:t.state.currentItemFillStyle,strokeWidth:t.state.currentItemStrokeWidth,strokeStyle:t.state.currentItemStrokeStyle,roughness:t.state.currentItemRoughness,opacity:t.state.currentItemOpacity,strokeSharpness:t.state.currentItemStrokeSharpness,text:"",fontSize:t.state.currentItemFontSize,fontFamily:t.state.currentItemFontFamily,textAlign:u?"center":t.state.currentItemTextAlign,verticalAlign:u?"middle":c.hs,containerId:null!==(n=null==d?void 0:d.id)&&void 0!==n?n:void 0,groupIds:null!==(r=null==d?void 0:d.groupIds)&&void 0!==r?r:[]});t.setState({editingElement:y}),f?u&&"center"===y.textAlign||ao(y,{verticalAlign:c.hs}):(t.scene.replaceAllElements([].concat(A(t.scene.getElementsIncludingDeleted()),[y])),u||ao(y,{y:y.y-y.baseline/2})),t.setState({editingElement:y}),t.handleTextWysiwyg(y,{isExistingElement:!!f})},this.handleCanvasDoubleClick=function(e){if(!t.state.multiElement&&"selection"===t.state.elementType){var n=Dc(t.scene.getElements(),t.state);if(1===n.length&&Xe(n[0]))t.state.editingLinearElement&&t.state.editingLinearElement.elementId===n[0].id||(t.history.resumeRecording(),t.setState({editingLinearElement:new aa(n[0],t.scene)}));else{mn(t.canvas);var r=xn(e,t.state),o=r.x,i=r.y;if(wo(t.state).length>0){var a=t.getElementAtPosition(o,i),l=a&&(u=a,d=t.state.selectedGroupIds,u.groupIds.find((function(e){return d[e]})));if(l)return void t.setState((function(e){return ko($m($m({},e),{},{editingGroupId:l,selectedElementIds:L({},a.id,!0),selectedGroupIds:{}}),t.scene.getElements())}))}if(mn(t.canvas),!e[tn.CTRL_OR_CMD]&&!t.state.viewModeEnabled){var s=Dc(t.scene.getElements(),t.state);if(1===s.length){var c=s[0];et(c)&&(o=c.x+c.width/2,i=c.y+c.height/2)}t.startTextEditing({sceneX:o,sceneY:i,shouldBind:!1,insertAtParentCenter:!e.altKey})}}}var u,d},this.getElementLinkAtPosition=function(e,n){var r=t.scene.getElements().slice().reverse(),o=1/0;return r.find((function(r,i){return n&&r.id===n.id&&(o=i),r.link&&Ou(r,t.state,[e.x,e.y],t.isMobile)&&i<=o}))},this.redirectToLink=function(e,n){var r=it(t.lastPointerDown.clientX,t.lastPointerDown.clientY,t.lastPointerUp.clientX,t.lastPointerUp.clientY);if(!(!t.hitLinkElement||n&&r>c.f||!n&&0!==r)){var o=xn(t.lastPointerDown,t.state),i=Ou(t.hitLinkElement,t.state,[o.x,o.y],t.isMobile),a=xn(t.lastPointerUp,t.state),l=Ou(t.hitLinkElement,t.state,[a.x,a.y],t.isMobile);if(i&&l){var s,u,d=t.hitLinkElement.link;if(d&&(t.props.onLinkOpen&&(u=An(c.Ks.EXCALIDRAW_LINK,e.nativeEvent),t.props.onLinkOpen(t.hitLinkElement,u)),null===(s=u)||void 0===s||!s.defaultPrevented)){var f=_u(d)?"_self":"_blank",p=window.open(void 0,f);p&&(p.opener=null,p.location=Eu(d))}}}},this.handleCanvasPointerMove=function(e){t.savePointer(e.clientX,e.clientY,t.state.cursorButton),hg.pointers.has(e.pointerId)&&hg.pointers.set(e.pointerId,{x:e.clientX,y:e.clientY});var n,r,o=hg.initialScale;if(2===hg.pointers.size&&hg.lastCenter&&o&&hg.initialDistance){var i=ph(hg.pointers),a=i.x-hg.lastCenter.x,l=i.y-hg.lastCenter.y;hg.lastCenter=i;var s=hh(Array.from(hg.pointers.values())),u="freedraw"===t.state.elementType&&t.state.penMode?1:s/hg.initialDistance,d=u?Qs(o*u):t.state.zoom.value;t.setState((function(e){var t=Js({viewportX:i.x,viewportY:i.y,nextZoom:d},e);return{zoom:t.zoom,scrollX:t.scrollX+a/d,scrollY:t.scrollY+l/d,shouldCacheIgnoreZoom:!0}})),t.resetShouldCacheIgnoreZoomDebounced()}else hg.lastCenter=hg.initialDistance=hg.initialScale=null;if(!(lg||sg||cg)){var f=Pc(ug,e.clientX-t.state.offsetLeft,e.clientY-t.state.offsetTop).isOverEither;t.state.draggingElement||t.state.multiElement||(f?mn(t.canvas):vn(t.canvas,t.state.elementType));var p=xn(e,t.state),h=p.x,m=p.y;if(t.state.editingLinearElement&&!t.state.editingLinearElement.isDragging){var g=aa.handlePointerMove(e,h,m,t.state.editingLinearElement,t.state.gridSize);g!==t.state.editingLinearElement&&t.setState({editingLinearElement:g}),null!=g.lastUncommittedPoint?t.maybeSuggestBindingAtCursor(p):t.setState({suggestedBindings:[]})}if(Qe(t.state.elementType)){var v=t.state.draggingElement;$e(v)?t.maybeSuggestBindingsForLinearElementAtCoords(v,[p],t.state.startBoundElement):t.maybeSuggestBindingAtCursor(p)}if(t.state.multiElement){var b=t.state.multiElement,y=b.x,x=b.y,w=b.points,k=b.lastCommittedPoint,E=w[w.length-1];return vn(t.canvas,t.state.elementType),void(E===k?it(h-y,m-x,E[0],E[1])>=c.qx?ao(b,{points:[].concat(A(w),[[h-y,m-x]])}):gn(t.canvas,c.oc.POINTER):w.length>2&&k&&it(h-y,m-x,k[0],k[1])<c.qx?(gn(t.canvas,c.oc.POINTER),ao(b,{points:w.slice(0,-1)})):(at(w,t.state.zoom.value)&&gn(t.canvas,c.oc.POINTER),ao(b,{points:[].concat(A(w.slice(0,-1)),[[h-y,m-x]])})))}if(!(Boolean(e.buttons)||"selection"!==t.state.elementType&&"text"!==t.state.elementType)){var _=t.scene.getElements(),S=Dc(_,t.state);if(1!==S.length||f||t.state.editingLinearElement){if(S.length>1&&!f){var C=Ji(Et(S),h,m,t.state.zoom,e.pointerType);if(C)return void gn(t.canvas,ta({transformHandleType:C}))}}else{var j=Qi(_,t.state,h,m,t.state.zoom,e.pointerType);if(j&&j.transformHandleType)return void gn(t.canvas,ta(j))}var O=t.getElementAtPosition(p.x,p.y);if(t.hitLinkElement=t.getElementLinkAtPosition(p,O),t.hitLinkElement&&!t.state.selectedElementIds[t.hitLinkElement.id])gn(t.canvas,c.oc.POINTER),n=t.hitLinkElement,r=t.state,Iu&&clearTimeout(Iu),Iu=window.setTimeout((function(){return Mu(n,r)}),c.sA);else if(Iu&&clearTimeout(Iu),xu&&(xu=!1,ec().classList.remove("excalidraw-tooltip--visible")),O&&O.link&&t.state.selectedElementIds[O.id]&&!t.contextMenuOpen&&!t.state.showHyperlinkPopup&&t.setState({showHyperlinkPopup:"info"}),"text"===t.state.elementType)gn(t.canvas,Ge(O)?c.oc.TEXT:c.oc.CROSSHAIR);else if(t.state.viewModeEnabled)gn(t.canvas,c.oc.GRAB);else if(f)gn(t.canvas,c.oc.AUTO);else if(t.state.editingLinearElement){var I=aa.getElement(t.state.editingLinearElement.elementId);I&&yi(I,t.state,[p.x,p.y])?gn(t.canvas,c.oc.MOVE):gn(t.canvas,c.oc.AUTO)}else e[tn.CTRL_OR_CMD]||!O&&!t.isHittingCommonBoundingBoxOfSelectedElements(p,S)?gn(t.canvas,c.oc.AUTO):gn(t.canvas,c.oc.MOVE)}}},this.handleTouchMove=function(e){fg=!0},this.handleCanvasPointerDown=function(e){var n=document.getSelection();if(null!=n&&n.anchorNode&&n.removeAllRanges(),t.maybeOpenContextMenuAfterPointerDownOnTouchDevices(e),t.maybeCleanupAfterMissingPointerUp(e),t.state.penDetected||"pen"!==e.pointerType||t.setState((function(e){return{penMode:!0,penDetected:!0}})),!sg&&(t.lastPointerDown=e,t.setState({lastPointerDownWith:e.pointerType,cursorButton:"down"}),t.savePointer(e.clientX,e.clientY,"down"),!t.handleCanvasPanUsingWheelOrSpaceDrag(e)&&!(e.button!==c.Oh.MAIN&&e.button!==c.Oh.TOUCH||(t.updateGestureOnPointerDown(e),hg.pointers.size>1)))){var r=t.initialPointerDownState(e);if(!(t.handleDraggingScrollBar(e,r)||(t.contextMenuOpen=!1,t.clearSelectionIfNotUsingSelection(),t.updateBindingEnabledOnPointerMove(e),t.handleSelectionOnPointerDown(e,r)||t.state.penMode&&"touch"===e.pointerType&&"selection"!==t.state.elementType&&"text"!==t.state.elementType&&"image"!==t.state.elementType)))if("text"!==t.state.elementType){if("arrow"===t.state.elementType||"line"===t.state.elementType)t.handleLinearElementOnPointerDown(e,t.state.elementType,r);else if("image"===t.state.elementType){if(gn(t.canvas,c.oc.CROSSHAIR),!t.state.pendingImageElement)return;t.setState({draggingElement:t.state.pendingImageElement,editingElement:t.state.pendingImageElement,pendingImageElement:null,multiElement:null});var o=xn(e,t.state),i=o.x,a=o.y;ao(t.state.pendingImageElement,{x:i,y:a})}else"freedraw"===t.state.elementType?t.handleFreeDrawElementOnPointerDown(e,t.state.elementType,r):t.createGenericElementOnPointerDown(t.state.elementType,r);var l=t.onPointerMoveFromPointerDownHandler(r),s=t.onPointerUpFromPointerDownHandler(r),u=t.onKeyDownFromPointerDownHandler(r),d=t.onKeyUpFromPointerDownHandler(r);pg=s,t.state.viewModeEnabled||(window.addEventListener(c.Ks.POINTER_MOVE,l),window.addEventListener(c.Ks.POINTER_UP,s),window.addEventListener(c.Ks.KEYDOWN,u),window.addEventListener(c.Ks.KEYUP,d),r.eventListeners.onMove=l,r.eventListeners.onUp=s,r.eventListeners.onKeyUp=d,r.eventListeners.onKeyDown=u)}else t.handleTextOnPointerDown(e,r)}},this.handleCanvasPointerUp=function(e){t.lastPointerUp=e;var n=["pen","touch"].includes(e.pointerType);if(n){var r=xn({clientX:e.clientX,clientY:e.clientY},t.state),o=t.getElementAtPosition(r.x,r.y);t.hitLinkElement=t.getElementLinkAtPosition(r,o)}t.hitLinkElement&&!t.state.selectedElementIds[t.hitLinkElement.id]&&t.redirectToLink(e,n),t.removePointer(e)},this.maybeOpenContextMenuAfterPointerDownOnTouchDevices=function(e){"touch"===e.pointerType&&(fg=!1,dg?fg=!0:dg=window.setTimeout((function(){dg=0,fg||t.handleCanvasContextMenu(e)}),c.nM))},this.resetContextMenuTimer=function(){clearTimeout(dg),dg=0,fg=!1},this.handleCanvasPanUsingWheelOrSpaceDrag=function(e){if(0!==hg.pointers.size||!(e.button===c.Oh.WHEEL||e.button===c.Oh.MAIN&&lg||t.state.viewModeEnabled)||Ge(t.state.editingElement))return!1;sg=!0,e.preventDefault();var n=!1,r=/Linux/.test(window.navigator.platform);gn(t.canvas,c.oc.GRABBING);var o=e.clientX,i=e.clientY,a=In((function(e){var a=o-e.clientX,l=i-e.clientY;if(o=e.clientX,i=e.clientY,r&&!n&&(Math.abs(a)>1||Math.abs(l)>1)){n=!0;var s=function e(t){document.body.removeEventListener(c.Ks.PASTE,e),t.stopPropagation()};document.body.addEventListener(c.Ks.PASTE,s),window.addEventListener(c.Ks.POINTER_UP,(function e(){setTimeout((function(){document.body.removeEventListener(c.Ks.PASTE,s),window.removeEventListener(c.Ks.POINTER_UP,e)}),100)}))}t.setState({scrollX:t.state.scrollX-a/t.state.zoom.value,scrollY:t.state.scrollY-l/t.state.zoom.value})})),l=On(pg=function(){pg=null,sg=!1,lg||(t.state.viewModeEnabled?gn(t.canvas,c.oc.GRAB):vn(t.canvas,t.state.elementType)),t.setState({cursorButton:"up"}),t.savePointer(e.clientX,e.clientY,"up"),window.removeEventListener(c.Ks.POINTER_MOVE,a),window.removeEventListener(c.Ks.POINTER_UP,l),window.removeEventListener(c.Ks.BLUR,l),a.flush()});return window.addEventListener(c.Ks.BLUR,l),window.addEventListener(c.Ks.POINTER_MOVE,a,{passive:!0}),window.addEventListener(c.Ks.POINTER_UP,l),!0},this.clearSelectionIfNotUsingSelection=function(){"selection"!==t.state.elementType&&t.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null})},this.handleSelectionOnPointerDown=function(e,n){if("selection"===t.state.elementType){var r=t.scene.getElements(),o=Dc(r,t.state);if(1!==o.length||t.state.editingLinearElement)o.length>1&&(n.resize.handleType=Ji(Et(o),n.origin.x,n.origin.y,t.state.zoom,e.pointerType));else{var i=Qi(r,t.state,n.origin.x,n.origin.y,t.state.zoom,e.pointerType);null!=i&&(t.setState({resizingElement:i.element}),n.resize.handleType=i.transformHandleType)}if(n.resize.handleType)gn(t.canvas,ta({transformHandleType:n.resize.handleType})),n.resize.isResizing=!0,n.resize.offset=Sn(function(e,t,n,r){var o=h(1===t.length?gt(t[0]):Et(t),4),i=o[0],a=o[1],l=o[2],s=o[3],c=(i+l)/2,u=(a+s)/2,d=1===t.length?t[0].angle:0,f=h(nt(n,r,c,u,-d),2);switch(n=f[0],r=f[1],e){case"n":return nt(n-(i+l)/2,r-a,0,0,d);case"s":return nt(n-(i+l)/2,r-s,0,0,d);case"w":return nt(n-i,r-(a+s)/2,0,0,d);case"e":return nt(n-l,r-(a+s)/2,0,0,d);case"nw":return nt(n-i,r-a,0,0,d);case"ne":return nt(n-l,r-a,0,0,d);case"sw":return nt(n-i,r-s,0,0,d);case"se":return nt(n-l,r-s,0,0,d);default:return[0,0]}}(n.resize.handleType,o,n.origin.x,n.origin.y)),1===o.length&&Xe(o[0])&&2===o[0].points.length&&(n.resize.arrowDirection=(u=n.resize.handleType,d=h(o[0].points,2),p=(f=h(d[1],2))[0],m=f[1],"nw"===u&&(p<0||m<0)||"ne"===u&&p>=0||"sw"===u&&p<=0||"se"===u&&(p>0||m>0)?"end":"origin"));else{var a;if(t.state.editingLinearElement){var l=aa.handlePointerDown(e,t.state,(function(e){return t.setState(e)}),t.history,n.origin);if(l.hitElement&&(n.hit.element=l.hitElement),l.didAddPoint)return!0}if(n.hit.element=null!==(a=n.hit.element)&&void 0!==a?a:t.getElementAtPosition(n.origin.x,n.origin.y),n.hit.element){if(Ou(n.hit.element,t.state,[n.origin.x,n.origin.y],t.isMobile))return!1;n.hit.hasHitElementInside=yi(n.hit.element,t.state,[n.origin.x,n.origin.y])}n.hit.allHitElements=t.getElementsAtPosition(n.origin.x,n.origin.y);var s=n.hit.element,c=n.hit.allHitElements.some((function(e){return t.isASelectedElement(e)}));if(null!==s&&c||e.shiftKey||n.hit.hasHitCommonBoundingBoxOfSelectedElements||t.clearSelection(s),t.state.editingLinearElement)t.setState({selectedElementIds:L({},t.state.editingLinearElement.elementId,!0)});else if(null!=s){if(e[tn.CTRL_OR_CMD])return t.state.selectedElementIds[s.id]||(n.hit.wasAddedToSelection=!0),t.setState((function(e){return $m($m({},(n=s,vo(vo({},e),{},{editingGroupId:n.groupIds.length?n.groupIds[0]:null,selectedGroupIds:{},selectedElementIds:L({},n.id,!0)}))),{},{previousSelectedElementIds:t.state.selectedElementIds});var n})),!1;t.state.selectedElementIds[s.id]||(t.state.editingGroupId&&!Eo(s,t.state.editingGroupId)&&t.setState({selectedElementIds:{},selectedGroupIds:{},editingGroupId:null}),c||n.hit.hasHitCommonBoundingBoxOfSelectedElements||(t.setState((function(e){return ko($m($m({},e),{},{selectedElementIds:$m($m({},e.selectedElementIds),{},L({},s.id,!0)),showHyperlinkPopup:!!s.link&&"info"}),t.scene.getElements())})),n.hit.wasAddedToSelection=!0))}t.setState({previousSelectedElementIds:t.state.selectedElementIds})}}var u,d,f,p,m;return!1},this.handleTextOnPointerDown=function(e,n){if(!Ge(t.state.editingElement)){var r=n.origin.x,o=n.origin.y,i=t.getElementAtPosition(r,o,{includeBoundTextElement:!0});et(i)&&(r=i.x+i.width/2,o=i.y+i.height/2),t.startTextEditing({sceneX:r,sceneY:o,shouldBind:!1,insertAtParentCenter:!e.altKey}),mn(t.canvas),t.state.elementLocked||t.setState({elementType:"selection"})}},this.handleFreeDrawElementOnPointerDown=function(e,n,r){var o,i=h(dt(r.origin.x,r.origin.y,null),2),a=(o={type:n,x:i[0],y:i[1],strokeColor:t.state.currentItemStrokeColor,backgroundColor:t.state.currentItemBackgroundColor,fillStyle:t.state.currentItemFillStyle,strokeWidth:t.state.currentItemStrokeWidth,strokeStyle:t.state.currentItemStrokeStyle,roughness:t.state.currentItemRoughness,opacity:t.state.currentItemOpacity,strokeSharpness:t.state.currentItemLinearStrokeSharpness,simulatePressure:.5===e.pressure},Io(Io({},Mo(o.type,o)),{},{points:o.points||[],pressures:[],simulatePressure:o.simulatePressure,lastCommittedPoint:null}));t.setState((function(e){return{selectedElementIds:$m($m({},e.selectedElementIds),{},L({},a.id,!1))}}));var l=a.simulatePressure?a.pressures:[].concat(A(a.pressures),[e.pressure]);ao(a,{points:[[0,0]],pressures:l});var s=xa(r.origin,t.scene);t.scene.replaceAllElements([].concat(A(t.scene.getElementsIncludingDeleted()),[a])),t.setState({draggingElement:a,editingElement:a,startBoundElement:s,suggestedBindings:[]})},this.createImageElement=function(e){var n,r=e.sceneX,o=e.sceneY,i=h(dt(r,o,t.state.gridSize),2);return n={type:"image",x:i[0],y:i[1],strokeColor:t.state.currentItemStrokeColor,backgroundColor:t.state.currentItemBackgroundColor,fillStyle:t.state.currentItemFillStyle,strokeWidth:t.state.currentItemStrokeWidth,strokeStyle:t.state.currentItemStrokeStyle,roughness:t.state.currentItemRoughness,opacity:t.state.currentItemOpacity,strokeSharpness:t.state.currentItemLinearStrokeSharpness},Io(Io({},Mo("image",n)),{},{strokeColor:"transparent",status:"pending",fileId:null,scale:[1,1]})},this.handleLinearElementOnPointerDown=function(e,n,r){if(t.state.multiElement){var o=t.state.multiElement;if("line"===o.type&&at(o.points,t.state.zoom.value))return ao(o,{lastCommittedPoint:o.points[o.points.length-1]}),void t.actionManager.executeAction(pu);var i=o.x,a=o.y,l=o.lastCommittedPoint;if(o.points.length>1&&l&&it(r.origin.x-i,r.origin.y-a,l[0],l[1])<c.qx)return void t.actionManager.executeAction(pu);t.setState((function(e){return{selectedElementIds:$m($m({},e.selectedElementIds),{},L({},o.id,!0))}})),ao(o,{lastCommittedPoint:o.points[o.points.length-1]}),gn(t.canvas,c.oc.POINTER)}else{var s=h(dt(r.origin.x,r.origin.y,t.state.gridSize),2),u=s[0],d=s[1],f=t.state,p=f.currentItemStartArrowhead,m=f.currentItemEndArrowhead,g=h("arrow"===n?[p,m]:[null,null],2),v=g[0],b=g[1],y=Do({type:n,x:u,y:d,strokeColor:t.state.currentItemStrokeColor,backgroundColor:t.state.currentItemBackgroundColor,fillStyle:t.state.currentItemFillStyle,strokeWidth:t.state.currentItemStrokeWidth,strokeStyle:t.state.currentItemStrokeStyle,roughness:t.state.currentItemRoughness,opacity:t.state.currentItemOpacity,strokeSharpness:t.state.currentItemLinearStrokeSharpness,startArrowhead:v,endArrowhead:b});t.setState((function(e){return{selectedElementIds:$m($m({},e.selectedElementIds),{},L({},y.id,!1))}})),ao(y,{points:[].concat(A(y.points),[[0,0]])});var x=xa(r.origin,t.scene);t.scene.replaceAllElements([].concat(A(t.scene.getElementsIncludingDeleted()),[y])),t.setState({draggingElement:y,editingElement:y,startBoundElement:x,suggestedBindings:[]})}},this.createGenericElementOnPointerDown=function(e,n){var r=h(dt(n.origin.x,n.origin.y,t.state.gridSize),2),o=r[0],i=r[1],a=To({type:e,x:o,y:i,strokeColor:t.state.currentItemStrokeColor,backgroundColor:t.state.currentItemBackgroundColor,fillStyle:t.state.currentItemFillStyle,strokeWidth:t.state.currentItemStrokeWidth,strokeStyle:t.state.currentItemStrokeStyle,roughness:t.state.currentItemRoughness,opacity:t.state.currentItemOpacity,strokeSharpness:t.state.currentItemStrokeSharpness});"selection"===a.type?t.setState({selectionElement:a,draggingElement:a}):(t.scene.replaceAllElements([].concat(A(t.scene.getElementsIncludingDeleted()),[a])),t.setState({multiElement:null,draggingElement:a,editingElement:a}))},this.initializeImage=function(){var e=(0,d.Z)(g().mark((function e(n){var r,o,i,a,l,s,u,f,p,h,m,v,b,y,x;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.imageFile,l=n.imageElement,s=n.showCursorImagePreview,u=void 0!==s&&s,zd(a)){e.next=3;break}throw new Error(O("errors.unsupportedFileType"));case 3:if(f=a.type,gn(t.canvas,"wait"),f!==c.LO.svg){e.next=23;break}return e.prev=6,e.t0=Vd,e.t1=sf,e.next=11,a.text();case 11:return e.t2=e.sent,e.next=14,(0,e.t1)(e.t2);case 14:e.t3=e.sent,e.t4=a.name,a=(0,e.t0)(e.t3,e.t4),e.next=23;break;case 19:throw e.prev=19,e.t5=e.catch(6),console.warn(e.t5),new Error(O("errors.svgImageInsertError"));case 23:return e.next=25,(null===(r=(o=t.props).generateIdForFile)||void 0===r?void 0:r.call(o,a))||Fd(a);case 25:if(p=e.sent){e.next=29;break}throw console.warn("Couldn't generate file id or the supplied `generateIdForFile` didn't resolve to one."),new Error(O("errors.imageInsertError"));case 29:if(null!=(h=t.files[p])&&h.dataURL){e.next=42;break}return e.prev=31,e.next=34,Wd(a,{maxWidthOrHeight:c.h6});case 34:a=e.sent,e.next=40;break;case 37:e.prev=37,e.t6=e.catch(31),console.error("error trying to resing image file on insertion",e.t6);case 40:if(!(a.size>c.$n)){e.next=42;break}throw new Error(O("errors.fileTooBig",{maxSize:"".concat(Math.trunc(c.$n/1024/1024),"MB")}));case 42:if(u&&(v=null===(m=t.files[p])||void 0===m?void 0:m.dataURL,b=v&&Kd(v),t.setImagePreviewCursor(b||a)),e.t7=null===(i=t.files[p])||void 0===i?void 0:i.dataURL,e.t7){e.next=48;break}return e.next=47,Ud(a);case 47:e.t7=e.sent;case 48:return y=e.t7,x=ao(l,{fileId:p},!1),e.abrupt("return",new Promise(function(){var e=(0,d.Z)(g().mark((function e(n,r){var o,i,a;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,t.files=$m($m({},t.files),{},L({},p,{mimeType:f,id:p,dataURL:y,created:Date.now()})),a=t.imageCache.get(p)){e.next=7;break}return t.addNewImagesToImageCache(),e.next=7,t.updateImageCache([x]);case 7:if(!((null==a?void 0:a.image)instanceof Promise)){e.next=10;break}return e.next=10,a.image;case 10:(null===(o=t.state.pendingImageElement)||void 0===o?void 0:o.id)!==x.id&&(null===(i=t.state.draggingElement)||void 0===i?void 0:i.id)!==x.id&&t.initializeImageDimensions(x,!0),n(x),e.next=18;break;case 14:e.prev=14,e.t0=e.catch(0),console.error(e.t0),r(new Error(O("errors.imageInsertError")));case 18:return e.prev=18,u||mn(t.canvas),e.finish(18);case 21:case"end":return e.stop()}}),e,null,[[0,14,18,21]])})));return function(t,n){return e.apply(this,arguments)}}()));case 51:case"end":return e.stop()}}),e,null,[[6,19],[31,37]])})));return function(t){return e.apply(this,arguments)}}(),this.insertImageElement=function(){var e=(0,d.Z)(g().mark((function e(n,r,o){return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.scene.replaceAllElements([].concat(A(t.scene.getElementsIncludingDeleted()),[n])),e.prev=1,e.next=4,t.initializeImage({imageFile:r,imageElement:n,showCursorImagePreview:o});case 4:e.next=11;break;case 6:e.prev=6,e.t0=e.catch(1),ao(n,{isDeleted:!0}),t.actionManager.executeAction(pu),t.setState({errorMessage:e.t0.message||O("errors.imageInsertError")});case 11:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(t,n,r){return e.apply(this,arguments)}}(),this.setImagePreviewCursor=function(){var e=(0,d.Z)(g().mark((function e(n){var r,o,i,a,l,s,u;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=96,e.next=3,Wd(n,{maxWidthOrHeight:r});case 3:return o=e.sent,e.next=6,Ud(o);case 6:if(i=e.sent,n.type!==c.LO.svg){e.next=20;break}return e.next=10,of(i);case 10:a=e.sent,l=Math.min(a.height,r),(s=l*(a.width/a.height))>r&&(l=(s=r)*(a.height/a.width)),(u=document.createElement("canvas")).height=l,u.width=s,u.getContext("2d").drawImage(a,0,0,s,l),i=u.toDataURL(c.LO.svg);case 20:t.state.pendingImageElement&&gn(t.canvas,"url(".concat(i,") 4 4, auto"));case 21:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.onImageAction=(0,d.Z)(g().mark((function e(){var n,r,o,i,a,l,s,c,u,d=arguments;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=d.length>0&&void 0!==d[0]?d[0]:{insertOnCanvasDirectly:!1},r=n.insertOnCanvasDirectly,e.prev=1,o=t.state.width/2+t.state.offsetLeft,i=t.state.height/2+t.state.offsetTop,a=xn({clientX:o,clientY:i},t.state),l=a.x,s=a.y,e.next=7,yd({description:"Image",extensions:["jpg","png","svg","gif"]});case 7:c=e.sent,u=t.createImageElement({sceneX:l,sceneY:s}),r?(t.insertImageElement(u,c),t.initializeImageDimensions(u),t.setState({selectedElementIds:L({},u.id,!0)},(function(){t.actionManager.executeAction(pu)}))):t.setState({pendingImageElement:u},(function(){t.insertImageElement(u,c,!0)})),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(1),"AbortError"!==e.t0.name?console.error(e.t0):console.warn(e.t0),t.setState({pendingImageElement:null,editingElement:null,elementType:"selection"},(function(){t.actionManager.executeAction(pu)}));case 16:case"end":return e.stop()}}),e,null,[[1,12]])}))),this.initializeImageDimensions=function(e){var n,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=We(e)&&(null===(n=t.imageCache.get(e.fileId))||void 0===n?void 0:n.image);if(!o||o instanceof Promise){if(e.width<c.f/t.state.zoom.value&&e.height<c.f/t.state.zoom.value){var i=100/t.state.zoom.value;ao(e,{x:e.x-i/2,y:e.y-i/2,width:i,height:i})}}else if(r||e.width<c.f/t.state.zoom.value&&e.height<c.f/t.state.zoom.value){var a=Math.max(t.state.height-120,160),l=Math.min(a,Math.floor(.5*t.state.height)/t.state.zoom.value),s=Math.min(o.naturalHeight,l),u=s*(o.naturalWidth/o.naturalHeight),d=e.x+e.width/2-u/2,f=e.y+e.height/2-s/2;ao(e,{x:d,y:f,width:u,height:s})}},this.updateImageCache=function(){var e=(0,d.Z)(g().mark((function e(n){var r,o,i,a,l,s,c,u=arguments;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=u.length>1&&void 0!==u[1]?u[1]:t.files,e.next=3,af({imageCache:t.imageCache,fileIds:n.map((function(e){return e.fileId})),files:r});case 3:if(o=e.sent,i=o.updatedFiles,a=o.erroredFiles,i.size||a.size){l=Ym(n);try{for(l.s();!(s=l.n()).done;)c=s.value,i.has(c.fileId)&&Fr(c)}catch(d){l.e(d)}finally{l.f()}}return a.size&&t.scene.replaceAllElements(t.scene.getElementsIncludingDeleted().map((function(e){return We(e)&&a.has(e.fileId)?lo(e,{status:"error"}):e}))),e.abrupt("return",{updatedFiles:i,erroredFiles:a});case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),this.addNewImagesToImageCache=(0,d.Z)(g().mark((function e(){var n,r,o,i=arguments;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=i.length>0&&void 0!==i[0]?i[0]:lf(t.scene.getElements()),r=i.length>1&&void 0!==i[1]?i[1]:t.files,!(o=n.filter((function(e){return!e.isDeleted&&!t.imageCache.has(e.fileId)}))).length){e.next=9;break}return e.next=6,t.updateImageCache(o,r);case 6:e.sent.updatedFiles.size&&t.scene.informMutation();case 9:case"end":return e.stop()}}),e)}))),this.scheduleImageRefresh=Zm()((function(){t.addNewImagesToImageCache()}),c.LL),this.updateBindingEnabledOnPointerMove=function(e){var n=!e[tn.CTRL_OR_CMD];t.state.isBindingEnabled!==n&&t.setState({isBindingEnabled:n})},this.maybeSuggestBindingAtCursor=function(e){var n=xa(e,t.scene);t.setState({suggestedBindings:null!=n?[n]:[]})},this.maybeSuggestBindingsForLinearElementAtCoords=function(e,n,r){if(n.length){var o=n.reduce((function(n,o){var i=xa(o,t.scene);return null==i||va(e,null==r?void 0:r.id,i)||n.push(i),n}),[]);t.setState({suggestedBindings:o})}},this.handleCanvasRef=function(e){var n,r,o;null!==e?(t.canvas=e,t.rc=Be.canvas(t.canvas),t.canvas.addEventListener(c.Ks.WHEEL,t.handleWheel,{passive:!1}),t.canvas.addEventListener(c.Ks.TOUCH_START,t.onTapStart),t.canvas.addEventListener(c.Ks.TOUCH_END,t.onTapEnd)):(null===(n=t.canvas)||void 0===n||n.removeEventListener(c.Ks.WHEEL,t.handleWheel),null===(r=t.canvas)||void 0===r||r.removeEventListener(c.Ks.TOUCH_START,t.onTapStart),null===(o=t.canvas)||void 0===o||o.removeEventListener(c.Ks.TOUCH_END,t.onTapEnd))},this.handleAppOnDrop=function(){var e=(0,d.Z)(g().mark((function e(n){var r,o,i,a,l,s,u,d,f,p,h,m;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,i=n.dataTransfer.files[0],!zd(i)){e.next=33;break}if((null==i?void 0:i.type)!==c.LO.png&&(null==i?void 0:i.type)!==c.LO.svg){e.next=27;break}if(e.prev=4,!gd){e.next=16;break}return e.prev=6,a=n.dataTransfer.items[0],e.next=10,a.getAsFileSystemHandle();case 10:i.handle=e.sent,e.next=16;break;case 13:e.prev=13,e.t0=e.catch(6),console.warn(e.t0.name,e.t0.message);case 16:return e.next=18,Nd(i,t.state,t.scene.getElementsIncludingDeleted());case 18:return l=e.sent,t.syncActionResult($m($m({},l),{},{appState:$m($m({},l.appState||t.state),{},{isLoading:!1}),replaceFiles:!0,commitToHistory:!0})),e.abrupt("return");case 23:if(e.prev=23,e.t1=e.catch(4),"EncodingError"===e.t1.name){e.next=27;break}throw e.t1;case 27:return s=xn(n,t.state),u=s.x,d=s.y,f=t.createImageElement({sceneX:u,sceneY:d}),t.insertImageElement(f,i),t.initializeImageDimensions(f),t.setState({selectedElementIds:L({},f.id,!0)}),e.abrupt("return");case 33:e.next=38;break;case 35:return e.prev=35,e.t2=e.catch(0),e.abrupt("return",t.setState({isLoading:!1,errorMessage:e.t2.message}));case 38:if(""===(p=n.dataTransfer.getData(c.LO.excalidrawlib))){e.next=42;break}return t.addElementsFromPasteOrLibrary({elements:JSON.parse(p),position:n,files:null}),e.abrupt("return");case 42:if(!((null==(h=null===(r=n.dataTransfer)||void 0===r?void 0:r.files[0])?void 0:h.type)===c.LO.excalidrawlib||null!=h&&null!==(o=h.name)&&void 0!==o&&o.endsWith(".excalidrawlib"))){e.next=47;break}t.library.importLibrary(h).then((function(){t.setState({isLibraryOpen:!1}),t.setState({isLibraryOpen:!0})})).catch((function(e){return t.setState({isLoading:!1,errorMessage:e.message})})),e.next=61;break;case 47:if(t.setState({isLoading:!0}),!gd){e.next=59;break}return e.prev=49,m=n.dataTransfer.items[0],e.next=53,m.getAsFileSystemHandle();case 53:h.handle=e.sent,e.next=59;break;case 56:e.prev=56,e.t3=e.catch(49),console.warn(e.t3.name,e.t3.message);case 59:return e.next=61,t.loadFileToCanvas(h);case 61:case"end":return e.stop()}}),e,null,[[0,35],[4,23],[6,13],[49,56]])})));return function(t){return e.apply(this,arguments)}}(),this.loadFileToCanvas=function(e){Nd(e,t.state,t.scene.getElementsIncludingDeleted()).then((function(e){t.syncActionResult($m($m({},e),{},{appState:$m($m({},e.appState||t.state),{},{isLoading:!1}),replaceFiles:!0,commitToHistory:!0}))})).catch((function(e){t.setState({isLoading:!1,errorMessage:e.message})}))},this.handleCanvasContextMenu=function(e){if(e.preventDefault(),"touch"!==e.nativeEvent.pointerType&&("pen"!==e.nativeEvent.pointerType||e.button===c.Oh.SECONDARY)||"selection"===t.state.elementType){var n=xn(e,t.state),r=n.x,o=n.y,i=t.getElementAtPosition(r,o,{preferSelected:!0}),a=i?"element":"canvas",l=t.excalidrawContainerRef.current.getBoundingClientRect(),s=l.top,u=l.left,d=e.clientX-u,f=e.clientY-s;i&&!t.state.selectedElementIds[i.id]?t.setState({selectedElementIds:L({},i.id,!0)},(function(){t._openContextMenu({top:f,left:d},a)})):t._openContextMenu({top:f,left:d},a)}},this.maybeDragNewGenericElement=function(e,n){var r=t.state.draggingElement,o=e.lastCoords;if(r)if("selection"===r.type)Ya(r,t.state.elementType,e.origin.x,e.origin.y,o.x,o.y,hn(e.origin.x,o.x),hn(e.origin.y,o.y),on(n),rn(n));else{var i,a=h(dt(o.x,o.y,t.state.gridSize),2),l=a[0],s=a[1],c=We(r)&&(null===(i=t.imageCache.get(r.fileId))||void 0===i?void 0:i.image),u=!c||c instanceof Promise?null:c.width/c.height;Ya(r,t.state.elementType,e.originInGrid.x,e.originInGrid.y,l,s,hn(e.originInGrid.x,l),hn(e.originInGrid.y,s),Ve(r)?!on(n):on(n),rn(n),u),t.maybeSuggestBindingForAll([r])}},this.maybeHandleResize=function(e,n){var r=Dc(t.scene.getElements(),t.state),o=e.resize.handleType;t.setState({isResizing:o&&"rotation"!==o,isRotating:"rotation"===o});var i=e.lastCoords,a=h(dt(i.x-e.resize.offset.x,i.y-e.resize.offset.y,t.state.gridSize),2),l=a[0],s=a[1];return!!function(e,t,n,r,o,i,a,l,s,c,u){if(1===n.length){var d=h(n,1)[0];return"rotation"===t?(Ha(d,l,s,o),ka(d)):!Xe(d)||2!==d.points.length||"nw"!==t&&"ne"!==t&&"sw"!==t&&"se"!==t?!Ge(d)||"nw"!==t&&"ne"!==t&&"sw"!==t&&"se"!==t?t&&Wa(e.originalElements.get(d.id),a,d,t,i,l,s):(Ka(d,t,i,l,s),ka(d)):Ba(d,r,o,l,s),!0}if(n.length>1){if("rotation"===t)return Ga(e,n,l,s,o,c,u),!0;if("nw"===t||"ne"===t||"sw"===t||"se"===t)return Va(n,t,l,s),fr(n,t),!0}return!1}(e,o,r,e.resize.arrowDirection,an(n),rn(n),1===r.length&&Ve(r[0])?!on(n):on(n),l,s,e.resize.center.x,e.resize.center.y)&&(t.maybeSuggestBindingForAll(r),!0)},this._openContextMenu=function(e,n){var r=e.left,o=e.top;t.state.showHyperlinkPopup&&t.setState({showHyperlinkPopup:!1}),t.contextMenuOpen=!0;var i=bp.contextItemPredicate(t.actionManager.getElementsIncludingDeleted(),t.actionManager.getAppState()),a=yp.contextItemPredicate(t.actionManager.getElementsIncludingDeleted(),t.actionManager.getAppState()),l=Dp.contextItemPredicate(t.actionManager.getElementsIncludingDeleted(),t.actionManager.getAppState()),s=Rp.contextItemPredicate(t.actionManager.getElementsIncludingDeleted(),t.actionManager.getAppState()),c="separator",u=t.scene.getElements(),d=[];if(Lf&&u.length>0&&d.push(Gp),Af&&u.length>0&&d.push(Vp),"canvas"===n){var f=[].concat(d,[void 0===t.props.gridModeEnabled&&Xp,void 0===t.props.zenModeEnabled&&Qp,void 0===t.props.viewModeEnabled&&Vm,th]);t.state.viewModeEnabled?_h({options:f,top:o,left:r,actionManager:t.actionManager,appState:t.state,container:t.excalidrawContainerRef.current,elements:u}):_h({options:[t.isMobile&&navigator.clipboard&&{name:"paste",perform:function(e,n){return t.pasteFromClipboard(null),{commitToHistory:!1}},contextItemLabel:"labels.paste"},t.isMobile&&navigator.clipboard&&c,Lf&&u.length>0&&Gp,Af&&u.length>0&&Vp,(Lf&&u.length>0||Af&&u.length>0)&&c,ru,c,void 0===t.props.gridModeEnabled&&Xp,void 0===t.props.zenModeEnabled&&Qp,void 0===t.props.viewModeEnabled&&Vm,th],top:o,left:r,actionManager:t.actionManager,appState:t.state,container:t.excalidrawContainerRef.current,elements:u})}else if("element"===n){var p=Dc(u,t.state).some((function(e){return!et(e)}));t.state.viewModeEnabled?_h({options:[navigator.clipboard&&Kp].concat(d),top:o,left:r,actionManager:t.actionManager,appState:t.state,container:t.excalidrawContainerRef.current,elements:u}):_h({options:[t.isMobile&&Wp,t.isMobile&&navigator.clipboard&&Kp,t.isMobile&&navigator.clipboard&&{name:"paste",perform:function(e,n){return t.pasteFromClipboard(null),{commitToHistory:!1}},contextItemLabel:"labels.paste"},t.isMobile&&c].concat(d,[c,sp,cp,c,i&&bp,!p&&nh,a&&yp,(i||a)&&c,Sp,c,$c,Qc,Jc,eu,c,l&&Dp,s&&Rp,(l||s)&&c,Su.contextItemPredicate(u,t.state)&&Su,au,Bc]),top:o,left:r,actionManager:t.actionManager,appState:t.state,container:t.excalidrawContainerRef.current,elements:u})}},this.handleWheel=On((function(e){if(e.preventDefault(),!sg){var n=e.deltaX,r=e.deltaY,o=t.state,i=o.selectedElementIds,a=o.previousSelectedElementIds;if(e.metaKey||e.ctrlKey){var l=Math.sign(r),s=Math.abs(r);s>10&&(s=10),s*=l,0!==Object.keys(a).length&&setTimeout((function(){t.setState({selectedElementIds:a,previousSelectedElementIds:{}})}),1e3);var u=t.state.zoom.value-s/100;return u+=Math.log10(Math.max(1,t.state.zoom.value))*-l,u=Math.round(u*c.V4*100)/(100*c.V4),t.setState((function(e){return $m($m({},Js({viewportX:ig,viewportY:ag,nextZoom:Qs(u)},e)),{},{selectedElementIds:{},previousSelectedElementIds:0!==Object.keys(i).length?i:a,shouldCacheIgnoreZoom:!0})})),void t.resetShouldCacheIgnoreZoomDebounced()}e.shiftKey?t.setState((function(e){var t=e.zoom;return{scrollX:e.scrollX-(r||n)/t.value}})):t.setState((function(e){var t=e.zoom,o=e.scrollX,i=e.scrollY;return{scrollX:o-n/t.value,scrollY:i-r/t.value}}))}})),this.savePointer=function(e,n,r){var o,i;if(e&&n){var a=xn({clientX:e,clientY:n},t.state);isNaN(a.x)||isNaN(a.y),null===(o=(i=t.props).onPointerUpdate)||void 0===o||o.call(i,{pointer:a,button:r,pointersMap:hg.pointers})}},this.resetShouldCacheIgnoreZoomDebounced=fn((function(){t.unmounted||t.setState({shouldCacheIgnoreZoom:!1})}),300),this.updateDOMRect=function(e){var n;if(null!==(n=t.excalidrawContainerRef)&&void 0!==n&&n.current){var r=t.excalidrawContainerRef.current.getBoundingClientRect(),o=r.width,i=r.height,a=r.left,l=r.top,s=t.state,c=s.width,u=s.height,d=s.offsetTop,f=s.offsetLeft;if(o===c&&i===u&&a===f&&l===d)return void(e&&e());t.setState({width:o,height:i,offsetLeft:a,offsetTop:l},(function(){e&&e()}))}},this.refresh=function(){t.setState($m({},t.getCanvasOffsets()))}};"production"!==c.Vi.TEST&&"production"!==c.Vi.DEVELOPMENT||(window.h=window.h||{},Object.defineProperties(window.h,{elements:{configurable:!0,get:function(){return this.app.scene.getElementsIncludingDeleted()},set:function(e){return this.app.scene.replaceAllElements(e)}}}));var vg=mg,bg=(n(4285),n(3313),["initialData","UIOptions"]),yg=["initialData","UIOptions"];function xg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xg(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xg(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var kg=function(e){var t,n,r,o=e.onChange,i=e.initialData,a=e.excalidrawRef,s=e.onCollabButtonClick,u=e.isCollaborating,d=void 0!==u&&u,f=e.onPointerUpdate,p=e.renderTopRightUI,h=e.renderFooter,m=e.langCode,g=void 0===m?y.code:m,v=e.viewModeEnabled,b=e.zenModeEnabled,x=e.gridModeEnabled,w=e.libraryReturnUrl,k=e.theme,E=e.name,_=e.renderCustomStats,S=e.onPaste,C=e.detectScroll,j=void 0===C||C,O=e.handleKeyboardGlobally,M=void 0!==O&&O,P=e.onLibraryChange,A=e.autoFocus,L=void 0!==A&&A,D=e.generateIdForFile,R=e.onLinkOpen,z=null===(t=e.UIOptions)||void 0===t?void 0:t.canvasActions,N={canvasActions:wg(wg({},c.cW.canvasActions),z)};return null!=z&&z.export&&(N.canvasActions.export.saveFileToDisk=null!==(n=null===(r=z.export)||void 0===r?void 0:r.saveFileToDisk)&&void 0!==n?n:c.cW.canvasActions.export.saveFileToDisk),(0,l.useEffect)((function(){var e=function(e){"number"==typeof e.scale&&1!==e.scale&&e.preventDefault()};return document.addEventListener("touchmove",e,{passive:!1}),function(){document.removeEventListener("touchmove",e)}}),[]),(0,I.jsx)(T,{langCode:g,children:(0,I.jsx)(vg,{onChange:o,initialData:i,excalidrawRef:a,onCollabButtonClick:s,isCollaborating:d,onPointerUpdate:f,renderTopRightUI:p,renderFooter:h,langCode:g,viewModeEnabled:v,zenModeEnabled:b,gridModeEnabled:x,libraryReturnUrl:w,theme:k,name:E,renderCustomStats:_,UIOptions:N,onPaste:S,detectScroll:j,handleKeyboardGlobally:M,onLibraryChange:P,autoFocus:L,generateIdForFile:D,onLinkOpen:R})})},Eg=function(e,t){e.initialData;var n=e.UIOptions,r=void 0===n?{}:n,i=o()(e,bg),a=(t.initialData,t.UIOptions),l=void 0===a?{}:a,s=o()(t,yg),c=Object.keys(r),u=Object.keys(l);if(c.length!==u.length)return!1;var d=c.every((function(e){return"canvasActions"===e&&Object.keys(r.canvasActions).every((function(e){var t,n,o,i;return"export"===e&&null!=r&&null!==(t=r.canvasActions)&&void 0!==t&&t.export&&null!=l&&null!==(n=l.canvasActions)&&void 0!==n&&n.export?r.canvasActions.export.saveFileToDisk===l.canvasActions.export.saveFileToDisk:(null==r||null===(o=r.canvasActions)||void 0===o?void 0:o[e])===(null==l||null===(i=l.canvasActions)||void 0===i?void 0:i[e])})),!0})),f=Object.keys(e),p=Object.keys(t);return d&&f.length===p.length&&f.every((function(e){return i[e]===s[e]}))},_g=(0,l.forwardRef)((function(e,t){return(0,I.jsx)(kg,wg(wg({},e),{},{excalidrawRef:t}))})),Sg=s().memo(_g,Eg),Cg=(n(8336),Sg)},9669:function(e){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg=="},7984:function(e){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:function(e){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:function(e,t,n){e.exports=n.p+"excalidraw-assets/Cascadia.woff2"},3940:function(e,t,n){e.exports=n.p+"excalidraw-assets/Virgil.woff2"},9787:function(e){e.exports=y},5156:function(e){e.exports=x},8950:function(e,t,n){function r(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(c){return void n(c)}l.done?t(s):Promise.resolve(s).then(r,o)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var a=e.apply(t,n);function l(e){r(a,o,i,l,s,"next",e)}function s(e){r(a,o,i,l,s,"throw",e)}l(void 0)}))}}n.d(t,{Z:function(){return o}})},1463:function(e){e.exports=JSON.parse('{"labels":{"paste":"Paste","pasteCharts":"Paste charts","selectAll":"Select all","multiSelect":"Add element to selection","moveCanvas":"Move canvas","cut":"Cut","copy":"Copy","copyAsPng":"Copy to clipboard as PNG","copyAsSvg":"Copy to clipboard as SVG","bringForward":"Bring forward","sendToBack":"Send to back","bringToFront":"Bring to front","sendBackward":"Send backward","delete":"Delete","copyStyles":"Copy styles","pasteStyles":"Paste styles","stroke":"Stroke","background":"Background","fill":"Fill","strokeWidth":"Stroke width","strokeStyle":"Stroke style","strokeStyle_solid":"Solid","strokeStyle_dashed":"Dashed","strokeStyle_dotted":"Dotted","sloppiness":"Sloppiness","opacity":"Opacity","textAlign":"Text align","edges":"Edges","sharp":"Sharp","round":"Round","arrowheads":"Arrowheads","arrowhead_none":"None","arrowhead_arrow":"Arrow","arrowhead_bar":"Bar","arrowhead_dot":"Dot","arrowhead_triangle":"Triangle","fontSize":"Font size","fontFamily":"Font family","onlySelected":"Only selected","withBackground":"Background","exportEmbedScene":"Embed scene","exportEmbedScene_details":"Scene data will be saved into the exported PNG/SVG file so that the scene can be restored from it.\\nWill increase exported file size.","addWatermark":"Add \\"Made with Excalidraw\\"","handDrawn":"Hand-drawn","normal":"Normal","code":"Code","small":"Small","medium":"Medium","large":"Large","veryLarge":"Very large","solid":"Solid","hachure":"Hachure","crossHatch":"Cross-hatch","thin":"Thin","bold":"Bold","left":"Left","center":"Center","right":"Right","extraBold":"Extra bold","architect":"Architect","artist":"Artist","cartoonist":"Cartoonist","fileTitle":"File name","colorPicker":"Color picker","canvasBackground":"Canvas background","drawingCanvas":"Drawing canvas","layers":"Layers","actions":"Actions","language":"Language","liveCollaboration":"Live collaboration","duplicateSelection":"Duplicate","untitled":"Untitled","name":"Name","yourName":"Your name","madeWithExcalidraw":"Made with Excalidraw","group":"Group selection","ungroup":"Ungroup selection","collaborators":"Collaborators","showGrid":"Show grid","addToLibrary":"Add to library","removeFromLibrary":"Remove from library","libraryLoadingMessage":"Loading library…","libraries":"Browse libraries","loadingScene":"Loading scene…","align":"Align","alignTop":"Align top","alignBottom":"Align bottom","alignLeft":"Align left","alignRight":"Align right","centerVertically":"Center vertically","centerHorizontally":"Center horizontally","distributeHorizontally":"Distribute horizontally","distributeVertically":"Distribute vertically","flipHorizontal":"Flip horizontal","flipVertical":"Flip vertical","viewMode":"View mode","toggleExportColorScheme":"Toggle export color scheme","share":"Share","showStroke":"Show stroke color picker","showBackground":"Show background color picker","toggleTheme":"Toggle theme","personalLib":"Personal Library","excalidrawLib":"Excalidraw Library","decreaseFontSize":"Decrease font size","increaseFontSize":"Increase font size","unbindText":"Unbind text","link":{"edit":"Edit link","create":"Create link","label":"Link"}},"buttons":{"clearReset":"Reset the canvas","exportJSON":"Export to file","exportImage":"Save as image","export":"Export","exportToPng":"Export to PNG","exportToSvg":"Export to SVG","copyToClipboard":"Copy to clipboard","copyPngToClipboard":"Copy PNG to clipboard","scale":"Scale","save":"Save to current 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","createNewRoom":"Create new room","fullScreen":"Full screen","darkMode":"Dark mode","lightMode":"Light mode","zenMode":"Zen mode","exitZenMode":"Exit zen mode","cancel":"Cancel","clear":"Clear","remove":"Remove","publishLibrary":"Publish","submit":"Submit","confirm":"Confirm"},"alerts":{"clearReset":"This will clear the whole canvas. Are you sure?","couldNotCreateShareableLink":"Couldn\'t create shareable link.","couldNotCreateShareableLinkTooBig":"Couldn\'t create shareable link: the scene is too big","couldNotLoadInvalidFile":"Couldn\'t load invalid file","importBackendFailed":"Importing from backend failed.","cannotExportEmptyCanvas":"Cannot export empty canvas.","couldNotCopyToClipboard":"Couldn\'t copy to clipboard. Try using Chrome browser.","decryptFailed":"Couldn\'t decrypt data.","uploadedSecurly":"The upload has been secured with end-to-end encryption, which means that Excalidraw server and third parties can\'t read the content.","loadSceneOverridePrompt":"Loading external drawing will replace your existing content. Do you wish to continue?","collabStopOverridePrompt":"Stopping the session will overwrite your previous, locally stored drawing. Are you sure?\\n\\n(If you want to keep your local drawing, simply close the browser tab instead.)","errorLoadingLibrary":"There was an error loading the third party library.","errorAddingToLibrary":"Couldn\'t add item to the library","errorRemovingFromLibrary":"Couldn\'t remove item from the library","confirmAddLibrary":"This will add {{numShapes}} shape(s) to your library. Are you sure?","imageDoesNotContainScene":"This image does not seem to contain any scene data. Have you enabled scene embedding during export?","cannotRestoreFromImage":"Scene couldn\'t be restored from this image file","invalidSceneUrl":"Couldn\'t import scene from the supplied URL. It\'s either malformed, or doesn\'t contain valid Excalidraw JSON data.","resetLibrary":"This will clear your library. Are you sure?","removeItemsFromsLibrary":"Delete {{count}} item(s) from library?","invalidEncryptionKey":"Encryption key must be of 22 characters. Live collaboration is disabled."},"errors":{"unsupportedFileType":"Unsupported file type.","imageInsertError":"Couldn\'t insert image. Try again later...","fileTooBig":"File is too big. Maximum allowed size is {{maxSize}}.","svgImageInsertError":"Couldn\'t insert SVG image. The SVG markup looks invalid.","invalidSVGString":"Invalid SVG."},"toolBar":{"selection":"Selection","image":"Insert image","rectangle":"Rectangle","diamond":"Diamond","ellipse":"Ellipse","arrow":"Arrow","line":"Line","freedraw":"Draw","text":"Text","library":"Library","lock":"Keep selected tool active after drawing","penMode":"Prevent pinch-zoom and accept freedraw input only from pen","link":"Add/ Update link for a selected shape"},"headings":{"canvasActions":"Canvas actions","selectedShapeActions":"Selected shape actions","shapes":"Shapes"},"hints":{"canvasPanning":"To move canvas, hold mouse wheel or spacebar while dragging","linearElement":"Click to start multiple points, drag for single line","freeDraw":"Click and drag, release when you\'re finished","text":"Tip: you can also add text by double-clicking anywhere with the selection tool","text_selected":"Double-click or press ENTER to edit text","text_editing":"Press Escape or CtrlOrCmd+ENTER to finish editing","linearElementMulti":"Click on last point or press Escape or Enter to finish","lockAngle":"You can constrain angle by holding SHIFT","resize":"You can constrain proportions by holding SHIFT while resizing,\\nhold ALT to resize from the center","resizeImage":"You can resize freely by holding SHIFT,\\nhold ALT to resize from the center","rotate":"You can constrain angles by holding SHIFT while rotating","lineEditor_info":"Double-click or press Enter to edit points","lineEditor_pointSelected":"Press Delete to remove point(s),\\nCtrlOrCmd+D to duplicate, or drag to move","lineEditor_nothingSelected":"Select a point to edit (hold SHIFT to select multiple),\\nor hold Alt and click to add new points","placeImage":"Click to place the image, or click and drag to set its size manually","publishLibrary":"Publish your own library","bindTextToElement":"Press enter to add text","deepBoxSelect":"Hold CtrlOrCmd to deep select, and to prevent dragging"},"canvasError":{"cannotShowPreview":"Cannot show preview","canvasTooBig":"The canvas may be too big.","canvasTooBigTip":"Tip: try moving the farthest elements a bit closer together."},"errorSplash":{"headingMain_pre":"Encountered an error. Try ","headingMain_button":"reloading the page.","clearCanvasMessage":"If reloading doesn\'t work, try ","clearCanvasMessage_button":"clearing the canvas.","clearCanvasCaveat":" This will result in loss of work ","trackedToSentry_pre":"The error with identifier ","trackedToSentry_post":" was tracked on our system.","openIssueMessage_pre":"We were very cautious not to include your scene information on the error. If your scene is not private, please consider following up on our ","openIssueMessage_button":"bug tracker.","openIssueMessage_post":" Please include information below by copying and pasting into the GitHub issue.","sceneContent":"Scene content:"},"roomDialog":{"desc_intro":"You can invite people to your current scene to collaborate with you.","desc_privacy":"Don\'t worry, the session uses end-to-end encryption, so whatever you draw will stay private. Not even our server will be able to see what you come up with.","button_startSession":"Start session","button_stopSession":"Stop session","desc_inProgressIntro":"Live-collaboration session is now in progress.","desc_shareLink":"Share this link with anyone you want to collaborate with:","desc_exitSession":"Stopping the session will disconnect you from the room, but you\'ll be able to continue working with the scene, locally. Note that this won\'t affect other people, and they\'ll still be able to collaborate on their version.","shareTitle":"Join a live collaboration session on Excalidraw"},"errorDialog":{"title":"Error"},"exportDialog":{"disk_title":"Save to disk","disk_details":"Export the scene data to a file from which you can import later.","disk_button":"Save to file","link_title":"Shareable link","link_details":"Export as a read-only link.","link_button":"Export to Link","excalidrawplus_description":"Save the scene to your Excalidraw+ workspace.","excalidrawplus_button":"Export","excalidrawplus_exportError":"Couldn\'t export to Excalidraw+ at this moment..."},"helpDialog":{"blog":"Read our blog","click":"click","deepSelect":"Deep select","deepBoxSelect":"Deep select within box, and prevent dragging","curvedArrow":"Curved arrow","curvedLine":"Curved line","documentation":"Documentation","doubleClick":"double-click","drag":"drag","editor":"Editor","editSelectedShape":"Edit selected shape (text/arrow/line)","github":"Found an issue? Submit","howto":"Follow our guides","or":"or","preventBinding":"Prevent arrow binding","shapes":"Shapes","shortcuts":"Keyboard shortcuts","textFinish":"Finish editing (text editor)","textNewLine":"Add new line (text editor)","title":"Help","view":"View","zoomToFit":"Zoom to fit all elements","zoomToSelection":"Zoom to selection"},"clearCanvasDialog":{"title":"Clear canvas"},"publishDialog":{"title":"Publish library","itemName":"Item name","authorName":"Author name","githubUsername":"GitHub username","twitterUsername":"Twitter username","libraryName":"Library name","libraryDesc":"Library description","website":"Website","placeholder":{"authorName":"Your name or username","libraryName":"Name of your library","libraryDesc":"Description of your library to help people understand its usage","githubHandle":"GitHub handle (optional), so you can edit the library once submitted for review","twitterHandle":"Twitter username (optional), so we know who to credit when promoting over Twitter","website":"Link to your personal website or elsewhere (optional)"},"errors":{"required":"Required","website":"Enter a valid URL"},"noteDescription":{"pre":"Submit your library to be included in the ","link":"public library repository","post":"for other people to use in their drawings."},"noteGuidelines":{"pre":"The library needs to be manually approved first. Please read the ","link":"guidelines","post":" before submitting. You will need a GitHub account to communicate and make changes if requested, but it is not strictly required."},"noteLicense":{"pre":"By submitting, you agree the library will be published under the ","link":"MIT License, ","post":"which in short means anyone can use them without restrictions."},"noteItems":"Each library item must have its own name so it\'s filterable. The following library items will be included:","atleastOneLibItem":"Please select at least one library item to get started"},"publishSuccessDialog":{"title":"Library submitted","content":"Thank you {{authorName}}. Your library has been submitted for review. You can track the status","link":"here"},"confirmDialog":{"resetLibrary":"Reset library","removeItemsFromLib":"Remove selected items from library"},"encrypted":{"tooltip":"Your drawings are end-to-end encrypted so Excalidraw\'s servers will never see them.","link":"Blog post on end-to-end encryption in Excalidraw"},"stats":{"angle":"Angle","element":"Element","elements":"Elements","height":"Height","scene":"Scene","selected":"Selected","storage":"Storage","title":"Stats for nerds","total":"Total","version":"Version","versionCopy":"Click to copy","versionNotAvailable":"Version not available","width":"Width"},"toast":{"addedToLibrary":"Added to library","copyStyles":"Copied styles.","copyToClipboard":"Copied to clipboard.","copyToClipboardAsPng":"Copied {{exportSelection}} to clipboard as PNG\\n({{exportColorScheme}})","fileSaved":"File saved.","fileSavedToFilename":"Saved to {filename}","canvas":"canvas","selection":"selection"},"colors":{"495057":"Gray 7","ffffff":"White","f8f9fa":"Gray 0","f1f3f5":"Gray 1","fff5f5":"Red 0","fff0f6":"Pink 0","f8f0fc":"Grape 0","f3f0ff":"Violet 0","edf2ff":"Indigo 0","e7f5ff":"Blue 0","e3fafc":"Cyan 0","e6fcf5":"Teal 0","ebfbee":"Green 0","f4fce3":"Lime 0","fff9db":"Yellow 0","fff4e6":"Orange 0","transparent":"Transparent","ced4da":"Gray 4","868e96":"Gray 6","fa5252":"Red 6","e64980":"Pink 6","be4bdb":"Grape 6","7950f2":"Violet 6","4c6ef5":"Indigo 6","228be6":"Blue 6","15aabf":"Cyan 6","12b886":"Teal 6","40c057":"Green 6","82c91e":"Lime 6","fab005":"Yellow 6","fd7e14":"Orange 6","000000":"Black","343a40":"Gray 8","c92a2a":"Red 9","a61e4d":"Pink 9","862e9c":"Grape 9","5f3dc4":"Violet 9","364fc7":"Indigo 9","1864ab":"Blue 9","0b7285":"Cyan 9","087f5b":"Teal 9","2b8a3e":"Green 9","5c940d":"Lime 9","e67700":"Yellow 9","d9480f":"Orange 9"}}')},4451:function(e){e.exports=JSON.parse('{"ar-SA":88,"bg-BG":61,"bn-BD":0,"ca-ES":95,"cs-CZ":24,"da-DK":16,"de-DE":99,"el-GR":87,"en":100,"es-ES":84,"eu-ES":96,"fa-IR":63,"fi-FI":98,"fr-FR":100,"he-IL":80,"hi-IN":55,"hu-HU":49,"id-ID":100,"it-IT":96,"ja-JP":98,"kab-KAB":95,"kk-KZ":23,"ko-KR":72,"lt-LT":24,"lv-LV":100,"my-MM":46,"nb-NO":100,"nl-NL":90,"nn-NO":83,"oc-FR":97,"pa-IN":87,"pl-PL":93,"pt-BR":98,"pt-PT":83,"ro-RO":100,"ru-RU":99,"si-LK":9,"sk-SK":100,"sv-SE":100,"ta-IN":99,"tr-TR":85,"uk-UA":82,"zh-CN":100,"zh-HK":28,"zh-TW":100}')}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={id:e,loaded:!1,exports:{}};return o[e].call(n.exports,n,n.exports,a),n.loaded=!0,n.exports}return a.m=o,a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,{a:t}),t},t=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},a.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var o=Object.create(null);a.r(o);var i={};e=e||[null,t({}),t([]),t(t)];for(var l=2&r&&n;"object"==typeof l&&!~e.indexOf(l);l=t(l))Object.getOwnPropertyNames(l).forEach((function(e){i[e]=function(){return n[e]}}));return i.default=function(){return n},a.d(o,i),o},a.d=function(e,t){for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.f={},a.e=function(e){return Promise.all(Object.keys(a.f).reduce((function(t,n){return a.f[n](e,t),t}),[]))},a.u=function(e){return"excalidraw-assets/"+{9:"i18n-zh-HK-json",43:"i18n-de-DE-json",58:"i18n-lt-LT-json",60:"i18n-ko-KR-json",62:"i18n-zh-TW-json",90:"i18n-si-LK-json",137:"i18n-ja-JP-json",149:"i18n-pt-PT-json",164:"i18n-kab-KAB-json",196:"i18n-nl-NL-json",213:"i18n-tr-TR-json",242:"i18n-my-MM-json",246:"i18n-nb-NO-json",262:"i18n-he-IL-json",280:"i18n-pa-IN-json",304:"i18n-zh-CN-json",317:"i18n-es-ES-json",351:"i18n-ca-ES-json",364:"i18n-fr-FR-json",381:"i18n-pt-BR-json",384:"i18n-bg-BG-json",387:"i18n-cs-CZ-json",395:"i18n-ta-IN-json",401:"i18n-sk-SK-json",431:"i18n-eu-ES-json",465:"i18n-it-IT-json",472:"i18n-fi-FI-json",491:"i18n-id-ID-json",499:"image",526:"i18n-el-GR-json",558:"i18n-ar-SA-json",565:"i18n-oc-FR-json",583:"i18n-uk-UA-json",603:"i18n-bn-BD-json",617:"i18n-da-DK-json",649:"i18n-kk-KZ-json",661:"i18n-hu-HU-json",698:"i18n-sv-SE-json",710:"i18n-fa-IR-json",736:"vendor",752:"i18n-ro-RO-json",852:"i18n-pl-PL-json",869:"i18n-ru-RU-json",899:"i18n-lv-LV-json",920:"i18n-nn-NO-json",933:"i18n-hi-IN-json"}[e]+"-"+{9:"30c36c8fd961f5d170f3",43:"ef380f64f6865954b0a8",58:"999644c6901ba293b94f",60:"8cb8265529a1b44b5b83",62:"b98625b888d1a38a1e35",90:"0168ba04309e69acf8f8",137:"d393424a3bf3d819c55c",149:"51f59b1e2263211ec93f",164:"b6e3fb72b894c32d880b",196:"ac240a29fc28abe04b68",213:"a5403d611da049fb9ac9",242:"f113e0d4e325f2ab5f9a",246:"a68ef171ead03e41a3fc",262:"46098f880b56c784c524",280:"fd72f5acaf54acdf92f4",304:"bf2622c18de40b872772",317:"2a7c2aedd8e0e11c0ffd",351:"49c237f0386f487f2b89",364:"c4a47fdc6828648bcc0b",381:"c33f3d7e5ced5fa875da",384:"e4675485be70db3d505b",387:"18e06cddb62be71241bc",395:"028cb3ff5436242bfe93",401:"689a542868cd8bf55c8f",431:"2b70c65af4801826fd81",465:"353b67282442ff113ca5",472:"d1b98e036e0c311a5f94",491:"a56030455c18e20fc460",499:"b76d879db8316c30fd0d",526:"ced6e4a724987ebc00c3",558:"d46c8f24fe4ef43f1ba6",565:"032cf6f52e5c1fde7146",583:"574637d179e2f430e9cd",603:"a74dc358f3c11e1f2eda",617:"ae94ab97dbff85f9a6a5",649:"0c61810ca218a4a849ab",661:"be46128b9fe090bd2727",698:"b487a1452d9e8cc95e99",710:"ca6c7d3370106a46c722",736:"41e5c0be76c29ad2aba4",752:"db4d695c50423ea348a2",852:"c4f01f39d882bac94426",869:"9c2f8157732f9cfd998c",899:"3d721192be0e9e91d53a",920:"6b400c9d969d9b00957f",933:"0abea31b70b913ab7137"}[e]+".js"},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n={},r="Excalidraw:",a.l=function(e,t,o,i){if(n[e])n[e].push(t);else{var l,s;if(void 0!==o)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var d=c[u];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==r+o){l=d;break}}l||(s=!0,(l=document.createElement("script")).charset="utf-8",l.timeout=120,a.nc&&l.setAttribute("nonce",a.nc),l.setAttribute("data-webpack",r+o),l.src=e),n[e]=[t];var f=function(t,r){l.onerror=l.onload=null,clearTimeout(p);var o=n[e];if(delete n[e],l.parentNode&&l.parentNode.removeChild(l),o&&o.forEach((function(e){return e(r)})),t)return t(r)},p=setTimeout(f.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=f.bind(null,l.onerror),l.onload=f.bind(null,l.onload),s&&document.head.appendChild(l)}},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},a.p="",function(){a.b=document.baseURI||self.location.href;var e={388:0};a.f.j=function(t,n){var r=a.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise((function(n,o){r=e[t]=[n,o]}));n.push(r[2]=o);var i=a.p+a.u(t),l=new Error;a.l(i,(function(n){if(a.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;l.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",l.name="ChunkLoadError",l.type=o,l.request=i,r[1](l)}}),"chunk-"+t,t)}};var t=function(t,n){var r,o,i=n[0],l=n[1],s=n[2],c=0;if(i.some((function(t){return 0!==e[t]}))){for(r in l)a.o(l,r)&&(a.m[r]=l[r]);s&&s(a)}for(t&&t(n);c<i.length;c++)o=i[c],a.o(e,o)&&e[o]&&e[o][0](),e[i[c]]=0},n=self.webpackChunkExcalidraw=self.webpackChunkExcalidraw||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}(),a(7314)}()),w.exports=k.exports;var E=w.exports;function _({elements:t,imageContainerRef:r,appState:o=null,rootClassName:i=null}){var a;const[l,s]=e.exports.useState(null);return e.exports.useEffect((()=>{(async()=>{const e=await w.exports.exportToSvg({elements:t,files:null});(e=>{var t;const n=null==(t=null==e?void 0:e.firstElementChild)?void 0:t.firstElementChild,r=e.getAttribute("viewBox");if(null!=r){const t=r.split(" ");e.setAttribute("width",t[2]),e.setAttribute("height",t[3])}n&&"style"===n.tagName&&n.remove()})(e),e.setAttribute("width","100%"),e.setAttribute("height","100%"),e.setAttribute("display","block"),s(e)})()}),[t,o]),n("div",{ref:r,className:null!=i?i:"",dangerouslySetInnerHTML:{__html:null!=(a=null==l?void 0:l.outerHTML)?a:""}})}function S({closeOnClickOutside:a=!1,onSave:l,initialElements:s,isShown:c=!1,onDelete:u}){const d=e.exports.useRef(null),[f,p]=e.exports.useState(!1),[h,m]=e.exports.useState(s);e.exports.useEffect((()=>{null!==d.current&&d.current.focus()}),[]),e.exports.useEffect((()=>{var e;let t=null;const n=e=>{const t=e.target;null!==d.current&&!d.current.contains(t)&&a&&u()};return null!==d.current&&(t=null==(e=d.current)?void 0:e.parentElement,null!==t&&(null==t||t.addEventListener("click",n))),()=>{null!==t&&(null==t||t.removeEventListener("click",n))}}),[a,u]),e.exports.useLayoutEffect((()=>{const e=d.current,t=e=>{"Escape"===e.key&&u()};return null!==e&&e.addEventListener("keydown",t),()=>{null!==e&&e.removeEventListener("keydown",t)}}),[h,u]);function g(){return r(o,{title:"Discard",onClose:()=>{p(!1)},closeOnClickOutside:!0,children:["Are you sure you want to discard the changes?",r("div",{className:"ExcalidrawModal__discardModal",children:[n(i,{onClick:()=>{p(!1),u()},children:"Discard"})," ",n(i,{onClick:()=>{p(!1)},children:"Cancel"})]})]})}if(!1===c)return null;const v=null!=E.$$typeof?E:E.default;return t.exports.createPortal(n("div",{className:"ExcalidrawModal__overlay",role:"dialog",children:n("div",{className:"ExcalidrawModal__modal",ref:d,tabIndex:-1,children:r("div",{className:"ExcalidrawModal__row",children:[f&&n(g,{}),n(v,{onChange:e=>{m(e)},initialData:{appState:{isLoading:!1},elements:s}}),r("div",{className:"ExcalidrawModal__actions",children:[n("button",{className:"action-button",onClick:()=>{0===h.filter((e=>!e.isDeleted)).length?u():p(!0)},children:"Discard"}),n("button",{className:"action-button",onClick:()=>{h.filter((e=>!e.isDeleted)).length>0?l(h):u()},children:"Save"})]})]})})}),document.body)}function C({nodeKey:t,data:o}){const[i]=a(),[y,x]=e.exports.useState("[]"===o&&i.isEditable()),w=e.exports.useRef(null),k=e.exports.useRef(null),E=e.exports.useRef(null),[C,j,O]=l(t),[I,M]=e.exports.useState(!1),T=e.exports.useCallback((e=>(C&&s(c())&&(e.preventDefault(),i.update((()=>{const e=u(t);d(e)&&e.remove(),j(!1)}))),!1)),[i,C,t,j]);e.exports.useEffect((()=>{y?i.setEditable(!1):i.setEditable(!0)}),[y,i]),e.exports.useEffect((()=>f(i.registerCommand(p,(e=>{const t=k.current,n=e.target;return!!I||!(null===t||!t.contains(n))&&(e.shiftKey||O(),j(!C),e.detail>1&&x(!0),!0)}),h),i.registerCommand(m,T,h),i.registerCommand(g,T,h))),[O,i,C,I,T,j]);const P=e.exports.useCallback((()=>(x(!1),i.update((()=>{const e=u(t);d(e)&&e.remove()})))),[i,t]),A=e.exports.useMemo((()=>JSON.parse(o)),[o]);return r(v,{children:[n(S,{initialElements:A,isShown:y,onDelete:P,onSave:e=>{i.setEditable(!0),(e=>{if(i.isEditable())i.update((()=>{const n=u(t);d(n)&&(e.length>0?n.setData(JSON.stringify(e)):n.remove())}))})(e),x(!1)},closeOnClickOutside:!0}),A.length>0&&r("button",{ref:k,className:"excalidraw-button "+(C?"selected":""),children:[n(_,{imageContainerRef:w,className:"image",elements:A}),(C||I)&&n(b,{buttonRef:E,showCaption:!0,setShowCaption:()=>null,imageRef:w,editor:i,onResizeStart:()=>{M(!0)},onResizeEnd:()=>{setTimeout((()=>{M(!1)}),200)},captionsEnabled:!0})]})]})}export{C as default};