open-grid 1.7.0 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/ExportProgressView-BYPw8osg.cjs +2 -0
  3. package/dist/ExportProgressView-Bt5-z7rE.js +2 -0
  4. package/dist/LcpMergeOrderer-CeP6C6G1.cjs +2 -0
  5. package/dist/LcpMergeOrderer-Ebwuir-r.js +2 -0
  6. package/dist/OpenGrid-Bh1NMOcm.cjs +98 -0
  7. package/dist/OpenGrid-CeXt04ho.js +98 -0
  8. package/dist/Registry-CrT46EAO.js +2 -0
  9. package/dist/Registry-DpHOpU5V.cjs +2 -0
  10. package/dist/XlsxChannel-CuOZ3LQz.js +2 -0
  11. package/dist/XlsxChannel-DQHLGend.cjs +2 -0
  12. package/dist/XlsxWorkbookWriter-DixuNGtw.cjs +3 -0
  13. package/dist/XlsxWorkbookWriter-VgbibI0Z.js +3 -0
  14. package/dist/fflate-Cs3txMgg.js +2 -0
  15. package/dist/fflate-G9RAFEgF.cjs +2 -0
  16. package/dist/index-1OXjJmct.js +2 -0
  17. package/dist/index-B5V7e4Xc.js +2 -0
  18. package/dist/index-DbKDox8y.cjs +2 -0
  19. package/dist/index-HaDoF1HM.cjs +2 -0
  20. package/dist/open-grid-react.cjs +1 -27
  21. package/dist/open-grid-react.js +1 -30
  22. package/dist/open-grid-vue.cjs +1 -31
  23. package/dist/open-grid-vue.js +1 -33
  24. package/dist/open-grid.cjs +6 -275
  25. package/dist/open-grid.js +6 -293
  26. package/dist/sinks-BCZFMGQJ.cjs +2 -0
  27. package/dist/sinks-qkBJ5bKn.js +2 -0
  28. package/dist/types/core/ExportManager.d.ts +1 -0
  29. package/dist/types/core/export/channels/XlsxChannel.d.ts +9 -1
  30. package/dist/types/core/export/channels/XlsxRichTextRun.d.ts +14 -0
  31. package/dist/types/core/export/channels/XlsxSheetXml.d.ts +19 -0
  32. package/dist/types/core/export/channels/XlsxStyleEntries.d.ts +80 -0
  33. package/dist/types/core/export/channels/XlsxStylesRegistry.d.ts +20 -0
  34. package/dist/types/core/export/channels/XlsxWorkbookWriter.d.ts +7 -4
  35. package/dist/types/core/export/channels/XlsxXml.d.ts +6 -0
  36. package/dist/types/core/export/types.d.ts +63 -0
  37. package/dist/types/core/types.d.ts +24 -0
  38. package/dist/types/index.d.ts +1 -0
  39. package/dist/xlsx.min-CMvrM6b4.cjs +138 -0
  40. package/dist/xlsx.min-i_b-4PvU.js +138 -0
  41. package/package.json +2 -1
  42. package/dist/ExportProgressView-9Kt1SQxv.js +0 -48
  43. package/dist/ExportProgressView-B59uHIwt.cjs +0 -48
  44. package/dist/LcpMergeOrderer-BdUtV67j.js +0 -114
  45. package/dist/LcpMergeOrderer-C_ANVkGk.cjs +0 -113
  46. package/dist/OpenGrid-BUYQs1_w.cjs +0 -9806
  47. package/dist/OpenGrid-BmagF0yo.js +0 -9819
  48. package/dist/Registry-CPJYOqCn.js +0 -74
  49. package/dist/Registry-D74ZmdDz.cjs +0 -71
  50. package/dist/XlsxChannel-DOeHeP7h.cjs +0 -95
  51. package/dist/XlsxChannel-DdaiytFR.js +0 -95
  52. package/dist/XlsxWorkbookWriter-BTNtZ80J.js +0 -199
  53. package/dist/XlsxWorkbookWriter-_u5stfg4.cjs +0 -198
  54. package/dist/index-B9_g5Eg3.js +0 -481
  55. package/dist/index-CeJ-0-80.cjs +0 -260
  56. package/dist/index-CnyumyPV.cjs +0 -452
  57. package/dist/index-DnarQ4eR.js +0 -266
  58. package/dist/sinks-BWkWQexV.js +0 -149
  59. package/dist/sinks-DPK0VxYG.cjs +0 -143
  60. package/dist/xlsx.min-BQ1o3sB6.cjs +0 -11793
  61. package/dist/xlsx.min-Bbz2ZypC.js +0 -11794
@@ -0,0 +1,2 @@
1
+ const d=["og:","og-"];function a(t){return d.some(i=>t.startsWith(i))}function u(t){const i=t.lastIndexOf("@"),r=i>=0?t.slice(i+1):t;return r.split(".")[0]??r}function c(t,i){return u(t)===u(i)}function l(t,i,r,e,s){const n={key:t,value:i,origin:r,priority:e.priority??0,seq:s};return e.pluginId!==void 0&&(n.pluginId=e.pluginId),e.spiVersion!==void 0&&(n.spiVersion=e.spiVersion),e.deprecated!==void 0&&(n.deprecated=e.deprecated),n}class h{constructor(i={}){this.$c=new Map,this.$nh=0,this._disposed=!1,this.$aq=new Set,this.$g=i}$hA(i,r){const e=`[OpenGrid] ${r}`,s=`${i}::${r}`;return this.$aq.has(s)||(this.$aq.add(s),(this.$g.onWarn??(o=>{typeof console<"u"&&console.warn(o)}))(e)),e}register(i,r,e={}){if(this._disposed)return{ok:!1,action:"rejected",reason:"disposed"};if(typeof i!="string"||i.length===0)return{ok:!1,action:"rejected",reason:"invalid-key"};const s=e.origin??"user";if(a(i)&&s!=="builtin")return{ok:!1,action:"rejected",reason:"reserved-namespace",warning:this.$hA(i,`reserved namespace: '${i}' 는 og:* 코어 예약 대역입니다(origin:'builtin' 만 점유).`)};if(this.$g.spi&&e.spiVersion!==void 0&&!c(this.$g.spi.version,e.spiVersion))return{ok:!1,action:"rejected",reason:"spi-mismatch",warning:this.$hA(i,`SPI major 불일치: '${i}' 선언 ${e.spiVersion}, 코어 ${this.$g.spi.name}@${this.$g.spi.version}.`)};const n=this.$c.get(i);return n&&!this.$mY(n,e)?{ok:!1,action:"kept",reason:"protected-builtin",warning:this.$hA(i,`'${i}' 는 ${n.origin==="builtin"?"내장(built-in) 보호":"override 미지정"} — 덮으려면 { override:true }.`)}:(this.$c.set(i,l(i,r,s,e,this.$nh++)),{ok:!0,action:n?"replaced":"added"})}$mY(i,r){return i.origin==="builtin"&&r.override!==!0?!1:this.$g.duplicatePolicy==="explicit-override"?r.override===!0:!0}get(i){var r;return(r=this.$c.get(i))==null?void 0:r.value}require(i,r){const e=this.get(i);if(e!==void 0)return e;if(r!==void 0)return r;if(this.$g.placeholder)return this.$g.placeholder(i)}has(i){return this.$c.has(i)}list(){return[...this.$c.keys()]}entries(){return[...this.$c.values()]}unregister(i){return this.$c.delete(i)}disposePlugin(i){let r=0;for(const[e,s]of this.$c)s.pluginId===i&&(this.$c.delete(e),r++);return r}dispose(){this.$c.clear(),this.$aq.clear(),this._disposed=!0}}export{d as R,h as T,a as i};
2
+ //# sourceMappingURL=Registry-CrT46EAO.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";const RESERVED_PREFIXES=["og:","og-"];function isReserved(t){return RESERVED_PREFIXES.some(i=>t.startsWith(i))}function spiMajor(t){const i=t.lastIndexOf("@"),r=i>=0?t.slice(i+1):t;return r.split(".")[0]??r}function spiCompatible(t,i){return spiMajor(t)===spiMajor(i)}function buildEntry(t,i,r,e,n){const s={key:t,value:i,origin:r,priority:e.priority??0,seq:n};return e.pluginId!==void 0&&(s.pluginId=e.pluginId),e.spiVersion!==void 0&&(s.spiVersion=e.spiVersion),e.deprecated!==void 0&&(s.deprecated=e.deprecated),s}class TypedRegistry{constructor(i={}){this.$c=new Map,this.$nh=0,this._disposed=!1,this.$aq=new Set,this.$g=i}$hA(i,r){const e=`[OpenGrid] ${r}`,n=`${i}::${r}`;return this.$aq.has(n)||(this.$aq.add(n),(this.$g.onWarn??(o=>{typeof console<"u"&&console.warn(o)}))(e)),e}register(i,r,e={}){if(this._disposed)return{ok:!1,action:"rejected",reason:"disposed"};if(typeof i!="string"||i.length===0)return{ok:!1,action:"rejected",reason:"invalid-key"};const n=e.origin??"user";if(isReserved(i)&&n!=="builtin")return{ok:!1,action:"rejected",reason:"reserved-namespace",warning:this.$hA(i,`reserved namespace: '${i}' 는 og:* 코어 예약 대역입니다(origin:'builtin' 만 점유).`)};if(this.$g.spi&&e.spiVersion!==void 0&&!spiCompatible(this.$g.spi.version,e.spiVersion))return{ok:!1,action:"rejected",reason:"spi-mismatch",warning:this.$hA(i,`SPI major 불일치: '${i}' 선언 ${e.spiVersion}, 코어 ${this.$g.spi.name}@${this.$g.spi.version}.`)};const s=this.$c.get(i);return s&&!this.$mY(s,e)?{ok:!1,action:"kept",reason:"protected-builtin",warning:this.$hA(i,`'${i}' 는 ${s.origin==="builtin"?"내장(built-in) 보호":"override 미지정"} — 덮으려면 { override:true }.`)}:(this.$c.set(i,buildEntry(i,r,n,e,this.$nh++)),{ok:!0,action:s?"replaced":"added"})}$mY(i,r){return i.origin==="builtin"&&r.override!==!0?!1:this.$g.duplicatePolicy==="explicit-override"?r.override===!0:!0}get(i){var r;return(r=this.$c.get(i))==null?void 0:r.value}require(i,r){const e=this.get(i);if(e!==void 0)return e;if(r!==void 0)return r;if(this.$g.placeholder)return this.$g.placeholder(i)}has(i){return this.$c.has(i)}list(){return[...this.$c.keys()]}entries(){return[...this.$c.values()]}unregister(i){return this.$c.delete(i)}disposePlugin(i){let r=0;for(const[e,n]of this.$c)n.pluginId===i&&(this.$c.delete(e),r++);return r}dispose(){this.$c.clear(),this.$aq.clear(),this._disposed=!0}}exports.RESERVED_PREFIXES=RESERVED_PREFIXES,exports.TypedRegistry=TypedRegistry,exports.isReserved=isReserved;
2
+ //# sourceMappingURL=Registry-DpHOpU5V.cjs.map
@@ -0,0 +1,2 @@
1
+ const P={merges:!1,frozen:!1,colWidths:!1,cf:!1,filters:!1,sort:!1,hiddenCols:!1,groupCollapse:!1,charts:!1,styling:!1,provenance:!1},R={...P,merges:!0,colWidths:!0,cf:!0,styling:!0,provenance:!0};class C{constructor(s,t={}){this.writer=s,this.opts=t,this.id="xlsx",this.capabilities=R}async buildModel(s,t){const o=s.projectHeader(),n=o[o.length-1]??[],c=[],p=[];let h=0;for await(const r of s.projectRows()){for(const b of r.rows){const m=[];let a=0;for(const i of b.cells){if(i.hidden){a++;continue}const f=N(i);(i.rowSpan>1||i.colSpan>1)&&p.push({r:h+1,c:a,rs:i.rowSpan,cs:i.colSpan}),m.push(f),a++}c.push(m),h++}if(r.done)break}const u={sheetName:this.opts.sheetName??"Sheet1",header:n.map(r=>r.text),colWidthsPx:n.map(r=>r.widthPx),rows:c,merges:p};if(this.opts.includeProvenance!==!1&&(t!=null&&t.provenance)){const r=t.provenance.render("xlsx");r.text&&(u.provenanceNote=r.text)}return u}async write(s,t,o){const n=await this.buildModel(s,o),c=await this.writer.write(n,t);return await t.close(),{bytesWritten:c,rowsWritten:n.rows.length,aborted:!1}}async writeStreaming(s,t,o){var n,c,p,h;const u=this.writer;if(typeof u.openStream!="function")throw new Error("xlsx writer does not support streaming");const r=s.projectHeader(),b=r[r.length-1]??[],m=s.totalRows(),a=await u.openStream({sheetName:this.opts.sheetName??"Sheet1",header:b.map(l=>l.text),colWidthsPx:b.map(l=>l.widthPx),...this.opts.includeHeader===!1?{includeHeader:!1}:{}},t),i=this.opts.includeHeader===!1?0:1;let f=0,w=!1;try{for await(const l of s.projectRows()){if((n=o==null?void 0:o.signal)!=null&&n.aborted){w=!0;break}if(l.rows.length>0){const g=[],y=[];for(const S of l.rows){const v=[];let x=0;for(const d of S.cells){if(d.hidden){x++;continue}(d.rowSpan>1||d.colSpan>1)&&y.push({r:f+g.length+i,c:x,rs:d.rowSpan,cs:d.colSpan}),v.push(N(d)),x++}g.push(v)}await a.appendRows(g,y),f+=g.length,(c=o==null?void 0:o.onProgress)==null||c.call(o,f,m),await new Promise(S=>setTimeout(S,0))}if((p=o==null?void 0:o.signal)!=null&&p.aborted){w=!0;break}if(l.done)break}}catch(l){throw a.abort(),t.abort("error"),l}if(!w&&((h=o==null?void 0:o.signal)!=null&&h.aborted)&&(w=!0),w)return a.abort(),t.abort("cancelled"),{bytesWritten:0,rowsWritten:f,aborted:!0};const W=await a.finish();return await t.close(),{bytesWritten:W,rowsWritten:f,aborted:!1}}}function N(e){var s;const t={value:e.text,align:e.align,rowSpan:e.rowSpan,colSpan:e.colSpan};if(e.type==="number"||e.type==="currency"||e.type==="money"||e.type==="percent"){let o=NaN;if(e.rawText!==void 0)o=Number(e.rawText);else{const n=e.text.replace(/[^\d.-]/g,"");n!==""&&(o=Number(n))}Number.isFinite(o)&&(t.num=o)}return e.xlsxStyle&&(t.style=e.xlsxStyle),e.xlsxRuns&&(t.runs=e.xlsxRuns),(s=e.cf)!=null&&s.fill&&(t.fill=e.cf.fill.color),e.cf&&(t.ink=e.cf.inkColor),t}export{C as XlsxChannel};
2
+ //# sourceMappingURL=XlsxChannel-CuOZ3LQz.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const NONE={merges:!1,frozen:!1,colWidths:!1,cf:!1,filters:!1,sort:!1,hiddenCols:!1,groupCollapse:!1,charts:!1,styling:!1,provenance:!1},XLSX_CAPS={...NONE,merges:!0,colWidths:!0,cf:!0,styling:!0,provenance:!0};class XlsxChannel{constructor(s,t={}){this.writer=s,this.opts=t,this.id="xlsx",this.capabilities=XLSX_CAPS}async buildModel(s,t){const o=s.projectHeader(),l=o[o.length-1]??[],c=[],p=[];let u=0;for await(const r of s.projectRows()){for(const b of r.rows){const m=[];let a=0;for(const i of b.cells){if(i.hidden){a++;continue}const f=toSheetCell(i);(i.rowSpan>1||i.colSpan>1)&&p.push({r:u+1,c:a,rs:i.rowSpan,cs:i.colSpan}),m.push(f),a++}c.push(m),u++}if(r.done)break}const h={sheetName:this.opts.sheetName??"Sheet1",header:l.map(r=>r.text),colWidthsPx:l.map(r=>r.widthPx),rows:c,merges:p};if(this.opts.includeProvenance!==!1&&(t!=null&&t.provenance)){const r=t.provenance.render("xlsx");r.text&&(h.provenanceNote=r.text)}return h}async write(s,t,o){const l=await this.buildModel(s,o),c=await this.writer.write(l,t);return await t.close(),{bytesWritten:c,rowsWritten:l.rows.length,aborted:!1}}async writeStreaming(s,t,o){var l,c,p,u;const h=this.writer;if(typeof h.openStream!="function")throw new Error("xlsx writer does not support streaming");const r=s.projectHeader(),b=r[r.length-1]??[],m=s.totalRows(),a=await h.openStream({sheetName:this.opts.sheetName??"Sheet1",header:b.map(n=>n.text),colWidthsPx:b.map(n=>n.widthPx),...this.opts.includeHeader===!1?{includeHeader:!1}:{}},t),i=this.opts.includeHeader===!1?0:1;let f=0,w=!1;try{for await(const n of s.projectRows()){if((l=o==null?void 0:o.signal)!=null&&l.aborted){w=!0;break}if(n.rows.length>0){const g=[],y=[];for(const S of n.rows){const v=[];let x=0;for(const d of S.cells){if(d.hidden){x++;continue}(d.rowSpan>1||d.colSpan>1)&&y.push({r:f+g.length+i,c:x,rs:d.rowSpan,cs:d.colSpan}),v.push(toSheetCell(d)),x++}g.push(v)}await a.appendRows(g,y),f+=g.length,(c=o==null?void 0:o.onProgress)==null||c.call(o,f,m),await new Promise(S=>setTimeout(S,0))}if((p=o==null?void 0:o.signal)!=null&&p.aborted){w=!0;break}if(n.done)break}}catch(n){throw a.abort(),t.abort("error"),n}if(!w&&((u=o==null?void 0:o.signal)!=null&&u.aborted)&&(w=!0),w)return a.abort(),t.abort("cancelled"),{bytesWritten:0,rowsWritten:f,aborted:!0};const N=await a.finish();return await t.close(),{bytesWritten:N,rowsWritten:f,aborted:!1}}}function toSheetCell(e){var s;const t={value:e.text,align:e.align,rowSpan:e.rowSpan,colSpan:e.colSpan};if(e.type==="number"||e.type==="currency"||e.type==="money"||e.type==="percent"){let o=NaN;if(e.rawText!==void 0)o=Number(e.rawText);else{const l=e.text.replace(/[^\d.-]/g,"");l!==""&&(o=Number(l))}Number.isFinite(o)&&(t.num=o)}return e.xlsxStyle&&(t.style=e.xlsxStyle),e.xlsxRuns&&(t.runs=e.xlsxRuns),(s=e.cf)!=null&&s.fill&&(t.fill=e.cf.fill.color),e.cf&&(t.ink=e.cf.inkColor),t}exports.XlsxChannel=XlsxChannel;
2
+ //# sourceMappingURL=XlsxChannel-DQHLGend.cjs.map
@@ -0,0 +1,3 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const fflate=require("./fflate-G9RAFEgF.cjs");function xmlEscape(n){return n.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F￾￿]/g,"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function colName(n){let t=n+1,e="";for(;t>0;){const s=(t-1)%26;e=String.fromCharCode(65+s)+e,t=Math.floor((t-1)/26)}return e}const XML_HEAD=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
+ `,NS="http://schemas.openxmlformats.org/spreadsheetml/2006/main";function argb(n){if(!n)return;const t=n.trim(),e=t.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);if(e)return"FF"+[e[1],e[2],e[3]].map(o=>Math.min(255,parseInt(o,10)).toString(16).padStart(2,"0")).join("").toUpperCase();const s=t.replace("#","").toUpperCase();if(/^[0-9A-F]+$/.test(s)){if(s.length===3)return"FF"+s[0]+s[0]+s[1]+s[1]+s[2]+s[2];if(s.length===6)return"FF"+s;if(s.length===8)return s}}class FontEntry{constructor(t,e,s,o=11){this.bold=t,this.italic=e,this.color=s,this.size=o}static plain(){return new FontEntry(!1,!1,void 0)}static from(t){var e,s,o,i;const l=argb((s=(e=t.font)==null?void 0:e.color)==null?void 0:s.rgb),r=!!((o=t.font)!=null&&o.bold),a=!!((i=t.font)!=null&&i.italic);return l||r||a?new FontEntry(r,a,l):void 0}static fromRun(t){var e;if(!t)return;const s=argb((e=t.color)==null?void 0:e.rgb),o=typeof t.size=="number"&&t.size>0&&Number.isFinite(t.size)?t.size:11;return s||t.bold||t.italic||o!==11?new FontEntry(!!t.bold,!!t.italic,s,o):void 0}hashKey(){return`${this.bold?"b":""}${this.italic?"i":""}|${this.color??""}|${this.size}`}equals(t){return this.hashKey()===t.hashKey()}toXml(){return"<font>"+(this.bold?"<b/>":"")+(this.italic?"<i/>":"")+`<sz val="${this.size}"/>`+(this.color?`<color rgb="${this.color}"/>`:"")+'<name val="Calibri"/></font>'}toRunPropsXml(){return'<rPr><rFont val="Calibri"/>'+(this.bold?"<b/>":"")+(this.italic?"<i/>":"")+(this.color?`<color rgb="${this.color}"/>`:"")+`<sz val="${this.size}"/></rPr>`}}class FillEntry{constructor(t,e){this.pattern=t,this.color=e}static none(){return new FillEntry("none",void 0)}static gray125(){return new FillEntry("gray125",void 0)}static solid(t){return new FillEntry("solid",t)}static from(t){var e;const s=argb((e=t.fill)==null?void 0:e.rgb);return s?FillEntry.solid(s):void 0}hashKey(){return`${this.pattern}|${this.color??""}`}equals(t){return this.hashKey()===t.hashKey()}toXml(){return this.pattern!=="solid"?`<fill><patternFill patternType="${this.pattern}"/></fill>`:`<fill><patternFill patternType="solid"><fgColor rgb="${this.color}"/><bgColor indexed="64"/></patternFill></fill>`}}class BorderEntry{constructor(t,e){this.style=t,this.color=e}static none(){return new BorderEntry(void 0,void 0)}static from(t){var e;return t.border?new BorderEntry(t.border.style,argb((e=t.border.color)==null?void 0:e.rgb)):void 0}hashKey(){return`${this.style??""}|${this.color??""}`}equals(t){return this.hashKey()===t.hashKey()}toXml(){if(!this.style)return"<border><left/><right/><top/><bottom/><diagonal/></border>";const t=this.color?`rgb="${this.color}"`:'auto="1"',e=s=>`<${s} style="${this.style}"><color ${t}/></${s}>`;return"<border>"+e("left")+e("right")+e("top")+e("bottom")+"<diagonal/></border>"}}const BUILTIN_NUMFMT={0:1,"0.00":2,"#,##0":3,"#,##0.00":4,"0%":9,"0.00%":10};class NumFmtEntry{constructor(t,e){this.code=t,this.id=e}static builtinId(t){return BUILTIN_NUMFMT[t]}hashKey(){return this.code}equals(t){return this.code===t.code}toXml(){return`<numFmt numFmtId="${this.id}" formatCode="${xmlEscape(this.code)}"/>`}}class AlignmentEntry{constructor(t){this.horizontal=t}static from(t){return t.align?new AlignmentEntry(t.align.horizontal):void 0}hashKey(){return this.horizontal}equals(t){return this.horizontal===t.horizontal}toXml(){return`<alignment horizontal="${this.horizontal}"/>`}}const STRIPE_RGB="F5F7FA",MAX_XFS=64e3;class EntryPool{constructor(){this.items=[],this.ids=new Map}add(t){const e=t.hashKey();let s=this.ids.get(e);return s===void 0&&(s=this.items.length,this.items.push(t),this.ids.set(e,s)),s}get size(){return this.items.length}toXml(t){return this.items.length===0?"":`<${t} count="${this.items.length}">${this.items.map(e=>e.toXml()).join("")}</${t}>`}}class StylesRegistry{constructor(){this.fonts=new EntryPool,this.fills=new EntryPool,this.borders=new EntryPool,this.numFmts=new EntryPool,this.xfs=[],this.xfIds=new Map,this.fonts.add(FontEntry.plain()),this.fills.add(FillEntry.none()),this.fills.add(FillEntry.gray125()),this.borders.add(BorderEntry.none()),this.xfs.push('<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>'),this.add({font:{bold:!0},fill:{rgb:"D9E2F3"}}),this.add({fill:{rgb:STRIPE_RGB}})}get size(){return this.xfs.length}add(t){const e=FontEntry.from(t),s=FillEntry.from(t),o=BorderEntry.from(t),i=AlignmentEntry.from(t),l=t.numFmt,r=[(e==null?void 0:e.hashKey())??"",(s==null?void 0:s.hashKey())??"",(o==null?void 0:o.hashKey())??"",(i==null?void 0:i.hashKey())??"",l??""].join("#"),a=this.xfIds.get(r);if(a!==void 0)return a;if(this.xfs.length>=MAX_XFS)return 0;const h=e?this.fonts.add(e):0,c=s?this.fills.add(s):0,d=o?this.borders.add(o):0,m=l?this.numFmtId(l):0,u=`numFmtId="${m}" fontId="${h}" fillId="${c}" borderId="${d}" xfId="0"`+(m?' applyNumberFormat="1"':"")+(h?' applyFont="1"':"")+(c?' applyFill="1"':"")+(d?' applyBorder="1"':"")+(i?' applyAlignment="1"':"");this.xfs.push(i?`<xf ${u}>${i.toXml()}</xf>`:`<xf ${u}/>`);const f=this.xfs.length-1;return this.xfIds.set(r,f),f}numFmtId(t){const e=NumFmtEntry.builtinId(t);if(e!==void 0)return e;const s=164+this.numFmts.size,o=new NumFmtEntry(t,s);return 164+this.numFmts.add(o)}toXml(){return XML_HEAD+`<styleSheet xmlns="${NS}">`+this.numFmts.toXml("numFmts")+this.fonts.toXml("fonts")+this.fills.toXml("fills")+this.borders.toXml("borders")+`<cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="${this.xfs.length}">${this.xfs.join("")}</cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles></styleSheet>`}}class RichTextRunEntry{constructor(t,e){this.text=t,this.font=e}static from(t){return t.text===""?void 0:new RichTextRunEntry(t.text,FontEntry.fromRun(t.style))}static fromAll(t){const e=[];for(const s of t){const o=RichTextRunEntry.from(s);o&&e.push(o)}return e}toXml(){var t;return`<r>${((t=this.font)==null?void 0:t.toRunPropsXml())??""}<t xml:space="preserve">${xmlEscape(this.text)}</t></r>`}}const S_DEFAULT=0,S_HEADER=1,S_STRIPE=2;class SheetXmlBuilder{constructor(t,e){this.init=t,this.styles=e,this.merges=[],this.writeHeader=t.header.length>0&&t.includeHeader!==!1,this.nextRow=this.writeHeader?2:1}head(){const{init:t}=this;let e=XML_HEAD+`<worksheet xmlns="${NS}">`;return t.colWidthsPx.length>0&&(e+="<cols>"+t.colWidthsPx.map((s,o)=>`<col min="${o+1}" max="${o+1}" width="${Math.max(1,Math.round(s/7*100)/100)}" customWidth="1"/>`).join("")+"</cols>"),e+="<sheetData>",this.writeHeader&&(e+='<row r="1">'+t.header.map((s,o)=>cellXml(`${colName(o)}1`,S_HEADER,void 0,s)).join("")+"</row>"),e}rows(t,e){let s="";for(const o of t){const i=this.nextRow%2===1?S_STRIPE:S_DEFAULT;s+=`<row r="${this.nextRow}">`;for(let l=0;l<o.length;l++){const r=o[l];s+=cellXml(`${colName(l)}${this.nextRow}`,this.styleIndex(r,i),r.num,r.value,r.runs)}s+="</row>",this.nextRow++}if(e)for(const o of e)this.merges.push(o);return s}tail(){let t="</sheetData>";return this.merges.length>0&&(t+=`<mergeCells count="${this.merges.length}">`+this.merges.map(e=>`<mergeCell ref="${colName(e.c)}${e.r+1}:${colName(e.c+e.cs-1)}${e.r+e.rs}"/>`).join("")+"</mergeCells>"),t+"</worksheet>"}styleIndex(t,e){if(t.s!==void 0)return t.s;let s=t.style;return!s&&t.fill&&(s=t.ink?{fill:{rgb:t.fill},font:{color:{rgb:t.ink}}}:{fill:{rgb:t.fill}}),s?(!s.fill&&e===S_STRIPE&&(s={...s,fill:{rgb:STRIPE_RGB}}),this.styles.add(s)):e}}function cellXml(n,t,e,s,o){const i=t===S_DEFAULT?"":` s="${t}"`;if(e!==void 0)return`<c r="${n}"${i} t="n"><v>${e}</v></c>`;if(o&&o.length>0){const l=RichTextRunEntry.fromAll(o);if(l.length>0)return`<c r="${n}"${i} t="inlineStr"><is>${l.map(r=>r.toXml()).join("")}</is></c>`}return s===""?`<c r="${n}"${i}/>`:`<c r="${n}"${i} t="inlineStr"><is><t xml:space="preserve">${xmlEscape(s)}</t></is></c>`}const ENC=new TextEncoder,ZIP_MTIME=new Date(2026,0,1,0,0,0),CONTENT_TYPES=XML_HEAD+'<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/></Types>',ROOT_RELS=XML_HEAD+'<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>',WB_RELS=XML_HEAD+'<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet1.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/></Relationships>';function workbookXml(n){const t=xmlEscape(n.replace(/[[\]:*?/\\]/g," ").slice(0,31)||"Sheet1");return XML_HEAD+`<workbook xmlns="${NS}" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><sheets><sheet name="${t}" sheetId="1" r:id="rId1"/></sheets></workbook>`}class XlsxWorkbookWriter{constructor(t={}){this.opts=t}async write(t,e){const s=await this.openStream({sheetName:t.sheetName,header:t.header,colWidthsPx:t.colWidthsPx},e);return await s.appendRows(t.rows,t.merges),s.finish()}async openStream(t,e){const s=this.opts.level,o=typeof s=="number"&&Number.isInteger(s)&&s>=0&&s<=9?s:6,i=(this.opts.createStyles??(()=>new StylesRegistry))(),l=new SheetXmlBuilder(t,i),r=new ZipOutput(e);for(const[h,c]of[["[Content_Types].xml",CONTENT_TYPES],["_rels/.rels",ROOT_RELS],["xl/workbook.xml",workbookXml(t.sheetName)],["xl/_rels/workbook.xml.rels",WB_RELS]])await r.putWhole(h,c,o);const a=r.open("xl/worksheets/sheet1.xml",o);return a.push(ENC.encode(l.head()),!1),await r.flush(),{appendRows:async(h,c)=>{const d=l.rows(h,c);d!==""&&a.push(ENC.encode(d),!1),await r.flush()},addStyle:h=>i.add(h),finish:async()=>(a.push(ENC.encode(l.tail()),!0),await r.putWhole("xl/styles.xml",i.toXml(),o),r.end()),abort:()=>r.discard()}}}class ZipOutput{constructor(t){this.sink=t,this.pending=[],this.total=0,this.zip=new fflate.Zip((e,s)=>{if(e){this.failure??(this.failure=e);return}s.length>0&&(this.pending.push(s),this.total+=s.length),this.total>4294967295&&(this.failure??(this.failure=new Error("xlsx too large (ZIP64 unsupported)")))})}open(t,e){const s=new fflate.ZipDeflate(t,{level:e});return s.mtime=ZIP_MTIME,this.zip.add(s),s}async putWhole(t,e,s){this.open(t,s).push(ENC.encode(e),!0),await this.flush()}async flush(){for(;this.pending.length>0;)await this.sink.write(this.pending.shift());if(this.failure)throw this.failure}async end(){return this.zip.end(),await this.flush(),this.total}discard(){this.pending.length=0}}exports.XlsxWorkbookWriter=XlsxWorkbookWriter,exports.xmlEscape=xmlEscape;
3
+ //# sourceMappingURL=XlsxWorkbookWriter-DixuNGtw.cjs.map
@@ -0,0 +1,3 @@
1
+ import{Z as N,a as P}from"./fflate-Cs3txMgg.js";function p(n){return n.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F￾￿]/g,"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function x(n){let t=n+1,e="";for(;t>0;){const s=(t-1)%26;e=String.fromCharCode(65+s)+e,t=Math.floor((t-1)/26)}return e}const u=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
+ `,v="http://schemas.openxmlformats.org/spreadsheetml/2006/main";function b(n){if(!n)return;const t=n.trim(),e=t.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);if(e)return"FF"+[e[1],e[2],e[3]].map(o=>Math.min(255,parseInt(o,10)).toString(16).padStart(2,"0")).join("").toUpperCase();const s=t.replace("#","").toUpperCase();if(/^[0-9A-F]+$/.test(s)){if(s.length===3)return"FF"+s[0]+s[0]+s[1]+s[1]+s[2]+s[2];if(s.length===6)return"FF"+s;if(s.length===8)return s}}class d{constructor(t,e,s,o=11){this.bold=t,this.italic=e,this.color=s,this.size=o}static plain(){return new d(!1,!1,void 0)}static from(t){var e,s,o,i;const l=b((s=(e=t.font)==null?void 0:e.color)==null?void 0:s.rgb),r=!!((o=t.font)!=null&&o.bold),a=!!((i=t.font)!=null&&i.italic);return l||r||a?new d(r,a,l):void 0}static fromRun(t){var e;if(!t)return;const s=b((e=t.color)==null?void 0:e.rgb),o=typeof t.size=="number"&&t.size>0&&Number.isFinite(t.size)?t.size:11;return s||t.bold||t.italic||o!==11?new d(!!t.bold,!!t.italic,s,o):void 0}hashKey(){return`${this.bold?"b":""}${this.italic?"i":""}|${this.color??""}|${this.size}`}equals(t){return this.hashKey()===t.hashKey()}toXml(){return"<font>"+(this.bold?"<b/>":"")+(this.italic?"<i/>":"")+`<sz val="${this.size}"/>`+(this.color?`<color rgb="${this.color}"/>`:"")+'<name val="Calibri"/></font>'}toRunPropsXml(){return'<rPr><rFont val="Calibri"/>'+(this.bold?"<b/>":"")+(this.italic?"<i/>":"")+(this.color?`<color rgb="${this.color}"/>`:"")+`<sz val="${this.size}"/></rPr>`}}class c{constructor(t,e){this.pattern=t,this.color=e}static none(){return new c("none",void 0)}static gray125(){return new c("gray125",void 0)}static solid(t){return new c("solid",t)}static from(t){var e;const s=b((e=t.fill)==null?void 0:e.rgb);return s?c.solid(s):void 0}hashKey(){return`${this.pattern}|${this.color??""}`}equals(t){return this.hashKey()===t.hashKey()}toXml(){return this.pattern!=="solid"?`<fill><patternFill patternType="${this.pattern}"/></fill>`:`<fill><patternFill patternType="solid"><fgColor rgb="${this.color}"/><bgColor indexed="64"/></patternFill></fill>`}}class g{constructor(t,e){this.style=t,this.color=e}static none(){return new g(void 0,void 0)}static from(t){var e;return t.border?new g(t.border.style,b((e=t.border.color)==null?void 0:e.rgb)):void 0}hashKey(){return`${this.style??""}|${this.color??""}`}equals(t){return this.hashKey()===t.hashKey()}toXml(){if(!this.style)return"<border><left/><right/><top/><bottom/><diagonal/></border>";const t=this.color?`rgb="${this.color}"`:'auto="1"',e=s=>`<${s} style="${this.style}"><color ${t}/></${s}>`;return"<border>"+e("left")+e("right")+e("top")+e("bottom")+"<diagonal/></border>"}}const K={0:1,"0.00":2,"#,##0":3,"#,##0.00":4,"0%":9,"0.00%":10};class S{constructor(t,e){this.code=t,this.id=e}static builtinId(t){return K[t]}hashKey(){return this.code}equals(t){return this.code===t.code}toXml(){return`<numFmt numFmtId="${this.id}" formatCode="${p(this.code)}"/>`}}class I{constructor(t){this.horizontal=t}static from(t){return t.align?new I(t.align.horizontal):void 0}hashKey(){return this.horizontal}equals(t){return this.horizontal===t.horizontal}toXml(){return`<alignment horizontal="${this.horizontal}"/>`}}const T="F5F7FA",D=64e3;class w{constructor(){this.items=[],this.ids=new Map}add(t){const e=t.hashKey();let s=this.ids.get(e);return s===void 0&&(s=this.items.length,this.items.push(t),this.ids.set(e,s)),s}get size(){return this.items.length}toXml(t){return this.items.length===0?"":`<${t} count="${this.items.length}">${this.items.map(e=>e.toXml()).join("")}</${t}>`}}class E{constructor(){this.fonts=new w,this.fills=new w,this.borders=new w,this.numFmts=new w,this.xfs=[],this.xfIds=new Map,this.fonts.add(d.plain()),this.fills.add(c.none()),this.fills.add(c.gray125()),this.borders.add(g.none()),this.xfs.push('<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>'),this.add({font:{bold:!0},fill:{rgb:"D9E2F3"}}),this.add({fill:{rgb:T}})}get size(){return this.xfs.length}add(t){const e=d.from(t),s=c.from(t),o=g.from(t),i=I.from(t),l=t.numFmt,r=[(e==null?void 0:e.hashKey())??"",(s==null?void 0:s.hashKey())??"",(o==null?void 0:o.hashKey())??"",(i==null?void 0:i.hashKey())??"",l??""].join("#"),a=this.xfIds.get(r);if(a!==void 0)return a;if(this.xfs.length>=D)return 0;const h=e?this.fonts.add(e):0,m=s?this.fills.add(s):0,f=o?this.borders.add(o):0,F=l?this.numFmtId(l):0,k=`numFmtId="${F}" fontId="${h}" fillId="${m}" borderId="${f}" xfId="0"`+(F?' applyNumberFormat="1"':"")+(h?' applyFont="1"':"")+(m?' applyFill="1"':"")+(f?' applyBorder="1"':"")+(i?' applyAlignment="1"':"");this.xfs.push(i?`<xf ${k}>${i.toXml()}</xf>`:`<xf ${k}/>`);const X=this.xfs.length-1;return this.xfIds.set(r,X),X}numFmtId(t){const e=S.builtinId(t);if(e!==void 0)return e;const s=164+this.numFmts.size,o=new S(t,s);return 164+this.numFmts.add(o)}toXml(){return u+`<styleSheet xmlns="${v}">`+this.numFmts.toXml("numFmts")+this.fonts.toXml("fonts")+this.fills.toXml("fills")+this.borders.toXml("borders")+`<cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="${this.xfs.length}">${this.xfs.join("")}</cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles></styleSheet>`}}class y{constructor(t,e){this.text=t,this.font=e}static from(t){return t.text===""?void 0:new y(t.text,d.fromRun(t.style))}static fromAll(t){const e=[];for(const s of t){const o=y.from(s);o&&e.push(o)}return e}toXml(){var t;return`<r>${((t=this.font)==null?void 0:t.toRunPropsXml())??""}<t xml:space="preserve">${p(this.text)}</t></r>`}}const z=0,M=1,R=2;class W{constructor(t,e){this.init=t,this.styles=e,this.merges=[],this.writeHeader=t.header.length>0&&t.includeHeader!==!1,this.nextRow=this.writeHeader?2:1}head(){const{init:t}=this;let e=u+`<worksheet xmlns="${v}">`;return t.colWidthsPx.length>0&&(e+="<cols>"+t.colWidthsPx.map((s,o)=>`<col min="${o+1}" max="${o+1}" width="${Math.max(1,Math.round(s/7*100)/100)}" customWidth="1"/>`).join("")+"</cols>"),e+="<sheetData>",this.writeHeader&&(e+='<row r="1">'+t.header.map((s,o)=>C(`${x(o)}1`,M,void 0,s)).join("")+"</row>"),e}rows(t,e){let s="";for(const o of t){const i=this.nextRow%2===1?R:z;s+=`<row r="${this.nextRow}">`;for(let l=0;l<o.length;l++){const r=o[l];s+=C(`${x(l)}${this.nextRow}`,this.styleIndex(r,i),r.num,r.value,r.runs)}s+="</row>",this.nextRow++}if(e)for(const o of e)this.merges.push(o);return s}tail(){let t="</sheetData>";return this.merges.length>0&&(t+=`<mergeCells count="${this.merges.length}">`+this.merges.map(e=>`<mergeCell ref="${x(e.c)}${e.r+1}:${x(e.c+e.cs-1)}${e.r+e.rs}"/>`).join("")+"</mergeCells>"),t+"</worksheet>"}styleIndex(t,e){if(t.s!==void 0)return t.s;let s=t.style;return!s&&t.fill&&(s=t.ink?{fill:{rgb:t.fill},font:{color:{rgb:t.ink}}}:{fill:{rgb:t.fill}}),s?(!s.fill&&e===R&&(s={...s,fill:{rgb:T}}),this.styles.add(s)):e}}function C(n,t,e,s,o){const i=t===z?"":` s="${t}"`;if(e!==void 0)return`<c r="${n}"${i} t="n"><v>${e}</v></c>`;if(o&&o.length>0){const l=y.fromAll(o);if(l.length>0)return`<c r="${n}"${i} t="inlineStr"><is>${l.map(r=>r.toXml()).join("")}</is></c>`}return s===""?`<c r="${n}"${i}/>`:`<c r="${n}"${i} t="inlineStr"><is><t xml:space="preserve">${p(s)}</t></is></c>`}const $=new TextEncoder,_=new Date(2026,0,1,0,0,0),A=u+'<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/></Types>',j=u+'<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>',O=u+'<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet1.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/></Relationships>';function q(n){const t=p(n.replace(/[[\]:*?/\\]/g," ").slice(0,31)||"Sheet1");return u+`<workbook xmlns="${v}" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><sheets><sheet name="${t}" sheetId="1" r:id="rId1"/></sheets></workbook>`}class H{constructor(t={}){this.opts=t}async write(t,e){const s=await this.openStream({sheetName:t.sheetName,header:t.header,colWidthsPx:t.colWidthsPx},e);return await s.appendRows(t.rows,t.merges),s.finish()}async openStream(t,e){const s=this.opts.level,o=typeof s=="number"&&Number.isInteger(s)&&s>=0&&s<=9?s:6,i=(this.opts.createStyles??(()=>new E))(),l=new W(t,i),r=new U(e);for(const[h,m]of[["[Content_Types].xml",A],["_rels/.rels",j],["xl/workbook.xml",q(t.sheetName)],["xl/_rels/workbook.xml.rels",O]])await r.putWhole(h,m,o);const a=r.open("xl/worksheets/sheet1.xml",o);return a.push($.encode(l.head()),!1),await r.flush(),{appendRows:async(h,m)=>{const f=l.rows(h,m);f!==""&&a.push($.encode(f),!1),await r.flush()},addStyle:h=>i.add(h),finish:async()=>(a.push($.encode(l.tail()),!0),await r.putWhole("xl/styles.xml",i.toXml(),o),r.end()),abort:()=>r.discard()}}}class U{constructor(t){this.sink=t,this.pending=[],this.total=0,this.zip=new N((e,s)=>{if(e){this.failure??(this.failure=e);return}s.length>0&&(this.pending.push(s),this.total+=s.length),this.total>4294967295&&(this.failure??(this.failure=new Error("xlsx too large (ZIP64 unsupported)")))})}open(t,e){const s=new P(t,{level:e});return s.mtime=_,this.zip.add(s),s}async putWhole(t,e,s){this.open(t,s).push($.encode(e),!0),await this.flush()}async flush(){for(;this.pending.length>0;)await this.sink.write(this.pending.shift());if(this.failure)throw this.failure}async end(){return this.zip.end(),await this.flush(),this.total}discard(){this.pending.length=0}}export{H as XlsxWorkbookWriter,p as xmlEscape};
3
+ //# sourceMappingURL=XlsxWorkbookWriter-VgbibI0Z.js.map
@@ -0,0 +1,2 @@
1
+ var x=Uint8Array,C=Uint16Array,sr=Int32Array,vr=new x([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),fr=new x([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Mr=new x([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),pr=function(a,r){for(var t=new C(31),n=0;n<31;++n)t[n]=r+=1<<a[n-1];for(var i=new sr(t[30]),n=1;n<30;++n)for(var e=t[n];e<t[n+1];++e)i[e]=e-t[n]<<5|n;return{b:t,r:i}},Tr=pr(vr,2),Ir=Tr.b,hr=Tr.r;Ir[28]=258,hr[258]=28;for(var Pr=pr(fr,0),xr=Pr.r,or=new C(32768),g=0;g<32768;++g){var R=(g&43690)>>1|(g&21845)<<1;R=(R&52428)>>2|(R&13107)<<2,R=(R&61680)>>4|(R&3855)<<4,or[g]=((R&65280)>>8|(R&255)<<8)>>1}for(var k=function(a,r,t){for(var n=a.length,i=0,e=new C(r);i<n;++i)a[i]&&++e[a[i]-1];var s=new C(r);for(i=1;i<r;++i)s[i]=s[i-1]+e[i-1]<<1;var h;if(t){h=new C(1<<r);var f=15-r;for(i=0;i<n;++i)if(a[i])for(var l=i<<4|a[i],v=r-a[i],y=s[a[i]-1]++<<v,c=y|(1<<v)-1;y<=c;++y)h[or[y]>>f]=l}else for(h=new C(n),i=0;i<n;++i)a[i]&&(h[i]=or[s[a[i]-1]++]>>15-a[i]);return h},V=new x(288),g=0;g<144;++g)V[g]=8;for(var g=144;g<256;++g)V[g]=9;for(var g=256;g<280;++g)V[g]=7;for(var g=280;g<288;++g)V[g]=8;for(var _=new x(32),g=0;g<32;++g)_[g]=5;var qr=k(V,9,0),Hr=k(_,5,0),Dr=function(a){return(a+7)/8|0},Zr=function(a,r,t){return(t==null||t>a.length)&&(t=a.length),new x(a.subarray(r,t))},Lr=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],P=function(a,r,t){var n=new Error(r||Lr[a]);if(n.code=a,Error.captureStackTrace&&Error.captureStackTrace(n,P),!t)throw n;return n},N=function(a,r,t){t<<=r&7;var n=r/8|0;a[n]|=t,a[n+1]|=t>>8},b=function(a,r,t){t<<=r&7;var n=r/8|0;a[n]|=t,a[n+1]|=t>>8,a[n+2]|=t>>16},lr=function(a,r){for(var t=[],n=0;n<a.length;++n)a[n]&&t.push({s:n,f:a[n]});var i=t.length,e=t.slice();if(!i)return{t:rr,l:0};if(i==1){var s=new x(t[0].s+1);return s[t[0].s]=1,{t:s,l:1}}t.sort(function(I,H){return I.f-H.f}),t.push({s:-1,f:25001});var h=t[0],f=t[1],l=0,v=1,y=2;for(t[0]={s:-1,f:h.f+f.f,l:h,r:f};v!=i-1;)h=t[t[l].f<t[y].f?l++:y++],f=t[l!=v&&t[l].f<t[y].f?l++:y++],t[v++]={s:-1,f:h.f+f.f,l:h,r:f};for(var c=e[0].s,n=1;n<i;++n)e[n].s>c&&(c=e[n].s);var z=new C(c+1),M=ur(t[v-1],z,0);if(M>r){var n=0,w=0,p=M-r,E=1<<p;for(e.sort(function(H,A){return z[A.s]-z[H.s]||H.f-A.f});n<i;++n){var m=e[n].s;if(z[m]>r)w+=E-(1<<M-z[m]),z[m]=r;else break}for(w>>=p;w>0;){var S=e[n].s;z[S]<r?w-=1<<r-z[S]++-1:++n}for(;n>=0&&w;--n){var q=e[n].s;z[q]==r&&(--z[q],++w)}M=r}return{t:new x(z),l:M}},ur=function(a,r,t){return a.s==-1?Math.max(ur(a.l,r,t+1),ur(a.r,r,t+1)):r[a.s]=t},Er=function(a){for(var r=a.length;r&&!a[--r];);for(var t=new C(++r),n=0,i=a[0],e=1,s=function(f){t[n++]=f},h=1;h<=r;++h)if(a[h]==i&&h!=r)++e;else{if(!i&&e>2){for(;e>138;e-=138)s(32754);e>2&&(s(e>10?e-11<<5|28690:e-3<<5|12305),e=0)}else if(e>3){for(s(i),--e;e>6;e-=6)s(8304);e>2&&(s(e-3<<5|8208),e=0)}for(;e--;)s(i);e=1,i=a[h]}return{c:t.subarray(0,n),n:r}},d=function(a,r){for(var t=0,n=0;n<r.length;++n)t+=a[n]*r[n];return t},cr=function(a,r,t){var n=t.length,i=Dr(r+2);a[i]=n&255,a[i+1]=n>>8,a[i+2]=a[i]^255,a[i+3]=a[i+1]^255;for(var e=0;e<n;++e)a[i+e+4]=t[e];return(i+4+n)*8},mr=function(a,r,t,n,i,e,s,h,f,l,v){N(r,v++,t),++i[256];for(var y=lr(i,15),c=y.t,z=y.l,M=lr(e,15),w=M.t,p=M.l,E=Er(c),m=E.c,S=E.n,q=Er(w),I=q.c,H=q.n,A=new C(19),u=0;u<m.length;++u)++A[m[u]&31];for(var u=0;u<I.length;++u)++A[I[u]&31];for(var o=lr(A,7),U=o.t,W=o.l,F=19;F>4&&!U[Mr[F-1]];--F);var X=l+5<<3,L=d(i,V)+d(e,_)+s,O=d(i,c)+d(e,w)+s+14+3*F+d(A,U)+2*A[16]+3*A[17]+7*A[18];if(f>=0&&X<=L&&X<=O)return cr(r,v,a.subarray(f,f+l));var G,D,Y,Q;if(N(r,v,1+(O<L)),v+=2,O<L){G=k(c,z,0),D=c,Y=k(w,p,0),Q=w;var tr=k(U,W,0);N(r,v,S-257),N(r,v+5,H-1),N(r,v+10,F-4),v+=14;for(var u=0;u<F;++u)N(r,v+3*u,U[Mr[u]]);v+=3*F;for(var J=[m,I],j=0;j<2;++j)for(var $=J[j],u=0;u<$.length;++u){var K=$[u]&31;N(r,v,tr[K]),v+=U[K],K>15&&(N(r,v,$[u]>>5&127),v+=$[u]>>12)}}else G=qr,D=V,Y=Hr,Q=_;for(var u=0;u<h;++u){var Z=n[u];if(Z>255){var K=Z>>18&31;b(r,v,G[K+257]),v+=D[K+257],K>7&&(N(r,v,Z>>23&31),v+=vr[K]);var B=Z&31;b(r,v,Y[B]),v+=Q[B],B>3&&(b(r,v,Z>>5&8191),v+=fr[B])}else b(r,v,G[Z]),v+=D[Z]}return b(r,v,G[256]),v+D[256]},Or=new sr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),rr=new x(0),Yr=function(a,r,t,n,i,e){var s=e.z||a.length,h=new x(n+s+5*(1+Math.ceil(s/7e3))+i),f=h.subarray(n,h.length-i),l=e.l,v=(e.r||0)&7;if(r){v&&(f[0]=e.r>>3);for(var y=Or[r-1],c=y>>13,z=y&8191,M=(1<<t)-1,w=e.p||new C(32768),p=e.h||new C(M+1),E=Math.ceil(t/3),m=2*E,S=function(ir){return(a[ir]^a[ir+1]<<E^a[ir+2]<<m)&M},q=new sr(25e3),I=new C(288),H=new C(32),A=0,u=0,o=e.i||0,U=0,W=e.w||0,F=0;o+2<s;++o){var X=S(o),L=o&32767,O=p[X];if(w[L]=O,p[X]=L,W<=o){var G=s-o;if((A>7e3||U>24576)&&(G>423||!l)){v=mr(a,f,0,q,I,H,u,U,F,o-F,v),U=A=u=0,F=o;for(var D=0;D<286;++D)I[D]=0;for(var D=0;D<30;++D)H[D]=0}var Y=2,Q=0,tr=z,J=L-O&32767;if(G>2&&X==S(o-J))for(var j=Math.min(c,G)-1,$=Math.min(32767,o),K=Math.min(258,G);J<=$&&--tr&&L!=O;){if(a[o+Y]==a[o+Y-J]){for(var Z=0;Z<K&&a[o+Z]==a[o+Z-J];++Z);if(Z>Y){if(Y=Z,Q=J,Z>j)break;for(var B=Math.min(J,Z-2),gr=0,D=0;D<B;++D){var nr=o-J+D&32767,Cr=w[nr],wr=nr-Cr&32767;wr>gr&&(gr=wr,O=nr)}}}L=O,O=w[L],J+=L-O&32767}if(Q){q[U++]=268435456|hr[Y]<<18|xr[Q];var yr=hr[Y]&31,zr=xr[Q]&31;u+=vr[yr]+fr[zr],++I[257+yr],++H[zr],W=o+Y,++A}else q[U++]=a[o],++I[a[o]]}}for(o=Math.max(o,W);o<s;++o)q[U++]=a[o],++I[a[o]];v=mr(a,f,l,q,I,H,u,U,F,o-F,v),l||(e.r=v&7|f[v/8|0]<<3,v-=7,e.h=p,e.p=w,e.i=o,e.w=W)}else{for(var o=e.w||0;o<s+l;o+=65535){var er=o+65535;er>=s&&(f[v/8|0]=l,er=s),v=cr(f,v+1,a.subarray(o,er))}e.i=s}return Zr(h,0,n+Dr(v)+i)},Gr=function(){for(var a=new Int32Array(256),r=0;r<256;++r){for(var t=r,n=9;--n;)t=(t&1&&-306674912)^t>>>1;a[r]=t}return a}(),Jr=function(){var a=-1;return{p:function(r){for(var t=a,n=0;n<r.length;++n)t=Gr[t&255^r[n]]^t>>>8;a=t},d:function(){return~a}}},Kr=function(a,r,t,n,i){if(!i&&(i={l:1},r.dictionary)){var e=r.dictionary.subarray(-32768),s=new x(e.length+a.length);s.set(e),s.set(a,e.length),a=s,i.w=e.length}return Yr(a,r.level==null?6:r.level,r.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(a.length)))*1.5):20:12+r.mem,t,n,i)},Nr=function(a,r){var t={};for(var n in a)t[n]=a[n];for(var n in r)t[n]=r[n];return t},T=function(a,r,t){for(;t;++r)a[r]=t,t>>>=8},Qr=function(){function a(r,t){if(typeof r=="function"&&(t=r,r={}),this.ondata=t,this.o=r||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new x(98304),this.o.dictionary){var n=this.o.dictionary.subarray(-32768);this.b.set(n,32768-n.length),this.s.i=32768-n.length}}return a.prototype.p=function(r,t){this.ondata(Kr(r,this.o,0,0,this.s),t)},a.prototype.push=function(r,t){this.ondata||P(5),this.s.l&&P(4);var n=r.length+this.s.z;if(n>this.b.length){if(n>2*this.b.length-32768){var i=new x(n&-32768);i.set(this.b.subarray(0,this.s.z)),this.b=i}var e=this.b.length-this.s.z;this.b.set(r.subarray(0,e),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(r.subarray(e),32768),this.s.z=r.length-e+32768,this.s.i=32766,this.s.w=32768}else this.b.set(r,this.s.z),this.s.z+=r.length;this.s.l=t&1,(this.s.z>this.s.w+8191||t)&&(this.p(this.b,t||!1),this.s.w=this.s.i,this.s.i-=2),t&&(this.s=this.o={},this.b=rr)},a.prototype.flush=function(r){if(this.ondata||P(5),this.s.l&&P(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2,r){var t=new x(6);t[0]=this.s.r>>3;var n=cr(t,this.s.r,rr);this.s.r=0,this.ondata(t.subarray(0,n>>3),!1)}},a}(),Ar=typeof TextEncoder<"u"&&new TextEncoder,Rr=typeof TextDecoder<"u"&&new TextDecoder,Vr=0;try{Rr.decode(rr,{stream:!0}),Vr=1}catch{}function Sr(a,r){var t;if(Ar)return Ar.encode(a);for(var n=a.length,i=new x(a.length+(a.length>>1)),e=0,s=function(l){i[e++]=l},t=0;t<n;++t){if(e+5>i.length){var h=new x(e+8+(n-t<<1));h.set(i),i=h}var f=a.charCodeAt(t);f<128||r?s(f):f<2048?(s(192|f>>6),s(128|f&63)):f>55295&&f<57344?(f=65536+(f&1047552)|a.charCodeAt(++t)&1023,s(240|f>>18),s(128|f>>12&63),s(128|f>>6&63),s(128|f&63)):(s(224|f>>12),s(128|f>>6&63),s(128|f&63))}return Zr(i,0,e)}var Wr=function(a){return a==1?3:a<6?2:a==9?1:0},ar=function(a){var r=0;if(a)for(var t in a){var n=a[t].length;n>65535&&P(9),r+=n+4}return r},Ur=function(a,r,t,n,i,e,s,h){var f=n.length,l=t.extra,v=h&&h.length,y=ar(l);T(a,r,s!=null?33639248:67324752),r+=4,s!=null&&(a[r++]=20,a[r++]=t.os),a[r]=20,r+=2,a[r++]=t.flag<<1|(e<0&&8),a[r++]=i&&8,a[r++]=t.compression&255,a[r++]=t.compression>>8;var c=new Date(t.mtime==null?Date.now():t.mtime),z=c.getFullYear()-1980;if((z<0||z>119)&&P(10),T(a,r,z<<25|c.getMonth()+1<<21|c.getDate()<<16|c.getHours()<<11|c.getMinutes()<<5|c.getSeconds()>>1),r+=4,e!=-1&&(T(a,r,t.crc),T(a,r+4,e<0?-e-2:e),T(a,r+8,t.size)),T(a,r+12,f),T(a,r+14,y),r+=16,s!=null&&(T(a,r,v),T(a,r+6,t.attrs),T(a,r+10,s),r+=14),a.set(n,r),r+=f,y)for(var M in l){var w=l[M],p=w.length;T(a,r,+M),T(a,r+2,p),a.set(w,r+4),r+=4+p}return v&&(a.set(h,r),r+=v),r},Xr=function(a,r,t,n,i){T(a,r,101010256),T(a,r+8,t),T(a,r+10,t),T(a,r+12,n),T(a,r+16,i)},Fr=function(){function a(r){this.filename=r,this.c=Jr(),this.size=0,this.compression=0}return a.prototype.process=function(r,t){this.ondata(null,r,t)},a.prototype.push=function(r,t){this.ondata||P(5),this.c.p(r),this.size+=r.length,t&&(this.crc=this.c.d()),this.process(r,t||!1)},a}(),$r=function(){function a(r,t){var n=this;t||(t={}),Fr.call(this,r),this.d=new Qr(t,function(i,e){n.ondata(null,i,e)}),this.compression=8,this.flag=Wr(t.level)}return a.prototype.process=function(r,t){try{this.d.push(r,t)}catch(n){this.ondata(n,null,t)}},a.prototype.push=function(r,t){Fr.prototype.push.call(this,r,t)},a}(),Br=function(){function a(r){this.ondata=r,this.u=[],this.d=1}return a.prototype.add=function(r){var t=this;if(this.ondata||P(5),this.d&2)this.ondata(P(4+(this.d&1)*8,0,1),null,!1);else{var n=Sr(r.filename),i=n.length,e=r.comment,s=e&&Sr(e),h=i!=r.filename.length||s&&e.length!=s.length,f=i+ar(r.extra)+30;i>65535&&this.ondata(P(11,0,1),null,!1);var l=new x(f);Ur(l,0,r,n,h,-1);var v=[l],y=function(){for(var p=0,E=v;p<E.length;p++){var m=E[p];t.ondata(null,m,!1)}v=[]},c=this.d;this.d=0;var z=this.u.length,M=Nr(r,{f:n,u:h,o:s,t:function(){r.terminate&&r.terminate()},r:function(){if(y(),c){var p=t.u[z+1];p?p.r():t.d=1}c=1}}),w=0;r.ondata=function(p,E,m){if(p)t.ondata(p,E,m),t.terminate();else if(w+=E.length,v.push(E),m){var S=new x(16);T(S,0,134695760),T(S,4,r.crc),T(S,8,w),T(S,12,r.size),v.push(S),M.c=w,M.b=f+w+16,M.crc=r.crc,M.size=r.size,c&&M.r(),c=1}else c&&y()},this.u.push(M)}},a.prototype.end=function(){var r=this;if(this.d&2){this.ondata(P(4+(this.d&1)*8,0,1),null,!0);return}this.d?this.e():this.u.push({r:function(){r.d&1&&(r.u.splice(-1,1),r.e())},t:function(){}}),this.d=3},a.prototype.e=function(){for(var r=0,t=0,n=0,i=0,e=this.u;i<e.length;i++){var s=e[i];n+=46+s.f.length+ar(s.extra)+(s.o?s.o.length:0)}for(var h=new x(n+22),f=0,l=this.u;f<l.length;f++){var s=l[f];Ur(h,r,s,s.f,s.u,-s.c-2,t,s.o),r+=46+s.f.length+ar(s.extra)+(s.o?s.o.length:0),t+=s.b}Xr(h,r,this.u.length,n,t),this.ondata(null,h,!0),this.d=2},a.prototype.terminate=function(){for(var r=0,t=this.u;r<t.length;r++){var n=t[r];n.t()}this.d=2},a}();export{Br as Z,$r as a};
2
+ //# sourceMappingURL=fflate-Cs3txMgg.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";var u8=Uint8Array,u16=Uint16Array,i32=Int32Array,fleb=new u8([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),fdeb=new u8([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),clim=new u8([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),freb=function(t,r){for(var a=new u16(31),e=0;e<31;++e)a[e]=r+=1<<t[e-1];for(var s=new i32(a[30]),e=1;e<30;++e)for(var n=a[e];n<a[e+1];++n)s[n]=n-a[e]<<5|e;return{b:a,r:s}},_a=freb(fleb,2),fl=_a.b,revfl=_a.r;fl[28]=258,revfl[258]=28;for(var _b=freb(fdeb,0),revfd=_b.r,rev=new u16(32768),i=0;i<32768;++i){var x=(i&43690)>>1|(i&21845)<<1;x=(x&52428)>>2|(x&13107)<<2,x=(x&61680)>>4|(x&3855)<<4,rev[i]=((x&65280)>>8|(x&255)<<8)>>1}for(var hMap=function(t,r,a){for(var e=t.length,s=0,n=new u16(r);s<e;++s)t[s]&&++n[t[s]-1];var v=new u16(r);for(s=1;s<r;++s)v[s]=v[s-1]+n[s-1]<<1;var o;if(a){o=new u16(1<<r);var h=15-r;for(s=0;s<e;++s)if(t[s])for(var u=s<<4|t[s],f=r-t[s],y=v[t[s]-1]++<<f,g=y|(1<<f)-1;y<=g;++y)o[rev[y]>>h]=u}else for(o=new u16(e),s=0;s<e;++s)t[s]&&(o[s]=rev[v[t[s]-1]++]>>15-t[s]);return o},flt=new u8(288),i=0;i<144;++i)flt[i]=8;for(var i=144;i<256;++i)flt[i]=9;for(var i=256;i<280;++i)flt[i]=7;for(var i=280;i<288;++i)flt[i]=8;for(var fdt=new u8(32),i=0;i<32;++i)fdt[i]=5;var flm=hMap(flt,9,0),fdm=hMap(fdt,5,0),shft=function(t){return(t+7)/8|0},slc=function(t,r,a){return(a==null||a>t.length)&&(a=t.length),new u8(t.subarray(r,a))},ec=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],err=function(t,r,a){var e=new Error(r||ec[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,err),!a)throw e;return e},wbits=function(t,r,a){a<<=r&7;var e=r/8|0;t[e]|=a,t[e+1]|=a>>8},wbits16=function(t,r,a){a<<=r&7;var e=r/8|0;t[e]|=a,t[e+1]|=a>>8,t[e+2]|=a>>16},hTree=function(t,r){for(var a=[],e=0;e<t.length;++e)t[e]&&a.push({s:e,f:t[e]});var s=a.length,n=a.slice();if(!s)return{t:et,l:0};if(s==1){var v=new u8(a[0].s+1);return v[a[0].s]=1,{t:v,l:1}}a.sort(function(F,I){return F.f-I.f}),a.push({s:-1,f:25001});var o=a[0],h=a[1],u=0,f=1,y=2;for(a[0]={s:-1,f:o.f+h.f,l:o,r:h};f!=s-1;)o=a[a[u].f<a[y].f?u++:y++],h=a[u!=f&&a[u].f<a[y].f?u++:y++],a[f++]={s:-1,f:o.f+h.f,l:o,r:h};for(var g=n[0].s,e=1;e<s;++e)n[e].s>g&&(g=n[e].s);var z=new u16(g+1),p=ln(a[f-1],z,0);if(p>r){var e=0,w=0,M=p-r,Z=1<<M;for(n.sort(function(I,m){return z[m.s]-z[I.s]||I.f-m.f});e<s;++e){var E=n[e].s;if(z[E]>r)w+=Z-(1<<p-z[E]),z[E]=r;else break}for(w>>=M;w>0;){var A=n[e].s;z[A]<r?w-=1<<r-z[A]++-1:++e}for(;e>=0&&w;--e){var C=n[e].s;z[C]==r&&(--z[C],++w)}p=r}return{t:new u8(z),l:p}},ln=function(t,r,a){return t.s==-1?Math.max(ln(t.l,r,a+1),ln(t.r,r,a+1)):r[t.s]=a},lc=function(t){for(var r=t.length;r&&!t[--r];);for(var a=new u16(++r),e=0,s=t[0],n=1,v=function(h){a[e++]=h},o=1;o<=r;++o)if(t[o]==s&&o!=r)++n;else{if(!s&&n>2){for(;n>138;n-=138)v(32754);n>2&&(v(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(v(s),--n;n>6;n-=6)v(8304);n>2&&(v(n-3<<5|8208),n=0)}for(;n--;)v(s);n=1,s=t[o]}return{c:a.subarray(0,e),n:r}},clen=function(t,r){for(var a=0,e=0;e<r.length;++e)a+=t[e]*r[e];return a},wfblk=function(t,r,a){var e=a.length,s=shft(r+2);t[s]=e&255,t[s+1]=e>>8,t[s+2]=t[s]^255,t[s+3]=t[s+1]^255;for(var n=0;n<e;++n)t[s+n+4]=a[n];return(s+4+e)*8},wblk=function(t,r,a,e,s,n,v,o,h,u,f){wbits(r,f++,a),++s[256];for(var y=hTree(s,15),g=y.t,z=y.l,p=hTree(n,15),w=p.t,M=p.l,Z=lc(g),E=Z.c,A=Z.n,C=lc(w),F=C.c,I=C.n,m=new u16(19),c=0;c<E.length;++c)++m[E[c]&31];for(var c=0;c<F.length;++c)++m[F[c]&31];for(var l=hTree(m,7),S=l.t,J=l.l,U=19;U>4&&!S[clim[U-1]];--U);var K=u+5<<3,P=clen(s,flt)+clen(n,fdt)+v,q=clen(s,g)+clen(n,w)+v+14+3*U+clen(m,S)+2*m[16]+3*m[17]+7*m[18];if(h>=0&&K<=P&&K<=q)return wfblk(r,f,t.subarray(h,h+u));var L,T,H,G;if(wbits(r,f,1+(q<P)),f+=2,q<P){L=hMap(g,z,0),T=g,H=hMap(w,M,0),G=w;var V=hMap(S,J,0);wbits(r,f,A-257),wbits(r,f+5,I-1),wbits(r,f+10,U-4),f+=14;for(var c=0;c<U;++c)wbits(r,f+3*c,S[clim[c]]);f+=3*U;for(var O=[E,F],R=0;R<2;++R)for(var N=O[R],c=0;c<N.length;++c){var Y=N[c]&31;wbits(r,f,V[Y]),f+=S[Y],Y>15&&(wbits(r,f,N[c]>>5&127),f+=N[c]>>12)}}else L=flm,T=flt,H=fdm,G=fdt;for(var c=0;c<o;++c){var D=e[c];if(D>255){var Y=D>>18&31;wbits16(r,f,L[Y+257]),f+=T[Y+257],Y>7&&(wbits(r,f,D>>23&31),f+=fleb[Y]);var Q=D&31;wbits16(r,f,H[Q]),f+=G[Q],Q>3&&(wbits16(r,f,D>>5&8191),f+=fdeb[Q])}else wbits16(r,f,L[D]),f+=T[D]}return wbits16(r,f,L[256]),f+T[256]},deo=new i32([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),et=new u8(0),dflt=function(t,r,a,e,s,n){var v=n.z||t.length,o=new u8(e+v+5*(1+Math.ceil(v/7e3))+s),h=o.subarray(e,o.length-s),u=n.l,f=(n.r||0)&7;if(r){f&&(h[0]=n.r>>3);for(var y=deo[r-1],g=y>>13,z=y&8191,p=(1<<a)-1,w=n.p||new u16(32768),M=n.h||new u16(p+1),Z=Math.ceil(a/3),E=2*Z,A=function($){return(t[$]^t[$+1]<<Z^t[$+2]<<E)&p},C=new i32(25e3),F=new u16(288),I=new u16(32),m=0,c=0,l=n.i||0,S=0,J=n.w||0,U=0;l+2<v;++l){var K=A(l),P=l&32767,q=M[K];if(w[P]=q,M[K]=P,J<=l){var L=v-l;if((m>7e3||S>24576)&&(L>423||!u)){f=wblk(t,h,0,C,F,I,c,S,U,l-U,f),S=m=c=0,U=l;for(var T=0;T<286;++T)F[T]=0;for(var T=0;T<30;++T)I[T]=0}var H=2,G=0,V=z,O=P-q&32767;if(L>2&&K==A(l-O))for(var R=Math.min(g,L)-1,N=Math.min(32767,l),Y=Math.min(258,L);O<=N&&--V&&P!=q;){if(t[l+H]==t[l+H-O]){for(var D=0;D<Y&&t[l+D]==t[l+D-O];++D);if(D>H){if(H=D,G=O,D>R)break;for(var Q=Math.min(O,D-2),B=0,T=0;T<Q;++T){var W=l-O+T&32767,d=w[W],j=W-d&32767;j>B&&(B=j,q=W)}}}P=q,q=w[P],O+=P-q&32767}if(G){C[S++]=268435456|revfl[H]<<18|revfd[G];var k=revfl[H]&31,b=revfd[G]&31;c+=fleb[k]+fdeb[b],++F[257+k],++I[b],J=l+H,++m}else C[S++]=t[l],++F[t[l]]}}for(l=Math.max(l,J);l<v;++l)C[S++]=t[l],++F[t[l]];f=wblk(t,h,u,C,F,I,c,S,U,l-U,f),u||(n.r=f&7|h[f/8|0]<<3,f-=7,n.h=M,n.p=w,n.i=l,n.w=J)}else{for(var l=n.w||0;l<v+u;l+=65535){var X=l+65535;X>=v&&(h[f/8|0]=u,X=v),f=wfblk(h,f+1,t.subarray(l,X))}n.i=v}return slc(o,0,e+shft(f)+s)},crct=function(){for(var t=new Int32Array(256),r=0;r<256;++r){for(var a=r,e=9;--e;)a=(a&1&&-306674912)^a>>>1;t[r]=a}return t}(),crc=function(){var t=-1;return{p:function(r){for(var a=t,e=0;e<r.length;++e)a=crct[a&255^r[e]]^a>>>8;t=a},d:function(){return~t}}},dopt=function(t,r,a,e,s){if(!s&&(s={l:1},r.dictionary)){var n=r.dictionary.subarray(-32768),v=new u8(n.length+t.length);v.set(n),v.set(t,n.length),t=v,s.w=n.length}return dflt(t,r.level==null?6:r.level,r.mem==null?s.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+r.mem,a,e,s)},mrg=function(t,r){var a={};for(var e in t)a[e]=t[e];for(var e in r)a[e]=r[e];return a},wbytes=function(t,r,a){for(;a;++r)t[r]=a,a>>>=8},Deflate=function(){function t(r,a){if(typeof r=="function"&&(a=r,r={}),this.ondata=a,this.o=r||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new u8(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return t.prototype.p=function(r,a){this.ondata(dopt(r,this.o,0,0,this.s),a)},t.prototype.push=function(r,a){this.ondata||err(5),this.s.l&&err(4);var e=r.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var s=new u8(e&-32768);s.set(this.b.subarray(0,this.s.z)),this.b=s}var n=this.b.length-this.s.z;this.b.set(r.subarray(0,n),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(r.subarray(n),32768),this.s.z=r.length-n+32768,this.s.i=32766,this.s.w=32768}else this.b.set(r,this.s.z),this.s.z+=r.length;this.s.l=a&1,(this.s.z>this.s.w+8191||a)&&(this.p(this.b,a||!1),this.s.w=this.s.i,this.s.i-=2),a&&(this.s=this.o={},this.b=et)},t.prototype.flush=function(r){if(this.ondata||err(5),this.s.l&&err(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2,r){var a=new u8(6);a[0]=this.s.r>>3;var e=wfblk(a,this.s.r,et);this.s.r=0,this.ondata(a.subarray(0,e>>3),!1)}},t}(),te=typeof TextEncoder<"u"&&new TextEncoder,td=typeof TextDecoder<"u"&&new TextDecoder,tds=0;try{td.decode(et,{stream:!0}),tds=1}catch{}function strToU8(t,r){var a;if(te)return te.encode(t);for(var e=t.length,s=new u8(t.length+(t.length>>1)),n=0,v=function(u){s[n++]=u},a=0;a<e;++a){if(n+5>s.length){var o=new u8(n+8+(e-a<<1));o.set(s),s=o}var h=t.charCodeAt(a);h<128||r?v(h):h<2048?(v(192|h>>6),v(128|h&63)):h>55295&&h<57344?(h=65536+(h&1047552)|t.charCodeAt(++a)&1023,v(240|h>>18),v(128|h>>12&63),v(128|h>>6&63),v(128|h&63)):(v(224|h>>12),v(128|h>>6&63),v(128|h&63))}return slc(s,0,n)}var dbf=function(t){return t==1?3:t<6?2:t==9?1:0},exfl=function(t){var r=0;if(t)for(var a in t){var e=t[a].length;e>65535&&err(9),r+=e+4}return r},wzh=function(t,r,a,e,s,n,v,o){var h=e.length,u=a.extra,f=o&&o.length,y=exfl(u);wbytes(t,r,v!=null?33639248:67324752),r+=4,v!=null&&(t[r++]=20,t[r++]=a.os),t[r]=20,r+=2,t[r++]=a.flag<<1|(n<0&&8),t[r++]=s&&8,t[r++]=a.compression&255,t[r++]=a.compression>>8;var g=new Date(a.mtime==null?Date.now():a.mtime),z=g.getFullYear()-1980;if((z<0||z>119)&&err(10),wbytes(t,r,z<<25|g.getMonth()+1<<21|g.getDate()<<16|g.getHours()<<11|g.getMinutes()<<5|g.getSeconds()>>1),r+=4,n!=-1&&(wbytes(t,r,a.crc),wbytes(t,r+4,n<0?-n-2:n),wbytes(t,r+8,a.size)),wbytes(t,r+12,h),wbytes(t,r+14,y),r+=16,v!=null&&(wbytes(t,r,f),wbytes(t,r+6,a.attrs),wbytes(t,r+10,v),r+=14),t.set(e,r),r+=h,y)for(var p in u){var w=u[p],M=w.length;wbytes(t,r,+p),wbytes(t,r+2,M),t.set(w,r+4),r+=4+M}return f&&(t.set(o,r),r+=f),r},wzf=function(t,r,a,e,s){wbytes(t,r,101010256),wbytes(t,r+8,a),wbytes(t,r+10,a),wbytes(t,r+12,e),wbytes(t,r+16,s)},ZipPassThrough=function(){function t(r){this.filename=r,this.c=crc(),this.size=0,this.compression=0}return t.prototype.process=function(r,a){this.ondata(null,r,a)},t.prototype.push=function(r,a){this.ondata||err(5),this.c.p(r),this.size+=r.length,a&&(this.crc=this.c.d()),this.process(r,a||!1)},t}(),ZipDeflate=function(){function t(r,a){var e=this;a||(a={}),ZipPassThrough.call(this,r),this.d=new Deflate(a,function(s,n){e.ondata(null,s,n)}),this.compression=8,this.flag=dbf(a.level)}return t.prototype.process=function(r,a){try{this.d.push(r,a)}catch(e){this.ondata(e,null,a)}},t.prototype.push=function(r,a){ZipPassThrough.prototype.push.call(this,r,a)},t}(),Zip=function(){function t(r){this.ondata=r,this.u=[],this.d=1}return t.prototype.add=function(r){var a=this;if(this.ondata||err(5),this.d&2)this.ondata(err(4+(this.d&1)*8,0,1),null,!1);else{var e=strToU8(r.filename),s=e.length,n=r.comment,v=n&&strToU8(n),o=s!=r.filename.length||v&&n.length!=v.length,h=s+exfl(r.extra)+30;s>65535&&this.ondata(err(11,0,1),null,!1);var u=new u8(h);wzh(u,0,r,e,o,-1);var f=[u],y=function(){for(var M=0,Z=f;M<Z.length;M++){var E=Z[M];a.ondata(null,E,!1)}f=[]},g=this.d;this.d=0;var z=this.u.length,p=mrg(r,{f:e,u:o,o:v,t:function(){r.terminate&&r.terminate()},r:function(){if(y(),g){var M=a.u[z+1];M?M.r():a.d=1}g=1}}),w=0;r.ondata=function(M,Z,E){if(M)a.ondata(M,Z,E),a.terminate();else if(w+=Z.length,f.push(Z),E){var A=new u8(16);wbytes(A,0,134695760),wbytes(A,4,r.crc),wbytes(A,8,w),wbytes(A,12,r.size),f.push(A),p.c=w,p.b=h+w+16,p.crc=r.crc,p.size=r.size,g&&p.r(),g=1}else g&&y()},this.u.push(p)}},t.prototype.end=function(){var r=this;if(this.d&2){this.ondata(err(4+(this.d&1)*8,0,1),null,!0);return}this.d?this.e():this.u.push({r:function(){r.d&1&&(r.u.splice(-1,1),r.e())},t:function(){}}),this.d=3},t.prototype.e=function(){for(var r=0,a=0,e=0,s=0,n=this.u;s<n.length;s++){var v=n[s];e+=46+v.f.length+exfl(v.extra)+(v.o?v.o.length:0)}for(var o=new u8(e+22),h=0,u=this.u;h<u.length;h++){var v=u[h];wzh(o,r,v,v.f,v.u,-v.c-2,a,v.o),r+=46+v.f.length+exfl(v.extra)+(v.o?v.o.length:0),a+=v.b}wzf(o,r,this.u.length,e,a),this.ondata(null,o,!0),this.d=2},t.prototype.terminate=function(){for(var r=0,a=this.u;r<a.length;r++){var e=a[r];e.t()}this.d=2},t}();exports.Zip=Zip,exports.ZipDeflate=ZipDeflate;
2
+ //# sourceMappingURL=fflate-G9RAFEgF.cjs.map
@@ -0,0 +1,2 @@
1
+ import{T as $}from"./Registry-CrT46EAO.js";import{p as ne,c as I}from"./OpenGrid-CeXt04ho.js";function z(e){return!!e&&typeof e.ref=="string"}const N=1;function re(e,t){return JSON.stringify(e)===JSON.stringify(t)}function oe(e){const t=(e==null?void 0:e.primary)??"#1976d2",n=(e==null?void 0:e.graphite)??"#3a3f45";return{rampFrom:r=>r==="primary"?t:n}}function se(e){const t=[];for(const n of e){const r=typeof n=="number"?n:typeof n=="string"&&n.trim()!==""?Number(n):NaN;Number.isFinite(r)&&t.push(r)}return t}function ie(e){const t=se(e),n=t.length;if(n===0)return{count:0,distinct:0};const r=[...t].sort((p,g)=>p-g),s=r[0],o=r[n-1],a=t.reduce((p,g)=>p+g,0)/n,c=t.reduce((p,g)=>p+(g-a)**2,0)/n,l=Math.sqrt(c),f=new Map;for(const p of t)f.set(p,(f.get(p)??0)+1);const d=f.size;return{min:s,max:o,avg:a,stddev:l,count:n,distinct:d,rankOf:p=>{let g=0;for(const k of t)k>p&&g++;return g+1},rankAscOf:p=>{let g=0;for(const k of t)k<p&&g++;return g+1},percentileOf:p=>{let g=0;for(const k of t)k<=p&&g++;return g/n},countOf:p=>f.get(p)??0}}function Y(e){const t={};return e.min!==void 0&&(t.min=e.min),e.max!==void 0&&(t.max=e.max),e.avg!==void 0&&(t.avg=e.avg),e.stddev!==void 0&&(t.stddev=e.stddev),e.count!==void 0&&(t.count=e.count),e.distinct!==void 0&&(t.distinct=e.distinct),t}function v(e){return typeof e=="number"?e:typeof e=="string"&&e.trim()!==""?Number(e):NaN}const h=864e5;function w(e){const t=new Date(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()}function L(e){const t=w(e),n=new Date(t).getDay();return t-n*h}const ae={needs:[],test(e,t){const n=v(t.value);if(!Number.isFinite(n))return!1;switch(e.op){case">":return n>e.a;case">=":return n>=e.a;case"<":return n<e.a;case"<=":return n<=e.a;case"=":return n===e.a;case"!=":return n!==e.a;case"between":return e.b!==void 0&&n>=Math.min(e.a,e.b)&&n<=Math.max(e.a,e.b);default:return!1}}},ce={needs:[],test(e,t){const n=t.value==null?"":String(t.value);return e.ci===!1?n.includes(e.text):n.toLowerCase().includes(e.text.toLowerCase())}},ue={needs:[],test(e,t,n,r){const s=t.value,o=s instanceof Date?s.getTime():typeof s=="number"?s:Date.parse(String(s));if(!Number.isFinite(o))return!1;const i=r.now,a=w(i);switch(e.rel){case"today":return w(o)===a;case"yesterday":return w(o)===a-h;case"tomorrow":return w(o)===a+h;case"thisWeek":{const c=L(i);return o>=c&&o<c+7*h}case"lastWeek":{const c=L(i)-7*h;return o>=c&&o<c+7*h}case"thisMonth":{const c=new Date(i);return new Date(o).getFullYear()===c.getFullYear()&&new Date(o).getMonth()===c.getMonth()}case"lastMonth":{const c=new Date(i.valueOf()),l=new Date(c.getFullYear(),c.getMonth()-1,1);return new Date(o).getFullYear()===l.getFullYear()&&new Date(o).getMonth()===l.getMonth()}case"next7d":return o>=a&&o<a+7*h;case"last7d":return o<a+h&&o>=a-6*h;default:return!1}}},le={needs:["rank"],test(e,t,n){const r=v(t.value);return Number.isFinite(r)?e.bottom?n.rankAscOf?n.rankAscOf(r)<=e.n:!1:n.rankOf?n.rankOf(r)<=e.n:!1:!1}},de={needs:["percentile"],test(e,t,n){const r=v(t.value);if(!Number.isFinite(r)||!n.percentileOf)return!1;const s=n.percentileOf(r);return e.bottom?s<=e.pct/100:s>=1-e.pct/100}},fe={needs:["avg"],test(e,t,n){const r=v(t.value);return!Number.isFinite(r)||n.avg===void 0?!1:e.below?r<n.avg:r>n.avg}},me={needs:["avg","stddev"],test(e,t,n){const r=v(t.value);if(!Number.isFinite(r)||n.avg===void 0||n.stddev===void 0)return!1;const s=Math.abs(r-n.avg),o=e.k*n.stddev;return e.outside===!1?s<=o:s>=o}},pe={needs:["cardinality"],test(e,t,n){const r=v(t.value);if(!Number.isFinite(r)||!n.countOf)return!1;const s=n.countOf(r);return e.unique?s===1:s>1}},ge={needs:[],test(){return!1}},W=Object.freeze({compare:ae,textContains:ce,dateOccurring:ue,topN:le,topNpct:de,aboveAvg:fe,stdBand:me,duplicate:pe,custom:ge});function q(){const e=new $({spi:{name:"CFPredicate",version:"1"}});for(const[t,n]of Object.entries(W))e.register(t,n,{origin:"builtin"});return e}function U(e,t){const n=e.scope;return!(n.columnId!==t.columnId||n.range&&(t.rowIndex<n.range.startRow||t.rowIndex>=n.range.endRow)||n.rowState&&n.rowState!==t.rowState)}function he(e){return[...e].sort((t,n)=>t.priority-n.priority||(t.id<n.id?-1:t.id>n.id?1:0))}function ye(e){return typeof e=="number"?e:typeof e=="string"&&e.trim()!==""?Number(e):NaN}function b(e){return e<0?0:e>1?1:e}function V(e,t,n){const r=ye(t),s=Number.isFinite(r),o=!s||r===0?0:r>0?1:-1,i=n.min??0,a=n.max??0;if(e.kind==="bar"){if(!s)return{sign:0};const c=e.axis??"zero";let l,f=!1;if(c==="zero"){const d=Math.max(Math.abs(i),Math.abs(a))||1,u=Math.abs(r)/d;l=b(u),e.clamp&&u>1&&(f=!0)}else{const d=a-i||1,u=(r-i)/d;l=b(u),e.clamp&&(u<0||u>1)&&(f=!0)}return{ratio:l,sign:o,value:r,clamped:f}}if(e.kind==="scale"){if(!s)return{sign:0};const c=e.mode??"discrete";let l;if(e.diverging){const u=e.midpoint==="zero"?0:e.midpoint==="mean"?n.avg??(i+a)/2:typeof e.midpoint=="number"?e.midpoint:0;if(r<=u){const m=u-i||1;l=.5*b((r-i)/m)}else{const m=a-u||1;l=.5+.5*b((r-u)/m)}}else{const u=a-i||1;l=b((r-i)/u)}if(c==="continuous")return{ratio:l,sign:o,value:r};const f=e.diverging?Math.max(3,Math.min(5,e.bands??3)):Math.max(2,Math.min(5,e.bands??3)),d=Math.min(f-1,Math.floor(l*f));return{ratio:l,bandIndex:d,bandCount:f,sign:o,value:r}}if(e.kind==="icon"){if(!s)return{sign:0};const c=e.steps??3,l=a-i||1,f=b((r-i)/l);let d=Math.min(c-1,Math.floor(f*c));return e.reverse&&(d=c-1-d),{bandIndex:d,bandCount:c,ratio:f,sign:o,value:r}}return s?{sign:o,value:r}:{sign:o}}function ve(e,t){return e.get(t)}class H{constructor(t){this.ruleTypes=t}evaluate(t,n,r,s){const o=he(t.filter(u=>U(u,n)));let i;const a=[],c=[];let l;for(const u of o){const m=ve(this.ruleTypes,u.when.type);if(!m)continue;let y=!1;try{y=m.test(u.when,n,r,s)}catch{y=!1}if(!y)continue;const B=V(u.encode,n.value,r),p={ruleId:u.id,conditionType:u.when.type,threshold:be(u),inputValue:n.value,statsUsed:Y(r),priority:u.priority,wonOver:[]},g={ruleId:u.id,fired:!0,encode:u.encode,datum:B,...u.style!==void 0?{styleRef:u.style}:{},lineage:p};if(u.encode.kind==="bar"||u.encode.kind==="scale"?(i&&c.push(i.ruleId),i=g):a.push(g),u.stopIfTrue){l=u.id;break}}i&&c.length&&(i={...i,lineage:{...i.lineage,wonOver:[...c]}});const f=i??a[0],d={decorators:a};return i&&(d.background=i),f&&(d.winner=f),l!==void 0&&(d.stoppedAt=l),d}}function be(e){const{type:t,...n}=e.when;return n}const D="#f4f5f6";function A(e){const t=n=>Math.max(0,Math.min(255,Math.round(n))).toString(16).padStart(2,"0");return`#${t(e.r)}${t(e.g)}${t(e.b)}`}function x(e,t,n){const r=n<0?0:n>1?1:n;return{r:e.r+(t.r-e.r)*r,g:e.g+(t.g-e.g)*r,b:e.b+(t.b-e.b)*r}}function F(e){return ne(e)??{r:58,g:63,b:69}}function ke(e){return x({r:255,g:255,b:255},e,.08)}function R(e,t){const n=F(e);return A(x(ke(n),n,t))}function E(e,t){const n=Math.max(2,Math.min(5,Math.floor(t))),r=[];for(let s=0;s<n;s++)r.push(R(e,n===1?0:s/(n-1)));return r}function T(e,t,n,r=D){const s=F(r);return n<=.5?A(x(F(e),s,n/.5)):A(x(s,F(t),(n-.5)/.5))}function J(e,t,n,r=D){const s=Math.max(3,Math.min(5,Math.floor(n))),o=[];for(let i=0;i<s;i++)o.push(T(e,t,s===1?.5:i/(s-1),r));return o}const P=4.5,O="#111111",C="#ffffff";class G{pickInk(t){const n=I(O,t),r=I(C,t),s=r>=n,o=s?C:O,i=s?r:n;return i>=P?{color:o,ratio:i}:{color:o,outline:!0,outlineColor:s?O:C,ratio:i}}}function we(e){return Math.max(I(O,e),I(C,e))>=P}const K=new G,_="#111111";function S(e){return e===void 0||!Number.isFinite(e)?"—":Number.isInteger(e)?String(e):String(Math.round(e*1e3)/1e3)}function j(e){return e===void 0?"—":`${Math.round(e*100)}%`}class Q{constructor(){this.kind="bar"}encode(t,n,r){const s=t.encode,o=t.datum;if(o.value===void 0)return{layer:"background",inkColor:_,ariaSummary:"값 없음"};const i=s.seed??(o.sign===-1?"graphite":"primary"),a=n.rampFrom(i),l=(s.axis??"zero")==="zero"&&o.sign===-1?"right":"left",f=K.pickInk(a),d=o.ratio??0,u=o.clamped?" (범위 초과·클램프)":"",m=s.log?" (log)":"",y=`값 ${S(o.value)}, 막대 ${j(d)}${o.sign===-1?" 음수":""}${u}${m}`;return{layer:"background",fill:{color:a,from:l,ratio:d},inkColor:f.color,...f.outline?{inkOutline:!0}:{},...o.clamped?{clamped:!0}:{},ariaSummary:y}}}class X{constructor(){this.kind="scale"}encode(t,n,r){const s=t.encode,o=t.datum;if(o.value===void 0)return{layer:"background",inkColor:_,ariaSummary:"값 없음"};const i=s.mode??"discrete";let a,c="";if(s.diverging){const d=n.rampFrom("graphite"),u=n.rampFrom("primary");if(i==="continuous")a=T(d,u,o.ratio??.5);else{const m=J(d,u,o.bandCount??3);a=m[o.bandIndex??0]??m[0],c=` (구간 ${(o.bandIndex??0)+1}/${o.bandCount??m.length})`}}else{const d=s.seed??"graphite",u=n.rampFrom(d);if(i==="continuous")a=R(u,o.ratio??0);else{const m=E(u,o.bandCount??3);a=m[o.bandIndex??0]??m[0],c=` (구간 ${(o.bandIndex??0)+1}/${o.bandCount??m.length})`}}const l=K.pickInk(a),f=`값 ${S(o.value)}, 히트맵 ${j(o.ratio)}${c}`;return{layer:"background",fill:{color:a,ratio:o.ratio??0},inkColor:l.color,...l.outline?{inkOutline:!0}:{},ariaSummary:f}}}function Me(e,t){return t<=1?"circle":e<=0?"triangleDown":e>=t-1?"triangleUp":"circle"}class Z{constructor(){this.kind="icon"}encode(t,n,r){const s=t.encode,o=t.datum;if(o.value===void 0)return{layer:"decorator",inkColor:_,ariaSummary:"값 없음"};const i=o.bandCount??s.steps??3,a=o.bandIndex??0,c=Me(a,i),l=E(n.rampFrom("graphite"),Math.max(2,i)),f=l[Math.min(l.length-1,a)]??l[0],d=`cf-icon-${a}-of-${i}`,u=a<=0?"하위":a>=i-1?"상위":"중간",m=`값 ${S(o.value)}, ${u} 구간 ${a+1}/${i} (${c})`;return{layer:"decorator",glyph:{role:d,tint:f,shape:c},inkColor:f,ariaSummary:m}}}class ee{constructor(){this.kind="sparkline"}encode(t,n,r){const s=t.encode,o=t.datum;return{layer:"decorator",inkColor:"#111111",ariaSummary:`인셀 ${s.chart??"line"} 스파크, 값 ${S(o.value)}`}}}function te(){const e=new $({spi:{name:"CFEncoder",version:"1"}});return e.register("bar",new Q,{origin:"builtin"}),e.register("scale",new X,{origin:"builtin"}),e.register("icon",new Z,{origin:"builtin"}),e.register("sparkline",new ee,{origin:"builtin"}),e}function Ie(){return new $({spi:{name:"CFNamedStyle",version:"1"}})}function M(e){return typeof e=="object"&&e!==null}class Ne{load(t,n){const r=[],s=[],o=Array.isArray(t)?t:M(t)&&Array.isArray(t.rules)?t.rules:[];for(const i of o){if(!M(i)){s.push({ruleId:"?",reason:"malformed",detail:"not an object"});continue}const a=typeof i.id=="string"?i.id:"?",c=i.when,l=i.encode,f=i.scope;if(typeof i.v=="number"&&i.v>N){s.push({ruleId:a,reason:"future-version",detail:`v${i.v} > ${N}`});continue}if(!M(c)||typeof c.type!="string"||!M(l)||typeof l.kind!="string"||!M(f)||typeof f.columnId!="string"){s.push({ruleId:a,reason:"malformed",detail:"missing when/encode/scope"});continue}if(!n.types.has(c.type)){s.push({ruleId:a,reason:"unknown-condition",detail:String(c.type)});continue}if(!n.encoders.has(l.kind)){s.push({ruleId:a,reason:"unknown-encoder",detail:String(l.kind)});continue}const d=i.style;if(z(d)&&!n.styles.has(d.ref)){s.push({ruleId:a,reason:"unknown-style",detail:d.ref});continue}r.push(i)}return{rules:r,skipped:s}}}function xe(e){return JSON.stringify({v:N,rules:e})}class Fe{constructor(t=[]){this.byColumn=new Map,this.all=[];for(const n of t)this.add(n)}add(t){this.all.push(t);const n=this.byColumn.get(t.scope.columnId)??[];n.push(t),this.byColumn.set(t.scope.columnId,n)}rulesFor(t){return this.byColumn.get(t)??[]}list(){return this.all}}class Oe{constructor(t,n=te(),r=q(),s){this.rules=t,this.encoders=n,this.ruleTypes=r,this.evaluator=s??new H(r)}get lineage(){return this}paintFor(t,n,r,s,o){const i=this.evaluator.evaluate(this.rules.rulesFor(t.columnId),t,n,o),a=[];if(i.background){const c=this.encoders.get(i.background.encode.kind);c&&a.push(c.encode(i.background,r,s))}for(const c of i.decorators){const l=this.encoders.get(c.encode.kind);l&&a.push(l.encode(c,r,s))}return a}statsNeedsFor(t){const n=new Set;for(const r of this.rules.rulesFor(t)){const s=this.ruleTypes.get(r.when.type);if(s)for(const o of s.needs)n.add(o)}return[...n].sort()}explain(t,n,r,s){const o=this.evaluator.evaluate(n,t,r,s),i=[];o.background&&i.push(o.background.lineage);for(const a of o.decorators)i.push(a.lineage);return i.sort((a,c)=>a.priority-c.priority)}}export{P as AA_BODY,W as BUILTIN_PREDICATES,Q as BarEncoder,Oe as CFEngine,Fe as CFRuleStore,N as CF_SCHEMA_VERSION,H as DefaultCFEvaluator,Ne as DefaultCFRuleLoader,G as DefaultInkResolver,Z as IconEncoder,D as NEUTRAL_MIDPOINT,X as ScaleEncoder,ee as SparklineEncoder,re as cfRuleEquals,ie as computeColumnStats,V as computeDatum,te as createEncoderRegistry,Ie as createNamedStyleRegistry,q as createRuleTypeRegistry,J as divergingBands,T as divergingColor,z as isStyleRef,we as passesInkGate,U as scopeMatches,E as sequentialBands,R as sequentialColor,xe as serializeRules,Y as snapshotStats,oe as staticAppearanceView};
2
+ //# sourceMappingURL=index-1OXjJmct.js.map
@@ -0,0 +1,2 @@
1
+ const a=h=>{const t=globalThis.requestAnimationFrame;if(typeof t=="function"){const i=t(()=>h()),o=globalThis.cancelAnimationFrame;return{cancel:()=>o==null?void 0:o(i)}}const e=setTimeout(h,16);return{cancel:()=>clearTimeout(e)}};class c{constructor(t){this.$p=new Map,this.$be=new Map,this.$bb=new Set,this._coalesced=0,this._dropped=0,this._disposed=!1,this.$g=t}enqueue(t){if(!this._disposed){if(t.kind==="snapshot"){this._dropped+=this.$p.size+this.$be.size+this.$bb.size,this.$p.clear(),this.$be.clear(),this.$bb.clear(),this.$bD=t,this.$hl();return}this.$mr(t),this.$hl()}}$mr(t){if(t.removes)for(const e of t.removes){this.$bb.add(e),this.$be.delete(e);for(const i of this.$p.keys())i.slice(0,i.indexOf("\0"))===e&&this.$p.delete(i)}if(t.upserts)for(const e of t.upserts){if(this.$bb.has(e.rowId))continue;const i=this.$be.get(e.rowId);i&&this._coalesced++,this.$be.set(e.rowId,{...i??{},...e.row})}if(t.cells)for(const e of t.cells){if(this.$bb.has(e.rowId))continue;const i=e.rowId+"\0"+e.field;this.$p.has(i)&&this._coalesced++,this.$p.set(i,{rowId:e.rowId,field:e.field,value:e.value})}}$hl(){this.$I||(this.$I=this.$g.scheduleFrame(()=>{this.$I=void 0,this.$lR()}))}$lR(){if(this._disposed)return;if(this.$bD){const n=this.$bD;this.$bD=void 0,this.$g.flush({cells:[],upserts:[],removes:[],snapshot:n,overflowToNextFrame:!1});return}const t=this.$g.maxBatchPerFrame??0,e=[];let i=!1;for(const[n,r]of this.$p){if(t>0&&e.length>=t){i=!0;break}e.push(r),this.$p.delete(n)}const o=[...this.$be.entries()].map(([n,r])=>({rowId:n,row:r})),s=[...this.$bb];this.$be.clear(),this.$bb.clear(),!(e.length===0&&o.length===0&&s.length===0)&&(this.$g.flush({cells:e.map(n=>({rowId:n.rowId,field:n.field,value:n.value})),upserts:o,removes:s,overflowToNextFrame:i}),(i||this.$p.size>0)&&this.$hl())}get stats(){return{pending:this.$p.size+this.$be.size+this.$bb.size,coalesced:this._coalesced,dropped:this._dropped}}dispose(){var t;this._disposed=!0,(t=this.$I)==null||t.cancel(),this.$I=void 0,this.$p.clear(),this.$be.clear(),this.$bb.clear(),this.$bD=void 0}}class l{constructor(t){this.spi="command",this.kind="rt.apply",this.label="rt.backgroundUpdate",this.$K=0,this.$eo=[],this.$eJ=[],this.$fi=[],this.$bL=t,this.footprint=l.$lT(t)}get appliedDelta(){return this.$bK}do(t){this.$K=t.clock.now(),this.$eo=[],this.$eJ=[],this.$fi=[];const e=[];t.mutation.beginBatch();try{const i=[];for(const s of this.$bL.cells){const n=t.coords.indexOf(s.rowId);n<0||(this.$eo.push({rowId:s.rowId,field:s.field,oldValue:t.coords.getCellValue(s.rowId,s.field)}),i.push({rowIndex:n,field:s.field,value:s.value}),e.push({rowId:s.rowId,field:s.field}))}i.length>0&&t.mutation.writeCells(i);for(const s of this.$bL.upserts){const n=t.coords.indexOf(s.rowId);if(n>=0){const r=[];for(const[d,u]of Object.entries(s.row))this.$eo.push({rowId:s.rowId,field:d,oldValue:t.coords.getCellValue(s.rowId,d)}),r.push({rowIndex:n,field:d,value:u}),e.push({rowId:s.rowId,field:d});r.length>0&&t.mutation.writeCells(r)}else t.mutation.insertRow(s.row,"last"),this.$eJ.push(s.rowId)}const o=[];for(const s of this.$bL.removes){const n=t.coords.indexOf(s);n<0||(this.$fi.push({rowId:s,snapshot:t.coords.getRowSnapshot(s)}),o.push({rowId:s,index:n}))}o.length>0&&t.mutation.deleteRows(o.sort((s,n)=>n.index-s.index).map(s=>s.index)),this.$bK={changedCells:e,insertedRowIds:[...this.$eJ],removedRowIds:this.$fi.map(s=>s.rowId),userInitiated:!1}}finally{t.mutation.endBatch()}}undo(t){t.mutation.beginBatch();try{const e=this.$eJ.map(o=>t.coords.indexOf(o)).filter(o=>o>=0).sort((o,s)=>s-o);e.length>0&&t.mutation.deleteRows(e);for(const o of this.$fi)o.snapshot&&t.mutation.insertRow(o.snapshot,"last");const i=[];for(const o of this.$eo){const s=t.coords.indexOf(o.rowId);s>=0&&i.push({rowIndex:s,field:o.field,value:o.oldValue})}i.length>0&&t.mutation.writeCells(i)}finally{t.mutation.endBatch()}}serialize(){return{kind:this.kind,payload:{cells:this.$bL.cells,upserts:this.$bL.upserts,removes:this.$bL.removes},at:this.$K}}static $lT(t){if(t.snapshot||t.upserts.length>0||t.removes.length>0)return{scope:"structure"};const e=[...new Set(t.cells.map(o=>o.rowId))],i=[...new Set(t.cells.map(o=>o.field))];return e.length===1&&i.length===1?{scope:"cell",rowId:e[0],field:i[0]}:{scope:"range",rowIds:e,fields:i}}}class f{constructor(t,e){this.$aD=new Set,this.$ek=!1,this.$q=t,this.$b=e,this.$i=e.now??(()=>Date.now()),this.$fV=t.status,this._scheduler=new c({...e.maxBatchPerFrame!==void 0?{maxBatchPerFrame:e.maxBatchPerFrame}:{},scheduleFrame:e.scheduleFrame??a,flush:i=>this.$lb(i)})}attach(){this.$ek||(this.$ek=!0,this.$gL=this.$q.onData(t=>this.$mx(t)),this.$gM=this.$q.onStatus(t=>this.$mG(t)),this.$q.start())}detach(){var t,e;this.$ek&&(this.$ek=!1,(t=this.$gL)==null||t.call(this),(e=this.$gM)==null||e.call(this),this.$gL=void 0,this.$gM=void 0,this.$q.stop(),this._scheduler.dispose())}get connection(){return this.$fV}get backpressureStats(){return this._scheduler.stats}onConnection(t){return this.$aD.add(t),()=>this.$aD.delete(t)}$mx(t){this.$b.freshness.markReceived(t.serverTime??this.$i()),this._scheduler.enqueue(t)}$mG(t){this.$fV=t,this.$b.announce.onConnection(t.status),this.$b.freshness.tick();for(const e of this.$aD)e(t)}$lb(t){const e=this.$b.stateGuard.capture();if(t.snapshot){if(this.$b.applySnapshot){this.$b.applySnapshot(t.snapshot.rows);const s={changedCells:[],insertedRowIds:[],removedRowIds:[],userInitiated:!1};this.$b.stateGuard.restore(e,s),this.$b.announce.onBackgroundChange(s)}else console.warn("[open-grid/realtime] snapshot received but no applySnapshot dep wired — skipped");return}const i=new l(t);this.$b.sink.beginBatch();try{this.$b.sink.dispatchSilent(i)}finally{this.$b.sink.endBatch()}const o=i.appliedDelta;if(o&&(this.$b.stateGuard.restore(e,o),this.$b.announce.onBackgroundChange(o),this.$b.chart)){const s=[...new Set([...o.changedCells.map(n=>n.rowId),...o.insertedRowIds,...o.removedRowIds])];s.length>0&&this.$b.chart.markDirty(s)}}}class w{constructor(t,e){this.$gy=[],this.$o=t,this.$eu=e}get lastConflicts(){return this.$gy}capture(){const t=this.$o.readEditing();return{selection:this.$o.readSelection(),scroll:this.$o.readScroll(),...t?{editing:t}:{},sortFilterSig:this.$o.readSortFilterSig()}}restore(t,e){this.$gy=[];const i=new Set(e.removedRowIds),o=t.selection.filter(s=>!i.has(s.rowId)&&this.$eu.rowIdToIndex(s.rowId)>=0);this.$o.writeSelection(o),t.scroll.anchorRowId&&(i.has(t.scroll.anchorRowId)||this.$eu.rowIdToIndex(t.scroll.anchorRowId)<0)?this.$o.writeScroll({pixelWithinRow:0,scrollLeft:t.scroll.scrollLeft}):this.$o.writeScroll(t.scroll),t.editing&&(!i.has(t.editing.rowId)&&this.$eu.rowIdToIndex(t.editing.rowId)>=0?(e.changedCells.some(r=>r.rowId===t.editing.rowId&&r.field===t.editing.field)&&this.$gy.push({rowId:t.editing.rowId,field:t.editing.field}),this.$o.writeEditing(t.editing)):this.$o.writeEditing(void 0))}}class p{constructor(t){this.$jg="stale",this.$ae=new Set,this.$kB=t.staleAfterMs,this.$i=t.now??(()=>Date.now())}markReceived(t){this.$eM=t,this.$ir()}compute(){const t=this.$i();if(this.$eM===void 0)return{state:"stale",ageMs:1/0};const e=t-this.$eM;return{state:e>this.$kB?"stale":"fresh",ageMs:e,lastReceivedAt:this.$eM}}tick(){return this.$ir()}$ir(){const t=this.compute();if(t.state!==this.$jg){this.$jg=t.state;for(const e of this.$ae)e(t)}return t}onChange(t){return this.$ae.add(t),()=>this.$ae.delete(t)}}class m{constructor(t){this.$dR=new Set,this.$bZ=new Set,this._announce=t.announce,this._debounceMs=t.debounceMs??500,this.$ch=t.schedule??((e,i)=>{const o=setTimeout(e,i);return{cancel:()=>clearTimeout(o)}})}onBackgroundChange(t){for(const e of t.changedCells)this.$dR.add(e.rowId+" "+e.field),this.$bZ.add(e.rowId);for(const e of t.insertedRowIds)this.$bZ.add(e);for(const e of t.removedRowIds)this.$bZ.add(e);this.$cm()}$cm(){this._timer||(this._timer=this.$ch(()=>{this._timer=void 0,this._flush()},this._debounceMs))}_flush(){this.$dR.size===0&&this.$bZ.size===0||(this._announce({kind:"background-update",changedCount:this.$dR.size,rowCount:this.$bZ.size,label:"background",interruptsFocus:!1}),this.$dR.clear(),this.$bZ.clear())}onConnection(t){this._announce({kind:"connection",changedCount:0,rowCount:0,label:"connection",interruptsFocus:!1,connectionStatus:t})}dispose(){var t;(t=this._timer)==null||t.cancel(),this._timer=void 0,this.$dR.clear(),this.$bZ.clear()}}export{c as BackpressureScheduler,p as FreshnessClock,w as LiveStateGuard,f as RealtimeController,m as RtAnnouncePolicy,l as RtApplyCommand,a as defaultFrameScheduler};
2
+ //# sourceMappingURL=index-B5V7e4Xc.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const defaultFrameScheduler=h=>{const t=globalThis.requestAnimationFrame;if(typeof t=="function"){const i=t(()=>h()),o=globalThis.cancelAnimationFrame;return{cancel:()=>o==null?void 0:o(i)}}const e=setTimeout(h,16);return{cancel:()=>clearTimeout(e)}};class BackpressureScheduler{constructor(t){this.$p=new Map,this.$be=new Map,this.$bb=new Set,this._coalesced=0,this._dropped=0,this._disposed=!1,this.$g=t}enqueue(t){if(!this._disposed){if(t.kind==="snapshot"){this._dropped+=this.$p.size+this.$be.size+this.$bb.size,this.$p.clear(),this.$be.clear(),this.$bb.clear(),this.$bD=t,this.$hl();return}this.$mr(t),this.$hl()}}$mr(t){if(t.removes)for(const e of t.removes){this.$bb.add(e),this.$be.delete(e);for(const i of this.$p.keys())i.slice(0,i.indexOf("\0"))===e&&this.$p.delete(i)}if(t.upserts)for(const e of t.upserts){if(this.$bb.has(e.rowId))continue;const i=this.$be.get(e.rowId);i&&this._coalesced++,this.$be.set(e.rowId,{...i??{},...e.row})}if(t.cells)for(const e of t.cells){if(this.$bb.has(e.rowId))continue;const i=e.rowId+"\0"+e.field;this.$p.has(i)&&this._coalesced++,this.$p.set(i,{rowId:e.rowId,field:e.field,value:e.value})}}$hl(){this.$I||(this.$I=this.$g.scheduleFrame(()=>{this.$I=void 0,this.$lR()}))}$lR(){if(this._disposed)return;if(this.$bD){const r=this.$bD;this.$bD=void 0,this.$g.flush({cells:[],upserts:[],removes:[],snapshot:r,overflowToNextFrame:!1});return}const t=this.$g.maxBatchPerFrame??0,e=[];let i=!1;for(const[r,n]of this.$p){if(t>0&&e.length>=t){i=!0;break}e.push(n),this.$p.delete(r)}const o=[...this.$be.entries()].map(([r,n])=>({rowId:r,row:n})),s=[...this.$bb];this.$be.clear(),this.$bb.clear(),!(e.length===0&&o.length===0&&s.length===0)&&(this.$g.flush({cells:e.map(r=>({rowId:r.rowId,field:r.field,value:r.value})),upserts:o,removes:s,overflowToNextFrame:i}),(i||this.$p.size>0)&&this.$hl())}get stats(){return{pending:this.$p.size+this.$be.size+this.$bb.size,coalesced:this._coalesced,dropped:this._dropped}}dispose(){var t;this._disposed=!0,(t=this.$I)==null||t.cancel(),this.$I=void 0,this.$p.clear(),this.$be.clear(),this.$bb.clear(),this.$bD=void 0}}class RtApplyCommand{constructor(t){this.spi="command",this.kind="rt.apply",this.label="rt.backgroundUpdate",this.$K=0,this.$eo=[],this.$eJ=[],this.$fi=[],this.$bL=t,this.footprint=RtApplyCommand.$lT(t)}get appliedDelta(){return this.$bK}do(t){this.$K=t.clock.now(),this.$eo=[],this.$eJ=[],this.$fi=[];const e=[];t.mutation.beginBatch();try{const i=[];for(const s of this.$bL.cells){const r=t.coords.indexOf(s.rowId);r<0||(this.$eo.push({rowId:s.rowId,field:s.field,oldValue:t.coords.getCellValue(s.rowId,s.field)}),i.push({rowIndex:r,field:s.field,value:s.value}),e.push({rowId:s.rowId,field:s.field}))}i.length>0&&t.mutation.writeCells(i);for(const s of this.$bL.upserts){const r=t.coords.indexOf(s.rowId);if(r>=0){const n=[];for(const[l,d]of Object.entries(s.row))this.$eo.push({rowId:s.rowId,field:l,oldValue:t.coords.getCellValue(s.rowId,l)}),n.push({rowIndex:r,field:l,value:d}),e.push({rowId:s.rowId,field:l});n.length>0&&t.mutation.writeCells(n)}else t.mutation.insertRow(s.row,"last"),this.$eJ.push(s.rowId)}const o=[];for(const s of this.$bL.removes){const r=t.coords.indexOf(s);r<0||(this.$fi.push({rowId:s,snapshot:t.coords.getRowSnapshot(s)}),o.push({rowId:s,index:r}))}o.length>0&&t.mutation.deleteRows(o.sort((s,r)=>r.index-s.index).map(s=>s.index)),this.$bK={changedCells:e,insertedRowIds:[...this.$eJ],removedRowIds:this.$fi.map(s=>s.rowId),userInitiated:!1}}finally{t.mutation.endBatch()}}undo(t){t.mutation.beginBatch();try{const e=this.$eJ.map(o=>t.coords.indexOf(o)).filter(o=>o>=0).sort((o,s)=>s-o);e.length>0&&t.mutation.deleteRows(e);for(const o of this.$fi)o.snapshot&&t.mutation.insertRow(o.snapshot,"last");const i=[];for(const o of this.$eo){const s=t.coords.indexOf(o.rowId);s>=0&&i.push({rowIndex:s,field:o.field,value:o.oldValue})}i.length>0&&t.mutation.writeCells(i)}finally{t.mutation.endBatch()}}serialize(){return{kind:this.kind,payload:{cells:this.$bL.cells,upserts:this.$bL.upserts,removes:this.$bL.removes},at:this.$K}}static $lT(t){if(t.snapshot||t.upserts.length>0||t.removes.length>0)return{scope:"structure"};const e=[...new Set(t.cells.map(o=>o.rowId))],i=[...new Set(t.cells.map(o=>o.field))];return e.length===1&&i.length===1?{scope:"cell",rowId:e[0],field:i[0]}:{scope:"range",rowIds:e,fields:i}}}class RealtimeController{constructor(t,e){this.$aD=new Set,this.$ek=!1,this.$q=t,this.$b=e,this.$i=e.now??(()=>Date.now()),this.$fV=t.status,this._scheduler=new BackpressureScheduler({...e.maxBatchPerFrame!==void 0?{maxBatchPerFrame:e.maxBatchPerFrame}:{},scheduleFrame:e.scheduleFrame??defaultFrameScheduler,flush:i=>this.$lb(i)})}attach(){this.$ek||(this.$ek=!0,this.$gL=this.$q.onData(t=>this.$mx(t)),this.$gM=this.$q.onStatus(t=>this.$mG(t)),this.$q.start())}detach(){var t,e;this.$ek&&(this.$ek=!1,(t=this.$gL)==null||t.call(this),(e=this.$gM)==null||e.call(this),this.$gL=void 0,this.$gM=void 0,this.$q.stop(),this._scheduler.dispose())}get connection(){return this.$fV}get backpressureStats(){return this._scheduler.stats}onConnection(t){return this.$aD.add(t),()=>this.$aD.delete(t)}$mx(t){this.$b.freshness.markReceived(t.serverTime??this.$i()),this._scheduler.enqueue(t)}$mG(t){this.$fV=t,this.$b.announce.onConnection(t.status),this.$b.freshness.tick();for(const e of this.$aD)e(t)}$lb(t){const e=this.$b.stateGuard.capture();if(t.snapshot){if(this.$b.applySnapshot){this.$b.applySnapshot(t.snapshot.rows);const s={changedCells:[],insertedRowIds:[],removedRowIds:[],userInitiated:!1};this.$b.stateGuard.restore(e,s),this.$b.announce.onBackgroundChange(s)}else console.warn("[open-grid/realtime] snapshot received but no applySnapshot dep wired — skipped");return}const i=new RtApplyCommand(t);this.$b.sink.beginBatch();try{this.$b.sink.dispatchSilent(i)}finally{this.$b.sink.endBatch()}const o=i.appliedDelta;if(o&&(this.$b.stateGuard.restore(e,o),this.$b.announce.onBackgroundChange(o),this.$b.chart)){const s=[...new Set([...o.changedCells.map(r=>r.rowId),...o.insertedRowIds,...o.removedRowIds])];s.length>0&&this.$b.chart.markDirty(s)}}}class LiveStateGuard{constructor(t,e){this.$gy=[],this.$o=t,this.$eu=e}get lastConflicts(){return this.$gy}capture(){const t=this.$o.readEditing();return{selection:this.$o.readSelection(),scroll:this.$o.readScroll(),...t?{editing:t}:{},sortFilterSig:this.$o.readSortFilterSig()}}restore(t,e){this.$gy=[];const i=new Set(e.removedRowIds),o=t.selection.filter(s=>!i.has(s.rowId)&&this.$eu.rowIdToIndex(s.rowId)>=0);this.$o.writeSelection(o),t.scroll.anchorRowId&&(i.has(t.scroll.anchorRowId)||this.$eu.rowIdToIndex(t.scroll.anchorRowId)<0)?this.$o.writeScroll({pixelWithinRow:0,scrollLeft:t.scroll.scrollLeft}):this.$o.writeScroll(t.scroll),t.editing&&(!i.has(t.editing.rowId)&&this.$eu.rowIdToIndex(t.editing.rowId)>=0?(e.changedCells.some(n=>n.rowId===t.editing.rowId&&n.field===t.editing.field)&&this.$gy.push({rowId:t.editing.rowId,field:t.editing.field}),this.$o.writeEditing(t.editing)):this.$o.writeEditing(void 0))}}class FreshnessClock{constructor(t){this.$jg="stale",this.$ae=new Set,this.$kB=t.staleAfterMs,this.$i=t.now??(()=>Date.now())}markReceived(t){this.$eM=t,this.$ir()}compute(){const t=this.$i();if(this.$eM===void 0)return{state:"stale",ageMs:1/0};const e=t-this.$eM;return{state:e>this.$kB?"stale":"fresh",ageMs:e,lastReceivedAt:this.$eM}}tick(){return this.$ir()}$ir(){const t=this.compute();if(t.state!==this.$jg){this.$jg=t.state;for(const e of this.$ae)e(t)}return t}onChange(t){return this.$ae.add(t),()=>this.$ae.delete(t)}}class RtAnnouncePolicy{constructor(t){this.$dR=new Set,this.$bZ=new Set,this._announce=t.announce,this._debounceMs=t.debounceMs??500,this.$ch=t.schedule??((e,i)=>{const o=setTimeout(e,i);return{cancel:()=>clearTimeout(o)}})}onBackgroundChange(t){for(const e of t.changedCells)this.$dR.add(e.rowId+" "+e.field),this.$bZ.add(e.rowId);for(const e of t.insertedRowIds)this.$bZ.add(e);for(const e of t.removedRowIds)this.$bZ.add(e);this.$cm()}$cm(){this._timer||(this._timer=this.$ch(()=>{this._timer=void 0,this._flush()},this._debounceMs))}_flush(){this.$dR.size===0&&this.$bZ.size===0||(this._announce({kind:"background-update",changedCount:this.$dR.size,rowCount:this.$bZ.size,label:"background",interruptsFocus:!1}),this.$dR.clear(),this.$bZ.clear())}onConnection(t){this._announce({kind:"connection",changedCount:0,rowCount:0,label:"connection",interruptsFocus:!1,connectionStatus:t})}dispose(){var t;(t=this._timer)==null||t.cancel(),this._timer=void 0,this.$dR.clear(),this.$bZ.clear()}}exports.BackpressureScheduler=BackpressureScheduler,exports.FreshnessClock=FreshnessClock,exports.LiveStateGuard=LiveStateGuard,exports.RealtimeController=RealtimeController,exports.RtAnnouncePolicy=RtAnnouncePolicy,exports.RtApplyCommand=RtApplyCommand,exports.defaultFrameScheduler=defaultFrameScheduler;
2
+ //# sourceMappingURL=index-DbKDox8y.cjs.map
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Registry=require("./Registry-DpHOpU5V.cjs"),OpenGrid=require("./OpenGrid-Bh1NMOcm.cjs");function isStyleRef(e){return!!e&&typeof e.ref=="string"}const CF_SCHEMA_VERSION=1;function cfRuleEquals(e,t){return JSON.stringify(e)===JSON.stringify(t)}function staticAppearanceView(e){const t=(e==null?void 0:e.primary)??"#1976d2",n=(e==null?void 0:e.graphite)??"#3a3f45";return{rampFrom:r=>r==="primary"?t:n}}function numeric(e){const t=[];for(const n of e){const r=typeof n=="number"?n:typeof n=="string"&&n.trim()!==""?Number(n):NaN;Number.isFinite(r)&&t.push(r)}return t}function computeColumnStats(e){const t=numeric(e),n=t.length;if(n===0)return{count:0,distinct:0};const r=[...t].sort((m,g)=>m-g),s=r[0],o=r[n-1],a=t.reduce((m,g)=>m+g,0)/n,c=t.reduce((m,g)=>m+(g-a)**2,0)/n,l=Math.sqrt(c),f=new Map;for(const m of t)f.set(m,(f.get(m)??0)+1);const d=f.size;return{min:s,max:o,avg:a,stddev:l,count:n,distinct:d,rankOf:m=>{let g=0;for(const y of t)y>m&&g++;return g+1},rankAscOf:m=>{let g=0;for(const y of t)y<m&&g++;return g+1},percentileOf:m=>{let g=0;for(const y of t)y<=m&&g++;return g/n},countOf:m=>f.get(m)??0}}function snapshotStats(e){const t={};return e.min!==void 0&&(t.min=e.min),e.max!==void 0&&(t.max=e.max),e.avg!==void 0&&(t.avg=e.avg),e.stddev!==void 0&&(t.stddev=e.stddev),e.count!==void 0&&(t.count=e.count),e.distinct!==void 0&&(t.distinct=e.distinct),t}function num$1(e){return typeof e=="number"?e:typeof e=="string"&&e.trim()!==""?Number(e):NaN}const DAY=864e5;function startOfDay(e){const t=new Date(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()}function startOfWeek(e){const t=startOfDay(e),n=new Date(t).getDay();return t-n*DAY}const comparePredicate={needs:[],test(e,t){const n=num$1(t.value);if(!Number.isFinite(n))return!1;switch(e.op){case">":return n>e.a;case">=":return n>=e.a;case"<":return n<e.a;case"<=":return n<=e.a;case"=":return n===e.a;case"!=":return n!==e.a;case"between":return e.b!==void 0&&n>=Math.min(e.a,e.b)&&n<=Math.max(e.a,e.b);default:return!1}}},textContainsPredicate={needs:[],test(e,t){const n=t.value==null?"":String(t.value);return e.ci===!1?n.includes(e.text):n.toLowerCase().includes(e.text.toLowerCase())}},dateOccurringPredicate={needs:[],test(e,t,n,r){const s=t.value,o=s instanceof Date?s.getTime():typeof s=="number"?s:Date.parse(String(s));if(!Number.isFinite(o))return!1;const i=r.now,a=startOfDay(i);switch(e.rel){case"today":return startOfDay(o)===a;case"yesterday":return startOfDay(o)===a-DAY;case"tomorrow":return startOfDay(o)===a+DAY;case"thisWeek":{const c=startOfWeek(i);return o>=c&&o<c+7*DAY}case"lastWeek":{const c=startOfWeek(i)-7*DAY;return o>=c&&o<c+7*DAY}case"thisMonth":{const c=new Date(i);return new Date(o).getFullYear()===c.getFullYear()&&new Date(o).getMonth()===c.getMonth()}case"lastMonth":{const c=new Date(i.valueOf()),l=new Date(c.getFullYear(),c.getMonth()-1,1);return new Date(o).getFullYear()===l.getFullYear()&&new Date(o).getMonth()===l.getMonth()}case"next7d":return o>=a&&o<a+7*DAY;case"last7d":return o<a+DAY&&o>=a-6*DAY;default:return!1}}},topNPredicate={needs:["rank"],test(e,t,n){const r=num$1(t.value);return Number.isFinite(r)?e.bottom?n.rankAscOf?n.rankAscOf(r)<=e.n:!1:n.rankOf?n.rankOf(r)<=e.n:!1:!1}},topNpctPredicate={needs:["percentile"],test(e,t,n){const r=num$1(t.value);if(!Number.isFinite(r)||!n.percentileOf)return!1;const s=n.percentileOf(r);return e.bottom?s<=e.pct/100:s>=1-e.pct/100}},aboveAvgPredicate={needs:["avg"],test(e,t,n){const r=num$1(t.value);return!Number.isFinite(r)||n.avg===void 0?!1:e.below?r<n.avg:r>n.avg}},stdBandPredicate={needs:["avg","stddev"],test(e,t,n){const r=num$1(t.value);if(!Number.isFinite(r)||n.avg===void 0||n.stddev===void 0)return!1;const s=Math.abs(r-n.avg),o=e.k*n.stddev;return e.outside===!1?s<=o:s>=o}},duplicatePredicate={needs:["cardinality"],test(e,t,n){const r=num$1(t.value);if(!Number.isFinite(r)||!n.countOf)return!1;const s=n.countOf(r);return e.unique?s===1:s>1}},customFallbackPredicate={needs:[],test(){return!1}},BUILTIN_PREDICATES=Object.freeze({compare:comparePredicate,textContains:textContainsPredicate,dateOccurring:dateOccurringPredicate,topN:topNPredicate,topNpct:topNpctPredicate,aboveAvg:aboveAvgPredicate,stdBand:stdBandPredicate,duplicate:duplicatePredicate,custom:customFallbackPredicate});function createRuleTypeRegistry(){const e=new Registry.TypedRegistry({spi:{name:"CFPredicate",version:"1"}});for(const[t,n]of Object.entries(BUILTIN_PREDICATES))e.register(t,n,{origin:"builtin"});return e}function scopeMatches(e,t){const n=e.scope;return!(n.columnId!==t.columnId||n.range&&(t.rowIndex<n.range.startRow||t.rowIndex>=n.range.endRow)||n.rowState&&n.rowState!==t.rowState)}function sortRules(e){return[...e].sort((t,n)=>t.priority-n.priority||(t.id<n.id?-1:t.id>n.id?1:0))}function num(e){return typeof e=="number"?e:typeof e=="string"&&e.trim()!==""?Number(e):NaN}function clamp01(e){return e<0?0:e>1?1:e}function computeDatum(e,t,n){const r=num(t),s=Number.isFinite(r),o=!s||r===0?0:r>0?1:-1,i=n.min??0,a=n.max??0;if(e.kind==="bar"){if(!s)return{sign:0};const c=e.axis??"zero";let l,f=!1;if(c==="zero"){const d=Math.max(Math.abs(i),Math.abs(a))||1,u=Math.abs(r)/d;l=clamp01(u),e.clamp&&u>1&&(f=!0)}else{const d=a-i||1,u=(r-i)/d;l=clamp01(u),e.clamp&&(u<0||u>1)&&(f=!0)}return{ratio:l,sign:o,value:r,clamped:f}}if(e.kind==="scale"){if(!s)return{sign:0};const c=e.mode??"discrete";let l;if(e.diverging){const u=e.midpoint==="zero"?0:e.midpoint==="mean"?n.avg??(i+a)/2:typeof e.midpoint=="number"?e.midpoint:0;if(r<=u){const p=u-i||1;l=.5*clamp01((r-i)/p)}else{const p=a-u||1;l=.5+.5*clamp01((r-u)/p)}}else{const u=a-i||1;l=clamp01((r-i)/u)}if(c==="continuous")return{ratio:l,sign:o,value:r};const f=e.diverging?Math.max(3,Math.min(5,e.bands??3)):Math.max(2,Math.min(5,e.bands??3)),d=Math.min(f-1,Math.floor(l*f));return{ratio:l,bandIndex:d,bandCount:f,sign:o,value:r}}if(e.kind==="icon"){if(!s)return{sign:0};const c=e.steps??3,l=a-i||1,f=clamp01((r-i)/l);let d=Math.min(c-1,Math.floor(f*c));return e.reverse&&(d=c-1-d),{bandIndex:d,bandCount:c,ratio:f,sign:o,value:r}}return s?{sign:o,value:r}:{sign:o}}function predicateFor(e,t){return e.get(t)}class DefaultCFEvaluator{constructor(t){this.ruleTypes=t}evaluate(t,n,r,s){const o=sortRules(t.filter(u=>scopeMatches(u,n)));let i;const a=[],c=[];let l;for(const u of o){const p=predicateFor(this.ruleTypes,u.when.type);if(!p)continue;let h=!1;try{h=p.test(u.when,n,r,s)}catch{h=!1}if(!h)continue;const v=computeDatum(u.encode,n.value,r),m={ruleId:u.id,conditionType:u.when.type,threshold:thresholdOf(u),inputValue:n.value,statsUsed:snapshotStats(r),priority:u.priority,wonOver:[]},g={ruleId:u.id,fired:!0,encode:u.encode,datum:v,...u.style!==void 0?{styleRef:u.style}:{},lineage:m};if(u.encode.kind==="bar"||u.encode.kind==="scale"?(i&&c.push(i.ruleId),i=g):a.push(g),u.stopIfTrue){l=u.id;break}}i&&c.length&&(i={...i,lineage:{...i.lineage,wonOver:[...c]}});const f=i??a[0],d={decorators:a};return i&&(d.background=i),f&&(d.winner=f),l!==void 0&&(d.stoppedAt=l),d}}function thresholdOf(e){const{type:t,...n}=e.when;return n}const NEUTRAL_MIDPOINT="#f4f5f6";function toHex(e){const t=n=>Math.max(0,Math.min(255,Math.round(n))).toString(16).padStart(2,"0");return`#${t(e.r)}${t(e.g)}${t(e.b)}`}function mix(e,t,n){const r=n<0?0:n>1?1:n;return{r:e.r+(t.r-e.r)*r,g:e.g+(t.g-e.g)*r,b:e.b+(t.b-e.b)*r}}function rgb(e){return OpenGrid.parseColor(e)??{r:58,g:63,b:69}}function lightAnchorOf(e){return mix({r:255,g:255,b:255},e,.08)}function sequentialColor(e,t){const n=rgb(e);return toHex(mix(lightAnchorOf(n),n,t))}function sequentialBands(e,t){const n=Math.max(2,Math.min(5,Math.floor(t))),r=[];for(let s=0;s<n;s++)r.push(sequentialColor(e,n===1?0:s/(n-1)));return r}function divergingColor(e,t,n,r=NEUTRAL_MIDPOINT){const s=rgb(r);return n<=.5?toHex(mix(rgb(e),s,n/.5)):toHex(mix(s,rgb(t),(n-.5)/.5))}function divergingBands(e,t,n,r=NEUTRAL_MIDPOINT){const s=Math.max(3,Math.min(5,Math.floor(n))),o=[];for(let i=0;i<s;i++)o.push(divergingColor(e,t,s===1?.5:i/(s-1),r));return o}const AA_BODY=4.5,BLACK="#111111",WHITE="#ffffff";class DefaultInkResolver{pickInk(t){const n=OpenGrid.contrastRatio(BLACK,t),r=OpenGrid.contrastRatio(WHITE,t),s=r>=n,o=s?WHITE:BLACK,i=s?r:n;return i>=AA_BODY?{color:o,ratio:i}:{color:o,outline:!0,outlineColor:s?BLACK:WHITE,ratio:i}}}function passesInkGate(e){return Math.max(OpenGrid.contrastRatio(BLACK,e),OpenGrid.contrastRatio(WHITE,e))>=AA_BODY}const ink=new DefaultInkResolver,MISSING_INK="#111111";function fmt(e){return e===void 0||!Number.isFinite(e)?"—":Number.isInteger(e)?String(e):String(Math.round(e*1e3)/1e3)}function pct(e){return e===void 0?"—":`${Math.round(e*100)}%`}class BarEncoder{constructor(){this.kind="bar"}encode(t,n,r){const s=t.encode,o=t.datum;if(o.value===void 0)return{layer:"background",inkColor:MISSING_INK,ariaSummary:"값 없음"};const i=s.seed??(o.sign===-1?"graphite":"primary"),a=n.rampFrom(i),l=(s.axis??"zero")==="zero"&&o.sign===-1?"right":"left",f=ink.pickInk(a),d=o.ratio??0,u=o.clamped?" (범위 초과·클램프)":"",p=s.log?" (log)":"",h=`값 ${fmt(o.value)}, 막대 ${pct(d)}${o.sign===-1?" 음수":""}${u}${p}`;return{layer:"background",fill:{color:a,from:l,ratio:d},inkColor:f.color,...f.outline?{inkOutline:!0}:{},...o.clamped?{clamped:!0}:{},ariaSummary:h}}}class ScaleEncoder{constructor(){this.kind="scale"}encode(t,n,r){const s=t.encode,o=t.datum;if(o.value===void 0)return{layer:"background",inkColor:MISSING_INK,ariaSummary:"값 없음"};const i=s.mode??"discrete";let a,c="";if(s.diverging){const d=n.rampFrom("graphite"),u=n.rampFrom("primary");if(i==="continuous")a=divergingColor(d,u,o.ratio??.5);else{const p=divergingBands(d,u,o.bandCount??3);a=p[o.bandIndex??0]??p[0],c=` (구간 ${(o.bandIndex??0)+1}/${o.bandCount??p.length})`}}else{const d=s.seed??"graphite",u=n.rampFrom(d);if(i==="continuous")a=sequentialColor(u,o.ratio??0);else{const p=sequentialBands(u,o.bandCount??3);a=p[o.bandIndex??0]??p[0],c=` (구간 ${(o.bandIndex??0)+1}/${o.bandCount??p.length})`}}const l=ink.pickInk(a),f=`값 ${fmt(o.value)}, 히트맵 ${pct(o.ratio)}${c}`;return{layer:"background",fill:{color:a,ratio:o.ratio??0},inkColor:l.color,...l.outline?{inkOutline:!0}:{},ariaSummary:f}}}function shapeFor(e,t){return t<=1?"circle":e<=0?"triangleDown":e>=t-1?"triangleUp":"circle"}class IconEncoder{constructor(){this.kind="icon"}encode(t,n,r){const s=t.encode,o=t.datum;if(o.value===void 0)return{layer:"decorator",inkColor:MISSING_INK,ariaSummary:"값 없음"};const i=o.bandCount??s.steps??3,a=o.bandIndex??0,c=shapeFor(a,i),l=sequentialBands(n.rampFrom("graphite"),Math.max(2,i)),f=l[Math.min(l.length-1,a)]??l[0],d=`cf-icon-${a}-of-${i}`,u=a<=0?"하위":a>=i-1?"상위":"중간",p=`값 ${fmt(o.value)}, ${u} 구간 ${a+1}/${i} (${c})`;return{layer:"decorator",glyph:{role:d,tint:f,shape:c},inkColor:f,ariaSummary:p}}}class SparklineEncoder{constructor(){this.kind="sparkline"}encode(t,n,r){const s=t.encode,o=t.datum;return{layer:"decorator",inkColor:"#111111",ariaSummary:`인셀 ${s.chart??"line"} 스파크, 값 ${fmt(o.value)}`}}}function createEncoderRegistry(){const e=new Registry.TypedRegistry({spi:{name:"CFEncoder",version:"1"}});return e.register("bar",new BarEncoder,{origin:"builtin"}),e.register("scale",new ScaleEncoder,{origin:"builtin"}),e.register("icon",new IconEncoder,{origin:"builtin"}),e.register("sparkline",new SparklineEncoder,{origin:"builtin"}),e}function createNamedStyleRegistry(){return new Registry.TypedRegistry({spi:{name:"CFNamedStyle",version:"1"}})}function isObj(e){return typeof e=="object"&&e!==null}class DefaultCFRuleLoader{load(t,n){const r=[],s=[],o=Array.isArray(t)?t:isObj(t)&&Array.isArray(t.rules)?t.rules:[];for(const i of o){if(!isObj(i)){s.push({ruleId:"?",reason:"malformed",detail:"not an object"});continue}const a=typeof i.id=="string"?i.id:"?",c=i.when,l=i.encode,f=i.scope;if(typeof i.v=="number"&&i.v>CF_SCHEMA_VERSION){s.push({ruleId:a,reason:"future-version",detail:`v${i.v} > ${CF_SCHEMA_VERSION}`});continue}if(!isObj(c)||typeof c.type!="string"||!isObj(l)||typeof l.kind!="string"||!isObj(f)||typeof f.columnId!="string"){s.push({ruleId:a,reason:"malformed",detail:"missing when/encode/scope"});continue}if(!n.types.has(c.type)){s.push({ruleId:a,reason:"unknown-condition",detail:String(c.type)});continue}if(!n.encoders.has(l.kind)){s.push({ruleId:a,reason:"unknown-encoder",detail:String(l.kind)});continue}const d=i.style;if(isStyleRef(d)&&!n.styles.has(d.ref)){s.push({ruleId:a,reason:"unknown-style",detail:d.ref});continue}r.push(i)}return{rules:r,skipped:s}}}function serializeRules(e){return JSON.stringify({v:CF_SCHEMA_VERSION,rules:e})}class CFRuleStore{constructor(t=[]){this.byColumn=new Map,this.all=[];for(const n of t)this.add(n)}add(t){this.all.push(t);const n=this.byColumn.get(t.scope.columnId)??[];n.push(t),this.byColumn.set(t.scope.columnId,n)}rulesFor(t){return this.byColumn.get(t)??[]}list(){return this.all}}class CFEngine{constructor(t,n=createEncoderRegistry(),r=createRuleTypeRegistry(),s){this.rules=t,this.encoders=n,this.ruleTypes=r,this.evaluator=s??new DefaultCFEvaluator(r)}get lineage(){return this}paintFor(t,n,r,s,o){const i=this.evaluator.evaluate(this.rules.rulesFor(t.columnId),t,n,o),a=[];if(i.background){const c=this.encoders.get(i.background.encode.kind);c&&a.push(c.encode(i.background,r,s))}for(const c of i.decorators){const l=this.encoders.get(c.encode.kind);l&&a.push(l.encode(c,r,s))}return a}statsNeedsFor(t){const n=new Set;for(const r of this.rules.rulesFor(t)){const s=this.ruleTypes.get(r.when.type);if(s)for(const o of s.needs)n.add(o)}return[...n].sort()}explain(t,n,r,s){const o=this.evaluator.evaluate(n,t,r,s),i=[];o.background&&i.push(o.background.lineage);for(const a of o.decorators)i.push(a.lineage);return i.sort((a,c)=>a.priority-c.priority)}}exports.AA_BODY=AA_BODY,exports.BUILTIN_PREDICATES=BUILTIN_PREDICATES,exports.BarEncoder=BarEncoder,exports.CFEngine=CFEngine,exports.CFRuleStore=CFRuleStore,exports.CF_SCHEMA_VERSION=CF_SCHEMA_VERSION,exports.DefaultCFEvaluator=DefaultCFEvaluator,exports.DefaultCFRuleLoader=DefaultCFRuleLoader,exports.DefaultInkResolver=DefaultInkResolver,exports.IconEncoder=IconEncoder,exports.NEUTRAL_MIDPOINT=NEUTRAL_MIDPOINT,exports.ScaleEncoder=ScaleEncoder,exports.SparklineEncoder=SparklineEncoder,exports.cfRuleEquals=cfRuleEquals,exports.computeColumnStats=computeColumnStats,exports.computeDatum=computeDatum,exports.createEncoderRegistry=createEncoderRegistry,exports.createNamedStyleRegistry=createNamedStyleRegistry,exports.createRuleTypeRegistry=createRuleTypeRegistry,exports.divergingBands=divergingBands,exports.divergingColor=divergingColor,exports.isStyleRef=isStyleRef,exports.passesInkGate=passesInkGate,exports.scopeMatches=scopeMatches,exports.sequentialBands=sequentialBands,exports.sequentialColor=sequentialColor,exports.serializeRules=serializeRules,exports.snapshotStats=snapshotStats,exports.staticAppearanceView=staticAppearanceView;
2
+ //# sourceMappingURL=index-HaDoF1HM.cjs.map
@@ -1,28 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("react/jsx-runtime"), React = require("react"), OpenGrid = require("./OpenGrid-BUYQs1_w.cjs");
4
- function OpenGridReact({ data: e, columns: r, height: t = 400, width: u = "100%", editable: i = false, sortable: p = true, filterable: o = true, rowNumber: l = false, checkColumn: d = false, stateColumn: y = false, draggable: R = false, frozenColumns: x = 0, theme: s = "default", options: E, style: T, className: $, onReady: g, onDataChange: O, onCellClick: G, onRowClick: j, onEditEnd: a, onSortChange: b, onFilterChange: q, onRowDrop: S }) {
5
- const c = React.useRef(null), n = React.useRef(null), M = { height: typeof t == "number" ? `${t}px` : t, width: typeof u == "number" ? `${u}px` : u, display: "block", boxSizing: "border-box", ...T };
6
- return React.useEffect(() => {
7
- if (!c.current) return;
8
- const P = { columns: r, height: "100%", width: "100%", editable: i, sortable: p, filterable: o, rowNumber: l, checkColumn: d, stateColumn: y, draggable: R, frozenColumns: x, theme: s, ...E, onReady: (f) => {
9
- n.current = f, (e == null ? void 0 : e.length) && f.setData(e), g == null ? void 0 : g(f);
10
- }, ...O && { onDataChange: O }, ...G && { onCellClick: G }, ...j && { onRowClick: j }, ...a && { onEditEnd: a }, ...b && { onSortChange: b }, ...q && { onFilterChange: q }, ...S && { onRowDrop: S } }, v = new OpenGrid.OpenGrid(c.current, P);
11
- return n.current = v, () => {
12
- v.destroy(), n.current = null;
13
- };
14
- }, [r, i, p, o, l, d, y, R, x]), React.useEffect(() => {
15
- n.current && e && n.current.setData(e);
16
- }, [e]), React.useEffect(() => {
17
- n.current && n.current.setTheme(s);
18
- }, [s]), jsxRuntime.jsx("div", { ref: c, style: M, className: $ });
19
- }
20
- const OpenGridWithRef = React.forwardRef((e, r) => {
21
- React.useRef(null);
22
- const t = React.useRef(null);
23
- return React.useEffect(() => {
24
- t.current && r && (typeof r == "function" ? r(t.current) : r.current = t.current);
25
- }), jsxRuntime.jsx(OpenGridReact, { ...e });
26
- });
27
- OpenGridWithRef.displayName = "OpenGrid", exports.OpenGrid = OpenGridReact;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const jsxRuntime=require("react/jsx-runtime"),React=require("react"),OpenGrid=require("./OpenGrid-Bh1NMOcm.cjs");function OpenGridReact({data:e,columns:r,height:t=400,width:u="100%",editable:i=!1,sortable:p=!0,filterable:l=!0,rowNumber:o=!1,checkColumn:d=!1,stateColumn:x=!1,draggable:y=!1,frozenColumns:R=0,theme:s="default",options:$,style:a,className:g,onReady:O,onDataChange:G,onCellClick:j,onRowClick:v,onEditEnd:b,onSortChange:q,onFilterChange:S,onRowDrop:E}){const c=React.useRef(null),n=React.useRef(null),M={height:typeof t=="number"?`${t}px`:t,width:typeof u=="number"?`${u}px`:u,display:"block",boxSizing:"border-box",...a};return React.useEffect(()=>{if(!c.current)return;const P={columns:r,height:"100%",width:"100%",editable:i,sortable:p,filterable:l,rowNumber:o,checkColumn:d,stateColumn:x,draggable:y,frozenColumns:R,theme:s,...$,onReady:f=>{n.current=f,e!=null&&e.length&&f.setData(e),O==null||O(f)},...G&&{onDataChange:G},...j&&{onCellClick:j},...v&&{onRowClick:v},...b&&{onEditEnd:b},...q&&{onSortChange:q},...S&&{onFilterChange:S},...E&&{onRowDrop:E}},T=new OpenGrid.OpenGrid(c.current,P);return n.current=T,()=>{T.destroy(),n.current=null}},[r,i,p,l,o,d,x,y,R]),React.useEffect(()=>{n.current&&e&&n.current.setData(e)},[e]),React.useEffect(()=>{n.current&&n.current.setTheme(s)},[s]),jsxRuntime.jsx("div",{ref:c,style:M,className:g})}const OpenGridWithRef=React.forwardRef((e,r)=>{React.useRef(null);const t=React.useRef(null);return React.useEffect(()=>{t.current&&r&&(typeof r=="function"?r(t.current):r.current=t.current)}),jsxRuntime.jsx(OpenGridReact,{...e})});OpenGridWithRef.displayName="OpenGrid",exports.OpenGrid=OpenGridReact;
28
2
  //# sourceMappingURL=open-grid-react.cjs.map
@@ -1,31 +1,2 @@
1
- import { jsx as W } from "react/jsx-runtime";
2
- import J, { useRef as u, useEffect as f } from "react";
3
- import { O as K } from "./OpenGrid-BmagF0yo.js";
4
- function q({ data: r, columns: e, height: t = 400, width: c = "100%", editable: o = false, sortable: l = true, filterable: y = true, rowNumber: d = false, checkColumn: O = false, stateColumn: R = false, draggable: x = false, frozenColumns: G = 0, theme: s = "default", options: z, style: A, className: B, onReady: D, onDataChange: m, onCellClick: a, onRowClick: $, onEditEnd: b, onSortChange: j, onFilterChange: v, onRowDrop: S }) {
5
- const i = u(null), n = u(null), H = { height: typeof t == "number" ? `${t}px` : t, width: typeof c == "number" ? `${c}px` : c, display: "block", boxSizing: "border-box", ...A };
6
- return f(() => {
7
- if (!i.current) return;
8
- const I = { columns: e, height: "100%", width: "100%", editable: o, sortable: l, filterable: y, rowNumber: d, checkColumn: O, stateColumn: R, draggable: x, frozenColumns: G, theme: s, ...z, onReady: (p) => {
9
- n.current = p, (r == null ? void 0 : r.length) && p.setData(r), D == null ? void 0 : D(p);
10
- }, ...m && { onDataChange: m }, ...a && { onCellClick: a }, ...$ && { onRowClick: $ }, ...b && { onEditEnd: b }, ...j && { onSortChange: j }, ...v && { onFilterChange: v }, ...S && { onRowDrop: S } }, T = new K(i.current, I);
11
- return n.current = T, () => {
12
- T.destroy(), n.current = null;
13
- };
14
- }, [e, o, l, y, d, O, R, x, G]), f(() => {
15
- n.current && r && n.current.setData(r);
16
- }, [r]), f(() => {
17
- n.current && n.current.setTheme(s);
18
- }, [s]), W("div", { ref: i, style: H, className: B });
19
- }
20
- const L = J.forwardRef((r, e) => {
21
- u(null);
22
- const t = u(null);
23
- return f(() => {
24
- t.current && e && (typeof e == "function" ? e(t.current) : e.current = t.current);
25
- }), W(q, { ...r });
26
- });
27
- L.displayName = "OpenGrid";
28
- export {
29
- q as OpenGrid
30
- };
1
+ import{jsx as z}from"react/jsx-runtime";import K,{useRef as u,useEffect as f}from"react";import{O as L}from"./OpenGrid-CeXt04ho.js";function A({data:r,columns:e,height:t=400,width:c="100%",editable:l=!1,sortable:o=!0,filterable:y=!0,rowNumber:d=!1,checkColumn:O=!1,stateColumn:x=!1,draggable:R=!1,frozenColumns:G=0,theme:i="default",options:B,style:D,className:H,onReady:m,onDataChange:v,onCellClick:$,onRowClick:b,onEditEnd:j,onSortChange:S,onFilterChange:T,onRowDrop:W}){const s=u(null),n=u(null),I={height:typeof t=="number"?`${t}px`:t,width:typeof c=="number"?`${c}px`:c,display:"block",boxSizing:"border-box",...D};return f(()=>{if(!s.current)return;const J={columns:e,height:"100%",width:"100%",editable:l,sortable:o,filterable:y,rowNumber:d,checkColumn:O,stateColumn:x,draggable:R,frozenColumns:G,theme:i,...B,onReady:p=>{n.current=p,r!=null&&r.length&&p.setData(r),m==null||m(p)},...v&&{onDataChange:v},...$&&{onCellClick:$},...b&&{onRowClick:b},...j&&{onEditEnd:j},...S&&{onSortChange:S},...T&&{onFilterChange:T},...W&&{onRowDrop:W}},q=new L(s.current,J);return n.current=q,()=>{q.destroy(),n.current=null}},[e,l,o,y,d,O,x,R,G]),f(()=>{n.current&&r&&n.current.setData(r)},[r]),f(()=>{n.current&&n.current.setTheme(i)},[i]),z("div",{ref:s,style:I,className:H})}const M=K.forwardRef((r,e)=>{u(null);const t=u(null);return f(()=>{t.current&&e&&(typeof e=="function"?e(t.current):e.current=t.current)}),z(A,{...r})});M.displayName="OpenGrid";export{A as OpenGrid};
31
2
  //# sourceMappingURL=open-grid-react.js.map
@@ -1,32 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const vue = require("vue"), OpenGrid$1 = require("./OpenGrid-BUYQs1_w.cjs"), _sfc_main = vue.defineComponent({ __name: "OpenGrid", props: { data: { default: () => [] }, columns: {}, height: { default: 400 }, width: { default: "100%" }, editable: { type: Boolean, default: false }, sortable: { type: Boolean, default: true }, filterable: { type: Boolean, default: true }, rowNumber: { type: Boolean, default: false }, checkColumn: { type: Boolean, default: false }, stateColumn: { type: Boolean, default: false }, draggable: { type: Boolean, default: false }, frozenColumns: { default: 0 }, theme: { default: "default" }, options: {} }, emits: ["update:data", "ready", "cell-click", "row-click", "edit-end", "sort-change", "filter-change", "row-check"], setup(n, { expose: u, emit: r }) {
4
- const e = n, o = r, c = vue.ref(), a = vue.shallowRef(null);
5
- let i = null;
6
- const s = vue.computed(() => ({ height: typeof e.height == "number" ? `${e.height}px` : e.height, width: typeof e.width == "number" ? `${e.width}px` : e.width }));
7
- return vue.onMounted(() => {
8
- if (!c.value) return;
9
- const l = { columns: e.columns, height: "100%", width: "100%", editable: e.editable, sortable: e.sortable, filterable: e.filterable, rowNumber: e.rowNumber, checkColumn: e.checkColumn, stateColumn: e.stateColumn, draggable: e.draggable, frozenColumns: e.frozenColumns, theme: e.theme, ...e.options, onReady: (t) => {
10
- var _a;
11
- ((_a = e.data) == null ? void 0 : _a.length) && t.setData(e.data), o("ready", t);
12
- }, onCellClick: (t) => o("cell-click", t), onRowClick: (t) => o("row-click", t), onEditEnd: (t) => o("edit-end", t), onSortChange: (t) => o("sort-change", t), onFilterChange: (t) => o("filter-change", t), onDataChange: (t) => {
13
- i = t, o("update:data", t);
14
- } };
15
- a.value = new OpenGrid$1.OpenGrid(c.value, l);
16
- }), vue.watch(() => e.data, (l) => {
17
- !a.value || !l || l !== i && a.value.setData(l);
18
- }, { deep: false }), vue.watch(() => e.theme, (l) => {
19
- a.value && l && a.value.setTheme(l);
20
- }), vue.watch(() => e.columns, (l) => {
21
- a.value && a.value.applyColumns(l);
22
- }, { deep: false }), vue.onUnmounted(() => {
23
- var _a;
24
- (_a = a.value) == null ? void 0 : _a.destroy(), a.value = null;
25
- }), u({ grid: a }), (l, t) => (vue.openBlock(), vue.createElementBlock("div", { ref_key: "containerRef", ref: c, class: "og-vue-wrapper", style: vue.normalizeStyle(s.value) }, null, 4));
26
- } }), _export_sfc = (n, u) => {
27
- const r = n.__vccOpts || n;
28
- for (const [e, o] of u) r[e] = o;
29
- return r;
30
- }, OpenGrid = _export_sfc(_sfc_main, [["__scopeId", "data-v-a9841021"]]);
31
- exports.OpenGrid = OpenGrid;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const vue=require("vue"),OpenGrid$1=require("./OpenGrid-Bh1NMOcm.cjs"),_sfc_main=vue.defineComponent({__name:"OpenGrid",props:{data:{default:()=>[]},columns:{},height:{default:400},width:{default:"100%"},editable:{type:Boolean,default:!1},sortable:{type:Boolean,default:!0},filterable:{type:Boolean,default:!0},rowNumber:{type:Boolean,default:!1},checkColumn:{type:Boolean,default:!1},stateColumn:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},frozenColumns:{default:0},theme:{default:"default"},options:{}},emits:["update:data","ready","cell-click","row-click","edit-end","sort-change","filter-change","row-check"],setup(n,{expose:u,emit:r}){const e=n,o=r,i=vue.ref(),a=vue.shallowRef(null);let c=null;const s=vue.computed(()=>({height:typeof e.height=="number"?`${e.height}px`:e.height,width:typeof e.width=="number"?`${e.width}px`:e.width}));return vue.onMounted(()=>{if(!i.value)return;const l={columns:e.columns,height:"100%",width:"100%",editable:e.editable,sortable:e.sortable,filterable:e.filterable,rowNumber:e.rowNumber,checkColumn:e.checkColumn,stateColumn:e.stateColumn,draggable:e.draggable,frozenColumns:e.frozenColumns,theme:e.theme,...e.options,onReady:t=>{var d;(d=e.data)!=null&&d.length&&t.setData(e.data),o("ready",t)},onCellClick:t=>o("cell-click",t),onRowClick:t=>o("row-click",t),onEditEnd:t=>o("edit-end",t),onSortChange:t=>o("sort-change",t),onFilterChange:t=>o("filter-change",t),onDataChange:t=>{c=t,o("update:data",t)}};a.value=new OpenGrid$1.OpenGrid(i.value,l)}),vue.watch(()=>e.data,l=>{!a.value||!l||l!==c&&a.value.setData(l)},{deep:!1}),vue.watch(()=>e.theme,l=>{a.value&&l&&a.value.setTheme(l)}),vue.watch(()=>e.columns,l=>{a.value&&a.value.applyColumns(l)},{deep:!1}),vue.onUnmounted(()=>{var l;(l=a.value)==null||l.destroy(),a.value=null}),u({grid:a}),(l,t)=>(vue.openBlock(),vue.createElementBlock("div",{ref_key:"containerRef",ref:i,class:"og-vue-wrapper",style:vue.normalizeStyle(s.value)},null,4))}}),_export_sfc=(n,u)=>{const r=n.__vccOpts||n;for(const[e,o]of u)r[e]=o;return r},OpenGrid=_export_sfc(_sfc_main,[["__scopeId","data-v-a9841021"]]);exports.OpenGrid=OpenGrid;
32
2
  //# sourceMappingURL=open-grid-vue.cjs.map
@@ -1,34 +1,2 @@
1
- import { defineComponent as f, ref as p, shallowRef as m, computed as h, onMounted as g, watch as d, onUnmounted as y, openBlock as b, createElementBlock as v, normalizeStyle as C } from "vue";
2
- import { O as k } from "./OpenGrid-BmagF0yo.js";
3
- const w = f({ __name: "OpenGrid", props: { data: { default: () => [] }, columns: {}, height: { default: 400 }, width: { default: "100%" }, editable: { type: Boolean, default: false }, sortable: { type: Boolean, default: true }, filterable: { type: Boolean, default: true }, rowNumber: { type: Boolean, default: false }, checkColumn: { type: Boolean, default: false }, stateColumn: { type: Boolean, default: false }, draggable: { type: Boolean, default: false }, frozenColumns: { default: 0 }, theme: { default: "default" }, options: {} }, emits: ["update:data", "ready", "cell-click", "row-click", "edit-end", "sort-change", "filter-change", "row-check"], setup(n, { expose: u, emit: r }) {
4
- const e = n, o = r, c = p(), a = m(null);
5
- let i = null;
6
- const s = h(() => ({ height: typeof e.height == "number" ? `${e.height}px` : e.height, width: typeof e.width == "number" ? `${e.width}px` : e.width }));
7
- return g(() => {
8
- if (!c.value) return;
9
- const l = { columns: e.columns, height: "100%", width: "100%", editable: e.editable, sortable: e.sortable, filterable: e.filterable, rowNumber: e.rowNumber, checkColumn: e.checkColumn, stateColumn: e.stateColumn, draggable: e.draggable, frozenColumns: e.frozenColumns, theme: e.theme, ...e.options, onReady: (t) => {
10
- var _a;
11
- ((_a = e.data) == null ? void 0 : _a.length) && t.setData(e.data), o("ready", t);
12
- }, onCellClick: (t) => o("cell-click", t), onRowClick: (t) => o("row-click", t), onEditEnd: (t) => o("edit-end", t), onSortChange: (t) => o("sort-change", t), onFilterChange: (t) => o("filter-change", t), onDataChange: (t) => {
13
- i = t, o("update:data", t);
14
- } };
15
- a.value = new k(c.value, l);
16
- }), d(() => e.data, (l) => {
17
- !a.value || !l || l !== i && a.value.setData(l);
18
- }, { deep: false }), d(() => e.theme, (l) => {
19
- a.value && l && a.value.setTheme(l);
20
- }), d(() => e.columns, (l) => {
21
- a.value && a.value.applyColumns(l);
22
- }, { deep: false }), y(() => {
23
- var _a;
24
- (_a = a.value) == null ? void 0 : _a.destroy(), a.value = null;
25
- }), u({ grid: a }), (l, t) => (b(), v("div", { ref_key: "containerRef", ref: c, class: "og-vue-wrapper", style: C(s.value) }, null, 4));
26
- } }), _ = (n, u) => {
27
- const r = n.__vccOpts || n;
28
- for (const [e, o] of u) r[e] = o;
29
- return r;
30
- }, B = _(w, [["__scopeId", "data-v-a9841021"]]);
31
- export {
32
- B as OpenGrid
33
- };
1
+ import{defineComponent as p,ref as m,shallowRef as h,computed as g,onMounted as v,watch as i,onUnmounted as y,openBlock as b,createElementBlock as C,normalizeStyle as _}from"vue";import{O as k}from"./OpenGrid-CeXt04ho.js";const w=p({__name:"OpenGrid",props:{data:{default:()=>[]},columns:{},height:{default:400},width:{default:"100%"},editable:{type:Boolean,default:!1},sortable:{type:Boolean,default:!0},filterable:{type:Boolean,default:!0},rowNumber:{type:Boolean,default:!1},checkColumn:{type:Boolean,default:!1},stateColumn:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},frozenColumns:{default:0},theme:{default:"default"},options:{}},emits:["update:data","ready","cell-click","row-click","edit-end","sort-change","filter-change","row-check"],setup(n,{expose:u,emit:r}){const e=n,o=r,d=m(),a=h(null);let c=null;const f=g(()=>({height:typeof e.height=="number"?`${e.height}px`:e.height,width:typeof e.width=="number"?`${e.width}px`:e.width}));return v(()=>{if(!d.value)return;const l={columns:e.columns,height:"100%",width:"100%",editable:e.editable,sortable:e.sortable,filterable:e.filterable,rowNumber:e.rowNumber,checkColumn:e.checkColumn,stateColumn:e.stateColumn,draggable:e.draggable,frozenColumns:e.frozenColumns,theme:e.theme,...e.options,onReady:t=>{var s;(s=e.data)!=null&&s.length&&t.setData(e.data),o("ready",t)},onCellClick:t=>o("cell-click",t),onRowClick:t=>o("row-click",t),onEditEnd:t=>o("edit-end",t),onSortChange:t=>o("sort-change",t),onFilterChange:t=>o("filter-change",t),onDataChange:t=>{c=t,o("update:data",t)}};a.value=new k(d.value,l)}),i(()=>e.data,l=>{!a.value||!l||l!==c&&a.value.setData(l)},{deep:!1}),i(()=>e.theme,l=>{a.value&&l&&a.value.setTheme(l)}),i(()=>e.columns,l=>{a.value&&a.value.applyColumns(l)},{deep:!1}),y(()=>{var l;(l=a.value)==null||l.destroy(),a.value=null}),u({grid:a}),(l,t)=>(b(),C("div",{ref_key:"containerRef",ref:d,class:"og-vue-wrapper",style:_(f.value)},null,4))}}),B=(n,u)=>{const r=n.__vccOpts||n;for(const[e,o]of u)r[e]=o;return r},x=B(w,[["__scopeId","data-v-a9841021"]]);export{x as OpenGrid};
34
2
  //# sourceMappingURL=open-grid-vue.js.map