1import{j as e}from"./vendor-radix-BDJ1G1Rz.js";import{r as l}from"./vendor-query-jnzAvHUk.js";import{aa as le,aP as ce,D as se,x as te,t as F,P as v,ah as A,ar as S,B as k,I as _,C as ae,c as de,a_ as ue,q as me,aX as pe,b5 as he,aV as fe,aW as Z}from"./index-DU-Mv_L_.js";import{G as q,a5 as Q,a6 as $,S as H,a7 as xe,a8 as Y,F as J,Q as ge,z as U,M as K,e as V,a9 as be,aa as ye}from"./index-B0iGX3f6.js";import{u as O,T as G,t as L}from"./vendor-i18n-B-AdlurK.js";import{F as Ce,R as ne,E as je,T as Ee,A as Te}from"./explore-DEdj8QjE.js";import{u as we}from"./use-account-filter-tree-CAjveGQx.js";import{F as De}from"./filter-dropdown-zQz1F6iG.js";import"./vendor-date-CemE0fj8.js";import"./vendor-datadog-D3gwQpHA.js";import{u as P}from"./use-verify-permission.hook-z68Q1APH.js";import{B as Ne}from"./bulk-action-bar-Bcs3CGlv.js";import{u as ve,C as Ae}from"./connect-context-BkT7is64.js";import{D as Se,a as Pe,b as Oe,g as _e}from"./dropdown-menu-CYoEklaj.js";import{u as Le}from"./use-test-credentials-flag.hook-DYnWf25l.js";import{D as Ie}from"./data-table-cell-wrapper-CplAFoJ9.js";import{D as ke}from"./data-table-text-cell-Cg-VNhe2.js";import{D as Fe}from"./data-table-icon-cell-BHMxW-mj.js";import{u as $e}from"./user-settings-table.hooks-Bc0GQwYg.js";import{D as Ue}from"./data-table-5fro1WoV.js";
1import"./vendor-shared-D7qeTqf-.js";import"./index.esm-DLMWj2gi.js";import"./accordion-C8KrTtcp.js";import"./loading-TYH7LjbY.js";import"./select-DpDnkHhK.js";import"./field-label-row-DncCxLr_.js";import"./field-kJ7JUfRc.js";import"./textarea-5Xv9XPyh.js";import"./field-B3A1usSq.js";import"./use-scoped-account-selection-CnrJrnzJ.js";import"./connections.mutation-BhGLG8qi.js";import"./smart-routing.query-lAHy4Y6X.js";import"./page-title-BlPv_5hX.js";import"./alert-CXODG9VH.js";import"./nav-tabs-CxWO2knQ.js";import"./nav-link-CxyWzSoe.js";import"./access-denied-alert-BIofsjaN.js";import"./empty-DxWctKZr.js";import"./provider-card-CUYvFqMt.js";import"./card-4a05wjRk.js";import"./textarea-Di-uA-vE.js";import"./use-feature-flags-CM_eQXV5.js";import"./intl-DBWlphZd.js";import"./filter-date-range-DiKef5xl.js";import"./date-picker-DDyGAMtD.js";import"./time-picker-xf1StE2V.js";import"./vendor-table-szJPgfvF.js";const Re=()=>{const{t:s}=O(),{handleSetFilter:t,filter:{search:d}}=l.useContext(q),o=r=>{t("search",r)};return e.jsx(le,{id:"search","aria-label":s("searchByNameOrId","Search by name or ID"),value:d,onSearch:o,persistKey:"connection-your-connections",placeholder:s("searchByNameOrId"),className:"w-[328px]"})},ze=()=>{const{t:s}=O(),{handleChange:t,accounts:d,selectedAccount:o,isLoadingAccount:r}=Q(),{filter:a,handleSetFilter:n}=l.useContext(q),u=we(d),f=l.useCallback(h=>{t({account:h})},[t]),m=l.useCallback(h=>{n($,h.join(","))},[n]),p=l.useMemo(()=>[{label:s("flowType.payin"),value:H.PAYIN},{label:s("flowType.payout"),value:H.PAYOUT}],[s]),i=l.useCallback(h=>{if(h==="flowType")n($,"");else if(h.startsWith("flowType-")){const w=h.replace("flowType-",""),c=a.flowTypes.filter(g=>g!==w);n($,c.join(","))}},[a.flowTypes,n]),x=l.useCallback(()=>{n($,"")},[n]),b=l.useMemo(()=>{const h=[];return o?.name&&h.push({id:"account",label:o.name,...ce()&&{icon:"User"}}),a.flowTypes.length===1?h.push({id:`flowType-${a.flowTypes[0]}`,label:s(`flowType.${a.flowTypes[0].toLowerCase()}`)}):a.flowTypes.length>1&&h.push({id:"flowType",label:`${s("tableHeader.flowType")} (${a.flowTypes.length})`}),h},[o?.name,a.flowTypes,s]);return r||!o?null:e.jsx(De,{translations:{addFilter:s("filters")},filters:[{id:"account",icon:"User",label:s("account"),type:"radio",items:u.items,groups:u.groups,selectedValue:o?.code||"",onValueChange:f,clearable:!1,searchable:!0,searchPlaceholder:s("search")},{id:"flowType",icon:"ArrowsLeftRight",label:s("tableHeader.flowType"),type:"checkbox",items:p,selectedValues:a.flowTypes,onChange:m}],appliedFilters:b,onRemoveFilter:i,onClearAllFilters:x})},Me=({open:s,onClose:t,onAction:d,content:o,onClearSelection:r})=>{const{t:a}=O(),{state:n,count:u,allowed:f,notAllowed:m}=o.data,[p,i]=l.useState(!1),x=l.useCallback(()=>t(),[t]),b=u>1?"_plural":"",h=async E=>{i(!0);try{await d({status:E.toUpperCase(),connectionCodes:o.checkedConnections.filter(T=>!m?.map(C=>C.code).includes(T))}),te.invalidateQueries({queryKey:["organizations-account-integrations"]}),F.success(a(`actions.${n}.success${b}`)),i(!1),x(),r?.()}catch{i(!1),F.error(a(`actions.${n}.error${b}`))}},w=f?.length>0,c=m?.length>0,g=!w&&c,D=c&&Number(u)===1||c&&u-m?.length===0,j=l.useMemo(()=>c&&u>1&&u-m?.length>0?e.jsx(G,{i18nKey:`actions.${n}.body_partial_conflict`,components:{1:e.jsx("br",{}),connections:m?.map(E=>e.jsx("li",{children:e.jsx("b",{children:E.name})},E.code))},values:{allowed:u-m?.length,number:u}}):g?e.jsx(G,{i18nKey:`actions.${n}.body_conflict${b}`,components:{1:e.jsx("br",{})},values:{number:u}}):e.jsx(G,{i18nKey:`actions.${n}.body${b}`,components:{1:e.jsx("br",{})},values:{number:u}}),[c,u,n,m,g,b]),y=()=>{if(D)return[{children:a("gotIt"),onClick:x}];const E=[{children:a("cancel"),variant:"secondary",onClick:x}];return n&&E.push({children:a(`actions.${n}.button`),onClick:()=>{h(n)},loading:p}),E};return e.jsx(se,{open:s,closeIcon:x,title:n?a(`actions.${n}.title${b}`,{number:u}):"",buttons:y(),children:e.jsx("div",{children:j})})},ee={type:"",data:{}},We=({showIn:s,checkedConnections:t,onClearSelection:d,connectionsData:o})=>{const{t:r}=O(),a=l.useRef(0);s&&(a.current=t?.length||0);const[n,u]=l.useState(!1),[f,m]=l.useState(ee);l.useEffect(()=>{n||m(ee)},[n]);const p=T=>{T&&Object.keys(T?.data).length>0&&(u(!0),m(T))},i=()=>{u(!1)},{statusPermission:x}=P(v.ADD_EDIT_DELETE_CONNECTIONS),{statusPermission:b}=P(v.PAUSE_UNPAUSE_CONNECTIONS),h=b===A.ALLOWED,w=x===A.ALLOWED,c=te.getQueriesData({queryKey:["organizations-account-integrations"]}),g=o||c?.[0]?.[1]||[],{checkPauseStatus:D,changeStatus:j}=xe(),y=(T,C)=>T.filter(I=>C.includes(I.code)),E=async T=>{try{const C=await D(t,T,!0);if(!Array.isArray(C?.allowed)&&!Array.isArray(C?.not_allowed))throw C;const I=C?.allowed??[],R=C?.not_allowed??[],z=y(g,I),M=y(g,R),N={DELETED:"deleted",PAUSED:"paused",ACTIVE:"active"}[T]||T.toLowerCase();p({type:T,checkedConnections:t,data:{count:String(t?.length),state:N,allowed:z,notAllowed:M}})}catch(C){const I=C?.response?.data?.message||C?.message||r("actions.error.generic");F.error(I)}};return e.jsxs(e.Fragment,{children:[e.jsxs(Ne,{open:s,label:`${a.current} ${r("selected")}`,clearLabel:r("clearSelection"),onClear:()=>d?.(),children:[e.jsx(S,{content:r("noAccess"),show:!h,delayDuration:0,
1children:e.jsxs(k,{variant:"outline",size:"sm",disabled:!h,onClick:()=>E("PAUSED"),className:"h-8 gap-2 text-xs",children:[e.jsx(_,{name:"Pause",size:"sm"}),r("tableOptions.pause")]})}),e.jsx(S,{content:r("noAccess"),show:!h,delayDuration:0,children:e.jsxs(k,{variant:"outline",size:"sm",disabled:!h,onClick:()=>E("ACTIVE"),className:"h-8 gap-2 text-xs",children:[e.jsx(_,{name:"Play",size:"sm"}),r("tableOptions.unpause")]})}),e.jsx(S,{content:r("noAccess"),show:!w,delayDuration:0,children:e.jsxs(k,{variant:"outline",size:"sm",disabled:!w,onClick:()=>E("DELETED"),className:"h-8 gap-2 text-xs",children:[e.jsx(_,{name:"Trash",size:"sm"}),r("tableOptions.delete")]})})]}),e.jsx(Me,{open:n,onAction:j,onClose:i,content:f,onClearSelection:d})]})},oe=({options:s,connection:t,isActionTable:d})=>{const{t:o}=O(),r=()=>t.status==="PENDING"?s.filter(a=>a.icon!=="PlayCircle"&&a.icon!=="PauseCircle"&&a.icon!=="PencilSimpleLine"):s;return e.jsxs(Se,{children:[e.jsx(Pe,{asChild:!0,children:e.jsx(k,{variant:"ghost",size:"icon","aria-label":"more options",children:e.jsx(_,{name:"DotsThreeOutline",weight:"fill",size:"sm",className:"text-foreground"})})}),e.jsx(Oe,{align:"end",className:"min-w-[150px]",children:r()?.map(a=>{const n=e.jsxs(_e,{onClick:()=>a.action(t),disabled:a.disabled,className:"gap-2 h-8 px-2 py-1.5 text-sm cursor-pointer",children:[e.jsx(_,{name:a.icon,size:"sm",className:"text-foreground"}),a.text]},`menu-item-option-${a.text}`);return a.disabled?e.jsx(S,{content:o("noAccess"),delayDuration:0,triggerProps:{className:"w-full justify-start"},children:n},a.text):n})})]})},Be=s=>({COMPLETED:"success",ACTIVE:"success",PENDING:"warning",PAUSED:"alert",REJECTED:"error"})[s]||"success",Ke=s=>({COMPLETED:"CheckCircle",ACTIVE:"CheckCircle",PENDING:"Clock",PAUSED:"PauseCircle",REJECTED:"XCircle"})[s]||"CheckCircle",re=({status:s,isArchived:t})=>{const{t:d}=O(),o=t?"PAUSED":s,r=e.jsx(ae,{variant:Be(o),startIcon:Ke(o),children:d(`status.${o}`)});return s==="PENDING"?e.jsx(S,{content:d("validatingDataHours"),delayDuration:0,children:r}):r},Ve=({morePayments:s,index:t,icon:d,description:o})=>{const[r,a]=l.useState(!1),[n,u]=l.useState(!1),f=s.length>0&&t===Y,m=l.useMemo(()=>f?s.map(i=>i.name).join(", "):"",[s,f]),p=()=>!r&&d?e.jsx("img",{src:d,alt:o,className:"w-6 h-6 rounded-md",onError:()=>a(!0)}):n?e.jsx("div",{className:"w-6 h-6 rounded-md bg-muted flex items-center justify-center",children:e.jsx("p",{className:"text-xs font-semibold text-muted-foreground",children:o?.charAt(0)?.toUpperCase()||"?"})}):e.jsx("img",{src:J,alt:o,className:"w-6 h-6 rounded-md",onError:()=>u(!0)});return t<3?e.jsx(S,{content:o,delayDuration:0,children:p()}):f&&e.jsx(S,{content:m,delayDuration:0,children:e.jsx("div",{children:e.jsxs(ae,{variant:"outline",children:["+",s.length]})})})},ie=()=>{const{t:s}=O(),t=de(),{setParams:d}=ge(),{handlerArchive:o,showDeleteDialog:r}=U(),{statusPermission:a}=P(v.ADD_EDIT_DELETE_CONNECTIONS),{statusPermission:n}=P(v.PAUSE_UNPAUSE_CONNECTIONS),{statusPermission:u}=P(v.VIEW_CONNECTIONS),{isTestCredentialsEnabled:f}=Le(),m=a===A.ALLOWED,p=n===A.ALLOWED,i=u===A.ALLOWED,x=c=>{const g=K(c.flow_type);t(`/connections/${c.provider.provider_id}/edit/${c.code}?${V}=${g}`)},b=c=>{const g=K(c.flow_type);t(`/connections/${c.provider.provider_id}/add?${V}=${g}`,{state:{duplicateFrom:c.code}})},h=c=>{const g=K(c.flow_type);t(`/connections/${c.provider.provider_id}/view/${c.code}?${V}=${g}`)};return{getTableOptionsData:c=>{const g=c?.flow_type===H.PAYOUT,D=c?.status==="REJECTED",j=[];return D||j.push({action:()=>o(c?.code,!c?.archive,c?.provider.name),icon:c.archive?"PlayCircle":"PauseCircle",text:c.archive?s("tableOptions.unpause"):s("tableOptions.pause"),disabled:!p}),j.push({action:()=>h(c),icon:"Eye",text:s("tableOptions.view"),disabled:!i}),j.push({action:()=>x(c),icon:"PencilSimpleLine",text:s("tableOptions.edit"),disabled:!m},{action:()=>b(c),icon:"Copy",text:s("tableOptions.duplicate"),disabled:!m},{action:()=>r(c),icon:"Trash",text:s("tableOptions.delete"),disabled:!m},...f&&!D?[{action:()=>d({provider:c.provider.provider_id,connectionId:c.code}),icon:"Key",text:s("simulate.title"),disabled:!m||g}]:[]),j}}},Ge=(s=[])=>s?.length<=Y?[]:s?.slice(Y),He=({img:s,title:t,archived:d,name:o,pending:r=!1,integrationCode:a,connection:n,checked:u,onCheck:f})=>{const{t:m}=O(),[p,i]=l.useState(!1),[x,b]=l.useState(!1),{statusPermission:h}=P(v.ADD_EDIT_DELETE_CONNECTIONS),{statusPermission:w}=P(v.PAUSE_UNPAUSE_CONNECTIONS),{getTableOptionsData:c}=ie(),g=l.useCallback(async()=>
1{if(a)try{await navigator.clipboard.writeText(a),F.success(m("copyClipboard"))}catch(y){console.error("Failed to copy:",y)}},[a,m]),D=!r,j=()=>!p&&s?e.jsx("img",{src:s,alt:t,className:"w-10 h-10 shrink-0 rounded-md",onError:()=>i(!0)}):x?e.jsx("div",{className:"w-10 h-10 shrink-0 rounded-md bg-muted flex items-center justify-center",children:e.jsx("p",{className:"text-sm font-semibold text-muted-foreground",children:t?.charAt(0)?.toUpperCase()||"?"})}):e.jsx("img",{src:J,alt:t,className:"w-10 h-10 shrink-0 rounded-md",onError:()=>b(!0)});return e.jsxs("div",{"data-testid":"connection-card-small",className:me("app-card flex flex-col rounded-xl bg-card text-card-foreground border transition-all overflow-hidden",u?"border-primary shadow-lg":"border-border",D&&"hover:border-primary hover:shadow-lg group"),children:[e.jsxs("div",{className:"flex flex-col p-6",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[(h===A.ALLOWED||w===A.ALLOWED)&&e.jsx(ue,{className:"self-center",checked:u,onChange:y=>f?.(y,y.target.checked)}),j(),e.jsx("div",{className:"flex-1"}),e.jsxs("div",{className:"flex gap-2 items-center shrink-0",children:[!d&&a&&e.jsx(S,{content:m("copyId"),delayDuration:0,children:e.jsx(k,{variant:"ghost",size:"icon",onClick:g,"aria-label":m("copyId"),children:e.jsx(_,{name:"Copy",size:"sm",className:"text-muted-foreground"})})}),e.jsx(oe,{isActionTable:!0,options:c(n),connection:n})]})]}),e.jsxs("div",{className:"flex flex-col gap-1 mt-4",children:[e.jsx("p",{className:`text-base font-semibold leading-none tracking-tight break-all ${d?"text-muted-foreground":"text-card-foreground"}`,children:t}),e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:o})]})]}),e.jsxs("div",{className:"flex items-center justify-between border-t border-border px-6 py-4",children:[e.jsx(re,{isArchived:n.archive,status:n.status}),e.jsx("div",{className:"flex items-center gap-2",children:n?.payment_methods?.map((y,E)=>e.jsx(Ve,{icon:y.icon,description:y.name,index:E,morePayments:Ge(n.payment_methods)},`index-table-payment-method-${y?.payment_method_id}`))})]})]})},Ye=s=>{navigator.clipboard.writeText(s),F.success(L("copyClipboard"))},qe=({provider:s,code:t})=>{const[d,o]=l.useState(!1),[r,a]=l.useState(!1),n=()=>!d&&s.icon?e.jsx("img",{className:"rounded-md w-6 h-6",src:s.icon,alt:s.provider_id,onError:()=>o(!0)}):r?e.jsx("div",{className:"rounded-md w-6 h-6 bg-muted flex items-center justify-center",children:e.jsx("p",{className:"text-xs font-semibold text-muted-foreground",children:s.name?.charAt(0)?.toUpperCase()||"?"})}):e.jsx("img",{className:"rounded-md w-6 h-6",src:J,alt:s.provider_id,onError:()=>a(!0)});return e.jsxs("div",{className:"flex gap-2 items-center justify-start",children:[n(),e.jsx(S,{content:s.name,delayDuration:0,children:e.jsx("span",{className:"text-foreground",children:s.name})}),e.jsx(S,{content:L("copyId"),delayDuration:0,children:e.jsx(k,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:u=>{u.stopPropagation(),Ye(t)},"aria-label":L("a11y.copyConnectionId","Copy ID for {{name}} ({{code}})",{name:s.name,code:t}),children:e.jsx(_,{name:"Copy",size:"sm"})})})]})},Qe=()=>[{accessorKey:"provider",header:L("tableHeader.connection"),size:300,enableHiding:!1,cell:({row:s})=>{const t=s.original.provider,d=s.original.code;return e.jsx(Ie,{value:t,children:t&&e.jsx(qe,{provider:t,code:d})})}},{accessorKey:"name",header:L("tableHeader.name"),size:300,cell:({row:s})=>e.jsx(ke,{value:s.original.name})},{accessorKey:"flow_type",header:L("tableHeader.flowType"),size:150,cell:({row:s})=>{const t=s.original.flow_type||be;return e.jsx("div",{className:"flex justify-start",children:e.jsx(Ce,{flowType:t})})}},{accessorKey:"payment_methods",header:L("tableHeader.paymentMethod"),size:300,cell:({row:s})=>e.jsx(Fe,{items:(s.original.payment_methods||[]).map(t=>({name:t.name,src:t.icon})),maxVisible:3})},{accessorKey:"status",header:L("tableHeader.status"),size:200,cell:({row:s})=>{const t=s.original.status,d=s.original.archive;return t?e.jsx(re,{isArchived:!!d,status:t}):"-"}}],Je=({isLoading:s,columnsData:t,rowData:d,idTable:o,customActions:r,emptyTitle:a,emptySubtitle:n,emptyIcon:u=null,emptyLink:f,emptyLinkUrl:m,withCheckbox:p,rowSelection:i,onCheckboxSelected:x})=>{const{isLoadingProfile:b,initialSettingsLocalStorage:h,initialSettingsUserProfile:w,onUpdateTable:c}=$e("connections",o),g=l.useCallback((D,j)=>{x?.(j)},[x]);return b?null:e.jsx(Ue,{columns:t,data:d||[],isLoading:s,checkboxSelection:p,rowSelection:i,onRowSelectionChange:g,persistKey:o,height:"100%",enableColumnDragDrop:!0,initialSettings:h||w,onUpdate:c,empty:{title:a,description:n,media:u,actions:m?e.jsx("a",{href:m,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline text-sm",children:f}):void 0},actions:r?{render:D=>r.renderActions(D)}:void 0,enableSorting:!1})},Xe=({onCheckboxSelected:s,checkedConnections:t})=>{const{staticContent:d}=pe(),o=he(),{filter:{search:r}}=l.useContext(q),{status:a}=Q(),{data:n,isLoading:u}=U(),{statusPermission:f}=P(v.ADD_EDIT_DELETE_CONNECTIONS),{statusPermission:m}=P(v.PAUSE_UNPAUSE_CONNECTIONS),{t:p}=O(),[i,x]=l.useState(!1),[b,h]=l.useState(""),[w,c]=l.useState(0),[g,D]=l.useState(null),{getTableOptionsData:j}=ie(),y=l.useCallback(()=>{x(!1),h(""),c(0),D(null)},[]),E=()=>w===0||!g?null:e.jsxs("div",{children:[e.jsx("span",{className:"text-foreground",children:p("modalStatus.pause.firstText")}),e.jsx("span",{className:"text-foreground",children:`${p("modalStatus.pause.firstText")} ${g.name}?`})]}),T=l.useMemo(()=>Qe(),[]),C=l.useMemo(()=>n?n.filter(N=>N?.provider?.provider_id!==ne):[],[n]),I=l.useMemo(()=>
1{if(!t?.length)return{};const N={};return C.forEach((W,B)=>{t.includes(W.code)&&(N[B]=!0)}),N},[t,C]),R=l.useCallback(N=>{const W=N.map(B=>B.code);s(W)},[s]),z=l.useMemo(()=>({renderActions:N=>e.jsx(oe,{isActionTable:!0,options:j(N),connection:N})}),[j]),M=l.useMemo(()=>[{onClick:y,children:p("cancel"),variant:"secondary"}],[y,p]),X=u||a==="LOADING";return e.jsxs("div",{className:"mt-6",children:[e.jsx(Je,{emptyTitle:r?`${p("noResultsSearchTitle")} "${r}"`:p("noResults"),emptySubtitle:r?[p("noResultsSearch"),!o&&p("noResultsSearch2")].filter(Boolean).join(" "):[p("noResultsFinal"),!o&&p("noResultsFinal2")].filter(Boolean).join(" "),emptyLink:p("noResultsFinalLink"),emptyLinkUrl:r||o?void 0:d?.docs_url,customActions:z,columnsData:T,rowData:C,isLoading:X,idTable:"connections",withCheckbox:f===A.ALLOWED||m===A.ALLOWED,rowSelection:I,onCheckboxSelected:R}),e.jsx(se,{title:b,open:i,closeIcon:()=>x(!1),buttons:M,children:E()})]})},Ze=({typeList:s,setCheckedConnections:t,checkedConnections:d})=>{const{status:o}=Q(),{data:r,isLoading:a,refetch:n,error:u}=U(),{filter:{search:f}}=ye();l.useEffect(()=>{a&&t([])},[a,o]);const m=i=>{if(i){if(d.includes(i)){t(d.filter(x=>x!==i));return}t([...d,i])}},p=l.useCallback(i=>{t(i)},[t]);return e.jsxs(e.Fragment,{children:[!u&&e.jsx(e.Fragment,{children:s===1?e.jsx(Xe,{onCheckboxSelected:p,checkedConnections:d}):e.jsx("div",{className:"pt-6",children:!a&&r?.length>0?e.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-6 overflow-hidden",children:r?.filter(i=>i?.provider?.provider_id!==ne)?.map(i=>e.jsx(He,{onCheck:()=>m(i.code),integrationCode:i.code,checked:d?.includes(i?.code),title:i?.provider.name,name:i?.name,img:i?.provider.icon,pending:i.status==="PENDING",connection:i},i.code))}):e.jsx(je,{hasFilters:!0,searchAdd:f})})}),u&&!Array.isArray(r)?e.jsx(Ee,{refetch:n}):null]})},es=({setOpenAdd:s})=>{const{t}=O(),{error:d,isLoadingData:o}=ve(),{statusPermission:r}=P(v.ADD_EDIT_DELETE_CONNECTIONS);return r===A.ALLOWED?e.jsx(k,{size:"sm",disabled:o||!!d,onClick:()=>s(!0),className:"text-xs",children:t("addNewConnection")}):null},Ys=()=>{const{refetch:s,connectionResponse:t,data:d}=U(),[o,r]=l.useState(1),[a,n]=l.useState(!1),[u,f]=l.useState([]);l.useEffect(()=>{f([])},[o]);const m=()=>{f([])},p=(i,x)=>{x==="WarningCircle"?F.error(i):F.success(i)};return e.jsx(Ae,{refetchConnection:s,children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"sticky-filters",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx(Re,{}),e.jsx(es,{setOpenAdd:n})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"flex items-center",children:e.jsx(ze,{})}),e.jsxs(fe,{type:"single",value:String(o),onChange:i=>i&&r(Number(i)),size:"sm",variant:"outline",children:[e.jsx(Z,{value:"1","aria-label":"List view",children:e.jsx(_,{name:"ListBullets",size:"sm"})}),e.jsx(Z,{value:"2","aria-label":"Grid view",children:e.jsx(_,{name:"SquaresFour",size:"sm"})})]})]}),e.jsx(We,{checkedConnections:u,showIn:u?.length>0,onClearSelection:m,connectionsData:d})]}),e.jsx(Ze,{typeList:o,setCheckedConnections:f,checkedConnections:u}),a&&e.jsx(Te,{connectionResponse:t?.data,open:a,setOpen:n,setSnackbar:p})]})})};export{Ys as default};
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.