1import{a as te,d as se,r as Z,b as B,p as de,i as M,e as mt,u as P,f as Ge,g as ve,h as ee,j as G,k as ht,t as me,w as qe,l as O,o as i,c as x,m as c,n as l,q as ft,s as gt,v as Ye,x as _t,y as bt,E as W,z as ze,A as yt,B as Ce,C as vt,D as wt,F as xt,G as a,H as kt,I as he,J as R,K as v,L as Ke,M as t,O as Ct,P as ke,Q as D,R as It,S as St,T as He,_ as q,$ as U,U as f,V as m,W as We,X as Et,Y as F,Z as ie,a0 as H,a1 as Je,a2 as Dt,a3 as Ot,a4 as $e}from"./D1ce7ejF.js";import{E as Qe}from"./B0jMeB69.js";import{E as At,a as Tt}from"./Don6skoQ.js";import{E as Ie}from"./-YnkLpMw.js";import{c as Ze,E as re}from"./D1jnW7T7.js";import{_ as oe}from"./_jfF5CaT.js";import{E}from"./DJ3AwLYR.js";import{E as we}from"./BsTadKa3.js";import{_ as Se}from"./CgSlByxS.js";import{E as Xe,_ as Pt,a as Nt}from"./v1crY46V.js";import{v as ue}from"./q-4lAxfl.js";import{r as Rt}from"./B6Bz4lVA.js";import{r as et}from"./D08zemgN.js";import{c as X,u as Ut,a as Be,E as Ee,O as Lt,w as Fe}from"./Ct5AqAv4.js";import"./l0sNRNKZ.js";import{E as Me}from"./CaH8Xzrl.js";import{i as De,c as be,f as ce,s as Oe,a as ye}from"./CnXQnTpP.js";import{c as tt}from"./ztpOsgVE.js";import{r as $t}from"./BUwj3bUn.js";import{r as st}from"./Bqi-2WCb.js";import{r as Bt}from"./C7TCjRTp.js";import{E as Ft,a as Mt}from"./DzTwOsLd.js";/* empty css */import{E as Vt}from"./C17B76ix.js";import{E as jt}from"./BKVJe6y7.js";import{E as z}from"./BUADUvnR.js";import{u as Gt}from"./aeNTggsm.js";import{c as qt}from"./BHSfLCG9.js";import{F as Yt}from"./CEZLHgil.js";import{r as zt}from"./BMCpt_TI.js";import{E as Kt}from"./C_nc_rQC.js";import{E as Ht,a as Wt}from"./D9aTi7Rk.js";import{E as Jt,a as Qt}from"./BEgM7bgE.js";import{_ as Zt}from"./DI8542Cl.js";import{_ as Ae}from"./CL_hx29t.js";import"./Bp3YSIOJ.js";import"./Cq9Fpw4b.js";import"./s37hNq4d.js";import"./BB_Ol6Sd.js";import"./DreKaW0P.js";import"./CoxZJlod.js";import"./YwoHVwxi.js";import"./MIZLZu_p.js";import"./BGxbfjf5.js";import"./gG_AQL07.js";import"./By_25XIJ.js";const Xt=se({inheritAttrs:!1});function es(e,s,r,d,n,o){return Z(e.$slots,"default")}var ts=te(Xt,[["render",es],["__file","collection.vue"]]);const ss=se({name:"ElCollectionItem",inheritAttrs:!1});function os(e,s,r,d,n,o){return Z(e.$slots,"default")}var ns=te(ss,[["render",os],["__file","collection-item.vue"]]);const ot="data-el-collection-item",nt=e=>{const s=`El${e}Collection`,r=`${s}Item`,d=Symbol(s),n=Symbol(r),o={...ts,name:s,setup(){const _=B(null),b=new Map;de(d,{itemMap:b,getItems:()=>{const h=P(_);if(!h)return[];const g=Array.from(h.querySelectorAll(`[${ot}]`));return[...b.values()].sort((u,k)=>g.indexOf(u.ref)-g.indexOf(k.ref))},collectionRef:_})}},p={...ns,name:r,setup(_,{attrs:b}){const w=B(null),h=M(d,void 0);de(n,{collectionItemRef:w}),mt(()=>{const g=P(w);g&&h.itemMap.set(g,{ref:g,...b})}),Ge(()=>{const g=P(w);h.itemMap.delete(g)})}};return{COLLECTION_INJECTION_KEY:d,COLLECTION_ITEM_INJECTION_KEY:n,ElCollection:o,ElCollectionItem:p}},is=ve({style:{type:ee([String,Array,Object])},currentTabId:{type:ee(String)},defaultCurrentTabId:String,loop:Boolean,dir:{type:String,values:["ltr","rtl"],default:"ltr"},orientation:{type:ee(String)},onBlur:Function,onFocus:Function,onMousedown:Function}),{ElCollection:rs,ElCollectionItem:as,COLLECTION_INJECTION_KEY:Te,COLLECTION_ITEM_INJECTION_KEY:ls}=nt("RovingFocusGroup"),Pe=Symbol("elRovingFocusGroup"),it=Symbol("elRovingFocusGroupItem"),cs={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"},ds=(e,s)=>e,us=(e,s,r)=>{const d=ds(e.key);return cs[d]},ps=(e,s)=>e.map((r,d)=>e[(d+s)%e.length]),Ne=e=>{const{activeElement:s}=document;for(const r of e)if(r===s||(r.focus(),s!==document.activeElement))return},Ve="currentTabIdChange",je="rovingFocusGroup.entryFocus",ms={bubbles:!1,cancelable:!0},hs=se({name:"ElRovingFocusGroupImpl",inheritAttrs:!1,props:is,emits:[Ve,"entryFocus"],setup(e,{emit:s}){var r;const d=B((r=e.currentTabId||e.defaultCurrentTabId)!=null?r:null),n=B(!1),o=B(!1),p=B(null),{getItems:_}=M(Te,void 0),b=G(()=>[{outline:"none"},e.style]),w=I=>{s(Ve,I)},h=()=>{n.value=!0},g=X(I=>{var y;(y=e.onMousedown)==null||y.call(e,I)},()=>{o.value=!0}),C=X(I=>{var y;(y=e.onFocus)==null||y.call(e,I)},I=>{const y=!P(o),{target:T,currentTarget:N}=I;if(T===N&&y&&!P(n)){const K=new Event(je,ms);if(N==null||N.dispatchEvent(K),!K.defaultPrevented){const L=_().filter(j=>j.focusable),$=L.find(j=>j.active),V=L.find(j=>
1j.id===P(d)),J=[$,V,...L].filter(Boolean).map(j=>j.ref);Ne(J)}}o.value=!1}),u=X(I=>{var y;(y=e.onBlur)==null||y.call(e,I)},()=>{n.value=!1}),k=(...I)=>{s("entryFocus",...I)};de(Pe,{currentTabbedId:ht(d),loop:me(e,"loop"),tabIndex:G(()=>P(n)?-1:0),rovingFocusGroupRef:p,rovingFocusGroupRootStyle:b,orientation:me(e,"orientation"),dir:me(e,"dir"),onItemFocus:w,onItemShiftTab:h,onBlur:u,onFocus:C,onMousedown:g}),qe(()=>e.currentTabId,I=>{d.value=I??null}),Gt(p,je,k)}});function fs(e,s,r,d,n,o){return Z(e.$slots,"default")}var gs=te(hs,[["render",fs],["__file","roving-focus-group-impl.vue"]]);const _s=se({name:"ElRovingFocusGroup",components:{ElFocusGroupCollection:rs,ElRovingFocusGroupImpl:gs}});function bs(e,s,r,d,n,o){const p=O("el-roving-focus-group-impl"),_=O("el-focus-group-collection");return i(),x(_,null,{default:c(()=>[l(p,ft(gt(e.$attrs)),{default:c(()=>[Z(e.$slots,"default")]),_:3},16)]),_:3})}var ys=te(_s,[["render",bs],["__file","roving-focus-group.vue"]]);const vs=se({components:{ElRovingFocusCollectionItem:as},props:{focusable:{type:Boolean,default:!0},active:{type:Boolean,default:!1}},emits:["mousedown","focus","keydown"],setup(e,{emit:s}){const{currentTabbedId:r,loop:d,onItemFocus:n,onItemShiftTab:o}=M(Pe,void 0),{getItems:p}=M(Te,void 0),_=Ye(),b=B(null),w=X(u=>{s("mousedown",u)},u=>{e.focusable?n(P(_)):u.preventDefault()}),h=X(u=>{s("focus",u)},()=>{n(P(_))}),g=X(u=>{s("keydown",u)},u=>{const{key:k,shiftKey:I,target:y,currentTarget:T}=u;if(k===z.tab&&I){o();return}if(y!==T)return;const N=us(u);if(N){u.preventDefault();let L=p().filter($=>$.focusable).map($=>$.ref);switch(N){case"last":{L.reverse();break}case"prev":case"next":{N==="prev"&&L.reverse();const $=L.indexOf(T);L=d.value?ps(L,$+1):L.slice($+1);break}}_t(()=>{Ne(L)})}}),C=G(()=>r.value===P(_));return de(it,{rovingFocusGroupItemRef:b,tabIndex:G(()=>P(C)?0:-1),handleMousedown:w,handleFocus:h,handleKeydown:g}),{id:_,handleKeydown:g,handleFocus:h,handleMousedown:w}}});function ws(e,s,r,d,n,o){const p=O("el-roving-focus-collection-item");
1return i(),x(p,{id:e.id,focusable:e.focusable,active:e.active},{default:c(()=>[Z(e.$slots,"default")]),_:3},8,["id","focusable","active"])}var xs=te(vs,[["render",ws],["__file","roving-focus-item.vue"]]);const ks=ve({trigger:Ut.trigger,effect:{...Be.effect,default:"light"},type:{type:ee(String)},placement:{type:ee(String),default:"bottom"},popperOptions:{type:ee(Object),default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:ee([Number,String]),default:0},maxHeight:{type:ee([Number,String]),default:""},popperClass:{type:String,default:""},disabled:Boolean,role:{type:String,default:"menu"},buttonProps:{type:ee(Object)},teleported:Be.teleported}),rt=ve({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:bt}}),Cs=ve({onKeydown:{type:ee(Function)}}),Is=[z.down,z.pageDown,z.home],at=[z.up,z.pageUp,z.end],Ss=[...Is,...at],{ElCollection:Es,ElCollectionItem:Ds,COLLECTION_INJECTION_KEY:Os,COLLECTION_ITEM_INJECTION_KEY:As}=nt("Dropdown"),xe=Symbol("elDropdown"),{ButtonGroup:Ts}=W,Ps=se({name:"ElDropdown",components:{ElButton:W,ElButtonGroup:Ts,ElScrollbar:Vt,ElDropdownCollection:Es,ElTooltip:Ee,ElRovingFocusGroup:ys,ElOnlyChild:Lt,ElIcon:ze,ArrowDown:yt},props:ks,emits:["visible-change","click","command"],setup(e,{emit:s}){const r=Ke(),d=Ce("dropdown"),{t:n}=vt(),o=B(),p=B(),_=B(null),b=B(null),w=B(null),h=B(null),g=B(!1),C=[z.enter,z.space,z.down],u=G(()=>({maxHeight:wt(e.maxHeight)})),k=G(()=>[d.m($.value)]),I=G(()=>qt(e.trigger)),y=Ye().value,T=G(()=>e.id||y);qe([o,I],([S,Q],[le])=>{var Re,Ue,Le;(Re=le==null?void 0:le.$el)!=null&&Re.removeEventListener&&le.$el.removeEventListener("pointerenter",Y),(Ue=S==null?void 0:S.$el)!=null&&Ue.removeEventListener&&S.$el.removeEventListener("pointerenter",Y),(Le=S==null?void 0:S.$el)!=null&&Le.addEventListener&&Q.includes("hover")&&S.$el.addEventListener("pointerenter",Y)},{immediate:!0}),Ge(()=>{var S,Q;(Q=(S=o.value)==null?void 0:S.$el)!=null&&Q.removeEventListener&&o.value.$el.removeEventListener("pointerenter",Y)});function N(){K()}function K(){var S;(S=_.value)==null||S.onClose()}function L(){var S;(S=_.value)==null||S.onOpen()}const $=xt();function V(...S){s("command",...S)}function Y(){var S,Q;(Q=(S=o.value)==null?void 0:S.$el)==null||Q.focus()}function J(){}function j(){const S=P(b);I.value.includes("hover")&&(S==null||S.focus()),h.value=null}function fe(S){h.value=S}function ae(S){g.value||(S.preventDefault(),S.stopImmediatePropagation())}function ne(){s("visible-change",!0)}function ge(S){(S==null?void 0:S.type)==="keydown"&&b.value.focus()}function _e(){s("visible-change",!1)}return de(xe,{contentRef:b,role:G(()=>e.role),triggerId:T,isUsingKeyboard:g,onItemEnter:J,onItemLeave:j}),de("elDropdown",{instance:r,dropdownSize:$,handleClick:N,commandHandler:V,trigger:me(e,"trigger"),hideOnClick:me(e,"hideOnClick")}),{t:n,ns:d,scrollbar:w,wrapStyle:u,dropdownTriggerKls:k,dropdownSize:$,triggerId:T,triggerKeys:C,currentTabId:h,handleCurrentTabIdChange:fe,handlerMainButtonClick:S=>{s("click",S)},handleEntryFocus:ae,handleClose:K,handleOpen:L,handleBeforeShowTooltip:ne,handleShowTooltip:ge,handleBeforeHideTooltip:_e,onFocusAfterTrapped:S=>{var Q,le;S.preventDefault(),(le=(Q=b.value)==null?void 0:Q.focus)==null||le.call(Q,{preventScroll:!0})},popperRef:_,contentRef:b,triggeringElementRef:o,referenceElementRef:p}}});function Ns(e,s,r,d,n,o){var p;const _=O("el-dropdown-collection"),b=O("el-roving-focus-group"),w=O("el-scrollbar"),h=O("el-only-child"),g=O("el-tooltip"),C=O("el-button"),u=O("arrow-down"),k=O("el-icon"),I=O("el-button-group");return i(),a("div",{class:R([e.ns.b(),e.ns.is("disabled",e.disabled)])},[l(g,{ref:"popperRef",role:e.role,effect:e.effect,"fallback-placements":["bottom","top"],"popper-options":e.popperOptions,"gpu-acceleration":!1,"hide-after":e.trigger==="hover"?e.hideTimeout:0,"manual-mode":!0,placement:e.placement,"popper-class":[e.ns.e("popper"),e.popperClass],"reference-element":(p=e.referenceElementRef)==null?void 0:p.$el,trigger:e.trigger,"trigger-keys":e.triggerKeys,"trigger-target-el":e.contentRef,"show-after":e.trigger==="hover"?e.showTimeout:0,"stop-popper-mouse-event":!1,"virtual-ref":e.triggeringElementRef,"virtual-triggering":e.splitButton,disabled:e.disabled,transition:`${e.ns.namespace.value}-zoom-in-top`,teleported:e.teleported,pure:"",persistent:"",onBeforeShow:e.handleBeforeShowTooltip,onShow:e.handleShowTooltip,onBeforeHide:e.handleBeforeHideTooltip},kt({content:c(()=>[l(w,{ref:"scrollbar","wrap-style":e.wrapStyle,tag:"div","view-class":e.ns.e("list")},{default:c(()=>[l(b,{loop:e.loop,"current-tab-id":e.currentTabId,orientation:"horizontal",onCurrentTabIdC
1hange:e.handleCurrentTabIdChange,onEntryFocus:e.handleEntryFocus},{default:c(()=>[l(_,null,{default:c(()=>[Z(e.$slots,"dropdown")]),_:3})]),_:3},8,["loop","current-tab-id","onCurrentTabIdChange","onEntryFocus"])]),_:3},8,["wrap-style","view-class"])]),_:2},[e.splitButton?void 0:{name:"default",fn:c(()=>[l(h,{id:e.triggerId,ref:"triggeringElementRef",role:"button",tabindex:e.tabindex},{default:c(()=>[Z(e.$slots,"default")]),_:3},8,["id","tabindex"])])}]),1032,["role","effect","popper-options","hide-after","placement","popper-class","reference-element","trigger","trigger-keys","trigger-target-el","show-after","virtual-ref","virtual-triggering","disabled","transition","teleported","onBeforeShow","onShow","onBeforeHide"]),e.splitButton?(i(),x(I,{key:0},{default:c(()=>[l(C,he({ref:"referenceElementRef"},e.buttonProps,{size:e.dropdownSize,type:e.type,disabled:e.disabled,tabindex:e.tabindex,onClick:e.handlerMainButtonClick}),{default:c(()=>[Z(e.$slots,"default")]),_:3},16,["size","type","disabled","tabindex","onClick"]),l(C,he({id:e.triggerId,ref:"triggeringElementRef"},e.buttonProps,{role:"button",size:e.dropdownSize,type:e.type,class:e.ns.e("caret-button"),disabled:e.disabled,tabindex:e.tabindex,"aria-label":e.t("el.dropdown.toggleDropdown")}),{default:c(()=>[l(k,{class:R(e.ns.e("icon"))},{default:c(()=>[l(u)]),_:1},8,["class"])]),_:1},16,["id","size","type","class","disabled","tabindex","aria-label"])]),_:3})):v("v-if",!0)],2)}var Rs=te(Ps,[["render",Ns],["__file","dropdown.vue"]]);const Us=se({name:"DropdownItemImpl",components:{ElIcon:ze},props:rt,emits:["pointermove","pointerleave","click","clickimpl"],setup(e,{emit:s}){const r=Ce("dropdown"),{role:d}=M(xe,void 0),{collectionItemRef:n}=M(As,void 0),{collectionItemRef:o}=M(ls,void 0),{rovingFocusGroupItemRef:p,tabIndex:_,handleFocus:b,handleKeydown:w,handleMousedown:h}=M(it,void 0),g=Ze(n,o,p),C=G(()=>d.value==="menu"?"menuitem":d.value==="navigation"?"link":"button"),u=X(k=>{const{code:I}=k;if(I===z.enter||I===z.space)return k.preventDefault(),k.stopImmediatePropagation(),s("clickimpl",k),!0},w);return{ns:r,itemRef:g,dataset:{[ot]:""},role:C,tabIndex:_,handleFocus:b,handleKeydown:u,handleMousedown:h}}});function Ls(e,s,r,d,n,o){const p=O("el-icon");return i(),a(D,null,[e.divided?(i(),a("li",he({key:0,role:"separator",class:e.ns.bem("menu","item","divided")},e.$attrs),null,16)):v("v-if",!0),t("li",he({ref:e.itemRef},{...e.dataset,...e.$attrs},{"aria-disabled":e.disabled,class:[e.ns.be("menu","item"),e.ns.is("disabled",e.disabled)],tabindex:e.tabIndex,role:e.role,onClick:_=>e.$emit("clickimpl",_),onFocus:e.handleFocus,onKeydown:ke(e.handleKeydown,["self"]),onMousedown:e.handleMousedown,onPointermove:_=>e.$emit("pointermove",_),onPointerleave:_=>e.$emit("pointerleave",_)}
1),[e.icon?(i(),x(p,{key:0},{default:c(()=>[(i(),x(Ct(e.icon)))]),_:1})):v("v-if",!0),Z(e.$slots,"default")],16,["aria-disabled","tabindex","role","onClick","onFocus","onKeydown","onMousedown","onPointermove","onPointerleave"])],64)}var $s=te(Us,[["render",Ls],["__file","dropdown-item-impl.vue"]]);const lt=()=>{const e=M("elDropdown",{}),s=G(()=>e==null?void 0:e.dropdownSize);return{elDropdown:e,_elDropdownSize:s}},Bs=se({name:"ElDropdownItem",components:{ElDropdownCollectionItem:Ds,ElRovingFocusItem:xs,ElDropdownItemImpl:$s},inheritAttrs:!1,props:rt,emits:["pointermove","pointerleave","click"],setup(e,{emit:s,attrs:r}){const{elDropdown:d}=lt(),n=Ke(),o=B(null),p=G(()=>{var u,k;return(k=(u=P(o))==null?void 0:u.textContent)!=null?k:""}),{onItemEnter:_,onItemLeave:b}=M(xe,void 0),w=X(u=>(s("pointermove",u),u.defaultPrevented),Fe(u=>{if(e.disabled){b(u);return}const k=u.currentTarget;k===document.activeElement||k.contains(document.activeElement)||(_(u),u.defaultPrevented||k==null||k.focus())})),h=X(u=>(s("pointerleave",u),u.defaultPrevented),Fe(b)),g=X(u=>{if(!e.disabled)return s("click",u),u.type!=="keydown"&&u.defaultPrevented},u=>{var k,I,y;if(e.disabled){u.stopImmediatePropagation();return}(k=d==null?void 0:d.hideOnClick)!=null&&k.value&&((I=d.handleClick)==null||I.call(d)),(y=d.commandHandler)==null||y.call(d,e.command,n,u)}),C=G(()=>({...e,...r}));return{handleClick:g,handlePointerMove:w,handlePointerLeave:h,textContent:p,propsAndAttrs:C}}});function Fs(e,s,r,d,n,o){var p;const _=O("el-dropdown-item-impl"),b=O("el-roving-focus-item"),w=O("el-dropdown-collection-item");return i(),x(w,{disabled:e.disabled,"text-value":(p=e.textValue)!=null?p:e.textContent},{default:c(()=>[l(b,{focusable:!e.disabled},{default:c(()=>[l(_,he(e.propsAndAttrs,{onPointerleave:e.handlePointerLeave,onPointermove:e.handlePointerMove,onClickimpl:e.handleClick}),{default:c(()=>[Z(e.$slots,"default")]),_:3},16,["onPointerleave","onPointermove","onClickimpl"])]),_:3},8,["focusable"])]),_:3},8,["disabled","text-value"])}var ct=te(Bs,[["render",Fs],["__file","dropdown-item.vue"]]);const Ms=se({name:"ElDropdownMenu",props:Cs,setup(e){const s=Ce("dropdown"),{_elDropdownSize:r}=lt(),d=r.value,{focusTrapRef:n,onKeydown:o}=M(Yt,void 0),{contentRef:p,role:_,triggerId:b}=M(xe,void 0),{collectionRef:w,getItems:h}=M(Os,void 0),{rovingFocusGroupRef:g,rovingFocusGroupRootStyle:C,tabIndex:u,onBlur:k,onFocus:I,onMousedown:y}=M(Pe,void 0),{collectionRef:T}=M(Te,void 0),N=G(()=>[s.b("menu"),s.bm("menu",d==null?void 0:d.value)]),K=Ze(p,w,n,g,T),L=X(V=>{var Y;(Y=e.onKeydown)==null||Y.call(e,V)},V=>{const{currentTarget:Y,code:J,target:j}=V;if(Y.contains(j),z.tab===J&&V.stopImmediatePropagation(),V.preventDefault(),j!==P(p)||!Ss.includes(J))return;const ae=h().filter(ne=>!ne.disabled).map(ne=>ne.ref);at.includes(J)&&ae.reverse(),Ne(ae)});return{size:d,rovingFocusGroupRootStyle:C,tabIndex:u,dropdownKls:N,role:_,triggerId:b,dropdownListWrapperRef:K,handleKeydown:V=>{L(V),o(V)},onBlur:k,onFocus:I,onMousedown:y}}});function Vs(e,s,r,d,n,o){return i(),a("ul",{ref:e.dropdownListWrapperRef,class:R(e.dropdownKls),style:It(e.rovingFocusGroupRootStyle),tabindex:-1,role:e.role,"aria-labelledby":e.triggerId,onBlur:e.onBlur,onFocus:e.onFocus,onKeydown:ke(e.handleKeydown,["self"]),onMousedown:ke(e.onMousedown,["self"])},[Z(e.$slots,"default")],46,["role","aria-labelledby","onBlur","onFocus","onKeydown","onMousedown"])}var dt=te(Ms,[["render",Vs],["__file","dropdown-menu.vue"]]);const js=St(Rs,{DropdownItem:ct,DropdownMenu:dt}),Gs=He(ct),qs=He(dt),Ys={props:["email"],emits:["email-updated"],data(){return{displayEmail:this.email,isResending:!1,isUpdatingEmail:!1,showUpdateEmailDialog:!1,newEmail:"",updateEmailError:""}},watch:{email(e){this.displayEmail=e}},methods:{showEmailForm(){this.newEmail=this.displayEmail,this.updateEmailError="",this.showUpdateEmailDialog=!0},cancelUpdateEmail(){this.newEmail="",this.updateEmailError="",this.showUpdateEmailDialog=!1},getErrorMessage(e,s){const r=e==null?void 0:e.data;if(!r)return s;if(typeof r=="string")return r;if(r.message||r.msg||r.detail)return r.message||r.msg||r.detail;const d=Object.values(r).find(n=>n);
1return Array.isArray(d)?d[0]:typeof d=="string"?d:s},updateUnverifiedEmail(){const e=this.newEmail.trim();if(!e){this.updateEmailError="Please enter a new email address.";return}this.isUpdatingEmail||(this.isUpdatingEmail=!0,this.updateEmailError="",U(`${this.$config.public.API_URL}/auth/update-unverified-email/`,{credentials:"include",method:"POST",headers:{Accept:"application/json"},body:JSON.stringify({email:e})}).then(()=>{this.displayEmail=e,this.showUpdateEmailDialog=!1,this.newEmail="",E({title:"Success",message:"Your email has been updated. Please check your inbox for the new verification email.",type:"success"}),this.$emit("email-updated",e)}).catch(s=>{this.updateEmailError=this.getErrorMessage(s,"There was an error updating your email."),E({title:"Error",message:this.updateEmailError,type:"error"})}).finally(()=>{this.isUpdatingEmail=!1}))},resendVerifyEmail(){this.isResending||(this.isResending=!0,U(`${this.$config.public.API_URL}/auth/resend-verify-email/`,{credentials:"include",method:"POST",headers:{Accept:"application/json"},body:JSON.stringify({email:this.displayEmail})}).then(()=>{E({title:"Success",message:"Verification email has been resent. Please check your inbox. ð¬",type:"success"})}).catch(()=>{E({title:"Error",message:"There was an error resending the verification email.",type:"error"})}).finally(()=>{this.isResending=!1}))}}},zs={class:"rounded-2xl border border-amber-300 bg-amber-50 p-4"},Ks={class:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4"},Hs=t("div",{class:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-amber-100"},[t("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-amber-700",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8m-2 11H5a2 2 0 01-2-2V7a2 2 0 012-2h14a2 2 0 012 2v10a2 2 0 01-2 2z"})])],-1),Ws={class:"flex-1"},Js=t("h2",{class:"text-base font-semibold text-amber-900"},"Verify your email",-1),Qs={class:"mt-0.5 text-sm leading-6 text-amber-900/80"},Zs=t("b",null,"can't access data",-1),Xs={class:"flex shrink-0 items-center gap-3 sm:ml-auto"},eo=["disabled"],to=t("p",{class:"mb-4 text-sm leading-6 text-gray-600"}," Enter the email address you want to verify. We'll send a fresh verification email there. ",-1),so={key:0,class:"mt-2 text-sm text-red-600"};function oo(e,s,r,d,n,o){const p=Ie,_=W,b=re,w=oe;return i(),a("div",zs,[t("div",Ks,[Hs,t("div",Ws,[Js,t("p",Qs,[f(" We sent a verification link to "),t("b",null,m(n.displayEmail),1),f(". You "),Zs,f(" in Google Sheets or Excel until you verify your email. ")])]),t("div",Xs,[t("button",{type:"button",disabled:n.isResending,class:"rounded-lg border border-amber-400 bg-white px-3 py-1.5 text-sm font-medium text-amber-900 transition hover:bg-amber-100 disabled:cursor-not-allowed disabled:opacity-60",onClick:s[0]||(s[0]=(...h)=>o.resendVerifyEmail&&o.resendVerifyEmail(...h))},m(n.isResending?"Sending...":"Resend"),9,eo),t("button",{class:"cursor-pointer text-sm font-medium text-amber-900/80 underline hover:text-amber-900",onClick:s[1]||(s[1]=(...h)=>o.showEmailForm&&o.showEmailForm(...h))}," Wrong email? ")])]),l(w,null,{default:c(()=>[l(b,{modelValue:n.showUpdateEmailDialog,"onUpdate:modelValue":s[3]||(s[3]=h=>n.showUpdateEmailDialog=h),title:"Update email address",width:"420px"},{footer:c(()=>[l(_,{disabled:n.isUpdatingEmail,onClick:o.cancelUpdateEmail},{default:c(()=>[f(" Cancel ")]),_:1},8,["disabled","onClick"]),l(_,{type:"primary",loading:n.isUpdatingEmail,disabled:n.isUpdatingEmail,onClick:o.updateUnverifiedEmail},{default:c(()=>[f(" Update email ")]),_:1},8,["loading","disabled","onClick"])]),default:c(()=>[to,l(p,{modelValue:n.newEmail,"onUpdate:modelValue":s[2]||(s[2]=h=>
1n.newEmail=h),type:"email",size:"large",placeholder:"New email address",onKeyup:We(o.updateUnverifiedEmail,["enter"])},null,8,["modelValue","onKeyup"]),n.updateEmailError?(i(),a("p",so,m(n.updateEmailError),1)):v("",!0)]),_:1},8,["modelValue"])]),_:1})])}const no=q(Ys,[["render",oo]]);function io(e,s){return i(),a("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 14.15v4.25c0 1.094-.787 2.036-1.872 2.18-2.087.277-4.216.42-6.378.42s-4.291-.143-6.378-.42c-1.085-.144-1.872-1.086-1.872-2.18v-4.25m16.5 0a2.18 2.18 0 00.75-1.661V8.706c0-1.081-.768-2.015-1.837-2.175a48.114 48.114 0 00-3.413-.387m4.5 8.006c-.194.165-.42.295-.673.38A23.978 23.978 0 0112 15.75c-2.648 0-5.195-.429-7.577-1.22a2.016 2.016 0 01-.673-.38m0 0A2.18 2.18 0 013 12.489V8.706c0-1.081.768-2.015 1.837-2.175a48.111 48.111 0 013.413-.387m7.5 0V5.25A2.25 2.25 0 0013.5 3h-3a2.25 2.25 0 00-2.25 2.25v.894m7.5 0a48.667 48.667 0 00-7.5 0M12 12.75h.008v.008H12v-.008z"})])}function ro(e,s){return i(),a("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 01-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 011.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 00-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 01-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 00-3.375-3.375h-1.5a1.125 1.125 0 01-1.125-1.125v-1.5a3.375 3.375 0 00-3.375-3.375H9.75"})])}function ao(e,s){return i(),a("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z"})])}function lo(e,s){return i(),a("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v6m3-3H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"})])}const co={components:{BriefcaseIcon:io,GiftIcon:Rt,CheckIcon:et,Checkout:Se},props:{visible:Boolean,mobile:Boolean,profileEmail:String,profile:Object},emits:["access-ready","subscription-updated"],data(){return{offers:[],selected:null,drawer:!1,loading:!1,claiming:!1,error:"",requestVersion:0,readyCodes:[],emptyStripeObject:{stripe:null,elements:null,showStripeForm:!1}}},computed:{isSubscriptionUpgrade(){var e,s;return((e=this.selected)==null?void 0:e.fulfillment_type)==="subscription_upgrade"||((s=this.offers.find(r=>r.code===this.routeCode))==null?void 0:s.fulfillment_type)==="subscription_upgrade"},profileEmailValue(){var e;return this.profileEmail||((e=this.profile)==null?void 0:e.email)||""},targetPlan(){var e;return((e=this.selected)==null?void 0:e.target_product)||null},currentSubscriptionItem(){var e,s,r;return((r=(s=(e=this.profile)==null?void 0:e.subscription)==null?void 0:s.items)==null?void 0:r.find(d=>{var n,o;return((n=d.product)==null?void 0:n.group)===((o=this.selected)==null?void 0:o.product_group)&&["active","past_due","trialing"].includes(d.status)}))||null},subscriptionUpgradeCheckoutReady(){var e,s;return["assigned","processing"].includes((e=this.selected)==null?void 0:e.status)&&!!this.targetPlan&&!!((s=this.profile)!=null&&s.subscription)},trialEnded(){var e;return((e=this.selected)==null?void 0:e.trial_ends)&&new Date(this.selected.trial_ends)<=new Date},routeCode(){return typeof this.$route.query.offer=="string"?this.$route.query.offer:""}},watch:{routeCode(e){this.openFromRoute(e)}},mounted(){this.loadOffers(),this.openFromRoute(this.routeCode)},beforeUnmount(){this.requestVersion++},methods:{formatDate(e){return new Date(e).toLocaleString(void 0,{dateStyle:"long",timeStyle:"short"})},async loadOffers(){try{const e=await U(`${this.$config.public.API_URL}
1/users/offers/`,{headers:{Accept:"application/json"}});this.offers=e.offers.filter(this.shouldShowInDashboard)}catch{this.offers=[]}},shouldShowInDashboard(e){return e.fulfillment_type==="subscription_upgrade"?["assigned","processing","unavailable"].includes(e.status):["assigned","needs_retry"].includes(e.status)},dashboardMessage(e){return e.fulfillment_type!=="subscription_upgrade"?e.status==="needs_retry"?"Please retry activation to finish setting up your access.":e.description:e.status==="processing"?"Your plan change is processing. Review its status.":e.status==="unavailable"?"This account needs attention. Review the details or contact support.":"Your account appears to be used commercially. Review the move to Pro, or contact support if this does not apply."},openCommercialUseSupport(e=this.selected){if((e==null?void 0:e.fulfillment_type)!=="subscription_upgrade"&&!this.isSubscriptionUpgrade)return;const s=Et().openSupportContact();this.drawer=!1,s||this.$router.push("/support/contact")},openOffer(e){this.$router.replace({query:{...this.$route.query,offer:e}}),e===this.routeCode&&this.openFromRoute(e)},openFromRoute(e){if(this.requestVersion++,!e||e==="legacy-options-50"){this.drawer=!1;return}this.selected=null,this.error="",this.drawer=!0,this.refreshSelected()},closeOffer(){if(this.requestVersion++,this.routeCode&&this.routeCode!=="legacy-options-50"){const{offer:e,...s}=this.$route.query;this.$router.replace({query:s})}},applyOffer(e){if(this.selected=e,this.shouldShowInDashboard(e)){const s=this.offers.some(r=>r.code===e.code);this.offers=s?this.offers.map(r=>r.code===e.code?e:r):[...this.offers,e]}else this.offers=this.offers.filter(s=>s.code!==e.code);e.access_ready_at&&!this.readyCodes.includes(e.code)&&(this.readyCodes.push(e.code),this.$emit("access-ready"))},async refreshSelected(){var r;const e=this.routeCode;if(!e||e==="legacy-options-50")return;const s=++this.requestVersion;this.loading=!0,this.error="";try{const d=await U(`${this.$config.public.API_URL}/users/offers/${encodeURIComponent(e)}/`,{headers:{Accept:"application/json"}});s===this.requestVersion&&this.applyOffer(d)}catch(d){s===this.requestVersion&&(this.error=((r=d==null?void 0:d.data)==null?void 0:r.msg)||"We couldnât check your offer. Please try again.")}finally{s===this.requestVersion&&(this.loading=!1)}},async activate(){var s,r,d,n;if(this.claiming||!((s=this.selected)!=null&&s.can_claim))return;const e=++this.requestVersion;this.claiming=!0,this.error="";try{const o=await U(`${this.$config.public.API_URL}/users/offers/${encodeURIComponent(this.selected.code)}/claim/`,{method:"POST",headers:{Accept:"application/json"}});e===this.requestVersion&&(this.applyOffer(o),this.loadOffers())}catch(o){if(e!==this.requestVersion)return;(r=o==null?void 0:o.data)!=null&&r.code&&o.data.status&&this.applyOffer(o.data),this.error=((d=o==null?void 0:o.data)==null?void 0:d.reason)||((n=o==null?void 0:o.data)==null?void 0:n.msg)||"We couldnât confirm activation. Check the offer status or safely retry; your trial will only be activated once."}finally{this.claiming=!1}},handleUpgradeSuccess(){this.drawer=!1,this.$emit("subscription-updated")}}},uo={key:0,class:"mb-6 space-y-3"},po={class:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4"},mo={class:"min-w-0 flex-1"},ho={class:"text-base font-semibold text-sf-dark"},fo={key:0,class:"mt-0.5 text-sm leading-6 text-slate-600"},go=["onClick"],_o={key:1,class:"mt-0.5 text-sm leading-6 text-slate-600"},bo=["id"],yo={class:"space-y-6 text-sm leading-6 text-slate-600"},vo={class:"flex items-center gap-4 py-2"},wo={class:"min-w-0 flex-1"},xo={class:"text-2xl font-semibold leading-tight tracking-tight text-slate-900"},ko={class:"mt-3"},Co={key:0,class:"mt-3 font-medium text-slate-900"},Io={key:1,class:"mt-3"},So={key:2,class:"rounded-xl border border-sf-green/20 bg-sf-green/5 px-4 py-3"},Eo=t("p",{class:"font-medium text-slate-900"},"Plan aligned",-1),Do=t("p",null,"Your existing SheetsFinance connections and formulas remain unchanged.",-1),Oo=[Eo,Do],Ao={class:"mb-5 flex h-14 w-14 items-center justify-center rounded-2xl bg-sf-green/10"},To={class:"mb-2 text-xs font-semibold uppercase tracking-wider text-sf-green"},Po={class:"text-2xl font-semibold leading-tight tracking-tight text-slate-900"},No={key:0,class:"mt-3"},Ro={key:0,class:"space-y-5 rounded-2xl border border-slate-200 bg-slate-50 p-5"},Uo={class:"flex gap-3"},Lo=t("div",null,[t("p",{class:"font-semibold text-slate-900"},"Full Analyst-level Market Data"),t("p",{class:"mt-1"},"All the features. The only trial limit is 1,000 calls per day.")],-1),$o={class:"flex gap-3"},Bo={class:"font-semibold text-slate-900"},Fo=t("p",{class:"mt-1"},"Keep your existing spreadsheet connections.",-1),Mo={class:"flex gap-3"},Vo=t("div",null,[t("p",{class:"font-semibold text-slate-900"},"No card details. No automatic charges."),t("p",{class:"mt-1"},"Access ends after the trial unless you choose to upgrade.")],-1),jo={key:0},Go={key:1,class:"rounded-xl border border-sf-green/20 bg-sf-green/5 px-4 py-3"},qo={class:"font-medium text-slate-900"},Yo={key:2,class:"space-y-3"},zo=t("h3",{class:"font-semibold text-slate-900"},"Ready to use it in your spreadsheet?",-1),Ko=t("p",null,[f("Open your SheetsFinance account in Google Sheets or Excel to check your new trial is active. If itâs already open, select "),t("strong",{class:"font-medium text-slate-900"},"Sync Account"),f(", then recalculate your formulas.")],-1),Ho=t("p",null,"Your existing Connection ID stays the same.",-1),Wo=t("p",{class:"text-xs leading-5 text-slate-500"},"If formulas still show expired access, allow up to two minutes and recalculate again.",-1),Jo=[zo,Ko,Ho,Wo],Qo={class:"mb-3 break-words text-center text-xs text-slate-500"},Zo={class:"font-medium text-slate-700"};function Xo(e,s,r,d,n,o){const p=O("BriefcaseIcon"),_=O("GiftIcon"),b=W,w=O("CheckIcon"),h=we,g=Se,C=Je,u=Xe,k=oe,I=ue;return i(),a(D,null,[n.offers.length?F((i(),a("section",uo,[(i(!0),a(D,null,H(n.offers,y=>(i(),a("div",{key:y.code,class:R(["rounded-2xl border p-4",y.fulfillment_type==="subscription_upgrade"?"border-amber-300 bg-amber-50":"border-sf-green/30 bg-sf-green/5"])},[t("div",po,[t("div",{class:R(["flex h-10 w-10 shrink-0 items-center justify-center rounded-full",y.fulfillment_type==="subscription_upgrade"?"bg-amber-100":"bg-sf-green/10"])},[y.fulfillment_type==="subscription_upgrade"?(i(),x(p,{key:0,class:"h-5 w-5 text-amber-700","aria-hidden":"true"})):(i(),x(_,{key:1,class:"h-5 w-5 text-sf-green","aria-hidden":"true"}))],2),t("div",mo,[t("h2",ho,m(y.fulfillment_type==="subscription_upgrade"?"Commercial use requires a Pro plan":y.title),1),y.fulfillment_type==="subscription_upgrade"?(i(),a("p",fo,[y.status==="processing"?(i(),a(D,{key:0},[f("Your plan change is processing. Review its status or ")],64)):y.status==="unavailable"?(i(),a(D,{key:1},[f("This account needs attention. Review the details or ")],64)):(i(),a(D,{key:2},[f("Your account appears to be used commercially. Review the move to Pro, or ")],64)),t("button",{type:"button",class:"font-medium text-amber-800 underline",onClick:T=>o.openCommercialUseSupport(y)},"contact support",8,go),y.status==="assigned"?(i(),a(D,{key:3},[f(" if this does not apply")],64)):v("",!0),f(". ")])):(i(),a("p",_o,m(o.dashboardMessage(y)),1))]),l(b,{class:R(["self-start sm:self-auto",y.fulfillment_type==="subscription_upgrade"?"!border-amber-300 !bg-amber-100 !text-amber-900 hover:!border-amber-400 hover:!bg-amber-200":""]),type:y.fulfillment_type==="subscription_upgrade"?"":"primary",onClick:T=>o.openOffer(y.code)},{default:c(()=>[f(m(y.fulfillment_type==="subscription_upgrade"?"Review Pro upgrade â":"View offer"),1)]),_:2},1032,["class","type","onClick"])])],2))),128))],512)),[[ie,r.visible]]):v("",!0),l(k,null,{default:c(()=>[l(u,{modelValue:n.drawer,"onUpdate:modelValue":s[4]||(s[4]=y=>n.drawer=y),class:"account-offer-drawer",size:r.mobile?"100%":"520px",onClosed:o.closeOffer},{header:c(({titleId:y})=>[t("span",{id:y,class:"text-sm font-semibold text-slate-600"},m(o.isSubscriptionUpgrade?"Account action required":"Your account offer"),9,bo)]),footer:c(()=>{var y,T;return[o.isSubscriptionUpgrade?o.subscriptionUpgradeCheckoutReady?v("",!0):(i(),x(b,{key:1,class:"w-full !h-11 !rounded-xl",onClick:s[3]||(s[3]=N=>n.drawer=!1)},{default:c(()=>[f("Close")]),_:1})):(i(),a(D,{key:0},[t("p",Qo,[f("For "),t("span",Zo,m(o.profileEmailValue),1)]),((y=n.selected)==null?void 0:y.status)==="assigned"||((T=n.selected)==null?void 0:T.status)==="needs_retry"?(i(),x(b,{key:0,class:"w-full !h-12 !rou
1nded-xl !text-base !font-semibold",type:"primary",loading:n.claiming,disabled:!n.selected.can_claim,onClick:o.activate},{default:c(()=>[f(m(n.selected.status==="needs_retry"?"Retry activation":`Activate ${n.selected.trial_days} free days`),1)]),_:1},8,["loading","disabled","onClick"])):(i(),x(b,{key:1,class:"w-full !h-11 !rounded-xl",onClick:s[2]||(s[2]=N=>n.drawer=!1)},{default:c(()=>{var N;return[f(m(((N=n.selected)==null?void 0:N.status)==="claimed"?"Done":"Close"),1)]}),_:1}))],64))]}),default:c(()=>{var y,T;return[F((i(),a("div",yo,[n.selected?(i(),a(D,{key:0},[o.isSubscriptionUpgrade?(i(),a(D,{key:0},[t("div",null,[t("div",vo,[t("div",{class:R(["flex h-12 w-12 shrink-0 items-center justify-center rounded-xl",n.selected.status==="claimed"?"bg-sf-green/10":"bg-amber-100"])},[n.selected.status==="claimed"?(i(),x(w,{key:0,class:"h-6 w-6 text-sf-green","aria-hidden":"true"})):(i(),x(p,{key:1,class:"h-6 w-6 text-amber-700","aria-hidden":"true"}))],2),t("div",wo,[t("p",{class:R(["mb-1 text-xs font-semibold uppercase tracking-wider",n.selected.status==="claimed"?"text-sf-green":"text-amber-700"])},m(n.selected.status==="claimed"?"Market Data · Pro":"Market Data · Plan review"),3),t("h2",xo,m(n.selected.status==="claimed"?"Your account is now aligned":"Commercial use requires a Pro plan"),1)])]),t("p",ko,m(n.selected.description),1),n.selected.expires_at&&n.selected.status!=="claimed"?(i(),a("p",Co," Please complete this change by "+m(o.formatDate(n.selected.expires_at))+". ",1)):v("",!0),["assigned","processing"].includes(n.selected.status)?(i(),a("p",Io,[f(" If you believe your use is personal, "),t("button",{type:"button",class:"font-medium text-amber-800 underline",onClick:s[0]||(s[0]=(...N)=>o.openCommercialUseSupport&&o.openCommercialUseSupport(...N))},"contact support"),f(" or reply to the email we sent you before completing this upgrade. ")])):v("",!0)]),n.selected.status==="processing"?(i(),x(h,{key:0,title:"Your plan change is processing",description:"You can safely retry below if the previous attempt did not finish. You will not be upgraded twice.",type:"warning",closable:!1})):v("",!0),o.subscriptionUpgradeCheckoutReady?(i(),x(g,{key:1,currentSubscriptionItem:o.currentSubscriptionItem,currentSubscription:r.profile.subscription,allSubscriptions:r.profile.subscription.items||[],selectedPlan:o.targetPlan,initialStripeObject:n.emptyStripeObject,initialSubscriptionId:r.profile.subscription.subscription_id,license:"business",frequency:o.targetPlan.frequency,isSubscriptionUpdate:!0,upgradeDowngrade:"UPGRADE",productGroup:n.selected.product_group,isMobile:r.mobile,emailVerified:r.profile.email_verified,accountOfferCode:n.selected.code,onSuccess:o.handleUpgradeSuccess,onSupport:o.openCommercialUseSupport},null,8,["currentSubscriptionItem","currentSubscription","allSubscriptions","selectedPlan","initialStripeObject","initialSubscriptionId","frequency","productGroup","isMobile","emailVerified","accountOfferCode","onSuccess","onSupport"])):n.selected.status==="claimed"?(i(),a("div",So,Oo)):(i(),x(h,{key:3,title:n.selected.reason||"This account requires attention.",type:"warning",closable:!1},null,8,["title"]))],64)):(i(),a(D,{key:1},[t("div",null,[t("div",Ao,[n.selected.access_ready_at&&!o.trialEnded?(i(),x(w,{key:0,class:"h-7 w-7 text-sf-green","aria-hidden":"true"})):(i(),x(_,{key:1,class:"h-7 w-7 text-sf-green","aria-hidden":"true"}))]),t("p",To,"Market Data · "+m(n.selected.trial_days)+" days free",1),t("h2",Po,m(n.selected.access_ready_at&&!o.trialEnded?`Your ${n.selected.trial_days}-day trial is active`:n.selected.title),1),n.selected.status==="assigned"?(i(),a("p",No,"Pick up where you left off in Google Sheets or Excel.")):v("",!0)]),n.selected.status==="assigned"?(i(),a("ul",Ro,[t("li",Uo,[l(w,{class:"mt-0.5 h-5 w-5 shrink-0 text-sf-green","aria-hidden":"true"}),Lo]),t("li",$o,[l(w,{class:"mt-0.5 h-5 w-5 shrink-0 text-sf-green","aria-hidden":"true"}),t("div",null,[t("p",Bo,m(n.selected.trial_days)+" days, starting when you activate",1),Fo])]),t("li",Mo,[l(w,{class:"mt-0.5 h-5 w-5 shrink-0 text-sf-green","aria-hidden":"true"}),Vo])])):n.selected.status==="needs_retry"?(i(),x(h,{key:1,title:"Please retry activation",description:"Your trial has been saved, but we couldnât finish updating your access. Retrying is safe and wonât start a second trial.",type:"warning",closable:!1})):n.selected.status==="claimed"?(i(),a(D,{key:2},[!n.selected.access_ready_at||o.trialEnded?(i(),a("p",jo,"You have already activated this offer.")):v("",!0),n.selected.trial_ends?(i(),a("div",Go,[t("p",qo,m(o.trialEnded?"Your trial ended":"Enjoy your access until"),1),t("p",null,m(o.formatDate(n.selected.trial_ends)),1)])):v("",!0),n.selected.access_ready_at&&!o.trialEnded?(i(),a("div",Yo,Jo)):v("",!0)],64)):(i(),x(h,{key:3,title:n.selected.reason||"This offer is unavailable.",type:"info",closable:!1},null,8,["title"]))],64))],64)):v("",!0),n.error?(i(),x(h,{key:1,title:n.error,type:"warning",closable:!1},null,8,["title"])):v("",!0),n.error?(i(),x(b,{key:2,loading:n.loading,onClick:o.refreshSelected},{default:c(()=>[f("Check offer status")]),_:1},8,["loading","onClick"])):v("",!0),o.isSubscriptionUpgrade&&(n.error||((y=n.selected)==null?void 0:y.status)==="unavailable")?(i(),a("button",{key:3,type:"button",class:"block text-sf-green underline",onClick:s[1]||(s[1]=(...N)=>o.openCommercialUseSupport&&o.openCommercialUseSupport(...N))},"Contact support")):n.error||((T=n.selected)==null?void 0:T.status)==="unavailable"?(i(),x(C,{key:4,to:"/support/contact",class:"block text-sf-green underline"},{default:c(()=>[f("Contact support")]),_:1})):v("",!0)])),[[I,n.loading]])]}),_:1},8,["modelValue","size","onClosed"])]),_:1})],64)}const en=q(co,[["render",Xo]]),tn={props:{usage:{type:Object,default:null},loading:{type:Boolean,default:!1}},emits:["refresh","view-usage"],data(){return{dismissed:!1}},computed:{alert(){var _,b;const e=(Array.isArray((_=this.usage)==null?void 0:_.buckets)?this.usage.buckets:[]).filter(w=>!w.unlimited&&Number(w.percentage)>=80).sort((w,h)=>Number(h.percentage)-Number(w.percentage));if(!e.length)return null;const s=e.filter(w=>Number(w.percentage)>=100),r=s.length>0,d=s[0]||e[0],n=r?s.length===1?`${this.bucketLabel(d)} daily limit reached`:`${s.length} daily limits reached`:e.length===1?`${this.bucketLabel(d)} usage: ${d.percentage}%`:`${e.length} usage limits above 80%`;let o;!r&&e.length===1?o=`${this.formatNumber(d.remaining)} requests remaining`:r&&e.length===1?o=`${d.percentage}% used`:o=e.map(w=>`${this.bucketLabel(w)} ${w.percentage}%`).join(" · "),(b=this.usage)!=null&&b.resets_at&&(o+=` · ${this.formatReset(this.usage.resets_at)}`);const p=[...new Set((r?s:[d]).flatMap(w=>w.product_groups||[]))];return{limitReached:r,productGroup:p.length===1?p[0]:null,tier:d.tier,title:n,summary:o}},pricingPath(){var e;return(e=this.alert)!=null&&e.productGroup&&this.alert.productGroup!=="data"?`/pricing/${this.alert.productGroup}`:"/pricing"},planActionLabel(){var e;return["trial","basic","investor","analyst","pro"].includes((e=this.alert)==null?void 0:e.tier)?"Upgrade plan":"View plan"}},watch:{usage(){this.dismissed=!1}},mounted(){!this.usage&&!this.loading&&this.$emit("refresh")},methods:{capitalise(e){const s=String(e||"");return s?s.charAt(0).toUpperCase()+s.slice(1):""},bucketLabel(e){const s={data:"Market Data",brokerage:"Brokerage",options:"Options"};return(e.product_groups||[]).map(r=>s[r]||this.capitalise(r)).join(" & ")}
1,formatNumber(e){return Number(e||0).toLocaleString()},formatReset(e){const s=new Date(e);return Number.isNaN(s.getTime())?"":`Resets ${s.toLocaleString(void 0,{weekday:"short",hour:"numeric",minute:"2-digit",timeZoneName:"short"})}`}}},sn={class:"flex min-w-0 flex-1 flex-col gap-1 sm:flex-row sm:items-center sm:gap-2"},on={class:"shrink-0 text-sm font-semibold"},nn={class:"min-w-0 text-xs opacity-75"},rn={class:"flex shrink-0 flex-wrap items-center gap-3 text-xs font-semibold sm:ml-auto"};function an(e,s,r,d,n,o){const p=Je;return o.alert&&(!n.dismissed||o.alert.limitReached)?(i(),a("div",{key:0,class:R(["flex items-center gap-2 rounded-lg border px-3 py-2",o.alert.limitReached?"border-red-200 bg-red-50 text-red-950":"border-amber-200 bg-amber-50 text-amber-950"]),role:"alert"},[t("div",{class:R(["flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-xs font-bold text-white",o.alert.limitReached?"bg-red-500":"bg-amber-500"]),"aria-hidden":"true"}," ! ",2),t("div",sn,[t("div",on,m(o.alert.title),1),t("div",nn,m(o.alert.summary),1),t("div",rn,[o.alert.limitReached?(i(),x(p,{key:0,to:o.pricingPath,class:"hover:underline"},{default:c(()=>[f(m(o.planActionLabel),1)]),_:1},8,["to"])):v("",!0),t("button",{type:"button",class:"hover:underline",onClick:s[0]||(s[0]=_=>e.$emit("view-usage"))}," View usage ")])]),o.alert.limitReached?v("",!0):(i(),a("button",{key:0,type:"button",class:"shrink-0 px-0.5 text-base leading-none opacity-50 hover:opacity-100","aria-label":"Dismiss usage warning",onClick:s[1]||(s[1]=_=>n.dismissed=!0)}," à "))],2)):v("",!0)}const ut=q(tn,[["render",an]]);function ln(e,s){return i(),a("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[t("path",{"fill-rule":"evenodd",d:"M15.312 11.424a5.5 5.5 0 01-9.201 2.466l-.312-.311h2.433a.75.75 0 000-1.5H3.989a.75.75 0 00-.75.75v4.242a.75.75 0 001.5 0v-2.43l.31.31a7 7 0 0011.712-3.138.75.75 0 00-1.449-.39zm1.23-3.723a.75.75 0 00.219-.53V2.929a.75.75 0 00-1.5 0V5.36l-.31-.31A7 7 0 003.239 8.188a.75.75 0 101.448.389A5.5 5.5 0 0113.89 6.11l.311.31h-2.432a.75.75 0 000 1.5h4.243a.75.75 0 00.53-.219z","clip-rule":"evenodd"})])}function cn(e,s){return i(),a("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[t("path",{"fill-rule":"evenodd",d:"M15.988 3.012A2.25 2.25 0 0118 5.25v6.5A2.25 2.25 0 0115.75 14H13.5v-3.379a3 3 0 00-.879-2.121l-3.12-3.121a3 3 0 00-1.402-.791 2.252 2.252 0 011.913-1.576A2.25 2.25 0 0112.25 1h1.5a2.25 2.25 0 012.238 2.012zM11.5 3.25a.75.75 0 01.75-.75h1.5a.75.75 0 01.75.75v.25h-3v-.25z","clip-rule":"evenodd"}),t("path",{d:"M3.5 6A1.5 1.5 0 002 7.5v9A1.5 1.5 0 003.5 18h7a1.5 1.5 0 001.5-1.5v-5.879a1.5 1.5 0 00-.44-1.06L8.44 6.439A1.5 1.5 0 007.378 6H3.5z"})])}function dn(e,s){return i(),a("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[t("path",{d:"M10 3a1.5 1.5 0 110 3 1.5 1.5 0 010-3zM10 8.5a1.5 1.5 0 110 3 1.5 1.5 0 010-3zM11.5 15.5a1.5 1.5 0 10-3 0 1.5 1.5 0 003 0z"})])}function un(e,s){return i(),a("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[t("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z","clip-rule":"evenodd"})])}const pn={props:{connections:{type:Array,default:()=>[]}},emits:["refresh-connection-id"],components:{ArrowPathIcon:ln,ClipboardDocumentIcon:cn,InformationCircleIcon:un},data(){return{pendingConnection:null,showRotateDialog:!1}},computed:{isMobileD(){return De()},rotateWarning(){return this.pendingConnection?this.pendingConnection.platform_email?`This will disconnect ${this.pendingConnection.platform_email}. The old ID will stop working and a replacement will be generated.`:`The old ID will stop working in ${this.platformName(this.pendingConnection.platform)} and a replacement will be generated.`:""}},methods:{platformName(e){return{google_sheets:"Google Sheets",excel:"Excel"}[e]||String(e||"Connection").split("_").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")},platformLogo(e){return e==="google_sheets"?"/img/google-sheets-logo.png":e==="excel"?"https://res.cdn.office.net/files/fabric-cdn-prod_20251117.001/assets/brand-icons/product/svg/excel_16x1.svg":"/img/logo_png.png"},accountLabel(e){return e.platform_email?e.platform_email:e.platform==="excel"?e.excel_client_id||"Not connected yet":"No Google account yet"},accountLabelClasses(e){return e.excel_client_id?"font-mono text-gray-700":e.platform_email?"text-gray-700":"italic text-gray-400"},statusLabel(e){return e.active?e.platform==="excel"?e.excel_client_id?"Connected":"Ready to use":e.platform_email?"Connected":"Ready to use":"Inactive"},statusClasses(e){return e.active?e.platform==="excel"?e.excel_client_id?"bg-emerald-50 text-emerald-700 ring-emerald-600/20":"bg-gray-100 text-gray-600 ring-gray-500/10":e.platform_email?"bg-green-50 text-green-700 ring-green-600/20":"bg-gray-100 text-gray-600 ring-gray-500/10":"bg-red-50 text-red-700 ring-red-600/20"},maskedConnectionId(e){return`â¢â¢â¢â¢ ${e.slice(-4).toUpperCase()}`},async copyToClipboard(e){try{await navigator.clipboard.writeText(e),Me.success("Connection ID copied to clipboard")}catch{Me.error("Unable to copy the Connection ID")}},openRotateDialog(e){this.pendingConnection=e,this.showRotateDialog=!0},confirmRotation(){this.pendingConnection&&(this.$emit("refresh-connection-id",this.pendingConnection.connection_id),this.showRotateDialog=!1)}}},mn={class:"overflow-hidden rounded-xl border border-gray-200 bg-white"},hn={class:"hidden overflow-x-auto lg:block"},fn={class:"w-full min-w-[660px] table-fixed"},gn=t("caption",{class:"sr-only"}," Spreadsheet connection IDs and the latest accounts using them ",-1),_n=t("thead",{class:"bg-gray-50 text-left"},[t("tr",null,[t("th",{scope:"col",class:"w-[21%] px-4 py-3 text-xs font-semibold uppercase tracking-wide text-gray-500"}," Platform "),t("th",{scope:"col",class:"w-[28%] px-4 py-3 text-xs font-semibold uppercase tracking-wide text-gray-500"}," Account / client "),t("th",{scope:"col",class:"w-[16%] px-4 py-3 text-xs font-semibold uppercase tracking-wide text-gray-500"}," Status "),t("th",{scope:"col",class:"w-[22%] px-4 py-3 text-xs font-semibold uppercase tracking-wide text-gray-500"}," Connection ID "),t("th",{scope:"col",class:"w-[13%] px-4 py-3"},[t("span",{class:"sr-only"},"Actions")])])],-1),bn={class:"divide-y divide-gray-100"},yn={class:"px-4 py-3 align-middle"},vn={class:"flex items-center gap-2.5"},wn=["src","alt"],xn={class:"whitespace-nowrap text-xs font-medium text-gray-900"},kn={class:"px-4 py-3 align-middle"},Cn={class:"flex min-w-0 items-center gap-1.5"},In={type:"button",class:"shrink-0 rounded-full text-gray-400 transition hover:text-sf-green focus:outline-none focus:ring-2 focus:ring-sf-green/30","aria-label":"About the Excel client ID"},Sn={class:"px-4 py-3 align-middle"},En={class:"px-4 py-3 align-middle"},Dn={class:"flex items-center gap-2"},On={class:"whitespace-nowrap rounded-md bg-gray-100 px-2 py-1 text-xs text-gray-600"}
1,An=["aria-label","onClick"],Tn={class:"px-4 py-3 text-right align-middle"},Pn=["aria-label","onClick"],Nn={class:"divide-y divide-gray-100 lg:hidden"},Rn={class:"flex items-start justify-between gap-3"},Un={class:"flex min-w-0 items-center gap-2.5"},Ln=["src","alt"],$n={class:"min-w-0"},Bn={class:"whitespace-nowrap text-sm font-semibold text-gray-900"},Fn={class:"mt-0.5 flex min-w-0 items-center gap-1.5"},Mn={type:"button",class:"shrink-0 rounded-full text-gray-400 transition hover:text-sf-green focus:outline-none focus:ring-2 focus:ring-sf-green/30","aria-label":"About the Excel client ID"},Vn={class:"mt-3 flex items-center gap-2"},jn={class:"min-w-0 flex-1 rounded-md bg-gray-100 px-2.5 py-2 text-xs text-gray-600"},Gn=["aria-label","onClick"],qn=["aria-label","onClick"],Yn={key:0,class:"space-y-3 text-sm leading-6 text-gray-600"},zn=t("strong",{class:"text-amber-700"},"Important:",-1);function Kn(e,s,r,d,n,o){const p=O("InformationCircleIcon"),_=Ee,b=O("ClipboardDocumentIcon"),w=O("ArrowPathIcon"),h=W,g=re,C=oe;return i(),a("div",mn,[t("div",hn,[t("table",fn,[gn,_n,t("tbody",bn,[(i(!0),a(D,null,H(r.connections,u=>(i(),a("tr",{key:u.connection_id,class:"transition-colors hover:bg-gray-50/70"},[t("td",yn,[t("div",vn,[t("img",{src:o.platformLogo(u.platform),alt:o.platformName(u.platform),class:"h-8 w-8 shrink-0 object-contain"},null,8,wn),t("span",xn,m(o.platformName(u.platform)),1)])]),t("td",kn,[t("div",Cn,[t("span",{class:R(["block truncate text-sm",o.accountLabelClasses(u)])},m(o.accountLabel(u)),3),u.excel_client_id?(i(),x(_,{key:0,content:"Temporary identifier for the connected Excel client. It changes when Excel reconnects.",placement:"top"},{default:c(()=>[t("button",In,[l(p,{class:"h-4 w-4","aria-hidden":"true"})])]),_:1})):v("",!0)])]),t("td",Sn,[t("span",{class:R([o.statusClasses(u),"inline-flex whitespace-nowrap rounded-full px-2.5 py-1 text-xs font-medium ring-1 ring-inset"])},m(o.statusLabel(u)),3)]),t("td",En,[t("div",Dn,[t("code",On,m(o.maskedConnectionId(u.connection_id)),1),t("button",{type:"button",class:"inline-flex items-center gap-1 rounded-md border border-gray-200 bg-white px-2 py-1.5 text-xs font-medium text-gray-600 transition hover:border-sf-green hover:text-sf-green focus:outline-none focus:ring-2 focus:ring-sf-green/30","aria-label":`Copy ${o.platformName(u.platform)} connection ID`,onClick:k=>o.copyToClipboard(u.connection_id)},[l(b,{class:"h-3.5 w-3.5","aria-hidden":"true"}),f(" Copy ")],8,An)])]),t("td",Tn,[t("button",{type:"button",class:"inline-flex items-center gap-1 rounded-md border border-gray-200 bg-white px-2 py-1.5 text-xs font-medium text-gray-600 transition hover:border-amber-300 hover:bg-amber-50 hover:text-amber-700 focus:outline-none focus:ring-2 focus:ring-amber-300/40","aria-label":`Rotate ${o.platformName(u.platform)} connection ID ending ${u.connection_id.slice(-4)}`,onClick:k=>o.openRotateDialog(u)},[l(w,{class:"h-3.5 w-3.5","aria-hidden":"true"}),f(" Rotate ")],8,Pn)])]))),128))])])]),t("div",Nn,[(i(!0),a(D,null,H(r.connections,u=>(i(),a("div",{key:u.connection_id,class:"px-4 py-4"},[t("div",Rn,[t("div",Un,[t("img",{src:o.platformLogo(u.platform),alt:o.platformName(u.platform),class:"h-8 w-8 shrink-0 object-contain"},null,8,Ln),t("div",$n,[t("p",Bn,m(o.platformName(u.platform)),1),t("div",Fn,[t("p",{class:R(["truncate text-xs",o.accountLabelClasses(u)])},m(o.accountLabel(u)),3),u.excel_client_id?(i(),x(_,{key:0,content:"Temporary identifier for the connected Excel client. It changes when Excel reconnects.",placement:"top"},{default:c(()=>[t("button",Mn,[l(p,{class:"h-4 w-4","aria-hidden":"true"})])]),_:1})):v("",!0)])])]),t("span",{class:R([o.statusClasses(u),"inline-flex shrink-0 whitespace-nowrap rounded-full px-2.5 py-1 text-xs font-medium ring-1 ring-inset"])},m(o.statusLabel(u)),3)]),t("div",Vn,[t("code",jn,m(o.maskedConnectionId(u.connection_id)),1),t("button",{type:"button",class:"inline-flex shrink-0 items-center gap-1 rounded-md border border-gray-200 bg-white px-2.5 py-2 text-xs font-medium text-gray-600 transition hover:border-sf-green hover:text-sf-green focus:outline-none focus:ring-2 focus:ring-sf-green/30","aria-label":`Copy ${o.platformName(u.platform)} connection ID`,onClick:k=>o.copyToClipboard(u.connection_id)},[l(b,{class:"h-3.5 w-3.5","aria-hidden":"true"}),f(" Copy ")],8,Gn)]),t("button",{type:"button",class:"mt-2 inline-flex w-full items-center justify-center gap-1.5 rounded-md border border-gray-200 bg-white px-3 py-2 text-xs font-medium text-gray-600 transition hover:border-amber-300 hover:bg-amber-50 hover:text-amber-700 focus:outline-none focus:ring-2 focus:ring-amber-300/40","aria-label":`Rotate ${o.platformName(u.platform)} connection ID ending ${u.connection_id.slice(-4)}`,onClick:k=>o.openRotateDialog(u)},[l(w,{class:"h-3.5 w-3.5","aria-hidden":"true"}),f(" Rotate Connection ID ")],8,qn)]))),128))]),l(C,null,{default:c(()=>[l(g,{modelValue:n.showRotateDialog,"onUpdate:modelValue":s[1]||(s[1]=u=>n.showRotateDialog=u),title:"Rotate Connection ID",width:o.isMobileD?"calc(100% - 32px)":"460px",onClosed:s[2]||(s[2]=u=>n.pendingConnection=null)},{footer:c(()=>[l(h,{onClick:s[0]||(s[0]=u=>n.showRotateDialog=!1)},{default:c(()=>[f("Cancel")]),_:1}),l(h,{type:"warning",onClick:o.confirmRotation},{default:c(()=>[f(" Rotate ID ")]),_:1},8,["onClick"])]),default:c(()=>[n.pendingConnection?(i(),a("div",Yn,[t("p",null,[f(" Rotate the "),t("strong",null,m(o.platformName(n.pendingConnection.platform)),1
1),f(" connection ending in "),t("strong",null,m(n.pendingConnection.connection_id.slice(-4)),1),f("? ")]),t("p",null,[zn,f(" "+m(o.rotateWarning),1)])])):v("",!0)]),_:1},8,["modelValue","width"])]),_:1})])}const pt=q(pn,[["render",Kn]]);function Hn(e,s){return i(),a("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[t("path",{"fill-rule":"evenodd",d:"M4.5 12a1.5 1.5 0 113 0 1.5 1.5 0 01-3 0zm6 0a1.5 1.5 0 113 0 1.5 1.5 0 01-3 0zm6 0a1.5 1.5 0 113 0 1.5 1.5 0 01-3 0z","clip-rule":"evenodd"})])}const Wn={mixins:[tt],props:["subscription"],components:{EllipsisHorizontalIcon:Hn,CircleStackIcon:$t,ChartBarSquareIcon:st,BuildingLibraryIcon:Bt},computed:{external(){return this.subscription.product.name.includes("external")?"(External)":""},academic(){return this.subscription.product.name.includes("academic")?"(Academic)":""},free(){return this.subscription.product.name.includes("free")?"(Free)":""}},data(){return{bgColor:"bg-blue-500"}},methods:{productName(e){return e.group==="data"?"Market Data":be(e.group)}}},Jn={key:0,class:""},Qn={class:"flex items-center gap-x-4 border-b border-gray-900/5 bg-gray-50 p-6"},Zn={class:"h-12 w-12 flex rounded-lg ring-1 ring-gray-900/10 items-center justify-center bg-sf-green text-white text-lg"},Xn={class:"text-sm font-medium leading-6 text-gray-900 hover:underline hover:text-sf-green"},ei={class:"-my-3 divide-y divide-gray-100 px-6 py-4 text-sm leading-6"},ti={class:"flex justify-between gap-x-4 py-3"},si=t("dt",{class:"text-gray-500"},"Tier",-1),oi={class:"text-gray-700"},ni={class:"font-medium text-gray-900"},ii={key:0,class:"flex justify-between gap-x-4 py-3"},ri=t("dt",{class:"text-gray-500"},"Frequency",-1),ai={class:"text-gray-700"},li={class:"font-medium text-gray-900"},ci={key:1,class:"flex justify-between gap-x-4 py-3"},di=t("dt",{class:"text-gray-500"},"Trial Ends",-1),ui={class:"flex items-start gap-x-2"},pi={class:"font-medium text-gray-900"},mi={class:"flex justify-between gap-x-4 py-3"},hi=t("dt",{class:"text-gray-500"},"Status",-1),fi={class:"flex items-start gap-x-2"};function gi(e,s,r,d,n,o){const p=O("CircleStackIcon"),_=O("ChartBarSquareIcon"),b=O("BuildingLibraryIcon");return r.subscription?(i(),a("div",Jn,[t("div",Qn,[t("div",Zn,[t("div",null,[r.subscription.product.group==="data"?(i(),x(p,{key:0,class:"h-6 w-6","aria-hidden":"true"})):v("",!0),r.subscription.product.group==="options"?(i(),x(_,{key:1,class:"h-6 w-6","aria-hidden":"true"})):v("",!0),r.subscription.product.group==="brokerage"?(i(),x(b,{key:2,class:"h-6 w-6","aria-hidden":"true"})):v("",!0)])]),t("div",Xn,m(o.productName(r.subscription.product))+" "+m(o.external)+m(o.academic)+m(o.free),1)]),t("dl",ei,[t("div",ti,[si,t("dd",oi,[t("div",ni,m(("capitalise"in e?e.capitalise:P(be))(r.subscription.product.tier)),1)])]),r.subscription.product.tier!=="trial"?(i(),a("div",ii,[ri,t("dd",ai,[t("div",li,m(r.subscription.product.frequency==="month"?"Monthly":"Annual"),1)])])):v("",!0),r.subscription.product.tier==="trial"?(i(),a("div",ci,[di,t("dd",ui,[t("div",pi,m(("formatDate"in e?e.formatDate:P(ce))(r.subscription.trial_ends)),1)])])):v("",!0),t("div",mi,[hi,t("dd",fi,[r.subscription.cancel_at_period_end?(i(),a("div",{key:1,class:R([e.badgeStatuses.canceled,"rounded-md ml-2 py-1 px-2 text-xs font-medium ring-1 ring-inset max-w-full inline-block"])}," Cancels "+m(("formatDate"in e?e.formatDate:P(ce))(r.subscription.current_period_end)),3)):(i(),a("div",{key:0,class:R([e.badgeStatuses[r.subscription.status],"rounded-md py-1 px-2 text-xs font-medium ring-1 ring-inset"])},m(("snakeToTitleCase"in e?e.snakeToTitleCase:P(Oe))(r.subscription.status)),3))])])])])):v("",!0)}const _i=q(Wn,[["render",gi]]),bi={components:{PlusCircleIcon:lo}},yi={class:"flex flex-col items-center justify-center h-full p-5"},vi=t("span",null,"Add New",-1);function wi(e,s,r,d,n,o){const p=O("PlusCircleIcon");return i(),a("div",{onClick:s[0]||(s[0]=_=>this.$router.push("/pricing")),class:"cursor-pointer overflow-hidden rounded-xl border border-gray-200 text-gray-600 hover:shadow-md"},[t("div",yi,[l(p,{class:"h-12 w-12","aria-hidden":"true"}),vi])])}const xi=q(bi,[["render",wi]]),ki={mixins:[tt],emits:["get-profile","change-tab"],props:["profile","subscription","selectedSubscription"],computed:{subscriptionItems(){var e;return((e=this.subscription)==null?void 0:e.items)||[]}},watch:{selectedSubscription(e){this.subscriptionIndex=e}},data(){return{subscriptionIndex:0,showCancelDialog:!1,showCancelAddonDialog:!1}},methods:{cancelSubscriptionItem(){U(`${this.$config.public.API_URL}
1/subscription-item/cancel/`,{method:"POST",headers:{Accept:"application/json"},credentials:"include",body:{subscription_item_id:this.subscription.items[this.subscriptionIndex].subscription_item_id}}).then(e=>{E({title:"Success",message:"Your subscription has been cancelled.",type:"success"}),this.subscription.items[this.subscriptionIndex].status=e.sub.status,this.subscription.items[this.subscriptionIndex].cancel_at_period_end=e.sub.cancel_at_period_end,this.showCancelDialog=!1}).catch(e=>{E({title:"Error",message:"There was an error cancelling your subscription.",type:"error"})})},resumeSubscriptionItem(){U(`${this.$config.public.API_URL}/subscription-item/resume/`,{method:"POST",headers:{Accept:"application/json"},credentials:"include",body:{subscription_item_id:this.subscription.items[this.subscriptionIndex].subscription_item_id}}).then(e=>{E({title:"Success",message:"Your subscription has been resumed.",type:"success"}),this.subscription.items[this.subscriptionIndex].status=e.sub.status,this.subscription.items[this.subscriptionIndex].cancel_at_period_end=e.sub.cancel_at_period_end}).catch(e=>{e.data.code==="frequency_error"?E({title:"Error",message:e.data.msg,type:"error"}):E({title:"Error",message:"There was an error resuming your subscription.",type:"error"})})},goToPricing(){const e=this.subscriptionItems[this.subscriptionIndex].product,s=e.group==="data"?"/pricing":`/pricing/${e.group}`;this.$router.push({path:s,query:{type:e.license}})}}},Ci={key:0},Ii={class:"flex items-center justify-center h-96"},Si={class:"text-center"},Ei=t("h2",{class:"text-2xl font-semibold leading-7 text-black"}," No active subscriptions. ",-1),Di=t("p",{class:"mt-1 text-sm leading-6 text-gray-400"}," You don't have any active subscriptions. ",-1),Oi={key:1,class:"grid max-w-7xl grid-cols-1 gap-x-8 gap-y-4 pt-2 pb-4 md:grid-cols-3 lg:gap-y-10 lg:py-8"},Ai=t("div",null,[t("h2",{class:"text-base font-semibold leading-7 text-black"},"Plan"),t("p",{class:"mt-1 text-sm leading-6 text-gray-400"},"Your subscription.")],-1),Ti={class:"col-span-2"},Pi=t("div",null,[t("h2",{class:"text-base font-semibold leading-7 text-black"},"Price"),t("p",{class:"mt-1 text-sm leading-6 text-gray-400"},"Current price.")],-1),Ni={class:"col-span-2"},Ri={key:0},Ui=t("div",null,[t("h2",{class:"text-base font-semibold leading-7 text-black"},"Status"),t("p",{class:"mt-1 text-sm leading-6 text-gray-400"},"Subscription status.")],-1),Li={class:"col-span-2"},$i={key:0},Bi=t("h2",{class:"text-base font-semibold leading-7 text-black"},"Trial Ends",-1),Fi=t("p",{class:"mt-1 text-sm leading-6 text-gray-400"}," Your trial ends on this date. ",-1),Mi=[Bi,Fi],Vi={key:1},ji=t("h2",{class:"text-base font-semibold leading-7 text-black"},"Next Invoice",-1),Gi=t("p",{class:"mt-1 text-sm leading-6 text-gray-400"}," Your next payment date. ",-1),qi=[ji,Gi],Yi={key:2,class:"col-span-2"},zi=t("div",null,[t("h2",{class:"text-base font-semibold leading-7 text-black"},"Change Plan"),t("p",{class:"mt-1 text-sm leading-6 text-gray-400"}," Upgrade or downgrade your plan. ")],-1),Ki={class:"col-span-2"},Hi={key:3},Wi=t("h2",{class:"text-base font-semibold leading-7 text-black"}," Update Payment Details ",-1),Ji=t("p",{class:"mt-1 text-sm leading-6 text-gray-400"}," Change the way you pay. ",-1),Qi=[Wi,Ji],Zi={key:4,class:"col-span-2"},Xi={key:5},er=t("h2",{class:"text-base font-semibold leading-7 text-black"}," Cancel Subscription ",-1),tr=t("p",{class:"mt-1 text-sm leading-6 text-gray-400"},"Say goodbye.",-1),sr=[er,tr],or={key:6},nr=t("h2",{class:"text-base font-semibold leading-7 text-black"}," Resume Your Subscription ",-1),ir=t("p",{class:"mt-1 text-sm leading-6 text-gray-400"},"Don't say goodbye.",-1),rr=[nr,ir],ar={key:7,class:"col-span-2"},lr={key:8,class:"col-span-2"},cr=t("span",null,"Are you sure you want to cancel your subscription?",-1),dr={class:"pb-4"},ur={class:"pb-4 text-red-500"};function pr(e,s,r,d,n,o){const p=W,_=Ft,b=Mt,w=re,h=oe;return i(),a(D,null,[o.subscriptionItems.length===0?(i(),a("div",Ci,[t("div",Ii,[t("div",Si,[Ei,Di,l(p,{onClick:s[0]||(s[0]=g=>e.$router.push("/pricing")),type:"primary",class:"mt-4"},{default:c(()=>[f("Get Started")]),_:1})])])])):(i(),a("div",Oi,[Ai,t("div",Ti,[l(b,{modelValue:n.subscriptionIndex,"onUpdate:modelValue":s[1]||(s[1]=g=>n.subscriptionIndex=g),placeholder:"Select a subscription",class:"max-w-[150px]"},{default:c(()=>[(i(!0),a(D,null,H(o.subscriptionItems,(g,C)=>(i(),x(_,{key:g.subscription_id,label:`${("capitalise"in e?e.capitalise:P(be))(g.product.group)} - ${("capitalise"in e?e.capitalise:P(be))(g.product.tier)}`,value:C},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),Pi,t("div",Ni,[f(m(("formatCurrency"in e?e.formatCurrency:P(ye))(o.subscriptionItems[n.subscriptionIndex].product.price/100,"USD")),1),!o.subscriptionItems[n.subscriptionIndex].product.tier==="trial"?(i(),a("span",Ri,"/"+m(o.subscriptionItems[n.subscriptionIndex].product.frequency.charAt(0)),1)):v("",!0)]),Ui,t("div",Li,[t("div",{class:R([e.badgeStatuses[o.subscriptionItems[n.subscriptionIndex].status],"rounded-md py-1 px-2 text-xs font-medium ring-1 ring-inset max-w-full inline-block"])},m(("snakeToTitleCase"in e?e.snakeToTitleCase:P(Oe))(o.subscriptionItems[n.subscriptionIndex].status)),3),o.subscriptionItems[n.subscriptionIndex].cancel_at_period_end?(i(),a("div",{key:0,class:R([e.badgeStatuses.canceled,"rounded-md ml-2 py-1 px-2 text-xs font-medium ring-1 ring-inset max-w-full inline-block"])}," Cancels "+m(("formatDate"in e?e.formatDate:P(ce))(o.subscriptionItems[n.subscriptionIndex].current_period_end)),3)):v("",!0)]),o.subscriptionItems[n.subscriptionIndex].product.tier==="trial"?(i(),a("div",$i,Mi)):o.subscriptionItems[n.subscriptionIndex].cancel_at_period_end?v("",!0):(i(),a("div",Vi,qi)),o.subscriptionItems[n.subscriptionIndex].cancel_at_period_end?v("",!0):(i(),a("div",Yi,m(o.subscriptionItems[n.subscriptionIndex].product.tier==="trial"?("formatDate"in e?e.formatDate:P(ce))(o.subscriptionItems[n.subscriptionIndex].trial_ends):("formatDate"in e?e.formatDate:P(ce))(o.subscriptionItems[n.subscriptionIndex].current_period_end)),1)),zi,t("div",Ki,[l(p,{onClick:s[2]||(s[2]=g=>o.goToPricing())},{default:c(()=>[f("Change Plan")]),_:1})]),o.subscriptionItems[n.subscriptionIndex].product.name.includes("external")?v("",!0):(i(),a("div",Hi,Qi)),o.subscriptionItems[n.subscriptionIndex].product.name.includes("external")?v("",!0):(i(),a("div",Zi,[l(p,{onClick:s[3]||(s[3]=g=>e.$emit("change-tab","settings"))},{default:c(()=>[f("Go to Settings")]),_:1})])),!o.subscriptionItems[n.subscriptionIndex].cancel_at_period_end&&o.subscriptionItems[n.subscriptionIndex].product.tier!=="trial"?(i(),a("div",Xi,sr)):o.subscriptionItems[n.subscriptionIndex].product.tier==="trial"||o.subscriptionItems[n.subscriptionIndex].product.name.includes("external")?v("",!0):(i(),a("div",or,rr)),!o.subscriptionItems[n.subscriptionIndex].cancel_at_period_end&&o.subscriptionItems[n.subscriptionIndex].product.tier!=="trial"?(i(),a("div",ar,[l(p,{onClick:s[4]||(s[4]=g=>n.showCancelDialog=!0),type:"danger"},{default:c(()=>[f("Cancel Subscription")]),_:1})])):o.subscriptionItems[n.subscriptionIndex].product.tier==="trial"||o.subscriptionItems[n.subscriptionIndex].product.name.includes("external")?v("",!0):(i(),a("div",lr,[l(p,{onClick:s[5
1]||(s[5]=g=>o.resumeSubscriptionItem()),type:"warning"},{default:c(()=>[f("Don't Cancel")]),_:1})]))])),l(h,null,{default:c(()=>[l(w,{title:"Cancel Subscription",modelValue:n.showCancelDialog,"onUpdate:modelValue":s[8]||(s[8]=g=>n.showCancelDialog=g),width:"30%"},{footer:c(()=>[l(p,{onClick:s[6]||(s[6]=g=>n.showCancelDialog=!1)},{default:c(()=>[f("Cancel")]),_:1}),l(p,{type:"danger",onClick:s[7]||(s[7]=g=>o.cancelSubscriptionItem())},{default:c(()=>[f("Yes, Cancel")]),_:1})]),default:c(()=>[cr]),_:1},8,["modelValue"])]),_:1}),l(h,null,{default:c(()=>[l(w,{title:"Remove Add-on",modelValue:n.showCancelAddonDialog,"onUpdate:modelValue":s[11]||(s[11]=g=>n.showCancelAddonDialog=g),width:"30%"},{footer:c(()=>[l(p,{onClick:s[9]||(s[9]=g=>n.showCancelAddonDialog=!1)},{default:c(()=>[f("Cancel")]),_:1}),l(p,{type:"danger",onClick:s[10]||(s[10]=g=>e.removeAddon())},{default:c(()=>[f("Remove")]),_:1})]),default:c(()=>[t("p",dr," Are you sure you want to remove "+m(o.subscriptionItems[n.subscriptionIndex].product.group)+" from your subscription? ",1),t("p",ur," You will immediately lose access to "+m(o.subscriptionItems[n.subscriptionIndex].product.group)+" for your account. ",1)]),_:1},8,["modelValue"])]),_:1})],64)}const mr=q(ki,[["render",pr]]),hr={props:{usage:{type:Object,default:null},loading:{type:Boolean,default:!1},error:{type:String,default:""}},emits:["retry"],computed:{buckets(){var e;return Array.isArray((e=this.usage)==null?void 0:e.buckets)?this.usage.buckets:[]}},methods:{capitalise(e){const s=String(e||"");return s?s.charAt(0).toUpperCase()+s.slice(1):""},bucketLabel(e){const s={data:"Market Data",brokerage:"Brokerage",options:"Options"};return(e.product_groups||[]).map(r=>s[r]||this.capitalise(r)).join(" & ")},formatNumber(e){return Number(e||0).toLocaleString()},formatReset(e){const s=new Date(e);return Number.isNaN(s.getTime())?"":`Resets ${s.toLocaleString(void 0,{weekday:"short",hour:"numeric",minute:"2-digit",timeZoneName:"short"})}`},progressStatus(e){return e>=100?"exception":e>=80?"warning":""}}},fr={class:"min-h-[56px]"},gr={key:0,class:"flex min-h-[56px] items-center justify-between gap-4 rounded-lg border border-red-100 bg-red-50/60 px-3 py-2.5 text-sm text-red-700"},_r={key:1,class:"rounded-lg border border-dashed border-gray-200 bg-gray-50/60 px-3 py-3 text-sm text-gray-500"},br={key:2},yr={class:"divide-y divide-gray-100 rounded-lg border border-gray-100 bg-gray-50/40 px-3"},vr={class:"flex items-start justify-between gap-3"},wr={class:"min-w-0 text-sm font-medium text-gray-800"},xr={class:"font-normal text-gray-400"},kr={key:0,class:"shrink-0 text-xs font-medium text-sf-green"},Cr={key:1,class:"shrink-0 text-right text-xs text-gray-500"},Ir={class:"font-medium text-gray-700"},Sr={key:0,class:"mt-1 text-xs text-gray-400"},Er={class:"mt-1 flex justify-between gap-3 text-xs text-gray-400"},Dr={key:0,class:"mt-1.5 text-right text-xs text-gray-400"};function Or(e,s,r,d,n,o){const p=jt,_=ue;return F((i(),a("div",fr,[r.error?(i(),a("div",gr,[t("span",null,m(r.error),1),t("button",{type:"button",class:"shrink-0 font-semibold text-sf-green hover:text-sf-green-hover",onClick:s[0]||(s[0]=b=>e.$emit("retry"))}," Try again ")])):r.usage&&o.buckets.length===0?(i(),a("div",_r," No active daily quota is associated with this account. ")):o.buckets.length?(i(),a("div",br,[t("div",yr,[(i(!0),a(D,null,H(o.buckets,(b,w)=>(i(),a("div",{key:`${b.tier}-${w}`,class:"py-3"},[t("div",vr,[t("div",wr,[f(m(o.bucketLabel(b))+" ",1),t("span",xr," · "+m(o.capitalise(b.tier)),1)]),b.unlimited?(i(),a("div",kr," Unlimited ")):(i(),a("div",Cr,[t("span",Ir,m(o.formatNumber(b.used)),1),f(" of "+m(o.formatNumber(b.limit))+" requests ",1)]))]),b.unlimited?(i(),a("div",Sr," No daily request limit ")):(i(),a(D,{key:1},[l(p,{class:"mt-2",percentage:b.percentage,"stroke-width":6,"show-text":!1,status:o.progressStatus(b.percentage),"aria-label":`${o.bucketLabel(b)} daily usage: ${b.percentage}%`},null,8,["percentage","status","aria-label"]),t("div",Er,[t("span",null,m(o.formatNumber(b.remaining))+" remaining",1),t("span",null,m(b.percentage)+"%",1)])],64))]))),128))]),r.usage.resets_at?(i(),a("div",Dr,m(o.formatReset(r.usage.resets_at)),1)):v("",!0)])):v("",!0)])),[[_,r.loading]])}const Ar=q(hr,[["render",Or]]),Tr={props:["account"],emits:["remove-brokerage","reconnect-brokerage","nickname-updated"],components:{EllipsisVerticalIcon:dn,QuestionMarkCircleIcon:zt,ExclamationCircleIcon:ao},data(){return{showDeleteDialog:!1,showNicknameDialog:!1,updatingNickname:!1,nicknameDraft:""}},computed:{accountId(){var e,s;return((e=this.account)==null?void 0:e.account_id)||((s=this.account)==null?void 0:s.id)||null}},methods:{removeAccountConnection(){this.$emit("remove-brokerage",this.account.authorization_id),this.showDeleteDialog=!1},startReconnectFlow(){this.$emit("reconnect-brokerage",this.account.authorization_id)},handleMenuCommand(e){e==="nickname"&&this.openNicknameDialog(),e==="disconnect"&&(this.showDeleteDialog=!0)},openNicknameDialog(){this.accountId&&(this.nicknameDraft=this.account.nickname||"",this.showNicknameDialog=!0)},closeNicknameDialog(){this.updatingNickname||(this.showNicknameDialog=!1)},submitNickname(){if(!this.accountId)return;const e=this.account.nickname||"",s=(this.nicknameDraft||"").trim();if(s===e){this.closeNicknameDialog();return}this.saveNickname(s)},saveNickname(e){const s=this.accountId;s&&(this.updatingNickname=!0,U(`${this.$config.public.API_URL}
1/brokerage/accounts/update-nickname/`,{credentials:"include",method:"PATCH",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({account_id:s,new_nickname:e})}).then(()=>{this.updatingNickname=!1,this.showNicknameDialog=!1,this.$emit("nickname-updated",{accountId:s,nickname:e}),E({title:"Success",message:"Nickname updated.",type:"success"})}).catch(()=>{this.updatingNickname=!1,E({title:"Error",message:"Unable to update nickname. Please try again.",type:"error"})}))}}},Pr={class:"flex rounded-md shadow-sm max-w-[300px]"},Nr={class:"flex w-16 flex-shrink-0 items-center justify-center rounded-l-md text-sm font-medium text-white bg-sf-green"},Rr={key:0},Ur={key:1},Lr={class:"flex flex-1 items-start justify-between truncate rounded-r-md border-b border-r border-t border-gray-200 bg-white"},$r={class:"flex-1 truncate px-4 py-2 text-sm"},Br={class:"flex items-start justify-between gap-2"},Fr={class:"font-medium text-gray-900 hover:text-gray-600"},Mr={key:0},Vr={key:1},jr={class:"text-gray-500 mt-1"},Gr={key:0},qr={key:1,class:"flex items-center italic"},Yr=t("span",null,"pending...",-1),zr={class:"mt-2 text-xs text-gray-500"},Kr={key:0},Hr={class:"font-medium text-gray-700"},Wr={class:"flex flex-col items-end gap-2 pr-2 pt-2"},Jr=t("span",{class:"sr-only"},"Reconnect account",-1),Qr={type:"button",class:"inline-flex h-8 w-8 items-center justify-center rounded-full text-gray-400 hover:text-sf-green focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-sf-green"},Zr=t("span",{class:"sr-only"},"Open account actions",-1),Xr=t("span",{class:"text-red-500"},"Disconnect account",-1),ea={class:"text-center"},ta=t("p",null,"Are you sure you want to remove this account connection?",-1),sa={class:"flex justify-center mt-4"},oa={class:"space-y-3"},na=t("p",{class:"text-sm text-gray-500"}," This is the nickname you will use to access this account in Excel and/or Google Sheets â it's just for your reference and has no impact on your actual brokerage account. You can change it anytime. ",-1),ia={class:"flex justify-end gap-2"};function ra(e,s,r,d,n,o){const p=O("QuestionMarkCircleIcon"),_=Ee,b=O("ExclamationCircleIcon"),w=O("EllipsisVerticalIcon"),h=Gs,g=qs,C=js,u=W,k=re,I=Ie,y=oe;return i(),a(D,null,[t("div",Pr,[t("div",Nr,[r.account.account_name?(i(),a("span",Rr,m(r.account.account_name.charAt(0).toUpperCase()),1)):(i(),a("span",Ur,"NC"))]),t("div",Lr,[t("div",$r,[t("div",Br,[t("span",Fr,[r.account.account_name?(i(),a("span",Mr,m(r.account.account_name),1)):(i(),a("span",Vr,"New Connection"))])]),t("p",jr,[r.account.account_number?(i(),a("span",Gr,m(r.account.account_number),1)):(i(),a("span",qr,[l(_,{content:"Your broker is still processing this connection. Check back soon.",placement:"bottom"},{default:c(()=>[l(p,{class:"h-4 w-4 mr-1","aria-hidden":"true"})]),_:1}),Yr]))]),t("p",zr,[r.account.status!=="pending"?(i(),a("span",Kr,[f(" Nickname: "),t("span",Hr,m(r.account.nickname),1)])):v("",!0)])]),t("div",Wr,[r.account.status==="disabled"?(i(),x(_,{key:0,content:"This account connection is inactive. Click to reconnect.",placement:"top"},{default:c(()=>[t("button",{type:"button",class:"inline-flex h-8 w-8 items-center justify-center rounded-full text-red-500 hover:text-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-200",onClick:s[0]||(s[0]=T=>o.startReconnectFlow())},[Jr,l(b,{class:"h-5 w-5","aria-hidden":"true"})])]),_:1})):v("",!0),r.account.status!=="pending"?(i(),x(C,{key:1,trigger:"click",onCommand:o.handleMenuCommand},{dropdown:c(()=>[l(g,{class:"min-w-[180px]"},{default:c(()=>[l(h,{command:"nickname"},{default:c(()=>[f(" Edit nickname ")]),_:1}),l(h,{divided:"",command:"disconnect"},{default:c(()=>[Xr]),_:1})]),_:1})]),default:c(()=>[t("button",Qr,[Zr,l(w,{class:"h-5 w-5","aria-hidden":"true"})])]),_:1},8,["onCommand"])):v("",!0)])])]),l(y,null,{default:c(()=>[l(k,{modelValue:n.showDeleteDialog,"onUpdate:modelValue":s[2]||(s[2]=T=>n.showDeleteDialog=T),title:"Remove Connection",width:"30%"},{default:c(()=>[t("div",ea,[ta,t("div",sa,[l(u,{onClick:s[1]||(s[1]=T=>n.showDeleteDialog=!1)},{default:c(()=>[f("Cancel")]),_:1}),l(u,{type:"danger",onClick:o.removeAccountConnection},{default:c(()=>[f(" Remove ")]),_:1},8,["onClick"])])])]),_:1},8,["modelValue"]),l(k,{modelValue:n.showNicknameDialog,"onUpdate:modelValue":s[4]||(s[4]=T=>n.showNicknameDialog=T),title:"Edit Nickname"},{footer:c(()=>[t("div",ia,[l(u,{onClick:o.closeNicknameDialog,disabled:n.updatingNickname},{default:c(()=>[f(" Cancel ")]),_:1},8,["onClick","disabled"]),l(u,{type:"primary",onClick:o.submitNickname,loading:n.updatingNickname},{default:c(()=>[f(" Save ")]),_:1},8,["onClick","loading"])])]),default:c(()=>[t("div",oa,[na,l(I,{modelValue:n.nicknameDraft,"onUpdate:modelValue":s[3]||(s[3]=T=>n.nicknameDraft=T),placeholder:"e.g. Retirement",maxlength:"60","show-word-limit":"",onKeyup:We(o.submitNickname,["enter"])},null,8,["modelValue","onKeyup"])])]),_:1},8,["modelValue"])]),_:1})],64)}const aa=q(Tr,[["render",ra]]),la={computed:{hasBrokerage(){return!!(this.profile.subscription.items||[]).find(r=>r.product.group==="brokerage"&&r.status==="active")},canConnectBrokerage(){return this.hasBrokerage&&this.profile.email_verified}},data(){return{showBrokerageConnectDialog:!1,snaptradeLoginLink:"",accounts:[],showAccountsError:!1,loaded:!1,noBrokerageAccess:!0}},props:["profile"],mounted(){window.addEventListener("message",this.handleBrokerageResponse),this.listBrokerageAccounts()},beforeUnmount(){window.removeEventListener("message",this.handleBrokerageResponse)},methods:{beginBrokerageConnect(e=null){if(!this.profile.email_verified){E({title:"Email Verification Required",message:"Please verify your email before connecting brokerage accounts.",type:"warning"});return}this.loaded=!1;let s={};e&&(s={reconnect:e}),U(`${this.$config.public.API_URL}
1/brokerage/connect/`,{credentials:"include",method:"POST",headers:{Accept:"application/json"},body:JSON.stringify(s)}).then(r=>{this.loaded=!0,this.snaptradeLoginLink=r.redirectURI,this.showBrokerageConnectDialog=!0}).catch(r=>{this.loaded=!0,E({title:"Error",message:"There was an error opening the connection portal.",type:"error"})})},listBrokerageAccounts(){U(`${this.$config.public.API_URL}/brokerage/accounts/`,{credentials:"include",method:"GET",headers:{Accept:"application/json"}}).then(e=>{this.loaded=!0,this.accounts=e}).catch(e=>{this.loaded=!0,this.showAccountsError=!0})},removeBrokerageAccount(e){U(`${this.$config.public.API_URL}/brokerage/accounts/${e}/`,{credentials:"include",method:"DELETE",headers:{Accept:"application/json"}}).then(()=>{this.listBrokerageAccounts(),E({title:"Success",message:"Your brokerage account has been disconnected.",type:"success"})}).catch(s=>{E({title:"Error",message:"There was an error disconnecting your account.",type:"error"})})},addBrokerageAccount(e){U(`${this.$config.public.API_URL}/brokerage/accounts/${e}/`,{credentials:"include",method:"POST",headers:{Accept:"application/json"}}).then(()=>{this.showBrokerageConnectDialog=!1,this.listBrokerageAccounts(),E({title:"Success",message:"Your brokerage account has been connected.",type:"success"})}).catch(s=>{this.showBrokerageConnectDialog=!1,E({title:"Error",message:"There was an error connecting your account.",type:"error"})})},handleNicknameUpdated({accountId:e,nickname:s}){const r=this.accounts.find(d=>d.account_id===e);r&&(r.nickname=s)},handleBrokerageResponse(e){if(e.data){const s=e.data;if(s.status==="SUCCESS"){const r=s.authorizationId;this.addBrokerageAccount(r)}if(s.status==="ERROR"){const{errorCode:r,statusCode:d,detail:n}=s;r!=="1066"&&(E({title:"Error",message:n,type:"error"}),this.showBrokerageConnectDialog=!1)}s==="CLOSED"&&(this.showBrokerageConnectDialog=!1),s==="CLOSE_MODAL"&&(this.showBrokerageConnectDialog=!1),s==="ABANDONED"&&(this.showBrokerageConnectDialog=!1)}}}},ca={class:"relative max-w-7xl grid gap-x-8 gap-y-4 pt-2 pb-4 lg:gap-y-10 lg:py-8"},da={key:0,class:"z-50 absolute border bg-white rounded md:top-1/2 md:left-1/2 transform md:-translate-x-1/2 md:-translate-y-1/2 shadow-lg"},ua={class:"flex flex-col px-6 py-4"},pa=t("h1",{class:"text-lg font-bold mb-4"}," Get started with brokerage connections ",-1),ma=t("p",{class:"mb-4 text-sm"},[f(" Grab our Brokerage Add-on to connect your brokerage account(s) and get "),t("b",null,"live holdings data"),f(" in Google Sheets and Excel ð ")],-1),ha={class:"max-w-lg mb-2 text-center"},fa={class:"grid grid-cols-1 md:grid-cols-3 gap-x-8 gap-y-4"},ga=t("h2",{class:"text-base font-semibold leading-7 text-black"}," Create New Connection ",-1),_a=t("p",{class:"mt-1 text-sm leading-6 text-gray-400"}," Open our secure connection portal. ",-1),ba=[ga,_a],ya={class:"col-span-2"},va={key:0,class:"mt-2 text-sm text-gray-400"},wa={class:"grid grid-cols-1 md:grid-cols-3 gap-x-8 gap-y-4"},xa=t("h2",{class:"text-base font-semibold leading-7 text-black"}," Connected Brokerage Accounts ",-1),ka=t("p",{class:"mt-1 text-sm leading-6 text-gray-400"}," A list of the brokerage accounts you have connected. ",-1),Ca=[xa,ka],Ia={class:"col-span-2"},Sa={key:1,class:"flex gap-x-4 flex-wrap gap-y-4"},Ea={key:2},Da=["src"];function Oa(e,s,r,d,n,o){const p=W,_=we,b=aa,w=re,h=oe,g=ue;return i(),a(D,null,[t("div",ca,[!o.hasBrokerage&&n.loaded?(i(),a("div",da,[t("div",ua,[pa,ma,t("p",ha,[l(p,{type:"primary",onClick:s[0]||(s[0]=C=>e.$router.push("/pricing/brokerage"))},{default:c(()=>[f("Get Started")]),_:1})])])])):v("",!0),t("div",fa,[t("div",{class:R({"blur-sm":!o.hasBrokerage&&n.loaded})},ba,2),t("div",ya,[F((i(),x(p,{onClick:s[1]||(s[1]=C=>o.beginBrokerageConnect(null)),disabled:!o.canConnectBrokerage},{default:c(()=>[f("Connect")]),_:1},8,["disabled"])),[[g,!n.loaded]]),o.hasBrokerage&&!r.profile.email_verified?(i(),a("p",va," Please verify your email before connecting brokerage accounts. ")):v("",!0)])]),t("div",wa,[t("div",{class:R({"blur-sm":!o.hasBrokerage&&n.loaded})}
1,Ca,2),F((i(),a("div",Ia,[n.showAccountsError?(i(),x(_,{key:0,type:"error",description:"There was an error loading your brokerage accounts.",closable:!1,class:"max-w-[450px]","show-icon":!0})):v("",!0),n.accounts.length>0?(i(),a("div",Sa,[(i(!0),a(D,null,H(n.accounts,C=>(i(),x(b,{onRemoveBrokerage:o.removeBrokerageAccount,onReconnectBrokerage:o.beginBrokerageConnect,onNicknameUpdated:o.handleNicknameUpdated,account:C,key:C.id},null,8,["onRemoveBrokerage","onReconnectBrokerage","onNicknameUpdated","account"]))),128))])):n.loaded?(i(),a("div",Ea,"You have no connected accounts.")):v("",!0)])),[[g,!n.loaded]])])]),l(h,null,{default:c(()=>[l(w,{modelValue:n.showBrokerageConnectDialog,"onUpdate:modelValue":s[2]||(s[2]=C=>n.showBrokerageConnectDialog=C),title:"Connect Brokerage Account",class:"h-[660px]","show-close":!1},{default:c(()=>[t("iframe",{id:"snaptrade-connection-portal",src:n.snaptradeLoginLink,allowfullscreen:"",class:"w-full h-[600px]"},null,8,Da)]),_:1},8,["modelValue"])]),_:1})],64)}const Aa=q(la,[["render",Oa]]),Ta={props:["profile"],data(){return{firstNameLoading:!1,emailNotifications:{productUpdates:!0,newsletter:!0},paymentMethod:null,updateDetailsLoading:!1,loaded:!1,firstName:"",stripeObject:{elements:null,stripe:null,showStripeForm:!1},showDialog:!1,userForm:{old_password:{label:"Old Password",value:"",validation:""},new_password1:{label:"New Password",value:"",validation:""},new_password2:{label:"Confirm Password",value:"",validation:""}}}},methods:{getPaymentMethod(){U(`${this.$config.public.API_URL}/users/payment-methods/get/`,{headers:{Accept:"application/json"},credentials:"include"}).then(e=>{this.loaded=!0,this.paymentMethod=e}).catch(e=>{E({title:"Error",message:"There was an error fetching your payment method.",type:"error"})})},updateName(){this.firstName=this.firstName.trim(),this.firstNameLoading=!0,U(`${this.$config.public.API_URL}/users/update-name/`,{method:"POST",body:{first_name:this.firstName},credentials:"include"}).then(e=>{this.firstNameLoading=!1,E({title:"Success",message:"You've successfully updated your name ð",type:"success"})}).catch(e=>{this.firstNameLoading=!1,E({title:"Error",message:"There was an error updating your name.",type:"error"})})},updateEmailNotificationSettings(){U(`${this.$config.public.API_URL}/users/update-email-notifications/`,{method:"POST",body:{product_updates:this.emailNotifications.productUpdates,transactional:this.emailNotifications.productUpdates,newsletter:this.emailNotifications.newsletter},credentials:"include"}).then(e=>{E({title:"Success",message:"You've successfully updated your email notification settings ð",type:"success"})}).catch(e=>{E({title:"Error",message:"There was an error updating your email notification settings.",type:"error"})})},updateDetails(){if(!this.profile.email_verified){E({title:"Email Verification Required",message:"Please verify your email before updating payment details.",type:"warning"});return}this.updateDetailsLoading=!0,U(`${this.$config.public.API_URL}/users/payment-methods/update/`,{credentials:"include",method:"POST",headers:{Accept:"application/json"}}).then(e=>{this.updateDetailsLoading=!1,this.showDialog=!0,this.stripeObject.stripe=Stripe(this.$config.public.STRIPE_PUBLIC_KEY);const s={clientSecret:e.client_secret,appearance:{}};this.stripeObject.elements=this.stripeObject.stripe.elements(s),this.stripeObject.clientSecret=e.client_secret}).catch(e=>{this.updateDetailsLoading=!1,E({title:"Error",message:"There was an error opening this form.",type:"error"})})},changePassword(){if(this.userForm.new_password1.value!==this.userForm.new_password2.value){this.userForm.new_password2.validation=["New passwords do not match"];for(const e in this.userForm)this.userForm[e].value="";return}U(`${this.$config.public.API_URL}/auth/password/change/`,{method:"POST",body:{old_password:this.userForm.old_password.value,new_password1:this.userForm.new_password1.value,new_password2:this.userForm.new_password2.value},credentials:"include"}).then(e=>{E({title:"Success",message:"You've successfully updated your password â¡ï¸",type:"success"});for(const s in this.userForm)this.userForm[s].value="",this.userForm[s].validation=null}).catch(e=>{for(const s in e.data)s in this.userForm?this.userForm[s].validation=e.data[s]:this.userForm.new_password2.validation=e.data[s];for(const s in this.userForm)this.userForm[s].value=""})},handleSuccess(){this.$router.push({name:"account",query:{tab:"settings"}}),this.showDialog=!1,this.paymentMethod=null,this.getPaymentMethod()}},beforeMount(){this.getPaymentMethod()},mounted(){this.firstName=this.profile.first_name,this.profile.properties.email_notifications&&(this.emailNotifications.productUpdates=this.profile.properties.email_notifications.product_updates??this.profile.properties.email_notifications.transactional??!0,this.emailNotifications.newsletter=this.profile.properties.email_notifications.newsletter)}},Pa={class:"grid max-w-7xl grid-cols-1 gap-x-8 gap-y-4 pt-2 pb-4 md:grid-cols-3 lg:gap-y-10 lg:py-8"},Na=t("div",null,[t("h2",{class:"text-base font-semibold leading-7 text-black"}," Current payment details "),t("p",{class:"mt-1 text-sm leading-6 text-gray-400"},"How you pay.")],-1),Ra={class:"col-span-2"},Ua={key:0},La={key:1},$a={class:"grid max-w-7xl grid-cols-1 gap-x-8 gap-y-4 py-6 md:grid-cols-3 lg:gap-y-10 lg:py-8"},Ba=t("div",null,[t("h2",{class:"text-base font-semibold leading-7 text-black"}," Update Payment Details "),t("p",{class:"mt-1 text-sm leading-6 text-gray-400"},"Change how you pay.")],-1),Fa={class:"col-span-2"},Ma=t("div",{class:"flex items-center gap-x-1"},[t("h4",null,"Update Payment Details")],-1),Va={class:"grid max-w-7xl grid-cols-1 gap-x-8 gap-y-4 py-6 md:grid-cols-3 lg:gap-y-10 lg:py-8"},ja=t("div",null,[t("h2",{class:"text-base font-semibold leading-7 text-black"}," Email Notifications "),t("p",{class:"mt-1 text-sm leading-6 text-gray-400"}," Essential account, security and billing emails are always sent. ")],-1),Ga={class:"col-span-2 flex flex-col"},qa={class:"grid max-w-7xl grid-cols-1 gap-x-8 gap-y-4 py-6 md:grid-cols-3 lg:gap-y-10 lg:py-16"},Ya=t("div",null,[t("h2",{class:"text-base font-semibold leading-7 text-black"}," Change your name "),t("p",{class:"mt-1 text-sm leading-6 text-gray-400"}," What should we call you? ")],-1),za={class:"md:col-span-2"},Ka={class:"grid grid-cols-1 gap-x-6 gap-y-8 sm:max-w-xl sm:grid-cols-6"},Ha={class:"col-span-full space-y-4"},Wa={class:"grid max-w-7xl grid-cols-1 gap-x-8 gap-y-4 py-6 md:grid-cols-3 lg:gap-y-10 lg:py-16"},Ja=t("div",null,[t("h2",{class:"text-base font-semibold leading-7 text-black"}," Change your password "),t("p",{class:"mt-1 text-sm leading-6 text-gray-400"},"Update your password.")],-1),Qa={class:"md:col-span-2"},Za={class:"grid grid-cols-1 gap-x-6 gap-y-8 sm:max-w-xl sm:grid-cols-6"},Xa={key:0,class:"col-span-full space-y-4"},el={class:"el-form-item__label",style:{"justify-content":"flex-start"}},tl={key:1,class:"col-span-full"};function sl(e,s,r,d,n,o){const p=W,_=Pt,b=re,w=oe,h=Kt,g=Ie,C=Ht,u=Wt,k=we,I=ue;return i(),a(D,null,[t("div",Pa,[Na,F((i(),a("div",Ra,[n.paymentMethod&&"card"in n.paymentMethod?(i(),a("span",Ua,m(n.paymentMethod.card.brand.toUpperCase())+" ****"+m(n.paymentMethod.card.last4),1)):(i(),a("span",La,"No payment method provided."))])),[[I,!n.loaded]])]),t("div",$a,[Ba,F((i(),a("div",Fa,[n.showDialog?v("",!0):(i(),x(p,{key:0,onClick:s[0]||(s[0]=y=>o.updateDetails()),disabled:n.updateDetailsLoading},{default:c(()=>[f("Update Details")]),_:1},8,["disabled"])),l(w,null,{default:c(()=>[l(b,{modelValue:n.showDialog,"onUpdate:modelValue":s[2]||(s[2]=y=>n.showDialog=y)},{header:c(()=>[Ma]),default:c(()=>[l(_,{stripeObject:n.stripeObject,onUpdateSuccess:s[1]||(s[1]=y=>o.handleSuccess())},null,8,["stripeObject"])]),_:1},8,["modelValue"])]),_:1})])),[[I,!n.loaded||n.updateDetailsLoading]])]),t("div",Va,[ja,t("div",Ga,[l(h,{onChange:o.updateEmailNotificationSettings,modelValue:n.emailNotifications.productUpdates,"onUpdate:modelValue":s[3]||(s[3]=y=>n.emailNotifications.productUpdates=y),label:"Product tips & reminders"},null,8,["onChange","modelValue"]),l(h,{onChange:o.updateEmailNotificationSettings,modelValue:n.emailNotifications.newsletter,"onUpdate:modelValue":s[4]||(s[4]=y=>n.emailNotifications.newsletter=y),label:"Newsletter & announcements"},null,8,["onChange","modelValue"])])]),t("div",qa,[Ya,t("form",za,[t("div",Ka,[t("div",Ha,[l(u,null,{default:c(()=>[l(C,null,{default:c(()=>[l(g,{modelValue:n.firstName,"onUpdate:modelValue":s[5]||(s[5]=y=>n.firstName=y),size:"large"},null,8,["modelValue"])]),_:1})]),_:1}),l(p,{disabled:n.firstName.trim()===""||n.firstName===null||n.firstNameLoading||n.firstName===r.profile.first_name,type:"primary",plain:"",onClick:o.updateName},{default:c(()=>[f("Update")]),_:1},8,["disabled","onClick"])])])])]),t("div",Wa,[Ja,t("form",Qa,[t("div",Za,[r.profile.has_usable_password?(i(),a("div",Xa,[(i(!0),a(D,null,H(n.userForm,(y,T)=>(i(),a("div",{key:T},[t("p",el,m(y.label),1),l(C,null,{default:c(()=>[l(g,{modelValue:y.value,"onUpdate:modelValue":N=>y.value=N,size:"large",type:"password",onFocus:N=>y.validation=[]},null,8,["modelValue","onUpdate:modelValue","onFocus"])]),_:2},1024),(i(!0),a(D,null,H(y.validation,(N,K)=>
1F((i(),x(k,{key:K,title:N,type:"error",closable:!0,class:"mb-2"},null,8,["title"])),[[ie,y.validation]])),128))]))),128)),l(p,{disabled:!n.userForm.old_password.value||!n.userForm.new_password1.value||!n.userForm.new_password2.value,type:"primary",plain:"",onClick:o.changePassword},{default:c(()=>[f("Update")]),_:1},8,["disabled","onClick"])])):(i(),a("div",tl," Your account is connected via Google. You cannot update these details. "))])])])],64)}const ol=q(Ta,[["render",sl]]),nl={data(){return{invoices:null,loading:!0}},methods:{getInvoices(){U(`${this.$config.public.API_URL}/users/invoices/`,{headers:{Accept:"application/json"},credentials:"include"}).then(e=>{this.invoices=e.data,this.loading=!1}).catch(e=>{E({title:"Error",message:"There was an error fetching your invoices",type:"error"})})},downloadInvoice(e){window.open(e.invoice_pdf,"_blank")},viewInvoice(e){window.open(e.hosted_invoice_url,"_blank")}},mounted(){this.getInvoices()}},il={key:0},rl={key:1};function al(e,s,r,d,n,o){const p=Jt,_=Qe,b=W,w=Qt,h=ue;return F((i(),x(w,{data:n.invoices,style:{width:"100%"},stripe:""},{default:c(()=>[l(p,{prop:"number",label:"Invoice No.",width:"180"}),l(p,{prop:"effective_at",label:"Date"},{default:c(g=>[f(m(("formatDate"in e?e.formatDate:P(ce))(g.row.effective_at*1e3)),1)]),_:1}),l(p,{prop:"amount_paid",label:"Amount"},{default:c(g=>[g.row.amount_paid===0?(i(),a("span",il,m(("formatCurrency"in e?e.formatCurrency:P(ye))(g.row.amount_due/100,"usd")),1)):(i(),a("span",rl,m(("formatCurrency"in e?e.formatCurrency:P(ye))(g.row.amount_paid/100,"usd")),1))]),_:1}),l(p,{prop:"billing_reason",label:"Description"},{default:c(g=>[f(m(("snakeToTitleCase"in e?e.snakeToTitleCase:P(Oe))(g.row.billing_reason)),1)]),_:1}),l(p,{prop:"status",label:"Status"},{default:c(g=>[g.row.status==="paid"?(i(),x(_,{key:0,type:"success"},{default:c(()=>[f("Paid")]),_:1})):g.row.status==="open"?(i(),x(_,{key:1,type:"info"},{default:c(()=>[f("Open")]),_:1})):g.row.status==="uncollected"?(i(),x(_,{key:2,type:"warning"},{default:c(()=>[f("Uncollected")]),_:1})):g.row.status==="void"?(i(),x(_,{key:3,type:"danger"},{default:c(()=>[f("Void")]),_:1})):v("",!0)]),_:1}),l(p,{fixed:"right",label:"View"},{default:c(g=>[l(b,{size:"small",onClick:C=>o.viewInvoice(g.row)},{default:c(()=>[f("View")]),_:2},1032,["onClick"])]),_:1}),l(p,{fixed:"right",label:"Download"},{default:c(g=>[l(b,{size:"small",type:"primary",onClick:C=>o.downloadInvoice(g.row)},{default:c(()=>[f("Download")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])),[[h,n.loading]])}const ll=q(nl,[["render",al]]),cl="https://cal.com/sheetsfinance/30min",dl={props:["connections"],emits:["close"],components:{DocumentDuplicateIcon:ro,CheckIcon:et},data(){return{demoCallHref:cl,missingConnectionMessage:"You do not have a connection ID. This is usually because this platform is not active on your account yet.",selectedPlatform:null,currentStep:0,connectionCopied:!1,platformMeta:{sheets:{installTitle:"Google Sheets",shortname:"Google Sheets",connectionPlatform:"google_sheets",steps:[{label:"Open Google Sheets"},{label:"Install SheetsFinance"},{label:"Open Account modal"},{label:"Connect your account"},{label:"Confirm & finish"},{label:"Get started"}]},excel:{installTitle:"Microsoft Excel",shortname:"Excel",connectionPlatform:"excel",steps:[{label:"Open Add-ins"},{label:"Install SheetsFinance"},{label:"Confirm ribbon access"},{label:"Open Account view"},{label:"Connect your account"},{label:"Get started"}]}},sheetsItems:[{text:'Open a fresh Google Sheet and click "Get add-ons" from the Extensions menu.',src:"/img/demo_carousel/gs_demo_1.png",alt:"Open Google Sheets add-ons",note:"It doesn't matter what Google Account you use to connect to SheetsFinance, you can switch any time from the Account modal. Only one Google Account can be connected to SheetsFinance at a time.",noteEmoji:"ð¥"},{text:"Search for SheetsFinance, click Install, and follow the prompts.",src:"/img/demo_carousel/gs_demo_2.png",alt:"Install SheetsFinance from Google Workspace Marketplace",note:"Be sure to grant all the requested permissions for the extension to work properly.",noteEmoji:"ð"},{text:"Once installed, open the Account modal from the SheetsFinance menu in Google Sheets.",src:"/img/demo_carousel/gs_demo_3.png",alt:"Open the Google Sheets Account modal",note:"This menu is where everything SheetsFinance lives, come back here anytime to access other tools like the Function Generator.",noteEmoji:"ð¡"},{text:"Copy your Connection ID below, paste it into Google Sheets and click Connect.",src:"/img/demo_carousel/gs_demo_4.png",alt:"Connect Google Sheets with Connection ID",showConnectionCopy:!0},{text:"Once successfully connected, you'll see all your account details in the Account modal.",src:"/img/demo_carousel/gs_demo_5.png",alt:"Connected SheetsFinance account details in Google Sheets modal",note:"Close the Account modal and you're ready to start using SheetsFinance in Google Sheets!",noteEmoji:"â
"},{text:"Start using the extension.",src:"/img/demo_carousel/install_4.gif",alt:"SheetsFinance ready to use in Google Sheets"}],excelItems:[{text:"Open Microsoft Excel and click Add-ins from the Home ribbon.",src:"/img/demo_carousel/excel_demo_1.png",alt:"Open Excel add-ins"},{text:"Search for SheetsFinance and click Add to install.",src:"/img/demo_carousel/excel_demo_2.png",alt:"Install SheetsFinance in Excel"},{text:"Once installed, you'll see SheetsFinance available from your Home ribbon.",src:"/img/demo_carousel/excel_demo_3.png",alt:"SheetsFinance available in Excel ribbon"},{text:"Open the SheetsFinance sidebar in Excel, it will automatically open to the Account view.",src:"/img/demo_carousel/excel_demo_4.png",alt:"Excel account modal",note:"This sidebar is where everything SheetsFinance lives in Excel, come back here anytime to access other tools like the Function Generator.",noteEmoji:"ð¡"},{text:"Copy your Connection ID from this dashboard, paste it into Excel, and click Connect.",src:"/img/demo_carousel/excel_install_demo_4.png",alt:"Connect Excel with Connection ID",showConnectionCopy:!0},{text:"Start using the add-in.",src:"/img/demo_carousel/excel_demo_5.png",alt:"SheetsFinance ready to use in Excel"}]}},computed:{isMobileView(){return De()},currentItems(){return this.selectedPlatform==="sheets"?this.sheetsItems:this.excelItems},currentItem(){return this.currentItems[this.currentStep]},currentPlatformMeta(){return this.platformMeta[this.selectedPlatform]},stepNavItems(){var e;return((e=this.currentPlatformMeta)==null?void 0:e.steps)||[]},countedSteps(){return this.currentItems.length-1},currentStepNumber(){return this.currentStep+1},isEndState(){return this.currentStep===this.currentItems.length-1},currentConnection(){return!Array.isArray(this.connections)||!this.selectedPlatform?null:this.connections.find(e=>e.platform===this.currentPlatformMeta.connectionPlatform)||null},currentConnectionId(){var e;return((e=this.currentConnection)==null?void 0:e.connection_id)||""}},methods:{selectPlatform(e){this.selectedPlatform=e,this.currentStep=0,this.connectionCopied=!1},goToStep(e){this.currentStep=e,this.connectionCopied=!1},nextStep(){this.currentStep<this.currentItems.length-1&&(this.currentStep+=1,this.connectionCopied=!1)},previousStep(){this.currentStep>0&&(this.currentStep-=1,this.connectionCopied=!1)},resetSelection(){this.selectedPlatform=null,this.currentStep=0,this.connectionCopied=!1},resetDemo(){this.resetSelection()},async copyConnectionId(){if(this.currentConnectionId)try{await navigator.clipboard.writeText(this.currentConnectionId),this.connectionCopied=!0}catch{this.connectionCopied=!1}}}},ul={class:"demo-flow"},pl={class:"demo-shell"},ml={key:0,class:"demo-platform-select"},hl={class:"demo-platform-select-inner"},fl=t("div",{class:"text-center max-w-2xl px-4"},[t("h2",{class:"text-2xl font-bold mb-2 text-sf-dark"},"Haven't installed SheetsFinance yet?"),t("p",{class:"text-gray-600"},"Choose your platform below and we'll walk you through the setup.")],-1),gl={class:"mt-8 flex flex-col gap-3 sm:flex-row sm:gap-4"},_l=t("div",{class:"flex items-center gap-2"},[t("img",{src:Ae,alt:"Google Sheets",class:"h-8 w-8 rounded-md"}),t("div",null,"Google Sheets")],-1),bl=t("div",{class:"flex items-center gap-2"},[t("img",{src:"https://res.cdn.office.net/files/fabric-cdn-prod_20251117.001/assets/brand-icons/product/svg/excel_16x1.svg",alt:"Microsoft Excel",class:"h-8 w-8 rounded-md"}
1),t("div",null,"Microsoft Excel")],-1),yl={key:1,class:"demo-layout"},vl={class:"demo-sidebar"},wl={class:"demo-sidebar-platform"},xl={class:"border rounded-md p-1 bg-white"},kl={key:0,src:Ae,alt:"Google Sheets",class:"h-7 w-7"},Cl={key:1,src:"https://res.cdn.office.net/files/fabric-cdn-prod_20251117.001/assets/brand-icons/product/svg/excel_16x1.svg",alt:"Microsoft Excel",class:"h-7 w-7"},Il={class:"demo-sidebar-platform-title"},Sl={class:"demo-step-nav","aria-label":"Installation steps"},El=["onClick"],Dl={class:"demo-step-nav-label"},Ol=["href"],Al={class:"demo-content"},Tl={class:"demo-step-label"},Pl={class:"demo-copy"},Nl={class:"demo-image-frame"},Rl={key:0,class:"demo-image-top-block"},Ul={class:"text-center"},Ll=["disabled"],$l={key:0,class:"text-center mt-2"},Bl={key:1,class:"text-center mt-2"},Fl=["disabled"],Ml={class:"demo-image-wrap"},Vl={key:0,class:"demo-note-card"},jl={class:"demo-note-icon"},Gl={class:"demo-note-copy"},ql=t("div",{class:"demo-step-label"},"Get started",-1),Yl=t("div",{class:"demo-copy"},[f("SheetsFinance is ready to use in your spreadsheet. Try "),t("code",null,'=SF("AAPL")'),f(" in any cell to see live data.")],-1),zl={class:"demo-image-frame"},Kl={class:"demo-image-wrap"},Hl={class:"demo-complete-card"},Wl=t("div",{class:"demo-complete-card-icon"},"ð
",-1),Jl=t("div",{class:"demo-complete-card-content"},[t("div",{class:"demo-complete-card-title"},"Want help building your first dashboard?"),t("div",{class:"demo-complete-card-copy"}," Book a 20-min call we'll walk you through formulas tailored to your use case. ")],-1),Ql=["href"],Zl={key:2,class:"demo-mobile"},Xl={class:"demo-mobile-header"},ec={class:"flex"},tc={key:0,src:Ae,alt:"Google Sheets",class:"h-6 w-6 rounded-md mr-1"},sc={key:1,src:"https://res.cdn.office.net/files/fabric-cdn-prod_20251117.001/assets/brand-icons/product/svg/excel_16x1.svg",alt:"Microsoft Excel",class:"h-6 w-6 rounded-md mr-1"},oc={class:"demo-mobile-title"},nc={class:"demo-mobile-content"},ic={class:"demo-step-label"},rc={class:"demo-copy"},ac={key:0,class:"demo-mobile-copy-block"},lc={class:"flex border items-center rounded-lg p-2"},cc=["disabled"],dc={key:0},uc={key:1},pc={class:"demo-mobile-image-frame"},mc=["disabled"],hc={class:"demo-mobile-image-wrap"},fc=t("div",{class:"demo-step-label"},"Get started",-1),gc=t("div",{class:"demo-copy"},[f("SheetsFinance is ready to use in your spreadsheet. Try "),t("code",null,'=SF("AAPL")'),f(" in any cell to see live data.")],-1),_c={class:"demo-mobile-image-frame"},bc={class:"demo-mobile-image-wrap"},yc={class:"demo-mobile-end-actions"},vc={class:"demo-mobile-progress demo-mobile-progress-bottom"},wc={class:"demo-mobile-dots"};function xc(e,s,r,d,n,o){const p=W,_=Zt,b=O("DocumentDuplicateIcon"),w=O("CheckIcon");return i(),a("div",ul,[t("div",pl,[t("button",{type:"button",class:"demo-close-button",onClick:s[0]||(s[0]=h=>e.$emit("close"))},"Ã"),n.selectedPlatform?o.isMobileView?(i(),a("div",Zl,[t("div",Xl,[t("div",ec,[o.currentPlatformMeta.connectionPlatform==="google_sheets"?(i(),a("img",tc)):o.currentPlatformMeta.connectionPlatform==="excel"?(i(),a("img",sc)):v("",!0),t("div",oc,m(o.currentPlatformMeta.installTitle),1)]),t("button",{type:"button",class:"demo-switch-link demo-mobile-switch-link ml-1",onClick:s[8]||(s[8]=(...h)=>o.resetSelection&&o.resetSelection(...h))}," â Switch platform ")]),t("section",nc,[o.isEndState?(i(),a(D,{key:1},[fc,gc,t("div",_c,[t("button",{type:"button",class:"demo-arrow demo-arrow-left",onClick:s[12]||(s[12]=(...h)=>o.previousStep&&o.previousStep(...h))}," â "),t("div",bc,[l(_,{preload:"",src:o.currentItem.src,alt:o.currentItem.alt,class:"demo-mobile-image",loading:"eager",quality:"90"},null,8,["src","alt"])])]),t("div",yc,[l(p,{type:"primary",onClick:s[13]||(s[13]=h=>e.$emit("close"))},{default:c(()=>[f("Get started â")]),_:1})])],64)):(i(),a(D,{key:0},[t("div",ic,"Step "+m(o.currentStepNumber),1),t("div",rc,m(o.currentItem.text),1),o.currentItem.showConnectionCopy?(i(),a("div",ac,[t("div",lc,[t("div",{class:R(["demo-connection-value",o.currentConnectionId?"":"demo-connection-value-empty"])},m(o.currentConnectionId||n.missingConnectionMessage),3),t("button",{type:"button",class:"bg-sf-green text-white rounded-md px-2 py-1 font-semibold ml-1",disabled:!o.currentConnectionId,onClick:s[9]||(s[9]=(...h)=>o.copyConnectionId&&o.copyConnectionId(...h))},[n.connectionCopied?(i(),a("span",uc,[l(w,{class:"h-4 w-4"})])):(i(),a("span",dc,[l(b,{class:"h-4 w-4"})]))],8,cc)])])):v("",!0),t("div",pc,[t("button",{type:"button",class:"demo-arrow demo-arrow-left",disabled:n.currentStep===0,onClick:s[10]||(s[10]=(...h)=>o.previousStep&&o.previousStep(...h))}," â ",8,mc),t("div",hc,[l(_,{preload:"",src:o.currentItem.src,alt:o.currentItem.alt,class:"demo-mobile-image",loading:"eager",quality:"90"},null,8,["src","alt"])]),t("button",{type:"button",class:"demo-arrow demo-arrow-right",onClick:s[11]||(s[11]=(...h)=>o.nextStep&&o.nextStep(...h))}
1," â ")])],64)),t("div",vc,[t("div",wc,[(i(!0),a(D,null,H(o.countedSteps,h=>(i(),a("span",{key:`mobile-${h}`,class:R(["demo-mobile-dot",h<=Math.min(o.currentStepNumber,o.countedSteps)?"demo-mobile-dot-active":""])},null,2))),128))])])])])):(i(),a("div",yl,[t("aside",vl,[t("div",null,[t("div",wl,[t("div",xl,[o.currentPlatformMeta.connectionPlatform==="google_sheets"?(i(),a("img",kl)):o.currentPlatformMeta.connectionPlatform==="excel"?(i(),a("img",Cl)):v("",!0)]),t("div",null,[t("div",Il,m(o.currentPlatformMeta.installTitle),1),t("button",{type:"button",class:"demo-switch-link",onClick:s[3]||(s[3]=(...h)=>o.resetSelection&&o.resetSelection(...h))}," â Switch platform ")])]),t("nav",Sl,[(i(!0),a(D,null,H(o.stepNavItems,(h,g)=>(i(),a("button",{key:h.label,type:"button",class:R(["demo-step-nav-item",g===n.currentStep?"demo-step-nav-item-active":""]),onClick:C=>o.goToStep(g)},[t("span",{class:R(["demo-step-nav-number",g<=n.currentStep?"demo-step-nav-number-active":""])},m(g+1),3),t("span",Dl,m(h.label),1)],10,El))),128))])]),t("a",{href:n.demoCallHref,target:"_blank",rel:"noopener noreferrer",class:"demo-founder-link"}," ð§ð½âð» Book a demo ",8,Ol)]),t("section",Al,[o.isEndState?(i(),a(D,{key:1},[ql,Yl,t("div",zl,[t("button",{type:"button",class:"demo-arrow demo-arrow-left",onClick:s[7]||(s[7]=(...h)=>o.previousStep&&o.previousStep(...h))}," â "),t("div",Kl,[l(_,{preload:"",src:o.currentItem.src,alt:o.currentItem.alt,class:"demo-image",loading:"eager",quality:"90"},null,8,["src","alt"])])]),t("div",Hl,[Wl,Jl,t("a",{href:n.demoCallHref,target:"_blank",rel:"noopener noreferrer",class:"demo-complete-card-link"}," Book a demo â ",8,Ql)])],64)):(i(),a(D,{key:0},[t("div",Tl,"Step "+m(o.currentStepNumber),1),t("div",Pl,m(o.currentItem.text),1),t("div",Nl,[o.currentItem.showConnectionCopy?(i(),a("div",Rl,[t("div",Ul,"1. Click below to copy your "+m(o.currentPlatformMeta.shortname)+" Connection ID",1),t("div",{class:"demo-connection-card hover:shadow-md hover:cursor-pointer transition-all duration-200",onClick:s[4]||(s[4]=(...h)=>o.copyConnectionId&&o.copyConnectionId(...h))},[t("div",{class:R(["demo-connection-value",o.currentConnectionId?"":"demo-connection-value-empty"])},m(o.currentConnectionId||n.missingConnectionMessage),3),t("button",{type:"button",class:"demo-connection-copy",disabled:!o.currentConnectionId},m(n.connectionCopied?"Copied":"Copy"),9,Ll)]),o.currentPlatformMeta.connectionPlatform==="google_sheets"?(i(),a("div",$l,"2. Paste it into the Account modal in Google Sheets")):v("",!0),o.currentPlatformMeta.connectionPlatform==="excel"?(i(),a("div",Bl,"2. Paste it into the Account sidebar in Excel")):v("",!0)])):v("",!0),t("button",{type:"button",class:"demo-arrow demo-arrow-left",disabled:n.currentStep===0,onClick:s[5]||(s[5]=(...h)=>o.previousStep&&o.previousStep(...h))}," â ",8,Fl),t("div",Ml,[l(_,{preload:"",src:o.currentItem.src,alt:o.currentItem.alt,class:"demo-image",loading:"eager",quality:"90"},null,8,["src","alt"])]),t("button",{type:"button",class:"demo-arrow demo-arrow-right",onClick:s[6]||(s[6]=(...h)=>o.nextStep&&o.nextStep(...h))}," â ")]),o.currentItem.note?(i(),a("div",Vl,[t("div",jl,m(o.currentItem.noteEmoji||"ð¡"),1),t("div",Gl,m(o.currentItem.note),1)])):v("",!0)],64))])])):(i(),a("div",ml,[t("div",hl,[fl,t("div",gl,[l(p,{type:"primary",size:"large",class:"demo-platform-button",onClick:s[1]||(s[1]=h=>o.selectPlatform("sheets"))},{default:c(()=>[_l]),_:1}),l(p,{type:"success",size:"large",class:"demo-platform-button",onClick:s[2]||(s[2]=h=>o.selectPlatform("excel"))},{default:c(()=>[bl]),_:1})])])]))])])}const kc=q(dl,[["render",xc]]),Cc={components:{AccountUsageDisclosure:ut,ChartBarSquareIcon:st,ConnectionTable:pt},watch:{activeTab:{handler:function(e){this.$router.push({query:{...this.$route.query,tab:e}}),["dashboard","usage"].includes(e)&&this.profileLoaded&&this.getUsageData()}}},computed:{isMobileD(){return De()},legacyOptionsOffer(){var e;return((e=this.profile)==null?void 0:e.legacy_options_offer)||null},showLegacyOptionsOffer(){var e;return((e=this.legacyOptionsOffer)==null?void 0:e.status)==="eligible"&&this.legacyOptionsOffer.can_claim},formatOfferCutoff(){var e;return(e=this.legacyOptionsOffer)!=null&&e.cutoff_at?new Intl.DateTimeFormat("en-AU",{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZone:"Australia/Melbourne",timeZoneName:"short"}).format(new Date(this.legacyOptionsOffer.cutoff_at)):"the cutoff"},currentDataSubscriptionItem(){var e,s,r;return((r=(s=(e=this.profile)==null?void 0:e.subscription)==null?void 0:s.items)==null?void 0:r.find(d=>{var n;return((n=d.product)==null?void 0:n.group)==="data"&&["active","past_due"].includes(d.status)}))||null},legacyOptionsPlan(){return this.legacyOptionsOffer?{id:this.legacyOptionsOffer.target_product_id,name:"Options",tier:"Options",price:this.legacyOptionsOffer.regular_price,currency:this.legacyOptionsOffer.currency}:null},accountBalanceInCents(){const e=Number(this.balance);return Number.isFinite(e)?e:0},hasAccountBalance(){return this.accountBalanceInCents!==0},formattedAccountBalance(){return ye(-this.accountBalanceInCents/100,"usd")}},data(){return{profile:null,profileLoaded:!1,migrationFound:!1,showChangePasswordModal:!1,activeTab:"dashboard",selectedSubscription:0,connections:[],balance:null,usage:null,usageLoading:!1,usageError:"",usageRequestId:0,showPulse:!1,hasShownNoTrialNotice:!1,hasAutoOpenedDemo:!1,demoDialog:{visible:!1},legacyOptionsDrawer:!1,legacyOptionsInfoDialog:!1,openLegacyOptionsAfterInfo:!1,legacyOfferAutoOpened:!1,emptyStripeObject:{stripe:null,elements:null,showStripeForm:!1},tabs:[{label:"Dashboard",name:"dashboard"},{label:"Subscription",name:"subscription"},{label:"Usage",name:"usage"},{label:"Brokerage",name:"brokerage"},{label:"Invoices",name:"invoices"},{label:"Settings",name:"settings"}]}},methods:{...Dt($e,["getIsAuthenticated","getUserData"]),...Ot($e,["updateUser"]),getConnections(){let e=[];return this.profile&&(e=this.profile.subscription.connections),e},async getUsageData(){var r,d,n;const e=(d=(r=this.connections)==null?void 0:r[0])==null?void 0:d.connection_id,s=++this.usageRequestId;if(this.usageError="",!e){this.usage={buckets:[],resets_at:null}
1,this.usageLoading=!1;return}this.usageLoading=!0;try{const o=await $fetch(`${this.$config.public.DATA_API_URL}/auth/usage`,{query:{conn:e},headers:{Accept:"application/json"}});s===this.usageRequestId&&(this.usage=o)}catch(o){if(s===this.usageRequestId){this.usage=null;const p=(n=o==null?void 0:o.data)==null?void 0:n.detail;this.usageError=typeof p=="string"?p:(p==null?void 0:p.detail)||"Daily usage is temporarily unavailable. Please try again."}}finally{s===this.usageRequestId&&(this.usageLoading=!1)}},async refreshConnectionId(e){try{const s=await U(`${this.$config.public.API_URL}/connection/refresh/`,{credentials:"include",method:"POST",headers:{Accept:"application/json"},body:JSON.stringify({connection_id:e})});this.profile=s,this.updateUser(s),this.connections=this.getConnections(),await this.getProfileData(),E({title:"Success",message:"Connection ID refreshed successfully ð¡",type:"success"})}catch{E({title:"Error",message:"Something went wrong refreshing your connection ID ð¢",type:"error"})}},handleEmailUpdated(e){this.profile&&(this.profile.email=e,this.updateUser(this.profile)),this.getProfileData()},getProfileData(){return U(`${this.$config.public.API_URL}/users/profile/`,{credentials:"include",headers:{Accept:"application/json"}}).then(e=>(this.profile=e,this.updateUser(this.profile),this.connections=this.getConnections(),this.getUsageData(),this.showInstallationDemoIfNeeded(),this.redirectToOnboardingIfNeeded(),this.openLegacyOptionsOfferFromRoute(),this.profileLoaded=!0,e)).catch(e=>{E({title:"Error",message:"There was an error loading your profile data. Refresh the page to try again.",type:"error"})})},showInstallationDemoIfNeeded(){var e;this.$route.query.offer||!((e=this.profile)!=null&&e.show_demo)||this.hasAutoOpenedDemo||(this.hasAutoOpenedDemo=!0,this.demoDialog.visible=!0)},markInstallationDemoSeen(){var e;(e=this.profile)!=null&&e.show_demo&&U(`${this.$config.public.API_URL}/users/profile/`,{credentials:"include",method:"PATCH",headers:{Accept:"application/json"},body:JSON.stringify({show_demo:!1})}).then(s=>{this.profile=s,this.updateUser(this.profile)}).catch(()=>{})},getSubscriptionItems(e=this.profile){var s;return((s=e==null?void 0:e.subscription)==null?void 0:s.items)||[]},getActiveSubscriptionItems(e=this.profile){return this.getSubscriptionItems(e).filter(s=>["active","past_due","trialing"].includes(s.status))},hasAvailableTrial(e=this.profile){return["data","brokerage","options"].some(s=>!(e!=null&&e[`has_trialed_${s}`]))},hasAnyTrialHistory(e=this.profile){return["data","brokerage","options"].some(s=>e==null?void 0:e[`has_trialed_${s}`])},shouldSkipOnboardingGuard(){return!!(this.$route.query.offer||this.$route.query.billing_action||this.$route.query.billing_state||this.$route.query.payment_intent||this.$route.query.payment_intent_client_secret)},redirectToOnboardingIfNeeded(){if(!this.shouldSkipOnboardingGuard()&&!(this.getActiveSubscriptionItems().length>0)){if(this.hasAvailableTrial()&&!this.hasAnyTrialHistory()){this.$router.replace({name:"onboarding"});return}!this.hasAvailableTrial()&&!this.hasShownNoTrialNotice&&(this.hasShownNoTrialNotice=!0,E({title:"Select a Plan",message:"You've already used your free trials. Please select a paid plan to continue.",type:"info"}))}},async refreshSubscriptionAfterDelay(){const e=Nt.service({lock:!0,text:"Updating your subscription...",spinner:"el-icon-loading",background:"rgba(0, 0, 0, 0.7)"});try{await new Promise(s=>setTimeout(s,4e3)),await this.getProfileData()}finally{e.close()}},getBillingNotification(e){return e==="succeeded"?{title:"Authorization Complete",message:"Your card verification succeeded. We're finalizing your subscription update now.",type:"success"}:e==="processing"?{title:"Update Pending",message:"Your card was authorised and the payment is still processing. Your account will update shortly.",type:"info"}:e==="requires_payment_method"?{title:"Payment Failed",message:"Your card could not be authorised. Your subscription was not updated.",type:"error"}:e==="requires_action"?{title:"More Action Needed",message:"Your bank needs another approval step before this subscription update can complete.",type:"warning"}:e==="canceled"?{title:"Payment Canceled",message:"The card authorisation was canceled before your subscription could be updated.",type:"error"}:null},clearBillingQuery(){const e={...this.$route.query};delete e.billing_action,delete e.billing_state,delete e.billing_target_product,delete e.payment_intent,delete e.payment_intent_client_secret,delete e.redirect_status,this.$router.replace({query:e})},async handleBillingReturn(){const e=this.$route.query.billing_action,s=this.$route.query.billing_state,r=this.$route.query.payment_intent_client_secret;if(e!=="update"&&!r&&!s)return;let d=null,n=!1;if(r)try{const o=Stripe(this.$config.public.STRIPE_PUBLIC_KEY),{paymentIntent:p,error:_}=await o.retrievePaymentIntent(r);if(_)d={title:"Payment Status Unavailable",message:"We couldn't confirm the card authorisation result automatically. Please check your subscription status below.",type:"warning"};else{const b=p==null?void 0:p.status;d=this.getBillingNotification(b),n=["succeeded","processing"].includes(b)}}catch{d={title:"Payment Status Unavailable",message:"We couldn't confirm the card authorisation result automatically. Please refresh this page in a moment.",type:"warning"}}else e==="update"&&s==="processing"&&(n=!0,d={title:"Update Pending",message:"Your card authorisation has started. We're waiting for Stripe to finish updating your subscription.",type:"info"});d&&E(d),n?await this.refreshSubscriptionAfterDelay():await this.getProfileData(),this.clearBillingQuery()},getBalance(){U(`${this.$config.public.API_URL}
1/users/balance/`,{credentials:"include",headers:{Accept:"application/json"}}).then(e=>{this.balance=e}).catch(e=>{})},goToSubscriptionPage(e){this.selectedSubscription=e,this.activeTab="subscription"},beforeClose(e){this.showChangePasswordModal?e(!1):e(!0)},handleChangeTab(e){this.activeTab=e},openLegacyOptionsOffer(){this.showLegacyOptionsOffer&&(this.legacyOptionsDrawer=!0)},openLegacyOptionsOfferFromInfo(){this.openLegacyOptionsAfterInfo=!0,this.legacyOptionsInfoDialog=!1},handleLegacyOptionsInfoClosed(){this.openLegacyOptionsAfterInfo&&(this.openLegacyOptionsAfterInfo=!1,this.openLegacyOptionsOffer())},openLegacyOptionsOfferFromRoute(){var e;this.$route.query.offer!=="legacy-options-50"||this.legacyOfferAutoOpened||(this.legacyOfferAutoOpened=!0,this.showLegacyOptionsOffer?this.legacyOptionsDrawer=!0:((e=this.legacyOptionsOffer)==null?void 0:e.status)==="expired"&&E({title:"Offer ended",message:"The self-service discount offer has ended. Contact us if you need help.",type:"info"}))},async handleLegacyOptionsSuccess(){this.legacyOptionsDrawer=!1,await this.refreshSubscriptionAfterDelay()},async handleAccountOfferSubscriptionUpdated(){var e,s;await this.refreshSubscriptionAfterDelay(),await((s=(e=this.$refs.accountOffers)==null?void 0:e.loadOffers)==null?void 0:s.call(e))},handleDemoClose(){var e,s;(s=(e=this.$refs.demoCarousel)==null?void 0:e.resetDemo)==null||s.call(e),this.markInstallationDemoSeen(),this.showPulse=!0,setTimeout(()=>{this.showPulse=!1},3e3)}},beforeMount(){const e=this.$route.query.tab;e&&this.tabs.map(s=>s.name).includes(e)?this.activeTab=e:this.activeTab="dashboard"},mounted(){this.getProfileData(),this.getBalance(),this.handleBillingReturn()}},Ic={class:"min-h-[70vh]"},Sc={key:0},Ec={class:"flex flex-col relative mx-auto max-w-7xl px-4 sm:px-6 lg:px-8"},Dc={key:0,class:"ml-2"},Oc={class:"mx-auto min-h-[70vh] max-w-7xl px-4 pt-0 sm:px-6 lg:px-8"},Ac={key:1,class:"divide-y divide-black/5"},Tc={key:0,class:"mt-3 mb-6 rounded-2xl border border-sf-green/30 bg-sf-green/5 p-4"},Pc={class:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4"},Nc={class:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-sf-green/10"},Rc={class:"flex-1"},Uc=t("h2",{class:"text-base font-semibold text-sf-dark"}," Restore access to Options data ",-1),Lc={class:"mt-0.5 text-sm leading-6 text-sf-dark/75"},$c=t("b",null,"50% off",-1),Bc={class:"flex shrink-0 items-center gap-3 sm:ml-auto"},Fc={class:"max-w-7xl grid gap-x-8 gap-y-4 pt-2 pb-4 lg:gap-y-10 lg:py-8"},Mc={class:"grid grid-cols-1 md:grid-cols-3 gap-x-8 gap-y-4"},Vc=t("div",null,[t("h2",{class:"text-base font-semibold leading-7 text-black"}," Account Email "),t("p",{class:"mt-1 text-sm leading-6 text-gray-400"}," Your account email address. ")],-1),jc={class:"col-span-2"},Gc={class:"grid grid-cols-1 md:grid-cols-3 gap-x-8 gap-y-4 py-4 lg:gap-y-10 lg:py-8"},qc=t("div",null,[t("h2",{class:"text-base font-semibold leading-7 text-black"}," Connections "),t("p",{class:"mt-1 text-sm leading-6 text-gray-400"}," Copy an ID to connect a Google Sheets or Excel account. ")],-1),Yc={class:"col-span-2 md:col-start-2"},zc={key:0},Kc={key:1},Hc=t("p",{class:"text-gray-400"},"You have no connections.",-1),Wc=[Hc],Jc={class:"grid max-w-7xl grid-cols-1 gap-x-8 gap-y-4 py-4 md:grid-cols-3 lg:gap-y-10 lg:py-8"},Qc=t("div",null,[t("h2",{class:"text-base font-semibold leading-7 text-black"}," Subscriptions "),t("p",{class:"mt-1 text-sm leading-6 text-gray-400"}," Your subscriptions and billing information. ")],-1),Zc={class:"md:col-span-2 md:col-start-2"},Xc={key:0},ed={class:"flex flex-wrap"},td={key:1,class:"col-span-full"},sd=t("span",{class:"text-gray-400 mr-4"},"You have no subscriptions.",-1),od={key:3,class:"grid max-w-7xl grid-cols-1 gap-x-8 gap-y-4 py-4 md:grid-cols-3 lg:gap-y-10 lg:py-8"},nd=t("div",null,[t("h2",{class:"text-base font-semibold leading-7 text-black"}," Account Balance "),t("p",{class:"mt-1 text-sm leading-6 text-gray-400"}," Additional balance in your account, applied automatically to your next subscription. ")],-1),id={class:"col-span-2"},rd={class:"divide-y divide-black/5"},ad={class:"divide-y divide-black/5"},ld={class:"grid max-w-7xl grid-cols-1 gap-x-8 gap-y-4 py-4 md:grid-cols-3 lg:gap-y-10 lg:py-8"}
1,cd=t("div",null,[t("h2",{class:"text-base font-semibold leading-7 text-black"}," Daily Usage "),t("p",{class:"mt-1 text-sm leading-6 text-gray-400"}," Your daily request allowance, shared across Google Sheets and Excel. ")],-1),dd={class:"md:col-span-2 md:col-start-2"},ud={class:"divide-y divide-black/5"},pd={class:"divide-y divide-black/5"},md={class:"space-y-4 text-sm leading-6 text-slate-600"},hd=t("p",null," Basic Options functionality was originally included with Market Data. Earlier this year, we launched Options as a dedicated product with broader chains, Greeks, history and volatility analytics. ",-1),fd=t("p",null," SheetsFinance is now an OPRA Vendor. Meeting OPRAâs licensing, subscriber-management and reporting requirementsâalongside our specialist provider feesâmakes Options data more costly to deliver, but enables us to provide it in a properly licensed and sustainable way. ",-1),gd={class:"flex items-start gap-3 rounded-lg border border-sf-green/25 bg-sf-green/5 px-4 py-3 text-sf-dark"},_d={class:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-sf-green/10"},bd=t("p",{class:"pt-0.5"},[f(" Your account is eligible for "),t("strong",null,"50% off Options."),f(" The discounted rate stays fixed while your Options subscription remains continuously active. ")],-1);function yd(e,s,r,d,n,o){var ge,_e;const p=W,_=Qe,b=Tt,w=At,h=no,g=en,C=O("ChartBarSquareIcon"),u=we,k=ut,I=pt,y=_i,T=xi,N=mr,K=Ar,L=Aa,$=ol,V=ll,Y=re,J=oe,j=Se,fe=Xe,ae=kc,ne=ue;return F((i(),a("div",Ic,[n.profile?(i(),a("div",Sc,[t("div",Ec,[l(p,{class:R(["md:absolute mt-2 md:mt-0 top-3 right-5 z-40",{"pulse-animation":n.showPulse}]),type:"primary",onClick:s[0]||(s[0]=A=>{n.demoDialog.visible=!0,n.showPulse=!1})},{default:c(()=>[f("Show Installation Demo")]),_:1},8,["class"]),l(w,{id:"account-tabs",modelValue:n.activeTab,"onUpdate:modelValue":s[1]||(s[1]=A=>n.activeTab=A),class:"mt-4"},{default:c(()=>[(i(!0),a(D,null,H(n.tabs,A=>(i(),x(b,{key:A.label,label:A.label,name:A.name},{label:c(()=>[t("span",null,m(A.label),1),A.isNew?(i(),a("span",Dc,[l(_,{size:"small"},{default:c(()=>[f("NEW")]),_:1})])):v("",!0)]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])]),t("div",Oc,[n.profile.email_verified?v("",!0):(i(),x(h,{key:0,email:n.profile.email,class:"mb-6",onEmailUpdated:o.handleEmailUpdated},null,8,["email","onEmailUpdated"])),l(g,{ref:"accountOffers",visible:["dashboard","subscription"].includes(n.activeTab),mobile:o.isMobileD,profile:n.profile,"profile-email":n.profile.email,onAccessReady:o.getProfileData,onSubscriptionUpdated:o.handleAccountOfferSubscriptionUpdated},null,8,["visible","mobile","profile","profile-email","onAccessReady","onSubscriptionUpdated"]),n.profile&&n.activeTab==="dashboard"?(i(),a("div",Ac,[o.showLegacyOptionsOffer?(i(),a("div",Tc,[t("div",Pc,[t("div",Nc,[l(C,{class:"h-5 w-5 text-sf-green","aria-hidden":"true"})]),t("div",Rc,[Uc,t("p",Lc,[f(" Legacy Options access through your Market Data subscription has ended. Upgrade before "),t("b",null,m(o.formatOfferCutoff),1),f(" for "),$c,f(" to restore access; your discounted rate stays fixed while your Options subscription remains active. ")])]),t("div",Bc,[t("button",{type:"button",class:"text-sm font-medium text-sf-dark/70 underline decoration-sf-green/50 underline-offset-4 transition hover:text-sf-green",onClick:s[2]||(s[2]=A=>n.legacyOptionsInfoDialog=!0)}," Why is this changing? "),t("button",{type:"button",class:"rounded-lg bg-sf-green px-4 py-2 text-sm font-semibold text-white shadow-sm transition hover:bg-sf-green-hover",onClick:s[3]||(s[3]=(...A)=>o.openLegacyOptionsOffer&&o.openLegacyOptionsOffer(...A))}," View offer ")])])])):((ge=o.legacyOptionsOffer)==null?void 0:ge.status)==="billing_attention"?(i(),x(u,{key:1,class:"mt-3 mb-3",type:"warning",closable:!1,title:o.legacyOptionsOffer.reason,description:"Fix or resume your Market Data billing before the offer expires, then return here to claim it."},null,8,["title"])):v("",!0),n.profile.email_verified?(i(),x(k,{key:2,usage:n.usage,loading:n.usageLoading,class:"mt-3 mb-0",onRefresh:o.getUsageData,onViewUsage:s[4]||(s[4]=A=>n.activeTab="usage")},null,8,["usage","loading","onRefresh"])):v("",!0),t("div",Fc,[t("div",Mc,[Vc,t("div",jc,m(n.profile.email),1)])]),t("div",Gc,[qc,t("div",Yc,[((_e=n.connections)==null?void 0:_e.length)>0?(i(),a("div",zc,[l(I,{connections:n.connections,onRefreshConnectionId:o.refreshConnectionId},null,8,["connections","onRefreshConnectionId"])])):(i(),a("div",Kc,Wc))])]),t("div",Jc,[Qc,t("form",Zc,[n.profile.subscription.items?(i(),a("div",Xc,[t("div",ed,[(i(!0),a(D,null,H(n.profile.subscription.items,(A,pe)=>(i(),a("div",{key:A.id,class:"mr-2 mb-2 min-w-[253px] overflow-hidden rounded-xl border border-gray-200 cursor-pointer hover:shadow-md"},[l(y,{onClick:S=>o.goToSubscriptionPage(pe),subscription:A},null,8,["onClick","subscription"])]))),128)),n.profile.subscription.items<2?(i(),x(T,{key:0,class:"min-w-[253px] mb-2"}
1)):v("",!0)])])):(i(),a("div",td,[sd,l(p,{onClick:s[5]||(s[5]=A=>e.$router.push("/pricing"))},{default:c(()=>[f("Select a Plan")]),_:1})]))])]),o.hasAccountBalance?(i(),a("div",od,[nd,t("div",id,m(o.formattedAccountBalance),1)])):v("",!0)])):v("",!0),F(t("div",rd,[l(N,{subscription:n.profile.subscription,selectedSubscription:n.selectedSubscription,onChangeTab:o.handleChangeTab,onGetProfile:s[6]||(s[6]=A=>(o.getProfileData(),n.activeTab="dashboard",n.selectedSubscription=0))},null,8,["subscription","selectedSubscription","onChangeTab"])],512),[[ie,n.activeTab==="subscription"]]),F(t("div",ad,[t("div",ld,[cd,t("div",dd,[l(K,{usage:n.usage,loading:n.usageLoading,error:n.usageError,onRetry:o.getUsageData},null,8,["usage","loading","error","onRetry"])])])],512),[[ie,n.activeTab==="usage"]]),F(t("div",ud,[l(L,{profile:n.profile},null,8,["profile"])],512),[[ie,n.activeTab==="brokerage"]]),F(t("div",pd,[l($,{profile:n.profile},null,8,["profile"])],512),[[ie,n.activeTab==="settings"]]),F(t("div",null,[l(V)],512),[[ie,n.activeTab==="invoices"]])]),l(J,null,{default:c(()=>[l(Y,{modelValue:n.legacyOptionsInfoDialog,"onUpdate:modelValue":s[8]||(s[8]=A=>n.legacyOptionsInfoDialog=A),title:"Why your Options access changed",width:o.isMobileD?"calc(100% - 32px)":"560px",onClosed:o.handleLegacyOptionsInfoClosed},{footer:c(()=>[t("button",{type:"button",class:"rounded-lg bg-sf-green px-4 py-2 text-sm font-semibold text-white shadow-sm transition hover:bg-sf-green-hover",onClick:s[7]||(s[7]=(...A)=>o.openLegacyOptionsOfferFromInfo&&o.openLegacyOptionsOfferFromInfo(...A))}," View offer ")]),default:c(()=>[t("div",md,[hd,fd,t("p",null,[f(" We kept your existing access active at no additional cost during the transition. That access has now ended. Your Market Data subscription and all other included data access remain unchanged. You can upgrade before "),t("b",null,m(o.formatOfferCutoff),1),f(" to restore Options access at the discounted rate. ")]),t("div",gd,[t("div",_d,[l(C,{class:"h-4 w-4 text-sf-green","aria-hidden":"true"})]),bd])])]),_:1},8,["modelValue","width","onClosed"])]),_:1}),l(J,null,{default:c(()=>[l(fe,{modelValue:n.legacyOptionsDrawer,"onUpdate:modelValue":s[9]||(s[9]=A=>n.legacyOptionsDrawer=A),title:"Options upgrade offer",class:"checkout-drawer"},{default:c(()=>{var A,pe;return[n.legacyOptionsDrawer&&o.legacyOptionsPlan?(i(),x(j,{key:0,currentSubscriptionItem:o.currentDataSubscriptionItem,currentSubscription:n.profile.subscription,allSubscriptions:((pe=(A=n.profile)==null?void 0:A.subscription)==null?void 0:pe.items)||[],selectedPlan:o.legacyOptionsPlan,initialStripeObject:n.emptyStripeObject,initialSubscriptionId:n.profile.subscription.subscription_id,license:"individual",frequency:o.legacyOptionsOffer.frequency,isSubscriptionUpdate:!0,upgradeDowngrade:"ADD-ON",productGroup:"options",isMobile:o.isMobileD,emailVerified:n.profile.email_verified,offerMode:!0,offerPricing:o.legacyOptionsOffer,onSuccess:o.handleLegacyOptionsSuccess},null,8,["currentSubscriptionItem","currentSubscription","allSubscriptions","selectedPlan","initialStripeObject","initialSubscriptionId","frequency","isMobile","emailVerified","offerPricing","onSuccess"])):v("",!0)]}),_:1},8,["modelValue"])]),_:1}),l(J,null,{default:c(()=>[l(Y,{modelValue:n.demoDialog.visible,"onUpdate:modelValue":s[11]||(s[11]=A=>n.demoDialog.visible=A),class:"demo-dialog",width:"1180px",top:"4vh",fullscreen:o.isMobileD,"show-close":!1,onClose:o.handleDemoClose},{default:c(()=>[l(ae,{ref:"demoCarousel",connections:n.connections,onClose:s[10]||(s[10]=A=>n.demoDialog.visible=!1)},null,8,["connections"])]),_:1},8,["modelValue","fullscreen","onClose"])]),_:1})])):v("",!0)])),[[ne,!n.profileLoaded]])}const pu=q(Cc,[["render",yd]]);export{pu as default};
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.