@excalidraw/common 0.18.0-4e471c107 → 0.18.0-5fffc47

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 (82) hide show
  1. package/dist/dev/index.js +91 -25
  2. package/dist/dev/index.js.map +2 -2
  3. package/dist/prod/index.js +3 -3
  4. package/dist/types/common/src/constants.d.ts +24 -4
  5. package/dist/types/common/src/utils.d.ts +3 -0
  6. package/dist/types/element/src/Scene.d.ts +6 -2
  7. package/dist/types/element/src/align.d.ts +2 -1
  8. package/dist/types/element/src/bounds.d.ts +1 -1
  9. package/dist/types/element/src/delta.d.ts +16 -4
  10. package/dist/types/element/src/distribute.d.ts +2 -1
  11. package/dist/types/element/src/groups.d.ts +1 -0
  12. package/dist/types/element/src/index.d.ts +1 -0
  13. package/dist/types/element/src/linearElementEditor.d.ts +2 -1
  14. package/dist/types/element/src/positionElementsOnGrid.d.ts +2 -0
  15. package/dist/types/element/src/renderElement.d.ts +4 -1
  16. package/dist/types/element/src/store.d.ts +6 -1
  17. package/dist/types/element/src/textElement.d.ts +1 -1
  18. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +21 -9
  19. package/dist/types/excalidraw/actions/actionBoundText.d.ts +14 -6
  20. package/dist/types/excalidraw/actions/actionCanvas.d.ts +94 -41
  21. package/dist/types/excalidraw/actions/actionClipboard.d.ts +45 -20
  22. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +7 -3
  23. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +24 -12
  24. package/dist/types/excalidraw/actions/actionElementLink.d.ts +7 -3
  25. package/dist/types/excalidraw/actions/actionElementLock.d.ts +14 -6
  26. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +7 -3
  27. package/dist/types/excalidraw/actions/actionExport.d.ts +63 -27
  28. package/dist/types/excalidraw/actions/actionFinalize.d.ts +16 -7
  29. package/dist/types/excalidraw/actions/actionFrame.d.ts +28 -12
  30. package/dist/types/excalidraw/actions/actionGroup.d.ts +14 -6
  31. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +41 -6
  32. package/dist/types/excalidraw/actions/actionLink.d.ts +6 -2
  33. package/dist/types/excalidraw/actions/actionMenu.d.ts +7 -371
  34. package/dist/types/excalidraw/actions/actionNavigate.d.ts +14 -6
  35. package/dist/types/excalidraw/actions/actionProperties.d.ts +122 -53
  36. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +7 -3
  37. package/dist/types/excalidraw/actions/actionStyles.d.ts +7 -3
  38. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +7 -3
  39. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +7 -3
  40. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +7 -3
  41. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +7 -3
  42. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +7 -3
  43. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +7 -3
  44. package/dist/types/excalidraw/actions/index.d.ts +2 -2
  45. package/dist/types/excalidraw/actions/types.d.ts +1 -1
  46. package/dist/types/excalidraw/appState.d.ts +5 -1
  47. package/dist/types/excalidraw/clipboard.d.ts +64 -1
  48. package/dist/types/excalidraw/components/Actions.d.ts +17 -7
  49. package/dist/types/excalidraw/components/App.d.ts +10 -8
  50. package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +1 -0
  51. package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +2 -0
  52. package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +2 -1
  53. package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +2 -1
  54. package/dist/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +1 -0
  55. package/dist/types/excalidraw/components/Ellipsify.d.ts +4 -0
  56. package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +1 -1
  57. package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +2 -1
  58. package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +3 -1
  59. package/dist/types/excalidraw/components/InlineIcon.d.ts +3 -1
  60. package/dist/types/excalidraw/components/LayerUI.d.ts +2 -1
  61. package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +1 -1
  62. package/dist/types/excalidraw/components/MobileMenu.d.ts +3 -5
  63. package/dist/types/excalidraw/components/MobileToolBar.d.ts +11 -0
  64. package/dist/types/excalidraw/components/PropertiesPopover.d.ts +1 -0
  65. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +1 -2
  66. package/dist/types/excalidraw/components/TextField.d.ts +1 -0
  67. package/dist/types/excalidraw/components/ToolPopover.d.ts +25 -0
  68. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +4 -2
  69. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +2 -1
  70. package/dist/types/excalidraw/components/icons.d.ts +5 -0
  71. package/dist/types/excalidraw/components/shapes.d.ts +129 -1
  72. package/dist/types/excalidraw/data/blob.d.ts +3 -7
  73. package/dist/types/excalidraw/data/reconcile.d.ts +1 -0
  74. package/dist/types/excalidraw/data/restore.d.ts +6 -1
  75. package/dist/types/excalidraw/data/types.d.ts +4 -1
  76. package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
  77. package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
  78. package/dist/types/excalidraw/index.d.ts +2 -1
  79. package/dist/types/excalidraw/renderer/staticScene.d.ts +4 -1
  80. package/dist/types/excalidraw/types.d.ts +16 -6
  81. package/dist/types/math/src/segment.d.ts +1 -0
  82. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- var he=Object.create;var Y=Object.defineProperty;var ye=Object.getOwnPropertyDescriptor;var ge=Object.getOwnPropertyNames;var Le=Object.getPrototypeOf,Se=Object.prototype.hasOwnProperty;var Oe=(e,t)=>()=>(e&&(t=e(e=0)),t);var V=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Re=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of ge(t))!Se.call(e,s)&&s!==n&&Y(e,s,{get:()=>t[s],enumerable:!(r=ye(t,s))||r.enumerable});return e};var X=(e,t,n)=>(n=e!=null?he(Le(e)):{},Re(t||!e||!e.__esModule?Y(n,"default",{value:e,enumerable:!0}):n,e));var f,c=Oe(()=>{f={PROD:!0}});var le=V((G,ae)=>{c();(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof G=="object"?ae.exports=t():(e.PromisePool=t(),e.promisePool=e.PromisePool)})(G,function(){"use strict";var e=function(){this._listeners={}};e.prototype.addEventListener=function(o,a){this._listeners[o]=this._listeners[o]||[],this._listeners[o].indexOf(a)<0&&this._listeners[o].push(a)},e.prototype.removeEventListener=function(o,a){if(this._listeners[o]){var p=this._listeners[o].indexOf(a);p>=0&&this._listeners[o].splice(p,1)}},e.prototype.dispatchEvent=function(o){if(this._listeners[o.type]&&this._listeners[o.type].length)for(var a=this._listeners[o.type].slice(),p=0,m=a.length;p<m;++p)a[p].call(this,o)};var t=function(o){return typeof o.constructor=="function"&&o.constructor.name==="GeneratorFunction"},n=function(o){return{next:function(){var a=o();return a?{value:a}:{done:!0}}}},r=function(o){var a=!1;return{next:function(){return a?{done:!0}:(a=!0,{value:o})}}},s=function(o,a){var p=typeof o;if(p==="object"){if(typeof o.next=="function")return o;if(typeof o.then=="function")return r(o)}return p==="function"?t(o)?o():n(o):r(a.resolve(o))},l=function(o,a,p){this.target=o,this.type=a,this.data=p},i=function(o,a,p){if(e.call(this),typeof a!="number"||Math.floor(a)!==a||a<1)throw new Error("Invalid concurrency");this._concurrency=a,this._options=p||{},this._options.promise=this._options.promise||Promise,this._iterator=s(o,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(o){return typeof o<"u"&&(this._concurrency=o,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 o=this,a=this._options.promise;return this._promise=new a(function(p,m){o._callbacks={reject:m,resolve:p},o._proceed()}),this._promise},i.prototype._fireEvent=function(o,a){this.dispatchEvent(new l(this,o,a))},i.prototype._settle=function(o){o?this._callbacks.reject(o):this._callbacks.resolve(),this._promise=null,this._callbacks=null},i.prototype._onPooledPromiseFulfilled=function(o,a){this._size--,this.active()&&(this._fireEvent("fulfilled",{promise:o,result:a}),this._proceed())},i.prototype._onPooledPromiseRejected=function(o,a){this._size--,this.active()&&(this._fireEvent("rejected",{promise:o,error:a}),this._settle(a||new Error("Unknown error")))},i.prototype._trackPromise=function(o){var a=this;o.then(function(p){a._onPooledPromiseFulfilled(o,p)},function(p){a._onPooledPromiseRejected(o,p)}).catch(function(p){a._settle(new Error("Promise processing failed: "+p))})},i.prototype._proceed=function(){if(!this._done){for(var o={done:!1};this._size<this._concurrency&&!(o=this._iterator.next()).done;)this._size++,this._trackPromise(o.value);this._done=o===null||!!o.done}this._done&&this._size===0&&this._settle()},i.PromisePoolEvent=l,i.PromisePool=i,i})});var be=V(U=>{"use strict";c();Object.defineProperty(U,"__esModule",{value:!0});U.sanitizeUrl=void 0;var tt=/^([^\w]*)(javascript|data|vbscript)/im,nt=/&#(\w+)(^\w|;)?/g,rt=/&(newline|tab);/gi,ot=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,st=/^.+(:|&colon;)/gim,it=[".","/"];function at(e){return it.indexOf(e[0])>-1}function lt(e){return e.replace(nt,function(t,n){return String.fromCharCode(n)})}function ct(e){var t=lt(e||"").replace(rt,"").replace(ot,"").trim();if(!t)return"about:blank";if(at(t))return t;var n=t.match(st);if(!n)return t;var r=n[0];return tt.test(r)?"about:blank":t}U.sanitizeUrl=ct});c();c();var $=class{constructor(t){this.scoreFunction=t}content=[];sinkDown(t){let n=this.content[t];for(;t>0;){let r=(t+1>>1)-1,s=this.content[r];if(this.scoreFunction(n)<this.scoreFunction(s))this.content[r]=n,this.content[t]=s,t=r;else break}}bubbleUp(t){let n=this.content.length,r=this.content[t],s=this.scoreFunction(r);for(;;){let l=t+1<<1,i=l-1,o=null,a=0;if(i<n){let p=this.content[i];a=this.scoreFunction(p),a<s&&(o=i)}if(l<n){let p=this.content[l];this.scoreFunction(p)<(o===null?s:a)&&(o=l)}if(o!==null)this.content[t]=this.content[o],this.content[o]=r,t=o;else break}}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))}};c();var z={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 xt=240,Fe=(e,t)=>t.reduce((n,r)=>(r in e&&(n[r]=e[r]),n),{}),bt=5,_t=5,At=4,C=4,F=1,E=[0,2,4,6,8],ht=[0,1,2,3,4],x=(e,t)=>t.map(n=>z[e][n]),u={transparent:"transparent",black:"#1e1e1e",white:"#ffffff",gray:x("gray",E),red:x("red",E),pink:x("pink",E),grape:x("grape",E),violet:x("violet",E),blue:x("blue",E),cyan:x("cyan",E),teal:x("teal",E),green:x("green",E),yellow:x("yellow",E),orange:x("orange",E),bronze:["#f8f1ee","#eaddd7","#d2bab0","#a18072","#846358"]},j=Fe(u,["cyan","blue","violet","grape","pink","green","teal","yellow","orange","red"]),yt=[u.black,u.red[C],u.green[C],u.blue[C],u.yellow[C]],gt=[u.transparent,u.red[F],u.green[F],u.blue[F],u.yellow[F]],Lt=[u.white,"#f8f9fa","#f5faff","#fffce8","#fdf8f6"],St={transparent:u.transparent,white:u.white,gray:u.gray,black:u.black,bronze:u.bronze,...j},Ot={transparent:u.transparent,white:u.white,gray:u.gray,black:u.black,bronze:u.bronze,...j},Rt=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]],vt=(e,t,n)=>`#${((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)}`;c();var w=/Mac|iPod|iPhone|iPad/.test(navigator.platform),It=/^Win/.test(navigator.platform),Mt=/\b(android)\b/i.test(navigator.userAgent),Pt=typeof window<"u"&&"netscape"in window&&navigator.userAgent.indexOf("rv:")>1&&navigator.userAgent.indexOf("Gecko")>1,we=navigator.userAgent.indexOf("Chrome")!==-1,Dt=!we&&navigator.userAgent.indexOf("Safari")!==-1,Ut=/iPad|iPhone/.test(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document,Nt=()=>navigator.brave?.isBrave?.name==="isBrave",kt=typeof window<"u"&&"ResizeObserver"in window,Ht="Excalidraw",Kt=36,Bt=10,Gt=8,Wt=5,Yt=1,Vt=30,Xt=Math.PI/12,$t="red",zt={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},jt={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1,ERASER:5},Zt={enabled:"all",disabled:"none",inheritFromUI:"var(--ui-pointerEvents)"},Ie=(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))(Ie||{}),qt={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5},I={TEST:"test",DEVELOPMENT:"development",PRODUCTION:"production"},Qt={SHAPE_ACTIONS_MENU:"App-menu__left",ZOOM_ACTIONS:"zoom-actions",SEARCH_MENU_INPUT_WRAPPER:"layer-ui__search-inputWrapper",CONVERT_ELEMENT_TYPE_POPUP:"ConvertElementTypePopup"},q="Xiaolai",L="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},Q="sans-serif",J="monospace",Me={[Q]:998,[J]:999},B={[q]:100,...Me,[L]:1e3};function Pe(e){switch(e){case T.Cascadia:case T["Comic Shanns"]:return J;default:return Q}}var ee=e=>{let t=Pe(e);switch(e){case T.Excalifont:return[q,t,L];default:return[t,L]}},Jt={LIGHT:"light",DARK:"dark"},en={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},tn=1,nn=20,rn=T.Excalifont,on="left",sn="top",te="{version}",De=2,Ue=2*De,Ne=1e-5,an=2*Ue-Ne,ln="#ffffff",cn="#1e1e1e",un="#a2f1a6",pn=["selectAll"],dn=20,fn=5,ne={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"},Z={text:"text/plain",html:"text/html",json:"application/json",excalidraw:"application/vnd.excalidraw+json",excalidrawlib:"application/vnd.excalidrawlib+json","excalidraw.svg":"image/svg+xml","excalidraw.png":"image/png",binary:"application/octet-stream",...ne},Tn=[Z.text,Z.html,...Object.values(ne)],mn={png:"png",svg:"svg",clipboard:"clipboard"},En={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawLibrary:"excalidrawlib",excalidrawClipboardWithAPI:"excalidraw-api/clipboard"},xn=()=>window.EXCALIDRAW_EXPORT_SOURCE||window.location.origin,bn=500,_n=300,An=500,hn=1e4,yn=3e4,gn=100,Ln=.1,Sn=.1,On=30,Rn=300,vn=6e4,Cn=3e3,Fn="invert(93%) hue-rotate(180deg)",wn={addLibrary:"addLibrary"},In={addLibrary:"addLibrary"},Mn={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,toggleTheme:null,saveAsImage:!0},tools:{image:!0}},Pn=730,Dn=1e3,Un=500,Nn=1229,kn=2,Hn=[1,2,3],Kn=10,Bn=1440,Gn=4*1024*1024,Wn="http://www.w3.org/2000/svg",Yn=`<?xml version="1.0" standalone="no"?>
1
+ var ge=Object.create;var V=Object.defineProperty;var Se=Object.getOwnPropertyDescriptor;var Le=Object.getOwnPropertyNames;var Oe=Object.getPrototypeOf,Re=Object.prototype.hasOwnProperty;var ve=(e,t)=>()=>(e&&(t=e(e=0)),t);var X=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ce=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Le(t))!Re.call(e,o)&&o!==n&&V(e,o,{get:()=>t[o],enumerable:!(r=Se(t,o))||r.enumerable});return e};var $=(e,t,n)=>(n=e!=null?ge(Oe(e)):{},Ce(t||!e||!e.__esModule?V(n,"default",{value:e,enumerable:!0}):n,e));var f,c=ve(()=>{f={PROD:!0}});var ue=X((W,ce)=>{c();(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof W=="object"?ce.exports=t():(e.PromisePool=t(),e.promisePool=e.PromisePool)})(W,function(){"use strict";var e=function(){this._listeners={}};e.prototype.addEventListener=function(s,a){this._listeners[s]=this._listeners[s]||[],this._listeners[s].indexOf(a)<0&&this._listeners[s].push(a)},e.prototype.removeEventListener=function(s,a){if(this._listeners[s]){var p=this._listeners[s].indexOf(a);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 a=this._listeners[s.type].slice(),p=0,m=a.length;p<m;++p)a[p].call(this,s)};var t=function(s){return typeof s.constructor=="function"&&s.constructor.name==="GeneratorFunction"},n=function(s){return{next:function(){var a=s();return a?{value:a}:{done:!0}}}},r=function(s){var a=!1;return{next:function(){return a?{done:!0}:(a=!0,{value:s})}}},o=function(s,a){var p=typeof s;if(p==="object"){if(typeof s.next=="function")return s;if(typeof s.then=="function")return r(s)}return p==="function"?t(s)?s():n(s):r(a.resolve(s))},l=function(s,a,p){this.target=s,this.type=a,this.data=p},i=function(s,a,p){if(e.call(this),typeof a!="number"||Math.floor(a)!==a||a<1)throw new Error("Invalid concurrency");this._concurrency=a,this._options=p||{},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,a=this._options.promise;return this._promise=new a(function(p,m){s._callbacks={reject:m,resolve:p},s._proceed()}),this._promise},i.prototype._fireEvent=function(s,a){this.dispatchEvent(new l(this,s,a))},i.prototype._settle=function(s){s?this._callbacks.reject(s):this._callbacks.resolve(),this._promise=null,this._callbacks=null},i.prototype._onPooledPromiseFulfilled=function(s,a){this._size--,this.active()&&(this._fireEvent("fulfilled",{promise:s,result:a}),this._proceed())},i.prototype._onPooledPromiseRejected=function(s,a){this._size--,this.active()&&(this._fireEvent("rejected",{promise:s,error:a}),this._settle(a||new Error("Unknown error")))},i.prototype._trackPromise=function(s){var a=this;s.then(function(p){a._onPooledPromiseFulfilled(s,p)},function(p){a._onPooledPromiseRejected(s,p)}).catch(function(p){a._settle(new Error("Promise processing failed: "+p))})},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=l,i.PromisePool=i,i})});var he=X(U=>{"use strict";c();Object.defineProperty(U,"__esModule",{value:!0});U.sanitizeUrl=void 0;var st=/^([^\w]*)(javascript|data|vbscript)/im,it=/&#(\w+)(^\w|;)?/g,at=/&(newline|tab);/gi,lt=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,ct=/^.+(:|&colon;)/gim,ut=[".","/"];function pt(e){return ut.indexOf(e[0])>-1}function dt(e){return e.replace(it,function(t,n){return String.fromCharCode(n)})}function ft(e){var t=dt(e||"").replace(at,"").replace(lt,"").trim();if(!t)return"about:blank";if(pt(t))return t;var n=t.match(ct);if(!n)return t;var r=n[0];return st.test(r)?"about:blank":t}U.sanitizeUrl=ft});c();c();var z=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,l=this.content[o];if(r<this.scoreFunction(l))this.content[t]=l,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 l=(t+1<<1)-1,i=l+1,s=t,a=o;if(l<n){let p=this.scoreFunction(this.content[l]);p<a&&(s=l,a=p)}if(i<n&&this.scoreFunction(this.content[i])<a&&(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))}};c();var j={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 At=240,Me=(e,t)=>t.reduce((n,r)=>(r in e&&(n[r]=e[r]),n),{}),yt=5,gt=5,St=4,C=4,F=1,E=[0,2,4,6,8],Lt=[0,1,2,3,4],x=(e,t)=>t.map(n=>j[e][n]),u={transparent:"transparent",black:"#1e1e1e",white:"#ffffff",gray:x("gray",E),red:x("red",E),pink:x("pink",E),grape:x("grape",E),violet:x("violet",E),blue:x("blue",E),cyan:x("cyan",E),teal:x("teal",E),green:x("green",E),yellow:x("yellow",E),orange:x("orange",E),bronze:["#f8f1ee","#eaddd7","#d2bab0","#a18072","#846358"]},Z=Me(u,["cyan","blue","violet","grape","pink","green","teal","yellow","orange","red"]),Ot=[u.black,u.red[C],u.green[C],u.blue[C],u.yellow[C]],Rt=[u.transparent,u.red[F],u.green[F],u.blue[F],u.yellow[F]],vt=[u.white,"#f8f9fa","#f5faff","#fffce8","#fdf8f6"],Ct={transparent:u.transparent,white:u.white,gray:u.gray,black:u.black,bronze:u.bronze,...Z},Ft={transparent:u.transparent,white:u.white,gray:u.gray,black:u.black,bronze:u.bronze,...Z},wt=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]],Mt=(e,t,n)=>`#${((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1)}`;c();var w=/Mac|iPod|iPhone|iPad/.test(navigator.platform),Ut=/^Win/.test(navigator.platform),Q=/\b(android)\b/i.test(navigator.userAgent),Nt=typeof window<"u"&&"netscape"in window&&navigator.userAgent.indexOf("rv:")>1&&navigator.userAgent.indexOf("Gecko")>1,Ie=navigator.userAgent.indexOf("Chrome")!==-1,kt=!Ie&&navigator.userAgent.indexOf("Safari")!==-1,B=/iPad|iPhone/i.test(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document,Ht=()=>navigator.brave?.isBrave?.name==="isBrave",Kt=B||/android|webos|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent)||/android|ios|ipod|blackberry|windows phone/i.test(navigator.platform),Bt=typeof window<"u"&&"ResizeObserver"in window,Gt="Excalidraw",Wt=36,Yt=10,Vt=20,Xt=8,$t=5,zt=1,jt=30,Zt=Math.PI/12,qt="red",Qt={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},Jt={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1,ERASER:5},en={enabled:"all",disabled:"none",inheritFromUI:"var(--ui-pointerEvents)"},Pe=(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))(Pe||{}),tn={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5},M={TEST:"test",DEVELOPMENT:"development",PRODUCTION:"production"},nn={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"},J="Xiaolai",S="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},ee="sans-serif",te="monospace",De={[ee]:998,[te]:999},G={[J]:100,...De,[S]:1e3};function Ue(e){switch(e){case T.Cascadia:case T["Comic Shanns"]:return te;default:return ee}}var ne=e=>{let t=Ue(e);switch(e){case T.Excalifont:return[J,t,S];default:return[t,S]}},rn={LIGHT:"light",DARK:"dark"},on={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},sn=1,an=20,ln=T.Excalifont,cn="left",un="top",re="{version}",Ne=2,ke=2*Ne,He=1e-5,pn=2*ke-He,dn="#ffffff",fn="#1e1e1e",Tn="#a2f1a6",mn=["selectAll"],En=20,xn=5,oe={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"},Ke={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"},q={...Ke,"excalidraw.svg":"image/svg+xml","excalidraw.png":"image/png",binary:"application/octet-stream",...oe},bn=[q.text,q.html,...Object.values(oe)],_n={png:"png",svg:"svg",clipboard:"clipboard"},hn={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawLibrary:"excalidrawlib",excalidrawClipboardWithAPI:"excalidraw-api/clipboard"},An=()=>window.EXCALIDRAW_EXPORT_SOURCE||window.location.origin,yn=500,gn=300,Sn=500,Ln=1e4,On=3e4,Rn=100,vn=.1,Cn=.1,Fn=30,wn=300,Mn=6e4,In=3e3,Pn="invert(93%) hue-rotate(180deg)",Dn={addLibrary:"addLibrary"},Un={addLibrary:"addLibrary"},Nn={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,toggleTheme:null,saveAsImage:!0},tools:{image:!0}},Be=599,kn=1e3,Hn=500,Kn=Be+1,Bn=1400,Gn=1440,Wn=1229,Yn=2,Vn=[1,2,3],Xn=10,$n=1440,zn=4*1024*1024,jn="http://www.w3.org/2000/svg",Zn=`<?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
- `,Vn=128,Xn={excalidraw:2,excalidrawLibrary:2},$n=5,zn=.7,jn=11,Zn={TOP:"top",MIDDLE:"middle",BOTTOM:"bottom"},qn={LEFT:"left",CENTER:"center",RIGHT:"right"},Qn=20,Jn=.25,er=32,tr={LEGACY:1,PROPORTIONAL_RADIUS:2,ADAPTIVE_RADIUS:3},ke={architect:0,artist:1,cartoonist:2},nr={thin:1,bold:2,extraBold:4},rr={strokeColor:u.black,backgroundColor:u.transparent,fillStyle:"solid",strokeWidth:2,strokeStyle:"solid",roughness:ke.artist,opacity:100,locked:!1},He="library",or="search",sr={name:"default",defaultTab:He},ir=new Set(["iframe","embeddable","image"]),ar={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"},lr={OAI_API_KEY:"excalidraw-oai-api-key",MERMAID_TO_EXCALIDRAW:"mermaid-to-excalidraw",PUBLISH_LIBRARY:"publish-library-data"},cr="Untitled",ur={generalStats:1,elementProperties:2},pr=1,dr={sharp:"sharp",round:"round",elbow:"elbow"},fr=.3,Tr="element",mr=Symbol.for("__test__originalId__"),Ke=(r=>(r.ACTIVE="active",r.AWAY="away",r.IDLE="idle",r))(Ke||{}),Er=20;c();var M={[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},[B.Xiaolai]:{metrics:{unitsPerEm:1e3,ascender:880,descender:-144,lineHeight:1.25},fallback:!0},[B["Segoe UI Emoji"]]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},local:!0,fallback:!0}},Ar={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"},hr="local:",yr=(e,t,n)=>{let{unitsPerEm:r,ascender:s,descender:l}=M[e]?.metrics||M[T.Excalifont].metrics,i=t/r,o=(n-i*s+i*l)/2;return i*s+o},gr=e=>{let{lineHeight:t}=M[e]?.metrics||M[T.Excalifont].metrics;return t};c();var re=class{jobs=[];running=!1;tick(){if(this.running)return;let t=this.jobs.shift();t?(this.running=!0,t.promise.resolve(se(t.jobFactory,...t.args).finally(()=>{this.running=!1,this.tick()}))):this.running=!1}push(t,...n){let r=oe();return this.jobs.push({jobFactory:t,promise:r,args:n}),this.tick(),r}};c();var ie={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"},y={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:w?"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"},Be=new Map([[y.Z,ie.Z],[y.Y,ie.Y]]),Ge=e=>/^[a-z]$/.test(e.toLowerCase()),Fr=(e,t)=>{if(t===e.key.toLowerCase())return!0;let n=Be.get(t);return!!(n&&!Ge(e.key)&&e.code===n)},wr=e=>e===y.ARROW_LEFT||e===y.ARROW_RIGHT||e===y.ARROW_DOWN||e===y.ARROW_UP,Ir=e=>e.altKey,Mr=e=>e.shiftKey,Pr=e=>e.shiftKey;c();import{pointFromPair as We}from"@excalidraw/math";var kr=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)}},Hr=(e,t,n,r)=>{let s=n.map(b=>b[e]),l=Math.max(...s),i=Math.min(...s),o=l-i,a=o===0?1:t/o,p=1/0,m=n.map(b=>{let _=b[e]*a,A=[...b];return A[e]=_,_<p&&(p=_),A});if(!r||m.length===2)return m;let O=i-p;return m.map(b=>We(b.map((_,A)=>A===e?_+O:_)))},Kr=(e,t,n)=>n?[Math.round(e/n)*n,Math.round(t/n)*n]:[e,t];c();var ue=X(le(),1),ce=class{pool;entries={};constructor(t,n){this.pool=new ue.default(t,n)}all(){let t=n=>{if(n.data.result){let[r,s]=n.data.result;this.entries[r]=s}};return this.pool.addEventListener("fulfilled",t),this.pool.start().then(()=>(setTimeout(()=>{this.pool.removeEventListener("fulfilled",t)}),Object.values(this.entries)))}};c();c();c();var pe=(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 S=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 P}from"@excalidraw/math";var W=null,ro=e=>{W=e},oo=()=>{if(W)return W;let e=new Date,t=e.getFullYear(),n=`${e.getMonth()+1}`.padStart(2,"0"),r=`${e.getDate()}`.padStart(2,"0"),s=`${e.getHours()}`.padStart(2,"0"),l=`${e.getMinutes()}`.padStart(2,"0");return`${t}-${n}-${r}-${s}${l}`},so=e=>e.charAt(0).toUpperCase()+e.slice(1),io=e=>e instanceof HTMLElement&&e.className.includes("ToolIcon"),Ye=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement,ao=e=>Ye(e)||e instanceof Element&&!!e.closest("label, button"),lo=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"),Ve=({fontFamily:e})=>{for(let[t,n]of Object.entries(T))if(n===e)return`${t}${ee(n).map(r=>`, ${r}`).join("")}`;return L},co=({fontSize:e,fontFamily:t})=>`${e}px ${Ve({fontFamily:t})}`,uo=(e,t)=>{let n=0,r=null,s=(...l)=>{r=l,clearTimeout(n),n=window.setTimeout(()=>{r=null,e(...l)},t)};return s.flush=()=>{if(clearTimeout(n),r){let l=r;r=null,e(...l)}},s.cancel=()=>{r=null,clearTimeout(n)},s},po=(e,t)=>{let n=null,r=null,s=null,l=o=>{n=window.requestAnimationFrame(()=>{n=null,e(...o),r=null,s&&(r=s,s=null,l(r))})},i=(...o)=>{if(D()){e(...o);return}r=o,n===null?l(r):t?.trailing&&(s=o)};return i.flush=()=>{n!==null&&(cancelAnimationFrame(n),n=null),r&&(e(...s||r),r=s=null)},i.cancel=()=>{r=s=null,n!==null&&(cancelAnimationFrame(n),n=null)},i},Te=e=>1-Math.pow(1-e,4),de=(e,t,n)=>(t-e)*Te(n)+e,fo=({fromValues:e,toValues:t,onStep:n,duration:r=250,interpolateValue:s,onStart:l,onEnd:i,onCancel:o})=>{let a=!1,p=0,m;function O(N){if(a)return;m===void 0&&(m=N,l?.());let b=Math.min(N-m,r),_=Te(b/r),A={};if(Object.keys(e).forEach(g=>{let h=g,k=(t[h]-e[h])*_+e[h];A[h]=k}),n(A),b<r){let g=b/r,h={};Object.keys(e).forEach(k=>{let R=k,H=e[R],K=t[R],v;v=s?s(H,K,g,R):de(H,K,g),v==null&&(v=de(H,K,g)),h[R]=v}),n(h),p=window.requestAnimationFrame(O)}else n(t),i?.()}return p=window.requestAnimationFrame(O),()=>{o?.(),a=!0,window.cancelAnimationFrame(p)}},To=(e,t)=>{if(!e.length||t<1)return[];let n=0,r=0,s=Array(Math.ceil(e.length/t));for(;n<e.length;)s[r++]=e.slice(n,n+=t);return s},mo=e=>{let t=window.getSelection();if(t){let n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}},Eo=()=>{let e=window.getSelection();e&&e.removeAllRanges()},xo=(e,t)=>Math.abs(e-t),bo=(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},_o=()=>document.fullscreenElement?.nodeName==="HTML",Ao=()=>document.documentElement.requestFullscreen(),ho=()=>document.exitFullscreen(),yo=e=>(e=e.replace(/\bAlt\b/i,"Alt").replace(/\bShift\b/i,"Shift").replace(/\b(Enter|Return)\b/i,"Enter"),w?e.replace(/\bCtrlOrCmd\b/gi,"Cmd").replace(/\bAlt\b/i,"Option"):e.replace(/\bCtrlOrCmd\b/gi,"Ctrl")),go=({clientX:e,clientY:t},{zoom:n,offsetLeft:r,offsetTop:s,scrollX:l,scrollY:i})=>{let o=(e-r)/n.value-l,a=(t-s)/n.value-i;return{x:o,y:a}},Lo=({sceneX:e,sceneY:t},{zoom:n,offsetLeft:r,offsetTop:s,scrollX:l,scrollY:i})=>{let o=(e+l)*n.value+r,a=(t+i)*n.value+s;return{x:o,y:a}},So=e=>getComputedStyle(document.documentElement).getPropertyValue(`--${e}`),Xe="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u2C00-\uFB1C\uFDFE-\uFE6F\uFEFD-\uFFFF",$e="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",ze=new RegExp(`^[^${Xe}]*[${$e}]`),Oo=e=>ze.test(e),Ro=e=>{let[t,n]=e;return{x:t,y:n}},vo=e=>{if(e?.name==="AbortError"){console.warn(e);return}throw e},Co=(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},Fo=(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},wo=(e,t)=>{for(let n=0;n<e.length;n++){let r=t(e[n],n);if(r!=null)return r}},je=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},Io=e=>e.fillStyle!=="solid"||je(e.backgroundColor),oe=()=>{let e,t,n=new Promise((r,s)=>{e=r,t=s});return n.resolve=e,n.reject=t,n},Mo=(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+$/,s;for(s=n.length-1;s>0&&!(e>=n[s].value);s--);return(e/n[s].value).toFixed(t).replace(r,"$1")+n[s].symbol},Po=()=>document.querySelector('meta[name="version"]')?.content||te,Do=()=>{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},Uo=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},No=e=>{let t=e.parentElement;for(;t;){if(t.tabIndex>-1){t.focus();return}t=t.parentElement}},ko=e=>{e.preventDefault(),e.returnValue=""},Ho=e=>Array.from(e).map(t=>`0${t.toString(16)}`.slice(-2)).join(""),Ko=()=>D()?1:Date.now(),Bo=e=>e instanceof Map?e:e.reduce((t,n)=>(t.set(typeof n=="string"?n:n.id,n),t),new Map),Go=e=>e.reduce((t,n,r)=>(t.set(n.id,[n,r]),t),new Map),Wo=(e,t)=>e.reduce((n,r,s)=>(n[t?t(r):s]=r,n),{}),Yo=e=>e.reduce((t,n,r)=>{let s={...n,prev:null,next:null};if(r!==0){let l=t[r-1];if(s.prev=l,l.next=s,r===e.length-1){let i=t[0];s.next=i,i.prev=s}}return t.push(s),t},[]),Ze=e=>Array.isArray(e)?e:e.values(),Vo=e=>Array.isArray(e)?e:Array.from(Ze(e)),D=()=>f.MODE===I.TEST,Xo=()=>f.MODE===I.DEVELOPMENT,$o=()=>f.MODE===I.PRODUCTION,zo=()=>typeof process<"u"&&!0,jo=(e,t)=>new CustomEvent(e,{detail:{nativeEvent:t},cancelable:!0}),Zo=(e,t)=>{let n=!1;for(let r in t){let s=t[r];if(typeof s<"u"){if(e[r]===s&&(typeof s!="object"||s===null))continue;n=!0}}return n?{...e,...t}:e},qo=e=>{let t=typeof e;return e==null||t!=="object"&&t!=="function"},qe=()=>{try{return window.self===window.top?"top":"iframe"}catch{return"iframe"}},Qo=()=>qe()==="iframe",Jo=e=>!!e&&typeof e=="object"&&"then"in e&&"catch"in e&&"finally"in e,es=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):[]},fe=(e,t)=>Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t,Qe=(e,t,n,r=!1)=>{let s=Object.keys(e),l=Object.keys(t);if(s.length!==l.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]||fe(e[i],t[i])))return r&&console.warn(`%cisShallowEqual: ${i} not equal ->`,"color: #8B4000",e[i],t[i]),!1;return!0}return s.every(i=>{let o=n?.[i],a=o?o(e[i],t[i]):e[i]===t[i]||fe(e[i],t[i]);return!a&&r&&console.warn(`%cisShallowEqual: ${i} not equal ->`,"color: #8B4000",e[i],t[i]),a})},ts=(e,t,{checkForDefaultPrevented:n=!0}={})=>function(s){if(e?.(s),!n||!s?.defaultPrevented)return t?.(s)},ns=(e,t,n)=>{if(!t)return e;if(n)return console.error(t),e;throw new Error(t)};function rs(e,t){if(!e)throw new Error(t)}var os=e=>{let t,n,r=function(s){let l=Object.entries(s);if(t){let o=!0;for(let[a,p]of l)if(t.get(a)!==p){o=!1;break}if(o)return n}let i=e(s);return t=new Map(l),n=i,i};return r.clear=()=>{t=void 0,n=void 0},r},ss=(e,t)=>e instanceof Set||e instanceof Map?e.has(t):"includes"in e?e.includes(t):e.hasOwnProperty(t),is=e=>JSON.parse(JSON.stringify(e)),as=(e,t)=>Qe(e,t)?e:t;function ls(e,t,n,r){return e?(e?.addEventListener?.(t,n,r),()=>{e?.removeEventListener?.(t,n,r)}):()=>{}}function cs(e,t=!0){let n=e.length;if(n<4)return"";let r=e[0],s=e[1],l=e[2],i=`M${r[0].toFixed(2)},${r[1].toFixed(2)} Q${s[0].toFixed(2)},${s[1].toFixed(2)} ${P(s[0],l[0]).toFixed(2)},${P(s[1],l[1]).toFixed(2)} T`;for(let o=2,a=n-1;o<a;o++)r=e[o],s=e[o+1],i+=`${P(r[0],s[0]).toFixed(2)},${P(r[1],s[1]).toFixed(2)} `;return t&&(i+="Z"),i}var us=e=>e.replace(/\r?\n|\r/g,`
4
- `),ps=e=>e,se=async(e,...t)=>new Promise(n=>{n(e(...t))}),ds=(...e)=>Math.max(...e.map(t=>t?1:0))>0,fs=e=>{try{return JSON.parse(e)}catch{return null}},me=e=>e.replace(/"/g,"&quot;"),Ts=e=>Array.isArray(e)?e:[e],Je=e=>Array.isArray(e),et=e=>Je(e)?e.length:e instanceof Map||e instanceof Set?e.size:Object.keys(e).length,ms=(e,t)=>{if(et(e)===0)return null;let n=t||(s=>s),r=null;for(let s of e){let l=n(s);if((r===null||r===l)&&l!=null)r=l;else return null}return r};var Ee=new S(Date.now()),xe=0,hs=()=>Math.floor(Ee.next()*2**31),ys=e=>{Ee=new S(e),xe=0},gs=()=>D()?`id${xe++}`:pe();c();var _e=X(be(),1);var ut=e=>(e=e.trim(),e&&(0,_e.sanitizeUrl)(me(e))),Cs=e=>!!(e?.includes(location.origin)||e?.startsWith("/")),Fs=e=>{if(e=ut(e),e.startsWith("/"))return`${location.origin}${e}`;try{new URL(e)}catch{return"about:blank"}return e};c();var Ae=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(s=>typeof s=="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=[]}};export{Cn as ACTIVE_THRESHOLD,Tn as ALLOWED_PASTE_MIME_TYPES,Ht as APP_NAME,jn as ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO,zn as ARROW_LABEL_WIDTH_FRACTION,dr as ARROW_TYPE,$n as BOUND_TEXT_PADDING,$ as BinaryHeap,pn as CANVAS_ONLY_ACTIONS,ht as CANVAS_PALETTE_SHADE_INDEXES,or as CANVAS_SEARCH_TAB,q as CJK_HAND_DRAWN_FALLBACK_FONT,Qt as CLASSES,ie as CODES,_t as COLORS_PER_ROW,cn as COLOR_CHARCOAL_BLACK,xt as COLOR_OUTLINE_CONTRAST_THRESHOLD,u as COLOR_PALETTE,un as COLOR_VOICE_CALL,ln as COLOR_WHITE,zt as CURSOR_TYPE,er as DEFAULT_ADAPTIVE_RADIUS,Lt as DEFAULT_CANVAS_BACKGROUND_PICKS,At as DEFAULT_CHART_COLOR_INDEX,an as DEFAULT_COLLISION_THRESHOLD,F as DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX,Ot as DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE,gt as DEFAULT_ELEMENT_BACKGROUND_PICKS,rr as DEFAULT_ELEMENT_PROPS,C as DEFAULT_ELEMENT_STROKE_COLOR_INDEX,St as DEFAULT_ELEMENT_STROKE_COLOR_PALETTE,yt as DEFAULT_ELEMENT_STROKE_PICKS,Kn as DEFAULT_EXPORT_PADDING,cr as DEFAULT_FILENAME,rn as DEFAULT_FONT_FAMILY,nn as DEFAULT_FONT_SIZE,dn as DEFAULT_GRID_SIZE,fn as DEFAULT_GRID_STEP,$t as DEFAULT_LASER_COLOR,Bn as DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT,Jn as DEFAULT_PROPORTIONAL_RADIUS,fr as DEFAULT_REDUCED_GLOBAL_ALPHA,sr as DEFAULT_SIDEBAR,on as DEFAULT_TEXT_ALIGN,De as DEFAULT_TRANSFORM_HANDLE_SPACING,Mn as DEFAULT_UI_OPTIONS,te as DEFAULT_VERSION,sn as DEFAULT_VERTICAL_ALIGN,Bt as DRAGGING_THRESHOLD,lr as EDITOR_LS_KEYS,E as ELEMENTS_PALETTE_SHADE_INDEXES,Tr as ELEMENT_LINK_KEY,Qn as ELEMENT_READY_TO_ERASE_OPACITY,Wt as ELEMENT_SHIFT_TRANSLATE_AMOUNT,Yt as ELEMENT_TRANSLATE_AMOUNT,Vn as ENCRYPTION_KEY_BITS,I as ENV,Ne as EPSILON,Ie as EVENT,En as EXPORT_DATA_TYPES,mn as EXPORT_IMAGE_TYPES,Hn as EXPORT_SCALES,Ae as Emitter,T as FONT_FAMILY,B as FONT_FAMILY_FALLBACKS,Me as FONT_FAMILY_GENERIC_FALLBACKS,M as FONT_METADATA,en as FRAME_STYLE,Ar as GOOGLE_FONTS_RANGES,Rn as HYPERLINK_TOOLTIP_DELAY,vn as IDLE_THRESHOLD,ne as IMAGE_MIME_TYPES,bn as IMAGE_RENDER_TIMEOUT,y as KEYS,Be as KeyCodeMap,ir as LIBRARY_DISABLED_TYPES,He as LIBRARY_SIDEBAR_TAB,Gt as LINE_CONFIRM_THRESHOLD,Er as LINE_POLYGON_POINT_MERGE_DISTANCE,hr as LOCAL_FONT_PROTOCOL,Gn as MAX_ALLOWED_FILE_BYTES,bt as MAX_CUSTOM_COLORS_USED_IN_CANVAS,kn as MAX_DECIMALS_FOR_SVG_EXPORT,On as MAX_ZOOM,Z as MIME_TYPES,tn as MIN_FONT_SIZE,pr as MIN_WIDTH_OR_HEIGHT,Sn as MIN_ZOOM,J as MONOSPACE_GENERIC_FONT,Un as MQ_MAX_HEIGHT_LANDSCAPE,Dn as MQ_MAX_WIDTH_LANDSCAPE,Pn as MQ_MAX_WIDTH_PORTRAIT,Nn as MQ_RIGHT_SIDEBAR_MIN_WIDTH,mr as ORIG_ID,jt as POINTER_BUTTON,Zt as POINTER_EVENTS,ce as PromisePool,re as Queue,ke as ROUGHNESS,tr as ROUNDNESS,Q as SANS_SERIF_GENERIC_FONT,gn as SCROLL_TIMEOUT,Xt as SHIFT_LOCKING_ANGLE,Ue as SIDE_RESIZING_THRESHOLD,ur as STATS_PANELS,nr as STROKE_WIDTH,Yn as SVG_DOCUMENT_PREAMBLE,Wn as SVG_NS,_n as TAP_TWICE_TIMEOUT,qn as TEXT_ALIGN,Kt as TEXT_AUTOWRAP_THRESHOLD,Vt as TEXT_TO_CENTER_SNAP_THRESHOLD,Jt as THEME,Fn as THEME_FILTER,hn as TITLE_TIMEOUT,ar as TOOL_TYPE,An as TOUCH_CTX_MENU_TIMEOUT,In as URL_HASH_KEYS,wn as URL_QUERY_KEYS,Ke as UserIdleState,Xn as VERSIONS,yn as VERSION_TIMEOUT,Zn as VERTICAL_ALIGN,L as WINDOWS_EMOJI_FALLBACK_FONT,qt as YOUTUBE_STATES,Ln as ZOOM_STEP,ls as addEventListener,Ao as allowFullScreen,Yo as arrayToList,Bo as arrayToMap,Go as arrayToMapWithIndex,Wo as arrayToObject,ns as assertNever,Ho as bytesToHexString,so as capitalizeString,Ts as castArray,To as chunk,is as cloneJSON,ts as composeEventHandlers,uo as debounce,xo as distance,Te as easeOut,fo as easeToValuesRAF,me as escapeDoubleQuotes,ho as exitFullScreen,Co as findIndex,Fo as findLastIndex,No as focusNearestParent,Rt as getAllColorsSpecificShade,oo as getDateTime,xn as getExportSource,ee as getFontFamilyFallbacks,Ve as getFontFamilyString,co as getFontString,qe as getFrame,Pe as getGenericFontFamilyFallback,So as getGlobalCSSVariable,Kr as getGridPoint,gr as getLineHeight,Uo as getNearestScrollableContainer,yo as getShortcutKey,kr as getSizeFromPoints,x as getSpecificColorShades,cs as getSvgPathFromStroke,Ko as getUpdatedTimestamp,Po as getVersion,yr as getVerticalOffset,rs as invariant,Mt as isAndroid,ds as isAnyTrue,wr as isArrowKey,Io as isBindingFallthroughEnabled,Nt as isBrave,we as isChrome,w as isDarwin,Xo as isDevEnv,Pt as isFirefox,_o as isFullScreen,Ut as isIOS,Ye as isInputLike,ao as isInteractive,Ge as isLatinChar,Cs as isLocalLink,ss as isMemberOf,qo as isPrimitive,$o as isProdEnv,Jo as isPromiseLike,Oo as isRTL,Je as isReadonlyArray,Qo as isRunningInIframe,Dt as isSafari,zo as isServerEnv,Qe as isShallowEqual,D as isTestEnv,io as isToolIcon,je as isTransparent,It as isWindows,lo as isWritableElement,wo as mapFind,Fr as matchKey,os as memoize,vo as muteFSAbortError,Mo as nFormatter,us as normalizeEOL,ut as normalizeLink,ko as preventUnload,se as promiseTry,es as queryFocusableElements,gs as randomId,hs as randomInteger,ms as reduceToCommonValue,Eo as removeSelection,Hr as rescalePoints,ys as reseed,oe as resolvablePromise,vt as rgbToHex,fs as safelyParseJSON,Lo as sceneCoordsToViewportCoords,mo as selectNode,ro as setDateTimeForTests,Mr as shouldMaintainAspectRatio,Ir as shouldResizeFromCenter,Pr as shouldRotateWithDiscreteAngle,et as sizeOf,Do as supportsEmoji,kt as supportsResizeObserver,po as throttleRAF,Vo as toArray,ps as toBrandedType,Ze as toIterable,Fs as toValidURL,Ro as tupleToCoors,bo as updateActiveTool,Zo as updateObject,as as updateStable,go as viewportCoordsToSceneCoords,jo as wrapEvent};
3
+ `,qn=128,Qn={excalidraw:2,excalidrawLibrary:2},Jn=5,er=.7,tr=11,nr={TOP:"top",MIDDLE:"middle",BOTTOM:"bottom"},rr={LEFT:"left",CENTER:"center",RIGHT:"right"},or=20,sr=.25,ir=32,ar={LEGACY:1,PROPORTIONAL_RADIUS:2,ADAPTIVE_RADIUS:3},Ge={architect:0,artist:1,cartoonist:2},lr={thin:1,bold:2,extraBold:4},cr={strokeColor:u.black,backgroundColor:u.transparent,fillStyle:"solid",strokeWidth:2,strokeStyle:"solid",roughness:Ge.artist,opacity:100,locked:!1},We="library",ur="search",pr={name:"default",defaultTab:We},dr=new Set(["iframe","embeddable","image"]),fr={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"},Tr={OAI_API_KEY:"excalidraw-oai-api-key",MERMAID_TO_EXCALIDRAW:"mermaid-to-excalidraw",PUBLISH_LIBRARY:"publish-library-data"},mr="Untitled",Er={generalStats:1,elementProperties:2},xr=1,br={sharp:"sharp",round:"round",elbow:"elbow"},_r=.3,hr="element",Ar=Symbol.for("__test__originalId__"),Ye=(r=>(r.ACTIVE="active",r.AWAY="away",r.IDLE="idle",r))(Ye||{}),yr=20,gr=35,Sr={background:"var(--mobile-action-button-bg)"};c();var I={[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},[G.Xiaolai]:{metrics:{unitsPerEm:1e3,ascender:880,descender:-144,lineHeight:1.25},fallback:!0},[G["Segoe UI Emoji"]]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},local:!0,fallback:!0}},vr={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"},Cr="local:",Fr=(e,t,n)=>{let{unitsPerEm:r,ascender:o,descender:l}=I[e]?.metrics||I[T.Excalifont].metrics,i=t/r,s=(n-i*o+i*l)/2;return i*o+s},wr=e=>{let{lineHeight:t}=I[e]?.metrics||I[T.Excalifont].metrics;return t};c();var se=class{jobs=[];running=!1;tick(){if(this.running)return;let t=this.jobs.shift();t?(this.running=!0,t.promise.resolve(ae(t.jobFactory,...t.args).finally(()=>{this.running=!1,this.tick()}))):this.running=!1}push(t,...n){let r=ie();return this.jobs.push({jobFactory:t,promise:r,args:n}),this.tick(),r}};c();var le={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"},y={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:w?"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"},Ve=new Map([[y.Z,le.Z],[y.Y,le.Y]]),Xe=e=>/^[a-z]$/.test(e.toLowerCase()),kr=(e,t)=>{if(t===e.key.toLowerCase())return!0;let n=Ve.get(t);return!!(n&&!Xe(e.key)&&e.code===n)},Hr=e=>e===y.ARROW_LEFT||e===y.ARROW_RIGHT||e===y.ARROW_DOWN||e===y.ARROW_UP,Kr=e=>e.altKey,Br=e=>e.shiftKey,Gr=e=>e.shiftKey;c();import{pointFromPair as $e}from"@excalidraw/math";var Xr=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)}},$r=(e,t,n,r)=>{let o=n.map(b=>b[e]),l=Math.max(...o),i=Math.min(...o),s=l-i,a=s===0?1:t/s,p=1/0,m=n.map(b=>{let _=b[e]*a,h=[...b];return h[e]=_,_<p&&(p=_),h});if(!r||m.length===2)return m;let O=i-p;return m.map(b=>$e(b.map((_,h)=>h===e?_+O:_)))},zr=(e,t,n)=>n?[Math.round(e/n)*n,Math.round(t/n)*n]:[e,t];c();var de=$(ue(),1),pe=class{pool;entries={};constructor(t,n){this.pool=new de.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)))}};c();c();c();var fe=(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 L=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 P}from"@excalidraw/math";var Y=null,po=e=>{Y=e},fo=()=>{if(Y)return Y;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"),l=`${e.getMinutes()}`.padStart(2,"0");return`${t}-${n}-${r}-${o}${l}`},To=e=>e.charAt(0).toUpperCase()+e.slice(1),mo=e=>e instanceof HTMLElement&&e.className.includes("ToolIcon"),ze=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement,Eo=e=>ze(e)||e instanceof Element&&!!e.closest("label, button"),xo=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"),je=({fontFamily:e})=>{for(let[t,n]of Object.entries(T))if(n===e)return`${t}${ne(n).map(r=>`, ${r}`).join("")}`;return S},bo=({fontSize:e,fontFamily:t})=>`${e}px ${je({fontFamily:t})}`,_o=async e=>{requestAnimationFrame(()=>requestAnimationFrame(e))},ho=(e,t)=>{let n=0,r=null,o=(...l)=>{r=l,clearTimeout(n),n=window.setTimeout(()=>{r=null,e(...l)},t)};return o.flush=()=>{if(clearTimeout(n),r){let l=r;r=null,e(...l)}},o.cancel=()=>{r=null,clearTimeout(n)},o},Ao=(e,t)=>{let n=null,r=null,o=null,l=s=>{n=window.requestAnimationFrame(()=>{n=null,e(...s),r=null,o&&(r=o,o=null,l(r))})},i=(...s)=>{if(D()){e(...s);return}r=s,n===null?l(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},Ee=e=>1-Math.pow(1-e,4),Te=(e,t,n)=>(t-e)*Ee(n)+e,yo=({fromValues:e,toValues:t,onStep:n,duration:r=250,interpolateValue:o,onStart:l,onEnd:i,onCancel:s})=>{let a=!1,p=0,m;function O(N){if(a)return;m===void 0&&(m=N,l?.());let b=Math.min(N-m,r),_=Ee(b/r),h={};if(Object.keys(e).forEach(g=>{let A=g,k=(t[A]-e[A])*_+e[A];h[A]=k}),n(h),b<r){let g=b/r,A={};Object.keys(e).forEach(k=>{let R=k,H=e[R],K=t[R],v;v=o?o(H,K,g,R):Te(H,K,g),v==null&&(v=Te(H,K,g)),A[R]=v}),n(A),p=window.requestAnimationFrame(O)}else n(t),i?.()}return p=window.requestAnimationFrame(O),()=>{s?.(),a=!0,window.cancelAnimationFrame(p)}},go=(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},So=e=>{let t=window.getSelection();if(t){let n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}},Lo=()=>{let e=window.getSelection();e&&e.removeAllRanges()},Oo=(e,t)=>Math.abs(e-t),Ro=(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},vo=()=>document.fullscreenElement?.nodeName==="HTML",Co=()=>document.documentElement.requestFullscreen(),Fo=()=>document.exitFullscreen(),wo=e=>(e=e.replace(/\bAlt\b/i,"Alt").replace(/\bShift\b/i,"Shift").replace(/\b(Enter|Return)\b/i,"Enter"),w?e.replace(/\bCtrlOrCmd\b/gi,"Cmd").replace(/\bAlt\b/i,"Option"):e.replace(/\bCtrlOrCmd\b/gi,"Ctrl")),Mo=({clientX:e,clientY:t},{zoom:n,offsetLeft:r,offsetTop:o,scrollX:l,scrollY:i})=>{let s=(e-r)/n.value-l,a=(t-o)/n.value-i;return{x:s,y:a}},Io=({sceneX:e,sceneY:t},{zoom:n,offsetLeft:r,offsetTop:o,scrollX:l,scrollY:i})=>{let s=(e+l)*n.value+r,a=(t+i)*n.value+o;return{x:s,y:a}},Po=e=>getComputedStyle(document.documentElement).getPropertyValue(`--${e}`),Ze="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u2C00-\uFB1C\uFDFE-\uFE6F\uFEFD-\uFFFF",qe="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",Qe=new RegExp(`^[^${Ze}]*[${qe}]`),Do=e=>Qe.test(e),Uo=e=>{let[t,n]=e;return{x:t,y:n}},No=e=>{if(e?.name==="AbortError"){console.warn(e);return}throw e},ko=(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},Ho=(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},Ko=(e,t)=>{for(let n=0;n<e.length;n++){let r=t(e[n],n);if(r!=null)return r}},Je=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},Bo=e=>e.fillStyle!=="solid"||Je(e.backgroundColor),ie=()=>{let e,t,n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n},Go=(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},Wo=()=>document.querySelector('meta[name="version"]')?.content||re,Yo=()=>{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},Vo=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},Xo=e=>{let t=e.parentElement;for(;t;){if(t.tabIndex>-1){t.focus();return}t=t.parentElement}},$o=e=>{e.preventDefault(),e.returnValue=""},zo=e=>Array.from(e).map(t=>`0${t.toString(16)}`.slice(-2)).join(""),jo=()=>D()?1:Date.now(),Zo=e=>e instanceof Map?e:e.reduce((t,n)=>(t.set(typeof n=="string"?n:n.id,n),t),new Map),qo=e=>e.reduce((t,n,r)=>(t.set(n.id,[n,r]),t),new Map),Qo=(e,t)=>e.reduce((n,r,o)=>(n[t?t(r):o]=r,n),{}),Jo=e=>e.reduce((t,n,r)=>{let o={...n,prev:null,next:null};if(r!==0){let l=t[r-1];if(o.prev=l,l.next=o,r===e.length-1){let i=t[0];o.next=i,i.prev=o}}return t.push(o),t},[]),et=e=>Array.isArray(e)?e:e.values(),es=e=>Array.isArray(e)?e:Array.from(et(e)),D=()=>f.MODE===M.TEST,ts=()=>f.MODE===M.DEVELOPMENT,ns=()=>f.MODE===M.PRODUCTION,rs=()=>typeof process<"u"&&!0,os=(e,t)=>new CustomEvent(e,{detail:{nativeEvent:t},cancelable:!0}),ss=(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},is=e=>{let t=typeof e;return e==null||t!=="object"&&t!=="function"},tt=()=>{try{return window.self===window.top?"top":"iframe"}catch{return"iframe"}},as=()=>tt()==="iframe",ls=e=>!!e&&typeof e=="object"&&"then"in e&&"catch"in e&&"finally"in e,cs=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):[]},me=(e,t)=>Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t,nt=(e,t,n,r=!1)=>{let o=Object.keys(e),l=Object.keys(t);if(o.length!==l.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]||me(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],a=s?s(e[i],t[i]):e[i]===t[i]||me(e[i],t[i]);return!a&&r&&console.warn(`%cisShallowEqual: ${i} not equal ->`,"color: #8B4000",e[i],t[i]),a})},us=(e,t,{checkForDefaultPrevented:n=!0}={})=>function(o){if(e?.(o),!n||!o?.defaultPrevented)return t?.(o)},ps=(e,t,n)=>{if(!t)return e;if(n)return console.error(t),e;throw new Error(t)};function ds(e,t){if(!e)throw new Error(t)}var fs=e=>{let t,n,r=function(o){let l=Object.entries(o);if(t){let s=!0;for(let[a,p]of l)if(t.get(a)!==p){s=!1;break}if(s)return n}let i=e(o);return t=new Map(l),n=i,i};return r.clear=()=>{t=void 0,n=void 0},r},Ts=(e,t)=>e instanceof Set||e instanceof Map?e.has(t):"includes"in e?e.includes(t):e.hasOwnProperty(t),ms=e=>JSON.parse(JSON.stringify(e)),Es=(e,t)=>nt(e,t)?e:t;function xs(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],l=e[2],i=`M${r[0].toFixed(2)},${r[1].toFixed(2)} Q${o[0].toFixed(2)},${o[1].toFixed(2)} ${P(o[0],l[0]).toFixed(2)},${P(o[1],l[1]).toFixed(2)} T`;for(let s=2,a=n-1;s<a;s++)r=e[s],o=e[s+1],i+=`${P(r[0],o[0]).toFixed(2)},${P(r[1],o[1]).toFixed(2)} `;return t&&(i+="Z"),i}var _s=e=>e.replace(/\r?\n|\r/g,`
4
+ `),hs=e=>e,ae=async(e,...t)=>new Promise(n=>{n(e(...t))}),As=(...e)=>Math.max(...e.map(t=>t?1:0))>0,ys=e=>{try{return JSON.parse(e)}catch{return null}},xe=e=>e.replace(/"/g,"&quot;"),gs=e=>Array.isArray(e)?e:[e],rt=e=>Array.isArray(e),ot=e=>rt(e)?e.length:e instanceof Map||e instanceof Set?e.size:Object.keys(e).length,Ss=(e,t)=>{if(ot(e)===0)return null;let n=t||(o=>o),r=null;for(let o of e){let l=n(o);if((r===null||r===l)&&l!=null)r=l;else return null}return r},Ls=()=>{let e=navigator.userAgent||"",t=navigator.platform||"",n=navigator.userAgentData;if(n){let o=(n.platform||"").toLowerCase(),l=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(l)return!1}if(B)return!0;if(Q){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};var be=new L(Date.now()),_e=0,ws=()=>Math.floor(be.next()*2**31),Ms=e=>{be=new L(e),_e=0},Is=()=>D()?`id${_e++}`:fe();c();var Ae=$(he(),1);var Tt=e=>(e=e.trim(),e&&(0,Ae.sanitizeUrl)(xe(e))),Hs=e=>!!(e?.includes(location.origin)||e?.startsWith("/")),Ks=e=>{if(e=Tt(e),e.startsWith("/"))return`${location.origin}${e}`;try{new URL(e)}catch{return"about:blank"}return e};c();var ye=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=[]}};export{In as ACTIVE_THRESHOLD,bn as ALLOWED_PASTE_MIME_TYPES,Gt as APP_NAME,tr as ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO,er as ARROW_LABEL_WIDTH_FRACTION,br as ARROW_TYPE,Jn as BOUND_TEXT_PADDING,z as BinaryHeap,mn as CANVAS_ONLY_ACTIONS,Lt as CANVAS_PALETTE_SHADE_INDEXES,ur as CANVAS_SEARCH_TAB,J as CJK_HAND_DRAWN_FALLBACK_FONT,nn as CLASSES,le as CODES,gt as COLORS_PER_ROW,fn as COLOR_CHARCOAL_BLACK,At as COLOR_OUTLINE_CONTRAST_THRESHOLD,u as COLOR_PALETTE,Tn as COLOR_VOICE_CALL,dn as COLOR_WHITE,Qt as CURSOR_TYPE,ir as DEFAULT_ADAPTIVE_RADIUS,vt as DEFAULT_CANVAS_BACKGROUND_PICKS,St as DEFAULT_CHART_COLOR_INDEX,pn as DEFAULT_COLLISION_THRESHOLD,F as DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX,Ft as DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE,Rt as DEFAULT_ELEMENT_BACKGROUND_PICKS,cr as DEFAULT_ELEMENT_PROPS,C as DEFAULT_ELEMENT_STROKE_COLOR_INDEX,Ct as DEFAULT_ELEMENT_STROKE_COLOR_PALETTE,Ot as DEFAULT_ELEMENT_STROKE_PICKS,Xn as DEFAULT_EXPORT_PADDING,mr as DEFAULT_FILENAME,ln as DEFAULT_FONT_FAMILY,an as DEFAULT_FONT_SIZE,En as DEFAULT_GRID_SIZE,xn as DEFAULT_GRID_STEP,qt as DEFAULT_LASER_COLOR,$n as DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT,sr as DEFAULT_PROPORTIONAL_RADIUS,_r as DEFAULT_REDUCED_GLOBAL_ALPHA,pr as DEFAULT_SIDEBAR,cn as DEFAULT_TEXT_ALIGN,Ne as DEFAULT_TRANSFORM_HANDLE_SPACING,Nn as DEFAULT_UI_OPTIONS,re as DEFAULT_VERSION,un as DEFAULT_VERTICAL_ALIGN,gr as DOUBLE_TAP_POSITION_THRESHOLD,Yt as DRAGGING_THRESHOLD,Tr as EDITOR_LS_KEYS,E as ELEMENTS_PALETTE_SHADE_INDEXES,hr as ELEMENT_LINK_KEY,or as ELEMENT_READY_TO_ERASE_OPACITY,$t as ELEMENT_SHIFT_TRANSLATE_AMOUNT,zt as ELEMENT_TRANSLATE_AMOUNT,qn as ENCRYPTION_KEY_BITS,M as ENV,He as EPSILON,Pe as EVENT,hn as EXPORT_DATA_TYPES,_n as EXPORT_IMAGE_TYPES,Vn as EXPORT_SCALES,ye as Emitter,T as FONT_FAMILY,G as FONT_FAMILY_FALLBACKS,De as FONT_FAMILY_GENERIC_FALLBACKS,I as FONT_METADATA,on as FRAME_STYLE,vr as GOOGLE_FONTS_RANGES,wn as HYPERLINK_TOOLTIP_DELAY,Mn as IDLE_THRESHOLD,oe as IMAGE_MIME_TYPES,yn as IMAGE_RENDER_TIMEOUT,y as KEYS,Ve as KeyCodeMap,dr as LIBRARY_DISABLED_TYPES,We as LIBRARY_SIDEBAR_TAB,Xt as LINE_CONFIRM_THRESHOLD,yr as LINE_POLYGON_POINT_MERGE_DISTANCE,Cr as LOCAL_FONT_PROTOCOL,zn as MAX_ALLOWED_FILE_BYTES,yt as MAX_CUSTOM_COLORS_USED_IN_CANVAS,Yn as MAX_DECIMALS_FOR_SVG_EXPORT,Fn as MAX_ZOOM,q as MIME_TYPES,Vt as MINIMUM_ARROW_SIZE,sn as MIN_FONT_SIZE,xr as MIN_WIDTH_OR_HEIGHT,Cn as MIN_ZOOM,Sr as MOBILE_ACTION_BUTTON_BG,te as MONOSPACE_GENERIC_FONT,Hn as MQ_MAX_HEIGHT_LANDSCAPE,Be as MQ_MAX_MOBILE,Bn as MQ_MAX_TABLET,kn as MQ_MAX_WIDTH_LANDSCAPE,Kn as MQ_MIN_TABLET,Gn as MQ_MIN_WIDTH_DESKTOP,Wn as MQ_RIGHT_SIDEBAR_MIN_WIDTH,Ar as ORIG_ID,Jt as POINTER_BUTTON,en as POINTER_EVENTS,pe as PromisePool,se as Queue,Ge as ROUGHNESS,ar as ROUNDNESS,ee as SANS_SERIF_GENERIC_FONT,Rn as SCROLL_TIMEOUT,Zt as SHIFT_LOCKING_ANGLE,ke as SIDE_RESIZING_THRESHOLD,Er as STATS_PANELS,Ke as STRING_MIME_TYPES,lr as STROKE_WIDTH,Zn as SVG_DOCUMENT_PREAMBLE,jn as SVG_NS,gn as TAP_TWICE_TIMEOUT,rr as TEXT_ALIGN,Wt as TEXT_AUTOWRAP_THRESHOLD,jt as TEXT_TO_CENTER_SNAP_THRESHOLD,rn as THEME,Pn as THEME_FILTER,Ln as TITLE_TIMEOUT,fr as TOOL_TYPE,Sn as TOUCH_CTX_MENU_TIMEOUT,Un as URL_HASH_KEYS,Dn as URL_QUERY_KEYS,Ye as UserIdleState,Qn as VERSIONS,On as VERSION_TIMEOUT,nr as VERTICAL_ALIGN,S as WINDOWS_EMOJI_FALLBACK_FONT,tn as YOUTUBE_STATES,vn as ZOOM_STEP,xs as addEventListener,Co as allowFullScreen,Jo as arrayToList,Zo as arrayToMap,qo as arrayToMapWithIndex,Qo as arrayToObject,ps as assertNever,zo as bytesToHexString,To as capitalizeString,gs as castArray,go as chunk,ms as cloneJSON,us as composeEventHandlers,ho as debounce,Oo as distance,Ee as easeOut,yo as easeToValuesRAF,xe as escapeDoubleQuotes,Fo as exitFullScreen,ko as findIndex,Ho as findLastIndex,Xo as focusNearestParent,wt as getAllColorsSpecificShade,fo as getDateTime,An as getExportSource,ne as getFontFamilyFallbacks,je as getFontFamilyString,bo as getFontString,tt as getFrame,Ue as getGenericFontFamilyFallback,Po as getGlobalCSSVariable,zr as getGridPoint,wr as getLineHeight,Vo as getNearestScrollableContainer,wo as getShortcutKey,Xr as getSizeFromPoints,x as getSpecificColorShades,bs as getSvgPathFromStroke,jo as getUpdatedTimestamp,Wo as getVersion,Fr as getVerticalOffset,ds as invariant,Q as isAndroid,As as isAnyTrue,Hr as isArrowKey,Bo as isBindingFallthroughEnabled,Ht as isBrave,Ie as isChrome,w as isDarwin,ts as isDevEnv,Nt as isFirefox,vo as isFullScreen,B as isIOS,ze as isInputLike,Eo as isInteractive,Xe as isLatinChar,Hs as isLocalLink,Ts as isMemberOf,Kt as isMobile,Ls as isMobileOrTablet,is as isPrimitive,ns as isProdEnv,ls as isPromiseLike,Do as isRTL,rt as isReadonlyArray,as as isRunningInIframe,kt as isSafari,rs as isServerEnv,nt as isShallowEqual,D as isTestEnv,mo as isToolIcon,Je as isTransparent,Ut as isWindows,xo as isWritableElement,Ko as mapFind,kr as matchKey,fs as memoize,No as muteFSAbortError,Go as nFormatter,_o as nextAnimationFrame,_s as normalizeEOL,Tt as normalizeLink,$o as preventUnload,ae as promiseTry,cs as queryFocusableElements,Is as randomId,ws as randomInteger,Ss as reduceToCommonValue,Lo as removeSelection,$r as rescalePoints,Ms as reseed,ie as resolvablePromise,Mt as rgbToHex,ys as safelyParseJSON,Io as sceneCoordsToViewportCoords,So as selectNode,po as setDateTimeForTests,Br as shouldMaintainAspectRatio,Kr as shouldResizeFromCenter,Gr as shouldRotateWithDiscreteAngle,ot as sizeOf,Yo as supportsEmoji,Bt as supportsResizeObserver,Ao as throttleRAF,es as toArray,hs as toBrandedType,et as toIterable,Ks as toValidURL,Uo as tupleToCoors,Ro as updateActiveTool,ss as updateObject,Es as updateStable,Mo as viewportCoordsToSceneCoords,os as wrapEvent};
@@ -8,10 +8,12 @@ export declare const isChrome: boolean;
8
8
  export declare const isSafari: boolean;
9
9
  export declare const isIOS: boolean;
10
10
  export declare const isBrave: () => boolean;
11
+ export declare const isMobile: boolean;
11
12
  export declare const supportsResizeObserver: boolean;
12
13
  export declare const APP_NAME = "Excalidraw";
13
14
  export declare const TEXT_AUTOWRAP_THRESHOLD = 36;
14
15
  export declare const DRAGGING_THRESHOLD = 10;
16
+ export declare const MINIMUM_ARROW_SIZE = 20;
15
17
  export declare const LINE_CONFIRM_THRESHOLD = 8;
16
18
  export declare const ELEMENT_SHIFT_TRANSLATE_AMOUNT = 5;
17
19
  export declare const ELEMENT_TRANSLATE_AMOUNT = 1;
@@ -85,10 +87,12 @@ export declare const ENV: {
85
87
  PRODUCTION: string;
86
88
  };
87
89
  export declare const CLASSES: {
90
+ SIDEBAR: string;
88
91
  SHAPE_ACTIONS_MENU: string;
89
92
  ZOOM_ACTIONS: string;
90
93
  SEARCH_MENU_INPUT_WRAPPER: string;
91
94
  CONVERT_ELEMENT_TYPE_POPUP: string;
95
+ SHAPE_ACTIONS_THEME_SCOPE: string;
92
96
  };
93
97
  export declare const CJK_HAND_DRAWN_FALLBACK_FONT = "Xiaolai";
94
98
  export declare const WINDOWS_EMOJI_FALLBACK_FONT = "Segoe UI Emoji";
@@ -174,6 +178,14 @@ export declare const IMAGE_MIME_TYPES: {
174
178
  readonly avif: "image/avif";
175
179
  readonly jfif: "image/jfif";
176
180
  };
181
+ export declare const STRING_MIME_TYPES: {
182
+ readonly text: "text/plain";
183
+ readonly html: "text/html";
184
+ readonly json: "application/json";
185
+ readonly excalidraw: "application/vnd.excalidraw+json";
186
+ readonly excalidrawlib: "application/vnd.excalidrawlib+json";
187
+ readonly excalidrawlibIds: "application/vnd.excalidrawlib.ids+json";
188
+ };
177
189
  export declare const MIME_TYPES: {
178
190
  readonly svg: "image/svg+xml";
179
191
  readonly png: "image/png";
@@ -184,14 +196,15 @@ export declare const MIME_TYPES: {
184
196
  readonly ico: "image/x-icon";
185
197
  readonly avif: "image/avif";
186
198
  readonly jfif: "image/jfif";
199
+ readonly "excalidraw.svg": "image/svg+xml";
200
+ readonly "excalidraw.png": "image/png";
201
+ readonly binary: "application/octet-stream";
187
202
  readonly text: "text/plain";
188
203
  readonly html: "text/html";
189
204
  readonly json: "application/json";
190
205
  readonly excalidraw: "application/vnd.excalidraw+json";
191
206
  readonly excalidrawlib: "application/vnd.excalidrawlib+json";
192
- readonly "excalidraw.svg": "image/svg+xml";
193
- readonly "excalidraw.png": "image/png";
194
- readonly binary: "application/octet-stream";
207
+ readonly excalidrawlibIds: "application/vnd.excalidrawlib.ids+json";
195
208
  };
196
209
  export declare const ALLOWED_PASTE_MIME_TYPES: readonly ["text/plain", "text/html", ...("image/svg+xml" | "image/png" | "image/jpeg" | "image/gif" | "image/webp" | "image/bmp" | "image/x-icon" | "image/avif" | "image/jfif")[]];
197
210
  export declare const EXPORT_IMAGE_TYPES: {
@@ -226,9 +239,12 @@ export declare const URL_HASH_KEYS: {
226
239
  readonly addLibrary: "addLibrary";
227
240
  };
228
241
  export declare const DEFAULT_UI_OPTIONS: AppProps["UIOptions"];
229
- export declare const MQ_MAX_WIDTH_PORTRAIT = 730;
242
+ export declare const MQ_MAX_MOBILE = 599;
230
243
  export declare const MQ_MAX_WIDTH_LANDSCAPE = 1000;
231
244
  export declare const MQ_MAX_HEIGHT_LANDSCAPE = 500;
245
+ export declare const MQ_MIN_TABLET: number;
246
+ export declare const MQ_MAX_TABLET = 1400;
247
+ export declare const MQ_MIN_WIDTH_DESKTOP = 1440;
232
248
  export declare const MQ_RIGHT_SIDEBAR_MIN_WIDTH = 1229;
233
249
  export declare const MAX_DECIMALS_FOR_SVG_EXPORT = 2;
234
250
  export declare const EXPORT_SCALES: number[];
@@ -341,3 +357,7 @@ export declare enum UserIdleState {
341
357
  * the start and end points)
342
358
  */
343
359
  export declare const LINE_POLYGON_POINT_MERGE_DISTANCE = 20;
360
+ export declare const DOUBLE_TAP_POSITION_THRESHOLD = 35;
361
+ export declare const MOBILE_ACTION_BUTTON_BG: {
362
+ readonly background: "var(--mobile-action-button-bg)";
363
+ };
@@ -17,6 +17,8 @@ export declare const getFontString: ({ fontSize, fontFamily, }: {
17
17
  fontSize: number;
18
18
  fontFamily: FontFamilyValues;
19
19
  }) => FontString;
20
+ /** executes callback in the frame that's after the current one */
21
+ export declare const nextAnimationFrame: (cb: () => any) => Promise<void>;
20
22
  export declare const debounce: <T extends any[]>(fn: (...args: T) => void, timeout: number) => {
21
23
  (...args: T): void;
22
24
  flush(): void;
@@ -264,4 +266,5 @@ export declare const castArray: <T>(value: T | T[]) => T[];
264
266
  export declare const isReadonlyArray: (value?: any) => value is readonly any[];
265
267
  export declare const sizeOf: (value: readonly unknown[] | Readonly<Map<string, unknown>> | Readonly<Record<string, unknown>> | ReadonlySet<unknown>) => number;
266
268
  export declare const reduceToCommonValue: <T, R = T>(collection: ReadonlySet<T> | readonly T[], getValue?: ((item: T) => R) | undefined) => R | null;
269
+ export declare const isMobileOrTablet: () => boolean;
267
270
  export {};
@@ -27,7 +27,9 @@ export declare class Scene {
27
27
  getElementsMapIncludingDeleted(): Map<string, Ordered<ExcalidrawElement>> & import("@excalidraw/common/utility-types").MakeBrand<"SceneElementsMap">;
28
28
  getNonDeletedElements(): readonly Ordered<NonDeletedExcalidrawElement>[];
29
29
  getFramesIncludingDeleted(): readonly ExcalidrawFrameLikeElement[];
30
- constructor(elements?: ElementsMapOrArray | null);
30
+ constructor(elements?: ElementsMapOrArray | null, options?: {
31
+ skipValidation?: true;
32
+ });
31
33
  getSelectedElements(opts: {
32
34
  selectedElementIds: AppState["selectedElementIds"];
33
35
  /**
@@ -55,7 +57,9 @@ export declare class Scene {
55
57
  * @returns whether a change was made
56
58
  */
57
59
  mapElements(iteratee: (element: ExcalidrawElement) => ExcalidrawElement): boolean;
58
- replaceAllElements(nextElements: ElementsMapOrArray): void;
60
+ replaceAllElements(nextElements: ElementsMapOrArray, options?: {
61
+ skipValidation?: true;
62
+ }): void;
59
63
  triggerUpdate(): void;
60
64
  onUpdate(cb: SceneStateCallback): SceneStateCallbackRemover;
61
65
  destroy(): void;
@@ -1,7 +1,8 @@
1
+ import type { AppState } from "@excalidraw/excalidraw/types";
1
2
  import type { Scene } from "./Scene";
2
3
  import type { ExcalidrawElement } from "./types";
3
4
  export interface Alignment {
4
5
  position: "start" | "center" | "end";
5
6
  axis: "x" | "y";
6
7
  }
7
- export declare const alignElements: (selectedElements: ExcalidrawElement[], alignment: Alignment, scene: Scene) => ExcalidrawElement[];
8
+ export declare const alignElements: (selectedElements: ExcalidrawElement[], alignment: Alignment, scene: Scene, appState: Readonly<AppState>) => ExcalidrawElement[];
@@ -74,7 +74,7 @@ export interface BoundingBox {
74
74
  width: number;
75
75
  height: number;
76
76
  }
77
- export declare const getCommonBoundingBox: (elements: ExcalidrawElement[] | readonly NonDeleted<ExcalidrawElement>[]) => BoundingBox;
77
+ export declare const getCommonBoundingBox: (elements: readonly ExcalidrawElement[] | readonly NonDeleted<ExcalidrawElement>[]) => BoundingBox;
78
78
  /**
79
79
  * returns scene coords of user's editor viewport (visible canvas area) bounds
80
80
  */
@@ -29,12 +29,16 @@ export declare class Delta<T> {
29
29
  }>(prevObject: T, nextObject: T, modifier?: (partial: Partial<T>) => Partial<T>, postProcess?: (deleted: Partial<T>, inserted: Partial<T>) => [Partial<T>, Partial<T>]): Delta<T>;
30
30
  static empty(): Delta<unknown>;
31
31
  static isEmpty<T>(delta: Delta<T>): boolean;
32
+ /**
33
+ * Merges two deltas into a new one.
34
+ */
35
+ static merge<T>(delta1: Delta<T>, delta2: Delta<T>, delta3?: Delta<T>): Delta<T>;
32
36
  /**
33
37
  * Merges deleted and inserted object partials.
34
38
  */
35
39
  static mergeObjects<T extends {
36
40
  [key: string]: unknown;
37
- }>(prev: T, added: T, removed: T): T;
41
+ }>(prev: T, added: T, removed?: T): T;
38
42
  /**
39
43
  * Merges deleted and inserted array partials.
40
44
  */
@@ -102,18 +106,24 @@ export interface DeltaContainer<T> {
102
106
  * @returns a tuple of the next object `T` with applied `Delta`s, and `boolean`, indicating whether the applied deltas resulted in a visible change.
103
107
  */
104
108
  applyTo(previous: T, ...options: unknown[]): [T, boolean];
109
+ /**
110
+ * Squashes the current delta with the given one.
111
+ */
112
+ squash(delta: DeltaContainer<T>): this;
105
113
  /**
106
114
  * Checks whether all `Delta`s are empty.
107
115
  */
108
116
  isEmpty(): boolean;
109
117
  }
110
118
  export declare class AppStateDelta implements DeltaContainer<AppState> {
111
- readonly delta: Delta<ObservedAppState>;
119
+ delta: Delta<ObservedAppState>;
112
120
  private constructor();
121
+ static create(delta: Delta<ObservedAppState>): AppStateDelta;
113
122
  static calculate<T extends ObservedAppState>(prevAppState: T, nextAppState: T): AppStateDelta;
114
123
  static restore(appStateDeltaDTO: DTO<AppStateDelta>): AppStateDelta;
115
124
  static empty(): AppStateDelta;
116
125
  inverse(): AppStateDelta;
126
+ squash(delta: AppStateDelta): this;
117
127
  applyTo(appState: AppState, nextElements: SceneElementsMap): [AppState, boolean];
118
128
  isEmpty(): boolean;
119
129
  /**
@@ -122,7 +132,6 @@ export declare class AppStateDelta implements DeltaContainer<AppState> {
122
132
  * @returns `true` if a visible change is found, `false` otherwise.
123
133
  */
124
134
  private filterInvisibleChanges;
125
- private static convertToAppStateKey;
126
135
  private static filterSelectedElements;
127
136
  private static filterSelectedGroups;
128
137
  private static stripElementsProps;
@@ -136,7 +145,7 @@ export declare class AppStateDelta implements DeltaContainer<AppState> {
136
145
  }
137
146
  type ElementPartial<TElement extends ExcalidrawElement = ExcalidrawElement> = Omit<Partial<Ordered<TElement>>, "id" | "updated" | "seed">;
138
147
  export type ApplyToOptions = {
139
- excludedProperties: Set<keyof ElementPartial>;
148
+ excludedProperties?: Set<keyof ElementPartial>;
140
149
  };
141
150
  /**
142
151
  * Elements change is a low level primitive to capture a change between two sets of elements.
@@ -155,6 +164,7 @@ export declare class ElementsDelta implements DeltaContainer<SceneElementsMap> {
155
164
  private static satisfiesRemoval;
156
165
  private static satisfiesUpdate;
157
166
  private static satisfiesCommmonInvariants;
167
+ private static satisfiesUniqueInvariants;
158
168
  private static validate;
159
169
  /**
160
170
  * Calculates the `Delta`s between the previous and next set of elements.
@@ -177,6 +187,7 @@ export declare class ElementsDelta implements DeltaContainer<SceneElementsMap> {
177
187
  */
178
188
  applyLatestChanges(prevElements: SceneElementsMap, nextElements: SceneElementsMap, modifierOptions?: "deleted" | "inserted"): ElementsDelta;
179
189
  applyTo(elements: SceneElementsMap, snapshot?: StoreSnapshot["elements"], options?: ApplyToOptions): [SceneElementsMap, boolean];
190
+ squash(delta: ElementsDelta): this;
180
191
  private static createApplier;
181
192
  private static createGetter;
182
193
  private static applyDelta;
@@ -203,6 +214,7 @@ export declare class ElementsDelta implements DeltaContainer<SceneElementsMap> {
203
214
  * should be rebound (if possible) with the current element ~ bindings should be bidirectional.
204
215
  */
205
216
  private static rebindAffected;
217
+ static redrawElements(nextElements: SceneElementsMap, changedElements: Map<string, OrderedExcalidrawElement>): SceneElementsMap;
206
218
  private static redrawTextBoundingBoxes;
207
219
  private static redrawBoundArrows;
208
220
  private static reorderElements;
@@ -1,6 +1,7 @@
1
+ import type { AppState } from "@excalidraw/excalidraw/types";
1
2
  import type { ElementsMap, ExcalidrawElement } from "./types";
2
3
  export interface Distribution {
3
4
  space: "between";
4
5
  axis: "x" | "y";
5
6
  }
6
- export declare const distributeElements: (selectedElements: ExcalidrawElement[], elementsMap: ElementsMap, distribution: Distribution) => ExcalidrawElement[];
7
+ export declare const distributeElements: (selectedElements: ExcalidrawElement[], elementsMap: ElementsMap, distribution: Distribution, appState: Readonly<AppState>) => ExcalidrawElement[];
@@ -31,3 +31,4 @@ export declare const getNonDeletedGroupIds: (elements: ElementsMap) => Set<strin
31
31
  export declare const elementsAreInSameGroup: (elements: readonly ExcalidrawElement[]) => boolean;
32
32
  export declare const isInGroup: (element: NonDeletedExcalidrawElement) => boolean;
33
33
  export declare const getNewGroupIdsForDuplication: (groupIds: ExcalidrawElement["groupIds"], editingGroupId: AppState["editingGroupId"], mapper: (groupId: GroupId) => GroupId) => string[];
34
+ export declare const getSelectedElementsByGroup: (selectedElements: ExcalidrawElement[], elementsMap: ElementsMap, appState: Readonly<AppState>) => ExcalidrawElement[][];
@@ -38,6 +38,7 @@ export * from "./image";
38
38
  export * from "./linearElementEditor";
39
39
  export * from "./mutateElement";
40
40
  export * from "./newElement";
41
+ export * from "./positionElementsOnGrid";
41
42
  export * from "./renderElement";
42
43
  export * from "./resizeElements";
43
44
  export * from "./resizeTest";
@@ -39,7 +39,8 @@ export declare class LinearElementEditor {
39
39
  readonly segmentMidPointHoveredCoords: GlobalPoint | null;
40
40
  readonly elbowed: boolean;
41
41
  readonly customLineAngle: number | null;
42
- constructor(element: NonDeleted<ExcalidrawLinearElement>, elementsMap: ElementsMap);
42
+ readonly isEditing: boolean;
43
+ constructor(element: NonDeleted<ExcalidrawLinearElement>, elementsMap: ElementsMap, isEditing?: boolean);
43
44
  static POINT_HANDLE_SIZE: number;
44
45
  /**
45
46
  * @param id the `elementId` from the instance of this class (so that we can
@@ -0,0 +1,2 @@
1
+ import type { ExcalidrawElement } from "./types";
2
+ export declare const positionElementsOnGrid: <TElement extends ExcalidrawElement>(elements: TElement[] | TElement[][], centerX: number, centerY: number, padding?: number) => TElement[];
@@ -1,6 +1,7 @@
1
+ import { type GlobalPoint } from "@excalidraw/math";
1
2
  import type { AppState, StaticCanvasAppState, InteractiveCanvasAppState, ElementsPendingErasure, PendingExcalidrawElements } from "@excalidraw/excalidraw/types";
2
3
  import type { StaticCanvasRenderConfig, RenderableElementsMap, InteractiveCanvasRenderConfig } from "@excalidraw/excalidraw/scene/types";
3
- import type { ExcalidrawElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawImageElement, ExcalidrawFrameLikeElement, NonDeletedSceneElementsMap } from "./types";
4
+ import type { ExcalidrawElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawImageElement, ExcalidrawFrameLikeElement, NonDeletedSceneElementsMap, ElementsMap } from "./types";
4
5
  import type { RoughCanvas } from "roughjs/bin/canvas";
5
6
  export declare const IMAGE_INVERT_FILTER = "invert(100%) hue-rotate(180deg) saturate(1.25)";
6
7
  export declare const getRenderOpacity: (element: ExcalidrawElement, containingFrame: ExcalidrawFrameLikeElement | null, elementsPendingErasure: ElementsPendingErasure, pendingNodes: Readonly<PendingExcalidrawElements> | null, globalAlpha?: number) => number;
@@ -26,3 +27,5 @@ export declare const pathsCache: WeakMap<ExcalidrawFreeDrawElement, Path2D>;
26
27
  export declare function generateFreeDrawShape(element: ExcalidrawFreeDrawElement): Path2D;
27
28
  export declare function getFreeDrawPath2D(element: ExcalidrawFreeDrawElement): Path2D | undefined;
28
29
  export declare function getFreeDrawSvgPath(element: ExcalidrawFreeDrawElement): string;
30
+ export declare function getFreedrawOutlineAsSegments(element: ExcalidrawFreeDrawElement, points: [number, number][], elementsMap: ElementsMap): import("@excalidraw/math").LineSegment<GlobalPoint>[];
31
+ export declare function getFreedrawOutlinePoints(element: ExcalidrawFreeDrawElement): [number, number][];
@@ -169,7 +169,11 @@ export declare class StoreDelta {
169
169
  /**
170
170
  * Parse and load the delta from the remote payload.
171
171
  */
172
- static load({ id, elements: { added, removed, updated }, }: DTO<StoreDelta>): StoreDelta;
172
+ static load({ id, elements: { added, removed, updated }, appState: { delta: appStateDelta }, }: DTO<StoreDelta>): StoreDelta;
173
+ /**
174
+ * Squash the passed deltas into the aggregated delta instance.
175
+ */
176
+ static squash(...deltas: StoreDelta[]): StoreDelta;
173
177
  /**
174
178
  * Inverse store delta, creates new instance of `StoreDelta`.
175
179
  */
@@ -182,6 +186,7 @@ export declare class StoreDelta {
182
186
  * Apply latest (remote) changes to the delta, creates new instance of `StoreDelta`.
183
187
  */
184
188
  static applyLatestChanges(delta: StoreDelta, prevElements: SceneElementsMap, nextElements: SceneElementsMap, modifierOptions?: "deleted" | "inserted"): StoreDelta;
189
+ static empty(): StoreDelta;
185
190
  isEmpty(): boolean;
186
191
  }
187
192
  /**
@@ -1,6 +1,6 @@
1
+ import { type Radians } from "@excalidraw/math";
1
2
  import type { AppState } from "@excalidraw/excalidraw/types";
2
3
  import type { ExtractSetType } from "@excalidraw/common/utility-types";
3
- import type { Radians } from "@excalidraw/math";
4
4
  import type { Scene } from "./Scene";
5
5
  import type { MaybeTransformHandleType } from "./transformHandles";
6
6
  import type { ElementsMap, ExcalidrawElement, ExcalidrawElementType, ExcalidrawTextContainer, ExcalidrawTextElement, ExcalidrawTextElementWithContainer, NonDeletedExcalidrawElement } from "./types";
@@ -39,12 +39,15 @@ export declare const actionAddToLibrary: {
39
39
  editingFrame: string | null;
40
40
  elementsToHighlight: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawElement>[] | null;
41
41
  editingTextElement: import("../../element/src/types").NonDeletedExcalidrawElement | null;
42
- editingLinearElement: import("@excalidraw/element").LinearElementEditor | null;
43
42
  activeTool: {
44
43
  lastActiveTool: import("../types").ActiveTool | null;
45
44
  locked: boolean;
46
45
  fromSelection: boolean;
47
46
  } & import("../types").ActiveTool;
47
+ preferredSelectionTool: {
48
+ type: "selection" | "lasso";
49
+ initialized: boolean;
50
+ };
48
51
  penMode: boolean;
49
52
  penDetected: boolean;
50
53
  exportBackground: boolean;
@@ -77,8 +80,8 @@ export declare const actionAddToLibrary: {
77
80
  zoom: Readonly<{
78
81
  value: import("../types").NormalizedZoomValue;
79
82
  }>;
80
- openMenu: "canvas" | "shape" | null;
81
- openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
83
+ openMenu: "canvas" | null;
84
+ openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
82
85
  openSidebar: {
83
86
  name: string;
84
87
  tab?: string | undefined;
@@ -174,6 +177,7 @@ export declare const actionAddToLibrary: {
174
177
  lockedMultiSelections: {
175
178
  [groupId: string]: true;
176
179
  };
180
+ stylesPanelMode: "compact" | "full" | "mobile";
177
181
  };
178
182
  } | {
179
183
  captureUpdate: "EVENTUALLY";
@@ -207,12 +211,15 @@ export declare const actionAddToLibrary: {
207
211
  editingFrame: string | null;
208
212
  elementsToHighlight: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawElement>[] | null;
209
213
  editingTextElement: import("../../element/src/types").NonDeletedExcalidrawElement | null;
210
- editingLinearElement: import("@excalidraw/element").LinearElementEditor | null;
211
214
  activeTool: {
212
215
  lastActiveTool: import("../types").ActiveTool | null;
213
216
  locked: boolean;
214
217
  fromSelection: boolean;
215
218
  } & import("../types").ActiveTool;
219
+ preferredSelectionTool: {
220
+ type: "selection" | "lasso";
221
+ initialized: boolean;
222
+ };
216
223
  penMode: boolean;
217
224
  penDetected: boolean;
218
225
  exportBackground: boolean;
@@ -245,8 +252,8 @@ export declare const actionAddToLibrary: {
245
252
  zoom: Readonly<{
246
253
  value: import("../types").NormalizedZoomValue;
247
254
  }>;
248
- openMenu: "canvas" | "shape" | null;
249
- openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
255
+ openMenu: "canvas" | null;
256
+ openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
250
257
  openSidebar: {
251
258
  name: string;
252
259
  tab?: string | undefined;
@@ -347,6 +354,7 @@ export declare const actionAddToLibrary: {
347
354
  lockedMultiSelections: {
348
355
  [groupId: string]: true;
349
356
  };
357
+ stylesPanelMode: "compact" | "full" | "mobile";
350
358
  };
351
359
  }> | {
352
360
  captureUpdate: "EVENTUALLY";
@@ -380,12 +388,15 @@ export declare const actionAddToLibrary: {
380
388
  editingFrame: string | null;
381
389
  elementsToHighlight: import("../../element/src/types").NonDeleted<import("../../element/src/types").ExcalidrawElement>[] | null;
382
390
  editingTextElement: import("../../element/src/types").NonDeletedExcalidrawElement | null;
383
- editingLinearElement: import("@excalidraw/element").LinearElementEditor | null;
384
391
  activeTool: {
385
392
  lastActiveTool: import("../types").ActiveTool | null;
386
393
  locked: boolean;
387
394
  fromSelection: boolean;
388
395
  } & import("../types").ActiveTool;
396
+ preferredSelectionTool: {
397
+ type: "selection" | "lasso";
398
+ initialized: boolean;
399
+ };
389
400
  penMode: boolean;
390
401
  penDetected: boolean;
391
402
  exportBackground: boolean;
@@ -418,8 +429,8 @@ export declare const actionAddToLibrary: {
418
429
  zoom: Readonly<{
419
430
  value: import("../types").NormalizedZoomValue;
420
431
  }>;
421
- openMenu: "canvas" | "shape" | null;
422
- openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
432
+ openMenu: "canvas" | null;
433
+ openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
423
434
  openSidebar: {
424
435
  name: string;
425
436
  tab?: string | undefined;
@@ -520,6 +531,7 @@ export declare const actionAddToLibrary: {
520
531
  lockedMultiSelections: {
521
532
  [groupId: string]: true;
522
533
  };
534
+ stylesPanelMode: "compact" | "full" | "mobile";
523
535
  };
524
536
  };
525
537
  label: string;