1"use strict";(self.webpackChunksurvicatejs=self.webpackChunksurvicatejs||[]).push([[9896],{99040:(function(Q,y,t){t.d(y,{HH:function(){return d},rk:function(){return n},wk:function(){return g}});var e=t(50953);const a=(0,e.IJ)(null);function d(){return(0,e.nD)(a)}function g(r){a.value=r}function n(r){a.value===r&&(a.value=null)}}),46721:(function(Q,y,t){t.r(y),t.d(y,{default:function(){return M}});var e=t(20641),a=t(50953),d=t(90033),g=t(61038),n=t(60249),r=t(48173),p=t(34744),$=t(52666),b=t(51082),_=t(11619),N=t(4739),P=t(85655),F=t(19425),O=t(955);const x={class:"h3 no-air grow"};var z=(0,e.pM)({__name:"Dashboard",setup(T){const K=(0,N.I)(),C=(0,e.EW)(()=>K.dashboard),D=(0,$.t)();_.l7.emit("Segment/track",{name:"dashboard_viewed",data:{widgets_count:C.value?.widgets.length||0,workspace_id:D.params.wId}});const B=(0,F.e)(),U=(0,a.KR)(!0),i=(0,a.KR)("");function J(){U.value=!0,i.value="",K.fetch(D.params.wId,D.params.dashboardId).then(c=>{B.save({type:"dashboard_viewed",dashboard_id:c.data.id,dashboard_name:c.data.name})}).catch(c=>{i.value=`Failed to fetch dashboard: ${(0,_.zc)(c)}`}).finally(()=>{U.value=!1})}(0,e.wB)(()=>D.params.dashboardId,c=>{c&&J()},{immediate:!0});const q=(0,e.EW)(()=>{const{allowedWidgetTypes:c,routes:v}=K.context,s=v.createWidget;return[{widgetType:"single-survey",label:"Single survey question",icon:g.A,attr:{to:{...s,params:{widgetType:"single-survey"}}}},{widgetType:"combined-score",label:"Combined score",icon:n.A,handler:()=>{(0,_.to)({type:"select-survey-points",size:"large"},"Dashboards")}},{widgetType:"insights-hub",label:"Research Hub",icon:r.A,attr:{to:{...s,params:{widgetType:"research-hub"}}}}].filter(({widgetType:w})=>c.includes(w))}),G=(0,P.E)(),u=(0,e.EW)(()=>typeof G.organization.subscription.limits.dashboard_widgets!="number"?!0:C.value?C.value?.widgets.length<G.organization.subscription.limits.dashboard_widgets:!1);return(c,v)=>{const s=(0,e.gN)("tooltip");return U.value?((0,e.uX)(),(0,e.Wv)((0,a.R1)(b.M6),{key:0})):((0,e.uX)(),(0,e.CE)("div",{key:1,class:(0,d.C4)([c.$style.component,{"has-widgets":C.value?.widgets.length}])},[i.value?((0,e.uX)(),(0,e.Wv)((0,a.R1)(b.gN),{key:0,type:"danger"},{default:(0,e.k6)(()=>[(0,e.Lk)("strong",null,(0,d.v_)(i.value),1)]),_:1})):C.value?((0,e.uX)(),(0,e.CE)(e.FK,{key:1},[((0,e.uX)(),(0,e.Wv)(e.Im,{to:"#survicate-module-header"},[(0,e.Lk)("div",{class:(0,d.C4)(["l-flex align-center grow",c.$style.title])},[(0,e.Lk)("h1",x,[(0,e.Lk)("strong",null,(0,d.v_)(C.value?.name),1)]),(0,e.bF)((0,a.R1)(b.Jc),{class:"air-left",menu:q.value,placement:"bottom-end",disabled:!u.value},{default:(0,e.k6)(()=>[(0,e.bo)(((0,e.uX)(),(0,e.Wv)((0,a.R1)(b.eF),{class:"color-brand no-wrap",icon:(0,a.R1)(p.A),disabled:!u.value},{default:(0,e.k6)(()=>[...v[0]||(v[0]=[(0,e.eW)(" Add widget ",-1)])]),_:1},8,["icon","disabled"])),[[s,u.value?"":"You have reached the limit of widgets for your subscription"]])]),_:1},8,["menu","disabled"])],2)])),C.value.widgets.length?((0,e.uX)(),(0,e.Wv)(O.A,{key:0})):((0,e.uX)(),(0,e.Wv)((0,a.R1)(b.Af),{key:1,src:["dashboards/empty-state.svg","dashboards/empty-state-dark.svg"],header:"No widgets added yet",content:"Add a widget to visualize your data"},{button:(0,e.k6)(()=>[(0,e.bF)((0,a.R1)(b.Jc),{menu:q.value,disabled:!u.value,placement:"bottom-end"},{default:(0,e.k6)(()=>[(0,e.bo)(((0,e.uX)(),(0,e.Wv)((0,a.R1)(b.eF),{class:"color-brand",disabled:!u.value,icon:(0,a.R1)(p.A)},{default:(0,e.k6)(()=>[...v[1]||(v[1]=[(0,e.eW)(" Add widget ",-1)])]),_:1},8,["disabled","icon"])),[[s,u.value?"":"You have reached the limit of widgets for your subscription"]])]),_:1},8,["menu","disabled"])]),_:1}))],64)):(0,e.Q3)("v-if",!0)],2))}}}),R={title:"Dashboard_c7bd7a1ad6",component:"Dashboard_b50d690333"},A=t(66262);const L={};L.$style=R;var M=(0,A.A)(z,[["__cssModules",L]])}),60959:(function(Q,y,t){t.r(y),t.d(y,{default:function(){return G}});var e=t(20641),a=t(50953),d=t(90033),g=t(52666),n=t(51082),r=t(11619),p=t(4739),$=t(14493),b=t(53751),_=t(90444),N=t(38221),P=t.n(N),F=t(67067),O=t(47831);const x={class:"g-row align-end air"},z={class:"g-col-3"},R={key:0,class:"g-col-3"},A={class:"g-col"},L={class:"relative",style:{"min-height":"400px"}},W={class:"l-flex"},M={class:"text-right"};var T=(0,e.pM)({__name:"SelectSurveyPoints",props:{isEditing:{type:Boolean,default:!1},modelData:{default:()=>{}}},emits:["close","set-close-handler-payload"],setup(u,{emit:c}){const v=c,s=(0,a.Kh)({answer_type:"nps",scale:"",survey_point_ids:[]}),f=(0,a.Kh)({smiley_scale:[],rating:[],numerical_scale:[]}
1),w=(0,e.EW)(()=>[{value:"nps",label:"NPS"},{value:"rating",label:"Rating"},{value:"smiley_scale",label:"Smiley scale"},{value:"numerical_scale",label:"Numerical scale"},{value:"csat",label:"Classic CSAT"}].filter(o=>["nps","csat"].includes(o.value)?!0:!!f[o.value]?.length)),E=(0,a.KR)(!0),m=(0,a.KR)(""),I=(0,g.t)();function X(){(0,r.lw)("ANALYSIS_SERVER").get(`workspaces/${I.params.wId}/available_combined_rating_questions`).then(l=>{Object.keys(l.data).forEach(o=>{f[o]=l.data[o].map(k=>({value:`${k}`,label:`${k}`}))})}).catch(l=>{m.value=`Failed to fetch scale options: ${(0,r.zc)(l)}`}).finally(()=>{E.value=!1})}X();const S=(0,e.EW)(()=>s.survey_point_ids.length?`Combine (${s.survey_point_ids.length})`:"Combine"),ee=[{key:"survey_name",label:"Survey"},{key:"content",label:"Question"},{key:"response_count",label:"Responses",colStyle:"width: 1%",align:"right",noWrap:!0},{key:"last_response_at",label:"Last on",colStyle:"width: 1%",align:"right",noWrap:!0}],H=(0,a.KR)([]),ae=(0,a.Kh)({current:0,first:1,num_items_per_page:0,page_count:0,total_items:0}),Z=(0,a.KR)("");let te=[];const Y=(0,a.KR)(!1),oe=(0,e.EW)(()=>!!s.survey_point_ids.length&&H.value.every(({id:l})=>s.survey_point_ids.includes(l)));function re(){if(oe.value){s.survey_point_ids=[];return}if(ae.page_count===1){s.survey_point_ids=[...te];return}Y.value=!0,m.value="";const l={answer_type:s.answer_type};s.scale&&(l.scale=s.scale),Z.value&&(l.search=Z.value),(0,r.lw)("ANALYSIS_SERVER").post(`workspaces/${I.params.wId}/all_combined_survey_points`,l).then(o=>{s.survey_point_ids=[...o.data.survey_points]}).catch(o=>{m.value=`Failed to fetch all survey points: ${(0,r.zc)(o)}`}).finally(()=>{Y.value=!1})}function ue(l){s.survey_point_ids=l}const V=(0,a.KR)(!0),le=(0,p.I)();function j(l={}){m.value="";const o={...l,answer_type:s.answer_type};s.scale&&(o.scale=s.scale),le.fetchSurveyPoints(I.params.wId,o).then(k=>{Object.keys(k.data.pagination_data).forEach(h=>{ae[h]=k.data.pagination_data[h]}),te=[],H.value=k.data.survey_points.map(h=>(k.data.pagination_data.page_count===1&&te.push(h.id),h))}).catch(k=>{m.value=`Failed to fetch survey points: ${(0,r.zc)(k)}`}).finally(()=>{V.value=!1,Y.value=!1})}function ne(l){V.value=!0,s.survey_point_ids=[],["nps","csat"].includes(l)?s.scale="":s.scale=f[l][0].value,j()}function ie(){V.value=!0,s.survey_point_ids=[],j()}const ce=P()(l=>{V.value=!0,j({search:l})},300);function ve(l){Y.value=!0,j({page:l})}u.isEditing&&u.modelData?(s.survey_point_ids=[...u.modelData.survey_point_ids],s.answer_type=u.modelData.answer_type,s.scale=u.modelData.scale||"",j()):ne(s.answer_type);function de(){const l=le.widget.source;l.survey_point_ids=[...s.survey_point_ids],l.answer_type=s.answer_type,s.scale&&(l.scale=s.scale),u.isEditing&&(l.breakdown=[]),v("set-close-handler-payload",!0)}const se=(0,a.KR)(!1),me=(0,g.n)();function pe(){if(se.value=!0,u.isEditing){de(),v("close");return}de(),me.push({name:"dashboards-dashboard-create-widget",params:{widgetType:"combined-score"}}).finally(()=>{se.value=!1}),v("close")}return(l,o)=>{const k=(0,e.gN)("tooltip");return(0,e.uX)(),(0,e.CE)(e.FK,null,[m.value?((0,e.uX)(),(0,e.Wv)((0,a.R1)(n.gN),{key:0,type:"danger"},{default:(0,e.k6)(()=>[(0,e.Lk)("strong",null,(0,d.v_)(m.value),1)]),_:1})):(0,e.Q3)("v-if",!0),o[8]||(o[8]=(0,e.Lk)("h2",{class:"h1"}," Combined Score Widget ",-1)),o[9]||(o[9]=(0,e.Lk)("p",null,"Select question type you want to combine.",-1)),(0,e.Lk)("div",x,[(0,e.Lk)("div",z,[(0,e.bF)((0,a.R1)(n.G9),{modelValue:s.answer_type,"onUpdate:modelValue":[o[0]||(o[0]=h=>s.answer_type=h),ne],class:"no-air",options:w.value,readonly:V.value,"is-loading":E.value},{default:(0,e.k6)(()=>[...o[4]||(o[4]=[(0,e.eW)(" Question type ",-1)])]),_:1},8,["modelValue","options","readonly","is-loading"])]),f[s.answer_type]?((0,e.uX)(),(0,e.CE)("div",R,[(0,e.bF)((0,a.R1)(n.G9),{modelValue:s.scale,"onUpdate:modelValue":[o[1]||(o[1]=h=>s.scale=h),ie],class:"no-air",options:f[s.answer_type],readonly:V.value,"is-loading":E.value},{default:(0,e.k6)(()=>[...o[5]||(o[5]=[(0,e.eW)(" Number of answers ",-1)])]),_:1},8,["modelValue","options","readonly","is-loading"])])):(0,e.Q3)("v-if",!0),(0,e.Lk)("div",A,[(0,e.bF)((0,a.R1)(n.yF),{modelValue:Z.value,"onUpdate:modelValue":[o[2]||(o[2]=h=>Z.value=h),(0,a.R1)(ce)],class:"no-air",placeholder:"Search surveys","allow-clear":"",icon:{name:(0,a.R1)(_.A),position:"right"}},null,8,["modelValue","icon","onUpdate:modelValue"])])]),(0,e.Lk)("div",L,[(0,e.bF)(b.eB,{name:"component-fade",mode:"out-in"},{default:(0,e.k6)(()=>[V.value?((0,e.uX)(),(0,e.Wv)((0,a.R1)(n.M6),{key:0}
1)):H.value.length?((0,e.uX)(),(0,e.Wv)(O.A,{key:"content",items:H.value,"selected-ids":s.survey_point_ids,columns:ee,"pagination-data":ae,"is-loading":Y.value,"onUpdate:modelValue":ue,"onUpdate:page":ve},{"header-checkbox":(0,e.k6)(()=>[(0,e.bo)((0,e.bF)((0,a.R1)(n.HA),{class:"no-air","model-value":oe.value,"onUpdate:modelValue":re},null,8,["model-value"]),[[k,{content:"Select all",container:"#survicate-active-modal"}]])]),"cell(last_response_at)":(0,e.k6)(({item:h})=>[(0,e.eW)((0,d.v_)(h.last_response_at?(0,a.R1)(F.A)(h.last_response_at):"Never"),1)]),_:1},8,["items","selected-ids","pagination-data","is-loading"])):((0,e.uX)(),(0,e.Wv)((0,a.R1)(n.Af),{key:1,header:"No questions found",src:["dashboards/widget/empty-state.svg","dashboards/widget/empty-state-dark.svg"]}))]),_:1})]),(0,e.Lk)("div",W,[o[7]||(o[7]=(0,e.Lk)("div",{class:"grow"},null,-1)),(0,e.Lk)("div",M,[(0,e.bF)((0,a.R1)(n.eF),{class:"type-link",onClick:o[3]||(o[3]=h=>l.$emit("close"))},{default:(0,e.k6)(()=>[...o[6]||(o[6]=[(0,e.eW)(" Cancel ",-1)])]),_:1}),(0,e.bo)(((0,e.uX)(),(0,e.Wv)((0,a.R1)(n.eF),{class:"color-brand air-left-double","is-loading":se.value,disabled:s.survey_point_ids.length<2,onClick:pe},{default:(0,e.k6)(()=>[(0,e.eW)((0,d.v_)(S.value),1)]),_:1},8,["is-loading","disabled"])),[[k,{content:s.survey_point_ids.length<2?"Select at least 2 questions":"",container:"#survicate-active-modal"}]])])])],64)}}}),C=T;const D={class:"text-right"};var B=(0,e.pM)({__name:"RenameDashboard",props:{dashboardId:{},dashboardName:{}},emits:["close","set-close-handler-payload"],setup(u,{emit:c}){const v=c,s=(0,a.Kh)({name:u.dashboardName}),f=(0,p.I)(),w=(0,g.t)(),E=(0,a.KR)(!1),m=(0,a.KR)("");function I(){E.value=!0,m.value="",f.updateName(w.params.wId,u.dashboardId,s.name).then(()=>{(0,r.S7)({id:"dashboards",type:"success",message:"Dashboard name updated successfully"}),v("close")}).catch(X=>{s.name=u.dashboardName,m.value=`Failed to rename dashboard: ${(0,r.zc)(X)}`}).finally(()=>{E.value=!1})}return(X,S)=>{const ee=(0,e.gN)("focus");return(0,e.uX)(),(0,e.CE)(e.FK,null,[m.value?((0,e.uX)(),(0,e.Wv)((0,a.R1)(n.gN),{key:0,type:"danger"},{default:(0,e.k6)(()=>[(0,e.Lk)("strong",null,(0,d.v_)(m.value),1)]),_:1})):(0,e.Q3)("v-if",!0),S[4]||(S[4]=(0,e.Lk)("h2",{class:"h1 air"}," Rename dashboard ",-1)),(0,e.bo)((0,e.bF)((0,a.R1)(n.yF),{modelValue:s.name,"onUpdate:modelValue":S[0]||(S[0]=H=>s.name=H),maxlength:255},null,8,["modelValue"]),[[ee]]),(0,e.Lk)("div",D,[(0,e.bF)((0,a.R1)(n.eF),{class:"type-link",onClick:S[1]||(S[1]=H=>X.$emit("close"))},{default:(0,e.k6)(()=>[...S[2]||(S[2]=[(0,e.eW)(" Cancel ",-1)])]),_:1}),(0,e.bF)((0,a.R1)(n.eF),{class:"color-brand air-left-double","is-loading":E.value,disabled:!s.name||s.name===u.dashboardName,onClick:I},{default:(0,e.k6)(()=>[...S[3]||(S[3]=[(0,e.eW)(" Submit ",-1)])]),_:1},8,["is-loading","disabled"])])],64)}}}),i=B,J=(0,e.pM)({__name:"Dashboards",setup(u){const c=()=>({"select-survey-points":C,"rename-dashboard":i}),v=(0,g.t)(),s=(0,g.n)(),f=(0,p.I)(),w=(0,a.KR)(!0),E=(0,a.KR)("");return f.fetchAll(v.params.wId).then(()=>{v.params.dashboardId&&f.dashboards.find(I=>I.id===v.params.dashboardId)||s.replace(f.dashboards.length===0?{name:"dashboards-dashboard-create"}:{params:{dashboardId:f.dashboards[0].id}})}).catch(m=>{E.value=`Failed to fetch dashboards: ${(0,r.zc)(m)}`}).finally(()=>{w.value=!1,f.isLoadingDashboards=!1}),(0,e.xo)(()=>{f.$reset()}),(m,I)=>{const X=(0,e.g2)("router-view");return(0,e.uX)(),(0,e.Wv)($.A,null,{default:(0,e.k6)(()=>[w.value?((0,e.uX)(),(0,e.Wv)((0,a.R1)(n.M6),{key:0})):E.value?((0,e.uX)(),(0,e.Wv)((0,a.R1)(n.gN),{key:1,type:"danger"},{default:(0,e.k6)(()=>[(0,e.Lk)("strong",null,(0,d.v_)(E.value),1)]),_:1})):((0,e.uX)(),(0,e.Wv)(X,{key:2})),(0,e.bF)((0,a.R1)(n.aK),{"event-id":"Dashboards","modal-components":c})]),_:1})}}}),G=J}),92642:(function(Q,y,t){t.r(y),t.d(y,{default:function(){return N}});var e=t(20641),a=t(50953),d=t(34744),g=t(52666),n=t(51082),r=t(11619),p=t(4739),$=t(1334),b=(0,e.pM)({__name:"EmptyState",setup(P){const F=(0,$.S)(),O=(0,e.EW)(()=>!F.limitReached("dashboards")),x=(0,p.I)(),z=(0,g.t)(),R=(0,g.n)(),A=(0,a.KR)(!1);function L(){A.value=!0,x.create(z.params.wId).then(W=>{R.replace({name:"dashboards-dashboard",params:{dashboardId:W.data.id}}).then(async()=>{(0,r.S7)({id:"dashboards",type:"success",message:"Dashboard created successfully"})})}).catch(W=>{(0,r.S7)({id:"dashboards",type:"danger",message:`Failed to create dashboard: ${(0,r.zc)(W)}`})}).finally(()=>{A.value=!1})}return(W,M)=>((0,e.uX)(),(0,e.Wv)((0,a.R1)(n.Af),{src:["dashboards/empty-state.svg","dashboards/empty-state-dark.svg"],header:"All your customer feedback in one place"},{content:(0,e.k6)(()=>[...M[0]||(M[0]=[(0,e.eW)(" Create your first dashboard to visualize data from ",-1),(0,e.Lk)("br",null,null,-1),(0,e.eW)(" surveys and other feedback sources in one view ",-1)])]),button:(0,e.k6)(()=>[(0,e.bF)((0,a.R1)(n.uo),{"flag-check":O.value,"permission-message":"You have reached limit of dashboards on current plan.<br><strong>Upgrade</strong> your account to use it."},{default:(0,e.k6)(({isDisabled:T})=>[(0,e.bF)((0,a.R1)(n.eF),{class:"color-brand",icon:(0,a.R1)(d.A),"is-loading":A.value,disabled:T,onClick:L},{default:(0,e.k6)(()=>[...M[1]||(M[1]=[(0,e.eW)(" Create dashboard ",-1)])]),_:1},8,["icon","is-loading","disabled"])]),_:1},8,["flag-check"])]),_:1}))}}),N=b}),14493:(function(Q,y,t){t.d(y,{A:function(){return x}});
1var e=t(20641),a=t(90033),d=t(50953),g=t(52666),n=t(37248),r=t(51082),p=t(11619),$=t(35634),b=t(99040),_=(0,e.pM)({__name:"ModuleContent",setup(z){const R=(0,e.rk)("contentEl"),A=(0,e.rk)("footerEl"),L=(0,d.KR)(!1),W=(0,$.c)();(0,e.sV)(()=>{W.container=R.value,(0,b.wk)(A.value),L.value=!0,document.body.classList.add("has-module-content")});function M(){W.toggleSubNavigation()}function T(){R.value&&R.value.scrollTo({top:0})}function K(){R.value&&R.value.scrollTo({top:R.value.scrollHeight,behavior:"smooth"})}function C(i){R.value&&R.value.scrollBy(0,i)}p.l7.on("ModuleContent/scrollToTop",T),p.l7.on("ModuleContent/scrollToBottom",K),p.l7.on("ModuleContent/scrollBy",C),(0,e.xo)(()=>{p.l7.off("ModuleContent/scrollToTop",T),p.l7.off("ModuleContent/scrollToBottom",K),p.l7.off("ModuleContent/scrollBy",C),W.container=null,(0,b.rk)(A.value),document.body.classList.remove("has-module-content")});const D=(0,g.t)(),B=(0,e.EW)(()=>!!D.meta.hideModuleHeader),U=(0,e.EW)(()=>!!D.meta.navigationComponent);return(i,J)=>((0,e.uX)(),(0,e.CE)("div",{class:(0,a.C4)(["l-flex direction-column",i.$style.component])},[(0,e.Lk)("div",{class:(0,a.C4)(["l-flex direction-column grow",i.$style.wrapper])},[B.value?(0,e.Q3)("v-if",!0):((0,e.uX)(),(0,e.CE)("div",{key:0,id:"survicate-module-header",class:(0,a.C4)(["l-flex align-center flex-wrap",i.$style.header])},[(0,e.bF)((0,d.R1)(r.eF),{class:"type-icon s-small",icon:(0,d.R1)(n.A),disabled:!U.value,onClick:M},null,8,["icon","disabled"]),J[0]||(J[0]=(0,e.Lk)("div",{class:"header-separator air-right"},null,-1)),(0,e.RG)(i.$slots,"header")],2)),(0,e.Lk)("div",{id:"survicate-module-sub-header",class:(0,a.C4)(["l-flex align-center flex-wrap",i.$style["sub-header"]])},null,2),(0,e.Lk)("div",{id:"survicate-module-content",ref:"contentEl",class:(0,a.C4)(["grow relative",[i.$style.content,{"full-border-radius":B.value}]])},[L.value?(0,e.RG)(i.$slots,"default",{},void 0,void 0,0):(0,e.Q3)("v-if",!0)],2)],2),(0,e.Lk)("div",{id:"survicate-module-footer",ref:"footerEl",class:(0,a.C4)(["relative",i.$style.footer])},null,2)],2))}}),N={component:"ModuleContent_acf7bde734",wrapper:"ModuleContent_f5426014c2",header:"ModuleContent_c7f2063afd","sub-header":"ModuleContent_d2ca9ae2b8",content:"ModuleContent_dad692735e",footer:"ModuleContent_df864ddee4"},P=t(66262);const F={};F.$style=N;var x=(0,P.A)(_,[["__cssModules",F]])}),37248:(function(Q,y,t){var e=t(19104);const a=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],d=(0,e.A)("panel-left",a);t.d(y,["A",0,d])})}]);
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.