1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9f7ce977-5ac4-43b0-bdd3-4ae809851fca",e._sentryDebugIdIdentifier="sentry-dbid-9f7ce977-5ac4-43b0-bdd3-4ae809851fca")}()}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7699],{13532:(e,t,r)=>{r.d(t,{BD:()=>s,Ed:()=>c});var o=r(70785),n=r(54645),i=r(19886),a=r(11060);let l=new Set(["connected","success"]);function s(e,t,r){var s,c,d,u,h,p,f,m,y,_,w,g,k,x,b,v,P,E,j;let T=null!=(d=null==t||null==(s=t.institution)?void 0:s.name)?d:"unknown",N=null!=(u=null==t||null==(c=t.institution)?void 0:c.institution_id)?u:"unknown",S=null!=(h=null==t?void 0:t.status)?h:"unknown",A=function(e,t){if(e)return!0;let r=null==t?void 0:t.status;return!r||!l.has(r)}(e,t);if(e){let o=Error("Plaid Link exit (".concat(r,"): ").concat(e.error_type,"/").concat(e.error_code," at ").concat(T));o.name="PlaidLinkExitError",(0,a.l)(o,{action:"plaid_link_exit",tags:{plaid_flow:r,plaid_error_type:e.error_type,plaid_error_code:e.error_code,plaid_exit_status:S,plaid_institution_id:N},data:{institutionName:T,institutionId:N,status:S,errorType:e.error_type,errorCode:e.error_code,errorMessage:e.error_message,displayMessage:e.display_message,linkSessionId:null==t?void 0:t.link_session_id,requestId:null==t?void 0:t.request_id}})}else{let e={category:"plaid.link",level:"info",message:"Plaid Link closed (".concat(r,") at ").concat(S),data:{flow:r,status:S,institutionName:T,institutionId:N,linkSessionId:null==t?void 0:t.link_session_id,requestId:null==t?void 0:t.request_id}};(0,o.eL)(t=>t.addBreadcrumb(e))}if(A){try{n.Ay.track("Plaid Link Exit",{error_code:null!=(f=null==e?void 0:e.error_code)?f:null,institution_id:null!=(m=null==t||null==(p=t.institution)?void 0:p.institution_id)?m:null,status:null!=(y=null==t?void 0:t.status)?y:null,flow:r})}catch(e){}i.eE.recordLinkExit({error_code:null!=(g=null==e?void 0:e.error_code)?g:null,error_type:null!=(k=null==e?void 0:e.error_type)?k:null,error_message:null!=(x=null==e?void 0:e.error_message)?x:null,institution_id:null!=(b=null==t||null==(_=t.institution)?void 0:_.institution_id)?b:null,institution_name:null!=(v=null==t||null==(w=t.institution)?void 0:w.name)?v:null,link_session_id:null!=(P=null==t?void 0:t.link_session_id)?P:null,request_id:null!=(E=null==t?void 0:t.request_id)?E:null,status:null!=(j=null==t?void 0:t.status)?j:null,flow:r}).catch(()=>{})}}function c(e,t){var r;return(null==e||null==(r=e.display_message)?void 0:r.trim())||t}},19886:(e,t,r)=>{r.d(t,{aV:()=>s,eE:()=>y,j5:()=>f,lF:()=>p,rC:()=>u,w:()=>d,zc:()=>h});var o=r(39004),n=r(11060),i=r(85978);let a=new Set(["investment","brokerage"]);function l(e){return a.has((e.type||"").toLowerCase())}function s(e){return e.filter(l)}let c=new Set(["investment","brokerage","depository"]);function d(e){return"depository"===(e.type||"").toLowerCase()}function u(e){return e.filter(e=>c.has((e.type||"").toLowerCase()))}
1class h extends Error{constructor(e="Plaid connection needs re-authentication"){super(e),this.name="PlaidReauthRequiredError"}}class p extends Error{constructor(e="Your institution reported no holdings for this account"){super(e),this.name="PlaidSuspectEmptyHoldingsError"}}class f extends Error{constructor(e="We're still pulling your holdings. Please try again in a few minutes."){super(e),this.name="PlaidDataNotReadyError"}}class m{static getInstance(){return m.instance||(m.instance=new m),m.instance}async getAuthToken(){let{auth:e}=await (0,o.Ho)(),t=e.currentUser;if(!t)throw Error("User not authenticated");return await t.getIdToken()}async createLinkToken(){try{let e=await this.getAuthToken(),t=await fetch("".concat(i.l8,"?function=create_plaid_link_token"),{method:"POST",headers:{Authorization:"Bearer ".concat(e)}}),r=await t.json();if(!t.ok)throw Error(r.error||"Failed to create Plaid link token");return r.linkToken}catch(e){throw console.error("Error creating Plaid link token:",e),(0,n.l)(e,{action:"create_plaid_link_token"}),e}}async exchangeToken(e){try{let t=await this.getAuthToken(),r=await fetch("".concat(i.l8,"?function=exchange_plaid_token"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)},body:JSON.stringify(e)}),o=await r.json();if(!r.ok)throw Error(o.error||"Failed to exchange Plaid token");return o}catch(e){throw console.error("Error exchanging Plaid token:",e),(0,n.l)(e,{action:"exchange_plaid_token"}),e}}async getItems(){try{let e=await this.getAuthToken(),t=await fetch("".concat(i.l8,"?function=get_plaid_items"),{method:"GET",headers:{Authorization:"Bearer ".concat(e)}}),r=await t.json();if(!t.ok)throw Error(r.error||"Failed to get Plaid items");return r.items}catch(e){throw console.error("Error getting Plaid items:",e),(0,n.l)(e,{action:"get_plaid_items"}),e}}async deleteItem(e){try{let r=await this.getAuthToken(),o=await fetch("".concat(i.l8,"?function=delete_plaid_item"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(r)},body:JSON.stringify({itemId:e})}),n=await o.json();if(!o.ok){var t;throw Error((t=null==n?void 0:n.error,"string"==typeof t&&t.trim()&&"internal server error"!==t.trim().toLowerCase()?t:"Couldn't remove this brokerage connection. Please try again."))}return n}catch(t){throw console.error("Error deleting Plaid item:",t),(0,n.l)(t,{action:"delete_plaid_item",data:{itemId:e}}),t}}async createPortfolioFromPlaid(e){try{let t=await this.getAuthToken(),r=await fetch("".concat(i.l8,"?function=create_portfolio_from_plaid"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)},body:JSON.stringify(e)}),o=await r.json();if(!r.ok){if(o.retryable)throw new f(o.error);throw Error(o.error||"Failed to create portfolio from Plaid")}return o}catch(t){if(t instanceof f)throw t;throw console.error("Error creating portfolio from Plaid:",t),(0,n.l)(t,{action:"create_portfolio_from_plaid",data:{itemId:e.itemId,accountId:e.accountId}}),t}}async syncPortfolio(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{let r=await this.getAuthToken(),o=await fetch("".concat(i.l8,"?function=sync_plaid_portfolio"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(r)},body:JSON.stringify({portfolioId:e,forceEmptyHoldings:t})}),n=await o.json();if(!o.ok){if(n.reauthRequired)throw new h(n.error);if(n.suspectEmptyHoldings)throw new p(n.error);throw Error(n.error||"Failed to sync Plaid portfolio")}return n}catch(t){if(t instanceof h||t instanceof p)throw t;throw console.error("Error syncing Plaid portfolio:",t),(0,n.l)(t,{action:"sync_plaid_portfolio",data:{portfolioId:e}}),t}}async reimportTrades(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{let r=await this.getAuthToken(),o=await fetch("".concat(i.l8,"?function=reimport_plaid_trades"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(r)},body:JSON.stringify({portfolioId:e,forceEmptyHoldings:t})}),n=await o.json();if(!o.ok){if(n.reauthRequired)throw new h(n.error);if(n.suspectEmptyHoldings)throw new p(n.error);throw Error(n.error||"Failed to reimport trades")}return n}catch(t){if(t instanceof h||t instanceof p)throw t;throw console.error("Error reimporting Plaid trades:",t),(0,n.l)(t,{action:"reimport_plaid_trades",data:{portfolioId:e}}),t}}async createUpdateToken(e,t){try{let r=await this.getAuthToken(),o=await fetch("".concat(i.l8,"?function=create_plaid_update_token"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(r)},body:JSON.stringify({itemId:e,accountSelection:!!(null==t?void 0:t.accountSelection)})}),n=await o.json();if(!o.ok)throw Error(n.error||"Failed to create Plaid update token");return n.linkToken}catch(t){throw console.error("Error creating Plaid update token:",t),(0,n.l)(t,{action:"create_plaid_update_token",data:{itemId:e}}),t}}async completeReauth(e){try{let t=await this.getAuthToken(),r=await fetch("".concat(i.l8,"?function=complete_plaid_reauth"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)},body:JSON.stringify({itemId:e})}),o=await r.json();if(!r.ok)throw Error(o.error||"Failed to complete re-authentication")}catch(t){throw console.error("Error completing Plaid re-authentication:",t),(0,n.l)(t,{action:"complete_plaid_reauth",data:{itemId:e}}),t}}async recordLinkExit(e){try{let t=await this.getAuthToken(),r=await fetch("".concat(i.l8,"?function=record_plaid_link_exit"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)},body:JSON.stringify(e)}),o=await r.json();if(!r.ok)throw Error(o.error||"Failed to record Plaid Link exit")}catch(e){throw console.error("Error recording Plaid Link exit:",e),(0,n.l)(e,{action:"record_plaid_link_exit"}),e}}constructor(){}}let y=m.getInstance()},63784:(e,t,r)=>{r.d(t,{d:()=>u});var o=r(95155),n=r(98500),i=r.n(n),a=r(25777),l=r(86901),s=r(42268),c=r(1365),d=r(23681);function u(e){let{feature:t,currentLimit:r,variant:n="inline",className:u="",tier:h,theme:p="light"}=e,f="expired"===h,m=f?"Subscribe":"Upgrade";return"inline"===n?(0,o.jsxs)("span",{"data-theme":p,className:"inline-flex items-center text-sm px-2 py-1 rounded-pill text-ink-muted bg-surface border border-hairline ".concat(u),children:[(0,o.jsx)(a.A,{className:"h-3 w-3 mr-1"}),(0,o.jsx)(i(),{href:d.i$,className:"underline hover:no-underline",children:m})," ","for ",t]}):"banner"===n?(0,o.jsxs)("div",{"data-theme":p,className:"rounded-tile px-4 py-3 flex items-center justify-between bg-surface border border-hairline shadow-soft ".concat(u),children:[(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)(l.A,{className:"h-4 w-4 text-ink-muted"}),(0,o.jsxs)("span",{className:"text-sm text-ink-body",children:[void 0!==r?"You've reached your limit of ".concat(r,". "):"",f?"Subscribe to unlock ".concat(t,"."):"Upgrade to unlock ".concat(t,".")]})]}),(0,o.jsxs)(i(),{href:d.i$,className:"inline-flex items-center px-3 py-1.5 text-sm font-medium rounded-pill transition-colors no-u
1nderline text-ink-secondary bg-ink/[0.04] hover:bg-ink/[0.08]",children:[m,(0,o.jsx)(s.A,{className:"h-3 w-3 ml-1"})]})]}):(0,o.jsxs)("div",{"data-theme":p,className:"rounded-tile p-6 bg-surface border border-hairline shadow-card ".concat(u),"data-sentry-component":"UpgradePrompt","data-sentry-source-file":"UpgradePrompt.tsx",children:[(0,o.jsxs)(c.YZ,{tone:"muted",className:"mb-4","data-sentry-element":"Eyebrow","data-sentry-source-file":"UpgradePrompt.tsx",children:[m," \xb7 Premium"]}),(0,o.jsxs)("div",{className:"flex items-start gap-3",children:[(0,o.jsx)("div",{className:"p-2 rounded-pill bg-ink/[0.04]",children:(0,o.jsx)(a.A,{className:"h-5 w-5 text-ink-muted","data-sentry-element":"Lock","data-sentry-source-file":"UpgradePrompt.tsx"})}),(0,o.jsxs)("div",{className:"flex-1",children:[(0,o.jsx)("h3",{className:"font-semibold text-ink",children:f?"Subscribe to access ".concat(t):"Unlock ".concat(t)}),void 0!==r&&(0,o.jsxs)("p",{className:"text-sm mt-1 text-ink-body",children:["You've reached your limit of ",r,"."]}),(0,o.jsx)("p",{className:"text-sm mt-1 text-ink-body",children:f?"Subscribe to access this feature.":"Upgrade for unlimited access."}),(0,o.jsxs)(i(),{href:d.i$,className:"mt-4 inline-flex items-center px-4 py-2 rounded-pill transition-all no-underline text-sm font-medium hover:-translate-y-px bg-ink text-white hover:brightness-110","data-sentry-element":"Link","data-sentry-source-file":"UpgradePrompt.tsx",children:[(0,o.jsx)(l.A,{className:"h-4 w-4 mr-2","data-sentry-element":"Sparkles","data-sentry-source-file":"UpgradePrompt.tsx"}),m]})]})]})]})}}}]);
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.