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.
- package/CHANGELOG.md +34 -0
- package/dist/ExportProgressView-BYPw8osg.cjs +2 -0
- package/dist/ExportProgressView-Bt5-z7rE.js +2 -0
- package/dist/LcpMergeOrderer-CeP6C6G1.cjs +2 -0
- package/dist/LcpMergeOrderer-Ebwuir-r.js +2 -0
- package/dist/OpenGrid-Bh1NMOcm.cjs +98 -0
- package/dist/OpenGrid-CeXt04ho.js +98 -0
- package/dist/Registry-CrT46EAO.js +2 -0
- package/dist/Registry-DpHOpU5V.cjs +2 -0
- package/dist/XlsxChannel-CuOZ3LQz.js +2 -0
- package/dist/XlsxChannel-DQHLGend.cjs +2 -0
- package/dist/XlsxWorkbookWriter-DixuNGtw.cjs +3 -0
- package/dist/XlsxWorkbookWriter-VgbibI0Z.js +3 -0
- package/dist/fflate-Cs3txMgg.js +2 -0
- package/dist/fflate-G9RAFEgF.cjs +2 -0
- package/dist/index-1OXjJmct.js +2 -0
- package/dist/index-B5V7e4Xc.js +2 -0
- package/dist/index-DbKDox8y.cjs +2 -0
- package/dist/index-HaDoF1HM.cjs +2 -0
- package/dist/open-grid-react.cjs +1 -27
- package/dist/open-grid-react.js +1 -30
- package/dist/open-grid-vue.cjs +1 -31
- package/dist/open-grid-vue.js +1 -33
- package/dist/open-grid.cjs +6 -275
- package/dist/open-grid.js +6 -293
- package/dist/sinks-BCZFMGQJ.cjs +2 -0
- package/dist/sinks-qkBJ5bKn.js +2 -0
- package/dist/types/core/ExportManager.d.ts +1 -0
- package/dist/types/core/export/channels/XlsxChannel.d.ts +9 -1
- package/dist/types/core/export/channels/XlsxRichTextRun.d.ts +14 -0
- package/dist/types/core/export/channels/XlsxSheetXml.d.ts +19 -0
- package/dist/types/core/export/channels/XlsxStyleEntries.d.ts +80 -0
- package/dist/types/core/export/channels/XlsxStylesRegistry.d.ts +20 -0
- package/dist/types/core/export/channels/XlsxWorkbookWriter.d.ts +7 -4
- package/dist/types/core/export/channels/XlsxXml.d.ts +6 -0
- package/dist/types/core/export/types.d.ts +63 -0
- package/dist/types/core/types.d.ts +24 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/xlsx.min-CMvrM6b4.cjs +138 -0
- package/dist/xlsx.min-i_b-4PvU.js +138 -0
- package/package.json +2 -1
- package/dist/ExportProgressView-9Kt1SQxv.js +0 -48
- package/dist/ExportProgressView-B59uHIwt.cjs +0 -48
- package/dist/LcpMergeOrderer-BdUtV67j.js +0 -114
- package/dist/LcpMergeOrderer-C_ANVkGk.cjs +0 -113
- package/dist/OpenGrid-BUYQs1_w.cjs +0 -9806
- package/dist/OpenGrid-BmagF0yo.js +0 -9819
- package/dist/Registry-CPJYOqCn.js +0 -74
- package/dist/Registry-D74ZmdDz.cjs +0 -71
- package/dist/XlsxChannel-DOeHeP7h.cjs +0 -95
- package/dist/XlsxChannel-DdaiytFR.js +0 -95
- package/dist/XlsxWorkbookWriter-BTNtZ80J.js +0 -199
- package/dist/XlsxWorkbookWriter-_u5stfg4.cjs +0 -198
- package/dist/index-B9_g5Eg3.js +0 -481
- package/dist/index-CeJ-0-80.cjs +0 -260
- package/dist/index-CnyumyPV.cjs +0 -452
- package/dist/index-DnarQ4eR.js +0 -266
- package/dist/sinks-BWkWQexV.js +0 -149
- package/dist/sinks-DPK0VxYG.cjs +0 -143
- package/dist/xlsx.min-BQ1o3sB6.cjs +0 -11793
- package/dist/xlsx.min-Bbz2ZypC.js +0 -11794
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
class rn{constructor(){this.listeners=new Map}on(t,e){const s=this.listeners.get(t)??[];return s.push({handler:e,once:!1}),this.listeners.set(t,s),this}once(t,e){const s=this.listeners.get(t)??[];return s.push({handler:e,once:!0}),this.listeners.set(t,s),this}off(t,e){if(!e)return this.listeners.delete(t),this;const s=this.listeners.get(t);if(s){const i=s.filter(n=>n.handler!==e);i.length===0?this.listeners.delete(t):this.listeners.set(t,i)}return this}emit(t,...e){const s=this.listeners.get(t);if(!s||s.length===0)return!1;const i=[];for(const n of s)n.handler(...e),n.once||i.push(n);return i.length!==s.length&&(i.length===0?this.listeners.delete(t):this.listeners.set(t,i)),!0}removeAllListeners(t){return t?this.listeners.delete(t):this.listeners.clear(),this}listenerCount(t){var e;return((e=this.listeners.get(t))==null?void 0:e.length)??0}}class on{constructor(t,e){this._totalRows=0,this.$cW=0,this.$ef=0,this.$dT=null,this.$bx=()=>{this.$cW=this.container.scrollTop,this.$fq(!0)},this.container=t,this.rowHeight=e.rowHeight,this.overscan=e.overscan??5,this.onRender=e.onRender,this.$kf=e.requestRender??null,this.container.addEventListener("scroll",this.$bx,{passive:!0})}$fq(t=!1){const e=this.$kf;if(e!==null){const s=this.getVisibleRange();e(s.startIndex,s.endIndex,t);return}this.$dT===null&&(this.$dT=requestAnimationFrame(()=>{this.$dT=null;const s=this.getVisibleRange();this.onRender(s.startIndex,s.endIndex)}))}getVisibleRange(){const t=Math.ceil(this.$ef/this.rowHeight),e=Math.max(0,Math.floor(this.$cW/this.rowHeight)-this.overscan),s=Math.min(this._totalRows-1,e+t+this.overscan*2),i=e*this.rowHeight;return{startIndex:e,endIndex:s,offsetY:i}}setTotalRows(t){this._totalRows=t,this.$kP(),this.$fq()}setViewportHeight(t){t!==this.$ef&&(this.$ef=t,this.$fq())}setRowHeight(t){this.rowHeight=t,this.$kP(),this.$fq()}scrollToRow(t){const e=t*this.rowHeight,s=e+this.rowHeight,i=this.$cW+this.$ef;if(e<this.$cW)this.$cW=e,this.container.scrollTop=e;else if(s>i){const n=s-this.$ef;this.$cW=n,this.container.scrollTop=n}}getTotalHeight(){return this._totalRows*this.rowHeight}$kP(){const t=this.container.querySelector(".og-spacer");t&&(t.style.height=`${this.getTotalHeight()}px`)}destroy(){this.container.removeEventListener("scroll",this.$bx),this.$dT!==null&&cancelAnimationFrame(this.$dT)}}class fs{constructor(t,e=0){this.$bo=[],this.$W=1,this._frozenCount=0,this.$fF=null,this.$al=t,this._frozenCount=e,this.$fc()}$fc(){const t=[];let e=0;const s=(i,n)=>{for(const o of i)o.children&&o.children.length>0?(s(o.children,n+1),this.$W=Math.max(this.$W,n+1)):t.push({...o,_colIndex:e++,_depth:n,_leaf:!0})};this.$W=1,s(this.$al,1),this.$bo=t,this.$fF=null}get leaves(){return this.$bo}get visibleLeaves(){return this.$fF??(this.$fF=this.$bo.filter(t=>!t.hidden))}get headerDepth(){return this.$W}get frozenCount(){return this._frozenCount}setFrozen(t){this._frozenCount=t}setColumns(t){this.$al=t,this.$fc()}hideColumn(t){const e=Array.isArray(t)?t:[t];this.$bo.forEach(s=>{e.includes(s.field)&&(s.hidden=!0)}),this.$fF=null}showColumn(t){const e=Array.isArray(t)?t:[t];this.$bo.forEach(s=>{e.includes(s.field)&&(s.hidden=!1)}),this.$fF=null}addColumn(t,e="last"){e==="last"?this.$al.push(t):e==="first"?this.$al.unshift(t):this.$al.splice(e,0,t),this.$fc()}removeColumn(t){const e=s=>s.filter(i=>i.field===t?!1:(i.children&&(i.children=e(i.children)),!0));this.$al=e(this.$al),this.$fc()}getColumnByField(t){return this.$bo.find(e=>e.field===t)}getColumnByIndex(t){return this.$bo[t]}getColumnIndex(t){return this.$bo.findIndex(e=>e.field===t)}buildHeaderCells(){const t=Array.from({length:this.$W},()=>[]);let e=0;const s=(i,n)=>{let o=0;for(const l of i)if(!l.hidden)if(l.children&&l.children.length>0){const a=s(l.children,n+1);a>0&&(t[n-1].push({column:l,colIndex:e,depth:n,colSpan:a,rowSpan:1}),o+=a)}else t[n-1].push({column:l,colIndex:e++,depth:n,colSpan:1,rowSpan:this.$W-n+1}),o++;return o};return s(this.$al,1),t}computeWidths(t,e=100){const s=this.visibleLeaves,i=s.filter(a=>a.flex),n=s.filter(a=>!a.flex&&a.width).reduce((a,h)=>a+h.width,0),o=i.reduce((a,h)=>a+(h.flex??1),0),l=Math.max(0,t-n);return s.map(a=>a.flex?Math.round(a.flex/o*l):a.width??e)}}function ln(r,t){return r.indexOf("{")===-1?r:r.replace(/\{\{|\}\}|\{(\w+)\}/g,(e,s)=>{if(e==="{{")return"{";if(e==="}}")return"}";const i=t?t[s]:void 0;return i===void 0?e:String(i)})}const an={contextMenu:{sortAsc:"오름차순 정렬",sortDesc:"내림차순 정렬",find:"찾기",exportExcel:"Excel로 저장",exportCsv:"CSV로 저장",print:"인쇄"},filter:{title:"필터",opContains:"포함",opEq:"같음",opNe:"같지 않음",opStartsWith:"시작",opEndsWith:"끝남",opGt:"보다 큼",opLt:"보다 작음",opGte:"이상",opLte:"이하",valuePlaceholder:"필터 값 입력...",clear:"초기화",apply:"적용",legend:"필터",clearAria:"필터 초기화",all:"전체"},findBar:{label:"찾기",placeholder:"검색어 입력...",searchAria:"그리드 내 검색",closeAria:"찾기 닫기",countBadge:"{n}건"},pagination:{rowsPerPage:"행/페이지:",rangeBadge:"{from}–{to} / {total}건",empty:"0건"},drag:{rowCount:"{count}개 행 이동"},crossGrid:{overlayAria:"그리드 필드 매핑",title:"필드 매핑",desc1:"두 그리드의 필드 구조가 다릅니다. <b>타깃 필드</b>마다 어떤 <b>소스 필드</b>의 값을 가져올지 지정하세요. ",desc2:"아래 스크립트를 복사해 <code>crossGridMapping</code> 에 baking 하면 다음부터는 이 창 없이 자동 변환됩니다.",emptyOption:"(비움)",scriptTitle:"생성된 변환 스크립트",copy:"복사",copied:"복사됨!",copyFailed:"복사 실패",cancel:"취소",applyMove:"적용 후 이동",scriptComment:"// crossGridMapping 옵션에 이 함수를 그대로 지정하세요."},shuttle:{toRight:"체크한 행을 오른쪽 그리드로 이동",toLeft:"체크한 행을 왼쪽 그리드로 이동",allRight:"왼쪽 전체를 오른쪽으로 이동",allLeft:"오른쪽 전체를 왼쪽으로 이동"},tree:{collapse:"접기",expand:"펼치기"},detail:{glyphLabel:"▤ 상세",glyphTooltip:"상세 보기",expandAria:"상세 패널 펼치기",collapseAria:"상세 패널 접기",expandedAnnounce:"행 상세 패널을 펼쳤습니다.",collapsedAnnounce:"행 상세 패널을 접었습니다.",collapsedAllAnnounce:"모든 상세 패널을 접었습니다.",depthLimitOpen:"중첩 깊이 한계({max})로 상세 패널을 열 수 없습니다.",depthLimitSubgrid:"중첩 깊이 한계({max})로 서브 그리드를 생성하지 않습니다."},worksheet:{addAria:"새 워크시트 추가"},editor:{datePick:"날짜 선택",select:"선택",cellPositionAnnounce:"{row}행 {col}열, {header}: {value}"},cell:{emptyValue:"빈 값",revealTooltip:"클릭하면 원문 표시",revealAria:"마스킹 해제",radioAria:"선택",barcodeAria:"바코드: {value}"},row:{selectAllAria:"전체 행 선택",selectAria:"{n}행 선택",moveAnnounce:"행 {from}을(를) {to}번째 위치로 이동"},group:{badge:"{label} ({count}건)",nullLabel:"(없음)"},pivot:{totalLabel:"합계"},data:{loadedAnnounce:"{count}행 데이터 로드됨",skippedCellsAnnounce:"쓰기 대상이 아닌 셀 {count}개를 건너뛰었습니다"},range:{selectionAnnounce:"{r1}행 {c1}열 ~ {r2}행 {c2}열, {n}개 셀 선택",formulaPreserved:"수식 셀 {count}개 보존",fillSkipped:"채우기 대상이 아닌 셀 {count}개를 건너뛰었습니다",fillHandleAria:"채우기 핸들"},sort:{asc:"오름차순",desc:"내림차순",none:"정렬 해제",announce:"{field} {dir} 정렬"},chart:{defaultTitle:"차트",badgeSampled:"샘플링됨 {to}/{from}행",badgeAggregated:"category 집계됨 ({op})",badgePieFirstSeries:"파이: 첫 시리즈만 표시",badgeNegativesAbs:"음수→절대값 표시 · bar 권장",badgeRangeFallback:"범위 소스 없음 · 선택 행으로 대체",badgeEngineFallback:"{engine} 미설치 · 내장 차트로 대체",announcePrefix:"차트 안내: {badges}",a11ySummary:"{title}: 카테고리 {categories}개, 시리즈 {series}",a11ySummaryNoTitle:"카테고리 {categories}개, 시리즈 {series}",a11yAltText:"{title}: {categories}개 카테고리별 {series} — 상세 값은 아래 표를 참고하세요",a11yNoData:"데이터 없음",tooltipEmpty:"없음",canvasDefault:"차트"},formulaError:{err:"수식 오류",ref:"참조 대상이 삭제됨",cycle:"순환 참조",div0:"0으로 나눔",name:"알 수 없는 함수/이름",value:"숫자가 아닌 값에 산술 연산",num:"수치 도메인 오류",fallback:"수식 오류"},formula:{cellErrorAnnounce:"{field} 셀 오류: {message}",ariaError:"수식 {src}, 오류: {message}",ariaValue:"수식 {src}, 값 {value}{approx}",approxSuffix:" (근사값)"},grid:{containerAria:"OPEN_GRID 데이터 그리드",emptyMessage:"데이터가 없습니다.",filterTooltip:"필터",detailRegion:"상세 내용"},export:{printSummary:"{rows}행 × {cols}열 · {date}",preparing:"내보내기를 준비하고 있어요…",exporting:"{done} / {total}행 내보내는 중 ({percent}%)",cancel:"취소",cancelled:"내보내기를 취소했어요",done:"내보내기를 마쳤어요",exportError:"내보내기에 실패했어요"}},hn={intlLocale:"ko-KR",dir:"ltr",exportFont:"맑은 고딕"},cn={contextMenu:{sortAsc:"Sort ascending",sortDesc:"Sort descending",find:"Find",exportExcel:"Save as Excel",exportCsv:"Save as CSV",print:"Print"},filter:{title:"Filter",opContains:"Contains",opEq:"Equals",opNe:"Not equal",opStartsWith:"Starts with",opEndsWith:"Ends with",opGt:"Greater than",opLt:"Less than",opGte:"At least",opLte:"At most",valuePlaceholder:"Enter filter value...",clear:"Reset",apply:"Apply",legend:"Filter",clearAria:"Reset filter",all:"All"},findBar:{label:"Find",placeholder:"Enter search term...",searchAria:"Search within grid",closeAria:"Close find",countBadge:r=>r.n===1?"1 match":`${r.n} matches`},pagination:{rowsPerPage:"Rows per page:",rangeBadge:"{from}–{to} of {total}",empty:"0 rows"},drag:{rowCount:r=>r.count===1?"Move 1 row":`Move ${r.count} rows`},crossGrid:{overlayAria:"Grid field mapping",title:"Field mapping",desc1:"The two grids have different field structures. For each <b>target field</b>, choose which <b>source field</b> to pull its value from. ",desc2:"Copy the script below and bake it into <code>crossGridMapping</code> to convert automatically without this dialog next time.",emptyOption:"(none)",scriptTitle:"Generated conversion script",copy:"Copy",copied:"Copied!",copyFailed:"Copy failed",cancel:"Cancel",applyMove:"Apply and move",scriptComment:"// Assign this function to the crossGridMapping option as-is."},shuttle:{toRight:"Move checked rows to the right grid",toLeft:"Move checked rows to the left grid",allRight:"Move all from left to right",allLeft:"Move all from right to left"},tree:{collapse:"Collapse",expand:"Expand"},detail:{glyphLabel:"▤ Detail",glyphTooltip:"View detail",expandAria:"Expand detail panel",collapseAria:"Collapse detail panel",expandedAnnounce:"Row detail panel expanded.",collapsedAnnounce:"Row detail panel collapsed.",collapsedAllAnnounce:"All detail panels collapsed.",depthLimitOpen:"Nesting depth limit ({max}) reached — cannot open the detail panel.",depthLimitSubgrid:"Nesting depth limit ({max}) reached — subgrid will not be created."},worksheet:{addAria:"Add new worksheet"},editor:{datePick:"Pick a date",select:"Select",cellPositionAnnounce:"Row {row}, column {col}, {header}: {value}"},cell:{emptyValue:"empty",revealTooltip:"Click to reveal the original",revealAria:"Reveal masked value",radioAria:"Select",barcodeAria:"Barcode: {value}"},row:{selectAllAria:"Select all rows",selectAria:"Select row {n}",moveAnnounce:"Move row {from} to position {to}"},group:{badge:"{label} ({count})",nullLabel:"(none)"},pivot:{totalLabel:"Total"},data:{loadedAnnounce:r=>r.count===1?"1 row loaded":`${r.count} rows loaded`,skippedCellsAnnounce:r=>r.count===1?"Skipped 1 non-writable cell":`Skipped ${r.count} non-writable cells`},range:{selectionAnnounce:"Selected {n} cells from row {r1} column {c1} to row {r2} column {c2}",formulaPreserved:r=>r.count===1?"1 formula cell preserved":`${r.count} formula cells preserved`,fillSkipped:r=>r.count===1?"Skipped 1 non-fillable cell":`Skipped ${r.count} non-fillable cells`,fillHandleAria:"Fill handle"},sort:{asc:"ascending",desc:"descending",none:"unsorted",announce:"{field} sorted {dir}"},chart:{defaultTitle:"Chart",badgeSampled:"Sampled {to}/{from} rows",badgeAggregated:"Category aggregated ({op})",badgePieFirstSeries:"Pie: first series only",badgeNegativesAbs:"Negatives shown as absolute · bar recommended",badgeRangeFallback:"No range source · using selected rows",badgeEngineFallback:"{engine} not installed · using built-in chart",announcePrefix:"Chart notice: {badges}",a11ySummary:"{title}: {categories} categories, series {series}",a11ySummaryNoTitle:"{categories} categories, series {series}",a11yAltText:"{title}: {series} across {categories} categories — see the table below for detailed values",a11yNoData:"No data",tooltipEmpty:"none",canvasDefault:"Chart"},formulaError:{err:"Formula error",ref:"Reference was deleted",cycle:"Circular reference",div0:"Division by zero",name:"Unknown function/name",value:"Arithmetic on a non-numeric value",num:"Numeric domain error",fallback:"Formula error"},formula:{cellErrorAnnounce:"{field} cell error: {message}",ariaError:"Formula {src}, error: {message}",ariaValue:"Formula {src}, value {value}{approx}",approxSuffix:" (approx.)"},grid:{containerAria:"OPEN_GRID data grid",emptyMessage:"No data.",filterTooltip:"Filter",detailRegion:"Detail"},export:{printSummary:"{rows} rows × {cols} cols · {date}",preparing:"Preparing export…",exporting:"Exporting {done} / {total} rows ({percent}%)",cancel:"Cancel",cancelled:"Export cancelled",done:"Export complete",exportError:"Export failed"}},dn={intlLocale:"en-US",dir:"ltr",exportFont:"Calibri"};function gs(r){const t=r.indexOf(".");return t<0?[r,""]:[r.slice(0,t),r.slice(t+1)]}function te(r,t){if(!r)return;const[e,s]=gs(t),i=r[e];return i?i[s]:void 0}function ps(r,t){const e={};for(const s of Object.keys(r))e[s]={...r[s]};for(const s of Object.keys(t))e[s]={...e[s]??{},...t[s]};return e}class me{constructor(t){this._locales=new Map,this._meta=new Map,this.$iy=new Map,this.$aB={},this.$h=new Map,this.$aq=new Set,this._parent=t,this.$E=t?t.$E:"ko"}register(t,e,s){return this._locales.set(t,e),s!=null&&s.extends&&this.$iy.set(t,s.extends),this.$h.clear(),{missingKeys:this.$kX().filter(o=>te(e,o)===void 0)}}extend(t,e){const s=this._locales.get(t)??{};return this._locales.set(t,ps(s,e)),this.$h.clear(),this}has(t){var e;return this._locales.has(t)||(((e=this._parent)==null?void 0:e.has(t))??!1)}get(t){return this._locales.get(t)}list(){const t=new Set(this._locales.keys());if(this._parent)for(const e of this._parent.list())t.add(e);return[...t]}setActive(t){if(!this.has(t)&&t!=="ko"){typeof console<"u"&&console.warn(`[LocaleRegistry] 미등록 로케일 "${t}" — 무시하고 현재 로케일 유지. / unknown locale, keeping current.`);return}this.$E=t}active(){return this.$E}child(){return new me(this)}setOverride(t,e){var s;const[i,n]=gs(t),o=(s=this.$aB)[i]??(s[i]={});return o[n]=e,this.$h.clear(),this}applyOverrides(t){return this.$aB=ps(this.$aB,t),this.$h.clear(),this}t(t,e){const s=this.$mW(t);return s===void 0?(this.$aq.has(t)||(this.$aq.add(t),typeof console<"u"&&console.warn(`[LocaleRegistry] 미등록 메시지 키 "${t}" — 키 원문 반환. / unknown message key, returning the key.`)),t):typeof s=="function"?s(e??{}):ln(s,e)}meta(){return this.$ki(this.$E)??this.$ki("ko")??{intlLocale:this.$E}}$mW(t){const e=`${this.$E}\0${t}`,s=this.$h.get(e);if(s!==void 0)return s===null?void 0:s;const i=this.$cR(t);return this.$h.set(e,i===void 0?null:i),i}$cR(t){const e=this.$E;for(let i=this;i;i=i._parent){const n=te(i.$aB,t);if(n!==void 0)return n;const o=te(i._locales.get(e),t);if(o!==void 0)return o}const s=this.$lM(e);if(s&&s!==e&&this.$kh(s)!==void 0){const n=ms(this,s,t);if(n!==void 0)return n}if(e!=="ko"){const i=ms(this,"ko",t);if(i!==void 0)return i}}$kh(t){for(let e=this;e;e=e._parent){const s=e._locales.get(t);if(s)return s}}$lM(t){for(let e=this;e;e=e._parent){const s=e.$iy.get(t);if(s)return s}}$ki(t){for(let e=this;e;e=e._parent){const s=e._meta.get(t);if(s)return s}}$kX(){const t=this.$kh("ko");if(!t)return[];const e=[];for(const s of Object.keys(t)){const i=t[s];if(i)for(const n of Object.keys(i))e.push(`${s}.${n}`)}return e}_seed(t,e,s){this._locales.set(t,e),this._meta.set(t,s)}}function ms(r,t,e){for(let s=r;s;s=s._parent){const i=te(s._locales.get(t),e);if(i!==void 0)return i}}const st=new me;st._seed("ko",an,hn),st._seed("en",cn,dn);function B(r,t){return st.t(r,t)}class un{constructor(t,e,s,i){this._field="",this.$bX=null,this.$jC=e,this.$gN=s,this._t=i??B,this.$d=document.createElement("div"),this.$d.className="og-filter-panel",this.$d.style.cssText=`
|
|
2
|
+
position:absolute;z-index:1000;min-width:200px;max-width:280px;
|
|
3
|
+
background:var(--og-row-bg,#fff);border:1px solid var(--og-border-color,#e0e0e0);
|
|
4
|
+
border-radius:var(--og-radius-md,4px);box-shadow:0 4px 16px rgba(0,0,0,0.15);
|
|
5
|
+
padding:10px;box-sizing:border-box;display:none;font-size:13px;
|
|
6
|
+
`,t.appendChild(this.$d)}open(t,e,s){var i;this._field=t,this.$d.innerHTML="";const n=document.createElement("div");n.textContent=this._t("filter.title"),n.style.cssText="font-weight:600;margin-bottom:8px;color:var(--og-text-color,#333);",this.$d.appendChild(n);const o=document.createElement("div");o.style.cssText="display:flex;gap:4px;margin-bottom:6px;";const l=document.createElement("select");l.style.cssText="flex:1;padding:3px 4px;border:1px solid var(--og-border-color,#e0e0e0);border-radius:var(--og-radius-md,3px);font-size:12px;";const a=[{label:this._t("filter.opContains"),value:"contains"},{label:this._t("filter.opEq"),value:"="},{label:this._t("filter.opNe"),value:"!="},{label:this._t("filter.opStartsWith"),value:"startsWith"},{label:this._t("filter.opEndsWith"),value:"endsWith"},{label:this._t("filter.opGt"),value:">"},{label:this._t("filter.opLt"),value:"<"},{label:this._t("filter.opGte"),value:">="},{label:this._t("filter.opLte"),value:"<="}];for(const p of a){const v=document.createElement("option");v.value=p.value,v.textContent=p.label,l.appendChild(v)}s[0]&&(l.value=s[0].operator),o.appendChild(l),this.$d.appendChild(o);const h=document.createElement("input");h.type="text",h.placeholder=this._t("filter.valuePlaceholder"),h.value=((i=s[0])==null?void 0:i.value)??"",h.style.cssText=`
|
|
7
|
+
width:100%;padding:4px 6px;border:1px solid var(--og-border-color,#e0e0e0);
|
|
8
|
+
border-radius:var(--og-radius-md,3px);font-size:12px;box-sizing:border-box;margin-bottom:8px;
|
|
9
|
+
outline:none;
|
|
10
|
+
`,h.addEventListener("keydown",p=>{p.key==="Enter"?d.click():p.key==="Escape"&&this.close()}),this.$d.appendChild(h);const c=document.createElement("div");c.style.cssText="display:flex;gap:6px;justify-content:flex-end;";const u=document.createElement("button");u.textContent=this._t("filter.clear"),u.style.cssText=`
|
|
11
|
+
padding:3px 10px;border:1px solid var(--og-border-color,#e0e0e0);
|
|
12
|
+
border-radius:var(--og-radius-md,3px);background:#fff;cursor:pointer;font-size:12px;color:#666;
|
|
13
|
+
`,u.addEventListener("click",()=>{this.$gN(this._field),this.close()});const d=document.createElement("button");d.textContent=this._t("filter.apply"),d.style.cssText=`
|
|
14
|
+
padding:3px 10px;border:1px solid var(--og-primary,#1976d2);
|
|
15
|
+
border-radius:var(--og-radius-md,3px);background:var(--og-primary,#1976d2);
|
|
16
|
+
color:#fff;cursor:pointer;font-size:12px;
|
|
17
|
+
`,d.addEventListener("click",()=>{const p=h.value.trim();p?this.$jC(this._field,[{operator:l.value,value:p}]):this.$gN(this._field),this.close()}),c.appendChild(u),c.appendChild(d),this.$d.appendChild(c);const g=e.getBoundingClientRect(),f=this.$d.parentElement.getBoundingClientRect();this.$d.style.top=`${g.bottom-f.top+2}px`,this.$d.style.left=`${Math.min(g.left-f.left,f.width-220)}px`,this.$d.style.display="block",requestAnimationFrame(()=>h.focus()),this.$bX&&document.removeEventListener("mousedown",this.$bX),this.$bX=p=>{!this.$d.contains(p.target)&&p.target!==e&&this.close()},setTimeout(()=>document.addEventListener("mousedown",this.$bX),0)}close(){this.$d.style.display="none",this.$bX&&(document.removeEventListener("mousedown",this.$bX),this.$bX=null)}get isOpen(){return this.$d.style.display!=="none"}destroy(){this.close(),this.$d.remove()}}const fn="#e0e0e0";class ee{constructor(t="default",e="default"){this.theme=t,this.skin=e}}class _e{constructor(t=new ee){this.$G=t}get context(){return this.$G}$hs(){return this.$G.skin!=="default"}setSkin(t){this.$G=new ee(this.$G.theme,t)}$fL(){return`var(--og-border-color,${fn})`}border(t){let e=(t==null?void 0:t.style)??"solid";if(t!=null&&t.state&&(e="solid"),this.$hs()){const s="var(--og-border-width, 1px)",i=t!=null&&t.state?"solid":`var(--og-border-style, ${e})`;return`${s} ${i} ${this.$fL()}`}return`1px ${e} ${this.$fL()}`}divider(){return this.$hs()?`var(--og-border-width, 1px) var(--og-divider-style, solid) ${this.$fL()}`:this.border()}texture(t){return t==="data"||t==="status"||t==="range"||t==="merge"||t==="focus"?"none":"var(--og-texture-bg, none)"}radius(t){return`${t}px`}cellPadding(){return"2px 8px"}elevation(t="md"){const e={sm:"0 1px 2px",md:"0 2px 6px",lg:"0 8px 24px"},s={sm:"0.07",md:"0.10",lg:"0.14"};return`var(--og-elevation-${t}, ${e[t]}) rgba(var(--og-shadow-ink, 0 0 0), var(--og-elevation-alpha-${t}, ${s[t]}))`}focusRing(t){let e=(t==null?void 0:t.width)??2,s=(t==null?void 0:t.style)??"solid";e<2&&(e=2),s==="none"&&(s="solid");const i=(t==null?void 0:t.color)??"var(--og-focus-border,var(--og-primary,#1976d2))";return this.$hs()&&(t==null?void 0:t.width)===void 0&&(t==null?void 0:t.style)===void 0?`var(--og-focus-width, 2px) var(--og-focus-style, solid) ${i}`:`${e}px ${s} ${i}`}}const kt=new _e;function D(r,t){const e=document.createElement(r);return t&&(e.className=t),e}function vs(r,t){Object.assign(r.style,t)}class gn{constructor(){this.$k=new Map}set(t,e,s){let i=this.$k.get(t);i||(i=new Map,this.$k.set(t,i)),i.set(e,s)}setRow(t,e){this.$k.set(t,e)}get(t,e){var s;return(s=this.$k.get(t))==null?void 0:s.get(e)}*cellsOfColumn(t){for(const e of this.$k.values()){const s=e.get(t);s&&(yield s)}}dropRow(t){this.$k.delete(t)}dropColumn(t,e){var s;(s=this.$k.get(t))==null||s.delete(e)}clear(){this.$k.clear()}get size(){let t=0;for(const e of this.$k.values())t+=e.size;return t}}function pn(r,t){return Math.min(t.max,Math.max(t.min,r))}function ws(r,t){return Number.isFinite(t)?pn(r.startWidth+(t-r.pressX),r):r.width}function ys(r,t){return t===r.startWidth?null:{ci:r.ci,width:t}}const dt=()=>null,Nt=()=>{},pt={phase:"idle",press:(r,t,e,s,i)=>r.begin(t,e,s,i),move:dt,release:dt,cancel:dt,lose:dt,consumeClick:()=>!1,expireSwallow:Nt},mn={phase:"pressed",press:Nt,move:(r,t)=>t===r.d.pressX||!Number.isFinite(t)?null:(r.to(se),se.move(r,t)),release:(r,t)=>t===r.d.pressX||!Number.isFinite(t)?(r.to(ie),null):(r.to(se),se.release(r,t)),cancel:r=>(r.to(pt),null),lose:r=>(r.to(pt),null),consumeClick:r=>(r.to(pt),!0),expireSwallow:Nt},se={phase:"dragging",press:Nt,move:(r,t)=>{const e=ws(r.d,t);return e===r.d.width?null:(r.d.width=e,e)},release:(r,t)=>{const e=ws(r.d,t);return r.d.width=e,r.to(ie),ys(r.d,e)},cancel:r=>(r.to(ie),{ci:r.d.ci,width:r.d.startWidth}),lose:r=>(r.to(ie),ys(r.d,r.d.width)),consumeClick:()=>!0,expireSwallow:Nt},ie={phase:"swallowing",press:(r,t,e,s,i)=>r.begin(t,e,s,i),move:dt,release:dt,cancel:dt,lose:dt,consumeClick:r=>(r.to(pt),!0),expireSwallow:r=>r.to(pt)};class vn{constructor(){this.$f=pt;const t={ci:-1,startWidth:0,pressX:0,min:0,max:1/0,width:0};this.$aZ={d:t,to:e=>{this.$f=e,e===pt&&(t.ci=-1)},begin:(e,s,i,n)=>{if(!(n.min<=n.max))throw new RangeError(`invalid resize bounds: min ${n.min} > max ${n.max}`);!Number.isFinite(i)||!Number.isFinite(s)||(t.ci=e,t.startWidth=s,t.pressX=i,t.min=n.min,t.max=n.max,t.width=s,this.$f=mn)}}}get phase(){return this.$f.phase}get column(){return this.$aZ.d.ci}press(t,e,s,i){this.$f.press(this.$aZ,t,e,s,i)}move(t){return this.$f.move(this.$aZ,t)}release(t){return this.$f.release(this.$aZ,t)}cancel(){return this.$f.cancel(this.$aZ)}lose(){return this.$f.lose(this.$aZ)}consumeClick(){return this.$f.consumeClick(this.$aZ)}expireSwallow(){this.$f.expireSwallow(this.$aZ)}}const wn=6;class yn{constructor(t=wn){this.$eG=t}columnFor(t,e,s,i){if(!Number.isFinite(t)||!Number.isFinite(e)||s<0)return-1;const n=e-t,o=n>=-this.$eG&&n<=this.$eG&&i(s),l=t>=-this.$eG&&t<=this.$eG&&s>0&&i(s-1);return o&&l?n<=t?s:s-1:o?s:l?s-1:-1}}const z={RowsScrolled:1,ColsScrolled:2,ColWidth:4,RowSet:8,RowOrder:16,RowState:32,Focus:64,CellValue:128,Range:256,Columns:512,Viewport:1024,Appearance:2048,SortIndicator:4096,All:8191},j=r=>r,ne=r=>r,L=r=>r;function bn(r,t,e,s){return{x:j(r),y:j(t),w:j(Math.max(0,e)),h:j(Math.max(0,s))}}const Z=Object.freeze([]);function xe(r,t){return r.ri!==t.ri?r.ri-t.ri:r.field<t.field?-1:r.field>t.field?1:0}function _n(r){return Object.isFrozen(r)?r:Object.freeze({ri:r.ri,field:r.field})}function xn(r){if(!Object.isFrozen(r))return!1;for(let t=0;t<r.length;t++)if(!Object.isFrozen(r[t])||t>0&&xe(r[t-1],r[t])>=0)return!1;return!0}function Ce(r){if(r.length===0)return Z;if(xn(r))return r;const t=r.slice().sort(xe),e=[];for(let s=0;s<t.length;s++){const i=t[s],n=e[e.length-1];n!==void 0&&n.ri===i.ri&&n.field===i.field||e.push(_n(i))}return Object.freeze(e)}function Cn(r,t){if(t.length===0)return r;if(r.length===0)return t;const e=[];let s=0,i=0;for(;s<r.length||i<t.length;){const n=r[s],o=t[i],l=n===void 0?1:o===void 0?-1:xe(n,o);l<=0&&s++,l>=0&&i++,e.push(l<=0?n:o)}return Object.freeze(e)}function Rn(r){return r===null||r==="clear"||Object.isFrozen(r)?r:Object.freeze({start:r.start,end:r.end})}function En(r){return r===null||Object.isFrozen(r)?r:Object.freeze({ri:r.ri,ci:r.ci})}function kn(r,t){return r===null?t:t===null||r<t?r:t}const tt=class es{constructor(t,e,s,i,n,o){this.changes=t,this.detail=Object.freeze({cells:e,focusTo:s,widthChangedFrom:i,rows:n,sync:o}),Object.freeze(this)}static of(t,e){if(!Number.isInteger(t)||t<0||t&-8192)throw new RangeError(`RenderRequest: unknown change bits ${t}`);return new es(t,Ce((e==null?void 0:e.cells)??Z),En((e==null?void 0:e.focusTo)??null),(e==null?void 0:e.widthChangedFrom)??null,Rn((e==null?void 0:e.rows)??null),(e==null?void 0:e.sync)??!1)}static rowsInclusive(t,e){return es.of(z.All,{sync:!0,rows:{start:ne(t),end:ne(e+1)}})}has(t){return(this.changes&t)!==0}merge(t){return new bs().add(this).add(t).freeze()}};tt.NONE=new tt(0,Z,null,null,null,!1),tt.REPAINT_VISIBLE=new tt(z.All,Z,null,null,null,!0),tt.REPAINT_CLEAR=new tt(z.All,Z,null,null,"clear",!0),tt.ROW_STATE=new tt(z.RowState,Z,null,null,null,!0),tt.SCROLLED=new tt(z.RowsScrolled,Z,null,null,null,!1),tt.WINDOW_CHANGED=new tt(z.All,Z,null,null,null,!1);let F=tt;class bs{constructor(){this._mask=0,this.$gm=null,this.$fG=null,this.$k=null,this.$cZ=!1,this.$ap=!1,this.$ct=Z,this.$cu=Z,this.$c=null}get pending(){return this.$ap}add(t){const e=t.detail;return this.$ap=!0,this._mask|=t.changes,e.focusTo!==null&&(this.$gm=e.focusTo),e.rows!==null&&(this.$k=e.rows),this.$fG=kn(this.$fG,e.widthChangedFrom),this.$cZ=this.$cZ||e.sync,e.cells.length>0&&this.$kV(t instanceof F?e.cells:Ce(e.cells)),this}freeze(){const t=F.of(this._mask,{cells:this.$lW(),focusTo:this.$gm,widthChangedFrom:this.$fG,rows:this.$k,sync:this.$cZ});return this.clear(),t}clear(){this._mask=0,this.$gm=null,this.$fG=null,this.$k=null,this.$cZ=!1,this.$ap=!1,this.$ct=Z,this.$cu=Z,this.$c=null}$kV(t){if(this.$c===null){if(this.$ct.length===0){this.$ct=t;return}if(this.$cu.length===0){this.$cu=t;return}this.$c=new Map,this.$gY(this.$ct),this.$gY(this.$cu),this.$ct=Z,this.$cu=Z}this.$gY(t)}$gY(t){const e=this.$c;for(let s=0;s<t.length;s++){const i=t[s];e.set(`${i.ri}\0${i.field}`,i)}}$lW(){return this.$c!==null?Ce([...this.$c.values()]):Cn(this.$ct,this.$cu)}}const Mn={min:40,max:1/0},Sn="col-resize";class An{constructor(t,e){this.$mN=t,this.$bj=e,this.$eC=new vn,this.$nx=new yn,this.$fl=new Map,this.$eP=new Map,this.$gB=new WeakMap,this.$eI=null,this.$dr=null,this.$hj="",this.$jR=null,this.$L=null,this.$bl=null,this.$jh=()=>NaN}clear(t){this.$hq=t,this.$fl.clear(),this.$eP.clear(),this.$gB=new WeakMap,this.$fm()}connect(t){this.$jR=t}destroy(){var t,e,s;(t=this.$L)==null||t.end(),this.$L=null,(e=this.$bl)==null||e.abort(),this.$bl=null,this.clear(),(s=this.$eI)==null||s.abort(),this.$eI=null}bindHeader(t,e){var s;this.$jh=e,(s=this.$eI)==null||s.abort();const i=new AbortController;this.$eI=i;const n={signal:i.signal};t.addEventListener("mousemove",l=>this.$me(l),n),t.addEventListener("mouseleave",()=>this.$fm(),n);const o=l=>{if(this.$L){l.type==="mousedown"&&l.preventDefault();return}if(l.button!==0)return;const a=this.$iT(l);a&&this.$hN(l,a.th,a.ci)};t.addEventListener("pointerdown",o,n),t.addEventListener("mousedown",o,n)}leaf(t,e){e>=0&&this.$gB.set(t,e)}attach(t,e,s,i){s>=0&&(this.$fl.set(s,e),i!==void 0&&this.$eP.set(i,s));const n=l=>{if(this.$L){l.type==="mousedown"&&(l.stopPropagation(),l.preventDefault());return}l.button===0&&this.$hN(l,e,s)},o=this.$hq&&{signal:this.$hq};t.addEventListener("pointerdown",n,o),t.addEventListener("mousedown",n,o)}shouldSwallowClick(t){return this.$eC.consumeClick()}$iT(t){var e,s;const i=t.target;if(!i||(e=i.classList)!=null&&e.contains("og-resize-handle"))return null;const n=(s=i.closest)==null?void 0:s.call(i,"th");if(!n)return null;const o=this.$gB.get(n);if(o===void 0)return null;const l=this.$nx.columnFor(Fn(t,i,n),this.$jh(o),o,h=>this.$fl.has(h)),a=l>=0?this.$fl.get(l):void 0;return a?{ci:l,th:a,cell:n}:null}$me(t){if(this.$eC.phase==="dragging"||this.$eC.phase==="pressed")return;const e=this.$iT(t);if(!e){this.$fm();return}const s=e.cell;this.$dr!==s&&(this.$fm(),this.$dr=s,this.$hj=s.style.cursor,s.style.cursor=Sn)}$fm(){this.$dr&&(this.$dr.style.cursor=this.$hj),this.$dr=null,this.$hj=""}$hN(t,e,s){var i;t.type==="mousedown"&&(t.stopPropagation(),t.preventDefault());const n=this.$eC,o=this.$jR,l=s>=0,a=o&&l?o.geometry.widthOf(L(s)):this.$mN(e);if(n.press(s,a,t.clientX,o&&l?o.sink.boundsOf(s):Mn),n.phase!=="pressed")return;const h=e.ownerDocument,c=h.defaultView,u="pointerId"in t&&typeof t.pointerId=="number"&&t.type==="pointerdown"?t.pointerId:null,d=t.target;let g;for(const[x,T]of this.$eP)if(T===s){g=x;break}const f=()=>g===void 0?s:this.$eP.get(g)??-1,p=new AbortController,v={signal:p.signal},w={ci:s,th:e,pointerId:u,lastWritten:a,end:()=>{p.abort(),this.$L===w&&(this.$L=null)}};this.$L=w;const m=(x,T)=>{if(l&&o){const O=f();if(O<0)return;o.widths.setWidth(L(O),x),w.lastWritten=x,o.scheduler.submit(F.of(z.ColWidth,{widthChangedFrom:O,sync:T}))}else l||(e.style.width=`${x}px`,e.style.minWidth=`${x}px`)},b=()=>l&&!!o&&f()<0,y=()=>{const x=c??globalThis,T=O=>{n.consumeClick()&&O.stopPropagation()};x.addEventListener("click",T,{capture:!0,once:!0}),x.requestAnimationFrame(()=>{x.removeEventListener("click",T,{capture:!0}),n.expireSwallow()})},R=()=>{n.cancel(),w.end(),y()},_=x=>{if(b()){R();return}w.end(),!x&&l&&o&&w.lastWritten!==a&&m(a,!0),x&&l&&(o?(x.width!==w.lastWritten&&m(x.width,!0),o.sink.commit(f(),x.width),o.sink.needsHeaderRemeasure()&&o.sink.remeasureHeader()):this.$bj(s,x.width)),y()},S=x=>{if(u!==null&&x.pointerId!==u)return;if(b()){R();return}const T=n.move(x.clientX);T!==null&&m(T,!1)},M=x=>{u!==null&&x.pointerId!==u||_(n.release(x.clientX))},C=x=>{var T;if(x.key!=="Escape")return;x.preventDefault(),x.stopPropagation();const O=n.cancel();w.end(),(O&&l&&o||O&&!l)&&m(O.width,!1),(T=this.$bl)==null||T.abort();const P=new AbortController;this.$bl=P;const K=()=>{P.abort(),this.$bl===P&&(this.$bl=null),y()};h.addEventListener(u!==null?"pointerup":"mouseup",K,{capture:!0,signal:P.signal}),u!==null&&h.addEventListener("pointercancel",K,{capture:!0,signal:P.signal}),c==null||c.addEventListener("blur",()=>{P.abort(),this.$bl===P&&(this.$bl=null),n.expireSwallow()},{signal:P.signal})},E=()=>_(n.lose());if(u!==null){h.addEventListener("pointermove",S,v),h.addEventListener("pointerup",M,v),h.addEventListener("pointercancel",E,v);try{(i=d==null?void 0:d.setPointerCapture)==null||i.call(d,u)}catch{}d==null||d.addEventListener("lostpointercapture",()=>{d.isConnected&&E()},v)}else h.addEventListener("mousemove",S,v),h.addEventListener("mouseup",M,v);h.addEventListener("keydown",C,{signal:p.signal,capture:!0}),c==null||c.addEventListener("blur",E,v)}}function Fn(r,t,e){let s=r.offsetX,i=t;for(;i&&i!==e;)s+=i.offsetLeft,i=i.offsetParent;return i===e?s:NaN}class In{constructor(t,e,s,i,n){this.$N=t,this.$T=e,this.$l=s,this.$aP=i,this.$bF=n,this.$e=null,this.$V=0,this.$hv=null,this.$t=null,this.$bE=null,this.$ae=new AbortController,this.$aP.bindHeader(this.$N,o=>this.$e?this.$e.widthOf(o):NaN)}setGeometry(t){this.$e=t}setEndGutter(t){t!==this.$V&&(this.$V=t,this.$hv&&(this.$hv.style.marginRight=t>0?`${t}px`:"0px"))}setSortIndicator(t){this.$bE=t}destroy(){this.$ae.abort(),this.$aP.destroy()}setApplier(t){this.$t=t}_t(t,e){return this.$bF(t,e)}height(){return this.$N.offsetHeight}paint(t,e,s,i,n){var o,l,a,h;this.$N.innerHTML="",this.$ae.abort(),this.$ae=new AbortController;const c=this.$ae.signal;this.$aP.clear(c),(o=this.$bE)==null||o.release();const u=this.$t;u==null||u.release("header");const d=this.$T,g=n._frozenCount??0,f=this.$e,p=f.extra,v=f.totalWidth();this.$N.style.background="var(--og-header-bg,#f5f5f5)";const w=D("table","og-header-table");w.setAttribute("role","presentation"),w.style.cssText=`table-layout:fixed;border-collapse:collapse;border-spacing:0;margin:0;width:${v}px;background:var(--og-header-bg,#f5f5f5);`,u==null||u.trackTotal(w,"width","header"),this.$V>0&&(w.style.marginRight=`${this.$V}px`),this.$hv=w;const m=t.length,b=(_,S,M,C="")=>{const E=p.widthOf(S),x=D("th",`og-header-cell og-extra-col ${C}`);x.setAttribute("rowspan",String(m)),x.textContent=M,vs(x,{width:`${E}px`,minWidth:`${E}px`,textAlign:"center",borderRight:d.border(),borderBottom:d.border(),borderTop:"0",borderLeft:"0",lineHeight:"normal",verticalAlign:"middle",padding:"0",fontSize:"11px",color:"#999",userSelect:"none",boxSizing:"border-box",background:"var(--og-header-bg,#f5f5f5)"}),g>0&&(x.style.position="sticky",x.style.left=`${p.leftOf(S)}px`,x.style.zIndex="4"),_.appendChild(x)},R={state:_=>b(_,"state",""),drag:_=>b(_,"drag",""),rowNumber:_=>b(_,"rowNumber","No"),check:_=>{const S=p.widthOf("check"),M=D("th","og-header-cell og-extra-col");M.setAttribute("rowspan",String(m)),M.style.cssText=`width:${S}px;min-width:${S}px;text-align:center;border-right:${d.border()};border-bottom:${d.border()};border-top:0;border-left:0;line-height:normal;vertical-align:middle;background:var(--og-header-bg,#f5f5f5);box-sizing:border-box;`,g>0&&(M.style.position="sticky",M.style.left=`${p.leftOf("check")}px`,M.style.zIndex="4");const C=document.createElement("input");C.type="checkbox",C.setAttribute("aria-label",this._t("row.selectAllAria")),C.style.cssText="width:16px;height:16px;",C.addEventListener("change",()=>this.$l.onAllCheck(C.checked),{signal:c}),M.appendChild(C),_.appendChild(M)},detail:_=>b(_,"detail","","og-detail-toggle-col")};for(let _=0;_<t.length;_++){const S=D("tr","og-header-row");if(S.style.height=`${n.headerHeight}px`,_===0)for(const M of p.ids)R[M](S);for(const M of t[_]??[]){const C=D("th","og-header-cell"),E=M.column;M.colSpan>1&&(C.colSpan=M.colSpan),M.rowSpan>1&&(C.rowSpan=M.rowSpan);const x=M.colSpan===1?e.findIndex(I=>I.field===E.field):-1;if(M.colSpan===1){const I=x>=0?f.widthOf(x):E.width??n.defaultColumnWidth;C.style.width=`${I}px`,C.style.minWidth=`${I}px`,x>=0&&(u==null||u.trackHeaderCell(C,x,"wm"))}const T=i.find(I=>I.field===E.field),O=E.sortable!==!1&&n.sortable&&M.colSpan===1;C.setAttribute("role","columnheader"),C.setAttribute("scope","col"),O&&(C.classList.add("og-sortable"),C.setAttribute("aria-sort",T?T.dir==="asc"?"ascending":"descending":"none"),C.tabIndex=x===0?0:-1,C.addEventListener("keydown",I=>{if(I.key==="Enter"||I.key===" ")I.preventDefault(),this.$l.onHeaderClick(E.field,I.shiftKey);else if(I.key==="ArrowRight"){I.preventDefault();const G=C.nextElementSibling;(G==null?void 0:G.tagName)==="TH"&&G.focus()}else if(I.key==="ArrowLeft"){I.preventDefault();const G=C.previousElementSibling;(G==null?void 0:G.tagName)==="TH"&&G.focus()}},{signal:c})),x>=0&&x<g&&(C.classList.add("og-frozen"),x===g-1&&C.classList.add("og-frozen-last"),C.style.left=`${f.leftOf(x)}px`,u==null||u.trackLeft(C,x,"header"));const P=E.header??E.field,K=typeof P=="string"&&P.indexOf(`
|
|
18
|
+
`)>=0,ht=E.headerWrap===!0||K;vs(C,{padding:"4px 8px",boxSizing:"border-box",background:"var(--og-header-bg)",color:"var(--og-header-color)",lineHeight:ht?"1.3":"normal",verticalAlign:"middle",fontSize:"var(--og-font-size)",textAlign:E.headerAlign??"center",borderTop:"0",borderLeft:"0",borderRight:d.border(),borderBottom:d.border(),userSelect:"none",cursor:O?"pointer":"default",whiteSpace:ht?"normal":"nowrap",overflow:ht?"visible":"hidden",textOverflow:ht?"clip":"ellipsis",wordBreak:ht?"break-word":"normal",position:"relative"}),C.title=(typeof E.tooltip=="string"?E.tooltip:P)??"";const et=D("span");if(ht?(et.style.cssText="overflow:visible;text-overflow:clip;white-space:normal;word-break:break-word;",String(P).split(`
|
|
19
|
+
`).forEach((G,nt)=>{nt>0&&et.appendChild(document.createElement("br")),et.appendChild(document.createTextNode(G))})):(et.textContent=P,et.style.cssText="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"),C.appendChild(et),T){C.classList.add("og-sorted");const I=D("span","og-sort-icon");I.textContent=T.dir==="asc"?" ↑":" ↓",C.appendChild(I)}if(E.filterable!==!1&&n.filterable&&M.colSpan===1){const I=D("span","og-filter-icon"),G=(((a=(l=n._activeFilters)==null?void 0:l[E.field])==null?void 0:a.length)??0)>0;I.textContent=G?"⊿":"▿",I.title=this._t("grid.filterTooltip"),I.style.cssText="margin-left:3px;cursor:pointer;font-size:10px;opacity:0.6;",G&&I.classList.add("og-filter-icon--active"),I.addEventListener("click",nt=>{nt.stopPropagation(),this.$l.onFilterIconClick(E.field,I)},{signal:c}),C.appendChild(I)}if(E.resizable!==!1){const I=D("div","og-resize-handle");I.style.cssText="position:absolute;right:0;top:0;bottom:0;width:4px;cursor:col-resize;z-index:1;",C.appendChild(I),this.$aP.attach(I,C,x,x>=0?E.field:void 0)}x>=0&&M.colSpan===1&&this.$aP.leaf(C,x),M.colSpan===1&&((h=this.$bE)==null||h.bind(C,E.field,O)),n.columnReorder&&x>=0&&M.colSpan===1&&(C.draggable=!0,C.addEventListener("dragstart",I=>{var G;this.$l.onColDragStart(x),C.classList.add("og-col-dragging"),(G=I.dataTransfer)==null||G.setData("text/plain",String(x))},{signal:c}),C.addEventListener("dragend",()=>{C.classList.remove("og-col-dragging"),this.$N.querySelectorAll(".og-col-drop-over").forEach(I=>I.classList.remove("og-col-drop-over"))},{signal:c}),C.addEventListener("dragover",I=>{I.preventDefault();const G=this.$l.getColDragIdx();G!==null&&G!==x&&(this.$N.querySelectorAll(".og-col-drop-over").forEach(nt=>nt.classList.remove("og-col-drop-over")),C.classList.add("og-col-drop-over"))},{signal:c}),C.addEventListener("dragleave",()=>{C.classList.remove("og-col-drop-over")},{signal:c}),C.addEventListener("drop",I=>{I.preventDefault(),C.classList.remove("og-col-drop-over"),this.$l.onColDrop(x)},{signal:c})),O&&C.addEventListener("click",I=>{this.$aP.shouldSwallowClick(I)||I.target.classList.contains("og-resize-handle")||this.$l.onHeaderClick(E.field,I.shiftKey)},{signal:c}),S.appendChild(C)}w.appendChild(S)}this.$N.appendChild(w)}}function zt(r,t,e){e.frozenCount>0&&(r.style.position="sticky",r.style.left=`${t}px`,r.style.zIndex="2",r.style.background=e.bg)}const Ln={added:"✚",edited:"✎",removed:"✖",none:""},Tn={added:"#2e7d32",edited:"#bf360c",removed:"#c62828",none:""};class On{constructor(){this.id="state"}paint(t,e,s,i){const n=D("div","og-cell og-col-state");n.textContent=Ln[i.rowState]??"",n.style.color=Tn[i.rowState]??"",n.title=i.rowState,zt(n,i.extraLeft.state,i),t.appendChild(n)}}class Dn{constructor(){this.id="drag"}paint(t,e,s,i){const n=i.dnd;if(!n)return;const o=n.attachHandle(t,e,i.opts._totalRows??i.endIndex+1);zt(o,i.extraLeft.drag,i),t.appendChild(o)}}class Nn{constructor(){this.id="rowNumber"}paint(t,e,s,i){const n=D("div","og-cell og-col-rownum");n.textContent=String(e+1),zt(n,i.extraLeft.rowNumber-i.dragGap,i),t.appendChild(n)}}class zn{constructor(t,e){this.$l=t,this._t=e,this.id="check"}paint(t,e,s,i){const n=D("div","og-cell og-col-check"),o=document.createElement("input");o.type="checkbox",o.checked=i.checkedRows.has(e),o.setAttribute("aria-label",this._t("row.selectAria",{n:e+1})),o.addEventListener("click",l=>l.stopPropagation()),o.addEventListener("change",l=>{l.stopPropagation(),this.$l.onRowCheck(e,o.checked)}),n.appendChild(o),zt(n,i.extraLeft.check-i.dragGap,i),t.appendChild(n)}}class $n{constructor(){this.id="detail"}paint(t,e,s,i){if(!i.detailColOn)return;const n=i.detailApi,o=D("div","og-cell og-col-detail-toggle");o.style.cssText="display:flex;align-items:center;justify-content:center;flex-shrink:0;box-sizing:border-box;";const l=n.getRowId(s),a=!!l&&n.isExpanded(l),h=n.getGlyph(a),c=Kr(h,l,e,n);o.appendChild(c),zt(o,i.extraLeft.detail-i.dragGap,i);const u=i.detailWidth;o.style.width=`${u}px`,o.style.minWidth=`${u}px`,t.appendChild(o),l&&t.setAttribute("aria-expanded",a?"true":"false")}}function Bn(r,t){return Object.freeze({state:new On,drag:new Dn,rowNumber:new Nn,check:new zn(r,t),detail:new $n})}class Pn{constructor(t){this.$hR=new Map;for(const e of t)this.$hR.set(e.kind,e)}kindOf(t){const e=t;if(e){if(e._isDetailFiller===!0)return"detail-filler";if(e._isDetailHead===!0)return"detail-head";if(e._isGroup===!0)return"group"}return"data"}painterFor(t){const e=this.$hR.get(t);if(!e)throw new Error(`[OpenGrid] no row painter for kind: ${String(t)}`);return e}}function _s(r){const t=[],e=r.segments,s=r.gaps();let i=0,n=0;for(;i<e.length||n<s.length;){const a=e[i],h=s[n];a&&(!h||a.from<h.from)?(t.push({gap:!1,from:a.from,to:a.to}),i++):(t.push({gap:!0,from:h.from,to:h.to}),n++)}const o=t[t.length-1],l=t[t.length-2];return Object.freeze({pieces:Object.freeze(t),lastBeforeGap:o!=null&&o.gap&&l&&!l.gap?l.to:-1})}function Re(r,t,e){var s;const i=D("div","og-col-gap");return i.style.cssText=`width:${e.geometry.spanWidth(L(r),t-r+1)}px;flex-shrink:0;`,i.setAttribute("aria-hidden","true"),(s=e.applier)==null||s.trackGap(i,r,t,"body"),i}function Vn(r,t,e,s){var i;return r.style.width=`${s.geometry.spanWidth(L(t),e-t+1)}px`,(i=s.applier)==null||i.trackGap(r,t,e,"body"),r}const xs="var(--og-row-bg,#fff)",Cs="var(--og-row-alt-bg,#fafafa)",Hn={"#ERR":"formulaError.err","#REF":"formulaError.ref","#CYCLE":"formulaError.cycle","#DIV0":"formulaError.div0","#NAME":"formulaError.name","#VALUE":"formulaError.value","#NUM":"formulaError.num"};class Wn{constructor(t,e,s,i,n){this.$T=t,this.$l=e,this.$at=s,this.$bF=i,this.$lO=n,this.kind="data",this.$nr=(o,l)=>this.$bF(o,l),this.$lX=[],this.$as=document.createDocumentFragment()}_t(t,e){return this.$bF(t,e)}paint(t,e,s){const{opts:i,startIndex:n,offsetY:o,selectedRows:l,auto:a}=s;if(!this.$km(t,e,s))return null;const h=s.rowData,c=s.rowState,u=D("div","og-row");if(u.setAttribute("role","row"),u.setAttribute("aria-rowindex",String(t+1)),!a){const p=o+(t-n)*i.rowHeight;u.style.top=`${p}px`,u.style.height=`${i.rowHeight}px`}u.style.background=t%2===0?xs:Cs,c==="added"&&u.classList.add("og-state-added"),c==="edited"&&u.classList.add("og-state-edited"),c==="removed"&&u.classList.add("og-state-removed"),l.has(t)&&u.classList.add("og-selected"),u.setAttribute("aria-selected",l.has(t)?"true":"false");const d=new Map,g=this.$l.getDndManager();s.dnd=g,s.dragGap=i.draggable&&!g?s.dragWidth:0;const f=s.extraIds;for(let p=0;p<f.length;p++)this.$lO[f[p]].paint(u,t,h,s);return s.extraCount=u.childElementCount,this.$mI(u,t,s,d),this.$at.setRow(t,d),u}$mI(t,e,s,i){var n;const o=s.layout.pieces;for(let a=0;a<o.length;a++){const h=o[a];if(h.gap)t.appendChild(Re(h.from,h.to,s));else for(let c=h.from;c<=h.to;c++)this.$hW(t,e,c,s,i)}const l=s.layout.lastBeforeGap;l>=0&&((n=i.get(l))==null||n.classList.add("og-cell--last"))}shift(t,e,s,i,n,o){var l;if(!this.$km(e,s,n))return;const a=this.$at,h=n.columns,c=i.segments;for(let m=0;m<c.length;m++)for(let b=c[m].from;b<=c[m].to;b++){if(h.contains(L(b)))continue;const y=a.get(e,b);y&&(o(y),y.remove(),a.dropColumn(e,b))}const u=n.applier,d=this.$lX;d.length=0;for(let m=t.children[n.extraCount]??null;m;){const b=m.nextElementSibling;m.classList.contains("og-col-gap")?(d.push(m),m.remove()):m.classList.remove("og-cell--last"),m=b}let g=0,f=n.extraCount>0?t.children[n.extraCount-1]??null:null;const p=n.layout.pieces,v=this.$as;for(let m=0;m<p.length;m++){const b=p[m];if(b.gap){const y=g<d.length?Vn(d[g++],b.from,b.to,n):Re(b.from,b.to,n);t.insertBefore(y,f?f.nextSibling:t.firstChild),f=y;continue}for(let y=b.from;y<=b.to;y++){const R=a.get(e,y);if(R){f=R;continue}this.$hW(v,e,y,n,null);const _=v.firstChild;t.insertBefore(v,f?f.nextSibling:t.firstChild),_&&(f=_)}}for(;g<d.length;g++)u==null||u.untrack(d[g]);d.length=0;const w=n.layout.lastBeforeGap;w>=0&&((l=a.get(e,w))==null||l.classList.add("og-cell--last"))}$km(t,e,s){const{data:i,groupFlatRows:n,selectedRows:o}=s,l=e&&e._isTree===!0,a=l?e:null,h=a?a.data:n?e:i.getRowByIndex(t);if(!h)return!1;const c=l?"none":i.getRowState(t);let u=t%2===0?xs:Cs;return c==="added"&&(u="var(--og-row-added-bg,#e8f5e9)"),c==="edited"&&(u="var(--og-row-edited-bg,#fff8e1)"),c==="removed"&&(u="var(--og-row-removed-bg,#ffebee)"),o.has(t)&&(u="var(--og-row-selected-bg,#bbdefb)"),s.rowData=h,s.treeNode=a,s.rowState=c,s.bg=u,!0}$hW(t,e,s,i,n){var o,l,a,h,c,u,d,g,f,p,v,w,m,b,y,R,_;const{opts:S,leaves:M,startIndex:C,offsetY:E,selectedRows:x,mergeEngine:T,frozenCount:O,frag:P,applier:K}=i,ht=this.$T,et=i.geometry,ns=et.count,I=i.rowData,G=i.rowState,nt=i.bg,J=i.treeNode,V=M[s],Jt=L(s),Dt=et.widthOf(Jt),rs=S.editable&&V.editable!==!1,os=s===0,Rt=T&&!T.isEmpty?T.getInfo(e,s):null;if(Rt!=null&&Rt.hidden){const H=D("div","og-cell og-cell--merge-ph");H.style.cssText=`width:${Dt}px;min-width:${Dt}px;flex-shrink:0;visibility:hidden;box-sizing:border-box;`,K==null||K.trackSpan(H,s,1,"wm","body"),t.appendChild(H);return}const A=D("div","og-cell");A.setAttribute("role","gridcell"),A.setAttribute("aria-colindex",String(s+1));const ft=(Rt==null?void 0:Rt.rowSpan)??1,gt=(Rt==null?void 0:Rt.colSpan)??1,ye=ft>1?ft*S.rowHeight:S.rowHeight;let Et=Dt,ls=!0;if(gt>1){Et=et.spanWidth(Jt,gt);const H=s+gt-ns,q=H>0?H*S.defaultColumnWidth:0;H>0&&(Et+=q,ls=!1),K==null||K.trackSpan(A,s,gt,"wmm","body",q)}const be=s<O;be&&(A.classList.add("og-frozen-cell"),s===O-1&&A.classList.add("og-frozen-last")),A.style.width=`${Et}px`,A.style.minWidth=`${Et}px`,A.style.maxWidth=`${Et}px`,ft>1&&(A.style.height=`${ye}px`),be&&(A.style.background=nt),J&&os&&(A.style.padding="0"),A.style.overflow="hidden",ft>1?(A.style.height=`${ye}px`,A.style.position="absolute",A.style.zIndex="3",A.style.background=nt&&nt!=="inherit"?nt:"var(--og-row-bg, #fff)",A.style.borderTop="0",A.style.borderLeft="0",A.style.borderBottom="1px solid var(--og-border-color, #e0e0e0)"):be&&(A.style.position="sticky",A.style.left=`${et.leftOf(Jt)}px`,A.style.zIndex="1"),V.type==="number"||V.align==="right"?A.classList.add("og-cell--right"):V.align==="center"&&A.classList.add("og-cell--center"),rs&&A.classList.add("og-cell--editable"),V.wrap&&A.classList.add("og-cell--wrap"),rs||A.setAttribute("aria-readonly","true"),gt>1&&A.setAttribute("aria-colspan",String(gt)),ft>1&&A.setAttribute("aria-rowspan",String(ft)),((o=S._focusCell)==null?void 0:o.ri)===e&&((l=S._focusCell)==null?void 0:l.ci)===s&&(A.classList.add("og-cell-focused"),A.tabIndex=-1);const as=S._rangeRects;as!=null&&as.some(H=>e>=H.startRow&&e<=H.endRow&&s>=H.startCol&&s<=H.endCol)&&(A.classList.add("og-range-selected"),A.style.background="var(--og-range-bg, rgba(25,118,210,0.12))");const ot=I?I[V.field]:null,Qt=V.ariaLabel;A.setAttribute("aria-label",Qt==null?`${V.header}: ${ot==null?"":String(ot)}`:String(typeof Qt=="function"?Qt(ot,I)??"":Qt)),V.tooltip!=null?A.title=typeof V.tooltip=="function"?String(V.tooltip(ot,I)??""):String(V.tooltip):S.tooltips&&ot!=null&&ot!==""&&(A.title=String(ot));const rt=((h=(a=this.$l).getFormulaMeta)==null?void 0:h.call(a,e,V.field))??null;if(rt){const H=ot==null?this._t("cell.emptyValue"):String(ot);if(rt.error){const q=Hn[rt.error],ct=q?this._t(q):this._t("formulaError.fallback");A.setAttribute("aria-label",this._t("formula.ariaError",{src:rt.src,message:ct})),A.title=`${rt.error} — ${ct}`,A.style.color="var(--og-formula-error-color, #c62828)"}else{const q=rt.approx?this._t("formula.approxSuffix"):"";A.setAttribute("aria-label",this._t("formula.ariaValue",{src:rt.src,value:H,approx:q})),A.title=`${rt.src}${q}`}if(((c=S.formula)==null?void 0:c.cellMarker)!==!1){A.classList.add("og-formula-cell");const q=rt.error?"var(--og-formula-error-color, #c62828)":"var(--og-formula-marker-color, #1976d2)",ct=A.style.background||A.style.backgroundColor;A.style.backgroundImage=`linear-gradient(135deg, ${q} 0 6px, transparent 6px)`,A.style.backgroundRepeat="no-repeat",A.style.backgroundPosition="top right",A.style.backgroundSize="8px 8px",ct&&(A.style.backgroundColor=ct)}}const hs=(d=(u=this.$l).resolveRenderHook)==null?void 0:d.call(u,"cellClass",e,V.field);hs&&(A.className+=" "+hs);const cs=(f=(g=this.$l).resolveRenderHook)==null?void 0:f.call(g,"ariaLabel",e,V.field);cs!=null&&A.setAttribute("aria-label",String(cs));let ds=A;if(J&&os){const H=D("div","og-tree-cell"),q=J._ancestorHasMore??[];for(let Q=0;Q<J._depth;Q++){const us=D("span","og-tree-guide");q[Q]&&us.classList.add("og-tree-guide--line"),H.appendChild(us)}if(J._depth>0){const Q=D("span","og-tree-connector");Q.classList.add(J._isLastChild?"og-tree-connector--last":"og-tree-connector--mid"),H.appendChild(Q)}const ct=D("span","og-tree-toggle-wrap");if(!J._hasChildren){const Q=D("span","og-tree-leaf-dot");ct.appendChild(Q)}H.appendChild(ct);const lt=document.createElement("i");if(J._hasChildren){const Q=Rs(V.treeNodeIcon,I,!0,J._expanded);lt.className=J._expanded?`${Q} og-tree-node-icon og-tree-node-icon--branch og-tree-node-icon--open og-tree-node-icon--toggle`:`${Q} og-tree-node-icon og-tree-node-icon--branch og-tree-node-icon--toggle`,lt.setAttribute("role","button"),lt.setAttribute("tabindex","0"),lt.setAttribute("aria-expanded",J._expanded?"true":"false"),lt.setAttribute("aria-label",this._t(J._expanded?"tree.collapse":"tree.expand")),i.treeIcons.set(lt,J._treeId)}else{const Q=Rs(V.treeNodeIcon,I,!1,!1);lt.setAttribute("aria-hidden","true"),lt.className=`${Q} og-tree-node-icon og-tree-node-icon--leaf`}H.appendChild(lt),A.appendChild(H),ds=H}if(V.cellStyle){const H=I[V.field],q=typeof V.cellStyle=="function"?V.cellStyle(H,I,e):V.cellStyle;Object.assign(A.style,q)}const nn=i.plans[s].renderer().render({value:I[V.field],row:I,rowIndex:e,column:V,colIndex:s,isSelected:x.has(e),rowState:G,displayValue:((v=(p=this.$l).resolveRenderHook)==null?void 0:v.call(p,"displayText",e,V.field))??((m=(w=this.$l).getDisplayText)==null?void 0:m.call(w,e,V.field))??null,displayFormatter:((y=(b=this.$l).getDisplayFormatter)==null?void 0:y.call(b))??null,hasCellFormula:rt!=null,t:this.$nr});if(ds.appendChild(nn),i.cellCi=s,i.cellSpan=gt,(_=(R=this.$l).applyCF)==null||_.call(R,A,e,V.field,I?I[V.field]:void 0,Et,ye,ls?i.trackBar:void 0),n?n.set(s,A):this.$at.set(e,s,A),ft>1){const H=document.createElement("div");H.style.cssText=[`width:${Dt}px;min-width:${Dt}px;height:${S.rowHeight}px;`,"flex-shrink:0;box-sizing:border-box;",`border-right:${ht.border()};`].join(""),K==null||K.trackSpan(H,s,1,"wm","body"),t.appendChild(H);const q=E+(e-C)*S.rowHeight;A.style.left=`${et.leftOf(Jt)}px`,A.style.top=`${q}px`,K==null||K.trackLeft(A,s,"body"),i.masters.set(A,e),P.appendChild(A)}else t.appendChild(A)}}function Rs(r,t,e,s){let i;return r?typeof r=="function"?i=r(t,e,s):e?i=s?r.branchOpen??"bi-folder2-open":r.branch??"bi-folder2":i=r.leaf??"bi-file-earmark":i=e?s?"bi-folder2-open":"bi-folder2":"bi-file-earmark",i.startsWith("bi ")?i:`bi ${i}`}class jn{constructor(t,e){this.$T=t,this.$bF=e,this.kind="group"}_t(t,e){return this.$bF(t,e)}paint(t,e,s){const{opts:i,startIndex:n,offsetY:o,auto:l,applier:a}=s,h=this.$T,c=s.extraWidth,u=e,d=`__${u._groupField}:${u._groupValue}`,g=D("div","og-group-row"),f=o+(t-n)*i.rowHeight;if(g.style.cssText=[l?"":`top:${f}px;height:${i.rowHeight}px;`,"display:flex;align-items:stretch;cursor:pointer;",`padding-left:${4+u._depth*12}px;`,"background:var(--og-header-bg,#f5f5f5);",`border:0;border-bottom:${h.divider()};`].join(""),g.setAttribute("role","row"),g.setAttribute("aria-expanded",u._expanded?"true":"false"),g.setAttribute("aria-rowindex",String(t+1)),g.setAttribute("aria-level",String(u._depth+1)),c>0){const p=D("div","og-group-state-cell");p.style.cssText=[`width:${c}px;min-width:${c}px;flex-shrink:0;`,"display:flex;align-items:center;justify-content:center;","font-size:10px;font-weight:700;gap:2px;",`border-right:${h.border()};`].join("");const v=u._states??{added:0,edited:0,removed:0};if(v.added>0){const w=D("span");w.textContent=`+${v.added}`,w.style.cssText=`color:var(--og-row-added-bg,#2e7d32);background:#e8f5e9;padding:1px 3px;border-radius:${h.radius(3)};`,p.appendChild(w)}if(v.edited>0){const w=D("span");w.textContent=`M${v.edited}`,w.style.cssText=`color:#e65100;background:#fff8e1;padding:1px 3px;border-radius:${h.radius(3)};`,p.appendChild(w)}if(v.removed>0){const w=D("span");w.textContent=`D${v.removed}`,w.style.cssText=`color:var(--og-row-removed-bg,#c62828);background:#ffebee;padding:1px 3px;border-radius:${h.radius(3)};`,p.appendChild(w)}a==null||a.trackExtra(p,"body"),g.appendChild(p)}return this.$al(g,u,s),s.groupKeys.set(g,d),g}shift(t,e,s){const i=s.applier;i==null||i.untrack(t);const n=s.extraWidth>0?1:0;for(;t.children.length>n;){const o=t.lastElementChild;i==null||i.untrack(o),o.remove()}this.$al(t,e,s)}$al(t,e,s){const{leaves:i,applier:n}=s,o=this.$T,l=s.geometry;let a=-1;for(let u=0;u<i.length;u++)if(!(e._summaryFmt!==void 0&&i[u].field in(e._summaryFmt??{}))){a=u;break}const h=s.layout.pieces;let c=-1;for(let u=0;u<h.length;u++)h[u].gap||(c=u);for(let u=0;u<h.length;u++){const d=h[u];if(d.gap){t.appendChild(Re(d.from,d.to,s));continue}const g=t.children.length;for(let f=d.from;f<=d.to;f++){const p=i[f],v=l.widthOf(L(f)),w=e._summaryFmt!==void 0&&p.field in(e._summaryFmt??{}),m=D("div","og-group-cell");if(m.style.cssText=[`width:${v}px;min-width:${v}px;flex-shrink:0;`,`padding:${o.cellPadding()};box-sizing:border-box;overflow:hidden;`,`border-right:${o.border()};`,"display:flex;align-items:center;","white-space:nowrap;text-overflow:ellipsis;"].join(""),w){const b=e._summaryFmt[p.field];m.textContent=b!==""?b:"-",m.style.justifyContent="flex-end",m.style.color="var(--og-primary,#1976d2)",m.style.fontWeight="600"}else if(f===a){const b=D("span","og-group-arrow");b.textContent=e._expanded?"▾ ":"▸ ",b.style.cssText="color:var(--og-primary,#1976d2);margin-right:4px;flex-shrink:0;",m.appendChild(b);const y=D("span","og-group-label");y.textContent=this._t("group.badge",{label:e._groupLabel,count:e._childCount}),y.style.cssText="overflow:hidden;text-overflow:ellipsis;font-weight:600;",m.appendChild(y),m.style.gap="0"}u!==c&&(n==null||n.trackSpan(m,f,1,"wm","body")),t.appendChild(m)}u===c&&(n==null||n.trackRowCells(t,g,d.from,d.to,"wm","body"))}a>=0&&!s.columns.contains(L(a))?t.setAttribute("aria-label",this._t("group.badge",{label:e._groupLabel,count:e._childCount})):t.hasAttribute("aria-label")&&t.removeAttribute("aria-label")}}class Gn{constructor(t){this.$T=t,this.kind="detail-head"}paint(t,e,s){var i;const n=s.detailApi;if(!n)return null;const{opts:o,offsetY:l,startIndex:a}=s,h=l+(t-a)*o.rowHeight,c=e._rowId,u=e._span*o.rowHeight,d=D("div","og-detail-panel og-detail-panel-intro");d.dataset.ogRowId=c,d.id=`og-detail-${c}`,d.setAttribute("role","region"),d.setAttribute("aria-label",n.ariaLabel),d.style.cssText=["position:absolute;left:0;",`top:${h}px;width:${s.totalColWidth}px;height:${u}px;`,"box-sizing:border-box;","overflow-y:auto;overflow-x:auto;","overscroll-behavior:contain;","background:var(--og-detail-bg,#fff);",`border:0;border-bottom:${this.$T.divider()};`,"z-index:var(--og-z-detail,2);"].join(""),(i=s.applier)==null||i.trackTotal(d,"width","body");const g=n.getPanelHost(c);return d.appendChild(g),d}}class Un{constructor(){this.kind="detail-filler"}paint(){return null}}const Kn=10;function qn(r,t=Kn){const e=Math.pow(10,t);return Math.round(r*e)/e}class k{constructor(t,e){this.$v=t,this.$z=e<0?0:e}static from(t){if(t instanceof k)return t;if(typeof t=="bigint")return new k(t,0);const e=String(t).trim();if(!e||e==="null"||e==="undefined"||e==="NaN")return new k(0n,0);const s=e.startsWith("-"),i=s?e.slice(1):e,n=i.indexOf(".");let o,l;if(n===-1)o=BigInt(i),l=0;else{const a=i.slice(n+1);o=BigInt(i.slice(0,n)+a),l=a.length}return new k(s?-o:o,l)}static zero(){return new k(0n,0)}static one(){return new k(1n,0)}static $cl(t,e){return t.$z===e.$z?[t.$v,e.$v,t.$z]:t.$z>e.$z?[t.$v,e.$v*10n**BigInt(t.$z-e.$z),t.$z]:[t.$v*10n**BigInt(e.$z-t.$z),e.$v,e.$z]}add(t){const[e,s,i]=k.$cl(this,k.from(t));return new k(e+s,i)}sub(t){const[e,s,i]=k.$cl(this,k.from(t));return new k(e-s,i)}mul(t){const e=k.from(t);return new k(this.$v*e.$v,this.$z+e.$z)}div(t,e=20){const s=k.from(t);if(s.$v===0n)throw new Error("OGDecimal: division by zero");const n=this.$v*10n**BigInt(e+s.$z)/s.$v;return new k(n,e+this.$z)}mod(t){const e=k.from(t),[s,i,n]=k.$cl(this,e);return new k(s%i,n)}neg(){return new k(-this.$v,this.$z)}abs(){return new k(this.$v<0n?-this.$v:this.$v,this.$z)}eq(t){const[e,s]=k.$cl(this,k.from(t));return e===s}gt(t){const[e,s]=k.$cl(this,k.from(t));return e>s}lt(t){const[e,s]=k.$cl(this,k.from(t));return e<s}gte(t){return!this.lt(t)}lte(t){return!this.gt(t)}isZero(){return this.$v===0n}isNeg(){return this.$v<0n}isPos(){return this.$v>0n}toFixed(t){let e=this.$v,s=this.$z;if(s<t)e=e*10n**BigInt(t-s);else if(s>t){const c=10n**BigInt(s-t),u=c/2n,d=e<0n,g=d?-e:e,f=g%c;let p=g/c;f>=u&&(p+=1n),e=d?-p:p}s=t;const i=e<0n,o=(i?-e:e).toString().padStart(t+1,"0"),l=o.slice(0,o.length-t)||"0",a=t>0?"."+o.slice(o.length-t):"";return(i?"-":"")+l+a}toString(){if(this.$z===0)return this.$v.toString();let t=this.$v,e=this.$z;for(;e>0&&t!==0n&&t%10n===0n;)t/=10n,e--;return new k(t,e).toFixed(e)}toNumber(){return parseFloat(this.toFixed(20))}static sum(t){return t.reduce((e,s)=>e.add(s),k.zero())}static avg(t,e=20){return t.length?k.sum(t).div(t.length,e):k.zero()}static min(t){if(!t.length)throw new Error("OGDecimal.min: empty array");return t.map(k.from).reduce((e,s)=>e.lt(s)?e:s)}static max(t){if(!t.length)throw new Error("OGDecimal.max: empty array");return t.map(k.from).reduce((e,s)=>e.gt(s)?e:s)}}function Es(r,t,e=30){return new Yn(r,t,e).parse()}class Yn{constructor(t,e,s){this.$G=e,this.$fa=s,this.$j=0,this.$o=t.trim()}parse(){const t=this.$de();if(this.$aR(),this.$j<this.$o.length)throw new SyntaxError(`FormulaEngine: 예상치 못한 토큰 '${this.$o[this.$j]}' (위치 ${this.$j})`);return t}$de(){let t=this.$jx();for(this.$aR();this.$j<this.$o.length;){const e=this.$o[this.$j];if(e!=="+"&&e!=="-")break;this.$j++,this.$aR();const s=this.$jx();t=e==="+"?t.add(s):t.sub(s),this.$aR()}return t}$jx(){let t=this.$hx();for(this.$aR();this.$j<this.$o.length;){const e=this.$o[this.$j];if(e!=="*"&&e!=="/"&&e!=="%")break;this.$j++,this.$aR();const s=this.$hx();e==="*"?t=t.mul(s):e==="/"?t=t.div(s,this.$fa):t=t.mod(s),this.$aR()}return t}$hx(){return this.$aR(),this.$o[this.$j]==="-"?(this.$j++,this.$hx().neg()):this.$mM()}$mM(){this.$aR();const t=this.$o[this.$j];if(t==="("){this.$j++;const e=this.$de();if(this.$aR(),this.$o[this.$j]!==")")throw new SyntaxError("FormulaEngine: 닫는 괄호 ) 누락");return this.$j++,e}return t==="["?this.$ge():this.$ml()}$ge(){this.$j++;const t=this.$j;for(;this.$j<this.$o.length&&this.$o[this.$j]!=="]";)this.$j++;if(this.$j>=this.$o.length)throw new SyntaxError("FormulaEngine: 닫는 ] 누락");const e=this.$o.slice(t,this.$j);this.$j++;const s=this.$G[e];if(s==null)throw new ReferenceError(`FormulaEngine: 필드 '[${e}]'가 행 데이터에 없습니다`);return k.from(s)}$ml(){const t=this.$j;for(;this.$j<this.$o.length&&/[0-9.]/.test(this.$o[this.$j]);)this.$j++;const e=this.$o.slice(t,this.$j);if(!e)throw new SyntaxError(`FormulaEngine: 숫자 또는 [필드]를 기대했지만 '${this.$o[this.$j]??"EOF"}' 발견 (위치 ${t})`);return k.from(e)}$aR(){for(;this.$j<this.$o.length&&/\s/.test(this.$o[this.$j]);)this.$j++}}function Ee(r,t){if(r==null||r==="")return r??"";const e=typeof t=="string"?{type:t}:t,s=e.char??"*";switch(e.type){case"ssn":return Xn(r,s);case"phone":case"mobile":return Zn(r,s);case"email":return Jn(r,s);case"credit":return Qn(r,s);case"account":return tr(r,s,e.visiblePrefix??3,e.visibleSuffix??4);case"password":return s.repeat(Math.max(r.length,6));case"name":return er(r,s);case"ip":return sr(r,s);case"partial":return $t(r,s,e.visiblePrefix??0,e.visibleSuffix??4);default:return r}}function Xn(r,t){const e=r.replace(/[^0-9]/g,"");if(e.length<7){const o=r.includes("-")?"-":"",l=r.indexOf("-")>=0?r.indexOf("-"):6;return r.slice(0,l)+o+t.repeat(Math.max(1,r.length-l-o.length))}const s=e.slice(0,6),i=e[6],n=e.length-7;return`${s}-${i}${t.repeat(n)}`}function Zn(r,t){const e=r.replace(/[^0-9]/g,"");return e.length===11?`${e.slice(0,3)}-${t.repeat(4)}-${e.slice(7)}`:e.length===10?e.startsWith("02")?`${e.slice(0,2)}-${t.repeat(4)}-${e.slice(6)}`:`${e.slice(0,3)}-${t.repeat(3)}-${e.slice(6)}`:e.length===9?`${e.slice(0,2)}-${t.repeat(3)}-${e.slice(5)}`:$t(r,t,3,4)}function Jn(r,t){const e=r.indexOf("@");if(e<0)return $t(r,t,2,0);const s=r.slice(0,e),i=r.slice(e),n=Math.min(2,s.length),o=s.slice(0,n),l=Math.max(s.length-n,3);return`${o}${t.repeat(l)}${i}`}function Qn(r,t){const e=r.replace(/[^0-9]/g,"");if(e.length<8)return r;const s=e.slice(0,4),i=e.slice(-4),n=e.length-8,o=t.repeat(Math.max(n,8)),l=[s];for(let a=0;a<o.length;a+=4){const h=o.slice(a,a+4);h&&l.push(h)}return l.push(i),l.join("-")}function tr(r,t,e,s){const i=r.replace(/[^0-9]/g,"");if(i.length<=e+s)return $t(i,t,e,s);const n=i.slice(0,e),o=i.slice(-s),l=i.length-e-s;return`${n}-${t.repeat(l)}-${o}`}function er(r,t){const e=r.trim();return e.length===0?r:e.length===1?t:e.length===2?`${e[0]}${t}`:`${e[0]}${t.repeat(e.length-2)}${e[e.length-1]}`}function sr(r,t){const e=r.split(".");if(e.length!==4)return $t(r,t,3,0);const s=i=>t.repeat(Math.max(i.length,3));return`${e[0]}.${e[1]}.${s(e[2])}.${s(e[3])}`}function $t(r,t,e,s){if(r.length<=e+s)return r;const i=r.slice(0,e),n=s>0?r.slice(-s):"",o=r.length-e-s;return`${i}${t.repeat(o)}${n}`}const ir="0 0 16 16",ke={"sort-up":'<path d="M3.5 12.5a.5.5 0 0 1-1 0V3.707L1.354 4.854a.5.5 0 1 1-.708-.708l2-1.999.007-.007a.5.5 0 0 1 .7.006l2 2a.5.5 0 1 1-.707.708L3.5 3.707zm3.5-9a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5M7.5 6a.5.5 0 0 0 0 1h5a.5.5 0 0 0 0-1zm0 3a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1zm0 3a.5.5 0 0 0 0 1h1a.5.5 0 0 0 0-1z"/>',"sort-down":'<path d="M3.5 2.5a.5.5 0 0 0-1 0v8.793l-1.146-1.147a.5.5 0 0 0-.708.708l2 1.999.007.007a.497.497 0 0 0 .7-.006l2-2a.5.5 0 0 0-.707-.708L3.5 11.293zm3.5 1a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5M7.5 6a.5.5 0 0 0 0 1h5a.5.5 0 0 0 0-1zm0 3a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1zm0 3a.5.5 0 0 0 0 1h1a.5.5 0 0 0 0-1z"/>',"chevron-expand":'<path fill-rule="evenodd" d="M3.646 9.146a.5.5 0 0 1 .708 0L8 12.793l3.646-3.647a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 0-.708m0-2.292a.5.5 0 0 0 .708 0L8 3.207l3.646 3.647a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 0 0 0 .708"/>',funnel:'<path d="M1.5 1.5A.5.5 0 0 1 2 1h12a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-.128.334L10 8.692V13.5a.5.5 0 0 1-.342.474l-3 1A.5.5 0 0 1 6 14.5V8.692L1.628 3.834A.5.5 0 0 1 1.5 3.5zm1 .5v1.308l4.372 4.858A.5.5 0 0 1 7 8.5v5.306l2-.666V8.5a.5.5 0 0 1 .128-.334L13.5 3.308V2z"/>',"funnel-fill":'<path d="M1.5 1.5A.5.5 0 0 1 2 1h12a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-.128.334L10 8.692V13.5a.5.5 0 0 1-.342.474l-3 1A.5.5 0 0 1 6 14.5V8.692L1.628 3.834A.5.5 0 0 1 1.5 3.5z"/>',filter:'<path d="M6 10.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5m-2-3a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m-2-3a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5"/>',search:'<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0"/>',"chevron-left":'<path fill-rule="evenodd" d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0"/>',"chevron-right":'<path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708"/>',"chevron-up":'<path fill-rule="evenodd" d="M7.646 4.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1-.708.708L8 5.707l-5.646 5.647a.5.5 0 0 1-.708-.708z"/>',"chevron-down":'<path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708"/>',"chevron-double-left":'<path fill-rule="evenodd" d="M8.354 1.646a.5.5 0 0 1 0 .708L2.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0"/><path fill-rule="evenodd" d="M12.354 1.646a.5.5 0 0 1 0 .708L6.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0"/>',"chevron-double-right":'<path fill-rule="evenodd" d="M3.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L9.293 8 3.646 2.354a.5.5 0 0 1 0-.708"/><path fill-rule="evenodd" d="M7.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L13.293 8 7.646 2.354a.5.5 0 0 1 0-.708"/>',"arrow-up":'<path fill-rule="evenodd" d="M8 15a.5.5 0 0 0 .5-.5V2.707l3.146 3.147a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 1 0 .708.708L7.5 2.707V14.5a.5.5 0 0 0 .5.5"/>',"arrow-down":'<path fill-rule="evenodd" d="M8 1a.5.5 0 0 1 .5.5v11.793l3.146-3.147a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 .708-.708L7.5 13.293V1.5A.5.5 0 0 1 8 1"/>',"arrow-left":'<path fill-rule="evenodd" d="M15 8a.5.5 0 0 0-.5-.5H2.707l3.147-3.146a.5.5 0 1 0-.708-.708l-4 4a.5.5 0 0 0 0 .708l4 4a.5.5 0 0 0 .708-.708L2.707 8.5H14.5A.5.5 0 0 0 15 8"/>',"arrow-right":'<path fill-rule="evenodd" d="M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8"/>',"arrow-clockwise":'<path fill-rule="evenodd" d="M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2z"/><path d="M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466"/>',"plus-lg":'<path fill-rule="evenodd" d="M8 2a.5.5 0 0 1 .5.5v5h5a.5.5 0 0 1 0 1h-5v5a.5.5 0 0 1-1 0v-5h-5a.5.5 0 0 1 0-1h5v-5A.5.5 0 0 1 8 2"/>',"plus-circle":'<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16"/><path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4"/>',trash3:'<path d="M6.5 1h3a.5.5 0 0 1 .5.5v1H6v-1a.5.5 0 0 1 .5-.5M11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3A1.5 1.5 0 0 0 5 1.5v1H1.5a.5.5 0 0 0 0 1h.538l.853 10.66A2 2 0 0 0 4.885 16h6.23a2 2 0 0 0 1.994-1.84l.853-10.66h.538a.5.5 0 0 0 0-1zm1.958 1-.846 10.58a1 1 0 0 1-.997.92h-6.23a1 1 0 0 1-.997-.92L3.042 3.5zm-7.487 1a.5.5 0 0 1 .528.47l.5 8.5a.5.5 0 0 1-.998.06L5 5.03a.5.5 0 0 1 .47-.53Zm5.058 0a.5.5 0 0 1 .47.53l-.5 8.5a.5.5 0 1 1-.998-.06l.5-8.5a.5.5 0 0 1 .528-.47M8 4.5a.5.5 0 0 1 .5.5v8.5a.5.5 0 0 1-1 0V5a.5.5 0 0 1 .5-.5"/>',"grip-vertical":'<path d="M7 2a1 1 0 1 1-2 0 1 1 0 0 1 2 0m3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0M7 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0m3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0M7 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0m3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0m-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0m3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0m-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0m3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0"/>',"grip-horizontal":'<path d="M2 8a1 1 0 1 1 0 2 1 1 0 0 1 0-2m0-3a1 1 0 1 1 0 2 1 1 0 0 1 0-2m3 3a1 1 0 1 1 0 2 1 1 0 0 1 0-2m0-3a1 1 0 1 1 0 2 1 1 0 0 1 0-2m3 3a1 1 0 1 1 0 2 1 1 0 0 1 0-2m0-3a1 1 0 1 1 0 2 1 1 0 0 1 0-2m3 3a1 1 0 1 1 0 2 1 1 0 0 1 0-2m0-3a1 1 0 1 1 0 2 1 1 0 0 1 0-2m3 3a1 1 0 1 1 0 2 1 1 0 0 1 0-2m0-3a1 1 0 1 1 0 2 1 1 0 0 1 0-2"/>',"pin-angle":'<path d="M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a6 6 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707s.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a6 6 0 0 1 1.013.16l3.134-3.133a3 3 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146m.122 2.112v-.002zm0-.002v.002a.5.5 0 0 1-.122.51L6.293 6.878a.5.5 0 0 1-.511.12H5.78l-.014-.004a5 5 0 0 0-.288-.076 5 5 0 0 0-.765-.116c-.422-.028-.836.008-1.175.15l5.51 5.509c.141-.34.177-.753.149-1.175a5 5 0 0 0-.192-1.054l-.004-.013v-.001a.5.5 0 0 1 .12-.512l3.536-3.535a.5.5 0 0 1 .532-.115l.096.022c.087.017.208.034.344.034q.172.002.343-.04L9.927 2.028q-.042.172-.04.343a1.8 1.8 0 0 0 .062.46z"/>',"pin-angle-fill":'<path d="M9.828.722a.5.5 0 0 1 .354.146l4.95 4.95a.5.5 0 0 1 0 .707c-.48.48-1.072.588-1.503.588-.177 0-.335-.018-.46-.039l-3.134 3.134a6 6 0 0 1 .16 1.013c.046.702-.032 1.687-.72 2.375a.5.5 0 0 1-.707 0l-2.829-2.828-3.182 3.182c-.195.195-1.219.902-1.414.707s.512-1.22.707-1.414l3.182-3.182-2.828-2.829a.5.5 0 0 1 0-.707c.688-.688 1.673-.767 2.375-.72a6 6 0 0 1 1.013.16l3.134-3.133a3 3 0 0 1-.04-.461c0-.43.108-1.022.589-1.503a.5.5 0 0 1 .353-.146"/>',eye:'<path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8M1.173 8a13 13 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5s3.879 1.168 5.168 2.457A13 13 0 0 1 14.828 8q-.086.13-.195.288c-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5s-3.879-1.168-5.168-2.457A13 13 0 0 1 1.172 8z"/><path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0"/>',"eye-slash":'<path d="M13.359 11.238C15.06 9.72 16 8 16 8s-3-5.5-8-5.5a7 7 0 0 0-2.79.588l.77.771A6 6 0 0 1 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13 13 0 0 1 14.828 8q-.086.13-.195.288c-.335.48-.83 1.12-1.465 1.755q-.247.248-.517.486z"/><path d="M11.297 9.176a3.5 3.5 0 0 0-4.474-4.474l.823.823a2.5 2.5 0 0 1 2.829 2.829zm-2.943 1.299.822.822a3.5 3.5 0 0 1-4.474-4.474l.823.823a2.5 2.5 0 0 0 2.829 2.829"/><path d="M3.35 5.47q-.27.24-.518.487A13 13 0 0 0 1.172 8l.195.288c.335.48.83 1.12 1.465 1.755C4.121 11.332 5.881 12.5 8 12.5c.716 0 1.39-.133 2.02-.36l.77.772A7 7 0 0 1 8 13.5C3 13.5 0 8 0 8s.939-1.721 2.641-3.238l.708.709zm10.296 8.884-12-12 .708-.708 12 12z"/>',pencil:'<path d="M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325"/>',"check-lg":'<path d="M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425z"/>',"x-lg":'<path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8z"/>',clipboard:'<path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1z"/><path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0z"/>',"clipboard-check":'<path fill-rule="evenodd" d="M10.854 7.146a.5.5 0 0 1 0 .708l-3 3a.5.5 0 0 1-.708 0l-1.5-1.5a.5.5 0 1 1 .708-.708L7.5 9.793l2.646-2.647a.5.5 0 0 1 .708 0"/><path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1z"/><path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0z"/>',eraser:'<path d="M8.086 2.207a2 2 0 0 1 2.828 0l3.879 3.879a2 2 0 0 1 0 2.828l-5.5 5.5A2 2 0 0 1 7.879 15H5.12a2 2 0 0 1-1.414-.586l-2.5-2.5a2 2 0 0 1 0-2.828zm2.121.707a1 1 0 0 0-1.414 0L4.16 7.547l5.293 5.293 4.633-4.633a1 1 0 0 0 0-1.414zM8.746 13.547 3.453 8.254 1.914 9.793a1 1 0 0 0 0 1.414l2.5 2.5a1 1 0 0 0 .707.293H7.88a1 1 0 0 0 .707-.293z"/>',square:'<path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"/>',"check-square":'<path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"/><path d="M10.97 4.97a.75.75 0 0 1 1.071 1.05l-3.992 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425z"/>',"dash-square":'<path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"/><path d="M4 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 4 8"/>',"check-all":'<path d="M8.97 4.97a.75.75 0 0 1 1.07 1.05l-3.99 4.99a.75.75 0 0 1-1.08.02L2.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093L8.95 4.992zm-.92 5.14.92.92a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 1 0-1.091-1.028L9.477 9.417l-.485-.486z"/>',"filetype-csv":'<path fill-rule="evenodd" d="M14 4.5V14a2 2 0 0 1-2 2h-1v-1h1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5zM3.517 14.841a1.13 1.13 0 0 0 .401.823q.195.162.478.252.284.091.665.091.507 0 .859-.158.354-.158.539-.44.187-.284.187-.656 0-.336-.134-.56a1 1 0 0 0-.375-.357 2 2 0 0 0-.566-.21l-.621-.144a1 1 0 0 1-.404-.176.37.37 0 0 1-.144-.299q0-.234.185-.384.188-.152.512-.152.214 0 .37.068a.6.6 0 0 1 .246.181.56.56 0 0 1 .12.258h.75a1.1 1.1 0 0 0-.2-.566 1.2 1.2 0 0 0-.5-.41 1.8 1.8 0 0 0-.78-.152q-.439 0-.776.15-.337.149-.527.421-.19.273-.19.639 0 .302.122.524.124.223.352.367.228.143.539.213l.618.144q.31.073.463.193a.39.39 0 0 1 .152.326.5.5 0 0 1-.085.29.56.56 0 0 1-.255.193q-.167.07-.413.07-.175 0-.32-.04a.8.8 0 0 1-.248-.115.58.58 0 0 1-.255-.384zM.806 13.693q0-.373.102-.633a.87.87 0 0 1 .302-.399.8.8 0 0 1 .475-.137q.225 0 .398.097a.7.7 0 0 1 .272.26.85.85 0 0 1 .12.381h.765v-.072a1.33 1.33 0 0 0-.466-.964 1.4 1.4 0 0 0-.489-.272 1.8 1.8 0 0 0-.606-.097q-.534 0-.911.223-.375.222-.572.632-.195.41-.196.979v.498q0 .568.193.976.197.407.572.626.375.217.914.217.439 0 .785-.164t.55-.454a1.27 1.27 0 0 0 .226-.674v-.076h-.764a.8.8 0 0 1-.118.363.7.7 0 0 1-.272.25.9.9 0 0 1-.401.087.85.85 0 0 1-.478-.132.83.83 0 0 1-.299-.392 1.7 1.7 0 0 1-.102-.627zm8.239 2.238h-.953l-1.338-3.999h.917l.896 3.138h.038l.888-3.138h.879z"/>',"filetype-xlsx":'<path fill-rule="evenodd" d="M14 4.5V11h-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5zM7.86 14.841a1.13 1.13 0 0 0 .401.823q.195.162.479.252.284.091.665.091.507 0 .858-.158.355-.158.54-.44a1.17 1.17 0 0 0 .187-.656q0-.336-.135-.56a1 1 0 0 0-.375-.357 2 2 0 0 0-.565-.21l-.621-.144a1 1 0 0 1-.405-.176.37.37 0 0 1-.143-.299q0-.234.184-.384.188-.152.513-.152.214 0 .37.068a.6.6 0 0 1 .245.181.56.56 0 0 1 .12.258h.75a1.1 1.1 0 0 0-.199-.566 1.2 1.2 0 0 0-.5-.41 1.8 1.8 0 0 0-.78-.152q-.44 0-.777.15-.336.149-.527.421-.19.273-.19.639 0 .302.123.524t.351.367q.229.143.54.213l.618.144q.31.073.462.193a.39.39 0 0 1 .153.326.5.5 0 0 1-.085.29.56.56 0 0 1-.255.193q-.168.07-.413.07-.176 0-.32-.04a.8.8 0 0 1-.249-.115.58.58 0 0 1-.255-.384zm-3.726-2.909h.893l-1.274 2.007 1.254 1.992h-.908l-.85-1.415h-.035l-.853 1.415H1.5l1.24-2.016-1.228-1.983h.931l.832 1.438h.036zm1.923 3.325h1.697v.674H5.266v-3.999h.791zm7.636-3.325h.893l-1.274 2.007 1.254 1.992h-.908l-.85-1.415h-.035l-.853 1.415h-.861l1.24-2.016-1.228-1.983h.931l.832 1.438h.036z"/>',"filetype-pdf":'<path fill-rule="evenodd" d="M14 4.5V14a2 2 0 0 1-2 2h-1v-1h1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5zM1.6 11.85H0v3.999h.791v-1.342h.803q.43 0 .732-.173.305-.175.463-.474a1.4 1.4 0 0 0 .161-.677q0-.375-.158-.677a1.2 1.2 0 0 0-.46-.477q-.3-.18-.732-.179m.545 1.333a.8.8 0 0 1-.085.38.57.57 0 0 1-.238.241.8.8 0 0 1-.375.082H.788V12.48h.66q.327 0 .512.181.185.183.185.522m1.217-1.333v3.999h1.46q.602 0 .998-.237a1.45 1.45 0 0 0 .595-.689q.196-.45.196-1.084 0-.63-.196-1.075a1.43 1.43 0 0 0-.589-.68q-.396-.234-1.005-.234zm.791.645h.563q.371 0 .609.152a.9.9 0 0 1 .354.454q.118.302.118.753a2.3 2.3 0 0 1-.068.592 1.1 1.1 0 0 1-.196.422.8.8 0 0 1-.334.252 1.3 1.3 0 0 1-.483.082h-.563zm3.743 1.763v1.591h-.79V11.85h2.548v.653H7.896v1.117h1.606v.638z"/>',"filetype-json":'<path fill-rule="evenodd" d="M14 4.5V11h-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5zM4.151 15.29a1.2 1.2 0 0 1-.111-.449h.764a.58.58 0 0 0 .255.384q.105.073.25.114.142.041.319.041.245 0 .413-.07a.56.56 0 0 0 .255-.193.5.5 0 0 0 .084-.29.39.39 0 0 0-.152-.326q-.152-.12-.463-.193l-.618-.143a1.7 1.7 0 0 1-.539-.214 1 1 0 0 1-.352-.367 1.1 1.1 0 0 1-.123-.524q0-.366.19-.639.192-.272.528-.422.337-.15.777-.149.456 0 .779.152.326.153.5.41.18.255.2.566h-.75a.56.56 0 0 0-.12-.258.6.6 0 0 0-.246-.181.9.9 0 0 0-.37-.068q-.324 0-.512.152a.47.47 0 0 0-.185.384q0 .18.144.3a1 1 0 0 0 .404.175l.621.143q.326.075.566.211a1 1 0 0 1 .375.358q.135.222.135.56 0 .37-.188.656a1.2 1.2 0 0 1-.539.439q-.351.158-.858.158-.381 0-.665-.09a1.4 1.4 0 0 1-.478-.252 1.1 1.1 0 0 1-.29-.375m-3.104-.033a1.3 1.3 0 0 1-.082-.466h.764a.6.6 0 0 0 .074.27.5.5 0 0 0 .454.246q.285 0 .422-.164.137-.165.137-.466v-2.745h.791v2.725q0 .66-.357 1.005-.355.345-.985.345a1.6 1.6 0 0 1-.568-.094 1.15 1.15 0 0 1-.407-.266 1.1 1.1 0 0 1-.243-.39m9.091-1.585v.522q0 .384-.117.641a.86.86 0 0 1-.322.387.9.9 0 0 1-.47.126.9.9 0 0 1-.47-.126.87.87 0 0 1-.32-.387 1.55 1.55 0 0 1-.117-.641v-.522q0-.386.117-.641a.87.87 0 0 1 .32-.387.87.87 0 0 1 .47-.129q.265 0 .47.129a.86.86 0 0 1 .322.387q.117.255.117.641m.803.519v-.513q0-.565-.205-.973a1.46 1.46 0 0 0-.59-.63q-.38-.22-.916-.22-.534 0-.92.22a1.44 1.44 0 0 0-.589.628q-.205.407-.205.975v.513q0 .562.205.973.205.407.589.626.386.217.92.217.536 0 .917-.217.384-.22.589-.626.204-.41.205-.973m1.29-.935v2.675h-.746v-3.999h.662l1.752 2.66h.032v-2.66h.75v4h-.656l-1.761-2.676z"/>',printer:'<path d="M2.5 8a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1"/><path d="M5 1a2 2 0 0 0-2 2v2H2a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h1v1a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2v-1h1a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-1V3a2 2 0 0 0-2-2zM4 3a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2H4zm1 5a2 2 0 0 0-2 2v1H2a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-1v-1a2 2 0 0 0-2-2zm7 2v3a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1"/>',download:'<path d="M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5"/><path d="M7.646 11.854a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V1.5a.5.5 0 0 0-1 0v8.793L5.354 8.146a.5.5 0 1 0-.708.708z"/>',upload:'<path d="M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5"/><path d="M7.646 1.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708L8.5 2.707V11.5a.5.5 0 0 1-1 0V2.707L5.354 4.854a.5.5 0 1 1-.708-.708z"/>',table:'<path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm15 2h-4v3h4zm0 4h-4v3h4zm0 4h-4v3h3a1 1 0 0 0 1-1zm-5 3v-3H6v3zm-5 0v-3H1v2a1 1 0 0 0 1 1zm-4-4h4V8H1zm0-4h4V4H1zm5-3v3h4V4zm4 4H6v3h4z"/>',"bar-chart":'<path d="M4 11H2v3h2zm5-4H7v7h2zm5-5v12h-2V2zm-2-1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1zM6 7a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1zm-5 4a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1z"/>',"graph-up":'<path fill-rule="evenodd" d="M0 0h1v15h15v1H0zm14.817 3.113a.5.5 0 0 1 .07.704l-4.5 5.5a.5.5 0 0 1-.74.037L7.06 6.767l-3.656 5.027a.5.5 0 0 1-.808-.588l4-5.5a.5.5 0 0 1 .758-.06l2.609 2.61 4.15-5.073a.5.5 0 0 1 .704-.07"/>',"pie-chart":'<path d="M7.5 1.018a7 7 0 0 0-4.79 11.566L7.5 7.793zm1 0V7.5h6.482A7 7 0 0 0 8.5 1.018M14.982 8.5H8.207l-4.79 4.79A7 7 0 0 0 14.982 8.5M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8"/>',"check-circle-fill":'<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"/>',"exclamation-triangle-fill":'<path d="M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5m.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2"/>',"x-circle-fill":'<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293z"/>',"info-circle":'<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16"/><path d="m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0"/>',"lock-fill":'<path fill-rule="evenodd" d="M8 0a4 4 0 0 1 4 4v2.05a2.5 2.5 0 0 1 2 2.45v5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 13.5v-5a2.5 2.5 0 0 1 2-2.45V4a4 4 0 0 1 4-4m0 1a3 3 0 0 0-3 3v2h6V4a3 3 0 0 0-3-3"/>',unlock:'<path fill-rule="evenodd" d="M12 0a4 4 0 0 1 4 4v2.5h-1V4a3 3 0 1 0-6 0v2h.5A2.5 2.5 0 0 1 12 8.5v5A2.5 2.5 0 0 1 9.5 16h-7A2.5 2.5 0 0 1 0 13.5v-5A2.5 2.5 0 0 1 2.5 6H8V4a4 4 0 0 1 4-4M2.5 7A1.5 1.5 0 0 0 1 8.5v5A1.5 1.5 0 0 0 2.5 15h7a1.5 1.5 0 0 0 1.5-1.5v-5A1.5 1.5 0 0 0 9.5 7z"/>',asterisk:'<path d="M8 0a1 1 0 0 1 1 1v5.268l4.562-2.634a1 1 0 1 1 1 1.732L10 8l4.562 2.634a1 1 0 1 1-1 1.732L9 9.732V15a1 1 0 1 1-2 0V9.732l-4.562 2.634a1 1 0 1 1-1-1.732L6 8 1.438 5.366a1 1 0 0 1 1-1.732L7 6.268V1a1 1 0 0 1 1-1"/>',calculator:'<path d="M12 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM4 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z"/><path d="M4 2.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-.5.5h-7a.5.5 0 0 1-.5-.5zm0 4a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm0 3a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm0 3a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm3-6a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm0 3a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm0 3a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm3-6a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm0 3a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5z"/>',gear:'<path d="M8 4.754a3.246 3.246 0 1 0 0 6.492 3.246 3.246 0 0 0 0-6.492M5.754 8a2.246 2.246 0 1 1 4.492 0 2.246 2.246 0 0 1-4.492 0"/><path d="M9.796 1.343c-.527-1.79-3.065-1.79-3.592 0l-.094.319a.873.873 0 0 1-1.255.52l-.292-.16c-1.64-.892-3.433.902-2.54 2.541l.159.292a.873.873 0 0 1-.52 1.255l-.319.094c-1.79.527-1.79 3.065 0 3.592l.319.094a.873.873 0 0 1 .52 1.255l-.16.292c-.892 1.64.901 3.434 2.541 2.54l.292-.159a.873.873 0 0 1 1.255.52l.094.319c.527 1.79 3.065 1.79 3.592 0l.094-.319a.873.873 0 0 1 1.255-.52l.292.16c1.64.893 3.434-.902 2.54-2.541l-.159-.292a.873.873 0 0 1 .52-1.255l.319-.094c1.79-.527 1.79-3.065 0-3.592l-.319-.094a.873.873 0 0 1-.52-1.255l.16-.292c.893-1.64-.902-3.433-2.541-2.54l-.292.159a.873.873 0 0 1-1.255-.52zm-2.633.283c.246-.835 1.428-.835 1.674 0l.094.319a1.873 1.873 0 0 0 2.693 1.115l.291-.16c.764-.415 1.6.42 1.184 1.185l-.159.292a1.873 1.873 0 0 0 1.116 2.692l.318.094c.835.246.835 1.428 0 1.674l-.319.094a1.873 1.873 0 0 0-1.115 2.693l.16.291c.415.764-.42 1.6-1.185 1.184l-.291-.159a1.873 1.873 0 0 0-2.693 1.116l-.094.318c-.246.835-1.428.835-1.674 0l-.094-.319a1.873 1.873 0 0 0-2.692-1.115l-.292.16c-.764.415-1.6-.42-1.184-1.185l.159-.291A1.873 1.873 0 0 0 1.945 8.93l-.319-.094c-.835-.246-.835-1.428 0-1.674l.319-.094A1.873 1.873 0 0 0 3.06 4.377l-.16-.292c-.415-.764.42-1.6 1.185-1.184l.292.159a1.873 1.873 0 0 0 2.692-1.115z"/>',list:'<path fill-rule="evenodd" d="M2.5 12a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5m0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5"/>',"three-dots-vertical":'<path d="M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"/>',"three-dots":'<path d="M3 9.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"/>',plus:'<path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4"/>',dash:'<path d="M4 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 4 8"/>',"question-circle":'<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16"/><path d="M5.255 5.786a.237.237 0 0 0 .241.247h.825c.138 0 .248-.113.266-.25.09-.656.54-1.134 1.342-1.134.686 0 1.314.343 1.314 1.168 0 .635-.374.927-.965 1.371-.673.489-1.206 1.06-1.168 1.987l.003.217a.25.25 0 0 0 .25.246h.811a.25.25 0 0 0 .25-.25v-.105c0-.718.273-.927 1.01-1.486.609-.463 1.244-.977 1.244-2.056 0-1.511-1.276-2.241-2.673-2.241-1.267 0-2.655.59-2.75 2.286m1.557 5.763c0 .533.425.927 1.01.927.609 0 1.028-.394 1.028-.927 0-.552-.42-.94-1.029-.94-.584 0-1.009.388-1.009.94"/>',"eye-reveal":'<path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8z"/><path d="M8 5.5A2.5 2.5 0 1 0 8 10.5 2.5 2.5 0 0 0 8 5.5zm0 4A1.5 1.5 0 1 1 8 6.5a1.5 1.5 0 0 1 0 3z" fill="#fff"/>'};Object.keys(ke).length;const ks={"sort.asc":"sort-up","sort.desc":"sort-down","sort.none":"chevron-expand",filter:"funnel","filter.active":"funnel-fill",search:"search","row.add":"plus-lg","row.delete":"trash3",delete:"trash3","row.drag":"grip-vertical","column.drag":"grip-horizontal",expand:"chevron-right",collapse:"chevron-down","tree.expand":"chevron-right","tree.collapse":"chevron-down","mask.reveal":"eye-reveal","mask.show":"eye","mask.hide":"eye-slash","export.excel":"filetype-xlsx","export.csv":"filetype-csv","export.pdf":"filetype-pdf","export.json":"filetype-json",export:"download",import:"upload",print:"printer",table:"table",edit:"pencil",copy:"clipboard",paste:"clipboard-check",clear:"eraser",check:"check-lg",close:"x-lg",add:"plus",remove:"dash","select.all":"check-all","select.none":"square","select.check":"check-square","select.indeterminate":"dash-square",pin:"pin-angle","pin.active":"pin-angle-fill","status.error":"x-circle-fill","status.warning":"exclamation-triangle-fill","status.success":"check-circle-fill","status.info":"info-circle","status.lock":"lock-fill","status.unlock":"unlock",required:"asterisk",chart:"bar-chart","chart.bar":"bar-chart","chart.line":"graph-up","chart.pie":"pie-chart",formula:"calculator","nav.first":"chevron-double-left","nav.prev":"chevron-left","nav.next":"chevron-right","nav.last":"chevron-double-right","nav.up":"arrow-up","nav.down":"arrow-down",refresh:"arrow-clockwise",menu:"list",more:"three-dots-vertical","more.horizontal":"three-dots",settings:"gear",help:"question-circle"},nr="";function rr(r){return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}class ve{constructor(t,e){if(this.$fp=new Map,this._parent=e,t)for(const[s,i]of Object.entries(t))this.register(s,i)}register(t,e){const s=Object.prototype.hasOwnProperty.call(ke,e)?ke[e]:e;return this.$fp.set(t,s),this}has(t){var e;return this.$fp.has(t)||(((e=this._parent)==null?void 0:e.has(t))??!1)}resolveBody(t){const e=this.$fp.get(t);return e!==void 0?e:this._parent?this._parent.resolveBody(t):null}child(){return new ve(void 0,this)}render(t,e){const s=this.resolveBody(t)??nr,i=e==null?void 0:e.size,n=i!=null?` width="${i}" height="${i}"`:"",o=e==null?void 0:e.title,l=o?`<title>${rr(o)}</title>`:"",h=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${ir}"${n} fill="currentColor"${o?' role="img"':""} style="stroke-linejoin:var(--og-icon-corner, miter)">${l}${s}</svg>`;return e!=null&&e.el?new DOMParser().parseFromString(h,"image/svg+xml").documentElement:h}roles(){return[...this.$fp.keys()]}}const mt=new ve(ks);function or(r,t){return mt.render(r,t)}function Mt(r,t,e){return r.t?r.t(t,e):B(t,e)}function Ms(r){if(r.hasCellFormula)return null;const t=r.column;if(!t.formula)return null;const e=t.formulaPrecision??30;try{let s;return typeof t.formula=="function"?s=t.formula(r.row,k):s=Es(t.formula,r.row,e),s instanceof k?t.precision!=null?s.toFixed(t.precision):s.toString():typeof s=="string"?s:t.precision!=null?k.from(s).toFixed(t.precision):String(s)}catch(s){return console.warn("[OpenGrid] Formula error:",s),"#ERR"}}function lr(r,t,e,s,i,n){if(r==null||r==="")return"";let o=Number(r);if(isNaN(o))return String(r);if(e!=null&&(o=qn(o,e)),s)try{return new Intl.NumberFormat(void 0,{style:"currency",currency:s,...e!=null?{minimumFractionDigits:e,maximumFractionDigits:e}:{}}).format(o)}catch{}if(!t)return e!=null?o.toFixed(e):String(o);const l=t.indexOf(";"),a=l>=0?t.slice(l+1):null,h=o<0&&a!=null?a:l>=0?t.slice(0,l):t,c=o<0&&a!=null?Math.abs(o):o,u=h.match(/[#0][#0,]*(?:\.[#0]+)?/);if(!u)return String(o);const d=u[0],g=h.slice(0,u.index),f=h.slice(u.index+d.length),p=d.includes(","),v=d.includes(".")?d.split(".")[1].length:e??0,w=c.toLocaleString("ko-KR",{minimumFractionDigits:v,maximumFractionDigits:v,useGrouping:p});return g+w+f}function Ss(r,t="yyyy-MM-dd",e,s){if(!r)return"";const i=r instanceof Date?r:new Date(r);if(isNaN(i.getTime()))return String(r);const n=i.getFullYear(),o=String(i.getMonth()+1).padStart(2,"0"),l=String(i.getDate()).padStart(2,"0");return t.replace("yyyy",String(n)).replace("MM",o).replace("dd",l)}function ar(r,t,e,s){const i=Ee(r,t.mask),n=document.createElement("span");n.style.cssText="display:flex;align-items:center;gap:3px;overflow:hidden;width:100%;box-sizing:border-box;";const o=document.createElement("span");o.style.cssText="flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:monospace;letter-spacing:0.4px;color:var(--og-mask-text,#888);",o.textContent=i;const l=document.createElement("button");return l.title=Mt(s,"cell.revealTooltip"),l.setAttribute("aria-label",Mt(s,"cell.revealAria")),l.innerHTML=mt.render("mask.reveal",{size:13}),l.style.cssText=`flex-shrink:0;background:none;border:none;cursor:pointer;color:#c0c0c0;padding:1px 2px;line-height:0;border-radius:${kt.radius(3)};display:flex;align-items:center;`,l.addEventListener("mouseover",()=>{l.style.color="var(--og-primary,#1976d2)",l.style.background="rgba(25,118,210,0.08)"}),l.addEventListener("mouseout",()=>{l.style.color="#c0c0c0",l.style.background="none"}),l.addEventListener("click",a=>{a.stopPropagation(),o.textContent=r,o.style.fontFamily="",o.style.letterSpacing="",o.style.color="",l.remove(),(t._maskRevealedRows??(t._maskRevealedRows=new Set)).add(e)}),n.appendChild(o),n.appendChild(l),n}class vt{render(t){var e;const s=document.createElement("span");s.className="og-cell-text";const i=Ms(t);if(i!==null)return s.textContent=i,s.style.cssText="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;",s;const{value:n,column:o,rowIndex:l}=t;if(t.displayValue!=null)return s.textContent=t.displayValue,s.style.cssText="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;",s;let a;if(o.valueMap&&n!=null&&o.valueMap[n]?a=o.valueMap[n]:a=n==null?"":String(n),o.mask){const h=o._maskRevealed===!0,c=((e=o._maskRevealedRows)==null?void 0:e.has(l))===!0;if(!h&&!c)return ar(a,o,l,t)}return s.textContent=a,s.style.cssText="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;",s}}class hr{constructor(t=[],e){this.$aA=t.map(s=>typeof s=="string"?{label:s,value:s}:{label:s.label??s.text??String(s.value??""),value:s.value}),this.$gl=e??null}render(t){const e=document.createElement("span");e.className="og-cell-text",e.style.cssText="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;";const s=t.value;if(s==null||s==="")return e;const i=String(s),o=(this.$gl?this.$gl(t.row,t.rowIndex).map(l=>typeof l=="string"?{label:l,value:l}:{label:l.label??l.text??String(l.value??""),value:l.value}):this.$aA).find(l=>String(l.value)===i);return e.textContent=o?o.label:i,e}}class cr{render(t){const e=document.createElement("span");e.className="og-cell-number";const s=Ms(t);if(s!==null)return e.textContent=s,e.style.cssText="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;width:100%;text-align:right;",e;if(t.displayFormatter){const i=t.displayFormatter(t.value,t.column.field??"",t.row);if(i!=null)return e.textContent=i,e.style.cssText="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;width:100%;text-align:right;",e}return e.textContent=lr(t.value,t.column.format??"#,##0",t.column.precision,t.column.currency,t.column.field,t.row),e.style.cssText="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;width:100%;text-align:right;",e}}class dr{render(t){const e=document.createElement("span");e.className="og-cell-date";const s=t.displayFormatter?t.displayFormatter(t.value,t.column.field??"",t.row):null;return s!=null?e.textContent=s:e.textContent=Ss(t.value,t.column.format,t.column.field,t.row),e.style.cssText="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;",e}}class As{render(t){const e=document.createElement("span");e.className="og-cell-checkbox",e.style.cssText="display:flex;align-items:center;justify-content:center;height:100%;";const s=document.createElement("input");return s.type="checkbox",s.checked=!!t.value,s.disabled=!0,s.style.cssText+="cursor:pointer;pointer-events:none;",e.appendChild(s),e}}class ur{constructor(t){this.def=t}render(t){var e,s,i,n;const o=document.createElement("span");o.style.cssText="display:flex;align-items:center;justify-content:center;height:100%;";const l=document.createElement("button");l.className=`og-cell-btn${(e=this.def)!=null&&e.buttonClass?" "+this.def.buttonClass:""}`;const a=(s=this.def)==null?void 0:s.label,h=typeof a=="function"?a(t.value,t.row):a??String(t.value??"btn");if(l.style.cssText=`
|
|
20
|
+
padding:2px 10px;border:1px solid var(--og-primary,#1976d2);
|
|
21
|
+
border-radius:4px;background:var(--og-row-bg,#fff);color:var(--og-primary,#1976d2);
|
|
22
|
+
cursor:pointer;font-size:12px;white-space:nowrap;transition:background 0.12s;
|
|
23
|
+
${((i=this.def)==null?void 0:i.style)??""}
|
|
24
|
+
`,(n=this.def)!=null&&n.icon){l.style.display="inline-flex",l.style.alignItems="center",l.style.gap="4px";const c=document.createElement("span");c.style.cssText="display:inline-flex;flex-shrink:0;",c.innerHTML=mt.render(this.def.icon,{size:13});const u=document.createElement("span");u.textContent=h,this.def.iconPos==="right"?(l.appendChild(u),l.appendChild(c)):(l.appendChild(c),l.appendChild(u))}else l.textContent=h;return l.addEventListener("mouseover",()=>l.style.background="var(--og-primary-light,#e3f2fd)"),l.addEventListener("mouseout",()=>l.style.background="var(--og-row-bg,#fff)"),o.appendChild(l),o}}class fr{constructor(t,e){this.colorMap=t,this.labelMap=e}render(t){var e,s,i;const n=document.createElement("span");n.style.cssText="display:flex;align-items:center;height:100%;";const o=document.createElement("span"),l=t.value==null?"":String(t.value),a=((e=this.labelMap)==null?void 0:e[l])??((s=t.column.valueMap)==null?void 0:s[l])??l;o.textContent=a;const h=((i=this.colorMap)==null?void 0:i[l])??"#666";return o.style.cssText=`
|
|
25
|
+
display:inline-block;padding:2px 8px;border-radius:${kt.radius(12)};font-size:11px;
|
|
26
|
+
background:${h}22;color:${h};border:1px solid ${h}66;
|
|
27
|
+
white-space:nowrap;
|
|
28
|
+
`,n.appendChild(o),n}}class gr{constructor(t,e){this.hrefFn=t,this.target=e}render(t){const e=document.createElement("a");return e.className="og-cell-link",e.textContent=t.value==null?"":String(t.value),e.href=this.hrefFn?this.hrefFn(t.value,t.row):"#",this.target&&(e.target=this.target),e.style.cssText="color:var(--og-primary,#1976d2);text-decoration:underline;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;",this.hrefFn||e.addEventListener("click",s=>s.preventDefault()),e}}class pr{constructor(t){this.templateFn=t}render(t){const e=document.createElement("div");return e.className="og-cell-template",e.style.cssText="display:flex;align-items:center;height:100%;overflow:hidden;",e.innerHTML=this.templateFn(t.value,t.row,t.rowIndex),e}}class mr{constructor(t){this.def=t}render(t){var e,s,i,n,o;const l=document.createElement("span");l.style.cssText="display:flex;align-items:center;justify-content:center;height:100%;";const a=document.createElement("img"),h=(e=this.def)!=null&&e.srcFn?this.def.srcFn(t.value,t.row):String(t.value??"");a.src=h;const c=((s=this.def)==null?void 0:s.width)??28,u=((i=this.def)==null?void 0:i.height)??28,d=((n=this.def)==null?void 0:n.radius)??4;a.style.cssText=`width:${c}px;height:${u}px;object-fit:cover;border-radius:${kt.radius(d)};display:block;`;const g=(o=this.def)==null?void 0:o.alt;return a.alt=typeof g=="function"?g(t.value,t.row):g??"",a.onerror=()=>{a.style.display="none"},l.appendChild(a),l}}class vr{constructor(t){this.def=t}render(t){var e,s,i,n;const o=document.createElement("span");o.style.cssText="display:flex;align-items:center;gap:5px;width:100%;padding:0 4px;box-sizing:border-box;";const l=((e=this.def)==null?void 0:e.max)??100,a=Number(t.value)||0,h=Math.min(100,Math.max(0,a/l*100)),c=(s=this.def)!=null&&s.colorFn?this.def.colorFn(a):((i=this.def)==null?void 0:i.color)??"var(--og-primary,#1976d2)",u=document.createElement("div");u.className="og-progress-track",u.style.cssText=`flex:1;height:10px;background:#e0e0e0;border-radius:${kt.radius(5)};overflow:hidden;`;const d=document.createElement("div");if(d.className="og-progress-fill",d.style.cssText=`width:${h}%;height:100%;background:${c};border-radius:${kt.radius(5)};`,u.appendChild(d),o.appendChild(u),((n=this.def)==null?void 0:n.showLabel)!==!1){const g=document.createElement("span");g.style.cssText="font-size:11px;color:#666;white-space:nowrap;min-width:28px;text-align:right;",g.textContent=`${Math.round(h)}%`,o.appendChild(g)}return o}}class wr{constructor(t){this.def=t}render(t){var e,s,i,n;const o=document.createElement("span");o.style.cssText="display:flex;align-items:center;justify-content:center;height:100%;";const l=Array.isArray(t.value)?t.value.map(Number):[];if(!l.length)return o.textContent="-",o;const a=((e=this.def)==null?void 0:e.width)??80,h=((s=this.def)==null?void 0:s.height)??22,c=((i=this.def)==null?void 0:i.color)??"#1976d2",u=((n=this.def)==null?void 0:n.chartType)??"bar",d=document.createElement("canvas");d.width=a,d.height=h,d.style.cssText="display:block;";const g=d.getContext("2d");if(g){const f=Math.max(...l,1),p=Math.min(...l,0),v=f-p||1,w=l.length;if(u==="bar"){const m=a/w;l.forEach((b,y)=>{const R=(b-p)/v*(h-2);g.fillStyle=c,g.fillRect(y*m+1,h-R-1,m-2,R)})}else{const m=l.map((b,y)=>({x:y/(w-1||1)*a,y:h-(b-p)/v*(h-4)-2}));u==="area"&&(g.fillStyle=c+"33",g.beginPath(),g.moveTo(m[0].x,h),m.forEach(b=>g.lineTo(b.x,b.y)),g.lineTo(m[m.length-1].x,h),g.closePath(),g.fill()),g.strokeStyle=c,g.lineWidth=1.5,g.beginPath(),m.forEach((b,y)=>y===0?g.moveTo(b.x,b.y):g.lineTo(b.x,b.y)),g.stroke()}}return o.appendChild(d),o}}class yr{render(t){const e=document.createElement("span");e.style.cssText="display:flex;align-items:center;justify-content:center;height:100%;";const s=!!t.value,i=document.createElement("span");i.className="og-switch"+(s?" og-switch--on":""),i.style.cssText=`display:inline-block;width:34px;height:18px;border-radius:${kt.radius(9)};
|
|
29
|
+
background:${s?"var(--og-primary,#1976d2)":"#bdbdbd"};
|
|
30
|
+
position:relative;transition:background 0.2s;cursor:pointer;flex-shrink:0;pointer-events:none;`;const n=document.createElement("span");return n.style.cssText=`position:absolute;top:2px;left:${s?"16px":"2px"};
|
|
31
|
+
width:14px;height:14px;border-radius:50%;background:#fff;
|
|
32
|
+
transition:left 0.2s;box-shadow:0 1px 3px rgba(0,0,0,0.3);`,i.appendChild(n),e.appendChild(i),e}}class br{constructor(t){this.def=t}render(t){var e,s;const i=document.createElement("span");i.style.cssText="display:flex;align-items:center;gap:1px;height:100%;";const n=((e=this.def)==null?void 0:e.max)??5,o=Math.round(Number(t.value)||0),l=((s=this.def)==null?void 0:s.color)??"#ffa000";for(let a=1;a<=n;a++){const h=document.createElement("span");h.textContent="★",h.style.cssText=`font-size:14px;color:${a<=o?l:"#e0e0e0"};line-height:1;`,i.appendChild(h)}return i}}class _r{render(t){const e=document.createElement("span");e.style.cssText="display:flex;align-items:center;justify-content:center;height:100%;pointer-events:none;";const s=document.createElement("input");return s.type="radio",s.checked=!!t.value,s.setAttribute("aria-checked",t.value?"true":"false"),s.setAttribute("aria-label",t.column.header??Mt(t,"cell.radioAria")),t.column.group&&(s.name=`og-radio-${t.rowIndex}-${t.column.group}`),s.style.cssText="width:14px;height:14px;cursor:pointer;accent-color:var(--og-primary,#1976d2);",e.appendChild(s),e}}class xr{render(t){const e=document.createElement("span");if(e.style.cssText="display:flex;align-items:center;justify-content:center;height:100%;overflow:hidden;",!t.value)return e;const s=document.createElement("img");return s.src=String(t.value),s.alt=t.column.alt??t.column.field,s.style.cssText="max-width:100%;max-height:100%;object-fit:contain;display:block;",s.setAttribute("role","img"),e.appendChild(s),e}}function Cr(r){const t=document.createElement("div");return t.innerHTML=r,t.querySelectorAll("script,iframe,object,embed").forEach(e=>e.remove()),t.querySelectorAll("*").forEach(e=>{for(const s of[...e.attributes])s.name.startsWith("on")&&e.removeAttribute(s.name);if(e.tagName==="A"){const s=e.getAttribute("href")??"";/^javascript:/i.test(s)&&e.removeAttribute("href")}}),t.innerHTML}class Rr{render(t){const e=document.createElement("span");e.style.cssText="display:block;overflow:hidden;width:100%;";const s=t.column.sanitize!==!1,i=String(t.value??"");return e.innerHTML=s?Cr(i):i,e}}const Er=["212222","222122","222221","121223","121322","131222","122213","122312","132212","221213","221312","231212","112232","122132","122231","113222","123122","123221","223211","221132","221231","213212","223112","312131","311222","321122","321221","312212","322112","322211","212123","212321","232121","111323","131123","131321","112313","132113","132311","211313","231113","231311","112133","112331","132131","113123","113321","133121","313121","211331","231131","213113","213311","213131","311123","311321","331121","312113","312311","332111","314111","221411","431111","111224","111422","121124","121421","141122","141221","112214","112412","122114","122411","142112","142211","241211","221114","413111","241112","134111","111242","121142","121241","114212","124112","124211","411212","421112","421211","212141","214121","412121","111143","111341","131141","114113","114311","411113","411311","113141","114131","311141","411131","211412","211214","211232"],kr="2331112";function Fs(r){let t="",e=!0;for(const s of r)t+=(e?"1":"0").repeat(+s),e=!e;return t}function Mr(r){const t=[104];for(const s of r){const i=s.charCodeAt(0)-32;i>=0&&i<=94&&t.push(i)}let e=104;for(let s=1;s<t.length;s++)e+=t[s]*s;return t.push(e%103),t.map(s=>Fs(Er[s])).join("")+Fs(kr)+"11"}class Sr{render(t){const e=String(t.value??""),s=t.column.barcodeHeight??28,i=document.createElement("div");i.style.cssText="display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;overflow:hidden;gap:1px;",i.setAttribute("role","img"),i.setAttribute("aria-label",Mt(t,"cell.barcodeAria",{value:e})),i.innerHTML=Ar(e,s);const n=document.createElement("span");return n.textContent=e,n.style.cssText="font-size:9px;font-family:monospace;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%;",i.appendChild(n),i}}function Ar(r,t){if(!r)return"";const e=Mr(r),s=1.4,i=6,n=e.length*s+i*2,o=[];let l=0,a=i;for(;l<e.length;)if(e[l]==="1"){let h=0;for(;l+h<e.length&&e[l+h]==="1";)h++;o.push(`<rect x="${a.toFixed(2)}" y="0" width="${(h*s).toFixed(2)}" height="${t}"/>`),a+=h*s,l+=h}else a+=s,l++;return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${n.toFixed(2)} ${t}" width="${n.toFixed(2)}" height="${t}" style="display:block" aria-hidden="true"><g fill="currentColor">${o.join("")}</g></svg>`}const re=new Map;function U(r,t){re.set(r,t)}U("number",()=>new cr),U("date",()=>new dr),U("boolean",()=>new As),U("checkbox",()=>new As),U("radio",()=>new _r),U("img",()=>new xr),U("html",()=>new Rr),U("barcode",()=>new Sr),U("switch",()=>new yr),U("select",r=>new hr(r.options??[],r.optionsFn)),U("button",(r,t)=>new ur(t)),U("link",(r,t)=>new gr(t==null?void 0:t.hrefFn,t==null?void 0:t.target)),U("badge",(r,t)=>new fr(t==null?void 0:t.colorMap,t?t.labelMap??t.valueMap:void 0)),U("image",(r,t)=>t?new mr(t):new vt),U("progress",(r,t)=>t?new vr(t):new vt),U("sparkline",(r,t)=>t?new wr(t):new vt),U("rating",(r,t)=>t?new br(t):new vt),U("template",(r,t)=>t?new pr(t.templateFn):new vt);const Fr=new Set(re.values());function Is(r){const t=r.renderer;return t?typeof t=="string"?t:t.type:String(r.type??"")}function Ls(r){const t=r.renderer;return t&&typeof t!="string"?t:void 0}function Ir(r){const t=re.get(Is(r));return t?t(r,Ls(r)):new vt}function Lr(r){const t=re.get(Is(r));return t?Fr.has(t)?t(r,Ls(r)):null:new vt}class Tr{constructor(t){this.$eq=t,this.$kx=Lr(t)}renderer(){return this.$kx??Ir(this.$eq)}}function Ts(r){return r.getAttribute("role")==="gridcell"}class Or{constructor(t,e){this.$s=t,this.$cL=e,this.$md={top:null,cell:null,ri:-1,ci:-1}}locate(t){let e=t instanceof Element?t:(t==null?void 0:t.parentElement)??null,s=null;for(;e&&e.parentElement!==this.$s;)s=e,e=e.parentElement;if(!e)return null;const i=this.$md;if(i.top=e,i.cell=null,i.ri=-1,i.ci=-1,Ts(e)){const n=this.$cL.get(e);if(n===void 0)return i;i.cell=e,i.ri=n}else e.classList.contains("og-row")&&(i.ri=Number(e.getAttribute("aria-rowindex"))-1,s&&Ts(s)&&(i.cell=s));return i.cell&&(i.ci=Number(i.cell.getAttribute("aria-colindex"))-1),i}}const Dr={dblclick:"onCellDblClick",mousedown:"onCellMouseDown",mouseup:"onCellMouseUp",mousemove:"onCellMouseMove"},Nr={mouseover:"onCellMouseOver",mouseout:"onCellMouseOut"},Os=["click","dblclick","mouseover","mouseout","mousedown","mouseup","mousemove","keydown"];class zr{constructor(t,e,s,i){this.$s=t,this.$mo=e,this.$l=s,this.$aK=i,this.$cn=null,this.$hK=-1,this.$hJ=-1,this.$co=null,this.$jD=n=>{const o=this.$cn;this.$co=n,this.$l.onCellDblClick(this.$hK,this.$hJ,n),o&&!o.isConnected&&this.$cn===o&&this.$cm(null,-1,-1),setTimeout(()=>{this.$co===n&&(this.$co=null)},0)};for(const n of Os)t.addEventListener(n,this)}destroy(){for(const t of Os)this.$s.removeEventListener(t,this);this.$cm(null,-1,-1),this.$co=null}forget(t){this.$cn===t&&this.$cm(null,-1,-1)}$cm(t,e,s){var i;this.$cn!==t&&((i=this.$cn)==null||i.removeEventListener("dblclick",this.$jD),t==null||t.addEventListener("dblclick",this.$jD),this.$cn=t),this.$hK=e,this.$hJ=s}handleEvent(t){const e=t.type;if(e==="keydown"){const l=t.key;(l==="Enter"||l===" ")&&this.$aK.treeToggle(t.target)&&(t.preventDefault(),t.stopPropagation());return}if(e==="click"&&this.$aK.treeToggle(t.target)){t.stopPropagation();return}const s=this.$mo.locate(t.target);if(!s)return;const i=t;if(!s.cell){if(e!=="click")return;s.ri>=0?this.$l.onCellClick(s.ri,-1,i):this.$aK.otherRowClick(s.top);return}if(t.stopPropagation(),e==="click"){this.$cm(s.cell,s.ri,s.ci),this.$l.onCellClick(s.ri,s.ci,i);return}if(e==="dblclick"&&t===this.$co){this.$co=null;return}const n=Nr[e];if(n){const l=i.relatedTarget;l instanceof Node&&s.cell.contains(l)||this.$l[n](s.ri,s.ci,i);return}const o=Dr[e];o&&this.$l[o](s.ri,s.ci,i)}}const oe=Object.freeze([]);function Bt(r,t){return Object.freeze({from:L(r),to:L(t)})}class it{constructor(t,e){this.segments=t,this.count=e;const s=t[0];this.full=t.length===0?e===0:t.length===1&&s.from===0&&s.to===e-1,this.$iI=this.full?oe:it.$lY(t,e),Object.freeze(this)}static full(t){return it.$hZ(t),new it(t===0?oe:Object.freeze([Bt(0,t-1)]),t)}static of(t,e){it.$hZ(e);const s=[];let i=-1;for(let n=0;n<t.length;n++){const o=t[n],l=o.from,a=o.to;if(!Number.isInteger(l)||!Number.isInteger(a)||l<0||a>=e||l>a)throw new RangeError(`ColumnWindow: segment [${l}, ${a}] is outside 0..${e-1}`);if(l<=i)throw new RangeError(`ColumnWindow: segment [${l}, ${a}] overlaps or is out of order`);const h=s[s.length-1];h!==void 0&&l===i+1?s[s.length-1]=Bt(h.from,a):s.push(Bt(l,a)),i=a}return new it(s.length===0?oe:Object.freeze(s),e)}contains(t){const e=this.segments;for(let s=0;s<e.length;s++){const i=e[s];if(t<i.from)return!1;if(t<=i.to)return!0}return!1}forEachColumn(t){const e=this.segments;for(let s=0;s<e.length;s++){const i=e[s];for(let n=i.from;n<=i.to;n++)t(L(n))}}gaps(){return this.$iI}equals(t){if(t===this)return!0;if(t.full!==this.full)return!1;const e=this.segments,s=t.segments;if(e.length!==s.length)return!1;for(let i=0;i<e.length;i++)if(e[i].from!==s[i].from||e[i].to!==s[i].to)return!1;return!0}static $hZ(t){if(!Number.isInteger(t)||t<0)throw new RangeError(`ColumnWindow: column count ${t} is invalid`)}static $lY(t,e){const s=[];let i=0;for(let n=0;n<t.length;n++){const o=t[n];o.from>i&&s.push(Bt(i,o.from-1)),i=o.to+1}return i<e&&s.push(Bt(i,e-1)),s.length===0?oe:Object.freeze(s)}}class $r{constructor(){this.$k=new Map}get size(){return this.$k.size}has(t){return this.$k.has(t)}get(t){return this.$k.get(t)}add(t,e){this.$k.set(t,e)}remove(t){const e=this.$k.get(t);return this.$k.delete(t),e}diff(t,e){const s=[],i=[];for(let n=t.start;n<t.end;n++)this.$k.has(n)||s.push(n);for(const n of this.$k.keys())n>=t.start&&n<t.end||e.indexOf(n)>=0||i.push(n);return i.sort((n,o)=>n-o),{enter:s,leave:i}}forEach(t){const e=Array.from(this.$k.keys()).sort((s,i)=>s-i);for(const s of e)t(s,this.$k.get(s))}clear(){this.$k.clear()}}class Br{constructor(t,e,s,i,n){this.$s=t,this.$T=e,this.$l=s,this.$at=i,this.$bF=n,this.$cL=new Map,this.$eF=new Map,this.$bH=new Map,this.$am={columns:null,diffBlocked:!0},this.$dZ=new $r,this.$cT=new Map,this.$dx=null,this.$ci=0,this.$ez=-1,this.$G=null,this.$I=null,this.$jI=l=>{var a;this.$eA.forget(l);const h=l.firstElementChild;h&&h.classList.contains("og-cf-bar")&&((a=this.$t)==null||a.untrack(h)),this.$bH.size>0&&this.$iE(l)};const o=Bn(s,n);this.$ex=new Wn(e,s,i,n,o),this.$gq=new jn(e,n),this.$k=new Pn([this.$ex,this.$gq,new Gn(e),new Un]),this.$eA=new zr(t,new Or(t,this.$cL),s,{otherRowClick:l=>{var a;const h=this.$eF.get(l);h!==void 0&&((a=this.$gO)==null||a.call(this,h))},treeToggle:l=>{var a;return this.$bH.has(l)?((a=this.$gQ)==null||a.call(this,this.$bH.get(l)),!0):!1}})}get drawn(){return this.$am}$iE(t){const e=t.getElementsByClassName("og-tree-node-icon--toggle");for(let s=0;s<e.length;s++)this.$bH.delete(e[s])}destroy(){this.$eA.destroy(),this.$cL.clear(),this.$eF.clear(),this.$bH.clear()}setGeometry(t){this.$e=t}setApplier(t){this.$t=t}_t(t,e){return this.$bF(t,e)}cell(t,e){return this.$at.get(t,e)}rebuildWindow(t){if(t.rowWork==="diff"&&this.$lq(t)){this.$lA(t);return}const{startIndex:e,endIndex:s,data:i,totalHeight:n,groupFlatRows:o=null,onGroupToggle:l,onTreeToggle:a,extraOpts:h={},mergeEngine:c,detailApi:u}=t,d=this.$t;d==null||d.release("body");let g=t.opts;Object.keys(h).length&&(g={...g,...h}),u==null||u.onBeforeTeardown(),this.$s.innerHTML="",this.$at.clear(),this.$dZ.clear(),this.$cT.clear(),this.$cL.clear(),this.$eF.clear(),this.$bH.clear(),this.$gO=l,this.$gQ=a;const f=g.autoHeight===!0;this.$s.classList.toggle("og-autoheight",f),this.$s.style.height=f?"":`${n}px`;const p=g._frozenCount??0,v=this.$e,w=v.extra,m=!!u&&w.widthOf("detail")>0,b=t.columns??it.full(v.count);this.$am.columns=b,this.$am.diffBlocked=f||o!==null||!!(c&&!c.isEmpty),this.$I=t,this.$G=null,this.$ci=e,this.$ez=s;const y=v.totalWidth();if(this.$s.style.minWidth=`${y}px`,d==null||d.trackTotal(this.$s,"minWidth","body"),s<e)return;const R=document.createDocumentFragment(),_=this.$if(t,g,b,f,p,m,y,R),S=this.$k;if(o&&u)for(let M=e-1;M>=0;M--){const C=o[M];if(!(C&&C._isDetailFiller===!0)){if(C&&C._isDetailHead===!0&&M+C._span-1>=e){const E=S.painterFor("detail-head").paint(M,C,_);E&&R.appendChild(E)}break}}for(let M=e;M<=s;M++){const C=o?o[M]:null,E=S.painterFor(S.kindOf(C)).paint(M,C,_);E&&(R.appendChild(E),this.$am.diffBlocked||(this.$dZ.add(M,E),this.$cT.set(M,this.$fw(M,_,_.rowState))))}if(i.rowCount===0){const M=D("div","og-empty-message");M.textContent=this._t("grid.emptyMessage"),M.style.cssText="width:100%;",R.appendChild(M)}this.$s.appendChild(R)}$if(t,e,s,i,n,o,l,a){const{startIndex:h,endIndex:c,data:u,leaves:d,offsetY:g,selectedRows:f,checkedRows:p,groupFlatRows:v=null,mergeEngine:w,detailApi:m}=t,b=this.$e,y=b.extra,R=this.$t,_={opts:e,data:u,leaves:d,startIndex:h,endIndex:c,offsetY:g,selectedRows:f,checkedRows:p,groupFlatRows:v,mergeEngine:w,detailApi:m,detailColOn:o,auto:i,frozenCount:n,geometry:b,totalColWidth:l,frag:a,columns:s,layout:_s(s),plans:d.map(S=>new Tr(S)),masters:this.$cL,groupKeys:this.$eF,treeIcons:this.$bH,extraIds:y.ids,extraLeft:{state:y.leftOf("state"),drag:y.leftOf("drag"),rowNumber:y.leftOf("rowNumber"),check:y.leftOf("check"),detail:y.leftOf("detail")},extraWidth:y.width(),dragWidth:y.widthOf("drag"),detailWidth:y.widthOf("detail"),applier:R,trackBar:void 0,rowState:"none",bg:"",dnd:null,dragGap:0,cellCi:0,cellSpan:1,rowData:null,treeNode:null,extraCount:0};return this.$G=_,R&&(_.trackBar=(S,M)=>R.trackBar(S,_.cellCi,_.cellSpan,M)),_}$fw(t,e,s){const i=e.opts,n=i._focusCell;let o=`${s??e.data.getRowState(t)}|${e.selectedRows.has(t)?1:0}|${e.checkedRows.has(t)?1:0}|${n&&n.ri===t?n.ci:-1}`;const l=i._rangeRects;if(l)for(const a of l)t>=a.startRow&&t<=a.endRow&&(o+=`|${a.startCol}-${a.endCol}`);return o}$lq(t){const e=this.$I,s=this.$G;if(!e||!s||this.$am.diffBlocked||this.$dZ.size===0||t.data!==e.data||t.leaves.length!==e.leaves.length||t.opts.rowHeight!==e.opts.rowHeight||(t.groupFlatRows??null)!==null||t.opts.autoHeight===!0||t.mergeEngine&&!t.mergeEngine.isEmpty||t.endIndex<t.startIndex)return!1;const i=this.$am.columns,n=t.columns??it.full(this.$e.count);return!i||i.count!==n.count?!1:Math.min(this.$ez,t.endIndex)>=Math.max(this.$ci,t.startIndex)}$lA(t){var e;const s=this.$am.columns,{startIndex:i,endIndex:n,totalHeight:o,extraOpts:l={}}=t;let a=t.opts;Object.keys(l).length&&(a={...a,...l});const h=this.$e,c=t.columns??it.full(h.count),u=`${o}px`;this.$s.style.height!==u&&(this.$s.style.height=u);const d=h.totalWidth(),g=`${d}px`;this.$s.style.minWidth!==g&&(this.$s.style.minWidth=g);const f=!!t.detailApi&&h.extra.widthOf("detail")>0,p=document.createDocumentFragment(),v=((e=this.$G)==null?void 0:e.extraCount)??0,w=this.$if(t,a,c,!1,a._frozenCount??0,f,d,p);w.extraCount=v,this.$I=t,this.$ci=i,this.$ez=n,this.$gO=t.onGroupToggle,this.$gQ=t.onTreeToggle;const m=this.$dZ,b=this.$dx!==null?[this.$dx]:[],{enter:y,leave:R}=m.diff({start:ne(i),end:ne(n+1)},b);for(const x of R)this.$ga(x,m.remove(x));const _=this.$ex,S=!s.equals(c),M=a.rowHeight;m.forEach((x,T)=>{if(x!==this.$dx&&this.$cT.get(x)!==this.$fw(x,w)){this.$ga(x,T,!0);const P=_.paint(x,null,w);P?(T.replaceWith(P),this.$cT.set(x,this.$fw(x,w,w.rowState)),m.add(x,P)):(T.remove(),m.remove(x));return}S&&_.shift(T,x,null,s,w,this.$jI);const O=`${t.offsetY+(x-i)*M}px`;T.style.top!==O&&(T.style.top=O)});const C=[];m.forEach(x=>{C.push(x)});let E=0;for(const x of y){for(;E<C.length&&C[E]<x;)E++;const T=E<C.length?m.get(C[E]):null,O=_.paint(x,null,w);O&&(this.$s.insertBefore(O,T),m.add(x,O),this.$cT.set(x,this.$fw(x,w,w.rowState)))}p.firstChild&&this.$s.appendChild(p),this.$am.columns=c}$ga(t,e,s=!1){this.$at.dropRow(t),this.$cT.delete(t);const i=this.$t,n=e.getElementsByTagName("*");for(let o=0;o<n.length;o++){const l=n[o];i==null||i.untrack(l),l.getAttribute("role")==="gridcell"&&this.$eA.forget(l)}i==null||i.untrack(e),this.$bH.size>0&&this.$iE(e),s||e.remove()}pin(t){if(!("editRow"in t))return;const e=this.$dx,s=t.editRow??null;if(this.$dx=s,e===null||e===s||e>=this.$ci&&e<=this.$ez)return;const i=this.$dZ.remove(e);i&&this.$ga(e,i)}update(t,e,s){const i=t.columns;if(e==="rebuild"||e==="clear"||e==="diff"){this.$I&&this.rebuildWindow({...this.$I,columns:i});return}if(s!=="shift")return;const n=this.$am.columns,o=this.$G;if(n&&n.equals(i))return;if(!n||!o||n.count!==i.count){this.$I&&this.rebuildWindow({...this.$I,columns:i});return}o.columns=i,o.layout=_s(i);const l=o.groupFlatRows;for(let a=this.$s.firstElementChild;a;a=a.nextElementSibling){const h=a.classList;if(h.contains("og-row")){const c=Number(a.getAttribute("aria-rowindex"))-1;this.$ex.shift(a,c,l?l[c]:null,n,o,this.$jI)}else h.contains("og-group-row")&&l&&this.$gq.shift(a,l[Number(a.getAttribute("aria-rowindex"))-1],o)}this.$am.columns=i}}class Pr{constructor(){this.$db=[],this.$q=null,this.$ad=0,this.$bx=()=>{this.sync(this.$q.scrollLeft)}}follow(t){this.$db.indexOf(t)>=0||(this.$db.push(t),this.$ad!==0&&(t.scrollLeft=this.$ad))}unfollow(t){const e=this.$db.indexOf(t);e>=0&&this.$db.splice(e,1)}sync(t){this.$ad=t;const e=this.$db;for(let s=0;s<e.length;s++)e[s].scrollLeft=t}listenTo(t){this.$q!==t&&(this.$ii(),this.$q=t,t.addEventListener("scroll",this.$bx,{passive:!0}))}destroy(){this.$ii(),this.$db.length=0,this.$ad=0}$ii(){this.$q&&(this.$q.removeEventListener("scroll",this.$bx),this.$q=null)}}function le(r,t,e){return r.spanWidth(L(t),e-t+1)}function Me(r,t,e){for(const s of r.widthCols){if(s>e)return!1;if(s>=t)return!0}return!1}function wt(r,t){return{touched:t,emit:(e,s,i,n)=>n(s.el,r(e,s))}}const Pt=(r,t)=>Me(r,t.ci,t.last),Ds={cell:wt((r,t)=>le(r,t.ci,t.last),Pt),span:wt((r,t)=>le(r,t.ci,t.last)+t.extra,Pt),gap:wt((r,t)=>le(r,t.ci,t.last)+t.extra,Pt),left:wt((r,t)=>r.leftOf(L(t.ci)),(r,t)=>t.ci>=r.leftFrom),total:wt(r=>r.totalWidth(),r=>r.totalChanged),extra:wt(r=>r.extra.width(),()=>!1),bar:wt((r,t)=>Math.max(0,Math.min(1,t.ratio))*le(r,t.ci,t.last),Pt),row:{touched:Pt,emit:(r,t,e,s)=>{const i=t.el.children;for(let n=t.ci;n<=t.last;n++){if(e&&!Me(e,n,n))continue;const o=i[t.child+(n-t.ci)];o&&s(o,r.widthOf(L(n)))}}}},St={w:["width"],wm:["width","minWidth"],wmm:["width","minWidth","maxWidth"]},ae=St.w,Vr=["minWidth"],Hr=["left"],Wr=St.wmm,Vt=r=>`${r}px`;class jr{constructor(t,e){this.$aS={header:new Map,body:new Map,footer:new Map},this.$e=t,this.$p=e}writeCellWidth(t,e,s){const i=Vt(this.$e.widthOf(L(e)));for(const n of St[s])t.style[n]=i}trackHeaderCell(t,e,s){this._add("header",t,"cell",e,e,St[s],0,0)}trackSpan(t,e,s,i,n,o=0){this._add(n,t,"span",e,e+Math.max(1,s)-1,St[i],0,0,o)}trackRowCells(t,e,s,i,n,o){i<s||this._add(o,t,"row",s,i,St[n],0,e)}trackLeft(t,e,s){this._add(s,t,"left",e,e,Hr,0,0)}trackTotal(t,e,s){this._add(s,t,"total",0,0,e==="width"?ae:Vr,0,0)}trackExtra(t,e){this._add(e,t,"extra",0,0,ae,0,0)}trackGap(t,e,s,i,n=0){this._add(i,t,"gap",e,s,ae,0,0,n)}trackBar(t,e,s,i){this._add("body",t,"bar",e,e+Math.max(1,s)-1,ae,i,0)}untrack(t){this.$aS.header.delete(t),this.$aS.body.delete(t),this.$aS.footer.delete(t)}release(t){this.$aS[t].clear()}applyChange(t,e){if(t.none)return;const s=this.$e,i=t.structural,n=(e==null?void 0:e.skipScope)==="body",o=n?0:s.count,l=s.frozenCount;for(let h=0;h<o;h++){const c=i||Me(t,h,h),u=h<l&&(i||h>=t.leftFrom);if(!c&&!u)continue;const d=Vt(s.widthOf(L(h))),g=Vt(s.leftOf(L(h)));for(const f of this.$p.cellsOfColumn(h)){if(c)for(const p of Wr)Se(f,p,d);u&&Se(f,"left",g)}}const a=i?null:t;for(const h of this.$ca())if(!(n&&h===this.$aS.body))for(const[c,u]of h){if(!c.isConnected){h.delete(c);continue}for(const d of u){const g=Ds[d.kind];a&&!g.touched(a,d)||g.emit(s,d,a,(f,p)=>{const v=Vt(p);for(const w of d.props)Se(f,w,v)})}}}projections(t){const e=[];for(const s of this.$ca(t))for(const i of s.values())for(const n of i)Ds[n.kind].emit(this.$e,n,null,(o,l)=>{for(const a of n.props)e.push({el:o,prop:a,value:Vt(l)})});return e}trackedCount(t){let e=0;for(const s of this.$ca(t))for(const i of s.values())e+=i.length;return e}$ca(t){return t?[this.$aS[t]]:[this.$aS.header,this.$aS.body,this.$aS.footer]}_add(t,e,s,i,n,o,l,a,h=0){const c=this.$aS[t],u={el:e,kind:s,ci:i,last:n,props:o,ratio:l,child:a,extra:h},d=c.get(e);if(!d){c.set(e,[u]);return}const g=d.findIndex(f=>f.kind===s);g>=0?d[g]=u:d.push(u)}}function Se(r,t,e){r.style[t]!==e&&(r.style[t]=e)}class Gr{constructor(t,e,s){this.$s=t,this.$N=e,this.$ej=s,this.$bB=null,this.$gZ=0,!(typeof ResizeObserver>"u")&&(this.$bB=new ResizeObserver(()=>this.measure()),this.$bB.observe(t))}get px(){return this.$gZ}measure(){const t=Math.max(0,Math.round(this.$N.clientWidth-this.$s.clientWidth));t!==this.$gZ&&(this.$gZ=t,this.$ej(t))}destroy(){var t;(t=this.$bB)==null||t.disconnect(),this.$bB=null}}class Ur{constructor(t,e,s,i){this.$at=new gn,this.$aJ=new Pr,this.$t=null,this.$V=null,this.$iO=null,this._root=t,this.$aA=e,this.$l=s,this.$aP=new An(n=>n.offsetWidth,(n,o)=>s.onColResize(n,o)),this.$T=i??new _e(new ee(e.theme??"default")),this.$N=D("div","og-header"),this.$N.style.cssText=`flex-shrink:0;overflow-x:auto;overflow-y:hidden;border:0;border-bottom:${this.$T.divider()};scrollbar-width:none;`,this.$bs=new In(this.$N,this.$T,this.$l,this.$aP,(n,o)=>this._t(n,o)),this.$aV=D("div","og-body-wrapper"),this.$aV.style.cssText="flex:1;overflow:auto;position:relative;",this.$aV.style.setProperty("--scrollbar-size","8px"),this.$s=D("div","og-body"),this.$s.style.cssText="position:relative;",this.$aV.appendChild(this.$s),this.$cs=new Br(this.$s,this.$T,this.$l,this.$at,(n,o)=>this._t(n,o)),t.appendChild(this.$N),t.appendChild(this.$aV),this.$aJ.follow(this.$N),this.$aJ.listenTo(this.$aV),this.$V=new Gr(this.$aV,this.$N,n=>{var o;this.$bs.setEndGutter(n),(o=this.$iO)==null||o.call(this,n)})}get follower(){return this.$aJ}get applier(){return this.$t}get bodyView(){return this.$cs}onEndGutter(t){var e;this.$iO=t,(e=this.$V)!=null&&e.px&&t(this.$V.px)}connectResize(t){this.$aP.connect(t)}commitColumnResize(t,e){this.$l.onColResize(t,e)}get bodyWrapper(){return this.$aV}_t(t,e){return this.$l.t?this.$l.t(t,e):B(t,e)}updateSize(t,e){this.$aV.style.height=`${t-e}px`}setSortIndicator(t){this.$bs.setSortIndicator(t)}setGeometry(t){this.$bs.setGeometry(t),this.$cs.setGeometry(t),this.$t=new jr(t,this.$at),this.$bs.setApplier(this.$t),this.$cs.setApplier(this.$t)}getHeaderHeight(){return this.$bs.height()}renderHeader(t,e,s,i,n){this.$bs.paint(t,e,s,i,n)}renderBody(t){this.$cs.rebuildWindow(t)}getCellEl(t,e){return this.$at.get(t,e)}destroy(){var t;this.$aJ.destroy(),(t=this.$V)==null||t.destroy(),this.$bs.destroy(),this.$cs.destroy(),this._root.innerHTML=""}}function Kr(r,t,e,s){const i=D("span","og-detail-expander");i.textContent=r.glyph,i.title=r.title,i.setAttribute("role","button"),i.setAttribute("tabindex","0"),i.setAttribute("aria-label",r.ariaLabel),t&&i.setAttribute("aria-controls",`og-detail-${t}`),i.style.cssText="cursor:pointer;display:inline-flex;align-items:center;justify-content:center;min-width:22px;min-height:22px;user-select:none;line-height:1;";const n=t,o=e,l=a=>{a.stopPropagation(),n&&s.onToggle(o,n)};return i.addEventListener("click",l),i.addEventListener("keydown",a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),l(a))}),i}function Ns(r,t,e="text/plain;charset=utf-8"){const s=new Blob([r],{type:e}),i=URL.createObjectURL(s),n=document.createElement("a");n.href=i,n.download=t,n.click(),URL.revokeObjectURL(i)}const qr=new Set(["--og-radius-none","--og-radius-sm","--og-radius-md","--og-radius-lg","--og-radius-pill","--og-radius-container","--og-radius-control","--og-radius-widget","--og-container-radius","--og-border-width","--og-border-width-strong","--og-border-style","--og-divider-style","--og-divider-repeat","--og-elevation-sm","--og-elevation-md","--og-elevation-lg","--og-elevation-alpha-sm","--og-elevation-alpha-md","--og-elevation-alpha-lg","--og-elevation-inset","--og-cell-padding-x","--og-cell-padding-y","--og-density-row-height","--og-density-header-height","--og-density-footer-height","--og-scrollbar-size","--og-texture-bg","--og-texture-size","--og-texture-opacity","--og-focus-width","--og-focus-style","--og-focus-offset","--og-focus-radius","--og-icon-size","--og-icon-fill","--og-icon-stroke-width","--og-icon-corner","--og-transition-fast","--og-transition-base","--og-row-accent-width"]),Yr=/#[0-9a-fA-F]{3,8}\b/,Xr=/\b(?:rgba?|hsla?)\(\s*\d/,Zr=/\b(?:red|green|blue|black|white|gray|grey|yellow|orange|purple|pink|brown|cyan|magenta)\b/i;function zs(r,t){for(const[e,s]of Object.entries(t)){const i=e;if(!qr.has(i))throw new Error(`[SkinRegistry] 스킨 "${r}" 의 토큰 "${i}" 은 FORM 토큰이 아닙니다. 스킨은 형태(radius/border/elevation/…)만 소유하며 색 토큰은 data-og-theme 축입니다(색⊥형태 직교성).`);const n=String(s??"");if(Yr.test(n)||Xr.test(n)||Zr.test(n))throw new Error(`[SkinRegistry] 스킨 "${r}" 토큰 "${i}: ${n}" 에 색 리터럴이 있습니다. 스킨 델타는 색을 담을 수 없습니다(Rule 2). 색이 필요하면 COLOR 토큰(예: var(--og-texture-ink))을 참조하세요.`)}}function $s(r,t){const e={...t},s=[],i=e["--og-focus-width"];if(i!=null){const n=parseFloat(String(i));!Number.isNaN(n)&&n<2&&(e["--og-focus-width"]="2px",s.push(`focus-width ${i} → 2px (가시 포커스 최소 2px, 접근성 가드레일)`))}return e["--og-focus-style"]==="none"&&(e["--og-focus-style"]="solid",s.push("focus-style none → solid (가시 포커스 비협상, 접근성 가드레일)")),{delta:e,warnings:s}}class Bs{constructor(){this.$eb=new Map,this.$ed=null}registerBuiltin(t,e){zs(t,e);const{delta:s}=$s(t,e);this.$eb.set(t,s)}define(t,e){zs(t,e);const s=$s(t,e);this.$eb.set(t,s.delta);for(const i of s.warnings)typeof console<"u"&&console.warn(`[SkinRegistry] "${t}": ${i}`);return this.$mh(t,s.delta),s}has(t){return this.$eb.has(t)}get(t){return this.$eb.get(t)}list(){return[...this.$eb.keys()]}$mh(t,e){if(typeof document>"u")return;this.$ed||(this.$ed=document.createElement("style"),this.$ed.setAttribute("data-og-skins","runtime"),document.head.appendChild(this.$ed));const s=Object.entries(e).map(([i,n])=>` ${i}: ${n};`).join(`
|
|
33
|
+
`);this.$ed.appendChild(document.createTextNode(`
|
|
34
|
+
.og-container[data-og-skin="${t}"] {
|
|
35
|
+
${s}
|
|
36
|
+
}
|
|
37
|
+
`))}}const Jr={"--og-radius-sm":"0","--og-radius-md":"0","--og-radius-lg":"0","--og-radius-pill":"0","--og-radius-container":"0","--og-container-radius":"0","--og-border-width":"1px","--og-border-style":"solid","--og-divider-style":"solid","--og-elevation-sm":"none","--og-elevation-md":"none","--og-elevation-lg":"0 1px 2px","--og-cell-padding-x":"6px","--og-density-row-height":"28","--og-density-header-height":"28","--og-focus-width":"2px","--og-focus-style":"solid","--og-focus-radius":"0","--og-icon-fill":"0","--og-icon-corner":"miter"},Qr={"--og-radius-sm":"4px","--og-radius-md":"8px","--og-radius-lg":"12px","--og-radius-pill":"999px","--og-radius-container":"12px","--og-container-radius":"12px","--og-radius-control":"8px","--og-radius-widget":"6px","--og-border-width":"1px","--og-border-style":"solid","--og-elevation-sm":"0 1px 3px","--og-elevation-md":"0 4px 12px","--og-elevation-lg":"0 12px 32px","--og-elevation-alpha-sm":"0.06","--og-elevation-alpha-md":"0.10","--og-elevation-alpha-lg":"0.16","--og-cell-padding-x":"12px","--og-cell-padding-y":"2px","--og-density-row-height":"40","--og-density-header-height":"42","--og-focus-width":"2px","--og-focus-offset":"2px","--og-focus-radius":"8px","--og-icon-fill":"0","--og-icon-corner":"round"},to={"--og-radius-sm":"2px","--og-radius-md":"3px","--og-radius-lg":"4px","--og-container-radius":"3px","--og-border-width":"1px","--og-border-style":"dashed","--og-divider-style":"dashed","--og-divider-repeat":"2","--og-texture-bg":"repeating-linear-gradient(45deg, rgba(var(--og-texture-ink),0.04) 0 2px, transparent 2px 6px)","--og-texture-size":"6px 6px","--og-texture-opacity":"1","--og-elevation-sm":"0 1px 2px","--og-elevation-md":"0 2px 4px","--og-elevation-lg":"0 4px 10px","--og-cell-padding-x":"10px","--og-density-row-height":"36","--og-focus-style":"dashed","--og-icon-fill":"0","--og-icon-corner":"round"},eo={"--og-radius-sm":"2px","--og-radius-md":"3px","--og-radius-lg":"4px","--og-container-radius":"4px","--og-border-width":"1px","--og-border-style":"solid","--og-divider-style":"solid","--og-elevation-sm":"none","--og-elevation-md":"none","--og-elevation-lg":"none","--og-elevation-inset":"none","--og-cell-padding-x":"10px","--og-density-row-height":"34","--og-focus-width":"2px","--og-focus-style":"solid","--og-icon-fill":"0","--og-icon-corner":"round"},so={"--og-radius-sm":"0","--og-radius-md":"2px","--og-radius-lg":"2px","--og-container-radius":"2px","--og-border-width":"2px","--og-border-width-strong":"3px","--og-border-style":"solid","--og-divider-style":"solid","--og-elevation-sm":"none","--og-elevation-md":"0 2px 4px","--og-elevation-lg":"0 4px 8px","--og-elevation-alpha-md":"0.30","--og-elevation-alpha-lg":"0.40","--og-cell-padding-x":"10px","--og-density-row-height":"40","--og-focus-width":"3px","--og-focus-style":"solid","--og-focus-offset":"2px","--og-focus-radius":"0","--og-icon-size":"18px","--og-icon-fill":"1","--og-icon-stroke-width":"2","--og-icon-corner":"miter"},io={"--og-radius-sm":"2px","--og-radius-md":"4px","--og-radius-lg":"8px","--og-container-radius":"8px","--og-radius-control":"4px","--og-radius-widget":"4px","--og-border-width":"1px","--og-border-style":"solid","--og-divider-style":"solid","--og-elevation-sm":"0 1px 2px","--og-elevation-md":"0 2px 6px","--og-elevation-lg":"0 8px 24px","--og-elevation-alpha-sm":"0.12","--og-elevation-alpha-md":"0.16","--og-elevation-alpha-lg":"0.20","--og-cell-padding-x":"8px","--og-density-row-height":"36","--og-focus-width":"2px","--og-focus-style":"solid","--og-focus-offset":"1px","--og-icon-fill":"0","--og-icon-corner":"round"},no=[["sharp",Jr],["rounded",Qr],["stitch",to],["flat",eo],["high-contrast",so],["material",io]],Ae=new Bs;for(const[r,t]of no)Ae.registerBuiltin(r,t);const ro="default",Ps=Object.freeze({tokens:Object.freeze({})});function Vs(r,t,e){for(const s of Object.keys(e))if(!t.has(s))throw new Error(`[AppearanceAxis:${r}] 토큰 "${s}" 은 ${r} 축 이름공간이 아닙니다. 각 축은 자기 이름공간 토큰만 소유합니다(축 섞임 금지 — 이름-분리 물리 직교, 불변식 1).`)}class Hs{constructor(t){this.$ah=new Map,this.id=t.id,this.namespace=t.namespace,this.$hL=t.attrName,this.$kg=t.requiresRelayout??!1}registerBuiltin(t,e){Vs(this.id,this.namespace,e),this.$ah.set(t,this.$cB(t,e).delta)}$cB(t,e){return{delta:e,warnings:[]}}define(t,e){Vs(this.id,this.namespace,e);const s=this.$cB(t,e);this.$ah.set(t,s.delta);for(const i of s.warnings)typeof console<"u"&&console.warn(`[AppearanceAxis:${this.id}] "${t}": ${i}`);return s}has(t){return this.$ah.has(t)}resolve(t){if(t===ro)return Ps;const e=this.$ah.get(t);if(e===void 0)return Ps;const s={tokens:e,attr:{name:this.$hL,value:t}};return this.$kg&&(s.requiresRelayout=!0),s}list(){return[...this.$ah.keys()]}}const Ws=new Set(["--og-density-row-height","--og-density-header-height","--og-density-footer-height","--og-font-size","--og-density-touch-min"]),Fe=44;class oo extends Hs{constructor(){super({id:"density",attrName:"data-og-density",namespace:Ws,requiresRelayout:!0})}$cB(t,e){const s={...e},i=[];for(const n of["--og-density-row-height","--og-density-header-height","--og-density-footer-height"]){const o=s[n];if(o==null)continue;const l=parseFloat(String(o));!Number.isNaN(l)&&l<Fe&&t.includes("touch")&&(s[n]=`${Fe}px`,i.push(`${n} ${o} → ${Fe}px (터치 히트타깃 최소 44px, REQ-T2-018)`))}return{delta:s,warnings:i}}}const lo={"--og-density-row-height":"28px","--og-density-header-height":"30px","--og-density-footer-height":"28px","--og-font-size":"12px"},ao={"--og-density-row-height":"36px","--og-density-header-height":"38px","--og-density-footer-height":"36px","--og-font-size":"13px"},ho={"--og-density-row-height":"40px","--og-density-header-height":"44px","--og-density-footer-height":"40px","--og-font-size":"14px"},co={"--og-density-row-height":"56px","--og-density-header-height":"48px","--og-density-footer-height":"48px","--og-font-size":"15px"},uo={"--og-density-row-height":"44px","--og-density-header-height":"44px","--og-density-footer-height":"44px","--og-font-size":"13px"},fo=[["compact",lo],["comfortable",ao],["spacious",ho],["gallery",co],["compact-touch",uo]],js=new oo;for(const[r,t]of fo)js.registerBuiltin(r,t);const Gs=new Set(["--og-texture-bg","--og-texture-size","--og-texture-opacity","--og-texture-seam","--og-texture-zone"]),Ie=.1;class go extends Hs{constructor(){super({id:"texture",attrName:"data-og-texture",namespace:Gs})}$cB(t,e){const s={...e},i=[],n=s["--og-texture-opacity"];if(n!=null){const o=parseFloat(String(n));!Number.isNaN(o)&&o>Ie&&(s["--og-texture-opacity"]=String(Ie),i.push(`--og-texture-opacity ${n} → ${Ie} (질감 알파 정직 상한, 텍스트 아래 AA 안전, §9.5)`))}return{delta:s,warnings:i}}}const po={"--og-texture-bg":"repeating-linear-gradient(0deg, rgba(var(--og-texture-ink, 0, 0, 0),0.05) 0 1px, transparent 1px 4px), repeating-linear-gradient(90deg, rgba(var(--og-texture-ink, 0, 0, 0),0.04) 0 1px, transparent 1px 4px)","--og-texture-size":"4px 4px","--og-texture-opacity":"0.06","--og-texture-zone":"chrome"},mo={"--og-texture-bg":"radial-gradient(rgba(var(--og-texture-ink, 0, 0, 0),0.05) 0.5px, transparent 0.5px)","--og-texture-size":"3px 3px","--og-texture-opacity":"0.05","--og-texture-zone":"chrome"},vo={"--og-texture-bg":"repeating-linear-gradient(0deg, rgba(var(--og-texture-ink, 0, 0, 0),0.06) 0 1px, transparent 1px 8px), repeating-linear-gradient(90deg, rgba(var(--og-texture-ink, 0, 0, 0),0.06) 0 1px, transparent 1px 8px)","--og-texture-size":"8px 8px","--og-texture-opacity":"0.07","--og-texture-seam":"var(--og-texture-ink)","--og-texture-zone":"chrome"},wo=[["linen",po],["paper-grain",mo],["graph",vo]],Us=new go;for(const[r,t]of wo)Us.registerBuiltin(r,t);const yt=[{id:"state",width:24},{id:"drag",width:18},{id:"rowNumber",width:44},{id:"check",width:36},{id:"detail",width:28}],Ks=new Array(1<<yt.length);class we{constructor(t){const e=[];this.$ai=new Float64Array(yt.length),this.$w=new Float64Array(yt.length);let s=0;for(let i=0;i<yt.length;i++){const n=(t&1<<i)!==0;this.$w[i]=s,n&&(e.push(yt[i].id),this.$ai[i]=yt[i].width,s+=yt[i].width)}this.ids=Object.freeze(e),this._total=s}static fromOptions(t){const e=t??{},s=(e.stateColumn?1:0)|(e.draggable?2:0)|(e.rowNumber?4:0)|(e.checkColumn?8:0)|(e.detailExpanderCol?16:0);return Ks[s]??(Ks[s]=new we(s))}widthOf(t){return j(this.$ai[qs(t)])}leftOf(t){const e=qs(t);return j(this.$ai[e]>0?this.$w[e]:this._total)}width(){return j(this._total)}}const yo={state:0,drag:1,rowNumber:2,check:3,detail:4};function qs(r){return yo[r]}function bo(r,t){const e=r.length-1;if(e<=0)return 0;let s=0,i=e-1;const n=Math.max(0,t);for(;s<i;){const o=s+i+1>>>1;r[o]<=n?s=o:i=o-1}return s}class _o{constructor(t,e){const s=t.map(n=>Math.max(0,n)),i=new Array(s.length+1);i[0]=0;for(let n=0;n<s.length;n++)i[n+1]=i[n]+s[n];this.$aj=s,this.$w=i,this.$go=Math.max(0,Math.min(Math.floor(e),s.length))}get count(){return this.$aj.length}totalWidth(){return j(this.$w[this.$aj.length])}leftOf(t){const e=this.$ls(t);return j(this.$w[e])}widthOf(t){return t<0||t>=this.$aj.length?j(0):j(this.$aj[Math.floor(t)])}colAt(t){return L(bo(this.$w,t))}get frozenLeft(){return this.$go}frozenWidth(){return j(this.$w[this.$go])}$ls(t){return t<0?0:t>this.$aj.length?this.$aj.length:Math.floor(t)}}const xo=64,Co=Object.freeze([]);function Ys(r,t){return Object.freeze({none:!0,widthCols:Co,leftFrom:L(t),totalChanged:!1,structural:!1,version:r})}const Xs=1e15;function Zs(r){return j(Number.isFinite(r)&&r>0?Math.min(Xs,r):0)}function Js(r,t){return Number.isFinite(r)?Math.max(0,Math.min(Math.floor(r),t)):0}function Ro(r,t){if(r===t)return!0;if(r.ids.length!==t.ids.length)return!1;for(let e=0;e<r.ids.length;e++){const s=r.ids[e];if(s!==t.ids[e]||r.widthOf(s)!==t.widthOf(s))return!1}return!0}class Eo{constructor(t,e,s){this.$dI=0,this.$bf=0,this.$aY=[],this.$cr=0,this.$eK(t.map(Zs),e,s),this.$cN=Ys(this.$bf,this.count)}get version(){return this.$bf}get count(){return this.$aM.count}get frozenCount(){return this.$aM.frozenLeft}get extra(){return this.$dz}widthOf(t){return Number.isInteger(t)?this.$aM.widthOf(t):j(0)}leftOf(t){return j(this.$dI+this.$aM.leftOf(Number.isFinite(t)?t:L(0)))}spanWidth(t,e){if(!(e>0)||!Number.isFinite(t))return j(0);const s=this.count,i=Math.min(s,Math.max(0,Math.floor(t))),n=Math.min(s,i+Math.floor(e));return j(this.$aM.leftOf(L(n))-this.$aM.leftOf(L(i)))}totalWidth(){return j(this.$dI+this.$aM.totalWidth())}frozenRight(){return j(this.$dI+this.$aM.frozenWidth())}colAt(t){return this.$aM.colAt(j(t-this.$dI))}widths(){return this.$aj}changesSince(t){if(t===this.$bf)return this.$cN;if(!(t>=this.$cr&&t<this.$bf))return this.$kG();const e=t-this.$cr;if(e===this.$aY.length-1)return this.$aY[e];let s=this.count,i=!1;for(let l=e;l<this.$aY.length;l++){const a=this.$aY[l];if(a.structural)return this.$kG();a.totalChanged&&(i=!0),a.leftFrom<s&&(s=a.leftFrom)}const n=new Set;for(let l=e;l<this.$aY.length;l++)for(const a of this.$aY[l].widthCols)n.add(a);const o=Array.from(n).sort((l,a)=>l-a).map(L);return Object.freeze({none:!1,widthCols:Object.freeze(o),leftFrom:L(s),totalChanged:i,structural:!1,version:this.$bf})}reset(t,e,s){const i=t.map(Zs),n=Js(s,i.length),o=i.length!==this.count||n!==this.frozenCount||!Ro(e,this.$dz),l=this.totalWidth();if(o)return this.$eK(i,e,s),this.$bj(this.$kF(this.totalWidth()!==l));const a=[];for(let h=0;h<i.length;h++)i[h]!==this.$aj[h]&&a.push(L(h));return this.$dz=e,a.length===0?this.$cN:(this.$eK(i,e,s),this.$bj({widthCols:Object.freeze(a),leftFrom:L(a[0]+1),totalChanged:this.totalWidth()!==l,structural:!1}))}resize(t,e){if(!Number.isInteger(t)||t<0||t>=this.count)throw new RangeError(`column index out of range: ${t} (count ${this.count})`);if(!Number.isFinite(e))return this.$cN;const s=Math.min(Xs,Math.max(1,Math.round(e)));if(s===this.$aj[t])return this.$cN;const i=this.$aj.slice();return i[t]=j(s),this.$eK(i,this.$dz,this.frozenCount),this.$bj({widthCols:Object.freeze([t]),leftFrom:L(t+1),totalChanged:!0,structural:!1})}$eK(t,e,s){this.$aj=Object.freeze(t),this.$aM=new _o(t,Js(s,t.length)),this.$dz=e,this.$dI=e.width()}$bj(t){this.$bf++;const e=Object.freeze({none:!1,...t,version:this.$bf});return this.$aY.push(e),this.$aY.length>xo&&(this.$aY.shift(),this.$cr++),this.$cN=Ys(this.$bf,this.count),e}$kF(t){const e=this.count,s=new Array(e);for(let i=0;i<e;i++)s[i]=L(i);return{widthCols:Object.freeze(s),leftFrom:L(0),totalChanged:t,structural:!0}}$kG(){return Object.freeze({none:!1,...this.$kF(!0),version:this.$bf})}}const ko={autoHeight:!1,mergeEmpty:!0,virtualColumns:!0},Mo=Object.freeze([]);class at{constructor(t,e,s){this.$iG=null,this.$jf=NaN,this.$e=t,this.$kn=Object.freeze([...e]),this.$ju=at.$jy(s==null?void 0:s.minMarginPx,400),this.$dV=at.$jy(s==null?void 0:s.marginRatio,.5)}static defaultRules(){return Object.freeze([Object.freeze({id:"autoHeight",allowsWindow:t=>!t.autoHeight}),Object.freeze({id:"unknownWidth",allowsWindow:t=>t.viewportWidth>0}),Object.freeze({id:"mergeActive",allowsWindow:t=>t.mergeEmpty}),Object.freeze({id:"optOut",allowsWindow:t=>t.virtualColumns})])}next(t,e,s){const i=at.$ai(e),n=this.$R(e,i),o=this.$jf;return this.$jf=n,t!==null&&!t.full&&this.$hG(s)&&this.covers(t,e)?t:this.$kT(e,s,Number.isNaN(o)?0:n-o)}compute(t,e){return this.$kT(t,e,0)}$kT(t,e,s){const i=this.$e,n=i.count;if(n===0||!this.$hG(e))return this.$iH(n);const o=i.frozenCount,l=at.$ai(t),a=this.$R(t,l),h=this.$jr(l),c=Math.min(Math.abs(s)*2,l);let u=this.$eq(a-h-(s<0?c:0),n);const d=this.$eq(a+l+h+(s>0?c:0),n);u<o&&(u=o);const g=[];o>0&&g.push({from:L(0),to:L(o-1)}),u<=d&&g.push({from:L(u),to:L(d)});const f=t.pinned;for(let v=0;v<f.length;v++){const w=f[v];!Number.isInteger(w)||w<o||w>=n||w>=u&&w<=d||at.$mi(g,w)}const p=it.of(g,n);return p.full?this.$iH(n):p}covers(t,e){const s=this.$e,i=s.count;if(t.full||t.count!==i)return!1;const n=t.segments,o=s.frozenCount,l=n[0];if(o>0&&(l===void 0||l.from!==0||l.to<o-1))return!1;const a=e.pinned;for(let v=0;v<a.length;v++){const w=a[v];if(Number.isInteger(w)&&w>=o&&w<i&&!t.contains(w))return!1}const h=at.$ai(e),c=this.$R(e,h),u=this.$jr(h)/2,d=s.leftOf(L(0)),g=s.totalWidth();let f=Math.min(c+h+u,g),p=Math.max(c-u,d);f<d&&(f=d),p>f&&(p=f);for(let v=n.length-1;v>=0;v--){const w=n[v];if(!(p<s.leftOf(w.from)))return f<=s.leftOf(L(w.to+1))}return!1}horizontalWindow(t,e){const i=this.compute({box:{scrollLeft:t,width:e},pinned:Mo},{...ko,viewportWidth:e}).segments;return i.length===0?{start:L(0),end:L(0)}:{start:i[0].from,end:L(i[i.length-1].to+1)}}$hG(t){const e=this.$kn;for(let s=0;s<e.length;s++)if(!e[s].allowsWindow(t))return!1;return!0}static $ai(t){const e=t.box.width;return Number.isFinite(e)&&e>0?e:0}$R(t,e){const s=t.box.scrollLeft;if(!Number.isFinite(s)||s<=0)return 0;const i=Math.max(0,this.$e.totalWidth()-e);return s<i?s:i}static $mi(t,e){let s=0;for(;s<t.length&&t[s].to<e;)s++;s<t.length&&t[s].from<=e||t.splice(s,0,{from:L(e),to:L(e)})}$jr(t){return Math.max(this.$ju,t*this.$dV)}$eq(t,e){const s=this.$e.colAt(j(Math.max(0,t)));return s<0?0:s>=e?e-1:s}$iH(t){const e=this.$iG;if(e!==null&&e.count===t)return e;const s=it.full(t);return this.$iG=s,s}static $jy(t,e){return t!==void 0&&Number.isFinite(t)&&t>=0?t:e}}class Zt{constructor(t,e){this.$ai=0,this.$dg=!0,this.$bx=()=>{if(!this.$dg)return;const s=this.$d;this.$hw=s.scrollTop,this.$kv(s.scrollLeft)},this.$d=t,this._scheduler=e,this.$w=t.scrollLeft||0,this.$hw=t.scrollTop||0,this.$dk={scrollLeft:this.$w,width:0},this.$cU=Zt.$gx(t),t.addEventListener("scroll",this.$bx,{passive:!0})}get box(){return this.$dk}get scrollTop(){return this.$hw}setWidth(t){if(!this.$dg)return;this.$cU=Zt.$gx(this.$d);const e=!this.$cU&&Number.isFinite(t)&&t>0?t:0;e!==this.$ai&&(this.$ai=e,this.$dk={scrollLeft:this.$w,width:e},this._scheduler.submit(F.of(z.Viewport)))}scrollLeftTo(t){if(!this.$dg||!Number.isFinite(t))return;const e=t<0?0:t;this.$d.scrollLeft=e,this.$kv(e)}destroy(){this.$dg&&(this.$dg=!1,this.$d.removeEventListener("scroll",this.$bx))}static $gx(t){const e=t.ownerDocument.defaultView;return e!==null&&e.getComputedStyle(t).direction==="rtl"}$kv(t){if(t<0&&!this.$cU&&!Zt.$gx(this.$d)&&(t=0),t<0&&!this.$cU){this.$cU=!0,this.$ai=0,this.$w=t,this.$dk={scrollLeft:t,width:0},this._scheduler.submit(F.of(z.Viewport));return}t!==this.$w&&(this.$w=t,this.$dk={scrollLeft:t,width:this.$ai},this._scheduler.submit(F.of(z.ColsScrolled)))}}class So{constructor(t,e){this.$R=t,this.$e=e}revealColumn(t){this.reveal(t)}reveal(t){const e=this.$e;if(!Number.isInteger(t)||t<0||t>=e.count||t<e.frozenCount)return null;const{scrollLeft:s,width:i}=this.$R.box;if(!(i>0))return null;const n=L(t),o=e.leftOf(n),l=o+e.widthOf(n),a=e.frozenCount>0?e.frozenRight():0,h=s+a,c=s+i;let u;if(o<h||l-o>i-a)u=o-a;else if(l>c)u=l-i;else return null;const d=Math.max(0,e.totalWidth()-i);return u=Math.min(d,Math.max(0,u)),u===s?null:(this.$R.scrollLeftTo(u),u)}}class Ao{constructor(t,e){this.$e=t,this.$kl=(e==null?void 0:e.rowBorderPx)??1}rect(t,e,s,i){const n=this.$hX(t.startCol,e.left),o=this.$e.widthOf(t.startCol),l=this.$hX(t.endCol,e.left),a=this.$e.widthOf(t.endCol),h=Math.min(n,l),c=Math.max(n+o,l+a),u=Math.min(t.startRow,t.endRow),d=Math.max(t.startRow,t.endRow),g=i+u*s-e.top,f=i+d*s+s-this.$kl-e.top;return{left:h,top:g,width:Math.max(0,c-h),height:Math.max(0,f-g)}}$hX(t,e){const s=L(t),i=this.$e.leftOf(s);return t<this.$e.frozenCount?i:i-e}}class Fo{constructor(t){var e,s,i;this.$hM=!1,this.$iP=-1,this.$e=new Eo([],we.fromOptions(null),0),this.$nw=new at(this.$e,at.defaultRules()),this.$R=null,this.$nc=null,this._rangeRects=new Ao(this.$e),this.$b=t,(s=(e=t.getRenderer())==null?void 0:e.setGeometry)==null||s.call(e,this.$e);const n=(i=t.getRenderer())==null?void 0:i.bodyWrapper;n&&(this.$R=new Zt(n,{submit:o=>t.submitRender(o)}))}get windowPolicy(){return this.$nw}get scroll(){return this.$R}shape(){var t;const e=this.$b.getOptions();return{autoHeight:e.autoHeight===!0,viewportWidth:((t=this.$R)==null?void 0:t.box.width)??0,mergeEmpty:this.$b.getMergeEngine().isEmpty,virtualColumns:e.virtualColumns!==!1}}revealColumn(t){const e=this.$R;e===null||t<0||t>=this.$e.count||(this.$nc??(this.$nc=new So(e,this.$e))).reveal(t)}rangeRect(t){const e=this.$R,s=this.$e;return e===null||t.endCol>=s.count||t.startCol<0?null:this._rangeRects.rect({startRow:t.startRow,endRow:t.endRow,startCol:L(t.startCol),endCol:L(t.endCol)},{top:e.scrollTop,left:e.box.scrollLeft},this.$b.getOptions().rowHeight,0)}destroy(){var t;(t=this.$R)==null||t.destroy(),this.$R=null}get geometry(){return this.$e}currentGeometry(){return this.syncGeometry()}$iz(){const t=this.$b.getOptions(),e=t.masterDetail;return we.fromOptions({stateColumn:t.stateColumn,draggable:t.draggable,rowNumber:t.rowNumber,checkColumn:t.checkColumn,detailExpanderCol:!!(e!=null&&e.enabled)&&((e==null?void 0:e.toggle)??"expander-col")==="expander-col"})}syncGeometry(){const t=this.$b.getOptions(),e=this.$b.getColLayout(),s=this.$b.getColWidths(),i=t.defaultColumnWidth;return this.$e.reset(e.visibleLeaves.map((n,o)=>s[o]??i),this.$iz(),e.frozenCount),this.$e}$jM(){return this.$b.getOptions().pagination?38:0}onResize(){const{width:t}=this.$b.getContainer().getBoundingClientRect();t&&(this.recalcWidths(t),this.renderHeader(),this.syncViewportWidth(),this.$b.submitRender(F.REPAINT_VISIBLE))}syncViewportWidth(){var t,e;const s=(t=this.$b.getRenderer())==null?void 0:t.bodyWrapper;s&&((e=this.$R)==null||e.setWidth(s.clientWidth))}recalcWidths(t){const e=this.$b.getColLayout(),s=this.$b.getOptions(),i=e.computeWidths(t-this.$iz().width(),s.defaultColumnWidth),n=this.$b.getUserWidths();n.size&&e.visibleLeaves.forEach((o,l)=>{const a=n.get(o.field);a!=null&&(i[l]=a)}),this.$b.setColWidths(i)}commitColumnWidth(t,e){const s=this.syncGeometry();t<s.count&&s.widthOf(L(t))!==Math.round(e)&&(this.setUserWidth(t,e),this.$b.submitRender(F.of(z.ColWidth,{sync:!0,widthChangedFrom:t})));const i=this.$b.getColLayout().visibleLeaves[t];i&&this.$b.getUserWidths().set(i.field,Math.round(e))}setUserWidth(t,e){const s=Math.round(e),i=this.$b.getColWidths();if(i[t]===void 0){const n=this.$b.getOptions().defaultColumnWidth,o=this.$b.getColLayout().visibleLeaves.length;for(let l=0;l<o;l++)i[l]===void 0&&(i[l]=n)}return i[t]!==void 0&&(i[t]=s),this.syncGeometry(),this.$e.resize(L(t),s)}hasWrappedHeader(){return this.$b.getColLayout().visibleLeaves.some(t=>{const e=t.header??t.field;return t.headerWrap===!0||typeof e=="string"&&e.indexOf(`
|
|
38
|
+
`)>=0})}renderHeader(){const t=this.$b.getRenderer(),e=this.$b.getColLayout(),s=this.$b.getSfMgr(),i=this.$b.getOptions();t==null||t.renderHeader(e.buildHeaderCells(),e.visibleLeaves,this.syncGeometry().widths(),s.sortList,{...i,_activeFilters:s.filters,_frozenCount:e.frozenCount}),this.syncHeaderLayout()}relayoutHeaderIfChanged(){const t=this.$b.getRenderer();t&&t.getHeaderHeight()!==this.$iP&&this.syncHeaderLayout()}syncHeaderLayout(){const t=this.$b.getRenderer(),e=this.$b.getVs();if(!t||!e)return;const s=this.$b.getOptions(),{height:i}=this.$b.getContainer().getBoundingClientRect();if(!i)return;const n=t.getHeaderHeight();this.$iP=n;const o=n>s.headerHeight?n:s.headerHeight;t.updateSize(i-this.$jM(),o);let l=i-o-this.$jM();const a=s.fallbackViewportHeight;if(a&&a>0){const h=e.getTotalHeight();l>=h&&l>a&&(l=a)}e.setViewportHeight(l)}doRender(t,e,s,i){const n=this.$b.getRenderer(),o=this.$b.getVs();if(!n||!o)return;const l=this.$b.getOptions(),a=o.getVisibleRange(),h=l.autoHeight===!0;h&&([t,e]=this.visRange(),!this.$hM&&e-t+1>2e3&&(this.$hM=!0,console.warn(`[OpenGrid] autoHeight 는 가상 스크롤이 아니라 전 행(${e-t+1}행)을 렌더합니다. 행이 많으면 고정 rowHeight(가상 스크롤) 사용을 권장합니다.`)));const c=this.$b.getGrpMgr(),d=c.isGroupMode||c.isTreeMode||this.$b.getDetailMgr().isActive?this.$b.getFlatModel().getFlatArray():null,g=this.$b.getColLayout(),f=this.$b.getData(),p=this.$b.getRowMgr();n.renderBody({startIndex:t,endIndex:e,data:f,leaves:g.visibleLeaves,widths:this.syncGeometry().widths(),opts:l,offsetY:h?0:a.offsetY,totalHeight:h?0:o.getTotalHeight(),selectedRows:p.selectedRows,checkedRows:p.checkedRows,groupFlatRows:d,onGroupToggle:v=>c.handleGroupToggle(v),onTreeToggle:c.isTreeMode?v=>c.handleTreeToggle(v):void 0,extraOpts:{_totalRows:f.rowCount,_frozenCount:g.frozenCount,_focusCell:this.$b.getEditMgr().focusCell,...this.$b.getRangeMgr().getOverlayExtraOpts()},mergeEngine:this.$b.getMergeEngine(),detailApi:this.$b.buildDetailRenderContext(),columns:s,...i===void 0?null:{rowWork:i}}),this.$b.getRangeMgr().repaint()}visRange(){var t;const e=this.$b.getOptions(),s=this.$b.getPagination();if(e.pagination&&s){const{start:o,end:l}=s.getRange();return[o,l]}const i=this.$b.getFlatModel().count();if(e.autoHeight)return[0,i-1];const n=(t=this.$b.getVs())==null?void 0:t.getVisibleRange();return[(n==null?void 0:n.startIndex)??0,Math.min((n==null?void 0:n.endIndex)??30,i-1)]}}const Io=1024;class Lo{constructor(t,e,s,i,n={}){if(this.$q=t,this.$cY=e,this.$cZ=i,this.lastOrdererId="",this.prefixSortReady=Promise.resolve(),this.$ca=null,s.length===0)throw new RangeError("Sorter: at least one orderer is required");this.$dN=s,this.$gD=n.loadPrefixSort??null}sortNow(t,e,s=this.$q.displayOrder()){return t.length===0?s.slice():Array.from(this.$ci(t,e,s).settle())}sortInteractive(t,e,s=this.$q.displayOrder()){return this.$ci(t,e,s)}$ci(t,e,s){const i=t.map(a=>this.$cY.keyColumnFor(a,e,s)),n=t.map(a=>a.dir),o=this.$mH(i,s);this.lastOrdererId=o.id;const l=this.$cZ.run(s,i,n,o);return l.onDone(a=>{var h,c;return(c=(h=this.$cY).noteSorted)==null?void 0:c.call(h,i[0],a,n[0])}),l}$mH(t,e){if(this.$ca)return this.$ca(this.$dN,t,e);this.$lP(t,e.length);const s=this.$dN.find(i=>i.accepts(t,e.length));if(!s)throw new Error("Sorter: no orderer accepts these keys");return s}$lP(t,e){const s=this.$gD;!s||t.length!==1||t[0].kind!=="string"||e<Io||(this.$gD=null,this.prefixSortReady=s().then(i=>{this.$dN=[...this.$dN,new i.LcpMergeOrderer],this.$ca=(n,o,l)=>i.SortCostEstimate.pickOrderer(n,o,l)},()=>{}))}}const Qs=(r,t)=>{if(r==null&&t==null)return 0;if(r==null)return-1;if(t==null)return 1;if(typeof r=="number"&&typeof t=="number")return r-t;const e=String(r),s=String(t);return e<s?-1:e>s?1:0};function To(r){for(let t=0;t<r.length;t++){const e=r[t];if(e!==null&&(typeof e=="object"||typeof e=="function"))return!1}return!0}class he{static build(t,e,s,i,n){if(!i)return new ti(t,e,s,n);const o=ss.of(e);return o.numeric?new Oo(t,o.copy):o.textual?new Do(t,o.copy):new ti(t,o.copy,s,n)}}class ss{constructor(t,e,s){this.copy=t,this.numeric=e,this.textual=s}static of(t){const e=t.length,s=new Array(e);let i=!0,n=!0,o=0,l=0;for(let a=0;a<e;a++){const h=t[a];if(s[a]=h,h==null)continue;const c=typeof h;c==="number"?(n=!1,h!==h?i=!1:h===1/0?++o>1&&(i=!1):h===-1/0&&++l>1&&(i=!1)):c==="string"||c==="boolean"?i=!1:(i=!1,n=!1)}return new ss(s,i,n)}}class ti extends he{constructor(t,e,s,i){super(),this.field=t,this.$ah=e,this.$lu=s,this.$lB=i,this.kind="general",this.cacheable=To(e)}compare(t,e){const s=this.$lu;return s(this.$ah[t],this.$ah[e],this.field,this.$lB)}stringKeyAt(t){return null}}class Oo extends he{constructor(t,e){super(),this.field=t,this.kind="number",this.cacheable=!0;const s=e.length;this.$ac=new Float64Array(s),this.$gc=new Uint8Array(s);for(let i=0;i<s;i++){const n=e[i];n==null?this.$gc[i]=1:this.$ac[i]=n}}compare(t,e){const s=this.$gc;return s[t]?s[e]?0:-1:s[e]?1:this.$ac[t]-this.$ac[e]}stringKeyAt(t){return null}}class Do extends he{constructor(t,e){super(),this.field=t,this.kind="string",this.cacheable=!0;const s=e.length,i=new Array(s);for(let n=0;n<s;n++){const o=e[n];i[n]=o==null?null:String(o)}this.$ac=i}compare(t,e){const s=this.$ac[t],i=this.$ac[e];return s==null?i==null?0:-1:i==null?1:s<i?-1:s>i?1:0}stringKeyAt(t){return this.$ac[t]??null}}class ei{constructor(t,e,s){this.field=t,this.values=e,this.$ev=new Uint8Array(e.length);for(let i=0;i<s.length;i++)this.$ev[s[i]]=1}covers(t){const e=this.$ev;for(let s=0;s<t.length;s++)if(!e[t[s]])return!1;return!0}isFreshFor(t,e){const s=this.values,i=s.length;if(t.length!==i)return!1;const n=this.field,o=this.$ev;if(e){for(let l=0;l<e.length;l++){const a=e[l];if(!o[a]||t[a][n]!==s[a])return!1}return!0}for(let l=0;l<i;l++)if(o[l]&&t[l][n]!==s[l])return!1;return!0}}class is{constructor(t,e,s){this.field=t,this.$cP=e,this.$bD=s}static fromSorted(t,e,s,i,n){const o=new Int32Array(n.length),l=s.length,a=i==="asc";let h=0;for(let c=0;c<l;c++){const u=a?c:l-1-c,d=s[u];c>0&&e.compare(s[a?u-1:u+1],d)!==0&&h++,o[d]=h}return new is(t,o,new ei(t,n,s))}compare(t,e){return this.$cP[t]-this.$cP[e]}covers(t){return this.$bD.covers(t)}isFreshFor(t,e){return this.$bD.isFreshFor(t,e)}}class No{constructor(t){this.$iX=t,this.kind="ranked",this.cacheable=!0}get field(){return this.$iX.field}compare(t,e){return this.$iX.compare(t,e)}stringKeyAt(t){return null}}class zo{constructor(t){this.$q=t,this.$cH=new Map}get size(){return this.$cH.size}keyColumnFor(t,e,s=this.$q.displayOrder()){const i=this.$q.rows,n=t.field,o=e===Qs;if(o){const h=this.$cH.get(n);if(h&&h.snapshot.isFreshFor(i,s))return this.$nb(h,s)}const l=new Array(i.length);for(let h=0;h<s.length;h++){const c=s[h];l[c]=i[c][n]}const a=he.build(n,l,e,o,t.dir);return o&&(a.kind==="number"||a.kind==="string")?this.$cH.set(n,{key:a,snapshot:new ei(n,l,s),sorted:null,dir:void 0,ranks:null}):o&&this.$cH.delete(n),a}noteSorted(t,e,s){const i=this.$cH.get(t.field);!i||i.key!==t||(i.sorted=e,i.dir=s)}clear(){this.$cH.clear()}$nb(t,e){return t.sorted&&(!t.ranks||!t.ranks.covers(e))&&(t.ranks=is.fromSorted(t.key.field,t.key,t.sorted,t.dir,t.snapshot.values),t.sorted=null),t.ranks&&t.ranks.covers(e)?new No(t.ranks):t.key}}class $o{constructor(){this.id="comparison"}accepts(t,e){return!0}order(t,e,s){const i=t.slice(),n=e.length;return n>0&&i.sort((o,l)=>{for(let a=0;a<n;a++){const h=e[a].compare(o,l);if(h!==0)return s[a]==="asc"?h:-h}return 0}),Int32Array.from(i)}}class Bo{constructor(t){this.$cO=t,this.done=!0,this.$hT=!1}cancel(){this.$hT=!0}onDone(t){this.$hT||t(this.$cO)}settle(){return this.$cO}peekWindow(t,e){return null}}class Po{run(t,e,s,i){return new Bo(i.order(t,e,s))}}let Vo=0;function si(){return`og-r-${++Vo}`}class Ho{constructor(t="_ogRowId"){this._data=[],this.$dO=[],this._meta=new Map,this._displayIndexes=[],this.$bt=new Map,this.$gk="",this.$gj=[],this._getStrategy=(e,s)=>s,this.$ac=new zo(this),this.$nl=new Lo(this,this.$ac,[new $o],new Po,{loadPrefixSort:()=>import("./LcpMergeOrderer-Ebwuir-r.js")}),this.$bc=0,this.$y=t}getDataIndexByRowId(t){return this.$bt.get(t)}get structureVersion(){return this.$bc}setStrategyResolver(t){this._getStrategy=t}setData(t){this.$ac.clear(),this._data=t.map(e=>{const s=si(),i={...e,[this.$y]:s};return this._meta.set(s,{state:"none",rowId:s}),i}),this.$dO=this._data.map(e=>({...e})),this.$dW(),this._displayIndexes=this._data.map((e,s)=>s),this.$bc++}getData(){return this._displayIndexes.map(t=>this._data[t])}getOriginalData(){return[...this.$dO]}getAllData(){return[...this._data]}clearData(){this.$ac.clear(),this._data=[],this.$dO=[],this._meta.clear(),this.$bt.clear(),this._displayIndexes=[],this.$bc++}get rowCount(){return this._displayIndexes.length}get totalRowCount(){return this._data.length}addRow(t,e="last"){const s=si(),i={...t,[this.$y]:s};if(this._meta.set(s,{state:"added",rowId:s}),e==="last"){const n=this._data.push(i)-1;this.$bt.set(s,n),this._displayIndexes.push(n)}else if(e==="first")this._data.unshift(i),this.$dW(),this._displayIndexes.unshift(0);else{const n=Math.min(e,this._displayIndexes.length),o=n<this._displayIndexes.length?this._displayIndexes[n]:this._data.length;this._data.splice(o,0,i),this.$dW(),this._displayIndexes=this._data.map((l,a)=>a)}this.$bc++}removeRow(t){const e=this._displayIndexes[t];if(e===void 0)return;const s=this._data[e],i=s[this.$y],n=this._meta.get(i);return(n==null?void 0:n.state)==="added"?(this._data.splice(e,1),this._meta.delete(i)):this._meta.set(i,{...n,state:"removed"}),this.$dW(),this._displayIndexes=this._data.map((o,l)=>({r:o,i:l})).filter(({r:o})=>{var l;return((l=this._meta.get(o[this.$y]))==null?void 0:l.state)!=="removed"}).map(({i:o})=>o),this.$bc++,s}moveRow(t,e){const s=this._displayIndexes[t],i=this._displayIndexes[e];if(s===void 0||i===void 0)return;const[n]=this._data.splice(s,1),o=s<i?i-1:i;this._data.splice(o,0,n),this.$dW(),this._displayIndexes=this._data.map((l,a)=>({r:l,i:a})).filter(({r:l})=>{var a;return((a=this._meta.get(l[this.$y]))==null?void 0:a.state)!=="removed"}).map(({i:l})=>l),this.$bc++}updateCell(t,e,s){const i=this._displayIndexes[t];if(i===void 0)return!1;const o=this._data[i][this.$y],l=this._meta.get(o);return(l==null?void 0:l.state)==="none"&&this._meta.set(o,{...l,state:"edited",original:{...this.$dO[i]}}),this._data[i][e]=s,!0}getRowByIndex(t){const e=this._displayIndexes[t];return e!==void 0?this._data[e]:void 0}getCellValue(t,e){var s;return(s=this.getRowByIndex(t))==null?void 0:s[e]}hasRow(t){var e;return this.$bt.get(t)===void 0?!1:((e=this._meta.get(t))==null?void 0:e.state)!=="removed"}getRowById(t){if(!this.hasRow(t))return;const e=this.$bt.get(t);return this._data[e]}getCellValueByRowId(t,e){var s;return(s=this.getRowById(t))==null?void 0:s[e]}setComputedValueByRowId(t,e,s){const i=this.$bt.get(t);i!==void 0&&(this._data[i][e]=s)}getEditedRows(){return this._data.filter(t=>{var e;return((e=this._meta.get(t[this.$y]))==null?void 0:e.state)==="edited"})}getChangedRows(){return this.getEditedRows()}getAddedRows(){return this._data.filter(t=>{var e;return((e=this._meta.get(t[this.$y]))==null?void 0:e.state)==="added"})}getRemovedRows(){return this._data.filter(t=>{var e;return((e=this._meta.get(t[this.$y]))==null?void 0:e.state)==="removed"})}getChanges(){const t=[],e=[],s=[];for(const i of this._data){const n=i[this.$y],o=this._meta.get(n),l=(o==null?void 0:o.state)??"none";if(l==="added")t.push({...i});else if(l==="removed")s.push({...i});else if(l==="edited"){const a=o.original??{},h=Object.keys(i).filter(c=>c!==this.$y&&i[c]!==a[c]);e.push({...i,_changedFields:h})}}return{added:t,edited:e,removed:s}}getChangedColumns(){return this._data.filter(t=>{var e;return((e=this._meta.get(t[this.$y]))==null?void 0:e.state)==="edited"}).map(t=>{var e;const s=((e=this._meta.get(t[this.$y]))==null?void 0:e.original)??{},i=[];for(const n of Object.keys(t))n!==this.$y&&t[n]!==s[n]&&i.push({field:n,oldValue:s[n],newValue:t[n]});return{row:{...t},fields:i.map(n=>n.field),diff:i}})}getOriginalRow(t){const e=this._displayIndexes[t];if(e===void 0)return;const s=this._data[e],i=this._meta.get(s[this.$y]);if(!(!i||i.state==="added"))return i.state==="edited"&&i.original?{...i.original}:{...this.$dO[e]}}getRowsWithState(t){return this._data.map(e=>{var s;const i=((s=this._meta.get(e[this.$y]))==null?void 0:s.state)??"none";return{...e,[t]:i}})}getRowState(t){var e;const s=this.getRowByIndex(t);return s?((e=this._meta.get(s[this.$y]))==null?void 0:e.state)??"none":"none"}applySort(t){if(t.length===0){this._displayIndexes=this._data.map((i,n)=>n).filter(i=>this.$gw(i)),this.$bc++;return}const e=this._getStrategy("sortComparator",Qs),s=this._displayIndexes.filter(i=>this.$gw(i));this.$kw(this.$nl.sortNow(t,e,s),s.length)}get rows(){return this._data}displayOrder(){return this._displayIndexes.filter(t=>this.$gw(t))}applyOrder(t){this.$kw(t,this.displayOrder().length)}$kw(t,e){if(t.length!==e)throw new RangeError(`DataLayer.applyOrder: expected ${e} indexes, got ${t.length}`);this._displayIndexes=Array.from(t),this.$bc++}$gw(t){var e,s;return((s=this._meta.get((e=this._data[t])==null?void 0:e[this.$y]))==null?void 0:s.state)!=="removed"}applyFilter(t){const e=Object.keys(t),s=this._getStrategy("filterPredicate",(i,n,o)=>Wo(i,n));this._displayIndexes=this._data.map((i,n)=>({r:i,i:n})).filter(({r:i})=>{var n;if(((n=this._meta.get(i[this.$y]))==null?void 0:n.state)==="removed"||e.length>0&&!e.every(o=>{const l=i[o];return t[o].every(a=>s(l,a,o))}))return!1;if(this.$gk&&this.$gj.length>0){const o=this.$gk;if(!this.$gj.some(a=>{const h=i[a];return h!=null&&String(h).toLowerCase().includes(o)}))return!1}return!0}).map(({i})=>i),this.$bc++}setFindFilter(t,e){this.$gk=t.toLowerCase(),this.$gj=e}$dW(){this.$bt.clear(),this._data.forEach((t,e)=>{this.$bt.set(t[this.$y],e)})}}function Wo(r,t){const e=r,s=t.value;switch(t.operator){case"=":return e==s;case"!=":return e!=s;case">":return e>s;case">=":return e>=s;case"<":return e<s;case"<=":return e<=s;case"contains":return String(e).includes(String(s));case"startsWith":return String(e).startsWith(String(s));case"endsWith":return String(e).endsWith(String(s));default:return!0}}function Ht(r){return r&&r._isGroup===!0}function ii(r,t,e=[],s=new Set,i,n){return t.length?ni(r,t,0,e,s,"",i,n):[]}function ni(r,t,e,s,i,n,o,l){const a=t[e],h=new Map;for(const u of r){const d=l?l(u,t.slice(e)):u[a];h.has(d)||h.set(d,[]),h.get(d).push(u)}const c=[];for(const[u,d]of h){const g=`${n}__${a}:${u}`,f=i.has(g);let p;e<t.length-1?p=ni(d,t,e+1,s,i,g,o,l):p=d;const{summary:v,summaryFmt:w}=jo(d,s),m=Go(d,o);c.push({_isGroup:!0,_groupField:a,_groupValue:u,_groupLabel:u==null?B("group.nullLabel"):String(u),_depth:e,_expanded:f,_childCount:d.length,_summary:v,_summaryFmt:w,_states:m,children:p})}return c}function jo(r,t){const e={},s={};for(const i of t){const n=r.map(h=>h[i.field]).filter(h=>h!=null&&h!=="");let o=null;const l=i.op.toUpperCase();if(l==="SUM")o=n.length>0?k.sum(n.map(String)):null;else if(l==="AVG")o=n.length>0?k.sum(n.map(String)).div(k.from(String(n.length))):null;else if(l==="COUNT"){e[i.field]=r.length,s[i.field]=r.length.toLocaleString("ko-KR");continue}else l==="MAX"?o=n.length>0?k.max(n.map(String)):null:l==="MIN"&&(o=n.length>0?k.min(n.map(String)):null);if(!o){e[i.field]=null,s[i.field]="";continue}const a=o.toNumber();e[i.field]=a,s[i.field]=Uo(a,i.format)}return{summary:e,summaryFmt:s}}function Go(r,t){if(!t)return{added:0,edited:0,removed:0};let e=0,s=0,i=0;for(const n of r){const o=t(n);o==="added"?e++:o==="edited"?s++:o==="removed"&&i++}return{added:e,edited:s,removed:i}}function Uo(r,t){if(t==null)return r%1===0?r.toLocaleString("ko-KR"):parseFloat(r.toFixed(6)).toLocaleString("ko-KR",{minimumFractionDigits:2,maximumFractionDigits:6});const e=t.includes("#")||t.includes(","),s=t.match(/\.(\d+)$/),i=s?parseInt(s[1],10):/^\d+$/.test(t)?parseInt(t,10):0,n=Math.abs(r).toFixed(i),[o="0",l]=n.split("."),a=e?o.replace(/\B(?=(\d{3})+(?!\d))/g,","):o,h=l!==void 0?`${a}.${l}`:a;return r<0?`-${h}`:h}function ri(r){const t=[];for(const e of r)if(t.push(e),e._expanded)for(const s of e.children)Ht(s)?t.push(...ri([s])):t.push(s);return t}function oi(r,t=""){const e=[];for(const s of r){const i=`${t}__${s._groupField}:${s._groupValue}`;e.push(i);const n=s.children.filter(o=>Ht(o));n.length&&e.push(...oi(n,i))}return e}function Le(r){return r!=null&&r._isTree===!0}function Te(r,t,e=new Set){const{idField:s,parentIdField:i,expandOnLoad:n=!1}=t,o=new Map,l=[];for(const c of r){const u=c[s],d={_isTree:!0,_treeId:u,_treeParentId:c[i],_depth:0,_expanded:n||e.has(u),_hasChildren:!1,_childCount:0,_isLastChild:!1,_ancestorHasMore:[],data:c,children:[]};o.set(u,d)}for(const c of o.values()){const u=c._treeParentId;if(u==null||u===""||!o.has(u))l.push(c);else{const g=o.get(u);g.children.push(c),g._hasChildren=!0}}function a(c,u){for(const d of c)d._depth=u,d._childCount=li(d),a(d.children,u+1)}a(l,0);function h(c,u){for(let d=0;d<c.length;d++){const g=c[d],f=d===c.length-1;g._isLastChild=f,g._ancestorHasMore=u,g.children.length>0&&h(g.children,[...u,!f])}}return h(l,[]),l}function li(r){let t=r.children.length;for(const e of r.children)t+=li(e);return t}function ai(r){const t=[];for(const e of r)t.push(e),e._expanded&&e.children.length>0&&t.push(...ai(e.children));return t}function Ko(r,t){r.has(t)?r.delete(t):r.add(t)}function Oe(r){const t=[];for(const e of r)t.push(e._treeId),e.children.length&&t.push(...Oe(e.children));return t}class qo{constructor(t,e,s){this.$jW=t,this.$jV=e,this.$jX=s,this.$cw=null,this.$kH=-1,this.$ar=null,this.$cr=null,this.$kR=[]}same(){const t=this.$jW();if(t!==this.$cw||t.structureVersion!==this.$kH)return!1;const e=this.$jV();if(e!==this.$ar||e&&e()!==this.$cr)return!1;const s=this.$jX();for(let i=0;i<s.length;i++)if(s[i].version()!==this.$kR[i])return!1;return!0}take(){const t=this.$jX();for(let s=0;s<t.length;s++){const i=t[s].version;if(i===null)return!1;this.$kR[s]=i()}const e=this.$jW();return this.$cw=e,this.$kH=e.structureVersion,this.$ar=this.$jV(),this.$cr=this.$ar?this.$ar():null,!0}}class Yo{constructor(t){this.$cw=t,this.$iU=0}get hits(){return this.$iU}count(){return this.$cw().rowCount}itemAt(t){return this.$iU++,this.$cw().getRowByIndex(t)}array(){return this.$cw().getData()}}class Xo{constructor(t,e){this.$fU=t,this.$an=e,this.$h=null,this.$hQ=0}get builds(){return this.$hQ}count(){return this.$av().length}itemAt(t){return this.$av()[t]}array(){return this.$av()}invalidate(){this.$h=null}$av(){if(this.$h!==null&&this.$an.same())return this.$h;const t=this.$an.take(),e=this.$fU();return this.$hQ++,this.$h=t?e:null,e}}class Zo{constructor(t){this.$ar=null,this.$ec=[],this.$fn=null,this.$he=null,this.$a=t,this.$fY=new Yo(()=>this.$a.getDataLayer()),this.$es=new Xo(()=>this.$fU(),new qo(()=>this.$a.getDataLayer(),()=>this.$ar,()=>this.$ec))}get directHits(){return this.$fY.hits}get dataStructureVersion(){return this.$a.getDataLayer().structureVersion}setBacking(t){this.$ar=t,this.$cE()}registerSplice(t,e=()=>!0,s){this.$ec.push({fn:t,isActive:e,version:s??null}),this.$cE()}count(){return this.$q().count()}getFlatArray(){return this.$q().array()}resolveFlatRow(t){const e=this.$q().itemAt(t);if(e==null)return{kind:"data"};if(e._isDetailFiller===!0)return{kind:"detailFiller",rowId:e._rowId};if(e._isDetailHead===!0)return{kind:"detailHead",rowId:e._rowId};if(Ht(e))return{kind:"group"};if(Le(e)){const o=e.data;return{kind:"tree",rowId:o==null?void 0:o[this.$a.rowIdField]}}const s=e[this.$a.rowIdField],i=this.$a.getDataLayer().getDataIndexByRowId(s),n={kind:"data",rowId:s};return i!==void 0&&(n.dataIndex=i),this.$ar||(n.displayIndex=t),n}rowAt(t){const e=this.$q().itemAt(t);return e==null||e._isDetailFiller===!0||e._isDetailHead===!0||Ht(e)?null:Le(e)?e.data??null:e}flatIndexOfRowId(t){return this.$lC(),this.$fn.get(t)??-1}rowIdOfFlat(t){const e=this.resolveFlatRow(t);return e.kind==="data"||e.kind==="tree"?e.rowId??null:null}$q(){if(this.$ar)return this.$es;for(let t=0;t<this.$ec.length;t++)if(this.$ec[t].isActive())return this.$es;return this.$fY}$fU(){let t=this.$ar?this.$ar():this.$a.getDataLayer().getData();for(const e of this.$ec)t=e.fn(t);return t}$cE(){this.$es.invalidate(),this.$fn=null,this.$he=null}$lC(){const t=this.$q().array();if(this.$fn&&this.$he===t)return;const e=new Map;for(let s=0;s<t.length;s++){const i=t[s];if(i==null||Ht(i)||i._isDetailHead===!0||i._isDetailFiller===!0)continue;const n=Le(i)?i.data:i,o=n==null?void 0:n[this.$a.rowIdField];o!=null&&e.set(o,s)}this.$fn=e,this.$he=t}}class Jo{constructor(t){this._selectedRows=new Set,this.$aW=new Set,this._data=t}get selectedRows(){return this._selectedRows}get checkedRows(){return this.$aW}selectSingle(t){this._selectedRows.clear(),this._selectedRows.add(t)}selectToggle(t){this._selectedRows.has(t)?this._selectedRows.delete(t):this._selectedRows.add(t)}clearSelection(){this._selectedRows.clear()}check(t,e){e?this.$aW.add(t):this.$aW.delete(t)}checkAll(t,e){if(t)for(let s=0;s<e;s++)this.$aW.add(s);else this.$aW.clear()}checkByValue(t,e){for(let s=0;s<this._data.rowCount;s++)e.includes(this._data.getCellValue(s,t))&&this.$aW.add(s)}uncheckAll(){this.$aW.clear()}checkById(t){}addCheckById(t){}uncheckById(t){}getSelections(){return[...this._selectedRows].map(t=>this._data.getRowByIndex(t)).filter(Boolean)}getChecked(){return[...this.$aW].map(t=>({row:this._data.getRowByIndex(t),rowIndex:t}))}getAllChecked(){return this.getChecked().map(t=>t.row)}getActiveRow(){return this._selectedRows.size>0?[...this._selectedRows][0]:-1}activate(t){this._selectedRows.clear(),this._selectedRows.add(t)}deselect(){this._selectedRows.clear()}reset(){this._selectedRows.clear(),this.$aW.clear()}}function X(r,t){return`${r}:${t}`}function bt(r){const t=r.indexOf(":");return t===-1?{rowId:r,field:""}:{rowId:r.slice(0,t),field:r.slice(t+1)}}const De=new Set(["#ERR","#REF","#CYCLE","#DIV0","#NAME","#VALUE","#NUM"]);function Ne(r){return typeof r=="string"&&De.has(r)?r:null}const Qo=500,tl={"#REF":"formulaError.ref","#CYCLE":"formulaError.cycle","#VALUE":"formulaError.value","#DIV0":"formulaError.div0","#NAME":"formulaError.name","#NUM":"formulaError.num"};class el{constructor(t){this.$b=t}flushRecalc(){const t=this.$b.getDirtySeeds();if(t.size===0)return;const e=[...t];t.clear(),this.afterRecalc(this.$b.getRecalc().onValuesChanged(e),{skipRender:!0})}afterRecalc(t,e={}){var s,i;if(t.changed.length>0||t.cycles>0){const n={changed:t.changed,cycles:t.cycles,ms:t.ms,large:t.changed.length>Qo};this.$b.emit("formulaRecalc",n),(i=(s=this.$b.getOptions().formula)==null?void 0:s.onFormulaRecalc)==null||i.call(s,n)}e.skipRender||this.$b.submitRender(F.REPAINT_VISIBLE)}handleFormulaError(t,e,s){var i,n;const l={rowIndex:this.$b.getFlatModel().flatIndexOfRowId(t),field:e,error:s};this.$b.emit("formulaError",l),(n=(i=this.$b.getOptions().formula)==null?void 0:i.onFormulaError)==null||n.call(i,l),this.$b.announce(this.$b.t("formula.cellErrorAnnounce",{field:e,message:this.$lU(s)}))}$lU(t){const e=tl[t]??"formulaError.fallback";return this.$b.t(e)}buildAccessor(){return{visibleFields:()=>this.$b.getColLayout().visibleLeaves.map(t=>t.field),rowIdAtFlat:t=>{const e=this.$b.getFlatModel().resolveFlatRow(t);return e.kind==="data"?e.rowId??null:null},flatIndexOfRowId:t=>this.$b.getFlatModel().flatIndexOfRowId(t),displayedRowIds:()=>{const t=[],e=this.$b.getFlatModel(),s=e.count();for(let i=0;i<s;i++){const n=e.resolveFlatRow(i);n.kind==="data"&&n.rowId&&t.push(n.rowId)}return t},getCellValue:(t,e)=>this.$b.getData().getCellValueByRowId(t,e),hasRow:t=>this.$b.getData().hasRow(t),hasField:t=>this.$b.getColLayout().getColumnByField(t)!=null}}setCellFormula(t,e,s){const i=this.$b.getFlatModel().resolveFlatRow(t);i.kind!=="data"||!i.rowId||this.setCellFormulaByRowId(i.rowId,e,s,t)}setCellFormulaByRowId(t,e,s,i){var n,o;const l=i??this.$b.getFlatModel().flatIndexOfRowId(t),a=this.$b.getRecalc(),h=a.getCellFormula(t,e),c=a.setCellFormula(t,e,s),u={rowIndex:l,field:e,formula:s,oldFormula:h};this.$b.emit("formulaChange",u),(o=(n=this.$b.getOptions().formula)==null?void 0:n.onFormulaChange)==null||o.call(n,u),this.afterRecalc(c)}getCellFormula(t,e){const s=this.$b.getFlatModel().resolveFlatRow(t);return s.kind!=="data"||!s.rowId?null:this.$b.getRecalc().getCellFormula(s.rowId,e)}hasCellFormula(t,e){const s=this.$b.getFlatModel().resolveFlatRow(t);return s.kind==="data"&&!!s.rowId&&this.$b.getRecalc().hasCellFormula(s.rowId,e)}clearCellFormula(t,e){const s=this.$b.getFlatModel().resolveFlatRow(t);if(s.kind!=="data"||!s.rowId)return;const i=this.$b.getRecalc(),n=i.clearCellFormula(s.rowId,e);n.length?this.afterRecalc(i.onValuesChanged(n)):this.$b.submitRender(F.REPAINT_VISIBLE)}getCellError(t,e){const s=this.$b.getFlatModel().resolveFlatRow(t);return s.kind!=="data"||!s.rowId?null:this.$b.getRecalc().getCellError(s.rowId,e)}getDependents(t,e){const s=this.$b.getFlatModel().resolveFlatRow(t);if(s.kind!=="data"||!s.rowId)return[];const i=this.$b.getFlatModel();return this.$b.getRecalc().getDependents(s.rowId,e).map(({rowId:n,field:o})=>({rowIndex:i.flatIndexOfRowId(n),field:o}))}getPrecedents(t,e){const s=this.$b.getFlatModel().resolveFlatRow(t);if(s.kind!=="data"||!s.rowId)return[];const i=this.$b.getFlatModel();return this.$b.getRecalc().graph.getPrecedents(X(s.rowId,e)).map(bt).map(({rowId:n,field:o})=>({rowIndex:i.flatIndexOfRowId(n),field:o}))}recalculate(){this.afterRecalc(this.$b.getRecalc().recalculateAll())}recalculateCell(t,e){const s=this.$b.getFlatModel().resolveFlatRow(t);s.kind!=="data"||!s.rowId||this.afterRecalc(this.$b.getRecalc().onValuesChanged([X(s.rowId,e)]))}offsetFormula(t,e,s,i){return this.$b.getRecalc().offsetFormula(t,e,s,i)}getFormulaMeta(t,e){const s=this.$b.getRecalc().store;if(s.size()===0)return null;const i=this.$b.getFlatModel().resolveFlatRow(t);if(i.kind!=="data"||!i.rowId)return null;const n=s.getFormula(i.rowId,e);return n?{src:n.src,error:n.error,approx:!!n.approx}:null}recalcRangeBearingFormulas(){const t=this.$b.getRecalc().recalcRangeBearing();this.afterRecalc(t,{skipRender:t.changed.length===0&&t.cycles===0})}}const ze=/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/;function hi(r){const t=r.trim(),e=/^([+-]?)(\d*)(?:\.(\d*))?[eE]([+-]?\d+)$/.exec(t);if(!e)return t;const[,s,i,n="",o]=e,l=i||"0",a=parseInt(o,10);let h=l+n,c=l.length+a;h===""&&(h="0"),c<=0?(h="0".repeat(-c+1)+h,c=1):c>h.length&&(h=h+"0".repeat(c-h.length));const u=h.slice(0,c)||"0",d=h.slice(c);return s+u+(d?"."+d:"")}function sl(r){const t=r.startsWith("=")?r.slice(1):r,e=new il(t),s=e.parseComparison();if(e.skip(),!e.eof())throw new SyntaxError(`FormulaParser: 예상치 못한 토큰 '${e.peekChar()}' (위치 ${e.pos})`);return s}class il{constructor(t){this.pos=0,this.src=t}eof(){return this.pos>=this.src.length}peekChar(){return this.src[this.pos]??""}skip(){for(;!this.eof()&&/\s/.test(this.peekChar());)this.pos++}$kO(...t){this.skip();for(const e of t.sort((s,i)=>i.length-s.length))if(this.src.startsWith(e,this.pos))return this.pos+=e.length,e;return null}parseComparison(){let t=this.parseConcat();for(;;){const e=this.$kO("<=",">=","<>","=","<",">");if(!e)break;const s=this.parseConcat();t={t:"bin",op:e,left:t,right:s}}return t}parseConcat(){let t=this.parseAdditive();for(;this.$kO("&");){const s=this.parseAdditive();t={t:"bin",op:"&",left:t,right:s}}return t}parseAdditive(){let t=this.parseMultiplicative();for(;;){this.skip();const e=this.peekChar();if(e!=="+"&&e!=="-")break;this.pos++;const s=this.parseMultiplicative();t={t:"bin",op:e,left:t,right:s}}return t}parseMultiplicative(){let t=this.parsePower();for(;;){this.skip();const e=this.peekChar();if(e!=="*"&&e!=="/"&&e!=="%")break;this.pos++;const s=this.parsePower();t={t:"bin",op:e,left:t,right:s}}return t}parsePower(){const t=this.parseUnary();if(this.skip(),this.peekChar()==="^"){this.pos++;const e=this.parsePower();return{t:"bin",op:"^",left:t,right:e}}return t}parseUnary(){this.skip();const t=this.peekChar();return t==="-"||t==="+"?(this.pos++,{t:"unary",op:t,arg:this.parseUnary()}):this.parsePrimary()}parsePrimary(){this.skip();const t=this.peekChar();if(t==="("){this.pos++;const e=this.parseComparison();if(this.skip(),this.peekChar()!==")")throw new SyntaxError("FormulaParser: 닫는 괄호 ) 누락");return this.pos++,e}if(t==="[")return this.$ge();if(t==='"')return this.$np();if(/[A-Za-z$]/.test(t))return this.$mf();if(/[0-9.]/.test(t))return this.$mw();throw new SyntaxError(`FormulaParser: 예상치 못한 문자 '${t||"EOF"}' (위치 ${this.pos})`)}$ge(){this.pos++;const t=this.pos;for(;!this.eof()&&this.peekChar()!=="]";)this.pos++;if(this.eof())throw new SyntaxError("FormulaParser: 닫는 ] 누락");const e=this.src.slice(t,this.pos);return this.pos++,{t:"field",field:e}}$np(){this.pos++;let t="";for(;!this.eof();){const e=this.peekChar();if(e==='"'){if(this.src[this.pos+1]==='"'){t+='"',this.pos+=2;continue}return this.pos++,{t:"str",v:t}}t+=e,this.pos++}throw new SyntaxError('FormulaParser: 닫는 " 누락')}$mf(){const t=this.pos;let e=!1;this.peekChar()==="$"&&(e=!0,this.pos++);const s=this.pos;for(;!this.eof()&&/[A-Za-z]/.test(this.peekChar());)this.pos++;const i=this.src.slice(s,this.pos);if(!i)throw new SyntaxError(`FormulaParser: 식별자를 기대했지만 '${this.peekChar()||"EOF"}' (위치 ${t})`);if(!e){if(this.skip(),this.peekChar()==="("){this.pos++;const c=[];if(this.skip(),this.peekChar()!==")")for(c.push(this.parseComparison()),this.skip();this.peekChar()===",";)this.pos++,c.push(this.parseComparison()),this.skip();if(this.peekChar()!==")")throw new SyntaxError(`FormulaParser: 함수 '${i}' 닫는 ) 누락`);return this.pos++,{t:"call",name:i.toUpperCase(),args:c}}const h=i.toUpperCase();if(this.peekChar()!=="$"&&!/[0-9]/.test(this.peekChar())){if(h==="TRUE")return{t:"bool",v:!0};if(h==="FALSE")return{t:"bool",v:!1}}}let n=!1;this.peekChar()==="$"&&(n=!0,this.pos++);const o=this.pos;for(;!this.eof()&&/[0-9]/.test(this.peekChar());)this.pos++;if(this.pos===o){if(e||n)throw new SyntaxError(`FormulaParser: 셀참조 행번호 누락 (위치 ${this.pos})`);return{t:"error",code:"#NAME"}}const l=parseInt(this.src.slice(o,this.pos),10),a={t:"rawRef",colLetters:i.toUpperCase(),row:l,dollarCol:e,dollarRow:n};return this.$mq(a)}$mq(t){const e=this.pos;if(this.skip(),this.peekChar()===":"){this.pos++,this.skip();let s=!1,i=!1;this.peekChar()==="$"&&(s=!0,this.pos++);const n=this.pos;for(;!this.eof()&&/[A-Za-z]/.test(this.peekChar());)this.pos++;const o=this.src.slice(n,this.pos).toUpperCase();if(!o)throw new SyntaxError(`FormulaParser: 범위 두번째 코너 열문자 누락 (위치 ${this.pos})`);this.peekChar()==="$"&&(i=!0,this.pos++);const l=this.pos;for(;!this.eof()&&/[0-9]/.test(this.peekChar());)this.pos++;if(this.pos===l)throw new SyntaxError(`FormulaParser: 범위 두번째 코너 행번호 누락 (위치 ${this.pos})`);const a=parseInt(this.src.slice(l,this.pos),10);return{t:"rawRange",a:t,b:{t:"rawRef",colLetters:o,row:a,dollarCol:s,dollarRow:i}}}return this.pos=e,t}$mw(){const t=this.pos;for(;!this.eof()&&/[0-9]/.test(this.peekChar());)this.pos++;if(this.peekChar()===".")for(this.pos++;!this.eof()&&/[0-9]/.test(this.peekChar());)this.pos++;if(this.peekChar()==="e"||this.peekChar()==="E"){const s=this.pos;this.pos++,(this.peekChar()==="+"||this.peekChar()==="-")&&this.pos++;const i=this.pos;for(;!this.eof()&&/[0-9]/.test(this.peekChar());)this.pos++;this.pos===i&&(this.pos=s)}const e=this.src.slice(t,this.pos);if(!e||e===".")throw new SyntaxError(`FormulaParser: 숫자를 기대했지만 '${this.peekChar()||"EOF"}' (위치 ${t})`);return{t:"num",v:hi(e)}}}function nl(r){let t=0;for(const e of r.toUpperCase())t=t*26+(e.charCodeAt(0)-64);return t-1}function rl(r){let t=r+1,e="";for(;t>0;){const s=(t-1)%26;e=String.fromCharCode(65+s)+e,t=Math.floor((t-1)/26)}return e||"A"}function $e(r,t){const{accessor:e,host:s,refMode:i}=t,n=nl(r.colLetters),l=e.visibleFields()[n];if(l===void 0)return null;const a=r.row-1,h=e.rowIdAtFlat(a);if(h===null)return null;if(i==="relative"&&!r.dollarRow){const c=e.flatIndexOfRowId(s.rowId);return{kind:"rel",dRow:c===-1?0:a-c,field:l,dollarRow:r.dollarRow,dollarCol:r.dollarCol}}return{kind:"abs",rowId:h,field:l,dollarRow:r.dollarRow,dollarCol:r.dollarCol}}function ol(r,t,e,s="stable"){const i={host:t,accessor:e,refMode:s};function n(o){switch(o.t){case"rawRef":{const l=$e(o,i);return l?{t:"ref",ref:l}:{t:"error",code:"#REF"}}case"rawRange":{const l=$e(o.a,i),a=$e(o.b,i);return!l||!a?{t:"error",code:"#REF"}:{t:"range",ref:{a:l,b:a}}}case"call":return{t:"call",name:o.name,args:o.args.map(n)};case"unary":return{t:"unary",op:o.op,arg:n(o.arg)};case"bin":return{t:"bin",op:o.op,left:n(o.left),right:n(o.right)};default:return o}}return n(r)}function Wt(r){switch(r.t){case"range":return!0;case"call":return r.args.some(Wt);case"unary":return Wt(r.arg);case"bin":return Wt(r.left)||Wt(r.right);default:return!1}}class N extends Error{constructor(t){super(t),this.code=t}}function ci(r,t,e,s={}){const i=new Set,n={v:!1},o=s.divisionPrecision??30;try{return{value:W(r,t,e,i,n,o,s.functions,s.now),error:null,approx:n.v,touched:i}}catch(l){const a=l instanceof N?l.code:"#ERR";return{value:a,error:a,approx:n.v,touched:i}}}function Be(r,t,e){if(r.kind==="abs")return r.rowId;const s=e.flatIndexOfRowId(t.rowId);return s===-1?null:e.rowIdAtFlat(s+r.dRow)}function ll(r,t,e,s){const i=Be(r,t,e);if(i===null||!e.hasRow(i))throw new N("#REF");if(!e.hasField(r.field))throw new N("#REF");s.add(X(i,r.field));const n=e.getCellValue(i,r.field),o=Ne(n);if(o)throw new N(o);return n}function al(r,t,e,s){const i=Be(r.a,t,e),n=Be(r.b,t,e);if(i===null||n===null||!e.hasRow(i)||!e.hasRow(n))throw new N("#REF");if(!e.hasField(r.a.field)||!e.hasField(r.b.field))throw new N("#REF");const o=e.displayedRowIds(),l=o.indexOf(i),a=o.indexOf(n);if(l===-1||a===-1)throw new N("#REF");const h=Math.min(l,a),c=Math.max(l,a),u=o.slice(h,c+1),d=e.visibleFields(),g=d.indexOf(r.a.field),f=d.indexOf(r.b.field),[p,v]=g===-1||f===-1?[null,null]:[Math.min(g,f),Math.max(g,f)],w=[];for(const m of u){if(p===null||v===null){s.add(X(m,r.a.field)),w.push(e.getCellValue(m,r.a.field));continue}for(let b=p;b<=v;b++){const y=d[b];s.add(X(m,y)),w.push(e.getCellValue(m,y))}}return w}function $(r){if(r==null||r==="")return k.zero();if(r instanceof k)return r;if(typeof r=="boolean")return k.from(r?"1":"0");if(typeof r=="number")return k.from(r);if(typeof r=="string"){const t=r.trim();if(!ze.test(t))throw new N("#VALUE");return k.from(hi(t))}throw new N("#VALUE")}function At(r){return r==null?"":r instanceof k?r.toString():typeof r=="boolean"?r?"TRUE":"FALSE":String(r)}function jt(r){return typeof r=="boolean"?r:r instanceof k?!r.isZero():typeof r=="number"?r!==0:typeof r=="string"?r.trim().toUpperCase()==="TRUE"||ze.test(r.trim())&&r.trim()!=="0":!1}function hl(r){return r<=0?k.from("1"):k.from("0."+"0".repeat(r-1)+"1")}function di(r,t,e){const s=Math.max(t,0),i=r.toFixed(s+20),n=i.startsWith("-"),o=n?i.slice(1):i,[l,a=""]=o.split("."),h=a.slice(0,s),c=a.slice(s),u=/[1-9]/.test(c),d=(n?"-":"")+l+(s>0?"."+h:"");let g=k.from(d);if(u&&e==="up"){const f=hl(s);g=n?g.sub(f):g.add(f)}return g}function ui(r){const t=di(r,0,"down");return r.isNeg()&&!r.eq(t)?t.sub("1"):t}function cl(r,t){return k.from(r.toFixed(Math.max(t,0)))}function fi(r,t,e,s){const i=ui(t);if(t.eq(i)){const n=Number(i.toFixed(0));if(!Number.isFinite(n)||Math.abs(n)>1e5)return s.v=!0,k.from(String(Math.pow(r.toNumber(),t.toNumber())));if(n===0)return k.one();let o=k.one();for(let l=0;l<Math.abs(n);l++)o=o.mul(r);if(n<0){if(o.isZero())throw new N("#DIV0");o=k.one().div(o,e)}return o}return s.v=!0,k.from(String(Math.pow(r.toNumber(),t.toNumber())))}function dl(r,t,e,s,i){switch(r){case"+":return $(t).add($(e));case"-":return $(t).sub($(e));case"*":return $(t).mul($(e));case"/":{const n=$(e);if(n.isZero())throw new N("#DIV0");return $(t).div(n,s)}case"%":{const n=$(e);if(n.isZero())throw new N("#DIV0");return $(t).mod(n)}case"^":return fi($(t),$(e),s,i);case"&":return At(t)+At(e);case"=":case"<>":{const n=ul(t,e);return r==="="?n:!n}case"<":case"<=":case">":case">=":{const n=$(t),o=$(e);return r==="<"?n.lt(o):r==="<="?n.lte(o):r===">"?n.gt(o):n.gte(o)}default:throw new N("#ERR")}}function ul(r,t){try{return $(r).eq($(t))}catch{return At(r)===At(t)}}function gi(r,t){return r.t==="range"?al(r.ref,t.host,t.accessor,t.touched):[W(r,t.host,t.accessor,t.touched,t.approxBox,t.prec,t.functions,t.now)]}function _t(r,t){const e=[];for(const s of r)for(const i of gi(s,t))Ne(i)||e.push(i);return e}function ce(r){return r==null||r===""?!1:r instanceof k||typeof r=="number"?!0:typeof r=="string"?ze.test(r.trim()):!1}function fl(r,t,e){if(e.functions){const s=e.functions.get(r);if(s)return gl(s,t,e)}switch(r){case"SUM":{const s=_t(t,e);return k.sum(s.map(i=>$(i)))}case"AVG":case"AVERAGE":{const i=_t(t,e).filter(n=>n!=null&&n!=="").map(n=>$(n));if(i.length===0)throw new N("#ERR");return k.avg(i,e.prec)}case"MIN":{const s=_t(t,e).filter(ce);if(s.length===0)throw new N("#ERR");return k.min(s.map(i=>$(i)))}case"MAX":{const s=_t(t,e).filter(ce);if(s.length===0)throw new N("#ERR");return k.max(s.map(i=>$(i)))}case"COUNT":{const s=_t(t,e);return k.from(String(s.filter(ce).length))}case"COUNTA":{const s=_t(t,e);return k.from(String(s.filter(i=>i!=null&&i!=="").length))}case"IF":{if(t.length<2)throw new N("#ERR");const s=W(t[0],e.host,e.accessor,e.touched,e.approxBox,e.prec,e.functions,e.now);return jt(s)?W(t[1],e.host,e.accessor,e.touched,e.approxBox,e.prec,e.functions,e.now):t.length>2?W(t[2],e.host,e.accessor,e.touched,e.approxBox,e.prec,e.functions,e.now):!1}case"AND":return t.every(s=>jt(W(s,e.host,e.accessor,e.touched,e.approxBox,e.prec,e.functions,e.now)));case"OR":return t.some(s=>jt(W(s,e.host,e.accessor,e.touched,e.approxBox,e.prec,e.functions,e.now)));case"NOT":if(t.length!==1)throw new N("#ERR");return!jt(W(t[0],e.host,e.accessor,e.touched,e.approxBox,e.prec,e.functions,e.now));case"ROUND":{if(t.length!==2)throw new N("#ERR");const s=$(W(t[0],e.host,e.accessor,e.touched,e.approxBox,e.prec,e.functions,e.now)),i=Number($(W(t[1],e.host,e.accessor,e.touched,e.approxBox,e.prec,e.functions,e.now)).toFixed(0));return cl(s,i)}case"ROUNDUP":case"ROUNDDOWN":{if(t.length!==2)throw new N("#ERR");const s=$(W(t[0],e.host,e.accessor,e.touched,e.approxBox,e.prec,e.functions,e.now)),i=Number($(W(t[1],e.host,e.accessor,e.touched,e.approxBox,e.prec,e.functions,e.now)).toFixed(0));return di(s,i,r==="ROUNDUP"?"up":"down")}case"ABS":{if(t.length!==1)throw new N("#ERR");return $(W(t[0],e.host,e.accessor,e.touched,e.approxBox,e.prec,e.functions,e.now)).abs()}case"INT":{if(t.length!==1)throw new N("#ERR");return ui($(W(t[0],e.host,e.accessor,e.touched,e.approxBox,e.prec,e.functions,e.now)))}case"MOD":{if(t.length!==2)throw new N("#ERR");const s=$(W(t[0],e.host,e.accessor,e.touched,e.approxBox,e.prec,e.functions,e.now)),i=$(W(t[1],e.host,e.accessor,e.touched,e.approxBox,e.prec,e.functions,e.now));if(i.isZero())throw new N("#DIV0");return s.mod(i)}case"POWER":{if(t.length!==2)throw new N("#ERR");const s=$(W(t[0],e.host,e.accessor,e.touched,e.approxBox,e.prec,e.functions,e.now)),i=$(W(t[1],e.host,e.accessor,e.touched,e.approxBox,e.prec,e.functions,e.now));return fi(s,i,e.prec,e.approxBox)}case"SQRT":{if(t.length!==1)throw new N("#ERR");const s=$(W(t[0],e.host,e.accessor,e.touched,e.approxBox,e.prec,e.functions,e.now));if(s.isNeg())throw new N("#NUM");return e.approxBox.v=!0,k.from(String(Math.sqrt(s.toNumber())))}case"CONCAT":return t.map(s=>At(W(s,e.host,e.accessor,e.touched,e.approxBox,e.prec,e.functions,e.now))).join("");default:throw new N("#NAME")}}function gl(r,t,e){const{min:s,max:i}=r.arity;if(t.length<s||i!=="variadic"&&t.length>i)throw new N("#ERR");const n=t.map(l=>({scalar:()=>W(l,e.host,e.accessor,e.touched,e.approxBox,e.prec,e.functions,e.now),tryScalar:()=>{try{return{ok:!0,value:W(l,e.host,e.accessor,e.touched,e.approxBox,e.prec,e.functions,e.now)}}catch(a){return{ok:!1,error:a instanceof N?a.code:"#ERR"}}},list:()=>gi(l,e)})),o={prec:e.prec,now:e.now??(()=>Date.now()),argCount:t.length,markApprox:()=>{e.approxBox.v=!0},fail:l=>{throw new N(l)},toNum:l=>$(l),toBool:l=>jt(l),toStr:l=>At(l),isNumeric:l=>ce(l),collect:()=>_t(t,e)};return r.evaluate(n,o)}function W(r,t,e,s,i,n,o,l){switch(r.t){case"num":return k.from(r.v);case"str":return r.v;case"bool":return r.v;case"error":throw new N(r.code);case"field":{if(!e.hasField(r.field))throw new N("#REF");s.add(X(t.rowId,r.field));const a=e.getCellValue(t.rowId,r.field),h=Ne(a);if(h)throw new N(h);return pi(a)}case"ref":{const a=ll(r.ref,t,e,s);return pi(a)}case"range":throw new N("#VALUE");case"call":return fl(r.name,r.args,{host:t,accessor:e,touched:s,prec:n,approxBox:i,functions:o,now:l});case"unary":{const a=$(W(r.arg,t,e,s,i,n,o,l));return r.op==="-"?a.neg():a}case"bin":return dl(r.op,W(r.left,t,e,s,i,n,o,l),W(r.right,t,e,s,i,n,o,l),n,i);default:throw new N("#ERR")}}function pi(r){return r==null?null:r instanceof k||typeof r=="string"||typeof r=="boolean"?r:typeof r=="number"?k.from(r):String(r)}class pl{constructor(){this.$p=new Map}setFormula(t,e,s){this.$p.set(X(t,e),s)}getFormula(t,e){return this.$p.get(X(t,e))}clearFormula(t,e){this.$p.delete(X(t,e))}hasFormula(t,e){return this.$p.has(X(t,e))}getFormulaByKey(t){return this.$p.get(t)}getAllFormulaCells(){const t=[];for(const[e,s]of this.$p){const i=e.indexOf(":");t.push({rowId:e.slice(0,i),field:e.slice(i+1),cell:s})}return t}getRangeBearingKeys(){const t=[];for(const[e,s]of this.$p)s.hasRangeRef&&t.push(e);return t}size(){return this.$p.size}}class ml{constructor(){this.$cb=new Map,this.$bk=new Map,this.$do=new Map,this.$dn=new Map}$kW(t,e){let s=this.$bk.get(t);s||(s=new Set,this.$bk.set(t,s)),s.add(e);const{rowId:i,field:n}=bt(t);let o=this.$do.get(i);o||(o=new Set,this.$do.set(i,o)),o.add(e);let l=this.$dn.get(n);l||(l=new Set,this.$dn.set(n,l)),l.add(e)}$kd(t){const e=this.$cb.get(t);if(e)for(const s of e){const i=this.$bk.get(s);i&&(i.delete(t),i.size===0&&this.$bk.delete(s));const{rowId:n,field:o}=bt(s),l=this.$do.get(n);l&&(l.delete(t),l.size===0&&this.$do.delete(n));const a=this.$dn.get(o);a&&(a.delete(t),a.size===0&&this.$dn.delete(o))}}addFormula(t,e){this.$kd(t),this.$cb.set(t,new Set(e));for(const s of e)this.$kW(s,t)}removeFormula(t){this.$kd(t),this.$cb.delete(t)}isFormula(t){return this.$cb.has(t)}getPrecedents(t){return[...this.$cb.get(t)??[]]}getDependents(t){return[...this.$bk.get(t)??[]]}getDependentsClosure(t){const e=new Set;for(const n of t)this.isFormula(n)&&e.add(n);const s=[...t];let i=0;for(;i<s.length;){const n=s[i++],o=this.$bk.get(n);if(o)for(const l of o)e.has(l)||(e.add(l),s.push(l))}return[...e]}topoOrder(t){const e=new Set(t),s=new Map;for(const h of t){const c=this.$cb.get(h);let u=0;if(c)for(const d of c)e.has(d)&&u++;s.set(h,u)}const i=[];for(const[h,c]of s)c===0&&i.push(h);let n=0;const o=[];for(;n<i.length;){const h=i[n++];o.push(h);const c=this.$bk.get(h);if(c)for(const u of c){if(!e.has(u))continue;const d=(s.get(u)??0)-1;s.set(u,d),d===0&&i.push(u)}}const l=new Set(o),a=t.filter(h=>!l.has(h));return{order:o,cycles:a}}formulasReferencing(t,e){return e!==void 0?[...this.$bk.get(X(t,e))??[]]:[...this.$do.get(t)??[]]}formulasReferencingField(t){return[...this.$dn.get(t)??[]]}allFormulaKeys(){return[...this.$cb.keys()]}}function Pe(r,t,e){let s;if(r.kind==="abs")s=r.rowId;else{const a=e.flatIndexOfRowId(t.rowId);s=a===-1?null:e.rowIdAtFlat(a+r.dRow)}if(s===null||!e.hasRow(s)||!e.hasField(r.field))return"#REF!";const i=e.flatIndexOfRowId(s),n=e.visibleFields().indexOf(r.field);if(i===-1||n===-1)return"#REF!";const o=(r.dollarCol?"$":"")+rl(n),l=(r.dollarRow?"$":"")+(i+1);return o+l}function vl(r){return'"'+r.replace(/"/g,'""')+'"'}const wl={"+":"+","-":"-","*":"*","/":"/","%":"%","^":"^","&":"&","=":"=","<>":"<>","<":"<","<=":"<=",">":">",">=":">="};function yl(r,t,e){return"="+Gt(r,t,e)}function Gt(r,t,e){switch(r.t){case"num":return r.v;case"str":return vl(r.v);case"bool":return r.v?"TRUE":"FALSE";case"field":return`[${r.field}]`;case"error":return"#REF!";case"ref":return Pe(r.ref,t,e);case"range":return`${Pe(r.ref.a,t,e)}:${Pe(r.ref.b,t,e)}`;case"call":return`${r.name}(${r.args.map(s=>Gt(s,t,e)).join(",")})`;case"unary":return`${r.op}${Gt(r.arg,t,e)}`;case"bin":return`(${Gt(r.left,t,e)}${wl[r.op]}${Gt(r.right,t,e)})`;default:return"#REF!"}}class mi{constructor(t){this.store=new pl,this.graph=new ml,this.$P=t.accessor,this.$fu=t.setComputedValue,this.$eV=t.onFormulaError,this.$ka=t.refMode??"stable",this.$fa=t.divisionPrecision??30,this.$gp=t.functions,this.$i=t.now}$iv(){const t={divisionPrecision:this.$fa};return this.$gp&&(t.functions=this.$gp),this.$i&&(t.now=this.$i),t}compile(t,e){let s;try{s=sl(t)}catch{s={t:"error",code:"#ERR"}}const i=ol(s,e,this.$P,this.$ka);return{ast:i,hasRangeRef:Wt(i)}}setCellFormula(t,e,s){const i={rowId:t,field:e},{ast:n,hasRangeRef:o}=this.compile(s,i),l={src:s,ast:n,hasRangeRef:o,value:null,error:null};this.store.setFormula(t,e,l);const a=X(t,e),h=ci(n,i,this.$P,this.$iv());return this.graph.addFormula(a,h.touched),this.onValuesChanged([a])}getCellFormula(t,e){var s;return((s=this.store.getFormula(t,e))==null?void 0:s.src)??null}hasCellFormula(t,e){return this.store.hasFormula(t,e)}clearCellFormula(t,e){const s=X(t,e),i=this.graph.getDependents(s);return this.store.clearFormula(t,e),this.graph.removeFormula(s),i}getCellError(t,e){var s;return((s=this.store.getFormula(t,e))==null?void 0:s.error)??null}getDependents(t,e){return this.graph.getDependents(X(t,e)).map(bt)}onValuesChanged(t){var e;const s=de(),i=this.graph.getDependentsClosure(t),{order:n,cycles:o}=this.graph.topoOrder(i);for(const l of o){const{rowId:a,field:h}=bt(l),c=this.store.getFormula(a,h);c&&(c.value="#CYCLE",c.error="#CYCLE"),this.$fu(a,h,"#CYCLE"),(e=this.$eV)==null||e.call(this,a,h,"#CYCLE")}for(const l of n)this.$iw(l);return{changed:[...n,...o],cycles:o.length,ms:de()-s}}$iw(t){var e;const{rowId:s,field:i}=bt(t),n=this.store.getFormula(s,i);if(!n)return;const o=ci(n.ast,{rowId:s,field:i},this.$P,this.$iv());this.graph.addFormula(t,o.touched),n.value=o.value,n.error=o.error,n.approx=o.approx,this.$fu(s,i,o.value),o.error&&((e=this.$eV)==null||e.call(this,s,i,o.error))}recalculateAll(){var t;const e=de(),s=this.graph.allFormulaKeys(),{order:i,cycles:n}=this.graph.topoOrder(s);for(const o of n){const{rowId:l,field:a}=bt(o),h=this.store.getFormula(l,a);h&&(h.value="#CYCLE",h.error="#CYCLE"),this.$fu(l,a,"#CYCLE"),(t=this.$eV)==null||t.call(this,l,a,"#CYCLE")}for(const o of i)this.$iw(o);return{changed:[...i,...n],cycles:n.length,ms:de()-e}}recalcRangeBearing(){return this.onValuesChanged(this.store.getRangeBearingKeys())}invalidateRow(t){return this.onValuesChanged(this.graph.formulasReferencing(t))}invalidateField(t){return this.onValuesChanged(this.graph.formulasReferencingField(t))}offsetFormula(t,e,s,i){const n=this.store.getFormula(t,e);if(!n)return"";const o=(()=>{const a=this.$P.flatIndexOfRowId(t);return a===-1?t:this.$P.rowIdAtFlat(a+s)??t})();(()=>{const a=this.$P.visibleFields(),h=a.indexOf(e);return h===-1?e:a[h+i]??e})();const l=this.$ni(n.ast,s,i);return yl(l,{rowId:o},this.$P)}$ni(t,e,s){const i=o=>{if(o.kind==="rel")return{...o,dRow:o.dollarRow?o.dRow:o.dRow+e};let l=o.field;if(!o.dollarCol&&s!==0){const h=this.$P.visibleFields(),c=h.indexOf(o.field),u=c===-1?void 0:h[c+s];if(!u)return{kind:"abs",rowId:"__dead__",field:"__dead__",dollarRow:o.dollarRow,dollarCol:o.dollarCol};l=u}let a=o.rowId;if(!o.dollarRow&&e!==0){const h=this.$P.flatIndexOfRowId(o.rowId),c=h===-1?null:this.$P.rowIdAtFlat(h+e);if(c===null)return{kind:"abs",rowId:"__dead__",field:"__dead__",dollarRow:o.dollarRow,dollarCol:o.dollarCol};a=c}return{kind:"abs",rowId:a,field:l,dollarRow:o.dollarRow,dollarCol:o.dollarCol}},n=o=>{switch(o.t){case"ref":{const l=i(o.ref);return l.kind==="abs"&&l.rowId==="__dead__"?{t:"error",code:"#REF"}:{t:"ref",ref:l}}case"range":{const l=i(o.ref.a),a=i(o.ref.b);return l.kind==="abs"&&l.rowId==="__dead__"||a.kind==="abs"&&a.rowId==="__dead__"?{t:"error",code:"#REF"}:{t:"range",ref:{a:l,b:a}}}case"call":return{t:"call",name:o.name,args:o.args.map(n)};case"unary":return{t:"unary",op:o.op,arg:n(o.arg)};case"bin":return{t:"bin",op:o.op,left:n(o.left),right:n(o.right)};default:return o}};return n(t)}}function de(){return typeof performance<"u"?performance.now():Date.now()}class bl{constructor(){this.$az=t=>{t.stopPropagation(),t.key==="Enter"?(t.preventDefault(),this.$X(this.input.value)):t.key==="Escape"&&this.$aN()},this.$bv=()=>{this.$X(this.input.value)}}mount(t,e,s,i){this._container=t,this.$X=s,this.$aN=i,t.setAttribute("aria-haspopup","dialog"),t.setAttribute("aria-expanded","true"),this.input=document.createElement("input"),this.input.type="date",this.input.className="og-cell-input",this.input.setAttribute("aria-label",e.column.header??Mt(e,"editor.datePick"));const n=e.value;if(n){const o=n instanceof Date?n:new Date(n);isNaN(o.getTime())||(this.input.value=Ss(o,"yyyy-MM-dd"))}this.input.addEventListener("keydown",this.$az),this.input.addEventListener("blur",this.$bv),t.appendChild(this.input)}getValue(){var t;return(t=this.input)==null?void 0:t.value}focus(){var t;(t=this.input)==null||t.focus()}destroy(){var t,e,s;(t=this._container)==null||t.setAttribute("aria-expanded","false"),(e=this.input)==null||e.removeEventListener("keydown",this.$az),(s=this.input)==null||s.removeEventListener("blur",this.$bv)}}function vi(r){return r.map(t=>typeof t=="string"?{label:t,value:t}:{label:t.label??t.text??String(t.value??""),value:t.value})}class _l{constructor(t=[],e){this._options=vi(t),this.$gS=e??null}mount(t,e,s,i){this._container=t,this.$X=s,this.$aN=i,t.setAttribute("aria-haspopup","listbox"),t.setAttribute("aria-expanded","true"),this.select=document.createElement("select"),this.select.className="og-cell-select",this.select.setAttribute("aria-label",e.column.header??Mt(e,"editor.select"));const n=this.$gS?vi(this.$gS(e.row,e.rowIndex)):this._options;for(const l of n){const a=document.createElement("option");a.value=String(l.value),a.textContent=l.label,this.select.appendChild(a)}const o=e.value==null?"":String(e.value);n.some(l=>String(l.value)===o)&&(this.select.value=o),this.select.addEventListener("change",()=>s(this.select.value)),this.select.addEventListener("blur",()=>s(this.select.value)),this.select.addEventListener("keydown",l=>{l.key==="Escape"&&i()}),t.appendChild(this.select)}getValue(){var t;return(t=this.select)==null?void 0:t.value}focus(){var t;(t=this.select)==null||t.focus()}destroy(){var t;(t=this._container)==null||t.setAttribute("aria-expanded","false")}}class xl{constructor(){this.$az=t=>{t.stopPropagation(),t.key==="Enter"||t.key==="Tab"?(t.preventDefault(),this.$X(this.input.value)):t.key==="Escape"&&this.$aN()},this.$bv=()=>{this.$X(this.input.value)}}mount(t,e,s,i){this.$X=s,this.$aN=i,this.input=document.createElement("input"),this.input.type="text",this.input.value=e.value==null?"":String(e.value),this.input.style.cssText=`
|
|
39
|
+
width:100%;height:100%;border:none;outline:none;padding:0 8px;
|
|
40
|
+
font-size:var(--og-font-size,13px);font-family:var(--og-font-family,sans-serif);
|
|
41
|
+
background:var(--og-row-bg,#fff);box-sizing:border-box;
|
|
42
|
+
`,this.input.addEventListener("keydown",this.$az),this.input.addEventListener("blur",this.$bv),t.appendChild(this.input)}getValue(){var t;return(t=this.input)==null?void 0:t.value}focus(){var t,e;(t=this.input)==null||t.focus(),(e=this.input)==null||e.select()}destroy(){var t,e;(t=this.input)==null||t.removeEventListener("keydown",this.$az),(e=this.input)==null||e.removeEventListener("blur",this.$bv)}}class Cl{constructor(t){this.$az=e=>{e.stopPropagation(),e.key==="Enter"||e.key==="Tab"?(e.preventDefault(),this.$bj()):e.key==="Escape"&&this.$aN()},this.$bv=()=>{this.$bj()},this.min=t==null?void 0:t.min,this.max=t==null?void 0:t.max,this.step=t==null?void 0:t.step}mount(t,e,s,i){this.$X=s,this.$aN=i,this.input=document.createElement("input"),this.input.type="number",this.input.value=e.value==null?"":String(e.value),this.min!=null&&(this.input.min=String(this.min)),this.max!=null&&(this.input.max=String(this.max)),this.step!=null&&(this.input.step=String(this.step)),this.input.style.cssText=`
|
|
43
|
+
width:100%;height:100%;border:none;outline:none;padding:0 8px;
|
|
44
|
+
font-size:var(--og-font-size,13px);text-align:right;
|
|
45
|
+
background:var(--og-row-bg,#fff);box-sizing:border-box;
|
|
46
|
+
`,this.input.addEventListener("keydown",this.$az),this.input.addEventListener("blur",this.$bv),t.appendChild(this.input)}$bj(){const t=this.input.value===""?null:Number(this.input.value);this.$X(t)}getValue(){var t,e;return((t=this.input)==null?void 0:t.value)===""?null:Number((e=this.input)==null?void 0:e.value)}focus(){var t,e;(t=this.input)==null||t.focus(),(e=this.input)==null||e.select()}destroy(){var t,e;(t=this.input)==null||t.removeEventListener("keydown",this.$az),(e=this.input)==null||e.removeEventListener("blur",this.$bv)}}class wi{mount(t,e,s,i){this.$X=s,t.style.cssText+="display:flex;align-items:center;justify-content:center;",this.chk=document.createElement("input"),this.chk.type="checkbox",this.chk.checked=!!e.value,this.chk.style.cursor="pointer",this.chk.addEventListener("change",()=>s(this.chk.checked)),t.appendChild(this.chk)}getValue(){var t;return(t=this.chk)==null?void 0:t.checked}focus(){var t;(t=this.chk)==null||t.focus()}destroy(){}}const yi=new Map;function Ft(r,t){yi.set(r,t)}Ft("number",(r,t)=>{const e={};return t&&(t.min!=null&&(e.min=t.min),t.max!=null&&(e.max=t.max),t.step!=null&&(e.step=t.step)),new Cl(e)}),Ft("date",()=>new bl),Ft("boolean",()=>new wi),Ft("checkbox",()=>new wi),Ft("select",(r,t)=>new _l((t?t.options:r.options)??[],r.optionsFn));function bi(r){const t=r.editor;let e,s;t?typeof t=="string"?(e=t,s=void 0):(e=t.type,s=t):(e=String(r.type??""),s=void 0);const i=yi.get(e);return i?i(r,s):new xl}function Ut(r){const t=typeof r.renderer=="string"?r.renderer:r.renderer&&typeof r.renderer=="object"?r.renderer.type:"";return r.type==="boolean"||r.type==="checkbox"||t==="checkbox"||t==="switch"}const Rl=F.of(z.Focus,{sync:!0}),El=F.of(z.ColsScrolled),kl=F.of(z.ColsScrolled,{sync:!0}),_i=Object.freeze([]);class Ml{constructor(t){this.$bg=null,this.$aH=null,this._focusCell=null,this.$ik=null,this.$gV=_i,this.$a=t}get activeEditor(){return this.$bg}get editCell(){return this.$aH}get focusCell(){return this._focusCell}get dragColIdx(){return this.$ik}set dragColIdx(t){this.$ik=t}pinnedColumns(){const t=this.$aH?this.$aH.ci:-1,e=this._focusCell?this._focusCell.ci:-1,s=Math.min(t,e),i=Math.max(t,e),n=this.$gV,o=s<0?i<0?0:1:s===i?1:2,l=s<0?i:s;return n.length===o&&(o===0||n[0]===l&&(o===1||n[1]===i))?n:(this.$gV=o===0?_i:Object.freeze(o===1?[l]:[s,i]),this.$gV)}$jA(t){this.pinnedColumns()!==t&&this.$a.submitRender(El)}setFocusCell(t,e){var s,i;this._focusCell={ri:t,ci:e},this.$a.scrollToRow(t),(i=(s=this.$a).revealColumn)==null||i.call(s,e),this.$a.submitRender(Rl);const n=this.$a.getVisibleLeaves()[e],o=this.$a.data.getRowByIndex(t);if(n&&o){const l=o[n.field];this.$a.announce(this.$a.t("editor.cellPositionAnnounce",{row:t+1,col:e+1,header:n.header,value:l==null?this.$a.t("cell.emptyValue"):String(l)}))}}clearFocusCell(){this._focusCell=null}startEditByKey(t,e){var s,i,n,o,l,a,h,c,u,d,g;const f=this.$a.getVisibleLeaves()[e];if(!f)return;if(Ut(f)){const _=this.$a.getOptions();if(f.editable!==!1&&(f.editable!==void 0||_.editable)){const M=this.$a.data.getRowByIndex(t);M&&this.$a.writeCell(t,f.field,!M[f.field])}return}const p=this.$a.data.getRowByIndex(t);if(f.editable===!1||typeof f.editable=="function"&&!f.editable(p,t))return;this.commitEdit();let v=(s=this.$a.getRenderer())==null?void 0:s.getCellEl(t,e);if(v||((n=(i=this.$a).revealColumn)==null||n.call(i,e),this.$a.submitRender(kl),v=(o=this.$a.getRenderer())==null?void 0:o.getCellEl(t,e)),!v)return;v.innerHTML="";const w=bi(f),m=this.pinnedColumns();this.$bg=w,this.$aH={ri:t,ci:e},this.$jA(m),(h=(a=(l=this.$a).getBodyPin)==null?void 0:a.call(l))==null||h.pin({editRow:t});const b={type:"editStart",rowIndex:t,columnIndex:e,field:f.field,oldValue:p==null?void 0:p[f.field],newValue:p==null?void 0:p[f.field],row:p,column:f};this.$a.emit("editStart",b),v.classList.add("og-editing");const R={value:((u=(c=this.$a).hasCellFormula)!=null&&u.call(c,t,f.field)?(g=(d=this.$a).getCellFormula)==null?void 0:g.call(d,t,f.field):null)??(p==null?void 0:p[f.field]),row:p,rowIndex:t,column:f,colIndex:e,isSelected:!0,rowState:"none",t:(_,S)=>this.$a.t(_,S)};w.mount(v,R,_=>this.commitEditWithValue(t,e,_),()=>this.cancelEdit()),requestAnimationFrame(()=>w.focus())}startEdit(t,e,s){var i,n,o,l,a,h,c,u;const d=this.$a.getOptions();if(!d.editable)return;const g=this.$a.getVisibleLeaves()[e];if(!g||Ut(g))return;const f=this.$a.data.getRowByIndex(t);if(g.editable===!1||typeof g.editable=="function"&&!g.editable(f,t)||!g.editable&&!d.editable)return;this.commitEdit();const p=(i=this.$a.getRenderer())==null?void 0:i.getCellEl(t,e);if(!p)return;p.innerHTML="";const v=bi(g),w=this.pinnedColumns();this.$bg=v,this.$aH={ri:t,ci:e},this.$jA(w),(l=(o=(n=this.$a).getBodyPin)==null?void 0:o.call(n))==null||l.pin({editRow:t});const m={type:"editStart",rowIndex:t,columnIndex:e,field:g.field,oldValue:f==null?void 0:f[g.field],newValue:f==null?void 0:f[g.field],row:f,column:g};this.$a.emit("editStart",m),p.classList.add("og-editing");const y={value:((h=(a=this.$a).hasCellFormula)!=null&&h.call(a,t,g.field)?(u=(c=this.$a).getCellFormula)==null?void 0:u.call(c,t,g.field):null)??(f==null?void 0:f[g.field]),row:f,rowIndex:t,column:g,colIndex:e,isSelected:!0,rowState:"none",t:(R,_)=>this.$a.t(R,_)};v.mount(p,y,R=>this.commitEditWithValue(t,e,R),()=>this.cancelEdit()),requestAnimationFrame(()=>v.focus())}commitEdit(){if(!this.$bg||!this.$aH)return;const t=this.$bg.getValue(),{ri:e,ci:s}=this.$aH;this._finishEdit(e,s,t,!1)}commitEditWithValue(t,e,s){this._finishEdit(t,e,s,!1)}cancelEdit(){if(!this.$aH)return;const{ri:t,ci:e}=this.$aH;this._finishEdit(t,e,void 0,!0)}_finishEdit(t,e,s,i){var n,o,l,a,h,c,u,d,g,f;if(!this.$bg)return;const p=this.$a.getVisibleLeaves()[e],v=(n=this.$a.getRenderer())==null?void 0:n.getCellEl(t,e);if(this.$bg.destroy(),v&&v.classList.remove("og-editing"),this.$bg=null,this.$aH=null,(a=(l=(o=this.$a).getBodyPin)==null?void 0:l.call(o))==null||a.pin({editRow:null}),!i&&p){const w=this.$a.data.getCellValue(t,p.field),m=((c=(h=this.$a).hasCellFormula)==null?void 0:c.call(h,t,p.field))??!1;if(typeof s=="string"&&s.trimStart().startsWith("=")){(d=(u=this.$a).setCellFormula)==null||d.call(u,t,p.field,s);const y=this.$a.data.getRowByIndex(t),R={type:"editEnd",rowIndex:t,columnIndex:e,field:p.field,oldValue:w,newValue:s,row:y,column:p};this.$a.emit("editEnd",R),this.$a.emit("dataChange",this.$a.data.getData())}else if(s!==w||m){m&&((f=(g=this.$a).clearCellFormula)==null||f.call(g,t,p.field)),this.$a.data.updateCell(t,p.field,s);const y=this.$a.data.getRowByIndex(t),R={type:"editEnd",rowIndex:t,columnIndex:e,field:p.field,oldValue:w,newValue:s,row:y,column:p};this.$a.emit("editEnd",R),this.$a.emit("dataChange",this.$a.data.getData())}}this.$a.submitRender(F.REPAINT_VISIBLE),requestAnimationFrame(()=>this.$a.getContainer().focus({preventScroll:!0}))}}const Sl={streamRowThreshold:5e4};function Al(r,t){return r>=Sl.streamRowThreshold}new TextEncoder;async function Fl(){const[r,t,e]=await Promise.all([import("./sinks-qkBJ5bKn.js"),import("./XlsxChannel-CuOZ3LQz.js"),import("./XlsxWorkbookWriter-VgbibI0Z.js")]);return{pickExcelSink:r.pickExcelSink,createChannel:s=>new t.XlsxChannel(new e.XlsxWorkbookWriter({level:s.compressionLevel}),s)}}class Il{constructor(t){this.$a=t}$cd(t){return getComputedStyle(this.$a.getContainer()).getPropertyValue(t).trim()}$iR(t){const e=t.trim(),s=e.match(/^rgba?\(\s*(\d+),\s*(\d+),\s*(\d+)/i);if(s)return[s[1],s[2],s[3]].map(n=>parseInt(n).toString(16).padStart(2,"0")).join("").toUpperCase();const i=e.replace("#","").toUpperCase();return i.length===3?i[0]+i[0]+i[1]+i[1]+i[2]+i[2]:i.length===6?i:""}$hC(t){return typeof t=="string"&&/^[#0,.%]+$/.test(t)?t:void 0}$hI(t,e,s,i,n,o){var l,a;let h="1565C0",c="FFFFFF",u="FFFFFF",d="EEF2FF",g="212121",f="BDBDBD",p=10;if(o==="theme"){const b=R=>this.$iR(R);h=b(this.$cd("--og-header-bg"))||h,c=b(this.$cd("--og-header-color"))||c,u=b(this.$cd("--og-row-bg"))||u,d=b(this.$cd("--og-row-alt-bg"))||d,g=b(this.$cd("--og-row-color"))||g,f=b(this.$cd("--og-border-color"))||f;const y=this.$cd("--og-font-size");y&&(p=Math.max(8,Math.round(parseFloat(y)*.75)))}const v=o==="none",w=((a=(l=this.$a).getMeta)==null?void 0:a.call(l).exportFont)??"맑은 고딕",m={hdrFont:v?{}:{bold:!0,color:{rgb:c},sz:p,name:w},dataFont:v?{}:{sz:p,color:{rgb:g},name:w},hdrFill:v?{}:{patternType:"solid",fgColor:{rgb:h}},evenFill:v?{}:{patternType:"solid",fgColor:{rgb:u}},oddFill:v?{}:{patternType:"solid",fgColor:{rgb:d}},hdrBorder:v?{}:{top:{style:"medium",color:{rgb:h}},bottom:{style:"medium",color:{rgb:h}},left:{style:"thin",color:{rgb:h}},right:{style:"thin",color:{rgb:h}}},dataBorder:v?{}:{top:{style:"thin",color:{rgb:f}},bottom:{style:"thin",color:{rgb:f}},left:{style:"thin",color:{rgb:f}},right:{style:"thin",color:{rgb:f}}}};s.forEach((b,y)=>{const R=n&&y===0,S=(n?y-1:y)%2===0;b.forEach((M,C)=>{const E=t.encode_cell({r:y,c:C});e[E]||(e[E]={t:"s",v:""});const x=i[C],T=x.type==="number"||x.align==="right",O=R?"center":T?"right":x.align??"left",P=R?void 0:this.$hC(x.format);P&&e[E].t==="n"&&(e[E].z=P),e[E].s={font:R?m.hdrFont:m.dataFont,fill:R?m.hdrFill:S?m.evenFill:m.oddFill,border:R?m.hdrBorder:m.dataBorder,alignment:{horizontal:O,vertical:"center",wrapText:!1},...P?{numFmt:P}:{}}})})}exportExcel(t){const e=typeof t=="string"?{filename:t}:t??{};let s=e.filename??"export";s.toLowerCase().endsWith(".xlsx")||(s+=".xlsx");const i=e.sheetName??(this.$a.getOptions().ariaLabel||"Sheet1"),n=this.$a.getData(),o=this.$a.getColLayout().visibleLeaves.filter(d=>{var g;return!((g=e.exceptFields)!=null&&g.includes(d.field))}),l=e.includeHeader!==!1,a=e.stream??"auto",h=a==="force"||a==="auto"&&Al(n.length),c=(this.$a.getStrategy??((d,g)=>g))("cellSerializer",(d,g,f)=>g.type==="number"&&typeof d=="number"?d:typeof d=="boolean"?d?"✓":"":typeof d=="object"?"":String(d)),u=(d,g)=>{const f=d[g.field];if(e.maskOnExport&&g.mask&&this.$a.getMaskEnabled(g.field))return Ee(f==null?"":String(f),g.mask);const p=f;return p==null||p===""?"":c(p,g,d)};if(h){this.$lL(e,s,i,n,o,u,l);return}import("./xlsx.min-i_b-4PvU.js").then(d=>d.x).then(({utils:d,writeFile:g})=>{var f;const p=[];l&&p.push(o.map(y=>y.header));for(const y of n)p.push(o.map(R=>u(y,R)));const v=d.aoa_to_sheet(p),w=this.$a.getColWidths(),m=this.$a.getColLayout();v["!cols"]=o.map(y=>({wpx:w[m.getColumnIndex(y.field)]??100})),v["!rows"]=p.map((y,R)=>({hpx:R===0&&l?22:19})),this.$hI(d,v,p,o,l,e.styleMode??"theme");const b=d.book_new();d.book_append_sheet(b,v,i),g(b,s,{cellStyles:!0}),(f=e.onAfter)==null||f.call(e,new Blob([]))}).catch(()=>{console.error("Excel 내보내기 실패: xlsx 패키지를 확인하세요.")})}async $lL(t,e,s,i,n,o,l){var a,h;const c=this.$a.getColWidths(),u=this.$a.getColLayout(),d=y=>typeof y=="string"&&this.$iR(y)||void 0,g=(y,R)=>{const _=d((y==null?void 0:y.backgroundColor)??(y==null?void 0:y.background)),S=d(y==null?void 0:y.color),M=y==null?void 0:y.fontWeight,C=M==="bold"||M==="bolder"||Number(M)>=600,E=(y==null?void 0:y.fontStyle)==="italic";if(!(!_&&!S&&!C&&!E&&!R))return{..._?{fill:{rgb:_}}:{},...S||C||E?{font:{...C?{bold:!0}:{},...E?{italic:!0}:{},...S?{color:{rgb:S}}:{}}}:{},...R?{numFmt:R}:{}}},f=n.map(y=>({fn:typeof y.cellStyle=="function"?y.cellStyle:void 0,fmt:this.$hC(y.format),fixed:typeof y.cellStyle=="function"?void 0:g(y.cellStyle,this.$hC(y.format))})),p={projectHeader:()=>[n.map(y=>({text:y.header,field:y.field,colSpan:1,rowSpan:1,widthPx:c[u.getColumnIndex(y.field)]??100,align:y.align??"left"}))],totalRows:()=>i.length,dataState:()=>"ready",projectRows:()=>async function*(){let R=[];for(let _=0;_<i.length;_++){const S=i[_],M=n.map((C,E)=>{const x=o(S,C),T=typeof x=="number"&&C.type==="number",O=f[E],P=O.fn?g(O.fn(S[C.field],S,_),T?O.fmt:void 0):O.fixed,K=!T&&typeof C.cellRuns=="function"?C.cellRuns(S[C.field],S,_):void 0;return{text:String(x),...T?{rawText:String(x)}:{},applied:[],rowSpan:1,colSpan:1,hidden:!1,align:T||C.align==="right"?"right":C.align??"left",type:T?"number":"text",...P?{xlsxStyle:P}:{},...K&&K.length>0?{xlsxRuns:K}:{}}});R.push({modelIndex:_,cells:M}),R.length>=2e3&&(yield{rows:R,done:!1},R=[])}yield{rows:R,done:!0}}()},v=new AbortController,w=t.signal;w&&(w.aborted?v.abort():w.addEventListener("abort",()=>v.abort(),{once:!0}));const{ExportProgressView:m}=await import("./ExportProgressView-Bt5-z7rE.js"),b=new m({t:this.$a.t,onCancel:()=>v.abort()});try{const y=await(this.$a.loadStreamModules??Fl)();let R,_;try{const E=y.pickExcelSink({fileName:e});_=E.kind,R=await E.create()}catch(E){if((E==null?void 0:E.name)==="AbortError"){b.close();return}if((E==null?void 0:E.name)!=="SecurityError"&&(E==null?void 0:E.name)!=="NotAllowedError")throw E;const x=y.pickExcelSink({fileName:e,fsAccess:"off"});_=x.kind,R=await x.create()}const S=[];if(_==="blob"&&t.onAfter){const E=R;R={write:x=>(S.push(typeof x=="string"?x:x.slice()),E.write(x)),close:()=>E.close(),abort:x=>E.abort(x),get desiredSize(){return E.desiredSize}}}const M=i.length,C=await y.createChannel({sheetName:s,includeHeader:l,compressionLevel:t.compressionLevel}).writeStreaming(p,R,{signal:v.signal,onProgress:(E,x)=>{var T;b.update(E,x||M),(T=t.onProgress)==null||T.call(t,E,x||M)}});b.close(),!C.aborted&&_==="blob"&&((a=t.onAfter)==null||a.call(t,new Blob(S,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"})))}catch(y){if(v.signal.aborted){b.close();return}b.fail(y instanceof Error?y.message:String(y)),(h=t.onError)==null||h.call(t,y),console.error("Excel 스트리밍 내보내기 실패",y)}}exportCsv(t){const e=typeof t=="string"?{filename:t}:t??{},s=this.$a.getData(),i=this.$a.getColLayout().visibleLeaves,n=i.map(a=>`"${a.header}"`).join(","),o=s.map(a=>i.map(h=>{const c=a[h.field]??"";if(e.maskOnExport&&h.mask&&this.$a.getMaskEnabled(h.field))return Ee(String(c),h.mask);const u=c;return typeof u=="string"&&u.includes(",")?`"${u}"`:u}).join(",")),l=e.filename??"export.csv";Ns("\uFEFF"+[n,...o].join(`
|
|
47
|
+
`),l)}exportJson(t){const e=typeof t=="string"?t:(t==null?void 0:t.filename)??"export.json";Ns(JSON.stringify(this.$a.getData(),null,2),e,"application/json")}print(t){var e,s;const i=(t==null?void 0:t.title)??"OPEN_GRID",n=(t==null?void 0:t.footerText)??"",o=this.$a.getData(),l=this.$a.getColLayout().visibleLeaves.filter(v=>{var w;return!((w=t==null?void 0:t.excludeFields)!=null&&w.includes(v.field))}),a=l.map(v=>`<th>${v.header??v.field}</th>`).join(""),h=o.map(v=>`<tr>${l.map(w=>`<td>${String(v[w.field]??"")}</td>`).join("")}</tr>`).join(""),c=n?`<div class="og-print-footer">${n}</div>`:"",d=(((s=(e=this.$a).getMeta)==null?void 0:s.call(e))??{intlLocale:"ko-KR"}).intlLocale,g=this.$a.t?this.$a.t("export.printSummary",{rows:o.length,cols:l.length,date:new Date().toLocaleString(d)}):`${o.length}행 × ${l.length}열 · ${new Date().toLocaleString(d)}`,f=`<!DOCTYPE html>
|
|
48
|
+
<html lang="${d}"><head>
|
|
49
|
+
<meta charset="UTF-8"><title>${i}</title>
|
|
50
|
+
<style>
|
|
51
|
+
@page{margin:0;}
|
|
52
|
+
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;font-size:12px;margin:0;padding:1cm;}
|
|
53
|
+
h2{margin:0 0 10px;font-size:14px;color:#333;}
|
|
54
|
+
p{margin:0 0 8px;font-size:11px;color:#999;}
|
|
55
|
+
table{border-collapse:collapse;width:100%;}
|
|
56
|
+
th,td{border:1px solid #ccc;padding:5px 8px;text-align:left;white-space:nowrap;}
|
|
57
|
+
th{background:#f5f5f5;font-weight:600;color:#333;}
|
|
58
|
+
tr:nth-child(even) td{background:#fafafa;}
|
|
59
|
+
.og-print-footer{position:fixed;bottom:0;left:0;right:0;padding:6px 1cm;font-size:10px;color:#888;border-top:1px solid #e5e7eb;background:#fff;text-align:center;}
|
|
60
|
+
</style>
|
|
61
|
+
</head><body>
|
|
62
|
+
<h2>${i}</h2>
|
|
63
|
+
<p>${g}</p>
|
|
64
|
+
<table>
|
|
65
|
+
<thead><tr>${a}</tr></thead>
|
|
66
|
+
<tbody>${h}</tbody>
|
|
67
|
+
</table>
|
|
68
|
+
${c}
|
|
69
|
+
<script>window.addEventListener('load',()=>{window.print();window.addEventListener('afterprint',()=>window.close());});<\/script>
|
|
70
|
+
</body></html>`,p=window.open("","_blank","width=960,height=640");p&&(p.document.write(f),p.document.close())}exportSheetsExcel(t){const e=this.$a.getWsManager();if(!e){this.exportExcel(t??"workbook");return}const s=t??"workbook.xlsx",i=(this.$a.getStrategy??((n,o)=>o))("cellSerializer",(n,o,l)=>typeof n=="boolean"?n?"✓":"":o.type==="number"&&typeof n=="number"?n:String(n));import("./xlsx.min-i_b-4PvU.js").then(n=>n.x).then(({utils:n,writeFile:o})=>{const l=n.book_new(),a=this.$a.getOptions(),h=e.getActive();for(const c of e.getNames()){const u=e.get(c),d=u.columns.length?u.columns:a.columns,g=c===h?this.$a.getData():u.data,f=[d.map(v=>v.header)];for(const v of g)f.push(d.map(w=>{const m=v[w.field];return m==null?"":i(m,w,v)}));const p=n.aoa_to_sheet(f);p["!cols"]=d.map(v=>({wpx:v.width??100})),p["!rows"]=f.map((v,w)=>({hpx:w===0?22:19})),this.$hI(n,p,f,d,!0,"theme"),n.book_append_sheet(l,p,c)}o(l,s.endsWith(".xlsx")?s:s+".xlsx",{cellStyles:!0})}).catch(()=>console.error("exportSheetsExcel: xlsx 패키지를 확인하세요."))}}const ue=r=>r.map(t=>String(t)),Ll=new Map([["SUM",r=>r.length>0?k.sum(ue(r)):null],["AVG",r=>r.length>0?k.sum(ue(r)).div(k.from(String(r.length))):null],["MAX",r=>r.length>0?k.max(ue(r)):null],["MIN",r=>r.length>0?k.min(ue(r)):null]]),Tl=(r,t)=>t;let Ve=0;const xi=new Set;for(const r of De)r.length>Ve&&(Ve=r.length),xi.add(r.charCodeAt(0));const Ol=r=>typeof r=="string"&&r.length<=Ve&&xi.has(r.charCodeAt(0))&&De.has(r);function Dl(r,t){const e=[];for(let s=0;s<r.length;s++){const i=r[s][t];i==null||i===""||Ol(i)||e.push(i)}return e}class Nl{constructor(t){this.$kE=(t==null?void 0:t.getStrategy)??Tl}compute(t,e){if(!t||t.length===0)return[];const s=e.rows(),i=t.filter(a=>a.field&&a.op),n=new Map;for(const a of i)n.set(a.field,(n.get(a.field)??0)+1);const o=new Map,l=a=>{let h=o.get(a);return h||(h=Dl(s,a),o.set(a,h)),n.get(a)>1?h.slice():h};return i.map(a=>this.$lv(a,l))}format(t,e){if(!e)return Math.round(t).toLocaleString("ko-KR");const s=e.match(/[#0][#0,]*(?:\.[#0]+)?|\d+/),i=s?e.slice(0,s.index):"",n=s?e.slice(s.index+s[0].length):"",o=s?s[0]:e,l=o.includes("#")||o.includes(","),a=o.match(/\.(\d+)$/),h=a?parseInt(a[1],10):/^\d+$/.test(o)?parseInt(o,10):0,c=Math.abs(t).toFixed(h),[u="0",d]=c.split("."),g=l?u.replace(/\B(?=(\d{3})+(?!\d))/g,","):u,f=d!==void 0?`${g}.${d}`:g,p=`${i}${f}${n}`;return t<0?`-${p}`:p}$lv(t,e){const s=t.field,i=t.op,n=e(s),o=i.toUpperCase(),l=this.$kE("summaryOp",null);if(l){const u=l(o,n,s);if(u!=null)return{_field:s,_value:u,_formatted:this.format(u,t.format)}}if(o==="COUNT"){const u=n.length;return{_field:s,_value:u,_formatted:u.toLocaleString("ko-KR")}}const a=Ll.get(o),h=a?a(n):null;if(!h)return{_field:s,_value:null,_formatted:""};const c=h.toNumber();return{_field:s,_value:c,_formatted:this.format(c,t.format)}}}const Ci=100;class zl{constructor(t){this.$u=null,this.$fX=null,this.$p=[],this.$fE=[],this.$iK=-1,this.$iQ=void 0,this.$eZ=void 0,this.$t=null,this.$V=0,this.$aX=null,this.$a=t,this.$aJ=t.follower??null}setFollower(t){var e;this.$u&&((e=this.$aJ)==null||e.unfollow(this.$u)),this.$aJ=t,this.$u&&(t==null||t.follow(this.$u))}setEndGutter(t){var e;const s=t>0?t:0;if(s===this.$V)return;this.$V=s;const i=this.$u;if(i){if(s===0){(e=this.$aX)==null||e.remove(),this.$aX=null;return}if(!this.$aX){this.$aX=this.$jq(s),i.appendChild(this.$aX);return}this.$aX.style.width=`${s}px`}}$jq(t){const e=document.createElement("div");return e.className="og-footer-gutter",e.style.cssText=`width:${t}px;flex-shrink:0;`,e}setApplier(t){var e;(e=this.$t)==null||e.release("footer"),this.$t=t,this.$u&&this.paint()}paint(){var t,e,s;const i=this.$a.container(),n=i.querySelector(".og-footer-bar");n==null||n.remove(),this.$kb();const o=this.$a.options(),l=o.footer;if(!l||l.length===0)return;const a=this.$a.leaves(),h=this.$a.geometry(),c=this.$a.widths(),u=new Map(this.$a.values().map(y=>[y._field,y])),d=document.createElement("div");d.className="og-footer-bar",d.style.cssText=["display:flex;align-items:stretch;",`min-height:${o.footerHeight}px;`,"border-top:2px solid var(--og-primary,#1976d2);","background:var(--og-header-bg,#f5f5f5);","overflow:hidden;flex-shrink:0;font-size:13px;font-weight:600;"].join("");const g=h.extra.width();if(g>0){const y=document.createElement("div");y.style.cssText=`width:${g}px;flex-shrink:0;border-right:1px solid var(--og-border-color,#e0e0e0);`,d.appendChild(y)}let f=0,p=g,v=!0;const w=[],m=[];for(const y of l){const R=Math.max(1,y.colspan??1);let _=0,S=!0;for(let O=0;O<R;O++)_+=this.$nv(f+O,h,c,a),S=S&&this.$lV(f+O,h,c);const M=f;v=v&&S;const C=a[f];f+=R,p+=_;const E=document.createElement("div");E.style.cssText=[`width:${_}px;min-width:${_}px;flex-shrink:0;`,"padding:4px 8px;box-sizing:border-box;overflow:hidden;","border-right:1px solid var(--og-border-color,#e0e0e0);","white-space:nowrap;text-overflow:ellipsis;"].join("");const x=y.field,T=x?u.get(x):null;T?(this.$kU(E,y,T),E.style.color="var(--og-primary,#1976d2)",E.style.textAlign=y.align??((C==null?void 0:C.type)==="number","right")):y.label&&(E.textContent=y.label,E.style.textAlign=y.align??"left",E.style.color="var(--og-row-color,#212121)"),d.appendChild(E),S&&((t=this.$t)==null||t.trackSpan(E,M,R,"wm","footer")),w.push(E),m.push(!!T)}const b=h.totalWidth()-p;if(b>0){const y=document.createElement("div");y.className="og-footer-fill",y.style.cssText=`width:${b}px;flex-shrink:0;`,d.appendChild(y),v&&f<h.count&&((e=this.$t)==null||e.trackGap(y,f,h.count-1,"footer"))}this.$aX=this.$V>0?this.$jq(this.$V):null,this.$aX&&d.appendChild(this.$aX),o.footerPosition==="top"?i.insertBefore(d,i.firstChild):i.appendChild(d),this.$u=d,this.$fX=l,this.$p=w,this.$fE=m,this.$iK=h.version,this.$iQ=o.footerHeight,this.$eZ=o.footerPosition,(s=this.$aJ)==null||s.follow(d)}updateValues(){const t=this.$u,e=this.$fX,s=this.$a.options();if(!t||t.parentNode!==this.$a.container()||!e||s.footer!==e||s.footerHeight!==this.$iQ||s.footerPosition!==this.$eZ||this.$a.geometry().version!==this.$iK){this.paint();return}const i=new Map(this.$a.values().map(n=>[n._field,n]));for(let n=0;n<e.length;n++){const o=e[n].field;if(!!(o&&i.get(o))!==this.$fE[n]){this.paint();return}}for(let n=0;n<e.length;n++){if(!this.$fE[n])continue;const o=e[n];this.$kU(this.$p[n],o,i.get(o.field))}}$kU(t,e,s){var i;const n=s._formatted??String(s._value??""),o=e.label?`${e.label}: `:"";t.textContent=o+n,t.title=`${((i=e.op)==null?void 0:i.toUpperCase())??""} = ${n}`}destroy(){this.$kb()}$lV(t,e,s){return s!=null&&s[t]!=null&&t<e.count}$nv(t,e,s,i){var n;if(s==null)return((n=i[t])==null?void 0:n.width)??Ci;const o=s[t];return o==null?Ci:t<e.count?e.widthOf(t):o}$kb(){var t,e;(t=this.$t)==null||t.release("footer"),this.$u&&((e=this.$aJ)==null||e.unfollow(this.$u),this.$u=null,this.$fX=null,this.$p=[],this.$fE=[])}}class $l{constructor(t){this.$a=t,this.$ah=new Nl({getStrategy:(e,s)=>(this.$a.getStrategy??((i,n)=>n))(e,s)}),this.$q={rows:()=>this.$a.getData()},this.$bJ=new zl({container:()=>this.$a.getContainer(),options:()=>this.$a.getOptions(),leaves:()=>this.$a.getColLayout().visibleLeaves,geometry:()=>this.$a.getGeometry(),widths:()=>this.$a.getColWidths(),values:()=>this.computeValues()})}fmtNum(t,e){return this.$ah.format(t,e)}computeValues(){return this.$ah.compute(this.$a.getOptions().footer,this.$q)}render(){this.$bJ.paint()}paint(){this.$bJ.paint()}updateValues(){this.$bJ.updateValues()}setFollower(t){this.$bJ.setFollower(t)}setApplier(t){this.$bJ.setApplier(t)}setEndGutter(t){this.$bJ.setEndGutter(t)}destroy(){this.$bJ.destroy()}}const Bl=F.of(z.Focus|z.Range,{sync:!0});class Pl{constructor(t){this.$a=t}handleKeyDown(t){var e,s,i,n,o;const l=this.$a.getEditMgr();if(l.activeEditor)return;this.$a.handleCellKeyEvt("cellKeyDown",t);const a=this.$a.getData(),h=this.$a.getColLayout(),c=a.rowCount,u=h.visibleLeaves.length;if(c===0||u===0)return;if((t.ctrlKey||t.metaKey)&&t.key==="c"){t.preventDefault(),this.$lw();return}if((t.ctrlKey||t.metaKey)&&t.key==="v"){t.preventDefault(),this.$mJ();return}const d=((s=(e=this.$a).getRangeHooks)==null?void 0:s.call(e))??null;if((t.ctrlKey||t.metaKey)&&(d!=null&&d.isEnabled())&&(t.key==="d"||t.key==="D")){t.preventDefault(),d.ctrlFill("down");return}if((t.ctrlKey||t.metaKey)&&(d!=null&&d.isEnabled())&&(t.key==="r"||t.key==="R")){t.preventDefault(),d.ctrlFill("right");return}if(t.shiftKey&&(d!=null&&d.isEnabled())&&(t.key==="ArrowDown"||t.key==="ArrowUp"||t.key==="ArrowLeft"||t.key==="ArrowRight")){t.preventDefault();const f=t.key==="ArrowDown"?"down":t.key==="ArrowUp"?"up":t.key==="ArrowLeft"?"left":"right";d.extendFocus(f);return}const g=this.$a.getOptions();if((t.ctrlKey||t.metaKey)&&g.draggable&&l.focusCell){if(t.key==="ArrowDown"){t.preventDefault();const f=l.focusCell.ci!==void 0?l.focusCell.ri:0;f<c-1&&(this.$a.handleRowDrop(f,f+1),this.$a.setFocusCell(f+1,l.focusCell.ci),this.$a.announce(this.$a.t("row.moveAnnounce",{from:f+1,to:f+2})));return}if(t.key==="ArrowUp"){t.preventDefault();const f=l.focusCell.ri;f>0&&(this.$a.handleRowDrop(f,f-1),this.$a.setFocusCell(f-1,l.focusCell.ci),this.$a.announce(this.$a.t("row.moveAnnounce",{from:f+1,to:f})));return}}switch(t.key){case"ArrowDown":{t.preventDefault();const f=l.focusCell,p=f?Math.min(f.ri+1,c-1):0;this.$a.setFocusCell(p,(f==null?void 0:f.ci)??0);break}case"ArrowUp":{t.preventDefault();const f=l.focusCell,p=f?Math.max(f.ri-1,0):0;this.$a.setFocusCell(p,(f==null?void 0:f.ci)??0);break}case"ArrowRight":{t.preventDefault();const f=l.focusCell;if(!f){this.$a.setFocusCell(0,0);break}f.ci<u-1?this.$a.setFocusCell(f.ri,f.ci+1):f.ri<c-1&&this.$a.setFocusCell(f.ri+1,0);break}case"ArrowLeft":{t.preventDefault();const f=l.focusCell;if(!f){this.$a.setFocusCell(0,0);break}f.ci>0?this.$a.setFocusCell(f.ri,f.ci-1):f.ri>0&&this.$a.setFocusCell(f.ri-1,u-1);break}case"Tab":{t.preventDefault();const f=l.focusCell;if(!f){this.$a.setFocusCell(0,0);break}t.shiftKey?f.ci>0?this.$a.setFocusCell(f.ri,f.ci-1):f.ri>0&&this.$a.setFocusCell(f.ri-1,u-1):f.ci<u-1?this.$a.setFocusCell(f.ri,f.ci+1):f.ri<c-1&&this.$a.setFocusCell(f.ri+1,0);break}case"Home":{if(t.preventDefault(),t.ctrlKey||t.metaKey)this.$a.setFocusCell(0,0);else{const f=l.focusCell;this.$a.setFocusCell((f==null?void 0:f.ri)??0,0)}break}case"End":{if(t.preventDefault(),t.ctrlKey||t.metaKey)this.$a.setFocusCell(c-1,u-1);else{const f=l.focusCell;this.$a.setFocusCell((f==null?void 0:f.ri)??0,u-1)}break}case"PageDown":{t.preventDefault();const f=l.focusCell,p=this.$a.getOptions().pageSize??10,v=Math.min(f?f.ri+p:p-1,c-1);this.$a.setFocusCell(v,(f==null?void 0:f.ci)??0);break}case"PageUp":{t.preventDefault();const f=l.focusCell,p=this.$a.getOptions().pageSize??10,v=f?Math.max(f.ri-p,0):0;this.$a.setFocusCell(v,(f==null?void 0:f.ci)??0);break}case" ":{if(l.focusCell){t.preventDefault();const f=l.focusCell.ri,p=this.$a.getRowMgr();this.$a.getOptions().checkColumn?(p.check(f,!p.checkedRows.has(f)),this.$a.submitRender(F.ROW_STATE)):(p.selectToggle(f),this.$a.submitRender(F.ROW_STATE))}break}case"F2":case"Enter":{l.focusCell&&this.$a.getOptions().editable&&(t.preventDefault(),l.startEditByKey(l.focusCell.ri,l.focusCell.ci));break}case"Escape":{(o=(n=(i=this.$a).getRangeHooks)==null?void 0:n.call(i))==null||o.clear(),l.clearFocusCell(),this.$a.submitRender(Bl);break}}}$lw(){var t,e,s,i;if(!this.$a.getOptions().clipboard)return;const o=(e=(t=this.$a).getRangeHooks)==null?void 0:e.call(t);if(o!=null&&o.isEnabled()&&o.hasSelection()){const u=o.copyText();if(u!=null){(s=navigator.clipboard)==null||s.writeText(u).catch(()=>{});return}}const l=this.$a.getEditMgr(),a=this.$a.getColLayout(),h=this.$a.getData();let c="";if(l.focusCell){const{ri:u,ci:d}=l.focusCell,g=a.visibleLeaves[d];g&&(c=String(h.getCellValue(u,g.field)??""))}else if(this.$a.getRowMgr().selectedRows.size>0){const u=a.visibleLeaves;c=[...this.$a.getRowMgr().selectedRows].sort((g,f)=>g-f).map(g=>{const f=h.getRowByIndex(g);return u.map(p=>String((f==null?void 0:f[p.field])??"")).join(" ")}).join(`
|
|
71
|
+
`)}c&&((i=navigator.clipboard)==null||i.writeText(c).catch(()=>{}))}$mJ(){var t,e,s;const i=this.$a.getOptions();if(!i.clipboard||!i.editable)return;const n=this.$a.getEditMgr(),o=(e=(t=this.$a).getRangeHooks)==null?void 0:e.call(t);(s=navigator.clipboard)==null||s.readText().then(l=>{var a,h;if(!l||o!=null&&o.isEnabled()&&o.hasSelection()&&o.pasteText(l)||!n.focusCell)return;const{ri:c,ci:u}=n.focusCell,d=l.split(`
|
|
72
|
+
`),g=this.$a.getColLayout().visibleLeaves,f=this.$a.getData(),p=[];for(let v=0;v<d.length;v++){const w=d[v].split(" ");for(let m=0;m<w.length;m++){const b=c+v,y=u+m,R=g[y];R&&b<f.rowCount&&p.push({rowIndex:b,field:R.field,value:w[m]})}}p.length&&((h=(a=this.$a).writeCells)==null||h.call(a,p))}).catch(()=>{})}}class Vl{constructor(t){this.$r=[],this.$bn={},this.$a=t}get sortList(){return this.$r}get filters(){return this.$bn}handleSortClick(t,e){var s,i;const n=this.$a.getOptions();if(!n.sortable)return;const o=this.$r.findIndex(h=>h.field===t);if(o>=0){const h=this.$r[o];h.dir==="asc"?h.dir="desc":this.$r.splice(o,1)}else(!e||!n.multiSort)&&(this.$r=[]),this.$r.push({field:t,dir:"asc"});this.$a.getData().applySort(this.$r),(i=(s=this.$a).onReproject)==null||i.call(s),this.$hp(),this.$a.submitRender(F.REPAINT_VISIBLE);const l=this.$r.find(h=>h.field===t),a=this.$a.t(l?l.dir==="asc"?"sort.asc":"sort.desc":"sort.none");this.$a.announce(this.$a.t("sort.announce",{field:t,dir:a})),this.$gb(t)}sort(t,e="asc"){var s,i,n;if(Array.isArray(t))this.$r=t;else{const o=this.$r.findIndex(l=>l.field===t);o>=0?this.$r[o].dir=e:this.$r=[{field:t,dir:e}],this.$a.getOptions().multiSort||(this.$r=this.$r.slice(-1))}this.$a.getData().applySort(this.$r),(i=(s=this.$a).onReproject)==null||i.call(s),this.$hp(),this.$a.submitRender(F.REPAINT_VISIBLE),this.$gb(Array.isArray(t)?(n=t[0])==null?void 0:n.field:t)}$gb(t){const e={sortList:this.$r};if(t!=null){e.field=t;const s=this.$r.find(i=>i.field===t);s&&(e.dir=s.dir)}this.$a.emit("sortChange",e)}$hp(){const t=this.$a.sortIndicator;t?t.update(this.$r):this.$a.renderHeader()}resetSort(){var t,e;const s=this.$r.length>0;this.$r=[],this.$a.getData().applySort([]),(e=(t=this.$a).onReproject)==null||e.call(t),this.$hp(),this.$a.submitRender(F.REPAINT_VISIBLE),s&&this.$gb(void 0)}initSort(t){var e,s;this.$r=[...t],this.$a.getData().applySort(this.$r),(s=(e=this.$a).onReproject)==null||s.call(e)}getSortState(){return[...this.$r]}setFilter(t,e){this.$bn[t]=e,this.applyFilters(),this.$a.renderHeader(),this.$a.submitRender(F.REPAINT_VISIBLE),this.$a.emit("filterChange",{field:t,filterItems:e,allFilters:this.$bn})}resetFilter(t){t?delete this.$bn[t]:this.$bn={},this.applyFilters(),this.$a.renderHeader(),this.$a.submitRender(F.REPAINT_VISIBLE)}getFilterState(){return{...this.$bn}}restoreFilter(t){this.$bn={...t},this.applyFilters()}applyFilters(){var t,e,s,i;const n=this.$a.getData();n.setFindFilter(this.$a.getFindFilter(),this.$a.getColLayout().visibleLeaves.map(l=>l.field)),n.applyFilter(this.$bn),(e=(t=this.$a).onReproject)==null||e.call(t);const o=n.rowCount;(s=this.$a.getVs())==null||s.setTotalRows(o),(i=this.$a.getPagination())==null||i.setTotalRows(o)}}class Hl{constructor(t){this.$u=null,this.$bT=null,this.$bO=null,this.$gA=null,this.$fS=null,this.$cy="",this.$a=t}get findFilter(){return this.$cy}init(t){const e=document.createElement("div");e.className="og-find-bar",e.hidden=!0;const s=document.createElement("span");s.className="og-find-label",s.textContent=this.$a.t("findBar.label");const i=document.createElement("input");i.type="text",i.className="og-find-input",i.placeholder=this.$a.t("findBar.placeholder"),i.setAttribute("aria-label",this.$a.t("findBar.searchAria"));const n=document.createElement("span");n.className="og-find-count";const o=document.createElement("button");o.className="og-find-close",o.textContent="✕",o.setAttribute("aria-label",this.$a.t("findBar.closeAria")),e.appendChild(s),e.appendChild(i),e.appendChild(n),e.appendChild(o),t.insertBefore(e,t.firstChild),i.addEventListener("input",()=>{this.$cy=i.value.trim(),this.$ej()}),i.addEventListener("keydown",l=>{l.key==="Escape"&&this.close()}),o.addEventListener("click",()=>this.close()),this.$u=e,this.$bT=i,this.$bO=n,this.$gA=s,this.$fS=o}refreshLabels(){this.$gA&&(this.$gA.textContent=this.$a.t("findBar.label")),this.$bT&&(this.$bT.placeholder=this.$a.t("findBar.placeholder"),this.$bT.setAttribute("aria-label",this.$a.t("findBar.searchAria"))),this.$fS&&this.$fS.setAttribute("aria-label",this.$a.t("findBar.closeAria")),this.$bO&&this.$cy&&(this.$bO.textContent=this.$a.t("findBar.countBadge",{n:this.$a.getData().rowCount}))}open(){this.$u&&(this.$u.hidden=!1,this.$bT.focus(),this.$bT.select())}close(){this.$u&&(this.$u.hidden=!0,this.$cy="",this.$bT.value="",this.$bO&&(this.$bO.textContent=""),this.$ej())}$ej(){var t,e;const s=this.$a.getData(),i=this.$a.getColLayout().visibleLeaves.map(o=>o.field);s.setFindFilter(this.$cy,i),s.applyFilter(this.$a.getFilters());const n=s.rowCount;(t=this.$a.getVs())==null||t.setTotalRows(n),(e=this.$a.getPagination())==null||e.setTotalRows(n),this.$bO&&(this.$bO.textContent=this.$cy?this.$a.t("findBar.countBadge",{n}):""),this.$a.submitRender(F.REPAINT_VISIBLE)}}class Wl{constructor(t){this.$a=t}handleCellClick(t,e,s){var i,n,o,l,a,h;const c=this.$a.getOptions(),u=this.$a.getRowMgr(),d=this.$a.getEditMgr();c.selection==="single"||c.selection==="row"?u.selectSingle(t):c.selection==="multiple"?s.ctrlKey||s.metaKey?u.selectToggle(t):u.selectSingle(t):c.selection==="cells"&&e>=0&&((n=(i=this.$a).onCellsClick)==null||n.call(i,t,e,s.shiftKey));const g=this.$a.getData().getRowByIndex(t),f=this.$a.getColLayout().visibleLeaves[e];if(g&&f){d.setFocusCell(t,e);const p=f.editable!==!1&&(f.editable!==void 0||c.editable);if(Ut(f)&&p){const R=g[f.field];this.$a.writeCell(t,f.field,!R)}if(f.type==="radio"){const R=f.group;for(const _ of this.$a.getColLayout().visibleLeaves)_.type==="radio"&&_.field!==f.field&&(!R||_.group===R)&&this.$a.getData().updateCell(t,_.field,!1);this.$a.writeCell(t,f.field,!0)}let v=g[f.field];if(v===void 0&&f.formula)try{const R=f.formulaPrecision??30,_=Es(f.formula,g,R);v=_ instanceof k?f.precision!=null?_.toFixed(f.precision):_.toString():String(_)}catch{}const w={type:"cellClick",rowIndex:t,columnIndex:e,field:f.field,value:v,row:g,column:f,target:s.target,originalEvent:s};this.$a.emit("cellClick",w);const m={type:"rowClick",rowIndex:t,row:g,target:s.target,originalEvent:s};this.$a.emit("rowClick",m);const b=f.type==="select";!(d.activeEditor!=null&&((o=d.editCell)==null?void 0:o.ri)===t&&((l=d.editCell)==null?void 0:l.ci)===e)&&(c.editMode==="click"||b)&&!Ut(f)&&d.startEdit(t,e,s)}d.activeEditor&&((a=d.editCell)==null?void 0:a.ri)===t&&((h=d.editCell)==null?void 0:h.ci)===e||c.selection!=="cells"&&(this.$a.submitRender(F.ROW_STATE),this.$a.emit("selectionChange",{rows:u.getSelections(),rowIndexes:[...u.selectedRows],cells:[]}))}handleCellDblClick(t,e,s){const i=this.$a.getData().getRowByIndex(t),n=this.$a.getColLayout().visibleLeaves[e];if(!i||!n)return;const o=this.$a.getOptions(),l={type:"cellDblClick",rowIndex:t,columnIndex:e,field:n.field,value:i[n.field],row:i,column:n,target:s.target,originalEvent:s};this.$a.emit("cellDblClick",l);const a={type:"rowDblClick",rowIndex:t,row:i,target:s.target,originalEvent:s};this.$a.emit("rowDblClick",a),o.editMode==="dblclick"&&this.$a.getEditMgr().startEdit(t,e,s)}handleCellMouseOver(t,e,s){const i=this.$a.getData().getRowByIndex(t),n=this.$a.getColLayout().visibleLeaves[e];if(!i||!n)return;const o={type:"cellMouseOver",rowIndex:t,columnIndex:e,field:n.field,value:i[n.field],row:i,column:n,target:s.target,originalEvent:s};this.$a.emit("cellMouseOver",o);const l={type:"rowMouseOver",rowIndex:t,row:i,target:s.target,originalEvent:s};this.$a.emit("rowMouseOver",l)}handleCellMouseOut(t,e,s){const i=this.$a.getData().getRowByIndex(t),n=this.$a.getColLayout().visibleLeaves[e];if(!i||!n)return;const o={type:"cellMouseOut",rowIndex:t,columnIndex:e,field:n.field,value:i[n.field],row:i,column:n,target:s.target,originalEvent:s};this.$a.emit("cellMouseOut",o);const l={type:"rowMouseOut",rowIndex:t,row:i,target:s.target,originalEvent:s};this.$a.emit("rowMouseOut",l)}handleCellMouseDown(t,e,s){var i,n;(n=(i=this.$a).rangeMouseDown)==null||n.call(i,t,e,s);const o=this.$a.getData().getRowByIndex(t),l=this.$a.getColLayout().visibleLeaves[e];if(!o||!l)return;const a={type:"cellMouseDown",rowIndex:t,columnIndex:e,field:l.field,value:o[l.field],row:o,column:l,target:s.target,originalEvent:s};this.$a.emit("cellMouseDown",a);const h={type:"rowMouseDown",rowIndex:t,row:o,target:s.target,originalEvent:s};this.$a.emit("rowMouseDown",h)}handleCellMouseUp(t,e,s){var i,n;(n=(i=this.$a).rangeMouseUp)==null||n.call(i,t,e,s);const o=this.$a.getData().getRowByIndex(t),l=this.$a.getColLayout().visibleLeaves[e];if(!o||!l)return;const a={type:"cellMouseUp",rowIndex:t,columnIndex:e,field:l.field,value:o[l.field],row:o,column:l,target:s.target,originalEvent:s};this.$a.emit("cellMouseUp",a);const h={type:"rowMouseUp",rowIndex:t,row:o,target:s.target,originalEvent:s};this.$a.emit("rowMouseUp",h)}handleCellMouseMove(t,e,s){var i,n;(n=(i=this.$a).rangeMouseMove)==null||n.call(i,t,e,s);const o=this.$a.getData().getRowByIndex(t),l=this.$a.getColLayout().visibleLeaves[e];if(!o||!l)return;const a={type:"cellMouseMove",rowIndex:t,columnIndex:e,field:l.field,value:o[l.field],row:o,column:l,target:s.target,originalEvent:s};this.$a.emit("cellMouseMove",a);const h={type:"rowMouseMove",rowIndex:t,row:o,target:s.target,originalEvent:s};this.$a.emit("rowMouseMove",h)}handleCellKeyEvt(t,e){const s=this.$a.getEditMgr();if(!s.focusCell||s.activeEditor)return;const{ri:i,ci:n}=s.focusCell,o=this.$a.getData().getRowByIndex(i),l=this.$a.getColLayout().visibleLeaves[n];if(!o||!l)return;const a={type:t,rowIndex:i,columnIndex:n,field:l.field,value:o[l.field],row:o,column:l,key:e.key,target:this.$a.getContainer(),originalEvent:e};this.$a.emit(t,a)}}function jl(r,t){return{startRow:Math.min(r.ri,t.ri),endRow:Math.max(r.ri,t.ri),startCol:Math.min(r.ci,t.ci),endCol:Math.max(r.ci,t.ci)}}class Gl{constructor(t){this.$aU={ri:0,ci:0},this.$aw={ri:0,ci:0},this.$aL={rowIds:[],fields:[]},this.$aO=[],this.$ax=!1,this.$de=!1,this.$m=t}get hasSelection(){return this.$ax}getAnchor(){return{...this.$aU}}getFocus(){return{...this.$aw}}getIdentity(){return{rowIds:[...this.$aL.rowIds],fields:[...this.$aL.fields]}}getRangeSelection(){return this.$aO.map(t=>({...t}))}getActiveRange(){return this.$aO[0]?{...this.$aO[0]}:null}getPrimaryRect(){return this.getActiveRange()}getProjectedFlatRows(){return this.$aL.rowIds.map(t=>this.$m.flatIndexOfRowId(t)).filter(t=>t>=0).sort((t,e)=>t-e)}beginDrag(t,e,s={}){s.shift&&this.$ax?this.$aw={ri:t,ci:e}:(this.$aU={ri:t,ci:e},this.$aw={ri:t,ci:e}),this.$ax=!0,this.$de=!!s.additive,this.$dX()}updateFocus(t,e){this.$ax&&(this.$aw={ri:t,ci:e},this.$dX())}endDrag(){this.$ax&&this.snapshotIdentity()}get additive(){return this.$de}click(t,e){this.$aU={ri:t,ci:e},this.$aw={ri:t,ci:e},this.$ax=!0,this.$dX(),this.snapshotIdentity()}shiftClickExtend(t,e){if(!this.$ax){this.click(t,e);return}this.$aw={ri:t,ci:e},this.$dX(),this.snapshotIdentity()}extendFocus(t){if(!this.$ax)return;const e=Math.max(0,this.$m.count()-1),s=Math.max(0,this.$m.visibleFields().length-1);let{ri:i,ci:n}=this.$aw;switch(t){case"up":i=Math.max(0,i-1);break;case"down":i=Math.min(e,i+1);break;case"left":n=Math.max(0,n-1);break;case"right":n=Math.min(s,n+1);break}this.$aw={ri:i,ci:n},this.$dX(),this.snapshotIdentity()}setRect(t){this.$aU={ri:t.startRow,ci:t.startCol},this.$aw={ri:t.endRow,ci:t.endCol},this.$ax=!0,this.$aO=[{...t}],this.snapshotIdentity()}clear(){this.$ax=!1,this.$aO=[],this.$aL={rowIds:[],fields:[]}}snapshotIdentity(){const t=this.$aO[0];if(!t){this.$aL={rowIds:[],fields:[]};return}const e=[];for(let n=t.startRow;n<=t.endRow;n++){const o=this.$m.rowIdOfFlat(n);o&&e.push(o)}const i=this.$m.visibleFields().slice(t.startCol,t.endCol+1);this.$aL={rowIds:e,fields:i}}reproject(){if(!this.$ax)return;if(this.$aL.rowIds.length===0||this.$aL.fields.length===0){this.$aO=[];return}const t=this.$aL.rowIds.map(a=>this.$m.flatIndexOfRowId(a)).filter(a=>a>=0),e=this.$m.visibleFields(),s=this.$aL.fields.map(a=>e.indexOf(a)).filter(a=>a>=0);if(t.length===0||s.length===0){this.$aO=[];return}const i=Math.min(...t),n=Math.max(...t),o=Math.min(...s),l=Math.max(...s);this.$aO=[{startRow:i,endRow:n,startCol:o,endCol:l}],this.$aU={ri:i,ci:o},this.$aw={ri:n,ci:l}}$dX(){this.$aO=[jl(this.$aU,this.$aw)]}}const Ul=/^-?\d+(\.\d+)?$/,Kl=/^(.*?)(\d+)$/;function ql(r){const t=String(r??"").trim();if(t===""||!Ul.test(t))return null;try{return k.from(t)}catch{return null}}function Yl(r){const t=r.length;if(t===0)return{kind:"copy"};const e=r.map(ql);if(e.every(s=>s!==null)){if(t===1)return{kind:"copy"};const s=e,i=s.slice(1).map((o,l)=>o.sub(s[l]));return i.every(o=>o.eq(i[0]))?{kind:"arith",step:i[0],values:s}:{kind:"copy"}}if(t>=2){const s=r.map(i=>Kl.exec(String(i??"")));if(s.every(i=>i!==null)){const i=s.map(o=>o[1]);if(i.every(o=>o===i[0])){const o=s.map(h=>k.from(h[2])),l=o.slice(1).map((h,c)=>h.sub(o[c]));if(l.every(h=>h.eq(l[0])))return{kind:"text-suffix",step:l[0],values:o,prefix:i[0]}}}}return{kind:"copy"}}function Ri(r,t,e){return e<=0?0:r==="down"||r==="right"?(t-1)%e:(e-t%e)%e}function Xl(r,t,e,s){const i=t.length;if(r.kind==="copy"||!r.values||!r.step)return t[Ri(e,s,i)];const n=e==="down"||e==="right",o=n?r.values[r.values.length-1]:r.values[0],l=n?r.step:r.step.neg(),a=o.add(l.mul(s));return r.kind==="text-suffix"?`${r.prefix}${a.toNumber()}`:a.toNumber()}function It(r,t){const e=[];for(let s=r;s<=t;s++)e.push(s);return e}function Zl(r,t,e,s,i){var n;const o=r.resolveFlatRow(t);return o.kind!=="data"||!o.rowId?{rowIndex:t,field:e,action:"skip",reason:"non-data-row"}:r.isEditable&&!r.isEditable(o.rowId,e)?{rowIndex:t,field:e,action:"skip",reason:"not-editable"}:!!((n=r.hasCellFormula)!=null&&n.call(r,o.rowId,e))&&!r.overwriteFormula?(i(),{rowIndex:t,field:e,action:"skip",reason:"formula-preserved"}):{rowIndex:t,field:e,action:"value",value:s}}function Jl(r,t,e,s,i,n,o,l){var a,h;const c=r.resolveFlatRow(t);if(c.kind!=="data"||!c.rowId)return{rowIndex:t,field:s,action:"skip",reason:"non-data-row"};if(r.isEditable&&!r.isEditable(c.rowId,s))return{rowIndex:t,field:s,action:"skip",reason:"not-editable"};const u=r.resolveFlatRow(i),d=!!(u.rowId&&((a=r.hasCellFormula)!=null&&a.call(r,u.rowId,o)));if(d&&u.rowId){if(r.forceCopyFormula){const p=r.getCellValue(i,o);return{rowIndex:t,field:s,action:"setFormula",formula:String(p)}}if(r.offsetFormula){const p=r.offsetFormula(u.rowId,o,t-i,e-n);return{rowIndex:t,field:s,action:"setFormula",formula:p}}}const g=!!((h=r.hasCellFormula)!=null&&h.call(r,c.rowId,s));if(!d&&g&&!r.overwriteFormula)return l(),{rowIndex:t,field:s,action:"skip",reason:"formula-preserved"};const f=r.getCellValue(i,o);return{rowIndex:t,field:s,action:"value",value:f}}function Ql(r,t,e,s,i){const n=e==="up"||e==="down",o=[];let l=0;const a=()=>{l++},h=n?It(r.startCol,r.endCol):It(r.startRow,r.endRow);for(const c of h){const u=n?i.fieldAt(c):void 0,d=n?It(r.startRow,r.endRow).map(w=>({ri:w,ci:c})):It(r.startCol,r.endCol).map(w=>({ri:c,ci:w})),g=d.map(w=>{const m=n?u:i.fieldAt(w.ci);return m?i.getCellValue(w.ri,m):void 0}),f=s==="series"?Yl(g):{kind:"copy"},p=n?It(t.startRow,t.endRow):It(t.startCol,t.endCol);(e==="down"||e==="right"?p:[...p].reverse()).forEach((w,m)=>{const b=m+1,y=n?w:c,R=n?c:w,_=n?u:i.fieldAt(w);if(!_)return;if(f.kind!=="copy"){const E=Xl(f,g,e,b);o.push(Zl(i,y,_,E,a));return}const S=Ri(e,b,d.length),M=d[S],C=n?u:i.fieldAt(M.ci);C&&o.push(Jl(i,y,R,_,M.ri,M.ci,C,a))})}return{items:o,skippedFormula:l}}function ta(r,t){return t==="down"?r.endRow<=r.startRow?null:{source:{startRow:r.startRow,endRow:r.startRow,startCol:r.startCol,endCol:r.endCol},target:{startRow:r.startRow+1,endRow:r.endRow,startCol:r.startCol,endCol:r.endCol}}:r.endCol<=r.startCol?null:{source:{startRow:r.startRow,endRow:r.endRow,startCol:r.startCol,endCol:r.startCol},target:{startRow:r.startRow,endRow:r.endRow,startCol:r.startCol+1,endCol:r.endCol}}}function ea(r,t){const e=[];for(let s=r.startRow;s<=r.endRow;s++){const i=[];for(let n=r.startCol;n<=r.endCol;n++){const o=t.fieldAt(n);if(!o){i.push("");continue}const l=t.getDisplayText?t.getDisplayText(s,o):String(t.getCellValue(s,o)??"");i.push(l)}e.push(i.join(" "))}return e.join(`
|
|
73
|
+
`)}function sa(r){return r===""?[[""]]:r.split(`
|
|
74
|
+
`).map(t=>t.split(" "))}function ia(r,t,e){var s;const i=r.length,n=i>0?Math.max(...r.map(u=>u.length)):0;if(i===0||n===0)return[];const o=t.endRow-t.startRow+1,l=t.endCol-t.startCol+1,a=Math.max(o,i),h=Math.max(l,n),c=[];for(let u=0;u<a;u++)for(let d=0;d<h;d++){const g=t.startRow+u,f=t.startCol+d,p=e.fieldAt(f);if(!p)continue;const v=e.resolveFlatRow(g);if(v.kind!=="data"||!v.rowId){c.push({rowIndex:g,field:p,action:"skip",reason:"non-data-row"});continue}if(e.isEditable&&!e.isEditable(v.rowId,p)){c.push({rowIndex:g,field:p,action:"skip",reason:"not-editable"});continue}const w=((s=r[u%i])==null?void 0:s[d%n])??"";c.push({rowIndex:g,field:p,action:"value",value:w})}return c}function Ei(r,t){const e=[];for(let s=r.startRow;s<=r.endRow;s++){const i=[];for(let n=r.startCol;n<=r.endCol;n++){const o=t.fieldAt(n);i.push(o?t.getCellValue(s,o):void 0)}e.push(i)}return e}function na(r,t){const e=Ei(r,t).flat(),s=[];for(const i of e){const n=String(i??"").trim();n===""||!/^-?\d+(\.\d+)?$/.test(n)||s.push(k.from(n))}return s.length===0?null:{sum:k.sum(s).toString(),avg:k.avg(s).toString(),count:s.length,min:k.min(s).toString(),max:k.max(s).toString()}}const He=F.of(z.Range,{sync:!0});class ra{constructor(t){this.$eL=!1,this.$gg=null,this.$gh=null,this.$bm=null,this._handlePointerId=null,this.$cq=null,this.$fH=0,this.$fI=0,this.$jL=null,this.$el=null,this.$dS=null,this._handleEl=null,this.$jv=null,this.$a=t;const e={count:()=>this.$a.getFlatModel().count(),resolveFlatRow:s=>this.$a.getFlatModel().resolveFlatRow(s),flatIndexOfRowId:s=>this.$a.getFlatModel().flatIndexOfRowId(s),rowIdOfFlat:s=>this.$a.getFlatModel().rowIdOfFlat(s),visibleFields:()=>this.$a.getColLayout().visibleLeaves.map(s=>s.field)};this.$n=new Gl(e)}isEnabled(){var t;const e=this.$a.getOptions();return((t=e.rangeSelection)==null?void 0:t.enabled)??e.selection==="cells"}$fd(){const t=this.$a.getOptions().rangeSelection;return{fillHandle:(t==null?void 0:t.fillHandle)??!0,multiRange:(t==null?void 0:t.multiRange)??!1,autoScrollEdge:(t==null?void 0:t.autoScrollEdge)??24,seriesFill:(t==null?void 0:t.seriesFill)??!0,enabledInTreeGroup:(t==null?void 0:t.enabledInTreeGroup)??!1,fillOverwriteFormula:(t==null?void 0:t.fillOverwriteFormula)??!1}}$ip(){return this.$a.getEditMgr().activeEditor!=null}hasSelection(){return this.$n.hasSelection}getRangeSelection(){return this.$n.getRangeSelection()}getActiveRange(){return this.$n.getActiveRange()}getFillPreview(){return this.$bm}getRangeValues(){const t=this.getActiveRange();return t?Ei(t,this.$jU()):[]}getRangeStats(){const t=this.getActiveRange();return t?na(t,this.$jU()):null}$jU(){return{fieldAt:t=>{var e;return(e=this.$a.getColLayout().visibleLeaves[t])==null?void 0:e.field},getCellValue:(t,e)=>this.$a.getData().getCellValue(t,e)}}handleCellMouseDown(t,e,s){if(!this.isEnabled()||this.$ip()||t<0||e<0)return;this.$n.beginDrag(t,e,{additive:s.ctrlKey||s.metaKey,shift:s.shiftKey}),this.$eL=!0,this.$a.setFocusCell(t,e),this.$a.submitRender(He);const i=()=>{document.removeEventListener("mouseup",i),this.handleCellMouseUp(-1,-1,s)};document.addEventListener("mouseup",i)}handleCellMouseMove(t,e,s){this.$eL&&(t>=0&&e>=0&&(this.$n.updateFocus(t,e),this.$a.submitRender(He)),this.$mp(s))}handleCellMouseUp(t,e,s){this.$eL&&(this.$eL=!1,this.$kD(),this.$n.endDrag(),this.$df(!0))}handleClick(t,e,s){if(!this.isEnabled()||this.$ip())return;s?this.$n.shiftClickExtend(t,e):this.$n.click(t,e);const i=this.$n.getFocus();this.$a.setFocusCell(i.ri,i.ci),this.$df(!0)}extendFocus(t){if(!this.isEnabled()||!this.$n.hasSelection)return;this.$n.extendFocus(t);const e=this.$n.getFocus();this.$a.setFocusCell(e.ri,e.ci),this.$df(!0)}clear(){this.$n.hasSelection&&(this.$n.clear(),this.$df(!0))}clearRangeSelection(){this.clear()}setRangeSelection(t){const e=Array.isArray(t)?t[0]:t;if(!e){this.clear();return}this.$n.setRect(e);const s=this.$n.getFocus();this.$a.setFocusCell(s.ri,s.ci),this.$df(!0)}reproject(){var t,e;if(!this.$n.hasSelection)return;this.$n.reproject();const s=this.$n.getActiveRange();this.$a.emit("rangeChange",{range:s}),(e=(t=this.$a.getOptions()).onRangeChange)==null||e.call(t,{range:s})}$df(t){var e;if(this.$a.submitRender(He),!t)return;const s=this.$n.getRangeSelection(),i=this.$n.getActiveRange(),n=this.$a.getOptions();this.$a.emit("selectionChange",{rows:[],rowIndexes:[],cells:s}),this.$a.emit("rangeChange",{range:i}),(e=n.onRangeChange)==null||e.call(n,{range:i}),this.$la()}$la(){const t=this.getActiveRange();if(!t)return;const e=t.endRow-t.startRow+1,s=t.endCol-t.startCol+1;this.$a.announce(this.$a.t("range.selectionAnnounce",{r1:t.startRow+1,c1:t.startCol+1,r2:t.endRow+1,c2:t.endCol+1,n:e*s}))}ctrlFill(t){if(!this.isEnabled())return;const e=this.getActiveRange();if(!e)return;const s=ta(e,t);s&&this.$fT(s.source,s.target,t,"copy")}fillRange(t,e,s="copy"){let i;e.startRow<t.startRow?i="up":e.endRow>t.endRow?i="down":e.startCol<t.startCol?i="left":i="right",this.$fT(t,e,i,s)}$jb(t,e){const s=this.$a.getColLayout().getColumnByField(e);if(!s||s.editable===!1)return!1;const i=this.$a.getOptions();if(typeof s.editable=="function"){const n=this.$a.getFlatModel().flatIndexOfRowId(t),o=n>=0?this.$a.getData().getRowByIndex(n):void 0;return o?!!s.editable(o,n):!1}return s.editable!==void 0?!0:!!i.editable}$fT(t,e,s,i){var n,o,l,a;const h=this.$fd(),c=h.seriesFill?i:"copy",u={resolveFlatRow:m=>this.$a.getFlatModel().resolveFlatRow(m),fieldAt:m=>{var b;return(b=this.$a.getColLayout().visibleLeaves[m])==null?void 0:b.field},getCellValue:(m,b)=>this.$a.getData().getCellValue(m,b),isEditable:(m,b)=>this.$jb(m,b),hasCellFormula:(m,b)=>{var y,R;return((R=(y=this.$a).hasCellFormula)==null?void 0:R.call(y,m,b))??!1},offsetFormula:(m,b,y,R)=>{var _,S;return((S=(_=this.$a).offsetFormula)==null?void 0:S.call(_,m,b,y,R))??""},overwriteFormula:h.fillOverwriteFormula},d=Ql(t,e,s,c,u),g=[],f=[],p=[];for(const m of d.items)if(m.action==="value"){const b=this.$a.getData().getCellValue(m.rowIndex,m.field);g.push({rowIndex:m.rowIndex,field:m.field,oldValue:b,newValue:m.value}),f.push({rowIndex:m.rowIndex,field:m.field,value:m.value})}else if(m.action==="setFormula"&&m.formula!=null){const b=this.$a.getFlatModel().resolveFlatRow(m.rowIndex);b.kind==="data"&&b.rowId&&(p.push({rowId:b.rowId,field:m.field,formula:m.formula}),g.push({rowIndex:m.rowIndex,field:m.field,oldValue:this.$a.getData().getCellValue(m.rowIndex,m.field),newValue:m.formula}))}const v={source:t,target:e,mode:c,written:g,skippedFormula:d.skippedFormula,cancel:!1};if(this.$a.emit("rangeFill",v),(o=(n=this.$a.getOptions()).onRangeFill)==null||o.call(n,v),v.cancel)return;f.length&&this.$a.writeCells(f);for(const m of p)(a=(l=this.$a).setCellFormulaByRowId)==null||a.call(l,m.rowId,m.field,m.formula);d.skippedFormula>0&&this.$a.announce(this.$a.t("range.formulaPreserved",{count:d.skippedFormula}));const w=d.items.filter(m=>m.action==="skip"&&m.reason!=="formula-preserved").length;w>0&&this.$a.announce(this.$a.t("range.fillSkipped",{count:w}))}copyText(){var t,e;const s=this.getActiveRange();if(!s)return null;const n=ea(s,{fieldAt:o=>{var l;return(l=this.$a.getColLayout().visibleLeaves[o])==null?void 0:l.field},getCellValue:(o,l)=>this.$a.getData().getCellValue(o,l),getDisplayText:(o,l)=>this.$a.getDisplayValue(o,l)});return this.$a.emit("rangeCopy",{range:s,text:n}),(e=(t=this.$a.getOptions()).onRangeCopy)==null||e.call(t,{range:s,text:n}),n}pasteText(t){const e=this.getActiveRange();if(!e)return!1;const s=sa(t),o=ia(s,e,{resolveFlatRow:l=>this.$a.getFlatModel().resolveFlatRow(l),fieldAt:l=>{var a;return(a=this.$a.getColLayout().visibleLeaves[l])==null?void 0:a.field},isEditable:(l,a)=>this.$jb(l,a)}).filter(l=>l.action==="value").map(l=>({rowIndex:l.rowIndex,field:l.field,value:l.value}));return this.$a.writeCells(o),!0}$mp(t){const e=this.$a.getRenderer();if(!e)return;const i=e.bodyWrapper.getBoundingClientRect(),n=this.$fd().autoScrollEdge;let o=0,l=0;const a=t.clientY-i.top,h=i.bottom-t.clientY,c=t.clientX-i.left,u=i.right-t.clientX;if(a<n?l=-this.$fr(n-a):h<n&&(l=this.$fr(n-h)),c<n?o=-this.$fr(n-c):u<n&&(o=this.$fr(n-u)),o===0&&l===0){this.$kD();return}this.$fH=o,this.$fI=l,this.$cq==null&&this.$ko()}$fr(t){return Math.max(2,Math.min(20,t))}$ko(){const t=this.$a.getRenderer();if(!t){this.$cq=null;return}t.bodyWrapper.scrollTop+=this.$fI,t.bodyWrapper.scrollLeft+=this.$fH,this.$cq=requestAnimationFrame(()=>this.$ko())}$kD(){this.$cq!=null&&(cancelAnimationFrame(this.$cq),this.$cq=null),this.$fH=0,this.$fI=0}mount(t){if(this.$jv===t)return;this.$jv=t;const e=document.createElement("div");e.className="og-range-overlay",e.style.cssText="position:sticky;top:0;left:0;width:0;height:0;overflow:visible;pointer-events:none;z-index:6;";const s=document.createElement("div");s.className="og-range-border",s.style.cssText="position:absolute;box-sizing:border-box;border:2px solid var(--og-range-border,#1976d2);pointer-events:none;display:none;";const i=document.createElement("div");i.className="og-range-fill-preview",i.style.cssText="position:absolute;box-sizing:border-box;border:1px dashed var(--og-range-border,#1976d2);pointer-events:none;display:none;";const n=document.createElement("div");n.className="og-range-fill-handle",n.setAttribute("role","button"),n.setAttribute("aria-label",this.$a.t("range.fillHandleAria")),n.style.cssText="position:absolute;display:none;pointer-events:auto;background-color:var(--og-fill-handle-bg,#1976d2);",n.addEventListener("pointerdown",o=>this.$mz(o)),e.appendChild(s),e.appendChild(i),e.appendChild(n),t.insertBefore(e,t.firstChild),t.addEventListener("scroll",()=>this.repaint(),{passive:!0}),this.$jL=e,this.$el=s,this.$dS=i,this._handleEl=n}repaint(){if(!this.$jL)return;const t=this.$a.getRenderer(),e=this.getActiveRange();if(!t||!e){this.$iS();return}const s=this.$hO(t,e);if(!s){this.$iS();return}const{left:i,top:n,right:o,bottom:l}=s;if(Object.assign(this.$el.style,{display:"block",left:`${i}px`,top:`${n}px`,width:`${Math.max(0,o-i)}px`,height:`${Math.max(0,l-n)}px`}),this.$fd().fillHandle?Object.assign(this._handleEl.style,{display:"block",left:`${o}px`,top:`${l}px`}):this._handleEl.style.display="none",this.$bm){const a=this.$hO(t,this.$bm.target);if(a){const{left:h,top:c,right:u,bottom:d}=a;Object.assign(this.$dS.style,{display:"block",left:`${h}px`,top:`${c}px`,width:`${Math.max(0,u-h)}px`,height:`${Math.max(0,d-c)}px`});return}}this.$dS.style.display="none"}$hO(t,e){var s,i;const n=t.getCellEl(e.startRow,e.startCol),o=t.getCellEl(e.endRow,e.endCol);if(n&&o){const a=t.bodyWrapper.getBoundingClientRect(),h=n.getBoundingClientRect(),c=o.getBoundingClientRect();return{left:Math.min(h.left,c.left)-a.left,top:Math.min(h.top,c.top)-a.top,right:Math.max(h.right,c.right)-a.left,bottom:Math.max(h.bottom,c.bottom)-a.top}}const l=(i=(s=this.$a).rangeRect)==null?void 0:i.call(s,e);return l?{left:l.left,top:l.top,right:l.left+l.width,bottom:l.top+l.height}:null}$iS(){this.$el&&(this.$el.style.display="none"),this._handleEl&&(this._handleEl.style.display="none"),this.$dS&&(this.$dS.style.display="none")}getOverlayExtraOpts(){return{_rangeRects:this.$n.getRangeSelection()}}$mX(t,e){const s=typeof document.elementFromPoint=="function"?document.elementFromPoint(t,e):null,i=s==null?void 0:s.closest(".og-cell"),n=i==null?void 0:i.closest(".og-row");if(!i||!n)return null;const o=i.getAttribute("aria-colindex"),l=n.getAttribute("aria-rowindex");return o==null||l==null?null:{ri:Number(l)-1,ci:Number(o)-1}}$mz(t){var e;const s=this.getActiveRange();if(!s)return;t.stopPropagation(),t.preventDefault(),this._handlePointerId=t.pointerId;try{(e=this._handleEl)==null||e.setPointerCapture(t.pointerId)}catch{}this.$gg=s,this.$gh={x:t.clientX,y:t.clientY};const i=o=>this.$mA(o),n=o=>{document.removeEventListener("pointermove",i),document.removeEventListener("pointerup",n),this.$mB(o)};document.addEventListener("pointermove",i),document.addEventListener("pointerup",n)}$mA(t){const e=this.$gg,s=this.$gh;if(!e||!s)return;const i=this.$mX(t.clientX,t.clientY);if(!i)return;const n=t.clientX-s.x,o=t.clientY-s.y,l=Math.abs(o)>=Math.abs(n);let a,h;if(l)if(i.ri>e.endRow)a="down",h={startRow:e.endRow+1,endRow:i.ri,startCol:e.startCol,endCol:e.endCol};else if(i.ri<e.startRow)a="up",h={startRow:i.ri,endRow:e.startRow-1,startCol:e.startCol,endCol:e.endCol};else{this.$bm=null,this.repaint();return}else if(i.ci>e.endCol)a="right",h={startRow:e.startRow,endRow:e.endRow,startCol:e.endCol+1,endCol:i.ci};else if(i.ci<e.startCol)a="left",h={startRow:e.startRow,endRow:e.endRow,startCol:i.ci,endCol:e.startCol-1};else{this.$bm=null,this.repaint();return}const u=this.$fd().seriesFill?"series":"copy",g=t.ctrlKey||t.metaKey?u==="series"?"copy":"series":u;this.$bm={source:e,target:h,axis:a,mode:g},this.repaint()}$mB(t){const e=this.$bm;this.$gg=null,this.$gh=null,this.$bm=null,this._handlePointerId=null,e&&this.$fT(e.source,e.target,e.axis,e.mode),this.repaint()}}class oa{constructor(t){this.$eD=[],this.$bq=new Set,this.$eE=[],this.$cF=!1,this.$fD=[],this.$fC=[],this.$bG=new Set,this.$cG=!1,this.$a=t}get isGroupMode(){return this.$cF}get isTreeMode(){return this.$cG}get groupFlatRows(){return this.$eE}get treeFlatRows(){return this.$fC}groupBy(t){this.$eD=t,this.$bq.clear(),this.$cF=t.length>0,this.rebuildGroups()}clearGroup(){var t;this.$eD=[],this.$bq.clear(),this.$cF=!1,this.$eE=[],this.$a.setFlatBacking(null),(t=this.$a.getVs())==null||t.setTotalRows(this.$a.getFlatCount()),this.$a.submitRender(F.REPAINT_VISIBLE)}expandAll(){if(!this.$cF)return;const t=ii(this.$a.getData(),this.$eD,this.$iL(),void 0,void 0,this.$iN());oi(t).forEach(e=>this.$bq.add(e)),this.rebuildGroups()}$iN(){return this.$a.getStrategy?this.$a.getStrategy("groupKeyFn",void 0):void 0}collapseAll(){this.$bq.clear(),this.$cF&&this.rebuildGroups()}handleGroupToggle(t){this.$bq.has(t)?this.$bq.delete(t):this.$bq.add(t),this.rebuildGroups()}rebuildGroups(){var t;const e=this.$a.getData(),s=this.$a.getDataLayer(),i=l=>{const a=e.indexOf(l);return a>=0?s.getRowState(a):"none"},n=ii(e,this.$eD,this.$iL(),this.$bq,i,this.$iN());this.$eE=ri(n),this.$a.setFlatBacking(()=>this.$eE);const o=this.$a.getFlatCount();(t=this.$a.getVs())==null||t.setTotalRows(o),this.$a.submitRender(F.REPAINT_VISIBLE)}enableTree(){this.$cG=!0,this.$cF=!1;const t=this.$a.getOptions();if(t.expandOnLoad){const e=Te(this.$a.getData(),{idField:t.treeId,parentIdField:t.treeParentId});Oe(e).forEach(s=>this.$bG.add(s))}this.rebuildTree()}disableTree(){var t;this.$cG=!1,this.$fD=[],this.$fC=[],this.$bG.clear(),this.$a.setFlatBacking(null),(t=this.$a.getVs())==null||t.setTotalRows(this.$a.getFlatCount()),this.$a.submitRender(F.REPAINT_VISIBLE)}expandNodes(t,e=!0){const s=Array.isArray(t)?t:[t];for(const i of s)e?this.$bG.add(i):this.$bG.delete(i);this.$cG&&this.rebuildTree()}expandAllNodes(){this.$cG&&(Oe(this.$fD).forEach(t=>this.$bG.add(t)),this.rebuildTree())}collapseAllNodes(){this.$cG&&(this.$bG.clear(),this.rebuildTree())}handleTreeToggle(t){Ko(this.$bG,t),this.rebuildTree()}rebuildTree(){var t;const e=this.$a.getOptions();this.$fD=Te(this.$a.getData(),{idField:e.treeId,parentIdField:e.treeParentId,expandOnLoad:e.expandOnLoad},this.$bG),this.$fC=ai(this.$fD),this.$a.setFlatBacking(()=>this.$fC);const s=this.$a.getFlatCount();(t=this.$a.getVs())==null||t.setTotalRows(s),this.$a.submitRender(F.REPAINT_VISIBLE)}$iL(){const t=this.$a.getOptions().summary;if(!t)return[];if(t.rows&&t.rows.length>0)return t.fields.flatMap(s=>t.rows.map(i=>({field:s,op:i.op,format:i.format})));const e=Array.isArray(t.ops)?t.ops:t.ops?[t.ops]:["SUM"];return t.fields.map(s=>({field:s,op:e[0]??"SUM",format:t.format}))}}class la{constructor(t={}){this._expanded=new Set,this.$W=t.maxDepth??2,this.$gd=t.expandMultiple??!0,this._depth=t.depth??0}get expandedRowIds(){return this._expanded}get size(){return this._expanded.size}get depth(){return this._depth}get maxDepth(){return this.$W}get expandMultiple(){return this.$gd}isExpanded(t){return this._expanded.has(t)}canExpand(){return this._depth<this.$W}expand(t){return this._expanded.has(t)?!0:this.canExpand()?(this.$gd||this._expanded.clear(),this._expanded.add(t),!0):!1}collapse(t){return this._expanded.delete(t)}toggle(t){return this._expanded.has(t)?(this.collapse(t),"collapsed"):this.expand(t)?"expanded":"rejected"}collapseAll(){const t=Array.from(this._expanded);return this._expanded.clear(),t}buildEventPayload(t,e,s,i){return{rowIndex:e,rowId:t,row:s,host:i}}}function aa(r){return!!r&&r._isGroup===!0}function ha(r){return!!r&&r._isTree===!0}function ca(r){return!!r&&(r._isDetailHead===!0||r._isDetailFiller===!0)}function da(r){return!(r==null||ca(r)||aa(r))}function ua(r){return ha(r)?r.data:r}function fa(r,t,e){if(e.getSlotCount){const n=Math.floor(e.getSlotCount(r,t));return Number.isFinite(n)&&n>0?n:1}const s=e.height??200,i=e.rowHeight>0?e.rowHeight:1;return Math.max(1,Math.ceil(s/i))}function ga(r,t){const e=[];if(t.expandedRowIds.size===0){for(const s of r)e.push(s);return e}for(const s of r){if(e.push(s),!da(s))continue;const i=ua(s),n=i!=null?t.getRowId(i):null;if(n==null||!t.expandedRowIds.has(n))continue;const o=fa(i,n,t),l={_isDetailHead:!0,_rowId:n,_masterFlatBase:s,_span:o};e.push(l);for(let a=1;a<o;a++)e.push({_isDetailFiller:!0,_rowId:n})}return e}class pa{constructor(t){this.adapter=t,this.$Q=new Map}get size(){return this.$Q.size}has(t){return this.$Q.has(t)}getOrCreate(t,e){const s=this.$Q.get(t);if(s)return s.attached=!0,s;const i=e(),n=this.adapter.create(t,i),o={host:i,instance:n,attached:!0};return this.$Q.set(t,o),o}reattach(t){const e=this.$Q.get(t);return!e||e.attached?!1:(this.adapter.reattach(e.instance,e.host),e.attached=!0,!0)}detach(t){const e=this.$Q.get(t);return!e||!e.attached?!1:(this.adapter.detach(e.instance,e.host),e.attached=!1,!0)}detachAll(){for(const t of this.$Q.keys())this.detach(t)}remove(t,e={}){const s=this.$Q.get(t);if(s){if(e.cache){s.attached&&this.adapter.detach(s.instance,s.host),s.attached=!1;return}this.adapter.destroy(s.instance,s.host),this.$Q.delete(t)}}getInstance(t){var e;return(e=this.$Q.get(t))==null?void 0:e.instance}getHost(t){var e;return(e=this.$Q.get(t))==null?void 0:e.host}isAttached(t){var e;return((e=this.$Q.get(t))==null?void 0:e.attached)===!0}isEditing(t,e){if(!e)return!1;const s=this.$Q.get(t);return!!s&&e(s.instance)}destroyAll(){for(const t of this.$Q.values())this.adapter.destroy(t.instance,t.host);this.$Q.clear()}}let ki=!1;class ma{constructor(t){this.$bS=new Map,this.$dD=null,this.$ck=0,this.$kt=void 0,this.$ks=void 0,this.$ku=void 0,this.$kr=void 0,this.$jj=!1,this.$jk=-1,this.$jl=-1,this.$a=t;const e=this.$cM();this.$f=new la({maxDepth:e.maxDepth??2,expandMultiple:e.expandMultiple??!0,depth:t.getDepth()});const s={create:(n,o)=>this.$lm(n,o),detach:(n,o)=>{o.remove()},reattach:()=>{},destroy:(n,o)=>{var l;try{(l=n==null?void 0:n.destroy)==null||l.call(n)}catch{}o.remove()}};this.$h=new pa(s),t.getFlatModel().registerSplice(n=>this.$nm(n),()=>this.$mb(),()=>this.activeVersion),e.heightMode==="auto"&&!ki&&(ki=!0,console.warn("[OpenGrid] masterDetail.heightMode:'auto' 는 Spike-B(가변높이 VirtualScroll) 통과 전까지 미공개 기능입니다. 'fixed' 로 동작합니다(11_design_F2_v2.md §2.2/C12.2)."))}$cM(){var t;return((t=this.$a.getOptions())==null?void 0:t.masterDetail)??{}}get enabled(){return this.$cM().enabled===!0}get isActive(){return this.enabled&&this.$f.size>0}get activeVersion(){var t;const e=this.$cM(),s=(t=this.$a.getOptions())==null?void 0:t.rowHeight;return(e.enabled!==this.$kr||e.height!==this.$ks||e.detailRowCount!==this.$ku||s!==this.$kt)&&(this.$kr=e.enabled,this.$ks=e.height,this.$ku=e.detailRowCount,this.$kt=s,this.$ck++),this.$ck}$mb(){if(!this.enabled||this.$f.size===0)return!1;const t=this.$ck,e=this.$a.getFlatModel().dataStructureVersion;if(t===this.$jk&&e===this.$jl)return this.$jj;let s=!1;for(const i of this.$f.expandedRowIds)if(this.$a.getRowById(i)!==void 0){s=!0;break}return this.$jj=s,this.$jk=t,this.$jl=e,s}get maxDepth(){return this.$f.maxDepth}$dY(t){if(typeof t=="number"){const e=this.$a.getFlatModel().resolveFlatRow(t);return e.kind==="data"||e.kind==="tree"?e.rowId??null:null}return(t==null?void 0:t.id)??null}isExpandedId(t){return this.$f.isExpanded(t)}isRowExpanded(t){const e=this.$dY(t);return e!=null&&this.$f.isExpanded(e)}expandRow(t){if(!this.enabled)return;const e=this.$dY(t);if(e==null||this.$f.isExpanded(e))return;const s=this.$f.expand(e);if(this.$ck++,!s){this.$a.announce(this.$a.t("detail.depthLimitOpen",{max:this.$f.maxDepth}));return}this.$hE(e,"expanded")}collapseRow(t){const e=this.$dY(t);if(e==null||!this.$f.isExpanded(e))return;const s=this.$bS.get(e);s&&document.activeElement&&s.contains(document.activeElement)&&(this.$dD=e),this.$f.collapse(e),this.$ck++,this.$kc(e),this.$hE(e,"collapsed")}toggleRow(t){const e=this.$dY(t);e!=null&&(this.$f.isExpanded(e)?this.collapseRow(t):this.expandRow(t))}collapseAllDetails(){const t=this.$f.collapseAll();if(t.length!==0){this.$ck++;for(const e of t)this.$kc(e);this.$hb();for(const e of t)this.$a.emit("rowCollapse",{rowIndex:this.$a.getFlatModel().flatIndexOfRowId(e),rowId:e,row:this.$a.getRowById(e),host:null});this.$a.announce(this.$a.t("detail.collapsedAllAnnounce"))}}getDetailInstance(t){const e=this.$dY(t);if(e!=null)return this.$h.getInstance(e)}resyncPanelWidths(){this.isActive&&this.$hb()}getPanelHost(t){let e=this.$bS.get(t);return e||(e=document.createElement("div"),e.className="og-detail-host",e.style.cssText="width:100%;height:100%;box-sizing:border-box;overflow:auto;",this.$bS.set(t,e)),this.$h.getOrCreate(t,()=>e),this.$dD===t&&(this.$dD=null),e}$lm(t,e){const s=this.$cM(),i=this.$a.getRowById(t),n=this.$a.getDepth(),o={grid:this.$a.getGridInstance(),rowId:t,depth:n,collapse:()=>this.collapseRow({id:t}),refresh:()=>{var l,a;try{(a=(l=this.$h.getInstance(t))==null?void 0:l.refresh)==null||a.call(l)}catch{}}};if(typeof s.renderer=="function"){const l=s.renderer(i,e,o);return l instanceof HTMLElement&&l!==e&&e.appendChild(l),{destroy:()=>{}}}if(s.subgridOptions){if(n+1>this.$f.maxDepth)return this.$a.announce(this.$a.t("detail.depthLimitSubgrid",{max:this.$f.maxDepth})),{destroy:()=>{}};if(this.$a.createSubgrid)return this.$a.createSubgrid(e,s.subgridOptions,n+1)}return{destroy:()=>{}}}onBeforeTeardown(){for(const[t,e]of this.$bS)if(this.$h.isAttached(t)){if(this.isEditing(t)){document.body.appendChild(e);continue}this.$h.detach(t)}}isEditing(t){const e=this.$h.getInstance(t);return!!e&&typeof e.isEditing=="function"&&!!e.isEditing()}consumePendingFocusRestore(){const t=this.$dD;return this.$dD=null,t}$kc(t){const e=this.$cM();this.$h.remove(t,{cache:e.cache===!0}),e.cache!==!0&&this.$bS.delete(t)}$nm(t){var e;if(!this.isActive)return t;const s=this.$cM(),i=((e=this.$a.getOptions())==null?void 0:e.rowHeight)??32,n={expandedRowIds:this.$f.expandedRowIds,getRowId:o=>this.$a.getRowId(o),rowHeight:i,height:s.height??200};if(typeof s.detailRowCount=="number"){const o=s.detailRowCount;n.getSlotCount=()=>o}return ga(t,n)}$hE(t,e){this.$hb();const i=this.$a.getFlatModel().flatIndexOfRowId(t),n=e==="expanded"?this.$bS.get(t)??null:null,o={rowIndex:i,rowId:t,row:this.$a.getRowById(t),host:n};this.$a.emit(e==="expanded"?"rowExpand":"rowCollapse",o),this.$a.announce(this.$a.t(e==="expanded"?"detail.expandedAnnounce":"detail.collapsedAnnounce"))}$hb(){var t;const e=this.$a.getFlatModel().count();(t=this.$a.getVs())==null||t.setTotalRows(e),this.$a.submitRender(F.REPAINT_VISIBLE)}destroy(){this.$h.destroyAll(),this.$bS.clear()}}function va(r,t){return r==null||Number.isNaN(r)?"":t?t(r,{axis:"tooltip"}):String(r)}function Mi(r,t={}){const{categories:e,series:s}=r,i=["category",...s.map(h=>h.name)],n=e.map((h,c)=>[h,...s.map(u=>va(u.data[c]??null,t.numberFormat))]),l=s.map(h=>h.name).join(", ")||B("chart.tooltipEmpty");return{caption:t.title?B("chart.a11ySummary",{title:t.title,categories:e.length,series:l}):B("chart.a11ySummaryNoTitle",{categories:e.length,series:l}),colHeaders:i,rows:n}}const wa=.8,ya=50;function Si(r){if(r==null||r==="")return null;if(typeof r=="number")return Number.isFinite(r)?r:null;const t=Number(r);return Number.isFinite(t)?t:null}function Ai(r,t,e){if((r==null?void 0:r.type)==="number")return!0;if(r!=null&&r.type)return!1;let s=0,i=0;for(const n of t){if(s>=ya)break;const o=n[e];o==null||o===""||(s++,Si(o)!==null&&i++)}return s===0?!1:i/s>=wa}function ba(r){return typeof r=="string"?r:r.field}function _a(r,t){return typeof r=="string"?t:r.name??t}function xa(r,t){let e=null;for(const i of t)if(!Ai(i,r,i.field)){e=i;break}const s=t.filter(i=>i!==e&&Ai(i,r,i.field));return{categoryField:(e==null?void 0:e.field)??null,seriesCols:s}}function Ca(r,t,e){if(typeof e=="function")return e(r,t);if(!r.length)return 0;switch(e){case"sum":return k.sum(r).toNumber();case"avg":return k.avg(r).toNumber();case"min":return k.min(r).toNumber();case"max":return k.max(r).toNumber();case"count":return r.length;default:return k.sum(r).toNumber()}}function Ra(r,t){var e;switch(r.kind){case"all":case"columns":return{rows:t.getAllRows(),effectiveKind:r.kind,rangeFallback:!1};case"selection":return{rows:t.getSelectedRows(),effectiveKind:"selection",rangeFallback:!1};case"checked":return{rows:t.getCheckedRows(),effectiveKind:"checked",rangeFallback:!1};case"range":{const s=r.range??((e=t.getActiveRange)==null?void 0:e.call(t))??null;return!s||!t.getRangeRows?{rows:t.getSelectedRows(),effectiveKind:"selection",rangeFallback:!0}:{rows:t.getRangeRows(s),effectiveKind:"range",rangeFallback:!1}}}}function Ea(r,t,e){return r.kind==="range"&&t==="range"&&r.range&&e.getRangeColumns?e.getRangeColumns(r.range):e.getVisibleColumns()}function ka(r,t,e={}){const{rows:s,effectiveKind:i,rangeFallback:n}=Ra(r,t),o=Ea(r,i,t);let l=null,a;if(r.kind==="columns")l=e.category??r.category??null,a=e.series??r.series;else if(e.series)l=e.category??null,a=e.series;else{const m=xa(s,o);l=e.category??m.categoryField,a=m.seriesCols.map(b=>b.field)}const h=new Map(o.map(m=>[m.field,m])),c=l?s.map(m=>String(m[l]??"")):s.map((m,b)=>String(b+1)),u=a.map(m=>{const b=ba(m),y=h.get(b),R=_a(m,(y==null?void 0:y.header)??b),_=s.map(E=>Si(E[b])),S=typeof m=="string"?void 0:m.pattern,M=typeof m=="string"?void 0:m.color,C={name:R,data:_};return S&&(C.pattern=S),M&&(C.color=M),C}),d=s.length;let g=c,f=u,p,v=!1;if(e.aggregate&&c.length>0){const m=[],b=new Map;for(let y=0;y<c.length;y++){const R=c[y];b.has(R)?b.get(R).push(y):(b.set(R,[y]),m.push(R))}m.length<c.length&&(g=m,f=u.map(y=>({...y,data:m.map(R=>{const S=b.get(R).map(M=>y.data[M]).filter(M=>M!==null);return S.length?Ca(S,R,e.aggregate):null})})),p=typeof e.aggregate=="function"?"custom":e.aggregate,v=!0)}const w={categories:g,series:f,meta:{sourceKind:i,total:d,sampled:v,a11yTable:Mi({categories:g,series:f},{title:e.title,numberFormat:e.numberFormat})}};return p&&(w.meta.aggregatedOp=p),{model:w,rangeFallback:n}}function Ma(r){return r==="line"||r==="area"}function We(r){return r==null||Number.isNaN(r)?null:r}function Fi(r){let t=-1,e=-1,s=1/0,i=-1/0;for(let o=0;o<r.length;o++){const l=We(r[o]);l!=null&&(l<s&&(s=l,t=o),l>i&&(i=l,e=o))}const n=[];return t>=0&&n.push(t),e>=0&&n.push(e),n}function Sa(r,t){const e=r.length;if(t>=e||t<=2)return Array.from({length:e},(l,a)=>a);const s=l=>We(r[l])??0,i=[0],n=(e-2)/(t-2);let o=0;for(let l=0;l<t-2;l++){let a=0,h=0;const c=Math.floor((l+1)*n)+1;let u=Math.floor((l+2)*n)+1;u=Math.min(u,e);const d=u-c;for(let b=c;b<u;b++)a+=b,h+=s(b);d>0&&(a/=d,h/=d);const g=Math.floor(l*n)+1,f=Math.floor((l+1)*n)+1,p=o,v=s(o);let w=-1,m=g;for(let b=g;b<f&&b<e;b++){const y=Math.abs((p-a)*(s(b)-v)-(p-b)*(h-v))*.5;y>w&&(w=y,m=b)}i.push(m),o=m}return i.push(e-1),i}function Aa(r,t,e,s={}){var i;const n=r.categories.length;if(!Number.isFinite(t)||t<=0||n<=t)return{model:r,sampled:!1};let o,l;if(Ma(e)){const h=((i=r.series[0])==null?void 0:i.data)??new Array(n).fill(0),c=new Set([0,n-1]);for(const f of r.series)for(const p of Fi(f.data))c.add(p);const u=new Set(c),d=Sa(h,t);for(const f of d){if(u.size>=t)break;u.add(f)}let g=[...u].sort((f,p)=>f-p);if(g.length>t){const f=new Set([0,n-1]),p=r.series.map(w=>Fi(w.data));let v=!0;for(;v&&f.size<t;){v=!1;for(const w of p){if(f.size>=t)break;const m=w.find(b=>!f.has(b));m!==void 0&&(f.add(m),v=!0)}}g=[...f].sort((w,m)=>w-m).slice(0,t)}o=g.map(f=>r.categories[f]),l=r.series.map(f=>({...f,data:g.map(p=>f.data[p])}))}else{const h=t,c=n/h;o=[];const u=[];for(let d=0;d<h;d++){const g=Math.floor(d*c),f=Math.min(Math.floor((d+1)*c),n);if(g>=f)continue;u.push([g,f]);const p=r.categories[g],v=r.categories[f-1];o.push(f-g>1?`${p}…${v}`:p)}l=r.series.map(d=>({...d,data:u.map(([g,f])=>{let p=0,v=!1;for(let w=g;w<f;w++){const m=We(d.data[w]);m!=null&&(p+=m,v=!0)}return v?p:null})}))}return{model:{categories:o,series:l,meta:{...r.meta,sampled:!0,sampledFrom:n,sampledTo:o.length,a11yTable:Mi({categories:o,series:l},{title:s.title,numberFormat:s.numberFormat})}},sampled:!0}}const Ii=["#0072B2","#E69F00","#009E73","#CC79A7","#F0E442","#56B4E9","#D55E00","#999999"],Li=["solid","hatch","dot","cross"];function je(r){return Math.min(255,Math.max(0,r))}function fe(r){const t=r.trim(),e=t.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);if(e)return{r:je(+e[1]),g:je(+e[2]),b:je(+e[3])};const s=t.replace("#","");return/^[0-9a-f]{3}$/i.test(s)?{r:parseInt(s[0]+s[0],16),g:parseInt(s[1]+s[1],16),b:parseInt(s[2]+s[2],16)}:/^[0-9a-f]{6}$/i.test(s)?{r:parseInt(s.slice(0,2),16),g:parseInt(s.slice(2,4),16),b:parseInt(s.slice(4,6),16)}:null}function Ge(r){const t=r/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ti(r){return .2126*Ge(r.r)+.7152*Ge(r.g)+.0722*Ge(r.b)}function Oi(r,t){const e=fe(r),s=fe(t);if(!e||!s)return 1;const i=Ti(e),n=Ti(s),[o,l]=i>=n?[i,n]:[n,i];return(o+.05)/(l+.05)}function Fa(r,t={}){var e;const s=(t.palette&&t.palette.length?t.palette:Ii).slice();return!((e=t.palette)!=null&&e.length)&&t.primary&&fe(t.primary)&&(s.length<2||Oi(t.primary,s[1])>=3)&&(s[0]=t.primary),r.map((i,n)=>({color:i.color??s[n%s.length],pattern:i.pattern??Li[n%Li.length]}))}function Di(r,t){if(r===0)return 0;const e=Math.abs(r),s=Math.floor(Math.log10(e)),i=e/Math.pow(10,s);let n;return t?i<1.5?n=1:i<3?n=2:i<7?n=5:n=10:i<=1?n=1:i<=2?n=2:i<=5?n=5:n=10,n*Math.pow(10,s)}function Ue(r,t){const e=Math.max(0,-Math.floor(Math.log10(t))+6),s=Math.pow(10,e),i=Math.round(r*s)/s;return i===0?0:i}function Ni(r,t,e=6){let s=r,i=t;if(s>i&&([s,i]=[i,s]),s===i)if(s===0)s=-1,i=1;else{const d=Math.abs(s)*.5;s-=d,i+=d}const n=Math.max(2,e),o=Di(i-s,!1),l=Di(o/(n-1),!0),a=Ue(Math.floor(s/l)*l,l),h=Ue(Math.ceil(i/l)*l,l),c=[],u=Math.round((h-a)/l)+1;for(let d=0;d<u;d++)c.push(Ue(a+d*l,l));return{min:a,max:h,step:l,ticks:c}}function Ia(r,t,e){for(const s of r){const i=Math.min(s.x,s.x+s.w),n=Math.max(s.x,s.x+s.w),o=Math.min(s.y,s.y+s.h),l=Math.max(s.y,s.y+s.h);if(t>=i&&t<=n&&e>=o&&e<=l)return s}return null}function La(r,t,e){if(!r.length)return null;let s=-1,i=1/0;for(const l of r){const a=Math.abs(l.cx-t);a<i&&(i=a,s=l.categoryIndex)}let n=null,o=1/0;for(const l of r){if(l.categoryIndex!==s)continue;const a=Math.abs(l.cy-e);a<o&&(o=a,n=l)}return n}function zi(r,t,e,s){return r.length?s==="line"||s==="area"?La(r,t,e):Ia(r,t,e):null}const $i="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0;padding:0;margin:-1px;",Lt={top:26,right:14,bottom:34,left:52},Kt=3.5;let Ta=0;function Ke(r,t,e){return r==null||Number.isNaN(r)?"":t.numberFormat?t.numberFormat(r,{axis:e}):String(r)}class Bi{constructor(){this.id="builtin-canvas",this.$m=null,this.$U=null,this.$eh=null,this.$eQ=null,this.$dc=null,this.$ay=null,this.$n=null,this.$dd=480,this.$cC=300,this.$bp=[],this.$bR=new Set,this.$H={cat:0,series:0},this.$gP=null,this.$bw=t=>{if(this.$Y.tooltip===!1)return;const{x:e,y:s}=this.$jn(t),i=zi(this.$bp,e,s,this.$Y.type);i?this.$ky(i,e,s):this.$gv()},this.$jH=()=>this.$gv(),this.$jE=t=>{const{x:e,y:s}=this.$jn(t),i=zi(this.$bp,e,s,this.$Y.type);i&&this.$is(i)},this.$az=t=>{const e=this.$n;if(!e)return;const s=e.categories.length,i=e.series.length;let n=!0;switch(t.key){case"ArrowRight":this.$H.cat=Math.min(s-1,this.$H.cat+1);break;case"ArrowLeft":this.$H.cat=Math.max(0,this.$H.cat-1);break;case"ArrowDown":this.$H.series=Math.min(i-1,this.$H.series+1);break;case"ArrowUp":this.$H.series=Math.max(0,this.$H.series-1);break;case"Enter":case" ":{const o=this.$ih();o&&this.$is(o);break}default:n=!1}n&&(t.preventDefault(),this.$kZ())}}async init(t,e){this.$m=t,this.$Y=e,t.classList.add("og-chart"),getComputedStyle(t).position==="static"&&(t.style.position="relative");const s=document.createElement("canvas");s.className="og-chart-canvas",s.style.cssText="display:block;",s.setAttribute("role","img"),s.tabIndex=0,s.setAttribute("aria-label",e.title??B("chart.canvasDefault")),this.$U=s;const i=document.createElement("table");i.className="og-chart-a11y",i.style.cssText=$i;const n=`og-chart-a11y-${++Ta}`;i.id=n,s.setAttribute("aria-describedby",n),this.$eh=i;const o=document.createElement("div");o.className="og-chart-legend",o.style.cssText="display:flex;flex-wrap:wrap;gap:8px;margin-top:6px;",this.$eQ=o;const l=document.createElement("div");l.className="og-chart-tooltip",l.style.cssText="position:absolute;pointer-events:none;display:none;z-index:5;padding:4px 8px;font-size:12px;border-radius:4px;background:#333;color:#fff;white-space:nowrap;",this.$dc=l;const a=document.createElement("div");a.className="og-chart-live",a.setAttribute("aria-live","polite"),a.style.cssText=$i,this.$ay=a,t.appendChild(s),t.appendChild(i),t.appendChild(o),t.appendChild(l),t.appendChild(a),s.addEventListener("mousemove",this.$bw),s.addEventListener("mouseleave",this.$jH),s.addEventListener("click",this.$jE),s.addEventListener("keydown",this.$az)}render(t,e){var s;this.$n=t,this.$Y=e,this.$H.cat=t.categories.length?Math.min(Math.max(this.$H.cat,0),t.categories.length-1):0,this.$H.series=t.series.length?Math.min(Math.max(this.$H.series,0),t.series.length-1):0,this.$U&&this.$U.setAttribute("aria-label",((s=e.a11y)==null?void 0:s.caption)??e.title??B("chart.canvasDefault")),this.$mQ(t,e),this.$mS(t,e),this.$id(t,e),this.$aC(t,e),this.$gv()}resize(t,e){this.$dd=Math.max(80,Math.floor(t)),this.$cC=Math.max(60,Math.floor(e)),this.$n&&this.render(this.$n,this.$Y)}onPointClick(t){this.$gP=t}destroy(){var t,e,s,i,n,o;const l=this.$U;l&&(l.removeEventListener("mousemove",this.$bw),l.removeEventListener("mouseleave",this.$jH),l.removeEventListener("click",this.$jE),l.removeEventListener("keydown",this.$az)),(t=this.$eh)==null||t.remove(),(e=this.$U)==null||e.remove(),(s=this.$eQ)==null||s.remove(),(i=this.$dc)==null||i.remove(),(n=this.$ay)==null||n.remove(),(o=this.$m)==null||o.classList.remove("og-chart"),this.$m=this.$U=this.$eh=this.$eQ=this.$dc=this.$ay=null,this.$bp=[],this.$gP=null}getGeometry(){return this.$bp}$mQ(t,e){const s=this.$eh;if(!s)return;const i=t.meta.a11yTable;s.innerHTML="";const n=document.createElement("caption");n.textContent=i.caption,s.appendChild(n);const o=document.createElement("thead"),l=document.createElement("tr");for(const h of i.colHeaders){const c=document.createElement("th");c.scope="col",c.textContent=h,l.appendChild(c)}o.appendChild(l),s.appendChild(o);const a=document.createElement("tbody");for(const h of i.rows){const c=document.createElement("tr");h.forEach((u,d)=>{const g=document.createElement(d===0?"th":"td");d===0&&(g.scope="row"),g.textContent=u,c.appendChild(g)}),a.appendChild(c)}s.appendChild(a)}$mS(t,e){const s=this.$eQ;if(!s)return;if(e.legend===!1){s.style.display="none";return}s.style.display="flex";const i=this.$kI(t,e),n=Array.from(s.querySelectorAll("button.og-chart-legend-item"));if(n.length===t.series.length&&n.every((h,c)=>h.dataset.seriesName===t.series[c].name)){t.series.forEach((h,c)=>{const u=n[c],d=!this.$bR.has(c);this.$hy(u,t.series[c],i[c],d)});return}const l=document.activeElement,a=l instanceof HTMLButtonElement?n.indexOf(l):-1;if(s.innerHTML="",t.series.forEach((h,c)=>{const u=document.createElement("button");u.type="button",u.className="og-chart-legend-item",u.dataset.seriesName=h.name,u.style.cssText="display:inline-flex;align-items:center;gap:5px;min-height:24px;padding:2px 6px;font-size:12px;cursor:pointer;background:none;border:1px solid transparent;border-radius:4px;";const d=document.createElement("span");d.setAttribute("aria-hidden","true"),d.style.cssText="display:inline-block;width:12px;height:12px;border-radius:2px;";const g=document.createElement("span");u.appendChild(d),u.appendChild(g),this.$hy(u,h,i[c],!this.$bR.has(c)),u.addEventListener("click",()=>{const f=!this.$bR.has(c);f?this.$bR.add(c):this.$bR.delete(c),this.$hy(u,h,i[c],!f),this.$id(this.$n,this.$Y),this.$aC(this.$n,this.$Y)}),s.appendChild(u)}),a>=0){const h=s.querySelectorAll("button.og-chart-legend-item"),c=h[a]??h[h.length-1];c==null||c.focus()}}$hy(t,e,s,i){t.setAttribute("aria-pressed",String(i)),t.style.opacity=i?"1":"0.45";const n=t.querySelector("span[aria-hidden]");n&&(n.style.background=s.color);const o=t.querySelector("span:not([aria-hidden])");o&&(o.textContent=`${e.name} (${s.pattern})`)}$kI(t,e){var s,i;return Fa(t.series.map(n=>({color:n.color,pattern:n.pattern})),{palette:e.palette??((s=e.theme)==null?void 0:s.palette),primary:(i=e.theme)==null?void 0:i.primary})}$jP(){return{x:Lt.left,y:Lt.top,w:Math.max(1,this.$dd-Lt.left-Lt.right),h:Math.max(1,this.$cC-Lt.top-Lt.bottom)}}$kQ(t){let e=1/0,s=-1/0;return t.series.forEach((i,n)=>{if(!this.$bR.has(n))for(const o of i.data)o==null||Number.isNaN(o)||(o<e&&(e=o),o>s&&(s=o))}),(!Number.isFinite(e)||!Number.isFinite(s))&&(e=0,s=1),(this.$Y.type==="bar"||this.$Y.type==="bar-stacked"||this.$Y.type==="bar-grouped")&&(e=Math.min(0,e),s=Math.max(0,s)),{min:e,max:s}}$id(t,e){const s=[],i=this.$jP(),o=t.categories.length||1,{min:l,max:a}=this.$kQ(t),h=Ni(l,a,6),c=p=>{const v=(p-h.min)/(h.max-h.min||1);return i.y+i.h-v*i.h},u=c(0<h.min?h.min:0>h.max?h.max:0),d=i.w/o,g=e.type==="line"||e.type==="area",f=t.series.map((p,v)=>({s:p,si:v})).filter(({si:p})=>!this.$bR.has(p));if(g)for(const{s:p,si:v}of f)p.data.forEach((w,m)=>{const b=i.x+d*m+d/2,y=w==null?NaN:c(w);Number.isNaN(y)||s.push({seriesIndex:v,categoryIndex:m,x:b-Kt,y:y-Kt,w:Kt*2,h:Kt*2,cx:b,cy:y})});else{const p=f.length||1,v=d*.72,w=v/p;f.forEach(({s:m,si:b},y)=>{m.data.forEach((R,_)=>{if(R==null||Number.isNaN(R))return;const M=i.x+d*_+(d-v)/2+w*y,C=c(R),E=Math.min(C,u),x=Math.abs(u-C);s.push({seriesIndex:b,categoryIndex:_,x:M,y:E,w,h:x,cx:M+w/2,cy:E+x/2})})})}this.$bp=s}$aC(t,e){const s=this.$U;if(!s)return;const i=Na();s.width=Math.floor(this.$dd*i),s.height=Math.floor(this.$cC*i),s.style.width=`${this.$dd}px`,s.style.height=`${this.$cC}px`;const n=s.getContext?s.getContext("2d"):null;if(!n)return;n.setTransform(i,0,0,i,0,0),n.clearRect(0,0,this.$dd,this.$cC);const o=e.theme,l=this.$jP(),{min:a,max:h}=this.$kQ(t),c=Ni(a,h,6),u=p=>{const v=(p-c.min)/(c.max-c.min||1);return l.y+l.h-v*l.h};n.strokeStyle=(o==null?void 0:o.gridLine)||(o==null?void 0:o.border)||"#e0e0e0",n.fillStyle=(o==null?void 0:o.text)||"#212121",n.lineWidth=1,n.font=`${(o==null?void 0:o.fontSize)||12}px ${(o==null?void 0:o.fontFamily)||"sans-serif"}`,n.textAlign="right",n.textBaseline="middle";for(const p of c.ticks){const v=u(p);n.beginPath(),n.moveTo(l.x,v),n.lineTo(l.x+l.w,v),n.stroke(),n.fillText(Ke(p,e,"y"),l.x-6,v)}n.textAlign="center",n.textBaseline="top";const d=l.w/(t.categories.length||1);t.categories.forEach((p,v)=>{const w=l.x+d*v+d/2;n.fillText(String(p),w,l.y+l.h+6)});const g=this.$kI(t,e);if(e.type==="line"||e.type==="area"){const p=new Map;for(const v of this.$bp){let w=p.get(v.seriesIndex);w||(w=[],p.set(v.seriesIndex,w)),w.push(v)}for(const[v,w]of p){w.sort((m,b)=>m.categoryIndex-b.categoryIndex),n.strokeStyle=g[v].color,n.lineWidth=2,n.setLineDash(Oa(g[v].pattern)),n.beginPath(),w.forEach((m,b)=>b===0?n.moveTo(m.cx,m.cy):n.lineTo(m.cx,m.cy)),n.stroke(),n.setLineDash([]),n.fillStyle=g[v].color;for(const m of w)n.beginPath(),n.arc(m.cx,m.cy,Kt,0,Math.PI*2),n.fill()}}else for(const p of this.$bp)n.fillStyle=g[p.seriesIndex].color,n.fillRect(p.x,p.y,p.w,p.h),Da(n,p,g[p.seriesIndex].pattern)}$jn(t){var e;const s=(e=this.$U)==null?void 0:e.getBoundingClientRect();if(!s||s.width===0&&s.height===0)return{x:t.offsetX??0,y:t.offsetY??0};const i=s.width>0?this.$dd/s.width:1,n=s.height>0?this.$cC/s.height:1;return{x:(t.clientX-s.left)*i,y:(t.clientY-s.top)*n}}$ih(){return this.$bp.find(t=>t.categoryIndex===this.$H.cat&&t.seriesIndex===this.$H.series)??null}$kZ(){const t=this.$n;if(!t)return;const e=t.series[this.$H.series],s=t.categories[this.$H.cat],i=(e==null?void 0:e.data[this.$H.cat])??null,n=`${(e==null?void 0:e.name)??""}, ${s??""}: ${Ke(i,this.$Y,"tooltip")||B("chart.tooltipEmpty")}`;this.$ay&&(this.$ay.textContent=n);const o=this.$ih();o&&this.$ky(o,o.cx,o.cy)}$jQ(t){var e,s;const i=this.$n;return{seriesName:((e=i.series[t.seriesIndex])==null?void 0:e.name)??"",category:i.categories[t.categoryIndex]??"",value:((s=i.series[t.seriesIndex])==null?void 0:s.data[t.categoryIndex])??null,index:t.categoryIndex}}$is(t){var e;(e=this.$gP)==null||e.call(this,this.$jQ(t))}$ky(t,e,s){const i=this.$dc;if(!i||this.$Y.tooltip===!1)return;const n=this.$jQ(t);i.textContent=`${n.seriesName} · ${n.category}: ${Ke(n.value,this.$Y,"tooltip")}`,i.style.display="block",i.style.left=`${e+10}px`,i.style.top=`${s+10}px`}$gv(){this.$dc&&(this.$dc.style.display="none")}}function Oa(r){switch(r){case"hatch":return[6,3];case"dot":return[2,3];case"cross":return[8,3,2,3];default:return[]}}function Da(r,t,e){if(e==="solid"||!e)return;r.save(),r.beginPath(),r.rect(t.x,t.y,t.w,t.h),r.clip(),r.strokeStyle="rgba(255,255,255,0.55)",r.lineWidth=1;const s=5;if(e==="hatch"||e==="cross")for(let i=-t.h;i<t.w;i+=s)r.beginPath(),r.moveTo(t.x+i,t.y+t.h),r.lineTo(t.x+i+t.h,t.y),r.stroke();if(e==="cross")for(let i=0;i<t.w+t.h;i+=s)r.beginPath(),r.moveTo(t.x+i,t.y),r.lineTo(t.x+i-t.h,t.y+t.h),r.stroke();if(e==="dot"){r.fillStyle="rgba(255,255,255,0.6)";for(let i=t.y+s;i<t.y+t.h;i+=s)for(let n=t.x+s;n<t.x+t.w;n+=s)r.beginPath(),r.arc(n,i,1,0,Math.PI*2),r.fill()}r.restore()}function Na(){return typeof window<"u"&&window.devicePixelRatio?window.devicePixelRatio:1}const za=500,$a=50,Ba=100,qe={width:480,height:300};let Pa=0;class Va{constructor(t){this.$dq=new Map,this.$a=t}createChart(t){var e;const s=`chart-${++Pa}`,i=this.$a.getContainer(),n=this.$kz(t),{adapter:o,engineFallback:l}=this.$mV(t),{panel:a,host:h,badgeBox:c,backdrop:u}=this.$ln(t,i),d={id:s,config:t,adapter:o,panel:a,badgeBox:c,host:h,backdrop:u,model:null,spec:null,snapshot:n,liveHandler:null,debounceTimer:null,resizeObserver:null,resizeDebounceTimer:null,renderSize:{...qe},localEvents:new Map,destroyed:!1,instance:null};try{this.$dq.set(s,d);const{model:g,rangeFallback:f}=this.$iA(d);d.model=g,d.spec=this.$hP(t,g),d.renderSize=this.$na(t,h),o.init(h,d.spec),o.resize(d.renderSize.width,d.renderSize.height),o.render(g,d.spec),(e=o.onPointClick)==null||e.call(o,v=>this.$mF(d,v)),this.$ke(d,f,l),t.live!==!1&&this.$nq(d),this.$le(d);const p=this.$gF(d);return this.$lf(d),this.$M(d,"chartCreate",p),this.$a.emit("chartCreate",p),p}catch(g){try{this._destroy(d)}catch{}throw g}}$na(t,e){var s;const i=t.size??qe,n=e.clientWidth;return{width:((s=t.size)==null?void 0:s.width)??(n>0?n:i.width),height:i.height}}$le(t){if(typeof ResizeObserver>"u")return;const e=Ba,s=new ResizeObserver(()=>{t.destroyed||(clearTimeout(t.resizeDebounceTimer),t.resizeDebounceTimer=setTimeout(()=>{if(t.destroyed)return;const i=t.host.clientWidth;i>0&&i!==t.renderSize.width&&(t.renderSize={width:i,height:t.renderSize.height},t.adapter.resize(t.renderSize.width,t.renderSize.height))},e))});s.observe(t.host),t.resizeObserver=s}getCharts(){return[...this.$dq.values()].filter(t=>!t.destroyed).map(t=>this.$gF(t))}destroyCharts(){for(const t of[...this.$dq.values()])this._destroy(t)}$kz(t){var e,s;if(t.source.kind!=="range")return null;const i=t.source.range??((s=(e=this.$a).getActiveRange)==null?void 0:s.call(e))??null;if(!i)return null;const n=this.$a.getFlatModel(),o=this.$a.getVisibleColumns(),l=[];for(let h=i.startRow;h<=i.endRow;h++){const c=n.rowIdOfFlat(h);c!=null&&l.push(c)}const a=[];for(let h=i.startCol;h<=i.endCol;h++){const c=o[h];c&&a.push(c.field)}return{rowIds:l,fields:a}}$iA(t){var e;const s=t.config,i=((e=this.$a.getOptions())==null?void 0:e.chart)??{},n=s.numberFormat??i.numberFormat,o=this.$lN(t),l=ka(s.source,o,{category:s.category,series:s.series??(s.source.kind==="columns"?s.source.series:void 0),aggregate:s.aggregate,title:s.title,numberFormat:n}),a=s.maxPoints??i.maxPoints??za;return{model:Aa(l.model,a,s.type,{title:s.title,numberFormat:n}).model,rangeFallback:l.rangeFallback}}$lN(t){const e=t.snapshot;return{getAllRows:()=>this.$a.getAllRows(),getSelectedRows:()=>this.$a.getSelectedRows(),getCheckedRows:()=>this.$a.getCheckedRows(),getVisibleColumns:()=>this.$a.getVisibleColumns(),getActiveRange:this.$a.getActiveRange?()=>this.$a.getActiveRange():void 0,getRangeRows:e?()=>e.rowIds.map(s=>this.$a.getRowById(s)).filter(s=>!!s):void 0,getRangeColumns:e?()=>{const s=this.$a.getVisibleColumns(),i=new Set(e.fields),n=s.filter(o=>i.has(o.field));return n.length?n:s}:void 0}}$hP(t,e){var s;const i=((s=this.$a.getOptions())==null?void 0:s.chart)??{},n=this.$nk(),o={type:t.type,theme:n,a11y:e.meta.a11yTable,palette:t.palette??i.palette??n.palette};t.title!==void 0&&(o.title=t.title),t.legend!==void 0&&(o.legend=t.legend),t.tooltip!==void 0&&(o.tooltip=t.tooltip),t.axis!==void 0&&(o.axis=t.axis);const l=t.numberFormat??i.numberFormat;return l&&(o.numberFormat=l),o}$bA(t,e,s){return getComputedStyle(t).getPropertyValue(e).trim()||s}$nk(){var t;const e=this.$a.getContainer(),s=((t=this.$a.getOptions())==null?void 0:t.chart)??{},i=this.$bA(e,"--og-primary","#1976d2"),n=this.$bA(e,"--og-font-size","13px"),o=parseInt(n,10)||13;return{primary:i,border:this.$bA(e,"--og-border-color","#e0e0e0"),text:this.$bA(e,"--og-row-color","#212121"),bg:this.$bA(e,"--og-row-bg","#ffffff"),gridLine:this.$bA(e,"--og-border-color","#e0e0e0"),fontFamily:getComputedStyle(e).fontFamily||"sans-serif",fontSize:o,palette:(s.palette&&s.palette.length?s.palette:Ii).slice()}}$ln(t,e){var s,i;const n=t.placement??((i=(s=this.$a.getOptions())==null?void 0:s.chart)==null?void 0:i.placement)??"docked",o=t.size??qe,l=document.createElement("div");l.className="og-chart-panel",l.setAttribute("data-placement",n),l.setAttribute("role","group"),l.setAttribute("aria-label",t.title??this.$a.t("chart.defaultTitle"));const a=document.createElement("div");a.className="og-chart-badges",a.style.cssText="display:flex;flex-wrap:wrap;gap:6px;margin-bottom:6px;";const h=document.createElement("div");h.className="og-chart-host",h.style.cssText=`position:relative;width:${o.width}px;max-width:100%;`;let c=null;const u=this.$bA(e,"--og-row-bg","#ffffff"),d=this.$bA(e,"--og-border-color","#e0e0e0"),g=`box-sizing:border-box;padding:10px;background:${u};border:1px solid ${d};border-radius:6px;`;return n==="modal"?(c=document.createElement("div"),c.className="og-chart-backdrop",c.style.cssText="position:fixed;inset:0;background:rgba(0,0,0,0.4);z-index:1000;display:flex;align-items:center;justify-content:center;",l.style.cssText=g+"max-width:90vw;max-height:90vh;overflow:auto;box-shadow:0 8px 30px rgba(0,0,0,0.3);",c.appendChild(l),c.addEventListener("click",f=>{f.target===c&&this.$lz(l)}),document.body.appendChild(c)):n==="inline"?(l.style.cssText=g+"width:100%;",(t.mount??e).appendChild(l)):n==="floating"?(l.style.cssText=g+"position:absolute;top:12px;right:12px;z-index:20;box-shadow:0 4px 16px rgba(0,0,0,0.18);",e.appendChild(l)):(l.style.cssText=g+"width:100%;margin-top:8px;",e.appendChild(l)),l.appendChild(a),l.appendChild(h),{panel:l,host:h,badgeBox:a,backdrop:c}}$ke(t,e,s){var i;const n=t.badgeBox;n.innerHTML="";const o=t.model.meta,l=[];o.sampled&&o.sampledFrom&&l.push(this.$a.t("chart.badgeSampled",{to:(i=o.sampledTo)==null?void 0:i.toLocaleString(),from:o.sampledFrom.toLocaleString()})),o.aggregatedOp&&l.push(this.$a.t("chart.badgeAggregated",{op:o.aggregatedOp})),o.pieReducedToFirst&&l.push(this.$a.t("chart.badgePieFirstSeries")),o.negativesAbsInPie&&l.push(this.$a.t("chart.badgeNegativesAbs")),e&&l.push(this.$a.t("chart.badgeRangeFallback")),s&&l.push(this.$a.t("chart.badgeEngineFallback",{engine:s}));for(const a of l){const h=document.createElement("span");h.className="og-chart-badge",h.style.cssText="display:inline-block;padding:2px 8px;font-size:11px;border-radius:10px;background:#fff3cd;color:#8a6d3b;border:1px solid #ffe08a;",h.textContent=a,n.appendChild(h)}n.style.display=l.length?"flex":"none",l.length&&this.$a.announce(this.$a.t("chart.announcePrefix",{badges:l.join(", ")}))}$nq(t){var e;const i=(((e=this.$a.getOptions())==null?void 0:e.chart)??{}).debounceMs??$a,n=()=>{t.destroyed||(clearTimeout(t.debounceTimer),t.debounceTimer=setTimeout(()=>{t.destroyed||this.$fh(t)},i))};t.liveHandler=n,this.$a.on("dataChange",n),this.$a.on("formulaRecalc",n)}$fh(t){if(t.destroyed)return;const{model:e,rangeFallback:s}=this.$iA(t);t.model=e,t.spec=this.$hP(t.config,e),t.adapter.render(e,t.spec),this.$ke(t,s,null),this.$M(t,"chartRender",{id:t.id,model:e}),this.$a.emit("chartRender",{id:t.id,model:e})}$mV(t){var e,s;const i=t.engine??((s=(e=this.$a.getOptions())==null?void 0:e.chart)==null?void 0:s.defaultEngine)??"builtin";return i&&typeof i=="object"?{adapter:i,engineFallback:null}:i==="chartjs"||i==="echarts"?{adapter:new Bi,engineFallback:i}:{adapter:new Bi,engineFallback:null}}$mF(t,e){this.$M(t,"chartPointClick",{id:t.id,point:e}),this.$a.emit("chartPointClick",{id:t.id,point:e})}$gF(t){if(t.instance)return t.instance;const e={id:t.id,update:s=>{t.destroyed||(s&&(t.config={...t.config,...s}),s&&(s.source||s.category||s.series)&&(t.snapshot=this.$kz(t.config)),this.$fh(t))},refresh:()=>this.$fh(t),setType:s=>{t.destroyed||(t.config={...t.config,type:s},this.$fh(t))},destroy:()=>this._destroy(t),toBlob:s=>t.adapter.toBlob?t.adapter.toBlob(s):Promise.resolve(null),getModel:()=>t.model,on:(s,i)=>this.$eS(t,s,i)};return t.instance=e,e}$lf(t){var e;const s=((e=this.$a.getOptions())==null?void 0:e.chart)??{},i=this.$gF(t);typeof s.onChartCreate=="function"&&s.onChartCreate(i),typeof s.onChartRender=="function"&&this.$eS(t,"chartRender",s.onChartRender),typeof s.onChartPointClick=="function"&&this.$eS(t,"chartPointClick",s.onChartPointClick),typeof s.onChartDestroy=="function"&&this.$eS(t,"chartDestroy",s.onChartDestroy)}$eS(t,e,s){const i=t.localEvents.get(e)??[];i.push(s),t.localEvents.set(e,i)}$M(t,e,...s){for(const i of t.localEvents.get(e)??[])try{i(...s)}catch{}}$lz(t){for(const e of this.$dq.values())if(e.panel===t){this._destroy(e);return}}_destroy(t){var e;if(!t.destroyed){t.destroyed=!0,t.liveHandler&&(this.$a.off("dataChange",t.liveHandler),this.$a.off("formulaRecalc",t.liveHandler)),clearTimeout(t.debounceTimer),clearTimeout(t.resizeDebounceTimer);try{(e=t.resizeObserver)==null||e.disconnect()}catch{}try{t.adapter.destroy()}catch{}(t.backdrop??t.panel).remove(),this.$M(t,"chartDestroy",{id:t.id}),this.$a.emit("chartDestroy",{id:t.id}),t.localEvents.clear(),this.$dq.delete(t.id)}}}class Ha{constructor(t,e){this.$ba=new Map,this.$gr=new Map,this.$A=new Map,this.$fy=new Map,this._callPath=[],this.$m=t,this.$fz=(e==null?void 0:e.strict)??!0,this.$W=(e==null?void 0:e.maxDepth)??32}override(t,e,s={}){if(typeof e!="function")throw new TypeError(`OverrideKernel.override: fn for "${t}" must be a function`);if(!this.$ba.has(t)){const n=this.$m[t];if(typeof n!="function")throw new TypeError(`OverrideKernel.override: host["${t}"] is not a function`);this.$gr.set(t,Object.prototype.hasOwnProperty.call(this.$m,t)),this.$ba.set(t,n.bind(this.$m))}const i=this.$A.get(t)??[];return i.push({fn:e,opts:s}),this.$A.set(t,i),this.$m[t]=this.$ll(t),this.$m}$ll(t){var e;const s=this.$ba.get(t),i=this.$A.get(t)??[],n=i.reduce((c,u)=>(...d)=>u.fn(c,...d),s),o=((e=i[i.length-1])==null?void 0:e.opts)??{},l=o.reentrant===!0,a=o.onError==="fallback",h=this;return function(...c){if(!l&&h._callPath.indexOf(t)!==-1)return s(...c);if(h._callPath.length>=h.$W){if(h.$fz&&!a)throw new Error(`OverrideKernel: max override depth (${h.$W}) exceeded at "${t}"`);return s(...c)}h._callPath.push(t);try{return n(...c)}catch(u){if(a&&!h.$fz)return console.warn(`[og.override:${t}]`,u),s(...c);if(a&&h.$fz)return console.warn(`[og.override:${t}]`,u),s(...c);throw u}finally{h._callPath.pop()}}}strategy(t,e){if(typeof e!="function")throw new TypeError(`OverrideKernel.strategy: fn for "${t}" must be a function`);return this.$fy.set(t,e),this.$m}getStrategy(t,e){return this.$fy.get(t)??e}hasStrategy(t){return this.$fy.has(t)}restore(t){return this.$ba.has(t)?(this.$gr.get(t)?this.$m[t]=this.$ba.get(t):delete this.$m[t],this.$ba.delete(t),this.$gr.delete(t),this.$A.delete(t),this.$m):this.$m}restoreAll(){for(const t of[...this.$ba.keys()])this.restore(t);return this.$fy.clear(),this._callPath=[],this.$m}hasOverride(t){return this.$ba.has(t)}getOverrideNames(){return[...this.$ba.keys()]}}const Wa=()=>null;function qt(r){return r===void 0?Wa:typeof r=="function"?r:()=>r}const ja={request:r=>requestAnimationFrame(r),cancel:r=>cancelAnimationFrame(r)},Pi=it.full(0),Vi=Object.freeze([]),Ga=Object.freeze([]),Ua=Object.freeze({scrollLeft:0,width:0}),Ka=Object.freeze({skipScope:"body"}),qa=Object.freeze({editRow:null,editCol:null,focusRow:null});class Ya{constructor(t,e){var s;this.$bK=0,this.$cc=new bs,this.$je=null,this.$cA=null,this._depth=0,this.$aG=!1,this.$fZ=null,this.$jN=0,this.$fk=!1,this.$I=t,this.$jO=e.planner,this.$aC=e.paint,this.$iD=e.footer??null,this.$bE=e.sort??null,this.$e=qt(e.geometry),this.$t=qt(e.applier),this.$gs=e.headerLayout??null,this.$gt=e.headerWraps??null,this.$bY=e.overlay??null,this.$aa=e.window&&e.scroll&&e.shape&&e.body?{window:qt(e.window),scroll:qt(e.scroll),shape:e.shape,body:qt(e.body),pinned:e.pinnedColumns??null}:null,this.$bK=((s=this.$e())==null?void 0:s.version)??0,this.$r=e.sortList??null}get lastPlan(){return this.$je}get depth(){return this._depth}submit(t){if(!this.$aG){if(t.detail.sync&&t.detail.rows!==null&&this._depth===0&&this.$cc.pending){this.$cV(t);return}this.$cc.add(t),t.detail.sync?(this.$fN(),this.$cV()):this.$ch()}}flushNow(){this.$aG||!this.$cc.pending||(this.$fN(),this.$cV())}destroy(){this.$fN(),this.$aG=!0,this.$cc.clear()}$ch(){this.$cA===null&&(this.$cA=this.$I.request(()=>{if(this.$cA=null,!(this.$aG||!this.$cc.pending))try{this.$cV()}catch(t){console.error("[OpenGrid] render frame failed",t)}}))}$fN(){this.$cA!==null&&(this.$I.cancel(this.$cA),this.$cA=null)}$cV(t){if(this._depth>0){this.$fk=!0;return}this._depth++;try{let e=t;do{this.$fk=!1;const s=e??this.$cc.freeze();e=void 0;const i=this.$jO.plan(s,this.$am(),this.$mt(s.detail.rows));this.$je=i,this.$lE(i)}while(this.$fk&&this.$cc.pending)}finally{this._depth--,this.$fk=!1}}$mt(t){let e;if(t===null){const[n,o]=this.$aC.visibleRows();e={start:n,end:o+1}}else e=t;const s=this.$e(),i=this.$mu();return s===null||this.$t()===null?{rows:e,columns:i,columnWidths:Vi,geometryVersion:0,appliedGeometryVersion:0}:{rows:e,columns:i,columnWidths:s.widths(),geometryVersion:s.version,appliedGeometryVersion:this.$bK}}$mu(){var t;const e=this.$aa,s=e===null?null:e.window();if(e===null||s===null)return Pi;const i=e.pinned===null?Ga:e.pinned(),n=((t=e.scroll())==null?void 0:t.box)??Ua;return s.next(this.$im(),{box:n,pinned:i},e.shape())}$im(){var t;const e=this.$aa;return e===null?Pi:((t=e.body())==null?void 0:t.drawn.columns)??null}$am(){var t,e;const s=((e=(t=this.$aa)==null?void 0:t.body())==null?void 0:e.drawn.diffBlocked)??!0;return{rows:this.$fZ,columns:this.$im(),pinned:qa,focus:null,diffBlocked:s,coverWidths:Vi}}$lE(t){this.$lH(t),this.$lK(t),this.$lF(t),this.$lI(t),this.$lG(t),this.$lJ(t)}$lH(t){const e=this.$e(),s=this.$t();if(!t.geometry||e===null||s===null)return;const i=e.changesSince(this.$bK);this.$bK=i.version,!i.none&&(s.applyChange(i,t.rows==="rebuild"||t.rows==="clear"?Ka:void 0),this.$gs!==null&&(this.$gt===null||this.$gt())&&this.$gs())}$lJ(t){t.overlay&&t.rows==="none"&&this.$bY!==null&&this.$bY.repaint()}$lI(t){const e=this.$bE,s=this.$r;t.header==="sortIndicator"&&e!==null&&s!==null&&e.update(s())}$lF(t){var e,s;t.cols==="shift"&&t.rows!=="diff"&&((s=(e=this.$aa)==null?void 0:e.body())==null||s.update(t.next,"none","shift"))}$lK(t){const e=t.next.rows;if(t.rows==="none")return;const s=t.rows==="clear"||e==="clear"?"clear":e,i=++this.$jN;this.$fZ=null,s==="clear"?this.$aC.paintRows(0,-1):this.$aa===null?this.$aC.paintRows(s.start,s.end-1):t.rows==="diff"?this.$aC.paintRows(s.start,s.end-1,t.next.columns,"diff"):this.$aC.paintRows(s.start,s.end-1,t.next.columns),this.$jN===i&&(this.$fZ=s)}$lG(t){const e=this.$iD;e!==null&&(t.footer==="rebuild"?e.paint():t.footer==="values"&&e.updateValues())}}const Hi="og-sort-icon",Wi={asc:" ↑",desc:" ↓"},Xa={asc:"ascending",desc:"descending"};class Za{constructor(){this.$dj=[],this.$fb=null}bind(t,e,s){const i=this.$iW(t),n=t.classList.contains("og-sorted")?(i==null?void 0:i.textContent)===Wi.desc?"desc":"asc":null;this.$dj.push({th:t,field:e,sortable:s,dir:n})}update(t){var e;for(const s of this.$dj){const i=((e=t.find(n=>n.field===s.field))==null?void 0:e.dir)??null;i!==s.dir&&this.$aC(s,i)}}setPressed(t){if(this.$fb!==t){for(const e of this.$dj)e.field===this.$fb&&e.th.classList.remove("og-sorting"),e.field===t&&e.th.classList.add("og-sorting");this.$fb=t}}setBusy(t,e,s){for(const i of this.$dj)i.field===t&&(e?i.th.setAttribute("aria-busy","true"):i.th.removeAttribute("aria-busy"))}release(){this.$dj=[],this.$fb=null}$aC(t,e){const s=t.th;let i=this.$iW(s);if(e){if(s.classList.add("og-sorted"),!i){i=D("span",Hi);const n=s.firstElementChild;s.insertBefore(i,n?n.nextSibling:s.firstChild)}i.textContent=Wi[e]}else s.classList.remove("og-sorted"),i==null||i.remove();t.sortable&&s.setAttribute("aria-sort",e?Xa[e]:"none"),t.dir=e}$iW(t){for(let e=t.firstElementChild;e;e=e.nextElementSibling)if(e.classList.contains(Hi))return e;return null}}const Ja=Object.freeze({min:40,max:1/0});class Qa{constructor(t){this.$m=t}boundsOf(t){return Ja}commit(t,e){this.$m.commitWidth(t,e)}needsHeaderRemeasure(){return this.$m.hasWrappedHeader()}remeasureHeader(){this.$m.relayoutHeaderIfChanged()}}const ji=[{bit:z.All,when:"always",feature:null,rows:"rebuild",cols:"none",header:"rebuild",footer:"values",geometry:!0,overlay:!0,extra:"none",offHeader:"rebuild",offFooter:"values"},{bit:0,when:"explicitClear",feature:null,rows:"clear",cols:"none",header:"none",footer:"none",geometry:!1,overlay:!1,extra:"none",offHeader:"none",offFooter:"none"},{bit:0,when:"explicitRange",feature:null,rows:"rebuild",cols:"none",header:"none",footer:"none",geometry:!1,overlay:!0,extra:"none",offHeader:"none",offFooter:"none"},{bit:z.Columns,when:"always",feature:null,rows:"rebuild",cols:"none",header:"rebuild",footer:"rebuild",geometry:!0,overlay:!0,extra:"none",offHeader:"rebuild",offFooter:"rebuild"},{bit:z.Appearance,when:"always",feature:null,rows:"rebuild",cols:"none",header:"rebuild",footer:"rebuild",geometry:!0,overlay:!0,extra:"none",offHeader:"rebuild",offFooter:"rebuild"},{bit:z.Viewport,when:"always",feature:"columnWindow",rows:"viewportRows",cols:"shiftIfChanged",header:"none",footer:"none",geometry:!0,overlay:!0,extra:"none",offHeader:"none",offFooter:"none"},{bit:z.RowSet,when:"always",feature:null,rows:"rebuild",cols:"none",header:"none",footer:"values",geometry:!1,overlay:!0,extra:"none",offHeader:"none",offFooter:"values"},{bit:z.RowOrder,when:"always",feature:"sortIndicatorOnly",rows:"rebuild",cols:"none",header:"sortIndicator",footer:"none",geometry:!1,overlay:!0,extra:"none",offHeader:"rebuild",offFooter:"values"},{bit:z.SortIndicator,when:"always",feature:"sortIndicatorOnly",rows:"none",cols:"none",header:"sortIndicator",footer:"none",geometry:!1,overlay:!1,extra:"none",offHeader:"rebuild",offFooter:"none"},{bit:z.RowsScrolled,when:"rowsSame",feature:"scrollSkip",rows:"none",cols:"none",header:"none",footer:"none",geometry:!1,overlay:!1,extra:"none",offHeader:"none",offFooter:"none"},{bit:z.RowsScrolled,when:"rowsChanged",feature:"rowDiff",rows:"diffOrRebuild",cols:"none",header:"none",footer:"none",geometry:!1,overlay:!0,extra:"none",offHeader:"none",offFooter:"none"},{bit:z.ColsScrolled,when:"colsSame",feature:"scrollSkip",rows:"none",cols:"none",header:"none",footer:"none",geometry:!1,overlay:!1,extra:"none",offHeader:"none",offFooter:"none"},{bit:z.ColsScrolled,when:"colsChanged",feature:"columnWindow",rows:"none",cols:"shiftIfChanged",header:"none",footer:"none",geometry:!1,overlay:!0,extra:"none",offHeader:"none",offFooter:"none"},{bit:z.ColWidth,when:"always",feature:"geometryOnly",rows:"none",cols:"shiftIfChanged",header:"none",footer:"none",geometry:!0,overlay:!0,extra:"refill",offHeader:"none",offFooter:"none"},{bit:z.CellValue,when:"always",feature:"smallUpdates",rows:"cellsOrRebuild",cols:"none",header:"none",footer:"values",geometry:!1,overlay:!1,extra:"cells",offHeader:"none",offFooter:"values"},{bit:z.RowState,when:"always",feature:"smallUpdates",rows:"none",cols:"none",header:"none",footer:"none",geometry:!1,overlay:!1,extra:"rowState",offHeader:"none",offFooter:"none"},{bit:z.Focus,when:"always",feature:"smallUpdates",rows:"none",cols:"none",header:"none",footer:"none",geometry:!1,overlay:!1,extra:"focus",offHeader:"none",offFooter:"none"},{bit:z.Range,when:"always",feature:"smallUpdates",rows:"none",cols:"none",header:"none",footer:"none",geometry:!1,overlay:!0,extra:"none",offHeader:"none",offFooter:"none"}],Tt=r=>r!==null&&r!=="clear";function Ye(r){const t=r.drawn.rows,e=r.next.rows;return Tt(t)&&Tt(e)&&t.start===e.start&&t.end===e.end}function Xe(r){const t=r.drawn.columns;return t!==null&&t.equals(r.next.columns)}function Gi(r){const t=r.drawn.rows,e=r.next.rows;if(!r.f.rowDiff||r.drawn.diffBlocked||!Tt(t)||!Tt(e))return"rebuild";const s=t.end-t.start;if(s<=0)return"rebuild";const i=Math.max(0,Math.min(t.end,e.end)-Math.max(t.start,e.start));return i===0?"rebuild":Math.max(e.end-e.start-i,s-i)<s*r.ratio?"diff":"rebuild"}const th={always:()=>!0,rowsSame:Ye,rowsChanged:r=>!Ye(r),colsSame:Xe,colsChanged:r=>!Xe(r),explicitClear:r=>r.req.detail.rows==="clear",explicitRange:r=>Tt(r.req.detail.rows)},eh={none:()=>"none",rebuild:()=>"rebuild",clear:()=>"clear",diffOrRebuild:Gi,viewportRows:r=>Ye(r)?"none":Gi(r),cellsOrRebuild:r=>r.req.detail.cells.length===0?"rebuild":"none"},sh={none:()=>{},refill:r=>{r.refill=ah(r.drawn,r.next)},cells:r=>{r.cells=r.req.detail.cells},rowState:r=>{r.stateRows=hh(r.drawn)},focus:r=>{const t=r.drawn.focus,e=r.req.detail.focusTo;(e!==null||t!==null)&&(r.focus=Object.freeze({from:t,to:e}))}},Ui={none:0,diff:1,rebuild:2,clear:3},Ki={none:0,sortIndicator:1,rebuild:2},Ze={none:0,values:1,rebuild:2},ih=["none","diff","rebuild","clear"],nh=["none","sortIndicator","rebuild"],rh=["none","values","rebuild"],ut=Object.freeze([]),Je=Object.freeze([]),oh=Object.freeze({sortIndicatorOnly:!1,footerGating:!1,scrollSkip:!1,geometryOnly:!1,columnWindow:!1,rowDiff:!1,smallUpdates:!1});class lh{constructor(t){const e=t==null?void 0:t.diffMaxRatio;this.$dV=e!==void 0&&Number.isFinite(e)&&e>0?e:.5,this.$iC=Object.freeze({...oh,...t==null?void 0:t.features})}plan(t,e,s){const i=t.changes;if(i===0)return qi("none","none","none","none",!1,ut,ut,null,Je,!1,s);const n={req:t,drawn:e,next:s,f:this.$iC,ratio:this.$dV,rows:0,shift:!1,header:0,footer:0,geometry:!1,overlay:!1,refill:ut,stateRows:ut,focus:null,cells:Je},o=i===z.All;for(let u=0;u<ji.length;u++){const d=ji[u];if(!(d.bit===0?!0:d.bit===z.All?o:!o&&(i&d.bit)!==0)||!th[d.when](n))continue;if(n.geometry=n.geometry||d.geometry,d.feature!==null&&!n.f[d.feature]){n.rows=Math.max(n.rows,Ui.rebuild),n.header=Math.max(n.header,Ki[d.offHeader]),n.footer=Math.max(n.footer,Ze[d.offFooter]),n.overlay=!0;continue}let f=eh[d.rows](n);d.cols==="shiftIfChanged"&&!Xe(n)&&(e.columns!==null&&n.f.columnWindow?n.shift=!0:f="rebuild"),n.rows=Math.max(n.rows,Ui[f]),n.header=Math.max(n.header,Ki[d.header]),n.footer=Math.max(n.footer,Ze[d.footer]),n.overlay=n.overlay||d.overlay,sh[d.extra](n)}const l=ih[n.rows];let a=n.footer;!n.f.footerGating&&l!=="none"&&(a=Math.max(a,Ze.values));const h=l==="rebuild"||l==="clear",c=n.refill;return qi(l,!h&&n.shift?"shift":"none",nh[n.header],rh[a],n.geometry&&s.geometryVersion!==s.appliedGeometryVersion,h?ut:c,h?ut:n.stateRows,h?null:n.focus,h?Je:n.cells,n.overlay,s)}}function ah(r,t){const e=r.coverWidths,s=t.columnWidths,i=t.columns.segments,n=[];for(let o=0;o<i.length;o++){const l=i[o];for(let a=l.from;a<=l.to;a++){const h=e[a];h!==void 0&&s[a]>h&&n.push(a)}}return n.length===0?ut:Object.freeze(n)}function hh(r){const t=r.rows;if(!Tt(t)||t.end<=t.start)return ut;const e=new Array(t.end-t.start);for(let s=0;s<e.length;s++)e[s]=t.start+s;return Object.freeze(e)}function qi(r,t,e,s,i,n,o,l,a,h,c){const u=r==="none"&&t==="none"&&e==="none"&&s==="none"&&!i&&!h&&n.length===0&&o.length===0&&l===null&&a.length===0;return Object.freeze({rows:r,cols:t,header:e,footer:s,geometry:i,refillColumns:n,rowStateRows:o,focus:l,cells:a,overlay:h,next:c,empty:u})}const Qe="_ogRowId";class xt{static compose(t,e,s,i){const n=xt.buildCoreServices(t,e,s),o=xt.buildFormula(t,n),l=xt.buildManagers(t,n,o,i),a=xt.buildOverrideKernel(t,l);return{mounted:xt.mount(t,a)}}static buildCoreServices(t,e,s){const i=typeof e=="string"?document.querySelector(e):e;if(!i)throw new Error(`OpenGrid: container not found: ${e}`);if(t._container=i,t._options={height:"100%",width:"100%",rowHeight:32,headerHeight:34,footerHeight:30,autoHeight:!1,fillWidth:!1,defaultColumnWidth:100,virtualColumns:!0,editable:!1,editMode:"dblclick",history:!0,historySize:100,selection:"single",clipboard:!0,sortable:!0,multiSort:!0,filterable:!0,defaultSort:[],frozenColumns:0,frozenRows:0,rowNumber:!1,stateColumn:!1,checkColumn:!1,draggable:!1,crossGrid:!1,crossGridMapping:"auto",mergeCells:!1,groupBy:[],summary:void 0,treeMode:"auto",treeId:"id",treeParentId:"parentId",expandOnLoad:!1,pagination:!1,pageSize:50,footer:void 0,footerPosition:"bottom",theme:"default",skin:"default",cssVars:{},ariaLabel:"OPEN_GRID 데이터 그리드",...s},t._data=new Ho(Qe),t._flatModel=new Zo({getDataLayer:()=>t._data,rowIdField:Qe}),t._rowMgr=new Jo(t._data),t._colLayout=new fs(t._options.columns,t._options.frozenColumns),s.locale||s.messages){const n=st.child();s.messages&&n.applyOverrides(s.messages),s.locale&&(n.setActive(s.locale),t._container.setAttribute("lang",n.meta().intlLocale)),t._locales=n}else t._locales=null;return t._sortIndicator=new Za,t._scheduler=new Ya(ja,{planner:new lh({features:{footerGating:!0,sortIndicatorOnly:!0,scrollSkip:!0,geometryOnly:!0,columnWindow:!0,rowDiff:!0}}),paint:{paintRows:(n,o,l,a)=>t._doRender(n,o,l,a),visibleRows:()=>t._visRange()},sort:t._sortIndicator,sortList:()=>t._sfMgr.sortList,geometry:()=>{var n;return((n=t._render)==null?void 0:n.geometry)??null},applier:()=>{var n;return((n=t._renderer)==null?void 0:n.applier)??null},headerLayout:()=>{var n;return(n=t._render)==null?void 0:n.relayoutHeaderIfChanged()},headerWraps:()=>{var n;return((n=t._render)==null?void 0:n.hasWrappedHeader())??!1},overlay:{repaint:()=>t._rangeMgr.repaint()},window:()=>{var n;return((n=t._render)==null?void 0:n.windowPolicy)??null},scroll:()=>{var n;return((n=t._render)==null?void 0:n.scroll)??null},shape:()=>t._render.shape(),pinnedColumns:()=>t._editMgr.pinnedColumns(),body:()=>{var n;return((n=t._renderer)==null?void 0:n.bodyView)??null},footer:{paint:()=>t._footerMgr.paint(),updateValues:()=>t._footerMgr.updateValues()}}),{_phase:"core"}}static buildFormula(t,e){var s,i;return t._formula=new el({getData:()=>t._data,getColLayout:()=>t._colLayout,getFlatModel:()=>t._flatModel,getRecalc:()=>t._recalc,getDirtySeeds:()=>t._formulaDirtySeeds,getOptions:()=>t._options,emit:(n,o)=>{t.emit(n,o)},announce:n=>t._announce(n),t:(n,o)=>t.t(n,o),submitRender:n=>t._scheduler.submit(n)}),t._recalc=new mi({accessor:t._formula.buildAccessor(),setComputedValue:(n,o,l)=>t._data.setComputedValueByRowId(n,o,l),onFormulaError:(n,o,l)=>t._formula.handleFormulaError(n,o,l),refMode:((s=t._options.formula)==null?void 0:s.refMode)??"stable",divisionPrecision:((i=t._options.formula)==null?void 0:i.divisionPrecision)??30}),{_phase:"formula"}}static buildManagers(t,e,s,i){return t._editMgr=new Ml({revealColumn:n=>{var o;return(o=t._render)==null?void 0:o.revealColumn(n)},getBodyPin:()=>{var n;return((n=t._renderer)==null?void 0:n.bodyView)??null},data:t._data,colLayout:t._colLayout,getRenderer:()=>t._renderer,getContainer:()=>t._container,getOptions:()=>t._options,emit:(n,...o)=>t.emit(n,...o),submitRender:n=>t._scheduler.submit(n),announce:n=>t._announce(n),t:(n,o)=>t.t(n,o),writeCell:(n,o,l)=>t.writeCell(n,o,l),scrollToRow:n=>{var o;return(o=t._vs)==null?void 0:o.scrollToRow(n)},getVisibleLeaves:()=>t._colLayout.visibleLeaves,hasCellFormula:(n,o)=>t.hasCellFormula(n,o),getCellFormula:(n,o)=>t.getCellFormula(n,o),setCellFormula:(n,o,l)=>t.setCellFormula(n,o,l),clearCellFormula:(n,o)=>t.clearCellFormula(n,o)}),t._exportMgr=new Il({getData:()=>t._data.getData(),getColLayout:()=>t._colLayout,getColWidths:()=>t._colWidths,getOptions:()=>t._options,getContainer:()=>t._container,getMaskEnabled:n=>t.getMaskEnabled(n),getWsManager:()=>t._wsManager,getStrategy:(n,o)=>t._ovk.getStrategy(n,o),t:(n,o)=>t.t(n,o),getMeta:()=>(t._locales??st).meta()}),t._footerMgr=new $l({getData:()=>t._data.getData(),getColLayout:()=>t._colLayout,getColWidths:()=>t._colWidths,getGeometry:()=>t._render.currentGeometry(),getOptions:()=>t._options,getContainer:()=>t._container,getStrategy:(n,o)=>t._ovk.getStrategy(n,o)}),t._kbdMgr=new Pl({getEditMgr:()=>t._editMgr,getRowMgr:()=>t._rowMgr,getData:()=>t._data,getColLayout:()=>t._colLayout,getOptions:()=>t._options,setFocusCell:(n,o)=>t._setFocusCell(n,o),handleRowDrop:(n,o)=>t._handleRowDrop(n,o),submitRender:n=>t._scheduler.submit(n),announce:n=>t._announce(n),t:(n,o)=>t.t(n,o),emit:(n,...o)=>t.emit(n,...o),visRange:()=>t._visRange(),handleCellKeyEvt:(n,o)=>t._handleCellKeyEvt(n,o),writeCells:n=>t.writeCells(n),getRangeHooks:()=>t._rangeMgr}),t._sfMgr=new Vl({sortIndicator:t._sortIndicator,getData:()=>t._data,getColLayout:()=>t._colLayout,getFindFilter:()=>t._findMgr.findFilter,getVs:()=>t._vs,getPagination:()=>t._pagination,getOptions:()=>t._options,renderHeader:()=>t._renderHeader(),submitRender:n=>t._scheduler.submit(n),announce:n=>t._announce(n),t:(n,o)=>t.t(n,o),emit:(n,...o)=>t.emit(n,...o),onReproject:()=>t._rangeMgr.reproject()}),t._findMgr=new Hl({getColLayout:()=>t._colLayout,getData:()=>t._data,getFilters:()=>t._sfMgr.filters,getVs:()=>t._vs,getPagination:()=>t._pagination,submitRender:n=>t._scheduler.submit(n),t:(n,o)=>t.t(n,o)}),t._cellEvt=new Wl({getData:()=>t._data,getColLayout:()=>t._colLayout,getOptions:()=>t._options,getEditMgr:()=>t._editMgr,getRowMgr:()=>t._rowMgr,emit:(n,...o)=>t.emit(n,...o),writeCell:(n,o,l)=>t.writeCell(n,o,l),submitRender:n=>t._scheduler.submit(n),getContainer:()=>t._container,onCellsClick:(n,o,l)=>t._rangeMgr.handleClick(n,o,l),rangeMouseDown:(n,o,l)=>t._rangeMgr.handleCellMouseDown(n,o,l),rangeMouseMove:(n,o,l)=>t._rangeMgr.handleCellMouseMove(n,o,l),rangeMouseUp:(n,o,l)=>t._rangeMgr.handleCellMouseUp(n,o,l)}),t._rangeMgr=new ra({rangeRect:n=>{var o;return((o=t._render)==null?void 0:o.rangeRect(n))??null},getOptions:()=>t._options,getData:()=>t._data,getColLayout:()=>t._colLayout,getFlatModel:()=>t._flatModel,getRenderer:()=>t._renderer,getEditMgr:()=>t._editMgr,setFocusCell:(n,o)=>t._setFocusCell(n,o),writeCells:n=>t.writeCells(n),getDisplayValue:(n,o)=>t.getDisplayValue(n,o),emit:(n,...o)=>t.emit(n,...o),submitRender:n=>t._scheduler.submit(n),announce:n=>t._announce(n),t:(n,o)=>t.t(n,o),hasCellFormula:(n,o)=>t._recalc.hasCellFormula(n,o),offsetFormula:(n,o,l,a)=>t._recalc.offsetFormula(n,o,l,a),setCellFormulaByRowId:(n,o,l)=>t._formula.setCellFormulaByRowId(n,o,l)}),t._grpMgr=new oa({getData:()=>t._data.getData(),getDataLayer:()=>t._data,getOptions:()=>t._options,getVs:()=>t._vs,submitRender:n=>t._scheduler.submit(n),getStrategy:(n,o)=>t._ovk.getStrategy(n,o),setFlatBacking:n=>t._flatModel.setBacking(n),getFlatCount:()=>t._flatModel.count()}),t._detailMgr=new ma({getOptions:()=>t._options,getFlatModel:()=>t._flatModel,getVs:()=>t._vs,getRowId:n=>n[Qe],getRowById:n=>t._data.getRowById(n),submitRender:n=>t._scheduler.submit(n),emit:(n,o)=>t.emit(n,o),announce:n=>t._announce(n),t:(n,o)=>t.t(n,o),getDepth:()=>t._options._detailDepth??0,getGridInstance:()=>t,createSubgrid:(n,o,l)=>i.createSubgrid(n,o,l)}),t._chartMgr=new Va({getContainer:()=>t._container,getOptions:()=>t._options,getAllRows:()=>t._data.getData(),getSelectedRows:()=>t._rowMgr.getSelections(),getCheckedRows:()=>t._rowMgr.getChecked().map(n=>n.row),getVisibleColumns:()=>t._colLayout.visibleLeaves.map(n=>({field:n.field,header:n.header,type:n.type})),getFlatModel:()=>t._flatModel,getRowById:n=>t._data.getRowById(n),getActiveRange:()=>t._rangeMgr.getActiveRange(),on:(n,o)=>{t.on(n,o)},off:(n,o)=>{t.off(n,o)},emit:(n,...o)=>t.emit(n,...o),announce:n=>t._announce(n),t:(n,o)=>t.t(n,o)}),{_phase:"managers"}}static buildOverrideKernel(t,e){if(t._ovk=new Ha(t,{strict:t._options.overrideStrict??!0}),t._data.setStrategyResolver((s,i)=>t._ovk.getStrategy(s,i)),t._ovk==null)throw new Error("[OpenGrid] 초기화 순서 위반: OverrideKernel(_ovk)은 _mount() 이전에 생성돼야 합니다 — 매니저 strategy 슬롯(footer/group 등)이 초기 렌더에서 _ovk.getStrategy 를 참조합니다.");return{_phase:"ovk"}}static mount(t,e){var s;if(t._mount(),t._renderer&&t._footerMgr.setFollower(t._renderer.follower),(s=t._renderer)==null||s.onEndGutter(i=>{var n;t._footerMgr.setEndGutter(i),(n=t._render)==null||n.syncViewportWidth()}),t._renderer&&t._render){const i=t._render;t._footerMgr.setApplier(t._renderer.applier),t._renderer.connectResize({widths:{setWidth:(n,o)=>i.setUserWidth(n,o)},scheduler:t._scheduler,sink:new Qa({commitWidth:(n,o)=>{var l;return(l=t._renderer)==null?void 0:l.commitColumnResize(n,o)},hasWrappedHeader:()=>i.hasWrappedHeader(),relayoutHeaderIfChanged:()=>i.relayoutHeaderIfChanged()}),geometry:i.geometry})}return{_phase:"mounted"}}}class ch{constructor(t){this.$di=0,this.$fK=!1,this.$b=t}commit(t){var e,s,i,n,o;if(t.coalescable&&this.$di>0){this.$fK=!0;return}const l=this.$b.getData();t.totals==="count"?((e=this.$b.getVs())==null||e.setTotalRows(this.$b.getFlatModel().count()),(s=this.$b.getPagination())==null||s.setTotalRows(l.rowCount)):t.totals==="zero"&&((i=this.$b.getVs())==null||i.setTotalRows(0),(n=this.$b.getPagination())==null||n.setTotalRows(0)),(o=t.preRender)==null||o.call(t),t.flushFormula&&this.$b.flushFormula();const a=()=>{t.renderMode==="sync-window"?this.$b.submitRender(F.REPAINT_VISIBLE):t.renderMode==="full"&&this.$b.submitRender(F.REPAINT_CLEAR)},h=()=>{this.$b.emit("dataChange",t.emitPayload())};t.emitBeforeRender?(h(),a()):(a(),h())}setData(t){var e;const s=this.$b.getTrigMgr(),i=s.mkCtx("setData",[t]);if(!s.exec("before:setData",i))return;this.$b.getRowMgr().reset();const n=this.$b.getData();n.setData(t),this.$b.resetFormulaState(),this.$b.applyFilters();const o=this.$b.getGrpMgr();o.isTreeMode?o.rebuildTree():o.isGroupMode?o.rebuildGroups():(e=this.$b.getVs())==null||e.setTotalRows(this.$b.getFlatModel().count());const l=this.$b.getContainer();l.setAttribute("aria-rowcount",String(n.rowCount)),l.setAttribute("aria-colcount",String(this.$b.getColLayout().visibleLeaves.length)),this.$b.announce(this.$b.t("data.loadedAnnounce",{count:n.rowCount})),this.commit({renderMode:"async-vs",emitPayload:()=>n.getData()}),i.result=t.length,s.exec("after:setData",i)}insertRow(t,e="last"){const s=this.$b.getTrigMgr(),i=s.mkCtx("insertRow",[t,e]);if(!s.exec("before:insertRow",i))return;const n=this.$b.getData(),o=e==="before"?0:e==="after"?n.rowCount:e;n.addRow(t,o);const l=n.rowCount;this.commit({totals:"count",renderMode:"sync-window",emitPayload:()=>n.getData()}),i.result={rowCount:l,item:t},s.exec("after:insertRow",i)}pushRow(t){const e=Array.isArray(t)?t:[t],s=this.$b.getData();e.forEach(i=>s.addRow(i,"last")),this.commit({totals:"count",renderMode:"sync-window",emitPayload:()=>s.getData()})}deleteRow(t){const e=this.$b.getTrigMgr(),s=this.$b.getData(),i=e.mkCtx("deleteRow",[t]),n=Array.isArray(t)?[...t]:[t];if(i.extra={rows:n.map(h=>s.getRowByIndex(h))},!e.exec("before:deleteRow",i))return;const o=n.sort((h,c)=>c-h),l=o.map(h=>this.$b.getRowIdAt(h)).filter(h=>h!=null);o.forEach(h=>s.removeRow(h));const a=s.rowCount;this.commit({totals:"count",renderMode:"sync-window",preRender:()=>this.$b.invalidateRemovedRows(l),emitPayload:()=>s.getData()}),i.result={deleted:o.length,rowCount:a},e.exec("after:deleteRow",i)}writeCell(t,e,s){const i=this.$b.getData(),n=i.getCellValue(t,e),o=this.$b.getTrigMgr(),l=o.mkCtx("writeCell",[t,e,s]);if(l.extra={oldValue:n,rowIndex:t,field:e},!o.exec("before:writeCell",l))return;i.updateCell(t,e,s);const a=i.getRowByIndex(t),h=this.$b.getColLayout(),c=h.getColumnByField(e),u=h.getColumnIndex(e),d={type:"editEnd",rowIndex:t,columnIndex:u,field:e,oldValue:n,newValue:s,row:a,column:c};this.$b.emit("editEnd",d),this.$b.seedFormulaDirty(t,e),this.commit({renderMode:"sync-window",flushFormula:!0,emitBeforeRender:!0,emitPayload:()=>i.getData(),coalescable:!0}),l.result={rowIndex:t,field:e,oldValue:n,newValue:s},o.exec("after:writeCell",l)}beginBatch(){this.$di++}endBatch(){this.$di!==0&&(this.$di--,this.$di===0&&this.$fK&&(this.$fK=!1,this.commit({renderMode:"sync-window",flushFormula:!0,emitBeforeRender:!0,emitPayload:()=>this.$b.getData().getData()})))}writeCells(t){this.beginBatch();let e=0;const s=this.$b.getFlatModel();for(const i of t){if(s.resolveFlatRow(i.rowIndex).kind!=="data"){e++;continue}this.writeCell(i.rowIndex,i.field,i.value)}return this.endBatch(),e>0&&(this.$b.announce(this.$b.t("data.skippedCellsAnnounce",{count:e})),this.$b.emit("writeCellsSkip",{skipped:e,total:t.length})),e}}const ge="";function Yi(r){const t=Object.entries(r).filter(([,e])=>e!==ge).map(([e,s])=>` ${JSON.stringify(e)}: src[${JSON.stringify(s)}],`);return B("crossGrid.scriptComment")+`
|
|
75
|
+
function mapRow(src) {
|
|
76
|
+
return {
|
|
77
|
+
`+t.join(`
|
|
78
|
+
`)+(t.length?`
|
|
79
|
+
`:"")+` };
|
|
80
|
+
}`}function dh(r){return t=>{const e={};for(const[s,i]of Object.entries(r))i!==ge&&(e[s]=t[i]);return e}}function uh(r,t){if(r.length!==t.length)return!1;const e=new Set(t);return r.every(s=>e.has(s))}function fh(r,t){return new Promise(e=>{const s=new Set(r.map(_=>_.field)),i={};for(const _ of t)i[_.field]=s.has(_.field)?_.field:ge;const n=document.createElement("div");n.className="og-mapper-overlay",n.setAttribute("role","dialog"),n.setAttribute("aria-modal","true"),n.setAttribute("aria-label",B("crossGrid.overlayAria")),n.style.cssText="position:fixed;inset:0;z-index:100000;background:rgba(0,0,0,0.45);display:flex;align-items:center;justify-content:center;font-family:var(--og-font-family,-apple-system,sans-serif);";const o=document.createElement("div");o.style.cssText="background:#fff;border-radius:10px;box-shadow:0 12px 40px rgba(0,0,0,0.3);width:min(620px,92vw);max-height:88vh;overflow:auto;color:#222;",n.appendChild(o);const l=document.createElement("div");l.style.cssText="padding:18px 20px 8px;",l.innerHTML='<div style="font-size:16px;font-weight:700;">'+B("crossGrid.title")+'</div><div style="font-size:12.5px;color:#666;margin-top:4px;line-height:1.5;">'+B("crossGrid.desc1")+B("crossGrid.desc2")+"</div>",o.appendChild(l);const a=document.createElement("div");a.style.cssText="padding:6px 20px;";const h=`<option value="">${B("crossGrid.emptyOption")}</option>`+r.map(_=>`<option value="${Yt(_.field)}">${Yt(_.header)} <${Yt(_.field)}></option>`).join("");for(const _ of t){const S=document.createElement("div");S.style.cssText="display:flex;align-items:center;gap:10px;padding:7px 0;border-bottom:1px solid #f0f0f0;";const M=document.createElement("div");M.style.cssText="flex:1;font-size:13px;min-width:0;",M.innerHTML=`<span style="font-weight:600;">${Yt(_.header)}</span><span style="color:#999;font-size:11.5px;"> <${Yt(_.field)}></span>`;const C=document.createElement("span");C.textContent="←",C.style.cssText="color:#888;flex-shrink:0;";const E=document.createElement("select");E.style.cssText="flex:1;min-width:0;padding:6px 8px;border:1px solid #ccc;border-radius:6px;font-size:13px;background:#fff;",E.innerHTML=h,E.value=i[_.field]??ge,E.addEventListener("change",()=>{i[_.field]=E.value,p()}),S.append(M,C,E),a.appendChild(S)}o.appendChild(a);const c=document.createElement("div");c.style.cssText="padding:10px 20px 4px;";const u=document.createElement("div");u.style.cssText="display:flex;align-items:center;justify-content:space-between;margin-bottom:6px;",u.innerHTML='<span style="font-size:12.5px;font-weight:600;color:#444;">'+B("crossGrid.scriptTitle")+"</span>";const d=document.createElement("button");d.type="button",d.textContent=B("crossGrid.copy"),d.style.cssText="font-size:12px;padding:4px 10px;border:1px solid #ccc;border-radius:6px;background:#f7f7f7;cursor:pointer;",u.appendChild(d);const g=document.createElement("pre");g.style.cssText="margin:0;background:#0d1117;color:#c9d1d9;padding:12px;border-radius:8px;font-family:ui-monospace,Consolas,monospace;font-size:12px;line-height:1.5;overflow:auto;max-height:180px;",c.append(u,g),o.appendChild(c);function f(){return Yi(i)}function p(){g.textContent=f()}p(),d.addEventListener("click",()=>{var _;const S=f();(_=navigator.clipboard)==null||_.writeText(S).then(()=>{d.textContent=B("crossGrid.copied"),setTimeout(()=>d.textContent=B("crossGrid.copy"),1200)},()=>{d.textContent=B("crossGrid.copyFailed"),setTimeout(()=>d.textContent=B("crossGrid.copy"),1200)})});const v=document.createElement("div");v.style.cssText="display:flex;justify-content:flex-end;gap:8px;padding:14px 20px 18px;";const w=document.createElement("button");w.type="button",w.textContent=B("crossGrid.cancel"),w.style.cssText="font-size:13px;padding:8px 16px;border:1px solid #ccc;border-radius:7px;background:#fff;cursor:pointer;";const m=document.createElement("button");m.type="button",m.textContent=B("crossGrid.applyMove"),m.style.cssText="font-size:13px;padding:8px 16px;border:0;border-radius:7px;background:#1976d2;color:#fff;cursor:pointer;font-weight:600;",v.append(w,m),o.appendChild(v);let b=!1;function y(_){b||(b=!0,document.removeEventListener("keydown",R),n.remove(),e(_))}function R(_){_.key==="Escape"&&y(null)}w.addEventListener("click",()=>y(null)),n.addEventListener("mousedown",_=>{_.target===n&&y(null)}),m.addEventListener("click",()=>y({mapping:{...i},script:f()})),document.addEventListener("keydown",R),document.body.appendChild(n),m.focus()})}function Yt(r){return String(r).replace(/[&<>"]/g,t=>({"&":"&","<":"<",">":">",'"':"""})[t])}class gh{constructor(){this.$c=new Map}register(t,e){this.$c.set(t,e)}unregister(t){this.$c.delete(t)}get(t){return this.$c.get(t)}get size(){return this.$c.size}resolveAt(t,e,s){const i=document.elementFromPoint(t,e),n=i==null?void 0:i.closest(".og-body-wrapper");if(!n)return null;const o=this.$c.get(n);return!o||o===s?null:o}}const pe=new gh,ph="_ogRowId";class mh{constructor(t){this.$b=t}getSelf(){return this.$b.getSelf()}$nd(){return this.$b.getData().rowCount}$mj(t,e){this.$b.insertRow(t,e)}$kS(){return this.$b.getColLayout().visibleLeaves.map(t=>({field:t.field,header:t.header}))}handleCrossGridDrop(t,e,s){const i=pe.get(e);!i||i===this.$b.getSelf()||this.moveRowsTo(i,this.$b.dragRowSet(t),s)}async moveRowsTo(t,e,s){const i=this.$b.getSelf();if(!t||t===i||!e.length)return!1;const n=this.$b.getPeerController(t);if(!n)return!1;const o=[...new Set(e)].sort((u,d)=>u-d),l=s??n.$nd();let a=o.map(u=>{const d={...this.$b.getData().getRowByIndex(u)};return delete d[ph],d});const h=await this.$mZ(n);if(h===!1)return!1;h&&(a=a.map(u=>h(u)));const c={sourceGrid:i,targetGrid:t,rows:a,sourceIndexes:o,targetIndex:l};return this.fireGridDropBefore(c)===!1||c.cancel||n.fireGridDropBefore(c)===!1||c.cancel?!1:(a.forEach((u,d)=>n.$mj(u,l+d)),[...o].sort((u,d)=>d-u).forEach(u=>this.$b.deleteRow(u)),this.fireGridDropAfter(c),n.fireGridDropAfter(c),this.fireGridDropComplete(c),n.fireGridDropComplete(c),!0)}async moveCheckedTo(t){const e=this.$b.getChecked().map(s=>s.rowIndex);return e.length?(this.$b.uncheckAll(),this.moveRowsTo(t,e)):!1}async $mZ(t){var e,s;const i=this.$b.getOptions().crossGridMapping;if(typeof i=="function")return i;if(i!=="interactive")return null;const n=this.$kS(),o=t.$kS();if(uh(n.map(h=>h.field),o.map(h=>h.field)))return null;const l=await fh(n,o);if(!l)return!1;const a={sourceGrid:this.$b.getSelf(),targetGrid:t.getSelf(),mapping:l.mapping,script:l.script};return this.$b.emit("gridDropMapping",a),(s=(e=this.$b.getOptions()).onGridDropMapping)==null||s.call(e,a),console.log(`[OpenGrid] cross-grid mapping script:
|
|
81
|
+
`+Yi(l.mapping)),dh(l.mapping)}fireGridDropBefore(t){var e,s;return this.$b.emit("gridDropBefore",t),(s=(e=this.$b.getOptions()).onGridDropBefore)==null?void 0:s.call(e,t)}fireGridDropAfter(t){var e,s;this.$b.emit("gridDropAfter",t),(s=(e=this.$b.getOptions()).onGridDropAfter)==null||s.call(e,t)}fireGridDropComplete(t){var e,s;this.$b.emit("gridDropComplete",t),(s=(e=this.$b.getOptions()).onGridDropComplete)==null||s.call(e,t)}}const vh="⊕",wh="⊖";function yh(r,t=B){return{glyph:r?wh:vh,ariaLabel:t(r?"detail.collapseAria":"detail.expandAria"),title:t("detail.glyphTooltip")}}class bh{constructor(t,e,s,i,n,o){this.$ho=new Map,this.$cX={},this.$et=e,this.$jG=s,this.$dL=i,this._t=o??B,this.$d=document.createElement("fieldset"),this.$d.className="og-filter-select";const l=document.createElement("legend");l.className="og-filter-select-legend",l.textContent=e.legend??this._t("filter.legend"),this.$d.appendChild(l);const a=document.createElement("div");a.className="og-filter-select-row";for(const c of e.columns){const u=`og-fsel-${c.field}`,d=document.createElement("div");d.className="og-filter-select-group";const g=document.createElement("label");g.htmlFor=u,g.textContent=c.label,g.className="og-filter-select-label";const f=document.createElement("select");f.id=u,f.className="og-filter-select-sel",f.setAttribute("aria-label",c.label),n&&f.setAttribute("aria-controls",n),c.dependsOn?this.$dB(f,[],!1):this.$dB(f,this.$cR(c,""),!0),f.addEventListener("change",()=>this.$eT(c.field,f.value)),d.appendChild(g),d.appendChild(f),a.appendChild(d),this.$ho.set(c.field,f)}const h=document.createElement("button");h.type="button",h.textContent=this._t("filter.clear"),h.className="og-filter-select-reset",h.setAttribute("aria-label",this._t("filter.clearAria")),h.addEventListener("click",()=>this._reset()),this.$d.appendChild(a),this.$d.appendChild(h),t.insertBefore(this.$d,t.firstChild)}$cR(t,e){if(t.options)return t.options;let s=t.data??[];t.dependsOn&&t.dependsOnKey&&e&&(s=s.filter(o=>String(o[t.dependsOnKey]??"")===e));const i=t.valueKey??"value",n=t.textKey??i;return s.map(o=>({value:String(o[i]??""),text:String(o[n]??o[i]??"")}))}$dB(t,e,s){t.innerHTML="";const i=document.createElement("option");i.value="",i.textContent=this._t("filter.all"),t.appendChild(i);for(const n of e){const o=document.createElement("option");o.value=n.value,o.textContent=n.text,t.appendChild(o)}t.disabled=!s}$eT(t,e){const s=this.$et.columns.find(n=>n.field===t),i=s.filterKey??s.field;e?(this.$cX[t]=e,this.$jG(i,[{operator:"=",value:e}])):(delete this.$cX[t],this.$dL(i)),this.$hV(t)}$hV(t){const e=this.$cX[t]??"";for(const s of this.$et.columns){if(s.dependsOn!==t)continue;const i=this.$ho.get(s.field);if(!i)continue;const n=s.filterKey??s.field;e?(this.$dB(i,this.$cR(s,e),!0),i.value="",delete this.$cX[s.field],this.$dL(n)):(this.$dB(i,[],!1),delete this.$cX[s.field],this.$dL(n),this.$hV(s.field))}}_reset(){this.$cX={};for(const t of this.$et.columns){const e=this.$ho.get(t.field),s=t.filterKey??t.field;e&&(t.dependsOn?this.$dB(e,[],!1):(e.value="",e.disabled=!1),this.$dL(s))}}reset(){this._reset()}destroy(){this.$d.remove()}}const _h={"pagination.rowsPerPage":"행/페이지:","pagination.empty":"0건"};function xh(r,t){return r==="pagination.rangeBadge"?`${t==null?void 0:t.from}–${t==null?void 0:t.to} / ${t==null?void 0:t.total}건`:_h[r]??r}class Ch{constructor(t,e,s,i){this.$J=1,this._totalRows=0,this.$bz=e,this.$eT=s,this._t=i??xh,this.$d=document.createElement("div"),this.$d.className="og-pagination",this.$d.style.cssText=`
|
|
82
|
+
display:flex;align-items:center;justify-content:center;gap:4px;
|
|
83
|
+
padding:6px 8px;border-top:1px solid var(--og-border-color,#e0e0e0);
|
|
84
|
+
background:var(--og-header-bg,#f5f5f5);flex-shrink:0;user-select:none;
|
|
85
|
+
font-size:12px;color:var(--og-text-color,#333);
|
|
86
|
+
`,t.appendChild(this.$d),this._render()}get page(){return this.$J}get pageSize(){return this.$bz}get totalPages(){return Math.max(1,Math.ceil(this._totalRows/this.$bz))}setTotalRows(t){this._totalRows=t,this.$J>this.totalPages&&(this.$J=this.totalPages),this._render()}setPageSize(t){this.$bz=t,this.$J=1,this._render(),this.$M()}goTo(t){const e=Math.max(1,Math.min(t,this.totalPages));e!==this.$J&&(this.$J=e,this._render(),this.$M())}getRange(){const t=(this.$J-1)*this.$bz,e=Math.min(t+this.$bz-1,this._totalRows-1);return{start:t,end:e}}$M(){this.$eT({page:this.$J,pageSize:this.$bz,totalRows:this._totalRows,totalPages:this.totalPages})}_render(){this.$d.innerHTML="";const t=this.totalPages,e=document.createElement("span");e.style.cssText="display:flex;align-items:center;gap:3px;margin-right:8px;";const s=document.createElement("span");s.textContent=this._t("pagination.rowsPerPage"),s.style.color="#888";const i=document.createElement("select");i.style.cssText="padding:2px 4px;border:1px solid var(--og-border-color,#e0e0e0);border-radius:3px;font-size:11px;cursor:pointer;";for(const c of[10,20,50,100,200]){const u=document.createElement("option");u.value=String(c),u.textContent=String(c),c===this.$bz&&(u.selected=!0),i.appendChild(u)}i.addEventListener("change",()=>this.setPageSize(Number(i.value))),e.appendChild(s),e.appendChild(i),this.$d.appendChild(e);const n=document.createElement("span"),{start:o,end:l}=this.getRange();n.textContent=this._totalRows>0?this._t("pagination.rangeBadge",{from:o+1,to:l+1,total:this._totalRows}):this._t("pagination.empty"),n.style.cssText="margin-right:8px;color:#888;",this.$d.appendChild(n);const a=(c,u,d)=>{const g=document.createElement("button");return g.textContent=c,g.disabled=d,g.style.cssText=`
|
|
87
|
+
min-width:28px;height:24px;padding:0 6px;
|
|
88
|
+
border:1px solid var(--og-border-color,#e0e0e0);border-radius:3px;
|
|
89
|
+
background:${d?"#f5f5f5":"#fff"};
|
|
90
|
+
color:${d?"#bbb":"var(--og-text-color,#333)"};
|
|
91
|
+
cursor:${d?"default":"pointer"};font-size:12px;
|
|
92
|
+
`,d||g.addEventListener("click",()=>this.goTo(u)),g};this.$d.appendChild(a("«",1,this.$J===1)),this.$d.appendChild(a("‹",this.$J-1,this.$J===1));const h=Rh(this.$J,t);for(const c of h)if(c===-1){const u=document.createElement("span");u.textContent="…",u.style.padding="0 3px",this.$d.appendChild(u)}else{const u=a(String(c),c,c===this.$J);c===this.$J&&(u.style.background="var(--og-primary,#1976d2)",u.style.color="#fff",u.style.borderColor="var(--og-primary,#1976d2)"),this.$d.appendChild(u)}this.$d.appendChild(a("›",this.$J+1,this.$J===t)),this.$d.appendChild(a("»",t,this.$J===t))}refreshLabels(){this._render()}destroy(){this.$d.remove()}}function Rh(r,t){if(t<=7)return Array.from({length:t},(s,i)=>i+1);const e=[1];r>3&&e.push(-1);for(let s=Math.max(2,r-1);s<=Math.min(t-1,r+1);s++)e.push(s);return r<t-2&&e.push(-1),e.push(t),e}class Eh{constructor(t,e,s,i){this.$in=e-t.left,this.$io=s-t.top;const n=document.createElement("div");n.className="og-drag-ghost",n.style.cssText=`position:fixed;left:0;top:0;width:${t.width}px;height:${Math.min(t.height,40)}px;transform:translate(${t.left}px,${t.top}px);background:rgba(25,118,210,0.12);border:2px dashed #1976d2;box-sizing:border-box;pointer-events:none;z-index:10000;border-radius:3px;opacity:0.92;display:flex;align-items:center;padding-left:10px;font-size:12px;color:#1565c0;font-weight:600;white-space:nowrap;overflow:hidden;`,i>1&&(n.textContent=B("drag.rowCount",{count:i})),document.body.appendChild(n),this.$d=n}move(t,e){this.$d.style.transform=`translate(${t-this.$in}px,${e-this.$io}px)`}destroy(){this.$d.remove()}}class Xi{constructor(t="#1976d2"){const e=document.createElement("div");e.className="og-drop-indicator",e.style.cssText="position:absolute;left:0;right:0;display:none;align-items:center;pointer-events:none;z-index:9998;transform:translateY(-50%);";const s=n=>{const o=document.createElement("div"),l=n==="left"?`border-left:7px solid ${t}`:`border-right:7px solid ${t}`;return o.style.cssText=`width:0;height:0;flex-shrink:0;border-top:5px solid transparent;border-bottom:5px solid transparent;${l};`,o},i=document.createElement("div");i.style.cssText=`flex:1;height:3px;background:${t};border-radius:2px;box-shadow:0 0 0 1px rgba(255,255,255,0.7);`,e.append(s("left"),i,s("right")),this.$d=e}showIn(t,e){this.$d.parentElement!==t&&(this.$d.remove(),t.appendChild(this.$d)),this.$d.style.display="flex",this.$d.style.top=`${e}px`}hide(){this.$d.style.display="none"}destroy(){this.$d.remove()}}const Zi=(r,t,e)=>Math.max(t,Math.min(e,r));class kh{constructor(t,e,s,i=null,n=()=>1){this.$lh=t,this.$aQ=e,this.$eU=s,this.$aF=i,this.$lZ=n,this.$L=null,this.$ft=new Xi("#1976d2"),this.$ew=new Xi("#2e7d32"),this.$bw=this.$bw.bind(this),this.$dK=this.$dK.bind(this)}setRowHeight(t){this.$aQ=t}attachHandle(t,e,s){const i=document.createElement("div");return i.className="og-drag-handle",i.innerHTML="⠿",i.style.cssText=`
|
|
93
|
+
width:18px;min-width:18px;height:100%;
|
|
94
|
+
display:flex;align-items:center;justify-content:center;
|
|
95
|
+
cursor:grab;font-size:14px;color:#bbb;flex-shrink:0;
|
|
96
|
+
user-select:none;border-right:1px solid var(--og-border-color,#e0e0e0);
|
|
97
|
+
`,i.addEventListener("mousedown",n=>{n.preventDefault(),n.stopPropagation(),this.$nn(n,t,e,s)}),i}$nn(t,e,s,i){const n=e.getBoundingClientRect(),o=this.$lZ(s);this.$L={fromIndex:s,bodyEl:this.$lh,rowHeight:this.$aQ,totalRows:i,ghost:new Eh(n,t.clientX,t.clientY,o),currentTarget:s,crossTarget:null},document.addEventListener("mousemove",this.$bw,!0),document.addEventListener("mouseup",this.$dK,!0)}$bw(t){if(!this.$L)return;const e=this.$L;if(e.ghost.move(t.clientX,t.clientY),this.$aF){const n=this.$aF.resolveTarget(t.clientX,t.clientY);if(n&&n.bodyEl!==e.bodyEl){const o=n.bodyEl.getBoundingClientRect(),l=t.clientY-o.top+n.bodyEl.scrollTop,a=Zi(Math.round(l/n.rowHeight),0,n.totalRows);e.crossTarget={bodyEl:n.bodyEl,index:a},this.$ft.hide(),this.$ew.showIn(n.bodyEl,a*n.rowHeight);return}}e.crossTarget=null,this.$ew.hide();const s=e.bodyEl.getBoundingClientRect(),i=t.clientY-s.top+e.bodyEl.scrollTop;e.currentTarget=Zi(Math.round(i/e.rowHeight),0,e.totalRows-1),this.$ft.showIn(e.bodyEl,e.currentTarget*e.rowHeight)}$dK(t){if(document.removeEventListener("mousemove",this.$bw,!0),document.removeEventListener("mouseup",this.$dK,!0),!this.$L)return;const{fromIndex:e,currentTarget:s,ghost:i,crossTarget:n}=this.$L;this.$L=null,i.destroy(),this.$ft.hide(),this.$ew.hide(),n&&this.$aF?this.$aF.onCrossDrop(e,n.bodyEl,n.index):e!==s&&this.$eU(e,s)}destroy(){var t;document.removeEventListener("mousemove",this.$bw,!0),document.removeEventListener("mouseup",this.$dK,!0),(t=this.$L)==null||t.ghost.destroy(),this.$ft.destroy(),this.$ew.destroy(),this.$L=null}}class Ct{constructor(){this.$c=new Map}static $an(t,e){return`${t}:${e}`}applyMergeCells(t){this.$c.clear();for(const e of t){const s=Math.max(1,e.rowSpan??1),i=Math.max(1,e.colSpan??1);this.$c.set(Ct.$an(e.row,e.col),{rowSpan:s,colSpan:i,hidden:!1});for(let n=0;n<s;n++)for(let o=0;o<i;o++)n===0&&o===0||this.$c.set(Ct.$an(e.row+n,e.col+o),{rowSpan:1,colSpan:1,hidden:!0})}}applyAutoMerge(t,e,s){var i,n;this.$c.clear();for(let o=0;o<e.length;o++){const l=e[o],a=s[o];let h=0;for(let c=1;c<=t.length;c++){const u=(i=t[c-1])==null?void 0:i[a],d=c<t.length?(n=t[c])==null?void 0:n[a]:void 0;if(c===t.length||d!==u){const g=c-h;if(g>1){this.$c.set(Ct.$an(h,l),{rowSpan:g,colSpan:1,hidden:!1});for(let f=h+1;f<c;f++)this.$c.set(Ct.$an(f,l),{rowSpan:1,colSpan:1,hidden:!0})}h=c}}}}getInfo(t,e){return this.$c.get(Ct.$an(t,e))??null}clear(){this.$c.clear()}get isEmpty(){return this.$c.size===0}}const Mh=[{id:"sort-asc",labelKey:"contextMenu.sortAsc",icon:"↑",action:"sortAsc"},{id:"sort-desc",labelKey:"contextMenu.sortDesc",icon:"↓",action:"sortDesc"},{type:"divider"},{id:"find",labelKey:"contextMenu.find",icon:"🔍",action:"find"},{type:"divider"},{id:"excel",labelKey:"contextMenu.exportExcel",icon:"📊",action:"excel"},{id:"csv",labelKey:"contextMenu.exportCsv",icon:"📄",action:"csv"},{id:"print",labelKey:"contextMenu.print",icon:"🖨",action:"print"}],Sh=[{id:"sort-asc",label:"오름차순 정렬",icon:"↑",action:"sortAsc"},{id:"sort-desc",label:"내림차순 정렬",icon:"↓",action:"sortDesc"},{type:"divider"},{id:"find",label:"찾기",icon:"🔍",action:"find"},{type:"divider"},{id:"excel",label:"Excel로 저장",icon:"📊",action:"excel"},{id:"csv",label:"CSV로 저장",icon:"📄",action:"csv"},{id:"print",label:"인쇄",icon:"🖨",action:"print"}];function Ah(r){return r?Mh.map(t=>"type"in t?{type:"divider"}:{id:t.id,label:r(t.labelKey),icon:t.icon,action:t.action}):Sh}class Fh{constructor(t,e,s){this.$aU=t,this._actions=e,this._t=s,this.$d=null,this.$ds=null,this.$dt=null,this.$dv=null,this.$du=null,this.$dC=-1}open(t,e){this.close();const s=e??Ah(this._t),i=document.createElement("div");i.className="og-context-menu",i.setAttribute("role","menu");for(const h of s){if(h.type==="divider"){const d=document.createElement("div");d.className="og-cm-divider",d.setAttribute("role","separator"),i.appendChild(d);continue}const c=document.createElement("button");if(c.className="og-cm-item",c.setAttribute("role","menuitem"),c.setAttribute("tabindex","-1"),h.disabled&&(c.classList.add("og-cm-disabled"),c.setAttribute("aria-disabled","true")),h.icon){const d=document.createElement("span");if(d.className="og-cm-icon",/^[a-zA-Z][\w-]*(\s+[\w-]+)+$/.test(h.icon.trim())){const g=document.createElement("i");g.className=h.icon,d.appendChild(g)}else d.textContent=h.icon;d.setAttribute("aria-hidden","true"),c.appendChild(d)}const u=document.createElement("span");u.className="og-cm-label",u.textContent=h.label??"",c.appendChild(u),c.addEventListener("click",d=>{d.stopPropagation(),h.disabled||this.$ng(h),this.close()}),i.appendChild(c)}const n=this.$aU.closest("[data-og-theme]"),o=n==null?void 0:n.getAttribute("data-og-theme");o&&i.setAttribute("data-og-theme",o);const l=this.$aU.closest("[data-og-skin]"),a=l==null?void 0:l.getAttribute("data-og-skin");a&&i.setAttribute("data-og-skin",a),document.body.appendChild(i),this.$d=i,this.$du=h=>{if(!this.$d)return;const c=this.$d.getBoundingClientRect();(h.clientX<c.left-4||h.clientX>c.right+4||h.clientY<c.top-4||h.clientY>c.bottom+4)&&this.close()},this.$eZ(i,t.clientX,t.clientY,()=>{this.$d===i&&document.addEventListener("mousemove",this.$du,{capture:!0,passive:!0})}),this.$ds=h=>{i.contains(h.target)||this.close()},this.$dt=h=>{if(h.key==="Escape"){this.close();return}if(h.key==="ArrowDown"){h.preventDefault(),this.$gJ(1);return}if(h.key==="ArrowUp"){h.preventDefault(),this.$gJ(-1);return}if(h.key==="Enter"){const c=i.querySelector(".og-cm-item:focus");c==null||c.click()}},this.$dv=()=>this.close(),setTimeout(()=>{document.addEventListener("click",this.$ds),document.addEventListener("keydown",this.$dt),window.addEventListener("scroll",this.$dv,{passive:!0})},0),this.$dC=-1,this.$gJ(1)}close(){var t;(t=this.$d)==null||t.remove(),this.$d=null,this.$ds&&document.removeEventListener("click",this.$ds),this.$dt&&document.removeEventListener("keydown",this.$dt),this.$dv&&window.removeEventListener("scroll",this.$dv),this.$du&&document.removeEventListener("mousemove",this.$du,{capture:!0}),this.$ds=this.$dt=this.$dv=this.$du=null,this.$dC=-1}destroy(){this.close()}$eZ(t,e,s,i){t.style.cssText="position:fixed;visibility:hidden;left:0;top:0;",requestAnimationFrame(()=>{const{width:n,height:o}=t.getBoundingClientRect(),l=window.innerWidth,a=window.innerHeight,h=e+n>l?Math.max(0,e-n):e,c=s+o>a?Math.max(0,s-o):s;t.style.cssText=`position:fixed;left:${h}px;top:${c}px;z-index:9999;`,i==null||i()})}$gJ(t){var e;if(!this.$d)return;const s=Array.from(this.$d.querySelectorAll(".og-cm-item:not(.og-cm-disabled)"));s.length&&(this.$dC=(this.$dC+t+s.length)%s.length,(e=s[this.$dC])==null||e.focus())}$ng(t){if(typeof t.action=="function"){t.action();return}switch(t.action){case"sortAsc":this._actions.onSortAsc();break;case"sortDesc":this._actions.onSortDesc();break;case"find":this._actions.onFind();break;case"excel":this._actions.onExcel();break;case"csv":this._actions.onCsv();break;case"print":this._actions.onPrint();break}}}class Ji{constructor(t,e,s){this.$D=new Map,this.$E="",this.$jJ=e,this._t=s??B,this.$ee=this.$lo(t)}add(t,e=[],s=[]){if(this.$D.has(t))throw new Error(`WorksheetManager: 시트 '${t}'이 이미 존재합니다`);this.$D.set(t,{name:t,columns:e,data:s}),this.$cQ(),this.$D.size===1&&this.switch(t)}remove(t){if(!this.$D.has(t))return;if(this.$D.size===1)throw new Error("WorksheetManager: 마지막 시트는 삭제할 수 없습니다");const e=this.$E===t;this.$D.delete(t),this.$cQ(),e&&this.switch(this.$D.keys().next().value)}rename(t,e){if(!this.$D.has(t))return;if(this.$D.has(e))throw new Error(`WorksheetManager: 시트 '${e}'이 이미 존재합니다`);this.$D.get(t);const s=Array.from(this.$D.entries()).map(([i,n])=>i===t?[e,{...n,name:e}]:[i,n]);this.$D=new Map(s),this.$E===t&&(this.$E=e),this.$cQ()}switch(t){const e=this.$D.get(t);if(!e)throw new Error(`WorksheetManager: 시트 '${t}'을 찾을 수 없습니다`);this.$E=t,this.$cQ(),this.$jJ(t,e)}get(t){return this.$D.get(t)}getNames(){return Array.from(this.$D.keys())}getActive(){return this.$E}syncData(t,e){const s=this.$D.get(t);s&&(s.data=e)}destroy(){this.$ee.remove()}$lo(t){const e=document.createElement("div");return e.className="og-sheet-tabs",t.appendChild(e),e}$cQ(){this.$ee.innerHTML="";for(const e of this.$D.keys()){const s=document.createElement("button");s.className="og-sheet-tab",s.textContent=e,s.setAttribute("role","tab"),s.setAttribute("aria-selected",e===this.$E?"true":"false"),e===this.$E&&s.classList.add("og-sheet-tab--active"),s.addEventListener("click",()=>{e!==this.$E&&this.switch(e)}),s.addEventListener("dblclick",()=>this.$no(s,e)),this.$ee.appendChild(s)}const t=document.createElement("button");t.className="og-sheet-add",t.textContent="+",t.setAttribute("aria-label",this._t("worksheet.addAria")),t.addEventListener("click",()=>{const e=`Sheet${this.$D.size+1}`;this.add(e,[],[]),this.switch(e)}),this.$ee.appendChild(t)}$no(t,e){const s=document.createElement("input");s.className="og-sheet-tab-rename",s.value=e,t.replaceWith(s),s.focus(),s.select();const i=()=>{const n=s.value.trim()||e;try{n!==e?this.rename(e,n):this.$cQ()}catch{this.$cQ()}};s.addEventListener("blur",i),s.addEventListener("keydown",n=>{n.key==="Enter"&&s.blur(),n.key==="Escape"&&(s.value=e,s.blur())})}}class Ih{constructor(){this.$bI=new Map}add(t,e){this.$bI.has(t)||this.$bI.set(t,[]),this.$bI.get(t).push(e)}remove(t,e){const s=this.$bI.get(t);if(s){const i=s.indexOf(e);i>=0&&s.splice(i,1)}}clear(t){t?this.$bI.delete(t):this.$bI.clear()}mkCtx(t,e){let s=!1;return{operation:t,args:e,result:void 0,extra:{},timestamp:Date.now(),get cancelled(){return s},cancel(){s=!0}}}exec(t,e){const s=this.$bI.get(t)??[];for(const i of s)if(i(e),e.cancelled)return!1;if(t.startsWith("after:")){const i=this.$bI.get("complete")??[];for(const n of i)n(e)}return!0}}class Lh{constructor(){this.$cO=[],this.$aK=new Map}register(t){this.$aK.has(t.id)||this.$cO.push(t.id),this.$aK.set(t.id,t)}get(t){return this.$aK.get(t)}has(t){return this.$aK.has(t)}ids(){return[...this.$cO]}resolve(t,e,s){const i=this.$aK.get(t);return!i||!i.gate()?null:i.resolve(e,s)}activeIds(){return this.$cO.filter(t=>this.$aK.get(t).gate())}}class Th{constructor(t){this.$fj=new Lh,this.$b=t}get renderHooks(){return this.$fj}registerRenderHook(t){this.$fj.register(t)}resolveRenderHook(t,e,s){return this.$fj.resolve(t,e,s)}strategy(t,e){this.$b.kernel.strategy(t,e)}getStrategy(t,e){return this.$b.kernel.getStrategy(t,e)}hasStrategy(t){return this.$b.kernel.hasStrategy(t)}override(t,e,s={}){this.$b.kernel.override(t,e,s)}beforeMutation(t,e){this.$b.getTrigMgr().add(`before:${t}`,e)}afterMutation(t,e){this.$b.getTrigMgr().add(`after:${t}`,e)}offMutation(t,e,s){this.$b.getTrigMgr().remove(`${t}:${e}`,s)}catalog(){const t=[["sortComparator","(a,b,field,dir)=>number"],["filterPredicate","(value,fi,field)=>boolean"],["displayFormatter","(value,field,row)=>string"],["cellSerializer","(value,col,row)=>any"],["groupKeyFn","(row,remainingFields)=>any"],["summaryOp","(op,nums,field)=>number|null"],["cellClassResolver","(value,field,row)=>string|null"],["ariaLabelResolver","(value,field,row)=>string|null"],["skinResolver","(skinId)=>SkinTokenDelta|null"]].map(([o,l])=>({name:o,category:"strategy",signature:l})),e=this.$fj.ids().map(o=>({name:o,category:"renderHook",signature:"(rowIndex,field)=>value|null"})),s=[{name:"before:mutation",category:"lifecycle",signature:"(ctx)=>void — cancelable"},{name:"after:mutation",category:"lifecycle",signature:"(ctx)=>void — observe"}],i=[{name:"getDisplayValue",category:"override",signature:"(orig,rowIndex,field)=>string"},{name:"readCell",category:"override",signature:"(orig,rowIndex,field)=>any"}],n=[{name:"override(name,fn)",category:"escapeHatch",signature:"best-effort arbitrary method wrap (UC-11)"}];return[...t,...e,...s,...i,...n]}}const Qi="og-cf-bar",tn="og-cf-icon",ts="ogCf";function Oh(r){return r==="triangleUp"?"▲":r==="triangleDown"?"▼":"●"}function Dh(r){for(const t of Array.from(r.children))(t.classList.contains(Qi)||t.classList.contains(tn))&&t.remove();r.dataset[ts]&&(r.style.backgroundColor="",r.style.color="",r.style.textShadow="",delete r.dataset[ts])}function Nh(r,t,e,s,i){if(Dh(r),t.length===0)return;let n=!1;const o=[];for(const l of t){if(l.ariaSummary&&o.push(l.ariaSummary),l.fill){const{color:a,from:h,ratio:c}=l.fill;if(h===void 0)r.style.backgroundColor=a;else{r.style.position="relative";const u=document.createElement("div");u.className=Qi;const d=Math.max(0,Math.min(1,c))*e;u.style.position="absolute",u.style.top="0",u.style.bottom="0",u.style.width=`${d}px`,u.style.background=a,h==="right"?u.style.right="0":u.style.left="0",u.style.zIndex="0",u.style.pointerEvents="none",r.insertBefore(u,r.firstChild),i==null||i(u,c)}r.style.color=l.inkColor,l.inkOutline&&(r.style.textShadow="0 0 2px rgba(255,255,255,0.9), 0 0 2px rgba(255,255,255,0.9)"),n=!0}if(l.glyph){const{role:a,tint:h,shape:c}=l.glyph,u=document.createElement("span");u.className=tn,u.textContent=Oh(c),u.style.color=h,u.style.marginRight="4px",u.style.display="inline-block",u.setAttribute("role","img"),u.setAttribute("aria-label",a),r.insertBefore(u,r.firstChild),n=!0}}if(o.length>0){const l=r.getAttribute("aria-label")??"",a=o.join(" · ");r.setAttribute("aria-label",l?`${l} — ${a}`:a),n=!0}n&&(r.dataset[ts]="1")}const en="_ogRowId";function sn(r,t){const e=r.indexOf(t);e>=0&&r.splice(e,1)}const Xt=new WeakMap,zh={cellClick:"onCellClick",cellDblClick:"onCellDblClick",rowClick:"onRowClick",rowDblClick:"onRowDblClick",cellMouseOver:"onCellMouseOver",cellMouseOut:"onCellMouseOut",cellMouseDown:"onCellMouseDown",cellMouseUp:"onCellMouseUp",cellMouseMove:"onCellMouseMove",rowMouseOver:"onRowMouseOver",rowMouseOut:"onRowMouseOut",rowMouseDown:"onRowMouseDown",rowMouseUp:"onRowMouseUp",rowMouseMove:"onRowMouseMove",cellKeyDown:"onCellKeyDown",cellKeyUp:"onCellKeyUp",cellKeyPress:"onCellKeyPress",editStart:"onEditStart",editEnd:"onEditEnd",dataChange:"onDataChange",selectionChange:"onSelectionChange",sortChange:"onSortChange",filterChange:"onFilterChange",scroll:"onScroll",rowExpand:"onRowExpand",rowCollapse:"onRowCollapse"},Ot=class Y extends rn{constructor(t,e){var s;super(),this._vs=null,this.$bB=null,this._renderer=null,this.$dh=null,this.$dG=null,this._locales=null,this.$B=new Ih,this.$aG=!1,this._colWidths=[],this.$nu=new Map,this.$cz=null,this.$gi=null,this._pagination=null,this.$ey=null,this.$eR=new Ct,this.$ao=null,this.$au=null,this.$bh=null,this.$bi=null,this._wsManager=null,this._formulaDirtySeeds=new Set,this.$dp=null,this.$ep=new Map,this.$fR=[],this.$fQ=null,this.$hY=null,this.$cg=null,xt.compose(this,t,e,{createSubgrid:(o,l,a)=>new Y(o,{...l,_detailDepth:a})});const i=Xt.get(this._container)??new Set;i.add(this),Xt.set(this._container,i),this.$lg(),(s=this._options.defaultSort)!=null&&s.length&&this._sfMgr.initSort(this._options.defaultSort),this.override=Object.assign((o,l,a)=>this._ovk.override(o,l,a),{strategy:(o,l)=>this._ovk.strategy(o,l)});const n=this.destroy.bind(this);this.destroy=()=>{try{n()}finally{this._ovk.restoreAll()}};for(const[o,l]of Y._defaultStrategies)this._ovk.strategy(o,l);for(const[o,l,a]of Y._defaultOverrides)this._ovk.override(o,l,a);requestAnimationFrame(()=>{var o,l;this.emit("ready",this),(l=(o=this._options).onReady)==null||l.call(o,this)})}get extensions(){return this.$bQ}static instancesIn(t){return[t,...Array.from(t.querySelectorAll(".og-container"))].flatMap(s=>[...Xt.get(s)??[]])}static destroyAllIn(t){const e=[];for(const s of Y.instancesIn(t))try{s.destroy()}catch(i){e.push(i)}if(e.length===1)throw e[0];if(e.length>1)throw Object.assign(new Error(`OpenGrid.destroyAllIn: ${e.length} grids failed to destroy`),{errors:e})}static addDefaultOverride(t,e,s={}){const i=[t,e,s];return Y._defaultOverrides.push(i),()=>sn(Y._defaultOverrides,i)}static addDefaultStrategy(t,e){const s=[t,e];return Y._defaultStrategies.push(s),()=>sn(Y._defaultStrategies,s)}static defaultOverride(t,e,s={}){return Y.addDefaultOverride(t,e,s),Y}static registerRenderer(t,e){return U(t,e),Y}static registerEditor(t,e){return Ft(t,e),Y}static defineSkin(t,e){return Ae.define(t,e),Y}static defineIconSet(t){for(const[e,s]of Object.entries(t))mt.register(e,s);return Y}static defineLocale(t,e,s){return st.register(t,e,s),Y}restore(t){return this._ovk.restore(t),this}restoreAll(){return this._ovk.restoreAll(),this}hasOverride(t){return this._ovk.hasOverride(t)}getOverrideNames(){return this._ovk.getOverrideNames()}getStrategy(t,e){return this._ovk.getStrategy(t,e)}_mount(){var t,e,s;this.$bQ=new Th({kernel:this._ovk,getTrigMgr:()=>this.$B}),this.$bQ.registerRenderHook({id:"displayText",gate:()=>this.hasOverride("getDisplayValue")||this._ovk.hasStrategy("displayFormatter"),resolve:(l,a)=>this.getDisplayValue(l,a)}),this.$bQ.registerRenderHook({id:"cellClass",gate:()=>this._ovk.hasStrategy("cellClassResolver"),resolve:(l,a)=>{const h=this._ovk.getStrategy("cellClassResolver",null);return h?h(this.readCell(l,a),a,this._data.getRowByIndex(l)):null}}),this.$bQ.registerRenderHook({id:"ariaLabel",gate:()=>this._ovk.hasStrategy("ariaLabelResolver"),resolve:(l,a)=>{const h=this._ovk.getStrategy("ariaLabelResolver",null);return h?h(this.readCell(l,a),a,this._data.getRowByIndex(l)):null}}),this._container.classList.add("og-container");const i=this._options.height,n=this._options.width;this._container.style.height=typeof i=="number"?`${i}px`:String(i),this._container.style.width=typeof n=="number"?`${n}px`:String(n),this._container.style.display="flex",this._container.style.flexDirection="column",this._container.style.overflow="hidden",this._container.style.boxSizing="border-box",this._container.style.border="1px solid var(--og-border-color, #e0e0e0)",this._container.style.fontFamily="var(--og-font-family, -apple-system, sans-serif)",this._container.style.fontSize="var(--og-font-size, 13px)",this._container.setAttribute("data-og-theme",this._options.theme),this._container.setAttribute("data-og-skin",this._options.skin??"default");for(const[l,a]of Object.entries(this._options.cssVars))this._container.style.setProperty(l,a);this.$dh=new _e(new ee(this._options.theme,this._options.skin??"default")),this._renderer=new Ur(this._container,this._options,{onHeaderClick:(l,a)=>this._handleSortClick(l,a),onCellClick:(l,a,h)=>this._handleCellClick(l,a,h),onCellDblClick:(l,a,h)=>this._handleCellDblClick(l,a,h),onCellMouseOver:(l,a,h)=>this._handleCellMouseOver(l,a,h),onCellMouseOut:(l,a,h)=>this._handleCellMouseOut(l,a,h),onCellMouseDown:(l,a,h)=>this._handleCellMouseDown(l,a,h),onCellMouseUp:(l,a,h)=>this._handleCellMouseUp(l,a,h),onCellMouseMove:(l,a,h)=>this._handleCellMouseMove(l,a,h),onRowCheck:(l,a)=>this._handleRowCheck(l,a),onAllCheck:l=>this._handleAllCheck(l),onColResize:(l,a)=>this._handleColResize(l,a),onFilterIconClick:(l,a)=>this._handleFilterIconClick(l,a),getDndManager:()=>this.$ey,onColDragStart:l=>{this._editMgr.dragColIdx=l},onColDrop:l=>{this._editMgr.dragColIdx!==null&&this._editMgr.dragColIdx!==l&&this.$mT(this._editMgr.dragColIdx,l),this._editMgr.dragColIdx=null},getColDragIdx:()=>this._editMgr.dragColIdx,resolveRenderHook:(l,a,h)=>this.$bQ.resolveRenderHook(l,a,h),getDisplayFormatter:()=>this._ovk.getStrategy("displayFormatter",null)??null,getFormulaMeta:(l,a)=>this._formula.getFormulaMeta(l,a),t:(l,a)=>this.t(l,a),applyCF:(l,a,h,c,u,d,g)=>{if(!this.$dp||!this.$fQ)return;const f=this.$ep.get(h);if(!f)return;const p=this.$dp.paintFor({value:c,rowIndex:a,columnId:h,rowState:"none"},f,this.$fQ,bn(0,0,u,d),{now:Date.now()});Nh(l,p,u,d,g)}},this.$dh),this._renderer.setSortIndicator(this._sortIndicator),this._render=new Fo({getContainer:()=>this._container,getOptions:()=>this._options,getRenderer:()=>this._renderer,getVs:()=>this._vs,getPagination:()=>this._pagination,getData:()=>this._data,getColLayout:()=>this._colLayout,getFlatModel:()=>this._flatModel,getMergeEngine:()=>this.$eR,getColWidths:()=>this._colWidths,setColWidths:l=>{this._colWidths=l},getUserWidths:()=>this.$nu,getSfMgr:()=>this._sfMgr,getRowMgr:()=>this._rowMgr,getEditMgr:()=>this._editMgr,getGrpMgr:()=>this._grpMgr,getDetailMgr:()=>this._detailMgr,getRangeMgr:()=>this._rangeMgr,buildDetailRenderContext:()=>this.$lk(),submitRender:l=>this._scheduler.submit(l)}),this.$C=new ch({getData:()=>this._data,getVs:()=>this._vs,getPagination:()=>this._pagination,getFlatModel:()=>this._flatModel,getColLayout:()=>this._colLayout,getContainer:()=>this._container,getTrigMgr:()=>this.$B,getRowMgr:()=>this._rowMgr,getGrpMgr:()=>this._grpMgr,getOptions:()=>this._options,emit:(l,a)=>{this.emit(l,a)},announce:l=>this._announce(l),t:(l,a)=>this.t(l,a),applyFilters:()=>this.$lc(),flushFormula:()=>this._formula.flushRecalc(),submitRender:l=>this._scheduler.submit(l),resetFormulaState:()=>{var l,a;this._formulaDirtySeeds.clear(),this._recalc=new mi({accessor:this._formula.buildAccessor(),setComputedValue:(h,c,u)=>this._data.setComputedValueByRowId(h,c,u),onFormulaError:(h,c,u)=>this._formula.handleFormulaError(h,c,u),refMode:((l=this._options.formula)==null?void 0:l.refMode)??"stable",divisionPrecision:((a=this._options.formula)==null?void 0:a.divisionPrecision)??30})},seedFormulaDirty:(l,a)=>{const h=this._flatModel.resolveFlatRow(l);h.kind==="data"&&h.rowId&&this._formulaDirtySeeds.add(X(h.rowId,a))},invalidateRemovedRows:l=>{for(const a of l)this._formula.afterRecalc(this._recalc.invalidateRow(a),{skipRender:!0})},getRowIdAt:l=>{var a;return(a=this._data.getRowByIndex(l))==null?void 0:a[en]}}),this._rangeMgr.mount(this._renderer.bodyWrapper),this.$cz=new un(this._container,(l,a)=>this.setFilter(l,a),l=>this.resetFilter(l),(l,a)=>this.t(l,a)),this._container.setAttribute("role","grid"),this._container.setAttribute("aria-label",this._options.ariaLabel??((t=this._options.cssVars)==null?void 0:t["aria-label"])??this.t("grid.containerAria")),this._container.setAttribute("aria-rowcount","0"),this._container.setAttribute("aria-colcount",String(this._options.columns.filter(l=>!l.hidden).length)),this.$ao=document.createElement("div"),this.$ao.setAttribute("aria-live","polite"),this.$ao.setAttribute("aria-atomic","true"),this.$ao.className="og-live-region",Object.assign(this.$ao.style,{position:"absolute",width:"1px",height:"1px",margin:"-1px",padding:"0",overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:"0"}),this._container.appendChild(this.$ao),this._container.tabIndex=0,this._container.addEventListener("keydown",l=>this._handleKeyDown(l)),this._container.addEventListener("keyup",l=>this._handleCellKeyEvt("cellKeyUp",l)),this._container.addEventListener("keypress",l=>this._handleCellKeyEvt("cellKeyPress",l)),this._vs=new on(this._renderer.bodyWrapper,{rowHeight:this._options.rowHeight,onRender:(l,a)=>this._scheduler.submit(F.rowsInclusive(l,a)),requestRender:(l,a,h)=>this._scheduler.submit(h?F.SCROLLED:F.WINDOW_CHANGED)});const o=this._renderer.bodyWrapper;o.addEventListener("scroll",()=>{const{scrollTop:l,scrollLeft:a,scrollHeight:h,clientHeight:c}=o;this.emit("scroll",{scrollTop:l,scrollLeft:a,isAtTop:l<=0,isAtBottom:l+c>=h-1})},{passive:!0}),pe.register(this._renderer.bodyWrapper,this),this.$aF=new mh({getSelf:()=>this,getData:()=>this._data,getColLayout:()=>this._colLayout,getOptions:()=>this._options,emit:(l,a)=>{this.emit(l,a)},insertRow:(l,a)=>this.insertRow(l,a),deleteRow:l=>this.deleteRow(l),getChecked:()=>this._rowMgr.getChecked(),uncheckAll:()=>this._rowMgr.uncheckAll(),dragRowSet:l=>this.$il(l),getPeerController:l=>l.$aF}),this._options.draggable&&(this.$ey=new kh(this._renderer.bodyWrapper,this._options.rowHeight,(l,a)=>this._handleRowDrop(l,a),this._options.crossGrid?{resolveTarget:(l,a)=>{const h=pe.resolveAt(l,a,this);return!h||!h._options.crossGrid?null:{bodyEl:h._crossBodyEl(),rowHeight:h._options.rowHeight,totalRows:h._data.rowCount}},onCrossDrop:(l,a,h)=>this.$aF.handleCrossGridDrop(l,a,h)}:void 0,l=>this.$il(l).length)),this._options.pagination&&(this._pagination=new Ch(this._container,this._options.pageSize,l=>{this.emit("pageChange",l),this._scheduler.submit(F.REPAINT_VISIBLE)},(l,a)=>this.t(l,a))),this._findMgr.init(this._container),this.$iY(),(e=this._options.worksheets)!=null&&e.length&&this.$mg(),this._options.density!=null&&this.setDensity(this._options.density),this._options.texture!=null&&this.setTexture(this._options.texture),(s=this._options.conditionalFormat)!=null&&s.length&&this.setConditionalFormat(this._options.conditionalFormat),this.$bB=new ResizeObserver(()=>this.$dM()),this.$bB.observe(this._container),this.$dM()}$iY(){const t=this._options.contextMenu;t!==!1&&(this.$bh&&this._container.removeEventListener("contextmenu",this.$bh),this.$bi&&this._container.removeEventListener("keydown",this.$bi),this.$bh=this.$bi=null,this.$au=new Fh(this._container,{onSortAsc:()=>{const e=this._colLayout.visibleLeaves[0];e&&this.orderBy(e.field,"asc")},onSortDesc:()=>{const e=this._colLayout.visibleLeaves[0];e&&this.orderBy(e.field,"desc")},onFind:()=>this._findMgr.open(),onExcel:()=>this.exportExcel(),onCsv:()=>this.exportCsv(),onPrint:()=>this.print()},(e,s)=>this.t(e,s)),this.$bh=e=>{var s;const i=e.target.closest(".og-cell");if(!i)return;e.preventDefault();const n=Number(i.dataset.colIndex??-1),o=this._colLayout.visibleLeaves[n];o&&this.$au&&(this.$au._actions.onSortAsc=()=>this.orderBy(o.field,"asc"),this.$au._actions.onSortDesc=()=>this.orderBy(o.field,"desc"));const l=Array.isArray(t)?t:void 0;(s=this.$au)==null||s.open(e,l)},this._container.addEventListener("contextmenu",this.$bh),this.$bi=e=>{var s;if(e.shiftKey&&e.key==="F10"){e.preventDefault();const i=this._container.getBoundingClientRect(),n={clientX:i.left+80,clientY:i.top+40};(s=this.$au)==null||s.open(n)}},this._container.addEventListener("keydown",this.$bi))}openContextMenu(t,e){var s;(s=this.$au)==null||s.open(t,e)}closeContextMenu(){var t;(t=this.$au)==null||t.close()}setFilterSelect(t){var e;(e=this.$gi)==null||e.destroy(),this.$gi=null,t&&(this._container.id||(this._container.id=`og-${Math.random().toString(36).slice(2,7)}`),this.$gi=new bh(this._container,t,(s,i)=>this.setFilter(s,i),s=>this.resetFilter(s),this._container.id,(s,i)=>this.t(s,i)))}setOptions(t){var e;if(Object.assign(this._options,t),"contextMenu"in t&&((e=this.$au)==null||e.destroy(),this.$au=null,this.$iY()),"groupBy"in t||"summary"in t){const s=t.groupBy??[];s.length>0?this._grpMgr.groupBy(s):this.clearGroup();return}this._renderHeader(),this._scheduler.submit(F.REPAINT_VISIBLE)}setMaskEnabled(t,e){var s;const i=this._colLayout.getColumnByField(t);i&&(e?(i._maskRevealed=!1,(s=i._maskRevealedRows)==null||s.clear()):i._maskRevealed=!0,this._scheduler.submit(F.REPAINT_VISIBLE))}getMaskEnabled(t){const e=this._colLayout.getColumnByField(t);return e?e._maskRevealed!==!0:!1}$mg(){const t=this._options.worksheets;this._wsManager=new Ji(this._container,(e,s)=>this.$jm(s),(e,s)=>this.t(e,s));for(const e of t)this._wsManager.add(e.name,e.columns??this._options.columns,e.data??[])}$jm(t){var e,s;this._rowMgr.reset(),this._data.setData(t.data),this._colLayout=new fs(t.columns.length?t.columns:this._options.columns,this._options.frozenColumns),(e=this._vs)==null||e.setTotalRows(this._data.rowCount),(s=this._pagination)==null||s.setTotalRows(this._data.rowCount),this._container.setAttribute("aria-rowcount",String(this._data.rowCount)),this._container.setAttribute("aria-colcount",String(this._colLayout.visibleLeaves.length));const{width:i}=this._container.getBoundingClientRect();i&&this._recalcWidths(i),this._renderHeader(),this._scheduler.submit(F.REPAINT_VISIBLE)}addWorksheet(t,e,s){this._wsManager||(this._wsManager=new Ji(this._container,(i,n)=>this.$jm(n),(i,n)=>this.t(i,n))),this._wsManager.add(t,e??this._options.columns,s??[])}removeWorksheet(t){var e;(e=this._wsManager)==null||e.remove(t)}switchWorksheet(t){var e;(e=this._wsManager)==null||e.switch(t)}renameWorksheet(t,e){var s;(s=this._wsManager)==null||s.rename(t,e)}getWorksheet(t){var e;return(e=this._wsManager)==null?void 0:e.get(t)}getWorksheetNames(){var t;return((t=this._wsManager)==null?void 0:t.getNames())??[]}exportSheetsExcel(t){this._exportMgr.exportSheetsExcel(t)}$dM(){this._render.onResize()}_recalcWidths(t){this._render.recalcWidths(t)}_renderHeader(){this._render.renderHeader()}$nA(){this._render.syncHeaderLayout()}_doRender(t,e,s,i){this._render.doRender(t,e,s,i)}$lk(){if(!this._detailMgr.enabled)return;const t=this._options.masterDetail??{};return{toggleMode:t.toggle??"expander-col",ariaLabel:t.ariaLabel??this.t("grid.detailRegion"),getRowId:e=>e==null?void 0:e[en],isExpanded:e=>this._detailMgr.isExpandedId(e),onToggle:(e,s)=>this._detailMgr.toggleRow({id:s}),getGlyph:e=>yh(e,(s,i)=>this.t(s,i)),getPanelHost:e=>this._detailMgr.getPanelHost(e),onBeforeTeardown:()=>this._detailMgr.onBeforeTeardown()}}_handleGroupToggle(t){this._grpMgr.handleGroupToggle(t)}_visRange(){return this._render.visRange()}_handleSortClick(t,e){this._sfMgr.handleSortClick(t,e)}$ny(t){return Ut(t)}_handleCellClick(t,e,s){this._cellEvt.handleCellClick(t,e,s)}_handleCellDblClick(t,e,s){this._cellEvt.handleCellDblClick(t,e,s)}_handleCellMouseOver(t,e,s){this._cellEvt.handleCellMouseOver(t,e,s)}_handleCellMouseOut(t,e,s){this._cellEvt.handleCellMouseOut(t,e,s)}_handleCellMouseDown(t,e,s){this._cellEvt.handleCellMouseDown(t,e,s)}_handleCellMouseUp(t,e,s){this._cellEvt.handleCellMouseUp(t,e,s)}_handleCellMouseMove(t,e,s){this._cellEvt.handleCellMouseMove(t,e,s)}_handleCellKeyEvt(t,e){this._cellEvt.handleCellKeyEvt(t,e)}_handleRowCheck(t,e){this._rowMgr.check(t,e),this._scheduler.submit(F.REPAINT_VISIBLE),this.emit("rowCheck",{rowIndex:t,checked:e,row:this._data.getRowByIndex(t)})}_handleFilterIconClick(t,e){var s,i;if((s=this.$cz)!=null&&s.isOpen){this.$cz.close();return}const n=this._sfMgr.filters[t]??[];(i=this.$cz)==null||i.open(t,e,n)}_handleAllCheck(t){this._rowMgr.checkAll(t,this._data.rowCount),this._scheduler.submit(F.REPAINT_VISIBLE),this.emit("allCheck",{checked:t})}_handleRowDrop(t,e){var s,i;this._data.moveRow(t,e),this._scheduler.submit(F.REPAINT_VISIBLE),this.emit("rowDrop",{fromIndex:t,toIndex:e}),(i=(s=this._options).onRowDrop)==null||i.call(s,{fromIndex:t,toIndex:e})}_crossBodyEl(){return this._renderer.bodyWrapper}$il(t){const e=[...this._rowMgr.selectedRows];return e.length>1&&e.includes(t)?e.sort((s,i)=>s-i):[t]}moveRowsTo(t,e,s){return this.$aF.moveRowsTo(t,e,s)}moveCheckedTo(t){return this.$aF.moveCheckedTo(t)}reorderRow(t,e){this._data.moveRow(t,e),this._scheduler.submit(F.REPAINT_VISIBLE)}_handleColResize(t,e){this._render.commitColumnWidth(t,e)}_handleKeyDown(t){this._kbdMgr.handleKeyDown(t)}_setFocusCell(t,e){this._rowMgr.selectSingle(t),this._editMgr.setFocusCell(t,e)}_announce(t){this.$ao&&(this.$ao.textContent="",setTimeout(()=>{this.$ao&&(this.$ao.textContent=t)},50))}$lg(){for(const[t,e]of Object.entries(zh))this.on(t,s=>{var i,n;return(n=(i=this._options)[e])==null?void 0:n.call(i,s)})}setData(t){this.$C.setData(t),this.$dp&&(this.$jY(),this._scheduler.submit(F.REPAINT_VISIBLE))}getData(){return this._data.getData()}getSourceRows(){return this._data.getOriginalData()}pushData(t){var e,s;const i=[...this._data.getAllData(),...t];this._data.setData(i);const n=this._data.rowCount;(e=this._vs)==null||e.setTotalRows(this._flatModel.count()),(s=this._pagination)==null||s.setTotalRows(n)}prefixData(t){var e,s;const i=[...t,...this._data.getAllData()];this._data.setData(i);const n=this._data.rowCount;(e=this._vs)==null||e.setTotalRows(this._flatModel.count()),(s=this._pagination)==null||s.setTotalRows(n)}async setConditionalFormat(t){if(this.$fR=t,!t.length){this.$dp=null,this.$ep.clear(),this._scheduler.submit(F.REPAINT_VISIBLE);return}const e=await import("./index-1OXjJmct.js");this.$dp=new e.CFEngine(new e.CFRuleStore(t)),this.$fQ=e.staticAppearanceView(),this.$hY=e.computeColumnStats,this.$jY(),this._scheduler.submit(F.REPAINT_VISIBLE)}$jY(){const t=this.$hY;if(!this.$fR.length||!t){this.$ep.clear();return}const e=new Set(this.$fR.map(n=>n.scope.columnId)),s=this._data.getData(),i=new Map;for(const n of e)i.set(n,t(s.map(o=>o[n])));this.$ep=i}async setRealtimeSource(t,e){var s;(s=this.$cg)==null||s.detach(),this.$cg=null;const i=await import("./index-B5V7e4Xc.js"),o={mutation:{writeCell:(d,g,f)=>this.$C.writeCell(d,g,f),writeCells:d=>this.$C.writeCells(d.map(g=>({...g}))),insertRow:(d,g)=>this.$C.insertRow(d,g??"last"),deleteRows:d=>this.$C.deleteRow([...d]),beginBatch:()=>this.$C.beginBatch(),endBatch:()=>this.$C.endBatch()},coords:{rowCount:()=>this._flatModel.count(),rowIdAt:d=>this._flatModel.rowIdOfFlat(d)??void 0,indexOf:d=>this._flatModel.flatIndexOfRowId(d),getCellValue:(d,g)=>this._data.getCellValueByRowId(d,g),getRowSnapshot:d=>{const g=this._data.getRowById(d);return g?{...g}:void 0}},values:{equals:(d,g)=>Object.is(d,g)},clock:{now:()=>Date.now()}},l={dispatchSilent:d=>d.do(o),beginBatch:()=>this.$C.beginBatch(),endBatch:()=>this.$C.endBatch()},a={rowIdToIndex:d=>this._flatModel.flatIndexOfRowId(d),indexToRowId:d=>this._flatModel.rowIdOfFlat(d)??void 0},h={readSelection:()=>[],readScroll:()=>{var d;return{pixelWithinRow:0,scrollLeft:((d=this._renderer)==null?void 0:d.bodyWrapper.scrollLeft)??0}},readEditing:()=>{},readSortFilterSig:()=>"",writeSelection:()=>{},writeScroll:()=>{},writeEditing:()=>{}},c={sink:l,stateGuard:new i.LiveStateGuard(h,a),freshness:new i.FreshnessClock({staleAfterMs:(e==null?void 0:e.staleAfterMs)??5e3}),announce:new i.RtAnnouncePolicy({announce:(e==null?void 0:e.announce)??(()=>{}),...(e==null?void 0:e.debounceMs)!==void 0?{debounceMs:e.debounceMs}:{}}),...e!=null&&e.scheduleFrame?{scheduleFrame:e.scheduleFrame}:{},...(e==null?void 0:e.maxBatchPerFrame)!==void 0?{maxBatchPerFrame:e.maxBatchPerFrame}:{},applySnapshot:d=>this.setData(d)},u=new i.RealtimeController(t,c);return this.$cg=u,u.attach(),u}disconnectRealtime(){var t;(t=this.$cg)==null||t.detach(),this.$cg=null}clearData(){this._rowMgr.reset(),this._data.clearData(),this.$C.commit({totals:"zero",renderMode:"full",emitPayload:()=>[]})}insertRow(t,e="last"){this.$C.insertRow(t,e)}pushRow(t){this.$C.pushRow(t)}appendRows(t){this.pushRow(t)}unshiftRow(t){(Array.isArray(t)?t:[t]).forEach(s=>this._data.addRow(s,"first")),this.$C.commit({totals:"count",renderMode:"sync-window",emitPayload:()=>this._data.getData()})}prependRows(t){this.unshiftRow(t)}deleteRow(t){this.$C.deleteRow(t)}deleteById(t){}readCell(t,e){return this._data.getCellValue(t,e)}getDisplayValue(t,e){const s=this.readCell(t,e);return this._ovk.getStrategy("displayFormatter",(n,o,l)=>n==null?"":String(n))(s,e,this._data.getRowByIndex(t))}writeCell(t,e,s){this.$C.writeCell(t,e,s)}getRowAt(t){return this._data.getRowByIndex(t)}getFlatRow(t){return this._flatModel.rowAt(t)}getFlatRowModel(){return this._flatModel}beginBatch(){this.$C.beginBatch()}endBatch(){this.$C.endBatch()}setCellFormula(t,e,s){this._formula.setCellFormula(t,e,s)}getCellFormula(t,e){return this._formula.getCellFormula(t,e)}hasCellFormula(t,e){return this._formula.hasCellFormula(t,e)}clearCellFormula(t,e){this._formula.clearCellFormula(t,e)}getCellError(t,e){return this._formula.getCellError(t,e)}getDependents(t,e){return this._formula.getDependents(t,e)}getPrecedents(t,e){return this._formula.getPrecedents(t,e)}recalculate(){this._formula.recalculate()}recalculateCell(t,e){this._formula.recalculateCell(t,e)}offsetFormula(t,e,s,i){return this._formula.offsetFormula(t,e,s,i)}writeCells(t){return this.$C.writeCells(t)}getRangeSelection(){return this._rangeMgr.getRangeSelection()}getActiveRange(){return this._rangeMgr.getActiveRange()}setRangeSelection(t){this._rangeMgr.setRangeSelection(t)}clearRangeSelection(){this._rangeMgr.clearRangeSelection()}getRangeValues(){return this._rangeMgr.getRangeValues()}getRangeStats(){return this._rangeMgr.getRangeStats()}fillRange(t,e,s="copy"){this._rangeMgr.fillRange(t,e,s)}createChart(t){return this._chartMgr.createChart(t)}getCharts(){return this._chartMgr.getCharts()}destroyCharts(){this._chartMgr.destroyCharts()}getChanges(){return this._data.getChanges()}getEditedRows(){return this._data.getEditedRows()}getChangedRows(){return this._data.getChangedRows()}getChangedColumns(){return this._data.getChangedColumns()}getAddedRows(){return this._data.getAddedRows()}getRemovedRows(){return this._data.getRemovedRows()}getOriginalRow(t){return this._data.getOriginalRow(t)}getRowsWithState(t){return this._data.getRowsWithState(t)}undo(){}redo(){}clearHistory(){}getColumnDefs(){return this._colLayout.visibleLeaves.slice()}getAllColumnDefs(){return this._colLayout.leaves}getColumnCount(){return this._colLayout.visibleLeaves.length}applyColumns(t){const e=this.$B.mkCtx("applyColumns",[t]);this.$B.exec("before:applyColumns",e)&&(this._colLayout.setColumns(t),this._recalcWidths(this._container.getBoundingClientRect().width),this._renderHeader(),this._scheduler.submit(F.REPAINT_VISIBLE),e.result={columnCount:t.length},this.$B.exec("after:applyColumns",e))}insertColumn(t,e){this._colLayout.addColumn(t,e),this._recalcWidths(this._container.getBoundingClientRect().width),this._renderHeader(),this._scheduler.submit(F.REPAINT_VISIBLE)}deleteColumn(t){this._colLayout.removeColumn(t),this._recalcWidths(this._container.getBoundingClientRect().width),this._formula.afterRecalc(this._recalc.invalidateField(t),{skipRender:!0}),this._renderHeader(),this._scheduler.submit(F.REPAINT_VISIBLE)}$mT(t,e){var s,i;const n=this._colLayout.visibleLeaves.map(a=>a);if(t<0||e<0||t>=n.length||e>=n.length)return;const o=[...this._options.columns],[l]=o.splice(t,1);o.splice(e,0,l),this._options.columns=o,this.applyColumns(o),(i=(s=this._options).onColumnReorder)==null||i.call(s,{fromIndex:t,toIndex:e,field:l.field??""})}hideColumn(t){this._colLayout.hideColumn(t),this._recalcWidths(this._container.getBoundingClientRect().width),this._renderHeader(),this._scheduler.submit(F.REPAINT_VISIBLE)}showColumn(t){this._colLayout.showColumn(t),this._recalcWidths(this._container.getBoundingClientRect().width),this._renderHeader(),this._scheduler.submit(F.REPAINT_VISIBLE)}getColumnIndex(t){return this._colLayout.getColumnIndex(t)}getFieldAt(t){var e;return((e=this._colLayout.getColumnByIndex(t))==null?void 0:e.field)??""}getColValues(t,e=!1){return this._data.getData().map(s=>s[t])}getUniqueValues(t,e=!1){return[...new Set(this.getColValues(t,e))]}setColWidths(t){}calcColWidths(t=!1){return[]}getSelections(){return this._rowMgr.getSelections()}getActiveRow(){return this._rowMgr.getActiveRow()}activate(t){this._rowMgr.activate(t),this._scheduler.submit(F.REPAINT_VISIBLE)}deselect(){this._rowMgr.deselect(),this._scheduler.submit(F.REPAINT_VISIBLE)}getChecked(){return this._rowMgr.getChecked()}getAllChecked(){return this._rowMgr.getAllChecked()}checkById(t){}addCheckById(t){}checkByValue(t,e){this._rowMgr.checkByValue(t,e),this._scheduler.submit(F.REPAINT_VISIBLE)}uncheckById(t){}uncheckAll(){this._rowMgr.uncheckAll(),this._scheduler.submit(F.REPAINT_VISIBLE)}orderBy(t,e="asc"){const s=this.$B.mkCtx("orderBy",[t,e]);this.$B.exec("before:orderBy",s)&&(this._sfMgr.sort(t,e),this.$fe(),s.result={sortList:this._sfMgr.sortList},this.$B.exec("after:orderBy",s))}resetOrder(){this._sfMgr.resetSort(),this.$fe()}setFilter(t,e){const s=this.$B.mkCtx("setFilter",[t,e]);this.$B.exec("before:setFilter",s)&&(this._sfMgr.setFilter(t,e),this.$fe(),s.result={field:t,filteredCount:this._data.rowCount},this.$B.exec("after:setFilter",s))}resetFilter(t){this._sfMgr.resetFilter(t),this.$fe()}$fe(){this._formula.recalcRangeBearingFormulas()}getFilterState(){return this._sfMgr.getFilterState()}restoreFilter(t){this._sfMgr.restoreFilter(t)}$lc(){this._sfMgr.applyFilters()}freeze(t){this._colLayout.setFrozen(t),this._renderHeader(),this._scheduler.submit(F.REPAINT_VISIBLE)}mergeCells(t){this.$eR.applyMergeCells(t),this._scheduler.submit(F.REPAINT_VISIBLE)}autoMerge(t){const e=this._colLayout.visibleLeaves,s=[],i=[];for(const n of t){const o=e.findIndex(l=>l.field===n);o>=0&&(s.push(o),i.push(n))}this.$eR.applyAutoMerge(this._data.getData(),s,i),this._scheduler.submit(F.REPAINT_VISIBLE)}clearMerge(){this.$eR.clear(),this._scheduler.submit(F.REPAINT_VISIBLE)}freezeRows(t){}groupBy(t){const e=this.$B.mkCtx("groupBy",[t]);this.$B.exec("before:groupBy",e)&&(this._grpMgr.groupBy(t),e.result={fields:t},this.$B.exec("after:groupBy",e))}clearGroup(){this._grpMgr.clearGroup()}expandAll(){this._grpMgr.expandAll()}collapseAll(){this._grpMgr.collapseAll()}enableTree(){this._grpMgr.enableTree()}disableTree(){this._grpMgr.disableTree()}expandNodes(t,e=!0){this._grpMgr.expandNodes(t,e)}expandAllNodes(){this._grpMgr.expandAllNodes()}collapseAllNodes(){this._grpMgr.collapseAllNodes()}expandRow(t){this._detailMgr.expandRow(t)}collapseRow(t){this._detailMgr.collapseRow(t)}toggleRow(t){this._detailMgr.toggleRow(t)}isRowExpanded(t){return this._detailMgr.isRowExpanded(t)}collapseAllDetails(){this._detailMgr.collapseAllDetails()}getDetailInstance(t){return this._detailMgr.getDetailInstance(t)}resyncPanelWidths(){this._detailMgr.resyncPanelWidths()}addTreeRow(t,e,s){}exportExcel(t){this._exportMgr.exportExcel(t)}exportCsv(t){this._exportMgr.exportCsv(t)}exportJson(t){this._exportMgr.exportJson(t)}print(t){this._exportMgr.print(t)}setPageSize(t){var e;if(!Number.isInteger(t)||t<1)throw new RangeError(`OpenGrid.setPageSize: size must be an integer >= 1 (got ${t})`);this._options.pageSize=t,(e=this._pagination)==null||e.setPageSize(t)}openFindBar(){this._findMgr.open()}closeFindBar(){this._findMgr.close()}toArray(t=!0){const e=this._data.getData();if(t)return e;const s=this._colLayout.visibleLeaves;return e.map(i=>s.map(n=>i[n.field]))}jumpToRow(t){var e;this._rowMgr.selectSingle(t),(e=this._vs)==null||e.scrollToRow(t),this._scheduler.submit(F.REPAINT_VISIBLE)}jumpToCol(t){var e;(e=this._render)==null||e.revealColumn(this._colLayout.visibleLeaves.findIndex(s=>s.field===t))}getScrollPos(){var t,e;return{x:((t=this._renderer)==null?void 0:t.bodyWrapper.scrollLeft)??0,y:((e=this._renderer)==null?void 0:e.bodyWrapper.scrollTop)??0}}setFooter(t){this._options.footer=t,this.$mR()}getFooterData(){return this._footerMgr.computeValues()}getFooterValue(t){var e;return((e=this._footerMgr.computeValues().find(s=>s._field===t))==null?void 0:e._value)??null}$mR(){this._footerMgr.render()}resize(t,e){t&&(this._container.style.width=`${t}px`),e&&(this._container.style.height=`${e}px`),this.$dM()}setTheme(t){this._container.setAttribute("data-og-theme",t)}setThemeVar(t,e){this._container.style.setProperty(t,e)}setSkin(t){var e;this._options.skin=t,this._container.setAttribute("data-og-skin",t),(e=this.$dh)==null||e.setSkin(t),this._container.style.border=t==="default"?"1px solid var(--og-border-color, #e0e0e0)":this.$dh?this.$dh.border():"1px solid var(--og-border-color, #e0e0e0)",this._renderHeader(),this._scheduler.submit(F.REPAINT_VISIBLE)}getSkin(){return this._options.skin??"default"}setIcon(t,e){var s;this.$dG||(this.$dG=mt.child()),this.$dG.register(t,e);try{(s=this.$bQ)==null||s.strategy("iconResolver",(i,n)=>this.$dG.render(i,n))}catch{}return this}renderIcon(t,e){return(this.$dG??mt).render(t,e)}setLocale(t){var e,s;const i=this.getLocale();(this._locales??(this._locales=st.child())).setActive(t),this._options.locale=t,this._container.setAttribute("lang",(this._locales??st).meta().intlLocale),(e=this._pagination)==null||e.refreshLabels(),(s=this._findMgr)==null||s.refreshLabels(),this.$cz=null,this._renderHeader(),this._scheduler.submit(F.REPAINT_VISIBLE),this.emit("localeChange",{locale:t,prev:i})}getLocale(){return(this._locales??st).active()}setMessage(t,e){return(this._locales??(this._locales=st.child())).setOverride(t,e),this}t(t,e){return(this._locales??st).t(t,e)}setSkinVar(t,e){if(/#[0-9a-fA-F]{3,8}\b/.test(e)||/\b(?:rgba?|hsla?)\(\s*\d/.test(e))throw new Error(`[OpenGrid.setSkinVar] "${t}: ${e}" 에 색 리터럴 — 색은 setThemeVar 축입니다(색⊥형태).`);this._container.style.setProperty(t,e)}setDensity(t){const e=js.resolve(t);e.attr?this._container.setAttribute(e.attr.name,e.attr.value):this._container.removeAttribute("data-og-density");for(const i of Ws)this._container.style.removeProperty(i);this._container.style.removeProperty("--og-row-height");for(const[i,n]of Object.entries(e.tokens))this._container.style.setProperty(i,n);const s=e.tokens["--og-density-row-height"];s!=null&&this._container.style.setProperty("--og-row-height",s),this.$hz??(this.$hz=this._options.rowHeight),this.$hH(s!=null?parseFloat(s):this.$hz),e.requiresRelayout&&this.$dM()}setRowHeight(t){if(!Number.isFinite(t)||t<1)throw new RangeError(`OpenGrid.setRowHeight: px must be a finite number >= 1 (got ${t})`);this.$hz=t,this.$hH(t),this.$dM()}$hH(t){var e,s;this._options.rowHeight=t,(e=this._vs)==null||e.setRowHeight(t),(s=this.$ey)==null||s.setRowHeight(t)}setTexture(t){const e=Us.resolve(t);e.attr?this._container.setAttribute(e.attr.name,e.attr.value):this._container.removeAttribute("data-og-texture");for(const s of Gs)this._container.style.removeProperty(s);for(const[s,i]of Object.entries(e.tokens))this._container.style.setProperty(s,i)}addTrigger(t,e){return this.$B.add(t,e),this}removeTrigger(t,e){return this.$B.remove(t,e),this}clearTriggers(t){return this.$B.clear(t),this}$nz(t,e){return this.$B.mkCtx(t,e)}$nB(t,e){return this.$B.exec(t,e)}destroy(){var t,e,s,i,n,o,l,a,h,c,u,d,g,f,p,v;this.$aG||(this.$aG=!0,(t=Xt.get(this._container))==null||t.delete(this),this._renderer&&pe.unregister(this._renderer.bodyWrapper),this.$B.clear(),(e=this.$bB)==null||e.disconnect(),(s=this._vs)==null||s.destroy(),(i=this._scheduler)==null||i.destroy(),(n=this._render)==null||n.destroy(),(o=this.$cg)==null||o.detach(),this.$cg=null,(l=this._chartMgr)==null||l.destroyCharts(),(a=this._detailMgr)==null||a.destroy(),(h=this._footerMgr)==null||h.destroy(),(c=this.$cz)==null||c.destroy(),(u=this.$ey)==null||u.destroy(),this.$bh&&this._container.removeEventListener("contextmenu",this.$bh),this.$bi&&this._container.removeEventListener("keydown",this.$bi),this.$bh=this.$bi=null,(d=this.$au)==null||d.destroy(),(g=this._wsManager)==null||g.destroy(),(f=this._renderer)==null||f.destroy(),(p=this.$ao)==null||p.remove(),this.$ao=null,this._container.innerHTML="",(v=Xt.get(this._container))!=null&&v.size||this._container.classList.remove("og-container"),this.removeAllListeners())}};Ot._defaultOverrides=[],Ot._defaultStrategies=[],Ot.defaults={strategy(r,t){return Ot.addDefaultStrategy(r,t),Ot}};let $h=Ot;export{ks as D,ve as I,me as L,$h as O,Bs as S,Te as b,Oi as c,mt as i,st as l,fe as p,or as r,Ae as s,B as t};
|
|
98
|
+
//# sourceMappingURL=OpenGrid-CeXt04ho.js.map
|