@myoc/common 0.19.518 → 0.19.520
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev/index.js +33 -65
- package/dist/dev/index.js.map +3 -3
- package/dist/prod/index.js +3 -3
- package/dist/types/common/src/colors.d.ts +1 -1
- package/dist/types/common/src/constants.d.ts +8 -5
- package/dist/types/common/src/utils.d.ts +0 -42
- package/dist/types/element/src/bounds.d.ts +18 -1
- package/dist/types/element/src/comparisons.d.ts +1 -0
- package/dist/types/element/src/image.d.ts +5 -0
- package/dist/types/element/src/newElement.d.ts +2 -0
- package/dist/types/element/src/types.d.ts +8 -0
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +6 -2
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +33 -11
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +6 -2
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +3 -1
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +9 -3
- package/dist/types/excalidraw/actions/actionDeselect.d.ts +3 -1
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +3 -1
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +6 -2
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +3 -1
- package/dist/types/excalidraw/actions/actionExport.d.ts +6 -2
- package/dist/types/excalidraw/actions/actionFrame.d.ts +14 -4
- package/dist/types/excalidraw/actions/actionGroup.d.ts +6 -2
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionLink.d.ts +3 -1
- package/dist/types/excalidraw/actions/actionMenu.d.ts +3 -1
- package/dist/types/excalidraw/actions/actionProperties.d.ts +18 -5
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +3 -1
- package/dist/types/excalidraw/actions/actionStyles.d.ts +3 -1
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +3 -1
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +3 -1
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +3 -1
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +3 -1
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +3 -1
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +3 -1
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +5 -3
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +3 -1
- package/dist/types/excalidraw/actions/index.d.ts +1 -1
- package/dist/types/excalidraw/actions/types.d.ts +1 -1
- package/dist/types/excalidraw/appState.d.ts +2 -1
- package/dist/types/excalidraw/components/App.d.ts +13 -28
- package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -1
- package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +1 -1
- package/dist/types/excalidraw/components/EyeDropper.d.ts +1 -1
- package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +1 -1
- package/dist/types/excalidraw/components/SearchMenu.d.ts +1 -1
- package/dist/types/excalidraw/components/Sidebar/Sidebar.d.ts +1 -1
- package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +2 -1
- package/dist/types/excalidraw/components/icons.d.ts +2 -0
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +7 -4
- package/dist/types/excalidraw/data/blob.d.ts +3 -1
- package/dist/types/excalidraw/data/json.d.ts +3 -1
- package/dist/types/excalidraw/renderer/animation.d.ts +1 -0
- package/dist/types/excalidraw/scene/Renderer.d.ts +2 -0
- package/dist/types/excalidraw/scene/index.d.ts +1 -1
- package/dist/types/excalidraw/scene/types.d.ts +1 -0
- package/dist/types/excalidraw/scroll.d.ts +46 -0
- package/dist/types/excalidraw/types.d.ts +24 -3
- package/dist/types/laser-pointer/src/index.d.ts +2 -0
- package/dist/types/laser-pointer/src/math.d.ts +16 -0
- package/dist/types/laser-pointer/src/simplify.d.ts +2 -0
- package/dist/types/laser-pointer/src/state.d.ts +35 -0
- package/dist/types/utils/src/index.d.ts +1 -2
- package/package.json +1 -1
- package/dist/types/utils/src/bbox.d.ts +0 -9
- package/dist/types/utils/src/withinBounds.d.ts +0 -19
package/dist/prod/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Qe=Object.create;var re=Object.defineProperty;var Je=Object.getOwnPropertyDescriptor;var et=Object.getOwnPropertyNames;var tt=Object.getPrototypeOf,nt=Object.prototype.hasOwnProperty;var rt=(e,t)=>()=>(e&&(t=e(e=0)),t);var oe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ot=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of et(t))!nt.call(e,o)&&o!==n&&re(e,o,{get:()=>t[o],enumerable:!(r=Je(t,o))||r.enumerable});return e};var se=(e,t,n)=>(n=e!=null?Qe(tt(e)):{},ot(t||!e||!e.__esModule?re(n,"default",{value:e,enumerable:!0}):n,e));var m,p=rt(()=>{m={PROD:!0}});var ke=oe((Q,Pe)=>{p();(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof Q=="object"?Pe.exports=t():(e.PromisePool=t(),e.promisePool=e.PromisePool)})(Q,function(){"use strict";var e=function(){this._listeners={}};e.prototype.addEventListener=function(a,l){this._listeners[a]=this._listeners[a]||[],this._listeners[a].indexOf(l)<0&&this._listeners[a].push(l)},e.prototype.removeEventListener=function(a,l){if(this._listeners[a]){var u=this._listeners[a].indexOf(l);u>=0&&this._listeners[a].splice(u,1)}},e.prototype.dispatchEvent=function(a){if(this._listeners[a.type]&&this._listeners[a.type].length)for(var l=this._listeners[a.type].slice(),u=0,d=l.length;u<d;++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,d){a._callbacks={reject:d,resolve:u},a._proceed()}),this._promise},i.prototype._fireEvent=function(a,l){this.dispatchEvent(new s(this,a,l))},i.prototype._settle=function(a){a?this._callbacks.reject(a):this._callbacks.resolve(),this._promise=null,this._callbacks=null},i.prototype._onPooledPromiseFulfilled=function(a,l){this._size--,this.active()&&(this._fireEvent("fulfilled",{promise:a,result:l}),this._proceed())},i.prototype._onPooledPromiseRejected=function(a,l){this._size--,this.active()&&(this._fireEvent("rejected",{promise:a,error:l}),this._settle(l||new Error("Unknown error")))},i.prototype._trackPromise=function(a){var l=this;a.then(function(u){l._onPooledPromiseFulfilled(a,u)},function(u){l._onPooledPromiseRejected(a,u)}).catch(function(u){l._settle(new Error("Promise processing failed: "+u))})},i.prototype._proceed=function(){if(!this._done){for(var a={done:!1};this._size<this._concurrency&&!(a=this._iterator.next()).done;)this._size++,this._trackPromise(a.value);this._done=a===null||!!a.done}this._done&&this._size===0&&this._settle()},i.PromisePoolEvent=s,i.PromisePool=i,i})});var Xe=oe(W=>{"use strict";p();Object.defineProperty(W,"__esModule",{value:!0});W.sanitizeUrl=void 0;var fn=/^([^\w]*)(javascript|data|vbscript)/im,dn=/&#(\w+)(^\w|;)?/g,hn=/&(newline|tab);/gi,mn=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,Tn=/^.+(:|:)/gim,En=[".","/"];function gn(e){return En.indexOf(e[0])>-1}function bn(e){return e.replace(dn,function(t,n){return String.fromCharCode(n)})}function _n(e){var t=bn(e||"").replace(hn,"").replace(mn,"").trim();if(!t)return"about:blank";if(gn(t))return t;var n=t.match(Tn);if(!n)return t;var r=n[0];return fn.test(r)?"about:blank":t}W.sanitizeUrl=_n});p();p();var ae=class{constructor(t){this.scoreFunction=t}content=[];sinkDown(t){let n=this.content[t],r=this.scoreFunction(n);for(;t>0;){let o=(t+1>>1)-1,s=this.content[o];if(r<this.scoreFunction(s))this.content[t]=s,t=o;else break}this.content[t]=n}bubbleUp(t){let n=this.content.length,r=this.content[t],o=this.scoreFunction(r);for(;;){let s=(t+1<<1)-1,i=s+1,a=t,l=o;if(s<n){let u=this.scoreFunction(this.content[s]);u<l&&(a=s,l=u)}if(i<n&&this.scoreFunction(this.content[i])<l&&(a=i),a===t)break;this.content[t]=this.content[a],t=a}this.content[t]=r}push(t){this.content.push(t),this.sinkDown(this.content.length-1)}pop(){if(this.content.length===0)return null;let t=this.content[0],n=this.content.pop();return this.content.length>0&&(this.content[0]=n,this.bubbleUp(0)),t}remove(t){if(this.content.length===0)return;let n=this.content.indexOf(t),r=this.content.pop();n<this.content.length&&(this.content[n]=r,this.scoreFunction(r)<this.scoreFunction(t)?this.sinkDown(n):this.bubbleUp(n))}size(){return this.content.length}rescoreElement(t){this.sinkDown(this.content.indexOf(t))}};p();var Rn=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 U(e){"@babel/helpers - typeof";return U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},U(e)}var at=/^\s+/,it=/\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=lt(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=de(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=le(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=le(this._r,this._g,this._b),n=Math.round(t.h*360),r=Math.round(t.s*100),o=Math.round(t.v*100);return this._a==1?"hsv("+n+", "+r+"%, "+o+"%)":"hsva("+n+", "+r+"%, "+o+"%, "+this._roundA+")"},toHsl:function(){var t=ie(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=ie(this._r,this._g,this._b),n=Math.round(t.h*360),r=Math.round(t.s*100),o=Math.round(t.l*100);return this._a==1?"hsl("+n+", "+r+"%, "+o+"%)":"hsla("+n+", "+r+"%, "+o+"%, "+this._roundA+")"},toHex:function(t){return ce(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return ft(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(T(this._r,255)*100)+"%",g:Math.round(T(this._g,255)*100)+"%",b:Math.round(T(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(T(this._r,255)*100)+"%, "+Math.round(T(this._g,255)*100)+"%, "+Math.round(T(this._b,255)*100)+"%)":"rgba("+Math.round(T(this._r,255)*100)+"%, "+Math.round(T(this._g,255)*100)+"%, "+Math.round(T(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:vt[ce(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var n="#"+ue(this._r,this._g,this._b,this._a),r=n,o=this._gradientType?"GradientType = 1, ":"";if(t){var s=c(t);r="#"+ue(s._r,s._g,s._b,s._a)}return"progid:DXImageTransform.Microsoft.gradient("+o+"startColorstr="+n+",endColorstr="+r+")"},toString:function(t){var n=!!t;t=t||this._format;var r=!1,o=this._a<1&&this._a>=0,s=!n&&o&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return s?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return c(this.toString())},_applyModification:function(t,n){var r=t.apply(null,[this].concat([].slice.call(n)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(Tt,arguments)},brighten:function(){return this._applyModification(Et,arguments)},darken:function(){return this._applyModification(gt,arguments)},desaturate:function(){return this._applyModification(dt,arguments)},saturate:function(){return this._applyModification(ht,arguments)},greyscale:function(){return this._applyModification(mt,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(_t,arguments)},monochromatic:function(){return this._applyCombination(yt,arguments)},splitcomplement:function(){return this._applyCombination(At,arguments)},triad:function(){return this._applyCombination(pe,[3])},tetrad:function(){return this._applyCombination(pe,[4])}};c.fromRatio=function(e,t){if(U(e)=="object"){var n={};for(var r in e)e.hasOwnProperty(r)&&(r==="a"?n[r]=e[r]:n[r]=w(e[r]));e=n}return c(e,t)};function lt(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=Ot(e)),U(e)=="object"&&(y(e.r)&&y(e.g)&&y(e.b)?(t=ct(e.r,e.g,e.b),i=!0,a=String(e.r).substr(-1)==="%"?"prgb":"rgb"):y(e.h)&&y(e.s)&&y(e.v)?(r=w(e.s),o=w(e.v),t=pt(e.h,r,o),i=!0,a="hsv"):y(e.h)&&y(e.s)&&y(e.l)&&(r=w(e.s),s=w(e.l),t=ut(e.h,r,s),i=!0,a="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=de(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 ct(e,t,n){return{r:T(e,255)*255,g:T(t,255)*255,b:T(n,255)*255}}function ie(e,t,n){e=T(e,255),t=T(t,255),n=T(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 ut(e,t,n){var r,o,s;e=T(e,360),t=T(t,100),n=T(n,100);function i(u,d,E){return E<0&&(E+=1),E>1&&(E-=1),E<1/6?u+(d-u)*6*E:E<1/2?d:E<2/3?u+(d-u)*(2/3-E)*6:u}if(t===0)r=o=s=n;else{var a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;r=i(l,a,e+1/3),o=i(l,a,e),s=i(l,a,e-1/3)}return{r:r*255,g:o*255,b:s*255}}function le(e,t,n){e=T(e,255),t=T(t,255),n=T(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),s,i,a=r,l=r-o;if(i=r===0?0:l/r,r==o)s=0;else{switch(r){case e:s=(t-n)/l+(t<n?6:0);break;case t:s=(n-e)/l+2;break;case n:s=(e-t)/l+4;break}s/=6}return{h:s,s:i,v:a}}function pt(e,t,n){e=T(e,360)*6,t=T(t,100),n=T(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],d=[a,n,n,i,s,s][l],E=[s,s,a,n,n,i][l];return{r:u*255,g:d*255,b:E*255}}function ce(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 ft(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(he(r))];return o&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function ue(e,t,n,r){var o=[x(he(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=N(n.s),c(n)}function ht(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.s+=t/100,n.s=N(n.s),c(n)}function mt(e){return c(e).desaturate(100)}function Tt(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.l+=t/100,n.l=N(n.l),c(n)}function 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 gt(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.l-=t/100,n.l=N(n.l),c(n)}function bt(e,t){var n=c(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,c(n)}function _t(e){var t=c(e).toHsl();return t.h=(t.h+180)%360,c(t)}function pe(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var n=c(e).toHsl(),r=[c(e)],o=360/t,s=1;s<t;s++)r.push(c({h:(n.h+s*o)%360,s:n.s,l:n.l}));return r}function At(e){var t=c(e).toHsl(),n=t.h;return[c(e),c({h:(n+72)%360,s:t.s,l:t.l}),c({h:(n+216)%360,s:t.s,l:t.l})]}function 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 yt(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=Lt(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 q=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"},vt=c.hexNames=Mt(q);function Mt(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 T(e,t){St(e)&&(e="100%");var n=Rt(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function N(e){return Math.min(1,Math.max(0,e))}function b(e){return parseInt(e,16)}function St(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function Rt(e){return typeof e=="string"&&e.indexOf("%")!=-1}function x(e){return e.length==1?"0"+e:""+e}function w(e){return e<=1&&(e=e*100+"%"),e}function he(e){return Math.round(parseFloat(e)*255).toString(16)}function fe(e){return b(e)/255}var A=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",n="(?:"+t+")|(?:"+e+")",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",o="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+o),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+o),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+o),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function y(e){return!!A.CSS_UNIT.exec(e)}function Ot(e){e=e.replace(at,"").replace(it,"").toLowerCase();var t=!1;if(q[e])e=q[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=A.rgb.exec(e))?{r:n[1],g:n[2],b:n[3]}:(n=A.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=A.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=A.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=A.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=A.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=A.hex8.exec(e))?{r:b(n[1]),g:b(n[2]),b:b(n[3]),a:fe(n[4]),format:t?"name":"hex8"}:(n=A.hex6.exec(e))?{r:b(n[1]),g:b(n[2]),b:b(n[3]),format:t?"name":"hex"}:(n=A.hex4.exec(e))?{r:b(n[1]+""+n[1]),g:b(n[2]+""+n[2]),b:b(n[3]+""+n[3]),a:fe(n[4]+""+n[4]),format:t?"name":"hex8"}:(n=A.hex3.exec(e))?{r:b(n[1]+""+n[1]),g:b(n[2]+""+n[2]),b:b(n[3]+""+n[3]),format:t?"name":"hex"}:!1}function Lt(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 me}from"@excalidraw/math";import{degreesToRadians as Ft}from"@excalidraw/math";var j=typeof window<"u"?new Map:null;function wt(e,t,n,r){let o=e/255,s=t/255,i=n/255,a=Ft(r),l=Math.cos(a),u=Math.sin(a),d=[.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],E=o*d[0]+s*d[1]+i*d[2],L=o*d[3]+s*d[4]+i*d[5],_=o*d[6]+s*d[7]+i*d[8];return{r:Math.round(Math.max(0,Math.min(1,E))*255),g:Math.round(Math.max(0,Math.min(1,L))*255),b:Math.round(Math.max(0,Math.min(1,_))*255)}}var It=(e,t,n,r)=>{let o=me(r,0,100)/100,s=u=>{let d=u*(1-o)+(255-u)*o;return Math.round(me(d,0,255))},i=s(e),a=s(t),l=s(n);return{r:i,g:a,b:l}},kn=e=>{let t=j?.get(e);if(t)return t;let n=c(e),r=n.getAlpha(),o=n.toRgb(),s=It(o.r,o.g,o.b,93),i=wt(s.r,s.g,s.b,180),a=Ee(i.r,i.g,i.b,r);return j&&j.set(e,a),a},Ct=(e,t)=>t.reduce((n,r)=>(r in e&&(n[r]=e[r]),n),{}),Dn=5,Un=5,Nn=4,H=4,G=1,f={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=Ct(f,["cyan","blue","violet","grape","pink","green","teal","yellow","orange","red"]),Hn=[f.black,f.red[H],f.green[H],f.blue[H],f.yellow[H]],Gn=[f.transparent,f.red[G],f.green[G],f.blue[G],f.yellow[G]],Bn=[f.white,"#f8f9fa","#f5faff","#fffce8","#fdf8f6"],Kn={transparent:f.transparent,white:f.white,gray:f.gray,black:f.black,bronze:f.bronze,...Te},Vn={transparent:f.transparent,white:f.white,gray:f.gray,black:f.black,bronze:f.bronze,...Te},Wn=e=>[f.cyan[e],f.blue[e],f.violet[e],f.grape[e],f.pink[e],f.green[e],f.teal[e],f.yellow[e],f.orange[e],f.red[e]],Ee=(e,t,n,r)=>{let o=`#${(16777216+(e<<16)+(t<<8)+n).toString(16).slice(1)}`;if(r!==void 0&&r<1){let s=Math.round(r*255).toString(16).padStart(2,"0");return`${o}${s}`}return o},Yn=e=>{let t=c(e);if(!t.isValid())return null;let{r:n,g:r,b:o,a:s}=t.toRgb();return Ee(n,r,o,s)},ge=e=>c(e).getAlpha()===0,$n=240,Pt=(e,t,n)=>(e*299+t*587+n*114)/1e3,Xn=(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 Pt(r,o,s)<t},zn=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 Qn=typeof window<"u"&&"ResizeObserver"in window,Jn="Excalidraw",er=36,tr=10,nr=20,rr=8,or=5,sr=1,ar=30,ir=Math.PI/12,lr="red",cr={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},ur={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1,ERASER:5},pr={enabled:"all",disabled:"none",inheritFromUI:"var(--ui-pointerEvents)"},kt=(h=>(h.COPY="copy",h.PASTE="paste",h.CUT="cut",h.KEYDOWN="keydown",h.KEYUP="keyup",h.MOUSE_MOVE="mousemove",h.RESIZE="resize",h.UNLOAD="unload",h.FOCUS="focus",h.BLUR="blur",h.DRAG_OVER="dragover",h.DROP="drop",h.GESTURE_END="gestureend",h.BEFORE_UNLOAD="beforeunload",h.GESTURE_START="gesturestart",h.GESTURE_CHANGE="gesturechange",h.POINTER_MOVE="pointermove",h.POINTER_DOWN="pointerdown",h.POINTER_UP="pointerup",h.STATE_CHANGE="statechange",h.WHEEL="wheel",h.TOUCH_START="touchstart",h.TOUCH_END="touchend",h.HASHCHANGE="hashchange",h.VISIBILITY_CHANGE="visibilitychange",h.SCROLL="scroll",h.EXCALIDRAW_LINK="excalidraw-link",h.MENU_ITEM_SELECT="menu.itemSelect",h.MESSAGE="message",h.FULLSCREENCHANGE="fullscreenchange",h))(kt||{}),fr={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5},B={TEST:"test",DEVELOPMENT:"development",PRODUCTION:"production"},dr={SIDEBAR:"sidebar",SHAPE_ACTIONS_MENU:"App-menu__left",ZOOM_ACTIONS:"zoom-actions",SEARCH_MENU_INPUT_WRAPPER:"layer-ui__search-inputWrapper",CONVERT_ELEMENT_TYPE_POPUP:"ConvertElementTypePopup",SHAPE_ACTIONS_THEME_SCOPE:"shape-actions-theme-scope",FRAME_NAME:"frame-name",DROPDOWN_MENU_EVENT_WRAPPER:"dropdown-menu-event-wrapper"},hr={sm:16,md:20,lg:28,xl:36},_e="Xiaolai",I="Segoe UI Emoji",g={Virgil:1,Helvetica:2,Cascadia:3,Excalifont:5,Nunito:6,"Lilita One":7,"Comic Shanns":8,"Liberation Sans":9,Assistant:10},Ae="sans-serif",xe="monospace",Dt={[Ae]:998,[xe]:999},Z={[_e]:100,...Dt,[I]:1e3};function Ut(e){switch(e){case g.Cascadia:case g["Comic Shanns"]:return xe;default:return Ae}}var ye=e=>{let t=Ut(e);switch(e){case g.Excalifont:return[_e,t,I];default:return[t,I]}},mr={LIGHT:"light",DARK:"dark"},Tr="invert(93%) hue-rotate(180deg)",Er={strokeColor:"#bbb",strokeWidth:2,strokeStyle:"solid",fillStyle:"solid",roughness:0,roundness:null,backgroundColor:"transparent",radius:8,nameOffsetY:3,nameColorLightTheme:"#999999",nameColorDarkTheme:"#7a7a7a",nameFontSize:14,nameLineHeight:1.25},gr=1,br=20,_r=g.Excalifont,Ar="left",xr="top",ve="{version}",Nt=2,Ht=2*Nt,Gt=1e-5,yr=2*Ht-Gt,vr="#ffffff",Mr="#1e1e1e",Sr="#a2f1a6",Rr=["selectAll"],Or=20,Lr=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"},Bt={text:"text/plain",html:"text/html",json:"application/json",excalidraw:"application/vnd.excalidraw+json",excalidrawClipboard:"application/vnd.excalidraw.clipboard+json"},be={...Bt,"excalidraw.svg":"image/svg+xml","excalidraw.png":"image/png",binary:"application/octet-stream",...Me},Fr=[be.text,be.html,...Object.values(Me)],wr={png:"png",svg:"svg",clipboard:"clipboard"},Ir={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawClipboardWithAPI:"excalidraw-api/clipboard"},Cr=()=>window.EXCALIDRAW_EXPORT_SOURCE||window.location.origin,Pr=500,kr=300,Dr=500,Ur=1e4,Nr=3e4,Hr=100,Gr=.1,Br=.1,Kr=30,Vr=300,Wr=6e4,Yr=3e3,$r={canvasActions:{changeViewBackgroundColor:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,toggleTheme:null,saveAsImage:!0},tools:{image:!0}},Xr=2,zr=[1,2,3],qr=10,Kt=1440,Vt=100*1024*1024,jr={maxWidthOrHeight:Kt,maxFileSizeBytes:Vt},Zr="http://www.w3.org/2000/svg",Qr=`<?xml version="1.0" standalone="no"?>
|
|
1
|
+
var Ve=Object.create;var j=Object.defineProperty;var Ye=Object.getOwnPropertyDescriptor;var $e=Object.getOwnPropertyNames;var Xe=Object.getPrototypeOf,ze=Object.prototype.hasOwnProperty;var qe=(e,t)=>()=>(e&&(t=e(e=0)),t);var Z=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var je=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of $e(t))!ze.call(e,o)&&o!==n&&j(e,o,{get:()=>t[o],enumerable:!(r=Ye(t,o))||r.enumerable});return e};var Q=(e,t,n)=>(n=e!=null?Ve(Xe(e)):{},je(t||!e||!e.__esModule?j(n,"default",{value:e,enumerable:!0}):n,e));var h,p=qe(()=>{h={PROD:!0}});var Le=Z((V,Oe)=>{p();(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof V=="object"?Oe.exports=t():(e.PromisePool=t(),e.promisePool=e.PromisePool)})(V,function(){"use strict";var e=function(){this._listeners={}};e.prototype.addEventListener=function(i,l){this._listeners[i]=this._listeners[i]||[],this._listeners[i].indexOf(l)<0&&this._listeners[i].push(l)},e.prototype.removeEventListener=function(i,l){if(this._listeners[i]){var u=this._listeners[i].indexOf(l);u>=0&&this._listeners[i].splice(u,1)}},e.prototype.dispatchEvent=function(i){if(this._listeners[i.type]&&this._listeners[i.type].length)for(var l=this._listeners[i.type].slice(),u=0,m=l.length;u<m;++u)l[u].call(this,i)};var t=function(i){return typeof i.constructor=="function"&&i.constructor.name==="GeneratorFunction"},n=function(i){return{next:function(){var l=i();return l?{value:l}:{done:!0}}}},r=function(i){var l=!1;return{next:function(){return l?{done:!0}:(l=!0,{value:i})}}},o=function(i,l){var u=typeof i;if(u==="object"){if(typeof i.next=="function")return i;if(typeof i.then=="function")return r(i)}return u==="function"?t(i)?i():n(i):r(l.resolve(i))},s=function(i,l,u){this.target=i,this.type=l,this.data=u},a=function(i,l,u){if(e.call(this),typeof l!="number"||Math.floor(l)!==l||l<1)throw new Error("Invalid concurrency");this._concurrency=l,this._options=u||{},this._options.promise=this._options.promise||Promise,this._iterator=o(i,this._options.promise),this._done=!1,this._size=0,this._promise=null,this._callbacks=null};return a.prototype=new e,a.prototype.constructor=a,a.prototype.concurrency=function(i){return typeof i<"u"&&(this._concurrency=i,this.active()&&this._proceed()),this._concurrency},a.prototype.size=function(){return this._size},a.prototype.active=function(){return!!this._promise},a.prototype.promise=function(){return this._promise},a.prototype.start=function(){var i=this,l=this._options.promise;return this._promise=new l(function(u,m){i._callbacks={reject:m,resolve:u},i._proceed()}),this._promise},a.prototype._fireEvent=function(i,l){this.dispatchEvent(new s(this,i,l))},a.prototype._settle=function(i){i?this._callbacks.reject(i):this._callbacks.resolve(),this._promise=null,this._callbacks=null},a.prototype._onPooledPromiseFulfilled=function(i,l){this._size--,this.active()&&(this._fireEvent("fulfilled",{promise:i,result:l}),this._proceed())},a.prototype._onPooledPromiseRejected=function(i,l){this._size--,this.active()&&(this._fireEvent("rejected",{promise:i,error:l}),this._settle(l||new Error("Unknown error")))},a.prototype._trackPromise=function(i){var l=this;i.then(function(u){l._onPooledPromiseFulfilled(i,u)},function(u){l._onPooledPromiseRejected(i,u)}).catch(function(u){l._settle(new Error("Promise processing failed: "+u))})},a.prototype._proceed=function(){if(!this._done){for(var i={done:!1};this._size<this._concurrency&&!(i=this._iterator.next()).done;)this._size++,this._trackPromise(i.value);this._done=i===null||!!i.done}this._done&&this._size===0&&this._settle()},a.PromisePoolEvent=s,a.PromisePool=a,a})});var He=Z(H=>{"use strict";p();Object.defineProperty(H,"__esModule",{value:!0});H.sanitizeUrl=void 0;var sn=/^([^\w]*)(javascript|data|vbscript)/im,an=/&#(\w+)(^\w|;)?/g,ln=/&(newline|tab);/gi,cn=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,un=/^.+(:|:)/gim,pn=[".","/"];function dn(e){return pn.indexOf(e[0])>-1}function fn(e){return e.replace(an,function(t,n){return String.fromCharCode(n)})}function hn(e){var t=fn(e||"").replace(ln,"").replace(cn,"").trim();if(!t)return"about:blank";if(dn(t))return t;var n=t.match(un);if(!n)return t;var r=n[0];return sn.test(r)?"about:blank":t}H.sanitizeUrl=hn});p();p();var J=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 An=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 I(e){"@babel/helpers - typeof";return I=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},I(e)}var Qe=/^\s+/,Je=/\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=et(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=ie(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=te(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=te(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=ee(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=ee(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 ne(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return ot(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:Et[ne(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var n="#"+re(this._r,this._g,this._b,this._a),r=n,o=this._gradientType?"GradientType = 1, ":"";if(t){var s=c(t);r="#"+re(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(lt,arguments)},brighten:function(){return this._applyModification(ct,arguments)},darken:function(){return this._applyModification(ut,arguments)},desaturate:function(){return this._applyModification(st,arguments)},saturate:function(){return this._applyModification(it,arguments)},greyscale:function(){return this._applyModification(at,arguments)},spin:function(){return this._applyModification(pt,arguments)},_applyCombination:function(t,n){return t.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(ht,arguments)},complement:function(){return this._applyCombination(dt,arguments)},monochromatic:function(){return this._applyCombination(mt,arguments)},splitcomplement:function(){return this._applyCombination(ft,arguments)},triad:function(){return this._applyCombination(oe,[3])},tetrad:function(){return this._applyCombination(oe,[4])}};c.fromRatio=function(e,t){if(I(e)=="object"){var n={};for(var r in e)e.hasOwnProperty(r)&&(r==="a"?n[r]=e[r]:n[r]=R(e[r]));e=n}return c(e,t)};function et(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=_t(e)),I(e)=="object"&&(x(e.r)&&x(e.g)&&x(e.b)?(t=tt(e.r,e.g,e.b),a=!0,i=String(e.r).substr(-1)==="%"?"prgb":"rgb"):x(e.h)&&x(e.s)&&x(e.v)?(r=R(e.s),o=R(e.v),t=rt(e.h,r,o),a=!0,i="hsv"):x(e.h)&&x(e.s)&&x(e.l)&&(r=R(e.s),s=R(e.l),t=nt(e.h,r,s),a=!0,i="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=ie(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 tt(e,t,n){return{r:E(e,255)*255,g:E(t,255)*255,b:E(n,255)*255}}function ee(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 nt(e,t,n){var r,o,s;e=E(e,360),t=E(t,100),n=E(n,100);function a(u,m,g){return g<0&&(g+=1),g>1&&(g-=1),g<1/6?u+(m-u)*6*g:g<1/2?m:g<2/3?u+(m-u)*(2/3-g)*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 te(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 rt(e,t,n){e=E(e,360)*6,t=E(t,100),n=E(n,100);var r=Math.floor(e),o=e-r,s=n*(1-t),a=n*(1-o*t),i=n*(1-(1-o)*t),l=r%6,u=[n,a,s,s,i,n][l],m=[i,n,n,a,s,s][l],g=[s,s,i,n,n,a][l];return{r:u*255,g:m*255,b:g*255}}function ne(e,t,n,r){var o=[A(Math.round(e).toString(16)),A(Math.round(t).toString(16)),A(Math.round(n).toString(16))];return r&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function ot(e,t,n,r,o){var s=[A(Math.round(e).toString(16)),A(Math.round(t).toString(16)),A(Math.round(n).toString(16)),A(ae(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 re(e,t,n,r){var o=[A(ae(r)),A(Math.round(e).toString(16)),A(Math.round(t).toString(16)),A(Math.round(n).toString(16))];return o.join("")}c.equals=function(e,t){return!e||!t?!1:c(e).toRgbString()==c(t).toRgbString()};c.random=function(){return c.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function st(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.s-=t/100,n.s=C(n.s),c(n)}function it(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.s+=t/100,n.s=C(n.s),c(n)}function at(e){return c(e).desaturate(100)}function lt(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.l+=t/100,n.l=C(n.l),c(n)}function ct(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 ut(e,t){t=t===0?0:t||10;var n=c(e).toHsl();return n.l-=t/100,n.l=C(n.l),c(n)}function pt(e,t){var n=c(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,c(n)}function dt(e){var t=c(e).toHsl();return t.h=(t.h+180)%360,c(t)}function oe(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 ft(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 ht(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 mt(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=At(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 B=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Et=c.hexNames=Tt(B);function Tt(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function ie(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function E(e,t){gt(e)&&(e="100%");var n=bt(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 C(e){return Math.min(1,Math.max(0,e))}function b(e){return parseInt(e,16)}function gt(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function bt(e){return typeof e=="string"&&e.indexOf("%")!=-1}function A(e){return e.length==1?"0"+e:""+e}function R(e){return e<=1&&(e=e*100+"%"),e}function ae(e){return Math.round(parseFloat(e)*255).toString(16)}function se(e){return b(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 x(e){return!!_.CSS_UNIT.exec(e)}function _t(e){e=e.replace(Qe,"").replace(Je,"").toLowerCase();var t=!1;if(B[e])e=B[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=_.rgb.exec(e))?{r:n[1],g:n[2],b:n[3]}:(n=_.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=_.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=_.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=_.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=_.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=_.hex8.exec(e))?{r:b(n[1]),g:b(n[2]),b:b(n[3]),a:se(n[4]),format:t?"name":"hex8"}:(n=_.hex6.exec(e))?{r:b(n[1]),g:b(n[2]),b:b(n[3]),format:t?"name":"hex"}:(n=_.hex4.exec(e))?{r:b(n[1]+""+n[1]),g:b(n[2]+""+n[2]),b:b(n[3]+""+n[3]),a:se(n[4]+""+n[4]),format:t?"name":"hex8"}:(n=_.hex3.exec(e))?{r:b(n[1]+""+n[1]),g:b(n[2]+""+n[2]),b:b(n[3]+""+n[3]),format:t?"name":"hex"}:!1}function At(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 le}from"@excalidraw/math";import{degreesToRadians as xt}from"@excalidraw/math";var K=typeof window<"u"?new Map:null;function yt(e,t,n,r){let o=e/255,s=t/255,a=n/255,i=xt(r),l=Math.cos(i),u=Math.sin(i),m=[.213+l*.787-u*.213,.715-l*.715-u*.715,.072-l*.072+u*.928,.213-l*.213+u*.143,.715+l*.285+u*.14,.072-l*.072-u*.283,.213-l*.213-u*.787,.715-l*.715+u*.715,.072+l*.928+u*.072],g=o*m[0]+s*m[1]+a*m[2],q=o*m[3]+s*m[4]+a*m[5],y=o*m[6]+s*m[7]+a*m[8];return{r:Math.round(Math.max(0,Math.min(1,g))*255),g:Math.round(Math.max(0,Math.min(1,q))*255),b:Math.round(Math.max(0,Math.min(1,y))*255)}}var vt=(e,t,n,r)=>{let o=le(r,0,100)/100,s=u=>{let m=u*(1-o)+(255-u)*o;return Math.round(le(m,0,255))},a=s(e),i=s(t),l=s(n);return{r:a,g:i,b:l}},Ln=(e,t=!0)=>{if(!t)return e;let n=K?.get(e);if(n)return n;let r=c(e),o=r.getAlpha(),s=r.toRgb(),a=vt(s.r,s.g,s.b,93),i=yt(a.r,a.g,a.b,180),l=ue(i.r,i.g,i.b,o);return K&&K.set(e,l),l},St=(e,t)=>t.reduce((n,r)=>(r in e&&(n[r]=e[r]),n),{}),Fn=5,wn=5,In=4,P=4,D=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"]},ce=St(d,["cyan","blue","violet","grape","pink","green","teal","yellow","orange","red"]),Cn=[d.black,d.red[P],d.green[P],d.blue[P],d.yellow[P]],Pn=[d.transparent,d.red[D],d.green[D],d.blue[D],d.yellow[D]],Dn=[d.white,"#f8f9fa","#f5faff","#fffce8","#fdf8f6"],kn={transparent:d.transparent,white:d.white,gray:d.gray,black:d.black,bronze:d.bronze,...ce},Un={transparent:d.transparent,white:d.white,gray:d.gray,black:d.black,bronze:d.bronze,...ce},Nn=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]],ue=(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},Hn=e=>{let t=c(e);if(!t.isValid())return null;let{r:n,g:r,b:o,a:s}=t.toRgb();return ue(n,r,o,s)},pe=e=>c(e).getAlpha()===0,Gn=240,Mt=(e,t,n)=>(e*299+t*587+n*114)/1e3,Bn=(e,t=160)=>{if(!e)return!0;if(pe(e))return!1;let n=c(e);if(!n.isValid())return!0;let{r,g:o,b:s}=n.toRgb();return Mt(r,o,s)<t},Kn=e=>{if(e=e.trim(),pe(e))return e;let t=c(e);return t.isValid()?["hex","hex8"].includes(t.getFormat())&&!e.startsWith("#")?`#${e}`:e:null};p();var $n=typeof window<"u"&&"ResizeObserver"in window,Xn="Excalidraw",zn=36,qn=10,jn=20,Zn=8,Qn=5,Jn=1,er=30,tr=Math.PI/12,nr="red",rr={TEXT:"text",CROSSHAIR:"crosshair",GRABBING:"grabbing",GRAB:"grab",POINTER:"pointer",MOVE:"move",AUTO:""},or={MAIN:0,WHEEL:1,SECONDARY:2,TOUCH:-1,ERASER:5},sr={enabled:"all",disabled:"none",inheritFromUI:"var(--ui-pointerEvents)"},Rt=(f=>(f.COPY="copy",f.PASTE="paste",f.CUT="cut",f.KEYDOWN="keydown",f.KEYUP="keyup",f.MOUSE_MOVE="mousemove",f.RESIZE="resize",f.UNLOAD="unload",f.FOCUS="focus",f.BLUR="blur",f.DRAG_OVER="dragover",f.DROP="drop",f.GESTURE_END="gestureend",f.BEFORE_UNLOAD="beforeunload",f.GESTURE_START="gesturestart",f.GESTURE_CHANGE="gesturechange",f.POINTER_MOVE="pointermove",f.POINTER_DOWN="pointerdown",f.POINTER_UP="pointerup",f.STATE_CHANGE="statechange",f.WHEEL="wheel",f.TOUCH_START="touchstart",f.TOUCH_END="touchend",f.HASHCHANGE="hashchange",f.VISIBILITY_CHANGE="visibilitychange",f.SCROLL="scroll",f.EXCALIDRAW_LINK="excalidraw-link",f.MENU_ITEM_SELECT="menu.itemSelect",f.MESSAGE="message",f.FULLSCREENCHANGE="fullscreenchange",f))(Rt||{}),ir={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5},k={TEST:"test",DEVELOPMENT:"development",PRODUCTION:"production"},ar={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"},lr={sm:16,md:20,lg:28,xl:36},fe="Xiaolai",O="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},he="sans-serif",me="monospace",Ot={[he]:998,[me]:999},W={[fe]:100,...Ot,[O]:1e3};function Lt(e){switch(e){case T.Cascadia:case T["Comic Shanns"]:return me;default:return he}}var Ee=e=>{let t=Lt(e);switch(e){case T.Excalifont:return[fe,t,O];default:return[t,O]}},cr={LIGHT:"light",DARK:"dark"},ur="invert(93%) hue-rotate(180deg)",pr={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},dr=1,fr=20,hr=T.Excalifont,mr="left",Er="top",Te="{version}",Ft=2,wt=2*Ft,It=1e-5,Tr=2*wt-It,gr="#ffffff",br="#1e1e1e",_r="#a2f1a6",Ar=["selectAll"],xr=20,yr=5,ge={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"},Ct={text:"text/plain",html:"text/html",json:"application/json",excalidraw:"application/vnd.excalidraw+json",excalidrawClipboard:"application/vnd.excalidraw.clipboard+json"},de={...Ct,"excalidraw.svg":"image/svg+xml","excalidraw.png":"image/png",binary:"application/octet-stream",...ge},vr=[de.text,de.html,...Object.values(ge)],Sr={png:"png",svg:"svg",clipboard:"clipboard"},Mr={excalidraw:"excalidraw",excalidrawClipboard:"excalidraw/clipboard",excalidrawClipboardWithAPI:"excalidraw-api/clipboard"},Rr=()=>window.EXCALIDRAW_EXPORT_SOURCE||window.location.origin,Or=500,Lr=300,Fr=500,wr=1e4,Ir=3e4,Cr=100,Pr=.1,Dr=.1,kr=30,Ur=300,Nr=6e4,Hr=3e3,Gr={canvasActions:{changeViewBackgroundColor:!0,export:{saveFileToDisk:!0},loadScene:!0,saveToActiveFile:!0,toggleTheme:null,saveAsImage:!0},tools:{image:!0}},Br=2,Kr=[1,2,3],Wr=10,Pt=1440,Dt=100*1024*1024,Vr={maxWidthOrHeight:Pt,maxFileSizeBytes:Dt,placeholderTransitionDuration:300},Yr="http://www.w3.org/2000/svg",$r=`<?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
|
-
`,Jr=128,eo={excalidraw:2},to=5,no=.7,ro=11,oo={TOP:"top",MIDDLE:"middle",BOTTOM:"bottom"},so={LEFT:"left",CENTER:"center",RIGHT:"right"},ao=20,io=.25,lo=32,co={LEGACY:1,PROPORTIONAL_RADIUS:2,ADAPTIVE_RADIUS:3},Wt={architect:0,artist:1,cartoonist:2},uo={thin:1,bold:2,extraBold:4},po={strokeColor:f.black,backgroundColor:f.transparent,fillStyle:"solid",strokeWidth:2,strokeStyle:"solid",roughness:Wt.artist,opacity:100,locked:!1},Yt="search",fo={name:"default",defaultTab:Yt},ho={selection:"selection",lasso:"lasso",rectangle:"rectangle",diamond:"diamond",ellipse:"ellipse",arrow:"arrow",line:"line",freedraw:"freedraw",text:"text",image:"image",eraser:"eraser",hand:"hand",frame:"frame",magicframe:"magicframe",embeddable:"embeddable",laser:"laser"},mo={OAI_API_KEY:"excalidraw-oai-api-key",MERMAID_TO_EXCALIDRAW:"mermaid-to-excalidraw"},To="Untitled",Eo={generalStats:1,elementProperties:2},go=1,bo={sharp:"sharp",round:"round",elbow:"elbow"},_o=.3,Ao="element",xo=Symbol.for("__test__originalId__"),$t=(r=>(r.ACTIVE="active",r.AWAY="away",r.IDLE="idle",r))($t||{}),yo=20,vo=35,Mo=700,So={background:"var(--mobile-action-button-bg)"};p();var K={[g.Excalifont]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25}},[g.Nunito]:{metrics:{unitsPerEm:1e3,ascender:1011,descender:-353,lineHeight:1.25}},[g["Lilita One"]]:{metrics:{unitsPerEm:1e3,ascender:923,descender:-220,lineHeight:1.15}},[g["Comic Shanns"]]:{metrics:{unitsPerEm:1e3,ascender:750,descender:-250,lineHeight:1.25}},[g.Virgil]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},deprecated:!0},[g.Helvetica]:{metrics:{unitsPerEm:2048,ascender:1577,descender:-471,lineHeight:1.15},deprecated:!0,local:!0},[g.Cascadia]:{metrics:{unitsPerEm:2048,ascender:1900,descender:-480,lineHeight:1.2},deprecated:!0},[g["Liberation Sans"]]:{metrics:{unitsPerEm:2048,ascender:1854,descender:-434,lineHeight:1.15},private:!0},[g.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}},Fo={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"},wo="local:",Io=(e,t,n)=>{let{unitsPerEm:r,ascender:o,descender:s}=K[e]?.metrics||K[g.Excalifont].metrics,i=t/r,a=(n-i*o+i*s)/2;return i*o+a},Co=e=>{let{lineHeight:t}=K[e]?.metrics||K[g.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(Oe(t.jobFactory,...t.args).finally(()=>{this.running=!1,this.tick()}))):this.running=!1}push(t,...n){let r=Re();return this.jobs.push({jobFactory:t,promise:r,args:n}),this.tick(),r}};p();p();var Le="excalidraw.desktopUIMode",Ho=599,Go=1e3,Bo=500,Ko=600,Vo=1180,Wo=1440,Yo=1229,Fe=/Mac|iPod|iPhone|iPad/.test(navigator.platform),$o=/^Win/.test(navigator.platform),we=/\b(android)\b/i.test(navigator.userAgent),Xo=typeof window<"u"&&"netscape"in window&&navigator.userAgent.indexOf("rv:")>1&&navigator.userAgent.indexOf("Gecko")>1,Xt=navigator.userAgent.indexOf("Chrome")!==-1,zo=!Xt&&navigator.userAgent.indexOf("Safari")!==-1,Ie=/iPad|iPhone/i.test(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document,qo=()=>navigator.brave?.isBrave?.name==="isBrave",zt=(e,t)=>e<=599||t<500&&e<1e3,qt=(e,t)=>{let n=Math.min(e,t),r=Math.max(e,t);return n>=600&&r<=1180},jt=()=>{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(Ie)return!0;if(we){let o=/Mobile/i.test(e);if(o||!o)return matchMedia?.("(hover: none)").matches&&matchMedia?.("(pointer: coarse)").matches}return/Win|Linux|CrOS|Mac/.test(t)||/Windows NT|X11|CrOS|Macintosh/.test(e),!1},jo=(e,t)=>zt(e,t)?"phone":qt(e,t)?"tablet":"desktop",Zo=e=>e.formFactor==="phone"?"mobile":e.formFactor==="tablet"?"compact":e.desktopUIMode,Qo=e=>{let t=e??"",n="unknown";return Ie?n="ios":we?n="android":t&&(n="other"),{isMobileDevice:jt(),platform:n}},Jo=()=>{if(typeof window>"u")return null;try{let e=window.localStorage.getItem(Le);if(e==="compact"||e==="full")return e}catch{}return null},Zt=e=>{if(!(typeof window>"u"))try{window.localStorage.setItem(Le,e)}catch{}},es=e=>{if(!(e!=="compact"&&e!=="full"))return Zt(e),e};var Ce={EQUAL:"Equal",MINUS:"Minus",NUM_ADD:"NumpadAdd",NUM_SUBTRACT:"NumpadSubtract",NUM_ZERO:"Numpad0",BRACKET_RIGHT:"BracketRight",BRACKET_LEFT:"BracketLeft",ONE:"Digit1",TWO:"Digit2",THREE:"Digit3",NINE:"Digit9",QUOTE:"Quote",ZERO:"Digit0",SLASH:"Slash",C:"KeyC",D:"KeyD",H:"KeyH",V:"KeyV",Z:"KeyZ",Y:"KeyY",R:"KeyR",S:"KeyS"},R={ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",BACKSPACE:"Backspace",ALT:"Alt",CTRL_OR_CMD:Fe?"metaKey":"ctrlKey",DELETE:"Delete",ENTER:"Enter",ESCAPE:"Escape",QUESTION_MARK:"?",SPACE:" ",TAB:"Tab",CHEVRON_LEFT:"<",CHEVRON_RIGHT:">",PERIOD:".",COMMA:",",SUBTRACT:"-",SLASH:"/",A:"a",C:"c",D:"d",E:"e",F:"f",G:"g",H:"h",I:"i",L:"l",O:"o",P:"p",Q:"q",R:"r",S:"s",T:"t",V:"v",X:"x",Y:"y",Z:"z",K:"k",W:"w",0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9"},Qt=new Map([[R.Z,Ce.Z],[R.Y,Ce.Y]]),Jt=e=>/^[a-z]$/.test(e.toLowerCase()),os=(e,t)=>{if(t===e.key.toLowerCase())return!0;let n=Qt.get(t);return!!(n&&!Jt(e.key)&&e.code===n)},ss=e=>e===R.ARROW_LEFT||e===R.ARROW_RIGHT||e===R.ARROW_DOWN||e===R.ARROW_UP,as=e=>e.altKey,is=e=>e.shiftKey,ls=e=>e.shiftKey;p();import{pointFromPair as en}from"@excalidraw/math";var fs=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)}},ds=(e,t,n,r)=>{let o=n.map(_=>_[e]),s=Math.max(...o),i=Math.min(...o),a=s-i,l=a===0?1:t/a,u=1/0,d=n.map(_=>{let v=_[e]*l,M=[..._];return M[e]=v,v<u&&(u=v),M});if(!r||d.length===2)return d;let E=i-u;return d.map(_=>en(_.map((v,M)=>M===e?v+E:v)))},hs=(e,t,n)=>n?[Math.round(e/n)*n,Math.round(t/n)*n]:[e,t];p();var Ue=se(ke(),1),De=class{pool;entries={};constructor(t,n){this.pool=new Ue.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 Ne=(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 C=class{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}};p();import{average as V}from"@excalidraw/math";var J=null,Fs=e=>{J=e},ws=()=>{if(J)return J;let e=new Date,t=e.getFullYear(),n=`${e.getMonth()+1}`.padStart(2,"0"),r=`${e.getDate()}`.padStart(2,"0"),o=`${e.getHours()}`.padStart(2,"0"),s=`${e.getMinutes()}`.padStart(2,"0");return`${t}-${n}-${r}-${o}${s}`},Is=e=>e.charAt(0).toUpperCase()+e.slice(1),Cs=e=>e instanceof HTMLElement&&e.className.includes("ToolIcon"),tn=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement,Ps=e=>tn(e)||e instanceof Element&&!!e.closest("label, button"),ks=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&(e.type==="text"||e.type==="number"||e.type==="password"||e.type==="search")||e instanceof HTMLElement&&e.closest(".cm-editor")!==null,nn=({fontFamily:e})=>{for(let[t,n]of Object.entries(g))if(n===e)return`${t}${ye(n).map(r=>`, ${r}`).join("")}`;return I},Ds=({fontSize:e,fontFamily:t})=>`${e}px ${nn({fontFamily:t})}`,Us=async e=>{requestAnimationFrame(()=>requestAnimationFrame(e))},Ns=(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},Hs=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},Be=e=>1-Math.pow(1-e,4),He=(e,t,n)=>(t-e)*Be(n)+e,Gs=({fromValues:e,toValues:t,onStep:n,duration:r=250,interpolateValue:o,onStart:s,onEnd:i,onCancel:a})=>{let l=!1,u=0,d;function E(L){if(l)return;d===void 0&&(d=L,s?.());let _=Math.min(L-d,r),v=Be(_/r),M={};if(Object.keys(e).forEach(F=>{let S=F,$=(t[S]-e[S])*v+e[S];M[S]=$}),n(M),_<r){let F=_/r,S={};Object.keys(e).forEach($=>{let k=$,X=e[k],z=t[k],D;D=o?o(X,z,F,k):He(X,z,F),D==null&&(D=He(X,z,F)),S[k]=D}),n(S),u=window.requestAnimationFrame(E)}else n(t),i?.()}return u=window.requestAnimationFrame(E),()=>{a?.(),l=!0,window.cancelAnimationFrame(u)}},Bs=(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},Ks=e=>{let t=window.getSelection();if(t){let n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}},Vs=()=>{let e=window.getSelection();e&&e.removeAllRanges()},Ws=(e,t)=>Math.abs(e-t),Ys=e=>e==="selection"||e==="lasso",$s=(e,t)=>t.type==="custom"?{...e.activeTool,type:"custom",customType:t.customType,locked:t.locked??e.activeTool.locked}:{...e.activeTool,lastActiveTool:t.lastActiveToolBeforeEraser===void 0?e.activeTool.lastActiveTool:t.lastActiveToolBeforeEraser,type:t.type,customType:null,locked:t.locked??e.activeTool.locked,fromSelection:t.fromSelection??!1},Xs=()=>document.fullscreenElement?.nodeName==="HTML",zs=()=>document.documentElement.requestFullscreen(),qs=()=>document.exitFullscreen(),js=({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}},Zs=({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}},Qs=e=>getComputedStyle(document.documentElement).getPropertyValue(`--${e}`),rn="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u2C00-\uFB1C\uFDFE-\uFE6F\uFEFD-\uFFFF",on="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",sn=new RegExp(`^[^${rn}]*[${on}]`),Js=e=>sn.test(e),ea=e=>{let[t,n]=e;return{x:t,y:n}},ta=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},ra=(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},oa=(e,t)=>{for(let n=0;n<e.length;n++){let r=t(e[n],n);if(r!=null)return r}},Re=()=>{let e,t,n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n},sa=(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},aa=()=>document.querySelector('meta[name="version"]')?.content||ve,ia=()=>{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},la=e=>{let t=e.parentElement;for(;t;){if(t===document.body)return document;let{overflowY:n}=window.getComputedStyle(t);if(t.scrollHeight>t.clientHeight&&(n==="auto"||n==="scroll"||n==="overlay"))return t;t=t.parentElement}return document},ca=e=>{let t=e.parentElement;for(;t;){if(t.tabIndex>-1){t.focus();return}t=t.parentElement}},ua=e=>{e.preventDefault(),e.returnValue=""},pa=e=>Array.from(e).map(t=>`0${t.toString(16)}`.slice(-2)).join(""),fa=()=>te()?1:Date.now(),da=e=>e instanceof Map?e:e.reduce((t,n)=>(t.set(typeof n=="string"?n:n.id,n),t),new Map),ha=e=>e.reduce((t,n,r)=>(t.set(n.id,[n,r]),t),new Map),ma=(e,t)=>e.reduce((n,r,o)=>(n[t?t(r):o]=r,n),{}),Ta=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},[]),an=e=>Array.isArray(e)?e:e.values(),Ea=e=>Array.isArray(e)?e:Array.from(an(e)),te=()=>m.MODE===B.TEST,ga=()=>m.MODE===B.DEVELOPMENT,Ke=()=>m.MODE===B.PRODUCTION,ba=()=>typeof process<"u"&&!0,_a=(e,t)=>new CustomEvent(e,{detail:{nativeEvent:t},cancelable:!0}),Aa=(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},xa=e=>{let t=typeof e;return e==null||t!=="object"&&t!=="function"},ln=()=>{try{return window.self===window.top?"top":"iframe"}catch{return"iframe"}},ya=()=>ln()==="iframe",va=e=>!!e&&typeof e=="object"&&"then"in e&&"catch"in e&&"finally"in e,Ma=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):[]},Ge=(e,t)=>Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t,cn=(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]||Ge(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]||Ge(e[i],t[i]);return!l&&r&&console.warn(`%cisShallowEqual: ${i} not equal ->`,"color: #8B4000",e[i],t[i]),l})},Sa=(e,t,{checkForDefaultPrevented:n=!0}={})=>function(o){if(e?.(o),!n||!o?.defaultPrevented)return t?.(o)},Ra=(e,t,n)=>{if(!t)return e;if(n)return console.error(t),e;throw new Error(t)};function Oa(e,t){if(!e)throw new Error(t)}var La=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},Fa=(e,t)=>e instanceof Set||e instanceof Map?e.has(t):"includes"in e?e.includes(t):e.hasOwnProperty(t),wa=e=>JSON.parse(JSON.stringify(e)),Ia=(e,t)=>cn(e,t)?e:t;function Ca(e,t,n,r){return e?(e?.addEventListener?.(t,n,r),()=>{e?.removeEventListener?.(t,n,r)}):()=>{}}function Pa(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)} ${V(o[0],s[0]).toFixed(2)},${V(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+=`${V(r[0],o[0]).toFixed(2)},${V(r[1],o[1]).toFixed(2)} `;return t&&(i+="Z"),i}var ka=e=>e.replace(/\r?\n|\r/g,`
|
|
4
|
-
`);function Da(e){return e}var Oe=async(e,...t)=>new Promise(n=>{n(e(...t))}),Ua=(...e)=>Math.max(...e.map(t=>t?1:0))>0,Na=e=>{try{return JSON.parse(e)}catch{return null}},Ve=e=>e.replace(/"/g,"""),Ha=e=>Array.isArray(e)?e:[e],un=e=>Array.isArray(e),pn=e=>un(e)?e.length:e instanceof Map||e instanceof Set?e.size:Object.keys(e).length,Ga=(e,t)=>{if(pn(e)===0)return null;let n=t||(o=>o),r=null;for(let o of e){let s=n(o);if((r===null||r===s)&&s!=null)r=s;else return null}return r},We="excalidraw-feature-flags",ee={COMPLEX_BINDINGS:!1},O=null,Ba=e=>{if(!O)try{let t=localStorage.getItem(We);t&&(O=JSON.parse(t)??ee)}catch{}return(O||ee)[e]},Ka=(e,t)=>{try{O={...O||ee,[e]:t},localStorage.setItem(We,JSON.stringify(O))}catch(n){console.error("unable to set feature flag",n)}},Va=(e,t)=>t.includes(e);var Ye=new C(Date.now()),$e=0,qa=()=>Math.floor(Ye.next()*2**31),ja=e=>{Ye=new C(e),$e=0},Za=()=>te()?`id${$e++}`:Ne();p();var ze=se(Xe(),1);var An=e=>(e=e.trim(),e&&(0,ze.sanitizeUrl)(Ve(e))),ri=e=>!!(e?.includes(location.origin)||e?.startsWith("/")),oi=e=>{if(e=An(e),e.startsWith("/"))return`${location.origin}${e}`;try{new URL(e)}catch{return"about:blank"}return e};p();var Y=class{subscribers=[];on(...t){let n=t.flat().filter(r=>typeof r=="function");return this.subscribers.push(...n),()=>this.off(n)}once(...t){let n=t.flat().filter(o=>typeof o=="function");n.push(()=>r());let r=this.on(...n);return r}off(...t){let n=t.flat();this.subscribers=this.subscribers.filter(r=>!n.includes(r))}trigger(...t){for(let n of this.subscribers)n(...t);return this}clear(){this.subscribers=[]}};p();var qe=class{constructor(t){this.behavior=t}emitters=new Map;lastPayload=new Map;emittedOnce=new Set;getEmitter(t){let n=this.emitters.get(t);return n||(n=new Y,this.emitters.set(t,n)),n}toPromiseValue(t){return t.length===1?t[0]:t}on(t,n){let r=this.behavior[t],o=this.lastPayload.get(t);if(n)return r.replay==="last"&&o&&(queueMicrotask(()=>n(...o)),r.cardinality==="once")?()=>{}:this.getEmitter(t).on(n);if(r.cardinality!=="once"||r.replay!=="last")throw new Error(`Event "${String(t)}" requires a callback`);return o?Promise.resolve(this.toPromiseValue(o)):new Promise(s=>{this.getEmitter(t).once((...i)=>{s(this.toPromiseValue(i))})})}emit(t,...n){let r=this.behavior[t];if(!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 P=(e,t=5)=>parseFloat(e.toPrecision(t)),xn=e=>P(e.reduce((t,n)=>t+n)/e.length),ne=class e{static DEBUG_LOG_TIMES=!0;static TIMES_AGGR={};static TIMES_AVG={};static LAST_DEBUG_LOG_CALL=0;static DEBUG_LOG_INTERVAL_ID=null;static LAST_FRAME_TIMESTAMP=0;static FRAME_COUNT=0;static ANIMATION_FRAME_ID=null;static scheduleAnimationFrame=()=>{e.DEBUG_LOG_INTERVAL_ID!==null&&(e.ANIMATION_FRAME_ID=requestAnimationFrame(t=>{e.LAST_FRAME_TIMESTAMP!==t&&(e.LAST_FRAME_TIMESTAMP=t,e.FRAME_COUNT++),e.DEBUG_LOG_INTERVAL_ID!==null&&e.scheduleAnimationFrame()}))};static setupInterval=()=>{e.DEBUG_LOG_INTERVAL_ID===null&&(console.info("%c(starting perf recording)","color: lime"),e.DEBUG_LOG_INTERVAL_ID=window.setInterval(e.debugLogger,1e3),e.scheduleAnimationFrame()),e.LAST_DEBUG_LOG_CALL=Date.now()};static debugLogger=()=>{if(e.DEBUG_LOG_TIMES){for(let[t,{t:n,times:r}]of Object.entries(e.TIMES_AGGR))r.length&&(console.info(t,P(r.reduce((o,s)=>o+s)),r.sort((o,s)=>o-s).map(o=>P(o))),e.TIMES_AGGR[t]={t:n,times:[]});for(let[t,{t:n,times:r,avg:o}]of Object.entries(e.TIMES_AVG))if(r.length){let s=r.reduce((a,l)=>a+l),i=P(s/e.FRAME_COUNT);console.info(t,`- ${r.length} calls - ${i}ms/frame across ${e.FRAME_COUNT} frames (${P(i/16.67*100,1)}% of frame budget)`),e.TIMES_AVG[t]={t:n,times:[],avg:o!=null?xn([o,i]):i}}}e.FRAME_COUNT=0,Date.now()-e.LAST_DEBUG_LOG_CALL>600&&e.DEBUG_LOG_INTERVAL_ID!==null&&(console.info("%c(stopping perf recording)","color: red"),window.clearInterval(e.DEBUG_LOG_INTERVAL_ID),window.cancelAnimationFrame(e.ANIMATION_FRAME_ID),e.ANIMATION_FRAME_ID=null,e.FRAME_COUNT=0,e.LAST_FRAME_TIMESTAMP=0,e.DEBUG_LOG_INTERVAL_ID=null,e.TIMES_AGGR={},e.TIMES_AVG={})};static logTime=(t,n="default")=>{e.setupInterval();let r=performance.now(),{t:o,times:s}=e.TIMES_AGGR[n]=e.TIMES_AGGR[n]||{t:0,times:[]};o&&s.push(t??r-o),e.TIMES_AGGR[n].t=r};static logTimeAverage=(t,n="default")=>{e.setupInterval();let r=performance.now(),{t:o,times:s}=e.TIMES_AVG[n]=e.TIMES_AVG[n]||{t:0,times:[]};o&&s.push(t??r-o),e.TIMES_AVG[n].t=r};static logWrapper=t=>(n,r="default")=>(...o)=>{let s=performance.now(),i=n(...o);return e[t](performance.now()-s,r),i};static logTimeWrap=e.logWrapper("logTime");static logTimeAverageWrap=e.logWrapper("logTimeAverage");static perfWrap=(t,n="default")=>(...r)=>{console.time(n);let o=t(...r);return console.timeEnd(n),o};static CHANGED_CACHE={};static logChanged(t,n){let r=e.CHANGED_CACHE[t];if(e.CHANGED_CACHE[t]=n,!r)return;let o=new Set([...Object.keys(r),...Object.keys(n)]),s={};for(let i of o){let a=r[i],l=n[i];Ze(a,l)||(s[i]={prev:a,next:l})}Object.keys(s).length>0&&console.info(`[${t}] changed:`,s)}};function Ze(e,t){if(Object.is(e,t))return!0;if(e===null||t===null||typeof e!="object"||typeof t!="object"||Array.isArray(e)!==Array.isArray(t))return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let o of n)if(!Ze(e[o],t[o]))return!1;return!0}export{Yr as ACTIVE_THRESHOLD,Fr as ALLOWED_PASTE_MIME_TYPES,Jn as APP_NAME,ro as ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO,no as ARROW_LABEL_WIDTH_FRACTION,bo as ARROW_TYPE,qe as AppEventBus,Mo as BIND_MODE_TIMEOUT,to as BOUND_TEXT_PADDING,ae as BinaryHeap,Rr as CANVAS_ONLY_ACTIONS,Yt as CANVAS_SEARCH_TAB,_e as CJK_HAND_DRAWN_FALLBACK_FONT,dr as CLASSES,Ce as CODES,Un as COLORS_PER_ROW,Mr as COLOR_CHARCOAL_BLACK,$n as COLOR_OUTLINE_CONTRAST_THRESHOLD,f as COLOR_PALETTE,Sr as COLOR_VOICE_CALL,vr as COLOR_WHITE,cr as CURSOR_TYPE,Tr as DARK_THEME_FILTER,lo as DEFAULT_ADAPTIVE_RADIUS,Bn as DEFAULT_CANVAS_BACKGROUND_PICKS,Nn as DEFAULT_CHART_COLOR_INDEX,yr as DEFAULT_COLLISION_THRESHOLD,G as DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX,Vn as DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE,Gn as DEFAULT_ELEMENT_BACKGROUND_PICKS,po as DEFAULT_ELEMENT_PROPS,H as DEFAULT_ELEMENT_STROKE_COLOR_INDEX,Kn as DEFAULT_ELEMENT_STROKE_COLOR_PALETTE,Hn as DEFAULT_ELEMENT_STROKE_PICKS,qr as DEFAULT_EXPORT_PADDING,To as DEFAULT_FILENAME,_r as DEFAULT_FONT_FAMILY,br as DEFAULT_FONT_SIZE,Or as DEFAULT_GRID_SIZE,Lr as DEFAULT_GRID_STEP,jr as DEFAULT_IMAGE_OPTIONS,lr as DEFAULT_LASER_COLOR,Kt as DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT,io as DEFAULT_PROPORTIONAL_RADIUS,_o as DEFAULT_REDUCED_GLOBAL_ALPHA,fo as DEFAULT_SIDEBAR,Ar as DEFAULT_TEXT_ALIGN,Nt as DEFAULT_TRANSFORM_HANDLE_SPACING,$r as DEFAULT_UI_OPTIONS,ve as DEFAULT_VERSION,xr as DEFAULT_VERTICAL_ALIGN,vo as DOUBLE_TAP_POSITION_THRESHOLD,tr as DRAGGING_THRESHOLD,ne as Debug,mo as EDITOR_LS_KEYS,Ao as ELEMENT_LINK_KEY,ao as ELEMENT_READY_TO_ERASE_OPACITY,or as ELEMENT_SHIFT_TRANSLATE_AMOUNT,sr as ELEMENT_TRANSLATE_AMOUNT,Jr as ENCRYPTION_KEY_BITS,B as ENV,Gt as EPSILON,kt as EVENT,Ir as EXPORT_DATA_TYPES,wr as EXPORT_IMAGE_TYPES,zr as EXPORT_SCALES,Y as Emitter,g as FONT_FAMILY,Z as FONT_FAMILY_FALLBACKS,Dt as FONT_FAMILY_GENERIC_FALLBACKS,K as FONT_METADATA,hr as FONT_SIZES,Er as FRAME_STYLE,Fo as GOOGLE_FONTS_RANGES,Vr as HYPERLINK_TOOLTIP_DELAY,Wr as IDLE_THRESHOLD,Me as IMAGE_MIME_TYPES,Pr as IMAGE_RENDER_TIMEOUT,R as KEYS,Qt as KeyCodeMap,rr as LINE_CONFIRM_THRESHOLD,yo as LINE_POLYGON_POINT_MERGE_DISTANCE,wo as LOCAL_FONT_PROTOCOL,Vt as MAX_ALLOWED_FILE_BYTES,Dn as MAX_CUSTOM_COLORS_USED_IN_CANVAS,Xr as MAX_DECIMALS_FOR_SVG_EXPORT,Kr as MAX_ZOOM,be as MIME_TYPES,nr as MINIMUM_ARROW_SIZE,gr as MIN_FONT_SIZE,go as MIN_WIDTH_OR_HEIGHT,Br as MIN_ZOOM,So as MOBILE_ACTION_BUTTON_BG,xe as MONOSPACE_GENERIC_FONT,Bo as MQ_MAX_HEIGHT_LANDSCAPE,Ho as MQ_MAX_MOBILE,Vo as MQ_MAX_TABLET,Go as MQ_MAX_WIDTH_LANDSCAPE,Ko as MQ_MIN_TABLET,Wo as MQ_MIN_WIDTH_DESKTOP,Yo as MQ_RIGHT_SIDEBAR_MIN_WIDTH,xo as ORIG_ID,ur as POINTER_BUTTON,pr as POINTER_EVENTS,De as PromisePool,Se as Queue,Wt as ROUGHNESS,co as ROUNDNESS,Ae as SANS_SERIF_GENERIC_FONT,Hr as SCROLL_TIMEOUT,ir as SHIFT_LOCKING_ANGLE,Ht as SIDE_RESIZING_THRESHOLD,Eo as STATS_PANELS,Bt as STRING_MIME_TYPES,uo as STROKE_WIDTH,Qr as SVG_DOCUMENT_PREAMBLE,Zr as SVG_NS,kr as TAP_TWICE_TIMEOUT,so as TEXT_ALIGN,er as TEXT_AUTOWRAP_THRESHOLD,ar as TEXT_TO_CENTER_SNAP_THRESHOLD,mr as THEME,Ur as TITLE_TIMEOUT,ho as TOOL_TYPE,Dr as TOUCH_CTX_MENU_TIMEOUT,$t as UserIdleState,eo as VERSIONS,Nr as VERSION_TIMEOUT,oo as VERTICAL_ALIGN,je as VersionedSnapshotStore,I as WINDOWS_EMOJI_FALLBACK_FONT,fr as YOUTUBE_STATES,Gr as ZOOM_STEP,Ca as addEventListener,zs as allowFullScreen,kn as applyDarkModeFilter,Ta as arrayToList,da as arrayToMap,ha as arrayToMapWithIndex,ma as arrayToObject,Ra as assertNever,pa as bytesToHexString,Is as capitalizeString,Ha as castArray,Bs as chunk,wa as cloneJSON,Yn as colorToHex,Sa as composeEventHandlers,Qo as createUserAgentDescriptor,Ns as debounce,Zo as deriveStylesPanelMode,Ws as distance,Be as easeOut,Gs as easeToValuesRAF,Ve as escapeDoubleQuotes,qs as exitFullScreen,na as findIndex,ra as findLastIndex,ca as focusNearestParent,Wn as getAllColorsSpecificShade,ws as getDateTime,Cr as getExportSource,Ba as getFeatureFlag,ye as getFontFamilyFallbacks,nn as getFontFamilyString,Ds as getFontString,jo as getFormFactor,ln as getFrame,Ut as getGenericFontFamilyFallback,Qs as getGlobalCSSVariable,hs as getGridPoint,Co as getLineHeight,la as getNearestScrollableContainer,fs as getSizeFromPoints,Pa as getSvgPathFromStroke,fa as getUpdatedTimestamp,aa as getVersion,Io as getVerticalOffset,Oa as invariant,we as isAndroid,Ua as isAnyTrue,ss as isArrowKey,Rn as isBounds,qo as isBrave,Xt as isChrome,Xn as isColorDark,Fe as isDarwin,ga as isDevEnv,Xo as isFirefox,Xs as isFullScreen,Ie as isIOS,tn as isInputLike,Ps as isInteractive,Jt as isLatinChar,ri as isLocalLink,Fa as isMemberOf,zt as isMobileBreakpoint,xa as isPrimitive,Ke as isProdEnv,va as isPromiseLike,Js as isRTL,un as isReadonlyArray,ya as isRunningInIframe,zo as isSafari,Ys as isSelectionLikeTool,ba as isServerEnv,cn as isShallowEqual,qt as isTabletBreakpoint,te as isTestEnv,Cs as isToolIcon,ge as isTransparent,$o as isWindows,ks as isWritableElement,Jo as loadDesktopUIModePreference,oa as mapFind,os as matchKey,La as memoize,ta as muteFSAbortError,sa as nFormatter,Us as nextAnimationFrame,ka as normalizeEOL,zn as normalizeInputColor,An as normalizeLink,Va as oneOf,ua as preventUnload,Oe as promiseTry,Ma as queryFocusableElements,Za as randomId,qa as randomInteger,Ga as reduceToCommonValue,Vs as removeSelection,ds as rescalePoints,ja as reseed,Re as resolvablePromise,Ee as rgbToHex,Na as safelyParseJSON,Zs as sceneCoordsToViewportCoords,Ks as selectNode,Fs as setDateTimeForTests,es as setDesktopUIMode,Ka as setFeatureFlag,is as shouldMaintainAspectRatio,as as shouldResizeFromCenter,ls as shouldRotateWithDiscreteAngle,pn as sizeOf,ia as supportsEmoji,Qn as supportsResizeObserver,Hs as throttleRAF,Ea as toArray,Da as toBrandedType,an as toIterable,oi as toValidURL,ea as tupleToCoors,$s as updateActiveTool,Aa as updateObject,Ia as updateStable,js as viewportCoordsToSceneCoords,_a as wrapEvent};
|
|
3
|
+
`,Xr=128,zr={excalidraw:2},qr=5,jr=.7,Zr=11,Qr={TOP:"top",MIDDLE:"middle",BOTTOM:"bottom"},Jr={LEFT:"left",CENTER:"center",RIGHT:"right"},eo=20,to=.25,no=32,ro={LEGACY:1,PROPORTIONAL_RADIUS:2,ADAPTIVE_RADIUS:3},kt={architect:0,artist:1,cartoonist:2},oo=["thin","medium","bold"],be={thin:1,medium:2,bold:4,extraBold:8},Ut={thin:.5,medium:1,bold:2,extraBold:4},so=(e,t)=>e==="freedraw"?Ut[t]:be[t],Nt="medium",io={strokeColor:d.black,backgroundColor:d.transparent,fillStyle:"solid",strokeWidth:be[Nt],strokeStyle:"solid",roughness:kt.artist,opacity:100,locked:!1},Ht="search",ao={name:"default",defaultTab:Ht},lo={selection:"selection",lasso:"lasso",rectangle:"rectangle",diamond:"diamond",ellipse:"ellipse",arrow:"arrow",line:"line",freedraw:"freedraw",text:"text",image:"image",eraser:"eraser",hand:"hand",frame:"frame",magicframe:"magicframe",embeddable:"embeddable",laser:"laser"},co={OAI_API_KEY:"excalidraw-oai-api-key",MERMAID_TO_EXCALIDRAW:"mermaid-to-excalidraw"},uo="Untitled",po={generalStats:1,elementProperties:2},fo=1,ho={sharp:"sharp",round:"round",elbow:"elbow"},mo=.3,Eo="element",To=Symbol.for("__test__originalId__"),Gt=(r=>(r.ACTIVE="active",r.AWAY="away",r.IDLE="idle",r))(Gt||{}),go=20,bo=35,_o=700,Ao={background:"var(--mobile-action-button-bg)"},xo=.5,yo=.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},[W.Xiaolai]:{metrics:{unitsPerEm:1e3,ascender:880,descender:-144,lineHeight:1.25},fallback:!0},[W["Segoe UI Emoji"]]:{metrics:{unitsPerEm:1e3,ascender:886,descender:-374,lineHeight:1.25},local:!0,fallback:!0}},Ro={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"},Oo="local:",Lo=(e,t,n)=>{let{unitsPerEm:r,ascender:o,descender:s}=U[e]?.metrics||U[T.Excalifont].metrics,a=t/r,i=(n-a*o+a*s)/2;return a*o+i},Fo=e=>{let{lineHeight:t}=U[e]?.metrics||U[T.Excalifont].metrics;return t};p();var _e=class{jobs=[];running=!1;tick(){if(this.running)return;let t=this.jobs.shift();t?(this.running=!0,t.promise.resolve(xe(t.jobFactory,...t.args).finally(()=>{this.running=!1,this.tick()}))):this.running=!1}push(t,...n){let r=Ae();return this.jobs.push({jobFactory:t,promise:r,args:n}),this.tick(),r}};p();p();var ye="excalidraw.desktopUIMode",ko=599,Uo=1e3,No=500,Ho=600,Go=1180,Bo=1440,Ko=1229,ve=/Mac|iPod|iPhone|iPad/.test(navigator.platform),Wo=/^Win/.test(navigator.platform),Se=/\b(android)\b/i.test(navigator.userAgent),Vo=typeof window<"u"&&"netscape"in window&&navigator.userAgent.indexOf("rv:")>1&&navigator.userAgent.indexOf("Gecko")>1,Bt=navigator.userAgent.indexOf("Chrome")!==-1,Yo=!Bt&&navigator.userAgent.indexOf("Safari")!==-1,Me=/iPad|iPhone/i.test(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document,$o=()=>navigator.brave?.isBrave?.name==="isBrave",Kt=(e,t)=>e<=599||t<500&&e<1e3,Wt=(e,t)=>{let n=Math.min(e,t),r=Math.max(e,t);return n>=600&&r<=1180},Vt=()=>{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(Me)return!0;if(Se){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},Xo=(e,t)=>Kt(e,t)?"phone":Wt(e,t)?"tablet":"desktop",zo=e=>e.formFactor==="phone"?"mobile":e.formFactor==="tablet"?"compact":e.desktopUIMode,qo=e=>{let t=e??"",n="unknown";return Me?n="ios":Se?n="android":t&&(n="other"),{isMobileDevice:Vt(),platform:n}},jo=()=>{if(typeof window>"u")return null;try{let e=window.localStorage.getItem(ye);if(e==="compact"||e==="full")return e}catch{}return null},Yt=e=>{if(!(typeof window>"u"))try{window.localStorage.setItem(ye,e)}catch{}},Zo=e=>{if(!(e!=="compact"&&e!=="full"))return Yt(e),e};var Re={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"},S={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:ve?"metaKey":"ctrlKey",DELETE:"Delete",ENTER:"Enter",ESCAPE:"Escape",QUESTION_MARK:"?",SPACE:" ",TAB:"Tab",CHEVRON_LEFT:"<",CHEVRON_RIGHT:">",PERIOD:".",COMMA:",",SUBTRACT:"-",SLASH:"/",A:"a",C:"c",D:"d",E:"e",F:"f",G:"g",H:"h",I:"i",L:"l",O:"o",P:"p",Q:"q",R:"r",S:"s",T:"t",V:"v",X:"x",Y:"y",Z:"z",K:"k",W:"w",0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9"},$t=new Map([[S.Z,Re.Z],[S.Y,Re.Y]]),Xt=e=>/^[a-z]$/.test(e.toLowerCase()),ts=(e,t)=>{if(t===e.key.toLowerCase())return!0;let n=$t.get(t);return!!(n&&!Xt(e.key)&&e.code===n)},ns=e=>e===S.ARROW_LEFT||e===S.ARROW_RIGHT||e===S.ARROW_DOWN||e===S.ARROW_UP,rs=e=>e.altKey,os=e=>e.shiftKey,ss=e=>e.shiftKey;p();import{pointFromPair as zt}from"@excalidraw/math";var cs=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)}},us=(e,t,n,r)=>{let o=n.map(y=>y[e]),s=Math.max(...o),a=Math.min(...o),i=s-a,l=i===0?1:t/i,u=1/0,m=n.map(y=>{let v=y[e]*l,w=[...y];return w[e]=v,v<u&&(u=v),w});if(!r||m.length===2)return m;let g=a-u;return m.map(y=>zt(y.map((v,w)=>w===e?v+g:v)))},ps=(e,t,n)=>n?[Math.round(e/n)*n,Math.round(t/n)*n]:[e,t];p();var we=Q(Le(),1),Fe=class{pool;entries={};constructor(t,n){this.pool=new we.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 Ie=(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 L=class{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}};p();import{average as N}from"@excalidraw/math";var Y=null,Rs=e=>{Y=e},Os=()=>{if(Y)return Y;let e=new Date,t=e.getFullYear(),n=`${e.getMonth()+1}`.padStart(2,"0"),r=`${e.getDate()}`.padStart(2,"0"),o=`${e.getHours()}`.padStart(2,"0"),s=`${e.getMinutes()}`.padStart(2,"0");return`${t}-${n}-${r}-${o}${s}`},Ls=e=>e.charAt(0).toUpperCase()+e.slice(1),Fs=e=>e instanceof HTMLElement&&e.className.includes("ToolIcon"),qt=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement,ws=e=>qt(e)||e instanceof Element&&!!e.closest("label, button"),Is=e=>e instanceof HTMLElement&&e.dataset.type==="wysiwyg"||e instanceof HTMLBRElement||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&(e.type==="text"||e.type==="number"||e.type==="password"||e.type==="search")||e instanceof HTMLElement&&e.closest(".cm-editor")!==null,jt=({fontFamily:e})=>{for(let[t,n]of Object.entries(T))if(n===e)return`${t}${Ee(n).map(r=>`, ${r}`).join("")}`;return O},Cs=({fontSize:e,fontFamily:t})=>`${e}px ${jt({fontFamily:t})}`,Ps=async e=>{requestAnimationFrame(()=>requestAnimationFrame(e))},Ds=(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},ks=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},Us=e=>1-Math.pow(1-e,4),Ns=(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},Hs=e=>{let t=window.getSelection();if(t){let n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}},Gs=()=>{let e=window.getSelection();e&&e.removeAllRanges()},Bs=(e,t)=>Math.abs(e-t),Ks=e=>e==="selection"||e==="lasso",Ws=(e,t)=>t.type==="custom"?{...e.activeTool,type:"custom",customType:t.customType,locked:t.locked??e.activeTool.locked}:{...e.activeTool,lastActiveTool:t.lastActiveToolBeforeEraser===void 0?e.activeTool.lastActiveTool:t.lastActiveToolBeforeEraser,type:t.type,customType:null,locked:t.locked??e.activeTool.locked,fromSelection:t.fromSelection??!1},Vs=()=>document.fullscreenElement?.nodeName==="HTML",Ys=()=>document.documentElement.requestFullscreen(),$s=()=>document.exitFullscreen(),Xs=({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}},zs=({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}},qs=e=>getComputedStyle(document.documentElement).getPropertyValue(`--${e}`),Zt="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u2C00-\uFB1C\uFDFE-\uFE6F\uFEFD-\uFFFF",Qt="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",Jt=new RegExp(`^[^${Zt}]*[${Qt}]`),js=e=>Jt.test(e),Zs=e=>{let[t,n]=e;return{x:t,y:n}},Qs=e=>{if(e?.name==="AbortError"){console.warn(e);return}throw e},Js=(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},ei=(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},ti=(e,t)=>{for(let n=0;n<e.length;n++){let r=t(e[n],n);if(r!=null)return r}},Ae=()=>{let e,t,n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n},ni=(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},ri=()=>document.querySelector('meta[name="version"]')?.content||Te,oi=()=>{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},si=e=>{let t=e.parentElement;for(;t;){if(t===document.body)return document;let{overflowY:n}=window.getComputedStyle(t);if(t.scrollHeight>t.clientHeight&&(n==="auto"||n==="scroll"||n==="overlay"))return t;t=t.parentElement}return document},ii=e=>{let t=e.parentElement;for(;t;){if(t.tabIndex>-1){t.focus();return}t=t.parentElement}},ai=e=>{e.preventDefault(),e.returnValue=""},li=e=>Array.from(e).map(t=>`0${t.toString(16)}`.slice(-2)).join(""),ci=()=>X()?1:Date.now(),ui=e=>e instanceof Map?e:e.reduce((t,n)=>(t.set(typeof n=="string"?n:n.id,n),t),new Map),pi=e=>e.reduce((t,n,r)=>(t.set(n.id,[n,r]),t),new Map),di=(e,t)=>e.reduce((n,r,o)=>(n[t?t(r):o]=r,n),{}),fi=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},[]),en=e=>Array.isArray(e)?e:e.values(),hi=e=>Array.isArray(e)?e:Array.from(en(e)),X=()=>h.MODE===k.TEST,mi=()=>h.MODE===k.DEVELOPMENT,Pe=()=>h.MODE===k.PRODUCTION,Ei=()=>typeof process<"u"&&!0,Ti=(e,t)=>new CustomEvent(e,{detail:{nativeEvent:t},cancelable:!0}),gi=(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},bi=e=>{let t=typeof e;return e==null||t!=="object"&&t!=="function"},tn=()=>{try{return window.self===window.top?"top":"iframe"}catch{return"iframe"}},_i=()=>tn()==="iframe",Ai=e=>!!e&&typeof e=="object"&&"then"in e&&"catch"in e&&"finally"in e,xi=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):[]},Ce=(e,t)=>Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t,nn=(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]||Ce(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]||Ce(e[a],t[a]);return!l&&r&&console.warn(`%cisShallowEqual: ${a} not equal ->`,"color: #8B4000",e[a],t[a]),l})},yi=(e,t,{checkForDefaultPrevented:n=!0}={})=>function(o){if(e?.(o),!n||!o?.defaultPrevented)return t?.(o)},vi=(e,t,n)=>{if(!t)return e;if(n)return console.error(t),e;throw new Error(t)};function Si(e,t){if(!e)throw new Error(t)}var Mi=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},Ri=(e,t)=>e instanceof Set||e instanceof Map?e.has(t):"includes"in e?e.includes(t):e.hasOwnProperty(t),Oi=e=>JSON.parse(JSON.stringify(e)),Li=(e,t)=>nn(e,t)?e:t;function Fi(e,t,n,r){return e?(e?.addEventListener?.(t,n,r),()=>{e?.removeEventListener?.(t,n,r)}):()=>{}}function wi(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)} ${N(o[0],s[0]).toFixed(2)},${N(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+=`${N(r[0],o[0]).toFixed(2)},${N(r[1],o[1]).toFixed(2)} `;return t&&(a+="Z"),a}var Ii=e=>e.replace(/\r?\n|\r/g,`
|
|
4
|
+
`);function Ci(e){return e}var xe=async(e,...t)=>new Promise(n=>{n(e(...t))}),Pi=(...e)=>Math.max(...e.map(t=>t?1:0))>0,Di=e=>{try{return JSON.parse(e)}catch{return null}},De=e=>e.replace(/"/g,"""),ki=e=>Array.isArray(e)?e:[e],rn=e=>Array.isArray(e),on=e=>rn(e)?e.length:e instanceof Map||e instanceof Set?e.size:Object.keys(e).length,Ui=(e,t)=>{if(on(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},ke="excalidraw-feature-flags",$={COMPLEX_BINDINGS:!1},M=null,Ni=e=>{if(!M)try{let t=localStorage.getItem(ke);t&&(M=JSON.parse(t)??$)}catch{}return(M||$)[e]},Hi=(e,t)=>{try{M={...M||$,[e]:t},localStorage.setItem(ke,JSON.stringify(M))}catch(n){console.error("unable to set feature flag",n)}},Gi=(e,t)=>t.includes(e);var Ue=new L(Date.now()),Ne=0,$i=()=>Math.floor(Ue.next()*2**31),Xi=e=>{Ue=new L(e),Ne=0},zi=()=>X()?`id${Ne++}`:Ie();p();var Ge=Q(He(),1);var mn=e=>(e=e.trim(),e&&(0,Ge.sanitizeUrl)(De(e))),ea=e=>!!(e?.includes(location.origin)||e?.startsWith("/")),ta=e=>{if(e=mn(e),e.startsWith("/"))return`${location.origin}${e}`;try{new URL(e)}catch{return"about:blank"}return e};p();var G=class{subscribers=[];on(...t){let n=t.flat().filter(r=>typeof r=="function");return this.subscribers.push(...n),()=>this.off(n)}once(...t){let n=t.flat().filter(o=>typeof o=="function");n.push(()=>r());let r=this.on(...n);return r}off(...t){let n=t.flat();this.subscribers=this.subscribers.filter(r=>!n.includes(r))}trigger(...t){for(let n of this.subscribers)n(...t);return this}clear(){this.subscribers=[]}};p();var Be=class{constructor(t){this.behavior=t}emitters=new Map;lastPayload=new Map;emittedOnce=new Set;getEmitter(t){let n=this.emitters.get(t);return n||(n=new G,this.emitters.set(t,n)),n}toPromiseValue(t){return t.length===1?t[0]:t}on(t,n){let r=this.behavior[t],o=this.lastPayload.get(t);if(n)return r.replay==="last"&&o&&(queueMicrotask(()=>n(...o)),r.cardinality==="once")?()=>{}:this.getEmitter(t).on(n);if(r.cardinality!=="once"||r.replay!=="last")throw new Error(`Event "${String(t)}" requires a callback`);return o?Promise.resolve(this.toPromiseValue(o)):new Promise(s=>{this.getEmitter(t).once((...a)=>{s(this.toPromiseValue(a))})})}emit(t,...n){let r=this.behavior[t];if(!Pe()&&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 Ke=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)),En=e=>F(e.reduce((t,n)=>t+n)/e.length),z=class e{static DEBUG_LOG_TIMES=!0;static TIMES_AGGR={};static TIMES_AVG={};static LAST_DEBUG_LOG_CALL=0;static DEBUG_LOG_INTERVAL_ID=null;static LAST_FRAME_TIMESTAMP=0;static FRAME_COUNT=0;static ANIMATION_FRAME_ID=null;static scheduleAnimationFrame=()=>{e.DEBUG_LOG_INTERVAL_ID!==null&&(e.ANIMATION_FRAME_ID=requestAnimationFrame(t=>{e.LAST_FRAME_TIMESTAMP!==t&&(e.LAST_FRAME_TIMESTAMP=t,e.FRAME_COUNT++),e.DEBUG_LOG_INTERVAL_ID!==null&&e.scheduleAnimationFrame()}))};static setupInterval=()=>{e.DEBUG_LOG_INTERVAL_ID===null&&(console.info("%c(starting perf recording)","color: lime"),e.DEBUG_LOG_INTERVAL_ID=window.setInterval(e.debugLogger,1e3),e.scheduleAnimationFrame()),e.LAST_DEBUG_LOG_CALL=Date.now()};static debugLogger=()=>{if(e.DEBUG_LOG_TIMES){for(let[t,{t:n,times:r}]of Object.entries(e.TIMES_AGGR))r.length&&(console.info(t,F(r.reduce((o,s)=>o+s)),r.sort((o,s)=>o-s).map(o=>F(o))),e.TIMES_AGGR[t]={t:n,times:[]});for(let[t,{t:n,times:r,avg:o}]of Object.entries(e.TIMES_AVG))if(r.length){let s=r.reduce((i,l)=>i+l),a=F(s/e.FRAME_COUNT);console.info(t,`- ${r.length} calls - ${a}ms/frame across ${e.FRAME_COUNT} frames (${F(a/16.67*100,1)}% of frame budget)`),e.TIMES_AVG[t]={t:n,times:[],avg:o!=null?En([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];We(i,l)||(s[a]={prev:i,next:l})}Object.keys(s).length>0&&console.info(`[${t}] changed:`,s)}};function We(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(!We(e[o],t[o]))return!1;return!0}export{Hr as ACTIVE_THRESHOLD,vr as ALLOWED_PASTE_MIME_TYPES,Xn as APP_NAME,Zr as ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO,jr as ARROW_LABEL_WIDTH_FRACTION,ho as ARROW_TYPE,Be as AppEventBus,_o as BIND_MODE_TIMEOUT,qr as BOUND_TEXT_PADDING,J as BinaryHeap,Ar as CANVAS_ONLY_ACTIONS,Ht as CANVAS_SEARCH_TAB,fe as CJK_HAND_DRAWN_FALLBACK_FONT,ar as CLASSES,Re as CODES,wn as COLORS_PER_ROW,br as COLOR_CHARCOAL_BLACK,Gn as COLOR_OUTLINE_CONTRAST_THRESHOLD,d as COLOR_PALETTE,_r as COLOR_VOICE_CALL,gr as COLOR_WHITE,rr as CURSOR_TYPE,ur as DARK_THEME_FILTER,no as DEFAULT_ADAPTIVE_RADIUS,Dn as DEFAULT_CANVAS_BACKGROUND_PICKS,In as DEFAULT_CHART_COLOR_INDEX,Tr as DEFAULT_COLLISION_THRESHOLD,D as DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX,Un as DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE,Pn as DEFAULT_ELEMENT_BACKGROUND_PICKS,io as DEFAULT_ELEMENT_PROPS,P as DEFAULT_ELEMENT_STROKE_COLOR_INDEX,kn as DEFAULT_ELEMENT_STROKE_COLOR_PALETTE,Cn as DEFAULT_ELEMENT_STROKE_PICKS,Nt as DEFAULT_ELEMENT_STROKE_WIDTH_KEY,Wr as DEFAULT_EXPORT_PADDING,uo as DEFAULT_FILENAME,hr as DEFAULT_FONT_FAMILY,fr as DEFAULT_FONT_SIZE,xr as DEFAULT_GRID_SIZE,yr as DEFAULT_GRID_STEP,Vr as DEFAULT_IMAGE_OPTIONS,nr as DEFAULT_LASER_COLOR,Pt as DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT,to as DEFAULT_PROPORTIONAL_RADIUS,mo as DEFAULT_REDUCED_GLOBAL_ALPHA,ao as DEFAULT_SIDEBAR,xo as DEFAULT_STROKE_STREAMLINE,yo as DEFAULT_STROKE_STREAMLINE_PRECISE,mr as DEFAULT_TEXT_ALIGN,Ft as DEFAULT_TRANSFORM_HANDLE_SPACING,Gr as DEFAULT_UI_OPTIONS,Te as DEFAULT_VERSION,Er as DEFAULT_VERTICAL_ALIGN,bo as DOUBLE_TAP_POSITION_THRESHOLD,qn as DRAGGING_THRESHOLD,z as Debug,co as EDITOR_LS_KEYS,Eo as ELEMENT_LINK_KEY,eo as ELEMENT_READY_TO_ERASE_OPACITY,Qn as ELEMENT_SHIFT_TRANSLATE_AMOUNT,Jn as ELEMENT_TRANSLATE_AMOUNT,Xr as ENCRYPTION_KEY_BITS,k as ENV,It as EPSILON,Rt as EVENT,Mr as EXPORT_DATA_TYPES,Sr as EXPORT_IMAGE_TYPES,Kr as EXPORT_SCALES,G as Emitter,T as FONT_FAMILY,W as FONT_FAMILY_FALLBACKS,Ot as FONT_FAMILY_GENERIC_FALLBACKS,U as FONT_METADATA,lr as FONT_SIZES,pr as FRAME_STYLE,Ut as FREEDRAW_STROKE_WIDTH,Ro as GOOGLE_FONTS_RANGES,Ur as HYPERLINK_TOOLTIP_DELAY,Nr as IDLE_THRESHOLD,ge as IMAGE_MIME_TYPES,Or as IMAGE_RENDER_TIMEOUT,S as KEYS,$t as KeyCodeMap,Zn as LINE_CONFIRM_THRESHOLD,go as LINE_POLYGON_POINT_MERGE_DISTANCE,Oo as LOCAL_FONT_PROTOCOL,Dt as MAX_ALLOWED_FILE_BYTES,Fn as MAX_CUSTOM_COLORS_USED_IN_CANVAS,Br as MAX_DECIMALS_FOR_SVG_EXPORT,kr as MAX_ZOOM,de as MIME_TYPES,jn as MINIMUM_ARROW_SIZE,dr as MIN_FONT_SIZE,fo as MIN_WIDTH_OR_HEIGHT,Dr as MIN_ZOOM,Ao as MOBILE_ACTION_BUTTON_BG,me as MONOSPACE_GENERIC_FONT,No as MQ_MAX_HEIGHT_LANDSCAPE,ko as MQ_MAX_MOBILE,Go as MQ_MAX_TABLET,Uo as MQ_MAX_WIDTH_LANDSCAPE,Ho as MQ_MIN_TABLET,Bo as MQ_MIN_WIDTH_DESKTOP,Ko as MQ_RIGHT_SIDEBAR_MIN_WIDTH,To as ORIG_ID,or as POINTER_BUTTON,sr as POINTER_EVENTS,Fe as PromisePool,_e as Queue,kt as ROUGHNESS,ro as ROUNDNESS,he as SANS_SERIF_GENERIC_FONT,Cr as SCROLL_TIMEOUT,tr as SHIFT_LOCKING_ANGLE,wt as SIDE_RESIZING_THRESHOLD,po as STATS_PANELS,Ct as STRING_MIME_TYPES,be as STROKE_WIDTH,oo as STROKE_WIDTH_KEYS,$r as SVG_DOCUMENT_PREAMBLE,Yr as SVG_NS,Lr as TAP_TWICE_TIMEOUT,Jr as TEXT_ALIGN,zn as TEXT_AUTOWRAP_THRESHOLD,er as TEXT_TO_CENTER_SNAP_THRESHOLD,cr as THEME,wr as TITLE_TIMEOUT,lo as TOOL_TYPE,Fr as TOUCH_CTX_MENU_TIMEOUT,Gt as UserIdleState,zr as VERSIONS,Ir as VERSION_TIMEOUT,Qr as VERTICAL_ALIGN,Ke as VersionedSnapshotStore,O as WINDOWS_EMOJI_FALLBACK_FONT,ir as YOUTUBE_STATES,Pr as ZOOM_STEP,Fi as addEventListener,Ys as allowFullScreen,Ln as applyDarkModeFilter,fi as arrayToList,ui as arrayToMap,pi as arrayToMapWithIndex,di as arrayToObject,vi as assertNever,li as bytesToHexString,Ls as capitalizeString,ki as castArray,Ns as chunk,Oi as cloneJSON,Hn as colorToHex,yi as composeEventHandlers,qo as createUserAgentDescriptor,Ds as debounce,zo as deriveStylesPanelMode,Bs as distance,Us as easeOut,De as escapeDoubleQuotes,$s as exitFullScreen,Js as findIndex,ei as findLastIndex,ii as focusNearestParent,Nn as getAllColorsSpecificShade,Os as getDateTime,Rr as getExportSource,Ni as getFeatureFlag,Ee as getFontFamilyFallbacks,jt as getFontFamilyString,Cs as getFontString,Xo as getFormFactor,tn as getFrame,Lt as getGenericFontFamilyFallback,qs as getGlobalCSSVariable,ps as getGridPoint,Fo as getLineHeight,si as getNearestScrollableContainer,cs as getSizeFromPoints,so as getStrokeWidthByKey,wi as getSvgPathFromStroke,ci as getUpdatedTimestamp,ri as getVersion,Lo as getVerticalOffset,Si as invariant,Se as isAndroid,Pi as isAnyTrue,ns as isArrowKey,An as isBounds,$o as isBrave,Bt as isChrome,Bn as isColorDark,ve as isDarwin,mi as isDevEnv,Vo as isFirefox,Vs as isFullScreen,Me as isIOS,qt as isInputLike,ws as isInteractive,Xt as isLatinChar,ea as isLocalLink,Ri as isMemberOf,Kt as isMobileBreakpoint,bi as isPrimitive,Pe as isProdEnv,Ai as isPromiseLike,js as isRTL,rn as isReadonlyArray,_i as isRunningInIframe,Yo as isSafari,Ks as isSelectionLikeTool,Ei as isServerEnv,nn as isShallowEqual,Wt as isTabletBreakpoint,X as isTestEnv,Fs as isToolIcon,pe as isTransparent,Wo as isWindows,Is as isWritableElement,jo as loadDesktopUIModePreference,ti as mapFind,ts as matchKey,Mi as memoize,Qs as muteFSAbortError,ni as nFormatter,Ps as nextAnimationFrame,Ii as normalizeEOL,Kn as normalizeInputColor,mn as normalizeLink,Gi as oneOf,ai as preventUnload,xe as promiseTry,xi as queryFocusableElements,zi as randomId,$i as randomInteger,Ui as reduceToCommonValue,Gs as removeSelection,us as rescalePoints,Xi as reseed,Ae as resolvablePromise,ue as rgbToHex,Di as safelyParseJSON,zs as sceneCoordsToViewportCoords,Hs as selectNode,Rs as setDateTimeForTests,Zo as setDesktopUIMode,Hi as setFeatureFlag,os as shouldMaintainAspectRatio,rs as shouldResizeFromCenter,ss as shouldRotateWithDiscreteAngle,on as sizeOf,oi as supportsEmoji,$n as supportsResizeObserver,ks as throttleRAF,hi as toArray,Ci as toBrandedType,en as toIterable,ta as toValidURL,Zs as tupleToCoors,Ws as updateActiveTool,gi as updateObject,Li as updateStable,Xs as viewportCoordsToSceneCoords,Ti as wrapEvent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const applyDarkModeFilter: (color: string) => string;
|
|
1
|
+
export declare const applyDarkModeFilter: (color: string, enable?: boolean) => string;
|
|
2
2
|
export type ColorTuple = readonly [string, string, string, string, string];
|
|
3
3
|
export type ColorPaletteCustom = {
|
|
4
4
|
[key: string]: ColorTuple | string;
|
|
@@ -264,11 +264,12 @@ export declare const ROUGHNESS: {
|
|
|
264
264
|
readonly artist: 1;
|
|
265
265
|
readonly cartoonist: 2;
|
|
266
266
|
};
|
|
267
|
-
export
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
267
|
+
export type StrokeWidthKey = "thin" | "medium" | "bold";
|
|
268
|
+
export declare const STROKE_WIDTH_KEYS: readonly StrokeWidthKey[];
|
|
269
|
+
export declare const STROKE_WIDTH: Readonly<Record<StrokeWidthKey | "extraBold", ExcalidrawElement["strokeWidth"]>>;
|
|
270
|
+
export declare const FREEDRAW_STROKE_WIDTH: Readonly<Record<StrokeWidthKey | "extraBold", ExcalidrawElement["strokeWidth"]>>;
|
|
271
|
+
export declare const getStrokeWidthByKey: (elementType: ExcalidrawElement["type"], strokeWidthKey: StrokeWidthKey) => ExcalidrawElement["strokeWidth"];
|
|
272
|
+
export declare const DEFAULT_ELEMENT_STROKE_WIDTH_KEY: StrokeWidthKey;
|
|
272
273
|
export declare const DEFAULT_ELEMENT_PROPS: {
|
|
273
274
|
strokeColor: ExcalidrawElement["strokeColor"];
|
|
274
275
|
backgroundColor: ExcalidrawElement["backgroundColor"];
|
|
@@ -339,3 +340,5 @@ export declare const BIND_MODE_TIMEOUT = 700;
|
|
|
339
340
|
export declare const MOBILE_ACTION_BUTTON_BG: {
|
|
340
341
|
readonly background: "var(--mobile-action-button-bg)";
|
|
341
342
|
};
|
|
343
|
+
export declare const DEFAULT_STROKE_STREAMLINE = 0.5;
|
|
344
|
+
export declare const DEFAULT_STROKE_STREAMLINE_PRECISE = 0.2;
|
|
@@ -37,48 +37,6 @@ export declare const throttleRAF: <T extends any[]>(fn: (...args: T) => void) =>
|
|
|
37
37
|
* @returns {number} The tweened value.
|
|
38
38
|
*/
|
|
39
39
|
export declare const easeOut: (k: number) => number;
|
|
40
|
-
/**
|
|
41
|
-
* Animates values from `fromValues` to `toValues` using the requestAnimationFrame API.
|
|
42
|
-
* Executes the `onStep` callback on each step with the interpolated values.
|
|
43
|
-
* Returns a function that can be called to cancel the animation.
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* // Example usage:
|
|
47
|
-
* const fromValues = { x: 0, y: 0 };
|
|
48
|
-
* const toValues = { x: 100, y: 200 };
|
|
49
|
-
* const onStep = ({x, y}) => {
|
|
50
|
-
* setState(x, y)
|
|
51
|
-
* };
|
|
52
|
-
* const onCancel = () => {
|
|
53
|
-
* console.log("Animation canceled");
|
|
54
|
-
* };
|
|
55
|
-
*
|
|
56
|
-
* const cancelAnimation = easeToValuesRAF({
|
|
57
|
-
* fromValues,
|
|
58
|
-
* toValues,
|
|
59
|
-
* onStep,
|
|
60
|
-
* onCancel,
|
|
61
|
-
* });
|
|
62
|
-
*
|
|
63
|
-
* // To cancel the animation:
|
|
64
|
-
* cancelAnimation();
|
|
65
|
-
*/
|
|
66
|
-
export declare const easeToValuesRAF: <T extends Record<keyof T, number>, K extends keyof T>({ fromValues, toValues, onStep, duration, interpolateValue, onStart, onEnd, onCancel, }: {
|
|
67
|
-
fromValues: T;
|
|
68
|
-
toValues: T;
|
|
69
|
-
/**
|
|
70
|
-
* Interpolate a single value.
|
|
71
|
-
* Return undefined to be handled by the default interpolator.
|
|
72
|
-
*/
|
|
73
|
-
interpolateValue?: (fromValue: number, toValue: number,
|
|
74
|
-
/** no easing applied */
|
|
75
|
-
progress: number, key: K) => number | undefined;
|
|
76
|
-
onStep: (values: T) => void;
|
|
77
|
-
duration?: number;
|
|
78
|
-
onStart?: () => void;
|
|
79
|
-
onEnd?: () => void;
|
|
80
|
-
onCancel?: () => void;
|
|
81
|
-
}) => () => void;
|
|
82
40
|
export declare const chunk: <T extends any>(array: readonly T[], size: number) => T[][];
|
|
83
41
|
export declare const selectNode: (node: Element) => void;
|
|
84
42
|
export declare const removeSelection: () => void;
|
|
@@ -2,7 +2,7 @@ import { type Bounds } from "@excalidraw/common";
|
|
|
2
2
|
import type { Degrees, GlobalPoint, LineSegment, LocalPoint } from "@excalidraw/math";
|
|
3
3
|
import type { AppState } from "@excalidraw/excalidraw/types";
|
|
4
4
|
import type { Drawable, Op } from "roughjs/bin/core";
|
|
5
|
-
import type { Arrowhead, ElementsMap, ElementsMapOrArray, ExcalidrawElement, ExcalidrawLinearElement, NonDeleted } from "./types";
|
|
5
|
+
import type { Arrowhead, ElementsMap, ElementsMapOrArray, ExcalidrawElement, ExcalidrawLinearElement, NonDeleted, NonDeletedExcalidrawElement } from "./types";
|
|
6
6
|
export type RectangleBox = {
|
|
7
7
|
x: number;
|
|
8
8
|
y: number;
|
|
@@ -80,4 +80,21 @@ export declare const pointInsideBounds: <P extends GlobalPoint | LocalPoint>(p:
|
|
|
80
80
|
export declare const pointInsideBoundsInclusive: <P extends GlobalPoint | LocalPoint>(p: P, bounds: Bounds) => boolean;
|
|
81
81
|
export declare const doBoundsIntersect: (bounds1: Bounds | null, bounds2: Bounds | null) => boolean;
|
|
82
82
|
export declare const boundsContainBounds: (outerBounds: Bounds, innerBounds: Bounds) => boolean;
|
|
83
|
+
/**
|
|
84
|
+
* High level helper to get elements overlapping a bounding box.
|
|
85
|
+
* It can be used to get elements overlapping a selection box, for example.
|
|
86
|
+
*
|
|
87
|
+
*/
|
|
88
|
+
export declare const elementsOverlappingBBox: ({ elements, elementsMap, bounds, type, excludeElementsInFrames, shouldIgnoreElementFromSelection, }: {
|
|
89
|
+
elements: readonly NonDeletedExcalidrawElement[];
|
|
90
|
+
elementsMap?: ElementsMap;
|
|
91
|
+
bounds: Bounds | ExcalidrawElement;
|
|
92
|
+
/**
|
|
93
|
+
* - overlap: elements overlapping or inside bounds
|
|
94
|
+
* - contain: elements inside bounds
|
|
95
|
+
**/
|
|
96
|
+
type: "contain" | "overlap";
|
|
97
|
+
excludeElementsInFrames?: boolean;
|
|
98
|
+
shouldIgnoreElementFromSelection?: (element: NonDeletedExcalidrawElement) => boolean;
|
|
99
|
+
}) => NonDeletedExcalidrawElement[];
|
|
83
100
|
export declare const elementCenterPoint: (element: ExcalidrawElement, elementsMap: ElementsMap, xOffset?: number, yOffset?: number) => GlobalPoint;
|
|
@@ -3,6 +3,7 @@ export declare const hasBackground: (type: ElementOrToolType) => type is "line"
|
|
|
3
3
|
export declare const hasStrokeColor: (type: ElementOrToolType) => type is "line" | "arrow" | "text" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "freedraw";
|
|
4
4
|
export declare const hasStrokeWidth: (type: ElementOrToolType) => type is "line" | "arrow" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "iframe" | "freedraw";
|
|
5
5
|
export declare const hasStrokeStyle: (type: ElementOrToolType) => type is "line" | "arrow" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "iframe";
|
|
6
|
+
export declare const hasFreedrawMode: (type: ElementOrToolType) => type is "freedraw";
|
|
6
7
|
export declare const canChangeRoundness: (type: ElementOrToolType) => type is "line" | "rectangle" | "diamond" | "embeddable" | "iframe" | "image";
|
|
7
8
|
export declare const toolIsArrow: (type: ElementOrToolType) => type is "arrow";
|
|
8
9
|
export declare const canHaveArrowheads: (type: ElementOrToolType) => type is "arrow";
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { AppClassProperties, DataURL, BinaryFiles } from "@excalidraw/excalidraw/types";
|
|
2
2
|
import type { ExcalidrawElement, FileId, InitializedExcalidrawImageElement } from "./types";
|
|
3
|
+
export declare const generateThumbHash: (image: HTMLImageElement) => string | null;
|
|
4
|
+
export declare const getThumbHashPlaceholder: (thumbHash: string) => HTMLCanvasElement | null;
|
|
3
5
|
export declare const loadHTMLImageElement: (dataURL: DataURL) => Promise<HTMLImageElement>;
|
|
4
6
|
/** NOTE: updates cache even if already populated with given image. Thus,
|
|
5
7
|
* you should filter out the images upstream if you want to optimize this. */
|
|
@@ -11,6 +13,9 @@ export declare const updateImageCache: ({ fileIds, files, imageCache, }: {
|
|
|
11
13
|
imageCache: Map<FileId, {
|
|
12
14
|
image: HTMLImageElement | Promise<HTMLImageElement>;
|
|
13
15
|
mimeType: import("@excalidraw/common/utility-types").ValueOf<typeof import("@excalidraw/common").IMAGE_MIME_TYPES>;
|
|
16
|
+
isPlaceholder?: boolean;
|
|
17
|
+
placeholderImage?: HTMLImageElement;
|
|
18
|
+
transitionStart?: number;
|
|
14
19
|
}>;
|
|
15
20
|
/** includes errored files because they cache was updated nonetheless */
|
|
16
21
|
updatedFiles: Map<FileId, true>;
|
|
@@ -38,6 +38,7 @@ export declare const newFreeDrawElement: (opts: {
|
|
|
38
38
|
type: "freedraw";
|
|
39
39
|
points?: ExcalidrawFreeDrawElement["points"];
|
|
40
40
|
simulatePressure: boolean;
|
|
41
|
+
strokeOptions?: ExcalidrawFreeDrawElement["strokeOptions"];
|
|
41
42
|
pressures?: ExcalidrawFreeDrawElement["pressures"];
|
|
42
43
|
} & ElementConstructorOpts) => NonDeleted<ExcalidrawFreeDrawElement>;
|
|
43
44
|
export declare const newLinearElement: (opts: {
|
|
@@ -58,6 +59,7 @@ export declare const newImageElement: (opts: {
|
|
|
58
59
|
status?: ExcalidrawImageElement["status"];
|
|
59
60
|
fileId?: ExcalidrawImageElement["fileId"];
|
|
60
61
|
fileName?: ExcalidrawImageElement["fileName"];
|
|
62
|
+
thumbHash?: ExcalidrawImageElement["thumbHash"];
|
|
61
63
|
scale?: ExcalidrawImageElement["scale"];
|
|
62
64
|
crop?: ExcalidrawImageElement["crop"];
|
|
63
65
|
} & ElementConstructorOpts) => NonDeleted<ExcalidrawImageElement>;
|
|
@@ -130,6 +130,8 @@ export type ExcalidrawImageElement = _ExcalidrawElementBase & Readonly<{
|
|
|
130
130
|
type: "image";
|
|
131
131
|
fileId: FileId | null;
|
|
132
132
|
fileName: string | null;
|
|
133
|
+
/** compact base64-encoded ThumbHash used while the image is unavailable */
|
|
134
|
+
thumbHash: string | null;
|
|
133
135
|
/** whether respective file is persisted */
|
|
134
136
|
status: "pending" | "saved" | "error";
|
|
135
137
|
/** X and Y scale factors <-1, 1>, used for image axis flipping */
|
|
@@ -256,11 +258,17 @@ export type ExcalidrawElbowArrowElement = Merge<ExcalidrawArrowElement, {
|
|
|
256
258
|
*/
|
|
257
259
|
endIsSpecial: boolean | null;
|
|
258
260
|
}>;
|
|
261
|
+
export type StrokeVariability = "variable" | "constant";
|
|
262
|
+
export type StrokeOptions = Readonly<{
|
|
263
|
+
variability: StrokeVariability;
|
|
264
|
+
streamline: number;
|
|
265
|
+
}>;
|
|
259
266
|
export type ExcalidrawFreeDrawElement = _ExcalidrawElementBase & Readonly<{
|
|
260
267
|
type: "freedraw";
|
|
261
268
|
points: readonly LocalPoint[];
|
|
262
269
|
pressures: readonly number[];
|
|
263
270
|
simulatePressure: boolean;
|
|
271
|
+
strokeOptions: StrokeOptions;
|
|
264
272
|
}>;
|
|
265
273
|
export type FileId = string & {
|
|
266
274
|
_brand: "FileId";
|
|
@@ -93,9 +93,10 @@ export declare const actionBindText: {
|
|
|
93
93
|
currentItemStrokeColor: string;
|
|
94
94
|
currentItemBackgroundColor: string;
|
|
95
95
|
currentItemFillStyle: ExcalidrawElement["fillStyle"];
|
|
96
|
-
|
|
96
|
+
currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
|
|
97
97
|
currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
|
|
98
98
|
currentItemRoughness: number;
|
|
99
|
+
currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
|
|
99
100
|
currentItemOpacity: number;
|
|
100
101
|
currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
|
|
101
102
|
currentItemFontSize: number;
|
|
@@ -153,6 +154,7 @@ export declare const actionBindText: {
|
|
|
153
154
|
gridStep: number;
|
|
154
155
|
gridModeEnabled: boolean;
|
|
155
156
|
viewModeEnabled: boolean;
|
|
157
|
+
viewModeOnly: boolean;
|
|
156
158
|
selectedGroupIds: {
|
|
157
159
|
[groupId: string]: boolean;
|
|
158
160
|
};
|
|
@@ -271,9 +273,10 @@ export declare const actionWrapTextInContainer: {
|
|
|
271
273
|
currentItemStrokeColor: string;
|
|
272
274
|
currentItemBackgroundColor: string;
|
|
273
275
|
currentItemFillStyle: ExcalidrawElement["fillStyle"];
|
|
274
|
-
|
|
276
|
+
currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
|
|
275
277
|
currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
|
|
276
278
|
currentItemRoughness: number;
|
|
279
|
+
currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
|
|
277
280
|
currentItemOpacity: number;
|
|
278
281
|
currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
|
|
279
282
|
currentItemFontSize: number;
|
|
@@ -331,6 +334,7 @@ export declare const actionWrapTextInContainer: {
|
|
|
331
334
|
gridStep: number;
|
|
332
335
|
gridModeEnabled: boolean;
|
|
333
336
|
viewModeEnabled: boolean;
|
|
337
|
+
viewModeOnly: boolean;
|
|
334
338
|
selectedGroupIds: {
|
|
335
339
|
[groupId: string]: boolean;
|
|
336
340
|
};
|