@mlightcad/common 1.11.3 → 1.12.1

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.
@@ -1 +1 @@
1
- (function(h,n){typeof exports=="object"&&typeof module<"u"?n(exports):typeof define=="function"&&define.amd?define(["exports"],n):(h=typeof globalThis<"u"?globalThis:h||self,n(h.common={}))})(this,(function(h){"use strict";var n=(r=>(r[r.ByColor=1]="ByColor",r[r.ByACI=2]="ByACI",r[r.ByLayer=3]="ByLayer",r[r.ByBlock=4]="ByBlock",r[r.None=0]="None",r))(n||{});const $={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},S=[0,16711680,16776960,65280,65535,255,16711935,16777215,8421504,12632256,16711680,16744319,13369344,13395558,10027008,10046540,8323072,8339263,4980736,4990502,16727808,16752511,13382400,13401958,10036736,10051404,8331008,8343359,4985600,4992806,16744192,16760703,13395456,13408614,10046464,10056268,8339200,8347455,4990464,4995366,16760576,16768895,13408512,13415014,10056192,10061132,8347392,8351551,4995328,4997670,16776960,16777087,13421568,13421670,10000384,10000460,8355584,8355647,5000192,5000230,12582656,14679935,10079232,11717734,7510016,8755276,6258432,7307071,3755008,4344870,8388352,12582783,6736896,10079334,5019648,7510092,4161280,6258495,2509824,3755046,4194048,10485631,3394560,8375398,2529280,6264908,2064128,5209919,1264640,3099686,65280,8388479,52224,6736998,38912,5019724,32512,4161343,19456,2509862,65343,8388511,52275,6737023,38950,5019743,32543,4161359,19475,2509871,65407,8388543,52326,6737049,38988,5019762,32575,4161375,19494,2509881,65471,8388575,52377,6737074,39026,5019781,32607,4161391,19513,2509890,65535,8388607,52428,6737100,39064,5019800,32639,4161407,19532,2509900,49151,8380415,39372,6730444,29336,5014936,24447,4157311,14668,2507340,32767,8372223,26316,6724044,19608,5010072,16255,4153215,9804,2505036,16383,8364031,13260,6717388,9880,5005208,8063,4149119,4940,2502476,255,8355839,204,6710988,152,5000344,127,4145023,76,2500172,4129023,10452991,3342540,8349388,2490520,6245528,2031743,5193599,1245260,3089996,8323327,12550143,6684876,10053324,4980888,7490712,4128895,6242175,2490444,3745356,12517631,14647295,10027212,11691724,7471256,8735896,6226047,7290751,3735628,4335180,16711935,16744447,13369548,13395660,9961624,9981080,8323199,8339327,4980812,4990540,16711871,16744415,13369497,13395634,9961586,9981061,8323167,8339311,4980793,4990530,16711807,16744383,13369446,13395609,9961548,9981042,8323135,8339295,4980774,4990521,16711743,16744351,13369395,13395583,9961510,9981023,8323103,8339279,4980755,4990511,3355443,5987163,8684676,11382189,14079702,16777215,0];class b{static getColorByIndex(e){return S[e]}static getIndexByColor(e){const t=S.length-1;for(let s=1;s<t;++s)if(S[s]===e)return s}static getColorByName(e){return $[e.toLowerCase()]}static getNameByColor(e){for(const[t,s]of Object.entries($))if(s===e)return t}static getNameByIndex(e){const t=this.getColorByIndex(e);return this.getNameByColor(t)}}class v{constructor(e=n.ByLayer,t){this._colorMethod=e,this._colorMethod==n.ByColor&&t==null?this._value=16777215:this._colorMethod==n.ByACI?t==null?this._value=8:t===0?this._colorMethod=n.ByBlock:t===256?this._colorMethod=n.ByLayer:this._value=Math.max(0,Math.min(t,256)):this._value=t}get colorMethod(){return this._colorMethod}set colorMethod(e){this._colorMethod=e}get red(){const e=this.RGB;return e!=null?e>>16&255:void 0}get green(){const e=this.RGB;return e!=null?e>>8&255:void 0}get blue(){const e=this.RGB;return e!=null?e&255:void 0}get RGB(){switch(this._colorMethod){case n.ByColor:case n.ByBlock:case n.ByLayer:return this._value;case n.ByACI:return this._value?b.getColorByIndex(this._value):this._value;default:return}}setRGB(e,t,s){const i=Math.max(0,Math.min(255,Math.round(e))),l=Math.max(0,Math.min(255,Math.round(t))),o=Math.max(0,Math.min(255,Math.round(s)));return this._value=i<<16|l<<8|o,this._colorMethod=n.ByColor,this}setRGBValue(e){return e==null||!Number.isFinite(e)?this:(this._value=e&16777215,this._colorMethod=n.ByColor,this)}setRGBFromCss(e){if(!e)return this;const t=e.trim().toLowerCase();if(t.startsWith("#")){let l=0,o=0,d=0;if(t.length===7)l=parseInt(t.substr(1,2),16),o=parseInt(t.substr(3,2),16),d=parseInt(t.substr(5,2),16);else if(t.length===4)l=parseInt(t[1]+t[1],16),o=parseInt(t[2]+t[2],16),d=parseInt(t[3]+t[3],16);else return this;return this.setRGB(l,o,d)}const s=t.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);if(s){const l=parseInt(s[1],10),o=parseInt(s[2],10),d=parseInt(s[3],10);return this.setRGB(l,o,d)}const i=b.getColorByName(e);return i!==void 0?this.setRGBValue(i):this}setScalar(e){return this.setRGB(e,e,e)}get hexColor(){const e=this.RGB;return e==null?void 0:"0x"+e.toString(16).padStart(6,"0").toUpperCase()}get cssColor(){const e=this.RGB;if(e!=null)return`rgb(${e>>16&255},${e>>8&255},${e&255})`}cssColorAlpha(e){const t=this.RGB;if(t!=null)return`rgba(${t>>16&255},${t>>8&255},${t&255},${e})`}get colorIndex(){return this._colorMethod===n.ByACI?this._value:this._colorMethod===n.ByLayer?256:this._colorMethod===n.ByBlock?0:void 0}set colorIndex(e){if(e==null)return;const t=Math.max(0,Math.min(256,Math.round(e)));t===0?(this._colorMethod=n.ByBlock,this._value=void 0):t===256?(this._colorMethod=n.ByLayer,this._value=void 0):(this._colorMethod=n.ByACI,this._value=t)}get isByColor(){return this._colorMethod===n.ByColor}get isByACI(){return this._colorMethod===n.ByACI}get isForeground(){return this._colorMethod===n.ByACI&&this._value===7}setForeground(){return this._colorMethod=n.ByACI,this._value=7,this}get isByLayer(){return this._colorMethod===n.ByLayer}setByLayer(e){return this._colorMethod=n.ByLayer,e==null?this._value=256:this._value=e,this}get isByBlock(){return this._colorMethod===n.ByBlock}setByBlock(e){return this._colorMethod=n.ByBlock,e==null?this._value=0:this._value=e,this}get colorName(){switch(this._colorMethod){case n.ByLayer:return"ByLayer";case n.ByBlock:return"ByBlock";case n.ByColor:return this._value?b.getNameByColor(this._value):"";case n.ByACI:return this._value?b.getNameByIndex(this._value):"";default:return}}set colorName(e){if(!e)return;const t=b.getColorByName(e);t!==void 0&&(this._value=t,this._colorMethod=n.ByColor)}clone(){const e=new v;return e._colorMethod=this._colorMethod,e._value=this._value,e}copy(e){return this._colorMethod=e._colorMethod,this._value=e._value,this}equals(e){return this._colorMethod===e._colorMethod&&this._value===e._value}toString(){switch(this._colorMethod){case n.None:return"None";case n.ByLayer:return"ByLayer";case n.ByBlock:return"ByBlock";case n.ByACI:return this._value!==void 0?String(this._value):"";case n.ByColor:return this._value?`RGB:${this.red},${this.green},${this.blue}`:"";default:return""}}static fromString(e){if(!e)return;const t=e.trim();if(/^none$/i.test(t))return new v(n.None);if(/^bylayer$/i.test(t))return new v(n.ByLayer);if(/^byblock$/i.test(t))return new v(n.ByBlock);const s=t.match(/^rgb\s*:\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})$/i);if(s){const l=Number(s[1]),o=Number(s[2]),d=Number(s[3]),_=new v(n.ByColor);return _.setRGB(l,o,d),_}if(/^\d{1,3},\d{1,3},\d{1,3}$/.test(t)){const[l,o,d]=t.split(",").map(Number),_=new v(n.ByColor);return _.setRGB(l,o,d),_}if(/^\d+$/.test(t)){const l=parseInt(t,10);return new v(n.ByACI,l)}if(/^book\$/i.test(t)){const l=t.substring(t.indexOf("$")+1),o=b.getColorByName(l);return o!=null?new v(n.ByColor,o):void 0}const i=b.getColorByName(t);if(i!=null)return new v(n.ByColor,i)}}class Z{constructor(e=n.ByColor,t=0){this._colorMethod=e,this._value=t}get colorMethd(){return this._colorMethod}get red(){return this._value>>16&255}set red(e){this._colorMethod=n.ByColor,this._value=this._value&65535|(e&255)<<16}get green(){return this._value>>8&255}set green(e){this._colorMethod=n.ByColor,this._value=this._value&16711935|(e&255)<<8}get blue(){return this._value&255}set blue(e){this._colorMethod=n.ByColor,this._value=this._value&16776960|e&255}setRGB(e,t,s){this._colorMethod=n.ByColor,this._value=(e&255)<<16|(t&255)<<8|s&255}get colorIndex(){return this._value}set colorIndex(e){this._colorMethod=n.ByACI,this._value=e}get layerIndex(){return this._value}set layerIndex(e){this._colorMethod=n.ByLayer,this._value=e}isByColor(){return this._colorMethod===n.ByColor}isByLayer(){return this._colorMethod===n.ByLayer}isByBlock(){return this._colorMethod===n.ByBlock}isByACI(){return this._colorMethod===n.ByACI}isNone(){return this._colorMethod===n.None}get rawValue(){return this._value}set rawValue(e){this._value=e}}const J={get ILLEGAL_PARAMETERS(){return new ReferenceError("Illegal Parameters")},get ZERO_DIVISION(){return new Error("Zero division")},get UNRESOLVED_BOUNDARY_CONFLICT(){return new Error("Unresolved boundary conflict in boolean operation")},get INFINITE_LOOP(){return new Error("Infinite loop")},get CANNOT_INVOKE_ABSTRACT_METHOD(){return new Error("Abstract method cannot be invoked")},get OPERATION_IS_NOT_SUPPORTED(){return new Error("Operation is not supported")},get NOT_IMPLEMENTED(){return new Error("Not implemented yet")}};class X{constructor(){this._listeners={}}addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const s=this._listeners;s[e]===void 0&&(s[e]=[]),s[e].indexOf(t)===-1&&s[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const s=this._listeners;return s[e]!==void 0&&s[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const l=i.indexOf(t);l!==-1&&i.splice(l,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const s=this._listeners[e.type];if(s!==void 0){e.target=this;const i=s.slice(0);for(let l=0,o=i.length;l<o;l++)i[l].call(this,e)}}}class T{constructor(){this.listeners=[]}addEventListener(e){this.listeners.push(e)}removeEventListener(e){this.listeners=this.listeners.filter(t=>t!==e)}replaceEventListener(e){this.removeEventListener(e),this.addEventListener(e)}dispatch(e,...t){for(const s of this.listeners)s.call(null,e,...t)}}function C(r){return r===null||typeof r!="object"?r:Array.isArray(r)?[...r]:{...r}}function P(r){if(r===null||typeof r!="object")return r;if(r instanceof Date)return new Date(r.getTime());if(r instanceof RegExp)return new RegExp(r.source,r.flags);if(Array.isArray(r))return r.map(P);const e={};for(const t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=P(r[t]));return e}function D(r,...e){for(const t of e)if(t)for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&r[s]===void 0&&(r[s]=t[s]);return r}function q(r,e){return r!=null&&Object.prototype.hasOwnProperty.call(r,e)}function F(r){return r==null?!0:Array.isArray(r)||typeof r=="string"?r.length===0:r instanceof Map||r instanceof Set?r.size===0:typeof r=="object"?Object.keys(r).length===0:!1}function L(r,e){if(r===e)return!0;if(r==null||e==null)return r===e;if(typeof r!=typeof e)return!1;if(typeof r!="object")return r===e;if(Array.isArray(r)!==Array.isArray(e))return!1;if(Array.isArray(r)){if(r.length!==e.length)return!1;for(let i=0;i<r.length;i++)if(!L(r[i],e[i]))return!1;return!0}const t=Object.keys(r),s=Object.keys(e);if(t.length!==s.length)return!1;for(const i of t)if(!Object.prototype.hasOwnProperty.call(e,i)||!L(r[i],e[i]))return!1;return!0}function Q(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var O={exports:{}},ee=O.exports,V;function te(){return V||(V=1,(function(r){(function(e,t){r.exports?r.exports=t():e.log=t()})(ee,function(){var e=function(){},t="undefined",s=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"],l={},o=null;function d(u,f){var a=u[f];if(typeof a.bind=="function")return a.bind(u);try{return Function.prototype.bind.call(a,u)}catch{return function(){return Function.prototype.apply.apply(a,[u,arguments])}}}function _(){console.log&&(console.log.apply||Function.prototype.apply.apply(console.log,[console,arguments]))}function k(u){return u==="debug"&&(u="log"),typeof console===t?!1:u==="trace"&&s?_:console[u]!==void 0?d(console,u):console.log!==void 0?d(console,"log"):e}function w(){for(var u=this.getLevel(),f=0;f<i.length;f++){var a=i[f];this[a]=f<u?e:this.methodFactory(a,u,this.name)}if(this.log=this.debug,typeof console===t&&u<this.levels.SILENT)return"No console available for logging"}function G(u){return function(){typeof console!==t&&(w.call(this),this[u].apply(this,arguments))}}function p(u,f,a){return k(u)||G.apply(this,arguments)}function H(u,f){var a=this,N,U,E,B="loglevel";typeof u=="string"?B+=":"+u:typeof u=="symbol"&&(B=void 0);function ce(c){var y=(i[c]||"silent").toUpperCase();if(!(typeof window===t||!B)){try{window.localStorage[B]=y;return}catch{}try{window.document.cookie=encodeURIComponent(B)+"="+y+";"}catch{}}}function K(){var c;if(!(typeof window===t||!B)){try{c=window.localStorage[B]}catch{}if(typeof c===t)try{var y=window.document.cookie,R=encodeURIComponent(B),Y=y.indexOf(R+"=");Y!==-1&&(c=/^([^;]+)/.exec(y.slice(Y+R.length+1))[1])}catch{}return a.levels[c]===void 0&&(c=void 0),c}}function de(){if(!(typeof window===t||!B)){try{window.localStorage.removeItem(B)}catch{}try{window.document.cookie=encodeURIComponent(B)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function A(c){var y=c;if(typeof y=="string"&&a.levels[y.toUpperCase()]!==void 0&&(y=a.levels[y.toUpperCase()]),typeof y=="number"&&y>=0&&y<=a.levels.SILENT)return y;throw new TypeError("log.setLevel() called with invalid level: "+c)}a.name=u,a.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},a.methodFactory=f||p,a.getLevel=function(){return E??U??N},a.setLevel=function(c,y){return E=A(c),y!==!1&&ce(E),w.call(a)},a.setDefaultLevel=function(c){U=A(c),K()||a.setLevel(c,!1)},a.resetLevel=function(){E=null,de(),w.call(a)},a.enableAll=function(c){a.setLevel(a.levels.TRACE,c)},a.disableAll=function(c){a.setLevel(a.levels.SILENT,c)},a.rebuild=function(){if(o!==a&&(N=A(o.getLevel())),w.call(a),o===a)for(var c in l)l[c].rebuild()},N=A(o?o.getLevel():"WARN");var W=K();W!=null&&(E=A(W)),w.call(a)}o=new H,o.getLogger=function(f){if(typeof f!="symbol"&&typeof f!="string"||f==="")throw new TypeError("You must supply a name when creating a logger.");var a=l[f];return a||(a=l[f]=new H(f,o.methodFactory)),a};var ue=typeof window!==t?window.log:void 0;return o.noConflict=function(){return typeof window!==t&&window.log===o&&(window.log=ue),o},o.getLoggers=function(){return l},o.default=o,o})})(O)),O.exports}var re=te();const se=Q(re),ie=!0,I=se;I.setLevel("debug");const ne=r=>{try{I.setLevel(r)}catch(e){I.setLevel("error"),I.error(e)}};class x{constructor(e,t){this.events={attrChanged:new T,modelChanged:new T},this._changing=!1,this._previousAttributes={},this._pending=!1;const s=e||{};t&&D(s,t),this.attributes=s,this.changed={}}get(e){return this.attributes[e]}set(e,t,s){if(e==null)return this;let i;typeof e=="object"?(i=e,s=t):(i={},i[e]=t),s||(s={});const l=s.unset,o=s.silent,d=[],_=this._changing;this._changing=!0,_||(this._previousAttributes=C(this.attributes),this.changed={});const k=this.attributes,w=this.changed,G=this._previousAttributes;for(const p in i)t=i[p],L(k[p],t)||d.push(p),L(G[p],t)?delete w[p]:w[p]=t,l?delete k[p]:k[p]=t;if(!o){d.length&&(this._pending=s);for(let p=0;p<d.length;p++)this.events.attrChanged.dispatch({object:this,attrName:d[p],attrValue:k[d[p]],options:s})}if(_)return this;if(!o)for(;this._pending;)s=this._pending,this._pending=!1,this.events.modelChanged.dispatch({object:this,options:s});return this._pending=!1,this._changing=!1,this}has(e){return this.get(e)!=null}hasChanged(e){return e==null?!F(this.changed):q(this.changed,e)}changedAttributes(e){if(!e)return this.hasChanged()?C(this.changed):{};const t=this._changing?this._previousAttributes:this.attributes,s={};for(const i in e){const l=e[i];L(t[i],l)||(s[i]=l)}return s}previous(e){return e==null||!this._previousAttributes?null:this._previousAttributes[e]}previousAttributes(){return C(this._previousAttributes)}clone(){const e=C(this.attributes);return new x(e)}}class M{constructor(){this.entries=new Map}static getInstance(){return M.instance||(M.instance=new M),M.instance}collect(e){this.entries.set(e.name,e)}printAll(){for(const[e,t]of this.entries);}clear(){this.entries.clear()}getAll(){return Array.from(this.entries.values())}getEntry(e){return this.entries.get(e)}remove(e){return this.entries.delete(e)}}class oe{static formatBytes(e,t=2){if(e===0)return"0 B";const s=1024,i=Math.max(0,t),l=["B","KB","MB","GB","TB"],o=Math.floor(Math.log(e)/Math.log(s)),d=e/Math.pow(s,o);return`${parseFloat(d.toFixed(i))} ${l[o]}`}}var g=(r=>(r[r.ByLayer=0]="ByLayer",r[r.ByBlock=1]="ByBlock",r[r.ByAlpha=2]="ByAlpha",r[r.ErrorValue=3]="ErrorValue",r))(g||{});class m{constructor(e){e!==void 0?(this._method=g.ByAlpha,this._alpha=m.clampAlpha(e)):(this._method=g.ByLayer,this._alpha=255)}get method(){return this._method}set method(e){this._method=e}get alpha(){return this._alpha}set alpha(e){this._alpha=m.clampAlpha(e),this._method=g.ByAlpha}get percentage(){if(this._method===g.ByAlpha)return Math.round((1-this._alpha/255)*100)}set percentage(e){const t=Math.max(0,Math.min(100,e)),s=Math.round(255*(1-t/100));this.alpha=s}static clampAlpha(e){return Math.max(0,Math.min(255,Math.floor(e)))}get isByAlpha(){return this._method===g.ByAlpha}get isByBlock(){return this._method===g.ByBlock}get isByLayer(){return this._method===g.ByLayer}get isClear(){return this.isByAlpha&&this._alpha===0}get isSolid(){return this.isByAlpha&&this._alpha===255}get isInvalid(){return this._method===g.ErrorValue}serialize(){return this._method<<24|this._alpha}clone(){const e=new m;return e._method=this._method,e._alpha=this._alpha,e}equals(e){return this._method===e._method&&this._alpha===e._alpha}toString(){return this.isByLayer?"ByLayer":this.isByBlock?"ByBlock":this._alpha.toString()}static fromString(e){const t=e.trim(),s=t.toLowerCase();if(s===""||s==="."||s==="use current"||s==="bylayer"){const o=new m;return o._method=g.ByLayer,o}if(s==="byblock"){const o=new m;return o._method=g.ByBlock,o}const i=Number(t);if(Number.isInteger(i)&&i>=0&&i<=255){const o=new m;return i<=90?o.percentage=i:o.alpha=i,o}const l=new m;return l._method=g.ErrorValue,l}static deserialize(e){const t=e>>>24&255,s=e&255,i=t>=g.ByLayer&&t<=g.ErrorValue?t:g.ErrorValue,l=new m;return l._method=i,l._alpha=m.clampAlpha(s),l}}class le{constructor(e){this.name=e}run(e){throw new Error("run() must be implemented by subclass")}}class ae{constructor(){this.tasks=[],this.onProgress=()=>{},this.onComplete=()=>{},this.onError=()=>!1}scheduleTask(e){return new Promise((t,s)=>{const i=()=>{Promise.resolve(e()).then(t).catch(s)};typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(i):setTimeout(i,0)})}addTask(e){this.tasks.push(e)}setProgressCallback(e){this.onProgress=e}setCompleteCallback(e){this.onComplete=e}setErrorCallback(e){this.onError=e}async run(e){const t=this.tasks.length;let s=e;for(let i=0;i<t;i++){const l=this.tasks[i];try{s=await this.scheduleTask(async()=>{const o=await l.run(s);return this.onProgress((i+1)/t,l),o})}catch(o){if(this.onError({error:o,taskIndex:i,task:l}))return Promise.reject(o)}}this.onComplete(s)}}class j{constructor(e,t,s){this.isLoading=!1,this.itemsLoaded=0,this.itemsTotal=0,this.urlModifier=void 0,this.handlers=[],this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=s}itemStart(e){this.itemsTotal++,this.isLoading===!1&&this.onStart!==void 0&&this.onStart(e,this.itemsLoaded,this.itemsTotal),this.isLoading=!0}itemEnd(e){this.itemsLoaded++,this.onProgress!==void 0&&this.onProgress(e,this.itemsLoaded,this.itemsTotal),this.itemsLoaded===this.itemsTotal&&(this.isLoading=!1,this.onLoad!==void 0&&this.onLoad())}itemError(e){this.onError!==void 0&&this.onError(e)}resolveURL(e){return this.urlModifier?this.urlModifier(e):e}setURLModifier(e){return this.urlModifier=e,this}addHandler(e,t){return this.handlers.push(e,t),this}removeHandler(e){const t=this.handlers.indexOf(e);return t!==-1&&this.handlers.splice(t,2),this}getHandler(e){for(let t=0,s=this.handlers.length;t<s;t+=2){const i=this.handlers[t],l=this.handlers[t+1];if(i.global&&(i.lastIndex=0),i.test(e))return l}return null}}const z=new j;class he{constructor(e){this.manager=e!==void 0?e:z,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}loadAsync(e,t){return new Promise((s,i)=>{this.load(e,s,t,i)})}parse(e){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}h.AcCmColor=v,h.AcCmColorMethod=n,h.AcCmColorUtil=b,h.AcCmEntityColor=Z,h.AcCmErrors=J,h.AcCmEventDispatcher=X,h.AcCmEventManager=T,h.AcCmLoader=he,h.AcCmLoadingManager=j,h.AcCmObject=x,h.AcCmPerformanceCollector=M,h.AcCmTask=le,h.AcCmTaskScheduler=ae,h.AcCmTransparency=m,h.AcCmTransparencyMethod=g,h.AcTrStringUtil=oe,h.DEBUG_MODE=ie,h.DefaultLoadingManager=z,h.clone=C,h.deepClone=P,h.defaults=D,h.has=q,h.isEmpty=F,h.isEqual=L,h.log=I,h.setLogLevel=ne,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(h,n){typeof exports=="object"&&typeof module<"u"?n(exports):typeof define=="function"&&define.amd?define(["exports"],n):(h=typeof globalThis<"u"?globalThis:h||self,n(h.common={}))})(this,(function(h){"use strict";var n=(r=>(r[r.ByColor=1]="ByColor",r[r.ByACI=2]="ByACI",r[r.ByLayer=3]="ByLayer",r[r.ByBlock=4]="ByBlock",r[r.None=0]="None",r))(n||{});const $={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},S=[0,16711680,16776960,65280,65535,255,16711935,16777215,8421504,12632256,16711680,16744319,13369344,13395558,10027008,10046540,8323072,8339263,4980736,4990502,16727808,16752511,13382400,13401958,10036736,10051404,8331008,8343359,4985600,4992806,16744192,16760703,13395456,13408614,10046464,10056268,8339200,8347455,4990464,4995366,16760576,16768895,13408512,13415014,10056192,10061132,8347392,8351551,4995328,4997670,16776960,16777087,13421568,13421670,10000384,10000460,8355584,8355647,5000192,5000230,12582656,14679935,10079232,11717734,7510016,8755276,6258432,7307071,3755008,4344870,8388352,12582783,6736896,10079334,5019648,7510092,4161280,6258495,2509824,3755046,4194048,10485631,3394560,8375398,2529280,6264908,2064128,5209919,1264640,3099686,65280,8388479,52224,6736998,38912,5019724,32512,4161343,19456,2509862,65343,8388511,52275,6737023,38950,5019743,32543,4161359,19475,2509871,65407,8388543,52326,6737049,38988,5019762,32575,4161375,19494,2509881,65471,8388575,52377,6737074,39026,5019781,32607,4161391,19513,2509890,65535,8388607,52428,6737100,39064,5019800,32639,4161407,19532,2509900,49151,8380415,39372,6730444,29336,5014936,24447,4157311,14668,2507340,32767,8372223,26316,6724044,19608,5010072,16255,4153215,9804,2505036,16383,8364031,13260,6717388,9880,5005208,8063,4149119,4940,2502476,255,8355839,204,6710988,152,5000344,127,4145023,76,2500172,4129023,10452991,3342540,8349388,2490520,6245528,2031743,5193599,1245260,3089996,8323327,12550143,6684876,10053324,4980888,7490712,4128895,6242175,2490444,3745356,12517631,14647295,10027212,11691724,7471256,8735896,6226047,7290751,3735628,4335180,16711935,16744447,13369548,13395660,9961624,9981080,8323199,8339327,4980812,4990540,16711871,16744415,13369497,13395634,9961586,9981061,8323167,8339311,4980793,4990530,16711807,16744383,13369446,13395609,9961548,9981042,8323135,8339295,4980774,4990521,16711743,16744351,13369395,13395583,9961510,9981023,8323103,8339279,4980755,4990511,3355443,5987163,8684676,11382189,14079702,16777215,0];class b{static getColorByIndex(e){return S[e]}static getIndexByColor(e){const t=S.length-1;for(let s=1;s<t;++s)if(S[s]===e)return s}static getColorByName(e){return $[e.toLowerCase()]}static getNameByColor(e){for(const[t,s]of Object.entries($))if(s===e)return t}static getNameByIndex(e){const t=this.getColorByIndex(e);return this.getNameByColor(t)}}class m{constructor(e=n.ByLayer,t){this._colorMethod=e,this._colorMethod==n.ByColor&&t==null?this._value=16777215:this._colorMethod==n.ByACI?t==null?this._value=8:t===0?this._colorMethod=n.ByBlock:t===256?this._colorMethod=n.ByLayer:this._value=Math.max(0,Math.min(t,256)):this._value=t}get colorMethod(){return this._colorMethod}set colorMethod(e){this._colorMethod=e}get red(){const e=this.RGB;return e!=null?e>>16&255:void 0}get green(){const e=this.RGB;return e!=null?e>>8&255:void 0}get blue(){const e=this.RGB;return e!=null?e&255:void 0}get RGB(){switch(this._colorMethod){case n.ByColor:case n.ByBlock:case n.ByLayer:return this._value;case n.ByACI:return this._value?b.getColorByIndex(this._value):this._value;default:return}}setRGB(e,t,s){const i=Math.max(0,Math.min(255,Math.round(e))),l=Math.max(0,Math.min(255,Math.round(t))),o=Math.max(0,Math.min(255,Math.round(s)));return this._value=i<<16|l<<8|o,this._colorMethod=n.ByColor,this}setRGBValue(e){return e==null||!Number.isFinite(e)?this:(this._value=e&16777215,this._colorMethod=n.ByColor,this)}setRGBFromCss(e){if(!e)return this;const t=e.trim().toLowerCase();if(t.startsWith("#")){let l=0,o=0,d=0;if(t.length===7)l=parseInt(t.substr(1,2),16),o=parseInt(t.substr(3,2),16),d=parseInt(t.substr(5,2),16);else if(t.length===4)l=parseInt(t[1]+t[1],16),o=parseInt(t[2]+t[2],16),d=parseInt(t[3]+t[3],16);else return this;return this.setRGB(l,o,d)}const s=t.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);if(s){const l=parseInt(s[1],10),o=parseInt(s[2],10),d=parseInt(s[3],10);return this.setRGB(l,o,d)}const i=b.getColorByName(e);return i!==void 0?this.setRGBValue(i):this}setScalar(e){return this.setRGB(e,e,e)}get hexColor(){const e=this.RGB;return e==null?void 0:"0x"+e.toString(16).padStart(6,"0").toUpperCase()}get cssColor(){const e=this.RGB;if(e!=null)return`rgb(${e>>16&255},${e>>8&255},${e&255})`}cssColorAlpha(e){const t=this.RGB;if(t!=null)return`rgba(${t>>16&255},${t>>8&255},${t&255},${e})`}get colorIndex(){return this._colorMethod===n.ByACI?this._value:this._colorMethod===n.ByLayer?256:this._colorMethod===n.ByBlock?0:void 0}set colorIndex(e){if(e==null)return;const t=Math.max(0,Math.min(256,Math.round(e)));t===0?(this._colorMethod=n.ByBlock,this._value=void 0):t===256?(this._colorMethod=n.ByLayer,this._value=void 0):(this._colorMethod=n.ByACI,this._value=t)}get isByColor(){return this._colorMethod===n.ByColor}get isByACI(){return this._colorMethod===n.ByACI}get isForeground(){return this._colorMethod===n.ByACI&&this._value===7}setForeground(){return this._colorMethod=n.ByACI,this._value=7,this}get isByLayer(){return this._colorMethod===n.ByLayer}setByLayer(e){return this._colorMethod=n.ByLayer,e==null?this._value=256:this._value=e,this}get isByBlock(){return this._colorMethod===n.ByBlock}setByBlock(e){return this._colorMethod=n.ByBlock,e==null?this._value=0:this._value=e,this}get colorName(){switch(this._colorMethod){case n.ByLayer:return"ByLayer";case n.ByBlock:return"ByBlock";case n.ByColor:return this._value?b.getNameByColor(this._value):"";case n.ByACI:return this._value?b.getNameByIndex(this._value):"";default:return}}set colorName(e){if(!e)return;const t=b.getColorByName(e);t!==void 0&&(this._value=t,this._colorMethod=n.ByColor)}clone(){const e=new m;return e._colorMethod=this._colorMethod,e._value=this._value,e}copy(e){return this._colorMethod=e._colorMethod,this._value=e._value,this}equals(e){return this._colorMethod===e._colorMethod&&this._value===e._value}toString(){switch(this._colorMethod){case n.None:return"None";case n.ByLayer:return"ByLayer";case n.ByBlock:return"ByBlock";case n.ByACI:return this._value!==void 0?String(this._value):"";case n.ByColor:return this._value?`RGB:${this.red},${this.green},${this.blue}`:"";default:return""}}static fromString(e){if(!e)return;const t=e.trim();if(/^none$/i.test(t))return new m(n.None);if(/^bylayer$/i.test(t))return new m(n.ByLayer);if(/^byblock$/i.test(t))return new m(n.ByBlock);const s=t.match(/^rgb\s*:\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})$/i);if(s){const l=Number(s[1]),o=Number(s[2]),d=Number(s[3]),B=new m(n.ByColor);return B.setRGB(l,o,d),B}if(/^\d{1,3},\d{1,3},\d{1,3}$/.test(t)){const[l,o,d]=t.split(",").map(Number),B=new m(n.ByColor);return B.setRGB(l,o,d),B}if(/^\d+$/.test(t)){const l=parseInt(t,10);return new m(n.ByACI,l)}if(/^book\$/i.test(t)){const l=t.substring(t.indexOf("$")+1),o=b.getColorByName(l);return o!=null?new m(n.ByColor,o):void 0}const i=b.getColorByName(t);if(i!=null)return new m(n.ByColor,i)}}class Q{constructor(e=n.ByColor,t=0){this._colorMethod=e,this._value=t}get colorMethd(){return this._colorMethod}get red(){return this._value>>16&255}set red(e){this._colorMethod=n.ByColor,this._value=this._value&65535|(e&255)<<16}get green(){return this._value>>8&255}set green(e){this._colorMethod=n.ByColor,this._value=this._value&16711935|(e&255)<<8}get blue(){return this._value&255}set blue(e){this._colorMethod=n.ByColor,this._value=this._value&16776960|e&255}setRGB(e,t,s){this._colorMethod=n.ByColor,this._value=(e&255)<<16|(t&255)<<8|s&255}get colorIndex(){return this._value}set colorIndex(e){this._colorMethod=n.ByACI,this._value=e}get layerIndex(){return this._value}set layerIndex(e){this._colorMethod=n.ByLayer,this._value=e}isByColor(){return this._colorMethod===n.ByColor}isByLayer(){return this._colorMethod===n.ByLayer}isByBlock(){return this._colorMethod===n.ByBlock}isByACI(){return this._colorMethod===n.ByACI}isNone(){return this._colorMethod===n.None}get rawValue(){return this._value}set rawValue(e){this._value=e}}const ee={get ILLEGAL_PARAMETERS(){return new ReferenceError("Illegal Parameters")},get ZERO_DIVISION(){return new Error("Zero division")},get UNRESOLVED_BOUNDARY_CONFLICT(){return new Error("Unresolved boundary conflict in boolean operation")},get INFINITE_LOOP(){return new Error("Infinite loop")},get CANNOT_INVOKE_ABSTRACT_METHOD(){return new Error("Abstract method cannot be invoked")},get OPERATION_IS_NOT_SUPPORTED(){return new Error("Operation is not supported")},get NOT_IMPLEMENTED(){return new Error("Not implemented yet")}};class te{constructor(){this._listeners={}}addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const s=this._listeners;s[e]===void 0&&(s[e]=[]),s[e].indexOf(t)===-1&&s[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const s=this._listeners;return s[e]!==void 0&&s[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const l=i.indexOf(t);l!==-1&&i.splice(l,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const s=this._listeners[e.type];if(s!==void 0){e.target=this;const i=s.slice(0);for(let l=0,o=i.length;l<o;l++)i[l].call(this,e)}}}class P{constructor(){this.listeners=[]}addEventListener(e){this.listeners.push(e)}removeEventListener(e){this.listeners=this.listeners.filter(t=>t!==e)}replaceEventListener(e){this.removeEventListener(e),this.addEventListener(e)}dispatch(e,...t){for(const s of this.listeners)s.call(null,e,...t)}}function I(r){return r===null||typeof r!="object"?r:Array.isArray(r)?[...r]:{...r}}function D(r){if(r===null||typeof r!="object")return r;if(r instanceof Date)return new Date(r.getTime());if(r instanceof RegExp)return new RegExp(r.source,r.flags);if(Array.isArray(r))return r.map(D);const e={};for(const t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=D(r[t]));return e}function x(r,...e){for(const t of e)if(t)for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&r[s]===void 0&&(r[s]=t[s]);return r}function V(r,e){return r!=null&&Object.prototype.hasOwnProperty.call(r,e)}function j(r){return r==null?!0:Array.isArray(r)||typeof r=="string"?r.length===0:r instanceof Map||r instanceof Set?r.size===0:typeof r=="object"?Object.keys(r).length===0:!1}function L(r,e){if(r===e)return!0;if(r==null||e==null)return r===e;if(typeof r!=typeof e)return!1;if(typeof r!="object")return r===e;if(Array.isArray(r)!==Array.isArray(e))return!1;if(Array.isArray(r)){if(r.length!==e.length)return!1;for(let i=0;i<r.length;i++)if(!L(r[i],e[i]))return!1;return!0}const t=Object.keys(r),s=Object.keys(e);if(t.length!==s.length)return!1;for(const i of t)if(!Object.prototype.hasOwnProperty.call(e,i)||!L(r[i],e[i]))return!1;return!0}function re(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var N={exports:{}},se=N.exports,Y;function ne(){return Y||(Y=1,(function(r){(function(e,t){r.exports?r.exports=t():e.log=t()})(se,function(){var e=function(){},t="undefined",s=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"],l={},o=null;function d(u,f){var a=u[f];if(typeof a.bind=="function")return a.bind(u);try{return Function.prototype.bind.call(a,u)}catch{return function(){return Function.prototype.apply.apply(a,[u,arguments])}}}function B(){console.log&&(console.log.apply||Function.prototype.apply.apply(console.log,[console,arguments]))}function k(u){return u==="debug"&&(u="log"),typeof console===t?!1:u==="trace"&&s?B:console[u]!==void 0?d(console,u):console.log!==void 0?d(console,"log"):e}function w(){for(var u=this.getLevel(),f=0;f<i.length;f++){var a=i[f];this[a]=f<u?e:this.methodFactory(a,u,this.name)}if(this.log=this.debug,typeof console===t&&u<this.levels.SILENT)return"No console available for logging"}function G(u){return function(){typeof console!==t&&(w.call(this),this[u].apply(this,arguments))}}function p(u,f,a){return k(u)||G.apply(this,arguments)}function W(u,f){var a=this,R,q,C,_="loglevel";typeof u=="string"?_+=":"+u:typeof u=="symbol"&&(_=void 0);function ye(c){var y=(i[c]||"silent").toUpperCase();if(!(typeof window===t||!_)){try{window.localStorage[_]=y;return}catch{}try{window.document.cookie=encodeURIComponent(_)+"="+y+";"}catch{}}}function Z(){var c;if(!(typeof window===t||!_)){try{c=window.localStorage[_]}catch{}if(typeof c===t)try{var y=window.document.cookie,T=encodeURIComponent(_),X=y.indexOf(T+"=");X!==-1&&(c=/^([^;]+)/.exec(y.slice(X+T.length+1))[1])}catch{}return a.levels[c]===void 0&&(c=void 0),c}}function pe(){if(!(typeof window===t||!_)){try{window.localStorage.removeItem(_)}catch{}try{window.document.cookie=encodeURIComponent(_)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function O(c){var y=c;if(typeof y=="string"&&a.levels[y.toUpperCase()]!==void 0&&(y=a.levels[y.toUpperCase()]),typeof y=="number"&&y>=0&&y<=a.levels.SILENT)return y;throw new TypeError("log.setLevel() called with invalid level: "+c)}a.name=u,a.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},a.methodFactory=f||p,a.getLevel=function(){return C??q??R},a.setLevel=function(c,y){return C=O(c),y!==!1&&ye(C),w.call(a)},a.setDefaultLevel=function(c){q=O(c),Z()||a.setLevel(c,!1)},a.resetLevel=function(){C=null,pe(),w.call(a)},a.enableAll=function(c){a.setLevel(a.levels.TRACE,c)},a.disableAll=function(c){a.setLevel(a.levels.SILENT,c)},a.rebuild=function(){if(o!==a&&(R=O(o.getLevel())),w.call(a),o===a)for(var c in l)l[c].rebuild()},R=O(o?o.getLevel():"WARN");var J=Z();J!=null&&(C=O(J)),w.call(a)}o=new W,o.getLogger=function(f){if(typeof f!="symbol"&&typeof f!="string"||f==="")throw new TypeError("You must supply a name when creating a logger.");var a=l[f];return a||(a=l[f]=new W(f,o.methodFactory)),a};var fe=typeof window!==t?window.log:void 0;return o.noConflict=function(){return typeof window!==t&&window.log===o&&(window.log=fe),o},o.getLoggers=function(){return l},o.default=o,o})})(N)),N.exports}var ie=ne();const oe=re(ie),le=!0,A=oe;A.setLevel("debug");const ae=r=>{try{A.setLevel(r)}catch(e){A.setLevel("error"),A.error(e)}};class U{constructor(e,t){this.events={attrChanged:new P,modelChanged:new P},this._changing=!1,this._previousAttributes={},this._pending=!1;const s=e||{};t&&x(s,t),this.attributes=s,this.changed={}}get(e){return this.attributes[e]}set(e,t,s){if(e==null)return this;let i;typeof e=="object"?(i=e,s=t):(i={},i[e]=t),s||(s={});const l=s.unset,o=s.silent,d=[],B=this._changing;this._changing=!0,B||(this._previousAttributes=I(this.attributes),this.changed={});const k=this.attributes,w=this.changed,G=this._previousAttributes;for(const p in i)t=i[p],L(k[p],t)||d.push(p),L(G[p],t)?delete w[p]:w[p]=t,l?delete k[p]:k[p]=t;if(!o){d.length&&(this._pending=s);for(let p=0;p<d.length;p++)this.events.attrChanged.dispatch({object:this,attrName:d[p],attrValue:k[d[p]],options:s})}if(B)return this;if(!o)for(;this._pending;)s=this._pending,this._pending=!1,this.events.modelChanged.dispatch({object:this,options:s});return this._pending=!1,this._changing=!1,this}has(e){return this.get(e)!=null}hasChanged(e){return e==null?!j(this.changed):V(this.changed,e)}changedAttributes(e){if(!e)return this.hasChanged()?I(this.changed):{};const t=this._changing?this._previousAttributes:this.attributes,s={};for(const i in e){const l=e[i];L(t[i],l)||(s[i]=l)}return s}previous(e){return e==null||!this._previousAttributes?null:this._previousAttributes[e]}previousAttributes(){return I(this._previousAttributes)}clone(){const e=I(this.attributes);return new U(e)}}class M{constructor(){this.entries=new Map}static getInstance(){return M.instance||(M.instance=new M),M.instance}collect(e){this.entries.set(e.name,e)}printAll(){for(const[e,t]of this.entries);}clear(){this.entries.clear()}getAll(){return Array.from(this.entries.values())}getEntry(e){return this.entries.get(e)}remove(e){return this.entries.delete(e)}}class he{static formatBytes(e,t=2){if(e===0)return"0 B";const s=1024,i=Math.max(0,t),l=["B","KB","MB","GB","TB"],o=Math.floor(Math.log(e)/Math.log(s)),d=e/Math.pow(s,o);return`${parseFloat(d.toFixed(i))} ${l[o]}`}}var g=(r=>(r[r.ByLayer=0]="ByLayer",r[r.ByBlock=1]="ByBlock",r[r.ByAlpha=2]="ByAlpha",r[r.ErrorValue=3]="ErrorValue",r))(g||{});class v{constructor(e){e!==void 0?(this._method=g.ByAlpha,this._alpha=v.clampAlpha(e)):(this._method=g.ByLayer,this._alpha=255)}get method(){return this._method}set method(e){this._method=e}get alpha(){return this._alpha}set alpha(e){this._alpha=v.clampAlpha(e),this._method=g.ByAlpha}get percentage(){if(this._method===g.ByAlpha)return Math.round((1-this._alpha/255)*100)}set percentage(e){const t=Math.max(0,Math.min(100,e)),s=Math.round(255*(1-t/100));this.alpha=s}static clampAlpha(e){return Math.max(0,Math.min(255,Math.floor(e)))}get isByAlpha(){return this._method===g.ByAlpha}get isByBlock(){return this._method===g.ByBlock}get isByLayer(){return this._method===g.ByLayer}get isClear(){return this.isByAlpha&&this._alpha===0}get isSolid(){return this.isByAlpha&&this._alpha===255}get isInvalid(){return this._method===g.ErrorValue}serialize(){return this._method<<24|this._alpha}clone(){const e=new v;return e._method=this._method,e._alpha=this._alpha,e}equals(e){return this._method===e._method&&this._alpha===e._alpha}toString(){return this.isByLayer?"ByLayer":this.isByBlock?"ByBlock":this._alpha.toString()}static fromString(e){const t=e.trim(),s=t.toLowerCase();if(s===""||s==="."||s==="use current"||s==="bylayer"){const o=new v;return o._method=g.ByLayer,o}if(s==="byblock"){const o=new v;return o._method=g.ByBlock,o}const i=Number(t);if(Number.isInteger(i)&&i>=0&&i<=255){const o=new v;return i<=90?o.percentage=i:o.alpha=i,o}const l=new v;return l._method=g.ErrorValue,l}static deserialize(e){const t=e>>>24&255,s=e&255,i=t>=g.ByLayer&&t<=g.ErrorValue?t:g.ErrorValue,l=new v;return l._method=i,l._alpha=v.clampAlpha(s),l}}const z=50;function F(){return new Promise(r=>{typeof globalThis<"u"&&typeof globalThis.requestAnimationFrame=="function"?globalThis.requestAnimationFrame(()=>r()):setTimeout(r,0)})}function ue(){return new Promise(r=>{if(typeof globalThis<"u"&&typeof globalThis.requestAnimationFrame=="function"){const e=globalThis.requestAnimationFrame;e(()=>e(()=>r()))}else setTimeout(r,0)})}class E{constructor(e=z){this._budgetMs=e,this._lastYieldCompletedAt=E.now()}get budgetMs(){return this._budgetMs}async maybeYield(e=F){return E.now()-this._lastYieldCompletedAt<this._budgetMs?!1:(await e(),this._lastYieldCompletedAt=E.now(),!0)}mark(){this._lastYieldCompletedAt=E.now()}static now(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}}class ce{constructor(e){this.name=e}run(e){throw new Error("run() must be implemented by subclass")}}class de{constructor(){this.tasks=[],this.onProgress=()=>{},this.onComplete=()=>{},this.onError=()=>!1}async scheduleTask(e){return await F(),e()}addTask(e){this.tasks.push(e)}setProgressCallback(e){this.onProgress=e}setCompleteCallback(e){this.onComplete=e}setErrorCallback(e){this.onError=e}async run(e){const t=this.tasks.length;let s=e;for(let i=0;i<t;i++){const l=this.tasks[i];try{s=await this.scheduleTask(async()=>{const o=await l.run(s);return this.onProgress((i+1)/t,l),o})}catch(o){if(this.onError({error:o,taskIndex:i,task:l}))return Promise.reject(o)}}this.onComplete(s)}}class H{constructor(e,t,s){this.isLoading=!1,this.itemsLoaded=0,this.itemsTotal=0,this.urlModifier=void 0,this.handlers=[],this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=s}itemStart(e){this.itemsTotal++,this.isLoading===!1&&this.onStart!==void 0&&this.onStart(e,this.itemsLoaded,this.itemsTotal),this.isLoading=!0}itemEnd(e){this.itemsLoaded++,this.onProgress!==void 0&&this.onProgress(e,this.itemsLoaded,this.itemsTotal),this.itemsLoaded===this.itemsTotal&&(this.isLoading=!1,this.onLoad!==void 0&&this.onLoad())}itemError(e){this.onError!==void 0&&this.onError(e)}resolveURL(e){return this.urlModifier?this.urlModifier(e):e}setURLModifier(e){return this.urlModifier=e,this}addHandler(e,t){return this.handlers.push(e,t),this}removeHandler(e){const t=this.handlers.indexOf(e);return t!==-1&&this.handlers.splice(t,2),this}getHandler(e){for(let t=0,s=this.handlers.length;t<s;t+=2){const i=this.handlers[t],l=this.handlers[t+1];if(i.global&&(i.lastIndex=0),i.test(e))return l}return null}}const K=new H;class ge{constructor(e){this.manager=e!==void 0?e:K,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}loadAsync(e,t){return new Promise((s,i)=>{this.load(e,s,t,i)})}parse(e){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}h.ACCM_DEFAULT_UI_YIELD_BUDGET_MS=z,h.AcCmColor=m,h.AcCmColorMethod=n,h.AcCmColorUtil=b,h.AcCmEntityColor=Q,h.AcCmErrors=ee,h.AcCmEventDispatcher=te,h.AcCmEventManager=P,h.AcCmLoader=ge,h.AcCmLoadingManager=H,h.AcCmObject=U,h.AcCmPerformanceCollector=M,h.AcCmTask=ce,h.AcCmTaskScheduler=de,h.AcCmTransparency=v,h.AcCmTransparencyMethod=g,h.AcCmUiYieldGate=E,h.AcTrStringUtil=he,h.DEBUG_MODE=le,h.DefaultLoadingManager=K,h.accmYieldForPaint=ue,h.accmYieldToUi=F,h.clone=I,h.deepClone=D,h.defaults=x,h.has=V,h.isEmpty=j,h.isEqual=L,h.log=A,h.setLogLevel=ae,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})}));
@@ -154,8 +154,8 @@ export declare class AcCmTaskScheduler<TInitial, TFinal = TInitial> {
154
154
  /**
155
155
  * Schedules a task to be executed asynchronously.
156
156
  *
157
- * This method uses requestAnimationFrame in browser environments or setTimeout
158
- * in Node.js environments to schedule the task.
157
+ * Yields via {@link accmYieldToUi} so the browser can paint between tasks,
158
+ * then runs `callback` on the resumed turn.
159
159
  *
160
160
  * @param callback - The callback function to schedule
161
161
  * @returns Promise that resolves with the result of the callback
@@ -1 +1 @@
1
- {"version":3,"file":"AcCmTaskScheduler.d.ts","sourceRoot":"","sources":["../src/AcCmTaskScheduler.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,KAAK,EAAE,OAAO,CAAA;IAEd;;;;;OAKG;IACH,SAAS,EAAE,MAAM,CAAA;IAEjB;;;;;OAKG;IACH,IAAI,EAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;CACjC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,QAAQ,CAAC,GAAG,EAAE,IAAI;IAC7B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IAErB;;;;OAIG;gBACS,IAAI,EAAE,MAAM;IAIxB;;;;;;;;;OASG;IACH,GAAG,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAGvC;AAED;;;;;GAKG;AACH,KAAK,oBAAoB,GAAG,CAC1B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,KAC7B,IAAI,CAAA;AAET;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK,IAAI,CAAA;AAE9D;;;;;;;;GAQG;AACH,KAAK,iBAAiB,GAAG,CAAC,KAAK,EAAE,aAAa,KAAK,OAAO,CAAA;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,qBAAa,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ;IACxD,OAAO,CAAC,KAAK,CAAmC;IAChD,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AQ,EAAE,MAAM,EAChB,IAAI,EAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,KAC7B,IAAI,CAAA;AAET;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK,IAAI,CAAA;AAE9D;;;;;;;;GAQG;AACH,KAAK,iBAAiB,GAAG,CAAC,KAAK,EAAE,aAAa,KAAK,OAAO,CAAA;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,qBAAa,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ;IACxD,OAAO,CAAC,KAAK,CAAmC;IAChD,OAAO,CAAC,UAAU,CAAiC;IACnD,OAAO,CAAC,UAAU,CAAyC;IAC3D,OAAO,CAAC,OAAO,CAAiC;IAEhD;;;;;;;;OAQG;YACW,YAAY;IAK1B;;;;OAIG;IACH,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI;IAInD;;OAEG;IACH,mBAAmB,CAAC,QAAQ,EAAE,oBAAoB,GAAG,IAAI;IAIzD;;OAEG;IACH,mBAAmB,CAAC,QAAQ,EAAE,oBAAoB,CAAC,MAAM,CAAC,GAAG,IAAI;IAIjE;;OAEG;IACH,gBAAgB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI;IAInD;;OAEG;IACG,GAAG,CAAC,WAAW,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CAwBhD"}
@@ -1,12 +1,3 @@
1
- /**
2
- * @fileoverview Task scheduling and execution system for the AutoCAD Common library.
3
- *
4
- * This module provides a type-safe task scheduler that can execute a chain of named tasks
5
- * in sequence, with progress reporting, error handling, and data flow between tasks.
6
- *
7
- * @module AcCmTaskScheduler
8
- * @version 1.0.0
9
- */
10
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
11
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
12
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -43,6 +34,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
43
34
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
44
35
  }
45
36
  };
37
+ import { accmYieldToUi } from './AcCmYieldToUi';
46
38
  /**
47
39
  * Represents a named unit of work with an asynchronous or synchronous execution function.
48
40
  *
@@ -133,27 +125,22 @@ var AcCmTaskScheduler = /** @class */ (function () {
133
125
  /**
134
126
  * Schedules a task to be executed asynchronously.
135
127
  *
136
- * This method uses requestAnimationFrame in browser environments or setTimeout
137
- * in Node.js environments to schedule the task.
128
+ * Yields via {@link accmYieldToUi} so the browser can paint between tasks,
129
+ * then runs `callback` on the resumed turn.
138
130
  *
139
131
  * @param callback - The callback function to schedule
140
132
  * @returns Promise that resolves with the result of the callback
141
133
  */
142
134
  AcCmTaskScheduler.prototype.scheduleTask = function (callback) {
143
- return new Promise(function (resolve, reject) {
144
- var executeCallback = function () {
145
- // Execute the callback and handle the result
146
- Promise.resolve(callback()).then(resolve).catch(reject);
147
- };
148
- if (typeof window !== 'undefined' &&
149
- typeof window.requestAnimationFrame === 'function') {
150
- // Browser environment with requestAnimationFrame
151
- window.requestAnimationFrame(executeCallback);
152
- }
153
- else {
154
- // Node.js or fallback to setTimeout
155
- setTimeout(executeCallback, 0);
156
- }
135
+ return __awaiter(this, void 0, void 0, function () {
136
+ return __generator(this, function (_a) {
137
+ switch (_a.label) {
138
+ case 0: return [4 /*yield*/, accmYieldToUi()];
139
+ case 1:
140
+ _a.sent();
141
+ return [2 /*return*/, callback()];
142
+ }
143
+ });
157
144
  });
158
145
  };
159
146
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"AcCmTaskScheduler.js","sourceRoot":"","sources":["../src/AcCmTaskScheduler.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;;;;;;;;;;;;;;;;;;;;;;;;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AAgB,GAAhB,UAAiB,QAA2B;QAC1C,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAA;IACzB,CAAC;IAED;;OAEG;IACG,+BAAG,GAAT,UAAU,WAAqB;;;;;;;wBACvB,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAA;wBAC3B,MAAM,GAAY,WAAW,CAAA;4CAExB,CAAC;;;;;wCACF,IAAI,GAAG,OAAK,KAAK,CAAC,CAAC,CAAC,CAAA;;;;wCAGf,qBAAM,OAAK,YAAY,CAAC;;;;gEAChB,qBAAM,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAA;;4DAA/B,MAAM,GAAG,SAAsB;4DACrC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,EAAE,IAAI,CAAC,CAAA;4DACtC,sBAAO,MAAM,EAAA;;;iDACd,CAAC,EAAA;;wCAJF,MAAM,GAAG,SAIP,CAAA;;;;wCAEI,eAAe,GAAG,OAAK,OAAO,CAAC,EAAE,KAAK,SAAA,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,MAAA,EAAE,CAAC,CAAA;wCACnE,IAAI,eAAe,EAAE,CAAC;2EAEb,OAAO,CAAC,MAAM,CAAC,OAAK,CAAC;wCAC9B,CAAC;;;;;;;wBAdI,CAAC,GAAG,CAAC;;;6BAAE,CAAA,CAAC,GAAG,KAAK,CAAA;sDAAhB,CAAC;;;;;;;wBAAiB,CAAC,EAAE,CAAA;;;wBAkB9B,IAAI,CAAC,UAAU,CAAC,MAAgB,CAAC,CAAA;;;;;KAClC;IACH,wBAAC;AAAD,CAAC,AA7ED,IA6EC"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Default work-slice budget (ms) before a cooperative UI yield during
3
+ * main-thread work. Large enough to keep throughput high; small enough that
4
+ * spinners and progress UI still update.
5
+ */
6
+ export declare const ACCM_DEFAULT_UI_YIELD_BUDGET_MS = 50;
7
+ /**
8
+ * Yields once to the event loop / next animation frame so the browser can
9
+ * paint and handle input. Prefer this inside hot loops (time-gated via
10
+ * {@link AcCmUiYieldGate}).
11
+ *
12
+ * Uses a single `requestAnimationFrame` when available (not a double-rAF),
13
+ * falling back to `setTimeout(0)`.
14
+ *
15
+ * @returns Promise that resolves after one frame (or next timer tick).
16
+ */
17
+ export declare function accmYieldToUi(): Promise<void>;
18
+ /**
19
+ * Waits until after at least one paint (double rAF). Use sparingly — e.g. once
20
+ * before a long sync stretch so a loading overlay can appear. Do not call this
21
+ * per chunk on large files.
22
+ *
23
+ * @returns Promise that resolves after two animation frames (or one timer tick).
24
+ */
25
+ export declare function accmYieldForPaint(): Promise<void>;
26
+ /**
27
+ * Time-budgeted cooperative yields: only awaits {@link accmYieldToUi} when at
28
+ * least `budgetMs` of wall time has elapsed since the previous yield completed.
29
+ *
30
+ * Typical usage: construct one gate per long job, then `await gate.maybeYield()`
31
+ * inside each loop iteration.
32
+ */
33
+ export declare class AcCmUiYieldGate {
34
+ private readonly _budgetMs;
35
+ /**
36
+ * High-resolution timestamp (ms) of when the last yield finished, or when the
37
+ * gate was constructed / {@link mark}ed.
38
+ */
39
+ private _lastYieldCompletedAt;
40
+ /**
41
+ * Creates a yield gate.
42
+ *
43
+ * @param _budgetMs - Minimum wall time between yields, in milliseconds.
44
+ * Defaults to {@link ACCM_DEFAULT_UI_YIELD_BUDGET_MS}.
45
+ */
46
+ constructor(_budgetMs?: number);
47
+ /**
48
+ * Minimum wall time between yields, in milliseconds.
49
+ */
50
+ get budgetMs(): number;
51
+ /**
52
+ * Yields when at least {@link budgetMs} has elapsed since the last completed
53
+ * yield (or since construction / {@link mark}).
54
+ *
55
+ * @param yieldFn - Async yield implementation. Defaults to {@link accmYieldToUi}.
56
+ * @returns Whether a yield actually ran.
57
+ */
58
+ maybeYield(yieldFn?: () => Promise<void>): Promise<boolean>;
59
+ /**
60
+ * Marks the timeline without yielding (e.g. after an explicit paint wait).
61
+ * Resets the budget clock so the next {@link maybeYield} waits a full
62
+ * {@link budgetMs} from this point.
63
+ */
64
+ mark(): void;
65
+ /**
66
+ * Current high-resolution time in milliseconds (`performance.now` when
67
+ * available, otherwise `Date.now`).
68
+ *
69
+ * @returns Monotonic-ish timestamp in ms suitable for budget comparisons.
70
+ */
71
+ private static now;
72
+ }
73
+ //# sourceMappingURL=AcCmYieldToUi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcCmYieldToUi.d.ts","sourceRoot":"","sources":["../src/AcCmYieldToUi.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,+BAA+B,KAAK,CAAA;AAEjD;;;;;;;;;GASG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAgB7C;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAiBjD;AAED;;;;;;GAMG;AACH,qBAAa,eAAe;IAcxB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAb5B;;;OAGG;IACH,OAAO,CAAC,qBAAqB,CAAQ;IAErC;;;;;OAKG;gBAEgB,SAAS,GAAE,MAAwC;IAKtE;;OAEG;IACH,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED;;;;;;OAMG;IACG,UAAU,CACd,OAAO,GAAE,MAAM,OAAO,CAAC,IAAI,CAAiB,GAC3C,OAAO,CAAC,OAAO,CAAC;IAUnB;;;;OAIG;IACH,IAAI,IAAI,IAAI;IAIZ;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,GAAG;CASnB"}
@@ -0,0 +1,166 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
37
+ /**
38
+ * Default work-slice budget (ms) before a cooperative UI yield during
39
+ * main-thread work. Large enough to keep throughput high; small enough that
40
+ * spinners and progress UI still update.
41
+ */
42
+ export var ACCM_DEFAULT_UI_YIELD_BUDGET_MS = 50;
43
+ /**
44
+ * Yields once to the event loop / next animation frame so the browser can
45
+ * paint and handle input. Prefer this inside hot loops (time-gated via
46
+ * {@link AcCmUiYieldGate}).
47
+ *
48
+ * Uses a single `requestAnimationFrame` when available (not a double-rAF),
49
+ * falling back to `setTimeout(0)`.
50
+ *
51
+ * @returns Promise that resolves after one frame (or next timer tick).
52
+ */
53
+ export function accmYieldToUi() {
54
+ return new Promise(function (resolve) {
55
+ if (typeof globalThis !== 'undefined' &&
56
+ typeof globalThis
57
+ .requestAnimationFrame === 'function') {
58
+ ;
59
+ globalThis.requestAnimationFrame(function () { return resolve(); });
60
+ }
61
+ else {
62
+ setTimeout(resolve, 0);
63
+ }
64
+ });
65
+ }
66
+ /**
67
+ * Waits until after at least one paint (double rAF). Use sparingly — e.g. once
68
+ * before a long sync stretch so a loading overlay can appear. Do not call this
69
+ * per chunk on large files.
70
+ *
71
+ * @returns Promise that resolves after two animation frames (or one timer tick).
72
+ */
73
+ export function accmYieldForPaint() {
74
+ return new Promise(function (resolve) {
75
+ if (typeof globalThis !== 'undefined' &&
76
+ typeof globalThis
77
+ .requestAnimationFrame === 'function') {
78
+ var raf_1 = globalThis.requestAnimationFrame;
79
+ raf_1(function () { return raf_1(function () { return resolve(); }); });
80
+ }
81
+ else {
82
+ setTimeout(resolve, 0);
83
+ }
84
+ });
85
+ }
86
+ /**
87
+ * Time-budgeted cooperative yields: only awaits {@link accmYieldToUi} when at
88
+ * least `budgetMs` of wall time has elapsed since the previous yield completed.
89
+ *
90
+ * Typical usage: construct one gate per long job, then `await gate.maybeYield()`
91
+ * inside each loop iteration.
92
+ */
93
+ var AcCmUiYieldGate = /** @class */ (function () {
94
+ /**
95
+ * Creates a yield gate.
96
+ *
97
+ * @param _budgetMs - Minimum wall time between yields, in milliseconds.
98
+ * Defaults to {@link ACCM_DEFAULT_UI_YIELD_BUDGET_MS}.
99
+ */
100
+ function AcCmUiYieldGate(_budgetMs) {
101
+ if (_budgetMs === void 0) { _budgetMs = ACCM_DEFAULT_UI_YIELD_BUDGET_MS; }
102
+ this._budgetMs = _budgetMs;
103
+ this._lastYieldCompletedAt = AcCmUiYieldGate.now();
104
+ }
105
+ Object.defineProperty(AcCmUiYieldGate.prototype, "budgetMs", {
106
+ /**
107
+ * Minimum wall time between yields, in milliseconds.
108
+ */
109
+ get: function () {
110
+ return this._budgetMs;
111
+ },
112
+ enumerable: false,
113
+ configurable: true
114
+ });
115
+ /**
116
+ * Yields when at least {@link budgetMs} has elapsed since the last completed
117
+ * yield (or since construction / {@link mark}).
118
+ *
119
+ * @param yieldFn - Async yield implementation. Defaults to {@link accmYieldToUi}.
120
+ * @returns Whether a yield actually ran.
121
+ */
122
+ AcCmUiYieldGate.prototype.maybeYield = function () {
123
+ return __awaiter(this, arguments, void 0, function (yieldFn) {
124
+ var now;
125
+ if (yieldFn === void 0) { yieldFn = accmYieldToUi; }
126
+ return __generator(this, function (_a) {
127
+ switch (_a.label) {
128
+ case 0:
129
+ now = AcCmUiYieldGate.now();
130
+ if (now - this._lastYieldCompletedAt < this._budgetMs) {
131
+ return [2 /*return*/, false];
132
+ }
133
+ return [4 /*yield*/, yieldFn()];
134
+ case 1:
135
+ _a.sent();
136
+ this._lastYieldCompletedAt = AcCmUiYieldGate.now();
137
+ return [2 /*return*/, true];
138
+ }
139
+ });
140
+ });
141
+ };
142
+ /**
143
+ * Marks the timeline without yielding (e.g. after an explicit paint wait).
144
+ * Resets the budget clock so the next {@link maybeYield} waits a full
145
+ * {@link budgetMs} from this point.
146
+ */
147
+ AcCmUiYieldGate.prototype.mark = function () {
148
+ this._lastYieldCompletedAt = AcCmUiYieldGate.now();
149
+ };
150
+ /**
151
+ * Current high-resolution time in milliseconds (`performance.now` when
152
+ * available, otherwise `Date.now`).
153
+ *
154
+ * @returns Monotonic-ish timestamp in ms suitable for budget comparisons.
155
+ */
156
+ AcCmUiYieldGate.now = function () {
157
+ if (typeof performance !== 'undefined' &&
158
+ typeof performance.now === 'function') {
159
+ return performance.now();
160
+ }
161
+ return Date.now();
162
+ };
163
+ return AcCmUiYieldGate;
164
+ }());
165
+ export { AcCmUiYieldGate };
166
+ //# sourceMappingURL=AcCmYieldToUi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcCmYieldToUi.js","sourceRoot":"","sources":["../src/AcCmYieldToUi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;GAIG;AACH,MAAM,CAAC,IAAM,+BAA+B,GAAG,EAAE,CAAA;AAEjD;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,IAAI,OAAO,CAAC,UAAA,OAAO;QACxB,IACE,OAAO,UAAU,KAAK,WAAW;YACjC,OAAQ,UAAkD;iBACvD,qBAAqB,KAAK,UAAU,EACvC,CAAC;YACD,CAAC;YACC,UAGD,CAAC,qBAAqB,CAAC,cAAM,OAAA,OAAO,EAAE,EAAT,CAAS,CAAC,CAAA;QAC1C,CAAC;aAAM,CAAC;YACN,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAA;QACxB,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,IAAI,OAAO,CAAC,UAAA,OAAO;QACxB,IACE,OAAO,UAAU,KAAK,WAAW;YACjC,OAAQ,UAAkD;iBACvD,qBAAqB,KAAK,UAAU,EACvC,CAAC;YACD,IAAM,KAAG,GACP,UAGD,CAAC,qBAAqB,CAAA;YACvB,KAAG,CAAC,cAAM,OAAA,KAAG,CAAC,cAAM,OAAA,OAAO,EAAE,EAAT,CAAS,CAAC,EAApB,CAAoB,CAAC,CAAA;QACjC,CAAC;aAAM,CAAC;YACN,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAA;QACxB,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AAED;;;;;;GAMG;AACH;IAOE;;;;;OAKG;IACH,yBACmB,SAAmD;QAAnD,0BAAA,EAAA,2CAAmD;QAAnD,cAAS,GAAT,SAAS,CAA0C;QAEpE,IAAI,CAAC,qBAAqB,GAAG,eAAe,CAAC,GAAG,EAAE,CAAA;IACpD,CAAC;IAKD,sBAAI,qCAAQ;QAHZ;;WAEG;aACH;YACE,OAAO,IAAI,CAAC,SAAS,CAAA;QACvB,CAAC;;;OAAA;IAED;;;;;;OAMG;IACG,oCAAU,GAAhB;4DACE,OAA4C;;YAA5C,wBAAA,EAAA,uBAA4C;;;;wBAEtC,GAAG,GAAG,eAAe,CAAC,GAAG,EAAE,CAAA;wBACjC,IAAI,GAAG,GAAG,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;4BACtD,sBAAO,KAAK,EAAA;wBACd,CAAC;wBACD,qBAAM,OAAO,EAAE,EAAA;;wBAAf,SAAe,CAAA;wBACf,IAAI,CAAC,qBAAqB,GAAG,eAAe,CAAC,GAAG,EAAE,CAAA;wBAClD,sBAAO,IAAI,EAAA;;;;KACZ;IAED;;;;OAIG;IACH,8BAAI,GAAJ;QACE,IAAI,CAAC,qBAAqB,GAAG,eAAe,CAAC,GAAG,EAAE,CAAA;IACpD,CAAC;IAED;;;;;OAKG;IACY,mBAAG,GAAlB;QACE,IACE,OAAO,WAAW,KAAK,WAAW;YAClC,OAAO,WAAW,CAAC,GAAG,KAAK,UAAU,EACrC,CAAC;YACD,OAAO,WAAW,CAAC,GAAG,EAAE,CAAA;QAC1B,CAAC;QACD,OAAO,IAAI,CAAC,GAAG,EAAE,CAAA;IACnB,CAAC;IACH,sBAAC;AAAD,CAAC,AArED,IAqEC"}
package/lib/index.d.ts CHANGED
@@ -17,6 +17,7 @@ export { AcCmTransparency } from './AcCmTransparency';
17
17
  export { AcCmTransparencyMethod } from './AcCmTransparencyMethod';
18
18
  export { AcCmTask, AcCmTaskScheduler } from './AcCmTaskScheduler';
19
19
  export type { AcCmCompleteCallback, AcCmTaskError } from './AcCmTaskScheduler';
20
+ export { ACCM_DEFAULT_UI_YIELD_BUDGET_MS, AcCmUiYieldGate, accmYieldForPaint, accmYieldToUi } from './AcCmYieldToUi';
20
21
  export { AcCmLoader, AcCmLoadingManager, DefaultLoadingManager } from './loader';
21
22
  export type { AcCmLoaderProgressCallback, AcCmOnErrorCallback, AcCmOnLoadCallback, AcCmOnProgressCallback, AcCmOnStartCallback, AcCmUrlModifier } from './loader';
22
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,YAAY,EACV,aAAa,EACb,SAAS,EACT,iBAAiB,EAClB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EACL,KAAK,EACL,SAAS,EACT,QAAQ,EACR,GAAG,EACH,OAAO,EACP,OAAO,EACR,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,YAAY,EACV,cAAc,EACd,mCAAmC,EACnC,0BAA0B,EAC1B,iBAAiB,EACjB,aAAa,EACd,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AACrE,YAAY,EAA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AM,cAAc,CAAA;AACzC,YAAY,EACV,cAAc,EACd,mCAAmC,EACnC,0BAA0B,EAC1B,iBAAiB,EACjB,aAAa,EACd,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AACrE,YAAY,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACjE,YAAY,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAC9E,OAAO,EACL,+BAA+B,EAC/B,eAAe,EACf,iBAAiB,EACjB,aAAa,EACd,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAChF,YAAY,EACV,0BAA0B,EAC1B,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,EAChB,MAAM,UAAU,CAAA"}
package/lib/index.js CHANGED
@@ -13,5 +13,6 @@ export { AcTrStringUtil } from './AcCmStringUtil';
13
13
  export { AcCmTransparency } from './AcCmTransparency';
14
14
  export { AcCmTransparencyMethod } from './AcCmTransparencyMethod';
15
15
  export { AcCmTask, AcCmTaskScheduler } from './AcCmTaskScheduler';
16
+ export { ACCM_DEFAULT_UI_YIELD_BUDGET_MS, AcCmUiYieldGate, accmYieldForPaint, accmYieldToUi } from './AcCmYieldToUi';
16
17
  export { AcCmLoader, AcCmLoadingManager, DefaultLoadingManager } from './loader';
17
18
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","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ACnD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAM3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EACL,KAAK,EACL,SAAS,EACT,QAAQ,EACR,GAAG,EACH,OAAO,EACP,OAAO,EACR,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAQzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AAErE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAEjE,OAAO,EACL,+BAA+B,EAC/B,eAAe,EACf,iBAAiB,EACjB,aAAa,EACd,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mlightcad/common",
3
- "version": "1.11.3",
3
+ "version": "1.12.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {