1/*! For license information please see 2907.f43e255e.chunk.js.LICENSE.txt */ 2(self.webpackChunkknowledge_base_saas=self.webpackChunkknowledge_base_saas||[]).push([[2907],{15003(e,t,a){"use strict";a.d(t,{A:()=>u});var s=a(89379),n=a(53986),i=a(65043),r=a(98139),l=a.n(r),o=a(66630),d=a(70579);const c=["size","fullWidth","loading","leadingIcon","trailingIcon","className","disabled","children","type"],m={sm:"py-2 px-3 text-body-sm font-medium",md:"py-2 px-4 text-body-md font-medium",lg:"py-3 px-4 text-body-md font-medium"},u=(0,i.forwardRef)(function(e,t){let a=e.size,i=void 0===a?"md":a,r=e.fullWidth,u=void 0!==r&&r,x=e.loading,p=void 0!==x&&x,g=e.leadingIcon,h=e.trailingIcon,y=e.className,b=e.disabled,v=e.children,f=e.type,A=void 0===f?"button":f,j=(0,n.A)(e,c);const w=Boolean(p),N=w?(0,d.jsx)(o.y$,{size:"sm",className:"shrink-0","aria-hidden":!0}):g;return(0,d.jsxs)("button",(0,s.A)((0,s.A)({ref:t,type:A,disabled:b||w,className:l()("inline-flex items-center justify-center font-medium bg-brand hover:bg-brand-hover text-brand-on rounded-brand-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-focus-ring disabled:opacity-50 disabled:cursor-not-allowed transition-colors",m[i]||m.md,u&&"w-full justify-center",(N||h)&&"gap-2",y)},j),{},{children:[N,v,h]}))})},37322(e,t,a){"use strict";a.d(t,{A:()=>n});a(65043);var s=a(70579);function n(e){let t=e.className,a=e.size,n=void 0===a?24:a;return(0,s.jsx)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:["text-[#10A37F]",t].filter(Boolean).join(" "),"aria-hidden":!0,children:(0,s.jsx)("path",{d:"M22.282 9.821a5.985 5.985 0 0 0-.516-4.91 6.046 6.046 0 0 0-6.51-2.9A6.065 6.065 0 0 0 4.981 4.18a5.985 5.985 0 0 0-3.998 2.9 6.046 6.046 0 0 0 .743 7.097 5.98 5.98 0 0 0 .51 4.911 6.051 6.051 0 0 0 6.515 2.9A5.985 5.985 0 0 0 13.26 24a6.056 6.056 0 0 0 5.772-4.206 5.99 5.99 0 0 0 3.997-2.9 6.056 6.056 0 0 0-.747-7.073zM13.26 22.43a4.476 4.476 0 0 1-2.876-1.04l.141-.081 4.779-2.758a.795.795 0 0 0 .392-.681v-6.737l2.02 1.168a.071.071 0 0 1 .038.052v5.583a4.504 4.504 0 0 1-4.494 4.494zM3.6 18.304a4.47 4.47 0 0 1-.535-3.014l.142.085 4.783 2.759a.771.771 0 0 0 .78 0l5.843-3.369v2.332a.08.08 0 0 1-.033.062L9.74 19.95a4.5 4.5 0 0 1-6.14-1.646zM2.34 7.896a4.485 4.485 0 0 1 2.345-1.973V11.6a.766.766 0 0 0 .388.676l5.815 3.355-2.02 1.168a.076.076 0 0 1-.071 0l-4.83-2.786A4.504 4.504 0 0 1 2.34 7.872v.024zm16.597 3.855l-5.833-3.387L15.119 7.2a.076.076 0 0 1 .071 0l4.83 2.791a4.494 4.494 0 0 1-.676 8.105v-5.678a.79.79 0 0 0-.407-.667zm2.01-3.023l-.141-.085-4.774-2.782a.776.776 0 0 0-.785 0L9.409 9.23V6.897a.066.066 0 0 1 .028-.061l4.83-2.787a4.5 4.5 0 0 1 6.68 4.66v.018zm-12.64 4.135l-2.02-1.164a.08.08 0 0 1-.038-.057V6.075a4.5 4.5 0 0 1 7.375-3.453l-.142.08L8.704 5.46a.795.795 0 0 0-.393.681l-.004 6.722zm1.097-2.365l2.602-1.5 2.607 1.5v2.999l-2.597 1.5-2.607-1.5z",fill:"currentColor"})})}},59395(e,t,a){"use strict";a.d(t,{A:()=>n});a(65043);var s=a(70579);function n(e){let t=e.className,a=e.size,n=void 0===a?24:a;return(0,s.jsx)("img",{src:"https://cdn.brandfetch.io/idW5s392j1/w/338/h/338/theme/dark/icon.png?c=1bxid64Mup7aczewSAYMX&t=1738315794862",alt:"",width:n,height:n,className:["shrink-0 object-contain rounded-md",t].filter(Boolean).join(" ")})}},18419(e,t,a){"use strict";a.d(t,{A:()=>n});a(65043);var s=a(70579);function n(e){let t=e.className,a=void 0===t?"h-8 w-8":t;return(0,s.jsx)("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:a,"aria-hidden":!0,children:(0,s.jsx)("path",{fill:"currentColor",d:"M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23"})})}},22907(e,t,a){"use strict";a.r(t),a.d(t,{default:()=>ee});var s=a(89379),n=a(5544),i=a(65043),r=a(47874),l=a(9463),o=a(77819),d=a(40614),c=a(687),m=a(77784);const u=(0,m.A)("timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);var x=a(69807),p=a(4596),g=a(65727),h=a(82300),y=a(94965),b=a(56099),v=a(10629),f=a(70067),A=a(26405),j=a(41680),w=a(3308),N=a(55731),k=a(35327),C=a(84669),E=a(37916),S=a(36210),I=a(7365),z=a(72313),D=a(70764);const T=(0,m.A)("book-open",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);var F=a(20073),M=a(73062),R=a(18419),_=a(37322),P=a(59395);const V="based-cursor-dev-sync.vsix";function W(e){const t={NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_VERCEL_GIT_COMMIT_AUTHOR_NAME:"Gary Riger",REACT_APP_VERCEL_GIT_PROVIDER:"github",REACT_APP_VERCEL_PROJECT_ID:"prj_A5c8ZMv75ibxQVceA3I7GjPny9oD",REACT_APP_VERCEL_GIT_PULL_REQUEST_ID:"",REACT_APP_VERCEL_OBSERVABILITY_CLIENT_CONFIG:'{"analytics":{"scriptSrc":"8f81e36d25c71756/script.
2js","viewEndpoint":"8f81e36d25c71756/view","eventEndpoint":"8f81e36d25c71756/event","sessionEndpoint":"8f81e36d25c71756/session"},"speedInsights":{"scriptSrc":"1e9f61cb490e195d/script.js","endpoint":"1e9f61cb490e195d/vitals"}}',REACT_APP_VERCEL_BRANCH_URL:"based-git-main-trybased.vercel.app",REACT_APP_VERCEL_GIT_COMMIT_MESSAGE:"Merge pull request #69 from grigerny/cursor/native-document-tables-6648\n\nNative document tables for editor and MCP agents",REACT_APP_VERCEL_DEPLOYMENT_ID:"dpl_6MQChUZTeZEjuh9PAEPmwanHsu8y",REACT_APP_VERCEL_GIT_REPO_SLUG:"knowledge-base-saas",REACT_APP_VERCEL_TARGET_ENV:"production",REACT_APP_VERCEL_GIT_COMMIT_SHA:"fe8e0cad17d5c751081fbff8964f57a16f15178c",REACT_APP_VERCEL_ENV:"production",REACT_APP_VERCEL_GIT_COMMIT_REF:"main",REACT_APP_VERCEL_URL:"based-o7e1bdtta-trybased.vercel.app",REACT_APP_VERCEL_PROJECT_PRODUCTION_URL:"www.trybased.com",REACT_APP_VERCEL_GIT_PREVIOUS_SHA:"",REACT_APP_VERCEL_GIT_REPO_ID:"980833582",REACT_APP_VERCEL_GIT_COMMIT_AUTHOR_LOGIN:"grigerny",REACT_APP_VERCEL_GIT_REPO_OWNER:"grigerny"}.REACT_APP_CURSOR_DEV_SYNC_VSIX_URL;if(t&&""!==String(t).trim())return t.trim();const a=e&&""!==String(e).trim()?"?v=".concat(encodeURIComponent(e)):"";return"".concat(".").concat("/extensions/based-cursor-dev-sync.vsix").concat(a)}var L=a(28279),O=a(67898),U=a(52395),H=a(47081),B=a(12475),q=a(92339),G=a(66630),Z=a(15003),Y=a(77927),$=a(70579);function K(){const e=(0,i.useState)(!1),t=(0,n.A)(e,2),a=t[0],s=t[1];return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)("button",{type:"button",onClick:()=>s(!0),className:"flex items-center px-4 py-2 text-sm font-medium text-blue-700 bg-blue-50 rounded-md hover:bg-blue-100 transition-colors",children:[(0,$.jsx)(T,{className:"h-4 w-4 mr-2"}),"More info"]}),a&&(0,$.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",role:"presentation",onClick:()=>s(!1),children:(0,$.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"document-signatures-more-info-title",className:"bg-white rounded-lg max-w-lg w-full mx-4 max-h-[90vh] overflow-y-auto",onClick:e=>e.stopPropagation(),children:[(0,$.jsx)("div",{className:"p-6 border-b border-gray-100",children:(0,$.jsxs)("div",{className:"flex items-center justify-between",children:[(0,$.jsx)("div",{children:(0,$.jsx)("h3",{id:"document-signatures-more-info-title",className:"text-lg font-semibold text-gray-900",children:"Document signatures"})}),(0,$.jsx)("button",{type:"button",onClick:()=>s(!1),className:"p-1 text-gray-400 hover:text-gray-600 rounded","aria-label":"Close",children:(0,$.jsx)(d.A,{className:"h-5 w-5"})})]})}),(0,$.jsxs)("div",{className:"p-6 space-y-5",children:[(0,$.jsxs)("div",{children:[(0,$.jsx)("h4",{className:"text-sm font-semibold text-gray-900 mb-2",children:"Where can I use Based electronic signatures?"}),(0,$.jsx)("p",{className:"text-sm text-gray-600",children:"Based electronic signatures are designed for everyday business documents, including contracts, NDAs, consulting and service agreements, employment documents, approvals, and similar agreements."})]}),(0,$.jsxs)("div",{children:[(0,$.jsx)("h4",{className:"text-sm font-semibold text-gray-900 mb-2",children:"Are Based signatures legally valid?"}),(0,$.jsx)("p",{className:"text-sm text-gray-600 mb-3",children:"Yes. Electronic signatures created through Based are governed by the same electronic-signature laws that apply to other electronic-signature platforms. When used as intended, Based signatures can be legally valid and enforceable just like traditional signatures."}),(0,$.jsx)("p",{className:"text-sm text-gray-600",children:"Using Based instead of another electronic-signature platform does not make a signature less valid simply because it was signed with Based. Based also maintains records of the signing process to help document who signed and when."})]}),(0,$.jsxs)("div",{children:[(0,$.jsx)("h4",{className:"text-sm font-semibold text-gray-900 mb-2",children:"When shouldn't I use Based?"}),(0,$.jsx)("p",{className:"text-sm text-gray-600 mb-2",children:"Based is not intended for documents that require specialized electronic-signature procedures or compliance, including:"}),(0,$.jsxs)("ul",{className:"list-disc pl-5 space-y-2 text-sm text-gray-600",children:[(0,$.jsx)("li",{children:"FDA-regulated records requiring 21 CFR Part 11 compliance, such as certain pharmaceutical, clinical trial, and medical research records."}),(0,$.jsx)("li",{children:"Certain legally required consumer notices and disclosures, such as some mortgage, lending, banking, credit card, and insurance disclosures that require additional consent before being delivered electronically."}),(0,$.jsx)("li",{children:"Wills and certain estate documents, including codicils and testamentary trusts, which may have special signing, witnessing, or notarization requirements under state law."})]})]}),(0,$.jsx)("p",{className:"text-sm text-gray-600",children:"The simple rule: For standard business agreements, a signature made with Based isn't inherently less valid because it came from Based rather than another electronic-signature platform. The limitations above apply to specialized types of documents and regulated signing processes, not to the general validity of Based electronic signatures."}),(0,$.jsx)("p",{className:"text-sm text-gray-600",children:(0,$.jsx)("a",{href:Y.N,className:"text-blue-600 hover:underline",onClick:()=>s(!1),children:"Electronic signatures"})})]})]})})]})}const J=(0,U.getFunctions)(),Q=e=>{let t=e.className,a=e.style;return(0,$.jsxs)("svg",{width:"140",height:"32",viewBox:"0 0 360 150",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:a,children:[(0,$.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M360 77.4001C360 51.8001 347.6 31.6001 323.9 31.6001C300.1 31.6001 285.7 51.8001 285.7 77.2001C285.7 107.3 302.7 122.5 327.1 122.5C339 122.5 348 119.8 354.8 116V96.0001C348 99.4001 340.2 101.5 330.3 101.5C320.6 101.5 312 98.1001 310.9 86.3001H359.8C359.8 85.0001 360 79.8001 360 77.4001ZM310.6 67.9001C310.6 56.6001 317.5 51.9001 323.8 51.9001C329.9 51.9001 336.4 56.6001 336.4 67.9001H310.6Z",fill:"#533AFD"}),(0,$.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M247.1 31.6001C237.3 31.6001 231 36.2001 227.5 39.4001L226.2 33.2001H204.2V149.8L229.2 144.5L229.3 116.2C232.9 118.8 238.2 122.5 247 122.5C264.9 122.5 281.2 108.1 281.2 76.4001C281.1 47.4001 264.6 31.6001 247.1 31.6001ZM241.1 100.5C235.2 100.5 231.7 98.4001 229.3 95.8001L229.2 58.7001C231.8 55.8001 235.4 53.8001 241.1 53.8001C250.2 53.8001 256.5 64.0001 256.5 77.1001C256.5 90.5001 250.3 100.5 241.1 100.5Z",fill:"#533AFD"}),(0,$.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M169.8 25.7L194.9 20.3V0L169.8 5.3V25.7Z",fill:"#533AFD"}),(0,$.jsx)("path",{d:"M194.9 33.3H169.8V120.8H194.9V33.3Z",fill:"#533AFD"}),(0,$.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M142.9 40.7L141.3 33.3H119.7V120.8H144.7V61.5C150.6 53.8 160.6 55.2 163.7 56.3V33.3C160.5 32.1 148.8 29.9 142.9 40.7Z",fill:"#533AFD"}),(0,$.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M92.8999 11.6001L68.4999 16.8001L68.3999 96.9001C68.3999 111.7 79.4999 122.6 94.2999 122.6C102.5 122.6 108.5 121.1 111.8 119.3V99.0001C108.6 100.3 92.7999 104.9 92.7999 90.1001V54.6001H111.8V33.3001H92.7999L92.8999 11.6001Z",fill:"#533AFD"}),(0,$.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M25.3 58.7001C25.3 54.8001 28.5 53.3001 33.8 53.3001C41.4 53.3001 51 55.6001 58.6 59.7001V36.2001C50.3 32.9001 42.1 31.6001 33.8 31.6001C13.5 31.6001 0 42.2001 0 59.9001C0 87.5001 38 83.1001 38 95.0001C38 99.6001 34 101.1 28.4 101.1C20.1 101.1 9.5 97.7001 1.1 93.1001V116.9C10.4 120.9 19.8 122.6 28.4 122.6C49.2 122.6 63.5 112.3 63.5 94.4001C63.4 64.6001 25.3 69.9001 25.3 58.7001Z",fill:"#533AFD"})]})},X={versionControl:"Version control enabled",timer:"Timer enabled",pdfExport:"Export as PDF enabled",documentSignatures:"Document signatures enabled",documentLock:"Document lock enabled",autoTitle:"Auto title enabled",autoCategory:"Auto category enabled",sopEnhancement:"Update with AI enabled",voice:"Voice enabled",pexels:"Pexels Images enabled",forms:"Forms enabled",templateFill:"Template Fill enabled",envVault:"Env Vault enabled",cursorDevSync:"Cursor / VS Code extension enabled",emailToDocument:"Email to Document enabled",emailAsk:"Email Ask enabled",customDomain:"Custom Domains enabled \u2014 configure your hostname next"},ee=()=>{const e=(0,r.Zp)(),t=(0,i.useState)(null),a=(0,n.A)(t,2),m=a[0],Y=a[1],ee=(0,i.useState)(null),te=(0,n.A)(ee,2),ae=te[0],se=te[1],ne=(0,i.useState)(!1),ie=(0,n.A)(ne,2),re=ie[0],le=ie[1],oe=(0,i.useState)(!0),de=(0,n.A)(oe,2),ce=de[0],me=de[1],ue=(0,i.useState)(!1),xe=(0,n.A)(ue,2),pe=xe[0],ge=xe[1],he=(0,i.useRef)(null),ye=(0,i.useState)({connected:!1,hourlyRate:null,stripeConnectAccountId:null,stripeConnectChargesEnabled:!1,stripeConnectDetailsSubmitted:!1,stripeConnectAccountEmail:null,status:null}),be=(0,n.A)(ye,2),ve=be[0],fe=be[1],Ae=(0,i.useState)(!1),je=(0,n.A)(Ae,2),we=je[0],Ne=je[1],ke=(0,i.useState)(!1),Ce=(0,n.A)(ke,2),Ee=Ce[0],Se=Ce[1],Ie=(0,i.useState)(!1),ze=(0,n.A)(Ie,2),De=ze[0],Te=ze[1],Fe=(0,i.useState)(""),Me=(0,n.A)(Fe,2),Re=Me[0],_e=Me[1],Pe=(0,i.useState)(""),Ve=(0,n.A)(Pe,2),We=Ve[0],Le=Ve[1],Oe=(0,i.useState)(!0),Ue=(0,n.A)(Oe,2),He=Ue[0],Be=Ue[1],qe=(0,i.useState)([{id:"mcp",name:"MCP",description:"Let AI assistants like Claude and ChatGPT manage your knowledge base directly \u2014 create documents, organize workspaces, and more through natural conversation.",icon:"Plug",logoComponent:!0,status:"connected",category:"AI Agents",kind:"integration",alwaysOn:!0},{id:"sopEnhancement",name:"Update with AI",description:"Move drafts forward with AI: it suggests what to change, asks for missing context when needed, and follows the update style you pick.",icon:"Sparkles",logoComponent:!1,status:"available",category:"AI Assist",kind:"power-up"},{id:"autoTitle",name:"Auto title",description:"Automatically suggest a title for new documents based on content.",icon:"Type",logoComponent:!1,status:"available",category:"AI Assist",kind:"power-up"},{id:"autoCategory",name:"Auto category",description:"Automatically assign a category to new documents based on content.",icon:"FolderOpen",logoComponent:!1,status:"available",category:"AI Assist",kind:"power-up"},{id:"documentSignatures",name:"Document signatures",description:"Add signature and fill-in fields to any document and send for signing. Recipients sign via email link; track status and download completed PDFs.",icon:"PenLine",logoComponent:!1,status:"available",category:"Documents",kind:"power-up"},{id:"pdfExport",name:"Export as PDF",description:'Export documents as PDF from the document view. When enabled, an "Export as PDF" button appears so you can download any document as a formatted PDF.',icon:"FileDown",logoComponent:!1,status:"available",category:"Documents",kind:"power-up"},{id:"pexels",name:"Pexels Images",description:"Search and insert royalty-free images from Pexels directly in your documents.",icon:"Image",logoComponent:!1,status:"available",category:"Media",kind:"power-up"},{id:"stripe",name:"Stripe",description:"Connect your own Stripe account to generate invoices from time entries and accept document payments directly to your account.",icon:"\ud83d\udcb3",logoComponent:!0,status:"available",category:"Payment",kind:"integration"},{id:"timer",name:"Timer",description:"Time yourself while working and use those times to calculate totals\u2014great for invoicing and tracking work. Start a timer on any document, pause or stop to save a t
2ime entry, then view totals and create invoices from time entries.",icon:"Clock",logoComponent:!1,status:"available",category:"Time tracking",kind:"power-up"},{id:"cursorDevSync",name:"Cursor / VS Code extension",description:"Install the Based extension for Cursor or VS Code: auto time-tracking into a document\u2019s Time Tracking, plus Env Vault (encrypted env vars as an in-memory virtual YAML \u2014 never writes a .env). Turn this on to download the .vsix; enable Env Vault separately if you want secrets sync.",icon:"cursor",logoComponent:!1,status:"available",category:"Time tracking",kind:"power-up"},{id:"versionControl",name:"Version Control",description:"Save document history and restore previous versions. When enabled, every save creates a version you can browse and restore.",icon:"GitBranch",logoComponent:!1,status:"available",category:"Documents",kind:"power-up"},{id:"documentLock",name:"Document lock",description:'Lock documents with one click. Locked documents cannot be deleted until you unlock them using the phrase "unlock document".',icon:"Lock",logoComponent:!1,status:"available",category:"Documents",kind:"power-up"},{id:"voice",name:"Voice",description:"Use voice input (Whisper) to add text to the document from the toolbar.",icon:"Mic",logoComponent:!1,status:"available",category:"Actions",kind:"power-up"},{id:"forms",name:"Forms",description:"Embed forms directly into documents to collect information from users. Add text, email, phone, date, and other field types.",icon:"ClipboardList",logoComponent:!1,status:"available",category:"Documents",kind:"power-up"},{id:"templateFill",name:"Template Fill",description:"Fill [bracket] placeholders in letter templates from a sidebar, preview values, then create a titled client copy while keeping the template clean.",icon:"FileText",logoComponent:!1,status:"available",category:"Documents",kind:"power-up"},{id:"envVault",name:"Env Vault",description:"Store project environment variables in an encrypted Based document. Edit them in Cursor / VS Code as an in-memory virtual file \u2014 never writes a .env to disk.",icon:"KeyRound",logoComponent:!1,status:"available",category:"Documents",kind:"power-up"},{id:"emailToDocument",name:"Email to Document",description:"Send or forward an email to a Based address and AI creates a knowledge document from it \u2014 keeping clean SOPs intact and teasing knowledge out of conversational threads.",icon:"Mail",logoComponent:!1,status:"available",category:"Documents",kind:"power-up"},{id:"emailAsk",name:"Email Ask",description:"Email a question to a Based address. Based answers from your knowledge base \u2014 auto-replies when confident, or saves a draft for you to send.",icon:"MessageSquare",logoComponent:!1,status:"available",category:"Documents",kind:"power-up"},{id:"customDomain",name:"Custom Domains",description:"Serve your public share or mascot on your own hostname (e.g. help.yourcompany.com) with your branding.",icon:"Globe",logoComponent:!1,status:"available",category:"Sharing",kind:"power-up"}]),Ge=(0,n.A)(qe,2),Ze=Ge[0],Ye=Ge[1],$e=(0,i.useState)(!1),Ke=(0,n.A)($e,2),Je=(Ke[0],Ke[1]),Qe=(0,i.useState)(!1),Xe=(0,n.A)(Qe,2),et=(Xe[0],Xe[1]),tt=(0,i.useState)(!1),at=(0,n.A)(tt,2),st=(at[0],at[1]),nt=(0,i.useState)(!1),it=(0,n.A)(nt,2),rt=(it[0],it[1]),lt=(0,i.useState)(!1),ot=(0,n.A)(lt,2),dt=(ot[0],ot[1]),ct=(0,i.useState)(!1),mt=(0,n.A)(ct,2),ut=(mt[0],mt[1]),xt=(0,i.useState)(!1),pt=(0,n.A)(xt,2),gt=(pt[0],pt[1]),ht=(0,i.useState)(!1),yt=(0,n.A)(ht,2),bt=(yt[0],yt[1]),vt=(0,i.useState)(!1),ft=(0,n.A)(vt,2),At=(ft[0],ft[1]),jt=(0,i.useState)(!1),wt=(0,n.A)(jt,2),Nt=(wt[0],wt[1]),kt=(0,i.useState)(!1),Ct=(0,n.A)(kt,2),Et=(Ct[0],Ct[1]),St=(0,i.useState)(!1),It=(0,n.A)(St,2),zt=(It[0],It[1]),Dt=(0,i.useState)(!1),Tt=(0,n.A)(Dt,2),Ft=(Tt[0],Tt[1]),Mt=(0,i.useState)(!1),Rt=(0,n.A)(Mt,2),_t=(Rt[0],Rt[1]),Pt=(0,i.useState)(!1),Vt=(0,n.A)(Pt,2),Wt=Vt[0],Lt=Vt[1],Ot=(0,i.useState)("defaultWorkspace"),Ut=(0,n.A)(Ot,2),Ht=Ut[0],Bt=Ut[1],qt=(0,i.useState)(""),Gt=(0,n.A)(qt,2),Zt=Gt[0],Yt=Gt[1],$t=(0,i.useState)([]),Kt=(0,n.A)($t,2),Jt=Kt[0],Qt=Kt[1],Xt=(0,i.useState)(!1),ea=(0,n.A)(Xt,2),ta=ea[0],aa=ea[1],sa=(0,i.useState)("enable"),na=(0,n.A)(sa,2),ia=na[0],ra=na[1],la=(0,i.useState)("defaultWorkspace"),oa=(0,n.A)(la,2),da=oa[0],ca=oa[1],ma=(0,i.useState)(""),ua=(0,n.A)(ma,2),xa=ua[0],pa=ua[1],ga=(0,i.useState)(!1),ha=(0,n.A)(ga,2),ya=ha[0],ba=ha[1],va=(0,i.useState)("defaultWorkspace"),fa=(0,n.A)(va,2),Aa=fa[0],ja=fa[1],wa=(0,i.useState)(""),Na=(0,n.A)(wa,2),ka=Na[0],Ca=Na[1],Ea=(0,i.useState)([]),Sa=(0,n.A)(Ea,2),Ia=Sa[0],za=Sa[1],Da=(0,i.useState)(""),Ta=(0,n.A)(Da,2),Fa=Ta[0],Ma=Ta[1],Ra=(0,i.useState)(!1),_a=(0,n.A)(Ra,2),Pa=_a[0],Va=_a[1],Wa=(0,i.useState)([]),La=(0,n.A)(Wa,2),Oa=La[0],Ua=La[1],Ha=(0,i.useState)(null),Ba=(0,n.A)(Ha,2),qa=Ba[0],Ga=Ba[1],Za=(0,i.useState)(""),Ya=(0,n.A)(Za,2),$a=Ya[0],Ka=Ya[1],Ja=(0,i.useState)(!1),Qa=(0,n.A)(Ja,2),Xa=Qa[0],es=Qa[1],ts=(0,i.useState)("enable"),as=(0,n.A)(ts,2),ss=as[0],ns=as[1],is=(0,i.useState)("defaultWorkspace"),rs=(0,n.A)(is,2),ls=rs[0],os=rs[1],ds=(0,i.useState)(""),cs=(0,n.A)(ds,2),ms=cs[0],us=cs[1],xs=(0,i.useState)(!1),ps=(0,n.A)(xs,2),gs=ps[0],hs=ps[1],ys=(0,i.useState)([]),bs=(0,n.A)(ys,2),vs=bs[0],fs=bs[1],As=(0,i.useState)(""),js=(0,n.A)(As,2),ws=js[0],Ns=js[1],ks=(0,i.useState)(!1),Cs=(0,n.A)(ks,2),Es=Cs[0],Ss=Cs[1],Is=(0,i.useState)(!1),zs=(0,n.A)(Is,2),Ds=zs[0],Ts=zs[1],Fs=(0,i.useState)(""),Ms=(0,n.A)(Fs,2),Rs=Ms[0],_s=Ms[1],Ps=(0,i.useState)(!1),Vs=(0,n.A)(Ps,2),Ws=Vs[0],Ls=Vs[1],Os=(0,i.useState)(null),Us=(0,n.A)(Os,2),Hs=Us[0],Bs=Us[1],qs=(0,i.useState)(!1),Gs=(0,n.A)(qs,2),Zs=Gs[0],Ys=Gs[1],$s=(0,i.useState)(!1),Ks=(0,n.A)($s,2),Js=Ks[0],Qs=Ks[1],Xs=(0,i.useState)(!1),en=(0,n.A)(Xs,2),tn=en[0],an=en[1],sn=(0,i.useState)([]),nn=(0,n.A)(sn,2),rn=nn[0],ln=nn[1],on=(0,i.useState)(null),dn=(0,n.A)(on,2),cn=dn[0],mn=dn[1],un=(0,i.useState)(null),xn=(0,n.A)(un,2),pn=xn[0],gn=xn[1],hn=(0,O.xI)(),yn=(0,L.hD)(hn),bn=(0,n.A)(yn,2),vn=bn[0],fn=bn[1];null===vn||void 0===vn||vn.uid;(0,i.useEffect)(()=>{const e=async()=>
2{if(vn)try{let t=(0,H.getSelectedOrganizationId)(),a=null;if(!t)try{a=await(0,H.getUserOrganizationData)(null),a&&((0,H.t6)(a.id),t=a.id)}catch(e){console.warn("Could not resolve default organization:",e)}if(!t)return he.current&&clearTimeout(he.current),le(!1),ge(!1),me(!1),Bs(null),void(he.current=setTimeout(()=>ge(!0),1500));if(a||(a=await(0,H.getUserOrganizationData)(t)),Bs(t),!a)return he.current&&clearTimeout(he.current),le(!1),ge(!1),me(!1),void(he.current=setTimeout(()=>ge(!0),1500));const s=a.role;if(se(s),"admin"!==s)return he.current&&clearTimeout(he.current),le(!1),ge(!1),me(!1),void(he.current=setTimeout(()=>ge(!0),1500));he.current&&(clearTimeout(he.current),he.current=null),le(!0),ge(!1)}catch(t){console.error("Error checking permissions:",t),he.current&&clearTimeout(he.current),le(!1),ge(!1),me(!1),he.current=setTimeout(()=>ge(!0),1500)}finally{me(!1)}else me(!1)};e();const t=()=>{e()};return window.addEventListener("organizationChanged",t),()=>{window.removeEventListener("organizationChanged",t),he.current&&(clearTimeout(he.current),he.current=null)}},[vn]);const An=(0,i.useCallback)(async e=>{if(e)try{var t,a,n,i,r,l,o,d,c,m,u,x,p,g,h,y,b,v,f,A,j,w,N;const C=await(0,U.httpsCallable)(J,"getAllIntegrationStatuses")({organizationId:e}),E=(null===C||void 0===C?void 0:C.data)||{},S=E.stripe;var k;if(S)fe({connected:!!S.connected,hourlyRate:null!==(k=S.hourlyRate)&&void 0!==k?k:null,stripeConnectAccountId:S.stripeConnectAccountId||null,stripeConnectChargesEnabled:S.stripeConnectChargesEnabled||!1,stripeConnectDetailsSubmitted:S.stripeConnectDetailsSubmitted||!1,stripeConnectAccountEmail:S.stripeConnectAccountEmail||null,status:S.status||null}),_e(null!=S.hourlyRate?String(S.hourlyRate):"");Je(!0===(null===(t=E.versionControl)||void 0===t?void 0:t.enabled)),et(!0===(null===(a=E.timer)||void 0===a?void 0:a.enabled)),st(!0===(null===(n=E.pdfExport)||void 0===n?void 0:n.enabled)),rt(!0===(null===(i=E.documentSignatures)||void 0===i?void 0:i.enabled)),dt(!0===(null===(r=E.documentLock)||void 0===r?void 0:r.enabled)),ut(!0===(null===(l=E.autoTitle)||void 0===l?void 0:l.enabled)),gt(!0===(null===(o=E.autoCategory)||void 0===o?void 0:o.enabled)),bt(!0===(null===(d=E.sopEnhancement)||void 0===d?void 0:d.enabled)),At(!0===(null===(c=E.voice)||void 0===c?void 0:c.enabled)),Nt(!0===(null===(m=E.pexels)||void 0===m?void 0:m.enabled)),Et(!0===(null===(u=E.forms)||void 0===u?void 0:u.enabled)),Ns((null===(x=E.forms)||void 0===x?void 0:x.notificationEmails)||""),Ss(!0===(null===(p=E.forms)||void 0===p?void 0:p.sendCopyToRespondent)),zt(!0===(null===(g=E.templateFill)||void 0===g?void 0:g.enabled)),Ft(!0===(null===(h=E.envVault)||void 0===h?void 0:h.enabled)),_t(!0===(null===(y=E.customDomain)||void 0===y?void 0:y.enabled)),Lt(!0===(null===(b=E.emailToDocument)||void 0===b?void 0:b.enabled)),Bt("perWorkspace"===(null===(v=E.emailToDocument)||void 0===v?void 0:v.addressMode)?"perWorkspace":"defaultWorkspace"),Yt((null===(f=E.emailToDocument)||void 0===f?void 0:f.defaultWorkspaceId)||""),ba(!0===(null===(A=E.emailAsk)||void 0===A?void 0:A.enabled)),ja("perWorkspace"===(null===(j=E.emailAsk)||void 0===j?void 0:j.addressMode)?"perWorkspace":"defaultWorkspace"),Ca((null===(w=E.emailAsk)||void 0===w?void 0:w.defaultWorkspaceId)||""),Va(!0===(null===(N=E.emailAsk)||void 0===N?void 0:N.autoSendWhenConfident)),Ye(e=>e.map(e=>{if("stripe"===e.id){let t="available";return null!==S&&void 0!==S&&S.connected?t="connected":null!==S&&void 0!==S&&S.stripeConnectAccountId&&"pending"===(null===S||void 0===S?void 0:S.status)&&(t="pending"),(0,s.A)((0,s.A)({},e),{},{status:t})}var t;if("timer"===e.id)return(0,s.A)((0,s.A)({},e),{},{status:!0===(null===(t=E.timer)||void 0===t?void 0:t.enabled)?"connected":"available"});const a=E[e.id];return a?(0,s.A)((0,s.A)({},e),{},{status:a.enabled?"connected":"available"}):e}))}catch(C){console.error("Error fetching integration statuses:",C)}finally{Be(!1)}},[]);(0,i.useEffect)(()=>{let e=!1;return fetch("".concat(".","/cursor-dev-sync-extension-info.json"),{cache:"no-cache"}).then(e=>e.ok?e.json():null).then(t=>{!e&&t&&"string"===typeof t.version&&gn(t)}
2).catch(()=>{}),()=>{e=!0}},[]),(0,i.useEffect)(()=>{re&&Hs&&An(Hs)},[re,Hs,An]);const jn=(0,i.useCallback)(async e=>{if(!e)return fs([]),[];try{const t=await(0,H.getWorkspaces)(),a=(0,B.jI)(t||[],e).filter(t=>t.organizationId===e).map(e=>({id:e.id||e.workspaceId,name:e.name||"Workspace",isDefault:!0===e.isDefault})).filter(e=>e.id);return fs(a),a}catch(t){return console.error("Error loading workspaces for Email to Document:",t),fs([]),[]}},[]),wn=(0,i.useCallback)(async e=>{if(e)try{var t,a,s,n;const i=(0,U.httpsCallable)(J,"listEmailToDocumentAddresses"),r=await i({organizationId:e});Qt((null===(t=r.data)||void 0===t?void 0:t.addresses)||[]),null!==(a=r.data)&&void 0!==a&&a.addressMode&&Bt("perWorkspace"===r.data.addressMode?"perWorkspace":"defaultWorkspace"),null!=(null===(s=r.data)||void 0===s?void 0:s.defaultWorkspaceId)&&Yt(r.data.defaultWorkspaceId||""),Lt(!0===(null===(n=r.data)||void 0===n?void 0:n.enabled))}catch(i){console.error("Error listing Email to Document addresses:",i)}else Qt([])},[]);(0,i.useEffect)(()=>{re&&Hs&&Wt&&(wn(Hs),jn(Hs))},[re,Hs,Wt,wn,jn]);const Nn=async function(){var e,t,a;let s=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).mode,n=void 0===s?"enable":s;const i=Hs||(0,H.getSelectedOrganizationId)();if(!i)return void q.Ay.error("No organization selected");const r=await jn(i),l=Zt||(null===(e=r.find(e=>e.isDefault))||void 0===e?void 0:e.id)||(null===(t=r.find(e=>/default/i.test(e.name)))||void 0===t?void 0:t.id)||(null===(a=r[0])||void 0===a?void 0:a.id)||"";ca(Ht||"defaultWorkspace"),pa(l),ra(n),aa(!0)},kn=(0,i.useCallback)(e=>{const t=Array.isArray(e)?e:[];za(t),Ma(e=>{var a;return e&&t.some(t=>t.workspaceId===e)?e:(null===(a=t[0])||void 0===a?void 0:a.workspaceId)||""})},[]),Cn=(0,i.useCallback)(async e=>{if(e)try{var t,a,s,n,i;const r=(0,U.httpsCallable)(J,"listEmailAskAddresses"),l=await r({organizationId:e});kn((null===(t=l.data)||void 0===t?void 0:t.addresses)||[]),null!==(a=l.data)&&void 0!==a&&a.addressMode&&ja("perWorkspace"===l.data.addressMode?"perWorkspace":"defaultWorkspace"),null!=(null===(s=l.data)||void 0===s?void 0:s.defaultWorkspaceId)&&Ca(l.data.defaultWorkspaceId||""),Va(!0===(null===(n=l.data)||void 0===n?void 0:n.autoSendWhenConfident)),ba(!0===(null===(i=l.data)||void 0===i?void 0:i.enabled))}catch(r){console.error("Error listing Email Ask addresses:",r)}else kn([])},[kn]),En=(0,i.useCallback)(async e=>{if(e)try{var t;const a=(0,U.httpsCallable)(J,"listEmailAskDrafts"),s=await a({organizationId:e,status:"draft",limit:20});Ua((null===(t=s.data)||void 0===t?void 0:t.drafts)||[])}catch(a){console.error("Error listing Email Ask drafts:",a)}else Ua([])},[]);(0,i.useEffect)(()=>{re&&Hs&&ya&&(Cn(Hs),En(Hs),jn(Hs))},[re,Hs,ya,Cn,En,jn]);const Sn=async function(){var e,t,a;let s=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).mode,n=void 0===s?"enable":s;const i=Hs||(0,H.getSelectedOrganizationId)();if(!i)return void q.Ay.error("No organization selected");const r=await jn(i),l=ka||(null===(e=r.find(e=>e.isDefault))||void 0===e?void 0:e.id)||(null===(t=r.find(e=>/default/i.test(e.name)))||void 0===t?void 0:t.id)||(null===(a=r[0])||void 0===a?void 0:a.id)||"";os(Aa||"defaultWorkspace"),us(l),hs(Pa),ns(n),es(!0)};(0,i.useEffect)(()=>{ln(e=>e.filter(e=>{const t=Ze.find(t=>t.id===e);return t&&"available"===t.status&&!t.alwaysOn}))},[Ze]),(0,i.useEffect)(()=>{ve.connected&&mn(null)},[ve.connected]),(0,i.useEffect)(()=>{const e=new URLSearchParams(window.location.search).get("stripe_connect");if("return"===e&&Hs){const e=new URL(window.location);e.searchParams.delete("stripe_connect"),window.history.replaceState({},"",e.pathname+e.search);(async()=>{Y("stripe");try{var e,t;const a=(0,U.httpsCallable)(J,"completeStripeConnect"),n=await a({organizationId:Hs,returnUrl:window.location.origin+"/integrations?stripe_connect=return",refreshUrl:window.location.origin+"/integrations?stripe_connect=refresh"});null!==(e=n.data)&&void 0!==e&&e.connected?(fe(e=>(0,s.A)((0,s.A)({},e),{},{connected:!0,stripeConnectChargesEnabled:!0,stripeConnectDetailsSubmitted:!0,stripeConnectAccountEmail:n.data.accountEmail||null,status:"connected"})),Ye(e=>e.map(e=>"stripe"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"connected"}):e)),q.Ay.success("Stripe account connected successfully!"),window.dispatchEvent(new Event("organizationChanged"))):null!==(t=n.data)&&void 0!==t&&t.onboardingUrl?((0,q.Ay)("Stripe onboarding is not yet complete. Redirecting...",{icon:"\u23f3"}),setTimeout(()=>{window.location.href=n.data.onboardingUrl},1500)):(Ye(e=>e.map(e=>"stripe"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"pending"}):e)),q.Ay.error("Stripe onboarding is incomplete. Please try again."))}catch(a){console.error("Error completing Stripe Connect:",a),q.Ay.error(a.message||"Failed to complete Stripe Connect")}finally{Y(null)}})()}else if("refresh"===e&&Hs){const e=new URL(window.location);e.searchParams.delete("stripe_connect"),window.history.replaceState({},"",e.pathname+e.search),(0,q.Ay)("Stripe onboarding session expired. Please try connecting again.",{icon:"\ud83d\udd04"})}},[Hs]);const In=async(e,t)=>{const a=e=>({ok:!1,errorMessage:e});try{switch(t){case"versionControl":{var n;const t=(0,U.httpsCallable)(J,"enableVersionControlIntegration");return null!==(n=(await t({organizationId:e})).data)&&void 0!==n&&n.success?(Je(!0),Ye(e=>e.map(e=>"versionControl"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"connected"}):e)),{ok:!0}):a("Failed to enable version control")}case"timer":{var i;const t=(0,U.httpsCallable)(J,"enableTimerIntegration");return null!==(i=(await t({organizationId:e})).data)&&void 0!==i&&i.success?(et(!0),Ye(e=>e.map(e=>"timer"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"connected"}):e)),{ok:!0}):a("Failed to enable timer")}case"pdfExport":{var r;const t=(0,U.httpsCallable)(J,"enablePdfExportIntegration");return null!==(r=(await t({organizationId:e})).data)&&void 0!==r&&r.success?(st(!0),Ye(e=>e.map(e=>"pdfExport"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"connected"}):e)),{ok:!0}):a("Failed to enable Export as PDF")}case"documentSignatures":{var l;const t=(0,U.httpsCallable)(J,"enableDocumentSignaturesIntegration");return null!==(l=(await t({organizationId:e})).data)&&void 0!==l&&l.success?(rt(!0),Ye(e=>e.map(e=>"documentSignatures"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"connected"}):e)),{ok:!0}):a("Failed to enable Document signatures")}case"documentLock":{var o;const t=(0,U.httpsCallable)(J,"enableDocumentLockIntegration");return null!==(o=(await t({organizationId:e})).data)&&void 0!==o&&o.success?(dt(!0),Ye(e=>e.map(e=>"documentLock"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"connected"}):e)),{ok:!0}):a("Failed to enable Document lock")}case"autoTitle":{var d;const t=(0,U.httpsCallable)(J,"enableAutoTitleIntegration");return null!==(d=(await t({organizationId:e})).data)&&void 0!==d&&d.success?(ut(!0),Ye(e=>e.map(e=>"autoTitle"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"connected"}):e)),{ok:!0}):a("Failed to enable Auto title")}case"autoCategory":{var c;const t=(0,U.httpsCallable)(J,"enableAutoCategoryIntegration");return null!==(c=(await t({organizationId:e})).data)&&void 0!==c&&c.success?(gt(!0),Ye(e=>e.map(e=>"autoCategory"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"connected"}):e)),{ok:!0}):a("Failed to enable Auto category")}case"sopEnhancement":{var m;const t=(0,U.httpsCallable)(J,"enableSopEnhancementIntegration");return null!==(m=(await t({organizationId:e})).data)&&void 0!==m&&m.success?(bt(!0),Ye(e=>e.map(e=>"sopEnhancement"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"connected"}):e)),{ok:!0}):a("Failed to enable SOP enhancement")}case"voice":{var u;const t=(0,U.httpsCallable)(J,"enableVoiceIntegration");return null!==(u=(await t({organizationId:e})).data)&&void 0!==u&&u.success?(At(!0),Ye(e=>e.map(e=>"voice"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"connected"}):e)),{ok:!0}):a("Failed to enable Voice")}case"pexels":{var x;const t=(0,U.httpsCallable)(J,"enablePexelsIntegration");return null!==(x=(await t({organizationId:e})).data)&&void 0!==x&&x.success?(Nt(!0),Ye(e=>e.map(e=>"pexels"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"connected"}):e)),{ok:!0}):a("Failed to enable Pexels Images")}case"forms":{var p;const t=(0,U.httpsCallable)(J,"enableFormsIntegration");return null!==(p=(await t({organizationId:e})).data)&&void 0!==p&&p.success?(Et(!0),Ye(e=>e.map(e=>"forms"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"connected"}):e)),{ok:!0}):a("Failed to enable Forms")}case"templateFill":{var g;const t=(0,U.httpsCallable)(J,"enableTemplateFillIntegration");return null!==(g=(await t({organizationId:e})).data)&&void 0!==g&&g.success?(zt(!0),Ye(e=>e.map(e=>"templateFill"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"connected"}):e)),{ok:!0}):a("Failed to enable Template Fill")}case"envVault":{var h;const t=(0,U.httpsCallable)(J,"enableEnvVaultIntegration");return null!==(h=(await t({organizationId:e})).data)&&void 0!==h&&h.success?(Ft(!0),Ye(e=>e.map(e=>"envVault"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"connected"}):e)),{ok:!0}):a("Failed to enable Env Vault")}case"customDomain":{var y;const t=(0,U.httpsCallable)(J,"enableCustomDomainIntegration");return null!==(y=(await t({organizationId:e})).data)&&void 0!==y&&y.success?(_t(!0),Ye(e=>e.map(e=>"customDomain"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"connected"}):e)),{ok:!0,navigateTo:"/profile?tab=custom-domain"}):a("Failed to enable Custom Domains")}case"cursorDevSync":{var b;const t=(0,U.httpsCallable)(J,"enableCursorDevSyncIntegration");return null!==(b=(await t({organizationId:e})).data)&&void 0!==b&&b.success?(Ye(e=>e.map(e=>"cursorDevSync"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"connected"}):e)),{ok:!0}):a("Failed to enable Cursor / VS Code extension")}case"emailToDocument":{var v;const t=(0,U.httpsCallable)(J,"enableEmailToDocumentIntegration"),n=await t({organizationId:e,addressMode:"defaultWorkspace"});return null!==(v=n.data)&&void 0!==v&&v.success?(Lt(!0),Bt(n.data.addressMode||"defaultWorkspace"),Yt(n.data.defaultWorkspaceId||""),Qt(n.data.addresses||[]),Ye(e=>e.map(e=>"emailToDocument"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"connected"}):e)),{ok:!0}):a("Failed to enable Email to Document")}case"emailAsk":{var f;const t=(0,U.httpsCallable)(J,"enableEmailAskIntegration"),n=await t({organizationId:e,addressMode:"defaultWorkspace",autoSendWhenConfident:!1});return null!==(f=n.data)&&void 0!==f&&f.success?(ba(!0),ja(n.data.addressMode||"defaultWorkspace"),Ca(n.data.defaultWorkspaceId||""),Va(!0===n.data.autoSendWhenConfident),kn(n.data.addresses||[]),Ye(e=>e.map(e=>"emailAsk"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"connected"}):e)),{ok:!0}):a("Failed to enable Email Ask")}default:return a("Unknown ability")}}catch(A){const e=(null===A||void 0===A?void 0:A.message)||(null===A||void 0===A?void 0:A.details)||"Failed to enable ".concat(t);return console.error("Error enabling ".concat(t,":"),null===A||void 0===A?void 0:A.code,e,A),a(e)}},zn=async(e,t)=>{let a=t.redirect;const s=window.location.origin+"/integrations";try{var n;const t=(0,U.httpsCallable)(J,"createStripeConnectAccount"),i=await t({organizationId:e,returnUrl:s+"?stripe_connect=return",refreshUrl:s+"?stripe_connect=refresh"});return null!==(n=i.data)&&void 0!==n&&n.url?(a&&(window.location.href=i.data.url),{ok:!0,url:i.data.url}):{ok:!1,errorMessage:"Could not start Stripe onboarding"}}catch(i){return console.error("Error starting Stripe Connect:",i),{ok:!1,errorMessage:i.message||"Failed to start Stripe Connect"}}},Dn=e=>"available"===e.status&&!e.alwaysOn,Tn=async()=>{Y("stripe");try{var e,t;const a=(0,H.getSelectedOrganizationId)();if(!a)return void q.Ay.error("No organization selected");const n=window.location.origin+"/integrations",i=(0,U.httpsCallable)(J,"completeStripeConnect"),r=await i({organizationId:a,returnUrl:n+"?stripe_connect=return",refreshUrl:n+"?stripe_connect=refresh"});null!==(e=r.data)&&void 0!==e&&e.connected?(fe(e=>(0,s.A)((0,s.A)({},e),{},{connected:!0,stripeConnectAccountId:e.stripeConnectAccountId,str
2ipeConnectChargesEnabled:!0,stripeConnectDetailsSubmitted:!0,stripeConnectAccountEmail:r.data.accountEmail||null,status:"connected"})),Ye(e=>e.map(e=>"stripe"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"connected"}):e)),q.Ay.success("Stripe account connected successfully!"),window.dispatchEvent(new Event("organizationChanged"))):null!==(t=r.data)&&void 0!==t&&t.onboardingUrl?window.location.href=r.data.onboardingUrl:q.Ay.error("Stripe onboarding is incomplete. Please try again.")}catch(a){console.error("Error completing Stripe Connect:",a),q.Ay.error(a.message||"Failed to complete Stripe Connect")}finally{Y(null)}},Fn=async()=>{if(!We||parseFloat(We)<=0)q.Ay.error("Please enter a valid hourly rate");else{Y("stripe");try{const e=(0,H.getSelectedOrganizationId)();if(!e)return void q.Ay.error("No organization selected");const t=(0,U.httpsCallable)(J,"updateStripeHourlyRate"),a=await t({organizationId:e,hourlyRate:parseFloat(We)});a.data.success&&(fe(e=>(0,s.A)((0,s.A)({},e),{},{hourlyRate:a.data.hourlyRate})),_e(We),Se(!1),Le(""),q.Ay.success("Hourly rate updated successfully!"))}catch(e){console.error("Error updating hourly rate:",e),q.Ay.error(e.message||"Failed to update hourly rate")}finally{Y(null)}}};return fn||ce||!re&&!pe?(0,$.jsx)(G.Ay,{}):vn?!re&&pe?(0,$.jsxs)("div",{className:"min-h-screen bg-gray-50",children:[(0,$.jsx)("div",{className:"bg-white border-b border-gray-200",children:(0,$.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,$.jsxs)("div",{className:"flex items-center justify-between h-16",children:[(0,$.jsx)("div",{className:"flex items-center",children:(0,$.jsxs)("a",{href:"/",className:"flex items-center text-gray-600 hover:text-gray-900",children:[(0,$.jsx)(l.A,{className:"h-5 w-5 mr-1"}),(0,$.jsx)("span",{children:"Back"})]})}),(0,$.jsx)("h1",{className:"text-xl font-semibold text-gray-900",children:"Based Abilities"}),(0,$.jsx)("div",{className:"w-32"})]})})}),(0,$.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:(0,$.jsx)("div",{className:"bg-red-50 border-l-4 border-red-500 p-6 rounded-md",children:(0,$.jsxs)("div",{className:"flex items-start",children:[(0,$.jsx)(o.A,{className:"h-6 w-6 text-red-500 mr-3 mt-0.5"}),(0,$.jsxs)("div",{children:[(0,$.jsx)("h3",{className:"text-lg font-medium text-red-800 mb-2",children:"Access Denied"}),(0,$.jsx)("p",{className:"text-sm text-red-700 mb-4",children:"You do not have permission to manage abilities. Only administrators can configure abilities for the workspace."}),(0,$.jsxs)("p",{className:"text-sm text-red-600",children:["Your current role: ",(0,$.jsx)("span",{className:"font-semibold capitalize",children:ae||"Unknown"})]})]})]})})})]}):(0,$.jsxs)("div",{className:"min-h-screen bg-gray-50",children:[(0,$.jsx)("div",{className:"bg-white border-b border-gray-200",children:(0,$.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,$.jsxs)("div",{className:"flex items-center justify-between h-16",children:[(0,$.jsx)("div",{className:"flex items-center",children:(0,$.jsxs)("a",{href:"/",className:"flex items-center text-gray-600 hover:text-gray-900",children:[(0,$.jsx)(l.A,{className:"h-5 w-5 mr-1"}),(0,$.jsx)("span",{children:"Back"})]})}),(0,$.jsx)("h1",{className:"text-xl font-semibold text-gray-900",children:"Based Abilities"}),(0,$.jsx)("div",{className:"w-32"})]})})}),(0,$.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[(0,$.jsxs)("div",{className:"mb-8",children:[(0,$.jsx)("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Based Abilities"}),(0,$.jsx)("p",{className:"text-gray-600",children:"Unlock powerful capabilities for your workspace. Active abilities appear at the top; turn them off to move them back to Available."})]}),cn&&(0,$.jsxs)("div",{className:"mb-6 p-4 bg-indigo-50 border border-indigo-200 rounded-lg flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[(0,$.jsx)("p",{className:"text-sm text-gray-800",children:"Stripe was added \u2014 finish connecting your account to accept payments."}),(0,$.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,$.jsx)("button",{type:"button",onClick:()=>{window.location.href=cn},className:"px-4 py-2 text-sm font-medium text-white bg-indigo-600 rounded-md hover:bg-indigo-700 transition-colors",children:"Continue to Stripe"}),(0,$.jsx)("button",{type:"button",onClick:()=>mn(null),className:"p-2 text-gray-500 hover:text-gray-700 rounded-md transition-colors","aria-label":"Dismiss Stripe reminder",children:(0,$.jsx)(d.A,{className:"h-5 w-5"})})]})]}),re&&He&&(0,$.jsxs)("div",{className:"mb-8",children:[(0,$.jsx)("div",{className:"h-4 w-48 bg-gray-200 rounded animate-pulse mb-3"}),(0,$.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:Array.from({length:9}).map((e,t)=>(0,$.jsxs)("div",{className:"bg-white rounded-lg border border-gray-200 p-6",children:[(0,$.jsxs)("div",{className:"flex items-start justify-between mb-4",children:[(0,$.jsxs)("div",{className:"flex items-center",children:[(0,$.jsx)("div",{className:"w-8 h-8 bg-gray-200 rounded animate-pulse mr-3"}),(0,$.jsxs)("div",{children:[(0,$.jsx)("div",{className:"h-5 w-28 bg-gray-200 rounded animate-pulse mb-2"}),(0,$.jsx)("div",{className:"h-4 w-16 bg-gray-100 rounded-full animate-pulse"})]})]}),(0,$.jsx)("div",{className:"w-5 h-5 bg-gray-100 rounded-full animate-pulse"})]}),(0,$.jsxs)("div",{className:"space-y-2 mb-4",children:[(0,$.jsx)("div",{className:"h-3 w-full bg-gray-200 rounded animate-pulse"}),(0,$.jsx)("div",{className:"h-3 w-5/6 bg-gray-200 rounded animate-pulse"}),(0,$.jsx)("div",{className:"h-3 w-3/4 bg-gray-100 rounded animate-pulse"})]}),(0,$.jsx)("div",{className:"h-8 w-24 bg-gray-200 rounded animate-pulse"})]},t))})]}),!He&&Ze.some(e=>
2"connected"===e.status)&&(0,$.jsxs)("div",{className:"mb-8",children:[(0,$.jsxs)("h3",{className:"text-sm font-semibold text-gray-500 uppercase tracking-wide mb-3",children:["Active",(0,$.jsxs)("span",{className:"ml-2 text-gray-400 font-normal normal-case",children:["(",Ze.filter(e=>"connected"===e.status||"pending"===e.status).length," Active Abilities)"]})]}),(0,$.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:Ze.filter(e=>"connected"===e.status||"pending"===e.status).map(t=>(0,$.jsxs)("div",{className:"bg-white rounded-lg border border-gray-200 p-6 hover:shadow-md transition-shadow",children:[(0,$.jsxs)("div",{className:"flex items-start justify-between mb-4",children:[(0,$.jsxs)("div",{className:"flex items-center",children:[t.logoComponent&&"stripe"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",style:{height:"32px",width:"auto"},children:(0,$.jsx)(Q,{className:"object-contain",style:{maxWidth:"140px",height:"32px"}})}):null,"versionControl"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(c.A,{className:"h-8 w-8 text-gray-700"})}):null,"timer"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(u,{className:"h-8 w-8 text-gray-700"})}):null,"cursorDevSync"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(R.A,{className:"h-8 w-8 text-gray-700"})}):null,"pdfExport"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(x.A,{className:"h-8 w-8 text-gray-700"})}):null,"documentSignatures"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(p.A,{className:"h-8 w-8 text-gray-700"})}):null,"documentLock"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(g.A,{className:"h-8 w-8 text-gray-700"})}):null,"autoTitle"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(h.A,{className:"h-8 w-8 text-gray-700"})}):null,"autoCategory"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(y.A,{className:"h-8 w-8 text-gray-700"})}):null,"sopEnhancement"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(b.A,{className:"h-8 w-8 text-gray-700"})}):null,"voice"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(v.A,{className:"h-8 w-8 text-gray-700"})}):null,"pexels"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(f.A,{className:"h-8 w-8 text-gray-700"})}):null,"forms"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(A.A,{className:"h-8 w-8 text-gray-700"})}):null,"templateFill"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(j.A,{className:"h-8 w-8 text-gray-700"})}):null,"envVault"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(w.A,{className:"h-8 w-8 text-gray-700"})}):null,"customDomain"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(N.A,{className:"h-8 w-8 text-gray-700"})}):null,"emailToDocument"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(k.A,{className:"h-8 w-8 text-gray-700"})}):null,"emailAsk"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(C.A,{className:"h-8 w-8 text-gray-700"})}):null,"mcp"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(E.A,{className:"h-8 w-8 text-gray-700"})}):null,!t.logoComponent&&"versionControl"!==t.id&&"timer"!==t.id&&"cursorDevSync"!==t.id&&"pdfExport"!==t.id&&"documentSignatures"!==t.id&&"documentLock"!==t.id&&"autoTitle"!==t.id&&"autoCategory"!==t.id&&"sopEnhancement"!==t.id&&"voice"!==t.id&&"pexels"!==t.id&&"forms"!==t.id&&"templateFill"!==t.id&&"envVault"!==t.id&&"customDomain"!==t.id&&"emailToDocument"!==t.id&&"emailAsk"!==t.id&&"mcp"!==t.id&&(0,$.jsx)("div",{className:"text-3xl mr-3",children:t.icon}),(0,$.jsxs)("div",{children:[("versionControl"===t.id||"timer"===t.id||"cursorDevSync"===t.id||"pdfExport"===t.id||"documentSignatures"===t.id||"documentLock"===t.id||"autoTitle"===t.id||"autoCategory"===t.id||"sopEnhancement"===t.id||"voice"===t.id||"pexels"===t.id||"forms"===t.id||"templateFill"===t.id||"envVault"===t.id||"customDomain"===t.id||"emailToDocument"===t.id||"emailAsk"===t.id||"mcp"===t.id||!t.logoComponent)&&(0,$.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:t.name}),(0,$.jsx)("span",{className:"text-xs text-gray-500 bg-gray-100 px-2 py-1 rounded",children:t.category})]})]}),(0,$.jsx)("div",{className:"flex items-center text-green-600",children:(0,$.jsx)(S.A,{className:"h-5 w-5"})})]}),(0,$.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:t.description}),"mcp"===t.id&&(0,$.jsxs)("div",{className:"mb-4",children:[(0,$.jsx)("p",{className:"text-xs text-gray-500 mb-2",children:"Works with"}),(0,$.jsxs)("div",{className:"flex items-center gap-3",children:[(0,$.jsxs)("div",{className:"flex items-center gap-1.5 px-2.5 py-1.5 bg-gray-50 border border-gray-200 rounded-md",children:[(0,$.jsx)(P.A,{size:16}),(0,$.jsx)("span",{className:"text-xs font-medium text-gray-700",children:"Claude"})]}),(0,$.jsxs)("div",{className:"flex items-center gap-1.5 px-2.5 py-1.5 bg-gray-50 border border-gray-200 rounded-md",children:[(0,$.jsx)(_.A,{size:16}),(0,$.jsx)("span",{className:"text-xs font-medium text-gray-700",children:"ChatGPT"})]})]})]}),"stripe"===t.id&&"connected"===t.status&&(0,$.jsxs)("div",{className:"mb-4 space-y-2",children:[ve.stripeConnectAccountEmail&&(0,$.jsxs)("div",{className:"p-3 bg-green-50 rounded-md",children:[(0,$.jsx)("p",{className:"text-xs text-gray-600",children:"Connected Account"}),(0,$.jsx)("p",{className:"text-sm font-medium text-gray-900",children:ve.
2stripeConnectAccountEmail})]}),ve.hourlyRate?(0,$.jsx)("div",{className:"p-3 bg-blue-50 rounded-md",children:(0,$.jsxs)("div",{className:"flex items-center justify-between",children:[(0,$.jsxs)("div",{children:[(0,$.jsx)("p",{className:"text-xs text-gray-600",children:"Hourly Rate"}),(0,$.jsxs)("p",{className:"text-lg font-semibold text-gray-900",children:["$",ve.hourlyRate.toFixed(2),"/hr"]})]}),(0,$.jsx)("button",{onClick:()=>{Le(Re),Se(!0)},className:"p-2 text-gray-600 hover:text-gray-900 hover:bg-blue-100 rounded transition-colors",children:(0,$.jsx)(I.A,{className:"h-4 w-4"})})]})}):(0,$.jsx)("button",{onClick:()=>{Le(""),Ne(!0)},className:"w-full text-left p-3 bg-yellow-50 border border-yellow-200 rounded-md hover:bg-yellow-100 transition-colors",children:(0,$.jsx)("p",{className:"text-xs font-medium text-yellow-800",children:"Set your hourly rate to start invoicing"})})]}),"stripe"===t.id&&"pending"===t.status&&(0,$.jsx)("div",{className:"mb-4",children:(0,$.jsxs)("div",{className:"p-3 bg-yellow-50 border border-yellow-200 rounded-md",children:[(0,$.jsx)("p",{className:"text-xs font-medium text-yellow-800 mb-2",children:"Stripe onboarding incomplete"}),(0,$.jsx)("button",{onClick:Tn,disabled:null!==m,className:"px-3 py-1.5 text-xs font-medium text-white bg-yellow-600 rounded hover:bg-yellow-700 transition-colors disabled:opacity-50",children:"stripe"===m?(0,$.jsxs)("span",{className:"flex items-center",children:[(0,$.jsx)(G.y$,{size:"sm",className:"mr-1"}),"Checking..."]}):"Complete Setup"})]})}),"forms"===t.id&&"connected"===t.status&&(0,$.jsxs)("div",{className:"mb-4 p-3 bg-blue-50 rounded-md",children:[(0,$.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,$.jsxs)("div",{className:"flex items-center",children:[(0,$.jsx)(k.A,{className:"h-4 w-4 text-gray-500 mr-1.5"}),(0,$.jsx)("p",{className:"text-xs font-medium text-gray-600",children:"Notification Emails"})]}),(0,$.jsx)("button",{onClick:()=>{_s(ws),Ls(Es),Ts(!0)},className:"p-1.5 text-gray-600 hover:text-gray-900 hover:bg-blue-100 rounded transition-colors",children:(0,$.jsx)(I.A,{className:"h-4 w-4"})})]}),(0,$.jsx)("p",{className:"text-sm text-gray-800 break-all",children:ws||(0,$.jsx)("span",{className:"text-gray-400 italic",children:"Workspace owner (default)"})}),Es&&(0,$.jsxs)("p",{className:"text-xs text-gray-500 mt-1.5 flex items-center",children:[(0,$.jsx)(S.A,{className:"h-3 w-3 mr-1 text-green-600"}),"Respondent receives a copy"]})]}),"customDomain"===t.id&&"connected"===t.status&&(0,$.jsx)("div",{className:"mb-4 p-3 bg-blue-50 rounded-md",children:(0,$.jsxs)("div",{className:"flex items-center justify-between",children:[(0,$.jsxs)("div",{children:[(0,$.jsx)("p",{className:"text-xs font-medium text-gray-600",children:"Hostname setup"}),(0,$.jsx)("p",{className:"text-xs text-gray-500 mt-0.5",children:"Configure DNS and primary share on Profile"})]}),(0,$.jsx)("button",{type:"button",onClick:()=>e("/profile?tab=custom-domain"),className:"p-1.5 text-gray-600 hover:text-gray-900 hover:bg-blue-100 rounded transition-colors",title:"Settings",children:(0,$.jsx)(I.A,{className:"h-4 w-4"})})]})}),"emailToDocument"===t.id&&"connected"===t.status&&(0,$.jsxs)("div",{className:"mb-4 p-3 bg-blue-50 rounded-md space-y-3",children:[(0,$.jsxs)("div",{className:"flex items-center justify-between",children:[(0,$.jsxs)("div",{children:[(0,$.jsx)("p",{className:"text-xs font-medium text-gray-600",children:"Inbound addresses"}),(0,$.jsx)("p",{className:"text-xs text-gray-500 mt-0.5",children:"perWorkspace"===Ht?"Unique address per workspace":"One address \u2192 default workspace"})]}),(0,$.jsx)("button",{type:"button",onClick:()=>Nn({mode:"settings"}),className:"p-1.5 text-gray-600 hover:text-gray-900 hover:bg-blue-100 rounded transition-colors",title:"Settings",children:(0,$.jsx)(I.A,{className:"h-4 w-4"})})]}),0===Jt.length?(0,$.jsx)("p",{className:"text-sm text-gray-500 italic",children:"No addresses yet \u2014 open settings to regenerate."}):(0,$.jsx)("ul",{className:"space-y-2",children:Jt.map(e=>(0,$.jsxs)("li",{className:"bg-white/70 border border-blue-100 rounded-md p-2",children:["perWorkspace"===Ht&&(0,$.jsx)("p",{className:"text-xs font-medium text-gray-700 mb-1",children:e.workspaceName||"Workspace"}),(0,$.jsxs)("div",{className:"flex items-start gap-2",children:[(0,$.jsx)("code",{className:"text-xs text-gray-800 break-all flex-1",children:e.address}),(0,$.jsx)("button",{type:"button",onClick:()=>(async e=>{if(e)try{await navigator.clipboard.writeText(e),q.Ay.success("Address copied")}catch(t){q.Ay.error("Could not copy address")}})(e.address),className:"p-1 text-gray-600 hover:text-gray-900 hover:bg-blue-100 rounded shrink-0",title:"Copy address",children:(0,$.jsx)(z.A,{className:"h-3.5 w-3.5"})}),(0,$.jsx)("button",{type:"button",onClick:()=>(async e=>{const t=Hs||(0,H.getSelectedOrganizationId)();if(t){Y("emailToDocument");try{var a;const s=(0,U.httpsCallable)(J,"regenerateEmailToDocumentAddress"),n={organizationId:t};"perWorkspace"===Ht&&e&&(n.workspaceId=e);const i=await s(n);null!==(a=i.data)&&void 0!==a&&a.addresses?Qt(i.data.addresses):await wn(t),q.Ay.success("Address regenerated")}catch(s){console.error("Error regenerating Email to Document address:",s),q.Ay.error(s.message||"Failed to regenerate address")}finally{Y(null)}}else q.Ay.error("No organization selected")})(e.workspaceId),disabled:null!==m,className:"text-[11px] font-medium text-blue-700 hover:underline shrink-0 disabled:opacity-50",children:"Regenerate"})]})]},e.token||e.address))}),(0,$.jsx)("p",{className:"text-xs text-gray-500",children:"Send or forward from an org member email. Email body only (attachments ignored for now). AI structures the content into a completed document."})]}),"emailAsk"===t.id&&"connected"===t.status&&(0,$.jsxs)("div",{className:"mb-4 p-3 bg-blue-50 rounded-md space-y-3",children:[(0,$.jsxs)("div",{className:"flex items-center justify-between",children:[(0,$.jsxs)("div",{children:[(0,$.jsx)("p",{className:"text-xs font-medium text-gray-600",children:"Ask addresses"}),(0,$.jsxs)("p",{className:"text-xs text-gray-500 mt-0.5",children:["perWorkspace"===Aa?"Unique address per workspace":"One address \u2192 default workspace",Pa?" \xb7 Auto-send when confident":" \xb7 Drafts only (review before send)"]})]}),(0,$.jsx)("button",{type:"button",onClick:()=>Sn({mode:"settings"}),className:"p-1.5 text-gray-600 hover:text-gray-900 hover:bg-blue-100 rounded transition-colors",title:"Settings",children:(0,$.jsx)(I.A,{className:"h-4 w-4"})})]}),0===Ia.length?(0,$.jsx)("p",{className:"text-sm text-gray-500 italic",children:"No addresses yet \u2014 open settings to regenerate."}):(()=>{const e="perWorkspace"===Aa&&Ia.find(e=>
2e.workspaceId===Fa)||Ia[0];return e?(0,$.jsxs)("div",{className:"bg-white/70 border border-blue-100 rounded-md p-2 space-y-2",children:["perWorkspace"===Aa&&(0,$.jsxs)("div",{children:[(0,$.jsx)("label",{className:"block text-[11px] font-medium text-gray-600 mb-1",children:"Workspace"}),(0,$.jsx)("select",{value:e.workspaceId||"",onChange:e=>Ma(e.target.value),className:"w-full px-2.5 py-1.5 border border-gray-300 rounded-md text-sm bg-white focus:ring-blue-500 focus:border-blue-500",children:Ia.map(e=>(0,$.jsx)("option",{value:e.workspaceId,children:e.workspaceName||"Workspace"},e.token||e.workspaceId))})]}),(0,$.jsxs)("div",{className:"flex items-start gap-2",children:[(0,$.jsx)("code",{className:"text-xs text-gray-800 break-all flex-1",children:e.address}),(0,$.jsx)("button",{type:"button",onClick:()=>(async e=>{if(e)try{await navigator.clipboard.writeText(e),q.Ay.success("Address copied")}catch(t){q.Ay.error("Could not copy address")}})(e.address),className:"p-1 text-gray-600 hover:text-gray-900 hover:bg-blue-100 rounded shrink-0",title:"Copy address",children:(0,$.jsx)(z.A,{className:"h-3.5 w-3.5"})}),(0,$.jsx)("button",{type:"button",onClick:()=>(async e=>{const t=Hs||(0,H.getSelectedOrganizationId)();if(t){Y("emailAsk");try{var a;const s=(0,U.httpsCallable)(J,"regenerateEmailAskAddress"),n={organizationId:t};"perWorkspace"===Aa&&e&&(n.workspaceId=e);const i=await s(n);null!==(a=i.data)&&void 0!==a&&a.addresses?kn(i.data.addresses):await Cn(t),q.Ay.success("Address regenerated")}catch(s){console.error("Error regenerating Email Ask address:",s),q.Ay.error(s.message||"Failed to regenerate address")}finally{Y(null)}}else q.Ay.error("No organization selected")})(e.workspaceId),disabled:null!==m,className:"text-[11px] font-medium text-blue-700 hover:underline shrink-0 disabled:opacity-50",children:"Regenerate"})]})]}):null})(),(0,$.jsxs)("div",{className:"border-t border-blue-100 pt-3 space-y-2",children:[(0,$.jsxs)("div",{className:"flex items-center justify-between",children:[(0,$.jsx)("p",{className:"text-xs font-medium text-gray-600",children:"Reply drafts"}),(0,$.jsx)("button",{type:"button",onClick:()=>En(Hs),className:"text-[11px] font-medium text-blue-700 hover:underline",children:"Refresh"})]}),0===Oa.length?(0,$.jsx)("p",{className:"text-sm text-gray-500 italic",children:"No open drafts. Email a question to your ask address to create one."}):(0,$.jsx)("ul",{className:"space-y-3",children:Oa.map(e=>(0,$.jsxs)("li",{className:"bg-white/80 border border-blue-100 rounded-md p-2.5 space-y-2",children:[(0,$.jsx)("div",{className:"flex items-start justify-between gap-2",children:(0,$.jsxs)("div",{className:"min-w-0",children:[(0,$.jsx)("p",{className:"text-xs font-medium text-gray-800 truncate",children:e.subject||"(no subject)"}),(0,$.jsxs)("p",{className:"text-[11px] text-gray-500 truncate",children:["From ",e.fromEmail||"unknown",e.noAnswer?" \xb7 No confident answer":" \xb7 ".concat(e.confidence||"low"," confidence")]})]})}),qa===e.id?(0,$.jsx)("textarea",{value:$a,onChange:e=>Ka(e.target.value),rows:5,className:"w-full text-xs border border-gray-300 rounded-md p-2 focus:ring-blue-500 focus:border-blue-500"}):(0,$.jsx)("p",{className:"text-xs text-gray-700 whitespace-pre-wrap max-h-28 overflow-y-auto",children:e.proposedAnswer||"(empty answer)"}),(0,$.jsxs)("div",{className:"flex flex-wrap gap-2",children:[qa===e.id?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)("button",{type:"button",onClick:()=>(async e=>{const t=Hs||(0,H.getSelectedOrganizationId)();if(t&&null!==e&&void 0!==e&&e.id){Y("emailAskDraft-".concat(e.id));try{var a;const s=(0,U.httpsCallable)(J,"updateEmailAskDraft");if(null===(a=(await s({organizationId:t,draftId:e.id,proposedAnswer:$a})).data)||void 0===a||!a.success)return void q.Ay.error("Failed to save draft");q.Ay.success("Draft updated"),Ga(null),Ka(""),await En(t)}catch(s){console.error("Error updating Email Ask draft:",s),q.Ay.error(s.message||"Failed to save draft")}finally{Y(null)}}})(e),disabled:null!==m,className:"text-[11px] font-medium text-blue-700 hover:underline disabled:opacity-50",children:"Save"}),(0,$.jsx)("button",{type:"button",onClick:()=>{Ga(null),Ka("")},className:"text-[11px] font-medium text-gray-600 hover:underline",children:"Cancel"})]}):(0,$.jsx)("button",{type:"button",onClick:()=>{Ga(e.id),Ka(e.proposedAnswer||"")},className:"text-[11px] font-medium text-blue-700 hover:underline",children:"Edit"}),(0,$.jsx)("button",{type:"button",onClick:()=>(async e=>{const t=Hs||(0,H.getSelectedOrganizationId)();if(t&&null!==e&&void 0!==e&&e.id){Y("emailAskDraft-".concat(e.id));try{var a;const s=(0,U.httpsCallable)(J,"sendEmailAskDraft"),n=qa===e.id?$a:e.proposedAnswer;if(null===(a=(await s({organizationId:t,draftId:e.id,proposedAnswer:n})).data)||void 0===a||!a.success)return void q.Ay.error("Failed to send reply");q.Ay.success("Reply sent"),Ga(null),Ka(""),await En(t)}catch(s){console.error("Error sending Email Ask draft:",s),q.Ay.error(s.message||"Failed to send reply")}finally{Y(null)}}})(e),disabled:null!==m,className:"text-[11px] font-medium text-green-700 hover:underline disabled:opacity-50",children:m==="emailAskDraft-".concat(e.id)?"Sending\u2026":"Send"}),(0,$.jsx)("button",{type:"button",onClick:()=>(async e=>{const t=Hs||(0,H.getSelectedOrganizationId)();if(t&&null!==e&&void 0!==e&&e.id){Y("emailAskDraft-".concat(e.id));try{var a;const s=(0,U.httpsCallable)(J,"discardEmailAskDraft");if(null===(a=(await s({organizationId:t,draftId:e.id})).data)||void 0===a||!a.success)return void q.Ay.error("Failed to discard draft");q.Ay.success("Draft discarded"),qa===e.id&&(Ga(null),Ka("")),await En(t)}catch(s){console.error("Error discarding Email Ask draft:",s),q.Ay.error(s.message||"Failed to discard draft")}finally{Y(null)}}})(e),disabled:null!==m,className:"text-[11px] font-medium text-red-600 hover:underline disabled:opacity-50",children:"Discard"})]})]},e.id))})]}),(0,$.jsx)("p",{className:"text-xs text-gray-500",children:"Ask from an org member email. Based replies from your knowledge base, or par
2ks a draft here when unsure."})]}),"cursorDevSync"===t.id&&"connected"===t.status&&(0,$.jsxs)("div",{className:"mb-4 p-3 bg-slate-50 border border-slate-200 rounded-md space-y-2 text-sm text-gray-700",children:[(0,$.jsx)("p",{className:"text-xs font-semibold text-gray-800 uppercase tracking-wide",children:"Setup"}),(0,$.jsxs)("a",{href:W(null===pn||void 0===pn?void 0:pn.version),download:V,className:"inline-flex items-center gap-1.5 px-3 py-2 text-xs font-medium text-white bg-slate-800 rounded-md hover:bg-slate-900 transition-colors w-fit",children:[(0,$.jsx)(x.A,{className:"h-3.5 w-3.5 shrink-0"}),"Download extension (.vsix)"]}),(null===pn||void 0===pn?void 0:pn.version)&&(0,$.jsxs)("p",{className:"text-xs text-gray-500",children:["Extension version ",(0,$.jsxs)("span",{className:"font-medium text-gray-700",children:["v",pn.version]})," (matches this download)."]}),(0,$.jsxs)("ol",{className:"list-decimal list-inside space-y-1 text-xs",children:[(0,$.jsx)("li",{children:(0,$.jsxs)("a",{href:"https://cursor.com",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:underline inline-flex items-center gap-1",children:["Install Cursor ",(0,$.jsx)(D.A,{className:"h-3 w-3 shrink-0"})]})}),(0,$.jsxs)("li",{children:["In Cursor: ",(0,$.jsx)("strong",{children:"Extensions"})," \u2192 ",(0,$.jsx)("strong",{children:"Install from VSIX\u2026"})," and choose the file you downloaded."]}),(0,$.jsxs)("li",{children:["Command Palette \u2192 ",(0,$.jsx)("strong",{children:"Based: Sign in"}),", then ",(0,$.jsx)("strong",{children:"Based: Link folder\u2026"})," and pick your organization, workspace, and document."]})]}),(0,$.jsxs)("p",{className:"text-xs text-gray-600 border-t border-slate-200 pt-2 mt-2",children:["Work sessions from Cursor will be automatically added to the document as time tracked. In order for this to happen automatically on each commit, the extension can install git commit logging (you\u2019ll confirm first). Need help? Just message us at"," ",(0,$.jsx)("a",{href:"mailto:[email protected]",className:"text-blue-600 hover:underline",children:"[email protected]"}),"."]})]}),(0,$.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:["documentSignatures"===t.id&&(0,$.jsx)(K,{}),t.alwaysOn?(0,$.jsxs)("button",{onClick:()=>Ys(!0),className:"flex items-center px-4 py-2 text-sm font-medium text-blue-700 bg-blue-50 rounded-md hover:bg-blue-100 transition-colors",children:[(0,$.jsx)(T,{className:"h-4 w-4 mr-2"}),"Learn how to use"]}):(0,$.jsxs)("button",{onClick:()=>(async e=>{let t=!1;if("stripe"===e&&Te(!0),"versionControl"===e){Y(e);try{var a;const e=(0,H.getSelectedOrganizationId)();if(!e)return void q.Ay.error("No organization selected");const n=(0,U.httpsCallable)(J,"disableVersionControlIntegration");null!==(a=(await n({organizationId:e})).data)&&void 0!==a&&a.success&&(Je(!1),Ye(e=>e.map(e=>"versionControl"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"available"}):e)),q.Ay.success("Version control disabled"),t=!0)}catch(f){console.error("Error disabling version control:",f),q.Ay.error(f.message||"Failed to disable version control")}finally{Y(null)}}if("timer"===e){Y(e);try{var n;const e=(0,H.getSelectedOrganizationId)();if(!e)return void q.Ay.error("No organization selected");const a=(0,U.httpsCallable)(J,"disableTimerIntegration");null!==(n=(await a({organizationId:e})).data)&&void 0!==n&&n.success&&(et(!1),Ye(e=>e.map(e=>"timer"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"available"}):e)),q.Ay.success("Timer disabled"),t=!0)}catch(f){console.error("Error disabling timer:",f),q.Ay.error(f.message||"Failed to disable timer")}finally{Y(null)}}if("cursorDevSync"===e){Y(e);try{var i;const e=(0,H.getSelectedOrganizationId)();if(!e)return void q.Ay.error("No organization selected");const a=(0,U.httpsCallable)(J,"disableCursorDevSyncIntegration");null!==(i=(await a({organizationId:e})).data)&&void 0!==i&&i.success&&(Ye(e=>e.map(e=>"cursorDevSync"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"available"}):e)),q.Ay.success("Cursor / VS Code extension disabled"),t=!0)}catch(f){console.error("Error disabling Cursor / VS Code extension:",f),q.Ay.error(f.message||"Failed to disable Cursor / VS Code extension")}finally{Y(null)}}if("pdfExport"===e){Y(e);try{var r;const e=(0,H.getSelectedOrganizationId)();if(!e)return void q.Ay.error("No organization selected");const a=(0,U.httpsCallable)(J,"disablePdfExportIntegration");null!==(r=(await a({organizationId:e})).data)&&void 0!==r&&r.success&&(st(!1),Ye(e=>e.map(e=>"pdfExport"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"available"}):e)),q.Ay.success("Export as PDF disabled"),t=!0)}
2catch(f){console.error("Error disabling PDF export:",f),q.Ay.error(f.message||"Failed to disable Export as PDF")}finally{Y(null)}}if("documentSignatures"===e){Y(e);try{var l;const e=(0,H.getSelectedOrganizationId)();if(!e)return void q.Ay.error("No organization selected");const a=(0,U.httpsCallable)(J,"disableDocumentSignaturesIntegration");null!==(l=(await a({organizationId:e})).data)&&void 0!==l&&l.success&&(rt(!1),Ye(e=>e.map(e=>"documentSignatures"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"available"}):e)),q.Ay.success("Document signatures disabled"),t=!0)}catch(f){console.error("Error disabling Document signatures:",f),q.Ay.error(f.message||"Failed to disable Document signatures")}finally{Y(null)}}if("documentLock"===e){Y(e);try{var o;const e=(0,H.getSelectedOrganizationId)();if(!e)return void q.Ay.error("No organization selected");const a=(0,U.httpsCallable)(J,"disableDocumentLockIntegration");null!==(o=(await a({organizationId:e})).data)&&void 0!==o&&o.success&&(dt(!1),Ye(e=>e.map(e=>"documentLock"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"available"}):e)),q.Ay.success("Document lock disabled"),t=!0)}catch(f){console.error("Error disabling Document lock:",f),q.Ay.error(f.message||"Failed to disable Document lock")}finally{Y(null)}}if("autoTitle"===e){Y(e);try{var d;const e=(0,H.getSelectedOrganizationId)();if(!e)return void q.Ay.error("No organization selected");const a=(0,U.httpsCallable)(J,"disableAutoTitleIntegration");null!==(d=(await a({organizationId:e})).data)&&void 0!==d&&d.success&&(ut(!1),Ye(e=>e.map(e=>"autoTitle"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"available"}):e)),q.Ay.success("Auto title disabled"),t=!0)}catch(f){console.error("Error disabling Auto title:",f),q.Ay.error(f.message||"Failed to disable Auto title")}finally{Y(null)}}if("autoCategory"===e){Y(e);try{var c;const e=(0,H.getSelectedOrganizationId)();if(!e)return void q.Ay.error("No organization selected");const a=(0,U.httpsCallable)(J,"disableAutoCategoryIntegration");null!==(c=(await a({organizationId:e})).data)&&void 0!==c&&c.success&&(gt(!1),Ye(e=>e.map(e=>"autoCategory"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"available"}):e)),q.Ay.success("Auto category disabled"),t=!0)}catch(f){console.error("Error disabling Auto category:",f),q.Ay.error(f.message||"Failed to disable Auto category")}finally{Y(null)}}if("sopEnhancement"===e){Y(e);try{var m;const e=(0,H.getSelectedOrganizationId)();if(!e)return void q.Ay.error("No organization selected");const a=(0,U.httpsCallable)(J,"disableSopEnhancementIntegration");null!==(m=(await a({organizationId:e})).data)&&void 0!==m&&m.success&&(bt(!1),Ye(e=>e.map(e=>"sopEnhancement"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"available"}):e)),q.Ay.success("Update with AI disabled"),t=!0)}catch(f){console.error("Error disabling SOP enhancement:",f),q.Ay.error(f.message||"Failed to disable SOP enhancement")}finally{Y(null)}}if("voice"===e){Y(e);try{var u;const e=(0,H.getSelectedOrganizationId)();if(!e)return void q.Ay.error("No organization selected");const a=(0,U.httpsCallable)(J,"disableVoiceIntegration");null!==(u=(await a({organizationId:e})).data)&&void 0!==u&&u.success&&(At(!1),Ye(e=>e.map(e=>"voice"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"available"}):e)),q.Ay.success("Voice disabled"),t=!0)}catch(f){console.error("Error disabling Voice:",f),q.Ay.error(f.message||"Failed to disable Voice")}finally{Y(null)}}if("pexels"===e){Y(e);try{var x;const e=(0,H.getSelectedOrganizationId)();if(!e)return void q.Ay.error("No organization selected");const a=(0,U.httpsCallable)(J,"disablePexelsIntegration");null!==(x=(await a({organizationId:e})).data)&&void 0!==x&&x.success&&(Nt(!1),Ye(e=>e.map(e=>"pexels"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"available"}):e)),q.Ay.success("Pexels Images disabled"),t=!0)}catch(f){console.error("Error disabling Pexels:",f),q.Ay.error(f.message||"Failed to disable Pexels Images")}finally{Y(null)}}if("forms"===e){Y(e);try{var p;const e=(0,H.getSelectedOrganizationId)();if(!e)return void q.Ay.error("No organization selected");const a=(0,U.httpsCallable)(J,"disableFormsIntegration");null!==(p=(await a({organizationId:e})).data)&&void 0!==p&&p.success&&(Et(!1),Ye(e=>e.map(e=>"forms"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"available"}):e)),q.Ay.success("Forms disabled"),t=!0)}catch(f){console.error("Error disabling Forms:",f),q.Ay.error(f.message||"Failed to disable Forms")}finally{Y(null)}}if("templateFill"===e){Y(e);try{var g;const e=(0,H.getSelectedOrganizationId)();if(!e)return void q.Ay.error("No organization selected");const a=(0,U.httpsCallable)(J,"disableTemplateFillIntegration");null!==(g=(await a({organizationId:e})).data)&&void 0!==g&&g.success&&(zt(!1),Ye(e=>e.map(e=>"templateFill"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"available"}):e)),q.Ay.success("Template Fill disabled"),t=!0)}catch(f){console.error("Error disabling Template Fill:",f),q.Ay.error(f.message||"Failed to disable Template Fill")}finally{Y(null)}}if("envVault"===e){Y(e);try{var h;const e=(0,H.getSelectedOrganizationId)();if(!e)return void q.Ay.error("No organization selected");const a=(0,U.httpsCallable)(J,"disableEnvVaultIntegration");null!==(h=(await a({organizationId:e})).data)&&void 0!==h&&h.success&&(Ft(!1),Ye(e=>e.map(e=>"envVault"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"available"}):e)),q.Ay.success("Env Vault disabled"),t=!0)}catch(f){console.error("Error disabling Env Vault:",f),q.Ay.error(f.message||"Failed to disable Env Vault")}finally{Y(null)}}if("customDomain"===e){Y(e);try{var y;const e=(0,H.getSelectedOrganizationId)();if(!e)return void q.Ay.error("No organization selected");const a=(0,U.httpsCallable)(J,"disableCustomDomainIntegration");null!==(y=(await a({organizationId:e})).data)&&void 0!==y&&y.success&&(_t(!1),Ye(e=>e.map(e=>"customDomain"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"available"}):e)),q.Ay.success("Custom Domains disabled"),t=!0)}catch(f){console.error("Error disabling Custom Domains:",f),q.Ay.error(f.message||"Failed to disable Custom Domains")}finally{Y(null)}}if("emailToDocument"===e){Y(e);try{var b;const e=(0,H.getSelectedOrganizationId)();if(!e)return void q.Ay.error("No organization selected");const a=(0,U.httpsCallable)(J,"disableEmailToDocumentIntegration");null!==(b=(await a({organizationId:e})).data)&&void 0!==b&&b.success&&(Lt(!1),Qt([]),Ye(e=>e.map(e=>"emailToDocument"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"available"}):e)),q.Ay.success("Email to Document disabled"),t=!0)}catch(f){console.error("Error disabling Email to Document:",f),q.Ay.error(f.message||"Failed to disable Email to Document")}finally{Y(null)}}if("emailAsk"===e){Y(e);try{var v;const e=(0,H.getSelectedOrganizationId)();if(!e)return void q.Ay.error("No organization selected");const a=(0,U.httpsCallable)(J,"disableEmailAskIntegration");null!==(v=(await a({organizationId:e})).data)&&void 0!==v&&v.success&&(ba(!1),kn([]),Ua([]),Ye(e=>e.map(e=>"emailAsk"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"available"}):e)),q.Ay.success("Email Ask disabled"),t=!0)}catch(f){console.error("Error disabling Email Ask:",f),q.Ay.error(f.message||"Failed to disable Email Ask")}finally{Y(null)}}t&&window.dispatchEvent(new Event("organizationChanged"))})(t.id),disabled:null!==m,className:"flex items-center px-4 py-2 text-sm font-medium text-red-700 bg-red-50 rounded-md hover:bg-red-100 transition-colors disabled:opacity-50",children:[m===t.id?(0,$.jsx)(G.y$,{size:"sm",className:"mr-2"}):(0,$.jsx)(d.A,{className:"h-4 w-4 mr-2"}),"power-up"===t.kind?"Deactivate":"Disconnect"]})]})]},t.id))})]}),!He&&(0,$.jsxs)("div",{children:[(0,$.jsxs)("div",{className:"flex flex-col lg:flex-row lg:items-end lg:justify-between gap-3 mb-3",children:[(0,$.jsxs)("h3",{className:"text-sm font-semibold text-gray-500 uppercase tracking-wide",children:["Available",(0,$.jsxs)("span",{className:"ml-2 text-gray-400 font-normal normal-case",children:["(",Ze.f
2ilter(e=>"available"===e.status).length," Available Abilities)"]})]}),(0,$.jsxs)("div",{className:"flex flex-col sm:flex-row sm:flex-wrap sm:items-center gap-2",children:[(0,$.jsx)("p",{className:"text-sm text-gray-600 sm:mr-1",children:"Select several abilities, then activate them together."}),(0,$.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,$.jsx)("button",{type:"button",onClick:()=>ln(Ze.filter(Dn).map(e=>e.id)),disabled:null!==m||0===Ze.filter(Dn).length,className:"px-3 py-1.5 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"Select all"}),(0,$.jsx)("button",{type:"button",onClick:()=>ln([]),disabled:null!==m||0===rn.length,className:"px-3 py-1.5 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"Clear selection"}),(0,$.jsx)(Z.A,{type:"button",size:"md",onClick:async()=>{const e=Hs||(0,H.getSelectedOrganizationId)();if(!e)return void q.Ay.error("No organization selected");const t=Ze.filter(Dn),a=new Set(t.map(e=>e.id)),s=rn.filter(e=>a.has(e));if(0===s.length)return void q.Ay.error("Select at least one available ability");const n=s.filter(e=>"stripe"!==e),i=s.includes("stripe");Y("batch");const r=[],l=[];let o=0;try{for(const t of n){const a=await In(e,t);a.ok?(r.push(t),o+=1):l.push({id:t,message:a.errorMessage||"Failed"})}if(i){const t=await zn(e,{redirect:!1});t.ok?(r.push("stripe"),mn(t.url),await An(e)):l.push({id:"stripe",message:t.errorMessage||"Failed"})}o>0&&q.Ay.success(1===o?"Activated 1 ability":"Activated ".concat(o," abilities")),i&&r.includes("stripe")&&(0,q.Ay)("Finish Stripe setup to accept payments \u2014 use Continue to Stripe below.",{icon:"\ud83d\udcb3"}),l.length>0&&q.Ay.error(1===l.length?"".concat(l[0].id,": ").concat(l[0].message):"".concat(l.length," abilities could not be activated")),ln(e=>e.filter(e=>!r.includes(e))),r.length>0&&window.dispatchEvent(new Event("organizationChanged"))}finally{Y(null)}},disabled:null!==m||0===rn.length||He,loading:"batch"===m,className:"inline-flex items-center px-4 py-2 text-sm rounded-md transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"batch"===m?"Activating\u2026":"Activate selected (".concat(rn.length,")")})]})]})]}),(0,$.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:Ze.filter(e=>"available"===e.status).map(t=>(0,$.jsxs)("div",{className:"bg-white rounded-lg border border-gray-200 p-6 hover:shadow-md transition-shadow",children:[(0,$.jsxs)("div",{className:"flex items-start justify-between mb-4 gap-2",children:[(0,$.jsxs)("div",{className:"flex items-center min-w-0",children:[t.logoComponent&&"stripe"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",style:{height:"32px",width:"auto"},children:(0,$.jsx)(Q,{className:"object-contain",style:{maxWidth:"140px",height:"32px"}})}):null,"versionControl"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(c.A,{className:"h-8 w-8 text-gray-700"})}):null,"timer"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(u,{className:"h-8 w-8 text-gray-700"})}):null,"cursorDevSync"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(R.A,{className:"h-8 w-8 text-gray-700"})}):null,"pdfExport"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(x.A,{className:"h-8 w-8 text-gray-700"})}):null,"documentSignatures"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(p.A,{className:"h-8 w-8 text-gray-700"})}):null,"documentLock"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(g.A,{className:"h-8 w-8 text-gray-700"})}):null,"autoTitle"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(h.A,{className:"h-8 w-8 text-gray-700"})}):null,"autoCategory"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(y.A,{className:"h-8 w-8 text-gray-700"})}
2):null,"sopEnhancement"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(b.A,{className:"h-8 w-8 text-gray-700"})}):null,"voice"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(v.A,{className:"h-8 w-8 text-gray-700"})}):null,"pexels"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(f.A,{className:"h-8 w-8 text-gray-700"})}):null,"forms"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(A.A,{className:"h-8 w-8 text-gray-700"})}):null,"templateFill"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(j.A,{className:"h-8 w-8 text-gray-700"})}):null,"envVault"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(w.A,{className:"h-8 w-8 text-gray-700"})}):null,"customDomain"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(N.A,{className:"h-8 w-8 text-gray-700"})}):null,"emailToDocument"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(k.A,{className:"h-8 w-8 text-gray-700"})}):null,"emailAsk"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(C.A,{className:"h-8 w-8 text-gray-700"})}):null,"mcp"===t.id?(0,$.jsx)("div",{className:"mr-3 flex items-center",children:(0,$.jsx)(E.A,{className:"h-8 w-8 text-gray-700"})}):null,!t.logoComponent&&"versionControl"!==t.id&&"timer"!==t.id&&"cursorDevSync"!==t.id&&"pdfExport"!==t.id&&"documentSignatures"!==t.id&&"documentLock"!==t.id&&"autoTitle"!==t.id&&"autoCategory"!==t.id&&"sopEnhancement"!==t.id&&"voice"!==t.id&&"pexels"!==t.id&&"forms"!==t.id&&"templateFill"!==t.id&&"envVault"!==t.id&&"customDomain"!==t.id&&"emailToDocument"!==t.id&&"emailAsk"!==t.id&&"mcp"!==t.id&&(0,$.jsx)("div",{className:"text-3xl mr-3",children:t.icon}),(0,$.jsxs)("div",{children:[("versionControl"===t.id||"timer"===t.id||"cursorDevSync"===t.id||"pdfExport"===t.id||"documentSignatures"===t.id||"documentLock"===t.id||"autoTitle"===t.id||"autoCategory"===t.id||"sopEnhancement"===t.id||"voice"===t.id||"pexels"===t.id||"forms"===t.id||"templateFill"===t.id||"envVault"===t.id||"customDomain"===t.id||"emailToDocument"===t.id||"emailAsk"===t.id||"mcp"===t.id||!t.logoComponent)&&(0,$.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:t.name}),(0,$.jsx)("span",{className:"text-xs text-gray-500 bg-gray-100 px-2 py-1 rounded",children:t.category})]})]}),Dn(t)&&(0,$.jsxs)("label",{className:"flex items-center shrink-0 cursor-pointer mt-1",children:[(0,$.jsx)("input",{type:"checkbox",checked:rn.includes(t.id),onChange:()=>{ln(e=>e.includes(t.id)?e.filter(e=>e!==t.id):[...e,t.id])},disabled:null!==m,className:"h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),(0,$.jsxs)("span",{className:"sr-only",children:["Select ",t.name," for batch activate"]})]})]}),(0,$.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:t.description}),(0,$.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:["documentSignatures"===t.id&&(0,$.jsx)(K,{}),"cursorDevSync"===t.id&&(0,$.jsxs)("a",{href:W(null===pn||void 0===pn?void 0:pn.version),download:V,className:"inline-flex items-center gap-1.5 px-4 py-2 text-sm font-medium text-slate-800 bg-white border border-slate-300 rounded-md hover:bg-slate-50 transition-colors",children:[(0,$.jsx)(x.A,{className:"h-4 w-4 shrink-0"}),"Download .vsix"]}),(0,$.jsx)(Z.A,{type:"button",size:"md",onClick:()=>(async t=>{if("stripe"!==t)if("emailToDocument"!==t)if("emailAsk"!==t){Y(t);try{const a=(0,H.getSelectedOrganizationId)();if(!a)return void q.Ay.error("No organization selected");const s=await In(a,t);s.ok?(q.Ay.success(X[t]||"Enabled"),window.dispatchEvent(new Event("organizationChanged")),s.navigateTo&&e(s.navigateTo)):q.Ay.error(s.errorMessage||"Failed to enable")}finally{Y(null)}}else await Sn({mode:"enable"});else await Nn({mode:"enable"});else{Y("stripe");try{const e=(0,H.getSelectedOrganizationId)();if(!e)return void q.Ay.error("No organization selected");const t=await zn(e,{redirect:!0});t.ok||q.Ay.error(t.errorMessage||"Failed to start Stripe Connect")}finally{Y(null)}}})(t.id),disabled:null!==m||"available"!==t.status,loading:m===t.id,leadingIcon:(0,$.jsx)(E.A,{className:"h-4 w-4"}),className:"flex items-center px-4 py-2 text-sm rounded-md transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"power-up"===t.kind?"Activate":"Connect"})]})]},t.id))})]}),!He&&(0,$.jsxs)("div",{className:"mt-12 bg-white rounded-lg border border-gray-200 p-6",children:[(0,$.jsxs)("div",{className:"flex items-center mb-4",children:[(0,$.jsx)(F.A,{className:"h-5 w-5 text-yellow-500 mr-2"}),(0,$.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"More Abilities Coming Soon"})]}),(0,$.jsx)("p",{className:"text-gray-600",children:"We're adding more abilities to unlock new features. Have a suggestion? Let us know!"})]})]}),Zs&&(0,$.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,$.jsxs)("div",{className:"bg-white rounded-lg max-w-lg w-full mx-4 max-h-[90vh] overflow-y-auto",children:[(0,$.jsx)("div",{className:"p-6 border-b border-gray-100",children:(0,$.jsxs)("div",{className:"flex items-center justify-between",children:[(0,$.jsxs)("div",{children:[(0,$.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"MCP (Model Context Protocol)"}),(0,$.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"Connect AI assistants to your knowledge base"})]}),(0,$.jsx)("button",{onClick:()=>Ys(!1),className:"p-1 text-gray-400 hover:text-gray-600 rounded",children:(0,$.jsx)(d.A,{className:"h-5 w-5"})})]})}),(0,$.jsxs)("div",{className:"p-6 space-y-6",children:[(0,$.jsxs)("div",{children:[(0,$.jsx)("h4",{className:"text-sm font-semibold text-gray-900 mb-2",children:"What is MCP?"}),(0,$.jsx)("p",{className:"text-sm text-gray-600",children:"MCP (Model Context Protocol) lets AI assistants interact with your Based knowledge base directly. Instead of copy-pasting, your AI can read, create, edit, and organize documents for you through natural conversation."})]}),(0,$.jsxs)("div",{children:[(0,$.jsx)("h4",{className:"text-sm font-semibold text-gray-900 mb-3",children:"What AI can do with your knowledge base"}),(0,$.jsxs)("div",{className:"grid grid-cols-1 gap-2",children:[(0,$.jsxs)("div",{className:"flex items-start gap-2 text-sm text-gray-600",children:[(0,$.jsx)(S.A,{className:"h-4 w-4 text-green-500 mt-0.5 flex-shrink-0"}),(0,$.jsx)("span",{children:"Create, edit, and delete documents"})]}),(0,$.jsxs)("div",{className:"flex items-start gap-2 text-sm text-gray-600",children:[(0,$.jsx)(S.A,{className:"h-4 w-4 text-green-500 mt-0.5 flex-shrink-0"}),(0,$.jsx)("span",{children:"Read document content, metadata, and highlights"})]}),(0,$.jsxs)("div",{className:"flex items-start gap-2 text-sm text-gray-600",children:[(0,$.jsx)(S.A,{className:"h-4 w-4 text-green-500 mt-0.5 flex-shrink-0"}),(0,$.jsx)("span",{children:"List and search across your documents"})]}),(0,$.jsxs)("div",{className:"flex items-start gap-2 text-sm text-gray-600",children:[(0,$.jsx)(S.A,{className:"h-4 w-4 text-green-500 mt-0.5 flex-shrink-0"}),(0,$.jsx)("span",{children:"Create, edit, and manage workspaces"})]}),(0,$.jsxs)("div",{className:"flex items-start gap-2 text-sm text-gray-600",children:[(0,$.jsx)(S.A,{className:"h-4 w-4 text-green-500 mt-0.5 flex-shrink-0"}),(0,$.jsx)("span",{children:"Assign documents to workspaces"})]})]})]}),(0,$.jsxs)("div",{children:[(0,$.jsx)("h4",{className:"text-sm font-semibold text-gray-900 mb-3",children:"How to connect"}),(0,$.jsxs)("div",{className:"space-y-4",children:[(0,$.jsxs)("div",{className:"border border-gray-200 rounded-lg p-4",children:[(0,$.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,$.jsx)(P.A,{size:20}),(0,$.jsx)("span",{className:"text-sm font-medium text-gray-900",children:"Claude"})]}),(0,$.jsxs)("ol",{className:"text-sm text-gray-600 space-y-1 list-decimal list-inside",children:[(0,$.jsxs)("li",{children:["Open Claude and go to ",(0,$.jsx)("strong",{children:"Settings"})]}),(0,$.jsxs)("li",{children:["Navigate to ",(0,$.jsx)("strong",{children:"Integrations"})]}),(0,$.jsxs)("li",{children:["Click ",(0,$.jsx)("strong",{children:"Add More"})," and paste the connection URL below"]}),(0,$.jsx)("li",{children:"Authorize with your Based account"})]})]}),(0,$.jsxs)("div",{className:"border border-gray-200 rounded-lg p-4",children:[(0,$.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,$.jsx)(_.A,{size:20}),(0,$.jsx)("span",{className:"text-sm font-medium text-gray-900",children:"ChatGPT"})]}),(0,$.jsxs)("ol",{className:"text-sm text-gray-600 space-y-1 list-decimal list-inside",children:[(0,$.jsxs)("li",{children:["Open ChatGPT and go to ",(0,$.jsx)("strong",{children:"Settings"})]}),(0,$.jsxs)("li",{children:["Navigate to ",(0,$.jsx)("strong",{children:"Connected apps"})]}),(0,$.jsxs)("li",{children:["Click ",(0,$.jsx)("strong",{children:"Add connection"})," and paste the URL below"]}),(0,$.jsx)("li",{children:"Authorize with your Based account"})]})]})]})]}),(0,$.jsxs)("div",{children:[(0,$.jsx)("h4",{className:"text-sm font-semibold text-gray-900 mb-2",children:"Connection URL"}),(0,$.jsx)("p",{className:"text-xs text-gray-500 mb-1",children:"SSE (Cursor IDE, Claude, VS Code)"}),(0,$.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,$.jsx)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-md px-3 py-2",children:(0,$.jsx)("code",{className:"text-sm text-gray-800 select-all",children:"https://mcp.trybased.com/sse"})}),(0,$.jsx)("button",{onClick:()=>{navigator.clipboard.writeText("https://mcp.trybased.com/sse"),Qs(!0),setTimeout(()=>Qs(!1),2e3)},className:"flex items-center gap-1 px-3 py-2 text-sm font-medium text-gray-700 bg-gray-100 rounded-md hover:bg-gray-200 transition-colors",children:Js?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(S.A,{className:"h-4 w-4 text-green-600"}),(0,$.jsx)("span",{className:"text-green-600",children:"Copied"})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(z.A,{className:"h-4 w-4"}),(0,$.jsx)("span",{children:"Copy"})]})})]}),(0,$.jsx)("p",{className:"text-xs text-gray-500 mb-1",children:"Streamable HTTP (e.g. Cursor Cloud Agents)"}),(0,$.jsxs)("div",{className:"flex items-center gap-2",children:[(0,$.jsx)("div",{className:"flex-1 bg-gray-50 border border-gray-200 rounded-md px-3 py-2",children:(0,$.jsx)("code",{className:"text-sm text-gray-800 select-all",children:"https://mcp.trybased.com/mcp"})}),(0,$.jsx)("button",{onClick:()=>{navigator.clipboard.writeText("https://mcp.trybased.com/mcp"),an(!0),setTimeout(()=>an(!1),2e3)},className:"flex items-center gap-1 px-3 py-2 text-sm font-medium text-gray-700 bg-gray-100 rounded-md hover:bg-gray-200 transition-colors",children:tn?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(S.A,{className:"h-4 w-4 text-green-600"}),(0,$.jsx)("span",{className:"text-green-600",children:"Copied"})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(z.A,{className:"h-4 w-4"}),(0,$.jsx)("span",{children:"Copy"})]})})]})]})]}),(0,$.jsx)("div",{className:"p-6 border-t border-gray-100",children:(0,$.jsx)("button",{onClick:()=>Ys(!1),className:"w-full px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 rounded-md hover:bg-gray-200 transition-colors",children:"Done"})})]})}),we&&(0,$.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,$.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-full mx-4",children:[(0,$.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Set Hourly Rate"}),(0,$.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:"Set your hourly rate to generate invoices from time entries. You can change this later."}),(0,$.jsxs)("div",{className:"mb-4",children:[(0,$.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Hourly Rate ($)"}),(0,$.jsxs)("div",{className:"relative",children:[(0,$.jsx)(M.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,$.jsx)("input",{type:"number",step:"0.01",min:"0",value:We,onChange:e=>Le(e.target.value),placeholder:"100.00",className:"w-full pl-10 pr-4 py-2 border border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500"})]})]}),(0,$.jsxs)("div",{className:"flex gap-3 justify-end",children:[(0,$.jsx)("button",{onClick:()=>{Ne(!1),Le("")},className:"px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 rounded-md hover:bg-gray-200 transition-colors",children:"Cancel"}),(0,$.jsx)(Z.A,{type:"button",size:"md",onClick:Fn,disabled:null!==m||!We,loading:"stripe"===m,className:"px-4 py-2 text-sm rounded-md transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"stripe"===m?"Saving...":"Save"})]})]})}),Ee&&(0,$.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,$.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-full mx-4",children:[(0,$.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Update Hourly Rate"}),(0,$.jsxs)("div",{className:"mb-4",children:[(0,$.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Hourly Rate ($)"}),(0,$.jsxs)("div",{className:"relative",children:[(0,$.jsx)(M.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,$.jsx)("input",{type:"number",step:"0.01",min:"0",value:We,onChange:e=>Le(e.target.value),placeholder:"100.00",className:"w-full pl-10 pr-4 py-2 border border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500"})]})]}),(0,$.jsxs)("div",{className:"flex gap-3 justify-end",children:[(0,$.jsx)("button",{onClick:()=>{Se(!1),Le("")},className:"px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 rounded-md hover:bg-gray-200 transition-colors",children:"Cancel"}),(0,$.jsx)(Z.A,{type:"button",size:"md",onClick:Fn,disabled:null!==m||!We,loading:"stripe"===m,className:"px-4 py-2 text-sm rounded-md transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"stripe"===m?"Updating...":"Update"})]})]})}),De&&(0,$.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,$.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-full mx-4",children:[(0,$.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Disconnect Stripe?"}),(0,$.jsx)("p",{className:"text-sm text-gray-600 mb-6",children:"Are you sure you want to disconnect Stripe? You will not be able to create invoices until you reconnect."}),(0,$.jsxs)("div",{className:"flex gap-3 justify-end",children:[(0,$.jsx)("button",{onClick:()=>Te(!1),className:"px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 rounded-md hover:bg-gray-200 transition-colors",children:"Cancel"}),(0,$.jsx)("button",{onClick:async()=>{Te(!1),Y("stripe");try{const e=(0,H.getSelectedOrganizationId)();if(!e)return void q.Ay.error("No organization selected");const t=(0,U.httpsCallable)(J,"disconnectStripeAccount");(await t({organizationId:e})).data.success&&(fe({connected:!1,hourlyRate:null,stripeConnectAccountId:null,stripeConnectChargesEnabled:!1,stripeConnectDetailsSubmitted:!1,stripeConnectAccountEmail:null,status:null}),_e(""),Ye(e=>e.map(e=>"stripe"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"available"}):e)),q.Ay.success("Stripe integration disconnected"),window.dispatchEvent(new Event("organizationChanged")))}catch(e){console.error("Error disconnecting Stripe:",e),q.Ay.error(e.message||"Failed to disconnect Stripe account")}finally{Y(null)}},disabled:null!==m,className:"px-4 py-2 text-sm font-medium text-white bg-red-600 rounded-md hover:bg-red-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"stripe"===m?(0,$.jsxs)("span",{className:"flex items-center",children:[(0,$.jsx)(G.y$,{size:"sm",className:"mr-2"}),"Disconnecting..."]}):"Disconnect"})]})]})}),ta&&(0,$.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,$.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-full mx-4",children:[(0,$.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"settings"===ia?"Email to Document sett
2ings":"Enable Email to Document"}),(0,$.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:"Choose how inbound addresses map to workspaces. Only emails from organization members create documents."}),(0,$.jsxs)("div",{className:"space-y-3 mb-4",children:[(0,$.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer",children:[(0,$.jsx)("input",{type:"radio",name:"emailToDocumentMode",checked:"defaultWorkspace"===da,onChange:()=>ca("defaultWorkspace"),className:"mt-1"}),(0,$.jsxs)("span",{className:"text-sm text-gray-800",children:[(0,$.jsx)("span",{className:"font-medium",children:"One address"}),(0,$.jsx)("span",{className:"block text-xs text-gray-500",children:"All mail goes to a default workspace"})]})]}),(0,$.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer",children:[(0,$.jsx)("input",{type:"radio",name:"emailToDocumentMode",checked:"perWorkspace"===da,onChange:()=>ca("perWorkspace"),className:"mt-1"}),(0,$.jsxs)("span",{className:"text-sm text-gray-800",children:[(0,$.jsx)("span",{className:"font-medium",children:"Unique address per workspace"}),(0,$.jsx)("span",{className:"block text-xs text-gray-500",children:"Each workspace gets its own inbound address"})]})]})]}),"defaultWorkspace"===da&&(0,$.jsxs)("div",{className:"mb-4",children:[(0,$.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Default workspace"}),(0,$.jsxs)("select",{value:xa,onChange:e=>pa(e.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500 text-sm bg-white",children:[(0,$.jsx)("option",{value:"",children:"Select workspace\u2026"}),vs.map(e=>(0,$.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,$.jsx)("p",{className:"text-xs text-gray-500 mb-6",children:"Changing mode regenerates addresses. Attachments are not imported in this version."}),(0,$.jsxs)("div",{className:"flex gap-3 justify-end",children:[(0,$.jsx)("button",{type:"button",onClick:()=>aa(!1),className:"px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 rounded-md hover:bg-gray-200 transition-colors",children:"Cancel"}),(0,$.jsx)(Z.A,{type:"button",size:"md",onClick:async()=>{const e=Hs||(0,H.getSelectedOrganizationId)();if(e)if("defaultWorkspace"!==da||xa){Y("emailToDocument");try{if("settings"===ia){var t;const a=(0,U.httpsCallable)(J,"updateEmailToDocumentSettings"),s=await a({organizationId:e,addressMode:da,defaultWorkspaceId:xa||null});if(null===(t=s.data)||void 0===t||!t.success)return void q.Ay.error("Failed to update Email to Document settings");Bt(s.data.addressMode||da),Yt(s.data.defaultWorkspaceId||""),Qt(s.data.addresses||[]),q.Ay.success("Email to Document settings updated")}else{var a;const t=(0,U.httpsCallable)(J,"enableEmailToDocumentIntegration"),n=await t({organizationId:e,addressMode:da,defaultWorkspaceId:xa||null});if(null===(a=n.data)||void 0===a||!a.success)return void q.Ay.error("Failed to enable Email to Document");Lt(!0),Bt(n.data.addressMode||da),Yt(n.data.defaultWorkspaceId||""),Qt(n.data.addresses||[]),Ye(e=>e.map(e=>"emailToDocument"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"connected"}):e)),q.Ay.success(X.emailToDocument),window.dispatchEvent(new Event("organizationChanged"))}aa(!1)}catch(n){console.error("Error saving Email to Document setup:",n),q.Ay.error(n.message||"Failed to save Email to Document")}finally{Y(null)}}else q.Ay.error("Select a default workspace");else q.Ay.error("No organization selected")},disabled:null!==m,loading:"emailToDocument"===m,className:"px-4 py-2 text-sm rounded-md transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"emailToDocument"===m?"Saving\u2026":"settings"===ia?"Save":"Enable"})]})]})}),Xa&&(0,$.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,$.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-full mx-4",children:[(0,$.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"settings"===ss?"Email Ask settings":"Enable Email Ask"}),(0,$.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:"Choose how ask addresses map to workspaces. Only organization members can ask by email."}),(0,$.jsxs)("div",{className:"space-y-3 mb-4",children:[(0,$.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer",children:[(0,$.jsx)("input",{type:"radio",name:"emailAskMode",checked:"defaultWorkspace"===ls,onChange:()=>os("defaultWorkspace"),className:"mt-1"}),(0,$.jsxs)("span",{className:"text-sm text-gray-800",children:[(0,$.jsx)("span",{className:"font-medium",children:"One address"}),(0,$.jsx)("span",{className:"block text-xs text-gray-500",children:"All questions go to a default workspace"})]})]}),(0,$.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer",children:[(0,$.jsx)("input",{type:"radio",name:"emailAskMode",checked:"perWorkspace"===ls,onChange:()=>os("perWorkspace"),className:"mt-1"}),(0,$.jsxs)("span",{className:"text-sm text-gray-800",children:[(0,$.jsx)("span",{className:"font-medium",children:"Unique address per workspace"}),(0,$.jsx)("span",{className:"block text-xs text-gray-500",children:"Each workspace gets its own ask address"})]})]})]}),"defaultWorkspace"===ls&&(0,$.jsxs)("div",{className:"mb-4",children:[(0,$.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Default workspace"}),(0,$.jsxs)("select",{value:ms,onChange:e=>us(e.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500 text-sm bg-white",children:[(0,$.jsx)("option",{value:"",children:"Select workspace\u2026"}),vs.map(e=>(0,$.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,$.jsxs)("label",{className:"flex items-start gap-2 cursor-pointer mb-4",children:[(0,$.jsx)("input",{type:"checkbox",checked:gs,onChange:e=>hs(e.target.checked),className:"mt-0.5 h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"}),(0,$.jsxs)("span",{className:"text-sm text-gray-800",children:[(0,$.jsx)("span",{className:"font-medium",children:"Auto-send when confident"}),(0,$.jsx)("span",{className:"block text-xs text-gray-500",children:"Otherwise every answer is saved as a draft for review first (recommended)"})]})]}),(0,$.jsx)("p",{className:"text-xs text-gray-500 mb-6",children:"Changing mode regenerates addresses. Start with drafts-only until you trust the answers."}),(0,$.jsxs)("div",{className:"flex gap-3 justify-end",children:[(0,$.jsx)("button",{type:"button",onClick:()=>es(!1),className:"px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 rounded-md hover:bg-gray-200 transition-colors",children:"Cancel"}),(0,$.jsx)(Z.A,{type:"button",size:"md",onClick:async()=>{const e=Hs||(0,H.getSelectedOrganizationId)();if(e)if("defaultWorkspace"!==ls||ms){Y("emailAsk");try{if("settings"===ss){var t;const a=(0,U.httpsCallable)(J,"updateEmailAskSettings"),s=await a({organizationId:e,addressMode:ls,defaultWorkspaceId:ms||null,autoSendWhenConfident:gs});if(null===(t=s.data)||void 0===t||!t.success)return void q.Ay.error("Failed to update Email Ask settings");ja(s.data.addressMode||ls),Ca(s.data.defaultWorkspaceId||""),Va(!0===s.data.autoSendWhenConfident),kn(s.data.addresses||[]),q.Ay.success("Email Ask settings updated")}else{var a;const t=(0,U.httpsCallable)(J,"enableEmailAskIntegration"),n=await t({organizationId:e,addressMode:ls,defaultWorkspaceId:ms||null,autoSendWhenConfident:gs});if(null===(a=n.data)||void 0===a||!a.success)return void q.Ay.error("Failed to enable Email Ask");ba(!0),ja(n.data.addressMode||ls),Ca(n.data.defaultWorkspaceId||""),Va(!0===n.data.autoSendWhenConfident),kn(n.data.addresses||[]),Ye(e=>e.map(e=>"emailAsk"===e.id?(0,s.A)((0,s.A)({},e),{},{status:"connected"}):e)),q.Ay.success(X.emailAsk),window.dispatchEvent(new Event("organizationChanged"))}es(!1)}catch(n){console.error("Error saving Email Ask setup:",n),q.Ay.error(n.message||"Failed to save Email Ask")}finally{Y(null)}}else q.Ay.error("Select a default workspace");else q.Ay.error("No organization selected")},disabled:null!==m,loading:"emailAsk"===m,className:"px-4 py-2 text-sm rounded-md transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"emailAsk"===m?"Saving\u2026":"settings"===ss?"Save":"Enable"})]})]})}),Ds&&(0,$.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,$.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-md w-full mx-4",children:[(0,$.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Form Notification Settings"}),(0,$.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:"Configure who receives an email when a form response is submitted."}),(0,$.jsxs)("div",{className:"mb-4",children:[(0,$.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Recipient Email Addresses"}),(0,$.jsx)("input",{type:"text",value:Rs,onChange:e=>_s(e.target.value),placeholder:"[email protected], [email protected]",className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500 text-sm"}),(0,$.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Separate multiple emails with commas. Leave empty to send to the workspace owner."})]}),(0,$.jsx)("div",{className:"mb-6",children:(0,$.jsxs)("label",{className:"flex items-start cursor-pointer",children:[(0,$.jsx)("input",{type:"checkbox",checked:Ws,onChange:e=>Ls(e.target.checked),className:"mt-0.5 h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"}),(0,$.jsxs)("span",{className:"ml-2 text-sm text-gray-700",children:["Send a copy of the response to the respondent",(0,$.jsx)("span",{className:"block text-xs text-gray-500 mt-0.5",children:"Only applies when the form includes an email field"})]})]})}),(0,$.jsxs)("div",{className:"flex gap-3 justify-end",children:[(0,$.jsx)("button",{onClick:()=>{Ts(!1),_s(""),Ls(!1)},className:"px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 rounded-md hover:bg-gray-200 transition-colors",children:"Cancel"}),(0,$.jsx)(Z.A,{type:"button",size:"md",onClick:async()=>{Y("forms");try{var e;const t=(0,H.getSelectedOrganizationId)();if(!t)return void q.Ay.error("No organization selected");const a=(0,U.httpsCallable)(J,"updateFormNotificationSettings");null!==(e=(await a({organizationId:t,notificationEmails:Rs,sendCopyToRespondent:Ws})).data)&&void 0!==e&&e.success&&(Ns(Rs.trim()),Ss(Ws),Ts(!1),q.Ay.success("Form notification settings updated"))}catch(t){console.error("Error updating form notification settings:",t),q.Ay.error(t.message||"Failed to update notification settings")}finally{Y(null)}},disabled:null!==m,loading:"forms"===m,className:"px-4 py-2 text-sm rounded-md transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"forms"===m?"Saving...":"Save"})]})]})})]}):(0,$.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:(0,$.jsxs)("div",{className:"text-center",children:[(0,$.jsx)("h2",{className:"text-xl font-semibold mb-4",children:"Authentication Required"}),(0,$.jsx)("p",{className:"text-gray-600 mb-4",children:"Please sign in to access abilities."}),(0,$.jsx)(Z.A,{type:"button",size:"md",onClick:()=>{window.location.href="/auth"},children:"Sign In"})]})})}},77927(e,t,a){"use strict";a.d(t,{N:()=>n,Z:()=>s});const s="I confirm that this is my legal signature and I consent to signing this document electronically.",n="/electronic-signatures"},12475(e,t,a){"use strict";function s(e,t){return t&&Array.isArray(e)?e.filter(e=>{return function(e,t){return Boolean(e&&t&&e.organizationId===t)}(e,t)||(s=t,!(!(a=e)||!s)&&a.organizationId!==s&&!0===a.isExternalWorkspace);var a,s}):[]}a.d(t,{jI:()=>s})},36210(e,t,a){"use strict";a.d(t,{A:()=>s});const s=(0,a(77784).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},9463(e,t,a){"use strict";a.d(t,{A:()=>s});const s=(0,a(77784).A)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},77819(e,t,a){"use strict";a.d(t,{A:()=>s});const s=(0,a(77784).A)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},26405(e,t,a){"use strict";a.d(t,{A:()=>s});
2const s=(0,a(77784).A)("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]])},72313(e,t,a){"use strict";a.d(t,{A:()=>s});const s=(0,a(77784).A)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},73062(e,t,a){"use strict";a.d(t,{A:()=>s});const s=(0,a(77784).A)("dollar-sign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]])},70764(e,t,a){"use strict";a.d(t,{A:()=>s});const s=(0,a(77784).A)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},69807(e,t,a){"use strict";a.d(t,{A:()=>s});const s=(0,a(77784).A)("file-down",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]])},41680(e,t,a){"use strict";a.d(t,{A:()=>s});const s=(0,a(77784).A)("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},94965(e,t,a){"use strict";a.d(t,{A:()=>s});const s=(0,a(77784).A)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]])},687(e,t,a){"use strict";a.d(t,{A:()=>s});const s=(0,a(77784).A)("git-branch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]])},55731(e,t,a){"use strict";a.d(t,{A:()=>s});const s=(0,a(77784).A)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},70067(e,t,a){"use strict";a.d(t,{A:()=>s});const s=(0,a(77784).A)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]])},3308(e,t,a){"use strict";a.d(t,{A:()=>s});const s=(0,a(77784).A)("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]])},65727(e,t,a){"use strict";a.d(t,{A:()=>s});const s=(0,a(77784).A)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]])},35327(e,t,a){"use strict";a.d(t,{A:()=>s});const s=(0,a(77784).A)("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]])},84669(e,t,a){"use strict";a.d(t,{A:()=>s});const s=(0,a(77784).A)("message-square",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]])},10629(e,t,a){"use strict";a.d(t,{A:()=>s});const s=(0,a(77784).A)("mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]])},4596(e,t,a){"use strict";a.d(t,{A:()=>s});const s=(0,a(77784).A)("pen-line",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]])},37916(e,t,a){"use strict";a.d(t,{A:()=>s});const s=(0,a(77784).A)("plug",[["path",{d:"M12 22v-5",key:"1ega77"}
2],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]])},7365(e,t,a){"use strict";a.d(t,{A:()=>s});const s=(0,a(77784).A)("settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},56099(e,t,a){"use strict";a.d(t,{A:()=>s});const s=(0,a(77784).A)("sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]])},82300(e,t,a){"use strict";a.d(t,{A:()=>s});const s=(0,a(77784).A)("type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]])},40614(e,t,a){"use strict";a.d(t,{A:()=>s});const s=(0,a(77784).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},20073(e,t,a){"use strict";a.d(t,{A:()=>s});const s=(0,a(77784).A)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])},98139(e,t){var a;!function(){"use strict";var s={}.hasOwnProperty;function n(){for(var e="",t=0;t<arguments.length;t++){var a=arguments[t];a&&(e=r(e,i(a)))}return e}function i(e){if("string"===typeof e||"number"===typeof e)return e;if("object"!==typeof e)return"";if(Array.isArray(e))return n.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var a in e)s.call(e,a)&&e[a]&&(t=r(t,a));return t}function r(e,t){return t?e?e+" "+t:e+t:e}e.exports?(n.default=n,e.exports=n):void 0===(a=function(){return n}.apply(t,[]))||(e.exports=a)}()}}]); 3//# sourceMappingURL=2907.f43e255e.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.