@rock10/ui 1.0.12 → 1.0.13

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.
@@ -2,7 +2,7 @@ import { ReactNode } from 'react';
2
2
 
3
3
  export interface PageHeaderProps {
4
4
  title: string;
5
- description?: string;
5
+ description?: ReactNode;
6
6
  badge?: ReactNode;
7
7
  actions?: ReactNode;
8
8
  breadcrumb?: ReactNode;
package/dist/index.es.js CHANGED
@@ -4823,7 +4823,7 @@ function Ns({
4823
4823
  /* @__PURE__ */ r.jsx("h1", { className: "text-2xl font-bold text-gray-900 dark:text-dark-text tracking-tight", children: e }),
4824
4824
  t && /* @__PURE__ */ r.jsx("div", { children: t })
4825
4825
  ] }),
4826
- a && /* @__PURE__ */ r.jsx("p", { className: "text-sm text-gray-500 dark:text-dark-text-muted mt-0.5 font-medium", children: a })
4826
+ a && /* @__PURE__ */ r.jsx("div", { className: "text-sm text-gray-500 dark:text-dark-text-muted mt-0.5 font-medium", children: a })
4827
4827
  ] }),
4828
4828
  o && /* @__PURE__ */ r.jsx("div", { className: "flex items-center gap-2.5 flex-wrap shrink-0", children: o })
4829
4829
  ]
package/dist/index.umd.js CHANGED
@@ -152,4 +152,4 @@ React keys must be passed directly to JSX without using spread:
152
152
  *
153
153
  * This source code is licensed under the ISC license.
154
154
  * See the LICENSE file in the root directory of this source tree.
155
- */const be=W("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ja=jr("inline-flex items-center justify-center font-bold transition-all select-none disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-none active:scale-[0.98]",{variants:{variant:{primary:"bg-primary-500 hover:bg-primary-600 active:bg-primary-700 text-white shadow-sm shadow-primary-500/20",secondary:"bg-gray-100 hover:bg-gray-200 dark:bg-dark-surface-light dark:hover:bg-gray-700 text-gray-700 dark:text-dark-text border border-gray-200 dark:border-dark-border",outline:"border border-gray-300 dark:border-dark-border text-gray-700 dark:text-dark-text hover:bg-gray-50 dark:hover:bg-dark-surface-light",ghost:"text-gray-600 dark:text-dark-text hover:bg-gray-100 dark:hover:bg-dark-surface-light",danger:"bg-red-600 hover:bg-red-700 active:bg-red-800 text-white shadow-sm shadow-red-600/20",success:"bg-emerald-600 hover:bg-emerald-700 active:bg-emerald-800 text-white shadow-sm shadow-emerald-600/20",purple:"bg-purple-600 hover:bg-purple-500 active:bg-purple-700 text-white shadow-sm shadow-purple-600/20",link:"text-primary-500 hover:text-primary-600 dark:text-primary-400 underline-offset-4 hover:underline p-0 h-auto font-semibold"},size:{sm:"h-8 px-3 text-xs gap-1.5 rounded-lg",md:"h-10 px-4 py-2 text-sm gap-2 rounded-xl",lg:"h-12 px-6 text-base gap-2.5 rounded-xl"},fullWidth:{true:"w-full",false:"w-auto"}},defaultVariants:{variant:"primary",size:"md",fullWidth:!1}}),zr=k.forwardRef(({className:e,variant:a,size:t,fullWidth:o,isLoading:n=!1,leftIcon:l,rightIcon:i,children:c,disabled:m,...d},f)=>r.jsxs("button",{ref:f,disabled:m||n,className:x(ja({variant:a,size:t,fullWidth:o}),e),...d,children:[n?r.jsx(De,{className:"w-4 h-4 animate-spin shrink-0"}):l&&r.jsx("span",{className:"shrink-0",children:l}),c&&r.jsx("span",{children:c}),!n&&i&&r.jsx("span",{className:"shrink-0",children:i})]}));zr.displayName="Button";const Ar=k.forwardRef(({className:e,label:a,error:t,helperText:o,startIcon:n,endIcon:l,clearable:i=!1,onClear:c,inputSize:m="md",fullWidth:d=!0,disabled:f,value:y,id:N,...v},C)=>{const S=N||(a?`input-${a.toLowerCase().replace(/\s+/g,"-")}`:void 0),T={sm:"h-8 px-2.5 text-xs rounded-lg",md:"h-10 px-3.5 text-sm rounded-xl",lg:"h-12 px-4 text-base rounded-xl"};return r.jsxs("div",{className:x("flex flex-col gap-1.5",d&&"w-full"),children:[a&&r.jsx("label",{htmlFor:S,className:"text-xs font-bold uppercase tracking-wider text-gray-700 dark:text-dark-text",children:a}),r.jsxs("div",{className:"relative flex items-center w-full",children:[n&&r.jsx("div",{className:"absolute left-3.5 flex items-center pointer-events-none text-gray-400 dark:text-dark-text-muted",children:n}),r.jsx("input",{id:S,ref:C,disabled:f,value:y,className:x("w-full bg-gray-50 dark:bg-dark-bg border border-gray-200 dark:border-dark-border text-gray-900 dark:text-dark-text placeholder-gray-400 dark:placeholder-gray-500 font-medium transition-all focus:outline-none focus:bg-white dark:focus:bg-dark-bg focus:border-primary-500 focus:ring-2 focus:ring-primary-500/20 disabled:bg-gray-100 dark:disabled:bg-dark-surface disabled:opacity-60 disabled:cursor-not-allowed",T[m],n&&"pl-10",(l||i&&y)&&"pr-10",t&&"border-red-500 focus:border-red-500 focus:ring-red-500/20 text-red-900 dark:text-red-300",e),...v}),i&&y&&!f&&r.jsx("button",{type:"button",onClick:c,className:"absolute right-3 p-1 rounded-md text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors",children:r.jsx(be,{className:"w-3.5 h-3.5"})}),!i&&l&&r.jsx("div",{className:"absolute right-3.5 flex items-center pointer-events-none text-gray-400 dark:text-dark-text-muted",children:l})]}),t&&r.jsx("span",{className:"text-xs font-semibold text-red-500",children:t}),!t&&o&&r.jsx("span",{className:"text-xs text-gray-500 dark:text-dark-text-muted",children:o})]})});Ar.displayName="Input";const Or=k.forwardRef(({className:e,label:a,error:t,helperText:o,options:n,selectSize:l="md",fullWidth:i=!0,disabled:c,children:m,id:d,...f},y)=>{const N=d||(a?`select-${a.toLowerCase().replace(/\s+/g,"-")}`:void 0),v={sm:"h-8 pl-2.5 pr-8 text-xs rounded-lg",md:"h-10 pl-3.5 pr-10 text-sm rounded-xl",lg:"h-12 pl-4 pr-12 text-base rounded-xl"};return r.jsxs("div",{className:x("flex flex-col gap-1.5",i&&"w-full"),children:[a&&r.jsx("label",{htmlFor:N,className:"text-xs font-bold uppercase tracking-wider text-gray-700 dark:text-dark-text",children:a}),r.jsxs("div",{className:"relative flex items-center w-full",children:[r.jsx("select",{id:N,ref:y,disabled:c,className:x("w-full appearance-none bg-gray-50 dark:bg-dark-bg border border-gray-200 dark:border-dark-border text-gray-900 dark:text-dark-text font-medium transition-all focus:outline-none focus:bg-white dark:focus:bg-dark-bg focus:border-primary-500 focus:ring-2 focus:ring-primary-500/20 disabled:bg-gray-100 dark:disabled:bg-dark-surface disabled:opacity-60 disabled:cursor-not-allowed cursor-pointer",v[l],t&&"border-red-500 focus:border-red-500 focus:ring-red-500/20 text-red-900 dark:text-red-300",e),...f,children:n?n.map(C=>r.jsx("option",{value:C.value,disabled:C.disabled,children:C.label},C.value)):m}),r.jsx("div",{className:"absolute right-3 pointer-events-none text-gray-400 dark:text-dark-text-muted",children:r.jsx(Rr,{className:"w-4 h-4"})})]}),t&&r.jsx("span",{className:"text-xs font-semibold text-red-500",children:t}),!t&&o&&r.jsx("span",{className:"text-xs text-gray-500 dark:text-dark-text-muted",children:o})]})});Or.displayName="Select";const Fr=k.forwardRef(({className:e,label:a,error:t,helperText:o,fullWidth:n=!0,disabled:l,rows:i=3,id:c,...m},d)=>{const f=c||(a?`textarea-${a.toLowerCase().replace(/\s+/g,"-")}`:void 0);return r.jsxs("div",{className:x("flex flex-col gap-1.5",n&&"w-full"),children:[a&&r.jsx("label",{htmlFor:f,className:"text-xs font-bold uppercase tracking-wider text-gray-700 dark:text-dark-text",children:a}),r.jsx("textarea",{id:f,ref:d,rows:i,disabled:l,className:x("w-full p-3 bg-gray-50 dark:bg-dark-bg border border-gray-200 dark:border-dark-border text-gray-900 dark:text-dark-text placeholder-gray-400 dark:placeholder-gray-500 text-sm font-medium rounded-xl transition-all focus:outline-none focus:bg-white dark:focus:bg-dark-bg focus:border-primary-500 focus:ring-2 focus:ring-primary-500/20 disabled:bg-gray-100 dark:disabled:bg-dark-surface disabled:opacity-60 disabled:cursor-not-allowed resize-y",t&&"border-red-500 focus:border-red-500 focus:ring-red-500/20 text-red-900 dark:text-red-300",e),...m}),t&&r.jsx("span",{className:"text-xs font-semibold text-red-500",children:t}),!t&&o&&r.jsx("span",{className:"text-xs text-gray-500 dark:text-dark-text-muted",children:o})]})});Fr.displayName="Textarea";const Ir=k.forwardRef(({className:e,label:a,description:t,checked:o,disabled:n,id:l,onChange:i,...c},m)=>{const d=l||(typeof a=="string"?`checkbox-${a.toLowerCase().replace(/\s+/g,"-")}`:void 0);return r.jsxs("label",{htmlFor:d,className:x("inline-flex items-start gap-2.5 select-none cursor-pointer group",n&&"opacity-60 cursor-not-allowed pointer-events-none",e),children:[r.jsxs("div",{className:"relative flex items-center justify-center shrink-0 mt-0.5",children:[r.jsx("input",{id:d,ref:m,type:"checkbox",checked:o,disabled:n,onChange:i,className:"peer sr-only",...c}),r.jsx("div",{className:x("w-5 h-5 rounded-md border border-gray-300 dark:border-dark-border bg-white dark:bg-dark-surface transition-all flex items-center justify-center peer-checked:bg-primary-500 peer-checked:border-primary-500 peer-focus-visible:ring-2 peer-focus-visible:ring-primary-500/30 group-hover:border-primary-500/60 shadow-xs",o&&"bg-primary-500 border-primary-500 text-white"),children:o&&r.jsx(Cr,{className:"w-3.5 h-3.5 stroke-[3] text-white"})})]}),(a||t)&&r.jsxs("div",{className:"flex flex-col",children:[a&&r.jsx("span",{className:"text-sm font-semibold text-gray-800 dark:text-dark-text leading-tight",children:a}),t&&r.jsx("span",{className:"text-xs text-gray-500 dark:text-dark-text-muted mt-0.5",children:t})]})]})});Ir.displayName="Checkbox";const Mr=k.forwardRef(({className:e,label:a,description:t,checked:o,disabled:n,switchSize:l="md",id:i,onChange:c,...m},d)=>{const f=i||(typeof a=="string"?`switch-${a.toLowerCase().replace(/\s+/g,"-")}`:void 0),y={sm:"w-8 h-4.5",md:"w-11 h-6",lg:"w-14 h-7.5"},N={sm:"w-3.5 h-3.5 translate-x-0.5 peer-checked:translate-x-4",md:"w-5 h-5 translate-x-0.5 peer-checked:translate-x-5.5",lg:"w-6.5 h-6.5 translate-x-0.5 peer-checked:translate-x-7"};return r.jsxs("label",{htmlFor:f,className:x("inline-flex items-center gap-3 select-none cursor-pointer group",n&&"opacity-60 cursor-not-allowed pointer-events-none",e),children:[r.jsxs("div",{className:"relative inline-flex items-center shrink-0",children:[r.jsx("input",{id:f,ref:d,type:"checkbox",role:"switch",checked:o,disabled:n,onChange:c,className:"peer sr-only",...m}),r.jsx("div",{className:x("rounded-full bg-gray-200 dark:bg-dark-surface-light peer-checked:bg-primary-500 transition-colors duration-200 ease-in-out border border-transparent shadow-inner",y[l])}),r.jsx("div",{className:x("absolute bg-white rounded-full shadow-md transform transition-transform duration-200 ease-in-out pointer-events-none",N[l])})]}),(a||t)&&r.jsxs("div",{className:"flex flex-col",children:[a&&r.jsx("span",{className:"text-sm font-semibold text-gray-800 dark:text-dark-text leading-tight",children:a}),t&&r.jsx("span",{className:"text-xs text-gray-500 dark:text-dark-text-muted mt-0.5",children:t})]})]})});Mr.displayName="Switch";const Na=jr("inline-flex items-center font-bold tracking-tight transition-colors select-none shrink-0",{variants:{variant:{success:"bg-emerald-50 dark:bg-emerald-950/30 text-emerald-700 dark:text-emerald-300 border border-emerald-200 dark:border-emerald-800/60",danger:"bg-red-50 dark:bg-red-950/30 text-red-700 dark:text-red-400 border border-red-200 dark:border-red-800/60",warning:"bg-amber-50 dark:bg-amber-950/30 text-amber-700 dark:text-amber-400 border border-amber-200 dark:border-amber-800/60",info:"bg-blue-50 dark:bg-blue-950/30 text-blue-700 dark:text-blue-300 border border-blue-200 dark:border-blue-800/60",purple:"bg-purple-50 dark:bg-purple-950/30 text-purple-700 dark:text-purple-300 border border-purple-200 dark:border-purple-800/60",neutral:"bg-gray-100 dark:bg-dark-surface-light text-gray-700 dark:text-dark-text-muted border border-gray-200 dark:border-dark-border",primary:"bg-primary-50 dark:bg-primary-950/30 text-primary-700 dark:text-primary-300 border border-primary-200 dark:border-primary-800/60",secondary:"bg-secondary-50 dark:bg-secondary-950/30 text-secondary-700 dark:text-secondary-300 border border-secondary-200 dark:border-secondary-800/60"},size:{sm:"text-[10px] px-2 py-0.5 gap-1",md:"text-xs px-2.5 py-1 gap-1.5"},shape:{pill:"rounded-full",rounded:"rounded-md"}},defaultVariants:{variant:"neutral",size:"sm",shape:"pill"}}),_a={success:"bg-emerald-500",danger:"bg-red-500",warning:"bg-amber-500",info:"bg-blue-500",purple:"bg-purple-500",neutral:"bg-gray-400",primary:"bg-primary-500",secondary:"bg-secondary-500"};function Dr({className:e,variant:a="neutral",size:t="sm",shape:o="pill",dot:n=!1,pulseDot:l=!1,children:i,...c}){const d=_a[a||"neutral"]||"bg-gray-400";return r.jsxs("span",{className:x(Na({variant:a,size:t,shape:o}),e),...c,children:[n&&r.jsxs("span",{className:"relative flex h-1.5 w-1.5 shrink-0",children:[l&&r.jsx("span",{className:x("animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",d)}),r.jsx("span",{className:x("relative inline-flex rounded-full h-1.5 w-1.5",d)})]}),i]})}function Se({className:e,variant:a="text",width:t,height:o,style:n,...l}){const i={text:"h-4 rounded-md w-full",circular:"rounded-full",rectangular:"rounded-xl",card:"h-32 rounded-2xl w-full"};return r.jsx("div",{className:x("animate-pulse bg-gray-200/80 dark:bg-dark-surface-light/80",i[a],e),style:{width:typeof t=="number"?`${t}px`:t,height:typeof o=="number"?`${o}px`:o,...n},...l})}const Lr=({icon:e,variant:a="primary",size:t="md",rounded:o=!1,ariaLabel:n,disabled:l=!1,loading:i=!1,className:c="",...m})=>{const d="relative inline-flex items-center justify-center gap-2 border-none font-semibold cursor-pointer transition-all select-none -webkit-tap-highlight-color-transparent outline-none focus-visible:ring-3 focus-visible:ring-primary-300 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-none active:scale-95 duration-150",f={primary:"bg-gradient-to-br from-primary-500 to-primary-600 text-white shadow-md hover:from-primary-600 hover:to-primary-700 hover:shadow-lg hover:-translate-y-0.5",secondary:"bg-gray-100 dark:bg-dark-surface text-gray-700 dark:text-dark-text border border-gray-300 dark:border-dark-border hover:bg-gray-200 dark:hover:bg-dark-surface-light hover:-translate-y-0.5",ghost:"bg-transparent text-gray-600 dark:text-dark-text-muted hover:bg-gray-100 dark:hover:bg-dark-surface hover:text-gray-800 dark:hover:text-dark-text",danger:"bg-gradient-to-br from-red-500 to-red-600 text-white shadow-md hover:from-red-600 hover:to-red-700 hover:shadow-lg hover:-translate-y-0.5"},y=o?{sm:"w-8 h-8 rounded-full p-0 text-base",md:"w-10 h-10 rounded-full p-0 text-lg sm:w-11 sm:h-11",lg:"w-12 h-12 rounded-full p-0 text-xl sm:w-13 sm:h-13"}:{sm:"px-3 py-1.5 text-sm rounded-md min-h-[32px]",md:"px-4 py-2 text-base rounded-md min-h-[40px] sm:min-h-[44px]",lg:"px-6 py-3 text-lg rounded-lg min-h-[48px] sm:min-h-[52px]"};return r.jsx("button",{className:x(d,f[a],y[t],i&&"pointer-events-none",c),"aria-label":n,disabled:l||i,...m,children:i?r.jsx(De,{className:"w-4 h-4 animate-spin",role:"status","aria-hidden":"true"}):r.jsx("span",{className:"flex items-center justify-center leading-none",children:e})})},Vr=k.forwardRef(({className:e,hoverable:a=!1,padded:t=!0,children:o,...n},l)=>r.jsx("div",{ref:l,className:x("bg-white dark:bg-dark-surface border border-gray-150 dark:border-dark-border rounded-2xl shadow-xs transition-all duration-200 overflow-hidden",t&&"p-5 sm:p-6",a&&"hover:shadow-md hover:-translate-y-0.5 cursor-pointer",e),...n,children:o}));Vr.displayName="Card";const Br=k.forwardRef(({className:e,actions:a,children:t,...o},n)=>r.jsxs("div",{ref:n,className:x("flex items-center justify-between gap-4 mb-4",e),...o,children:[r.jsx("div",{className:"flex flex-col gap-1",children:t}),a&&r.jsx("div",{className:"flex items-center gap-2 shrink-0",children:a})]}));Br.displayName="CardHeader";const Wr=k.forwardRef(({className:e,children:a,...t},o)=>r.jsx("h3",{ref:o,className:x("text-base font-bold text-gray-900 dark:text-dark-text tracking-tight",e),...t,children:a}));Wr.displayName="CardTitle";const Gr=k.forwardRef(({className:e,children:a,...t},o)=>r.jsx("p",{ref:o,className:x("text-xs text-gray-500 dark:text-dark-text-muted font-medium",e),...t,children:a}));Gr.displayName="CardDescription";const Ur=k.forwardRef(({className:e,children:a,...t},o)=>r.jsx("div",{ref:o,className:x("space-y-4",e),...t,children:a}));Ur.displayName="CardContent";const Hr=k.forwardRef(({className:e,children:a,...t},o)=>r.jsx("div",{ref:o,className:x("flex items-center justify-end gap-3 pt-4 mt-4 border-t border-gray-100 dark:border-dark-border",e),...t,children:a}));Hr.displayName="CardFooter";const Yr={purple:{text:"text-purple-600 dark:text-purple-400",bg:"bg-purple-100 dark:bg-purple-900/30 text-purple-600 dark:text-purple-400",border:"border-purple-200/50 dark:border-purple-950/20"},blue:{text:"text-blue-600 dark:text-blue-400",bg:"bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400",border:"border-blue-200/50 dark:border-blue-950/20"},emerald:{text:"text-emerald-600 dark:text-emerald-400",bg:"bg-emerald-100 dark:bg-emerald-900/30 text-emerald-600 dark:text-emerald-400",border:"border-emerald-200/50 dark:border-emerald-950/20"},amber:{text:"text-amber-600 dark:text-amber-400",bg:"bg-amber-100 dark:bg-amber-900/30 text-amber-600 dark:text-amber-400",border:"border-amber-200/50 dark:border-amber-950/20"},red:{text:"text-red-600 dark:text-red-400",bg:"bg-red-100 dark:bg-red-900/30 text-red-600 dark:text-red-400",border:"border-red-200/50 dark:border-red-950/20"},cyan:{text:"text-cyan-600 dark:text-cyan-400",bg:"bg-cyan-100 dark:bg-cyan-900/30 text-cyan-600 dark:text-cyan-400",border:"border-cyan-200/50 dark:border-cyan-950/20"},pink:{text:"text-pink-600 dark:text-pink-400",bg:"bg-pink-100 dark:bg-pink-900/30 text-pink-600 dark:text-pink-400",border:"border-pink-200/50 dark:border-pink-950/20"},yellow:{text:"text-yellow-600 dark:text-yellow-400",bg:"bg-yellow-100 dark:bg-yellow-900/30 text-yellow-600 dark:text-yellow-400",border:"border-yellow-200/50 dark:border-yellow-950/20"}};function Ca({title:e,value:a,subtitle:t,icon:o,color:n="purple",isLoading:l=!1,animateValue:i=!0,className:c,onClick:m}){const[d,f]=k.useState(typeof a=="number"&&i?0:a),y=Yr[n]||Yr.purple;return k.useEffect(()=>{if(typeof a!="number"||!i){f(a);return}let N=!0,v=null;const C=1e3,S=T=>{if(!N)return;v||(v=T);const z=Math.min((T-v)/C,1),E=z*(2-z),X=Math.floor(E*a);f(X.toLocaleString("pt-BR")),z<1?window.requestAnimationFrame(S):f(a.toLocaleString("pt-BR"))};return window.requestAnimationFrame(S),()=>{N=!1}},[a,i]),l?r.jsxs("div",{className:"bg-white dark:bg-dark-surface p-5 rounded-2xl border border-gray-150 dark:border-dark-border shadow-xs",children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsx(Se,{width:"50%",height:14}),r.jsx(Se,{variant:"circular",width:40,height:40})]}),r.jsx(Se,{width:"40%",height:32,className:"my-2"}),r.jsx(Se,{width:"70%",height:12})]}):r.jsxs("div",{onClick:m,className:x("bg-white dark:bg-dark-surface p-5 rounded-2xl border border-gray-150 dark:border-dark-border shadow-xs hover:shadow-sm transition-all",m&&"cursor-pointer hover:-translate-y-0.5",c),children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsx("span",{className:x("text-xs font-bold uppercase tracking-wider",y.text),children:e}),o&&r.jsx("div",{className:x("w-10 h-10 rounded-xl flex items-center justify-center shrink-0",y.bg),children:o})]}),r.jsx("div",{className:"text-3xl font-black text-gray-900 dark:text-dark-text tracking-tight",children:typeof a=="number"&&!i?a.toLocaleString("pt-BR"):d}),t&&r.jsx("div",{className:"text-xs text-gray-500 dark:text-dark-text-muted font-medium mt-1.5 flex items-center gap-1",children:t})]})}function Ra({variant:e="info",title:a,children:t,icon:o,onClose:n,className:l}){const c={info:{container:"bg-blue-50 dark:bg-blue-950/30 border-blue-200 dark:border-blue-800/60 text-blue-900 dark:text-blue-200",icon:r.jsx(ha,{className:"w-5 h-5 text-blue-600 dark:text-blue-400 shrink-0"})},success:{container:"bg-emerald-50 dark:bg-emerald-950/30 border-emerald-200 dark:border-emerald-800/60 text-emerald-900 dark:text-emerald-200",icon:r.jsx(xa,{className:"w-5 h-5 text-emerald-600 dark:text-emerald-400 shrink-0"})},warning:{container:"bg-amber-50 dark:bg-amber-950/30 border-amber-200 dark:border-amber-800/60 text-amber-900 dark:text-amber-200",icon:r.jsx(Pr,{className:"w-5 h-5 text-amber-600 dark:text-amber-400 shrink-0"})},danger:{container:"bg-red-50 dark:bg-red-950/30 border-red-200 dark:border-red-800/60 text-red-900 dark:text-red-200",icon:r.jsx(fa,{className:"w-5 h-5 text-red-600 dark:text-red-400 shrink-0"})}}[e];return r.jsxs("div",{role:"alert",className:x("p-4 rounded-xl border flex items-start gap-3 relative transition-all",c.container,l),children:[r.jsx("div",{className:"mt-0.5",children:o||c.icon}),r.jsxs("div",{className:"flex-1 text-sm",children:[a&&r.jsx("h5",{className:"font-bold text-sm mb-1",children:a}),r.jsx("div",{className:"font-medium text-xs sm:text-sm leading-relaxed",children:t})]}),n&&r.jsx("button",{onClick:n,className:"p-1 rounded-md text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors",children:r.jsx(be,{className:"w-4 h-4"})})]})}const Kr=k.forwardRef(({className:e,bordered:a=!0,children:t,...o},n)=>r.jsx("div",{ref:n,className:x("w-full overflow-x-auto rounded-2xl bg-white dark:bg-dark-surface shadow-xs",a&&"border border-gray-150 dark:border-dark-border",e),...o,children:t}));Kr.displayName="TableContainer";const Jr=k.forwardRef(({className:e,...a},t)=>r.jsx("table",{ref:t,className:x("w-full text-left text-sm border-collapse",e),...a}));Jr.displayName="Table";const Xr=k.forwardRef(({className:e,...a},t)=>r.jsx("thead",{ref:t,className:x("bg-gray-50/80 dark:bg-dark-surface-light/80 border-b border-gray-150 dark:border-dark-border text-gray-600 dark:text-dark-text-muted text-xs uppercase font-bold tracking-wider",e),...a}));Xr.displayName="TableHeader";const Zr=k.forwardRef(({className:e,...a},t)=>r.jsx("tbody",{ref:t,className:x("divide-y divide-gray-100 dark:divide-dark-border",e),...a}));Zr.displayName="TableBody";const Qr=k.forwardRef(({className:e,...a},t)=>r.jsx("tr",{ref:t,className:x("transition-colors hover:bg-gray-50/60 dark:hover:bg-dark-surface-light/40 data-[state=selected]:bg-gray-50",e),...a}));Qr.displayName="TableRow";const $r=k.forwardRef(({className:e,...a},t)=>r.jsx("th",{ref:t,className:x("px-6 py-4 text-left font-bold text-gray-600 dark:text-dark-text-muted select-none text-xs uppercase tracking-wider",e),...a}));$r.displayName="TableHead";const qr=k.forwardRef(({className:e,...a},t)=>r.jsx("td",{ref:t,className:x("px-6 py-4 align-middle text-gray-800 dark:text-dark-text text-sm font-medium",e),...a}));qr.displayName="TableCell";function Sa({title:e="Filtros",hasActiveFilters:a=!1,activeFiltersCount:t,onClearFilters:o,children:n,className:l}){return r.jsxs("div",{className:x("bg-white dark:bg-dark-surface p-4 sm:p-5 rounded-2xl border border-gray-150 dark:border-dark-border shadow-xs space-y-3",l),children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"p-1.5 rounded-lg bg-purple-50 dark:bg-purple-950/40 text-purple-600 dark:text-purple-400",children:r.jsx(ga,{className:"w-4 h-4"})}),r.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-gray-700 dark:text-dark-text",children:e}),a&&r.jsx("span",{className:"px-2 py-0.5 rounded-full text-[10px] font-extrabold bg-purple-100 dark:bg-purple-900/40 text-purple-700 dark:text-purple-300",children:t!==void 0?`${t} ${t===1?"ativo":"ativos"}`:"Filtro Ativo"})]}),a&&o&&r.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-1 text-xs font-bold text-red-500 hover:text-red-600 dark:hover:text-red-400 transition-colors cursor-pointer",children:[r.jsx(be,{className:"w-3.5 h-3.5"}),"Limpar Filtros"]})]}),r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3 pt-1",children:n})]})}function Ta({title:e,description:a,badge:t,actions:o,breadcrumb:n,className:l}){return r.jsxs("div",{className:x("flex flex-col sm:flex-row sm:items-center justify-between gap-4 select-none",l),children:[r.jsxs("div",{className:"flex flex-col gap-1",children:[n&&r.jsx("div",{className:"text-xs text-gray-500 mb-0.5",children:n}),r.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[r.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-dark-text tracking-tight",children:e}),t&&r.jsx("div",{children:t})]}),a&&r.jsx("p",{className:"text-sm text-gray-500 dark:text-dark-text-muted mt-0.5 font-medium",children:a})]}),o&&r.jsx("div",{className:"flex items-center gap-2.5 flex-wrap shrink-0",children:o})]})}const Ea=({variant:e="spinner",size:a="md",text:t,fullScreen:o=!1})=>{const n={sm:"w-6 h-6",md:"w-10 h-10",lg:"w-16 h-16"},l={sm:"text-xs",md:"text-sm font-medium",lg:"text-base font-semibold"};if(e==="skeleton")return r.jsxs("div",{className:x("w-full bg-white dark:bg-dark-surface border border-gray-150 dark:border-dark-border rounded-xl overflow-hidden shadow-sm animate-pulse",a==="sm"?"max-w-xs":a==="md"?"max-w-sm":"max-w-md"),children:[r.jsx("div",{className:"aspect-video bg-gray-200 dark:bg-dark-surface-light w-full"}),r.jsxs("div",{className:"p-4 space-y-3",children:[r.jsx("div",{className:"h-4 bg-gray-200 dark:bg-dark-surface-light rounded w-3/4"}),r.jsx("div",{className:"h-3 bg-gray-200 dark:bg-dark-surface-light rounded w-1/2"}),r.jsx("div",{className:"h-3 bg-gray-200 dark:bg-dark-surface-light rounded w-5/6"})]})]});const i=r.jsxs("div",{className:"flex flex-col items-center justify-center space-y-3 p-4",children:[r.jsx(De,{className:x("text-primary-500 animate-spin",n[a])}),t&&r.jsx("p",{className:x("text-gray-500 dark:text-dark-text-muted select-none",l[a]),children:t})]});return o?r.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-white/80 dark:bg-dark-bg/80 backdrop-blur-sm",children:i}):r.jsx("div",{className:"flex items-center justify-center w-full",children:i})};function et({isOpen:e,onClose:a,title:t,children:o,footer:n,size:l="md",closeOnOutsideClick:i=!1}){if(k.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset"}),[e]),!e)return null;const c={sm:"max-w-md",md:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl"};return r.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm animate-[fadeIn_0.2s_ease-out]",children:[r.jsx("div",{className:"fixed inset-0",onClick:i?a:void 0}),r.jsxs("div",{className:x("relative w-full bg-white dark:bg-dark-surface border border-gray-150 dark:border-dark-border rounded-xl shadow-xl overflow-hidden flex flex-col max-h-[90vh] z-10 animate-[slideUp_0.2s_ease-out]",c[l]),children:[r.jsxs("div",{className:"flex justify-between items-center px-6 py-4 border-b border-gray-100 dark:border-dark-border",children:[r.jsx("h2",{className:"text-lg font-bold text-gray-900 dark:text-dark-text",children:t}),r.jsx("button",{className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors p-1.5 hover:bg-gray-100 dark:hover:bg-dark-surface-light rounded-lg cursor-pointer",onClick:a,children:r.jsx(be,{className:"w-5 h-5"})})]}),r.jsx("div",{className:"p-6 overflow-y-auto flex-1 text-sm text-gray-700 dark:text-dark-text-muted",children:o}),n&&r.jsx("div",{className:"flex justify-end items-center gap-3 px-6 py-4 border-t border-gray-100 dark:border-dark-border bg-gray-50/50 dark:bg-dark-surface/50",children:n})]})]})}function Pa({isOpen:e,onClose:a,onConfirm:t,title:o,message:n,confirmText:l="Confirmar",cancelText:i="Cancelar",isLoading:c=!1}){return r.jsx(et,{isOpen:e,onClose:a,title:o,size:"sm",footer:r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"px-4 py-2 text-sm font-semibold text-gray-700 dark:text-dark-text bg-gray-100 hover:bg-gray-200 dark:bg-dark-surface-light dark:hover:bg-gray-700 rounded-lg transition-all disabled:opacity-50 cursor-pointer",onClick:a,disabled:c,children:i}),r.jsx("button",{className:"px-4 py-2 text-sm font-semibold text-white bg-red-600 hover:bg-red-700 active:scale-[0.98] rounded-lg shadow-sm transition-all disabled:opacity-50 cursor-pointer",onClick:t,disabled:c,children:c?"Aguarde...":l})]}),children:r.jsxs("div",{className:"flex gap-4 items-start",children:[r.jsx("div",{className:"p-2.5 bg-red-50 dark:bg-red-950/20 text-red-600 dark:text-red-400 rounded-xl",children:r.jsx(Pr,{className:"w-6 h-6 flex-shrink-0"})}),r.jsx("div",{children:r.jsx("p",{className:"text-gray-600 dark:text-dark-text-muted mt-1 leading-relaxed",children:n})})]})})}const za=({icon:e,title:a,description:t,action:o,variant:n="default"})=>{const l={default:"text-primary-500 bg-primary-50 dark:bg-primary-950/20",error:"text-red-500 bg-red-50 dark:bg-red-950/20",search:"text-secondary-500 bg-secondary-50 dark:bg-secondary-950/20"};return r.jsxs("div",{className:x("flex flex-col items-center justify-center p-8 sm:p-12 text-center min-h-[300px] sm:min-h-[400px] animate-fadeIn group"),children:[e&&r.jsx("div",{className:x("flex items-center justify-center w-16 h-16 sm:w-20 sm:h-20 mb-6 text-4xl sm:text-[48px] rounded-full transition-all duration-200 group-hover:scale-105 group-hover:bg-opacity-80",l[n]),children:e}),r.jsxs("div",{className:"max-w-[500px] mb-6 space-y-2",children:[r.jsx("h3",{className:"text-xl sm:text-2xl font-bold font-heading text-gray-900 dark:text-dark-text leading-tight",children:a}),t&&r.jsx("p",{className:"text-sm sm:text-base text-gray-600 dark:text-dark-text-muted leading-relaxed",children:t})]}),o&&r.jsx("button",{className:"inline-flex items-center justify-center px-6 py-3 font-semibold text-white bg-gradient-to-br from-primary-500 to-primary-600 rounded-lg shadow-md transition-all duration-200 cursor-pointer hover:from-primary-600 hover:to-primary-700 hover:shadow-lg hover:-translate-y-0.5 active:scale-95 active:translate-y-0 min-h-[44px]",onClick:o.onClick,children:o.label})]})},Aa=({onSearch:e,debounceMs:a=300,placeholder:t="Pesquisar vídeos...",initialValue:o="",showClear:n=!0,autoFocus:l=!1,size:i="md",className:c="",...m})=>{const[d,f]=k.useState(o),[y,N]=k.useState(!1),v=k.useRef(null),C=k.useRef();k.useEffect(()=>{l&&v.current&&v.current.focus()},[l]),k.useEffect(()=>(C.current&&clearTimeout(C.current),C.current=setTimeout(()=>{e(d)},a),()=>{C.current&&clearTimeout(C.current)}),[d,e,a]);const S=G=>{f(G.target.value)},T=()=>{var G;f(""),(G=v.current)==null||G.focus()},z=G=>{G.key==="Escape"&&T()},E={sm:"h-9 text-sm rounded-lg",md:"h-11 sm:h-12 text-base rounded-xl",lg:"h-13 sm:h-14 text-lg rounded-2xl"},X={sm:"w-4 h-4 ml-3",md:"w-5 h-5 ml-4",lg:"w-6 h-6 ml-5"};return r.jsxs("div",{className:x("relative flex items-center w-full max-w-[600px] bg-white dark:bg-dark-surface border border-gray-300 dark:border-dark-border shadow-sm transition-all duration-150 overflow-hidden",y?"border-primary-500 ring-3 ring-primary-100 dark:ring-primary-900/30":"hover:border-gray-400 dark:hover:border-dark-border/80 hover:shadow",E[i],c),children:[r.jsx(va,{className:x("text-gray-400 dark:text-dark-text-muted flex-shrink-0",X[i]),"aria-hidden":"true"}),r.jsx("input",{ref:v,type:"text",className:"flex-1 h-full px-3 py-2 border-none bg-transparent font-sans text-gray-900 dark:text-dark-text outline-none placeholder-gray-400 dark:placeholder-dark-text-muted text-inherit",value:d,onChange:S,onKeyDown:z,onFocus:()=>N(!0),onBlur:()=>N(!1),placeholder:t,"aria-label":"Campo de busca",...m}),n&&d&&r.jsx("button",{type:"button",className:x("flex items-center justify-center mr-3 bg-gray-150 dark:bg-dark-surface-light border-none rounded-full cursor-pointer text-gray-500 dark:text-dark-text-muted transition-all duration-150 flex-shrink-0 hover:bg-gray-200 dark:hover:bg-dark-surface-light/80 hover:scale-105 active:scale-95",i==="sm"?"w-5 h-5 p-0.5":i==="md"?"w-6 h-6 p-1":"w-7 h-7 p-1.5"),onClick:T,"aria-label":"Limpar busca",children:r.jsx(be,{className:"w-full h-full"})})]})},Oa=({onDateSelect:e,label:a="Selecione uma data",maxDate:t,minDate:o,initialDate:n})=>{const[l,i]=k.useState(n||"");k.useEffect(()=>{i(n||"")},[n]);const c=m=>{const d=m.target.value;i(d),e(d)};return r.jsxs("div",{className:"flex flex-col gap-2.5 w-full max-w-[400px] md:max-w-full",children:[r.jsx("label",{htmlFor:"date-picker",className:"font-sans text-xs font-semibold text-gray-700 dark:text-dark-text-muted uppercase tracking-wider",children:a}),r.jsx("input",{id:"date-picker",type:"date",value:l,onChange:c,max:t,min:o,className:x("w-full px-4 py-3 font-sans text-base font-medium border-2 border-gray-300 dark:border-dark-border rounded-xl bg-white dark:bg-dark-surface text-gray-900 dark:text-dark-text shadow-sm cursor-pointer outline-none transition-all duration-200","hover:border-primary-400 hover:shadow-md focus:border-primary-500 focus:ring-3 focus:ring-primary-100 dark:focus:ring-primary-900/30","webkit-calendar-picker-indicator:cursor-pointer webkit-calendar-picker-indicator:p-1 webkit-calendar-picker-indicator:rounded-md webkit-calendar-picker-indicator:transition-colors hover:webkit-calendar-picker-indicator:bg-primary-50")})]})},Fa=({onDateChange:e,initialStartDate:a,initialEndDate:t,allowRange:o=!0,placeholder:n="Selecionar data"})=>{const[l,i]=k.useState(a||""),[c,m]=k.useState(t||""),[d,f]=k.useState(null),[y,N]=k.useState(!1),v=()=>new Date().toISOString().split("T")[0],C=()=>{const O=new Date;return O.setDate(O.getDate()-1),O.toISOString().split("T")[0]},S=O=>{const I=new Date;return I.setDate(I.getDate()-O),I.toISOString().split("T")[0]},T=O=>{switch(f(O),O){case"today":i(v()),m(v()),e(v(),v());break;case"yesterday":i(C()),m(C()),e(C(),C());break;case"last7days":i(S(7)),m(v()),e(S(7),v());break;case"last30days":i(S(30)),m(v()),e(S(30),v());break;case"custom":f("custom");break}O!=="custom"&&N(!1)},z=O=>{const I=O.target.value;i(I),f("custom"),e(I,o?c:null)},E=O=>{const I=O.target.value;m(I),f("custom"),e(l,I)},X=()=>{i(""),m(""),f(null),e(null,null)},G=()=>l?d&&d!=="custom"?{today:"Hoje",yesterday:"Ontem",last7days:"Últimos 7 dias",last30days:"Últimos 30 dias",custom:"Personalizado"}[d]:o&&c&&l!==c?`${Z(l)} - ${Z(c)}`:Z(l):n,Z=O=>{const[I,b,D]=O.split("-");return`${D}/${b}/${I}`};return r.jsxs("div",{className:"relative inline-block w-full sm:w-auto",children:[r.jsxs("button",{type:"button",className:x("w-full sm:w-auto min-w-[200px] h-11 sm:h-12 px-4 flex items-center gap-2.5 bg-white dark:bg-dark-surface border-2 border-gray-300 dark:border-dark-border rounded-xl font-sans font-medium text-base text-gray-700 dark:text-dark-text cursor-pointer transition-all duration-200 outline-none select-none hover:border-gray-400 dark:hover:border-dark-border/80 hover:shadow-sm focus-visible:ring-3 focus-visible:ring-primary-300",y&&"border-primary-500 ring-3 ring-primary-100 dark:ring-primary-900/30"),onClick:()=>N(!y),"aria-label":"Selecionar data","aria-expanded":y,children:[r.jsx(_r,{className:"w-5 h-5 text-gray-400 dark:text-dark-text-muted flex-shrink-0"}),r.jsx("span",{className:"flex-1 text-left whitespace-nowrap overflow-hidden text-ellipsis",children:G()}),l||c?r.jsx("button",{type:"button",className:"flex items-center justify-center w-5 h-5 bg-gray-200 dark:bg-dark-surface-light border-none rounded-full text-[10px] text-gray-600 dark:text-dark-text-muted transition-all duration-150 flex-shrink-0 hover:bg-gray-300 dark:hover:bg-dark-surface hover:scale-105 active:scale-95",onClick:O=>{O.stopPropagation(),X()},"aria-label":"Limpar seleção",children:r.jsx(be,{className:"w-3 h-3"})}):r.jsx(Rr,{className:"w-4 h-4 text-gray-400 dark:text-dark-text-muted flex-shrink-0"})]}),y&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"fixed inset-0 z-40 sm:hidden",onClick:()=>N(!1)}),r.jsxs("div",{className:x("absolute top-[calc(100%+8px)] left-0 sm:left-auto z-50 min-w-[280px] bg-white dark:bg-dark-surface border border-gray-300 dark:border-dark-border rounded-2xl shadow-xl animate-slideUp sm:animate-slideDown","w-[calc(100vw-32px)] max-w-[340px] left-1/2 -translate-x-1/2 sm:left-0 sm:translate-x-0"),children:[r.jsxs("div",{className:"flex flex-col gap-1 p-3",children:[r.jsx("button",{type:"button",className:x("w-full px-3 py-2 text-left font-sans text-sm font-medium text-gray-700 dark:text-dark-text rounded-xl border-none bg-transparent cursor-pointer transition-all hover:bg-gray-150 dark:hover:bg-dark-surface-light min-h-[40px]",d==="today"&&"bg-primary-50 dark:bg-primary-950/20 text-primary-700 dark:text-primary-400 font-semibold"),onClick:()=>T("today"),children:"Hoje"}),r.jsx("button",{type:"button",className:x("w-full px-3 py-2 text-left font-sans text-sm font-medium text-gray-700 dark:text-dark-text rounded-xl border-none bg-transparent cursor-pointer transition-all hover:bg-gray-150 dark:hover:bg-dark-surface-light min-h-[40px]",d==="yesterday"&&"bg-primary-50 dark:bg-primary-950/20 text-primary-700 dark:text-primary-400 font-semibold"),onClick:()=>T("yesterday"),children:"Ontem"}),r.jsx("button",{type:"button",className:x("w-full px-3 py-2 text-left font-sans text-sm font-medium text-gray-700 dark:text-dark-text rounded-xl border-none bg-transparent cursor-pointer transition-all hover:bg-gray-150 dark:hover:bg-dark-surface-light min-h-[40px]",d==="last7days"&&"bg-primary-50 dark:bg-primary-950/20 text-primary-700 dark:text-primary-400 font-semibold"),onClick:()=>T("last7days"),children:"Últimos 7 dias"}),r.jsx("button",{type:"button",className:x("w-full px-3 py-2 text-left font-sans text-sm font-medium text-gray-700 dark:text-dark-text rounded-xl border-none bg-transparent cursor-pointer transition-all hover:bg-gray-150 dark:hover:bg-dark-surface-light min-h-[40px]",d==="last30days"&&"bg-primary-50 dark:bg-primary-950/20 text-primary-700 dark:text-primary-400 font-semibold"),onClick:()=>T("last30days"),children:"Últimos 30 dias"})]}),r.jsx("div",{className:"h-[1px] mx-3 my-1 bg-gray-200 dark:bg-dark-border"}),r.jsxs("div",{className:"flex flex-col gap-3.5 p-4 bg-gray-50/50 dark:bg-dark-bg/20 rounded-b-2xl",children:[r.jsxs("label",{className:"flex flex-col gap-1.5 font-sans text-xs font-semibold text-gray-500 dark:text-dark-text-muted uppercase tracking-wider",children:["Data inicial",r.jsx("input",{type:"date",className:"w-full px-3 py-2 bg-white dark:bg-dark-surface border border-gray-300 dark:border-dark-border rounded-lg font-sans text-sm text-gray-900 dark:text-dark-text cursor-pointer outline-none transition-colors hover:border-gray-400 focus:border-primary-500",value:l,onChange:z,max:v()})]}),o&&r.jsxs("label",{className:"flex flex-col gap-1.5 font-sans text-xs font-semibold text-gray-500 dark:text-dark-text-muted uppercase tracking-wider",children:["Data final",r.jsx("input",{type:"date",className:"w-full px-3 py-2 bg-white dark:bg-dark-surface border border-gray-300 dark:border-dark-border rounded-lg font-sans text-sm text-gray-900 dark:text-dark-text cursor-pointer outline-none transition-colors hover:border-gray-400 focus:border-primary-500",value:c,onChange:E,min:l,max:v()})]})]})]})]})]})};function Ia({tabs:e,activeTab:a,onChange:t,className:o}){return r.jsx("div",{className:x("border-b border-gray-150 dark:border-dark-border/40 flex gap-2 overflow-x-auto select-none",o),children:e.map(n=>{const l=n.id===a;return r.jsxs("button",{type:"button",onClick:()=>t(n.id),className:x("flex items-center gap-2 px-4 py-3 text-xs font-bold uppercase tracking-wider border-b-2 transition-all cursor-pointer whitespace-nowrap outline-none",l?"border-primary-500 text-primary-500 font-extrabold":"border-transparent text-gray-500 hover:text-gray-700 dark:text-dark-text-muted dark:hover:text-dark-text"),children:[n.icon,n.label]},n.id)})})}const rt=({videoUrl:e,fileName:a,downloadCount:t=0,onDownloadIncrement:o,onDownloadComplete:n,onDownloadChange:l,onError:i,size:c="md",iconOnly:m=!1,useLucide:d=!0})=>{const[f,y]=k.useState("idle"),[N,v]=k.useState(0),[C,S]=k.useState(t),T=async()=>{var I;try{y("downloading"),v(0);const b=await fetch(e);if(!b.ok)throw new Error("Falha ao baixar o vídeo");const D=b.headers.get("content-length");if(!D)throw new Error("Não foi possível obter o tamanho do arquivo");const le=(I=b.body)==null?void 0:I.getReader();if(!le)throw new Error("Não foi possível ler o stream do vídeo");let ie=0;const ae=[],$=parseInt(D,10);for(;;){const{done:re,value:de}=await le.read();if(re)break;ae.push(de),ie+=de.length,v(Math.round(ie/$*100))}v(100);const L=new Blob(ae),H=window.URL.createObjectURL(L),V=document.createElement("a");V.href=H,V.download=a,document.body.appendChild(V),V.click(),document.body.removeChild(V),window.URL.revokeObjectURL(H),y("success");const ee=C+1;if(S(ee),l==null||l(ee),setTimeout(()=>{y("idle"),v(0)},2e3),o)try{const re=await o();re!==ee&&(S(re),l==null||l(re))}catch(re){i==null||i(re)}n==null||n()}catch(b){y("error"),i==null||i(b),setTimeout(()=>{y("idle"),v(0)},2e3)}},z={sm:16,md:20,lg:24},E=()=>{if(d)switch(f){case"downloading":return r.jsx(De,{className:"animate-spin text-primary-500",size:z[c]});case"success":return r.jsx(Cr,{className:"text-green-600 dark:text-green-400",size:z[c]});case"error":return r.jsx(be,{className:"text-red-600 dark:text-red-400",size:z[c]});default:return r.jsx(Sr,{className:"text-gray-600 dark:text-dark-text-muted group-hover:text-primary-500 transition-colors",size:z[c]})}switch(f){case"downloading":return"⏳";case"success":return"✓";case"error":return"✕";default:return"⬇️"}},X=()=>{switch(f){case"downloading":return`${N}%`;case"success":return"Baixado!";case"error":return"Erro";default:return m?"":"Download"}},G={idle:"bg-gray-100 dark:bg-dark-surface hover:bg-gray-200 dark:hover:bg-dark-surface-light border-gray-300 dark:border-dark-border text-gray-700 dark:text-dark-text hover:-translate-y-0.5",downloading:"bg-primary-50 dark:bg-primary-900/20 border-primary-300 dark:border-primary-800 text-primary-700 dark:text-primary-400",success:"bg-green-50 dark:bg-green-950/20 border-green-300 dark:border-green-800 text-green-700 dark:text-green-400 animate-successPulse",error:"bg-red-50 dark:bg-red-950/20 border-red-300 dark:border-red-800 text-red-700 dark:text-red-400 animate-shake"},Z={sm:"px-2 py-1 text-sm min-h-[32px] rounded-md",md:"px-3 py-2 text-base min-h-[40px] sm:min-h-[44px] rounded-md",lg:"px-4 py-3 text-lg min-h-[48px] sm:min-h-[52px] rounded-lg"},O={sm:"min-w-[16px] h-4 text-[10px] px-1",md:"min-w-[20px] h-5 text-xs px-1.5",lg:"min-w-[22px] h-[22px] text-xs px-2"};return r.jsxs("button",{className:x("relative inline-flex items-center gap-2 font-semibold cursor-pointer transition-all duration-200 select-none border overflow-hidden focus-visible:ring-3 focus-visible:ring-primary-300 focus-visible:ring-offset-2 disabled:opacity-75 disabled:cursor-not-allowed",G[f],Z[c]),onClick:T,disabled:f==="downloading","aria-label":`Baixar vídeo ${a}`,children:[r.jsx("span",{className:"flex items-center justify-center leading-none flex-shrink-0",children:E()}),!m&&r.jsxs("span",{className:"flex items-center gap-1.5 z-10",children:[r.jsx("span",{className:"whitespace-nowrap",children:X()}),C>0&&r.jsx("span",{className:x("inline-flex items-center justify-center rounded-full bg-primary-500 text-white font-bold",O[c]),children:C})]}),f==="downloading"&&r.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-[3px] bg-primary-100 dark:bg-primary-900 overflow-hidden",children:r.jsx("div",{className:"h-full bg-gradient-to-r from-primary-500 to-primary-600 transition-all duration-250 ease-out",style:{width:`${N}%`}})})]})},tt=({initialLikes:e=0,onLike:a,onLikeChange:t,size:o="md",iconOnly:n=!1,disabled:l=!1,useLucide:i=!0})=>{const[c,m]=k.useState(e),[d,f]=k.useState(!1),y=async()=>{if(l||d)return;const T=c+1;if(f(!0),m(T),t==null||t(T),a)try{const z=await a();m(z),z!==T&&(t==null||t(z))}catch{m(c),t==null||t(c)}finally{setTimeout(()=>f(!1),600)}else setTimeout(()=>f(!1),600)},N={sm:"px-2 py-1 text-sm min-h-[32px]",md:"px-3 py-2 text-base min-h-[40px] sm:min-h-[44px]",lg:"px-4 py-3 text-lg min-h-[48px] sm:min-h-[52px]"},v={sm:"text-base",md:"text-lg",lg:"text-xl"},C={sm:16,md:20,lg:24},S={sm:"min-w-[16px] h-4 text-[10px] px-1",md:"min-w-[20px] h-5 text-xs px-1.5",lg:"min-w-[22px] h-[22px] text-xs px-2"};return r.jsxs("button",{className:x("relative inline-flex items-center justify-center gap-2 font-semibold cursor-pointer transition-all duration-200 select-none rounded-lg border focus-visible:ring-3 focus-visible:ring-primary-300 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed","bg-primary-50 border-primary-300 text-primary-700 hover:bg-primary-100 hover:border-primary-400 active:scale-95",N[o],d&&"animate-heartBeat"),onClick:y,disabled:l,"aria-label":"Curtir vídeo","aria-pressed":!0,children:[r.jsxs("span",{className:"relative flex items-center justify-center leading-none flex-shrink-0",children:[i?r.jsx(Re,{className:x("fill-rose-500 text-rose-500 transition-transform duration-150",d&&"animate-iconPop"),size:C[o]}):r.jsx("span",{className:x("flex items-center justify-center transition-transform duration-150",d&&"animate-iconPop"),children:"❤️"}),d&&r.jsx(r.Fragment,{children:i?r.jsxs(r.Fragment,{children:[r.jsx(Re,{className:"absolute pointer-events-none opacity-0 animate-heartFloat1 fill-rose-500 text-rose-500",size:C[o]-4}),r.jsx(Re,{className:"absolute pointer-events-none opacity-0 animate-heartFloat2 fill-rose-500 text-rose-500",size:C[o]-4}),r.jsx(Re,{className:"absolute pointer-events-none opacity-0 animate-heartFloat3 fill-rose-500 text-rose-500",size:C[o]-4})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:x("absolute text-sm pointer-events-none opacity-0 animate-heartFloat1",v[o]),children:"❤️"}),r.jsx("span",{className:x("absolute text-sm pointer-events-none opacity-0 animate-heartFloat2",v[o]),children:"❤️"}),r.jsx("span",{className:x("absolute text-sm pointer-events-none opacity-0 animate-heartFloat3",v[o]),children:"❤️"})]})})]}),!n&&r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"whitespace-nowrap",children:"Curtido"}),c>0&&r.jsx("span",{className:x("inline-flex items-center justify-center rounded-full bg-primary-600 text-white font-bold transition-all duration-150 animate-countBounce",S[o]),children:c})]})]})};function Ma({video:e,showShare:a=!0,onPlay:t,onShare:o,onLikeChange:n,onDownloadComplete:l,onDownloadIncrement:i,extraActions:c,className:m}){const[d,f]=k.useState(!1),[y,N]=k.useState(!1),v=k.useRef(null),[C,S]=k.useState(e.curtidas),[T,z]=k.useState(e.downloads),[E,X]=k.useState(e.visualizacoes||0),[G,Z]=k.useState(e.compartilhamentos||0),O=e.is_vertical===void 0||e.is_vertical!==!1&&e.is_vertical!==0;k.useEffect(()=>{S(e.curtidas),z(e.downloads),X(e.visualizacoes||0),Z(e.compartilhamentos||0)},[e.curtidas,e.downloads,e.visualizacoes,e.compartilhamentos]);const I=e.dthr&&e.dthr.length>=16?e.dthr.substring(11,16):"",b=e.dthr&&e.dthr.length>=10?new Date(e.dthr).toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit"}):"",D=L=>L.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g,"-").replace(/[^\w-]/g,"").replace(/-{2,}/g,"-").trim(),le=["Rock10",e.arena_nome?D(e.arena_nome):null,e.quadra_nome?D(e.quadra_nome):null,D(e.nome.replace(/\.mp4$/i,""))].filter(Boolean).join("-")+".mp4",ie=()=>{N(!0),f(!0),X(L=>L+1),t&&t(e)},ae=()=>{v.current&&(d?v.current.pause():ie())},$=async()=>{if(o){o(e);return}const L=`${window.location.origin}/video/${e.id}`,H={title:e.nome,text:"Confira este lance gravado no Rock10 Replay:",url:L};if(navigator.share)try{await navigator.share(H),Z(V=>V+1);return}catch{}try{await navigator.clipboard.writeText(`${H.text} ${H.url}`),Z(V=>V+1),alert("Link copiado para a área de transferência!")}catch{window.open(H.url,"_blank")}};return r.jsxs("article",{className:x("group relative flex flex-col bg-white dark:bg-dark-surface rounded-2xl shadow-xs hover:shadow-xl hover:-translate-y-1 transition-all duration-300 overflow-hidden border border-gray-150 dark:border-dark-border",m),children:[r.jsxs("div",{className:x("relative w-full overflow-hidden bg-black z-10 cursor-pointer select-none",O?"aspect-[9/16]":"aspect-[16/9]",d&&"rounded-b-none"),onClick:ae,children:[r.jsx("video",{ref:v,className:"w-full h-full object-contain transition-transform duration-300 bg-black group-hover:scale-[1.02]",src:y?e.url:void 0,poster:e.poster,controls:d,autoPlay:d,playsInline:!0,muted:!1,preload:y?"metadata":"none",onPlay:()=>f(!0),onPause:()=>f(!1)}),!d&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/15 transition-opacity duration-300 z-20 pointer-events-none group-hover:bg-black/30",children:r.jsx("div",{className:"w-14 h-14 sm:w-16 sm:h-16 flex items-center justify-center bg-white/95 dark:bg-dark-surface/95 text-primary-500 rounded-full shadow-2xl backdrop-blur-sm transition-transform duration-200 hover:scale-110 active:scale-95",children:r.jsx(ka,{className:"w-6 h-6 fill-current ml-1"})})}),r.jsxs("div",{className:"absolute left-0 right-0 bottom-0 bg-gradient-to-t from-white via-white/80 to-transparent dark:from-dark-surface dark:via-dark-surface/85 dark:to-transparent pt-8 pb-3 px-3.5 flex flex-col gap-1 z-20 pointer-events-none",children:[(e.arena_nome||e.quadra_nome)&&r.jsxs("div",{className:"text-xs font-bold text-primary-600 dark:text-primary-400 flex items-center gap-1.5 leading-none",children:[r.jsx(Tr,{className:"w-3.5 h-3.5"}),r.jsxs("span",{children:[e.arena_nome||""," ",e.arena_nome&&e.quadra_nome?"•":""," ",e.quadra_nome||""]})]}),r.jsxs("div",{className:"flex justify-between items-center w-full mt-1.5",children:[r.jsxs("span",{className:"text-xs font-bold text-gray-800 dark:text-dark-text flex items-center gap-1.5 leading-none",children:[r.jsx(_r,{className:"w-3.5 h-3.5 text-gray-500 dark:text-dark-text-muted"})," ",b,r.jsx(ba,{className:"w-3.5 h-3.5 text-gray-500 dark:text-dark-text-muted ml-0.5"})," ",I]}),r.jsxs("div",{className:"flex gap-2 sm:gap-2.5 items-center text-xs font-bold text-gray-800 dark:text-dark-text leading-none",children:[r.jsxs("span",{className:"flex items-center gap-1",title:"Visualizações",children:[r.jsx(pa,{className:"w-3.5 h-3.5 text-gray-500 dark:text-dark-text-muted"})," ",E]}),r.jsxs("span",{className:"flex items-center gap-1",title:"Compartilhamentos",children:[r.jsx(Er,{className:"w-3.5 h-3.5 text-gray-500 dark:text-dark-text-muted"})," ",G]}),r.jsxs("span",{className:"flex items-center gap-1",title:"Downloads",children:[r.jsx(Sr,{className:"w-3.5 h-3.5 text-gray-500 dark:text-dark-text-muted"})," ",T]}),r.jsxs("span",{className:"flex items-center gap-1",title:"Curtidas",children:[r.jsx(Re,{className:"w-3.5 h-3.5 text-gray-500 dark:text-dark-text-muted"})," ",C]})]})]})]})]})]}),r.jsx("div",{className:"p-3.5 sm:p-4 flex flex-col gap-3 relative z-20 bg-white dark:bg-dark-surface flex-1",children:r.jsxs("div",{className:"flex gap-2.5 items-center justify-start pointer-events-auto",onClick:L=>L.stopPropagation(),children:[r.jsx(rt,{videoUrl:e.url,fileName:le,downloadCount:T,size:"sm",iconOnly:!0,onDownloadIncrement:i?()=>i(e.id):void 0,onDownloadChange:L=>z(L),onDownloadComplete:()=>l==null?void 0:l(e.id)}),r.jsx(tt,{videoId:e.id,initialLikes:C,size:"sm",iconOnly:!0,onLikeChange:L=>{S(L),n==null||n(e.id,!0)}}),a&&r.jsx(Lr,{icon:r.jsx(Er,{className:"w-4 h-4 text-gray-600 dark:text-dark-text"}),ariaLabel:"Compartilhar vídeo",variant:"ghost",size:"sm",rounded:!0,onClick:$}),c&&r.jsx("div",{className:"ml-auto flex items-center gap-2",children:c})]})})]})}function Da({arena:e,onClick:a,actionText:t="Ver Replays",extraBadge:o,className:n}){return r.jsxs("div",{onClick:()=>a==null?void 0:a(e),className:x("group bg-white dark:bg-dark-surface border border-gray-150 dark:border-dark-border rounded-2xl p-5 shadow-xs hover:shadow-md hover:-translate-y-1 transition-all duration-200 cursor-pointer flex flex-col justify-between",n),children:[r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-50 dark:bg-blue-950/40 text-blue-600 dark:text-blue-400 flex items-center justify-center font-bold text-base shrink-0 overflow-hidden border border-blue-150 dark:border-blue-900/40",children:e.logo_url?r.jsx("img",{src:e.logo_url,alt:e.nome,className:"w-full h-full object-cover"}):r.jsx(wa,{className:"w-6 h-6"})}),r.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap justify-end",children:[o,e.ativo!==void 0&&r.jsx(Dr,{variant:e.ativo?"success":"danger",dot:!0,size:"sm",children:e.ativo?"Ativa":"Inativa"})]})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-base font-bold text-gray-900 dark:text-dark-text group-hover:text-primary-500 transition-colors line-clamp-1",children:e.nome}),(e.cidade||e.uf)&&r.jsxs("p",{className:"text-xs text-gray-500 dark:text-dark-text-muted font-medium flex items-center gap-1 mt-1",children:[r.jsx(Tr,{className:"w-3.5 h-3.5 text-gray-400 shrink-0"}),r.jsxs("span",{children:[e.cidade,e.cidade&&e.uf?" / ":"",e.uf]})]})]}),e.total_quadras!==void 0&&r.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-semibold text-gray-600 dark:text-dark-text-muted pt-2 border-t border-gray-100 dark:border-dark-border",children:[r.jsx(ya,{className:"w-4 h-4 text-emerald-500"}),r.jsxs("span",{children:[e.total_quadras," ",e.total_quadras===1?"quadra disponível":"quadras disponíveis"]})]})]}),r.jsxs("div",{className:"mt-4 pt-3 flex items-center justify-between text-xs font-bold text-primary-600 dark:text-primary-400 group-hover:text-primary-700 dark:group-hover:text-primary-300 transition-colors",children:[r.jsx("span",{children:t}),r.jsx(ma,{className:"w-4 h-4 transform group-hover:translate-x-1 transition-transform"})]})]})}function La({variant:e="full",themeMode:a="auto",size:t="md",className:o,...n}){const l={sm:e==="full"?"h-6 w-auto":"h-6 w-6",md:e==="full"?"h-8 w-auto":"h-8 w-8",lg:e==="full"?"h-10 w-auto":"h-10 w-10",xl:e==="full"?"h-12 w-auto":"h-12 w-12"};return e==="icon"?r.jsxs("svg",{viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:x(l[t],o),...n,children:[r.jsx("rect",{width:"40",height:"40",rx:"10",fill:"#0EA571"}),r.jsx("path",{d:"M12 28V12H21C23.7614 12 26 14.2386 26 17C26 19.7614 23.7614 22 21 22H16V28H12Z",fill:"white"}),r.jsx("path",{d:"M20 21L26 28H21L16.5 22.5H20V21Z",fill:"#FF6B35"}),r.jsx("circle",{cx:"28",cy:"14",r:"3",fill:"#FF6B35"})]}):r.jsxs("svg",{viewBox:"0 0 160 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:x(l[t],o),...n,children:[r.jsx("rect",{width:"40",height:"40",rx:"10",fill:"#0EA571"}),r.jsx("path",{d:"M12 28V12H21C23.7614 12 26 14.2386 26 17C26 19.7614 23.7614 22 21 22H16V28H12Z",fill:"white"}),r.jsx("path",{d:"M20 21L26 28H21L16.5 22.5H20V21Z",fill:"#FF6B35"}),r.jsx("circle",{cx:"28",cy:"14",r:"3",fill:"#FF6B35"}),r.jsx("text",{x:"48",y:"28",fontFamily:"Inter, system-ui, sans-serif",fontSize:"20",fontWeight:"800",fill:a==="light"?"#0F1419":a==="dark"?"#FFFFFF":"currentColor",letterSpacing:"-0.5px",children:"ROCK"}),r.jsx("text",{x:"112",y:"28",fontFamily:"Inter, system-ui, sans-serif",fontSize:"20",fontWeight:"900",fill:"#0EA571",children:"10"})]})}j.Alert=Ra,j.ArenaCard=Da,j.Badge=Dr,j.Button=zr,j.Card=Vr,j.CardContent=Ur,j.CardDescription=Gr,j.CardFooter=Hr,j.CardHeader=Br,j.CardTitle=Wr,j.Checkbox=Ir,j.ConfirmDialog=Pa,j.DatePicker=Oa,j.DateSelector=Fa,j.DownloadButton=rt,j.EmptyState=za,j.FilterBar=Sa,j.IconButton=Lr,j.Input=Ar,j.LikeButton=tt,j.Loading=Ea,j.Logo=La,j.Modal=et,j.PageHeader=Ta,j.SearchBar=Aa,j.Select=Or,j.Skeleton=Se,j.StatCard=Ca,j.Switch=Mr,j.Table=Jr,j.TableBody=Zr,j.TableCell=qr,j.TableContainer=Kr,j.TableHead=$r,j.TableHeader=Xr,j.TableRow=Qr,j.Tabs=Ia,j.Textarea=Fr,j.VideoCard=Ma,j.cn=x,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})});
155
+ */const be=W("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ja=jr("inline-flex items-center justify-center font-bold transition-all select-none disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-none active:scale-[0.98]",{variants:{variant:{primary:"bg-primary-500 hover:bg-primary-600 active:bg-primary-700 text-white shadow-sm shadow-primary-500/20",secondary:"bg-gray-100 hover:bg-gray-200 dark:bg-dark-surface-light dark:hover:bg-gray-700 text-gray-700 dark:text-dark-text border border-gray-200 dark:border-dark-border",outline:"border border-gray-300 dark:border-dark-border text-gray-700 dark:text-dark-text hover:bg-gray-50 dark:hover:bg-dark-surface-light",ghost:"text-gray-600 dark:text-dark-text hover:bg-gray-100 dark:hover:bg-dark-surface-light",danger:"bg-red-600 hover:bg-red-700 active:bg-red-800 text-white shadow-sm shadow-red-600/20",success:"bg-emerald-600 hover:bg-emerald-700 active:bg-emerald-800 text-white shadow-sm shadow-emerald-600/20",purple:"bg-purple-600 hover:bg-purple-500 active:bg-purple-700 text-white shadow-sm shadow-purple-600/20",link:"text-primary-500 hover:text-primary-600 dark:text-primary-400 underline-offset-4 hover:underline p-0 h-auto font-semibold"},size:{sm:"h-8 px-3 text-xs gap-1.5 rounded-lg",md:"h-10 px-4 py-2 text-sm gap-2 rounded-xl",lg:"h-12 px-6 text-base gap-2.5 rounded-xl"},fullWidth:{true:"w-full",false:"w-auto"}},defaultVariants:{variant:"primary",size:"md",fullWidth:!1}}),zr=k.forwardRef(({className:e,variant:a,size:t,fullWidth:o,isLoading:n=!1,leftIcon:l,rightIcon:i,children:c,disabled:m,...d},f)=>r.jsxs("button",{ref:f,disabled:m||n,className:x(ja({variant:a,size:t,fullWidth:o}),e),...d,children:[n?r.jsx(De,{className:"w-4 h-4 animate-spin shrink-0"}):l&&r.jsx("span",{className:"shrink-0",children:l}),c&&r.jsx("span",{children:c}),!n&&i&&r.jsx("span",{className:"shrink-0",children:i})]}));zr.displayName="Button";const Ar=k.forwardRef(({className:e,label:a,error:t,helperText:o,startIcon:n,endIcon:l,clearable:i=!1,onClear:c,inputSize:m="md",fullWidth:d=!0,disabled:f,value:y,id:N,...v},C)=>{const S=N||(a?`input-${a.toLowerCase().replace(/\s+/g,"-")}`:void 0),T={sm:"h-8 px-2.5 text-xs rounded-lg",md:"h-10 px-3.5 text-sm rounded-xl",lg:"h-12 px-4 text-base rounded-xl"};return r.jsxs("div",{className:x("flex flex-col gap-1.5",d&&"w-full"),children:[a&&r.jsx("label",{htmlFor:S,className:"text-xs font-bold uppercase tracking-wider text-gray-700 dark:text-dark-text",children:a}),r.jsxs("div",{className:"relative flex items-center w-full",children:[n&&r.jsx("div",{className:"absolute left-3.5 flex items-center pointer-events-none text-gray-400 dark:text-dark-text-muted",children:n}),r.jsx("input",{id:S,ref:C,disabled:f,value:y,className:x("w-full bg-gray-50 dark:bg-dark-bg border border-gray-200 dark:border-dark-border text-gray-900 dark:text-dark-text placeholder-gray-400 dark:placeholder-gray-500 font-medium transition-all focus:outline-none focus:bg-white dark:focus:bg-dark-bg focus:border-primary-500 focus:ring-2 focus:ring-primary-500/20 disabled:bg-gray-100 dark:disabled:bg-dark-surface disabled:opacity-60 disabled:cursor-not-allowed",T[m],n&&"pl-10",(l||i&&y)&&"pr-10",t&&"border-red-500 focus:border-red-500 focus:ring-red-500/20 text-red-900 dark:text-red-300",e),...v}),i&&y&&!f&&r.jsx("button",{type:"button",onClick:c,className:"absolute right-3 p-1 rounded-md text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors",children:r.jsx(be,{className:"w-3.5 h-3.5"})}),!i&&l&&r.jsx("div",{className:"absolute right-3.5 flex items-center pointer-events-none text-gray-400 dark:text-dark-text-muted",children:l})]}),t&&r.jsx("span",{className:"text-xs font-semibold text-red-500",children:t}),!t&&o&&r.jsx("span",{className:"text-xs text-gray-500 dark:text-dark-text-muted",children:o})]})});Ar.displayName="Input";const Or=k.forwardRef(({className:e,label:a,error:t,helperText:o,options:n,selectSize:l="md",fullWidth:i=!0,disabled:c,children:m,id:d,...f},y)=>{const N=d||(a?`select-${a.toLowerCase().replace(/\s+/g,"-")}`:void 0),v={sm:"h-8 pl-2.5 pr-8 text-xs rounded-lg",md:"h-10 pl-3.5 pr-10 text-sm rounded-xl",lg:"h-12 pl-4 pr-12 text-base rounded-xl"};return r.jsxs("div",{className:x("flex flex-col gap-1.5",i&&"w-full"),children:[a&&r.jsx("label",{htmlFor:N,className:"text-xs font-bold uppercase tracking-wider text-gray-700 dark:text-dark-text",children:a}),r.jsxs("div",{className:"relative flex items-center w-full",children:[r.jsx("select",{id:N,ref:y,disabled:c,className:x("w-full appearance-none bg-gray-50 dark:bg-dark-bg border border-gray-200 dark:border-dark-border text-gray-900 dark:text-dark-text font-medium transition-all focus:outline-none focus:bg-white dark:focus:bg-dark-bg focus:border-primary-500 focus:ring-2 focus:ring-primary-500/20 disabled:bg-gray-100 dark:disabled:bg-dark-surface disabled:opacity-60 disabled:cursor-not-allowed cursor-pointer",v[l],t&&"border-red-500 focus:border-red-500 focus:ring-red-500/20 text-red-900 dark:text-red-300",e),...f,children:n?n.map(C=>r.jsx("option",{value:C.value,disabled:C.disabled,children:C.label},C.value)):m}),r.jsx("div",{className:"absolute right-3 pointer-events-none text-gray-400 dark:text-dark-text-muted",children:r.jsx(Rr,{className:"w-4 h-4"})})]}),t&&r.jsx("span",{className:"text-xs font-semibold text-red-500",children:t}),!t&&o&&r.jsx("span",{className:"text-xs text-gray-500 dark:text-dark-text-muted",children:o})]})});Or.displayName="Select";const Fr=k.forwardRef(({className:e,label:a,error:t,helperText:o,fullWidth:n=!0,disabled:l,rows:i=3,id:c,...m},d)=>{const f=c||(a?`textarea-${a.toLowerCase().replace(/\s+/g,"-")}`:void 0);return r.jsxs("div",{className:x("flex flex-col gap-1.5",n&&"w-full"),children:[a&&r.jsx("label",{htmlFor:f,className:"text-xs font-bold uppercase tracking-wider text-gray-700 dark:text-dark-text",children:a}),r.jsx("textarea",{id:f,ref:d,rows:i,disabled:l,className:x("w-full p-3 bg-gray-50 dark:bg-dark-bg border border-gray-200 dark:border-dark-border text-gray-900 dark:text-dark-text placeholder-gray-400 dark:placeholder-gray-500 text-sm font-medium rounded-xl transition-all focus:outline-none focus:bg-white dark:focus:bg-dark-bg focus:border-primary-500 focus:ring-2 focus:ring-primary-500/20 disabled:bg-gray-100 dark:disabled:bg-dark-surface disabled:opacity-60 disabled:cursor-not-allowed resize-y",t&&"border-red-500 focus:border-red-500 focus:ring-red-500/20 text-red-900 dark:text-red-300",e),...m}),t&&r.jsx("span",{className:"text-xs font-semibold text-red-500",children:t}),!t&&o&&r.jsx("span",{className:"text-xs text-gray-500 dark:text-dark-text-muted",children:o})]})});Fr.displayName="Textarea";const Ir=k.forwardRef(({className:e,label:a,description:t,checked:o,disabled:n,id:l,onChange:i,...c},m)=>{const d=l||(typeof a=="string"?`checkbox-${a.toLowerCase().replace(/\s+/g,"-")}`:void 0);return r.jsxs("label",{htmlFor:d,className:x("inline-flex items-start gap-2.5 select-none cursor-pointer group",n&&"opacity-60 cursor-not-allowed pointer-events-none",e),children:[r.jsxs("div",{className:"relative flex items-center justify-center shrink-0 mt-0.5",children:[r.jsx("input",{id:d,ref:m,type:"checkbox",checked:o,disabled:n,onChange:i,className:"peer sr-only",...c}),r.jsx("div",{className:x("w-5 h-5 rounded-md border border-gray-300 dark:border-dark-border bg-white dark:bg-dark-surface transition-all flex items-center justify-center peer-checked:bg-primary-500 peer-checked:border-primary-500 peer-focus-visible:ring-2 peer-focus-visible:ring-primary-500/30 group-hover:border-primary-500/60 shadow-xs",o&&"bg-primary-500 border-primary-500 text-white"),children:o&&r.jsx(Cr,{className:"w-3.5 h-3.5 stroke-[3] text-white"})})]}),(a||t)&&r.jsxs("div",{className:"flex flex-col",children:[a&&r.jsx("span",{className:"text-sm font-semibold text-gray-800 dark:text-dark-text leading-tight",children:a}),t&&r.jsx("span",{className:"text-xs text-gray-500 dark:text-dark-text-muted mt-0.5",children:t})]})]})});Ir.displayName="Checkbox";const Mr=k.forwardRef(({className:e,label:a,description:t,checked:o,disabled:n,switchSize:l="md",id:i,onChange:c,...m},d)=>{const f=i||(typeof a=="string"?`switch-${a.toLowerCase().replace(/\s+/g,"-")}`:void 0),y={sm:"w-8 h-4.5",md:"w-11 h-6",lg:"w-14 h-7.5"},N={sm:"w-3.5 h-3.5 translate-x-0.5 peer-checked:translate-x-4",md:"w-5 h-5 translate-x-0.5 peer-checked:translate-x-5.5",lg:"w-6.5 h-6.5 translate-x-0.5 peer-checked:translate-x-7"};return r.jsxs("label",{htmlFor:f,className:x("inline-flex items-center gap-3 select-none cursor-pointer group",n&&"opacity-60 cursor-not-allowed pointer-events-none",e),children:[r.jsxs("div",{className:"relative inline-flex items-center shrink-0",children:[r.jsx("input",{id:f,ref:d,type:"checkbox",role:"switch",checked:o,disabled:n,onChange:c,className:"peer sr-only",...m}),r.jsx("div",{className:x("rounded-full bg-gray-200 dark:bg-dark-surface-light peer-checked:bg-primary-500 transition-colors duration-200 ease-in-out border border-transparent shadow-inner",y[l])}),r.jsx("div",{className:x("absolute bg-white rounded-full shadow-md transform transition-transform duration-200 ease-in-out pointer-events-none",N[l])})]}),(a||t)&&r.jsxs("div",{className:"flex flex-col",children:[a&&r.jsx("span",{className:"text-sm font-semibold text-gray-800 dark:text-dark-text leading-tight",children:a}),t&&r.jsx("span",{className:"text-xs text-gray-500 dark:text-dark-text-muted mt-0.5",children:t})]})]})});Mr.displayName="Switch";const Na=jr("inline-flex items-center font-bold tracking-tight transition-colors select-none shrink-0",{variants:{variant:{success:"bg-emerald-50 dark:bg-emerald-950/30 text-emerald-700 dark:text-emerald-300 border border-emerald-200 dark:border-emerald-800/60",danger:"bg-red-50 dark:bg-red-950/30 text-red-700 dark:text-red-400 border border-red-200 dark:border-red-800/60",warning:"bg-amber-50 dark:bg-amber-950/30 text-amber-700 dark:text-amber-400 border border-amber-200 dark:border-amber-800/60",info:"bg-blue-50 dark:bg-blue-950/30 text-blue-700 dark:text-blue-300 border border-blue-200 dark:border-blue-800/60",purple:"bg-purple-50 dark:bg-purple-950/30 text-purple-700 dark:text-purple-300 border border-purple-200 dark:border-purple-800/60",neutral:"bg-gray-100 dark:bg-dark-surface-light text-gray-700 dark:text-dark-text-muted border border-gray-200 dark:border-dark-border",primary:"bg-primary-50 dark:bg-primary-950/30 text-primary-700 dark:text-primary-300 border border-primary-200 dark:border-primary-800/60",secondary:"bg-secondary-50 dark:bg-secondary-950/30 text-secondary-700 dark:text-secondary-300 border border-secondary-200 dark:border-secondary-800/60"},size:{sm:"text-[10px] px-2 py-0.5 gap-1",md:"text-xs px-2.5 py-1 gap-1.5"},shape:{pill:"rounded-full",rounded:"rounded-md"}},defaultVariants:{variant:"neutral",size:"sm",shape:"pill"}}),_a={success:"bg-emerald-500",danger:"bg-red-500",warning:"bg-amber-500",info:"bg-blue-500",purple:"bg-purple-500",neutral:"bg-gray-400",primary:"bg-primary-500",secondary:"bg-secondary-500"};function Dr({className:e,variant:a="neutral",size:t="sm",shape:o="pill",dot:n=!1,pulseDot:l=!1,children:i,...c}){const d=_a[a||"neutral"]||"bg-gray-400";return r.jsxs("span",{className:x(Na({variant:a,size:t,shape:o}),e),...c,children:[n&&r.jsxs("span",{className:"relative flex h-1.5 w-1.5 shrink-0",children:[l&&r.jsx("span",{className:x("animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",d)}),r.jsx("span",{className:x("relative inline-flex rounded-full h-1.5 w-1.5",d)})]}),i]})}function Se({className:e,variant:a="text",width:t,height:o,style:n,...l}){const i={text:"h-4 rounded-md w-full",circular:"rounded-full",rectangular:"rounded-xl",card:"h-32 rounded-2xl w-full"};return r.jsx("div",{className:x("animate-pulse bg-gray-200/80 dark:bg-dark-surface-light/80",i[a],e),style:{width:typeof t=="number"?`${t}px`:t,height:typeof o=="number"?`${o}px`:o,...n},...l})}const Lr=({icon:e,variant:a="primary",size:t="md",rounded:o=!1,ariaLabel:n,disabled:l=!1,loading:i=!1,className:c="",...m})=>{const d="relative inline-flex items-center justify-center gap-2 border-none font-semibold cursor-pointer transition-all select-none -webkit-tap-highlight-color-transparent outline-none focus-visible:ring-3 focus-visible:ring-primary-300 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-none active:scale-95 duration-150",f={primary:"bg-gradient-to-br from-primary-500 to-primary-600 text-white shadow-md hover:from-primary-600 hover:to-primary-700 hover:shadow-lg hover:-translate-y-0.5",secondary:"bg-gray-100 dark:bg-dark-surface text-gray-700 dark:text-dark-text border border-gray-300 dark:border-dark-border hover:bg-gray-200 dark:hover:bg-dark-surface-light hover:-translate-y-0.5",ghost:"bg-transparent text-gray-600 dark:text-dark-text-muted hover:bg-gray-100 dark:hover:bg-dark-surface hover:text-gray-800 dark:hover:text-dark-text",danger:"bg-gradient-to-br from-red-500 to-red-600 text-white shadow-md hover:from-red-600 hover:to-red-700 hover:shadow-lg hover:-translate-y-0.5"},y=o?{sm:"w-8 h-8 rounded-full p-0 text-base",md:"w-10 h-10 rounded-full p-0 text-lg sm:w-11 sm:h-11",lg:"w-12 h-12 rounded-full p-0 text-xl sm:w-13 sm:h-13"}:{sm:"px-3 py-1.5 text-sm rounded-md min-h-[32px]",md:"px-4 py-2 text-base rounded-md min-h-[40px] sm:min-h-[44px]",lg:"px-6 py-3 text-lg rounded-lg min-h-[48px] sm:min-h-[52px]"};return r.jsx("button",{className:x(d,f[a],y[t],i&&"pointer-events-none",c),"aria-label":n,disabled:l||i,...m,children:i?r.jsx(De,{className:"w-4 h-4 animate-spin",role:"status","aria-hidden":"true"}):r.jsx("span",{className:"flex items-center justify-center leading-none",children:e})})},Vr=k.forwardRef(({className:e,hoverable:a=!1,padded:t=!0,children:o,...n},l)=>r.jsx("div",{ref:l,className:x("bg-white dark:bg-dark-surface border border-gray-150 dark:border-dark-border rounded-2xl shadow-xs transition-all duration-200 overflow-hidden",t&&"p-5 sm:p-6",a&&"hover:shadow-md hover:-translate-y-0.5 cursor-pointer",e),...n,children:o}));Vr.displayName="Card";const Br=k.forwardRef(({className:e,actions:a,children:t,...o},n)=>r.jsxs("div",{ref:n,className:x("flex items-center justify-between gap-4 mb-4",e),...o,children:[r.jsx("div",{className:"flex flex-col gap-1",children:t}),a&&r.jsx("div",{className:"flex items-center gap-2 shrink-0",children:a})]}));Br.displayName="CardHeader";const Wr=k.forwardRef(({className:e,children:a,...t},o)=>r.jsx("h3",{ref:o,className:x("text-base font-bold text-gray-900 dark:text-dark-text tracking-tight",e),...t,children:a}));Wr.displayName="CardTitle";const Gr=k.forwardRef(({className:e,children:a,...t},o)=>r.jsx("p",{ref:o,className:x("text-xs text-gray-500 dark:text-dark-text-muted font-medium",e),...t,children:a}));Gr.displayName="CardDescription";const Ur=k.forwardRef(({className:e,children:a,...t},o)=>r.jsx("div",{ref:o,className:x("space-y-4",e),...t,children:a}));Ur.displayName="CardContent";const Hr=k.forwardRef(({className:e,children:a,...t},o)=>r.jsx("div",{ref:o,className:x("flex items-center justify-end gap-3 pt-4 mt-4 border-t border-gray-100 dark:border-dark-border",e),...t,children:a}));Hr.displayName="CardFooter";const Yr={purple:{text:"text-purple-600 dark:text-purple-400",bg:"bg-purple-100 dark:bg-purple-900/30 text-purple-600 dark:text-purple-400",border:"border-purple-200/50 dark:border-purple-950/20"},blue:{text:"text-blue-600 dark:text-blue-400",bg:"bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400",border:"border-blue-200/50 dark:border-blue-950/20"},emerald:{text:"text-emerald-600 dark:text-emerald-400",bg:"bg-emerald-100 dark:bg-emerald-900/30 text-emerald-600 dark:text-emerald-400",border:"border-emerald-200/50 dark:border-emerald-950/20"},amber:{text:"text-amber-600 dark:text-amber-400",bg:"bg-amber-100 dark:bg-amber-900/30 text-amber-600 dark:text-amber-400",border:"border-amber-200/50 dark:border-amber-950/20"},red:{text:"text-red-600 dark:text-red-400",bg:"bg-red-100 dark:bg-red-900/30 text-red-600 dark:text-red-400",border:"border-red-200/50 dark:border-red-950/20"},cyan:{text:"text-cyan-600 dark:text-cyan-400",bg:"bg-cyan-100 dark:bg-cyan-900/30 text-cyan-600 dark:text-cyan-400",border:"border-cyan-200/50 dark:border-cyan-950/20"},pink:{text:"text-pink-600 dark:text-pink-400",bg:"bg-pink-100 dark:bg-pink-900/30 text-pink-600 dark:text-pink-400",border:"border-pink-200/50 dark:border-pink-950/20"},yellow:{text:"text-yellow-600 dark:text-yellow-400",bg:"bg-yellow-100 dark:bg-yellow-900/30 text-yellow-600 dark:text-yellow-400",border:"border-yellow-200/50 dark:border-yellow-950/20"}};function Ca({title:e,value:a,subtitle:t,icon:o,color:n="purple",isLoading:l=!1,animateValue:i=!0,className:c,onClick:m}){const[d,f]=k.useState(typeof a=="number"&&i?0:a),y=Yr[n]||Yr.purple;return k.useEffect(()=>{if(typeof a!="number"||!i){f(a);return}let N=!0,v=null;const C=1e3,S=T=>{if(!N)return;v||(v=T);const z=Math.min((T-v)/C,1),E=z*(2-z),X=Math.floor(E*a);f(X.toLocaleString("pt-BR")),z<1?window.requestAnimationFrame(S):f(a.toLocaleString("pt-BR"))};return window.requestAnimationFrame(S),()=>{N=!1}},[a,i]),l?r.jsxs("div",{className:"bg-white dark:bg-dark-surface p-5 rounded-2xl border border-gray-150 dark:border-dark-border shadow-xs",children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsx(Se,{width:"50%",height:14}),r.jsx(Se,{variant:"circular",width:40,height:40})]}),r.jsx(Se,{width:"40%",height:32,className:"my-2"}),r.jsx(Se,{width:"70%",height:12})]}):r.jsxs("div",{onClick:m,className:x("bg-white dark:bg-dark-surface p-5 rounded-2xl border border-gray-150 dark:border-dark-border shadow-xs hover:shadow-sm transition-all",m&&"cursor-pointer hover:-translate-y-0.5",c),children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsx("span",{className:x("text-xs font-bold uppercase tracking-wider",y.text),children:e}),o&&r.jsx("div",{className:x("w-10 h-10 rounded-xl flex items-center justify-center shrink-0",y.bg),children:o})]}),r.jsx("div",{className:"text-3xl font-black text-gray-900 dark:text-dark-text tracking-tight",children:typeof a=="number"&&!i?a.toLocaleString("pt-BR"):d}),t&&r.jsx("div",{className:"text-xs text-gray-500 dark:text-dark-text-muted font-medium mt-1.5 flex items-center gap-1",children:t})]})}function Ra({variant:e="info",title:a,children:t,icon:o,onClose:n,className:l}){const c={info:{container:"bg-blue-50 dark:bg-blue-950/30 border-blue-200 dark:border-blue-800/60 text-blue-900 dark:text-blue-200",icon:r.jsx(ha,{className:"w-5 h-5 text-blue-600 dark:text-blue-400 shrink-0"})},success:{container:"bg-emerald-50 dark:bg-emerald-950/30 border-emerald-200 dark:border-emerald-800/60 text-emerald-900 dark:text-emerald-200",icon:r.jsx(xa,{className:"w-5 h-5 text-emerald-600 dark:text-emerald-400 shrink-0"})},warning:{container:"bg-amber-50 dark:bg-amber-950/30 border-amber-200 dark:border-amber-800/60 text-amber-900 dark:text-amber-200",icon:r.jsx(Pr,{className:"w-5 h-5 text-amber-600 dark:text-amber-400 shrink-0"})},danger:{container:"bg-red-50 dark:bg-red-950/30 border-red-200 dark:border-red-800/60 text-red-900 dark:text-red-200",icon:r.jsx(fa,{className:"w-5 h-5 text-red-600 dark:text-red-400 shrink-0"})}}[e];return r.jsxs("div",{role:"alert",className:x("p-4 rounded-xl border flex items-start gap-3 relative transition-all",c.container,l),children:[r.jsx("div",{className:"mt-0.5",children:o||c.icon}),r.jsxs("div",{className:"flex-1 text-sm",children:[a&&r.jsx("h5",{className:"font-bold text-sm mb-1",children:a}),r.jsx("div",{className:"font-medium text-xs sm:text-sm leading-relaxed",children:t})]}),n&&r.jsx("button",{onClick:n,className:"p-1 rounded-md text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors",children:r.jsx(be,{className:"w-4 h-4"})})]})}const Kr=k.forwardRef(({className:e,bordered:a=!0,children:t,...o},n)=>r.jsx("div",{ref:n,className:x("w-full overflow-x-auto rounded-2xl bg-white dark:bg-dark-surface shadow-xs",a&&"border border-gray-150 dark:border-dark-border",e),...o,children:t}));Kr.displayName="TableContainer";const Jr=k.forwardRef(({className:e,...a},t)=>r.jsx("table",{ref:t,className:x("w-full text-left text-sm border-collapse",e),...a}));Jr.displayName="Table";const Xr=k.forwardRef(({className:e,...a},t)=>r.jsx("thead",{ref:t,className:x("bg-gray-50/80 dark:bg-dark-surface-light/80 border-b border-gray-150 dark:border-dark-border text-gray-600 dark:text-dark-text-muted text-xs uppercase font-bold tracking-wider",e),...a}));Xr.displayName="TableHeader";const Zr=k.forwardRef(({className:e,...a},t)=>r.jsx("tbody",{ref:t,className:x("divide-y divide-gray-100 dark:divide-dark-border",e),...a}));Zr.displayName="TableBody";const Qr=k.forwardRef(({className:e,...a},t)=>r.jsx("tr",{ref:t,className:x("transition-colors hover:bg-gray-50/60 dark:hover:bg-dark-surface-light/40 data-[state=selected]:bg-gray-50",e),...a}));Qr.displayName="TableRow";const $r=k.forwardRef(({className:e,...a},t)=>r.jsx("th",{ref:t,className:x("px-6 py-4 text-left font-bold text-gray-600 dark:text-dark-text-muted select-none text-xs uppercase tracking-wider",e),...a}));$r.displayName="TableHead";const qr=k.forwardRef(({className:e,...a},t)=>r.jsx("td",{ref:t,className:x("px-6 py-4 align-middle text-gray-800 dark:text-dark-text text-sm font-medium",e),...a}));qr.displayName="TableCell";function Sa({title:e="Filtros",hasActiveFilters:a=!1,activeFiltersCount:t,onClearFilters:o,children:n,className:l}){return r.jsxs("div",{className:x("bg-white dark:bg-dark-surface p-4 sm:p-5 rounded-2xl border border-gray-150 dark:border-dark-border shadow-xs space-y-3",l),children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"p-1.5 rounded-lg bg-purple-50 dark:bg-purple-950/40 text-purple-600 dark:text-purple-400",children:r.jsx(ga,{className:"w-4 h-4"})}),r.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-gray-700 dark:text-dark-text",children:e}),a&&r.jsx("span",{className:"px-2 py-0.5 rounded-full text-[10px] font-extrabold bg-purple-100 dark:bg-purple-900/40 text-purple-700 dark:text-purple-300",children:t!==void 0?`${t} ${t===1?"ativo":"ativos"}`:"Filtro Ativo"})]}),a&&o&&r.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-1 text-xs font-bold text-red-500 hover:text-red-600 dark:hover:text-red-400 transition-colors cursor-pointer",children:[r.jsx(be,{className:"w-3.5 h-3.5"}),"Limpar Filtros"]})]}),r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3 pt-1",children:n})]})}function Ta({title:e,description:a,badge:t,actions:o,breadcrumb:n,className:l}){return r.jsxs("div",{className:x("flex flex-col sm:flex-row sm:items-center justify-between gap-4 select-none",l),children:[r.jsxs("div",{className:"flex flex-col gap-1",children:[n&&r.jsx("div",{className:"text-xs text-gray-500 mb-0.5",children:n}),r.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[r.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-dark-text tracking-tight",children:e}),t&&r.jsx("div",{children:t})]}),a&&r.jsx("div",{className:"text-sm text-gray-500 dark:text-dark-text-muted mt-0.5 font-medium",children:a})]}),o&&r.jsx("div",{className:"flex items-center gap-2.5 flex-wrap shrink-0",children:o})]})}const Ea=({variant:e="spinner",size:a="md",text:t,fullScreen:o=!1})=>{const n={sm:"w-6 h-6",md:"w-10 h-10",lg:"w-16 h-16"},l={sm:"text-xs",md:"text-sm font-medium",lg:"text-base font-semibold"};if(e==="skeleton")return r.jsxs("div",{className:x("w-full bg-white dark:bg-dark-surface border border-gray-150 dark:border-dark-border rounded-xl overflow-hidden shadow-sm animate-pulse",a==="sm"?"max-w-xs":a==="md"?"max-w-sm":"max-w-md"),children:[r.jsx("div",{className:"aspect-video bg-gray-200 dark:bg-dark-surface-light w-full"}),r.jsxs("div",{className:"p-4 space-y-3",children:[r.jsx("div",{className:"h-4 bg-gray-200 dark:bg-dark-surface-light rounded w-3/4"}),r.jsx("div",{className:"h-3 bg-gray-200 dark:bg-dark-surface-light rounded w-1/2"}),r.jsx("div",{className:"h-3 bg-gray-200 dark:bg-dark-surface-light rounded w-5/6"})]})]});const i=r.jsxs("div",{className:"flex flex-col items-center justify-center space-y-3 p-4",children:[r.jsx(De,{className:x("text-primary-500 animate-spin",n[a])}),t&&r.jsx("p",{className:x("text-gray-500 dark:text-dark-text-muted select-none",l[a]),children:t})]});return o?r.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-white/80 dark:bg-dark-bg/80 backdrop-blur-sm",children:i}):r.jsx("div",{className:"flex items-center justify-center w-full",children:i})};function et({isOpen:e,onClose:a,title:t,children:o,footer:n,size:l="md",closeOnOutsideClick:i=!1}){if(k.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset"}),[e]),!e)return null;const c={sm:"max-w-md",md:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl"};return r.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm animate-[fadeIn_0.2s_ease-out]",children:[r.jsx("div",{className:"fixed inset-0",onClick:i?a:void 0}),r.jsxs("div",{className:x("relative w-full bg-white dark:bg-dark-surface border border-gray-150 dark:border-dark-border rounded-xl shadow-xl overflow-hidden flex flex-col max-h-[90vh] z-10 animate-[slideUp_0.2s_ease-out]",c[l]),children:[r.jsxs("div",{className:"flex justify-between items-center px-6 py-4 border-b border-gray-100 dark:border-dark-border",children:[r.jsx("h2",{className:"text-lg font-bold text-gray-900 dark:text-dark-text",children:t}),r.jsx("button",{className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors p-1.5 hover:bg-gray-100 dark:hover:bg-dark-surface-light rounded-lg cursor-pointer",onClick:a,children:r.jsx(be,{className:"w-5 h-5"})})]}),r.jsx("div",{className:"p-6 overflow-y-auto flex-1 text-sm text-gray-700 dark:text-dark-text-muted",children:o}),n&&r.jsx("div",{className:"flex justify-end items-center gap-3 px-6 py-4 border-t border-gray-100 dark:border-dark-border bg-gray-50/50 dark:bg-dark-surface/50",children:n})]})]})}function Pa({isOpen:e,onClose:a,onConfirm:t,title:o,message:n,confirmText:l="Confirmar",cancelText:i="Cancelar",isLoading:c=!1}){return r.jsx(et,{isOpen:e,onClose:a,title:o,size:"sm",footer:r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"px-4 py-2 text-sm font-semibold text-gray-700 dark:text-dark-text bg-gray-100 hover:bg-gray-200 dark:bg-dark-surface-light dark:hover:bg-gray-700 rounded-lg transition-all disabled:opacity-50 cursor-pointer",onClick:a,disabled:c,children:i}),r.jsx("button",{className:"px-4 py-2 text-sm font-semibold text-white bg-red-600 hover:bg-red-700 active:scale-[0.98] rounded-lg shadow-sm transition-all disabled:opacity-50 cursor-pointer",onClick:t,disabled:c,children:c?"Aguarde...":l})]}),children:r.jsxs("div",{className:"flex gap-4 items-start",children:[r.jsx("div",{className:"p-2.5 bg-red-50 dark:bg-red-950/20 text-red-600 dark:text-red-400 rounded-xl",children:r.jsx(Pr,{className:"w-6 h-6 flex-shrink-0"})}),r.jsx("div",{children:r.jsx("p",{className:"text-gray-600 dark:text-dark-text-muted mt-1 leading-relaxed",children:n})})]})})}const za=({icon:e,title:a,description:t,action:o,variant:n="default"})=>{const l={default:"text-primary-500 bg-primary-50 dark:bg-primary-950/20",error:"text-red-500 bg-red-50 dark:bg-red-950/20",search:"text-secondary-500 bg-secondary-50 dark:bg-secondary-950/20"};return r.jsxs("div",{className:x("flex flex-col items-center justify-center p-8 sm:p-12 text-center min-h-[300px] sm:min-h-[400px] animate-fadeIn group"),children:[e&&r.jsx("div",{className:x("flex items-center justify-center w-16 h-16 sm:w-20 sm:h-20 mb-6 text-4xl sm:text-[48px] rounded-full transition-all duration-200 group-hover:scale-105 group-hover:bg-opacity-80",l[n]),children:e}),r.jsxs("div",{className:"max-w-[500px] mb-6 space-y-2",children:[r.jsx("h3",{className:"text-xl sm:text-2xl font-bold font-heading text-gray-900 dark:text-dark-text leading-tight",children:a}),t&&r.jsx("p",{className:"text-sm sm:text-base text-gray-600 dark:text-dark-text-muted leading-relaxed",children:t})]}),o&&r.jsx("button",{className:"inline-flex items-center justify-center px-6 py-3 font-semibold text-white bg-gradient-to-br from-primary-500 to-primary-600 rounded-lg shadow-md transition-all duration-200 cursor-pointer hover:from-primary-600 hover:to-primary-700 hover:shadow-lg hover:-translate-y-0.5 active:scale-95 active:translate-y-0 min-h-[44px]",onClick:o.onClick,children:o.label})]})},Aa=({onSearch:e,debounceMs:a=300,placeholder:t="Pesquisar vídeos...",initialValue:o="",showClear:n=!0,autoFocus:l=!1,size:i="md",className:c="",...m})=>{const[d,f]=k.useState(o),[y,N]=k.useState(!1),v=k.useRef(null),C=k.useRef();k.useEffect(()=>{l&&v.current&&v.current.focus()},[l]),k.useEffect(()=>(C.current&&clearTimeout(C.current),C.current=setTimeout(()=>{e(d)},a),()=>{C.current&&clearTimeout(C.current)}),[d,e,a]);const S=G=>{f(G.target.value)},T=()=>{var G;f(""),(G=v.current)==null||G.focus()},z=G=>{G.key==="Escape"&&T()},E={sm:"h-9 text-sm rounded-lg",md:"h-11 sm:h-12 text-base rounded-xl",lg:"h-13 sm:h-14 text-lg rounded-2xl"},X={sm:"w-4 h-4 ml-3",md:"w-5 h-5 ml-4",lg:"w-6 h-6 ml-5"};return r.jsxs("div",{className:x("relative flex items-center w-full max-w-[600px] bg-white dark:bg-dark-surface border border-gray-300 dark:border-dark-border shadow-sm transition-all duration-150 overflow-hidden",y?"border-primary-500 ring-3 ring-primary-100 dark:ring-primary-900/30":"hover:border-gray-400 dark:hover:border-dark-border/80 hover:shadow",E[i],c),children:[r.jsx(va,{className:x("text-gray-400 dark:text-dark-text-muted flex-shrink-0",X[i]),"aria-hidden":"true"}),r.jsx("input",{ref:v,type:"text",className:"flex-1 h-full px-3 py-2 border-none bg-transparent font-sans text-gray-900 dark:text-dark-text outline-none placeholder-gray-400 dark:placeholder-dark-text-muted text-inherit",value:d,onChange:S,onKeyDown:z,onFocus:()=>N(!0),onBlur:()=>N(!1),placeholder:t,"aria-label":"Campo de busca",...m}),n&&d&&r.jsx("button",{type:"button",className:x("flex items-center justify-center mr-3 bg-gray-150 dark:bg-dark-surface-light border-none rounded-full cursor-pointer text-gray-500 dark:text-dark-text-muted transition-all duration-150 flex-shrink-0 hover:bg-gray-200 dark:hover:bg-dark-surface-light/80 hover:scale-105 active:scale-95",i==="sm"?"w-5 h-5 p-0.5":i==="md"?"w-6 h-6 p-1":"w-7 h-7 p-1.5"),onClick:T,"aria-label":"Limpar busca",children:r.jsx(be,{className:"w-full h-full"})})]})},Oa=({onDateSelect:e,label:a="Selecione uma data",maxDate:t,minDate:o,initialDate:n})=>{const[l,i]=k.useState(n||"");k.useEffect(()=>{i(n||"")},[n]);const c=m=>{const d=m.target.value;i(d),e(d)};return r.jsxs("div",{className:"flex flex-col gap-2.5 w-full max-w-[400px] md:max-w-full",children:[r.jsx("label",{htmlFor:"date-picker",className:"font-sans text-xs font-semibold text-gray-700 dark:text-dark-text-muted uppercase tracking-wider",children:a}),r.jsx("input",{id:"date-picker",type:"date",value:l,onChange:c,max:t,min:o,className:x("w-full px-4 py-3 font-sans text-base font-medium border-2 border-gray-300 dark:border-dark-border rounded-xl bg-white dark:bg-dark-surface text-gray-900 dark:text-dark-text shadow-sm cursor-pointer outline-none transition-all duration-200","hover:border-primary-400 hover:shadow-md focus:border-primary-500 focus:ring-3 focus:ring-primary-100 dark:focus:ring-primary-900/30","webkit-calendar-picker-indicator:cursor-pointer webkit-calendar-picker-indicator:p-1 webkit-calendar-picker-indicator:rounded-md webkit-calendar-picker-indicator:transition-colors hover:webkit-calendar-picker-indicator:bg-primary-50")})]})},Fa=({onDateChange:e,initialStartDate:a,initialEndDate:t,allowRange:o=!0,placeholder:n="Selecionar data"})=>{const[l,i]=k.useState(a||""),[c,m]=k.useState(t||""),[d,f]=k.useState(null),[y,N]=k.useState(!1),v=()=>new Date().toISOString().split("T")[0],C=()=>{const O=new Date;return O.setDate(O.getDate()-1),O.toISOString().split("T")[0]},S=O=>{const I=new Date;return I.setDate(I.getDate()-O),I.toISOString().split("T")[0]},T=O=>{switch(f(O),O){case"today":i(v()),m(v()),e(v(),v());break;case"yesterday":i(C()),m(C()),e(C(),C());break;case"last7days":i(S(7)),m(v()),e(S(7),v());break;case"last30days":i(S(30)),m(v()),e(S(30),v());break;case"custom":f("custom");break}O!=="custom"&&N(!1)},z=O=>{const I=O.target.value;i(I),f("custom"),e(I,o?c:null)},E=O=>{const I=O.target.value;m(I),f("custom"),e(l,I)},X=()=>{i(""),m(""),f(null),e(null,null)},G=()=>l?d&&d!=="custom"?{today:"Hoje",yesterday:"Ontem",last7days:"Últimos 7 dias",last30days:"Últimos 30 dias",custom:"Personalizado"}[d]:o&&c&&l!==c?`${Z(l)} - ${Z(c)}`:Z(l):n,Z=O=>{const[I,b,D]=O.split("-");return`${D}/${b}/${I}`};return r.jsxs("div",{className:"relative inline-block w-full sm:w-auto",children:[r.jsxs("button",{type:"button",className:x("w-full sm:w-auto min-w-[200px] h-11 sm:h-12 px-4 flex items-center gap-2.5 bg-white dark:bg-dark-surface border-2 border-gray-300 dark:border-dark-border rounded-xl font-sans font-medium text-base text-gray-700 dark:text-dark-text cursor-pointer transition-all duration-200 outline-none select-none hover:border-gray-400 dark:hover:border-dark-border/80 hover:shadow-sm focus-visible:ring-3 focus-visible:ring-primary-300",y&&"border-primary-500 ring-3 ring-primary-100 dark:ring-primary-900/30"),onClick:()=>N(!y),"aria-label":"Selecionar data","aria-expanded":y,children:[r.jsx(_r,{className:"w-5 h-5 text-gray-400 dark:text-dark-text-muted flex-shrink-0"}),r.jsx("span",{className:"flex-1 text-left whitespace-nowrap overflow-hidden text-ellipsis",children:G()}),l||c?r.jsx("button",{type:"button",className:"flex items-center justify-center w-5 h-5 bg-gray-200 dark:bg-dark-surface-light border-none rounded-full text-[10px] text-gray-600 dark:text-dark-text-muted transition-all duration-150 flex-shrink-0 hover:bg-gray-300 dark:hover:bg-dark-surface hover:scale-105 active:scale-95",onClick:O=>{O.stopPropagation(),X()},"aria-label":"Limpar seleção",children:r.jsx(be,{className:"w-3 h-3"})}):r.jsx(Rr,{className:"w-4 h-4 text-gray-400 dark:text-dark-text-muted flex-shrink-0"})]}),y&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"fixed inset-0 z-40 sm:hidden",onClick:()=>N(!1)}),r.jsxs("div",{className:x("absolute top-[calc(100%+8px)] left-0 sm:left-auto z-50 min-w-[280px] bg-white dark:bg-dark-surface border border-gray-300 dark:border-dark-border rounded-2xl shadow-xl animate-slideUp sm:animate-slideDown","w-[calc(100vw-32px)] max-w-[340px] left-1/2 -translate-x-1/2 sm:left-0 sm:translate-x-0"),children:[r.jsxs("div",{className:"flex flex-col gap-1 p-3",children:[r.jsx("button",{type:"button",className:x("w-full px-3 py-2 text-left font-sans text-sm font-medium text-gray-700 dark:text-dark-text rounded-xl border-none bg-transparent cursor-pointer transition-all hover:bg-gray-150 dark:hover:bg-dark-surface-light min-h-[40px]",d==="today"&&"bg-primary-50 dark:bg-primary-950/20 text-primary-700 dark:text-primary-400 font-semibold"),onClick:()=>T("today"),children:"Hoje"}),r.jsx("button",{type:"button",className:x("w-full px-3 py-2 text-left font-sans text-sm font-medium text-gray-700 dark:text-dark-text rounded-xl border-none bg-transparent cursor-pointer transition-all hover:bg-gray-150 dark:hover:bg-dark-surface-light min-h-[40px]",d==="yesterday"&&"bg-primary-50 dark:bg-primary-950/20 text-primary-700 dark:text-primary-400 font-semibold"),onClick:()=>T("yesterday"),children:"Ontem"}),r.jsx("button",{type:"button",className:x("w-full px-3 py-2 text-left font-sans text-sm font-medium text-gray-700 dark:text-dark-text rounded-xl border-none bg-transparent cursor-pointer transition-all hover:bg-gray-150 dark:hover:bg-dark-surface-light min-h-[40px]",d==="last7days"&&"bg-primary-50 dark:bg-primary-950/20 text-primary-700 dark:text-primary-400 font-semibold"),onClick:()=>T("last7days"),children:"Últimos 7 dias"}),r.jsx("button",{type:"button",className:x("w-full px-3 py-2 text-left font-sans text-sm font-medium text-gray-700 dark:text-dark-text rounded-xl border-none bg-transparent cursor-pointer transition-all hover:bg-gray-150 dark:hover:bg-dark-surface-light min-h-[40px]",d==="last30days"&&"bg-primary-50 dark:bg-primary-950/20 text-primary-700 dark:text-primary-400 font-semibold"),onClick:()=>T("last30days"),children:"Últimos 30 dias"})]}),r.jsx("div",{className:"h-[1px] mx-3 my-1 bg-gray-200 dark:bg-dark-border"}),r.jsxs("div",{className:"flex flex-col gap-3.5 p-4 bg-gray-50/50 dark:bg-dark-bg/20 rounded-b-2xl",children:[r.jsxs("label",{className:"flex flex-col gap-1.5 font-sans text-xs font-semibold text-gray-500 dark:text-dark-text-muted uppercase tracking-wider",children:["Data inicial",r.jsx("input",{type:"date",className:"w-full px-3 py-2 bg-white dark:bg-dark-surface border border-gray-300 dark:border-dark-border rounded-lg font-sans text-sm text-gray-900 dark:text-dark-text cursor-pointer outline-none transition-colors hover:border-gray-400 focus:border-primary-500",value:l,onChange:z,max:v()})]}),o&&r.jsxs("label",{className:"flex flex-col gap-1.5 font-sans text-xs font-semibold text-gray-500 dark:text-dark-text-muted uppercase tracking-wider",children:["Data final",r.jsx("input",{type:"date",className:"w-full px-3 py-2 bg-white dark:bg-dark-surface border border-gray-300 dark:border-dark-border rounded-lg font-sans text-sm text-gray-900 dark:text-dark-text cursor-pointer outline-none transition-colors hover:border-gray-400 focus:border-primary-500",value:c,onChange:E,min:l,max:v()})]})]})]})]})]})};function Ia({tabs:e,activeTab:a,onChange:t,className:o}){return r.jsx("div",{className:x("border-b border-gray-150 dark:border-dark-border/40 flex gap-2 overflow-x-auto select-none",o),children:e.map(n=>{const l=n.id===a;return r.jsxs("button",{type:"button",onClick:()=>t(n.id),className:x("flex items-center gap-2 px-4 py-3 text-xs font-bold uppercase tracking-wider border-b-2 transition-all cursor-pointer whitespace-nowrap outline-none",l?"border-primary-500 text-primary-500 font-extrabold":"border-transparent text-gray-500 hover:text-gray-700 dark:text-dark-text-muted dark:hover:text-dark-text"),children:[n.icon,n.label]},n.id)})})}const rt=({videoUrl:e,fileName:a,downloadCount:t=0,onDownloadIncrement:o,onDownloadComplete:n,onDownloadChange:l,onError:i,size:c="md",iconOnly:m=!1,useLucide:d=!0})=>{const[f,y]=k.useState("idle"),[N,v]=k.useState(0),[C,S]=k.useState(t),T=async()=>{var I;try{y("downloading"),v(0);const b=await fetch(e);if(!b.ok)throw new Error("Falha ao baixar o vídeo");const D=b.headers.get("content-length");if(!D)throw new Error("Não foi possível obter o tamanho do arquivo");const le=(I=b.body)==null?void 0:I.getReader();if(!le)throw new Error("Não foi possível ler o stream do vídeo");let ie=0;const ae=[],$=parseInt(D,10);for(;;){const{done:re,value:de}=await le.read();if(re)break;ae.push(de),ie+=de.length,v(Math.round(ie/$*100))}v(100);const L=new Blob(ae),H=window.URL.createObjectURL(L),V=document.createElement("a");V.href=H,V.download=a,document.body.appendChild(V),V.click(),document.body.removeChild(V),window.URL.revokeObjectURL(H),y("success");const ee=C+1;if(S(ee),l==null||l(ee),setTimeout(()=>{y("idle"),v(0)},2e3),o)try{const re=await o();re!==ee&&(S(re),l==null||l(re))}catch(re){i==null||i(re)}n==null||n()}catch(b){y("error"),i==null||i(b),setTimeout(()=>{y("idle"),v(0)},2e3)}},z={sm:16,md:20,lg:24},E=()=>{if(d)switch(f){case"downloading":return r.jsx(De,{className:"animate-spin text-primary-500",size:z[c]});case"success":return r.jsx(Cr,{className:"text-green-600 dark:text-green-400",size:z[c]});case"error":return r.jsx(be,{className:"text-red-600 dark:text-red-400",size:z[c]});default:return r.jsx(Sr,{className:"text-gray-600 dark:text-dark-text-muted group-hover:text-primary-500 transition-colors",size:z[c]})}switch(f){case"downloading":return"⏳";case"success":return"✓";case"error":return"✕";default:return"⬇️"}},X=()=>{switch(f){case"downloading":return`${N}%`;case"success":return"Baixado!";case"error":return"Erro";default:return m?"":"Download"}},G={idle:"bg-gray-100 dark:bg-dark-surface hover:bg-gray-200 dark:hover:bg-dark-surface-light border-gray-300 dark:border-dark-border text-gray-700 dark:text-dark-text hover:-translate-y-0.5",downloading:"bg-primary-50 dark:bg-primary-900/20 border-primary-300 dark:border-primary-800 text-primary-700 dark:text-primary-400",success:"bg-green-50 dark:bg-green-950/20 border-green-300 dark:border-green-800 text-green-700 dark:text-green-400 animate-successPulse",error:"bg-red-50 dark:bg-red-950/20 border-red-300 dark:border-red-800 text-red-700 dark:text-red-400 animate-shake"},Z={sm:"px-2 py-1 text-sm min-h-[32px] rounded-md",md:"px-3 py-2 text-base min-h-[40px] sm:min-h-[44px] rounded-md",lg:"px-4 py-3 text-lg min-h-[48px] sm:min-h-[52px] rounded-lg"},O={sm:"min-w-[16px] h-4 text-[10px] px-1",md:"min-w-[20px] h-5 text-xs px-1.5",lg:"min-w-[22px] h-[22px] text-xs px-2"};return r.jsxs("button",{className:x("relative inline-flex items-center gap-2 font-semibold cursor-pointer transition-all duration-200 select-none border overflow-hidden focus-visible:ring-3 focus-visible:ring-primary-300 focus-visible:ring-offset-2 disabled:opacity-75 disabled:cursor-not-allowed",G[f],Z[c]),onClick:T,disabled:f==="downloading","aria-label":`Baixar vídeo ${a}`,children:[r.jsx("span",{className:"flex items-center justify-center leading-none flex-shrink-0",children:E()}),!m&&r.jsxs("span",{className:"flex items-center gap-1.5 z-10",children:[r.jsx("span",{className:"whitespace-nowrap",children:X()}),C>0&&r.jsx("span",{className:x("inline-flex items-center justify-center rounded-full bg-primary-500 text-white font-bold",O[c]),children:C})]}),f==="downloading"&&r.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-[3px] bg-primary-100 dark:bg-primary-900 overflow-hidden",children:r.jsx("div",{className:"h-full bg-gradient-to-r from-primary-500 to-primary-600 transition-all duration-250 ease-out",style:{width:`${N}%`}})})]})},tt=({initialLikes:e=0,onLike:a,onLikeChange:t,size:o="md",iconOnly:n=!1,disabled:l=!1,useLucide:i=!0})=>{const[c,m]=k.useState(e),[d,f]=k.useState(!1),y=async()=>{if(l||d)return;const T=c+1;if(f(!0),m(T),t==null||t(T),a)try{const z=await a();m(z),z!==T&&(t==null||t(z))}catch{m(c),t==null||t(c)}finally{setTimeout(()=>f(!1),600)}else setTimeout(()=>f(!1),600)},N={sm:"px-2 py-1 text-sm min-h-[32px]",md:"px-3 py-2 text-base min-h-[40px] sm:min-h-[44px]",lg:"px-4 py-3 text-lg min-h-[48px] sm:min-h-[52px]"},v={sm:"text-base",md:"text-lg",lg:"text-xl"},C={sm:16,md:20,lg:24},S={sm:"min-w-[16px] h-4 text-[10px] px-1",md:"min-w-[20px] h-5 text-xs px-1.5",lg:"min-w-[22px] h-[22px] text-xs px-2"};return r.jsxs("button",{className:x("relative inline-flex items-center justify-center gap-2 font-semibold cursor-pointer transition-all duration-200 select-none rounded-lg border focus-visible:ring-3 focus-visible:ring-primary-300 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed","bg-primary-50 border-primary-300 text-primary-700 hover:bg-primary-100 hover:border-primary-400 active:scale-95",N[o],d&&"animate-heartBeat"),onClick:y,disabled:l,"aria-label":"Curtir vídeo","aria-pressed":!0,children:[r.jsxs("span",{className:"relative flex items-center justify-center leading-none flex-shrink-0",children:[i?r.jsx(Re,{className:x("fill-rose-500 text-rose-500 transition-transform duration-150",d&&"animate-iconPop"),size:C[o]}):r.jsx("span",{className:x("flex items-center justify-center transition-transform duration-150",d&&"animate-iconPop"),children:"❤️"}),d&&r.jsx(r.Fragment,{children:i?r.jsxs(r.Fragment,{children:[r.jsx(Re,{className:"absolute pointer-events-none opacity-0 animate-heartFloat1 fill-rose-500 text-rose-500",size:C[o]-4}),r.jsx(Re,{className:"absolute pointer-events-none opacity-0 animate-heartFloat2 fill-rose-500 text-rose-500",size:C[o]-4}),r.jsx(Re,{className:"absolute pointer-events-none opacity-0 animate-heartFloat3 fill-rose-500 text-rose-500",size:C[o]-4})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{className:x("absolute text-sm pointer-events-none opacity-0 animate-heartFloat1",v[o]),children:"❤️"}),r.jsx("span",{className:x("absolute text-sm pointer-events-none opacity-0 animate-heartFloat2",v[o]),children:"❤️"}),r.jsx("span",{className:x("absolute text-sm pointer-events-none opacity-0 animate-heartFloat3",v[o]),children:"❤️"})]})})]}),!n&&r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"whitespace-nowrap",children:"Curtido"}),c>0&&r.jsx("span",{className:x("inline-flex items-center justify-center rounded-full bg-primary-600 text-white font-bold transition-all duration-150 animate-countBounce",S[o]),children:c})]})]})};function Ma({video:e,showShare:a=!0,onPlay:t,onShare:o,onLikeChange:n,onDownloadComplete:l,onDownloadIncrement:i,extraActions:c,className:m}){const[d,f]=k.useState(!1),[y,N]=k.useState(!1),v=k.useRef(null),[C,S]=k.useState(e.curtidas),[T,z]=k.useState(e.downloads),[E,X]=k.useState(e.visualizacoes||0),[G,Z]=k.useState(e.compartilhamentos||0),O=e.is_vertical===void 0||e.is_vertical!==!1&&e.is_vertical!==0;k.useEffect(()=>{S(e.curtidas),z(e.downloads),X(e.visualizacoes||0),Z(e.compartilhamentos||0)},[e.curtidas,e.downloads,e.visualizacoes,e.compartilhamentos]);const I=e.dthr&&e.dthr.length>=16?e.dthr.substring(11,16):"",b=e.dthr&&e.dthr.length>=10?new Date(e.dthr).toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit"}):"",D=L=>L.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g,"-").replace(/[^\w-]/g,"").replace(/-{2,}/g,"-").trim(),le=["Rock10",e.arena_nome?D(e.arena_nome):null,e.quadra_nome?D(e.quadra_nome):null,D(e.nome.replace(/\.mp4$/i,""))].filter(Boolean).join("-")+".mp4",ie=()=>{N(!0),f(!0),X(L=>L+1),t&&t(e)},ae=()=>{v.current&&(d?v.current.pause():ie())},$=async()=>{if(o){o(e);return}const L=`${window.location.origin}/video/${e.id}`,H={title:e.nome,text:"Confira este lance gravado no Rock10 Replay:",url:L};if(navigator.share)try{await navigator.share(H),Z(V=>V+1);return}catch{}try{await navigator.clipboard.writeText(`${H.text} ${H.url}`),Z(V=>V+1),alert("Link copiado para a área de transferência!")}catch{window.open(H.url,"_blank")}};return r.jsxs("article",{className:x("group relative flex flex-col bg-white dark:bg-dark-surface rounded-2xl shadow-xs hover:shadow-xl hover:-translate-y-1 transition-all duration-300 overflow-hidden border border-gray-150 dark:border-dark-border",m),children:[r.jsxs("div",{className:x("relative w-full overflow-hidden bg-black z-10 cursor-pointer select-none",O?"aspect-[9/16]":"aspect-[16/9]",d&&"rounded-b-none"),onClick:ae,children:[r.jsx("video",{ref:v,className:"w-full h-full object-contain transition-transform duration-300 bg-black group-hover:scale-[1.02]",src:y?e.url:void 0,poster:e.poster,controls:d,autoPlay:d,playsInline:!0,muted:!1,preload:y?"metadata":"none",onPlay:()=>f(!0),onPause:()=>f(!1)}),!d&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/15 transition-opacity duration-300 z-20 pointer-events-none group-hover:bg-black/30",children:r.jsx("div",{className:"w-14 h-14 sm:w-16 sm:h-16 flex items-center justify-center bg-white/95 dark:bg-dark-surface/95 text-primary-500 rounded-full shadow-2xl backdrop-blur-sm transition-transform duration-200 hover:scale-110 active:scale-95",children:r.jsx(ka,{className:"w-6 h-6 fill-current ml-1"})})}),r.jsxs("div",{className:"absolute left-0 right-0 bottom-0 bg-gradient-to-t from-white via-white/80 to-transparent dark:from-dark-surface dark:via-dark-surface/85 dark:to-transparent pt-8 pb-3 px-3.5 flex flex-col gap-1 z-20 pointer-events-none",children:[(e.arena_nome||e.quadra_nome)&&r.jsxs("div",{className:"text-xs font-bold text-primary-600 dark:text-primary-400 flex items-center gap-1.5 leading-none",children:[r.jsx(Tr,{className:"w-3.5 h-3.5"}),r.jsxs("span",{children:[e.arena_nome||""," ",e.arena_nome&&e.quadra_nome?"•":""," ",e.quadra_nome||""]})]}),r.jsxs("div",{className:"flex justify-between items-center w-full mt-1.5",children:[r.jsxs("span",{className:"text-xs font-bold text-gray-800 dark:text-dark-text flex items-center gap-1.5 leading-none",children:[r.jsx(_r,{className:"w-3.5 h-3.5 text-gray-500 dark:text-dark-text-muted"})," ",b,r.jsx(ba,{className:"w-3.5 h-3.5 text-gray-500 dark:text-dark-text-muted ml-0.5"})," ",I]}),r.jsxs("div",{className:"flex gap-2 sm:gap-2.5 items-center text-xs font-bold text-gray-800 dark:text-dark-text leading-none",children:[r.jsxs("span",{className:"flex items-center gap-1",title:"Visualizações",children:[r.jsx(pa,{className:"w-3.5 h-3.5 text-gray-500 dark:text-dark-text-muted"})," ",E]}),r.jsxs("span",{className:"flex items-center gap-1",title:"Compartilhamentos",children:[r.jsx(Er,{className:"w-3.5 h-3.5 text-gray-500 dark:text-dark-text-muted"})," ",G]}),r.jsxs("span",{className:"flex items-center gap-1",title:"Downloads",children:[r.jsx(Sr,{className:"w-3.5 h-3.5 text-gray-500 dark:text-dark-text-muted"})," ",T]}),r.jsxs("span",{className:"flex items-center gap-1",title:"Curtidas",children:[r.jsx(Re,{className:"w-3.5 h-3.5 text-gray-500 dark:text-dark-text-muted"})," ",C]})]})]})]})]})]}),r.jsx("div",{className:"p-3.5 sm:p-4 flex flex-col gap-3 relative z-20 bg-white dark:bg-dark-surface flex-1",children:r.jsxs("div",{className:"flex gap-2.5 items-center justify-start pointer-events-auto",onClick:L=>L.stopPropagation(),children:[r.jsx(rt,{videoUrl:e.url,fileName:le,downloadCount:T,size:"sm",iconOnly:!0,onDownloadIncrement:i?()=>i(e.id):void 0,onDownloadChange:L=>z(L),onDownloadComplete:()=>l==null?void 0:l(e.id)}),r.jsx(tt,{videoId:e.id,initialLikes:C,size:"sm",iconOnly:!0,onLikeChange:L=>{S(L),n==null||n(e.id,!0)}}),a&&r.jsx(Lr,{icon:r.jsx(Er,{className:"w-4 h-4 text-gray-600 dark:text-dark-text"}),ariaLabel:"Compartilhar vídeo",variant:"ghost",size:"sm",rounded:!0,onClick:$}),c&&r.jsx("div",{className:"ml-auto flex items-center gap-2",children:c})]})})]})}function Da({arena:e,onClick:a,actionText:t="Ver Replays",extraBadge:o,className:n}){return r.jsxs("div",{onClick:()=>a==null?void 0:a(e),className:x("group bg-white dark:bg-dark-surface border border-gray-150 dark:border-dark-border rounded-2xl p-5 shadow-xs hover:shadow-md hover:-translate-y-1 transition-all duration-200 cursor-pointer flex flex-col justify-between",n),children:[r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-50 dark:bg-blue-950/40 text-blue-600 dark:text-blue-400 flex items-center justify-center font-bold text-base shrink-0 overflow-hidden border border-blue-150 dark:border-blue-900/40",children:e.logo_url?r.jsx("img",{src:e.logo_url,alt:e.nome,className:"w-full h-full object-cover"}):r.jsx(wa,{className:"w-6 h-6"})}),r.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap justify-end",children:[o,e.ativo!==void 0&&r.jsx(Dr,{variant:e.ativo?"success":"danger",dot:!0,size:"sm",children:e.ativo?"Ativa":"Inativa"})]})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-base font-bold text-gray-900 dark:text-dark-text group-hover:text-primary-500 transition-colors line-clamp-1",children:e.nome}),(e.cidade||e.uf)&&r.jsxs("p",{className:"text-xs text-gray-500 dark:text-dark-text-muted font-medium flex items-center gap-1 mt-1",children:[r.jsx(Tr,{className:"w-3.5 h-3.5 text-gray-400 shrink-0"}),r.jsxs("span",{children:[e.cidade,e.cidade&&e.uf?" / ":"",e.uf]})]})]}),e.total_quadras!==void 0&&r.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-semibold text-gray-600 dark:text-dark-text-muted pt-2 border-t border-gray-100 dark:border-dark-border",children:[r.jsx(ya,{className:"w-4 h-4 text-emerald-500"}),r.jsxs("span",{children:[e.total_quadras," ",e.total_quadras===1?"quadra disponível":"quadras disponíveis"]})]})]}),r.jsxs("div",{className:"mt-4 pt-3 flex items-center justify-between text-xs font-bold text-primary-600 dark:text-primary-400 group-hover:text-primary-700 dark:group-hover:text-primary-300 transition-colors",children:[r.jsx("span",{children:t}),r.jsx(ma,{className:"w-4 h-4 transform group-hover:translate-x-1 transition-transform"})]})]})}function La({variant:e="full",themeMode:a="auto",size:t="md",className:o,...n}){const l={sm:e==="full"?"h-6 w-auto":"h-6 w-6",md:e==="full"?"h-8 w-auto":"h-8 w-8",lg:e==="full"?"h-10 w-auto":"h-10 w-10",xl:e==="full"?"h-12 w-auto":"h-12 w-12"};return e==="icon"?r.jsxs("svg",{viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:x(l[t],o),...n,children:[r.jsx("rect",{width:"40",height:"40",rx:"10",fill:"#0EA571"}),r.jsx("path",{d:"M12 28V12H21C23.7614 12 26 14.2386 26 17C26 19.7614 23.7614 22 21 22H16V28H12Z",fill:"white"}),r.jsx("path",{d:"M20 21L26 28H21L16.5 22.5H20V21Z",fill:"#FF6B35"}),r.jsx("circle",{cx:"28",cy:"14",r:"3",fill:"#FF6B35"})]}):r.jsxs("svg",{viewBox:"0 0 160 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:x(l[t],o),...n,children:[r.jsx("rect",{width:"40",height:"40",rx:"10",fill:"#0EA571"}),r.jsx("path",{d:"M12 28V12H21C23.7614 12 26 14.2386 26 17C26 19.7614 23.7614 22 21 22H16V28H12Z",fill:"white"}),r.jsx("path",{d:"M20 21L26 28H21L16.5 22.5H20V21Z",fill:"#FF6B35"}),r.jsx("circle",{cx:"28",cy:"14",r:"3",fill:"#FF6B35"}),r.jsx("text",{x:"48",y:"28",fontFamily:"Inter, system-ui, sans-serif",fontSize:"20",fontWeight:"800",fill:a==="light"?"#0F1419":a==="dark"?"#FFFFFF":"currentColor",letterSpacing:"-0.5px",children:"ROCK"}),r.jsx("text",{x:"112",y:"28",fontFamily:"Inter, system-ui, sans-serif",fontSize:"20",fontWeight:"900",fill:"#0EA571",children:"10"})]})}j.Alert=Ra,j.ArenaCard=Da,j.Badge=Dr,j.Button=zr,j.Card=Vr,j.CardContent=Ur,j.CardDescription=Gr,j.CardFooter=Hr,j.CardHeader=Br,j.CardTitle=Wr,j.Checkbox=Ir,j.ConfirmDialog=Pa,j.DatePicker=Oa,j.DateSelector=Fa,j.DownloadButton=rt,j.EmptyState=za,j.FilterBar=Sa,j.IconButton=Lr,j.Input=Ar,j.LikeButton=tt,j.Loading=Ea,j.Logo=La,j.Modal=et,j.PageHeader=Ta,j.SearchBar=Aa,j.Select=Or,j.Skeleton=Se,j.StatCard=Ca,j.Switch=Mr,j.Table=Jr,j.TableBody=Zr,j.TableCell=qr,j.TableContainer=Kr,j.TableHead=$r,j.TableHeader=Xr,j.TableRow=Qr,j.Tabs=Ia,j.Textarea=Fr,j.VideoCard=Ma,j.cn=x,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rock10/ui",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "type": "module",
5
5
  "main": "./dist/index.umd.js",
6
6
  "module": "./dist/index.es.js",