1 import { type PLANS } from '@proton/payments';
2 import { getAppHref } from '@proton/shared/lib/apps/helper';
3 import type { CYCLE } from '@proton/shared/lib/constants';
4 import { APPS } from '@proton/shared/lib/constants';
5 import { invokeInboxDesktopIPC } from '@proton/shared/lib/desktop/ipcHelpers';
6 import { addUpsellPath, getUpgradePath } from '@proton/shared/lib/helpers/upsell';
8 export const freeTrialUpgradeClick = (upsellRef: string) => {
9 invokeInboxDesktopIPC({
11 payload: getAppHref(addUpsellPath(getUpgradePath({}), upsellRef), APPS.PROTONACCOUNT),
15 export const upgradeButtonClick = (cycle: CYCLE, plan?: PLANS) => {
16 invokeInboxDesktopIPC({
18 payload: getAppHref(`/dashboard?plan=${plan}&cycle=${cycle}&step=1`, APPS.PROTONACCOUNT),
22 export const openLinkInBrowser = (url: string) => {
23 invokeInboxDesktopIPC({ type: 'openExternal', payload: url });