@boxyhq/react-ui
Version:
React UI components from BoxyHQ
3 lines (2 loc) • 20.6 kB
JavaScript
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CS5SeY3J.cjs"),g=require("react"),l=require("./index-DleagIor.cjs");var U=(t=>(t["azure-scim-v2"]="Entra ID SCIM v2.0",t["onelogin-scim-v2"]="OneLogin SCIM v2.0",t["okta-scim-v2"]="Okta SCIM v2.0",t["jumpcloud-scim-v2"]="JumpCloud v2.0",t["generic-scim-v2"]="Generic SCIM v2.0",t.google="Google",t))(U||{});const le="_heading_h67it_3",re="_fieldContainer_h67it_17",ue="_formAction_h67it_22",M={heading:le,fieldContainer:re,formAction:ue},de={name:"",tenant:"",product:"",webhook_url:"",webhook_secret:"",type:"azure-scim-v2",google_domain:"",log_webhook_events:!1};function oe(t){var j,y,R,T;const[c,p]=g.useState(()=>de),[N,w]=g.useState(()=>!1),[F,_]=g.useState(()=>!1);function I(){var a;return(a=Object.entries(U))==null?void 0:a.map(([o,u])=>({value:o,text:u})).filter(({value:o})=>t.disableGoogleProvider?o!=="google":!0)}function s(a){var u;const o=(u=a==null?void 0:a.target)==null?void 0:u.value;w(o==="google"),p({...c,type:o})}function E(){var a,o,u,k,n,i;return{fieldContainer:e.cssClassAssembler((a=t.classNames)==null?void 0:a.fieldContainer,M.fieldContainer),inputField:{label:(o=t.classNames)==null?void 0:o.label,input:(u=t.classNames)==null?void 0:u.input,container:(k=t.classNames)==null?void 0:k.fieldContainer},select:{label:(n=t.classNames)==null?void 0:n.label,select:(i=t.classNames)==null?void 0:i.select}}}function h(){return t.displayHeader!==void 0?t.displayHeader:!0}function D(a){return{...c,...a}}function d(a){const o=a.target,u=o.type==="checkbox"?o.checked:o.value;p(D({[o.id]:u}))}function r(a){a.preventDefault();async function o(u,k){_(!0);const n=await l.sendHTTPRequest(k,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u)});_(!1),n&&typeof n=="object"&&("error"in n&&n.error?typeof t.errorCallback=="function"&&t.errorCallback(n.error.message):"data"in n&&n.data&&typeof t.successCallback=="function"&&t.successCallback({operation:"CREATE",connection:n.data}))}o(c,t.urls.post)}function C(a){var o;return!!((o=t.excludeFields)!=null&&o.includes(a))}return g.useEffect(()=>{p(D({tenant:t.tenant??c.tenant,product:t.product??c.product,webhook_url:t.defaultWebhookEndpoint??c.webhook_url,webhook_secret:t.defaultWebhookSecret??c.webhook_secret}))},[t.tenant,t.product,t.defaultWebhookEndpoint]),e.jsxRuntimeExports.jsxs("div",{children:[h()?e.jsxRuntimeExports.jsx("h2",{className:M.heading,children:"Create Directory"}):null,e.jsxRuntimeExports.jsxs("form",{onSubmit:a=>r(a),children:[C("name")?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(l.InputField,{label:"Directory name",id:"name",name:"name",value:c.name,handleInputChange:d,required:!0,classNames:E().inputField}),e.jsxRuntimeExports.jsx(e.Spacer,{y:6})]}),C("type")?null:e.jsxRuntimeExports.jsxs("div",{className:E().fieldContainer,children:[e.jsxRuntimeExports.jsx(l.Select,{label:"Directory provider",name:"type",id:"type",classNames:E().select,options:I(),selectedValue:c.type,handleChange:s}),e.jsxRuntimeExports.jsx(e.Spacer,{y:6})]}),N?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(l.InputField,{label:"Directory domain",id:"google_domain",name:"google_domain",title:"Please enter a valid domain (e.g: boxyhq.com)",value:c.google_domain||"",handleInputChange:d,pattern:"^[a-zA-Z0-9-]+(.[a-zA-Z0-9-]+)*.[a-zA-Z]{2,}$",classNames:E().inputField}),e.jsxRuntimeExports.jsx(e.Spacer,{y:6})]}):null,C("tenant")?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(l.InputField,{label:"Tenant",id:"tenant",name:"tenant",value:c.tenant,handleInputChange:d,required:!0,classNames:E().inputField}),e.jsxRuntimeExports.jsx(e.Spacer,{y:6})]}),C("product")?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(l.InputField,{label:"Product",id:"product",name:"product",value:c.product,handleInputChange:d,required:!0,classNames:E().inputField}),e.jsxRuntimeExports.jsx(e.Spacer,{y:6})]}),C("webhook_url")?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(l.InputField,{type:"url",label:"Webhook URL",id:"webhook_url",name:"webhook_url",value:c.webhook_url,handleInputChange:d,classNames:E().inputField}),e.jsxRuntimeExports.jsx(e.Spacer,{y:6})]}),C("webhook_secret")?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(l.SecretInputFormControl,{label:"Webhook secret",id:"webhook_secret",name:"webhook_secret",value:c.webhook_secret,handleChange:d,classNames:E().inputField,required:!1,readOnly:!1}),e.jsxRuntimeExports.jsx(e.Spacer,{y:6})]}),C("log_webhook_events")?null:e.jsxRuntimeExports.jsxs("div",{className:M.checkboxFieldsDiv,children:[e.jsxRuntimeExports.jsx(l.Checkbox,{label:"Enable Webhook events logging",id:"log_webhook_events",name:"log_webhook_events",checked:c.log_webhook_events,handleChange:d}),e.jsxRuntimeExports.jsx(e.Spacer,{y:6})]}),e.jsxRuntimeExports.jsxs("div",{className:M.formAction,children:[typeof t.cancelCallback=="function"?e.jsxRuntimeExports.jsx(e.Button,{type:"button",name:"Cancel",variant:"outline",handleClick:t.cancelCallback,classNames:(y=(j=t.classNames)==null?void 0:j.button)==null?void 0:y.cancel}):null,e.jsxRuntimeExports.jsx(e.Button,{variant:"primary",type:"submit",name:"Create Directory",classNames:(T=(R=t.classNames)==null?void 0:R.button)==null?void 0:T.ctoa,isLoading:F})]})]})]})}const me="_iconSpan_qz43r_5",xe={iconSpan:me},he={directoryListData:[]};function ie(t){var k;const[c,p]=g.useState(()=>he.directoryListData);function N(){var n;return(n=Object.entries(U))==null?void 0:n.map(([i,v])=>({value:i,text:v}))}const[w,F]=g.useState(()=>!0),[_,I]=g.useState(()=>({})),[s,E]=g.useState(()=>!1),[h,D]=g.useState(()=>"");function d(){return t.urls.get}function r(){var n;return((n=t.paginate)==null?void 0:n.itemsPerPage)!==void 0}function C(){return t.hideViewAction?[{icon:"PencilIcon",label:"Edit",handleClick:n=>t.handleActionClick("edit",n)}]:[{icon:"EyeIcon",label:"View",handleClick:n=>t.handleActionClick("view",n)},{icon:"PencilIcon",label:"Edit",handleClick:n=>t.handleActionClick("edit",n)}]}function j(){return(t.cols||["name","tenant","product","type","status","actions"]).map(n=>n==="status"?{name:"status",badge:{position:"surround",variantSelector(i){let v;return i.deactivated&&(v="warning"),i.deactivated||(v="success"),v}}}:n)}function y(n){let i=n.getUrl;const[v,q]=i.split("?"),S=new URLSearchParams(q);return n.tenant&&S.set("tenant",n.tenant),n.product&&S.set("product",n.product),n.pageToken&&S.set("pageToken",n.pageToken),(n==null?void 0:n.offset)!==void 0&&(S.set("pageOffset",`${n.offset}`),S.set("pageLimit",`${n.limit}`)),S.toString()?`${v}?${S}`:i}function R(){return y({getUrl:d(),tenant:t.tenant,product:t.product})}function T(){var n;return{...t.tableProps,classNames:{...(n=t.tableProps)==null?void 0:n.classNames,iconSpan:xe.iconSpan}}}function a(n,i){return{..._,[n]:i}}async function o(n){const i=await l.sendHTTPRequest(n);if(F(!1),i&&typeof i=="object"){if("error"in i&&i.error)E(!0),D(i.error.message),typeof t.errorCallback=="function"&&t.errorCallback(i.error.message);else if("data"in i){const v="pageToken"in i,q=v?i.data.data:i.data;if(Array.isArray(q)){const S=q.map(P=>{var H;return{...P,id:P.id,name:P.name,tenant:P.tenant,product:P.product,type:(H=N().find(({value:z})=>z===P.type))==null?void 0:H.text,status:P.deactivated?"Inactive":"Active"}});p(S),typeof t.handleListFetchComplete=="function"&&t.handleListFetchComplete(S)}if(v)return i.pageToken}}}async function u(n){const i=await o(y({getUrl:R(),...n}));i&&I(a(n.offset,i))}return g.useEffect(()=>{r()||o(R())},[R(),r()]),e.jsxRuntimeExports.jsxs(l.LoadingContainer,{isBusy:w,children:[r()?e.jsxRuntimeExports.jsx(l.Paginate,{itemsPerPage:t.paginate.itemsPerPage,currentPageItemsCount:c.length,handlePageChange:(k=t.paginate)==null?void 0:k.handlePageChange,reFetch:u,pageTokenMap:_,children:e.jsxRuntimeExports.jsx(l.PaginatedTable,{emptyStateMessage:"No directories found.",cols:j(),data:c,actions:C(),showErrorComponent:s,errorMessage:h,tableProps:T()})}):null,r()?null:e.jsxRuntimeExports.jsx(l.NonPaginatedTable,{emptyStateMessage:"No directories found.",cols:j(),data:c,actions:C(),showErrorComponent:s,errorMessage:h,tableProps:T()})]})}const je="_container_r3olf_1",fe={container:je};function ge(t){var h,D,d;const[c,p]=g.useState(()=>!1);function N(){var r;return(r=t.connection)!=null&&r.deactivated?"Inactive":"Active"}function w(){var r;return(r=t.connection)!=null&&r.deactivated?"activate":"deactivate"}function F(){p(!0)}function _(){p(!1)}function I(){var r;E(!((r=t.connection)!=null&&r.deactivated))}function s(){var r;return{container:e.cssClassAssembler((r=t.classNames)==null?void 0:r.container,fe.container)}}function E(r){async function C(){var R;const j={directoryId:(R=t.connection)==null?void 0:R.id,deactivated:r},y=await l.sendHTTPRequest(t.urls.patch,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(j)});p(!1),y&&typeof y=="object"&&("error"in y&&y.error?typeof t.errorCallback=="function"&&t.errorCallback(y.error.message):typeof t.successCallback=="function"&&t.successCallback({operation:"UPDATE"}))}C()}return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:t.connection!==void 0||t.connection!==null?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("div",{className:s().container,children:[c?e.jsxRuntimeExports.jsx(l.ConfirmationPrompt,{ctoaVariant:(h=t.connection)!=null&&h.deactivated?"primary":"destructive",classNames:(D=t.classNames)==null?void 0:D.confirmationPrompt,cancelCallback:_,confirmationCallback:I,promptMessage:`Do you want to ${w()} the connection?`}):null,c?null:e.jsxRuntimeExports.jsx(l.ToggleSwitch,{label:N(),disabled:c,checked:!((d=t.connection)!=null&&d.deactivated),handleChange:F})]})}):null})}const be="_headingContainer_gj246_2",Ee="_heading_gj246_2",Ce="_section_gj246_27",ye="_info_gj246_39",ke="_sectionHeading_gj246_43",Re="_sectionPara_gj246_48",_e="_formAction_gj246_52",pe="_hint_gj246_57",A={headingContainer:be,heading:Ee,section:Ce,info:ye,sectionHeading:ke,sectionPara:Re,formAction:_e,hint:pe},ve={name:"",log_webhook_events:!1,webhook_url:"",webhook_secret:"",google_domain:"",google_authorization_url:""};function ce(t){var a,o,u,k,n,i,v,q,S,P,H,z,W,V,B,G,J,Z,Y,K,Q,X,ee,te,ne,se;const[c,p]=g.useState(()=>!1);function N(){p(!c)}const[w,F]=g.useState(()=>!1),[_,I]=g.useState(()=>!0),[s,E]=g.useState(()=>ve);function h(){var b,x,m,f;return{inputField:{label:(b=t.classNames)==null?void 0:b.label,input:(x=t.classNames)==null?void 0:x.input,container:(m=t.classNames)==null?void 0:m.fieldContainer},section:e.cssClassAssembler((f=t.classNames)==null?void 0:f.section,A.section)}}function D(b,x){return{...s,[b]:x}}function d(b){const x=b.target,m=x.id,f=x.type==="checkbox"?x.checked:x.value;E(D(m,f))}function r(b){b.preventDefault(),F(!0);async function x(m){const f=await l.sendHTTPRequest(m,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});F(!1),f&&typeof f=="object"&&("error"in f&&f.error?typeof t.errorCallback=="function"&&t.errorCallback(f.error.message):"data"in f&&f.data&&typeof t.successCallback=="function"&&t.successCallback({operation:"UPDATE",connection:f.data}))}x(t.urls.patch)}function C(){async function b(x){const m=await l.sendHTTPRequest(x,{method:"DELETE"});m&&typeof m=="object"&&(m.error?typeof t.errorCallback=="function"&&t.errorCallback(m.error.message):typeof t.successCallback=="function"&&t.successCallback({operation:"DELETE"}))}b(t.urls.delete)}function j(b){var x;return!!((x=t.excludeFields)!=null&&x.includes(b))}function y(){return t.displayHeader!==void 0?t.displayHeader:!0}function R(){return t.urls.get}function T(){if(!s.google_authorization_url)return;let b=s.google_authorization_url;const[x,m]=b.split("?"),f=new URLSearchParams(m);return f.set("directoryId",s.id),`${x}?${f}`}return g.useEffect(()=>{async function b(x){var f,ae;const m=await l.sendHTTPRequest(x);if(I(!1),m&&typeof m=="object"){if("error"in m&&m.error)typeof t.errorCallback=="function"&&t.errorCallback(m.error.message);else if("data"in m){const L=m.data;E({...L,name:L.name,log_webhook_events:L.log_webhook_events,webhook_url:((f=L.webhook)==null?void 0:f.endpoint)||"",webhook_secret:((ae=L.webhook)==null?void 0:ae.secret)||"",google_authorization_url:L.google_authorization_url||"",google_domain:L.google_domain||"",deactivated:L.deactivated})}}}b(R())},[R()]),e.jsxRuntimeExports.jsxs(l.LoadingContainer,{isBusy:_,children:[e.jsxRuntimeExports.jsxs("div",{className:A.headingContainer,children:[y()?e.jsxRuntimeExports.jsx("h2",{className:A.heading,children:"Update Directory"}):null,e.jsxRuntimeExports.jsx(ge,{connection:s,urls:{patch:t.urls.patch},classNames:{confirmationPrompt:{button:{ctoa:`${(u=(o=(a=t.classNames)==null?void 0:a.confirmationPrompt)==null?void 0:o.button)==null?void 0:u.ctoa} ${s!=null&&s.deactivated?(n=(k=t.classNames)==null?void 0:k.button)==null?void 0:n.ctoa:(v=(i=t.classNames)==null?void 0:i.button)==null?void 0:v.destructive}`.trim(),cancel:(P=(S=(q=t.classNames)==null?void 0:q.confirmationPrompt)==null?void 0:S.button)==null?void 0:P.cancel}}},errorCallback:t.errorCallback,successCallback:t.successCallback})]}),e.jsxRuntimeExports.jsxs("form",{onSubmit:b=>r(b),children:[j("name")?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(l.InputField,{label:"Directory name",id:"name",value:s.name,handleInputChange:d,required:!0,classNames:h().inputField}),e.jsxRuntimeExports.jsx(e.Spacer,{y:6})]}),!j("scim_endpoint")&&(s==null?void 0:s.type)!=="google"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(e.InputWithCopyButton,{label:"SCIM Endpoint",text:(H=s.scim)==null?void 0:H.endpoint,copyDoneCallback:t.successCallback,classNames:h().inputField}),e.jsxRuntimeExports.jsx(e.Spacer,{y:6})]}):null,!j("scim_token")&&(s==null?void 0:s.type)!=="google"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(e.InputWithCopyButton,{label:"SCIM Token",text:(z=s.scim)==null?void 0:z.secret,copyDoneCallback:t.successCallback,classNames:h().inputField}),e.jsxRuntimeExports.jsx(e.Spacer,{y:6})]}):null,!j("google_domain")&&(s==null?void 0:s.type)==="google"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(l.InputField,{label:"Directory domain",id:"google_domain",value:s.google_domain,handleInputChange:d,classNames:h().inputField}),e.jsxRuntimeExports.jsx(e.Spacer,{y:6})]}):null,!j("google_authorization_url")&&(s==null?void 0:s.type)==="google"&&T()?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(e.InputWithCopyButton,{label:"Google SCIM Authorization url",text:T(),copyDoneCallback:t.successCallback,classNames:h().inputField}),e.jsxRuntimeExports.jsx("div",{id:"scim-authz-hint",className:A.hint,children:"The URL that your tenant needs to authorize the application to access their Google Directory."}),e.jsxRuntimeExports.jsx(e.Spacer,{y:6})]}):null,j("webhook_url")?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(l.InputField,{type:"url",label:"Webhook URL",id:"webhook_url",value:s.webhook_url,handleInputChange:d,classNames:h().inputField}),e.jsxRuntimeExports.jsx(e.Spacer,{y:6})]}),j("webhook_secret")?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(l.SecretInputFormControl,{label:"Webhook secret",id:"webhook_secret",classNames:h().inputField,handleChange:d,value:s.webhook_secret,copyDoneCallback:t.successCallback,required:!1,readOnly:!1}),e.jsxRuntimeExports.jsx(e.Spacer,{y:6})]}),j("log_webhook_events")?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(l.Checkbox,{label:"Enable Webhook events logging",id:"log_webhook_events",name:"log_webhook_events",checked:s==null?void 0:s.log_webhook_events,handleChange:d}),e.jsxRuntimeExports.jsx(e.Spacer,{y:6})]}),e.jsxRuntimeExports.jsxs("div",{className:A.formAction,children:[typeof t.cancelCallback=="function"?e.jsxRuntimeExports.jsx(e.Button,{type:"button",name:"Cancel",variant:"outline",handleClick:t.cancelCallback,classNames:(V=(W=t.classNames)==null?void 0:W.button)==null?void 0:V.cancel}):null,t.hideSave?null:e.jsxRuntimeExports.jsx(e.Button,{type:"submit",name:"Save",variant:"primary",classNames:(G=(B=t.classNames)==null?void 0:B.button)==null?void 0:G.ctoa,isLoading:w})]})]}),e.jsxRuntimeExports.jsxs("section",{className:h().section,children:[e.jsxRuntimeExports.jsxs("div",{className:A.info,children:[e.jsxRuntimeExports.jsx("h6",{className:A.sectionHeading,children:"Delete this directory connection"}),e.jsxRuntimeExports.jsx("p",{className:A.sectionPara,children:"All your apps using this connection will stop working."})]}),c?null:e.jsxRuntimeExports.jsx(e.Button,{name:"Delete",variant:"destructive",type:"button",handleClick:N,classNames:(Z=(J=t.classNames)==null?void 0:J.button)==null?void 0:Z.destructive}),c?e.jsxRuntimeExports.jsx(l.ConfirmationPrompt,{ctoaVariant:"destructive",promptMessage:" Are you sure you want to delete the directory connection? This will permanently delete the directory connection, users, and groups.",classNames:{button:{ctoa:`${(K=(Y=t.classNames)==null?void 0:Y.button)==null?void 0:K.destructive} ${(ee=(X=(Q=t.classNames)==null?void 0:Q.confirmationPrompt)==null?void 0:X.button)==null?void 0:ee.ctoa}`.trim(),cancel:(se=(ne=(te=t.classNames)==null?void 0:te.confirmationPrompt)==null?void 0:ne.button)==null?void 0:se.cancel}},cancelCallback:N,confirmationCallback:C}):null]})]})}const Se="_header_z5rjx_1",Ne="_h5_z5rjx_8",we="_ctoa_z5rjx_15",$={header:Se,h5:Ne,ctoa:we},O={directoryListData:[],view:"LIST",directoryToEdit:{}};function De(t){var C,j,y,R,T;const[c,p]=g.useState(()=>O.directoryListData),[N,w]=g.useState(()=>O.view);function F(a){p(a)}const[_,I]=g.useState(()=>O.directoryToEdit);function s(){let a=t.urls.get;const[o,u]=a.split("?"),k=new URLSearchParams(u);return k.toString()?`${o}/${_.id}?${k}`:`${o}/${_.id}`}function E(){w("CREATE")}function h(a){w("EDIT"),I(a)}function D(a,o){var u,k;a==="edit"?h(o):typeof((k=(u=t.componentProps)==null?void 0:u.directoryList)==null?void 0:k.handleActionClick)=="function"&&t.componentProps.directoryList.handleActionClick("view",o)}function d(){w("LIST")}function r(a){const{connection:o,operation:u}=a;typeof t.successCallback=="function"&&t.successCallback({operation:u,connection:o}),u==="CREATE"?h(o):u!=="COPY"&&d()}return e.jsxRuntimeExports.jsxs("div",{children:[N==="LIST"?e.jsxRuntimeExports.jsxs("div",{className:$.listview,children:[e.jsxRuntimeExports.jsxs("div",{className:$.header,children:[e.jsxRuntimeExports.jsx("h5",{className:$.h5,children:t.title||"Manage DSync Connections"}),e.jsxRuntimeExports.jsx("div",{className:$.ctoa,children:e.jsxRuntimeExports.jsx(e.Button,{name:"New Directory",handleClick:E,classNames:(j=(C=t.classNames)==null?void 0:C.button)==null?void 0:j.ctoa})})]}),e.jsxRuntimeExports.jsx(e.Spacer,{y:8}),e.jsxRuntimeExports.jsx(ie,{...(y=t.componentProps)==null?void 0:y.directoryList,urls:{get:t.urls.get},handleActionClick:D,handleListFetchComplete:F,tenant:t.tenant,product:t.product})]}):null,N==="EDIT"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:$.header,children:e.jsxRuntimeExports.jsx("h5",{className:$.h5,children:"Edit DSync Connection"})}),e.jsxRuntimeExports.jsx(ce,{...(R=t.componentProps)==null?void 0:R.editDirectory,classNames:t.classNames,successCallback:r,errorCallback:t.errorCallback,cancelCallback:d,displayHeader:!1,urls:{patch:`${t.urls.patch}/${_.id}`,delete:`${t.urls.delete}/${_.id}`,get:s()}})]}):null,N==="CREATE"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:$.header,children:e.jsxRuntimeExports.jsx("h5",{className:$.h5,children:"Create DSync Connection"})}),e.jsxRuntimeExports.jsx(e.Spacer,{y:5}),e.jsxRuntimeExports.jsx(oe,{...(T=t.componentProps)==null?void 0:T.createDirectory,classNames:t.classNames,successCallback:r,errorCallback:t.errorCallback,cancelCallback:d,displayHeader:!1,urls:{post:t.urls.post},tenant:t.tenant,product:t.product})]}):null]})}exports.CreateDirectory=oe;exports.DirectoriesWrapper=De;exports.DirectoryList=ie;exports.EditDirectory=ce;
//# sourceMappingURL=dsync.cjs.map