@toclocoinc/lattice-grid 1.71.1 → 1.71.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +1 -1
  3. package/angular/package.json +1 -1
  4. package/docs/API.html +42 -8
  5. package/docs/api/adapters.html +1 -1
  6. package/docs/api/ai.html +1 -1
  7. package/docs/api/alarms.html +1 -1
  8. package/docs/api/charts.html +39 -5
  9. package/docs/api/data-router.html +1 -1
  10. package/docs/api/gantt.html +1 -1
  11. package/docs/api/grid.html +2 -2
  12. package/docs/api/index.html +2 -2
  13. package/docs/api/kanban.html +1 -1
  14. package/docs/api/kpi.html +1 -1
  15. package/docs/api/layout.html +1 -1
  16. package/docs/api/mock-socket.html +1 -1
  17. package/docs/api/tabs.html +1 -1
  18. package/docs/api/types.html +1 -1
  19. package/docs/api-detail.html +4 -4
  20. package/docs/warnings.json +13 -2
  21. package/lattice-grid.d.ts +31 -7
  22. package/lattice-grid.esm.min.js +3 -3
  23. package/lattice-grid.min.cjs +3 -3
  24. package/lattice-grid.min.js +3 -3
  25. package/modules/ai.d.ts +1 -1
  26. package/modules/ai.esm.min.js +2 -2
  27. package/modules/ai.min.cjs +2 -2
  28. package/modules/ai.min.js +2 -2
  29. package/modules/alarms.d.ts +1 -1
  30. package/modules/alarms.esm.min.js +2 -2
  31. package/modules/alarms.min.cjs +2 -2
  32. package/modules/alarms.min.js +2 -2
  33. package/modules/angular.d.ts +1 -1
  34. package/modules/angular.esm.min.js +2 -2
  35. package/modules/angular.min.cjs +2 -2
  36. package/modules/angular.min.js +2 -2
  37. package/modules/chart-alluvial.d.ts +1 -1
  38. package/modules/chart-alluvial.esm.min.js +1 -1
  39. package/modules/chart-alluvial.min.cjs +1 -1
  40. package/modules/chart-alluvial.min.js +1 -1
  41. package/modules/chart-arc.d.ts +1 -1
  42. package/modules/chart-arc.esm.min.js +1 -1
  43. package/modules/chart-arc.min.cjs +1 -1
  44. package/modules/chart-arc.min.js +1 -1
  45. package/modules/chart-bubblemap.d.ts +1 -1
  46. package/modules/chart-bubblemap.esm.min.js +1 -1
  47. package/modules/chart-bubblemap.min.cjs +1 -1
  48. package/modules/chart-bubblemap.min.js +1 -1
  49. package/modules/chart-bump.d.ts +1 -1
  50. package/modules/chart-bump.esm.min.js +1 -1
  51. package/modules/chart-bump.min.cjs +1 -1
  52. package/modules/chart-bump.min.js +1 -1
  53. package/modules/chart-calendar.d.ts +1 -1
  54. package/modules/chart-calendar.esm.min.js +1 -1
  55. package/modules/chart-calendar.min.cjs +1 -1
  56. package/modules/chart-calendar.min.js +1 -1
  57. package/modules/chart-decomposition.d.ts +1 -1
  58. package/modules/chart-decomposition.esm.min.js +1 -1
  59. package/modules/chart-decomposition.min.cjs +1 -1
  60. package/modules/chart-decomposition.min.js +1 -1
  61. package/modules/chart-diverging.d.ts +1 -1
  62. package/modules/chart-diverging.esm.min.js +1 -1
  63. package/modules/chart-diverging.min.cjs +1 -1
  64. package/modules/chart-diverging.min.js +1 -1
  65. package/modules/chart-dumbbell.d.ts +1 -1
  66. package/modules/chart-dumbbell.esm.min.js +1 -1
  67. package/modules/chart-dumbbell.min.cjs +1 -1
  68. package/modules/chart-dumbbell.min.js +1 -1
  69. package/modules/chart-fan.d.ts +1 -1
  70. package/modules/chart-fan.esm.min.js +1 -1
  71. package/modules/chart-fan.min.cjs +1 -1
  72. package/modules/chart-fan.min.js +1 -1
  73. package/modules/chart-hexbin.d.ts +1 -1
  74. package/modules/chart-hexbin.esm.min.js +1 -1
  75. package/modules/chart-hexbin.min.cjs +1 -1
  76. package/modules/chart-hexbin.min.js +1 -1
  77. package/modules/chart-hexmap.d.ts +1 -1
  78. package/modules/chart-hexmap.esm.min.js +1 -1
  79. package/modules/chart-hexmap.min.cjs +1 -1
  80. package/modules/chart-hexmap.min.js +1 -1
  81. package/modules/chart-icicle.d.ts +1 -1
  82. package/modules/chart-icicle.esm.min.js +1 -1
  83. package/modules/chart-icicle.min.cjs +1 -1
  84. package/modules/chart-icicle.min.js +1 -1
  85. package/modules/chart-markermap.d.ts +1 -1
  86. package/modules/chart-markermap.esm.min.js +1 -1
  87. package/modules/chart-markermap.min.cjs +1 -1
  88. package/modules/chart-markermap.min.js +1 -1
  89. package/modules/chart-parallel.d.ts +1 -1
  90. package/modules/chart-parallel.esm.min.js +1 -1
  91. package/modules/chart-parallel.min.cjs +1 -1
  92. package/modules/chart-parallel.min.js +1 -1
  93. package/modules/chart-ridgeline.d.ts +1 -1
  94. package/modules/chart-ridgeline.esm.min.js +1 -1
  95. package/modules/chart-ridgeline.min.cjs +1 -1
  96. package/modules/chart-ridgeline.min.js +1 -1
  97. package/modules/chart-roc.d.ts +1 -1
  98. package/modules/chart-roc.esm.min.js +1 -1
  99. package/modules/chart-roc.min.cjs +1 -1
  100. package/modules/chart-roc.min.js +1 -1
  101. package/modules/chart-slope.d.ts +1 -1
  102. package/modules/chart-slope.esm.min.js +1 -1
  103. package/modules/chart-slope.min.cjs +1 -1
  104. package/modules/chart-slope.min.js +1 -1
  105. package/modules/chart-splom.d.ts +1 -1
  106. package/modules/chart-splom.esm.min.js +1 -1
  107. package/modules/chart-splom.min.cjs +1 -1
  108. package/modules/chart-splom.min.js +1 -1
  109. package/modules/chart-waffle.d.ts +1 -1
  110. package/modules/chart-waffle.esm.min.js +1 -1
  111. package/modules/chart-waffle.min.cjs +1 -1
  112. package/modules/chart-waffle.min.js +1 -1
  113. package/modules/charts.d.ts +1 -1
  114. package/modules/charts.esm.min.js +13 -9
  115. package/modules/charts.esm.min.js.map +2 -2
  116. package/modules/charts.min.cjs +141 -137
  117. package/modules/charts.min.js +141 -137
  118. package/modules/charts.min.js.map +2 -2
  119. package/modules/data-router.d.ts +1 -1
  120. package/modules/data-router.esm.min.js +2 -2
  121. package/modules/data-router.min.cjs +2 -2
  122. package/modules/data-router.min.js +2 -2
  123. package/modules/devtools.d.ts +1 -1
  124. package/modules/devtools.esm.min.js +1 -1
  125. package/modules/devtools.min.cjs +1 -1
  126. package/modules/devtools.min.js +1 -1
  127. package/modules/dhtmlx-compat.d.ts +1 -1
  128. package/modules/dhtmlx-compat.esm.min.js +2 -2
  129. package/modules/dhtmlx-compat.min.cjs +2 -2
  130. package/modules/dhtmlx-compat.min.js +2 -2
  131. package/modules/gantt.d.ts +1 -1
  132. package/modules/gantt.esm.min.js +2 -2
  133. package/modules/gantt.min.cjs +2 -2
  134. package/modules/gantt.min.js +2 -2
  135. package/modules/geo-europe-nuts.d.ts +1 -1
  136. package/modules/geo-europe-nuts.esm.min.js +1 -1
  137. package/modules/geo-europe-nuts.min.cjs +1 -1
  138. package/modules/geo-europe-nuts.min.js +1 -1
  139. package/modules/geo-uk.d.ts +1 -1
  140. package/modules/geo-uk.esm.min.js +1 -1
  141. package/modules/geo-uk.min.cjs +1 -1
  142. package/modules/geo-uk.min.js +1 -1
  143. package/modules/geo-us-states.d.ts +1 -1
  144. package/modules/geo-us-states.esm.min.js +1 -1
  145. package/modules/geo-us-states.min.cjs +1 -1
  146. package/modules/geo-us-states.min.js +1 -1
  147. package/modules/geo-world-110m.d.ts +1 -1
  148. package/modules/geo-world-110m.esm.min.js +1 -1
  149. package/modules/geo-world-110m.min.cjs +1 -1
  150. package/modules/geo-world-110m.min.js +1 -1
  151. package/modules/geo-world-50m.d.ts +1 -1
  152. package/modules/geo-world-50m.esm.min.js +1 -1
  153. package/modules/geo-world-50m.min.cjs +1 -1
  154. package/modules/geo-world-50m.min.js +1 -1
  155. package/modules/htmx.d.ts +1 -1
  156. package/modules/htmx.esm.min.js +3 -3
  157. package/modules/htmx.min.cjs +3 -3
  158. package/modules/htmx.min.js +3 -3
  159. package/modules/kanban.d.ts +1 -1
  160. package/modules/kanban.esm.min.js +2 -2
  161. package/modules/kanban.min.cjs +2 -2
  162. package/modules/kanban.min.js +2 -2
  163. package/modules/kpi.d.ts +1 -1
  164. package/modules/kpi.esm.min.js +2 -2
  165. package/modules/kpi.min.cjs +2 -2
  166. package/modules/kpi.min.js +2 -2
  167. package/modules/layout.d.ts +1 -1
  168. package/modules/layout.esm.min.js +2 -2
  169. package/modules/layout.min.cjs +2 -2
  170. package/modules/layout.min.js +2 -2
  171. package/modules/mock-socket.d.ts +1 -1
  172. package/modules/mock-socket.esm.min.js +1 -1
  173. package/modules/mock-socket.min.cjs +1 -1
  174. package/modules/mock-socket.min.js +1 -1
  175. package/modules/react.d.ts +1 -1
  176. package/modules/react.esm.min.js +2 -2
  177. package/modules/react.min.cjs +2 -2
  178. package/modules/react.min.js +2 -2
  179. package/modules/svelte.d.ts +1 -1
  180. package/modules/svelte.esm.min.js +2 -2
  181. package/modules/svelte.min.cjs +2 -2
  182. package/modules/svelte.min.js +2 -2
  183. package/modules/tabs.d.ts +1 -1
  184. package/modules/tabs.esm.min.js +2 -2
  185. package/modules/tabs.min.cjs +2 -2
  186. package/modules/tabs.min.js +2 -2
  187. package/modules/vue.d.ts +1 -1
  188. package/modules/vue.esm.min.js +2 -2
  189. package/modules/vue.min.cjs +2 -2
  190. package/modules/vue.min.js +2 -2
  191. package/modules/webcomponent.d.ts +1 -1
  192. package/modules/webcomponent.esm.min.js +3 -3
  193. package/modules/webcomponent.min.cjs +3 -3
  194. package/modules/webcomponent.min.js +3 -3
  195. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
1
  /*!
2
- * Lattice Grid 1.71.1, react module
2
+ * Lattice Grid 1.71.3, react module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
6
- var Le=Object.create(null),Ee=Object.create(null);function ge(c,_){Le[c]=_}function Pe(c){var _=Ee[c];if(_)return _;var ee=Object.create(null);Ee[c]=ee;var re=Le[c];if(!re)throw new Error("[lattice] missing module: "+c);return re(ee,Pe),ee}ge("packages/core/src/internal/util.js",function(c,_){"use strict";Object.defineProperty(c,"VERSION",{enumerable:!0,get:function(){return x}}),Object.defineProperty(c,"reportedWarnings",{enumerable:!0,get:function(){return o}}),Object.defineProperty(c,"warnOnce",{enumerable:!0,get:function(){return l}}),Object.defineProperty(c,"infoOnce",{enumerable:!0,get:function(){return E}}),Object.defineProperty(c,"resetWarnings",{enumerable:!0,get:function(){return w}}),Object.defineProperty(c,"fail",{enumerable:!0,get:function(){return p}}),Object.defineProperty(c,"invariant",{enumerable:!0,get:function(){return A}}),Object.defineProperty(c,"DEV",{enumerable:!0,get:function(){return k}}),Object.defineProperty(c,"isObject",{enumerable:!0,get:function(){return v}}),Object.defineProperty(c,"isFunction",{enumerable:!0,get:function(){return B}}),Object.defineProperty(c,"isNil",{enumerable:!0,get:function(){return T}}),Object.defineProperty(c,"isBlank",{enumerable:!0,get:function(){return D}}),Object.defineProperty(c,"isCtor",{enumerable:!0,get:function(){return P}}),Object.defineProperty(c,"pathGetter",{enumerable:!0,get:function(){return h}}),Object.defineProperty(c,"pathSetter",{enumerable:!0,get:function(){return V}}),Object.defineProperty(c,"getPath",{enumerable:!0,get:function(){return C}}),Object.defineProperty(c,"setPath",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(c,"humanise",{enumerable:!0,get:function(){return me}}),Object.defineProperty(c,"escapeHtml",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(c,"titleCase",{enumerable:!0,get:function(){return he}}),Object.defineProperty(c,"expand",{enumerable:!0,get:function(){return we}}),Object.defineProperty(c,"toArray",{enumerable:!0,get:function(){return n}}),Object.defineProperty(c,"merge",{enumerable:!0,get:function(){return s}}),Object.defineProperty(c,"mergeRow",{enumerable:!0,get:function(){return m}}),Object.defineProperty(c,"Lru",{enumerable:!0,get:function(){return d}}),Object.defineProperty(c,"collator",{enumerable:!0,get:function(){return y}}),Object.defineProperty(c,"defaultCompare",{enumerable:!0,get:function(){return X}}),Object.defineProperty(c,"now",{enumerable:!0,get:function(){return M}}),Object.defineProperty(c,"nextFrame",{enumerable:!0,get:function(){return z}}),Object.defineProperty(c,"cancelFrame",{enumerable:!0,get:function(){return S}}),Object.defineProperty(c,"frameBatched",{enumerable:!0,get:function(){return O}}),Object.defineProperty(c,"settleDebounce",{enumerable:!0,get:function(){return $}}),Object.defineProperty(c,"whenIdle",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(c,"uid",{enumerable:!0,get:function(){return j}});const ee="1.71.1";async function re(){return ee}const x="1.71.1",H=new Set,oe=2e3;function ae(e){if(H.add(e),H.size>oe){const t=H.values().next().value;t!==void 0&&H.delete(t)}}const Y=[],J=500;function ie(e,t,r){Y.push({key:e,level:t,message:r.map(i=>typeof i=="string"?i:u(i)).join(" "),at:Date.now()}),Y.length>J&&Y.shift()}function u(e){if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch{return String(e)}}function o(){return Y.map(e=>({...e}))}function l(e,...t){H.has(e)||(ae(e),ie(e,"warn",t),console.warn("[lattice]",...t))}function E(e,...t){H.has(e)||(ae(e),ie(e,"info",t),console.info("[lattice]",...t))}function w(){H.clear(),Y.length=0}function p(e,t){const r=new Error(`[lattice] ${e}`);throw t!==void 0&&(r.cause=t),r}function A(e,t){e||p(t)}const k=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function v(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function B(e){return typeof e=="function"}function T(e){return e==null}function D(e){return e==null||e===""}function P(e){return typeof e!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(e))?!0:!!(e.prototype&&Object.getOwnPropertyNames(e.prototype).length>1)}const K=new Map;function h(e){let t=K.get(e);if(t)return t;if(!e.includes("."))t=r=>r?.[e];else{const r=e.split("."),i=r.length;t=R=>{let L=R;for(let b=0;b<i;b++){if(L==null)return;L=L[r[b]]}return L}}return K.set(e,t),t}const N=new Map;function V(e){let t=N.get(e);if(t)return t;if(!e.includes("."))t=(r,i)=>{r!=null&&(r[e]=i)};else{const r=e.split("."),i=r.length-1;t=(R,L)=>{let b=R;for(let f=0;f<i;f++){if(b==null)return;const U=r[f];b[U]==null&&(b[U]={}),b=b[U]}b!=null&&(b[r[i]]=L)}}return N.set(e,t),t}function C(e,t){return h(t)(e)}function Z(e,t,r){V(t)(e,r)}function me(e){return e?(e.includes(".")?e.slice(e.lastIndexOf(".")+1):e).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,r=>r.toUpperCase()):""}const ye={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function pe(e){const t=e==null?"":String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,r=>ye[r]):t}function he(e){return String(e).replace(/\w\S*/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function we(e,t,r){if(e!==void 0)return e===!0?{enabled:!0,...r}:e===!1?{enabled:!1}:v(e)?e:{[t]:e,enabled:!0}}function n(e){return e==null?[]:Array.isArray(e)?e:[e]}const a=Object.freeze(new Set(["__proto__","constructor","prototype"]));function s(e,t){if(!v(e))return v(t)?{...t}:t;if(!v(t))return t===void 0?e:t;const r={...e};for(const i of Object.keys(t)){if(a.has(i))continue;const R=t[i];R!==void 0&&(r[i]=v(R)&&v(r[i])?s(r[i],R):R)}return r}function m(e,t){if(!v(e)||!v(t)||e===t)return t;const r=Object.create(Object.getPrototypeOf(e));return Object.assign(r,e,t),r}class d{#n;#e=new Map;#t;constructor(t=256,r=null){this.#n=t,this.#t=r}get size(){return this.#e.size}get max(){return this.#n}set max(t){this.#n=t,this.#r()}has(t){return this.#e.has(t)}get(t){const r=this.#e;if(!r.has(t))return;const i=r.get(t);return r.delete(t),r.set(t,i),i}peek(t){return this.#e.get(t)}set(t,r){const i=this.#e;return i.has(t)&&i.delete(t),i.set(t,r),this.#r(),r}delete(t){const r=this.#e.get(t);return this.#e.delete(t)&&this.#t&&this.#t(r,t),r}clear(){if(this.#t)for(const[t,r]of this.#e)this.#t(r,t);this.#e.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}#r(){const t=this.#e;for(;t.size>this.#n;){const r=t.keys().next().value,i=t.get(r);t.delete(r),this.#t&&this.#t(i,r)}}}const g=new Map;function y(e,t){const r=`${e||""}|${t?JSON.stringify(t):""}`;let i=g.get(r);return i||(i=new Intl.Collator(e||void 0,{numeric:!0,sensitivity:"variant",...t}),g.set(r,i)),i}function X(e,t){if(e===t)return 0;if(e==null)return 1;if(t==null)return-1;if(typeof e=="number"&&typeof t=="number")return Number.isNaN(e)?Number.isNaN(t)?0:1:Number.isNaN(t)||e<t?-1:e>t?1:0;const r=String(e),i=String(t);return r<i?-1:r>i?1:0}function M(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const F=typeof requestAnimationFrame=="function";function z(e){return F?requestAnimationFrame(e):setTimeout(()=>e(M()),16)}function S(e){e!=null&&(F?cancelAnimationFrame(e):clearTimeout(e))}function O(e){let t=null,r=null;const i=()=>{t=null;const L=r;r=null,e(...L||[])},R=(...L)=>{r=L,t===null&&(t=z(i))};return R.cancel=()=>{S(t),t=null,r=null},R.flush=()=>{t!==null&&(S(t),i())},R}function $(e,t){let r=null,i=null;const R=()=>{if(r=null,i===null)return;const f=i;i=null,e(...f),L()},L=()=>{r=setTimeout(R,t),typeof r?.unref=="function"&&r.unref()},b=(...f)=>{r===null?(e(...f),L()):(i=f,clearTimeout(r),L())};return b.flush=()=>{if(r!==null&&clearTimeout(r),r=null,i===null)return;const f=i;i=null,e(...f)},b.cancel=()=>{r!==null&&clearTimeout(r),r=null,i=null},b.pending=()=>r!==null||i!==null,b}function Q(e,t=50){return typeof requestIdleCallback=="function"?requestIdleCallback(e,{timeout:t}):setTimeout(()=>e({timeRemaining:()=>0,didTimeout:!0}),1)}let G=0;function j(e="l"){return`${e}${(++G).toString(36)}`}}),ge("packages/modules/shared/adapter.js",function(c,_){"use strict";Object.defineProperty(c,"EVENT_NAMES",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(c,"handlerName",{enumerable:!0,get:function(){return x}}),Object.defineProperty(c,"dashedName",{enumerable:!0,get:function(){return H}}),Object.defineProperty(c,"CONFIG_KEY_ALIASES",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(c,"aliasConfigKey",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(c,"isHandlerProp",{enumerable:!0,get:function(){return J}}),Object.defineProperty(c,"partition",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(c,"createGridController",{enumerable:!0,get:function(){return u}});const ee=Object.freeze(["ready","destroy","render:first","render:done","config:changed","licence:changed","model:changed","rows:changed","rows:queued","rows:deferred","rows:paused","rows:resumed","row:received","row:sent","row:copied","row:moved","source:error","source:total","stream:chunk","stream:end","stream:evicted","rowDrag:started","rowDrag:moved","rowDrag:left","rowDrag:ended","cell:changed","cell:pending","cell:confirmed","cell:reverted","cell:conflict","cell:clicked","cell:dblclicked","cell:contextmenu","cell:mouseover","cell:mouseout","cell:mousedown","cell:mouseup","cell:edit:start","cell:edit:end","row:edit:start","row:edit:end","row:clicked","row:dblclicked","row:pending","row:confirmed","row:reverted","row:conflict","form:opened","form:closed","form:saved","form:error","sort:changed","filter:changed","group:toggled","facet:computed","facet:filtered","facet:expanded","facet:failed","column:moved","column:resized","column:visible","column:pinned","column:grouped","column:pivoted","column:filter:open","column:profile:open","column:menu:open","columns:changed","columns:tagged","columngroup:changed","header:contextmenu","pivot:drill","selection:changed","range:changed","clipboard:copy","page:changed","scroll","scroll:end","size:changed","detail:toggled","toolpanel:focus","highlight:changed","find:changed","tree:loading","tree:loaded","tree:loadFailed","tree:loadAborted","state:changed","state:reset","history:changed","history:applied","views:changed","view:applied","view:saved","view:removed","view:renamed","view:default","formatting:changed","redaction:changed","permissions:changed","presentation:changed","presentation:started","presentation:ended","presentation:view","presentation:scale","presentation:spotlight","presentation:captured","comment:added","comment:edited","comment:deleted","comment:failed","comment:resolved","comment:unresolved","comment:threadOpened","comment:threadClosed","comment:indexLoaded","presence:published","presence:joined","presence:updated","presence:left","presence:failed","presence:lockRefused","diff:changed","diff:swapped","timeline:attached","timeline:detached","timeline:seek","timeline:seeking","annotation:changed","validation:failed","validation:cleared","export:progress","export:request","export:done","shortcuts:opened","shortcuts:closed","print:before","print:after","beforeEdit","beforeSort","beforeFilter","beforeColumnMove","beforeColumnResize","beforeColumnHide","beforeSelect","beforeRowAdd","beforeDelete","beforeRowMove","beforeGroup","beforeRowReceive","edit:cancelled","sort:cancelled","filter:cancelled","columnMove:cancelled","columnResize:cancelled","columnHide:cancelled","selection:cancelled","rowAdd:cancelled","delete:cancelled","rowMove:cancelled","group:cancelled","rowReceive:cancelled"]),re=Object.freeze({sort:(o,l)=>o.sort.set(l||[]),filters:(o,l)=>o.filters.set(l||null),quickFilter:(o,l)=>{if(l&&typeof l=="object"){o.filters.quick(l.text||"",{mode:l.mode});return}o.filters.quick(typeof l=="string"?l:"")},selectedKeys:(o,l)=>o.selection.set(Array.isArray(l)?l:[])});function x(o){return`on${String(o).split(":").map(E=>E.charAt(0).toUpperCase()+E.slice(1)).join("")}`}function H(o){return String(o).replace(/:/g,"-")}const oe=Object.freeze({"row-key":"rowKey","row-height":"rowHeight","header-height":"headerHeight","auto-height":"autoHeight"});function ae(o){return Object.hasOwn(oe,o)?oe[o]:o}const Y=Object.freeze(Object.fromEntries(ee.map(o=>[x(o),o])));function J(o){return Object.hasOwn(Y,o)}function ie(o){const l={},E={},w={};for(const[p,A]of Object.entries(o||{})){if(J(p)){w[p]=A;continue}if(Object.hasOwn(re,p)){E[p]=A;continue}l[p]=A}return{config:l,imperative:E,handlers:w}}function u(o){const l=o.createGrid;if(typeof l!="function")throw new TypeError("createGridController needs createGrid; pass it in from the grid package.");const E=ie(o.props||{}),w=l(o.element,{...E.config});let p=E.handlers,A=E.config,k={};const v=D=>{if(!D||typeof D.type!="string")return;const P=p[x(D.type)];typeof P=="function"&&P(D)},B=w.on("*",v);for(const[D,P]of Object.entries(E.imperative))P!==void 0&&(re[D](w,P),k[D]=P);let T=!1;return{grid:w,update(D){if(T)return;const P=ie(D||{});p=P.handlers;const K={};for(const[h,N]of Object.entries(P.config))Object.is(A[h],N)||(K[h]=N);for(const h of Object.keys(A))Object.hasOwn(P.config,h)||(K[h]=void 0);Object.keys(K).length&&w.setAll(K),A=P.config;for(const[h,N]of Object.entries(re)){const V=P.imperative[h];Object.is(k[h],V)||V===void 0&&!Object.hasOwn(k,h)||(N(w,V),k[h]=V)}},destroy(){T||(T=!0,B(),w.destroy())}}}}),ge("packages/modules/react/viewers.js",function(c,_){"use strict";Object.defineProperty(c,"VIEWER_EVENTS",{enumerable:!0,get:function(){return x}}),Object.defineProperty(c,"VIEWER_APPLY",{enumerable:!0,get:function(){return H}}),Object.defineProperty(c,"VIEWER_BULK_UPDATE",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(c,"viewerHandlerName",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(c,"partitionViewerProps",{enumerable:!0,get:function(){return J}}),Object.defineProperty(c,"createViewerController",{enumerable:!0,get:function(){return ie}});const re=_("packages/core/src/internal/util.js").warnOnce,x=Object.freeze({kpi:Object.freeze(["tile:click","tile:dblclick","tile:contextmenu","node:toggle","change","tile:status"]),kanban:Object.freeze(["card:click","card:dblclick","card:contextmenu","card:move","card:reverted","card:confirmed","selection:changed","column:collapse","card:add","drag:start","drag:end","swimlane:collapse","swimlane:reorder","column:reorder","filter:changed","sprint:changed","epic:changed","card:expand","card:drill","card:edit","card:sla","beforeMove","beforeAdd","beforeEdit","beforeLaneReorder","beforeColumnReorder","beforeColumnChange","move:cancelled","add:cancelled","edit:cancelled","laneReorder:cancelled","columnReorder:cancelled","columnChange:cancelled"]),tabs:Object.freeze(["beforeTabChange","tab:changed","tabChange:cancelled"]),chart:Object.freeze(["click","hover","leave","draw","legend"]),gantt:Object.freeze(["schedule","error"]),layout:Object.freeze(["layout:changed","window:moved","window:resized","window:closed","beforeWindowClose","windowClose:cancelled"]),router:Object.freeze(["metrics"])}),H=Object.freeze({kpi:Object.freeze({rows:(u,o)=>u.setRows(Array.isArray(o)?o:[])}),kanban:Object.freeze({rows:(u,o)=>u.setRows(Array.isArray(o)?o:[]),quickFilter:(u,o)=>u.setQuickFilter(typeof o=="string"?o:""),sprint:(u,o)=>u.setSprint(o),epic:(u,o)=>u.setEpic(o),loading:(u,o)=>u.setLoading(!!o),error:(u,o)=>u.setError(o??null)}),gantt:Object.freeze({tasks:(u,o)=>u.setTasks(Array.isArray(o)?o:[]),dependencies:(u,o)=>u.setDependencies(Array.isArray(o)?o:[])}),tabs:Object.freeze({active:(u,o)=>{typeof o=="string"&&u.activate(o)}}),chart:Object.freeze({}),layout:Object.freeze({})}),oe=Object.freeze({chart:"update"});function ae(u){return`on${String(u).split(":").map(l=>l.charAt(0).toUpperCase()+l.slice(1)).join("")}`}const Y=Object.freeze(Object.fromEntries(Object.entries(x).map(([u,o])=>[u,Object.freeze(Object.fromEntries(o.map(l=>[ae(l),l])))])));function J(u,o){const l=Y[u]||{},E=H[u]||{},w={},p={},A={};for(const[k,v]of Object.entries(o||{})){if(Object.hasOwn(l,k)){A[k]=v;continue}if(Object.hasOwn(E,k)){p[k]=v,w[k]=v;continue}w[k]=v}return{config:w,live:p,handlers:A}}function ie(u){const o=String(u.viewer),l=u.mount,E=u.name||o;if(typeof l!="function")throw new TypeError(`createViewerController needs a mount factory for "${o}"; pass the module's own factory in, e.g. { createKPI } from lattice-grid/modules/kpi.`);const w=J(o,u.props||{}),p=l(u.element,{...w.config});if(!p||typeof p!="object")throw new TypeError(`the ${E} factory returned no instance; nothing can be driven.`);let A=w.handlers,k=w.config;const v={...w.live},B=[];if(typeof p.on=="function")for(const K of x[o]||[]){const h=ae(K),N=p.on(K,V=>{const C=A[h];typeof C=="function"&&C(V)});typeof N=="function"&&B.push(N)}const T=oe[o],D=H[o]||{};let P=!1;return{instance:p,update(K){if(P)return;const h=J(o,K||{});A=h.handlers;const N={};for(const[C,Z]of Object.entries(h.config))Object.is(k[C],Z)||(N[C]=Z);if(k=h.config,!Object.keys(N).length)return;const V=[];for(const C of Object.keys(N)){const Z=D[C];if(Z){Z(p,N[C]),v[C]=N[C];continue}T&&typeof p[T]=="function"||V.push(C)}if(T&&typeof p[T]=="function"){const C={};for(const Z of Object.keys(N))D[Z]||(C[Z]=N[Z]);Object.keys(C).length&&p[T](C)}V.length&&re(`react.viewer.${o}.mountOnly.${V.join(".")}`,`${E}: ${V.map(C=>`\`${C}\``).join(", ")} changed, but ${E} takes ${V.length===1?"it":"them"} only when the viewer is created. Nothing was applied and the viewer was NOT rebuilt — rebuilding it silently would throw away scroll position, selection and expansion. Give the component a \`key\` that changes when this must take effect, so the rebuild is yours and visible, or drive the instance through the ref.`)},destroy(){if(!P){P=!0;for(const K of B)try{K()}catch{}B.length=0,typeof p.destroy=="function"&&p.destroy()}}}}}),ge("packages/modules/react/index.js",function(c,_){"use strict";Object.defineProperty(c,"EVENT_NAMES",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(c,"handlerName",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(c,"VIEWER_EVENTS",{enumerable:!0,get:function(){return J}}),Object.defineProperty(c,"VIEWER_APPLY",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(c,"viewerHandlerName",{enumerable:!0,get:function(){return u}}),Object.defineProperty(c,"createViewerController",{enumerable:!0,get:function(){return o}}),Object.defineProperty(c,"DEFAULT_GRID_NAME",{enumerable:!0,get:function(){return w}}),Object.defineProperty(c,"createLatticeGrid",{enumerable:!0,get:function(){return P}}),Object.defineProperty(c,"createLatticeGridContext",{enumerable:!0,get:function(){return K}}),Object.defineProperty(c,"createLatticeViewer",{enumerable:!0,get:function(){return h}}),Object.defineProperty(c,"createLatticeKPI",{enumerable:!0,get:function(){return N}}),Object.defineProperty(c,"createLatticeChart",{enumerable:!0,get:function(){return V}}),Object.defineProperty(c,"createLatticeKanban",{enumerable:!0,get:function(){return C}}),Object.defineProperty(c,"createLatticeGantt",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(c,"createLatticeLayout",{enumerable:!0,get:function(){return me}}),Object.defineProperty(c,"createLatticeTabs",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(c,"createLatticeRouter",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(c,"createLatticeReact",{enumerable:!0,get:function(){return he}}),Object.defineProperty(c,"default",{enumerable:!0,get:function(){return we}});const re=_("packages/core/src/internal/util.js").warnOnce,x=_("packages/modules/shared/adapter.js"),H=x.createGridController,oe=x.EVENT_NAMES,ae=x.handlerName,Y=_("packages/modules/react/viewers.js"),J=Y.VIEWER_EVENTS,ie=Y.VIEWER_APPLY,u=Y.viewerHandlerName,o=Y.createViewerController,l=new Set(["className","style","id"]),E=new Set(["onGridReady","onGridDestroy","rowUpdates","predicates","name","route","routeOptions"]),w="default",p=new WeakMap;function A(n){let a=p.get(n);return a||(a=n.createContext(null),a.displayName="LatticeGridContext",p.set(n,a)),a}const k=new WeakMap;function v(n){let a=k.get(n);return a||(a=n.createContext(null),a.displayName="LatticeRouterContext",k.set(n,a)),a}function B(n,a){if(!n||typeof n.createElement!="function")throw new TypeError(`${a} needs React: ${a}({ React, … }).`)}function T(n,a){const s={},m={},d={};for(const[g,y]of Object.entries(n||{}))l.has(g)?s[g]=y:a.has(g)?m[g]=y:d[g]=y;return{host:s,own:m,rest:d}}function D(n,a,s){const m=a&&typeof a=="object"?a:{},d=s&&typeof s=="object"?s:{};for(const[g,y]of Object.entries(m))Object.is(d[g],y)||n.filters.where(g,typeof y=="function"?y:null);for(const g of Object.keys(d))Object.hasOwn(m,g)||n.filters.where(g,null)}function P(n){const a=n&&n.React,s=n&&n.createGrid;if(B(a,"createLatticeGrid"),typeof s!="function")throw new TypeError("createLatticeGrid needs createGrid: createLatticeGrid({ React, createGrid }).");const{createElement:m,useRef:d,useEffect:g,useContext:y,useImperativeHandle:X,forwardRef:M}=a,F=typeof a.createContext=="function"&&typeof y=="function",z=F?A(a):null,S=F?v(a):null,O=($,Q)=>{const G=d(null),j=d(null),e=d($);e.current=$;const t=d({rowUpdates:void 0,predicates:void 0}),r=F?y(z):null,i=d(r);i.current=r;const R=F?y(S):null,L=d(R);L.current=R,g(()=>{const f=G.current;if(!f)return;const U=e.current,W=T(U,E),te=H({createGrid:s,element:f,props:W.rest});j.current=te;const{grid:q}=te,fe=typeof W.own.name=="string"?W.own.name:w;W.own.predicates&&(D(q,W.own.predicates,{}),t.current.predicates=W.own.predicates),i.current&&typeof i.current.publish=="function"&&i.current.publish(fe,q);const ne=L.current,ue=W.own.route;return ne&&ue!==void 0&&typeof ne.attach=="function"&&ne.attach(q,ue,W.own.routeOptions||{}),typeof W.own.onGridReady=="function"&&W.own.onGridReady(q),()=>{j.current=null;const ce=e.current;if(typeof ce.onGridDestroy=="function"&&ce.onGridDestroy(),ne&&typeof ne.detach=="function")try{ne.detach(q)}catch{}i.current&&typeof i.current.publish=="function"&&i.current.publish(fe,null),t.current={rowUpdates:void 0,predicates:void 0},te.destroy()}},[]),g(()=>{const f=j.current;if(!f)return;const U=T($,E);f.update(U.rest);const{grid:W}=f;Object.is(t.current.predicates,U.own.predicates)||(D(W,U.own.predicates,t.current.predicates),t.current.predicates=U.own.predicates);const te=U.own.rowUpdates;te&&!Object.is(t.current.rowUpdates,te)&&(t.current.rowUpdates=te,W.rows.apply(te))}),X(Q,()=>({get grid(){return j.current?j.current.grid:null}}),[]);const{host:b}=T($,E);return m("div",{...b,ref:G})};return O.displayName="LatticeGrid",typeof M=="function"?M(O):O}function K(n){const a=n&&n.React;if(B(a,"createLatticeGridContext"),typeof a.createContext!="function")throw new TypeError("createLatticeGridContext needs a React with createContext.");const{createElement:s,useState:m,useCallback:d,useMemo:g,useContext:y}=a,X=A(a),M=z=>{const[S,O]=m(()=>({})),$=d((G,j)=>{O(e=>{if(Object.is(e[G],j))return e;const t={...e};return j==null?delete t[G]:t[G]=j,t})},[]),Q=g(()=>({grids:S,publish:$}),[S,$]);return s(X.Provider,{value:Q},z.children)};return M.displayName="LatticeGridProvider",{LatticeGridProvider:M,useLatticeGrid:(z=w)=>{const S=y(X);return S&&S.grids?S.grids[z]??null:null}}}function h(n){const a=n&&n.React;B(a,"createLatticeViewer");const s=String(n.viewer||""),m=n.mount,d=n.name||`Lattice${s.charAt(0).toUpperCase()}${s.slice(1)}`,g=Array.isArray(n.requires)?n.requires:[],y=n.fromContext||null;if(typeof m!="function")throw new TypeError(`${d} needs a mount factory: createLatticeViewer({ React, mount }).`);if(!Object.hasOwn(J,s))throw new TypeError(`createLatticeViewer: "${s}" is not a viewer this adapter knows; expected one of ${Object.keys(J).join(", ")}.`);const{createElement:X,useRef:M,useEffect:F,useContext:z,useImperativeHandle:S,forwardRef:O}=a,$=typeof a.createContext=="function"&&typeof z=="function",Q=$?A(a):null,G=new Set(["gridName","onReady","onDestroy"]),j=(e,t)=>{const r=M(null),i=M(null),R=M(e),L=$?z(Q):null,b=y&&L&&L.grids?L.grids[typeof e.gridName=="string"?e.gridName:w]??null:null,f=y&&e[y]===void 0&&b?{...e,[y]:b}:e;R.current=f;const W=(y&&!g.includes(y)?[...g,y]:g).map(q=>f[q]);F(()=>{const q=r.current;if(!q)return;const fe=R.current;if(g.some(ce=>fe[ce]===null||fe[ce]===void 0))return;const ne=T(fe,G),ue=o({viewer:s,mount:m,element:q,props:ne.rest,name:d});return i.current=ue,typeof ne.own.onReady=="function"&&ne.own.onReady(ue.instance),()=>{i.current=null;const ce=R.current;typeof ce.onDestroy=="function"&&ce.onDestroy(),ue.destroy()}},W),F(()=>{const q=i.current;q&&q.update(T(R.current,G).rest)}),S(t,()=>({get instance(){return i.current?i.current.instance:null}}),[]);const{host:te}=T(f,G);return X("div",{...te,ref:r})};return j.displayName=d,typeof O=="function"?O(j):j}function N(n){const a=n&&n.createKPI;if(typeof a!="function")throw new TypeError("createLatticeKPI needs createKPI: createLatticeKPI({ React, createKPI }).");return h({React:n.React,viewer:"kpi",name:"LatticeKPI",mount:(s,m)=>a(s,m),fromContext:"grid"})}function V(n){const a=n&&n.createChart;if(typeof a!="function")throw new TypeError("createLatticeChart needs createChart: createLatticeChart({ React, createChart }).");return h({React:n.React,viewer:"chart",name:"LatticeChart",mount:(s,m)=>a({...m,container:s}),requires:["grid"],fromContext:"grid"})}function C(n){const a=n&&n.createKanban;if(typeof a!="function")throw new TypeError("createLatticeKanban needs createKanban: createLatticeKanban({ React, createKanban }).");return h({React:n.React,viewer:"kanban",name:"LatticeKanban",mount:(s,m)=>a(s,m),fromContext:"grid"})}function Z(n){const a=n&&n.createGantt;if(typeof a!="function")throw new TypeError("createLatticeGantt needs createGantt: createLatticeGantt({ React, createGantt }).");return h({React:n.React,viewer:"gantt",name:"LatticeGantt",mount:(s,m)=>a({...m,element:s})})}function me(n){const a=n&&n.createLayout;if(typeof a!="function")throw new TypeError("createLatticeLayout needs createLayout: createLatticeLayout({ React, createLayout }).");return h({React:n.React,viewer:"layout",name:"LatticeLayout",mount:(s,m)=>a(s,m)})}function ye(n){const a=n&&n.React,s=n&&n.ReactDOM,m=n&&n.createTabs;if(B(a,"createLatticeTabs"),!s||typeof s.createPortal!="function")throw new TypeError("createLatticeTabs needs react-dom for createPortal: createLatticeTabs({ React, ReactDOM, createTabs }) with ReactDOM from 'react-dom'.");if(typeof m!="function")throw new TypeError("createLatticeTabs needs createTabs: createLatticeTabs({ React, ReactDOM, createTabs }).");const{createElement:d,Fragment:g,useRef:y,useEffect:X,useState:M,useImperativeHandle:F,forwardRef:z}=a,S=(O,$)=>{const Q=y(null),G=y(null),j=y(O);j.current=O;const[e,t]=M(()=>({})),r=y(null);X(()=>{const b=Q.current;if(!b)return;const f=j.current,{host:U,own:W,rest:te}=T(f,new Set(["tabs","active"])),q=Array.isArray(f.tabs)?f.tabs:[],fe={},ne=q.map(de=>{const se=de;if(se.content===void 0)return se;const{content:Oe,...je}=se;return{...je,view:be=>(fe[se.id]=be,t(le=>le[se.id]===be?le:{...le,[se.id]:be}),{destroy(){t(le=>{if(!Object.hasOwn(le,se.id))return le;const Re={...le};return delete Re[se.id],Re})}})}}),ue=m(b,{...te,tabs:ne,createGrid:n.createGrid||(()=>{throw new Error("[lattice] LatticeTabs: a tab has no `content` and no `createGrid` was injected, so there is nothing to build it with. Give the tab a React `content`, or pass createGrid into createLatticeTabs.")}),...typeof f.active=="string"?{active:f.active}:{}});G.current=ue,r.current=f.tabs;const ce=[];for(const de of J.tabs){const se=u(de),Oe=ue.on(de,je=>{const be=j.current[se];typeof be=="function"&&be(je)});typeof Oe=="function"&&ce.push(Oe)}return()=>{G.current=null;for(const de of ce)try{de()}catch{}ue.destroy(),t({})}},[]),X(()=>{const b=G.current;if(!b)return;const f=O.active;typeof f=="string"&&b.activeId!==f&&b.activate(f),Object.is(r.current,O.tabs)||(r.current=O.tabs,re("react.tabs.mountOnly.tabs","LatticeTabs: `tabs` changed (a label, a badge or a descriptor), but the strip takes it only when created — the module has no way to repaint an existing tab. Nothing was applied and the strip was NOT rebuilt — rebuilding it would lose whichever tab is open and any state its content holds. Give the component a `key` that changes when a genuine rebuild is wanted; a live badge otherwise needs to live in your own render, as `tab.badge` on this component's own props does today."))}),F($,()=>({get instance(){return G.current},get tabs(){return G.current}}),[]);const{host:i}=T(O,new Set(["tabs","active"])),L=(Array.isArray(O.tabs)?O.tabs:[]).filter(b=>b.content!==void 0&&e[b.id]).map(b=>{const f=b,U=typeof f.content=="function"?f.content():f.content;return s.createPortal(U,e[f.id],f.id)});return d(g,null,d("div",{...i,ref:Q}),...L)};return S.displayName="LatticeTabs",typeof z=="function"?z(S):S}function pe(n){const a=n&&n.React,s=n&&n.createDataRouter;if(B(a,"createLatticeRouter"),typeof a.createContext!="function")throw new TypeError("createLatticeRouter needs a React with createContext.");if(typeof s!="function")throw new TypeError("createLatticeRouter needs createDataRouter: createLatticeRouter({ React, createDataRouter }).");const{createElement:m,useState:d,useEffect:g,useRef:y,useContext:X}=a,M=v(a),F=O=>{const[$,Q]=d(null),G=y(O);return g(()=>{const j=s(G.current||{});return Q(j),()=>{Q(null),j.destroy()}},[]),$},z=O=>m(M.Provider,{value:O.router??null},O.children);return z.displayName="LatticeRouterProvider",{useLatticeRouter:F,LatticeRouterProvider:z,useRouter:()=>X(M)}}function he(n){const a=n&&n.React;B(a,"createLatticeReact");const{LatticeGridProvider:s,useLatticeGrid:m}=K({React:a}),d={LatticeGridProvider:s,useLatticeGrid:m};return typeof n.createGrid=="function"&&(d.LatticeGrid=P({React:a,createGrid:n.createGrid})),typeof n.createKPI=="function"&&(d.LatticeKPI=N({React:a,createKPI:n.createKPI})),typeof n.createChart=="function"&&(d.LatticeChart=V({React:a,createChart:n.createChart})),typeof n.createKanban=="function"&&(d.LatticeKanban=C({React:a,createKanban:n.createKanban})),typeof n.createGantt=="function"&&(d.LatticeGantt=Z({React:a,createGantt:n.createGantt})),typeof n.createLayout=="function"&&(d.LatticeLayout=me({React:a,createLayout:n.createLayout})),typeof n.createTabs=="function"&&n.ReactDOM&&(d.LatticeTabs=ye({React:a,ReactDOM:n.ReactDOM,createTabs:n.createTabs,createGrid:n.createGrid})),typeof n.createDataRouter=="function"&&Object.assign(d,pe({React:a,createDataRouter:n.createDataRouter})),d}const we=P});const I=Pe("packages/modules/react/index.js"),Ce=I.EVENT_NAMES,ve=I.handlerName,Ne=I.VIEWER_EVENTS,Te=I.VIEWER_APPLY,Ge=I.viewerHandlerName,Ae=I.createViewerController,ke=I.DEFAULT_GRID_NAME,Se=I.createLatticeGrid,Ie=I.createLatticeGridContext,Ve=I.createLatticeViewer,De=I.createLatticeKPI,Ke=I.createLatticeChart,Me=I.createLatticeKanban,ze=I.createLatticeGantt,$e=I.createLatticeLayout,We=I.createLatticeTabs,He=I.createLatticeRouter,Fe=I.createLatticeReact;var Ue=I.default;export{ke as DEFAULT_GRID_NAME,Ce as EVENT_NAMES,Te as VIEWER_APPLY,Ne as VIEWER_EVENTS,Ke as createLatticeChart,ze as createLatticeGantt,Se as createLatticeGrid,Ie as createLatticeGridContext,De as createLatticeKPI,Me as createLatticeKanban,$e as createLatticeLayout,Fe as createLatticeReact,He as createLatticeRouter,We as createLatticeTabs,Ve as createLatticeViewer,Ae as createViewerController,Ue as default,ve as handlerName,Ge as viewerHandlerName};
6
+ var Le=Object.create(null),Ee=Object.create(null);function ge(c,_){Le[c]=_}function Pe(c){var _=Ee[c];if(_)return _;var ee=Object.create(null);Ee[c]=ee;var re=Le[c];if(!re)throw new Error("[lattice] missing module: "+c);return re(ee,Pe),ee}ge("packages/core/src/internal/util.js",function(c,_){"use strict";Object.defineProperty(c,"VERSION",{enumerable:!0,get:function(){return x}}),Object.defineProperty(c,"reportedWarnings",{enumerable:!0,get:function(){return o}}),Object.defineProperty(c,"warnOnce",{enumerable:!0,get:function(){return l}}),Object.defineProperty(c,"infoOnce",{enumerable:!0,get:function(){return E}}),Object.defineProperty(c,"resetWarnings",{enumerable:!0,get:function(){return w}}),Object.defineProperty(c,"fail",{enumerable:!0,get:function(){return p}}),Object.defineProperty(c,"invariant",{enumerable:!0,get:function(){return A}}),Object.defineProperty(c,"DEV",{enumerable:!0,get:function(){return k}}),Object.defineProperty(c,"isObject",{enumerable:!0,get:function(){return v}}),Object.defineProperty(c,"isFunction",{enumerable:!0,get:function(){return B}}),Object.defineProperty(c,"isNil",{enumerable:!0,get:function(){return T}}),Object.defineProperty(c,"isBlank",{enumerable:!0,get:function(){return D}}),Object.defineProperty(c,"isCtor",{enumerable:!0,get:function(){return P}}),Object.defineProperty(c,"pathGetter",{enumerable:!0,get:function(){return h}}),Object.defineProperty(c,"pathSetter",{enumerable:!0,get:function(){return V}}),Object.defineProperty(c,"getPath",{enumerable:!0,get:function(){return C}}),Object.defineProperty(c,"setPath",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(c,"humanise",{enumerable:!0,get:function(){return me}}),Object.defineProperty(c,"escapeHtml",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(c,"titleCase",{enumerable:!0,get:function(){return he}}),Object.defineProperty(c,"expand",{enumerable:!0,get:function(){return we}}),Object.defineProperty(c,"toArray",{enumerable:!0,get:function(){return n}}),Object.defineProperty(c,"merge",{enumerable:!0,get:function(){return s}}),Object.defineProperty(c,"mergeRow",{enumerable:!0,get:function(){return m}}),Object.defineProperty(c,"Lru",{enumerable:!0,get:function(){return d}}),Object.defineProperty(c,"collator",{enumerable:!0,get:function(){return y}}),Object.defineProperty(c,"defaultCompare",{enumerable:!0,get:function(){return X}}),Object.defineProperty(c,"now",{enumerable:!0,get:function(){return M}}),Object.defineProperty(c,"nextFrame",{enumerable:!0,get:function(){return z}}),Object.defineProperty(c,"cancelFrame",{enumerable:!0,get:function(){return S}}),Object.defineProperty(c,"frameBatched",{enumerable:!0,get:function(){return O}}),Object.defineProperty(c,"settleDebounce",{enumerable:!0,get:function(){return $}}),Object.defineProperty(c,"whenIdle",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(c,"uid",{enumerable:!0,get:function(){return j}});const ee="1.71.3";async function re(){return ee}const x="1.71.3",H=new Set,oe=2e3;function ae(e){if(H.add(e),H.size>oe){const t=H.values().next().value;t!==void 0&&H.delete(t)}}const Y=[],J=500;function ie(e,t,r){Y.push({key:e,level:t,message:r.map(i=>typeof i=="string"?i:u(i)).join(" "),at:Date.now()}),Y.length>J&&Y.shift()}function u(e){if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch{return String(e)}}function o(){return Y.map(e=>({...e}))}function l(e,...t){H.has(e)||(ae(e),ie(e,"warn",t),console.warn("[lattice]",...t))}function E(e,...t){H.has(e)||(ae(e),ie(e,"info",t),console.info("[lattice]",...t))}function w(){H.clear(),Y.length=0}function p(e,t){const r=new Error(`[lattice] ${e}`);throw t!==void 0&&(r.cause=t),r}function A(e,t){e||p(t)}const k=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function v(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function B(e){return typeof e=="function"}function T(e){return e==null}function D(e){return e==null||e===""}function P(e){return typeof e!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(e))?!0:!!(e.prototype&&Object.getOwnPropertyNames(e.prototype).length>1)}const K=new Map;function h(e){let t=K.get(e);if(t)return t;if(!e.includes("."))t=r=>r?.[e];else{const r=e.split("."),i=r.length;t=R=>{let L=R;for(let b=0;b<i;b++){if(L==null)return;L=L[r[b]]}return L}}return K.set(e,t),t}const N=new Map;function V(e){let t=N.get(e);if(t)return t;if(!e.includes("."))t=(r,i)=>{r!=null&&(r[e]=i)};else{const r=e.split("."),i=r.length-1;t=(R,L)=>{let b=R;for(let f=0;f<i;f++){if(b==null)return;const U=r[f];b[U]==null&&(b[U]={}),b=b[U]}b!=null&&(b[r[i]]=L)}}return N.set(e,t),t}function C(e,t){return h(t)(e)}function Z(e,t,r){V(t)(e,r)}function me(e){return e?(e.includes(".")?e.slice(e.lastIndexOf(".")+1):e).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,r=>r.toUpperCase()):""}const ye={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function pe(e){const t=e==null?"":String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,r=>ye[r]):t}function he(e){return String(e).replace(/\w\S*/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function we(e,t,r){if(e!==void 0)return e===!0?{enabled:!0,...r}:e===!1?{enabled:!1}:v(e)?e:{[t]:e,enabled:!0}}function n(e){return e==null?[]:Array.isArray(e)?e:[e]}const a=Object.freeze(new Set(["__proto__","constructor","prototype"]));function s(e,t){if(!v(e))return v(t)?{...t}:t;if(!v(t))return t===void 0?e:t;const r={...e};for(const i of Object.keys(t)){if(a.has(i))continue;const R=t[i];R!==void 0&&(r[i]=v(R)&&v(r[i])?s(r[i],R):R)}return r}function m(e,t){if(!v(e)||!v(t)||e===t)return t;const r=Object.create(Object.getPrototypeOf(e));return Object.assign(r,e,t),r}class d{#n;#e=new Map;#t;constructor(t=256,r=null){this.#n=t,this.#t=r}get size(){return this.#e.size}get max(){return this.#n}set max(t){this.#n=t,this.#r()}has(t){return this.#e.has(t)}get(t){const r=this.#e;if(!r.has(t))return;const i=r.get(t);return r.delete(t),r.set(t,i),i}peek(t){return this.#e.get(t)}set(t,r){const i=this.#e;return i.has(t)&&i.delete(t),i.set(t,r),this.#r(),r}delete(t){const r=this.#e.get(t);return this.#e.delete(t)&&this.#t&&this.#t(r,t),r}clear(){if(this.#t)for(const[t,r]of this.#e)this.#t(r,t);this.#e.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}#r(){const t=this.#e;for(;t.size>this.#n;){const r=t.keys().next().value,i=t.get(r);t.delete(r),this.#t&&this.#t(i,r)}}}const g=new Map;function y(e,t){const r=`${e||""}|${t?JSON.stringify(t):""}`;let i=g.get(r);return i||(i=new Intl.Collator(e||void 0,{numeric:!0,sensitivity:"variant",...t}),g.set(r,i)),i}function X(e,t){if(e===t)return 0;if(e==null)return 1;if(t==null)return-1;if(typeof e=="number"&&typeof t=="number")return Number.isNaN(e)?Number.isNaN(t)?0:1:Number.isNaN(t)||e<t?-1:e>t?1:0;const r=String(e),i=String(t);return r<i?-1:r>i?1:0}function M(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const F=typeof requestAnimationFrame=="function";function z(e){return F?requestAnimationFrame(e):setTimeout(()=>e(M()),16)}function S(e){e!=null&&(F?cancelAnimationFrame(e):clearTimeout(e))}function O(e){let t=null,r=null;const i=()=>{t=null;const L=r;r=null,e(...L||[])},R=(...L)=>{r=L,t===null&&(t=z(i))};return R.cancel=()=>{S(t),t=null,r=null},R.flush=()=>{t!==null&&(S(t),i())},R}function $(e,t){let r=null,i=null;const R=()=>{if(r=null,i===null)return;const f=i;i=null,e(...f),L()},L=()=>{r=setTimeout(R,t),typeof r?.unref=="function"&&r.unref()},b=(...f)=>{r===null?(e(...f),L()):(i=f,clearTimeout(r),L())};return b.flush=()=>{if(r!==null&&clearTimeout(r),r=null,i===null)return;const f=i;i=null,e(...f)},b.cancel=()=>{r!==null&&clearTimeout(r),r=null,i=null},b.pending=()=>r!==null||i!==null,b}function Q(e,t=50){return typeof requestIdleCallback=="function"?requestIdleCallback(e,{timeout:t}):setTimeout(()=>e({timeRemaining:()=>0,didTimeout:!0}),1)}let G=0;function j(e="l"){return`${e}${(++G).toString(36)}`}}),ge("packages/modules/shared/adapter.js",function(c,_){"use strict";Object.defineProperty(c,"EVENT_NAMES",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(c,"handlerName",{enumerable:!0,get:function(){return x}}),Object.defineProperty(c,"dashedName",{enumerable:!0,get:function(){return H}}),Object.defineProperty(c,"CONFIG_KEY_ALIASES",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(c,"aliasConfigKey",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(c,"isHandlerProp",{enumerable:!0,get:function(){return J}}),Object.defineProperty(c,"partition",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(c,"createGridController",{enumerable:!0,get:function(){return u}});const ee=Object.freeze(["ready","destroy","render:first","render:done","config:changed","licence:changed","model:changed","rows:changed","rows:queued","rows:deferred","rows:paused","rows:resumed","row:received","row:sent","row:copied","row:moved","source:error","source:total","stream:chunk","stream:end","stream:evicted","rowDrag:started","rowDrag:moved","rowDrag:left","rowDrag:ended","cell:changed","cell:pending","cell:confirmed","cell:reverted","cell:conflict","cell:clicked","cell:dblclicked","cell:contextmenu","cell:mouseover","cell:mouseout","cell:mousedown","cell:mouseup","cell:edit:start","cell:edit:end","row:edit:start","row:edit:end","row:clicked","row:dblclicked","row:pending","row:confirmed","row:reverted","row:conflict","form:opened","form:closed","form:saved","form:error","sort:changed","filter:changed","group:toggled","facet:computed","facet:filtered","facet:expanded","facet:failed","column:moved","column:resized","column:visible","column:pinned","column:grouped","column:pivoted","column:filter:open","column:profile:open","column:menu:open","columns:changed","columns:tagged","columngroup:changed","header:contextmenu","pivot:drill","selection:changed","range:changed","clipboard:copy","page:changed","scroll","scroll:end","size:changed","detail:toggled","toolpanel:focus","highlight:changed","find:changed","tree:loading","tree:loaded","tree:loadFailed","tree:loadAborted","state:changed","state:reset","history:changed","history:applied","views:changed","view:applied","view:saved","view:removed","view:renamed","view:default","formatting:changed","redaction:changed","permissions:changed","presentation:changed","presentation:started","presentation:ended","presentation:view","presentation:scale","presentation:spotlight","presentation:captured","comment:added","comment:edited","comment:deleted","comment:failed","comment:resolved","comment:unresolved","comment:threadOpened","comment:threadClosed","comment:indexLoaded","presence:published","presence:joined","presence:updated","presence:left","presence:failed","presence:lockRefused","diff:changed","diff:swapped","timeline:attached","timeline:detached","timeline:seek","timeline:seeking","annotation:changed","validation:failed","validation:cleared","export:progress","export:request","export:done","shortcuts:opened","shortcuts:closed","print:before","print:after","beforeEdit","beforeSort","beforeFilter","beforeColumnMove","beforeColumnResize","beforeColumnHide","beforeSelect","beforeRowAdd","beforeDelete","beforeRowMove","beforeGroup","beforeRowReceive","edit:cancelled","sort:cancelled","filter:cancelled","columnMove:cancelled","columnResize:cancelled","columnHide:cancelled","selection:cancelled","rowAdd:cancelled","delete:cancelled","rowMove:cancelled","group:cancelled","rowReceive:cancelled"]),re=Object.freeze({sort:(o,l)=>o.sort.set(l||[]),filters:(o,l)=>o.filters.set(l||null),quickFilter:(o,l)=>{if(l&&typeof l=="object"){o.filters.quick(l.text||"",{mode:l.mode});return}o.filters.quick(typeof l=="string"?l:"")},selectedKeys:(o,l)=>o.selection.set(Array.isArray(l)?l:[])});function x(o){return`on${String(o).split(":").map(E=>E.charAt(0).toUpperCase()+E.slice(1)).join("")}`}function H(o){return String(o).replace(/:/g,"-")}const oe=Object.freeze({"row-key":"rowKey","row-height":"rowHeight","header-height":"headerHeight","auto-height":"autoHeight"});function ae(o){return Object.hasOwn(oe,o)?oe[o]:o}const Y=Object.freeze(Object.fromEntries(ee.map(o=>[x(o),o])));function J(o){return Object.hasOwn(Y,o)}function ie(o){const l={},E={},w={};for(const[p,A]of Object.entries(o||{})){if(J(p)){w[p]=A;continue}if(Object.hasOwn(re,p)){E[p]=A;continue}l[p]=A}return{config:l,imperative:E,handlers:w}}function u(o){const l=o.createGrid;if(typeof l!="function")throw new TypeError("createGridController needs createGrid; pass it in from the grid package.");const E=ie(o.props||{}),w=l(o.element,{...E.config});let p=E.handlers,A=E.config,k={};const v=D=>{if(!D||typeof D.type!="string")return;const P=p[x(D.type)];typeof P=="function"&&P(D)},B=w.on("*",v);for(const[D,P]of Object.entries(E.imperative))P!==void 0&&(re[D](w,P),k[D]=P);let T=!1;return{grid:w,update(D){if(T)return;const P=ie(D||{});p=P.handlers;const K={};for(const[h,N]of Object.entries(P.config))Object.is(A[h],N)||(K[h]=N);for(const h of Object.keys(A))Object.hasOwn(P.config,h)||(K[h]=void 0);Object.keys(K).length&&w.setAll(K),A=P.config;for(const[h,N]of Object.entries(re)){const V=P.imperative[h];Object.is(k[h],V)||V===void 0&&!Object.hasOwn(k,h)||(N(w,V),k[h]=V)}},destroy(){T||(T=!0,B(),w.destroy())}}}}),ge("packages/modules/react/viewers.js",function(c,_){"use strict";Object.defineProperty(c,"VIEWER_EVENTS",{enumerable:!0,get:function(){return x}}),Object.defineProperty(c,"VIEWER_APPLY",{enumerable:!0,get:function(){return H}}),Object.defineProperty(c,"VIEWER_BULK_UPDATE",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(c,"viewerHandlerName",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(c,"partitionViewerProps",{enumerable:!0,get:function(){return J}}),Object.defineProperty(c,"createViewerController",{enumerable:!0,get:function(){return ie}});const re=_("packages/core/src/internal/util.js").warnOnce,x=Object.freeze({kpi:Object.freeze(["tile:click","tile:dblclick","tile:contextmenu","node:toggle","change","tile:status"]),kanban:Object.freeze(["card:click","card:dblclick","card:contextmenu","card:move","card:reverted","card:confirmed","selection:changed","column:collapse","card:add","drag:start","drag:end","swimlane:collapse","swimlane:reorder","column:reorder","filter:changed","sprint:changed","epic:changed","card:expand","card:drill","card:edit","card:sla","beforeMove","beforeAdd","beforeEdit","beforeLaneReorder","beforeColumnReorder","beforeColumnChange","move:cancelled","add:cancelled","edit:cancelled","laneReorder:cancelled","columnReorder:cancelled","columnChange:cancelled"]),tabs:Object.freeze(["beforeTabChange","tab:changed","tabChange:cancelled"]),chart:Object.freeze(["click","hover","leave","draw","legend"]),gantt:Object.freeze(["schedule","error"]),layout:Object.freeze(["layout:changed","window:moved","window:resized","window:closed","beforeWindowClose","windowClose:cancelled"]),router:Object.freeze(["metrics"])}),H=Object.freeze({kpi:Object.freeze({rows:(u,o)=>u.setRows(Array.isArray(o)?o:[])}),kanban:Object.freeze({rows:(u,o)=>u.setRows(Array.isArray(o)?o:[]),quickFilter:(u,o)=>u.setQuickFilter(typeof o=="string"?o:""),sprint:(u,o)=>u.setSprint(o),epic:(u,o)=>u.setEpic(o),loading:(u,o)=>u.setLoading(!!o),error:(u,o)=>u.setError(o??null)}),gantt:Object.freeze({tasks:(u,o)=>u.setTasks(Array.isArray(o)?o:[]),dependencies:(u,o)=>u.setDependencies(Array.isArray(o)?o:[])}),tabs:Object.freeze({active:(u,o)=>{typeof o=="string"&&u.activate(o)}}),chart:Object.freeze({}),layout:Object.freeze({})}),oe=Object.freeze({chart:"update"});function ae(u){return`on${String(u).split(":").map(l=>l.charAt(0).toUpperCase()+l.slice(1)).join("")}`}const Y=Object.freeze(Object.fromEntries(Object.entries(x).map(([u,o])=>[u,Object.freeze(Object.fromEntries(o.map(l=>[ae(l),l])))])));function J(u,o){const l=Y[u]||{},E=H[u]||{},w={},p={},A={};for(const[k,v]of Object.entries(o||{})){if(Object.hasOwn(l,k)){A[k]=v;continue}if(Object.hasOwn(E,k)){p[k]=v,w[k]=v;continue}w[k]=v}return{config:w,live:p,handlers:A}}function ie(u){const o=String(u.viewer),l=u.mount,E=u.name||o;if(typeof l!="function")throw new TypeError(`createViewerController needs a mount factory for "${o}"; pass the module's own factory in, e.g. { createKPI } from lattice-grid/modules/kpi.`);const w=J(o,u.props||{}),p=l(u.element,{...w.config});if(!p||typeof p!="object")throw new TypeError(`the ${E} factory returned no instance; nothing can be driven.`);let A=w.handlers,k=w.config;const v={...w.live},B=[];if(typeof p.on=="function")for(const K of x[o]||[]){const h=ae(K),N=p.on(K,V=>{const C=A[h];typeof C=="function"&&C(V)});typeof N=="function"&&B.push(N)}const T=oe[o],D=H[o]||{};let P=!1;return{instance:p,update(K){if(P)return;const h=J(o,K||{});A=h.handlers;const N={};for(const[C,Z]of Object.entries(h.config))Object.is(k[C],Z)||(N[C]=Z);if(k=h.config,!Object.keys(N).length)return;const V=[];for(const C of Object.keys(N)){const Z=D[C];if(Z){Z(p,N[C]),v[C]=N[C];continue}T&&typeof p[T]=="function"||V.push(C)}if(T&&typeof p[T]=="function"){const C={};for(const Z of Object.keys(N))D[Z]||(C[Z]=N[Z]);Object.keys(C).length&&p[T](C)}V.length&&re(`react.viewer.${o}.mountOnly.${V.join(".")}`,`${E}: ${V.map(C=>`\`${C}\``).join(", ")} changed, but ${E} takes ${V.length===1?"it":"them"} only when the viewer is created. Nothing was applied and the viewer was NOT rebuilt — rebuilding it silently would throw away scroll position, selection and expansion. Give the component a \`key\` that changes when this must take effect, so the rebuild is yours and visible, or drive the instance through the ref.`)},destroy(){if(!P){P=!0;for(const K of B)try{K()}catch{}B.length=0,typeof p.destroy=="function"&&p.destroy()}}}}}),ge("packages/modules/react/index.js",function(c,_){"use strict";Object.defineProperty(c,"EVENT_NAMES",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(c,"handlerName",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(c,"VIEWER_EVENTS",{enumerable:!0,get:function(){return J}}),Object.defineProperty(c,"VIEWER_APPLY",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(c,"viewerHandlerName",{enumerable:!0,get:function(){return u}}),Object.defineProperty(c,"createViewerController",{enumerable:!0,get:function(){return o}}),Object.defineProperty(c,"DEFAULT_GRID_NAME",{enumerable:!0,get:function(){return w}}),Object.defineProperty(c,"createLatticeGrid",{enumerable:!0,get:function(){return P}}),Object.defineProperty(c,"createLatticeGridContext",{enumerable:!0,get:function(){return K}}),Object.defineProperty(c,"createLatticeViewer",{enumerable:!0,get:function(){return h}}),Object.defineProperty(c,"createLatticeKPI",{enumerable:!0,get:function(){return N}}),Object.defineProperty(c,"createLatticeChart",{enumerable:!0,get:function(){return V}}),Object.defineProperty(c,"createLatticeKanban",{enumerable:!0,get:function(){return C}}),Object.defineProperty(c,"createLatticeGantt",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(c,"createLatticeLayout",{enumerable:!0,get:function(){return me}}),Object.defineProperty(c,"createLatticeTabs",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(c,"createLatticeRouter",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(c,"createLatticeReact",{enumerable:!0,get:function(){return he}}),Object.defineProperty(c,"default",{enumerable:!0,get:function(){return we}});const re=_("packages/core/src/internal/util.js").warnOnce,x=_("packages/modules/shared/adapter.js"),H=x.createGridController,oe=x.EVENT_NAMES,ae=x.handlerName,Y=_("packages/modules/react/viewers.js"),J=Y.VIEWER_EVENTS,ie=Y.VIEWER_APPLY,u=Y.viewerHandlerName,o=Y.createViewerController,l=new Set(["className","style","id"]),E=new Set(["onGridReady","onGridDestroy","rowUpdates","predicates","name","route","routeOptions"]),w="default",p=new WeakMap;function A(n){let a=p.get(n);return a||(a=n.createContext(null),a.displayName="LatticeGridContext",p.set(n,a)),a}const k=new WeakMap;function v(n){let a=k.get(n);return a||(a=n.createContext(null),a.displayName="LatticeRouterContext",k.set(n,a)),a}function B(n,a){if(!n||typeof n.createElement!="function")throw new TypeError(`${a} needs React: ${a}({ React, … }).`)}function T(n,a){const s={},m={},d={};for(const[g,y]of Object.entries(n||{}))l.has(g)?s[g]=y:a.has(g)?m[g]=y:d[g]=y;return{host:s,own:m,rest:d}}function D(n,a,s){const m=a&&typeof a=="object"?a:{},d=s&&typeof s=="object"?s:{};for(const[g,y]of Object.entries(m))Object.is(d[g],y)||n.filters.where(g,typeof y=="function"?y:null);for(const g of Object.keys(d))Object.hasOwn(m,g)||n.filters.where(g,null)}function P(n){const a=n&&n.React,s=n&&n.createGrid;if(B(a,"createLatticeGrid"),typeof s!="function")throw new TypeError("createLatticeGrid needs createGrid: createLatticeGrid({ React, createGrid }).");const{createElement:m,useRef:d,useEffect:g,useContext:y,useImperativeHandle:X,forwardRef:M}=a,F=typeof a.createContext=="function"&&typeof y=="function",z=F?A(a):null,S=F?v(a):null,O=($,Q)=>{const G=d(null),j=d(null),e=d($);e.current=$;const t=d({rowUpdates:void 0,predicates:void 0}),r=F?y(z):null,i=d(r);i.current=r;const R=F?y(S):null,L=d(R);L.current=R,g(()=>{const f=G.current;if(!f)return;const U=e.current,W=T(U,E),te=H({createGrid:s,element:f,props:W.rest});j.current=te;const{grid:q}=te,fe=typeof W.own.name=="string"?W.own.name:w;W.own.predicates&&(D(q,W.own.predicates,{}),t.current.predicates=W.own.predicates),i.current&&typeof i.current.publish=="function"&&i.current.publish(fe,q);const ne=L.current,ue=W.own.route;return ne&&ue!==void 0&&typeof ne.attach=="function"&&ne.attach(q,ue,W.own.routeOptions||{}),typeof W.own.onGridReady=="function"&&W.own.onGridReady(q),()=>{j.current=null;const ce=e.current;if(typeof ce.onGridDestroy=="function"&&ce.onGridDestroy(),ne&&typeof ne.detach=="function")try{ne.detach(q)}catch{}i.current&&typeof i.current.publish=="function"&&i.current.publish(fe,null),t.current={rowUpdates:void 0,predicates:void 0},te.destroy()}},[]),g(()=>{const f=j.current;if(!f)return;const U=T($,E);f.update(U.rest);const{grid:W}=f;Object.is(t.current.predicates,U.own.predicates)||(D(W,U.own.predicates,t.current.predicates),t.current.predicates=U.own.predicates);const te=U.own.rowUpdates;te&&!Object.is(t.current.rowUpdates,te)&&(t.current.rowUpdates=te,W.rows.apply(te))}),X(Q,()=>({get grid(){return j.current?j.current.grid:null}}),[]);const{host:b}=T($,E);return m("div",{...b,ref:G})};return O.displayName="LatticeGrid",typeof M=="function"?M(O):O}function K(n){const a=n&&n.React;if(B(a,"createLatticeGridContext"),typeof a.createContext!="function")throw new TypeError("createLatticeGridContext needs a React with createContext.");const{createElement:s,useState:m,useCallback:d,useMemo:g,useContext:y}=a,X=A(a),M=z=>{const[S,O]=m(()=>({})),$=d((G,j)=>{O(e=>{if(Object.is(e[G],j))return e;const t={...e};return j==null?delete t[G]:t[G]=j,t})},[]),Q=g(()=>({grids:S,publish:$}),[S,$]);return s(X.Provider,{value:Q},z.children)};return M.displayName="LatticeGridProvider",{LatticeGridProvider:M,useLatticeGrid:(z=w)=>{const S=y(X);return S&&S.grids?S.grids[z]??null:null}}}function h(n){const a=n&&n.React;B(a,"createLatticeViewer");const s=String(n.viewer||""),m=n.mount,d=n.name||`Lattice${s.charAt(0).toUpperCase()}${s.slice(1)}`,g=Array.isArray(n.requires)?n.requires:[],y=n.fromContext||null;if(typeof m!="function")throw new TypeError(`${d} needs a mount factory: createLatticeViewer({ React, mount }).`);if(!Object.hasOwn(J,s))throw new TypeError(`createLatticeViewer: "${s}" is not a viewer this adapter knows; expected one of ${Object.keys(J).join(", ")}.`);const{createElement:X,useRef:M,useEffect:F,useContext:z,useImperativeHandle:S,forwardRef:O}=a,$=typeof a.createContext=="function"&&typeof z=="function",Q=$?A(a):null,G=new Set(["gridName","onReady","onDestroy"]),j=(e,t)=>{const r=M(null),i=M(null),R=M(e),L=$?z(Q):null,b=y&&L&&L.grids?L.grids[typeof e.gridName=="string"?e.gridName:w]??null:null,f=y&&e[y]===void 0&&b?{...e,[y]:b}:e;R.current=f;const W=(y&&!g.includes(y)?[...g,y]:g).map(q=>f[q]);F(()=>{const q=r.current;if(!q)return;const fe=R.current;if(g.some(ce=>fe[ce]===null||fe[ce]===void 0))return;const ne=T(fe,G),ue=o({viewer:s,mount:m,element:q,props:ne.rest,name:d});return i.current=ue,typeof ne.own.onReady=="function"&&ne.own.onReady(ue.instance),()=>{i.current=null;const ce=R.current;typeof ce.onDestroy=="function"&&ce.onDestroy(),ue.destroy()}},W),F(()=>{const q=i.current;q&&q.update(T(R.current,G).rest)}),S(t,()=>({get instance(){return i.current?i.current.instance:null}}),[]);const{host:te}=T(f,G);return X("div",{...te,ref:r})};return j.displayName=d,typeof O=="function"?O(j):j}function N(n){const a=n&&n.createKPI;if(typeof a!="function")throw new TypeError("createLatticeKPI needs createKPI: createLatticeKPI({ React, createKPI }).");return h({React:n.React,viewer:"kpi",name:"LatticeKPI",mount:(s,m)=>a(s,m),fromContext:"grid"})}function V(n){const a=n&&n.createChart;if(typeof a!="function")throw new TypeError("createLatticeChart needs createChart: createLatticeChart({ React, createChart }).");return h({React:n.React,viewer:"chart",name:"LatticeChart",mount:(s,m)=>a({...m,container:s}),requires:["grid"],fromContext:"grid"})}function C(n){const a=n&&n.createKanban;if(typeof a!="function")throw new TypeError("createLatticeKanban needs createKanban: createLatticeKanban({ React, createKanban }).");return h({React:n.React,viewer:"kanban",name:"LatticeKanban",mount:(s,m)=>a(s,m),fromContext:"grid"})}function Z(n){const a=n&&n.createGantt;if(typeof a!="function")throw new TypeError("createLatticeGantt needs createGantt: createLatticeGantt({ React, createGantt }).");return h({React:n.React,viewer:"gantt",name:"LatticeGantt",mount:(s,m)=>a({...m,element:s})})}function me(n){const a=n&&n.createLayout;if(typeof a!="function")throw new TypeError("createLatticeLayout needs createLayout: createLatticeLayout({ React, createLayout }).");return h({React:n.React,viewer:"layout",name:"LatticeLayout",mount:(s,m)=>a(s,m)})}function ye(n){const a=n&&n.React,s=n&&n.ReactDOM,m=n&&n.createTabs;if(B(a,"createLatticeTabs"),!s||typeof s.createPortal!="function")throw new TypeError("createLatticeTabs needs react-dom for createPortal: createLatticeTabs({ React, ReactDOM, createTabs }) with ReactDOM from 'react-dom'.");if(typeof m!="function")throw new TypeError("createLatticeTabs needs createTabs: createLatticeTabs({ React, ReactDOM, createTabs }).");const{createElement:d,Fragment:g,useRef:y,useEffect:X,useState:M,useImperativeHandle:F,forwardRef:z}=a,S=(O,$)=>{const Q=y(null),G=y(null),j=y(O);j.current=O;const[e,t]=M(()=>({})),r=y(null);X(()=>{const b=Q.current;if(!b)return;const f=j.current,{host:U,own:W,rest:te}=T(f,new Set(["tabs","active"])),q=Array.isArray(f.tabs)?f.tabs:[],fe={},ne=q.map(de=>{const se=de;if(se.content===void 0)return se;const{content:Oe,...je}=se;return{...je,view:be=>(fe[se.id]=be,t(le=>le[se.id]===be?le:{...le,[se.id]:be}),{destroy(){t(le=>{if(!Object.hasOwn(le,se.id))return le;const Re={...le};return delete Re[se.id],Re})}})}}),ue=m(b,{...te,tabs:ne,createGrid:n.createGrid||(()=>{throw new Error("[lattice] LatticeTabs: a tab has no `content` and no `createGrid` was injected, so there is nothing to build it with. Give the tab a React `content`, or pass createGrid into createLatticeTabs.")}),...typeof f.active=="string"?{active:f.active}:{}});G.current=ue,r.current=f.tabs;const ce=[];for(const de of J.tabs){const se=u(de),Oe=ue.on(de,je=>{const be=j.current[se];typeof be=="function"&&be(je)});typeof Oe=="function"&&ce.push(Oe)}return()=>{G.current=null;for(const de of ce)try{de()}catch{}ue.destroy(),t({})}},[]),X(()=>{const b=G.current;if(!b)return;const f=O.active;typeof f=="string"&&b.activeId!==f&&b.activate(f),Object.is(r.current,O.tabs)||(r.current=O.tabs,re("react.tabs.mountOnly.tabs","LatticeTabs: `tabs` changed (a label, a badge or a descriptor), but the strip takes it only when created — the module has no way to repaint an existing tab. Nothing was applied and the strip was NOT rebuilt — rebuilding it would lose whichever tab is open and any state its content holds. Give the component a `key` that changes when a genuine rebuild is wanted; a live badge otherwise needs to live in your own render, as `tab.badge` on this component's own props does today."))}),F($,()=>({get instance(){return G.current},get tabs(){return G.current}}),[]);const{host:i}=T(O,new Set(["tabs","active"])),L=(Array.isArray(O.tabs)?O.tabs:[]).filter(b=>b.content!==void 0&&e[b.id]).map(b=>{const f=b,U=typeof f.content=="function"?f.content():f.content;return s.createPortal(U,e[f.id],f.id)});return d(g,null,d("div",{...i,ref:Q}),...L)};return S.displayName="LatticeTabs",typeof z=="function"?z(S):S}function pe(n){const a=n&&n.React,s=n&&n.createDataRouter;if(B(a,"createLatticeRouter"),typeof a.createContext!="function")throw new TypeError("createLatticeRouter needs a React with createContext.");if(typeof s!="function")throw new TypeError("createLatticeRouter needs createDataRouter: createLatticeRouter({ React, createDataRouter }).");const{createElement:m,useState:d,useEffect:g,useRef:y,useContext:X}=a,M=v(a),F=O=>{const[$,Q]=d(null),G=y(O);return g(()=>{const j=s(G.current||{});return Q(j),()=>{Q(null),j.destroy()}},[]),$},z=O=>m(M.Provider,{value:O.router??null},O.children);return z.displayName="LatticeRouterProvider",{useLatticeRouter:F,LatticeRouterProvider:z,useRouter:()=>X(M)}}function he(n){const a=n&&n.React;B(a,"createLatticeReact");const{LatticeGridProvider:s,useLatticeGrid:m}=K({React:a}),d={LatticeGridProvider:s,useLatticeGrid:m};return typeof n.createGrid=="function"&&(d.LatticeGrid=P({React:a,createGrid:n.createGrid})),typeof n.createKPI=="function"&&(d.LatticeKPI=N({React:a,createKPI:n.createKPI})),typeof n.createChart=="function"&&(d.LatticeChart=V({React:a,createChart:n.createChart})),typeof n.createKanban=="function"&&(d.LatticeKanban=C({React:a,createKanban:n.createKanban})),typeof n.createGantt=="function"&&(d.LatticeGantt=Z({React:a,createGantt:n.createGantt})),typeof n.createLayout=="function"&&(d.LatticeLayout=me({React:a,createLayout:n.createLayout})),typeof n.createTabs=="function"&&n.ReactDOM&&(d.LatticeTabs=ye({React:a,ReactDOM:n.ReactDOM,createTabs:n.createTabs,createGrid:n.createGrid})),typeof n.createDataRouter=="function"&&Object.assign(d,pe({React:a,createDataRouter:n.createDataRouter})),d}const we=P});const I=Pe("packages/modules/react/index.js"),Ce=I.EVENT_NAMES,ve=I.handlerName,Ne=I.VIEWER_EVENTS,Te=I.VIEWER_APPLY,Ge=I.viewerHandlerName,Ae=I.createViewerController,ke=I.DEFAULT_GRID_NAME,Se=I.createLatticeGrid,Ie=I.createLatticeGridContext,Ve=I.createLatticeViewer,De=I.createLatticeKPI,Ke=I.createLatticeChart,Me=I.createLatticeKanban,ze=I.createLatticeGantt,$e=I.createLatticeLayout,We=I.createLatticeTabs,He=I.createLatticeRouter,Fe=I.createLatticeReact;var Ue=I.default;export{ke as DEFAULT_GRID_NAME,Ce as EVENT_NAMES,Te as VIEWER_APPLY,Ne as VIEWER_EVENTS,Ke as createLatticeChart,ze as createLatticeGantt,Se as createLatticeGrid,Ie as createLatticeGridContext,De as createLatticeKPI,Me as createLatticeKanban,$e as createLatticeLayout,Fe as createLatticeReact,He as createLatticeRouter,We as createLatticeTabs,Ve as createLatticeViewer,Ae as createViewerController,Ue as default,ve as handlerName,Ge as viewerHandlerName};
7
7
 
8
8
  //# sourceMappingURL=react.esm.min.js.map
@@ -1,8 +1,8 @@
1
1
  /*!
2
- * Lattice Grid 1.71.1, react module
2
+ * Lattice Grid 1.71.3, react module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
6
- (function(Ce){"use strict";var Re=Object.create(null),Pe=Object.create(null);function be(c,x){Re[c]=x}function Ee(c){var x=Pe[c];if(x)return x;var _=Object.create(null);Pe[c]=_;var ne=Re[c];if(!ne)throw new Error("[lattice] missing module: "+c);return ne(_,Ee),_}be("packages/core/src/internal/util.js",function(c,x){"use strict";Object.defineProperty(c,"VERSION",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(c,"reportedWarnings",{enumerable:!0,get:function(){return o}}),Object.defineProperty(c,"warnOnce",{enumerable:!0,get:function(){return l}}),Object.defineProperty(c,"infoOnce",{enumerable:!0,get:function(){return E}}),Object.defineProperty(c,"resetWarnings",{enumerable:!0,get:function(){return w}}),Object.defineProperty(c,"fail",{enumerable:!0,get:function(){return p}}),Object.defineProperty(c,"invariant",{enumerable:!0,get:function(){return k}}),Object.defineProperty(c,"DEV",{enumerable:!0,get:function(){return A}}),Object.defineProperty(c,"isObject",{enumerable:!0,get:function(){return v}}),Object.defineProperty(c,"isFunction",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(c,"isNil",{enumerable:!0,get:function(){return G}}),Object.defineProperty(c,"isBlank",{enumerable:!0,get:function(){return D}}),Object.defineProperty(c,"isCtor",{enumerable:!0,get:function(){return L}}),Object.defineProperty(c,"pathGetter",{enumerable:!0,get:function(){return h}}),Object.defineProperty(c,"pathSetter",{enumerable:!0,get:function(){return I}}),Object.defineProperty(c,"getPath",{enumerable:!0,get:function(){return C}}),Object.defineProperty(c,"setPath",{enumerable:!0,get:function(){return B}}),Object.defineProperty(c,"humanise",{enumerable:!0,get:function(){return me}}),Object.defineProperty(c,"escapeHtml",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(c,"titleCase",{enumerable:!0,get:function(){return he}}),Object.defineProperty(c,"expand",{enumerable:!0,get:function(){return we}}),Object.defineProperty(c,"toArray",{enumerable:!0,get:function(){return n}}),Object.defineProperty(c,"merge",{enumerable:!0,get:function(){return s}}),Object.defineProperty(c,"mergeRow",{enumerable:!0,get:function(){return m}}),Object.defineProperty(c,"Lru",{enumerable:!0,get:function(){return d}}),Object.defineProperty(c,"collator",{enumerable:!0,get:function(){return y}}),Object.defineProperty(c,"defaultCompare",{enumerable:!0,get:function(){return X}}),Object.defineProperty(c,"now",{enumerable:!0,get:function(){return K}}),Object.defineProperty(c,"nextFrame",{enumerable:!0,get:function(){return z}}),Object.defineProperty(c,"cancelFrame",{enumerable:!0,get:function(){return S}}),Object.defineProperty(c,"frameBatched",{enumerable:!0,get:function(){return O}}),Object.defineProperty(c,"settleDebounce",{enumerable:!0,get:function(){return M}}),Object.defineProperty(c,"whenIdle",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(c,"uid",{enumerable:!0,get:function(){return j}});const _="1.71.1";async function ne(){return _}const Z="1.71.1",H=new Set,ce=2e3;function oe(e){if(H.add(e),H.size>ce){const t=H.values().next().value;t!==void 0&&H.delete(t)}}const U=[],J=500;function ie(e,t,r){U.push({key:e,level:t,message:r.map(a=>typeof a=="string"?a:u(a)).join(" "),at:Date.now()}),U.length>J&&U.shift()}function u(e){if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch{return String(e)}}function o(){return U.map(e=>({...e}))}function l(e,...t){H.has(e)||(oe(e),ie(e,"warn",t),console.warn("[lattice]",...t))}function E(e,...t){H.has(e)||(oe(e),ie(e,"info",t),console.info("[lattice]",...t))}function w(){H.clear(),U.length=0}function p(e,t){const r=new Error(`[lattice] ${e}`);throw t!==void 0&&(r.cause=t),r}function k(e,t){e||p(t)}const A=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function v(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Y(e){return typeof e=="function"}function G(e){return e==null}function D(e){return e==null||e===""}function L(e){return typeof e!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(e))?!0:!!(e.prototype&&Object.getOwnPropertyNames(e.prototype).length>1)}const V=new Map;function h(e){let t=V.get(e);if(t)return t;if(!e.includes("."))t=r=>r?.[e];else{const r=e.split("."),a=r.length;t=R=>{let P=R;for(let b=0;b<a;b++){if(P==null)return;P=P[r[b]]}return P}}return V.set(e,t),t}const T=new Map;function I(e){let t=T.get(e);if(t)return t;if(!e.includes("."))t=(r,a)=>{r!=null&&(r[e]=a)};else{const r=e.split("."),a=r.length-1;t=(R,P)=>{let b=R;for(let f=0;f<a;f++){if(b==null)return;const F=r[f];b[F]==null&&(b[F]={}),b=b[F]}b!=null&&(b[r[a]]=P)}}return T.set(e,t),t}function C(e,t){return h(t)(e)}function B(e,t,r){I(t)(e,r)}function me(e){return e?(e.includes(".")?e.slice(e.lastIndexOf(".")+1):e).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,r=>r.toUpperCase()):""}const ye={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function pe(e){const t=e==null?"":String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,r=>ye[r]):t}function he(e){return String(e).replace(/\w\S*/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function we(e,t,r){if(e!==void 0)return e===!0?{enabled:!0,...r}:e===!1?{enabled:!1}:v(e)?e:{[t]:e,enabled:!0}}function n(e){return e==null?[]:Array.isArray(e)?e:[e]}const i=Object.freeze(new Set(["__proto__","constructor","prototype"]));function s(e,t){if(!v(e))return v(t)?{...t}:t;if(!v(t))return t===void 0?e:t;const r={...e};for(const a of Object.keys(t)){if(i.has(a))continue;const R=t[a];R!==void 0&&(r[a]=v(R)&&v(r[a])?s(r[a],R):R)}return r}function m(e,t){if(!v(e)||!v(t)||e===t)return t;const r=Object.create(Object.getPrototypeOf(e));return Object.assign(r,e,t),r}class d{#n;#e=new Map;#t;constructor(t=256,r=null){this.#n=t,this.#t=r}get size(){return this.#e.size}get max(){return this.#n}set max(t){this.#n=t,this.#r()}has(t){return this.#e.has(t)}get(t){const r=this.#e;if(!r.has(t))return;const a=r.get(t);return r.delete(t),r.set(t,a),a}peek(t){return this.#e.get(t)}set(t,r){const a=this.#e;return a.has(t)&&a.delete(t),a.set(t,r),this.#r(),r}delete(t){const r=this.#e.get(t);return this.#e.delete(t)&&this.#t&&this.#t(r,t),r}clear(){if(this.#t)for(const[t,r]of this.#e)this.#t(r,t);this.#e.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}#r(){const t=this.#e;for(;t.size>this.#n;){const r=t.keys().next().value,a=t.get(r);t.delete(r),this.#t&&this.#t(a,r)}}}const g=new Map;function y(e,t){const r=`${e||""}|${t?JSON.stringify(t):""}`;let a=g.get(r);return a||(a=new Intl.Collator(e||void 0,{numeric:!0,sensitivity:"variant",...t}),g.set(r,a)),a}function X(e,t){if(e===t)return 0;if(e==null)return 1;if(t==null)return-1;if(typeof e=="number"&&typeof t=="number")return Number.isNaN(e)?Number.isNaN(t)?0:1:Number.isNaN(t)||e<t?-1:e>t?1:0;const r=String(e),a=String(t);return r<a?-1:r>a?1:0}function K(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const W=typeof requestAnimationFrame=="function";function z(e){return W?requestAnimationFrame(e):setTimeout(()=>e(K()),16)}function S(e){e!=null&&(W?cancelAnimationFrame(e):clearTimeout(e))}function O(e){let t=null,r=null;const a=()=>{t=null;const P=r;r=null,e(...P||[])},R=(...P)=>{r=P,t===null&&(t=z(a))};return R.cancel=()=>{S(t),t=null,r=null},R.flush=()=>{t!==null&&(S(t),a())},R}function M(e,t){let r=null,a=null;const R=()=>{if(r=null,a===null)return;const f=a;a=null,e(...f),P()},P=()=>{r=setTimeout(R,t),typeof r?.unref=="function"&&r.unref()},b=(...f)=>{r===null?(e(...f),P()):(a=f,clearTimeout(r),P())};return b.flush=()=>{if(r!==null&&clearTimeout(r),r=null,a===null)return;const f=a;a=null,e(...f)},b.cancel=()=>{r!==null&&clearTimeout(r),r=null,a=null},b.pending=()=>r!==null||a!==null,b}function Q(e,t=50){return typeof requestIdleCallback=="function"?requestIdleCallback(e,{timeout:t}):setTimeout(()=>e({timeRemaining:()=>0,didTimeout:!0}),1)}let N=0;function j(e="l"){return`${e}${(++N).toString(36)}`}}),be("packages/modules/shared/adapter.js",function(c,x){"use strict";Object.defineProperty(c,"EVENT_NAMES",{enumerable:!0,get:function(){return _}}),Object.defineProperty(c,"handlerName",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(c,"dashedName",{enumerable:!0,get:function(){return H}}),Object.defineProperty(c,"CONFIG_KEY_ALIASES",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(c,"aliasConfigKey",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(c,"isHandlerProp",{enumerable:!0,get:function(){return J}}),Object.defineProperty(c,"partition",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(c,"createGridController",{enumerable:!0,get:function(){return u}});const _=Object.freeze(["ready","destroy","render:first","render:done","config:changed","licence:changed","model:changed","rows:changed","rows:queued","rows:deferred","rows:paused","rows:resumed","row:received","row:sent","row:copied","row:moved","source:error","source:total","stream:chunk","stream:end","stream:evicted","rowDrag:started","rowDrag:moved","rowDrag:left","rowDrag:ended","cell:changed","cell:pending","cell:confirmed","cell:reverted","cell:conflict","cell:clicked","cell:dblclicked","cell:contextmenu","cell:mouseover","cell:mouseout","cell:mousedown","cell:mouseup","cell:edit:start","cell:edit:end","row:edit:start","row:edit:end","row:clicked","row:dblclicked","row:pending","row:confirmed","row:reverted","row:conflict","form:opened","form:closed","form:saved","form:error","sort:changed","filter:changed","group:toggled","facet:computed","facet:filtered","facet:expanded","facet:failed","column:moved","column:resized","column:visible","column:pinned","column:grouped","column:pivoted","column:filter:open","column:profile:open","column:menu:open","columns:changed","columns:tagged","columngroup:changed","header:contextmenu","pivot:drill","selection:changed","range:changed","clipboard:copy","page:changed","scroll","scroll:end","size:changed","detail:toggled","toolpanel:focus","highlight:changed","find:changed","tree:loading","tree:loaded","tree:loadFailed","tree:loadAborted","state:changed","state:reset","history:changed","history:applied","views:changed","view:applied","view:saved","view:removed","view:renamed","view:default","formatting:changed","redaction:changed","permissions:changed","presentation:changed","presentation:started","presentation:ended","presentation:view","presentation:scale","presentation:spotlight","presentation:captured","comment:added","comment:edited","comment:deleted","comment:failed","comment:resolved","comment:unresolved","comment:threadOpened","comment:threadClosed","comment:indexLoaded","presence:published","presence:joined","presence:updated","presence:left","presence:failed","presence:lockRefused","diff:changed","diff:swapped","timeline:attached","timeline:detached","timeline:seek","timeline:seeking","annotation:changed","validation:failed","validation:cleared","export:progress","export:request","export:done","shortcuts:opened","shortcuts:closed","print:before","print:after","beforeEdit","beforeSort","beforeFilter","beforeColumnMove","beforeColumnResize","beforeColumnHide","beforeSelect","beforeRowAdd","beforeDelete","beforeRowMove","beforeGroup","beforeRowReceive","edit:cancelled","sort:cancelled","filter:cancelled","columnMove:cancelled","columnResize:cancelled","columnHide:cancelled","selection:cancelled","rowAdd:cancelled","delete:cancelled","rowMove:cancelled","group:cancelled","rowReceive:cancelled"]),ne=Object.freeze({sort:(o,l)=>o.sort.set(l||[]),filters:(o,l)=>o.filters.set(l||null),quickFilter:(o,l)=>{if(l&&typeof l=="object"){o.filters.quick(l.text||"",{mode:l.mode});return}o.filters.quick(typeof l=="string"?l:"")},selectedKeys:(o,l)=>o.selection.set(Array.isArray(l)?l:[])});function Z(o){return`on${String(o).split(":").map(E=>E.charAt(0).toUpperCase()+E.slice(1)).join("")}`}function H(o){return String(o).replace(/:/g,"-")}const ce=Object.freeze({"row-key":"rowKey","row-height":"rowHeight","header-height":"headerHeight","auto-height":"autoHeight"});function oe(o){return Object.hasOwn(ce,o)?ce[o]:o}const U=Object.freeze(Object.fromEntries(_.map(o=>[Z(o),o])));function J(o){return Object.hasOwn(U,o)}function ie(o){const l={},E={},w={};for(const[p,k]of Object.entries(o||{})){if(J(p)){w[p]=k;continue}if(Object.hasOwn(ne,p)){E[p]=k;continue}l[p]=k}return{config:l,imperative:E,handlers:w}}function u(o){const l=o.createGrid;if(typeof l!="function")throw new TypeError("createGridController needs createGrid; pass it in from the grid package.");const E=ie(o.props||{}),w=l(o.element,{...E.config});let p=E.handlers,k=E.config,A={};const v=D=>{if(!D||typeof D.type!="string")return;const L=p[Z(D.type)];typeof L=="function"&&L(D)},Y=w.on("*",v);for(const[D,L]of Object.entries(E.imperative))L!==void 0&&(ne[D](w,L),A[D]=L);let G=!1;return{grid:w,update(D){if(G)return;const L=ie(D||{});p=L.handlers;const V={};for(const[h,T]of Object.entries(L.config))Object.is(k[h],T)||(V[h]=T);for(const h of Object.keys(k))Object.hasOwn(L.config,h)||(V[h]=void 0);Object.keys(V).length&&w.setAll(V),k=L.config;for(const[h,T]of Object.entries(ne)){const I=L.imperative[h];Object.is(A[h],I)||I===void 0&&!Object.hasOwn(A,h)||(T(w,I),A[h]=I)}},destroy(){G||(G=!0,Y(),w.destroy())}}}}),be("packages/modules/react/viewers.js",function(c,x){"use strict";Object.defineProperty(c,"VIEWER_EVENTS",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(c,"VIEWER_APPLY",{enumerable:!0,get:function(){return H}}),Object.defineProperty(c,"VIEWER_BULK_UPDATE",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(c,"viewerHandlerName",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(c,"partitionViewerProps",{enumerable:!0,get:function(){return J}}),Object.defineProperty(c,"createViewerController",{enumerable:!0,get:function(){return ie}});const ne=x("packages/core/src/internal/util.js").warnOnce,Z=Object.freeze({kpi:Object.freeze(["tile:click","tile:dblclick","tile:contextmenu","node:toggle","change","tile:status"]),kanban:Object.freeze(["card:click","card:dblclick","card:contextmenu","card:move","card:reverted","card:confirmed","selection:changed","column:collapse","card:add","drag:start","drag:end","swimlane:collapse","swimlane:reorder","column:reorder","filter:changed","sprint:changed","epic:changed","card:expand","card:drill","card:edit","card:sla","beforeMove","beforeAdd","beforeEdit","beforeLaneReorder","beforeColumnReorder","beforeColumnChange","move:cancelled","add:cancelled","edit:cancelled","laneReorder:cancelled","columnReorder:cancelled","columnChange:cancelled"]),tabs:Object.freeze(["beforeTabChange","tab:changed","tabChange:cancelled"]),chart:Object.freeze(["click","hover","leave","draw","legend"]),gantt:Object.freeze(["schedule","error"]),layout:Object.freeze(["layout:changed","window:moved","window:resized","window:closed","beforeWindowClose","windowClose:cancelled"]),router:Object.freeze(["metrics"])}),H=Object.freeze({kpi:Object.freeze({rows:(u,o)=>u.setRows(Array.isArray(o)?o:[])}),kanban:Object.freeze({rows:(u,o)=>u.setRows(Array.isArray(o)?o:[]),quickFilter:(u,o)=>u.setQuickFilter(typeof o=="string"?o:""),sprint:(u,o)=>u.setSprint(o),epic:(u,o)=>u.setEpic(o),loading:(u,o)=>u.setLoading(!!o),error:(u,o)=>u.setError(o??null)}),gantt:Object.freeze({tasks:(u,o)=>u.setTasks(Array.isArray(o)?o:[]),dependencies:(u,o)=>u.setDependencies(Array.isArray(o)?o:[])}),tabs:Object.freeze({active:(u,o)=>{typeof o=="string"&&u.activate(o)}}),chart:Object.freeze({}),layout:Object.freeze({})}),ce=Object.freeze({chart:"update"});function oe(u){return`on${String(u).split(":").map(l=>l.charAt(0).toUpperCase()+l.slice(1)).join("")}`}const U=Object.freeze(Object.fromEntries(Object.entries(Z).map(([u,o])=>[u,Object.freeze(Object.fromEntries(o.map(l=>[oe(l),l])))])));function J(u,o){const l=U[u]||{},E=H[u]||{},w={},p={},k={};for(const[A,v]of Object.entries(o||{})){if(Object.hasOwn(l,A)){k[A]=v;continue}if(Object.hasOwn(E,A)){p[A]=v,w[A]=v;continue}w[A]=v}return{config:w,live:p,handlers:k}}function ie(u){const o=String(u.viewer),l=u.mount,E=u.name||o;if(typeof l!="function")throw new TypeError(`createViewerController needs a mount factory for "${o}"; pass the module's own factory in, e.g. { createKPI } from lattice-grid/modules/kpi.`);const w=J(o,u.props||{}),p=l(u.element,{...w.config});if(!p||typeof p!="object")throw new TypeError(`the ${E} factory returned no instance; nothing can be driven.`);let k=w.handlers,A=w.config;const v={...w.live},Y=[];if(typeof p.on=="function")for(const V of Z[o]||[]){const h=oe(V),T=p.on(V,I=>{const C=k[h];typeof C=="function"&&C(I)});typeof T=="function"&&Y.push(T)}const G=ce[o],D=H[o]||{};let L=!1;return{instance:p,update(V){if(L)return;const h=J(o,V||{});k=h.handlers;const T={};for(const[C,B]of Object.entries(h.config))Object.is(A[C],B)||(T[C]=B);if(A=h.config,!Object.keys(T).length)return;const I=[];for(const C of Object.keys(T)){const B=D[C];if(B){B(p,T[C]),v[C]=T[C];continue}G&&typeof p[G]=="function"||I.push(C)}if(G&&typeof p[G]=="function"){const C={};for(const B of Object.keys(T))D[B]||(C[B]=T[B]);Object.keys(C).length&&p[G](C)}I.length&&ne(`react.viewer.${o}.mountOnly.${I.join(".")}`,`${E}: ${I.map(C=>`\`${C}\``).join(", ")} changed, but ${E} takes ${I.length===1?"it":"them"} only when the viewer is created. Nothing was applied and the viewer was NOT rebuilt — rebuilding it silently would throw away scroll position, selection and expansion. Give the component a \`key\` that changes when this must take effect, so the rebuild is yours and visible, or drive the instance through the ref.`)},destroy(){if(!L){L=!0;for(const V of Y)try{V()}catch{}Y.length=0,typeof p.destroy=="function"&&p.destroy()}}}}}),be("packages/modules/react/index.js",function(c,x){"use strict";Object.defineProperty(c,"EVENT_NAMES",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(c,"handlerName",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(c,"VIEWER_EVENTS",{enumerable:!0,get:function(){return J}}),Object.defineProperty(c,"VIEWER_APPLY",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(c,"viewerHandlerName",{enumerable:!0,get:function(){return u}}),Object.defineProperty(c,"createViewerController",{enumerable:!0,get:function(){return o}}),Object.defineProperty(c,"DEFAULT_GRID_NAME",{enumerable:!0,get:function(){return w}}),Object.defineProperty(c,"createLatticeGrid",{enumerable:!0,get:function(){return L}}),Object.defineProperty(c,"createLatticeGridContext",{enumerable:!0,get:function(){return V}}),Object.defineProperty(c,"createLatticeViewer",{enumerable:!0,get:function(){return h}}),Object.defineProperty(c,"createLatticeKPI",{enumerable:!0,get:function(){return T}}),Object.defineProperty(c,"createLatticeChart",{enumerable:!0,get:function(){return I}}),Object.defineProperty(c,"createLatticeKanban",{enumerable:!0,get:function(){return C}}),Object.defineProperty(c,"createLatticeGantt",{enumerable:!0,get:function(){return B}}),Object.defineProperty(c,"createLatticeLayout",{enumerable:!0,get:function(){return me}}),Object.defineProperty(c,"createLatticeTabs",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(c,"createLatticeRouter",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(c,"createLatticeReact",{enumerable:!0,get:function(){return he}}),Object.defineProperty(c,"default",{enumerable:!0,get:function(){return we}});const ne=x("packages/core/src/internal/util.js").warnOnce,Z=x("packages/modules/shared/adapter.js"),H=Z.createGridController,ce=Z.EVENT_NAMES,oe=Z.handlerName,U=x("packages/modules/react/viewers.js"),J=U.VIEWER_EVENTS,ie=U.VIEWER_APPLY,u=U.viewerHandlerName,o=U.createViewerController,l=new Set(["className","style","id"]),E=new Set(["onGridReady","onGridDestroy","rowUpdates","predicates","name","route","routeOptions"]),w="default",p=new WeakMap;function k(n){let i=p.get(n);return i||(i=n.createContext(null),i.displayName="LatticeGridContext",p.set(n,i)),i}const A=new WeakMap;function v(n){let i=A.get(n);return i||(i=n.createContext(null),i.displayName="LatticeRouterContext",A.set(n,i)),i}function Y(n,i){if(!n||typeof n.createElement!="function")throw new TypeError(`${i} needs React: ${i}({ React, … }).`)}function G(n,i){const s={},m={},d={};for(const[g,y]of Object.entries(n||{}))l.has(g)?s[g]=y:i.has(g)?m[g]=y:d[g]=y;return{host:s,own:m,rest:d}}function D(n,i,s){const m=i&&typeof i=="object"?i:{},d=s&&typeof s=="object"?s:{};for(const[g,y]of Object.entries(m))Object.is(d[g],y)||n.filters.where(g,typeof y=="function"?y:null);for(const g of Object.keys(d))Object.hasOwn(m,g)||n.filters.where(g,null)}function L(n){const i=n&&n.React,s=n&&n.createGrid;if(Y(i,"createLatticeGrid"),typeof s!="function")throw new TypeError("createLatticeGrid needs createGrid: createLatticeGrid({ React, createGrid }).");const{createElement:m,useRef:d,useEffect:g,useContext:y,useImperativeHandle:X,forwardRef:K}=i,W=typeof i.createContext=="function"&&typeof y=="function",z=W?k(i):null,S=W?v(i):null,O=(M,Q)=>{const N=d(null),j=d(null),e=d(M);e.current=M;const t=d({rowUpdates:void 0,predicates:void 0}),r=W?y(z):null,a=d(r);a.current=r;const R=W?y(S):null,P=d(R);P.current=R,g(()=>{const f=N.current;if(!f)return;const F=e.current,$=G(F,E),ee=H({createGrid:s,element:f,props:$.rest});j.current=ee;const{grid:q}=ee,se=typeof $.own.name=="string"?$.own.name:w;$.own.predicates&&(D(q,$.own.predicates,{}),t.current.predicates=$.own.predicates),a.current&&typeof a.current.publish=="function"&&a.current.publish(se,q);const te=P.current,ae=$.own.route;return te&&ae!==void 0&&typeof te.attach=="function"&&te.attach(q,ae,$.own.routeOptions||{}),typeof $.own.onGridReady=="function"&&$.own.onGridReady(q),()=>{j.current=null;const re=e.current;if(typeof re.onGridDestroy=="function"&&re.onGridDestroy(),te&&typeof te.detach=="function")try{te.detach(q)}catch{}a.current&&typeof a.current.publish=="function"&&a.current.publish(se,null),t.current={rowUpdates:void 0,predicates:void 0},ee.destroy()}},[]),g(()=>{const f=j.current;if(!f)return;const F=G(M,E);f.update(F.rest);const{grid:$}=f;Object.is(t.current.predicates,F.own.predicates)||(D($,F.own.predicates,t.current.predicates),t.current.predicates=F.own.predicates);const ee=F.own.rowUpdates;ee&&!Object.is(t.current.rowUpdates,ee)&&(t.current.rowUpdates=ee,$.rows.apply(ee))}),X(Q,()=>({get grid(){return j.current?j.current.grid:null}}),[]);const{host:b}=G(M,E);return m("div",{...b,ref:N})};return O.displayName="LatticeGrid",typeof K=="function"?K(O):O}function V(n){const i=n&&n.React;if(Y(i,"createLatticeGridContext"),typeof i.createContext!="function")throw new TypeError("createLatticeGridContext needs a React with createContext.");const{createElement:s,useState:m,useCallback:d,useMemo:g,useContext:y}=i,X=k(i),K=z=>{const[S,O]=m(()=>({})),M=d((N,j)=>{O(e=>{if(Object.is(e[N],j))return e;const t={...e};return j==null?delete t[N]:t[N]=j,t})},[]),Q=g(()=>({grids:S,publish:M}),[S,M]);return s(X.Provider,{value:Q},z.children)};return K.displayName="LatticeGridProvider",{LatticeGridProvider:K,useLatticeGrid:(z=w)=>{const S=y(X);return S&&S.grids?S.grids[z]??null:null}}}function h(n){const i=n&&n.React;Y(i,"createLatticeViewer");const s=String(n.viewer||""),m=n.mount,d=n.name||`Lattice${s.charAt(0).toUpperCase()}${s.slice(1)}`,g=Array.isArray(n.requires)?n.requires:[],y=n.fromContext||null;if(typeof m!="function")throw new TypeError(`${d} needs a mount factory: createLatticeViewer({ React, mount }).`);if(!Object.hasOwn(J,s))throw new TypeError(`createLatticeViewer: "${s}" is not a viewer this adapter knows; expected one of ${Object.keys(J).join(", ")}.`);const{createElement:X,useRef:K,useEffect:W,useContext:z,useImperativeHandle:S,forwardRef:O}=i,M=typeof i.createContext=="function"&&typeof z=="function",Q=M?k(i):null,N=new Set(["gridName","onReady","onDestroy"]),j=(e,t)=>{const r=K(null),a=K(null),R=K(e),P=M?z(Q):null,b=y&&P&&P.grids?P.grids[typeof e.gridName=="string"?e.gridName:w]??null:null,f=y&&e[y]===void 0&&b?{...e,[y]:b}:e;R.current=f;const $=(y&&!g.includes(y)?[...g,y]:g).map(q=>f[q]);W(()=>{const q=r.current;if(!q)return;const se=R.current;if(g.some(re=>se[re]===null||se[re]===void 0))return;const te=G(se,N),ae=o({viewer:s,mount:m,element:q,props:te.rest,name:d});return a.current=ae,typeof te.own.onReady=="function"&&te.own.onReady(ae.instance),()=>{a.current=null;const re=R.current;typeof re.onDestroy=="function"&&re.onDestroy(),ae.destroy()}},$),W(()=>{const q=a.current;q&&q.update(G(R.current,N).rest)}),S(t,()=>({get instance(){return a.current?a.current.instance:null}}),[]);const{host:ee}=G(f,N);return X("div",{...ee,ref:r})};return j.displayName=d,typeof O=="function"?O(j):j}function T(n){const i=n&&n.createKPI;if(typeof i!="function")throw new TypeError("createLatticeKPI needs createKPI: createLatticeKPI({ React, createKPI }).");return h({React:n.React,viewer:"kpi",name:"LatticeKPI",mount:(s,m)=>i(s,m),fromContext:"grid"})}function I(n){const i=n&&n.createChart;if(typeof i!="function")throw new TypeError("createLatticeChart needs createChart: createLatticeChart({ React, createChart }).");return h({React:n.React,viewer:"chart",name:"LatticeChart",mount:(s,m)=>i({...m,container:s}),requires:["grid"],fromContext:"grid"})}function C(n){const i=n&&n.createKanban;if(typeof i!="function")throw new TypeError("createLatticeKanban needs createKanban: createLatticeKanban({ React, createKanban }).");return h({React:n.React,viewer:"kanban",name:"LatticeKanban",mount:(s,m)=>i(s,m),fromContext:"grid"})}function B(n){const i=n&&n.createGantt;if(typeof i!="function")throw new TypeError("createLatticeGantt needs createGantt: createLatticeGantt({ React, createGantt }).");return h({React:n.React,viewer:"gantt",name:"LatticeGantt",mount:(s,m)=>i({...m,element:s})})}function me(n){const i=n&&n.createLayout;if(typeof i!="function")throw new TypeError("createLatticeLayout needs createLayout: createLatticeLayout({ React, createLayout }).");return h({React:n.React,viewer:"layout",name:"LatticeLayout",mount:(s,m)=>i(s,m)})}function ye(n){const i=n&&n.React,s=n&&n.ReactDOM,m=n&&n.createTabs;if(Y(i,"createLatticeTabs"),!s||typeof s.createPortal!="function")throw new TypeError("createLatticeTabs needs react-dom for createPortal: createLatticeTabs({ React, ReactDOM, createTabs }) with ReactDOM from 'react-dom'.");if(typeof m!="function")throw new TypeError("createLatticeTabs needs createTabs: createLatticeTabs({ React, ReactDOM, createTabs }).");const{createElement:d,Fragment:g,useRef:y,useEffect:X,useState:K,useImperativeHandle:W,forwardRef:z}=i,S=(O,M)=>{const Q=y(null),N=y(null),j=y(O);j.current=O;const[e,t]=K(()=>({})),r=y(null);X(()=>{const b=Q.current;if(!b)return;const f=j.current,{host:F,own:$,rest:ee}=G(f,new Set(["tabs","active"])),q=Array.isArray(f.tabs)?f.tabs:[],se={},te=q.map(le=>{const ue=le;if(ue.content===void 0)return ue;const{content:Oe,...je}=ue;return{...je,view:de=>(se[ue.id]=de,t(fe=>fe[ue.id]===de?fe:{...fe,[ue.id]:de}),{destroy(){t(fe=>{if(!Object.hasOwn(fe,ue.id))return fe;const Le={...fe};return delete Le[ue.id],Le})}})}}),ae=m(b,{...ee,tabs:te,createGrid:n.createGrid||(()=>{throw new Error("[lattice] LatticeTabs: a tab has no `content` and no `createGrid` was injected, so there is nothing to build it with. Give the tab a React `content`, or pass createGrid into createLatticeTabs.")}),...typeof f.active=="string"?{active:f.active}:{}});N.current=ae,r.current=f.tabs;const re=[];for(const le of J.tabs){const ue=u(le),Oe=ae.on(le,je=>{const de=j.current[ue];typeof de=="function"&&de(je)});typeof Oe=="function"&&re.push(Oe)}return()=>{N.current=null;for(const le of re)try{le()}catch{}ae.destroy(),t({})}},[]),X(()=>{const b=N.current;if(!b)return;const f=O.active;typeof f=="string"&&b.activeId!==f&&b.activate(f),Object.is(r.current,O.tabs)||(r.current=O.tabs,ne("react.tabs.mountOnly.tabs","LatticeTabs: `tabs` changed (a label, a badge or a descriptor), but the strip takes it only when created — the module has no way to repaint an existing tab. Nothing was applied and the strip was NOT rebuilt — rebuilding it would lose whichever tab is open and any state its content holds. Give the component a `key` that changes when a genuine rebuild is wanted; a live badge otherwise needs to live in your own render, as `tab.badge` on this component's own props does today."))}),W(M,()=>({get instance(){return N.current},get tabs(){return N.current}}),[]);const{host:a}=G(O,new Set(["tabs","active"])),P=(Array.isArray(O.tabs)?O.tabs:[]).filter(b=>b.content!==void 0&&e[b.id]).map(b=>{const f=b,F=typeof f.content=="function"?f.content():f.content;return s.createPortal(F,e[f.id],f.id)});return d(g,null,d("div",{...a,ref:Q}),...P)};return S.displayName="LatticeTabs",typeof z=="function"?z(S):S}function pe(n){const i=n&&n.React,s=n&&n.createDataRouter;if(Y(i,"createLatticeRouter"),typeof i.createContext!="function")throw new TypeError("createLatticeRouter needs a React with createContext.");if(typeof s!="function")throw new TypeError("createLatticeRouter needs createDataRouter: createLatticeRouter({ React, createDataRouter }).");const{createElement:m,useState:d,useEffect:g,useRef:y,useContext:X}=i,K=v(i),W=O=>{const[M,Q]=d(null),N=y(O);return g(()=>{const j=s(N.current||{});return Q(j),()=>{Q(null),j.destroy()}},[]),M},z=O=>m(K.Provider,{value:O.router??null},O.children);return z.displayName="LatticeRouterProvider",{useLatticeRouter:W,LatticeRouterProvider:z,useRouter:()=>X(K)}}function he(n){const i=n&&n.React;Y(i,"createLatticeReact");const{LatticeGridProvider:s,useLatticeGrid:m}=V({React:i}),d={LatticeGridProvider:s,useLatticeGrid:m};return typeof n.createGrid=="function"&&(d.LatticeGrid=L({React:i,createGrid:n.createGrid})),typeof n.createKPI=="function"&&(d.LatticeKPI=T({React:i,createKPI:n.createKPI})),typeof n.createChart=="function"&&(d.LatticeChart=I({React:i,createChart:n.createChart})),typeof n.createKanban=="function"&&(d.LatticeKanban=C({React:i,createKanban:n.createKanban})),typeof n.createGantt=="function"&&(d.LatticeGantt=B({React:i,createGantt:n.createGantt})),typeof n.createLayout=="function"&&(d.LatticeLayout=me({React:i,createLayout:n.createLayout})),typeof n.createTabs=="function"&&n.ReactDOM&&(d.LatticeTabs=ye({React:i,ReactDOM:n.ReactDOM,createTabs:n.createTabs,createGrid:n.createGrid})),typeof n.createDataRouter=="function"&&Object.assign(d,pe({React:i,createDataRouter:n.createDataRouter})),d}const we=L});var ge=Ee("packages/modules/react/index.js");typeof module=="object"&&module.exports?module.exports=ge:typeof define=="function"&&define.amd?define(function(){return ge}):Ce.LatticeGridReact=ge})(typeof globalThis<"u"?globalThis:this);
6
+ (function(Ce){"use strict";var Re=Object.create(null),Pe=Object.create(null);function be(c,x){Re[c]=x}function Ee(c){var x=Pe[c];if(x)return x;var _=Object.create(null);Pe[c]=_;var ne=Re[c];if(!ne)throw new Error("[lattice] missing module: "+c);return ne(_,Ee),_}be("packages/core/src/internal/util.js",function(c,x){"use strict";Object.defineProperty(c,"VERSION",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(c,"reportedWarnings",{enumerable:!0,get:function(){return o}}),Object.defineProperty(c,"warnOnce",{enumerable:!0,get:function(){return l}}),Object.defineProperty(c,"infoOnce",{enumerable:!0,get:function(){return E}}),Object.defineProperty(c,"resetWarnings",{enumerable:!0,get:function(){return w}}),Object.defineProperty(c,"fail",{enumerable:!0,get:function(){return p}}),Object.defineProperty(c,"invariant",{enumerable:!0,get:function(){return k}}),Object.defineProperty(c,"DEV",{enumerable:!0,get:function(){return A}}),Object.defineProperty(c,"isObject",{enumerable:!0,get:function(){return v}}),Object.defineProperty(c,"isFunction",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(c,"isNil",{enumerable:!0,get:function(){return G}}),Object.defineProperty(c,"isBlank",{enumerable:!0,get:function(){return D}}),Object.defineProperty(c,"isCtor",{enumerable:!0,get:function(){return L}}),Object.defineProperty(c,"pathGetter",{enumerable:!0,get:function(){return h}}),Object.defineProperty(c,"pathSetter",{enumerable:!0,get:function(){return I}}),Object.defineProperty(c,"getPath",{enumerable:!0,get:function(){return C}}),Object.defineProperty(c,"setPath",{enumerable:!0,get:function(){return B}}),Object.defineProperty(c,"humanise",{enumerable:!0,get:function(){return me}}),Object.defineProperty(c,"escapeHtml",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(c,"titleCase",{enumerable:!0,get:function(){return he}}),Object.defineProperty(c,"expand",{enumerable:!0,get:function(){return we}}),Object.defineProperty(c,"toArray",{enumerable:!0,get:function(){return n}}),Object.defineProperty(c,"merge",{enumerable:!0,get:function(){return s}}),Object.defineProperty(c,"mergeRow",{enumerable:!0,get:function(){return m}}),Object.defineProperty(c,"Lru",{enumerable:!0,get:function(){return d}}),Object.defineProperty(c,"collator",{enumerable:!0,get:function(){return y}}),Object.defineProperty(c,"defaultCompare",{enumerable:!0,get:function(){return X}}),Object.defineProperty(c,"now",{enumerable:!0,get:function(){return K}}),Object.defineProperty(c,"nextFrame",{enumerable:!0,get:function(){return z}}),Object.defineProperty(c,"cancelFrame",{enumerable:!0,get:function(){return S}}),Object.defineProperty(c,"frameBatched",{enumerable:!0,get:function(){return O}}),Object.defineProperty(c,"settleDebounce",{enumerable:!0,get:function(){return M}}),Object.defineProperty(c,"whenIdle",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(c,"uid",{enumerable:!0,get:function(){return j}});const _="1.71.3";async function ne(){return _}const Z="1.71.3",H=new Set,ce=2e3;function oe(e){if(H.add(e),H.size>ce){const t=H.values().next().value;t!==void 0&&H.delete(t)}}const U=[],J=500;function ie(e,t,r){U.push({key:e,level:t,message:r.map(a=>typeof a=="string"?a:u(a)).join(" "),at:Date.now()}),U.length>J&&U.shift()}function u(e){if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch{return String(e)}}function o(){return U.map(e=>({...e}))}function l(e,...t){H.has(e)||(oe(e),ie(e,"warn",t),console.warn("[lattice]",...t))}function E(e,...t){H.has(e)||(oe(e),ie(e,"info",t),console.info("[lattice]",...t))}function w(){H.clear(),U.length=0}function p(e,t){const r=new Error(`[lattice] ${e}`);throw t!==void 0&&(r.cause=t),r}function k(e,t){e||p(t)}const A=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function v(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Y(e){return typeof e=="function"}function G(e){return e==null}function D(e){return e==null||e===""}function L(e){return typeof e!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(e))?!0:!!(e.prototype&&Object.getOwnPropertyNames(e.prototype).length>1)}const V=new Map;function h(e){let t=V.get(e);if(t)return t;if(!e.includes("."))t=r=>r?.[e];else{const r=e.split("."),a=r.length;t=R=>{let P=R;for(let b=0;b<a;b++){if(P==null)return;P=P[r[b]]}return P}}return V.set(e,t),t}const T=new Map;function I(e){let t=T.get(e);if(t)return t;if(!e.includes("."))t=(r,a)=>{r!=null&&(r[e]=a)};else{const r=e.split("."),a=r.length-1;t=(R,P)=>{let b=R;for(let f=0;f<a;f++){if(b==null)return;const F=r[f];b[F]==null&&(b[F]={}),b=b[F]}b!=null&&(b[r[a]]=P)}}return T.set(e,t),t}function C(e,t){return h(t)(e)}function B(e,t,r){I(t)(e,r)}function me(e){return e?(e.includes(".")?e.slice(e.lastIndexOf(".")+1):e).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,r=>r.toUpperCase()):""}const ye={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function pe(e){const t=e==null?"":String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,r=>ye[r]):t}function he(e){return String(e).replace(/\w\S*/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function we(e,t,r){if(e!==void 0)return e===!0?{enabled:!0,...r}:e===!1?{enabled:!1}:v(e)?e:{[t]:e,enabled:!0}}function n(e){return e==null?[]:Array.isArray(e)?e:[e]}const i=Object.freeze(new Set(["__proto__","constructor","prototype"]));function s(e,t){if(!v(e))return v(t)?{...t}:t;if(!v(t))return t===void 0?e:t;const r={...e};for(const a of Object.keys(t)){if(i.has(a))continue;const R=t[a];R!==void 0&&(r[a]=v(R)&&v(r[a])?s(r[a],R):R)}return r}function m(e,t){if(!v(e)||!v(t)||e===t)return t;const r=Object.create(Object.getPrototypeOf(e));return Object.assign(r,e,t),r}class d{#n;#e=new Map;#t;constructor(t=256,r=null){this.#n=t,this.#t=r}get size(){return this.#e.size}get max(){return this.#n}set max(t){this.#n=t,this.#r()}has(t){return this.#e.has(t)}get(t){const r=this.#e;if(!r.has(t))return;const a=r.get(t);return r.delete(t),r.set(t,a),a}peek(t){return this.#e.get(t)}set(t,r){const a=this.#e;return a.has(t)&&a.delete(t),a.set(t,r),this.#r(),r}delete(t){const r=this.#e.get(t);return this.#e.delete(t)&&this.#t&&this.#t(r,t),r}clear(){if(this.#t)for(const[t,r]of this.#e)this.#t(r,t);this.#e.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}#r(){const t=this.#e;for(;t.size>this.#n;){const r=t.keys().next().value,a=t.get(r);t.delete(r),this.#t&&this.#t(a,r)}}}const g=new Map;function y(e,t){const r=`${e||""}|${t?JSON.stringify(t):""}`;let a=g.get(r);return a||(a=new Intl.Collator(e||void 0,{numeric:!0,sensitivity:"variant",...t}),g.set(r,a)),a}function X(e,t){if(e===t)return 0;if(e==null)return 1;if(t==null)return-1;if(typeof e=="number"&&typeof t=="number")return Number.isNaN(e)?Number.isNaN(t)?0:1:Number.isNaN(t)||e<t?-1:e>t?1:0;const r=String(e),a=String(t);return r<a?-1:r>a?1:0}function K(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const W=typeof requestAnimationFrame=="function";function z(e){return W?requestAnimationFrame(e):setTimeout(()=>e(K()),16)}function S(e){e!=null&&(W?cancelAnimationFrame(e):clearTimeout(e))}function O(e){let t=null,r=null;const a=()=>{t=null;const P=r;r=null,e(...P||[])},R=(...P)=>{r=P,t===null&&(t=z(a))};return R.cancel=()=>{S(t),t=null,r=null},R.flush=()=>{t!==null&&(S(t),a())},R}function M(e,t){let r=null,a=null;const R=()=>{if(r=null,a===null)return;const f=a;a=null,e(...f),P()},P=()=>{r=setTimeout(R,t),typeof r?.unref=="function"&&r.unref()},b=(...f)=>{r===null?(e(...f),P()):(a=f,clearTimeout(r),P())};return b.flush=()=>{if(r!==null&&clearTimeout(r),r=null,a===null)return;const f=a;a=null,e(...f)},b.cancel=()=>{r!==null&&clearTimeout(r),r=null,a=null},b.pending=()=>r!==null||a!==null,b}function Q(e,t=50){return typeof requestIdleCallback=="function"?requestIdleCallback(e,{timeout:t}):setTimeout(()=>e({timeRemaining:()=>0,didTimeout:!0}),1)}let N=0;function j(e="l"){return`${e}${(++N).toString(36)}`}}),be("packages/modules/shared/adapter.js",function(c,x){"use strict";Object.defineProperty(c,"EVENT_NAMES",{enumerable:!0,get:function(){return _}}),Object.defineProperty(c,"handlerName",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(c,"dashedName",{enumerable:!0,get:function(){return H}}),Object.defineProperty(c,"CONFIG_KEY_ALIASES",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(c,"aliasConfigKey",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(c,"isHandlerProp",{enumerable:!0,get:function(){return J}}),Object.defineProperty(c,"partition",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(c,"createGridController",{enumerable:!0,get:function(){return u}});const _=Object.freeze(["ready","destroy","render:first","render:done","config:changed","licence:changed","model:changed","rows:changed","rows:queued","rows:deferred","rows:paused","rows:resumed","row:received","row:sent","row:copied","row:moved","source:error","source:total","stream:chunk","stream:end","stream:evicted","rowDrag:started","rowDrag:moved","rowDrag:left","rowDrag:ended","cell:changed","cell:pending","cell:confirmed","cell:reverted","cell:conflict","cell:clicked","cell:dblclicked","cell:contextmenu","cell:mouseover","cell:mouseout","cell:mousedown","cell:mouseup","cell:edit:start","cell:edit:end","row:edit:start","row:edit:end","row:clicked","row:dblclicked","row:pending","row:confirmed","row:reverted","row:conflict","form:opened","form:closed","form:saved","form:error","sort:changed","filter:changed","group:toggled","facet:computed","facet:filtered","facet:expanded","facet:failed","column:moved","column:resized","column:visible","column:pinned","column:grouped","column:pivoted","column:filter:open","column:profile:open","column:menu:open","columns:changed","columns:tagged","columngroup:changed","header:contextmenu","pivot:drill","selection:changed","range:changed","clipboard:copy","page:changed","scroll","scroll:end","size:changed","detail:toggled","toolpanel:focus","highlight:changed","find:changed","tree:loading","tree:loaded","tree:loadFailed","tree:loadAborted","state:changed","state:reset","history:changed","history:applied","views:changed","view:applied","view:saved","view:removed","view:renamed","view:default","formatting:changed","redaction:changed","permissions:changed","presentation:changed","presentation:started","presentation:ended","presentation:view","presentation:scale","presentation:spotlight","presentation:captured","comment:added","comment:edited","comment:deleted","comment:failed","comment:resolved","comment:unresolved","comment:threadOpened","comment:threadClosed","comment:indexLoaded","presence:published","presence:joined","presence:updated","presence:left","presence:failed","presence:lockRefused","diff:changed","diff:swapped","timeline:attached","timeline:detached","timeline:seek","timeline:seeking","annotation:changed","validation:failed","validation:cleared","export:progress","export:request","export:done","shortcuts:opened","shortcuts:closed","print:before","print:after","beforeEdit","beforeSort","beforeFilter","beforeColumnMove","beforeColumnResize","beforeColumnHide","beforeSelect","beforeRowAdd","beforeDelete","beforeRowMove","beforeGroup","beforeRowReceive","edit:cancelled","sort:cancelled","filter:cancelled","columnMove:cancelled","columnResize:cancelled","columnHide:cancelled","selection:cancelled","rowAdd:cancelled","delete:cancelled","rowMove:cancelled","group:cancelled","rowReceive:cancelled"]),ne=Object.freeze({sort:(o,l)=>o.sort.set(l||[]),filters:(o,l)=>o.filters.set(l||null),quickFilter:(o,l)=>{if(l&&typeof l=="object"){o.filters.quick(l.text||"",{mode:l.mode});return}o.filters.quick(typeof l=="string"?l:"")},selectedKeys:(o,l)=>o.selection.set(Array.isArray(l)?l:[])});function Z(o){return`on${String(o).split(":").map(E=>E.charAt(0).toUpperCase()+E.slice(1)).join("")}`}function H(o){return String(o).replace(/:/g,"-")}const ce=Object.freeze({"row-key":"rowKey","row-height":"rowHeight","header-height":"headerHeight","auto-height":"autoHeight"});function oe(o){return Object.hasOwn(ce,o)?ce[o]:o}const U=Object.freeze(Object.fromEntries(_.map(o=>[Z(o),o])));function J(o){return Object.hasOwn(U,o)}function ie(o){const l={},E={},w={};for(const[p,k]of Object.entries(o||{})){if(J(p)){w[p]=k;continue}if(Object.hasOwn(ne,p)){E[p]=k;continue}l[p]=k}return{config:l,imperative:E,handlers:w}}function u(o){const l=o.createGrid;if(typeof l!="function")throw new TypeError("createGridController needs createGrid; pass it in from the grid package.");const E=ie(o.props||{}),w=l(o.element,{...E.config});let p=E.handlers,k=E.config,A={};const v=D=>{if(!D||typeof D.type!="string")return;const L=p[Z(D.type)];typeof L=="function"&&L(D)},Y=w.on("*",v);for(const[D,L]of Object.entries(E.imperative))L!==void 0&&(ne[D](w,L),A[D]=L);let G=!1;return{grid:w,update(D){if(G)return;const L=ie(D||{});p=L.handlers;const V={};for(const[h,T]of Object.entries(L.config))Object.is(k[h],T)||(V[h]=T);for(const h of Object.keys(k))Object.hasOwn(L.config,h)||(V[h]=void 0);Object.keys(V).length&&w.setAll(V),k=L.config;for(const[h,T]of Object.entries(ne)){const I=L.imperative[h];Object.is(A[h],I)||I===void 0&&!Object.hasOwn(A,h)||(T(w,I),A[h]=I)}},destroy(){G||(G=!0,Y(),w.destroy())}}}}),be("packages/modules/react/viewers.js",function(c,x){"use strict";Object.defineProperty(c,"VIEWER_EVENTS",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(c,"VIEWER_APPLY",{enumerable:!0,get:function(){return H}}),Object.defineProperty(c,"VIEWER_BULK_UPDATE",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(c,"viewerHandlerName",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(c,"partitionViewerProps",{enumerable:!0,get:function(){return J}}),Object.defineProperty(c,"createViewerController",{enumerable:!0,get:function(){return ie}});const ne=x("packages/core/src/internal/util.js").warnOnce,Z=Object.freeze({kpi:Object.freeze(["tile:click","tile:dblclick","tile:contextmenu","node:toggle","change","tile:status"]),kanban:Object.freeze(["card:click","card:dblclick","card:contextmenu","card:move","card:reverted","card:confirmed","selection:changed","column:collapse","card:add","drag:start","drag:end","swimlane:collapse","swimlane:reorder","column:reorder","filter:changed","sprint:changed","epic:changed","card:expand","card:drill","card:edit","card:sla","beforeMove","beforeAdd","beforeEdit","beforeLaneReorder","beforeColumnReorder","beforeColumnChange","move:cancelled","add:cancelled","edit:cancelled","laneReorder:cancelled","columnReorder:cancelled","columnChange:cancelled"]),tabs:Object.freeze(["beforeTabChange","tab:changed","tabChange:cancelled"]),chart:Object.freeze(["click","hover","leave","draw","legend"]),gantt:Object.freeze(["schedule","error"]),layout:Object.freeze(["layout:changed","window:moved","window:resized","window:closed","beforeWindowClose","windowClose:cancelled"]),router:Object.freeze(["metrics"])}),H=Object.freeze({kpi:Object.freeze({rows:(u,o)=>u.setRows(Array.isArray(o)?o:[])}),kanban:Object.freeze({rows:(u,o)=>u.setRows(Array.isArray(o)?o:[]),quickFilter:(u,o)=>u.setQuickFilter(typeof o=="string"?o:""),sprint:(u,o)=>u.setSprint(o),epic:(u,o)=>u.setEpic(o),loading:(u,o)=>u.setLoading(!!o),error:(u,o)=>u.setError(o??null)}),gantt:Object.freeze({tasks:(u,o)=>u.setTasks(Array.isArray(o)?o:[]),dependencies:(u,o)=>u.setDependencies(Array.isArray(o)?o:[])}),tabs:Object.freeze({active:(u,o)=>{typeof o=="string"&&u.activate(o)}}),chart:Object.freeze({}),layout:Object.freeze({})}),ce=Object.freeze({chart:"update"});function oe(u){return`on${String(u).split(":").map(l=>l.charAt(0).toUpperCase()+l.slice(1)).join("")}`}const U=Object.freeze(Object.fromEntries(Object.entries(Z).map(([u,o])=>[u,Object.freeze(Object.fromEntries(o.map(l=>[oe(l),l])))])));function J(u,o){const l=U[u]||{},E=H[u]||{},w={},p={},k={};for(const[A,v]of Object.entries(o||{})){if(Object.hasOwn(l,A)){k[A]=v;continue}if(Object.hasOwn(E,A)){p[A]=v,w[A]=v;continue}w[A]=v}return{config:w,live:p,handlers:k}}function ie(u){const o=String(u.viewer),l=u.mount,E=u.name||o;if(typeof l!="function")throw new TypeError(`createViewerController needs a mount factory for "${o}"; pass the module's own factory in, e.g. { createKPI } from lattice-grid/modules/kpi.`);const w=J(o,u.props||{}),p=l(u.element,{...w.config});if(!p||typeof p!="object")throw new TypeError(`the ${E} factory returned no instance; nothing can be driven.`);let k=w.handlers,A=w.config;const v={...w.live},Y=[];if(typeof p.on=="function")for(const V of Z[o]||[]){const h=oe(V),T=p.on(V,I=>{const C=k[h];typeof C=="function"&&C(I)});typeof T=="function"&&Y.push(T)}const G=ce[o],D=H[o]||{};let L=!1;return{instance:p,update(V){if(L)return;const h=J(o,V||{});k=h.handlers;const T={};for(const[C,B]of Object.entries(h.config))Object.is(A[C],B)||(T[C]=B);if(A=h.config,!Object.keys(T).length)return;const I=[];for(const C of Object.keys(T)){const B=D[C];if(B){B(p,T[C]),v[C]=T[C];continue}G&&typeof p[G]=="function"||I.push(C)}if(G&&typeof p[G]=="function"){const C={};for(const B of Object.keys(T))D[B]||(C[B]=T[B]);Object.keys(C).length&&p[G](C)}I.length&&ne(`react.viewer.${o}.mountOnly.${I.join(".")}`,`${E}: ${I.map(C=>`\`${C}\``).join(", ")} changed, but ${E} takes ${I.length===1?"it":"them"} only when the viewer is created. Nothing was applied and the viewer was NOT rebuilt — rebuilding it silently would throw away scroll position, selection and expansion. Give the component a \`key\` that changes when this must take effect, so the rebuild is yours and visible, or drive the instance through the ref.`)},destroy(){if(!L){L=!0;for(const V of Y)try{V()}catch{}Y.length=0,typeof p.destroy=="function"&&p.destroy()}}}}}),be("packages/modules/react/index.js",function(c,x){"use strict";Object.defineProperty(c,"EVENT_NAMES",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(c,"handlerName",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(c,"VIEWER_EVENTS",{enumerable:!0,get:function(){return J}}),Object.defineProperty(c,"VIEWER_APPLY",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(c,"viewerHandlerName",{enumerable:!0,get:function(){return u}}),Object.defineProperty(c,"createViewerController",{enumerable:!0,get:function(){return o}}),Object.defineProperty(c,"DEFAULT_GRID_NAME",{enumerable:!0,get:function(){return w}}),Object.defineProperty(c,"createLatticeGrid",{enumerable:!0,get:function(){return L}}),Object.defineProperty(c,"createLatticeGridContext",{enumerable:!0,get:function(){return V}}),Object.defineProperty(c,"createLatticeViewer",{enumerable:!0,get:function(){return h}}),Object.defineProperty(c,"createLatticeKPI",{enumerable:!0,get:function(){return T}}),Object.defineProperty(c,"createLatticeChart",{enumerable:!0,get:function(){return I}}),Object.defineProperty(c,"createLatticeKanban",{enumerable:!0,get:function(){return C}}),Object.defineProperty(c,"createLatticeGantt",{enumerable:!0,get:function(){return B}}),Object.defineProperty(c,"createLatticeLayout",{enumerable:!0,get:function(){return me}}),Object.defineProperty(c,"createLatticeTabs",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(c,"createLatticeRouter",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(c,"createLatticeReact",{enumerable:!0,get:function(){return he}}),Object.defineProperty(c,"default",{enumerable:!0,get:function(){return we}});const ne=x("packages/core/src/internal/util.js").warnOnce,Z=x("packages/modules/shared/adapter.js"),H=Z.createGridController,ce=Z.EVENT_NAMES,oe=Z.handlerName,U=x("packages/modules/react/viewers.js"),J=U.VIEWER_EVENTS,ie=U.VIEWER_APPLY,u=U.viewerHandlerName,o=U.createViewerController,l=new Set(["className","style","id"]),E=new Set(["onGridReady","onGridDestroy","rowUpdates","predicates","name","route","routeOptions"]),w="default",p=new WeakMap;function k(n){let i=p.get(n);return i||(i=n.createContext(null),i.displayName="LatticeGridContext",p.set(n,i)),i}const A=new WeakMap;function v(n){let i=A.get(n);return i||(i=n.createContext(null),i.displayName="LatticeRouterContext",A.set(n,i)),i}function Y(n,i){if(!n||typeof n.createElement!="function")throw new TypeError(`${i} needs React: ${i}({ React, … }).`)}function G(n,i){const s={},m={},d={};for(const[g,y]of Object.entries(n||{}))l.has(g)?s[g]=y:i.has(g)?m[g]=y:d[g]=y;return{host:s,own:m,rest:d}}function D(n,i,s){const m=i&&typeof i=="object"?i:{},d=s&&typeof s=="object"?s:{};for(const[g,y]of Object.entries(m))Object.is(d[g],y)||n.filters.where(g,typeof y=="function"?y:null);for(const g of Object.keys(d))Object.hasOwn(m,g)||n.filters.where(g,null)}function L(n){const i=n&&n.React,s=n&&n.createGrid;if(Y(i,"createLatticeGrid"),typeof s!="function")throw new TypeError("createLatticeGrid needs createGrid: createLatticeGrid({ React, createGrid }).");const{createElement:m,useRef:d,useEffect:g,useContext:y,useImperativeHandle:X,forwardRef:K}=i,W=typeof i.createContext=="function"&&typeof y=="function",z=W?k(i):null,S=W?v(i):null,O=(M,Q)=>{const N=d(null),j=d(null),e=d(M);e.current=M;const t=d({rowUpdates:void 0,predicates:void 0}),r=W?y(z):null,a=d(r);a.current=r;const R=W?y(S):null,P=d(R);P.current=R,g(()=>{const f=N.current;if(!f)return;const F=e.current,$=G(F,E),ee=H({createGrid:s,element:f,props:$.rest});j.current=ee;const{grid:q}=ee,se=typeof $.own.name=="string"?$.own.name:w;$.own.predicates&&(D(q,$.own.predicates,{}),t.current.predicates=$.own.predicates),a.current&&typeof a.current.publish=="function"&&a.current.publish(se,q);const te=P.current,ae=$.own.route;return te&&ae!==void 0&&typeof te.attach=="function"&&te.attach(q,ae,$.own.routeOptions||{}),typeof $.own.onGridReady=="function"&&$.own.onGridReady(q),()=>{j.current=null;const re=e.current;if(typeof re.onGridDestroy=="function"&&re.onGridDestroy(),te&&typeof te.detach=="function")try{te.detach(q)}catch{}a.current&&typeof a.current.publish=="function"&&a.current.publish(se,null),t.current={rowUpdates:void 0,predicates:void 0},ee.destroy()}},[]),g(()=>{const f=j.current;if(!f)return;const F=G(M,E);f.update(F.rest);const{grid:$}=f;Object.is(t.current.predicates,F.own.predicates)||(D($,F.own.predicates,t.current.predicates),t.current.predicates=F.own.predicates);const ee=F.own.rowUpdates;ee&&!Object.is(t.current.rowUpdates,ee)&&(t.current.rowUpdates=ee,$.rows.apply(ee))}),X(Q,()=>({get grid(){return j.current?j.current.grid:null}}),[]);const{host:b}=G(M,E);return m("div",{...b,ref:N})};return O.displayName="LatticeGrid",typeof K=="function"?K(O):O}function V(n){const i=n&&n.React;if(Y(i,"createLatticeGridContext"),typeof i.createContext!="function")throw new TypeError("createLatticeGridContext needs a React with createContext.");const{createElement:s,useState:m,useCallback:d,useMemo:g,useContext:y}=i,X=k(i),K=z=>{const[S,O]=m(()=>({})),M=d((N,j)=>{O(e=>{if(Object.is(e[N],j))return e;const t={...e};return j==null?delete t[N]:t[N]=j,t})},[]),Q=g(()=>({grids:S,publish:M}),[S,M]);return s(X.Provider,{value:Q},z.children)};return K.displayName="LatticeGridProvider",{LatticeGridProvider:K,useLatticeGrid:(z=w)=>{const S=y(X);return S&&S.grids?S.grids[z]??null:null}}}function h(n){const i=n&&n.React;Y(i,"createLatticeViewer");const s=String(n.viewer||""),m=n.mount,d=n.name||`Lattice${s.charAt(0).toUpperCase()}${s.slice(1)}`,g=Array.isArray(n.requires)?n.requires:[],y=n.fromContext||null;if(typeof m!="function")throw new TypeError(`${d} needs a mount factory: createLatticeViewer({ React, mount }).`);if(!Object.hasOwn(J,s))throw new TypeError(`createLatticeViewer: "${s}" is not a viewer this adapter knows; expected one of ${Object.keys(J).join(", ")}.`);const{createElement:X,useRef:K,useEffect:W,useContext:z,useImperativeHandle:S,forwardRef:O}=i,M=typeof i.createContext=="function"&&typeof z=="function",Q=M?k(i):null,N=new Set(["gridName","onReady","onDestroy"]),j=(e,t)=>{const r=K(null),a=K(null),R=K(e),P=M?z(Q):null,b=y&&P&&P.grids?P.grids[typeof e.gridName=="string"?e.gridName:w]??null:null,f=y&&e[y]===void 0&&b?{...e,[y]:b}:e;R.current=f;const $=(y&&!g.includes(y)?[...g,y]:g).map(q=>f[q]);W(()=>{const q=r.current;if(!q)return;const se=R.current;if(g.some(re=>se[re]===null||se[re]===void 0))return;const te=G(se,N),ae=o({viewer:s,mount:m,element:q,props:te.rest,name:d});return a.current=ae,typeof te.own.onReady=="function"&&te.own.onReady(ae.instance),()=>{a.current=null;const re=R.current;typeof re.onDestroy=="function"&&re.onDestroy(),ae.destroy()}},$),W(()=>{const q=a.current;q&&q.update(G(R.current,N).rest)}),S(t,()=>({get instance(){return a.current?a.current.instance:null}}),[]);const{host:ee}=G(f,N);return X("div",{...ee,ref:r})};return j.displayName=d,typeof O=="function"?O(j):j}function T(n){const i=n&&n.createKPI;if(typeof i!="function")throw new TypeError("createLatticeKPI needs createKPI: createLatticeKPI({ React, createKPI }).");return h({React:n.React,viewer:"kpi",name:"LatticeKPI",mount:(s,m)=>i(s,m),fromContext:"grid"})}function I(n){const i=n&&n.createChart;if(typeof i!="function")throw new TypeError("createLatticeChart needs createChart: createLatticeChart({ React, createChart }).");return h({React:n.React,viewer:"chart",name:"LatticeChart",mount:(s,m)=>i({...m,container:s}),requires:["grid"],fromContext:"grid"})}function C(n){const i=n&&n.createKanban;if(typeof i!="function")throw new TypeError("createLatticeKanban needs createKanban: createLatticeKanban({ React, createKanban }).");return h({React:n.React,viewer:"kanban",name:"LatticeKanban",mount:(s,m)=>i(s,m),fromContext:"grid"})}function B(n){const i=n&&n.createGantt;if(typeof i!="function")throw new TypeError("createLatticeGantt needs createGantt: createLatticeGantt({ React, createGantt }).");return h({React:n.React,viewer:"gantt",name:"LatticeGantt",mount:(s,m)=>i({...m,element:s})})}function me(n){const i=n&&n.createLayout;if(typeof i!="function")throw new TypeError("createLatticeLayout needs createLayout: createLatticeLayout({ React, createLayout }).");return h({React:n.React,viewer:"layout",name:"LatticeLayout",mount:(s,m)=>i(s,m)})}function ye(n){const i=n&&n.React,s=n&&n.ReactDOM,m=n&&n.createTabs;if(Y(i,"createLatticeTabs"),!s||typeof s.createPortal!="function")throw new TypeError("createLatticeTabs needs react-dom for createPortal: createLatticeTabs({ React, ReactDOM, createTabs }) with ReactDOM from 'react-dom'.");if(typeof m!="function")throw new TypeError("createLatticeTabs needs createTabs: createLatticeTabs({ React, ReactDOM, createTabs }).");const{createElement:d,Fragment:g,useRef:y,useEffect:X,useState:K,useImperativeHandle:W,forwardRef:z}=i,S=(O,M)=>{const Q=y(null),N=y(null),j=y(O);j.current=O;const[e,t]=K(()=>({})),r=y(null);X(()=>{const b=Q.current;if(!b)return;const f=j.current,{host:F,own:$,rest:ee}=G(f,new Set(["tabs","active"])),q=Array.isArray(f.tabs)?f.tabs:[],se={},te=q.map(le=>{const ue=le;if(ue.content===void 0)return ue;const{content:Oe,...je}=ue;return{...je,view:de=>(se[ue.id]=de,t(fe=>fe[ue.id]===de?fe:{...fe,[ue.id]:de}),{destroy(){t(fe=>{if(!Object.hasOwn(fe,ue.id))return fe;const Le={...fe};return delete Le[ue.id],Le})}})}}),ae=m(b,{...ee,tabs:te,createGrid:n.createGrid||(()=>{throw new Error("[lattice] LatticeTabs: a tab has no `content` and no `createGrid` was injected, so there is nothing to build it with. Give the tab a React `content`, or pass createGrid into createLatticeTabs.")}),...typeof f.active=="string"?{active:f.active}:{}});N.current=ae,r.current=f.tabs;const re=[];for(const le of J.tabs){const ue=u(le),Oe=ae.on(le,je=>{const de=j.current[ue];typeof de=="function"&&de(je)});typeof Oe=="function"&&re.push(Oe)}return()=>{N.current=null;for(const le of re)try{le()}catch{}ae.destroy(),t({})}},[]),X(()=>{const b=N.current;if(!b)return;const f=O.active;typeof f=="string"&&b.activeId!==f&&b.activate(f),Object.is(r.current,O.tabs)||(r.current=O.tabs,ne("react.tabs.mountOnly.tabs","LatticeTabs: `tabs` changed (a label, a badge or a descriptor), but the strip takes it only when created — the module has no way to repaint an existing tab. Nothing was applied and the strip was NOT rebuilt — rebuilding it would lose whichever tab is open and any state its content holds. Give the component a `key` that changes when a genuine rebuild is wanted; a live badge otherwise needs to live in your own render, as `tab.badge` on this component's own props does today."))}),W(M,()=>({get instance(){return N.current},get tabs(){return N.current}}),[]);const{host:a}=G(O,new Set(["tabs","active"])),P=(Array.isArray(O.tabs)?O.tabs:[]).filter(b=>b.content!==void 0&&e[b.id]).map(b=>{const f=b,F=typeof f.content=="function"?f.content():f.content;return s.createPortal(F,e[f.id],f.id)});return d(g,null,d("div",{...a,ref:Q}),...P)};return S.displayName="LatticeTabs",typeof z=="function"?z(S):S}function pe(n){const i=n&&n.React,s=n&&n.createDataRouter;if(Y(i,"createLatticeRouter"),typeof i.createContext!="function")throw new TypeError("createLatticeRouter needs a React with createContext.");if(typeof s!="function")throw new TypeError("createLatticeRouter needs createDataRouter: createLatticeRouter({ React, createDataRouter }).");const{createElement:m,useState:d,useEffect:g,useRef:y,useContext:X}=i,K=v(i),W=O=>{const[M,Q]=d(null),N=y(O);return g(()=>{const j=s(N.current||{});return Q(j),()=>{Q(null),j.destroy()}},[]),M},z=O=>m(K.Provider,{value:O.router??null},O.children);return z.displayName="LatticeRouterProvider",{useLatticeRouter:W,LatticeRouterProvider:z,useRouter:()=>X(K)}}function he(n){const i=n&&n.React;Y(i,"createLatticeReact");const{LatticeGridProvider:s,useLatticeGrid:m}=V({React:i}),d={LatticeGridProvider:s,useLatticeGrid:m};return typeof n.createGrid=="function"&&(d.LatticeGrid=L({React:i,createGrid:n.createGrid})),typeof n.createKPI=="function"&&(d.LatticeKPI=T({React:i,createKPI:n.createKPI})),typeof n.createChart=="function"&&(d.LatticeChart=I({React:i,createChart:n.createChart})),typeof n.createKanban=="function"&&(d.LatticeKanban=C({React:i,createKanban:n.createKanban})),typeof n.createGantt=="function"&&(d.LatticeGantt=B({React:i,createGantt:n.createGantt})),typeof n.createLayout=="function"&&(d.LatticeLayout=me({React:i,createLayout:n.createLayout})),typeof n.createTabs=="function"&&n.ReactDOM&&(d.LatticeTabs=ye({React:i,ReactDOM:n.ReactDOM,createTabs:n.createTabs,createGrid:n.createGrid})),typeof n.createDataRouter=="function"&&Object.assign(d,pe({React:i,createDataRouter:n.createDataRouter})),d}const we=L});var ge=Ee("packages/modules/react/index.js");typeof module=="object"&&module.exports?module.exports=ge:typeof define=="function"&&define.amd?define(function(){return ge}):Ce.LatticeGridReact=ge})(typeof globalThis<"u"?globalThis:this);
7
7
 
8
8
  //# sourceMappingURL=react.min.js.map
@@ -1,8 +1,8 @@
1
1
  /*!
2
- * Lattice Grid 1.71.1, react module
2
+ * Lattice Grid 1.71.3, react module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
6
- (function(Ce){"use strict";var Re=Object.create(null),Pe=Object.create(null);function be(c,x){Re[c]=x}function Ee(c){var x=Pe[c];if(x)return x;var _=Object.create(null);Pe[c]=_;var ne=Re[c];if(!ne)throw new Error("[lattice] missing module: "+c);return ne(_,Ee),_}be("packages/core/src/internal/util.js",function(c,x){"use strict";Object.defineProperty(c,"VERSION",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(c,"reportedWarnings",{enumerable:!0,get:function(){return o}}),Object.defineProperty(c,"warnOnce",{enumerable:!0,get:function(){return l}}),Object.defineProperty(c,"infoOnce",{enumerable:!0,get:function(){return E}}),Object.defineProperty(c,"resetWarnings",{enumerable:!0,get:function(){return w}}),Object.defineProperty(c,"fail",{enumerable:!0,get:function(){return p}}),Object.defineProperty(c,"invariant",{enumerable:!0,get:function(){return k}}),Object.defineProperty(c,"DEV",{enumerable:!0,get:function(){return A}}),Object.defineProperty(c,"isObject",{enumerable:!0,get:function(){return v}}),Object.defineProperty(c,"isFunction",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(c,"isNil",{enumerable:!0,get:function(){return G}}),Object.defineProperty(c,"isBlank",{enumerable:!0,get:function(){return D}}),Object.defineProperty(c,"isCtor",{enumerable:!0,get:function(){return L}}),Object.defineProperty(c,"pathGetter",{enumerable:!0,get:function(){return h}}),Object.defineProperty(c,"pathSetter",{enumerable:!0,get:function(){return I}}),Object.defineProperty(c,"getPath",{enumerable:!0,get:function(){return C}}),Object.defineProperty(c,"setPath",{enumerable:!0,get:function(){return B}}),Object.defineProperty(c,"humanise",{enumerable:!0,get:function(){return me}}),Object.defineProperty(c,"escapeHtml",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(c,"titleCase",{enumerable:!0,get:function(){return he}}),Object.defineProperty(c,"expand",{enumerable:!0,get:function(){return we}}),Object.defineProperty(c,"toArray",{enumerable:!0,get:function(){return n}}),Object.defineProperty(c,"merge",{enumerable:!0,get:function(){return s}}),Object.defineProperty(c,"mergeRow",{enumerable:!0,get:function(){return m}}),Object.defineProperty(c,"Lru",{enumerable:!0,get:function(){return d}}),Object.defineProperty(c,"collator",{enumerable:!0,get:function(){return y}}),Object.defineProperty(c,"defaultCompare",{enumerable:!0,get:function(){return X}}),Object.defineProperty(c,"now",{enumerable:!0,get:function(){return K}}),Object.defineProperty(c,"nextFrame",{enumerable:!0,get:function(){return z}}),Object.defineProperty(c,"cancelFrame",{enumerable:!0,get:function(){return S}}),Object.defineProperty(c,"frameBatched",{enumerable:!0,get:function(){return O}}),Object.defineProperty(c,"settleDebounce",{enumerable:!0,get:function(){return M}}),Object.defineProperty(c,"whenIdle",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(c,"uid",{enumerable:!0,get:function(){return j}});const _="1.71.1";async function ne(){return _}const Z="1.71.1",H=new Set,ce=2e3;function oe(e){if(H.add(e),H.size>ce){const t=H.values().next().value;t!==void 0&&H.delete(t)}}const U=[],J=500;function ie(e,t,r){U.push({key:e,level:t,message:r.map(a=>typeof a=="string"?a:u(a)).join(" "),at:Date.now()}),U.length>J&&U.shift()}function u(e){if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch{return String(e)}}function o(){return U.map(e=>({...e}))}function l(e,...t){H.has(e)||(oe(e),ie(e,"warn",t),console.warn("[lattice]",...t))}function E(e,...t){H.has(e)||(oe(e),ie(e,"info",t),console.info("[lattice]",...t))}function w(){H.clear(),U.length=0}function p(e,t){const r=new Error(`[lattice] ${e}`);throw t!==void 0&&(r.cause=t),r}function k(e,t){e||p(t)}const A=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function v(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Y(e){return typeof e=="function"}function G(e){return e==null}function D(e){return e==null||e===""}function L(e){return typeof e!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(e))?!0:!!(e.prototype&&Object.getOwnPropertyNames(e.prototype).length>1)}const V=new Map;function h(e){let t=V.get(e);if(t)return t;if(!e.includes("."))t=r=>r?.[e];else{const r=e.split("."),a=r.length;t=R=>{let P=R;for(let b=0;b<a;b++){if(P==null)return;P=P[r[b]]}return P}}return V.set(e,t),t}const T=new Map;function I(e){let t=T.get(e);if(t)return t;if(!e.includes("."))t=(r,a)=>{r!=null&&(r[e]=a)};else{const r=e.split("."),a=r.length-1;t=(R,P)=>{let b=R;for(let f=0;f<a;f++){if(b==null)return;const F=r[f];b[F]==null&&(b[F]={}),b=b[F]}b!=null&&(b[r[a]]=P)}}return T.set(e,t),t}function C(e,t){return h(t)(e)}function B(e,t,r){I(t)(e,r)}function me(e){return e?(e.includes(".")?e.slice(e.lastIndexOf(".")+1):e).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,r=>r.toUpperCase()):""}const ye={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function pe(e){const t=e==null?"":String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,r=>ye[r]):t}function he(e){return String(e).replace(/\w\S*/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function we(e,t,r){if(e!==void 0)return e===!0?{enabled:!0,...r}:e===!1?{enabled:!1}:v(e)?e:{[t]:e,enabled:!0}}function n(e){return e==null?[]:Array.isArray(e)?e:[e]}const i=Object.freeze(new Set(["__proto__","constructor","prototype"]));function s(e,t){if(!v(e))return v(t)?{...t}:t;if(!v(t))return t===void 0?e:t;const r={...e};for(const a of Object.keys(t)){if(i.has(a))continue;const R=t[a];R!==void 0&&(r[a]=v(R)&&v(r[a])?s(r[a],R):R)}return r}function m(e,t){if(!v(e)||!v(t)||e===t)return t;const r=Object.create(Object.getPrototypeOf(e));return Object.assign(r,e,t),r}class d{#n;#e=new Map;#t;constructor(t=256,r=null){this.#n=t,this.#t=r}get size(){return this.#e.size}get max(){return this.#n}set max(t){this.#n=t,this.#r()}has(t){return this.#e.has(t)}get(t){const r=this.#e;if(!r.has(t))return;const a=r.get(t);return r.delete(t),r.set(t,a),a}peek(t){return this.#e.get(t)}set(t,r){const a=this.#e;return a.has(t)&&a.delete(t),a.set(t,r),this.#r(),r}delete(t){const r=this.#e.get(t);return this.#e.delete(t)&&this.#t&&this.#t(r,t),r}clear(){if(this.#t)for(const[t,r]of this.#e)this.#t(r,t);this.#e.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}#r(){const t=this.#e;for(;t.size>this.#n;){const r=t.keys().next().value,a=t.get(r);t.delete(r),this.#t&&this.#t(a,r)}}}const g=new Map;function y(e,t){const r=`${e||""}|${t?JSON.stringify(t):""}`;let a=g.get(r);return a||(a=new Intl.Collator(e||void 0,{numeric:!0,sensitivity:"variant",...t}),g.set(r,a)),a}function X(e,t){if(e===t)return 0;if(e==null)return 1;if(t==null)return-1;if(typeof e=="number"&&typeof t=="number")return Number.isNaN(e)?Number.isNaN(t)?0:1:Number.isNaN(t)||e<t?-1:e>t?1:0;const r=String(e),a=String(t);return r<a?-1:r>a?1:0}function K(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const W=typeof requestAnimationFrame=="function";function z(e){return W?requestAnimationFrame(e):setTimeout(()=>e(K()),16)}function S(e){e!=null&&(W?cancelAnimationFrame(e):clearTimeout(e))}function O(e){let t=null,r=null;const a=()=>{t=null;const P=r;r=null,e(...P||[])},R=(...P)=>{r=P,t===null&&(t=z(a))};return R.cancel=()=>{S(t),t=null,r=null},R.flush=()=>{t!==null&&(S(t),a())},R}function M(e,t){let r=null,a=null;const R=()=>{if(r=null,a===null)return;const f=a;a=null,e(...f),P()},P=()=>{r=setTimeout(R,t),typeof r?.unref=="function"&&r.unref()},b=(...f)=>{r===null?(e(...f),P()):(a=f,clearTimeout(r),P())};return b.flush=()=>{if(r!==null&&clearTimeout(r),r=null,a===null)return;const f=a;a=null,e(...f)},b.cancel=()=>{r!==null&&clearTimeout(r),r=null,a=null},b.pending=()=>r!==null||a!==null,b}function Q(e,t=50){return typeof requestIdleCallback=="function"?requestIdleCallback(e,{timeout:t}):setTimeout(()=>e({timeRemaining:()=>0,didTimeout:!0}),1)}let N=0;function j(e="l"){return`${e}${(++N).toString(36)}`}}),be("packages/modules/shared/adapter.js",function(c,x){"use strict";Object.defineProperty(c,"EVENT_NAMES",{enumerable:!0,get:function(){return _}}),Object.defineProperty(c,"handlerName",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(c,"dashedName",{enumerable:!0,get:function(){return H}}),Object.defineProperty(c,"CONFIG_KEY_ALIASES",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(c,"aliasConfigKey",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(c,"isHandlerProp",{enumerable:!0,get:function(){return J}}),Object.defineProperty(c,"partition",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(c,"createGridController",{enumerable:!0,get:function(){return u}});const _=Object.freeze(["ready","destroy","render:first","render:done","config:changed","licence:changed","model:changed","rows:changed","rows:queued","rows:deferred","rows:paused","rows:resumed","row:received","row:sent","row:copied","row:moved","source:error","source:total","stream:chunk","stream:end","stream:evicted","rowDrag:started","rowDrag:moved","rowDrag:left","rowDrag:ended","cell:changed","cell:pending","cell:confirmed","cell:reverted","cell:conflict","cell:clicked","cell:dblclicked","cell:contextmenu","cell:mouseover","cell:mouseout","cell:mousedown","cell:mouseup","cell:edit:start","cell:edit:end","row:edit:start","row:edit:end","row:clicked","row:dblclicked","row:pending","row:confirmed","row:reverted","row:conflict","form:opened","form:closed","form:saved","form:error","sort:changed","filter:changed","group:toggled","facet:computed","facet:filtered","facet:expanded","facet:failed","column:moved","column:resized","column:visible","column:pinned","column:grouped","column:pivoted","column:filter:open","column:profile:open","column:menu:open","columns:changed","columns:tagged","columngroup:changed","header:contextmenu","pivot:drill","selection:changed","range:changed","clipboard:copy","page:changed","scroll","scroll:end","size:changed","detail:toggled","toolpanel:focus","highlight:changed","find:changed","tree:loading","tree:loaded","tree:loadFailed","tree:loadAborted","state:changed","state:reset","history:changed","history:applied","views:changed","view:applied","view:saved","view:removed","view:renamed","view:default","formatting:changed","redaction:changed","permissions:changed","presentation:changed","presentation:started","presentation:ended","presentation:view","presentation:scale","presentation:spotlight","presentation:captured","comment:added","comment:edited","comment:deleted","comment:failed","comment:resolved","comment:unresolved","comment:threadOpened","comment:threadClosed","comment:indexLoaded","presence:published","presence:joined","presence:updated","presence:left","presence:failed","presence:lockRefused","diff:changed","diff:swapped","timeline:attached","timeline:detached","timeline:seek","timeline:seeking","annotation:changed","validation:failed","validation:cleared","export:progress","export:request","export:done","shortcuts:opened","shortcuts:closed","print:before","print:after","beforeEdit","beforeSort","beforeFilter","beforeColumnMove","beforeColumnResize","beforeColumnHide","beforeSelect","beforeRowAdd","beforeDelete","beforeRowMove","beforeGroup","beforeRowReceive","edit:cancelled","sort:cancelled","filter:cancelled","columnMove:cancelled","columnResize:cancelled","columnHide:cancelled","selection:cancelled","rowAdd:cancelled","delete:cancelled","rowMove:cancelled","group:cancelled","rowReceive:cancelled"]),ne=Object.freeze({sort:(o,l)=>o.sort.set(l||[]),filters:(o,l)=>o.filters.set(l||null),quickFilter:(o,l)=>{if(l&&typeof l=="object"){o.filters.quick(l.text||"",{mode:l.mode});return}o.filters.quick(typeof l=="string"?l:"")},selectedKeys:(o,l)=>o.selection.set(Array.isArray(l)?l:[])});function Z(o){return`on${String(o).split(":").map(E=>E.charAt(0).toUpperCase()+E.slice(1)).join("")}`}function H(o){return String(o).replace(/:/g,"-")}const ce=Object.freeze({"row-key":"rowKey","row-height":"rowHeight","header-height":"headerHeight","auto-height":"autoHeight"});function oe(o){return Object.hasOwn(ce,o)?ce[o]:o}const U=Object.freeze(Object.fromEntries(_.map(o=>[Z(o),o])));function J(o){return Object.hasOwn(U,o)}function ie(o){const l={},E={},w={};for(const[p,k]of Object.entries(o||{})){if(J(p)){w[p]=k;continue}if(Object.hasOwn(ne,p)){E[p]=k;continue}l[p]=k}return{config:l,imperative:E,handlers:w}}function u(o){const l=o.createGrid;if(typeof l!="function")throw new TypeError("createGridController needs createGrid; pass it in from the grid package.");const E=ie(o.props||{}),w=l(o.element,{...E.config});let p=E.handlers,k=E.config,A={};const v=D=>{if(!D||typeof D.type!="string")return;const L=p[Z(D.type)];typeof L=="function"&&L(D)},Y=w.on("*",v);for(const[D,L]of Object.entries(E.imperative))L!==void 0&&(ne[D](w,L),A[D]=L);let G=!1;return{grid:w,update(D){if(G)return;const L=ie(D||{});p=L.handlers;const V={};for(const[h,T]of Object.entries(L.config))Object.is(k[h],T)||(V[h]=T);for(const h of Object.keys(k))Object.hasOwn(L.config,h)||(V[h]=void 0);Object.keys(V).length&&w.setAll(V),k=L.config;for(const[h,T]of Object.entries(ne)){const I=L.imperative[h];Object.is(A[h],I)||I===void 0&&!Object.hasOwn(A,h)||(T(w,I),A[h]=I)}},destroy(){G||(G=!0,Y(),w.destroy())}}}}),be("packages/modules/react/viewers.js",function(c,x){"use strict";Object.defineProperty(c,"VIEWER_EVENTS",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(c,"VIEWER_APPLY",{enumerable:!0,get:function(){return H}}),Object.defineProperty(c,"VIEWER_BULK_UPDATE",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(c,"viewerHandlerName",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(c,"partitionViewerProps",{enumerable:!0,get:function(){return J}}),Object.defineProperty(c,"createViewerController",{enumerable:!0,get:function(){return ie}});const ne=x("packages/core/src/internal/util.js").warnOnce,Z=Object.freeze({kpi:Object.freeze(["tile:click","tile:dblclick","tile:contextmenu","node:toggle","change","tile:status"]),kanban:Object.freeze(["card:click","card:dblclick","card:contextmenu","card:move","card:reverted","card:confirmed","selection:changed","column:collapse","card:add","drag:start","drag:end","swimlane:collapse","swimlane:reorder","column:reorder","filter:changed","sprint:changed","epic:changed","card:expand","card:drill","card:edit","card:sla","beforeMove","beforeAdd","beforeEdit","beforeLaneReorder","beforeColumnReorder","beforeColumnChange","move:cancelled","add:cancelled","edit:cancelled","laneReorder:cancelled","columnReorder:cancelled","columnChange:cancelled"]),tabs:Object.freeze(["beforeTabChange","tab:changed","tabChange:cancelled"]),chart:Object.freeze(["click","hover","leave","draw","legend"]),gantt:Object.freeze(["schedule","error"]),layout:Object.freeze(["layout:changed","window:moved","window:resized","window:closed","beforeWindowClose","windowClose:cancelled"]),router:Object.freeze(["metrics"])}),H=Object.freeze({kpi:Object.freeze({rows:(u,o)=>u.setRows(Array.isArray(o)?o:[])}),kanban:Object.freeze({rows:(u,o)=>u.setRows(Array.isArray(o)?o:[]),quickFilter:(u,o)=>u.setQuickFilter(typeof o=="string"?o:""),sprint:(u,o)=>u.setSprint(o),epic:(u,o)=>u.setEpic(o),loading:(u,o)=>u.setLoading(!!o),error:(u,o)=>u.setError(o??null)}),gantt:Object.freeze({tasks:(u,o)=>u.setTasks(Array.isArray(o)?o:[]),dependencies:(u,o)=>u.setDependencies(Array.isArray(o)?o:[])}),tabs:Object.freeze({active:(u,o)=>{typeof o=="string"&&u.activate(o)}}),chart:Object.freeze({}),layout:Object.freeze({})}),ce=Object.freeze({chart:"update"});function oe(u){return`on${String(u).split(":").map(l=>l.charAt(0).toUpperCase()+l.slice(1)).join("")}`}const U=Object.freeze(Object.fromEntries(Object.entries(Z).map(([u,o])=>[u,Object.freeze(Object.fromEntries(o.map(l=>[oe(l),l])))])));function J(u,o){const l=U[u]||{},E=H[u]||{},w={},p={},k={};for(const[A,v]of Object.entries(o||{})){if(Object.hasOwn(l,A)){k[A]=v;continue}if(Object.hasOwn(E,A)){p[A]=v,w[A]=v;continue}w[A]=v}return{config:w,live:p,handlers:k}}function ie(u){const o=String(u.viewer),l=u.mount,E=u.name||o;if(typeof l!="function")throw new TypeError(`createViewerController needs a mount factory for "${o}"; pass the module's own factory in, e.g. { createKPI } from lattice-grid/modules/kpi.`);const w=J(o,u.props||{}),p=l(u.element,{...w.config});if(!p||typeof p!="object")throw new TypeError(`the ${E} factory returned no instance; nothing can be driven.`);let k=w.handlers,A=w.config;const v={...w.live},Y=[];if(typeof p.on=="function")for(const V of Z[o]||[]){const h=oe(V),T=p.on(V,I=>{const C=k[h];typeof C=="function"&&C(I)});typeof T=="function"&&Y.push(T)}const G=ce[o],D=H[o]||{};let L=!1;return{instance:p,update(V){if(L)return;const h=J(o,V||{});k=h.handlers;const T={};for(const[C,B]of Object.entries(h.config))Object.is(A[C],B)||(T[C]=B);if(A=h.config,!Object.keys(T).length)return;const I=[];for(const C of Object.keys(T)){const B=D[C];if(B){B(p,T[C]),v[C]=T[C];continue}G&&typeof p[G]=="function"||I.push(C)}if(G&&typeof p[G]=="function"){const C={};for(const B of Object.keys(T))D[B]||(C[B]=T[B]);Object.keys(C).length&&p[G](C)}I.length&&ne(`react.viewer.${o}.mountOnly.${I.join(".")}`,`${E}: ${I.map(C=>`\`${C}\``).join(", ")} changed, but ${E} takes ${I.length===1?"it":"them"} only when the viewer is created. Nothing was applied and the viewer was NOT rebuilt — rebuilding it silently would throw away scroll position, selection and expansion. Give the component a \`key\` that changes when this must take effect, so the rebuild is yours and visible, or drive the instance through the ref.`)},destroy(){if(!L){L=!0;for(const V of Y)try{V()}catch{}Y.length=0,typeof p.destroy=="function"&&p.destroy()}}}}}),be("packages/modules/react/index.js",function(c,x){"use strict";Object.defineProperty(c,"EVENT_NAMES",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(c,"handlerName",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(c,"VIEWER_EVENTS",{enumerable:!0,get:function(){return J}}),Object.defineProperty(c,"VIEWER_APPLY",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(c,"viewerHandlerName",{enumerable:!0,get:function(){return u}}),Object.defineProperty(c,"createViewerController",{enumerable:!0,get:function(){return o}}),Object.defineProperty(c,"DEFAULT_GRID_NAME",{enumerable:!0,get:function(){return w}}),Object.defineProperty(c,"createLatticeGrid",{enumerable:!0,get:function(){return L}}),Object.defineProperty(c,"createLatticeGridContext",{enumerable:!0,get:function(){return V}}),Object.defineProperty(c,"createLatticeViewer",{enumerable:!0,get:function(){return h}}),Object.defineProperty(c,"createLatticeKPI",{enumerable:!0,get:function(){return T}}),Object.defineProperty(c,"createLatticeChart",{enumerable:!0,get:function(){return I}}),Object.defineProperty(c,"createLatticeKanban",{enumerable:!0,get:function(){return C}}),Object.defineProperty(c,"createLatticeGantt",{enumerable:!0,get:function(){return B}}),Object.defineProperty(c,"createLatticeLayout",{enumerable:!0,get:function(){return me}}),Object.defineProperty(c,"createLatticeTabs",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(c,"createLatticeRouter",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(c,"createLatticeReact",{enumerable:!0,get:function(){return he}}),Object.defineProperty(c,"default",{enumerable:!0,get:function(){return we}});const ne=x("packages/core/src/internal/util.js").warnOnce,Z=x("packages/modules/shared/adapter.js"),H=Z.createGridController,ce=Z.EVENT_NAMES,oe=Z.handlerName,U=x("packages/modules/react/viewers.js"),J=U.VIEWER_EVENTS,ie=U.VIEWER_APPLY,u=U.viewerHandlerName,o=U.createViewerController,l=new Set(["className","style","id"]),E=new Set(["onGridReady","onGridDestroy","rowUpdates","predicates","name","route","routeOptions"]),w="default",p=new WeakMap;function k(n){let i=p.get(n);return i||(i=n.createContext(null),i.displayName="LatticeGridContext",p.set(n,i)),i}const A=new WeakMap;function v(n){let i=A.get(n);return i||(i=n.createContext(null),i.displayName="LatticeRouterContext",A.set(n,i)),i}function Y(n,i){if(!n||typeof n.createElement!="function")throw new TypeError(`${i} needs React: ${i}({ React, … }).`)}function G(n,i){const s={},m={},d={};for(const[g,y]of Object.entries(n||{}))l.has(g)?s[g]=y:i.has(g)?m[g]=y:d[g]=y;return{host:s,own:m,rest:d}}function D(n,i,s){const m=i&&typeof i=="object"?i:{},d=s&&typeof s=="object"?s:{};for(const[g,y]of Object.entries(m))Object.is(d[g],y)||n.filters.where(g,typeof y=="function"?y:null);for(const g of Object.keys(d))Object.hasOwn(m,g)||n.filters.where(g,null)}function L(n){const i=n&&n.React,s=n&&n.createGrid;if(Y(i,"createLatticeGrid"),typeof s!="function")throw new TypeError("createLatticeGrid needs createGrid: createLatticeGrid({ React, createGrid }).");const{createElement:m,useRef:d,useEffect:g,useContext:y,useImperativeHandle:X,forwardRef:K}=i,W=typeof i.createContext=="function"&&typeof y=="function",z=W?k(i):null,S=W?v(i):null,O=(M,Q)=>{const N=d(null),j=d(null),e=d(M);e.current=M;const t=d({rowUpdates:void 0,predicates:void 0}),r=W?y(z):null,a=d(r);a.current=r;const R=W?y(S):null,P=d(R);P.current=R,g(()=>{const f=N.current;if(!f)return;const F=e.current,$=G(F,E),ee=H({createGrid:s,element:f,props:$.rest});j.current=ee;const{grid:q}=ee,se=typeof $.own.name=="string"?$.own.name:w;$.own.predicates&&(D(q,$.own.predicates,{}),t.current.predicates=$.own.predicates),a.current&&typeof a.current.publish=="function"&&a.current.publish(se,q);const te=P.current,ae=$.own.route;return te&&ae!==void 0&&typeof te.attach=="function"&&te.attach(q,ae,$.own.routeOptions||{}),typeof $.own.onGridReady=="function"&&$.own.onGridReady(q),()=>{j.current=null;const re=e.current;if(typeof re.onGridDestroy=="function"&&re.onGridDestroy(),te&&typeof te.detach=="function")try{te.detach(q)}catch{}a.current&&typeof a.current.publish=="function"&&a.current.publish(se,null),t.current={rowUpdates:void 0,predicates:void 0},ee.destroy()}},[]),g(()=>{const f=j.current;if(!f)return;const F=G(M,E);f.update(F.rest);const{grid:$}=f;Object.is(t.current.predicates,F.own.predicates)||(D($,F.own.predicates,t.current.predicates),t.current.predicates=F.own.predicates);const ee=F.own.rowUpdates;ee&&!Object.is(t.current.rowUpdates,ee)&&(t.current.rowUpdates=ee,$.rows.apply(ee))}),X(Q,()=>({get grid(){return j.current?j.current.grid:null}}),[]);const{host:b}=G(M,E);return m("div",{...b,ref:N})};return O.displayName="LatticeGrid",typeof K=="function"?K(O):O}function V(n){const i=n&&n.React;if(Y(i,"createLatticeGridContext"),typeof i.createContext!="function")throw new TypeError("createLatticeGridContext needs a React with createContext.");const{createElement:s,useState:m,useCallback:d,useMemo:g,useContext:y}=i,X=k(i),K=z=>{const[S,O]=m(()=>({})),M=d((N,j)=>{O(e=>{if(Object.is(e[N],j))return e;const t={...e};return j==null?delete t[N]:t[N]=j,t})},[]),Q=g(()=>({grids:S,publish:M}),[S,M]);return s(X.Provider,{value:Q},z.children)};return K.displayName="LatticeGridProvider",{LatticeGridProvider:K,useLatticeGrid:(z=w)=>{const S=y(X);return S&&S.grids?S.grids[z]??null:null}}}function h(n){const i=n&&n.React;Y(i,"createLatticeViewer");const s=String(n.viewer||""),m=n.mount,d=n.name||`Lattice${s.charAt(0).toUpperCase()}${s.slice(1)}`,g=Array.isArray(n.requires)?n.requires:[],y=n.fromContext||null;if(typeof m!="function")throw new TypeError(`${d} needs a mount factory: createLatticeViewer({ React, mount }).`);if(!Object.hasOwn(J,s))throw new TypeError(`createLatticeViewer: "${s}" is not a viewer this adapter knows; expected one of ${Object.keys(J).join(", ")}.`);const{createElement:X,useRef:K,useEffect:W,useContext:z,useImperativeHandle:S,forwardRef:O}=i,M=typeof i.createContext=="function"&&typeof z=="function",Q=M?k(i):null,N=new Set(["gridName","onReady","onDestroy"]),j=(e,t)=>{const r=K(null),a=K(null),R=K(e),P=M?z(Q):null,b=y&&P&&P.grids?P.grids[typeof e.gridName=="string"?e.gridName:w]??null:null,f=y&&e[y]===void 0&&b?{...e,[y]:b}:e;R.current=f;const $=(y&&!g.includes(y)?[...g,y]:g).map(q=>f[q]);W(()=>{const q=r.current;if(!q)return;const se=R.current;if(g.some(re=>se[re]===null||se[re]===void 0))return;const te=G(se,N),ae=o({viewer:s,mount:m,element:q,props:te.rest,name:d});return a.current=ae,typeof te.own.onReady=="function"&&te.own.onReady(ae.instance),()=>{a.current=null;const re=R.current;typeof re.onDestroy=="function"&&re.onDestroy(),ae.destroy()}},$),W(()=>{const q=a.current;q&&q.update(G(R.current,N).rest)}),S(t,()=>({get instance(){return a.current?a.current.instance:null}}),[]);const{host:ee}=G(f,N);return X("div",{...ee,ref:r})};return j.displayName=d,typeof O=="function"?O(j):j}function T(n){const i=n&&n.createKPI;if(typeof i!="function")throw new TypeError("createLatticeKPI needs createKPI: createLatticeKPI({ React, createKPI }).");return h({React:n.React,viewer:"kpi",name:"LatticeKPI",mount:(s,m)=>i(s,m),fromContext:"grid"})}function I(n){const i=n&&n.createChart;if(typeof i!="function")throw new TypeError("createLatticeChart needs createChart: createLatticeChart({ React, createChart }).");return h({React:n.React,viewer:"chart",name:"LatticeChart",mount:(s,m)=>i({...m,container:s}),requires:["grid"],fromContext:"grid"})}function C(n){const i=n&&n.createKanban;if(typeof i!="function")throw new TypeError("createLatticeKanban needs createKanban: createLatticeKanban({ React, createKanban }).");return h({React:n.React,viewer:"kanban",name:"LatticeKanban",mount:(s,m)=>i(s,m),fromContext:"grid"})}function B(n){const i=n&&n.createGantt;if(typeof i!="function")throw new TypeError("createLatticeGantt needs createGantt: createLatticeGantt({ React, createGantt }).");return h({React:n.React,viewer:"gantt",name:"LatticeGantt",mount:(s,m)=>i({...m,element:s})})}function me(n){const i=n&&n.createLayout;if(typeof i!="function")throw new TypeError("createLatticeLayout needs createLayout: createLatticeLayout({ React, createLayout }).");return h({React:n.React,viewer:"layout",name:"LatticeLayout",mount:(s,m)=>i(s,m)})}function ye(n){const i=n&&n.React,s=n&&n.ReactDOM,m=n&&n.createTabs;if(Y(i,"createLatticeTabs"),!s||typeof s.createPortal!="function")throw new TypeError("createLatticeTabs needs react-dom for createPortal: createLatticeTabs({ React, ReactDOM, createTabs }) with ReactDOM from 'react-dom'.");if(typeof m!="function")throw new TypeError("createLatticeTabs needs createTabs: createLatticeTabs({ React, ReactDOM, createTabs }).");const{createElement:d,Fragment:g,useRef:y,useEffect:X,useState:K,useImperativeHandle:W,forwardRef:z}=i,S=(O,M)=>{const Q=y(null),N=y(null),j=y(O);j.current=O;const[e,t]=K(()=>({})),r=y(null);X(()=>{const b=Q.current;if(!b)return;const f=j.current,{host:F,own:$,rest:ee}=G(f,new Set(["tabs","active"])),q=Array.isArray(f.tabs)?f.tabs:[],se={},te=q.map(le=>{const ue=le;if(ue.content===void 0)return ue;const{content:Oe,...je}=ue;return{...je,view:de=>(se[ue.id]=de,t(fe=>fe[ue.id]===de?fe:{...fe,[ue.id]:de}),{destroy(){t(fe=>{if(!Object.hasOwn(fe,ue.id))return fe;const Le={...fe};return delete Le[ue.id],Le})}})}}),ae=m(b,{...ee,tabs:te,createGrid:n.createGrid||(()=>{throw new Error("[lattice] LatticeTabs: a tab has no `content` and no `createGrid` was injected, so there is nothing to build it with. Give the tab a React `content`, or pass createGrid into createLatticeTabs.")}),...typeof f.active=="string"?{active:f.active}:{}});N.current=ae,r.current=f.tabs;const re=[];for(const le of J.tabs){const ue=u(le),Oe=ae.on(le,je=>{const de=j.current[ue];typeof de=="function"&&de(je)});typeof Oe=="function"&&re.push(Oe)}return()=>{N.current=null;for(const le of re)try{le()}catch{}ae.destroy(),t({})}},[]),X(()=>{const b=N.current;if(!b)return;const f=O.active;typeof f=="string"&&b.activeId!==f&&b.activate(f),Object.is(r.current,O.tabs)||(r.current=O.tabs,ne("react.tabs.mountOnly.tabs","LatticeTabs: `tabs` changed (a label, a badge or a descriptor), but the strip takes it only when created — the module has no way to repaint an existing tab. Nothing was applied and the strip was NOT rebuilt — rebuilding it would lose whichever tab is open and any state its content holds. Give the component a `key` that changes when a genuine rebuild is wanted; a live badge otherwise needs to live in your own render, as `tab.badge` on this component's own props does today."))}),W(M,()=>({get instance(){return N.current},get tabs(){return N.current}}),[]);const{host:a}=G(O,new Set(["tabs","active"])),P=(Array.isArray(O.tabs)?O.tabs:[]).filter(b=>b.content!==void 0&&e[b.id]).map(b=>{const f=b,F=typeof f.content=="function"?f.content():f.content;return s.createPortal(F,e[f.id],f.id)});return d(g,null,d("div",{...a,ref:Q}),...P)};return S.displayName="LatticeTabs",typeof z=="function"?z(S):S}function pe(n){const i=n&&n.React,s=n&&n.createDataRouter;if(Y(i,"createLatticeRouter"),typeof i.createContext!="function")throw new TypeError("createLatticeRouter needs a React with createContext.");if(typeof s!="function")throw new TypeError("createLatticeRouter needs createDataRouter: createLatticeRouter({ React, createDataRouter }).");const{createElement:m,useState:d,useEffect:g,useRef:y,useContext:X}=i,K=v(i),W=O=>{const[M,Q]=d(null),N=y(O);return g(()=>{const j=s(N.current||{});return Q(j),()=>{Q(null),j.destroy()}},[]),M},z=O=>m(K.Provider,{value:O.router??null},O.children);return z.displayName="LatticeRouterProvider",{useLatticeRouter:W,LatticeRouterProvider:z,useRouter:()=>X(K)}}function he(n){const i=n&&n.React;Y(i,"createLatticeReact");const{LatticeGridProvider:s,useLatticeGrid:m}=V({React:i}),d={LatticeGridProvider:s,useLatticeGrid:m};return typeof n.createGrid=="function"&&(d.LatticeGrid=L({React:i,createGrid:n.createGrid})),typeof n.createKPI=="function"&&(d.LatticeKPI=T({React:i,createKPI:n.createKPI})),typeof n.createChart=="function"&&(d.LatticeChart=I({React:i,createChart:n.createChart})),typeof n.createKanban=="function"&&(d.LatticeKanban=C({React:i,createKanban:n.createKanban})),typeof n.createGantt=="function"&&(d.LatticeGantt=B({React:i,createGantt:n.createGantt})),typeof n.createLayout=="function"&&(d.LatticeLayout=me({React:i,createLayout:n.createLayout})),typeof n.createTabs=="function"&&n.ReactDOM&&(d.LatticeTabs=ye({React:i,ReactDOM:n.ReactDOM,createTabs:n.createTabs,createGrid:n.createGrid})),typeof n.createDataRouter=="function"&&Object.assign(d,pe({React:i,createDataRouter:n.createDataRouter})),d}const we=L});var ge=Ee("packages/modules/react/index.js");typeof module=="object"&&module.exports?module.exports=ge:typeof define=="function"&&define.amd?define(function(){return ge}):Ce.LatticeGridReact=ge})(typeof globalThis<"u"?globalThis:this);
6
+ (function(Ce){"use strict";var Re=Object.create(null),Pe=Object.create(null);function be(c,x){Re[c]=x}function Ee(c){var x=Pe[c];if(x)return x;var _=Object.create(null);Pe[c]=_;var ne=Re[c];if(!ne)throw new Error("[lattice] missing module: "+c);return ne(_,Ee),_}be("packages/core/src/internal/util.js",function(c,x){"use strict";Object.defineProperty(c,"VERSION",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(c,"reportedWarnings",{enumerable:!0,get:function(){return o}}),Object.defineProperty(c,"warnOnce",{enumerable:!0,get:function(){return l}}),Object.defineProperty(c,"infoOnce",{enumerable:!0,get:function(){return E}}),Object.defineProperty(c,"resetWarnings",{enumerable:!0,get:function(){return w}}),Object.defineProperty(c,"fail",{enumerable:!0,get:function(){return p}}),Object.defineProperty(c,"invariant",{enumerable:!0,get:function(){return k}}),Object.defineProperty(c,"DEV",{enumerable:!0,get:function(){return A}}),Object.defineProperty(c,"isObject",{enumerable:!0,get:function(){return v}}),Object.defineProperty(c,"isFunction",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(c,"isNil",{enumerable:!0,get:function(){return G}}),Object.defineProperty(c,"isBlank",{enumerable:!0,get:function(){return D}}),Object.defineProperty(c,"isCtor",{enumerable:!0,get:function(){return L}}),Object.defineProperty(c,"pathGetter",{enumerable:!0,get:function(){return h}}),Object.defineProperty(c,"pathSetter",{enumerable:!0,get:function(){return I}}),Object.defineProperty(c,"getPath",{enumerable:!0,get:function(){return C}}),Object.defineProperty(c,"setPath",{enumerable:!0,get:function(){return B}}),Object.defineProperty(c,"humanise",{enumerable:!0,get:function(){return me}}),Object.defineProperty(c,"escapeHtml",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(c,"titleCase",{enumerable:!0,get:function(){return he}}),Object.defineProperty(c,"expand",{enumerable:!0,get:function(){return we}}),Object.defineProperty(c,"toArray",{enumerable:!0,get:function(){return n}}),Object.defineProperty(c,"merge",{enumerable:!0,get:function(){return s}}),Object.defineProperty(c,"mergeRow",{enumerable:!0,get:function(){return m}}),Object.defineProperty(c,"Lru",{enumerable:!0,get:function(){return d}}),Object.defineProperty(c,"collator",{enumerable:!0,get:function(){return y}}),Object.defineProperty(c,"defaultCompare",{enumerable:!0,get:function(){return X}}),Object.defineProperty(c,"now",{enumerable:!0,get:function(){return K}}),Object.defineProperty(c,"nextFrame",{enumerable:!0,get:function(){return z}}),Object.defineProperty(c,"cancelFrame",{enumerable:!0,get:function(){return S}}),Object.defineProperty(c,"frameBatched",{enumerable:!0,get:function(){return O}}),Object.defineProperty(c,"settleDebounce",{enumerable:!0,get:function(){return M}}),Object.defineProperty(c,"whenIdle",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(c,"uid",{enumerable:!0,get:function(){return j}});const _="1.71.3";async function ne(){return _}const Z="1.71.3",H=new Set,ce=2e3;function oe(e){if(H.add(e),H.size>ce){const t=H.values().next().value;t!==void 0&&H.delete(t)}}const U=[],J=500;function ie(e,t,r){U.push({key:e,level:t,message:r.map(a=>typeof a=="string"?a:u(a)).join(" "),at:Date.now()}),U.length>J&&U.shift()}function u(e){if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch{return String(e)}}function o(){return U.map(e=>({...e}))}function l(e,...t){H.has(e)||(oe(e),ie(e,"warn",t),console.warn("[lattice]",...t))}function E(e,...t){H.has(e)||(oe(e),ie(e,"info",t),console.info("[lattice]",...t))}function w(){H.clear(),U.length=0}function p(e,t){const r=new Error(`[lattice] ${e}`);throw t!==void 0&&(r.cause=t),r}function k(e,t){e||p(t)}const A=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function v(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Y(e){return typeof e=="function"}function G(e){return e==null}function D(e){return e==null||e===""}function L(e){return typeof e!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(e))?!0:!!(e.prototype&&Object.getOwnPropertyNames(e.prototype).length>1)}const V=new Map;function h(e){let t=V.get(e);if(t)return t;if(!e.includes("."))t=r=>r?.[e];else{const r=e.split("."),a=r.length;t=R=>{let P=R;for(let b=0;b<a;b++){if(P==null)return;P=P[r[b]]}return P}}return V.set(e,t),t}const T=new Map;function I(e){let t=T.get(e);if(t)return t;if(!e.includes("."))t=(r,a)=>{r!=null&&(r[e]=a)};else{const r=e.split("."),a=r.length-1;t=(R,P)=>{let b=R;for(let f=0;f<a;f++){if(b==null)return;const F=r[f];b[F]==null&&(b[F]={}),b=b[F]}b!=null&&(b[r[a]]=P)}}return T.set(e,t),t}function C(e,t){return h(t)(e)}function B(e,t,r){I(t)(e,r)}function me(e){return e?(e.includes(".")?e.slice(e.lastIndexOf(".")+1):e).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,r=>r.toUpperCase()):""}const ye={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function pe(e){const t=e==null?"":String(e);return/[&<>"']/.test(t)?t.replace(/[&<>"']/g,r=>ye[r]):t}function he(e){return String(e).replace(/\w\S*/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function we(e,t,r){if(e!==void 0)return e===!0?{enabled:!0,...r}:e===!1?{enabled:!1}:v(e)?e:{[t]:e,enabled:!0}}function n(e){return e==null?[]:Array.isArray(e)?e:[e]}const i=Object.freeze(new Set(["__proto__","constructor","prototype"]));function s(e,t){if(!v(e))return v(t)?{...t}:t;if(!v(t))return t===void 0?e:t;const r={...e};for(const a of Object.keys(t)){if(i.has(a))continue;const R=t[a];R!==void 0&&(r[a]=v(R)&&v(r[a])?s(r[a],R):R)}return r}function m(e,t){if(!v(e)||!v(t)||e===t)return t;const r=Object.create(Object.getPrototypeOf(e));return Object.assign(r,e,t),r}class d{#n;#e=new Map;#t;constructor(t=256,r=null){this.#n=t,this.#t=r}get size(){return this.#e.size}get max(){return this.#n}set max(t){this.#n=t,this.#r()}has(t){return this.#e.has(t)}get(t){const r=this.#e;if(!r.has(t))return;const a=r.get(t);return r.delete(t),r.set(t,a),a}peek(t){return this.#e.get(t)}set(t,r){const a=this.#e;return a.has(t)&&a.delete(t),a.set(t,r),this.#r(),r}delete(t){const r=this.#e.get(t);return this.#e.delete(t)&&this.#t&&this.#t(r,t),r}clear(){if(this.#t)for(const[t,r]of this.#e)this.#t(r,t);this.#e.clear()}keys(){return this.#e.keys()}values(){return this.#e.values()}#r(){const t=this.#e;for(;t.size>this.#n;){const r=t.keys().next().value,a=t.get(r);t.delete(r),this.#t&&this.#t(a,r)}}}const g=new Map;function y(e,t){const r=`${e||""}|${t?JSON.stringify(t):""}`;let a=g.get(r);return a||(a=new Intl.Collator(e||void 0,{numeric:!0,sensitivity:"variant",...t}),g.set(r,a)),a}function X(e,t){if(e===t)return 0;if(e==null)return 1;if(t==null)return-1;if(typeof e=="number"&&typeof t=="number")return Number.isNaN(e)?Number.isNaN(t)?0:1:Number.isNaN(t)||e<t?-1:e>t?1:0;const r=String(e),a=String(t);return r<a?-1:r>a?1:0}function K(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const W=typeof requestAnimationFrame=="function";function z(e){return W?requestAnimationFrame(e):setTimeout(()=>e(K()),16)}function S(e){e!=null&&(W?cancelAnimationFrame(e):clearTimeout(e))}function O(e){let t=null,r=null;const a=()=>{t=null;const P=r;r=null,e(...P||[])},R=(...P)=>{r=P,t===null&&(t=z(a))};return R.cancel=()=>{S(t),t=null,r=null},R.flush=()=>{t!==null&&(S(t),a())},R}function M(e,t){let r=null,a=null;const R=()=>{if(r=null,a===null)return;const f=a;a=null,e(...f),P()},P=()=>{r=setTimeout(R,t),typeof r?.unref=="function"&&r.unref()},b=(...f)=>{r===null?(e(...f),P()):(a=f,clearTimeout(r),P())};return b.flush=()=>{if(r!==null&&clearTimeout(r),r=null,a===null)return;const f=a;a=null,e(...f)},b.cancel=()=>{r!==null&&clearTimeout(r),r=null,a=null},b.pending=()=>r!==null||a!==null,b}function Q(e,t=50){return typeof requestIdleCallback=="function"?requestIdleCallback(e,{timeout:t}):setTimeout(()=>e({timeRemaining:()=>0,didTimeout:!0}),1)}let N=0;function j(e="l"){return`${e}${(++N).toString(36)}`}}),be("packages/modules/shared/adapter.js",function(c,x){"use strict";Object.defineProperty(c,"EVENT_NAMES",{enumerable:!0,get:function(){return _}}),Object.defineProperty(c,"handlerName",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(c,"dashedName",{enumerable:!0,get:function(){return H}}),Object.defineProperty(c,"CONFIG_KEY_ALIASES",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(c,"aliasConfigKey",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(c,"isHandlerProp",{enumerable:!0,get:function(){return J}}),Object.defineProperty(c,"partition",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(c,"createGridController",{enumerable:!0,get:function(){return u}});const _=Object.freeze(["ready","destroy","render:first","render:done","config:changed","licence:changed","model:changed","rows:changed","rows:queued","rows:deferred","rows:paused","rows:resumed","row:received","row:sent","row:copied","row:moved","source:error","source:total","stream:chunk","stream:end","stream:evicted","rowDrag:started","rowDrag:moved","rowDrag:left","rowDrag:ended","cell:changed","cell:pending","cell:confirmed","cell:reverted","cell:conflict","cell:clicked","cell:dblclicked","cell:contextmenu","cell:mouseover","cell:mouseout","cell:mousedown","cell:mouseup","cell:edit:start","cell:edit:end","row:edit:start","row:edit:end","row:clicked","row:dblclicked","row:pending","row:confirmed","row:reverted","row:conflict","form:opened","form:closed","form:saved","form:error","sort:changed","filter:changed","group:toggled","facet:computed","facet:filtered","facet:expanded","facet:failed","column:moved","column:resized","column:visible","column:pinned","column:grouped","column:pivoted","column:filter:open","column:profile:open","column:menu:open","columns:changed","columns:tagged","columngroup:changed","header:contextmenu","pivot:drill","selection:changed","range:changed","clipboard:copy","page:changed","scroll","scroll:end","size:changed","detail:toggled","toolpanel:focus","highlight:changed","find:changed","tree:loading","tree:loaded","tree:loadFailed","tree:loadAborted","state:changed","state:reset","history:changed","history:applied","views:changed","view:applied","view:saved","view:removed","view:renamed","view:default","formatting:changed","redaction:changed","permissions:changed","presentation:changed","presentation:started","presentation:ended","presentation:view","presentation:scale","presentation:spotlight","presentation:captured","comment:added","comment:edited","comment:deleted","comment:failed","comment:resolved","comment:unresolved","comment:threadOpened","comment:threadClosed","comment:indexLoaded","presence:published","presence:joined","presence:updated","presence:left","presence:failed","presence:lockRefused","diff:changed","diff:swapped","timeline:attached","timeline:detached","timeline:seek","timeline:seeking","annotation:changed","validation:failed","validation:cleared","export:progress","export:request","export:done","shortcuts:opened","shortcuts:closed","print:before","print:after","beforeEdit","beforeSort","beforeFilter","beforeColumnMove","beforeColumnResize","beforeColumnHide","beforeSelect","beforeRowAdd","beforeDelete","beforeRowMove","beforeGroup","beforeRowReceive","edit:cancelled","sort:cancelled","filter:cancelled","columnMove:cancelled","columnResize:cancelled","columnHide:cancelled","selection:cancelled","rowAdd:cancelled","delete:cancelled","rowMove:cancelled","group:cancelled","rowReceive:cancelled"]),ne=Object.freeze({sort:(o,l)=>o.sort.set(l||[]),filters:(o,l)=>o.filters.set(l||null),quickFilter:(o,l)=>{if(l&&typeof l=="object"){o.filters.quick(l.text||"",{mode:l.mode});return}o.filters.quick(typeof l=="string"?l:"")},selectedKeys:(o,l)=>o.selection.set(Array.isArray(l)?l:[])});function Z(o){return`on${String(o).split(":").map(E=>E.charAt(0).toUpperCase()+E.slice(1)).join("")}`}function H(o){return String(o).replace(/:/g,"-")}const ce=Object.freeze({"row-key":"rowKey","row-height":"rowHeight","header-height":"headerHeight","auto-height":"autoHeight"});function oe(o){return Object.hasOwn(ce,o)?ce[o]:o}const U=Object.freeze(Object.fromEntries(_.map(o=>[Z(o),o])));function J(o){return Object.hasOwn(U,o)}function ie(o){const l={},E={},w={};for(const[p,k]of Object.entries(o||{})){if(J(p)){w[p]=k;continue}if(Object.hasOwn(ne,p)){E[p]=k;continue}l[p]=k}return{config:l,imperative:E,handlers:w}}function u(o){const l=o.createGrid;if(typeof l!="function")throw new TypeError("createGridController needs createGrid; pass it in from the grid package.");const E=ie(o.props||{}),w=l(o.element,{...E.config});let p=E.handlers,k=E.config,A={};const v=D=>{if(!D||typeof D.type!="string")return;const L=p[Z(D.type)];typeof L=="function"&&L(D)},Y=w.on("*",v);for(const[D,L]of Object.entries(E.imperative))L!==void 0&&(ne[D](w,L),A[D]=L);let G=!1;return{grid:w,update(D){if(G)return;const L=ie(D||{});p=L.handlers;const V={};for(const[h,T]of Object.entries(L.config))Object.is(k[h],T)||(V[h]=T);for(const h of Object.keys(k))Object.hasOwn(L.config,h)||(V[h]=void 0);Object.keys(V).length&&w.setAll(V),k=L.config;for(const[h,T]of Object.entries(ne)){const I=L.imperative[h];Object.is(A[h],I)||I===void 0&&!Object.hasOwn(A,h)||(T(w,I),A[h]=I)}},destroy(){G||(G=!0,Y(),w.destroy())}}}}),be("packages/modules/react/viewers.js",function(c,x){"use strict";Object.defineProperty(c,"VIEWER_EVENTS",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(c,"VIEWER_APPLY",{enumerable:!0,get:function(){return H}}),Object.defineProperty(c,"VIEWER_BULK_UPDATE",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(c,"viewerHandlerName",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(c,"partitionViewerProps",{enumerable:!0,get:function(){return J}}),Object.defineProperty(c,"createViewerController",{enumerable:!0,get:function(){return ie}});const ne=x("packages/core/src/internal/util.js").warnOnce,Z=Object.freeze({kpi:Object.freeze(["tile:click","tile:dblclick","tile:contextmenu","node:toggle","change","tile:status"]),kanban:Object.freeze(["card:click","card:dblclick","card:contextmenu","card:move","card:reverted","card:confirmed","selection:changed","column:collapse","card:add","drag:start","drag:end","swimlane:collapse","swimlane:reorder","column:reorder","filter:changed","sprint:changed","epic:changed","card:expand","card:drill","card:edit","card:sla","beforeMove","beforeAdd","beforeEdit","beforeLaneReorder","beforeColumnReorder","beforeColumnChange","move:cancelled","add:cancelled","edit:cancelled","laneReorder:cancelled","columnReorder:cancelled","columnChange:cancelled"]),tabs:Object.freeze(["beforeTabChange","tab:changed","tabChange:cancelled"]),chart:Object.freeze(["click","hover","leave","draw","legend"]),gantt:Object.freeze(["schedule","error"]),layout:Object.freeze(["layout:changed","window:moved","window:resized","window:closed","beforeWindowClose","windowClose:cancelled"]),router:Object.freeze(["metrics"])}),H=Object.freeze({kpi:Object.freeze({rows:(u,o)=>u.setRows(Array.isArray(o)?o:[])}),kanban:Object.freeze({rows:(u,o)=>u.setRows(Array.isArray(o)?o:[]),quickFilter:(u,o)=>u.setQuickFilter(typeof o=="string"?o:""),sprint:(u,o)=>u.setSprint(o),epic:(u,o)=>u.setEpic(o),loading:(u,o)=>u.setLoading(!!o),error:(u,o)=>u.setError(o??null)}),gantt:Object.freeze({tasks:(u,o)=>u.setTasks(Array.isArray(o)?o:[]),dependencies:(u,o)=>u.setDependencies(Array.isArray(o)?o:[])}),tabs:Object.freeze({active:(u,o)=>{typeof o=="string"&&u.activate(o)}}),chart:Object.freeze({}),layout:Object.freeze({})}),ce=Object.freeze({chart:"update"});function oe(u){return`on${String(u).split(":").map(l=>l.charAt(0).toUpperCase()+l.slice(1)).join("")}`}const U=Object.freeze(Object.fromEntries(Object.entries(Z).map(([u,o])=>[u,Object.freeze(Object.fromEntries(o.map(l=>[oe(l),l])))])));function J(u,o){const l=U[u]||{},E=H[u]||{},w={},p={},k={};for(const[A,v]of Object.entries(o||{})){if(Object.hasOwn(l,A)){k[A]=v;continue}if(Object.hasOwn(E,A)){p[A]=v,w[A]=v;continue}w[A]=v}return{config:w,live:p,handlers:k}}function ie(u){const o=String(u.viewer),l=u.mount,E=u.name||o;if(typeof l!="function")throw new TypeError(`createViewerController needs a mount factory for "${o}"; pass the module's own factory in, e.g. { createKPI } from lattice-grid/modules/kpi.`);const w=J(o,u.props||{}),p=l(u.element,{...w.config});if(!p||typeof p!="object")throw new TypeError(`the ${E} factory returned no instance; nothing can be driven.`);let k=w.handlers,A=w.config;const v={...w.live},Y=[];if(typeof p.on=="function")for(const V of Z[o]||[]){const h=oe(V),T=p.on(V,I=>{const C=k[h];typeof C=="function"&&C(I)});typeof T=="function"&&Y.push(T)}const G=ce[o],D=H[o]||{};let L=!1;return{instance:p,update(V){if(L)return;const h=J(o,V||{});k=h.handlers;const T={};for(const[C,B]of Object.entries(h.config))Object.is(A[C],B)||(T[C]=B);if(A=h.config,!Object.keys(T).length)return;const I=[];for(const C of Object.keys(T)){const B=D[C];if(B){B(p,T[C]),v[C]=T[C];continue}G&&typeof p[G]=="function"||I.push(C)}if(G&&typeof p[G]=="function"){const C={};for(const B of Object.keys(T))D[B]||(C[B]=T[B]);Object.keys(C).length&&p[G](C)}I.length&&ne(`react.viewer.${o}.mountOnly.${I.join(".")}`,`${E}: ${I.map(C=>`\`${C}\``).join(", ")} changed, but ${E} takes ${I.length===1?"it":"them"} only when the viewer is created. Nothing was applied and the viewer was NOT rebuilt — rebuilding it silently would throw away scroll position, selection and expansion. Give the component a \`key\` that changes when this must take effect, so the rebuild is yours and visible, or drive the instance through the ref.`)},destroy(){if(!L){L=!0;for(const V of Y)try{V()}catch{}Y.length=0,typeof p.destroy=="function"&&p.destroy()}}}}}),be("packages/modules/react/index.js",function(c,x){"use strict";Object.defineProperty(c,"EVENT_NAMES",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(c,"handlerName",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(c,"VIEWER_EVENTS",{enumerable:!0,get:function(){return J}}),Object.defineProperty(c,"VIEWER_APPLY",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(c,"viewerHandlerName",{enumerable:!0,get:function(){return u}}),Object.defineProperty(c,"createViewerController",{enumerable:!0,get:function(){return o}}),Object.defineProperty(c,"DEFAULT_GRID_NAME",{enumerable:!0,get:function(){return w}}),Object.defineProperty(c,"createLatticeGrid",{enumerable:!0,get:function(){return L}}),Object.defineProperty(c,"createLatticeGridContext",{enumerable:!0,get:function(){return V}}),Object.defineProperty(c,"createLatticeViewer",{enumerable:!0,get:function(){return h}}),Object.defineProperty(c,"createLatticeKPI",{enumerable:!0,get:function(){return T}}),Object.defineProperty(c,"createLatticeChart",{enumerable:!0,get:function(){return I}}),Object.defineProperty(c,"createLatticeKanban",{enumerable:!0,get:function(){return C}}),Object.defineProperty(c,"createLatticeGantt",{enumerable:!0,get:function(){return B}}),Object.defineProperty(c,"createLatticeLayout",{enumerable:!0,get:function(){return me}}),Object.defineProperty(c,"createLatticeTabs",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(c,"createLatticeRouter",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(c,"createLatticeReact",{enumerable:!0,get:function(){return he}}),Object.defineProperty(c,"default",{enumerable:!0,get:function(){return we}});const ne=x("packages/core/src/internal/util.js").warnOnce,Z=x("packages/modules/shared/adapter.js"),H=Z.createGridController,ce=Z.EVENT_NAMES,oe=Z.handlerName,U=x("packages/modules/react/viewers.js"),J=U.VIEWER_EVENTS,ie=U.VIEWER_APPLY,u=U.viewerHandlerName,o=U.createViewerController,l=new Set(["className","style","id"]),E=new Set(["onGridReady","onGridDestroy","rowUpdates","predicates","name","route","routeOptions"]),w="default",p=new WeakMap;function k(n){let i=p.get(n);return i||(i=n.createContext(null),i.displayName="LatticeGridContext",p.set(n,i)),i}const A=new WeakMap;function v(n){let i=A.get(n);return i||(i=n.createContext(null),i.displayName="LatticeRouterContext",A.set(n,i)),i}function Y(n,i){if(!n||typeof n.createElement!="function")throw new TypeError(`${i} needs React: ${i}({ React, … }).`)}function G(n,i){const s={},m={},d={};for(const[g,y]of Object.entries(n||{}))l.has(g)?s[g]=y:i.has(g)?m[g]=y:d[g]=y;return{host:s,own:m,rest:d}}function D(n,i,s){const m=i&&typeof i=="object"?i:{},d=s&&typeof s=="object"?s:{};for(const[g,y]of Object.entries(m))Object.is(d[g],y)||n.filters.where(g,typeof y=="function"?y:null);for(const g of Object.keys(d))Object.hasOwn(m,g)||n.filters.where(g,null)}function L(n){const i=n&&n.React,s=n&&n.createGrid;if(Y(i,"createLatticeGrid"),typeof s!="function")throw new TypeError("createLatticeGrid needs createGrid: createLatticeGrid({ React, createGrid }).");const{createElement:m,useRef:d,useEffect:g,useContext:y,useImperativeHandle:X,forwardRef:K}=i,W=typeof i.createContext=="function"&&typeof y=="function",z=W?k(i):null,S=W?v(i):null,O=(M,Q)=>{const N=d(null),j=d(null),e=d(M);e.current=M;const t=d({rowUpdates:void 0,predicates:void 0}),r=W?y(z):null,a=d(r);a.current=r;const R=W?y(S):null,P=d(R);P.current=R,g(()=>{const f=N.current;if(!f)return;const F=e.current,$=G(F,E),ee=H({createGrid:s,element:f,props:$.rest});j.current=ee;const{grid:q}=ee,se=typeof $.own.name=="string"?$.own.name:w;$.own.predicates&&(D(q,$.own.predicates,{}),t.current.predicates=$.own.predicates),a.current&&typeof a.current.publish=="function"&&a.current.publish(se,q);const te=P.current,ae=$.own.route;return te&&ae!==void 0&&typeof te.attach=="function"&&te.attach(q,ae,$.own.routeOptions||{}),typeof $.own.onGridReady=="function"&&$.own.onGridReady(q),()=>{j.current=null;const re=e.current;if(typeof re.onGridDestroy=="function"&&re.onGridDestroy(),te&&typeof te.detach=="function")try{te.detach(q)}catch{}a.current&&typeof a.current.publish=="function"&&a.current.publish(se,null),t.current={rowUpdates:void 0,predicates:void 0},ee.destroy()}},[]),g(()=>{const f=j.current;if(!f)return;const F=G(M,E);f.update(F.rest);const{grid:$}=f;Object.is(t.current.predicates,F.own.predicates)||(D($,F.own.predicates,t.current.predicates),t.current.predicates=F.own.predicates);const ee=F.own.rowUpdates;ee&&!Object.is(t.current.rowUpdates,ee)&&(t.current.rowUpdates=ee,$.rows.apply(ee))}),X(Q,()=>({get grid(){return j.current?j.current.grid:null}}),[]);const{host:b}=G(M,E);return m("div",{...b,ref:N})};return O.displayName="LatticeGrid",typeof K=="function"?K(O):O}function V(n){const i=n&&n.React;if(Y(i,"createLatticeGridContext"),typeof i.createContext!="function")throw new TypeError("createLatticeGridContext needs a React with createContext.");const{createElement:s,useState:m,useCallback:d,useMemo:g,useContext:y}=i,X=k(i),K=z=>{const[S,O]=m(()=>({})),M=d((N,j)=>{O(e=>{if(Object.is(e[N],j))return e;const t={...e};return j==null?delete t[N]:t[N]=j,t})},[]),Q=g(()=>({grids:S,publish:M}),[S,M]);return s(X.Provider,{value:Q},z.children)};return K.displayName="LatticeGridProvider",{LatticeGridProvider:K,useLatticeGrid:(z=w)=>{const S=y(X);return S&&S.grids?S.grids[z]??null:null}}}function h(n){const i=n&&n.React;Y(i,"createLatticeViewer");const s=String(n.viewer||""),m=n.mount,d=n.name||`Lattice${s.charAt(0).toUpperCase()}${s.slice(1)}`,g=Array.isArray(n.requires)?n.requires:[],y=n.fromContext||null;if(typeof m!="function")throw new TypeError(`${d} needs a mount factory: createLatticeViewer({ React, mount }).`);if(!Object.hasOwn(J,s))throw new TypeError(`createLatticeViewer: "${s}" is not a viewer this adapter knows; expected one of ${Object.keys(J).join(", ")}.`);const{createElement:X,useRef:K,useEffect:W,useContext:z,useImperativeHandle:S,forwardRef:O}=i,M=typeof i.createContext=="function"&&typeof z=="function",Q=M?k(i):null,N=new Set(["gridName","onReady","onDestroy"]),j=(e,t)=>{const r=K(null),a=K(null),R=K(e),P=M?z(Q):null,b=y&&P&&P.grids?P.grids[typeof e.gridName=="string"?e.gridName:w]??null:null,f=y&&e[y]===void 0&&b?{...e,[y]:b}:e;R.current=f;const $=(y&&!g.includes(y)?[...g,y]:g).map(q=>f[q]);W(()=>{const q=r.current;if(!q)return;const se=R.current;if(g.some(re=>se[re]===null||se[re]===void 0))return;const te=G(se,N),ae=o({viewer:s,mount:m,element:q,props:te.rest,name:d});return a.current=ae,typeof te.own.onReady=="function"&&te.own.onReady(ae.instance),()=>{a.current=null;const re=R.current;typeof re.onDestroy=="function"&&re.onDestroy(),ae.destroy()}},$),W(()=>{const q=a.current;q&&q.update(G(R.current,N).rest)}),S(t,()=>({get instance(){return a.current?a.current.instance:null}}),[]);const{host:ee}=G(f,N);return X("div",{...ee,ref:r})};return j.displayName=d,typeof O=="function"?O(j):j}function T(n){const i=n&&n.createKPI;if(typeof i!="function")throw new TypeError("createLatticeKPI needs createKPI: createLatticeKPI({ React, createKPI }).");return h({React:n.React,viewer:"kpi",name:"LatticeKPI",mount:(s,m)=>i(s,m),fromContext:"grid"})}function I(n){const i=n&&n.createChart;if(typeof i!="function")throw new TypeError("createLatticeChart needs createChart: createLatticeChart({ React, createChart }).");return h({React:n.React,viewer:"chart",name:"LatticeChart",mount:(s,m)=>i({...m,container:s}),requires:["grid"],fromContext:"grid"})}function C(n){const i=n&&n.createKanban;if(typeof i!="function")throw new TypeError("createLatticeKanban needs createKanban: createLatticeKanban({ React, createKanban }).");return h({React:n.React,viewer:"kanban",name:"LatticeKanban",mount:(s,m)=>i(s,m),fromContext:"grid"})}function B(n){const i=n&&n.createGantt;if(typeof i!="function")throw new TypeError("createLatticeGantt needs createGantt: createLatticeGantt({ React, createGantt }).");return h({React:n.React,viewer:"gantt",name:"LatticeGantt",mount:(s,m)=>i({...m,element:s})})}function me(n){const i=n&&n.createLayout;if(typeof i!="function")throw new TypeError("createLatticeLayout needs createLayout: createLatticeLayout({ React, createLayout }).");return h({React:n.React,viewer:"layout",name:"LatticeLayout",mount:(s,m)=>i(s,m)})}function ye(n){const i=n&&n.React,s=n&&n.ReactDOM,m=n&&n.createTabs;if(Y(i,"createLatticeTabs"),!s||typeof s.createPortal!="function")throw new TypeError("createLatticeTabs needs react-dom for createPortal: createLatticeTabs({ React, ReactDOM, createTabs }) with ReactDOM from 'react-dom'.");if(typeof m!="function")throw new TypeError("createLatticeTabs needs createTabs: createLatticeTabs({ React, ReactDOM, createTabs }).");const{createElement:d,Fragment:g,useRef:y,useEffect:X,useState:K,useImperativeHandle:W,forwardRef:z}=i,S=(O,M)=>{const Q=y(null),N=y(null),j=y(O);j.current=O;const[e,t]=K(()=>({})),r=y(null);X(()=>{const b=Q.current;if(!b)return;const f=j.current,{host:F,own:$,rest:ee}=G(f,new Set(["tabs","active"])),q=Array.isArray(f.tabs)?f.tabs:[],se={},te=q.map(le=>{const ue=le;if(ue.content===void 0)return ue;const{content:Oe,...je}=ue;return{...je,view:de=>(se[ue.id]=de,t(fe=>fe[ue.id]===de?fe:{...fe,[ue.id]:de}),{destroy(){t(fe=>{if(!Object.hasOwn(fe,ue.id))return fe;const Le={...fe};return delete Le[ue.id],Le})}})}}),ae=m(b,{...ee,tabs:te,createGrid:n.createGrid||(()=>{throw new Error("[lattice] LatticeTabs: a tab has no `content` and no `createGrid` was injected, so there is nothing to build it with. Give the tab a React `content`, or pass createGrid into createLatticeTabs.")}),...typeof f.active=="string"?{active:f.active}:{}});N.current=ae,r.current=f.tabs;const re=[];for(const le of J.tabs){const ue=u(le),Oe=ae.on(le,je=>{const de=j.current[ue];typeof de=="function"&&de(je)});typeof Oe=="function"&&re.push(Oe)}return()=>{N.current=null;for(const le of re)try{le()}catch{}ae.destroy(),t({})}},[]),X(()=>{const b=N.current;if(!b)return;const f=O.active;typeof f=="string"&&b.activeId!==f&&b.activate(f),Object.is(r.current,O.tabs)||(r.current=O.tabs,ne("react.tabs.mountOnly.tabs","LatticeTabs: `tabs` changed (a label, a badge or a descriptor), but the strip takes it only when created — the module has no way to repaint an existing tab. Nothing was applied and the strip was NOT rebuilt — rebuilding it would lose whichever tab is open and any state its content holds. Give the component a `key` that changes when a genuine rebuild is wanted; a live badge otherwise needs to live in your own render, as `tab.badge` on this component's own props does today."))}),W(M,()=>({get instance(){return N.current},get tabs(){return N.current}}),[]);const{host:a}=G(O,new Set(["tabs","active"])),P=(Array.isArray(O.tabs)?O.tabs:[]).filter(b=>b.content!==void 0&&e[b.id]).map(b=>{const f=b,F=typeof f.content=="function"?f.content():f.content;return s.createPortal(F,e[f.id],f.id)});return d(g,null,d("div",{...a,ref:Q}),...P)};return S.displayName="LatticeTabs",typeof z=="function"?z(S):S}function pe(n){const i=n&&n.React,s=n&&n.createDataRouter;if(Y(i,"createLatticeRouter"),typeof i.createContext!="function")throw new TypeError("createLatticeRouter needs a React with createContext.");if(typeof s!="function")throw new TypeError("createLatticeRouter needs createDataRouter: createLatticeRouter({ React, createDataRouter }).");const{createElement:m,useState:d,useEffect:g,useRef:y,useContext:X}=i,K=v(i),W=O=>{const[M,Q]=d(null),N=y(O);return g(()=>{const j=s(N.current||{});return Q(j),()=>{Q(null),j.destroy()}},[]),M},z=O=>m(K.Provider,{value:O.router??null},O.children);return z.displayName="LatticeRouterProvider",{useLatticeRouter:W,LatticeRouterProvider:z,useRouter:()=>X(K)}}function he(n){const i=n&&n.React;Y(i,"createLatticeReact");const{LatticeGridProvider:s,useLatticeGrid:m}=V({React:i}),d={LatticeGridProvider:s,useLatticeGrid:m};return typeof n.createGrid=="function"&&(d.LatticeGrid=L({React:i,createGrid:n.createGrid})),typeof n.createKPI=="function"&&(d.LatticeKPI=T({React:i,createKPI:n.createKPI})),typeof n.createChart=="function"&&(d.LatticeChart=I({React:i,createChart:n.createChart})),typeof n.createKanban=="function"&&(d.LatticeKanban=C({React:i,createKanban:n.createKanban})),typeof n.createGantt=="function"&&(d.LatticeGantt=B({React:i,createGantt:n.createGantt})),typeof n.createLayout=="function"&&(d.LatticeLayout=me({React:i,createLayout:n.createLayout})),typeof n.createTabs=="function"&&n.ReactDOM&&(d.LatticeTabs=ye({React:i,ReactDOM:n.ReactDOM,createTabs:n.createTabs,createGrid:n.createGrid})),typeof n.createDataRouter=="function"&&Object.assign(d,pe({React:i,createDataRouter:n.createDataRouter})),d}const we=L});var ge=Ee("packages/modules/react/index.js");typeof module=="object"&&module.exports?module.exports=ge:typeof define=="function"&&define.amd?define(function(){return ge}):Ce.LatticeGridReact=ge})(typeof globalThis<"u"?globalThis:this);
7
7
 
8
8
  //# sourceMappingURL=react.min.js.map
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Lattice Grid 1.71.1, svelte module type declarations
2
+ * Lattice Grid 1.71.3, svelte module type declarations
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */