@excalidraw/common 0.18.0-2a82821 → 0.18.0-2b1c2a9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev/index.js +94 -79
- package/dist/dev/index.js.map +3 -3
- package/dist/prod/index.js +3 -3
- package/dist/types/common/src/colors.d.ts +19 -0
- package/dist/types/common/src/constants.d.ts +3 -0
- package/dist/types/common/src/keys.d.ts +2 -0
- package/dist/types/common/src/points.d.ts +1 -1
- package/dist/types/common/src/utils.d.ts +1 -43
- package/dist/types/element/src/Scene.d.ts +1 -1
- package/dist/types/element/src/align.d.ts +2 -2
- package/dist/types/element/src/arrowEndpointText.d.ts +49 -0
- package/dist/types/element/src/arrows/focus.d.ts +5 -2
- package/dist/types/element/src/binding.d.ts +17 -8
- package/dist/types/element/src/bounds.d.ts +5 -9
- package/dist/types/element/src/bucketFill.d.ts +110 -0
- package/dist/types/element/src/collision.d.ts +1 -1
- package/dist/types/element/src/comparisons.d.ts +4 -4
- package/dist/types/element/src/convertToShape.d.ts +23 -0
- package/dist/types/element/src/distribute.d.ts +2 -2
- package/dist/types/element/src/dragElements.d.ts +27 -0
- package/dist/types/element/src/duplicate.d.ts +3 -3
- package/dist/types/element/src/embeddable.d.ts +2 -2
- package/dist/types/element/src/flowchart.d.ts +7 -7
- package/dist/types/element/src/fractionalIndex.d.ts +2 -2
- package/dist/types/element/src/frame.d.ts +4 -4
- package/dist/types/element/src/groups.d.ts +9 -9
- package/dist/types/element/src/index.d.ts +4 -1
- package/dist/types/element/src/linearElementEditor.d.ts +27 -10
- package/dist/types/element/src/newElement.d.ts +14 -0
- package/dist/types/element/src/renderElement.d.ts +0 -3
- package/dist/types/element/src/resizeElements.d.ts +2 -2
- package/dist/types/element/src/selection.d.ts +5 -5
- package/dist/types/element/src/shape.d.ts +12 -0
- package/dist/types/element/src/sortElements.d.ts +10 -0
- package/dist/types/element/src/textElement.d.ts +13 -9
- package/dist/types/element/src/transform.d.ts +2 -2
- package/dist/types/element/src/typeChecks.d.ts +25 -25
- package/dist/types/element/src/types.d.ts +9 -1
- package/dist/types/element/src/utils.d.ts +7 -3
- package/dist/types/element/src/zindex.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +36 -12
- package/dist/types/excalidraw/actions/actionAlign.d.ts +6 -6
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +24 -8
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +146 -931
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +24 -8
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +12 -4
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +38 -13
- package/dist/types/excalidraw/actions/actionDeselect.d.ts +9 -4
- package/dist/types/excalidraw/actions/actionDistribute.d.ts +2 -3
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +12 -4
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +25 -9
- package/dist/types/excalidraw/actions/actionExport.d.ts +29 -13
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionFrame.d.ts +48 -197
- package/dist/types/excalidraw/actions/actionGroup.d.ts +39 -23
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +16 -6
- package/dist/types/excalidraw/actions/actionLink.d.ts +13 -5
- package/dist/types/excalidraw/actions/actionMenu.d.ts +12 -4
- package/dist/types/excalidraw/actions/actionProperties.d.ts +43 -24
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +17 -9
- package/dist/types/excalidraw/actions/actionStyles.d.ts +12 -4
- package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +13 -5
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +16 -9
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +13 -5
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +13 -5
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +16 -9
- package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +13 -5
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +14 -6
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +13 -5
- package/dist/types/excalidraw/actions/index.d.ts +1 -2
- package/dist/types/excalidraw/actions/manager.d.ts +1 -0
- package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
- package/dist/types/excalidraw/actions/types.d.ts +8 -4
- package/dist/types/excalidraw/appState.d.ts +10 -5
- package/dist/types/excalidraw/components/Actions.d.ts +17 -12
- package/dist/types/excalidraw/components/App.arrowText.d.ts +104 -0
- package/dist/types/excalidraw/components/App.bucketFill.d.ts +48 -0
- package/dist/types/excalidraw/components/App.cursor.d.ts +38 -0
- package/dist/types/excalidraw/components/App.d.ts +372 -67
- package/dist/types/excalidraw/components/App.drawshape.d.ts +55 -0
- package/dist/types/excalidraw/components/App.flowchart.d.ts +21 -0
- package/dist/types/excalidraw/components/App.viewport.d.ts +73 -0
- package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +9 -3
- package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +3 -1
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +3 -1
- package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +9 -2
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +4 -2
- package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +8 -1
- package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +2 -1
- package/dist/types/excalidraw/components/ColorPicker/topPicksDnD.d.ts +31 -0
- package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +1 -1
- package/dist/types/excalidraw/components/CursorHint.d.ts +46 -0
- package/dist/types/excalidraw/components/{ToolButton.d.ts → IconButton.d.ts} +16 -19
- package/dist/types/excalidraw/components/Island.d.ts +7 -0
- package/dist/types/excalidraw/components/LaserPointerButton.d.ts +2 -4
- package/dist/types/excalidraw/components/LayerUI.d.ts +5 -2
- package/dist/types/excalidraw/components/LockButton.d.ts +3 -4
- package/dist/types/excalidraw/components/MagicButton.d.ts +0 -2
- package/dist/types/excalidraw/components/MobileMenu.d.ts +4 -4
- package/dist/types/excalidraw/components/MobileToolbar.d.ts +9 -0
- package/dist/types/excalidraw/components/PenModeButton.d.ts +2 -5
- package/dist/types/excalidraw/components/Popover.d.ts +1 -3
- package/dist/types/excalidraw/components/{ButtonIcon.d.ts → RadioButton.d.ts} +2 -5
- package/dist/types/excalidraw/components/Stats/Angle.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/Dimension.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/DragInput.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/Position.d.ts +3 -3
- package/dist/types/excalidraw/components/Stats/utils.d.ts +1 -1
- package/dist/types/excalidraw/components/ToolPopover.d.ts +3 -6
- package/dist/types/excalidraw/components/Toolbar.d.ts +11 -0
- package/dist/types/excalidraw/components/Tools.d.ts +146 -0
- package/dist/types/excalidraw/components/UserList.d.ts +3 -2
- package/dist/types/excalidraw/components/ViewportStatusFrame/ViewportStatusFrame.d.ts +11 -0
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +2 -0
- package/dist/types/excalidraw/components/footer/Footer.d.ts +3 -1
- package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +2 -2
- package/dist/types/excalidraw/components/icons.d.ts +4 -1
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +1 -1
- package/dist/types/excalidraw/components/positionElementBesideCursor.d.ts +26 -0
- package/dist/types/excalidraw/components/shapeActionPredicates.d.ts +39 -0
- package/dist/types/excalidraw/data/blob.d.ts +34 -18
- package/dist/types/excalidraw/data/index.d.ts +4 -4
- package/dist/types/excalidraw/data/json.d.ts +23 -15
- package/dist/types/excalidraw/drawShapeTrail.d.ts +16 -0
- package/dist/types/excalidraw/fonts/Fonts.d.ts +3 -2
- package/dist/types/excalidraw/hooks/useAppStateValue.d.ts +29 -0
- package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +5 -5
- package/dist/types/excalidraw/lasso/utils.d.ts +2 -0
- package/dist/types/excalidraw/renderer/animation.d.ts +1 -0
- package/dist/types/excalidraw/renderer/helpers.d.ts +7 -0
- package/dist/types/excalidraw/renderer/interactiveScene.d.ts +1 -3
- package/dist/types/excalidraw/scene/Renderer.d.ts +12 -11
- package/dist/types/excalidraw/scene/export.d.ts +3 -3
- package/dist/types/excalidraw/scene/index.d.ts +1 -1
- package/dist/types/excalidraw/scene/types.d.ts +4 -3
- package/dist/types/excalidraw/snapping.d.ts +7 -7
- package/dist/types/excalidraw/types.d.ts +410 -20
- package/dist/types/excalidraw/viewport.d.ts +275 -0
- package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +2 -3
- package/dist/types/laser-pointer/src/state.d.ts +1 -0
- package/dist/types/math/src/curve.d.ts +19 -12
- package/dist/types/math/src/index.d.ts +1 -0
- package/dist/types/math/src/pca.d.ts +79 -0
- package/dist/types/math/src/polygon.d.ts +25 -1
- package/dist/types/math/src/segment.d.ts +6 -0
- package/dist/types/utils/src/export.d.ts +3 -3
- package/package.json +1 -1
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +0 -172
- package/dist/types/excalidraw/components/FollowMode/FollowMode.d.ts +0 -10
- package/dist/types/excalidraw/components/HandButton.d.ts +0 -10
- package/dist/types/excalidraw/components/MobileToolBar.d.ts +0 -10
- package/dist/types/excalidraw/components/shapes.d.ts +0 -270
- package/dist/types/excalidraw/cursor.d.ts +0 -5
- package/dist/types/excalidraw/scene/scroll.d.ts +0 -18
- package/dist/types/excalidraw/scene/zoom.d.ts +0 -12
package/dist/prod/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Je=Object.create;var re=Object.defineProperty;var et=Object.getOwnPropertyDescriptor;var tt=Object.getOwnPropertyNames;var nt=Object.getPrototypeOf,rt=Object.prototype.hasOwnProperty;var ot=(e,t)=>()=>(e&&(t=e(e=0)),t);var oe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var st=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of tt(t))!rt.call(e,o)&&o!==n&&re(e,o,{get:()=>t[o],enumerable:!(r=et(t,o))||r.enumerable});return e};var se=(e,t,n)=>(n=e!=null?Je(nt(e)):{},st(t||!e||!e.__esModule?re(n,"default",{value:e,enumerable:!0}):n,e));var h,d=ot(()=>{h={PROD:!0}});var De=oe((Q,ke)=>{d();(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof Q=="object"?ke.exports=t():(e.PromisePool=t(),e.promisePool=e.PromisePool)})(Q,function(){"use strict";var e=function(){this._listeners={}};e.prototype.addEventListener=function(a,l){this._listeners[a]=this._listeners[a]||[],this._listeners[a].indexOf(l)<0&&this._listeners[a].push(l)},e.prototype.removeEventListener=function(a,l){if(this._listeners[a]){var u=this._listeners[a].indexOf(l);u>=0&&this._listeners[a].splice(u,1)}},e.prototype.dispatchEvent=function(a){if(this._listeners[a.type]&&this._listeners[a.type].length)for(var l=this._listeners[a.type].slice(),u=0,f=l.length;u<f;++u)l[u].call(this,a)};var t=function(a){return typeof a.constructor=="function"&&a.constructor.name==="GeneratorFunction"},n=function(a){return{next:function(){var l=a();return l?{value:l}:{done:!0}}}},r=function(a){var l=!1;return{next:function(){return l?{done:!0}:(l=!0,{value:a})}}},o=function(a,l){var u=typeof a;if(u==="object"){if(typeof a.next=="function")return a;if(typeof a.then=="function")return r(a)}return u==="function"?t(a)?a():n(a):r(l.resolve(a))},s=function(a,l,u){this.target=a,this.type=l,this.data=u},i=function(a,l,u){if(e.call(this),typeof l!="number"||Math.floor(l)!==l||l<1)throw new Error("Invalid concurrency");this._concurrency=l,this._options=u||{},this._options.promise=this._options.promise||Promise,this._iterator=o(a,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(a){return typeof a<"u"&&(this._concurrency=a,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 a=this,l=this._options.promise;return this._promise=new l(function(u,f){a._callbacks={reject:f,resolve:u},a._proceed()}),this._promise},i.prototype._fireEvent=function(a,l){this.dispatchEvent(new s(this,a,l))},i.prototype._settle=function(a){a?this._callbacks.reject(a):this._callbacks.resolve(),this._promise=null,this._callbacks=null},i.prototype._onPooledPromiseFulfilled=function(a,l){this._size--,this.active()&&(this._fireEvent("fulfilled",{promise:a,result:l}),this._proceed())},i.prototype._onPooledPromiseRejected=function(a,l){this._size--,this.active()&&(this._fireEvent("rejected",{promise:a,error:l}),this._settle(l||new Error("Unknown error")))},i.prototype._trackPromise=function(a){var l=this;a.then(function(u){l._onPooledPromiseFulfilled(a,u)},function(u){l._onPooledPromiseRejected(a,u)}).catch(function(u){l._settle(new Error("Promise processing failed: "+u))})},i.prototype._proceed=function(){if(!this._done){for(var a={done:!1};this._size<this._concurrency&&!(a=this._iterator.next()).done;)this._size++,this._trackPromise(a.value);this._done=a===null||!!a.done}this._done&&this._size===0&&this._settle()},i.PromisePoolEvent=s,i.PromisePool=i,i})});var Xe=oe(V=>{"use strict";d();Object.defineProperty(V,"__esModule",{value:!0});V.sanitizeUrl=void 0;var fn=/^([^\w]*)(javascript|data|vbscript)/im,mn=/&#(\w+)(^\w|;)?/g,hn=/&(newline|tab);/gi,En=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,Tn=/^.+(:|:)/gim,bn=[".","/"];function gn(e){return bn.indexOf(e[0])>-1}function _n(e){return e.replace(mn,function(t,n){return String.fromCharCode(n)})}function xn(e){var t=_n(e||"").replace(hn,"").replace(En,"").trim();if(!t)return"about:blank";if(gn(t))return t;var n=t.match(Tn);if(!n)return t;var r=n[0];return fn.test(r)?"about:blank":t}V.sanitizeUrl=xn});d();d();var ae=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,s=this.content[o];if(r<this.scoreFunction(s))this.content[t]=s,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 s=(t+1<<1)-1,i=s+1,a=t,l=o;if(s<n){let u=this.scoreFunction(this.content[s]);u<l&&(a=s,l=u)}if(i<n&&this.scoreFunction(this.content[i])<l&&(a=i),a===t)break;this.content[t]=this.content[a],t=a}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))}};d();var On=e=>Array.isArray(e)&&e.length===4&&typeof e[0]=="number"&&typeof e[1]=="number"&&typeof e[2]=="number"&&typeof e[3]=="number";d();d();function U(e){"@babel/helpers - typeof";return U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},U(e)}var it=/^\s+/,lt=/\s+$/;function c(e,t){if(e=e||"",t=t||{},e instanceof c)return e;if(!(this instanceof c))return new c(e,t);var n=ct(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),n,r,o,s,i,a;return n=t.r/255,r=t.g/255,o=t.b/255,n<=.03928?s=n/12.92:s=Math.pow((n+.055)/1.055,2.4),r<=.03928?i=r/12.92:i=Math.pow((r+.055)/1.055,2.4),o<=.03928?a=o/12.92:a=Math.pow((o+.055)/1.055,2.4),.2126*s+.7152*i+.0722*a},setAlpha:function(t){return this._a=fe(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=le(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=le(this._r,this._g,this._b),n=Math.round(t.h*360),r=Math.round(t.s*100),o=Math.round(t.v*100);return this._a==1?"hsv("+n+", "+r+"%, "+o+"%)":"hsva("+n+", "+r+"%, "+o+"%, "+this._roundA+")"},toHsl:function(){var t=ie(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=ie(this._r,this._g,this._b),n=Math.round(t.h*360),r=Math.round(t.s*100),o=Math.round(t.l*100);return this._a==1?"hsl("+n+", "+r+"%, "+o+"%)":"hsla("+n+", "+r+"%, "+o+"%, "+this._roundA+")"},toHex:function(t){return ce(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return ft(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(E(this._r,255)*100)+"%",g:Math.round(E(this._g,255)*100)+"%",b:Math.round(E(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(E(this._r,255)*100)+"%, "+Math.round(E(this._g,255)*100)+"%, "+Math.round(E(this._b,255)*100)+"%)":"rgba("+Math.round(E(this._r,255)*100)+"%, "+Math.round(E(this._g,255)*100)+"%, "+Math.round(E(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:St[ce(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var n="#"+ue(this._r,this._g,this._b,this._a),r=n,o=this._gradientType?"GradientType = 1, ":"";if(t){var s=c(t);r="#"+ue(s._r,s._g,s._b,s._a)}return"progid:DXImageTransform.Microsoft.gradient("+o+"startColorstr="+n+",endColorstr="+r+")"},toString:function(t){var n=!!t;t=t||this._format;var r=!1,o=this._a<1&&this._a>=0,s=!n&&o&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return s?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return c(this.toString())},_applyModification:function(t,n){var r=t.apply(null,[this].concat([].slice.call(n)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(Tt,arguments)},brighten:function(){return this._applyModification(bt,arguments)},darken:function(){return this._applyModification(gt,arguments)},desaturate:function(){return this._applyModification(mt,arguments)},saturate:function(){return this._applyModification(ht,arguments)},greyscale:function(){return this._applyModification(Et,arguments)},spin:function(){return this._applyModification(_t,arguments)},_applyCombination:function(t,n){return t.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(yt,arguments)},complement:function(){return this._applyCombination(xt,arguments)},monochromatic:function(){return this._applyCombination(vt,arguments)},splitcomplement:function(){return this._applyCombination(At,arguments)},triad:function(){return this._applyCombination(de,[3])},tetrad:function(){return this._applyCombination(de,[4])}};c.fromRatio=function(e,t){if(U(e)=="object"){var n={};for(var r in e)e.hasOwnProperty(r)&&(r==="a"?n[r]=e[r]:n[r]=F(e[r]));e=n}return c(e,t)};function ct(e){var t={r:0,g:0,b:0},n=1,r=null,o=null,s=null,i=!1,a=!1;return typeof e=="string"&&(e=Lt(e)),U(e)=="object"&&(y(e.r)&&y(e.g)&&y(e.b)?(t=ut(e.r,e.g,e.b),i=!0,a=String(e.r).substr(-1)==="%"?"prgb":"rgb"):y(e.h)&&y(e.s)&&y(e.v)?(r=F(e.s),o=F(e.v),t=pt(e.h,r,o),i=!0,a="hsv"):y(e.h)&&y(e.s)&&y(e.l)&&(r=F(e.s),s=F(e.l),t=dt(e.h,r,s),i=!0,a="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=fe(n),{ok:i,format:e.format||a,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}function ut(e,t,n){return{r:E(e,255)*255,g:E(t,255)*255,b:E(n,255)*255}}function ie(e,t,n){e=E(e,255),t=E(t,255),n=E(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),s,i,a=(r+o)/2;if(r==o)s=i=0;else{var l=r-o;switch(i=a>.5?l/(2-r-o):l/(r+o),r){case e:s=(t-n)/l+(t<n?6:0);break;case t:s=(n-e)/l+2;break;case n:s=(e-t)/l+4;break}s/=6}return{h:s,s:i,l:a}}function dt(e,t,n){var r,o,s;e=E(e,360),t=E(t,100),n=E(n,100);function i(u,f,T){return T<0&&(T+=1),T>1&&(T-=1),T<1/6?u+(f-u)*6*T:T<1/2?f:T<2/3?u+(f-u)*(2/3-T)*6:u}if(t===0)r=o=s=n;else{var a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;r=i(l,a,e+1/3),o=i(l,a,e),s=i(l,a,e-1/3)}return{r:r*255,g:o*255,b:s*255}}function le(e,t,n){e=E(e,255),t=E(t,255),n=E(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),s,i,a=r,l=r-o;if(i=r===0?0:l/r,r==o)s=0;else{switch(r){case e:s=(t-n)/l+(t<n?6:0);break;case t:s=(n-e)/l+2;break;case n:s=(e-t)/l+4;break}s/=6}return{h:s,s:i,v:a}}function pt(e,t,n){e=E(e,360)*6,t=E(t,100),n=E(n,100);var r=Math.floor(e),o=e-r,s=n*(1-t),i=n*(1-o*t),a=n*(1-(1-o)*t),l=r%6,u=[n,i,s,s,a,n][l],f=[a,n,n,i,s,s][l],T=[s,s,a,n,n,i][l];return{r:u*255,g:f*255,b:T*255}}function ce(e,t,n,r){var o=[A(Math.round(e).toString(16)),A(Math.round(t).toString(16)),A(Math.round(n).toString(16))];return r&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function ft(e,t,n,r,o){var s=[A(Math.round(e).toString(16)),A(Math.round(t).toString(16)),A(Math.round(n).toString(16)),A(me(r))];return o&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function ue(e,t,n,r){var o=[A(me(r)),A(Math.round(e).toString(16)),A(Math.round(t).toString(16)),A(Math.round(n).toString(16))];return o.join("")}c.equals=function(e,t){return!e||!t?!1:c(e).toRgbString()==c(t).toRgbString()};c.random=function(){return c.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function mt(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.s-=t/100,n.s=N(n.s),c(n)}function ht(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.s+=t/100,n.s=N(n.s),c(n)}function Et(e){return c(e).desaturate(100)}function Tt(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.l+=t/100,n.l=N(n.l),c(n)}function bt(e,t){t=t===0?0:t||10;var n=c(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),c(n)}function gt(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.l-=t/100,n.l=N(n.l),c(n)}function _t(e,t){var n=c(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,c(n)}function xt(e){var t=c(e).toHsl();return t.h=(t.h+180)%360,c(t)}function de(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var n=c(e).toHsl(),r=[c(e)],o=360/t,s=1;s<t;s++)r.push(c({h:(n.h+s*o)%360,s:n.s,l:n.l}));return r}function At(e){var t=c(e).toHsl(),n=t.h;return[c(e),c({h:(n+72)%360,s:t.s,l:t.l}),c({h:(n+216)%360,s:t.s,l:t.l})]}function yt(e,t,n){t=t||6,n=n||30;var r=c(e).toHsl(),o=360/n,s=[c(e)];for(r.h=(r.h-(o*t>>1)+720)%360;--t;)r.h=(r.h+o)%360,s.push(c(r));return s}function vt(e,t){t=t||6;for(var n=c(e).toHsv(),r=n.h,o=n.s,s=n.v,i=[],a=1/t;t--;)i.push(c({h:r,s:o,v:s})),s=(s+a)%1;return i}c.mix=function(e,t,n){n=n===0?0:n||50;var r=c(e).toRgb(),o=c(t).toRgb(),s=n/100,i={r:(o.r-r.r)*s+r.r,g:(o.g-r.g)*s+r.g,b:(o.b-r.b)*s+r.b,a:(o.a-r.a)*s+r.a};return c(i)};c.readability=function(e,t){var n=c(e),r=c(t);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)};c.isReadable=function(e,t,n){var r=c.readability(e,t),o,s;switch(s=!1,o=wt(n),o.level+o.size){case"AAsmall":case"AAAlarge":s=r>=4.5;break;case"AAlarge":s=r>=3;break;case"AAAsmall":s=r>=7;break}return s};c.mostReadable=function(e,t,n){var r=null,o=0,s,i,a,l;n=n||{},i=n.includeFallbackColors,a=n.level,l=n.size;for(var u=0;u<t.length;u++)s=c.readability(e,t[u]),s>o&&(o=s,r=c(t[u]));return c.isReadable(e,r,{level:a,size:l})||!i?r:(n.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],n))};var j=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},St=c.hexNames=Mt(j);function Mt(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function fe(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function E(e,t){Rt(e)&&(e="100%");var n=Ot(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function N(e){return Math.min(1,Math.max(0,e))}function g(e){return parseInt(e,16)}function Rt(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function Ot(e){return typeof e=="string"&&e.indexOf("%")!=-1}function A(e){return e.length==1?"0"+e:""+e}function F(e){return e<=1&&(e=e*100+"%"),e}function me(e){return Math.round(parseFloat(e)*255).toString(16)}function pe(e){return g(e)/255}var x=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",n="(?:"+t+")|(?:"+e+")",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",o="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+o),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+o),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+o),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function y(e){return!!x.CSS_UNIT.exec(e)}function Lt(e){e=e.replace(it,"").replace(lt,"").toLowerCase();var t=!1;if(j[e])e=j[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=x.rgb.exec(e))?{r:n[1],g:n[2],b:n[3]}:(n=x.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=x.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=x.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=x.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=x.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=x.hex8.exec(e))?{r:g(n[1]),g:g(n[2]),b:g(n[3]),a:pe(n[4]),format:t?"name":"hex8"}:(n=x.hex6.exec(e))?{r:g(n[1]),g:g(n[2]),b:g(n[3]),format:t?"name":"hex"}:(n=x.hex4.exec(e))?{r:g(n[1]+""+n[1]),g:g(n[2]+""+n[2]),b:g(n[3]+""+n[3]),a:pe(n[4]+""+n[4]),format:t?"name":"hex8"}:(n=x.hex3.exec(e))?{r:g(n[1]+""+n[1]),g:g(n[2]+""+n[2]),b:g(n[3]+""+n[3]),format:t?"name":"hex"}:!1}function wt(e){var t,n;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:t,size:n}}import{clamp as he}from"@excalidraw/math";import{degreesToRadians as Ft}from"@excalidraw/math";var q=typeof window<"u"?new Map:null;function It(e,t,n,r){let o=e/255,s=t/255,i=n/255,a=Ft(r),l=Math.cos(a),u=Math.sin(a),f=[.213+l*.787-u*.213,.715-l*.715-u*.715,.072-l*.072+u*.928,.213-l*.213+u*.143,.715+l*.285+u*.14,.072-l*.072-u*.283,.213-l*.213-u*.787,.715-l*.715+u*.715,.072+l*.928+u*.072],T=o*f[0]+s*f[1]+i*f[2],L=o*f[3]+s*f[4]+i*f[5],_=o*f[6]+s*f[7]+i*f[8];return{r:Math.round(Math.max(0,Math.min(1,T))*255),g:Math.round(Math.max(0,Math.min(1,L))*255),b:Math.round(Math.max(0,Math.min(1,_))*255)}}var Ct=(e,t,n,r)=>{let o=he(r,0,100)/100,s=u=>{let f=u*(1-o)+(255-u)*o;return Math.round(he(f,0,255))},i=s(e),a=s(t),l=s(n);return{r:i,g:a,b:l}},Dn=(e,t=!0)=>{if(!t)return e;let n=q?.get(e);if(n)return n;let r=c(e),o=r.getAlpha(),s=r.toRgb(),i=Ct(s.r,s.g,s.b,93),a=It(i.r,i.g,i.b,180),l=Te(a.r,a.g,a.b,o);return q&&q.set(e,l),l},Pt=(e,t)=>t.reduce((n,r)=>(r in e&&(n[r]=e[r]),n),{}),Un=5,Nn=5,Hn=4,H=4,G=1,p={transparent:"transparent",black:"#1e1e1e",white:"#ffffff",gray:["#f8f9fa","#e9ecef","#ced4da","#868e96","#343a40"],red:["#fff5f5","#ffc9c9","#ff8787","#fa5252","#e03131"],pink:["#fff0f6","#fcc2d7","#f783ac","#e64980","#c2255c"],grape:["#f8f0fc","#eebefa","#da77f2","#be4bdb","#9c36b5"],violet:["#f3f0ff","#d0bfff","#9775fa","#7950f2","#6741d9"],blue:["#e7f5ff","#a5d8ff","#4dabf7","#228be6","#1971c2"],cyan:["#e3fafc","#99e9f2","#3bc9db","#15aabf","#0c8599"],teal:["#e6fcf5","#96f2d7","#38d9a9","#12b886","#099268"],green:["#ebfbee","#b2f2bb","#69db7c","#40c057","#2f9e44"],yellow:["#fff9db","#ffec99","#ffd43b","#fab005","#f08c00"],orange:["#fff4e6","#ffd8a8","#ffa94d","#fd7e14","#e8590c"],bronze:["#f8f1ee","#eaddd7","#d2bab0","#a18072","#846358"]},Ee=Pt(p,["cyan","blue","violet","grape","pink","green","teal","yellow","orange","red"]),Gn=[p.black,p.red[H],p.green[H],p.blue[H],p.yellow[H]],Bn=[p.transparent,p.red[G],p.green[G],p.blue[G],p.yellow[G]],Kn=[p.white,"#f8f9fa","#f5faff","#fffce8","#fdf8f6"],Wn={transparent:p.transparent,white:p.white,gray:p.gray,black:p.black,bronze:p.bronze,...Ee},Vn={transparent:p.transparent,white:p.white,gray:p.gray,black:p.black,bronze:p.bronze,...Ee},Yn=e=>[p.cyan[e],p.blue[e],p.violet[e],p.grape[e],p.pink[e],p.green[e],p.teal[e],p.yellow[e],p.orange[e],p.red[e]],Te=(e,t,n,r)=>{let o=`#${(16777216+(e<<16)+(t<<8)+n).toString(16).slice(1)}`;if(r!==void 0&&r<1){let s=Math.round(r*255).toString(16).padStart(2,"0");return`${o}${s}`}return o},$n=e=>{let t=c(e);if(!t.isValid())return null;let{r:n,g:r,b:o,a:s}=t.toRgb();return Te(n,r,o,s)},be=e=>c(e).getAlpha()===0,zn=240,kt=(e,t,n)=>(e*299+t*587+n*114)/1e3,Xn=(e,t=160)=>{if(!e)return!0;if(be(e))return!1;let n=c(e);if(!n.isValid())return!0;let{r,g:o,b:s}=n.toRgb();return kt(r,o,s)<t},jn=e=>{if(e=e.trim(),be(e))return e;let t=c(e);return t.isValid()?["hex","hex8"].includes(t.getFormat())&&!e.startsWith("#")?`#${e}`:e:null};d();var Jn=typeof window<"u"&&"ResizeObserver"in window,er="Excalidraw",tr=36,nr=10,rr=20,or=8,sr=5,ar=1,ir=30,lr=Math.PI/12,cr="red",ur={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},dr={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1,ERASER:5},pr={enabled:"all",disabled:"none",inheritFromUI:"var(--ui-pointerEvents)"},Dt=(m=>(m.COPY="copy",m.PASTE="paste",m.CUT="cut",m.KEYDOWN="keydown",m.KEYUP="keyup",m.MOUSE_MOVE="mousemove",m.RESIZE="resize",m.UNLOAD="unload",m.FOCUS="focus",m.BLUR="blur",m.DRAG_OVER="dragover",m.DROP="drop",m.GESTURE_END="gestureend",m.BEFORE_UNLOAD="beforeunload",m.GESTURE_START="gesturestart",m.GESTURE_CHANGE="gesturechange",m.POINTER_MOVE="pointermove",m.POINTER_DOWN="pointerdown",m.POINTER_UP="pointerup",m.STATE_CHANGE="statechange",m.WHEEL="wheel",m.TOUCH_START="touchstart",m.TOUCH_END="touchend",m.HASHCHANGE="hashchange",m.VISIBILITY_CHANGE="visibilitychange",m.SCROLL="scroll",m.EXCALIDRAW_LINK="excalidraw-link",m.MENU_ITEM_SELECT="menu.itemSelect",m.MESSAGE="message",m.FULLSCREENCHANGE="fullscreenchange",m))(Dt||{}),fr={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5},B={TEST:"test",DEVELOPMENT:"development",PRODUCTION:"production"},mr={SIDEBAR:"sidebar",SHAPE_ACTIONS_MENU:"App-menu__left",ZOOM_ACTIONS:"zoom-actions",SEARCH_MENU_INPUT_WRAPPER:"layer-ui__search-inputWrapper",CONVERT_ELEMENT_TYPE_POPUP:"ConvertElementTypePopup",SHAPE_ACTIONS_THEME_SCOPE:"shape-actions-theme-scope",FRAME_NAME:"frame-name",DROPDOWN_MENU_EVENT_WRAPPER:"dropdown-menu-event-wrapper"},hr={sm:16,md:20,lg:28,xl:36},_e="Xiaolai",I="Segoe UI Emoji",b={Virgil:1,Helvetica:2,Cascadia:3,Excalifont:5,Nunito:6,"Lilita One":7,"Comic Shanns":8,"Liberation Sans":9,Assistant:10},xe="sans-serif",Ae="monospace",Ut={[xe]:998,[Ae]:999},Z={[_e]:100,...Ut,[I]:1e3};function Nt(e){switch(e){case b.Cascadia:case b["Comic Shanns"]:return Ae;default:return xe}}var ye=e=>{let t=Nt(e);switch(e){case b.Excalifont:return[_e,t,I];default:return[t,I]}},Er={LIGHT:"light",DARK:"dark"},Tr="invert(93%) hue-rotate(180deg)",br={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},gr=1,_r=20,xr=b.Excalifont,Ar="left",yr="top",ve="{version}",Ht=2,Gt=2*Ht,Bt=1e-5,vr=2*Gt-Bt,Sr="#ffffff",Mr="#1e1e1e",Rr="#a2f1a6",Or=["selectAll"],Lr=20,wr=5,Se={svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",ico:"image/x-icon",avif:"image/avif",jfif:"image/jfif"},Kt={text:"text/plain",html:"text/html",json:"application/json",excalidraw:"application/vnd.excalidraw+json",excalidrawClipboard:"application/vnd.excalidraw.clipboard+json",excalidrawlib:"application/vnd.excalidrawlib+json",excalidrawlibIds:"application/vnd.excalidrawlib.ids+json"},ge={...Kt,"excalidraw.svg":"image/svg+xml","excalidraw.png":"image/png",binary:"application/octet-stream",...Se},Fr=[ge.text,ge.html,...Object.values(Se)],Ir={png:"png",svg:"svg",clipboard:"clipboard"},Cr={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawLibrary:"excalidrawlib",excalidrawClipboardWithAPI:"excalidraw-api/clipboard"},Pr=()=>window.EXCALIDRAW_EXPORT_SOURCE||window.location.origin,kr=500,Dr=300,Ur=500,Nr=1e4,Hr=3e4,Gr=100,Br=.1,Kr=.1,Wr=30,Vr=300,Yr=6e4,$r=3e3,zr={addLibrary:"addLibrary"},Xr={addLibrary:"addLibrary"},jr={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,toggleTheme:null,saveAsImage:!0},tools:{image:!0}},qr=2,Zr=[1,2,3],Qr=10,Jr={maxWidthOrHeight:1440,maxFileSizeBytes:4*1024*1024},eo="http://www.w3.org/2000/svg",to=`<?xml version="1.0" standalone="no"?>
|
|
1
|
+
var je=Object.create;var J=Object.defineProperty;var qe=Object.getOwnPropertyDescriptor;var Ze=Object.getOwnPropertyNames;var Qe=Object.getPrototypeOf,Je=Object.prototype.hasOwnProperty;var et=(e,t)=>()=>(e&&(t=e(e=0)),t);var ee=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var tt=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ze(t))!Je.call(e,o)&&o!==n&&J(e,o,{get:()=>t[o],enumerable:!(r=qe(t,o))||r.enumerable});return e};var te=(e,t,n)=>(n=e!=null?je(Qe(e)):{},tt(t||!e||!e.__esModule?J(n,"default",{value:e,enumerable:!0}):n,e));var h,p=et(()=>{h={PROD:!0}});var Pe=ee((z,Ce)=>{p();(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof z=="object"?Ce.exports=t():(e.PromisePool=t(),e.promisePool=e.PromisePool)})(z,function(){"use strict";var e=function(){this._listeners={}};e.prototype.addEventListener=function(i,l){this._listeners[i]=this._listeners[i]||[],this._listeners[i].indexOf(l)<0&&this._listeners[i].push(l)},e.prototype.removeEventListener=function(i,l){if(this._listeners[i]){var u=this._listeners[i].indexOf(l);u>=0&&this._listeners[i].splice(u,1)}},e.prototype.dispatchEvent=function(i){if(this._listeners[i.type]&&this._listeners[i.type].length)for(var l=this._listeners[i.type].slice(),u=0,m=l.length;u<m;++u)l[u].call(this,i)};var t=function(i){return typeof i.constructor=="function"&&i.constructor.name==="GeneratorFunction"},n=function(i){return{next:function(){var l=i();return l?{value:l}:{done:!0}}}},r=function(i){var l=!1;return{next:function(){return l?{done:!0}:(l=!0,{value:i})}}},o=function(i,l){var u=typeof i;if(u==="object"){if(typeof i.next=="function")return i;if(typeof i.then=="function")return r(i)}return u==="function"?t(i)?i():n(i):r(l.resolve(i))},s=function(i,l,u){this.target=i,this.type=l,this.data=u},a=function(i,l,u){if(e.call(this),typeof l!="number"||Math.floor(l)!==l||l<1)throw new Error("Invalid concurrency");this._concurrency=l,this._options=u||{},this._options.promise=this._options.promise||Promise,this._iterator=o(i,this._options.promise),this._done=!1,this._size=0,this._promise=null,this._callbacks=null};return a.prototype=new e,a.prototype.constructor=a,a.prototype.concurrency=function(i){return typeof i<"u"&&(this._concurrency=i,this.active()&&this._proceed()),this._concurrency},a.prototype.size=function(){return this._size},a.prototype.active=function(){return!!this._promise},a.prototype.promise=function(){return this._promise},a.prototype.start=function(){var i=this,l=this._options.promise;return this._promise=new l(function(u,m){i._callbacks={reject:m,resolve:u},i._proceed()}),this._promise},a.prototype._fireEvent=function(i,l){this.dispatchEvent(new s(this,i,l))},a.prototype._settle=function(i){i?this._callbacks.reject(i):this._callbacks.resolve(),this._promise=null,this._callbacks=null},a.prototype._onPooledPromiseFulfilled=function(i,l){this._size--,this.active()&&(this._fireEvent("fulfilled",{promise:i,result:l}),this._proceed())},a.prototype._onPooledPromiseRejected=function(i,l){this._size--,this.active()&&(this._fireEvent("rejected",{promise:i,error:l}),this._settle(l||new Error("Unknown error")))},a.prototype._trackPromise=function(i){var l=this;i.then(function(u){l._onPooledPromiseFulfilled(i,u)},function(u){l._onPooledPromiseRejected(i,u)}).catch(function(u){l._settle(new Error("Promise processing failed: "+u))})},a.prototype._proceed=function(){if(!this._done){for(var i={done:!1};this._size<this._concurrency&&!(i=this._iterator.next()).done;)this._size++,this._trackPromise(i.value);this._done=i===null||!!i.done}this._done&&this._size===0&&this._settle()},a.PromisePoolEvent=s,a.PromisePool=a,a})});var Ve=ee(B=>{"use strict";p();Object.defineProperty(B,"__esModule",{value:!0});B.sanitizeUrl=void 0;var cn=/^([^\w]*)(javascript|data|vbscript)/im,un=/&#(\w+)(^\w|;)?/g,pn=/&(newline|tab);/gi,dn=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,fn=/^.+(:|:)/gim,hn=[".","/"];function mn(e){return hn.indexOf(e[0])>-1}function En(e){return e.replace(un,function(t,n){return String.fromCharCode(n)})}function Tn(e){var t=En(e||"").replace(pn,"").replace(dn,"").trim();if(!t)return"about:blank";if(mn(t))return t;var n=t.match(fn);if(!n)return t;var r=n[0];return cn.test(r)?"about:blank":t}B.sanitizeUrl=Tn});p();p();var ne=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,s=this.content[o];if(r<this.scoreFunction(s))this.content[t]=s,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 s=(t+1<<1)-1,a=s+1,i=t,l=o;if(s<n){let u=this.scoreFunction(this.content[s]);u<l&&(i=s,l=u)}if(a<n&&this.scoreFunction(this.content[a])<l&&(i=a),i===t)break;this.content[t]=this.content[i],t=i}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))}};p();var vn=e=>Array.isArray(e)&&e.length===4&&typeof e[0]=="number"&&typeof e[1]=="number"&&typeof e[2]=="number"&&typeof e[3]=="number";p();p();function C(e){"@babel/helpers - typeof";return C=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C(e)}var rt=/^\s+/,ot=/\s+$/;function c(e,t){if(e=e||"",t=t||{},e instanceof c)return e;if(!(this instanceof c))return new c(e,t);var n=st(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),n,r,o,s,a,i;return n=t.r/255,r=t.g/255,o=t.b/255,n<=.03928?s=n/12.92:s=Math.pow((n+.055)/1.055,2.4),r<=.03928?a=r/12.92:a=Math.pow((r+.055)/1.055,2.4),o<=.03928?i=o/12.92:i=Math.pow((o+.055)/1.055,2.4),.2126*s+.7152*a+.0722*i},setAlpha:function(t){return this._a=ce(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=oe(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=oe(this._r,this._g,this._b),n=Math.round(t.h*360),r=Math.round(t.s*100),o=Math.round(t.v*100);return this._a==1?"hsv("+n+", "+r+"%, "+o+"%)":"hsva("+n+", "+r+"%, "+o+"%, "+this._roundA+")"},toHsl:function(){var t=re(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=re(this._r,this._g,this._b),n=Math.round(t.h*360),r=Math.round(t.s*100),o=Math.round(t.l*100);return this._a==1?"hsl("+n+", "+r+"%, "+o+"%)":"hsla("+n+", "+r+"%, "+o+"%, "+this._roundA+")"},toHex:function(t){return se(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return ct(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(E(this._r,255)*100)+"%",g:Math.round(E(this._g,255)*100)+"%",b:Math.round(E(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(E(this._r,255)*100)+"%, "+Math.round(E(this._g,255)*100)+"%, "+Math.round(E(this._b,255)*100)+"%)":"rgba("+Math.round(E(this._r,255)*100)+"%, "+Math.round(E(this._g,255)*100)+"%, "+Math.round(E(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:xt[se(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var n="#"+ie(this._r,this._g,this._b,this._a),r=n,o=this._gradientType?"GradientType = 1, ":"";if(t){var s=c(t);r="#"+ie(s._r,s._g,s._b,s._a)}return"progid:DXImageTransform.Microsoft.gradient("+o+"startColorstr="+n+",endColorstr="+r+")"},toString:function(t){var n=!!t;t=t||this._format;var r=!1,o=this._a<1&&this._a>=0,s=!n&&o&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return s?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return c(this.toString())},_applyModification:function(t,n){var r=t.apply(null,[this].concat([].slice.call(n)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(ft,arguments)},brighten:function(){return this._applyModification(ht,arguments)},darken:function(){return this._applyModification(mt,arguments)},desaturate:function(){return this._applyModification(ut,arguments)},saturate:function(){return this._applyModification(pt,arguments)},greyscale:function(){return this._applyModification(dt,arguments)},spin:function(){return this._applyModification(Et,arguments)},_applyCombination:function(t,n){return t.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(gt,arguments)},complement:function(){return this._applyCombination(Tt,arguments)},monochromatic:function(){return this._applyCombination(_t,arguments)},splitcomplement:function(){return this._applyCombination(bt,arguments)},triad:function(){return this._applyCombination(ae,[3])},tetrad:function(){return this._applyCombination(ae,[4])}};c.fromRatio=function(e,t){if(C(e)=="object"){var n={};for(var r in e)e.hasOwnProperty(r)&&(r==="a"?n[r]=e[r]:n[r]=O(e[r]));e=n}return c(e,t)};function st(e){var t={r:0,g:0,b:0},n=1,r=null,o=null,s=null,a=!1,i=!1;return typeof e=="string"&&(e=St(e)),C(e)=="object"&&(A(e.r)&&A(e.g)&&A(e.b)?(t=it(e.r,e.g,e.b),a=!0,i=String(e.r).substr(-1)==="%"?"prgb":"rgb"):A(e.h)&&A(e.s)&&A(e.v)?(r=O(e.s),o=O(e.v),t=lt(e.h,r,o),a=!0,i="hsv"):A(e.h)&&A(e.s)&&A(e.l)&&(r=O(e.s),s=O(e.l),t=at(e.h,r,s),a=!0,i="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=ce(n),{ok:a,format:e.format||i,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}function it(e,t,n){return{r:E(e,255)*255,g:E(t,255)*255,b:E(n,255)*255}}function re(e,t,n){e=E(e,255),t=E(t,255),n=E(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),s,a,i=(r+o)/2;if(r==o)s=a=0;else{var l=r-o;switch(a=i>.5?l/(2-r-o):l/(r+o),r){case e:s=(t-n)/l+(t<n?6:0);break;case t:s=(n-e)/l+2;break;case n:s=(e-t)/l+4;break}s/=6}return{h:s,s:a,l:i}}function at(e,t,n){var r,o,s;e=E(e,360),t=E(t,100),n=E(n,100);function a(u,m,b){return b<0&&(b+=1),b>1&&(b-=1),b<1/6?u+(m-u)*6*b:b<1/2?m:b<2/3?u+(m-u)*(2/3-b)*6:u}if(t===0)r=o=s=n;else{var i=n<.5?n*(1+t):n+t-n*t,l=2*n-i;r=a(l,i,e+1/3),o=a(l,i,e),s=a(l,i,e-1/3)}return{r:r*255,g:o*255,b:s*255}}function oe(e,t,n){e=E(e,255),t=E(t,255),n=E(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),s,a,i=r,l=r-o;if(a=r===0?0:l/r,r==o)s=0;else{switch(r){case e:s=(t-n)/l+(t<n?6:0);break;case t:s=(n-e)/l+2;break;case n:s=(e-t)/l+4;break}s/=6}return{h:s,s:a,v:i}}function lt(e,t,n){e=E(e,360)*6,t=E(t,100),n=E(n,100);var r=Math.floor(e),o=e-r,s=n*(1-t),a=n*(1-o*t),i=n*(1-(1-o)*t),l=r%6,u=[n,a,s,s,i,n][l],m=[i,n,n,a,s,s][l],b=[s,s,i,n,n,a][l];return{r:u*255,g:m*255,b:b*255}}function se(e,t,n,r){var o=[x(Math.round(e).toString(16)),x(Math.round(t).toString(16)),x(Math.round(n).toString(16))];return r&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function ct(e,t,n,r,o){var s=[x(Math.round(e).toString(16)),x(Math.round(t).toString(16)),x(Math.round(n).toString(16)),x(ue(r))];return o&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function ie(e,t,n,r){var o=[x(ue(r)),x(Math.round(e).toString(16)),x(Math.round(t).toString(16)),x(Math.round(n).toString(16))];return o.join("")}c.equals=function(e,t){return!e||!t?!1:c(e).toRgbString()==c(t).toRgbString()};c.random=function(){return c.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function ut(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.s-=t/100,n.s=P(n.s),c(n)}function pt(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.s+=t/100,n.s=P(n.s),c(n)}function dt(e){return c(e).desaturate(100)}function ft(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.l+=t/100,n.l=P(n.l),c(n)}function ht(e,t){t=t===0?0:t||10;var n=c(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),c(n)}function mt(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.l-=t/100,n.l=P(n.l),c(n)}function Et(e,t){var n=c(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,c(n)}function Tt(e){var t=c(e).toHsl();return t.h=(t.h+180)%360,c(t)}function ae(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var n=c(e).toHsl(),r=[c(e)],o=360/t,s=1;s<t;s++)r.push(c({h:(n.h+s*o)%360,s:n.s,l:n.l}));return r}function bt(e){var t=c(e).toHsl(),n=t.h;return[c(e),c({h:(n+72)%360,s:t.s,l:t.l}),c({h:(n+216)%360,s:t.s,l:t.l})]}function gt(e,t,n){t=t||6,n=n||30;var r=c(e).toHsl(),o=360/n,s=[c(e)];for(r.h=(r.h-(o*t>>1)+720)%360;--t;)r.h=(r.h+o)%360,s.push(c(r));return s}function _t(e,t){t=t||6;for(var n=c(e).toHsv(),r=n.h,o=n.s,s=n.v,a=[],i=1/t;t--;)a.push(c({h:r,s:o,v:s})),s=(s+i)%1;return a}c.mix=function(e,t,n){n=n===0?0:n||50;var r=c(e).toRgb(),o=c(t).toRgb(),s=n/100,a={r:(o.r-r.r)*s+r.r,g:(o.g-r.g)*s+r.g,b:(o.b-r.b)*s+r.b,a:(o.a-r.a)*s+r.a};return c(a)};c.readability=function(e,t){var n=c(e),r=c(t);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)};c.isReadable=function(e,t,n){var r=c.readability(e,t),o,s;switch(s=!1,o=Mt(n),o.level+o.size){case"AAsmall":case"AAAlarge":s=r>=4.5;break;case"AAlarge":s=r>=3;break;case"AAAsmall":s=r>=7;break}return s};c.mostReadable=function(e,t,n){var r=null,o=0,s,a,i,l;n=n||{},a=n.includeFallbackColors,i=n.level,l=n.size;for(var u=0;u<t.length;u++)s=c.readability(e,t[u]),s>o&&(o=s,r=c(t[u]));return c.isReadable(e,r,{level:i,size:l})||!a?r:(n.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],n))};var W=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},xt=c.hexNames=At(W);function At(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function ce(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function E(e,t){yt(e)&&(e="100%");var n=vt(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function P(e){return Math.min(1,Math.max(0,e))}function g(e){return parseInt(e,16)}function yt(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function vt(e){return typeof e=="string"&&e.indexOf("%")!=-1}function x(e){return e.length==1?"0"+e:""+e}function O(e){return e<=1&&(e=e*100+"%"),e}function ue(e){return Math.round(parseFloat(e)*255).toString(16)}function le(e){return g(e)/255}var _=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",n="(?:"+t+")|(?:"+e+")",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",o="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+o),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+o),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+o),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function A(e){return!!_.CSS_UNIT.exec(e)}function St(e){e=e.replace(rt,"").replace(ot,"").toLowerCase();var t=!1;if(W[e])e=W[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=_.rgb.exec(e))?{r:n[1],g:n[2],b:n[3]}:(n=_.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=_.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=_.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=_.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=_.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=_.hex8.exec(e))?{r:g(n[1]),g:g(n[2]),b:g(n[3]),a:le(n[4]),format:t?"name":"hex8"}:(n=_.hex6.exec(e))?{r:g(n[1]),g:g(n[2]),b:g(n[3]),format:t?"name":"hex"}:(n=_.hex4.exec(e))?{r:g(n[1]+""+n[1]),g:g(n[2]+""+n[2]),b:g(n[3]+""+n[3]),a:le(n[4]+""+n[4]),format:t?"name":"hex8"}:(n=_.hex3.exec(e))?{r:g(n[1]+""+n[1]),g:g(n[2]+""+n[2]),b:g(n[3]+""+n[3]),format:t?"name":"hex"}:!1}function Mt(e){var t,n;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:t,size:n}}import{clamp as Y}from"@excalidraw/math";import{degreesToRadians as Rt}from"@excalidraw/math";var V=typeof window<"u"?new Map:null,pe=93,de=180;function fe(e,t,n,r){let o=e/255,s=t/255,a=n/255,i=Rt(r),l=Math.cos(i),u=Math.sin(i),m=[.213+l*.787-u*.213,.715-l*.715-u*.715,.072-l*.072+u*.928,.213-l*.213+u*.143,.715+l*.285+u*.14,.072-l*.072-u*.283,.213-l*.213-u*.787,.715-l*.715+u*.715,.072+l*.928+u*.072],b=o*m[0]+s*m[1]+a*m[2],Q=o*m[3]+s*m[4]+a*m[5],y=o*m[6]+s*m[7]+a*m[8];return{r:Math.round(Math.max(0,Math.min(1,b))*255),g:Math.round(Math.max(0,Math.min(1,Q))*255),b:Math.round(Math.max(0,Math.min(1,y))*255)}}var Ot=(e,t,n,r)=>{let o=Y(r,0,100)/100,s=u=>{let m=u*(1-o)+(255-u)*o;return Math.round(Y(m,0,255))},a=s(e),i=s(t),l=s(n);return{r:a,g:i,b:l}},In=(e,t=!0)=>{if(!t)return e;let n=V?.get(e);if(n)return n;let r=c(e),o=r.getAlpha(),s=r.toRgb(),a=Ot(s.r,s.g,s.b,pe),i=fe(a.r,a.g,a.b,de),l=k(i.r,i.g,i.b,o);return V&&V.set(e,l),l},Lt=(e,t,n)=>{let r=pe/100,o=1-2*r,s=a=>Math.round(Y((a-255*r)/o,0,255));return{r:s(e),g:s(t),b:s(n)}},Cn=e=>{let t=c(e),n=t.getAlpha(),r=t.toRgb(),o=fe(r.r,r.g,r.b,de),s=Lt(o.r,o.g,o.b);return k(s.r,s.g,s.b,n)},wt=(e,t)=>t.reduce((n,r)=>(r in e&&(n[r]=e[r]),n),{}),Pn=5,Dn=5,kn=4,D=4,v=1,d={transparent:"transparent",black:"#1e1e1e",white:"#ffffff",gray:["#f8f9fa","#e9ecef","#ced4da","#868e96","#343a40"],red:["#fff5f5","#ffc9c9","#ff8787","#fa5252","#e03131"],pink:["#fff0f6","#fcc2d7","#f783ac","#e64980","#c2255c"],grape:["#f8f0fc","#eebefa","#da77f2","#be4bdb","#9c36b5"],violet:["#f3f0ff","#d0bfff","#9775fa","#7950f2","#6741d9"],blue:["#e7f5ff","#a5d8ff","#4dabf7","#228be6","#1971c2"],cyan:["#e3fafc","#99e9f2","#3bc9db","#15aabf","#0c8599"],teal:["#e6fcf5","#96f2d7","#38d9a9","#12b886","#099268"],green:["#ebfbee","#b2f2bb","#69db7c","#40c057","#2f9e44"],yellow:["#fff9db","#ffec99","#ffd43b","#fab005","#f08c00"],orange:["#fff4e6","#ffd8a8","#ffa94d","#fd7e14","#e8590c"],bronze:["#f8f1ee","#eaddd7","#d2bab0","#a18072","#846358"]},he=wt(d,["cyan","blue","violet","grape","pink","green","teal","yellow","orange","red"]),Un=5,Nn=[d.black,d.red[D],d.green[D],d.blue[D],d.yellow[D]],Hn=[d.transparent,d.red[v],d.green[v],d.blue[v],d.yellow[v]],Gn=[d.white,d.red[v],d.green[v],d.blue[v],d.yellow[v]],Bn=[d.white,"#f8f9fa","#f5faff","#fffce8","#fdf8f6"],Kn={transparent:d.transparent,white:d.white,gray:d.gray,black:d.black,bronze:d.bronze,...he},Wn={transparent:d.transparent,white:d.white,gray:d.gray,black:d.black,bronze:d.bronze,...he},Vn=e=>[d.cyan[e],d.blue[e],d.violet[e],d.grape[e],d.pink[e],d.green[e],d.teal[e],d.yellow[e],d.orange[e],d.red[e]],k=(e,t,n,r)=>{let o=`#${(16777216+(e<<16)+(t<<8)+n).toString(16).slice(1)}`;if(r!==void 0&&r<1){let s=Math.round(r*255).toString(16).padStart(2,"0");return`${o}${s}`}return o},Yn=(e,t)=>{let n=c(e);if(!n.isValid())return e;let{r,g:o,b:s}=n.toRgb();return k(r,o,s,t)},$n=e=>{let t=c(e);if(!t.isValid())return null;let{r:n,g:r,b:o,a:s}=t.toRgb();return k(n,r,o,s)},me=e=>c(e).getAlpha()===0,zn=e=>c(e).getAlpha()===1,Xn=240,Ft=(e,t,n)=>(e*299+t*587+n*114)/1e3,jn=(e,t=160)=>{if(!e)return!0;if(me(e))return!1;let n=c(e);if(!n.isValid())return!0;let{r,g:o,b:s}=n.toRgb();return Ft(r,o,s)<t},qn=e=>{if(e=e.trim(),me(e))return e;let t=c(e);return t.isValid()?["hex","hex8"].includes(t.getFormat())&&!e.startsWith("#")?`#${e}`:e:null};p();var er=typeof window<"u"&&"ResizeObserver"in window,tr="Excalidraw",nr=36,rr=10,or=20,sr=8,ir=5,ar=1,lr=30,cr=Math.PI/12,ur="red",pr={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},dr={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1,ERASER:5},fr={enabled:"all",disabled:"none",inheritFromUI:"var(--ui-pointerEvents)"},It=(f=>(f.COPY="copy",f.PASTE="paste",f.CUT="cut",f.KEYDOWN="keydown",f.KEYUP="keyup",f.MOUSE_MOVE="mousemove",f.RESIZE="resize",f.UNLOAD="unload",f.FOCUS="focus",f.BLUR="blur",f.DRAG_OVER="dragover",f.DROP="drop",f.GESTURE_END="gestureend",f.BEFORE_UNLOAD="beforeunload",f.GESTURE_START="gesturestart",f.GESTURE_CHANGE="gesturechange",f.POINTER_MOVE="pointermove",f.POINTER_DOWN="pointerdown",f.POINTER_UP="pointerup",f.STATE_CHANGE="statechange",f.WHEEL="wheel",f.TOUCH_START="touchstart",f.TOUCH_END="touchend",f.HASHCHANGE="hashchange",f.VISIBILITY_CHANGE="visibilitychange",f.SCROLL="scroll",f.EXCALIDRAW_LINK="excalidraw-link",f.MENU_ITEM_SELECT="menu.itemSelect",f.MESSAGE="message",f.FULLSCREENCHANGE="fullscreenchange",f))(It||{}),hr={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5},U={TEST:"test",DEVELOPMENT:"development",PRODUCTION:"production"},mr={SIDEBAR:"sidebar",SHAPE_ACTIONS_MENU:"App-menu__left",ZOOM_ACTIONS:"zoom-actions",SEARCH_MENU_INPUT_WRAPPER:"layer-ui__search-inputWrapper",CONVERT_ELEMENT_TYPE_POPUP:"ConvertElementTypePopup",SHAPE_ACTIONS_THEME_SCOPE:"shape-actions-theme-scope",FRAME_NAME:"frame-name",DROPDOWN_MENU_EVENT_WRAPPER:"dropdown-menu-event-wrapper"},Er={sm:16,md:20,lg:28,xl:36},Te="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},be="sans-serif",ge="monospace",Ct={[be]:998,[ge]:999},$={[Te]:100,...Ct,[L]:1e3};function Pt(e){switch(e){case T.Cascadia:case T["Comic Shanns"]:return ge;default:return be}}var _e=e=>{let t=Pt(e);switch(e){case T.Excalifont:return[Te,t,L];default:return[t,L]}},Tr={LIGHT:"light",DARK:"dark"},br="invert(93%) hue-rotate(180deg)",gr={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},_r=1,xr=20,Ar=T.Excalifont,yr="left",vr="top",xe="{version}",Dt=2,kt=2*Dt,Ut=1e-5,Sr=2*kt-Ut,Mr="#ffffff",Rr="#1e1e1e",Or="#a2f1a6",Lr=["selectAll"],wr=20,Fr=5,Ae={svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",ico:"image/x-icon",avif:"image/avif",jfif:"image/jfif"},Nt={text:"text/plain",html:"text/html",json:"application/json",excalidraw:"application/vnd.excalidraw+json",excalidrawClipboard:"application/vnd.excalidraw.clipboard+json",excalidrawlib:"application/vnd.excalidrawlib+json",excalidrawlibIds:"application/vnd.excalidrawlib.ids+json"},Ee={...Nt,"excalidraw.svg":"image/svg+xml","excalidraw.png":"image/png",binary:"application/octet-stream",...Ae},Ir=[Ee.text,Ee.html,...Object.values(Ae)],Cr={png:"png",svg:"svg",clipboard:"clipboard"},Pr={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawLibrary:"excalidrawlib",excalidrawClipboardWithAPI:"excalidraw-api/clipboard"},Dr=()=>window.EXCALIDRAW_EXPORT_SOURCE||window.location.origin,kr=500,Ur=300,Nr=500,Hr=1e4,Gr=3e4,Br=100,Kr=.1,Wr=.1,Vr=30,Yr=300,$r=6e4,zr=3e3,Xr={addLibrary:"addLibrary"},jr={addLibrary:"addLibrary"},qr={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,toggleTheme:null,saveAsImage:!0},tools:{image:!0}},Zr=2,Qr=[1,2,3],Jr=10,eo={maxWidthOrHeight:1440,maxFileSizeBytes:4*1024*1024},to="http://www.w3.org/2000/svg",no=`<?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
|
-
`,no=128,ro={excalidraw:2,excalidrawLibrary:2},oo=5,so=.7,ao=11,io={TOP:"top",MIDDLE:"middle",BOTTOM:"bottom"},lo={LEFT:"left",CENTER:"center",RIGHT:"right"},co=20,uo=.25,po=32,fo={LEGACY:1,PROPORTIONAL_RADIUS:2,ADAPTIVE_RADIUS:3},Wt={architect:0,artist:1,cartoonist:2},mo=["thin","medium","bold"],Me={thin:1,medium:2,bold:4,extraBold:8},Vt={thin:.5,medium:1,bold:2,extraBold:4},ho=(e,t)=>e==="freedraw"?Vt[t]:Me[t],Yt="medium",Eo={strokeColor:p.black,backgroundColor:p.transparent,fillStyle:"solid",strokeWidth:Me[Yt],strokeStyle:"solid",roughness:Wt.artist,opacity:100,locked:!1},$t="library",To="search",bo={name:"default",defaultTab:$t},go=new Set(["iframe","embeddable","image"]),_o={selection:"selection",lasso:"lasso",rectangle:"rectangle",diamond:"diamond",ellipse:"ellipse",arrow:"arrow",line:"line",freedraw:"freedraw",text:"text",image:"image",eraser:"eraser",hand:"hand",frame:"frame",magicframe:"magicframe",embeddable:"embeddable",laser:"laser"},xo={OAI_API_KEY:"excalidraw-oai-api-key",MERMAID_TO_EXCALIDRAW:"mermaid-to-excalidraw",PUBLISH_LIBRARY:"publish-library-data"},Ao="Untitled",yo={generalStats:1,elementProperties:2},vo=1,So={sharp:"sharp",round:"round",elbow:"elbow"},Mo=.3,Ro="element",Oo=Symbol.for("__test__originalId__"),zt=(r=>(r.ACTIVE="active",r.AWAY="away",r.IDLE="idle",r))(zt||{}),Lo=20,wo=35,Fo=700,Io={background:"var(--mobile-action-button-bg)"},Co=.5,Po=.2;d();var K={[b.Excalifont]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25}},[b.Nunito]:{metrics:{unitsPerEm:1e3,ascender:1011,descender:-353,lineHeight:1.25}},[b["Lilita One"]]:{metrics:{unitsPerEm:1e3,ascender:923,descender:-220,lineHeight:1.15}},[b["Comic Shanns"]]:{metrics:{unitsPerEm:1e3,ascender:750,descender:-250,lineHeight:1.25}},[b.Virgil]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},deprecated:!0},[b.Helvetica]:{metrics:{unitsPerEm:2048,ascender:1577,descender:-471,lineHeight:1.15},deprecated:!0,local:!0},[b.Cascadia]:{metrics:{unitsPerEm:2048,ascender:1900,descender:-480,lineHeight:1.2},deprecated:!0},[b["Liberation Sans"]]:{metrics:{unitsPerEm:2048,ascender:1854,descender:-434,lineHeight:1.15},private:!0},[b.Assistant]:{metrics:{unitsPerEm:2048,ascender:1021,descender:-287,lineHeight:1.25},private:!0},[Z.Xiaolai]:{metrics:{unitsPerEm:1e3,ascender:880,descender:-144,lineHeight:1.25},fallback:!0},[Z["Segoe UI Emoji"]]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},local:!0,fallback:!0}},No={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"},Ho="local:",Go=(e,t,n)=>{let{unitsPerEm:r,ascender:o,descender:s}=K[e]?.metrics||K[b.Excalifont].metrics,i=t/r,a=(n-i*o+i*s)/2;return i*o+a},Bo=e=>{let{lineHeight:t}=K[e]?.metrics||K[b.Excalifont].metrics;return t};d();var Re=class{jobs=[];running=!1;tick(){if(this.running)return;let t=this.jobs.shift();t?(this.running=!0,t.promise.resolve(Le(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}};d();d();var we="excalidraw.desktopUIMode",zo=599,Xo=1e3,jo=500,qo=600,Zo=1180,Qo=1440,Jo=1229,Fe=/Mac|iPod|iPhone|iPad/.test(navigator.platform),es=/^Win/.test(navigator.platform),Ie=/\b(android)\b/i.test(navigator.userAgent),ts=typeof window<"u"&&"netscape"in window&&navigator.userAgent.indexOf("rv:")>1&&navigator.userAgent.indexOf("Gecko")>1,Xt=navigator.userAgent.indexOf("Chrome")!==-1,ns=!Xt&&navigator.userAgent.indexOf("Safari")!==-1,Ce=/iPad|iPhone/i.test(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document,rs=()=>navigator.brave?.isBrave?.name==="isBrave",jt=(e,t)=>e<=599||t<500&&e<1e3,qt=(e,t)=>{let n=Math.min(e,t),r=Math.max(e,t);return n>=600&&r<=1180},Zt=()=>{let e=navigator.userAgent||"",t=navigator.platform||"",n=navigator.userAgentData;if(n){let o=(n.platform||"").toLowerCase(),s=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(s)return!1}if(Ce)return!0;if(Ie){let o=/Mobile/i.test(e);if(o||!o)return matchMedia?.("(hover: none)").matches&&matchMedia?.("(pointer: coarse)").matches}return/Win|Linux|CrOS|Mac/.test(t)||/Windows NT|X11|CrOS|Macintosh/.test(e),!1},os=(e,t)=>jt(e,t)?"phone":qt(e,t)?"tablet":"desktop",ss=e=>e.formFactor==="phone"?"mobile":e.formFactor==="tablet"?"compact":e.desktopUIMode,as=e=>{let t=e??"",n="unknown";return Ce?n="ios":Ie?n="android":t&&(n="other"),{isMobileDevice:Zt(),platform:n}},is=()=>{if(typeof window>"u")return null;try{let e=window.localStorage.getItem(we);if(e==="compact"||e==="full")return e}catch{}return null},Qt=e=>{if(!(typeof window>"u"))try{window.localStorage.setItem(we,e)}catch{}},ls=e=>{if(!(e!=="compact"&&e!=="full"))return Qt(e),e};var Pe={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"},R={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:Fe?"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"},Jt=new Map([[R.Z,Pe.Z],[R.Y,Pe.Y]]),en=e=>/^[a-z]$/.test(e.toLowerCase()),ps=(e,t)=>{if(t===e.key.toLowerCase())return!0;let n=Jt.get(t);return!!(n&&!en(e.key)&&e.code===n)},fs=e=>e===R.ARROW_LEFT||e===R.ARROW_RIGHT||e===R.ARROW_DOWN||e===R.ARROW_UP,ms=e=>e.altKey,hs=e=>e.shiftKey,Es=e=>e.shiftKey;d();import{pointFromPair as tn}from"@excalidraw/math";var _s=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)}},xs=(e,t,n,r)=>{let o=n.map(_=>_[e]),s=Math.max(...o),i=Math.min(...o),a=s-i,l=a===0?1:t/a,u=1/0,f=n.map(_=>{let v=_[e]*l,S=[..._];return S[e]=v,v<u&&(u=v),S});if(!r||f.length===2)return f;let T=i-u;return f.map(_=>tn(_.map((v,S)=>S===e?v+T:v)))},As=(e,t,n)=>n?[Math.round(e/n)*n,Math.round(t/n)*n]:[e,t];d();var Ne=se(De(),1),Ue=class{pool;entries={};constructor(t,n){this.pool=new Ne.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)))}};d();d();d();var He=(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),"");d();var C=class{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}};d();import{average as W}from"@excalidraw/math";var J=null,Ns=e=>{J=e},Hs=()=>{if(J)return J;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"),s=`${e.getMinutes()}`.padStart(2,"0");return`${t}-${n}-${r}-${o}${s}`},Gs=e=>e.charAt(0).toUpperCase()+e.slice(1),Bs=e=>e instanceof HTMLElement&&e.className.includes("ToolIcon"),nn=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement,Ks=e=>nn(e)||e instanceof Element&&!!e.closest("label, button"),Ws=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")||e instanceof HTMLElement&&e.closest(".cm-editor")!==null,rn=({fontFamily:e})=>{for(let[t,n]of Object.entries(b))if(n===e)return`${t}${ye(n).map(r=>`, ${r}`).join("")}`;return I},Vs=({fontSize:e,fontFamily:t})=>`${e}px ${rn({fontFamily:t})}`,Ys=async e=>{requestAnimationFrame(()=>requestAnimationFrame(e))},$s=(e,t)=>{let n=0,r=null,o=(...s)=>{r=s,clearTimeout(n),n=window.setTimeout(()=>{r=null,e(...s)},t)};return o.flush=()=>{if(clearTimeout(n),r){let s=r;r=null,e(...s)}},o.cancel=()=>{r=null,clearTimeout(n)},o},zs=e=>{let t=null,n=null,r=()=>{t=window.requestAnimationFrame(()=>{t=null;let s=n;n=null,s&&e(...s)})},o=(...s)=>{n=s,t===null&&r()};return o.flush=()=>{t!==null&&(cancelAnimationFrame(t),t=null),n&&(e(...n),n=null)},o.cancel=()=>{n=null,t!==null&&(cancelAnimationFrame(t),t=null)},o},Ke=e=>1-Math.pow(1-e,4),Ge=(e,t,n)=>(t-e)*Ke(n)+e,Xs=({fromValues:e,toValues:t,onStep:n,duration:r=250,interpolateValue:o,onStart:s,onEnd:i,onCancel:a})=>{let l=!1,u=0,f;function T(L){if(l)return;f===void 0&&(f=L,s?.());let _=Math.min(L-f,r),v=Ke(_/r),S={};if(Object.keys(e).forEach(w=>{let M=w,$=(t[M]-e[M])*v+e[M];S[M]=$}),n(S),_<r){let w=_/r,M={};Object.keys(e).forEach($=>{let k=$,z=e[k],X=t[k],D;D=o?o(z,X,w,k):Ge(z,X,w),D==null&&(D=Ge(z,X,w)),M[k]=D}),n(M),u=window.requestAnimationFrame(T)}else n(t),i?.()}return u=window.requestAnimationFrame(T),()=>{a?.(),l=!0,window.cancelAnimationFrame(u)}},js=(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},qs=e=>{let t=window.getSelection();if(t){let n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}},Zs=()=>{let e=window.getSelection();e&&e.removeAllRanges()},Qs=(e,t)=>Math.abs(e-t),Js=e=>e==="selection"||e==="lasso",ea=(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},ta=()=>document.fullscreenElement?.nodeName==="HTML",na=()=>document.documentElement.requestFullscreen(),ra=()=>document.exitFullscreen(),oa=({clientX:e,clientY:t},{zoom:n,offsetLeft:r,offsetTop:o,scrollX:s,scrollY:i})=>{let a=(e-r)/n.value-s,l=(t-o)/n.value-i;return{x:a,y:l}},sa=({sceneX:e,sceneY:t},{zoom:n,offsetLeft:r,offsetTop:o,scrollX:s,scrollY:i})=>{let a=(e+s)*n.value+r,l=(t+i)*n.value+o;return{x:a,y:l}},aa=e=>getComputedStyle(document.documentElement).getPropertyValue(`--${e}`),on="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u2C00-\uFB1C\uFDFE-\uFE6F\uFEFD-\uFFFF",sn="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",an=new RegExp(`^[^${on}]*[${sn}]`),ia=e=>an.test(e),la=e=>{let[t,n]=e;return{x:t,y:n}},ca=e=>{if(e?.name==="AbortError"){console.warn(e);return}throw e},ua=(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},da=(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},pa=(e,t)=>{for(let n=0;n<e.length;n++){let r=t(e[n],n);if(r!=null)return r}},Oe=()=>{let e,t,n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n},fa=(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},ma=()=>document.querySelector('meta[name="version"]')?.content||ve,ha=()=>{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},Ea=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},Ta=e=>{let t=e.parentElement;for(;t;){if(t.tabIndex>-1){t.focus();return}t=t.parentElement}},ba=e=>{e.preventDefault(),e.returnValue=""},ga=e=>Array.from(e).map(t=>`0${t.toString(16)}`.slice(-2)).join(""),_a=()=>te()?1:Date.now(),xa=e=>e instanceof Map?e:e.reduce((t,n)=>(t.set(typeof n=="string"?n:n.id,n),t),new Map),Aa=e=>e.reduce((t,n,r)=>(t.set(n.id,[n,r]),t),new Map),ya=(e,t)=>e.reduce((n,r,o)=>(n[t?t(r):o]=r,n),{}),va=e=>e.reduce((t,n,r)=>{let o={...n,prev:null,next:null};if(r!==0){let s=t[r-1];if(o.prev=s,s.next=o,r===e.length-1){let i=t[0];o.next=i,i.prev=o}}return t.push(o),t},[]),ln=e=>Array.isArray(e)?e:e.values(),Sa=e=>Array.isArray(e)?e:Array.from(ln(e)),te=()=>h.MODE===B.TEST,Ma=()=>h.MODE===B.DEVELOPMENT,We=()=>h.MODE===B.PRODUCTION,Ra=()=>typeof process<"u"&&!0,Oa=(e,t)=>new CustomEvent(e,{detail:{nativeEvent:t},cancelable:!0}),La=(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},wa=e=>{let t=typeof e;return e==null||t!=="object"&&t!=="function"},cn=()=>{try{return window.self===window.top?"top":"iframe"}catch{return"iframe"}},Fa=()=>cn()==="iframe",Ia=e=>!!e&&typeof e=="object"&&"then"in e&&"catch"in e&&"finally"in e,Ca=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):[]},Be=(e,t)=>Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t,un=(e,t,n,r=!1)=>{let o=Object.keys(e),s=Object.keys(t);if(o.length!==s.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]||Be(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 a=n?.[i],l=a?a(e[i],t[i]):e[i]===t[i]||Be(e[i],t[i]);return!l&&r&&console.warn(`%cisShallowEqual: ${i} not equal ->`,"color: #8B4000",e[i],t[i]),l})},Pa=(e,t,{checkForDefaultPrevented:n=!0}={})=>function(o){if(e?.(o),!n||!o?.defaultPrevented)return t?.(o)},ka=(e,t,n)=>{if(!t)return e;if(n)return console.error(t),e;throw new Error(t)};function Da(e,t){if(!e)throw new Error(t)}var Ua=e=>{let t,n,r=function(o){let s=Object.entries(o);if(t){let a=!0;for(let[l,u]of s)if(t.get(l)!==u){a=!1;break}if(a)return n}let i=e(o);return t=new Map(s),n=i,i};return r.clear=()=>{t=void 0,n=void 0},r},Na=(e,t)=>e instanceof Set||e instanceof Map?e.has(t):"includes"in e?e.includes(t):e.hasOwnProperty(t),Ha=e=>JSON.parse(JSON.stringify(e)),Ga=(e,t)=>un(e,t)?e:t;function Ba(e,t,n,r){return e?(e?.addEventListener?.(t,n,r),()=>{e?.removeEventListener?.(t,n,r)}):()=>{}}function Ka(e,t=!0){let n=e.length;if(n<4)return"";let r=e[0],o=e[1],s=e[2],i=`M${r[0].toFixed(2)},${r[1].toFixed(2)} Q${o[0].toFixed(2)},${o[1].toFixed(2)} ${W(o[0],s[0]).toFixed(2)},${W(o[1],s[1]).toFixed(2)} T`;for(let a=2,l=n-1;a<l;a++)r=e[a],o=e[a+1],i+=`${W(r[0],o[0]).toFixed(2)},${W(r[1],o[1]).toFixed(2)} `;return t&&(i+="Z"),i}var Wa=e=>e.replace(/\r?\n|\r/g,`
|
|
4
|
-
`);function Va(e){return e}var Le=async(e,...t)=>new Promise(n=>{n(e(...t))}),Ya=(...e)=>Math.max(...e.map(t=>t?1:0))>0,$a=e=>{try{return JSON.parse(e)}catch{return null}},Ve=e=>e.replace(/"/g,"""),za=e=>Array.isArray(e)?e:[e],dn=e=>Array.isArray(e),pn=e=>dn(e)?e.length:e instanceof Map||e instanceof Set?e.size:Object.keys(e).length,Xa=(e,t)=>{if(pn(e)===0)return null;let n=t||(o=>o),r=null;for(let o of e){let s=n(o);if((r===null||r===s)&&s!=null)r=s;else return null}return r},Ye="excalidraw-feature-flags",ee={COMPLEX_BINDINGS:!1},O=null,ja=e=>{if(!O)try{let t=localStorage.getItem(Ye);t&&(O=JSON.parse(t)??ee)}catch{}return(O||ee)[e]},qa=(e,t)=>{try{O={...O||ee,[e]:t},localStorage.setItem(Ye,JSON.stringify(O))}catch(n){console.error("unable to set feature flag",n)}},Za=(e,t)=>t.includes(e);var $e=new C(Date.now()),ze=0,ri=()=>Math.floor($e.next()*2**31),oi=e=>{$e=new C(e),ze=0},si=()=>te()?`id${ze++}`:He();d();var je=se(Xe(),1);var An=e=>(e=e.trim(),e&&(0,je.sanitizeUrl)(Ve(e))),di=e=>!!(e?.includes(location.origin)||e?.startsWith("/")),pi=e=>{if(e=An(e),e.startsWith("/"))return`${location.origin}${e}`;try{new URL(e)}catch{return"about:blank"}return e};d();var Y=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=[]}};d();var qe=class{constructor(t){this.behavior=t}emitters=new Map;lastPayload=new Map;emittedOnce=new Set;getEmitter(t){let n=this.emitters.get(t);return n||(n=new Y,this.emitters.set(t,n)),n}toPromiseValue(t){return t.length===1?t[0]:t}on(t,n){let r=this.behavior[t],o=this.lastPayload.get(t);if(n)return r.replay==="last"&&o&&(queueMicrotask(()=>n(...o)),r.cardinality==="once")?()=>{}:this.getEmitter(t).on(n);if(r.cardinality!=="once"||r.replay!=="last")throw new Error(`Event "${String(t)}" requires a callback`);return o?Promise.resolve(this.toPromiseValue(o)):new Promise(s=>{this.getEmitter(t).once((...i)=>{s(this.toPromiseValue(i))})})}emit(t,...n){let r=this.behavior[t];if(!We()&&r.cardinality==="once"){if(this.emittedOnce.has(t))throw new Error(`Event "${String(t)}" can only be emitted once`);this.emittedOnce.add(t)}r.replay==="last"&&this.lastPayload.set(t,n);try{this.getEmitter(t).trigger(...n)}finally{r.cardinality==="once"&&this.getEmitter(t).clear()}}clear(){this.lastPayload.clear(),this.emittedOnce.clear();for(let t of this.emitters.values())t.clear();this.emitters.clear()}};d();var Ze=class{constructor(t,n=Object.is){this.isEqual=n;this.value=t}version=0;value;waiters=new Set;subscribers=new Set;getSnapshot(){return{version:this.version,value:this.value}}set(t){if(this.isEqual(this.value,t))return!1;this.value=t,this.version+=1;let n=this.getSnapshot();for(let r of this.subscribers)r(n);for(let r of this.waiters)r(n);return this.waiters.clear(),!0}update(t){return this.set(t(this.value))}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}pull(t=-1){return this.version!==t?Promise.resolve(this.getSnapshot()):new Promise(n=>{this.waiters.add(n)})}};d();var P=(e,t=5)=>parseFloat(e.toPrecision(t)),yn=e=>P(e.reduce((t,n)=>t+n)/e.length),ne=class e{static DEBUG_LOG_TIMES=!0;static TIMES_AGGR={};static TIMES_AVG={};static LAST_DEBUG_LOG_CALL=0;static DEBUG_LOG_INTERVAL_ID=null;static LAST_FRAME_TIMESTAMP=0;static FRAME_COUNT=0;static ANIMATION_FRAME_ID=null;static scheduleAnimationFrame=()=>{e.DEBUG_LOG_INTERVAL_ID!==null&&(e.ANIMATION_FRAME_ID=requestAnimationFrame(t=>{e.LAST_FRAME_TIMESTAMP!==t&&(e.LAST_FRAME_TIMESTAMP=t,e.FRAME_COUNT++),e.DEBUG_LOG_INTERVAL_ID!==null&&e.scheduleAnimationFrame()}))};static setupInterval=()=>{e.DEBUG_LOG_INTERVAL_ID===null&&(console.info("%c(starting perf recording)","color: lime"),e.DEBUG_LOG_INTERVAL_ID=window.setInterval(e.debugLogger,1e3),e.scheduleAnimationFrame()),e.LAST_DEBUG_LOG_CALL=Date.now()};static debugLogger=()=>{if(e.DEBUG_LOG_TIMES){for(let[t,{t:n,times:r}]of Object.entries(e.TIMES_AGGR))r.length&&(console.info(t,P(r.reduce((o,s)=>o+s)),r.sort((o,s)=>o-s).map(o=>P(o))),e.TIMES_AGGR[t]={t:n,times:[]});for(let[t,{t:n,times:r,avg:o}]of Object.entries(e.TIMES_AVG))if(r.length){let s=r.reduce((a,l)=>a+l),i=P(s/e.FRAME_COUNT);console.info(t,`- ${r.length} calls - ${i}ms/frame across ${e.FRAME_COUNT} frames (${P(i/16.67*100,1)}% of frame budget)`),e.TIMES_AVG[t]={t:n,times:[],avg:o!=null?yn([o,i]):i}}}e.FRAME_COUNT=0,Date.now()-e.LAST_DEBUG_LOG_CALL>600&&e.DEBUG_LOG_INTERVAL_ID!==null&&(console.info("%c(stopping perf recording)","color: red"),window.clearInterval(e.DEBUG_LOG_INTERVAL_ID),window.cancelAnimationFrame(e.ANIMATION_FRAME_ID),e.ANIMATION_FRAME_ID=null,e.FRAME_COUNT=0,e.LAST_FRAME_TIMESTAMP=0,e.DEBUG_LOG_INTERVAL_ID=null,e.TIMES_AGGR={},e.TIMES_AVG={})};static logTime=(t,n="default")=>{e.setupInterval();let r=performance.now(),{t:o,times:s}=e.TIMES_AGGR[n]=e.TIMES_AGGR[n]||{t:0,times:[]};o&&s.push(t??r-o),e.TIMES_AGGR[n].t=r};static logTimeAverage=(t,n="default")=>{e.setupInterval();let r=performance.now(),{t:o,times:s}=e.TIMES_AVG[n]=e.TIMES_AVG[n]||{t:0,times:[]};o&&s.push(t??r-o),e.TIMES_AVG[n].t=r};static logWrapper=t=>(n,r="default")=>(...o)=>{let s=performance.now(),i=n(...o);return e[t](performance.now()-s,r),i};static logTimeWrap=e.logWrapper("logTime");static logTimeAverageWrap=e.logWrapper("logTimeAverage");static perfWrap=(t,n="default")=>(...r)=>{console.time(n);let o=t(...r);return console.timeEnd(n),o};static CHANGED_CACHE={};static logChanged(t,n){let r=e.CHANGED_CACHE[t];if(e.CHANGED_CACHE[t]=n,!r)return;let o=new Set([...Object.keys(r),...Object.keys(n)]),s={};for(let i of o){let a=r[i],l=n[i];Qe(a,l)||(s[i]={prev:a,next:l})}Object.keys(s).length>0&&console.info(`[${t}] changed:`,s)}};function Qe(e,t){if(Object.is(e,t))return!0;if(e===null||t===null||typeof e!="object"||typeof t!="object"||Array.isArray(e)!==Array.isArray(t))return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let o of n)if(!Qe(e[o],t[o]))return!1;return!0}export{$r as ACTIVE_THRESHOLD,Fr as ALLOWED_PASTE_MIME_TYPES,er as APP_NAME,ao as ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO,so as ARROW_LABEL_WIDTH_FRACTION,So as ARROW_TYPE,qe as AppEventBus,Fo as BIND_MODE_TIMEOUT,oo as BOUND_TEXT_PADDING,ae as BinaryHeap,Or as CANVAS_ONLY_ACTIONS,To as CANVAS_SEARCH_TAB,_e as CJK_HAND_DRAWN_FALLBACK_FONT,mr as CLASSES,Pe as CODES,Nn as COLORS_PER_ROW,Mr as COLOR_CHARCOAL_BLACK,zn as COLOR_OUTLINE_CONTRAST_THRESHOLD,p as COLOR_PALETTE,Rr as COLOR_VOICE_CALL,Sr as COLOR_WHITE,ur as CURSOR_TYPE,Tr as DARK_THEME_FILTER,po as DEFAULT_ADAPTIVE_RADIUS,Kn as DEFAULT_CANVAS_BACKGROUND_PICKS,Hn as DEFAULT_CHART_COLOR_INDEX,vr as DEFAULT_COLLISION_THRESHOLD,G as DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX,Vn as DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE,Bn as DEFAULT_ELEMENT_BACKGROUND_PICKS,Eo as DEFAULT_ELEMENT_PROPS,H as DEFAULT_ELEMENT_STROKE_COLOR_INDEX,Wn as DEFAULT_ELEMENT_STROKE_COLOR_PALETTE,Gn as DEFAULT_ELEMENT_STROKE_PICKS,Yt as DEFAULT_ELEMENT_STROKE_WIDTH_KEY,Qr as DEFAULT_EXPORT_PADDING,Ao as DEFAULT_FILENAME,xr as DEFAULT_FONT_FAMILY,_r as DEFAULT_FONT_SIZE,Lr as DEFAULT_GRID_SIZE,wr as DEFAULT_GRID_STEP,Jr as DEFAULT_IMAGE_OPTIONS,cr as DEFAULT_LASER_COLOR,uo as DEFAULT_PROPORTIONAL_RADIUS,Mo as DEFAULT_REDUCED_GLOBAL_ALPHA,bo as DEFAULT_SIDEBAR,Co as DEFAULT_STROKE_STREAMLINE,Po as DEFAULT_STROKE_STREAMLINE_PRECISE,Ar as DEFAULT_TEXT_ALIGN,Ht as DEFAULT_TRANSFORM_HANDLE_SPACING,jr as DEFAULT_UI_OPTIONS,ve as DEFAULT_VERSION,yr as DEFAULT_VERTICAL_ALIGN,wo as DOUBLE_TAP_POSITION_THRESHOLD,nr as DRAGGING_THRESHOLD,ne as Debug,xo as EDITOR_LS_KEYS,Ro as ELEMENT_LINK_KEY,co as ELEMENT_READY_TO_ERASE_OPACITY,sr as ELEMENT_SHIFT_TRANSLATE_AMOUNT,ar as ELEMENT_TRANSLATE_AMOUNT,no as ENCRYPTION_KEY_BITS,B as ENV,Bt as EPSILON,Dt as EVENT,Cr as EXPORT_DATA_TYPES,Ir as EXPORT_IMAGE_TYPES,Zr as EXPORT_SCALES,Y as Emitter,b as FONT_FAMILY,Z as FONT_FAMILY_FALLBACKS,Ut as FONT_FAMILY_GENERIC_FALLBACKS,K as FONT_METADATA,hr as FONT_SIZES,br as FRAME_STYLE,Vt as FREEDRAW_STROKE_WIDTH,No as GOOGLE_FONTS_RANGES,Vr as HYPERLINK_TOOLTIP_DELAY,Yr as IDLE_THRESHOLD,Se as IMAGE_MIME_TYPES,kr as IMAGE_RENDER_TIMEOUT,R as KEYS,Jt as KeyCodeMap,go as LIBRARY_DISABLED_TYPES,$t as LIBRARY_SIDEBAR_TAB,or as LINE_CONFIRM_THRESHOLD,Lo as LINE_POLYGON_POINT_MERGE_DISTANCE,Ho as LOCAL_FONT_PROTOCOL,Un as MAX_CUSTOM_COLORS_USED_IN_CANVAS,qr as MAX_DECIMALS_FOR_SVG_EXPORT,Wr as MAX_ZOOM,ge as MIME_TYPES,rr as MINIMUM_ARROW_SIZE,gr as MIN_FONT_SIZE,vo as MIN_WIDTH_OR_HEIGHT,Kr as MIN_ZOOM,Io as MOBILE_ACTION_BUTTON_BG,Ae as MONOSPACE_GENERIC_FONT,jo as MQ_MAX_HEIGHT_LANDSCAPE,zo as MQ_MAX_MOBILE,Zo as MQ_MAX_TABLET,Xo as MQ_MAX_WIDTH_LANDSCAPE,qo as MQ_MIN_TABLET,Qo as MQ_MIN_WIDTH_DESKTOP,Jo as MQ_RIGHT_SIDEBAR_MIN_WIDTH,Oo as ORIG_ID,dr as POINTER_BUTTON,pr as POINTER_EVENTS,Ue as PromisePool,Re as Queue,Wt as ROUGHNESS,fo as ROUNDNESS,xe as SANS_SERIF_GENERIC_FONT,Gr as SCROLL_TIMEOUT,lr as SHIFT_LOCKING_ANGLE,Gt as SIDE_RESIZING_THRESHOLD,yo as STATS_PANELS,Kt as STRING_MIME_TYPES,Me as STROKE_WIDTH,mo as STROKE_WIDTH_KEYS,to as SVG_DOCUMENT_PREAMBLE,eo as SVG_NS,Dr as TAP_TWICE_TIMEOUT,lo as TEXT_ALIGN,tr as TEXT_AUTOWRAP_THRESHOLD,ir as TEXT_TO_CENTER_SNAP_THRESHOLD,Er as THEME,Nr as TITLE_TIMEOUT,_o as TOOL_TYPE,Ur as TOUCH_CTX_MENU_TIMEOUT,Xr as URL_HASH_KEYS,zr as URL_QUERY_KEYS,zt as UserIdleState,ro as VERSIONS,Hr as VERSION_TIMEOUT,io as VERTICAL_ALIGN,Ze as VersionedSnapshotStore,I as WINDOWS_EMOJI_FALLBACK_FONT,fr as YOUTUBE_STATES,Br as ZOOM_STEP,Ba as addEventListener,na as allowFullScreen,Dn as applyDarkModeFilter,va as arrayToList,xa as arrayToMap,Aa as arrayToMapWithIndex,ya as arrayToObject,ka as assertNever,ga as bytesToHexString,Gs as capitalizeString,za as castArray,js as chunk,Ha as cloneJSON,$n as colorToHex,Pa as composeEventHandlers,as as createUserAgentDescriptor,$s as debounce,ss as deriveStylesPanelMode,Qs as distance,Ke as easeOut,Xs as easeToValuesRAF,Ve as escapeDoubleQuotes,ra as exitFullScreen,ua as findIndex,da as findLastIndex,Ta as focusNearestParent,Yn as getAllColorsSpecificShade,Hs as getDateTime,Pr as getExportSource,ja as getFeatureFlag,ye as getFontFamilyFallbacks,rn as getFontFamilyString,Vs as getFontString,os as getFormFactor,cn as getFrame,Nt as getGenericFontFamilyFallback,aa as getGlobalCSSVariable,As as getGridPoint,Bo as getLineHeight,Ea as getNearestScrollableContainer,_s as getSizeFromPoints,ho as getStrokeWidthByKey,Ka as getSvgPathFromStroke,_a as getUpdatedTimestamp,ma as getVersion,Go as getVerticalOffset,Da as invariant,Ie as isAndroid,Ya as isAnyTrue,fs as isArrowKey,On as isBounds,rs as isBrave,Xt as isChrome,Xn as isColorDark,Fe as isDarwin,Ma as isDevEnv,ts as isFirefox,ta as isFullScreen,Ce as isIOS,nn as isInputLike,Ks as isInteractive,en as isLatinChar,di as isLocalLink,Na as isMemberOf,jt as isMobileBreakpoint,wa as isPrimitive,We as isProdEnv,Ia as isPromiseLike,ia as isRTL,dn as isReadonlyArray,Fa as isRunningInIframe,ns as isSafari,Js as isSelectionLikeTool,Ra as isServerEnv,un as isShallowEqual,qt as isTabletBreakpoint,te as isTestEnv,Bs as isToolIcon,be as isTransparent,es as isWindows,Ws as isWritableElement,is as loadDesktopUIModePreference,pa as mapFind,ps as matchKey,Ua as memoize,ca as muteFSAbortError,fa as nFormatter,Ys as nextAnimationFrame,Wa as normalizeEOL,jn as normalizeInputColor,An as normalizeLink,Za as oneOf,ba as preventUnload,Le as promiseTry,Ca as queryFocusableElements,si as randomId,ri as randomInteger,Xa as reduceToCommonValue,Zs as removeSelection,xs as rescalePoints,oi as reseed,Oe as resolvablePromise,Te as rgbToHex,$a as safelyParseJSON,sa as sceneCoordsToViewportCoords,qs as selectNode,Ns as setDateTimeForTests,ls as setDesktopUIMode,qa as setFeatureFlag,hs as shouldMaintainAspectRatio,ms as shouldResizeFromCenter,Es as shouldRotateWithDiscreteAngle,pn as sizeOf,ha as supportsEmoji,Jn as supportsResizeObserver,zs as throttleRAF,Sa as toArray,Va as toBrandedType,ln as toIterable,pi as toValidURL,la as tupleToCoors,ea as updateActiveTool,La as updateObject,Ga as updateStable,oa as viewportCoordsToSceneCoords,Oa as wrapEvent};
|
|
3
|
+
`,ro=128,oo={excalidraw:2,excalidrawLibrary:2},so=5,io=.7,ao=11,lo={TOP:"top",MIDDLE:"middle",BOTTOM:"bottom"},co={LEFT:"left",CENTER:"center",RIGHT:"right"},uo=20,po=70,fo=.25,ho=32,mo={LEGACY:1,PROPORTIONAL_RADIUS:2,ADAPTIVE_RADIUS:3},Ht={architect:0,artist:1,cartoonist:2},Eo=["thin","medium","bold"],ye={thin:1,medium:2,bold:4,extraBold:8},Gt={thin:.5,medium:1,bold:2,extraBold:4},To=(e,t)=>e==="freedraw"?Gt[t]:ye[t],Bt="medium",bo={strokeColor:d.black,backgroundColor:d.transparent,fillStyle:"solid",strokeWidth:ye[Bt],strokeStyle:"solid",roughness:Ht.artist,opacity:100,locked:!1},Kt="library",go="search",_o={name:"default",defaultTab:Kt},xo=new Set(["iframe","embeddable","image"]),Ao={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",autoshape:"autoshape",bucketfill:"bucketfill"},yo={OAI_API_KEY:"excalidraw-oai-api-key",MERMAID_TO_EXCALIDRAW:"mermaid-to-excalidraw",PUBLISH_LIBRARY:"publish-library-data"},vo="Untitled",So={generalStats:1,elementProperties:2},Mo=1,Ro={sharp:"sharp",round:"round",elbow:"elbow"},Oo=.3,Lo="element",wo=Symbol.for("__test__originalId__"),Wt=(r=>(r.ACTIVE="active",r.AWAY="away",r.IDLE="idle",r))(Wt||{}),Fo=20,Io=35,Co=700,Po={background:"var(--mobile-action-button-bg)"},Do=.5,ko=.2;p();var N={[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},[$.Xiaolai]:{metrics:{unitsPerEm:1e3,ascender:880,descender:-144,lineHeight:1.25},fallback:!0},[$["Segoe UI Emoji"]]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},local:!0,fallback:!0}},Go={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"},Bo="local:",Ko=(e,t,n)=>{let{unitsPerEm:r,ascender:o,descender:s}=N[e]?.metrics||N[T.Excalifont].metrics,a=t/r,i=(n-a*o+a*s)/2;return a*o+i},Wo=e=>{let{lineHeight:t}=N[e]?.metrics||N[T.Excalifont].metrics;return t};p();var ve=class{jobs=[];running=!1;tick(){if(this.running)return;let t=this.jobs.shift();t?(this.running=!0,t.promise.resolve(Me(t.jobFactory,...t.args).finally(()=>{this.running=!1,this.tick()}))):this.running=!1}push(t,...n){let r=Se();return this.jobs.push({jobFactory:t,promise:r,args:n}),this.tick(),r}};p();p();var Re="excalidraw.desktopUIMode",jo=599,qo=1e3,Zo=500,Qo=600,Jo=1180,es=1440,ts=1229,Oe=/Mac|iPod|iPhone|iPad/.test(navigator.platform),ns=/^Win/.test(navigator.platform),Le=/\b(android)\b/i.test(navigator.userAgent),rs=typeof window<"u"&&"netscape"in window&&navigator.userAgent.indexOf("rv:")>1&&navigator.userAgent.indexOf("Gecko")>1,Vt=navigator.userAgent.indexOf("Chrome")!==-1,os=!Vt&&navigator.userAgent.indexOf("Safari")!==-1,we=/iPad|iPhone/i.test(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document,ss=()=>navigator.brave?.isBrave?.name==="isBrave",Yt=(e,t)=>e<=599||t<500&&e<1e3,$t=(e,t)=>{let n=Math.min(e,t),r=Math.max(e,t);return n>=600&&r<=1180},zt=()=>{let e=navigator.userAgent||"",t=navigator.platform||"",n=navigator.userAgentData;if(n){let o=(n.platform||"").toLowerCase(),s=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(s)return!1}if(we)return!0;if(Le){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},is=(e,t)=>Yt(e,t)?"phone":$t(e,t)?"tablet":"desktop",as=e=>e.formFactor==="phone"?"mobile":e.formFactor==="tablet"?"compact":e.desktopUIMode,ls=e=>{let t=e??"",n="unknown";return we?n="ios":Le?n="android":t&&(n="other"),{isMobileDevice:zt(),platform:n}},cs=()=>{if(typeof window>"u")return null;try{let e=window.localStorage.getItem(Re);if(e==="compact"||e==="full")return e}catch{}return null},Xt=e=>{if(!(typeof window>"u"))try{window.localStorage.setItem(Re,e)}catch{}},us=e=>{if(!(e!=="compact"&&e!=="full"))return Xt(e),e};var Fe={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"},M={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:Oe?"metaKey":"ctrlKey",DELETE:"Delete",ENTER:"Enter",ESCAPE:"Escape",QUESTION_MARK:"?",SPACE:" ",TAB:"Tab",CHEVRON_LEFT:"<",CHEVRON_RIGHT:">",PERIOD:".",COMMA:",",SUBTRACT:"-",SLASH:"/",A:"a",B:"b",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"},jt=new Map([[M.Z,Fe.Z],[M.Y,Fe.Y]]),qt=e=>/^[a-z]$/.test(e.toLowerCase()),hs=(e,t)=>{if(t===e.key.toLowerCase())return!0;let n=jt.get(t);return!!(n&&!qt(e.key)&&e.code===n)},ms=e=>e===M.ARROW_LEFT||e===M.ARROW_RIGHT||e===M.ARROW_DOWN||e===M.ARROW_UP,Es=e=>e.altKey,Ts=e=>e.shiftKey,bs=e=>e.shiftKey;p();import{pointFrom as Ie,pointFromPair as Zt}from"@excalidraw/math";var As=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)}},ys=(e,t,n,r)=>{let o=n.map(y=>y[e]),s=Math.max(...o),a=Math.min(...o),i=s-a,l=i===0?1:t/i,u=1/0,m=n.map(y=>{let S=y[e]*l,I=[...y];return I[e]=S,S<u&&(u=S),I});if(!r||m.length===2)return m;let b=a-u;return m.map(y=>Zt(y.map((S,I)=>I===e?S+b:S)))},vs=(e,t,n)=>n?Ie(Math.round(e/n)*n,Math.round(t/n)*n):Ie(e,t);p();var ke=te(Pe(),1),De=class{pool;entries={};constructor(t,n){this.pool=new ke.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)))}};p();p();p();var Ue=(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),"");p();var w=class{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}};p();import{average as H}from"@excalidraw/math";var X=null,Gs=e=>{X=e},Bs=()=>{if(X)return X;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"),s=`${e.getMinutes()}`.padStart(2,"0");return`${t}-${n}-${r}-${o}${s}`},Ks=e=>e.charAt(0).toUpperCase()+e.slice(1),G=e=>e?.ownerDocument?.defaultView??(typeof window>"u"?null:window),Ws=e=>{let t=G(e);return!!t&&e instanceof t.HTMLElement&&e.className.includes("ToolIcon")},Qt=e=>{let t=G(e);return!!t&&(e instanceof t.HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof t.HTMLBRElement||e instanceof t.HTMLInputElement||e instanceof t.HTMLTextAreaElement||e instanceof t.HTMLSelectElement)},Vs=e=>{let t=G(e);return Qt(e)||!!t&&e instanceof t.Element&&!!e.closest("label, button")},Ys=e=>{let t=G(e);return!!t&&(e instanceof t.HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof t.HTMLBRElement||e instanceof t.HTMLTextAreaElement||e instanceof t.HTMLInputElement&&(e.type==="text"||e.type==="number"||e.type==="password"||e.type==="search")||e instanceof t.HTMLElement&&e.closest(".cm-editor")!==null)},Jt=({fontFamily:e})=>{for(let[t,n]of Object.entries(T))if(n===e)return`${t}${_e(n).map(r=>`, ${r}`).join("")}`;return L},$s=({fontSize:e,fontFamily:t})=>`${e}px ${Jt({fontFamily:t})}`,zs=async e=>{requestAnimationFrame(()=>requestAnimationFrame(e))},Xs=(e,t)=>{let n=0,r=null,o=(...s)=>{r=s,clearTimeout(n),n=window.setTimeout(()=>{r=null,e(...s)},t)};return o.flush=()=>{if(clearTimeout(n),r){let s=r;r=null,e(...s)}},o.cancel=()=>{r=null,clearTimeout(n)},o},js=e=>{let t=null,n=null,r=()=>{t=window.requestAnimationFrame(()=>{t=null;let s=n;n=null,s&&e(...s)})},o=(...s)=>{n=s,t===null&&r()};return o.flush=()=>{t!==null&&(cancelAnimationFrame(t),t=null),n&&(e(...n),n=null)},o.cancel=()=>{n=null,t!==null&&(cancelAnimationFrame(t),t=null)},o},qs=e=>1-Math.pow(1-e,4),Zs=(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},Qs=e=>{let t=window.getSelection();if(t){let n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}},Js=()=>{let e=window.getSelection();e&&e.removeAllRanges()},ei=(e,t)=>Math.abs(e-t),ti=e=>e==="selection"||e==="lasso",ni=(e,t)=>t.type==="custom"?{...e.activeTool,type:"custom",customType:t.customType,locked:t.locked??e.activeTool.locked}:{...e.activeTool,lastActiveTool:t.lastActiveTool===void 0?e.activeTool.lastActiveTool:t.lastActiveTool,type:t.type,customType:null,locked:t.locked??e.activeTool.locked,fromSelection:t.fromSelection??!1},ri=()=>document.fullscreenElement?.nodeName==="HTML",oi=()=>document.documentElement.requestFullscreen(),si=()=>document.exitFullscreen(),ii=({clientX:e,clientY:t},{zoom:n,offsetLeft:r,offsetTop:o,scrollX:s,scrollY:a})=>{let i=(e-r)/n.value-s,l=(t-o)/n.value-a;return{x:i,y:l}},ai=({sceneX:e,sceneY:t},{zoom:n,offsetLeft:r,offsetTop:o,scrollX:s,scrollY:a})=>{let i=(e+s)*n.value+r,l=(t+a)*n.value+o;return{x:i,y:l}},li=e=>getComputedStyle(document.documentElement).getPropertyValue(`--${e}`),en="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u2C00-\uFB1C\uFDFE-\uFE6F\uFEFD-\uFFFF",tn="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",nn=new RegExp(`^[^${en}]*[${tn}]`),ci=e=>nn.test(e),ui=e=>{let[t,n]=e;return{x:t,y:n}},pi=e=>{if(e?.name==="AbortError"){console.warn(e);return}throw e},di=(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},fi=(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},hi=(e,t)=>{for(let n=0;n<e.length;n++){let r=t(e[n],n);if(r!=null)return r}},Se=()=>{let e,t,n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n},mi=(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},Ei=()=>document.querySelector('meta[name="version"]')?.content||xe,Ti=()=>{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},bi=e=>{let t=e.ownerDocument,n=t.defaultView??window,r=e.parentElement;for(;r;){if(r===t.body)return t;let{overflowY:o}=n.getComputedStyle(r);if(r.scrollHeight>r.clientHeight&&(o==="auto"||o==="scroll"||o==="overlay"))return r;r=r.parentElement}return t},gi=e=>{let t=e.parentElement;for(;t;){if(t.tabIndex>-1){t.focus();return}t=t.parentElement}},_i=e=>{e.preventDefault(),e.returnValue=""},xi=e=>Array.from(e).map(t=>`0${t.toString(16)}`.slice(-2)).join(""),Ai=()=>q()?1:Date.now(),yi=e=>e instanceof Map?e:e.reduce((t,n)=>(t.set(typeof n=="string"?n:n.id,n),t),new Map),vi=e=>e.reduce((t,n,r)=>(t.set(n.id,[n,r]),t),new Map),Si=(e,t)=>e.reduce((n,r,o)=>(n[t?t(r):o]=r,n),{}),Mi=e=>e.reduce((t,n,r)=>{let o={...n,prev:null,next:null};if(r!==0){let s=t[r-1];if(o.prev=s,s.next=o,r===e.length-1){let a=t[0];o.next=a,a.prev=o}}return t.push(o),t},[]),rn=e=>Array.isArray(e)?e:e.values(),Ri=e=>Array.isArray(e)?e:Array.from(rn(e)),q=()=>h.MODE===U.TEST,Oi=()=>h.MODE===U.DEVELOPMENT,He=()=>h.MODE===U.PRODUCTION,Li=()=>typeof process<"u"&&!0,wi=(e,t)=>new CustomEvent(e,{detail:{nativeEvent:t},cancelable:!0}),Fi=(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},Ii=e=>{let t=typeof e;return e==null||t!=="object"&&t!=="function"},on=()=>{try{return window.self===window.top?"top":"iframe"}catch{return"iframe"}},Ci=()=>on()==="iframe",Pi=e=>!!e&&typeof e=="object"&&"then"in e&&"catch"in e&&"finally"in e,Di=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):[]},Ne=(e,t)=>Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t,sn=(e,t,n,r=!1)=>{let o=Object.keys(e),s=Object.keys(t);if(o.length!==s.length)return r&&console.warn("%cisShallowEqual: objects don't have same properties ->","color: #8B4000",e,t),!1;if(n&&Array.isArray(n)){for(let a of n)if(!(e[a]===t[a]||Ne(e[a],t[a])))return r&&console.warn(`%cisShallowEqual: ${a} not equal ->`,"color: #8B4000",e[a],t[a]),!1;return!0}return o.every(a=>{let i=n?.[a],l=i?i(e[a],t[a]):e[a]===t[a]||Ne(e[a],t[a]);return!l&&r&&console.warn(`%cisShallowEqual: ${a} not equal ->`,"color: #8B4000",e[a],t[a]),l})},ki=(e,t,{checkForDefaultPrevented:n=!0}={})=>function(o){if(e?.(o),!n||!o?.defaultPrevented)return t?.(o)},Ui=(e,t,n)=>{if(!t)return e;if(n)return console.error(t),e;throw new Error(t)};function Ni(e,t){if(!e)throw new Error(t)}var Hi=e=>{let t,n,r=function(o){let s=Object.entries(o);if(t){let i=!0;for(let[l,u]of s)if(t.get(l)!==u){i=!1;break}if(i)return n}let a=e(o);return t=new Map(s),n=a,a};return r.clear=()=>{t=void 0,n=void 0},r},Gi=(e,t)=>e instanceof Set||e instanceof Map?e.has(t):"includes"in e?e.includes(t):e.hasOwnProperty(t),Bi=e=>JSON.parse(JSON.stringify(e)),Ki=(e,t)=>sn(e,t)?e:t;function Wi(e,t,n,r){return e?(e?.addEventListener?.(t,n,r),()=>{e?.removeEventListener?.(t,n,r)}):()=>{}}function Vi(e,t=!0){let n=e.length;if(n<4)return"";let r=e[0],o=e[1],s=e[2],a=`M${r[0].toFixed(2)},${r[1].toFixed(2)} Q${o[0].toFixed(2)},${o[1].toFixed(2)} ${H(o[0],s[0]).toFixed(2)},${H(o[1],s[1]).toFixed(2)} T`;for(let i=2,l=n-1;i<l;i++)r=e[i],o=e[i+1],a+=`${H(r[0],o[0]).toFixed(2)},${H(r[1],o[1]).toFixed(2)} `;return t&&(a+="Z"),a}var Yi=e=>e.replace(/\r?\n|\r/g,`
|
|
4
|
+
`);function $i(e){return e}var Me=async(e,...t)=>new Promise(n=>{n(e(...t))}),zi=(...e)=>Math.max(...e.map(t=>t?1:0))>0,Xi=e=>{try{return JSON.parse(e)}catch{return null}},Ge=e=>e.replace(/"/g,"""),ji=e=>Array.isArray(e)?e:[e],an=e=>Array.isArray(e),ln=e=>an(e)?e.length:e instanceof Map||e instanceof Set?e.size:Object.keys(e).length,qi=(e,t)=>{if(ln(e)===0)return null;let n=t||(o=>o),r=null;for(let o of e){let s=n(o);if((r===null||r===s)&&s!=null)r=s;else return null}return r},Be="excalidraw-feature-flags",j={COMPLEX_BINDINGS:!1},R=null,Zi=e=>{if(!R)try{let t=localStorage.getItem(Be);t&&(R=JSON.parse(t)??j)}catch{}return(R||j)[e]},Qi=(e,t)=>{try{R={...R||j,[e]:t},localStorage.setItem(Be,JSON.stringify(R))}catch(n){console.error("unable to set feature flag",n)}},Ji=(e,t)=>t.includes(e);var Ke=new w(Date.now()),We=0,sa=()=>Math.floor(Ke.next()*2**31),ia=e=>{Ke=new w(e),We=0},aa=()=>q()?`id${We++}`:Ue();p();var Ye=te(Ve(),1);var bn=e=>(e=e.trim(),e&&(0,Ye.sanitizeUrl)(Ge(e))),fa=e=>!!(e?.includes(location.origin)||e?.startsWith("/")),ha=e=>{if(e=bn(e),e.startsWith("/"))return`${location.origin}${e}`;try{new URL(e)}catch{return"about:blank"}return e};p();var K=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=[]}};p();var $e=class{constructor(t){this.behavior=t}emitters=new Map;lastPayload=new Map;emittedOnce=new Set;getEmitter(t){let n=this.emitters.get(t);return n||(n=new K,this.emitters.set(t,n)),n}toPromiseValue(t){return t.length===1?t[0]:t}on(t,n){let r=this.behavior[t],o=this.lastPayload.get(t);if(n)return r.replay==="last"&&o&&(queueMicrotask(()=>n(...o)),r.cardinality==="once")?()=>{}:this.getEmitter(t).on(n);if(r.cardinality!=="once"||r.replay!=="last")throw new Error(`Event "${String(t)}" requires a callback`);return o?Promise.resolve(this.toPromiseValue(o)):new Promise(s=>{this.getEmitter(t).once((...a)=>{s(this.toPromiseValue(a))})})}emit(t,...n){let r=this.behavior[t];if(!He()&&r.cardinality==="once"){if(this.emittedOnce.has(t))throw new Error(`Event "${String(t)}" can only be emitted once`);this.emittedOnce.add(t)}r.replay==="last"&&this.lastPayload.set(t,n);try{this.getEmitter(t).trigger(...n)}finally{r.cardinality==="once"&&this.getEmitter(t).clear()}}clear(){this.lastPayload.clear(),this.emittedOnce.clear();for(let t of this.emitters.values())t.clear();this.emitters.clear()}};p();var ze=class{constructor(t,n=Object.is){this.isEqual=n;this.value=t}version=0;value;waiters=new Set;subscribers=new Set;getSnapshot(){return{version:this.version,value:this.value}}set(t){if(this.isEqual(this.value,t))return!1;this.value=t,this.version+=1;let n=this.getSnapshot();for(let r of this.subscribers)r(n);for(let r of this.waiters)r(n);return this.waiters.clear(),!0}update(t){return this.set(t(this.value))}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}pull(t=-1){return this.version!==t?Promise.resolve(this.getSnapshot()):new Promise(n=>{this.waiters.add(n)})}};p();var F=(e,t=5)=>parseFloat(e.toPrecision(t)),gn=e=>F(e.reduce((t,n)=>t+n)/e.length),Z=class e{static DEBUG_LOG_TIMES=!0;static TIMES_AGGR={};static TIMES_AVG={};static LAST_DEBUG_LOG_CALL=0;static DEBUG_LOG_INTERVAL_ID=null;static LAST_FRAME_TIMESTAMP=0;static FRAME_COUNT=0;static ANIMATION_FRAME_ID=null;static scheduleAnimationFrame=()=>{e.DEBUG_LOG_INTERVAL_ID!==null&&(e.ANIMATION_FRAME_ID=requestAnimationFrame(t=>{e.LAST_FRAME_TIMESTAMP!==t&&(e.LAST_FRAME_TIMESTAMP=t,e.FRAME_COUNT++),e.DEBUG_LOG_INTERVAL_ID!==null&&e.scheduleAnimationFrame()}))};static setupInterval=()=>{e.DEBUG_LOG_INTERVAL_ID===null&&(console.info("%c(starting perf recording)","color: lime"),e.DEBUG_LOG_INTERVAL_ID=window.setInterval(e.debugLogger,1e3),e.scheduleAnimationFrame()),e.LAST_DEBUG_LOG_CALL=Date.now()};static debugLogger=()=>{if(e.DEBUG_LOG_TIMES){for(let[t,{t:n,times:r}]of Object.entries(e.TIMES_AGGR))r.length&&(console.info(t,F(r.reduce((o,s)=>o+s)),r.sort((o,s)=>o-s).map(o=>F(o))),e.TIMES_AGGR[t]={t:n,times:[]});for(let[t,{t:n,times:r,avg:o}]of Object.entries(e.TIMES_AVG))if(r.length){let s=r.reduce((i,l)=>i+l),a=F(s/e.FRAME_COUNT);console.info(t,`- ${r.length} calls - ${a}ms/frame across ${e.FRAME_COUNT} frames (${F(a/16.67*100,1)}% of frame budget)`),e.TIMES_AVG[t]={t:n,times:[],avg:o!=null?gn([o,a]):a}}}e.FRAME_COUNT=0,Date.now()-e.LAST_DEBUG_LOG_CALL>600&&e.DEBUG_LOG_INTERVAL_ID!==null&&(console.info("%c(stopping perf recording)","color: red"),window.clearInterval(e.DEBUG_LOG_INTERVAL_ID),window.cancelAnimationFrame(e.ANIMATION_FRAME_ID),e.ANIMATION_FRAME_ID=null,e.FRAME_COUNT=0,e.LAST_FRAME_TIMESTAMP=0,e.DEBUG_LOG_INTERVAL_ID=null,e.TIMES_AGGR={},e.TIMES_AVG={})};static logTime=(t,n="default")=>{e.setupInterval();let r=performance.now(),{t:o,times:s}=e.TIMES_AGGR[n]=e.TIMES_AGGR[n]||{t:0,times:[]};o&&s.push(t??r-o),e.TIMES_AGGR[n].t=r};static logTimeAverage=(t,n="default")=>{e.setupInterval();let r=performance.now(),{t:o,times:s}=e.TIMES_AVG[n]=e.TIMES_AVG[n]||{t:0,times:[]};o&&s.push(t??r-o),e.TIMES_AVG[n].t=r};static logWrapper=t=>(n,r="default")=>(...o)=>{let s=performance.now(),a=n(...o);return e[t](performance.now()-s,r),a};static logTimeWrap=e.logWrapper("logTime");static logTimeAverageWrap=e.logWrapper("logTimeAverage");static perfWrap=(t,n="default")=>(...r)=>{console.time(n);let o=t(...r);return console.timeEnd(n),o};static CHANGED_CACHE={};static logChanged(t,n){let r=e.CHANGED_CACHE[t];if(e.CHANGED_CACHE[t]=n,!r)return;let o=new Set([...Object.keys(r),...Object.keys(n)]),s={};for(let a of o){let i=r[a],l=n[a];Xe(i,l)||(s[a]={prev:i,next:l})}Object.keys(s).length>0&&console.info(`[${t}] changed:`,s)}};function Xe(e,t){if(Object.is(e,t))return!0;if(e===null||t===null||typeof e!="object"||typeof t!="object"||Array.isArray(e)!==Array.isArray(t))return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let o of n)if(!Xe(e[o],t[o]))return!1;return!0}export{zr as ACTIVE_THRESHOLD,Ir as ALLOWED_PASTE_MIME_TYPES,tr as APP_NAME,ao as ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO,io as ARROW_LABEL_WIDTH_FRACTION,Ro as ARROW_TYPE,$e as AppEventBus,Co as BIND_MODE_TIMEOUT,so as BOUND_TEXT_PADDING,Gn as BUCKET_FILL_BACKGROUND_PICKS,ne as BinaryHeap,Lr as CANVAS_ONLY_ACTIONS,go as CANVAS_SEARCH_TAB,Te as CJK_HAND_DRAWN_FALLBACK_FONT,mr as CLASSES,Fe as CODES,Dn as COLORS_PER_ROW,Rr as COLOR_CHARCOAL_BLACK,Xn as COLOR_OUTLINE_CONTRAST_THRESHOLD,d as COLOR_PALETTE,Un as COLOR_TOP_PICKS_SLOTS,Or as COLOR_VOICE_CALL,Mr as COLOR_WHITE,pr as CURSOR_TYPE,br as DARK_THEME_FILTER,ho as DEFAULT_ADAPTIVE_RADIUS,Bn as DEFAULT_CANVAS_BACKGROUND_PICKS,kn as DEFAULT_CHART_COLOR_INDEX,Sr as DEFAULT_COLLISION_THRESHOLD,v as DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX,Wn as DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE,Hn as DEFAULT_ELEMENT_BACKGROUND_PICKS,bo as DEFAULT_ELEMENT_PROPS,D as DEFAULT_ELEMENT_STROKE_COLOR_INDEX,Kn as DEFAULT_ELEMENT_STROKE_COLOR_PALETTE,Nn as DEFAULT_ELEMENT_STROKE_PICKS,Bt as DEFAULT_ELEMENT_STROKE_WIDTH_KEY,Jr as DEFAULT_EXPORT_PADDING,vo as DEFAULT_FILENAME,Ar as DEFAULT_FONT_FAMILY,xr as DEFAULT_FONT_SIZE,wr as DEFAULT_GRID_SIZE,Fr as DEFAULT_GRID_STEP,eo as DEFAULT_IMAGE_OPTIONS,ur as DEFAULT_LASER_COLOR,fo as DEFAULT_PROPORTIONAL_RADIUS,Oo as DEFAULT_REDUCED_GLOBAL_ALPHA,_o as DEFAULT_SIDEBAR,Do as DEFAULT_STROKE_STREAMLINE,ko as DEFAULT_STROKE_STREAMLINE_PRECISE,yr as DEFAULT_TEXT_ALIGN,Dt as DEFAULT_TRANSFORM_HANDLE_SPACING,qr as DEFAULT_UI_OPTIONS,xe as DEFAULT_VERSION,vr as DEFAULT_VERTICAL_ALIGN,Io as DOUBLE_TAP_POSITION_THRESHOLD,rr as DRAGGING_THRESHOLD,Z as Debug,yo as EDITOR_LS_KEYS,Lo as ELEMENT_LINK_KEY,po as ELEMENT_PENDING_DRAW_SHAPE_OPACITY,uo as ELEMENT_READY_TO_ERASE_OPACITY,ir as ELEMENT_SHIFT_TRANSLATE_AMOUNT,ar as ELEMENT_TRANSLATE_AMOUNT,ro as ENCRYPTION_KEY_BITS,U as ENV,Ut as EPSILON,It as EVENT,Pr as EXPORT_DATA_TYPES,Cr as EXPORT_IMAGE_TYPES,Qr as EXPORT_SCALES,K as Emitter,T as FONT_FAMILY,$ as FONT_FAMILY_FALLBACKS,Ct as FONT_FAMILY_GENERIC_FALLBACKS,N as FONT_METADATA,Er as FONT_SIZES,gr as FRAME_STYLE,Gt as FREEDRAW_STROKE_WIDTH,Go as GOOGLE_FONTS_RANGES,Yr as HYPERLINK_TOOLTIP_DELAY,$r as IDLE_THRESHOLD,Ae as IMAGE_MIME_TYPES,kr as IMAGE_RENDER_TIMEOUT,M as KEYS,jt as KeyCodeMap,xo as LIBRARY_DISABLED_TYPES,Kt as LIBRARY_SIDEBAR_TAB,sr as LINE_CONFIRM_THRESHOLD,Fo as LINE_POLYGON_POINT_MERGE_DISTANCE,Bo as LOCAL_FONT_PROTOCOL,Pn as MAX_CUSTOM_COLORS_USED_IN_CANVAS,Zr as MAX_DECIMALS_FOR_SVG_EXPORT,Vr as MAX_ZOOM,Ee as MIME_TYPES,or as MINIMUM_ARROW_SIZE,_r as MIN_FONT_SIZE,Mo as MIN_WIDTH_OR_HEIGHT,Wr as MIN_ZOOM,Po as MOBILE_ACTION_BUTTON_BG,ge as MONOSPACE_GENERIC_FONT,Zo as MQ_MAX_HEIGHT_LANDSCAPE,jo as MQ_MAX_MOBILE,Jo as MQ_MAX_TABLET,qo as MQ_MAX_WIDTH_LANDSCAPE,Qo as MQ_MIN_TABLET,es as MQ_MIN_WIDTH_DESKTOP,ts as MQ_RIGHT_SIDEBAR_MIN_WIDTH,wo as ORIG_ID,dr as POINTER_BUTTON,fr as POINTER_EVENTS,De as PromisePool,ve as Queue,Ht as ROUGHNESS,mo as ROUNDNESS,be as SANS_SERIF_GENERIC_FONT,Br as SCROLL_TIMEOUT,cr as SHIFT_LOCKING_ANGLE,kt as SIDE_RESIZING_THRESHOLD,So as STATS_PANELS,Nt as STRING_MIME_TYPES,ye as STROKE_WIDTH,Eo as STROKE_WIDTH_KEYS,no as SVG_DOCUMENT_PREAMBLE,to as SVG_NS,Ur as TAP_TWICE_TIMEOUT,co as TEXT_ALIGN,nr as TEXT_AUTOWRAP_THRESHOLD,lr as TEXT_TO_CENTER_SNAP_THRESHOLD,Tr as THEME,Hr as TITLE_TIMEOUT,Ao as TOOL_TYPE,Nr as TOUCH_CTX_MENU_TIMEOUT,jr as URL_HASH_KEYS,Xr as URL_QUERY_KEYS,Wt as UserIdleState,oo as VERSIONS,Gr as VERSION_TIMEOUT,lo as VERTICAL_ALIGN,ze as VersionedSnapshotStore,L as WINDOWS_EMOJI_FALLBACK_FONT,hr as YOUTUBE_STATES,Kr as ZOOM_STEP,Wi as addEventListener,oi as allowFullScreen,In as applyDarkModeFilter,Mi as arrayToList,yi as arrayToMap,vi as arrayToMapWithIndex,Si as arrayToObject,Ui as assertNever,xi as bytesToHexString,Ks as capitalizeString,ji as castArray,Zs as chunk,Bi as cloneJSON,$n as colorToHex,ki as composeEventHandlers,ls as createUserAgentDescriptor,Xs as debounce,as as deriveStylesPanelMode,ei as distance,qs as easeOut,Ge as escapeDoubleQuotes,si as exitFullScreen,di as findIndex,fi as findLastIndex,gi as focusNearestParent,Vn as getAllColorsSpecificShade,Bs as getDateTime,Dr as getExportSource,Zi as getFeatureFlag,_e as getFontFamilyFallbacks,Jt as getFontFamilyString,$s as getFontString,is as getFormFactor,on as getFrame,Pt as getGenericFontFamilyFallback,li as getGlobalCSSVariable,vs as getGridPoint,Wo as getLineHeight,bi as getNearestScrollableContainer,As as getSizeFromPoints,To as getStrokeWidthByKey,Vi as getSvgPathFromStroke,Ai as getUpdatedTimestamp,Ei as getVersion,Ko as getVerticalOffset,Ni as invariant,Le as isAndroid,zi as isAnyTrue,ms as isArrowKey,vn as isBounds,ss as isBrave,Vt as isChrome,jn as isColorDark,Oe as isDarwin,Oi as isDevEnv,rs as isFirefox,ri as isFullScreen,we as isIOS,Qt as isInputLike,Vs as isInteractive,qt as isLatinChar,fa as isLocalLink,Gi as isMemberOf,Yt as isMobileBreakpoint,zn as isOpaqueColor,Ii as isPrimitive,He as isProdEnv,Pi as isPromiseLike,ci as isRTL,an as isReadonlyArray,Ci as isRunningInIframe,os as isSafari,ti as isSelectionLikeTool,Li as isServerEnv,sn as isShallowEqual,$t as isTabletBreakpoint,q as isTestEnv,Ws as isToolIcon,me as isTransparent,ns as isWindows,Ys as isWritableElement,cs as loadDesktopUIModePreference,hi as mapFind,hs as matchKey,Hi as memoize,pi as muteFSAbortError,mi as nFormatter,zs as nextAnimationFrame,Yi as normalizeEOL,qn as normalizeInputColor,bn as normalizeLink,Ji as oneOf,_i as preventUnload,Me as promiseTry,Di as queryFocusableElements,aa as randomId,sa as randomInteger,qi as reduceToCommonValue,Cn as removeDarkModeFilter,Js as removeSelection,ys as rescalePoints,ia as reseed,Se as resolvablePromise,k as rgbToHex,Xi as safelyParseJSON,ai as sceneCoordsToViewportCoords,Qs as selectNode,Yn as setColorAlpha,Gs as setDateTimeForTests,us as setDesktopUIMode,Qi as setFeatureFlag,Ts as shouldMaintainAspectRatio,Es as shouldResizeFromCenter,bs as shouldRotateWithDiscreteAngle,ln as sizeOf,Ti as supportsEmoji,er as supportsResizeObserver,js as throttleRAF,Ri as toArray,$i as toBrandedType,rn as toIterable,ha as toValidURL,ui as tupleToCoors,ni as updateActiveTool,Fi as updateObject,Ki as updateStable,ii as viewportCoordsToSceneCoords,wi as wrapEvent};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const applyDarkModeFilter: (color: string, enable?: boolean) => string;
|
|
2
|
+
export declare const removeDarkModeFilter: (color: string) => string;
|
|
2
3
|
export type ColorTuple = readonly [string, string, string, string, string];
|
|
3
4
|
export type ColorPaletteCustom = {
|
|
4
5
|
[key: string]: ColorTuple | string;
|
|
@@ -28,8 +29,13 @@ export declare const COLOR_PALETTE: {
|
|
|
28
29
|
};
|
|
29
30
|
export type ColorPalette = typeof COLOR_PALETTE;
|
|
30
31
|
export type ColorPickerColor = keyof typeof COLOR_PALETTE;
|
|
32
|
+
/** number of slots in the color-picker top-picks strip — the strip layout is
|
|
33
|
+
* sized for exactly this many swatches, and pick customization (replace /
|
|
34
|
+
* reorder) preserves it */
|
|
35
|
+
export declare const COLOR_TOP_PICKS_SLOTS = 5;
|
|
31
36
|
export declare const DEFAULT_ELEMENT_STROKE_PICKS: ColorTuple;
|
|
32
37
|
export declare const DEFAULT_ELEMENT_BACKGROUND_PICKS: ColorTuple;
|
|
38
|
+
export declare const BUCKET_FILL_BACKGROUND_PICKS: ColorTuple;
|
|
33
39
|
export declare const DEFAULT_CANVAS_BACKGROUND_PICKS: ColorTuple;
|
|
34
40
|
export declare const DEFAULT_ELEMENT_STROKE_COLOR_PALETTE: {
|
|
35
41
|
readonly cyan: readonly ["#e3fafc", "#99e9f2", "#3bc9db", "#15aabf", "#0c8599"];
|
|
@@ -67,12 +73,25 @@ export declare const DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE: {
|
|
|
67
73
|
};
|
|
68
74
|
export declare const getAllColorsSpecificShade: (index: 0 | 1 | 2 | 3 | 4) => ("#fff5f5" | "#ffc9c9" | "#ff8787" | "#fa5252" | "#e03131" | "#fff0f6" | "#fcc2d7" | "#f783ac" | "#e64980" | "#c2255c" | "#f8f0fc" | "#eebefa" | "#da77f2" | "#be4bdb" | "#9c36b5" | "#f3f0ff" | "#d0bfff" | "#9775fa" | "#7950f2" | "#6741d9" | "#e7f5ff" | "#a5d8ff" | "#4dabf7" | "#228be6" | "#1971c2" | "#e3fafc" | "#99e9f2" | "#3bc9db" | "#15aabf" | "#0c8599" | "#e6fcf5" | "#96f2d7" | "#38d9a9" | "#12b886" | "#099268" | "#ebfbee" | "#b2f2bb" | "#69db7c" | "#40c057" | "#2f9e44" | "#fff9db" | "#ffec99" | "#ffd43b" | "#fab005" | "#f08c00" | "#fff4e6" | "#ffd8a8" | "#ffa94d" | "#fd7e14" | "#e8590c")[];
|
|
69
75
|
export declare const rgbToHex: (r: number, g: number, b: number, a?: number) => string;
|
|
76
|
+
/**
|
|
77
|
+
* @returns the color with its alpha replaced by `alpha` (as #RRGGBBAA), or the
|
|
78
|
+
* input unchanged if it's not a valid color
|
|
79
|
+
*/
|
|
80
|
+
export declare const setColorAlpha: (color: string, alpha: number) => string;
|
|
70
81
|
/**
|
|
71
82
|
* @returns #RRGGBB or #RRGGBBAA based on color containing non-opaque alpha,
|
|
72
83
|
* null if not valid color
|
|
73
84
|
*/
|
|
74
85
|
export declare const colorToHex: (color: string) => string | null;
|
|
75
86
|
export declare const isTransparent: (color: string) => boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Whether the color is fully opaque (alpha exactly 1).
|
|
89
|
+
*
|
|
90
|
+
* NOT the negation of `isTransparent`, which is true only at alpha 0 — a
|
|
91
|
+
* partial-alpha color (`#RRGGBBAA`, `rgba(…, 0.5)`) is neither transparent
|
|
92
|
+
* (it renders) nor opaque (what's beneath shows through it).
|
|
93
|
+
*/
|
|
94
|
+
export declare const isOpaqueColor: (color: string) => boolean;
|
|
76
95
|
export declare const COLOR_OUTLINE_CONTRAST_THRESHOLD = 240;
|
|
77
96
|
export declare const isColorDark: (color: string, threshold?: number) => boolean;
|
|
78
97
|
/**
|
|
@@ -262,6 +262,7 @@ export declare const TEXT_ALIGN: {
|
|
|
262
262
|
RIGHT: string;
|
|
263
263
|
};
|
|
264
264
|
export declare const ELEMENT_READY_TO_ERASE_OPACITY = 20;
|
|
265
|
+
export declare const ELEMENT_PENDING_DRAW_SHAPE_OPACITY = 70;
|
|
265
266
|
export declare const DEFAULT_PROPORTIONAL_RADIUS = 0.25;
|
|
266
267
|
export declare const DEFAULT_ADAPTIVE_RADIUS = 32;
|
|
267
268
|
export declare const ROUNDNESS: {
|
|
@@ -314,6 +315,8 @@ export declare const TOOL_TYPE: {
|
|
|
314
315
|
readonly magicframe: "magicframe";
|
|
315
316
|
readonly embeddable: "embeddable";
|
|
316
317
|
readonly laser: "laser";
|
|
318
|
+
readonly autoshape: "autoshape";
|
|
319
|
+
readonly bucketfill: "bucketfill";
|
|
317
320
|
};
|
|
318
321
|
export declare const EDITOR_LS_KEYS: {
|
|
319
322
|
readonly OAI_API_KEY: "excalidraw-oai-api-key";
|
|
@@ -46,6 +46,7 @@ export declare const KEYS: {
|
|
|
46
46
|
readonly SUBTRACT: "-";
|
|
47
47
|
readonly SLASH: "/";
|
|
48
48
|
readonly A: "a";
|
|
49
|
+
readonly B: "b";
|
|
49
50
|
readonly C: "c";
|
|
50
51
|
readonly D: "d";
|
|
51
52
|
readonly E: "e";
|
|
@@ -101,6 +102,7 @@ export declare const KeyCodeMap: Map<ValueOf<{
|
|
|
101
102
|
readonly SUBTRACT: "-";
|
|
102
103
|
readonly SLASH: "/";
|
|
103
104
|
readonly A: "a";
|
|
105
|
+
readonly B: "b";
|
|
104
106
|
readonly C: "c";
|
|
105
107
|
readonly D: "d";
|
|
106
108
|
readonly E: "e";
|
|
@@ -6,4 +6,4 @@ export declare const getSizeFromPoints: (points: readonly (GlobalPoint | LocalPo
|
|
|
6
6
|
};
|
|
7
7
|
/** @arg dimension, 0 for rescaling only x, 1 for y */
|
|
8
8
|
export declare const rescalePoints: <Point extends GlobalPoint | LocalPoint>(dimension: 0 | 1, newSize: number, points: readonly Point[], normalize: boolean) => Point[];
|
|
9
|
-
export declare const getGridPoint: (x: number, y: number, gridSize: NullableGridSize) =>
|
|
9
|
+
export declare const getGridPoint: (x: number, y: number, gridSize: NullableGridSize) => GlobalPoint;
|
|
@@ -37,48 +37,6 @@ export declare const throttleRAF: <T extends any[]>(fn: (...args: T) => void) =>
|
|
|
37
37
|
* @returns {number} The tweened value.
|
|
38
38
|
*/
|
|
39
39
|
export declare const easeOut: (k: number) => number;
|
|
40
|
-
/**
|
|
41
|
-
* Animates values from `fromValues` to `toValues` using the requestAnimationFrame API.
|
|
42
|
-
* Executes the `onStep` callback on each step with the interpolated values.
|
|
43
|
-
* Returns a function that can be called to cancel the animation.
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* // Example usage:
|
|
47
|
-
* const fromValues = { x: 0, y: 0 };
|
|
48
|
-
* const toValues = { x: 100, y: 200 };
|
|
49
|
-
* const onStep = ({x, y}) => {
|
|
50
|
-
* setState(x, y)
|
|
51
|
-
* };
|
|
52
|
-
* const onCancel = () => {
|
|
53
|
-
* console.log("Animation canceled");
|
|
54
|
-
* };
|
|
55
|
-
*
|
|
56
|
-
* const cancelAnimation = easeToValuesRAF({
|
|
57
|
-
* fromValues,
|
|
58
|
-
* toValues,
|
|
59
|
-
* onStep,
|
|
60
|
-
* onCancel,
|
|
61
|
-
* });
|
|
62
|
-
*
|
|
63
|
-
* // To cancel the animation:
|
|
64
|
-
* cancelAnimation();
|
|
65
|
-
*/
|
|
66
|
-
export declare const easeToValuesRAF: <T extends Record<keyof T, number>, K extends keyof T>({ fromValues, toValues, onStep, duration, interpolateValue, onStart, onEnd, onCancel, }: {
|
|
67
|
-
fromValues: T;
|
|
68
|
-
toValues: T;
|
|
69
|
-
/**
|
|
70
|
-
* Interpolate a single value.
|
|
71
|
-
* Return undefined to be handled by the default interpolator.
|
|
72
|
-
*/
|
|
73
|
-
interpolateValue?: (fromValue: number, toValue: number,
|
|
74
|
-
/** no easing applied */
|
|
75
|
-
progress: number, key: K) => number | undefined;
|
|
76
|
-
onStep: (values: T) => void;
|
|
77
|
-
duration?: number;
|
|
78
|
-
onStart?: () => void;
|
|
79
|
-
onEnd?: () => void;
|
|
80
|
-
onCancel?: () => void;
|
|
81
|
-
}) => () => void;
|
|
82
40
|
export declare const chunk: <T extends any>(array: readonly T[], size: number) => T[][];
|
|
83
41
|
export declare const selectNode: (node: Element) => void;
|
|
84
42
|
export declare const removeSelection: () => void;
|
|
@@ -93,7 +51,7 @@ export declare const updateActiveTool: (appState: Pick<AppState, "activeTool">,
|
|
|
93
51
|
locked?: boolean;
|
|
94
52
|
fromSelection?: boolean;
|
|
95
53
|
}) & {
|
|
96
|
-
|
|
54
|
+
lastActiveTool?: ActiveTool | null;
|
|
97
55
|
}) => AppState["activeTool"];
|
|
98
56
|
export declare const isFullScreen: () => boolean;
|
|
99
57
|
export declare const allowFullScreen: () => Promise<void>;
|
|
@@ -40,7 +40,7 @@ export declare class Scene {
|
|
|
40
40
|
elements?: ElementsMapOrArray;
|
|
41
41
|
includeBoundTextElement?: boolean;
|
|
42
42
|
includeElementsInFrames?: boolean;
|
|
43
|
-
}):
|
|
43
|
+
}): NonDeletedExcalidrawElement[];
|
|
44
44
|
getNonDeletedFramesLikes(): readonly NonDeleted<ExcalidrawFrameLikeElement>[];
|
|
45
45
|
getElement<T extends ExcalidrawElement>(id: T["id"]): T | null;
|
|
46
46
|
getNonDeletedElement(id: ExcalidrawElement["id"]): NonDeleted<ExcalidrawElement> | null;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { AppState } from "@excalidraw/excalidraw/types";
|
|
2
2
|
import type { Scene } from "./Scene";
|
|
3
|
-
import type {
|
|
3
|
+
import type { NonDeletedExcalidrawElement } from "./types";
|
|
4
4
|
export interface Alignment {
|
|
5
5
|
position: "start" | "center" | "end";
|
|
6
6
|
axis: "x" | "y";
|
|
7
7
|
}
|
|
8
|
-
export declare const alignElements: (selectedElements:
|
|
8
|
+
export declare const alignElements: (selectedElements: NonDeletedExcalidrawElement[], alignment: Alignment, scene: Scene, appState: Readonly<AppState>) => NonDeletedExcalidrawElement[];
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { GlobalPoint } from "@excalidraw/math";
|
|
2
|
+
import type { AppState } from "@excalidraw/excalidraw/types";
|
|
3
|
+
import type { ElementsMap, ExcalidrawArrowElement, ExcalidrawTextElement, FixedPoint, NonDeleted, NonDeletedExcalidrawElement, TextAlign, VerticalAlign } from "./types";
|
|
4
|
+
export type ArrowEndpoint = {
|
|
5
|
+
arrow: NonDeleted<ExcalidrawArrowElement>;
|
|
6
|
+
startOrEnd: "start" | "end";
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Finds a free (unbound) arrow endpoint under the cursor, front-most first.
|
|
10
|
+
* Used by the text tool to offer creating a text label anchored to the tip of
|
|
11
|
+
* an arrow.
|
|
12
|
+
*/
|
|
13
|
+
export declare const getUnboundArrowEndpointAtPoint: (scenePointer: GlobalPoint, elements: readonly NonDeletedExcalidrawElement[], elementsMap: ElementsMap, zoom: AppState["zoom"]) => ArrowEndpoint | null;
|
|
14
|
+
/**
|
|
15
|
+
* Describes how a text element should be created so that it reads as a label
|
|
16
|
+
* for the given arrow endpoint.
|
|
17
|
+
*
|
|
18
|
+
* The arrow is treated as fixed: rather than routing the arrow to the text, we
|
|
19
|
+
* pick the side of the text the arrow should attach to (the one it already
|
|
20
|
+
* points at), and place the text so that side's midpoint lands on the existing
|
|
21
|
+
* endpoint. The alignment returned pins that same midpoint while the text is
|
|
22
|
+
* typed, so the arrow doesn't swing around during editing.
|
|
23
|
+
*/
|
|
24
|
+
export declare const getTextBindingForArrowEndpoint: (arrow: NonDeleted<ExcalidrawArrowElement>, startOrEnd: "start" | "end", elementsMap: ElementsMap,
|
|
25
|
+
/**
|
|
26
|
+
* stroke width the text will be created with — the binding gap is derived
|
|
27
|
+
* from the *bind target*, so using the arrow's would offset the anchor by
|
|
28
|
+
* half the difference between the two
|
|
29
|
+
*/
|
|
30
|
+
targetStrokeWidth: number) => {
|
|
31
|
+
/** the text-local ratio the arrow binds to (a side midpoint) */
|
|
32
|
+
fixedPoint: FixedPoint;
|
|
33
|
+
textAlign: TextAlign;
|
|
34
|
+
verticalAlign: VerticalAlign;
|
|
35
|
+
/** scene position the text's bound side midpoint should sit at */
|
|
36
|
+
anchor: GlobalPoint;
|
|
37
|
+
} | null;
|
|
38
|
+
/**
|
|
39
|
+
* Whether an arrow endpoint is bound to this text — i.e. the text serves as an
|
|
40
|
+
* arrow-endpoint label. Checked on the arrows' own bindings: the text's
|
|
41
|
+
* `boundElements` only says an arrow relates to it, while the binding on the
|
|
42
|
+
* arrow is the authoritative side of the relationship.
|
|
43
|
+
*/
|
|
44
|
+
export declare const isEndpointBoundText: (text: ExcalidrawTextElement, elementsMap: ElementsMap) => boolean;
|
|
45
|
+
/** the anchor a text bound to an arrow endpoint grows away from */
|
|
46
|
+
export declare const getEndpointBoundTextDragAnchor: (newElement: ExcalidrawTextElement) => {
|
|
47
|
+
anchorRatio: number;
|
|
48
|
+
anchorX: number;
|
|
49
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type GlobalPoint } from "@excalidraw/math";
|
|
2
2
|
import type { AppState, NullableGridSize } from "@excalidraw/excalidraw/types";
|
|
3
3
|
import { LinearElementEditor } from "../linearElementEditor";
|
|
4
|
-
import type { ElementsMap, ExcalidrawArrowElement, ExcalidrawBindableElement, NonDeletedSceneElementsMap } from "../types";
|
|
4
|
+
import type { ElementsMap, ExcalidrawArrowElement, ExcalidrawBindableElement, FixedPointBinding, NonDeletedSceneElementsMap } from "../types";
|
|
5
5
|
import type { Scene } from "../Scene";
|
|
6
6
|
export declare const isFocusPointVisible: (focusPoint: GlobalPoint, arrow: ExcalidrawArrowElement, bindableElement: ExcalidrawBindableElement, elementsMap: ElementsMap, appState: {
|
|
7
7
|
isBindingEnabled: AppState["isBindingEnabled"];
|
|
@@ -22,6 +22,9 @@ export declare const handleFocusPointPointerDown: (arrow: ExcalidrawArrowElement
|
|
|
22
22
|
x: number;
|
|
23
23
|
y: number;
|
|
24
24
|
};
|
|
25
|
+
arrowOtherEndpointInitialBinding: FixedPointBinding | null;
|
|
26
|
+
};
|
|
27
|
+
export declare const handleFocusPointPointerUp: (linearElementEditor: LinearElementEditor, scene: Scene) => {
|
|
28
|
+
arrowOtherEndpointInitialBinding: null;
|
|
25
29
|
};
|
|
26
|
-
export declare const handleFocusPointPointerUp: (linearElementEditor: LinearElementEditor, scene: Scene) => void;
|
|
27
30
|
export declare const handleFocusPointHover: (arrow: ExcalidrawArrowElement, scenePointerX: number, scenePointerY: number, scene: Scene, appState: AppState) => "start" | "end" | null;
|