forked from duneanalytics/DuneQueryRepo
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path9736-f07e9714a6dce674.js.download
2 lines (2 loc) · 10.6 KB
/
9736-f07e9714a6dce674.js.download
1
2
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9736],{39736:function(n,e,t){t.d(e,{A:function(){return Z}});var r=t(85893),i=t(76896),a=t(82729),l=t(27073),s=t(83402),d=t.n(s),o=t(94184),c=t.n(o),u=t(41664),h=t.n(u),f=t(71429),v=t(30297),m=t(77747),x=t(67693),p=t(54173),j=t(91745),g=t(26550),I=t(80949);function y(n){let{title:e,url:t,type:i,owner:a,updatedAt:l,tags:s,onOpen:o,isPrivate:u}=n;return(0,r.jsxs)("td",{className:c()(d().contentDetails,d().mainCell),children:[(0,r.jsxs)("div",{className:d().nameAndTags,children:[(0,r.jsx)(h(),{href:t,onClick:o,onAuxClick:o,children:(0,r.jsxs)("div",{className:d().titleRow,children:["QueryModel"===i?(0,r.jsx)(j.IconTerminalWindow,{}):(0,r.jsx)(g.IconTiles,{}),(0,r.jsx)("div",{className:d().title,children:e})]})}),void 0!==s&&s.length>0&&(0,r.jsx)("ul",{className:d().tags,children:s.slice(0,5).map(n=>(0,r.jsx)("li",{children:(0,r.jsxs)(p.A,{href:"/discover/content/relevant?q=".concat(encodeURIComponent(n.includes(" ")?'tags:"'.concat(n,'"'):"tags:".concat(n))),theme:"tertiary",size:"XS",children:["#",n]})},n))})]}),(0,r.jsxs)("div",{className:d().ownerAndDetails,children:[(0,r.jsxs)(h(),{href:"/".concat(a.handle),children:["@",a.handle]}),(0,r.jsxs)("span",{children:["• updated ",(0,r.jsx)(f.bM,{children:l})]}),u&&(0,r.jsx)(I.J,{icon:"lock-fill"})]})]})}var C=t(59896),b=t(39137),w=t(26089),A=t(1801),U=t(42708),k=t(15468),_=t(15801),N=t(57831),S=t(71909);function D(){let n=(0,a._)(["\n fragment FDashboard on Dashboard {\n __typename\n createdAt\n updatedAt\n id\n isArchived\n isPrivate\n name\n slug\n starCount\n tags\n isTrending\n hasStarred\n\n team {\n id\n handle\n profileImageUrl\n }\n\n user {\n id\n handle: name\n profileImageUrl\n }\n }\n"]);return D=function(){return n},n}function P(n){var e,t,i,a,s,o;let{item:c,onOpen:u}=n,h=(0,l.iP)().width<=699,f=null!==(e=c.isTrending)&&void 0!==e&&e,v=c.user?{type:"user",id:c.user.id,handle:c.user.handle,profileImageUrl:null!==(t=c.user.profileImageUrl)&&void 0!==t?t:void 0}:c.team?{type:"team",id:null!==(i=c.team.id)&&void 0!==i?i:-1,handle:null!==(a=c.team.handle)&&void 0!==a?a:"",profileImageUrl:null!==(s=c.team.profileImageUrl)&&void 0!==s?s:void 0}:void 0;if(!v)throw Error("No owner for dasboard id=".concat(c.id));return(0,r.jsx)("tr",{children:h?(0,r.jsx)(L,{item:c,owner:v,trending:f,onOpen:u}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:d().avatarCell,children:(0,r.jsx)(x._,{id:v.id,handle:v.handle,type:v.type,profileImageUrl:v.profileImageUrl})}),(0,r.jsx)(y,{title:c.name,url:"/".concat(v.handle,"/").concat(c.slug),type:c.__typename,owner:v,tags:null!==(o=c.tags)&&void 0!==o?o:void 0,updatedAt:c.updatedAt,onOpen:u,isPrivate:c.isPrivate}),(0,r.jsx)(C.a,{icon:(0,r.jsx)(F,{item:c}),count:c.starCount,trending:f})]})})}function L(n){let{item:e,owner:t,trending:i,onOpen:a}=n;return(0,r.jsxs)("td",{className:c()(d().contentDetails,d().mainCell),children:[(0,r.jsx)("div",{className:d().nameAndTags,children:(0,r.jsx)(h(),{href:"/".concat(t.handle,"/").concat(e.slug),onClick:a,children:(0,r.jsxs)("div",{className:d().titleRow,children:[(0,r.jsx)(g.IconTiles,{}),(0,r.jsx)("div",{className:d().title,children:e.name})]})})}),(0,r.jsxs)("div",{className:d().ownerAndDetails,children:[(0,r.jsx)(h(),{href:"/".concat(t.handle),children:(0,r.jsx)(v.q,{src:t.profileImageUrl,ownerId:t.id,handle:t.handle,type:t.type,size:16})}),(0,r.jsxs)(h(),{href:"/".concat(t.handle),children:["@",t.handle]}),(0,r.jsxs)("span",{children:["• updated ",(0,r.jsx)(f.bM,{children:e.updatedAt})]}),e.isPrivate&&(0,r.jsx)(I.J,{icon:"lock-fill"})]}),(0,r.jsxs)("div",{className:d().statsAndTrending,children:[(0,r.jsx)(C.k,{icon:(0,r.jsx)(F,{item:e}),count:e.starCount}),i&&(0,r.jsx)(A.C,{size:"L",variant:"filled",color:"brand-orange",iconOnly:!0,children:(0,r.jsx)(w.IconChartLineUp,{})})]})]})}function F(n){var e;let{item:t}=n,i=(0,N.kP)(),a=(0,S.J)(),{favoriteDashboard:l}=(0,k.t)(),{unfavoriteDashboard:s}=(0,_.s)();if(void 0===i)return(0,r.jsx)(h(),{href:a,"aria-label":"Add to favorites",children:(0,r.jsx)(m.IconStar,{})});let d=null!==(e=t.hasStarred)&&void 0!==e&&e;return d?(0,r.jsx)("button",{"aria-label":"Remove from favorites",onClick:()=>{s(t.id)},children:(0,r.jsx)(U.IconStarFill,{})}):(0,r.jsx)("button",{"aria-label":"Add to favorites",onClick:()=>{l(t.id)},children:(0,r.jsx)(m.IconStar,{})})}(0,b.Z)(D());var Q=t(23852),T=t(93556);function O(){let n=(0,a._)(["\n fragment FQuery on QueryModel {\n __typename\n id\n name\n tags\n createdAt\n updatedAt\n isPrivate\n starCount\n isTrending\n hasStarred\n matviewId\n\n team {\n id\n handle\n profileImageUrl\n }\n\n user {\n id\n handle: name\n profileImageUrl\n }\n }\n"]);return O=function(){return n},n}function $(n){var e,t,i,a,s,o;let{item:c,onOpen:u}=n,h=(0,l.iP)().width<=699,f=null!==(e=c.isTrending)&&void 0!==e&&e,v=c.user?{type:"user",id:c.user.id,handle:c.user.handle,profileImageUrl:null!==(t=c.user.profileImageUrl)&&void 0!==t?t:void 0}:c.team?{type:"team",id:null!==(i=c.team.id)&&void 0!==i?i:-1,handle:null!==(a=c.team.handle)&&void 0!==a?a:"",profileImageUrl:null!==(s=c.team.profileImageUrl)&&void 0!==s?s:void 0}:void 0;if(!v)throw Error("No owner for query id=".concat(c.id));return(0,r.jsx)("tr",{children:h?(0,r.jsx)(q,{item:c,owner:v,trending:f,onOpen:u}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("td",{className:d().avatarCell,children:(0,r.jsx)(x._,{id:v.id,handle:v.handle,type:v.type,profileImageUrl:v.profileImageUrl})}),(0,r.jsx)(y,{title:c.name,url:"/queries/".concat(c.id),type:c.__typename,owner:v,tags:null!==(o=c.tags)&&void 0!==o?o:void 0,updatedAt:c.updatedAt,onOpen:u,isPrivate:c.isPrivate}),(0,r.jsx)(C.a,{icon:(0,r.jsx)(M,{item:c}),count:c.starCount,trending:f})]})})}function q(n){let{item:e,owner:t,trending:i,onOpen:a}=n;return(0,r.jsxs)("td",{className:c()(d().contentDetails,d().mainCell),children:[(0,r.jsx)("div",{className:d().nameAndTags,children:(0,r.jsx)(h(),{href:"/queries/".concat(e.id),onClick:a,children:(0,r.jsxs)("div",{className:d().titleRow,children:[(0,r.jsx)(j.IconTerminalWindow,{}),(0,r.jsx)("div",{className:d().title,children:e.name})]})})}),(0,r.jsxs)("div",{className:d().ownerAndDetails,children:[(0,r.jsx)(h(),{href:"/".concat(t.handle),children:(0,r.jsx)(v.q,{src:t.profileImageUrl,ownerId:t.id,handle:t.handle,type:t.type,size:16})}),(0,r.jsxs)(h(),{href:"/".concat(t.handle),children:["@",t.handle]}),(0,r.jsxs)("span",{children:["• updated ",(0,r.jsx)(f.bM,{children:e.updatedAt})]}),e.isPrivate&&(0,r.jsx)(I.J,{icon:"lock-fill"})]}),(0,r.jsxs)("div",{className:d().statsAndTrending,children:[(0,r.jsx)(C.k,{icon:(0,r.jsx)(M,{item:e}),count:e.starCount}),i&&(0,r.jsx)(A.C,{size:"L",variant:"filled",color:"brand-orange",iconOnly:!0,children:(0,r.jsx)(w.IconChartLineUp,{})})]})]})}function M(n){var e;let{item:t}=n,i=(0,N.kP)(),a=(0,S.J)(),{favoriteQuery:l}=(0,Q.S)(),{unfavoriteQuery:s}=(0,T.F)();if(void 0===i)return(0,r.jsx)(h(),{href:a,"aria-label":"Add to favorites",children:(0,r.jsx)(m.IconStar,{})});let d=null!==(e=t.hasStarred)&&void 0!==e&&e;return d?(0,r.jsx)("button",{"aria-label":"Remove from favorites",onClick:()=>{s(t.id)},children:(0,r.jsx)(U.IconStarFill,{})}):(0,r.jsx)("button",{"aria-label":"Add to favorites",onClick:()=>{l(t.id)},children:(0,r.jsx)(m.IconStar,{})})}function R(n){let{item:e,onOpen:t}=n;switch(e.__typename){case"Dashboard":return(0,r.jsx)(P,{item:e,onOpen:t});case"QueryModel":return(0,r.jsx)($,{item:e,onOpen:t})}}function Z(n){return(0,r.jsx)(i.i,{children:n.items.map((e,t)=>(0,r.jsx)(R,{item:e,onOpen:()=>{var r;return null===(r=n.trackResultClick)||void 0===r?void 0:r.call(n,e,t)}},e.__typename+e.id))})}(0,b.Z)(O())},67693:function(n,e,t){t.d(e,{_:function(){return s}});var r=t(85893),i=t(41664),a=t.n(i),l=t(30297);function s(n){let{id:e,handle:t,type:i,profileImageUrl:s}=n;return(0,r.jsx)(a(),{href:"/".concat(t),children:(0,r.jsx)(l.q,{src:s,ownerId:e,handle:t,type:i,size:25})})}},42708:function(n,e,t){t.r(e),t.d(e,{IconStarFill:function(){return i}});var r=t(85893);function i(){return(0,r.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M3.6123 15.4427C3.22586 15.6413 2.78829 15.2942 2.86609 14.8508L3.69582 10.1213L0.173489 6.76462C-0.155692 6.45092 0.0147086 5.87737 0.455698 5.81472L5.35417 5.11885L7.53829 0.792305C7.73504 0.402565 8.26801 0.402565 8.46476 0.792305L10.6489 5.11885L15.5474 5.81472C15.9883 5.87737 16.1587 6.45092 15.8296 6.76462L12.3072 10.1213L13.137 14.8508C13.2148 15.2942 12.7772 15.6413 12.3908 15.4427L8.00153 13.1868L3.6123 15.4427Z",fill:"currentColor"})})}},15468:function(n,e,t){t.d(e,{t:function(){return s}});var r=t(82729),i=t(57831),a=t(84937);function l(){let n=(0,r._)(["\n mutation FavoriteDashboard($input: FavoriteDashboardInput!) {\n favoriteDashboard(input: $input) {\n id\n starCount\n hasStarred\n }\n }\n"]);return l=function(){return n},n}function s(){let n=(0,i.kP)(),[e,t]=(0,a.QyX)();return{favoriteDashboard:function(t){e({context:{session:n},variables:{input:{id:t}}})},favoriteDashboardMutationResult:t}}(0,t(39137).Z)(l())},23852:function(n,e,t){t.d(e,{S:function(){return s}});var r=t(82729),i=t(57831),a=t(84937);function l(){let n=(0,r._)(["\n mutation FavoriteQuery($input: FavoriteQueryInput!) {\n favoriteQuery(input: $input) {\n id\n starCount\n hasStarred\n }\n }\n"]);return l=function(){return n},n}function s(){let n=(0,i.kP)(),[e,t]=(0,a.j7d)();return{favoriteQuery:function(t){e({context:{session:n},variables:{input:{id:t}}})},favoriteQueryMutationResult:t}}(0,t(39137).Z)(l())},15801:function(n,e,t){t.d(e,{s:function(){return s}});var r=t(82729),i=t(57831),a=t(84937);function l(){let n=(0,r._)(["\n mutation UnfavoriteDashboard($input: UnfavoriteDashboardInput!) {\n unfavoriteDashboard(input: $input) {\n id\n starCount\n hasStarred\n }\n }\n"]);return l=function(){return n},n}function s(){let n=(0,i.kP)(),[e,t]=(0,a.LhV)();return{unfavoriteDashboard:function(t){e({context:{session:n},variables:{input:{id:t}}})},unfavoriteDashboardMutationResult:t}}(0,t(39137).Z)(l())},93556:function(n,e,t){t.d(e,{F:function(){return s}});var r=t(82729),i=t(57831),a=t(84937);function l(){let n=(0,r._)(["\n mutation UnfavoriteQuery($input: UnfavoriteQueryInput!) {\n unfavoriteQuery(input: $input) {\n id\n starCount\n hasStarred\n }\n }\n"]);return l=function(){return n},n}function s(){let n=(0,i.kP)(),[e,t]=(0,a.UW4)();return{unfavoriteQuery:function(t){e({context:{session:n},variables:{input:{id:t}}})},unfavoriteQueryMutationResult:t}}(0,t(39137).Z)(l())}}]);
//# sourceMappingURL=9736-f07e9714a6dce674.js.map