zeed-dynamic-table
Version:
A flexible and dynamic table component for React and Next.js applications without Tailwind dependencies
3 lines (2 loc) • 42.1 kB
JavaScript
import{jsx as e,jsxs as r,Fragment as o}from"react/jsx-runtime";import{useMemo as t,createElement as n,useState as a,useEffect as i,memo as l,useCallback as s}from"react";function c(e){var r,o,t="";if("string"==typeof e||"number"==typeof e)t+=e;else if("object"==typeof e)if(Array.isArray(e))for(r=0;r<e.length;r++)e[r]&&(o=c(e[r]))&&(t&&(t+=" "),t+=o);else for(r in e)e[r]&&(t&&(t+=" "),t+=r);return t}function d(){for(var e,r,o=0,t="";o<arguments.length;)(e=arguments[o++])&&(r=u(e))&&(t&&(t+=" "),t+=r);return t}function u(e){if("string"==typeof e)return e;for(var r,o="",t=0;t<e.length;t++)e[t]&&(r=u(e[t]))&&(o&&(o+=" "),o+=r);return o}function p(e){var r=function(e){var r=e.theme,o=e.prefix,t={nextPart:new Map,validators:[]},n=function(e,r){if(!r)return e;return e.map((function(e){return[e[0],e[1].map((function(e){return"string"==typeof e?r+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map((function(e){var o=e[0],t=e[1];return[r+o,t]}))):e}))]}))}(Object.entries(e.classGroups),o);return n.forEach((function(e){var o=e[0];g(e[1],t,o,r)})),t}(e),o=e.conflictingClassGroups,t=e.conflictingClassGroupModifiers,n=void 0===t?{}:t;return{getClassGroupId:function(e){var o=e.split("-");return""===o[0]&&1!==o.length&&o.shift(),m(o,r)||function(e){if(f.test(e)){var r=f.exec(e)[1],o=r?.substring(0,r.indexOf(":"));if(o)return"arbitrary.."+o}}(e)},getConflictingClassGroupIds:function(e,r){var t=o[e]||[];return r&&n[e]?[].concat(t,n[e]):t}}}function m(e,r){if(0===e.length)return r.classGroupId;var o=e[0],t=r.nextPart.get(o),n=t?m(e.slice(1),t):void 0;if(n)return n;if(0!==r.validators.length){var a=e.join("-");return r.validators.find((function(e){return(0,e.validator)(a)}))?.classGroupId}}var f=/^\[(.+)\]$/;function g(e,r,o,t){e.forEach((function(e){if("string"!=typeof e){if("function"==typeof e)return e.isThemeGetter?void g(e(t),r,o,t):void r.validators.push({validator:e,classGroupId:o});Object.entries(e).forEach((function(e){var n=e[0];g(e[1],h(r,n),o,t)}))}else{(""===e?r:h(r,e)).classGroupId=o}}))}function h(e,r){var o=e;return r.split("-").forEach((function(e){o.nextPart.has(e)||o.nextPart.set(e,{nextPart:new Map,validators:[]}),o=o.nextPart.get(e)})),o}function b(e){if(e<1)return{get:function(){},set:function(){}};var r=0,o=new Map,t=new Map;function n(n,a){o.set(n,a),++r>e&&(r=0,t=o,o=new Map)}return{get:function(e){var r=o.get(e);return void 0!==r?r:void 0!==(r=t.get(e))?(n(e,r),r):void 0},set:function(e,r){o.has(e)?o.set(e,r):n(e,r)}}}function y(e){var r=e.separator||":",o=1===r.length,t=r[0],n=r.length;return function(e){for(var a,i=[],l=0,s=0,c=0;c<e.length;c++){var d=e[c];if(0===l){if(d===t&&(o||e.slice(c,c+n)===r)){i.push(e.slice(s,c)),s=c+n;continue}if("/"===d){a=c;continue}}"["===d?l++:"]"===d&&l--}var u=0===i.length?e:e.substring(s),p=u.startsWith("!");return{modifiers:i,hasImportantModifier:p,baseClassName:p?u.substring(1):u,maybePostfixModifierPosition:a&&a>s?a-s:void 0}}}var x=/\s+/;function v(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];var t,n,a,i=function(e){var o=r[0],s=r.slice(1).reduce((function(e,r){return r(e)}),o());return t=function(e){return{cache:b(e.cacheSize),splitModifiers:y(e),...p(e)}}(s),n=t.cache.get,a=t.cache.set,i=l,l(e)};function l(e){var r=n(e);if(r)return r;var o=function(e,r){var o=r.splitModifiers,t=r.getClassGroupId,n=r.getConflictingClassGroupIds,a=new Set;return e.trim().split(x).map((function(e){var r=o(e),n=r.modifiers,a=r.hasImportantModifier,i=r.baseClassName,l=r.maybePostfixModifierPosition,s=t(l?i.substring(0,l):i),c=Boolean(l);if(!s){if(!l)return{isTailwindClass:!1,originalClassName:e};if(!(s=t(i)))return{isTailwindClass:!1,originalClassName:e};c=!1}var d=function(e){if(e.length<=1)return e;var r=[],o=[];return e.forEach((function(e){"["===e[0]?(r.push.apply(r,o.sort().concat([e])),o=[]):o.push(e)})),r.push.apply(r,o.sort()),r}(n).join(":");return{isTailwindClass:!0,modifierId:a?d+"!":d,classGroupId:s,originalClassName:e,hasPostfixModifier:c}})).reverse().filter((function(e){if(!e.isTailwindClass)return!0;var r=e.modifierId,o=e.classGroupId,t=e.hasPostfixModifier,i=r+o;return!a.has(i)&&(a.add(i),n(o,t).forEach((function(e){return a.add(r+e)})),!0)})).reverse().map((function(e){return e.originalClassName})).join(" ")}(e,t);return a(e,o),o}return function(){return i(d.apply(null,arguments))}}function w(e){var r=function(r){return r[e]||[]};return r.isThemeGetter=!0,r}var k=/^\[(?:([a-z-]+):)?(.+)\]$/i,N=/^\d+\/\d+$/,C=new Set(["px","full","screen"]),P=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,E=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,B=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;function F(e){return A(e)||C.has(e)||N.test(e)||I(e)}function I(e){return R(e,"length",W)}function j(e){return R(e,"size",U)}function z(e){return R(e,"position",U)}function $(e){return R(e,"url",_)}function O(e){return R(e,"number",A)}function A(e){return!Number.isNaN(Number(e))}function D(e){return e.endsWith("%")&&A(e.slice(0,-1))}function S(e){return H(e)||R(e,"number",H)}function M(e){return k.test(e)}function L(){return!0}function T(e){return P.test(e)}function G(e){return R(e,"",q)}function R(e,r,o){var t=k.exec(e);return!!t&&(t[1]?t[1]===r:o(t[2]))}function W(e){return E.test(e)}function U(){return!1}function _(e){return e.startsWith("url(")}function H(e){return Number.isInteger(Number(e))}function q(e){return B.test(e)}function J(){var e=w("colors"),r=w("spacing"),o=w("blur"),t=w("brightness"),n=w("borderColor"),a=w("borderRadius"),i=w("borderSpacing"),l=w("borderWidth"),s=w("contrast"),c=w("grayscale"),d=w("hueRotate"),u=w("invert"),p=w("gap"),m=w("gradientColorStops"),f=w("gradientColorStopPositions"),g=w("inset"),h=w("margin"),b=w("opacity"),y=w("padding"),x=w("saturate"),v=w("scale"),k=w("sepia"),N=w("skew"),C=w("space"),P=w("translate"),E=function(){return["auto",M,r]},B=function(){return[M,r]},R=function(){return["",F]},W=function(){return["auto",A,M]},U=function(){return["","0",M]},_=function(){return[A,O]},H=function(){return[A,M]};return{cacheSize:500,theme:{colors:[L],spacing:[F],blur:["none","",T,M],brightness:_(),borderColor:[e],borderRadius:["none","","full",T,M],borderSpacing:B(),borderWidth:R(),contrast:_(),grayscale:U(),hueRotate:H(),invert:U(),gap:B(),gradientColorStops:[e],gradientColorStopPositions:[D,I],inset:E(),margin:E(),opacity:_(),padding:B(),saturate:_(),scale:_(),sepia:U(),skew:H(),space:B(),translate:B()},classGroups:{aspect:[{aspect:["auto","square","video",M]}],container:["container"],columns:[{columns:[T]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[].concat(["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],[M])}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",S]}],basis:[{basis:E()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",M]}],grow:[{grow:U()}],shrink:[{shrink:U()}],order:[{order:["first","last","none",S]}],"grid-cols":[{"grid-cols":[L]}],"col-start-end":[{col:["auto",{span:["full",S]},M]}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":[L]}],"row-start-end":[{row:["auto",{span:[S]},M]}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",M]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",M]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal"].concat(["start","end","center","between","around","evenly","stretch"])}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal"].concat(["start","end","center","between","around","evenly","stretch"],["baseline"])}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[].concat(["start","end","center","between","around","evenly","stretch"],["baseline"])}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[h]}],mx:[{mx:[h]}],my:[{my:[h]}],ms:[{ms:[h]}],me:[{me:[h]}],mt:[{mt:[h]}],mr:[{mr:[h]}],mb:[{mb:[h]}],ml:[{ml:[h]}],"space-x":[{"space-x":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",M,r]}],"min-w":[{"min-w":["min","max","fit",M,F]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[T]},T,M]}],h:[{h:[M,r,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",M,F]}],"max-h":[{"max-h":[M,r,"min","max","fit"]}],"font-size":[{text:["base",T,I]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",O]}],"font-family":[{font:[L]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",M]}],"line-clamp":[{"line-clamp":["none",A,O]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",M,F]}],"list-image":[{"list-image":["none",M]}],"list-style-type":[{list:["none","disc","decimal",M]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[].concat(["solid","dashed","dotted","double","none"],["wavy"])}],"text-decoration-thickness":[{decoration:["auto","from-font",F]}],"underline-offset":[{"underline-offset":["auto",M,F]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",M]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",M]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[].concat(["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],[z])}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",j]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},$]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[f]}],"gradient-via-pos":[{via:[f]}],"gradient-to-pos":[{to:[f]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[].concat(["solid","dashed","dotted","double","none"],["hidden"])}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:["solid","dashed","dotted","double","none"]}],"border-color":[{border:[n]}],"border-color-x":[{"border-x":[n]}],"border-color-y":[{"border-y":[n]}],"border-color-t":[{"border-t":[n]}],"border-color-r":[{"border-r":[n]}],"border-color-b":[{"border-b":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:[""].concat(["solid","dashed","dotted","double","none"])}],"outline-offset":[{"outline-offset":[M,F]}],"outline-w":[{outline:[F]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:R()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[F]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",T,G]}],"shadow-color":[{shadow:[L]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"]}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[t]}],contrast:[{contrast:[s]}],"drop-shadow":[{"drop-shadow":["","none",T,M]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[u]}],saturate:[{saturate:[x]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[t]}],"backdrop-contrast":[{"backdrop-contrast":[s]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",M]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",M]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",M]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[v]}],"scale-x":[{"scale-x":[v]}],"scale-y":[{"scale-y":[v]}],rotate:[{rotate:[S,M]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",M]}],accent:[{accent:["auto",e]}],appearance:["appearance-none"],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",M]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","pinch-zoom","manipulation",{pan:["x","left","right","y","up","down"]}]}],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",M]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[F,O]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}var V=v(J);function X(...e){return V(function(){for(var e,r,o=0,t="";o<arguments.length;)(e=arguments[o++])&&(r=c(e))&&(t&&(t+=" "),t+=r);return t}(e))}function K(...e){return e.filter(Boolean).join(" ")}const Q={white:"#FFFFFF",black:"#000000",primary:"#3B82F6",primaryHover:"#2563EB",primaryLight:"#93C5FD",primaryDark:"#1D4ED8",gray50:"#F9FAFB",gray100:"#F3F4F6",gray200:"#E5E7EB",gray300:"#D1D5DB",gray400:"#9CA3AF",gray500:"#6B7280",gray600:"#4B5563",gray700:"#374151",gray800:"#1F2937",gray900:"#111827",success:"#10B981",successLight:"#A7F3D0",successDark:"#047857",danger:"#EF4444",dangerLight:"#FCA5A5",dangerDark:"#B91C1C",warning:"#F59E0B",warningLight:"#FCD34D",warningDark:"#B45309",info:"#3B82F6",infoLight:"#93C5FD",infoDark:"#1D4ED8"},Y=({children:r,baseProps:o})=>e("div",{...o,className:X("flex flex-col md:flex-row justify-between items-start md:items-center space-y-3 md:space-y-0 p-4 bg-white dark:bg-gray-900 border-t border-gray-200 dark:border-gray-700 transition-colors",o?.className),children:r}),Z=({children:r,leftBaseProps:o})=>e("div",{...o,className:X("flex items-center gap-x-3",o?.className),children:r}),ee=({children:r,rightBaseProps:o})=>e("ul",{...o,className:X("inline-flex items-stretch -space-x-px",o?.className),children:r}),re=({pagination:t})=>{const n=t?.page||1,a=t?.totalPages||0,i="flex items-center justify-center h-full py-1.5 px-3 cursor-pointer transition-colors",l="bg-gray-300 dark:bg-gray-700 text-gray-800 dark:text-white",s="text-gray-500 dark:text-gray-400 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-700 hover:bg-gray-100 dark:hover:bg-gray-700",c="disabled:cursor-not-allowed disabled:bg-gray-200 dark:disabled:bg-gray-900 disabled:text-gray-400 dark:disabled:text-gray-600";return r(Y,{baseProps:t?.baseProps,children:[r(Z,{leftBaseProps:t?.leftBaseProps,children:[r("span",{className:"text-sm font-normal text-gray-500 dark:text-gray-400",children:["Showing",e("span",{className:"font-semibold text-gray-900 dark:text-white mx-1",children:n}),"of",e("span",{className:"font-semibold text-gray-900 dark:text-white ml-1",children:a})]}),t.per_pageComponent]}),r(ee,{rightBaseProps:t?.rightBaseProps,children:[e("li",{children:r("button",{onClick:()=>{n>1&&t.handlePageChange(n-1)},disabled:n<=1,className:X(i,s,c,"rounded-l-lg"),"aria-label":"Previous page",children:[e("span",{className:"sr-only",children:"Previous"}),e("svg",{className:"w-5 h-5","aria-hidden":"true",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:e("path",{fillRule:"evenodd",d:"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z",clipRule:"evenodd"})})]})}),a<=5?Array.from({length:a},((r,o)=>e("li",{onClick:()=>{t.handlePageChange(o+1)},className:"cursor-pointer",children:e("span",{className:X(i,o+1===n?l:s),children:o+1})},`page-${o+1}`))):r(o,{children:[e("li",{onClick:()=>{t.handlePageChange(1)},className:"cursor-pointer",children:e("span",{className:X(i,1===n?l:s),children:"1"})}),n>3&&e("li",{className:"cursor-pointer",children:e("span",{className:X(i,s),children:"..."})}),Array.from({length:3},((r,o)=>{const c=n-1+o;return c>1&&c<a?e("li",{onClick:()=>{t.handlePageChange(c)},className:"cursor-pointer",children:e("span",{className:X(i,n===c?l:s),children:c})},`page-${c}`):null})),n<a-2&&e("li",{className:"cursor-pointer",children:e("span",{className:X(i,s),children:"..."})}),e("li",{onClick:()=>{t.handlePageChange(a)},className:"cursor-pointer",children:e("span",{className:X(i,n===a?l:s),children:a})})]}),e("li",{children:r("button",{onClick:()=>{n<a&&t.handlePageChange(n+1)},disabled:n>=a,className:X(i,s,c,"rounded-r-lg"),"aria-label":"Next page",children:[e("span",{className:"sr-only",children:"Next"}),e("svg",{className:"w-5 h-5","aria-hidden":"true",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:e("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})})]})})]})]})},oe=({className:r,item:o,color:n="primary",size:a="md",style:i})=>{const l=t((()=>{const e={sm:{width:6,height:6},md:{width:10,height:10},lg:{width:12,height:12}};if("number"==typeof a)return{width:`${a}px`,height:`${a}px`};const r=e[a]||e.md;return{width:`${r.width}px`,height:`${r.height}px`}}),[a]),s=t((()=>{try{return"function"==typeof r?r(o):r||""}catch(e){return console.error("Error resolving className in Chip:",e),""}}),[r,o]),c=t((()=>{try{const e="function"==typeof n?n(o):n;return"string"==typeof e&&e in Q?Q[e]:e}catch(e){return console.error("Error resolving color in Chip:",e),Q.primary}}),[n,o]),d=t((()=>{try{return"function"==typeof i?i(o):i||{}}catch(e){return console.error("Error resolving style in Chip:",e),{}}}),[i,o]),u=t((()=>({...{display:"inline-flex",borderRadius:"9999px",...l,backgroundColor:c},...d})),[l,c,d]);return e("span",{className:s,style:u})};function te(e,r){if(r)try{const o=r.split(".");let t=e;for(const e of o){if(null==t)return;t=t[e]}return"number"==typeof t?Number(t):void 0!==t?t:""}catch(e){return console.error(`Error getting nested value for path ${r}:`,e),""}}function ne(e,r){if(!e||"object"!=typeof e)return{};try{const o={};for(const[t,n]of Object.entries(e))if("function"!=typeof n)if("string"!=typeof n)o[t]=n;else try{let e=n.replace(/\[([^\]]+)\]/g,((e,o)=>{const t=te(r,o);return void 0!==t?String(t):""}));o[t]=e}catch(e){console.error(`Error processing string value for ${t}:`,e),o[t]=n}else try{o[t]=n(r)}catch(e){console.error(`Error evaluating function for ${t}:`,e),o[t]="style"===t?{}:""}return o}catch(e){return console.error("Error in handlePropsDynamic:",e),{}}}function ae(e,r){if(!e.join||!Array.isArray(e.join))return"";try{return e.join.map((e=>{try{const o=te(r,e);return null!=o?String(o):""}catch(r){return console.error(`Error getting joined value for path ${e}:`,r),""}})).filter(Boolean).join(" ")}catch(e){return console.error("Error in handleJoined:",e),""}}const ie=({children:r,baseProps:o})=>e("div",{...o,className:X("flex flex-col md:flex-row items-center justify-between gap-3 py-3 px-4 bg-white dark:bg-gray-900 border-b border-gray-200 dark:border-gray-700 transition-colors",o?.className),children:r}),le=({children:r,leftBaseProps:o})=>e("div",{...o,className:X("w-full md:w-2/3 mb-2 md:mb-0",o?.className),children:r}),se=({children:r,moreComponentBaseProps:o})=>e("div",{...o,className:X("flex items-center space-x-3 w-full md:w-auto",o?.className),children:r}),ce=({children:r,rightBaseProps:o})=>e("div",{...o,className:X("w-full md:w-auto flex flex-row items-center justify-end space-x-2 h-10",o?.className),children:r}),de=({searchInput:o,addButton:t,moreComponents:n,baseProps:a,leftBaseProps:i,rightBaseProps:l,moreComponentBaseProps:s})=>r(ie,{baseProps:a,children:[e(le,{leftBaseProps:i,children:r("form",{className:"flex items-center w-full",onSubmit:e=>e.preventDefault(),children:[e("label",{htmlFor:"table-search-input",className:"sr-only",children:"Search Input For The Table"}),r("div",{className:"relative w-full",children:[e("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:e("svg",{"aria-hidden":"true",className:"w-5 h-5 text-gray-500 dark:text-gray-400",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:e("path",{fillRule:"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z",clipRule:"evenodd"})})}),e("input",{id:"table-search-input",type:"text",placeholder:"Search",...o,className:X("bg-gray-50 dark:bg-gray-800 border border-gray-300 dark:border-gray-700 text-gray-900 dark:text-gray-200 text-sm rounded-lg block w-full pl-10 p-2.5 focus:ring-blue-500 focus:border-blue-500 dark:focus:ring-blue-500 dark:focus:border-blue-500 transition-colors",o?.className)})]})]})}),r(ce,{rightBaseProps:l,children:[t&&r("button",{type:"button",...t,className:X("flex items-center justify-center text-white bg-blue-600 hover:bg-blue-700 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800 transition-colors",t?.className),children:[t?.startContent,t?.title||"Add",t?.endContent]}),n&&e(se,{moreComponentBaseProps:s,children:n})]})]}),ue=({column:e,item:r,colIndex:o,children:t})=>{const a=e?.normalProps?.td?ne(e.normalProps.td,r):{},i={...a,...e?.normalProps?.td};return n("td",{...i,className:X("px-2 py-4 capitalize font-medium text-gray-900 dark:text-gray-200 whitespace-nowrap transition-colors",a?.className,e?.normalProps?.td?.className),key:o,scope:"row"},t)},pe={display:"flex",alignItems:"center",justifyContent:"flex-end",padding:"0.5rem",fontWeight:500,color:Q.gray900,whiteSpace:"nowrap",transition:"colors 0.2s ease-in-out"},me={...pe,color:Q.gray200},fe=({column:r,item:o,colIndex:t,children:n,onClick:a,adJustClass:i})=>{const l=r?.normalProps?.td?ne(r.normalProps.td,o):{},s=l?.style||{},c=r?.normalProps?.td?.style||{},d={...we()?me:pe,...c,...s},u=K("dynamic-table-action-td",i,l?.className,r?.normalProps?.td?.className),{className:p,onClick:m,style:f,...g}=l;return e("td",{onClick:e=>{a&&(e.preventDefault(),a()),l?.onClick&&"function"==typeof l.onClick&&l.onClick(e)},className:u,style:d,...r?.normalProps?.td||{},...g,children:n},t)},ge=({item:r,href:o,children:t,className:n,target:l,rel:s,onClick:c})=>{const d=function(e,r){if(!e)return"#";try{return e.replace(/\[([^\]]+)\]/g,((e,o)=>{try{const e=te(r,o);return null!=e?String(e):""}catch(e){return console.error(`Error generating dynamic link for [${o}]:`,e),""}}))}catch(e){return console.error("Error in generateDynamicLink:",e),"#"}}(o,r),[u,p]=a(null),[m,f]=a(!1);i((()=>{const e=(()=>{try{if("undefined"!=typeof window&&void 0!==window&&void 0!==window.__NEXT_DATA__)return!0;try{return require.resolve("next/link"),!0}catch(e){return!1}}catch(e){return console.warn("Error detecting Next.js environment:",e),!1}})();f(e),e&&import("next/link").then((e=>{p((()=>e.default))})).catch((e=>{console.warn("Failed to import Next.js Link, falling back to <a> tag:",e)}))}),[]);const g={className:n,target:l,rel:s||("_blank"===l?"noopener noreferrer":void 0),onClick:e=>{c&&c(e)}};return e(m&&u?u:"a",{href:d,...g,children:t})};function he(e){if(null==e)return"-";try{const r=new Date(e);if(isNaN(r.getTime()))return String(e);const o={year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"};return new Intl.DateTimeFormat("en-US",o).format(r)}catch(r){return console.error("Error rendering date value:",r),String(e)}}function be(t,n){try{if(t.join&&Array.isArray(t.join))return t.useChip?r(o,{children:[e(oe,{className:t?.chipOptions?.className||"",item:n,color:t?.chipOptions?.color})," ",ae(t,n)]}):ae(t,n);{const a=t.accessor?te(n,t.accessor):"";return void 0!==t.static?t.useChip?r(o,{children:[e(oe,{className:t?.chipOptions?.className||"",item:n,color:t?.chipOptions?.color})," ",t.static]}):t.static:t.useDate?t.useChip?r(o,{children:[e(oe,{className:t?.chipOptions?.className||"",item:n,color:t?.chipOptions?.color})," ",he(a)]}):he(a):t.useChip?r(o,{children:[e(oe,{className:t?.chipOptions?.className||"",item:n,color:t?.chipOptions?.color})," ",a]}):a}}catch(e){return console.error("Error in renderValue:",e),"Error displaying value"}}const ye={display:"block",width:"100%",padding:"0.5rem",fontSize:"0.875rem",border:`1px solid ${Q.gray300}`,borderRadius:"0.375rem",backgroundColor:Q.white,color:Q.gray900},xe={...ye,backgroundColor:Q.gray800,color:Q.white,borderColor:Q.gray700};function ve(o,t,n,a){try{const i=a||`cell-${t}-${Date.now()}`;return o.useOption?e(ue,{column:o,item:n,colIndex:t,children:o?.optionOptions?.component?r("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[o.useChip&&e(oe,{item:n,className:o?.chipOptions?.className||"",color:o?.chipOptions?.color}),o.optionOptions.component(n)]}):e("select",o?.optionOptions?.apiLink?{onChange:e=>{o?.optionOptions?.apiLink&&async function(e,r,o,t,n){if(r)try{const a={item:n,value:e},i={"Content-Type":"application/json"},l=new AbortController,s=setTimeout((()=>l.abort()),15e3);try{const e=await fetch(r,{method:"POST",headers:i,body:JSON.stringify(a),signal:l.signal});if(clearTimeout(s),!e.ok)throw new Error(`API returned status ${e.status}`);try{const r=await e.json();o&&"function"==typeof o&&o(r)}catch(e){o&&"function"==typeof o&&o(null)}}catch(e){console.error("Fetch error in handleOptionChnage:",e),t&&"function"==typeof t&&t(e)}}catch(e){console.error("Error in handleOptionChnage:",e),t&&"function"==typeof t&&t(e)}else console.warn("API link not provided for option change")}(e.target.value,o.optionOptions.apiLink,o?.optionOptions?.onRes,o?.optionOptions?.onCatch,n)},style:we()?xe:ye,children:Array.isArray(o?.optionOptions?.data)&&o.optionOptions.data.map(((r,o)=>e("option",{value:r,children:r},`option-${o}-${r}`)))}:{onChange:e=>{o?.optionOptions?.onChange&&o.optionOptions.onChange(e.target.value)},style:we()?xe:ye,children:Array.isArray(o?.optionOptions?.data)&&o?.optionOptions?.data?.map(((r,o)=>e("option",{value:r,children:r},`option-${o}-${r}`)))})},i):o.useLink?e(ue,{column:o,item:n,colIndex:t,children:e(ge,{href:o?.linkOptions?.href||"#",item:n,className:o?.linkOptions?.className||"dynamic-table-link",children:be(o,n)})},i):o.useAction?function(r,o,t){try{return e(fe,{column:r,item:t,colIndex:o,children:r?.actionOptions?.components?r?.actionOptions?.components(t):null})}catch(n){return console.error("Error in handleAction:",n),e(fe,{column:r,item:t,colIndex:o,children:e("span",{style:{color:Q.danger},children:"Error"})})}}(o,t,n):e(ue,{column:o,item:n,colIndex:t,children:be(o,n)},i)}catch(r){return console.error("Error in celValue:",r),e(ue,{column:o,item:n,colIndex:t,children:e("span",{style:{color:Q.danger},children:"Error"})},`error-${t}`)}}function we(){if("undefined"==typeof window)return!1;return!!document.documentElement.classList.contains("dark")||!(!window.matchMedia||!window.matchMedia("(prefers-color-scheme: dark)").matches)}const ke=({tHeadProps:r,children:o})=>e("thead",{...r,className:X("text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-800 dark:text-gray-300 transition-colors",r?.className),children:o}),Ne=({tHeadTrProps:r,children:o})=>e("tr",{...r,className:X("border-b dark:border-gray-700",r?.className),children:o}),Ce=({tBodyTrProps:r,children:o})=>{const t="undefined"!=typeof self&&self.crypto?.randomUUID?self.crypto.randomUUID():`row-${Math.random().toString(36).substring(2,9)}`;return e("tr",{...r,className:X("odd:bg-white even:bg-gray-50 dark:odd:bg-gray-900 dark:even:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 dark:text-white border-b dark:border-gray-700 transition-colors",r?.className),children:o},t)},Pe=({tBodyProps:r,children:o})=>e("tbody",{...r,className:X("divide-y divide-gray-200 dark:divide-gray-700 transition-colors",r?.className),children:o}),Ee={boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",overflowX:"auto",padding:"0.5rem 1.25rem",zIndex:0,backgroundColor:Q.white,transition:"background-color 0.2s ease-in-out",borderRadius:"0.375rem"},Be={...Ee,boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.18)",backgroundColor:Q.gray900},Fe=({children:r,baseProps:o,id:t})=>{const{style:n,...a}=o||{},i={...we()?Be:Ee,...n};return e("div",{id:t,...a,className:K("dynamic-table-base",o?.className),style:i,children:r})},Ie=({children:r,tableBaseProps:o})=>e("div",{...o,className:X("overflow-x-auto max-h-[70vh] h-fit bg-white dark:bg-gray-900 rounded-lg transition-colors",o?.className),children:r}),je=({children:r,tableProps:o})=>e("table",{...o,className:X("w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400 transition-colors",o?.className),children:r}),ze=({column:e,colIndex:r,children:o})=>{const t=!0===e.useAction;return n("th",{...e.normalProps?.th,className:X("px-2 py-3 text-xs font-medium uppercase tracking-wider text-gray-700 dark:text-gray-300 transition-colors",t&&"text-end",e.normalProps?.th?.className),key:r,scope:"col"},o)};function $e(){const e=function(){const[e,r]=a(!1);return i((()=>{r(!0)}),[]),e}(),[r,o]=a(!1);return i((()=>{if(!e)return;const r=()=>{const e=document.documentElement.classList.contains("dark"),r=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;return e||r};o(r());const t=window.matchMedia("(prefers-color-scheme: dark)"),n=()=>o(r());t.addEventListener?t.addEventListener("change",n):t.addListener(n);const a=new MutationObserver((e=>{e.forEach((e=>{"class"===e.attributeName&&e.target===document.documentElement&&o(r())}))}));return a.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>{t.removeEventListener?t.removeEventListener("change",n):t.removeListener(n),a.disconnect()}}),[e]),r}var Oe=l((({items:o=[],columns:n=[],topContent:a,topContentOptions:i,usePagination:l=!1,pagination:c,emptyContent:d,isLoading:u=!1,loadingContent:p,tableName:m="Data",tBodyTrProps:f,tHeadTrProps:g,tBodyProps:h,tHeadProps:b,baseProps:y,tableBaseProps:x,tableProps:v,id:w})=>{const k=$e(),N=t((()=>w||`dynamic-table-${Math.random().toString(36).substring(2,9)}`),[w]),C=t((()=>n.map(((r,o)=>{try{return void 0===r?.showIf||!0===r.showIf?e(ze,{colIndex:o,column:r,children:r?.rename||r?.columnName||""},`th-${o}-${r?.columnName||o}`):null}catch(e){return console.error(`Error rendering table header at index ${o}:`,e),null}})).filter(Boolean)),[n]),P=s(((e,r)=>"undefined"!=typeof crypto&&crypto.randomUUID?crypto.randomUUID():`row-${r}-${Math.random().toString(36).substring(2,9)}`),[]),E=s(((e,r,o,t)=>{try{if(!1===e?.showIf)return null;if(e.useCondition&&e.condtions){const n=function(e,r){if(!e?.condtions||!Array.isArray(e.condtions))return null;try{return e.condtions.find((e=>{try{if("boolean"==typeof e.condtion)return!0===e.condtion;if(e.condtion&&Array.isArray(e.condtion.compare)&&e.condtion.compare.length>=1){const[o,t]=e.condtion.compare;let n=o;if("string"==typeof o&&o?.startsWith("[")&&o?.endsWith("]")){const e=o.slice(1,-1);n=te(r,e)}if(1===e.condtion.compare.length)return null!=n&&""!==n&&"undefined"!==n;let a=t;if("string"==typeof t&&t?.startsWith("[")&&t?.endsWith("]")){const e=t.slice(1,-1);a=te(r,e)}return String(n).toLowerCase()===String(a).toLowerCase()}return!1}catch(e){return console.error("Error evaluating condition:",e),!1}}))}catch(e){return console.error("Error in findTrueContion:",e),null}}(e,o);return n?.redner?ve(n.redner,r,o,`cell-${t}-${r}`):null}return ve(e,r,o,`cell-${t}-${r}`)}catch(e){return console.error(`Error rendering cell at row ${t}, column ${r}:`,e),null}}),[]),B=t((()=>o&&Array.isArray(o)&&0!==o.length?o.map(((r,o)=>{try{const t=P(r,o);return e(Ce,{tBodyTrProps:f,children:(()=>n.map(((e,t)=>E(e,t,r,o))).filter(Boolean))()},t)}catch(e){return console.error(`Error rendering row at index ${o}:`,e),null}})).filter(Boolean):null),[o,n,f,P,E]),F=t((()=>{try{return function(r,o){try{return void 0===r?e(de,{addButton:o?.addButton,searchInput:o?.searchInput,moreComponents:o?.moreComponents,baseProps:o?.baseProps,leftBaseProps:o?.leftBaseProps,rightBaseProps:o?.rightBaseProps,moreComponentBaseProps:o?.moreComponentBaseProps}):r}catch(r){return console.error("Error rendering top content:",r),e("div",{style:{padding:"0.75rem",backgroundColor:Q.white,borderBottom:`1px solid ${Q.gray200}`},children:"Error rendering top content"})}}(a,i)}catch(e){return console.error("Error rendering top content:",e),null}}),[a,i]),I=s((()=>{try{return u?e("div",{style:{width:"100%",height:"10rem",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:k?"#E5E7EB":"#6B7280",backgroundColor:k?"#111827":"#FFFFFF",transition:"colors 0.2s ease-in-out"},children:p||"Loading..."}):o&&o.length?null:e("div",{style:{width:"100%",height:"10rem",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:k?"#E5E7EB":"#6B7280",backgroundColor:k?"#111827":"#FFFFFF",transition:"colors 0.2s ease-in-out"},children:d||`No ${m} Available`})}catch(r){return console.error("Error rendering empty or loading state:",r),e("div",{style:{width:"100%",height:"10rem",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:k?"#E5E7EB":"#6B7280",backgroundColor:k?"#111827":"#FFFFFF"},children:"No data available"})}}),[u,o,p,d,m,k]);return r(Fe,{baseProps:y,id:N,children:[F,r(Ie,{tableBaseProps:x,children:[(Array.isArray(o)&&o.length>0||u)&&r(je,{tableProps:v,children:[e(ke,{tHeadProps:b,children:e(Ne,{tHeadTrProps:g,children:C})}),!u&&e(Pe,{tBodyProps:h,children:B})]}),I()]}),l&&c&&e(re,{pagination:c})]})}));const Ae=({children:r,onClick:o,props:t,className:n})=>e("li",{...t,onClick:t?.onClick||o,className:X(n,t?.className),children:r});export{fe as ActionTd,Fe as Base,oe as Chip,Oe as DynamicTable,Ae as Li,ge as Link,re as PaginationController,je as Table,Ie as TableBase,de as TableTopContent,Pe as Tbody,Ce as TbodyTr,ue as Td,ze as Th,ke as Thead,Ne as TheadTr,X as cn};
//# sourceMappingURL=index.esm.js.map