PageSourceSearch

https://www.eqiqs.com/assets/useTierLimits-Chn6cz7q.js

js eqiqs.com collected 2026-09-24 13:48:10 UTC 2,032 bytes, 1 lines download raw bytes

1import{b as g,d as R,e as b,u as c}from"./index-DQ5XgqgM.js";import{r as h,j as P}from"./vendor-react-aMKJrssV.js";import{A as C}from"./addon-products-91FW-arT.js";const m={extraProfiles:0,extraRelationships:0,apiCalls:0,groupSessions:0,reports:0,whitelabelReports:0,hasReportTemplates:!1,hasBrandedExports:!1},I=()=>{const{addonPurchases:s,roleLoading:f,refreshProfile:n}=g(),l=h.useMemo(()=>{if(!s||s.length===0)return m;const r={...m};for(const i of s){const o=C[i.addon_type];if(!o?.grants){i.addon_type==="report_templates"&&(r.hasReportTemplates=!0),i.addon_type==="branded_exports"&&(r.hasBrandedExports=!0);continue}const e=o.grants,t=i.quantity||1;e.profiles&&(r.extraProfiles+=e.profiles*t),e.relationships&&(r.extraRelationships+=e.relationships*t),e.apiCalls&&(r.apiCalls+=e.apiCalls*t),e.groupSessions&&(r.groupSessions+=e.groupSessions*t),e.reports&&(r.reports+=e.reports*t),e.whitelabelReports&&(r.whitelabelReports+=e.whitelabelReports*t)}return r},[s]),p=h.useCallback(async()=>{await n()},[n]);return{...l,loading:f,refresh:p}},A=()=>{const{subscribed:s,tier:f,monthsActive:n}=R(),{extraProfiles:l,extraRelationships:p}=I(),{role:r}=g(),i=P(),o=r==="admin",e=f?b[f]:null,t=o?1/0:e?e.maxProfiles===1/0?1/0:e.maxProfiles*n+l:l,u=o?1/0:e?e.maxRelationships===1/0?1/0:e.maxRelationships*n+p:p,y=a=>o?!0:!s||!e?l>0&&a<l?!0:(d("create profiles"),!1):t!==1/0&&a>=t?(c.error(`You've reached your profile limit (${t}). Buy more profiles or upgrade your plan.`,{action:{label:"Upgrade",onClick:()=>i("/pricing")}}),!1):!0,x=a=>o?!0:!s||!e?p>0&&a<p?!0:(d("create relationships"),!1):u!==1/0&&a>=u?(c.error(`You've reached your relationship limit (${u}). Buy more or upgrade your plan.`,{action:{label:"Upgrade",onClick:()=>i("/pricing")}}),!1):!0,d=a=>{c.error(`You need an active subscription to ${a}.`,{action:{label:"View Plans",onClick:()=>i("/pricing")}})};return{subscribed:s,tier:f,limits:e,monthsActive:n,effectiveMaxProfiles:t,effectiveMaxRelationships:u,canCreateProfile:y,canCreateRelationship:x}};export{A as u};

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.