@nice2dev/ui 1.1.10 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (269) hide show
  1. package/CHANGELOG.md +183 -0
  2. package/README.md +12 -20
  3. package/dist/NiceApiExplorer.doc-CFJndg5h.js +25 -0
  4. package/dist/NiceApiExplorer.doc-TEx67kV5.cjs +1 -0
  5. package/dist/NiceBPMNDesigner.doc-6lK1pXRq.js +32 -0
  6. package/dist/NiceBPMNDesigner.doc-BY8t7qOi.cjs +8 -0
  7. package/dist/NiceBackupDiffViewer.doc-CYvOeX19.js +25 -0
  8. package/dist/NiceBackupDiffViewer.doc-ChQaZCg1.cjs +1 -0
  9. package/dist/NiceBackupList.doc-BdQCw0_D.cjs +1 -0
  10. package/dist/NiceBackupList.doc-BwjIAoqz.js +25 -0
  11. package/dist/NiceBackupRestoreDialog.doc-B2iiqTps.cjs +1 -0
  12. package/dist/NiceBackupRestoreDialog.doc-DuXSGJiD.js +25 -0
  13. package/dist/NiceBackupScheduler.doc-BpY45181.js +31 -0
  14. package/dist/NiceBackupScheduler.doc-ByeL3iH1.cjs +7 -0
  15. package/dist/NiceBackupStatusBadge.doc-BA3dYgiW.cjs +1 -0
  16. package/dist/NiceBackupStatusBadge.doc-CxwkVarP.js +25 -0
  17. package/dist/NiceBackupTagEditor.doc-Bej1KHco.cjs +7 -0
  18. package/dist/NiceBackupTagEditor.doc-CNy4uNws.js +31 -0
  19. package/dist/NiceBottomSheet.doc-keq-Fzlz.cjs +8 -0
  20. package/dist/NiceBottomSheet.doc-v-UPUKQk.js +32 -0
  21. package/dist/NiceBranchManager.doc-BTyRjX7X.cjs +6 -0
  22. package/dist/NiceBranchManager.doc-Cz4SyEqE.js +30 -0
  23. package/dist/NiceButton-3AcJJ15c.cjs +1 -0
  24. package/dist/NiceButton-5tWvfXKl.cjs +1 -0
  25. package/dist/NiceButton-DHSgQT1_.js +112 -0
  26. package/dist/NiceButton-vkI07DP0.js +88 -0
  27. package/dist/NiceCodeEditor-B8At55f5.js +1179 -0
  28. package/dist/NiceCodeEditor-BJSEzhcY.cjs +260 -0
  29. package/dist/NiceCodeEditor-VGIDWSkS.js +1181 -0
  30. package/dist/NiceCodeEditor-qX39PSnQ.cjs +260 -0
  31. package/dist/NiceColorPicker-CQhhjZ8w.cjs +1 -0
  32. package/dist/NiceColorPicker-Cbop7VMu.js +491 -0
  33. package/dist/NiceColorPicker-DCgmE-3H.cjs +1 -0
  34. package/dist/NiceColorPicker-DK30kJgy.js +486 -0
  35. package/dist/NiceColorPicker-DtPFxDKM.cjs +1 -0
  36. package/dist/NiceColorPicker-bNJBAU_c.js +598 -0
  37. package/dist/NiceConnectorConfigForm.doc-BKrDuhXw.cjs +7 -0
  38. package/dist/NiceConnectorConfigForm.doc-BsHeXz3M.js +31 -0
  39. package/dist/NiceDataBranchGraph.doc-Axidz41W.js +29 -0
  40. package/dist/NiceDataBranchGraph.doc-sjLmrrtE.cjs +5 -0
  41. package/dist/NiceDataBranchManager.doc-B1-Rp2X4.cjs +6 -0
  42. package/dist/NiceDataBranchManager.doc-GUqfTFvW.js +30 -0
  43. package/dist/NiceDataConflictResolver.doc-CjQryrTu.cjs +5 -0
  44. package/dist/NiceDataConflictResolver.doc-L-TcnQMX.js +29 -0
  45. package/dist/NiceDataDiffViewer.doc-BzGrf0U-.cjs +6 -0
  46. package/dist/NiceDataDiffViewer.doc-goxhSldH.js +30 -0
  47. package/dist/NiceDataGrid-BDEIbuBS.js +2218 -0
  48. package/dist/NiceDataGrid-BOCJr6XF.js +2217 -0
  49. package/dist/NiceDataGrid-BV5Oh-gy.cjs +10 -0
  50. package/dist/NiceDataGrid-CS5aB-EN.cjs +10 -0
  51. package/dist/NiceDataGrid-Dd7SI-M6.cjs +10 -0
  52. package/dist/NiceDataGrid-DjZchXYG.js +2217 -0
  53. package/dist/NiceDataMapper.doc-QmnmnvVq.js +30 -0
  54. package/dist/NiceDataMapper.doc-ytGVtYVr.cjs +6 -0
  55. package/dist/NiceDataMergeBuilder.doc-BcmzKxh2.cjs +6 -0
  56. package/dist/NiceDataMergeBuilder.doc-BvYa4aUJ.js +30 -0
  57. package/dist/NiceDataSnapshot.doc-C73K1biG.cjs +6 -0
  58. package/dist/NiceDataSnapshot.doc-hU7wnOzM.js +30 -0
  59. package/dist/NiceDesktopViews.doc-DJjYlyP2.cjs +1 -0
  60. package/dist/NiceDesktopViews.doc-ly-VUAJj.js +25 -0
  61. package/dist/NiceDeviceControlCard.doc-BZIo92-w.cjs +1 -0
  62. package/dist/NiceDeviceControlCard.doc-DIzZcW9L.js +25 -0
  63. package/dist/NiceDocumentViewer-B9VIVKyw.js +726 -0
  64. package/dist/NiceDocumentViewer-CDXAmPp7.cjs +180 -0
  65. package/dist/NiceDocumentationViewer.doc-BSNGa7a_.js +25 -0
  66. package/dist/NiceDocumentationViewer.doc-CrwlvPFg.cjs +1 -0
  67. package/dist/NiceEnergyChart.doc-DW-jllDV.cjs +1 -0
  68. package/dist/NiceEnergyChart.doc-DnEehTff.js +25 -0
  69. package/dist/NiceFeatureGate.doc-DN17uS_B.cjs +3 -0
  70. package/dist/NiceFeatureGate.doc-DNfFSRrh.js +27 -0
  71. package/dist/NiceForm-BCEXovJR.cjs +1 -0
  72. package/dist/NiceForm-BcN4p2kG.cjs +1 -0
  73. package/dist/NiceForm-D7oyWHXg.js +4820 -0
  74. package/dist/NiceForm-DUhxXArr.js +4817 -0
  75. package/dist/NiceForm-tIXS-M6b.js +4770 -0
  76. package/dist/NiceForm-uCeVmTrD.cjs +1 -0
  77. package/dist/NiceFormItem.doc-BJwEnDz2.js +36 -0
  78. package/dist/NiceFormItem.doc-Ck3PgaPD.cjs +12 -0
  79. package/dist/NiceGantt-CTbqCuwv.cjs +1 -0
  80. package/dist/NiceGantt-Dao7pN9z.js +328 -0
  81. package/dist/NiceGantt.doc-B6YZcJvG.cjs +11 -0
  82. package/dist/NiceGantt.doc-DsI1QXly.js +48 -0
  83. package/dist/NiceGitBlame.doc-BQ2KvGkD.js +30 -0
  84. package/dist/NiceGitBlame.doc-DuTSjZVN.cjs +6 -0
  85. package/dist/NiceGitDiffViewer.doc-D24AGos_.js +30 -0
  86. package/dist/NiceGitDiffViewer.doc-D9FVquBC.cjs +6 -0
  87. package/dist/NiceGitGraph.doc-C-8VGMIz.js +29 -0
  88. package/dist/NiceGitGraph.doc-eRvTmefl.cjs +5 -0
  89. package/dist/NiceGitHooks.doc-DCTVw7HX.cjs +5 -0
  90. package/dist/NiceGitHooks.doc-OCFj5w6v.js +29 -0
  91. package/dist/NiceHtmlEditor-BYk1roA4.cjs +10 -0
  92. package/dist/NiceHtmlEditor-C5kLeF9H.cjs +10 -0
  93. package/dist/NiceHtmlEditor-CFVMIC5L.js +848 -0
  94. package/dist/NiceHtmlEditor-DUwcqj5N.cjs +10 -0
  95. package/dist/NiceHtmlEditor-DiAphF1k.js +889 -0
  96. package/dist/NiceHtmlEditor-mWebBmy1.js +849 -0
  97. package/dist/NiceInstanceMonitor.doc-BSDZp5xa.js +31 -0
  98. package/dist/NiceInstanceMonitor.doc-HVbLufnh.cjs +7 -0
  99. package/dist/NiceLocaleManager.doc-CbVHDEWu.js +25 -0
  100. package/dist/NiceLocaleManager.doc-XH6hMW0Z.cjs +1 -0
  101. package/dist/NiceLockButton.doc-BMhSj3TB.cjs +1 -0
  102. package/dist/NiceLockButton.doc-DvHGhcfm.js +25 -0
  103. package/dist/NiceLoginForm-BHyDY7br.cjs +1 -0
  104. package/dist/NiceLoginForm-BuxFY2Rk.js +750 -0
  105. package/dist/NiceLoginForm-DQe77Isv.js +747 -0
  106. package/dist/NiceLoginForm-NBCo-DUZ.cjs +1 -0
  107. package/dist/NiceLoginForm.css +1 -0
  108. package/dist/NiceMAM.doc-CsQ57saR.cjs +8 -0
  109. package/dist/NiceMAM.doc-hjW7buTH.js +32 -0
  110. package/dist/NiceMention--3P3vO-W.cjs +430 -0
  111. package/dist/NiceMention-CA7CL5BI.js +11263 -0
  112. package/dist/NiceMention-CHcKRl-L.cjs +430 -0
  113. package/dist/NiceMention-Co2cqkVM.js +11316 -0
  114. package/dist/NiceMention-DJD0BLcp.js +11269 -0
  115. package/dist/NiceMention-DcaUEMSg.cjs +430 -0
  116. package/dist/NiceMention.css +1 -1
  117. package/dist/NiceModal-C4p8a82e.cjs +1 -0
  118. package/dist/NiceModal-TNlkaL_i.js +85 -0
  119. package/dist/NiceModuleLifecyclePanel-BWbKdVC_.js +7054 -0
  120. package/dist/NiceModuleLifecyclePanel-CZHIzvkE.cjs +1 -0
  121. package/dist/NiceModuleLifecyclePanel-DV3F_QdI.cjs +1 -0
  122. package/dist/NiceModuleLifecyclePanel-OC9YK2kG.js +7052 -0
  123. package/dist/NiceModuleLifecyclePanel-_OcfDmtC.cjs +1 -0
  124. package/dist/NiceModuleLifecyclePanel-gaZkIEtK.js +6825 -0
  125. package/dist/NiceModuleLifecyclePanel.css +1 -1
  126. package/dist/NiceNetworkDiscoveryPanel.doc-B0RtGaS3.js +25 -0
  127. package/dist/NiceNetworkDiscoveryPanel.doc-BFgFZI5G.cjs +1 -0
  128. package/dist/NicePagination-8XsBbMNx.js +165 -0
  129. package/dist/NicePagination-B3nZDZem.js +165 -0
  130. package/dist/NicePagination-B8rg1Y67.cjs +1 -0
  131. package/dist/NicePagination-CkOoXf0f.js +165 -0
  132. package/dist/NicePagination-D7lek1G7.cjs +1 -0
  133. package/dist/NicePagination-OjTEfZJE.cjs +1 -0
  134. package/dist/NicePipelineEditor.doc-CjqDKe2x.js +29 -0
  135. package/dist/NicePipelineEditor.doc-DZ0pTVTp.cjs +5 -0
  136. package/dist/NicePipelineMonitor.doc-C88-TagI.cjs +5 -0
  137. package/dist/NicePipelineMonitor.doc-CFtH4XJx.js +29 -0
  138. package/dist/NicePivotGrid-BJRSciWl.js +1183 -0
  139. package/dist/NicePivotGrid-BaZa2YZW.js +1157 -0
  140. package/dist/NicePivotGrid-CS1dPmNI.cjs +152 -0
  141. package/dist/NicePivotGrid-D2AxqDzJ.js +1183 -0
  142. package/dist/NicePivotGrid-DxQ6Py9D.cjs +152 -0
  143. package/dist/NicePivotGrid-DyOPhPO8.cjs +152 -0
  144. package/dist/NiceRoomGrid.doc-DJPVUQVg.cjs +8 -0
  145. package/dist/NiceRoomGrid.doc-DLHJS_Wb.js +32 -0
  146. package/dist/NiceSavedQueryPanel-B5HhqlAI.cjs +586 -0
  147. package/dist/NiceSavedQueryPanel-BC84uRfh.cjs +586 -0
  148. package/dist/NiceSavedQueryPanel-CMStDOKe.js +5125 -0
  149. package/dist/NiceSavedQueryPanel-CMfcODIO.js +5120 -0
  150. package/dist/NiceSavedQueryPanel-D2i34e_b.cjs +586 -0
  151. package/dist/NiceSavedQueryPanel-mPO2THs7.js +5142 -0
  152. package/dist/NiceSavedQueryPanel.css +1 -1
  153. package/dist/NiceSceneBar.doc-09sc3yuF.cjs +1 -0
  154. package/dist/NiceSceneBar.doc-DLePMuVU.js +25 -0
  155. package/dist/NiceSceneSelector.doc-CPzCAy-d.cjs +7 -0
  156. package/dist/NiceSceneSelector.doc-FCLZvPc0.js +31 -0
  157. package/dist/NiceScheduler-7gP7vcLy.cjs +5 -0
  158. package/dist/NiceScheduler-BAJRzFQN.js +1690 -0
  159. package/dist/NiceScheduler-Cy7F9tgH.js +1693 -0
  160. package/dist/NiceScheduler-DquRUZxD.cjs +5 -0
  161. package/dist/NiceScheduler-dJ7gHDv7.cjs +5 -0
  162. package/dist/NiceScheduler-l8N4yCWd.js +1716 -0
  163. package/dist/NiceSchedulerViews.doc-C9opZpgg.cjs +1 -0
  164. package/dist/NiceSchedulerViews.doc-Dy7ZH1iL.js +25 -0
  165. package/dist/NiceSelect-CZR8Zu_k.js +420 -0
  166. package/dist/NiceSelect-DIKGbaJo.cjs +1 -0
  167. package/dist/NiceSelect-DZB1Rs9x.js +435 -0
  168. package/dist/NiceSelect-tMz9QQUs.cjs +1 -0
  169. package/dist/NiceSensorGaugePanel.doc-BHirbWLn.cjs +8 -0
  170. package/dist/NiceSensorGaugePanel.doc-DjKmooI6.js +32 -0
  171. package/dist/NiceSpotlight.doc-BVZFfDVI.cjs +10 -0
  172. package/dist/NiceSpotlight.doc-JqwkzrEm.js +34 -0
  173. package/dist/NiceStateDesigner.doc-CfnwiwfU.js +29 -0
  174. package/dist/NiceStateDesigner.doc-DV4zEC50.cjs +5 -0
  175. package/dist/NiceStepper.doc-5VjaLM6r.js +31 -0
  176. package/dist/NiceStepper.doc-f8lYpr33.cjs +7 -0
  177. package/dist/NiceStreamDashboard.doc-74KUXya1.cjs +8 -0
  178. package/dist/NiceStreamDashboard.doc-k8PQfCM0.js +32 -0
  179. package/dist/NiceTaskInbox.doc-CHrxthqp.js +32 -0
  180. package/dist/NiceTaskInbox.doc-CdCTfgBq.cjs +8 -0
  181. package/dist/NiceTestBuilder.doc-BoBzLfa0.js +30 -0
  182. package/dist/NiceTestBuilder.doc-Cj1fNTvk.cjs +6 -0
  183. package/dist/NiceTranscoder.doc-Dnirl3wg.cjs +7 -0
  184. package/dist/NiceTranscoder.doc-cInCYZh7.js +31 -0
  185. package/dist/NiceVideoAnnotator.doc-C1iEi7OM.cjs +7 -0
  186. package/dist/NiceVideoAnnotator.doc-C8zyfKH_.js +31 -0
  187. package/dist/NiceVideoEditor.doc-C6mhEb-q.cjs +7 -0
  188. package/dist/NiceVideoEditor.doc-lrwmKjqj.js +31 -0
  189. package/dist/NiceWindow-BEov3s9F.js +2094 -0
  190. package/dist/NiceWindow-CDt6PCEg.cjs +1 -0
  191. package/dist/NiceWindow-CWN8OCHF.js +2109 -0
  192. package/dist/NiceWindow-Dd8qjkIW.cjs +1 -0
  193. package/dist/NiceWindow.css +1 -1
  194. package/dist/charts-Bo2WAI5T.cjs +768 -0
  195. package/dist/charts-ByrdMeQP.js +4767 -0
  196. package/dist/charts-C047IMVn.cjs +768 -0
  197. package/dist/charts-CCXSb3xk.js +4752 -0
  198. package/dist/charts-CqETcUhH.js +4752 -0
  199. package/dist/charts-DouiiHOT.cjs +768 -0
  200. package/dist/charts.cjs +1 -1
  201. package/dist/charts.css +1 -1
  202. package/dist/charts.d.ts +28 -18
  203. package/dist/charts.mjs +1 -1
  204. package/dist/core-B8eBUE4m.js +438 -0
  205. package/dist/core-BL-KmGYC.js +795 -0
  206. package/dist/core-Chg-oYCr.cjs +1 -0
  207. package/dist/core-CxBnKAhs.cjs +1 -0
  208. package/dist/core-D_LRh59n.js +795 -0
  209. package/dist/core-lBFqvT0V.cjs +1 -0
  210. package/dist/core-lazy-Bh2yg4Et.js +351 -0
  211. package/dist/core-lazy-CkWKjfc6.cjs +1 -0
  212. package/dist/data-branching-Dak1_ZKR.cjs +1 -0
  213. package/dist/data-branching-DiLAO4Qt.js +6386 -0
  214. package/dist/data-branching-Km4lc8P_.cjs +1 -0
  215. package/dist/data-branching-YQtJJEtn.js +6273 -0
  216. package/dist/data-branching.cjs +1 -1
  217. package/dist/data-branching.mjs +1 -1
  218. package/dist/data.cjs +1 -1
  219. package/dist/data.d.ts +22 -69
  220. package/dist/data.mjs +3 -3
  221. package/dist/devops-D5yIDM3e.js +8312 -0
  222. package/dist/devops-DkVluHBp.cjs +17 -0
  223. package/dist/devops-rVpB0ZAX.cjs +17 -0
  224. package/dist/devops-zsMUueTd.js +8648 -0
  225. package/dist/devops.cjs +1 -1
  226. package/dist/devops.d.ts +3 -3
  227. package/dist/devops.mjs +1 -1
  228. package/dist/editors.cjs +1 -1
  229. package/dist/editors.d.ts +106 -63
  230. package/dist/editors.mjs +55 -54
  231. package/dist/feedback.cjs +1 -1
  232. package/dist/feedback.d.ts +76 -2
  233. package/dist/feedback.mjs +10 -9
  234. package/dist/index.cjs +261 -261
  235. package/dist/index.css +1 -1
  236. package/dist/index.d.ts +831 -433
  237. package/dist/index.mjs +27339 -26540
  238. package/dist/injectStyleOnce-BzC_BCs_.js +9 -0
  239. package/dist/injectStyleOnce-DeWaxcdf.cjs +1 -0
  240. package/dist/lazy.cjs +1 -1
  241. package/dist/lazy.d.ts +9 -7
  242. package/dist/lazy.mjs +55 -55
  243. package/dist/navigation.cjs +1 -1
  244. package/dist/navigation.css +1 -0
  245. package/dist/navigation.d.ts +99 -43
  246. package/dist/navigation.mjs +504 -547
  247. package/dist/no-code-6WyYb3hL.cjs +331 -0
  248. package/dist/no-code-BH5oVFC6.js +8186 -0
  249. package/dist/no-code-CnHG5_Vn.js +8186 -0
  250. package/dist/no-code-DMKlg1Zl.cjs +331 -0
  251. package/dist/no-code-DiTEnuRv.js +8288 -0
  252. package/dist/no-code-wG9c0z_T.cjs +331 -0
  253. package/dist/no-code.cjs +1 -1
  254. package/dist/no-code.css +1 -1
  255. package/dist/no-code.d.ts +25 -18
  256. package/dist/no-code.mjs +3 -3
  257. package/dist/overlays.cjs +1 -1
  258. package/dist/overlays.d.ts +36 -30
  259. package/dist/overlays.mjs +24 -490
  260. package/dist/pickerCommons-0vyK1Knv.js +547 -0
  261. package/dist/pickerCommons-BCRiHDE_.cjs +1 -0
  262. package/dist/pickerCommons-BFbItm8o.cjs +1 -0
  263. package/dist/pickerCommons-BHirHJyn.js +548 -0
  264. package/dist/pickerCommons-Bt8JIaTN.cjs +1 -0
  265. package/dist/pickerCommons-DkumQ3KE.js +548 -0
  266. package/dist/pickerCommons.css +1 -1
  267. package/dist/style.css +15 -9
  268. package/package.json +4 -6
  269. package/css/legacy-bg-text-aliases.css +0 -87
@@ -0,0 +1 @@
1
+ "use strict";const s=require("react"),d=require("@nice2dev/ui-core"),I=s.createContext(null);function Y({children:r,initialPolicy:o,policyEndpoint:e,instanceCeiling:t,tenantPolicy:a,groupPolicy:l,userPreference:S,instanceId:n="default",tenantId:u,onPolicyChange:f}){const[c,m]=s.useState(o||d.DEFAULT_TRACELESS_POLICY),[A,M]=s.useState(S),[C,E]=s.useState(!!e),[b,w]=s.useState(null),T=s.useRef(new Map);s.useEffect(()=>{const g=t||d.createPermissiveInstanceCeiling(n),i=d.resolveTracelessPolicy(g,a,l,A);m(i),f?.(i),T.current.forEach(L=>{L.updatePolicy(i)})},[t,a,l,A,n,f]),s.useEffect(()=>{if(!e)return;(async()=>{E(!0),w(null);try{const i=await fetch(e,{credentials:"include"});if(!i.ok)throw new Error(`Failed to fetch policy: ${i.status}`);const L=i.headers.get(d.TRACELESS_POLICY_HEADER);if(L){const k=d.parsePolicyFromHeader(L);if(k){const R=t||d.createPermissiveInstanceCeiling(n),F=d.resolveTracelessPolicy(R,a?{...a,mode:k}:{tenantId:"default",mode:k,allowGroupOverride:!0,allowUserOverride:!0,updatedAt:Date.now()},l,A);m(F),f?.(F)}}try{const k=await i.json();k.policy&&(m(k.policy),f?.(k.policy))}catch{}}catch(i){w(i instanceof Error?i:new Error("Unknown error"))}finally{E(!1)}})()},[e,t,a,l,A,n,f]);const P=s.useCallback(g=>{M(i=>({userId:i?.userId||"anonymous",preferredMode:g.preferredMode||i?.preferredMode||"traceless",restrictCookies:g.restrictCookies??i?.restrictCookies,restrictLocalStorage:g.restrictLocalStorage??i?.restrictLocalStorage,restrictSessionStorage:g.restrictSessionStorage??i?.restrictSessionStorage,setAt:Date.now()}))},[]),U=s.useCallback(()=>d.generateTracelessComplianceReport(c,n,u),[c,n,u]),D=s.useCallback(()=>d.auditStorageCompliance(c),[c]),_=s.useCallback(async()=>{if(e){E(!0);try{const g=await fetch(e,{credentials:"include",cache:"no-cache"});if(g.ok){const i=g.headers.get(d.TRACELESS_POLICY_HEADER);if(i){const L=d.parsePolicyFromHeader(i);if(L){const k=t||d.createPermissiveInstanceCeiling(n),R=d.resolveTracelessPolicy(k,a?{...a,mode:L}:void 0,l,A);m(R),f?.(R)}}}}finally{E(!1)}}},[e,t,a,l,A,n,f]),p=s.useCallback((g="nice2dev")=>{let i=T.current.get(g);return i||(i=new d.StorageAdapter(c,g),T.current.set(g,i)),i},[c]),O=s.useMemo(()=>d.getTracelessBadgeInfo(c),[c]),B=s.useMemo(()=>({policy:c,canUseCookies:c.cookiesAllowed,canUseLocalStorage:c.localStorageAllowed,canUseSessionStorage:c.sessionStorageAllowed,canPersist:c.localStorageAllowed,mode:c.effectiveMode,requiresConsentBanner:c.requiresConsentBanner,badgeInfo:O,setUserPreference:P,generateReport:U,runAudit:D,refreshPolicy:_,getStorageAdapter:p,isLoading:C,error:b}),[c,O,P,U,D,_,p,C,b]);return s.createElement(I.Provider,{value:B},r)}function x(){const r=s.useContext(I);if(!r)throw new Error("useTracelessPolicy must be used within a TracelessProvider");return r}function v(){const r=s.useContext(I);if(r)return r;const o=new d.StorageAdapter(d.DEFAULT_TRACELESS_POLICY);return{policy:d.DEFAULT_TRACELESS_POLICY,canUseCookies:!1,canUseLocalStorage:!1,canUseSessionStorage:!1,canPersist:!1,mode:"traceless",requiresConsentBanner:!1,badgeInfo:d.getTracelessBadgeInfo(d.DEFAULT_TRACELESS_POLICY),setUserPreference:()=>{},generateReport:()=>d.generateTracelessComplianceReport(d.DEFAULT_TRACELESS_POLICY,"default"),runAudit:()=>d.auditStorageCompliance(d.DEFAULT_TRACELESS_POLICY),refreshPolicy:async()=>{},getStorageAdapter:()=>o,isLoading:!1,error:null}}function h(r="nice2dev"){const{getStorageAdapter:o}=v();return s.useMemo(()=>o(r),[o,r])}function y(r,o,e){const t=h(e?.namespace),{canPersist:a,canUseSessionStorage:l}=v(),S=e?.storageMode==="session"?l:a,[n,u]=s.useState(()=>{if(S){const c=t.get(r,e?.storageMode);if(c!==null)return c}return o}),f=s.useCallback(c=>{u(m=>{const A=typeof c=="function"?c(m):c;return S&&t.set(r,A,e?.storageMode==="session"?"session":"local"),A})},[t,r,S,e?.storageMode]);return[n,f,S]}function q(){const{requiresConsentBanner:r,mode:o}=v(),e=h("nice2dev-consent"),[t,a]=s.useState(()=>e.get("banner-dismissed")===!0),l=s.useCallback(()=>{a(!0),e.set("banner-dismissed",!0)},[e]);return{shouldShow:r&&!t,mode:o,dismiss:l}}function H(r=!1){const{runAudit:o}=v(),[e,t]=s.useState(null),a=s.useCallback(()=>{const l=o();return t(l),l},[o]);return s.useEffect(()=>{r&&a()},[r,a]),{result:e,run:a,isCompliant:e?.compliant??null}}function V(){const{policy:r,getStorageAdapter:o}=v(),e=s.useMemo(()=>o("local"),[o]),t=s.useCallback(n=>e.get(n),[e]),a=s.useCallback((n,u)=>{e.set(n,u)},[e]),l=s.useCallback(n=>{e.remove(n)},[e]),S=s.useCallback(()=>{e.clear()},[e]);return s.useMemo(()=>({getItem:t,setItem:a,removeItem:l,clear:S,isAvailable:r.localStorageAllowed,effectiveMode:r.effectiveMode,policy:r}),[t,a,l,S,r])}function $(){const{policy:r,getStorageAdapter:o}=v(),e=s.useMemo(()=>o("session"),[o]),t=s.useCallback(n=>e.get(n),[e]),a=s.useCallback((n,u)=>{e.set(n,u)},[e]),l=s.useCallback(n=>{e.remove(n)},[e]),S=s.useCallback(()=>{e.clear()},[e]);return s.useMemo(()=>({getItem:t,setItem:a,removeItem:l,clear:S,isAvailable:r.sessionStorageAllowed,effectiveMode:r.effectiveMode}),[t,a,l,S,r])}function G({storageKey:r,initialState:o={},onStateChange:e,storageType:t="auto"}){const{policy:a,getStorageAdapter:l}=v(),S=`nice-datagrid-${r}`,n=s.useMemo(()=>{if(t==="local"&&a.localStorageAllowed)return"local";if(t==="session"&&a.sessionStorageAllowed)return"session";if(t==="auto"){if(a.localStorageAllowed)return"local";if(a.sessionStorageAllowed)return"session"}return"memory"},[t,a]),u=s.useMemo(()=>l(n==="session"?"session-grid":"local-grid"),[l,n]),[f,c]=s.useState(()=>{const C=u.get(S);if(C)try{return{...o,...JSON.parse(C)}}catch{return o}return o});s.useEffect(()=>{u.set(S,JSON.stringify(f)),e?.(f)},[f,u,S,e]);const m=s.useCallback(C=>{c(E=>({...E,...C}))},[]),A=s.useCallback(()=>{u.remove(S),c(o)},[u,S,o]);return{state:f,updateState:m,setState:c,clearState:A,degraded:n==="memory",effectiveStorageType:n,policy:a}}function K({storageKey:r,autoSaveInterval:o=5e3,maxVersions:e=10}){const{policy:t,getStorageAdapter:a}=v(),l=`nice-editor-${r}`,S=`${l}-history`,n=s.useMemo(()=>a("editor"),[a]),[u,f]=y(l,null,{storageMode:t.localStorageAllowed?"local":"session"}),[c,m]=y(S,[],{storageMode:"local"}),A=s.useCallback((w,T)=>{const P={content:w,cursorPosition:T,lastModified:Date.now(),version:(u?.version??0)+1};f(P)},[u,f]),M=s.useCallback(()=>{!u||!t.localStorageAllowed||m(w=>[...w,u].slice(-e))},[u,t.localStorageAllowed,e,m]),C=s.useCallback(w=>{const T=c.find(P=>P.version===w);T&&f(T)},[c,f]),E=s.useCallback(()=>{n.remove(l),f(null)},[n,l,f]),b=s.useRef(null);return s.useEffect(()=>{if(!o||!u?.content||u.content===b.current)return;const w=setTimeout(()=>{b.current=u.content??null},o);return()=>clearTimeout(w)},[u?.content,o]),{draft:u,saveDraft:A,saveToHistory:M,restoreVersion:C,clearDraft:E,history:c,hasDraft:u!==null,degraded:!t.localStorageAllowed&&!t.sessionStorageAllowed,policy:t}}function J(r="local"){const o=h(r),e=s.useRef([]);return s.useMemo(()=>({getItem:t=>o.get(t),setItem:(t,a)=>{o.set(t,a),e.current.includes(t)||e.current.push(t)},removeItem:t=>{o.remove(t),e.current=e.current.filter(a=>a!==t)},clear:()=>{o.clear(),e.current=[]},get length(){return e.current.length},key:t=>e.current[t]??null}),[o])}function N(r){const{policy:o}=v();return s.useMemo(()=>{const e=o.cookiesAllowed&&r.cookies!==!1,t=o.localStorageAllowed&&r.localStorage!==!1,a=o.sessionStorageAllowed&&r.sessionStorage!==!1;return{cookiesAllowed:e,localStorageAllowed:t,sessionStorageAllowed:a,effectiveMode:o.effectiveMode,canPersist:t||a,degraded:!t&&!a}},[o,r.cookies,r.localStorage,r.sessionStorage])}exports.TracelessProvider=Y;exports.useCookieBannerVisibility=q;exports.useEditorStatePersistence=K;exports.useGridStatePersistence=G;exports.usePersistedState=y;exports.useResolvedStorageProps=N;exports.useStorageAdapter=h;exports.useStorageAudit=H;exports.useTracelessLocalStorage=V;exports.useTracelessPolicy=x;exports.useTracelessPolicySafe=v;exports.useTracelessSessionStorage=$;exports.useTracelessStorage=J;
@@ -0,0 +1,351 @@
1
+ import { jsxs as T, jsx as t, Fragment as V } from "react/jsx-runtime";
2
+ import { useNiceTranslation as P, NiceIcon as H } from "@nice2dev/ui-core";
3
+ import O, { lazy as A, useRef as z, useState as F, useEffect as y, Suspense as M } from "react";
4
+ const u = ({
5
+ height: e = 200
6
+ }) => /* @__PURE__ */ t(
7
+ "div",
8
+ {
9
+ className: "ntd-lazy-loading",
10
+ style: {
11
+ display: "flex",
12
+ alignItems: "center",
13
+ justifyContent: "center",
14
+ height: e,
15
+ background: "var(--ntd-color-surface, #f5f5f5)",
16
+ borderRadius: "var(--ntd-radius, 8px)",
17
+ animation: "ntd-pulse 1.5s ease-in-out infinite"
18
+ },
19
+ children: /* @__PURE__ */ t(
20
+ "div",
21
+ {
22
+ className: "ntd-lazy-loading-spinner",
23
+ style: {
24
+ width: 24,
25
+ height: 24,
26
+ border: "2px solid var(--ntd-color-border, #ddd)",
27
+ borderTopColor: "var(--ntd-color-primary, #6366f1)",
28
+ borderRadius: "50%",
29
+ animation: "ntd-spin 0.8s linear infinite"
30
+ }
31
+ }
32
+ )
33
+ }
34
+ ), q = (e, r) => {
35
+ const { t: a } = P();
36
+ return /* @__PURE__ */ T(
37
+ "div",
38
+ {
39
+ className: "ntd-lazy-error",
40
+ style: {
41
+ display: "flex",
42
+ flexDirection: "column",
43
+ alignItems: "center",
44
+ justifyContent: "center",
45
+ padding: 24,
46
+ background: "var(--ntd-color-error-bg, #fee2e2)",
47
+ borderRadius: "var(--ntd-radius, 8px)",
48
+ color: "var(--ntd-color-error, #dc2626)"
49
+ },
50
+ children: [
51
+ /* @__PURE__ */ t(H, { name: "error", size: 32 }),
52
+ /* @__PURE__ */ t("p", { style: { margin: "12px 0 8px", fontWeight: 500 }, children: a("lazy.failedToLoadComponent", "Failed to load component") }),
53
+ /* @__PURE__ */ t("p", { style: { margin: 0, fontSize: "0.875em", opacity: 0.8 }, children: e.message }),
54
+ /* @__PURE__ */ t(
55
+ "button",
56
+ {
57
+ onClick: r,
58
+ style: {
59
+ marginTop: 16,
60
+ padding: "8px 16px",
61
+ border: "none",
62
+ borderRadius: "var(--ntd-radius, 8px)",
63
+ background: "var(--ntd-color-error, #dc2626)",
64
+ color: "var(--nice-color-white, #fff)",
65
+ cursor: "pointer",
66
+ fontSize: "0.875em"
67
+ },
68
+ children: a("lazy.retry", "Retry")
69
+ }
70
+ )
71
+ ]
72
+ }
73
+ );
74
+ };
75
+ class j extends O.Component {
76
+ constructor() {
77
+ super(...arguments), this.state = { error: null }, this.handleRetry = () => {
78
+ this.setState({ error: null });
79
+ };
80
+ }
81
+ static getDerivedStateFromError(r) {
82
+ return { error: r };
83
+ }
84
+ render() {
85
+ return this.state.error ? this.props.fallback(this.state.error, this.handleRetry) : this.props.children;
86
+ }
87
+ }
88
+ function l(e, r = {}) {
89
+ const {
90
+ fallback: a = /* @__PURE__ */ t(u, {}),
91
+ preloadOnMount: o = !1,
92
+ preloadOnHover: p = !1,
93
+ preloadAfterIdle: n,
94
+ minLoadingTime: f = 0,
95
+ ssrFallback: s,
96
+ errorFallback: I = q,
97
+ displayName: x
98
+ } = r;
99
+ let b = null, m = !1;
100
+ const h = async () => {
101
+ if (b)
102
+ return b;
103
+ const v = Date.now();
104
+ b = e();
105
+ const k = await b;
106
+ if (f > 0) {
107
+ const g = Date.now() - v;
108
+ g < f && await new Promise((c) => setTimeout(c, f - g));
109
+ }
110
+ return m = !0, k;
111
+ }, D = A(h), R = (v) => {
112
+ const k = z(null);
113
+ return y(() => {
114
+ o && !m && h();
115
+ }, []), y(() => {
116
+ if (n && !m) {
117
+ const c = "requestIdleCallback" in window ? window.requestIdleCallback(() => h(), {
118
+ timeout: n
119
+ }) : setTimeout(() => h(), n);
120
+ return () => {
121
+ "cancelIdleCallback" in window ? window.cancelIdleCallback(c) : clearTimeout(c);
122
+ };
123
+ }
124
+ }, []), y(() => {
125
+ if (!p || m)
126
+ return;
127
+ const c = k.current;
128
+ if (!c)
129
+ return;
130
+ const N = () => {
131
+ m || h();
132
+ };
133
+ return c.addEventListener("mouseenter", N, { once: !0 }), () => c.removeEventListener("mouseenter", N);
134
+ }, []), typeof window > "u" && s ? /* @__PURE__ */ t(V, { children: s }) : /* @__PURE__ */ t("div", { ref: k, className: "ntd-lazy-wrapper", children: /* @__PURE__ */ t(j, { fallback: I, children: /* @__PURE__ */ t(M, { fallback: a, children: /* @__PURE__ */ t(D, { ...v }) }) }) });
135
+ }, G = async () => {
136
+ m || await h();
137
+ }, w = R;
138
+ return w.preload = G, w.displayName = x || "LazyComponent", w;
139
+ }
140
+ function K(e = 0.1, r = "100px") {
141
+ const a = z(null), [o, p] = F(!1);
142
+ return y(() => {
143
+ if (!a.current || o)
144
+ return;
145
+ const n = new IntersectionObserver(
146
+ ([f]) => {
147
+ f.isIntersecting && (p(!0), n.disconnect());
148
+ },
149
+ { threshold: e, rootMargin: r }
150
+ );
151
+ return n.observe(a.current), () => n.disconnect();
152
+ }, [e, r, o]), [a, o];
153
+ }
154
+ function Q(e, r = 2e3) {
155
+ y(() => {
156
+ if ("requestIdleCallback" in window) {
157
+ const a = window.requestIdleCallback(
158
+ () => {
159
+ e.forEach((o) => o());
160
+ },
161
+ { timeout: r }
162
+ );
163
+ return () => window.cancelIdleCallback(a);
164
+ } else {
165
+ const a = setTimeout(() => {
166
+ e.forEach((o) => o());
167
+ }, r);
168
+ return () => clearTimeout(a);
169
+ }
170
+ }, []);
171
+ }
172
+ function U(e, r) {
173
+ const a = z(/* @__PURE__ */ new Set());
174
+ y(() => {
175
+ const o = document.querySelectorAll("a[href]"), p = (n) => {
176
+ const s = n.currentTarget.getAttribute("href");
177
+ s && e[s] && !a.current.has(s) && (e[s](), a.current.add(s));
178
+ };
179
+ return o.forEach((n) => {
180
+ n.addEventListener("mouseenter", p);
181
+ }), () => {
182
+ o.forEach((n) => {
183
+ n.removeEventListener("mouseenter", p);
184
+ });
185
+ };
186
+ }, [r, e]);
187
+ }
188
+ const C = () => /* @__PURE__ */ t(u, { height: 400 }), L = () => /* @__PURE__ */ t(u, { height: 300 }), S = () => /* @__PURE__ */ t(u, { height: 500 }), E = () => /* @__PURE__ */ t(u, { height: 600 }), i = (e) => e, d = {
189
+ /**
190
+ * Lazy-loaded NiceCodeEditor (Monaco ~2MB)
191
+ *
192
+ * @example
193
+ * ```tsx
194
+ * import { LazyComponents } from '@nice2dev/ui';
195
+ *
196
+ * <LazyComponents.CodeEditor
197
+ * value={code}
198
+ * language="typescript"
199
+ * onChange={setCode}
200
+ * />
201
+ * ```
202
+ */
203
+ CodeEditor: /* @__PURE__ */ l(
204
+ /* @__PURE__ */ i(
205
+ () => import("./NiceCodeEditor-VGIDWSkS.js").then((e) => ({ default: e.NiceCodeEditor }))
206
+ ),
207
+ {
208
+ fallback: /* @__PURE__ */ t(C, {}),
209
+ preloadOnHover: !0,
210
+ displayName: "LazyCodeEditor"
211
+ }
212
+ ),
213
+ /**
214
+ * Lazy-loaded NiceHtmlEditor
215
+ */
216
+ HtmlEditor: /* @__PURE__ */ l(
217
+ /* @__PURE__ */ i(
218
+ () => import("./NiceHtmlEditor-DiAphF1k.js").then((e) => ({ default: e.NiceHtmlEditor }))
219
+ ),
220
+ {
221
+ fallback: /* @__PURE__ */ t(C, {}),
222
+ preloadOnHover: !0,
223
+ displayName: "LazyHtmlEditor"
224
+ }
225
+ ),
226
+ /**
227
+ * Lazy-loaded NiceDocumentViewer
228
+ */
229
+ DocumentViewer: /* @__PURE__ */ l(
230
+ /* @__PURE__ */ i(
231
+ () => import("./NiceDocumentViewer-B9VIVKyw.js").then((e) => ({ default: e.NiceDocumentViewer }))
232
+ ),
233
+ {
234
+ fallback: /* @__PURE__ */ t(u, { height: 600 }),
235
+ displayName: "LazyDocumentViewer"
236
+ }
237
+ ),
238
+ /**
239
+ * Lazy-loaded NiceChart
240
+ */
241
+ Chart: /* @__PURE__ */ l(
242
+ /* @__PURE__ */ i(
243
+ () => import("./charts-ByrdMeQP.js").then((e) => e.A).then((e) => ({ default: e.NiceChart }))
244
+ ),
245
+ {
246
+ fallback: /* @__PURE__ */ t(L, {}),
247
+ preloadAfterIdle: 3e3,
248
+ displayName: "LazyChart"
249
+ }
250
+ ),
251
+ /**
252
+ * Lazy-loaded NiceVectorMap
253
+ */
254
+ VectorMap: /* @__PURE__ */ l(
255
+ /* @__PURE__ */ i(
256
+ () => import("./charts-ByrdMeQP.js").then((e) => e.E).then((e) => ({ default: e.NiceVectorMap }))
257
+ ),
258
+ {
259
+ fallback: /* @__PURE__ */ t(u, { height: 400 }),
260
+ displayName: "LazyVectorMap"
261
+ }
262
+ ),
263
+ /**
264
+ * Lazy-loaded NiceSankey
265
+ */
266
+ Sankey: /* @__PURE__ */ l(
267
+ /* @__PURE__ */ i(
268
+ () => import("./charts-ByrdMeQP.js").then((e) => e.B).then((e) => ({ default: e.NiceSankey }))
269
+ ),
270
+ {
271
+ fallback: /* @__PURE__ */ t(L, {}),
272
+ displayName: "LazySankey"
273
+ }
274
+ ),
275
+ /**
276
+ * Lazy-loaded NiceScheduler
277
+ */
278
+ Scheduler: /* @__PURE__ */ l(
279
+ /* @__PURE__ */ i(
280
+ () => import("./NiceScheduler-BAJRzFQN.js").then((e) => e.d).then((e) => ({ default: e.NiceScheduler }))
281
+ ),
282
+ {
283
+ fallback: /* @__PURE__ */ t(E, {}),
284
+ displayName: "LazyScheduler"
285
+ }
286
+ ),
287
+ /**
288
+ * Lazy-loaded NiceGantt
289
+ */
290
+ Gantt: /* @__PURE__ */ l(
291
+ /* @__PURE__ */ i(
292
+ () => import("./NiceGantt-Dao7pN9z.js").then((e) => ({ default: e.NiceGantt }))
293
+ ),
294
+ {
295
+ fallback: /* @__PURE__ */ t(E, {}),
296
+ displayName: "LazyGantt"
297
+ }
298
+ ),
299
+ /**
300
+ * Lazy-loaded NicePivotGrid
301
+ */
302
+ PivotGrid: /* @__PURE__ */ l(
303
+ /* @__PURE__ */ i(
304
+ () => import("./NicePivotGrid-BaZa2YZW.js").then((e) => e.o).then((e) => ({ default: e.NicePivotGrid }))
305
+ ),
306
+ {
307
+ fallback: /* @__PURE__ */ t(S, {}),
308
+ displayName: "LazyPivotGrid"
309
+ }
310
+ ),
311
+ /**
312
+ * Lazy-loaded NiceDataGrid (for very heavy usage)
313
+ */
314
+ DataGrid: /* @__PURE__ */ l(
315
+ /* @__PURE__ */ i(
316
+ () => import("./NiceDataGrid-BDEIbuBS.js").then((e) => e.h).then((e) => ({ default: e.NiceDataGrid }))
317
+ ),
318
+ {
319
+ fallback: /* @__PURE__ */ t(S, {}),
320
+ preloadAfterIdle: 2e3,
321
+ displayName: "LazyDataGrid"
322
+ }
323
+ )
324
+ };
325
+ async function X() {
326
+ await Promise.all([
327
+ d.CodeEditor.preload(),
328
+ d.HtmlEditor.preload(),
329
+ d.DocumentViewer.preload(),
330
+ d.Chart.preload(),
331
+ d.VectorMap.preload(),
332
+ d.Sankey.preload(),
333
+ d.Scheduler.preload(),
334
+ d.Gantt.preload(),
335
+ d.PivotGrid.preload()
336
+ ]);
337
+ }
338
+ async function Y(e) {
339
+ await Promise.all(e.map((r) => d[r].preload()));
340
+ }
341
+ export {
342
+ q as D,
343
+ d as L,
344
+ u as a,
345
+ Y as b,
346
+ l as c,
347
+ Q as d,
348
+ U as e,
349
+ X as p,
350
+ K as u
351
+ };
@@ -0,0 +1 @@
1
+ "use strict";const r=require("react/jsx-runtime"),C=require("@nice2dev/ui-core"),o=require("react"),f=({height:e=200})=>r.jsx("div",{className:"ntd-lazy-loading",style:{display:"flex",alignItems:"center",justifyContent:"center",height:e,background:"var(--ntd-color-surface, #f5f5f5)",borderRadius:"var(--ntd-radius, 8px)",animation:"ntd-pulse 1.5s ease-in-out infinite"},children:r.jsx("div",{className:"ntd-lazy-loading-spinner",style:{width:24,height:24,border:"2px solid var(--ntd-color-border, #ddd)",borderTopColor:"var(--ntd-color-primary, #6366f1)",borderRadius:"50%",animation:"ntd-spin 0.8s linear infinite"}})}),L=(e,t)=>{const{t:a}=C.useNiceTranslation();return r.jsxs("div",{className:"ntd-lazy-error",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:24,background:"var(--ntd-color-error-bg, #fee2e2)",borderRadius:"var(--ntd-radius, 8px)",color:"var(--ntd-color-error, #dc2626)"},children:[r.jsx(C.NiceIcon,{name:"error",size:32}),r.jsx("p",{style:{margin:"12px 0 8px",fontWeight:500},children:a("lazy.failedToLoadComponent","Failed to load component")}),r.jsx("p",{style:{margin:0,fontSize:"0.875em",opacity:.8},children:e.message}),r.jsx("button",{onClick:t,style:{marginTop:16,padding:"8px 16px",border:"none",borderRadius:"var(--ntd-radius, 8px)",background:"var(--ntd-color-error, #dc2626)",color:"var(--nice-color-white, #fff)",cursor:"pointer",fontSize:"0.875em"},children:a("lazy.retry","Retry")})]})};class D extends o.Component{constructor(){super(...arguments),this.state={error:null},this.handleRetry=()=>{this.setState({error:null})}}static getDerivedStateFromError(t){return{error:t}}render(){return this.state.error?this.props.fallback(this.state.error,this.handleRetry):this.props.children}}function i(e,t={}){const{fallback:a=r.jsx(f,{}),preloadOnMount:l=!1,preloadOnHover:p=!1,preloadAfterIdle:n,minLoadingTime:m=0,ssrFallback:c,errorFallback:S=L,displayName:P}=t;let b=null,h=!1;const y=async()=>{if(b)return b;const x=Date.now();b=e();const v=await b;if(m>0){const w=Date.now()-x;w<m&&await new Promise(u=>setTimeout(u,m-w))}return h=!0,v},I=o.lazy(y),q=x=>{const v=o.useRef(null);return o.useEffect(()=>{l&&!h&&y()},[]),o.useEffect(()=>{if(n&&!h){const u="requestIdleCallback"in window?window.requestIdleCallback(()=>y(),{timeout:n}):setTimeout(()=>y(),n);return()=>{"cancelIdleCallback"in window?window.cancelIdleCallback(u):clearTimeout(u)}}},[]),o.useEffect(()=>{if(!p||h)return;const u=v.current;if(!u)return;const N=()=>{h||y()};return u.addEventListener("mouseenter",N,{once:!0}),()=>u.removeEventListener("mouseenter",N)},[]),typeof window>"u"&&c?r.jsx(r.Fragment,{children:c}):r.jsx("div",{ref:v,className:"ntd-lazy-wrapper",children:r.jsx(D,{fallback:S,children:r.jsx(o.Suspense,{fallback:a,children:r.jsx(I,{...x})})})})},R=async()=>{h||await y()},k=q;return k.preload=R,k.displayName=P||"LazyComponent",k}function G(e=.1,t="100px"){const a=o.useRef(null),[l,p]=o.useState(!1);return o.useEffect(()=>{if(!a.current||l)return;const n=new IntersectionObserver(([m])=>{m.isIntersecting&&(p(!0),n.disconnect())},{threshold:e,rootMargin:t});return n.observe(a.current),()=>n.disconnect()},[e,t,l]),[a,l]}function V(e,t=2e3){o.useEffect(()=>{if("requestIdleCallback"in window){const a=window.requestIdleCallback(()=>{e.forEach(l=>l())},{timeout:t});return()=>window.cancelIdleCallback(a)}else{const a=setTimeout(()=>{e.forEach(l=>l())},t);return()=>clearTimeout(a)}},[])}function T(e,t){const a=o.useRef(new Set);o.useEffect(()=>{const l=document.querySelectorAll("a[href]"),p=n=>{const c=n.currentTarget.getAttribute("href");c&&e[c]&&!a.current.has(c)&&(e[c](),a.current.add(c))};return l.forEach(n=>{n.addEventListener("mouseenter",p)}),()=>{l.forEach(n=>{n.removeEventListener("mouseenter",p)})}},[t,e])}const z=()=>r.jsx(f,{height:400}),g=()=>r.jsx(f,{height:300}),j=()=>r.jsx(f,{height:500}),E=()=>r.jsx(f,{height:600}),d=e=>e,s={CodeEditor:i(d(()=>Promise.resolve().then(()=>require("./NiceCodeEditor-qX39PSnQ.cjs")).then(e=>({default:e.NiceCodeEditor}))),{fallback:r.jsx(z,{}),preloadOnHover:!0,displayName:"LazyCodeEditor"}),HtmlEditor:i(d(()=>Promise.resolve().then(()=>require("./NiceHtmlEditor-DUwcqj5N.cjs")).then(e=>({default:e.NiceHtmlEditor}))),{fallback:r.jsx(z,{}),preloadOnHover:!0,displayName:"LazyHtmlEditor"}),DocumentViewer:i(d(()=>Promise.resolve().then(()=>require("./NiceDocumentViewer-CDXAmPp7.cjs")).then(e=>({default:e.NiceDocumentViewer}))),{fallback:r.jsx(f,{height:600}),displayName:"LazyDocumentViewer"}),Chart:i(d(()=>Promise.resolve().then(()=>require("./charts-Bo2WAI5T.cjs")).then(e=>e.NiceChart$1).then(e=>({default:e.NiceChart}))),{fallback:r.jsx(g,{}),preloadAfterIdle:3e3,displayName:"LazyChart"}),VectorMap:i(d(()=>Promise.resolve().then(()=>require("./charts-Bo2WAI5T.cjs")).then(e=>e.NiceVectorMap$1).then(e=>({default:e.NiceVectorMap}))),{fallback:r.jsx(f,{height:400}),displayName:"LazyVectorMap"}),Sankey:i(d(()=>Promise.resolve().then(()=>require("./charts-Bo2WAI5T.cjs")).then(e=>e.NiceSankey$1).then(e=>({default:e.NiceSankey}))),{fallback:r.jsx(g,{}),displayName:"LazySankey"}),Scheduler:i(d(()=>Promise.resolve().then(()=>require("./NiceScheduler-dJ7gHDv7.cjs")).then(e=>e.NiceScheduler$1).then(e=>({default:e.NiceScheduler}))),{fallback:r.jsx(E,{}),displayName:"LazyScheduler"}),Gantt:i(d(()=>Promise.resolve().then(()=>require("./NiceGantt-CTbqCuwv.cjs")).then(e=>({default:e.NiceGantt}))),{fallback:r.jsx(E,{}),displayName:"LazyGantt"}),PivotGrid:i(d(()=>Promise.resolve().then(()=>require("./NicePivotGrid-DyOPhPO8.cjs")).then(e=>e.NicePivotGrid$1).then(e=>({default:e.NicePivotGrid}))),{fallback:r.jsx(j,{}),displayName:"LazyPivotGrid"}),DataGrid:i(d(()=>Promise.resolve().then(()=>require("./NiceDataGrid-CS5aB-EN.cjs")).then(e=>e.NiceDataGrid$1).then(e=>({default:e.NiceDataGrid}))),{fallback:r.jsx(j,{}),preloadAfterIdle:2e3,displayName:"LazyDataGrid"})};async function H(){await Promise.all([s.CodeEditor.preload(),s.HtmlEditor.preload(),s.DocumentViewer.preload(),s.Chart.preload(),s.VectorMap.preload(),s.Sankey.preload(),s.Scheduler.preload(),s.Gantt.preload(),s.PivotGrid.preload()])}async function O(e){await Promise.all(e.map(t=>s[t].preload()))}exports.DefaultErrorFallback=L;exports.DefaultLoadingFallback=f;exports.LazyComponents=s;exports.createLazyComponent=i;exports.preloadAllHeavyComponents=H;exports.preloadComponents=O;exports.useLazyOnVisible=G;exports.usePreloadOnIdle=V;exports.usePreloadOnRouteHint=T;