@nice2dev/ui 1.1.9 → 1.2.0

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 (163) hide show
  1. package/CHANGELOG.md +150 -0
  2. package/README.md +27 -34
  3. package/dist/NiceButton-5tWvfXKl.cjs +1 -0
  4. package/dist/NiceButton-DHSgQT1_.js +112 -0
  5. package/dist/NiceCodeEditor-B8At55f5.js +1179 -0
  6. package/dist/NiceCodeEditor-BJSEzhcY.cjs +260 -0
  7. package/dist/NiceCodeEditor-BfkH1bsZ.cjs +260 -0
  8. package/dist/NiceCodeEditor-CduGYggj.js +1179 -0
  9. package/dist/NiceColorPicker-CdUnhM-A.cjs +1 -0
  10. package/dist/NiceColorPicker-DCgmE-3H.cjs +1 -0
  11. package/dist/NiceColorPicker-DK30kJgy.js +486 -0
  12. package/dist/NiceColorPicker-DpXwnDwL.js +598 -0
  13. package/dist/NiceColorPicker-DtPFxDKM.cjs +1 -0
  14. package/dist/NiceColorPicker-bNJBAU_c.js +598 -0
  15. package/dist/NiceConfirmDialog-B7aNRL2K.cjs +1 -0
  16. package/dist/NiceConfirmDialog-BdhWenrO.js +81 -0
  17. package/dist/NiceDataGrid-BOCJr6XF.js +2217 -0
  18. package/dist/NiceDataGrid-BV5Oh-gy.cjs +10 -0
  19. package/dist/NiceDataGrid-CVYEo_nv.cjs +10 -0
  20. package/dist/NiceDataGrid-D-rm4lu8.js +2217 -0
  21. package/dist/NiceDataGrid-Dd7SI-M6.cjs +10 -0
  22. package/dist/NiceDataGrid-DjZchXYG.js +2217 -0
  23. package/dist/NiceDocumentViewer-BgcgLWJ3.cjs +180 -0
  24. package/dist/NiceDocumentViewer-sukmGhRx.js +672 -0
  25. package/dist/NiceForm-BCEXovJR.cjs +1 -0
  26. package/dist/NiceForm-D7oyWHXg.js +4820 -0
  27. package/dist/NiceForm-DUhxXArr.js +4817 -0
  28. package/dist/NiceForm-DVc0Xoly.js +4819 -0
  29. package/dist/NiceForm-qD_RKPYz.cjs +1 -0
  30. package/dist/NiceForm-uCeVmTrD.cjs +1 -0
  31. package/dist/NiceGantt-4UBd4uJ8.cjs +1 -0
  32. package/dist/NiceGantt-B_1lwEsp.js +328 -0
  33. package/dist/NiceHtmlEditor-BYk1roA4.cjs +10 -0
  34. package/dist/NiceHtmlEditor-Bce9Vwe1.cjs +10 -0
  35. package/dist/NiceHtmlEditor-C5kLeF9H.cjs +10 -0
  36. package/dist/NiceHtmlEditor-CFVMIC5L.js +848 -0
  37. package/dist/NiceHtmlEditor-CGRgcu2h.js +848 -0
  38. package/dist/NiceHtmlEditor-mWebBmy1.js +849 -0
  39. package/dist/NiceLoginForm-BHyDY7br.cjs +1 -0
  40. package/dist/NiceLoginForm-BTuQ0eKk.cjs +1 -0
  41. package/dist/NiceLoginForm-BuxFY2Rk.js +750 -0
  42. package/dist/NiceLoginForm-o1A-TBcp.js +736 -0
  43. package/dist/NiceLoginForm.css +1 -0
  44. package/dist/NiceMention-CA7CL5BI.js +11263 -0
  45. package/dist/NiceMention-CHcKRl-L.cjs +430 -0
  46. package/dist/NiceMention-DJD0BLcp.js +11269 -0
  47. package/dist/NiceMention-DcaUEMSg.cjs +430 -0
  48. package/dist/NiceMention-Dds9GQzk.cjs +430 -0
  49. package/dist/NiceMention-DlLXWddO.js +11268 -0
  50. package/dist/NiceMention.css +1 -1
  51. package/dist/NiceModal-C4p8a82e.cjs +1 -0
  52. package/dist/NiceModal-Dr1e3nQZ.cjs +1 -0
  53. package/dist/NiceModal-TNlkaL_i.js +85 -0
  54. package/dist/NiceModal-sihGCfDy.js +95 -0
  55. package/dist/NiceModuleLifecyclePanel-BWbKdVC_.js +7054 -0
  56. package/dist/NiceModuleLifecyclePanel-CZHIzvkE.cjs +1 -0
  57. package/dist/NiceModuleLifecyclePanel-Du7G3-RG.js +7053 -0
  58. package/dist/NiceModuleLifecyclePanel-OC9YK2kG.js +7052 -0
  59. package/dist/NiceModuleLifecyclePanel-_OcfDmtC.cjs +1 -0
  60. package/dist/NiceModuleLifecyclePanel-js1p7LIY.cjs +1 -0
  61. package/dist/NicePagination-8XsBbMNx.js +165 -0
  62. package/dist/NicePagination-CkOoXf0f.js +165 -0
  63. package/dist/NicePagination-D44waj9o.cjs +1 -0
  64. package/dist/NicePagination-D7lek1G7.cjs +1 -0
  65. package/dist/NicePagination-DdxH8KMG.js +179 -0
  66. package/dist/NicePagination-OjTEfZJE.cjs +1 -0
  67. package/dist/NicePivotGrid-B2YHP3Z6.js +1183 -0
  68. package/dist/NicePivotGrid-BJRSciWl.js +1183 -0
  69. package/dist/NicePivotGrid-BtVUWiud.cjs +152 -0
  70. package/dist/NicePivotGrid-CS1dPmNI.cjs +152 -0
  71. package/dist/NicePivotGrid-D2AxqDzJ.js +1183 -0
  72. package/dist/NicePivotGrid-DxQ6Py9D.cjs +152 -0
  73. package/dist/NiceSavedQueryPanel-B5HhqlAI.cjs +586 -0
  74. package/dist/NiceSavedQueryPanel-C0A-eoYN.js +5142 -0
  75. package/dist/NiceSavedQueryPanel-CMStDOKe.js +5125 -0
  76. package/dist/NiceSavedQueryPanel-D2i34e_b.cjs +586 -0
  77. package/dist/NiceSavedQueryPanel-ZrilZRtf.cjs +586 -0
  78. package/dist/NiceSavedQueryPanel-mPO2THs7.js +5142 -0
  79. package/dist/NiceSavedQueryPanel.css +1 -1
  80. package/dist/NiceScheduler-7gP7vcLy.cjs +5 -0
  81. package/dist/NiceScheduler-Cy7F9tgH.js +1693 -0
  82. package/dist/NiceScheduler-DquRUZxD.cjs +5 -0
  83. package/dist/NiceScheduler-KSzaUQxC.js +1693 -0
  84. package/dist/NiceScheduler-O3AwmdGG.cjs +5 -0
  85. package/dist/NiceScheduler-l8N4yCWd.js +1716 -0
  86. package/dist/NiceSelect-BCbWtu1v.js +433 -0
  87. package/dist/NiceSelect-BqtiQbfD.cjs +1 -0
  88. package/dist/NiceSelect-DZB1Rs9x.js +435 -0
  89. package/dist/NiceSelect-tMz9QQUs.cjs +1 -0
  90. package/dist/NiceStreamDashboard.doc-74KUXya1.cjs +8 -0
  91. package/dist/NiceStreamDashboard.doc-k8PQfCM0.js +32 -0
  92. package/dist/NiceWindow-BEov3s9F.js +2094 -0
  93. package/dist/NiceWindow-BU1Ce7gS.js +1623 -0
  94. package/dist/NiceWindow-CDt6PCEg.cjs +1 -0
  95. package/dist/NiceWindow-jjdE6vGy.cjs +1 -0
  96. package/dist/NiceWindow.css +1 -1
  97. package/dist/charts-C047IMVn.cjs +768 -0
  98. package/dist/charts-C44vJber.cjs +768 -0
  99. package/dist/charts-CCXSb3xk.js +4752 -0
  100. package/dist/charts-CqETcUhH.js +4752 -0
  101. package/dist/charts-DouiiHOT.cjs +768 -0
  102. package/dist/charts-XVlDwU0y.js +4732 -0
  103. package/dist/charts.cjs +1 -1
  104. package/dist/charts.mjs +8 -8
  105. package/dist/core-BL-KmGYC.js +795 -0
  106. package/dist/core-BxiH7vkV.cjs +1 -0
  107. package/dist/core-Chg-oYCr.cjs +1 -0
  108. package/dist/core-CxBnKAhs.cjs +1 -0
  109. package/dist/core-DMV6_SEE.js +795 -0
  110. package/dist/core-D_LRh59n.js +795 -0
  111. package/dist/data-branching-Km4lc8P_.cjs +1 -0
  112. package/dist/data-branching-YQtJJEtn.js +6273 -0
  113. package/dist/data-branching-oEH04O3i.js +6273 -0
  114. package/dist/data-branching-wmsbLNfa.cjs +1 -0
  115. package/dist/data-branching.cjs +1 -1
  116. package/dist/data-branching.mjs +1 -1
  117. package/dist/data.cjs +1 -1
  118. package/dist/data.d.ts +2 -53
  119. package/dist/data.mjs +3 -3
  120. package/dist/devops-Bt6EsfPa.cjs +17 -0
  121. package/dist/devops-CnZQ1rU5.js +8312 -0
  122. package/dist/devops-D5yIDM3e.js +8312 -0
  123. package/dist/devops-rVpB0ZAX.cjs +17 -0
  124. package/dist/devops.cjs +1 -1
  125. package/dist/devops.mjs +1 -1
  126. package/dist/editors.cjs +1 -1
  127. package/dist/editors.d.ts +8 -26
  128. package/dist/editors.mjs +55 -54
  129. package/dist/feedback.cjs +1 -1
  130. package/dist/feedback.d.ts +5 -0
  131. package/dist/feedback.mjs +3 -3
  132. package/dist/index.cjs +290 -290
  133. package/dist/index.css +1 -1
  134. package/dist/index.d.ts +239 -234
  135. package/dist/index.mjs +20262 -19440
  136. package/dist/lazy.cjs +1 -1
  137. package/dist/lazy.mjs +29 -29
  138. package/dist/navigation.cjs +1 -1
  139. package/dist/navigation.d.ts +4 -4
  140. package/dist/navigation.mjs +69 -69
  141. package/dist/no-code-4GtIBr6f.js +7503 -0
  142. package/dist/no-code-6WyYb3hL.cjs +331 -0
  143. package/dist/no-code-BH5oVFC6.js +8186 -0
  144. package/dist/no-code-Bdwh1vyS.cjs +332 -0
  145. package/dist/no-code-CnHG5_Vn.js +8186 -0
  146. package/dist/no-code-DMKlg1Zl.cjs +331 -0
  147. package/dist/no-code.cjs +1 -1
  148. package/dist/no-code.css +1 -1
  149. package/dist/no-code.d.ts +25 -18
  150. package/dist/no-code.mjs +3 -3
  151. package/dist/overlays.cjs +1 -1
  152. package/dist/overlays.d.ts +24 -24
  153. package/dist/overlays.mjs +24 -490
  154. package/dist/pickerCommons-0vyK1Knv.js +547 -0
  155. package/dist/pickerCommons-31hyz1gs.js +1122 -0
  156. package/dist/pickerCommons-BFbItm8o.cjs +1 -0
  157. package/dist/pickerCommons-BHirHJyn.js +548 -0
  158. package/dist/pickerCommons-BifIkPdk.cjs +1 -0
  159. package/dist/pickerCommons-Bt8JIaTN.cjs +1 -0
  160. package/dist/pickerCommons.css +1 -1
  161. package/dist/style.css +10 -7
  162. package/package.json +5 -7
  163. package/css/legacy-bg-text-aliases.css +0 -87
@@ -0,0 +1 @@
1
+ "use strict";const e=require("react/jsx-runtime"),g=require("@nice2dev/ui-core"),n=require("react"),U=require("./NiceButton-5tWvfXKl.cjs"),M={info:e.jsx("svg",{viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})}),success:e.jsx("svg",{viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})}),warning:e.jsx("svg",{viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})}),error:e.jsx("svg",{viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z",clipRule:"evenodd"})})},W=({variant:s="info",title:i,children:a,closable:r,onClose:t,icon:c,size:d="md",className:f,style:u,displayStyle:h})=>{const _=g.useComponentDisplayClass("card",h);return e.jsxs("div",{className:`nice-alert nice-alert--${s} nice-alert--${d} nice-alert--ds-${_} ${f||""}`,style:u,role:"alert",children:[e.jsx("div",{className:`nice-alert__icon nice-alert__icon--${s}`,children:c||M[s]}),e.jsxs("div",{className:"nice-alert__content",children:[i&&e.jsx("div",{className:"nice-alert__title",children:i}),e.jsx("div",{children:a})]}),r&&e.jsx("button",{type:"button",className:"nice-alert__close",onClick:t,"aria-label":"Close",children:e.jsx(g.NiceIcon,{name:"close",size:16})})]})},Y=({open:s,onClose:i,title:a,position:r="right",size:t="md",children:c,footer:d,transitionDuration:f,className:u,style:h,displayStyle:_})=>{const N=g.useComponentDisplayStyle("modal",_),x=g.useComponentDisplayClass("modal",_),{t:p}=g.useNiceTranslation(),j=n.useRef(null);return g.useFocusTrap(j,s),n.useEffect(()=>{if(!s)return;const m=o=>{o.key==="Escape"&&i()};return document.addEventListener("keydown",m),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",m),document.body.style.overflow=""}},[s,i]),s?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"nice-drawer-overlay",onMouseDown:m=>{m.target===m.currentTarget&&i()}}),e.jsxs("div",{ref:j,className:`nice-drawer nice-drawer--${r} nice-drawer--${t} nice-drawer--ds-${x} ${u||""}`,style:{...N,...h,...f!=null?{transitionDuration:`${f}ms`}:{}},role:"dialog","aria-modal":"true","aria-label":a,children:[a&&e.jsxs("div",{className:"nice-drawer__header",children:[e.jsx("h3",{className:"nice-drawer__title",children:a}),e.jsx("button",{type:"button",className:"nice-drawer__close",onClick:i,"aria-label":p("controls.close","Close"),children:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})})})]}),e.jsx("div",{className:"nice-drawer__body",children:c}),d&&e.jsx("div",{className:"nice-drawer__footer",children:d})]})]}):null},G=({toasts:s,onDismiss:i,position:a="top-right"})=>e.jsx("div",{className:`nice-toast-container nice-toast-container--${a}`,children:s.map(r=>e.jsx(J,{toast:r,onDismiss:i},r.id))}),J=({toast:s,onDismiss:i})=>{const[a,r]=n.useState(!1);return n.useEffect(()=>{if(!s.duration&&s.duration!==0){const t=setTimeout(()=>r(!0),4e3);return()=>clearTimeout(t)}if(s.duration>0){const t=setTimeout(()=>r(!0),s.duration);return()=>clearTimeout(t)}},[s.duration]),n.useEffect(()=>{if(a){const t=setTimeout(()=>i(s.id),200);return()=>clearTimeout(t)}},[a,s.id,i]),e.jsxs("div",{className:`nice-toast nice-toast--${s.variant} ${a?"nice-toast--exiting":""}`,role:"alert",style:{position:"relative"},children:[e.jsx("div",{className:"nice-toast__icon",children:M[s.variant]}),e.jsxs("div",{className:"nice-toast__content",children:[s.title&&e.jsx("div",{className:"nice-toast__title",children:s.title}),e.jsx("div",{className:"nice-toast__message",children:s.message})]}),e.jsx("button",{type:"button",className:"nice-toast__close",onClick:()=>r(!0),"aria-label":"Close",children:e.jsx(g.NiceIcon,{name:"close",size:16})})]})};let K=0;function Q(){const[s,i]=n.useState([]),a=n.useCallback((t,c,d)=>{const f=`toast-${++K}`;return i(u=>[...u,{id:f,variant:t,message:c,title:d?.title,duration:d?.duration}]),f},[]),r=n.useCallback(t=>{i(c=>c.filter(d=>d.id!==t))},[]);return{toasts:s,dismiss:r,info:(t,c)=>a("info",t,c),success:(t,c)=>a("success",t,c),warning:(t,c)=>a("warning",t,c),error:(t,c)=>a("error",t,c)}}const P=class P extends n.Component{constructor(){super(...arguments),this.state={hasError:!1,error:null},this.handleReset=()=>{this.setState({hasError:!1,error:null})}}static getDerivedStateFromError(i){return{hasError:!0,error:i}}componentDidCatch(i,a){this.props.onError?.(i,a)}render(){if(this.state.hasError&&this.state.error){const{fallback:i,showRetry:a=!0,retryLabel:r="Retry",title:t="Something went wrong"}=this.props;return typeof i=="function"?i(this.state.error,this.handleReset):i||e.jsxs("div",{className:"nice-error-boundary",role:"alert",children:[e.jsx("div",{className:"nice-error-boundary__icon",children:e.jsx(g.NiceIcon,{name:"warning",size:32})}),e.jsx("h2",{className:"nice-error-boundary__title",children:t}),e.jsx("p",{className:"nice-error-boundary__message",children:this.state.error.message}),a&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--primary",onClick:this.handleReset,children:r})]})}return this.props.children}};P.displayName="NiceErrorBoundary";let F=P;function X(s){return window.addEventListener("online",s),window.addEventListener("offline",s),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",s)}}function Z(){return navigator.onLine}function ee(){return!0}const se=({message:s,variant:i="warning",icon:a,online:r,size:t="md",className:c,style:d,"data-testid":f})=>{const{t:u}=g.useNiceTranslation(),h=n.useSyncExternalStore(X,Z,ee);return r??h?null:e.jsxs("div",{className:`nice-offline-banner nice-offline-banner--${i} nice-offline-banner--${t} ${c||""}`,style:d,role:"alert","aria-live":"assertive","data-testid":f,children:[e.jsx("span",{className:"nice-offline-banner__icon",children:a??e.jsx(g.NiceIcon,{name:"wifi",size:18})}),e.jsx("span",{className:"nice-offline-banner__message",children:s??u("offlineBanner.message","You are offline. Some features may be unavailable.")})]})},ne=({error:s,onRetry:i,retryLabel:a="Retry",title:r="Operation failed",autoRetrySeconds:t,variant:c="error",icon:d,size:f="md",className:u,style:h,"data-testid":_})=>{const[N,x]=n.useState(t??0),p=n.useRef(void 0),j=typeof s=="string"?s:s.message,m=n.useCallback(()=>{x(t??0),i()},[i,t]);return n.useEffect(()=>{if(!(!t||t<=0))return x(t),p.current=setInterval(()=>{x(o=>o<=1?(clearInterval(p.current),i(),0):o-1)},1e3),()=>clearInterval(p.current)},[t,i]),e.jsxs("div",{className:`nice-retry-panel nice-retry-panel--${c} nice-retry-panel--${f} ${u||""}`,style:h,role:"alert","data-testid":_,children:[e.jsx("div",{className:"nice-retry-panel__icon",children:d??e.jsx(g.NiceIcon,{name:"warning",size:24})}),e.jsxs("div",{className:"nice-retry-panel__content",children:[e.jsx("div",{className:"nice-retry-panel__title",children:r}),e.jsx("p",{className:"nice-retry-panel__message",children:j})]}),e.jsxs("div",{className:"nice-retry-panel__actions",children:[e.jsx("button",{type:"button",className:"nice-btn nice-btn--primary nice-btn--sm",onClick:m,children:a}),t&&N>0&&e.jsxs("span",{className:"nice-retry-panel__countdown",children:["Auto-retry in ",N,"s"]})]})]})};function q({timeoutMs:s=1e4,slowThresholdMs:i=3e3,onTimeout:a,autoRetry:r=!1,autoRetryCount:t=3}={}){const[c,d]=n.useState(!1),[f,u]=n.useState(!1),[h,_]=n.useState(!1),[N,x]=n.useState(0),[p,j]=n.useState(0),m=n.useRef(null),o=n.useRef(null),T=n.useRef(null),w=n.useRef(0),k=n.useCallback(()=>{m.current&&clearTimeout(m.current),o.current&&clearTimeout(o.current),T.current&&clearInterval(T.current)},[]),y=n.useCallback(()=>{k(),d(!0),u(!1),_(!1),x(0),w.current=Date.now(),T.current=setInterval(()=>{x(Date.now()-w.current)},200),m.current=setTimeout(()=>{u(!0)},i),o.current=setTimeout(()=>{_(!0),d(!1),u(!1),k(),a?.()},s)},[k,i,s,a]),C=n.useCallback(()=>{k(),d(!1),u(!1)},[k]),l=n.useCallback(()=>{j(v=>v+1),_(!1),y()},[y]);return n.useEffect(()=>()=>k(),[k]),n.useEffect(()=>{if(r&&h&&p<t){const v=Math.pow(2,p)*1e3,I=setTimeout(()=>l(),v);return()=>clearTimeout(I)}},[r,t,h,p,l]),{isLoading:c,isSlow:f,isTimedOut:h,elapsed:N,retryCount:p,start:y,stop:C,retry:l}}const te=({timeoutMs:s=1e4,slowThresholdMs:i=3e3,onTimeout:a,onRetry:r,autoRetry:t=!1,autoRetryCount:c=3,showProgress:d=!0,slowMessage:f,timeoutMessage:u,loading:h,children:_,size:N="md",className:x,style:p,"data-testid":j})=>{const{t:m}=g.useNiceTranslation(),{isSlow:o,isTimedOut:T,elapsed:w,start:k,stop:y,retry:C}=q({timeoutMs:s,slowThresholdMs:i,onTimeout:a,autoRetry:t,autoRetryCount:c}),l=n.useRef(k);l.current=k;const v=n.useRef(y);v.current=y,n.useEffect(()=>{h?l.current():v.current()},[h]);const I=()=>{C(),r?.()};if(!h)return e.jsx(e.Fragment,{children:_});if(T)return e.jsxs("div",{className:`nice-timeout-feedback nice-timeout-feedback--timeout nice-timeout-feedback--${N} ${x??""}`,style:p,role:"alert","data-testid":j,children:[e.jsx("p",{className:"nice-timeout-feedback__message",children:u??m("timeoutFeedback.timeout","The operation timed out. Please try again.")}),e.jsx(U.NiceButton,{size:"sm",className:"nice-timeout-feedback__retry-btn",onClick:I,children:m("timeoutFeedback.retry","Try again")})]});const $=Math.min(100,w/s*100);return e.jsxs("div",{className:`nice-timeout-feedback nice-timeout-feedback--${N} ${o?"nice-timeout-feedback--slow":""} ${x??""}`,style:p,role:"status","aria-busy":"true","data-testid":j,children:[e.jsx("div",{className:"nice-timeout-feedback__spinner","aria-hidden":"true"}),o&&e.jsx("p",{className:"nice-timeout-feedback__slow-msg",children:f??m("timeoutFeedback.slow","This is taking longer than usual…")}),d&&e.jsx("div",{className:"nice-timeout-feedback__progress",role:"progressbar","aria-label":m("timeoutFeedback.progress","Time until timeout"),"aria-valuenow":Math.round($),"aria-valuemin":0,"aria-valuemax":100,children:e.jsx("div",{className:"nice-timeout-feedback__progress-bar",style:{width:`${$}%`}})})]})},O=n.forwardRef(({visible:s,onAcceptAll:i,onRejectAll:a,onSave:r,categories:t=["necessary","analytics","marketing","preferences"],defaults:c,position:d="bottom",size:f="md",policyUrl:u,showDetails:h=!1,className:_,style:N,id:x,...p},j)=>{const m=g.useControlId(x),{t:o}=g.useNiceTranslation(),[T,w]=n.useState(!0),k=s??T,[y,C]=n.useState(h),[l,v]=n.useState(()=>{const b={necessary:!0,analytics:!1,marketing:!1,preferences:!1};return c&&Object.assign(b,c),b.necessary=!0,b}),I={necessary:o("cookie.necessary","Necessary"),analytics:o("cookie.analytics","Analytics"),marketing:o("cookie.marketing","Marketing"),preferences:o("cookie.preferences","Preferences")},$={necessary:o("cookie.necessaryDesc","Required for the website to function. Cannot be disabled."),analytics:o("cookie.analyticsDesc","Help us understand how visitors interact with the website."),marketing:o("cookie.marketingDesc","Used to deliver relevant advertisements."),preferences:o("cookie.preferencesDesc","Allow the website to remember your choices.")},L=n.useCallback(()=>{const b={necessary:!0,analytics:!0,marketing:!0,preferences:!0};i?.(),r?.(b),w(!1)},[i,r]),S=n.useCallback(()=>{const b={necessary:!0,analytics:!1,marketing:!1,preferences:!1};a?.(),r?.(b),w(!1)},[a,r]),z=n.useCallback(()=>{r?.({...l,necessary:!0}),w(!1)},[l,r]);return k?e.jsx("div",{ref:j,id:m,className:`nice-cookie-consent nice-cookie-consent--${d} nice-cookie-consent--${f} ${_??""}`,style:N,role:"dialog","aria-label":o("cookie.label","Cookie Consent"),"aria-modal":"true",...p,children:e.jsxs("div",{className:"nice-cookie-consent__content",children:[e.jsxs("p",{className:"nice-cookie-consent__message",children:[o("cookie.message","We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies."),u&&e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{href:u,className:"nice-cookie-consent__link",target:"_blank",rel:"noopener noreferrer",children:o("cookie.learnMore","Learn more")})]})]}),y&&e.jsx("div",{className:"nice-cookie-consent__details",children:t.map(b=>e.jsxs("label",{className:"nice-cookie-consent__category",children:[e.jsx("input",{type:"checkbox",checked:l[b],disabled:b==="necessary",onChange:D=>v(E=>({...E,[b]:D.target.checked})),className:"nice-cookie-consent__checkbox"}),e.jsxs("div",{className:"nice-cookie-consent__cat-info",children:[e.jsx("strong",{children:I[b]}),e.jsx("span",{className:"nice-cookie-consent__cat-desc",children:$[b]})]})]},b))}),e.jsxs("div",{className:"nice-cookie-consent__actions",children:[!y&&e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--details",onClick:()=>C(!0),children:o("cookie.customize","Customize")}),y&&e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--save",onClick:z,children:o("cookie.savePreferences","Save preferences")}),e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--reject",onClick:S,children:o("cookie.rejectAll","Reject all")}),e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--accept",onClick:L,children:o("cookie.acceptAll","Accept all")})]})]})}):null});O.displayName="NiceCookieConsent";const H=n.forwardRef(({onSubmit:s,onForgotPassword:i,onRegister:a,loading:r=!1,error:t,variant:c="primary",size:d="md",showRememberMe:f=!0,showForgotPassword:u=!0,showRegister:h=!1,title:_,logo:N,usernameLabel:x,passwordLabel:p,usernamePlaceholder:j,passwordPlaceholder:m,className:o,style:T,id:w,...k},y)=>{const C=g.useControlId(w),{t:l}=g.useNiceTranslation(),[v,I]=n.useState(""),[$,L]=n.useState(""),[S,z]=n.useState(!1),[b,D]=n.useState(!1),E=`${C}-user`,A=`${C}-pass`,B=`${C}-remember`,V=n.useCallback(R=>{R.preventDefault(),!r&&s?.({username:v,password:$,rememberMe:S})},[r,v,$,S,s]);return e.jsxs("form",{ref:y,id:C,className:`nice-login nice-login--${c} nice-login--${d} ${o??""}`,style:T,onSubmit:V,noValidate:!0,...k,children:[N&&e.jsx("div",{className:"nice-login__logo",children:N}),_&&e.jsx("h2",{className:"nice-login__title",children:_??l("login.title","Sign In")}),t&&e.jsx("div",{className:"nice-login__error",role:"alert",children:t}),e.jsxs("div",{className:"nice-login__field",children:[e.jsx("label",{htmlFor:E,className:"nice-login__label",children:x??l("login.username","Username")}),e.jsx("input",{id:E,className:"nice-login__input",type:"text",value:v,onChange:R=>I(R.target.value),placeholder:j??l("login.usernamePlaceholder","Enter your username"),autoComplete:"username",required:!0,disabled:r,"aria-required":"true"})]}),e.jsxs("div",{className:"nice-login__field",children:[e.jsx("label",{htmlFor:A,className:"nice-login__label",children:p??l("login.password","Password")}),e.jsxs("div",{className:"nice-login__password-wrap",children:[e.jsx("input",{id:A,className:"nice-login__input",type:b?"text":"password",value:$,onChange:R=>L(R.target.value),placeholder:m??l("login.passwordPlaceholder","Enter your password"),autoComplete:"current-password",required:!0,disabled:r,"aria-required":"true"}),e.jsx("button",{type:"button",className:"nice-login__toggle-password",onClick:()=>D(!b),"aria-label":b?l("login.hidePassword","Hide password"):l("login.showPassword","Show password"),tabIndex:-1,children:e.jsx(g.NiceIcon,{name:b?"eye-off":"eye",size:16})})]})]}),e.jsxs("div",{className:"nice-login__options",children:[f&&e.jsxs("label",{className:"nice-login__remember",htmlFor:B,children:[e.jsx("input",{id:B,type:"checkbox",checked:S,onChange:R=>z(R.target.checked),disabled:r}),e.jsx("span",{children:l("login.rememberMe","Remember me")})]}),u&&i&&e.jsx("button",{type:"button",className:"nice-login__forgot",onClick:i,disabled:r,children:l("login.forgotPassword","Forgot password?")})]}),e.jsx("button",{type:"submit",className:`nice-login__submit nice-login__submit--${c}`,disabled:r||!v||!$,children:r?l("login.loading","Signing in..."):l("login.submit","Sign In")}),h&&a&&e.jsxs("p",{className:"nice-login__register",children:[l("login.noAccount","Don't have an account?")," ",e.jsx("button",{type:"button",className:"nice-login__register-link",onClick:a,disabled:r,children:l("login.register","Register")})]})]})});H.displayName="NiceLoginForm";exports.NiceAlert=W;exports.NiceCookieConsent=O;exports.NiceDrawer=Y;exports.NiceErrorBoundary=F;exports.NiceLoginForm=H;exports.NiceOfflineBanner=se;exports.NiceRetryPanel=ne;exports.NiceTimeoutFeedback=te;exports.NiceToastContainer=G;exports.alertIcons=M;exports.useNiceTimeout=q;exports.useNiceToast=Q;
@@ -0,0 +1 @@
1
+ "use strict";const e=require("react/jsx-runtime"),x=require("@nice2dev/ui-core"),i=require("react"),F={info:e.jsx("svg",{viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})}),success:e.jsx("svg",{viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})}),warning:e.jsx("svg",{viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})}),error:e.jsx("svg",{viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z",clipRule:"evenodd"})})},U=({variant:s="info",title:t,children:a,closable:r,onClose:n,icon:c,size:l="md",className:h,style:u,displayStyle:p})=>{const b=x.useComponentDisplayClass("card",p);return e.jsxs("div",{className:`nice-alert nice-alert--${s} nice-alert--${l} nice-alert--ds-${b} ${h||""}`,style:u,role:"alert",children:[e.jsx("div",{className:`nice-alert__icon nice-alert__icon--${s}`,children:c||F[s]}),e.jsxs("div",{className:"nice-alert__content",children:[t&&e.jsx("div",{className:"nice-alert__title",children:t}),e.jsx("div",{children:a})]}),r&&e.jsx("button",{type:"button",className:"nice-alert__close",onClick:n,"aria-label":"Close",children:e.jsx(x.NiceIcon,{name:"close",size:16})})]})},W=({open:s,onClose:t,title:a,position:r="right",size:n="md",children:c,footer:l,transitionDuration:h,className:u,style:p,displayStyle:b})=>{const N=x.useComponentDisplayStyle("modal",b),g=x.useComponentDisplayClass("modal",b),{t:_}=x.useNiceTranslation(),j=i.useRef(null);return x.useFocusTrap(j,s),i.useEffect(()=>{if(!s)return;const f=o=>{o.key==="Escape"&&t()};return document.addEventListener("keydown",f),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",f),document.body.style.overflow=""}},[s,t]),s?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"nice-drawer-overlay",onMouseDown:f=>{f.target===f.currentTarget&&t()}}),e.jsxs("div",{ref:j,className:`nice-drawer nice-drawer--${r} nice-drawer--${n} nice-drawer--ds-${g} ${u||""}`,style:{...N,...p,...h!=null?{transitionDuration:`${h}ms`}:{}},role:"dialog","aria-modal":"true","aria-label":a,children:[a&&e.jsxs("div",{className:"nice-drawer__header",children:[e.jsx("h3",{className:"nice-drawer__title",children:a}),e.jsx("button",{type:"button",className:"nice-drawer__close",onClick:t,"aria-label":_("controls.close","Close"),children:e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})})})]}),e.jsx("div",{className:"nice-drawer__body",children:c}),l&&e.jsx("div",{className:"nice-drawer__footer",children:l})]})]}):null},Y=({toasts:s,onDismiss:t,position:a="top-right"})=>e.jsx("div",{className:`nice-toast-container nice-toast-container--${a}`,children:s.map(r=>e.jsx(G,{toast:r,onDismiss:t},r.id))}),G=({toast:s,onDismiss:t})=>{const[a,r]=i.useState(!1);return i.useEffect(()=>{if(!s.duration&&s.duration!==0){const n=setTimeout(()=>r(!0),4e3);return()=>clearTimeout(n)}if(s.duration>0){const n=setTimeout(()=>r(!0),s.duration);return()=>clearTimeout(n)}},[s.duration]),i.useEffect(()=>{if(a){const n=setTimeout(()=>t(s.id),200);return()=>clearTimeout(n)}},[a,s.id,t]),e.jsxs("div",{className:`nice-toast nice-toast--${s.variant} ${a?"nice-toast--exiting":""}`,role:"alert",style:{position:"relative"},children:[e.jsx("div",{className:"nice-toast__icon",children:F[s.variant]}),e.jsxs("div",{className:"nice-toast__content",children:[s.title&&e.jsx("div",{className:"nice-toast__title",children:s.title}),e.jsx("div",{className:"nice-toast__message",children:s.message})]}),e.jsx("button",{type:"button",className:"nice-toast__close",onClick:()=>r(!0),"aria-label":"Close",children:e.jsx(x.NiceIcon,{name:"close",size:16})})]})};let J=0;function K(){const[s,t]=i.useState([]),a=i.useCallback((n,c,l)=>{const h=`toast-${++J}`;return t(u=>[...u,{id:h,variant:n,message:c,title:l?.title,duration:l?.duration}]),h},[]),r=i.useCallback(n=>{t(c=>c.filter(l=>l.id!==n))},[]);return{toasts:s,dismiss:r,info:(n,c)=>a("info",n,c),success:(n,c)=>a("success",n,c),warning:(n,c)=>a("warning",n,c),error:(n,c)=>a("error",n,c)}}const M=class M extends i.Component{constructor(){super(...arguments),this.state={hasError:!1,error:null},this.handleReset=()=>{this.setState({hasError:!1,error:null})}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,a){this.props.onError?.(t,a)}render(){if(this.state.hasError&&this.state.error){const{fallback:t,showRetry:a=!0,retryLabel:r="Retry",title:n="Something went wrong"}=this.props;return typeof t=="function"?t(this.state.error,this.handleReset):t||e.jsxs("div",{className:"nice-error-boundary",role:"alert",children:[e.jsx("div",{className:"nice-error-boundary__icon",children:e.jsx(x.NiceIcon,{name:"warning",size:32})}),e.jsx("h2",{className:"nice-error-boundary__title",children:n}),e.jsx("p",{className:"nice-error-boundary__message",children:this.state.error.message}),a&&e.jsx("button",{type:"button",className:"nice-btn nice-btn--primary",onClick:this.handleReset,children:r})]})}return this.props.children}};M.displayName="NiceErrorBoundary";let P=M;function Q(s){return window.addEventListener("online",s),window.addEventListener("offline",s),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",s)}}function X(){return navigator.onLine}function Z(){return!0}const ee=({message:s="You are offline. Some features may be unavailable.",variant:t="warning",icon:a,size:r="md",className:n,style:c,"data-testid":l})=>i.useSyncExternalStore(Q,X,Z)?null:e.jsxs("div",{className:`nice-offline-banner nice-offline-banner--${t} nice-offline-banner--${r} ${n||""}`,style:c,role:"alert","aria-live":"assertive","data-testid":l,children:[e.jsx("span",{className:"nice-offline-banner__icon",children:a??e.jsx(x.NiceIcon,{name:"wifi",size:18})}),e.jsx("span",{className:"nice-offline-banner__message",children:s})]}),se=({error:s,onRetry:t,retryLabel:a="Retry",title:r="Operation failed",autoRetrySeconds:n,variant:c="error",icon:l,size:h="md",className:u,style:p,"data-testid":b})=>{const[N,g]=i.useState(n??0),_=i.useRef(void 0),j=typeof s=="string"?s:s.message,f=i.useCallback(()=>{g(n??0),t()},[t,n]);return i.useEffect(()=>{if(!(!n||n<=0))return g(n),_.current=setInterval(()=>{g(o=>o<=1?(clearInterval(_.current),t(),0):o-1)},1e3),()=>clearInterval(_.current)},[n,t]),e.jsxs("div",{className:`nice-retry-panel nice-retry-panel--${c} nice-retry-panel--${h} ${u||""}`,style:p,role:"alert","data-testid":b,children:[e.jsx("div",{className:"nice-retry-panel__icon",children:l??e.jsx(x.NiceIcon,{name:"warning",size:24})}),e.jsxs("div",{className:"nice-retry-panel__content",children:[e.jsx("div",{className:"nice-retry-panel__title",children:r}),e.jsx("p",{className:"nice-retry-panel__message",children:j})]}),e.jsxs("div",{className:"nice-retry-panel__actions",children:[e.jsx("button",{type:"button",className:"nice-btn nice-btn--primary nice-btn--sm",onClick:f,children:a}),n&&N>0&&e.jsxs("span",{className:"nice-retry-panel__countdown",children:["Auto-retry in ",N,"s"]})]})]})};function B({timeoutMs:s=1e4,slowThresholdMs:t=3e3,onTimeout:a,autoRetry:r=!1,autoRetryCount:n=3}={}){const[c,l]=i.useState(!1),[h,u]=i.useState(!1),[p,b]=i.useState(!1),[N,g]=i.useState(0),[_,j]=i.useState(0),f=i.useRef(null),o=i.useRef(null),C=i.useRef(null),y=i.useRef(0),k=i.useCallback(()=>{f.current&&clearTimeout(f.current),o.current&&clearTimeout(o.current),C.current&&clearInterval(C.current)},[]),v=i.useCallback(()=>{k(),l(!0),u(!1),b(!1),g(0),y.current=Date.now(),C.current=setInterval(()=>{g(Date.now()-y.current)},200),f.current=setTimeout(()=>{u(!0)},t),o.current=setTimeout(()=>{b(!0),l(!1),u(!1),k(),a?.()},s)},[k,t,s,a]),T=i.useCallback(()=>{k(),l(!1),u(!1)},[k]),d=i.useCallback(()=>{j(w=>w+1),b(!1),v()},[v]);return i.useEffect(()=>()=>k(),[k]),i.useEffect(()=>{if(r&&p&&_<n){const w=Math.pow(2,_)*1e3,S=setTimeout(()=>d(),w);return()=>clearTimeout(S)}},[r,n,p,_,d]),{isLoading:c,isSlow:h,isTimedOut:p,elapsed:N,retryCount:_,start:v,stop:T,retry:d}}const ne=({timeoutMs:s=1e4,slowThresholdMs:t=3e3,onTimeout:a,onRetry:r,autoRetry:n=!1,autoRetryCount:c=3,showProgress:l=!0,slowMessage:h="This is taking longer than usual…",timeoutMessage:u="The operation timed out. Please try again.",loading:p,children:b,size:N="md",className:g,style:_,"data-testid":j})=>{const{isSlow:f,isTimedOut:o,elapsed:C,retry:y}=B({timeoutMs:s,slowThresholdMs:t,onTimeout:a,autoRetry:n,autoRetryCount:c}),k=()=>{y(),r?.()};if(!p)return e.jsx(e.Fragment,{children:b});if(o)return e.jsxs("div",{className:`nice-timeout-feedback nice-timeout-feedback--timeout nice-timeout-feedback--${N} ${g??""}`,style:_,role:"alert","data-testid":j,children:[e.jsx("p",{className:"nice-timeout-feedback__message",children:u}),e.jsx("button",{className:"nice-timeout-feedback__retry-btn",onClick:k,type:"button",children:"Try again"})]});const v=Math.min(100,C/s*100);return e.jsxs("div",{className:`nice-timeout-feedback nice-timeout-feedback--${N} ${f?"nice-timeout-feedback--slow":""} ${g??""}`,style:_,"data-testid":j,children:[e.jsx("div",{className:"nice-timeout-feedback__spinner","aria-busy":"true"}),f&&e.jsx("p",{className:"nice-timeout-feedback__slow-msg",children:h}),l&&e.jsx("div",{className:"nice-timeout-feedback__progress",role:"progressbar","aria-valuenow":v,"aria-valuemin":0,"aria-valuemax":100,children:e.jsx("div",{className:"nice-timeout-feedback__progress-bar",style:{width:`${v}%`}})})]})},O=i.forwardRef(({visible:s,onAcceptAll:t,onRejectAll:a,onSave:r,categories:n=["necessary","analytics","marketing","preferences"],defaults:c,position:l="bottom",size:h="md",policyUrl:u,showDetails:p=!1,className:b,style:N,id:g,..._},j)=>{const f=x.useControlId(g),{t:o}=x.useNiceTranslation(),[C,y]=i.useState(!0),k=s??C,[v,T]=i.useState(p),[d,w]=i.useState(()=>{const m={necessary:!0,analytics:!1,marketing:!1,preferences:!1};return c&&Object.assign(m,c),m.necessary=!0,m}),S={necessary:o("cookie.necessary","Necessary"),analytics:o("cookie.analytics","Analytics"),marketing:o("cookie.marketing","Marketing"),preferences:o("cookie.preferences","Preferences")},I={necessary:o("cookie.necessaryDesc","Required for the website to function. Cannot be disabled."),analytics:o("cookie.analyticsDesc","Help us understand how visitors interact with the website."),marketing:o("cookie.marketingDesc","Used to deliver relevant advertisements."),preferences:o("cookie.preferencesDesc","Allow the website to remember your choices.")},R=i.useCallback(()=>{const m={necessary:!0,analytics:!0,marketing:!0,preferences:!0};t?.(),r?.(m),y(!1)},[t,r]),E=i.useCallback(()=>{const m={necessary:!0,analytics:!1,marketing:!1,preferences:!1};a?.(),r?.(m),y(!1)},[a,r]),D=i.useCallback(()=>{r?.({...d,necessary:!0}),y(!1)},[d,r]);return k?e.jsx("div",{ref:j,id:f,className:`nice-cookie-consent nice-cookie-consent--${l} nice-cookie-consent--${h} ${b??""}`,style:N,role:"dialog","aria-label":o("cookie.label","Cookie Consent"),"aria-modal":"true",..._,children:e.jsxs("div",{className:"nice-cookie-consent__content",children:[e.jsxs("p",{className:"nice-cookie-consent__message",children:[o("cookie.message","We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies."),u&&e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{href:u,className:"nice-cookie-consent__link",target:"_blank",rel:"noopener noreferrer",children:o("cookie.learnMore","Learn more")})]})]}),v&&e.jsx("div",{className:"nice-cookie-consent__details",children:n.map(m=>e.jsxs("label",{className:"nice-cookie-consent__category",children:[e.jsx("input",{type:"checkbox",checked:d[m],disabled:m==="necessary",onChange:z=>w(L=>({...L,[m]:z.target.checked})),className:"nice-cookie-consent__checkbox"}),e.jsxs("div",{className:"nice-cookie-consent__cat-info",children:[e.jsx("strong",{children:S[m]}),e.jsx("span",{className:"nice-cookie-consent__cat-desc",children:I[m]})]})]},m))}),e.jsxs("div",{className:"nice-cookie-consent__actions",children:[!v&&e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--details",onClick:()=>T(!0),children:o("cookie.customize","Customize")}),v&&e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--save",onClick:D,children:o("cookie.savePreferences","Save preferences")}),e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--reject",onClick:E,children:o("cookie.rejectAll","Reject all")}),e.jsx("button",{type:"button",className:"nice-cookie-consent__btn nice-cookie-consent__btn--accept",onClick:R,children:o("cookie.acceptAll","Accept all")})]})]})}):null});O.displayName="NiceCookieConsent";const H=i.forwardRef(({onSubmit:s,onForgotPassword:t,onRegister:a,loading:r=!1,error:n,variant:c="primary",size:l="md",showRememberMe:h=!0,showForgotPassword:u=!0,showRegister:p=!1,title:b,logo:N,usernameLabel:g,passwordLabel:_,usernamePlaceholder:j,passwordPlaceholder:f,className:o,style:C,id:y,...k},v)=>{const T=x.useControlId(y),{t:d}=x.useNiceTranslation(),[w,S]=i.useState(""),[I,R]=i.useState(""),[E,D]=i.useState(!1),[m,z]=i.useState(!1),L=`${T}-user`,A=`${T}-pass`,q=`${T}-remember`,V=i.useCallback($=>{$.preventDefault(),!r&&s?.({username:w,password:I,rememberMe:E})},[r,w,I,E,s]);return e.jsxs("form",{ref:v,id:T,className:`nice-login nice-login--${c} nice-login--${l} ${o??""}`,style:C,onSubmit:V,noValidate:!0,...k,children:[N&&e.jsx("div",{className:"nice-login__logo",children:N}),b&&e.jsx("h2",{className:"nice-login__title",children:b??d("login.title","Sign In")}),n&&e.jsx("div",{className:"nice-login__error",role:"alert",children:n}),e.jsxs("div",{className:"nice-login__field",children:[e.jsx("label",{htmlFor:L,className:"nice-login__label",children:g??d("login.username","Username")}),e.jsx("input",{id:L,className:"nice-login__input",type:"text",value:w,onChange:$=>S($.target.value),placeholder:j??d("login.usernamePlaceholder","Enter your username"),autoComplete:"username",required:!0,disabled:r,"aria-required":"true"})]}),e.jsxs("div",{className:"nice-login__field",children:[e.jsx("label",{htmlFor:A,className:"nice-login__label",children:_??d("login.password","Password")}),e.jsxs("div",{className:"nice-login__password-wrap",children:[e.jsx("input",{id:A,className:"nice-login__input",type:m?"text":"password",value:I,onChange:$=>R($.target.value),placeholder:f??d("login.passwordPlaceholder","Enter your password"),autoComplete:"current-password",required:!0,disabled:r,"aria-required":"true"}),e.jsx("button",{type:"button",className:"nice-login__toggle-password",onClick:()=>z(!m),"aria-label":m?d("login.hidePassword","Hide password"):d("login.showPassword","Show password"),tabIndex:-1,children:e.jsx(x.NiceIcon,{name:m?"eye-off":"eye",size:16})})]})]}),e.jsxs("div",{className:"nice-login__options",children:[h&&e.jsxs("label",{className:"nice-login__remember",htmlFor:q,children:[e.jsx("input",{id:q,type:"checkbox",checked:E,onChange:$=>D($.target.checked),disabled:r}),e.jsx("span",{children:d("login.rememberMe","Remember me")})]}),u&&t&&e.jsx("button",{type:"button",className:"nice-login__forgot",onClick:t,disabled:r,children:d("login.forgotPassword","Forgot password?")})]}),e.jsx("button",{type:"submit",className:`nice-login__submit nice-login__submit--${c}`,disabled:r||!w||!I,children:r?d("login.loading","Signing in..."):d("login.submit","Sign In")}),p&&a&&e.jsxs("p",{className:"nice-login__register",children:[d("login.noAccount","Don't have an account?")," ",e.jsx("button",{type:"button",className:"nice-login__register-link",onClick:a,disabled:r,children:d("login.register","Register")})]})]})});H.displayName="NiceLoginForm";exports.NiceAlert=U;exports.NiceCookieConsent=O;exports.NiceDrawer=W;exports.NiceErrorBoundary=P;exports.NiceLoginForm=H;exports.NiceOfflineBanner=ee;exports.NiceRetryPanel=se;exports.NiceTimeoutFeedback=ne;exports.NiceToastContainer=Y;exports.alertIcons=F;exports.useNiceTimeout=B;exports.useNiceToast=K;