forked from duneanalytics/DuneQueryRepo
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path2882-50dc02845b19281c.js.download
2 lines (2 loc) · 22.5 KB
/
2882-50dc02845b19281c.js.download
1
2
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2882],{55601:function(e,t,r){"use strict";r.d(t,{K:function(){return d}});var n=r(85893),i=r(10933),s=r(78528),a=r(45186),o=r(17870),l=r(82876);function d(e){let{buttonTheme:t="tertiary",disabled:r=!1}=e,{mode:d}=(0,l.v)();return(0,n.jsx)(a.f,{position:"below-align-right",content:t=>{let{close:r}=t;return(0,n.jsx)("div",{className:"dark"===d?"darkMode":"lightMode",children:(0,n.jsx)(o.l,{activeContext:e.activeContext,performance:e.performance,performanceTiers:e.performanceTiers,setPerformance:e.setPerformance,close:r})})},children:(0,n.jsx)(i.h,{theme:t,size:"M",type:"button",disabled:r,children:(0,n.jsx)(s.IconChevronDown,{})})})}},55417:function(e,t,r){"use strict";r.d(t,{E:function(){return et},r:function(){return V}});var n=r(85893),i=r(67294),s=r(23645),a=r.n(s),o=r(65240),l=r.n(o),d=r(31544),c=r.n(d),u=r(94184),h=r.n(u),m=r(61451),v=r(80949),x=r(42665),p=r(12098),f=r(85592),b=r(61575);let j=(e,t)=>{let[r,n]=(0,i.useState)(),s=(0,b.C_)(e.alerts.emails),a=!!s&&0===e.alerts.emails.length;return{emailAlertError:r,setEmailAlertError:n,emailAlertsEnabled:s,setEmailAlertsEnabled:e=>{t(t=>e?(n(void 0),{...t,alerts:{...t.alerts,emails:[]}}):{...t,alerts:{...t.alerts,emails:void 0}})},emailAlertInvalid:a}},_=e=>(0,i.useState)(e),g=e=>{var t,r;let[n,s]=(0,i.useState)(null!==(r=null!==(t=e.alerts.slack)&&void 0!==t?t:e.alerts.discord)&&void 0!==r?r:e.alerts.webhook),a=(0,b.C_)(n),o=!!a&&!n.startsWith("https://");return{webhookAlertUrl:n,setWebhookAlertUrl:s,webhookAlertsEnabled:a,setWebhookAlertsEnabled:()=>{(0,b.C_)(n)?s(void 0):s("")},webhookAlertInvalid:o}};var y=r(84512),w=r(56446),k=r(85361),C=r(98570),N=r(30990),S=r(54173),I=r(13498),T=r(75458),E=r(1801),M=r(7036),z=r(28313),q=r(83868),O=r.n(q),A=r(10398),B=r(82729),W=r(57831),F=r(21698),P=r.n(F),Q=r(21154),U=r(75805),J=r(95404),L=r(39137),Z=r(84937),R=r(40802);function D(){let e=(0,B._)(["\nmutation ManualTriggerWebhookAlert($input: ManualTriggerWebhookAlertInput!) {\n manualTriggerWebhookAlert(input: $input) {\n errorMessage\n }\n}\n"]);return D=function(){return e},e}let K=e=>{var t,r;let{isValid:i,url:s,queryId:a}=e,o=(0,W.kP)(),[l,d]=(0,Z.Ah8)({context:{session:o},variables:{input:{queryId:a,url:s}}}),c=async()=>{try{await l()}catch(e){R.Tb("Error while calling manual webhook alert: ".concat(e),{extra:{queryId:a,url:s}})}},u=null===(r=d.data)||void 0===r?void 0:null===(t=r.manualTriggerWebhookAlert)||void 0===t?void 0:t.errorMessage;return i?(0,n.jsxs)("div",{className:P().webhookTestTrigger,children:[(0,n.jsx)("div",{children:(0,n.jsxs)("span",{children:["Need to test?"," ",(0,n.jsx)(Q.V,{theme:"secondary",size:"S",disabled:d.loading,onClick:c,children:"Trigger a request"}),d.loading&&(0,n.jsx)(U.IconLoading,{})]})}),(0,n.jsx)("div",{children:(0,b.$K)(u)?(0,n.jsxs)("span",{className:P().error,children:["Error: ",u]}):null})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(J.IconInformation,{}),"A secure URL ",(0,n.jsx)("code",{children:"(https://)"})," must be provided."]})};(0,L.Z)(D());let Y=e=>{let{contextOwner:t,errorMessage:r}=e;switch(null==r?void 0:r.name){case"notification":return(0,n.jsx)(x.P,{level:"brand-orange",dismissable:!1,title:r.value,actions:(0,n.jsx)(S.A,{href:{pathname:"/pricing",query:(0,k.JW)(t)},theme:"secondary",size:"M",target:"_blank",children:"Upgrade plan"})});case"submit":return(0,n.jsxs)("p",{className:l().errorMessage,children:[(0,n.jsx)(v.J,{icon:"warning-triangle"}),"Something went wrong, please try again."]});default:return null}},H=e=>{let{stop:t,close:r,cronString:i}=e;return(0,n.jsxs)("div",{className:c().body,children:[(0,n.jsx)("div",{className:c().header,children:(0,n.jsx)("h3",{className:c().titleRow,children:"Schedule query refresh"})}),(0,n.jsx)(x.P,{level:"warning",dismissable:!1,title:(0,n.jsx)(n.Fragment,{children:"Incompatible cron expression"}),description:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("p",{children:['This query is scheduled to execute with the following cron expression: "',(0,n.jsx)("code",{children:i}),'".']}),(0,n.jsx)("p",{children:"It is using a format that is not supported in this UI, but you can delete the schedule and create a new one."})]})}),(0,n.jsxs)("div",{className:c().buttons,children:[(0,b.C_)(t)&&(0,n.jsx)(m.z,{size:"M",theme:"primary",type:"button",onClick:t,children:"Delete schedule"}),(0,n.jsx)(m.z,{size:"M",theme:"tertiary",type:"button",onClick:r,children:"Cancel"})]})]})},X=e=>(0,b.C_)(e)&&e.startsWith("https://hooks.slack.com"),$=e=>(0,b.C_)(e)&&(e.startsWith("https://discord.com/api/webhooks/")||e.startsWith("https://discordapp.com/api/webhooks/")),G=(e,t)=>e?X(t)?{slack:t,webhook:void 0}:$(t)?{discord:t,webhook:void 0}:{slack:void 0,discord:void 0,webhook:t}:{slack:void 0,discord:void 0,webhook:void 0};function V(e){var t,r,s,o;let[d,u]=_(null!==(s=e.initialState)&&void 0!==s?s:{id:void 0,cronString:ee,performanceTier:null===(t=e.performanceTiers[0])||void 0===t?void 0:t.publicPerformanceTierKey,alerts:{}}),{emailAlertError:v,setEmailAlertError:x,emailAlertsEnabled:y,setEmailAlertsEnabled:k}=j(d,u),{webhookAlertUrl:S,setWebhookAlertUrl:q,webhookAlertsEnabled:B,setWebhookAlertsEnabled:W,webhookAlertInvalid:F}=g(d),[P,Q]=(0,i.useState)(void 0),U=e.loading||F,[J,L]=(0,i.useState)((0,b.Yd)(d.id)),[Z,R]=(0,i.useState)(y||B),D=(0,w.mB)(d.cronString),V=e.performanceTiers.find(e=>e.publicPerformanceTierKey===d.performanceTier);if((0,i.useEffect)(()=>{var t,r,n;if(!e.error){Q(void 0);return}function i(e){Q(t=>({...t||{},...e}))}if(e.error instanceof N.cA){let t=null===(r=e.error.graphQLErrors)||void 0===r?void 0:r[0].extensions,s=null!==(n=null==t?void 0:t.key)&&void 0!==n?n:null==t?void 0:t.code;if("schedule_limit_reached"===s){i({name:"notification",value:e.error.message});return}if("max_alert_queries_reached"===s){i({name:"notification",value:"You have reached the maximum number of alerts"});return}}i({name:"submit",value:null===(t=e.error)||void 0===t?void 0:t.message})},[e.error]),!V)return null;if(void 0===D)return(0,n.jsx)(H,{cronString:d.cronString,stop:e.stop,close:e.close});let et=(0,C.Z)(D)*V.credits,er=e.contextOwner.serviceTier.includedCredits,en=!(D.includes("hour")||D.includes("minute")),ei=(0,n.jsxs)("div",{className:a().collapsibleTitle,children:[(0,n.jsx)("h3",{children:"Refresh Query Results"}),!J&&(0,n.jsxs)("div",{className:a().schedule,children:[(0,n.jsx)("p",{children:"Every"}),(0,n.jsx)(E.C,{size:"L",variant:"filled",color:"brand-orange",children:D}),en&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{children:"at"}),(0,n.jsxs)(E.C,{size:"L",variant:"filled",color:"brand-orange",children:[null===(r=(0,T.l0)(d.cronString))||void 0===r?void 0:r.display," UTC"]})]})]})]}),es=(0,n.jsxs)("div",{className:a().collapsibleTitle,children:[(0,n.jsx)("h3",{children:"Alerts"}),!Z&&(0,n.jsx)("p",{children:"Choose how you want to be notified when the query returns results."})]});return(0,n.jsxs)("div",{className:c().body,children:[(0,n.jsxs)("div",{className:c().header,children:[(0,n.jsx)("h3",{className:c().titleRow,children:"Query refresh"}),(0,n.jsx)("p",{className:c().description,children:"Set the time and day this query will run automatically."})]}),(0,n.jsxs)("form",{className:h()(a().subBody,c().subBody),onSubmit:t=>{t.preventDefault();let r={...d,alerts:{...d.alerts,...G(B,S)}};u(r),e.save(r)},children:[(0,n.jsx)(I.G,{title:ei,isOpen:J,setIsOpen:L,children:(0,n.jsxs)("div",{className:h()(c().content,l().fields),children:[(0,n.jsx)(p.u,{state:d,setState:u}),(0,n.jsx)("hr",{}),(0,n.jsx)(f.nn,{contextOwner:e.contextOwner,performanceTiers:e.performanceTiers,state:d,setState:u,CostNotification:void 0,cost:{monthlyCredits:et,planMonthlyCredits:er}})]})}),(0,n.jsx)(I.G,{title:es,isOpen:Z,setIsOpen:R,children:(0,n.jsxs)("div",{className:a().alertsContainer,children:[(0,n.jsx)("hr",{className:a().divider}),(0,n.jsxs)("div",{className:a().alert,children:[(0,n.jsxs)("div",{className:a().header,children:[(0,n.jsx)("h3",{children:"Email"}),(0,n.jsx)(M.Z,{label:"",enabled:y,setEnabled:k})]}),y&&(0,n.jsxs)("div",{className:a().content,children:[(0,n.jsx)("p",{children:"Which email addresses should received updated results?"}),(0,n.jsx)(z.e,{values:null!==(o=d.alerts.emails)&&void 0!==o?o:[],maxTags:5,onChange:e=>{u(t=>({...t,alerts:{emails:e}}))},setErrors:e=>{e.length>0?x("The following emails were invalid: ".concat(e.join(", "))):x(void 0)},inputProps:{placeholder:"Type an email..."},validate:e=>e.split(",").every(e=>O()(e)),onlyUnique:!0,hint:(0,b.C_)(v)?(0,n.jsx)("p",{className:a().error,children:v}):(0,n.jsx)("p",{children:"Separate multiple emails with commas or spaces."})})]})]}),(0,n.jsxs)("div",{className:a().alert,children:[(0,n.jsxs)("div",{className:a().header,children:[(0,n.jsx)("h3",{children:"Webhook"}),(0,n.jsx)(M.Z,{label:"",enabled:B,setEnabled:W})]}),B&&(0,n.jsx)("div",{className:a().content,children:(0,n.jsx)(A.U,{size:"M",style:"contained",label:"Your request endpoint url",onChange:e=>q(e.target.value),hint:(0,n.jsx)("span",{className:a().hint,children:X(S)?"Slack Webhook URL detected.":$(S)?"Discord Webhook URL detected.":(0,n.jsx)(K,{isValid:!F,url:S,queryId:e.queryId})}),value:S,placeholder:"https://example.com/postreceive"})})]})]})}),(0,n.jsx)(f.C2,{contextOwner:e.contextOwner,performanceTiers:e.performanceTiers,state:d,cost:{monthlyCredits:et,planMonthlyCredits:er}}),(0,n.jsx)(Y,{contextOwner:e.contextOwner,errorMessage:P}),(0,n.jsxs)("div",{className:c().buttons,children:[e.stop&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(m.z,{size:"M",theme:"danger",type:"button",onClick:e.stop,disabled:e.loading,children:"Stop"}),(0,n.jsx)("hr",{className:c().gapFillMiddle})]}),(0,n.jsx)(m.z,{size:"M",theme:"tertiary",type:"button",onClick:e.close,children:"Cancel"}),(0,n.jsx)(m.z,{size:"M",theme:"primary",type:"submit",disabled:U,children:"Save"})]})]})]})}let ee=(0,y.rn)((0,w.Kj)());function et(e){var t,r;let[s,a]=(0,i.useState)(void 0),[o,d]=(0,i.useState)(null!==(r=e.initialState)&&void 0!==r?r:{cronString:er,performanceTier:null===(t=e.performanceTiers[0])||void 0===t?void 0:t.publicPerformanceTierKey}),u=(0,w.mB)(o.cronString),b=e.performanceTiers.find(e=>e.publicPerformanceTierKey===o.performanceTier);if((0,i.useEffect)(()=>{var t,r,n;if(!e.error){a(void 0);return}function i(e){a(t=>({...t||{},...e}))}if(e.error instanceof N.cA){let t=null===(n=e.error.graphQLErrors)||void 0===n?void 0:null===(r=n[0].extensions)||void 0===r?void 0:r.key;if("schedule_limit_reached"===t){i({name:"notification",value:e.error.message});return}}i({name:"submit",value:null===(t=e.error)||void 0===t?void 0:t.message})},[e.error]),void 0===b)return null;if(void 0===u)return(0,n.jsxs)("div",{className:c().body,children:[(0,n.jsx)("div",{className:c().header,children:(0,n.jsx)("h3",{className:c().titleRow,children:"Schedule dashboard refresh"})}),(0,n.jsx)(x.P,{level:"warning",dismissable:!1,title:(0,n.jsx)(n.Fragment,{children:"Incompatible cron expression"}),description:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("p",{children:['This dashboard is scheduled to execute with the following cron expression: "',(0,n.jsx)("code",{children:o.cronString}),'".']}),(0,n.jsx)("p",{children:"It is using a format that is not supported in this UI, but you can delete the schedule and create a new one."})]})}),(0,n.jsxs)("div",{className:c().buttons,children:[e.stop&&(0,n.jsx)(m.z,{size:"M",theme:"primary",type:"button",onClick:e.stop,children:"Delete schedule"}),(0,n.jsx)(m.z,{size:"M",theme:"tertiary",type:"button",onClick:e.close,children:"Cancel"})]})]});let j=(0,C.Z)(u)*b.credits*e.queryCount,_=e.contextOwner.serviceTier.includedCredits;return(0,n.jsxs)("div",{className:c().body,children:[(0,n.jsxs)("div",{className:c().header,children:[(0,n.jsx)("h3",{className:c().titleRow,children:"Schedule dashboard refresh"}),(0,n.jsx)("p",{className:c().description,children:"Set a refresh schedule that all queries within this dashboard will be run."})]}),(0,n.jsxs)("form",{className:c().subBody,onSubmit:t=>{t.preventDefault(),e.save(o)},children:[(0,n.jsxs)("div",{className:h()(c().content,l().fields),children:[(0,n.jsx)(p.u,{state:o,setState:d}),(0,n.jsx)("hr",{}),(0,n.jsx)(f.nn,{contextOwner:e.contextOwner,performanceTiers:e.performanceTiers,state:o,setState:d,CostNotification:f.Ys,cost:{monthlyCredits:j,planMonthlyCredits:_}}),(null==s?void 0:s.name)==="notification"&&(0,n.jsx)(x.P,{level:"brand-orange",dismissable:!1,title:s.value,actions:(0,n.jsx)(S.A,{href:{pathname:"/pricing",query:(0,k.JW)(e.contextOwner)},theme:"secondary",size:"M",target:"_blank",children:"Upgrade plan"})}),(null==s?void 0:s.name)==="submit"&&(0,n.jsxs)("p",{className:l().errorMessage,children:[(0,n.jsx)(v.J,{icon:"warning-triangle"}),"Something went wrong, please try again."]})]}),(0,n.jsxs)("div",{className:c().buttons,children:[e.stop&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(m.z,{size:"M",theme:"danger",type:"button",onClick:e.stop,children:"Stop"}),(0,n.jsx)("hr",{className:c().gapFillMiddle})]}),(0,n.jsx)(m.z,{size:"M",theme:"tertiary",type:"button",onClick:e.close,children:"Cancel"}),(0,n.jsx)(m.z,{size:"M",theme:"primary",type:"submit",children:"Save"})]})]})]})}let er=(0,y.rn)((0,w.Kj)())},80558:function(e,t,r){"use strict";r.d(t,{v:function(){return N},C:function(){return C}});var n=r(85893),i=r(67294),s=r(91113),a=r.n(s),o=r(80949),l=r(41664),d=r.n(l),c=r(71909),u=r(24745),h=r(57831),m=r(51577),v=r(42120),x=r(61451),p=r(54173),f=r(47730),b=r(96752),j=r(76138),_=r(84937),g=r(6826),y=r(18099),w=r(45172);let k=async(e,t,r)=>{(0,g.h)(r,"updateFavorite called without a session");let n={input:{id:e.id}},i={session:r};if((0,b._C)(e)&&t){let t=await j.bj.mutate({mutation:_.Ikw,variables:n,context:i});return w.Z.trackEvent("Dashboard Favorited",{dashboard_id:e.id,dashboard_slug:e.slug,...(0,y.k)(e.owner)}),t}if((0,b._C)(e)&&!t){let t=await j.bj.mutate({mutation:_.$O0,variables:n,context:i});return w.Z.trackEvent("Dashboard Unfavorited",{dashboard_id:e.id,dashboard_slug:e.slug,...(0,y.k)(e.owner)}),t}if((0,b.Xh)(e)&&t){let t=await j.bj.mutate({mutation:_.uJo,variables:n,context:i});return w.Z.trackEvent("Query Favorited",{query_id:e.id,...(0,y.k)(e.owner)}),t}if((0,b.Xh)(e)&&!t){let t=await j.bj.mutate({mutation:_.lnb,variables:n,context:i});return w.Z.trackEvent("Query Unfavorited",{query_id:e.id,...(0,y.k)(e.owner)}),t}throw Error("unknown favorite update")},C=e=>{let{session:t}=i.useContext(h.B3),[r,s,l]=S(e.entry),m=(0,c.J)();return!t||e.readOnly?(0,n.jsxs)("div",{className:a().text,children:[(0,u.u)(s),(0,n.jsx)(d(),{href:m,"aria-label":"Favorite",children:(0,n.jsx)(o.J,{icon:"star"})})]}):(0,n.jsxs)("div",{className:a().text,children:[(0,u.u)(s),(0,n.jsx)("button",{type:"button",onClick:l,"aria-label":I,children:(0,n.jsx)(o.J,{icon:r?"star-fill":"star"})})]})},N=e=>{var t,r,s;let{session:l}=i.useContext(h.B3),[d,m,b]=S(e.entry),j=(0,v.f8)(),_=(0,c.J)();return e.readOnly?(0,n.jsxs)(x.z,{size:"M",theme:"tertiary","aria-label":I,className:a().readOnlyBtn,children:[(0,n.jsx)(o.J,{icon:"star"}),(0,u.u)(m)]}):l?(0,n.jsx)(f.u,{position:"below-center",label:j?"Archived queries cannot be favorited":"Archived dashboards cannot be favorited",hidden:!(null===(t=e.entry)||void 0===t?void 0:t.is_archived),children:(0,n.jsxs)(x.z,{...e,onClick:b,"aria-label":I,disabled:null===(r=e.entry)||void 0===r?void 0:r.is_archived,theme:"tertiary",size:"M",children:[(0,n.jsx)(o.J,{icon:d?"star-fill":"star"}),(0,u.u)(m)]})}):(0,n.jsx)(f.u,{position:"below-center",label:j?"Archived queries cannot be favorited":"Archived dashboards cannot be favorited",hidden:!(null===(s=e.entry)||void 0===s?void 0:s.is_archived),children:(0,n.jsxs)(p.A,{...e,href:_,"aria-label":"Favorite",theme:"tertiary",size:"M",children:[(0,n.jsx)(o.J,{icon:"star"}),(0,u.u)(m)]})})},S=e=>{let{session:t}=i.useContext(h.B3),[r,n]=i.useState(e.is_favorite),[s,a]=i.useState(e.num_favorites_in_period);return i.useEffect(()=>{n(e.is_favorite),a(e.num_favorites_in_period)},[e]),[r,s,()=>{k(e,!r,t).catch(m.k.warn),a(s+(r?-1:1)),n(!r)}]},I="Toggle favorite"},2178:function(e,t,r){"use strict";r.d(t,{G:function(){return m}});var n=r(85893),i=r(67294),s=r(1036),a=r.n(s),o=r(85361),l=r(66465),d=r(42665),c=r(54173),u=r(48171),h=r(50876);function m(e){let{props:t,session:r}=e,s=(0,o._0)(),{captureEvent:m}=(0,l.z$)(),v=(0,h.wI)(s),x="dashboard"===t.type,p="embed"===t.type,f=x&&!t.dashboard.is_private||p&&!t.query.is_private||(null==s?void 0:s.type)==="team"&&!v;return((0,i.useEffect)(()=>{if(!f){var e;m("share_private_resource_notification_shown",{userId:null==r?void 0:null===(e=r.user)||void 0===e?void 0:e.id})}},[f]),f)?null:(null==s?void 0:s.type)==="team"?(0,n.jsx)(d.P,{level:"brand-blue",title:"Dune is better with your teammates onboard",dismissable:!1,customIcon:(0,n.jsx)("div",{className:a().customIcon,children:(0,n.jsx)(u.IconPeople,{})}),description:x?(0,n.jsx)(n.Fragment,{children:"Invite teammates and let them find your content whenever they need to. No need to keep creating and sharing links to your creations."}):(0,n.jsx)(n.Fragment,{children:"Invite your teammates, and let them do more with this query."}),actions:(0,n.jsx)(c.A,{href:"/settings/teams/manage/".concat(s.handle,"/people"),target:"_blank",size:"M",theme:"primary",onOpen:()=>{var e;return m("share_private_resource_notification_invite_team_members_clicked",{userId:null==r?void 0:null===(e=r.user)||void 0===e?void 0:e.id,teamId:null==s?void 0:s.id,dashboardId:x?t.dashboard.id:void 0,queryId:p?t.query.id:void 0})},children:"Invite team members"})}):(0,n.jsx)(d.P,{level:"brand-blue",title:"Dune is better with your team",dismissable:!1,customIcon:(0,n.jsx)("div",{className:a().customIcon,children:(0,n.jsx)(u.IconPeople,{})}),description:x?(0,n.jsx)(n.Fragment,{children:"Create a team, invite other teammates, and let them find your content whenever they need to. No need to keep creating and sharing links to your creations."}):(0,n.jsx)(n.Fragment,{children:"Create a team, invite your teammates, and let them do more with this query."}),actions:(0,n.jsx)(c.A,{href:"/teams/new",target:"_blank",size:"M",theme:"primary",onOpen:()=>{var e;return m("share_private_resource_notification_create_team_clicked",{userId:null==r?void 0:null===(e=r.user)||void 0===e?void 0:e.id,dashboardId:x?t.dashboard.id:void 0,queryId:p?t.query.id:void 0})},children:"Create a team"})})}},28313:function(e,t,r){"use strict";r.d(t,{e:function(){return x}});var n=r(85893),i=r(94184),s=r.n(i),a=r(65808),o=r.n(a),l=r(24149),d=r.n(l),c=r(1801),u=r(41118);let h=RegExp(",|;|\\(|\\)|\\*|/|:|\\?|\n|\r| "),m=(e,t)=>(0,n.jsxs)("div",{className:o().container,children:[e,t]}),v=e=>{let{disabled:t,getTagDisplayValue:r,onRemove:i,tag:s,key:a}=e;return(0,n.jsx)(c.C,{className:o().badge,size:"L",variant:"filled",color:"brand-orange",children:(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{children:r(s)}),!t&&(0,n.jsx)("a",{onClick:()=>i(a),children:(0,n.jsx)(u.IconCross,{})})]})},a)},x=e=>{let{values:t,onChange:r,setErrors:i,validate:a,onValidationReject:l,className:c,hint:u,...x}=e,{maxTags:p}=x,f=void 0===p||p>t.length;return(0,n.jsxs)("div",{className:o().main,children:[(0,n.jsx)(d(),{className:s()(o().tagsInput,c),value:t,onChange:r,renderTag:v,renderLayout:m,renderInput:f?e=>{let{addTag:t,...r}=e;return(0,n.jsx)("input",{type:"text",...r})}:()=>null,addKeys:["Tab","Enter",","," "],addOnPaste:!0,addOnBlur:!0,pasteSplit:e=>e.split(h).map(e=>e.trim()),validate:e=>{var t;let r=null===(t=null==a?void 0:a(e))||void 0===t||t;return r&&(null==i||i([])),r},onValidationReject:e=>{null==l||l(e),null==i||i(e)},...x}),(0,n.jsxs)("div",{className:o().hint,children:[(0,n.jsx)("div",{children:u}),void 0!==p&&(0,n.jsxs)("div",{children:[t.length," / ",p]})]})]})}},54015:function(e,t,r){"use strict";r.d(t,{f:function(){return l}});var n=r(85893),i=r(150),s=r.n(i),a=r(94184),o=r.n(a);function l(e){return(0,n.jsx)("div",{className:o()(s().buttonCombo,e.className),children:e.children})}},69501:function(e,t,r){"use strict";r.d(t,{D:function(){return a}});var n=r(67294),i=r(45172),s=r(46367);function a(e,t){function r(){a.current.eventSent||(i.Z.trackEvent(e,{...t,max_memory_usage_bytes:a.current.maxMemoryUsage}),a.current.eventSent=!0)}let a=(0,n.useRef)({trackEvent:r,eventSent:!1,maxMemoryUsage:0});a.current.trackEvent=r,function(e){let t=(0,n.useRef)(e);t.current=e,(0,n.useEffect)(()=>{let e=()=>{t.current()};return window.addEventListener("beforeunload",e),()=>{window.removeEventListener("beforeunload",e)}},[])}(()=>{a.current.trackEvent(),i.Z.flush()}),(0,n.useEffect)(()=>{let e=setInterval(()=>{let e=performance;if((0,s.n)(e.memory)){var t;let r=null!==(t=e.memory.usedJSHeapSize)&&void 0!==t?t:0;a.current.maxMemoryUsage=Math.max(a.current.maxMemoryUsage,r)}},1e3);return()=>{a.current.trackEvent(),clearInterval(e)}},[])}},25657:function(e,t,r){"use strict";r.d(t,{u:function(){return o}});var n=r(56223),i=r(45172),s=r(46367);let a="".concat("https://core-api.dune.com/public","/events/page-view/"),o=async e=>{if(!(0,s.n)(i.Z.deviceId))return;let t=i.Z.userId,r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,platform:"WEB",deviceId:i.Z.deviceId,userId:(0,s.n)(t)?Number(t):null,userAgent:window.navigator.userAgent})});if(![200,204].includes(r.status)){let e=await r.json();throw new n.Bb(r.status,e)}}},18099:function(e,t,r){"use strict";function n(e){switch(e.type){case"team":return{owner_team:e.handle};case"user":return{owner_user:e.handle};default:return{}}}r.d(t,{k:function(){return n}})},23645:function(e){e.exports={subBody:"ScheduleQueryExecutionModalContent_subBody__LWw45",collapsibleTitle:"ScheduleQueryExecutionModalContent_collapsibleTitle__shJNZ",schedule:"ScheduleQueryExecutionModalContent_schedule__pAHFa",alertsContainer:"ScheduleQueryExecutionModalContent_alertsContainer__jdjiS",divider:"ScheduleQueryExecutionModalContent_divider__E9mPE",alert:"ScheduleQueryExecutionModalContent_alert___To8Y",header:"ScheduleQueryExecutionModalContent_header__y0lml",content:"ScheduleQueryExecutionModalContent_content__w43AI",error:"ScheduleQueryExecutionModalContent_error__IfSt1",hint:"ScheduleQueryExecutionModalContent_hint__mmeW5"}},21698:function(e){e.exports={webhookTestTrigger:"WebhookTriggerHint_webhookTestTrigger__kkWVK",error:"WebhookTriggerHint_error__llX71"}},91113:function(e){e.exports={text:"favorites_text__u6gY3",readOnlyBtn:"favorites_readOnlyBtn__T6SkD"}},1036:function(e){e.exports={modalContent:"share_modalContent__qagGQ",customIcon:"share_customIcon__5j_8d",hint:"share_hint__oK_uj",embedIframeHtml:"share_embedIframeHtml__Ojwfn",tag:"share_tag__YshSf",attribute:"share_attribute__XBTa6",value:"share_value__2m_Mq"}},65808:function(e){e.exports={main:"BadgeInput_main__FBQbT",container:"BadgeInput_container__rlT7e",badge:"BadgeInput_badge__RpLo1",tagsInput:"BadgeInput_tagsInput__Kp0qJ",hint:"BadgeInput_hint__UjWL5"}},150:function(e){e.exports={buttonCombo:"ButtonCombo_buttonCombo__N6Xto"}}}]);
//# sourceMappingURL=2882-50dc02845b19281c.js.map