builder-settings-types 0.0.440 → 0.0.441

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.
@@ -69,6 +69,7 @@ export declare class SettingGroup<TSettings extends SettingsMap> implements IDra
69
69
  private isSettingValue;
70
70
  private suppressOnChange;
71
71
  protected isRootNode: boolean;
72
+ private skipHistoryNextChange;
72
73
  $id: string;
73
74
  setActiveOnSettingSelection?: boolean;
74
75
  onDeleteRequest?: () => void;
@@ -77,6 +78,7 @@ export declare class SettingGroup<TSettings extends SettingsMap> implements IDra
77
78
  private groupContainer?;
78
79
  constructor(groupProps: SettingGroupProps<TSettings>);
79
80
  private propagateNestingLevel;
81
+ consumeSkipHistoryNextChange(): boolean;
80
82
  getNestingLevel(): number;
81
83
  setNestingLevel(level: number): void;
82
84
  setTitle(title: string): void;
@@ -128,7 +128,7 @@
128
128
  `),l.push(` </office:body>
129
129
  `),o.bookType=="fods"?l.push("</office:document>"):l.push("</office:document-content>"),l.join("")}}();function Sc(t,e){if(e.bookType=="fods")return h0(t,e);var r=ds(),a="",n=[],i=[];return a="mimetype",ye(r,a,"application/vnd.oasis.opendocument.spreadsheet"),a="content.xml",ye(r,a,h0(t,e)),n.push([a,"text/xml"]),i.push([a,"ContentFile"]),a="styles.xml",ye(r,a,M5(t,e)),n.push([a,"text/xml"]),i.push([a,"StylesFile"]),a="meta.xml",ye(r,a,tt+pl()),n.push([a,"text/xml"]),i.push([a,"MetadataFile"]),a="manifest.rdf",ye(r,a,lu(i)),n.push([a,"application/rdf+xml"]),a="META-INF/manifest.xml",ye(r,a,su(n)),r}/*! sheetjs (C) 2013-present SheetJS -- http://sheetjs.com */function ha(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function Zi(t){return typeof TextDecoder<"u"?new TextDecoder().decode(t):Be(Hr(t))}function O5(t){return typeof TextEncoder<"u"?new TextEncoder().encode(t):Dt(mr(t))}function P5(t,e){e:for(var r=0;r<=t.length-e.length;++r){for(var a=0;a<e.length;++a)if(t[r+a]!=e[a])continue e;return!0}return!1}function Vr(t){var e=t.reduce(function(n,i){return n+i.length},0),r=new Uint8Array(e),a=0;return t.forEach(function(n){r.set(n,a),a+=n.length}),r}function f0(t){return t-=t>>1&1431655765,t=(t&858993459)+(t>>2&858993459),(t+(t>>4)&252645135)*16843009>>>24}function D5(t,e){for(var r=(t[e+15]&127)<<7|t[e+14]>>1,a=t[e+14]&1,n=e+13;n>=e;--n)a=a*256+t[n];return(t[e+15]&128?-a:a)*Math.pow(10,r-6176)}function R5(t,e,r){var a=Math.floor(r==0?0:Math.LOG10E*Math.log(Math.abs(r)))+6176-20,n=r/Math.pow(10,a-6176);t[e+15]|=a>>7,t[e+14]|=(a&127)<<1;for(var i=0;n>=1;++i,n/=256)t[e+i]=n&255;t[e+15]|=r>=0?0:128}function mn(t,e){var r=e?e[0]:0,a=t[r]&127;e:if(t[r++]>=128&&(a|=(t[r]&127)<<7,t[r++]<128||(a|=(t[r]&127)<<14,t[r++]<128)||(a|=(t[r]&127)<<21,t[r++]<128)||(a+=(t[r]&127)*Math.pow(2,28),++r,t[r++]<128)||(a+=(t[r]&127)*Math.pow(2,35),++r,t[r++]<128)||(a+=(t[r]&127)*Math.pow(2,42),++r,t[r++]<128)))break e;return e&&(e[0]=r),a}function Pe(t){var e=new Uint8Array(7);e[0]=t&127;var r=1;e:if(t>127){if(e[r-1]|=128,e[r]=t>>7&127,++r,t<=16383||(e[r-1]|=128,e[r]=t>>14&127,++r,t<=2097151)||(e[r-1]|=128,e[r]=t>>21&127,++r,t<=268435455)||(e[r-1]|=128,e[r]=t/256>>>21&127,++r,t<=34359738367)||(e[r-1]|=128,e[r]=t/65536>>>21&127,++r,t<=4398046511103))break e;e[r-1]|=128,e[r]=t/16777216>>>21&127,++r}return e.slice(0,r)}function Ye(t){var e=0,r=t[e]&127;e:if(t[e++]>=128){if(r|=(t[e]&127)<<7,t[e++]<128||(r|=(t[e]&127)<<14,t[e++]<128)||(r|=(t[e]&127)<<21,t[e++]<128))break e;r|=(t[e]&127)<<28}return r}function Me(t){for(var e=[],r=[0];r[0]<t.length;){var a=r[0],n=mn(t,r),i=n&7;n=Math.floor(n/8);var s=0,o;if(n==0)break;switch(i){case 0:{for(var l=r[0];t[r[0]++]>=128;);o=t.slice(l,r[0])}break;case 5:s=4,o=t.slice(r[0],r[0]+s),r[0]+=s;break;case 1:s=8,o=t.slice(r[0],r[0]+s),r[0]+=s;break;case 2:s=mn(t,r),o=t.slice(r[0],r[0]+s),r[0]+=s;break;case 3:case 4:default:throw new Error("PB Type ".concat(i," for Field ").concat(n," at offset ").concat(a))}var c={data:o,type:i};e[n]==null?e[n]=[c]:e[n].push(c)}return e}function ut(t){var e=[];return t.forEach(function(r,a){r.forEach(function(n){n.data&&(e.push(Pe(a*8+n.type)),n.type==2&&e.push(Pe(n.data.length)),e.push(n.data))})}),Vr(e)}function Hs(t,e){return(t==null?void 0:t.map(function(r){return e(r.data)}))||[]}function $t(t){for(var e,r=[],a=[0];a[0]<t.length;){var n=mn(t,a),i=Me(t.slice(a[0],a[0]+n));a[0]+=n;var s={id:Ye(i[1][0].data),messages:[]};i[2].forEach(function(o){var l=Me(o.data),c=Ye(l[3][0].data);s.messages.push({meta:l,data:t.slice(a[0],a[0]+c)}),a[0]+=c}),(e=i[3])!=null&&e[0]&&(s.merge=Ye(i[3][0].data)>>>0>0),r.push(s)}return r}function va(t){var e=[];return t.forEach(function(r){var a=[];a[1]=[{data:Pe(r.id),type:0}],a[2]=[],r.merge!=null&&(a[3]=[{data:Pe(+!!r.merge),type:0}]);var n=[];r.messages.forEach(function(s){n.push(s.data),s.meta[3]=[{type:0,data:Pe(s.data.length)}],a[2].push({data:ut(s.meta),type:2})});var i=ut(a);e.push(Pe(i.length)),e.push(i),n.forEach(function(s){return e.push(s)})}),Vr(e)}function B5(t,e){if(t!=0)throw new Error("Unexpected Snappy chunk type ".concat(t));for(var r=[0],a=mn(e,r),n=[];r[0]<e.length;){var i=e[r[0]]&3;if(i==0){var s=e[r[0]++]>>2;if(s<60)++s;else{var o=s-59;s=e[r[0]],o>1&&(s|=e[r[0]+1]<<8),o>2&&(s|=e[r[0]+2]<<16),o>3&&(s|=e[r[0]+3]<<24),s>>>=0,s++,r[0]+=o}n.push(e.slice(r[0],r[0]+s)),r[0]+=s;continue}else{var l=0,c=0;if(i==1?(c=(e[r[0]]>>2&7)+4,l=(e[r[0]++]&224)<<3,l|=e[r[0]++]):(c=(e[r[0]++]>>2)+1,i==2?(l=e[r[0]]|e[r[0]+1]<<8,r[0]+=2):(l=(e[r[0]]|e[r[0]+1]<<8|e[r[0]+2]<<16|e[r[0]+3]<<24)>>>0,r[0]+=4)),n=[Vr(n)],l==0)throw new Error("Invalid offset 0");if(l>n[0].length)throw new Error("Invalid offset beyond length");if(c>=l)for(n.push(n[0].slice(-l)),c-=l;c>=n[n.length-1].length;)n.push(n[n.length-1]),c-=n[n.length-1].length;n.push(n[0].slice(-l,-l+c))}}var h=Vr(n);if(h.length!=a)throw new Error("Unexpected length: ".concat(h.length," != ").concat(a));return h}function Gt(t){for(var e=[],r=0;r<t.length;){var a=t[r++],n=t[r]|t[r+1]<<8|t[r+2]<<16;r+=3,e.push(B5(a,t.slice(r,r+n))),r+=n}if(r!==t.length)throw new Error("data is not a valid framed stream!");return Vr(e)}function wa(t){for(var e=[],r=0;r<t.length;){var a=Math.min(t.length-r,268435455),n=new Uint8Array(4);e.push(n);var i=Pe(a),s=i.length;e.push(i),a<=60?(s++,e.push(new Uint8Array([a-1<<2]))):a<=256?(s+=2,e.push(new Uint8Array([240,a-1&255]))):a<=65536?(s+=3,e.push(new Uint8Array([244,a-1&255,a-1>>8&255]))):a<=16777216?(s+=4,e.push(new Uint8Array([248,a-1&255,a-1>>8&255,a-1>>16&255]))):a<=4294967296&&(s+=5,e.push(new Uint8Array([252,a-1&255,a-1>>8&255,a-1>>16&255,a-1>>>24&255]))),e.push(t.slice(r,r+a)),s+=a,n[0]=0,n[1]=s&255,n[2]=s>>8&255,n[3]=s>>16&255,r+=a}return Vr(e)}function V5(t,e,r,a){var n=ha(t),i=n.getUint32(4,!0),s=(a>1?12:8)+f0(i&(a>1?3470:398))*4,o=-1,l=-1,c=NaN,h=new Date(2001,0,1);i&512&&(o=n.getUint32(s,!0),s+=4),s+=f0(i&(a>1?12288:4096))*4,i&16&&(l=n.getUint32(s,!0),s+=4),i&32&&(c=n.getFloat64(s,!0),s+=8),i&64&&(h.setTime(h.getTime()+n.getFloat64(s,!0)*1e3),s+=8);var u;switch(t[2]){case 0:break;case 2:u={t:"n",v:c};break;case 3:u={t:"s",v:e[l]};break;case 5:u={t:"d",v:h};break;case 6:u={t:"b",v:c>0};break;case 7:u={t:"n",v:c/86400};break;case 8:u={t:"e",v:0};break;case 9:if(o>-1)u={t:"s",v:r[o]};else if(l>-1)u={t:"s",v:e[l]};else if(!isNaN(c))u={t:"n",v:c};else throw new Error("Unsupported cell type ".concat(t.slice(0,4)));break;default:throw new Error("Unsupported cell type ".concat(t.slice(0,4)))}return u}function H5(t,e,r){var a=ha(t),n=a.getUint32(8,!0),i=12,s=-1,o=-1,l=NaN,c=NaN,h=new Date(2001,0,1);n&1&&(l=D5(t,i),i+=16),n&2&&(c=a.getFloat64(i,!0),i+=8),n&4&&(h.setTime(h.getTime()+a.getFloat64(i,!0)*1e3),i+=8),n&8&&(o=a.getUint32(i,!0),i+=4),n&16&&(s=a.getUint32(i,!0),i+=4);var u;switch(t[1]){case 0:break;case 2:u={t:"n",v:l};break;case 3:u={t:"s",v:e[o]};break;case 5:u={t:"d",v:h};break;case 6:u={t:"b",v:c>0};break;case 7:u={t:"n",v:c/86400};break;case 8:u={t:"e",v:0};break;case 9:if(s>-1)u={t:"s",v:r[s]};else throw new Error("Unsupported cell type ".concat(t[1]," : ").concat(n&31," : ").concat(t.slice(0,4)));break;case 10:u={t:"n",v:l};break;default:throw new Error("Unsupported cell type ".concat(t[1]," : ").concat(n&31," : ").concat(t.slice(0,4)))}return u}function Ii(t,e){var r=new Uint8Array(32),a=ha(r),n=12,i=0;switch(r[0]=5,t.t){case"n":r[1]=2,R5(r,n,t.v),i|=1,n+=16;break;case"b":r[1]=6,a.setFloat64(n,t.v?1:0,!0),i|=2,n+=8;break;case"s":if(e.indexOf(t.v)==-1)throw new Error("Value ".concat(t.v," missing from SST!"));r[1]=3,a.setUint32(n,e.indexOf(t.v),!0),i|=8,n+=4;break;default:throw"unsupported cell type "+t.t}return a.setUint32(8,i,!0),r.slice(0,n)}function Ni(t,e){var r=new Uint8Array(32),a=ha(r),n=12,i=0;switch(r[0]=3,t.t){case"n":r[2]=2,a.setFloat64(n,t.v,!0),i|=32,n+=8;break;case"b":r[2]=6,a.setFloat64(n,t.v?1:0,!0),i|=32,n+=8;break;case"s":if(e.indexOf(t.v)==-1)throw new Error("Value ".concat(t.v," missing from SST!"));r[2]=3,a.setUint32(n,e.indexOf(t.v),!0),i|=16,n+=4;break;default:throw"unsupported cell type "+t.t}return a.setUint32(4,i,!0),r.slice(0,n)}function U5(t,e,r){switch(t[0]){case 0:case 1:case 2:case 3:return V5(t,e,r,t[0]);case 5:return H5(t,e,r);default:throw new Error("Unsupported payload version ".concat(t[0]))}}function vt(t){var e=Me(t);return mn(e[1][0].data)}function u0(t,e){var r=Me(e.data),a=Ye(r[1][0].data),n=r[3],i=[];return(n||[]).forEach(function(s){var o=Me(s.data),l=Ye(o[1][0].data)>>>0;switch(a){case 1:i[l]=Zi(o[3][0].data);break;case 8:{var c=t[vt(o[9][0].data)][0],h=Me(c.data),u=t[vt(h[1][0].data)][0],f=Ye(u.meta[1][0].data);if(f!=2001)throw new Error("2000 unexpected reference to ".concat(f));var p=Me(u.data);i[l]=p[3].map(function(m){return Zi(m.data)}).join("")}break}}),i}function W5(t,e){var r,a,n,i,s,o,l,c,h,u,f,p,m,d,g=Me(t),x=Ye(g[1][0].data)>>>0,w=Ye(g[2][0].data)>>>0,v=((a=(r=g[8])==null?void 0:r[0])==null?void 0:a.data)&&Ye(g[8][0].data)>0||!1,I,L;if((i=(n=g[7])==null?void 0:n[0])!=null&&i.data&&e!=0)I=(o=(s=g[7])==null?void 0:s[0])==null?void 0:o.data,L=(c=(l=g[6])==null?void 0:l[0])==null?void 0:c.data;else if((u=(h=g[4])==null?void 0:h[0])!=null&&u.data&&e!=1)I=(p=(f=g[4])==null?void 0:f[0])==null?void 0:p.data,L=(d=(m=g[3])==null?void 0:m[0])==null?void 0:d.data;else throw"NUMBERS Tile missing ".concat(e," cell storage");for(var _=v?4:1,C=ha(I),M=[],N=0;N<I.length/2;++N){var z=C.getUint16(N*2,!0);z<65535&&M.push([N,z])}if(M.length!=w)throw"Expected ".concat(w," cells, found ").concat(M.length);var B=[];for(N=0;N<M.length-1;++N)B[M[N][0]]=L.subarray(M[N][1]*_,M[N+1][1]*_);return M.length>=1&&(B[M[M.length-1][0]]=L.subarray(M[M.length-1][1]*_)),{R:x,cells:B}}function $5(t,e){var r,a=Me(e.data),n=(r=a==null?void 0:a[7])!=null&&r[0]?Ye(a[7][0].data)>>>0>0?1:0:-1,i=Hs(a[5],function(s){return W5(s,n)});return{nrows:Ye(a[4][0].data)>>>0,data:i.reduce(function(s,o){return s[o.R]||(s[o.R]=[]),o.cells.forEach(function(l,c){if(s[o.R][c])throw new Error("Duplicate cell r=".concat(o.R," c=").concat(c));s[o.R][c]=l}),s},[])}}function G5(t,e,r){var a,n=Me(e.data),i={s:{r:0,c:0},e:{r:0,c:0}};if(i.e.r=(Ye(n[6][0].data)>>>0)-1,i.e.r<0)throw new Error("Invalid row varint ".concat(n[6][0].data));if(i.e.c=(Ye(n[7][0].data)>>>0)-1,i.e.c<0)throw new Error("Invalid col varint ".concat(n[7][0].data));r["!ref"]=Ce(i);var s=Me(n[4][0].data),o=u0(t,t[vt(s[4][0].data)][0]),l=(a=s[17])!=null&&a[0]?u0(t,t[vt(s[17][0].data)][0]):[],c=Me(s[3][0].data),h=0;c[1].forEach(function(u){var f=Me(u.data),p=t[vt(f[2][0].data)][0],m=Ye(p.meta[1][0].data);if(m!=6002)throw new Error("6001 unexpected reference to ".concat(m));var d=$5(t,p);d.data.forEach(function(g,x){g.forEach(function(w,v){var I=xe({r:h+x,c:v}),L=U5(w,o,l);L&&(r[I]=L)})}),h+=d.nrows})}function z5(t,e){var r=Me(e.data),a={"!ref":"A1"},n=t[vt(r[2][0].data)],i=Ye(n[0].meta[1][0].data);if(i!=6001)throw new Error("6000 unexpected reference to ".concat(i));return G5(t,n[0],a),a}function X5(t,e){var r,a=Me(e.data),n={name:(r=a[1])!=null&&r[0]?Zi(a[1][0].data):"",sheets:[]},i=Hs(a[2],vt);return i.forEach(function(s){t[s].forEach(function(o){var l=Ye(o.meta[1][0].data);l==6e3&&n.sheets.push(z5(t,o))})}),n}function j5(t,e){var r=zs(),a=Me(e.data),n=Hs(a[1],vt);if(n.forEach(function(i){t[i].forEach(function(s){var o=Ye(s.meta[1][0].data);if(o==2){var l=X5(t,s);l.sheets.forEach(function(c,h){Xs(r,c,h==0?l.name:l.name+"_"+h,!0)})}})}),r.SheetNames.length==0)throw new Error("Empty NUMBERS file");return r}function Mi(t){var e,r,a,n,i={},s=[];if(t.FullPaths.forEach(function(l){if(l.match(/\.iwpv2/))throw new Error("Unsupported password protection")}),t.FileIndex.forEach(function(l){if(l.name.match(/\.iwa$/)){var c;try{c=Gt(l.content)}catch(u){return console.log("?? "+l.content.length+" "+(u.message||u))}var h;try{h=$t(c)}catch(u){return console.log("## "+(u.message||u))}h.forEach(function(u){i[u.id]=u.messages,s.push(u.id)})}}),!s.length)throw new Error("File has no messages");var o=((n=(a=(r=(e=i==null?void 0:i[1])==null?void 0:e[0])==null?void 0:r.meta)==null?void 0:a[1])==null?void 0:n[0].data)&&Ye(i[1][0].meta[1][0].data)==1&&i[1][0];if(o||s.forEach(function(l){i[l].forEach(function(c){var h=Ye(c.meta[1][0].data)>>>0;if(h==1)if(!o)o=c;else throw new Error("Document has multiple roots")})}),!o)throw new Error("Cannot find Document root");return j5(i,o)}function K5(t,e,r){var a,n,i,s;if(!((a=t[6])!=null&&a[0])||!((n=t[7])!=null&&n[0]))throw"Mutation only works on post-BNC storages!";var o=((s=(i=t[8])==null?void 0:i[0])==null?void 0:s.data)&&Ye(t[8][0].data)>0||!1;if(o)throw"Math only works with normal offsets";for(var l=0,c=ha(t[7][0].data),h=0,u=[],f=ha(t[4][0].data),p=0,m=[],d=0;d<e.length;++d){if(e[d]==null){c.setUint16(d*2,65535,!0),f.setUint16(d*2,65535);continue}c.setUint16(d*2,h,!0),f.setUint16(d*2,p,!0);var g,x;switch(typeof e[d]){case"string":g=Ii({t:"s",v:e[d]},r),x=Ni({t:"s",v:e[d]},r);break;case"number":g=Ii({t:"n",v:e[d]},r),x=Ni({t:"n",v:e[d]},r);break;case"boolean":g=Ii({t:"b",v:e[d]},r),x=Ni({t:"b",v:e[d]},r);break;default:throw new Error("Unsupported value "+e[d])}u.push(g),h+=g.length,m.push(x),p+=x.length,++l}for(t[2][0].data=Pe(l);d<t[7][0].data.length/2;++d)c.setUint16(d*2,65535,!0),f.setUint16(d*2,65535,!0);return t[6][0].data=Vr(u),t[3][0].data=Vr(m),l}function Y5(t,e){if(!e||!e.numbers)throw new Error("Must pass a `numbers` option -- check the README");var r=t.Sheets[t.SheetNames[0]];t.SheetNames.length>1&&console.error("The Numbers writer currently writes only the first table");var a=Nt(r["!ref"]);a.s.r=a.s.c=0;var n=!1;a.e.c>9&&(n=!0,a.e.c=9),a.e.r>49&&(n=!0,a.e.r=49),n&&console.error("The Numbers writer is currently limited to ".concat(Ce(a)));var i=ni(r,{range:a,header:1}),s=["~Sh33tJ5~"];i.forEach(function(R){return R.forEach(function(O){typeof O=="string"&&s.push(O)})});var o={},l=[],c=pe.read(e.numbers,{type:"base64"});c.FileIndex.map(function(R,O){return[R,c.FullPaths[O]]}).forEach(function(R){var O=R[0],P=R[1];if(O.type==2&&O.name.match(/\.iwa/)){var K=O.content,te=Gt(K),re=$t(te);re.forEach(function(Q){l.push(Q.id),o[Q.id]={deps:[],location:P,type:Ye(Q.messages[0].meta[1][0].data)}})}}),l.sort(function(R,O){return R-O});var h=l.filter(function(R){return R>1}).map(function(R){return[R,Pe(R)]});c.FileIndex.map(function(R,O){return[R,c.FullPaths[O]]}).forEach(function(R){var O=R[0];if(R[1],!!O.name.match(/\.iwa/)){var P=$t(Gt(O.content));P.forEach(function(K){K.messages.forEach(function(te){h.forEach(function(re){K.messages.some(function(Q){return Ye(Q.meta[1][0].data)!=11006&&P5(Q.data,re[1])})&&o[re[0]].deps.push(K.id)})})})}});for(var u=pe.find(c,o[1].location),f=$t(Gt(u.content)),p,m=0;m<f.length;++m){var d=f[m];d.id==1&&(p=d)}var g=vt(Me(p.messages[0].data)[1][0].data);for(u=pe.find(c,o[g].location),f=$t(Gt(u.content)),m=0;m<f.length;++m)d=f[m],d.id==g&&(p=d);for(g=vt(Me(p.messages[0].data)[2][0].data),u=pe.find(c,o[g].location),f=$t(Gt(u.content)),m=0;m<f.length;++m)d=f[m],d.id==g&&(p=d);for(g=vt(Me(p.messages[0].data)[2][0].data),u=pe.find(c,o[g].location),f=$t(Gt(u.content)),m=0;m<f.length;++m)d=f[m],d.id==g&&(p=d);var x=Me(p.messages[0].data);{x[6][0].data=Pe(a.e.r+1),x[7][0].data=Pe(a.e.c+1);var w=vt(x[46][0].data),v=pe.find(c,o[w].location),I=$t(Gt(v.content));{for(var L=0;L<I.length&&I[L].id!=w;++L);if(I[L].id!=w)throw"Bad ColumnRowUIDMapArchive";var _=Me(I[L].messages[0].data);_[1]=[],_[2]=[],_[3]=[];for(var C=0;C<=a.e.c;++C){var M=[];M[1]=M[2]=[{type:0,data:Pe(C+420690)}],_[1].push({type:2,data:ut(M)}),_[2].push({type:0,data:Pe(C)}),_[3].push({type:0,data:Pe(C)})}_[4]=[],_[5]=[],_[6]=[];for(var N=0;N<=a.e.r;++N)M=[],M[1]=M[2]=[{type:0,data:Pe(N+726270)}],_[4].push({type:2,data:ut(M)}),_[5].push({type:0,data:Pe(N)}),_[6].push({type:0,data:Pe(N)});I[L].messages[0].data=ut(_)}v.content=wa(va(I)),v.size=v.content.length,delete x[46];var z=Me(x[4][0].data);{z[7][0].data=Pe(a.e.r+1);var B=Me(z[1][0].data),D=vt(B[2][0].data);v=pe.find(c,o[D].location),I=$t(Gt(v.content));{if(I[0].id!=D)throw"Bad HeaderStorageBucket";var q=Me(I[0].messages[0].data);for(N=0;N<i.length;++N){var oe=Me(q[2][0].data);oe[1][0].data=Pe(N),oe[4][0].data=Pe(i[N].length),q[2][N]={type:q[2][0].type,data:ut(oe)}}I[0].messages[0].data=ut(q)}v.content=wa(va(I)),v.size=v.content.length;var ie=vt(z[2][0].data);v=pe.find(c,o[ie].location),I=$t(Gt(v.content));{if(I[0].id!=ie)throw"Bad HeaderStorageBucket";for(q=Me(I[0].messages[0].data),C=0;C<=a.e.c;++C)oe=Me(q[2][0].data),oe[1][0].data=Pe(C),oe[4][0].data=Pe(a.e.r+1),q[2][C]={type:q[2][0].type,data:ut(oe)};I[0].messages[0].data=ut(q)}v.content=wa(va(I)),v.size=v.content.length;var he=vt(z[4][0].data);(function(){for(var R=pe.find(c,o[he].location),O=$t(Gt(R.content)),P,K=0;K<O.length;++K){var te=O[K];te.id==he&&(P=te)}var re=Me(P.messages[0].data);{re[3]=[];var Q=[];s.forEach(function(A,He){Q[1]=[{type:0,data:Pe(He)}],Q[2]=[{type:0,data:Pe(1)}],Q[3]=[{type:2,data:O5(A)}],re[3].push({type:2,data:ut(Q)})})}P.messages[0].data=ut(re);var J=va(O),ke=wa(J);R.content=ke,R.size=R.content.length})();var le=Me(z[3][0].data);{var Fe=le[1][0];delete le[2];var W=Me(Fe.data);{var me=vt(W[2][0].data);(function(){for(var R=pe.find(c,o[me].location),O=$t(Gt(R.content)),P,K=0;K<O.length;++K){var te=O[K];te.id==me&&(P=te)}var re=Me(P.messages[0].data);{delete re[6],delete le[7];var Q=new Uint8Array(re[5][0].data);re[5]=[];for(var J=0,ke=0;ke<=a.e.r;++ke){var A=Me(Q);J+=K5(A,i[ke],s),A[1][0].data=Pe(ke),re[5].push({data:ut(A),type:2})}re[1]=[{type:0,data:Pe(a.e.c+1)}],re[2]=[{type:0,data:Pe(a.e.r+1)}],re[3]=[{type:0,data:Pe(J)}],re[4]=[{type:0,data:Pe(a.e.r+1)}]}P.messages[0].data=ut(re);var He=va(O),Ae=wa(He);R.content=Ae,R.size=R.content.length})()}Fe.data=ut(W)}z[3][0].data=ut(le)}x[4][0].data=ut(z)}p.messages[0].data=ut(x);var de=va(f),F=wa(de);return u.content=F,u.size=u.content.length,c}function bc(t){return function(r){for(var a=0;a!=t.length;++a){var n=t[a];r[n[0]]===void 0&&(r[n[0]]=n[1]),n[2]==="n"&&(r[n[0]]=Number(r[n[0]]))}}}function Us(t){bc([["cellNF",!1],["cellHTML",!0],["cellFormula",!0],["cellStyles",!1],["cellText",!0],["cellDates",!1],["sheetStubs",!1],["sheetRows",0,"n"],["bookDeps",!1],["bookSheets",!1],["bookProps",!1],["bookFiles",!1],["bookVBA",!1],["password",""],["WTF",!1]])(t)}function Ws(t){bc([["cellDates",!1],["bookSST",!1],["bookType","xlsx"],["compression",!1],["WTF",!1]])(t)}function q5(t){return Se.WS.indexOf(t)>-1?"sheet":t==Se.CS?"chart":t==Se.DS?"dialog":t==Se.MS?"macro":t&&t.length?t:"sheet"}function J5(t,e){if(!t)return 0;try{t=e.map(function(a){return a.id||(a.id=a.strRelID),[a.name,t["!id"][a.id].Target,q5(t["!id"][a.id].Type)]})}catch{return null}return!t||t.length===0?null:t}function Z5(t,e,r,a,n,i,s,o,l,c,h,u){try{i[a]=qa(Rt(t,r,!0),e);var f=at(t,e),p;switch(o){case"sheet":p=Ev(f,e,n,l,i[a],c,h,u);break;case"chart":if(p=Cv(f,e,n,l,i[a],c,h,u),!p||!p["!drawel"])break;var m=Ga(p["!drawel"].Target,e),d=cn(m),g=om(Rt(t,m,!0),qa(Rt(t,d,!0),m)),x=Ga(g,m),w=cn(x);p=Kx(Rt(t,x,!0),x,l,qa(Rt(t,w,!0),x),c,p);break;case"macro":p=yv(f,e,n,l,i[a],c,h,u);break;case"dialog":p=kv(f,e,n,l,i[a],c,h,u);break;default:throw new Error("Unrecognized sheet type "+o)}s[a]=p;var v=[];i&&i[a]&&qe(i[a]).forEach(function(I){var L="";if(i[a][I].Type==Se.CMNT){L=Ga(i[a][I].Target,e);var _=bv(at(t,L,!0),L,l);if(!_||!_.length)return;Jo(p,_,!1)}i[a][I].Type==Se.TCMNT&&(L=Ga(i[a][I].Target,e),v=v.concat(cm(at(t,L,!0),l)))}),v&&v.length&&Jo(p,v,!0,l.people||[])}catch(I){if(l.WTF)throw I}}function Ut(t){return t.charAt(0)=="/"?t.slice(1):t}function Q5(t,e){if(Ma(),e=e||{},Us(e),zt(t,"META-INF/manifest.xml")||zt(t,"objectdata.xml"))return l0(t,e);if(zt(t,"Index/Document.iwa")){if(typeof Uint8Array>"u")throw new Error("NUMBERS file parsing requires Uint8Array support");if(typeof Mi<"u"){if(t.FileIndex)return Mi(t);var r=pe.utils.cfb_new();return vo(t).forEach(function(oe){ye(r,oe,hf(t,oe))}),Mi(r)}throw new Error("Unsupported NUMBERS file")}if(!zt(t,"[Content_Types].xml"))throw zt(t,"index.xml.gz")?new Error("Unsupported NUMBERS 08 file"):zt(t,"index.xml")?new Error("Unsupported NUMBERS 09 file"):new Error("Unsupported ZIP file");var a=vo(t),n=au(Rt(t,"[Content_Types].xml")),i=!1,s,o;if(n.workbooks.length===0&&(o="xl/workbook.xml",at(t,o,!0)&&n.workbooks.push(o)),n.workbooks.length===0){if(o="xl/workbook.bin",!at(t,o,!0))throw new Error("Could not find workbook");n.workbooks.push(o),i=!0}n.workbooks[0].slice(-3)=="bin"&&(i=!0);var l={},c={};if(!e.bookSheets&&!e.bookProps){if(Ja=[],n.sst)try{Ja=Sv(at(t,Ut(n.sst)),n.sst,e)}catch(oe){if(e.WTF)throw oe}e.cellStyles&&n.themes.length&&(l=Tv(Rt(t,n.themes[0].replace(/^\//,""),!0)||"",n.themes[0],e)),n.style&&(c=_v(at(t,Ut(n.style)),n.style,l,e))}n.links.map(function(oe){try{var ie=qa(Rt(t,cn(Ut(oe))),oe);return Fv(at(t,Ut(oe)),ie,oe,e)}catch{}});var h=wv(at(t,Ut(n.workbooks[0])),n.workbooks[0],e),u={},f="";n.coreprops.length&&(f=at(t,Ut(n.coreprops[0]),!0),f&&(u=ml(f)),n.extprops.length!==0&&(f=at(t,Ut(n.extprops[0]),!0),f&&hu(f,u,e)));var p={};(!e.bookSheets||e.bookProps)&&n.custprops.length!==0&&(f=Rt(t,Ut(n.custprops[0]),!0),f&&(p=uu(f,e)));var m={};if((e.bookSheets||e.bookProps)&&(h.Sheets?s=h.Sheets.map(function(ie){return ie.name}):u.Worksheets&&u.SheetNames.length>0&&(s=u.SheetNames),e.bookProps&&(m.Props=u,m.Custprops=p),e.bookSheets&&typeof s<"u"&&(m.SheetNames=s),e.bookSheets?m.SheetNames:e.bookProps))return m;s={};var d={};e.bookDeps&&n.calcchain&&(d=Lv(at(t,Ut(n.calcchain)),n.calcchain));var g=0,x={},w,v;{var I=h.Sheets;u.Worksheets=I.length,u.SheetNames=[];for(var L=0;L!=I.length;++L)u.SheetNames[L]=I[L].name}var _=i?"bin":"xml",C=n.workbooks[0].lastIndexOf("/"),M=(n.workbooks[0].slice(0,C+1)+"_rels/"+n.workbooks[0].slice(C+1)+".rels").replace(/^\//,"");zt(t,M)||(M="xl/_rels/workbook."+_+".rels");var N=qa(Rt(t,M,!0),M.replace(/_rels.*/,"s5s"));(n.metadata||[]).length>=1&&(e.xlmeta=Av(at(t,Ut(n.metadata[0])),n.metadata[0],e)),(n.people||[]).length>=1&&(e.people=fm(at(t,Ut(n.people[0])),e)),N&&(N=J5(N,h.Sheets));var z=at(t,"xl/worksheets/sheet.xml",!0)?1:0;e:for(g=0;g!=u.Worksheets;++g){var B="sheet";if(N&&N[g]?(w="xl/"+N[g][1].replace(/[\/]?xl\//,""),zt(t,w)||(w=N[g][1]),zt(t,w)||(w=M.replace(/_rels\/.*$/,"")+N[g][1]),B=N[g][2]):(w="xl/worksheets/sheet"+(g+1-z)+"."+_,w=w.replace(/sheet0\./,"sheet.")),v=w.replace(/^(.*)(\/)([^\/]*)$/,"$1/_rels/$3.rels"),e&&e.sheets!=null)switch(typeof e.sheets){case"number":if(g!=e.sheets)continue e;break;case"string":if(u.SheetNames[g].toLowerCase()!=e.sheets.toLowerCase())continue e;break;default:if(Array.isArray&&Array.isArray(e.sheets)){for(var D=!1,q=0;q!=e.sheets.length;++q)typeof e.sheets[q]=="number"&&e.sheets[q]==g&&(D=1),typeof e.sheets[q]=="string"&&e.sheets[q].toLowerCase()==u.SheetNames[g].toLowerCase()&&(D=1);if(!D)continue e}}Z5(t,w,v,u.SheetNames[g],g,x,s,B,e,h,l,c)}return m={Directory:n,Workbook:h,Props:u,Custprops:p,Deps:d,Sheets:s,SheetNames:u.SheetNames,Strings:Ja,Styles:c,Themes:l,SSF:$e(ge)},e&&e.bookFiles&&(t.files?(m.keys=a,m.files=t.files):(m.keys=[],m.files={},t.FullPaths.forEach(function(oe,ie){oe=oe.replace(/^Root Entry[\/]/,""),m.keys.push(oe),m.files[oe]=t.FileIndex[ie]}))),e&&e.bookVBA&&(n.vba.length>0?m.vbaraw=at(t,Ut(n.vba[0]),!0):n.defaults&&n.defaults.bin===wm&&(m.vbaraw=at(t,"xl/vbaProject.bin",!0))),m}function e4(t,e){var r=e||{},a="Workbook",n=pe.find(t,a);try{if(a="/!DataSpaces/Version",n=pe.find(t,a),!n||!n.content)throw new Error("ECMA-376 Encrypted file missing "+a);if(Ad(n.content),a="/!DataSpaces/DataSpaceMap",n=pe.find(t,a),!n||!n.content)throw new Error("ECMA-376 Encrypted file missing "+a);var i=Nd(n.content);if(i.length!==1||i[0].comps.length!==1||i[0].comps[0].t!==0||i[0].name!=="StrongEncryptionDataSpace"||i[0].comps[0].v!=="EncryptedPackage")throw new Error("ECMA-376 Encrypted file bad "+a);if(a="/!DataSpaces/DataSpaceInfo/StrongEncryptionDataSpace",n=pe.find(t,a),!n||!n.content)throw new Error("ECMA-376 Encrypted file missing "+a);var s=Md(n.content);if(s.length!=1||s[0]!="StrongEncryptionTransform")throw new Error("ECMA-376 Encrypted file bad "+a);if(a="/!DataSpaces/TransformInfo/StrongEncryptionTransform/!Primary",n=pe.find(t,a),!n||!n.content)throw new Error("ECMA-376 Encrypted file missing "+a);Pd(n.content)}catch{}if(a="/EncryptionInfo",n=pe.find(t,a),!n||!n.content)throw new Error("ECMA-376 Encrypted file missing "+a);var o=Dd(n.content);if(a="/EncryptedPackage",n=pe.find(t,a),!n||!n.content)throw new Error("ECMA-376 Encrypted file missing "+a);if(o[0]==4&&typeof decrypt_agile<"u")return decrypt_agile(o[1],n.content,r.password||"",r);if(o[0]==2&&typeof decrypt_std76<"u")return decrypt_std76(o[1],n.content,r.password||"",r);throw new Error("File is password-protected")}function t4(t,e){return e.bookType=="ods"?Sc(t,e):e.bookType=="numbers"?Y5(t,e):e.bookType=="xlsb"?r4(t,e):a4(t,e)}function r4(t,e){Ca=1024,t&&!t.SSF&&(t.SSF=$e(ge)),t&&t.SSF&&(Ma(),fi(t.SSF),e.revssf=di(t.SSF),e.revssf[t.SSF[65535]]=0,e.ssf=t.SSF),e.rels={},e.wbrels={},e.Strings=[],e.Strings.Count=0,e.Strings.Unique=0,Za?e.revStrings=new Map:(e.revStrings={},e.revStrings.foo=[],delete e.revStrings.foo);var r=e.bookType=="xlsb"?"bin":"xml",a=ec.indexOf(e.bookType)>-1,n=bs();Ws(e=e||{});var i=ds(),s="",o=0;if(e.cellXfs=[],Wr(e.cellXfs,{},{revssf:{General:0}}),t.Props||(t.Props={}),s="docProps/core.xml",ye(i,s,gl(t.Props,e)),n.coreprops.push(s),De(e.rels,2,s,Se.CORE_PROPS),s="docProps/app.xml",!(t.Props&&t.Props.SheetNames))if(!t.Workbook||!t.Workbook.Sheets)t.Props.SheetNames=t.SheetNames;else{for(var l=[],c=0;c<t.SheetNames.length;++c)(t.Workbook.Sheets[c]||{}).Hidden!=2&&l.push(t.SheetNames[c]);t.Props.SheetNames=l}for(t.Props.Worksheets=t.Props.SheetNames.length,ye(i,s,wl(t.Props)),n.extprops.push(s),De(e.rels,3,s,Se.EXT_PROPS),t.Custprops!==t.Props&&qe(t.Custprops||{}).length>0&&(s="docProps/custom.xml",ye(i,s,El(t.Custprops)),n.custprops.push(s),De(e.rels,4,s,Se.CUST_PROPS)),o=1;o<=t.SheetNames.length;++o){var h={"!id":{}},u=t.Sheets[t.SheetNames[o-1]],f=(u||{})["!type"]||"sheet";switch(f){case"chart":default:s="xl/worksheets/sheet"+o+"."+r,ye(i,s,Nv(o-1,s,e,t,h)),n.sheets.push(s),De(e.wbrels,-1,"worksheets/sheet"+o+"."+r,Se.WS[0])}if(u){var p=u["!comments"],m=!1,d="";p&&p.length>0&&(d="xl/comments"+o+"."+r,ye(i,d,Pv(p,d)),n.comments.push(d),De(h,-1,"../comments"+o+"."+r,Se.CMNT),m=!0),u["!legacy"]&&m&&ye(i,"xl/drawings/vmlDrawing"+o+".vml",Zl(o,u["!comments"])),delete u["!comments"],delete u["!legacy"]}h["!id"].rId1&&ye(i,cn(s),Sa(h))}return e.Strings!=null&&e.Strings.length>0&&(s="xl/sharedStrings."+r,ye(i,s,Ov(e.Strings,s,e)),n.strs.push(s),De(e.wbrels,-1,"sharedStrings."+r,Se.SST)),s="xl/workbook."+r,ye(i,s,Iv(t,s)),n.workbooks.push(s),De(e.rels,1,s,Se.WB),s="xl/theme/theme1.xml",ye(i,s,Ms(t.Themes,e)),n.themes.push(s),De(e.wbrels,-1,"theme/theme1.xml",Se.THEME),s="xl/styles."+r,ye(i,s,Mv(t,s,e)),n.styles.push(s),De(e.wbrels,-1,"styles."+r,Se.STY),t.vbaraw&&a&&(s="xl/vbaProject.bin",ye(i,s,t.vbaraw),n.vba.push(s),De(e.wbrels,-1,"vbaProject.bin",Se.VBA)),s="xl/metadata."+r,ye(i,s,Dv(s)),n.metadata.push(s),De(e.wbrels,-1,"metadata."+r,Se.XLMETA),ye(i,"[Content_Types].xml",dl(n,e)),ye(i,"_rels/.rels",Sa(e.rels)),ye(i,"xl/_rels/workbook."+r+".rels",Sa(e.wbrels)),delete e.revssf,delete e.ssf,i}function a4(t,e){Ca=1024,t&&!t.SSF&&(t.SSF=$e(ge)),t&&t.SSF&&(Ma(),fi(t.SSF),e.revssf=di(t.SSF),e.revssf[t.SSF[65535]]=0,e.ssf=t.SSF),e.rels={},e.wbrels={},e.Strings=[],e.Strings.Count=0,e.Strings.Unique=0,Za?e.revStrings=new Map:(e.revStrings={},e.revStrings.foo=[],delete e.revStrings.foo);var r="xml",a=ec.indexOf(e.bookType)>-1,n=bs();Ws(e=e||{});var i=ds(),s="",o=0;if(e.cellXfs=[],Wr(e.cellXfs,{},{revssf:{General:0}}),t.Props||(t.Props={}),s="docProps/core.xml",ye(i,s,gl(t.Props,e)),n.coreprops.push(s),De(e.rels,2,s,Se.CORE_PROPS),s="docProps/app.xml",!(t.Props&&t.Props.SheetNames))if(!t.Workbook||!t.Workbook.Sheets)t.Props.SheetNames=t.SheetNames;else{for(var l=[],c=0;c<t.SheetNames.length;++c)(t.Workbook.Sheets[c]||{}).Hidden!=2&&l.push(t.SheetNames[c]);t.Props.SheetNames=l}t.Props.Worksheets=t.Props.SheetNames.length,ye(i,s,wl(t.Props)),n.extprops.push(s),De(e.rels,3,s,Se.EXT_PROPS),t.Custprops!==t.Props&&qe(t.Custprops||{}).length>0&&(s="docProps/custom.xml",ye(i,s,El(t.Custprops)),n.custprops.push(s),De(e.rels,4,s,Se.CUST_PROPS));var h=["SheetJ5"];for(e.tcid=0,o=1;o<=t.SheetNames.length;++o){var u={"!id":{}},f=t.Sheets[t.SheetNames[o-1]],p=(f||{})["!type"]||"sheet";switch(p){case"chart":default:s="xl/worksheets/sheet"+o+"."+r,ye(i,s,fc(o-1,e,t,u)),n.sheets.push(s),De(e.wbrels,-1,"worksheets/sheet"+o+"."+r,Se.WS[0])}if(f){var m=f["!comments"],d=!1,g="";if(m&&m.length>0){var x=!1;m.forEach(function(w){w[1].forEach(function(v){v.T==!0&&(x=!0)})}),x&&(g="xl/threadedComments/threadedComment"+o+"."+r,ye(i,g,hm(m,h,e)),n.threadedcomments.push(g),De(u,-1,"../threadedComments/threadedComment"+o+"."+r,Se.TCMNT)),g="xl/comments"+o+"."+r,ye(i,g,Ql(m)),n.comments.push(g),De(u,-1,"../comments"+o+"."+r,Se.CMNT),d=!0}f["!legacy"]&&d&&ye(i,"xl/drawings/vmlDrawing"+o+".vml",Zl(o,f["!comments"])),delete f["!comments"],delete f["!legacy"]}u["!id"].rId1&&ye(i,cn(s),Sa(u))}return e.Strings!=null&&e.Strings.length>0&&(s="xl/sharedStrings."+r,ye(i,s,Hl(e.Strings,e)),n.strs.push(s),De(e.wbrels,-1,"sharedStrings."+r,Se.SST)),s="xl/workbook."+r,ye(i,s,gc(t)),n.workbooks.push(s),De(e.rels,1,s,Se.WB),s="xl/theme/theme1.xml",ye(i,s,Ms(t.Themes,e)),n.themes.push(s),De(e.wbrels,-1,"theme/theme1.xml",Se.THEME),s="xl/styles."+r,ye(i,s,Kl(t,e)),n.styles.push(s),De(e.wbrels,-1,"styles."+r,Se.STY),t.vbaraw&&a&&(s="xl/vbaProject.bin",ye(i,s,t.vbaraw),n.vba.push(s),De(e.wbrels,-1,"vbaProject.bin",Se.VBA)),s="xl/metadata."+r,ye(i,s,Jl()),n.metadata.push(s),De(e.wbrels,-1,"metadata."+r,Se.XLMETA),h.length>1&&(s="xl/persons/person.xml",ye(i,s,um(h)),n.people.push(s),De(e.wbrels,-1,"persons/person.xml",Se.PEOPLE)),ye(i,"[Content_Types].xml",dl(n,e)),ye(i,"_rels/.rels",Sa(e.rels)),ye(i,"xl/_rels/workbook."+r+".rels",Sa(e.wbrels)),delete e.revssf,delete e.ssf,i}function $s(t,e){var r="";switch((e||{}).type||"base64"){case"buffer":return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7]];case"base64":r=Bt(t.slice(0,12));break;case"binary":r=t;break;case"array":return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7]];default:throw new Error("Unrecognized type "+(e&&e.type||"undefined"))}return[r.charCodeAt(0),r.charCodeAt(1),r.charCodeAt(2),r.charCodeAt(3),r.charCodeAt(4),r.charCodeAt(5),r.charCodeAt(6),r.charCodeAt(7)]}function n4(t,e){return pe.find(t,"EncryptedPackage")?e4(t,e):Ec(t,e)}function i4(t,e){var r,a=t,n=e||{};return n.type||(n.type=_e&&Buffer.isBuffer(t)?"buffer":"base64"),r=W0(a,n),Q5(r,n)}function Lc(t,e){var r=0;e:for(;r<t.length;)switch(t.charCodeAt(r)){case 10:case 13:case 32:++r;break;case 60:return qi(t.slice(r),e);default:break e}return Aa.to_workbook(t,e)}function s4(t,e){var r="",a=$s(t,e);switch(e.type){case"base64":r=Bt(t);break;case"binary":r=t;break;case"buffer":r=t.toString("binary");break;case"array":r=sa(t);break;default:throw new Error("Unrecognized type "+e.type)}return a[0]==239&&a[1]==187&&a[2]==191&&(r=Be(r)),e.type="binary",Lc(r,e)}function o4(t,e){var r=t;return e.type=="base64"&&(r=Bt(r)),r=Ui.utils.decode(1200,r.slice(2),"str"),e.type="binary",Lc(r,e)}function l4(t){return t.match(/[^\x00-\x7F]/)?mr(t):t}function Oi(t,e,r,a){return a?(r.type="string",Aa.to_workbook(t,r)):Aa.to_workbook(e,r)}function ai(t,e){ls();var r=e||{};if(typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer)return ai(new Uint8Array(t),(r=$e(r),r.type="array",r));typeof Uint8Array<"u"&&t instanceof Uint8Array&&!r.type&&(r.type=typeof Deno<"u"?"buffer":"array");var a=t,n=[0,0,0,0],i=!1;if(r.cellStyles&&(r.cellNF=!0,r.sheetStubs=!0),La={},r.dateNF&&(La.dateNF=r.dateNF),r.type||(r.type=_e&&Buffer.isBuffer(t)?"buffer":"base64"),r.type=="file"&&(r.type=_e?"buffer":"binary",a=tf(t),typeof Uint8Array<"u"&&!_e&&(r.type="array")),r.type=="string"&&(i=!0,r.type="binary",r.codepage=65001,a=l4(t)),r.type=="array"&&typeof Uint8Array<"u"&&t instanceof Uint8Array&&typeof ArrayBuffer<"u"){var s=new ArrayBuffer(3),o=new Uint8Array(s);if(o.foo="bar",!o.foo)return r=$e(r),r.type="array",ai(cs(a),r)}switch((n=$s(a,r))[0]){case 208:if(n[1]===207&&n[2]===17&&n[3]===224&&n[4]===161&&n[5]===177&&n[6]===26&&n[7]===225)return n4(pe.read(a,r),r);break;case 9:if(n[1]<=8)return Ec(a,r);break;case 60:return qi(a,r);case 73:if(n[1]===73&&n[2]===42&&n[3]===0)throw new Error("TIFF Image File is not a spreadsheet");if(n[1]===68)return dd(a,r);break;case 84:if(n[1]===65&&n[2]===66&&n[3]===76)return Bl.to_workbook(a,r);break;case 80:return n[1]===75&&n[2]<9&&n[3]<9?i4(a,r):Oi(t,a,r,i);case 239:return n[3]===60?qi(a,r):Oi(t,a,r,i);case 255:if(n[1]===254)return o4(a,r);if(n[1]===0&&n[2]===2&&n[3]===0)return ea.to_workbook(a,r);break;case 0:if(n[1]===0&&(n[2]>=2&&n[3]===0||n[2]===0&&(n[3]===8||n[3]===9)))return ea.to_workbook(a,r);break;case 3:case 131:case 139:case 140:return Yi.to_workbook(a,r);case 123:if(n[1]===92&&n[2]===114&&n[3]===116)return zl.to_workbook(a,r);break;case 10:case 13:case 32:return s4(a,r);case 137:if(n[1]===80&&n[2]===78&&n[3]===71)throw new Error("PNG Image File is not a spreadsheet");break}return ud.indexOf(n[0])>-1&&n[2]<=12&&n[3]<=31?Yi.to_workbook(a,r):Oi(t,a,r,i)}function Fc(t,e){switch(e.type){case"base64":case"binary":break;case"buffer":case"array":e.type="";break;case"file":return vn(e.file,pe.write(t,{type:_e?"buffer":""}));case"string":throw new Error("'string' output type invalid for '"+e.bookType+"' files");default:throw new Error("Unrecognized type "+e.type)}return pe.write(t,e)}function c4(t,e){var r=$e(e||{}),a=t4(t,r);return h4(a,r)}function h4(t,e){var r={},a=_e?"nodebuffer":typeof Uint8Array<"u"?"array":"string";if(e.compression&&(r.compression="DEFLATE"),e.password)r.type=a;else switch(e.type){case"base64":r.type="base64";break;case"binary":r.type="string";break;case"string":throw new Error("'string' output type invalid for '"+e.bookType+"' files");case"buffer":case"file":r.type=a;break;default:throw new Error("Unrecognized type "+e.type)}var n=t.FullPaths?pe.write(t,{fileType:"zip",type:{nodebuffer:"buffer",string:"binary"}[r.type]||r.type,compression:!!e.compression}):t.generate(r);if(typeof Deno<"u"&&typeof n=="string"){if(e.type=="binary"||e.type=="base64")return n;n=new Uint8Array(hi(n))}return e.password&&typeof encrypt_agile<"u"?Fc(encrypt_agile(n,e.password),e):e.type==="file"?vn(e.file,n):e.type=="string"?Be(n):n}function f4(t,e){var r=e||{},a=l5(t,r);return Fc(a,r)}function dr(t,e,r){r||(r="");var a=r+t;switch(e.type){case"base64":return an(mr(a));case"binary":return mr(a);case"string":return t;case"file":return vn(e.file,a,"utf8");case"buffer":return _e?Lr(a,"utf8"):typeof TextEncoder<"u"?new TextEncoder().encode(a):dr(a,{type:"binary"}).split("").map(function(n){return n.charCodeAt(0)})}throw new Error("Unrecognized type "+e.type)}function u4(t,e){switch(e.type){case"base64":return an(t);case"binary":return t;case"string":return t;case"file":return vn(e.file,t,"binary");case"buffer":return _e?Lr(t,"binary"):t.split("").map(function(r){return r.charCodeAt(0)})}throw new Error("Unrecognized type "+e.type)}function Rn(t,e){switch(e.type){case"string":case"base64":case"binary":for(var r="",a=0;a<t.length;++a)r+=String.fromCharCode(t[a]);return e.type=="base64"?an(r):e.type=="string"?Be(r):r;case"file":return vn(e.file,t);case"buffer":return t;default:throw new Error("Unrecognized type "+e.type)}}function Ac(t,e){ls(),nv(t);var r=$e(e||{});if(r.cellStyles&&(r.cellNF=!0,r.sheetStubs=!0),r.type=="array"){r.type="binary";var a=Ac(t,r);return r.type="array",hi(a)}var n=0;if(r.sheet&&(typeof r.sheet=="number"?n=r.sheet:n=t.SheetNames.indexOf(r.sheet),!t.SheetNames[n]))throw new Error("Sheet not found: "+r.sheet+" : "+typeof r.sheet);switch(r.bookType||"xlsb"){case"xml":case"xlml":return dr(t5(t,r),r);case"slk":case"sylk":return dr(Rl.from_sheet(t.Sheets[t.SheetNames[n]],r),r);case"htm":case"html":return dr(yc(t.Sheets[t.SheetNames[n]],r),r);case"txt":return u4(Ic(t.Sheets[t.SheetNames[n]],r),r);case"csv":return dr(Gs(t.Sheets[t.SheetNames[n]],r),r,"\uFEFF");case"dif":return dr(Bl.from_sheet(t.Sheets[t.SheetNames[n]],r),r);case"dbf":return Rn(Yi.from_sheet(t.Sheets[t.SheetNames[n]],r),r);case"prn":return dr(Aa.from_sheet(t.Sheets[t.SheetNames[n]],r),r);case"rtf":return dr(zl.from_sheet(t.Sheets[t.SheetNames[n]],r),r);case"eth":return dr(Vl.from_sheet(t.Sheets[t.SheetNames[n]],r),r);case"fods":return dr(Sc(t,r),r);case"wk1":return Rn(ea.sheet_to_wk1(t.Sheets[t.SheetNames[n]],r),r);case"wk3":return Rn(ea.book_to_wk3(t,r),r);case"biff2":r.biff||(r.biff=2);case"biff3":r.biff||(r.biff=3);case"biff4":return r.biff||(r.biff=4),Rn(Cc(t,r),r);case"biff5":r.biff||(r.biff=5);case"biff8":case"xla":case"xls":return r.biff||(r.biff=8),f4(t,r);case"xlsx":case"xlsm":case"xlam":case"xlsb":case"numbers":case"ods":return c4(t,r);default:throw new Error("Unrecognized bookType |"+r.bookType+"|")}}function d4(t){if(!t.bookType){var e={xls:"biff8",htm:"html",slk:"sylk",socialcalc:"eth",Sh33tJS:"WTF"},r=t.file.slice(t.file.lastIndexOf(".")).toLowerCase();r.match(/^\.[a-z]+$/)&&(t.bookType=r.slice(1)),t.bookType=e[t.bookType]||t.bookType}}function Qi(t,e,r){var a={};return a.type="file",a.file=e,d4(a),Ac(t,a)}function p4(t,e,r,a,n,i,s,o){var l=et(r),c=o.defval,h=o.raw||!Object.prototype.hasOwnProperty.call(o,"raw"),u=!0,f=n===1?[]:{};if(n!==1)if(Object.defineProperty)try{Object.defineProperty(f,"__rowNum__",{value:r,enumerable:!1})}catch{f.__rowNum__=r}else f.__rowNum__=r;if(!s||t[r])for(var p=e.s.c;p<=e.e.c;++p){var m=s?t[r][p]:t[a[p]+l];if(m===void 0||m.t===void 0){if(c===void 0)continue;i[p]!=null&&(f[i[p]]=c);continue}var d=m.v;switch(m.t){case"z":if(d==null)break;continue;case"e":d=d==0?null:void 0;break;case"s":case"d":case"b":case"n":break;default:throw new Error("unrecognized type "+m.t)}if(i[p]!=null){if(d==null)if(m.t=="e"&&d===null)f[i[p]]=null;else if(c!==void 0)f[i[p]]=c;else if(h&&d===null)f[i[p]]=null;else continue;else f[i[p]]=h&&(m.t!=="n"||m.t==="n"&&o.rawNumbers!==!1)?d:br(m,d,o);d!=null&&(u=!1)}}return{row:f,isempty:u}}function ni(t,e){if(t==null||t["!ref"]==null)return[];var r={t:"n",v:0},a=0,n=1,i=[],s=0,o="",l={s:{r:0,c:0},e:{r:0,c:0}},c=e||{},h=c.range!=null?c.range:t["!ref"];switch(c.header===1?a=1:c.header==="A"?a=2:Array.isArray(c.header)?a=3:c.header==null&&(a=0),typeof h){case"string":l=Ne(h);break;case"number":l=Ne(t["!ref"]),l.s.r=h;break;default:l=h}a>0&&(n=0);var u=et(l.s.r),f=[],p=[],m=0,d=0,g=Array.isArray(t),x=l.s.r,w=0,v={};g&&!t[x]&&(t[x]=[]);var I=c.skipHidden&&t["!cols"]||[],L=c.skipHidden&&t["!rows"]||[];for(w=l.s.c;w<=l.e.c;++w)if(!(I[w]||{}).hidden)switch(f[w]=Xe(w),r=g?t[x][w]:t[f[w]+u],a){case 1:i[w]=w-l.s.c;break;case 2:i[w]=f[w];break;case 3:i[w]=c.header[w-l.s.c];break;default:if(r==null&&(r={w:"__EMPTY",t:"s"}),o=s=br(r,null,c),d=v[s]||0,!d)v[s]=1;else{do o=s+"_"+d++;while(v[o]);v[s]=d,v[o]=1}i[w]=o}for(x=l.s.r+n;x<=l.e.r;++x)if(!(L[x]||{}).hidden){var _=p4(t,l,x,f,a,i,g,c);(_.isempty===!1||(a===1?c.blankrows!==!1:c.blankrows))&&(p[m++]=_.row)}return p.length=m,p}var d0=/"/g;function m4(t,e,r,a,n,i,s,o){for(var l=!0,c=[],h="",u=et(r),f=e.s.c;f<=e.e.c;++f)if(a[f]){var p=o.dense?(t[r]||[])[f]:t[a[f]+u];if(p==null)h="";else if(p.v!=null){l=!1,h=""+(o.rawNumbers&&p.t=="n"?p.v:br(p,null,o));for(var m=0,d=0;m!==h.length;++m)if((d=h.charCodeAt(m))===n||d===i||d===34||o.forceQuotes){h='"'+h.replace(d0,'""')+'"';break}h=="ID"&&(h='"ID"')}else p.f!=null&&!p.F?(l=!1,h="="+p.f,h.indexOf(",")>=0&&(h='"'+h.replace(d0,'""')+'"')):h="";c.push(h)}return o.blankrows===!1&&l?null:c.join(s)}function Gs(t,e){var r=[],a=e??{};if(t==null||t["!ref"]==null)return"";var n=Ne(t["!ref"]),i=a.FS!==void 0?a.FS:",",s=i.charCodeAt(0),o=a.RS!==void 0?a.RS:`
130
130
  `,l=o.charCodeAt(0),c=new RegExp((i=="|"?"\\|":i)+"+$"),h="",u=[];a.dense=Array.isArray(t);for(var f=a.skipHidden&&t["!cols"]||[],p=a.skipHidden&&t["!rows"]||[],m=n.s.c;m<=n.e.c;++m)(f[m]||{}).hidden||(u[m]=Xe(m));for(var d=0,g=n.s.r;g<=n.e.r;++g)(p[g]||{}).hidden||(h=m4(t,n,g,u,s,l,i,a),h!=null&&(a.strip&&(h=h.replace(c,"")),(h||a.blankrows!==!1)&&r.push((d++?o:"")+h)));return delete a.dense,r.join("")}function Ic(t,e){e||(e={}),e.FS=" ",e.RS=`
131
- `;var r=Gs(t,e);return r}function g4(t){var e="",r,a="";if(t==null||t["!ref"]==null)return[];var n=Ne(t["!ref"]),i="",s=[],o,l=[],c=Array.isArray(t);for(o=n.s.c;o<=n.e.c;++o)s[o]=Xe(o);for(var h=n.s.r;h<=n.e.r;++h)for(i=et(h),o=n.s.c;o<=n.e.c;++o)if(e=s[o]+i,r=c?(t[h]||[])[o]:t[e],a="",r!==void 0){if(r.F!=null){if(e=r.F,!r.f)continue;a=r.f,e.indexOf(":")==-1&&(e=e+":"+e)}if(r.f!=null)a=r.f;else{if(r.t=="z")continue;if(r.t=="n"&&r.v!=null)a=""+r.v;else if(r.t=="b")a=r.v?"TRUE":"FALSE";else if(r.w!==void 0)a="'"+r.w;else{if(r.v===void 0)continue;r.t=="s"?a="'"+r.v:a=""+r.v}}l[l.length]=e+"="+a}return l}function Nc(t,e,r){var a=r||{},n=+!a.skipHeader,i=t||{},s=0,o=0;if(i&&a.origin!=null)if(typeof a.origin=="number")s=a.origin;else{var l=typeof a.origin=="string"?je(a.origin):a.origin;s=l.r,o=l.c}var c,h={s:{c:0,r:0},e:{c:o,r:s+e.length-1+n}};if(i["!ref"]){var u=Ne(i["!ref"]);h.e.c=Math.max(h.e.c,u.e.c),h.e.r=Math.max(h.e.r,u.e.r),s==-1&&(s=u.e.r+1,h.e.r=s+e.length-1+n)}else s==-1&&(s=0,h.e.r=e.length-1+n);var f=a.header||[],p=0;e.forEach(function(d,g){qe(d).forEach(function(x){(p=f.indexOf(x))==-1&&(f[p=f.length]=x);var w=d[x],v="z",I="",L=xe({c:o+p,r:s+g+n});c=gn(i,L),w&&typeof w=="object"&&!(w instanceof Date)?i[L]=w:(typeof w=="number"?v="n":typeof w=="boolean"?v="b":typeof w=="string"?v="s":w instanceof Date?(v="d",a.cellDates||(v="n",w=ot(w)),I=a.dateNF||ge[14]):w===null&&a.nullError&&(v="e",w=0),c?(c.t=v,c.v=w,delete c.w,delete c.R,I&&(c.z=I)):i[L]=c={t:v,v:w},I&&(c.z=I))})}),h.e.c=Math.max(h.e.c,o+f.length-1);var m=et(s);if(n)for(p=0;p<f.length;++p)i[Xe(p+o)+m]={t:"s",v:f[p]};return i["!ref"]=Ce(h),i}function x4(t,e){return Nc(null,t,e)}function gn(t,e,r){if(typeof e=="string"){if(Array.isArray(t)){var a=je(e);return t[a.r]||(t[a.r]=[]),t[a.r][a.c]||(t[a.r][a.c]={t:"z"})}return t[e]||(t[e]={t:"z"})}return typeof e!="number"?gn(t,xe(e)):gn(t,xe({r:e,c:r||0}))}function v4(t,e){if(typeof e=="number"){if(e>=0&&t.SheetNames.length>e)return e;throw new Error("Cannot find sheet # "+e)}else if(typeof e=="string"){var r=t.SheetNames.indexOf(e);if(r>-1)return r;throw new Error("Cannot find sheet name |"+e+"|")}else throw new Error("Cannot find sheet |"+e+"|")}function zs(){return{SheetNames:[],Sheets:{}}}function Xs(t,e,r,a){var n=1;if(!r)for(;n<=65535&&t.SheetNames.indexOf(r="Sheet"+n)!=-1;++n,r=void 0);if(!r||t.SheetNames.length>=65535)throw new Error("Too many worksheets");if(a&&t.SheetNames.indexOf(r)>=0){var i=r.match(/(^.*?)(\d+)$/);n=i&&+i[2]||0;var s=i&&i[1]||r;for(++n;n<=65535&&t.SheetNames.indexOf(r=s+n)!=-1;++n);}if(mc(r),t.SheetNames.indexOf(r)>=0)throw new Error("Worksheet with name |"+r+"| already exists!");return t.SheetNames.push(r),t.Sheets[r]=e,r}function w4(t,e,r){t.Workbook||(t.Workbook={}),t.Workbook.Sheets||(t.Workbook.Sheets=[]);var a=v4(t,e);switch(t.Workbook.Sheets[a]||(t.Workbook.Sheets[a]={}),r){case 0:case 1:case 2:break;default:throw new Error("Bad sheet visibility setting "+r)}t.Workbook.Sheets[a].Hidden=r}function E4(t,e){return t.z=e,t}function Mc(t,e,r){return e?(t.l={Target:e},r&&(t.l.Tooltip=r)):delete t.l,t}function C4(t,e,r){return Mc(t,"#"+e,r)}function y4(t,e,r){t.c||(t.c=[]),t.c.push({t:e,a:r||"SheetJS"})}function k4(t,e,r,a){for(var n=typeof e!="string"?e:Ne(e),i=typeof e=="string"?e:Ce(e),s=n.s.r;s<=n.e.r;++s)for(var o=n.s.c;o<=n.e.c;++o){var l=gn(t,s,o);l.t="n",l.F=i,delete l.v,s==n.s.r&&o==n.s.c&&(l.f=r,a&&(l.D=!0))}return t}var rr={encode_col:Xe,encode_row:et,encode_cell:xe,encode_range:Ce,decode_col:Cs,decode_row:Es,split_cell:Of,decode_cell:je,decode_range:Nt,format_cell:br,sheet_add_aoa:sl,sheet_add_json:Nc,sheet_add_dom:kc,aoa_to_sheet:Oa,json_to_sheet:x4,table_to_sheet:_c,table_to_book:A5,sheet_to_csv:Gs,sheet_to_txt:Ic,sheet_to_json:ni,sheet_to_html:yc,sheet_to_formulae:g4,sheet_to_row_object_array:ni,sheet_get_cell:gn,book_new:zs,book_append_sheet:Xs,book_set_sheet_visibility:w4,cell_set_number_format:E4,cell_set_hyperlink:Mc,cell_set_internal_link:C4,cell_add_comment:y4,sheet_set_array_formula:k4,consts:{SHEET_VISIBLE:0,SHEET_HIDDEN:1,SHEET_VERY_HIDDEN:2}};const Pi=["en","ka","ru","tr"],p0={title:{en:"Rule Title (EN)",ka:"წესის სათაური (KA)",ru:"Название правила (RU)",tr:"Kural Başlığı (TR)"},description:{en:"Rule Description (EN)",ka:"წესის აღწერა (KA)",ru:"Описание правила (RU)",tr:"Kural Açıklaması (TR)"}};class za{static exportToExcel(e,r=[...Pi],a="rules.xlsx"){const n=[],i=[];r.forEach(c=>{i.push(`title_${c}`),i.push(`description_${c}`)}),n.push(i),e.forEach(c=>{const h=[];r.forEach(u=>{h.push(c.ruleTitle[u]||""),h.push(c.ruleContent[u]||"")}),n.push(h)});const s=rr.aoa_to_sheet(n),o=i.map(()=>({wch:30}));s["!cols"]=o;const l=rr.book_new();rr.book_append_sheet(l,s,"Rules"),Qi(l,a)}static downloadTemplate(e=[...Pi],r="rules-template.xlsx"){const a=[],n=[];e.forEach(l=>{n.push(`title_${l}`),n.push(`description_${l}`)}),a.push(n),a.push(e.flatMap(()=>["",""]));const i=rr.aoa_to_sheet(a),s=n.map(()=>({wch:30}));i["!cols"]=s;const o=rr.book_new();rr.book_append_sheet(o,i,"Rules"),Qi(o,r)}static async importFromExcel(e,r=[...Pi]){return new Promise((a,n)=>{const i=new FileReader;i.onload=s=>{var o;try{const l=(o=s.target)==null?void 0:o.result,c=ai(l,{type:"binary"}),h=c.SheetNames[0],u=c.Sheets[h],f=rr.sheet_to_json(u,{header:1});if(f.length<2){a({rules:[],errors:["Excel file is empty or has no data rows"],summary:{total:0,successful:0,failed:0}});return}const p=f[0].map(v=>String(v||"").toLowerCase().trim()),m=this.normalizeHeaders(p,r),d=[],g=[];let x=0,w=0;for(let v=1;v<f.length;v++){const I=f[v];if(!(!I||I.length===0||I.every(L=>!L)))try{const L=this.parseRow(I,m);if(L){const _=Object.values(L.ruleTitle).some(M=>M&&M.trim()),C=Object.values(L.ruleContent).some(M=>M&&M.trim());_||C?(d.push(L),x++):(w++,g.push(`Row ${v+1}: Empty rule (no title or content)`))}}catch(L){w++,g.push(`Row ${v+1}: ${L instanceof Error?L.message:"Parse error"}`)}}a({rules:d,errors:g,summary:{total:f.length-1,successful:x,failed:w}})}catch(l){n(l)}},i.onerror=()=>{n(new Error("Failed to read file"))},i.readAsBinaryString(e)})}static normalizeHeaders(e,r){const a=new Map;return e.forEach((n,i)=>{var c,h;const s=n.toLowerCase().trim(),o=s.replace(/[^a-z_]/g,""),l=s.match(/^(title|description|desc|content)[^a-z0-9]*([a-z]{2,})$/);if(l){const u=l[1]==="title"?"title":"description",f=l[2],p=r.find(m=>m.toLowerCase()===f);if(p){a.set(i,{type:u,lang:p});return}}for(const u of r){const f=u.toLowerCase();if(o.includes(`title_${f}`)||o.includes(`title${f}`)||o.includes("title")&&o.includes(f)){a.set(i,{type:"title",lang:u});break}if(o.includes(`description_${f}`)||o.includes(`desc_${f}`)||o.includes(`content_${f}`)||o.includes("description")&&o.includes(f)||o.includes("content")&&o.includes(f)){a.set(i,{type:"description",lang:u});break}}if(!a.has(i))for(const u of r){const f=u.toLowerCase(),p=((c=p0.title[f])==null?void 0:c.toLowerCase())||"",m=((h=p0.description[f])==null?void 0:h.toLowerCase())||"";if(n.toLowerCase().includes(p.split("(")[0].trim())){a.set(i,{type:"title",lang:u});break}if(n.toLowerCase().includes(m.split("(")[0].trim())){a.set(i,{type:"description",lang:u});break}}}),a}static parseRow(e,r){const a={ruleTitle:{},ruleContent:{}};return r.forEach((n,i)=>{const s=e[i];if(s!=null){const o=String(s).trim();n.type==="title"?a.ruleTitle[n.lang]=o:a.ruleContent[n.lang]=o}}),a}static validateFile(e){const r=["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel"],n=[".xlsx",".xls"].some(s=>e.name.toLowerCase().endsWith(s));if(!r.includes(e.type)&&!n)return{valid:!1,error:"Invalid file type. Please upload an Excel file (.xlsx or .xls)"};const i=10*1024*1024;return e.size>i?{valid:!1,error:"File is too large. Maximum size is 10MB"}:{valid:!0}}}function Xr(t,e){for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const a=t[r];e(r,a)}}function es(t){if(t==null)return t;if(Array.isArray(t))return t.map(e=>es(e));if(typeof t=="object"){const e={};for(const[r,a]of Object.entries(t))r!=="disabled_removing_$id"&&(e[r]=es(a));return e}return t}const li=class li{constructor(e){this.elementRef=null,this.isHidden=!1,this.custom=!1,this.initialValues={},this.changeTimeout=null,this.isHandlingChange=!1,this.changeHandlers=new Set,this.blurTimeout=null,this.lastChangeTime=0,this.handleBlur=()=>{},this.pendingBlurHandler=null,this.originalDefaultValues={},this.nestingLevel=0,this.dataPropsPath="",this.hide=!1,this.isSettingValue=!1,this.suppressOnChange=!1,this.isRootNode=!1,this.$id=rn(),this.setActiveOnSettingSelection=!1,this.suppressOnChange=!0,this.id=e.id||rn(),this.title=e.title??"",this.settings=e.settings,this.isCollapsed=e.collapsed??!1,this.isMain=e.main??!1,this.custom=e.custom??!1,this.nestingLevel=0,this.includeGetJson=e.includeGetJson??!0,this.addItemCfg=e.addItem,this.deleteItemCfg=e.deleteItem,this.dataProps=e.dataProps,this.dataPropsPath=e.dataProps||"",this.hide=e.hide??!1,Object.assign(this,e.settings),this.initialValues=this.getValues(),this.originalDefaultValues=this.getDefaultValues(),this.propagateNestingLevel(),this.propagateDataPropsPath(),this.propagateComponentPaths(),this.suppressOnChange=!1,this.disabled=e.disabled}propagateNestingLevel(){const e=this.nestingLevel+1;Xr(this.settings,(r,a)=>{Oe(a)&&(a.nestingLevel=e,a.propagateNestingLevel())})}getNestingLevel(){return this.nestingLevel}setNestingLevel(e){this.nestingLevel=e,this.propagateNestingLevel(),this.elementRef&&this.updateNestingStyles()}setTitle(e){if(this.title=e,this.elementRef){const r=this.elementRef.querySelector(".setting-group-title h3");r&&(r.textContent=e)}}getDataPropsPath(){return this.dataPropsPath}setDataPropsPath(e){this.dataPropsPath=e,this.propagateDataPropsPath()}propagateDataPropsPath(){Xr(this.settings,(e,r)=>{const a=String(e),n=this.dataPropsPath?`${this.dataPropsPath}_${a}`:a;(Oe(r)||pr(r)&&typeof r.setDataPropsPath=="function")&&r.setDataPropsPath(n)})}propagateComponentPaths(e=""){Xr(this.settings,(r,a)=>{const n=String(r);if(Oe(a)){const i=e?`${e} > ${a.title}`:a.title;a.propagateComponentPaths(i)}else if(pr(a)&&typeof a.setComponentPath=="function"){const i=e?`${e} > ${n}`:n;a.setComponentPath(i)}})}updateNestingStyles(){this.elementRef&&(Vn(this.elementRef,this.nestingLevel),Bi(this.elementRef,this.nestingLevel))}forceChildUIRefresh(){Object.entries(this.settings).forEach(([e,r])=>{try{if(Oe(r)){const a=r.getValues();r.setValue(a)}else if(typeof r.setValue=="function"){const a=r.value;a!==void 0&&r.setValue(a)}}catch(a){console.warn(`Error refreshing UI for setting ${e}:`,a)}})}removeSetting(e){const r=this.settings[e];if(!r)return;if(delete this.settings[e],e in this&&delete this[e],Oe(r)&&r.onDeleteRequest&&(r.onDeleteRequest=void 0),this.elementRef){const n=this.elementRef.querySelector(".setting-group-content");if(n){const i=Array.from(n.querySelectorAll(".setting-group, .setting, [data-setting-id]"));for(const s of i){const o=s.id,l=s.getAttribute("data-setting-id");if(o&&"id"in r&&typeof r.id=="string"&&o.includes(r.id)){s.remove();break}if(l&&"id"in r&&typeof r.id=="string"&&l===r.id){s.remove();break}}}}typeof r.cleanup=="function"&&r.cleanup(),this.updateNestingStyles();const a=this.getValues();this.initialValues=a,!this.suppressOnChange&&this.onChange&&this.onChange(a),!this.suppressOnChange&&typeof this.detectChange=="function"&&this.detectChange()}updateVisibility(){this.elementRef}updateSettings(e,r){var l;const a=(r==null?void 0:r.preserveValues)??!0,n=new Set(Object.keys(this.settings)),i=Object.keys(e),s={};a&&i.forEach(c=>{const h=this.settings[c];h&&(Oe(h)?s[c]=h.getValues():pr(h)?s[c]=h.value:typeof h.getValues=="function"?s[c]=h.getValues():h.value!==void 0&&(s[c]=h.value))}),n.forEach(c=>{i.includes(c)||this.removeSetting(c)}),i.forEach(c=>{var f;const h=e[c],u=this.settings[c];if(u!==h&&(u&&this.removeSetting(c),this.addSetting(c,h),a&&c in s)){const p=s[c];try{Oe(h)?h.setValue(p):pr(h)?(f=h.setValue)==null||f.call(h,p):h.setValue&&h.setValue(p)}catch(m){console.warn(`Could not preserve value for setting ${c}:`,m)}}}),this.settings=e,this.propagateNestingLevel(),this.propagateDataPropsPath();const o=this.getValues();this.initialValues=o,this.suppressOnChange||(l=this.onChange)==null||l.call(this,o)}clone(){const e={};Xr(this.settings,(n,i)=>{const s=String(n);typeof i.clone=="function"?e[s]=i.clone():(console.warn(`Setting with key '${s}' does not have a clone method. Copying reference.`),e[s]=i)});const r={title:this.title,settings:e,collapsed:this.isCollapsed,main:this.isMain,custom:this.custom,includeGetJson:this.includeGetJson,addItem:this.addItemCfg,deleteItem:this.deleteItemCfg,dataProps:this.dataProps,hide:this.hide,setActiveOnSettingSelection:this.setActiveOnSettingSelection,disabled:this.disabled},a=Oc(r);return a.suppressOnChange=!0,a.initialValues=this.getValues(),a.suppressOnChange=!1,a}resetDefault(){const e=this.originalDefaultValues;this.setValue(e),this.onChange&&!this.suppressOnChange&&this.onChange(this.getValues())}setMobileValues(e){!e||typeof e!="object"||(Object.entries(e).forEach(([r,a])=>{const n=this.settings[r];n&&(Oe(n)||pr(n))&&typeof n.setMobileValue=="function"&&n.setMobileValue(a)}),this.setValue(e),this.onChange&&!this.suppressOnChange&&this.onChange(this.getValues()))}getMobileValues(e){if(e===void 0){const r={};for(const a in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,a)){const n=this.settings[a];if(Oe(n))r[a]=n.getMobileValues();else{const i=n;r[a]=i.mobileValue!==void 0?i.mobileValue:i.value}}return r}else{const r=this.settings[e];if(!r)return;if(Oe(r))return r.getMobileValues();const a=r;return a.mobileValue!==void 0?a.mobileValue:a.value}}setOnChange(e){this.onChange=e;const r=()=>{this.isHandlingChange||this.suppressOnChange||(this.isHandlingChange=!0,this.changeTimeout&&clearTimeout(this.changeTimeout),this.changeTimeout=setTimeout(()=>{const a=this.getValues(),n=this.calculateChanges(this.initialValues,a);Object.keys(n).length>0&&(this.lastChangeTime=Date.now(),this.initialValues=a,this.suppressOnChange||e(a),this.updateVisibility()),this.isHandlingChange=!1},50))};return this.changeHandlers.clear(),Xr(this.settings,(a,n)=>{var s,o;const i=String(a);if(Oe(n))n.setOnChange(()=>{if(this.suppressOnChange)return;const l=this.getValues();this.initialValues=l,e(l)}),this.changeHandlers.add(()=>e(this.getValues())),(s=n.deleteItemCfg)!=null&&s.showDeleteButton&&(n.onDeleteRequest=()=>{this.showDeleteConfirmation().then(l=>{l&&this.removeSetting(i)})});else if(pr(n)){const l=()=>r();this.changeHandlers.add(l),n.setOnChange(l)}else{const l=()=>r();this.changeHandlers.add(l),(o=n.setOnChange)==null||o.call(n,l)}}),this}cleanup(){this.changeTimeout&&(clearTimeout(this.changeTimeout),this.changeTimeout=null),this.blurTimeout&&(clearTimeout(this.blurTimeout),this.blurTimeout=null),this.elementRef&&this.elementRef.removeEventListener("focusout",this.handleBlur),this.changeHandlers.clear(),Xr(this.settings,(e,r)=>{const a=r;try{typeof a.cleanup=="function"?a.cleanup():typeof a.destroy=="function"&&a.destroy()}catch{}})}setValue(e){if(!(!e||typeof e!="object")&&!this.isSettingValue){this.isSettingValue=!0;try{if(this.addItemCfg){const a=this.addItemCfg.keyPrefix,n=Object.keys(this.settings).filter(o=>o.startsWith(a)),i=Object.keys(e).filter(o=>o.startsWith(a));n.filter(o=>!i.includes(o)).forEach(o=>{this.removeSetting(o)})}Object.entries(e).forEach(([a,n])=>{let i=this.settings[a];if(!i&&this.addItemCfg&&a.startsWith(this.addItemCfg.keyPrefix)){const s=a.slice(this.addItemCfg.keyPrefix.length),o=Number(s);if(Number.isFinite(o)){const l=this.addItemCfg.createItem(o);Hn(l)&&(this.addSetting(a,l),i=l)}}i&&(Oe(i)||pr(i))&&typeof i.setValue=="function"&&i.setValue(n)});const r=this.getValues();this.initialValues=r,this.onChange&&!this.suppressOnChange&&this.onChange(r)}finally{this.isSettingValue=!1}}}wireChild(e){var a;const r=()=>{var i;if(this.suppressOnChange)return;const n=this.getValues();this.initialValues=n,(i=this.onChange)==null||i.call(this,n),this.updateVisibility()};Oe(e)?e.setOnChange(()=>r()):pr(e)?e.setOnChange(()=>r()):(a=e.setOnChange)==null||a.call(e,()=>r())}addSetting(e,r){var n,i,s,o;if(this.settings[e]=r,this.wireChild(r),Oe(r)){const l=r;(n=l.deleteItemCfg)!=null&&n.showDeleteButton&&(l.onDeleteRequest=()=>{this.showDeleteConfirmation().then(c=>{c&&this.removeSetting(e)})})}if(Oe(r)&&r.isRootNode===!0){const l=this.getValues();this.initialValues=l,this.suppressOnChange||(i=this.onChange)==null||i.call(this,l);return}if(this.elementRef){const l=this.elementRef.querySelector(".setting-group-content");if(l){const c=l.querySelector(".setting-group-empty");c&&c.remove(),Oe(r)&&typeof r.setNestingLevel=="function"&&r.setNestingLevel(this.nestingLevel+1);const h=r.draw(),u=this.deleteItemCfg??this.addItemCfg;if(u){const m=u.keyPrefix??((s=this.addItemCfg)==null?void 0:s.keyPrefix);m&&e.startsWith(m)&&this.addDeleteButtonToElement(h,e)}const f=l.querySelector(".sg-buttons-container");if(f)l.insertBefore(h,f);else{const m=l.querySelector(".sg-add-button-bottom");m&&m.parentElement===l?l.insertBefore(h,m):l.appendChild(h)}eo.trackElement(h),Vn(h,this.nestingLevel+1),Bi(h,this.nestingLevel+1);const p=h.style.display;h.style.display="none",h.offsetHeight,h.style.display=p,this.updateNestingStyles()}}const a=this.getValues();this.initialValues=a,this.suppressOnChange||(o=this.onChange)==null||o.call(this,a),!this.suppressOnChange&&typeof this.detectChange=="function"&&this.detectChange()}addDeleteButtonToElement(e,r,a){let n=null;try{n=e.querySelector(":scope > .setting-group-title")}catch{n=null}if(!n){const c=Array.from(e.querySelectorAll(".setting-group-title"));for(const h of c)if(h.closest(".setting-group")===e){n=h;break}n||(n=c[0]??null)}if(!n)return;const i=n.querySelector(".actions-section");if(!i)return;const s=document.createElement("button");s.type="button",s.className="sg-delete-button",a?a.deleteItemCfg:this.deleteItemCfg??this.addItemCfg,s.title="Delete",s.style.cssText=`
131
+ `;var r=Gs(t,e);return r}function g4(t){var e="",r,a="";if(t==null||t["!ref"]==null)return[];var n=Ne(t["!ref"]),i="",s=[],o,l=[],c=Array.isArray(t);for(o=n.s.c;o<=n.e.c;++o)s[o]=Xe(o);for(var h=n.s.r;h<=n.e.r;++h)for(i=et(h),o=n.s.c;o<=n.e.c;++o)if(e=s[o]+i,r=c?(t[h]||[])[o]:t[e],a="",r!==void 0){if(r.F!=null){if(e=r.F,!r.f)continue;a=r.f,e.indexOf(":")==-1&&(e=e+":"+e)}if(r.f!=null)a=r.f;else{if(r.t=="z")continue;if(r.t=="n"&&r.v!=null)a=""+r.v;else if(r.t=="b")a=r.v?"TRUE":"FALSE";else if(r.w!==void 0)a="'"+r.w;else{if(r.v===void 0)continue;r.t=="s"?a="'"+r.v:a=""+r.v}}l[l.length]=e+"="+a}return l}function Nc(t,e,r){var a=r||{},n=+!a.skipHeader,i=t||{},s=0,o=0;if(i&&a.origin!=null)if(typeof a.origin=="number")s=a.origin;else{var l=typeof a.origin=="string"?je(a.origin):a.origin;s=l.r,o=l.c}var c,h={s:{c:0,r:0},e:{c:o,r:s+e.length-1+n}};if(i["!ref"]){var u=Ne(i["!ref"]);h.e.c=Math.max(h.e.c,u.e.c),h.e.r=Math.max(h.e.r,u.e.r),s==-1&&(s=u.e.r+1,h.e.r=s+e.length-1+n)}else s==-1&&(s=0,h.e.r=e.length-1+n);var f=a.header||[],p=0;e.forEach(function(d,g){qe(d).forEach(function(x){(p=f.indexOf(x))==-1&&(f[p=f.length]=x);var w=d[x],v="z",I="",L=xe({c:o+p,r:s+g+n});c=gn(i,L),w&&typeof w=="object"&&!(w instanceof Date)?i[L]=w:(typeof w=="number"?v="n":typeof w=="boolean"?v="b":typeof w=="string"?v="s":w instanceof Date?(v="d",a.cellDates||(v="n",w=ot(w)),I=a.dateNF||ge[14]):w===null&&a.nullError&&(v="e",w=0),c?(c.t=v,c.v=w,delete c.w,delete c.R,I&&(c.z=I)):i[L]=c={t:v,v:w},I&&(c.z=I))})}),h.e.c=Math.max(h.e.c,o+f.length-1);var m=et(s);if(n)for(p=0;p<f.length;++p)i[Xe(p+o)+m]={t:"s",v:f[p]};return i["!ref"]=Ce(h),i}function x4(t,e){return Nc(null,t,e)}function gn(t,e,r){if(typeof e=="string"){if(Array.isArray(t)){var a=je(e);return t[a.r]||(t[a.r]=[]),t[a.r][a.c]||(t[a.r][a.c]={t:"z"})}return t[e]||(t[e]={t:"z"})}return typeof e!="number"?gn(t,xe(e)):gn(t,xe({r:e,c:r||0}))}function v4(t,e){if(typeof e=="number"){if(e>=0&&t.SheetNames.length>e)return e;throw new Error("Cannot find sheet # "+e)}else if(typeof e=="string"){var r=t.SheetNames.indexOf(e);if(r>-1)return r;throw new Error("Cannot find sheet name |"+e+"|")}else throw new Error("Cannot find sheet |"+e+"|")}function zs(){return{SheetNames:[],Sheets:{}}}function Xs(t,e,r,a){var n=1;if(!r)for(;n<=65535&&t.SheetNames.indexOf(r="Sheet"+n)!=-1;++n,r=void 0);if(!r||t.SheetNames.length>=65535)throw new Error("Too many worksheets");if(a&&t.SheetNames.indexOf(r)>=0){var i=r.match(/(^.*?)(\d+)$/);n=i&&+i[2]||0;var s=i&&i[1]||r;for(++n;n<=65535&&t.SheetNames.indexOf(r=s+n)!=-1;++n);}if(mc(r),t.SheetNames.indexOf(r)>=0)throw new Error("Worksheet with name |"+r+"| already exists!");return t.SheetNames.push(r),t.Sheets[r]=e,r}function w4(t,e,r){t.Workbook||(t.Workbook={}),t.Workbook.Sheets||(t.Workbook.Sheets=[]);var a=v4(t,e);switch(t.Workbook.Sheets[a]||(t.Workbook.Sheets[a]={}),r){case 0:case 1:case 2:break;default:throw new Error("Bad sheet visibility setting "+r)}t.Workbook.Sheets[a].Hidden=r}function E4(t,e){return t.z=e,t}function Mc(t,e,r){return e?(t.l={Target:e},r&&(t.l.Tooltip=r)):delete t.l,t}function C4(t,e,r){return Mc(t,"#"+e,r)}function y4(t,e,r){t.c||(t.c=[]),t.c.push({t:e,a:r||"SheetJS"})}function k4(t,e,r,a){for(var n=typeof e!="string"?e:Ne(e),i=typeof e=="string"?e:Ce(e),s=n.s.r;s<=n.e.r;++s)for(var o=n.s.c;o<=n.e.c;++o){var l=gn(t,s,o);l.t="n",l.F=i,delete l.v,s==n.s.r&&o==n.s.c&&(l.f=r,a&&(l.D=!0))}return t}var rr={encode_col:Xe,encode_row:et,encode_cell:xe,encode_range:Ce,decode_col:Cs,decode_row:Es,split_cell:Of,decode_cell:je,decode_range:Nt,format_cell:br,sheet_add_aoa:sl,sheet_add_json:Nc,sheet_add_dom:kc,aoa_to_sheet:Oa,json_to_sheet:x4,table_to_sheet:_c,table_to_book:A5,sheet_to_csv:Gs,sheet_to_txt:Ic,sheet_to_json:ni,sheet_to_html:yc,sheet_to_formulae:g4,sheet_to_row_object_array:ni,sheet_get_cell:gn,book_new:zs,book_append_sheet:Xs,book_set_sheet_visibility:w4,cell_set_number_format:E4,cell_set_hyperlink:Mc,cell_set_internal_link:C4,cell_add_comment:y4,sheet_set_array_formula:k4,consts:{SHEET_VISIBLE:0,SHEET_HIDDEN:1,SHEET_VERY_HIDDEN:2}};const Pi=["en","ka","ru","tr"],p0={title:{en:"Rule Title (EN)",ka:"წესის სათაური (KA)",ru:"Название правила (RU)",tr:"Kural Başlığı (TR)"},description:{en:"Rule Description (EN)",ka:"წესის აღწერა (KA)",ru:"Описание правила (RU)",tr:"Kural Açıklaması (TR)"}};class za{static exportToExcel(e,r=[...Pi],a="rules.xlsx"){const n=[],i=[];r.forEach(c=>{i.push(`title_${c}`),i.push(`description_${c}`)}),n.push(i),e.forEach(c=>{const h=[];r.forEach(u=>{h.push(c.ruleTitle[u]||""),h.push(c.ruleContent[u]||"")}),n.push(h)});const s=rr.aoa_to_sheet(n),o=i.map(()=>({wch:30}));s["!cols"]=o;const l=rr.book_new();rr.book_append_sheet(l,s,"Rules"),Qi(l,a)}static downloadTemplate(e=[...Pi],r="rules-template.xlsx"){const a=[],n=[];e.forEach(l=>{n.push(`title_${l}`),n.push(`description_${l}`)}),a.push(n),a.push(e.flatMap(()=>["",""]));const i=rr.aoa_to_sheet(a),s=n.map(()=>({wch:30}));i["!cols"]=s;const o=rr.book_new();rr.book_append_sheet(o,i,"Rules"),Qi(o,r)}static async importFromExcel(e,r=[...Pi]){return new Promise((a,n)=>{const i=new FileReader;i.onload=s=>{var o;try{const l=(o=s.target)==null?void 0:o.result,c=ai(l,{type:"binary"}),h=c.SheetNames[0],u=c.Sheets[h],f=rr.sheet_to_json(u,{header:1});if(f.length<2){a({rules:[],errors:["Excel file is empty or has no data rows"],summary:{total:0,successful:0,failed:0}});return}const p=f[0].map(v=>String(v||"").toLowerCase().trim()),m=this.normalizeHeaders(p,r),d=[],g=[];let x=0,w=0;for(let v=1;v<f.length;v++){const I=f[v];if(!(!I||I.length===0||I.every(L=>!L)))try{const L=this.parseRow(I,m);if(L){const _=Object.values(L.ruleTitle).some(M=>M&&M.trim()),C=Object.values(L.ruleContent).some(M=>M&&M.trim());_||C?(d.push(L),x++):(w++,g.push(`Row ${v+1}: Empty rule (no title or content)`))}}catch(L){w++,g.push(`Row ${v+1}: ${L instanceof Error?L.message:"Parse error"}`)}}a({rules:d,errors:g,summary:{total:f.length-1,successful:x,failed:w}})}catch(l){n(l)}},i.onerror=()=>{n(new Error("Failed to read file"))},i.readAsBinaryString(e)})}static normalizeHeaders(e,r){const a=new Map;return e.forEach((n,i)=>{var c,h;const s=n.toLowerCase().trim(),o=s.replace(/[^a-z_]/g,""),l=s.match(/^(title|description|desc|content)[^a-z0-9]*([a-z]{2,})$/);if(l){const u=l[1]==="title"?"title":"description",f=l[2],p=r.find(m=>m.toLowerCase()===f);if(p){a.set(i,{type:u,lang:p});return}}for(const u of r){const f=u.toLowerCase();if(o.includes(`title_${f}`)||o.includes(`title${f}`)||o.includes("title")&&o.includes(f)){a.set(i,{type:"title",lang:u});break}if(o.includes(`description_${f}`)||o.includes(`desc_${f}`)||o.includes(`content_${f}`)||o.includes("description")&&o.includes(f)||o.includes("content")&&o.includes(f)){a.set(i,{type:"description",lang:u});break}}if(!a.has(i))for(const u of r){const f=u.toLowerCase(),p=((c=p0.title[f])==null?void 0:c.toLowerCase())||"",m=((h=p0.description[f])==null?void 0:h.toLowerCase())||"";if(n.toLowerCase().includes(p.split("(")[0].trim())){a.set(i,{type:"title",lang:u});break}if(n.toLowerCase().includes(m.split("(")[0].trim())){a.set(i,{type:"description",lang:u});break}}}),a}static parseRow(e,r){const a={ruleTitle:{},ruleContent:{}};return r.forEach((n,i)=>{const s=e[i];if(s!=null){const o=String(s).trim();n.type==="title"?a.ruleTitle[n.lang]=o:a.ruleContent[n.lang]=o}}),a}static validateFile(e){const r=["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel"],n=[".xlsx",".xls"].some(s=>e.name.toLowerCase().endsWith(s));if(!r.includes(e.type)&&!n)return{valid:!1,error:"Invalid file type. Please upload an Excel file (.xlsx or .xls)"};const i=10*1024*1024;return e.size>i?{valid:!1,error:"File is too large. Maximum size is 10MB"}:{valid:!0}}}function Xr(t,e){for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const a=t[r];e(r,a)}}function es(t){if(t==null)return t;if(Array.isArray(t))return t.map(e=>es(e));if(typeof t=="object"){const e={};for(const[r,a]of Object.entries(t))r!=="disabled_removing_$id"&&(e[r]=es(a));return e}return t}const li=class li{constructor(e){this.elementRef=null,this.isHidden=!1,this.custom=!1,this.initialValues={},this.changeTimeout=null,this.isHandlingChange=!1,this.changeHandlers=new Set,this.blurTimeout=null,this.lastChangeTime=0,this.handleBlur=()=>{},this.pendingBlurHandler=null,this.originalDefaultValues={},this.nestingLevel=0,this.dataPropsPath="",this.hide=!1,this.isSettingValue=!1,this.suppressOnChange=!1,this.isRootNode=!1,this.skipHistoryNextChange=!1,this.$id=rn(),this.setActiveOnSettingSelection=!1,this.suppressOnChange=!0,this.id=e.id||rn(),this.title=e.title??"",this.settings=e.settings,this.isCollapsed=e.collapsed??!1,this.isMain=e.main??!1,this.custom=e.custom??!1,this.nestingLevel=0,this.includeGetJson=e.includeGetJson??!0,this.addItemCfg=e.addItem,this.deleteItemCfg=e.deleteItem,this.dataProps=e.dataProps,this.dataPropsPath=e.dataProps||"",this.hide=e.hide??!1,Object.assign(this,e.settings),this.initialValues=this.getValues(),this.originalDefaultValues=this.getDefaultValues(),this.propagateNestingLevel(),this.propagateDataPropsPath(),this.propagateComponentPaths(),this.suppressOnChange=!1,this.disabled=e.disabled}propagateNestingLevel(){const e=this.nestingLevel+1;Xr(this.settings,(r,a)=>{Oe(a)&&(a.nestingLevel=e,a.propagateNestingLevel())})}consumeSkipHistoryNextChange(){const e=this.skipHistoryNextChange;return this.skipHistoryNextChange=!1,e}getNestingLevel(){return this.nestingLevel}setNestingLevel(e){this.nestingLevel=e,this.propagateNestingLevel(),this.elementRef&&this.updateNestingStyles()}setTitle(e){if(this.title=e,this.elementRef){const r=this.elementRef.querySelector(".setting-group-title h3");r&&(r.textContent=e)}}getDataPropsPath(){return this.dataPropsPath}setDataPropsPath(e){this.dataPropsPath=e,this.propagateDataPropsPath()}propagateDataPropsPath(){Xr(this.settings,(e,r)=>{const a=String(e),n=this.dataPropsPath?`${this.dataPropsPath}_${a}`:a;(Oe(r)||pr(r)&&typeof r.setDataPropsPath=="function")&&r.setDataPropsPath(n)})}propagateComponentPaths(e=""){Xr(this.settings,(r,a)=>{const n=String(r);if(Oe(a)){const i=e?`${e} > ${a.title}`:a.title;a.propagateComponentPaths(i)}else if(pr(a)&&typeof a.setComponentPath=="function"){const i=e?`${e} > ${n}`:n;a.setComponentPath(i)}})}updateNestingStyles(){this.elementRef&&(Vn(this.elementRef,this.nestingLevel),Bi(this.elementRef,this.nestingLevel))}forceChildUIRefresh(){Object.entries(this.settings).forEach(([e,r])=>{try{if(Oe(r)){const a=r.getValues();r.setValue(a)}else if(typeof r.setValue=="function"){const a=r.value;a!==void 0&&r.setValue(a)}}catch(a){console.warn(`Error refreshing UI for setting ${e}:`,a)}})}removeSetting(e){const r=this.settings[e];if(!r)return;if(delete this.settings[e],e in this&&delete this[e],Oe(r)&&r.onDeleteRequest&&(r.onDeleteRequest=void 0),this.elementRef){const n=this.elementRef.querySelector(".setting-group-content");if(n){const i=Array.from(n.querySelectorAll(".setting-group, .setting, [data-setting-id]"));for(const s of i){const o=s.id,l=s.getAttribute("data-setting-id");if(o&&"id"in r&&typeof r.id=="string"&&o.includes(r.id)){s.remove();break}if(l&&"id"in r&&typeof r.id=="string"&&l===r.id){s.remove();break}}}}typeof r.cleanup=="function"&&r.cleanup(),this.updateNestingStyles();const a=this.getValues();this.initialValues=a,!this.suppressOnChange&&this.onChange&&this.onChange(a),!this.suppressOnChange&&typeof this.detectChange=="function"&&this.detectChange()}updateVisibility(){this.elementRef}updateSettings(e,r){var l;const a=(r==null?void 0:r.preserveValues)??!0,n=new Set(Object.keys(this.settings)),i=Object.keys(e),s={};a&&i.forEach(c=>{const h=this.settings[c];h&&(Oe(h)?s[c]=h.getValues():pr(h)?s[c]=h.value:typeof h.getValues=="function"?s[c]=h.getValues():h.value!==void 0&&(s[c]=h.value))}),n.forEach(c=>{i.includes(c)||this.removeSetting(c)}),i.forEach(c=>{var f;const h=e[c],u=this.settings[c];if(u!==h&&(u&&this.removeSetting(c),this.addSetting(c,h),a&&c in s)){const p=s[c];try{Oe(h)?h.setValue(p):pr(h)?(f=h.setValue)==null||f.call(h,p):h.setValue&&h.setValue(p)}catch(m){console.warn(`Could not preserve value for setting ${c}:`,m)}}}),this.settings=e,this.propagateNestingLevel(),this.propagateDataPropsPath();const o=this.getValues();this.initialValues=o,this.suppressOnChange||(l=this.onChange)==null||l.call(this,o)}clone(){const e={};Xr(this.settings,(n,i)=>{const s=String(n);typeof i.clone=="function"?e[s]=i.clone():(console.warn(`Setting with key '${s}' does not have a clone method. Copying reference.`),e[s]=i)});const r={title:this.title,settings:e,collapsed:this.isCollapsed,main:this.isMain,custom:this.custom,includeGetJson:this.includeGetJson,addItem:this.addItemCfg,deleteItem:this.deleteItemCfg,dataProps:this.dataProps,hide:this.hide,setActiveOnSettingSelection:this.setActiveOnSettingSelection,disabled:this.disabled},a=Oc(r);return a.suppressOnChange=!0,a.initialValues=this.getValues(),a.suppressOnChange=!1,a}resetDefault(){const e=this.originalDefaultValues;this.setValue(e),this.onChange&&!this.suppressOnChange&&this.onChange(this.getValues())}setMobileValues(e){!e||typeof e!="object"||(Object.entries(e).forEach(([r,a])=>{const n=this.settings[r];n&&(Oe(n)||pr(n))&&typeof n.setMobileValue=="function"&&n.setMobileValue(a)}),this.setValue(e),this.onChange&&!this.suppressOnChange&&this.onChange(this.getValues()))}getMobileValues(e){if(e===void 0){const r={};for(const a in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,a)){const n=this.settings[a];if(Oe(n))r[a]=n.getMobileValues();else{const i=n;r[a]=i.mobileValue!==void 0?i.mobileValue:i.value}}return r}else{const r=this.settings[e];if(!r)return;if(Oe(r))return r.getMobileValues();const a=r;return a.mobileValue!==void 0?a.mobileValue:a.value}}setOnChange(e){this.onChange=e;const r=()=>{this.isHandlingChange||this.suppressOnChange||(this.isHandlingChange=!0,this.changeTimeout&&clearTimeout(this.changeTimeout),this.changeTimeout=setTimeout(()=>{const a=this.getValues(),n=this.calculateChanges(this.initialValues,a);Object.keys(n).length>0&&(this.lastChangeTime=Date.now(),this.initialValues=a,this.suppressOnChange||e(a),this.updateVisibility()),this.isHandlingChange=!1},50))};return this.changeHandlers.clear(),Xr(this.settings,(a,n)=>{var s,o;const i=String(a);if(Oe(n))n.setOnChange(()=>{if(this.suppressOnChange)return;const l=this.getValues();this.initialValues=l,e(l)}),this.changeHandlers.add(()=>e(this.getValues())),(s=n.deleteItemCfg)!=null&&s.showDeleteButton&&(n.onDeleteRequest=()=>{this.showDeleteConfirmation().then(l=>{l&&(this.skipHistoryNextChange=!0,this.removeSetting(i))})});else if(pr(n)){const l=()=>r();this.changeHandlers.add(l),n.setOnChange(l)}else{const l=()=>r();this.changeHandlers.add(l),(o=n.setOnChange)==null||o.call(n,l)}}),this}cleanup(){this.changeTimeout&&(clearTimeout(this.changeTimeout),this.changeTimeout=null),this.blurTimeout&&(clearTimeout(this.blurTimeout),this.blurTimeout=null),this.elementRef&&this.elementRef.removeEventListener("focusout",this.handleBlur),this.changeHandlers.clear(),Xr(this.settings,(e,r)=>{const a=r;try{typeof a.cleanup=="function"?a.cleanup():typeof a.destroy=="function"&&a.destroy()}catch{}})}setValue(e){if(!(!e||typeof e!="object")&&!this.isSettingValue){this.isSettingValue=!0;try{if(this.addItemCfg){const a=this.addItemCfg.keyPrefix,n=Object.keys(this.settings).filter(o=>o.startsWith(a)),i=Object.keys(e).filter(o=>o.startsWith(a));n.filter(o=>!i.includes(o)).forEach(o=>{this.removeSetting(o)})}Object.entries(e).forEach(([a,n])=>{let i=this.settings[a];if(!i&&this.addItemCfg&&a.startsWith(this.addItemCfg.keyPrefix)){const s=a.slice(this.addItemCfg.keyPrefix.length),o=Number(s);if(Number.isFinite(o)){const l=this.addItemCfg.createItem(o);Hn(l)&&(this.addSetting(a,l),i=l)}}i&&(Oe(i)||pr(i))&&typeof i.setValue=="function"&&i.setValue(n)});const r=this.getValues();this.initialValues=r,this.onChange&&!this.suppressOnChange&&this.onChange(r)}finally{this.isSettingValue=!1}}}wireChild(e){var a;const r=()=>{var i;if(this.suppressOnChange)return;const n=this.getValues();this.initialValues=n,(i=this.onChange)==null||i.call(this,n),this.updateVisibility()};Oe(e)?e.setOnChange(()=>r()):pr(e)?e.setOnChange(()=>r()):(a=e.setOnChange)==null||a.call(e,()=>r())}addSetting(e,r){var n,i,s,o;if(this.settings[e]=r,this.wireChild(r),Oe(r)){const l=r;(n=l.deleteItemCfg)!=null&&n.showDeleteButton&&(l.onDeleteRequest=()=>{this.showDeleteConfirmation().then(c=>{c&&(this.skipHistoryNextChange=!0,this.removeSetting(e))})})}if(Oe(r)&&r.isRootNode===!0){const l=this.getValues();this.initialValues=l,this.suppressOnChange||(i=this.onChange)==null||i.call(this,l);return}if(this.elementRef){const l=this.elementRef.querySelector(".setting-group-content");if(l){const c=l.querySelector(".setting-group-empty");c&&c.remove(),Oe(r)&&typeof r.setNestingLevel=="function"&&r.setNestingLevel(this.nestingLevel+1);const h=r.draw(),u=this.deleteItemCfg??this.addItemCfg;if(u){const m=u.keyPrefix??((s=this.addItemCfg)==null?void 0:s.keyPrefix);m&&e.startsWith(m)&&this.addDeleteButtonToElement(h,e)}const f=l.querySelector(".sg-buttons-container");if(f)l.insertBefore(h,f);else{const m=l.querySelector(".sg-add-button-bottom");m&&m.parentElement===l?l.insertBefore(h,m):l.appendChild(h)}eo.trackElement(h),Vn(h,this.nestingLevel+1),Bi(h,this.nestingLevel+1);const p=h.style.display;h.style.display="none",h.offsetHeight,h.style.display=p,this.updateNestingStyles()}}const a=this.getValues();this.initialValues=a,this.suppressOnChange||(o=this.onChange)==null||o.call(this,a),!this.suppressOnChange&&typeof this.detectChange=="function"&&this.detectChange()}addDeleteButtonToElement(e,r,a){let n=null;try{n=e.querySelector(":scope > .setting-group-title")}catch{n=null}if(!n){const c=Array.from(e.querySelectorAll(".setting-group-title"));for(const h of c)if(h.closest(".setting-group")===e){n=h;break}n||(n=c[0]??null)}if(!n)return;const i=n.querySelector(".actions-section");if(!i)return;const s=document.createElement("button");s.type="button",s.className="sg-delete-button",a?a.deleteItemCfg:this.deleteItemCfg??this.addItemCfg,s.title="Delete",s.style.cssText=`
132
132
  background: none;
133
133
  border: none;
134
134
  cursor: pointer;
@@ -145,7 +145,7 @@
145
145
  <path d="M2 4h12M5.333 4V2.667a1.333 1.333 0 0 1 1.334-1.334h2.666a1.333 1.333 0 0 1 1.334 1.334V4m2 0v9.333a1.333 1.333 0 0 1-1.334 1.334H4.667a1.333 1.333 0 0 1-1.334-1.334V4h8.667Z" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
146
146
  <path d="M6.667 7.333v4M9.333 7.333v4" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
147
147
  </svg>
148
- `;s.innerHTML=o,s.addEventListener("mouseenter",()=>{s.style.backgroundColor="#fef2f2"}),s.addEventListener("mouseleave",()=>{s.style.backgroundColor="transparent"}),s.addEventListener("click",c=>{c.stopPropagation(),c.preventDefault(),this.showDeleteConfirmation().then(h=>{h&&(a&&a.deleteItemCfg?this.removeSetting(r):this.removeSetting(r))})});const l=i.querySelector(".setting-group-arrow");l?i.insertBefore(s,l):i.appendChild(s)}showDeleteConfirmation(){return new Promise(e=>{const r=document.createElement("div");r.className="sg-modal-overlay",r.style.cssText=`
148
+ `;s.innerHTML=o,s.addEventListener("mouseenter",()=>{s.style.backgroundColor="#fef2f2"}),s.addEventListener("mouseleave",()=>{s.style.backgroundColor="transparent"}),s.addEventListener("click",c=>{c.stopPropagation(),c.preventDefault(),this.showDeleteConfirmation().then(h=>{h&&(this.skipHistoryNextChange=!0,a&&a.deleteItemCfg?this.removeSetting(r):this.removeSetting(r))})});const l=i.querySelector(".setting-group-arrow");l?i.insertBefore(s,l):i.appendChild(s)}showDeleteConfirmation(){return new Promise(e=>{const r=document.createElement("div");r.className="sg-modal-overlay",r.style.cssText=`
149
149
  position: fixed;
150
150
  top: 0;
151
151
  left: 0;
@@ -320,7 +320,7 @@
320
320
  font-size: 14px;
321
321
  font-weight: 500;
322
322
  cursor: pointer;
323
- `;const u=()=>{a.style.opacity="0",setTimeout(()=>a.remove(),200)};c.addEventListener("click",u),a.addEventListener("click",f=>{f.target===a&&u()}),h.addEventListener("click",()=>{var m,d,g;const f=((m=this.addItemCfg)==null?void 0:m.keyPrefix)||"rules:";Object.keys(this.settings).filter(x=>x.startsWith(f)).forEach(x=>{this.removeSetting(x)}),e.rules.forEach(x=>{const w=this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix),v=this.addItemCfg.createItem(w,x);if(Hn(v)){const I=`${this.addItemCfg.keyPrefix}${w}`;this.addSetting(I,v);const L=this.settings[I];if(Oe(L)){const _={},C={};Object.entries(x.ruleTitle).forEach(([M,N])=>{M==="ka"?_.default=N:_[M]=N}),Object.entries(x.ruleContent).forEach(([M,N])=>{M==="ka"?C.default=N:C[M]=N}),L.setValue({ruleTitle:{text:_},content:{ruleContent:{text:C}}})}}}),(g=(d=this.addItemCfg)==null?void 0:d.excelImport)!=null&&g.onImport&&this.addItemCfg.excelImport.onImport(e.rules),u()}),l.appendChild(c),l.appendChild(h),n.appendChild(i),n.appendChild(s),n.appendChild(o),n.appendChild(l),a.appendChild(n),document.body.appendChild(a)}escapeHtml(e){const r=document.createElement("div");return r.textContent=e,r.innerHTML}getNextIndexFromPrefix(e){const r=new Set(Object.keys(this.settings).filter(n=>n.startsWith(e)).map(n=>{const i=Number(n.slice(e.length));return Number.isFinite(i)?i:-1}).filter(n=>n>=0));let a=0;for(;r.has(a);)a+=1;return a}calculateChanges(e,r){const a={};return new Set([...Object.keys(e),...Object.keys(r)]).forEach(i=>{const s=e[i],o=r[i];JSON.stringify(s)!==JSON.stringify(o)&&(a[i]={from:s,to:o})}),a}getValues(e){if(e===void 0){const r={$id:this.$id,isRootNode:this.isRootNode};for(const a in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,a)){const n=this.settings[a];if(Oe(n))r[a]=n.getValues();else{const i=n,s=i.getValue?i.getValue():i.value;r[a]=s}}return r}else{const r=this.settings[e];if(!r)return;if(Oe(r))return r.getValues();const a=r;return a.getValue?a.getValue():a.value}}getValuesForJson(e){var r;if(e===void 0){if(this.includeGetJson===!1)return null;const a={};for(const n in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,n)){const i=this.settings[n];if(Oe(i)){const s=i.getValuesForJson();s!==null&&(a[n]=s)}else{const s=i;if(s.includeGetJson!==!1)if(i instanceof na){const o=i.getRawValue();a[n]=o?Zt(o):null}else a[n]=s.value}}return(this.hide===!0||((r=this==null?void 0:this.groupProps)==null?void 0:r.hide)===!0)&&(a.hide=!0),a}else{const a=this.settings[e];if(!a)return;if(Oe(a))return a.includeGetJson===!1?null:a.getValuesForJson();{const n=a;if(n.includeGetJson===!1)return null;if(a instanceof na){const i=a.getRawValue();return i?Zt(i):null}return es(n.value)}}}getDefaultValues(e){if(e===void 0){const r={};for(const a in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,a)){const n=this.settings[a];if(Oe(n))r[a]=n.getDefaultValues();else{const i=n;r[a]=i.default!==void 0?i.default:i.value}}return r}else{const r=this.settings[e];if(!r)return;if(Oe(r))return r.getDefaultValues();const a=r;return a.default!==void 0?a.default:a.value}}disable(){var e;(e=this.groupContainer)==null||e.classList.add("disabled-setting-group")}enable(){var e;(e=this.groupContainer)==null||e.classList.remove("disabled-setting-group")}draw(){var c,h;const e=document.createElement("div");this.groupContainer=e,e.className=`setting-group ${this.disabled?"disabled-setting-group":""}`,this.disabled&&this.disable(),e.id=`setting-group-${this.id}`,e.setAttribute("data-setting-id",this.$id),li.hiddenElements.add(e),this.hide&&(e.style.display="none"),this.isMain&&e.classList.add("main-group"),this.custom&&e.classList.add("custom_class"),Vn(e,this.nestingLevel);const r=document.createElement("div");r.className="setting-group-title",this.isCollapsed&&r.classList.add("collapsed-view"),r.setAttribute("role","button"),r.setAttribute("aria-expanded",(!this.isCollapsed).toString()),r.setAttribute("tabindex","0");const a=document.createElement("div");a.className="title-section";const n=document.createElement("h3");n.textContent=this.title,a.appendChild(n);const i=document.createElement("div");i.className="actions-section";const s=document.createElement("div");s.className="setting-group-content",this.isCollapsed&&(s.classList.add("collapsed"),r.classList.add("collapsed-view"),e.classList.add("collapsed")),this.isMain&&s.classList.add("main-content");const o=()=>{this.isCollapsed=!this.isCollapsed,s.classList.toggle("collapsed"),r.classList.toggle("collapsed-view"),e.classList.toggle("collapsed",this.isCollapsed),r.setAttribute("aria-expanded",(!this.isCollapsed).toString())};if(r.onkeydown=u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),o())},this.addItemCfg){const u=document.createElement("div");u.className="sg-buttons-container",u.style.cssText=`
323
+ `;const u=()=>{a.style.opacity="0",setTimeout(()=>a.remove(),200)};c.addEventListener("click",u),a.addEventListener("click",f=>{f.target===a&&u()}),h.addEventListener("click",()=>{var m,d,g;const f=((m=this.addItemCfg)==null?void 0:m.keyPrefix)||"rules:";Object.keys(this.settings).filter(x=>x.startsWith(f)).forEach(x=>{this.skipHistoryNextChange=!0,this.removeSetting(x)}),e.rules.forEach(x=>{const w=this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix),v=this.addItemCfg.createItem(w,x);if(Hn(v)){const I=`${this.addItemCfg.keyPrefix}${w}`;this.skipHistoryNextChange=!0,this.addSetting(I,v);const L=this.settings[I];if(Oe(L)){const _={},C={};Object.entries(x.ruleTitle).forEach(([M,N])=>{M==="ka"?_.default=N:_[M]=N}),Object.entries(x.ruleContent).forEach(([M,N])=>{M==="ka"?C.default=N:C[M]=N}),L.setValue({ruleTitle:{text:_},content:{ruleContent:{text:C}}})}}}),(g=(d=this.addItemCfg)==null?void 0:d.excelImport)!=null&&g.onImport&&this.addItemCfg.excelImport.onImport(e.rules),u()}),l.appendChild(c),l.appendChild(h),n.appendChild(i),n.appendChild(s),n.appendChild(o),n.appendChild(l),a.appendChild(n),document.body.appendChild(a)}escapeHtml(e){const r=document.createElement("div");return r.textContent=e,r.innerHTML}getNextIndexFromPrefix(e){const r=new Set(Object.keys(this.settings).filter(n=>n.startsWith(e)).map(n=>{const i=Number(n.slice(e.length));return Number.isFinite(i)?i:-1}).filter(n=>n>=0));let a=0;for(;r.has(a);)a+=1;return a}calculateChanges(e,r){const a={};return new Set([...Object.keys(e),...Object.keys(r)]).forEach(i=>{const s=e[i],o=r[i];JSON.stringify(s)!==JSON.stringify(o)&&(a[i]={from:s,to:o})}),a}getValues(e){if(e===void 0){const r={$id:this.$id,isRootNode:this.isRootNode};for(const a in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,a)){const n=this.settings[a];if(Oe(n))r[a]=n.getValues();else{const i=n,s=i.getValue?i.getValue():i.value;r[a]=s}}return r}else{const r=this.settings[e];if(!r)return;if(Oe(r))return r.getValues();const a=r;return a.getValue?a.getValue():a.value}}getValuesForJson(e){var r;if(e===void 0){if(this.includeGetJson===!1)return null;const a={};for(const n in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,n)){const i=this.settings[n];if(Oe(i)){const s=i.getValuesForJson();s!==null&&(a[n]=s)}else{const s=i;if(s.includeGetJson!==!1)if(i instanceof na){const o=i.getRawValue();a[n]=o?Zt(o):null}else a[n]=s.value}}return(this.hide===!0||((r=this==null?void 0:this.groupProps)==null?void 0:r.hide)===!0)&&(a.hide=!0),a}else{const a=this.settings[e];if(!a)return;if(Oe(a))return a.includeGetJson===!1?null:a.getValuesForJson();{const n=a;if(n.includeGetJson===!1)return null;if(a instanceof na){const i=a.getRawValue();return i?Zt(i):null}return es(n.value)}}}getDefaultValues(e){if(e===void 0){const r={};for(const a in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,a)){const n=this.settings[a];if(Oe(n))r[a]=n.getDefaultValues();else{const i=n;r[a]=i.default!==void 0?i.default:i.value}}return r}else{const r=this.settings[e];if(!r)return;if(Oe(r))return r.getDefaultValues();const a=r;return a.default!==void 0?a.default:a.value}}disable(){var e;(e=this.groupContainer)==null||e.classList.add("disabled-setting-group")}enable(){var e;(e=this.groupContainer)==null||e.classList.remove("disabled-setting-group")}draw(){var c,h;const e=document.createElement("div");this.groupContainer=e,e.className=`setting-group ${this.disabled?"disabled-setting-group":""}`,this.disabled&&this.disable(),e.id=`setting-group-${this.id}`,e.setAttribute("data-setting-id",this.$id),li.hiddenElements.add(e),this.hide&&(e.style.display="none"),this.isMain&&e.classList.add("main-group"),this.custom&&e.classList.add("custom_class"),Vn(e,this.nestingLevel);const r=document.createElement("div");r.className="setting-group-title",this.isCollapsed&&r.classList.add("collapsed-view"),r.setAttribute("role","button"),r.setAttribute("aria-expanded",(!this.isCollapsed).toString()),r.setAttribute("tabindex","0");const a=document.createElement("div");a.className="title-section";const n=document.createElement("h3");n.textContent=this.title,a.appendChild(n);const i=document.createElement("div");i.className="actions-section";const s=document.createElement("div");s.className="setting-group-content",this.isCollapsed&&(s.classList.add("collapsed"),r.classList.add("collapsed-view"),e.classList.add("collapsed")),this.isMain&&s.classList.add("main-content");const o=()=>{this.isCollapsed=!this.isCollapsed,s.classList.toggle("collapsed"),r.classList.toggle("collapsed-view"),e.classList.toggle("collapsed",this.isCollapsed),r.setAttribute("aria-expanded",(!this.isCollapsed).toString())};if(r.onkeydown=u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),o())},this.addItemCfg){const u=document.createElement("div");u.className="sg-buttons-container",u.style.cssText=`
324
324
  display: flex;
325
325
  flex-direction: column;
326
326
  align-items: flex-end;
@@ -360,7 +360,7 @@
360
360
  <path d="M6.2793 0C6.55544 0 6.7793 0.223858 6.7793 0.5V5.21875H11.499C11.775 5.21882 11.9988 5.44287 11.999 5.71875V6.28027C11.9989 6.55627 11.775 6.7802 11.499 6.78027H6.7793V11.499C6.7793 11.7752 6.55544 11.999 6.2793 11.999H5.71875C5.44266 11.999 5.21875 11.7751 5.21875 11.499V6.78027H0.5C0.223932 6.78027 0.000120808 6.55631 0 6.28027V5.71875C0.000250763 5.44282 0.224012 5.21875 0.5 5.21875H5.21875V0.5C5.21875 0.223893 5.44266 5.74439e-05 5.71875 0H6.2793Z" fill="#298C5C"/>
361
361
  </svg>
362
362
 
363
- </span>`;if(f.innerHTML=`${p}<span>${this.addItemCfg.buttonLabel??"Add"}</span>`,f.addEventListener("click",m=>{m.stopPropagation(),m.preventDefault();const d=this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix),g=this.addItemCfg.createItem(d);if(Hn(g)){const x=`${this.addItemCfg.keyPrefix}${d}`;this.addSetting(x,g)}}),u.appendChild(f),(c=this.addItemCfg.excelImport)!=null&&c.enabled){const m=this.addItemCfg.excelImport,d=document.createElement("div");d.className="sg-excel-buttons-row",d.style.cssText=`
363
+ </span>`;if(f.innerHTML=`${p}<span>${this.addItemCfg.buttonLabel??"Add"}</span>`,f.addEventListener("click",m=>{m.stopPropagation(),m.preventDefault();const d=this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix),g=this.addItemCfg.createItem(d);if(Hn(g)){const x=`${this.addItemCfg.keyPrefix}${d}`;this.skipHistoryNextChange=!0,this.addSetting(x,g)}}),u.appendChild(f),(c=this.addItemCfg.excelImport)!=null&&c.enabled){const m=this.addItemCfg.excelImport,d=document.createElement("div");d.className="sg-excel-buttons-row",d.style.cssText=`
364
364
  display: flex;
365
365
  justify-content: flex-end;
366
366
  gap: 8px;
@@ -26743,7 +26743,7 @@ function Qi(t) {
26743
26743
  const si = class si {
26744
26744
  constructor(e) {
26745
26745
  this.elementRef = null, this.isHidden = !1, this.custom = !1, this.initialValues = {}, this.changeTimeout = null, this.isHandlingChange = !1, this.changeHandlers = /* @__PURE__ */ new Set(), this.blurTimeout = null, this.lastChangeTime = 0, this.handleBlur = () => {
26746
- }, this.pendingBlurHandler = null, this.originalDefaultValues = {}, this.nestingLevel = 0, this.dataPropsPath = "", this.hide = !1, this.isSettingValue = !1, this.suppressOnChange = !1, this.isRootNode = !1, this.$id = tn(), this.setActiveOnSettingSelection = !1, this.suppressOnChange = !0, this.id = e.id || tn(), this.title = e.title ?? "", this.settings = e.settings, this.isCollapsed = e.collapsed ?? !1, this.isMain = e.main ?? !1, this.custom = e.custom ?? !1, this.nestingLevel = 0, this.includeGetJson = e.includeGetJson ?? !0, this.addItemCfg = e.addItem, this.deleteItemCfg = e.deleteItem, this.dataProps = e.dataProps, this.dataPropsPath = e.dataProps || "", this.hide = e.hide ?? !1, Object.assign(this, e.settings), this.initialValues = this.getValues(), this.originalDefaultValues = this.getDefaultValues(), this.propagateNestingLevel(), this.propagateDataPropsPath(), this.propagateComponentPaths(), this.suppressOnChange = !1, this.disabled = e.disabled;
26746
+ }, this.pendingBlurHandler = null, this.originalDefaultValues = {}, this.nestingLevel = 0, this.dataPropsPath = "", this.hide = !1, this.isSettingValue = !1, this.suppressOnChange = !1, this.isRootNode = !1, this.skipHistoryNextChange = !1, this.$id = tn(), this.setActiveOnSettingSelection = !1, this.suppressOnChange = !0, this.id = e.id || tn(), this.title = e.title ?? "", this.settings = e.settings, this.isCollapsed = e.collapsed ?? !1, this.isMain = e.main ?? !1, this.custom = e.custom ?? !1, this.nestingLevel = 0, this.includeGetJson = e.includeGetJson ?? !0, this.addItemCfg = e.addItem, this.deleteItemCfg = e.deleteItem, this.dataProps = e.dataProps, this.dataPropsPath = e.dataProps || "", this.hide = e.hide ?? !1, Object.assign(this, e.settings), this.initialValues = this.getValues(), this.originalDefaultValues = this.getDefaultValues(), this.propagateNestingLevel(), this.propagateDataPropsPath(), this.propagateComponentPaths(), this.suppressOnChange = !1, this.disabled = e.disabled;
26747
26747
  }
26748
26748
  propagateNestingLevel() {
26749
26749
  const e = this.nestingLevel + 1;
@@ -26751,6 +26751,10 @@ const si = class si {
26751
26751
  Re(a) && (a.nestingLevel = e, a.propagateNestingLevel());
26752
26752
  });
26753
26753
  }
26754
+ consumeSkipHistoryNextChange() {
26755
+ const e = this.skipHistoryNextChange;
26756
+ return this.skipHistoryNextChange = !1, e;
26757
+ }
26754
26758
  getNestingLevel() {
26755
26759
  return this.nestingLevel;
26756
26760
  }
@@ -26946,7 +26950,7 @@ const si = class si {
26946
26950
  this.initialValues = l, e(l);
26947
26951
  }), this.changeHandlers.add(() => e(this.getValues())), (s = n.deleteItemCfg) != null && s.showDeleteButton && (n.onDeleteRequest = () => {
26948
26952
  this.showDeleteConfirmation().then((l) => {
26949
- l && this.removeSetting(i);
26953
+ l && (this.skipHistoryNextChange = !0, this.removeSetting(i));
26950
26954
  });
26951
26955
  });
26952
26956
  else if (Er(n)) {
@@ -27020,7 +27024,7 @@ const si = class si {
27020
27024
  const l = r;
27021
27025
  (n = l.deleteItemCfg) != null && n.showDeleteButton && (l.onDeleteRequest = () => {
27022
27026
  this.showDeleteConfirmation().then((c) => {
27023
- c && this.removeSetting(e);
27027
+ c && (this.skipHistoryNextChange = !0, this.removeSetting(e));
27024
27028
  });
27025
27029
  });
27026
27030
  }
@@ -27103,7 +27107,7 @@ const si = class si {
27103
27107
  s.style.backgroundColor = "transparent";
27104
27108
  }), s.addEventListener("click", (c) => {
27105
27109
  c.stopPropagation(), c.preventDefault(), this.showDeleteConfirmation().then((h) => {
27106
- h && (a && a.deleteItemCfg ? this.removeSetting(r) : this.removeSetting(r));
27110
+ h && (this.skipHistoryNextChange = !0, a && a.deleteItemCfg ? this.removeSetting(r) : this.removeSetting(r));
27107
27111
  });
27108
27112
  });
27109
27113
  const l = i.querySelector(".setting-group-arrow");
@@ -27382,12 +27386,12 @@ const si = class si {
27382
27386
  Object.keys(this.settings).filter(
27383
27387
  (x) => x.startsWith(f)
27384
27388
  ).forEach((x) => {
27385
- this.removeSetting(x);
27389
+ this.skipHistoryNextChange = !0, this.removeSetting(x);
27386
27390
  }), e.rules.forEach((x) => {
27387
27391
  const w = this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix), v = this.addItemCfg.createItem(w, x);
27388
27392
  if (wi(v)) {
27389
27393
  const I = `${this.addItemCfg.keyPrefix}${w}`;
27390
- this.addSetting(I, v);
27394
+ this.skipHistoryNextChange = !0, this.addSetting(I, v);
27391
27395
  const L = this.settings[I];
27392
27396
  if (Re(L)) {
27393
27397
  const _ = {}, C = {};
@@ -27605,7 +27609,7 @@ const si = class si {
27605
27609
  const d = this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix), g = this.addItemCfg.createItem(d);
27606
27610
  if (wi(g)) {
27607
27611
  const x = `${this.addItemCfg.keyPrefix}${d}`;
27608
- this.addSetting(x, g);
27612
+ this.skipHistoryNextChange = !0, this.addSetting(x, g);
27609
27613
  }
27610
27614
  }), u.appendChild(f), (c = this.addItemCfg.excelImport) != null && c.enabled) {
27611
27615
  const m = this.addItemCfg.excelImport, d = document.createElement("div");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "builder-settings-types",
3
3
  "description": "builder settings",
4
- "version": "0.0.440",
4
+ "version": "0.0.441",
5
5
  "type": "module",
6
6
  "main": "dist/builder-settings-types.cjs.js",
7
7
  "module": "dist/builder-settings-types.es.js",