diff --git a/PRIVACY.md b/PRIVACY.md index a8ee650..252e7b0 100644 --- a/PRIVACY.md +++ b/PRIVACY.md @@ -21,19 +21,19 @@ today", so it can compare them on your next visit. It is described [below](#what-the-dark-pattern-blocker-remembers), stays on your device, and can be erased with one button. -There is one exception to "nothing is sent": **Sieve Pro**, the optional one-time +There is one exception to "nothing is sent": **Sieve Supporter**, the optional one-time purchase. If you buy it and type in your licence key, that key is sent to Polar, -the company that sells Sieve Pro for us, to check that it is valid, along with a +the company that sells Sieve Supporter for us, to check that it is valid, along with a plain name for the browser ("Sieve · Edge on Windows") so you can tell your browsers apart on your purchases page. That happens when you enter or remove the key and about once a week in between, and only from Sieve's settings page. It is -described [below](#sieve-pro-licence-check). Without Pro, nothing changes. +described [below](#sieve-supporter-licence-check). Without Supporter, nothing changes. Sieve is open source, so anyone can verify these claims: -. The one exception is Sieve Pro's +. The one exception is Sieve Supporter's features (the urge screen, plans, streaks and Your progress), which are not open source. They make no network requests and keep everything on your device, and the -licence check, the only request Pro makes, is part of the open-source code +licence check, the only request Supporter makes, is part of the open-source code (`common/pro.js`), so what it sends can be checked by anyone. --- @@ -55,15 +55,15 @@ third party. | Screen-time tally, **only if you turn Usage Insights on** | Show you where your time goes | Yes | | What a page claimed, while the Dark Pattern Blocker is on | Tell a fake countdown or stock number from a real one on your next visit — see [below](#what-the-dark-pattern-blocker-remembers) | Yes | | Free-trial reminders, **only the ones you ask for** | Remind you before a free trial starts charging — see [below](#free-trial-reminders) | Yes | -| When the block page last stopped each kind of site | One date and time per kind (gambling, dating, games, AI tools, trading, your own blocked sites) and your longest gap, for Sieve Pro's streaks — never the site or its address | Yes | -| When the block page stopped you, for the kinds of site you block for yourself | The time and the kind (gambling, dating, games, AI tools, trading, your own blocked sites) of each stop, kept for a year, so Sieve Pro can show when it tends to get hard and write your month — never the site or its address, and never threats such as scam or malware sites. Kept for everyone, Pro or not | Yes | +| When the block page last stopped each kind of site | One date and time per kind (gambling, dating, games, AI tools, trading, your own blocked sites) and your longest gap, for Sieve Supporter's streaks — never the site or its address | Yes | +| When the block page stopped you, for the kinds of site you block for yourself | The time and the kind (gambling, dating, games, AI tools, trading, your own blocked sites) of each stop, kept for a year, so Sieve Supporter can show when it tends to get hard and write your month — never the site or its address, and never threats such as scam or malware sites. Kept for everyone, Supporter or not | Yes | | Monthly block totals | The Protection Dashboard keeps its daily counts for 30 days; as a day leaves, its counts are added to its month, for about two years — counts only, never a site | Yes | -| Urges waited out, **only if you press "I'm OK now"** | When, how long it took, and the kind of site, to draw Sieve Pro's Proof it passes dial | Yes | +| Urges waited out, **only if you press "I'm OK now"** | When, how long it took, and the kind of site, to draw Sieve Supporter's Proof it passes dial | Yes | | A message in your own voice, **only if you record or choose one** | The recording or sound file, stored in the extension's own database in your browser, and played on the urge screen. The microphone is used only while you record | Yes | -| Plans for the hard moments, **only if you write one** | Your two lines in your own words, the kind of site and the time each is for, to show on Sieve Pro's urge screen when that moment comes | Yes | -| What you picked to try instead, **only if you pick one** | Your list of things to try, and for each pick on the urge screen when it was, the kind of site and which one, kept for a year, so Sieve Pro can tell you how long you tended to stay away after each | Yes | -| A heads-up before your hardest hours, **only if you turn it on** | The times to give it and the words it says, worked out from the record above, for Sieve Pro's heads-up notification | Yes | -| Sieve Pro licence key, **only if you enter one** | Turn on the Pro features | Kept on your device; checked with Polar — see [below](#sieve-pro-licence-check) | +| Plans for the hard moments, **only if you write one** | Your two lines in your own words, the kind of site and the time each is for, to show on Sieve Supporter's urge screen when that moment comes | Yes | +| What you picked to try instead, **only if you pick one** | Your list of things to try, and for each pick on the urge screen when it was, the kind of site and which one, kept for a year, so Sieve Supporter can tell you how long you tended to stay away after each | Yes | +| A heads-up before your hardest hours, **only if you turn it on** | The times to give it and the words it says, worked out from the record above, for Sieve Supporter's heads-up notification | Yes | +| Sieve Supporter licence key, **only if you enter one** | Turn on the Supporter features | Kept on your device; checked with Polar — see [below](#sieve-supporter-licence-check) | | Seal, **only if you start one** | When it ends, and its way out: either the key your witness's authenticator app shares with Sieve (needed to check their codes) and their recovery codes as **hashes**, or the emergency key as a **hash**. A witness's app works offline; nothing is sent to them, us or anyone | Yes | | Urge screen, **only what you fill in** | Your reason, an optional photo (shrunk to fit 800 pixels), and a contact's name and number or email address, shown on the block page | Yes | | Streak settings, **only for what you track** | The day you stopped, what it used to cost you, and what you are saving for, to count streaks, money kept and how close the goal is | Yes | @@ -131,9 +131,9 @@ what was already measured; **Clear history** is what erases it. This data is never transmitted anywhere, is not used for any purpose other than drawing your own report back to you, and is deleted with the extension. -### Sieve Pro licence check +### Sieve Supporter licence check -Sieve Pro is sold by Polar (polar.sh), who handle the payment, the receipt and +Sieve Supporter is sold by Polar (polar.sh), who handle the payment, the receipt and the licence key. Sieve itself never sees your payment details or your email address. @@ -148,15 +148,15 @@ shop ID and this browser's place on the key. **Remove from this browser** gives the place back (the same three things) and then deletes the key here. Nothing else is sent: not your browsing, not your settings, not anything the -Pro features keep. Polar knows which purchase the key belongs to, because they +Supporter features keep. Polar knows which purchase the key belongs to, because they sold it, and may see your IP address, as with any web request. **In Firefox**, Sieve asks your permission before it sends the key, the first time you press Activate, through Firefox's own question about data an -extension sends. If you say no, nothing is sent and Pro stays off. Nobody who -does not activate Pro is ever asked. +extension sends. If you say no, nothing is sent and Supporter stays off. Nobody who +does not activate Supporter is ever asked. -The key is kept on your device so it can be checked again. The Pro features +The key is kept on your device so it can be checked again. The Supporter features themselves (the urge screen, plans, the heads-up, streaks and Your progress) run entirely on your device, like the rest of Sieve. @@ -166,7 +166,7 @@ entirely on your device, like the rest of Sieve. - It does **not** create an account or ask you to log in. - It does **not** collect your name, email, location, or any identifier. (A Sieve - Pro licence key you type in is sent to Polar to check it, as described above.) + Supporter licence key you type in is sent to Polar to check it, as described above.) - It does **not** upload your browsing history, the URLs you visit, page content, keystrokes, or activity — to us or to anyone else. (If you switch on Usage Insights, a site-name-and-duration tally is kept **on your device**, as @@ -180,7 +180,7 @@ entirely on your device, like the rest of Sieve. ## Network activity (full transparency) Sieve makes outbound network requests only to **download files to your device** — -never to upload anything about you — with the one exception of the Sieve Pro +never to upload anything about you — with the one exception of the Sieve Supporter licence check. Specifically: - **Blocklists** — publicly available lists (for example, known gambling, scam, @@ -196,10 +196,10 @@ licence check. Specifically: optional in-app notice to show (for example, a new feature). It sends no information about you, and if the file is unreachable nothing is shown. You can dismiss any notice permanently. -- **Sieve Pro licence check, only if you enter a licence key** — the key, +- **Sieve Supporter licence check, only if you enter a licence key** — the key, Sieve's shop ID and a plain browser name are sent to Polar's licence service (`api.polar.sh`) when you enter or remove it, then about once a week when you - open the settings page. See [above](#sieve-pro-licence-check). + open the settings page. See [above](#sieve-supporter-licence-check). Apart from that licence check, these are all **downloads to your device**. They do not include your identity, your browsing history, page content, or any personal information beyond the normal @@ -221,7 +221,7 @@ Sieve requests only the permissions needed to filter content locally: - **tabs** — open the local "blocked"/settings pages and close popup/hijack tabs. It does not read your browser history. If you switch Usage Insights on, it also reads the site name of the tab you are looking at, in order to time it. - **idle** — used only by Usage Insights, to stop the clock when you step away or lock the screen. It reports how long it has been since you touched the keyboard or mouse; it cannot see what you typed. - **offscreen** — run the optional toxicity model locally, off the main page. -- **notifications** (optional, never asked for at install) — asked for only if you turn on Sieve Pro's heads-up before your hardest hours, and used only to show it. The notification's words are worked out on your device; nothing is sent. +- **notifications** (optional, never asked for at install) — asked for only if you turn on Sieve Supporter's heads-up before your hardest hours, and used only to show it. The notification's words are worked out on your device; nothing is sent. - **scripting** — run Sieve's own filters in pages. For example, the Dark Pattern Blocker's on-page notes are added only to a page where it has found something to show, rather than to every page. - **host access (all sites)** — required because harmful content can appear on any site; used only to run the local filters. No browsing data is collected. @@ -230,7 +230,7 @@ Sieve requests only the permissions needed to filter content locally: ## Chrome Web Store data disclosure In the Chrome Web Store's terms, "collect" means transferring data off the -user's device. The only thing Sieve transfers is a Sieve Pro licence key, if you +user's device. The only thing Sieve transfers is a Sieve Supporter licence key, if you enter one, to Polar to check it. Sieve declares that as **authentication information**, used only to check the licence, never sold, and never used for anything else. It declares that it does **not** collect any of the following: @@ -243,7 +243,7 @@ on Usage Insights, a tally of site names and durations is written **to your own browser storage**; the Dark Pattern Blocker writes the numbers described above under scrambled codes; a free-trial reminder you ask for keeps that site's name and dates; the block page keeps when it stopped you, by kind of -site; and Sieve Pro's streaks, urge screen and voice message keep what is +site; and Sieve Supporter's streaks, urge screen and voice message keep what is listed in the table above. You can erase any of them at any time. Nothing about them is ever sent to us or to a third party, which is why the declaration above is still accurate. diff --git a/README.md b/README.md index 44bd005..7423dd5 100644 --- a/README.md +++ b/README.md @@ -189,7 +189,7 @@ Sieve elects the CC arm of EasyList's GPLv3 / CC BY-SA 3.0 dual licence; BY-SA's "Collection" clause is what keeps the rest of the project MIT. Editing that one file means editing a BY-SA file — see [`data/ATTRIBUTION-easylist.md`](data/ATTRIBUTION-easylist.md). -**Sieve Pro** (the urge screen with its designs and voice message, streaks with a +**Sieve Supporter** (the urge screen with its designs and voice message, streaks with a savings goal, and Your progress: hardest hours, proof it passes, the month and year letters) is not open source and is not in this repository: [`pro/`](pro/README.md) holds empty stand-ins, and the store versions diff --git a/common/changelog.js b/common/changelog.js index 2afa9bf..73ce47e 100644 --- a/common/changelog.js +++ b/common/changelog.js @@ -20,7 +20,7 @@ const SIEVE_CHANGELOG = [ "New, and free: the Seal, in Settings › Lock. It locks your protection until a date you choose: a week, 30 days, 90 days or a year. Until then nothing that weakens it can be changed, not with your PIN and not by waiting out a cool-off. Extending a seal is always allowed; shortening one is not.", "The way out early is held by a witness: someone you trust scans a QR code into the authenticator app they already use, and you ask them for the six digits it shows. They also keep eight recovery codes in case their phone is lost. Nothing is sent anywhere, and five wrong codes lock entry for a while. The seal only starts once their app has shown a code that works. If there is nobody to ask, choose a printed emergency key instead.", "A running seal shows in the toolbar popup, with the day it ends.", - "New: Sieve Pro, a one-time purchase with no subscription. Every protection stays free, the Seal included, and always will. Pro adds help for the hard moments and a way to see how far you have come, running on your device like the rest of Sieve.", + "New: Sieve Supporter, a one-time purchase with no subscription. Every protection stays free, the Seal included, and always will. Supporter adds help for the hard moments and a way to see how far you have come, running on your device like the rest of Sieve.", "The urge screen changes what you see when Sieve stops you at a blocked site. Instead of a notice, the page leads with something to do while the urge passes, then your own reason in your own words, a photo if you chose one, a message in your own voice, and one tap to text, call or email someone you trust. Go back and Allow stay underneath, exactly as before.", "At its centre, choose a breathing ring, an ensō (hold to breathe in, let go to breathe out, and a brush draws one circle a breath), or a river to lead from the spring to the sea, a small puzzle with no clock and no score for the minutes an urge takes.", "Proof it passes: press “I'm OK now” when an urge has passed, and it becomes a dot on a dial at the minute it passed. The next time, the dial's hand runs through them while you wait: “Your urges pass. Usually by minute 6.” In your hardest hours, the urge screen says so.", @@ -32,9 +32,9 @@ const SIEVE_CHANGELOG = [ "A heads-up before your hardest hours, if you turn it on: a notification fifteen minutes before they usually start, on the days they have come, with your plan for them. Sieve asks your browser for permission to show notifications only when you switch this on. It is worked out on your device, and a heads-up the computer slept through is dropped rather than shown late.", "What works for you: while you wait on the urge screen, pick one of your own things to try instead, such as a walk or a call. Sieve keeps which one you picked and how long until a blocked site stopped you again, and once you have tried something twice it says so: “After a walk, you usually stayed away about 3 hours.” Your progress lists them all. A pattern from your own days, never a promise.", "The top of the toolbar popup, redone, on a pine band like BlockNSFW's. Whether Sieve is on is now a stamp beside its name, and a running seal shows its days as a row of holes, filling one a day.", - "With Sieve Pro the popup knows what time it is: “Your hard hours start in 20 minutes”, the day drawn hour by hour with your hardest ones marked, your plan for them, and what tends to help you, with your streaks underneath. On a day they don't come, it says when they next do.", - "To make that possible, the block page now keeps when it stopped you, as well as how many times, for the kinds of site you block for yourself (never threats such as scam sites, and never the site's address). It is kept on your device for a year, for everyone, so Pro can show the months before you bought it.", - "Sieve Pro is sold by Polar, who send the licence key with your receipt. One key works in up to three browsers at once, and “Remove from this browser” frees a place for another. Entering it sends that key and a plain name for the browser to Polar to check it, and again about once a week when you open the settings. Firefox asks your permission first. The privacy policy explains exactly what is sent.", + "With Sieve Supporter the popup knows what time it is: “Your hard hours start in 20 minutes”, the day drawn hour by hour with your hardest ones marked, your plan for them, and what tends to help you, with your streaks underneath. On a day they don't come, it says when they next do.", + "To make that possible, the block page now keeps when it stopped you, as well as how many times, for the kinds of site you block for yourself (never threats such as scam sites, and never the site's address). It is kept on your device for a year, for everyone, so Supporter can show the months before you bought it.", + "Sieve Supporter is sold by Polar, who send the licence key with your receipt. One key works in up to three browsers at once, and “Remove from this browser” frees a place for another. Entering it sends that key and a plain name for the browser to Polar to check it, and again about once a week when you open the settings. Firefox asks your permission first. The privacy policy explains exactly what is sent.", "New in Site Cleanup: Google Search, beside YouTube. Ten switches behind “Clean up Google Search”, each off until you turn it on. “Show web results only” opens every search on Google's Web tab, a plain list of links; Images, News and the other tabs still open when you ask for them. The rest hide AI Overviews and AI Mode, “People also ask”, “Discussions and forums”, short videos, the video row, Top stories, product grids and “People also search for”. They find each box by where it leads rather than by its heading, so they work in any language.", "The Search Result Filter now works on Brave Search, Yahoo and Swisscows, as well as Google, Bing and DuckDuckGo. Your hide and colour rules, your Blocked list and your subscribed lists all apply there, and the “?” beside a changed result explains it the same way.", "A fix for DuckDuckGo's no-JavaScript version, html.duckduckgo.com, where the filter did nothing. A search typed on that page leaves no search in the address, which is what the filter looked for, and a search opened from a link sends every result through a DuckDuckGo redirect that the filter would not read. Both now work.", diff --git a/common/pro.js b/common/pro.js index 464b0cc..9afd34d 100644 --- a/common/pro.js +++ b/common/pro.js @@ -59,9 +59,11 @@ // The benefit(s) that grant Sieve Pro. Required: every product in the // store shares the organisation id, so this is what tells a Sieve Pro // key from a BlockNSFW one. Until it is set, Pro cannot be activated. - benefitIds: [], - // Without it the settings page hides the Buy button. - checkoutUrl: "", + benefitIds: ["4c41be51-3c05-44a5-ac59-76108b4b8b6c"], + // Without it the settings page hides the Buy button. Sieve Pro at + // $34.99, with the $10 launch discount preset on the link until + // 2 January 2027 (see `launch` below). + checkoutUrl: "https://buy.polar.sh/polar_cl_qjDvSCcQ0ADA26pvzsvFIutGFMuX0HVcE4EwI2ZOsU1", api: "https://api.polar.sh", // Where buyers find their key and see the browsers it is on. portal: "https://polar.sh/monolab/portal", @@ -74,7 +76,12 @@ portal: "https://sandbox.polar.sh/monolab/portal", }, }, - priceLabel: "$24.99", + priceLabel: "$34.99", + // A launch price, quoted until the day `until` begins (in the buyer's + // own time zone) and then gone by itself, so Settings never quotes a + // price the checkout has stopped charging. It only says what the price + // is: the product's price in Polar has to change on the same day. + launch: { priceLabel: "$24.99", until: "2027-01-01" }, }; function store() { @@ -129,6 +136,21 @@ return !!s.organizationId && s.benefitIds.length > 0; } + // The price Settings quotes: the launch price until it ends, then the full + // one. { label, regular, launch, lastDay }: lastDay is the launch price's + // last day, or null when there is no launch price (any more). + function price(now = Date.now()) { + const regular = CONFIG.priceLabel; + const full = { label: regular, regular, launch: false, lastDay: null }; + const l = CONFIG.launch; + const m = l && l.priceLabel && /^(\d{4})-(\d{2})-(\d{2})$/.exec(l.until || ""); + if (!m) return full; + const ends = new Date(Number(m[1]), Number(m[2]) - 1, Number(m[3])); + if (!(now < ends.getTime())) return full; + const lastDay = new Date(Number(m[1]), Number(m[2]) - 1, Number(m[3]) - 1); + return { label: l.priceLabel, regular, launch: true, lastDay }; + } + function apiBase() { return store().api; } @@ -411,6 +433,7 @@ maskKey, isProState, isConfigured, + price, apiBase, portalUrl, checkoutUrl, diff --git a/options/options.html b/options/options.html index 9f53e0b..3da23fe 100644 --- a/options/options.html +++ b/options/options.html @@ -72,8 +72,8 @@ 10Advanced - - + +
@@ -1817,8 +1817,8 @@

Your licence Free

Activating sends the key and a plain name for this browser to Polar, who sell Sieve - Pro, to check it. Sieve checks again about once a week when you open these settings. - Pro features run on this device like the rest of Sieve. + Supporter, to check it. Sieve checks again about once a week when you open these + settings. Supporter features run on this device like the rest of Sieve.

@@ -1927,7 +1927,7 @@

Plans for the hard moments

the plan that fits the kind of site and the hour, before anything else. Sieve can also give you a heads-up shortly before your hardest hours start.

- +
@@ -53,10 +53,10 @@

See when it gets hard, and that it passes.

Your hardest hours by weekday and hour, proof from the urges you’ve waited out, what tends to help you, and a letter after every month with your year on one calendar. Sieve has been keeping the record on this device all along, so it starts from the months before. It comes with Sieve - Pro. Blocking is the same either way. + Supporter. Blocking is the same either way.

@@ -69,7 +69,7 @@

Days since the last one

    @@ -113,7 +113,7 @@

    Decided while it was calm.

      diff --git a/popup/popup.html b/popup/popup.html index 4b364e3..220f1e8 100644 --- a/popup/popup.html +++ b/popup/popup.html @@ -69,10 +69,10 @@

      - Sieve already keeps, on this device, when a blocked site stopped you. Sieve Pro turns - that into your hardest hours, here, with your plan for them. + Sieve already keeps, on this device, when a blocked site stopped you. Sieve Supporter + turns that into your hardest hours, here, with your plan for them.

      - +
      diff --git a/pro/README.md b/pro/README.md index 150d354..880afb8 100644 --- a/pro/README.md +++ b/pro/README.md @@ -1,6 +1,6 @@ # pro/ -The files in this folder are empty stand-ins for **Sieve Pro**: +The files in this folder are empty stand-ins for **Sieve Supporter** (called Pro in the code): | File | The feature | | --- | --- | @@ -11,10 +11,10 @@ The files in this folder are empty stand-ins for **Sieve Pro**: | `voice.js` | A message in your own voice, recorded in Settings and played on the urge screen | | `coach.js` | Plans for the hard moments, things to try instead and what works for you, and the heads-up before the hardest hours (shown by `background/heads-up.js`, open source) | | `progress.js` | The Your progress page (`pages/progress.html`) | -| `settings.js` | The urge screen, voice, plans and streaks groups in Settings › Sieve Pro | +| `settings.js` | The urge screen, voice, plans and streaks groups in Settings › Sieve Supporter | | `features.js` | Which Pro features a build carries (here: none) | -Sieve Pro is not open source. It lives in a separate, private repository and +Sieve Supporter is not open source. It lives in a separate, private repository and is copied over these files when a store build is made (`build-chrome.ps1`, `build-firefox.ps1`). The versions of Sieve on the Chrome Web Store, Microsoft Edge Add-ons and Firefox Add-ons carry it. @@ -24,7 +24,7 @@ the filters, the Dark Pattern Blocker, the Doomscroll Stopper, the Guardian Lock, the cool-off, the Seal, and everything else that decides what is blocked or guards your settings. A build made from this repository protects exactly as the store version does. Without -Pro, Settings has no Sieve Pro section, and the block page is the plain notice. +Pro, Settings has no Sieve Supporter section, and the block page is the plain notice. So is the licence check (`common/pro.js`), the one network request Pro makes, so anyone can see exactly what it sends. And so is the half of the heads-up diff --git a/test/pro-test.mjs b/test/pro-test.mjs index a6f09ee..94688f1 100644 --- a/test/pro-test.mjs +++ b/test/pro-test.mjs @@ -435,8 +435,12 @@ test("the shipped config: live mode, Monolab's live store, and a complete sandbo assert.equal(live.organizationId, "354a2f6c-8ea7-46a7-87c5-f97645c12e29"); assert.equal(live.api, "https://api.polar.sh"); assert.equal(live.portal, "https://polar.sh/monolab/portal"); - // The live store's benefit and checkout are filled in at launch; a store - // package refuses to build until they are (build-pro.mjs). + // Sieve Supporter on sale: its licence-key benefit, and the checkout link + // with the launch discount preset. A store package refuses to build + // without them (build-pro.mjs). + assert.deepEqual(live.benefitIds, ["4c41be51-3c05-44a5-ac59-76108b4b8b6c"]); + assert.equal(live.checkoutUrl, "https://buy.polar.sh/polar_cl_qjDvSCcQ0ADA26pvzsvFIutGFMuX0HVcE4EwI2ZOsU1"); + assert.ok(!live.benefitIds.some((id) => sandbox.benefitIds.includes(id)), "a sandbox benefit never sells live"); assert.notEqual(sandbox.organizationId, live.organizationId, "the sandbox is a separate store"); assert.match(sandbox.organizationId, /^[0-9a-f-]{36}$/); assert.equal(sandbox.benefitIds.length, 1); @@ -444,6 +448,36 @@ test("the shipped config: live mode, Monolab's live store, and a complete sandbo assert.equal(sandbox.api, "https://sandbox-api.polar.sh"); }); +test("the launch price is quoted until its last day, then the full price, with no update needed", () => { + assert.equal(SHIPPED.priceLabel, "$34.99"); + assert.deepEqual(SHIPPED.launch, { priceLabel: "$24.99", until: "2027-01-01" }); + // Local times, as the buyer's clock reads them. + const lastEvening = new Date(2026, 11, 31, 23, 59, 59).getTime(); + const firstMorning = new Date(2027, 0, 1, 0, 0, 0).getTime(); + + const during = P.price(new Date(2026, 10, 20, 12).getTime()); + assert.equal(during.label, "$24.99"); + assert.equal(during.regular, "$34.99"); + assert.equal(during.launch, true); + assert.deepEqual([during.lastDay.getFullYear(), during.lastDay.getMonth(), during.lastDay.getDate()], [2026, 11, 31]); + + assert.equal(P.price(lastEvening).label, "$24.99"); + assert.deepEqual(P.price(firstMorning), { label: "$34.99", regular: "$34.99", launch: false, lastDay: null }); + assert.equal(P.price(firstMorning + 90 * DAY).label, "$34.99"); +}); + +test("no launch price, or a broken one, quotes the full price", () => { + const saved = P.CONFIG.launch; + try { + for (const launch of [undefined, null, {}, { priceLabel: "$24.99" }, { priceLabel: "$24.99", until: "next year" }, { until: "2099-01-01" }]) { + P.CONFIG.launch = launch; + assert.deepEqual(P.price(T0), { label: "$34.99", regular: "$34.99", launch: false, lastDay: null }, JSON.stringify(launch)); + } + } finally { + P.CONFIG.launch = saved; + } +}); + test("the masked key shows the tail only", () => { assert.equal(P.maskKey("1C285B2D-6CE6-4BC7-B8BE-ADB6A7E304DA"), "****-E304DA"); assert.equal(P.maskKey("--"), "****");