@nice2dev/ui-enterprise 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,3 +1,3 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("@nice2dev/icons"),n=require("react"),ie=require("@nice2dev/ui");function ve(s,a,i){const c=i.csvDelimiter||",",l=[];return i.includeHeaders!==!1&&l.push(a.filter(r=>r.include).map(r=>`"${r.label}"`).join(c)),s.forEach(r=>{const u=a.filter(o=>o.include).map(o=>{let p=r[o.field];return o.transform&&(p=o.transform(p)),p==null?"":typeof p=="string"?`"${p.replace(/"/g,'""')}"`:String(p)});l.push(u.join(c))}),l.join(`
2
- `)}function fe(s,a,i){const c=a.filter(r=>r.include),l=s.map(r=>{const u={};return c.forEach(o=>{let p=r[o.field];o.transform&&(p=o.transform(p)),u[o.field]=p}),u});return JSON.stringify(l,null,2)}const le={csv:{label:"CSV",icon:e.jsx(t.NtdFileText,{size:20}),description:"Comma-separated values"},xlsx:{label:"Excel",icon:e.jsx(t.NtdBarChart,{size:20}),description:"Microsoft Excel"},json:{label:"JSON",icon:e.jsx(t.NtdBrackets,{size:20}),description:"JavaScript Object Notation"},pdf:{label:"PDF",icon:e.jsx(t.NtdFile,{size:20}),description:"Portable Document Format"},xml:{label:"XML",icon:e.jsx(t.NtdClipboard,{size:20}),description:"Extensible Markup Language"}},ke=({formats:s,selected:a,onChange:i})=>e.jsx("div",{className:"nice-export-formats",children:s.map(c=>{const l=le[c];return e.jsxs("button",{type:"button",className:`nice-export-format ${a===c?"nice-export-format--selected":""}`,onClick:()=>i(c),title:l.description,children:[e.jsx("span",{className:"nice-export-format-icon",children:l.icon}),e.jsx("span",{className:"nice-export-format-label",children:l.label})]},c)})}),ye=({fields:s,onChange:a})=>{const i=r=>{const u=[...s];u[r]={...u[r],include:!u[r].include},a(u)},c=r=>{a(s.map(u=>({...u,include:r})))},l=s.filter(r=>r.include).length;return e.jsxs("div",{className:"nice-export-fields",children:[e.jsxs("div",{className:"nice-export-fields-header",children:[e.jsxs("span",{children:["Fields to export (",l,"/",s.length,")"]}),e.jsxs("div",{className:"nice-export-fields-actions",children:[e.jsx("button",{type:"button",onClick:()=>c(!0),children:"Select all"}),e.jsx("button",{type:"button",onClick:()=>c(!1),children:"Deselect all"})]})]}),e.jsx("div",{className:"nice-export-fields-list",children:s.map((r,u)=>e.jsxs("label",{className:"nice-export-field",children:[e.jsx("input",{type:"checkbox",checked:r.include,onChange:()=>i(u)}),e.jsx("span",{className:"nice-export-field-label",children:r.label}),e.jsx("span",{className:"nice-export-field-name",children:r.field})]},r.field))})]})},we=({format:s,options:a,onChange:i})=>{const c=(l,r)=>{i({...a,[l]:r})};return e.jsxs("div",{className:"nice-export-options",children:[e.jsx("h4",{children:"Export Options"}),e.jsxs("label",{className:"nice-export-option",children:[e.jsx("input",{type:"checkbox",checked:a.includeHeaders!==!1,onChange:l=>c("includeHeaders",l.target.checked)}),"Include headers"]}),s==="csv"&&e.jsxs("label",{className:"nice-export-option",children:[e.jsx("span",{children:"Delimiter:"}),e.jsxs("select",{value:a.csvDelimiter||",",onChange:l=>c("csvDelimiter",l.target.value),children:[e.jsx("option",{value:",",children:"Comma (,)"}),e.jsx("option",{value:";",children:"Semicolon (;)"}),e.jsx("option",{value:"\\t",children:"Tab"}),e.jsx("option",{value:"|",children:"Pipe (|)"})]})]}),e.jsxs("label",{className:"nice-export-option",children:[e.jsx("span",{children:"Date format:"}),e.jsxs("select",{value:a.dateFormat||"YYYY-MM-DD",onChange:l=>c("dateFormat",l.target.value),children:[e.jsx("option",{value:"YYYY-MM-DD",children:"YYYY-MM-DD"}),e.jsx("option",{value:"DD/MM/YYYY",children:"DD/MM/YYYY"}),e.jsx("option",{value:"MM/DD/YYYY",children:"MM/DD/YYYY"}),e.jsx("option",{value:"ISO",children:"ISO 8601"})]})]}),e.jsxs("label",{className:"nice-export-option",children:[e.jsx("span",{children:"Encoding:"}),e.jsxs("select",{value:a.encoding||"utf-8",onChange:l=>c("encoding",l.target.value),children:[e.jsx("option",{value:"utf-8",children:"UTF-8"}),e.jsx("option",{value:"utf-16",children:"UTF-16"}),e.jsx("option",{value:"iso-8859-1",children:"ISO-8859-1"})]})]}),(s==="xlsx"||s==="pdf")&&e.jsxs("label",{className:"nice-export-option",children:[e.jsx("span",{children:"Password protect:"}),e.jsx("input",{type:"password",value:a.password||"",onChange:l=>c("password",l.target.value||void 0),placeholder:"Leave empty for no password"})]})]})},Ce=({jobs:s,onDownload:a})=>{if(s.length===0)return e.jsx("div",{className:"nice-export-history-empty",children:"No export history"});const i=c=>c?c<1024?`${c} B`:c<1024*1024?`${(c/1024).toFixed(1)} KB`:`${(c/1024/1024).toFixed(1)} MB`:"-";return e.jsxs("div",{className:"nice-export-history",children:[e.jsx("h4",{children:"Export History"}),e.jsx("div",{className:"nice-export-history-list",children:s.map(c=>e.jsxs("div",{className:`nice-export-job nice-export-job--${c.status}`,children:[e.jsxs("div",{className:"nice-export-job-info",children:[e.jsx("span",{className:"nice-export-job-name",children:c.name}),e.jsx("span",{className:"nice-export-job-format",children:c.format.toUpperCase()}),e.jsx("span",{className:"nice-export-job-date",children:new Date(c.createdAt).toLocaleString()})]}),e.jsxs("div",{className:"nice-export-job-meta",children:[c.rowCount&&e.jsxs("span",{children:[c.rowCount," rows"]}),c.fileSize&&e.jsx("span",{children:i(c.fileSize)})]}),e.jsxs("div",{className:"nice-export-job-status",children:[c.status==="processing"&&e.jsx("div",{className:"nice-export-job-progress",children:e.jsx("div",{className:"nice-export-job-progress-bar",style:{width:`${c.progress}%`}})}),c.status==="completed"&&c.downloadUrl&&e.jsx("button",{type:"button",className:"nice-export-job-download",onClick:()=>a==null?void 0:a(c),children:"Download"}),c.status==="failed"&&e.jsx("span",{className:"nice-export-job-error",title:c.error,children:"Failed"})]})]},c.id))})]})},pe=n.forwardRef(({dataSource:s,formats:a=["csv","xlsx","json","pdf"],templates:i=[],enableScheduling:c=!1,exportHistory:l=[],onExportStart:r,onExportComplete:u,onExportError:o,onSaveTemplate:p,onDeleteTemplate:z,onSchedule:E,customExportHandler:C,title:f="Data Export",description:H,className:T="",style:G},P)=>{const[$,O]=n.useState(a[0]),[M,V]=n.useState(s.getFields()),[x,k]=n.useState({includeHeaders:!0,dateFormat:"YYYY-MM-DD",encoding:"utf-8"}),[j,U]=n.useState(!1),[m,F]=n.useState(0),[L,A]=n.useState("export"),w=n.useCallback(async()=>{const g={id:Date.now().toString(),name:`Export ${new Date().toISOString()}`,format:$,status:"processing",progress:0,createdAt:new Date};U(!0),F(0),r==null||r(g);try{const S=await s.fetchData({fields:M,filters:void 0,sorting:void 0});F(50);let D;if(C)D=await C($,S,x);else switch($){case"csv":D=ve(S,M,x);break;case"json":D=fe(S,M,x);break;default:throw new Error(`Format ${$} requires a custom export handler`)}F(100);const J=typeof D=="string"?new Blob([D],{type:"text/plain"}):D,q=URL.createObjectURL(J),N=document.createElement("a");N.href=q,N.download=`export-${Date.now()}.${$}`,document.body.appendChild(N),N.click(),document.body.removeChild(N),URL.revokeObjectURL(q);const _={...g,status:"completed",progress:100,completedAt:new Date,rowCount:S.length,fileSize:J.size};u==null||u(_)}catch(S){const D={...g,status:"failed",error:S instanceof Error?S.message:"Unknown error"};o==null||o(D,S instanceof Error?S:new Error("Export failed"))}finally{U(!1),F(0)}},[$,M,x,s,C,r,u,o]),Y=n.useCallback(g=>{const S=i.find(D=>D.id===g);S&&(O(S.format),V(S.fields),S.options&&k(S.options))},[i]);return n.useImperativeHandle(P,()=>({exportNow:async g=>{O(g),await w()},getSelectedFields:()=>M,loadTemplate:Y})),e.jsxs("div",{className:`nice-export-center ${T}`,style:G,children:[e.jsx("div",{className:"nice-export-header",children:e.jsxs("div",{className:"nice-export-title-area",children:[e.jsx("h3",{className:"nice-export-title",children:f}),H&&e.jsx("p",{className:"nice-export-description",children:H})]})}),e.jsxs("div",{className:"nice-export-tabs",children:[e.jsx("button",{type:"button",className:`nice-export-tab ${L==="export"?"nice-export-tab--active":""}`,onClick:()=>A("export"),children:"Export"}),i.length>0&&e.jsxs("button",{type:"button",className:`nice-export-tab ${L==="templates"?"nice-export-tab--active":""}`,onClick:()=>A("templates"),children:["Templates (",i.length,")"]}),l.length>0&&e.jsx("button",{type:"button",className:`nice-export-tab ${L==="history"?"nice-export-tab--active":""}`,onClick:()=>A("history"),children:"History"})]}),e.jsxs("div",{className:"nice-export-content",children:[L==="export"&&e.jsxs(e.Fragment,{children:[e.jsx(ke,{formats:a,selected:$,onChange:O}),e.jsx(ye,{fields:M,onChange:V}),e.jsx(we,{format:$,options:x,onChange:k}),e.jsxs("div",{className:"nice-export-actions",children:[e.jsx("button",{type:"button",className:"nice-export-btn nice-export-btn--primary",onClick:w,disabled:j||M.filter(g=>g.include).length===0,children:j?`Exporting... ${m}%`:"Export Now"}),p&&e.jsx("button",{type:"button",className:"nice-export-btn nice-export-btn--secondary",onClick:()=>p({id:Date.now().toString(),name:`Template ${i.length+1}`,format:$,fields:M,options:x}),children:"Save as Template"})]})]}),L==="templates"&&e.jsx("div",{className:"nice-export-templates",children:i.map(g=>e.jsxs("div",{className:"nice-export-template",children:[e.jsxs("div",{className:"nice-export-template-info",children:[e.jsx("span",{className:"nice-export-template-name",children:g.name}),e.jsxs("span",{className:"nice-export-template-format",children:[le[g.format].icon," ",le[g.format].label]}),g.description&&e.jsx("span",{className:"nice-export-template-desc",children:g.description})]}),e.jsxs("div",{className:"nice-export-template-actions",children:[e.jsx("button",{type:"button",onClick:()=>{Y(g.id),A("export")},children:"Use"}),z&&e.jsx("button",{type:"button",onClick:()=>z(g.id),children:"Delete"})]})]},g.id))}),L==="history"&&e.jsx(Ce,{jobs:l,onDownload:g=>{g.downloadUrl&&window.open(g.downloadUrl,"_blank")}})]})]})});pe.displayName="NiceDataExportCenter";const se={create:{icon:e.jsx(t.NtdPlus,{size:16}),label:"Created",color:"var(--nice-color-success, #10b981)"},update:{icon:e.jsx(t.NtdEdit,{size:16}),label:"Updated",color:"var(--nice-color-primary, #3b82f6)"},delete:{icon:e.jsx(t.NtdClose,{size:16}),label:"Deleted",color:"var(--nice-color-error, #ef4444)"},view:{icon:e.jsx(t.NtdEye,{size:16}),label:"Viewed",color:"var(--nice-text-muted, #6b7280)"},export:{icon:e.jsx(t.NtdDownload,{size:16}),label:"Exported",color:"var(--nice-color-accent, #8b5cf6)"},import:{icon:e.jsx(t.NtdUpload,{size:16}),label:"Imported",color:"var(--nice-color-accent, #8b5cf6)"},approve:{icon:e.jsx(t.NtdCheck,{size:16}),label:"Approved",color:"var(--nice-color-success, #10b981)"},reject:{icon:e.jsx(t.NtdError,{size:16}),label:"Rejected",color:"var(--nice-color-error, #ef4444)"},login:{icon:e.jsx(t.NtdLogIn,{size:16}),label:"Login",color:"var(--nice-color-success, #10b981)"},logout:{icon:e.jsx(t.NtdLogOut,{size:16}),label:"Logout",color:"var(--nice-text-muted, #6b7280)"},permission_change:{icon:e.jsx(t.NtdKey,{size:16}),label:"Permissions",color:"var(--nice-color-warning, #f59e0b)"},config_change:{icon:e.jsx(t.NtdSettings,{size:16}),label:"Config",color:"var(--nice-color-warning, #f59e0b)"},custom:{icon:e.jsx(t.NtdCircle,{size:16}),label:"Action",color:"var(--nice-text-muted, #6b7280)"}},Se=({filter:s,onChange:a,availableFilters:i})=>{var l,r;const c=(u,o)=>{a({...s,[u]:o})};return e.jsxs("div",{className:"nice-audit-filters",children:[e.jsxs("div",{className:"nice-audit-filter-group",children:[e.jsx("label",{children:"Date Range"}),e.jsxs("div",{className:"nice-audit-date-range",children:[e.jsx("input",{type:"date",value:((l=s.startDate)==null?void 0:l.toISOString().split("T")[0])||"",onChange:u=>c("startDate",u.target.value?new Date(u.target.value):void 0)}),e.jsx("span",{children:"to"}),e.jsx("input",{type:"date",value:((r=s.endDate)==null?void 0:r.toISOString().split("T")[0])||"",onChange:u=>c("endDate",u.target.value?new Date(u.target.value):void 0)})]})]}),e.jsxs("div",{className:"nice-audit-filter-group",children:[e.jsx("label",{children:"Actions"}),e.jsx("div",{className:"nice-audit-action-chips",children:Object.keys(se).slice(0,8).map(u=>{var z;const o=se[u],p=(z=s.actions)==null?void 0:z.includes(u);return e.jsxs("button",{type:"button",className:`nice-audit-chip ${p?"nice-audit-chip--selected":""}`,style:{"--chip-color":o.color},onClick:()=>{const E=s.actions||[];c("actions",p?E.filter(C=>C!==u):[...E,u])},children:[e.jsx("span",{className:"nice-audit-chip-icon",children:o.icon}),o.label]},u)})})]}),e.jsxs("div",{className:"nice-audit-filter-group",children:[e.jsx("label",{children:"Search"}),e.jsx("input",{type:"text",className:"nice-audit-search",placeholder:"Search entries...",value:s.searchQuery||"",onChange:u=>c("searchQuery",u.target.value||void 0)})]})]})},De=({changes:s})=>{if(!s.length)return null;const a=(i,c)=>c||(i==null?"(empty)":typeof i=="object"?JSON.stringify(i,null,2):String(i));return e.jsx("div",{className:"nice-audit-diff",children:s.map((i,c)=>e.jsxs("div",{className:"nice-audit-diff-row",children:[e.jsx("span",{className:"nice-audit-diff-field",children:i.field}),e.jsxs("div",{className:"nice-audit-diff-values",children:[e.jsx("span",{className:"nice-audit-diff-old",children:a(i.oldValue,i.displayOldValue)}),e.jsx("span",{className:"nice-audit-diff-arrow",children:e.jsx(t.NtdArrowRight,{size:14})}),e.jsx("span",{className:"nice-audit-diff-new",children:a(i.newValue,i.displayNewValue)})]})]},c))})},ze=({entry:s,showDiff:a,renderActionIcon:i,renderUser:c,onClick:l})=>{const[r,u]=n.useState(!1),o=se[s.action]||se.custom;return e.jsxs("div",{className:`nice-audit-timeline-entry nice-audit-timeline-entry--${s.severity||"info"}`,onClick:l,role:l?"button":void 0,tabIndex:l?0:void 0,children:[e.jsx("div",{className:"nice-audit-timeline-marker",style:{"--marker-color":o.color},children:i?i(s.action):o.icon}),e.jsxs("div",{className:"nice-audit-timeline-content",children:[e.jsxs("div",{className:"nice-audit-timeline-header",children:[e.jsx("span",{className:"nice-audit-timeline-action",children:s.actionLabel||o.label}),e.jsxs("span",{className:"nice-audit-timeline-entity",children:[s.entityType," ",s.entityName&&`"${s.entityName}"`]}),e.jsx("span",{className:"nice-audit-timeline-time",children:new Date(s.timestamp).toLocaleString()})]}),e.jsx("div",{className:"nice-audit-timeline-user",children:c?c(s):e.jsxs(e.Fragment,{children:[s.userAvatar&&e.jsx("img",{src:s.userAvatar,alt:"",className:"nice-audit-avatar"}),e.jsx("span",{className:"nice-audit-username",children:s.userName}),s.userRole&&e.jsx("span",{className:"nice-audit-role",children:s.userRole})]})}),s.notes&&e.jsx("div",{className:"nice-audit-timeline-notes",children:s.notes}),a&&s.changes&&s.changes.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"nice-audit-expand-btn",onClick:p=>{p.stopPropagation(),u(!r)},children:r?e.jsxs(e.Fragment,{children:[e.jsx(t.NtdChevronDown,{size:14})," Hide changes"]}):e.jsxs(e.Fragment,{children:[e.jsx(t.NtdChevronRight,{size:14})," Show ",s.changes.length," changes"]})}),r&&e.jsx(De,{changes:s.changes})]}),s.ipAddress&&e.jsxs("div",{className:"nice-audit-timeline-meta",children:[e.jsxs("span",{children:["IP: ",s.ipAddress]}),s.location&&e.jsxs("span",{children:["• ",s.location]})]})]})]})},Te=({entries:s,showDiff:a,onEntryClick:i})=>e.jsxs("table",{className:"nice-audit-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Timestamp"}),e.jsx("th",{children:"Action"}),e.jsx("th",{children:"User"}),e.jsx("th",{children:"Entity"}),e.jsx("th",{children:"Changes"}),e.jsx("th",{children:"IP Address"})]})}),e.jsx("tbody",{children:s.map(c=>{const l=se[c.action]||se.custom;return e.jsxs("tr",{className:`nice-audit-row nice-audit-row--${c.severity||"info"}`,onClick:()=>i==null?void 0:i(c),role:i?"button":void 0,children:[e.jsx("td",{className:"nice-audit-cell-time",children:new Date(c.timestamp).toLocaleString()}),e.jsx("td",{children:e.jsxs("span",{className:"nice-audit-action-badge",style:{"--badge-color":l.color},children:[l.icon," ",c.actionLabel||l.label]})}),e.jsxs("td",{className:"nice-audit-cell-user",children:[c.userAvatar&&e.jsx("img",{src:c.userAvatar,alt:"",className:"nice-audit-avatar-sm"}),c.userName]}),e.jsxs("td",{children:[c.entityType,c.entityName&&`: ${c.entityName}`]}),e.jsx("td",{children:c.changes&&c.changes.length>0?e.jsxs("span",{className:"nice-audit-changes-count",children:[c.changes.length," field(s)"]}):"-"}),e.jsx("td",{className:"nice-audit-cell-ip",children:c.ipAddress||"-"})]},c.id)})})]}),me=n.forwardRef(({dataSource:s,initialFilter:a={},pageSize:i=50,viewMode:c="timeline",enableExport:l=!0,showDiffs:r=!0,renderActionIcon:u,renderUser:o,onEntryClick:p,onExport:z,title:E="Audit Trail",className:C="",style:f},H)=>{const[T,G]=n.useState([]),[P,$]=n.useState(0),[O,M]=n.useState(a),[V,x]=n.useState(1),[k,j]=n.useState(!1),[U,m]=n.useState(c),[F,L]=n.useState(!1),A=n.useCallback(async()=>{j(!0);try{const g=await s.fetchEntries(O,{page:V,pageSize:i});G(g.entries),$(g.totalCount)}finally{j(!1)}},[s,O,V,i]);n.useEffect(()=>{A()},[A]);const w=n.useCallback(g=>{if(z)z(T,g);else{let S,D;if(g==="json")S=JSON.stringify(T,null,2),D="application/json";else{const _=["Timestamp","Action","User","Entity Type","Entity","IP","Changes"],K=T.map(I=>{var Z;return[new Date(I.timestamp).toISOString(),I.action,I.userName,I.entityType,I.entityName||I.entityId,I.ipAddress||"",((Z=I.changes)==null?void 0:Z.length)||0]});S=[_.join(","),...K.map(I=>I.join(","))].join(`
3
- `),D="text/csv"}const J=new Blob([S],{type:D}),q=URL.createObjectURL(J),N=document.createElement("a");N.href=q,N.download=`audit-trail-${Date.now()}.${g}`,N.click(),URL.revokeObjectURL(q)}},[T,z]);n.useImperativeHandle(H,()=>({refresh:A,setFilter:g=>{M(g),x(1)},getEntries:()=>T}));const Y=Math.ceil(P/i);return e.jsxs("div",{className:`nice-audit-trail ${C}`,style:f,children:[e.jsxs("div",{className:"nice-audit-header",children:[e.jsx("h3",{className:"nice-audit-title",children:E}),e.jsxs("div",{className:"nice-audit-header-actions",children:[e.jsx("button",{type:"button",className:`nice-audit-view-btn ${U==="timeline"?"nice-audit-view-btn--active":""}`,onClick:()=>m("timeline"),title:"Timeline view",children:e.jsx(t.NtdList,{size:16})}),e.jsx("button",{type:"button",className:`nice-audit-view-btn ${U==="table"?"nice-audit-view-btn--active":""}`,onClick:()=>m("table"),title:"Table view",children:e.jsx(t.NtdGrid,{size:16})}),e.jsxs("button",{type:"button",className:`nice-audit-filter-btn ${F?"nice-audit-filter-btn--active":""}`,onClick:()=>L(!F),children:[e.jsx(t.NtdSearch,{size:16})," Filter"]}),l&&e.jsxs("div",{className:"nice-audit-export-dropdown",children:[e.jsxs("button",{type:"button",className:"nice-audit-export-btn",children:[e.jsx(t.NtdDownload,{size:16})," Export"]}),e.jsxs("div",{className:"nice-audit-export-menu",children:[e.jsx("button",{type:"button",onClick:()=>w("csv"),children:"Export as CSV"}),e.jsx("button",{type:"button",onClick:()=>w("json"),children:"Export as JSON"})]})]})]})]}),F&&e.jsx(Se,{filter:O,onChange:M}),e.jsxs("div",{className:"nice-audit-stats",children:[e.jsxs("span",{children:["Showing ",T.length," of ",P," entries"]}),O.startDate&&O.endDate&&e.jsxs("span",{className:"nice-audit-date-indicator",children:[O.startDate.toLocaleDateString()," - ",O.endDate.toLocaleDateString()]})]}),e.jsxs("div",{className:`nice-audit-content ${k?"nice-audit-content--loading":""}`,children:[k&&e.jsx("div",{className:"nice-audit-loader",children:e.jsx("div",{className:"nice-audit-spinner"})}),U==="timeline"?e.jsx("div",{className:"nice-audit-timeline",children:T.map(g=>e.jsx(ze,{entry:g,showDiff:r,renderActionIcon:u,renderUser:o,onClick:p?()=>p(g):void 0},g.id))}):e.jsx(Te,{entries:T,showDiff:r,onEntryClick:p}),T.length===0&&!k&&e.jsx("div",{className:"nice-audit-empty",children:"No audit entries found matching the current filters."})]}),Y>1&&e.jsxs("div",{className:"nice-audit-pagination",children:[e.jsx("button",{type:"button",disabled:V===1,onClick:()=>x(V-1),children:"Previous"}),e.jsxs("span",{children:["Page ",V," of ",Y]}),e.jsx("button",{type:"button",disabled:V===Y,onClick:()=>x(V+1),children:"Next"})]})]})});me.displayName="NiceAuditTrail";const _e=[{target:".nice-contract-editor",titleKey:"tutorial.contractEditor.intro.title",title:"Contract editor",contentKey:"tutorial.contractEditor.intro.content",content:"Assemble the contract from the clause library, fill template variables, track versions and approvals, then save or export to PDF/DOCX/HTML.",placement:"auto"}],ee={general:{label:"General",color:"var(--nice-text-muted, #6b7280)",icon:e.jsx(t.NtdFileText,{size:16})},liability:{label:"Liability",color:"var(--nice-color-error, #ef4444)",icon:e.jsx(t.NtdWarning,{size:16})},payment:{label:"Payment",color:"var(--nice-color-success, #10b981)",icon:e.jsx(t.NtdDollar,{size:16})},termination:{label:"Termination",color:"var(--nice-color-warning, #f59e0b)",icon:e.jsx(t.NtdOctagon,{size:16})},confidentiality:{label:"Confidentiality",color:"var(--nice-color-accent, #8b5cf6)",icon:e.jsx(t.NtdLock,{size:16})},compliance:{label:"Compliance",color:"var(--nice-color-primary, #3b82f6)",icon:e.jsx(t.NtdCheck,{size:16})},custom:{label:"Custom",color:"var(--nice-text-muted, #64748b)",icon:e.jsx(t.NtdEdit,{size:16})}},Le={draft:{label:"Draft",color:"var(--nice-text-muted, #6b7280)"},pending_review:{label:"Pending Review",color:"var(--nice-color-warning, #f59e0b)"},approved:{label:"Approved",color:"var(--nice-color-success, #10b981)"},rejected:{label:"Rejected",color:"var(--nice-color-error, #ef4444)"},signed:{label:"Signed",color:"var(--nice-color-accent, #8b5cf6)"}},Ae=({clauses:s,onInsert:a})=>{const[i,c]=n.useState(""),[l,r]=n.useState("all"),u=s.filter(o=>{const p=i===""||o.name.toLowerCase().includes(i.toLowerCase())||o.content.toLowerCase().includes(i.toLowerCase()),z=l==="all"||o.category===l;return p&&z});return e.jsxs("div",{className:"nice-contract-library",children:[e.jsxs("div",{className:"nice-contract-library-header",children:[e.jsx("h4",{children:"Clause Library"}),e.jsx("input",{type:"text",placeholder:"Search clauses...",value:i,onChange:o=>c(o.target.value),className:"nice-contract-library-search"})]}),e.jsxs("div",{className:"nice-contract-library-categories",children:[e.jsx("button",{type:"button",className:`nice-contract-category-btn ${l==="all"?"nice-contract-category-btn--active":""}`,onClick:()=>r("all"),children:"All"}),Object.keys(ee).map(o=>e.jsxs("button",{type:"button",className:`nice-contract-category-btn ${l===o?"nice-contract-category-btn--active":""}`,onClick:()=>r(o),style:{"--cat-color":ee[o].color},children:[ee[o].icon," ",ee[o].label]},o))]}),e.jsxs("div",{className:"nice-contract-library-list",children:[u.map(o=>e.jsxs("div",{className:"nice-contract-library-item",children:[e.jsxs("div",{className:"nice-contract-library-item-header",children:[e.jsx("span",{className:"nice-contract-library-item-name",children:o.name}),e.jsx("span",{className:"nice-contract-library-item-cat",style:{"--cat-color":ee[o.category].color},children:ee[o.category].icon})]}),o.description&&e.jsx("p",{className:"nice-contract-library-item-desc",children:o.description}),e.jsxs("button",{type:"button",className:"nice-contract-library-insert",onClick:()=>a(o),children:[e.jsx(t.NtdPlus,{size:14})," Insert"]})]},o.id)),u.length===0&&e.jsx("div",{className:"nice-contract-library-empty",children:"No matching clauses"})]})]})},Ie=({variables:s,definitions:a,onChange:i})=>e.jsxs("div",{className:"nice-contract-variables",children:[e.jsx("h4",{children:"Variables"}),e.jsx("div",{className:"nice-contract-variables-list",children:a.map(c=>e.jsxs("div",{className:"nice-contract-variable",children:[e.jsxs("label",{children:[c.name,c.required&&e.jsx("span",{className:"nice-contract-required",children:"*"})]}),c.type==="select"&&c.options?e.jsxs("select",{value:s[c.name]||c.defaultValue||"",onChange:l=>i(c.name,l.target.value),children:[e.jsx("option",{value:"",children:"Select..."}),c.options.map(l=>e.jsx("option",{value:l,children:l},l))]}):c.type==="date"?e.jsx("input",{type:"date",value:s[c.name]||c.defaultValue||"",onChange:l=>i(c.name,l.target.value)}):e.jsx("input",{type:c.type==="number"||c.type==="currency"?"number":"text",value:s[c.name]||c.defaultValue||"",placeholder:c.placeholder,onChange:l=>i(c.name,l.target.value)})]},c.name))})]}),Fe=({section:s,variables:a,readOnly:i,onToggle:c,onRemoveClause:l,onMoveClause:r})=>{const u=o=>o.replace(/\{\{(\w+)\}\}/g,(p,z)=>a[z]||`[${z}]`);return e.jsxs("div",{className:`nice-contract-section ${s.collapsed?"nice-contract-section--collapsed":""}`,children:[e.jsxs("div",{className:"nice-contract-section-header",onClick:c,children:[e.jsx("span",{className:"nice-contract-section-toggle",children:s.collapsed?e.jsx(t.NtdChevronRight,{size:14}):e.jsx(t.NtdChevronDown,{size:14})}),e.jsx("h3",{children:s.title}),e.jsxs("span",{className:"nice-contract-section-count",children:[s.clauses.length," clause(s)"]})]}),!s.collapsed&&e.jsxs("div",{className:"nice-contract-section-content",children:[s.clauses.map((o,p)=>e.jsxs("div",{className:"nice-contract-clause",children:[e.jsxs("div",{className:"nice-contract-clause-header",children:[e.jsx("span",{className:"nice-contract-clause-cat",style:{"--cat-color":ee[o.category].color},children:ee[o.category].icon}),e.jsx("span",{className:"nice-contract-clause-name",children:o.name}),o.isRequired&&e.jsx("span",{className:"nice-contract-clause-required",children:"Required"}),!i&&e.jsxs("div",{className:"nice-contract-clause-actions",children:[e.jsx("button",{type:"button",onClick:()=>r(o.id,"up"),disabled:p===0,children:e.jsx(t.NtdArrowUp,{size:14})}),e.jsx("button",{type:"button",onClick:()=>r(o.id,"down"),disabled:p===s.clauses.length-1,children:e.jsx(t.NtdArrowDown,{size:14})}),e.jsx("button",{type:"button",onClick:()=>l(o.id),children:e.jsx(t.NtdClose,{size:14})})]})]}),e.jsx("div",{className:"nice-contract-clause-content",dangerouslySetInnerHTML:{__html:u(o.content)}})]},o.id)),s.clauses.length===0&&e.jsx("div",{className:"nice-contract-section-empty",children:"No clauses in this section. Drag clauses here or use the library."})]})]})},Re=({workflow:s,onAction:a})=>{const[i,c]=n.useState(null),[l,r]=n.useState("");return e.jsxs("div",{className:"nice-contract-workflow",children:[e.jsx("h4",{children:"Approval Workflow"}),e.jsx("div",{className:"nice-contract-workflow-steps",children:s.steps.map((u,o)=>e.jsxs("div",{className:`nice-contract-workflow-step nice-contract-workflow-step--${u.status}`,children:[e.jsxs("div",{className:"nice-contract-workflow-step-header",children:[e.jsx("span",{className:"nice-contract-workflow-step-num",children:o+1}),e.jsx("span",{className:"nice-contract-workflow-step-name",children:u.name}),e.jsx("span",{className:`nice-contract-workflow-step-status nice-contract-workflow-step-status--${u.status}`,children:u.status})]}),e.jsx("div",{className:"nice-contract-workflow-approvers",children:u.approvers.map(p=>e.jsxs("div",{className:"nice-contract-approver",children:[p.avatar&&e.jsx("img",{src:p.avatar,alt:"",className:"nice-contract-approver-avatar"}),e.jsx("span",{children:p.name}),e.jsx("span",{className:"nice-contract-approver-role",children:p.role})]},p.id))}),u.status==="pending"&&s.currentStep===o&&e.jsx("div",{className:"nice-contract-workflow-actions",children:i===u.id?e.jsxs(e.Fragment,{children:[e.jsx("textarea",{placeholder:"Comments (optional)",value:l,onChange:p=>r(p.target.value)}),e.jsxs("div",{className:"nice-contract-workflow-btns",children:[e.jsxs("button",{type:"button",className:"nice-contract-btn nice-contract-btn--approve",onClick:()=>{a(u.id,"approve",l),c(null),r("")},children:[e.jsx(t.NtdCheck,{size:14})," Approve"]}),e.jsxs("button",{type:"button",className:"nice-contract-btn nice-contract-btn--reject",onClick:()=>{a(u.id,"reject",l),c(null),r("")},children:[e.jsx(t.NtdError,{size:14})," Reject"]}),e.jsx("button",{type:"button",onClick:()=>c(null),children:"Cancel"})]})]}):e.jsx("button",{type:"button",className:"nice-contract-btn",onClick:()=>c(u.id),children:"Review"})})]},u.id))})]})},xe=n.forwardRef(({document:s,clauseLibrary:a=[],readOnly:i=!1,showClauseLibrary:c=!0,showVersionHistory:l=!1,showComments:r=!1,showWorkflow:u=!0,currentUser:o,onChange:p,onAddClause:z,onRemoveClause:E,onVariableChange:C,onAddComment:f,onApprovalAction:H,onRestoreVersion:T,onSave:G,onExport:P,className:$="",style:O,tutorial:M},V)=>{var Z;const[x,k]=n.useState(s),[j,U]=n.useState(c?"library":null),[m,F]=n.useState(((Z=x.sections[0])==null?void 0:Z.id)||null),A=x.sections.flatMap(b=>b.clauses.flatMap(y=>y.variables||[])).filter((b,y,R)=>R.findIndex(B=>B.name===b.name)===y),w=n.useCallback(b=>{const y={...x,...b,updatedAt:new Date};k(y),p==null||p(y)},[x,p]),Y=n.useCallback((b,y)=>{const R=x.sections.map(B=>B.id===y?{...B,clauses:[...B.clauses,{...b,id:`${b.id}-${Date.now()}`}]}:B);w({sections:R}),z==null||z(b,y)},[x,w,z]),g=n.useCallback((b,y)=>{const R=x.sections.map(B=>B.id===y?{...B,clauses:B.clauses.filter(W=>W.id!==b)}:B);w({sections:R}),E==null||E(b,y)},[x,w,E]),S=n.useCallback((b,y,R)=>{const B=x.sections.map(W=>{if(W.id!==b)return W;const d=W.clauses.findIndex(X=>X.id===y);if(d===-1)return W;const h=R==="up"?d-1:d+1;if(h<0||h>=W.clauses.length)return W;const v=[...W.clauses];return[v[d],v[h]]=[v[h],v[d]],{...W,clauses:v}});w({sections:B})},[x,w]),D=n.useCallback(b=>{const y=x.sections.map(R=>R.id===b?{...R,collapsed:!R.collapsed}:R);w({sections:y})},[x,w]),J=n.useCallback((b,y)=>{w({variables:{...x.variables,[b]:y}}),C==null||C(b,y)},[x,w,C]),q=n.useCallback(()=>{const b=[];return A.forEach(y=>{y.required&&!x.variables[y.name]&&b.push(`Missing required variable: ${y.name}`)}),x.sections.forEach(y=>{y.clauses.forEach(R=>{R.isRequired&&!R.content&&b.push(`Required clause "${R.name}" is empty`)})}),{valid:b.length===0,errors:b}},[x,A]);n.useImperativeHandle(V,()=>({getDocument:()=>x,insertClause:Y,setVariable:J,exportDocument:b=>P==null?void 0:P(b),validate:q}));const N=Le[x.status],_=e.jsxs("div",{className:"nice-contract-header",children:[e.jsxs("div",{className:"nice-contract-header-info",children:[e.jsx("h2",{className:"nice-contract-title",children:x.title}),e.jsx("span",{className:"nice-contract-status",style:{"--status-color":N.color},children:N.label})]}),e.jsxs("div",{className:"nice-contract-header-actions",children:[G&&!i&&e.jsx("button",{type:"button",className:"nice-contract-btn nice-contract-btn--primary",onClick:()=>G(x),children:"Save"}),P&&e.jsxs("div",{className:"nice-contract-export-dropdown",children:[e.jsxs("button",{type:"button",className:"nice-contract-btn",children:["Export ",e.jsx(t.NtdChevronDown,{size:14})]}),e.jsxs("div",{className:"nice-contract-export-menu",children:[e.jsx("button",{type:"button",onClick:()=>P("pdf"),children:"PDF"}),e.jsx("button",{type:"button",onClick:()=>P("docx"),children:"Word (.docx)"}),e.jsx("button",{type:"button",onClick:()=>P("html"),children:"HTML"})]})]})]})]}),K=e.jsxs("div",{className:"nice-contract-toolbar",children:[c&&e.jsxs("button",{type:"button",className:`nice-contract-toolbar-btn ${j==="library"?"nice-contract-toolbar-btn--active":""}`,onClick:()=>U(j==="library"?null:"library"),children:[e.jsx(t.NtdBook,{size:16})," Library"]}),e.jsxs("button",{type:"button",className:`nice-contract-toolbar-btn ${j==="variables"?"nice-contract-toolbar-btn--active":""}`,onClick:()=>U(j==="variables"?null:"variables"),children:[e.jsx(t.NtdBrackets,{size:16})," Variables"]}),u&&x.workflow&&e.jsxs("button",{type:"button",className:`nice-contract-toolbar-btn ${j==="workflow"?"nice-contract-toolbar-btn--active":""}`,onClick:()=>U(j==="workflow"?null:"workflow"),children:[e.jsx(t.NtdCheck,{size:16})," Workflow"]}),l&&e.jsxs("button",{type:"button",className:`nice-contract-toolbar-btn ${j==="history"?"nice-contract-toolbar-btn--active":""}`,onClick:()=>U(j==="history"?null:"history"),children:[e.jsx(t.NtdClock,{size:16})," History"]})]}),I=j?e.jsxs("div",{className:"nice-contract-panel",children:[j==="library"&&e.jsx(Ae,{clauses:a,onInsert:b=>m&&Y(b,m)}),j==="variables"&&e.jsx(Ie,{variables:x.variables,definitions:A,onChange:J}),j==="workflow"&&x.workflow&&e.jsx(Re,{workflow:x.workflow,onAction:(b,y,R)=>H==null?void 0:H(b,y,R)})]}):void 0;return e.jsx(ie.NiceAppShell,{flush:!0,className:`nice-contract-editor ${$}`,style:O,menubar:_,toolbar:K,sidebar:I,children:e.jsxs("div",{className:"nice-contract-document",children:[e.jsx("span",{style:{position:"absolute",top:6,right:6,zIndex:30},children:e.jsx(ie.NiceTutorialButton,{steps:ie.resolveTutorial(M,_e)})}),x.sections.map(b=>e.jsx(Fe,{section:b,variables:x.variables,readOnly:i,onToggle:()=>D(b.id),onRemoveClause:y=>g(y,b.id),onMoveClause:(y,R)=>S(b.id,y,R)},b.id))]})})});xe.displayName="NiceContractEditor";const Pe=[{id:"necessary",label:"Necessary",description:"Essential cookies for site functionality. Cannot be disabled.",required:!0,enabled:!0,cookies:["session_id","csrf_token","consent"]},{id:"analytics",label:"Analytics",description:"Help us understand how visitors interact with our website.",enabled:!1,cookies:["_ga","_gid","_gat"],partners:["Google Analytics","Hotjar"]},{id:"marketing",label:"Marketing",description:"Used to deliver personalized advertisements.",enabled:!1,cookies:["_fbp","_gcl_au","ads_id"],partners:["Facebook","Google Ads","LinkedIn"]},{id:"preferences",label:"Preferences",description:"Remember your settings and preferences.",enabled:!1,cookies:["theme","language","timezone"]},{id:"social",label:"Social Media",description:"Enable social sharing and embedded content.",enabled:!1,cookies:["social_session"],partners:["Twitter","YouTube","Instagram"]}],Ee={title:"Cookie Preferences",description:"We use cookies to enhance your experience. Choose which types of cookies you allow.",acceptAll:"Accept All",rejectAll:"Reject All",customize:"Customize",savePreferences:"Save Preferences",necessary:"Necessary",analytics:"Analytics",marketing:"Marketing",preferences:"Preferences",social:"Social Media",dataRights:"Your Data Rights",exportData:"Export My Data",deleteData:"Delete My Data",pending:"Pending",processing:"Processing",completed:"Completed",close:"Close"},$e=({option:s,enabled:a,onChange:i})=>e.jsxs("div",{className:"nice-gdpr-option",children:[e.jsxs("div",{className:"nice-gdpr-option-header",children:[e.jsxs("label",{className:"nice-gdpr-option-toggle",children:[e.jsx("input",{type:"checkbox",checked:a,onChange:c=>i(c.target.checked),disabled:s.required}),e.jsx("span",{className:"nice-gdpr-toggle-slider"})]}),e.jsxs("div",{className:"nice-gdpr-option-info",children:[e.jsxs("span",{className:"nice-gdpr-option-label",children:[s.label,s.required&&e.jsx("span",{className:"nice-gdpr-required",children:"Required"})]}),e.jsx("span",{className:"nice-gdpr-option-desc",children:s.description})]})]}),s.partners&&s.partners.length>0&&e.jsxs("div",{className:"nice-gdpr-option-partners",children:[e.jsx("span",{children:"Partners: "}),s.partners.join(", ")]})]}),Oe=({requests:s,policies:a,onRequest:i,onDownload:c,labels:l})=>e.jsxs("div",{className:"nice-gdpr-rights",children:[e.jsx("h4",{children:l.dataRights}),e.jsxs("div",{className:"nice-gdpr-rights-actions",children:[e.jsxs("button",{type:"button",className:"nice-gdpr-btn nice-gdpr-btn--secondary",onClick:()=>i("export"),children:[e.jsx(t.NtdDownload,{size:16})," ",l.exportData]}),e.jsxs("button",{type:"button",className:"nice-gdpr-btn nice-gdpr-btn--danger",onClick:()=>i("delete"),children:[e.jsx(t.NtdTrash,{size:16})," ",l.deleteData]})]}),s.length>0&&e.jsxs("div",{className:"nice-gdpr-requests",children:[e.jsx("h5",{children:"Previous Requests"}),s.map(r=>e.jsxs("div",{className:`nice-gdpr-request nice-gdpr-request--${r.status}`,children:[e.jsx("span",{className:"nice-gdpr-request-type",children:r.type}),e.jsx("span",{className:"nice-gdpr-request-date",children:new Date(r.requestedAt).toLocaleDateString()}),e.jsx("span",{className:"nice-gdpr-request-status",children:r.status}),r.status==="completed"&&r.downloadUrl&&e.jsx("button",{type:"button",className:"nice-gdpr-download-btn",onClick:()=>c(r.id),children:"Download"})]},r.id))]}),a.length>0&&e.jsxs("div",{className:"nice-gdpr-policies",children:[e.jsx("h5",{children:"Data Retention"}),e.jsxs("table",{className:"nice-gdpr-policies-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Category"}),e.jsx("th",{children:"Retention"}),e.jsx("th",{children:"Legal Basis"})]})}),e.jsx("tbody",{children:a.map((r,u)=>e.jsxs("tr",{children:[e.jsx("td",{children:r.category}),e.jsxs("td",{children:[r.retentionDays," days"]}),e.jsx("td",{children:r.legalBasis})]},u))})]})]})]}),je=n.forwardRef(({appName:s,companyName:a,options:i=Pe,currentConsent:c=null,retentionPolicies:l=[],dataRequests:r=[],privacyPolicy:u=[],storageKey:o="nice_gdpr_consent",consentVersion:p="1.0",variant:z="banner",position:E="bottom",onConsentChange:C,onDataRequest:f,onDownloadExport:H,privacyPolicyUrl:T,cookiePolicyUrl:G,termsUrl:P,labels:$,className:O="",style:M},V)=>{const x={...Ee,...$},[k,j]=n.useState(!1),[U,m]=n.useState(!1),[F,L]=n.useState(!1),[A,w]=n.useState(()=>{const N={};return i.forEach(_=>{N[_.id]=(c==null?void 0:c.categories[_.id])??_.enabled}),N});n.useEffect(()=>{(!c||c.version!==p)&&j(!0)},[c,p]);const Y=n.useCallback((N,_)=>{const K=_||A;K.necessary=!0;const I={version:p,timestamp:new Date,categories:K,action:N};try{localStorage.setItem(o,JSON.stringify(I))}catch{}w(K),j(!1),m(!1),C==null||C(I)},[A,p,o,C]),g=n.useCallback(()=>{const N={};i.forEach(_=>{N[_.id]=!0}),Y("accept_all",N)},[i,Y]),S=n.useCallback(()=>{const N={};i.forEach(_=>{N[_.id]=_.required||!1}),Y("reject_all",N)},[i,Y]),D=n.useCallback(async N=>{f&&await f(N)},[f]);if(n.useImperativeHandle(V,()=>({showBanner:()=>j(!0),hideBanner:()=>j(!1),getConsent:()=>{try{const N=localStorage.getItem(o);return N?JSON.parse(N):null}catch{return null}},revokeConsent:()=>{try{localStorage.removeItem(o)}catch{}j(!0)},openPreferences:()=>{j(!0),m(!0)}})),!k&&z!=="embedded")return null;const J=e.jsxs("div",{className:"nice-gdpr-content",children:[e.jsxs("div",{className:"nice-gdpr-header",children:[e.jsx("div",{className:"nice-gdpr-icon",children:e.jsx(t.NtdCookieConsent,{size:32})}),e.jsxs("div",{className:"nice-gdpr-header-text",children:[e.jsx("h3",{children:x.title}),e.jsx("p",{children:x.description.replace("{app}",s).replace("{company}",a)})]})]}),!U&&!F&&e.jsxs("div",{className:"nice-gdpr-quick-actions",children:[e.jsx("button",{type:"button",className:"nice-gdpr-btn nice-gdpr-btn--primary",onClick:g,children:x.acceptAll}),e.jsx("button",{type:"button",className:"nice-gdpr-btn nice-gdpr-btn--secondary",onClick:S,children:x.rejectAll}),e.jsx("button",{type:"button",className:"nice-gdpr-btn nice-gdpr-btn--link",onClick:()=>m(!0),children:x.customize})]}),U&&!F&&e.jsxs("div",{className:"nice-gdpr-preferences",children:[e.jsx("div",{className:"nice-gdpr-options",children:i.map(N=>e.jsx($e,{option:N,enabled:A[N.id],onChange:_=>w(K=>({...K,[N.id]:_}))},N.id))}),e.jsxs("div",{className:"nice-gdpr-pref-actions",children:[e.jsx("button",{type:"button",className:"nice-gdpr-btn nice-gdpr-btn--primary",onClick:()=>Y("custom"),children:x.savePreferences}),e.jsx("button",{type:"button",className:"nice-gdpr-btn nice-gdpr-btn--link",onClick:()=>L(!0),children:x.dataRights})]})]}),F&&e.jsxs(e.Fragment,{children:[e.jsx(Oe,{requests:r,policies:l,onRequest:D,onDownload:N=>H==null?void 0:H(N),labels:x}),e.jsxs("button",{type:"button",className:"nice-gdpr-btn nice-gdpr-btn--link",onClick:()=>L(!1),children:[e.jsx(t.NtdArrowLeft,{size:14})," Back to preferences"]})]}),e.jsxs("div",{className:"nice-gdpr-footer",children:[T&&e.jsx("a",{href:T,target:"_blank",rel:"noopener noreferrer",children:"Privacy Policy"}),G&&e.jsx("a",{href:G,target:"_blank",rel:"noopener noreferrer",children:"Cookie Policy"}),P&&e.jsx("a",{href:P,target:"_blank",rel:"noopener noreferrer",children:"Terms of Service"})]})]}),q=`nice-gdpr-consent nice-gdpr-consent--${z} nice-gdpr-consent--${E} ${O}`;return z==="modal"?e.jsx("div",{className:"nice-gdpr-overlay",children:e.jsx("div",{className:q,style:M,role:"dialog","aria-modal":"true",children:J})}):e.jsx("div",{className:q,style:M,children:J})});je.displayName="NiceGDPRConsent";const ge={document:e.jsx(t.NtdFileText,{size:16}),user:e.jsx(t.NtdUser,{size:16}),task:e.jsx(t.NtdCheck,{size:16}),project:e.jsx(t.NtdFolder,{size:16}),setting:e.jsx(t.NtdSettings,{size:16}),help:e.jsx(t.NtdHelp,{size:16}),action:e.jsx(t.NtdZap,{size:16}),custom:e.jsx(t.NtdCircle,{size:16})},Me=({value:s,onChange:a,onKeyDown:i,placeholder:c,isLoading:l,inputRef:r})=>e.jsxs("div",{className:"nice-search-input-container",children:[e.jsx("span",{className:"nice-search-icon",children:e.jsx(t.NtdSearch,{size:16})}),e.jsx("input",{ref:r,type:"text",className:"nice-search-input",placeholder:c,value:s,onChange:u=>a(u.target.value),onKeyDown:i,"aria-label":"Search"}),l&&e.jsx("span",{className:"nice-search-loader"}),s&&!l&&e.jsx("button",{type:"button",className:"nice-search-clear",onClick:()=>a(""),"aria-label":"Clear search",children:e.jsx(t.NtdClose,{size:16})})]}),Ue=({result:s,isSelected:a,onSelect:i,renderResult:c})=>c?e.jsx("div",{onClick:i,children:c(s,a)}):e.jsxs("div",{className:`nice-search-result ${a?"nice-search-result--selected":""}`,onClick:i,role:"option","aria-selected":a,children:[e.jsx("div",{className:"nice-search-result-icon",children:s.icon||(s.image?e.jsx("img",{src:s.image,alt:""}):ge[s.type])}),e.jsxs("div",{className:"nice-search-result-content",children:[e.jsx("span",{className:"nice-search-result-title",children:s.title}),s.subtitle&&e.jsx("span",{className:"nice-search-result-subtitle",children:s.subtitle}),s.description&&e.jsx("span",{className:"nice-search-result-desc",children:s.description})]}),e.jsxs("div",{className:"nice-search-result-meta",children:[e.jsx("span",{className:"nice-search-result-source",children:s.source}),e.jsx("span",{className:"nice-search-result-type",children:s.type})]}),s.actions&&s.actions.length>0&&e.jsx("div",{className:"nice-search-result-actions",children:s.actions.map(l=>e.jsx("button",{type:"button",className:"nice-search-action-btn",onClick:r=>{r.stopPropagation(),l.onClick()},title:l.label,children:l.icon||l.label},l.id))})]}),Ye=({categories:s,selected:a,onSelect:i})=>e.jsxs("div",{className:"nice-search-categories",children:[e.jsx("button",{type:"button",className:`nice-search-category ${a===null?"nice-search-category--active":""}`,onClick:()=>i(null),children:"All"}),s.map(c=>e.jsxs("button",{type:"button",className:`nice-search-category ${a===c.id?"nice-search-category--active":""}`,onClick:()=>i(c.id),children:[c.icon&&e.jsx("span",{className:"nice-search-category-icon",children:c.icon}),c.label,c.count!==void 0&&e.jsx("span",{className:"nice-search-category-count",children:c.count})]},c.id))]}),qe=({searches:s,onSelect:a,onClear:i,label:c,clearLabel:l})=>e.jsxs("div",{className:"nice-search-recent",children:[e.jsxs("div",{className:"nice-search-recent-header",children:[e.jsx("span",{children:c}),e.jsx("button",{type:"button",onClick:i,children:l})]}),e.jsx("div",{className:"nice-search-recent-list",children:s.map((r,u)=>e.jsxs("button",{type:"button",className:"nice-search-recent-item",onClick:()=>a(r.query),children:[e.jsx("span",{className:"nice-search-recent-icon",children:e.jsx(t.NtdClock,{size:14})}),e.jsx("span",{className:"nice-search-recent-query",children:r.query})]},u))})]}),Ve={placeholder:"Search...",recent:"Recent Searches",noResults:"No results found for",searching:"Searching...",clearRecent:"Clear",categories:"Categories",filters:"Filters"},Ne=n.forwardRef(({sources:s,placeholder:a,minQueryLength:i=2,debounceMs:c=300,showCategories:l=!0,filters:r=[],showRecent:u=!0,maxRecent:o=5,showShortcuts:p=!0,hotkey:z="k",onResultSelect:E,onSearch:C,onClose:f,renderResult:H,renderEmpty:T,defaultOpen:G=!1,open:P,variant:$="modal",labels:O,className:M="",style:V},x)=>{const k={...Ve,...O},j=n.useRef(null),U=n.useRef(void 0),[m,F]=n.useState(G),[L,A]=n.useState(""),[w,Y]=n.useState([]),[g,S]=n.useState(!1),[D,J]=n.useState(0),[q,N]=n.useState(null),[_,K]=n.useState([]),I=P!==void 0?P:m;n.useEffect(()=>{try{const h=localStorage.getItem("nice_recent_searches");h&&K(JSON.parse(h))}catch{}},[]);const Z=n.useCallback((h,v)=>{const Q=[{query:h,timestamp:new Date,resultCount:v},..._.filter(te=>te.query!==h)].slice(0,o);K(Q);try{localStorage.setItem("nice_recent_searches",JSON.stringify(Q))}catch{}},[_,o]),b=n.useCallback(async h=>{if(h.length<i){Y([]);return}S(!0);try{const v=s.map(async Q=>{try{return(await Q.search(h)).map(re=>({...re,source:Q.name,relevanceScore:re.relevanceScore*(Q.priority||1)}))}catch{return[]}}),X=(await Promise.all(v)).flat();X.sort((Q,te)=>te.relevanceScore-Q.relevanceScore),Y(X),J(0),C==null||C(h,X),X.length>0&&Z(h,X.length)}finally{S(!1)}},[s,i,C,Z]),y=n.useCallback(h=>{A(h),U.current&&clearTimeout(U.current),U.current=setTimeout(()=>{b(h)},c)},[b,c]),R=n.useCallback(h=>{switch(h.key){case"ArrowDown":h.preventDefault(),J(v=>Math.min(v+1,w.length-1));break;case"ArrowUp":h.preventDefault(),J(v=>Math.max(v-1,0));break;case"Enter":h.preventDefault(),w[D]&&(E==null||E(w[D]),F(!1),f==null||f());break;case"Escape":h.preventDefault(),F(!1),f==null||f();break}},[w,D,E,f]);n.useEffect(()=>{const h=v=>{(v.metaKey||v.ctrlKey)&&v.key===z&&(v.preventDefault(),F(!0),setTimeout(()=>{var X;return(X=j.current)==null?void 0:X.focus()},0))};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[z]),n.useEffect(()=>{I&&setTimeout(()=>{var h;return(h=j.current)==null?void 0:h.focus()},0)},[I]);const B=q?w.filter(h=>h.type===q):w,W=Array.from(new Set(w.map(h=>h.type))).map(h=>({id:h,label:h.charAt(0).toUpperCase()+h.slice(1),icon:ge[h],count:w.filter(v=>v.type===h).length}));if(n.useImperativeHandle(x,()=>({open:()=>F(!0),close:()=>{F(!1),f==null||f()},focus:()=>{var h;return(h=j.current)==null?void 0:h.focus()},clear:()=>{A(""),Y([])},search:async h=>{A(h),await b(h)}})),!I&&$!=="inline")return null;const d=e.jsxs("div",{className:"nice-search-content",children:[e.jsx(Me,{value:L,onChange:y,onKeyDown:R,placeholder:a||k.placeholder,isLoading:g,inputRef:j}),l&&W.length>1&&L.length>=i&&e.jsx(Ye,{categories:W,selected:q,onSelect:N}),e.jsxs("div",{className:"nice-search-results",role:"listbox",children:[g&&L.length>=i&&e.jsx("div",{className:"nice-search-loading",children:k.searching}),!g&&L.length>=i&&B.length===0&&e.jsx("div",{className:"nice-search-empty",children:T?T(L):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"nice-search-empty-icon",children:e.jsx(t.NtdSearch,{size:32})}),e.jsxs("span",{children:[k.noResults,' "',L,'"']})]})}),B.map((h,v)=>e.jsx(Ue,{result:h,isSelected:v===D,onSelect:()=>{E==null||E(h),F(!1),f==null||f()},renderResult:H},h.id))]}),u&&L.length<i&&_.length>0&&e.jsx(qe,{searches:_,onSelect:h=>{A(h),b(h)},onClear:()=>{K([]),localStorage.removeItem("nice_recent_searches")},label:k.recent,clearLabel:k.clearRecent}),p&&e.jsxs("div",{className:"nice-search-shortcuts",children:[e.jsxs("span",{children:[e.jsx("kbd",{children:"↑"}),e.jsx("kbd",{children:"↓"})," Navigate"]}),e.jsxs("span",{children:[e.jsx("kbd",{children:"↵"})," Select"]}),e.jsxs("span",{children:[e.jsx("kbd",{children:"Esc"})," Close"]})]})]});return $==="modal"?e.jsx("div",{className:"nice-search-overlay",onClick:()=>{F(!1),f==null||f()},children:e.jsx("div",{className:`nice-global-search nice-global-search--modal ${M}`,style:V,onClick:h=>h.stopPropagation(),role:"dialog","aria-modal":"true",children:d})}):e.jsx("div",{className:`nice-global-search nice-global-search--${$} ${M}`,style:V,children:d})});Ne.displayName="NiceGlobalSearch";const ce={title:"Access Log",filters:"Filters",search:"Search users, IPs...",export:"Export",refresh:"Refresh",details:"Details",stats:"Statistics",map:"Geographic Distribution",timeline:"Timeline",showMore:"Show More",noResults:"No access logs found",eventTypes:{login_success:"Login Success",login_failed:"Login Failed",logout:"Logout",password_change:"Password Change",password_reset:"Password Reset",mfa_enabled:"MFA Enabled",mfa_disabled:"MFA Disabled",mfa_challenged:"MFA Challenge",permission_change:"Permission Change",session_expired:"Session Expired",account_locked:"Account Locked",account_unlocked:"Account Unlocked",api_key_created:"API Key Created",api_key_revoked:"API Key Revoked",token_refresh:"Token Refresh",suspicious_activity:"Suspicious Activity"},riskLevels:{low:"Low",medium:"Medium",high:"High",critical:"Critical"},deviceTypes:{desktop:"Desktop",mobile:"Mobile",tablet:"Tablet",unknown:"Unknown"},columns:{timestamp:"Time",user:"User",event:"Event",ip:"IP Address",location:"Location",device:"Device",risk:"Risk",status:"Status"}},ne={login_success:e.jsx(t.NtdCheck,{size:16}),login_failed:e.jsx(t.NtdError,{size:16}),logout:e.jsx(t.NtdLogOut,{size:16}),password_change:e.jsx(t.NtdKey,{size:16}),password_reset:e.jsx(t.NtdRefresh,{size:16}),mfa_enabled:e.jsx(t.NtdShield,{size:16}),mfa_disabled:e.jsx(t.NtdWarning,{size:16}),mfa_challenged:e.jsx(t.NtdSmartphone,{size:16}),permission_change:e.jsx(t.NtdUser,{size:16}),session_expired:e.jsx(t.NtdClock,{size:16}),account_locked:e.jsx(t.NtdLock,{size:16}),account_unlocked:e.jsx(t.NtdUnlock,{size:16}),api_key_created:e.jsx(t.NtdKey,{size:16}),api_key_revoked:e.jsx(t.NtdError,{size:16}),token_refresh:e.jsx(t.NtdRefresh,{size:16}),suspicious_activity:e.jsx(t.NtdZap,{size:16})},ae={low:"var(--nice-color-success, #22c55e)",medium:"var(--nice-color-warning, #f59e0b)",high:"var(--nice-color-error, #ef4444)",critical:"var(--nice-color-accent-hover, #7c3aed)"},oe={desktop:e.jsx(t.NtdMonitor,{size:16}),mobile:e.jsx(t.NtdSmartphone,{size:16}),tablet:e.jsx(t.NtdSmartphone,{size:16}),unknown:e.jsx(t.NtdHelp,{size:16})},de=s=>(typeof s=="string"?new Date(s):s).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),he=s=>{if(!s)return"Unknown";const a=[];return s.city&&a.push(s.city),s.country&&a.push(s.country),a.length>0?a.join(", "):"Unknown"},Be=s=>{if(!s)return"Unknown";const a=[];return s.browser&&a.push(s.browser),s.os&&a.push(s.os),a.length>0?a.join(" / "):s.type},ue=s=>s>=80?ae.critical:s>=60?ae.high:s>=40?ae.medium:ae.low,He=(s,a)=>{var i,c,l,r,u;if(a.startDate){const o=typeof a.startDate=="string"?new Date(a.startDate):a.startDate;if((typeof s.timestamp=="string"?new Date(s.timestamp):s.timestamp)<o)return!1}if(a.endDate){const o=typeof a.endDate=="string"?new Date(a.endDate):a.endDate;if((typeof s.timestamp=="string"?new Date(s.timestamp):s.timestamp)>o)return!1}if((i=a.eventTypes)!=null&&i.length&&!a.eventTypes.includes(s.eventType)||(c=a.riskLevels)!=null&&c.length&&!a.riskLevels.includes(s.riskLevel)||a.userId&&s.userId!==a.userId||a.ipAddress&&!s.ipAddress.includes(a.ipAddress)||a.country&&((l=s.location)==null?void 0:l.country)!==a.country||a.successOnly&&!s.success||a.failedOnly&&s.success)return!1;if(a.searchQuery){const o=a.searchQuery.toLowerCase();if(![s.userName,s.userEmail,s.userId,s.ipAddress,(r=s.location)==null?void 0:r.city,(u=s.location)==null?void 0:u.country].filter(Boolean).join(" ").toLowerCase().includes(o))return!1}return!0},be=n.forwardRef(function(a,i){var B,W;const{entries:c,filter:l={},stats:r,realtime:u=!1,pollingInterval:o=3e4,showMap:p=!1,showStats:z=!0,showDetails:E=!0,pageSize:C=50,labels:f,loading:H=!1,onFilterChange:T,onExport:G,onEntrySelect:P,onBlockIP:$,onRefresh:O,className:M="",...V}=a,x=n.useRef(null);n.useId();const k=n.useMemo(()=>({...ce,...f,eventTypes:{...ce.eventTypes,...f==null?void 0:f.eventTypes},riskLevels:{...ce.riskLevels,...f==null?void 0:f.riskLevels},deviceTypes:{...ce.deviceTypes,...f==null?void 0:f.deviceTypes},columns:{...ce.columns,...f==null?void 0:f.columns}}),[f]),[j,U]=n.useState(l),[m,F]=n.useState(null),[L,A]=n.useState(C),[w,Y]=n.useState(!1),[g,S]=n.useState("table"),D=n.useMemo(()=>c.filter(d=>He(d,j)),[c,j]),J=n.useMemo(()=>D.slice(0,L),[D,L]),q=n.useMemo(()=>{if(r)return r;const d=new Set(c.map(v=>v.ipAddress)),h=new Set(c.map(v=>{var X;return(X=v.location)==null?void 0:X.country}).filter(Boolean));return{totalEvents:c.length,successfulLogins:c.filter(v=>v.eventType==="login_success").length,failedLogins:c.filter(v=>v.eventType==="login_failed").length,uniqueIPs:d.size,uniqueCountries:h.size,highRiskEvents:c.filter(v=>v.riskLevel==="high"||v.riskLevel==="critical").length,suspiciousActivities:c.filter(v=>v.eventType==="suspicious_activity").length}},[c,r]),N=n.useCallback(d=>{const h={...j,...d};U(h),A(C),T==null||T(h)},[j,T,C]),_=n.useCallback(()=>{U({}),A(C),T==null||T({})},[T,C]),K=n.useCallback(d=>{F(d),P==null||P(d)},[P]),I=n.useCallback(d=>{G==null||G(d)},[G]),Z=n.useCallback(()=>{O==null||O()},[O]),b=n.useCallback(()=>{A(d=>d+C)},[C]);n.useImperativeHandle(i,()=>({getFilter:()=>j,applyFilter:N,clearFilters:_,export:I,refresh:Z,getSelectedEntry:()=>m,getElement:()=>x.current}),[j,N,_,I,Z,m]);const y=d=>{var h,v;return e.jsxs("tr",{className:`nice-accesslog-row ${(m==null?void 0:m.id)===d.id?"nice-accesslog-row--selected":""} ${d.success?"":"nice-accesslog-row--failed"}`,onClick:()=>K(d),children:[e.jsx("td",{className:"nice-accesslog-cell nice-accesslog-cell--timestamp",children:de(d.timestamp)}),e.jsx("td",{className:"nice-accesslog-cell nice-accesslog-cell--user",children:e.jsxs("div",{className:"nice-accesslog-user",children:[e.jsx("span",{className:"nice-accesslog-username",children:d.userName||d.userId}),d.userEmail&&e.jsx("span",{className:"nice-accesslog-email",children:d.userEmail})]})}),e.jsx("td",{className:"nice-accesslog-cell nice-accesslog-cell--event",children:e.jsxs("span",{className:`nice-accesslog-event nice-accesslog-event--${d.eventType}`,children:[e.jsx("span",{className:"nice-accesslog-event-icon",children:ne[d.eventType]}),k.eventTypes[d.eventType]]})}),e.jsxs("td",{className:"nice-accesslog-cell nice-accesslog-cell--ip",children:[e.jsx("span",{className:"nice-accesslog-ip",children:d.ipAddress}),$&&e.jsx("button",{type:"button",className:"nice-accesslog-block-btn",onClick:X=>{X.stopPropagation(),$(d.ipAddress)},title:"Block IP",children:e.jsx(t.NtdSlash,{size:14})})]}),e.jsxs("td",{className:"nice-accesslog-cell nice-accesslog-cell--location",children:[((h=d.location)==null?void 0:h.countryCode)&&e.jsx("span",{className:"nice-accesslog-flag",children:e.jsx(t.NtdFlag,{size:14})}),he(d.location)]}),e.jsx("td",{className:"nice-accesslog-cell nice-accesslog-cell--device",children:e.jsxs("span",{className:"nice-accesslog-device",children:[oe[((v=d.device)==null?void 0:v.type)||"unknown"],Be(d.device)]})}),e.jsx("td",{className:"nice-accesslog-cell nice-accesslog-cell--risk",children:e.jsxs("span",{className:`nice-accesslog-risk nice-accesslog-risk--${d.riskLevel}`,style:{"--risk-color":ue(d.riskScore)},children:[e.jsx("span",{className:"nice-accesslog-risk-score",children:d.riskScore}),e.jsx("span",{className:"nice-accesslog-risk-label",children:k.riskLevels[d.riskLevel]})]})}),e.jsx("td",{className:"nice-accesslog-cell nice-accesslog-cell--status",children:e.jsx("span",{className:`nice-accesslog-status ${d.success?"nice-accesslog-status--success":"nice-accesslog-status--failed"}`,children:d.success?e.jsx(t.NtdCheck,{size:14}):e.jsx(t.NtdError,{size:14})})})]},d.id)},R=d=>e.jsxs("div",{className:`nice-accesslog-timeline-item nice-accesslog-timeline-item--${d.riskLevel}`,onClick:()=>K(d),children:[e.jsx("div",{className:"nice-accesslog-timeline-marker",style:{background:ae[d.riskLevel]}}),e.jsxs("div",{className:"nice-accesslog-timeline-content",children:[e.jsxs("div",{className:"nice-accesslog-timeline-header",children:[e.jsxs("span",{className:"nice-accesslog-timeline-event",children:[ne[d.eventType]," ",k.eventTypes[d.eventType]]}),e.jsx("span",{className:"nice-accesslog-timeline-time",children:de(d.timestamp)})]}),e.jsxs("div",{className:"nice-accesslog-timeline-details",children:[e.jsx("span",{children:d.userName||d.userId}),e.jsx("span",{children:"•"}),e.jsx("span",{children:d.ipAddress}),e.jsx("span",{children:"•"}),e.jsx("span",{children:he(d.location)})]}),d.flags&&d.flags.length>0&&e.jsx("div",{className:"nice-accesslog-timeline-flags",children:d.flags.map((h,v)=>e.jsx("span",{className:"nice-accesslog-flag-badge",children:h},v))})]})]},d.id);return e.jsxs("div",{ref:x,className:`nice-accesslog ${M}`,...V,children:[e.jsxs("div",{className:"nice-accesslog-header",children:[e.jsxs("div",{className:"nice-accesslog-header-left",children:[e.jsx("h2",{className:"nice-accesslog-title",children:k.title}),u&&e.jsxs("span",{className:"nice-accesslog-realtime-badge",children:[e.jsx(t.NtdCircle,{size:10})," Live"]})]}),e.jsxs("div",{className:"nice-accesslog-header-actions",children:[e.jsxs("button",{type:"button",className:"nice-accesslog-btn",onClick:Z,disabled:H,children:[e.jsx(t.NtdRefresh,{size:16})," ",k.refresh]}),e.jsxs("div",{className:"nice-accesslog-export-dropdown",children:[e.jsxs("button",{type:"button",className:"nice-accesslog-btn",children:[e.jsx(t.NtdDownload,{size:16})," ",k.export]}),e.jsxs("div",{className:"nice-accesslog-export-menu",children:[e.jsx("button",{onClick:()=>I("csv"),children:"CSV"}),e.jsx("button",{onClick:()=>I("json"),children:"JSON"}),e.jsx("button",{onClick:()=>I("pdf"),children:"PDF"})]})]})]})]}),z&&e.jsxs("div",{className:"nice-accesslog-stats",children:[e.jsxs("div",{className:"nice-accesslog-stat",children:[e.jsx("span",{className:"nice-accesslog-stat-value",children:q.totalEvents}),e.jsx("span",{className:"nice-accesslog-stat-label",children:"Total Events"})]}),e.jsxs("div",{className:"nice-accesslog-stat nice-accesslog-stat--success",children:[e.jsx("span",{className:"nice-accesslog-stat-value",children:q.successfulLogins}),e.jsx("span",{className:"nice-accesslog-stat-label",children:"Successful"})]}),e.jsxs("div",{className:"nice-accesslog-stat nice-accesslog-stat--failed",children:[e.jsx("span",{className:"nice-accesslog-stat-value",children:q.failedLogins}),e.jsx("span",{className:"nice-accesslog-stat-label",children:"Failed"})]}),e.jsxs("div",{className:"nice-accesslog-stat",children:[e.jsx("span",{className:"nice-accesslog-stat-value",children:q.uniqueIPs}),e.jsx("span",{className:"nice-accesslog-stat-label",children:"Unique IPs"})]}),e.jsxs("div",{className:"nice-accesslog-stat",children:[e.jsx("span",{className:"nice-accesslog-stat-value",children:q.uniqueCountries}),e.jsx("span",{className:"nice-accesslog-stat-label",children:"Countries"})]}),e.jsxs("div",{className:"nice-accesslog-stat nice-accesslog-stat--warning",children:[e.jsx("span",{className:"nice-accesslog-stat-value",children:q.highRiskEvents}),e.jsx("span",{className:"nice-accesslog-stat-label",children:"High Risk"})]})]}),e.jsxs("div",{className:"nice-accesslog-filters",children:[e.jsxs("div",{className:"nice-accesslog-filters-row",children:[e.jsxs("div",{className:"nice-accesslog-search",children:[e.jsx("span",{className:"nice-accesslog-search-icon",children:e.jsx(t.NtdSearch,{size:16})}),e.jsx("input",{type:"text",placeholder:k.search,value:j.searchQuery||"",onChange:d=>N({searchQuery:d.target.value})})]}),e.jsxs("div",{className:"nice-accesslog-filter-quick",children:[e.jsx("button",{type:"button",className:`nice-accesslog-filter-chip ${j.failedOnly?"nice-accesslog-filter-chip--active":""}`,onClick:()=>N({failedOnly:!j.failedOnly,successOnly:!1}),children:"Failed Only"}),e.jsx("button",{type:"button",className:`nice-accesslog-filter-chip ${(B=j.riskLevels)!=null&&B.includes("high")||(W=j.riskLevels)!=null&&W.includes("critical")?"nice-accesslog-filter-chip--active":""}`,onClick:()=>{var d;return N({riskLevels:(d=j.riskLevels)!=null&&d.includes("high")?[]:["high","critical"]})},children:"High Risk"}),e.jsx("button",{type:"button",className:"nice-accesslog-filter-toggle",onClick:()=>Y(!w),children:w?e.jsxs(e.Fragment,{children:[e.jsx(t.NtdMinus,{size:14})," Less"]}):e.jsxs(e.Fragment,{children:[e.jsx(t.NtdPlus,{size:14})," More"]})})]})]}),w&&e.jsxs("div",{className:"nice-accesslog-filters-expanded",children:[e.jsxs("div",{className:"nice-accesslog-filter-group",children:[e.jsx("label",{children:"Event Type"}),e.jsx("select",{multiple:!0,value:j.eventTypes||[],onChange:d=>{const h=Array.from(d.target.selectedOptions,v=>v.value);N({eventTypes:h.length?h:void 0})},children:Object.entries(k.eventTypes).map(([d,h])=>e.jsx("option",{value:d,children:h},d))})]}),e.jsxs("div",{className:"nice-accesslog-filter-group",children:[e.jsx("label",{children:"Date Range"}),e.jsxs("div",{className:"nice-accesslog-date-range",children:[e.jsx("input",{type:"date",value:j.startDate?new Date(j.startDate).toISOString().split("T")[0]:"",onChange:d=>N({startDate:d.target.value||void 0})}),e.jsx("span",{children:"to"}),e.jsx("input",{type:"date",value:j.endDate?new Date(j.endDate).toISOString().split("T")[0]:"",onChange:d=>N({endDate:d.target.value||void 0})})]})]}),e.jsxs("div",{className:"nice-accesslog-filter-group",children:[e.jsx("label",{children:"IP Address"}),e.jsx("input",{type:"text",placeholder:"e.g., 192.168",value:j.ipAddress||"",onChange:d=>N({ipAddress:d.target.value||void 0})})]}),e.jsx("button",{type:"button",className:"nice-accesslog-clear-filters",onClick:_,children:"Clear All Filters"})]})]}),e.jsxs("div",{className:"nice-accesslog-tabs",children:[e.jsxs("button",{type:"button",className:`nice-accesslog-tab ${g==="table"?"nice-accesslog-tab--active":""}`,onClick:()=>S("table"),children:[e.jsx(t.NtdTable,{size:16})," Table"]}),e.jsxs("button",{type:"button",className:`nice-accesslog-tab ${g==="timeline"?"nice-accesslog-tab--active":""}`,onClick:()=>S("timeline"),children:[e.jsx(t.NtdCalendar,{size:16})," ",k.timeline]}),p&&e.jsxs("button",{type:"button",className:`nice-accesslog-tab ${g==="map"?"nice-accesslog-tab--active":""}`,onClick:()=>S("map"),children:[e.jsx(t.NtdMap,{size:16})," ",k.map]}),e.jsxs("span",{className:"nice-accesslog-count",children:[D.length," entries"]})]}),e.jsx("div",{className:"nice-accesslog-content",children:H?e.jsxs("div",{className:"nice-accesslog-loading",children:[e.jsx("div",{className:"nice-accesslog-spinner"}),"Loading access logs..."]}):D.length===0?e.jsxs("div",{className:"nice-accesslog-empty",children:[e.jsx("span",{className:"nice-accesslog-empty-icon",children:e.jsx(t.NtdShield,{size:32})}),e.jsx("span",{children:k.noResults})]}):e.jsxs(e.Fragment,{children:[g==="table"&&e.jsx("div",{className:"nice-accesslog-table-wrapper",children:e.jsxs("table",{className:"nice-accesslog-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:k.columns.timestamp}),e.jsx("th",{children:k.columns.user}),e.jsx("th",{children:k.columns.event}),e.jsx("th",{children:k.columns.ip}),e.jsx("th",{children:k.columns.location}),e.jsx("th",{children:k.columns.device}),e.jsx("th",{children:k.columns.risk}),e.jsx("th",{children:k.columns.status})]})}),e.jsx("tbody",{children:J.map(y)})]})}),g==="timeline"&&e.jsx("div",{className:"nice-accesslog-timeline",children:J.map(R)}),g==="map"&&e.jsx("div",{className:"nice-accesslog-map",children:e.jsxs("div",{className:"nice-accesslog-map-placeholder",children:[e.jsx(t.NtdMap,{size:16})," Geographic visualization would render here"]})}),L<D.length&&e.jsxs("button",{type:"button",className:"nice-accesslog-show-more",onClick:b,children:[k.showMore," (",D.length-L," remaining)"]})]})}),E&&m&&e.jsxs("div",{className:"nice-accesslog-detail",children:[e.jsxs("div",{className:"nice-accesslog-detail-header",children:[e.jsx("h3",{children:k.details}),e.jsx("button",{type:"button",className:"nice-accesslog-detail-close",onClick:()=>F(null),children:e.jsx(t.NtdClose,{size:16})})]}),e.jsxs("div",{className:"nice-accesslog-detail-content",children:[e.jsxs("div",{className:"nice-accesslog-detail-row",children:[e.jsx("span",{className:"nice-accesslog-detail-label",children:"Event ID"}),e.jsx("span",{className:"nice-accesslog-detail-value",children:m.id})]}),e.jsxs("div",{className:"nice-accesslog-detail-row",children:[e.jsx("span",{className:"nice-accesslog-detail-label",children:"Timestamp"}),e.jsx("span",{className:"nice-accesslog-detail-value",children:new Date(m.timestamp).toISOString()})]}),e.jsxs("div",{className:"nice-accesslog-detail-row",children:[e.jsx("span",{className:"nice-accesslog-detail-label",children:"User"}),e.jsxs("span",{className:"nice-accesslog-detail-value",children:[m.userName," (",m.userId,")",m.userEmail&&e.jsx("div",{children:m.userEmail})]})]}),e.jsxs("div",{className:"nice-accesslog-detail-row",children:[e.jsx("span",{className:"nice-accesslog-detail-label",children:"Event Type"}),e.jsxs("span",{className:"nice-accesslog-detail-value",children:[ne[m.eventType]," ",k.eventTypes[m.eventType]]})]}),e.jsxs("div",{className:"nice-accesslog-detail-row",children:[e.jsx("span",{className:"nice-accesslog-detail-label",children:"IP Address"}),e.jsx("span",{className:"nice-accesslog-detail-value",children:m.ipAddress})]}),m.location&&e.jsxs("div",{className:"nice-accesslog-detail-row",children:[e.jsx("span",{className:"nice-accesslog-detail-label",children:"Location"}),e.jsxs("span",{className:"nice-accesslog-detail-value",children:[m.location.city,", ",m.location.region,","," ",m.location.country,m.location.latitude&&m.location.longitude&&e.jsxs("div",{className:"nice-accesslog-coords",children:["(",m.location.latitude,", ",m.location.longitude,")"]})]})]}),m.device&&e.jsxs("div",{className:"nice-accesslog-detail-row",children:[e.jsx("span",{className:"nice-accesslog-detail-label",children:"Device"}),e.jsxs("span",{className:"nice-accesslog-detail-value",children:[oe[m.device.type]," ",m.device.os," ",m.device.osVersion,e.jsxs("div",{children:[m.device.browser," ",m.device.browserVersion]}),m.device.fingerprint&&e.jsxs("div",{className:"nice-accesslog-fingerprint",children:["Fingerprint: ",m.device.fingerprint]})]})]}),e.jsxs("div",{className:"nice-accesslog-detail-row",children:[e.jsx("span",{className:"nice-accesslog-detail-label",children:"Risk Score"}),e.jsx("span",{className:"nice-accesslog-detail-value",children:e.jsxs("span",{style:{color:ue(m.riskScore)},children:[m.riskScore,"/100 (",k.riskLevels[m.riskLevel],")"]})})]}),m.flags&&m.flags.length>0&&e.jsxs("div",{className:"nice-accesslog-detail-row",children:[e.jsx("span",{className:"nice-accesslog-detail-label",children:"Flags"}),e.jsx("span",{className:"nice-accesslog-detail-value",children:m.flags.map((d,h)=>e.jsx("span",{className:"nice-accesslog-flag-badge",children:d},h))})]}),m.details&&Object.keys(m.details).length>0&&e.jsxs("div",{className:"nice-accesslog-detail-row",children:[e.jsx("span",{className:"nice-accesslog-detail-label",children:"Additional Details"}),e.jsx("pre",{className:"nice-accesslog-detail-json",children:JSON.stringify(m.details,null,2)})]})]})]})]})});be.displayName="NiceAccessLog";exports.NiceAccessLog=be;exports.NiceAuditTrail=me;exports.NiceContractEditor=xe;exports.NiceDataExportCenter=pe;exports.NiceGDPRConsent=je;exports.NiceGlobalSearch=Ne;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("@nice2dev/icons"),F=require("@nice2dev/ui"),r=require("react");function xe(s,i,a){const t=a.csvDelimiter||",",c=[];return a.includeHeaders!==!1&&c.push(i.filter(l=>l.include).map(l=>`"${l.label}"`).join(t)),s.forEach(l=>{const h=i.filter(o=>o.include).map(o=>{let d=l[o.field];return o.transform&&(d=o.transform(d)),d==null?"":typeof d=="string"?`"${d.replace(/"/g,'""')}"`:String(d)});c.push(h.join(t))}),c.join(`
2
+ `)}function ge(s,i,a){const t=i.filter(l=>l.include),c=s.map(l=>{const h={};return t.forEach(o=>{let d=l[o.field];o.transform&&(d=o.transform(d)),h[o.field]=d}),h});return JSON.stringify(c,null,2)}const re={csv:{label:"CSV",icon:e.jsx(n.NtdFileText,{size:20}),description:"Comma-separated values"},xlsx:{label:"Excel",icon:e.jsx(n.NtdBarChart,{size:20}),description:"Microsoft Excel"},json:{label:"JSON",icon:e.jsx(n.NtdBrackets,{size:20}),description:"JavaScript Object Notation"},pdf:{label:"PDF",icon:e.jsx(n.NtdFile,{size:20}),description:"Portable Document Format"},xml:{label:"XML",icon:e.jsx(n.NtdClipboard,{size:20}),description:"Extensible Markup Language"}},je=({formats:s,selected:i,onChange:a})=>e.jsx("div",{className:"nice-export-formats",children:s.map(t=>{const c=re[t];return e.jsxs("button",{type:"button",className:`nice-export-format ${i===t?"nice-export-format--selected":""}`,onClick:()=>a(t),title:c.description,children:[e.jsx("span",{className:"nice-export-format-icon",children:c.icon}),e.jsx("span",{className:"nice-export-format-label",children:c.label})]},t)})}),Ne=({fields:s,onChange:i})=>{const{t:a}=F.useNiceTranslation(),t=h=>{const o=[...s];o[h]={...o[h],include:!o[h].include},i(o)},c=h=>{i(s.map(o=>({...o,include:h})))},l=s.filter(h=>h.include).length;return e.jsxs("div",{className:"nice-export-fields",children:[e.jsxs("div",{className:"nice-export-fields-header",children:[e.jsx("span",{children:a("dataExportCenter.fieldsToExport","Fields to export ({selectedCount}/{fields})").replace("{selectedCount}",String(l)).replace("{fields}",String(s.length))}),e.jsxs("div",{className:"nice-export-fields-actions",children:[e.jsx("button",{type:"button",onClick:()=>c(!0),children:a("dataExportCenter.selectAll","Select all")}),e.jsx("button",{type:"button",onClick:()=>c(!1),children:a("dataExportCenter.deselectAll","Deselect all")})]})]}),e.jsx("div",{className:"nice-export-fields-list",children:s.map((h,o)=>e.jsxs("label",{className:"nice-export-field",children:[e.jsx("input",{type:"checkbox",checked:h.include,onChange:()=>t(o)}),e.jsx("span",{className:"nice-export-field-label",children:h.label}),e.jsx("span",{className:"nice-export-field-name",children:h.field})]},h.field))})]})},be=({format:s,options:i,onChange:a})=>{const{t}=F.useNiceTranslation(),c=(l,h)=>{a({...i,[l]:h})};return e.jsxs("div",{className:"nice-export-options",children:[e.jsx("h4",{children:t("dataExportCenter.exportOptions","Export Options")}),e.jsxs("label",{className:"nice-export-option",children:[e.jsx("input",{type:"checkbox",checked:i.includeHeaders!==!1,onChange:l=>c("includeHeaders",l.target.checked)}),t("dataExportCenter.includeHeaders","Include headers")]}),s==="csv"&&e.jsxs("label",{className:"nice-export-option",children:[e.jsx("span",{children:t("dataExportCenter.delimiter","Delimiter:")}),e.jsxs("select",{value:i.csvDelimiter||",",onChange:l=>c("csvDelimiter",l.target.value),children:[e.jsx("option",{value:",",children:t("dataExportCenter.comma","Comma (,)")}),e.jsx("option",{value:";",children:t("dataExportCenter.semicolon","Semicolon (;)")}),e.jsx("option",{value:"\\t",children:t("dataExportCenter.tab","Tab")}),e.jsx("option",{value:"|",children:t("dataExportCenter.pipe","Pipe (|)")})]})]}),e.jsxs("label",{className:"nice-export-option",children:[e.jsx("span",{children:t("dataExportCenter.dateFormat","Date format:")}),e.jsxs("select",{value:i.dateFormat||"YYYY-MM-DD",onChange:l=>c("dateFormat",l.target.value),children:[e.jsx("option",{value:"YYYY-MM-DD",children:t("dataExportCenter.yyyyMmDd","YYYY-MM-DD")}),e.jsx("option",{value:"DD/MM/YYYY",children:t("dataExportCenter.ddMmYyyy","DD/MM/YYYY")}),e.jsx("option",{value:"MM/DD/YYYY",children:t("dataExportCenter.mmDdYyyy","MM/DD/YYYY")}),e.jsx("option",{value:"ISO",children:t("dataExportCenter.iso8601","ISO 8601")})]})]}),e.jsxs("label",{className:"nice-export-option",children:[e.jsx("span",{children:t("dataExportCenter.encoding","Encoding:")}),e.jsxs("select",{value:i.encoding||"utf-8",onChange:l=>c("encoding",l.target.value),children:[e.jsx("option",{value:"utf-8",children:t("dataExportCenter.utf8","UTF-8")}),e.jsx("option",{value:"utf-16",children:t("dataExportCenter.utf16","UTF-16")}),e.jsx("option",{value:"iso-8859-1",children:t("dataExportCenter.iso88591","ISO-8859-1")})]})]}),(s==="xlsx"||s==="pdf")&&e.jsxs("label",{className:"nice-export-option",children:[e.jsx("span",{children:t("dataExportCenter.passwordProtect","Password protect:")}),e.jsx("input",{type:"password",value:i.password||"",onChange:l=>c("password",l.target.value||void 0),placeholder:t("dataExportCenter.leaveEmptyForNoPassword","Leave empty for no password")})]})]})},ve=({jobs:s,onDownload:i})=>{const{t:a}=F.useNiceTranslation();if(s.length===0)return e.jsx("div",{className:"nice-export-history-empty",children:a("dataExportCenter.noExportHistory","No export history")});const t=c=>c?c<1024?`${c} B`:c<1024*1024?`${(c/1024).toFixed(1)} KB`:`${(c/1024/1024).toFixed(1)} MB`:"-";return e.jsxs("div",{className:"nice-export-history",children:[e.jsx("h4",{children:a("dataExportCenter.exportHistory","Export History")}),e.jsx("div",{className:"nice-export-history-list",children:s.map(c=>e.jsxs("div",{className:`nice-export-job nice-export-job--${c.status}`,children:[e.jsxs("div",{className:"nice-export-job-info",children:[e.jsx("span",{className:"nice-export-job-name",children:c.name}),e.jsx("span",{className:"nice-export-job-format",children:c.format.toUpperCase()}),e.jsx("span",{className:"nice-export-job-date",children:new Date(c.createdAt).toLocaleString()})]}),e.jsxs("div",{className:"nice-export-job-meta",children:[c.rowCount&&e.jsx("span",{children:a("dataExportCenter.rows","{rowCount} rows").replace("{rowCount}",String(c.rowCount))}),c.fileSize&&e.jsx("span",{children:t(c.fileSize)})]}),e.jsxs("div",{className:"nice-export-job-status",children:[c.status==="processing"&&e.jsx("div",{className:"nice-export-job-progress",children:e.jsx("div",{className:"nice-export-job-progress-bar",style:{width:`${c.progress}%`}})}),c.status==="completed"&&c.downloadUrl&&e.jsx("button",{type:"button",className:"nice-export-job-download",onClick:()=>i==null?void 0:i(c),children:a("dataExportCenter.download","Download")}),c.status==="failed"&&e.jsx("span",{className:"nice-export-job-error",title:c.error,children:a("dataExportCenter.failed","Failed")})]})]},c.id))})]})},fe=Object.assign(r.forwardRef(({dataSource:s,formats:i=["csv","xlsx","json","pdf"],templates:a=[],enableScheduling:t=!1,exportHistory:c=[],onExportStart:l,onExportComplete:h,onExportError:o,onSaveTemplate:d,onDeleteTemplate:y,onSchedule:z,customExportHandler:_,title:k,description:E,className:P="",style:Y},D)=>{const{t:O}=F.useNiceTranslation(),ee=k??O("dataExportCenter.title","Data Export"),[$,q]=r.useState(i[0]),[L,x]=r.useState(s.getFields()),[b,g]=r.useState({includeHeaders:!0,dateFormat:"YYYY-MM-DD",encoding:"utf-8"}),[V,m]=r.useState(!1),[H,I]=r.useState(0),[R,w]=r.useState("export"),B=r.useCallback(async()=>{const N={id:Date.now().toString(),name:`Export ${new Date().toISOString()}`,format:$,status:"processing",progress:0,createdAt:new Date};m(!0),I(0),l==null||l(N);try{const C=await s.fetchData({fields:L,filters:void 0,sorting:void 0});I(50);let A;if(_)A=await _($,C,b);else switch($){case"csv":A=xe(C,L,b);break;case"json":A=ge(C,L,b);break;default:throw new Error(`Format ${$} requires a custom export handler`)}I(100);const J=typeof A=="string"?new Blob([A],{type:"text/plain"}):A,v=URL.createObjectURL(J),T=document.createElement("a");T.href=v,T.download=`export-${Date.now()}.${$}`,document.body.appendChild(T),T.click(),document.body.removeChild(T),URL.revokeObjectURL(v);const W={...N,status:"completed",progress:100,completedAt:new Date,rowCount:C.length,fileSize:J.size};h==null||h(W)}catch(C){const A={...N,status:"failed",error:C instanceof Error?C.message:"Unknown error"};o==null||o(A,C instanceof Error?C:new Error("Export failed"))}finally{m(!1),I(0)}},[$,L,b,s,_,l,h,o]),U=r.useCallback(N=>{const C=a.find(A=>A.id===N);C&&(q(C.format),x(C.fields),C.options&&g(C.options))},[a]);return r.useImperativeHandle(D,()=>({exportNow:async N=>{q(N),await B()},getSelectedFields:()=>L,loadTemplate:U})),e.jsxs("div",{className:`nice-export-center ${P}`,style:Y,children:[e.jsx("div",{className:"nice-export-header",children:e.jsxs("div",{className:"nice-export-title-area",children:[e.jsx("h3",{className:"nice-export-title",children:ee}),E&&e.jsx("p",{className:"nice-export-description",children:E})]})}),e.jsxs("div",{className:"nice-export-tabs",children:[e.jsx("button",{type:"button",className:`nice-export-tab ${R==="export"?"nice-export-tab--active":""}`,onClick:()=>w("export"),children:O("dataExportCenter.export","Export")}),a.length>0&&e.jsx("button",{type:"button",className:`nice-export-tab ${R==="templates"?"nice-export-tab--active":""}`,onClick:()=>w("templates"),children:O("dataExportCenter.templates","Templates ({templates})").replace("{templates}",String(a.length))}),c.length>0&&e.jsx("button",{type:"button",className:`nice-export-tab ${R==="history"?"nice-export-tab--active":""}`,onClick:()=>w("history"),children:O("dataExportCenter.history","History")})]}),e.jsxs("div",{className:"nice-export-content",children:[R==="export"&&e.jsxs(e.Fragment,{children:[e.jsx(je,{formats:i,selected:$,onChange:q}),e.jsx(Ne,{fields:L,onChange:x}),e.jsx(be,{format:$,options:b,onChange:g}),e.jsxs("div",{className:"nice-export-actions",children:[e.jsx("button",{type:"button",className:"nice-export-btn nice-export-btn--primary",onClick:B,disabled:V||L.filter(N=>N.include).length===0,children:V?O("dataExportCenter.exporting","Exporting... {progress}%").replace("{progress}",String(H)):O("dataExportCenter.exportNow","Export Now")}),d&&e.jsx("button",{type:"button",className:"nice-export-btn nice-export-btn--secondary",onClick:()=>d({id:Date.now().toString(),name:`Template ${a.length+1}`,format:$,fields:L,options:b}),children:O("dataExportCenter.saveAsTemplate","Save as Template")})]})]}),R==="templates"&&e.jsx("div",{className:"nice-export-templates",children:a.map(N=>e.jsxs("div",{className:"nice-export-template",children:[e.jsxs("div",{className:"nice-export-template-info",children:[e.jsx("span",{className:"nice-export-template-name",children:N.name}),e.jsxs("span",{className:"nice-export-template-format",children:[re[N.format].icon," ",re[N.format].label]}),N.description&&e.jsx("span",{className:"nice-export-template-desc",children:N.description})]}),e.jsxs("div",{className:"nice-export-template-actions",children:[e.jsx("button",{type:"button",onClick:()=>{U(N.id),w("export")},children:O("dataExportCenter.use","Use")}),y&&e.jsx("button",{type:"button",onClick:()=>y(N.id),children:O("dataExportCenter.delete","Delete")})]})]},N.id))}),R==="history"&&e.jsx(ve,{jobs:c,onDownload:N=>{N.downloadUrl&&window.open(N.downloadUrl,"_blank")}})]})]})}),{displayName:"NiceDataExportCenter"}),te={create:{icon:e.jsx(n.NtdPlus,{size:16}),label:"Created",color:"var(--nice-color-success, #10b981)"},update:{icon:e.jsx(n.NtdEdit,{size:16}),label:"Updated",color:"var(--nice-color-primary, #3b82f6)"},delete:{icon:e.jsx(n.NtdClose,{size:16}),label:"Deleted",color:"var(--nice-color-error, #ef4444)"},view:{icon:e.jsx(n.NtdEye,{size:16}),label:"Viewed",color:"var(--nice-text-muted, #6b7280)"},export:{icon:e.jsx(n.NtdDownload,{size:16}),label:"Exported",color:"var(--nice-color-accent, #8b5cf6)"},import:{icon:e.jsx(n.NtdUpload,{size:16}),label:"Imported",color:"var(--nice-color-accent, #8b5cf6)"},approve:{icon:e.jsx(n.NtdCheck,{size:16}),label:"Approved",color:"var(--nice-color-success, #10b981)"},reject:{icon:e.jsx(n.NtdError,{size:16}),label:"Rejected",color:"var(--nice-color-error, #ef4444)"},login:{icon:e.jsx(n.NtdLogIn,{size:16}),label:"Login",color:"var(--nice-color-success, #10b981)"},logout:{icon:e.jsx(n.NtdLogOut,{size:16}),label:"Logout",color:"var(--nice-text-muted, #6b7280)"},permission_change:{icon:e.jsx(n.NtdKey,{size:16}),label:"Permissions",color:"var(--nice-color-warning, #f59e0b)"},config_change:{icon:e.jsx(n.NtdSettings,{size:16}),label:"Config",color:"var(--nice-color-warning, #f59e0b)"},custom:{icon:e.jsx(n.NtdCircle,{size:16}),label:"Action",color:"var(--nice-text-muted, #6b7280)"}},ye=({filter:s,onChange:i,availableFilters:a})=>{var l,h;const{t}=F.useNiceTranslation(),c=(o,d)=>{i({...s,[o]:d})};return e.jsxs("div",{className:"nice-audit-filters",children:[e.jsxs("div",{className:"nice-audit-filter-group",children:[e.jsx("label",{children:t("auditTrail.dateRange","Date Range")}),e.jsxs("div",{className:"nice-audit-date-range",children:[e.jsx("input",{type:"date",value:((l=s.startDate)==null?void 0:l.toISOString().split("T")[0])||"",onChange:o=>c("startDate",o.target.value?new Date(o.target.value):void 0)}),e.jsx("span",{children:t("auditTrail.to","to")}),e.jsx("input",{type:"date",value:((h=s.endDate)==null?void 0:h.toISOString().split("T")[0])||"",onChange:o=>c("endDate",o.target.value?new Date(o.target.value):void 0)})]})]}),e.jsxs("div",{className:"nice-audit-filter-group",children:[e.jsx("label",{children:t("auditTrail.actions","Actions")}),e.jsx("div",{className:"nice-audit-action-chips",children:Object.keys(te).slice(0,8).map(o=>{var z;const d=te[o],y=(z=s.actions)==null?void 0:z.includes(o);return e.jsxs("button",{type:"button",className:`nice-audit-chip ${y?"nice-audit-chip--selected":""}`,style:{"--chip-color":d.color},onClick:()=>{const _=s.actions||[];c("actions",y?_.filter(k=>k!==o):[..._,o])},children:[e.jsx("span",{className:"nice-audit-chip-icon",children:d.icon}),d.label]},o)})})]}),e.jsxs("div",{className:"nice-audit-filter-group",children:[e.jsx("label",{children:t("auditTrail.search","Search")}),e.jsx("input",{type:"text",className:"nice-audit-search",placeholder:t("auditTrail.searchEntries","Search entries..."),value:s.searchQuery||"",onChange:o=>c("searchQuery",o.target.value||void 0)})]})]})},ke=({changes:s})=>{if(!s.length)return null;const i=(a,t)=>t||(a==null?"(empty)":typeof a=="object"?JSON.stringify(a,null,2):String(a));return e.jsx("div",{className:"nice-audit-diff",children:s.map((a,t)=>e.jsxs("div",{className:"nice-audit-diff-row",children:[e.jsx("span",{className:"nice-audit-diff-field",children:a.field}),e.jsxs("div",{className:"nice-audit-diff-values",children:[e.jsx("span",{className:"nice-audit-diff-old",children:i(a.oldValue,a.displayOldValue)}),e.jsx("span",{className:"nice-audit-diff-arrow",children:e.jsx(n.NtdArrowRight,{size:14})}),e.jsx("span",{className:"nice-audit-diff-new",children:i(a.newValue,a.displayNewValue)})]})]},t))})},we=({entry:s,showDiff:i,renderActionIcon:a,renderUser:t,onClick:c})=>{const{t:l}=F.useNiceTranslation(),[h,o]=r.useState(!1),d=te[s.action]||te.custom;return e.jsxs("div",{className:`nice-audit-timeline-entry nice-audit-timeline-entry--${s.severity||"info"}`,onClick:c,role:c?"button":void 0,tabIndex:c?0:void 0,children:[e.jsx("div",{className:"nice-audit-timeline-marker",style:{"--marker-color":d.color},children:a?a(s.action):d.icon}),e.jsxs("div",{className:"nice-audit-timeline-content",children:[e.jsxs("div",{className:"nice-audit-timeline-header",children:[e.jsx("span",{className:"nice-audit-timeline-action",children:s.actionLabel||d.label}),e.jsxs("span",{className:"nice-audit-timeline-entity",children:[s.entityType," ",s.entityName&&`"${s.entityName}"`]}),e.jsx("span",{className:"nice-audit-timeline-time",children:new Date(s.timestamp).toLocaleString()})]}),e.jsx("div",{className:"nice-audit-timeline-user",children:t?t(s):e.jsxs(e.Fragment,{children:[s.userAvatar&&e.jsx("img",{src:s.userAvatar,alt:"",className:"nice-audit-avatar"}),e.jsx("span",{className:"nice-audit-username",children:s.userName}),s.userRole&&e.jsx("span",{className:"nice-audit-role",children:s.userRole})]})}),s.notes&&e.jsx("div",{className:"nice-audit-timeline-notes",children:s.notes}),i&&s.changes&&s.changes.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"nice-audit-expand-btn",onClick:y=>{y.stopPropagation(),o(!h)},children:h?e.jsxs(e.Fragment,{children:[e.jsx(n.NtdChevronDown,{size:14})," ",l("auditTrail.hideChanges","Hide changes")]}):e.jsxs(e.Fragment,{children:[e.jsx(n.NtdChevronRight,{size:14})," ",l("auditTrail.showChanges","Show {changes} changes").replace("{changes}",String(s.changes.length))]})}),h&&e.jsx(ke,{changes:s.changes})]}),s.ipAddress&&e.jsxs("div",{className:"nice-audit-timeline-meta",children:[e.jsx("span",{children:l("auditTrail.ip","IP: {ipAddress}").replace("{ipAddress}",String(s.ipAddress))}),s.location&&e.jsxs("span",{children:["• ",s.location]})]})]})]})},Ce=({entries:s,showDiff:i,onEntryClick:a})=>{const{t}=F.useNiceTranslation();return e.jsxs("table",{className:"nice-audit-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:t("auditTrail.timestamp","Timestamp")}),e.jsx("th",{children:t("auditTrail.action","Action")}),e.jsx("th",{children:t("auditTrail.user","User")}),e.jsx("th",{children:t("auditTrail.entity","Entity")}),e.jsx("th",{children:t("auditTrail.changes","Changes")}),e.jsx("th",{children:t("auditTrail.ipAddress","IP Address")})]})}),e.jsx("tbody",{children:s.map(c=>{const l=te[c.action]||te.custom;return e.jsxs("tr",{className:`nice-audit-row nice-audit-row--${c.severity||"info"}`,onClick:()=>a==null?void 0:a(c),role:a?"button":void 0,children:[e.jsx("td",{className:"nice-audit-cell-time",children:new Date(c.timestamp).toLocaleString()}),e.jsx("td",{children:e.jsxs("span",{className:"nice-audit-action-badge",style:{"--badge-color":l.color},children:[l.icon," ",c.actionLabel||l.label]})}),e.jsxs("td",{className:"nice-audit-cell-user",children:[c.userAvatar&&e.jsx("img",{src:c.userAvatar,alt:"",className:"nice-audit-avatar-sm"}),c.userName]}),e.jsxs("td",{children:[c.entityType,c.entityName&&`: ${c.entityName}`]}),e.jsx("td",{children:c.changes&&c.changes.length>0?e.jsx("span",{className:"nice-audit-changes-count",children:t("auditTrail.fieldS","{changes} field(s)").replace("{changes}",String(c.changes.length))}):"-"}),e.jsx("td",{className:"nice-audit-cell-ip",children:c.ipAddress||"-"})]},c.id)})})]})},Se=Object.assign(r.forwardRef(({dataSource:s,initialFilter:i={},pageSize:a=50,viewMode:t="timeline",enableExport:c=!0,showDiffs:l=!0,renderActionIcon:h,renderUser:o,onEntryClick:d,onExport:y,title:z,className:_="",style:k},E)=>{const{t:P}=F.useNiceTranslation(),Y=z??P("auditTrail.title","Audit Trail"),[D,O]=r.useState([]),[ee,$]=r.useState(0),[q,L]=r.useState(i),[x,b]=r.useState(1),[g,V]=r.useState(!1),[m,H]=r.useState(t),[I,R]=r.useState(!1),w=r.useCallback(async()=>{V(!0);try{const N=await s.fetchEntries(q,{page:x,pageSize:a});O(N.entries),$(N.totalCount)}finally{V(!1)}},[s,q,x,a]);r.useEffect(()=>{w()},[w]);const B=r.useCallback(N=>{if(y)y(D,N);else{let C,A;if(N==="json")C=JSON.stringify(D,null,2),A="application/json";else{const W=["Timestamp","Action","User","Entity Type","Entity","IP","Changes"],X=D.map(G=>{var j;return[new Date(G.timestamp).toISOString(),G.action,G.userName,G.entityType,G.entityName||G.entityId,G.ipAddress||"",((j=G.changes)==null?void 0:j.length)||0]});C=[W.join(","),...X.map(G=>G.join(","))].join(`
3
+ `),A="text/csv"}const J=new Blob([C],{type:A}),v=URL.createObjectURL(J),T=document.createElement("a");T.href=v,T.download=`audit-trail-${Date.now()}.${N}`,T.click(),URL.revokeObjectURL(v)}},[D,y]);r.useImperativeHandle(E,()=>({refresh:w,setFilter:N=>{L(N),b(1)},getEntries:()=>D}));const U=Math.ceil(ee/a);return e.jsxs("div",{className:`nice-audit-trail ${_}`,style:k,children:[e.jsxs("div",{className:"nice-audit-header",children:[e.jsx("h3",{className:"nice-audit-title",children:Y}),e.jsxs("div",{className:"nice-audit-header-actions",children:[e.jsx("button",{type:"button",className:`nice-audit-view-btn ${m==="timeline"?"nice-audit-view-btn--active":""}`,onClick:()=>H("timeline"),title:P("auditTrail.timelineView","Timeline view"),children:e.jsx(n.NtdList,{size:16})}),e.jsx("button",{type:"button",className:`nice-audit-view-btn ${m==="table"?"nice-audit-view-btn--active":""}`,onClick:()=>H("table"),title:P("auditTrail.tableView","Table view"),children:e.jsx(n.NtdGrid,{size:16})}),e.jsxs("button",{type:"button",className:`nice-audit-filter-btn ${I?"nice-audit-filter-btn--active":""}`,onClick:()=>R(!I),children:[e.jsx(n.NtdSearch,{size:16})," ",P("auditTrail.filter","Filter")]}),c&&e.jsxs("div",{className:"nice-audit-export-dropdown",children:[e.jsxs("button",{type:"button",className:"nice-audit-export-btn",children:[e.jsx(n.NtdDownload,{size:16})," ",P("auditTrail.export","Export")]}),e.jsxs("div",{className:"nice-audit-export-menu",children:[e.jsx("button",{type:"button",onClick:()=>B("csv"),children:P("auditTrail.exportAsCsv","Export as CSV")}),e.jsx("button",{type:"button",onClick:()=>B("json"),children:P("auditTrail.exportAsJson","Export as JSON")})]})]})]})]}),I&&e.jsx(ye,{filter:q,onChange:L}),e.jsxs("div",{className:"nice-audit-stats",children:[e.jsx("span",{children:P("auditTrail.showingOfEntries","Showing {entries} of {totalCount} entries").replace("{entries}",String(D.length)).replace("{totalCount}",String(ee))}),q.startDate&&q.endDate&&e.jsxs("span",{className:"nice-audit-date-indicator",children:[q.startDate.toLocaleDateString()," - ",q.endDate.toLocaleDateString()]})]}),e.jsxs("div",{className:`nice-audit-content ${g?"nice-audit-content--loading":""}`,children:[g&&e.jsx("div",{className:"nice-audit-loader",children:e.jsx("div",{className:"nice-audit-spinner"})}),m==="timeline"?e.jsx("div",{className:"nice-audit-timeline",children:D.map(N=>e.jsx(we,{entry:N,showDiff:l,renderActionIcon:h,renderUser:o,onClick:d?()=>d(N):void 0},N.id))}):e.jsx(Ce,{entries:D,showDiff:l,onEntryClick:d}),D.length===0&&!g&&e.jsx("div",{className:"nice-audit-empty",children:P("auditTrail.noAuditEntriesFoundMatching","No audit entries found matching the current filters.")})]}),U>1&&e.jsxs("div",{className:"nice-audit-pagination",children:[e.jsx("button",{type:"button",disabled:x===1,onClick:()=>b(x-1),children:P("auditTrail.previous","Previous")}),e.jsx("span",{children:P("auditTrail.pageOf","Page {page} of {totalPages}").replace("{page}",String(x)).replace("{totalPages}",String(U))}),e.jsx("button",{type:"button",disabled:x===U,onClick:()=>b(x+1),children:P("auditTrail.next","Next")})]})]})}),{displayName:"NiceAuditTrail"}),Te=[{target:".nice-contract-editor",titleKey:"tutorial.contractEditor.intro.title",title:"Contract editor",contentKey:"tutorial.contractEditor.intro.content",content:"Assemble the contract from the clause library, fill template variables, track versions and approvals, then save or export to PDF/DOCX/HTML.",placement:"auto"}],ce={general:{label:"General",color:"var(--nice-text-muted, #6b7280)",icon:e.jsx(n.NtdFileText,{size:16})},liability:{label:"Liability",color:"var(--nice-color-error, #ef4444)",icon:e.jsx(n.NtdWarning,{size:16})},payment:{label:"Payment",color:"var(--nice-color-success, #10b981)",icon:e.jsx(n.NtdDollar,{size:16})},termination:{label:"Termination",color:"var(--nice-color-warning, #f59e0b)",icon:e.jsx(n.NtdOctagon,{size:16})},confidentiality:{label:"Confidentiality",color:"var(--nice-color-accent, #8b5cf6)",icon:e.jsx(n.NtdLock,{size:16})},compliance:{label:"Compliance",color:"var(--nice-color-primary, #3b82f6)",icon:e.jsx(n.NtdCheck,{size:16})},custom:{label:"Custom",color:"var(--nice-text-muted, #64748b)",icon:e.jsx(n.NtdEdit,{size:16})}},De={draft:{label:"Draft",color:"var(--nice-text-muted, #6b7280)"},pending_review:{label:"Pending Review",color:"var(--nice-color-warning, #f59e0b)"},approved:{label:"Approved",color:"var(--nice-color-success, #10b981)"},rejected:{label:"Rejected",color:"var(--nice-color-error, #ef4444)"},signed:{label:"Signed",color:"var(--nice-color-accent, #8b5cf6)"}},Ee=({clauses:s,onInsert:i})=>{const{t:a}=F.useNiceTranslation(),[t,c]=r.useState(""),[l,h]=r.useState("all"),o=s.filter(d=>{const y=t===""||d.name.toLowerCase().includes(t.toLowerCase())||d.content.toLowerCase().includes(t.toLowerCase()),z=l==="all"||d.category===l;return y&&z});return e.jsxs("div",{className:"nice-contract-library",children:[e.jsxs("div",{className:"nice-contract-library-header",children:[e.jsx("h4",{children:a("contractEditor.clauseLibrary","Clause Library")}),e.jsx("input",{type:"text",placeholder:a("contractEditor.searchClauses","Search clauses..."),value:t,onChange:d=>c(d.target.value),className:"nice-contract-library-search"})]}),e.jsxs("div",{className:"nice-contract-library-categories",children:[e.jsx("button",{type:"button",className:`nice-contract-category-btn ${l==="all"?"nice-contract-category-btn--active":""}`,onClick:()=>h("all"),children:a("contractEditor.all","All")}),Object.keys(ce).map(d=>e.jsxs("button",{type:"button",className:`nice-contract-category-btn ${l===d?"nice-contract-category-btn--active":""}`,onClick:()=>h(d),style:{"--cat-color":ce[d].color},children:[ce[d].icon," ",ce[d].label]},d))]}),e.jsxs("div",{className:"nice-contract-library-list",children:[o.map(d=>e.jsxs("div",{className:"nice-contract-library-item",children:[e.jsxs("div",{className:"nice-contract-library-item-header",children:[e.jsx("span",{className:"nice-contract-library-item-name",children:d.name}),e.jsx("span",{className:"nice-contract-library-item-cat",style:{"--cat-color":ce[d.category].color},children:ce[d.category].icon})]}),d.description&&e.jsx("p",{className:"nice-contract-library-item-desc",children:d.description}),e.jsxs("button",{type:"button",className:"nice-contract-library-insert",onClick:()=>i(d),children:[e.jsx(n.NtdPlus,{size:14})," ",a("contractEditor.insert","Insert")]})]},d.id)),o.length===0&&e.jsx("div",{className:"nice-contract-library-empty",children:a("contractEditor.noMatchingClauses","No matching clauses")})]})]})},Le=({variables:s,definitions:i,onChange:a})=>{const{t}=F.useNiceTranslation();return e.jsxs("div",{className:"nice-contract-variables",children:[e.jsx("h4",{children:t("contractEditor.variables","Variables")}),e.jsx("div",{className:"nice-contract-variables-list",children:i.map(c=>e.jsxs("div",{className:"nice-contract-variable",children:[e.jsxs("label",{children:[c.name,c.required&&e.jsx("span",{className:"nice-contract-required",children:"*"})]}),c.type==="select"&&c.options?e.jsxs("select",{value:s[c.name]||c.defaultValue||"",onChange:l=>a(c.name,l.target.value),children:[e.jsx("option",{value:"",children:t("contractEditor.select","Select...")}),c.options.map(l=>e.jsx("option",{value:l,children:l},l))]}):c.type==="date"?e.jsx("input",{type:"date",value:s[c.name]||c.defaultValue||"",onChange:l=>a(c.name,l.target.value)}):e.jsx("input",{type:c.type==="number"||c.type==="currency"?"number":"text",value:s[c.name]||c.defaultValue||"",placeholder:c.placeholder,onChange:l=>a(c.name,l.target.value)})]},c.name))})]})},ze=({section:s,variables:i,readOnly:a,onToggle:t,onRemoveClause:c,onMoveClause:l})=>{const{t:h}=F.useNiceTranslation(),o=d=>d.replace(/\{\{(\w+)\}\}/g,(y,z)=>i[z]||`[${z}]`);return e.jsxs("div",{className:`nice-contract-section ${s.collapsed?"nice-contract-section--collapsed":""}`,children:[e.jsxs("div",{className:"nice-contract-section-header",onClick:t,children:[e.jsx("span",{className:"nice-contract-section-toggle",children:s.collapsed?e.jsx(n.NtdChevronRight,{size:14}):e.jsx(n.NtdChevronDown,{size:14})}),e.jsx("h3",{children:s.title}),e.jsx("span",{className:"nice-contract-section-count",children:h("contractEditor.clauseS","{clauses} clause(s)").replace("{clauses}",String(s.clauses.length))})]}),!s.collapsed&&e.jsxs("div",{className:"nice-contract-section-content",children:[s.clauses.map((d,y)=>e.jsxs("div",{className:"nice-contract-clause",children:[e.jsxs("div",{className:"nice-contract-clause-header",children:[e.jsx("span",{className:"nice-contract-clause-cat",style:{"--cat-color":ce[d.category].color},children:ce[d.category].icon}),e.jsx("span",{className:"nice-contract-clause-name",children:d.name}),d.isRequired&&e.jsx("span",{className:"nice-contract-clause-required",children:h("contractEditor.required","Required")}),!a&&e.jsxs("div",{className:"nice-contract-clause-actions",children:[e.jsx("button",{type:"button",onClick:()=>l(d.id,"up"),disabled:y===0,children:e.jsx(n.NtdArrowUp,{size:14})}),e.jsx("button",{type:"button",onClick:()=>l(d.id,"down"),disabled:y===s.clauses.length-1,children:e.jsx(n.NtdArrowDown,{size:14})}),e.jsx("button",{type:"button",onClick:()=>c(d.id),children:e.jsx(n.NtdClose,{size:14})})]})]}),e.jsx("div",{className:"nice-contract-clause-content",dangerouslySetInnerHTML:{__html:o(d.content)}})]},d.id)),s.clauses.length===0&&e.jsx("div",{className:"nice-contract-section-empty",children:h("contractEditor.noClausesInThisSection","No clauses in this section. Drag clauses here or use the library.")})]})]})},Ae=({workflow:s,onAction:i})=>{const{t:a}=F.useNiceTranslation(),[t,c]=r.useState(null),[l,h]=r.useState("");return e.jsxs("div",{className:"nice-contract-workflow",children:[e.jsx("h4",{children:a("contractEditor.approvalWorkflow","Approval Workflow")}),e.jsx("div",{className:"nice-contract-workflow-steps",children:s.steps.map((o,d)=>e.jsxs("div",{className:`nice-contract-workflow-step nice-contract-workflow-step--${o.status}`,children:[e.jsxs("div",{className:"nice-contract-workflow-step-header",children:[e.jsx("span",{className:"nice-contract-workflow-step-num",children:d+1}),e.jsx("span",{className:"nice-contract-workflow-step-name",children:o.name}),e.jsx("span",{className:`nice-contract-workflow-step-status nice-contract-workflow-step-status--${o.status}`,children:o.status})]}),e.jsx("div",{className:"nice-contract-workflow-approvers",children:o.approvers.map(y=>e.jsxs("div",{className:"nice-contract-approver",children:[y.avatar&&e.jsx("img",{src:y.avatar,alt:"",className:"nice-contract-approver-avatar"}),e.jsx("span",{children:y.name}),e.jsx("span",{className:"nice-contract-approver-role",children:y.role})]},y.id))}),o.status==="pending"&&s.currentStep===d&&e.jsx("div",{className:"nice-contract-workflow-actions",children:t===o.id?e.jsxs(e.Fragment,{children:[e.jsx("textarea",{placeholder:a("contractEditor.commentsOptional","Comments (optional)"),value:l,onChange:y=>h(y.target.value)}),e.jsxs("div",{className:"nice-contract-workflow-btns",children:[e.jsxs("button",{type:"button",className:"nice-contract-btn nice-contract-btn--approve",onClick:()=>{i(o.id,"approve",l),c(null),h("")},children:[e.jsx(n.NtdCheck,{size:14})," ",a("contractEditor.approve","Approve")]}),e.jsxs("button",{type:"button",className:"nice-contract-btn nice-contract-btn--reject",onClick:()=>{i(o.id,"reject",l),c(null),h("")},children:[e.jsx(n.NtdError,{size:14})," ",a("contractEditor.reject","Reject")]}),e.jsx("button",{type:"button",onClick:()=>c(null),children:a("contractEditor.cancel","Cancel")})]})]}):e.jsx("button",{type:"button",className:"nice-contract-btn",onClick:()=>c(o.id),children:a("contractEditor.review","Review")})})]},o.id))})]})},_e=Object.assign(r.forwardRef(({document:s,clauseLibrary:i=[],readOnly:a=!1,showClauseLibrary:t=!0,showVersionHistory:c=!1,showComments:l=!1,showWorkflow:h=!0,currentUser:o,onChange:d,onAddClause:y,onRemoveClause:z,onVariableChange:_,onAddComment:k,onApprovalAction:E,onRestoreVersion:P,onSave:Y,onExport:D,className:O="",style:ee,tutorial:$},q)=>{var G;const{t:L}=F.useNiceTranslation(),[x,b]=r.useState(s),[g,V]=r.useState(t?"library":null),[m,H]=r.useState(((G=x.sections[0])==null?void 0:G.id)||null),R=x.sections.flatMap(j=>j.clauses.flatMap(S=>S.variables||[])).filter((j,S,M)=>M.findIndex(K=>K.name===j.name)===S),w=r.useCallback(j=>{const S={...x,...j,updatedAt:new Date};b(S),d==null||d(S)},[x,d]),B=r.useCallback((j,S)=>{const M=x.sections.map(K=>K.id===S?{...K,clauses:[...K.clauses,{...j,id:`${j.id}-${Date.now()}`}]}:K);w({sections:M}),y==null||y(j,S)},[x,w,y]),U=r.useCallback((j,S)=>{const M=x.sections.map(K=>K.id===S?{...K,clauses:K.clauses.filter(Z=>Z.id!==j)}:K);w({sections:M}),z==null||z(j,S)},[x,w,z]),N=r.useCallback((j,S,M)=>{const K=x.sections.map(Z=>{if(Z.id!==j)return Z;const u=Z.clauses.findIndex(Q=>Q.id===S);if(u===-1)return Z;const p=M==="up"?u-1:u+1;if(p<0||p>=Z.clauses.length)return Z;const f=[...Z.clauses];return[f[u],f[p]]=[f[p],f[u]],{...Z,clauses:f}});w({sections:K})},[x,w]),C=r.useCallback(j=>{const S=x.sections.map(M=>M.id===j?{...M,collapsed:!M.collapsed}:M);w({sections:S})},[x,w]),A=r.useCallback((j,S)=>{w({variables:{...x.variables,[j]:S}}),_==null||_(j,S)},[x,w,_]),J=r.useCallback(()=>{const j=[];return R.forEach(S=>{S.required&&!x.variables[S.name]&&j.push(`Missing required variable: ${S.name}`)}),x.sections.forEach(S=>{S.clauses.forEach(M=>{M.isRequired&&!M.content&&j.push(`Required clause "${M.name}" is empty`)})}),{valid:j.length===0,errors:j}},[x,R]);r.useImperativeHandle(q,()=>({getDocument:()=>x,insertClause:B,setVariable:A,exportDocument:j=>D==null?void 0:D(j),validate:J}));const v=De[x.status],T=e.jsxs("div",{className:"nice-contract-header",children:[e.jsxs("div",{className:"nice-contract-header-info",children:[e.jsx("h2",{className:"nice-contract-title",children:x.title}),e.jsx("span",{className:"nice-contract-status",style:{"--status-color":v.color},children:v.label})]}),e.jsxs("div",{className:"nice-contract-header-actions",children:[Y&&!a&&e.jsx("button",{type:"button",className:"nice-contract-btn nice-contract-btn--primary",onClick:()=>Y(x),children:L("contractEditor.save","Save")}),D&&e.jsxs("div",{className:"nice-contract-export-dropdown",children:[e.jsxs("button",{type:"button",className:"nice-contract-btn",children:[L("contractEditor.export","Export")," ",e.jsx(n.NtdChevronDown,{size:14})]}),e.jsxs("div",{className:"nice-contract-export-menu",children:[e.jsx("button",{type:"button",onClick:()=>D("pdf"),children:"PDF"}),e.jsx("button",{type:"button",onClick:()=>D("docx"),children:"Word (.docx)"}),e.jsx("button",{type:"button",onClick:()=>D("html"),children:L("contractEditor.html","HTML")})]})]})]})]}),W=e.jsxs("div",{className:"nice-contract-toolbar",children:[t&&e.jsxs("button",{type:"button",className:`nice-contract-toolbar-btn ${g==="library"?"nice-contract-toolbar-btn--active":""}`,onClick:()=>V(g==="library"?null:"library"),children:[e.jsx(n.NtdBook,{size:16})," ",L("contractEditor.library","Library")]}),e.jsxs("button",{type:"button",className:`nice-contract-toolbar-btn ${g==="variables"?"nice-contract-toolbar-btn--active":""}`,onClick:()=>V(g==="variables"?null:"variables"),children:[e.jsx(n.NtdBrackets,{size:16})," ",L("contractEditor.variables","Variables")]}),h&&x.workflow&&e.jsxs("button",{type:"button",className:`nice-contract-toolbar-btn ${g==="workflow"?"nice-contract-toolbar-btn--active":""}`,onClick:()=>V(g==="workflow"?null:"workflow"),children:[e.jsx(n.NtdCheck,{size:16})," ",L("contractEditor.workflow","Workflow")]}),c&&e.jsxs("button",{type:"button",className:`nice-contract-toolbar-btn ${g==="history"?"nice-contract-toolbar-btn--active":""}`,onClick:()=>V(g==="history"?null:"history"),children:[e.jsx(n.NtdClock,{size:16})," ",L("contractEditor.history","History")]})]}),X=g?e.jsxs("div",{className:"nice-contract-panel",children:[g==="library"&&e.jsx(Ee,{clauses:i,onInsert:j=>m&&B(j,m)}),g==="variables"&&e.jsx(Le,{variables:x.variables,definitions:R,onChange:A}),g==="workflow"&&x.workflow&&e.jsx(Ae,{workflow:x.workflow,onAction:(j,S,M)=>E==null?void 0:E(j,S,M)})]}):void 0;return e.jsx(F.NiceAppShell,{flush:!0,className:`nice-contract-editor ${O}`,style:ee,menubar:T,toolbar:W,sidebar:X,children:e.jsxs("div",{className:"nice-contract-document",children:[e.jsx("span",{style:{position:"absolute",top:6,right:6,zIndex:30},children:e.jsx(F.NiceTutorialButton,{steps:F.resolveTutorial($,Te)})}),x.sections.map(j=>e.jsx(ze,{section:j,variables:x.variables,readOnly:a,onToggle:()=>C(j.id),onRemoveClause:S=>U(S,j.id),onMoveClause:(S,M)=>N(j.id,S,M)},j.id))]})})}),{displayName:"NiceContractEditor"}),Ie=[{id:"necessary",label:"Necessary",description:"Essential cookies for site functionality. Cannot be disabled.",required:!0,enabled:!0,cookies:["session_id","csrf_token","consent"]},{id:"analytics",label:"Analytics",description:"Help us understand how visitors interact with our website.",enabled:!1,cookies:["_ga","_gid","_gat"],partners:["Google Analytics","Hotjar"]},{id:"marketing",label:"Marketing",description:"Used to deliver personalized advertisements.",enabled:!1,cookies:["_fbp","_gcl_au","ads_id"],partners:["Facebook","Google Ads","LinkedIn"]},{id:"preferences",label:"Preferences",description:"Remember your settings and preferences.",enabled:!1,cookies:["theme","language","timezone"]},{id:"social",label:"Social Media",description:"Enable social sharing and embedded content.",enabled:!1,cookies:["social_session"],partners:["Twitter","YouTube","Instagram"]}],Re={title:"Cookie Preferences",description:"We use cookies to enhance your experience. Choose which types of cookies you allow.",acceptAll:"Accept All",rejectAll:"Reject All",customize:"Customize",savePreferences:"Save Preferences",necessary:"Necessary",analytics:"Analytics",marketing:"Marketing",preferences:"Preferences",social:"Social Media",dataRights:"Your Data Rights",exportData:"Export My Data",deleteData:"Delete My Data",pending:"Pending",processing:"Processing",completed:"Completed",close:"Close"},Fe=({option:s,enabled:i,onChange:a})=>{const{t}=F.useNiceTranslation();return e.jsxs("div",{className:"nice-gdpr-option",children:[e.jsxs("div",{className:"nice-gdpr-option-header",children:[e.jsxs("label",{className:"nice-gdpr-option-toggle",children:[e.jsx("input",{type:"checkbox",checked:i,onChange:c=>a(c.target.checked),disabled:s.required}),e.jsx("span",{className:"nice-gdpr-toggle-slider"})]}),e.jsxs("div",{className:"nice-gdpr-option-info",children:[e.jsxs("span",{className:"nice-gdpr-option-label",children:[s.label,s.required&&e.jsx("span",{className:"nice-gdpr-required",children:t("gdprConsent.required","Required")})]}),e.jsx("span",{className:"nice-gdpr-option-desc",children:s.description})]})]}),s.partners&&s.partners.length>0&&e.jsxs("div",{className:"nice-gdpr-option-partners",children:[e.jsxs("span",{children:[t("gdprConsent.partners","Partners:")," "]}),s.partners.join(", ")]})]})},Pe=({requests:s,policies:i,onRequest:a,onDownload:t,labels:c})=>{const{t:l}=F.useNiceTranslation();return e.jsxs("div",{className:"nice-gdpr-rights",children:[e.jsx("h4",{children:c.dataRights}),e.jsxs("div",{className:"nice-gdpr-rights-actions",children:[e.jsxs("button",{type:"button",className:"nice-gdpr-btn nice-gdpr-btn--secondary",onClick:()=>a("export"),children:[e.jsx(n.NtdDownload,{size:16})," ",c.exportData]}),e.jsxs("button",{type:"button",className:"nice-gdpr-btn nice-gdpr-btn--danger",onClick:()=>a("delete"),children:[e.jsx(n.NtdTrash,{size:16})," ",c.deleteData]})]}),s.length>0&&e.jsxs("div",{className:"nice-gdpr-requests",children:[e.jsx("h5",{children:l("gdprConsent.previousRequests","Previous Requests")}),s.map(h=>e.jsxs("div",{className:`nice-gdpr-request nice-gdpr-request--${h.status}`,children:[e.jsx("span",{className:"nice-gdpr-request-type",children:h.type}),e.jsx("span",{className:"nice-gdpr-request-date",children:new Date(h.requestedAt).toLocaleDateString()}),e.jsx("span",{className:"nice-gdpr-request-status",children:h.status}),h.status==="completed"&&h.downloadUrl&&e.jsx("button",{type:"button",className:"nice-gdpr-download-btn",onClick:()=>t(h.id),children:l("gdprConsent.download","Download")})]},h.id))]}),i.length>0&&e.jsxs("div",{className:"nice-gdpr-policies",children:[e.jsx("h5",{children:l("gdprConsent.dataRetention","Data Retention")}),e.jsxs("table",{className:"nice-gdpr-policies-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:l("gdprConsent.category","Category")}),e.jsx("th",{children:l("gdprConsent.retention","Retention")}),e.jsx("th",{children:l("gdprConsent.legalBasis","Legal Basis")})]})}),e.jsx("tbody",{children:i.map((h,o)=>e.jsxs("tr",{children:[e.jsx("td",{children:h.category}),e.jsx("td",{children:l("gdprConsent.days","{retentionDays} days").replace("{retentionDays}",String(h.retentionDays))}),e.jsx("td",{children:h.legalBasis})]},o))})]})]})]})},Oe=Object.assign(r.forwardRef(({appName:s,companyName:i,options:a=Ie,currentConsent:t=null,retentionPolicies:c=[],dataRequests:l=[],privacyPolicy:h=[],storageKey:o="nice_gdpr_consent",consentVersion:d="1.0",variant:y="banner",position:z="bottom",onConsentChange:_,onDataRequest:k,onDownloadExport:E,privacyPolicyUrl:P,cookiePolicyUrl:Y,termsUrl:D,labels:O,className:ee="",style:$},q)=>{const{t:L}=F.useNiceTranslation(),x={...Re,...O},[b,g]=r.useState(!1),[V,m]=r.useState(!1),[H,I]=r.useState(!1),[R,w]=r.useState(()=>{const v={};return a.forEach(T=>{v[T.id]=(t==null?void 0:t.categories[T.id])??T.enabled}),v});r.useEffect(()=>{(!t||t.version!==d)&&g(!0)},[t,d]);const B=r.useCallback((v,T)=>{const W=T||R;W.necessary=!0;const X={version:d,timestamp:new Date,categories:W,action:v};try{localStorage.setItem(o,JSON.stringify(X))}catch{}w(W),g(!1),m(!1),_==null||_(X)},[R,d,o,_]),U=r.useCallback(()=>{const v={};a.forEach(T=>{v[T.id]=!0}),B("accept_all",v)},[a,B]),N=r.useCallback(()=>{const v={};a.forEach(T=>{v[T.id]=T.required||!1}),B("reject_all",v)},[a,B]),C=r.useCallback(async v=>{k&&await k(v)},[k]);if(r.useImperativeHandle(q,()=>({showBanner:()=>g(!0),hideBanner:()=>g(!1),getConsent:()=>{try{const v=localStorage.getItem(o);return v?JSON.parse(v):null}catch{return null}},revokeConsent:()=>{try{localStorage.removeItem(o)}catch{}g(!0)},openPreferences:()=>{g(!0),m(!0)}})),!b&&y!=="embedded")return null;const A=e.jsxs("div",{className:"nice-gdpr-content",children:[e.jsxs("div",{className:"nice-gdpr-header",children:[e.jsx("div",{className:"nice-gdpr-icon",children:e.jsx(n.NtdCookieConsent,{size:32})}),e.jsxs("div",{className:"nice-gdpr-header-text",children:[e.jsx("h3",{children:x.title}),e.jsx("p",{children:x.description.replace("{app}",s).replace("{company}",i)})]})]}),!V&&!H&&e.jsxs("div",{className:"nice-gdpr-quick-actions",children:[e.jsx("button",{type:"button",className:"nice-gdpr-btn nice-gdpr-btn--primary",onClick:U,children:x.acceptAll}),e.jsx("button",{type:"button",className:"nice-gdpr-btn nice-gdpr-btn--secondary",onClick:N,children:x.rejectAll}),e.jsx("button",{type:"button",className:"nice-gdpr-btn nice-gdpr-btn--link",onClick:()=>m(!0),children:x.customize})]}),V&&!H&&e.jsxs("div",{className:"nice-gdpr-preferences",children:[e.jsx("div",{className:"nice-gdpr-options",children:a.map(v=>e.jsx(Fe,{option:v,enabled:R[v.id],onChange:T=>w(W=>({...W,[v.id]:T}))},v.id))}),e.jsxs("div",{className:"nice-gdpr-pref-actions",children:[e.jsx("button",{type:"button",className:"nice-gdpr-btn nice-gdpr-btn--primary",onClick:()=>B("custom"),children:x.savePreferences}),e.jsx("button",{type:"button",className:"nice-gdpr-btn nice-gdpr-btn--link",onClick:()=>I(!0),children:x.dataRights})]})]}),H&&e.jsxs(e.Fragment,{children:[e.jsx(Pe,{requests:l,policies:c,onRequest:C,onDownload:v=>E==null?void 0:E(v),labels:x}),e.jsxs("button",{type:"button",className:"nice-gdpr-btn nice-gdpr-btn--link",onClick:()=>I(!1),children:[e.jsx(n.NtdArrowLeft,{size:14})," ",L("gdprConsent.backToPreferences","Back to preferences")]})]}),e.jsxs("div",{className:"nice-gdpr-footer",children:[P&&e.jsx("a",{href:P,target:"_blank",rel:"noopener noreferrer",children:L("gdprConsent.privacyPolicy","Privacy Policy")}),Y&&e.jsx("a",{href:Y,target:"_blank",rel:"noopener noreferrer",children:L("gdprConsent.cookiePolicy","Cookie Policy")}),D&&e.jsx("a",{href:D,target:"_blank",rel:"noopener noreferrer",children:L("gdprConsent.termsOfService","Terms of Service")})]})]}),J=`nice-gdpr-consent nice-gdpr-consent--${y} nice-gdpr-consent--${z} ${ee}`;return y==="modal"?e.jsx("div",{className:"nice-gdpr-overlay",children:e.jsx("div",{className:J,style:$,role:"dialog","aria-modal":"true",children:A})}):e.jsx("div",{className:J,style:$,children:A})}),{displayName:"NiceGDPRConsent"}),$e=[],me={document:e.jsx(n.NtdFileText,{size:16}),user:e.jsx(n.NtdUser,{size:16}),task:e.jsx(n.NtdCheck,{size:16}),project:e.jsx(n.NtdFolder,{size:16}),setting:e.jsx(n.NtdSettings,{size:16}),help:e.jsx(n.NtdHelp,{size:16}),action:e.jsx(n.NtdZap,{size:16}),custom:e.jsx(n.NtdCircle,{size:16})},Me=({value:s,onChange:i,onKeyDown:a,placeholder:t,isLoading:c,inputRef:l})=>{const{t:h}=F.useNiceTranslation();return e.jsxs("div",{className:"nice-search-input-container",children:[e.jsx("span",{className:"nice-search-icon",children:e.jsx(n.NtdSearch,{size:16})}),e.jsx("input",{ref:l,type:"text",className:"nice-search-input",placeholder:t,value:s,onChange:o=>i(o.target.value),onKeyDown:a,"aria-label":h("globalSearch.search","Search")}),c&&e.jsx("span",{className:"nice-search-loader"}),s&&!c&&e.jsx("button",{type:"button",className:"nice-search-clear",onClick:()=>i(""),"aria-label":h("globalSearch.clearSearch","Clear search"),children:e.jsx(n.NtdClose,{size:16})})]})},Ue=({result:s,isSelected:i,onSelect:a,renderResult:t})=>t?e.jsx("div",{onClick:a,children:t(s,i)}):e.jsxs("div",{className:`nice-search-result ${i?"nice-search-result--selected":""}`,onClick:a,role:"option","aria-selected":i,children:[e.jsx("div",{className:"nice-search-result-icon",children:s.icon||(s.image?e.jsx("img",{src:s.image,alt:""}):me[s.type])}),e.jsxs("div",{className:"nice-search-result-content",children:[e.jsx("span",{className:"nice-search-result-title",children:s.title}),s.subtitle&&e.jsx("span",{className:"nice-search-result-subtitle",children:s.subtitle}),s.description&&e.jsx("span",{className:"nice-search-result-desc",children:s.description})]}),e.jsxs("div",{className:"nice-search-result-meta",children:[e.jsx("span",{className:"nice-search-result-source",children:s.source}),e.jsx("span",{className:"nice-search-result-type",children:s.type})]}),s.actions&&s.actions.length>0&&e.jsx("div",{className:"nice-search-result-actions",children:s.actions.map(c=>e.jsx("button",{type:"button",className:"nice-search-action-btn",onClick:l=>{l.stopPropagation(),c.onClick()},title:c.label,children:c.icon||c.label},c.id))})]}),Ye=({categories:s,selected:i,onSelect:a})=>{const{t}=F.useNiceTranslation();return e.jsxs("div",{className:"nice-search-categories",children:[e.jsx("button",{type:"button",className:`nice-search-category ${i===null?"nice-search-category--active":""}`,onClick:()=>a(null),children:t("globalSearch.all","All")}),s.map(c=>e.jsxs("button",{type:"button",className:`nice-search-category ${i===c.id?"nice-search-category--active":""}`,onClick:()=>a(c.id),children:[c.icon&&e.jsx("span",{className:"nice-search-category-icon",children:c.icon}),c.label,c.count!==void 0&&e.jsx("span",{className:"nice-search-category-count",children:c.count})]},c.id))]})},qe=({searches:s,onSelect:i,onClear:a,label:t,clearLabel:c})=>e.jsxs("div",{className:"nice-search-recent",children:[e.jsxs("div",{className:"nice-search-recent-header",children:[e.jsx("span",{children:t}),e.jsx("button",{type:"button",onClick:a,children:c})]}),e.jsx("div",{className:"nice-search-recent-list",children:s.map((l,h)=>e.jsxs("button",{type:"button",className:"nice-search-recent-item",onClick:()=>i(l.query),children:[e.jsx("span",{className:"nice-search-recent-icon",children:e.jsx(n.NtdClock,{size:14})}),e.jsx("span",{className:"nice-search-recent-query",children:l.query})]},h))})]}),Ve={placeholder:"Search...",recent:"Recent Searches",noResults:"No results found for",searching:"Searching...",clearRecent:"Clear",categories:"Categories",filters:"Filters"},He=Object.assign(r.forwardRef(({sources:s=$e,placeholder:i,minQueryLength:a=2,debounceMs:t=300,showCategories:c=!0,filters:l=[],showRecent:h=!0,maxRecent:o=5,showShortcuts:d=!0,hotkey:y="k",onResultSelect:z,onSearch:_,onClose:k,renderResult:E,renderEmpty:P,defaultOpen:Y=!1,open:D,variant:O="modal",labels:ee,className:$="",style:q},L)=>{const{t:x}=F.useNiceTranslation(),b={...Ve,...ee},g=r.useRef(null),V=r.useRef(void 0),[m,H]=r.useState(Y),[I,R]=r.useState(""),[w,B]=r.useState([]),[U,N]=r.useState(!1),[C,A]=r.useState(0),[J,v]=r.useState(null),[T,W]=r.useState([]),X=D!==void 0?D:m;r.useEffect(()=>{try{const p=localStorage.getItem("nice_recent_searches");p&&W(JSON.parse(p))}catch{}},[]);const G=r.useCallback((p,f)=>{const se=[{query:p,timestamp:new Date,resultCount:f},...T.filter(ne=>ne.query!==p)].slice(0,o);W(se);try{localStorage.setItem("nice_recent_searches",JSON.stringify(se))}catch{}},[T,o]),j=r.useCallback(async p=>{if(p.length<a){B([]);return}N(!0);try{const f=s.map(async se=>{try{return(await se.search(p)).map(oe=>({...oe,source:se.name,relevanceScore:oe.relevanceScore*(se.priority||1)}))}catch{return[]}}),Q=(await Promise.all(f)).flat();Q.sort((se,ne)=>ne.relevanceScore-se.relevanceScore),B(Q),A(0),_==null||_(p,Q),Q.length>0&&G(p,Q.length)}finally{N(!1)}},[s,a,_,G]),S=r.useCallback(p=>{R(p),V.current&&clearTimeout(V.current),V.current=setTimeout(()=>{j(p)},t)},[j,t]),M=r.useCallback(p=>{switch(p.key){case"ArrowDown":p.preventDefault(),A(f=>Math.min(f+1,w.length-1));break;case"ArrowUp":p.preventDefault(),A(f=>Math.max(f-1,0));break;case"Enter":p.preventDefault(),w[C]&&(z==null||z(w[C]),H(!1),k==null||k());break;case"Escape":p.preventDefault(),H(!1),k==null||k();break}},[w,C,z,k]);r.useEffect(()=>{const p=f=>{(f.metaKey||f.ctrlKey)&&f.key===y&&(f.preventDefault(),H(!0),setTimeout(()=>{var Q;return(Q=g.current)==null?void 0:Q.focus()},0))};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[y]),r.useEffect(()=>{X&&setTimeout(()=>{var p;return(p=g.current)==null?void 0:p.focus()},0)},[X]);const K=J?w.filter(p=>p.type===J):w,Z=Array.from(new Set(w.map(p=>p.type))).map(p=>({id:p,label:p.charAt(0).toUpperCase()+p.slice(1),icon:me[p],count:w.filter(f=>f.type===p).length}));if(r.useImperativeHandle(L,()=>({open:()=>H(!0),close:()=>{H(!1),k==null||k()},focus:()=>{var p;return(p=g.current)==null?void 0:p.focus()},clear:()=>{R(""),B([])},search:async p=>{R(p),await j(p)}})),!X&&O!=="inline")return null;const u=e.jsxs("div",{className:"nice-search-content",children:[e.jsx(Me,{value:I,onChange:S,onKeyDown:M,placeholder:i||b.placeholder,isLoading:U,inputRef:g}),c&&Z.length>1&&I.length>=a&&e.jsx(Ye,{categories:Z,selected:J,onSelect:v}),e.jsxs("div",{className:"nice-search-results",role:"listbox",children:[U&&I.length>=a&&e.jsx("div",{className:"nice-search-loading",children:b.searching}),!U&&I.length>=a&&K.length===0&&e.jsx("div",{className:"nice-search-empty",children:P?P(I):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"nice-search-empty-icon",children:e.jsx(n.NtdSearch,{size:32})}),e.jsxs("span",{children:[b.noResults,' "',I,'"']})]})}),K.map((p,f)=>e.jsx(Ue,{result:p,isSelected:f===C,onSelect:()=>{z==null||z(p),H(!1),k==null||k()},renderResult:E},p.id))]}),h&&I.length<a&&T.length>0&&e.jsx(qe,{searches:T,onSelect:p=>{R(p),j(p)},onClear:()=>{W([]),localStorage.removeItem("nice_recent_searches")},label:b.recent,clearLabel:b.clearRecent}),d&&e.jsxs("div",{className:"nice-search-shortcuts",children:[e.jsxs("span",{children:[e.jsx("kbd",{children:e.jsx(F.NiceIcon,{name:"arrow-up",size:12})}),e.jsx("kbd",{children:e.jsx(F.NiceIcon,{name:"arrow-down",size:12})})," ",x("globalSearch.navigate","Navigate")]}),e.jsxs("span",{children:[e.jsx("kbd",{children:"↵"})," ",x("globalSearch.select","Select")]}),e.jsxs("span",{children:[e.jsx("kbd",{children:"Esc"})," ",x("globalSearch.close","Close")]})]})]});return O==="modal"?e.jsx("div",{className:"nice-search-overlay",onClick:()=>{H(!1),k==null||k()},children:e.jsx("div",{className:`nice-global-search nice-global-search--modal ${$}`,style:q,onClick:p=>p.stopPropagation(),role:"dialog","aria-modal":"true",children:u})}):e.jsx("div",{className:`nice-global-search nice-global-search--${O} ${$}`,style:q,children:u})}),{displayName:"NiceGlobalSearch"}),Be=[],ae={title:"Access Log",filters:"Filters",search:"Search users, IPs...",export:"Export",refresh:"Refresh",details:"Details",stats:"Statistics",map:"Geographic Distribution",timeline:"Timeline",showMore:"Show More",noResults:"No access logs found",eventTypes:{login_success:"Login Success",login_failed:"Login Failed",logout:"Logout",password_change:"Password Change",password_reset:"Password Reset",mfa_enabled:"MFA Enabled",mfa_disabled:"MFA Disabled",mfa_challenged:"MFA Challenge",permission_change:"Permission Change",session_expired:"Session Expired",account_locked:"Account Locked",account_unlocked:"Account Unlocked",api_key_created:"API Key Created",api_key_revoked:"API Key Revoked",token_refresh:"Token Refresh",suspicious_activity:"Suspicious Activity"},riskLevels:{low:"Low",medium:"Medium",high:"High",critical:"Critical"},deviceTypes:{desktop:"Desktop",mobile:"Mobile",tablet:"Tablet",unknown:"Unknown"},columns:{timestamp:"Time",user:"User",event:"Event",ip:"IP Address",location:"Location",device:"Device",risk:"Risk",status:"Status"}},le={login_success:e.jsx(n.NtdCheck,{size:16}),login_failed:e.jsx(n.NtdError,{size:16}),logout:e.jsx(n.NtdLogOut,{size:16}),password_change:e.jsx(n.NtdKey,{size:16}),password_reset:e.jsx(n.NtdRefresh,{size:16}),mfa_enabled:e.jsx(n.NtdShield,{size:16}),mfa_disabled:e.jsx(n.NtdWarning,{size:16}),mfa_challenged:e.jsx(n.NtdSmartphone,{size:16}),permission_change:e.jsx(n.NtdUser,{size:16}),session_expired:e.jsx(n.NtdClock,{size:16}),account_locked:e.jsx(n.NtdLock,{size:16}),account_unlocked:e.jsx(n.NtdUnlock,{size:16}),api_key_created:e.jsx(n.NtdKey,{size:16}),api_key_revoked:e.jsx(n.NtdError,{size:16}),token_refresh:e.jsx(n.NtdRefresh,{size:16}),suspicious_activity:e.jsx(n.NtdZap,{size:16})},ie={low:"var(--nice-color-success, #22c55e)",medium:"var(--nice-color-warning, #f59e0b)",high:"var(--nice-color-error, #ef4444)",critical:"var(--nice-color-accent-hover, #7c3aed)"},de={desktop:e.jsx(n.NtdMonitor,{size:16}),mobile:e.jsx(n.NtdSmartphone,{size:16}),tablet:e.jsx(n.NtdSmartphone,{size:16}),unknown:e.jsx(n.NtdHelp,{size:16})},ue=s=>(typeof s=="string"?new Date(s):s).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),he=s=>{if(!s)return"Unknown";const i=[];return s.city&&i.push(s.city),s.country&&i.push(s.country),i.length>0?i.join(", "):"Unknown"},Je=s=>{if(!s)return"Unknown";const i=[];return s.browser&&i.push(s.browser),s.os&&i.push(s.os),i.length>0?i.join(" / "):s.type},pe=s=>s>=80?ie.critical:s>=60?ie.high:s>=40?ie.medium:ie.low,Ge=(s,i)=>{var a,t,c,l,h;if(i.startDate){const o=typeof i.startDate=="string"?new Date(i.startDate):i.startDate;if((typeof s.timestamp=="string"?new Date(s.timestamp):s.timestamp)<o)return!1}if(i.endDate){const o=typeof i.endDate=="string"?new Date(i.endDate):i.endDate;if((typeof s.timestamp=="string"?new Date(s.timestamp):s.timestamp)>o)return!1}if((a=i.eventTypes)!=null&&a.length&&!i.eventTypes.includes(s.eventType)||(t=i.riskLevels)!=null&&t.length&&!i.riskLevels.includes(s.riskLevel)||i.userId&&s.userId!==i.userId||i.ipAddress&&!s.ipAddress.includes(i.ipAddress)||i.country&&((c=s.location)==null?void 0:c.country)!==i.country||i.successOnly&&!s.success||i.failedOnly&&s.success)return!1;if(i.searchQuery){const o=i.searchQuery.toLowerCase();if(![s.userName,s.userEmail,s.userId,s.ipAddress,(l=s.location)==null?void 0:l.city,(h=s.location)==null?void 0:h.country].filter(Boolean).join(" ").toLowerCase().includes(o))return!1}return!0},Ke=Object.assign(r.forwardRef(function(i,a){var K,Z;const{t}=F.useNiceTranslation(),{entries:c=Be,filter:l={},stats:h,realtime:o=!1,pollingInterval:d=3e4,showMap:y=!1,showStats:z=!0,showDetails:_=!0,pageSize:k=50,labels:E,loading:P=!1,onFilterChange:Y,onExport:D,onEntrySelect:O,onBlockIP:ee,onRefresh:$,className:q="",...L}=i,x=r.useRef(null);r.useId();const b=r.useMemo(()=>({...ae,...E,eventTypes:{...ae.eventTypes,...E==null?void 0:E.eventTypes},riskLevels:{...ae.riskLevels,...E==null?void 0:E.riskLevels},deviceTypes:{...ae.deviceTypes,...E==null?void 0:E.deviceTypes},columns:{...ae.columns,...E==null?void 0:E.columns}}),[E]),[g,V]=r.useState(l),[m,H]=r.useState(null),[I,R]=r.useState(k),[w,B]=r.useState(!1),[U,N]=r.useState("table"),C=r.useMemo(()=>c.filter(u=>Ge(u,g)),[c,g]),A=r.useMemo(()=>C.slice(0,I),[C,I]),J=r.useMemo(()=>{if(h)return h;const u=new Set(c.map(f=>f.ipAddress)),p=new Set(c.map(f=>{var Q;return(Q=f.location)==null?void 0:Q.country}).filter(Boolean));return{totalEvents:c.length,successfulLogins:c.filter(f=>f.eventType==="login_success").length,failedLogins:c.filter(f=>f.eventType==="login_failed").length,uniqueIPs:u.size,uniqueCountries:p.size,highRiskEvents:c.filter(f=>f.riskLevel==="high"||f.riskLevel==="critical").length,suspiciousActivities:c.filter(f=>f.eventType==="suspicious_activity").length}},[c,h]),v=r.useCallback(u=>{const p={...g,...u};V(p),R(k),Y==null||Y(p)},[g,Y,k]),T=r.useCallback(()=>{V({}),R(k),Y==null||Y({})},[Y,k]),W=r.useCallback(u=>{H(u),O==null||O(u)},[O]),X=r.useCallback(u=>{D==null||D(u)},[D]),G=r.useCallback(()=>{$==null||$()},[$]),j=r.useCallback(()=>{R(u=>u+k)},[k]);r.useImperativeHandle(a,()=>({getFilter:()=>g,applyFilter:v,clearFilters:T,export:X,refresh:G,getSelectedEntry:()=>m,getElement:()=>x.current}),[g,v,T,X,G,m]);const S=u=>{var p,f;return e.jsxs("tr",{className:`nice-accesslog-row ${(m==null?void 0:m.id)===u.id?"nice-accesslog-row--selected":""} ${u.success?"":"nice-accesslog-row--failed"}`,onClick:()=>W(u),children:[e.jsx("td",{className:"nice-accesslog-cell nice-accesslog-cell--timestamp",children:ue(u.timestamp)}),e.jsx("td",{className:"nice-accesslog-cell nice-accesslog-cell--user",children:e.jsxs("div",{className:"nice-accesslog-user",children:[e.jsx("span",{className:"nice-accesslog-username",children:u.userName||u.userId}),u.userEmail&&e.jsx("span",{className:"nice-accesslog-email",children:u.userEmail})]})}),e.jsx("td",{className:"nice-accesslog-cell nice-accesslog-cell--event",children:e.jsxs("span",{className:`nice-accesslog-event nice-accesslog-event--${u.eventType}`,children:[e.jsx("span",{className:"nice-accesslog-event-icon",children:le[u.eventType]}),b.eventTypes[u.eventType]]})}),e.jsxs("td",{className:"nice-accesslog-cell nice-accesslog-cell--ip",children:[e.jsx("span",{className:"nice-accesslog-ip",children:u.ipAddress}),ee&&e.jsx("button",{type:"button",className:"nice-accesslog-block-btn",onClick:Q=>{Q.stopPropagation(),ee(u.ipAddress)},title:t("accessLog.blockIp","Block IP"),children:e.jsx(n.NtdSlash,{size:14})})]}),e.jsxs("td",{className:"nice-accesslog-cell nice-accesslog-cell--location",children:[((p=u.location)==null?void 0:p.countryCode)&&e.jsx("span",{className:"nice-accesslog-flag",children:e.jsx(n.NtdFlag,{size:14})}),he(u.location)]}),e.jsx("td",{className:"nice-accesslog-cell nice-accesslog-cell--device",children:e.jsxs("span",{className:"nice-accesslog-device",children:[de[((f=u.device)==null?void 0:f.type)||"unknown"],Je(u.device)]})}),e.jsx("td",{className:"nice-accesslog-cell nice-accesslog-cell--risk",children:e.jsxs("span",{className:`nice-accesslog-risk nice-accesslog-risk--${u.riskLevel}`,style:{"--risk-color":pe(u.riskScore)},children:[e.jsx("span",{className:"nice-accesslog-risk-score",children:u.riskScore}),e.jsx("span",{className:"nice-accesslog-risk-label",children:b.riskLevels[u.riskLevel]})]})}),e.jsx("td",{className:"nice-accesslog-cell nice-accesslog-cell--status",children:e.jsx("span",{className:`nice-accesslog-status ${u.success?"nice-accesslog-status--success":"nice-accesslog-status--failed"}`,children:u.success?e.jsx(n.NtdCheck,{size:14}):e.jsx(n.NtdError,{size:14})})})]},u.id)},M=u=>e.jsxs("div",{className:`nice-accesslog-timeline-item nice-accesslog-timeline-item--${u.riskLevel}`,onClick:()=>W(u),children:[e.jsx("div",{className:"nice-accesslog-timeline-marker",style:{background:ie[u.riskLevel]}}),e.jsxs("div",{className:"nice-accesslog-timeline-content",children:[e.jsxs("div",{className:"nice-accesslog-timeline-header",children:[e.jsxs("span",{className:"nice-accesslog-timeline-event",children:[le[u.eventType]," ",b.eventTypes[u.eventType]]}),e.jsx("span",{className:"nice-accesslog-timeline-time",children:ue(u.timestamp)})]}),e.jsxs("div",{className:"nice-accesslog-timeline-details",children:[e.jsx("span",{children:u.userName||u.userId}),e.jsx("span",{children:"•"}),e.jsx("span",{children:u.ipAddress}),e.jsx("span",{children:"•"}),e.jsx("span",{children:he(u.location)})]}),u.flags&&u.flags.length>0&&e.jsx("div",{className:"nice-accesslog-timeline-flags",children:u.flags.map((p,f)=>e.jsx("span",{className:"nice-accesslog-flag-badge",children:p},f))})]})]},u.id);return e.jsxs("div",{ref:x,className:`nice-accesslog ${q}`,...L,children:[e.jsxs("div",{className:"nice-accesslog-header",children:[e.jsxs("div",{className:"nice-accesslog-header-left",children:[e.jsx("h2",{className:"nice-accesslog-title",children:b.title}),o&&e.jsxs("span",{className:"nice-accesslog-realtime-badge",children:[e.jsx(n.NtdCircle,{size:10})," ",t("accessLog.live","Live")]})]}),e.jsxs("div",{className:"nice-accesslog-header-actions",children:[e.jsxs("button",{type:"button",className:"nice-accesslog-btn",onClick:G,disabled:P,children:[e.jsx(n.NtdRefresh,{size:16})," ",b.refresh]}),e.jsxs("div",{className:"nice-accesslog-export-dropdown",children:[e.jsxs("button",{type:"button",className:"nice-accesslog-btn",children:[e.jsx(n.NtdDownload,{size:16})," ",b.export]}),e.jsxs("div",{className:"nice-accesslog-export-menu",children:[e.jsx("button",{onClick:()=>X("csv"),children:"CSV"}),e.jsx("button",{onClick:()=>X("json"),children:t("accessLog.json","JSON")}),e.jsx("button",{onClick:()=>X("pdf"),children:"PDF"})]})]})]})]}),z&&e.jsxs("div",{className:"nice-accesslog-stats",children:[e.jsxs("div",{className:"nice-accesslog-stat",children:[e.jsx("span",{className:"nice-accesslog-stat-value",children:J.totalEvents}),e.jsx("span",{className:"nice-accesslog-stat-label",children:t("accessLog.totalEvents","Total Events")})]}),e.jsxs("div",{className:"nice-accesslog-stat nice-accesslog-stat--success",children:[e.jsx("span",{className:"nice-accesslog-stat-value",children:J.successfulLogins}),e.jsx("span",{className:"nice-accesslog-stat-label",children:t("accessLog.successful","Successful")})]}),e.jsxs("div",{className:"nice-accesslog-stat nice-accesslog-stat--failed",children:[e.jsx("span",{className:"nice-accesslog-stat-value",children:J.failedLogins}),e.jsx("span",{className:"nice-accesslog-stat-label",children:t("accessLog.failed","Failed")})]}),e.jsxs("div",{className:"nice-accesslog-stat",children:[e.jsx("span",{className:"nice-accesslog-stat-value",children:J.uniqueIPs}),e.jsx("span",{className:"nice-accesslog-stat-label",children:t("accessLog.uniqueIps","Unique IPs")})]}),e.jsxs("div",{className:"nice-accesslog-stat",children:[e.jsx("span",{className:"nice-accesslog-stat-value",children:J.uniqueCountries}),e.jsx("span",{className:"nice-accesslog-stat-label",children:t("accessLog.countries","Countries")})]}),e.jsxs("div",{className:"nice-accesslog-stat nice-accesslog-stat--warning",children:[e.jsx("span",{className:"nice-accesslog-stat-value",children:J.highRiskEvents}),e.jsx("span",{className:"nice-accesslog-stat-label",children:t("accessLog.highRisk","High Risk")})]})]}),e.jsxs("div",{className:"nice-accesslog-filters",children:[e.jsxs("div",{className:"nice-accesslog-filters-row",children:[e.jsxs("div",{className:"nice-accesslog-search",children:[e.jsx("span",{className:"nice-accesslog-search-icon",children:e.jsx(n.NtdSearch,{size:16})}),e.jsx("input",{type:"text",placeholder:b.search,value:g.searchQuery||"",onChange:u=>v({searchQuery:u.target.value})})]}),e.jsxs("div",{className:"nice-accesslog-filter-quick",children:[e.jsx("button",{type:"button",className:`nice-accesslog-filter-chip ${g.failedOnly?"nice-accesslog-filter-chip--active":""}`,onClick:()=>v({failedOnly:!g.failedOnly,successOnly:!1}),children:t("accessLog.failedOnly","Failed Only")}),e.jsx("button",{type:"button",className:`nice-accesslog-filter-chip ${(K=g.riskLevels)!=null&&K.includes("high")||(Z=g.riskLevels)!=null&&Z.includes("critical")?"nice-accesslog-filter-chip--active":""}`,onClick:()=>{var u;return v({riskLevels:(u=g.riskLevels)!=null&&u.includes("high")?[]:["high","critical"]})},children:t("accessLog.highRisk","High Risk")}),e.jsx("button",{type:"button",className:"nice-accesslog-filter-toggle",onClick:()=>B(!w),children:w?e.jsxs(e.Fragment,{children:[e.jsx(n.NtdMinus,{size:14})," ",t("accessLog.less","Less")]}):e.jsxs(e.Fragment,{children:[e.jsx(n.NtdPlus,{size:14})," ",t("accessLog.more","More")]})})]})]}),w&&e.jsxs("div",{className:"nice-accesslog-filters-expanded",children:[e.jsxs("div",{className:"nice-accesslog-filter-group",children:[e.jsx("label",{children:t("accessLog.eventType","Event Type")}),e.jsx("select",{multiple:!0,value:g.eventTypes||[],onChange:u=>{const p=Array.from(u.target.selectedOptions,f=>f.value);v({eventTypes:p.length?p:void 0})},children:Object.entries(b.eventTypes).map(([u,p])=>e.jsx("option",{value:u,children:p},u))})]}),e.jsxs("div",{className:"nice-accesslog-filter-group",children:[e.jsx("label",{children:t("accessLog.dateRange","Date Range")}),e.jsxs("div",{className:"nice-accesslog-date-range",children:[e.jsx("input",{type:"date",value:g.startDate?new Date(g.startDate).toISOString().split("T")[0]:"",onChange:u=>v({startDate:u.target.value||void 0})}),e.jsx("span",{children:t("accessLog.to","to")}),e.jsx("input",{type:"date",value:g.endDate?new Date(g.endDate).toISOString().split("T")[0]:"",onChange:u=>v({endDate:u.target.value||void 0})})]})]}),e.jsxs("div",{className:"nice-accesslog-filter-group",children:[e.jsx("label",{children:t("accessLog.ipAddress","IP Address")}),e.jsx("input",{type:"text",placeholder:"e.g., 192.168",value:g.ipAddress||"",onChange:u=>v({ipAddress:u.target.value||void 0})})]}),e.jsx("button",{type:"button",className:"nice-accesslog-clear-filters",onClick:T,children:t("accessLog.clearAllFilters","Clear All Filters")})]})]}),e.jsxs("div",{className:"nice-accesslog-tabs",children:[e.jsxs("button",{type:"button",className:`nice-accesslog-tab ${U==="table"?"nice-accesslog-tab--active":""}`,onClick:()=>N("table"),children:[e.jsx(n.NtdTable,{size:16})," ",t("accessLog.table","Table")]}),e.jsxs("button",{type:"button",className:`nice-accesslog-tab ${U==="timeline"?"nice-accesslog-tab--active":""}`,onClick:()=>N("timeline"),children:[e.jsx(n.NtdCalendar,{size:16})," ",b.timeline]}),y&&e.jsxs("button",{type:"button",className:`nice-accesslog-tab ${U==="map"?"nice-accesslog-tab--active":""}`,onClick:()=>N("map"),children:[e.jsx(n.NtdMap,{size:16})," ",b.map]}),e.jsx("span",{className:"nice-accesslog-count",children:t("accessLog.entries","{filteredEntries} entries").replace("{filteredEntries}",String(C.length))})]}),e.jsx("div",{className:"nice-accesslog-content",children:P?e.jsxs("div",{className:"nice-accesslog-loading",children:[e.jsx("div",{className:"nice-accesslog-spinner"}),t("accessLog.loadingAccessLogs","Loading access logs...")]}):C.length===0?e.jsxs("div",{className:"nice-accesslog-empty",children:[e.jsx("span",{className:"nice-accesslog-empty-icon",children:e.jsx(n.NtdShield,{size:32})}),e.jsx("span",{children:b.noResults})]}):e.jsxs(e.Fragment,{children:[U==="table"&&e.jsx("div",{className:"nice-accesslog-table-wrapper",children:e.jsxs("table",{className:"nice-accesslog-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:b.columns.timestamp}),e.jsx("th",{children:b.columns.user}),e.jsx("th",{children:b.columns.event}),e.jsx("th",{children:b.columns.ip}),e.jsx("th",{children:b.columns.location}),e.jsx("th",{children:b.columns.device}),e.jsx("th",{children:b.columns.risk}),e.jsx("th",{children:b.columns.status})]})}),e.jsx("tbody",{children:A.map(S)})]})}),U==="timeline"&&e.jsx("div",{className:"nice-accesslog-timeline",children:A.map(M)}),U==="map"&&e.jsx("div",{className:"nice-accesslog-map",children:e.jsxs("div",{className:"nice-accesslog-map-placeholder",children:[e.jsx(n.NtdMap,{size:16})," ",t("accessLog.geographicVisualizationWouldRenderHere","Geographic visualization would render here")]})}),I<C.length&&e.jsx("button",{type:"button",className:"nice-accesslog-show-more",onClick:j,children:t("accessLog.remaining","{showMore} ({filteredEntries} remaining)").replace("{showMore}",String(b.showMore)).replace("{filteredEntries}",String(C.length-I))})]})}),_&&m&&e.jsxs("div",{className:"nice-accesslog-detail",children:[e.jsxs("div",{className:"nice-accesslog-detail-header",children:[e.jsx("h3",{children:b.details}),e.jsx("button",{type:"button",className:"nice-accesslog-detail-close",onClick:()=>H(null),children:e.jsx(n.NtdClose,{size:16})})]}),e.jsxs("div",{className:"nice-accesslog-detail-content",children:[e.jsxs("div",{className:"nice-accesslog-detail-row",children:[e.jsx("span",{className:"nice-accesslog-detail-label",children:t("accessLog.eventId","Event ID")}),e.jsx("span",{className:"nice-accesslog-detail-value",children:m.id})]}),e.jsxs("div",{className:"nice-accesslog-detail-row",children:[e.jsx("span",{className:"nice-accesslog-detail-label",children:t("accessLog.timestamp","Timestamp")}),e.jsx("span",{className:"nice-accesslog-detail-value",children:new Date(m.timestamp).toISOString()})]}),e.jsxs("div",{className:"nice-accesslog-detail-row",children:[e.jsx("span",{className:"nice-accesslog-detail-label",children:t("accessLog.user","User")}),e.jsxs("span",{className:"nice-accesslog-detail-value",children:[m.userName," (",m.userId,")",m.userEmail&&e.jsx("div",{children:m.userEmail})]})]}),e.jsxs("div",{className:"nice-accesslog-detail-row",children:[e.jsx("span",{className:"nice-accesslog-detail-label",children:t("accessLog.eventType","Event Type")}),e.jsxs("span",{className:"nice-accesslog-detail-value",children:[le[m.eventType]," ",b.eventTypes[m.eventType]]})]}),e.jsxs("div",{className:"nice-accesslog-detail-row",children:[e.jsx("span",{className:"nice-accesslog-detail-label",children:t("accessLog.ipAddress","IP Address")}),e.jsx("span",{className:"nice-accesslog-detail-value",children:m.ipAddress})]}),m.location&&e.jsxs("div",{className:"nice-accesslog-detail-row",children:[e.jsx("span",{className:"nice-accesslog-detail-label",children:t("accessLog.location","Location")}),e.jsxs("span",{className:"nice-accesslog-detail-value",children:[m.location.city,", ",m.location.region,","," ",m.location.country,m.location.latitude&&m.location.longitude&&e.jsxs("div",{className:"nice-accesslog-coords",children:["(",m.location.latitude,", ",m.location.longitude,")"]})]})]}),m.device&&e.jsxs("div",{className:"nice-accesslog-detail-row",children:[e.jsx("span",{className:"nice-accesslog-detail-label",children:t("accessLog.device","Device")}),e.jsxs("span",{className:"nice-accesslog-detail-value",children:[de[m.device.type]," ",m.device.os," ",m.device.osVersion,e.jsxs("div",{children:[m.device.browser," ",m.device.browserVersion]}),m.device.fingerprint&&e.jsx("div",{className:"nice-accesslog-fingerprint",children:t("accessLog.fingerprint","Fingerprint: {fingerprint}").replace("{fingerprint}",String(m.device.fingerprint))})]})]}),e.jsxs("div",{className:"nice-accesslog-detail-row",children:[e.jsx("span",{className:"nice-accesslog-detail-label",children:t("accessLog.riskScore","Risk Score")}),e.jsx("span",{className:"nice-accesslog-detail-value",children:e.jsxs("span",{style:{color:pe(m.riskScore)},children:[m.riskScore,"/100 (",b.riskLevels[m.riskLevel],")"]})})]}),m.flags&&m.flags.length>0&&e.jsxs("div",{className:"nice-accesslog-detail-row",children:[e.jsx("span",{className:"nice-accesslog-detail-label",children:t("accessLog.flags","Flags")}),e.jsx("span",{className:"nice-accesslog-detail-value",children:m.flags.map((u,p)=>e.jsx("span",{className:"nice-accesslog-flag-badge",children:u},p))})]}),m.details&&Object.keys(m.details).length>0&&e.jsxs("div",{className:"nice-accesslog-detail-row",children:[e.jsx("span",{className:"nice-accesslog-detail-label",children:t("accessLog.additionalDetails","Additional Details")}),e.jsx("pre",{className:"nice-accesslog-detail-json",children:JSON.stringify(m.details,null,2)})]})]})]})]})}),{displayName:"NiceAccessLog"});exports.NiceAccessLog=Ke;exports.NiceAuditTrail=Se;exports.NiceContractEditor=_e;exports.NiceDataExportCenter=fe;exports.NiceGDPRConsent=Oe;exports.NiceGlobalSearch=He;
package/dist/index.d.ts CHANGED
@@ -394,11 +394,13 @@ export declare interface GeoLocation {
394
394
  timezone?: string;
395
395
  }
396
396
 
397
- export declare const NiceAccessLog: default_2.ForwardRefExoticComponent<NiceAccessLogProps & default_2.RefAttributes<NiceAccessLogRef>>;
397
+ export declare const NiceAccessLog: default_2.ForwardRefExoticComponent<NiceAccessLogProps & default_2.RefAttributes<NiceAccessLogRef>> & {
398
+ displayName: string;
399
+ };
398
400
 
399
401
  export declare interface NiceAccessLogProps extends NiceStandardProps {
400
402
  /** Log entries data */
401
- entries: AccessLogEntry[];
403
+ entries?: AccessLogEntry[];
402
404
  /** Initial filter */
403
405
  filter?: AccessLogFilter;
404
406
  /** Statistics */
@@ -448,7 +450,9 @@ export declare interface NiceAccessLogRef {
448
450
  getElement: () => HTMLDivElement | null;
449
451
  }
450
452
 
451
- export declare const NiceAuditTrail: default_2.ForwardRefExoticComponent<NiceAuditTrailProps & default_2.RefAttributes<NiceAuditTrailRef>>;
453
+ export declare const NiceAuditTrail: default_2.ForwardRefExoticComponent<NiceAuditTrailProps & default_2.RefAttributes<NiceAuditTrailRef>> & {
454
+ displayName: string;
455
+ };
452
456
 
453
457
  export declare interface NiceAuditTrailProps extends NiceStandardProps {
454
458
  /** Data source */
@@ -481,7 +485,9 @@ export declare interface NiceAuditTrailRef {
481
485
  getEntries: () => AuditEntry[];
482
486
  }
483
487
 
484
- export declare const NiceContractEditor: default_2.ForwardRefExoticComponent<NiceContractEditorProps & default_2.RefAttributes<NiceContractEditorRef>>;
488
+ export declare const NiceContractEditor: default_2.ForwardRefExoticComponent<NiceContractEditorProps & default_2.RefAttributes<NiceContractEditorRef>> & {
489
+ displayName: string;
490
+ };
485
491
 
486
492
  export declare interface NiceContractEditorProps extends NiceStandardProps {
487
493
  /** Document to edit */
@@ -537,7 +543,9 @@ export declare interface NiceContractEditorRef {
537
543
  };
538
544
  }
539
545
 
540
- export declare const NiceDataExportCenter: default_2.ForwardRefExoticComponent<NiceDataExportCenterProps & default_2.RefAttributes<NiceDataExportCenterRef>>;
546
+ export declare const NiceDataExportCenter: default_2.ForwardRefExoticComponent<NiceDataExportCenterProps & default_2.RefAttributes<NiceDataExportCenterRef>> & {
547
+ displayName: string;
548
+ };
541
549
 
542
550
  export declare interface NiceDataExportCenterProps extends NiceStandardProps {
543
551
  /** Data source */
@@ -576,7 +584,9 @@ export declare interface NiceDataExportCenterRef {
576
584
  loadTemplate: (templateId: string) => void;
577
585
  }
578
586
 
579
- export declare const NiceGDPRConsent: default_2.ForwardRefExoticComponent<NiceGDPRConsentProps & default_2.RefAttributes<NiceGDPRConsentRef>>;
587
+ export declare const NiceGDPRConsent: default_2.ForwardRefExoticComponent<NiceGDPRConsentProps & default_2.RefAttributes<NiceGDPRConsentRef>> & {
588
+ displayName: string;
589
+ };
580
590
 
581
591
  export declare interface NiceGDPRConsentProps extends Omit<NiceStandardProps, 'variant'> {
582
592
  /** Application name */
@@ -625,11 +635,13 @@ export declare interface NiceGDPRConsentRef {
625
635
  openPreferences: () => void;
626
636
  }
627
637
 
628
- export declare const NiceGlobalSearch: default_2.ForwardRefExoticComponent<NiceGlobalSearchProps & default_2.RefAttributes<NiceGlobalSearchRef>>;
638
+ export declare const NiceGlobalSearch: default_2.ForwardRefExoticComponent<NiceGlobalSearchProps & default_2.RefAttributes<NiceGlobalSearchRef>> & {
639
+ displayName: string;
640
+ };
629
641
 
630
642
  export declare interface NiceGlobalSearchProps extends Omit<NiceStandardProps, 'variant'> {
631
643
  /** Search sources */
632
- sources: SearchSource[];
644
+ sources?: SearchSource[];
633
645
  /** Placeholder text */
634
646
  placeholder?: string;
635
647
  /** Minimum characters before search */