@friggframework/ui 2.0.0--canary.395.65f5f64.0 → 2.0.0--canary.398.24926ac.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +2 -6
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
package/dist/index.umd.js
CHANGED
|
@@ -398,5 +398,5 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann
|
|
|
398
398
|
|
|
399
399
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
400
400
|
|
|
401
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},j1e="DialogDescriptionWarning",L1e=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${pR(j1e).contentName}}.`;return v.useEffect(()=>{var a;const s=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},F1e=eR,V1e=rR,mR=oR,hR=sR,gR=iR,bR=cR,yR=dR;const B1e=F1e,z1e=V1e,U1e=yR,vR=v.forwardRef(({className:e,...t},n)=>w.jsx(mR,{ref:n,className:xt("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));vR.displayName=mR.displayName;const xR=v.forwardRef(({className:e,children:t,...n},r)=>w.jsxs(z1e,{children:[w.jsx(vR,{}),w.jsxs(hR,{ref:r,className:xt("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,w.jsxs(yR,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[w.jsx(Jv,{className:"h-4 w-4"}),w.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));xR.displayName=hR.displayName;const wR=({className:e,...t})=>w.jsx("div",{className:xt("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});wR.displayName="DialogHeader";const CR=({className:e,...t})=>w.jsx("div",{className:xt("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});CR.displayName="DialogFooter";const SR=v.forwardRef(({className:e,...t},n)=>w.jsx(gR,{ref:n,className:xt("text-lg font-semibold leading-none tracking-tight",e),...t}));SR.displayName=gR.displayName;const TR=v.forwardRef(({className:e,...t},n)=>w.jsx(bR,{ref:n,className:xt("text-sm text-muted-foreground",e),...t}));TR.displayName=bR.displayName;const ER=v.forwardRef(({className:e,...t},n)=>w.jsx("div",{className:"relative w-full overflow-auto",children:w.jsx("table",{ref:n,className:xt("w-full caption-bottom text-sm",e),...t})}));ER.displayName="Table";const OR=v.forwardRef(({className:e,...t},n)=>w.jsx("thead",{ref:n,className:xt("[&_tr]:border-b",e),...t}));OR.displayName="TableHeader";const $R=v.forwardRef(({className:e,...t},n)=>w.jsx("tbody",{ref:n,className:xt("[&_tr:last-child]:border-0",e),...t}));$R.displayName="TableBody";const W1e=v.forwardRef(({className:e,...t},n)=>w.jsx("tfoot",{ref:n,className:xt("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));W1e.displayName="TableFooter";const wv=v.forwardRef(({className:e,...t},n)=>w.jsx("tr",{ref:n,className:xt("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));wv.displayName="TableRow";const PR=v.forwardRef(({className:e,...t},n)=>w.jsx("th",{ref:n,className:xt("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));PR.displayName="TableHead";const MR=v.forwardRef(({className:e,...t},n)=>w.jsx("td",{ref:n,className:xt("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));MR.displayName="TableCell";const H1e=v.forwardRef(({className:e,...t},n)=>w.jsx("caption",{ref:n,className:xt("mt-4 text-sm text-muted-foreground",e),...t}));H1e.displayName="TableCaption";const q1e=({friggBaseUrl:e,authToken:t,integrationId:n})=>{const[r,s]=O.useState([]),[a,i]=O.useState([]),{toast:l}=bp();return O.useEffect(()=>{(async()=>{if(t){let d=await new bo(e,t).getSampleData(n);if(d&&d.error){l({variant:"destructive",title:"Oops",description:d.error});return}d.constructor!==Array&&(d=d.data);const f=d&&d.length?Object.keys(d[0]):[],m=f&&f.length?d:[];s(f),i(m)}})()},[t,e,n,l]),r.length>0?w.jsx("div",{className:"m-3 border rounded",children:w.jsxs(ER,{children:[w.jsx(OR,{children:w.jsx(wv,{children:r.map((c,u)=>w.jsx(PR,{children:c},u))})}),w.jsx($R,{children:a.map((c,u)=>w.jsx(wv,{children:Object.values(c).map((d,f)=>w.jsx(MR,{children:`${d}`},f))},u))})]})}):w.jsx("div",{className:"flex w-full justify-center m-5",children:w.jsx("h1",{className:"text-lg",children:"No data available"})})},G1e=({isOpen:e,setOpen:t,friggBaseUrl:n,authToken:r,integrationId:s})=>w.jsx(B1e,{open:e,onOpenChange:t,children:w.jsxs(xR,{children:[w.jsxs(wR,{children:[w.jsx(SR,{children:"Integration Sample Data"}),w.jsx(TR,{children:"See the sample data provided by your integration."})]}),w.jsx("div",{className:"flex items-center space-x-2",children:w.jsx(q1e,{friggBaseUrl:n,authToken:r,integrationId:s})}),w.jsx(CR,{className:"sm:justify-start",children:w.jsx(U1e,{asChild:!0,children:w.jsx(go,{type:"button",variant:"secondary",children:"Close"})})})]})});function Y1e({disconnectIntegration:e,userActions:t,integrationConfiguration:n,integrationId:r,navigateToSampleDataFn:s,friggBaseUrl:a,authToken:i}){const[l,c]=O.useState(!1),[u,d]=O.useState({}),[f,m]=O.useState(!1),b=async()=>{await e()};function h(){c(!1)}async function p(x){if(x.action==="GET_SAMPLE_DATA"){await g();return}y(x)}const g=async()=>{if(s!==void 0){s(r);return}m(!0)};function y(x){c(!0),d({action:x.action,title:x.title,description:x.description})}return w.jsxs(w.Fragment,{children:[w.jsxs(e2,{children:[w.jsx(t2,{children:w.jsx(Xv,{})}),w.jsxs(t0,{children:[w.jsx(n0,{children:w.jsxs("div",{className:"flex",children:[w.jsx(d_,{className:"mr-2 h-4 w-4"})," ",w.jsx("span",{children:"Quick Actions"})]})}),w.jsx(Tu,{}),t.map(x=>w.jsx(Su,{onClick:()=>p(x),children:x.title},x.title)),n&&w.jsxs(w.Fragment,{children:[w.jsx(Tu,{}),w.jsx(Su,{onClick:n,children:"Configure Integration"})]}),w.jsx(Tu,{}),w.jsxs(Su,{onClick:b,className:"text-destructive focus:text-destructive",children:[w.jsx(u_,{className:"mr-2 h-4 w-4"}),w.jsx("p",{children:"Disconnect"})]})]})]}),l?w.jsx(Zk,{closeConfigModal:h,integrationId:r,userActionDetails:u,friggBaseUrl:a,authToken:i}):null,w.jsx(G1e,{isOpen:f,setOpen:m,integrationId:r,friggBaseUrl:a,authToken:i})]})}function K1e(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Cv="Switch",[X1e,T$e]=Uo(Cv),[J1e,Z1e]=X1e(Cv),DR=v.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:a,required:i,disabled:l,value:c="on",onCheckedChange:u,form:d,...f}=e,[m,b]=v.useState(null),h=on(t,C=>b(C)),p=v.useRef(!1),g=m?d||!!m.closest("form"):!0,[y=!1,x]=Bi({prop:s,defaultProp:a,onChange:u});return w.jsxs(J1e,{scope:n,checked:y,disabled:l,children:[w.jsx(kt.button,{type:"button",role:"switch","aria-checked":y,"aria-required":i,"data-state":IR(y),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:h,onClick:qe(e.onClick,C=>{x(S=>!S),g&&(p.current=C.isPropagationStopped(),p.current||C.stopPropagation())})}),g&&w.jsx(Q1e,{control:m,bubbles:!p.current,name:r,value:c,checked:y,required:i,disabled:l,form:d,style:{transform:"translateX(-100%)"}})]})});DR.displayName=Cv;var kR="SwitchThumb",RR=v.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=Z1e(kR,n);return w.jsx(kt.span,{"data-state":IR(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});RR.displayName=kR;var Q1e=e=>{const{control:t,checked:n,bubbles:r=!0,...s}=e,a=v.useRef(null),i=K1e(n),l=Dx(t);return v.useEffect(()=>{const c=a.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(i!==n&&f){const m=new Event("click",{bubbles:r});f.call(c,n),c.dispatchEvent(m)}},[i,n,r]),w.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:a,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function IR(e){return e?"checked":"unchecked"}var _R=DR,eEe=RR;const AR=v.forwardRef(({className:e,...t},n)=>w.jsx(_R,{className:xt("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:w.jsx(eEe,{className:xt("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));AR.displayName=_R.displayName;function NR(e){const{authToken:t,refreshIntegrations:n,friggBaseUrl:r,navigateToSampleDataFn:s}=e,{name:a,description:i,icon:l}=e.data.display,{type:c,status:u,id:d}=e.data,[f,m]=O.useState(!1),[b,h]=O.useState(u),[p,g]=O.useState(!1),[y,x]=O.useState(!1),[C,S]=O.useState([]),T=new bo(r,t);O.useEffect(()=>{e.data.id&&(async()=>{const I=await T.getUserActions(d,"QUICK_ACTION"),k=[];Object.keys(I||{}).map(L=>{k.push({title:I[L].title,description:I[L].description,action:L})}),S(k)})().catch(I=>{console.error(I)})},[]);const P=async()=>{m(!0);const j=await T.getAuthorizeRequirements(c,"");if(j.type==="oauth2"&&(window.location.href=j.url),j.type!=="oauth2"){let I=j.data;for(const k of Object.entries(I.uiSchema))k["ui:widget"]||(k["ui:widget"]="text");$()}};function $(){g(!0)}function M(){g(!1),m(!1)}function N(){x(!0)}function E(){x(!1),m(!1)}const _=async()=>{await T.deleteIntegration(e.data.id),m(!0),h(!1),await n(e),m(!1)};return w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"flex flex-nowrap p-4 bg-white rounded-lg shadow-xs h-[128px]","data-testid":"integration-horizontal",children:[w.jsxs("div",{className:"flex flex-1",children:[w.jsx("img",{className:"mr-3 w-[80px] h-[80px] rounded-lg",alt:a,src:l}),w.jsxs("div",{className:"pr-1 overflow-hidden",children:[w.jsx("p",{className:"w-full text-lg font-semibold text-gray-700 truncate ...",children:a}),w.jsx("p",{className:"pt-2 text-sm font-medium text-gray-600",children:i}),b&&b==="NEEDS_CONFIG"&&w.jsxs("p",{className:"inline-flex pt-2 text-xs font-medium text-orange-500 gap-1",children:[w.jsx(c_,{className:"w-4 h-4"})," Configure"]})]})]}),w.jsx("div",{children:w.jsx("div",{className:"flex flex-col h-full align-items-end",children:b?w.jsxs(w.Fragment,{children:[w.jsx("div",{className:"flex-1",children:w.jsx("label",{htmlFor:a,className:"flex items-center cursor-pointer",children:w.jsx(AR,{name:a,id:a,checked:!0})})}),w.jsx("div",{className:"flex flex-row-reverse",children:w.jsx(Y1e,{userActions:C,integrationConfiguration:N,disconnectIntegration:_,integrationId:d,navigateToSampleDataFn:s,friggBaseUrl:r,authToken:t})})]}):w.jsx(go,{onClick:P,children:f?w.jsx(bs,{}):"Connect"})})})]}),p?w.jsx(T1e,{isAuthModalOpen:p,closeAuthModal:M,refreshIntegrations:n,name:a,type:c,friggBaseUrl:r,authToken:t}):null,y?w.jsx($1e,{isConfigModalOpen:y,closeConfigModal:E,name:a,refreshIntegrations:()=>n(e),integrationId:e.data.id,friggBaseUrl:r,authToken:t}):null]})}function Lo({layout:e}){return w.jsxs(w.Fragment,{children:[e=="default-horizontal"&&w.jsxs("div",{"data-testid":"skeleton-horizontal",className:"flex p-4 bg-gray-200 rounded-lg shadow-xs animate-pulse",children:[w.jsx("div",{className:"mr-4 w-20 h-20 bg-gray-400 rounded-lg overflow-hidden animate-pulse"}),w.jsxs("div",{children:[w.jsx("p",{className:"h-6 w-20 bg-gray-400 animate-pulse"}),w.jsx("p",{className:"mb-2 mt-2 h-4 w-16 bg-gray-400 animate-pulse"})]}),w.jsx("div",{className:"ml-auto",children:w.jsx("div",{className:"relative",children:w.jsx("div",{className:"px-3 py-2 h-10 w-16 bg-gray-400 animate-pulse"})})})]}),e=="default-vertical"&&w.jsxs("div",{"data-testid":"skeleton-vertical",className:"flex flex-col items-center p-4 bg-gray-200 rounded-lg shadow-xs animate-pulse",children:[w.jsx("div",{className:"w-[120px] h-[120px] mt-4 bg-gray-400 rounded-full animate-pulse"}),w.jsx("div",{className:"mt-4 w-36 h-10 bg-gray-400 animate-pulse"}),w.jsx("div",{className:"mb-6 mt-2 w-16 h-6 bg-gray-400 animate-pulse"}),w.jsx("div",{className:"items-center pb-3",children:w.jsx("div",{className:"relative",children:w.jsx("div",{className:"w-40 h-14 bg-gray-400 rounded-lg"})})})]})]})}const tEe=e=>{const t=[],n=nEe(e);return jR(e).forEach(s=>{const a=n.filter(i=>i.type===s.type);a.length>0?a.forEach(i=>{t.push(i)}):t.push(s)}),t},nEe=e=>{const t=[];return e.integrations.forEach(n=>{const r={...n};if(r.entities.length>1){const s=r.entities[1].id,a=rEe(s,e);r.type=a,r.display=oEe(a,e)}t.push(r)}),t},rEe=(e,t)=>{const r=t.entities.authorized.find(s=>s.id===e);if(r)return r.type;throw Error(`getTypeForId() ERR - entityId ${e} does not exist in authorized entities!`)},oEe=(e,t)=>{const r=jR(t).find(s=>s.type===e);if(r)return r.display;throw Error(`getDisplayForType() ERR - type ${e} does not exist in possible integrations!`)},jR=e=>e.entities.options,sEe=e=>{const[t,n]=O.useState([]),[r,s]=O.useState([]),[a,i]=O.useState(!0),l=O.useCallback(async()=>{const m=await new bo(e.friggBaseUrl,e.authToken).listIntegrations();if(m.error&&console.log("Something went wrong while fetching integrations, please try again later."),m.integrations){const b=tEe(m);s(b)}},[e.authToken,e.friggBaseUrl]);O.useEffect(()=>{if(!e.authToken){console.log("Authentication token is required to fetch integrations.");return}l().then(()=>i(!1))},[l,e.authToken]);const c=f=>{const m=[f,...t];n(m)},u=f=>{if(e.componentLayout==="default-horizontal")return w.jsx(NR,{data:f,handleInstall:c,refreshIntegrations:l,friggBaseUrl:e.friggBaseUrl,authToken:e.authToken,navigateToSampleDataFn:e.navigateToSampleDataFn},`combined-integration-${f.type}`);if(e.componentLayout==="default-vertical")return w.jsx(LR,{data:f,handleInstall:c,refreshIntegrations:l,friggBaseUrl:e.friggBaseUrl},`combined-integration-${f.type}`)},d=f=>e.integrationType==="Recently added"?f.map(m=>u(m)):e.integrationType==="Installed"?t.map(m=>u(m)):f.filter(m=>m.display.description===e.integrationType).map(m=>u(m));return w.jsxs(w.Fragment,{children:[a&&w.jsxs("div",{className:"grid gap-6 lg:col-span-1 lg:grid-cols-1 xl:col-span-2 xl:grid-cols-2 2xl:col-span-3 2xl:grid-cols-3 grid-auto-rows-[128px]",children:[w.jsx(Lo,{layout:e.componentLayout}),w.jsx(Lo,{layout:e.componentLayout}),w.jsx(Lo,{layout:e.componentLayout}),w.jsx(Lo,{layout:e.componentLayout}),w.jsx(Lo,{layout:e.componentLayout}),w.jsx(Lo,{layout:e.componentLayout}),w.jsx(Lo,{layout:e.componentLayout}),w.jsx(Lo,{layout:e.componentLayout}),w.jsx(Lo,{layout:e.componentLayout})]}),d(r).length===0?w.jsxs("p",{children:["No ",e.integrationType," integrations found."]}):d(r)]})};function LR(e){const{name:t,description:n,category:r,icon:s}=e.data.display,{hasUserConfig:a,type:i}=e.data,{authToken:l,refreshIntegrations:c}=e,[u,d]=O.useState(!1),[f,m]=O.useState(""),[b,h]=O.useState([]),p=new bo(e.friggBaseUrl,l),g=async()=>{d(!0);const T=await p.getAuthorizeRequirements(i,"");T.type==="oauth2"&&(window.location.href=T.url),T.type!=="oauth2"&&y()},y=()=>{x()},x=()=>{let T;switch(e.data.status){case"NEEDS_CONFIG":T="INITIAL";break;case"ENABLED":T="CONFIGURE";break;default:T="AUTHORIZE"}return T},C=async()=>{alert("Implement sample data fetching logic here")},S=async()=>{await p.deleteIntegration(e.data.id),(await p.listIntegrations()).error||alert("Integration disconnected successfully"),h([]),m("")};return w.jsx(w.Fragment,{children:w.jsxs("div",{className:"flex flex-col items-center p-4 bg-white rounded-lg shadow-xs","data-testid":"integration-vertical",children:[w.jsxs("div",{className:"flex w-full h-[24px]",children:[w.jsx("div",{className:"inline-flex relative mr-auto",children:f&&f==="NEEDS_CONFIG"&&w.jsxs("p",{className:"inline-flex text-xs font-medium text-red-300 text-center",children:[w.jsx(a_,{className:"w-4 h-4 mr-1"})," Configure"]})}),w.jsx("div",{className:"inline-flex relative justify-end ml-auto",children:f&&f==="ENABLED"||f==="NEEDS_CONFIG"&&w.jsx(f_,{getSampleData:C,disconnectIntegration:S,name:t,hasUserConfig:a})})]}),w.jsx("img",{className:"w-[120px] h-[120px] rounded-full",alt:t,src:s}),w.jsxs("div",{className:"pr-1 pt-4 pb-4 overflow-hidden",children:[w.jsx("p",{className:"w-full text-2xl font-semibold text-gray-700 text-center truncate ...",children:t}),w.jsx("p",{className:"w-full pt-2 text-md font-medium text-gray-600 text-center",children:n})]}),w.jsx("div",{className:"items-center pb-3",children:w.jsxs("div",{className:"relative",children:[f&&f==="ENABLED"||f==="NEEDS_CONFIG"&&w.jsx("button",{onClick:S,className:"w-full px-5 py-3 font-medium leading-5 text-center text-primary transition-colors duration-150 rounded-lg border-2 border-purple-400 hover:border-purple-600 hover:bg-purple-600 hover:text-white focus:outline-none focus:shadow-outline-purple",children:"Disconnect"}),!f&&w.jsx(go,{onClick:g,children:u?w.jsx(bs,{}):"Connect"})]})})]})})}const FR="%[a-f0-9]{2}",VR=new RegExp("("+FR+")|([^%]+?)","gi"),BR=new RegExp("("+FR+")+","gi");function Sv(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;t=t||1;const n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],Sv(n),Sv(r))}function aEe(e){try{return decodeURIComponent(e)}catch{let t=e.match(VR)||[];for(let n=1;n<t.length;n++)e=Sv(t,n).join(""),t=e.match(VR)||[];return e}}function iEe(e){const t={"%FE%FF":"��","%FF%FE":"��"};let n=BR.exec(e);for(;n;){try{t[n[0]]=decodeURIComponent(n[0])}catch{const s=aEe(n[0]);s!==n[0]&&(t[n[0]]=s)}n=BR.exec(e)}t["%C2"]="�";const r=Object.keys(t);for(const s of r)e=e.replace(new RegExp(s,"g"),t[s]);return e}function lEe(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return iEe(e)}}function cEe(e,t){const n={};if(Array.isArray(t))for(const r of t){const s=Object.getOwnPropertyDescriptor(e,r);s!=null&&s.enumerable&&Object.defineProperty(n,r,s)}else for(const r of Reflect.ownKeys(e)){const s=Object.getOwnPropertyDescriptor(e,r);if(s.enumerable){const a=e[r];t(r,a,e)&&Object.defineProperty(n,r,s)}}return n}function zR(e,t){if(!(typeof e=="string"&&typeof t=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e===""||t==="")return[];const n=e.indexOf(t);return n===-1?[]:[e.slice(0,n),e.slice(n+t.length)]}const uEe=e=>e==null,dEe=e=>encodeURIComponent(e).replaceAll(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),Tv=Symbol("encodeFragmentIdentifier");function fEe(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const s=n.length;return r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[cn(t,e),"[",s,"]"].join("")]:[...n,[cn(t,e),"[",cn(s,e),"]=",cn(r,e)].join("")]};case"bracket":return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[cn(t,e),"[]"].join("")]:[...n,[cn(t,e),"[]=",cn(r,e)].join("")];case"colon-list-separator":return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[cn(t,e),":list="].join("")]:[...n,[cn(t,e),":list=",cn(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t=e.arrayFormat==="bracket-separator"?"[]=":"=";return n=>(r,s)=>s===void 0||e.skipNull&&s===null||e.skipEmptyString&&s===""?r:(s=s===null?"":s,r.length===0?[[cn(n,e),t,cn(s,e)].join("")]:[[r,cn(s,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,cn(t,e)]:[...n,[cn(t,e),"=",cn(r,e)].join("")]}}function pEe(e){let t;switch(e.arrayFormat){case"index":return(n,r,s)=>{if(t=/\[(\d*)]$/.exec(n),n=n.replace(/\[\d*]$/,""),!t){s[n]=r;return}s[n]===void 0&&(s[n]={}),s[n][t[1]]=r};case"bracket":return(n,r,s)=>{if(t=/(\[])$/.exec(n),n=n.replace(/\[]$/,""),!t){s[n]=r;return}if(s[n]===void 0){s[n]=[r];return}s[n]=[...s[n],r]};case"colon-list-separator":return(n,r,s)=>{if(t=/(:list)$/.exec(n),n=n.replace(/:list$/,""),!t){s[n]=r;return}if(s[n]===void 0){s[n]=[r];return}s[n]=[...s[n],r]};case"comma":case"separator":return(n,r,s)=>{const a=typeof r=="string"&&r.includes(e.arrayFormatSeparator),i=typeof r=="string"&&!a&&Fo(r,e).includes(e.arrayFormatSeparator);r=i?Fo(r,e):r;const l=a||i?r.split(e.arrayFormatSeparator).map(c=>Fo(c,e)):r===null?r:Fo(r,e);s[n]=l};case"bracket-separator":return(n,r,s)=>{const a=/(\[])$/.test(n);if(n=n.replace(/\[]$/,""),!a){s[n]=r&&Fo(r,e);return}const i=r===null?[]:Fo(r,e).split(e.arrayFormatSeparator);if(s[n]===void 0){s[n]=i;return}s[n]=[...s[n],...i]};default:return(n,r,s)=>{if(s[n]===void 0){s[n]=r;return}s[n]=[...[s[n]].flat(),r]}}}function UR(e){if(typeof e!="string"||e.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function cn(e,t){return t.encode?t.strict?dEe(e):encodeURIComponent(e):e}function Fo(e,t){return t.decode?lEe(e):e}function WR(e){return Array.isArray(e)?e.sort():typeof e=="object"?WR(Object.keys(e)).sort((t,n)=>Number(t)-Number(n)).map(t=>e[t]):e}function HR(e){const t=e.indexOf("#");return t!==-1&&(e=e.slice(0,t)),e}function mEe(e){let t="";const n=e.indexOf("#");return n!==-1&&(t=e.slice(n)),t}function qR(e,t,n){return n==="string"&&typeof e=="string"?e:typeof n=="function"&&typeof e=="string"?n(e):t.parseBooleans&&e!==null&&(e.toLowerCase()==="true"||e.toLowerCase()==="false")?e.toLowerCase()==="true":n==="number"&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""||t.parseNumbers&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?Number(e):e}function Ev(e){e=HR(e);const t=e.indexOf("?");return t===-1?"":e.slice(t+1)}function Ov(e,t){t={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,types:Object.create(null),...t},UR(t.arrayFormatSeparator);const n=pEe(t),r=Object.create(null);if(typeof e!="string"||(e=e.trim().replace(/^[?#&]/,""),!e))return r;for(const s of e.split("&")){if(s==="")continue;const a=t.decode?s.replaceAll("+"," "):s;let[i,l]=zR(a,"=");i===void 0&&(i=a),l=l===void 0?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?l:Fo(l,t),n(Fo(i,t),l,r)}for(const[s,a]of Object.entries(r))if(typeof a=="object"&&a!==null&&t.types[s]!=="string")for(const[i,l]of Object.entries(a)){const c=t.types[s]?t.types[s].replace("[]",""):void 0;a[i]=qR(l,t,c)}else typeof a=="object"&&a!==null&&t.types[s]==="string"?r[s]=Object.values(a).join(t.arrayFormatSeparator):r[s]=qR(a,t,t.types[s]);return t.sort===!1?r:(t.sort===!0?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce((s,a)=>{const i=r[a];return s[a]=i&&typeof i=="object"&&!Array.isArray(i)?WR(i):i,s},Object.create(null))}function GR(e,t){if(!e)return"";t={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...t},UR(t.arrayFormatSeparator);const n=i=>t.skipNull&&uEe(e[i])||t.skipEmptyString&&e[i]==="",r=fEe(t),s={};for(const[i,l]of Object.entries(e))n(i)||(s[i]=l);const a=Object.keys(s);return t.sort!==!1&&a.sort(t.sort),a.map(i=>{const l=e[i];return l===void 0?"":l===null?cn(i,t):Array.isArray(l)?l.length===0&&t.arrayFormat==="bracket-separator"?cn(i,t)+"[]":l.reduce(r(i),[]).join("&"):cn(i,t)+"="+cn(l,t)}).filter(i=>i.length>0).join("&")}function YR(e,t){var s;t={decode:!0,...t};let[n,r]=zR(e,"#");return n===void 0&&(n=e),{url:((s=n==null?void 0:n.split("?"))==null?void 0:s[0])??"",query:Ov(Ev(e),t),...t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:Fo(r,t)}:{}}}function KR(e,t){t={encode:!0,strict:!0,[Tv]:!0,...t};const n=HR(e.url).split("?")[0]||"",r=Ev(e.url),s={...Ov(r,{sort:!1}),...e.query};let a=GR(s,t);a&&(a=`?${a}`);let i=mEe(e.url);if(typeof e.fragmentIdentifier=="string"){const l=new URL(n);l.hash=e.fragmentIdentifier,i=t[Tv]?l.hash:`#${e.fragmentIdentifier}`}return`${n}${a}${i}`}function XR(e,t,n){n={parseFragmentIdentifier:!0,[Tv]:!1,...n};const{url:r,query:s,fragmentIdentifier:a}=YR(e,n);return KR({url:r,query:cEe(s,t),fragmentIdentifier:a},n)}function hEe(e,t,n){const r=Array.isArray(t)?s=>!t.includes(s):(s,a)=>!t(s,a);return XR(e,r,n)}const gEe=Object.freeze(Object.defineProperty({__proto__:null,exclude:hEe,extract:Ev,parse:Ov,parseUrl:YR,pick:XR,stringify:GR,stringifyUrl:KR},Symbol.toStringTag,{value:"Module"})),bEe=e=>(O.useEffect(()=>{(async()=>{const n=new bo(e.friggBaseUrl,e.authToken),r=gEe.parse(window.location.search);if(r.code){const s=await n.authorize(e.app,{code:r.code}),a=await n.listIntegrations();if(s!=null&&s.error){alert(s.error),e.redirectToUrl();return}const i={type:e.app,category:"CRM"},l=a.entities.authorized.find(u=>u.type===e.primaryEntityName),c=await n.createIntegration(l.id??s.entity_id,s.entity_id,i);if(c.error){alert(c.error);return}e.redirectToUrl()}})()},[]),w.jsx("div",{className:"flex items-center justify-center h-screen w-screen",children:w.jsx(bs,{})}));var yEe="VisuallyHidden",$v=v.forwardRef((e,t)=>w.jsx(kt.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));$v.displayName=yEe;var vEe="ToastProvider",[JR,xEe,wEe]=Mp("Toast"),[ZR,E$e]=Uo("Toast",[wEe]),[O$e,vp]=ZR(vEe),QR="ToastViewport",CEe=["F8"],Pv="toast.viewportPause",Mv="toast.viewportResume",eI=v.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=CEe,label:s="Notifications ({hotkey})",...a}=e,i=vp(QR,n),l=xEe(n),c=v.useRef(null),u=v.useRef(null),d=v.useRef(null),f=v.useRef(null),m=on(t,f,i.onViewportChange),b=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),h=i.toastCount>0;v.useEffect(()=>{const g=y=>{var C;r.length!==0&&r.every(S=>y[S]||y.code===S)&&((C=f.current)==null||C.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[r]),v.useEffect(()=>{const g=c.current,y=f.current;if(h&&g&&y){const x=()=>{if(!i.isClosePausedRef.current){const P=new CustomEvent(Pv);y.dispatchEvent(P),i.isClosePausedRef.current=!0}},C=()=>{if(i.isClosePausedRef.current){const P=new CustomEvent(Mv);y.dispatchEvent(P),i.isClosePausedRef.current=!1}},S=P=>{!g.contains(P.relatedTarget)&&C()},T=()=>{g.contains(document.activeElement)||C()};return g.addEventListener("focusin",x),g.addEventListener("focusout",S),g.addEventListener("pointermove",x),g.addEventListener("pointerleave",T),window.addEventListener("blur",x),window.addEventListener("focus",C),()=>{g.removeEventListener("focusin",x),g.removeEventListener("focusout",S),g.removeEventListener("pointermove",x),g.removeEventListener("pointerleave",T),window.removeEventListener("blur",x),window.removeEventListener("focus",C)}}},[h,i.isClosePausedRef]);const p=v.useCallback(({tabbingDirection:g})=>{const x=l().map(C=>{const S=C.ref.current,T=[S,...AEe(S)];return g==="forwards"?T:T.reverse()});return(g==="forwards"?x.reverse():x).flat()},[l]);return v.useEffect(()=>{const g=f.current;if(g){const y=x=>{var T,P,$;const C=x.altKey||x.ctrlKey||x.metaKey;if(x.key==="Tab"&&!C){const M=document.activeElement,N=x.shiftKey;if(x.target===g&&N){(T=u.current)==null||T.focus();return}const j=p({tabbingDirection:N?"backwards":"forwards"}),I=j.findIndex(k=>k===M);Rv(j.slice(I+1))?x.preventDefault():N?(P=u.current)==null||P.focus():($=d.current)==null||$.focus()}};return g.addEventListener("keydown",y),()=>g.removeEventListener("keydown",y)}},[l,p]),w.jsxs(O_,{ref:c,role:"region","aria-label":s.replace("{hotkey}",b),tabIndex:-1,style:{pointerEvents:h?void 0:"none"},children:[h&&w.jsx(Dv,{ref:u,onFocusFromOutsideViewport:()=>{const g=p({tabbingDirection:"forwards"});Rv(g)}}),w.jsx(JR.Slot,{scope:n,children:w.jsx(kt.ol,{tabIndex:-1,...a,ref:m})}),h&&w.jsx(Dv,{ref:d,onFocusFromOutsideViewport:()=>{const g=p({tabbingDirection:"backwards"});Rv(g)}})]})});eI.displayName=QR;var tI="ToastFocusProxy",Dv=v.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=e,a=vp(tI,n);return w.jsx($v,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:i=>{var u;const l=i.relatedTarget;!((u=a.viewport)!=null&&u.contains(l))&&r()}})});Dv.displayName=tI;var xp="Toast",SEe="toast.swipeStart",TEe="toast.swipeMove",EEe="toast.swipeCancel",OEe="toast.swipeEnd",nI=v.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:a,...i}=e,[l=!0,c]=Bi({prop:r,defaultProp:s,onChange:a});return w.jsx(xo,{present:n||l,children:w.jsx(MEe,{open:l,...i,ref:t,onClose:()=>c(!1),onPause:kn(e.onPause),onResume:kn(e.onResume),onSwipeStart:qe(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:qe(e.onSwipeMove,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:qe(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:qe(e.onSwipeEnd,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),c(!1)})})})});nI.displayName=xp;var[$Ee,PEe]=ZR(xp,{onClose(){}}),MEe=v.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:a,onClose:i,onEscapeKeyDown:l,onPause:c,onResume:u,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:m,onSwipeEnd:b,...h}=e,p=vp(xp,n),[g,y]=v.useState(null),x=on(t,k=>y(k)),C=v.useRef(null),S=v.useRef(null),T=s||p.duration,P=v.useRef(0),$=v.useRef(T),M=v.useRef(0),{onToastAdd:N,onToastRemove:E}=p,_=kn(()=>{var L;(g==null?void 0:g.contains(document.activeElement))&&((L=p.viewport)==null||L.focus()),i()}),j=v.useCallback(k=>{!k||k===1/0||(window.clearTimeout(M.current),P.current=new Date().getTime(),M.current=window.setTimeout(_,k))},[_]);v.useEffect(()=>{const k=p.viewport;if(k){const L=()=>{j($.current),u==null||u()},V=()=>{const q=new Date().getTime()-P.current;$.current=$.current-q,window.clearTimeout(M.current),c==null||c()};return k.addEventListener(Pv,V),k.addEventListener(Mv,L),()=>{k.removeEventListener(Pv,V),k.removeEventListener(Mv,L)}}},[p.viewport,T,c,u,j]),v.useEffect(()=>{a&&!p.isClosePausedRef.current&&j(T)},[a,T,p.isClosePausedRef,j]),v.useEffect(()=>(N(),()=>E()),[N,E]);const I=v.useMemo(()=>g?cI(g):null,[g]);return p.viewport?w.jsxs(w.Fragment,{children:[I&&w.jsx(DEe,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:I}),w.jsx($Ee,{scope:n,onClose:_,children:Jc.createPortal(w.jsx(JR.ItemSlot,{scope:n,children:w.jsx(E_,{asChild:!0,onEscapeKeyDown:qe(l,()=>{p.isFocusedToastEscapeKeyDownRef.current||_(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:w.jsx(kt.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":p.swipeDirection,...h,ref:x,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:qe(e.onKeyDown,k=>{k.key==="Escape"&&(l==null||l(k.nativeEvent),k.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,_()))}),onPointerDown:qe(e.onPointerDown,k=>{k.button===0&&(C.current={x:k.clientX,y:k.clientY})}),onPointerMove:qe(e.onPointerMove,k=>{if(!C.current)return;const L=k.clientX-C.current.x,V=k.clientY-C.current.y,q=!!S.current,K=["left","right"].includes(p.swipeDirection),H=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,B=K?H(0,L):0,A=K?0:H(0,V),X=k.pointerType==="touch"?10:2,z={x:B,y:A},D={originalEvent:k,delta:z};q?(S.current=z,wp(TEe,f,D,{discrete:!1})):uI(z,p.swipeDirection,X)?(S.current=z,wp(SEe,d,D,{discrete:!1}),k.target.setPointerCapture(k.pointerId)):(Math.abs(L)>X||Math.abs(V)>X)&&(C.current=null)}),onPointerUp:qe(e.onPointerUp,k=>{const L=S.current,V=k.target;if(V.hasPointerCapture(k.pointerId)&&V.releasePointerCapture(k.pointerId),S.current=null,C.current=null,L){const q=k.currentTarget,K={originalEvent:k,delta:L};uI(L,p.swipeDirection,p.swipeThreshold)?wp(OEe,b,K,{discrete:!0}):wp(EEe,m,K,{discrete:!0}),q.addEventListener("click",H=>H.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),DEe=e=>{const{__scopeToast:t,children:n,...r}=e,s=vp(xp,t),[a,i]=v.useState(!1),[l,c]=v.useState(!1);return IEe(()=>i(!0)),v.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),l?null:w.jsx(cu,{asChild:!0,children:w.jsx($v,{...r,children:a&&w.jsxs(w.Fragment,{children:[s.label," ",n]})})})},kEe="ToastTitle",rI=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return w.jsx(kt.div,{...r,ref:t})});rI.displayName=kEe;var REe="ToastDescription",oI=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return w.jsx(kt.div,{...r,ref:t})});oI.displayName=REe;var sI="ToastAction",aI=v.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?w.jsx(lI,{altText:n,asChild:!0,children:w.jsx(kv,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${sI}\`. Expected non-empty \`string\`.`),null)});aI.displayName=sI;var iI="ToastClose",kv=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,s=PEe(iI,n);return w.jsx(lI,{asChild:!0,children:w.jsx(kt.button,{type:"button",...r,ref:t,onClick:qe(e.onClick,s.onClose)})})});kv.displayName=iI;var lI=v.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...s}=e;return w.jsx(kt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:t})});function cI(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),_Ee(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",a=r.dataset.radixToastAnnounceExclude==="";if(!s)if(a){const i=r.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...cI(r))}}),t}function wp(e,t,n,{discrete:r}){const s=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?Pp(s,a):s.dispatchEvent(a)}var uI=(e,t,n=0)=>{const r=Math.abs(e.x),s=Math.abs(e.y),a=r>s;return t==="left"||t==="right"?a&&r>n:!a&&s>n};function IEe(e=()=>{}){const t=kn(e);Ho(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function _Ee(e){return e.nodeType===e.ELEMENT_NODE}function AEe(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Rv(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var dI=eI,fI=nI,pI=rI,mI=oI,hI=aI,gI=kv;const NEe=v.forwardRef(({className:e,...t},n)=>w.jsx(dI,{ref:n,className:xt("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));NEe.displayName=dI.displayName;const jEe=Vv("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),LEe=v.forwardRef(({className:e,variant:t,...n},r)=>w.jsx(fI,{ref:r,className:xt(jEe({variant:t}),e),...n}));LEe.displayName=fI.displayName;const FEe=v.forwardRef(({className:e,...t},n)=>w.jsx(hI,{ref:n,className:xt("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));FEe.displayName=hI.displayName;const VEe=v.forwardRef(({className:e,...t},n)=>w.jsx(gI,{ref:n,className:xt("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:w.jsx(Jv,{className:"h-4 w-4"})}));VEe.displayName=gI.displayName;const BEe=v.forwardRef(({className:e,...t},n)=>w.jsx(pI,{ref:n,className:xt("text-sm font-semibold",e),...t}));BEe.displayName=pI.displayName;const zEe=v.forwardRef(({className:e,...t},n)=>w.jsx(mI,{ref:n,className:xt("text-sm opacity-90",e),...t}));zEe.displayName=mI.displayName,Qt.Button=go,Qt.Input=Yv,Qt.IntegrationHorizontal=NR,Qt.IntegrationList=sEe,Qt.IntegrationVertical=LR,Qt.LoadingSpinner=bs,Qt.RedirectFromAuth=bEe,Qt.UserActionModal=Zk,Object.defineProperty(Qt,Symbol.toStringTag,{value:"Module"})});
|
|
401
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},j1e="DialogDescriptionWarning",L1e=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${pR(j1e).contentName}}.`;return v.useEffect(()=>{var a;const s=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},F1e=eR,V1e=rR,mR=oR,hR=sR,gR=iR,bR=cR,yR=dR;const B1e=F1e,z1e=V1e,U1e=yR,vR=v.forwardRef(({className:e,...t},n)=>w.jsx(mR,{ref:n,className:xt("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));vR.displayName=mR.displayName;const xR=v.forwardRef(({className:e,children:t,...n},r)=>w.jsxs(z1e,{children:[w.jsx(vR,{}),w.jsxs(hR,{ref:r,className:xt("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,w.jsxs(yR,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[w.jsx(Jv,{className:"h-4 w-4"}),w.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));xR.displayName=hR.displayName;const wR=({className:e,...t})=>w.jsx("div",{className:xt("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});wR.displayName="DialogHeader";const CR=({className:e,...t})=>w.jsx("div",{className:xt("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});CR.displayName="DialogFooter";const SR=v.forwardRef(({className:e,...t},n)=>w.jsx(gR,{ref:n,className:xt("text-lg font-semibold leading-none tracking-tight",e),...t}));SR.displayName=gR.displayName;const TR=v.forwardRef(({className:e,...t},n)=>w.jsx(bR,{ref:n,className:xt("text-sm text-muted-foreground",e),...t}));TR.displayName=bR.displayName;const ER=v.forwardRef(({className:e,...t},n)=>w.jsx("div",{className:"relative w-full overflow-auto",children:w.jsx("table",{ref:n,className:xt("w-full caption-bottom text-sm",e),...t})}));ER.displayName="Table";const OR=v.forwardRef(({className:e,...t},n)=>w.jsx("thead",{ref:n,className:xt("[&_tr]:border-b",e),...t}));OR.displayName="TableHeader";const $R=v.forwardRef(({className:e,...t},n)=>w.jsx("tbody",{ref:n,className:xt("[&_tr:last-child]:border-0",e),...t}));$R.displayName="TableBody";const W1e=v.forwardRef(({className:e,...t},n)=>w.jsx("tfoot",{ref:n,className:xt("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));W1e.displayName="TableFooter";const wv=v.forwardRef(({className:e,...t},n)=>w.jsx("tr",{ref:n,className:xt("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));wv.displayName="TableRow";const PR=v.forwardRef(({className:e,...t},n)=>w.jsx("th",{ref:n,className:xt("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));PR.displayName="TableHead";const MR=v.forwardRef(({className:e,...t},n)=>w.jsx("td",{ref:n,className:xt("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));MR.displayName="TableCell";const H1e=v.forwardRef(({className:e,...t},n)=>w.jsx("caption",{ref:n,className:xt("mt-4 text-sm text-muted-foreground",e),...t}));H1e.displayName="TableCaption";const q1e=({friggBaseUrl:e,authToken:t,integrationId:n})=>{const[r,s]=O.useState([]),[a,i]=O.useState([]),{toast:l}=bp();return O.useEffect(()=>{(async()=>{if(t){let d=await new bo(e,t).getSampleData(n);if(d&&d.error){l({variant:"destructive",title:"Oops",description:d.error});return}d.constructor!==Array&&(d=d.data);const f=d&&d.length?Object.keys(d[0]):[],m=f&&f.length?d:[];s(f),i(m)}})()},[t,e,n,l]),r.length>0?w.jsx("div",{className:"m-3 border rounded",children:w.jsxs(ER,{children:[w.jsx(OR,{children:w.jsx(wv,{children:r.map((c,u)=>w.jsx(PR,{children:c},u))})}),w.jsx($R,{children:a.map((c,u)=>w.jsx(wv,{children:Object.values(c).map((d,f)=>w.jsx(MR,{children:`${d}`},f))},u))})]})}):w.jsx("div",{className:"flex w-full justify-center m-5",children:w.jsx("h1",{className:"text-lg",children:"No data available"})})},G1e=({isOpen:e,setOpen:t,friggBaseUrl:n,authToken:r,integrationId:s})=>w.jsx(B1e,{open:e,onOpenChange:t,children:w.jsxs(xR,{children:[w.jsxs(wR,{children:[w.jsx(SR,{children:"Integration Sample Data"}),w.jsx(TR,{children:"See the sample data provided by your integration."})]}),w.jsx("div",{className:"flex items-center space-x-2",children:w.jsx(q1e,{friggBaseUrl:n,authToken:r,integrationId:s})}),w.jsx(CR,{className:"sm:justify-start",children:w.jsx(U1e,{asChild:!0,children:w.jsx(go,{type:"button",variant:"secondary",children:"Close"})})})]})});function Y1e({disconnectIntegration:e,userActions:t,integrationConfiguration:n,integrationId:r,navigateToSampleDataFn:s,friggBaseUrl:a,authToken:i}){const[l,c]=O.useState(!1),[u,d]=O.useState({}),[f,m]=O.useState(!1),b=async()=>{await e()};function h(){c(!1)}async function p(x){if(x.action==="GET_SAMPLE_DATA"){await g();return}y(x)}const g=async()=>{if(s!==void 0){s(r);return}m(!0)};function y(x){c(!0),d({action:x.action,title:x.title,description:x.description})}return w.jsxs(w.Fragment,{children:[w.jsxs(e2,{children:[w.jsx(t2,{children:w.jsx(Xv,{})}),w.jsxs(t0,{children:[w.jsx(n0,{children:w.jsxs("div",{className:"flex",children:[w.jsx(d_,{className:"mr-2 h-4 w-4"})," ",w.jsx("span",{children:"Quick Actions"})]})}),w.jsx(Tu,{}),t.map(x=>w.jsx(Su,{onClick:()=>p(x),children:x.title},x.title)),n&&w.jsxs(w.Fragment,{children:[w.jsx(Tu,{}),w.jsx(Su,{onClick:n,children:"Configure Integration"})]}),w.jsx(Tu,{}),w.jsxs(Su,{onClick:b,className:"text-destructive focus:text-destructive",children:[w.jsx(u_,{className:"mr-2 h-4 w-4"}),w.jsx("p",{children:"Disconnect"})]})]})]}),l?w.jsx(Zk,{closeConfigModal:h,integrationId:r,userActionDetails:u,friggBaseUrl:a,authToken:i}):null,w.jsx(G1e,{isOpen:f,setOpen:m,integrationId:r,friggBaseUrl:a,authToken:i})]})}function K1e(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Cv="Switch",[X1e,T$e]=Uo(Cv),[J1e,Z1e]=X1e(Cv),DR=v.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:a,required:i,disabled:l,value:c="on",onCheckedChange:u,form:d,...f}=e,[m,b]=v.useState(null),h=on(t,C=>b(C)),p=v.useRef(!1),g=m?d||!!m.closest("form"):!0,[y=!1,x]=Bi({prop:s,defaultProp:a,onChange:u});return w.jsxs(J1e,{scope:n,checked:y,disabled:l,children:[w.jsx(kt.button,{type:"button",role:"switch","aria-checked":y,"aria-required":i,"data-state":IR(y),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:h,onClick:qe(e.onClick,C=>{x(S=>!S),g&&(p.current=C.isPropagationStopped(),p.current||C.stopPropagation())})}),g&&w.jsx(Q1e,{control:m,bubbles:!p.current,name:r,value:c,checked:y,required:i,disabled:l,form:d,style:{transform:"translateX(-100%)"}})]})});DR.displayName=Cv;var kR="SwitchThumb",RR=v.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=Z1e(kR,n);return w.jsx(kt.span,{"data-state":IR(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});RR.displayName=kR;var Q1e=e=>{const{control:t,checked:n,bubbles:r=!0,...s}=e,a=v.useRef(null),i=K1e(n),l=Dx(t);return v.useEffect(()=>{const c=a.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(i!==n&&f){const m=new Event("click",{bubbles:r});f.call(c,n),c.dispatchEvent(m)}},[i,n,r]),w.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:a,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function IR(e){return e?"checked":"unchecked"}var _R=DR,eEe=RR;const AR=v.forwardRef(({className:e,...t},n)=>w.jsx(_R,{className:xt("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:w.jsx(eEe,{className:xt("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));AR.displayName=_R.displayName;function NR(e){const{authToken:t,refreshIntegrations:n,friggBaseUrl:r,navigateToSampleDataFn:s}=e,{name:a,description:i,icon:l}=e.data.display,{type:c,status:u,id:d}=e.data,[f,m]=O.useState(!1),[b,h]=O.useState(u),[p,g]=O.useState(!1),[y,x]=O.useState(!1),[C,S]=O.useState([]),T=new bo(r,t);O.useEffect(()=>{e.data.id&&(async()=>{const I=await T.getUserActions(d,"QUICK_ACTION"),k=[];Object.keys(I||{}).map(L=>{k.push({title:I[L].title,description:I[L].description,action:L})}),S(k)})().catch(I=>{console.error(I)})},[]);const P=async()=>{m(!0);const j=await T.getAuthorizeRequirements(c,"");if(j.type==="oauth2"&&(window.location.href=j.url),j.type!=="oauth2"){let I=j.data;for(const k of Object.entries(I.uiSchema))k["ui:widget"]||(k["ui:widget"]="text");$()}};function $(){g(!0)}function M(){g(!1),m(!1)}function N(){x(!0)}function E(){x(!1),m(!1)}const _=async()=>{await T.deleteIntegration(e.data.id),m(!0),h(!1),await n(e),m(!1)};return w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"flex flex-nowrap p-4 bg-white rounded-lg shadow-xs h-[128px]","data-testid":"integration-horizontal",children:[w.jsxs("div",{className:"flex flex-1",children:[w.jsx("img",{className:"mr-3 w-[80px] h-[80px] rounded-lg",alt:a,src:l}),w.jsxs("div",{className:"pr-1 overflow-hidden",children:[w.jsx("p",{className:"w-full text-lg font-semibold text-gray-700 truncate ...",children:a}),w.jsx("p",{className:"pt-2 text-sm font-medium text-gray-600",children:i}),b&&b==="NEEDS_CONFIG"&&w.jsxs("p",{className:"inline-flex pt-2 text-xs font-medium text-orange-500 gap-1",children:[w.jsx(c_,{className:"w-4 h-4"})," Configure"]})]})]}),w.jsx("div",{children:w.jsx("div",{className:"flex flex-col h-full align-items-end",children:b?w.jsxs(w.Fragment,{children:[w.jsx("div",{className:"flex-1",children:w.jsx("label",{htmlFor:a,className:"flex items-center cursor-pointer",children:w.jsx(AR,{name:a,id:a,checked:!0})})}),w.jsx("div",{className:"flex flex-row-reverse",children:w.jsx(Y1e,{userActions:C,integrationConfiguration:N,disconnectIntegration:_,integrationId:d,navigateToSampleDataFn:s,friggBaseUrl:r,authToken:t})})]}):w.jsx(go,{onClick:P,children:f?w.jsx(bs,{}):"Connect"})})})]}),p?w.jsx(T1e,{isAuthModalOpen:p,closeAuthModal:M,refreshIntegrations:n,name:a,type:c,friggBaseUrl:r,authToken:t}):null,y?w.jsx($1e,{isConfigModalOpen:y,closeConfigModal:E,name:a,refreshIntegrations:()=>n(e),integrationId:e.data.id,friggBaseUrl:r,authToken:t}):null]})}function Lo({layout:e}){return w.jsxs(w.Fragment,{children:[e=="default-horizontal"&&w.jsxs("div",{"data-testid":"skeleton-horizontal",className:"flex p-4 bg-gray-200 rounded-lg shadow-xs animate-pulse",children:[w.jsx("div",{className:"mr-4 w-20 h-20 bg-gray-400 rounded-lg overflow-hidden animate-pulse"}),w.jsxs("div",{children:[w.jsx("p",{className:"h-6 w-20 bg-gray-400 animate-pulse"}),w.jsx("p",{className:"mb-2 mt-2 h-4 w-16 bg-gray-400 animate-pulse"})]}),w.jsx("div",{className:"ml-auto",children:w.jsx("div",{className:"relative",children:w.jsx("div",{className:"px-3 py-2 h-10 w-16 bg-gray-400 animate-pulse"})})})]}),e=="default-vertical"&&w.jsxs("div",{"data-testid":"skeleton-vertical",className:"flex flex-col items-center p-4 bg-gray-200 rounded-lg shadow-xs animate-pulse",children:[w.jsx("div",{className:"w-[120px] h-[120px] mt-4 bg-gray-400 rounded-full animate-pulse"}),w.jsx("div",{className:"mt-4 w-36 h-10 bg-gray-400 animate-pulse"}),w.jsx("div",{className:"mb-6 mt-2 w-16 h-6 bg-gray-400 animate-pulse"}),w.jsx("div",{className:"items-center pb-3",children:w.jsx("div",{className:"relative",children:w.jsx("div",{className:"w-40 h-14 bg-gray-400 rounded-lg"})})})]})]})}const tEe=e=>{const t=[],n=nEe(e);return jR(e).forEach(s=>{const a=n.filter(i=>i.type===s.type);a.length>0?a.forEach(i=>{t.push(i)}):t.push(s)}),t},nEe=e=>{const t=[];return e.integrations.forEach(n=>{const r={...n},s=r.entities[1].id,a=rEe(s,e);r.type=a,r.display=oEe(a,e),t.push(r)}),t},rEe=(e,t)=>{const r=t.entities.authorized.find(s=>s.id===e);if(r)return r.type;throw Error(`getTypeForId() ERR - entityId ${e} does not exist in authorized entities!`)},oEe=(e,t)=>{const r=jR(t).find(s=>s.type===e);if(r)return r.display;throw Error(`getDisplayForType() ERR - type ${e} does not exist in possible integrations!`)},jR=e=>e.entities.options,sEe=e=>{const[t,n]=O.useState([]),[r,s]=O.useState([]),[a,i]=O.useState(!0),l=O.useCallback(async()=>{const m=await new bo(e.friggBaseUrl,e.authToken).listIntegrations();if(m.error&&console.log("Something went wrong while fetching integrations, please try again later."),m.integrations){const b=tEe(m);s(b)}},[e.authToken,e.friggBaseUrl]);O.useEffect(()=>{if(!e.authToken){console.log("Authentication token is required to fetch integrations.");return}l().then(()=>i(!1))},[l,e.authToken]);const c=f=>{const m=[f,...t];n(m)},u=f=>{if(e.componentLayout==="default-horizontal")return w.jsx(NR,{data:f,handleInstall:c,refreshIntegrations:l,friggBaseUrl:e.friggBaseUrl,authToken:e.authToken,navigateToSampleDataFn:e.navigateToSampleDataFn},`combined-integration-${f.type}`);if(e.componentLayout==="default-vertical")return w.jsx(LR,{data:f,handleInstall:c,refreshIntegrations:l,friggBaseUrl:e.friggBaseUrl},`combined-integration-${f.type}`)},d=f=>e.integrationType==="Recently added"?f.map(m=>u(m)):e.integrationType==="Installed"?t.map(m=>u(m)):f.filter(m=>m.display.description===e.integrationType).map(m=>u(m));return w.jsxs(w.Fragment,{children:[a&&w.jsxs("div",{className:"grid gap-6 lg:col-span-1 lg:grid-cols-1 xl:col-span-2 xl:grid-cols-2 2xl:col-span-3 2xl:grid-cols-3 grid-auto-rows-[128px]",children:[w.jsx(Lo,{layout:e.componentLayout}),w.jsx(Lo,{layout:e.componentLayout}),w.jsx(Lo,{layout:e.componentLayout}),w.jsx(Lo,{layout:e.componentLayout}),w.jsx(Lo,{layout:e.componentLayout}),w.jsx(Lo,{layout:e.componentLayout}),w.jsx(Lo,{layout:e.componentLayout}),w.jsx(Lo,{layout:e.componentLayout}),w.jsx(Lo,{layout:e.componentLayout})]}),d(r).length===0?w.jsxs("p",{children:["No ",e.integrationType," integrations found."]}):d(r)]})};function LR(e){const{name:t,description:n,category:r,icon:s}=e.data.display,{hasUserConfig:a,type:i}=e.data,{authToken:l,refreshIntegrations:c}=e,[u,d]=O.useState(!1),[f,m]=O.useState(""),[b,h]=O.useState([]),p=new bo(e.friggBaseUrl,l),g=async()=>{d(!0);const T=await p.getAuthorizeRequirements(i,"");T.type==="oauth2"&&(window.location.href=T.url),T.type!=="oauth2"&&y()},y=()=>{x()},x=()=>{let T;switch(e.data.status){case"NEEDS_CONFIG":T="INITIAL";break;case"ENABLED":T="CONFIGURE";break;default:T="AUTHORIZE"}return T},C=async()=>{alert("Implement sample data fetching logic here")},S=async()=>{await p.deleteIntegration(e.data.id),(await p.listIntegrations()).error||alert("Integration disconnected successfully"),h([]),m("")};return w.jsx(w.Fragment,{children:w.jsxs("div",{className:"flex flex-col items-center p-4 bg-white rounded-lg shadow-xs","data-testid":"integration-vertical",children:[w.jsxs("div",{className:"flex w-full h-[24px]",children:[w.jsx("div",{className:"inline-flex relative mr-auto",children:f&&f==="NEEDS_CONFIG"&&w.jsxs("p",{className:"inline-flex text-xs font-medium text-red-300 text-center",children:[w.jsx(a_,{className:"w-4 h-4 mr-1"})," Configure"]})}),w.jsx("div",{className:"inline-flex relative justify-end ml-auto",children:f&&f==="ENABLED"||f==="NEEDS_CONFIG"&&w.jsx(f_,{getSampleData:C,disconnectIntegration:S,name:t,hasUserConfig:a})})]}),w.jsx("img",{className:"w-[120px] h-[120px] rounded-full",alt:t,src:s}),w.jsxs("div",{className:"pr-1 pt-4 pb-4 overflow-hidden",children:[w.jsx("p",{className:"w-full text-2xl font-semibold text-gray-700 text-center truncate ...",children:t}),w.jsx("p",{className:"w-full pt-2 text-md font-medium text-gray-600 text-center",children:n})]}),w.jsx("div",{className:"items-center pb-3",children:w.jsxs("div",{className:"relative",children:[f&&f==="ENABLED"||f==="NEEDS_CONFIG"&&w.jsx("button",{onClick:S,className:"w-full px-5 py-3 font-medium leading-5 text-center text-primary transition-colors duration-150 rounded-lg border-2 border-purple-400 hover:border-purple-600 hover:bg-purple-600 hover:text-white focus:outline-none focus:shadow-outline-purple",children:"Disconnect"}),!f&&w.jsx(go,{onClick:g,children:u?w.jsx(bs,{}):"Connect"})]})})]})})}const FR="%[a-f0-9]{2}",VR=new RegExp("("+FR+")|([^%]+?)","gi"),BR=new RegExp("("+FR+")+","gi");function Sv(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;t=t||1;const n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],Sv(n),Sv(r))}function aEe(e){try{return decodeURIComponent(e)}catch{let t=e.match(VR)||[];for(let n=1;n<t.length;n++)e=Sv(t,n).join(""),t=e.match(VR)||[];return e}}function iEe(e){const t={"%FE%FF":"��","%FF%FE":"��"};let n=BR.exec(e);for(;n;){try{t[n[0]]=decodeURIComponent(n[0])}catch{const s=aEe(n[0]);s!==n[0]&&(t[n[0]]=s)}n=BR.exec(e)}t["%C2"]="�";const r=Object.keys(t);for(const s of r)e=e.replace(new RegExp(s,"g"),t[s]);return e}function lEe(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return iEe(e)}}function cEe(e,t){const n={};if(Array.isArray(t))for(const r of t){const s=Object.getOwnPropertyDescriptor(e,r);s!=null&&s.enumerable&&Object.defineProperty(n,r,s)}else for(const r of Reflect.ownKeys(e)){const s=Object.getOwnPropertyDescriptor(e,r);if(s.enumerable){const a=e[r];t(r,a,e)&&Object.defineProperty(n,r,s)}}return n}function zR(e,t){if(!(typeof e=="string"&&typeof t=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e===""||t==="")return[];const n=e.indexOf(t);return n===-1?[]:[e.slice(0,n),e.slice(n+t.length)]}const uEe=e=>e==null,dEe=e=>encodeURIComponent(e).replaceAll(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),Tv=Symbol("encodeFragmentIdentifier");function fEe(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const s=n.length;return r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[cn(t,e),"[",s,"]"].join("")]:[...n,[cn(t,e),"[",cn(s,e),"]=",cn(r,e)].join("")]};case"bracket":return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[cn(t,e),"[]"].join("")]:[...n,[cn(t,e),"[]=",cn(r,e)].join("")];case"colon-list-separator":return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[cn(t,e),":list="].join("")]:[...n,[cn(t,e),":list=",cn(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t=e.arrayFormat==="bracket-separator"?"[]=":"=";return n=>(r,s)=>s===void 0||e.skipNull&&s===null||e.skipEmptyString&&s===""?r:(s=s===null?"":s,r.length===0?[[cn(n,e),t,cn(s,e)].join("")]:[[r,cn(s,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,cn(t,e)]:[...n,[cn(t,e),"=",cn(r,e)].join("")]}}function pEe(e){let t;switch(e.arrayFormat){case"index":return(n,r,s)=>{if(t=/\[(\d*)]$/.exec(n),n=n.replace(/\[\d*]$/,""),!t){s[n]=r;return}s[n]===void 0&&(s[n]={}),s[n][t[1]]=r};case"bracket":return(n,r,s)=>{if(t=/(\[])$/.exec(n),n=n.replace(/\[]$/,""),!t){s[n]=r;return}if(s[n]===void 0){s[n]=[r];return}s[n]=[...s[n],r]};case"colon-list-separator":return(n,r,s)=>{if(t=/(:list)$/.exec(n),n=n.replace(/:list$/,""),!t){s[n]=r;return}if(s[n]===void 0){s[n]=[r];return}s[n]=[...s[n],r]};case"comma":case"separator":return(n,r,s)=>{const a=typeof r=="string"&&r.includes(e.arrayFormatSeparator),i=typeof r=="string"&&!a&&Fo(r,e).includes(e.arrayFormatSeparator);r=i?Fo(r,e):r;const l=a||i?r.split(e.arrayFormatSeparator).map(c=>Fo(c,e)):r===null?r:Fo(r,e);s[n]=l};case"bracket-separator":return(n,r,s)=>{const a=/(\[])$/.test(n);if(n=n.replace(/\[]$/,""),!a){s[n]=r&&Fo(r,e);return}const i=r===null?[]:Fo(r,e).split(e.arrayFormatSeparator);if(s[n]===void 0){s[n]=i;return}s[n]=[...s[n],...i]};default:return(n,r,s)=>{if(s[n]===void 0){s[n]=r;return}s[n]=[...[s[n]].flat(),r]}}}function UR(e){if(typeof e!="string"||e.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function cn(e,t){return t.encode?t.strict?dEe(e):encodeURIComponent(e):e}function Fo(e,t){return t.decode?lEe(e):e}function WR(e){return Array.isArray(e)?e.sort():typeof e=="object"?WR(Object.keys(e)).sort((t,n)=>Number(t)-Number(n)).map(t=>e[t]):e}function HR(e){const t=e.indexOf("#");return t!==-1&&(e=e.slice(0,t)),e}function mEe(e){let t="";const n=e.indexOf("#");return n!==-1&&(t=e.slice(n)),t}function qR(e,t,n){return n==="string"&&typeof e=="string"?e:typeof n=="function"&&typeof e=="string"?n(e):t.parseBooleans&&e!==null&&(e.toLowerCase()==="true"||e.toLowerCase()==="false")?e.toLowerCase()==="true":n==="number"&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""||t.parseNumbers&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?Number(e):e}function Ev(e){e=HR(e);const t=e.indexOf("?");return t===-1?"":e.slice(t+1)}function Ov(e,t){t={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,types:Object.create(null),...t},UR(t.arrayFormatSeparator);const n=pEe(t),r=Object.create(null);if(typeof e!="string"||(e=e.trim().replace(/^[?#&]/,""),!e))return r;for(const s of e.split("&")){if(s==="")continue;const a=t.decode?s.replaceAll("+"," "):s;let[i,l]=zR(a,"=");i===void 0&&(i=a),l=l===void 0?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?l:Fo(l,t),n(Fo(i,t),l,r)}for(const[s,a]of Object.entries(r))if(typeof a=="object"&&a!==null&&t.types[s]!=="string")for(const[i,l]of Object.entries(a)){const c=t.types[s]?t.types[s].replace("[]",""):void 0;a[i]=qR(l,t,c)}else typeof a=="object"&&a!==null&&t.types[s]==="string"?r[s]=Object.values(a).join(t.arrayFormatSeparator):r[s]=qR(a,t,t.types[s]);return t.sort===!1?r:(t.sort===!0?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce((s,a)=>{const i=r[a];return s[a]=i&&typeof i=="object"&&!Array.isArray(i)?WR(i):i,s},Object.create(null))}function GR(e,t){if(!e)return"";t={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...t},UR(t.arrayFormatSeparator);const n=i=>t.skipNull&&uEe(e[i])||t.skipEmptyString&&e[i]==="",r=fEe(t),s={};for(const[i,l]of Object.entries(e))n(i)||(s[i]=l);const a=Object.keys(s);return t.sort!==!1&&a.sort(t.sort),a.map(i=>{const l=e[i];return l===void 0?"":l===null?cn(i,t):Array.isArray(l)?l.length===0&&t.arrayFormat==="bracket-separator"?cn(i,t)+"[]":l.reduce(r(i),[]).join("&"):cn(i,t)+"="+cn(l,t)}).filter(i=>i.length>0).join("&")}function YR(e,t){var s;t={decode:!0,...t};let[n,r]=zR(e,"#");return n===void 0&&(n=e),{url:((s=n==null?void 0:n.split("?"))==null?void 0:s[0])??"",query:Ov(Ev(e),t),...t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:Fo(r,t)}:{}}}function KR(e,t){t={encode:!0,strict:!0,[Tv]:!0,...t};const n=HR(e.url).split("?")[0]||"",r=Ev(e.url),s={...Ov(r,{sort:!1}),...e.query};let a=GR(s,t);a&&(a=`?${a}`);let i=mEe(e.url);if(typeof e.fragmentIdentifier=="string"){const l=new URL(n);l.hash=e.fragmentIdentifier,i=t[Tv]?l.hash:`#${e.fragmentIdentifier}`}return`${n}${a}${i}`}function XR(e,t,n){n={parseFragmentIdentifier:!0,[Tv]:!1,...n};const{url:r,query:s,fragmentIdentifier:a}=YR(e,n);return KR({url:r,query:cEe(s,t),fragmentIdentifier:a},n)}function hEe(e,t,n){const r=Array.isArray(t)?s=>!t.includes(s):(s,a)=>!t(s,a);return XR(e,r,n)}const gEe=Object.freeze(Object.defineProperty({__proto__:null,exclude:hEe,extract:Ev,parse:Ov,parseUrl:YR,pick:XR,stringify:GR,stringifyUrl:KR},Symbol.toStringTag,{value:"Module"})),bEe=e=>(O.useEffect(()=>{(async()=>{const n=new bo(e.friggBaseUrl,e.authToken),r=gEe.parse(window.location.search);if(r.code){const s=await n.authorize(e.app,{code:r.code}),a=await n.listIntegrations();if(s!=null&&s.error){alert(s.error),e.redirectToUrl();return}const i={type:e.app,category:"CRM"},l=a.entities.authorized.find(u=>u.type===e.primaryEntityName),c=await n.createIntegration(l.id??s.entity_id,s.entity_id,i);if(c.error){alert(c.error);return}e.redirectToUrl()}})()},[]),w.jsx("div",{className:"flex items-center justify-center h-screen w-screen",children:w.jsx(bs,{})}));var yEe="VisuallyHidden",$v=v.forwardRef((e,t)=>w.jsx(kt.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));$v.displayName=yEe;var vEe="ToastProvider",[JR,xEe,wEe]=Mp("Toast"),[ZR,E$e]=Uo("Toast",[wEe]),[O$e,vp]=ZR(vEe),QR="ToastViewport",CEe=["F8"],Pv="toast.viewportPause",Mv="toast.viewportResume",eI=v.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=CEe,label:s="Notifications ({hotkey})",...a}=e,i=vp(QR,n),l=xEe(n),c=v.useRef(null),u=v.useRef(null),d=v.useRef(null),f=v.useRef(null),m=on(t,f,i.onViewportChange),b=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),h=i.toastCount>0;v.useEffect(()=>{const g=y=>{var C;r.length!==0&&r.every(S=>y[S]||y.code===S)&&((C=f.current)==null||C.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[r]),v.useEffect(()=>{const g=c.current,y=f.current;if(h&&g&&y){const x=()=>{if(!i.isClosePausedRef.current){const P=new CustomEvent(Pv);y.dispatchEvent(P),i.isClosePausedRef.current=!0}},C=()=>{if(i.isClosePausedRef.current){const P=new CustomEvent(Mv);y.dispatchEvent(P),i.isClosePausedRef.current=!1}},S=P=>{!g.contains(P.relatedTarget)&&C()},T=()=>{g.contains(document.activeElement)||C()};return g.addEventListener("focusin",x),g.addEventListener("focusout",S),g.addEventListener("pointermove",x),g.addEventListener("pointerleave",T),window.addEventListener("blur",x),window.addEventListener("focus",C),()=>{g.removeEventListener("focusin",x),g.removeEventListener("focusout",S),g.removeEventListener("pointermove",x),g.removeEventListener("pointerleave",T),window.removeEventListener("blur",x),window.removeEventListener("focus",C)}}},[h,i.isClosePausedRef]);const p=v.useCallback(({tabbingDirection:g})=>{const x=l().map(C=>{const S=C.ref.current,T=[S,...AEe(S)];return g==="forwards"?T:T.reverse()});return(g==="forwards"?x.reverse():x).flat()},[l]);return v.useEffect(()=>{const g=f.current;if(g){const y=x=>{var T,P,$;const C=x.altKey||x.ctrlKey||x.metaKey;if(x.key==="Tab"&&!C){const M=document.activeElement,N=x.shiftKey;if(x.target===g&&N){(T=u.current)==null||T.focus();return}const j=p({tabbingDirection:N?"backwards":"forwards"}),I=j.findIndex(k=>k===M);Rv(j.slice(I+1))?x.preventDefault():N?(P=u.current)==null||P.focus():($=d.current)==null||$.focus()}};return g.addEventListener("keydown",y),()=>g.removeEventListener("keydown",y)}},[l,p]),w.jsxs(O_,{ref:c,role:"region","aria-label":s.replace("{hotkey}",b),tabIndex:-1,style:{pointerEvents:h?void 0:"none"},children:[h&&w.jsx(Dv,{ref:u,onFocusFromOutsideViewport:()=>{const g=p({tabbingDirection:"forwards"});Rv(g)}}),w.jsx(JR.Slot,{scope:n,children:w.jsx(kt.ol,{tabIndex:-1,...a,ref:m})}),h&&w.jsx(Dv,{ref:d,onFocusFromOutsideViewport:()=>{const g=p({tabbingDirection:"backwards"});Rv(g)}})]})});eI.displayName=QR;var tI="ToastFocusProxy",Dv=v.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=e,a=vp(tI,n);return w.jsx($v,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:i=>{var u;const l=i.relatedTarget;!((u=a.viewport)!=null&&u.contains(l))&&r()}})});Dv.displayName=tI;var xp="Toast",SEe="toast.swipeStart",TEe="toast.swipeMove",EEe="toast.swipeCancel",OEe="toast.swipeEnd",nI=v.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:a,...i}=e,[l=!0,c]=Bi({prop:r,defaultProp:s,onChange:a});return w.jsx(xo,{present:n||l,children:w.jsx(MEe,{open:l,...i,ref:t,onClose:()=>c(!1),onPause:kn(e.onPause),onResume:kn(e.onResume),onSwipeStart:qe(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:qe(e.onSwipeMove,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:qe(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:qe(e.onSwipeEnd,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),c(!1)})})})});nI.displayName=xp;var[$Ee,PEe]=ZR(xp,{onClose(){}}),MEe=v.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:a,onClose:i,onEscapeKeyDown:l,onPause:c,onResume:u,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:m,onSwipeEnd:b,...h}=e,p=vp(xp,n),[g,y]=v.useState(null),x=on(t,k=>y(k)),C=v.useRef(null),S=v.useRef(null),T=s||p.duration,P=v.useRef(0),$=v.useRef(T),M=v.useRef(0),{onToastAdd:N,onToastRemove:E}=p,_=kn(()=>{var L;(g==null?void 0:g.contains(document.activeElement))&&((L=p.viewport)==null||L.focus()),i()}),j=v.useCallback(k=>{!k||k===1/0||(window.clearTimeout(M.current),P.current=new Date().getTime(),M.current=window.setTimeout(_,k))},[_]);v.useEffect(()=>{const k=p.viewport;if(k){const L=()=>{j($.current),u==null||u()},V=()=>{const q=new Date().getTime()-P.current;$.current=$.current-q,window.clearTimeout(M.current),c==null||c()};return k.addEventListener(Pv,V),k.addEventListener(Mv,L),()=>{k.removeEventListener(Pv,V),k.removeEventListener(Mv,L)}}},[p.viewport,T,c,u,j]),v.useEffect(()=>{a&&!p.isClosePausedRef.current&&j(T)},[a,T,p.isClosePausedRef,j]),v.useEffect(()=>(N(),()=>E()),[N,E]);const I=v.useMemo(()=>g?cI(g):null,[g]);return p.viewport?w.jsxs(w.Fragment,{children:[I&&w.jsx(DEe,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:I}),w.jsx($Ee,{scope:n,onClose:_,children:Jc.createPortal(w.jsx(JR.ItemSlot,{scope:n,children:w.jsx(E_,{asChild:!0,onEscapeKeyDown:qe(l,()=>{p.isFocusedToastEscapeKeyDownRef.current||_(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:w.jsx(kt.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":p.swipeDirection,...h,ref:x,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:qe(e.onKeyDown,k=>{k.key==="Escape"&&(l==null||l(k.nativeEvent),k.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,_()))}),onPointerDown:qe(e.onPointerDown,k=>{k.button===0&&(C.current={x:k.clientX,y:k.clientY})}),onPointerMove:qe(e.onPointerMove,k=>{if(!C.current)return;const L=k.clientX-C.current.x,V=k.clientY-C.current.y,q=!!S.current,K=["left","right"].includes(p.swipeDirection),H=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,B=K?H(0,L):0,A=K?0:H(0,V),X=k.pointerType==="touch"?10:2,z={x:B,y:A},D={originalEvent:k,delta:z};q?(S.current=z,wp(TEe,f,D,{discrete:!1})):uI(z,p.swipeDirection,X)?(S.current=z,wp(SEe,d,D,{discrete:!1}),k.target.setPointerCapture(k.pointerId)):(Math.abs(L)>X||Math.abs(V)>X)&&(C.current=null)}),onPointerUp:qe(e.onPointerUp,k=>{const L=S.current,V=k.target;if(V.hasPointerCapture(k.pointerId)&&V.releasePointerCapture(k.pointerId),S.current=null,C.current=null,L){const q=k.currentTarget,K={originalEvent:k,delta:L};uI(L,p.swipeDirection,p.swipeThreshold)?wp(OEe,b,K,{discrete:!0}):wp(EEe,m,K,{discrete:!0}),q.addEventListener("click",H=>H.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),DEe=e=>{const{__scopeToast:t,children:n,...r}=e,s=vp(xp,t),[a,i]=v.useState(!1),[l,c]=v.useState(!1);return IEe(()=>i(!0)),v.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),l?null:w.jsx(cu,{asChild:!0,children:w.jsx($v,{...r,children:a&&w.jsxs(w.Fragment,{children:[s.label," ",n]})})})},kEe="ToastTitle",rI=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return w.jsx(kt.div,{...r,ref:t})});rI.displayName=kEe;var REe="ToastDescription",oI=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return w.jsx(kt.div,{...r,ref:t})});oI.displayName=REe;var sI="ToastAction",aI=v.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?w.jsx(lI,{altText:n,asChild:!0,children:w.jsx(kv,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${sI}\`. Expected non-empty \`string\`.`),null)});aI.displayName=sI;var iI="ToastClose",kv=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,s=PEe(iI,n);return w.jsx(lI,{asChild:!0,children:w.jsx(kt.button,{type:"button",...r,ref:t,onClick:qe(e.onClick,s.onClose)})})});kv.displayName=iI;var lI=v.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...s}=e;return w.jsx(kt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:t})});function cI(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),_Ee(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",a=r.dataset.radixToastAnnounceExclude==="";if(!s)if(a){const i=r.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...cI(r))}}),t}function wp(e,t,n,{discrete:r}){const s=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?Pp(s,a):s.dispatchEvent(a)}var uI=(e,t,n=0)=>{const r=Math.abs(e.x),s=Math.abs(e.y),a=r>s;return t==="left"||t==="right"?a&&r>n:!a&&s>n};function IEe(e=()=>{}){const t=kn(e);Ho(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function _Ee(e){return e.nodeType===e.ELEMENT_NODE}function AEe(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Rv(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var dI=eI,fI=nI,pI=rI,mI=oI,hI=aI,gI=kv;const NEe=v.forwardRef(({className:e,...t},n)=>w.jsx(dI,{ref:n,className:xt("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));NEe.displayName=dI.displayName;const jEe=Vv("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),LEe=v.forwardRef(({className:e,variant:t,...n},r)=>w.jsx(fI,{ref:r,className:xt(jEe({variant:t}),e),...n}));LEe.displayName=fI.displayName;const FEe=v.forwardRef(({className:e,...t},n)=>w.jsx(hI,{ref:n,className:xt("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));FEe.displayName=hI.displayName;const VEe=v.forwardRef(({className:e,...t},n)=>w.jsx(gI,{ref:n,className:xt("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:w.jsx(Jv,{className:"h-4 w-4"})}));VEe.displayName=gI.displayName;const BEe=v.forwardRef(({className:e,...t},n)=>w.jsx(pI,{ref:n,className:xt("text-sm font-semibold",e),...t}));BEe.displayName=pI.displayName;const zEe=v.forwardRef(({className:e,...t},n)=>w.jsx(mI,{ref:n,className:xt("text-sm opacity-90",e),...t}));zEe.displayName=mI.displayName,Qt.Button=go,Qt.Input=Yv,Qt.IntegrationHorizontal=NR,Qt.IntegrationList=sEe,Qt.IntegrationVertical=LR,Qt.LoadingSpinner=bs,Qt.RedirectFromAuth=bEe,Qt.UserActionModal=Zk,Object.defineProperty(Qt,Symbol.toStringTag,{value:"Module"})});
|
|
402
402
|
//# sourceMappingURL=index.umd.js.map
|