@excalidraw/common 0.18.0-c141960 → 0.18.0-c158187

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 (175) hide show
  1. package/dist/dev/index.js +1070 -10
  2. package/dist/dev/index.js.map +4 -4
  3. package/dist/prod/index.js +3 -3
  4. package/dist/types/common/src/bounds.d.ts +10 -0
  5. package/dist/types/common/src/colors.d.ts +5 -2
  6. package/dist/types/common/src/constants.d.ts +14 -12
  7. package/dist/types/common/src/font-metadata.d.ts +1 -3
  8. package/dist/types/common/src/index.d.ts +1 -0
  9. package/dist/types/common/src/keys.d.ts +1 -1
  10. package/dist/types/common/src/utility-types.d.ts +0 -1
  11. package/dist/types/common/src/utils.d.ts +44 -34
  12. package/dist/types/common/src/visualdebug.d.ts +1 -1
  13. package/dist/types/element/src/Scene.d.ts +4 -4
  14. package/dist/types/element/src/binding.d.ts +6 -4
  15. package/dist/types/element/src/bounds.d.ts +2 -10
  16. package/dist/types/element/src/collision.d.ts +2 -2
  17. package/dist/types/element/src/comparisons.d.ts +7 -7
  18. package/dist/types/element/src/dragElements.d.ts +3 -3
  19. package/dist/types/element/src/duplicate.d.ts +3 -3
  20. package/dist/types/element/src/fractionalIndex.d.ts +2 -2
  21. package/dist/types/element/src/frame.d.ts +7 -3
  22. package/dist/types/element/src/heading.d.ts +2 -1
  23. package/dist/types/element/src/image.d.ts +1 -11
  24. package/dist/types/element/src/index.d.ts +1 -0
  25. package/dist/types/element/src/linearElementEditor.d.ts +1 -2
  26. package/dist/types/element/src/mutateElement.d.ts +3 -1
  27. package/dist/types/element/src/newElement.d.ts +6 -6
  28. package/dist/types/element/src/renderElement.d.ts +0 -6
  29. package/dist/types/element/src/resizeElements.d.ts +10 -10
  30. package/dist/types/element/src/resizeTest.d.ts +1 -1
  31. package/dist/types/element/src/selection.d.ts +3 -7
  32. package/dist/types/element/src/shape.d.ts +8 -7
  33. package/dist/types/element/src/textMeasurements.d.ts +1 -3
  34. package/dist/types/{excalidraw/data → element/src}/transform.d.ts +3 -3
  35. package/dist/types/element/src/transformHandles.d.ts +3 -23
  36. package/dist/types/element/src/typeChecks.d.ts +2 -4
  37. package/dist/types/element/src/utils.d.ts +3 -1
  38. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +114 -178
  39. package/dist/types/excalidraw/actions/actionAlign.d.ts +0 -1
  40. package/dist/types/excalidraw/actions/actionBoundText.d.ts +44 -87
  41. package/dist/types/excalidraw/actions/actionCanvas.d.ts +263 -510
  42. package/dist/types/excalidraw/actions/actionClipboard.d.ts +85 -128
  43. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +21 -43
  44. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +74 -142
  45. package/dist/types/excalidraw/actions/actionDistribute.d.ts +0 -1
  46. package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +2 -3
  47. package/dist/types/excalidraw/actions/actionElementLink.d.ts +41 -63
  48. package/dist/types/excalidraw/actions/actionElementLock.d.ts +45 -88
  49. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +41 -63
  50. package/dist/types/excalidraw/actions/actionExport.d.ts +85 -170
  51. package/dist/types/excalidraw/actions/actionFinalize.d.ts +1 -2
  52. package/dist/types/excalidraw/actions/actionFlip.d.ts +0 -1
  53. package/dist/types/excalidraw/actions/actionFrame.d.ts +208 -329
  54. package/dist/types/excalidraw/actions/actionGroup.d.ts +48 -99
  55. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +149 -207
  56. package/dist/types/excalidraw/actions/actionLink.d.ts +43 -65
  57. package/dist/types/excalidraw/actions/actionMenu.d.ts +35 -57
  58. package/dist/types/excalidraw/actions/actionNavigate.d.ts +14 -17
  59. package/dist/types/excalidraw/actions/actionProperties.d.ts +59 -102
  60. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +24 -50
  61. package/dist/types/excalidraw/actions/actionStyles.d.ts +20 -42
  62. package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +3 -3
  63. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +41 -63
  64. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +41 -63
  65. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +35 -57
  66. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +40 -62
  67. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +41 -63
  68. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +41 -63
  69. package/dist/types/excalidraw/actions/actionZindex.d.ts +8 -9
  70. package/dist/types/excalidraw/actions/manager.d.ts +1 -1
  71. package/dist/types/excalidraw/actions/register.d.ts +2 -2
  72. package/dist/types/excalidraw/appState.d.ts +12 -12
  73. package/dist/types/excalidraw/clipboard.d.ts +7 -31
  74. package/dist/types/excalidraw/components/Actions.d.ts +1 -1
  75. package/dist/types/excalidraw/components/App.d.ts +32 -40
  76. package/dist/types/excalidraw/components/Card.d.ts +0 -1
  77. package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +7 -4
  78. package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +0 -1
  79. package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +0 -1
  80. package/dist/types/excalidraw/components/CommandPalette/types.d.ts +0 -1
  81. package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +2 -2
  82. package/dist/types/excalidraw/components/DarkModeToggle.d.ts +1 -1
  83. package/dist/types/excalidraw/components/DefaultSidebar.d.ts +9 -13
  84. package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +1 -1
  85. package/dist/types/excalidraw/components/Ellipsify.d.ts +1 -2
  86. package/dist/types/excalidraw/components/ErrorDialog.d.ts +1 -1
  87. package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +0 -1
  88. package/dist/types/excalidraw/components/EyeDropper.d.ts +0 -1
  89. package/dist/types/excalidraw/components/FontPicker/keyboardNavHandlers.d.ts +0 -1
  90. package/dist/types/excalidraw/components/HelpDialog.d.ts +1 -1
  91. package/dist/types/excalidraw/components/InlineIcon.d.ts +2 -2
  92. package/dist/types/excalidraw/components/LibraryMenuControlButtons.d.ts +1 -1
  93. package/dist/types/excalidraw/components/LibraryMenuHeaderContent.d.ts +1 -2
  94. package/dist/types/excalidraw/components/LibraryUnit.d.ts +2 -3
  95. package/dist/types/excalidraw/components/LoadingMessage.d.ts +0 -1
  96. package/dist/types/excalidraw/components/MobileToolBar.d.ts +0 -1
  97. package/dist/types/excalidraw/components/Modal.d.ts +0 -1
  98. package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirm.d.ts +1 -1
  99. package/dist/types/excalidraw/components/RadioGroup.d.ts +0 -1
  100. package/dist/types/excalidraw/components/RadioSelection.d.ts +4 -4
  101. package/dist/types/excalidraw/components/ScrollableList.d.ts +0 -1
  102. package/dist/types/excalidraw/components/Sidebar/Sidebar.d.ts +15 -21
  103. package/dist/types/excalidraw/components/Sidebar/SidebarHeader.d.ts +1 -1
  104. package/dist/types/excalidraw/components/Sidebar/SidebarTab.d.ts +1 -2
  105. package/dist/types/excalidraw/components/Sidebar/SidebarTabTrigger.d.ts +1 -2
  106. package/dist/types/excalidraw/components/Sidebar/SidebarTabTriggers.d.ts +1 -2
  107. package/dist/types/excalidraw/components/Sidebar/SidebarTabs.d.ts +1 -2
  108. package/dist/types/excalidraw/components/Spinner.d.ts +4 -4
  109. package/dist/types/excalidraw/components/Stats/CanvasGrid.d.ts +0 -1
  110. package/dist/types/excalidraw/components/Stats/Collapsible.d.ts +0 -1
  111. package/dist/types/excalidraw/components/Stats/DragInput.d.ts +0 -1
  112. package/dist/types/excalidraw/components/Stats/index.d.ts +7 -8
  113. package/dist/types/excalidraw/components/TTDDialog/TTDDialog.d.ts +1 -2
  114. package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +0 -1
  115. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTab.d.ts +1 -2
  116. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTrigger.d.ts +1 -2
  117. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTriggers.d.ts +1 -2
  118. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +1 -1
  119. package/dist/types/excalidraw/components/TTDDialog/common.d.ts +2 -3
  120. package/dist/types/excalidraw/components/Toast.d.ts +3 -3
  121. package/dist/types/excalidraw/components/Trans.d.ts +2 -2
  122. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +28 -32
  123. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +5 -5
  124. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuGroup.d.ts +3 -3
  125. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +10 -18
  126. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContent.d.ts +3 -3
  127. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +0 -1
  128. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCustom.d.ts +2 -2
  129. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemLink.d.ts +6 -6
  130. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuTrigger.d.ts +3 -4
  131. package/dist/types/excalidraw/components/dropdownMenu/common.d.ts +1 -1
  132. package/dist/types/excalidraw/components/hoc/withInternalFallback.d.ts +1 -1
  133. package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +1 -1
  134. package/dist/types/excalidraw/components/icons.d.ts +11 -11
  135. package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +2 -13
  136. package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +2 -2
  137. package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +26 -28
  138. package/dist/types/excalidraw/components/shapes.d.ts +1 -1
  139. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +6 -6
  140. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +15 -16
  141. package/dist/types/excalidraw/data/blob.d.ts +321 -3
  142. package/dist/types/excalidraw/data/encode.d.ts +4 -4
  143. package/dist/types/excalidraw/data/encryption.d.ts +5 -5
  144. package/dist/types/excalidraw/data/filesystem.d.ts +2 -2
  145. package/dist/types/excalidraw/data/index.d.ts +3 -3
  146. package/dist/types/excalidraw/data/json.d.ts +159 -2
  147. package/dist/types/excalidraw/data/library.d.ts +24 -9
  148. package/dist/types/excalidraw/data/restore.d.ts +25 -10
  149. package/dist/types/excalidraw/editor-jotai.d.ts +11 -11
  150. package/dist/types/excalidraw/hooks/useOutsideClick.d.ts +1 -2
  151. package/dist/types/excalidraw/hooks/useScrollPosition.d.ts +1 -2
  152. package/dist/types/excalidraw/i18n.d.ts +2 -2
  153. package/dist/types/excalidraw/index.d.ts +2 -4
  154. package/dist/types/excalidraw/renderer/helpers.d.ts +6 -4
  155. package/dist/types/excalidraw/renderer/interactiveScene.d.ts +8 -6
  156. package/dist/types/excalidraw/scene/Renderer.d.ts +5 -2
  157. package/dist/types/excalidraw/scene/export.d.ts +2 -2
  158. package/dist/types/excalidraw/scene/scroll.d.ts +1 -6
  159. package/dist/types/excalidraw/scene/types.d.ts +7 -2
  160. package/dist/types/excalidraw/snapping.d.ts +5 -5
  161. package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-bindings.d.ts +1 -1
  162. package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-loader.d.ts +1 -1
  163. package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-wasm.d.ts +1 -1
  164. package/dist/types/excalidraw/subset/woff2/woff2-loader.d.ts +2 -2
  165. package/dist/types/excalidraw/subset/woff2/woff2-wasm.d.ts +1 -1
  166. package/dist/types/excalidraw/types.d.ts +1 -1
  167. package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +2 -2
  168. package/dist/types/math/src/polygon.d.ts +2 -2
  169. package/dist/types/math/src/range.d.ts +1 -3
  170. package/dist/types/math/src/segment.d.ts +3 -3
  171. package/dist/types/utils/src/bbox.d.ts +1 -1
  172. package/dist/types/utils/src/export.d.ts +5 -5
  173. package/dist/types/utils/src/shape.d.ts +6 -6
  174. package/dist/types/utils/src/withinBounds.d.ts +2 -2
  175. package/package.json +7 -1
@@ -1,4 +1,4 @@
1
- var we=Object.create;var $=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var Pe=Object.getOwnPropertyNames;var Ce=Object.getPrototypeOf,De=Object.prototype.hasOwnProperty;var Ue=(e,t)=>()=>(e&&(t=e(e=0)),t);var j=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ne=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Pe(t))!De.call(e,r)&&r!==n&&$(e,r,{get:()=>t[r],enumerable:!(o=Ie(t,r))||o.enumerable});return e};var Q=(e,t,n)=>(n=e!=null?we(Ce(e)):{},Ne(t||!e||!e.__esModule?$(n,"default",{value:e,enumerable:!0}):n,e));var f,c=Ue(()=>{f={PROD:!0}});var Ee=j((Y,Te)=>{c();(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof Y=="object"?Te.exports=t():(e.PromisePool=t(),e.promisePool=e.PromisePool)})(Y,function(){"use strict";var e=function(){this._listeners={}};e.prototype.addEventListener=function(s,i){this._listeners[s]=this._listeners[s]||[],this._listeners[s].indexOf(i)<0&&this._listeners[s].push(i)},e.prototype.removeEventListener=function(s,i){if(this._listeners[s]){var p=this._listeners[s].indexOf(i);p>=0&&this._listeners[s].splice(p,1)}},e.prototype.dispatchEvent=function(s){if(this._listeners[s.type]&&this._listeners[s.type].length)for(var i=this._listeners[s.type].slice(),p=0,E=i.length;p<E;++p)i[p].call(this,s)};var t=function(s){return typeof s.constructor=="function"&&s.constructor.name==="GeneratorFunction"},n=function(s){return{next:function(){var i=s();return i?{value:i}:{done:!0}}}},o=function(s){var i=!1;return{next:function(){return i?{done:!0}:(i=!0,{value:s})}}},r=function(s,i){var p=typeof s;if(p==="object"){if(typeof s.next=="function")return s;if(typeof s.then=="function")return o(s)}return p==="function"?t(s)?s():n(s):o(i.resolve(s))},l=function(s,i,p){this.target=s,this.type=i,this.data=p},a=function(s,i,p){if(e.call(this),typeof i!="number"||Math.floor(i)!==i||i<1)throw new Error("Invalid concurrency");this._concurrency=i,this._options=p||{},this._options.promise=this._options.promise||Promise,this._iterator=r(s,this._options.promise),this._done=!1,this._size=0,this._promise=null,this._callbacks=null};return a.prototype=new e,a.prototype.constructor=a,a.prototype.concurrency=function(s){return typeof s<"u"&&(this._concurrency=s,this.active()&&this._proceed()),this._concurrency},a.prototype.size=function(){return this._size},a.prototype.active=function(){return!!this._promise},a.prototype.promise=function(){return this._promise},a.prototype.start=function(){var s=this,i=this._options.promise;return this._promise=new i(function(p,E){s._callbacks={reject:E,resolve:p},s._proceed()}),this._promise},a.prototype._fireEvent=function(s,i){this.dispatchEvent(new l(this,s,i))},a.prototype._settle=function(s){s?this._callbacks.reject(s):this._callbacks.resolve(),this._promise=null,this._callbacks=null},a.prototype._onPooledPromiseFulfilled=function(s,i){this._size--,this.active()&&(this._fireEvent("fulfilled",{promise:s,result:i}),this._proceed())},a.prototype._onPooledPromiseRejected=function(s,i){this._size--,this.active()&&(this._fireEvent("rejected",{promise:s,error:i}),this._settle(i||new Error("Unknown error")))},a.prototype._trackPromise=function(s){var i=this;s.then(function(p){i._onPooledPromiseFulfilled(s,p)},function(p){i._onPooledPromiseRejected(s,p)}).catch(function(p){i._settle(new Error("Promise processing failed: "+p))})},a.prototype._proceed=function(){if(!this._done){for(var s={done:!1};this._size<this._concurrency&&!(s=this._iterator.next()).done;)this._size++,this._trackPromise(s.value);this._done=s===null||!!s.done}this._done&&this._size===0&&this._settle()},a.PromisePoolEvent=l,a.PromisePool=a,a})});var Re=j(k=>{"use strict";c();Object.defineProperty(k,"__esModule",{value:!0});k.sanitizeUrl=void 0;var Tt=/^([^\w]*)(javascript|data|vbscript)/im,Et=/&#(\w+)(^\w|;)?/g,xt=/&(newline|tab);/gi,bt=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,_t=/^.+(:|&colon;)/gim,At=[".","/"];function ht(e){return At.indexOf(e[0])>-1}function yt(e){return e.replace(Et,function(t,n){return String.fromCharCode(n)})}function gt(e){var t=yt(e||"").replace(xt,"").replace(bt,"").trim();if(!t)return"about:blank";if(ht(t))return t;var n=t.match(_t);if(!n)return t;var o=n[0];return Tt.test(o)?"about:blank":t}k.sanitizeUrl=gt});c();c();var Z=class{constructor(t){this.scoreFunction=t}content=[];sinkDown(t){let n=this.content[t],o=this.scoreFunction(n);for(;t>0;){let r=(t+1>>1)-1,l=this.content[r];if(o<this.scoreFunction(l))this.content[t]=l,t=r;else break}this.content[t]=n}bubbleUp(t){let n=this.content.length,o=this.content[t],r=this.scoreFunction(o);for(;;){let l=(t+1<<1)-1,a=l+1,s=t,i=r;if(l<n){let p=this.scoreFunction(this.content[l]);p<i&&(s=l,i=p)}if(a<n&&this.scoreFunction(this.content[a])<i&&(s=a),s===t)break;this.content[t]=this.content[s],t=s}this.content[t]=o}push(t){this.content.push(t),this.sinkDown(this.content.length-1)}pop(){if(this.content.length===0)return null;let t=this.content[0],n=this.content.pop();return this.content.length>0&&(this.content[0]=n,this.bubbleUp(0)),t}remove(t){if(this.content.length===0)return;let n=this.content.indexOf(t),o=this.content.pop();n<this.content.length&&(this.content[n]=o,this.scoreFunction(o)<this.scoreFunction(t)?this.sinkDown(n):this.bubbleUp(n))}size(){return this.content.length}rescoreElement(t){this.sinkDown(this.content.indexOf(t))}};c();var q={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"]};var Ct=240,Ge=(e,t)=>t.reduce((n,o)=>(o in e&&(n[o]=e[o]),n),{}),Dt=5,Ut=5,Nt=4,I=4,P=1,x=[0,2,4,6,8],kt=[0,1,2,3,4],b=(e,t)=>t.map(n=>q[e][n]),u={transparent:"transparent",black:"#1e1e1e",white:"#ffffff",gray:b("gray",x),red:b("red",x),pink:b("pink",x),grape:b("grape",x),violet:b("violet",x),blue:b("blue",x),cyan:b("cyan",x),teal:b("teal",x),green:b("green",x),yellow:b("yellow",x),orange:b("orange",x),bronze:["#f8f1ee","#eaddd7","#d2bab0","#a18072","#846358"]},J=Ge(u,["cyan","blue","violet","grape","pink","green","teal","yellow","orange","red"]),Ht=[u.black,u.red[I],u.green[I],u.blue[I],u.yellow[I]],Gt=[u.transparent,u.red[P],u.green[P],u.blue[P],u.yellow[P]],Bt=[u.white,"#f8f9fa","#f5faff","#fffce8","#fdf8f6"],Kt={transparent:u.transparent,white:u.white,gray:u.gray,black:u.black,bronze:u.bronze,...J},Wt={transparent:u.transparent,white:u.white,gray:u.gray,black:u.black,bronze:u.bronze,...J},Yt=e=>[u.cyan[e],u.blue[e],u.violet[e],u.grape[e],u.pink[e],u.green[e],u.teal[e],u.yellow[e],u.orange[e],u.red[e]],Xt=(e,t,n)=>`#${((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)}`;c();var jt=typeof window<"u"&&"ResizeObserver"in window,Qt="Excalidraw",Zt=36,qt=10,Jt=20,en=8,tn=5,nn=1,on=30,rn=Math.PI/12,sn="red",an={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},ln={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1,ERASER:5},cn={enabled:"all",disabled:"none",inheritFromUI:"var(--ui-pointerEvents)"},Be=(d=>(d.COPY="copy",d.PASTE="paste",d.CUT="cut",d.KEYDOWN="keydown",d.KEYUP="keyup",d.MOUSE_MOVE="mousemove",d.RESIZE="resize",d.UNLOAD="unload",d.FOCUS="focus",d.BLUR="blur",d.DRAG_OVER="dragover",d.DROP="drop",d.GESTURE_END="gestureend",d.BEFORE_UNLOAD="beforeunload",d.GESTURE_START="gesturestart",d.GESTURE_CHANGE="gesturechange",d.POINTER_MOVE="pointermove",d.POINTER_DOWN="pointerdown",d.POINTER_UP="pointerup",d.STATE_CHANGE="statechange",d.WHEEL="wheel",d.TOUCH_START="touchstart",d.TOUCH_END="touchend",d.HASHCHANGE="hashchange",d.VISIBILITY_CHANGE="visibilitychange",d.SCROLL="scroll",d.EXCALIDRAW_LINK="excalidraw-link",d.MENU_ITEM_SELECT="menu.itemSelect",d.MESSAGE="message",d.FULLSCREENCHANGE="fullscreenchange",d))(Be||{}),un={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5},C={TEST:"test",DEVELOPMENT:"development",PRODUCTION:"production"},pn={SIDEBAR:"sidebar",SHAPE_ACTIONS_MENU:"App-menu__left",ZOOM_ACTIONS:"zoom-actions",SEARCH_MENU_INPUT_WRAPPER:"layer-ui__search-inputWrapper",CONVERT_ELEMENT_TYPE_POPUP:"ConvertElementTypePopup",SHAPE_ACTIONS_THEME_SCOPE:"shape-actions-theme-scope",FRAME_NAME:"frame-name"},te="Xiaolai",R="Segoe UI Emoji",m={Virgil:1,Helvetica:2,Cascadia:3,Excalifont:5,Nunito:6,"Lilita One":7,"Comic Shanns":8,"Liberation Sans":9,Assistant:10},ne="sans-serif",oe="monospace",Ke={[ne]:998,[oe]:999},W={[te]:100,...Ke,[R]:1e3};function We(e){switch(e){case m.Cascadia:case m["Comic Shanns"]:return oe;default:return ne}}var re=e=>{let t=We(e);switch(e){case m.Excalifont:return[te,t,R];default:return[t,R]}},dn={LIGHT:"light",DARK:"dark"},fn={strokeColor:"#bbb",strokeWidth:2,strokeStyle:"solid",fillStyle:"solid",roughness:0,roundness:null,backgroundColor:"transparent",radius:8,nameOffsetY:3,nameColorLightTheme:"#999999",nameColorDarkTheme:"#7a7a7a",nameFontSize:14,nameLineHeight:1.25},mn=1,Tn=20,En=m.Excalifont,xn="left",bn="top",se="{version}",Ye=2,Xe=2*Ye,ze=1e-5,_n=2*Xe-ze,An="#ffffff",hn="#1e1e1e",yn="#a2f1a6",gn=["selectAll"],Sn=20,Ln=5,ae={svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",ico:"image/x-icon",avif:"image/avif",jfif:"image/jfif"},Ve={text:"text/plain",html:"text/html",json:"application/json",excalidraw:"application/vnd.excalidraw+json",excalidrawlib:"application/vnd.excalidrawlib+json",excalidrawlibIds:"application/vnd.excalidrawlib.ids+json"},ee={...Ve,"excalidraw.svg":"image/svg+xml","excalidraw.png":"image/png",binary:"application/octet-stream",...ae},On=[ee.text,ee.html,...Object.values(ae)],Rn={png:"png",svg:"svg",clipboard:"clipboard"},vn={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawLibrary:"excalidrawlib",excalidrawClipboardWithAPI:"excalidraw-api/clipboard"},Fn=()=>window.EXCALIDRAW_EXPORT_SOURCE||window.location.origin,Mn=500,wn=300,In=500,Pn=1e4,Cn=3e4,Dn=100,Un=.1,Nn=.1,kn=30,Hn=300,Gn=6e4,Bn=3e3,Kn="invert(93%) hue-rotate(180deg)",Wn={addLibrary:"addLibrary"},Yn={addLibrary:"addLibrary"},Xn={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,toggleTheme:null,saveAsImage:!0},tools:{image:!0}},zn=2,Vn=[1,2,3],$n=10,jn=1440,Qn=4*1024*1024,Zn="http://www.w3.org/2000/svg",qn=`<?xml version="1.0" standalone="no"?>
1
+ var Qe=Object.create;var ae=Object.defineProperty;var Je=Object.getOwnPropertyDescriptor;var et=Object.getOwnPropertyNames;var tt=Object.getPrototypeOf,nt=Object.prototype.hasOwnProperty;var rt=(e,t)=>()=>(e&&(t=e(e=0)),t);var se=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ot=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of et(t))!nt.call(e,o)&&o!==n&&ae(e,o,{get:()=>t[o],enumerable:!(r=Je(t,o))||r.enumerable});return e};var ie=(e,t,n)=>(n=e!=null?Qe(tt(e)):{},ot(t||!e||!e.__esModule?ae(n,"default",{value:e,enumerable:!0}):n,e));var h,f=rt(()=>{h={PROD:!0}});var Ue=se((te,ke)=>{f();(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof te=="object"?ke.exports=t():(e.PromisePool=t(),e.promisePool=e.PromisePool)})(te,function(){"use strict";var e=function(){this._listeners={}};e.prototype.addEventListener=function(s,l){this._listeners[s]=this._listeners[s]||[],this._listeners[s].indexOf(l)<0&&this._listeners[s].push(l)},e.prototype.removeEventListener=function(s,l){if(this._listeners[s]){var c=this._listeners[s].indexOf(l);c>=0&&this._listeners[s].splice(c,1)}},e.prototype.dispatchEvent=function(s){if(this._listeners[s.type]&&this._listeners[s.type].length)for(var l=this._listeners[s.type].slice(),c=0,p=l.length;c<p;++c)l[c].call(this,s)};var t=function(s){return typeof s.constructor=="function"&&s.constructor.name==="GeneratorFunction"},n=function(s){return{next:function(){var l=s();return l?{value:l}:{done:!0}}}},r=function(s){var l=!1;return{next:function(){return l?{done:!0}:(l=!0,{value:s})}}},o=function(s,l){var c=typeof s;if(c==="object"){if(typeof s.next=="function")return s;if(typeof s.then=="function")return r(s)}return c==="function"?t(s)?s():n(s):r(l.resolve(s))},a=function(s,l,c){this.target=s,this.type=l,this.data=c},i=function(s,l,c){if(e.call(this),typeof l!="number"||Math.floor(l)!==l||l<1)throw new Error("Invalid concurrency");this._concurrency=l,this._options=c||{},this._options.promise=this._options.promise||Promise,this._iterator=o(s,this._options.promise),this._done=!1,this._size=0,this._promise=null,this._callbacks=null};return i.prototype=new e,i.prototype.constructor=i,i.prototype.concurrency=function(s){return typeof s<"u"&&(this._concurrency=s,this.active()&&this._proceed()),this._concurrency},i.prototype.size=function(){return this._size},i.prototype.active=function(){return!!this._promise},i.prototype.promise=function(){return this._promise},i.prototype.start=function(){var s=this,l=this._options.promise;return this._promise=new l(function(c,p){s._callbacks={reject:p,resolve:c},s._proceed()}),this._promise},i.prototype._fireEvent=function(s,l){this.dispatchEvent(new a(this,s,l))},i.prototype._settle=function(s){s?this._callbacks.reject(s):this._callbacks.resolve(),this._promise=null,this._callbacks=null},i.prototype._onPooledPromiseFulfilled=function(s,l){this._size--,this.active()&&(this._fireEvent("fulfilled",{promise:s,result:l}),this._proceed())},i.prototype._onPooledPromiseRejected=function(s,l){this._size--,this.active()&&(this._fireEvent("rejected",{promise:s,error:l}),this._settle(l||new Error("Unknown error")))},i.prototype._trackPromise=function(s){var l=this;s.then(function(c){l._onPooledPromiseFulfilled(s,c)},function(c){l._onPooledPromiseRejected(s,c)}).catch(function(c){l._settle(new Error("Promise processing failed: "+c))})},i.prototype._proceed=function(){if(!this._done){for(var s={done:!1};this._size<this._concurrency&&!(s=this._iterator.next()).done;)this._size++,this._trackPromise(s.value);this._done=s===null||!!s.done}this._done&&this._size===0&&this._settle()},i.PromisePoolEvent=a,i.PromisePool=i,i})});var $e=se($=>{"use strict";f();Object.defineProperty($,"__esModule",{value:!0});$.sanitizeUrl=void 0;var fn=/^([^\w]*)(javascript|data|vbscript)/im,dn=/&#(\w+)(^\w|;)?/g,pn=/&(newline|tab);/gi,mn=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,hn=/^.+(:|&colon;)/gim,bn=[".","/"];function gn(e){return bn.indexOf(e[0])>-1}function Tn(e){return e.replace(dn,function(t,n){return String.fromCharCode(n)})}function En(e){var t=Tn(e||"").replace(pn,"").replace(mn,"").trim();if(!t)return"about:blank";if(gn(t))return t;var n=t.match(hn);if(!n)return t;var r=n[0];return fn.test(r)?"about:blank":t}$.sanitizeUrl=En});f();f();var le=class{constructor(t){this.scoreFunction=t}content=[];sinkDown(t){let n=this.content[t],r=this.scoreFunction(n);for(;t>0;){let o=(t+1>>1)-1,a=this.content[o];if(r<this.scoreFunction(a))this.content[t]=a,t=o;else break}this.content[t]=n}bubbleUp(t){let n=this.content.length,r=this.content[t],o=this.scoreFunction(r);for(;;){let a=(t+1<<1)-1,i=a+1,s=t,l=o;if(a<n){let c=this.scoreFunction(this.content[a]);c<l&&(s=a,l=c)}if(i<n&&this.scoreFunction(this.content[i])<l&&(s=i),s===t)break;this.content[t]=this.content[s],t=s}this.content[t]=r}push(t){this.content.push(t),this.sinkDown(this.content.length-1)}pop(){if(this.content.length===0)return null;let t=this.content[0],n=this.content.pop();return this.content.length>0&&(this.content[0]=n,this.bubbleUp(0)),t}remove(t){if(this.content.length===0)return;let n=this.content.indexOf(t),r=this.content.pop();n<this.content.length&&(this.content[n]=r,this.scoreFunction(r)<this.scoreFunction(t)?this.sinkDown(n):this.bubbleUp(n))}size(){return this.content.length}rescoreElement(t){this.sinkDown(this.content.indexOf(t))}};f();var ce=e=>Array.isArray(e)&&e.length===4&&typeof e[0]=="number"&&typeof e[1]=="number"&&typeof e[2]=="number"&&typeof e[3]=="number";f();var ue={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"]};f();function B(e){"@babel/helpers - typeof";return B=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},B(e)}var it=/^\s+/,lt=/\s+$/;function u(e,t){if(e=e||"",t=t||{},e instanceof u)return e;if(!(this instanceof u))return new u(e,t);var n=ct(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}u.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),n,r,o,a,i,s;return n=t.r/255,r=t.g/255,o=t.b/255,n<=.03928?a=n/12.92:a=Math.pow((n+.055)/1.055,2.4),r<=.03928?i=r/12.92:i=Math.pow((r+.055)/1.055,2.4),o<=.03928?s=o/12.92:s=Math.pow((o+.055)/1.055,2.4),.2126*a+.7152*i+.0722*s},setAlpha:function(t){return this._a=ge(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=de(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=de(this._r,this._g,this._b),n=Math.round(t.h*360),r=Math.round(t.s*100),o=Math.round(t.v*100);return this._a==1?"hsv("+n+", "+r+"%, "+o+"%)":"hsva("+n+", "+r+"%, "+o+"%, "+this._roundA+")"},toHsl:function(){var t=fe(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=fe(this._r,this._g,this._b),n=Math.round(t.h*360),r=Math.round(t.s*100),o=Math.round(t.l*100);return this._a==1?"hsl("+n+", "+r+"%, "+o+"%)":"hsla("+n+", "+r+"%, "+o+"%, "+this._roundA+")"},toHex:function(t){return pe(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return pt(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(b(this._r,255)*100)+"%",g:Math.round(b(this._g,255)*100)+"%",b:Math.round(b(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(b(this._r,255)*100)+"%, "+Math.round(b(this._g,255)*100)+"%, "+Math.round(b(this._b,255)*100)+"%)":"rgba("+Math.round(b(this._r,255)*100)+"%, "+Math.round(b(this._g,255)*100)+"%, "+Math.round(b(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:St[pe(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var n="#"+me(this._r,this._g,this._b,this._a),r=n,o=this._gradientType?"GradientType = 1, ":"";if(t){var a=u(t);r="#"+me(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+o+"startColorstr="+n+",endColorstr="+r+")"},toString:function(t){var n=!!t;t=t||this._format;var r=!1,o=this._a<1&&this._a>=0,a=!n&&o&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return a?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return u(this.toString())},_applyModification:function(t,n){var r=t.apply(null,[this].concat([].slice.call(n)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(gt,arguments)},brighten:function(){return this._applyModification(Tt,arguments)},darken:function(){return this._applyModification(Et,arguments)},desaturate:function(){return this._applyModification(mt,arguments)},saturate:function(){return this._applyModification(ht,arguments)},greyscale:function(){return this._applyModification(bt,arguments)},spin:function(){return this._applyModification(_t,arguments)},_applyCombination:function(t,n){return t.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(At,arguments)},complement:function(){return this._applyCombination(xt,arguments)},monochromatic:function(){return this._applyCombination(vt,arguments)},splitcomplement:function(){return this._applyCombination(yt,arguments)},triad:function(){return this._applyCombination(he,[3])},tetrad:function(){return this._applyCombination(he,[4])}};u.fromRatio=function(e,t){if(B(e)=="object"){var n={};for(var r in e)e.hasOwnProperty(r)&&(r==="a"?n[r]=e[r]:n[r]=D(e[r]));e=n}return u(e,t)};function ct(e){var t={r:0,g:0,b:0},n=1,r=null,o=null,a=null,i=!1,s=!1;return typeof e=="string"&&(e=wt(e)),B(e)=="object"&&(M(e.r)&&M(e.g)&&M(e.b)?(t=ut(e.r,e.g,e.b),i=!0,s=String(e.r).substr(-1)==="%"?"prgb":"rgb"):M(e.h)&&M(e.s)&&M(e.v)?(r=D(e.s),o=D(e.v),t=dt(e.h,r,o),i=!0,s="hsv"):M(e.h)&&M(e.s)&&M(e.l)&&(r=D(e.s),a=D(e.l),t=ft(e.h,r,a),i=!0,s="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=ge(n),{ok:i,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}function ut(e,t,n){return{r:b(e,255)*255,g:b(t,255)*255,b:b(n,255)*255}}function fe(e,t,n){e=b(e,255),t=b(t,255),n=b(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),a,i,s=(r+o)/2;if(r==o)a=i=0;else{var l=r-o;switch(i=s>.5?l/(2-r-o):l/(r+o),r){case e:a=(t-n)/l+(t<n?6:0);break;case t:a=(n-e)/l+2;break;case n:a=(e-t)/l+4;break}a/=6}return{h:a,s:i,l:s}}function ft(e,t,n){var r,o,a;e=b(e,360),t=b(t,100),n=b(n,100);function i(c,p,g){return g<0&&(g+=1),g>1&&(g-=1),g<1/6?c+(p-c)*6*g:g<1/2?p:g<2/3?c+(p-c)*(2/3-g)*6:c}if(t===0)r=o=a=n;else{var s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;r=i(l,s,e+1/3),o=i(l,s,e),a=i(l,s,e-1/3)}return{r:r*255,g:o*255,b:a*255}}function de(e,t,n){e=b(e,255),t=b(t,255),n=b(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),a,i,s=r,l=r-o;if(i=r===0?0:l/r,r==o)a=0;else{switch(r){case e:a=(t-n)/l+(t<n?6:0);break;case t:a=(n-e)/l+2;break;case n:a=(e-t)/l+4;break}a/=6}return{h:a,s:i,v:s}}function dt(e,t,n){e=b(e,360)*6,t=b(t,100),n=b(n,100);var r=Math.floor(e),o=e-r,a=n*(1-t),i=n*(1-o*t),s=n*(1-(1-o)*t),l=r%6,c=[n,i,a,a,s,n][l],p=[s,n,n,i,a,a][l],g=[a,a,s,n,n,i][l];return{r:c*255,g:p*255,b:g*255}}function pe(e,t,n,r){var o=[A(Math.round(e).toString(16)),A(Math.round(t).toString(16)),A(Math.round(n).toString(16))];return r&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function pt(e,t,n,r,o){var a=[A(Math.round(e).toString(16)),A(Math.round(t).toString(16)),A(Math.round(n).toString(16)),A(Te(r))];return o&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function me(e,t,n,r){var o=[A(Te(r)),A(Math.round(e).toString(16)),A(Math.round(t).toString(16)),A(Math.round(n).toString(16))];return o.join("")}u.equals=function(e,t){return!e||!t?!1:u(e).toRgbString()==u(t).toRgbString()};u.random=function(){return u.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function mt(e,t){t=t===0?0:t||10;var n=u(e).toHsl();return n.s-=t/100,n.s=G(n.s),u(n)}function ht(e,t){t=t===0?0:t||10;var n=u(e).toHsl();return n.s+=t/100,n.s=G(n.s),u(n)}function bt(e){return u(e).desaturate(100)}function gt(e,t){t=t===0?0:t||10;var n=u(e).toHsl();return n.l+=t/100,n.l=G(n.l),u(n)}function Tt(e,t){t=t===0?0:t||10;var n=u(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),u(n)}function Et(e,t){t=t===0?0:t||10;var n=u(e).toHsl();return n.l-=t/100,n.l=G(n.l),u(n)}function _t(e,t){var n=u(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,u(n)}function xt(e){var t=u(e).toHsl();return t.h=(t.h+180)%360,u(t)}function he(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var n=u(e).toHsl(),r=[u(e)],o=360/t,a=1;a<t;a++)r.push(u({h:(n.h+a*o)%360,s:n.s,l:n.l}));return r}function yt(e){var t=u(e).toHsl(),n=t.h;return[u(e),u({h:(n+72)%360,s:t.s,l:t.l}),u({h:(n+216)%360,s:t.s,l:t.l})]}function At(e,t,n){t=t||6,n=n||30;var r=u(e).toHsl(),o=360/n,a=[u(e)];for(r.h=(r.h-(o*t>>1)+720)%360;--t;)r.h=(r.h+o)%360,a.push(u(r));return a}function vt(e,t){t=t||6;for(var n=u(e).toHsv(),r=n.h,o=n.s,a=n.v,i=[],s=1/t;t--;)i.push(u({h:r,s:o,v:a})),a=(a+s)%1;return i}u.mix=function(e,t,n){n=n===0?0:n||50;var r=u(e).toRgb(),o=u(t).toRgb(),a=n/100,i={r:(o.r-r.r)*a+r.r,g:(o.g-r.g)*a+r.g,b:(o.b-r.b)*a+r.b,a:(o.a-r.a)*a+r.a};return u(i)};u.readability=function(e,t){var n=u(e),r=u(t);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)};u.isReadable=function(e,t,n){var r=u.readability(e,t),o,a;switch(a=!1,o=Ot(n),o.level+o.size){case"AAsmall":case"AAAlarge":a=r>=4.5;break;case"AAlarge":a=r>=3;break;case"AAAsmall":a=r>=7;break}return a};u.mostReadable=function(e,t,n){var r=null,o=0,a,i,s,l;n=n||{},i=n.includeFallbackColors,s=n.level,l=n.size;for(var c=0;c<t.length;c++)a=u.readability(e,t[c]),a>o&&(o=a,r=u(t[c]));return u.isReadable(e,r,{level:s,size:l})||!i?r:(n.includeFallbackColors=!1,u.mostReadable(e,["#fff","#000"],n))};var Q=u.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},St=u.hexNames=Mt(Q);function Mt(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function ge(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function b(e,t){Rt(e)&&(e="100%");var n=Lt(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function G(e){return Math.min(1,Math.max(0,e))}function E(e){return parseInt(e,16)}function Rt(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function Lt(e){return typeof e=="string"&&e.indexOf("%")!=-1}function A(e){return e.length==1?"0"+e:""+e}function D(e){return e<=1&&(e=e*100+"%"),e}function Te(e){return Math.round(parseFloat(e)*255).toString(16)}function be(e){return E(e)/255}var y=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",n="(?:"+t+")|(?:"+e+")",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",o="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+o),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+o),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+o),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function M(e){return!!y.CSS_UNIT.exec(e)}function wt(e){e=e.replace(it,"").replace(lt,"").toLowerCase();var t=!1;if(Q[e])e=Q[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=y.rgb.exec(e))?{r:n[1],g:n[2],b:n[3]}:(n=y.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=y.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=y.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=y.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=y.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=y.hex8.exec(e))?{r:E(n[1]),g:E(n[2]),b:E(n[3]),a:be(n[4]),format:t?"name":"hex8"}:(n=y.hex6.exec(e))?{r:E(n[1]),g:E(n[2]),b:E(n[3]),format:t?"name":"hex"}:(n=y.hex4.exec(e))?{r:E(n[1]+""+n[1]),g:E(n[2]+""+n[2]),b:E(n[3]+""+n[3]),a:be(n[4]+""+n[4]),format:t?"name":"hex8"}:(n=y.hex3.exec(e))?{r:E(n[1]+""+n[1]),g:E(n[2]+""+n[2]),b:E(n[3]+""+n[3]),format:t?"name":"hex"}:!1}function Ot(e){var t,n;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:t,size:n}}import{clamp as Ee}from"@excalidraw/math";import{degreesToRadians as Ft}from"@excalidraw/math";var J=typeof window<"u"?new Map:null;function Ct(e,t,n,r){let o=e/255,a=t/255,i=n/255,s=Ft(r),l=Math.cos(s),c=Math.sin(s),p=[.213+l*.787-c*.213,.715-l*.715-c*.715,.072-l*.072+c*.928,.213-l*.213+c*.143,.715+l*.285+c*.14,.072-l*.072-c*.283,.213-l*.213-c*.787,.715-l*.715+c*.715,.072+l*.928+c*.072],g=o*p[0]+a*p[1]+i*p[2],I=o*p[3]+a*p[4]+i*p[5],x=o*p[6]+a*p[7]+i*p[8];return{r:Math.round(Math.max(0,Math.min(1,g))*255),g:Math.round(Math.max(0,Math.min(1,I))*255),b:Math.round(Math.max(0,Math.min(1,x))*255)}}var It=(e,t,n,r)=>{let o=Ee(r,0,100)/100,a=c=>{let p=c*(1-o)+(255-c)*o;return Math.round(Ee(p,0,255))},i=a(e),s=a(t),l=a(n);return{r:i,g:s,b:l}},kn=e=>{let t=J?.get(e);if(t)return t;let n=u(e),r=n.getAlpha(),o=n.toRgb(),a=It(o.r,o.g,o.b,93),i=Ct(a.r,a.g,a.b,180),s=Dt(i.r,i.g,i.b,r);return J&&J.set(e,s),s},Un=240,Pt=(e,t)=>t.reduce((n,r)=>(r in e&&(n[r]=e[r]),n),{}),Nn=5,Hn=5,Bn=4,K=4,W=1,v=[0,2,4,6,8],Gn=[0,1,2,3,4],S=(e,t)=>t.map(n=>ue[e][n]),d={transparent:"transparent",black:"#1e1e1e",white:"#ffffff",gray:S("gray",v),red:S("red",v),pink:S("pink",v),grape:S("grape",v),violet:S("violet",v),blue:S("blue",v),cyan:S("cyan",v),teal:S("teal",v),green:S("green",v),yellow:S("yellow",v),orange:S("orange",v),bronze:["#f8f1ee","#eaddd7","#d2bab0","#a18072","#846358"]},_e=Pt(d,["cyan","blue","violet","grape","pink","green","teal","yellow","orange","red"]),Kn=[d.black,d.red[K],d.green[K],d.blue[K],d.yellow[K]],Wn=[d.transparent,d.red[W],d.green[W],d.blue[W],d.yellow[W]],Yn=[d.white,"#f8f9fa","#f5faff","#fffce8","#fdf8f6"],Vn={transparent:d.transparent,white:d.white,gray:d.gray,black:d.black,bronze:d.bronze,..._e},zn={transparent:d.transparent,white:d.white,gray:d.gray,black:d.black,bronze:d.bronze,..._e},Xn=e=>[d.cyan[e],d.blue[e],d.violet[e],d.grape[e],d.pink[e],d.green[e],d.teal[e],d.yellow[e],d.orange[e],d.red[e]],Dt=(e,t,n,r)=>{let o=`#${(16777216+(e<<16)+(t<<8)+n).toString(16).slice(1)}`;if(r!==void 0&&r<1){let a=Math.round(r*255).toString(16).padStart(2,"0");return`${o}${a}`}return o};f();var Zn=typeof window<"u"&&"ResizeObserver"in window,Qn="Excalidraw",Jn=36,er=10,tr=20,nr=8,rr=5,or=1,ar=30,sr=Math.PI/12,ir="red",lr={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},cr={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1,ERASER:5},ur={enabled:"all",disabled:"none",inheritFromUI:"var(--ui-pointerEvents)"},kt=(m=>(m.COPY="copy",m.PASTE="paste",m.CUT="cut",m.KEYDOWN="keydown",m.KEYUP="keyup",m.MOUSE_MOVE="mousemove",m.RESIZE="resize",m.UNLOAD="unload",m.FOCUS="focus",m.BLUR="blur",m.DRAG_OVER="dragover",m.DROP="drop",m.GESTURE_END="gestureend",m.BEFORE_UNLOAD="beforeunload",m.GESTURE_START="gesturestart",m.GESTURE_CHANGE="gesturechange",m.POINTER_MOVE="pointermove",m.POINTER_DOWN="pointerdown",m.POINTER_UP="pointerup",m.STATE_CHANGE="statechange",m.WHEEL="wheel",m.TOUCH_START="touchstart",m.TOUCH_END="touchend",m.HASHCHANGE="hashchange",m.VISIBILITY_CHANGE="visibilitychange",m.SCROLL="scroll",m.EXCALIDRAW_LINK="excalidraw-link",m.MENU_ITEM_SELECT="menu.itemSelect",m.MESSAGE="message",m.FULLSCREENCHANGE="fullscreenchange",m))(kt||{}),fr={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5},Y={TEST:"test",DEVELOPMENT:"development",PRODUCTION:"production"},dr={SIDEBAR:"sidebar",SHAPE_ACTIONS_MENU:"App-menu__left",ZOOM_ACTIONS:"zoom-actions",SEARCH_MENU_INPUT_WRAPPER:"layer-ui__search-inputWrapper",CONVERT_ELEMENT_TYPE_POPUP:"ConvertElementTypePopup",SHAPE_ACTIONS_THEME_SCOPE:"shape-actions-theme-scope",FRAME_NAME:"frame-name"},pr={sm:16,md:20,lg:28,xl:36},ye="Xiaolai",k="Segoe UI Emoji",T={Virgil:1,Helvetica:2,Cascadia:3,Excalifont:5,Nunito:6,"Lilita One":7,"Comic Shanns":8,"Liberation Sans":9,Assistant:10},Ae="sans-serif",ve="monospace",Ut={[Ae]:998,[ve]:999},ee={[ye]:100,...Ut,[k]:1e3};function Nt(e){switch(e){case T.Cascadia:case T["Comic Shanns"]:return ve;default:return Ae}}var Se=e=>{let t=Nt(e);switch(e){case T.Excalifont:return[ye,t,k];default:return[t,k]}},mr={LIGHT:"light",DARK:"dark"},hr={strokeColor:"#bbb",strokeWidth:2,strokeStyle:"solid",fillStyle:"solid",roughness:0,roundness:null,backgroundColor:"transparent",radius:8,nameOffsetY:3,nameColorLightTheme:"#999999",nameColorDarkTheme:"#7a7a7a",nameFontSize:14,nameLineHeight:1.25},br=1,gr=20,Tr=T.Excalifont,Er="left",_r="top",Me="{version}",Ht=2,Bt=2*Ht,Gt=1e-5,xr=2*Bt-Gt,yr="#ffffff",Ar="#1e1e1e",vr="#a2f1a6",Sr=["selectAll"],Mr=20,Rr=5,Re={svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",ico:"image/x-icon",avif:"image/avif",jfif:"image/jfif"},Kt={text:"text/plain",html:"text/html",json:"application/json",excalidraw:"application/vnd.excalidraw+json",excalidrawlib:"application/vnd.excalidrawlib+json",excalidrawlibIds:"application/vnd.excalidrawlib.ids+json"},xe={...Kt,"excalidraw.svg":"image/svg+xml","excalidraw.png":"image/png",binary:"application/octet-stream",...Re},Lr=[xe.text,xe.html,...Object.values(Re)],wr={png:"png",svg:"svg",clipboard:"clipboard"},Or={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawLibrary:"excalidrawlib",excalidrawClipboardWithAPI:"excalidraw-api/clipboard"},Fr=()=>window.EXCALIDRAW_EXPORT_SOURCE||window.location.origin,Cr=500,Ir=300,Pr=500,Dr=1e4,kr=3e4,Ur=100,Nr=.1,Hr=.1,Br=30,Gr=300,Kr=6e4,Wr=3e3,Yr={addLibrary:"addLibrary"},Vr={addLibrary:"addLibrary"},zr={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,toggleTheme:null,saveAsImage:!0},tools:{image:!0}},Xr=2,$r=[1,2,3],qr=10,jr=1440,Zr=4*1024*1024,Qr="http://www.w3.org/2000/svg",Jr=`<?xml version="1.0" standalone="no"?>
2
2
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
- `,Jn=128,eo={excalidraw:2,excalidrawLibrary:2},to=5,no=.7,oo=11,ro={TOP:"top",MIDDLE:"middle",BOTTOM:"bottom"},so={LEFT:"left",CENTER:"center",RIGHT:"right"},ao=20,io=.25,lo=32,co={LEGACY:1,PROPORTIONAL_RADIUS:2,ADAPTIVE_RADIUS:3},$e={architect:0,artist:1,cartoonist:2},uo={thin:1,bold:2,extraBold:4},po={strokeColor:u.black,backgroundColor:u.transparent,fillStyle:"solid",strokeWidth:2,strokeStyle:"solid",roughness:$e.artist,opacity:100,locked:!1},je="library",fo="search",mo={name:"default",defaultTab:je},To=new Set(["iframe","embeddable","image"]),Eo={selection:"selection",lasso:"lasso",rectangle:"rectangle",diamond:"diamond",ellipse:"ellipse",arrow:"arrow",line:"line",freedraw:"freedraw",text:"text",image:"image",eraser:"eraser",hand:"hand",frame:"frame",magicframe:"magicframe",embeddable:"embeddable",laser:"laser"},xo={OAI_API_KEY:"excalidraw-oai-api-key",MERMAID_TO_EXCALIDRAW:"mermaid-to-excalidraw",PUBLISH_LIBRARY:"publish-library-data"},bo="Untitled",_o={generalStats:1,elementProperties:2},Ao=1,ho={sharp:"sharp",round:"round",elbow:"elbow"},yo=.3,go="element",So=Symbol.for("__test__originalId__"),Qe=(o=>(o.ACTIVE="active",o.AWAY="away",o.IDLE="idle",o))(Qe||{}),Lo=20,Oo=35,Ro=700,vo={background:"var(--mobile-action-button-bg)"};c();var D={[m.Excalifont]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25}},[m.Nunito]:{metrics:{unitsPerEm:1e3,ascender:1011,descender:-353,lineHeight:1.25}},[m["Lilita One"]]:{metrics:{unitsPerEm:1e3,ascender:923,descender:-220,lineHeight:1.15}},[m["Comic Shanns"]]:{metrics:{unitsPerEm:1e3,ascender:750,descender:-250,lineHeight:1.25}},[m.Virgil]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},deprecated:!0},[m.Helvetica]:{metrics:{unitsPerEm:2048,ascender:1577,descender:-471,lineHeight:1.15},deprecated:!0,local:!0},[m.Cascadia]:{metrics:{unitsPerEm:2048,ascender:1900,descender:-480,lineHeight:1.2},deprecated:!0},[m["Liberation Sans"]]:{metrics:{unitsPerEm:2048,ascender:1854,descender:-434,lineHeight:1.15},private:!0},[m.Assistant]:{metrics:{unitsPerEm:2048,ascender:1021,descender:-287,lineHeight:1.25},private:!0},[W.Xiaolai]:{metrics:{unitsPerEm:1e3,ascender:880,descender:-144,lineHeight:1.25},fallback:!0},[W["Segoe UI Emoji"]]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},local:!0,fallback:!0}},Io={LATIN:"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD",LATIN_EXT:"U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF",CYRILIC_EXT:"U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F",CYRILIC:"U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116",VIETNAMESE:"U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB"},Po="local:",Co=(e,t,n)=>{let{unitsPerEm:o,ascender:r,descender:l}=D[e]?.metrics||D[m.Excalifont].metrics,a=t/o,s=(n-a*r+a*l)/2;return a*r+s},Do=e=>{let{lineHeight:t}=D[e]?.metrics||D[m.Excalifont].metrics;return t};c();var ie=class{jobs=[];running=!1;tick(){if(this.running)return;let t=this.jobs.shift();t?(this.running=!0,t.promise.resolve(ce(t.jobFactory,...t.args).finally(()=>{this.running=!1,this.tick()}))):this.running=!1}push(t,...n){let o=le();return this.jobs.push({jobFactory:t,promise:o,args:n}),this.tick(),o}};c();c();var ue="excalidraw.desktopUIMode",Bo=599,Ko=1e3,Wo=500,Yo=600,Xo=1400,zo=1440,Vo=1229,pe=/Mac|iPod|iPhone|iPad/.test(navigator.platform),$o=/^Win/.test(navigator.platform),de=/\b(android)\b/i.test(navigator.userAgent),jo=typeof window<"u"&&"netscape"in window&&navigator.userAgent.indexOf("rv:")>1&&navigator.userAgent.indexOf("Gecko")>1,Ze=navigator.userAgent.indexOf("Chrome")!==-1,Qo=!Ze&&navigator.userAgent.indexOf("Safari")!==-1,fe=/iPad|iPhone/i.test(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document,Zo=()=>navigator.brave?.isBrave?.name==="isBrave",qe=(e,t)=>e<=599||t<500&&e<1e3,Je=(e,t)=>{let n=Math.min(e,t),o=Math.max(e,t);return n>=600&&o<=1400},et=()=>{let e=navigator.userAgent||"",t=navigator.platform||"",n=navigator.userAgentData;if(n){let r=(n.platform||"").toLowerCase(),l=r==="windows"||r==="macos"||r==="linux"||r==="chrome os";if(n.mobile===!0)return!0;if(n.mobile===!1&&r==="android")return matchMedia?.("(hover: none)").matches&&matchMedia?.("(pointer: coarse)").matches;if(l)return!1}if(fe)return!0;if(de){let r=/Mobile/i.test(e);if(r||!r)return matchMedia?.("(hover: none)").matches&&matchMedia?.("(pointer: coarse)").matches}return/Win|Linux|CrOS|Mac/.test(t)||/Windows NT|X11|CrOS|Macintosh/.test(e),!1},qo=(e,t)=>qe(e,t)?"phone":Je(e,t)?"tablet":"desktop",Jo=e=>e.formFactor==="phone"?"mobile":e.formFactor==="tablet"?"compact":e.desktopUIMode,er=e=>{let t=e??"",n="unknown";return fe?n="ios":de?n="android":t&&(n="other"),{isMobileDevice:et(),platform:n}},tr=()=>{if(typeof window>"u")return null;try{let e=window.localStorage.getItem(ue);if(e==="compact"||e==="full")return e}catch{}return null},tt=e=>{if(!(typeof window>"u"))try{window.localStorage.setItem(ue,e)}catch{}},nr=e=>{if(!(e!=="compact"&&e!=="full"))return tt(e),e};var me={EQUAL:"Equal",MINUS:"Minus",NUM_ADD:"NumpadAdd",NUM_SUBTRACT:"NumpadSubtract",NUM_ZERO:"Numpad0",BRACKET_RIGHT:"BracketRight",BRACKET_LEFT:"BracketLeft",ONE:"Digit1",TWO:"Digit2",THREE:"Digit3",NINE:"Digit9",QUOTE:"Quote",ZERO:"Digit0",SLASH:"Slash",C:"KeyC",D:"KeyD",H:"KeyH",V:"KeyV",Z:"KeyZ",Y:"KeyY",R:"KeyR",S:"KeyS"},g={ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",BACKSPACE:"Backspace",ALT:"Alt",CTRL_OR_CMD:pe?"metaKey":"ctrlKey",DELETE:"Delete",ENTER:"Enter",ESCAPE:"Escape",QUESTION_MARK:"?",SPACE:" ",TAB:"Tab",CHEVRON_LEFT:"<",CHEVRON_RIGHT:">",PERIOD:".",COMMA:",",SUBTRACT:"-",SLASH:"/",A:"a",C:"c",D:"d",E:"e",F:"f",G:"g",H:"h",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",W:"w",0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9"},nt=new Map([[g.Z,me.Z],[g.Y,me.Y]]),ot=e=>/^[a-z]$/.test(e.toLowerCase()),ar=(e,t)=>{if(t===e.key.toLowerCase())return!0;let n=nt.get(t);return!!(n&&!ot(e.key)&&e.code===n)},ir=e=>e===g.ARROW_LEFT||e===g.ARROW_RIGHT||e===g.ARROW_DOWN||e===g.ARROW_UP,lr=e=>e.altKey,cr=e=>e.shiftKey,ur=e=>e.shiftKey;c();import{pointFromPair as rt}from"@excalidraw/math";var mr=e=>{let t=e.map(o=>o[0]),n=e.map(o=>o[1]);return{width:Math.max(...t)-Math.min(...t),height:Math.max(...n)-Math.min(...n)}},Tr=(e,t,n,o)=>{let r=n.map(_=>_[e]),l=Math.max(...r),a=Math.min(...r),s=l-a,i=s===0?1:t/s,p=1/0,E=n.map(_=>{let A=_[e]*i,h=[..._];return h[e]=A,A<p&&(p=A),h});if(!o||E.length===2)return E;let F=a-p;return E.map(_=>rt(_.map((A,h)=>h===e?A+F:A)))},Er=(e,t,n)=>n?[Math.round(e/n)*n,Math.round(t/n)*n]:[e,t];c();var be=Q(Ee(),1),xe=class{pool;entries={};constructor(t,n){this.pool=new be.default(t,n)}all(){let t=n=>{if(n.data.result){let[o,r]=n.data.result;this.entries[o]=r}};return this.pool.addEventListener("fulfilled",t),this.pool.start().then(()=>(setTimeout(()=>{this.pool.removeEventListener("fulfilled",t)}),Object.values(this.entries)))}};c();c();c();var _e=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");c();var v=class{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}};c();import{average as U}from"@excalidraw/math";var X=null,Pr=e=>{X=e},Cr=()=>{if(X)return X;let e=new Date,t=e.getFullYear(),n=`${e.getMonth()+1}`.padStart(2,"0"),o=`${e.getDate()}`.padStart(2,"0"),r=`${e.getHours()}`.padStart(2,"0"),l=`${e.getMinutes()}`.padStart(2,"0");return`${t}-${n}-${o}-${r}${l}`},Dr=e=>e.charAt(0).toUpperCase()+e.slice(1),Ur=e=>e instanceof HTMLElement&&e.className.includes("ToolIcon"),st=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement,Nr=e=>st(e)||e instanceof Element&&!!e.closest("label, button"),kr=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&(e.type==="text"||e.type==="number"||e.type==="password"||e.type==="search"),at=({fontFamily:e})=>{for(let[t,n]of Object.entries(m))if(n===e)return`${t}${re(n).map(o=>`, ${o}`).join("")}`;return R},Hr=({fontSize:e,fontFamily:t})=>`${e}px ${at({fontFamily:t})}`,Gr=async e=>{requestAnimationFrame(()=>requestAnimationFrame(e))},Br=(e,t)=>{let n=0,o=null,r=(...l)=>{o=l,clearTimeout(n),n=window.setTimeout(()=>{o=null,e(...l)},t)};return r.flush=()=>{if(clearTimeout(n),o){let l=o;o=null,e(...l)}},r.cancel=()=>{o=null,clearTimeout(n)},r},Kr=(e,t)=>{let n=null,o=null,r=null,l=s=>{n=window.requestAnimationFrame(()=>{n=null,e(...s),o=null,r&&(o=r,r=null,l(o))})},a=(...s)=>{if(N()){e(...s);return}o=s,n===null?l(o):t?.trailing&&(r=s)};return a.flush=()=>{n!==null&&(cancelAnimationFrame(n),n=null),o&&(e(...r||o),o=r=null)},a.cancel=()=>{o=r=null,n!==null&&(cancelAnimationFrame(n),n=null)},a},ye=e=>1-Math.pow(1-e,4),Ae=(e,t,n)=>(t-e)*ye(n)+e,Wr=({fromValues:e,toValues:t,onStep:n,duration:o=250,interpolateValue:r,onStart:l,onEnd:a,onCancel:s})=>{let i=!1,p=0,E;function F(H){if(i)return;E===void 0&&(E=H,l?.());let _=Math.min(H-E,o),A=ye(_/o),h={};if(Object.keys(e).forEach(O=>{let y=O,G=(t[y]-e[y])*A+e[y];h[y]=G}),n(h),_<o){let O=_/o,y={};Object.keys(e).forEach(G=>{let M=G,B=e[M],K=t[M],w;w=r?r(B,K,O,M):Ae(B,K,O),w==null&&(w=Ae(B,K,O)),y[M]=w}),n(y),p=window.requestAnimationFrame(F)}else n(t),a?.()}return p=window.requestAnimationFrame(F),()=>{s?.(),i=!0,window.cancelAnimationFrame(p)}},Yr=(e,t)=>{if(!e.length||t<1)return[];let n=0,o=0,r=Array(Math.ceil(e.length/t));for(;n<e.length;)r[o++]=e.slice(n,n+=t);return r},Xr=e=>{let t=window.getSelection();if(t){let n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}},zr=()=>{let e=window.getSelection();e&&e.removeAllRanges()},Vr=(e,t)=>Math.abs(e-t),$r=e=>e==="selection"||e==="lasso",jr=(e,t)=>t.type==="custom"?{...e.activeTool,type:"custom",customType:t.customType,locked:t.locked??e.activeTool.locked}:{...e.activeTool,lastActiveTool:t.lastActiveToolBeforeEraser===void 0?e.activeTool.lastActiveTool:t.lastActiveToolBeforeEraser,type:t.type,customType:null,locked:t.locked??e.activeTool.locked,fromSelection:t.fromSelection??!1},Qr=()=>document.fullscreenElement?.nodeName==="HTML",Zr=()=>document.documentElement.requestFullscreen(),qr=()=>document.exitFullscreen(),Jr=({clientX:e,clientY:t},{zoom:n,offsetLeft:o,offsetTop:r,scrollX:l,scrollY:a})=>{let s=(e-o)/n.value-l,i=(t-r)/n.value-a;return{x:s,y:i}},es=({sceneX:e,sceneY:t},{zoom:n,offsetLeft:o,offsetTop:r,scrollX:l,scrollY:a})=>{let s=(e+l)*n.value+o,i=(t+a)*n.value+r;return{x:s,y:i}},ts=e=>getComputedStyle(document.documentElement).getPropertyValue(`--${e}`),it="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u2C00-\uFB1C\uFDFE-\uFE6F\uFEFD-\uFFFF",lt="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",ct=new RegExp(`^[^${it}]*[${lt}]`),ns=e=>ct.test(e),os=e=>{let[t,n]=e;return{x:t,y:n}},rs=e=>{if(e?.name==="AbortError"){console.warn(e);return}throw e},ss=(e,t,n=0)=>{n<0&&(n=e.length+n),n=Math.min(e.length,Math.max(n,0));let o=n-1;for(;++o<e.length;)if(t(e[o],o,e))return o;return-1},as=(e,t,n=e.length-1)=>{n<0&&(n=e.length+n),n=Math.min(e.length-1,Math.max(n,0));let o=n+1;for(;--o>-1;)if(t(e[o],o,e))return o;return-1},is=(e,t)=>{for(let n=0;n<e.length;n++){let o=t(e[n],n);if(o!=null)return o}},ls=e=>{let t=e.length===5&&e.substr(4,1)==="0",n=e.length===9&&e.substr(7,2)==="00";return t||n||e===u.transparent},le=()=>{let e,t,n=new Promise((o,r)=>{e=o,t=r});return n.resolve=e,n.reject=t,n},cs=(e,t)=>{let n=[{value:1,symbol:"b"},{value:1e3,symbol:"k"},{value:1e6,symbol:"M"},{value:1e9,symbol:"G"}],o=/\.0+$|(\.[0-9]*[1-9])0+$/,r;for(r=n.length-1;r>0&&!(e>=n[r].value);r--);return(e/n[r].value).toFixed(t).replace(o,"$1")+n[r].symbol},us=()=>document.querySelector('meta[name="version"]')?.content||se,ps=()=>{let t=document.createElement("canvas").getContext("2d");if(!t)return!1;let n=12;return t.fillStyle="#f00",t.textBaseline="top",t.font="32px Arial",t.fillText("\u{1F600}",0,0),t.getImageData(n,n,1,1).data[0]!==0},ds=e=>{let t=e.parentElement;for(;t;){if(t===document.body)return document;let{overflowY:n}=window.getComputedStyle(t);if(t.scrollHeight>t.clientHeight&&(n==="auto"||n==="scroll"||n==="overlay"))return t;t=t.parentElement}return document},fs=e=>{let t=e.parentElement;for(;t;){if(t.tabIndex>-1){t.focus();return}t=t.parentElement}},ms=e=>{e.preventDefault(),e.returnValue=""},Ts=e=>Array.from(e).map(t=>`0${t.toString(16)}`.slice(-2)).join(""),Es=()=>N()?1:Date.now(),xs=e=>e instanceof Map?e:e.reduce((t,n)=>(t.set(typeof n=="string"?n:n.id,n),t),new Map),bs=e=>e.reduce((t,n,o)=>(t.set(n.id,[n,o]),t),new Map),_s=(e,t)=>e.reduce((n,o,r)=>(n[t?t(o):r]=o,n),{}),As=e=>e.reduce((t,n,o)=>{let r={...n,prev:null,next:null};if(o!==0){let l=t[o-1];if(r.prev=l,l.next=r,o===e.length-1){let a=t[0];r.next=a,a.prev=r}}return t.push(r),t},[]),ut=e=>Array.isArray(e)?e:e.values(),hs=e=>Array.isArray(e)?e:Array.from(ut(e)),N=()=>f.MODE===C.TEST,ys=()=>f.MODE===C.DEVELOPMENT,gs=()=>f.MODE===C.PRODUCTION,Ss=()=>typeof process<"u"&&!0,Ls=(e,t)=>new CustomEvent(e,{detail:{nativeEvent:t},cancelable:!0}),Os=(e,t)=>{let n=!1;for(let o in t){let r=t[o];if(typeof r<"u"){if(e[o]===r&&(typeof r!="object"||r===null))continue;n=!0}}return n?{...e,...t}:e},Rs=e=>{let t=typeof e;return e==null||t!=="object"&&t!=="function"},pt=()=>{try{return window.self===window.top?"top":"iframe"}catch{return"iframe"}},vs=()=>pt()==="iframe",Fs=e=>!!e&&typeof e=="object"&&"then"in e&&"catch"in e&&"finally"in e,Ms=e=>{let t=e?.querySelectorAll("button, a, input, select, textarea, div[tabindex], label[tabindex]");return t?Array.from(t).filter(n=>n.tabIndex>-1&&!n.disabled):[]},he=(e,t)=>Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t,dt=(e,t,n,o=!1)=>{let r=Object.keys(e),l=Object.keys(t);if(r.length!==l.length)return o&&console.warn("%cisShallowEqual: objects don't have same properties ->","color: #8B4000",e,t),!1;if(n&&Array.isArray(n)){for(let a of n)if(!(e[a]===t[a]||he(e[a],t[a])))return o&&console.warn(`%cisShallowEqual: ${a} not equal ->`,"color: #8B4000",e[a],t[a]),!1;return!0}return r.every(a=>{let s=n?.[a],i=s?s(e[a],t[a]):e[a]===t[a]||he(e[a],t[a]);return!i&&o&&console.warn(`%cisShallowEqual: ${a} not equal ->`,"color: #8B4000",e[a],t[a]),i})},ws=(e,t,{checkForDefaultPrevented:n=!0}={})=>function(r){if(e?.(r),!n||!r?.defaultPrevented)return t?.(r)},Is=(e,t,n)=>{if(!t)return e;if(n)return console.error(t),e;throw new Error(t)};function Ps(e,t){if(!e)throw new Error(t)}var Cs=e=>{let t,n,o=function(r){let l=Object.entries(r);if(t){let s=!0;for(let[i,p]of l)if(t.get(i)!==p){s=!1;break}if(s)return n}let a=e(r);return t=new Map(l),n=a,a};return o.clear=()=>{t=void 0,n=void 0},o},Ds=(e,t)=>e instanceof Set||e instanceof Map?e.has(t):"includes"in e?e.includes(t):e.hasOwnProperty(t),Us=e=>JSON.parse(JSON.stringify(e)),Ns=(e,t)=>dt(e,t)?e:t;function ks(e,t,n,o){return e?(e?.addEventListener?.(t,n,o),()=>{e?.removeEventListener?.(t,n,o)}):()=>{}}function Hs(e,t=!0){let n=e.length;if(n<4)return"";let o=e[0],r=e[1],l=e[2],a=`M${o[0].toFixed(2)},${o[1].toFixed(2)} Q${r[0].toFixed(2)},${r[1].toFixed(2)} ${U(r[0],l[0]).toFixed(2)},${U(r[1],l[1]).toFixed(2)} T`;for(let s=2,i=n-1;s<i;s++)o=e[s],r=e[s+1],a+=`${U(o[0],r[0]).toFixed(2)},${U(o[1],r[1]).toFixed(2)} `;return t&&(a+="Z"),a}var Gs=e=>e.replace(/\r?\n|\r/g,`
4
- `),Bs=e=>e,ce=async(e,...t)=>new Promise(n=>{n(e(...t))}),Ks=(...e)=>Math.max(...e.map(t=>t?1:0))>0,Ws=e=>{try{return JSON.parse(e)}catch{return null}},ge=e=>e.replace(/"/g,"&quot;"),Ys=e=>Array.isArray(e)?e:[e],ft=e=>Array.isArray(e),mt=e=>ft(e)?e.length:e instanceof Map||e instanceof Set?e.size:Object.keys(e).length,Xs=(e,t)=>{if(mt(e)===0)return null;let n=t||(r=>r),o=null;for(let r of e){let l=n(r);if((o===null||o===l)&&l!=null)o=l;else return null}return o},Se="excalidraw-feature-flags",z={COMPLEX_BINDINGS:!1},S=null,zs=e=>{if(!S)try{let t=localStorage.getItem(Se);t&&(S=JSON.parse(t)??z)}catch{}return(S||z)[e]},Vs=(e,t)=>{try{S={...S||z,[e]:t},localStorage.setItem(Se,JSON.stringify(S))}catch(n){console.error("unable to set feature flag",n)}};var Le=new v(Date.now()),Oe=0,Js=()=>Math.floor(Le.next()*2**31),ea=e=>{Le=new v(e),Oe=0},ta=()=>N()?`id${Oe++}`:_e();c();var ve=Q(Re(),1);var St=e=>(e=e.trim(),e&&(0,ve.sanitizeUrl)(ge(e))),ia=e=>!!(e?.includes(location.origin)||e?.startsWith("/")),la=e=>{if(e=St(e),e.startsWith("/"))return`${location.origin}${e}`;try{new URL(e)}catch{return"about:blank"}return e};c();var Fe=class{subscribers=[];on(...t){let n=t.flat().filter(o=>typeof o=="function");return this.subscribers.push(...n),()=>this.off(n)}once(...t){let n=t.flat().filter(r=>typeof r=="function");n.push(()=>o());let o=this.on(...n);return o}off(...t){let n=t.flat();this.subscribers=this.subscribers.filter(o=>!n.includes(o))}trigger(...t){for(let n of this.subscribers)n(...t);return this}clear(){this.subscribers=[]}};c();import{isLineSegment as Lt,lineSegment as L,pointFrom as T}from"@excalidraw/math";import{isBounds as Ot}from"@excalidraw/element";var Ta=(e,t)=>{Me({color:t?.color??"purple",permanent:!!t?.permanent,data:e})},V=(e,t)=>{(Lt(e)?[e]:e).forEach(o=>Me({color:t?.color??"red",data:o,permanent:!!t?.permanent}))},Rt=(e,t)=>{let n=t?.fuzzy?Math.random()*3:0,o=t?.fuzzy?Math.random()*3:0;V(L(T(e[0]+n-10,e[1]+o-10),T(e[0]+n+10,e[1]+o+10)),{color:t?.color??"cyan",permanent:t?.permanent}),V(L(T(e[0]+n-10,e[1]+o+10),T(e[0]+n+10,e[1]+o-10)),{color:t?.color??"cyan",permanent:t?.permanent})},Ea=(e,t)=>{(Ot(e)?[e]:e).forEach(n=>V([L(T(n[0],n[1]),T(n[2],n[1])),L(T(n[2],n[1]),T(n[2],n[3])),L(T(n[2],n[3]),T(n[0],n[3])),L(T(n[0],n[3]),T(n[0],n[1]))],{color:t?.color??"green",permanent:!!t?.permanent}))},xa=({x:e,y:t,points:n},o)=>{n.forEach(r=>Rt(T(e+r[0],t+r[1]),o))},ba=()=>{window.visualDebug?.data.push([])},_a=()=>{window.visualDebug?.data&&(window.visualDebug.data=[])},Me=e=>{window.visualDebug?.data&&window.visualDebug.data.length===0&&(window.visualDebug.data[0]=[]),window.visualDebug?.data&&window.visualDebug.data[window.visualDebug.data.length-1].push(e)};export{Bn as ACTIVE_THRESHOLD,On as ALLOWED_PASTE_MIME_TYPES,Qt as APP_NAME,oo as ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO,no as ARROW_LABEL_WIDTH_FRACTION,ho as ARROW_TYPE,Ro as BIND_MODE_TIMEOUT,to as BOUND_TEXT_PADDING,Z as BinaryHeap,gn as CANVAS_ONLY_ACTIONS,kt as CANVAS_PALETTE_SHADE_INDEXES,fo as CANVAS_SEARCH_TAB,te as CJK_HAND_DRAWN_FALLBACK_FONT,pn as CLASSES,me as CODES,Ut as COLORS_PER_ROW,hn as COLOR_CHARCOAL_BLACK,Ct as COLOR_OUTLINE_CONTRAST_THRESHOLD,u as COLOR_PALETTE,yn as COLOR_VOICE_CALL,An as COLOR_WHITE,an as CURSOR_TYPE,lo as DEFAULT_ADAPTIVE_RADIUS,Bt as DEFAULT_CANVAS_BACKGROUND_PICKS,Nt as DEFAULT_CHART_COLOR_INDEX,_n as DEFAULT_COLLISION_THRESHOLD,P as DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX,Wt as DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE,Gt as DEFAULT_ELEMENT_BACKGROUND_PICKS,po as DEFAULT_ELEMENT_PROPS,I as DEFAULT_ELEMENT_STROKE_COLOR_INDEX,Kt as DEFAULT_ELEMENT_STROKE_COLOR_PALETTE,Ht as DEFAULT_ELEMENT_STROKE_PICKS,$n as DEFAULT_EXPORT_PADDING,bo as DEFAULT_FILENAME,En as DEFAULT_FONT_FAMILY,Tn as DEFAULT_FONT_SIZE,Sn as DEFAULT_GRID_SIZE,Ln as DEFAULT_GRID_STEP,sn as DEFAULT_LASER_COLOR,jn as DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT,io as DEFAULT_PROPORTIONAL_RADIUS,yo as DEFAULT_REDUCED_GLOBAL_ALPHA,mo as DEFAULT_SIDEBAR,xn as DEFAULT_TEXT_ALIGN,Ye as DEFAULT_TRANSFORM_HANDLE_SPACING,Xn as DEFAULT_UI_OPTIONS,se as DEFAULT_VERSION,bn as DEFAULT_VERTICAL_ALIGN,Oo as DOUBLE_TAP_POSITION_THRESHOLD,qt as DRAGGING_THRESHOLD,xo as EDITOR_LS_KEYS,x as ELEMENTS_PALETTE_SHADE_INDEXES,go as ELEMENT_LINK_KEY,ao as ELEMENT_READY_TO_ERASE_OPACITY,tn as ELEMENT_SHIFT_TRANSLATE_AMOUNT,nn as ELEMENT_TRANSLATE_AMOUNT,Jn as ENCRYPTION_KEY_BITS,C as ENV,ze as EPSILON,Be as EVENT,vn as EXPORT_DATA_TYPES,Rn as EXPORT_IMAGE_TYPES,Vn as EXPORT_SCALES,Fe as Emitter,m as FONT_FAMILY,W as FONT_FAMILY_FALLBACKS,Ke as FONT_FAMILY_GENERIC_FALLBACKS,D as FONT_METADATA,fn as FRAME_STYLE,Io as GOOGLE_FONTS_RANGES,Hn as HYPERLINK_TOOLTIP_DELAY,Gn as IDLE_THRESHOLD,ae as IMAGE_MIME_TYPES,Mn as IMAGE_RENDER_TIMEOUT,g as KEYS,nt as KeyCodeMap,To as LIBRARY_DISABLED_TYPES,je as LIBRARY_SIDEBAR_TAB,en as LINE_CONFIRM_THRESHOLD,Lo as LINE_POLYGON_POINT_MERGE_DISTANCE,Po as LOCAL_FONT_PROTOCOL,Qn as MAX_ALLOWED_FILE_BYTES,Dt as MAX_CUSTOM_COLORS_USED_IN_CANVAS,zn as MAX_DECIMALS_FOR_SVG_EXPORT,kn as MAX_ZOOM,ee as MIME_TYPES,Jt as MINIMUM_ARROW_SIZE,mn as MIN_FONT_SIZE,Ao as MIN_WIDTH_OR_HEIGHT,Nn as MIN_ZOOM,vo as MOBILE_ACTION_BUTTON_BG,oe as MONOSPACE_GENERIC_FONT,Wo as MQ_MAX_HEIGHT_LANDSCAPE,Bo as MQ_MAX_MOBILE,Xo as MQ_MAX_TABLET,Ko as MQ_MAX_WIDTH_LANDSCAPE,Yo as MQ_MIN_TABLET,zo as MQ_MIN_WIDTH_DESKTOP,Vo as MQ_RIGHT_SIDEBAR_MIN_WIDTH,So as ORIG_ID,ln as POINTER_BUTTON,cn as POINTER_EVENTS,xe as PromisePool,ie as Queue,$e as ROUGHNESS,co as ROUNDNESS,ne as SANS_SERIF_GENERIC_FONT,Dn as SCROLL_TIMEOUT,rn as SHIFT_LOCKING_ANGLE,Xe as SIDE_RESIZING_THRESHOLD,_o as STATS_PANELS,Ve as STRING_MIME_TYPES,uo as STROKE_WIDTH,qn as SVG_DOCUMENT_PREAMBLE,Zn as SVG_NS,wn as TAP_TWICE_TIMEOUT,so as TEXT_ALIGN,Zt as TEXT_AUTOWRAP_THRESHOLD,on as TEXT_TO_CENTER_SNAP_THRESHOLD,dn as THEME,Kn as THEME_FILTER,Pn as TITLE_TIMEOUT,Eo as TOOL_TYPE,In as TOUCH_CTX_MENU_TIMEOUT,Yn as URL_HASH_KEYS,Wn as URL_QUERY_KEYS,Qe as UserIdleState,eo as VERSIONS,Cn as VERSION_TIMEOUT,ro as VERTICAL_ALIGN,R as WINDOWS_EMOJI_FALLBACK_FONT,un as YOUTUBE_STATES,Un as ZOOM_STEP,ks as addEventListener,Zr as allowFullScreen,As as arrayToList,xs as arrayToMap,bs as arrayToMapWithIndex,_s as arrayToObject,Is as assertNever,Ts as bytesToHexString,Dr as capitalizeString,Ys as castArray,Yr as chunk,Us as cloneJSON,ws as composeEventHandlers,er as createUserAgentDescriptor,Br as debounce,_a as debugClear,ba as debugCloseFrame,Ea as debugDrawBounds,Ta as debugDrawCubicBezier,V as debugDrawLine,Rt as debugDrawPoint,xa as debugDrawPoints,Jo as deriveStylesPanelMode,Vr as distance,ye as easeOut,Wr as easeToValuesRAF,ge as escapeDoubleQuotes,qr as exitFullScreen,ss as findIndex,as as findLastIndex,fs as focusNearestParent,Yt as getAllColorsSpecificShade,Cr as getDateTime,Fn as getExportSource,zs as getFeatureFlag,re as getFontFamilyFallbacks,at as getFontFamilyString,Hr as getFontString,qo as getFormFactor,pt as getFrame,We as getGenericFontFamilyFallback,ts as getGlobalCSSVariable,Er as getGridPoint,Do as getLineHeight,ds as getNearestScrollableContainer,mr as getSizeFromPoints,b as getSpecificColorShades,Hs as getSvgPathFromStroke,Es as getUpdatedTimestamp,us as getVersion,Co as getVerticalOffset,Ps as invariant,de as isAndroid,Ks as isAnyTrue,ir as isArrowKey,Zo as isBrave,Ze as isChrome,pe as isDarwin,ys as isDevEnv,jo as isFirefox,Qr as isFullScreen,fe as isIOS,st as isInputLike,Nr as isInteractive,ot as isLatinChar,ia as isLocalLink,Ds as isMemberOf,qe as isMobileBreakpoint,Rs as isPrimitive,gs as isProdEnv,Fs as isPromiseLike,ns as isRTL,ft as isReadonlyArray,vs as isRunningInIframe,Qo as isSafari,$r as isSelectionLikeTool,Ss as isServerEnv,dt as isShallowEqual,Je as isTabletBreakpoint,N as isTestEnv,Ur as isToolIcon,ls as isTransparent,$o as isWindows,kr as isWritableElement,tr as loadDesktopUIModePreference,is as mapFind,ar as matchKey,Cs as memoize,rs as muteFSAbortError,cs as nFormatter,Gr as nextAnimationFrame,Gs as normalizeEOL,St as normalizeLink,ms as preventUnload,ce as promiseTry,Ms as queryFocusableElements,ta as randomId,Js as randomInteger,Xs as reduceToCommonValue,zr as removeSelection,Tr as rescalePoints,ea as reseed,le as resolvablePromise,Xt as rgbToHex,Ws as safelyParseJSON,es as sceneCoordsToViewportCoords,Xr as selectNode,Pr as setDateTimeForTests,nr as setDesktopUIMode,Vs as setFeatureFlag,cr as shouldMaintainAspectRatio,lr as shouldResizeFromCenter,ur as shouldRotateWithDiscreteAngle,mt as sizeOf,ps as supportsEmoji,jt as supportsResizeObserver,Kr as throttleRAF,hs as toArray,Bs as toBrandedType,ut as toIterable,la as toValidURL,os as tupleToCoors,jr as updateActiveTool,Os as updateObject,Ns as updateStable,Jr as viewportCoordsToSceneCoords,Ls as wrapEvent};
3
+ `,eo=128,to={excalidraw:2,excalidrawLibrary:2},no=5,ro=.7,oo=11,ao={TOP:"top",MIDDLE:"middle",BOTTOM:"bottom"},so={LEFT:"left",CENTER:"center",RIGHT:"right"},io=20,lo=.25,co=32,uo={LEGACY:1,PROPORTIONAL_RADIUS:2,ADAPTIVE_RADIUS:3},Wt={architect:0,artist:1,cartoonist:2},fo={thin:1,bold:2,extraBold:4},po={strokeColor:d.black,backgroundColor:d.transparent,fillStyle:"solid",strokeWidth:2,strokeStyle:"solid",roughness:Wt.artist,opacity:100,locked:!1},Yt="library",mo="search",ho={name:"default",defaultTab:Yt},bo=new Set(["iframe","embeddable","image"]),go={selection:"selection",lasso:"lasso",rectangle:"rectangle",diamond:"diamond",ellipse:"ellipse",arrow:"arrow",line:"line",freedraw:"freedraw",text:"text",image:"image",eraser:"eraser",hand:"hand",frame:"frame",magicframe:"magicframe",embeddable:"embeddable",laser:"laser"},To={OAI_API_KEY:"excalidraw-oai-api-key",MERMAID_TO_EXCALIDRAW:"mermaid-to-excalidraw",PUBLISH_LIBRARY:"publish-library-data"},Eo="Untitled",_o={generalStats:1,elementProperties:2},xo=1,yo={sharp:"sharp",round:"round",elbow:"elbow"},Ao=.3,vo="element",So=Symbol.for("__test__originalId__"),Vt=(r=>(r.ACTIVE="active",r.AWAY="away",r.IDLE="idle",r))(Vt||{}),Mo=20,Ro=35,Lo=700,wo={background:"var(--mobile-action-button-bg)"};f();var V={[T.Excalifont]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25}},[T.Nunito]:{metrics:{unitsPerEm:1e3,ascender:1011,descender:-353,lineHeight:1.25}},[T["Lilita One"]]:{metrics:{unitsPerEm:1e3,ascender:923,descender:-220,lineHeight:1.15}},[T["Comic Shanns"]]:{metrics:{unitsPerEm:1e3,ascender:750,descender:-250,lineHeight:1.25}},[T.Virgil]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},deprecated:!0},[T.Helvetica]:{metrics:{unitsPerEm:2048,ascender:1577,descender:-471,lineHeight:1.15},deprecated:!0,local:!0},[T.Cascadia]:{metrics:{unitsPerEm:2048,ascender:1900,descender:-480,lineHeight:1.2},deprecated:!0},[T["Liberation Sans"]]:{metrics:{unitsPerEm:2048,ascender:1854,descender:-434,lineHeight:1.15},private:!0},[T.Assistant]:{metrics:{unitsPerEm:2048,ascender:1021,descender:-287,lineHeight:1.25},private:!0},[ee.Xiaolai]:{metrics:{unitsPerEm:1e3,ascender:880,descender:-144,lineHeight:1.25},fallback:!0},[ee["Segoe UI Emoji"]]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},local:!0,fallback:!0}},Io={LATIN:"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD",LATIN_EXT:"U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF",CYRILIC_EXT:"U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F",CYRILIC:"U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116",VIETNAMESE:"U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB"},Po="local:",Do=(e,t,n)=>{let{unitsPerEm:r,ascender:o,descender:a}=V[e]?.metrics||V[T.Excalifont].metrics,i=t/r,s=(n-i*o+i*a)/2;return i*o+s},ko=e=>{let{lineHeight:t}=V[e]?.metrics||V[T.Excalifont].metrics;return t};f();var Le=class{jobs=[];running=!1;tick(){if(this.running)return;let t=this.jobs.shift();t?(this.running=!0,t.promise.resolve(Oe(t.jobFactory,...t.args).finally(()=>{this.running=!1,this.tick()}))):this.running=!1}push(t,...n){let r=we();return this.jobs.push({jobFactory:t,promise:r,args:n}),this.tick(),r}};f();f();var Fe="excalidraw.desktopUIMode",Ko=599,Wo=1e3,Yo=500,Vo=600,zo=1400,Xo=1440,$o=1229,Ce=/Mac|iPod|iPhone|iPad/.test(navigator.platform),qo=/^Win/.test(navigator.platform),Ie=/\b(android)\b/i.test(navigator.userAgent),jo=typeof window<"u"&&"netscape"in window&&navigator.userAgent.indexOf("rv:")>1&&navigator.userAgent.indexOf("Gecko")>1,zt=navigator.userAgent.indexOf("Chrome")!==-1,Zo=!zt&&navigator.userAgent.indexOf("Safari")!==-1,Pe=/iPad|iPhone/i.test(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document,Qo=()=>navigator.brave?.isBrave?.name==="isBrave",Xt=(e,t)=>e<=599||t<500&&e<1e3,$t=(e,t)=>{let n=Math.min(e,t),r=Math.max(e,t);return n>=600&&r<=1400},qt=()=>{let e=navigator.userAgent||"",t=navigator.platform||"",n=navigator.userAgentData;if(n){let o=(n.platform||"").toLowerCase(),a=o==="windows"||o==="macos"||o==="linux"||o==="chrome os";if(n.mobile===!0)return!0;if(n.mobile===!1&&o==="android")return matchMedia?.("(hover: none)").matches&&matchMedia?.("(pointer: coarse)").matches;if(a)return!1}if(Pe)return!0;if(Ie){let o=/Mobile/i.test(e);if(o||!o)return matchMedia?.("(hover: none)").matches&&matchMedia?.("(pointer: coarse)").matches}return/Win|Linux|CrOS|Mac/.test(t)||/Windows NT|X11|CrOS|Macintosh/.test(e),!1},Jo=(e,t)=>Xt(e,t)?"phone":$t(e,t)?"tablet":"desktop",ea=e=>e.formFactor==="phone"?"mobile":e.formFactor==="tablet"?"compact":e.desktopUIMode,ta=e=>{let t=e??"",n="unknown";return Pe?n="ios":Ie?n="android":t&&(n="other"),{isMobileDevice:qt(),platform:n}},na=()=>{if(typeof window>"u")return null;try{let e=window.localStorage.getItem(Fe);if(e==="compact"||e==="full")return e}catch{}return null},jt=e=>{if(!(typeof window>"u"))try{window.localStorage.setItem(Fe,e)}catch{}},ra=e=>{if(!(e!=="compact"&&e!=="full"))return jt(e),e};var De={EQUAL:"Equal",MINUS:"Minus",NUM_ADD:"NumpadAdd",NUM_SUBTRACT:"NumpadSubtract",NUM_ZERO:"Numpad0",BRACKET_RIGHT:"BracketRight",BRACKET_LEFT:"BracketLeft",ONE:"Digit1",TWO:"Digit2",THREE:"Digit3",NINE:"Digit9",QUOTE:"Quote",ZERO:"Digit0",SLASH:"Slash",C:"KeyC",D:"KeyD",H:"KeyH",V:"KeyV",Z:"KeyZ",Y:"KeyY",R:"KeyR",S:"KeyS"},O={ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",BACKSPACE:"Backspace",ALT:"Alt",CTRL_OR_CMD:Ce?"metaKey":"ctrlKey",DELETE:"Delete",ENTER:"Enter",ESCAPE:"Escape",QUESTION_MARK:"?",SPACE:" ",TAB:"Tab",CHEVRON_LEFT:"<",CHEVRON_RIGHT:">",PERIOD:".",COMMA:",",SUBTRACT:"-",SLASH:"/",A:"a",C:"c",D:"d",E:"e",F:"f",G:"g",H:"h",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",W:"w",0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9"},Zt=new Map([[O.Z,De.Z],[O.Y,De.Y]]),Qt=e=>/^[a-z]$/.test(e.toLowerCase()),ia=(e,t)=>{if(t===e.key.toLowerCase())return!0;let n=Zt.get(t);return!!(n&&!Qt(e.key)&&e.code===n)},la=e=>e===O.ARROW_LEFT||e===O.ARROW_RIGHT||e===O.ARROW_DOWN||e===O.ARROW_UP,ca=e=>e.altKey,ua=e=>e.shiftKey,fa=e=>e.shiftKey;f();import{pointFromPair as Jt}from"@excalidraw/math";var ha=e=>{let t=e.map(r=>r[0]),n=e.map(r=>r[1]);return{width:Math.max(...t)-Math.min(...t),height:Math.max(...n)-Math.min(...n)}},ba=(e,t,n,r)=>{let o=n.map(x=>x[e]),a=Math.max(...o),i=Math.min(...o),s=a-i,l=s===0?1:t/s,c=1/0,p=n.map(x=>{let R=x[e]*l,L=[...x];return L[e]=R,R<c&&(c=R),L});if(!r||p.length===2)return p;let g=i-c;return p.map(x=>Jt(x.map((R,L)=>L===e?R+g:R)))},ga=(e,t,n)=>n?[Math.round(e/n)*n,Math.round(t/n)*n]:[e,t];f();var He=ie(Ue(),1),Ne=class{pool;entries={};constructor(t,n){this.pool=new He.default(t,n)}all(){let t=n=>{if(n.data.result){let[r,o]=n.data.result;this.entries[r]=o}};return this.pool.addEventListener("fulfilled",t),this.pool.start().then(()=>(setTimeout(()=>{this.pool.removeEventListener("fulfilled",t)}),Object.values(this.entries)))}};f();f();f();var Be=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");f();var U=class{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}};f();import{average as z}from"@excalidraw/math";var ne=null,Pa=e=>{ne=e},Da=()=>{if(ne)return ne;let e=new Date,t=e.getFullYear(),n=`${e.getMonth()+1}`.padStart(2,"0"),r=`${e.getDate()}`.padStart(2,"0"),o=`${e.getHours()}`.padStart(2,"0"),a=`${e.getMinutes()}`.padStart(2,"0");return`${t}-${n}-${r}-${o}${a}`},ka=e=>e.charAt(0).toUpperCase()+e.slice(1),Ua=e=>e instanceof HTMLElement&&e.className.includes("ToolIcon"),en=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement,Na=e=>en(e)||e instanceof Element&&!!e.closest("label, button"),Ha=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&(e.type==="text"||e.type==="number"||e.type==="password"||e.type==="search"),tn=({fontFamily:e})=>{for(let[t,n]of Object.entries(T))if(n===e)return`${t}${Se(n).map(r=>`, ${r}`).join("")}`;return k},Ba=({fontSize:e,fontFamily:t})=>`${e}px ${tn({fontFamily:t})}`,Ga=async e=>{requestAnimationFrame(()=>requestAnimationFrame(e))},Ka=(e,t)=>{let n=0,r=null,o=(...a)=>{r=a,clearTimeout(n),n=window.setTimeout(()=>{r=null,e(...a)},t)};return o.flush=()=>{if(clearTimeout(n),r){let a=r;r=null,e(...a)}},o.cancel=()=>{r=null,clearTimeout(n)},o},Wa=(e,t)=>{let n=null,r=null,o=null,a=s=>{n=window.requestAnimationFrame(()=>{n=null,e(...s),r=null,o&&(r=o,o=null,a(r))})},i=(...s)=>{if(X()){e(...s);return}r=s,n===null?a(r):t?.trailing&&(o=s)};return i.flush=()=>{n!==null&&(cancelAnimationFrame(n),n=null),r&&(e(...o||r),r=o=null)},i.cancel=()=>{r=o=null,n!==null&&(cancelAnimationFrame(n),n=null)},i},We=e=>1-Math.pow(1-e,4),Ge=(e,t,n)=>(t-e)*We(n)+e,Ya=({fromValues:e,toValues:t,onStep:n,duration:r=250,interpolateValue:o,onStart:a,onEnd:i,onCancel:s})=>{let l=!1,c=0,p;function g(I){if(l)return;p===void 0&&(p=I,a?.());let x=Math.min(I-p,r),R=We(x/r),L={};if(Object.keys(e).forEach(P=>{let w=P,q=(t[w]-e[w])*R+e[w];L[w]=q}),n(L),x<r){let P=x/r,w={};Object.keys(e).forEach(q=>{let N=q,j=e[N],Z=t[N],H;H=o?o(j,Z,P,N):Ge(j,Z,P),H==null&&(H=Ge(j,Z,P)),w[N]=H}),n(w),c=window.requestAnimationFrame(g)}else n(t),i?.()}return c=window.requestAnimationFrame(g),()=>{s?.(),l=!0,window.cancelAnimationFrame(c)}},Va=(e,t)=>{if(!e.length||t<1)return[];let n=0,r=0,o=Array(Math.ceil(e.length/t));for(;n<e.length;)o[r++]=e.slice(n,n+=t);return o},za=e=>{let t=window.getSelection();if(t){let n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}},Xa=()=>{let e=window.getSelection();e&&e.removeAllRanges()},$a=(e,t)=>Math.abs(e-t),qa=e=>e==="selection"||e==="lasso",ja=(e,t)=>t.type==="custom"?{...e.activeTool,type:"custom",customType:t.customType,locked:t.locked??e.activeTool.locked}:{...e.activeTool,lastActiveTool:t.lastActiveToolBeforeEraser===void 0?e.activeTool.lastActiveTool:t.lastActiveToolBeforeEraser,type:t.type,customType:null,locked:t.locked??e.activeTool.locked,fromSelection:t.fromSelection??!1},Za=()=>document.fullscreenElement?.nodeName==="HTML",Qa=()=>document.documentElement.requestFullscreen(),Ja=()=>document.exitFullscreen(),es=({clientX:e,clientY:t},{zoom:n,offsetLeft:r,offsetTop:o,scrollX:a,scrollY:i})=>{let s=(e-r)/n.value-a,l=(t-o)/n.value-i;return{x:s,y:l}},ts=({sceneX:e,sceneY:t},{zoom:n,offsetLeft:r,offsetTop:o,scrollX:a,scrollY:i})=>{let s=(e+a)*n.value+r,l=(t+i)*n.value+o;return{x:s,y:l}},ns=e=>getComputedStyle(document.documentElement).getPropertyValue(`--${e}`),nn="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u2C00-\uFB1C\uFDFE-\uFE6F\uFEFD-\uFFFF",rn="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",on=new RegExp(`^[^${nn}]*[${rn}]`),rs=e=>on.test(e),os=e=>{let[t,n]=e;return{x:t,y:n}},as=e=>{if(e?.name==="AbortError"){console.warn(e);return}throw e},ss=(e,t,n=0)=>{n<0&&(n=e.length+n),n=Math.min(e.length,Math.max(n,0));let r=n-1;for(;++r<e.length;)if(t(e[r],r,e))return r;return-1},is=(e,t,n=e.length-1)=>{n<0&&(n=e.length+n),n=Math.min(e.length-1,Math.max(n,0));let r=n+1;for(;--r>-1;)if(t(e[r],r,e))return r;return-1},ls=(e,t)=>{for(let n=0;n<e.length;n++){let r=t(e[n],n);if(r!=null)return r}},cs=e=>u(e).getAlpha()===0,we=()=>{let e,t,n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n},us=(e,t)=>{let n=[{value:1,symbol:"b"},{value:1e3,symbol:"k"},{value:1e6,symbol:"M"},{value:1e9,symbol:"G"}],r=/\.0+$|(\.[0-9]*[1-9])0+$/,o;for(o=n.length-1;o>0&&!(e>=n[o].value);o--);return(e/n[o].value).toFixed(t).replace(r,"$1")+n[o].symbol},fs=()=>document.querySelector('meta[name="version"]')?.content||Me,ds=()=>{let t=document.createElement("canvas").getContext("2d");if(!t)return!1;let n=12;return t.fillStyle="#f00",t.textBaseline="top",t.font="32px Arial",t.fillText("\u{1F600}",0,0),t.getImageData(n,n,1,1).data[0]!==0},ps=e=>{let t=e.parentElement;for(;t;){if(t===document.body)return document;let{overflowY:n}=window.getComputedStyle(t);if(t.scrollHeight>t.clientHeight&&(n==="auto"||n==="scroll"||n==="overlay"))return t;t=t.parentElement}return document},ms=e=>{let t=e.parentElement;for(;t;){if(t.tabIndex>-1){t.focus();return}t=t.parentElement}},hs=e=>{e.preventDefault(),e.returnValue=""},bs=e=>Array.from(e).map(t=>`0${t.toString(16)}`.slice(-2)).join(""),gs=()=>X()?1:Date.now(),Ts=e=>e instanceof Map?e:e.reduce((t,n)=>(t.set(typeof n=="string"?n:n.id,n),t),new Map),Es=e=>e.reduce((t,n,r)=>(t.set(n.id,[n,r]),t),new Map),_s=(e,t)=>e.reduce((n,r,o)=>(n[t?t(r):o]=r,n),{}),xs=e=>e.reduce((t,n,r)=>{let o={...n,prev:null,next:null};if(r!==0){let a=t[r-1];if(o.prev=a,a.next=o,r===e.length-1){let i=t[0];o.next=i,i.prev=o}}return t.push(o),t},[]),an=e=>Array.isArray(e)?e:e.values(),ys=e=>Array.isArray(e)?e:Array.from(an(e)),X=()=>h.MODE===Y.TEST,As=()=>h.MODE===Y.DEVELOPMENT,vs=()=>h.MODE===Y.PRODUCTION,Ss=()=>typeof process<"u"&&!0,Ms=(e,t)=>new CustomEvent(e,{detail:{nativeEvent:t},cancelable:!0}),Rs=(e,t)=>{let n=!1;for(let r in t){let o=t[r];if(typeof o<"u"){if(e[r]===o&&(typeof o!="object"||o===null))continue;n=!0}}return n?{...e,...t}:e},Ls=e=>{let t=typeof e;return e==null||t!=="object"&&t!=="function"},sn=()=>{try{return window.self===window.top?"top":"iframe"}catch{return"iframe"}},ws=()=>sn()==="iframe",Os=e=>!!e&&typeof e=="object"&&"then"in e&&"catch"in e&&"finally"in e,Fs=e=>{let t=e?.querySelectorAll("button, a, input, select, textarea, div[tabindex], label[tabindex]");return t?Array.from(t).filter(n=>n.tabIndex>-1&&!n.disabled):[]},Ke=(e,t)=>Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t,ln=(e,t,n,r=!1)=>{let o=Object.keys(e),a=Object.keys(t);if(o.length!==a.length)return r&&console.warn("%cisShallowEqual: objects don't have same properties ->","color: #8B4000",e,t),!1;if(n&&Array.isArray(n)){for(let i of n)if(!(e[i]===t[i]||Ke(e[i],t[i])))return r&&console.warn(`%cisShallowEqual: ${i} not equal ->`,"color: #8B4000",e[i],t[i]),!1;return!0}return o.every(i=>{let s=n?.[i],l=s?s(e[i],t[i]):e[i]===t[i]||Ke(e[i],t[i]);return!l&&r&&console.warn(`%cisShallowEqual: ${i} not equal ->`,"color: #8B4000",e[i],t[i]),l})},Cs=(e,t,{checkForDefaultPrevented:n=!0}={})=>function(o){if(e?.(o),!n||!o?.defaultPrevented)return t?.(o)},Is=(e,t,n)=>{if(!t)return e;if(n)return console.error(t),e;throw new Error(t)};function Ps(e,t){if(!e)throw new Error(t)}var Ds=e=>{let t,n,r=function(o){let a=Object.entries(o);if(t){let s=!0;for(let[l,c]of a)if(t.get(l)!==c){s=!1;break}if(s)return n}let i=e(o);return t=new Map(a),n=i,i};return r.clear=()=>{t=void 0,n=void 0},r},ks=(e,t)=>e instanceof Set||e instanceof Map?e.has(t):"includes"in e?e.includes(t):e.hasOwnProperty(t),Us=e=>JSON.parse(JSON.stringify(e)),Ns=(e,t)=>ln(e,t)?e:t;function Hs(e,t,n,r){return e?(e?.addEventListener?.(t,n,r),()=>{e?.removeEventListener?.(t,n,r)}):()=>{}}function Bs(e,t=!0){let n=e.length;if(n<4)return"";let r=e[0],o=e[1],a=e[2],i=`M${r[0].toFixed(2)},${r[1].toFixed(2)} Q${o[0].toFixed(2)},${o[1].toFixed(2)} ${z(o[0],a[0]).toFixed(2)},${z(o[1],a[1]).toFixed(2)} T`;for(let s=2,l=n-1;s<l;s++)r=e[s],o=e[s+1],i+=`${z(r[0],o[0]).toFixed(2)},${z(r[1],o[1]).toFixed(2)} `;return t&&(i+="Z"),i}var Gs=e=>e.replace(/\r?\n|\r/g,`
4
+ `);function Ks(e){return e}var Oe=async(e,...t)=>new Promise(n=>{n(e(...t))}),Ws=(...e)=>Math.max(...e.map(t=>t?1:0))>0,Ys=e=>{try{return JSON.parse(e)}catch{return null}},Ye=e=>e.replace(/"/g,"&quot;"),Vs=e=>Array.isArray(e)?e:[e],cn=e=>Array.isArray(e),un=e=>cn(e)?e.length:e instanceof Map||e instanceof Set?e.size:Object.keys(e).length,zs=(e,t)=>{if(un(e)===0)return null;let n=t||(o=>o),r=null;for(let o of e){let a=n(o);if((r===null||r===a)&&a!=null)r=a;else return null}return r},Ve="excalidraw-feature-flags",re={COMPLEX_BINDINGS:!1},F=null,Xs=e=>{if(!F)try{let t=localStorage.getItem(Ve);t&&(F=JSON.parse(t)??re)}catch{}return(F||re)[e]},$s=(e,t)=>{try{F={...F||re,[e]:t},localStorage.setItem(Ve,JSON.stringify(F))}catch(n){console.error("unable to set feature flag",n)}};var ze=new U(Date.now()),Xe=0,ei=()=>Math.floor(ze.next()*2**31),ti=e=>{ze=new U(e),Xe=0},ni=()=>X()?`id${Xe++}`:Be();f();var qe=ie($e(),1);var _n=e=>(e=e.trim(),e&&(0,qe.sanitizeUrl)(Ye(e))),li=e=>!!(e?.includes(location.origin)||e?.startsWith("/")),ci=e=>{if(e=_n(e),e.startsWith("/"))return`${location.origin}${e}`;try{new URL(e)}catch{return"about:blank"}return e};f();var je=class{subscribers=[];on(...t){let n=t.flat().filter(r=>typeof r=="function");return this.subscribers.push(...n),()=>this.off(n)}once(...t){let n=t.flat().filter(o=>typeof o=="function");n.push(()=>r());let r=this.on(...n);return r}off(...t){let n=t.flat();this.subscribers=this.subscribers.filter(r=>!n.includes(r))}trigger(...t){for(let n of this.subscribers)n(...t);return this}clear(){this.subscribers=[]}};f();import{isLineSegment as xn,lineSegment as C,pointFrom as _}from"@excalidraw/math";var bi=(e,t)=>{Ze({color:t?.color??"purple",permanent:!!t?.permanent,data:e})},oe=(e,t)=>{(xn(e)?[e]:e).forEach(r=>Ze({color:t?.color??"red",data:r,permanent:!!t?.permanent}))},yn=(e,t)=>{let n=t?.fuzzy?Math.random()*3:0,r=t?.fuzzy?Math.random()*3:0;oe(C(_(e[0]+n-10,e[1]+r-10),_(e[0]+n+10,e[1]+r+10)),{color:t?.color??"cyan",permanent:t?.permanent}),oe(C(_(e[0]+n-10,e[1]+r+10),_(e[0]+n+10,e[1]+r-10)),{color:t?.color??"cyan",permanent:t?.permanent})},gi=(e,t)=>{(ce(e)?[e]:e).forEach(n=>oe([C(_(n[0],n[1]),_(n[2],n[1])),C(_(n[2],n[1]),_(n[2],n[3])),C(_(n[2],n[3]),_(n[0],n[3])),C(_(n[0],n[3]),_(n[0],n[1]))],{color:t?.color??"green",permanent:!!t?.permanent}))},Ti=({x:e,y:t,points:n},r)=>{n.forEach(o=>yn(_(e+o[0],t+o[1]),r))},Ei=()=>{window.visualDebug?.data.push([])},_i=()=>{window.visualDebug?.data&&(window.visualDebug.data=[])},Ze=e=>{window.visualDebug?.data&&window.visualDebug.data.length===0&&(window.visualDebug.data[0]=[]),window.visualDebug?.data&&window.visualDebug.data[window.visualDebug.data.length-1].push(e)};export{Wr as ACTIVE_THRESHOLD,Lr as ALLOWED_PASTE_MIME_TYPES,Qn as APP_NAME,oo as ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO,ro as ARROW_LABEL_WIDTH_FRACTION,yo as ARROW_TYPE,Lo as BIND_MODE_TIMEOUT,no as BOUND_TEXT_PADDING,le as BinaryHeap,Sr as CANVAS_ONLY_ACTIONS,Gn as CANVAS_PALETTE_SHADE_INDEXES,mo as CANVAS_SEARCH_TAB,ye as CJK_HAND_DRAWN_FALLBACK_FONT,dr as CLASSES,De as CODES,Hn as COLORS_PER_ROW,Ar as COLOR_CHARCOAL_BLACK,Un as COLOR_OUTLINE_CONTRAST_THRESHOLD,d as COLOR_PALETTE,vr as COLOR_VOICE_CALL,yr as COLOR_WHITE,lr as CURSOR_TYPE,co as DEFAULT_ADAPTIVE_RADIUS,Yn as DEFAULT_CANVAS_BACKGROUND_PICKS,Bn as DEFAULT_CHART_COLOR_INDEX,xr as DEFAULT_COLLISION_THRESHOLD,W as DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX,zn as DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE,Wn as DEFAULT_ELEMENT_BACKGROUND_PICKS,po as DEFAULT_ELEMENT_PROPS,K as DEFAULT_ELEMENT_STROKE_COLOR_INDEX,Vn as DEFAULT_ELEMENT_STROKE_COLOR_PALETTE,Kn as DEFAULT_ELEMENT_STROKE_PICKS,qr as DEFAULT_EXPORT_PADDING,Eo as DEFAULT_FILENAME,Tr as DEFAULT_FONT_FAMILY,gr as DEFAULT_FONT_SIZE,Mr as DEFAULT_GRID_SIZE,Rr as DEFAULT_GRID_STEP,ir as DEFAULT_LASER_COLOR,jr as DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT,lo as DEFAULT_PROPORTIONAL_RADIUS,Ao as DEFAULT_REDUCED_GLOBAL_ALPHA,ho as DEFAULT_SIDEBAR,Er as DEFAULT_TEXT_ALIGN,Ht as DEFAULT_TRANSFORM_HANDLE_SPACING,zr as DEFAULT_UI_OPTIONS,Me as DEFAULT_VERSION,_r as DEFAULT_VERTICAL_ALIGN,Ro as DOUBLE_TAP_POSITION_THRESHOLD,er as DRAGGING_THRESHOLD,To as EDITOR_LS_KEYS,v as ELEMENTS_PALETTE_SHADE_INDEXES,vo as ELEMENT_LINK_KEY,io as ELEMENT_READY_TO_ERASE_OPACITY,rr as ELEMENT_SHIFT_TRANSLATE_AMOUNT,or as ELEMENT_TRANSLATE_AMOUNT,eo as ENCRYPTION_KEY_BITS,Y as ENV,Gt as EPSILON,kt as EVENT,Or as EXPORT_DATA_TYPES,wr as EXPORT_IMAGE_TYPES,$r as EXPORT_SCALES,je as Emitter,T as FONT_FAMILY,ee as FONT_FAMILY_FALLBACKS,Ut as FONT_FAMILY_GENERIC_FALLBACKS,V as FONT_METADATA,pr as FONT_SIZES,hr as FRAME_STYLE,Io as GOOGLE_FONTS_RANGES,Gr as HYPERLINK_TOOLTIP_DELAY,Kr as IDLE_THRESHOLD,Re as IMAGE_MIME_TYPES,Cr as IMAGE_RENDER_TIMEOUT,O as KEYS,Zt as KeyCodeMap,bo as LIBRARY_DISABLED_TYPES,Yt as LIBRARY_SIDEBAR_TAB,nr as LINE_CONFIRM_THRESHOLD,Mo as LINE_POLYGON_POINT_MERGE_DISTANCE,Po as LOCAL_FONT_PROTOCOL,Zr as MAX_ALLOWED_FILE_BYTES,Nn as MAX_CUSTOM_COLORS_USED_IN_CANVAS,Xr as MAX_DECIMALS_FOR_SVG_EXPORT,Br as MAX_ZOOM,xe as MIME_TYPES,tr as MINIMUM_ARROW_SIZE,br as MIN_FONT_SIZE,xo as MIN_WIDTH_OR_HEIGHT,Hr as MIN_ZOOM,wo as MOBILE_ACTION_BUTTON_BG,ve as MONOSPACE_GENERIC_FONT,Yo as MQ_MAX_HEIGHT_LANDSCAPE,Ko as MQ_MAX_MOBILE,zo as MQ_MAX_TABLET,Wo as MQ_MAX_WIDTH_LANDSCAPE,Vo as MQ_MIN_TABLET,Xo as MQ_MIN_WIDTH_DESKTOP,$o as MQ_RIGHT_SIDEBAR_MIN_WIDTH,So as ORIG_ID,cr as POINTER_BUTTON,ur as POINTER_EVENTS,Ne as PromisePool,Le as Queue,Wt as ROUGHNESS,uo as ROUNDNESS,Ae as SANS_SERIF_GENERIC_FONT,Ur as SCROLL_TIMEOUT,sr as SHIFT_LOCKING_ANGLE,Bt as SIDE_RESIZING_THRESHOLD,_o as STATS_PANELS,Kt as STRING_MIME_TYPES,fo as STROKE_WIDTH,Jr as SVG_DOCUMENT_PREAMBLE,Qr as SVG_NS,Ir as TAP_TWICE_TIMEOUT,so as TEXT_ALIGN,Jn as TEXT_AUTOWRAP_THRESHOLD,ar as TEXT_TO_CENTER_SNAP_THRESHOLD,mr as THEME,Dr as TITLE_TIMEOUT,go as TOOL_TYPE,Pr as TOUCH_CTX_MENU_TIMEOUT,Vr as URL_HASH_KEYS,Yr as URL_QUERY_KEYS,Vt as UserIdleState,to as VERSIONS,kr as VERSION_TIMEOUT,ao as VERTICAL_ALIGN,k as WINDOWS_EMOJI_FALLBACK_FONT,fr as YOUTUBE_STATES,Nr as ZOOM_STEP,Hs as addEventListener,Qa as allowFullScreen,kn as applyDarkModeFilter,xs as arrayToList,Ts as arrayToMap,Es as arrayToMapWithIndex,_s as arrayToObject,Is as assertNever,bs as bytesToHexString,ka as capitalizeString,Vs as castArray,Va as chunk,Us as cloneJSON,Cs as composeEventHandlers,ta as createUserAgentDescriptor,Ka as debounce,_i as debugClear,Ei as debugCloseFrame,gi as debugDrawBounds,bi as debugDrawCubicBezier,oe as debugDrawLine,yn as debugDrawPoint,Ti as debugDrawPoints,ea as deriveStylesPanelMode,$a as distance,We as easeOut,Ya as easeToValuesRAF,Ye as escapeDoubleQuotes,Ja as exitFullScreen,ss as findIndex,is as findLastIndex,ms as focusNearestParent,Xn as getAllColorsSpecificShade,Da as getDateTime,Fr as getExportSource,Xs as getFeatureFlag,Se as getFontFamilyFallbacks,tn as getFontFamilyString,Ba as getFontString,Jo as getFormFactor,sn as getFrame,Nt as getGenericFontFamilyFallback,ns as getGlobalCSSVariable,ga as getGridPoint,ko as getLineHeight,ps as getNearestScrollableContainer,ha as getSizeFromPoints,S as getSpecificColorShades,Bs as getSvgPathFromStroke,gs as getUpdatedTimestamp,fs as getVersion,Do as getVerticalOffset,Ps as invariant,Ie as isAndroid,Ws as isAnyTrue,la as isArrowKey,ce as isBounds,Qo as isBrave,zt as isChrome,Ce as isDarwin,As as isDevEnv,jo as isFirefox,Za as isFullScreen,Pe as isIOS,en as isInputLike,Na as isInteractive,Qt as isLatinChar,li as isLocalLink,ks as isMemberOf,Xt as isMobileBreakpoint,Ls as isPrimitive,vs as isProdEnv,Os as isPromiseLike,rs as isRTL,cn as isReadonlyArray,ws as isRunningInIframe,Zo as isSafari,qa as isSelectionLikeTool,Ss as isServerEnv,ln as isShallowEqual,$t as isTabletBreakpoint,X as isTestEnv,Ua as isToolIcon,cs as isTransparent,qo as isWindows,Ha as isWritableElement,na as loadDesktopUIModePreference,ls as mapFind,ia as matchKey,Ds as memoize,as as muteFSAbortError,us as nFormatter,Ga as nextAnimationFrame,Gs as normalizeEOL,_n as normalizeLink,hs as preventUnload,Oe as promiseTry,Fs as queryFocusableElements,ni as randomId,ei as randomInteger,zs as reduceToCommonValue,Xa as removeSelection,ba as rescalePoints,ti as reseed,we as resolvablePromise,Dt as rgbToHex,Ys as safelyParseJSON,ts as sceneCoordsToViewportCoords,za as selectNode,Pa as setDateTimeForTests,ra as setDesktopUIMode,$s as setFeatureFlag,ua as shouldMaintainAspectRatio,ca as shouldResizeFromCenter,fa as shouldRotateWithDiscreteAngle,un as sizeOf,ds as supportsEmoji,Zn as supportsResizeObserver,Wa as throttleRAF,u as tinycolor,ys as toArray,Ks as toBrandedType,an as toIterable,ci as toValidURL,os as tupleToCoors,ja as updateActiveTool,Rs as updateObject,Ns as updateStable,es as viewportCoordsToSceneCoords,Ms as wrapEvent};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * x and y position of top left corner, x and y position of bottom right corner
3
+ */
4
+ export type Bounds = readonly [
5
+ minX: number,
6
+ minY: number,
7
+ maxX: number,
8
+ maxY: number
9
+ ];
10
+ export declare const isBounds: (box: unknown) => box is Bounds;
@@ -1,5 +1,8 @@
1
1
  import oc from "open-color";
2
+ import tinycolor from "tinycolor2";
2
3
  import type { Merge } from "./utility-types";
4
+ export { tinycolor };
5
+ export declare const applyDarkModeFilter: (color: string) => string;
3
6
  export declare const COLOR_OUTLINE_CONTRAST_THRESHOLD = 240;
4
7
  export type ColorPickerColor = Exclude<keyof oc, "indigo" | "lime"> | "transparent" | "bronze";
5
8
  export type ColorTuple = readonly [string, string, string, string, string];
@@ -19,7 +22,7 @@ export declare const DEFAULT_ELEMENT_STROKE_COLOR_INDEX = 4;
19
22
  export declare const DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX = 1;
20
23
  export declare const ELEMENTS_PALETTE_SHADE_INDEXES: readonly [0, 2, 4, 6, 8];
21
24
  export declare const CANVAS_PALETTE_SHADE_INDEXES: readonly [0, 1, 2, 3, 4];
22
- export declare const getSpecificColorShades: (color: Exclude<ColorPickerColor, "transparent" | "white" | "black" | "bronze">, indexArr: readonly [number, number, number, number, number]) => ColorTuple;
25
+ export declare const getSpecificColorShades: (color: Exclude<ColorPickerColor, "transparent" | "white" | "black" | "bronze">, indexArr: Readonly<ColorShadesIndexes>) => ColorTuple;
23
26
  export declare const COLOR_PALETTE: ColorPalette;
24
27
  export declare const DEFAULT_ELEMENT_STROKE_PICKS: ColorTuple;
25
28
  export declare const DEFAULT_ELEMENT_BACKGROUND_PICKS: ColorTuple;
@@ -59,4 +62,4 @@ export declare const DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE: {
59
62
  readonly bronze: ColorTuple;
60
63
  };
61
64
  export declare const getAllColorsSpecificShade: (index: 0 | 1 | 2 | 3 | 4) => readonly [string, string, string, string, string, string, string, string, string, string];
62
- export declare const rgbToHex: (r: number, g: number, b: number) => string;
65
+ export declare const rgbToHex: (r: number, g: number, b: number, a?: number) => string;
@@ -86,6 +86,12 @@ export declare const CLASSES: {
86
86
  SHAPE_ACTIONS_THEME_SCOPE: string;
87
87
  FRAME_NAME: string;
88
88
  };
89
+ export declare const FONT_SIZES: {
90
+ readonly sm: 16;
91
+ readonly md: 20;
92
+ readonly lg: 28;
93
+ readonly xl: 36;
94
+ };
89
95
  export declare const CJK_HAND_DRAWN_FALLBACK_FONT = "Xiaolai";
90
96
  export declare const WINDOWS_EMOJI_FALLBACK_FONT = "Segoe UI Emoji";
91
97
  /**
@@ -126,16 +132,13 @@ export declare const THEME: {
126
132
  readonly DARK: "dark";
127
133
  };
128
134
  export declare const FRAME_STYLE: {
129
- strokeColor: string;
130
- strokeWidth: number;
131
- strokeStyle: import("@excalidraw/element/types").StrokeStyle;
132
- fillStyle: import("@excalidraw/element/types").FillStyle;
133
- roughness: number;
134
- roundness: {
135
- type: import("@excalidraw/element/types").RoundnessType;
136
- value?: number | undefined;
137
- } | null;
138
- backgroundColor: string;
135
+ strokeColor: ExcalidrawElement["strokeColor"];
136
+ strokeWidth: ExcalidrawElement["strokeWidth"];
137
+ strokeStyle: ExcalidrawElement["strokeStyle"];
138
+ fillStyle: ExcalidrawElement["fillStyle"];
139
+ roughness: ExcalidrawElement["roughness"];
140
+ roundness: ExcalidrawElement["roundness"];
141
+ backgroundColor: ExcalidrawElement["backgroundColor"];
139
142
  radius: number;
140
143
  nameOffsetY: number;
141
144
  nameColorLightTheme: string;
@@ -223,7 +226,6 @@ export declare const MAX_ZOOM = 30;
223
226
  export declare const HYPERLINK_TOOLTIP_DELAY = 300;
224
227
  export declare const IDLE_THRESHOLD = 60000;
225
228
  export declare const ACTIVE_THRESHOLD = 3000;
226
- export declare const THEME_FILTER = "invert(93%) hue-rotate(180deg)";
227
229
  export declare const URL_QUERY_KEYS: {
228
230
  readonly addLibrary: "addLibrary";
229
231
  };
@@ -290,7 +292,7 @@ export declare const DEFAULT_SIDEBAR: {
290
292
  readonly name: "default";
291
293
  readonly defaultTab: "library";
292
294
  };
293
- export declare const LIBRARY_DISABLED_TYPES: Set<"embeddable" | "image" | "iframe">;
295
+ export declare const LIBRARY_DISABLED_TYPES: Set<"embeddable" | "iframe" | "image">;
294
296
  export declare const TOOL_TYPE: {
295
297
  readonly selection: "selection";
296
298
  readonly lasso: "lasso";
@@ -43,6 +43,4 @@ export declare const getVerticalOffset: (fontFamily: ExcalidrawTextElement["font
43
43
  /**
44
44
  * Gets line height for a selected family.
45
45
  */
46
- export declare const getLineHeight: (fontFamily: FontFamilyValues) => number & {
47
- _brand: "unitlessLineHeight";
48
- };
46
+ export declare const getLineHeight: (fontFamily: FontFamilyValues) => ExcalidrawTextElement["lineHeight"];
@@ -1,4 +1,5 @@
1
1
  export * from "./binary-heap";
2
+ export * from "./bounds";
2
3
  export * from "./colors";
3
4
  export * from "./constants";
4
5
  export * from "./font-metadata";
@@ -183,7 +183,7 @@ export declare const isLatinChar: (key: string) => boolean;
183
183
  * More details in https://github.com/excalidraw/excalidraw/pull/5944
184
184
  */
185
185
  export declare const matchKey: (event: KeyboardEvent | React.KeyboardEvent<Element>, key: ValueOf<typeof KEYS>) => boolean;
186
- export declare const isArrowKey: (key: string) => boolean;
186
+ export declare const isArrowKey: (key: string) => key is "ArrowDown" | "ArrowLeft" | "ArrowRight" | "ArrowUp";
187
187
  export declare const shouldResizeFromCenter: (event: MouseEvent | KeyboardEvent) => boolean;
188
188
  export declare const shouldMaintainAspectRatio: (event: MouseEvent | KeyboardEvent) => boolean;
189
189
  export declare const shouldRotateWithDiscreteAngle: (event: MouseEvent | KeyboardEvent | React.PointerEvent<HTMLCanvasElement>) => boolean;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type Mutable<T> = {
3
2
  -readonly [P in keyof T]: T[P];
4
3
  };
@@ -1,14 +1,14 @@
1
1
  import type { FontFamilyValues, FontString } from "@excalidraw/element/types";
2
2
  import type { ActiveTool, AppState, ToolType, UnsubscribeCallback, Zoom } from "@excalidraw/excalidraw/types";
3
- import type { MaybePromise } from "./utility-types";
3
+ import type { MaybePromise, ResolutionType } from "./utility-types";
4
4
  import type { EVENT } from "./constants";
5
5
  export declare const setDateTimeForTests: (dateTime: string) => void;
6
6
  export declare const getDateTime: () => string;
7
7
  export declare const capitalizeString: (str: string) => string;
8
8
  export declare const isToolIcon: (target: Element | EventTarget | null) => target is HTMLElement;
9
- export declare const isInputLike: (target: Element | EventTarget | null) => target is HTMLBRElement | HTMLDivElement | HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
9
+ export declare const isInputLike: (target: Element | EventTarget | null) => target is HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | HTMLBRElement | HTMLDivElement;
10
10
  export declare const isInteractive: (target: Element | EventTarget | null) => boolean;
11
- export declare const isWritableElement: (target: Element | EventTarget | null) => target is HTMLBRElement | HTMLDivElement | HTMLInputElement | HTMLTextAreaElement;
11
+ export declare const isWritableElement: (target: Element | EventTarget | null) => target is HTMLInputElement | HTMLTextAreaElement | HTMLBRElement | HTMLDivElement;
12
12
  export declare const getFontFamilyString: ({ fontFamily, }: {
13
13
  fontFamily: FontFamilyValues;
14
14
  }) => string;
@@ -71,18 +71,20 @@ export declare const easeToValuesRAF: <T extends Record<keyof T, number>, K exte
71
71
  * Interpolate a single value.
72
72
  * Return undefined to be handled by the default interpolator.
73
73
  */
74
- interpolateValue?: ((fromValue: number, toValue: number, progress: number, key: K) => number | undefined) | undefined;
74
+ interpolateValue?: (fromValue: number, toValue: number,
75
+ /** no easing applied */
76
+ progress: number, key: K) => number | undefined;
75
77
  onStep: (values: T) => void;
76
- duration?: number | undefined;
77
- onStart?: (() => void) | undefined;
78
- onEnd?: (() => void) | undefined;
79
- onCancel?: (() => void) | undefined;
78
+ duration?: number;
79
+ onStart?: () => void;
80
+ onEnd?: () => void;
81
+ onCancel?: () => void;
80
82
  }) => () => void;
81
- export declare const chunk: <T extends unknown>(array: readonly T[], size: number) => T[][];
83
+ export declare const chunk: <T extends any>(array: readonly T[], size: number) => T[][];
82
84
  export declare const selectNode: (node: Element) => void;
83
85
  export declare const removeSelection: () => void;
84
86
  export declare const distance: (x: number, y: number) => number;
85
- export declare const isSelectionLikeTool: (type: ToolType | "custom") => boolean;
87
+ export declare const isSelectionLikeTool: (type: ToolType | "custom") => type is "selection" | "lasso";
86
88
  export declare const updateActiveTool: (appState: Pick<AppState, "activeTool">, data: (({
87
89
  type: ToolType;
88
90
  } | {
@@ -140,7 +142,7 @@ export declare const muteFSAbortError: (error?: Error) => void;
140
142
  export declare const findIndex: <T>(array: readonly T[], cb: (element: T, index: number, array: readonly T[]) => boolean, fromIndex?: number) => number;
141
143
  export declare const findLastIndex: <T>(array: readonly T[], cb: (element: T, index: number, array: readonly T[]) => boolean, fromIndex?: number) => number;
142
144
  /** returns the first non-null mapped value */
143
- export declare const mapFind: <T, K>(collection: readonly T[], iteratee: (value: T, index: number) => K | null | undefined) => K | undefined;
145
+ export declare const mapFind: <T, K>(collection: readonly T[], iteratee: (value: T, index: number) => K | undefined | null) => K | undefined;
144
146
  export declare const isTransparent: (color: string) => boolean;
145
147
  export type ResolvablePromise<T> = Promise<T> & {
146
148
  resolve: [T] extends [undefined] ? (value?: MaybePromise<Awaited<T>>) => void : (value: MaybePromise<Awaited<T>>) => void;
@@ -159,16 +161,16 @@ export declare const getUpdatedTimestamp: () => number;
159
161
  * Transforms array of objects containing `id` attribute,
160
162
  * or array of ids (strings), into a Map, keyd by `id`.
161
163
  */
162
- export declare const arrayToMap: <T extends string | {
164
+ export declare const arrayToMap: <T extends {
163
165
  id: string;
164
- }>(items: Map<string, T> | readonly T[]) => Map<string, T>;
166
+ } | string>(items: readonly T[] | Map<string, T>) => Map<string, T>;
165
167
  export declare const arrayToMapWithIndex: <T extends {
166
168
  id: string;
167
169
  }>(elements: readonly T[]) => Map<string, [element: T, index: number]>;
168
170
  /**
169
171
  * Transform array into an object, use only when array order is irrelevant.
170
172
  */
171
- export declare const arrayToObject: <T>(array: readonly T[], groupBy?: ((value: T) => string | number) | undefined) => {
173
+ export declare const arrayToObject: <T>(array: readonly T[], groupBy?: (value: T) => string | number) => {
172
174
  [key: string]: T;
173
175
  };
174
176
  /** Doubly linked node */
@@ -184,11 +186,11 @@ export declare const arrayToList: <T>(array: readonly T[]) => Node<T>[];
184
186
  * Converts a readonly array or map into an iterable.
185
187
  * Useful for avoiding entry allocations when iterating object / map on each iteration.
186
188
  */
187
- export declare const toIterable: <T>(values: ReadonlyMap<string, T> | readonly T[]) => Iterable<T>;
189
+ export declare const toIterable: <T>(values: readonly T[] | ReadonlyMap<string, T>) => Iterable<T>;
188
190
  /**
189
191
  * Converts a readonly array or map into an array.
190
192
  */
191
- export declare const toArray: <T>(values: ReadonlyMap<string, T> | readonly T[]) => T[];
193
+ export declare const toArray: <T>(values: readonly T[] | ReadonlyMap<string, T>) => T[];
192
194
  export declare const isTestEnv: () => boolean;
193
195
  export declare const isDevEnv: () => boolean;
194
196
  export declare const isProdEnv: () => boolean;
@@ -198,20 +200,20 @@ export declare const wrapEvent: <T extends Event>(name: EVENT, nativeEvent: T) =
198
200
  }>;
199
201
  export declare const updateObject: <T extends Record<string, any>>(obj: T, updates: Partial<T>) => T;
200
202
  export declare const isPrimitive: (val: any) => boolean;
201
- export declare const getFrame: () => "iframe" | "top";
203
+ export declare const getFrame: () => "top" | "iframe";
202
204
  export declare const isRunningInIframe: () => boolean;
203
- export declare const isPromiseLike: (value: any) => value is Promise<any>;
205
+ export declare const isPromiseLike: (value: any) => value is Promise<ResolutionType<typeof value>>;
204
206
  export declare const queryFocusableElements: (container: HTMLElement | null) => HTMLElement[];
205
207
  /**
206
208
  * Returns whether object/array is shallow equal.
207
209
  * Considers empty object/arrays as equal (whether top-level or second-level).
208
210
  */
209
- export declare const isShallowEqual: <T extends Record<string, any>, K extends readonly unknown[]>(objA: T, objB: T, comparators?: { [key in keyof T]?: ((a: T[key], b: T[key]) => boolean) | undefined; } | (keyof T extends K[number] ? K extends readonly (keyof T)[] ? K : {
211
+ export declare const isShallowEqual: <T extends Record<string, any>, K extends readonly unknown[]>(objA: T, objB: T, comparators?: { [key in keyof T]?: (a: T[key], b: T[key]) => boolean; } | (keyof T extends K[number] ? K extends readonly (keyof T)[] ? K : {
210
212
  _error: "keys are either missing or include keys not in compared obj";
211
213
  } : {
212
214
  _error: "keys are either missing or include keys not in compared obj";
213
- }) | undefined, debug?: boolean) => boolean;
214
- export declare const composeEventHandlers: <E>(originalEventHandler?: ((event: E) => void) | undefined, ourEventHandler?: ((event: E) => void) | undefined, { checkForDefaultPrevented }?: {
215
+ }), debug?: boolean) => boolean;
216
+ export declare const composeEventHandlers: <E>(originalEventHandler?: (event: E) => void, ourEventHandler?: (event: E) => void, { checkForDefaultPrevented }?: {
215
217
  checkForDefaultPrevented?: boolean | undefined;
216
218
  }) => (event: E) => void;
217
219
  /**
@@ -223,11 +225,15 @@ export declare function invariant(condition: any, message: string): asserts cond
223
225
  /**
224
226
  * Memoizes on values of `opts` object (strict equality).
225
227
  */
226
- export declare const memoize: <T extends Record<string, any>, R extends unknown>(func: (opts: T) => R) => ((opts: T) => R) & {
228
+ export declare const memoize: <T extends Record<string, any>, R extends any>(func: (opts: T) => R) => typeof func & {
227
229
  clear: () => void;
228
230
  };
229
231
  /** Checks if value is inside given collection. Useful for type-safety. */
230
- export declare const isMemberOf: <T extends string>(collection: Set<T> | Record<T, any> | Map<T, any> | readonly T[], value: string) => value is T;
232
+ export declare const isMemberOf: <T extends string>(
233
+ /** Set/Map/Array/Object */
234
+ collection: Set<T> | readonly T[] | Record<T, any> | Map<T, any>,
235
+ /** value to look for */
236
+ value: string) => value is T;
231
237
  export declare const cloneJSON: <T>(obj: T) => T;
232
238
  export declare const updateStable: <T extends any[] | Record<string, any>>(prevValue: T, nextValue: T) => T;
233
239
  export declare function addEventListener<K extends keyof WindowEventMap>(target: Window & typeof globalThis, type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): UnsubscribeCallback;
@@ -238,21 +244,25 @@ export declare function addEventListener<K extends keyof FontFaceSetEventMap>(ta
238
244
  export declare function addEventListener<K extends keyof HTMLElementEventMap>(target: Document | (Window & typeof globalThis) | HTMLElement | undefined | null | false, type: K, listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): UnsubscribeCallback;
239
245
  export declare function getSvgPathFromStroke(points: number[][], closed?: boolean): string;
240
246
  export declare const normalizeEOL: (str: string) => string;
241
- type HasBrand<T> = {
242
- [K in keyof T]: K extends `~brand${infer _}` ? true : never;
247
+ export type HasBrand<T> = {
248
+ [K in keyof T]: K extends `~brand${infer _}` | "_brand" ? true : never;
243
249
  }[keyof T];
244
250
  type RemoveAllBrands<T> = HasBrand<T> extends true ? {
245
- [K in keyof T as K extends `~brand~${infer _}` ? never : K]: T[K];
246
- } : never;
247
- type Unbrand<T> = T extends Map<infer E, infer F> ? Map<E, F> : T extends Set<infer E> ? Set<E> : T extends Array<infer E> ? Array<E> : RemoveAllBrands<T>;
251
+ [K in keyof T as K extends `~brand~${infer _}` | "_brand" ? never : K]: T[K];
252
+ } : T;
253
+ type UnbrandForValue<T> = T extends Map<infer E, infer F> ? Map<UnbrandForValue<E>, UnbrandForValue<F>> : T extends Set<infer E> ? Set<UnbrandForValue<E>> : T extends readonly any[] ? T extends any[] ? unknown[] : readonly unknown[] : RemoveAllBrands<T>;
254
+ export type Unbrand<T> = T extends Map<infer E, infer F> ? Map<Unbrand<E>, Unbrand<F>> : T extends Set<infer E> ? Set<Unbrand<E>> : T extends readonly (infer E)[] ? Array<Unbrand<E>> : RemoveAllBrands<T>;
255
+ export type CombineBrands<BrandedType, CurrentType> = BrandedType extends readonly (infer BE)[] ? CurrentType extends readonly (infer CE)[] ? Array<CE & BE> : CurrentType & BrandedType : CurrentType & BrandedType;
256
+ export type CombineBrandsIfNeeded<T, Required> = [T] extends [Required] ? T[] : HasBrand<T> extends true ? CombineBrands<T, Required>[] : Required[];
248
257
  /**
249
258
  * Makes type into a branded type, ensuring that value is assignable to
250
- * the base ubranded type. Optionally you can explicitly supply current value
259
+ * the base unbranded type. Optionally you can explicitly supply current value
251
260
  * type to combine both (useful for composite branded types. Make sure you
252
261
  * compose branded types which are not composite themselves.)
253
262
  */
254
- export declare const toBrandedType: <BrandedType, CurrentType = BrandedType>(value: Unbrand<BrandedType>) => CurrentType & BrandedType;
255
- export declare const promiseTry: <TValue, TArgs extends unknown[]>(fn: (...args: TArgs) => TValue | PromiseLike<TValue>, ...args: TArgs) => Promise<TValue>;
263
+ export declare function toBrandedType<BrandedType>(value: UnbrandForValue<BrandedType>): BrandedType;
264
+ export declare function toBrandedType<BrandedType, CurrentType>(value: CurrentType): CombineBrands<BrandedType, CurrentType>;
265
+ export declare const promiseTry: <TValue, TArgs extends unknown[]>(fn: (...args: TArgs) => PromiseLike<TValue> | TValue, ...args: TArgs) => Promise<TValue>;
256
266
  export declare const isAnyTrue: (...args: boolean[]) => boolean;
257
267
  export declare const safelyParseJSON: (json: string) => Record<string, any> | null;
258
268
  /**
@@ -264,10 +274,10 @@ export declare const castArray: <T>(value: T | T[]) => T[];
264
274
  /** hack for Array.isArray type guard not working with readonly value[] */
265
275
  export declare const isReadonlyArray: (value?: any) => value is readonly any[];
266
276
  export declare const sizeOf: (value: readonly unknown[] | Readonly<Map<string, unknown>> | Readonly<Record<string, unknown>> | ReadonlySet<unknown>) => number;
267
- export declare const reduceToCommonValue: <T, R = T>(collection: ReadonlySet<T> | readonly T[], getValue?: ((item: T) => R) | undefined) => R | null;
277
+ export declare const reduceToCommonValue: <T, R = T>(collection: readonly T[] | ReadonlySet<T>, getValue?: (item: T) => R) => R | null;
268
278
  type FEATURE_FLAGS = {
269
279
  COMPLEX_BINDINGS: boolean;
270
280
  };
271
- export declare const getFeatureFlag: <F extends "COMPLEX_BINDINGS">(flag: F) => FEATURE_FLAGS[F];
272
- export declare const setFeatureFlag: <F extends "COMPLEX_BINDINGS">(flag: F, value: FEATURE_FLAGS[F]) => void;
281
+ export declare const getFeatureFlag: <F extends keyof FEATURE_FLAGS>(flag: F) => FEATURE_FLAGS[F];
282
+ export declare const setFeatureFlag: <F extends keyof FEATURE_FLAGS>(flag: F, value: FEATURE_FLAGS[F]) => void;
273
283
  export {};
@@ -1,7 +1,7 @@
1
1
  import { type GlobalPoint, type LocalPoint } from "@excalidraw/math";
2
2
  import type { Curve } from "@excalidraw/math";
3
3
  import type { LineSegment } from "@excalidraw/utils";
4
- import type { Bounds } from "@excalidraw/element";
4
+ import { type Bounds } from "./bounds";
5
5
  declare global {
6
6
  interface Window {
7
7
  visualDebug?: {