@mlightcad/cad-simple-viewer-cli 1.6.3 → 1.7.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.
@@ -0,0 +1,1547 @@
1
+ import{F as Qa,$ as tr,_ as wt,u as v,v as it,b as R,g as er,a as Y,J as ar,c as ke,A as rr,d as Dt,i as j,L as nr,t as P,e as ir,x as or,f as sr,h as lr,j as cr,k as dr,l as ur,m as mr,n as pr,o as hr,p as Jt,q as fr,r as gr,s as br,w as wr,y as xr,z as vr,B as yr,C as kr,D as Ar,E as Mr,G as zr,H as Cr,I as Sr,K as Fr,M as Pr,N as Lr,O as Br,P as Ir,Q as Er,R as ot,S as sa,T as Dr,U as qt,V as Ur,W as Nr,X as Or,Y as Tr}from"./index-BSoxUnC1.js";import{Z as os,a0 as ss}from"./index-BSoxUnC1.js";function Zt(...t){return`<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 1024 1024">${t.map(a=>`<path fill="currentColor" d="${a}"/>`).join("")}</svg>`}Zt("M624 475.968V640h144a128 128 0 0 1 128 128H128a128 128 0 0 1 128-128h144V475.968a192 192 0 1 1 224 0M128 896v-64h768v64z");Zt("M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288m0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.19 160.19 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160");Zt("M876.8 156.8c0-9.6-3.2-16-9.6-22.4s-12.8-9.6-22.4-9.6-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176S0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4s3.2 16 9.6 22.4 12.8 9.6 22.4 9.6 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4m-646.4 528Q115.2 579.2 76.8 512q43.2-72 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4m140.8-96Q352 555.2 352 512c0-44.8 16-83.2 48-112s67.2-48 112-48c28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6q-43.2 72-153.6 172.8c-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176S1024 528 1024 512s-48.001-73.6-134.401-176","M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112s-67.2 48-112 48");const Rr='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" aria-hidden="true"><path fill="currentColor" d="M10 13.5 14.5 9h-9L10 13.5Z"/></svg>',jr='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M10.09 3.53 16.09 6.97 10.09 10.29 4.18 7 10.09 3.56M10.09 2.4 2.17 7 3.31 7.65 10.09 11.45 17 7.62 18.17 7 10.08 2.37 10.09 2.4Z"/><path fill="currentColor" d="M10.25 14.83 18.17 10.22 17 9.57 10.22 13.57 3.32 9.59 2.17 10.22 10.25 14.83Z"/><path fill="currentColor" d="M10.25 17.63 18.17 13 17 12.37 10.22 16.37 3.32 12.38 2.17 13 10.25 17.63Z"/></svg>',_r='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M10.09 5.15 16.09 8.59 10.09 11.91 4.18 8.59 10.09 5.15ZM10.09 4 2.17 8.61 3.31 9.25 10.09 13.06 17 9.24 18.16 8.61 10.08 4 10.09 4Z"/><path fill="currentColor" d="M10.25 16.46 18.17 11.85 17 11.2 10.22 15.2 3.32 11.21 2.17 11.85 10.25 16.46Z"/><path fill="none" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" d="M3.5 3.5 16.5 16.5"/></svg>',q=4;var _=Uint8Array,$=Uint16Array,Qt=Int32Array,te=new _([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),ee=new _([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ae=new _([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),la=function(t,e){for(var a=new $(31),r=0;r<31;++r)a[r]=e+=1<<t[r-1];for(var n=new Qt(a[30]),r=1;r<30;++r)for(var i=a[r];i<a[r+1];++i)n[i]=i-a[r]<<5|r;return{b:a,r:n}},ca=la(te,2),$r=ca.b,_t=ca.r;$r[28]=258,_t[258]=28;var Hr=la(ee,0),Me=Hr.r,$t=new $(32768);for(var y=0;y<32768;++y){var J=(y&43690)>>1|(y&21845)<<1;J=(J&52428)>>2|(J&13107)<<2,J=(J&61680)>>4|(J&3855)<<4,$t[y]=((J&65280)>>8|(J&255)<<8)>>1}var ut=(function(t,e,a){for(var r=t.length,n=0,i=new $(e);n<r;++n)t[n]&&++i[t[n]-1];var o=new $(e);for(n=1;n<e;++n)o[n]=o[n-1]+i[n-1]<<1;var l;if(a){l=new $(1<<e);var s=15-e;for(n=0;n<r;++n)if(t[n])for(var c=n<<4|t[n],d=e-t[n],u=o[t[n]-1]++<<d,m=u|(1<<d)-1;u<=m;++u)l[$t[u]>>s]=c}else for(l=new $(r),n=0;n<r;++n)t[n]&&(l[n]=$t[o[t[n]-1]++]>>15-t[n]);return l}),tt=new _(288);for(var y=0;y<144;++y)tt[y]=8;for(var y=144;y<256;++y)tt[y]=9;for(var y=256;y<280;++y)tt[y]=7;for(var y=280;y<288;++y)tt[y]=8;var vt=new _(32);for(var y=0;y<32;++y)vt[y]=5;var Vr=ut(tt,9,0),Yr=ut(vt,5,0),da=function(t){return(t+7)/8|0},ua=function(t,e,a){return(a==null||a>t.length)&&(a=t.length),new _(t.subarray(e,a))},Xr=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Ct=function(t,e,a){var r=new Error(e||Xr[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,Ct),!a)throw r;return r},W=function(t,e,a){a<<=e&7;var r=e/8|0;t[r]|=a,t[r+1]|=a>>8},lt=function(t,e,a){a<<=e&7;var r=e/8|0;t[r]|=a,t[r+1]|=a>>8,t[r+2]|=a>>16},Ut=function(t,e){for(var a=[],r=0;r<t.length;++r)t[r]&&a.push({s:r,f:t[r]});var n=a.length,i=a.slice();if(!n)return{t:pa,l:0};if(n==1){var o=new _(a[0].s+1);return o[a[0].s]=1,{t:o,l:1}}a.sort(function(g,L){return g.f-L.f}),a.push({s:-1,f:25001});var l=a[0],s=a[1],c=0,d=1,u=2;for(a[0]={s:-1,f:l.f+s.f,l,r:s};d!=n-1;)l=a[a[c].f<a[u].f?c++:u++],s=a[c!=d&&a[c].f<a[u].f?c++:u++],a[d++]={s:-1,f:l.f+s.f,l,r:s};for(var m=i[0].s,r=1;r<n;++r)i[r].s>m&&(m=i[r].s);var p=new $(m+1),f=Ht(a[d-1],p,0);if(f>e){var r=0,h=0,w=f-e,A=1<<w;for(i.sort(function(L,C){return p[C.s]-p[L.s]||L.f-C.f});r<n;++r){var M=i[r].s;if(p[M]>e)h+=A-(1<<f-p[M]),p[M]=e;else break}for(h>>=w;h>0;){var I=i[r].s;p[I]<e?h-=1<<e-p[I]++-1:++r}for(;r>=0&&h;--r){var z=i[r].s;p[z]==e&&(--p[z],++h)}f=e}return{t:new _(p),l:f}},Ht=function(t,e,a){return t.s==-1?Math.max(Ht(t.l,e,a+1),Ht(t.r,e,a+1)):e[t.s]=a},ze=function(t){for(var e=t.length;e&&!t[--e];);for(var a=new $(++e),r=0,n=t[0],i=1,o=function(s){a[r++]=s},l=1;l<=e;++l)if(t[l]==n&&l!=e)++i;else{if(!n&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(n),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(n);i=1,n=t[l]}return{c:a.subarray(0,r),n:e}},ct=function(t,e){for(var a=0,r=0;r<e.length;++r)a+=t[r]*e[r];return a},ma=function(t,e,a){var r=a.length,n=da(e+2);t[n]=r&255,t[n+1]=r>>8,t[n+2]=t[n]^255,t[n+3]=t[n+1]^255;for(var i=0;i<r;++i)t[n+i+4]=a[i];return(n+4+r)*8},Ce=function(t,e,a,r,n,i,o,l,s,c,d){W(e,d++,a),++n[256];for(var u=Ut(n,15),m=u.t,p=u.l,f=Ut(i,15),h=f.t,w=f.l,A=ze(m),M=A.c,I=A.n,z=ze(h),g=z.c,L=z.n,C=new $(19),x=0;x<M.length;++x)++C[M[x]&31];for(var x=0;x<g.length;++x)++C[g[x]&31];for(var b=Ut(C,7),D=b.t,X=b.l,S=19;S>4&&!D[Ae[S-1]];--S);var H=c+5<<3,E=ct(n,tt)+ct(i,vt)+o,U=ct(n,m)+ct(i,h)+o+14+3*S+ct(C,D)+2*C[16]+3*C[17]+7*C[18];if(s>=0&&H<=E&&H<=U)return ma(e,d,t.subarray(s,s+c));var N,k,O,V;if(W(e,d,1+(U<E)),d+=2,U<E){N=ut(m,p,0),k=m,O=ut(h,w,0),V=h;var Lt=ut(D,X,0);W(e,d,I-257),W(e,d+5,L-1),W(e,d+10,S-4),d+=14;for(var x=0;x<S;++x)W(e,d+3*x,D[Ae[x]]);d+=3*S;for(var G=[M,g],st=0;st<2;++st)for(var at=G[st],x=0;x<at.length;++x){var K=at[x]&31;W(e,d,Lt[K]),d+=D[K],K>15&&(W(e,d,at[x]>>5&127),d+=at[x]>>12)}}else N=Vr,k=tt,O=Yr,V=vt;for(var x=0;x<l;++x){var T=r[x];if(T>255){var K=T>>18&31;lt(e,d,N[K+257]),d+=k[K+257],K>7&&(W(e,d,T>>23&31),d+=te[K]);var rt=T&31;lt(e,d,O[rt]),d+=V[rt],rt>3&&(lt(e,d,T>>5&8191),d+=ee[rt])}else lt(e,d,N[T]),d+=k[T]}return lt(e,d,N[256]),d+k[256]},Gr=new Qt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),pa=new _(0),Kr=function(t,e,a,r,n,i){var o=i.z||t.length,l=new _(r+o+5*(1+Math.ceil(o/7e3))+n),s=l.subarray(r,l.length-n),c=i.l,d=(i.r||0)&7;if(e){d&&(s[0]=i.r>>3);for(var u=Gr[e-1],m=u>>13,p=u&8191,f=(1<<a)-1,h=i.p||new $(32768),w=i.h||new $(f+1),A=Math.ceil(a/3),M=2*A,I=function(Et){return(t[Et]^t[Et+1]<<A^t[Et+2]<<M)&f},z=new Qt(25e3),g=new $(288),L=new $(32),C=0,x=0,b=i.i||0,D=0,X=i.w||0,S=0;b+2<o;++b){var H=I(b),E=b&32767,U=w[H];if(h[E]=U,w[H]=E,X<=b){var N=o-b;if((C>7e3||D>24576)&&(N>423||!c)){d=Ce(t,s,0,z,g,L,x,D,S,b-S,d),D=C=x=0,S=b;for(var k=0;k<286;++k)g[k]=0;for(var k=0;k<30;++k)L[k]=0}var O=2,V=0,Lt=p,G=E-U&32767;if(N>2&&H==I(b-G))for(var st=Math.min(m,N)-1,at=Math.min(32767,b),K=Math.min(258,N);G<=at&&--Lt&&E!=U;){if(t[b+O]==t[b+O-G]){for(var T=0;T<K&&t[b+T]==t[b+T-G];++T);if(T>O){if(O=T,V=G,T>st)break;for(var rt=Math.min(G,T-2),we=0,k=0;k<rt;++k){var Bt=b-G+k&32767,Za=h[Bt],xe=Bt-Za&32767;xe>we&&(we=xe,U=Bt)}}}E=U,U=h[E],G+=E-U&32767}if(V){z[D++]=268435456|_t[O]<<18|Me[V];var ve=_t[O]&31,ye=Me[V]&31;x+=te[ve]+ee[ye],++g[257+ve],++L[ye],X=b+O,++C}else z[D++]=t[b],++g[t[b]]}}for(b=Math.max(b,X);b<o;++b)z[D++]=t[b],++g[t[b]];d=Ce(t,s,c,z,g,L,x,D,S,b-S,d),c||(i.r=d&7|s[d/8|0]<<3,d-=7,i.h=w,i.p=h,i.i=b,i.w=X)}else{for(var b=i.w||0;b<o+c;b+=65535){var It=b+65535;It>=o&&(s[d/8|0]=c,It=o),d=ma(s,d+1,t.subarray(b,It))}i.i=o}return ua(l,0,r+da(d)+n)},Wr=(function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var a=e,r=9;--r;)a=(a&1&&-306674912)^a>>>1;t[e]=a}return t})(),ha=function(){var t=-1;return{p:function(e){for(var a=t,r=0;r<e.length;++r)a=Wr[a&255^e[r]]^a>>>8;t=a},d:function(){return~t}}},fa=function(t,e,a,r,n){if(!n&&(n={l:1},e.dictionary)){var i=e.dictionary.subarray(-32768),o=new _(i.length+t.length);o.set(i),o.set(t,i.length),t=o,n.w=i.length}return Kr(t,e.level==null?6:e.level,e.mem==null?n.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,a,r,n)},ga=function(t,e){var a={};for(var r in t)a[r]=t[r];for(var r in e)a[r]=e[r];return a},F=function(t,e,a){for(;a;++e)t[e]=a,a>>>=8},Jr=function(t,e){var a=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:e.level==9?2:0,t[9]=3,e.mtime!=0&&F(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),a){t[3]=8;for(var r=0;r<=a.length;++r)t[r+10]=a.charCodeAt(r)}},qr=function(t){return 10+(t.filename?t.filename.length+1:0)};function Zr(t,e){return fa(t,e||{},0,0)}function Qr(t,e){e||(e={});var a=ha(),r=t.length;a.p(t);var n=fa(t,e,qr(e),8),i=n.length;return Jr(n,e),F(n,i-8,a.d()),F(n,i-4,r),n}var ba=function(t,e,a,r){for(var n in t){var i=t[n],o=e+n,l=r;Array.isArray(i)&&(l=ga(r,i[1]),i=i[0]),i instanceof _?a[o]=[i,l]:(a[o+="/"]=[new _(0),l],ba(i,o,a,r))}},Se=typeof TextEncoder<"u"&&new TextEncoder,tn=typeof TextDecoder<"u"&&new TextDecoder,en=0;try{tn.decode(pa,{stream:!0}),en=1}catch{}function pt(t,e){var a;if(Se)return Se.encode(t);for(var r=t.length,n=new _(t.length+(t.length>>1)),i=0,o=function(d){n[i++]=d},a=0;a<r;++a){if(i+5>n.length){var l=new _(i+8+(r-a<<1));l.set(n),n=l}var s=t.charCodeAt(a);s<128||e?o(s):s<2048?(o(192|s>>6),o(128|s&63)):s>55295&&s<57344?(s=65536+(s&1047552)|t.charCodeAt(++a)&1023,o(240|s>>18),o(128|s>>12&63),o(128|s>>6&63),o(128|s&63)):(o(224|s>>12),o(128|s>>6&63),o(128|s&63))}return ua(n,0,i)}var Vt=function(t){var e=0;if(t)for(var a in t){var r=t[a].length;r>65535&&Ct(9),e+=r+4}return e},Fe=function(t,e,a,r,n,i,o,l){var s=r.length,c=a.extra,d=l&&l.length,u=Vt(c);F(t,e,o!=null?33639248:67324752),e+=4,o!=null&&(t[e++]=20,t[e++]=a.os),t[e]=20,e+=2,t[e++]=a.flag<<1|(i<0&&8),t[e++]=n&&8,t[e++]=a.compression&255,t[e++]=a.compression>>8;var m=new Date(a.mtime==null?Date.now():a.mtime),p=m.getFullYear()-1980;if((p<0||p>119)&&Ct(10),F(t,e,p<<25|m.getMonth()+1<<21|m.getDate()<<16|m.getHours()<<11|m.getMinutes()<<5|m.getSeconds()>>1),e+=4,i!=-1&&(F(t,e,a.crc),F(t,e+4,i<0?-i-2:i),F(t,e+8,a.size)),F(t,e+12,s),F(t,e+14,u),e+=16,o!=null&&(F(t,e,d),F(t,e+6,a.attrs),F(t,e+10,o),e+=14),t.set(r,e),e+=s,u)for(var f in c){var h=c[f],w=h.length;F(t,e,+f),F(t,e+2,w),t.set(h,e+4),e+=4+w}return d&&(t.set(l,e),e+=d),e},an=function(t,e,a,r,n){F(t,e,101010256),F(t,e+8,a),F(t,e+10,a),F(t,e+12,r),F(t,e+16,n)};function rn(t,e){e||(e={});var a={},r=[];ba(t,"",a,e);var n=0,i=0;for(var o in a){var l=a[o],s=l[0],c=l[1],d=c.level==0?0:8,u=pt(o),m=u.length,p=c.comment,f=p&&pt(p),h=f&&f.length,w=Vt(c.extra);m>65535&&Ct(11);var A=d?Zr(s,c):s,M=A.length,I=ha();I.p(s),r.push(ga(c,{size:s.length,crc:I.d(),c:A,f:u,m:f,u:m!=o.length||f&&p.length!=h,o:n,compression:d})),n+=30+m+w+M,i+=76+2*(m+w)+(h||0)+M}for(var z=new _(i+22),g=n,L=i-n,C=0;C<r.length;++C){var u=r[C];Fe(z,u.o,u,u.f,u.u,u.c.length);var x=30+u.f.length+Vt(u.extra);z.set(u.c,u.o+x),Fe(z,n,u,u.f,u.u,u.c.length,u.o,u.m),n+=16+x+(u.m?u.m.length:0)}return an(z,n,r.length,L,g),z}const nn="gzip";function ae(t){return{bytes:Qr(t),compression:nn}}const Pe=1,Le=2,Be=4,Ie=8,Ee=16,on=32,De=1,Ue=2,Ne=4,Oe=8,Te=16,sn=32,Re=64,je=128;function re(t){let e=256+t.positions.byteLength;return t.indices&&(e+=t.indices.byteLength),t.lineDistances&&(e+=t.lineDistances.byteLength),t.linePattern&&(e+=64+t.linePattern.pattern.length*8),e}function ne(t){let e=256+t.positions.byteLength;return t.indices&&(e+=t.indices.byteLength),t.gradientPositions&&(e+=t.gradientPositions.byteLength),t.uvs&&(e+=t.uvs.byteLength),t.texture&&(e+=t.texture.bytes.byteLength+64),t.hatchPattern&&(e+=128),t.gradientFill&&(e+=64),e}function wa(t,e){t.writeString(e.layer),t.writeU32(e.color>>>0),t.writeF64(e.offset[0]),t.writeF64(e.offset[1]),t.writeF64(e.offset[2]),t.writeFloat32Array(e.positions);let a=0;e.indices&&e.indices.length>0&&(a|=Pe),e.linePattern&&(a|=Le),e.lineDistances&&e.lineDistances.length>0&&(a|=Be),e.lineWidth!=null&&e.lineWidth>0&&(a|=Ie),e.renderOrder!=null&&e.renderOrder!==0&&(a|=Ee),e.excludeFromOsnap&&(a|=on),t.writeU8(a),a&Pe&&t.writeUint32Array(e.indices),a&Le&&t.writeJson(e.linePattern),a&Be&&t.writeFloat32Array(e.lineDistances),a&Ie&&t.writeF32(e.lineWidth),a&Ee&&t.writeI32(e.renderOrder)}function xa(t,e){t.writeString(e.layer),t.writeU32(e.color>>>0),t.writeF64(e.offset[0]),t.writeF64(e.offset[1]),t.writeF64(e.offset[2]),t.writeFloat32Array(e.positions);let a=0;e.indices&&e.indices.length>0&&(a|=De),e.hatchPattern&&(a|=Ue),e.gradientFill&&(a|=Ne),e.gradientPositions&&e.gradientPositions.length>0&&(a|=Oe),e.side!=null&&(a|=Te),e.points&&(a|=sn),e.renderOrder!=null&&e.renderOrder!==0&&(a|=Re),e.texture&&e.texture.bytes.length>0&&e.uvs&&e.uvs.length>=2&&(a|=je),t.writeU8(a),a&De&&t.writeUint32Array(e.indices),a&Ue&&t.writeJson(e.hatchPattern),a&Ne&&t.writeJson(e.gradientFill),a&Oe&&t.writeFloat32Array(e.gradientPositions),a&Te&&t.writeU8(e.side),a&Re&&t.writeI32(e.renderOrder),a&je&&(t.writeFloat32Array(e.uvs),t.writeString(e.texture.mimeType||"image/png"),t.writeU32(e.texture.bytes.byteLength),t.writeBytes(e.texture.bytes))}class ie{constructor(){this.chunks=[],this.length=0}writeU8(e){const a=new Uint8Array(1);a[0]=e&255,this.chunks.push(a),this.length+=1}writeU32(e){const a=new Uint8Array(4);new DataView(a.buffer).setUint32(0,e>>>0,!0),this.chunks.push(a),this.length+=4}writeI32(e){const a=new Uint8Array(4);new DataView(a.buffer).setInt32(0,e|0,!0),this.chunks.push(a),this.length+=4}writeF32(e){const a=new Uint8Array(4);new DataView(a.buffer).setFloat32(0,e,!0),this.chunks.push(a),this.length+=4}writeF64(e){const a=new Uint8Array(8);new DataView(a.buffer).setFloat64(0,e,!0),this.chunks.push(a),this.length+=8}writeBytes(e){this.chunks.push(e),this.length+=e.length}writeString(e){const a=pt(e);this.writeU32(a.length),this.writeBytes(a)}writeJson(e){this.writeString(JSON.stringify(e))}writeFloat32Array(e){this.alignTo(4);const a=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);this.writeU32(a.length),this.writeBytes(a)}writeUint32Array(e){this.alignTo(4);const a=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);this.writeU32(a.length),this.writeBytes(a)}alignTo(e){const a=this.length%e;if(a===0)return;const r=e-a;for(let n=0;n<r;n++)this.writeU8(0)}toUint8Array(){const e=new Uint8Array(this.length);let a=0;for(const r of this.chunks)e.set(r,a),a+=r.length;return e}}const ln=1329939265,cn=1,dn=1,un=2,mn=3,pn=4,hn=5,fn=6,gn=7;function va(t){var e;switch(t.kind){case"line":return 37;case"circle":return 30;case"arc":return 46;case"ellipse":return 71;case"point":return 21;case"path":return 10+t.vertices.length*8;case"spline":return 10+(t.controlPoints.length+t.knots.length+t.weights.length+(((e=t.fitPoints)==null?void 0:e.length)??0))*8+16;default:return t}}function bn(t,e){if(t.length===0)return[];const a=[];let r=[],n=64;const i=()=>{r.length!==0&&(a.push(r),r=[],n=64)};for(const o of t){const l=va(o);r.length>0&&n+l>e&&i(),r.push(o),n+=l}return i(),a}function ya(t){const e=new ie;e.writeU32(ln),e.writeU8(cn),e.writeU8(0),e.writeU8(0),e.writeU8(0);const a=[],r=new Map,n=i=>{const o=r.get(i);if(o!=null)return o;const l=a.length;return a.push(i),r.set(i,l),l};for(const i of t.primitives)n(i.layer);e.writeU32(a.length);for(const i of a)e.writeString(i);e.writeU32(t.primitives.length);for(const i of t.primitives)xn(e,i,n(i.layer));return e.toUint8Array()}function wn(t){const e=ya(t),a=ae(e).bytes;return{uncompressed:e,compressed:a}}function Nt(t,e){t.writeU8(e<0?0:1)}function dt(t,e){t.writeU32(e.length);for(const a of e)t.writeF64(a)}function xn(t,e,a){switch(e.kind){case"line":t.writeU8(dn),t.writeU32(a),t.writeF64(e.x0),t.writeF64(e.y0),t.writeF64(e.x1),t.writeF64(e.y1);return;case"circle":t.writeU8(un),t.writeU32(a),t.writeF64(e.cx),t.writeF64(e.cy),t.writeF64(e.r),Nt(t,e.normalSign);return;case"arc":t.writeU8(mn),t.writeU32(a),t.writeF64(e.cx),t.writeF64(e.cy),t.writeF64(e.r),t.writeF64(e.startAngle),t.writeF64(e.endAngle),Nt(t,e.normalSign);return;case"ellipse":t.writeU8(pn),t.writeU32(a),t.writeF64(e.cx),t.writeF64(e.cy),t.writeF64(e.majorX),t.writeF64(e.majorY),t.writeF64(e.majorR),t.writeF64(e.minorR),t.writeF64(e.startAngle),t.writeF64(e.endAngle),t.writeU8(e.closed?1:0),Nt(t,e.normalSign??1);return;case"spline":t.writeU8(hn),t.writeU32(a),dt(t,e.controlPoints),t.writeU32(e.degree),dt(t,e.knots),dt(t,e.weights),t.writeU8(e.closed?1:0),dt(t,e.fitPoints??[]);return;case"point":t.writeU8(fn),t.writeU32(a),t.writeF64(e.x),t.writeF64(e.y);return;case"path":t.writeU8(gn),t.writeU32(a),t.writeU8(e.closed?1:0),dt(t,e.vertices);return;default:{const r=e;throw new Error(`Unsupported osnap primitive: ${String(r)}`)}}}const vn=1480934209;function yn(t){if(t.version!==q)throw new Error(`Unsupported snapshot version: ${t.version}`);const e=new ie;e.writeU32(vn),e.writeU8(q),e.writeU8(0),e.writeU8(0),e.writeU8(0),e.writeJson(t.meta),e.writeJson(t.layers),e.writeString(t.activeLayoutBtrId),e.writeU32(t.layouts.length);for(const a of t.layouts)kn(e,a);return e.toUint8Array()}function kn(t,e){t.writeString(e.btrId),t.writeString(e.name),t.writeU8(e.isModelSpace?1:0),An(t,e.osnap),t.writeJson(e.viewports??null),t.writeU32(e.lineBatches.length);for(const a of e.lineBatches)wa(t,a);t.writeU32(e.meshBatches.length);for(const a of e.meshBatches)xa(t,a)}function An(t,e){if(!e||e.primitives.length===0){t.writeU32(0);return}const a=ya(e);t.writeU32(a.length),t.writeBytes(a)}const Mn="application/vnd.mlightcad.acex-snapshot+binary";function ka(t){if(t.version!==q)throw new Error(`Unsupported snapshot version: ${t.version}`);const e=yn(t),a=ae(e);return{payload:Cn(a.bytes),compression:a.compression}}function zn(){return Mn}function Cn(t){let e="";for(let a=0;a<t.length;a++)e+=String.fromCharCode(t[a]);return btoa(e)}function et(t,e,a){if(a<=0)return new Float32Array(0);const r=new Float32Array(a);for(let n=0;n<a;n++)r[n]=t[e+n];return r}function Sn(t,e,a){if(a<=0)return new Uint32Array(0);const r=new Uint32Array(a);for(let n=0;n<a;n++)r[n]=t[e+n];return r}function Aa(t,e){if(e.length===0)return{positions:t,indices:e};let a=0;for(let n=0;n<e.length;n++){const i=e[n];i>a&&(a=i)}const r=(a+1)*3;return r>=t.length?{positions:t,indices:e}:{positions:et(t,0,r),indices:e}}function _e(t,e){return t+e}const nt={x:0,y:0,z:0};function Fn(t){t.updateMatrixWorld(!0);const e=t.matrixWorld.elements;return nt.x=e[12],nt.y=e[13],nt.z=e[14],[nt.x,nt.y,nt.z]}function Pn(t,e){const a=e.elements,r=t.positions;if(r.length===0)return{positions:new Float32Array(0),indices:t.indices};const n=new Float32Array(r.length);for(let i=0;i<r.length;i+=3){const o=r[i],l=r[i+1],s=r[i+2];n[i]=a[0]*o+a[4]*l+a[8]*s+a[12],n[i+1]=a[1]*o+a[5]*l+a[9]*s+a[13],n[i+2]=a[2]*o+a[6]*l+a[10]*s+a[14]}return{positions:n,indices:t.indices?new Uint32Array(t.indices):void 0}}function Ln(t){const e=t.positions;if(e.length<3)return{slice:t,offset:[0,0,0]};let a=1/0,r=1/0,n=1/0,i=-1/0,o=-1/0,l=-1/0;for(let d=0;d<e.length;d+=3){const u=e[d],m=e[d+1],p=e[d+2];a=Math.min(a,u),r=Math.min(r,m),n=Math.min(n,p),i=Math.max(i,u),o=Math.max(o,m),l=Math.max(l,p)}const s=[(a+i)/2,(r+o)/2,(n+l)/2],c=new Float32Array(e.length);for(let d=0;d<e.length;d+=3)c[d]=e[d]-s[0],c[d+1]=e[d+1]-s[1],c[d+2]=e[d+2]-s[2];return{slice:{positions:c,indices:t.indices?new Uint32Array(t.indices):void 0},offset:s}}function Bn(t,e,a={}){t.updateMatrixWorld(!0);const r=Pn(e,t.matrixWorld);return Ln(r)}function In(t){const e=t.image;if(!e||typeof document>"u")return;const a=document.createElement("canvas"),r=a.getContext("2d");if(!r)return;try{if(e instanceof ImageData)a.width=e.width,a.height=e.height,r.putImageData(e,0,0);else if(Dn(e)){a.width=e.width,a.height=e.height;const s=Nn(e.data,e.width*e.height),c=new ImageData(new Uint8ClampedArray(s),e.width,e.height);r.putImageData(c,0,0)}else if(En(e)){const s=Un(e);if(!s)return;a.width=s.width,a.height=s.height,r.drawImage(e,0,0)}else return}catch{return}const n=a.toDataURL("image/png"),i=n.indexOf(",");if(i<0)return;const o=atob(n.slice(i+1)),l=new Uint8Array(o.length);for(let s=0;s<o.length;s++)l[s]=o.charCodeAt(s);return{mimeType:"image/png",bytes:l}}function En(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&t instanceof ImageBitmap||typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement}function Dn(t){if(!t||typeof t!="object")return!1;const e=t;return e.data!=null&&typeof e.width=="number"&&typeof e.height=="number"&&e.width>=1&&e.height>=1}function Un(t){let e=Number(t.width),a=Number(t.height);if(t instanceof HTMLImageElement?(e=t.naturalWidth||t.width,a=t.naturalHeight||t.height):typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement&&(e=t.videoWidth||t.width,a=t.videoHeight||t.height),!(!Number.isFinite(e)||!Number.isFinite(a)||e<1||a<1))return{width:e,height:a}}function Nn(t,e){const a=e*4;if(t instanceof Uint8ClampedArray&&t.length>=a)return t.length===a?t:t.subarray(0,a);const r=new Uint8ClampedArray(a),n=Math.min(a,t.length);for(let i=0;i<n;i++)r[i]=t[i];if(t.length>=e*3&&t.length<a)for(let i=e-1;i>=0;i--){const o=i*3,l=i*4;r[l]=t[o],r[l+1]=t[o+1],r[l+2]=t[o+2],r[l+3]=255}return r}function On(t,e){const a=t.getAttribute("uv");if(!a||a.count===0||a.itemSize<2)return;const r=Math.floor(e.length/3)*2;if(r<=0)return;const n=a.array;if(!(a.count*a.itemSize<r))return et(n,0,r)}function Tn(t){const e=t;return e.map?!1:e.transparent===!0&&typeof e.opacity=="number"&&e.opacity<.01}function oe(t){const e=t;if(e.isShaderMaterial===!0||t.type==="ShaderMaterial")return e}function Rn(t){var e;const a=oe(t);if(!a)return;const r=a.uniforms.pattern,n=a.uniforms.patternLength;if(!r||!n)return;const i=r.value;if(!(!Array.isArray(i)||i.length===0))return{pattern:[...i],patternLength:Number(n.value),viewportScale:Number(((e=a.uniforms.u_viewportScale)==null?void 0:e.value)??1)}}function jn(t){var e;const a=oe(t);if(!a)return;const r=a.uniforms.u_patternLines;if(!r)return;const n=r.value;if(!(!Array.isArray(n)||n.length===0))return{patternAngle:Number(((e=a.uniforms.u_patternAngle)==null?void 0:e.value)??0),patternLines:n.map($n)}}function _n(t){var e,a,r,n,i;const o=oe(t);if(!o||o.uniforms.u_patternLines)return;const l=(e=o.uniforms.u_startColor)==null?void 0:e.value,s=(a=o.uniforms.u_endColor)==null?void 0:a.value,c=o.uniforms.u_gradientType;if(!(!(l!=null&&l.getHex)||c==null))return{startColor:l.getHex(),endColor:((r=s==null?void 0:s.getHex)==null?void 0:r.call(s))??l.getHex(),angle:Number(((n=o.uniforms.u_angle)==null?void 0:n.value)??0),shift:Number(((i=o.uniforms.u_shift)==null?void 0:i.value)??0),gradientType:Number(c.value)}}function $n(t){return{angle:t.angle,base:[t.base.x,t.base.y],offset:[t.offset.x,t.offset.y],dashLengths:[...t.dashLengths],patternLength:t.patternLength}}function Ma(t){const e=t.length/3;if(e<2)return new Float32Array(0);const a=new Float32Array(e);for(let r=0;r<e;r+=2){r===0?a[r]=0:a[r]=a[r-1];const n=t[r*3],i=t[r*3+1],o=t[r*3+2]??0,l=t[(r+1)*3],s=t[(r+1)*3+1],c=t[(r+1)*3+2]??0,d=l-n,u=s-i,m=c-o;a[r+1]=a[r]+Math.sqrt(d*d+u*u+m*m)}return a}function Hn(t,e){const a=t.getAttribute(e);if(!a||a.count===0)return;const r=a.itemSize;if(t.getIndex()){const d=a.array;return et(d,0,a.count*r)}const n=t.drawRange,i=a.count,o=Math.max(0,Math.min(Math.floor(n.start),i)),l=Math.max(0,i-o),s=!Number.isFinite(n.count)||n.count<=0?l:Math.min(Math.floor(n.count),l);if(s<=0)return;const c=a.array;return et(c,o*r,s*r)}function $e(t,e){const a=Math.atan2(e[1],e[0]),r=(i,o)=>[e[0]*i+e[4]*o+e[12],e[1]*i+e[5]*o+e[13]],n=(i,o)=>[e[0]*i+e[4]*o,e[1]*i+e[5]*o];return{patternAngle:t.patternAngle+a,patternLines:t.patternLines.map(i=>({angle:i.angle+a,base:r(i.base[0],i.base[1]),offset:n(i.offset[0],i.offset[1]),dashLengths:[...i.dashLengths],patternLength:i.patternLength}))}}function Vn(t,e){return{patternAngle:t.patternAngle,patternLines:t.patternLines.map(a=>{const r=new P.Vector2(a.base[0]-e[0],a.base[1]-e[1]),n=new P.Vector2(a.offset[0],a.offset[1]);return j.wrapPatternBaseToLocalFrame(r,n,a.angle,t.patternAngle,a.patternLength),{angle:a.angle,base:[r.x,r.y],offset:[a.offset[0],a.offset[1]],dashLengths:[...a.dashLengths],patternLength:a.patternLength}})}}function Yt(t,e){return!Number.isFinite(t)||t<0?0:Math.min(Math.floor(t),e)}function Xt(t,e,a){const r=Math.max(0,e-a);return!Number.isFinite(t)||t<=0?r:Math.min(Math.floor(t),r)}function He(t){const e=t.getAttribute("position");if(!e)return{positions:new Float32Array(0)};const a=t.drawRange,r=e.array,n=e.itemSize,i=t.getIndex();if(i){const s=et(r,0,e.count*n),c=i.array,d=Yt(a.start,i.count),u=Xt(a.count,i.count,d),m=Sn(c,d,u);return Aa(s,m)}const o=Yt(a.start,e.count),l=Xt(a.count,e.count,o);return{positions:et(r,o*n,l*n)}}function yt(t){return j.isBatchGeometryActive(t.flags)&&j.isBatchGeometryVisible(t.flags)}function za(t){const{count:e}=t.mappingStats;for(let a=0;a<e;a++){let r;try{r=t.getGeometryRangeAt(a)}catch{continue}if(yt(r)&&r.bboxIntersectionCheck)return!0}return!1}function Ve(t){return j.getSceneDrawableUserData(t).bboxIntersectionCheck===!0}function se(t,e){const a=e.getAttribute("position");if(!a)return{positions:new Float32Array(0)};const r=a.itemSize,n=a.array,i=e.getIndex(),{count:o}=t.mappingStats;if(i){const s=et(n,0,a.count*r),c=i.array,d=[];for(let u=0;u<o;u++){let m;try{m=t.getGeometryRangeAt(u)}catch{continue}const p=m.indexStart??0,f=m.indexCount??0;if(!(!yt(m)||f<=0))for(let h=0;h<f;h++)d.push(c[p+h])}return d.length===0?{positions:new Float32Array(0)}:Aa(s,new Uint32Array(d))}const l=[];for(let s=0;s<o;s++){let c;try{c=t.getGeometryRangeAt(s)}catch{continue}if(!yt(c)||c.vertexCount<=0)continue;const d=c.vertexStart*r,u=c.vertexCount*r;for(let m=0;m<u;m++)l.push(n[d+m])}return{positions:new Float32Array(l)}}function kt(t,e,a){t.push(e.getX(a),e.getY(a),e.getZ(a))}function Yn(t,e){const a=e.getAttribute("instanceStart"),r=e.getAttribute("instanceEnd");if(!a||!r)return{positions:new Float32Array(0)};const{count:n}=t.mappingStats,i=[];for(let o=0;o<n;o++){let l;try{l=t.getGeometryRangeAt(o)}catch{continue}if(!yt(l)||l.vertexCount<=0)continue;const s=l.vertexStart,c=s+l.vertexCount;for(let d=s;d<c;d++)kt(i,a,d),kt(i,r,d)}return{positions:new Float32Array(i)}}function Xn(t,e){const a=t.instanceCount;if(Number.isFinite(a)&&a>=0)return Math.min(Math.floor(a),e);const r=t.drawRange,n=Yt(r.start,e);return Xt(r.count,e,n)}function Gn(t){const e=t.getAttribute("instanceStart"),a=t.getAttribute("instanceEnd");if(!e||!a||e.count===0)return{positions:new Float32Array(0)};const r=Xn(t,e.count);if(r<=0)return{positions:new Float32Array(0)};const n=[];for(let i=0;i<r;i++)kt(n,e,i),kt(n,a,i);return{positions:new Float32Array(n)}}function Ot(t){return j.isObjectHierarchyVisible(t)}function Ca(t){if(t instanceof cr)return t.linewidth}function Tt(t){if("material"in t){const e=t.userData.originalMaterial??t.material;return Array.isArray(e)?e[0]:e}return t.material}function ht(t){var e;const a=j.getMaterialMetadata(t),r=a.layer??"0",n=t;let i=n.color!=null?n.color.getHex():a.color??16777215;const o=Rn(t),l=jn(t),s=_n(t);if(t instanceof P.ShaderMaterial||t.type==="ShaderMaterial"){const c=(e=t.uniforms.u_color)==null?void 0:e.value;c!=null&&c.getHex?i=c.getHex():s&&(i=s.startColor)}return{color:i,layer:r,linePattern:o,hatchPattern:l,gradientFill:s,side:l||s?t.side:void 0}}function Kn(t,e){const a=j.getMaterialMetadata(e).drawOrder??t.renderOrder;return a===0?void 0:a}function ft(t,e,a){const r=Kn(e,a);r!=null&&(t.renderOrder=r)}function Wn(t,e){if(!e)return;const a=t.userData.bakedWorldMatrix;return a&&a.length>=16?$e(e,a):(t.updateMatrixWorld(!0),$e(e,Array.from(t.matrixWorld.elements)))}function St(t){return Fn(t)}function Rt(t,e,a={}){const r=Bn(t,e,a);return{...r.slice,offset:r.offset}}function le(t,e,a,r,n){const i=ht(e),o=Wn(a,i.hatchPattern),l=o?Vn(o,n):void 0,s=i.gradientFill?Hn(t,"gradientPosition"):void 0,c={layer:i.layer,color:i.color,offset:n,hatchPattern:l,gradientFill:i.gradientFill,gradientPositions:s,side:i.side,...r},d=e;if(d.map){const u=In(d.map),m=On(t,r.positions);if(!u||!m)return;c.texture=u,c.uvs=m,c.color=16777215,c.side=P.DoubleSide}return ft(c,a,e),c}function Jn(t){const e=Yn(t,t.geometry);if(e.positions.length===0)return;const{color:a,layer:r}=ht(t.material),n=Ca(t.material),i={layer:r,color:a,offset:St(t),lineWidth:n,...e};return za(t)&&(i.excludeFromOsnap=!0),ft(i,t,t.material),i}function qn(t){const e=se(t,t.geometry);if(e.positions.length===0)return;const{color:a,layer:r,linePattern:n}=ht(t.material),i=n?Ma(e.positions):void 0,o={layer:r,color:a,offset:St(t),linePattern:n,lineDistances:i,...e};return za(t)&&(o.excludeFromOsnap=!0),ft(o,t,t.material),o}function Zn(t){const e=se(t,t.geometry);if(e.positions.length!==0)return le(t.geometry,t.material,t,e,St(t))}function Qn(t){const e=se(t,t.geometry);if(e.positions.length===0)return;const a=le(t.geometry,t.material,t,e,St(t));if(a)return{points:!0,...a}}function ti(t){const e=[],a=[];return t.traverse(r=>{if(!(j.isHighlightOverlayDescendant(r)||j.isHighlightCloneDrawable(r))){if(r instanceof j.AcTrBatchedLine){const n=qn(r);n&&e.push(n);return}if(r instanceof j.AcTrBatchedLine2){const n=Jn(r);n&&e.push(n);return}if(r instanceof j.AcTrBatchedMesh){const n=Zn(r);n&&a.push(n);return}if(r instanceof j.AcTrBatchedPoint){const n=Qn(r);n&&a.push(n);return}if(r instanceof nr){if(!Ot(r))return;const n=Gn(r.geometry);if(n.positions.length===0)return;const i=Tt(r),{color:o,layer:l}=ht(i),{offset:s,...c}=Rt(r,n),d={layer:l,color:o,offset:s,lineWidth:Ca(i),...c};Ve(r)&&(d.excludeFromOsnap=!0),ft(d,r,i),e.push(d)}else if(r instanceof P.LineSegments&&!(r instanceof j.AcTrBatchedLine)){if(!Ot(r))return;const n=He(r.geometry);if(n.positions.length===0)return;const i=Tt(r),{color:o,layer:l,linePattern:s}=ht(i),{offset:c,...d}=Rt(r,n),u=s?Ma(d.positions):void 0,m={layer:l,color:o,offset:c,linePattern:s,lineDistances:u,...d};Ve(r)&&(m.excludeFromOsnap=!0),ft(m,r,i),e.push(m)}else if(r instanceof P.Mesh&&!(r instanceof j.AcTrBatchedMesh)){if(!Ot(r))return;const n=Tt(r);if(Tn(n))return;const i=He(r.geometry);if(i.positions.length===0)return;const{offset:o,...l}=Rt(r,i),s=le(r.geometry,n,r,l,o);s&&a.push(s)}}}),{lineBatches:e,meshBatches:a}}const Ye={size:8,colorCss:"#0080ff",hotColorCss:"#ff0000"};function Xe(t){const e=new sr(lr.ByACI,t);return e.cssColor??`rgb(${e.red}, ${e.green}, ${e.blue})`}function ei(t){try{const e=rr.instance(),a=e.getVar(Dt.GRIPSIZE,t),r=e.getVar(Dt.GRIPCOLOR,t),n=e.getVar(Dt.GRIPHOT,t);return!(a>0)||!Number.isFinite(a)?Ye:{size:a,colorCss:Xe(r),hotColorCss:Xe(n)}}catch{return Ye}}function Ge(t,e){const a=t.extmin,r=t.extmax,n=ei(t);return{title:e==null?void 0:e.title,extents:{minX:a.x,minY:a.y,maxX:r.x,maxY:r.y},units:{insunits:t.insunits,lunits:t.lunits,luprec:t.luprec,aunits:t.aunits,auprec:t.auprec,measurement:t.measurement,ltscale:t.ltscale,angbase:t.angbase,angdir:t.angdir},grip:n,background:(e==null?void 0:e.background)??0}}function Ke(t,e,a,r,n){return Math.atan2(r-e,n*(a-t))}function ce(t){return t.z>=0?1:-1}function Sa(t,e,a){if(!(a.radius>0)||!Number.isFinite(a.radius))return;const r=a.clockwise?-1:1,n=a.center.x,i=a.center.y;t.push({kind:"arc",layer:e,cx:n,cy:i,r:a.radius,startAngle:Ke(n,i,a.startPoint.x,a.startPoint.y,r),endAngle:Ke(n,i,a.endPoint.x,a.endPoint.y,r),normalSign:r})}function B(t,e){const a=new P.Vector3(e.x,e.y,e.z??0).applyMatrix4(t);return{x:a.x,y:a.y}}function ai(t){const e=t.elements;return new P.Matrix4(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])}function At(t,e){return new P.Matrix4().multiplyMatrices(t,ai(e))}function Fa(t,e){const a=new P.Vector3(e.x,e.y,e.z??0).transformDirection(t).normalize();return{x:a.x,y:a.y}}function Gt(t){const e=new P.Vector3(t.elements[0],t.elements[1],t.elements[2]).length(),a=new P.Vector3(t.elements[4],t.elements[5],t.elements[6]).length();return ot.equal(e,a,sa*Math.max(e,a,1))}function ri(t,e){const a=t.tables.blockTable.getIdAt(e);if(a)return a;for(const n of t.tables.blockTable.newIterator())if(n.objectId===e)return n;const r=t.tables.blockTable.modelSpace;if(r.objectId===e)return r}function ni(t){if(t instanceof Er)return!0;const e=t;return(e.type==="LINE"||e.type==="Line")&&e.startPoint!=null&&e.endPoint!=null}function ii(t,e,a,r){r.startPoint,r.endPoint}function Pa(t,e){return t.blockTableRecord??(t.blockName?e.tables.blockTable.getAt(t.blockName):void 0)}function oi(t,e){const a=t.dimBlockId;return a?e.tables.blockTable.getAt(a):void 0}function si(t,e){const a=Pa(t,e);if(a)return a;const r=t.owningBlockRecordId;return r?e.tables.blockTable.getAt(r):void 0}function La(t){return t.getFullInsertionTransform()}function li(t){for(const e of t.newIterator())return!0;return!1}function ci(t){return typeof t.getFullInsertionTransform=="function"&&"blockTableRecord"in t}function Z(t,e,a,r,n){if(r.length<2)return;const i=Gt(a),o=a.elements[0]*a.elements[5]-a.elements[4]*a.elements[1]<0?-1:1,l=[];for(const s of r){const c=B(a,s);let d=s.bulge??0;ot.isPositive(Math.abs(d))&&(d=i?d*o:0),l.push(c.x,c.y,d)}t.push({kind:"path",layer:e,closed:n,vertices:l})}function Ba(t,e){return ot.equal(t.x,e.x)&&ot.equal(t.y,e.y)}function di(t){return(t.clockwise?-1:1)*Math.tan(t.deltaAngle/4)}function We(t,e,a,r){if(t.length===0){t.push({x:e.x,y:e.y,z:e.z??0,bulge:r}),t.push({x:a.x,y:a.y,z:a.z??0,bulge:0});return}const n=t[t.length-1];Ba(n,e)?n.bulge=r:(n.bulge=0,t.push({x:e.x,y:e.y,z:e.z??0,bulge:r})),t.push({x:a.x,y:a.y,z:a.z??0,bulge:0})}function Je(t){return t.length>=2&&Ba(t[0],t[t.length-1])&&t.pop(),t}function mt(t,e,a,r,n){if(r.length<2)return;const i=n?r.length:r.length-1;for(let o=0;o<i;o++)r[o],r[(o+1)%r.length]}function ui(t,e,a,r){const n=[r.startPosition];for(const i of r.segments)n.push(i.position);mt(t,e,a,n,r.closed)}function mi(t,e,a){if(a.vertices.length>=2)return a.vertices;if(a.vertices.length===0)return[];const r=a.vertices[0],n=e.lastLeaderLinePoint??e.landingPoint??t.landingPoint??t.contentBasePosition;if(!n)return a.vertices;const i=r.x-n.x,o=r.y-n.y,l=(r.z??0)-(n.z??0);return Math.hypot(i,o,l)<=sa?a.vertices:[r,n]}function pi(t,e,a,r){var n,i;for(const l of r.leaders)for(const s of l.leaderLines){const c=mi(r,l,s);mt(t,e,a,c,!1)}const o=l=>{if(!l)return;const s=B(a,l);t.push({kind:"point",layer:e,x:s.x,y:s.y})};o(r.contentBasePosition),o((n=r.mtextContent)==null?void 0:n.anchorPoint),o((i=r.blockContent)==null?void 0:i.position)}function hi(t,e,a,r){const n=r.numberOfVertices;if(n<2)return;const i=r.elevation,o=r.closed?n:n-1;for(let l=0;l<o;l++){const s=r.getPointAt(l),c=r.getPointAt((l+1)%n),d=r.getBulgeAt(l),u={x:s.x,y:s.y,z:i},m={x:c.x,y:c.y,z:i};if(ot.isPositive(Math.abs(d))){const p=B(a,u),f=B(a,m);Sa(t,e,new qt(p,f,d))}}}function fi(t,e,a,r,n,i){const o=B(a,r),l=new P.Vector3(a.elements[0],a.elements[1],a.elements[2]).length(),s={kind:"circle",layer:e,cx:o.x,cy:o.y,r:n*l,normalSign:ce(i)};t.push(s)}function gi(t,e,a,r){const n=B(a,r.center),i=new P.Vector3(a.elements[0],a.elements[1],a.elements[2]).length(),o={kind:"arc",layer:e,cx:n.x,cy:n.y,r:r.radius*i,startAngle:r.startAngle,endAngle:r.endAngle,normalSign:ce(r.normal)};t.push(o)}function jt(t,e,a,r){const n=B(a,r.center),i=r._geo,o=(i==null?void 0:i.majorAxis)??{x:1,y:0,z:0},l=Fa(a,o),s=Math.hypot(l.x,l.y)||1,c=new P.Vector3(a.elements[0],a.elements[1],a.elements[2]).length(),d=new P.Vector3(a.elements[4],a.elements[5],a.elements[6]).length(),u={kind:"ellipse",layer:e,cx:n.x,cy:n.y,majorX:l.x/s,majorY:l.y/s,majorR:r.majorAxisRadius*c,minorR:r.minorAxisRadius*d,startAngle:r.startAngle,endAngle:r.endAngle,closed:r.closed,normalSign:ce(r.normal)};t.push(u)}function bi(t,e,a,r){var n,i;const o=r._geo;if(!((n=o==null?void 0:o.controlPoints)!=null&&n.length))return;const l=[];for(const c of o.controlPoints){const d=B(a,c);l.push(d.x,d.y)}const s={kind:"spline",layer:e,controlPoints:l,degree:o.degree??3,knots:[...o.knots??[]],weights:[...o.weights??[]],closed:o.closed??!1};if((i=o.fitPoints)!=null&&i.length){s.fitPoints=[];for(const c of o.fitPoints){const d=B(a,c);s.fitPoints.push(d.x,d.y)}}t.push(s)}const qe=1e-6;function wi(t){var e;const a=t.elevation,r=(e=t._geo)==null?void 0:e.vertices;return r&&r.length>1?r.map(n=>({x:n.x,y:n.y,z:a,bulge:n.bulge,startWidth:n.startWidth,endWidth:n.endWidth})):Array.from({length:t.numberOfVertices},(n,i)=>{const o=t.getPoint2dAt(i);return{x:o.x,y:o.y,z:a,bulge:0}})}function xi(t){return t.some(e=>{const a=Math.max(0,e.startWidth??0),r=Math.max(0,e.endWidth??0);return a>qe||r>qe})}function vi(t,e,a,r){const n=wi(r),i=n.length;if(i<2)return;if(xi(n)){Z(t,e,a,n,r.closed);return}const o=r.closed?i:i-1;for(let l=0;l<o;l++){const s=n[l],c=n[(l+1)%i],d=s.bulge??0;if(ot.isPositive(Math.abs(d))){const u=B(a,s),m=B(a,c);Sa(t,e,new qt(u,m,d))}}}function yi(t,e,a,r,n){const i=B(a,{x:r.center.x,y:r.center.y,z:n}),o=Fa(a,{x:Math.cos(r.rotation),y:Math.sin(r.rotation),z:0}),l=Math.hypot(o.x,o.y)||1,s=new P.Vector3(a.elements[0],a.elements[1],a.elements[2]).length(),c=new P.Vector3(a.elements[4],a.elements[5],a.elements[6]).length();t.push({kind:"ellipse",layer:e,cx:i.x,cy:i.y,majorX:o.x/l,majorY:o.y/l,majorR:r.majorAxisRadius*s,minorR:r.minorAxisRadius*c,startAngle:r.startAngle,endAngle:r.endAngle,closed:!1,normalSign:r.clockwise?-1:1})}function ki(t,e,a,r,n){var i;const o=r.numberOfVertices;if(o<2)return;const l=[];for(let s=0;s<o;s++){const c=r.getPointAt(s);l.push({x:c.x,y:c.y,z:n,bulge:((i=r.vertices[s])==null?void 0:i.bulge)??0})}Z(t,e,a,l,r.closed)}function Ai(t,e,a,r,n){if(r instanceof Ur){ki(t,e,a,r,n);return}if(!(r instanceof Nr))return;const i=[];let o=!1;const l=()=>{const c=Je(i);c.length>=2&&Z(t,e,a,c,!1),i.length=0};for(const c of r.curves)c instanceof Or?We(i,{x:c.startPoint.x,y:c.startPoint.y,z:n},{x:c.endPoint.x,y:c.endPoint.y,z:n},0):c instanceof qt?We(i,{x:c.startPoint.x,y:c.startPoint.y,z:n},{x:c.endPoint.x,y:c.endPoint.y,z:n},di(c)):c instanceof Tr&&(o=!0,l(),yi(t,e,a,c,n));const s=Je(i);s.length>=2&&Z(t,e,a,s,!o)}function Mi(t,e,a,r){var n;const i=(n=r._geo)==null?void 0:n.loops;if(!(i!=null&&i.length))return;const o=r.elevation;for(const l of i)Ai(t,e,a,l,o)}function zi(t,e,a,r){At(a,La(r));const n=[0];for(let o=0;o<r.numColumns;o++)n.push(n[o]+r.columnWidth(o));const i=[0];for(let o=0;o<r.numRows;o++)i.push(i[o]-r.rowHeight(o));n[n.length-1],i[i.length-1];for(const o of i);for(const o of n);}function Ci(t,e,a,r,n,i,o,l=!0){const s=Kt(t.layer,a);if(o&&!o(s))return;const c=si(t,i);if(c&&!n.has(c.objectId)&&li(c)){n.add(c.objectId);const u=At(e,La(t));Mt(c,u,s,r,n,i,o,l),n.delete(c.objectId);return}zi(r,s,e,t);const d=B(e,t.position);r.push({kind:"point",layer:s,x:d.x,y:d.y})}function Si(t,e,a,r){let n=r.boundaryPath();if(n.length>1){const o=n[0],l=n[n.length-1];o.x===l.x&&o.y===l.y&&(o.z??0)===(l.z??0)&&(n=n.slice(0,-1))}n.length>=2&&Z(t,e,a,n,!0);const i=B(a,r.position);t.push({kind:"point",layer:e,x:i.x,y:i.y})}function Fi(t,e,a,r){const n=r.position();Z(t,e,a,[n.upperLeft,n.upperRight,n.lowerRight,n.lowerLeft],!0);const i=B(a,r.getLocation());t.push({kind:"point",layer:e,x:i.x,y:i.y})}function Pi(t){var e;const a=(e=t.attributeIterator)==null?void 0:e.call(t);return a?typeof a.toArray=="function"?a.toArray():[...a]:[]}function Kt(t,e){return t==="0"?e:t}function Ia(t,e,a,r,n,i,o,l=!0){if(!t.visibility)return;const s=Kt(t.layer,a);if(!(o&&!o(s))){if(t instanceof dr){Ci(t,e,a,r,n,i,o,l);return}if(ci(t)){const c=Pa(t,i);if(!c||n.has(c.objectId))return;n.add(c.objectId);const d=t.getFullInsertionTransform(),u=Math.max(1,t.columnCount??1),m=Math.max(1,t.rowCount??1),p=t.columnSpacing??0,f=t.rowSpacing??0,h=Kt(t.layer,a);for(let w=0;w<m;w++)for(let A=0;A<u;A++){const M=At(e,d);(A!==0||w!==0)&&M.multiply(new P.Matrix4().makeTranslation(A*p,w*f,0));const I=B(M,{x:0,y:0,z:0});r.push({kind:"point",layer:h,x:I.x,y:I.y}),Mt(c,M,h,r,n,i,o,l)}for(const w of Pi(t))w instanceof ur,w.isInvisible||Ia(w,e,h,r,n,i,o,l);n.delete(c.objectId);return}if(t instanceof mr){const c=t,d=oi(c,i);if(!d||n.has(d.objectId))return;n.add(d.objectId);const u=At(e,c.getFullDimBlockTransform());Mt(d,u,s,r,n,i,o,!0),n.delete(d.objectId);return}if(ni(t)){ii(r,s,e,t);return}if(t instanceof pr){Gt(e)?fi(r,s,e,t.center,t.radius,t.normal):jt(r,s,e,Li(t));return}if(t instanceof hr){Gt(e)?gi(r,s,e,t):jt(r,s,e,Bi(t));return}if(t instanceof Jt){jt(r,s,e,t);return}if(t instanceof fr){bi(r,s,e,t);return}if(t instanceof gr){vi(r,s,e,t);return}if(t instanceof br){hi(r,s,e,t);return}if(t instanceof wr){const c=[];for(let d=0;d<t.numberOfVertices;d++)c.push(t.getPointAt(d));mt(r,s,e,c,t.closed);return}if(t instanceof xr){l&&Mi(r,s,e,t);return}if(t instanceof vr){t.basePoint,t.unitDir;return}if(t instanceof yr){t.basePoint,t.unitDir;return}if(t instanceof kr){Z(r,s,e,[t.getPointAt(0),t.getPointAt(1),t.getPointAt(3),t.getPointAt(2)],!0);return}if(t instanceof Ar){l&&Z(r,s,e,[t.getPointAt(0),t.getPointAt(1),t.getPointAt(3),t.getPointAt(2)],!0);return}if(t instanceof Mr){const c=t.subGetGripPoints();c.length>=2&&mt(r,s,e,c,c.length>=3);return}if(t instanceof zr){const c=t.vertices;c.length>=2&&mt(r,s,e,c,!1);return}if(t instanceof Cr){ui(r,s,e,t);return}if(t instanceof Sr){pi(r,s,e,t);return}if(t instanceof Fr){const c=B(e,t.position);r.push({kind:"point",layer:s,x:c.x,y:c.y});return}if(t instanceof Pr){const c=B(e,t.location);r.push({kind:"point",layer:s,x:c.x,y:c.y});return}if(t instanceof Lr){l&&Fi(r,s,e,t);return}if(t instanceof Br){l&&Si(r,s,e,t);return}if(t instanceof Ir){const c=B(e,t.position);r.push({kind:"point",layer:s,x:c.x,y:c.y})}}}function Mt(t,e,a,r,n,i,o,l=!0){for(const s of t.newIterator())Ia(s,e,a,r,n,i,o,l)}function Li(t){return new Jt(t.center,t.normal,{x:1,y:0,z:0},t.radius,t.radius,0,Dr)}function Bi(t){return new Jt(t.center,t.normal,{x:1,y:0,z:0},t.radius,t.radius,t.startAngle,t.endAngle)}function Ii(t,e,a={}){const r=ri(t,e);if(!r)return{primitives:[]};const n=[],i=new P.Matrix4;return Mt(r,i,"0",n,new Set,t,a.includeLayer),{primitives:n.filter(o=>o.kind!=="line"&&Ei(o))}}function Ei(t){switch(t.kind){case"line":return Number.isFinite(t.x0)&&Number.isFinite(t.y0)&&Number.isFinite(t.x1)&&Number.isFinite(t.y1);case"circle":return Number.isFinite(t.cx)&&Number.isFinite(t.cy)&&Number.isFinite(t.r);case"arc":return Number.isFinite(t.cx)&&Number.isFinite(t.cy)&&Number.isFinite(t.r)&&Number.isFinite(t.startAngle)&&Number.isFinite(t.endAngle);case"ellipse":return Number.isFinite(t.cx)&&Number.isFinite(t.cy)&&Number.isFinite(t.majorX)&&Number.isFinite(t.majorY)&&Number.isFinite(t.majorR)&&Number.isFinite(t.minorR)&&Number.isFinite(t.startAngle)&&Number.isFinite(t.endAngle);case"spline":return t.controlPoints.every(e=>Number.isFinite(e))&&t.knots.every(e=>Number.isFinite(e))&&t.weights.every(e=>Number.isFinite(e));case"point":return Number.isFinite(t.x)&&Number.isFinite(t.y);case"path":return t.vertices.length>=6&&t.vertices.length%3===0&&t.vertices.every(e=>Number.isFinite(e));default:return t}}const Di=["en","zh","cs","tr","ar"];function de(t){if(t==null||t==="")return null;const e=t.toLowerCase().replace("_","-");for(const a of Di)if(e===a||e.startsWith(`${a}-`))return a;return null}const Ui=1128612673;function Ni(t){const e=new ie;e.writeU32(Ui),e.writeU8(q),e.writeU8(0),e.writeU8(0),e.writeU8(0),e.writeString(t.layoutBtrId),e.writeU32(t.lineBatches.length);for(const a of t.lineBatches)wa(e,a);e.writeU32(t.meshBatches.length);for(const a of t.meshBatches)xa(e,a);return e.toUint8Array()}function Oi(t){const e=Ni(t),a=ae(e).bytes;return{uncompressed:e,compressed:a}}const Ti=1,Ri=2*1024*1024,Ft=2*1024*1024,ji=512*1024,_i=8*1024*1024,Ze=12*1024*1024,$i=2*1024*1024,Pt="drawing.acex.json",Hi=`./${Pt}`,Wt={layerOn:jr,layerOff:_r,chevronDown:Rr},Vi=[90,45,30,23,18,10,5];function Yi(){return`<div id="mlcad-polar-angles" role="group" data-i18n-attr="aria-label" data-i18n-key="settings.polarAngles" aria-label="Polar tracking angles" hidden>
2
+ ${Vi.map(t=>`<button type="button" class="mlcad-tool-btn mlcad-settings-option-btn mlcad-polar-angle-btn" data-polar-ang="${t}" title="${t}°" aria-label="${t}°"><span class="mlcad-settings-option-indicator" aria-hidden="true"></span><span class="mlcad-settings-option-text">${t}°</span></button>`).join("")}
3
+ </div>`}const Xi=600,Gi=960,ue=`
4
+ :root {
5
+ --mlcad-ui-bg: rgba(24, 26, 30, 0.94);
6
+ --mlcad-ui-bg-elevated: rgba(32, 35, 40, 0.98);
7
+ --mlcad-ui-border: rgba(255, 255, 255, 0.1);
8
+ --mlcad-ui-text: #e8eaed;
9
+ --mlcad-ui-muted: #9aa0a6;
10
+ --mlcad-accent: #08e8de;
11
+ --mlcad-accent-active: #1a8cff;
12
+ /* Shared measure-tool SVGs read --el-color-primary (Element Plus in cad-viewer). */
13
+ --el-color-primary: var(--mlcad-accent);
14
+ --ml-ui-accent: var(--mlcad-accent);
15
+ --ml-ui-bg: var(--mlcad-ui-bg);
16
+ --ml-ui-bg-elevated: var(--mlcad-ui-bg-elevated);
17
+ --ml-ui-border: var(--mlcad-ui-border);
18
+ --ml-ui-text: var(--mlcad-ui-text);
19
+ --ml-ui-muted: var(--mlcad-ui-muted);
20
+ --mlcad-tool-btn-active-border: rgba(26, 140, 255, 0.55);
21
+ --mlcad-tool-btn-active-bg: rgba(26, 140, 255, 0.22);
22
+ --mlcad-measure-accent: #08e8de;
23
+ --mlcad-measure-accent-border: rgba(8, 232, 222, 0.45);
24
+ --mlcad-measure-accent-fill: rgba(8, 232, 222, 0.2);
25
+ --mlcad-markup-accent: #e53935;
26
+ --mlcad-markup-accent-border: rgba(229, 57, 53, 0.45);
27
+ --mlcad-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
28
+ --mlcad-toolbar-width: 44px;
29
+ --mlcad-drawer-width: 220px;
30
+ --mlcad-drawer-gap: 8px;
31
+ --mlcad-ui-inset: 12px;
32
+ --mlcad-review-max-height: calc(100vh - 2 * var(--mlcad-ui-inset) - 48px);
33
+ --mlcad-z-chrome: 7;
34
+ /* Drawing overlays stay under chrome, session panel, and modal dialogs. */
35
+ --mlcad-z-measure: 1;
36
+ --mlcad-z-markup: 2;
37
+ --ml-ui-grip-size: 8px;
38
+ --ml-ui-grip-normal: #0080ff;
39
+ --ml-ui-grip-hot: #ff0000;
40
+ }
41
+ html, body {
42
+ margin: 0; height: 100%; overflow: hidden;
43
+ background: #121418;
44
+ font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
45
+ color: var(--mlcad-ui-text);
46
+ }
47
+ #mlcad-root { position: relative; width: 100%; height: 100%; }
48
+ #mlcad-canvas-host {
49
+ position: absolute;
50
+ inset: 0;
51
+ min-width: 0;
52
+ min-height: 0;
53
+ -webkit-touch-callout: none;
54
+ -webkit-tap-highlight-color: transparent;
55
+ }
56
+ #mlcad-canvas-host canvas,
57
+ #mlcad-root > canvas {
58
+ display: block;
59
+ width: 100%;
60
+ height: 100%;
61
+ touch-action: none;
62
+ -webkit-user-select: none;
63
+ user-select: none;
64
+ -webkit-touch-callout: none;
65
+ -webkit-tap-highlight-color: transparent;
66
+ }
67
+
68
+ .mlcad-snap-loupe {
69
+ position: absolute;
70
+ left: 8px;
71
+ top: 8px;
72
+ width: 128px;
73
+ height: 128px;
74
+ box-sizing: border-box;
75
+ border: 2px solid var(--mlcad-measure-accent, #08e8de);
76
+ border-radius: 2px;
77
+ pointer-events: none;
78
+ z-index: 8;
79
+ overflow: hidden;
80
+ box-shadow: var(--mlcad-shadow);
81
+ }
82
+
83
+ html[data-mlcad-theme="light"] {
84
+ --mlcad-ui-bg: rgba(255, 255, 255, 0.94);
85
+ --mlcad-ui-bg-elevated: rgba(248, 249, 250, 0.98);
86
+ --mlcad-ui-border: rgba(0, 0, 0, 0.12);
87
+ --mlcad-ui-text: #202124;
88
+ --mlcad-ui-muted: #5f6368;
89
+ --mlcad-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
90
+ }
91
+ html[data-mlcad-theme="light"],
92
+ html[data-mlcad-theme="light"] body {
93
+ background: #e8eaed;
94
+ color: var(--mlcad-ui-text);
95
+ }
96
+
97
+ #mlcad-sidebar {
98
+ position: absolute;
99
+ left: var(--mlcad-ui-inset);
100
+ top: 50%;
101
+ z-index: var(--mlcad-z-chrome);
102
+ transform: translateY(-50%);
103
+ display: flex;
104
+ align-items: flex-start;
105
+ gap: var(--mlcad-drawer-gap);
106
+ max-width: calc(100% - 2 * var(--mlcad-ui-inset));
107
+ box-sizing: border-box;
108
+ pointer-events: none;
109
+ }
110
+ #mlcad-sidebar > * { pointer-events: auto; }
111
+
112
+ #mlcad-toolbar {
113
+ flex-shrink: 0;
114
+ display: flex;
115
+ flex-direction: column;
116
+ align-items: stretch;
117
+ padding: 0;
118
+ background: transparent;
119
+ border: none;
120
+ border-radius: 0;
121
+ box-shadow: none;
122
+ backdrop-filter: none;
123
+ }
124
+ /* AcUiToolbar chrome replaces the old .mlcad-tool-btn shell styles. */
125
+ #mlcad-toolbar .ml-ex-ui-toolbar {
126
+ position: relative !important;
127
+ inset: auto !important;
128
+ left: auto !important;
129
+ top: auto !important;
130
+ right: auto !important;
131
+ bottom: auto !important;
132
+ transform: none !important;
133
+ background: var(--mlcad-ui-bg);
134
+ border: 1px solid var(--mlcad-ui-border);
135
+ border-radius: 8px;
136
+ box-shadow: var(--mlcad-shadow);
137
+ backdrop-filter: blur(12px);
138
+ --ml-ex-ui-toolbar-btn-size: var(--mlcad-toolbar-width);
139
+ }
140
+ #mlcad-toolbar .ml-ex-ui-toolbar.is-left,
141
+ #mlcad-toolbar .ml-ex-ui-toolbar.is-right {
142
+ flex-direction: column;
143
+ }
144
+ #mlcad-toolbar .ml-ex-ui-toolbar.is-bottom,
145
+ #mlcad-toolbar .ml-ex-ui-toolbar.is-top {
146
+ flex-direction: row;
147
+ width: 100%;
148
+ box-sizing: border-box;
149
+ }
150
+ #mlcad-sidebar > #mlcad-toolbar.ml-ex-ui-toolbar-host {
151
+ display: flex;
152
+ flex-direction: column;
153
+ align-items: stretch;
154
+ }
155
+ /* Phone strips mount on #mlcad-root so they can sit above the bottom bar. */
156
+ #mlcad-root > .ml-ex-ui-subtoolbar {
157
+ z-index: calc(var(--mlcad-z-chrome) + 1);
158
+ }
159
+ .mlcad-tool-btn {
160
+ position: relative;
161
+ display: flex; flex-direction: column; align-items: center; justify-content: center;
162
+ gap: 2px;
163
+ width: var(--mlcad-toolbar-width); height: var(--mlcad-toolbar-width);
164
+ margin: 0; padding: 0;
165
+ border: 1px solid transparent;
166
+ border-radius: 6px;
167
+ background: transparent;
168
+ color: var(--mlcad-ui-text);
169
+ cursor: pointer;
170
+ transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
171
+ }
172
+ .mlcad-tool-btn:hover {
173
+ background: rgba(255, 255, 255, 0.08);
174
+ border-color: var(--mlcad-ui-border);
175
+ }
176
+ .mlcad-tool-btn.active,
177
+ .mlcad-tool-btn.is-menu-open {
178
+ background: var(--mlcad-tool-btn-active-bg);
179
+ border-color: var(--mlcad-tool-btn-active-border);
180
+ color: #fff;
181
+ }
182
+ .mlcad-tool-btn-icon {
183
+ display: inline-flex;
184
+ align-items: center;
185
+ justify-content: center;
186
+ width: 20px;
187
+ height: 20px;
188
+ flex-shrink: 0;
189
+ }
190
+ .mlcad-tool-btn-icon svg,
191
+ .mlcad-tool-btn svg {
192
+ width: 20px; height: 20px; display: block; flex-shrink: 0;
193
+ }
194
+ .mlcad-tool-btn-label {
195
+ display: none;
196
+ max-width: 100%;
197
+ overflow: hidden;
198
+ text-overflow: ellipsis;
199
+ white-space: nowrap;
200
+ font-size: 10px;
201
+ line-height: 1.2;
202
+ text-align: center;
203
+ pointer-events: none;
204
+ }
205
+ /* Settings is always on the bar (desktop/pad/phone); language lives under it. */
206
+ /* Flyout mark: opaque corner triangle (cad-simple-ui-plugin is-left style). */
207
+ .mlcad-tool-btn.has-children::after {
208
+ content: '';
209
+ position: absolute;
210
+ right: 1px;
211
+ bottom: 1px;
212
+ width: 6px;
213
+ height: 6px;
214
+ background: currentColor;
215
+ clip-path: polygon(100% 100%, 0 100%, 100% 0);
216
+ pointer-events: none;
217
+ }
218
+ .mlcad-dropdown {
219
+ position: fixed;
220
+ z-index: 40;
221
+ min-width: 180px;
222
+ max-width: min(280px, calc(100vw - 24px));
223
+ max-height: min(360px, calc(100vh - 24px));
224
+ overflow-y: auto;
225
+ padding: 4px;
226
+ background: var(--mlcad-ui-bg-elevated);
227
+ border: 1px solid var(--mlcad-ui-border);
228
+ border-radius: 8px;
229
+ box-shadow: var(--mlcad-shadow);
230
+ backdrop-filter: blur(12px);
231
+ }
232
+ .mlcad-dropdown-item {
233
+ display: flex;
234
+ align-items: center;
235
+ gap: 8px;
236
+ width: 100%;
237
+ box-sizing: border-box;
238
+ margin: 0;
239
+ padding: 6px 8px;
240
+ border: none;
241
+ border-radius: 5px;
242
+ background: transparent;
243
+ color: var(--mlcad-ui-text);
244
+ font-size: 12px;
245
+ font-weight: 500;
246
+ text-align: left;
247
+ cursor: pointer;
248
+ }
249
+ .mlcad-dropdown-item:hover {
250
+ background: rgba(255, 255, 255, 0.08);
251
+ }
252
+ .mlcad-dropdown-item.active,
253
+ .mlcad-dropdown-item.is-toggled {
254
+ background: rgba(26, 140, 255, 0.22);
255
+ color: #fff;
256
+ }
257
+ .mlcad-dropdown-icon {
258
+ display: inline-flex;
259
+ width: 18px;
260
+ height: 18px;
261
+ flex-shrink: 0;
262
+ align-items: center;
263
+ justify-content: center;
264
+ }
265
+ .mlcad-dropdown-icon svg {
266
+ width: 18px;
267
+ height: 18px;
268
+ display: block;
269
+ }
270
+ .mlcad-dropdown-label {
271
+ overflow: hidden;
272
+ text-overflow: ellipsis;
273
+ white-space: nowrap;
274
+ }
275
+ .mlcad-dropdown-separator {
276
+ height: 1px;
277
+ margin: 4px 6px;
278
+ background: var(--mlcad-ui-border);
279
+ }
280
+ #mlcad-toolbar-toggle {
281
+ height: calc(var(--mlcad-toolbar-width) / 2);
282
+ margin-top: -4px;
283
+ margin-bottom: -4px;
284
+ border-radius: 4px;
285
+ }
286
+ #mlcad-toolbar-toggle svg {
287
+ width: calc(var(--mlcad-toolbar-width) / 2);
288
+ height: calc(var(--mlcad-toolbar-width) / 2);
289
+ }
290
+ .mlcad-tool-separator {
291
+ height: 1px;
292
+ margin: 4px 8px;
293
+ background: var(--mlcad-ui-border);
294
+ }
295
+ .mlcad-locale-option-badge {
296
+ display: inline-flex;
297
+ align-items: center;
298
+ justify-content: center;
299
+ width: 100%;
300
+ height: 100%;
301
+ font-size: 12px;
302
+ font-weight: 700;
303
+ line-height: 1;
304
+ letter-spacing: -0.04em;
305
+ user-select: none;
306
+ }
307
+ #mlcad-zoom-window-rect,
308
+ #mlcad-selection-rect {
309
+ position: fixed;
310
+ z-index: 25;
311
+ box-sizing: border-box;
312
+ pointer-events: none;
313
+ border: 1px dashed var(--mlcad-accent, #08e8de);
314
+ background: rgba(8, 232, 222, 0.12);
315
+ }
316
+ #mlcad-zoom-window-rect[hidden],
317
+ #mlcad-selection-rect[hidden] { display: none; }
318
+ #mlcad-selection-rect[data-mode='window'] {
319
+ border-style: solid;
320
+ border-color: #00ff5a;
321
+ background: rgba(64, 158, 255, 0.12);
322
+ }
323
+ #mlcad-selection-rect[data-mode='crossing'] {
324
+ border-style: dashed;
325
+ border-color: #00d1ff;
326
+ background: rgba(64, 158, 255, 0.12);
327
+ }
328
+
329
+ #mlcad-layer-drawer,
330
+ #mlcad-review-drawer,
331
+ #mlcad-measure-drawer {
332
+ flex-shrink: 1;
333
+ min-width: 0;
334
+ width: var(--mlcad-drawer-width);
335
+ max-height: min(420px, var(--mlcad-review-max-height));
336
+ display: flex; flex-direction: column;
337
+ background: var(--mlcad-ui-bg-elevated);
338
+ border: 1px solid var(--mlcad-ui-border);
339
+ border-radius: 8px;
340
+ box-shadow: var(--mlcad-shadow);
341
+ backdrop-filter: blur(12px);
342
+ overflow: hidden;
343
+ box-sizing: border-box;
344
+ }
345
+ #mlcad-markup-strip-wrap {
346
+ position: relative;
347
+ }
348
+ #mlcad-review-drawer {
349
+ position: absolute;
350
+ left: 100%;
351
+ top: 0;
352
+ margin-left: var(--mlcad-drawer-gap);
353
+ width: min(320px, calc(100vw - 2 * var(--mlcad-ui-inset) - var(--mlcad-toolbar-width) - var(--mlcad-drawer-gap)));
354
+ height: 100%;
355
+ max-height: var(--mlcad-review-max-height);
356
+ }
357
+ #mlcad-layer-drawer[hidden],
358
+ #mlcad-review-drawer[hidden],
359
+ #mlcad-measure-drawer[hidden] { display: none; }
360
+
361
+ .mlcad-drawer-header {
362
+ display: flex; align-items: center; justify-content: space-between;
363
+ gap: 6px; padding: 8px 10px;
364
+ border-bottom: 1px solid var(--mlcad-ui-border);
365
+ font-size: 13px; font-weight: 600;
366
+ }
367
+ .mlcad-drawer-close {
368
+ width: 28px; height: 28px; padding: 0;
369
+ border: none; border-radius: 4px;
370
+ background: transparent; color: var(--mlcad-ui-muted);
371
+ cursor: pointer; font-size: 18px; line-height: 1;
372
+ }
373
+ .mlcad-drawer-close:hover {
374
+ background: rgba(255, 255, 255, 0.08); color: var(--mlcad-ui-text);
375
+ }
376
+
377
+ .mlcad-drawer-sheet-chrome {
378
+ display: none;
379
+ position: relative;
380
+ }
381
+ .mlcad-drawer-grabber {
382
+ flex: 1 1 auto;
383
+ display: flex;
384
+ align-items: center;
385
+ justify-content: center;
386
+ min-height: 20px;
387
+ cursor: ns-resize;
388
+ touch-action: none;
389
+ }
390
+ .mlcad-drawer-grabber::before {
391
+ content: '';
392
+ position: absolute;
393
+ left: 50%;
394
+ top: 50%;
395
+ transform: translate(-50%, -50%);
396
+ width: 36px;
397
+ height: 4px;
398
+ border-radius: 2px;
399
+ background: var(--mlcad-ui-muted);
400
+ opacity: 0.75;
401
+ }
402
+ .mlcad-drawer-sheet-close {
403
+ width: 36px; height: 28px; padding: 0;
404
+ border: none; background: transparent;
405
+ color: var(--mlcad-ui-muted); cursor: pointer;
406
+ display: inline-flex; align-items: center; justify-content: center;
407
+ flex: 0 0 auto;
408
+ position: relative;
409
+ z-index: 1;
410
+ }
411
+ .mlcad-drawer-sheet-close:hover { color: var(--mlcad-ui-text); }
412
+ .mlcad-drawer-sheet-close svg { width: 18px; height: 18px; }
413
+
414
+ .mlcad-layer-actions {
415
+ display: flex; gap: 4px; padding: 6px 8px;
416
+ border-bottom: 1px solid var(--mlcad-ui-border);
417
+ }
418
+ .mlcad-layer-action-btn {
419
+ flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
420
+ min-height: 30px; padding: 4px 8px;
421
+ border: 1px solid var(--mlcad-ui-border);
422
+ border-radius: 5px;
423
+ background: rgba(255, 255, 255, 0.04);
424
+ color: var(--mlcad-ui-text);
425
+ font-size: 12px; cursor: pointer;
426
+ }
427
+ .mlcad-layer-action-btn:hover { background: rgba(255, 255, 255, 0.1); }
428
+ .mlcad-layer-action-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
429
+
430
+ #mlcad-layer-list {
431
+ flex: 1; overflow: auto; padding: 4px 0;
432
+ }
433
+ .mlcad-layer-item {
434
+ display: grid;
435
+ grid-template-columns: auto auto 1fr auto;
436
+ align-items: center; gap: 6px;
437
+ padding: 5px 8px;
438
+ font-size: 12px; cursor: pointer;
439
+ }
440
+ .mlcad-layer-item:hover { background: rgba(255, 255, 255, 0.05); }
441
+ .mlcad-layer-item input { margin: 0; cursor: pointer; }
442
+ .mlcad-layer-swatch {
443
+ width: 12px; height: 12px; border-radius: 2px;
444
+ border: 1px solid rgba(255, 255, 255, 0.28);
445
+ }
446
+ .mlcad-layer-name {
447
+ overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
448
+ }
449
+ .mlcad-layer-zoom {
450
+ display: flex; align-items: center; justify-content: center;
451
+ width: 22px; height: 22px; padding: 0;
452
+ border: 1px solid transparent; border-radius: 4px;
453
+ background: transparent; color: var(--mlcad-ui-muted);
454
+ cursor: pointer;
455
+ }
456
+ .mlcad-layer-zoom svg {
457
+ width: 14px; height: 14px; display: block;
458
+ }
459
+ .mlcad-layer-zoom:hover:not(:disabled) {
460
+ color: var(--mlcad-accent);
461
+ border-color: var(--mlcad-ui-border);
462
+ background: rgba(255, 255, 255, 0.06);
463
+ }
464
+ .mlcad-layer-zoom:disabled { opacity: 0.35; cursor: not-allowed; }
465
+
466
+ .mlcad-review-toolbar {
467
+ display: flex; gap: 6px; align-items: center;
468
+ padding: 6px 8px;
469
+ border-bottom: 1px solid var(--mlcad-ui-border);
470
+ }
471
+ .mlcad-review-search {
472
+ flex: 1; min-width: 0;
473
+ box-sizing: border-box;
474
+ padding: 4px 8px;
475
+ border: 1px solid var(--mlcad-ui-border);
476
+ border-radius: 4px;
477
+ background: rgba(255, 255, 255, 0.04);
478
+ color: var(--mlcad-ui-text);
479
+ font-size: 12px;
480
+ }
481
+ .mlcad-review-clear,
482
+ .mlcad-review-zoom,
483
+ .mlcad-review-delete {
484
+ flex: 0 0 auto;
485
+ padding: 4px 8px;
486
+ border: 1px solid var(--mlcad-ui-border);
487
+ border-radius: 4px;
488
+ background: rgba(255, 255, 255, 0.04);
489
+ color: var(--mlcad-ui-text);
490
+ font-size: 12px; cursor: pointer;
491
+ }
492
+ .mlcad-review-clear:disabled { opacity: 0.5; cursor: default; }
493
+ .mlcad-review-delete { color: #f56c6c; border-color: rgba(245, 108, 108, 0.55); }
494
+ .mlcad-review-table-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; }
495
+ .mlcad-review-table {
496
+ width: 100%; border-collapse: collapse; font-size: 12px;
497
+ }
498
+ .mlcad-review-table th,
499
+ .mlcad-review-table td {
500
+ padding: 4px 8px; text-align: left;
501
+ border-bottom: 1px solid var(--mlcad-ui-border);
502
+ overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
503
+ max-width: 90px;
504
+ }
505
+ .mlcad-review-table tr.is-selected td {
506
+ background: rgba(26, 140, 255, 0.22);
507
+ }
508
+ .mlcad-review-table tr { cursor: pointer; }
509
+ .mlcad-review-empty td { text-align: center; color: var(--mlcad-ui-muted); cursor: default; }
510
+ .mlcad-review-detail {
511
+ flex: 0 1 auto;
512
+ max-height: 52%;
513
+ overflow: auto;
514
+ border-top: 1px solid var(--mlcad-ui-border);
515
+ padding: 8px 10px 14px;
516
+ display: flex; flex-direction: column; gap: 6px;
517
+ box-sizing: border-box;
518
+ }
519
+ .mlcad-review-detail[hidden] { display: none; }
520
+ .mlcad-review-detail-header {
521
+ display: flex; align-items: center; justify-content: space-between; gap: 4px;
522
+ }
523
+ .mlcad-review-detail-title { font-weight: 600; font-size: 12px; }
524
+ .mlcad-review-detail-close {
525
+ flex-shrink: 0;
526
+ width: 24px; height: 24px; padding: 0;
527
+ border: none; border-radius: 4px;
528
+ background: transparent; color: var(--mlcad-ui-muted);
529
+ cursor: pointer; font-size: 16px; line-height: 1;
530
+ }
531
+ .mlcad-review-detail-close:hover {
532
+ background: rgba(255, 255, 255, 0.08); color: var(--mlcad-ui-text);
533
+ }
534
+ .mlcad-review-field { display: flex; flex-direction: column; gap: 2px; }
535
+ .mlcad-review-field-label { font-size: 11px; color: var(--mlcad-ui-muted); }
536
+ .mlcad-review-status,
537
+ .mlcad-review-author,
538
+ .mlcad-review-text,
539
+ .mlcad-review-comment {
540
+ box-sizing: border-box; width: 100%;
541
+ padding: 4px 6px;
542
+ border: 1px solid var(--mlcad-ui-border);
543
+ border-radius: 4px;
544
+ background: rgba(255, 255, 255, 0.04);
545
+ color: var(--mlcad-ui-text);
546
+ font-size: 12px;
547
+ }
548
+ .mlcad-review-author:disabled { opacity: 0.7; }
549
+ .mlcad-review-comment { min-height: 44px; resize: vertical; }
550
+ .mlcad-review-detail-actions { display: flex; gap: 6px; margin-top: 2px; }
551
+
552
+ .mlcad-measure-toolbar {
553
+ display: flex; gap: 8px; align-items: center;
554
+ padding: 8px 10px; border-bottom: 1px solid var(--mlcad-ui-border);
555
+ }
556
+ .mlcad-measure-filter {
557
+ flex: 1 1 auto; min-width: 0;
558
+ display: flex; overflow: hidden;
559
+ border: 1px solid var(--mlcad-ui-border); border-radius: 4px;
560
+ }
561
+ .mlcad-measure-filter-btn {
562
+ flex: 1 1 0; min-width: 0; padding: 4px 2px;
563
+ border: none; border-right: 1px solid var(--mlcad-ui-border);
564
+ background: transparent; color: var(--mlcad-ui-text);
565
+ font: inherit; font-size: 11px; cursor: pointer;
566
+ white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
567
+ }
568
+ .mlcad-measure-filter-btn:last-child { border-right: none; }
569
+ .mlcad-measure-filter-btn:hover:not(.is-active) {
570
+ background: rgba(255, 255, 255, 0.06);
571
+ }
572
+ .mlcad-measure-filter-btn.is-active {
573
+ background: rgba(8, 232, 222, 0.18);
574
+ }
575
+ .mlcad-measure-clear,
576
+ .mlcad-measure-row-delete {
577
+ border: 1px solid var(--mlcad-ui-border); border-radius: 4px;
578
+ background: rgba(255, 255, 255, 0.04); color: var(--mlcad-ui-text);
579
+ padding: 4px 8px; font-size: 12px; cursor: pointer;
580
+ }
581
+ .mlcad-measure-clear:disabled { opacity: 0.5; cursor: default; }
582
+ .mlcad-measure-row-delete { color: #f56c6c; border-color: rgba(245, 108, 108, 0.55); padding: 2px 6px; font-size: 11px; }
583
+ .mlcad-measure-table-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; }
584
+ .mlcad-measure-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
585
+ .mlcad-measure-table th,
586
+ .mlcad-measure-table td {
587
+ padding: 6px 8px; text-align: left; font-size: 12px;
588
+ border-bottom: 1px solid var(--mlcad-ui-border);
589
+ overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
590
+ }
591
+ .mlcad-measure-table tr.is-selected td {
592
+ background: rgba(8, 232, 222, 0.12);
593
+ }
594
+ .mlcad-measure-table tr { cursor: pointer; }
595
+ .mlcad-measure-empty td { text-align: center; color: var(--mlcad-ui-muted); cursor: default; }
596
+ #mlcad-measure-strip-wrap { position: relative; }
597
+ #mlcad-measure-drawer {
598
+ position: absolute;
599
+ left: 100%;
600
+ top: 0;
601
+ margin-left: var(--mlcad-drawer-gap);
602
+ width: min(320px, calc(100vw - 2 * var(--mlcad-ui-inset) - var(--mlcad-toolbar-width) - var(--mlcad-drawer-gap)));
603
+ height: 100%;
604
+ max-height: var(--mlcad-review-max-height);
605
+ }
606
+
607
+ /*
608
+ * Top canvas chrome: message bar + expiry share one row. Shortcut toolbar
609
+ * and snap loupe stack below (see AcExHtmlTopChrome / ShortCutToolbar /
610
+ * SnapLoupeMath).
611
+ */
612
+ #mlcad-top-chrome {
613
+ position: absolute;
614
+ left: 12px;
615
+ right: 12px;
616
+ top: 10px;
617
+ z-index: var(--mlcad-z-chrome);
618
+ display: flex;
619
+ align-items: flex-start;
620
+ gap: 8px;
621
+ box-sizing: border-box;
622
+ pointer-events: none;
623
+ }
624
+ #mlcad-status-bar {
625
+ position: relative;
626
+ flex: 1 1 auto;
627
+ min-width: 0;
628
+ /* Block layout so text-overflow: ellipsis works on direct textContent. */
629
+ display: block;
630
+ min-height: 28px;
631
+ line-height: 28px;
632
+ padding: 0 12px;
633
+ border: 1px solid rgba(0, 0, 0, 0.12);
634
+ border-radius: 6px;
635
+ background: var(--mlcad-accent);
636
+ color: #0b1f1e;
637
+ font-size: 12px;
638
+ font-weight: 600;
639
+ box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
640
+ backdrop-filter: blur(10px);
641
+ pointer-events: none;
642
+ opacity: 1;
643
+ transform: translateY(0);
644
+ transition: opacity 0.18s ease, transform 0.18s ease;
645
+ /* Shrink before the expiry badge; clip with an ellipsis when too narrow. */
646
+ overflow: hidden;
647
+ white-space: nowrap;
648
+ text-overflow: ellipsis;
649
+ }
650
+ #mlcad-status-bar:empty,
651
+ #mlcad-status-bar[hidden] {
652
+ display: none;
653
+ opacity: 0;
654
+ transform: translateY(-6px);
655
+ }
656
+
657
+ /* Session panel DOM/CSS comes from shared AcUiMobileSessionPanel. */
658
+ #mlcad-root {
659
+ --ml-mobile-cmd-collapsed-height: var(--mlcad-toolbar-phone-height, 56px);
660
+ }
661
+ .ml-mobile-cmd-panel {
662
+ z-index: calc(var(--mlcad-z-chrome) + 3);
663
+ }
664
+
665
+ #mlcad-sidebar.mlcad-sidebar--collapsed #mlcad-snap-strip-wrap,
666
+ #mlcad-sidebar.mlcad-sidebar--collapsed #mlcad-measure-strip-wrap,
667
+ #mlcad-sidebar.mlcad-sidebar--collapsed #mlcad-markup-strip-wrap,
668
+ #mlcad-sidebar.mlcad-sidebar--collapsed #mlcad-zoom-strip-wrap,
669
+ #mlcad-sidebar.mlcad-sidebar--collapsed #mlcad-settings-strip-wrap,
670
+ #mlcad-sidebar.mlcad-sidebar--collapsed #mlcad-locale-strip-wrap,
671
+ #mlcad-sidebar.mlcad-sidebar--collapsed #mlcad-layer-drawer,
672
+ #mlcad-sidebar.mlcad-sidebar--collapsed #mlcad-review-drawer,
673
+ #mlcad-sidebar.mlcad-sidebar--collapsed #mlcad-measure-drawer {
674
+ display: none !important;
675
+ }
676
+ #mlcad-sidebar.mlcad-sidebar--collapsed #mlcad-toolbar .mlcad-tool-btn:not(#mlcad-toolbar-toggle) {
677
+ display: none;
678
+ }
679
+ #mlcad-sidebar.mlcad-sidebar--collapsed #mlcad-toolbar .mlcad-tool-separator {
680
+ display: none;
681
+ }
682
+
683
+ #mlcad-snap-strip-wrap,
684
+ #mlcad-measure-strip-wrap,
685
+ #mlcad-markup-strip-wrap,
686
+ #mlcad-zoom-strip-wrap,
687
+ #mlcad-settings-strip-wrap,
688
+ #mlcad-locale-strip-wrap {
689
+ flex-shrink: 0;
690
+ min-width: 0;
691
+ display: flex;
692
+ flex-direction: row;
693
+ align-items: flex-start;
694
+ gap: var(--mlcad-drawer-gap);
695
+ }
696
+ #mlcad-snap-strip-wrap[hidden],
697
+ #mlcad-measure-strip-wrap[hidden],
698
+ #mlcad-markup-strip-wrap[hidden],
699
+ #mlcad-zoom-strip-wrap[hidden],
700
+ #mlcad-settings-strip-wrap[hidden],
701
+ #mlcad-locale-strip-wrap[hidden] { display: none; }
702
+
703
+ #mlcad-snap-strip,
704
+ #mlcad-measure-strip,
705
+ #mlcad-markup-strip,
706
+ #mlcad-zoom-strip,
707
+ #mlcad-settings-strip,
708
+ #mlcad-locale-strip {
709
+ flex-shrink: 0;
710
+ display: flex;
711
+ flex-direction: column;
712
+ align-items: stretch;
713
+ gap: 4px;
714
+ padding: 6px;
715
+ background: var(--mlcad-ui-bg);
716
+ border: 1px solid var(--mlcad-ui-border);
717
+ border-radius: 8px;
718
+ box-shadow: var(--mlcad-shadow);
719
+ backdrop-filter: blur(12px);
720
+ }
721
+ /* Pad/desktop: same button size as the parent bar so a vertical strip
722
+ matches its width and a horizontal strip matches its height. */
723
+ #mlcad-snap-strip .mlcad-tool-btn,
724
+ #mlcad-measure-strip .mlcad-tool-btn,
725
+ #mlcad-markup-strip .mlcad-tool-btn,
726
+ #mlcad-zoom-strip .mlcad-tool-btn,
727
+ #mlcad-settings-strip .mlcad-tool-btn,
728
+ #mlcad-locale-strip .mlcad-tool-btn {
729
+ width: var(--mlcad-toolbar-width);
730
+ height: var(--mlcad-toolbar-width);
731
+ }
732
+ #mlcad-measure-strip .mlcad-tool-separator,
733
+ #mlcad-markup-strip .mlcad-tool-separator {
734
+ margin: 2px 4px;
735
+ }
736
+
737
+ #mlcad-polar-angles {
738
+ flex-shrink: 0;
739
+ display: inline-flex;
740
+ flex-direction: column;
741
+ align-items: stretch;
742
+ gap: 4px;
743
+ padding: 6px;
744
+ max-width: min(280px, calc(100vw - 2 * var(--mlcad-ui-inset) - 3 * var(--mlcad-toolbar-width) - 3 * var(--mlcad-drawer-gap)));
745
+ background: var(--mlcad-ui-bg);
746
+ border: 1px solid var(--mlcad-ui-border);
747
+ border-radius: 8px;
748
+ box-shadow: var(--mlcad-shadow);
749
+ backdrop-filter: blur(12px);
750
+ }
751
+ #mlcad-polar-angles[hidden] { display: none; }
752
+
753
+ .mlcad-color-input {
754
+ position: absolute;
755
+ width: 0;
756
+ height: 0;
757
+ opacity: 0;
758
+ pointer-events: none;
759
+ }
760
+ .mlcad-settings-option-btn {
761
+ width: 100%;
762
+ box-sizing: border-box;
763
+ height: var(--mlcad-toolbar-width);
764
+ justify-content: flex-start;
765
+ gap: 8px;
766
+ padding: 0 10px;
767
+ font-size: 11px;
768
+ font-weight: 500;
769
+ }
770
+ .mlcad-settings-option-indicator {
771
+ flex-shrink: 0;
772
+ width: 10px;
773
+ height: 10px;
774
+ border: 1px solid var(--mlcad-ui-muted);
775
+ border-radius: 2px;
776
+ box-sizing: border-box;
777
+ transition: background 0.15s ease, border-color 0.15s ease;
778
+ }
779
+ .mlcad-settings-option-btn.active .mlcad-settings-option-indicator {
780
+ background: var(--mlcad-accent);
781
+ border-color: var(--mlcad-accent);
782
+ }
783
+ .mlcad-settings-option-text {
784
+ overflow: hidden;
785
+ text-overflow: ellipsis;
786
+ white-space: nowrap;
787
+ pointer-events: none;
788
+ line-height: 1.2;
789
+ }
790
+
791
+ #mlcad-measure-overlays {
792
+ position: absolute;
793
+ inset: 0;
794
+ pointer-events: none;
795
+ z-index: var(--mlcad-z-measure);
796
+ overflow: hidden;
797
+ }
798
+ .mlcad-measure-canvas {
799
+ position: absolute;
800
+ left: 0;
801
+ top: 0;
802
+ z-index: 1;
803
+ pointer-events: none;
804
+ }
805
+ .mlcad-measure-dot {
806
+ position: absolute;
807
+ z-index: 3;
808
+ width: 10px;
809
+ height: 10px;
810
+ border-radius: 50%;
811
+ background: var(--mlcad-measure-accent);
812
+ border: 2px solid rgba(255, 255, 255, 0.9);
813
+ box-sizing: border-box;
814
+ transform: translate(-50%, -50%);
815
+ visibility: hidden;
816
+ pointer-events: none;
817
+ cursor: grab;
818
+ }
819
+ .mlcad-measure-dot.mlcad-measure-selected {
820
+ visibility: visible;
821
+ pointer-events: auto;
822
+ box-shadow:
823
+ 0 0 0 2px rgba(255, 213, 79, 0.75),
824
+ 0 0 10px rgba(255, 213, 79, 0.95),
825
+ 0 0 18px rgba(255, 213, 79, 0.55);
826
+ }
827
+ #mlcad-measure-overlays.mlcad-grip-dragging .mlcad-measure-dot {
828
+ visibility: hidden !important;
829
+ pointer-events: none !important;
830
+ }
831
+ .mlcad-measure-badge {
832
+ position: absolute;
833
+ z-index: 2;
834
+ padding: 3px 10px;
835
+ border-radius: 14px;
836
+ background: var(--mlcad-ui-bg-elevated);
837
+ border: 1px solid var(--mlcad-measure-accent-border);
838
+ color: var(--mlcad-measure-accent);
839
+ font-size: 12px;
840
+ font-weight: 600;
841
+ white-space: nowrap;
842
+ transform: translate(-50%, -50%);
843
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
844
+ pointer-events: none;
845
+ }
846
+ .mlcad-measure-badge--coordinate {
847
+ transform: translate(-50%, calc(-50% - 16px));
848
+ }
849
+ .mlcad-measure-badge.mlcad-measure-selected {
850
+ outline: 2px solid rgba(255, 213, 79, 0.85);
851
+ outline-offset: 1px;
852
+ box-shadow:
853
+ 0 0 0 2px rgba(255, 213, 79, 0.4),
854
+ 0 0 12px rgba(255, 213, 79, 0.75),
855
+ 0 2px 8px rgba(0, 0, 0, 0.35);
856
+ }
857
+ .mlcad-measure-canvas.mlcad-measure-selected {
858
+ filter:
859
+ drop-shadow(0 0 1.5px #ffd54f)
860
+ drop-shadow(0 0 4px rgba(255, 213, 79, 0.95))
861
+ drop-shadow(0 0 8px rgba(255, 213, 79, 0.55));
862
+ }
863
+
864
+ #mlcad-markup-overlays {
865
+ position: absolute;
866
+ inset: 0;
867
+ pointer-events: none;
868
+ z-index: var(--mlcad-z-markup);
869
+ overflow: hidden;
870
+ }
871
+ .mlcad-markup-canvas {
872
+ position: absolute;
873
+ left: 0;
874
+ top: 0;
875
+ z-index: 1;
876
+ pointer-events: none;
877
+ }
878
+ .mlcad-markup-badge,
879
+ .mlcad-markup-stamp {
880
+ position: absolute;
881
+ z-index: 2;
882
+ padding: 3px 10px;
883
+ border-radius: 14px;
884
+ background: var(--mlcad-ui-bg-elevated);
885
+ border: 1px solid var(--mlcad-markup-accent-border);
886
+ color: var(--mlcad-markup-accent);
887
+ font-size: 12px;
888
+ font-weight: 600;
889
+ white-space: pre-wrap;
890
+ max-width: 240px;
891
+ min-width: 80px;
892
+ min-height: 1.75em;
893
+ box-sizing: border-box;
894
+ transform: translate(-50%, -50%);
895
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
896
+ pointer-events: auto;
897
+ cursor: grab;
898
+ touch-action: none;
899
+ user-select: none;
900
+ }
901
+ .mlcad-markup-stamp {
902
+ border-radius: 4px;
903
+ border-width: 2px;
904
+ text-transform: uppercase;
905
+ letter-spacing: 0.04em;
906
+ font-size: 11px;
907
+ white-space: nowrap;
908
+ min-width: 0;
909
+ }
910
+ .mlcad-markup-preview-dot {
911
+ position: absolute;
912
+ width: 10px;
913
+ height: 10px;
914
+ border-radius: 50%;
915
+ background: var(--mlcad-markup-accent);
916
+ border: 2px solid rgba(255, 255, 255, 0.9);
917
+ box-sizing: border-box;
918
+ transform: translate(-50%, -50%);
919
+ pointer-events: none;
920
+ }
921
+ .mlcad-markup-dot {
922
+ position: absolute;
923
+ z-index: 3;
924
+ width: 10px;
925
+ height: 10px;
926
+ border-radius: 50%;
927
+ background: var(--mlcad-markup-accent);
928
+ border: 2px solid rgba(255, 255, 255, 0.9);
929
+ box-sizing: border-box;
930
+ transform: translate(-50%, -50%);
931
+ visibility: hidden;
932
+ pointer-events: none;
933
+ cursor: grab;
934
+ }
935
+ .mlcad-markup-dot.mlcad-markup-selected {
936
+ visibility: visible;
937
+ pointer-events: auto;
938
+ box-shadow:
939
+ 0 0 0 2px rgba(255, 213, 79, 0.75),
940
+ 0 0 10px rgba(255, 213, 79, 0.95),
941
+ 0 0 18px rgba(255, 213, 79, 0.55);
942
+ }
943
+ #mlcad-markup-overlays.mlcad-grip-dragging .mlcad-markup-dot {
944
+ visibility: hidden !important;
945
+ pointer-events: none !important;
946
+ }
947
+ .mlcad-markup-badge.mlcad-markup-selected,
948
+ .mlcad-markup-stamp.mlcad-markup-selected {
949
+ outline: 2px solid rgba(255, 213, 79, 0.85);
950
+ outline-offset: 1px;
951
+ box-shadow:
952
+ 0 0 0 2px rgba(255, 213, 79, 0.4),
953
+ 0 0 12px rgba(255, 213, 79, 0.75),
954
+ 0 2px 8px rgba(0, 0, 0, 0.35);
955
+ }
956
+ .mlcad-markup-canvas.mlcad-markup-selected {
957
+ filter:
958
+ drop-shadow(0 0 1.5px #ffd54f)
959
+ drop-shadow(0 0 4px rgba(255, 213, 79, 0.95))
960
+ drop-shadow(0 0 8px rgba(255, 213, 79, 0.55));
961
+ }
962
+
963
+ #mlcad-loading {
964
+ position: fixed; inset: 0; z-index: 100;
965
+ display: flex; align-items: center; justify-content: center;
966
+ background: #121418;
967
+ transition: opacity 0.35s ease, visibility 0.35s ease;
968
+ }
969
+ #mlcad-loading.mlcad-loading--done {
970
+ opacity: 0; visibility: hidden; pointer-events: none;
971
+ }
972
+ #mlcad-loading.mlcad-loading--gate .mlcad-loading-spinner {
973
+ display: none;
974
+ }
975
+ .mlcad-loading-spinner {
976
+ width: 48px; height: 48px; box-sizing: border-box;
977
+ border: 3px solid rgba(255, 255, 255, 0.12);
978
+ border-top-color: var(--mlcad-accent);
979
+ border-radius: 50%;
980
+ animation: mlcad-spin 0.85s linear infinite;
981
+ }
982
+ @keyframes mlcad-spin { to { transform: rotate(360deg); } }
983
+
984
+ #mlcad-access-gate {
985
+ display: flex;
986
+ align-items: center;
987
+ justify-content: center;
988
+ width: 100%;
989
+ max-width: 360px;
990
+ padding: 0 20px;
991
+ box-sizing: border-box;
992
+ }
993
+ #mlcad-access-gate[hidden] {
994
+ display: none !important;
995
+ }
996
+ .mlcad-access-card {
997
+ width: 100%;
998
+ padding: 24px 20px;
999
+ border-radius: 10px;
1000
+ border: 1px solid var(--mlcad-ui-border);
1001
+ background: var(--mlcad-ui-bg-elevated);
1002
+ box-shadow: var(--mlcad-shadow);
1003
+ box-sizing: border-box;
1004
+ }
1005
+ .mlcad-access-title {
1006
+ margin: 0 0 8px;
1007
+ font-size: 16px;
1008
+ font-weight: 600;
1009
+ color: var(--mlcad-ui-text);
1010
+ text-align: center;
1011
+ }
1012
+ .mlcad-access-hint {
1013
+ margin: 0 0 16px;
1014
+ font-size: 13px;
1015
+ line-height: 1.45;
1016
+ color: var(--mlcad-ui-muted);
1017
+ text-align: center;
1018
+ }
1019
+ .mlcad-access-expiry {
1020
+ margin: -8px 0 16px;
1021
+ font-size: 12px;
1022
+ line-height: 1.4;
1023
+ color: var(--mlcad-ui-muted);
1024
+ text-align: center;
1025
+ }
1026
+ .mlcad-access-expiry[hidden] {
1027
+ display: none;
1028
+ }
1029
+ .mlcad-access-expiry.mlcad-expiry-countdown {
1030
+ width: fit-content;
1031
+ max-width: 100%;
1032
+ margin-left: auto;
1033
+ margin-right: auto;
1034
+ margin-bottom: 16px;
1035
+ padding: 6px 10px;
1036
+ border-radius: 6px;
1037
+ box-sizing: border-box;
1038
+ }
1039
+ .mlcad-access-field {
1040
+ display: flex;
1041
+ gap: 8px;
1042
+ margin-bottom: 12px;
1043
+ }
1044
+ .mlcad-access-field input {
1045
+ flex: 1 1 auto;
1046
+ min-width: 0;
1047
+ height: 36px;
1048
+ padding: 0 12px;
1049
+ border-radius: 6px;
1050
+ border: 1px solid var(--mlcad-ui-border);
1051
+ background: rgba(0, 0, 0, 0.25);
1052
+ color: var(--mlcad-ui-text);
1053
+ font: inherit;
1054
+ box-sizing: border-box;
1055
+ }
1056
+ .mlcad-access-field input:focus {
1057
+ outline: none;
1058
+ border-color: rgba(26, 140, 255, 0.65);
1059
+ box-shadow: 0 0 0 2px rgba(26, 140, 255, 0.2);
1060
+ }
1061
+ .mlcad-access-submit {
1062
+ width: 100%;
1063
+ height: 36px;
1064
+ border: 1px solid rgba(26, 140, 255, 0.55);
1065
+ border-radius: 6px;
1066
+ background: rgba(26, 140, 255, 0.22);
1067
+ color: #fff;
1068
+ font: inherit;
1069
+ font-weight: 600;
1070
+ cursor: pointer;
1071
+ }
1072
+ .mlcad-access-submit:hover {
1073
+ background: rgba(26, 140, 255, 0.32);
1074
+ }
1075
+ .mlcad-access-error {
1076
+ margin: 0;
1077
+ font-size: 12px;
1078
+ line-height: 1.4;
1079
+ color: #ff8a80;
1080
+ text-align: center;
1081
+ }
1082
+ .mlcad-access-error[hidden] {
1083
+ display: none;
1084
+ }
1085
+ .mlcad-access-gate--locked .mlcad-access-submit:disabled,
1086
+ .mlcad-access-gate--locked .mlcad-access-field input:disabled {
1087
+ opacity: 0.55;
1088
+ cursor: not-allowed;
1089
+ }
1090
+ .mlcad-access-field[hidden],
1091
+ .mlcad-access-submit[hidden],
1092
+ .mlcad-access-gate--expired .mlcad-access-field,
1093
+ .mlcad-access-gate--expired .mlcad-access-submit,
1094
+ .mlcad-access-gate--expired #mlcad-access-expiry,
1095
+ .mlcad-access-gate--expired #mlcad-access-error {
1096
+ display: none !important;
1097
+ }
1098
+ .mlcad-expiry-badge {
1099
+ position: relative;
1100
+ flex: 0 0 auto;
1101
+ margin-left: auto;
1102
+ max-width: none;
1103
+ padding: 8px 12px;
1104
+ border-radius: 6px;
1105
+ border: 1px solid var(--mlcad-ui-border);
1106
+ background: var(--mlcad-ui-bg-elevated);
1107
+ box-shadow: var(--mlcad-shadow);
1108
+ color: var(--mlcad-ui-text);
1109
+ font-size: 12px;
1110
+ line-height: 1.4;
1111
+ white-space: nowrap;
1112
+ pointer-events: none;
1113
+ box-sizing: border-box;
1114
+ }
1115
+ .mlcad-expiry-badge[hidden] {
1116
+ display: none !important;
1117
+ }
1118
+ .mlcad-expiry-countdown {
1119
+ border-color: rgba(255, 152, 0, 0.55);
1120
+ background: rgba(255, 152, 0, 0.16);
1121
+ color: #ffcc80;
1122
+ font-variant-numeric: tabular-nums;
1123
+ }
1124
+
1125
+ @media (max-width: ${Xi}px) {
1126
+ :root {
1127
+ --mlcad-drawer-width: min(280px, calc(100vw - 16px));
1128
+ --mlcad-ui-inset: 0px;
1129
+ --mlcad-toolbar-phone-height: 56px;
1130
+ /* Portrait min width (narrower than simple-ui's height - 4). */
1131
+ --mlcad-toolbar-phone-btn-size: max(
1132
+ 24px,
1133
+ calc(var(--mlcad-toolbar-phone-height) - 16px)
1134
+ );
1135
+ }
1136
+ #mlcad-root {
1137
+ display: flex;
1138
+ flex-direction: column;
1139
+ }
1140
+ #mlcad-canvas-host {
1141
+ position: relative;
1142
+ flex: 1 1 auto;
1143
+ inset: auto;
1144
+ width: 100%;
1145
+ min-height: 0;
1146
+ }
1147
+ #mlcad-sidebar {
1148
+ position: relative;
1149
+ left: auto;
1150
+ top: auto;
1151
+ right: auto;
1152
+ transform: none;
1153
+ width: 100%;
1154
+ max-width: none;
1155
+ flex: 0 0 auto;
1156
+ flex-direction: column-reverse;
1157
+ align-items: stretch;
1158
+ gap: 0;
1159
+ overflow: visible;
1160
+ }
1161
+ #mlcad-toolbar {
1162
+ flex-direction: row;
1163
+ width: 100%;
1164
+ box-sizing: border-box;
1165
+ gap: 0;
1166
+ padding: 4px 0;
1167
+ border-radius: 0;
1168
+ border-left: none;
1169
+ border-right: none;
1170
+ border-bottom: none;
1171
+ }
1172
+ #mlcad-toolbar .mlcad-tool-btn {
1173
+ flex: 1 1 0;
1174
+ width: auto;
1175
+ min-width: 0;
1176
+ height: auto;
1177
+ min-height: var(--mlcad-toolbar-phone-height);
1178
+ border-radius: 0;
1179
+ padding: 4px 2px;
1180
+ }
1181
+ #mlcad-toolbar .mlcad-tool-btn-label,
1182
+ #mlcad-zoom-strip .mlcad-tool-btn-label,
1183
+ #mlcad-measure-strip .mlcad-tool-btn-label,
1184
+ #mlcad-markup-strip .mlcad-tool-btn-label,
1185
+ #mlcad-settings-strip .mlcad-tool-btn-label,
1186
+ #mlcad-locale-strip .mlcad-tool-btn-label,
1187
+ #mlcad-snap-strip .mlcad-tool-btn-label {
1188
+ display: block;
1189
+ max-width: 100%;
1190
+ overflow: hidden;
1191
+ text-overflow: ellipsis;
1192
+ white-space: nowrap;
1193
+ }
1194
+ /* Drop sticky :focus / touch :hover chrome after closing a strip. */
1195
+ #mlcad-toolbar .mlcad-tool-btn:focus,
1196
+ #mlcad-toolbar .mlcad-tool-btn:focus-visible {
1197
+ outline: none;
1198
+ }
1199
+ #mlcad-toolbar .mlcad-tool-btn:focus:not(.active):not(.is-menu-open),
1200
+ #mlcad-toolbar .mlcad-tool-btn:focus-visible:not(.active):not(.is-menu-open) {
1201
+ background: transparent;
1202
+ border-color: transparent;
1203
+ }
1204
+ @media (hover: none) {
1205
+ #mlcad-toolbar .mlcad-tool-btn:hover:not(.active):not(.is-menu-open) {
1206
+ background: transparent;
1207
+ border-color: transparent;
1208
+ }
1209
+ }
1210
+ .mlcad-tool-btn.has-children::after {
1211
+ display: none;
1212
+ }
1213
+ #mlcad-toolbar-toggle,
1214
+ #mlcad-toolbar .mlcad-tool-separator {
1215
+ display: none !important;
1216
+ }
1217
+ /* Float above the bottom bar so the wrap does not occupy an in-flow
1218
+ rectangle of page background around the rounded strip. */
1219
+ #mlcad-sidebar > #mlcad-snap-strip-wrap,
1220
+ #mlcad-sidebar > #mlcad-measure-strip-wrap,
1221
+ #mlcad-sidebar > #mlcad-markup-strip-wrap,
1222
+ #mlcad-sidebar > #mlcad-zoom-strip-wrap,
1223
+ #mlcad-sidebar > #mlcad-settings-strip-wrap,
1224
+ #mlcad-sidebar > #mlcad-locale-strip-wrap {
1225
+ position: absolute;
1226
+ left: 0;
1227
+ right: 0;
1228
+ bottom: 100%;
1229
+ width: auto;
1230
+ flex-direction: column;
1231
+ align-items: stretch;
1232
+ background: none;
1233
+ box-shadow: none;
1234
+ backdrop-filter: none;
1235
+ overflow: visible;
1236
+ pointer-events: none;
1237
+ z-index: calc(var(--mlcad-z-chrome) + 1);
1238
+ }
1239
+ #mlcad-settings-strip-wrap:not([hidden]) {
1240
+ display: flex !important;
1241
+ }
1242
+ #mlcad-snap-strip,
1243
+ #mlcad-measure-strip,
1244
+ #mlcad-markup-strip,
1245
+ #mlcad-zoom-strip,
1246
+ #mlcad-settings-strip,
1247
+ #mlcad-locale-strip {
1248
+ display: grid;
1249
+ /* Fallback before wrap-pack JS: auto-fit stretches a short strip evenly.
1250
+ JS then sets an explicit column count so wrapped last rows stay narrow. */
1251
+ grid-template-columns: repeat(
1252
+ auto-fit,
1253
+ minmax(var(--mlcad-toolbar-phone-btn-size), 1fr)
1254
+ );
1255
+ justify-content: start;
1256
+ align-content: flex-start;
1257
+ width: auto;
1258
+ box-sizing: border-box;
1259
+ gap: 0;
1260
+ margin: 4px 8px 8px;
1261
+ padding: 4px 0;
1262
+ border-radius: 8px;
1263
+ /* Match active toolbar button outline. */
1264
+ border: 1px solid var(--mlcad-tool-btn-active-border);
1265
+ box-shadow: none;
1266
+ backdrop-filter: none;
1267
+ overflow: hidden;
1268
+ isolation: isolate;
1269
+ clip-path: inset(0 round 8px);
1270
+ pointer-events: auto;
1271
+ }
1272
+ #mlcad-snap-strip .mlcad-tool-btn,
1273
+ #mlcad-measure-strip .mlcad-tool-btn,
1274
+ #mlcad-markup-strip .mlcad-tool-btn,
1275
+ #mlcad-zoom-strip .mlcad-tool-btn,
1276
+ #mlcad-settings-strip .mlcad-tool-btn,
1277
+ #mlcad-locale-strip .mlcad-tool-btn {
1278
+ width: 100%;
1279
+ min-width: 0;
1280
+ height: auto;
1281
+ min-height: var(--mlcad-toolbar-phone-height);
1282
+ border-radius: 0;
1283
+ padding: 4px 2px;
1284
+ box-sizing: border-box;
1285
+ }
1286
+ #mlcad-measure-strip .mlcad-tool-separator,
1287
+ #mlcad-markup-strip .mlcad-tool-separator {
1288
+ display: none;
1289
+ }
1290
+ #mlcad-polar-angles {
1291
+ flex-direction: row;
1292
+ flex-wrap: wrap;
1293
+ max-width: none;
1294
+ width: 100%;
1295
+ box-sizing: border-box;
1296
+ border-radius: 0;
1297
+ pointer-events: auto;
1298
+ }
1299
+ #mlcad-layer-drawer,
1300
+ #mlcad-review-drawer,
1301
+ #mlcad-measure-drawer {
1302
+ position: fixed;
1303
+ left: 0;
1304
+ right: 0;
1305
+ bottom: var(--mlcad-phone-drawer-bottom, var(--mlcad-toolbar-phone-height));
1306
+ top: auto;
1307
+ margin: 0;
1308
+ width: 100%;
1309
+ max-width: none;
1310
+ height: min(42vh, calc(100vh - var(--mlcad-phone-drawer-bottom, var(--mlcad-toolbar-phone-height)) - 12px));
1311
+ max-height: calc(100vh - var(--mlcad-phone-drawer-bottom, var(--mlcad-toolbar-phone-height)) - 12px);
1312
+ z-index: calc(var(--mlcad-z-chrome) + 1);
1313
+ border-radius: 12px 12px 0 0;
1314
+ pointer-events: auto;
1315
+ }
1316
+ #mlcad-layer-drawer .mlcad-drawer-sheet-chrome,
1317
+ #mlcad-review-drawer .mlcad-drawer-sheet-chrome,
1318
+ #mlcad-measure-drawer .mlcad-drawer-sheet-chrome {
1319
+ display: flex;
1320
+ align-items: center;
1321
+ flex: 0 0 auto;
1322
+ min-height: 28px;
1323
+ }
1324
+ #mlcad-layer-drawer .mlcad-drawer-header,
1325
+ #mlcad-review-drawer .mlcad-drawer-header,
1326
+ #mlcad-measure-drawer .mlcad-drawer-header {
1327
+ display: none;
1328
+ }
1329
+ .mlcad-layer-action-btn {
1330
+ min-height: 28px;
1331
+ padding: 3px 6px;
1332
+ font-size: 11px;
1333
+ gap: 4px;
1334
+ }
1335
+ .mlcad-layer-action-btn svg { width: 12px; height: 12px; }
1336
+ .mlcad-layer-zoom {
1337
+ width: 20px;
1338
+ height: 20px;
1339
+ }
1340
+ .mlcad-layer-zoom svg {
1341
+ width: 12px;
1342
+ height: 12px;
1343
+ }
1344
+ #mlcad-top-chrome {
1345
+ left: 8px;
1346
+ right: 8px;
1347
+ top: 8px;
1348
+ }
1349
+
1350
+ }
1351
+
1352
+ /* Pad / coarse pointer: same toolbar as desktop, minus select and pan. */
1353
+ @media (max-width: ${Gi}px), (pointer: coarse) {
1354
+ #mlcad-toolbar [data-action="select"],
1355
+ #mlcad-toolbar [data-action="pan"] {
1356
+ display: none !important;
1357
+ }
1358
+ }
1359
+
1360
+ /*
1361
+ * Hide toolbar chrome during measure / markup without changing canvas size.
1362
+ * On phone the sidebar is in the flex column; display:none would expand
1363
+ * #mlcad-canvas-host and shift the drawing. Session panel floats on top.
1364
+ */
1365
+ #mlcad-root.mlcad-session-active #mlcad-sidebar {
1366
+ visibility: hidden !important;
1367
+ pointer-events: none !important;
1368
+ }
1369
+ `;function me(t,e="measure",a=!0){const r=e==="measure"?`${Yi()}${Wi()}${Ki()}`:"";return`
1370
+ <div id="mlcad-loading" aria-hidden="true" style="background:${t}">
1371
+ <div class="mlcad-loading-spinner"></div>
1372
+ <div id="mlcad-access-gate" hidden>
1373
+ <form id="mlcad-access-form" class="mlcad-access-card">
1374
+ <h2 class="mlcad-access-title" data-i18n-key="access.title" data-i18n-text>Protected drawing</h2>
1375
+ <p class="mlcad-access-hint" data-i18n-key="access.passwordPrompt" data-i18n-text>Enter the password to open this file.</p>
1376
+ <p id="mlcad-access-expiry" class="mlcad-access-expiry" hidden></p>
1377
+ <div class="mlcad-access-field">
1378
+ <input
1379
+ id="mlcad-access-password"
1380
+ type="password"
1381
+ autocomplete="off"
1382
+ data-i18n-key="access.passwordPlaceholder"
1383
+ data-i18n-attr="placeholder aria-label"
1384
+ placeholder="Password"
1385
+ aria-label="Password"
1386
+ />
1387
+ </div>
1388
+ <button type="submit" class="mlcad-access-submit" data-i18n-key="access.unlock" data-i18n-text>Unlock</button>
1389
+ <p id="mlcad-access-error" class="mlcad-access-error" hidden></p>
1390
+ </form>
1391
+ </div>
1392
+ </div>
1393
+ <div id="mlcad-root">
1394
+ <div id="mlcad-canvas-host">
1395
+ <div id="mlcad-top-chrome">
1396
+ <footer id="mlcad-status-bar" aria-live="polite" hidden></footer>
1397
+ </div>
1398
+ </div>
1399
+ <aside id="mlcad-sidebar">
1400
+ <nav id="mlcad-toolbar" data-i18n-attr="aria-label" data-i18n-key="toolbar.viewerTools" aria-label="Viewer tools"></nav>
1401
+ ${r}
1402
+ <div id="mlcad-layer-drawer" role="dialog" data-i18n-attr="aria-label" data-i18n-key="layers.title" aria-label="Layers" hidden>
1403
+ ${pe("mlcad-layer-sheet-close","layers.close","Close layers")}
1404
+ <div class="mlcad-drawer-header">
1405
+ <span data-i18n-key="layers.title" data-i18n-text>Layers</span>
1406
+ <button type="button" class="mlcad-drawer-close" id="mlcad-layer-close" data-i18n-key="layers.close" data-i18n-attr="aria-label" aria-label="Close layers">×</button>
1407
+ </div>
1408
+ <div class="mlcad-layer-actions">
1409
+ <button type="button" class="mlcad-layer-action-btn" id="mlcad-layer-show-all">
1410
+ ${Wt.layerOn}<span data-i18n-key="layers.showAll" data-i18n-text>Show all</span>
1411
+ </button>
1412
+ <button type="button" class="mlcad-layer-action-btn" id="mlcad-layer-hide-all">
1413
+ ${Wt.layerOff}<span data-i18n-key="layers.hideAll" data-i18n-text>Hide all</span>
1414
+ </button>
1415
+ </div>
1416
+ <div id="mlcad-layer-list"></div>
1417
+ </div>
1418
+ </aside>
1419
+ </div>
1420
+ `}function pe(t,e,a){return`<div class="mlcad-drawer-sheet-chrome">
1421
+ <div class="mlcad-drawer-grabber" role="separator" aria-orientation="horizontal"></div>
1422
+ <button type="button" class="mlcad-drawer-sheet-close" id="${t}" data-i18n-key="${e}" data-i18n-attr="aria-label" aria-label="${a}">${Wt.chevronDown}</button>
1423
+ </div>`}function Ki(){return`<div id="mlcad-review-drawer" role="dialog" data-i18n-attr="aria-label" data-i18n-key="review.title" aria-label="Review" hidden>
1424
+ ${pe("mlcad-review-sheet-close","review.close","Close review")}
1425
+ <div class="mlcad-drawer-header">
1426
+ <span data-i18n-key="review.title" data-i18n-text>Review</span>
1427
+ <button type="button" class="mlcad-drawer-close" id="mlcad-review-close" data-i18n-key="review.close" data-i18n-attr="aria-label" aria-label="Close review">×</button>
1428
+ </div>
1429
+ <div class="mlcad-review-toolbar">
1430
+ <input type="search" class="mlcad-review-search" data-i18n-key="review.searchPlaceholder" data-i18n-attr="placeholder" placeholder="Search markups" />
1431
+ <button type="button" class="mlcad-review-clear" data-i18n-key="review.clear" data-i18n-text>Clear all</button>
1432
+ </div>
1433
+ <div class="mlcad-review-table-wrap">
1434
+ <table class="mlcad-review-table">
1435
+ <thead>
1436
+ <tr>
1437
+ <th data-review-col="type" data-i18n-key="review.type" data-i18n-text>Type</th>
1438
+ <th data-review-col="status" data-i18n-key="review.status" data-i18n-text>Status</th>
1439
+ <th data-review-col="author" data-i18n-key="review.author" data-i18n-text>Author</th>
1440
+ <th data-review-col="summary" data-i18n-key="review.summary" data-i18n-text>Summary</th>
1441
+ </tr>
1442
+ </thead>
1443
+ <tbody></tbody>
1444
+ </table>
1445
+ </div>
1446
+ <div class="mlcad-review-detail" hidden>
1447
+ <div class="mlcad-review-detail-header">
1448
+ <div class="mlcad-review-detail-title" data-i18n-key="review.details" data-i18n-text>Details</div>
1449
+ <button type="button" class="mlcad-review-detail-close" data-i18n-key="review.closeDetails" data-i18n-attr="title aria-label" title="Close details" aria-label="Close details">×</button>
1450
+ </div>
1451
+ <div class="mlcad-review-field">
1452
+ <label class="mlcad-review-field-label" data-review-field="status" data-i18n-key="review.status" data-i18n-text>Status</label>
1453
+ <select class="mlcad-review-status"></select>
1454
+ </div>
1455
+ <div class="mlcad-review-field">
1456
+ <label class="mlcad-review-field-label" data-review-field="author" data-i18n-key="review.author" data-i18n-text>Author</label>
1457
+ <input type="text" class="mlcad-review-author" disabled />
1458
+ </div>
1459
+ <div class="mlcad-review-field">
1460
+ <label class="mlcad-review-field-label" data-review-field="label" data-i18n-key="review.label" data-i18n-text>Label</label>
1461
+ <input type="text" class="mlcad-review-text" />
1462
+ </div>
1463
+ <div class="mlcad-review-field">
1464
+ <label class="mlcad-review-field-label" data-review-field="comment" data-i18n-key="review.comment" data-i18n-text>Comment</label>
1465
+ <textarea class="mlcad-review-comment" rows="2"></textarea>
1466
+ </div>
1467
+ <div class="mlcad-review-detail-actions">
1468
+ <button type="button" class="mlcad-review-zoom" data-i18n-key="review.zoomTo" data-i18n-text>Zoom to</button>
1469
+ <button type="button" class="mlcad-review-delete" data-i18n-key="review.delete" data-i18n-text>Delete</button>
1470
+ </div>
1471
+ </div>
1472
+ </div>`}function Wi(){return`<div id="mlcad-measure-drawer" role="dialog" data-i18n-attr="aria-label" data-i18n-key="measurePanel.title" aria-label="Measurements" hidden>
1473
+ ${pe("mlcad-measure-sheet-close","measurePanel.close","Close measurements")}
1474
+ <div class="mlcad-drawer-header">
1475
+ <span data-i18n-key="measurePanel.title" data-i18n-text>Measurements</span>
1476
+ <button type="button" class="mlcad-drawer-close" id="mlcad-measure-close" data-i18n-key="measurePanel.close" data-i18n-attr="aria-label" aria-label="Close measurements">×</button>
1477
+ </div>
1478
+ <div class="mlcad-measure-toolbar">
1479
+ <div class="mlcad-measure-filter" role="group" data-i18n-key="measurePanel.filterGroup" data-i18n-attr="aria-label" aria-label="Filter by type">
1480
+ <button type="button" class="mlcad-measure-filter-btn" data-measure-filter="distance" aria-pressed="false" data-i18n-key="measurePanel.filterDistance" data-i18n-text data-i18n-attr="title aria-label" title="Distance">Distance</button>
1481
+ <button type="button" class="mlcad-measure-filter-btn" data-measure-filter="arc" aria-pressed="false" data-i18n-key="measurePanel.filterArc" data-i18n-text data-i18n-attr="title aria-label" title="Arc">Arc</button>
1482
+ <button type="button" class="mlcad-measure-filter-btn" data-measure-filter="angle" aria-pressed="false" data-i18n-key="measurePanel.filterAngle" data-i18n-text data-i18n-attr="title aria-label" title="Angle">Angle</button>
1483
+ <button type="button" class="mlcad-measure-filter-btn" data-measure-filter="area" aria-pressed="false" data-i18n-key="measurePanel.filterArea" data-i18n-text data-i18n-attr="title aria-label" title="Area">Area</button>
1484
+ </div>
1485
+ <button type="button" class="mlcad-measure-clear" data-i18n-key="measurePanel.clear" data-i18n-text>Clear all</button>
1486
+ </div>
1487
+ <div class="mlcad-measure-table-wrap">
1488
+ <table class="mlcad-measure-table">
1489
+ <thead>
1490
+ <tr>
1491
+ <th data-measure-col="type" data-i18n-key="measurePanel.type" data-i18n-text>Type</th>
1492
+ <th data-measure-col="value" data-i18n-key="measurePanel.value" data-i18n-text>Value</th>
1493
+ <th></th>
1494
+ </tr>
1495
+ </thead>
1496
+ <tbody></tbody>
1497
+ </table>
1498
+ </div>
1499
+ </div>`}function Ji(t,e){var a;const r=e.title??t.meta.title??"CAD Drawing",n=e.encoded??ka(t),i=e.viewerRuntime,o=zn(),l=n.compression,s=((a=e.accessManifest)==null?void 0:a.encrypted)===!0,c=`#${t.meta.background.toString(16).padStart(6,"0")}`,d=de(t.meta.locale)??"en",u=t.meta.viewerMode??"measure",m=t.meta.exportLayouts!==!1,p=e.accessManifest?` <script id="mlcad-access" type="application/json">${Ua(JSON.stringify(e.accessManifest))}<\/script>
1500
+ `:"",f=s?`${o}+aes-gcm;base64`:`${o}+${l};base64`;return`<!DOCTYPE html>
1501
+ <html lang="${d}">
1502
+ <head>
1503
+ <meta charset="utf-8" />
1504
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
1505
+ <meta name="generator" content="mlightcad-cad-html-plugin" />
1506
+ <title>${Ea(r)}</title>
1507
+ <style>${ue}</style>
1508
+ </head>
1509
+ <body>
1510
+ ${me(c,u,m)}
1511
+ ${p} <script id="mlcad-snapshot" type="${f}">${n.payload}<\/script>
1512
+ <script>${Da(i)}<\/script>
1513
+ </body>
1514
+ </html>`}function qi(t,e){var a;const r=e.title??t.meta.title??"CAD Drawing",n=e.viewerRuntime,i=`#${t.meta.background.toString(16).padStart(6,"0")}`,o=de(t.meta.locale)??"en",l=t.meta.viewerMode??"measure",s=t.meta.exportLayouts!==!1,c=(a=e.manifestUrl)==null?void 0:a.trim(),d=JSON.stringify(c&&c!==Hi?{manifestUrl:c}:{});return`<!DOCTYPE html>
1515
+ <html lang="${o}">
1516
+ <head>
1517
+ <meta charset="utf-8" />
1518
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
1519
+ <meta name="generator" content="mlightcad-cad-html-plugin" />
1520
+ <title>${Ea(r)}</title>
1521
+ <style>${ue}</style>
1522
+ </head>
1523
+ <body>
1524
+ ${me(i,l,s)}
1525
+ <script id="mlcad-package" type="application/json">${Ua(d)}<\/script>
1526
+ <script>${Da(n)}<\/script>
1527
+ </body>
1528
+ </html>`}function Ea(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Da(t){return t.replace(/<\/script/gi,"<\\/script")}function Ua(t){return t.replace(/</g,"\\u003c")}const Zi=1,Qi=1e5,to=16,eo=12;function ao(t,e=Date.now(),a){return t==="never"?null:t==="custom"?a??null:e+t*24*60*60*1e3}function Na(t){var e;const a=!!((e=t.password)!=null&&e.trim());return t.expiresAt!=null||a}function zt(t){var e;if(!Na(t))return;const a=!!((e=t.password)!=null&&e.trim());return{v:Zi,expiresAt:t.expiresAt,encrypted:a,...a&&t.salt?{salt:t.salt}:{}}}async function Oa(t,e){const a=crypto.getRandomValues(new Uint8Array(to));return{key:await io(t,a),salt:ge(a)}}async function he(t,e){const a=crypto.getRandomValues(new Uint8Array(eo)),r=new Uint8Array(e),n=new Uint8Array(await crypto.subtle.encrypt({name:"AES-GCM",iv:a},t,r)),i=new Uint8Array(a.length+n.length);return i.set(a,0),i.set(n,a.length),i}async function ro(t,e){const{key:a,salt:r}=await Oa(t),n=new Uint8Array(oo(e)),i=await he(a,n);return{encryptedPayload:ge(i),salt:r}}function fe(t){return ge(t)}async function no(t,e){var a;if(!Na(e))return{encoded:t};const r=(a=e.password)==null?void 0:a.trim();if(r){const{encryptedPayload:n,salt:i}=await ro(r,t.payload);return{encoded:{payload:n,compression:t.compression},manifest:zt({expiresAt:e.expiresAt,password:r,salt:i})}}return{encoded:t,manifest:zt({expiresAt:e.expiresAt})}}async function io(t,e){const a=new TextEncoder,r=await crypto.subtle.importKey("raw",a.encode(t),"PBKDF2",!1,["deriveKey"]);return crypto.subtle.deriveKey({name:"PBKDF2",salt:new Uint8Array(e),iterations:Qi,hash:"SHA-256"},r,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}function ge(t){let e="";for(let a=0;a<t.length;a++)e+=String.fromCharCode(t[a]);return btoa(e)}function oo(t){const e=atob(t.trim()),a=new Uint8Array(e.length);for(let r=0;r<e.length;r++)a[r]=e.charCodeAt(r);return a}const so=256;function lo(t,e=Ft){return!(e>0)||re(t)<=e?[t]:t.indices&&t.indices.length>=2?mo(t,e):uo(t,e)}function co(t,e=Ft){return t.texture?[t]:!(e>0)||ne(t)<=e?[t]:t.points?ho(t,e):!t.indices||t.indices.length<3?Ra(t,e):go(t,e)}function Ta(t){return t.linePattern?64+t.linePattern.pattern.length*8:0}function be(t){return(t.hatchPattern?128:0)+(t.gradientFill?64:0)}function bt(t,e,a){const r=t-so-e;return r<a?1:Math.max(1,Math.floor(r/a))}function uo(t,e){var a;const r=(((a=t.lineDistances)==null?void 0:a.length)??0)>=2,n=24+(r?8:0),i=bt(e,Ta(t),n),o=t.positions.length/6|0;if(o<=1)return[t];const l=[];for(let s=0;s<o;s+=i){const c=Math.min(i,o-s),d=s*6,u={layer:t.layer,color:t.color,offset:t.offset,positions:t.positions.slice(d,d+c*6)};if($a(t,u),r&&t.lineDistances){const m=s*2;u.lineDistances=t.lineDistances.slice(m,m+c*2)}l.push(u)}return l.length>0?l:[t]}function mo(t,e){var a;const r=t.indices,n=32+((((a=t.lineDistances)==null?void 0:a.length)??0)>0?8:0),i=bt(e,Ta(t),n),o=[];for(let l=0;l+1<r.length;){const s=Math.min(i*2,r.length-l),c=s-s%2;if(c<2)break;o.push(po(t,l,c)),l+=c}return o.length>0?o:[t]}function po(t,e,a){const r=_a(t.positions,t.indices.subarray(e,e+a),t.lineDistances?[t.lineDistances]:[],[1]),n={layer:t.layer,color:t.color,offset:t.offset,positions:r.positions,indices:r.indices};return $a(t,n),r.attributes[0]&&r.attributes[0].length>0&&(n.lineDistances=r.attributes[0]),n}function ho(t,e){return t.indices&&t.indices.length>0?fo(t,e):Ra(t,e)}function fo(t,e){const a=t.indices,r=16+(t.uvs?8:0)+(t.gradientPositions?8:0),n=bt(e,be(t),r),i=[];for(let o=0;o<a.length;){const l=Math.min(n,a.length-o);if(l<1)break;i.push(ja(t,o,l)),o+=l}return i.length>0?i:[t]}function Ra(t,e){const a=t.positions.length/3|0;if(a<=1)return[t];const r=12+(t.uvs?8:0)+(t.gradientPositions?8:0),n=bt(e,be(t),r),i=t.points?1:3,o=Math.max(i,n-n%i),l=[];for(let s=0;s<a;s+=o){const c=Math.min(o,a-s),d=c-c%i;if(d<i)break;l.push(bo(t,s,d))}return l.length>0?l:[t]}function go(t,e){const a=t.indices,r=48+(t.uvs?24:0)+(t.gradientPositions?24:0),n=bt(e,be(t),r),i=[];for(let o=0;o+2<a.length;){const l=Math.min(n*3,a.length-o),s=l-l%3;if(s<3)break;i.push(ja(t,o,s)),o+=s}return i.length>0?i:[t]}function bo(t,e,a){const r=e*3,n={layer:t.layer,color:t.color,offset:t.offset,positions:t.positions.slice(r,r+a*3)};return Ha(t,n),t.uvs&&(n.uvs=t.uvs.slice(e*2,(e+a)*2)),t.gradientPositions&&(n.gradientPositions=t.gradientPositions.slice(e*2,(e+a)*2)),n}function ja(t,e,a){const r=[],n=[];t.uvs&&(r.push(t.uvs),n.push(2)),t.gradientPositions&&(r.push(t.gradientPositions),n.push(2));const i=_a(t.positions,t.indices.subarray(e,e+a),r,n),o={layer:t.layer,color:t.color,offset:t.offset,positions:i.positions,indices:i.indices};Ha(t,o);let l=0;return t.uvs&&(o.uvs=i.attributes[l++]),t.gradientPositions&&(o.gradientPositions=i.attributes[l]),o}function _a(t,e,a,r){const n=new Map,i=[],o=new Uint32Array(e.length),l=a.map(()=>[]);for(let s=0;s<e.length;s++){const c=e[s];let d=n.get(c);if(d==null){d=n.size,n.set(c,d);const u=c*3;i.push(t[u]??0,t[u+1]??0,t[u+2]??0);for(let m=0;m<a.length;m++){const p=r[m],f=a[m],h=c*p;for(let w=0;w<p;w++)l[m].push(f[h+w]??0)}}o[s]=d}return{positions:Float32Array.from(i),indices:o,attributes:l.map(s=>Float32Array.from(s))}}function $a(t,e){t.linePattern&&(e.linePattern=t.linePattern),t.lineWidth!=null&&(e.lineWidth=t.lineWidth),t.renderOrder!=null&&(e.renderOrder=t.renderOrder),t.excludeFromOsnap&&(e.excludeFromOsnap=!0)}function Ha(t,e){t.hatchPattern&&(e.hatchPattern=t.hatchPattern),t.gradientFill&&(e.gradientFill=t.gradientFill),t.side!=null&&(e.side=t.side),t.renderOrder!=null&&(e.renderOrder=t.renderOrder),t.points&&(e.points=!0)}function wo(t,e,a=Ft){const r=[];let n={lineBatches:[],meshBatches:[],estimatedBytes:64};const i=()=>{n.lineBatches.length===0&&n.meshBatches.length===0&&r.length>0||(r.push(n),n={lineBatches:[],meshBatches:[],estimatedBytes:64})},o=c=>{const d=re(c);n.estimatedBytes+d>e&&(n.lineBatches.length>0||n.meshBatches.length>0)&&i(),n.lineBatches.push(c),n.estimatedBytes+=d},l=c=>{const d=ne(c);n.estimatedBytes+d>e&&(n.lineBatches.length>0||n.meshBatches.length>0)&&i(),n.meshBatches.push(c),n.estimatedBytes+=d},s=Math.min(e,a);for(const c of t.lineBatches)for(const d of lo(c,s))o(d);for(const c of t.meshBatches)for(const d of co(c,s))l(d);return(r.length===0||n.lineBatches.length>0||n.meshBatches.length>0)&&i(),r.length===0&&r.push({lineBatches:[],meshBatches:[],estimatedBytes:64}),r}function Va(t,e={}){var a,r;if(t.version!==q)throw new Error(`Unsupported snapshot version: ${t.version}`);const n=e.maxChunkBytes??Ri,i=e.maxBatchBytes??Ft,o=e.maxOsnapChunkBytes??ji,l=Pt,s=vo(t.layouts,t.activeLayoutBtrId),c=[],d=[],u=[],m=[],p=new Map;s.forEach((g,L)=>{var C;p.set(g.btrId,L);const x=wo(g,n,i),b=[];x.forEach((S,H)=>{const E=`L${L}-${String(H).padStart(3,"0")}`,U=`chunks/${E}.acex.gz`,N={layoutBtrId:g.btrId,lineBatches:S.lineBatches,meshBatches:S.meshBatches},{uncompressed:k,compressed:O}=Oi(N);b.push(E),c.push({id:E,href:U,layoutBtrId:g.btrId,byteLength:k.byteLength,compressedByteLength:O.byteLength,lineBatchCount:S.lineBatches.length,meshBatchCount:S.meshBatches.length}),m.push({path:U,bytes:O})});const D={btrId:g.btrId,name:g.name,isModelSpace:g.isModelSpace,viewports:g.viewports,chunkIds:b},X=(C=g.osnap)==null?void 0:C.primitives;if(X&&X.length>0){const S=bn(X,o),H=[];S.forEach((E,U)=>{const N=`L${L}-osnap-${String(U).padStart(3,"0")}`,k=`chunks/${N}.osnap.gz`,{uncompressed:O,compressed:V}=wn({primitives:E});H.push(N),d.push({id:N,href:k,layoutBtrId:g.btrId,byteLength:O.byteLength,compressedByteLength:V.byteLength,primitiveCount:E.length}),m.push({path:k,bytes:V})}),D.osnapChunkIds=H}u.push(D)});const f=t.layouts.map(g=>{const L=p.get(g.btrId);return u[L]}),h=new Set(((a=f.find(g=>g.btrId===t.activeLayoutBtrId))==null?void 0:a.chunkIds)??[]),w=[...c.filter(g=>h.has(g.id)),...c.filter(g=>!h.has(g.id))],A=new Set(((r=f.find(g=>g.btrId===t.activeLayoutBtrId))==null?void 0:r.osnapChunkIds)??[]),M=[...d.filter(g=>A.has(g.id)),...d.filter(g=>!A.has(g.id))],I={format:"acex-package",packageVersion:Ti,snapshotVersion:q,meta:t.meta,layers:t.layers,activeLayoutBtrId:t.activeLayoutBtrId,layouts:f,chunks:w,...M.length>0?{osnapChunks:M}:{}},z=`${JSON.stringify(I)}
1529
+ `;return m.unshift({path:l,bytes:pt(z)}),{manifest:I,manifestFileName:l,files:m}}function xo(t,e){const a=Va(t,e),r=qi(t,{title:t.meta.title,viewerRuntime:e.viewerRuntime,...e.manifestUrl?{manifestUrl:e.manifestUrl}:{}});return{html:r,manifest:a.manifest,manifestFileName:a.manifestFileName,files:[{path:"viewer.html",bytes:pt(r)},...a.files]}}function vo(t,e){const a=t.find(n=>n.btrId===e),r=t.filter(n=>n.btrId!==e);return a?[a,...r]:[...t]}const yo="application/vnd.mlightcad.acex-chunk;base64",ko="application/vnd.mlightcad.acex-chunk+aes-gcm;base64",Ya="data-acex-href";function Ao(t){var e;let a=0;for(const r of t.layouts){for(const i of r.lineBatches)a+=re(i);for(const i of r.meshBatches)a+=ne(i);const n=(e=r.osnap)==null?void 0:e.primitives;if(n)for(const i of n)a+=va(i)}return a}function Mo(t,e=_i){return Ao(t)>=e}async function zo(t,e){var a;const r=e.title??t.meta.title??"CAD Drawing",n=e.viewerRuntime,i=`#${t.meta.background.toString(16).padStart(6,"0")}`,o=de(t.meta.locale)??"en",l=t.meta.viewerMode??"measure",s=t.meta.exportLayouts!==!1,c=e.expiresAt??null,d=((a=e.password)==null?void 0:a.trim())||void 0,u={maxChunkBytes:e.maxChunkBytes??Ze,maxBatchBytes:e.maxBatchBytes??e.maxChunkBytes??Ze,maxOsnapChunkBytes:e.maxOsnapChunkBytes??$i},m=Va(t,u);let p,f,h;if(d){const{key:A,salt:M}=await Oa(d);p=zt({expiresAt:c,password:d,salt:M});const I=new TextEncoder().encode(`${JSON.stringify(m.manifest)}
1530
+ `),z=await he(A,I);f={mode:"embedded",encrypted:!0,encryptedManifest:fe(z)},h=await So(m.files,A)}else p=zt({expiresAt:c}),f={mode:"embedded",manifest:m.manifest},h=Co(m.files);const w=p?` <script id="mlcad-access" type="application/json">${Qe(JSON.stringify(p))}<\/script>
1531
+ `:"";return`<!DOCTYPE html>
1532
+ <html lang="${o}">
1533
+ <head>
1534
+ <meta charset="utf-8" />
1535
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
1536
+ <meta name="generator" content="mlightcad-cad-html-plugin" />
1537
+ <title>${Xa(r)}</title>
1538
+ <style>${ue}</style>
1539
+ </head>
1540
+ <body>
1541
+ ${me(i,l,s)}
1542
+ ${w} <script id="mlcad-package" type="application/json">${Qe(JSON.stringify(f))}<\/script>
1543
+ ${h} <script>${Fo(n)}<\/script>
1544
+ </body>
1545
+ </html>`}function Co(t){const e=[];for(const a of t)a.path!==Pt&&e.push(` <script type="${yo}" ${Ya}="${Ga(a.path)}">${fe(a.bytes)}<\/script>
1546
+ `);return e.join("")}async function So(t,e){const a=[];for(const r of t){if(r.path===Pt)continue;const n=await he(e,r.bytes);a.push(` <script type="${ko}" ${Ya}="${Ga(r.path)}">${fe(n)}<\/script>
1547
+ `)}return a.join("")}function Xa(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Ga(t){return Xa(t).replace(/'/g,"&#39;")}function Fo(t){return t.replace(/<\/script/gi,"<\\/script")}function Qe(t){return t.replace(/</g,"\\u003c")}function Po(t){return!t||t.startsWith("/")||t.includes("\\")||t.includes("\0")?!1:t.split("/").every(e=>e.length>0&&e!=="."&&e!==".."&&/^[A-Za-z0-9._-]+$/.test(e))}function Lo(t){const e={};for(const a of t.files){if(!Po(a.path))throw new Error(`Unsafe package path: ${a.path}`);e[a.path]=a.bytes}return rn(e,{level:6})}const Bo=400;function Q(t={}){var e;const a=t.exportFormat==="multi"?"multi":"single";return{exportFormat:a,exportInvisibleLayers:t.exportInvisibleLayers!==!1,exportLayouts:t.exportLayouts!==!1,initialView:t.initialView??"fit",viewerMode:t.viewerMode??"measure",expiryDays:a==="multi"?"never":t.expiryDays??"never",expiresAt:a==="multi"?null:t.expiresAt??null,password:a==="multi"?"":((e=t.password)==null?void 0:e.trim())??""}}function Io(t){const e=t.activeLayoutView,a=e.center,r=e.trCamera.zoom,n=Math.max(e.height,1),i=r*(2*Bo)/n;return{centerX:a.x,centerY:a.y,zoom:i}}const Eo="./viewer-runtime.iife.js";let gt={};function Do(t){gt={...gt,...t}}function Uo(){return{...gt}}function No(t){return t!=null?String(t):gt.viewerRuntimeUrl!=null?String(gt.viewerRuntimeUrl):Eo}const Ka="https://mlightcad.com/cad-viewer/docs/";let Wa=Ja(Ka);function Oo(){return Wa}function To(t){Wa=Ja(t)}function Ja(t){const e=t.trim();return e?e.replace(/\/+$/,""):Ka.replace(/\/+$/,"")}function Ro(){return{minX:0,minY:0,maxX:0,maxY:0,valid:!1}}function jo(t,e,a){if(e.length<3)return;const r=a[0],n=a[1];for(let i=0;i+2<e.length;i+=3){const o=_e(e[i],r),l=_e(e[i+1],n);t.valid?(o<t.minX&&(t.minX=o),o>t.maxX&&(t.maxX=o),l<t.minY&&(t.minY=l),l>t.maxY&&(t.maxY=l)):(t.minX=t.maxX=o,t.minY=t.maxY=l,t.valid=!0)}}function ta(t,e){jo(t,e.positions,e.offset)}function _o(t){return t.valid?{minX:t.minX,minY:t.minY,maxX:t.maxX,maxY:t.maxY}:null}function $o(t,e){const a=Ro();for(const r of t)ta(a,r);for(const r of e)ta(a,r);return _o(a)}function qa(t,e){return t?e?{minX:Math.min(t.minX,e.minX),minY:Math.min(t.minY,e.minY),maxX:Math.max(t.maxX,e.maxX),maxY:Math.max(t.maxY,e.maxY)}:t:e??null}function Ho(t){if(!t||t.length===0)return null;let e=null;for(const a of t)e=qa(e,a.paper);return e}function Vo(t){return qa($o(t.lineBatches,t.meshBatches),Ho(t.viewports))}function Yo(t,e,a){if(a)return;const r=Xo(t,e);if(!(r!=null&&r.newIterator))return;const n=[];for(const i of r.newIterator()){if(!(i instanceof ir)||j.AcTrViewportView.isDefaultPaperSpaceViewport(i)||typeof i.toGiViewport!="function")continue;const o=i.toGiViewport(),l=o.box,s=o.viewBox,c=ea(l),d=ea(s);if(!c||!d)continue;const u=Number.isFinite(o.viewTwistAngle)?o.viewTwistAngle:i.viewTwistAngle;n.push(Number.isFinite(u)&&Math.abs(u)>1e-12?{paper:c,model:d,twist:u}:{paper:c,model:d})}return n.length>0?n:void 0}function ea(t){if(typeof t.isEmpty=="function"&&t.isEmpty())return;const e=t.min.x,a=t.min.y,r=t.max.x,n=t.max.y;if(!(!Number.isFinite(e)||!Number.isFinite(a)||!Number.isFinite(r)||!Number.isFinite(n)||r-e<=0||n-a<=0))return{minX:e,minY:a,maxX:r,maxY:n}}function Xo(t,e){var a;const r=(a=t.tables)==null?void 0:a.blockTable;if(!r)return;const n=typeof r.getIdAt=="function"?r.getIdAt(e):void 0;if(n)return n;if(typeof r.newIterator=="function"){for(const o of r.newIterator())if(o.objectId===e)return o}const i=r.modelSpace;if((i==null?void 0:i.objectId)===e)return i}class Go{build(e,a,r={}){return this.buildSync(e,a,r)}async buildAsync(e,a,r={}){await Y();const n=r.exportInvisibleLayers!==!1,i=r.exportLayouts!==!1,o=n?void 0:p=>xt(e,p,n),l=Ge(a,{title:r.title,background:r.background}),s=[];e.layers.forEach(p=>{xt(e,p.name,n)&&s.push({name:p.name,color:p.color.RGB??16777215,visible:!p.isOff&&!p.isFrozen})});const c=ra(a),d=new Map(c.map(p=>[p.blockTableRecordId,p.name])),u=ia(e,i),m=[];for(const p of na(e,c,i))m.push(oa(e,a,p,d,r,o)),await Y();return{version:q,meta:aa(l,r,m,u),layers:s,layouts:m,activeLayoutBtrId:u}}buildSync(e,a,r){const n=r.exportInvisibleLayers!==!1,i=r.exportLayouts!==!1,o=n?void 0:p=>xt(e,p,n),l=Ge(a,{title:r.title,background:r.background}),s=[];e.layers.forEach(p=>{xt(e,p.name,n)&&s.push({name:p.name,color:p.color.RGB??16777215,visible:!p.isOff&&!p.isFrozen})});const c=ra(a),d=new Map(c.map(p=>[p.blockTableRecordId,p.name])),u=ia(e,i),m=[];for(const p of na(e,c,i))m.push(oa(e,a,p,d,r,o));return{version:q,meta:aa(l,r,m,u),layers:s,layouts:m,activeLayoutBtrId:u}}}function aa(t,e,a,r){const n=a.find(l=>l.btrId===r)??a[0],i=n?Vo(n):null,o=e.initialView??"fit";return{title:t.title,createdAt:new Date().toISOString(),extents:t.extents,viewExtents:i??void 0,units:t.units,grip:t.grip,background:t.background,locale:e.locale??v.currentLocale,initialView:o,viewState:o==="current"?e.viewState:void 0,viewerMode:e.viewerMode??"measure",exportLayouts:e.exportLayouts!==!1,docsBaseUrl:Ko()}}function Ko(){try{To(or())}catch{}return Oo()}function Wo(t){return(t.viewerMode??"measure")==="measure"}function xt(t,e,a){if(a)return!0;const r=t.layers.get(e);return r?!r.isOff&&!r.isFrozen:!0}function ra(t){var e;const a=(e=t.objects)==null?void 0:e.layout;if(!(a!=null&&a.newIterator))return[];const r=[];for(const n of a.newIterator()){const i=n.blockTableRecordId;i&&r.push({name:n.layoutName||i,tabOrder:n.tabOrder??0,blockTableRecordId:i})}return r.sort((n,i)=>n.tabOrder-i.tabOrder),r}function na(t,e,a){if(!a)return t.modelSpaceBtrId?[t.modelSpaceBtrId]:[];const r=new Set,n=[];for(const i of e)r.has(i.blockTableRecordId)||(r.add(i.blockTableRecordId),n.push(i.blockTableRecordId));for(const i of t.layouts.keys())r.has(i)||(r.add(i),n.push(i));return n}function ia(t,e){return e&&t.activeLayoutBtrId||t.modelSpaceBtrId}function oa(t,e,a,r,n,i){const o=[],l=[],s=t.layouts.get(a);if(s)for(const[,d]of s.layers){if(i&&!i(d.name))continue;const u=ti(d.internalObject);o.push(...u.lineBatches),l.push(...u.meshBatches)}const c=a===t.modelSpaceBtrId;return{btrId:a,name:r.get(a)??Jo(e,a),isModelSpace:c,lineBatches:o,meshBatches:l,osnap:Wo(n)?Ii(e,a,{includeLayer:i}):void 0,viewports:Yo(e,a,c)}}function Jo(t,e){var a;const r=(a=t.tables)==null?void 0:a.blockTable;if(r!=null&&r.newIterator){for(const n of r.newIterator())if(n.objectId===e)return n.name}return e}class qo{constructor(e={}){this.options=e,this._snapshotBuilder=new Go}async prepareAcTrView2dForHtmlExport(e,a={}){if(!e||!("cadScene"in e)||!e.cadScene)throw new Error("CAD scene is not available. Open a drawing before exporting to HTML.");if(!(e instanceof er))throw new Error("HTML export requires a 2D CAD view. Open a drawing before exporting.");const r=Q(a),n={includeInvisibleLayers:r.exportInvisibleLayers,includeLayouts:r.exportLayouts};return await e.ensureEntitiesConvertedForExport(n),await Y(),e}async convert(e,a={},r){const n=it.instance,i=Q(a);await n.withBusyIndicator(async()=>{await Y();const o=n.curDocument,l=await this.prepareAcTrView2dForHtmlExport(r??n.curView,i),s=e||o.fileName||o.docTitle,c=ar(s),d=await this._snapshotBuilder.buildAsync(l.cadScene,o.database,{title:c,background:l.backgroundColor,exportInvisibleLayers:i.exportInvisibleLayers,exportLayouts:i.exportLayouts,initialView:i.initialView,viewerMode:i.viewerMode,viewState:i.initialView==="current"&&(i.exportLayouts||l.activeLayoutBtrId===l.modelSpaceBtrId)?Io(l):void 0});await Y();const u=await this.loadViewerRuntime();if(await Y(),i.exportFormat==="multi"){const f=xo(d,{viewerRuntime:u}),h=Lo(f);await Y(),this.downloadBytes(h,ke(s,"zip"),"application/zip");return}const m=ao(i.expiryDays,Date.now(),i.expiresAt),p=await this.packSelfContainedHtml(d,u,{expiresAt:m,password:i.password||void 0});await Y(),this.downloadHtml(p,ke(s,"html"))})}async packSnapshot(e,a){await it.instance.withBusyIndicator(async()=>{await Y();const r=await this.loadViewerRuntime();await Y();const n=await this.packSelfContainedHtml(e,r,{expiresAt:null});await Y(),this.downloadHtml(n,a)})}async packSelfContainedHtml(e,a,r){if(Mo(e))return zo(e,{title:e.meta.title,viewerRuntime:a,expiresAt:r.expiresAt,password:r.password});const n=await no(ka(e),{expiresAt:r.expiresAt,password:r.password});return Ji(e,{title:e.meta.title,viewerRuntime:a,encoded:n.encoded,accessManifest:n.manifest})}async loadViewerRuntime(){const e=No(this.options.viewerRuntimeUrl),a=await fetch(e);if(!a.ok)throw new Error(`Failed to load HTML viewer runtime from "${e}" (${a.status}). Install @mlightcad/cad-html-plugin, copy viewer-runtime.iife.js to your app assets, and set viewerRuntimeUrl on registerLazyHtmlPlugin / createHtmlPlugin / AcApHtmlConvertor.`);return a.text()}downloadHtml(e,a){this.downloadBytes(new TextEncoder().encode(e),a,"text/html;charset=utf-8")}downloadBytes(e,a,r){const n=new Uint8Array(e.byteLength);n.set(e);const i=new Blob([n],{type:r}),o=URL.createObjectURL(i),l=document.createElement("a");l.href=o,l.download=a,document.body.appendChild(l),l.click(),document.body.removeChild(l),window.setTimeout(()=>URL.revokeObjectURL(o),6e4)}}class Zo extends tr{constructor(e={}){super(),this.pluginOptions=e}async execute(e){const a=await this.promptOptions();a&&await new qo(this.pluginOptions).convert(e.doc.fileName||e.doc.docTitle,a,e.view)}async promptOptions(){const e=Q(),a=await this.promptExportFormat();if(a===void 0)return;const r=await this.promptYesNo("jig.chtml.exportInvisibleLayers",e.exportInvisibleLayers);if(r===void 0)return;const n=await this.promptYesNo("jig.chtml.exportLayouts",e.exportLayouts);if(n===void 0)return;const i=await this.promptInitialView();if(i===void 0)return;const o=await this.promptViewerMode();if(o!==void 0)return Q({exportFormat:a,exportInvisibleLayers:r,exportLayouts:n,initialView:i,viewerMode:o})}async promptExportFormat(){const e=Q(),a=new wt(v.t("jig.chtml.exportFormat"));a.allowNone=!0;const r=a.keywords.add(v.t("jig.chtml.keywords.single.display"),v.t("jig.chtml.keywords.single.global"),v.t("jig.chtml.keywords.single.local")),n=a.keywords.add(v.t("jig.chtml.keywords.multi.display"),v.t("jig.chtml.keywords.multi.global"),v.t("jig.chtml.keywords.multi.local"));a.keywords.default=e.exportFormat==="multi"?n:r;const i=await it.instance.editor.getKeywords(a);if(i.status!==R.Cancel){if(i.status===R.None)return e.exportFormat;if(i.status===R.OK||i.status===R.Keyword)return i.stringResult?i.stringResult==="Multi"?"multi":"single":e.exportFormat}}async promptYesNo(e,a){const r=new wt(v.t(e));r.allowNone=!0;const n=r.keywords.add(v.t("jig.chtml.keywords.yes.display"),v.t("jig.chtml.keywords.yes.global"),v.t("jig.chtml.keywords.yes.local")),i=r.keywords.add(v.t("jig.chtml.keywords.no.display"),v.t("jig.chtml.keywords.no.global"),v.t("jig.chtml.keywords.no.local"));r.keywords.default=a?n:i;const o=await it.instance.editor.getKeywords(r);if(o.status!==R.Cancel){if(o.status===R.None)return a;if(o.status===R.OK||o.status===R.Keyword)return o.stringResult?o.stringResult==="Yes":a}}async promptInitialView(){const e=Q(),a=new wt(v.t("jig.chtml.initialView"));a.allowNone=!0;const r=a.keywords.add(v.t("jig.chtml.keywords.extents.display"),v.t("jig.chtml.keywords.extents.global"),v.t("jig.chtml.keywords.extents.local")),n=a.keywords.add(v.t("jig.chtml.keywords.current.display"),v.t("jig.chtml.keywords.current.global"),v.t("jig.chtml.keywords.current.local"));a.keywords.default=e.initialView==="current"?n:r;const i=await it.instance.editor.getKeywords(a);if(i.status!==R.Cancel){if(i.status===R.None)return e.initialView;if(i.status===R.OK||i.status===R.Keyword)return i.stringResult?i.stringResult==="Current"?"current":"fit":e.initialView}}async promptViewerMode(){const e=Q(),a=new wt(v.t("jig.chtml.viewerMode"));a.allowNone=!0;const r=a.keywords.add(v.t("jig.chtml.keywords.view.display"),v.t("jig.chtml.keywords.view.global"),v.t("jig.chtml.keywords.view.local")),n=a.keywords.add(v.t("jig.chtml.keywords.measure.display"),v.t("jig.chtml.keywords.measure.global"),v.t("jig.chtml.keywords.measure.local"));a.keywords.default=e.viewerMode==="view"?r:n;const i=await it.instance.editor.getKeywords(a);if(i.status!==R.Cancel){if(i.status===R.None)return e.viewerMode;if(i.status===R.OK||i.status===R.Keyword)return i.stringResult?i.stringResult==="View"?"view":"measure":e.viewerMode}}}const Qo="1.7.1",ts={version:Qo};class es{constructor(e={}){this.options=e,this.name="HtmlPlugin",this.version=ts.version,this.description="HTML export (-chtml) command",this.registeredCommands=[]}onLoad(e,a){const r=Qa.SYSTEMT_COMMAND_GROUP_NAME,n=new Zo(this.options);a.addCommand(r,"-chtml","-chtml",n),this.registeredCommands.push({group:r,name:"-chtml"}),a.lookupGlobalCmd("chtml")||(a.addCommand(r,"chtml","chtml",n),this.registeredCommands.push({group:r,name:"chtml"}))}onUnload(e,a){for(const r of this.registeredCommands)a.removeCmd(r.group,r.name);this.registeredCommands=[]}}async function rs(t={}){return t.viewerRuntimeUrl!=null&&Do(t),new es(Uo())}export{Ui as ACEC_CHUNK_MAGIC,ln as ACEO_OSNAP_MAGIC,cn as ACEO_OSNAP_VERSION,Ri as ACEX_DEFAULT_CHUNK_MAX_BYTES,Pt as ACEX_DEFAULT_MANIFEST_FILE,Hi as ACEX_DEFAULT_MANIFEST_HREF,ji as ACEX_DEFAULT_OSNAP_CHUNK_MAX_BYTES,ko as ACEX_EMBEDDED_CHUNK_ENCRYPTED_MIME,Ya as ACEX_EMBEDDED_CHUNK_HREF_ATTR,Ze as ACEX_EMBEDDED_CHUNK_MAX_BYTES,yo as ACEX_EMBEDDED_CHUNK_MIME,_i as ACEX_EMBEDDED_CHUNK_THRESHOLD_BYTES,$i as ACEX_EMBEDDED_OSNAP_CHUNK_MAX_BYTES,Ft as ACEX_MAX_GEOMETRY_BATCH_BYTES,Ti as ACEX_PACKAGE_VERSION,nn as ACEX_SNAPSHOT_COMPRESSION,q as ACEX_SNAPSHOT_VERSION,Zo as AcApExportHtmlCmd,qo as AcApHtmlConvertor,Go as AcApHtmlSnapshotBuilder,Eo as DEFAULT_HTML_VIEWER_RUNTIME_URL,os as HTML_PLUGIN_NAME,ss as HTML_PLUGIN_TRIGGERS,fe as acExHtmlBytesToBase64,zt as buildAcExHtmlAccessManifest,xo as buildAcExPackage,Va as buildAcExPackageData,Ii as buildOsnapCatalog,Ge as buildViewerMetadata,Io as captureAcApHtmlViewState,ti as collectBatchesFromObject3D,ae as compressSnapshotBinary,Do as configureHtmlPlugin,Oa as createAcExHtmlAccessKey,rs as createHtmlPlugin,Ni as encodeChunkBinary,Oi as encodeChunkGzip,ya as encodeOsnapCatalogBinary,wn as encodeOsnapCatalogGzip,ka as encodeSnapshot,yn as encodeSnapshotBinary,he as encryptAcExHtmlBytes,ro as encryptAcExHtmlSnapshotPayload,Ao as estimateAcExSnapshotGeometryBytes,va as estimateOsnapPrimitiveBytes,Yn as exportActiveBatchedLine2Slice,se as exportActiveBatchedSlice,He as exportBufferGeometrySlice,Uo as getHtmlPluginOptions,ra as listDatabaseLayouts,Na as needsAcExHtmlAccessControl,Ji as packHtml,zo as packHtmlEmbeddedPackage,qi as packHtmlPackage,no as protectAcExHtmlEncodedSnapshot,ao as resolveAcApHtmlExpiresAt,Q as resolveAcApHtmlExportOptions,de as resolveAcExHtmlLocale,No as resolveViewerRuntimeUrl,Mo as shouldEmbedAcExChunks,zn as snapshotMimeType,wo as splitLayoutIntoSlices,bn as splitOsnapPrimitives,Lo as zipAcExPackageFiles};