PageSourceSearch

https://www.bluebag.ai/_next/static/chunks/pages/[organization]/[project]/monitoring-81da3fda3ce5e405.js

js bluebag.ai collected 2026-10-05 11:52:08 UTC 40,918 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8090],{86476:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/[organization]/[project]/monitoring",function(){return r(64912)}])},4189:function(e,n,r){"use strict";r.d(n,{d:function(){return t}});let t={INTERNAL_ERROR:"internal_error",BAD_REQUEST:"bad_request",SUCCESS:"success",NOT_FOUND:"resource_not_found",UNAUTHORIZED:"unauthorized",NO_AUTH:"no_auth",UNSUPPORTED_METHOD:"unsupported_method",ACTION_PREVIOUSLY_APPLIED:"action_previously_applied",RATE_LIMITED:"too_many_requests",SLUG_ALREADY_EXISTS:"slug_already_exists",FORBIDDEN:"forbidden",NO_KEYWORDS:"no_keywords",SUBSCRIPTION_EXPIRED:"subscription_expired",NO_ACTIVE_KEYWORDS:"no_active_keywords",PLATFORM_UNAVAILABLE:"platform_unavailable",INVALID_AUTOMATION_WORKFLOW:"invalid_automation_workflow",WORKSPACE_AUTOMATION_LIMIT_REACHED:"workspace_automation_limit_reached",WORKSPACE_KEYWORD_LIMIT_REACHED:"workspace_keyword_limit_reached",WORKSPACE_PROJECT_LIMIT_REACHED:"workspace_project_limit_reached",USER_WORKSPACE_LIMIT_REACHED:"user_workspace_limit_reached",WORKSPACE_MEMBER_LIMIT_REACHED:"workspace_member_limit_reached",PLAN_UNAUTHORIZED:"plan_unauthorized"}},34336:function(e,n,r){"use strict";r.d(n,{U:function(){return fetchChannels}});var t=r(89644),l=r.n(t),a=r(94560);async function fetchChannels(e){let{organizationId:n,projectId:r,provider:t}=e;try{let e=await l().get("/api/integrations/".concat(t,"/channels"),{params:{organizationId:n,projectId:r}});return e.data.channels}catch(e){throw Error((0,a.dr)(e,"Failed to fetch channels"))}}},36464:function(e,n,r){"use strict";r.d(n,{T:function(){return fetchIntegrations},V:function(){return getIntegrationsQueryKey}});var t=r(89644),l=r.n(t),a=r(94560),s=r(95220);let getIntegrationsQueryKey=(e,n)=>[s.U.PROJECT_INTEGRATIONS,e,n],fetchIntegrations=async e=>{let{organizationId:n,projectId:r}=e;try{let e=await l().get("/api/integrations",{params:{organizationId:n,projectId:r}});return e.data.integrations}catch(e){throw Error((0,a.dr)(e,"Failed to fetch integrations"))}}},64912:function(e,n,r){"use strict";r.r(n),r.d(n,{__N_SSP:function(){return ev},default:function(){return ey}});var t=r(52322),l=r(2784),a=r(49114),s=r(71472),i=r(69697),o=r(1736),d=r(37327),c=r(78868),u=r(55578),h=r(8263),p=r(7007),g=r(76753),x=r(64003),m=r(64079),j=r(82066),b=r(35938),v=r(23824),y=r(3178),f=r(45470),I=r(96150),k=r(96633),w=r(84726),C=r(60855),E=r(73630);let ContactUsForPaymentModal=e=>{let{isOpen:n,onClose:r}=e;return(0,t.jsxs)(I.G,{isOpen:n,onClose:r,size:"md",children:[(0,t.jsx)(I.G.Header,{withoutFormatting:!0,children:"Upgrade Account"}),(0,t.jsx)(I.G.Description,{children:"Ready to unlock Pro features? Reach out to us and we'll get you set up with the right plan for your needs"}),(0,t.jsx)(I.G.Body,{children:(0,t.jsxs)(i.K,{spacing:"md",children:[(0,t.jsx)(v.T,{h:"xl"}),(0,t.jsx)(y.z,{fullWidth:!0,component:"a",color:"indigo",target:"_blank",href:E.ul,leftIcon:(0,t.jsx)(w.Z,{size:18}),children:"Chat with us on Discord"}),(0,t.jsx)(y.z,{fullWidth:!0,color:"gray",component:"a",variant:"white",target:"_blank",href:E.fA,leftIcon:(0,t.jsx)(k.Z,{size:18}),children:"Schedule a call"}),(0,t.jsx)(C.M,{children:(0,t.jsx)(d.x,{size:"xs",color:"dimmed",children:"We typically respond within 10 minutes"})})]})})]})};var _=r(89644),A=r.n(_),R=r(94560);let testWebhook=async e=>{let{organizationId:n,projectId:r,type:t,channelId:l}=e;try{let e=await A().post("/api/organizations/".concat(n,"/projects/").concat(r,"/alert-rules/test-webhook"),{type:t,channelId:l});return e.data}catch(e){throw Error((0,R.dr)(e,"Failed to test notification"))}},deleteAlertRule=async e=>{let{organizationId:n,projectId:r,ruleId:t}=e;try{await A().delete("/api/organizations/".concat(n,"/projects/").concat(r,"/alert-rules/").concat(t))}catch(e){throw Error((0,R.dr)(e,"Failed to delete alert rule"))}},updateAlertRule=async e=>{let{organizationId:n,projectId:r,ruleId:t,input:l}=e;try{let e=await A().patch("/api/organizations/".concat(n,"/projects/").concat(r,"/alert-rules/").concat(t),l);return e.data.rule}catch(e){throw Error((0,R.dr)(e,"Failed to update alert rule"))}};var z=r(95220);let fetchAlertRules=async e=>{let{organizationId:n,projectId:r}=e;try{let e=await A().get("/api/organizations/".concat(n,"/projects/").concat(r,"/alert-rules"));return e.data.rules}catch(e){throw e}},getAlertRulesQueryKey=(e,n)=>[z.U.ALERT_RULES,e,n];var S=r(9040),N=r(30497),P=r(74820),T=r(26434),O=r(898),D=r(33362),U=r(96563),L=r(31626),M=r(53607),F=r(52106),K=r(1848),W=r(45461),Z=r(40037),V=r(65513),B=r(64278),G=r(2769),Q=r(17767),H=r(69083);let q={error_count:"Error count",error_rate:"Error rate (%)",latency_p95:"P95 latency (ms)",latency_p99:"P99 latency (ms)"},Y={gte:"≥",gt:">",eq:"=",lt:"<",lte:"≤"},$=[5,10,15,30,60],StateIndicator=e=>{let{state:n,pausedBySystem:r}=e;if(r)return(0,t.jsx)(D.u,{label:"Paused - please check your account plan",color:"dark.6",children:(0,t.jsx)(U.C,{color:"gray",variant:"outline",children:"Paused"})});switch(n){case"ok":return(0,t.jsx)(D.u,{label:"No alerts - all good",color:"dark.6",children:(0,t.jsx)(U.C,{color:"green",variant:"outline",children:"OK"})});case"triggered":return(0,t.jsx)(D.u,{label:"Alert triggered",color:"dark.6",children:(0,t.jsx)(U.C,{color:"red",variant:"outline",children:"Triggered"})});default:return(0,x.vE)(n)}},DestinationIcons=e=>{let{destinations:n}=e,r=n.some(e=>"slack"===e.type&&e.enabled),l=n.some(e=>"discord"===e.type&&e.enabled);return(0,t.jsxs)(s.Z,{spacing:4,children:[r&&(0,t.jsx)(D.u,{label:"Slack",color:"dark.6",children:(0,t.jsx)(L.q,{size:18,src:"".concat(Q.$,"slack.com")})}),l&&(0,t.jsx)(D.u,{label:"Discord",color:"dark.6",children:(0,t.jsx)(L.q,{size:22,src:"".concat(Q.$,"discord.com")})}),!r&&!l&&(0,t.jsx)(D.u,{label:"No destinations configured",color:"dark.6",children:(0,t.jsx)(b.x,{children:(0,t.jsx)(W.Z,{size:16,color:"gray"})})})]})},formatCondition=e=>{let n=q[e.metric],r=Y[e.comparison];return"".concat(n," ").concat(r," ").concat(e.threshold," in ").concat(e.timeWindowMinutes,"m")},AlertRulesList=e=>{let{rules:n,onMsg:r,togglingRuleId:l}=e;if(0===n.length)return(0,t.jsx)(C.M,{mih:"50vh",children:(0,t.jsx)(f.U,{children:(0,t.jsxs)(i.K,{align:"center",mt:"xl",children:[(0,t.jsx)(b.x,{h:150,w:250,children:(0,t.jsx)(P.x,{animation:"plug"})}),(0,t.jsx)(d.x,{color:"dimmed",size:"sm",children:"No alerts found"})]})},"empty-state")});let a=n.map(e=>(0,t.jsxs)(H.C,{onClick:()=>r({type:"edit_rule_clicked",payload:{rule:e}}),children:[(0,t.jsx)("td",{children:(0,t.jsxs)(s.Z,{spacing:2,children:[e.enabled&&!e.pausedBySystem?(0,t.jsx)(Z.Z,{size:16,color:"gray"}):(0,t.jsx)(W.Z,{size:16,color:"gray"}),(0,t.jsx)(d.x,{weight:500,children:e.name})]})}),(0,t.jsx)("td",{children:(0,t.jsx)(d.x,{size:"sm",color:"dimmed",children:formatCondition(e.condition)})}),(0,t.jsx)("td",{children:(0,t.jsx)(DestinationIcons,{destinations:e.destinations})}),(0,t.jsx)("td",{children:(0,t.jsx)(StateIndicator,{state:e.state,pausedBySystem:e.pausedBySystem})}),(0,t.jsx)(d.x,{component:"td",color:"dimmed",size:"sm",children:e.lastEvaluatedAt?(0,T.Z)(new Date(e.lastEvaluatedAt),{addSuffix:!0}):"Never"}),(0,t.jsx)(d.x,{component:"td",color:"dimmed",size:"sm",children:(0,O.Z)(new Date(e.createdAt),"MMM d, yyyy")}),(0,t.jsx)(b.x,{component:"td",onClick:e=>e.stopPropagation(),children:(0,t.jsxs)(s.Z,{spacing:"xs",position:"right",children:[l===e.id?(0,t.jsx)(M.a,{size:"xs",color:"gray"}):(0,t.jsx)(D.u,{label:e.pausedBySystem?"Paused by system - please check your account plan":e.enabled?"Disable rule":"Enable rule",withArrow:!0,color:"dark.5",children:(0,t.jsx)(b.x,{children:(0,t.jsx)(F.r,{size:"xs",color:"gray",checked:e.enabled,disabled:e.pausedBySystem,onChange:()=>{r({type:"toggle_rule_clicked",payload:{ruleId:e.id,enabled:!e.enabled}})}})})}),(0,t.jsx)(D.u,{label:"Send test alert",withArrow:!0,color:"dark.5",children:(0,t.jsx)(K.A,{color:"blue",variant:"subtle",onClick:()=>r({type:"test_alert_clicked",payload:{rule:e}}),children:(0,t.jsx)(V.Z,{size:16})})}),(0,t.jsx)(D.u,{label:"Delete rule",withArrow:!0,color:"dark.5",children:(0,t.jsx)(K.A,{color:"red",variant:"subtle",onClick:()=>r({type:"delete_rule_clicked",payload:{ruleId:e.id}}),children:(0,t.jsx)(B.Z,{size:16})})}),(0,t.jsx)(K.A,{variant:"transparent",children:(0,t.jsx)(G.Z,{size:16,color:"gray"})})]})})]},e.id));return(0,t.jsxs)(H.U,{children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{children:"Name"}),(0,t.jsx)("th",{children:"Condition"}),(0,t.jsx)("th",{children:"Destinations"}),(0,t.jsx)("th",{children:"Status"}),(0,t.jsx)("th",{children:"Last Evaluated"}),(0,t.jsx)("th",{children:"Created"}),(0,t.jsx)("th",{children:" "})]})}),(0,t.jsx)("tbody",{children:a})]})};var J=r(87611),X=r(94821);let PlanUnauthorizedView=e=>{let{message:n,onMsg:r}=e;return(0,t.jsx)(X.W,{size:400,children:(0,t.jsx)(f.U,{children:(0,t.jsx)(C.M,{mih:"50vh",children:(0,t.jsxs)(i.K,{align:"center",spacing:"lg",children:[(0,t.jsx)(J.Z,{size:100,color:"gray",strokeWidth:2}),(0,t.jsxs)(i.K,{spacing:"xs",align:"center",children:[(0,t.jsx)(d.x,{size:"lg",weight:600,color:"white",align:"center",children:"Access Restricted"}),(0,t.jsx)(d.x,{size:"sm",color:"dimmed",align:"center",children:n})]}),(0,t.jsx)(y.z,{mt:"xl",size:"sm",variant:"white",onClick:()=>r({type:"contact_us_clicked"}),children:"Upgrade account today"})]})})})})},isNotRetryable=e=>{var n;return!!A().isAxiosError(e)&&(null===(n=e.response)||void 0===n?void 0:n.status)===403},AlertRulesDataLoader=e=>{let{project:n,organization:r,onMsg:a,togglingRuleId:s}
1=e,o=(0,j.useQuery)(getAlertRulesQueryKey(r.id,n.id),()=>fetchAlertRules({organizationId:r.id,projectId:n.id}),{enabled:!!r.id&&!!n.id,retry:(e,n)=>!isNotRetryable(n)&&e<3}),c=(0,l.useRef)(null);switch((0,l.useEffect)(()=>{let e="error"===o.status&&(0,R.tG)(o.error),n="success"===o.status;e&&"restricted"!==c.current?(c.current="restricted",a({type:"access_restricted"})):n&&"allowed"!==c.current&&(c.current="allowed",a({type:"access_allowed"}))},[o.status,o.error,a]),o.status){case"idle":case"loading":return(0,t.jsx)(f.U,{children:(0,t.jsxs)(i.K,{spacing:"md",children:[(0,t.jsx)(v.T,{h:"xl"}),(0,t.jsx)(S.c.Loading,{transparent:!0})]})},"loading");case"error":if((0,R.tG)(o.error)){let e=(0,R.dr)(o.error,"The Monitoring & Alerting feature requires a Pro plan or higher. Upgrade to Pro to access this feature.");return(0,t.jsx)(PlanUnauthorizedView,{message:e,onMsg:a})}return(0,t.jsx)(N.j,{label:"Failed to load alert rules",retry:o.refetch});case"success":if(0===o.data.length)return(0,t.jsx)(f.U,{children:(0,t.jsx)(C.M,{mih:"50vh",children:(0,t.jsx)(f.U,{children:(0,t.jsxs)(i.K,{align:"center",mt:"xl",children:[(0,t.jsx)(b.x,{h:130,w:200,children:(0,t.jsx)(P.x,{animation:"plug"})}),(0,t.jsx)(d.x,{color:"dimmed",size:"sm",children:"No alerts configured yet"})]})})})},"empty-state");return(0,t.jsx)(f.U,{children:(0,t.jsx)(AlertRulesList,{rules:o.data,onMsg:a,togglingRuleId:s})},"list");default:return(0,x.vE)(o)}};var ee=r(38229),en=r(58989),er=r(67905),et=r(59618),el=r(1493),ea=r(89045),es=r(68461),ei=r(30255),eo=r(45043),ed=r(33712);let NumberInput_NumberInput=e=>{let{transparent:n=!0,inputStyles:r={},itemStyles:l={},dropdownStyles:a={},maxDropdownHeight:s=400,...i}=e;return(0,t.jsx)(eo.Y,{...i,styles:e=>({input:{...n&&{background:"transparent"},paddingRight:"1rem",border:"1px solid ".concat(e.colors.gray[9]),...r,":hover":{transform:"translateY(-1px)",transition:"all 0.15s ease"}},label:{opacity:.7,paddingBottom:"5px"},dropdown:{paddingTop:"".concat((0,ed.h)(10)," !important"),paddingLeft:"".concat((0,ed.h)(5)," !important"),paddingRight:"".concat((0,ed.h)(5)," !important"),border:"1px solid ".concat(e.colors.gray[9]),backgroundColor:e.colors.dark[9],...a},rightSection:{width:"1.2rem"},item:{fontSize:"0.8rem",marginBottom:(0,ed.h)(6),paddingBottom:(0,ed.h)(6),paddingTop:(0,ed.h)(6),":hover":{color:"white",backgroundColor:e.colors.dark[6]},...l}})})};var ec=r(34336),eu=r(36464);let eh=Object.entries(q).map(e=>{let[n,r]=e;return{value:n,label:r}}),ep=Object.entries(Y).map(e=>{let[n,r]=e;return{value:n,label:r}}),eg=$.map(e=>({value:String(e),label:"".concat(e," minutes")})),EditAlertRuleDrawer=e=>{let{isOpen:n,onClose:r,onSuccess:a,rule:o,project:c,organization:u}=e,h=(0,et.rZ)(),p=(0,j.useQueryClient)(),g=(0,er.c)({initialValues:{name:"",enabled:!0,metric:"error_count",comparison:"gte",threshold:10,timeWindowMinutes:10,slackEnabled:!1,slackChannelId:null,discordEnabled:!1,discordChannelId:null},validate:{name:e=>e&&0!==e.trim().length?null:"Rule name is required",threshold:e=>e<=0?"Threshold must be greater than 0":null,slackChannelId:(e,n)=>n.slackEnabled&&!e?"Please select a Slack channel":null,discordChannelId:(e,n)=>n.discordEnabled&&!e?"Please select a Discord channel":null},validateInputOnChange:!1}),{data:x,isLoading:f}=(0,j.useQuery)([z.U.PROJECT_INTEGRATIONS,u.id,c.id],()=>(0,eu.T)({organizationId:u.id,projectId:c.id}),{enabled:n}),I=null==x?void 0:x.find(e=>"slack"===e.provider),k=null==x?void 0:x.find(e=>"discord"===e.provider),w=!!(null==I?void 0:I.enabled),C=!!(null==k?void 0:k.enabled),{data:E=[],isLoading:_}=(0,j.useQuery)([z.U.SLACK_CHANNELS,u.id,c.id,null==o?void 0:o.id],()=>(0,ec.U)({organizationId:u.id,projectId:c.id,provider:"slack"}),{enabled:n&&g.values.slackEnabled&&w,onSuccess:e=>{let n=null==o?void 0:o.destinations.find(e=>"slack"===e.type);if(null==n?void 0:n.channelName){let r=e.find(e=>e.name===n.channelName);if(r){g.setFieldValue("slackChannelId",r.id);return}}I&&"defaultChannelId"in I&&I.defaultChannelId?g.setFieldValue("slackChannelId",I.defaultChannelId):e.length>0&&g.setFieldValue("slackChannelId",e[0].id)},onError:()=>{m.N9.show({title:"Error",message:"Failed to load Slack channels",color:"red"})}}),{data:A=[],isLoading:R}=(0,j.useQuery)([z.U.DISCORD_CHANNELS,u.id,c.id,null==o?void 0:o.id],()=>(0,ec.U)({organizationId:u.id,projectId:c.id,provider:"discord"}),{enabled:n&&g.values.discordEnabled&&C,onSuccess:e=>{let n=null==o?void 0:o.destinations.find(e=>"discord"===e.type);if(null==n?void 0:n.channelName){let r=e.find(e=>e.name===n.channelName);if(r){g.setFieldValue("discordChannelId",r.id);return}}k&&"defaultChannelId"in k&&k.defaultChannelId?g.setFieldValue("discordChannelId",k.defaultChannelId):e.length>0&&g.setFieldValue("discordChannelId",e[0].id)},onError:()=>{m.N9.show({title:"Error",message:"Failed to load Discord channels",color:"red"})}});(0,l.useEffect)(()=>
1{if(o&&n){var e,r;let n=o.destinations.find(e=>"slack"===e.type),t=o.destinations.find(e=>"discord"===e.type);g.setValues({name:o.name,enabled:o.enabled,metric:o.condition.metric,comparison:o.condition.comparison,threshold:o.condition.threshold,timeWindowMinutes:o.condition.timeWindowMinutes,slackEnabled:!!(null==n?void 0:n.enabled),slackChannelId:null!==(e=null==n?void 0:n.channelId)&&void 0!==e?e:null,discordEnabled:!!(null==t?void 0:t.enabled),discordChannelId:null!==(r=null==t?void 0:t.channelId)&&void 0!==r?r:null})}},[o,n]);let N=(0,j.useMutation)({mutationFn:()=>{var e,n;if(!o)throw Error("No rule to update");let r=[];if(g.values.slackEnabled&&g.values.slackChannelId){let n=E.find(e=>e.id===g.values.slackChannelId);r.push({type:"slack",channelId:g.values.slackChannelId,channelName:null!==(e=null==n?void 0:n.name)&&void 0!==e?e:null})}if(g.values.discordEnabled&&g.values.discordChannelId){let e=A.find(e=>e.id===g.values.discordChannelId);r.push({type:"discord",channelId:g.values.discordChannelId,channelName:null!==(n=null==e?void 0:e.name)&&void 0!==n?n:null})}return updateAlertRule({organizationId:u.id,projectId:c.id,ruleId:o.id,input:{name:g.values.name,enabled:g.values.enabled,condition:{metric:g.values.metric,comparison:g.values.comparison,threshold:g.values.threshold,timeWindowMinutes:g.values.timeWindowMinutes,filters:[]},destinations:r}})},onSuccess:()=>{p.invalidateQueries(getAlertRulesQueryKey(u.id,c.id)),m.N9.show({title:"Alert rule updated",message:"Your changes have been saved",color:"green"}),a()},onError:e=>{m.N9.show({title:"Failed to update rule",message:e instanceof Error?e.message:"An error occurred",color:"red"})}}),P=!w&&!C,T=g.values.slackEnabled&&g.values.slackChannelId||g.values.discordEnabled&&g.values.discordChannelId;return o?(0,t.jsx)(es.d,{opened:n,onClose:()=>{N.isLoading||r()},title:"Edit Alert Rule",children:f?(0,t.jsx)(S.c.Loading,{}):(0,t.jsxs)(i.K,{spacing:"md",h:"100%",children:[o.pausedBySystem&&(0,t.jsx)(b.x,{p:"sm",sx:e=>({borderRadius:e.radius.lg,backgroundColor:e.colors.red[9],borderLeft:"2px solid ".concat(e.colors.red[3])}),children:(0,t.jsxs)(s.Z,{spacing:"sm",noWrap:!0,align:"start",children:[(0,t.jsx)(ee.Z,{size:25,color:h.colors.red[3],style:{flexShrink:0}}),(0,t.jsx)(d.x,{size:"sm",color:"red.2",children:"This alert has been paused by the system. This typically happens when your plan limits have been reached. Please check your account plan to continue receiving alerts."})]})}),P&&(0,t.jsxs)(S.c,{children:[(0,t.jsx)(S.c.Avatar,{children:(0,t.jsx)(en.Z,{size:40})}),(0,t.jsxs)(S.c.Content,{children:[(0,t.jsx)(S.c.Title,{children:"No integrations connected"}),(0,t.jsxs)(S.c.Description,{children:["Go to"," ",(0,t.jsx)(d.x,{component:"a",weight:600,color:"indigo.5",href:"/".concat(u.slug,"/").concat(c.slug,"/settings#integrations"),sx:{"&:hover":{textDecoration:"underline"}},children:"Settings → Integrations"})," ","to connect Slack or Discord"]})]})]}),(0,t.jsxs)(s.Z,{position:"apart",children:[(0,t.jsx)(d.x,{size:"sm",weight:500,sx:{opacity:.7,paddingBottom:"5px"},children:"Rule Status"}),(0,t.jsx)(F.r,{size:"sm",color:"indigo",checked:g.values.enabled,disabled:o.pausedBySystem,onChange:e=>g.setFieldValue("enabled",e.currentTarget.checked),label:g.values.enabled?"Enabled":"Disabled",labelPosition:"left"})]}),(0,t.jsx)(ei.o,{label:"Rule Name",placeholder:"e.g., Error spike alert",required:!0,...g.getInputProps("name")}),(0,t.jsx)(ea.P,{label:"Metric",data:eh,...g.getInputProps("metric")}),(0,t.jsxs)(s.Z,{grow:!0,children:[(0,t.jsx)(ea.P,{label:"Comparison",data:ep,...g.getInputProps("comparison")}),(0,t.jsx)(NumberInput_NumberInput,{label:"Threshold",min:0,...g.getInputProps("threshold")})]}),(0,t.jsx)(ea.P,{label:"Time Window",data:eg,value:String(g.values.timeWindowMinutes),onChange:e=>g.setFieldValue("timeWindowMinutes",Number(e))}),(0,t.jsx)(b.x,{py:"xs",children:(0,t.jsxs)(i.K,{spacing:"md",children:[(0,t.jsxs)(s.Z,{position:"apart",children:[(0,t.jsxs)(s.Z,{spacing:"sm",children:[(0,t.jsx)(L.q,{size:25,src:"".concat(Q.$,"slack.com")}),(0,t.jsx)(d.x,{weight:500,size:"sm",children:"Slack"}),!w&&(0,t.jsx)(d.x,{size:"xs",color:"dimmed",children:"Not connected"})]}),(0,t.jsx)(F.r,{color:"indigo",checked:g.values.slackEnabled,onChange:e=>g.setFieldValue("slackEnabled",e.currentTarget.checked),disabled:!w})]}),g.values.slackEnabled&&w&&(0,t.jsx)(ea.P,{label:"Channel",placeholder:_?"Loading channels...":"Select a channel",data:E.map(e=>({value:e.id,label:"#".concat(e.name).concat(e.isPrivate?" (private)":"")}
1)),value:g.values.slackChannelId,onChange:e=>g.setFieldValue("slackChannelId",e),disabled:_,rightSection:_&&(0,t.jsx)(M.a,{size:"xs"}),error:g.errors.slackChannelId,searchable:!0,required:!0})]})}),(0,t.jsx)(b.x,{py:"xs",children:(0,t.jsxs)(i.K,{spacing:"md",children:[(0,t.jsxs)(s.Z,{position:"apart",children:[(0,t.jsxs)(s.Z,{spacing:"sm",children:[(0,t.jsx)(L.q,{size:25,src:"".concat(Q.$,"discord.com")}),(0,t.jsx)(d.x,{weight:500,size:"sm",children:"Discord"}),!C&&(0,t.jsx)(d.x,{size:"xs",color:"dimmed",children:"Not connected"})]}),(0,t.jsx)(F.r,{color:"indigo",checked:g.values.discordEnabled,onChange:e=>g.setFieldValue("discordEnabled",e.currentTarget.checked),disabled:!C})]}),g.values.discordEnabled&&C&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ea.P,{label:"Channel",placeholder:R?"Loading channels...":"Select a channel",data:A.map(e=>({value:e.id,label:"#".concat(e.name)})),value:g.values.discordChannelId,onChange:e=>g.setFieldValue("discordChannelId",e),disabled:R,rightSection:R&&(0,t.jsx)(M.a,{size:"xs"}),error:g.errors.discordChannelId,searchable:!0,required:!0}),(0,t.jsx)(el.b,{mt:"xs",radius:"lg",color:"gray",title:"Using a private channel?",children:(0,t.jsx)(d.x,{size:"sm",color:"dimmed",children:'Go to channel settings → Permissions → Add the Bluebag bot and enable "Send Messages"'})})]})]})}),!T&&!P&&(0,t.jsx)(d.x,{size:"sm",color:"dimmed",mt:"lg",children:"Enable at least one notification destination."}),(0,t.jsxs)(i.K,{spacing:"sm",mt:"auto",children:[(0,t.jsx)(b.x,{mt:"xl",children:(0,t.jsxs)(d.x,{size:"xs",color:"dimmed",children:["Triggers when"," ",(0,t.jsx)(d.x,{component:"span",weight:600,color:"white",children:q[g.values.metric].toLowerCase()})," ","is"," ",(0,t.jsxs)(d.x,{component:"span",weight:600,color:"white",children:[Y[g.values.comparison]," ",g.values.threshold]})," ","within"," ",(0,t.jsxs)(d.x,{component:"span",weight:600,color:"white",children:[g.values.timeWindowMinutes," minutes"]})]})}),(0,t.jsx)(y.z,{variant:"white",fullWidth:!0,loading:N.isLoading,disabled:P||!T,onClick:()=>{let e=g.validate();!e.hasErrors&&T&&N.mutate()},children:"Save Changes"}),(0,t.jsx)(v.T,{h:"md"})]})]})}):(0,t.jsx)(es.d,{opened:!1,onClose:()=>{},title:"Edit Alert Rule"})},createAlertRule=async e=>{let{organizationId:n,projectId:r,input:t}=e;try{let e=await A().post("/api/organizations/".concat(n,"/projects/").concat(r,"/alert-rules"),t);return e.data.rule}catch(e){throw Error((0,R.dr)(e,"Failed to create alert rule"))}},ex=Object.entries(q).map(e=>{let[n,r]=e;return{value:n,label:r}}),em=Object.entries(Y).map(e=>{let[n,r]=e;return{value:n,label:r}}),ej=$.map(e=>({value:String(e),label:"".concat(e," minutes")})),CreateAlertRuleDrawer=e=>{let{isOpen:n,onClose:r,onSuccess:a,project:o,organization:c}=e,u=(0,j.useQueryClient)(),h=(0,er.c)({initialValues:{name:"",metric:"error_count",comparison:"gte",threshold:10,timeWindowMinutes:10,slackEnabled:!1,slackChannelId:null,discordEnabled:!1,discordChannelId:null},validate:{name:e=>e&&0!==e.trim().length?null:"Rule name is required",threshold:e=>e<=0?"Threshold must be greater than 0":null,slackChannelId:(e,n)=>n.slackEnabled&&!e?"Please select a Slack channel":null,discordChannelId:(e,n)=>n.discordEnabled&&!e?"Please select a Discord channel":null},validateInputOnChange:!1}),{data:p,isLoading:g}=(0,j.useQuery)([z.U.PROJECT_INTEGRATIONS,c.id,o.id],()=>(0,eu.T)({organizationId:c.id,projectId:o.id}),{enabled:n}),x=null==p?void 0:p.find(e=>"slack"===e.provider),v=null==p?void 0:p.find(e=>"discord"===e.provider),f=!!(null==x?void 0:x.enabled),I=!!(null==v?void 0:v.enabled),{data:k=[],isLoading:w}=(0,j.useQuery)([z.U.SLACK_CHANNELS,c.id,o.id],()=>(0,ec.U)({organizationId:c.id,projectId:o.id,provider:"slack"}),{enabled:n&&h.values.slackEnabled&&f,onSuccess:e=>{x&&"defaultChannelId"in x&&x.defaultChannelId?h.setFieldValue("slackChannelId",x.defaultChannelId):e.length>0&&h.setFieldValue("slackChannelId",e[0].id)},onError:()=>{m.N9.show({title:"Error",message:"Failed to load Slack channels",color:"red"})}}),{data:C=[],isLoading:E}=(0,j.useQuery)([z.U.DISCORD_CHANNELS,c.id,o.id],()=>(0,ec.U)({organizationId:c.id,projectId:o.id,provider:"discord"}),{enabled:n&&h.values.discordEnabled&&I,onSuccess:e=>{v&&"defaultChannelId"in v&&v.defaultChannelId?h.setFieldValue("discordChannelId",v.defaultChannelId):e.length>0&&h.setFieldValue("discordChannelId",e[0].id)},onError:()=>{m.N9.show({title:"Error",message:"Failed to load Discord channels",color:"red"})}});(0,l.useEffect)(()=>{n&&h.reset()},[n]);let _=(0,j.useMutation)({mutationFn:()=>{var e,n;let r=[];if(h.values.slackEnabled&&h.values.slackChannelId){let n=k.find(e=>e.id===h.values.slackChannelId);r.push({type:"slack",channelId:h.values.slackChannelId,channelName:null!==(e=null==n?void 0:n.name)&&void 0!==e?e:null})}if(h.values.discordEnabled&&h.values.discordChannelId){let e=C.find(e=>e.id===h.values.discordChannelId);r.push({type:"discord",channelId:h.values.discordChannelId,channelName:null!==(n=null==e?void 0:e.name)&&void 0!==n?n:null})}return createAlertRule({organizationId:c.id,projectId:o.id,input
1:{name:h.values.name,condition:{metric:h.values.metric,comparison:h.values.comparison,threshold:h.values.threshold,timeWindowMinutes:h.values.timeWindowMinutes,filters:[]},destinations:r}})},onSuccess:()=>{u.invalidateQueries(getAlertRulesQueryKey(c.id,o.id)),m.N9.show({title:"Alert rule created",message:"Your new alert rule is now active",color:"green"}),h.reset(),a()},onError:e=>{m.N9.show({title:"Failed to create rule",message:e instanceof Error?e.message:"An error occurred",color:"red"})}}),A=!f&&!I,R=h.values.slackEnabled&&h.values.slackChannelId||h.values.discordEnabled&&h.values.discordChannelId;return(0,t.jsx)(es.d,{opened:n,onClose:()=>{_.isLoading||(h.reset(),r())},title:"Create Alert",children:g?(0,t.jsx)(S.c.Loading,{}):(0,t.jsxs)(i.K,{spacing:"md",h:"100%",children:[A&&(0,t.jsxs)(S.c,{children:[(0,t.jsx)(S.c.Avatar,{children:(0,t.jsx)(en.Z,{size:40})}),(0,t.jsxs)(S.c.Content,{children:[(0,t.jsx)(S.c.Title,{children:"No integrations connected"}),(0,t.jsxs)(S.c.Description,{children:["Go to"," ",(0,t.jsx)(d.x,{component:"a",weight:600,color:"indigo.5",href:"/".concat(c.slug,"/").concat(o.slug,"/settings#integrations"),sx:{"&:hover":{textDecoration:"underline"}},children:"Settings → Integrations"})," ","to connect Slack or Discord"]})]})]}),(0,t.jsx)(ei.o,{label:"Rule Name",placeholder:"e.g., Error spike alert",required:!0,...h.getInputProps("name")}),(0,t.jsx)(ea.P,{label:"Metric",data:ex,...h.getInputProps("metric")}),(0,t.jsxs)(s.Z,{grow:!0,children:[(0,t.jsx)(ea.P,{label:"Comparison",data:em,...h.getInputProps("comparison")}),(0,t.jsx)(NumberInput_NumberInput,{label:"Threshold",min:0,...h.getInputProps("threshold")})]}),(0,t.jsx)(ea.P,{label:"Time Window",data:ej,value:String(h.values.timeWindowMinutes),onChange:e=>h.setFieldValue("timeWindowMinutes",Number(e))}),(0,t.jsx)(b.x,{py:"xs",children:(0,t.jsxs)(i.K,{spacing:"md",children:[(0,t.jsxs)(s.Z,{position:"apart",children:[(0,t.jsxs)(s.Z,{spacing:"sm",children:[(0,t.jsx)(L.q,{size:25,src:"".concat(Q.$,"slack.com")}),(0,t.jsx)(d.x,{weight:500,size:"sm",children:"Slack"}),!f&&(0,t.jsx)(d.x,{size:"xs",color:"dimmed",children:"Not connected"})]}),(0,t.jsx)(F.r,{color:"indigo",checked:h.values.slackEnabled,onChange:e=>h.setFieldValue("slackEnabled",e.currentTarget.checked),disabled:!f})]}),h.values.slackEnabled&&f&&(0,t.jsx)(ea.P,{label:"Channel",placeholder:w?"Loading channels...":"Select a channel",data:k.map(e=>({value:e.id,label:"#".concat(e.name).concat(e.isPrivate?" (private)":"")})),value:h.values.slackChannelId,onChange:e=>h.setFieldValue("slackChannelId",e),disabled:w,rightSection:w&&(0,t.jsx)(M.a,{size:"xs"}),error:h.errors.slackChannelId,searchable:!0,required:!0})]})}),(0,t.jsx)(b.x,{py:"xs",children:(0,t.jsxs)(i.K,{spacing:"md",children:[(0,t.jsxs)(s.Z,{position:"apart",children:[(0,t.jsxs)(s.Z,{spacing:"sm",children:[(0,t.jsx)(L.q,{size:25,src:"".concat(Q.$,"discord.com")}),(0,t.jsx)(d.x,{weight:500,size:"sm",children:"Discord"}),!I&&(0,t.jsx)(d.x,{size:"xs",color:"dimmed",children:"Not connected"})]}),(0,t.jsx)(F.r,{color:"indigo",checked:h.values.discordEnabled,onChange:e=>h.setFieldValue("discordEnabled",e.currentTarget.checked),disabled:!I})]}),h.values.discordEnabled&&I&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ea.P,{label:"Channel",placeholder:E?"Loading channels...":"Select a channel",data:C.map(e=>({value:e.id,label:"#".concat(e.name)})),value:h.values.discordChannelId,onChange:e=>h.setFieldValue("discordChannelId",e),disabled:E,rightSection:E&&(0,t.jsx)(M.a,{size:"xs"}),error:h.errors.discordChannelId,searchable:!0,required:!0}),(0,t.jsx)(el.b,{mt:"xs",radius:"lg",color:"gray",title:"Using a private channel?",children:(0,t.jsx)(d.x,{size:"sm",color:"dimmed",children:'Go to channel settings → Permissions → Add the Bluebag bot and enable "Send Messages"'})})]})]})}),!R&&!A&&(0,t.jsx)(d.x,{size:"sm",color:"dimmed",mt:"lg",children:"Enable at least one notification destination."}),(0,t.jsxs)(i.K,{spacing:"sm",mt:"auto",children:[(0,t.jsx)(b.x,{mt:"xl",children:(0,t.jsxs)(d.x,{size:"xs",color:"dimmed",children:["Triggers when"," ",(0,t.jsx)(d.x,{component:"span",weight:600,color:"white",children:q[h.values.metric].toLowerCase()})," ","is"," ",(0,t.jsxs)(d.x,{component:"span",weight:600,color:"white",children:[Y[h.values.comparison]," ",h.values.threshold]})," ","within"," ",(0,t.jsxs)(d.x,{component:"span",weight:600,color:"white",children:[h.values.timeWindowMinutes," minutes"]})]})}),(0,t.jsx)(y.z,{variant:"white",fullWidth:!0,loading:_.isLoading,disabled:A||!R,onClick:()=>{let e=h.validate();!e.hasErrors&&R&&_.mutate()},children:"Create Rule"})]})]})})},eb={createDrawerOpen:!1,editDrawerOpen:!1,editingRule:null,deletePopupOpen:!1,deletingRuleId:null,togglingRuleId:null,testAlertPopupOpen:!1,testingRule:null,contactUsPopupOpen:!1},AlertRules=e=>{let{project:n,organization:r,onMsg:a}=e,s=(0,j.useQueryClient)(),[o,d]=(0,l.useState)(eb),c=(0,j.useMutation)(e=>deleteAlertRule({organizationId:r.id,projectId:n.id,ruleId:e}),{onSuccess:()=>{s.invalidateQueries(getAlertRulesQueryKey(r.id,n.id)),m.N9.show({title:"Rule deleted",message:"The alert rule has been deleted",color:"green"}),d(e=>({...e,deletePopupOpen:!1,deletingRuleId:null}))},onError:e=>{m.N9.show({title:"Failed to delete rule",message:e instanceof Error?e.message:"An error occurred",color:"red"})}}),u=(0,j.useMutation)(e=>updateAlertRule({organizationId:r.id,projectId:n.id,ruleId:e.ruleId,input:{enabled:e.enabled}}),{onMutate:e=>{d(n=>({...n,togglingRuleId:e.ruleId}))},onSuccess:()=>{s.invalidateQueries(getAlertRulesQueryKey(r.id,n.id)),d(e=>({...e,togglingRuleId:null}))},onError:e=>{d(e=>({...e,togglingRuleId:null})),m.N9.show({title:"Failed to toggle rule",message:e instanceof Error?e.message:"An error occurred",color:"red"})}}),h=(0,j.useMutation)(e=>testWebhook({organizationId:r.id,projectId:n.id,type:e.type,channelId:e.channelId}),{onSuccess:()=>{m.N9.show({title:"Test alert sent",message:"Check your notification channel for the test message",color:"green"}),d(e=>({...e,testAlertPopupOpen:!1,testingRule:null}))},onError:e=>{m.N9.show({title:"Failed to send test alert",message:e instanceof Error?e.message:"An error occurred",color:"red"})}}),p=(0,l.useCallback)(e=>{switch(e.type){case"edit_rule_clicked":d(n=>({...n,editDrawerOpen:!0,editingRule:e.payload.rule}));break;case"edit_drawer_closed":d(e=>({...e,editDrawerOpen:!1,editingRule:null}));break;case"rule_updated":d(e=>({...e,editDrawerOpen:!1,editingRule:null}));break;case"delete_rule_clicked":d(n=>({...n,deletePopupOpen:!0,deletingRuleId:e.payload.ruleId}));break;case"delete_confirmed":o.deletingRuleId&&c.mutate(o.deletingRuleId);break;case"delete_cancelled":d(e=>({...e,deletePopupOpen:!1,deletingRuleId:null}));break;case"rule_deleted":s.invalidateQueries(getAlertRulesQueryKey(r.id,n.id)),d(e=>({...e,deletePopupOpen:!1,deletingRuleId:null}));break;case"toggle_rule_clicked":u.mutate({ruleId:e.payload.ruleId,enabled:e.payload.enabled});break;case"test_alert_clicked":d(n=>({...n,testAlertPopupOpen:!0,testingRule:e.payload.rule}));break;case"test_alert_confirmed":{let e=o.testingRule;if(e){let n=e.destinations.find(e=>e.enabled&&e.channelId);n&&n.channelId?h.mutate({type:n.type,channelId:n.channelId}):(m.N9.show({title:"No destination configured",message:"Please configure a notification destination with a channel first.",color:"orange"}),d(e=>({...e,testAlertPopupOpen:!1,testingRule:null})))}break}case"test_alert_cancelled":d(e=>({...e,testAlertPopupOpen:!1,testingRule:null}));break;case"contact_us_clicked":d(e=>({...e,contactUsPopupOpen:!0}));break;case"contact_us_closed":d(e=>({...e,contactUsPopupOpen:!1}));break;case"access_restricted":null==a||a({type:"access_restricted"});break;case"access_allowed":null==a||a({type:"access_allowed"});break;default:(0,x.vE)(e)}},[s,r.id,n.id,c,u,h,o.deletingRuleId,o.testingRule,a]);return(0,t.jsx)(f.U,{children:(0,t.jsxs)(b.x,{children:[(0,t.jsx)(AlertRulesDataLoader,{project:n,organization:r,onMsg:p,togglingRuleId:o.togglingRuleId}),(0,t.jsx)(EditAlertRuleDrawer,{project:n,rule:o.editingRule,organization:r,isOpen:o.editDrawerOpen,onClose:()=>p({type:"edit_drawer_closed"}),onSuccess:()=>p({type:"rule_updated"})}),(0,t.jsx)(I.G,{size:"md",isOpen:o.deletePopupOpen,onClose:()=>p({type:"delete_cancelled"}),children:(0,t.jsxs)(b.x,{children:[(0,t.jsx)(I.G.Header,{withoutFormatting:!0,children:"Delete Alert Rule"}),(0,t.jsx)(I.G.Description,{children:"Are you sure you want to delete this alert rule? This action cannot be undone"}),(0,t.jsxs)(I.G.Body,{children:[(0,t.jsx)(v.T,{h:"xl"}),(0,t.jsx)(i.K,{spacing:"sm",children:(0,t.jsx)(y.z,{fullWidth:!0,color:"red",loading:c.isLoading,onClick:()=>p({type:"delete_confirmed"}),children:"Delete Rule"})})]})]})}),(0,t.jsx)(I.G,{size:"md",isOpen:o.testAlertPopupOpen,onClose:()=>p({type:"test_alert_cancelled"}),children:(0,t.jsxs)(b.x,{children:[(0,t.jsx)(I.G.Header,{withoutFormatting:!0,children:"Send Test Alert"}),(0,t.jsxs)(I.G.Description,{children:["Send a test notification to verify your alert destinations are working correctly.",o.testingRule&&(0,t.jsxs)(t.Fragment,{children:[" ",'This will send to the first configured channel for "',o.testingRule.name,'".']})]}),(0,t.jsxs)(I.G.Body,{children:[(0,t.jsx)(v.T,{h:"xl"}),(0,t.jsx)(i.K,{spacing:"sm",children:(0,t.jsx)(y.z,{fullWidth:!0,variant:"white",loading:h.isLoading,onClick:()=>p({type:"test_alert_confirmed"}),children:"Send Test Alert"})})]})]})}),(0,t.jsx)(ContactUsForPaymentModal,{isOpen:o.contactUsPopupOpen,onClose:()=>p({type:"contact_us_closed"})})]})})};var ev=!0,ey=(0,c.withUser)({whenAuthed:c.AuthAction.RENDER,whenUnauthedAfterInit:c.AuthAction.REDIRECT_TO_LOGIN}
1)(e=>{let{project:n,projects:r,organization:c,organizations:x}=e,[m,j]=(0,l.useState)(!1),[b,v]=(0,l.useState)("loading"),y=(0,l.useCallback)(e=>{switch(e.type){case"access_restricted":v("restricted");break;case"access_allowed":v("allowed");break;default:(0,u.v)(e)}},[]);return(0,t.jsxs)(h.A,{flush:!0,variant:"app",projects:r,organizations:x,children:[(0,t.jsx)(g.u.Header,{children:(0,t.jsxs)(s.Z,{spacing:"lg",position:"apart",align:"end",children:[(0,t.jsxs)(i.K,{spacing:"xs",children:[(0,t.jsx)(o.D,{order:1,sx:e=>({fontSize:"2.5rem",[e.fn.smallerThan("sm")]:{fontSize:"2.2rem"}}),children:"Alerts"}),(0,t.jsx)(d.x,{color:"dimmed",size:"sm",children:"Configure alert to get notified when issues occur"})]}),"allowed"===b&&(0,t.jsx)(p.K,{color:"indigo",leftIcon:(0,t.jsx)(a.Z,{size:16}),onClick:()=>j(!0),children:"Create Alert"})]})}),(0,t.jsx)(g.u.Body,{children:(0,t.jsx)(AlertRules,{project:n,organization:c,onMsg:y})}),(0,t.jsx)(CreateAlertRuleDrawer,{project:n,organization:c,isOpen:m,onSuccess:()=>j(!1),onClose:()=>j(!1)})]})})},68461:function(e,n,r){"use strict";r.d(n,{d:function(){return Drawer}});var t=r(52322),l=r(20269),a=r(87857),s=r(93218),i=r(5858),o=r(9012),d=r(69697),c=r(33362),u=r(1848);let Drawer=e=>{let{children:n,nested:r=!1,onCloseAll:h,...p}=e,g=(0,a.a)("(min-width: 100em)");return(0,t.jsx)(o.d,{title:"",position:"right",styles:e=>({header:{padding:e.spacing.md,background:e.colors.dark[8]},title:{fontWeight:700,lineHeight:1.5,color:e.colors.gray[2],fontSize:e.fontSizes.lg},close:{width:"27px",height:"27px","& > svg":{width:"27px !important",height:"27px !important",color:e.colors.gray[6]},"&:hover":{"& > svg":{color:e.colors.gray[4]}}},inner:{padding:"8px 8px 8px 0"},content:{borderRadius:"20px !important",background:e.colors.dark[8]},body:{height:"calc(100% - 70px)"}}),transitionProps:{duration:300,timingFunction:"ease-in-out",transition:"pop-bottom-right"},...r&&{overlayProps:{opacity:0},withCloseButton:!1},size:g?"lg":"md",...p,children:r?(0,t.jsxs)(d.K,{spacing:"xs",children:[(0,t.jsxs)(l.k,{gap:"xs",align:"center",children:[(0,t.jsx)(c.u,{label:"Go back",color:"dark.7",position:"right",withArrow:!0,children:(0,t.jsx)(u.A,{onClick:p.onClose,color:"pink",children:(0,t.jsx)(s.Z,{size:20})})}),h&&(0,t.jsx)(c.u,{label:"Close all",color:"dark.7",position:"right",withArrow:!0,children:(0,t.jsx)(u.A,{onClick:h,color:"pink",ml:"auto",children:(0,t.jsx)(i.Z,{size:20})})})]}),n]}):n})}},7198:function(e,n,r){"use strict";r.d(n,{j:function(){return Error}});var t=r(52322),l=r(46519),a=r(60855),s=r(69697),i=r(37327),o=r(3178),d=r(29511);let Error=e=>{let{label:n,retry:r}=e;return(0,t.jsx)(a.M,{w:"100%",h:"100%",children:(0,t.jsxs)(s.K,{align:"center",children:[(0,t.jsx)(l.Z,{size:100,color:"grey"}),(0,t.jsx)(i.x,{color:"dimmed",size:"sm",children:n}),(0,t.jsx)(o.z,{mx:"auto",onClick:r,color:"red",children:"Try again"})]})})};Error.Small=e=>{let{label:n,retry:r}=e;return(0,t.jsx)(a.M,{w:"100%",h:"100%",children:(0,t.jsxs)(s.K,{align:"center",spacing:"xs",children:[(0,t.jsxs)(s.K,{spacing:5,align:"center",children:[(0,t.jsx)(l.Z,{size:40,color:"grey"}),(0,t.jsx)(i.x,{color:"dimmed",size:"sm",children:n})]}),(0,t.jsx)(d.A,{size:"xs",compact:!0,mx:"auto",onClick:r,color:"red",children:"Try again"})]})})}},30497:function(e,n,r){"use strict";r.d(n,{j:function(){return t.j}});var t=r(7198)},74820:function(e,n,r){"use strict";r.d(n,{x:function(){return RiveEmptyState}});var t=r(52322);r(2784);var l=r(60388);let RiveEmptyState=e=>{let{animation:n}=e,{RiveComponent:r}=(0,l.useRive)({src:"https://bestregardsassets.com/animations/".concat(n,".riv"),stateMachines:n,autoplay:!0,layout:new l.Layout({fit:l.Fit.Cover,alignment:l.Alignment.Center})});return(0,t.jsx)(r,{})}},89045:function(e,n,r){"use strict";r.d(n,{P:function(){return Select}});var t=r(52322),l=r(65889),a=r(33712);let Select=e=>{let{transparent:n=!0,inputStyles:r={},itemStyles:s={},dropdownStyles:i={},maxDropdownHeight:o=400,...d}=e;return(0,t.jsx)(l.Ph,{transitionProps:{duration:150,transition:"pop"},maxDropdownHeight:o,...d,styles:e=>({input:{...n&&{background:"transparent"},paddingRight:"1rem",border:"1px solid ".concat(e.colors.gray[9]),...r,":hover":{transform:"translateY(-1px)",transition:"all 0.15s ease"}},label:{opacity:.7,paddingBottom:"5px"},dropdown:{paddingTop:"".concat((0,a.h)(10)," !important"),paddingLeft:"".concat((0,a.h)(5)," !important"),paddingRight:"".concat((0,a.h)(5)," !important"),border:"1px solid ".concat(e.colors.gray[9]),backgroundColor:e.colors.dark[9],...i},rightSection:{width:"1.2rem"},item:{fontSize:"0.8rem",marginBottom:(0,a.h)(6),paddingBottom:(0,a.h)(6),paddingTop:(0,a.h)(6),":hover":{color:"white",backgroundColor:e.colors.dark[6]},...s}})})}},29511:function(e,n,r){"use strict";r.d(n,{A:function(){return s}});var t=r(52322),l=r(3178),a=r(2784);let s=(0,a.forwardRef)((e,n)=>{let{children:r,...a}=e,{sx:s,...i}=a;return(0,t.jsx)(l.z,{size:"sm",ref:n,variant:"outline",...i,sx:{...s,borderColor:"transparent",":hover":{background:"transparent",opacity:.8}},children:r})})},30255:function(e,n,r){"use strict";r.d(n,{o:function(){return TextInput}});var t=r(52322),l=r(30820);let TextInput=e=>{let{focusOutlineColor:n,...r}=e;return(0,t.jsx)(l.o,{...r,styles:e=>({input:{background:"transparent",border:"1px solid ".concat(e.colors.gray[9]),"&:focus":{borderColor:"".concat(n||e.colors.gray[9])},"&:focus-within":{borderColor:"".concat(n||e.colors.gray[9])}}
1,label:{paddingBottom:"5px",opacity:.7}})})}},7007:function(e,n,r){"use strict";r.d(n,{K:function(){return c}});var t=r(52322),l=r(75673),a=r(2784),s=r(39649),i=r(3178);let o=(0,s.E)(a.forwardRef((e,n)=>(0,t.jsx)(i.z,{...e,ref:n}))),d=(0,a.forwardRef)((e,n)=>{let{children:r,color:l="indigo",hoverColor:a=l,sx:s,...i}=e;return(0,t.jsx)(o,{...i,px:"xl",ref:n,whileHover:{scale:1.02},whileTap:{scale:.9,y:1.2},sx:e=>{let n={border:0,backgroundColor:e.fn.rgba(e.colors[l][6],.1),color:e.colors[l][5],":hover":{color:e.colors[a][5],backgroundColor:e.fn.rgba(e.colors[a][6],.2)}},r={};if(s){if("function"==typeof s){let n=s(e);n&&"object"==typeof n&&!Array.isArray(n)&&(r=n)}else"object"!=typeof s||Array.isArray(s)||(r=s)}return{...n,...r}},styles:e=>({leftIcon:{marginRight:5}}),children:r})}),c=(0,l.F)(d)},94560:function(e,n,r){"use strict";r.d(n,{dr:function(){return getAxiosErrorMessage},tG:function(){return isPlanUnauthorizedError}});var t=r(89644),l=r.n(t),a=r(4189),s=r(43098);let getAxiosErrorMessage=(e,n)=>{if(l().isAxiosError(e)){var r;let t=null===(r=e.response)||void 0===r?void 0:r.data;return((0,s.U)(t)&&"string"==typeof t.message?t.message:e.message)||n}return e instanceof Error&&e.message||n},getAxiosErrorType=e=>{if(l().isAxiosError(e)){var n;let r=null===(n=e.response)||void 0===n?void 0:n.data;if((0,s.U)(r)&&"string"==typeof r.type)return r.type}return null},isPlanUnauthorizedError=e=>getAxiosErrorType(e)===a.d.PLAN_UNAUTHORIZED},43098:function(e,n,r){"use strict";r.d(n,{U:function(){return isRecord}});let isRecord=e=>"object"==typeof e&&null!==e}},function(e){e.O(0,[2485,9644,7905,2419,5889,6434,6027,4593,711,9774,2888,179],function(){return e(e.s=86476)}),_N_E=e.O()}]);

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.