PageSourceSearch

https://aibr.org/build/assets/__Table-gILvootm.js

js aibr.org collected 2026-09-24 09:34:13 UTC 11,714 bytes, 1 lines download raw bytes

1import{j as o,r as l,W as de}from"./app-belrbPXN.js";import{Paginated as ce}from"./Paginated-38wbBQW2.js";import{_ as R}from"./Lang-BxT6IC8I.js";import{HeadTable as me}from"./HeadTable-tAE5Yv6B.js";import{VerticalDotsIcon as pe}from"./VerticalDotsIcon-yy0sx5Wc.js";import{D as ue,c as fe,S as xe,v as be,a as he}from"./SortableItem-2xyf2IvR.js";import{a as H,c as ve,g as ye,f as ge,$ as we}from"./import-CF4r66r5.js";import{c as I,f as je,S as Ce}from"./import-0kiaZdOS.js";import{t as _e,f as O,u as D,m as Ne}from"./chunk-3TAVD5Y3-JLEfvKNw.js";import{d as ke}from"./chunk-XHQUSKIE-9yTKuk0T.js";import{u as Pe,A as Me}from"./index-Cg9dHLmZ.js";import{c as S}from"./chunk-6BQDBGF4-B566eCa_.js";import{d as A}from"./chunk-MCFSCOSB--WO4Tv9A.js";import{$ as $e}from"./chunk-3YBC73XM-2g_LxT9c.js";import{c as Be}from"./chunk-3XT5V4LF-zg9JoeIL.js";import{a as V,T as Se}from"./chunk-WUWNKKWR-zu7Kmz1i.js";import{R as Oe}from"./Combination-asPpbgkX.js";import{$ as Re}from"./chunk-LSZJW3GU-QPv3TR7N.js";import{m as U}from"./use-force-update-VB-OXXUy.js";import{d as Ae,a as Ie,b as De,m as Ee}from"./chunk-L6QJ42W6-W9sOl383.js";import{b as q}from"./chunk-NXTXE2B3-LSC6jqGg.js";import{t as Ve,a as Fe,b as Te,c as ze,d as He,e as Ue}from"./chunk-YRZGWF2W-PNkKtaL1.js";import"./ChevronIcon-2kwZXCOy.js";import"./chunk-TNTFQBEK-SFGRqfrY.js";import"./index-taukuCH3.js";import"./chunk-2PIR7DFM-PKNoTa34.js";import"./PlusIcon-YI9O2wg5.js";import"./SearchIcon-IcEPHXgu.js";import"./chunk-TC4QW7OA-U26paOyA.js";import"./import-p5sRK1qG.js";import"./import-_-a0l05m.js";import"./import-1bjV9P8v.js";import"./chunk-BSXPKUBX-mpJVaeDf.js";import"./chunk-M3MASYO7-ql8iGmnH.js";import"./index-2kllFQyz.js";import"./chunk-MCG5YV3A-mwckgY4f.js";import"./chunk-EB2I5ZVA-WHwNbYK3.js";import"./chunk-YOBXD5IP-I7dSNQUW.js";import"./import-QsBJSc9f.js";import"./real-module-p6qORkc6.js";import"./tslib.es6-gPgTONGq.js";import"./chunk-VMAPMSPF-sN-l8vC5.js";import"./import-Ho6b8CK9.js";import"./import-FZEXr2Df.js";import"./chunk-44JHHBS2-Enupn3hy.js";import"./chunk-AMSULWPV-n_7pBk8y.js";import"./import-FK7Wx42j.js";import"./chunk-RFUEKIFS-kjMkjToG.js";import"./chunk-7F3ZLNJ6-m2dcUC9z.js";var L=_e({slots:{wrapper:["flex","w-screen","h-[100dvh]","fixed","inset-0","z-50","overflow-x-auto","justify-center","[--scale-enter:100%]","[--scale-exit:100%]","[--slide-enter:0px]","[--slide-exit:80px]","sm:[--scale-enter:100%]","sm:[--scale-exit:103%]","sm:[--slide-enter:0px]","sm:[--slide-exit:0px]"],base:["flex","flex-col","relative","bg-white","z-50","w-full","box-border","bg-content1","outline-none","mx-1","my-1","sm:mx-6","sm:my-16"],backdrop:"z-50",header:"flex py-4 px-6 flex-initial text-large font-semibold",body:"flex flex-1 flex-col gap-3 px-6 py-2",footer:"flex flex-row gap-2 px-6 py-4 justify-end",closeButton:["absolute","appearance-none","outline-none","select-none","top-1","right-1","p-2","text-foreground-500","rounded-full","hover:bg-default-100","active:bg-default-200","tap-highlight-transparent",...ke]},variants:{size:{xs:{base:"max-w-xs"},sm:{base:"max-w-sm"},md:{base:"max-w-md"},lg:{base:"max-w-lg"},xl:{base:"max-w-xl"},"2xl":{base:"max-w-2xl"},"3xl":{base:"max-w-3xl"},"4xl":{base:"max-w-4xl"},"5xl":{base:"max-w-5xl"},full:{base:"my-0 mx-0 sm:mx-0 sm:my-0 max-w-full h-[100dvh] !rounded-none"}},radius:{none:{base:"rounded-none"},sm:{base:"rounded-small"},md:{base:"rounded-medium"},lg:{base:"rounded-large"}},placement:{auto:{wrapper:"items-end sm:items-center"},center:{wrapper:"items-center sm:items-center"},top:{wrapper:"items-start sm:items-start"},"top-center":{wrapper:"items-start sm:items-center"},bottom:{wrapper:"items-end sm:items-end"},"bottom-center":{wrapper:"items-end sm:items-center"}},shadow:{sm:{base:"shadow-small"},md:{base:"shadow-medium"},lg:{base:"shadow-large"}},backdrop:{transparent:{backdrop:"hidden"},opaque:{backdrop:"bg-overlay/50 backdrop-opacity-disabled"},blur:{backdrop:"backdrop-blur-md backdrop-saturate-150 bg-overlay/30"}},scrollBehavior:{normal:{base:"overflow-y-hidden"},inside:{base:"max-h-[calc(100%_-_7.5rem)]",body:"overflow-y-auto"},outside:{wrapper:"items-start sm:items-start overflow-y-auto",base:"my-16"}}},defaultVariants:{size:"md",radius:"lg",shadow:"sm",placement:"auto",backdrop:"opaque",scrollBehavior:"normal"},compoundVariants:[{backdrop:["opaque","blur"],class:{backdrop:"w-screen h-screen fixed inset-0"}}]}),qe=t=>
1o.jsx("svg",{"aria-hidden":"true",fill:"none",focusable:"false",height:"1em",role:"presentation",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:"1em",...t,children:o.jsx("path",{d:"M18 6L6 18M6 6l12 12"})}),[Le,E]=Be({name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap all popover components within `<Modal />`"}),K=O((t,a)=>{const{as:s,children:e,className:i,...d}=t,{slots:u,classNames:n,bodyId:p,setBodyMounted:c}=E(),f=D(a),x=s||"div";return l.useEffect(()=>(c(!0),()=>c(!1)),[c]),o.jsx(x,{ref:f,className:u.body({class:S(n==null?void 0:n.body,i)}),id:p,...d,children:e})});K.displayName="NextUI.ModalBody";var Ke=K,We={enter:{scale:"var(--scale-enter)",y:"var(--slide-enter))",opacity:1,transition:{scale:{duration:.4,ease:V.ease},opacity:{duration:.4,ease:V.ease},y:{type:"spring",bounce:0,duration:.6}}},exit:{scale:"var(--scale-exit)",y:"var(--slide-exit)",opacity:0,transition:{duration:.3,ease:V.ease}}},W=O((t,a)=>{const{as:s,children:e,role:i="dialog",...d}=t,{Component:u,domRef:n,slots:p,isOpen:c,classNames:f,motionProps:x,backdrop:C,closeButton:_,hideCloseButton:g,disableAnimation:y,shouldBlockScroll:$,getDialogProps:N,getBackdropProps:r,getCloseButtonProps:m,onClose:b}=E(),k=s||u||"div",{dialogProps:h}=Re({role:i},n),w=l.isValidElement(_)?l.cloneElement(_,m()):o.jsx("button",{...m(),children:o.jsx(qe,{})}),P=o.jsxs(k,{...N(I(h,d)),children:[o.jsx(H,{onDismiss:b}),!g&&w,typeof e=="function"?e(b):e,o.jsx(H,{onDismiss:b})]}),v=l.useMemo(()=>C==="transparent"?null:y?o.jsx("div",{...r()}):o.jsx(U.div,{animate:"enter",exit:"exit",initial:"exit",variants:Se.fade,...r()}),[C,y,r]);return o.jsxs("div",{tabIndex:-1,children:[v,o.jsx(Oe,{forwardProps:!0,enabled:$&&c,removeScrollBar:!1,children:y?o.jsx("div",{className:p.wrapper({class:f==null?void 0:f.wrapper}),children:P}):o.jsx(U.div,{animate:"enter",className:p.wrapper({class:f==null?void 0:f.wrapper}),exit:"exit",initial:"exit",variants:We,...x,children:P})})]})});W.displayName="NextUI.ModalContent";var Ge=W,G=O((t,a)=>{const{as:s,children:e,className:i,...d}=t,{slots:u,classNames:n}=E(),p=D(a),c=s||"footer";return o.jsx(c,{ref:p,className:u.footer({class:S(n==null?void 0:n.footer,i)}),...d,children:e})});G.displayName="NextUI.ModalFooter";var Je=G,J=O((t,a)=>{const{as:s,children:e,className:i,...d}=t,{slots:u,classNames:n,headerId:p,setHeaderMounted:c}=E(),f=D(a),x=s||"header";return l.useEffect(()=>(c(!0),()=>c(!1)),[c]),o.jsx(x,{ref:f,className:u.header({class:S(n==null?void 0:n.header,i)}),id:p,...d,children:e})});J.displayName="NextUI.ModalHeader";var Qe=J;function Xe(t={},a,s){let{overlayProps:e,underlayProps:i}=ve({...t,isOpen:a.isOpen,onClose:a.close},s);return ye(),l.useEffect(()=>{if(a.isOpen&&s.current)return ge([s.current])},[a.isOpen,s]),{modalProps:I(e),underlayProps:i}}function Ye(t){var a;const[s,e]=Ne(t,L.variantKeys),{ref:i,as:d,className:u,classNames:n,disableAnimation:p=!1,isOpen:c,defaultOpen:f,onOpenChange:x,motionProps:C,closeButton:_,isDismissable:g=!0,hideCloseButton:y=!1,shouldBlockScroll:$=!0,portalContainer:N,isKeyboardDismissDisabled:r=!1,onClose:m,...b}=s,k=d||"section",h=D(i),w=l.useRef(null),[P,v]=l.useState(!1),[X,Y]=l.useState(!1),Z=l.useId(),F=l.useId(),T=l.useId(),M=$e({isOpen:c,defaultOpen:f,onOpenChange:j=>{x==null||x(j),j||m==null||m()}}),{modalProps:ee,underlayProps:z}=Xe({isDismissable:g,isKeyboardDismissDisabled:r},M,h),{buttonProps:oe}=Pe({onPress:M.close},w),{isFocusVisible:ae,focusProps:se}=je(),te=S(n==null?void 0:n.base,u),B=l.useMemo(()=>L({...e}),[...Object.values(e)]),re=(j={},ie=null)=>({ref:Ce(ie,h),...I(ee,b,j),className:B.base({class:S(te,j.className)}),id:Z,"data-open":A(M.isOpen),"data-dismissable":A(g),"aria-modal":A(!0),"aria-labelledby":P?F:void 0,"aria-describedby":X?T:void 0}),ne=l.useCallback((j={})=>({className:B.backdrop({class:n==null?void 0:n.backdrop}),onClick:()=>M.close(),...z,...j}),[B,n,z]),le=()=>({role:"button",tabIndex:0,"aria-label":"Close","data-focus-visible":A(ae),className:B.closeButton({class:n==null?void 0:n.closeButton}),...I(oe,se)}
1);return{Component:k,slots:B,domRef:h,headerId:F,bodyId:T,motionProps:C,classNames:n,isDismissable:g,closeButton:_,hideCloseButton:y,portalContainer:N,shouldBlockScroll:$,backdrop:(a=t.backdrop)!=null?a:"opaque",isOpen:M.isOpen,onClose:M.close,disableAnimation:p,setBodyMounted:Y,setHeaderMounted:v,getDialogProps:re,getBackdropProps:ne,getCloseButtonProps:le}}var Q=O((t,a)=>{const{children:s,...e}=t,i=Ye({...e,ref:a}),d=o.jsx(we,{portalContainer:i.portalContainer,children:s});return o.jsx(Le,{value:i,children:i.disableAnimation&&i.isOpen?d:o.jsx(Me,{children:i.isOpen?d:null})})});Q.displayName="NextUI.Modal";var Ze=Q;const eo=async t=>{try{const a=await fetch(route("backoffice.people.search",{filters:{name:t}}));if(!a.ok)throw new Error("Network response was not ok");return await a.json()}catch(a){return console.error("Error:",a),[]}},oo=(t,a,s)=>{const e=t.slice(0);return e.splice(s<0?e.length+s:s,0,e.splice(a,1)[0]),e},Yo=t=>{var N;const[a,s]=l.useState(""),[e,i]=l.useState([]),[d,u]=l.useState(!1),{data:n,post:p}=de({orders:[]}),[c,f]=l.useState("inside"),x=!!a,C=l.useCallback(r=>{s(r||"")},[]);l.useEffect(()=>{(async()=>{let m=[];x?m=await eo(a):m=t,i(m)})()},[t,a]);const _=l.useCallback((r,m)=>{const{name_complete:b,status:k,id:h,updated_at:w}=r;switch(m){case"name":return b;case"actions":return o.jsx("div",{className:"relative flex justify-start items-center gap-2",children:o.jsxs(Ae,{className:"bg-background border-1 border-default-200",children:[o.jsx(Ie,{children:o.jsx(q,{isIconOnly:!0,radius:"full",size:"sm",variant:"light",children:o.jsx(pe,{className:"text-default-400"})})}),o.jsx(De,{children:o.jsx(Ee,{href:route("backoffice.people.edit",h),children:"Edit"})})]})});default:return h}},[]),g=[{name:"Name",uid:"name"},{name:"Actions",uid:"actions"}],y=()=>{u(!d)},$=r=>{const{active:m,over:b}=r,k=e==null?void 0:e.data.findIndex(v=>v.id===m.id),h=e==null?void 0:e.data.findIndex(v=>v.id===b.id),w=oo(e==null?void 0:e.data,k,h);i({...e,data:w});const P=w.map(v=>v.id);n.orders=P,p(route("backoffice.people.order"))};return o.jsxs("div",{children:[o.jsxs(Ve,{"aria-label":"PeopleTable",bottomContent:o.jsx(ce,{total:e==null?void 0:e.total,from:e==null?void 0:e.from,currentPage:e==null?void 0:e.current_page,lastPage:e==null?void 0:e.last_page}),topContent:o.jsx(me,{name:"Person",total:e==null?void 0:e.total,filterValue:a,onSearchChange:C,handleClickModal:y}),children:[o.jsx(Fe,{children:g.map(r=>o.jsx(Te,{children:R(r.name)},r.uid))}),o.jsx(ze,{items:(e==null?void 0:e.data)??[],children:r=>o.jsx(He,{children:m=>o.jsx(Ue,{children:_(r,m)})},r.id)})]}),o.jsx(Ze,{isOpen:d,scrollBehavior:c,title:"Order",children:o.jsx(Ge,{children:d&&o.jsxs(o.Fragment,{children:[o.jsx(Qe,{className:"flex flex-col gap-1",children:R("Order :name",{name:R("positions")})}),o.jsx(Ke,{children:o.jsx(ue,{collisionDetection:fe,onDragEnd:$,children:o.jsx("ul",{className:"z-10",children:o.jsx(xe,{items:(e==null?void 0:e.data)??[],strategy:be,children:(N=e==null?void 0:e.data)==null?void 0:N.map(r=>o.jsx(he,{...r},r.id))})})})}),o.jsx(Je,{children:o.jsx(q,{onClick:y,size:"small",color:"default",variant:"solid",children:R("Close")})})]})})})]})};export{Yo as __Table};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.