@excalidraw/common 0.18.0-4ce38fb → 0.18.0-4ce8305

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/dist/dev/index.js +25 -17
  2. package/dist/dev/index.js.map +3 -3
  3. package/dist/prod/index.js +3 -3
  4. package/dist/types/common/src/utils.d.ts +7 -1
  5. package/dist/types/element/src/align.d.ts +4 -1
  6. package/dist/types/element/src/binding.d.ts +36 -0
  7. package/dist/types/element/src/bounds.d.ts +10 -2
  8. package/dist/types/element/src/collision.d.ts +7 -0
  9. package/dist/types/element/src/cropElement.d.ts +36 -4
  10. package/dist/types/element/src/delta.d.ts +7 -1
  11. package/dist/types/element/src/distribute.d.ts +4 -1
  12. package/dist/types/element/src/dragElements.d.ts +8 -3
  13. package/dist/types/element/src/elbowArrow.d.ts +5 -0
  14. package/dist/types/element/src/embeddable.d.ts +2 -1
  15. package/dist/types/element/src/groups.d.ts +1 -6
  16. package/dist/types/element/src/image.d.ts +5 -2
  17. package/dist/types/element/src/index.d.ts +1 -0
  18. package/dist/types/element/src/linearElementEditor.d.ts +4 -1
  19. package/dist/types/element/src/listMarker.d.ts +7 -2
  20. package/dist/types/element/src/newElement.d.ts +3 -1
  21. package/dist/types/element/src/renderElement.d.ts +10 -0
  22. package/dist/types/element/src/renderEnvironment.d.ts +66 -0
  23. package/dist/types/element/src/resizeElements.d.ts +15 -5
  24. package/dist/types/element/src/selection.d.ts +1 -7
  25. package/dist/types/element/src/shape.d.ts +2 -0
  26. package/dist/types/element/src/stickyNote.d.ts +8 -0
  27. package/dist/types/element/src/textElement.d.ts +3 -2
  28. package/dist/types/element/src/textMeasurements.d.ts +15 -11
  29. package/dist/types/element/src/textWrapping.d.ts +3 -2
  30. package/dist/types/element/src/transform.d.ts +5 -1
  31. package/dist/types/excalidraw/actions/actionBoundText.d.ts +46 -221
  32. package/dist/types/excalidraw/actions/actionCanvas.d.ts +2 -2
  33. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +4 -588
  34. package/dist/types/excalidraw/actions/actionExport.d.ts +2 -2
  35. package/dist/types/excalidraw/actions/actionFrame.d.ts +41 -525
  36. package/dist/types/excalidraw/actions/actionToggleWrap.d.ts +12 -0
  37. package/dist/types/excalidraw/actions/index.d.ts +1 -0
  38. package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
  39. package/dist/types/excalidraw/actions/types.d.ts +1 -1
  40. package/dist/types/excalidraw/appState.d.ts +2 -2
  41. package/dist/types/excalidraw/charts/charts.bar.d.ts +2 -1
  42. package/dist/types/excalidraw/charts/charts.helpers.d.ts +6 -5
  43. package/dist/types/excalidraw/charts/charts.line.d.ts +2 -1
  44. package/dist/types/excalidraw/charts/charts.radar.d.ts +2 -1
  45. package/dist/types/excalidraw/charts/index.d.ts +2 -1
  46. package/dist/types/excalidraw/components/App.d.ts +34 -20
  47. package/dist/types/excalidraw/components/App.host.d.ts +102 -0
  48. package/dist/types/excalidraw/components/App.modifiers.d.ts +38 -0
  49. package/dist/types/excalidraw/components/App.selection.d.ts +265 -0
  50. package/dist/types/excalidraw/components/App.selectionTool.d.ts +93 -0
  51. package/dist/types/excalidraw/components/App.viewport.d.ts +13 -3
  52. package/dist/types/excalidraw/components/App.wrap.d.ts +31 -0
  53. package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +2 -1
  54. package/dist/types/excalidraw/components/Stats/utils.d.ts +4 -2
  55. package/dist/types/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +2 -1
  56. package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +5 -2
  57. package/dist/types/excalidraw/components/TTDDialog/TTDPreviewPanel.d.ts +5 -2
  58. package/dist/types/excalidraw/components/TTDDialog/TextToDiagram.d.ts +2 -1
  59. package/dist/types/excalidraw/components/TTDDialog/common.d.ts +4 -1
  60. package/dist/types/excalidraw/components/TTDDialog/hooks/useTextGeneration.d.ts +3 -2
  61. package/dist/types/excalidraw/components/TTDDialog/types.d.ts +14 -1
  62. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidError.d.ts +27 -1
  63. package/dist/types/excalidraw/components/Tooltip.d.ts +11 -1
  64. package/dist/types/excalidraw/components/TopPicksDnD/topPicksDnD.d.ts +1 -1
  65. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +0 -1
  66. package/dist/types/excalidraw/components/hyperlink/Hyperlink.d.ts +3 -2
  67. package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +13 -2
  68. package/dist/types/excalidraw/data/blob.d.ts +4 -4
  69. package/dist/types/excalidraw/data/index.d.ts +3 -3
  70. package/dist/types/excalidraw/data/json.d.ts +2 -2
  71. package/dist/types/excalidraw/fonts/Fonts.d.ts +9 -6
  72. package/dist/types/excalidraw/history.d.ts +10 -4
  73. package/dist/types/excalidraw/reactUtils.d.ts +1 -1
  74. package/dist/types/excalidraw/renderer/animation.d.ts +11 -4
  75. package/dist/types/excalidraw/renderer/staticScene.d.ts +11 -6
  76. package/dist/types/excalidraw/scene/Renderer.d.ts +1 -1
  77. package/dist/types/excalidraw/scene/export.d.ts +343 -20
  78. package/dist/types/excalidraw/scene/types.d.ts +23 -1
  79. package/dist/types/excalidraw/types.d.ts +49 -1
  80. package/dist/types/utils/src/index.d.ts +3 -1
  81. package/package.json +1 -1
  82. package/dist/types/utils/src/export.d.ts +0 -36
@@ -1,4 +1,4 @@
1
- var Ze=Object.create;var J=Object.defineProperty;var Qe=Object.getOwnPropertyDescriptor;var Je=Object.getOwnPropertyNames;var et=Object.getPrototypeOf,tt=Object.prototype.hasOwnProperty;var nt=(e,t)=>()=>(e&&(t=e(e=0)),t);var ee=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var rt=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Je(t))!tt.call(e,o)&&o!==n&&J(e,o,{get:()=>t[o],enumerable:!(r=Qe(t,o))||r.enumerable});return e};var te=(e,t,n)=>(n=e!=null?Ze(et(e)):{},rt(t||!e||!e.__esModule?J(n,"default",{value:e,enumerable:!0}):n,e));var h,p=nt(()=>{h={PROD:!0}});var Pe=ee((z,De)=>{p();(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof z=="object"?De.exports=t():(e.PromisePool=t(),e.promisePool=e.PromisePool)})(z,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 $e=ee(K=>{"use strict";p();Object.defineProperty(K,"__esModule",{value:!0});K.sanitizeUrl=void 0;var hn=/^([^\w]*)(javascript|data|vbscript)/im,mn=/&#(\w+)(^\w|;)?/g,En=/&(newline|tab);/gi,Tn=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,bn=/^.+(:|&colon;)/gim,gn=[".","/"];function _n(e){return gn.indexOf(e[0])>-1}function xn(e){return e.replace(mn,function(t,n){return String.fromCharCode(n)})}function An(e){var t=xn(e||"").replace(En,"").replace(Tn,"").trim();if(!t)return"about:blank";if(_n(t))return t;var n=t.match(bn);if(!n)return t;var r=n[0];return hn.test(r)?"about:blank":t}K.sanitizeUrl=An});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,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 Ln=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 st=/^\s+/,at=/\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,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=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 pt(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(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:yt[se(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var n="#"+ae(this._r,this._g,this._b,this._a),r=n,o=this._gradientType?"GradientType = 1, ":"";if(t){var s=c(t);r="#"+ae(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(mt,arguments)},brighten:function(){return this._applyModification(Et,arguments)},darken:function(){return this._applyModification(Tt,arguments)},desaturate:function(){return this._applyModification(dt,arguments)},saturate:function(){return this._applyModification(ft,arguments)},greyscale:function(){return this._applyModification(ht,arguments)},spin:function(){return this._applyModification(bt,arguments)},_applyCombination:function(t,n){return t.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(xt,arguments)},complement:function(){return this._applyCombination(gt,arguments)},monochromatic:function(){return this._applyCombination(At,arguments)},splitcomplement:function(){return this._applyCombination(_t,arguments)},triad:function(){return this._applyCombination(ie,[3])},tetrad:function(){return this._applyCombination(ie,[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,i=!1,a=!1;return typeof e=="string"&&(e=Rt(e)),C(e)=="object"&&(A(e.r)&&A(e.g)&&A(e.b)?(t=lt(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=ut(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=ct(e.h,r,s),i=!0,a="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=ce(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 lt(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,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 ct(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 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,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 ut(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 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 pt(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 ae(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 dt(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.s-=t/100,n.s=D(n.s),c(n)}function ft(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.s+=t/100,n.s=D(n.s),c(n)}function ht(e){return c(e).desaturate(100)}function mt(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.l+=t/100,n.l=D(n.l),c(n)}function Et(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 Tt(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.l-=t/100,n.l=D(n.l),c(n)}function bt(e,t){var n=c(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,c(n)}function gt(e){var t=c(e).toHsl();return t.h=(t.h+180)%360,c(t)}function ie(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 _t(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 xt(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 At(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=Ot(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 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"},yt=c.hexNames=vt(W);function vt(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){St(e)&&(e="100%");var n=Mt(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 D(e){return Math.min(1,Math.max(0,e))}function g(e){return parseInt(e,16)}function St(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function Mt(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 Rt(e){e=e.replace(st,"").replace(at,"").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 Ot(e){var t,n;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:t,size:n}}import{clamp as V}from"@excalidraw/math";import{degreesToRadians as Lt}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,i=n/255,a=Lt(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],Q=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,Q))*255),b:Math.round(Math.max(0,Math.min(1,y))*255)}}var It=(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))},i=s(e),a=s(t),l=s(n);return{r:i,g:a,b:l}},kn=(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(),i=It(s.r,s.g,s.b,pe),a=fe(i.r,i.g,i.b,de),l=N(a.r,a.g,a.b,o);return Y&&Y.set(e,l),l},wt=(e,t,n)=>{let r=pe/100,o=1-2*r,s=i=>Math.round(V((i-255*r)/o,0,255));return{r:s(e),g:s(t),b:s(n)}},Un=e=>{let t=c(e),n=t.getAlpha(),r=t.toRgb(),o=fe(r.r,r.g,r.b,de),s=wt(o.r,o.g,o.b);return N(s.r,s.g,s.b,n)},Ft=(e,t)=>t.reduce((n,r)=>(r in e&&(n[r]=e[r]),n),{}),Hn=5,Gn=5,Kn=4,P=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=Ft(d,["cyan","blue","violet","grape","pink","green","teal","yellow","orange","red"]),Bn=5,Ct=[d.black,d.red[P],d.green[P],d.blue[P],d.yellow[P]],Wn=[d.transparent,d.red[v],d.green[v],d.blue[v],d.yellow[v]],Yn=[d.white,d.red[v],d.green[v],d.blue[v],d.yellow[v]],me="#ffdf6b",Vn=Ct,$n=[me,d.pink[1],d.green[1],d.blue[1],d.orange[1]],zn=[d.white,"#f8f9fa","#f5faff","#fffce8","#fdf8f6"],Xn={transparent:d.transparent,white:d.white,gray:d.gray,black:d.black,bronze:d.bronze,...he},jn={transparent:d.transparent,white:d.white,gray:d.gray,black:d.black,bronze:d.bronze,...he},qn=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},Zn=(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)},Qn=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,Jn=e=>c(e).getAlpha()===1,er=240,Dt=(e,t,n)=>(e*299+t*587+n*114)/1e3,tr=(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 Dt(r,o,s)<t},nr=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 ar=typeof window<"u"&&"ResizeObserver"in window,ir="Excalidraw",lr=36,cr=20,ur=800,pr=10,dr=20,fr=8,hr=5,mr=1,Er=30,Tr=Math.PI/12,br="red",gr={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},_r={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1,ERASER:5},xr={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||{}),Ar={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5},k={TEST:"test",DEVELOPMENT:"development",PRODUCTION:"production"},yr={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"},vr={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",Nt={[ge]:998,[_e]:999},$={[be]:100,...Nt,[L]:1e3};function kt(e){switch(e){case T.Cascadia:case T["Comic Shanns"]:return _e;default:return ge}}var xe=e=>{let t=kt(e);switch(e){case T.Excalifont:return[be,t,L];default:return[t,L]}},Sr={LIGHT:"light",DARK:"dark"},Mr="invert(93%) hue-rotate(180deg)",Rr={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},Or=1,Lr=20,Ir=16,wr=512,Fr=28,Cr=2,Ut=16,Ht={height:20,fontSize:12,fontFamily:"Helvetica, Arial, sans-serif",baselineFromBottom:14,opacity:1,minBodyWidthForYear:80},Dr=Ut*2+Ht.height,Pr=250,Nr=75,kr=3,Ur=.16,Hr=.5,Gr=.08,Kr=T.Excalifont,Br=3,Wr="left",Yr="top",Ae="{version}",Gt=2,Kt=2*Gt,Bt=1e-5,Vr=2*Kt-Bt,$r="#ffffff",zr="#1e1e1e",Xr="#a2f1a6",jr=["selectAll"],qr=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"},Wt={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={...Wt,"excalidraw.svg":"image/svg+xml","excalidraw.png":"image/png",binary:"application/octet-stream",...ye},Qr=[Te.text,Te.html,...Object.values(ye)],Jr={png:"png",svg:"svg",clipboard:"clipboard"},eo={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawLibrary:"excalidrawlib",excalidrawClipboardWithAPI:"excalidraw-api/clipboard"},to=()=>window.EXCALIDRAW_EXPORT_SOURCE||window.location.origin,no=500,ro=300,oo=500,so=1e4,ao=3e4,io=100,lo=250,co=.1,uo=.1,po=30,fo=Object.freeze({value:1}),ho=300,mo=6e4,Eo=3e3,To={addLibrary:"addLibrary"},bo={addLibrary:"addLibrary"},go={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,toggleTheme:null,saveAsImage:!0},tools:{image:!0}},_o=2,xo=[1,2,3],Ao=10,yo={maxWidthOrHeight:1440,maxFileSizeBytes:4*1024*1024},vo="http://www.w3.org/2000/svg",So=`<?xml version="1.0" standalone="no"?>
1
+ var et=Object.create;var ne=Object.defineProperty;var tt=Object.getOwnPropertyDescriptor;var nt=Object.getOwnPropertyNames;var rt=Object.getPrototypeOf,ot=Object.prototype.hasOwnProperty;var st=(e,t)=>()=>(e&&(t=e(e=0)),t);var re=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var it=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of nt(t))!ot.call(e,o)&&o!==n&&ne(e,o,{get:()=>t[o],enumerable:!(r=tt(t,o))||r.enumerable});return e};var oe=(e,t,n)=>(n=e!=null?et(rt(e)):{},it(t||!e||!e.__esModule?ne(n,"default",{value:e,enumerable:!0}):n,e));var m,p=st(()=>{m={PROD:!0}});var Ue=re((q,ke)=>{p();(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof q=="object"?ke.exports=t():(e.PromisePool=t(),e.promisePool=e.PromisePool)})(q,function(){"use strict";var e=function(){this._listeners={}};e.prototype.addEventListener=function(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,h=l.length;u<h;++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,h){i._callbacks={reject:h,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 je=re(B=>{"use strict";p();Object.defineProperty(B,"__esModule",{value:!0});B.sanitizeUrl=void 0;var Tn=/^([^\w]*)(javascript|data|vbscript)/im,bn=/&#(\w+)(^\w|;)?/g,gn=/&(newline|tab);/gi,_n=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,xn=/^.+(:|&colon;)/gim,An=[".","/"];function yn(e){return An.indexOf(e[0])>-1}function vn(e){return e.replace(bn,function(t,n){return String.fromCharCode(n)})}function Sn(e){var t=vn(e||"").replace(gn,"").replace(_n,"").trim();if(!t)return"about:blank";if(yn(t))return t;var n=t.match(xn);if(!n)return t;var r=n[0];return Tn.test(r)?"about:blank":t}B.sanitizeUrl=Sn});p();p();var se=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 Fn=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 P(e){"@babel/helpers - typeof";return P=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},P(e)}var lt=/^\s+/,ct=/\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=ut(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=de(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=ae(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=ae(this._r,this._g,this._b),n=Math.round(t.h*360),r=Math.round(t.s*100),o=Math.round(t.v*100);return this._a==1?"hsv("+n+", "+r+"%, "+o+"%)":"hsva("+n+", "+r+"%, "+o+"%, "+this._roundA+")"},toHsl:function(){var t=ie(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=ie(this._r,this._g,this._b),n=Math.round(t.h*360),r=Math.round(t.s*100),o=Math.round(t.l*100);return this._a==1?"hsl("+n+", "+r+"%, "+o+"%)":"hsla("+n+", "+r+"%, "+o+"%, "+this._roundA+")"},toHex:function(t){return le(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return mt(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:Mt[le(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var n="#"+ce(this._r,this._g,this._b,this._a),r=n,o=this._gradientType?"GradientType = 1, ":"";if(t){var s=c(t);r="#"+ce(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(bt,arguments)},brighten:function(){return this._applyModification(gt,arguments)},darken:function(){return this._applyModification(_t,arguments)},desaturate:function(){return this._applyModification(ht,arguments)},saturate:function(){return this._applyModification(Et,arguments)},greyscale:function(){return this._applyModification(Tt,arguments)},spin:function(){return this._applyModification(xt,arguments)},_applyCombination:function(t,n){return t.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(vt,arguments)},complement:function(){return this._applyCombination(At,arguments)},monochromatic:function(){return this._applyCombination(St,arguments)},splitcomplement:function(){return this._applyCombination(yt,arguments)},triad:function(){return this._applyCombination(ue,[3])},tetrad:function(){return this._applyCombination(ue,[4])}};c.fromRatio=function(e,t){if(P(e)=="object"){var n={};for(var r in e)e.hasOwnProperty(r)&&(r==="a"?n[r]=e[r]:n[r]=L(e[r]));e=n}return c(e,t)};function ut(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=It(e)),P(e)=="object"&&(A(e.r)&&A(e.g)&&A(e.b)?(t=pt(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=L(e.s),o=L(e.v),t=ft(e.h,r,o),a=!0,i="hsv"):A(e.h)&&A(e.s)&&A(e.l)&&(r=L(e.s),s=L(e.l),t=dt(e.h,r,s),a=!0,i="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=de(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 pt(e,t,n){return{r:E(e,255)*255,g:E(t,255)*255,b:E(n,255)*255}}function ie(e,t,n){e=E(e,255),t=E(t,255),n=E(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),s,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 dt(e,t,n){var r,o,s;e=E(e,360),t=E(t,100),n=E(n,100);function a(u,h,b){return b<0&&(b+=1),b>1&&(b-=1),b<1/6?u+(h-u)*6*b:b<1/2?h:b<2/3?u+(h-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 ae(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 ft(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],h=[i,n,n,a,s,s][l],b=[s,s,i,n,n,a][l];return{r:u*255,g:h*255,b:b*255}}function le(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 mt(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(fe(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 ce(e,t,n,r){var o=[x(fe(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 ht(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.s-=t/100,n.s=D(n.s),c(n)}function Et(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.s+=t/100,n.s=D(n.s),c(n)}function Tt(e){return c(e).desaturate(100)}function bt(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.l+=t/100,n.l=D(n.l),c(n)}function gt(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 _t(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.l-=t/100,n.l=D(n.l),c(n)}function xt(e,t){var n=c(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,c(n)}function At(e){var t=c(e).toHsl();return t.h=(t.h+180)%360,c(t)}function ue(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 yt(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 vt(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 St(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=wt(n),o.level+o.size){case"AAsmall":case"AAAlarge":s=r>=4.5;break;case"AAlarge":s=r>=3;break;case"AAAsmall":s=r>=7;break}return s};c.mostReadable=function(e,t,n){var r=null,o=0,s,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 Y=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"},Mt=c.hexNames=Rt(Y);function Rt(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function de(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function E(e,t){Ot(e)&&(e="100%");var n=Lt(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function D(e){return Math.min(1,Math.max(0,e))}function g(e){return parseInt(e,16)}function Ot(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function Lt(e){return typeof e=="string"&&e.indexOf("%")!=-1}function x(e){return e.length==1?"0"+e:""+e}function L(e){return e<=1&&(e=e*100+"%"),e}function fe(e){return Math.round(parseFloat(e)*255).toString(16)}function pe(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 It(e){e=e.replace(lt,"").replace(ct,"").toLowerCase();var t=!1;if(Y[e])e=Y[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:pe(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:pe(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 wt(e){var t,n;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:t,size:n}}import{clamp as $}from"@excalidraw/math";import{degreesToRadians as Ft}from"@excalidraw/math";var V=typeof window<"u"?new Map:null,me=93,he=180;function Ee(e,t,n,r){let o=e/255,s=t/255,a=n/255,i=Ft(r),l=Math.cos(i),u=Math.sin(i),h=[.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*h[0]+s*h[1]+a*h[2],te=o*h[3]+s*h[4]+a*h[5],y=o*h[6]+s*h[7]+a*h[8];return{r:Math.round(Math.max(0,Math.min(1,b))*255),g:Math.round(Math.max(0,Math.min(1,te))*255),b:Math.round(Math.max(0,Math.min(1,y))*255)}}var Ct=(e,t,n,r)=>{let o=$(r,0,100)/100,s=u=>{let h=u*(1-o)+(255-u)*o;return Math.round($(h,0,255))},a=s(e),i=s(t),l=s(n);return{r:a,g:i,b:l}},Gn=(e,t=!0)=>{if(!t)return e;let n=V?.get(e);if(n)return n;let r=c(e),o=r.getAlpha(),s=r.toRgb(),a=Ct(s.r,s.g,s.b,me),i=Ee(a.r,a.g,a.b,he),l=k(i.r,i.g,i.b,o);return V&&V.set(e,l),l},Pt=(e,t,n)=>{let r=me/100,o=1-2*r,s=a=>Math.round($((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=Ee(r.r,r.g,r.b,he),s=Pt(o.r,o.g,o.b);return k(s.r,s.g,s.b,n)},Dt=(e,t)=>t.reduce((n,r)=>(r in e&&(n[r]=e[r]),n),{}),Bn=5,Wn=5,Yn=4,N=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"]},Te=Dt(d,["cyan","blue","violet","grape","pink","green","teal","yellow","orange","red"]),Vn=5,Nt=[d.black,d.red[N],d.green[N],d.blue[N],d.yellow[N]],$n=[d.transparent,d.red[v],d.green[v],d.blue[v],d.yellow[v]],zn=[d.white,d.red[v],d.green[v],d.blue[v],d.yellow[v]],be="#ffdf6b",Xn=Nt,jn=[be,d.pink[1],d.green[1],d.blue[1],d.orange[1]],qn=[d.white,"#f8f9fa","#f5faff","#fffce8","#fdf8f6"],Zn={transparent:d.transparent,white:d.white,gray:d.gray,black:d.black,bronze:d.bronze,...Te},Qn={transparent:d.transparent,white:d.white,gray:d.gray,black:d.black,bronze:d.bronze,...Te},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]],k=(e,t,n,r)=>{let o=`#${(16777216+(e<<16)+(t<<8)+n).toString(16).slice(1)}`;if(r!==void 0&&r<1){let s=Math.round(r*255).toString(16).padStart(2,"0");return`${o}${s}`}return o},er=(e,t)=>{let n=c(e);if(!n.isValid())return e;let{r,g:o,b:s}=n.toRgb();return k(r,o,s,t)},tr=e=>{let t=c(e);if(!t.isValid())return null;let{r:n,g:r,b:o,a:s}=t.toRgb();return k(n,r,o,s)},ge=e=>c(e).getAlpha()===0,nr=e=>c(e).getAlpha()===1,rr=240,kt=(e,t,n)=>(e*299+t*587+n*114)/1e3,or=(e,t=160)=>{if(!e)return!0;if(ge(e))return!1;let n=c(e);if(!n.isValid())return!0;let{r,g:o,b:s}=n.toRgb();return kt(r,o,s)<t},sr=e=>{if(e=e.trim(),ge(e))return e;let t=c(e);return t.isValid()?["hex","hex8"].includes(t.getFormat())&&!e.startsWith("#")?`#${e}`:e:null};p();var cr=typeof window<"u"&&"ResizeObserver"in window,ur="Excalidraw",pr=36,dr=20,fr=800,mr=10,hr=20,Er=8,Tr=5,br=1,gr=30,_r=Math.PI/12,xr="red",Ar={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},yr={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1,ERASER:5},vr={enabled:"all",disabled:"none",inheritFromUI:"var(--ui-pointerEvents)"},Ut=(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))(Ut||{}),Sr={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5},U={TEST:"test",DEVELOPMENT:"development",PRODUCTION:"production"},Mr={SIDEBAR:"sidebar",SHAPE_ACTIONS_MENU:"App-menu__left",ZOOM_ACTIONS:"zoom-actions",SEARCH_MENU_INPUT_WRAPPER:"layer-ui__search-inputWrapper",CONVERT_ELEMENT_TYPE_POPUP:"ConvertElementTypePopup",SHAPE_ACTIONS_THEME_SCOPE:"shape-actions-theme-scope",FRAME_NAME:"frame-name",DROPDOWN_MENU_EVENT_WRAPPER:"dropdown-menu-event-wrapper"},Rr={sm:16,md:20,lg:28,xl:36},xe="Xiaolai",I="Segoe UI Emoji",T={Virgil:1,Helvetica:2,Cascadia:3,Excalifont:5,Nunito:6,"Lilita One":7,"Comic Shanns":8,"Liberation Sans":9,Assistant:10},Ae="sans-serif",ye="monospace",Ht={[Ae]:998,[ye]:999},z={[xe]:100,...Ht,[I]:1e3};function Gt(e){switch(e){case T.Cascadia:case T["Comic Shanns"]:return ye;default:return Ae}}var ve=e=>{let t=Gt(e);switch(e){case T.Excalifont:return[xe,t,I];default:return[t,I]}},Or={LIGHT:"light",DARK:"dark"},Lr="invert(93%) hue-rotate(180deg)",Ir={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},wr=1,Fr=20,Cr=16,Pr=512,Dr=28,Nr=2,Kt=16,Bt={height:20,fontSize:12,fontFamily:"Helvetica, Arial, sans-serif",baselineFromBottom:14,opacity:1,minBodyWidthForYear:80},kr=Kt*2+Bt.height,Ur=250,Hr=75,Gr=3,Kr=.16,Br=.5,Wr=.08,Yr=T.Excalifont,Vr=3,$r="left",zr="top",Se="{version}",Wt=2,Yt=2*Wt,Vt=1e-5,Xr=2*Yt-Vt,jr="#ffffff",qr="#1e1e1e",Zr="#a2f1a6",Qr=["selectAll"],Jr=20,eo=5,Me={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"},$t={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"},_e={...$t,"excalidraw.svg":"image/svg+xml","excalidraw.png":"image/png",binary:"application/octet-stream",...Me},to=[_e.text,_e.html,...Object.values(Me)],no={png:"png",svg:"svg",clipboard:"clipboard"},ro={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawLibrary:"excalidrawlib",excalidrawClipboardWithAPI:"excalidraw-api/clipboard"},oo=()=>window.EXCALIDRAW_EXPORT_SOURCE||window.location.origin,so=500,io=300,ao=500,lo=1e4,co=3e4,uo=100,po=250,fo=.1,mo=.1,ho=30,Eo=Object.freeze({value:1}),To=300,bo=6e4,go=3e3,_o={addLibrary:"addLibrary"},xo={addLibrary:"addLibrary"},Ao={canvasActions:{changeViewBackgroundColor:!0,clearCanvas:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,toggleTheme:null,saveAsImage:!0},tools:{image:!0}},yo=2,vo=[1,2,3],So=10,Mo={maxWidthOrHeight:1440,maxFileSizeBytes:4*1024*1024},Ro="http://www.w3.org/2000/svg",Oo=`<?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
- `,Mo=128,Ro={excalidraw:2,excalidrawLibrary:2},Oo=5,Lo=.7,Io=11,wo={TOP:"top",MIDDLE:"middle",BOTTOM:"bottom"},Fo={LEFT:"left",CENTER:"center",RIGHT:"right"},Co=20,Do=70,Po=.25,No=32,ko={LEGACY:1,PROPORTIONAL_RADIUS:2,ADAPTIVE_RADIUS:3},Yt={architect:0,artist:1,cartoonist:2},Uo=["thin","medium","bold"],ve={thin:1,medium:2,bold:4,extraBold:8},Vt={thin:.5,medium:1,bold:2,extraBold:4},Ho=(e,t)=>e==="freedraw"?Vt[t]:ve[t],$t="medium",Go={strokeColor:d.black,backgroundColor:d.transparent,fillStyle:"solid",strokeWidth:ve[$t],strokeStyle:"solid",roughness:Yt.artist,opacity:100,locked:!1},zt="library",Ko="search",Bo={name:"default",defaultTab:zt},Wo=new Set(["iframe","embeddable","image"]),Yo={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"},Vo={OAI_API_KEY:"excalidraw-oai-api-key",MERMAID_TO_EXCALIDRAW:"mermaid-to-excalidraw",PUBLISH_LIBRARY:"publish-library-data"},$o="Untitled",zo={generalStats:1,elementProperties:2},Xo=1,jo={sharp:"sharp",round:"round",elbow:"elbow"},qo=.3,Zo="element",Qo=Symbol.for("__test__originalId__"),Xt=(r=>(r.ACTIVE="active",r.AWAY="away",r.IDLE="idle",r))(Xt||{}),Jo=20,es=35,ts=700,ns={background:"var(--mobile-action-button-bg)"},rs=.5,os=.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}},cs={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"},us="local:",ps=(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},ds=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",bs=599,gs=1e3,_s=500,xs=600,As=1180,ys=1440,vs=1229,Le=/Mac|iPod|iPhone|iPad/.test(navigator.platform),Ss=/^Win/.test(navigator.platform),Ie=/\b(android)\b/i.test(navigator.userAgent),Ms=typeof window<"u"&&"netscape"in window&&navigator.userAgent.indexOf("rv:")>1&&navigator.userAgent.indexOf("Gecko")>1,jt=navigator.userAgent.indexOf("Chrome")!==-1,Rs=!jt&&navigator.userAgent.indexOf("Safari")!==-1,we=/iPad|iPhone/i.test(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document,Os=()=>navigator.brave?.isBrave?.name==="isBrave",qt=(e,t)=>e<=599||t<500&&e<1e3,Zt=(e,t)=>{let n=Math.min(e,t),r=Math.max(e,t);return n>=600&&r<=1180},Qt=()=>{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},Ls=(e,t)=>qt(e,t)?"phone":Zt(e,t)?"tablet":"desktop",Is=e=>e.formFactor==="phone"?"mobile":e.formFactor==="tablet"?"compact":e.desktopUIMode,ws=e=>{let t=e??"",n="unknown";return we?n="ios":Ie?n="android":t&&(n="other"),{isMobileDevice:Qt(),platform:n}},Fs=()=>{if(typeof window>"u")return null;try{let e=window.localStorage.getItem(Oe);if(e==="compact"||e==="full")return e}catch{}return null},Jt=e=>{if(!(typeof window>"u"))try{window.localStorage.setItem(Oe,e)}catch{}},Cs=e=>{if(!(e!=="compact"&&e!=="full"))return Jt(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"},en=new Map([[M.Z,Fe.Z],[M.Y,Fe.Y]]),tn=e=>/^[a-z]$/.test(e.toLowerCase()),ks=(e,t)=>{if(t===e.key.toLowerCase())return!0;let n=en.get(t);return!!(n&&!tn(e.key)&&e.code===n)},Us=e=>e===M.ARROW_LEFT||e===M.ARROW_RIGHT||e===M.ARROW_DOWN||e===M.ARROW_UP,Hs=e=>e.altKey,Gs=e=>e.shiftKey,Ks=e=>e.shiftKey;p();import{pointFrom as Ce,pointFromPair as nn}from"@excalidraw/math";var Vs=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)}},$s=(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,F=[...y];return F[e]=S,S<u&&(u=S),F});if(!r||m.length===2)return m;let b=i-u;return m.map(y=>nn(y.map((S,F)=>F===e?S+b:S)))},zs=(e,t,n)=>n?Ce(Math.round(e/n)*n,Math.round(t/n)*n):Ce(e,t);p();var ke=te(Pe(),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,ca=e=>{X=e},ua=()=>{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}`},pa=e=>e.charAt(0).toUpperCase()+e.slice(1),G=e=>e?.ownerDocument?.defaultView??(typeof window>"u"?null:window),da=e=>{let t=G(e);return!!t&&e instanceof t.HTMLElement&&e.className.includes("ToolIcon")},rn=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)},fa=e=>{let t=G(e);return rn(e)||!!t&&e instanceof t.Element&&!!e.closest("label, button")},ha=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)},on=({fontFamily:e})=>{for(let[t,n]of Object.entries(T))if(n===e)return`${t}${xe(n).map(r=>`, ${r}`).join("")}`;return L},ma=({fontSize:e,fontFamily:t})=>`${e}px ${on({fontFamily:t})}`,Ea=async e=>{requestAnimationFrame(()=>requestAnimationFrame(e))},Ta=(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},ba=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},ga=e=>1-Math.pow(1-e,4),_a=(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},xa=e=>{let t=window.getSelection();if(t){let n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}},Aa=()=>{let e=window.getSelection();e&&e.removeAllRanges()},ya=(e,t)=>Math.abs(e-t),va=e=>e==="selection"||e==="lasso",Sa=(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},Ma=()=>document.fullscreenElement?.nodeName==="HTML",Ra=()=>document.documentElement.requestFullscreen(),Oa=()=>document.exitFullscreen(),La=({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}},Ia=({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}},wa=e=>getComputedStyle(document.documentElement).getPropertyValue(`--${e}`),sn="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u2C00-\uFB1C\uFDFE-\uFE6F\uFEFD-\uFFFF",Ge="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",an=new RegExp(`^[^${sn}]*[${Ge}]`),Fa=e=>an.test(e),ln=new RegExp(`[${Ge}]`),Ca=e=>ln.test(e),Da=e=>{let[t,n]=e;return{x:t,y:n}},Pa=e=>{if(e?.name==="AbortError"){console.warn(e);return}throw e},Na=(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},ka=(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},Ua=(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},Ha=(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},Ga=()=>document.querySelector('meta[name="version"]')?.content||Ae,Ka=()=>{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},Ba=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},Wa=e=>{let t=e.parentElement;for(;t;){if(t.tabIndex>-1){t.focus();return}t=t.parentElement}},Ya=e=>{e.preventDefault(),e.returnValue=""},Va=e=>Array.from(e).map(t=>`0${t.toString(16)}`.slice(-2)).join(""),$a=()=>q()?1:Date.now(),za=e=>e instanceof Map?e:e.reduce((t,n)=>(t.set(typeof n=="string"?n:n.id,n),t),new Map),Xa=e=>e.reduce((t,n,r)=>(t.set(n.id,[n,r]),t),new Map),ja=(e,t)=>e.reduce((n,r,o)=>(n[t?t(r):o]=r,n),{}),qa=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},[]),cn=e=>Array.isArray(e)?e:e.values(),Za=e=>Array.isArray(e)?e:Array.from(cn(e)),q=()=>h.MODE===k.TEST,Qa=()=>h.MODE===k.DEVELOPMENT,Ke=()=>h.MODE===k.PRODUCTION,Ja=()=>typeof process<"u"&&!0,ei=(e,t)=>new CustomEvent(e,{detail:{nativeEvent:t},cancelable:!0}),ti=(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},ni=e=>{let t=typeof e;return e==null||t!=="object"&&t!=="function"},un=()=>{try{return window.self===window.top?"top":"iframe"}catch{return"iframe"}},ri=()=>un()==="iframe",oi=e=>!!e&&typeof e=="object"&&"then"in e&&"catch"in e&&"finally"in e,si=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,pn=(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]||He(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]||He(e[i],t[i]);return!l&&r&&console.warn(`%cisShallowEqual: ${i} not equal ->`,"color: #8B4000",e[i],t[i]),l})},ai=(e,t,{checkForDefaultPrevented:n=!0}={})=>function(o){if(e?.(o),!n||!o?.defaultPrevented)return t?.(o)},ii=(e,t,n)=>{if(!t)return e;if(n)return console.error(t),e;throw new Error(t)};function li(e,t){if(!e)throw new Error(t)}var ci=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},ui=(e,t)=>e instanceof Set||e instanceof Map?e.has(t):"includes"in e?e.includes(t):e.hasOwnProperty(t),pi=e=>JSON.parse(JSON.stringify(e)),di=(e,t)=>pn(e,t)?e:t;function fi(e,t,n,r){return e?(e?.addEventListener?.(t,n,r),()=>{e?.removeEventListener?.(t,n,r)}):()=>{}}function hi(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)} ${H(o[0],s[0]).toFixed(2)},${H(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+=`${H(r[0],o[0]).toFixed(2)},${H(r[1],o[1]).toFixed(2)} `;return t&&(i+="Z"),i}var mi=e=>e.replace(/\r?\n|\r/g,`
4
- `);function Ei(e){return e}var Re=async(e,...t)=>new Promise(n=>{n(e(...t))}),Ti=(...e)=>Math.max(...e.map(t=>t?1:0))>0,bi=e=>{try{return JSON.parse(e)}catch{return null}},Be=e=>e.replace(/"/g,"&quot;"),gi=e=>Array.isArray(e)?e:[e],dn=e=>Array.isArray(e),fn=e=>dn(e)?e.length:e instanceof Map||e instanceof Set?e.size:Object.keys(e).length,_i=(e,t)=>{if(fn(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},We="excalidraw-feature-flags",j={COMPLEX_BINDINGS:!1},R=null,xi=e=>{if(!R)try{let t=localStorage.getItem(We);t&&(R=JSON.parse(t)??j)}catch{}return(R||j)[e]},Ai=(e,t)=>{try{R={...R||j,[e]:t},localStorage.setItem(We,JSON.stringify(R))}catch(n){console.error("unable to set feature flag",n)}},yi=(e,t)=>t.includes(e);var Ye=new I(Date.now()),Ve=0,Li=()=>Math.floor(Ye.next()*2**31),Ii=e=>{Ye=new I(e),Ve=0},wi=()=>q()?`id${Ve++}`:Ue(),Fi=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 ze=te($e(),1);var yn=e=>(e=e.trim(),e&&(0,ze.sanitizeUrl)(Be(e))),Ui=e=>!!(e?.includes(location.origin)||e?.startsWith("/")),Hi=e=>{if(e=yn(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 Xe=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((...i)=>{s(this.toPromiseValue(i))})})}emit(t,...n){let r=this.behavior[t];if(!Ke()&&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 je=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)),vn=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((a,l)=>a+l),i=w(s/e.FRAME_COUNT);console.info(t,`- ${r.length} calls - ${i}ms/frame across ${e.FRAME_COUNT} frames (${w(i/16.67*100,1)}% of frame budget)`),e.TIMES_AVG[t]={t:n,times:[],avg:o!=null?vn([o,i]):i}}}e.FRAME_COUNT=0,Date.now()-e.LAST_DEBUG_LOG_CALL>600&&e.DEBUG_LOG_INTERVAL_ID!==null&&(console.info("%c(stopping perf recording)","color: red"),window.clearInterval(e.DEBUG_LOG_INTERVAL_ID),window.cancelAnimationFrame(e.ANIMATION_FRAME_ID),e.ANIMATION_FRAME_ID=null,e.FRAME_COUNT=0,e.LAST_FRAME_TIMESTAMP=0,e.DEBUG_LOG_INTERVAL_ID=null,e.TIMES_AGGR={},e.TIMES_AVG={})};static logTime=(t,n="default")=>{e.setupInterval();let r=performance.now(),{t:o,times:s}=e.TIMES_AGGR[n]=e.TIMES_AGGR[n]||{t:0,times:[]};o&&s.push(t??r-o),e.TIMES_AGGR[n].t=r};static logTimeAverage=(t,n="default")=>{e.setupInterval();let r=performance.now(),{t:o,times:s}=e.TIMES_AVG[n]=e.TIMES_AVG[n]||{t:0,times:[]};o&&s.push(t??r-o),e.TIMES_AVG[n].t=r};static logWrapper=t=>(n,r="default")=>(...o)=>{let s=performance.now(),i=n(...o);return e[t](performance.now()-s,r),i};static logTimeWrap=e.logWrapper("logTime");static logTimeAverageWrap=e.logWrapper("logTimeAverage");static perfWrap=(t,n="default")=>(...r)=>{console.time(n);let o=t(...r);return console.timeEnd(n),o};static CHANGED_CACHE={};static logChanged(t,n){let r=e.CHANGED_CACHE[t];if(e.CHANGED_CACHE[t]=n,!r)return;let o=new Set([...Object.keys(r),...Object.keys(n)]),s={};for(let i of o){let a=r[i],l=n[i];qe(a,l)||(s[i]={prev:a,next:l})}Object.keys(s).length>0&&console.info(`[${t}] changed:`,s)}};function qe(e,t){if(Object.is(e,t))return!0;if(e===null||t===null||typeof e!="object"||typeof t!="object"||Array.isArray(e)!==Array.isArray(t))return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let o of n)if(!qe(e[o],t[o]))return!1;return!0}export{Eo as ACTIVE_THRESHOLD,Qr as ALLOWED_PASTE_MIME_TYPES,ir as APP_NAME,Io as ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO,Lo as ARROW_LABEL_WIDTH_FRACTION,jo as ARROW_TYPE,Xe as AppEventBus,ts as BIND_MODE_TIMEOUT,Oo as BOUND_TEXT_PADDING,Yn as BUCKET_FILL_BACKGROUND_PICKS,ne as BinaryHeap,jr as CANVAS_ONLY_ACTIONS,Ko as CANVAS_SEARCH_TAB,be as CJK_HAND_DRAWN_FALLBACK_FONT,yr as CLASSES,Fe as CODES,Gn as COLORS_PER_ROW,zr as COLOR_CHARCOAL_BLACK,er as COLOR_OUTLINE_CONTRAST_THRESHOLD,d as COLOR_PALETTE,Bn as COLOR_TOP_PICKS_SLOTS,Xr as COLOR_VOICE_CALL,$r as COLOR_WHITE,gr as CURSOR_TYPE,Mr as DARK_THEME_FILTER,No as DEFAULT_ADAPTIVE_RADIUS,zn as DEFAULT_CANVAS_BACKGROUND_PICKS,Kn as DEFAULT_CHART_COLOR_INDEX,Vr as DEFAULT_COLLISION_THRESHOLD,v as DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX,jn as DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE,Wn as DEFAULT_ELEMENT_BACKGROUND_PICKS,Go as DEFAULT_ELEMENT_PROPS,P as DEFAULT_ELEMENT_STROKE_COLOR_INDEX,Xn as DEFAULT_ELEMENT_STROKE_COLOR_PALETTE,Ct as DEFAULT_ELEMENT_STROKE_PICKS,$t as DEFAULT_ELEMENT_STROKE_WIDTH_KEY,Ao as DEFAULT_EXPORT_PADDING,$o as DEFAULT_FILENAME,Kr as DEFAULT_FONT_FAMILY,Lr as DEFAULT_FONT_SIZE,qr as DEFAULT_GRID_SIZE,Zr as DEFAULT_GRID_STEP,yo as DEFAULT_IMAGE_OPTIONS,br as DEFAULT_LASER_COLOR,Po as DEFAULT_PROPORTIONAL_RADIUS,qo as DEFAULT_REDUCED_GLOBAL_ALPHA,Bo as DEFAULT_SIDEBAR,me as DEFAULT_STICKY_NOTE_BG,Pr as DEFAULT_STICKY_NOTE_SIZE,rs as DEFAULT_STROKE_STREAMLINE,os as DEFAULT_STROKE_STREAMLINE_PRECISE,Wr as DEFAULT_TEXT_ALIGN,Gt as DEFAULT_TRANSFORM_HANDLE_SPACING,go as DEFAULT_UI_OPTIONS,Ae as DEFAULT_VERSION,Yr as DEFAULT_VERTICAL_ALIGN,fo as DEFAULT_ZOOM,es as DOUBLE_TAP_POSITION_THRESHOLD,pr as DRAGGING_THRESHOLD,Z as Debug,Vo as EDITOR_LS_KEYS,Zo as ELEMENT_LINK_KEY,Do as ELEMENT_PENDING_DRAW_SHAPE_OPACITY,Co as ELEMENT_READY_TO_ERASE_OPACITY,hr as ELEMENT_SHIFT_TRANSLATE_AMOUNT,mr as ELEMENT_TRANSLATE_AMOUNT,Mo as ENCRYPTION_KEY_BITS,k as ENV,Bt as EPSILON,Pt as EVENT,eo as EXPORT_DATA_TYPES,Jr as EXPORT_IMAGE_TYPES,xo as EXPORT_SCALES,B as Emitter,T as FONT_FAMILY,$ as FONT_FAMILY_FALLBACKS,Nt as FONT_FAMILY_GENERIC_FALLBACKS,U as FONT_METADATA,vr as FONT_SIZES,Br as FONT_TOP_PICKS_SLOTS,Rr as FRAME_STYLE,Vt as FREEDRAW_STROKE_WIDTH,cs as GOOGLE_FONTS_RANGES,ho as HYPERLINK_TOOLTIP_DELAY,mo as IDLE_THRESHOLD,ye as IMAGE_MIME_TYPES,no as IMAGE_RENDER_TIMEOUT,M as KEYS,en as KeyCodeMap,Wo as LIBRARY_DISABLED_TYPES,zt as LIBRARY_SIDEBAR_TAB,fr as LINE_CONFIRM_THRESHOLD,Jo as LINE_POLYGON_POINT_MERGE_DISTANCE,us as LOCAL_FONT_PROTOCOL,Hn as MAX_CUSTOM_COLORS_USED_IN_CANVAS,_o as MAX_DECIMALS_FOR_SVG_EXPORT,po as MAX_ZOOM,Te as MIME_TYPES,dr as MINIMUM_ARROW_SIZE,Or as MIN_FONT_SIZE,Xo as MIN_WIDTH_OR_HEIGHT,uo as MIN_ZOOM,ns as MOBILE_ACTION_BUTTON_BG,_e as MONOSPACE_GENERIC_FONT,_s as MQ_MAX_HEIGHT_LANDSCAPE,bs as MQ_MAX_MOBILE,As as MQ_MAX_TABLET,gs as MQ_MAX_WIDTH_LANDSCAPE,xs as MQ_MIN_TABLET,ys as MQ_MIN_WIDTH_DESKTOP,vs as MQ_RIGHT_SIDEBAR_MIN_WIDTH,Qo as ORIG_ID,_r as POINTER_BUTTON,xr as POINTER_EVENTS,Ne as PromisePool,Se as Queue,Yt as ROUGHNESS,ko as ROUNDNESS,ge as SANS_SERIF_GENERIC_FONT,io as SCROLL_TIMEOUT,Tr as SHIFT_LOCKING_ANGLE,Kt as SIDE_RESIZING_THRESHOLD,zo as STATS_PANELS,$n as STICKY_NOTE_BACKGROUND_PICKS,Dr as STICKY_NOTE_BODY_INSET_Y,Gr as STICKY_NOTE_EDGE_SHADOW_OPACITY,Hr as STICKY_NOTE_EDGE_SHADOW_WIDTH,Fr as STICKY_NOTE_FALLBACK_FONT_SIZE,Cr as STICKY_NOTE_FONT_STEP,Ht as STICKY_NOTE_FOOTER,wr as STICKY_NOTE_MAX_FONT_SIZE,Ir as STICKY_NOTE_MIN_FONT_SIZE,Nr as STICKY_NOTE_MIN_SIZE,Ut as STICKY_NOTE_PADDING,kr as STICKY_NOTE_SHADOW_OFFSET,Ur as STICKY_NOTE_SHADOW_OPACITY,Vn as STICKY_NOTE_STROKE_PICKS,Wt as STRING_MIME_TYPES,ve as STROKE_WIDTH,Uo as STROKE_WIDTH_KEYS,So as SVG_DOCUMENT_PREAMBLE,vo as SVG_NS,ro as TAP_TWICE_TIMEOUT,Fo as TEXT_ALIGN,lr as TEXT_AUTOWRAP_THRESHOLD,ur as TEXT_MAX_WRAP_WIDTH,Er as TEXT_TO_CENTER_SNAP_THRESHOLD,cr as TEXT_VIEWPORT_PADDING,Sr as THEME,so as TITLE_TIMEOUT,Yo as TOOL_TYPE,oo as TOUCH_CTX_MENU_TIMEOUT,bo as URL_HASH_KEYS,To as URL_QUERY_KEYS,Xt as UserIdleState,Ro as VERSIONS,ao as VERSION_TIMEOUT,wo as VERTICAL_ALIGN,je as VersionedSnapshotStore,L as WINDOWS_EMOJI_FALLBACK_FONT,Ar as YOUTUBE_STATES,lo as ZEN_MODE_TRANSITION_DURATION,co as ZOOM_STEP,fi as addEventListener,Ra as allowFullScreen,kn as applyDarkModeFilter,qa as arrayToList,za as arrayToMap,Xa as arrayToMapWithIndex,ja as arrayToObject,ii as assertNever,Va as bytesToHexString,pa as capitalizeString,gi as castArray,_a as chunk,pi as cloneJSON,Qn as colorToHex,ai as composeEventHandlers,ws as createUserAgentDescriptor,Ta as debounce,Is as deriveStylesPanelMode,ya as distance,ga as easeOut,Be as escapeDoubleQuotes,Oa as exitFullScreen,Na as findIndex,ka as findLastIndex,Wa as focusNearestParent,qn as getAllColorsSpecificShade,ua as getDateTime,to as getExportSource,xi as getFeatureFlag,xe as getFontFamilyFallbacks,on as getFontFamilyString,ma as getFontString,Ls as getFormFactor,un as getFrame,kt as getGenericFontFamilyFallback,wa as getGlobalCSSVariable,zs as getGridPoint,ds as getLineHeight,Ba as getNearestScrollableContainer,Vs as getSizeFromPoints,Ho as getStrokeWidthByKey,hi as getSvgPathFromStroke,$a as getUpdatedTimestamp,Ga as getVersion,ps as getVerticalOffset,Ca as hasRTLChars,li as invariant,Ie as isAndroid,Ti as isAnyTrue,Us as isArrowKey,Ln as isBounds,Os as isBrave,jt as isChrome,tr as isColorDark,Le as isDarwin,Qa as isDevEnv,Ms as isFirefox,Ma as isFullScreen,we as isIOS,rn as isInputLike,fa as isInteractive,tn as isLatinChar,Ui as isLocalLink,ui as isMemberOf,qt as isMobileBreakpoint,Jn as isOpaqueColor,ni as isPrimitive,Ke as isProdEnv,oi as isPromiseLike,Fa as isRTL,dn as isReadonlyArray,ri as isRunningInIframe,Rs as isSafari,va as isSelectionLikeTool,Ja as isServerEnv,pn as isShallowEqual,Zt as isTabletBreakpoint,q as isTestEnv,da as isToolIcon,Ee as isTransparent,Ss as isWindows,ha as isWritableElement,Fs as loadDesktopUIModePreference,Ua as mapFind,ks as matchKey,ci as memoize,Pa as muteFSAbortError,Ha as nFormatter,Ea as nextAnimationFrame,mi as normalizeEOL,nr as normalizeInputColor,yn as normalizeLink,yi as oneOf,Ya as preventUnload,Re as promiseTry,si as queryFocusableElements,wi as randomId,Li as randomInteger,_i as reduceToCommonValue,Un as removeDarkModeFilter,Aa as removeSelection,$s as rescalePoints,Ii as reseed,Me as resolvablePromise,N as rgbToHex,bi as safelyParseJSON,Ia as sceneCoordsToViewportCoords,Fi as seededRandom,xa as selectNode,Zn as setColorAlpha,ca as setDateTimeForTests,Cs as setDesktopUIMode,Ai as setFeatureFlag,Gs as shouldMaintainAspectRatio,Hs as shouldResizeFromCenter,Ks as shouldRotateWithDiscreteAngle,fn as sizeOf,Ka as supportsEmoji,ar as supportsResizeObserver,ba as throttleRAF,Za as toArray,Ei as toBrandedType,cn as toIterable,Hi as toValidURL,Da as tupleToCoors,Sa as updateActiveTool,ti as updateObject,di as updateStable,La as viewportCoordsToSceneCoords,ei as wrapEvent};
3
+ `,Lo=128,Io={excalidraw:2,excalidrawLibrary:2},wo=5,Fo=.7,Co=11,Po={TOP:"top",MIDDLE:"middle",BOTTOM:"bottom"},Do={LEFT:"left",CENTER:"center",RIGHT:"right"},No=20,ko=70,Uo=.25,Ho=32,Go={LEGACY:1,PROPORTIONAL_RADIUS:2,ADAPTIVE_RADIUS:3},zt={architect:0,artist:1,cartoonist:2},Ko=["thin","medium","bold"],Re={thin:1,medium:2,bold:4,extraBold:8},Xt={thin:.5,medium:1,bold:2,extraBold:4},Bo=(e,t)=>e==="freedraw"?Xt[t]:Re[t],jt="medium",Wo={strokeColor:d.black,backgroundColor:d.transparent,fillStyle:"solid",strokeWidth:Re[jt],strokeStyle:"solid",roughness:zt.artist,opacity:100,locked:!1},qt="library",Yo="search",Vo={name:"default",defaultTab:qt},$o=new Set(["iframe","embeddable","image"]),zo={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"},Xo={OAI_API_KEY:"excalidraw-oai-api-key",MERMAID_TO_EXCALIDRAW:"mermaid-to-excalidraw",PUBLISH_LIBRARY:"publish-library-data"},jo="Untitled",qo={generalStats:1,elementProperties:2},Zo=1,Qo={sharp:"sharp",round:"round",elbow:"elbow"},Jo=.3,es="element",ts=Symbol.for("__test__originalId__"),Zt=(r=>(r.ACTIVE="active",r.AWAY="away",r.IDLE="idle",r))(Zt||{}),ns=20,rs=35,os=700,ss={background:"var(--mobile-action-button-bg)"},is=.5,as=.2;p();var H={[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},[z.Xiaolai]:{metrics:{unitsPerEm:1e3,ascender:880,descender:-144,lineHeight:1.25},fallback:!0},[z["Segoe UI Emoji"]]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},local:!0,fallback:!0}},ds={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"},fs="local:",ms=(e,t,n)=>{let{unitsPerEm:r,ascender:o,descender:s}=H[e]?.metrics||H[T.Excalifont].metrics,a=t/r,i=(n-a*o+a*s)/2;return a*o+i},hs=e=>{let{lineHeight:t}=H[e]?.metrics||H[T.Excalifont].metrics;return t};p();var Oe=class{jobs=[];running=!1;tick(){if(this.running)return;let t=this.jobs.shift();t?(this.running=!0,t.promise.resolve(Ie(t.jobFactory,...t.args).finally(()=>{this.running=!1,this.tick()}))):this.running=!1}push(t,...n){let r=Le();return this.jobs.push({jobFactory:t,promise:r,args:n}),this.tick(),r}};p();p();var we="excalidraw.desktopUIMode",xs=599,As=1e3,ys=500,vs=600,Ss=1180,Ms=1440,Rs=1229,X=typeof navigator>"u"?void 0:navigator,j=X?.platform??"",M=X?.userAgent??"",Fe=/Mac|iPod|iPhone|iPad/.test(j),Os=/^Win/.test(j),Ce=/\b(android)\b/i.test(M),Ls=typeof window<"u"&&"netscape"in window&&M.indexOf("rv:")>1&&M.indexOf("Gecko")>1,Qt=M.indexOf("Chrome")!==-1,Is=!Qt&&M.indexOf("Safari")!==-1,Pe=/iPad|iPhone/i.test(j)||M.includes("Mac")&&typeof document<"u"&&"ontouchend"in document,ws=()=>X?.brave?.isBrave?.name==="isBrave",Jt=(e,t)=>e<=599||t<500&&e<1e3,en=(e,t)=>{let n=Math.min(e,t),r=Math.max(e,t);return n>=600&&r<=1180},tn=()=>{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(Pe)return!0;if(Ce){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},Fs=(e,t)=>Jt(e,t)?"phone":en(e,t)?"tablet":"desktop",Cs=e=>e.formFactor==="phone"?"mobile":e.formFactor==="tablet"?"compact":e.desktopUIMode,Ps=e=>{let t=e??"",n="unknown";return Pe?n="ios":Ce?n="android":t&&(n="other"),{isMobileDevice:tn(),platform:n}},Ds=()=>{if(typeof window>"u")return null;try{let e=window.localStorage.getItem(we);if(e==="compact"||e==="full")return e}catch{}return null},nn=e=>{if(!(typeof window>"u"))try{window.localStorage.setItem(we,e)}catch{}},Ns=e=>{if(!(e!=="compact"&&e!=="full"))return nn(e),e};var De={EQUAL:"Equal",MINUS:"Minus",NUM_ADD:"NumpadAdd",NUM_SUBTRACT:"NumpadSubtract",NUM_ZERO:"Numpad0",BRACKET_RIGHT:"BracketRight",BRACKET_LEFT:"BracketLeft",ONE:"Digit1",TWO:"Digit2",THREE:"Digit3",NINE:"Digit9",QUOTE:"Quote",ZERO:"Digit0",SLASH:"Slash",C:"KeyC",D:"KeyD",H:"KeyH",V:"KeyV",Z:"KeyZ",Y:"KeyY",R:"KeyR",S:"KeyS"},R={ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",BACKSPACE:"Backspace",ALT:"Alt",CTRL_OR_CMD:Fe?"metaKey":"ctrlKey",DELETE:"Delete",ENTER:"Enter",ESCAPE:"Escape",QUESTION_MARK:"?",SPACE:" ",TAB:"Tab",CHEVRON_LEFT:"<",CHEVRON_RIGHT:">",PERIOD:".",COMMA:",",SUBTRACT:"-",SLASH:"/",A:"a",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"},rn=new Map([[R.Z,De.Z],[R.Y,De.Y]]),on=e=>/^[a-z]$/.test(e.toLowerCase()),Gs=(e,t)=>{if(t===e.key.toLowerCase())return!0;let n=rn.get(t);return!!(n&&!on(e.key)&&e.code===n)},Ks=e=>e===R.ARROW_LEFT||e===R.ARROW_RIGHT||e===R.ARROW_DOWN||e===R.ARROW_UP,Bs=e=>e.altKey,Ws=e=>e.shiftKey,Ys=e=>e.shiftKey;p();import{pointFrom as Ne,pointFromPair as sn}from"@excalidraw/math";var Xs=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)}},js=(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,h=n.map(y=>{let S=y[e]*l,C=[...y];return C[e]=S,S<u&&(u=S),C});if(!r||h.length===2)return h;let b=a-u;return h.map(y=>sn(y.map((S,C)=>C===e?S+b:S)))},qs=(e,t,n)=>n?Ne(Math.round(e/n)*n,Math.round(t/n)*n):Ne(e,t);p();var Ge=oe(Ue(),1),He=class{pool;entries={};constructor(t,n){this.pool=new Ge.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 G}from"@excalidraw/math";var Z=null,di=e=>{Z=e},fi=()=>{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}`},mi=e=>e.charAt(0).toUpperCase()+e.slice(1),K=e=>{let t=e;return t?.ownerDocument?.defaultView??t?.defaultView??(typeof window>"u"?null:window)},hi=e=>{let t=K(e);return!!t&&e instanceof t.HTMLElement&&e.className.includes("ToolIcon")},an=e=>{let t=K(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)},Ei=e=>{let t=K(e);return an(e)||!!t&&e instanceof t.Element&&!!e.closest("label, button")},Ti=e=>{let t=K(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)},ln=({fontFamily:e})=>{for(let[t,n]of Object.entries(T))if(n===e)return`${t}${ve(n).map(r=>`, ${r}`).join("")}`;return I},bi=({fontSize:e,fontFamily:t})=>`${e}px ${ln({fontFamily:t})}`,gi=async e=>{requestAnimationFrame(()=>requestAnimationFrame(e))},_i=(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},xi=(e,t)=>{let n=null,r=null,o=()=>t??window,s=()=>{n=o().requestAnimationFrame(()=>{n=null;let i=r;r=null,i&&e(...i)})},a=(...i)=>{r=i,n===null&&s()};return a.flush=()=>{n!==null&&(o().cancelAnimationFrame(n),n=null),r&&(e(...r),r=null)},a.cancel=()=>{r=null,n!==null&&(o().cancelAnimationFrame(n),n=null)},a},Ai=e=>1-Math.pow(1-e,4),yi=(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},vi=e=>{let t=window.getSelection();if(t){let n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}},Si=()=>{let e=window.getSelection();e&&e.removeAllRanges()},Mi=(e,t)=>Math.abs(e-t),Ri=e=>e==="selection"||e==="lasso",Oi=(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},Li=()=>document.fullscreenElement?.nodeName==="HTML",Ii=()=>document.documentElement.requestFullscreen(),wi=()=>document.exitFullscreen(),Fi=({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}},Ci=({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}},Pi=e=>getComputedStyle(document.documentElement).getPropertyValue(`--${e}`),cn="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u2C00-\uFB1C\uFDFE-\uFE6F\uFEFD-\uFFFF",We="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",un=new RegExp(`^[^${cn}]*[${We}]`),Di=e=>un.test(e),pn=new RegExp(`[${We}]`),Ni=e=>pn.test(e),ki=e=>{let[t,n]=e;return{x:t,y:n}},Ui=e=>{if(e?.name==="AbortError"){console.warn(e);return}throw e},Hi=(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},Gi=(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},Ki=(e,t)=>{for(let n=0;n<e.length;n++){let r=t(e[n],n);if(r!=null)return r}},Le=()=>{let e,t,n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n},Bi=(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},Wi=()=>document.querySelector('meta[name="version"]')?.content||Se,Yi=()=>{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},Vi=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},$i=e=>{let t=e.parentElement;for(;t;){if(t.tabIndex>-1){t.focus();return}t=t.parentElement}},zi=e=>{e.preventDefault(),e.returnValue=""},Xi=e=>Array.from(e).map(t=>`0${t.toString(16)}`.slice(-2)).join(""),ji=()=>J()?1:Date.now(),qi=e=>e instanceof Map?e:e.reduce((t,n)=>(t.set(typeof n=="string"?n:n.id,n),t),new Map),Zi=e=>e.reduce((t,n,r)=>(t.set(n.id,[n,r]),t),new Map),Qi=(e,t)=>e.reduce((n,r,o)=>(n[t?t(r):o]=r,n),{}),Ji=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},[]),dn=e=>Array.isArray(e)?e:e.values(),ea=e=>Array.isArray(e)?e:Array.from(dn(e)),J=()=>m.MODE===U.TEST,ta=()=>m.MODE===U.DEVELOPMENT,Ye=()=>m.MODE===U.PRODUCTION,na=()=>typeof process<"u"&&!0,ra=(e,t)=>new CustomEvent(e,{detail:{nativeEvent:t},cancelable:!0}),oa=(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},sa=e=>{let t=typeof e;return e==null||t!=="object"&&t!=="function"},fn=()=>{try{return window.self===window.top?"top":"iframe"}catch{return"iframe"}},ia=()=>fn()==="iframe",aa=e=>!!e&&typeof e=="object"&&"then"in e&&"catch"in e&&"finally"in e,la=e=>{let t=e?.querySelectorAll("button, a, input, select, textarea, div[tabindex], label[tabindex]");return t?Array.from(t).filter(n=>n.tabIndex>-1&&!n.disabled):[]},Be=(e,t)=>Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t,mn=(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]||Be(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]||Be(e[a],t[a]);return!l&&r&&console.warn(`%cisShallowEqual: ${a} not equal ->`,"color: #8B4000",e[a],t[a]),l})},ca=(e,t,{checkForDefaultPrevented:n=!0}={})=>function(o){if(e?.(o),!n||!o?.defaultPrevented)return t?.(o)},ua=(e,t,n)=>{if(!t)return e;if(n)return console.error(t),e;throw new Error(t)};function pa(e,t){if(!e)throw new Error(t)}var da=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},fa=(e,t)=>e instanceof Set||e instanceof Map?e.has(t):"includes"in e?e.includes(t):e.hasOwnProperty(t),ma=e=>JSON.parse(JSON.stringify(e)),ha=(e,t)=>mn(e,t)?e:t;function Ea(e,t,n,r){return e?(e?.addEventListener?.(t,n,r),()=>{e?.removeEventListener?.(t,n,r)}):()=>{}}function Ta(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)} ${G(o[0],s[0]).toFixed(2)},${G(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+=`${G(r[0],o[0]).toFixed(2)},${G(r[1],o[1]).toFixed(2)} `;return t&&(a+="Z"),a}var ba=e=>e.replace(/\r?\n|\r/g,`
4
+ `);function ga(e){return e}var Ie=async(e,...t)=>new Promise(n=>{n(e(...t))}),_a=(...e)=>Math.max(...e.map(t=>t?1:0))>0,xa=e=>{try{return JSON.parse(e)}catch{return null}},Ve=e=>e.replace(/"/g,"&quot;"),Aa=e=>Array.isArray(e)?e:[e],hn=e=>Array.isArray(e),En=e=>hn(e)?e.length:e instanceof Map||e instanceof Set?e.size:Object.keys(e).length,ya=(e,t)=>{if(En(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},$e="excalidraw-feature-flags",Q={COMPLEX_BINDINGS:!1},O=null,va=e=>{if(!O)try{let t=localStorage.getItem($e);t&&(O=JSON.parse(t)??Q)}catch{}return(O||Q)[e]},Sa=(e,t)=>{try{O={...O||Q,[e]:t},localStorage.setItem($e,JSON.stringify(O))}catch(n){console.error("unable to set feature flag",n)}},Ma=(e,t)=>t.includes(e);var ze=new w(Date.now()),Xe=0,Fa=()=>Math.floor(ze.next()*2**31),Ca=e=>{ze=new w(e),Xe=0},Pa=()=>J()?`id${Xe++}`:Ke(),Da=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 qe=oe(je(),1);var Mn=e=>(e=e.trim(),e&&(0,qe.sanitizeUrl)(Ve(e))),Ka=e=>!!(e?.includes(location.origin)||e?.startsWith("/")),Ba=e=>{if(e=Mn(e),e.startsWith("/"))return`${location.origin}${e}`;try{new URL(e)}catch{return"about:blank"}return e};p();var W=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 W,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(!Ye()&&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 Qe=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)),Rn=e=>F(e.reduce((t,n)=>t+n)/e.length),ee=class e{static DEBUG_LOG_TIMES=!0;static TIMES_AGGR={};static TIMES_AVG={};static LAST_DEBUG_LOG_CALL=0;static DEBUG_LOG_INTERVAL_ID=null;static LAST_FRAME_TIMESTAMP=0;static FRAME_COUNT=0;static ANIMATION_FRAME_ID=null;static scheduleAnimationFrame=()=>{e.DEBUG_LOG_INTERVAL_ID!==null&&(e.ANIMATION_FRAME_ID=requestAnimationFrame(t=>{e.LAST_FRAME_TIMESTAMP!==t&&(e.LAST_FRAME_TIMESTAMP=t,e.FRAME_COUNT++),e.DEBUG_LOG_INTERVAL_ID!==null&&e.scheduleAnimationFrame()}))};static setupInterval=()=>{e.DEBUG_LOG_INTERVAL_ID===null&&(console.info("%c(starting perf recording)","color: lime"),e.DEBUG_LOG_INTERVAL_ID=window.setInterval(e.debugLogger,1e3),e.scheduleAnimationFrame()),e.LAST_DEBUG_LOG_CALL=Date.now()};static debugLogger=()=>{if(e.DEBUG_LOG_TIMES){for(let[t,{t:n,times:r}]of Object.entries(e.TIMES_AGGR))r.length&&(console.info(t,F(r.reduce((o,s)=>o+s)),r.sort((o,s)=>o-s).map(o=>F(o))),e.TIMES_AGGR[t]={t:n,times:[]});for(let[t,{t:n,times:r,avg:o}]of Object.entries(e.TIMES_AVG))if(r.length){let s=r.reduce((i,l)=>i+l),a=F(s/e.FRAME_COUNT);console.info(t,`- ${r.length} calls - ${a}ms/frame across ${e.FRAME_COUNT} frames (${F(a/16.67*100,1)}% of frame budget)`),e.TIMES_AVG[t]={t:n,times:[],avg:o!=null?Rn([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{go as ACTIVE_THRESHOLD,to as ALLOWED_PASTE_MIME_TYPES,ur as APP_NAME,Co as ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO,Fo as ARROW_LABEL_WIDTH_FRACTION,Qo as ARROW_TYPE,Ze as AppEventBus,os as BIND_MODE_TIMEOUT,wo as BOUND_TEXT_PADDING,zn as BUCKET_FILL_BACKGROUND_PICKS,se as BinaryHeap,Qr as CANVAS_ONLY_ACTIONS,Yo as CANVAS_SEARCH_TAB,xe as CJK_HAND_DRAWN_FALLBACK_FONT,Mr as CLASSES,De as CODES,Wn as COLORS_PER_ROW,qr as COLOR_CHARCOAL_BLACK,rr as COLOR_OUTLINE_CONTRAST_THRESHOLD,d as COLOR_PALETTE,Vn as COLOR_TOP_PICKS_SLOTS,Zr as COLOR_VOICE_CALL,jr as COLOR_WHITE,Ar as CURSOR_TYPE,Lr as DARK_THEME_FILTER,Ho as DEFAULT_ADAPTIVE_RADIUS,qn as DEFAULT_CANVAS_BACKGROUND_PICKS,Yn as DEFAULT_CHART_COLOR_INDEX,Xr as DEFAULT_COLLISION_THRESHOLD,v as DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX,Qn as DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE,$n as DEFAULT_ELEMENT_BACKGROUND_PICKS,Wo as DEFAULT_ELEMENT_PROPS,N as DEFAULT_ELEMENT_STROKE_COLOR_INDEX,Zn as DEFAULT_ELEMENT_STROKE_COLOR_PALETTE,Nt as DEFAULT_ELEMENT_STROKE_PICKS,jt as DEFAULT_ELEMENT_STROKE_WIDTH_KEY,So as DEFAULT_EXPORT_PADDING,jo as DEFAULT_FILENAME,Yr as DEFAULT_FONT_FAMILY,Fr as DEFAULT_FONT_SIZE,Jr as DEFAULT_GRID_SIZE,eo as DEFAULT_GRID_STEP,Mo as DEFAULT_IMAGE_OPTIONS,xr as DEFAULT_LASER_COLOR,Uo as DEFAULT_PROPORTIONAL_RADIUS,Jo as DEFAULT_REDUCED_GLOBAL_ALPHA,Vo as DEFAULT_SIDEBAR,be as DEFAULT_STICKY_NOTE_BG,Ur as DEFAULT_STICKY_NOTE_SIZE,is as DEFAULT_STROKE_STREAMLINE,as as DEFAULT_STROKE_STREAMLINE_PRECISE,$r as DEFAULT_TEXT_ALIGN,Wt as DEFAULT_TRANSFORM_HANDLE_SPACING,Ao as DEFAULT_UI_OPTIONS,Se as DEFAULT_VERSION,zr as DEFAULT_VERTICAL_ALIGN,Eo as DEFAULT_ZOOM,rs as DOUBLE_TAP_POSITION_THRESHOLD,mr as DRAGGING_THRESHOLD,ee as Debug,Xo as EDITOR_LS_KEYS,es as ELEMENT_LINK_KEY,ko as ELEMENT_PENDING_DRAW_SHAPE_OPACITY,No as ELEMENT_READY_TO_ERASE_OPACITY,Tr as ELEMENT_SHIFT_TRANSLATE_AMOUNT,br as ELEMENT_TRANSLATE_AMOUNT,Lo as ENCRYPTION_KEY_BITS,U as ENV,Vt as EPSILON,Ut as EVENT,ro as EXPORT_DATA_TYPES,no as EXPORT_IMAGE_TYPES,vo as EXPORT_SCALES,W as Emitter,T as FONT_FAMILY,z as FONT_FAMILY_FALLBACKS,Ht as FONT_FAMILY_GENERIC_FALLBACKS,H as FONT_METADATA,Rr as FONT_SIZES,Vr as FONT_TOP_PICKS_SLOTS,Ir as FRAME_STYLE,Xt as FREEDRAW_STROKE_WIDTH,ds as GOOGLE_FONTS_RANGES,To as HYPERLINK_TOOLTIP_DELAY,bo as IDLE_THRESHOLD,Me as IMAGE_MIME_TYPES,so as IMAGE_RENDER_TIMEOUT,R as KEYS,rn as KeyCodeMap,$o as LIBRARY_DISABLED_TYPES,qt as LIBRARY_SIDEBAR_TAB,Er as LINE_CONFIRM_THRESHOLD,ns as LINE_POLYGON_POINT_MERGE_DISTANCE,fs as LOCAL_FONT_PROTOCOL,Bn as MAX_CUSTOM_COLORS_USED_IN_CANVAS,yo as MAX_DECIMALS_FOR_SVG_EXPORT,ho as MAX_ZOOM,_e as MIME_TYPES,hr as MINIMUM_ARROW_SIZE,wr as MIN_FONT_SIZE,Zo as MIN_WIDTH_OR_HEIGHT,mo as MIN_ZOOM,ss as MOBILE_ACTION_BUTTON_BG,ye as MONOSPACE_GENERIC_FONT,ys as MQ_MAX_HEIGHT_LANDSCAPE,xs as MQ_MAX_MOBILE,Ss as MQ_MAX_TABLET,As as MQ_MAX_WIDTH_LANDSCAPE,vs as MQ_MIN_TABLET,Ms as MQ_MIN_WIDTH_DESKTOP,Rs as MQ_RIGHT_SIDEBAR_MIN_WIDTH,ts as ORIG_ID,yr as POINTER_BUTTON,vr as POINTER_EVENTS,He as PromisePool,Oe as Queue,zt as ROUGHNESS,Go as ROUNDNESS,Ae as SANS_SERIF_GENERIC_FONT,uo as SCROLL_TIMEOUT,_r as SHIFT_LOCKING_ANGLE,Yt as SIDE_RESIZING_THRESHOLD,qo as STATS_PANELS,jn as STICKY_NOTE_BACKGROUND_PICKS,kr as STICKY_NOTE_BODY_INSET_Y,Wr as STICKY_NOTE_EDGE_SHADOW_OPACITY,Br as STICKY_NOTE_EDGE_SHADOW_WIDTH,Dr as STICKY_NOTE_FALLBACK_FONT_SIZE,Nr as STICKY_NOTE_FONT_STEP,Bt as STICKY_NOTE_FOOTER,Pr as STICKY_NOTE_MAX_FONT_SIZE,Cr as STICKY_NOTE_MIN_FONT_SIZE,Hr as STICKY_NOTE_MIN_SIZE,Kt as STICKY_NOTE_PADDING,Gr as STICKY_NOTE_SHADOW_OFFSET,Kr as STICKY_NOTE_SHADOW_OPACITY,Xn as STICKY_NOTE_STROKE_PICKS,$t as STRING_MIME_TYPES,Re as STROKE_WIDTH,Ko as STROKE_WIDTH_KEYS,Oo as SVG_DOCUMENT_PREAMBLE,Ro as SVG_NS,io as TAP_TWICE_TIMEOUT,Do as TEXT_ALIGN,pr as TEXT_AUTOWRAP_THRESHOLD,fr as TEXT_MAX_WRAP_WIDTH,gr as TEXT_TO_CENTER_SNAP_THRESHOLD,dr as TEXT_VIEWPORT_PADDING,Or as THEME,lo as TITLE_TIMEOUT,zo as TOOL_TYPE,ao as TOUCH_CTX_MENU_TIMEOUT,xo as URL_HASH_KEYS,_o as URL_QUERY_KEYS,Zt as UserIdleState,Io as VERSIONS,co as VERSION_TIMEOUT,Po as VERTICAL_ALIGN,Qe as VersionedSnapshotStore,I as WINDOWS_EMOJI_FALLBACK_FONT,Sr as YOUTUBE_STATES,po as ZEN_MODE_TRANSITION_DURATION,fo as ZOOM_STEP,Ea as addEventListener,Ii as allowFullScreen,Gn as applyDarkModeFilter,Ji as arrayToList,qi as arrayToMap,Zi as arrayToMapWithIndex,Qi as arrayToObject,ua as assertNever,Xi as bytesToHexString,mi as capitalizeString,Aa as castArray,yi as chunk,ma as cloneJSON,tr as colorToHex,ca as composeEventHandlers,Ps as createUserAgentDescriptor,_i as debounce,Cs as deriveStylesPanelMode,Mi as distance,Ai as easeOut,Ve as escapeDoubleQuotes,wi as exitFullScreen,Hi as findIndex,Gi as findLastIndex,$i as focusNearestParent,Jn as getAllColorsSpecificShade,fi as getDateTime,oo as getExportSource,va as getFeatureFlag,ve as getFontFamilyFallbacks,ln as getFontFamilyString,bi as getFontString,Fs as getFormFactor,fn as getFrame,Gt as getGenericFontFamilyFallback,Pi as getGlobalCSSVariable,qs as getGridPoint,hs as getLineHeight,Vi as getNearestScrollableContainer,Xs as getSizeFromPoints,Bo as getStrokeWidthByKey,Ta as getSvgPathFromStroke,K as getTargetWindow,ji as getUpdatedTimestamp,Wi as getVersion,ms as getVerticalOffset,Ni as hasRTLChars,pa as invariant,Ce as isAndroid,_a as isAnyTrue,Ks as isArrowKey,Fn as isBounds,ws as isBrave,Qt as isChrome,or as isColorDark,Fe as isDarwin,ta as isDevEnv,Ls as isFirefox,Li as isFullScreen,Pe as isIOS,an as isInputLike,Ei as isInteractive,on as isLatinChar,Ka as isLocalLink,fa as isMemberOf,Jt as isMobileBreakpoint,nr as isOpaqueColor,sa as isPrimitive,Ye as isProdEnv,aa as isPromiseLike,Di as isRTL,hn as isReadonlyArray,ia as isRunningInIframe,Is as isSafari,Ri as isSelectionLikeTool,na as isServerEnv,mn as isShallowEqual,en as isTabletBreakpoint,J as isTestEnv,hi as isToolIcon,ge as isTransparent,Os as isWindows,Ti as isWritableElement,Ds as loadDesktopUIModePreference,Ki as mapFind,Gs as matchKey,da as memoize,Ui as muteFSAbortError,Bi as nFormatter,gi as nextAnimationFrame,ba as normalizeEOL,sr as normalizeInputColor,Mn as normalizeLink,Ma as oneOf,zi as preventUnload,Ie as promiseTry,la as queryFocusableElements,Pa as randomId,Fa as randomInteger,ya as reduceToCommonValue,Kn as removeDarkModeFilter,Si as removeSelection,js as rescalePoints,Ca as reseed,Le as resolvablePromise,k as rgbToHex,xa as safelyParseJSON,Ci as sceneCoordsToViewportCoords,Da as seededRandom,vi as selectNode,er as setColorAlpha,di as setDateTimeForTests,Ns as setDesktopUIMode,Sa as setFeatureFlag,Ws as shouldMaintainAspectRatio,Bs as shouldResizeFromCenter,Ys as shouldRotateWithDiscreteAngle,En as sizeOf,Yi as supportsEmoji,cr as supportsResizeObserver,xi as throttleRAF,ea as toArray,ga as toBrandedType,dn as toIterable,Ba as toValidURL,ki as tupleToCoors,Oi as updateActiveTool,oa as updateObject,ha as updateStable,Fi as viewportCoordsToSceneCoords,ra as wrapEvent};
@@ -6,6 +6,12 @@ import type { EVENT } from "./constants";
6
6
  export declare const setDateTimeForTests: (dateTime: string) => void;
7
7
  export declare const getDateTime: () => string;
8
8
  export declare const capitalizeString: (str: string) => string;
9
+ /**
10
+ * Resolves the window owning `target`, so that we keep working when the editor
11
+ * is rendered into another document. Accepts a `Document` as well, in which
12
+ * case its `defaultView` is used. Falls back to the module realm's window.
13
+ */
14
+ export declare const getTargetWindow: (target: Element | EventTarget | Document | null) => (Window & typeof globalThis) | null;
9
15
  export declare const isToolIcon: (target: Element | EventTarget | null) => target is HTMLElement;
10
16
  export declare const isInputLike: (target: Element | EventTarget | null) => target is HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | HTMLBRElement | HTMLDivElement;
11
17
  export declare const isInteractive: (target: Element | EventTarget | null) => boolean;
@@ -25,7 +31,7 @@ export declare const debounce: <T extends any[]>(fn: (...args: T) => void, timeo
25
31
  flush(): void;
26
32
  cancel(): void;
27
33
  };
28
- export declare const throttleRAF: <T extends any[]>(fn: (...args: T) => void) => {
34
+ export declare const throttleRAF: <T extends any[]>(fn: (...args: T) => void, ownerWindow?: Pick<Window, "requestAnimationFrame" | "cancelAnimationFrame">) => {
29
35
  (...args: T): void;
30
36
  flush(): void;
31
37
  cancel(): void;
@@ -1,8 +1,11 @@
1
1
  import type { AppState } from "@excalidraw/excalidraw/types";
2
+ import type { RenderEnvironment } from "./renderEnvironment";
2
3
  import type { Scene } from "./Scene";
3
4
  import type { NonDeletedExcalidrawElement } from "./types";
4
5
  export interface Alignment {
5
6
  position: "start" | "center" | "end";
6
7
  axis: "x" | "y";
7
8
  }
8
- export declare const alignElements: (selectedElements: NonDeletedExcalidrawElement[], alignment: Alignment, scene: Scene, appState: Readonly<AppState>) => NonDeletedExcalidrawElement[];
9
+ export declare const alignElements: (selectedElements: NonDeletedExcalidrawElement[], alignment: Alignment, scene: Scene, appState: Readonly<AppState>,
10
+ /** measures the labels of the bound arrows the alignment moves */
11
+ renderEnvironment?: RenderEnvironment) => NonDeletedExcalidrawElement[];
@@ -3,6 +3,7 @@ import type { LineSegment, LocalPoint } from "@excalidraw/math";
3
3
  import type { AppState, NullableGridSize } from "@excalidraw/excalidraw/types";
4
4
  import type { Bounds } from "@excalidraw/common";
5
5
  import { type Heading } from "./heading";
6
+ import type { RenderEnvironment } from "./renderEnvironment";
6
7
  import type { Scene } from "./Scene";
7
8
  import type { ElementUpdate } from "./mutateElement";
8
9
  import type { BindMode, ElementsMap, ExcalidrawArrowElement, ExcalidrawBindableElement, ExcalidrawElbowArrowElement, ExcalidrawElement, FixedPoint, FixedPointBinding, NonDeleted, NonDeletedExcalidrawElement, NonDeletedSceneElementsMap, Ordered, PointsPositionUpdates } from "./types";
@@ -55,12 +56,45 @@ export declare const getBindingStrategyForDraggingBindingElementEndpoints: (arro
55
56
  };
56
57
  export declare const bindOrUnbindBindingElements: (selectedArrows: NonDeleted<ExcalidrawArrowElement>[], scene: Scene, appState: AppState) => void;
57
58
  export declare const bindBindingElement: (arrow: NonDeleted<ExcalidrawArrowElement>, hoveredElement: NonDeleted<ExcalidrawBindableElement>, mode: BindMode, startOrEnd: "start" | "end", scene: Scene, zoom: AppState["zoom"], focusPoint?: GlobalPoint, shouldSnapToOutline?: boolean, isMidpointSnappingEnabled?: boolean) => void;
59
+ /**
60
+ * Whether the arrow's end is bound to an element it's beyond the binding area
61
+ * of, i.e. that it couldn't be bound to in the editor (e.g. a participant's
62
+ * header in a sequence diagram, as laid out by mermaid)
63
+ */
64
+ export declare const isEndBoundBeyondBindingArea: (arrow: ExcalidrawArrowElement, startOrEnd: "start" | "end", elementsMap: NonDeletedSceneElementsMap, zoom: AppState["zoom"]) => boolean;
65
+ /**
66
+ * Extends the arrow's bound end along its end segment, by the segment's length
67
+ * (at least MIN_BOUND_END_EXTENSION), to find where it would reach the element
68
+ * it's bound to, off the element by the binding gap. Moving the end there
69
+ * restores bindings given to arrows that just fall short of their elements.
70
+ *
71
+ * @returns where to move the end to, or null if it doesn't reach the element
72
+ */
73
+ export declare const getBoundEndExtension: (arrow: ExcalidrawArrowElement, startOrEnd: "start" | "end", elementsMap: NonDeletedSceneElementsMap) => GlobalPoint | null;
58
74
  export declare const unbindBindingElement: (arrow: ExcalidrawArrowElement, startOrEnd: "start" | "end", scene: Scene) => ExcalidrawBindableElement["id"] | null;
59
75
  export declare const reanchorBindingsToOutline: (changedElement: NonDeleted<ExcalidrawBindableElement>, scene: Scene, zoom: AppState["zoom"]) => void;
76
+ /**
77
+ * Places both bound ends of `arrow` where its bindings put them on the elements
78
+ * in `elementsMap` they're bound to, and rewraps its label along it as placed.
79
+ * Leaves the label's x/y as they were (the editor derives arrow labels' x/y as
80
+ * it renders them), so callers returning the elements as data must store them
81
+ * (see `LinearElementEditor.getBoundTextElementPosition`).
82
+ */
83
+ export declare const updateBoundArrow: (arrow: NonDeleted<ExcalidrawArrowElement>, scene: Scene, elementsMap: ElementsMap,
84
+ /** measures the arrow's label */
85
+ renderEnvironment?: RenderEnvironment,
86
+ /**
87
+ * whether it's placed as what it's bound to moved: an arrow bound to one
88
+ * element at both ends then moves with it whole (its midpoints with its
89
+ * start), rather than only at its ends
90
+ */
91
+ boundElementMoved?: boolean) => void;
60
92
  export declare const updateBoundElements: (changedElement: NonDeletedExcalidrawElement, scene: Scene, options?: {
61
93
  /** see `getSimultaneouslyUpdatedElementIds` for how to pass it */
62
94
  simultaneouslyUpdated?: readonly NonDeletedExcalidrawElement[];
63
95
  changedElements?: Map<string, ExcalidrawElement>;
96
+ /** measures the labels of the arrows it updates (the host's, in the editor) */
97
+ renderEnvironment?: RenderEnvironment;
64
98
  }) => void;
65
99
  export declare const updateBindings: (latestElement: NonDeletedExcalidrawElement, scene: Scene, appState: AppState, options?: {
66
100
  simultaneouslyUpdated?: readonly NonDeletedExcalidrawElement[];
@@ -68,6 +102,8 @@ export declare const updateBindings: (latestElement: NonDeletedExcalidrawElement
68
102
  width: number;
69
103
  height: number;
70
104
  };
105
+ /** measures the labels of the bound arrows it updates */
106
+ renderEnvironment?: RenderEnvironment;
71
107
  }) => void;
72
108
  /**
73
109
  * The id set of `simultaneouslyUpdated`, shared by every `updateBoundElements()`
@@ -39,10 +39,16 @@ export declare const getDiamondPoints: (element: ExcalidrawElement) => number[];
39
39
  export declare const getCubicBezierCurveBound: (p0: GlobalPoint, p1: GlobalPoint, p2: GlobalPoint, p3: GlobalPoint) => Bounds;
40
40
  export declare const getMinMaxXYFromCurvePathOps: (ops: Op[], transformXY?: (p: GlobalPoint) => GlobalPoint) => Bounds;
41
41
  export declare const getBoundsFromPoints: <P extends GlobalPoint | LocalPoint>(points: readonly P[], padding?: number) => Bounds;
42
+ export declare const CARDINALITY_ONE_OR_MANY_BAR_OFFSET = -0.25;
43
+ export declare const CARDINALITY_INNER_BAR_OFFSET = -0.5;
44
+ export declare const CARDINALITY_ZERO_CIRCLE_OFFSET = 1.5;
45
+ export declare const CARDINALITY_ZERO_CIRCLE_SCALE = 0.8;
42
46
  /** @returns number in pixels */
43
47
  export declare const getArrowheadSize: (arrowhead: Arrowhead) => number;
44
48
  /** @returns number in degrees */
45
- export declare const getArrowheadAngle: (arrowhead: Arrowhead) => Degrees;
49
+ export declare const getArrowheadAngle: (arrowhead: Arrowhead,
50
+ /** size the arrowhead is drawn at, if scaled down */
51
+ size?: number) => Degrees;
46
52
  export declare const getArrowheadPoints: (element: ExcalidrawLinearElement, shape: Drawable[], position: "start" | "end", arrowhead: Arrowhead, offsetMultiplier?: number) => number[] | null;
47
53
  export declare const getElementBounds: (element: ExcalidrawElement, elementsMap: ElementsMap, nonRotated?: boolean) => Bounds;
48
54
  export declare const getCommonBounds: (elements: ElementsMapOrArray, elementsMap?: ElementsMap) => Bounds;
@@ -81,7 +87,7 @@ export declare const boundsContainBounds: (outerBounds: Bounds, innerBounds: Bou
81
87
  * It can be used to get elements overlapping a selection box, for example.
82
88
  *
83
89
  */
84
- export declare const elementsOverlappingBBox: <T extends ExcalidrawElement>({ elements, elementsMap, bounds, type, excludeElementsInFrames, shouldIgnoreElementFromSelection, }: {
90
+ export declare const elementsOverlappingBBox: <T extends ExcalidrawElement>({ elements, elementsMap, bounds, type, excludeElementsInFrames, shouldIgnoreElementFromSelection, includeStroke, }: {
85
91
  elements: readonly T[];
86
92
  elementsMap?: ElementsMap;
87
93
  bounds: Bounds | ExcalidrawElement;
@@ -92,5 +98,7 @@ export declare const elementsOverlappingBBox: <T extends ExcalidrawElement>({ el
92
98
  type: "contain" | "overlap";
93
99
  excludeElementsInFrames?: boolean;
94
100
  shouldIgnoreElementFromSelection?: (element: T) => boolean;
101
+ /** whether elements extend by their stroke, as they render */
102
+ includeStroke?: boolean;
95
103
  }) => T[];
96
104
  export declare const elementCenterPoint: (element: ExcalidrawElement, elementsMap: ElementsMap, xOffset?: number, yOffset?: number) => GlobalPoint;
@@ -14,6 +14,13 @@ export declare const hitElementItself: ({ point, element, threshold, elementsMap
14
14
  export declare const hitElementBoundingBox: (point: GlobalPoint, element: ExcalidrawElement, elementsMap: ElementsMap, tolerance?: number) => boolean;
15
15
  export declare const hitElementBoundingBoxOnly: (hitArgs: HitTestArgs, elementsMap: ElementsMap) => boolean;
16
16
  export declare const hitElementBoundText: (point: GlobalPoint, element: ExcalidrawElement, elementsMap: ElementsMap) => boolean;
17
+ /**
18
+ * Whether an arrow endpoint at the point could bind to the element: inside it,
19
+ * or within binding distance of its outline. Unlike `getBindingCandidates`,
20
+ * it ignores frame clipping, as frames may not be sized yet (e.g. while
21
+ * converting skeletons, where frames are sized around their children last)
22
+ */
23
+ export declare const isPointInBindingArea: (point: GlobalPoint, element: NonDeleted<ExcalidrawBindableElement>, elementsMap: ElementsMap, zoom: AppState["zoom"]) => boolean;
17
24
  /**
18
25
  * Whether the element hides what is behind it from binding — an arrow's or a
19
26
  * text label's. Images count as opaque, and frames once they support a
@@ -1,13 +1,45 @@
1
- import type { TransformHandleType } from "./transformHandles";
2
- import type { ElementsMap, ExcalidrawImageElement, ImageCrop } from "./types";
1
+ import type { TransformHandleDirection } from "./transformHandles";
2
+ import type { ElementsMap, ExcalidrawImageElement } from "./types";
3
3
  export declare const MINIMAL_CROP_SIZE = 10;
4
- export declare const cropElement: (element: ExcalidrawImageElement, elementsMap: ElementsMap, transformHandle: TransformHandleType, naturalWidth: number, naturalHeight: number, pointerX: number, pointerY: number, widthAspectRatio?: number) => {
4
+ /**
5
+ * Crops the image (as it was at the drag's start) as resizing it would
6
+ * resize it, as far as the image reaches.
7
+ */
8
+ export declare const cropElement: (element: ExcalidrawImageElement, elementsMap: ElementsMap, transformHandle: TransformHandleDirection, naturalWidth: number, naturalHeight: number, pointerX: number, pointerY: number, { shouldMaintainAspectRatio, shouldResizeFromCenter, }?: {
9
+ shouldMaintainAspectRatio?: boolean;
10
+ shouldResizeFromCenter?: boolean;
11
+ }) => {
5
12
  x: number;
6
13
  y: number;
7
14
  width: number;
8
15
  height: number;
9
- crop: ImageCrop | null;
16
+ crop: {
17
+ x: number;
18
+ y: number;
19
+ width: number;
20
+ height: number;
21
+ naturalWidth: number;
22
+ naturalHeight: number;
23
+ } | null;
10
24
  };
25
+ /**
26
+ * Uncrops the image on the handle's side (a corner's two); mirrored, on the
27
+ * opposite side(s) too.
28
+ */
29
+ export declare const uncropElementSides: (element: ExcalidrawImageElement, elementsMap: ElementsMap, handle: TransformHandleDirection, mirrored?: boolean) => {
30
+ x: number;
31
+ y: number;
32
+ width: number;
33
+ height: number;
34
+ crop: {
35
+ x: number;
36
+ y: number;
37
+ width: number;
38
+ height: number;
39
+ naturalWidth: number;
40
+ naturalHeight: number;
41
+ } | null;
42
+ } | null;
11
43
  export declare const getUncroppedImageElement: (element: ExcalidrawImageElement, elementsMap: ElementsMap) => ExcalidrawImageElement;
12
44
  export declare const getUncroppedWidthAndHeight: (element: ExcalidrawImageElement) => {
13
45
  width: number;
@@ -2,6 +2,7 @@ import type { ExcalidrawElement, Ordered, OrderedExcalidrawElement, SceneElement
2
2
  import type { DTO, ValueOf } from "@excalidraw/common/utility-types";
3
3
  import type { AppState, ObservedAppState } from "@excalidraw/excalidraw/types";
4
4
  import { StoreSnapshot } from "./store";
5
+ import type { RenderEnvironment } from "./renderEnvironment";
5
6
  /**
6
7
  * Represents the difference between two objects of the same type.
7
8
  *
@@ -146,6 +147,11 @@ export declare class AppStateDelta implements DeltaContainer<AppState> {
146
147
  type ElementPartial<TElement extends ExcalidrawElement = ExcalidrawElement> = Omit<Partial<Ordered<TElement>>, "id" | "updated" | "seed">;
147
148
  export type ApplyToOptions = {
148
149
  excludedProperties?: Set<keyof ElementPartial>;
150
+ /**
151
+ * measures the labels re-laid out after applying (bound texts, and the
152
+ * labels of bound arrows) -- the editor passes the host's
153
+ */
154
+ renderEnvironment?: RenderEnvironment;
149
155
  };
150
156
  /**
151
157
  * Elements change is a low level primitive to capture a change between two sets of elements.
@@ -236,7 +242,7 @@ export declare class ElementsDelta implements DeltaContainer<SceneElementsMap> {
236
242
  * should be rebound (if possible) with the current element ~ bindings should be bidirectional.
237
243
  */
238
244
  private static rebindAffected;
239
- static redrawElements(nextElements: SceneElementsMap, changedElements: Map<string, OrderedExcalidrawElement>): SceneElementsMap;
245
+ static redrawElements(nextElements: SceneElementsMap, changedElements: Map<string, OrderedExcalidrawElement>, renderEnvironment?: RenderEnvironment): SceneElementsMap;
240
246
  private static redrawTextBoundingBoxes;
241
247
  private static redrawBoundArrows;
242
248
  private static reorderElements;
@@ -1,8 +1,11 @@
1
1
  import type { AppState } from "@excalidraw/excalidraw/types";
2
+ import type { RenderEnvironment } from "./renderEnvironment";
2
3
  import type { Scene } from "./Scene";
3
4
  import type { ElementsMap, NonDeletedExcalidrawElement } from "./types";
4
5
  export interface Distribution {
5
6
  space: "between";
6
7
  axis: "x" | "y";
7
8
  }
8
- export declare const distributeElements: (selectedElements: NonDeletedExcalidrawElement[], elementsMap: ElementsMap, distribution: Distribution, appState: Readonly<AppState>, scene: Scene) => NonDeletedExcalidrawElement[];
9
+ export declare const distributeElements: (selectedElements: NonDeletedExcalidrawElement[], elementsMap: ElementsMap, distribution: Distribution, appState: Readonly<AppState>, scene: Scene,
10
+ /** measures the labels of the bound arrows the distribution moves */
11
+ renderEnvironment?: RenderEnvironment) => NonDeletedExcalidrawElement[];
@@ -1,5 +1,6 @@
1
1
  import type { AppState, NormalizedZoomValue, NullableGridSize, PointerDownState } from "@excalidraw/excalidraw/types";
2
2
  import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
3
+ import type { RenderEnvironment } from "./renderEnvironment";
3
4
  import type { Scene } from "./Scene";
4
5
  import type { ExcalidrawTextElement } from "./types";
5
6
  export declare const dragSelectedElements: (pointerDownState: PointerDownState, _selectedElements: NonDeletedExcalidrawElement[], offset: {
@@ -8,7 +9,9 @@ export declare const dragSelectedElements: (pointerDownState: PointerDownState,
8
9
  }, scene: Scene, snapOffset: {
9
10
  x: number;
10
11
  y: number;
11
- }, gridSize: NullableGridSize) => void;
12
+ }, gridSize: NullableGridSize,
13
+ /** measures the labels of the bound arrows the drag moves */
14
+ renderEnvironment?: RenderEnvironment) => void;
12
15
  export declare const getDragOffsetXY: (selectedElements: NonDeletedExcalidrawElement[], x: number, y: number) => [number, number];
13
16
  /**
14
17
  * Sizes a text element as it is dragged out.
@@ -24,7 +27,7 @@ export declare const getDragOffsetXY: (selectedElements: NonDeletedExcalidrawEle
24
27
  * over the arrow, since dragging that way makes no progress rather than
25
28
  * flipping the box around.
26
29
  */
27
- export declare const dragNewTextElement: ({ newElement, anchorX, anchorRatio, pointerX, nextY, zoom, scene, informMutation, }: {
30
+ export declare const dragNewTextElement: ({ newElement, anchorX, anchorRatio, pointerX, nextY, zoom, scene, renderEnvironment, informMutation, }: {
28
31
  newElement: ExcalidrawTextElement;
29
32
  anchorX: number;
30
33
  /** 0 = anchored by its left edge, 1 = by its right, 0.5 = by its centre */
@@ -34,9 +37,10 @@ export declare const dragNewTextElement: ({ newElement, anchorX, anchorRatio, po
34
37
  nextY?: number;
35
38
  zoom: NormalizedZoomValue;
36
39
  scene: Scene;
40
+ renderEnvironment?: RenderEnvironment;
37
41
  informMutation?: boolean;
38
42
  }) => void;
39
- export declare const dragNewElement: ({ newElement, elementType, originX, originY, x, y, width, height, shouldMaintainAspectRatio, shouldResizeFromCenter, zoom, scene, widthAspectRatio, originOffset, informMutation, }: {
43
+ export declare const dragNewElement: ({ newElement, elementType, originX, originY, x, y, width, height, shouldMaintainAspectRatio, shouldResizeFromCenter, zoom, scene, renderEnvironment, widthAspectRatio, originOffset, informMutation, }: {
40
44
  newElement: NonDeletedExcalidrawElement;
41
45
  elementType: AppState["activeTool"]["type"];
42
46
  originX: number;
@@ -49,6 +53,7 @@ export declare const dragNewElement: ({ newElement, elementType, originX, origin
49
53
  shouldResizeFromCenter: boolean;
50
54
  zoom: NormalizedZoomValue;
51
55
  scene: Scene;
56
+ renderEnvironment?: RenderEnvironment;
52
57
  /** whether to keep given aspect ratio when `isResizeWithSidesSameLength` is
53
58
  true */
54
59
  widthAspectRatio?: number | null;