UNPKG

@ntdsk/react-ui

Version:

Reusable components used on nautidesk web projects

1 lines 64.6 kB
import{jsx as e,jsxs as t,Fragment as o}from"react/jsx-runtime";import r,{useState as a,useRef as n,useEffect as l}from"react";import{Icon as i}from"@iconify/react";import s from"moment";import"moment/locale/pt-br";import{createPortal as c}from"react-dom";function d(e,t){void 0===t&&(t={});var o=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===o&&r.firstChild?r.insertBefore(a,r.firstChild):r.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}d(".app-ripple-container{overflow:hidden;position:relative}.app-ripple-effect{animation:ripple .6s linear;background-color:hsla(0,0%,100%,.6);border-radius:50%;pointer-events:none;position:absolute;transform:scale(0)}@keyframes ripple{to{opacity:0;transform:scale(4)}}");const p=({onClick:t})=>e("span",{className:"app-ripple-container",onClick:e=>{const o=e.currentTarget,r=o.getBoundingClientRect(),a=Math.max(r.width,r.height),n=e.clientX-r.left-a/2,l=e.clientY-r.top-a/2,i=document.createElement("span");i.className="app-ripple-effect",i.style.width=i.style.height=a+"px",i.style.left=n+"px",i.style.top=l+"px",o.appendChild(i),setTimeout(()=>{i.parentNode&&i.parentNode.removeChild(i)},600),t&&t(e)},style:{position:"absolute",top:0,left:0,right:0,bottom:0}});d('.app-button{align-items:center;border-radius:.125rem;cursor:pointer;display:inline-flex;font-family:inherit;font-size:inherit;gap:.5rem;justify-content:center;padding:.25rem .75rem;position:relative;transition:all .2s ease;width:100%}.app-button:not([class*=border-]){border:none}.app-button:not([class*=bg-]){background-color:#282725}.app-button:not([class*=text-]){color:#fff}.app-button:hover:not(:disabled){opacity:.8}.app-button:disabled{cursor:not-allowed;opacity:.55}.app-button:focus,.app-button:focus-visible{outline:4px auto -webkit-focus-ring-color}.app-button-content{align-items:center;display:flex;gap:.5rem;position:relative;width:100%}.app-button-content.justify-left{justify-content:flex-start}.app-button-content.justify-right{justify-content:flex-end}.app-button-content.justify-center{justify-content:center}.app-button-subtext{font-size:.75rem;line-height:1rem}.app-button-tooltip{background-color:#333;border-radius:.25rem;color:#fff;font-size:.875rem;opacity:0;padding:.5rem .75rem;pointer-events:none;position:absolute;transition:opacity .2s ease,visibility .2s ease;visibility:hidden;white-space:nowrap;z-index:1000}.app-button:hover .app-button-tooltip{opacity:1;visibility:visible}.app-button-tooltip-top{bottom:100%;left:50%;transform:translateX(-50%) translateY(-8px)}.app-button-tooltip-bottom{left:50%;top:100%;transform:translateX(-50%) translateY(8px)}.app-button-tooltip-left{right:100%;top:50%;transform:translateY(-50%) translateX(-8px)}.app-button-tooltip-right{left:100%;top:50%;transform:translateY(-50%) translateX(8px)}.app-button-tooltip:before{border:6px solid transparent;content:"";position:absolute}.app-button-tooltip-top:before{border-top-color:#333;left:50%;top:100%;transform:translateX(-50%)}.app-button-tooltip-bottom:before{border-bottom-color:#333;bottom:100%;left:50%;transform:translateX(-50%)}.app-button-tooltip-left:before{border-left-color:#333;left:100%;top:50%;transform:translateY(-50%)}.app-button-tooltip-right:before{border-right-color:#333;right:100%;top:50%;transform:translateY(-50%)}');const m=({label:o,icon:r,iconPosition:a="left",iconClassName:n,iconWidth:l,iconStyle:s,className:c,onClick:d,disabled:m,type:u="button",subtext:b,subtextClassName:g,loading:h,style:f,align:x="center",tooltip:y,tooltipPosition:v="top"})=>t("button",{disabled:h||m,type:u,style:f,className:`p-ripple app-button ${c||""}`,onClick:()=>{d&&!m&&d()},children:[t("div",{className:`app-button-content justify-${x}`,children:["left"===a&&r&&e(i,{icon:r,width:l,className:n,style:s}),o,h&&e(i,{icon:"eos-icons:bubble-loading",width:l,className:n,style:s}),"left"!==a&&r&&e(i,{icon:r,width:l,className:n,style:s})]}),b&&e("p",{className:`app-button-subtext ${g}`,children:b}),y&&e("span",{className:`app-button-tooltip app-button-tooltip-${v}`,children:y}),!m&&!h&&e(p,{})]});d(".app-dialog-overlay{align-items:center;background-color:rgba(0,0,0,.5);bottom:0;display:flex;justify-content:center;left:0;padding:1rem;position:fixed;right:0;top:0;z-index:1000}.app-dialog{border-radius:.5rem;box-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 10px 10px -5px rgba(0,0,0,.04);display:flex;flex-direction:column;max-width:90vw;overflow:hidden;position:relative}.app-dialog:not([class*=max-h-]){max-height:90vh}.app-dialog.draggable{cursor:move}.app-dialog-header{align-items:center;border-bottom:1px solid #e5e7eb;display:flex;justify-content:space-between;min-height:60px;padding:1rem 1.5rem}.app-dialog-title{flex:1;font-size:1.125rem;font-weight:600;margin:0}.app-dialog-close-button{align-items:center;background:none;border:none;border-radius:.25rem;color:#6b7280;cursor:pointer;display:flex;font-size:1.5rem;height:32px;justify-content:center;line-height:1;padding:.25rem;transition:all .2s;width:32px}.app-dialog-close-button:hover{background-color:#f3f4f6;color:#374151}.app-dialog-content{flex:1;overflow-y:auto;padding:1.5rem}.app-dialog-hidden{display:none}.app-dialog-overlay.entering{animation:fadeIn .2s ease-out}.app-dialog-overlay.exiting{animation:fadeOut .2s ease-out}.app-dialog.entering{animation:slideIn .2s ease-out}.app-dialog.exiting{animation:slideOut .2s ease-out}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}@keyframes slideIn{0%{opacity:0;transform:scale(.9) translateY(-10px)}to{opacity:1;transform:scale(1) translateY(0)}}@keyframes slideOut{0%{opacity:1;transform:scale(1) translateY(0)}to{opacity:0;transform:scale(.9) translateY(-10px)}}");const u=({visible:o,onHide:r,header:i,children:s,className:c="",maskClassName:d="",contentClassName:p="",headerClassName:m="",closable:u=!0,draggable:b=!1,style:g})=>{const[h,f]=a(!1),[x,y]=a(o),v=n(null),w=n(!1),N=n({x:0,y:0}),k=n({x:0,y:0});l(()=>{if(!o){f(!1),document.body.style.overflow="auto";const e=setTimeout(()=>{y(!1)},200);return()=>clearTimeout(e)}return y(!0),f(!0),document.body.style.overflow="hidden",()=>{document.body.style.overflow="auto"}},[o]),l(()=>{const e=e=>{"Escape"===e.key&&o&&u&&r()};return o&&document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[o,r,u]);const C=e=>{if(!b)return;w.current=!0,N.current={x:e.clientX,y:e.clientY};const t=e=>{if(!w.current||!v.current)return;const t=e.clientX-N.current.x,o=e.clientY-N.current.y;k.current={x:k.current.x+t,y:k.current.y+o},v.current.style.transform=`translate(${k.current.x}px, ${k.current.y}px)`,N.current={x:e.clientX,y:e.clientY}},o=()=>{w.current=!1,document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",o)};document.addEventListener("mousemove",t),document.addEventListener("mouseup",o)};if(!x)return null;return e("div",{className:`app-dialog-overlay ${d} ${h?"entering":"exiting"}`,onClick:e=>{e.target===e.currentTarget&&u&&r()},children:t("div",{ref:v,className:`app-dialog ${c} ${b?"draggable":""} ${h?"entering":"exiting"}`,style:g,onClick:e=>e.stopPropagation(),children:[i?t("div",{className:`app-dialog-header ${m}`,onMouseDown:b?C:void 0,children:[e("div",{className:"app-dialog-title",children:"string"==typeof i?e("h3",{children:i}):i}),u&&e("button",{className:"app-dialog-close-button",onClick:r,type:"button","aria-label":"Close",children:"×"})]}):null,e("div",{className:`app-dialog-content ${p}`,children:s})]})})};d(".app-alert{width:100%}.app-alert-header{align-items:center;display:flex}.app-alert-header.success{color:#10b981}.app-alert-header.error{color:#ef4444}.app-alert-header.warning{color:#f59e0b}.app-alert-header.info{color:#3b82f6}.app-alert-content{padding:0}.app-alert-actions{display:flex;gap:.5rem;justify-content:flex-end;margin-top:1rem}.app-alert-cancel-btn{background-color:#ef4444;color:#fff}.app-alert-confirm-btn{background-color:#d1d5db;color:#374151}@media (min-width:640px){.app-alert{width:32rem}}");const b=({title:o,message:r,onClose:n,onConfirm:i,className:s,confirmLabel:c="Ok",cancelLabel:d="Cancelar"})=>{const[p,b]=a(!!o);if(l(()=>{b(!!o)},[o]),!p)return null;const g=()=>{switch(o){case"Sucesso":return"custom_alert_success";case"Erro":return"custom_alert_error";case"Atenção":return"custom_alert_warning";default:return"custom_alert_info"}};return e(u,{maskClassName:"custom_dialog_master p-4",header:o,visible:p,onHide:()=>{n?n():i()},className:`custom_dialog_master app-alert ${s||""}`,contentClassName:g(),headerClassName:g(),closable:!1,draggable:!1,children:t("div",{className:"app-alert-content",children:[e("p",{children:r}),t("div",{className:"app-alert-actions",children:[n&&e(m,{label:d,className:"app-alert-cancel-btn",onClick:n}),e(m,{label:c,className:"app-alert-confirm-btn",onClick:i})]})]})})};d(".app-modal-header{display:block}.app-modal-subtitle{font-size:1rem;line-height:1.5rem}.app-modal-header-btn{display:flex;justify-content:flex-end}.app-modal-content:not([class*=bg-]){background-color:#f9fafb}.app-modal-content:not([class*=text-]){color:#000}");const g=({children:o,header:r,headerBtn:a,subtitle:n,open:i,onHide:s,className:c,closable:d=!0,draggable:p})=>{l(()=>{if(i){"hidden"!==document.body.style.overflow&&(document.body.style.overflow="hidden")}return()=>{if(!i){0===document.querySelectorAll(".dialog-overlay, .app-sidebar-overlay").length&&(document.body.style.overflow="")}}},[i]);return e(u,{maskClassName:"custom_dialog_master p-4",header:t("div",{className:"app-modal-header",children:[e("h4",{children:r}),n&&e("h5",{className:"app-modal-subtitle",children:n}),a&&e("div",{className:"app-modal-header-btn",children:a})]}),visible:i,onHide:s,className:`custom_dialog_master app-modal-content ${c||""}`,closable:d,draggable:p,children:o})};d(".app-delete-warning-actions{display:flex;gap:.5rem;margin-top:1rem}.app-delete-warning-delete-btn{background-color:#ef4444!important;color:#fff}.app-delete-warning-cancel-btn{background-color:#fff!important;border:1px solid #ef4444;color:#ef4444!important}");const h=({model:o,title:r,message:n,onConfirmDelete:i,onCancel:s})=>{const[c,d]=a(!!o);l(()=>{d(!!o)},[o]);return t(g,{open:c,onHide:()=>{d(!1),s()},header:r||"Deseja excluir o registro?",children:[e("p",{children:n||"Você tem certeza que deseja excluir este registro?"}),t("div",{className:"app-delete-warning-actions",children:[e(m,{label:"Deletar",className:"app-delete-warning-delete-btn",onClick:()=>{i&&i((null==o?void 0:o.id)||"")}}),e(m,{label:"Cancelar",className:"app-delete-warning-cancel-btn",onClick:()=>{d(!1),s()}})]})]})};d(".app-dropdown-button-container{position:relative}.app-dropdown-button{border:none;border-radius:.125rem;cursor:pointer;font-family:inherit;font-size:inherit;padding:.25rem .75rem;transition:all .2s ease}.app-dropdown-button:hover:not(:disabled){opacity:.8}.app-dropdown-button:disabled{cursor:not-allowed}.app-dropdown-button.loading{opacity:.75}.app-dropdown-button-content{align-items:center;display:flex;gap:.5rem;justify-content:center;position:relative;width:100%}.app-dropdown-button-subtext{font-size:.75rem;line-height:1rem}.app-dropdown-menu{background-color:#fff;border-radius:.125rem;box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -1px rgba(0,0,0,.06);display:flex;flex-direction:column;gap:.25rem;padding:.5rem;position:absolute;right:0;top:2rem;z-index:10}.app-dropdown-menu-item{background:transparent;border:none;border-radius:.125rem;cursor:pointer;font-family:inherit;font-size:inherit;padding:.25rem .75rem;transition:all .2s ease}.app-dropdown-menu-item:hover:not(:disabled){opacity:.8}.app-dropdown-menu-item:disabled{cursor:not-allowed;opacity:.5}.app-dropdown-menu-item-content{align-items:center;display:flex;gap:.5rem;justify-content:center;position:relative;width:100%}");const f=({label:o,icon:r,iconPosition:s,iconClassName:c,iconWidth:d,iconStyle:p,className:m,containerClassName:u,disabled:b,type:g="button",subtext:h,subtextClassName:f,loading:x,menu:y,model:v})=>{const[w,N]=a(!1),k=n(null);return l(()=>{const e=e=>{k.current&&!k.current.contains(e.target)&&N(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]),t("div",{ref:k,className:`app-dropdown-button-container ${u||""}`,children:[w&&e("div",{className:"app-dropdown-menu",children:y.map((o,r)=>e("button",{disabled:o.disabled,type:"button",className:`app-dropdown-menu-item ${o.className||""}`,onClick:()=>o.onClick&&o.onClick(v),children:t("div",{className:"app-dropdown-menu-item-content",children:[o.label,o.icon&&e(i,{icon:o.icon})]})},r))}),t("button",{disabled:x||b,type:g,className:`app-dropdown-button ${x?"loading":""} ${m||""}`,onClick:()=>{N(!w)},children:[t("div",{className:"app-dropdown-button-content",children:["left"===s&&r&&e(i,{icon:r,width:d,className:c}),o,x&&r&&e(i,{icon:r,width:d,className:c}),"left"!==s&&r&&e(i,{icon:r,width:d,className:c})]}),h&&e("p",{className:`app-dropdown-button-subtext ${f}`,children:h})]})]})};d('.app-icon{display:inline-block}.app-icon-with-tooltip{position:relative}.app-icon-tooltip{background-color:#333;border-radius:.25rem;color:#fff;font-size:.875rem;opacity:0;padding:.5rem .75rem;pointer-events:none;position:absolute;transition:opacity .2s ease,visibility .2s ease;visibility:hidden;white-space:nowrap;z-index:1000}.app-icon:hover .app-icon-tooltip{opacity:1;visibility:visible}.app-icon-tooltip-top{bottom:100%;left:50%;transform:translateX(-50%) translateY(-8px)}.app-icon-tooltip-bottom{left:50%;top:100%;transform:translateX(-50%) translateY(8px)}.app-icon-tooltip-left{right:100%;top:50%;transform:translateY(-50%) translateX(-8px)}.app-icon-tooltip-right{left:100%;top:50%;transform:translateY(-50%) translateX(8px)}.app-icon-tooltip:before{border:6px solid transparent;content:"";position:absolute}.app-icon-tooltip-top:before{border-top-color:#333;left:50%;top:100%;transform:translateX(-50%)}.app-icon-tooltip-bottom:before{border-bottom-color:#333;bottom:100%;left:50%;transform:translateX(-50%)}.app-icon-tooltip-left:before{border-left-color:#333;left:100%;top:50%;transform:translateY(-50%)}.app-icon-tooltip-right:before{border-right-color:#333;right:100%;top:50%;transform:translateY(-50%)}');const x=({icon:o,label:r,width:a=15,className:n,style:l,onClick:s,tooltip:c,tooltipPosition:d="top"})=>t("div",{className:`app-icon ${c?"app-icon-with-tooltip":""} ${n||""}`,style:Object.assign({display:"inline-flex",alignItems:"center"},l),onClick:s,children:[e(i,{icon:o,width:a}),r&&e("span",{style:{marginLeft:6,display:"inline-block",verticalAlign:"middle"},children:r}),c&&e("span",{className:`app-icon-tooltip app-icon-tooltip-${d}`,children:c})]});d(".app-empty-image{align-items:center;background-color:#f3f4f6;border:1px solid #d1d5db;border-radius:.125rem;display:flex;flex-direction:column}.app-empty-image-icon{margin:10% auto 0;width:100%}.app-empty-image-text{font-size:.75rem;line-height:1rem;margin-top:-.2rem}");const y=({className:o,width:r,height:a,iconWidth:n=80})=>t("div",{className:`app-empty-image ${o||""}`,style:{width:r||void 0,height:a||void 0},children:[e(x,{icon:"solar:camera-bold",width:n,className:"app-empty-image-icon"}),e("p",{className:"app-empty-image-text",children:"Sem Foto"})]});d("");const v=({parentOpen:t})=>{const[o,r]=a(t);return e(g,{open:o,onHide:()=>r(!1),header:"Ajuda",children:e("p",{})})};d("");const w=({size:t=15,className:o=""})=>e(x,{icon:"eos-icons:loading",width:t,className:o});d(".app-menu-drop{position:relative}.app-menu-drop-trigger{align-items:center;border-radius:9999px;cursor:pointer;display:flex;gap:.5rem;padding:.25rem;transition:all .2s ease}.app-menu-drop-list,.app-menu-drop-trigger:hover{background-color:#fff}.app-menu-drop-list{border-radius:.5rem;box-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -2px rgba(0,0,0,.05);list-style:none;margin:0;padding:.5rem;position:absolute}.app-menu-drop-list.hidden{display:none}.app-menu-drop-list.block{display:block}.app-menu-drop-item{align-items:center;border-radius:.5rem;cursor:pointer;display:flex;gap:.5rem;padding:.5rem;transition:all .2s ease}.app-menu-drop-item:hover{background-color:#e5e7eb}");const N=({menuList:o})=>{const[r,i]=a(!1),s=n(null);return l(()=>{const e=e=>{s.current&&!s.current.contains(e.target)&&i(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]),t("div",{ref:s,className:"app-menu-drop",children:[e("div",{onClick:()=>i(!r),className:"app-menu-drop-trigger",children:e(x,{icon:"ic:round-menu",width:30})}),e("ul",{className:"app-menu-drop-list "+(r?"block":"hidden"),children:o.map((o,a)=>t("li",{className:"app-menu-drop-item",onClick:()=>{i(!r)},children:[o.icon&&e(x,{icon:o.icon,width:20}),e("span",{children:o.label})]},a))})]})};d(".app-page-loader{align-items:center;display:flex;height:calc(100vh - 100px);justify-content:center}");const k=({size:t=40,className:o})=>e("div",{className:o||"app-page-loader",children:e(x,{icon:"eos-icons:loading",width:t})});d(".app-pagination{align-items:center;display:flex;font-size:.875rem;gap:.5rem;justify-content:center;line-height:1.25rem;margin-top:1.5rem}.app-pagination-button{border-radius:.125rem;padding:.25rem .75rem}.app-pagination-button:not([class*=bg-]){background-color:#585858}.app-pagination-button:not([class*=border-]){border:1px solid #d1d5db}.app-pagination-button.active:not([class*=text-]){color:#fff}.app-pagination-button.active:not([class*=bg-]){background-color:#1a1a1a}.app-pagination-button.back,.app-pagination-button.next{max-width:90px}.app-pagination-button.back:not([class*=bg-]),.app-pagination-button.next:not([class*=bg-]){background-color:#1a1a1a}.app-pagination-button.page{max-width:40px}.app-pagination-button.next:disabled{opacity:.5}.app-pagination-dots{padding:0 .5rem}");const C=({currentPage:o,totalPages:r,onPageChange:a,buttonStyle:n,activeStyle:l,buttonClassName:i,activeClassName:s,maxVisiblePages:c=10})=>{const d=function(e,t,o){if(t<=o)return Array.from({length:t},(e,t)=>t+1);const r=[];if(1===o)return[e];if(2===o)return 1===e||e===t?[e]:[1,-1,t];const a=t,n=Math.max(0,o-2),l=Math.floor(n/2);let i=Math.max(e-l,2),s=Math.min(e+l,t-1);e-l<2&&(s=Math.min(2+n-1,t-1));e+l>t-1&&(i=Math.max(t-n,2));r.push(1),i>2&&r.push(-1);for(let e=i;e<=s;e++)r.push(e);s<t-1&&r.push(-2);t>1&&r.push(a);return r}(o,r,c);const p=e=>{e!==o&&e>0&&e<=r&&a(e)};return t("div",{className:"app-pagination",children:[e(m,{label:"Anterior",onClick:()=>p(o-1),disabled:1===o,className:`app-pagination-button back ${i}`,style:n}),d.map((t,r)=>t>0?e(m,{label:String(t),onClick:()=>p(t),className:"app-pagination-button page "+(o===t?`active ${s}`:`${i}`),style:Object.assign({},o===t?l:Object.assign({},n))},r):e("span",{className:"app-pagination-dots",children:"..."},r)),e(m,{label:"Próximo",onClick:()=>p(o+1),disabled:o===r,className:`app-pagination-button next ${i}`,style:n})]})};d(".app-sidebar-overlay{animation:fadeIn .3s ease-out;backdrop-filter:blur(2px);background-color:rgba(0,0,0,.5);height:100%;left:0;position:fixed;top:0;width:100%;z-index:8}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.app-sidebar{animation:slideIn .3s ease-out;box-shadow:0 4px 20px rgba(0,0,0,.1);display:flex;flex-direction:column;height:100vh;position:fixed;top:0;z-index:9}.app-sidebar:not([class*=w-]){width:320px}.app-sidebar:not([class*=bg-]){background-color:#fff}.app-sidebar--left{border-right:1px solid #e0e0e0;left:0}.app-sidebar--right{border-left:1px solid #e0e0e0;right:0}@keyframes slideIn{0%{transform:translateX(-100%)}to{transform:translateX(0)}}.app-sidebar--right{animation:slideInRight .3s ease-out}@keyframes slideInRight{0%{transform:translateX(100%)}to{transform:translateX(0)}}.app-sidebar__header{align-items:center;border-bottom:1px solid #e0e0e0;display:flex;justify-content:space-between;min-height:60px;padding:20px}.app-sidebar__title{color:#333;flex:1;font-size:18px;font-weight:600;margin:0}.app-sidebar__close-button{align-items:center;background:none;border:none;border-radius:6px;color:#666;cursor:pointer;display:flex;height:36px;justify-content:center;margin-left:auto;padding:8px;transition:all .2s ease;width:36px}.app-sidebar__close-button:hover{background-color:#e9ecef;color:#333}.app-sidebar__close-button:active{transform:scale(.95)}.app-sidebar__content{flex:1;overflow-x:hidden;overflow-y:auto;padding:0}.app-sidebar__footer{border-top:1px solid #e0e0e0;flex-shrink:0;padding:16px 20px}.app-sidebar__content::-webkit-scrollbar{width:6px}.app-sidebar__content::-webkit-scrollbar-track{background:#f1f1f1}.app-sidebar__content::-webkit-scrollbar-thumb{background:#c1c1c1;border-radius:3px}.app-sidebar__content::-webkit-scrollbar-thumb:hover{background:#a8a8a8}@media (max-width:768px){.app-sidebar{width:280px}}@media (max-width:480px){.app-sidebar{max-width:90vw;width:100%}}.app-sidebar--no-header .app-sidebar__content{padding-top:0}.app-sidebar--full-height{height:100vh}");const $=({isOpen:r,onClose:a,children:n,showOverlay:i=!0,position:s="left",className:c="",overlayClassName:d="",closeOnOverlayClick:p=!0,closeOnEscape:m=!0,title:u,showCloseButton:b=!0,footer:g})=>{if(l(()=>{if(!m||!r)return;const e=e=>{"Escape"===e.key&&a()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[m,r,a]),l(()=>{if(r&&i){"hidden"!==document.body.style.overflow&&(document.body.style.overflow="hidden")}return r||(document.body.style.overflow="visible"),()=>{if(!r){document.querySelectorAll(".dialog-overlay, .app-sidebar-overlay").length<=1&&(document.body.style.overflow="")}}},[r]),!r)return null;return t(o,{children:[i&&e("div",{className:`app-sidebar-overlay ${d}`,onClick:()=>{p&&a()}}),t("div",{className:`app-sidebar app-sidebar--${s} ${c}`,onClick:e=>e.stopPropagation(),children:[(u||b)&&t("div",{className:"app-sidebar__header",children:[u&&e("h3",{className:"app-sidebar__title",children:u}),b&&e("button",{className:"app-sidebar__close-button",onClick:a,type:"button","aria-label":"Fechar sidebar",children:e("span",{children:"X"})})]}),e("div",{className:"app-sidebar__content",children:n}),g&&e("div",{className:"app-sidebar__footer",children:g})]})]})};d(".app-stepper{width:100%}.app-stepper-header{margin-bottom:1rem;overflow-x:auto}.app-stepper-steps{display:flex;gap:1rem;min-width:max-content;padding:.5rem 0}.app-stepper-step{color:#333;cursor:pointer;flex-basis:auto;flex-grow:0;flex-shrink:0;padding:.5rem;text-align:center;transition:all .3s}@media (min-width:640px){.app-stepper-step{flex:1;flex-basis:auto}}.app-stepper-step.active{font-weight:700}.app-stepper-step.error{color:red}.app-stepper-step.disabled{color:#ccc;cursor:not-allowed}.app-stepper-circle{background-color:#eee;border-radius:50%;display:inline-block;height:24px;line-height:24px;margin-bottom:.25rem;width:24px}.app-stepper-circle.active{background-color:#888;color:#000}.app-stepper-circle.error{background-color:red;color:#fff}.app-stepper-circle.disabled{background-color:#ddd;color:#aaa}.app-stepper-content{padding:1rem}");const _=({activeIndex:o,setActiveIndex:r,stepsWithError:a,steps:n})=>t("div",{className:"app-stepper",children:[e("div",{className:"app-stepper-header",children:e("div",{className:"app-stepper-steps",children:n.map((n,l)=>{const i=l===o,s=!!a&&a.includes(l),c=n.disabled;return t("div",{onClick:()=>!c&&r(l),className:`app-stepper-step ${i?"active":""} ${s?"error":""} ${c?"disabled":""}`,style:Object.assign(Object.assign({},n.containerStyle),i?n.activeContainerStyle:{}),children:[e("div",{className:`app-stepper-circle ${i?"active":""} ${s?"error":""} ${c?"disabled":""}`,style:Object.assign(Object.assign({},n.circleStyle),i?n.circleActiveStyle:{}),children:l+1}),e("div",{children:n.label})]},l)})})}),e("div",{className:"app-stepper-content",children:n[o]&&n[o].component})]});s.locale("pt-br");const j=()=>({momentFn:s,formatDateTimeSend:e=>s(e).utc().format("YYYY-MM-DDTHH:mm:ss"),formatDate:e=>s(e).format("DD/MM/YYYY"),formatDateIfen:e=>s(e).format("YYYY-MM-DD"),formatTime:e=>s(e).format("HH:mm"),getWeekday:e=>s.weekdays(s(e).day()),isSameDay:(e,t)=>s(e).isSame(t,"day")});d(".app-table-wrapper{width:100%}.app-table-title{font-size:1.125rem;font-weight:700;line-height:1.75rem;margin-bottom:.25rem}.app-table-container{overflow-x:auto}.app-table{border-collapse:collapse;min-width:max-content;table-layout:auto;width:100%}.app-table-header:not([class*=bg-]){background-color:#1a1a1a}.app-table-header:not([class*=text-]){color:#f9fafb}.app-table-header th{padding:.5rem}.app-table-row{padding:.5rem;transition:all .2s ease}.app-table-row:hover{opacity:.8}.app-table-row.striped-even:not([class*=bg-]){background-color:#e5e7eb}.app-table-row.striped-odd:not([class*=bg-]){background-color:#fff}.app-table-cell{padding:.5rem}.app-table-cell.align-left{text-align:left}.app-table-cell.align-center{text-align:center}.app-table-cell.align-right{text-align:right}.app-table-text-nowrap{white-space:nowrap}.app-table-loading{align-items:center;display:flex;height:250px;justify-content:center}");const z=({title:o,columns:r,data:a,MaxVw:n=100,loading:l,error:i,tableStyle:s="striped",tableClassName:c="",tableHeaderClassName:d="",tableContentClassName:p="",stripeClassName:m="",pagination:u})=>e("div",l?{className:"app-table-loading",children:e(w,{className:"mx-auto",size:40})}:{className:"app-table-wrapper",children:t("div",{className:"app-table-container",children:[o&&e("h2",{className:"app-table-title",children:o}),e("div",{className:`app-table-container ${c}`,style:{maxWidth:`${n}vw`},children:t("table",{className:"app-table",children:[e("thead",{className:`app-table-header ${d}`,children:e("tr",{children:r.map((t,o)=>e("th",{className:`${t.headerClassName||""}`,children:t.header},o))})}),e("tbody",{children:a.map((t,o)=>e("tr",{className:`app-table-row ${"striped"===s?o%2==0?m||`striped-even ${m}`:`striped-odd ${p}`:`${p}`}`,children:r.map((o,r)=>e("td",{className:`app-table-cell align-${o.align||"left"} ${o.cellClassName||""}`,children:o.cell?o.cell(t):"percentage"===o.type?e("span",{className:"app-table-text-nowrap",children:`${t[o.accessor]}%`}):"currency"===o.type?e("span",{className:"app-table-text-nowrap",children:`R$ ${t[o.accessor].toFixed(2).replace(".",",")}`}):"date"===o.type?e("span",{children:j().formatDate(t[o.accessor])}):"time"===o.type?e("span",{children:j().formatTime(t[o.accessor])}):"datetime"===o.type?e("span",{children:j().formatDateTimeSend(t[o.accessor])}):"boolean"===o.type?e("span",{children:t[o.accessor]?"Sim":"Não"}):"image"===o.type?e("img",{src:t[o.accessor],alt:""}):t[o.accessor]},r))},o))})]})}),(null==u?void 0:u.onChange)&&e(C,{currentPage:u.page||1,totalPages:u.pages||0,onPageChange:null==u?void 0:u.onChange})]})});d(".app-tabs{border-radius:.125rem;display:flex;overflow-x:auto;width:100%}.app-tab{border-radius:0!important;flex:1}.app-tab.disabled{cursor:not-allowed;opacity:.6}.app-tab.active:not([class*=bg-]){background-color:#000}.app-tab.active:not([class*=text-]){color:#fff}.app-tab.inactive:not([class*=bg-]){background-color:#353535}.app-tab.inactive:not([class*=text-]){color:#c8c8c8}.app-tab.inactive:not([class*=border-]){border:1px solid #f3f4f6}");const L=({tabs:t,tabIndex:o,setTabIndex:r,onTabChange:a,className:n,activeStyle:l,inactiveStyle:i,activeClassName:s,inactiveClassName:c})=>e("div",{className:"app-tabs",children:t.map((t,d)=>e(m,{label:t.label,icon:t.icon,iconWidth:t.iconWidth,disabled:t.disabled,style:Object.assign({borderRadius:"0px"},o===d?l:i),className:`app-tab ${t.disabled?"disabled":""} ${o===d?`active ${s}`:`inactive ${c}`} ${n||""}`,onClick:()=>{t.disabled||(r&&r(d),a&&a(d),t.onClick&&t.onClick())}},t.id||d))});d(".app-tabs-v2{-webkit-overflow-scrolling:touch;align-items:flex-end;display:flex;gap:24px;overflow-x:auto;overflow-y:hidden;scroll-behavior:smooth;width:100%}.app-tab-v2{cursor:pointer;flex-shrink:0;font-size:1rem;font-weight:500;padding:8px 0 4px;position:relative;transition:all .2s;user-select:none;white-space:nowrap}.app-tab-v2:not([class*=text-]){color:#555}.app-tab-v2.active{font-weight:600}.app-tab-v2.active:not([class*=text-]){color:#1a1a1a}.app-tab-v2.active:not([class*=border-b-]){border-bottom:3px solid #1a1a1a}.app-tab-v2.disabled{color:#bdbdbd;cursor:not-allowed}.app-tab-v2-label{z-index:1}.app-tabs-v2::-webkit-scrollbar{height:4px}.app-tabs-v2::-webkit-scrollbar-track{background:transparent}.app-tabs-v2::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:2px}.app-tabs-v2::-webkit-scrollbar-thumb:hover{background:#9ca3af}.app-tabs-v2{scrollbar-color:#d1d5db transparent;scrollbar-width:thin}");const S=({tabs:o,tabIndex:r,setTabIndex:a,onTabChange:n,className:l,activeClassName:i,inactiveClassName:s})=>e("div",{className:`app-tabs-v2 ${l||""}`.trim(),children:o.map((o,l)=>t("div",{className:`app-tab-v2 ${o.disabled?"disabled":""} ${r===l?`active ${i||""}`:`inactive ${s||""}`}`.trim(),onClick:()=>{o.disabled||(a&&a(l),n&&n(l),o.onClick&&o.onClick())},children:[e("span",{className:"app-tab-v2-label",children:o.label}),r===l&&e("div",{className:"app-tab-v2-underline"})]},o.id||l))});d(".app-tag{border-radius:9999px;color:#fff;cursor:pointer;display:inline-block;font-size:.875rem;line-height:1.25rem;padding:.25rem .5rem}.app-tag p{margin:0}");const E=({label:t,bgColor:o,textColor:r,onClick:a})=>e("div",{className:"app-tag",style:{backgroundColor:o||"#4A90E2",color:r||"#FFFFFF"},onClick:a,children:e("p",{children:t})}),F=({condition:t,children:r,elseRender:a})=>e(o,{children:t?r:a||null});d(".dialog-overlay{align-items:center;background-color:rgba(0,0,0,.5);bottom:0;display:flex;justify-content:center;left:0;overflow-y:auto;padding:1rem;position:fixed;right:0;top:0;z-index:1050}.dialog-overlay.hidden{display:none}.dialog-container{background:#fff;border-radius:.5rem;box-shadow:0 25px 50px -12px rgba(0,0,0,.25);display:flex;flex-direction:column;margin:auto;max-width:90vw;min-height:0;overflow:hidden;position:relative}.dialog-header{align-items:center;border-bottom:1px solid #e5e7eb;display:flex;justify-content:space-between;padding:1.5rem 1.5rem 1rem}.dialog-title{color:#111827;font-size:1.125rem;font-weight:600;margin:0}.dialog-close-button{align-items:center;background:none;border:none;border-radius:.25rem;color:#6b7280;cursor:pointer;display:flex;font-size:1.5rem;height:2rem;justify-content:center;line-height:1;padding:.25rem;transition:all .2s;width:2rem}.dialog-close-button:hover{background-color:#f3f4f6;color:#374151}.dialog-content{flex:1;overflow-y:auto;padding:1.5rem}.dialog-draggable,.dialog-draggable .dialog-header{cursor:move}.dialog-overlay{-ms-overflow-style:none;scrollbar-width:none}.dialog-overlay::-webkit-scrollbar{display:none}.dialog-overlay{backdrop-filter:blur(1px)}@media (max-height:600px){.dialog-overlay{align-items:flex-start;padding-top:2rem}.dialog-container{max-height:calc(100vh - 4rem)}}");const O=({visible:o,onHide:r,header:i,children:s,className:c="",maskClassName:d="",contentClassName:p="",headerClassName:m="",closable:u=!0,draggable:b=!1,style:g={}})=>{const h=n(null),[f,x]=a(!1),[y,v]=a({x:0,y:0}),[w,N]=a({x:0,y:0});l(()=>{const e=e=>{"Escape"===e.key&&o&&u&&r()};if(o){document.addEventListener("keydown",e);"hidden"!==document.body.style.overflow&&(document.body.style.overflow="hidden")}return()=>{if(document.removeEventListener("keydown",e),!o){document.querySelectorAll(".dialog-overlay").length<=1&&(document.body.style.overflow="")}}},[o,u,r]);const k=e=>{f&&b&&N({x:e.clientX-y.x,y:e.clientY-y.y})},C=()=>{x(!1)};l(()=>(f&&(document.addEventListener("mousemove",k),document.addEventListener("mouseup",C)),()=>{document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",C)}),[f,y]);if(!o)return null;const $=!b||0===w.x&&0===w.y?g:Object.assign(Object.assign({},g),{transform:`translate(${w.x}px, ${w.y}px)`,position:"absolute"});return e("div",{className:`dialog-overlay ${d}`,onClick:e=>{e.target===e.currentTarget&&u&&r()},children:t("div",{ref:h,className:`dialog-container ${c} ${b?"dialog-draggable":""}`,style:$,children:[i&&t("div",{className:`dialog-header ${m}`,onMouseDown:e=>{var t;if(!b)return;const o=null===(t=h.current)||void 0===t?void 0:t.getBoundingClientRect();o&&(x(!0),v({x:e.clientX-o.left,y:e.clientY-o.top}))},children:[e("div",{className:"dialog-title",children:"string"==typeof i?e("h3",{children:i}):i}),u&&e("button",{className:"dialog-close-button",onClick:r,type:"button",children:"×"})]}),e("div",{className:`dialog-content ${p}`,children:s})]})})};var Y=e=>e instanceof Date,R=e=>null==e;const q=e=>"object"==typeof e;var A=e=>!R(e)&&!Array.isArray(e)&&q(e)&&!Y(e),T=e=>A(e)&&e.target?"checkbox"===e.target.type?e.target.checked:e.target.value:e,V="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function H(e){let t;const o=Array.isArray(e),r="undefined"!=typeof FileList&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else{if(V&&(e instanceof Blob||r)||!o&&!A(e))return e;if(t=o?[]:Object.create(Object.getPrototypeOf(e)),o||(e=>{const t=e.constructor&&e.constructor.prototype;return A(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const o in e)e.hasOwnProperty(o)&&(t[o]=H(e[o]));else t=e}return t}var M=e=>/^\w*$/.test(e),D=e=>void 0===e,P=e=>{return t=e.replace(/["|']|\]/g,"").split(/\.|\[/),Array.isArray(t)?t.filter(Boolean):[];var t},X=(e,t,o)=>{if(!t||!A(e))return o;const r=(M(t)?[t]:P(t)).reduce((e,t)=>R(e)?e:e[t],e);return D(r)||r===e?D(e[t])?o:e[t]:r},I=e=>"boolean"==typeof e,U=(e,t,o)=>{let r=-1;const a=M(t)?[t]:P(t),n=a.length,l=n-1;for(;++r<n;){const t=a[r];let n=o;if(r!==l){const o=e[t];n=A(o)||Array.isArray(o)?o:isNaN(+a[r+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=n,e=e[t]}};const B="blur",W="change",G="all",J=r.createContext(null);J.displayName="HookFormContext";const K=()=>r.useContext(J);const Q="undefined"!=typeof window?r.useLayoutEffect:r.useEffect;function Z(e){const t=K(),{control:o=t.control,disabled:a,name:n,exact:l}=e||{},[i,s]=r.useState(o._formState),c=r.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Q(()=>o._subscribe({name:n,formState:c.current,exact:l,callback:e=>{!a&&s({...o._formState,...e})}}),[n,a,l]),r.useEffect(()=>{c.current.isValid&&o._setValid(!0)},[o]),r.useMemo(()=>((e,t,o,r=!0)=>{const a={defaultValues:t._defaultValues};for(const n in e)Object.defineProperty(a,n,{get:()=>{const a=n;return t._proxyFormState[a]!==G&&(t._proxyFormState[a]=!r||G),o&&(o[a]=!0),e[a]}});return a})(i,o,c.current,!1),[i,o])}var ee=e=>R(e)||!q(e);function te(e,t,o=new WeakSet){if(ee(e)||ee(t))return e===t;if(Y(e)&&Y(t))return e.getTime()===t.getTime();const r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;if(o.has(e)||o.has(t))return!0;o.add(e),o.add(t);for(const n of r){const r=e[n];if(!a.includes(n))return!1;if("ref"!==n){const e=t[n];if(Y(r)&&Y(e)||A(r)&&A(e)||Array.isArray(r)&&Array.isArray(e)?!te(r,e,o):r!==e)return!1}}return!0}function oe(e){const t=K(),{control:o=t.control,name:a,defaultValue:n,disabled:l,exact:i,compute:s}=e||{},c=r.useRef(n),d=r.useRef(s),p=r.useRef(void 0);d.current=s;const m=r.useMemo(()=>o._getWatch(a,c.current),[o,a]),[u,b]=r.useState(d.current?d.current(m):m);return Q(()=>o._subscribe({name:a,formState:{values:!0},exact:i,callback:e=>{if(!l){const t=((e,t,o,r,a)=>"string"==typeof e?X(o,e,a):Array.isArray(e)?e.map(e=>X(o,e)):o)(a,o._names,e.values||o._formValues,0,c.current);if(d.current){const e=d.current(t);te(e,p.current)||(b(e),p.current=e)}else b(t)}}}),[o,l,a,i]),r.useEffect(()=>o._removeUnmounted()),u}const re=e=>e.render(function(e){const t=K(),{name:o,disabled:a,control:n=t.control,shouldUnregister:l,defaultValue:i}=e,s=((e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)))(n._names.array,o),c=r.useMemo(()=>X(n._formValues,o,X(n._defaultValues,o,i)),[n,o,i]),d=oe({control:n,name:o,defaultValue:c,exact:!0}),p=Z({control:n,name:o,exact:!0}),m=r.useRef(e),u=r.useRef(void 0),b=r.useRef(n.register(o,{...e.rules,value:d,...I(e.disabled)?{disabled:e.disabled}:{}}));m.current=e;const g=r.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!X(p.errors,o)},isDirty:{enumerable:!0,get:()=>!!X(p.dirtyFields,o)},isTouched:{enumerable:!0,get:()=>!!X(p.touchedFields,o)},isValidating:{enumerable:!0,get:()=>!!X(p.validatingFields,o)},error:{enumerable:!0,get:()=>X(p.errors,o)}}),[p,o]),h=r.useCallback(e=>b.current.onChange({target:{value:T(e),name:o},type:W}),[o]),f=r.useCallback(()=>b.current.onBlur({target:{value:X(n._formValues,o),name:o},type:B}),[o,n._formValues]),x=r.useCallback(e=>{const t=X(n._fields,o);t&&e&&(t._f.ref={focus:()=>e.focus&&e.focus(),select:()=>e.select&&e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})},[n._fields,o]),y=r.useMemo(()=>({name:o,value:d,...I(a)||p.disabled?{disabled:p.disabled||a}:{},onChange:h,onBlur:f,ref:x}),[o,a,p.disabled,h,f,x,d]);return r.useEffect(()=>{const e=n._options.shouldUnregister||l,t=u.current;t&&t!==o&&!s&&n.unregister(t),n.register(o,{...m.current.rules,...I(m.current.disabled)?{disabled:m.current.disabled}:{}});const r=(e,t)=>{const o=X(n._fields,e);o&&o._f&&(o._f.mount=t)};if(r(o,!0),e){const e=H(X(n._options.defaultValues,o,m.current.defaultValue));U(n._defaultValues,o,e),D(X(n._formValues,o))&&U(n._formValues,o,e)}return!s&&n.register(o),u.current=o,()=>{(s?e&&!n._state.action:e)?n.unregister(o):r(o,!1)}},[o,n,s,l]),r.useEffect(()=>{n._setDisabledField({disabled:a,name:o})},[a,o,n]),r.useMemo(()=>({field:y,formState:p,fieldState:g}),[y,p,g])}(e));d(".controlled-checkbox-container{align-items:center;display:flex;gap:.5rem}.app-button:not([class*=accent-]){accent-color:#282725}.controlled-checkbox-input{height:1rem;width:1rem}.controlled-checkbox-input.error{border:1px solid #ef4444}.controlled-checkbox-label{font-size:.875rem}.controlled-checkbox-label.error,.controlled-checkbox-required{color:#ef4444}.controlled-checkbox-error{color:#ef4444;font-size:.75rem}");const ae=({name:o,value:r,onChange:a,disabled:l,className:i,error:s,label:c,required:d})=>{const p=n(null);return t("div",{className:"controlled-checkbox-container",children:[e("input",{ref:p,id:o,type:"checkbox",checked:r||!1,onChange:e=>{a(e.target.checked)},disabled:l,className:`controlled-checkbox-input ${i||""} ${s?"error":""}`}),t("label",{htmlFor:o,className:"controlled-checkbox-label "+(s?"error":""),children:[c,d&&e("span",{className:"controlled-checkbox-required",children:" *"})]}),s&&e("small",{className:"controlled-checkbox-error",children:s})]})},ne=({name:t,error:o,label:r,required:a,control:n,className:l,disabled:i})=>{const s=(()=>{if(o){if("string"==typeof o)return o;if("object"==typeof o&&t in o){const e=o[t];return null==e?void 0:e.message}}})();return e(re,{disabled:i,name:t,control:n,render:({field:{onChange:o,value:n}})=>e(ae,{name:t,label:r,value:n,onChange:o,error:s,required:a})})};d(".controlled-image-container{position:relative}.controlled-image-preview{align-items:center;border-radius:.125rem;display:flex;height:200px;justify-content:center;margin:0 auto;overflow:hidden;width:215px}.controlled-image-preview:not([class*=bg-]){background-color:#f3f4f6}.controlled-image-preview:not([class*=border-]){border:1px solid #d1d5db}.controlled-image-preview.disabled{opacity:.7}@media (min-width:640px){.controlled-image-preview{width:260px}}.controlled-image-preview img{height:100%;object-fit:cover;object-position:center;width:100%}.controlled-image-placeholder{cursor:pointer;display:flex;flex-direction:column;height:100%}.controlled-image-placeholder:hover{opacity:.85}.controlled-image-placeholder.disabled{cursor:default}.controlled-image-icon{margin:20% auto 0}.controlled-image-icon:not([class*=text-]){color:#1a1a1a}.controlled-image-text{font-size:.875rem;text-align:center}.controlled-image-text:not([class*=text-]){color:#1a1a1a}.controlled-image-error{color:#ef4444;font-size:.875rem;margin-top:.5rem}.controlled-image-buttons{display:flex;gap:1rem;margin-top:.5rem}.controlled-image-button{border-radius:.125rem;cursor:pointer;font-weight:600;height:2.5rem;padding:.5rem;width:100%}.controlled-image-button:hover{opacity:.85}.controlled-image-button.disabled{cursor:default;opacity:.7}.controlled-image-button-choose:not([class*=text-]){color:#3b82f6}.controlled-image-button-choose:not([class*=bg-]){background-color:transparent}.controlled-image-button-choose:not([class*=border-]){border:1px solid #1a1a1a}.controlled-image-button-remove{background-color:#ef4444;border:none;color:#fff}.controlled-image-input{display:none}.controlled-image-error-prop{color:#ef4444;font-size:.875rem}");const le=({name:o,chooseLabel:r="Escolher Foto",removeLabel:i="Remover",changeLabel:s="Trocar Foto",control:c,maxSize:d=5,disabled:p,errorProp:m,proportions:u="500x500",defaultValue:b,containerClassName:g="",inputClassName:h="",previewContainerClassName:f="",iconClassName:y="",proportionsClassName:v=""})=>{const[w,N]=a(void 0),[k,C]=a(),$=n(null),_=(()=>{if(m){if("string"==typeof m)return m;if("object"==typeof m&&o in m){const e=m[o];return null==e?void 0:e.message}}})();l(()=>{b&&N("string"==typeof b?b:URL.createObjectURL(b))},[b]),l(()=>()=>{w&&URL.revokeObjectURL(w)},[w]);const j=()=>{var e;null===(e=$.current)||void 0===e||e.click()};return e(re,{name:o,control:c,render:({field:{onChange:o,value:a}})=>t("div",{className:`controlled-image-container ${g}`,children:[t("div",{className:`controlled-image-preview ${p?"disabled":""} ${f}`,children:[w?e("img",{src:w,alt:"Preview"}):t("div",{className:"controlled-image-placeholder "+(p?"disabled":""),onClick:p?()=>{}:j,children:[e(x,{icon:"solar:camera-bold",width:80,className:`controlled-image-icon ${y}`}),e("p",{className:`controlled-image-text ${v}`,children:u})]}),_&&e("small",{className:"controlled-image-error-prop",children:_})]}),k&&e("div",{className:"controlled-image-error",children:k}),t("div",{className:"controlled-image-buttons",children:[e("button",{type:"button",className:`controlled-image-button controlled-image-button-choose ${h} ${p?"disabled":""}`,onClick:j,disabled:p,children:a?s:r}),e("input",{ref:$,type:"file",accept:"image/*",onChange:e=>((e,t)=>{const o=e.target.files?e.target.files[0]:null;if(o)if(o.size>1024*d*1024)C(`O arquivo não pode exceder ${d}MB.`),N(void 0),t(null);else{C(void 0);const e=URL.createObjectURL(o);N(e),t(o)}})(e,o),className:"controlled-image-input",disabled:p}),a&&e("button",{type:"button",className:"controlled-image-button controlled-image-button-remove "+(p?"disabled":""),onClick:()=>(e=>{N(void 0),e(void 0)})(o),disabled:p,children:i})]})]})})},ie=e=>e?e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase():"";d(".custom-multiselect-container{position:relative}.custom-multiselect-trigger{align-items:center;background-color:#f3f4f6;border-bottom:1px solid #d1d5db;border-radius:.125rem;cursor:pointer;display:flex;justify-content:space-between;padding:.25rem .5rem}.custom-multiselect-trigger.disabled{cursor:not-allowed;opacity:.75}.custom-multiselect-placeholder{color:#9ca3af}.custom-multiselect-actions{display:flex;gap:.5rem}.custom-multiselect-clear{color:#6b7280;cursor:pointer}.custom-multiselect-clear:hover{color:#ef4444}.custom-multiselect-selected{background-color:#f3f4f6;border:1px solid #d1d5db;border-radius:.125rem;box-shadow:0 10px 15px -3px rgba(0,0,0,.1);margin-top:.25rem;max-height:5rem;overflow-y:auto;position:absolute;right:0;width:80%;z-index:10}.custom-multiselect-selected.error{border-color:#ef4444}.custom-multiselect-selected-content{color:#374151;font-size:.875rem;padding:.25rem .5rem}.custom-multiselect-tag{background-color:#e5e7eb;border-radius:9999px;cursor:pointer;display:inline-block;font-size:.875rem;margin-bottom:.5rem;margin-right:.5rem;padding:.25rem .5rem}.custom-multiselect-tag:hover{background-color:#fecaca}.custom-multiselect-dropdown{background-color:#f3f4f6;border:1px solid #d1d5db;border-radius:.125rem;box-shadow:0 10px 15px -3px rgba(0,0,0,.1);margin-top:-1.2rem;position:fixed;width:100%;z-index:99999}.custom-multiselect-dropdown.open-upwards{box-shadow:0 -10px 15px -3px rgba(0,0,0,.1)}.custom-multiselect-search{padding:1rem}.custom-multiselect-search input{border:1px solid #d1d5db;border-radius:.125rem;padding:.25rem .5rem;width:100%}.custom-multiselect-option{cursor:pointer;padding:.5rem 1rem}.custom-multiselect-option:hover{background-color:#d1d5db}.custom-multiselect-option.selected{background-color:#e5e7eb;border-bottom:1px solid #d1d5db;border-top:1px solid #d1d5db;font-weight:600}.custom-multiselect-counter{background-color:#f9fafb;border-top:2px solid #d1d5db;bottom:0;color:#6b7280;cursor:default;font-size:.875rem;font-weight:600;padding:.75rem 1rem;position:sticky;text-align:center}");const se=({value:o,onChange:r,options:i,showClear:s,showSearch:d,className:p="",error:m,disabled:u,maxLabelLength:b=50})=>{const[g,h]=a(!1),[f,y]=a(""),[v,w]=a({top:0,left:0,width:0,maxHeight:0,openUpwards:!1}),N=n(null),k=n(null),C=e=>o.includes(e),$=i.filter(e=>ie(e.label).includes(ie(f)));return l(()=>{const e=e=>{const t=e.target;N.current&&!N.current.contains(t)&&k.current&&!k.current.contains(t)&&h(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),l(()=>{if(g&&N.current){const e=()=>{var e;const t=null===(e=N.current)||void 0===e?void 0:e.getBoundingClientRect();if(t){const e=window.innerHeight-t.bottom,o=t.top,r=300,a=e<r&&o>e,n=a?Math.min(o-10,r):Math.min(e-10,r);w({top:a?t.top:t.bottom,left:t.left,width:t.width,maxHeight:n,openUpwards:a})}};e();const t=setTimeout(e,10);return()=>clearTimeout(t)}},[g]),t("div",{className:`custom-multiselect-container ${p}`,ref:N,children:[t("div",{onClick:()=>u?{}:h(!g),className:"custom-multiselect-trigger "+(u?"disabled":""),children:[e("span",{className:o.length>0?"":"custom-multiselect-placeholder",children:o.length>0?`${o.length} ${o.length>1?"selecionados":"selecionado"}`:"Selecione..."}),t("div",{className:"custom-multiselect-actions",children:[s&&o.length>0&&!u&&e("button",{disabled:u,onClick:e=>{e.stopPropagation(),r([]),h(!1),y("")},className:"custom-multiselect-clear",children:e(x,{icon:"mdi:clear"})}),e("span",{children:e(x,{icon:"raphael:arrowdown",width:12})})]})]}),g&&c(t("ul",{ref:k,className:"custom-multiselect-dropdown "+(v.openUpwards?"open-upwards":""),style:{position:"fixed",top:v.openUpwards?"auto":v.top,bottom:v.openUpwards?window.innerHeight-v.top:"auto",left:v.left,width:v.width||"auto",maxHeight:v.maxHeight,overflowY:"auto"},children:[d&&e("li",{className:"custom-multiselect-search",children:e("input",{type:"text",placeholder:"Buscar...",value:f,onChange:e=>y(e.target.value)})}),$.map(a=>{return t("li",{onClick:()=>{return e=a.value,void(C(e)?r(o.filter(t=>t!==e)):r([...o,e]));var e},className:"custom-multiselect-option "+(C(a.value)?"selected":""),style:{display:"flex",alignItems:"center",cursor:"pointer"},title:a.label,children:[e("input",{type:"checkbox",checked:C(a.value),readOnly:!0,tabIndex:-1,style:{marginRight:8}}),(n=a.label,l=b,n.length<=l?n:n.substring(0,l)+"...")]},a.value);var n,l}),t("li",{className:"custom-multiselect-counter",children:[o.length," ",1===o.length?"item selecionado":"itens selecionados"]})]}),document.body)]})};d(".controlled-multiselect-container{position:relative}.controlled-multiselect-label{display:block;margin-bottom:.25rem}.controlled-multiselect-label.error{color:#ef4444}.controlled-multiselect-input.error{border-color:#ef4444}.controlled-multiselect-error{color:#ef4444;display:block;font-size:.875rem;margin-top:.25rem}");const ce=({name:o,control:r,options:a,className:n="",containerClassName:l="",label:i,showClear:s,showSearch:c,error:d,disabled:p,loading:m,isRequired:u})=>{const b=(()=>{if(d){if("string"==typeof d)return d;if("object"==typeof d&&o in d){const e=d[o];return null==e?void 0:e.message}}})();return t("div",{className:`controlled-multiselect-container ${l||""}`,children:[t("label",{htmlFor:o,className:"controlled-multiselect-label "+(b?"error":""),children:[i,u&&e("span",{className:"input-text-required",children:" *"})]}),e(re,{name:o,control:r,render:({field:{onChange:t,value:o}})=>e(se,{value:o||[],onChange:t,options:a,showClear:s,showSearch:c,className:`controlled-multiselect-input ${n||""} ${b?"error":""}`,disabled:p||m})}),b&&e("small",{className:"controlled-multiselect-error",children:b})]})};d(".custom-select-container{position:relative}.custom-select-trigger{align-items:center;background-color:#f3f4f6;border:1px solid #d1d5db;border-radius:.125rem;cursor:pointer;display:flex;justify-content:space-between;padding:.25rem .5rem}.custom-select-trigger.disabled{cursor:not-allowed;opacity:.75}.custom-select-placeholder{color:#9ca3af}.custom-select-actions{display:flex;gap:.5rem}.custom-select-clear{color:#6b7280;cursor:pointer}.custom-select-clear:hover{color:#ef4444}.custom-select-dropdown{background-color:#f3f4f6;border:1px solid #d1d5db;border-radius:.125rem;box-shadow:0 10px 15px -3px rgba(0,0,0,.1);position:fixed;z-index:99999}.custom-select-dropdown.error{border-color:#ef4444}.custom-select-dropdown.open-upwards{box-shadow:0 -10px 15px -3px rgba(0,0,0,.1)}.custom-select-search{padding:1rem}.custom-select-search input{border:1px solid #d1d5db;border-radius:.125rem;padding:.25rem .5rem;width:100%}.custom-select-option{cursor:pointer;padding:.5rem 1rem}.custom-select-option:hover{background-color:#d1d5db}.custom-select-option.selected{background-color:#e5e7eb;border-bottom:1px solid #d1d5db;border-top:1px solid #d1d5db;font-weight:600}.custom-select-no-options{color:#6b7280;padding:.5rem 1rem}");const de=({value:o,onChange:r,options:i,showClear:s,showSearch:d,className:p="",error:m,disabled:u,maxLabelLength:b=50})=>{const[g,h]=a(!1),[f,y]=a(""),[v,w]=a({top:0,left:0,width:0,maxHeight:0,openUpwards:!1}),N=n(null),k=n(null),C=(e,t)=>e.length<=t?e:e.substring(0,t