@excalidraw/common 0.18.0-abeeaeb → 0.18.0-afa3a65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/dev/index.js +91 -10
  2. package/dist/dev/index.js.map +2 -2
  3. package/dist/prod/index.js +3 -3
  4. package/dist/types/common/src/colors.d.ts +8 -0
  5. package/dist/types/common/src/constants.d.ts +44 -0
  6. package/dist/types/common/src/keys.d.ts +2 -0
  7. package/dist/types/common/src/random.d.ts +7 -0
  8. package/dist/types/element/src/Scene.d.ts +1 -1
  9. package/dist/types/element/src/comparisons.d.ts +5 -3
  10. package/dist/types/element/src/delta.d.ts +23 -1
  11. package/dist/types/element/src/flowchart.d.ts +5 -1
  12. package/dist/types/element/src/frame.d.ts +2 -2
  13. package/dist/types/element/src/index.d.ts +1 -0
  14. package/dist/types/element/src/linearElementEditor.d.ts +10 -0
  15. package/dist/types/element/src/mutateElement.d.ts +1 -1
  16. package/dist/types/element/src/newElement.d.ts +24 -2
  17. package/dist/types/element/src/sizeHelpers.d.ts +6 -0
  18. package/dist/types/element/src/stickyNote.d.ts +183 -0
  19. package/dist/types/element/src/textElement.d.ts +2 -1
  20. package/dist/types/element/src/transform.d.ts +25 -6
  21. package/dist/types/element/src/typeChecks.d.ts +3 -2
  22. package/dist/types/element/src/types.d.ts +35 -6
  23. package/dist/types/element/src/utils.d.ts +7 -3
  24. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +12 -0
  25. package/dist/types/excalidraw/actions/actionAlign.d.ts +6 -6
  26. package/dist/types/excalidraw/actions/actionBoundText.d.ts +8 -0
  27. package/dist/types/excalidraw/actions/actionCanvas.d.ts +28 -0
  28. package/dist/types/excalidraw/actions/actionClipboard.d.ts +8 -0
  29. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +4 -0
  30. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +13 -1
  31. package/dist/types/excalidraw/actions/actionDeselect.d.ts +4 -0
  32. package/dist/types/excalidraw/actions/actionDistribute.d.ts +2 -2
  33. package/dist/types/excalidraw/actions/actionElementLink.d.ts +4 -0
  34. package/dist/types/excalidraw/actions/actionElementLock.d.ts +8 -0
  35. package/dist/types/excalidraw/actions/actionExport.d.ts +8 -0
  36. package/dist/types/excalidraw/actions/actionFinalize.d.ts +1 -0
  37. package/dist/types/excalidraw/actions/actionFrame.d.ts +63 -1
  38. package/dist/types/excalidraw/actions/actionGroup.d.ts +8 -0
  39. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +55 -1
  40. package/dist/types/excalidraw/actions/actionLink.d.ts +4 -0
  41. package/dist/types/excalidraw/actions/actionMenu.d.ts +4 -0
  42. package/dist/types/excalidraw/actions/actionProperties.d.ts +18 -6
  43. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +4 -0
  44. package/dist/types/excalidraw/actions/actionStyles.d.ts +5 -1
  45. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +4 -0
  46. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +4 -0
  47. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +4 -0
  48. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +4 -0
  49. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +4 -0
  50. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +4 -0
  51. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +4 -0
  52. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +4 -0
  53. package/dist/types/excalidraw/actions/colorTargets.d.ts +39 -0
  54. package/dist/types/excalidraw/appState.d.ts +4 -0
  55. package/dist/types/excalidraw/components/App.arrowText.d.ts +40 -8
  56. package/dist/types/excalidraw/components/App.cursor.d.ts +8 -0
  57. package/dist/types/excalidraw/components/App.d.ts +92 -6
  58. package/dist/types/excalidraw/components/App.toolDrag.d.ts +63 -0
  59. package/dist/types/excalidraw/components/IconButton.d.ts +2 -0
  60. package/dist/types/excalidraw/components/Tools.d.ts +7 -2
  61. package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +2 -0
  62. package/dist/types/excalidraw/components/icons.d.ts +1 -0
  63. package/dist/types/excalidraw/components/shapeActionPredicates.d.ts +2 -2
  64. package/dist/types/excalidraw/data/blob.d.ts +8 -0
  65. package/dist/types/excalidraw/data/json.d.ts +4 -0
  66. package/dist/types/excalidraw/fonts/Fonts.d.ts +3 -2
  67. package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +5 -5
  68. package/dist/types/excalidraw/renderer/helpers.d.ts +25 -0
  69. package/dist/types/excalidraw/renderer/interactiveScene.d.ts +1 -1
  70. package/dist/types/excalidraw/scene/Renderer.d.ts +50 -1
  71. package/dist/types/excalidraw/scene/index.d.ts +1 -1
  72. package/dist/types/excalidraw/scene/types.d.ts +1 -0
  73. package/dist/types/excalidraw/types.d.ts +30 -2
  74. package/dist/types/excalidraw/viewport.d.ts +4 -0
  75. package/dist/types/math/src/curve.d.ts +19 -12
  76. package/dist/types/math/src/segment.d.ts +6 -0
  77. package/dist/types/utils/src/export.d.ts +1 -0
  78. package/dist/types/utils/src/shape.d.ts +2 -2
  79. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- var Xe=Object.create;var Q=Object.defineProperty;var je=Object.getOwnPropertyDescriptor;var qe=Object.getOwnPropertyNames;var Ze=Object.getPrototypeOf,Qe=Object.prototype.hasOwnProperty;var Je=(e,t)=>()=>(e&&(t=e(e=0)),t);var J=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var et=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of qe(t))!Qe.call(e,o)&&o!==n&&Q(e,o,{get:()=>t[o],enumerable:!(r=je(t,o))||r.enumerable});return e};var ee=(e,t,n)=>(n=e!=null?Xe(Ze(e)):{},et(t||!e||!e.__esModule?Q(n,"default",{value:e,enumerable:!0}):n,e));var h,p=Je(()=>{h={PROD:!0}});var Ce=J(($,Ie)=>{p();(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof $=="object"?Ie.exports=t():(e.PromisePool=t(),e.promisePool=e.PromisePool)})($,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,m=l.length;u<m;++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,m){a._callbacks={reject:m,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 We=J(H=>{"use strict";p();Object.defineProperty(H,"__esModule",{value:!0});H.sanitizeUrl=void 0;var ln=/^([^\w]*)(javascript|data|vbscript)/im,cn=/&#(\w+)(^\w|;)?/g,un=/&(newline|tab);/gi,pn=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,dn=/^.+(:|&colon;)/gim,fn=[".","/"];function hn(e){return fn.indexOf(e[0])>-1}function mn(e){return e.replace(cn,function(t,n){return String.fromCharCode(n)})}function En(e){var t=mn(e||"").replace(un,"").replace(pn,"").trim();if(!t)return"about:blank";if(hn(t))return t;var n=t.match(dn);if(!n)return t;var r=n[0];return ln.test(r)?"about:blank":t}H.sanitizeUrl=En});p();p();var te=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))}};p();var yn=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 nt=/^\s+/,rt=/\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=ot(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=le(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=re(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString: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.v*100);return this._a==1?"hsv("+n+", "+r+"%, "+o+"%)":"hsva("+n+", "+r+"%, "+o+"%, "+this._roundA+")"},toHsl:function(){var t=ne(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=ne(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 oe(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return lt(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:_t[oe(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var n="#"+se(this._r,this._g,this._b,this._a),r=n,o=this._gradientType?"GradientType = 1, ":"";if(t){var s=c(t);r="#"+se(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(dt,arguments)},brighten:function(){return this._applyModification(ft,arguments)},darken:function(){return this._applyModification(ht,arguments)},desaturate:function(){return this._applyModification(ct,arguments)},saturate:function(){return this._applyModification(ut,arguments)},greyscale:function(){return this._applyModification(pt,arguments)},spin:function(){return this._applyModification(mt,arguments)},_applyCombination:function(t,n){return t.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(bt,arguments)},complement:function(){return this._applyCombination(Et,arguments)},monochromatic:function(){return this._applyCombination(gt,arguments)},splitcomplement:function(){return this._applyCombination(Tt,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 ot(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=vt(e)),C(e)=="object"&&(A(e.r)&&A(e.g)&&A(e.b)?(t=st(e.r,e.g,e.b),i=!0,a=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=it(e.h,r,o),i=!0,a="hsv"):A(e.h)&&A(e.s)&&A(e.l)&&(r=O(e.s),s=O(e.l),t=at(e.h,r,s),i=!0,a="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=le(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 st(e,t,n){return{r:E(e,255)*255,g:E(t,255)*255,b:E(n,255)*255}}function ne(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 at(e,t,n){var r,o,s;e=E(e,360),t=E(t,100),n=E(n,100);function i(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 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 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,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 it(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],m=[a,n,n,i,s,s][l],b=[s,s,a,n,n,i][l];return{r:u*255,g:m*255,b:b*255}}function oe(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 lt(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(ce(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 se(e,t,n,r){var o=[x(ce(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 ct(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 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){return c(e).desaturate(100)}function dt(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 ft(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 ht(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 mt(e,t){var n=c(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,c(n)}function Et(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 Tt(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 bt(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 gt(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=St(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 B=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"},_t=c.hexNames=xt(B);function xt(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function le(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function E(e,t){At(e)&&(e="100%");var n=yt(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 At(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function yt(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 ce(e){return Math.round(parseFloat(e)*255).toString(16)}function ie(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 vt(e){e=e.replace(nt,"").replace(rt,"").toLowerCase();var t=!1;if(B[e])e=B[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:ie(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:ie(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 St(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 W}from"@excalidraw/math";import{degreesToRadians as Mt}from"@excalidraw/math";var K=typeof window<"u"?new Map:null,ue=93,pe=180;function de(e,t,n,r){let o=e/255,s=t/255,i=n/255,a=Mt(r),l=Math.cos(a),u=Math.sin(a),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]+i*m[2],Z=o*m[3]+s*m[4]+i*m[5],y=o*m[6]+s*m[7]+i*m[8];return{r:Math.round(Math.max(0,Math.min(1,b))*255),g:Math.round(Math.max(0,Math.min(1,Z))*255),b:Math.round(Math.max(0,Math.min(1,y))*255)}}var Rt=(e,t,n,r)=>{let o=W(r,0,100)/100,s=u=>{let m=u*(1-o)+(255-u)*o;return Math.round(W(m,0,255))},i=s(e),a=s(t),l=s(n);return{r:i,g:a,b:l}},Fn=(e,t=!0)=>{if(!t)return e;let n=K?.get(e);if(n)return n;let r=c(e),o=r.getAlpha(),s=r.toRgb(),i=Rt(s.r,s.g,s.b,ue),a=de(i.r,i.g,i.b,pe),l=V(a.r,a.g,a.b,o);return K&&K.set(e,l),l},Ot=(e,t,n)=>{let r=ue/100,o=1-2*r,s=i=>Math.round(W((i-255*r)/o,0,255));return{r:s(e),g:s(t),b:s(n)}},In=e=>{let t=c(e),n=t.getAlpha(),r=t.toRgb(),o=de(r.r,r.g,r.b,pe),s=Ot(o.r,o.g,o.b);return V(s.r,s.g,s.b,n)},Lt=(e,t)=>t.reduce((n,r)=>(r in e&&(n[r]=e[r]),n),{}),Cn=5,Pn=5,Dn=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"]},fe=Lt(d,["cyan","blue","violet","grape","pink","green","teal","yellow","orange","red"]),kn=5,Un=[d.black,d.red[D],d.green[D],d.blue[D],d.yellow[D]],Nn=[d.transparent,d.red[v],d.green[v],d.blue[v],d.yellow[v]],Hn=[d.white,d.red[v],d.green[v],d.blue[v],d.yellow[v]],Gn=[d.white,"#f8f9fa","#f5faff","#fffce8","#fdf8f6"],Bn={transparent:d.transparent,white:d.white,gray:d.gray,black:d.black,bronze:d.bronze,...fe},Kn={transparent:d.transparent,white:d.white,gray:d.gray,black:d.black,bronze:d.bronze,...fe},Wn=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]],V=(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},Vn=e=>{let t=c(e);if(!t.isValid())return null;let{r:n,g:r,b:o,a:s}=t.toRgb();return V(n,r,o,s)},he=e=>c(e).getAlpha()===0,Yn=e=>c(e).getAlpha()===1,$n=240,wt=(e,t,n)=>(e*299+t*587+n*114)/1e3,zn=(e,t=160)=>{if(!e)return!0;if(he(e))return!1;let n=c(e);if(!n.isValid())return!0;let{r,g:o,b:s}=n.toRgb();return wt(r,o,s)<t},Xn=e=>{if(e=e.trim(),he(e))return e;let t=c(e);return t.isValid()?["hex","hex8"].includes(t.getFormat())&&!e.startsWith("#")?`#${e}`:e:null};p();var Qn=typeof window<"u"&&"ResizeObserver"in window,Jn="Excalidraw",er=36,tr=10,nr=20,rr=8,or=5,sr=1,ar=30,ir=Math.PI/12,lr="red",cr={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},ur={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1,ERASER:5},pr={enabled:"all",disabled:"none",inheritFromUI:"var(--ui-pointerEvents)"},Ft=(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))(Ft||{}),dr={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5},k={TEST:"test",DEVELOPMENT:"development",PRODUCTION:"production"},fr={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},Ee="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},Te="sans-serif",be="monospace",It={[Te]:998,[be]:999},Y={[Ee]:100,...It,[L]:1e3};function Ct(e){switch(e){case T.Cascadia:case T["Comic Shanns"]:return be;default:return Te}}var ge=e=>{let t=Ct(e);switch(e){case T.Excalifont:return[Ee,t,L];default:return[t,L]}},mr={LIGHT:"light",DARK:"dark"},Er="invert(93%) hue-rotate(180deg)",Tr={strokeColor:"#bbb",strokeWidth:2,strokeStyle:"solid",fillStyle:"solid",roughness:0,roundness:null,backgroundColor:"transparent",radius:8,nameOffsetY:3,nameColorLightTheme:"#999999",nameColorDarkTheme:"#7a7a7a",nameFontSize:14,nameLineHeight:1.25},br=1,gr=20,_r=T.Excalifont,xr="left",Ar="top",_e="{version}",Pt=2,Dt=2*Pt,kt=1e-5,yr=2*Dt-kt,vr="#ffffff",Sr="#1e1e1e",Mr="#a2f1a6",Rr=["selectAll"],Or=20,Lr=5,xe={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"},Ut={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"},me={...Ut,"excalidraw.svg":"image/svg+xml","excalidraw.png":"image/png",binary:"application/octet-stream",...xe},wr=[me.text,me.html,...Object.values(xe)],Fr={png:"png",svg:"svg",clipboard:"clipboard"},Ir={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawLibrary:"excalidrawlib",excalidrawClipboardWithAPI:"excalidraw-api/clipboard"},Cr=()=>window.EXCALIDRAW_EXPORT_SOURCE||window.location.origin,Pr=500,Dr=300,kr=500,Ur=1e4,Nr=3e4,Hr=100,Gr=.1,Br=.1,Kr=30,Wr=300,Vr=6e4,Yr=3e3,$r={addLibrary:"addLibrary"},zr={addLibrary:"addLibrary"},Xr={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,toggleTheme:null,saveAsImage:!0},tools:{image:!0}},jr=2,qr=[1,2,3],Zr=10,Qr={maxWidthOrHeight:1440,maxFileSizeBytes:4*1024*1024},Jr="http://www.w3.org/2000/svg",eo=`<?xml version="1.0" standalone="no"?>
1
+ var qe=Object.create;var J=Object.defineProperty;var Ze=Object.getOwnPropertyDescriptor;var Qe=Object.getOwnPropertyNames;var Je=Object.getPrototypeOf,et=Object.prototype.hasOwnProperty;var tt=(e,t)=>()=>(e&&(t=e(e=0)),t);var ee=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var nt=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Qe(t))!et.call(e,o)&&o!==n&&J(e,o,{get:()=>t[o],enumerable:!(r=Ze(t,o))||r.enumerable});return e};var te=(e,t,n)=>(n=e!=null?qe(Je(e)):{},nt(t||!e||!e.__esModule?J(n,"default",{value:e,enumerable:!0}):n,e));var h,p=tt(()=>{h={PROD:!0}});var De=ee((z,Pe)=>{p();(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof z=="object"?Pe.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(K=>{"use strict";p();Object.defineProperty(K,"__esModule",{value:!0});K.sanitizeUrl=void 0;var fn=/^([^\w]*)(javascript|data|vbscript)/im,hn=/&#(\w+)(^\w|;)?/g,mn=/&(newline|tab);/gi,En=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,Tn=/^.+(:|&colon;)/gim,bn=[".","/"];function gn(e){return bn.indexOf(e[0])>-1}function _n(e){return e.replace(hn,function(t,n){return String.fromCharCode(n)})}function xn(e){var t=_n(e||"").replace(mn,"").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}K.sanitizeUrl=xn});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 On=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 ot=/^\s+/,st=/\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=it(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 ut(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:At[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(ht,arguments)},brighten:function(){return this._applyModification(mt,arguments)},darken:function(){return this._applyModification(Et,arguments)},desaturate:function(){return this._applyModification(pt,arguments)},saturate:function(){return this._applyModification(dt,arguments)},greyscale:function(){return this._applyModification(ft,arguments)},spin:function(){return this._applyModification(Tt,arguments)},_applyCombination:function(t,n){return t.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(_t,arguments)},complement:function(){return this._applyCombination(bt,arguments)},monochromatic:function(){return this._applyCombination(xt,arguments)},splitcomplement:function(){return this._applyCombination(gt,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 it(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=Mt(e)),C(e)=="object"&&(A(e.r)&&A(e.g)&&A(e.b)?(t=at(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=ct(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=lt(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 at(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 lt(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 ct(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 ut(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 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,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 ft(e){return c(e).desaturate(100)}function ht(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 mt(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 Et(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 Tt(e,t){var n=c(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,c(n)}function bt(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 gt(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 _t(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 xt(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=Rt(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"},At=c.hexNames=yt(W);function yt(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){vt(e)&&(e="100%");var n=St(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 vt(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function St(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 Mt(e){e=e.replace(ot,"").replace(st,"").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 Rt(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 V}from"@excalidraw/math";import{degreesToRadians as Ot}from"@excalidraw/math";var Y=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=Ot(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 Lt=(e,t,n,r)=>{let o=V(r,0,100)/100,s=u=>{let m=u*(1-o)+(255-u)*o;return Math.round(V(m,0,255))},a=s(e),i=s(t),l=s(n);return{r:a,g:i,b:l}},Nn=(e,t=!0)=>{if(!t)return e;let n=Y?.get(e);if(n)return n;let r=c(e),o=r.getAlpha(),s=r.toRgb(),a=Lt(s.r,s.g,s.b,pe),i=fe(a.r,a.g,a.b,de),l=N(i.r,i.g,i.b,o);return Y&&Y.set(e,l),l},It=(e,t,n)=>{let r=pe/100,o=1-2*r,s=a=>Math.round(V((a-255*r)/o,0,255));return{r:s(e),g:s(t),b:s(n)}},kn=e=>{let t=c(e),n=t.getAlpha(),r=t.toRgb(),o=fe(r.r,r.g,r.b,de),s=It(o.r,o.g,o.b);return N(s.r,s.g,s.b,n)},wt=(e,t)=>t.reduce((n,r)=>(r in e&&(n[r]=e[r]),n),{}),Un=5,Hn=5,Gn=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"]),Kn=5,Ft=[d.black,d.red[D],d.green[D],d.blue[D],d.yellow[D]],Bn=[d.transparent,d.red[v],d.green[v],d.blue[v],d.yellow[v]],Wn=[d.white,d.red[v],d.green[v],d.blue[v],d.yellow[v]],me="#ffdf6b",Yn=Ft,Vn=[me,d.pink[1],d.green[1],d.blue[1],d.orange[1]],$n=[d.white,"#f8f9fa","#f5faff","#fffce8","#fdf8f6"],zn={transparent:d.transparent,white:d.white,gray:d.gray,black:d.black,bronze:d.bronze,...he},Xn={transparent:d.transparent,white:d.white,gray:d.gray,black:d.black,bronze:d.bronze,...he},jn=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]],N=(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},qn=(e,t)=>{let n=c(e);if(!n.isValid())return e;let{r,g:o,b:s}=n.toRgb();return N(r,o,s,t)},Zn=e=>{let t=c(e);if(!t.isValid())return null;let{r:n,g:r,b:o,a:s}=t.toRgb();return N(n,r,o,s)},Ee=e=>c(e).getAlpha()===0,Qn=e=>c(e).getAlpha()===1,Jn=240,Ct=(e,t,n)=>(e*299+t*587+n*114)/1e3,er=(e,t=160)=>{if(!e)return!0;if(Ee(e))return!1;let n=c(e);if(!n.isValid())return!0;let{r,g:o,b:s}=n.toRgb();return Ct(r,o,s)<t},tr=e=>{if(e=e.trim(),Ee(e))return e;let t=c(e);return t.isValid()?["hex","hex8"].includes(t.getFormat())&&!e.startsWith("#")?`#${e}`:e:null};p();var sr=typeof window<"u"&&"ResizeObserver"in window,ir="Excalidraw",ar=36,lr=10,cr=20,ur=8,pr=5,dr=1,fr=30,hr=Math.PI/12,mr="red",Er={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},Tr={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1,ERASER:5},br={enabled:"all",disabled:"none",inheritFromUI:"var(--ui-pointerEvents)"},Pt=(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.POINTER_CANCEL="pointercancel",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))(Pt||{}),gr={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5},k={TEST:"test",DEVELOPMENT:"development",PRODUCTION:"production"},_r={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"},xr={sm:16,md:20,lg:28,xl:36},be="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},ge="sans-serif",_e="monospace",Dt={[ge]:998,[_e]:999},$={[be]:100,...Dt,[L]:1e3};function Nt(e){switch(e){case T.Cascadia:case T["Comic Shanns"]:return _e;default:return ge}}var xe=e=>{let t=Nt(e);switch(e){case T.Excalifont:return[be,t,L];default:return[t,L]}},Ar={LIGHT:"light",DARK:"dark"},yr="invert(93%) hue-rotate(180deg)",vr={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},Sr=1,Mr=20,Rr=16,Or=512,Lr=28,Ir=2,kt=16,Ut={height:20,fontSize:12,fontFamily:"Helvetica, Arial, sans-serif",baselineFromBottom:14,opacity:1,minBodyWidthForYear:80},wr=kt*2+Ut.height,Fr=250,Cr=75,Pr=3,Dr=.16,Nr=.5,kr=.08,Ur=T.Excalifont,Hr="left",Gr="top",Ae="{version}",Ht=2,Gt=2*Ht,Kt=1e-5,Kr=2*Gt-Kt,Br="#ffffff",Wr="#1e1e1e",Yr="#a2f1a6",Vr=["selectAll"],$r=20,zr=5,ye={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"},Bt={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"},Te={...Bt,"excalidraw.svg":"image/svg+xml","excalidraw.png":"image/png",binary:"application/octet-stream",...ye},Xr=[Te.text,Te.html,...Object.values(ye)],jr={png:"png",svg:"svg",clipboard:"clipboard"},qr={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawLibrary:"excalidrawlib",excalidrawClipboardWithAPI:"excalidraw-api/clipboard"},Zr=()=>window.EXCALIDRAW_EXPORT_SOURCE||window.location.origin,Qr=500,Jr=300,eo=500,to=1e4,no=3e4,ro=100,oo=.1,so=.1,io=30,ao=300,lo=6e4,co=3e3,uo={addLibrary:"addLibrary"},po={addLibrary:"addLibrary"},fo={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,toggleTheme:null,saveAsImage:!0},tools:{image:!0}},ho=2,mo=[1,2,3],Eo=10,To={maxWidthOrHeight:1440,maxFileSizeBytes:4*1024*1024},bo="http://www.w3.org/2000/svg",go=`<?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
- `,to=128,no={excalidraw:2,excalidrawLibrary:2},ro=5,oo=.7,so=11,ao={TOP:"top",MIDDLE:"middle",BOTTOM:"bottom"},io={LEFT:"left",CENTER:"center",RIGHT:"right"},lo=20,co=70,uo=.25,po=32,fo={LEGACY:1,PROPORTIONAL_RADIUS:2,ADAPTIVE_RADIUS:3},Nt={architect:0,artist:1,cartoonist:2},ho=["thin","medium","bold"],Ae={thin:1,medium:2,bold:4,extraBold:8},Ht={thin:.5,medium:1,bold:2,extraBold:4},mo=(e,t)=>e==="freedraw"?Ht[t]:Ae[t],Gt="medium",Eo={strokeColor:d.black,backgroundColor:d.transparent,fillStyle:"solid",strokeWidth:Ae[Gt],strokeStyle:"solid",roughness:Nt.artist,opacity:100,locked:!1},Bt="library",To="search",bo={name:"default",defaultTab:Bt},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",autoshape:"autoshape",bucketfill:"bucketfill"},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__"),Kt=(r=>(r.ACTIVE="active",r.AWAY="away",r.IDLE="idle",r))(Kt||{}),Lo=20,wo=35,Fo=700,Io={background:"var(--mobile-action-button-bg)"},Co=.5,Po=.2;p();var U={[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},[Y.Xiaolai]:{metrics:{unitsPerEm:1e3,ascender:880,descender:-144,lineHeight:1.25},fallback:!0},[Y["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}=U[e]?.metrics||U[T.Excalifont].metrics,i=t/r,a=(n-i*o+i*s)/2;return i*o+a},Bo=e=>{let{lineHeight:t}=U[e]?.metrics||U[T.Excalifont].metrics;return t};p();var ye=class{jobs=[];running=!1;tick(){if(this.running)return;let t=this.jobs.shift();t?(this.running=!0,t.promise.resolve(Se(t.jobFactory,...t.args).finally(()=>{this.running=!1,this.tick()}))):this.running=!1}push(t,...n){let r=ve();return this.jobs.push({jobFactory:t,promise:r,args:n}),this.tick(),r}};p();p();var Me="excalidraw.desktopUIMode",zo=599,Xo=1e3,jo=500,qo=600,Zo=1180,Qo=1440,Jo=1229,Re=/Mac|iPod|iPhone|iPad/.test(navigator.platform),es=/^Win/.test(navigator.platform),Oe=/\b(android)\b/i.test(navigator.userAgent),ts=typeof window<"u"&&"netscape"in window&&navigator.userAgent.indexOf("rv:")>1&&navigator.userAgent.indexOf("Gecko")>1,Wt=navigator.userAgent.indexOf("Chrome")!==-1,ns=!Wt&&navigator.userAgent.indexOf("Safari")!==-1,Le=/iPad|iPhone/i.test(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document,rs=()=>navigator.brave?.isBrave?.name==="isBrave",Vt=(e,t)=>e<=599||t<500&&e<1e3,Yt=(e,t)=>{let n=Math.min(e,t),r=Math.max(e,t);return n>=600&&r<=1180},$t=()=>{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(Le)return!0;if(Oe){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)=>Vt(e,t)?"phone":Yt(e,t)?"tablet":"desktop",ss=e=>e.formFactor==="phone"?"mobile":e.formFactor==="tablet"?"compact":e.desktopUIMode,as=e=>{let t=e??"",n="unknown";return Le?n="ios":Oe?n="android":t&&(n="other"),{isMobileDevice:$t(),platform:n}},is=()=>{if(typeof window>"u")return null;try{let e=window.localStorage.getItem(Me);if(e==="compact"||e==="full")return e}catch{}return null},zt=e=>{if(!(typeof window>"u"))try{window.localStorage.setItem(Me,e)}catch{}},ls=e=>{if(!(e!=="compact"&&e!=="full"))return zt(e),e};var we={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:Re?"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"},Xt=new Map([[M.Z,we.Z],[M.Y,we.Y]]),jt=e=>/^[a-z]$/.test(e.toLowerCase()),ds=(e,t)=>{if(t===e.key.toLowerCase())return!0;let n=Xt.get(t);return!!(n&&!jt(e.key)&&e.code===n)},fs=e=>e===M.ARROW_LEFT||e===M.ARROW_RIGHT||e===M.ARROW_DOWN||e===M.ARROW_UP,hs=e=>e.altKey,ms=e=>e.shiftKey,Es=e=>e.shiftKey;p();import{pointFrom as Fe,pointFromPair as qt}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(y=>y[e]),s=Math.max(...o),i=Math.min(...o),a=s-i,l=a===0?1:t/a,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=i-u;return m.map(y=>qt(y.map((S,I)=>I===e?S+b:S)))},As=(e,t,n)=>n?Fe(Math.round(e/n)*n,Math.round(t/n)*n):Fe(e,t);p();var De=ee(Ce(),1),Pe=class{pool;entries={};constructor(t,n){this.pool=new De.default(t,n)}all(){let t=n=>{if(n.data.result){let[r,o]=n.data.result;this.entries[r]=o}};return this.pool.addEventListener("fulfilled",t),this.pool.start().then(()=>(setTimeout(()=>{this.pool.removeEventListener("fulfilled",t)}),Object.values(this.entries)))}};p();p();p();var ke=(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 N}from"@excalidraw/math";var z=null,Ns=e=>{z=e},Hs=()=>{if(z)return z;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"),Zt=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement,Ks=e=>Zt(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,Qt=({fontFamily:e})=>{for(let[t,n]of Object.entries(T))if(n===e)return`${t}${ge(n).map(r=>`, ${r}`).join("")}`;return L},Vs=({fontSize:e,fontFamily:t})=>`${e}px ${Qt({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},Xs=e=>1-Math.pow(1-e,4),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.lastActiveTool===void 0?e.activeTool.lastActiveTool:t.lastActiveTool,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}`),Jt="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u2C00-\uFB1C\uFDFE-\uFE6F\uFEFD-\uFFFF",en="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",tn=new RegExp(`^[^${Jt}]*[${en}]`),ia=e=>tn.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},pa=(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},da=(e,t)=>{for(let n=0;n<e.length;n++){let r=t(e[n],n);if(r!=null)return r}},ve=()=>{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},ha=()=>document.querySelector('meta[name="version"]')?.content||_e,ma=()=>{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=()=>j()?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},[]),nn=e=>Array.isArray(e)?e:e.values(),Sa=e=>Array.isArray(e)?e:Array.from(nn(e)),j=()=>h.MODE===k.TEST,Ma=()=>h.MODE===k.DEVELOPMENT,Ne=()=>h.MODE===k.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"},rn=()=>{try{return window.self===window.top?"top":"iframe"}catch{return"iframe"}},Fa=()=>rn()==="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):[]},Ue=(e,t)=>Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t,on=(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]||Ue(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]||Ue(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)},Da=(e,t,n)=>{if(!t)return e;if(n)return console.error(t),e;throw new Error(t)};function ka(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)=>on(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)} ${N(o[0],s[0]).toFixed(2)},${N(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+=`${N(r[0],o[0]).toFixed(2)},${N(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 Se=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}},He=e=>e.replace(/"/g,"&quot;"),za=e=>Array.isArray(e)?e:[e],sn=e=>Array.isArray(e),an=e=>sn(e)?e.length:e instanceof Map||e instanceof Set?e.size:Object.keys(e).length,Xa=(e,t)=>{if(an(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},Ge="excalidraw-feature-flags",X={COMPLEX_BINDINGS:!1},R=null,ja=e=>{if(!R)try{let t=localStorage.getItem(Ge);t&&(R=JSON.parse(t)??X)}catch{}return(R||X)[e]},qa=(e,t)=>{try{R={...R||X,[e]:t},localStorage.setItem(Ge,JSON.stringify(R))}catch(n){console.error("unable to set feature flag",n)}},Za=(e,t)=>t.includes(e);var Be=new w(Date.now()),Ke=0,ri=()=>Math.floor(Be.next()*2**31),oi=e=>{Be=new w(e),Ke=0},si=()=>j()?`id${Ke++}`:ke();p();var Ve=ee(We(),1);var Tn=e=>(e=e.trim(),e&&(0,Ve.sanitizeUrl)(He(e))),pi=e=>!!(e?.includes(location.origin)||e?.startsWith("/")),di=e=>{if(e=Tn(e),e.startsWith("/"))return`${location.origin}${e}`;try{new URL(e)}catch{return"about:blank"}return e};p();var G=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 Ye=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 G,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(!Ne()&&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 $e=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)),bn=e=>F(e.reduce((t,n)=>t+n)/e.length),q=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((a,l)=>a+l),i=F(s/e.FRAME_COUNT);console.info(t,`- ${r.length} calls - ${i}ms/frame across ${e.FRAME_COUNT} frames (${F(i/16.67*100,1)}% of frame budget)`),e.TIMES_AVG[t]={t:n,times:[],avg:o!=null?bn([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];ze(a,l)||(s[i]={prev:a,next:l})}Object.keys(s).length>0&&console.info(`[${t}] changed:`,s)}};function ze(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(!ze(e[o],t[o]))return!1;return!0}export{Yr as ACTIVE_THRESHOLD,wr as ALLOWED_PASTE_MIME_TYPES,Jn as APP_NAME,so as ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO,oo as ARROW_LABEL_WIDTH_FRACTION,So as ARROW_TYPE,Ye as AppEventBus,Fo as BIND_MODE_TIMEOUT,ro as BOUND_TEXT_PADDING,Hn as BUCKET_FILL_BACKGROUND_PICKS,te as BinaryHeap,Rr as CANVAS_ONLY_ACTIONS,To as CANVAS_SEARCH_TAB,Ee as CJK_HAND_DRAWN_FALLBACK_FONT,fr as CLASSES,we as CODES,Pn as COLORS_PER_ROW,Sr as COLOR_CHARCOAL_BLACK,$n as COLOR_OUTLINE_CONTRAST_THRESHOLD,d as COLOR_PALETTE,kn as COLOR_TOP_PICKS_SLOTS,Mr as COLOR_VOICE_CALL,vr as COLOR_WHITE,cr as CURSOR_TYPE,Er as DARK_THEME_FILTER,po as DEFAULT_ADAPTIVE_RADIUS,Gn as DEFAULT_CANVAS_BACKGROUND_PICKS,Dn as DEFAULT_CHART_COLOR_INDEX,yr as DEFAULT_COLLISION_THRESHOLD,v as DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX,Kn as DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE,Nn as DEFAULT_ELEMENT_BACKGROUND_PICKS,Eo as DEFAULT_ELEMENT_PROPS,D as DEFAULT_ELEMENT_STROKE_COLOR_INDEX,Bn as DEFAULT_ELEMENT_STROKE_COLOR_PALETTE,Un as DEFAULT_ELEMENT_STROKE_PICKS,Gt as DEFAULT_ELEMENT_STROKE_WIDTH_KEY,Zr as DEFAULT_EXPORT_PADDING,Ao as DEFAULT_FILENAME,_r as DEFAULT_FONT_FAMILY,gr as DEFAULT_FONT_SIZE,Or as DEFAULT_GRID_SIZE,Lr as DEFAULT_GRID_STEP,Qr as DEFAULT_IMAGE_OPTIONS,lr 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,xr as DEFAULT_TEXT_ALIGN,Pt as DEFAULT_TRANSFORM_HANDLE_SPACING,Xr as DEFAULT_UI_OPTIONS,_e as DEFAULT_VERSION,Ar as DEFAULT_VERTICAL_ALIGN,wo as DOUBLE_TAP_POSITION_THRESHOLD,tr as DRAGGING_THRESHOLD,q as Debug,xo as EDITOR_LS_KEYS,Ro as ELEMENT_LINK_KEY,co as ELEMENT_PENDING_DRAW_SHAPE_OPACITY,lo as ELEMENT_READY_TO_ERASE_OPACITY,or as ELEMENT_SHIFT_TRANSLATE_AMOUNT,sr as ELEMENT_TRANSLATE_AMOUNT,to as ENCRYPTION_KEY_BITS,k as ENV,kt as EPSILON,Ft as EVENT,Ir as EXPORT_DATA_TYPES,Fr as EXPORT_IMAGE_TYPES,qr as EXPORT_SCALES,G as Emitter,T as FONT_FAMILY,Y as FONT_FAMILY_FALLBACKS,It as FONT_FAMILY_GENERIC_FALLBACKS,U as FONT_METADATA,hr as FONT_SIZES,Tr as FRAME_STYLE,Ht as FREEDRAW_STROKE_WIDTH,No as GOOGLE_FONTS_RANGES,Wr as HYPERLINK_TOOLTIP_DELAY,Vr as IDLE_THRESHOLD,xe as IMAGE_MIME_TYPES,Pr as IMAGE_RENDER_TIMEOUT,M as KEYS,Xt as KeyCodeMap,go as LIBRARY_DISABLED_TYPES,Bt as LIBRARY_SIDEBAR_TAB,rr as LINE_CONFIRM_THRESHOLD,Lo as LINE_POLYGON_POINT_MERGE_DISTANCE,Ho as LOCAL_FONT_PROTOCOL,Cn as MAX_CUSTOM_COLORS_USED_IN_CANVAS,jr as MAX_DECIMALS_FOR_SVG_EXPORT,Kr as MAX_ZOOM,me as MIME_TYPES,nr as MINIMUM_ARROW_SIZE,br as MIN_FONT_SIZE,vo as MIN_WIDTH_OR_HEIGHT,Br as MIN_ZOOM,Io as MOBILE_ACTION_BUTTON_BG,be 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,ur as POINTER_BUTTON,pr as POINTER_EVENTS,Pe as PromisePool,ye as Queue,Nt as ROUGHNESS,fo as ROUNDNESS,Te as SANS_SERIF_GENERIC_FONT,Hr as SCROLL_TIMEOUT,ir as SHIFT_LOCKING_ANGLE,Dt as SIDE_RESIZING_THRESHOLD,yo as STATS_PANELS,Ut as STRING_MIME_TYPES,Ae as STROKE_WIDTH,ho as STROKE_WIDTH_KEYS,eo as SVG_DOCUMENT_PREAMBLE,Jr as SVG_NS,Dr as TAP_TWICE_TIMEOUT,io as TEXT_ALIGN,er as TEXT_AUTOWRAP_THRESHOLD,ar as TEXT_TO_CENTER_SNAP_THRESHOLD,mr as THEME,Ur as TITLE_TIMEOUT,_o as TOOL_TYPE,kr as TOUCH_CTX_MENU_TIMEOUT,zr as URL_HASH_KEYS,$r as URL_QUERY_KEYS,Kt as UserIdleState,no as VERSIONS,Nr as VERSION_TIMEOUT,ao as VERTICAL_ALIGN,$e as VersionedSnapshotStore,L as WINDOWS_EMOJI_FALLBACK_FONT,dr as YOUTUBE_STATES,Gr as ZOOM_STEP,Ba as addEventListener,na as allowFullScreen,Fn as applyDarkModeFilter,va as arrayToList,xa as arrayToMap,Aa as arrayToMapWithIndex,ya as arrayToObject,Da as assertNever,ga as bytesToHexString,Gs as capitalizeString,za as castArray,js as chunk,Ha as cloneJSON,Vn as colorToHex,Pa as composeEventHandlers,as as createUserAgentDescriptor,$s as debounce,ss as deriveStylesPanelMode,Qs as distance,Xs as easeOut,He as escapeDoubleQuotes,ra as exitFullScreen,ua as findIndex,pa as findLastIndex,Ta as focusNearestParent,Wn as getAllColorsSpecificShade,Hs as getDateTime,Cr as getExportSource,ja as getFeatureFlag,ge as getFontFamilyFallbacks,Qt as getFontFamilyString,Vs as getFontString,os as getFormFactor,rn as getFrame,Ct as getGenericFontFamilyFallback,aa as getGlobalCSSVariable,As as getGridPoint,Bo as getLineHeight,Ea as getNearestScrollableContainer,_s as getSizeFromPoints,mo as getStrokeWidthByKey,Ka as getSvgPathFromStroke,_a as getUpdatedTimestamp,ha as getVersion,Go as getVerticalOffset,ka as invariant,Oe as isAndroid,Ya as isAnyTrue,fs as isArrowKey,yn as isBounds,rs as isBrave,Wt as isChrome,zn as isColorDark,Re as isDarwin,Ma as isDevEnv,ts as isFirefox,ta as isFullScreen,Le as isIOS,Zt as isInputLike,Ks as isInteractive,jt as isLatinChar,pi as isLocalLink,Na as isMemberOf,Vt as isMobileBreakpoint,Yn as isOpaqueColor,wa as isPrimitive,Ne as isProdEnv,Ia as isPromiseLike,ia as isRTL,sn as isReadonlyArray,Fa as isRunningInIframe,ns as isSafari,Js as isSelectionLikeTool,Ra as isServerEnv,on as isShallowEqual,Yt as isTabletBreakpoint,j as isTestEnv,Bs as isToolIcon,he as isTransparent,es as isWindows,Ws as isWritableElement,is as loadDesktopUIModePreference,da as mapFind,ds as matchKey,Ua as memoize,ca as muteFSAbortError,fa as nFormatter,Ys as nextAnimationFrame,Wa as normalizeEOL,Xn as normalizeInputColor,Tn as normalizeLink,Za as oneOf,ba as preventUnload,Se as promiseTry,Ca as queryFocusableElements,si as randomId,ri as randomInteger,Xa as reduceToCommonValue,In as removeDarkModeFilter,Zs as removeSelection,xs as rescalePoints,oi as reseed,ve as resolvablePromise,V as rgbToHex,$a as safelyParseJSON,sa as sceneCoordsToViewportCoords,qs as selectNode,Ns as setDateTimeForTests,ls as setDesktopUIMode,qa as setFeatureFlag,ms as shouldMaintainAspectRatio,hs as shouldResizeFromCenter,Es as shouldRotateWithDiscreteAngle,an as sizeOf,ma as supportsEmoji,Qn as supportsResizeObserver,zs as throttleRAF,Sa as toArray,Va as toBrandedType,nn as toIterable,di as toValidURL,la as tupleToCoors,ea as updateActiveTool,La as updateObject,Ga as updateStable,oa as viewportCoordsToSceneCoords,Oa as wrapEvent};
3
+ `,_o=128,xo={excalidraw:2,excalidrawLibrary:2},Ao=5,yo=.7,vo=11,So={TOP:"top",MIDDLE:"middle",BOTTOM:"bottom"},Mo={LEFT:"left",CENTER:"center",RIGHT:"right"},Ro=20,Oo=70,Lo=.25,Io=32,wo={LEGACY:1,PROPORTIONAL_RADIUS:2,ADAPTIVE_RADIUS:3},Wt={architect:0,artist:1,cartoonist:2},Fo=["thin","medium","bold"],ve={thin:1,medium:2,bold:4,extraBold:8},Yt={thin:.5,medium:1,bold:2,extraBold:4},Co=(e,t)=>e==="freedraw"?Yt[t]:ve[t],Vt="medium",Po={strokeColor:d.black,backgroundColor:d.transparent,fillStyle:"solid",strokeWidth:ve[Vt],strokeStyle:"solid",roughness:Wt.artist,opacity:100,locked:!1},$t="library",Do="search",No={name:"default",defaultTab:$t},ko=new Set(["iframe","embeddable","image"]),Uo={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",stickynote:"stickynote",embeddable:"embeddable",laser:"laser",autoshape:"autoshape",bucketfill:"bucketfill"},Ho={OAI_API_KEY:"excalidraw-oai-api-key",MERMAID_TO_EXCALIDRAW:"mermaid-to-excalidraw",PUBLISH_LIBRARY:"publish-library-data"},Go="Untitled",Ko={generalStats:1,elementProperties:2},Bo=1,Wo={sharp:"sharp",round:"round",elbow:"elbow"},Yo=.3,Vo="element",$o=Symbol.for("__test__originalId__"),zt=(r=>(r.ACTIVE="active",r.AWAY="away",r.IDLE="idle",r))(zt||{}),zo=20,Xo=35,jo=700,qo={background:"var(--mobile-action-button-bg)"},Zo=.5,Qo=.2;p();var U={[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}},rs={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"},os="local:",ss=(e,t,n)=>{let{unitsPerEm:r,ascender:o,descender:s}=U[e]?.metrics||U[T.Excalifont].metrics,a=t/r,i=(n-a*o+a*s)/2;return a*o+i},is=e=>{let{lineHeight:t}=U[e]?.metrics||U[T.Excalifont].metrics;return t};p();var Se=class{jobs=[];running=!1;tick(){if(this.running)return;let t=this.jobs.shift();t?(this.running=!0,t.promise.resolve(Re(t.jobFactory,...t.args).finally(()=>{this.running=!1,this.tick()}))):this.running=!1}push(t,...n){let r=Me();return this.jobs.push({jobFactory:t,promise:r,args:n}),this.tick(),r}};p();p();var Oe="excalidraw.desktopUIMode",ds=599,fs=1e3,hs=500,ms=600,Es=1180,Ts=1440,bs=1229,Le=/Mac|iPod|iPhone|iPad/.test(navigator.platform),gs=/^Win/.test(navigator.platform),Ie=/\b(android)\b/i.test(navigator.userAgent),_s=typeof window<"u"&&"netscape"in window&&navigator.userAgent.indexOf("rv:")>1&&navigator.userAgent.indexOf("Gecko")>1,Xt=navigator.userAgent.indexOf("Chrome")!==-1,xs=!Xt&&navigator.userAgent.indexOf("Safari")!==-1,we=/iPad|iPhone/i.test(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document,As=()=>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(we)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},ys=(e,t)=>jt(e,t)?"phone":qt(e,t)?"tablet":"desktop",vs=e=>e.formFactor==="phone"?"mobile":e.formFactor==="tablet"?"compact":e.desktopUIMode,Ss=e=>{let t=e??"",n="unknown";return we?n="ios":Ie?n="android":t&&(n="other"),{isMobileDevice:Zt(),platform:n}},Ms=()=>{if(typeof window>"u")return null;try{let e=window.localStorage.getItem(Oe);if(e==="compact"||e==="full")return e}catch{}return null},Qt=e=>{if(!(typeof window>"u"))try{window.localStorage.setItem(Oe,e)}catch{}},Rs=e=>{if(!(e!=="compact"&&e!=="full"))return Qt(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:Le?"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",N:"n",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]]),en=e=>/^[a-z]$/.test(e.toLowerCase()),ws=(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===M.ARROW_LEFT||e===M.ARROW_RIGHT||e===M.ARROW_DOWN||e===M.ARROW_UP,Cs=e=>e.altKey,Ps=e=>e.shiftKey,Ds=e=>e.shiftKey;p();import{pointFrom as Ce,pointFromPair as tn}from"@excalidraw/math";var Hs=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)}},Gs=(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,F=[...y];return F[e]=S,S<u&&(u=S),F});if(!r||m.length===2)return m;let b=a-u;return m.map(y=>tn(y.map((S,F)=>F===e?S+b:S)))},Ks=(e,t,n)=>n?Ce(Math.round(e/n)*n,Math.round(t/n)*n):Ce(e,t);p();var ke=te(De(),1),Ne=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 I=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,ri=e=>{X=e},oi=()=>{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}`},si=e=>e.charAt(0).toUpperCase()+e.slice(1),G=e=>e?.ownerDocument?.defaultView??(typeof window>"u"?null:window),ii=e=>{let t=G(e);return!!t&&e instanceof t.HTMLElement&&e.className.includes("ToolIcon")},nn=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)},ai=e=>{let t=G(e);return nn(e)||!!t&&e instanceof t.Element&&!!e.closest("label, button")},li=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)},rn=({fontFamily:e})=>{for(let[t,n]of Object.entries(T))if(n===e)return`${t}${xe(n).map(r=>`, ${r}`).join("")}`;return L},ci=({fontSize:e,fontFamily:t})=>`${e}px ${rn({fontFamily:t})}`,ui=async e=>{requestAnimationFrame(()=>requestAnimationFrame(e))},pi=(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},di=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},fi=e=>1-Math.pow(1-e,4),hi=(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},mi=e=>{let t=window.getSelection();if(t){let n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}},Ei=()=>{let e=window.getSelection();e&&e.removeAllRanges()},Ti=(e,t)=>Math.abs(e-t),bi=e=>e==="selection"||e==="lasso",gi=(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},_i=()=>document.fullscreenElement?.nodeName==="HTML",xi=()=>document.documentElement.requestFullscreen(),Ai=()=>document.exitFullscreen(),yi=({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}},vi=({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}},Si=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}]`),Mi=e=>an.test(e),Ri=e=>{let[t,n]=e;return{x:t,y:n}},Oi=e=>{if(e?.name==="AbortError"){console.warn(e);return}throw e},Li=(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},Ii=(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},wi=(e,t)=>{for(let n=0;n<e.length;n++){let r=t(e[n],n);if(r!=null)return r}},Me=()=>{let e,t,n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n},Fi=(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},Ci=()=>document.querySelector('meta[name="version"]')?.content||Ae,Pi=()=>{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},Di=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},Ni=e=>{let t=e.parentElement;for(;t;){if(t.tabIndex>-1){t.focus();return}t=t.parentElement}},ki=e=>{e.preventDefault(),e.returnValue=""},Ui=e=>Array.from(e).map(t=>`0${t.toString(16)}`.slice(-2)).join(""),Hi=()=>q()?1:Date.now(),Gi=e=>e instanceof Map?e:e.reduce((t,n)=>(t.set(typeof n=="string"?n:n.id,n),t),new Map),Ki=e=>e.reduce((t,n,r)=>(t.set(n.id,[n,r]),t),new Map),Bi=(e,t)=>e.reduce((n,r,o)=>(n[t?t(r):o]=r,n),{}),Wi=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},[]),ln=e=>Array.isArray(e)?e:e.values(),Yi=e=>Array.isArray(e)?e:Array.from(ln(e)),q=()=>h.MODE===k.TEST,Vi=()=>h.MODE===k.DEVELOPMENT,Ge=()=>h.MODE===k.PRODUCTION,$i=()=>typeof process<"u"&&!0,zi=(e,t)=>new CustomEvent(e,{detail:{nativeEvent:t},cancelable:!0}),Xi=(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},ji=e=>{let t=typeof e;return e==null||t!=="object"&&t!=="function"},cn=()=>{try{return window.self===window.top?"top":"iframe"}catch{return"iframe"}},qi=()=>cn()==="iframe",Zi=e=>!!e&&typeof e=="object"&&"then"in e&&"catch"in e&&"finally"in e,Qi=e=>{let t=e?.querySelectorAll("button, a, input, select, textarea, div[tabindex], label[tabindex]");return t?Array.from(t).filter(n=>n.tabIndex>-1&&!n.disabled):[]},He=(e,t)=>Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t,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 a of n)if(!(e[a]===t[a]||He(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]||He(e[a],t[a]);return!l&&r&&console.warn(`%cisShallowEqual: ${a} not equal ->`,"color: #8B4000",e[a],t[a]),l})},Ji=(e,t,{checkForDefaultPrevented:n=!0}={})=>function(o){if(e?.(o),!n||!o?.defaultPrevented)return t?.(o)},ea=(e,t,n)=>{if(!t)return e;if(n)return console.error(t),e;throw new Error(t)};function ta(e,t){if(!e)throw new Error(t)}var na=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},ra=(e,t)=>e instanceof Set||e instanceof Map?e.has(t):"includes"in e?e.includes(t):e.hasOwnProperty(t),oa=e=>JSON.parse(JSON.stringify(e)),sa=(e,t)=>un(e,t)?e:t;function ia(e,t,n,r){return e?(e?.addEventListener?.(t,n,r),()=>{e?.removeEventListener?.(t,n,r)}):()=>{}}function aa(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 la=e=>e.replace(/\r?\n|\r/g,`
4
+ `);function ca(e){return e}var Re=async(e,...t)=>new Promise(n=>{n(e(...t))}),ua=(...e)=>Math.max(...e.map(t=>t?1:0))>0,pa=e=>{try{return JSON.parse(e)}catch{return null}},Ke=e=>e.replace(/"/g,"&quot;"),da=e=>Array.isArray(e)?e:[e],pn=e=>Array.isArray(e),dn=e=>pn(e)?e.length:e instanceof Map||e instanceof Set?e.size:Object.keys(e).length,fa=(e,t)=>{if(dn(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,ha=e=>{if(!R)try{let t=localStorage.getItem(Be);t&&(R=JSON.parse(t)??j)}catch{}return(R||j)[e]},ma=(e,t)=>{try{R={...R||j,[e]:t},localStorage.setItem(Be,JSON.stringify(R))}catch(n){console.error("unable to set feature flag",n)}},Ea=(e,t)=>t.includes(e);var We=new I(Date.now()),Ye=0,Aa=()=>Math.floor(We.next()*2**31),ya=e=>{We=new I(e),Ye=0},va=()=>q()?`id${Ye++}`:Ue(),Sa=e=>{let t=e>>>0;return()=>{t+=1831565813;let n=t;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}};p();var $e=te(Ve(),1);var An=e=>(e=e.trim(),e&&(0,$e.sanitizeUrl)(Ke(e))),wa=e=>!!(e?.includes(location.origin)||e?.startsWith("/")),Fa=e=>{if(e=An(e),e.startsWith("/"))return`${location.origin}${e}`;try{new URL(e)}catch{return"about:blank"}return e};p();var B=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 ze=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 B,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(!Ge()&&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 Xe=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 w=(e,t=5)=>parseFloat(e.toPrecision(t)),yn=e=>w(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,w(r.reduce((o,s)=>o+s)),r.sort((o,s)=>o-s).map(o=>w(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=w(s/e.FRAME_COUNT);console.info(t,`- ${r.length} calls - ${a}ms/frame across ${e.FRAME_COUNT} frames (${w(a/16.67*100,1)}% of frame budget)`),e.TIMES_AVG[t]={t:n,times:[],avg:o!=null?yn([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];je(i,l)||(s[a]={prev:i,next:l})}Object.keys(s).length>0&&console.info(`[${t}] changed:`,s)}};function je(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(!je(e[o],t[o]))return!1;return!0}export{co as ACTIVE_THRESHOLD,Xr as ALLOWED_PASTE_MIME_TYPES,ir as APP_NAME,vo as ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO,yo as ARROW_LABEL_WIDTH_FRACTION,Wo as ARROW_TYPE,ze as AppEventBus,jo as BIND_MODE_TIMEOUT,Ao as BOUND_TEXT_PADDING,Wn as BUCKET_FILL_BACKGROUND_PICKS,ne as BinaryHeap,Vr as CANVAS_ONLY_ACTIONS,Do as CANVAS_SEARCH_TAB,be as CJK_HAND_DRAWN_FALLBACK_FONT,_r as CLASSES,Fe as CODES,Hn as COLORS_PER_ROW,Wr as COLOR_CHARCOAL_BLACK,Jn as COLOR_OUTLINE_CONTRAST_THRESHOLD,d as COLOR_PALETTE,Kn as COLOR_TOP_PICKS_SLOTS,Yr as COLOR_VOICE_CALL,Br as COLOR_WHITE,Er as CURSOR_TYPE,yr as DARK_THEME_FILTER,Io as DEFAULT_ADAPTIVE_RADIUS,$n as DEFAULT_CANVAS_BACKGROUND_PICKS,Gn as DEFAULT_CHART_COLOR_INDEX,Kr as DEFAULT_COLLISION_THRESHOLD,v as DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX,Xn as DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE,Bn as DEFAULT_ELEMENT_BACKGROUND_PICKS,Po as DEFAULT_ELEMENT_PROPS,D as DEFAULT_ELEMENT_STROKE_COLOR_INDEX,zn as DEFAULT_ELEMENT_STROKE_COLOR_PALETTE,Ft as DEFAULT_ELEMENT_STROKE_PICKS,Vt as DEFAULT_ELEMENT_STROKE_WIDTH_KEY,Eo as DEFAULT_EXPORT_PADDING,Go as DEFAULT_FILENAME,Ur as DEFAULT_FONT_FAMILY,Mr as DEFAULT_FONT_SIZE,$r as DEFAULT_GRID_SIZE,zr as DEFAULT_GRID_STEP,To as DEFAULT_IMAGE_OPTIONS,mr as DEFAULT_LASER_COLOR,Lo as DEFAULT_PROPORTIONAL_RADIUS,Yo as DEFAULT_REDUCED_GLOBAL_ALPHA,No as DEFAULT_SIDEBAR,me as DEFAULT_STICKY_NOTE_BG,Fr as DEFAULT_STICKY_NOTE_SIZE,Zo as DEFAULT_STROKE_STREAMLINE,Qo as DEFAULT_STROKE_STREAMLINE_PRECISE,Hr as DEFAULT_TEXT_ALIGN,Ht as DEFAULT_TRANSFORM_HANDLE_SPACING,fo as DEFAULT_UI_OPTIONS,Ae as DEFAULT_VERSION,Gr as DEFAULT_VERTICAL_ALIGN,Xo as DOUBLE_TAP_POSITION_THRESHOLD,lr as DRAGGING_THRESHOLD,Z as Debug,Ho as EDITOR_LS_KEYS,Vo as ELEMENT_LINK_KEY,Oo as ELEMENT_PENDING_DRAW_SHAPE_OPACITY,Ro as ELEMENT_READY_TO_ERASE_OPACITY,pr as ELEMENT_SHIFT_TRANSLATE_AMOUNT,dr as ELEMENT_TRANSLATE_AMOUNT,_o as ENCRYPTION_KEY_BITS,k as ENV,Kt as EPSILON,Pt as EVENT,qr as EXPORT_DATA_TYPES,jr as EXPORT_IMAGE_TYPES,mo as EXPORT_SCALES,B as Emitter,T as FONT_FAMILY,$ as FONT_FAMILY_FALLBACKS,Dt as FONT_FAMILY_GENERIC_FALLBACKS,U as FONT_METADATA,xr as FONT_SIZES,vr as FRAME_STYLE,Yt as FREEDRAW_STROKE_WIDTH,rs as GOOGLE_FONTS_RANGES,ao as HYPERLINK_TOOLTIP_DELAY,lo as IDLE_THRESHOLD,ye as IMAGE_MIME_TYPES,Qr as IMAGE_RENDER_TIMEOUT,M as KEYS,Jt as KeyCodeMap,ko as LIBRARY_DISABLED_TYPES,$t as LIBRARY_SIDEBAR_TAB,ur as LINE_CONFIRM_THRESHOLD,zo as LINE_POLYGON_POINT_MERGE_DISTANCE,os as LOCAL_FONT_PROTOCOL,Un as MAX_CUSTOM_COLORS_USED_IN_CANVAS,ho as MAX_DECIMALS_FOR_SVG_EXPORT,io as MAX_ZOOM,Te as MIME_TYPES,cr as MINIMUM_ARROW_SIZE,Sr as MIN_FONT_SIZE,Bo as MIN_WIDTH_OR_HEIGHT,so as MIN_ZOOM,qo as MOBILE_ACTION_BUTTON_BG,_e as MONOSPACE_GENERIC_FONT,hs as MQ_MAX_HEIGHT_LANDSCAPE,ds as MQ_MAX_MOBILE,Es as MQ_MAX_TABLET,fs as MQ_MAX_WIDTH_LANDSCAPE,ms as MQ_MIN_TABLET,Ts as MQ_MIN_WIDTH_DESKTOP,bs as MQ_RIGHT_SIDEBAR_MIN_WIDTH,$o as ORIG_ID,Tr as POINTER_BUTTON,br as POINTER_EVENTS,Ne as PromisePool,Se as Queue,Wt as ROUGHNESS,wo as ROUNDNESS,ge as SANS_SERIF_GENERIC_FONT,ro as SCROLL_TIMEOUT,hr as SHIFT_LOCKING_ANGLE,Gt as SIDE_RESIZING_THRESHOLD,Ko as STATS_PANELS,Vn as STICKY_NOTE_BACKGROUND_PICKS,wr as STICKY_NOTE_BODY_INSET_Y,kr as STICKY_NOTE_EDGE_SHADOW_OPACITY,Nr as STICKY_NOTE_EDGE_SHADOW_WIDTH,Lr as STICKY_NOTE_FALLBACK_FONT_SIZE,Ir as STICKY_NOTE_FONT_STEP,Ut as STICKY_NOTE_FOOTER,Or as STICKY_NOTE_MAX_FONT_SIZE,Rr as STICKY_NOTE_MIN_FONT_SIZE,Cr as STICKY_NOTE_MIN_SIZE,kt as STICKY_NOTE_PADDING,Pr as STICKY_NOTE_SHADOW_OFFSET,Dr as STICKY_NOTE_SHADOW_OPACITY,Yn as STICKY_NOTE_STROKE_PICKS,Bt as STRING_MIME_TYPES,ve as STROKE_WIDTH,Fo as STROKE_WIDTH_KEYS,go as SVG_DOCUMENT_PREAMBLE,bo as SVG_NS,Jr as TAP_TWICE_TIMEOUT,Mo as TEXT_ALIGN,ar as TEXT_AUTOWRAP_THRESHOLD,fr as TEXT_TO_CENTER_SNAP_THRESHOLD,Ar as THEME,to as TITLE_TIMEOUT,Uo as TOOL_TYPE,eo as TOUCH_CTX_MENU_TIMEOUT,po as URL_HASH_KEYS,uo as URL_QUERY_KEYS,zt as UserIdleState,xo as VERSIONS,no as VERSION_TIMEOUT,So as VERTICAL_ALIGN,Xe as VersionedSnapshotStore,L as WINDOWS_EMOJI_FALLBACK_FONT,gr as YOUTUBE_STATES,oo as ZOOM_STEP,ia as addEventListener,xi as allowFullScreen,Nn as applyDarkModeFilter,Wi as arrayToList,Gi as arrayToMap,Ki as arrayToMapWithIndex,Bi as arrayToObject,ea as assertNever,Ui as bytesToHexString,si as capitalizeString,da as castArray,hi as chunk,oa as cloneJSON,Zn as colorToHex,Ji as composeEventHandlers,Ss as createUserAgentDescriptor,pi as debounce,vs as deriveStylesPanelMode,Ti as distance,fi as easeOut,Ke as escapeDoubleQuotes,Ai as exitFullScreen,Li as findIndex,Ii as findLastIndex,Ni as focusNearestParent,jn as getAllColorsSpecificShade,oi as getDateTime,Zr as getExportSource,ha as getFeatureFlag,xe as getFontFamilyFallbacks,rn as getFontFamilyString,ci as getFontString,ys as getFormFactor,cn as getFrame,Nt as getGenericFontFamilyFallback,Si as getGlobalCSSVariable,Ks as getGridPoint,is as getLineHeight,Di as getNearestScrollableContainer,Hs as getSizeFromPoints,Co as getStrokeWidthByKey,aa as getSvgPathFromStroke,Hi as getUpdatedTimestamp,Ci as getVersion,ss as getVerticalOffset,ta as invariant,Ie as isAndroid,ua as isAnyTrue,Fs as isArrowKey,On as isBounds,As as isBrave,Xt as isChrome,er as isColorDark,Le as isDarwin,Vi as isDevEnv,_s as isFirefox,_i as isFullScreen,we as isIOS,nn as isInputLike,ai as isInteractive,en as isLatinChar,wa as isLocalLink,ra as isMemberOf,jt as isMobileBreakpoint,Qn as isOpaqueColor,ji as isPrimitive,Ge as isProdEnv,Zi as isPromiseLike,Mi as isRTL,pn as isReadonlyArray,qi as isRunningInIframe,xs as isSafari,bi as isSelectionLikeTool,$i as isServerEnv,un as isShallowEqual,qt as isTabletBreakpoint,q as isTestEnv,ii as isToolIcon,Ee as isTransparent,gs as isWindows,li as isWritableElement,Ms as loadDesktopUIModePreference,wi as mapFind,ws as matchKey,na as memoize,Oi as muteFSAbortError,Fi as nFormatter,ui as nextAnimationFrame,la as normalizeEOL,tr as normalizeInputColor,An as normalizeLink,Ea as oneOf,ki as preventUnload,Re as promiseTry,Qi as queryFocusableElements,va as randomId,Aa as randomInteger,fa as reduceToCommonValue,kn as removeDarkModeFilter,Ei as removeSelection,Gs as rescalePoints,ya as reseed,Me as resolvablePromise,N as rgbToHex,pa as safelyParseJSON,vi as sceneCoordsToViewportCoords,Sa as seededRandom,mi as selectNode,qn as setColorAlpha,ri as setDateTimeForTests,Rs as setDesktopUIMode,ma as setFeatureFlag,Ps as shouldMaintainAspectRatio,Cs as shouldResizeFromCenter,Ds as shouldRotateWithDiscreteAngle,dn as sizeOf,Pi as supportsEmoji,sr as supportsResizeObserver,di as throttleRAF,Yi as toArray,ca as toBrandedType,ln as toIterable,Fa as toValidURL,Ri as tupleToCoors,gi as updateActiveTool,Xi as updateObject,sa as updateStable,yi as viewportCoordsToSceneCoords,zi as wrapEvent};
@@ -36,6 +36,9 @@ export declare const COLOR_TOP_PICKS_SLOTS = 5;
36
36
  export declare const DEFAULT_ELEMENT_STROKE_PICKS: ColorTuple;
37
37
  export declare const DEFAULT_ELEMENT_BACKGROUND_PICKS: ColorTuple;
38
38
  export declare const BUCKET_FILL_BACKGROUND_PICKS: ColorTuple;
39
+ export declare const DEFAULT_STICKY_NOTE_BG = "#ffdf6b";
40
+ export declare const STICKY_NOTE_STROKE_PICKS: ColorTuple;
41
+ export declare const STICKY_NOTE_BACKGROUND_PICKS: ColorTuple;
39
42
  export declare const DEFAULT_CANVAS_BACKGROUND_PICKS: ColorTuple;
40
43
  export declare const DEFAULT_ELEMENT_STROKE_COLOR_PALETTE: {
41
44
  readonly cyan: readonly ["#e3fafc", "#99e9f2", "#3bc9db", "#15aabf", "#0c8599"];
@@ -73,6 +76,11 @@ export declare const DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE: {
73
76
  };
74
77
  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")[];
75
78
  export declare const rgbToHex: (r: number, g: number, b: number, a?: number) => string;
79
+ /**
80
+ * @returns the color with its alpha replaced by `alpha` (as #RRGGBBAA), or the
81
+ * input unchanged if it's not a valid color
82
+ */
83
+ export declare const setColorAlpha: (color: string, alpha: number) => string;
76
84
  /**
77
85
  * @returns #RRGGBB or #RRGGBBAA based on color containing non-opaque alpha,
78
86
  * null if not valid color
@@ -1,5 +1,6 @@
1
1
  import type { ExcalidrawElement, FontFamilyValues } from "@excalidraw/element/types";
2
2
  import type { AppProps, AppState } from "@excalidraw/excalidraw/types";
3
+ export { DEFAULT_STICKY_NOTE_BG } from "./colors";
3
4
  export declare const supportsResizeObserver: boolean;
4
5
  export declare const APP_NAME = "Excalidraw";
5
6
  export declare const TEXT_AUTOWRAP_THRESHOLD = 36;
@@ -52,6 +53,7 @@ export declare enum EVENT {
52
53
  POINTER_MOVE = "pointermove",
53
54
  POINTER_DOWN = "pointerdown",
54
55
  POINTER_UP = "pointerup",
56
+ POINTER_CANCEL = "pointercancel",
55
57
  STATE_CHANGE = "statechange",
56
58
  WHEEL = "wheel",
57
59
  TOUCH_START = "touchstart",
@@ -150,6 +152,47 @@ export declare const FRAME_STYLE: {
150
152
  };
151
153
  export declare const MIN_FONT_SIZE = 1;
152
154
  export declare const DEFAULT_FONT_SIZE = 20;
155
+ export declare const STICKY_NOTE_MIN_FONT_SIZE = 16;
156
+ export declare const STICKY_NOTE_MAX_FONT_SIZE = 512;
157
+ export declare const STICKY_NOTE_FALLBACK_FONT_SIZE = 28;
158
+ export declare const STICKY_NOTE_FONT_STEP = 2;
159
+ export declare const STICKY_NOTE_PADDING = 16;
160
+ /**
161
+ * The creation-date footer: a 20px text row under the label body plus a 12px
162
+ * gap above it, inside the note's bottom padding. Reserved for every note —
163
+ * also when `created` is unknown — so geometry never depends on data
164
+ * availability. The label is chosen by width bucket, never measured, so
165
+ * painting stays measurement-free (the server has no text measurer):
166
+ * `minBodyWidthForYear` is the worst case ("30 May 2026") in the system sans
167
+ * stack at 12px, with margin for wider fallbacks such as DejaVu Sans.
168
+ */
169
+ /**
170
+ * The creation-date footer of a sticky note. The label body ends `height`
171
+ * above the note's bottom padding, and the date's baseline sits
172
+ * `baselineFromBottom` above the note's bottom edge — so the 12px glyphs
173
+ * (~9px above the baseline, ~3px below) end up roughly 11px from the edge
174
+ * with a ~13px gap to the label body above them.
175
+ */
176
+ export declare const STICKY_NOTE_FOOTER: {
177
+ readonly height: 20;
178
+ readonly fontSize: 12;
179
+ readonly fontFamily: "Helvetica, Arial, sans-serif";
180
+ readonly baselineFromBottom: 14;
181
+ readonly opacity: 1;
182
+ readonly minBodyWidthForYear: 80;
183
+ };
184
+ /**
185
+ * outer height → label body height: top + bottom padding + footer. The body
186
+ * is what the label is fitted into; a middle-aligned label is still centered
187
+ * in the whole padded note when it fits (see `computeBoundTextPosition`).
188
+ */
189
+ export declare const STICKY_NOTE_BODY_INSET_Y: number;
190
+ export declare const DEFAULT_STICKY_NOTE_SIZE = 250;
191
+ export declare const STICKY_NOTE_MIN_SIZE = 75;
192
+ export declare const STICKY_NOTE_SHADOW_OFFSET = 3;
193
+ export declare const STICKY_NOTE_SHADOW_OPACITY = 0.16;
194
+ export declare const STICKY_NOTE_EDGE_SHADOW_WIDTH = 0.5;
195
+ export declare const STICKY_NOTE_EDGE_SHADOW_OPACITY = 0.08;
153
196
  export declare const DEFAULT_FONT_FAMILY: FontFamilyValues;
154
197
  export declare const DEFAULT_TEXT_ALIGN = "left";
155
198
  export declare const DEFAULT_VERTICAL_ALIGN = "top";
@@ -313,6 +356,7 @@ export declare const TOOL_TYPE: {
313
356
  readonly hand: "hand";
314
357
  readonly frame: "frame";
315
358
  readonly magicframe: "magicframe";
359
+ readonly stickynote: "stickynote";
316
360
  readonly embeddable: "embeddable";
317
361
  readonly laser: "laser";
318
362
  readonly autoshape: "autoshape";
@@ -55,6 +55,7 @@ export declare const KEYS: {
55
55
  readonly H: "h";
56
56
  readonly I: "i";
57
57
  readonly L: "l";
58
+ readonly N: "n";
58
59
  readonly O: "o";
59
60
  readonly P: "p";
60
61
  readonly Q: "q";
@@ -111,6 +112,7 @@ export declare const KeyCodeMap: Map<ValueOf<{
111
112
  readonly H: "h";
112
113
  readonly I: "i";
113
114
  readonly L: "l";
115
+ readonly N: "n";
114
116
  readonly O: "o";
115
117
  readonly P: "p";
116
118
  readonly Q: "q";
@@ -1,3 +1,10 @@
1
1
  export declare const randomInteger: () => number;
2
2
  export declare const reseed: (seed: number) => void;
3
3
  export declare const randomId: () => string;
4
+ /**
5
+ * Deterministic PRNG (mulberry32) for a given seed: same seed, same
6
+ * sequence — used where a render must be stable across frames and clients
7
+ * (e.g. the sticky note's corner jitter) and roughjs's `Random` is
8
+ * unsuitable (it degenerates for seed 0). Returns numbers in [0, 1).
9
+ */
10
+ export declare const seededRandom: (seed: number) => () => number;
@@ -72,7 +72,7 @@ export declare class Scene {
72
72
  getElementIndex(elementId: string): number;
73
73
  getContainerElement: (element: (ExcalidrawElement & {
74
74
  containerId: ExcalidrawElement["id"] | null;
75
- }) | null) => import("@excalidraw/element/types").ExcalidrawLinearElement | import("@excalidraw/element/types").ExcalidrawSelectionElement | import("@excalidraw/element/types").ExcalidrawRectangleElement | import("@excalidraw/element/types").ExcalidrawDiamondElement | import("@excalidraw/element/types").ExcalidrawEllipseElement | import("@excalidraw/element/types").ExcalidrawEmbeddableElement | import("@excalidraw/element/types").ExcalidrawIframeElement | import("@excalidraw/element/types").ExcalidrawImageElement | import("@excalidraw/element/types").ExcalidrawFrameElement | import("@excalidraw/element/types").ExcalidrawMagicFrameElement | import("@excalidraw/element/types").ExcalidrawTextElement | import("@excalidraw/element/types").ExcalidrawFreeDrawElement | null;
75
+ }) | null) => import("@excalidraw/element/types").ExcalidrawLinearElement | import("@excalidraw/element/types").ExcalidrawSelectionElement | import("@excalidraw/element/types").ExcalidrawRectangleElement | import("@excalidraw/element/types").ExcalidrawStickyNoteElement | import("@excalidraw/element/types").ExcalidrawDiamondElement | import("@excalidraw/element/types").ExcalidrawEllipseElement | import("@excalidraw/element/types").ExcalidrawEmbeddableElement | import("@excalidraw/element/types").ExcalidrawIframeElement | import("@excalidraw/element/types").ExcalidrawImageElement | import("@excalidraw/element/types").ExcalidrawFrameElement | import("@excalidraw/element/types").ExcalidrawMagicFrameElement | import("@excalidraw/element/types").ExcalidrawTextElement | import("@excalidraw/element/types").ExcalidrawFreeDrawElement | null;
76
76
  getElementsFromId: (id: string) => ExcalidrawElement[];
77
77
  mutateElement<TElement extends Mutable<ExcalidrawElement>>(element: TElement, updates: ElementUpdate<TElement>, options?: {
78
78
  informMutation: boolean;
@@ -1,9 +1,11 @@
1
1
  import type { ElementOrToolType } from "@excalidraw/excalidraw/types";
2
- export declare const hasBackground: (type: ElementOrToolType) => type is "line" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "iframe" | "freedraw" | "autoshape" | "bucketfill";
3
- export declare const hasStrokeColor: (type: ElementOrToolType) => type is "line" | "arrow" | "text" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "freedraw" | "autoshape";
2
+ export declare const hasBackground: (type: ElementOrToolType) => type is "line" | "rectangle" | "stickynote" | "diamond" | "ellipse" | "embeddable" | "iframe" | "freedraw" | "autoshape" | "bucketfill";
3
+ export declare const hasFillStyle: (type: ElementOrToolType) => type is "line" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "iframe" | "freedraw" | "autoshape" | "bucketfill";
4
+ export declare const hasStrokeColor: (type: ElementOrToolType) => type is "line" | "arrow" | "text" | "rectangle" | "stickynote" | "diamond" | "ellipse" | "embeddable" | "freedraw" | "autoshape";
4
5
  export declare const hasStrokeWidth: (type: ElementOrToolType) => type is "line" | "arrow" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "iframe" | "freedraw" | "autoshape";
5
6
  export declare const hasStrokeStyle: (type: ElementOrToolType) => type is "line" | "arrow" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "iframe" | "autoshape";
7
+ export declare const hasRoughness: (type: ElementOrToolType) => type is "line" | "arrow" | "rectangle" | "stickynote" | "diamond" | "ellipse" | "embeddable" | "iframe" | "autoshape";
6
8
  export declare const hasFreedrawMode: (type: ElementOrToolType) => type is "freedraw";
7
- export declare const canChangeRoundness: (type: ElementOrToolType) => type is "line" | "rectangle" | "diamond" | "embeddable" | "iframe" | "image";
9
+ export declare const canChangeRoundness: (type: ElementOrToolType) => type is "line" | "rectangle" | "stickynote" | "diamond" | "embeddable" | "iframe" | "image";
8
10
  export declare const toolIsArrow: (type: ElementOrToolType) => type is "arrow";
9
11
  export declare const canHaveArrowheads: (type: ElementOrToolType) => type is "arrow";
@@ -192,7 +192,29 @@ export declare class ElementsDelta implements DeltaContainer<SceneElementsMap> {
192
192
  private static createGetter;
193
193
  private static applyDelta;
194
194
  /**
195
- * Check for visible changes regardless of whether they were removed, added or updated.
195
+ * Whether an element looks different after the delta — and the layout that
196
+ * followed it — was applied. The input to history's "skip entries with no
197
+ * visible change" loop.
198
+ *
199
+ * Both sides are first reduced to what actually paints:
200
+ * - a missing or deleted element paints nothing;
201
+ * - an empty text element paints nothing either — unless it carries arrow
202
+ * bindings (an arrow may end at it) or sits on an arrow (an empty label
203
+ * still cuts the arrow's gap);
204
+ * so an empty label's deletion or restoration compares as nothing against
205
+ * nothing. Two painting elements are then compared property by property:
206
+ * - `version`, `versionNonce`, `updated`, `created` are metadata, and
207
+ * `index` is covered by the separate z-order check (`reorderElements`);
208
+ * - `boundElements` is compared as `type:id` references with references to
209
+ * empty labels dropped, so adding or removing an empty label's reference
210
+ * is not visible on its own, and binding repair that rebuilt equal
211
+ * objects is not either;
212
+ * - everything else counts. Nested arrays (`points`, binding fixed points)
213
+ * compare by reference, which can only over-report a change — the safe
214
+ * direction, where undo stops one entry early.
215
+ *
216
+ * `previousElements` holds only `idsToCheck` (see `applyTo`); the label
217
+ * lookups it serves are for elements whose labels are in that set.
196
218
  */
197
219
  private static checkForVisibleDifference;
198
220
  /**
@@ -1,7 +1,11 @@
1
1
  import type { AppState, PendingExcalidrawElements } from "@excalidraw/excalidraw/types";
2
- import { type NonDeleted, type ElementsMap, type ExcalidrawElement, type ExcalidrawFlowchartNodeElement } from "./types";
2
+ import { type NonDeleted, type ElementsMap, type ExcalidrawElement, type ExcalidrawFlowchartNodeElement, type NonDeletedExcalidrawElement } from "./types";
3
3
  import type { Scene } from "./Scene";
4
4
  export type LinkDirection = "up" | "right" | "down" | "left";
5
+ export declare const addNewNodes: (startNode: NonDeleted<ExcalidrawFlowchartNodeElement>, appState: AppState, direction: LinkDirection, scene: Scene, numberOfNodes: number, stickyCrossStart?: number | null) => {
6
+ nodes: NonDeletedExcalidrawElement[];
7
+ crossStart: number;
8
+ };
5
9
  export declare class FlowChartNavigator {
6
10
  isExploring: boolean;
7
11
  private sameLevelNodes;
@@ -31,8 +31,8 @@ export declare const getFrameLikeElements: (allElements: ExcalidrawElementsInclu
31
31
  */
32
32
  export declare const getRootElements: <T extends ExcalidrawElement>(allElements: readonly T[]) => T[];
33
33
  export declare const getElementsInResizingFrame: (allElements: ExcalidrawElementsIncludingDeleted, frame: ExcalidrawFrameLikeElement, appState: AppState, elementsMap: ElementsMap) => ExcalidrawElement[];
34
- export declare const getElementsInNewFrame: (elements: ExcalidrawElementsIncludingDeleted, frame: ExcalidrawFrameLikeElement, elementsMap: ElementsMap) => (import("./types").ExcalidrawLinearElement | import("./types").ExcalidrawSelectionElement | import("./types").ExcalidrawRectangleElement | import("./types").ExcalidrawDiamondElement | import("./types").ExcalidrawEllipseElement | import("./types").ExcalidrawEmbeddableElement | import("./types").ExcalidrawIframeElement | import("./types").ExcalidrawImageElement | import("./types").ExcalidrawFrameElement | import("./types").ExcalidrawMagicFrameElement | import("./types").ExcalidrawTextElement | import("./types").ExcalidrawFreeDrawElement)[];
35
- export declare const omitPartialGroups: (elements: ExcalidrawElement[], frame: ExcalidrawFrameLikeElement, allElementsMap: ElementsMap) => (import("./types").ExcalidrawLinearElement | import("./types").ExcalidrawSelectionElement | import("./types").ExcalidrawRectangleElement | import("./types").ExcalidrawDiamondElement | import("./types").ExcalidrawEllipseElement | import("./types").ExcalidrawEmbeddableElement | import("./types").ExcalidrawIframeElement | import("./types").ExcalidrawImageElement | import("./types").ExcalidrawFrameElement | import("./types").ExcalidrawMagicFrameElement | import("./types").ExcalidrawTextElement | import("./types").ExcalidrawFreeDrawElement)[];
34
+ export declare const getElementsInNewFrame: (elements: ExcalidrawElementsIncludingDeleted, frame: ExcalidrawFrameLikeElement, elementsMap: ElementsMap) => (import("./types").ExcalidrawLinearElement | import("./types").ExcalidrawSelectionElement | import("./types").ExcalidrawRectangleElement | import("./types").ExcalidrawStickyNoteElement | import("./types").ExcalidrawDiamondElement | import("./types").ExcalidrawEllipseElement | import("./types").ExcalidrawEmbeddableElement | import("./types").ExcalidrawIframeElement | import("./types").ExcalidrawImageElement | import("./types").ExcalidrawFrameElement | import("./types").ExcalidrawMagicFrameElement | import("./types").ExcalidrawTextElement | import("./types").ExcalidrawFreeDrawElement)[];
35
+ export declare const omitPartialGroups: (elements: ExcalidrawElement[], frame: ExcalidrawFrameLikeElement, allElementsMap: ElementsMap) => (import("./types").ExcalidrawLinearElement | import("./types").ExcalidrawSelectionElement | import("./types").ExcalidrawRectangleElement | import("./types").ExcalidrawStickyNoteElement | import("./types").ExcalidrawDiamondElement | import("./types").ExcalidrawEllipseElement | import("./types").ExcalidrawEmbeddableElement | import("./types").ExcalidrawIframeElement | import("./types").ExcalidrawImageElement | import("./types").ExcalidrawFrameElement | import("./types").ExcalidrawMagicFrameElement | import("./types").ExcalidrawTextElement | import("./types").ExcalidrawFreeDrawElement)[];
36
36
  export declare const getContainingFrame: (element: ExcalidrawElement, elementsMap: ElementsMap) => ExcalidrawFrameLikeElement | null;
37
37
  /** */
38
38
  export declare const filterElementsEligibleAsFrameChildren: (elements: readonly ExcalidrawElement[], frame: ExcalidrawFrameLikeElement) => ExcalidrawElement[];
@@ -49,6 +49,7 @@ export * from "./showSelectedShapeActions";
49
49
  export * from "./sizeHelpers";
50
50
  export * from "./sortElements";
51
51
  export * from "./store";
52
+ export * from "./stickyNote";
52
53
  export * from "./textElement";
53
54
  export * from "./textMeasurements";
54
55
  export * from "./textWrapping";
@@ -65,6 +65,8 @@ export declare class LinearElementEditor {
65
65
  }, linearElementEditor: LinearElementEditor, scene: Scene): {
66
66
  didAddPoint: boolean;
67
67
  hitElement: NonDeleted<ExcalidrawElement> | null;
68
+ /** the pointer went down on the arrow's label, grabbing it for a drag */
69
+ hitBoundText: boolean;
68
70
  linearElementEditor: LinearElementEditor | null;
69
71
  };
70
72
  static arePointsEqual<Point extends LocalPoint | GlobalPoint>(point1: Point | null, point2: Point | null): boolean;
@@ -76,6 +78,11 @@ export declare class LinearElementEditor {
76
78
  static getPointAtIndexGlobalCoordinates(element: ExcalidrawLinearElement, indexMaybeFromEnd: number, // -1 for last element
77
79
  elementsMap: ElementsMap): GlobalPoint;
78
80
  static pointFromAbsoluteCoords(element: ExcalidrawLinearElement, absoluteCoords: GlobalPoint, elementsMap: ElementsMap): LocalPoint;
81
+ /**
82
+ * Whether the point at `index` is an interactive handle. Elbow arrows only
83
+ * expose their endpoints; their intermediate route points are not draggable.
84
+ */
85
+ static isPointHandle(element: ExcalidrawLinearElement, index: number): boolean;
79
86
  static getPointIndexUnderCursor(element: ExcalidrawLinearElement, elementsMap: ElementsMap, zoom: AppState["zoom"], x: number, y: number): number;
80
87
  static createPointAt(element: ExcalidrawLinearElement, elementsMap: ElementsMap, scenePointerX: number, scenePointerY: number, gridSize: NullableGridSize): LocalPoint;
81
88
  /**
@@ -114,10 +121,13 @@ export declare class LinearElementEditor {
114
121
  * segment.
115
122
  */
116
123
  static getBoundTextElementCenter: (element: ExcalidrawLinearElement, elementsMap: ElementsMap) => GlobalPoint;
124
+ static handleBoundTextDragging(linearElementEditor: LinearElementEditor, scene: Scene, pointerX: number, pointerY: number): LinearElementEditor | null;
125
+ static getPointAtPathParameter(container: ExcalidrawLinearElement, pathParameter: number, elementsMap: ElementsMap): GlobalPoint | null;
117
126
  static getBoundTextElementPosition: (element: ExcalidrawLinearElement, boundTextElement: ExcalidrawTextElementWithContainer, elementsMap: ElementsMap) => {
118
127
  x: number;
119
128
  y: number;
120
129
  };
130
+ private static computeBoundTextElementPosition;
121
131
  static getMinMaxXYWithBoundText: (element: ExcalidrawLinearElement, elementsMap: ElementsMap, elementBounds: Bounds, boundTextElement: ExcalidrawTextElementWithContainer) => [number, number, number, number, number, number];
122
132
  static getElementAbsoluteCoords: (element: ExcalidrawLinearElement, elementsMap: ElementsMap, includeBoundText?: boolean) => [number, number, number, number, number, number];
123
133
  static moveFixedSegment(linearElement: LinearElementEditor, index: number, x: number, y: number, scene: Scene): Pick<LinearElementEditor, "segmentMidPointHoveredCoords" | "initialState">;
@@ -1,6 +1,6 @@
1
1
  import type { Mutable } from "@excalidraw/common/utility-types";
2
2
  import type { ElementsMap, ExcalidrawElement } from "./types";
3
- export type ElementUpdate<TElement extends ExcalidrawElement> = Omit<Partial<TElement>, "id" | "updated">;
3
+ export type ElementUpdate<TElement extends ExcalidrawElement> = Omit<Partial<TElement>, "id" | "updated" | "created">;
4
4
  /**
5
5
  * This function tracks updates of text elements for the purposes for collaboration.
6
6
  * The version is used to compare updates when more than one user is working in