1import{a as V}from"./chunk-HJBOLW3R.js";import{b as k,j as N}from"./chunk-A3RTOHAE.js";import"./chunk-LNDWG6JC.js";import"./chunk-ARDNRIV2.js";import"./chunk-HQTVHAQW.js";import"./chunk-MEYOPHYL.js";import{b as D}from"./chunk-Z25JQFZY.js";import"./chunk-O4ZIPW7U.js";import{c as O,d as $,e as A}from"./chunk-UONNK4JB.js";import"./chunk-LU2HESFQ.js";import{a as j}from"./chunk-IH4ITUD4.js";import{a as U}from"./chunk-4CTEXQP5.js";import"./chunk-2OC6HQNA.js";import{z as E}from"./chunk-SYEZTLVW.js";import"./chunk-JP3XDRFL.js";import{b as q}from"./chunk-2RC3DEBP.js";import{m as M,o as T}from"./chunk-5RXBQWLG.js";import"./chunk-J6EGUZAK.js";import{Ec as S,La as a,Na as g,Qa as m,Sa as d,Ta as s,Ua as o,Va as f,bb as c,fa as _,fc as I,ja as x,ka as w,kb as l,lb as h,mc as C,zc as b}from"./chunk-ZJRTJZFI.js";import{h as R,j as y}from"./chunk-GM3POKX7.js";var K=R(j());function J(e,i){if(e&1&&(s(0,"small")(1,"code"),l(2),o()()),e&2){let t=c();a(2),h(t.event==null?null:t.event.id)}}function P(e,i){if(e&1&&f(0,"app-url-widget",6),e&2){let t=c(2);d("url",t.url)}}function G(e,i){if(e&1&&f(0,"app-url-widget",7),e&2){let t=c(2);d("url",t.appUrl)}}function W(e,i){if(e&1&&(s(0,"div",3),m(1,P,1,1,"app-url-widget",4),m(2,G,1,1,"app-url-widget",5),o()),e&2){let t=c();a(1),d("ngIf",t.event.registration.enabled),a(1),d("ngIf",!t.event.registration.enabled)}}function z(e,i){if(e&1&&(s(0,"div",13)(1,"div")(2,"h4",14),l(3),o(),s(4,"p",15),l(5,"Days"),o()(),s(6,"div")(7,"h4",14),l(8),o(),s(9,"p",15),l(10,"Hours"),o()(),s(11,"div")(12,"h4",14),l(13),o(),s(14,"p",15),l(15,"Minutes"),o()(),s(16,"div")(17,"h4",14),l(18),o(),s(19,"p",15),l(20,"Seconds"),o()()()),e&2){let t=c(2);a(3),h(t.countdown.days),a(5),h(t.countdown.hours),a(5),h(t.countdown.minutes),a(5),h(t.countdown.seconds)}}function B(e,i){e&1&&(s(0,"p",16),l(1," The event has started! "),o())}function H(e,i){e&1&&(s(0,"p",16),l(1,"The event has ended."),o())}function Y(e,i){if(e&1&&(s(0,"div",3)(1,"div",8)(2,"div",9)(3,"h5",10),l(4,"Event countdown"),o(),m(5,z,21,4,"div",11),m(6,B,2,0,"p",12),m(7,H,2,0,"p",12),o()()()),e&2){let t=c();a(5),d("ngIf",!t.eventStarted),a(1),d("ngIf",t.eventStarted&&!t.eventEnded),a(1),d("ngIf",t.eventEnded)}}function X(e,i){if(e&1&&f(0,"app-metrics",19,20),e&2){let t=c(2);d("metrics",t.metrics)("keenKey",t.event.org.keenKey)}}function Q(e,i){if(e&1&&(s(0,"div"),m(1,X,2,2,"app-metrics",17),f(2,"app-metric-chart",18),o()),e&2){let t=c();a(1),d("ngIf",t.metrics),a(1),d("charts",t.charts)("keenKey",t.event.org.keenKey)("minDate",t.event.created)}}var L=(()=>{let i=class{constructor(r,n,p){this.apollo=r,this.regUrl=n,this.route=p,this.loading=!0,this.eventStarted=!1,this.eventEnded=!1,this.interval="daily",this.timeframeDays=7}setTimeframe(r){this.timeframeDays=r,this.buildMetrics(this.timeframeDays)}buildMetrics(r){let n=[{propertyName:"event_id",operator:"eq",propertyValue:this.event.id}],p={id:"net-revenue",prefix:"$",title:"Total net sales",query:{analysisType:"sum",eventCollection:"order_paid",targetProperty:"net_amount",timeframe:{start:new Date(parseFloat(this.event.created)).toISOString(),end:new Date().toISOString()},filters:[...n]}},u={id:"pageviews",title:`Pageviews (last ${r} days)`,query:{analysisType:"count",eventCollection:"pageView",timeframe:`this_${r}_days`,filters:[...n]}};this.metrics=[{id:"devices",title:`Unique users (last ${r} days)`,query:{analysisType:"count_unique",eventCollection:"pageView",targetProperty:"device.uuid",timeframe:`this_${r}_days`,filters:[...n]}},this.event.registration.enabled?p:u],this.charts=[{id:"unique-users",title:"Unique Users",query:{analysisType:"count_unique",eventCollection:"pageView",targetProperty:"device.uuid",groupBy:["device.platform.name"],filters:[...n]},chart:{type:"area",legend:{position:"bottom"},renderOnVisible:!0,palette:"modern"}},{id:"pageviews",title:"Pageviews",query:{analysisType:"count",eventCollection:"pageView",timeframe:`this_${r}_days`,interval:this.interval,groupBy:["device.platform.name"],filters:[...n]},chart:{type:"area",legend:{position:"bottom"},renderOnVisible:!0,palette:"modern"}}],this.event.registration.enabled&&(this.metrics.push({id:"orders",title:"Total orders",query:{analysisType:"count",eventCollection:"order_paid",timeframe:{start:new Date(parseFloat(this.event.created)).toISOString(),end:new Date().toISOString()},filters:[...n]}}),this.charts.push({id:"registrations",title:"New Orders",query:{analysisType:"count",eventCollection:"order_paid",filters:[...n]},chart:{type:"area",legend:{position:"bottom"},renderOnVisible:!0,palette:"modern",labelMapping:{null:"None"}}},{id:"revenue",title:"Revenue",query:{analysisType:"sum",eventCollection:"order_paid",targetProperty:"net_amount",filters:[...n]},chart:{type:"area",legend:{position:"bottom"},renderOnVisible:!0,palette:"modern",labelMapping:{null:"None"},axis:{y:{tick:{format:(v,ee,te)=>(0,K.default)(v).format("$0,0")}}}}}))}getEvent(r){return y(this,null,function*(){let{errors:n,loading:p,data:u}=yield this.apollo.query({query:T` 2 query Dash_GetEventDashboard($event: String, $org: String) { 3 me { 4 id 5 isGlobalAdmin 6 } 7 getEvent(event: $event, org: $org) { 8 id 9 slug 10 startDate 11 endDate 12 created 13 org { 14 id 15 slug 16 keenKey 17 primaryDomain 18 } 19 registration { 20 enabled 21 } 22 } 23 } 24 `,variables:r}).toPromise();this.event=u?.getEvent,this.user=u?.me,this.event&&(this.url=this.reg
24Url.main(this.event.org.primaryDomain,this.event.slug),this.appUrl=this.regUrl.app(this.event.org.slug,this.event.slug),this.startCountdown()),this.buildMetrics(this.timeframeDays)})}startCountdown(){this.getCountdown(),this.countdownInterval=setInterval(()=>{this.getCountdown()},1e3)}getCountdown(){let r=new Date(this.event.startDate).getTime(),n=new Date(this.event.startDate).getTime(),p=new Date().getTime(),u=r-p,v=U.fromMillis(u).shiftTo("days","hours","minutes","seconds");this.countdown={days:Math.floor(v.days).toString(),hours:Math.floor(v.hours).toString(),minutes:Math.floor(v.minutes).toString(),seconds:Math.floor(v.seconds).toString()},this.eventStarted=u<=0,this.eventEnded=n-p<=0,this.eventEnded&&clearInterval(this.countdownInterval)}ngOnInit(){this.route.params.subscribe(p=>y(this,[p],function*({org:r,event:n}){this.getEvent({org:r,event:n})}))}ngOnDestroy(){this.event=null,clearInterval(this.countdownInterval)}},e=i;return(()=>{i.\u0275fac=function(n){return new(n||i)(g(M),g(V),g(b))}})(),(()=>{i.\u0275cmp=x({type:i,selectors:[["app-dashboard"]],decls:7,vars:4,consts:[[4,"ngIf"],[1,"row","mb-3"],["class","col-md-6 col-12 mb-4",4,"ngIf"],[1,"col-md-6","col-12","mb-4"],["name","Event page","description","Share this URL with when you are ready to start selling tickets",3,"url",4,"ngIf"],["name","App preview","description","Use this URL to preview the app",3,"url",4,"ngIf"],["name","Event page","description","Share this URL with when you are ready to start selling tickets",3,"url"],["name","App preview","description","Use this URL to preview the app",3,"url"],[1,"card","rounded-xl","shadow-sm"],[1,"card-body"],[1,"card-title"],["class","d-flex justify-content-between text-center",4,"ngIf"],["class","card-text",4,"ngIf"],[1,"d-flex","justify-content-between","text-center"],[1,"mb-0"],[1,"text-muted","mt-0"],[1,"card-text"],[3,"metrics","keenKey",4,"ngIf"],[3,"charts","keenKey","minDate"],[3,"metrics","keenKey"],["dashMetrics",""]],template:function(n,p){n&1&&(s(0,"h2"),l(1," Dashboard "),m(2,J,3,1,"small",0),o(),s(3,"div",1),m(4,W,3,2,"div",2),m(5,Y,8,3,"div",2),o(),m(6,Q,3,4,"div",0)),n&2&&(a(2),d("ngIf",p.user==null?null:p.user.isGlobalAdmin),a(2),d("ngIf",p.event),a(1),d("ngIf",p.event),a(1),d("ngIf",p.event))},dependencies:[I,k,O,$],styles:[` 25/*# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFtdLAogICJzb3VyY2VzQ29udGVudCI6IFtdLAogICJtYXBwaW5ncyI6ICIiLAogICJuYW1lcyI6IFtdCn0K */`]})})(),e})();var Z=[{path:"",component:L}],Ie=(()=>{let i=class{},e=i;return(()=>{i.\u0275fac=function(n){return new(n||i)}})(),(()=>{i.\u0275mod=w({type:i})})(),(()=>{i.\u0275inj=_({imports:[C,S.forChild(Z),E,q,N,D,A]})})(),e})();export{Ie as DashboardModule}; 26//# sourceMappingURL=dashboard.module-BGPNDZJ4.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.