efficient-storefront-blocks 0.65.0 → 0.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/README.md +0 -1
- package/dist/chunks/{EditorPreviewCheckout-4KZCYPQT.js → EditorPreviewCheckout-EXU5CRJ2.js} +1 -1
- package/dist/chunks/{SiteEditorProvider-ZYGNRWSB.js → SiteEditorProvider-KOPR3UDU.js} +1 -1
- package/dist/chunks/{chunk-I7BIOONR.js → chunk-S66TL4Z3.js} +1 -1
- package/dist/chunks/{chunk-YAO6XQYA.js → chunk-TAGGXC3A.js} +1 -1
- package/dist/chunks/{chunk-GR7OHU32.js → chunk-VWO54PMT.js} +1 -1
- package/dist/chunks/{chunk-OU2WWXMT.js → chunk-Z7PJKX2P.js} +1 -1
- package/dist/chunks/{fitment-data-IKFCBT6E.js → fitment-data-UQDOQP66.js} +1 -1
- package/dist/consent.js +1 -1
- package/dist/editor/components/CollectionPicker.js +1 -1
- package/dist/editor/components/EditProductLink.js +1 -1
- package/dist/editor/components/FormPicker.js +1 -1
- package/dist/editor/components/GalleryProductBinding.d.ts +1 -1
- package/dist/editor/components/GalleryProductBinding.js +1 -1
- package/dist/editor/components/GalleryShowcaseSource.d.ts +1 -1
- package/dist/editor/components/GalleryShowcaseSource.js +1 -1
- package/dist/editor/components/HeaderSettingsPanel.js +1 -1
- package/dist/editor/components/MenuLinkRangeField.js +1 -1
- package/dist/editor/components/PerViewStepperField.js +1 -1
- package/dist/editor/lib/puck/blocks/service/ContactRouting/fields.js +1 -1
- package/dist/editor/lib/puck/config.d.ts +0 -4
- package/dist/editor/lib/puck/config.js +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +2 -4
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/index.d.ts +0 -17
- package/dist/index.js +43 -43
- package/dist/render/app/globals.css +18 -4
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/ContactRouting.d.ts +11 -1
- package/dist/render/components/ContactRouting.js +1 -1
- package/dist/render/components/GalleryGrid.js +1 -1
- package/dist/render/components/GalleryItem.d.ts +1 -0
- package/dist/render/components/GalleryItem.js +1 -1
- package/dist/render/components/ProductGallery.js +1 -1
- package/dist/render/components/ProductGridSection.js +1 -1
- package/dist/render/components/fitment/FitmentPickerGrid.js +1 -1
- package/dist/render/components/fitment/PickerField.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicGalleryGrid.js +1 -1
- package/dist/render/lib/api/types.d.ts +1 -0
- package/dist/render/lib/consent/choice.d.ts +0 -2
- package/dist/render/lib/consent/choice.js +1 -1
- package/dist/render/lib/consent/rules.d.ts +0 -1
- package/dist/render/lib/consent/rules.js +1 -1
- package/dist/render/lib/content/source-values.d.ts +4 -0
- package/dist/render/lib/content/source-values.js +1 -0
- package/dist/render/lib/content/stock-words.d.ts +0 -4
- package/dist/render/lib/content/stock-words.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/GalleryItem/render.js +1 -1
- package/dist/render/lib/puck/blocks/text-part-shapes.json +6 -3
- package/dist/render/lib/sections/fill-row.d.ts +8 -0
- package/dist/render/lib/sections/fill-row.js +1 -1
- package/dist/render/lib/sections/grid-no-hole.d.ts +12 -0
- package/dist/render/lib/sections/grid-no-hole.js +1 -0
- package/dist/render/lib/wheels/catalog-filters-to-listing.d.ts +0 -1
- package/dist/render/lib/wheels/catalog-filters-to-listing.js +1 -1
- package/dist/render/lib/wheels/catalog-filters.d.ts +0 -1
- package/dist/render/lib/wheels/catalog-filters.js +1 -1
- package/dist/words.d.ts +3 -4
- package/dist/words.js +2 -2
- package/package.json +1 -1
- /package/dist/chunks/{chunk-B44XQA2J.js → chunk-IHYVLVY3.js} +0 -0
- /package/dist/chunks/{chunk-YAO6XQYA.js.LEGAL.txt → chunk-TAGGXC3A.js.LEGAL.txt} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
## 0.66.0 - 2026-10-26
|
|
6
|
+
|
|
7
|
+
**A major for hosts (major version zero, so a minor number):** the `mediaPlace` prop and the `MediaPlace` / `MediaPlacedFile` types are gone (#235). No peer range changes: `efficient-shell` `^9.1.0`, `efficient-easel` `^20.2.0`, `efficient-web-builder` `^40.1.0`; the package is built against efficient-web-builder 40.1.1. 0.65.1 was never published: its section below ships in this release.
|
|
8
|
+
|
|
9
|
+
- **A set card never leaves a hole in a Product Grid** (hartesmetal.com, 2026-10-26: "The FusionForge range", set to 3 and capped at 3, drew Hawkish, the two-place Stealth set card and Savage, so the second row stood 2 places empty; Lewis chose option C). A grid that shows a set card counts places, not cards: it packs dense (a single card moves up into a place a set card left), tops up from its source until the last row is full, and trims the short row when the source has no more. Each width works it out for its own columns; a set card is one place below 800px. A hand-picked grid reads its set cards once drawn and packs and trims only. A grid of single cards is unchanged. New `lib/sections/grid-no-hole`; `lib/sections/fill-row` shares its width bands (`gridBands`, `inBand`, `gridTracks`).
|
|
10
|
+
- Guards: new `scripts/test-grid-no-hole.tsx` (red first: 5 of 6 failed on the old grid) and `scripts/test-grid-no-hole-hand-picked.tsx`. `test-grid-fills-its-row` measures through the new shared `scripts/grid-drawn.ts`.
|
|
11
|
+
- **Fix: a gallery with a chosen wall layout draws its photos on the editor's canvas** (Lewis 2026-10-25, GG 2026-10-26: hartesmetal.com Home, "Vehicle gallery", layout threeAcross, drew its heading and an empty grid in the editor; the live page was right). The wall's height rule reached `.sf-gallery-zone > * > *`: on the page that is the tile, on the canvas it is the builder's part host, so the tile (one level deeper) had no height and its photo drew 0 high. The rule now names the tile by its role (`[data-gallery-tile]` and its own box) in `src/render/app/globals.css`, so a wrapper between the grid and the tile changes nothing. The published page draws the same.
|
|
12
|
+
- Guard: new `scripts/test-gallery-wall-tile-on-canvas.tsx` (red first: on main the canvas tile, and with the words below the photo the canvas tile's box, had no height; the page checks passed on both).
|
|
13
|
+
- **Breaking for hosts: the `mediaPlace` prop and the `MediaPlace` / `MediaPlacedFile` types are gone** (added in 0.61). They were the pick path for a file dragged from the admin portal's media popup onto the canvas. That popup is gone (efficient-admin-portal #2871, one Media Library window), no host passes `mediaPlace`, and no host drags a file out, so they had no user. A host that still passes `mediaPlace` gets a type error; remove the prop. `mediaPanel` is unchanged.
|
|
14
|
+
- Guard: new `scripts/test-no-media-place.ts` (red first: 19 lines in 4 package files).
|
|
15
|
+
- **Dead code out: 11 exports that nothing read** (duplicate re-check 2026-10-26, row X06). Each was named only where it was defined, in the blocks, the storefront, the admin portal, the builder and easel: `unitsInStock`, `setsInStock`, `pickupAt`, `pickupAtCount` (`lib/content/stock-words`); `getConsent`, `subscribeConsent` and the store's listener set (`lib/consent/choice`: `useConsent` reads the provider's context, not the store); `PANEL_HEADING` (`lib/consent/rules`); `HERO_SINGLE_PH` (editor `lib/puck/config`); `hasActiveFilters` (`lib/wheels/catalog-filters`); `UNMAPPABLE_FACET_LABELS` (`lib/wheels/catalog-filters-to-listing`). No page changes. Three phrases leave the editor's words (`words.public.d.ts`), because only the removed constants said them: "About us", "Main heading & *highlight*" (`HERO_SINGLE_PH`) and "Price from" (`UNMAPPABLE_FACET_LABELS`). A host's translation list may drop them. Guard: new `scripts/test-dead-exports-stay-gone.ts` (red first: 11 of 11).
|
|
16
|
+
- **Settings-panel controls are 32.** Medium now: the Collection card's "Edit category", the product link's "Edit product", the Form picker's "Edit form", "New form" and "Try again", the gallery card's show / hide eye, the Header panel's "Retry" and Border thickness box, the Menu's Show links From / To boxes, and the Columns stepper's − and +.
|
|
17
|
+
- **A Header panel strip fills its row.** `Field`'s control slot grows (`grow`, the content width as its basis, so the row still wraps first), and the strip, as wide as its slot, fills it in equal parts (easel 19.3.0 and later; main pins `^20.2.0`).
|
|
18
|
+
- Guards: new `scripts/test-panel-controls-medium.ts` runs the builder's `panel-controls-medium` rule over the blocks (red first: 16 small controls). `SwitchToBoxHeader` is named as not a settings panel: a notice banner, as the builder names its `SwitchToBoxFooter` twin. `scripts/test-panel-row-wraps.tsx` §3 (red first): the control slot grows and keeps its basis.
|
|
19
|
+
- No peer change: main already pins `efficient-shell` `^9.1.0` (the Slider's 32 typed box, `boxSize`, efficient-shell #620), `efficient-easel` `^20.2.0` and `efficient-web-builder` `^40.1.0`, which carry the parts this needs (harness FT-6; Lewis 2026-10-12).
|
|
20
|
+
- **The four car-picker cells are one height, and each says its text on one line** (Lewis, 2026-10-26, hartesmetal.com/wheels/stealth: the boxes were uneven). In the wheel page's 640px column at a 1440 window, "Pick a model first" (129px in Hartes' 17px face) had 126px, so the Year cell wrapped to 90px beside three 69px cells, and the grid's line colour showed as a 21px strip under them. Now every cell fills its grid row (`h-full`), its value never wraps (`truncate`, the whole text in its `title`), and the compact grid takes its columns from its own width (`@container`): 4 at 39rem or more, 2 at 20rem or more, else 1, so a hint is never cut. The compact cell's side padding is 12px (was 16px).
|
|
21
|
+
- Guard: new `scripts/test-picker-cells-even.tsx` (red first: 5 of 5 failed on the old cells). `test-wheel-page-phone-words` R07 now holds the 1-2-4 column steps instead of the wrap.
|
|
22
|
+
- **The words under a product's picture are one row on its bottom edge** (Lewis, 2026-10-26, hartesmetal.com/wheels/stealth: the captions were messy; he chose option A). The caption strip sat 20px in from the picture's edges, and its left slot (the size) was empty until a size was picked, so "FusionForge · 1-piece" hung alone at the right; "Pick your vehicle to see every angle" was a line of its own under the frame, at another edge. Now the strip lies flush on the picture's bottom, left and right edges, like the title row on its top edge. Its left column holds the size, then the reference note ("this picture is another size"), then the hint, each only when there is one; the origin stays on the right. A phone keeps the strip as its own row under the picture.
|
|
23
|
+
- Guard: new `scripts/test-hero-caption-strip.tsx` (red first: 3 of 4 failed on the old strip; §4, the presence control, passed on both). `test-render-fallback-note` §3 and `test-product-hero-angles-hint` §5 read the strip. `test-data-bound-blocks` §1 applies this change, named, to its frozen markup (`SINCE_CAPTURE`), including the tyre drawing's `useId` that moves with it.
|
|
24
|
+
- **Fix: a ContactRouting channel can be typed, a new one and an existing one's Sub line** (found 2026-10-23 on hartesmetal.com /contact). It reads the builder's `PART_ROW_ATTR` and its row-panel fix for the Label, Value, Link and Sub line boxes (efficient-web-builder#279), which the `^40.1.0` peer on main already includes.
|
|
25
|
+
- While editing, an empty Label, Value or Sub line draws its hint word (`CHANNEL_HINTS`, the row fields' placeholders), so a channel added with "+ Add item" has something to click. A published page draws no hint.
|
|
26
|
+
- Each channel row, in the rail and in the phone list, declares its row (`PART_ROW_ATTR`, while editing), so a repeated string ("Detail · Detail", inboxes that share one address) opens its own channel.
|
|
27
|
+
- **Fix: a gallery card's vehicle line is the car its photos show, never the media group's name** (found 2026-10-23 on inovit.com Home: every lightbox said "Vehicle: All Relative / Lifestyle Photos").
|
|
28
|
+
- New `mediaGroupVehicle(group)` (`src/render/lib/content/source-values.ts`) reads `MediaGroup.vehicle`, which the backend serves and the contract now declares (`src/render/lib/api/types.ts`, from efficient-storefront `openapi.yml`). Gallery Item (product binding), Gallery A (`GalleryShowcaseSource`) and the product-page grid (`DynamicGalleryGrid`) all read it.
|
|
29
|
+
- A bound Gallery Item snapshots `vehicle` and no longer reads `eyebrow`, which held the group's name. So a card stored before this fix draws no vehicle line until its media group is picked again. The panel row reads "Vehicle (from media group)".
|
|
30
|
+
- Guard: new `scripts/test-contact-rows-and-gallery-vehicle.tsx` (red first: 21 checks failed on main with the new builder).
|
|
31
|
+
|
|
32
|
+
## 0.65.1 - 2026-10-25
|
|
33
|
+
|
|
34
|
+
**A patch for hosts:** no export or peer range changes, and one optional field (`photosOnly` on `GalleryLinksContext`). One phrase is new to translate (`efficient-storefront-blocks/words`): the builder's "Image — set a path", which efficient-web-builder 40.1.1 says in the editor only.
|
|
35
|
+
|
|
36
|
+
- This repository installs `efficient-web-builder` 40.1.1 (devDependency `^40.1.1`; the peer stays `^40.1.0`), so the storefront can move to it with the blocks' pin (its doc/adr/0011). `package/src/words.public.d.ts` lists the builder's new phrase.
|
|
37
|
+
- Guards follow the builder: `test-image-block-container-width` and `test-image-block-link` draw the empty Image in the editor (a published page draws nothing for it now); `test-logo-block` reads the neutral wordmark "Website"; `test-shell-peer-range` holds the dev range `^40.1.1`.
|
|
38
|
+
- **A gallery photo opens as a photo where there is no build to speak of** (a venue's website, 2026-10-25: a person's photo opened the wheel shop's build popup, her name as the "Wheel" and the "Vehicle", with "View product", "See more builds" and "Submit your build"). On a site that does not sell (`useSiteSells()`), and for a record's pictures on any site (a person, a room: new optional `photosOnly` on `GalleryLinksContext`, set by the dynamic grid), the popup is the photo, its name and its own caption lines, each once, with no spec rows, no links and no "on"; a photo with no words fills the popup alone. Its tile and dialog are called "Open photo of <name>". A selling site's build popup is unchanged.
|
|
39
|
+
- **"See Gallery" leads only to a page there is.** A record's pictures draw none (its page is their whole gallery); an authored gallery draws none on the page it links to, nor to the shop's `/gallery` on a site that does not sell.
|
|
40
|
+
- A record's picture no longer repeats the record's name as its caption.
|
|
41
|
+
- Guard: new `scripts/test-gallery-photo-popup.tsx` (red first: 3 of 4 failed on the old popup). `test-block-sources` §5 reads the record grid's own marker instead of its "See Gallery".
|
|
42
|
+
|
|
3
43
|
## 0.65.0 - 2026-10-25
|
|
4
44
|
|
|
5
45
|
**A minor for hosts:** no export, prop or peer range changes; a site that sells nothing says less. Three phrases are new to translate (`efficient-storefront-blocks/words`), the consent panel's: "Cart, checkout, your country and currency, sign-in, and this choice. The site cannot work without them." (it said "The shop"), "What the site needs to work, such as remembering this choice. The site cannot work without them." and "Google Ads and Meta (Facebook, Instagram) tags, which measure our ads.".
|
package/README.md
CHANGED
|
@@ -182,7 +182,6 @@ panel. Everything round it is the host's, as it is the admin portal's
|
|
|
182
182
|
| The token, and a fresh one when it runs out | It sends `storefront-editor:ready`, and `storefront-editor:auth-expired` when a call is refused; answer each with `deliver({ type: "storefront-editor:auth", token, siteId })` |
|
|
183
183
|
| A window to mount it in, and its address | `createEditorHost({ address })`: `search`, `show`, `load`, `reload`; it sends `storefront-editor:navigated` when it moves to another page |
|
|
184
184
|
| A media library | the `mediaPanel` prop (`MediaPanelComponent`, drawn once as the editor's popup: open while `pick` or `browsing` is set, closed by `onClose`). Without one, each image field sends `storefront-editor:open-media-picker`; answer with `storefront-editor:media-picked` or `storefront-editor:media-pick-cancelled` |
|
|
185
|
-
| A picture dropped from that popup | the `mediaPlace` prop (`MediaPlace`): what the file becomes on this host before the editor places it (its pick path). Without one, the file as it came |
|
|
186
185
|
| The page list's settings screen, and the new-page flow | `storefront-editor:open-page` (`slug`) and `storefront-editor:new-page`. The new-page flow is where a page is made blank or from the website's template library (`GET /api/storefront/pages/template-library/`, `POST /api/storefront/pages/from-template/`) |
|
|
187
186
|
| Menus | `storefront-editor:open-menus` (`menuId`); tell the editor with `storefront-editor:menus-updated` when one was saved |
|
|
188
187
|
| Forms, and the inbox of what was sent | `storefront-editor:open-form` (`mode: "create"` with a `requestId`, or `"edit"` with a `formId`); answer a create with `storefront-editor:form-saved` or `storefront-editor:form-closed` |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";import{$ as zt,K as qt,L as _t,M as Dt,N as Ft,O as Mt,P as ie,R as we,S as Ut,T as Wt,U as Ze,V as $t,X as Qe,Z as Kt,_ as Yt,a as Lt,b as Ot,c as Tt,d as jt,ea as Bt,ja as Ht,ka as Gt,na as et,pa as K,w as _e}from"./chunk-
|
|
1
|
+
"use client";import{$ as zt,K as qt,L as _t,M as Dt,N as Ft,O as Mt,P as ie,R as we,S as Ut,T as Wt,U as Ze,V as $t,X as Qe,Z as Kt,_ as Yt,a as Lt,b as Ot,c as Tt,d as jt,ea as Bt,ja as Ht,ka as Gt,na as et,pa as K,w as _e}from"./chunk-VWO54PMT.js";import{i as qe,o as de,v as T}from"./chunk-Z7PJKX2P.js";import{a as Rt,c as ne,za as It}from"./chunk-S66TL4Z3.js";import{k as At,l as Se,m as H}from"./chunk-IHYVLVY3.js";import{a as Xe,b as ir}from"./chunk-Y6SLVHK3.js";var Jt=Xe((ra,Vt)=>{"use strict";var sr="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Vt.exports=sr});var en=Xe((aa,Qt)=>{"use strict";var cr=Jt();function Xt(){}function Zt(){}Zt.resetWarningCache=Xt;Qt.exports=function(){function t(a,o,s,l,d,p){if(p!==cr){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:Zt,resetWarningCache:Xt};return n.PropTypes=n,n}});var nn=Xe((sa,tn)=>{"use strict";tn.exports=en()();var oa,ia});import{useEffect as z,useMemo as ze,useRef as ce,useState as g}from"react";var N=ir(nn(),1);import x from"react";function rn(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,a=Array(e);n<e;n++)a[n]=t[n];return a}function lr(t){if(Array.isArray(t))return t}function ln(t,e,n){return(e=gr(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ur(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var a,o,s,l,d=[],p=!0,u=!1;try{if(s=(n=n.call(t)).next,e!==0)for(;!(p=(a=s.call(n)).done)&&(d.push(a.value),d.length!==e);p=!0);}catch(v){u=!0,o=v}finally{try{if(!p&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw o}}return d}}function pr(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function an(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,a)}return n}function on(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?an(Object(n),!0).forEach(function(a){ln(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):an(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function dr(t,e){if(t==null)return{};var n,a,o=mr(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(a=0;a<s.length;a++)n=s[a],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function mr(t,e){if(t==null)return{};var n={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;n[a]=t[a]}return n}function un(t,e){return lr(t)||ur(t,e)||yr(t,e)||pr()}function fr(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var a=n.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function gr(t){var e=fr(t,"string");return typeof e=="symbol"?e:e+""}function tt(t){"@babel/helpers - typeof";return tt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tt(t)}function yr(t,e){if(t){if(typeof t=="string")return rn(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rn(t,e):void 0}}var j=function(e,n,a){var o=!!a,s=x.useRef(a);x.useEffect(function(){s.current=a},[a]),x.useEffect(function(){if(!o||!e)return function(){};var l=function(){if(s.current)return s.current.apply(s,arguments)};return e.on(n,l),function(){e.off(n,l)}},[o,n,e,s])},nt=function(e){var n=x.useRef(e);return x.useEffect(function(){n.current=e},[e]),n.current},me=function(e){return e!==null&&tt(e)==="object"},hr=function(e){return me(e)&&typeof e.then=="function"},vr=function(e){return me(e)&&typeof e.elements=="function"&&typeof e.createToken=="function"&&typeof e.createPaymentMethod=="function"&&typeof e.confirmCardPayment=="function"},sn="[object Object]",br=function t(e,n){if(e===n)return!0;if(!me(e)||!me(n))return e===n;var a=Array.isArray(e),o=Array.isArray(n);if(a!==o)return!1;var s=Object.prototype.toString.call(e)===sn,l=Object.prototype.toString.call(n)===sn;if(s!==l)return!1;if(!s&&!a)return e===n;var d=Object.keys(e),p=Object.keys(n);if(d.length!==p.length)return!1;for(var u={},v=0;v<d.length;v+=1)u[d[v]]=!0;for(var b=0;b<p.length;b+=1)u[p[b]]=!0;var f=Object.keys(u);if(f.length!==d.length)return!1;var y=e,A=n,k=function(S){return t(y[S],A[S])};return f.every(k)},pn=function(e,n,a){return me(e)?Object.keys(e).reduce(function(o,s){var l=!me(n)||!br(e[s],n[s]);return a.includes(s)?(l&&console.warn("Unsupported prop change: options.".concat(s," is not a mutable property.")),o):l?on(on({},o||{}),{},ln({},s,e[s])):o},null):null},dn="Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",cn=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:dn;if(e===null||vr(e))return e;throw new Error(n)},xr=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:dn;if(hr(e))return{tag:"async",stripePromise:Promise.resolve(e).then(function(o){return cn(o,n)})};var a=cn(e,n);return a===null?{tag:"empty"}:{tag:"sync",stripe:a}},kr=function(e){!e||!e._registerWrapper||!e.registerAppInfo||(e._registerWrapper({name:"react-stripe-js",version:"6.12.0"}),e.registerAppInfo({name:"react-stripe-js",version:"6.12.0",url:"https://stripe.com/docs/stripe-js/react"}))},De=x.createContext(null);De.displayName="ElementsContext";var mn=function(e,n){if(!e)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(n," in an <Elements> provider."));return e},at=function(e){var n=e.stripe,a=e.options,o=e.children,s=x.useMemo(function(){return xr(n)},[n]),l=x.useState(function(){return{stripe:s.tag==="sync"?s.stripe:null,elements:s.tag==="sync"?s.stripe.elements(a):null}}),d=un(l,2),p=d[0],u=d[1];x.useEffect(function(){var f=!0,y=function(k){u(function(C){return C.stripe?C:{stripe:k,elements:k.elements(a)}})};return s.tag==="async"&&!p.stripe?s.stripePromise.then(function(A){A&&f&&y(A)}):s.tag==="sync"&&!p.stripe&&y(s.stripe),function(){f=!1}},[s,p,a]);var v=nt(n);x.useEffect(function(){v!==null&&v!==n&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[v,n]);var b=nt(a);return x.useEffect(function(){if(p.elements){var f=pn(a,b,["clientSecret","fonts"]);f&&p.elements.update(f)}},[a,b,p.elements]),x.useEffect(function(){kr(p.stripe)},[p.stripe]),x.createElement(De.Provider,{value:p},o)};at.propTypes={stripe:N.default.any,options:N.default.object};var fn=function(e){var n=x.useContext(De);return mn(n,e)},gn=function(){var e=fn("calls useElements()"),n=e.elements;return n},Cr=function(e){var n=e.children,a=fn("mounts <ElementsConsumer>");return n(a)};Cr.propTypes={children:N.default.func.isRequired};var Sr=x.createContext(null);Sr.displayName="CheckoutContext";var yn=x.createContext(null);yn.displayName="CheckoutSdkContext";var rt=function(e){var n=x.useContext(yn),a=x.useContext(De);if(n){if(a)throw new Error("You cannot wrap the part of your app that ".concat(e," in both a checkout provider and <Elements> provider."));return n}else return mn(a,e)},wr=["mode"],Pr=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},E=function(e,n,a){var o="".concat(Pr(e),"Element"),s=function(u){var v=u.id,b=u.className,f=u.options,y=f===void 0?{}:f,A=u.onBlur,k=u.onFocus,C=u.onReady,S=u.onChange,F=u.onEscape,O=u.onClick,X=u.onLoadError,G=u.onLoaderStart,fe=u.onNetworksChange,re=u.onConfirm,Ee=u.onCancel,ae=u.onShippingAddressChange,Re=u.onShippingRateChange,ge=u.onSavedPaymentMethodRemove,Ie=u.onSavedPaymentMethodUpdate,ye=u.onAvailablePaymentMethodsChange,ee=rt("mounts <".concat(o,">")),te="elements"in ee?ee.elements:null,M="checkoutSdk"in ee?ee.checkoutSdk:null,he=x.useState(null),le=un(he,2),I=le[0],ve=le[1],_=x.useRef(null),oe=x.useRef(null);j(I,"blur",A),j(I,"focus",k),j(I,"escape",F),j(I,"click",O),j(I,"loaderror",X),j(I,"loaderstart",G),j(I,"networkschange",fe),j(I,"confirm",re),j(I,"cancel",Ee),j(I,"shippingaddresschange",ae),j(I,"shippingratechange",Re),j(I,"savedpaymentmethodremove",ge),j(I,"savedpaymentmethodupdate",Ie),j(I,"availablepaymentmethodschange",ye),j(I,"change",S);var U;C&&(e==="expressCheckout"?U=C:U=function(){C(I)}),j(I,"ready",U),x.useLayoutEffect(function(){if(_.current===null&&oe.current!==null&&(te||M)){var w=null;if(M){var B=M,be=M;switch(e){case"paymentForm":w=be.createForm(y);break;case"payment":w=B.createPaymentElement(y);break;case"address":if("mode"in y){var xe=y.mode,He=dr(y,wr);if(xe==="shipping")w=B.createShippingAddressElement(He);else if(xe==="billing")w=B.createBillingAddressElement(He);else throw new Error("Invalid options.mode. mode must be 'billing' or 'shipping'.")}else throw new Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");break;case"expressCheckout":w=B.createExpressCheckoutElement(y);break;case"currencySelector":w=M.createCurrencySelectorElement();break;case"taxId":w=B.createTaxIdElement(y);break;case"contactDetails":w=B.createContactDetailsElement();break;case"linkSignup":if("createLinkSignupElement"in M)w=M.createLinkSignupElement(y);else throw new Error("<LinkSignupElement> requires <CheckoutElementsProvider> and is not supported inside <CheckoutFormProvider>.");break;case"terms":w=B.createTermsElement(y);break;default:throw new Error("<".concat(o,"> is not supported inside a checkout provider. Use an <Elements> provider instead."))}}else te&&(w=te.create(e,y));_.current=w,ve(w),w&&w.mount(oe.current)}},[te,M,y]);var ue=nt(y);return x.useEffect(function(){if(_.current){var w=pn(y,ue,["paymentRequest"]);w&&"update"in _.current&&_.current.update(w)}},[y,ue]),x.useLayoutEffect(function(){return function(){if(_.current&&typeof _.current.destroy=="function")try{_.current.destroy(),_.current=null}catch{}}},[]),x.createElement("div",{id:v,className:b,ref:oe})},l=function(u){rt("mounts <".concat(o,">"));var v=u.id,b=u.className;return x.createElement("div",{id:v,className:b})},d=n?l:s;return d.propTypes={id:N.default.string,className:N.default.string,onChange:N.default.func,onBlur:N.default.func,onFocus:N.default.func,onReady:N.default.func,onEscape:N.default.func,onClick:N.default.func,onLoadError:N.default.func,onLoaderStart:N.default.func,onNetworksChange:N.default.func,onConfirm:N.default.func,onCancel:N.default.func,onShippingAddressChange:N.default.func,onShippingRateChange:N.default.func,onSavedPaymentMethodRemove:N.default.func,onSavedPaymentMethodUpdate:N.default.func,onAvailablePaymentMethodsChange:N.default.func,options:N.default.object},d.displayName=o,d.__elementType=e,d},R=typeof window>"u",Nr=x.createContext(null);Nr.displayName="EmbeddedCheckoutProviderContext";var hn=function(){var e=rt("calls useStripe()"),n=e.stripe;return n},la=E("auBankAccount",R),ua=E("card",R),pa=E("cardNumber",R),da=E("cardExpiry",R),ma=E("cardCvc",R),fa=E("currencySelector",R),ga=E("iban",R),vn=E("payment",R),ya=E("expressCheckout",R),ha=E("paymentRequestButton",R),va=E("linkAuthentication",R),ba=E("linkSignup",R),xa=E("contactDetails",R),ka=E("address",R),Ca=E("shippingAddress",R),Sa=E("paymentMethodMessaging",R),wa=E("taxId",R),Pa=E("issuingCardNumberDisplay",R),Na=E("issuingCardCvcDisplay",R),Ea=E("issuingCardExpiryDisplay",R),Ra=E("issuingCardPinDisplay",R),Ia=E("issuingCardCopyButton",R),Aa=E("terms",R);function Ue(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ue=function(e){return typeof e}:Ue=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ue(t)}var kn="dahlia",Er=function(e){return e===3?"v3":e},Cn="https://js.stripe.com",Rr="".concat(Cn,"/").concat(kn,"/stripe.js"),Ir=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,Ar=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/,bn="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",Lr=function(e){return Ir.test(e)||Ar.test(e)},Or=function(){for(var e=document.querySelectorAll('script[src^="'.concat(Cn,'"]')),n=0;n<e.length;n++){var a=e[n];if(Lr(a.src))return a}return null},xn=function(e){var n=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",a=document.createElement("script");a.src="".concat(Rr).concat(n);var o=document.head||document.body;if(!o)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return o.appendChild(a),a},Tr=function(e,n){!e||!e._registerWrapper||e._registerWrapper({name:"stripe-js",version:"9.17.0",startTime:n})},Pe=null,Fe=null,Me=null,jr=function(e){return function(n){e(new Error("Failed to load Stripe.js",{cause:n}))}},qr=function(e,n){return function(){window.Stripe?e(window.Stripe):n(new Error("Stripe.js not available"))}},_r=function(e){return Pe!==null?Pe:(Pe=new Promise(function(n,a){if(typeof window>"u"||typeof document>"u"){n(null);return}if(window.Stripe&&e&&console.warn(bn),window.Stripe){n(window.Stripe);return}try{var o=Or();if(o&&e)console.warn(bn);else if(!o)o=xn(e);else if(o&&Me!==null&&Fe!==null){var s;o.removeEventListener("load",Me),o.removeEventListener("error",Fe),(s=o.parentNode)===null||s===void 0||s.removeChild(o),o=xn(e)}Me=qr(n,a),Fe=jr(a),o.addEventListener("load",Me),o.addEventListener("error",Fe)}catch(l){a(l);return}}),Pe.catch(function(n){return Pe=null,Promise.reject(n)}))},Dr=function(e,n,a){if(e===null)return null;var o=n[0];if(typeof o!="string")throw new Error("Expected publishable key to be of type string, got type ".concat(Ue(o)," instead."));var s=o.match(/^pk_test/),l=Er(e.version),d=kn;s&&l!==d&&console.warn("Stripe.js@".concat(l," was loaded on the page, but @stripe/stripe-js@").concat("9.17.0"," expected Stripe.js@").concat(d,". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));var p=e.apply(void 0,n);return Tr(p,a),p},Ne,Sn=!1,wn=function(){return Ne||(Ne=_r(null).catch(function(e){return Ne=null,Promise.reject(e)}),Ne)};Promise.resolve().then(function(){return wn()}).catch(function(t){Sn||console.warn(t)});var Pn=function(){for(var e=arguments.length,n=new Array(e),a=0;a<e;a++)n[a]=arguments[a];Sn=!0;var o=Date.now();return wn().then(function(s){return Dr(s,n,o)})};var Fr="sf:gclid",Mr="sf:fbclid",Ur=2160*60*60*1e3;function Rn(){return typeof window<"u"}function Nn(t){let e=Se.getItem(t);if(!e)return"";try{let{v:n,t:a}=JSON.parse(e);return!n||typeof a!="number"||Date.now()-a>Ur?"":n}catch{return""}}function En(t){if(!Rn())return"";let e=t.replace(/([.$?*|{}()[\]\\/+^])/g,"\\$1"),n=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return n?decodeURIComponent(n[1]):""}function In(){if(!Rn())return{};let t=Nn(Fr),e=Nn(Mr),n=En("_fbp"),a=En("_fbc");!a&&e&&(a=`fb.1.${Date.now()}.${e}`);let o={};return t&&(o.gclid=t),e&&(o.fbclid=e),n&&(o.fbp=n),a&&(o.fbc=a),o}var An="sf:meta-purchases",Wr=20;function On(){return typeof window>"u"||window.parent!==window}function $r(...t){try{if(On()||typeof window.fbq!="function")return;window.fbq(...t)}catch{}}var Ln=new Set;function Kr(t){if(Ln.has(t))return!1;Ln.add(t);try{let e=JSON.parse(Se.getItem(An)??"[]");if(e.includes(t))return!1;Se.setItem(An,JSON.stringify([...e,t].slice(-Wr)))}catch{}return!0}function Yr(t){return[...new Set(t.filter(we).flatMap(e=>e.components.map(n=>n.partNumber)))]}function Tn(t){let e=t.confirmation;On()||!Kr(e.orderNumber)||$r("track","Purchase",{value:Number(e.grandTotal),currency:e.currency,content_type:"product",content_ids:Yr(t.lines)},{eventID:e.orderNumber})}var ot="checkout-afterpay-context",We="checkout-gocardless-context",it="checkout-zip-context",$e="checkout-klarna-context";function zr({evidence:t,parked:e}){return t?{action:"capture",evidence:t,parked:e}:e?{action:"settle",parked:e}:{action:"ignore"}}function Br(t,e){let n=t.getItem(e);if(t.removeItem(e),!n)return null;try{return JSON.parse(n)}catch{return null}}var jn={name:"Afterpay",legParam:"afterpay",legValues:["confirm","cancel"],storageKey:ot,evidenceFrom(t,e){return e==="cancel"||(t.get("status")??"").toUpperCase()==="CANCELLED"?null:t.get("orderToken")},requestFrom:t=>({token:t})},qn={name:"Zip",legParam:"zip",legValues:["return"],storageKey:it,evidenceFrom(t){let e=(t.get("result")??"").toLowerCase();return e==="cancelled"||e==="declined"?null:t.get("checkoutId")},requestFrom:t=>({checkoutId:t})};async function st(t,e){let n=new URLSearchParams(e.search),a=n.get(t.legParam);if(!a||!t.legValues.includes(a))return;let o=Br(e.storage,t.storageKey),s=t.evidenceFrom(n,a);e.scrubQuery();let l=zr({evidence:s,parked:o});if(l.action!=="ignore"){if(e.page.clearCart(),l.action==="settle"){e.page.note(`The ${t.name} payment was not completed \u2014 our team will follow up on payment.`),e.page.land(l.parked.confirmation);return}e.page.setConfirming(!0);try{let d=await e.capture(t.requestFrom(l.evidence));d.status==="paid"?e.page.markPaid():e.page.note(`${t.name} declined the payment \u2014 our team will follow up on payment.`),e.page.land(l.parked?.confirmation??d)}catch{l.parked?(e.page.note(`We could not confirm the ${t.name} payment \u2014 our team will follow up on payment.`),e.page.land(l.parked.confirmation)):e.page.fail(`We could not confirm your ${t.name} payment. Please contact us before trying again \u2014 your payment may already have been taken.`)}finally{e.page.setConfirming(!1)}}}import{Fragment as q,jsx as r,jsxs as c}from"react/jsx-runtime";function _n(t){let e=t.indexOf(`
|
|
3
3
|
`);return e===-1?[t,""]:[t.slice(0,e),t.slice(e+1)]}function Dn(t,{canParkContext:e}={canParkContext:!0}){let n=t.paymentMethods,a=[];return n.includes("card")&&a.push({key:"card",title:"Card",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"VISA \xB7 MC \xB7 AMEX"})}),n.includes("paypal")&&t.paypalClientId&&a.push({key:"paypal",title:"PayPal",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAYPAL \xB7 CARDS"})}),n.includes("afterpay")&&a.push({key:"afterpay",title:"Afterpay",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"4 \xD7 INTEREST-FREE"})}),n.includes("square")&&t.squareApplicationId&&t.squareLocationId&&a.push({key:"square",title:"Card (Square)",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"VISA \xB7 MC \xB7 AMEX"})}),n.includes("gocardless")&&e&&a.push({key:"gocardless",title:"Bank Direct Debit",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY BY BANK"})}),n.includes("zip")&&a.push({key:"zip",title:"Zip",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY IN 4"})}),n.includes("klarna")&&e&&a.push({key:"klarna",title:"Klarna",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY LATER"})}),a.push({key:"bank",title:"Bank transfer",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Invoiced"})}),a}function ut({site:t,logo:e,preview:n=!1}){let{items:a,totals:o,coupon:s,refuseCoupon:l,deliveryOptions:d,shippingMethodId:p,setShippingMethodId:u,identify:v,clearCapturedCart:b}=Ze(),f=d.find(i=>i.id===p)?.pickupLocation??null,{country:y,countries:A,activeCountry:k,formatMoney:C}=ie(),[S,F]=g(()=>Dn(t)[0].key),[O,X]=g(!0);z(()=>{X(At(H))},[]);let[G,fe]=g(!1),[re,Ee]=g(""),[ae,Re]=g(""),[ge,Ie]=g(""),[ye,ee]=g(""),[te,M]=g(""),[he,le]=g(""),[I,ve]=g(""),[_,oe]=g(""),[U,ue]=g(()=>y||A[0]?.code||""),[w,B]=g(""),[be,xe]=g([]),$n=ze(()=>A.find(i=>i.code===U)??k,[A,U,k])?.postalLabel||"Postal Code",Kn=be[0]?.divisionType||"State / Province";z(()=>{if(!U){xe([]);return}let i=!1;return T.listCountrySubdivisions(U).then(m=>{i||(xe(m),B(""))}),()=>{i=!0}},[U]);let[Z,pt]=g(null),[dt,mt]=g([]),[Ae,Le]=g("new"),[Ge,ft]=g(!1),[gt,Yn]=g("Home"),[yt,ht]=g(null),[W]=g(()=>Gt()),[Oe,$]=g(null),[vt,ke]=g(null),[bt,zn]=g(null),[Bn,Hn]=g(!1),[Gn,Vn]=g(!1),[V,Ve]=g(null),[xt,pe]=g(!1),[kt,Q]=g(null),[Jn,Xn]=g(!1),[Zn,Ct]=g(!1),[Qn,er]=g(!1),[tr,St]=g(!1),wt=ce(!1);z(()=>{n||wt.current||!a.some(we)||(wt.current=!0,qt({lines:a,currency:o.currency,value:o.subtotal-o.discount,coupon:s?.valid?s.code:void 0}))},[a,o,s,n]),z(()=>{v(re,ae.trim()||void 0)},[re,ae,v]);let Pt=ce(null),[Te,nr]=g(null);z(()=>{let i=Pt.current;if(!Te||!i)return;let m=()=>i.style.setProperty("--sf-checkout-header-h",`${Te.offsetHeight}px`);m();let h=new ResizeObserver(m);return h.observe(Te),()=>h.disconnect()},[Te]),z(()=>{let i=h=>({setConfirming:h,land:$,markPaid:()=>pe(!0),note:Q,fail:ke,clearCart:b}),m={search:window.location.search,storage:H,scrubQuery:()=>window.history.replaceState(null,"",window.location.pathname)};st(jn,{...m,capture:T.captureAfterpayPayment,page:i(Xn)}),st(qn,{...m,capture:T.captureZipPayment,page:i(er)})},[]),z(()=>{let m=new URLSearchParams(window.location.search).get("gocardless");if(m!=="confirm"&&m!=="cancel")return;let h=H.getItem(We);if(H.removeItem(We),window.history.replaceState(null,"",window.location.pathname),!h)return;let L;try{L=JSON.parse(h)}catch{return}if(b(),m==="cancel"){Q("The direct debit was not set up \u2014 our team will follow up on payment."),$(L.confirmation);return}Ct(!0),T.completeGocardlessPayment({idempotencyKey:L.idempotencyKey}).then(P=>{P.status==="paid"?pe(!0):P.status==="declined"?Q("The direct debit was declined \u2014 our team will follow up on payment."):Q("Your direct debit is set up \u2014 the payment is collecting and will clear in a few days.")}).catch(()=>{Q("We could not confirm the direct debit \u2014 our team will follow up on payment.")}).finally(()=>{$(L.confirmation),Ct(!1)})},[]),z(()=>{let i=new URLSearchParams(window.location.search),m=i.get("klarna");if(m!=="confirm"&&m!=="cancel")return;let h=H.getItem($e);H.removeItem($e);let L=i.get("authorization_token");if(window.history.replaceState(null,"",window.location.pathname),!h)return;let P;try{P=JSON.parse(h)}catch{return}if(b(),m==="cancel"||!L){Q("The Klarna payment was not completed \u2014 our team will follow up on payment."),$(P.confirmation);return}St(!0),T.captureKlarnaPayment({idempotencyKey:P.idempotencyKey,authorizationToken:L}).then(D=>{D.status==="paid"?pe(!0):D.status==="declined"?Q("Klarna declined the payment \u2014 our team will follow up on payment."):Q("Your Klarna payment is being reviewed \u2014 we'll confirm the outcome shortly.")}).catch(()=>{Q("We could not confirm the Klarna payment \u2014 our team will follow up on payment.")}).finally(()=>{$(P.confirmation),St(!1)})},[]);function Nt(i){let[m,h]=_n(i.address);ee(m),M(h),le(i.city),ve(i.zip_code),i.country&&ue(i.country),i.phone&&oe(i.phone)}z(()=>{let i=!1;return(async()=>{try{let[m,h,L]=await Promise.all([de.me(),de.myProfile().catch(()=>null),de.myAddresses().catch(()=>[])]);if(i)return;pt(m);let P=L.filter(Ce=>Ce.is_active);mt(P),Ee(m.email);let D=(h?.contact_name??"").split(/\s+/);Re(m.first_name||D[0]||""),Ie(m.last_name||D.slice(1).join(" "));let J=m.phone||h?.phone;J&&oe(J);let Je=P.find(Ce=>Ce.id===m.default_delivery_location)??P[0];if(Je)Le(Je.id),Nt(Je);else if(h){let[Ce,or]=_n(h.address??"");ee(Ce),M(or),le(h.city??""),ve(h.zip_code??""),h.country&&ue(h.country)}}catch{}})(),()=>{i=!0}},[]);function rr(){de.logout(),pt(null),mt([]),Le("new"),ft(!1)}let je=ze(()=>Dn(t,{canParkContext:O}),[t,O]);z(()=>{je.some(i=>i.key===S)||F(je[0].key)},[je,S]);let Et=te.trim()?`${ye}
|
|
4
4
|
${te.trim()}`:ye;async function ar(){if(n||G||a.length===0||o.repricing)return;let i=a.filter(we).flatMap(m=>jt(m.components,m.qty));if(i.length===0){ke("Pick a size on each wheel's product page before checking out.");return}fe(!0),ke(null);try{let m=Z?T.createOrderAuthed:T.createOrder,h=Ht(),L=await m({customer:{email:re,name:`${ae} ${ge}`.trim(),phone:_.trim()||void 0,address:Et,city:he,state:w||void 0,zipCode:I,country:U},items:i,currency:o.currency,idempotencyKey:W,shippingMethodId:p??void 0,couponCode:Ot(s),...h==="denied"?{}:In(),...h?{adConsent:h}:{}});if(_t({confirmation:L,lines:a,adsSendTo:t.googleAdsId&&t.googleAdsConversionLabel?`${t.googleAdsId}/${t.googleAdsConversionLabel}`:null}),Tn({confirmation:L,lines:a}),b(),Z&&Ge&&Ae==="new")try{await de.createAddress({label:gt.trim()||"Home",contact_name:`${ae} ${ge}`.trim(),phone:_.trim(),address:Et,city:he,zip_code:I,country:U}),ht("Address saved to your account.")}catch{ht("We couldn't save the address to your account \u2014 you can add it under Account \u2192 Addresses.")}if(S==="card"&&t.paymentMethods.includes("card")){let P=await T.createPaymentIntent({idempotencyKey:W});Ve(L),zn(P)}else if(S==="paypal"&&t.paymentMethods.includes("paypal"))Ve(L),Hn(!0);else if(S==="afterpay"&&t.paymentMethods.includes("afterpay")){let P=window.location.origin,D=await T.createAfterpayCheckout({idempotencyKey:W,confirmUrl:`${P}/checkout?afterpay=confirm`,cancelUrl:`${P}/checkout?afterpay=cancel`}),J={idempotencyKey:W,confirmation:L};H.setItem(ot,JSON.stringify(J)),window.location.assign(D.redirectCheckoutUrl);return}else if(S==="square"&&t.paymentMethods.includes("square"))Ve(L),Vn(!0);else if(S==="gocardless"&&t.paymentMethods.includes("gocardless")){let P=window.location.origin,D=await T.createGocardlessBillingRequest({idempotencyKey:W,confirmUrl:`${P}/checkout?gocardless=confirm`,cancelUrl:`${P}/checkout?gocardless=cancel`}),J={idempotencyKey:W,confirmation:L};H.setItem(We,JSON.stringify(J)),window.location.assign(D.authorisationUrl);return}else if(S==="zip"&&t.paymentMethods.includes("zip")){let P=window.location.origin,D=await T.createZipCheckout({idempotencyKey:W,redirectUrl:`${P}/checkout?zip=return`}),J={idempotencyKey:W,confirmation:L};H.setItem(it,JSON.stringify(J)),window.location.assign(D.redirectUrl);return}else if(S==="klarna"&&t.paymentMethods.includes("klarna")){let P=window.location.origin,D=await T.createKlarnaCheckout({idempotencyKey:W,confirmUrl:`${P}/checkout?klarna=confirm`,cancelUrl:`${P}/checkout?klarna=cancel`}),J={idempotencyKey:W,confirmation:L};H.setItem($e,JSON.stringify(J)),window.location.assign(D.redirectUrl);return}else $(L)}catch(m){let h=Tt(m);h?(l(h),ke(`${h} Your order has not been placed. Place it again to continue without the code.`)):ke(m instanceof qe?m.message:"Could not place the order. Please try again."),fe(!1)}}return Oe?c("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[r("h1",{className:"font-display text-3xl",children:xt?"Payment received":"Order received"}),c("p",{className:"text-fg-dim",children:[xt?c(q,{children:["Thank you \u2014 your payment for order"," ",r("span",{className:"font-mono text-fg",children:Oe.orderNumber})," has gone through."," "]}):c(q,{children:["Thank you \u2014 your order ",r("span",{className:"font-mono text-fg",children:Oe.orderNumber})," is being reviewed by our team."," "]}),Z?c(q,{children:["Track it under"," ",r(ne,{href:"/account/orders",className:"text-accent underline",children:"your orders"}),"."]}):r(q,{children:"We\u2019ve emailed you a link to set a password and track it."})]}),kt&&r("p",{className:"text-sm text-fg-dim",children:kt}),yt&&r("p",{className:"text-sm text-fg-dim",children:yt}),!Z&&c("p",{className:"text-sm text-fg-dim",children:["You can also"," ",r(ne,{href:`/track?order=${encodeURIComponent(Oe.orderNumber)}`,className:"text-accent underline",children:"track this order"})," ","anytime with just your order number and email \u2014 no password needed."]}),r(ne,{href:"/wheels",className:"mt-2 border-2 border-line px-6 py-3 font-mono text-[12px] uppercase tracking-[0.24em] hover:border-accent",children:"Continue browsing"})]}):Jn?c("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[r("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Afterpay \u2014 one moment."})]}):Zn?c("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[r("h1",{className:"font-display text-3xl",children:"Setting up your direct debit\u2026"}),r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Confirming with GoCardless \u2014 one moment."})]}):Qn?c("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[r("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Zip \u2014 one moment."})]}):tr?c("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[r("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Klarna \u2014 one moment."})]}):bt?r(Hr,{payment:bt,onPaid:()=>{pe(!0),$(V)},onSkip:()=>$(V)}):Bn&&V?r(Jr,{confirmation:V,clientId:t.paypalClientId??"",idemKey:W,onPaid:()=>{pe(!0),$(V)},onSkip:()=>$(V)}):Gn&&V?r(Zr,{confirmation:V,applicationId:t.squareApplicationId??"",locationId:t.squareLocationId??"",environment:t.squareEnvironment??"production",idemKey:W,onPaid:()=>{pe(!0),$(V)},onSkip:()=>$(V)}):c("div",{ref:Pt,className:"bg-bg text-fg",children:[c("header",{ref:nr,className:"sticky top-0 z-30 grid grid-cols-[1fr_auto_1fr] items-center gap-8 border-b border-line px-[var(--sf-site-gutter,40px)] py-6 backdrop-blur-md max-[640px]:px-[min(20px,var(--sf-site-gutter,40px))] max-[640px]:py-4",style:{background:"color-mix(in oklab, var(--bg) 92%, transparent)"},children:[c(ne,{href:"/",className:"inline-flex items-center gap-3 font-mono text-[13px] uppercase tracking-[0.26em] text-fg-dim transition-colors hover:text-accent",children:["\u2190",r("span",{className:"max-[640px]:hidden",children:"Back to shop"})]}),r(ne,{href:"/","aria-label":`${t.name} home`,className:"inline-flex items-center justify-center",children:r(Kt,{variant:"header",scrolled:!0,src:e?.url??null,reverse:e?.reverse??!1,reversedSrc:e?.reversed??null,inkIsDark:e?.inkIsDark??null,size:e?.size??"medium",sizePx:e?.sizePx??null,siteName:t.name})}),t.cardPayments?c("span",{className:"flex items-center justify-end gap-3 font-mono text-[12px] uppercase tracking-[0.26em] text-fg-dim",children:[r("span",{className:"text-green",children:"\u25CF"}),r("span",{className:"max-[640px]:hidden",children:"Encrypted \xB7"})," Stripe"]}):r("span",{})]}),c("section",{className:"mx-auto flex max-w-[var(--sf-site-width,1600px)] flex-wrap items-center justify-between gap-x-8 gap-y-3 border-b border-line bg-surface px-[var(--sf-site-gutter,40px)] py-4 font-mono text-[13px] font-medium uppercase tracking-[0.24em] text-fg max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]",children:[r("span",{className:"inline-flex items-center bg-accent px-3 py-1 font-bold text-bg",children:"Checkout"}),r("nav",{"aria-label":"Checkout steps",className:"flex flex-wrap items-center gap-5",children:[{n:"01",label:"Cart",state:"done"},{n:"02",label:"Ship & pay",state:"active"},{n:"03",label:"Confirmed",state:"pending"}].map(i=>c("span",{className:["relative flex items-center gap-2 transition-colors",i.state==="pending"?"text-fg-dim":"text-fg",i.state==="active"?"font-bold after:absolute after:inset-x-0 after:-bottom-1 after:h-[2px] after:bg-accent":""].join(" "),children:[r("span",{className:i.state==="done"?"text-accent font-bold":"",children:i.n}),r("span",{children:i.label})]},i.n))})]}),c("main",{className:"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-[1fr_420px] items-start gap-16 px-[var(--sf-site-gutter,40px)] pt-10 pb-[100px] max-[1100px]:grid-cols-1 max-[1100px]:gap-10 max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[1100px]:pt-8 max-[1100px]:pb-20",children:[c("div",{children:[c(Ke,{num:"N\xB0 01",title:"Contact",children:[r(K,{label:"Email",hint:Z?c(q,{children:["Signed in \xB7"," ",r("button",{type:"button",onClick:rr,className:"underline transition-colors hover:text-accent",children:"Not you? Sign out"})]}):void 0,children:r("input",{type:"email",value:re,onChange:i=>Ee(i.target.value),placeholder:"you@example.com",readOnly:Z!==null,className:Y+(Z?" opacity-70":"")})}),c(Mn,{children:[r(K,{label:"First name",children:r("input",{type:"text",value:ae,onChange:i=>Re(i.target.value),className:Y})}),r(K,{label:"Last name",children:r("input",{type:"text",value:ge,onChange:i=>Ie(i.target.value),className:Y})})]})]}),c(Ke,{num:"N\xB0 02",title:f?"Collection":"Shipping address",children:[f?c("div",{className:"grid gap-2 text-[14px] leading-[1.6]",children:[r("span",{className:"font-medium",children:f.name}),[f.address,f.city,f.state,f.zipCode,f.country].filter(Boolean).length>0&&r("span",{className:"opacity-80",children:[f.address,f.city,f.state,f.zipCode,f.country].filter(Boolean).join(", ")}),f.openingHours&&r("span",{className:"opacity-80",children:f.openingHours}),f.instructions&&r("span",{className:"opacity-80",children:f.instructions}),r("span",{className:"mt-1 font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"No delivery address needed"})]}):c(q,{children:[Z!==null&&dt.length>0&&c("div",{className:"grid gap-3",children:[dt.map(i=>r(Ye,{active:Ae===i.id,onClick:()=>{Le(i.id),Nt(i)},title:i.label,body:i.formatted_address,price:null},i.id)),r(Ye,{active:Ae==="new",onClick:()=>Le("new"),title:"New address",body:null,price:null})]}),r(K,{label:"Address line 1",children:r("input",{type:"text",value:ye,onChange:i=>ee(i.target.value),className:Y})}),r(K,{label:"Address line 2",children:r("input",{type:"text",value:te,onChange:i=>M(i.target.value),placeholder:"Apartment, unit, garage bay\u2026",className:Y})}),c(Mn,{cols:"three",children:[r(K,{label:"City",children:r("input",{type:"text",value:he,onChange:i=>le(i.target.value),className:Y})}),r(K,{label:$n,children:r("input",{type:"text",value:I,onChange:i=>ve(i.target.value),className:Y})}),r(K,{label:"Country",separate:!0,children:r(et,{value:U,onChange:i=>ue(i.target.value),className:Y+" pr-10",style:Fn,children:A.map(i=>r("option",{value:i.code,children:i.name},i.code))})})]}),r(K,{label:Kn,separate:!0,children:be.length>0?c(et,{value:w,onChange:i=>B(i.target.value),className:Y+" pr-10",style:Fn,children:[r("option",{value:"",children:"Select\u2026"}),be.map(i=>r("option",{value:i.code||i.name,children:i.name},i.code||i.name))]}):r("input",{type:"text",value:w,onChange:i=>B(i.target.value),className:Y})})]}),r(K,{label:"Phone",children:r("input",{type:"tel",value:_,onChange:i=>oe(i.target.value),placeholder:"+44 7700 900000",className:Y})}),!f&&Z!==null&&Ae==="new"&&c(q,{children:[r(Qr,{checked:Ge,onChange:ft,label:"Save this address to my account"}),Ge&&r(K,{label:"Address label",children:r("input",{type:"text",value:gt,onChange:i=>Yn(i.target.value),placeholder:"Home",className:Y})})]})]}),r(Ke,{num:"N\xB0 03",title:"Shipping",children:c("div",{className:"grid gap-3",children:[d.map(i=>{let m=i.pickupLocation,h=m?[m.address,m.city,m.state,m.zipCode].filter(Boolean).join(", "):null;return r(Ye,{active:p===i.id,onClick:()=>u(i.id),title:m?`${i.name} \u2014 ${m.name}`:i.name,body:m?[h,m.openingHours,m.instructions,i.description].filter(Boolean).join(" \xB7 "):i.description||null,price:o.freeShipping||i.amount===0?_e:C(i.amount,o.currency),tag:i.tag||void 0},i.id)}),d.length===0&&r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Shipping is arranged after your order is reviewed."})]})}),c(Ke,{num:"N\xB0 04",title:"Payment",children:[r("div",{className:"grid gap-3",children:je.map(i=>r(Ye,{active:S===i.key,onClick:()=>F(i.key),title:i.title,body:i.body,price:i.price,tag:i.tag},i.key))}),S==="card"?r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll enter card details on the secure payment step after placing the order."}):S==="paypal"?r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll approve the payment with PayPal on the payment step after placing the order."}):S==="afterpay"?r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll be taken to Afterpay to approve four interest-free payments, then brought straight back."}):S==="square"?r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll enter card details on the secure payment step after placing the order."}):S==="gocardless"?r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll set up a bank direct debit with GoCardless, then be brought straight back. Direct debits clear in a few days."}):S==="zip"?r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll be taken to Zip to approve four instalments, then brought straight back."}):S==="klarna"?r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll be taken to Klarna to choose how to pay, then brought straight back."}):r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Our team emails you the invoice and bank details after review."})]})]}),c("aside",{className:"sticky top-[var(--sf-checkout-header-h,88px)] border border-line max-[1100px]:static",style:{background:"linear-gradient(180deg, color-mix(in oklab, var(--site-surface) 70%, var(--bg)) 0%, var(--bg) 100%)"},children:[c("header",{className:"flex items-center justify-between border-b border-accent bg-accent px-6 py-4 font-mono text-[13px] font-bold uppercase tracking-[0.28em] text-bg",children:[r("span",{children:"Your order"}),r(ne,{href:"/wheels",className:"text-bg/80 transition-colors hover:text-bg",children:"Edit \u2197"})]}),r("div",{className:"flex flex-col px-6 py-2",children:a.length===0?c("div",{className:"py-8 text-center font-serif text-[16px] italic leading-[1.5] text-fg-dim",children:["Your cart is empty. ",r(ne,{href:"/wheels",className:"text-accent underline-offset-4 hover:underline",children:"Browse the catalog \u2192"})]}):a.map(i=>r(ea,{slug:i.slug,name:i.name,qty:i.qty,config:i.config,configSummary:ta(i.config),price:Ut(i,o.currency)??0,currency:o.currency},i.id))}),r("div",{className:"border-t border-line px-6 pt-5",children:r(Bt,{customerEmail:re})}),c("div",{className:"flex flex-col gap-2 border-t border-line mt-5 px-6 pt-5",children:[r(se,{label:"Subtotal",value:C(o.subtotal,o.currency)}),o.discount>0&&s?.valid&&r(se,{label:`Coupon \xB7 ${s.code}`,value:c("span",{className:"font-semibold text-green",children:["\u2212 ",C(o.discount,o.currency)]})}),s?.deferred&&r(se,{label:`Coupon \xB7 ${s.code}`,value:Lt}),s?.valid&&s.effects?.gift&&r(se,{label:`Free gift \xB7 ${s.effects.gift.partNumber}${s.effects.gift.quantity>1?` \xD7${s.effects.gift.quantity}`:""}`,value:r("span",{className:"font-semibold text-green",children:_e})}),r(se,{label:"Shipping",value:o.shippingStatus==="free"?r("span",{className:"font-semibold text-green",children:_e}):Ft(o.shippingStatus)??C(o.shipping,o.currency)}),o.tax&&(o.tax.charged?r(se,{label:o.tax.inclusive?`${o.tax.name} included \xB7 ${o.tax.rate}%`:o.tax.name,value:C(o.tax.amount,o.currency)}):o.tax.name?r(se,{label:o.tax.name,value:Dt}):null)]}),c("div",{className:"mt-4 flex items-end justify-between border-y-2 border-accent px-6 py-4",style:{background:"color-mix(in oklab, var(--accent) 10%, var(--bg))"},children:[r("span",{className:"font-display text-[20px] font-bold uppercase tracking-[0.04em] text-fg",children:"Total"}),r("span",{className:"text-right font-display text-[34px] font-bold leading-none tracking-[-0.025em] text-fg",children:o.repricing?"\u2026":C(o.grand,o.currency)})]}),c("div",{className:"flex flex-col gap-3 px-6 pt-5 pb-6",children:[vt&&r("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:vt}),o.hasUnpricedLine&&c("p",{className:"border border-amber-300 bg-amber-50 px-3 py-2 text-[13px] text-amber-800",children:["One or more items have no price in ",o.currency,". Remove them, or switch region, to continue."]}),r("button",{type:"button",onClick:ar,disabled:G||a.length===0||o.hasUnpricedLine||o.repricing,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",a.length===0||G||o.hasUnpricedLine||o.repricing?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:G?c(q,{children:["Building order\u2026 ",r("span",{children:"\xB7"})]}):o.repricing?c(q,{children:["Updating total\u2026 ",r("span",{children:"\xB7"})]}):c(q,{children:[S==="bank"?"Place order":"Continue to payment"," \xB7"," ",C(o.grand,o.currency),r("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]})})]})]})]}),r("footer",{className:"flex flex-wrap items-center justify-between gap-4 border-t border-line px-[var(--sf-site-gutter,40px)] py-6 font-mono text-[12px] uppercase tracking-[0.22em] text-fg-dim max-[640px]:px-[min(20px,var(--sf-site-gutter,40px))]",children:r("span",{children:$t({legalName:t.legalName,foundedYear:t.foundedYear,siteName:t.name})})})]})}var Y="w-full border-2 border-line bg-bg px-4 py-4 font-display text-[17px] tracking-[-0.005em] text-fg outline-none transition-colors placeholder:text-fg-dim hover:border-fg-dim focus:border-accent",Fn={backgroundImage:"linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%)",backgroundPosition:"calc(100% - 18px) 50%, calc(100% - 12px) 50%",backgroundSize:"6px 6px",backgroundRepeat:"no-repeat"};function Ke({num:t,title:e,children:n}){return c("section",{className:"mb-6 border border-line bg-bg",children:[c("header",{className:"flex items-center gap-4 border-b border-line bg-surface px-6 py-4",children:[r("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:t}),r("h2",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:e})]}),r("div",{className:"flex flex-col gap-4 px-6 py-6",children:n})]})}function Mn({cols:t="two",children:e}){return r("div",{className:["grid gap-3 max-[640px]:grid-cols-1",t==="two"?"grid-cols-2":"grid-cols-[1.2fr_1fr_1fr]"].join(" "),children:e})}function Ye({active:t,onClick:e,title:n,body:a,price:o,tag:s}){return c("button",{type:"button",onClick:e,"aria-pressed":t,className:["relative grid grid-cols-[auto_1fr_auto] items-center gap-5 border bg-bg px-6 py-5 text-left transition-colors",t?"border-accent outline outline-1 outline-accent -outline-offset-1":"border-line hover:border-[color-mix(in_oklab,var(--accent)_50%,var(--site-line))]"].join(" "),style:t?{background:"color-mix(in oklab, var(--accent) 14%, var(--bg))"}:void 0,children:[t&&r("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),r("span",{className:["flex h-[18px] w-[18px] items-center justify-center rounded-full border-2",t?"border-accent":"border-fg-dim"].join(" "),children:t&&r("span",{className:"block h-2.5 w-2.5 rounded-full bg-accent"})}),c("span",{className:"flex min-w-0 flex-col gap-1",children:[c("span",{className:"flex flex-wrap items-baseline gap-3 font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:[n,s&&r("span",{className:"border px-2 py-0.5 font-mono text-[11px] font-normal uppercase tracking-[0.24em] text-accent",style:{background:"color-mix(in oklab, var(--accent) 14%, transparent)",borderColor:"color-mix(in oklab, var(--accent) 45%, var(--site-line))"},children:s})]}),a&&r("span",{className:"font-mono text-[12px] uppercase tracking-[0.22em] text-fg-dim",children:a})]}),r("span",{className:"whitespace-nowrap font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:o})]})}function Hr({payment:t,onPaid:e,onSkip:n}){let{formatMoney:a}=ie(),o=ze(()=>Pn(t.publishableKey),[t.publishableKey]),s=ze(()=>{if(typeof document>"u")return;let l=getComputedStyle(document.documentElement),d=(u,v)=>l.getPropertyValue(u).trim()||v,p=document.documentElement.getAttribute("data-theme")!=="light";return{theme:p?"night":"stripe",variables:{colorPrimary:d("--accent",p?"#c9a461":"#8a6a2a"),colorBackground:d("--site-surface",p?"#131313":"#ffffff"),colorText:d("--fg",p?"#f5f1e8":"#0a0a0a"),borderRadius:"0px"}}},[]);return r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:c("div",{className:"w-full max-w-xl border border-line bg-bg",children:[c("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[r("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:t.orderNumber}),r("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"Payment"})]}),c("div",{className:"flex flex-col gap-4 px-6 py-6",children:[c("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",r("span",{className:"text-fg",children:a(Number(t.amount),t.currency)})," ","by card to confirm it now."]}),r(at,{stripe:o,options:{clientSecret:t.clientSecret,appearance:s},children:r(Gr,{payment:t,onPaid:e,onSkip:n})})]})]})})}function Gr({payment:t,onPaid:e,onSkip:n}){let{formatMoney:a}=ie(),o=hn(),s=gn(),[l,d]=g(!1),[p,u]=g(null);async function v(){if(!o||!s||l)return;d(!0),u(null);let b=await o.confirmPayment({elements:s,redirect:"if_required"});if(b.error){u(b.error.message??"Payment failed. Please try again."),d(!1);return}let f=b.paymentIntent?.status;if(f==="succeeded"||f==="processing"){e();return}u("Payment did not complete. Please try again."),d(!1)}return c("div",{className:"flex flex-col gap-4",children:[r(vn,{}),p&&r("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:p}),r("button",{type:"button",onClick:v,disabled:!o||!s||l,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",!o||!s||l?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:l?c(q,{children:["Processing\u2026 ",r("span",{children:"\xB7"})]}):c(q,{children:["Pay ",a(Number(t.amount),t.currency),r("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]})}),r("button",{type:"button",onClick:n,disabled:l,className:"self-center font-mono text-[11px] uppercase tracking-[0.24em] text-fg-dim underline-offset-4 transition-colors hover:text-accent hover:underline",children:"Pay later \u2014 our team will be in touch"})]})}var Un="paypal-sdk-js",ct=null;function Vr(t,e){let n=`${t}|${e}`;if(ct?.key===n)return ct.promise;let a=new Promise((o,s)=>{document.getElementById(Un)?.remove();let l=document.createElement("script");l.id=Un;let d=new URLSearchParams({"client-id":t,currency:e,intent:"capture"});l.src=`https://www.paypal.com/sdk/js?${d}`,l.onload=()=>{let p=window.paypal;p?o(p):s(new Error("PayPal SDK loaded without its namespace"))},l.onerror=()=>s(new Error("PayPal SDK failed to load")),document.head.appendChild(l)});return ct={key:n,promise:a},a}function Jr({confirmation:t,clientId:e,idemKey:n,onPaid:a,onSkip:o}){let{formatMoney:s}=ie(),l=ce(null),[d,p]=g(!1),[u,v]=g(null),b=ce(a);return b.current=a,z(()=>{let f=!1,y=null;return Vr(e,t.currency).then(A=>{if(!(f||!l.current))return y=A.Buttons({style:{layout:"vertical",color:"gold",shape:"rect",label:"paypal"},createOrder:async()=>(await T.createPaypalOrder({idempotencyKey:n})).paypalOrderId,onApprove:async k=>{try{if((await T.capturePaypalOrder({idempotencyKey:n,paypalOrderId:k.orderID})).status==="paid"){b.current();return}v("PayPal did not complete the payment. Please try again.")}catch(C){v(C instanceof qe?C.message:"PayPal payment failed. Please try again.")}},onError:()=>{v("PayPal could not process the payment. Please try again.")}}),y.render(l.current).then(()=>{f||p(!0)})}).catch(()=>{f||v("PayPal could not be loaded. You can pay later \u2014 your order stands either way.")}),()=>{f=!0,y?.close?.()}},[e,t.currency,n]),r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:c("div",{className:"w-full max-w-xl border border-line bg-bg",children:[c("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[r("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:t.orderNumber}),r("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"PayPal"})]}),c("div",{className:"flex flex-col gap-4 px-6 py-6",children:[c("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",r("span",{className:"text-fg",children:s(Number(t.grandTotal),t.currency)})," ","with PayPal to confirm it now."]}),!d&&!u&&r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading PayPal\u2026"}),r("div",{ref:l}),u&&r("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:u}),r("button",{type:"button",onClick:o,className:"self-center font-mono text-[11px] uppercase tracking-[0.24em] text-fg-dim underline-offset-4 transition-colors hover:text-accent hover:underline",children:"Pay later \u2014 our team will be in touch"})]})]})})}var Wn="square-web-sdk",lt=null;function Xr(t){let e=t==="sandbox"?"sandbox":"production";if(lt?.key===e)return lt.promise;let n=new Promise((a,o)=>{document.getElementById(Wn)?.remove();let s=document.createElement("script");s.id=Wn,s.src=e==="sandbox"?"https://sandbox.web.squarecdn.com/v1/square.js":"https://web.squarecdn.com/v1/square.js",s.onload=()=>{let l=window.Square;l?a(l):o(new Error("Square SDK loaded without its namespace"))},s.onerror=()=>o(new Error("Square SDK failed to load")),document.head.appendChild(s)});return lt={key:e,promise:n},n}function Zr({confirmation:t,applicationId:e,locationId:n,environment:a,idemKey:o,onPaid:s,onSkip:l}){let{formatMoney:d}=ie(),p=ce(null),u=ce(null),v=ce(null),[b,f]=g(!1),[y,A]=g(!1),[k,C]=g(null);z(()=>{let F=!1,O=null;return Xr(a).then(async X=>{if(F||!p.current)return;let G=X.payments(e,n);v.current=G,O=await G.card(),await O.attach(p.current),u.current=O,F||f(!0)}).catch(()=>{F||C("Square could not be loaded. You can pay later \u2014 your order stands either way.")}),()=>{F=!0,O?.destroy?.()}},[e,n,a]);async function S(){let F=u.current;if(!(!F||y)){A(!0),C(null);try{let O=await F.tokenize();if(O.status!=="OK"||!O.token){C(O.errors?.[0]?.message??"Please check the card details and try again."),A(!1);return}let X;try{X=(await v.current?.verifyBuyer?.(O.token,{amount:String(t.grandTotal),currencyCode:t.currency,intent:"CHARGE"}))?.token}catch{}if((await T.chargeSquare({idempotencyKey:o,sourceId:O.token,...X?{verificationToken:X}:{}})).status==="paid"){s();return}C("Square did not complete the payment. Please try again.")}catch(O){C(O instanceof qe?O.message:"Square payment failed. Please try again.")}A(!1)}}return r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:c("div",{className:"w-full max-w-xl border border-line bg-bg",children:[c("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[r("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:t.orderNumber}),r("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"Card"})]}),c("div",{className:"flex flex-col gap-4 px-6 py-6",children:[c("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",r("span",{className:"text-fg",children:d(Number(t.grandTotal),t.currency)})," ","by card to confirm it now."]}),!b&&!k&&r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading card form\u2026"}),r("div",{ref:p}),k&&r("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:k}),r("button",{type:"button",onClick:S,disabled:!b||y,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",!b||y?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:y?c(q,{children:["Processing\u2026 ",r("span",{children:"\xB7"})]}):c(q,{children:["Pay ",d(Number(t.grandTotal),t.currency),r("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]})}),r("button",{type:"button",onClick:l,disabled:y,className:"self-center font-mono text-[11px] uppercase tracking-[0.24em] text-fg-dim underline-offset-4 transition-colors hover:text-accent hover:underline",children:"Pay later \u2014 our team will be in touch"})]})]})})}function Qr({checked:t,onChange:e,label:n,sub:a}){return c("div",{className:"flex items-start gap-3 border-t border-line py-4 first:border-t-0 first:pt-0",children:[r("button",{type:"button",onClick:()=>e(!t),"aria-pressed":t,"aria-label":n,className:["mt-px flex h-5 w-5 flex-shrink-0 items-center justify-center border transition-colors",t?"border-accent":"border-line"].join(" "),style:t?{background:"color-mix(in oklab, var(--accent) 18%, transparent)"}:void 0,children:t&&r("span",{className:"text-[13px] text-accent",children:"\u2713"})}),c("span",{className:"flex-1 font-display text-[16px] leading-[1.5] text-fg",children:[n,a&&r("small",{className:"mt-1 block font-mono text-[12px] uppercase tracking-[0.18em] text-fg-dim",children:a})]})]})}function ea({slug:t,name:e,qty:n,config:a,configSummary:o,price:s,currency:l}){let{catalog:d}=Ze(),{formatMoney:p}=ie(),u=d.find(k=>k.slug===t),v=u?.spokes??5,b=u?.mesh??!1,f=a.find(k=>k.gold)?.label,y=u?.finishes.find(k=>k.name===f&&k.src)??u?.finishes.find(k=>k.src),A=u?.finishes[0]?.color??zt;return c("div",{className:"grid grid-cols-[60px_1fr_auto] items-center gap-4 border-b border-line py-4 last:border-b-0",children:[c("div",{className:"relative flex aspect-square items-center justify-center overflow-hidden border border-line bg-surface",children:[r("span",{className:"absolute -right-1.5 -top-1.5 z-[2] flex h-[18px] w-[18px] items-center justify-center rounded-full bg-accent font-mono text-[11px] font-bold text-bg",children:n}),y?.src?r(Rt,{src:y.src,alt:`${e.lead}${e.accent} \u2014 ${y.name}`,width:120,height:120,sizes:"60px",className:"relative block h-full w-full object-contain p-2"}):r("div",{className:"block w-[78%]",style:{color:A},children:r(Yt,{spokes:v,mesh:b,className:"block w-full"})})]}),c("div",{className:"flex min-w-0 flex-col gap-0.5",children:[c("span",{className:"font-display text-[17px] font-bold uppercase leading-none tracking-[-0.005em] text-fg",children:[e.lead,r("em",{className:"font-serif font-normal italic text-accent tracking-[-0.005em] normal-case",children:e.accent})]}),r("span",{className:"font-mono text-[12px] uppercase leading-[1.5] tracking-[0.18em] text-fg-dim",children:o})]}),r("span",{className:"text-right font-display text-[17px] font-bold tracking-[-0.005em] text-fg",children:p(s,l)})]})}function se({label:t,value:e}){return c("div",{className:"flex items-center justify-between font-mono text-[13px] font-medium uppercase tracking-[0.18em] text-fg",children:[r("span",{children:t}),r("strong",{className:"font-display text-[16px] font-medium tracking-[-0.005em] normal-case text-fg",children:e})]})}function ta(t){return t.map(e=>e.label).join(" \xB7 ")}import{jsx as Be}from"react/jsx-runtime";function na(){let{settings:t,websiteName:e}=It(),n=e?{...Qe,name:e}:Qe,a=t?{url:t.logoUrl,reversed:t.logoReversed??null,inkIsDark:t.logoInkIsDark??null,reverse:t.reverseLogo,size:t.logoSize,sizePx:t.logoSizePx}:null;return Be("div",{style:{position:"fixed",inset:0,zIndex:2147482e3,overflowY:"auto",background:"var(--bg)",color:"var(--fg)"},children:Be(Mt,{children:Be(Wt,{preview:!0,children:Be(ut,{site:n,logo:a,preview:!0})})})})}export{na as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Th as r}from"./chunk-
|
|
1
|
+
"use client";import{Th as r}from"./chunk-TAGGXC3A.js";import"./chunk-S66TL4Z3.js";import"./chunk-IHYVLVY3.js";import"./chunk-Y6SLVHK3.js";import{jsx as o}from"react/jsx-runtime";import e from"efficient-easel/screen/components/ScreenStoreProvider";function a(t){return o(e,{...t,parts:r})}export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as Le}from"react/jsx-runtime";import{createContext as un,useCallback as r,useContext as hn,useMemo as gn,useState as ke}from"react";import{createContext as ue,useContext as M}from"react";import{createContext as Ct}from"react";var de=Ct(null);var wt=ue(null),P=ue({logo:null,placeholder:!1,wordmark:null});function Rn(){let e=M(de),t=M(wt),n=M(P),a=!e&&n.placeholder,o=e?e.logoUrl:n.logo?.logoUrl??t?.logoUrl??null;return{src:a?null:o,reversedSrc:e?e.logoReversed:n.logo?.logoReversed??t?.logoReversed??null,inkIsDark:e?e.logoInkIsDark:n.logo?.logoInkIsDark??t?.logoInkIsDark??null,wordmark:e?null:n.wordmark,siteName:e?.siteName??t?.siteName}}import{useSelectHandler as fn}from"efficient-easel/draw/client";var Mn="storefront-theme",Pn="sf:theme-mode",Dn="sf:theme-switch",Fn="hide",U="light";function Lt(e){return e>=7&&e<18}function Nn(e){let{mode:t,override:n,switchShown:a,hour:o}=e;return a&&(n==="light"||n==="dark")?n:t==="auto"?Lt(o)?"light":"dark":t==="light"?"light":"dark"}var h={background:"#0a0a0a",surface:"#131313",line:"#2a2a2a",muted:"#9a9388"},kt=[{text:"#2e2e2e",accent:"#2e2e2e",background:"#ffffff",surface:"#f7f7f7",line:"#e0e0e0",muted:"#5c5c5c"},{text:"#f7f7f7",accent:"#f7f7f7",background:"#0a0a0a",surface:"#1b1b1b",line:"#363636",muted:"#a3a3a3"},{text:"#ffffff",accent:"#ffffff",background:"#2e2e2e",surface:"#3d3d3d",line:"#545454",muted:"#b0b0b0"},{text:"#0a0a0a",accent:"#0a0a0a",background:"#f7f7f7",surface:"#ffffff",line:"#d9d9d9",muted:"#5c5c5c"}],I={selected:0,themes:kt};function he(e){return!e||!Array.isArray(e.themes)||e.themes.length===0?{...I}:{selected:Math.min(Math.max(0,e.selected??0),e.themes.length-1),themes:e.themes}}function D(e,t,n){let a=k(e),o=k(t);if(a===null||o===null)return e;let l=i=>Math.max(0,Math.min(255,Math.round(i))).toString(16).padStart(2,"0");return`#${a.map((i,d)=>l(i+(o[d]-i)*n)).join("")}`}var It={light:"#ffffff",dark:"#0a0a0a"},Gn=["light","dark"];function vn(e,t){let n=It[t],a=t==="light"?"#ffffff":"#000000";return{text:n,accent:n,background:e,surface:D(e,a,.1),line:D(e,a,.22),muted:D(n,e,.35),brandInk:t}}function y(e){let t=he(e);return t.themes[t.selected]}function ge(e){return{text:e.text,accent:e.accent,background:e.background||h.background,surface:e.surface||h.surface,line:e.line||h.line,muted:e.muted||h.muted}}function k(e){let t=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(!t)return null;let n=t[1].length===3?[...t[1]].map(i=>i+i).join(""):t[1],[a,o,l]=[0,2,4].map(i=>parseInt(n.slice(i,i+2),16));return[a,o,l]}function v(e){let t=k(e);if(t===null)return null;let[n,a,o]=t.map(l=>{let i=l/255;return i<=.04045?i/12.92:((i+.055)/1.055)**2.4});return .2126*n+.7152*a+.0722*o}var Ot=.4,Ht=4.5,Rt=3;function xt(e,t){let n=v(e),a=v(t);if(n===null||a===null)return null;let[o,l]=n>=a?[n,a]:[a,n];return(o+.05)/(l+.05)}var Un={good:"Good","large-only":"Large text only",hard:"Hard to read"};function Bn(e){return e>=Ht?"good":e>=Rt?"large-only":"hard"}var F=["#000000","#ffffff"];function O(e){let t=F[0],n=-1;for(let a of F){let o=xt(e,a);if(o===null)return F[0];o>n&&(n=o,t=a)}return t}var Mt=[.25,.4,.55];function Wn(e){let t=k(e);return t===null?[]:Mt.map(n=>"#"+t.map(a=>Math.round(a*(1-n)).toString(16).padStart(2,"0")).join(""))}function zn(e){let t=y(e),n={"--theme-fg":t.text},a=v(t.text);return(a===null||a>=Ot)&&(n["--overlay-fg"]=t.text),n}var Pt=82;function B(e){return`color-mix(in srgb, ${e} ${Pt}%, #000)`}function $n(e){let t=y(e);return{"--theme-accent":t.accent,"--theme-accent-2":B(t.accent),"--theme-accent-ink":O(t.accent)}}function W(e){let t=e?.button;return/^#[0-9a-fA-F]{6}$/.test(t??"")?t.toLowerCase():null}function Vn(e){let t=y(e),n=W(t),a=fe(t);if(n===null&&a===null)return{};let o={};return n!==null&&(o["--theme-btn"]=n,o["--theme-btn-2"]=B(n)),o["--theme-btn-ink"]=a??O(n),o}function fe(e){let t=e?.buttonInk;return/^#[0-9a-fA-F]{6}$/.test(t??"")?t.toLowerCase():null}function Dt(e,t){return fe(e)??O(W(e)??t)}function Yn(e){let t=y(e);return{fill:W(t)??t.accent.toLowerCase(),ink:Dt(t,t.accent)}}function Xn(e){let t={};return he(e).themes.forEach((n,a)=>{let o=ge(n);t[`--theme-preset-${a}-accent`]=o.accent,t[`--theme-preset-${a}-accent-2`]=B(o.accent),t[`--theme-preset-${a}-accent-ink`]=O(o.accent),t[`--theme-preset-${a}-bg`]=o.background,t[`--theme-preset-${a}-fg`]=o.text,t[`--theme-preset-${a}-surface`]=o.surface,t[`--theme-preset-${a}-surface-2`]=`color-mix(in srgb, ${o.surface} 60%, ${o.line})`,t[`--theme-preset-${a}-line`]=o.line,t[`--theme-preset-${a}-muted`]=o.muted}),t}var jn=["--theme-bg","--theme-surface","--theme-surface-2","--theme-line","--theme-muted"];function qn(e){let t=ge(y(e)),n=`color-mix(in srgb, ${t.surface} 60%, ${t.line})`,a={"--theme-bg":t.background,"--theme-surface":t.surface,"--theme-line":t.line,"--theme-muted":t.muted};return(t.surface!==h.surface||t.line!==h.line)&&(a["--theme-surface-2"]=n),a}var Ft=["heading","body","label"];function Kn(e){if(!e)return null;for(let t of Ft)if(e.includes(`--size-${t}`))return t;return/--size-heading(Large|Medium|Small)/.test(e)?"heading":null}var me=["headingLarge","headingMedium","headingSmall","accent","body","label"];var z={headingLarge:null,headingMedium:null,headingSmall:null,accent:null,body:null,label:null},Nt=8,Gt=200;function vt(e){if(typeof e!="number"||!Number.isFinite(e))return null;let t=Math.round(e);return t>=Nt&&t<=Gt?t:null}function Ut(e){let t={};for(let n of me)t[n]=vt(e?.[n]);return t}function Zn(e){let t=Ut(e),n={};for(let a of me){let o=t[a];o!==null&&(n[`--size-${a}`]=`${o}px`)}return n}var Bt=["square","small","large"],Wt="small";function Jn(e){return Bt.includes(e??"")?e:Wt}var Se=0,zt=40,Qn={square:0,small:null,large:16},$t={"--sf-card-radius":1,"--sf-button-radius":.5,"--site-radius":.5,"--site-radius-xs":.25,"--site-radius-sm":.5,"--site-radius-md":.75,"--site-radius-lg":1,"--site-radius-xl":1.25,"--site-radius-2xl":1.5,"--site-radius-3xl":2,"--site-radius-4xl":2.5};function pe(e){if(e==null||typeof e=="string"&&e.trim()==="")return null;let t=typeof e=="string"?Number(e):e;return Number.isFinite(t)?Math.min(zt,Math.max(Se,Math.round(t))):null}function Vt(e){let t=pe(e);return t===null?{}:Object.fromEntries(Object.entries($t).map(([n,a])=>{let o=t*a/16;return[n,o===0?"0":`${o}rem`]}))}function ea(e){return Vt(pe(e)??Se)}var Yt=["none","soft","lifted"],Xt="soft",_e="none",jt=["tight","normal","roomy"],qt="normal",H="normal",Kt=["none","lift","highlight"],Zt="lift",Jt="highlight",Ee="#141416";function ye(e){return Yt.includes(e??"")?e:Xt}function Qt(e){return jt.includes(e??"")?e:qt}function be(e){return Kt.includes(e??"")?e:Zt}function en(e){return/^#[0-9a-fA-F]{6}$/.test(e??"")?e.toLowerCase():Ee}function ta(e){let t=ye(e);return t===_e?void 0:t}function na(e){let t=Qt(e);return t===H?void 0:t}function aa(e){let t=be(e);return t===Jt?void 0:t}function oa(e,t,n){let a=en(t);return a===Ee?{}:ye(e)!==_e||be(n)==="lift"?{"--sf-shadow-color":a}:{}}var tn=["normal","tight","compressed"],b="normal";function Te(e){return tn.includes(e??"")?e:b}function sa(e){let t=Te(e);return t===b?void 0:t}function ra(e){switch(Te(e)){case"tight":return{lineHeight:.95,letterSpacing:-.01};case"compressed":return{lineHeight:.86,letterSpacing:-.01};default:return{}}}var $={case:"authored",weight:null,weightStrong:null,italicStrong:null,maxPx:null,weight2:null,weight3:null,case2:"authored",case3:"authored"},N=100,G=900,nn=24,an=200;function L(e,t,n){return typeof e!="number"||!Number.isFinite(e)?null:Math.round(Math.min(Math.max(e,t),n))}function Ae(e){let t=L(e?.weight,N,G),n=e?.case==="sentence"?"sentence":"authored",a=l=>l==null?t:L(l,N,G),o=l=>l==="sentence"?"sentence":l==="authored"?"authored":n;return{case:n,weight:t,weightStrong:L(e?.weightStrong,N,G),italicStrong:typeof e?.italicStrong=="boolean"?e.italicStrong:null,maxPx:L(e?.maxPx,nn,an),weight2:a(e?.weight2),weight3:a(e?.weight3),case2:o(e?.case2),case3:o(e?.case3)}}function ia(e){let t=Ae(e),n={};return t.case==="sentence"&&(n["--sf-heading-case"]="none"),t.weight!==null&&(n["--sf-heading-weight"]=String(t.weight)),t.weightStrong!==null&&(n["--sf-heading-weight-strong"]=String(t.weightStrong)),t.maxPx!==null&&(n["--sf-heading-max"]=`${t.maxPx}px`),t.weight2!==null&&t.weight2!==t.weight&&(n["--sf-heading-2-weight"]=String(t.weight2)),t.weight3!==null&&t.weight3!==t.weight&&(n["--sf-heading-3-weight"]=String(t.weight3)),t.case2!==t.case&&(n["--sf-heading-2-case"]=t.case2==="sentence"?"none":"uppercase"),t.case3!==t.case&&(n["--sf-heading-3-case"]=t.case3==="sentence"?"none":"uppercase"),n}function la(e){return Ae({case:e?.heading_case??void 0,weight:e?.heading_weight,weightStrong:e?.heading_weight_strong,italicStrong:e?.accent_italic,maxPx:e?.heading_max_px,weight2:e?.heading_2_weight??void 0,weight3:e?.heading_3_weight??void 0,case2:e?.heading_2_case??void 0,case3:e?.heading_3_case??void 0})}var Ce=[{key:"space-grotesk",label:"Space Grotesk",cssVar:"--font-display",category:"sans",italic:!1,italicLoaded:!1},{key:"inter",label:"Inter",cssVar:"--font-body",category:"sans",italic:!0,italicLoaded:!0},{key:"poppins",label:"Poppins",cssVar:"--font-poppins",category:"sans",italic:!0,italicLoaded:!0},{key:"dm-sans",label:"DM Sans",cssVar:"--font-dm-sans",category:"sans",italic:!0,italicLoaded:!0},{key:"sora",label:"Sora",cssVar:"--font-sora",category:"sans",italic:!1,italicLoaded:!1},{key:"oswald",label:"Oswald",cssVar:"--font-oswald",category:"sans",italic:!1,italicLoaded:!1},{key:"archivo",label:"Archivo",cssVar:"--font-archivo",category:"sans",italic:!0,italicLoaded:!0},{key:"outfit",label:"Outfit",cssVar:"--font-outfit",category:"sans",italic:!1,italicLoaded:!1},{key:"manrope",label:"Manrope",cssVar:"--font-manrope",category:"sans",italic:!1,italicLoaded:!1},{key:"big-shoulders",label:"Big Shoulders",cssVar:"--font-big-shoulders",category:"sans",italic:!1,italicLoaded:!1},{key:"michroma",label:"Michroma",cssVar:"--font-michroma",category:"sans",italic:!1,italicLoaded:!1},{key:"assistant",label:"Assistant",cssVar:"--font-assistant",category:"sans",italic:!1,italicLoaded:!1},{key:"fraunces",label:"Fraunces",cssVar:"--font-serif",category:"serif",italic:!0,italicLoaded:!0},{key:"playfair-display",label:"Playfair Display",cssVar:"--font-playfair",category:"serif",italic:!0,italicLoaded:!0},{key:"cormorant",label:"Cormorant",cssVar:"--font-cormorant",category:"serif",italic:!0,italicLoaded:!0},{key:"jetbrains-mono",label:"JetBrains Mono",cssVar:"--font-mono-loaded",category:"mono",italic:!0,italicLoaded:!0}],f=new Map(Ce.map(e=>[e.key,e]));function da(e){return f.get(e)}var we=["heading","heading2","heading3","body","accent","label"],ua={heading:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",body:"Body",accent:"Accent",label:"Labels"},on=[["font-heading2","heading2"],["font-heading3","heading3"],["font-display","heading"],["font-serif","accent"],["font-mono","label"],["font-body","body"]],sn=/var\(--size-(headingLarge|headingMedium|headingSmall|accent|body|label)\s*,/,ha={heading:"headingLarge",heading2:"headingMedium",heading3:"headingSmall",accent:"accent",body:"body",label:"label"},rn={headingLarge:"heading",headingMedium:"heading2",headingSmall:"heading3",accent:"accent",body:"body",label:"label"};function ga(e){let t=e?sn.exec(e):null;return t?rn[t[1]]??null:ln(e)}function ln(e){if(!e)return null;let t=e.split(/\s+/).filter(n=>!n.slice(0,n.lastIndexOf(":")+1).includes("&")).map(n=>n.slice(n.lastIndexOf(":")+1));for(let[n,a]of on)if(t.includes(n))return a;return null}var u={heading:"space-grotesk",heading2:"space-grotesk",heading3:"space-grotesk",body:"inter",accent:"fraunces",label:"jetbrains-mono"};function cn(e){let t=n=>{let a=e?.[n];if(a&&f.has(a))return a;if(n==="heading2"||n==="heading3"){let o=e?.heading;return o&&f.has(o)?o:u.heading}return u[n]};return Object.fromEntries(we.map(n=>[n,t(n)]))}function dn(e,t){return f.get(e[t])??f.get(u[t])}function g(e,t){return`var(${dn(e,t).cssVar})`}var fa=[...new Set(we.map(e=>f.get(u[e]).cssVar))],ma=[...new Set(Ce.map(e=>e.cssVar))];function Sa(e){let t=cn(e);return{"--font-role-heading":g(t,"heading"),"--font-role-heading2":g(t,"heading2"),"--font-role-heading3":g(t,"heading3"),"--font-role-body":g(t,"body"),"--font-role-accent":g(t,"accent"),"--font-role-label":g(t,"label"),fontFamily:"var(--font-role-body)"}}var Oe=un({settings:null,setSettings:()=>{},primeSettings:()=>{},websiteName:null,templateChrome:!1,templateName:null,chromePlaceholder:!1,themeMode:U,setThemeMode:()=>{},themeSwitchShown:!1,setThemeSwitchShown:()=>{},theme:I,setTheme:()=>{},fonts:u,setFonts:()=>{},sizes:z,setSizes:()=>{},cornerRadiusPx:null,setCornerRadiusPx:()=>{},cardShadow:null,setCardShadow:()=>{},shadowColor:null,setShadowColor:()=>{},cardGap:H,setCardGap:()=>{},hoverEffect:null,setHoverEffect:()=>{},headingCompression:b,setHeadingCompression:()=>{},siteWidth:null,setSiteWidth:()=>{},siteGutter:null,blockGap:null,setSiteGutter:()=>{},setBlockGap:()=>{},headingTypography:$,setHeadingTypography:()=>{},textStyles:null,setTextStyles:()=>{},wordStyles:null,heroBackgroundFollowsWidth:null,setHeroBackgroundFollowsWidth:()=>{},sectionBackgroundWidth:null,setSectionBackgroundWidth:()=>{},sectionContentWidth:null,setSectionContentWidth:()=>{},photographyGrayscale:null,setPhotographyGrayscale:()=>{},shareButtonOnPosts:null,setShareButtonOnPosts:()=>{},themeFromDocument:!1,selected:!1,setSelected:()=>{},select:()=>{},setSelectHandler:()=>{}});function Ca({children:e,websiteName:t=null,templateChrome:n=!1,templateName:a=null,chromePlaceholder:o=!1,themeMode:l=U,onThemeModeChange:i,themeSwitchShown:d=!1,onThemeSwitchShownChange:T,theme:A=I,onThemeChange:m,fonts:S=u,onFontsChange:p,sizes:_=z,onSizesChange:c,cornerRadiusPx:R=null,onCornerRadiusPxChange:C,cardShadow:x=null,onCardShadowChange:w,shadowColor:Pe=null,onShadowColorChange:V,cardGap:De=H,onCardGapChange:Y,hoverEffect:Fe=null,onHoverEffectChange:X,headingCompression:Ne=b,onHeadingCompressionChange:j,siteWidth:Ge=null,onSiteWidthChange:q,siteGutter:ve=null,blockGap:Ue=null,onSiteGutterChange:K,onBlockGapChange:Z,headingTypography:Be=$,onHeadingTypographyChange:J,textStyles:We=null,onTextStylesChange:Q,wordStyles:ze=null,heroBackgroundFollowsWidth:$e=null,onHeroBackgroundFollowsWidthChange:ee,sectionBackgroundWidth:Ve=null,onSectionBackgroundWidthChange:te,sectionContentWidth:Ye=null,onSectionContentWidthChange:ne,photographyGrayscale:Xe=null,onPhotographyGrayscaleChange:ae,shareButtonOnPosts:je=null,onShareButtonOnPostsChange:oe,themeFromDocument:qe=!1}){let[E,se]=ke(null),Ke=r(s=>se(At=>At??s),[]),[Ze,Je]=ke(!1),Qe=r(s=>i?.(s),[i]),et=r(s=>T?.(s),[T]),tt=r(s=>m?.(s),[m]),nt=r(s=>p?.(s),[p]),at=r(s=>c?.(s),[c]),ot=r(s=>q?.(s),[q]),st=r(s=>K?.(s),[K]),rt=r(s=>Z?.(s),[Z]),it=r(s=>ee?.(s),[ee]),lt=r(s=>te?.(s),[te]),ct=r(s=>ne?.(s),[ne]),dt=r(s=>ae?.(s),[ae]),ut=r(s=>oe?.(s),[oe]),ht=r(s=>C?.(s),[C]),gt=r(s=>w?.(s),[w]),ft=r(s=>V?.(s),[V]),mt=r(s=>Y?.(s),[Y]),St=r(s=>X?.(s),[X]),pt=r(s=>j?.(s),[j]),_t=r(s=>J?.(s),[J]),Et=r(s=>Q?.(s),[Q]),{select:yt,setSelectHandler:bt}=fn(),re=E?.logoUrl,ie=E?.logoReversed,le=E?.logoInkIsDark,ce=E!==null,Tt=gn(()=>({logo:ce?{logoUrl:re,logoReversed:ie,logoInkIsDark:le}:null,placeholder:n||o,wordmark:n?a:t}),[ce,re,ie,le,n,o,a,t]);return Le(P.Provider,{value:Tt,children:Le(Oe.Provider,{value:{settings:E,setSettings:se,primeSettings:Ke,websiteName:t,templateChrome:n,templateName:a,chromePlaceholder:o,themeMode:l,setThemeMode:Qe,themeSwitchShown:d,setThemeSwitchShown:et,theme:A,setTheme:tt,fonts:S,setFonts:nt,sizes:_,setSizes:at,cornerRadiusPx:R,setCornerRadiusPx:ht,cardShadow:x,setCardShadow:gt,shadowColor:Pe,setShadowColor:ft,cardGap:De,setCardGap:mt,hoverEffect:Fe,setHoverEffect:St,headingCompression:Ne,setHeadingCompression:pt,siteWidth:Ge,setSiteWidth:ot,siteGutter:ve,blockGap:Ue,setSiteGutter:st,setBlockGap:rt,headingTypography:Be,setHeadingTypography:_t,textStyles:We,setTextStyles:Et,wordStyles:ze,heroBackgroundFollowsWidth:$e,setHeroBackgroundFollowsWidth:it,sectionBackgroundWidth:Ve,setSectionBackgroundWidth:lt,sectionContentWidth:Ye,setSectionContentWidth:ct,photographyGrayscale:Xe,setPhotographyGrayscale:dt,shareButtonOnPosts:je,setShareButtonOnPosts:ut,themeFromDocument:qe,selected:Ze,setSelected:Je,select:yt,setSelectHandler:bt},children:e})})}var wa=()=>hn(Oe);import{forwardRef as mn}from"react";import{imageCopyUrl as He,imageSrcSet as Re}from"efficient-shell/image-copies";import{jsx as _n}from"react/jsx-runtime";var Sn={position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,color:"transparent"};function xe(e,t,n){if(n){let a=Re(e);return a?{src:He(e,1280),srcSet:a,sizes:n}:{src:e,sizes:n}}if(t&&t>0){let a=Re(e,{maxWidth:t*3});return a?{src:He(e,t*2),srcSet:a,sizes:`${t}px`}:{src:e}}return{src:e}}var pn=mn(function({src:t,width:n,height:a,fill:o,priority:l,loading:i,style:d,quality:T,placeholder:A,blurDataURL:m,unoptimized:S,loader:p,overrideSrc:_,sizes:c,...R},C){let x=_??(typeof t=="string"?t:t.src),w=xe(x,o?void 0:Number(n)||void 0,c??(o?"100vw":void 0));return _n("img",{ref:C,...w,width:o?void 0:n,height:o?void 0:a,loading:l?"eager":i??"lazy",fetchPriority:l?"high":void 0,decoding:"async",style:o?{...Sn,...d}:{color:"transparent",...d},...R})}),Oa=pn;function Ha(e){let t=e.overrideSrc??(typeof e.src=="string"?e.src:e.src.src),n=e.fill?void 0:Number(e.width)||void 0;return{props:xe(t,n,e.sizes??(e.fill?"100vw":void 0))}}import{forwardRef as En}from"react";import{jsx as Tn}from"react/jsx-runtime";function yn(e){if(typeof e=="string")return e;let t=e.query?`?${new URLSearchParams(e.query).toString()}`:"",n=e.hash?e.hash.startsWith("#")?e.hash:`#${e.hash}`:"";return`${e.pathname??""}${t}${n}`}var bn=En(function({href:t,prefetch:n,replace:a,scroll:o,shallow:l,legacyBehavior:i,passHref:d,locale:T,onClick:A,children:m,...S},p){let _=c=>{A?.(c),!(c.defaultPrevented||S.target==="_blank")&&c.preventDefault()};return Tn("a",{ref:p,href:yn(t),onClick:_,...S,children:m})}),Pa=bn;var An="Storefront";function Na(e){return e?.trim()||An}var Me=["instagram","facebook","tiktok","youtube","x","linkedin","pinterest","whatsapp","telegram","line","wechat"],Cn={instagram:"Instagram",facebook:"Facebook",tiktok:"TikTok",youtube:"YouTube",x:"X",linkedin:"LinkedIn",pinterest:"Pinterest",whatsapp:"WhatsApp",telegram:"Telegram",line:"LINE",wechat:"WeChat"},wn={};function va(e){if(!e||typeof e!="object")return wn;let t={};for(let n of Me){let a=e[n];if(typeof a!="string")continue;let o=a.trim();!o||!/^https?:\/\//i.test(o)||(t[n]=o)}return t}function Ua(e){return Me.flatMap(t=>{let n=e[t];return n?[{platform:t,href:n,label:Cn[t]}]:[]})}var Ba=e=>`${e}_url`;var za={small:54,medium:66,large:84},Ln=44,$a=16,Va=140,Ya=Ln*4;export{Oa as a,Ha as b,Pa as c,Ce as d,da as e,we as f,ua as g,ha as h,ga as i,ln as j,u as k,cn as l,Sa as m,Mn as n,Pn as o,Dn as p,Fn as q,U as r,Nn as s,h as t,kt as u,he as v,Gn as w,vn as x,y,ge as z,xt as A,Un as B,Bn as C,O as D,Wn as E,zn as F,$n as G,W as H,Vn as I,fe as J,Dt as K,Yn as L,Xn as M,jn as N,qn as O,Kn as P,z as Q,Ut as R,Zn as S,Jn as T,Se as U,zt as V,Qn as W,pe as X,Vt as Y,ea as Z,Yt as _,Xt as $,_e as aa,H as ba,Kt as ca,Zt as da,Jt as ea,Ee as fa,ye as ga,Qt as ha,be as ia,en as ja,ta as ka,na as la,aa as ma,oa as na,b as oa,Te as pa,sa as qa,ra,$ as sa,Ae as ta,ia as ua,la as va,de as wa,Rn as xa,Ca as ya,wa as za,An as Aa,Na as Ba,Me as Ca,Cn as Da,wn as Ea,va as Fa,Ua as Ga,Ba as Ha,za as Ia,Ln as Ja,$a as Ka,Va as La,Ya as Ma};
|
|
1
|
+
import{jsx as Le}from"react/jsx-runtime";import{createContext as un,useCallback as r,useContext as hn,useMemo as gn,useState as ke}from"react";import{createContext as ue,useContext as M}from"react";import{createContext as Ct}from"react";var de=Ct(null);var wt=ue(null),P=ue({logo:null,placeholder:!1,wordmark:null});function Rn(){let e=M(de),t=M(wt),n=M(P),a=!e&&n.placeholder,o=e?e.logoUrl:n.logo?.logoUrl??t?.logoUrl??null;return{src:a?null:o,reversedSrc:e?e.logoReversed:n.logo?.logoReversed??t?.logoReversed??null,inkIsDark:e?e.logoInkIsDark:n.logo?.logoInkIsDark??t?.logoInkIsDark??null,wordmark:e?null:n.wordmark,siteName:e?.siteName??t?.siteName}}import{useSelectHandler as fn}from"efficient-easel/draw/client";var Mn="storefront-theme",Pn="sf:theme-mode",Dn="sf:theme-switch",Fn="hide",U="light";function Lt(e){return e>=7&&e<18}function Nn(e){let{mode:t,override:n,switchShown:a,hour:o}=e;return a&&(n==="light"||n==="dark")?n:t==="auto"?Lt(o)?"light":"dark":t==="light"?"light":"dark"}var h={background:"#0a0a0a",surface:"#131313",line:"#2a2a2a",muted:"#9a9388"},kt=[{text:"#2e2e2e",accent:"#2e2e2e",background:"#ffffff",surface:"#f7f7f7",line:"#e0e0e0",muted:"#5c5c5c"},{text:"#f7f7f7",accent:"#f7f7f7",background:"#0a0a0a",surface:"#1b1b1b",line:"#363636",muted:"#a3a3a3"},{text:"#ffffff",accent:"#ffffff",background:"#2e2e2e",surface:"#3d3d3d",line:"#545454",muted:"#b0b0b0"},{text:"#0a0a0a",accent:"#0a0a0a",background:"#f7f7f7",surface:"#ffffff",line:"#d9d9d9",muted:"#5c5c5c"}],I={selected:0,themes:kt};function he(e){return!e||!Array.isArray(e.themes)||e.themes.length===0?{...I}:{selected:Math.min(Math.max(0,e.selected??0),e.themes.length-1),themes:e.themes}}function D(e,t,n){let a=k(e),o=k(t);if(a===null||o===null)return e;let l=i=>Math.max(0,Math.min(255,Math.round(i))).toString(16).padStart(2,"0");return`#${a.map((i,d)=>l(i+(o[d]-i)*n)).join("")}`}var It={light:"#ffffff",dark:"#0a0a0a"},Gn=["light","dark"];function vn(e,t){let n=It[t],a=t==="light"?"#ffffff":"#000000";return{text:n,accent:n,background:e,surface:D(e,a,.1),line:D(e,a,.22),muted:D(n,e,.35),brandInk:t}}function y(e){let t=he(e);return t.themes[t.selected]}function ge(e){return{text:e.text,accent:e.accent,background:e.background||h.background,surface:e.surface||h.surface,line:e.line||h.line,muted:e.muted||h.muted}}function k(e){let t=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(!t)return null;let n=t[1].length===3?[...t[1]].map(i=>i+i).join(""):t[1],[a,o,l]=[0,2,4].map(i=>parseInt(n.slice(i,i+2),16));return[a,o,l]}function v(e){let t=k(e);if(t===null)return null;let[n,a,o]=t.map(l=>{let i=l/255;return i<=.04045?i/12.92:((i+.055)/1.055)**2.4});return .2126*n+.7152*a+.0722*o}var Ot=.4,Ht=4.5,Rt=3;function xt(e,t){let n=v(e),a=v(t);if(n===null||a===null)return null;let[o,l]=n>=a?[n,a]:[a,n];return(o+.05)/(l+.05)}var Un={good:"Good","large-only":"Large text only",hard:"Hard to read"};function Bn(e){return e>=Ht?"good":e>=Rt?"large-only":"hard"}var F=["#000000","#ffffff"];function O(e){let t=F[0],n=-1;for(let a of F){let o=xt(e,a);if(o===null)return F[0];o>n&&(n=o,t=a)}return t}var Mt=[.25,.4,.55];function Wn(e){let t=k(e);return t===null?[]:Mt.map(n=>"#"+t.map(a=>Math.round(a*(1-n)).toString(16).padStart(2,"0")).join(""))}function zn(e){let t=y(e),n={"--theme-fg":t.text},a=v(t.text);return(a===null||a>=Ot)&&(n["--overlay-fg"]=t.text),n}var Pt=82;function B(e){return`color-mix(in srgb, ${e} ${Pt}%, #000)`}function $n(e){let t=y(e);return{"--theme-accent":t.accent,"--theme-accent-2":B(t.accent),"--theme-accent-ink":O(t.accent)}}function W(e){let t=e?.button;return/^#[0-9a-fA-F]{6}$/.test(t??"")?t.toLowerCase():null}function Vn(e){let t=y(e),n=W(t),a=fe(t);if(n===null&&a===null)return{};let o={};return n!==null&&(o["--theme-btn"]=n,o["--theme-btn-2"]=B(n)),o["--theme-btn-ink"]=a??O(n),o}function fe(e){let t=e?.buttonInk;return/^#[0-9a-fA-F]{6}$/.test(t??"")?t.toLowerCase():null}function Dt(e,t){return fe(e)??O(W(e)??t)}function Yn(e){let t=y(e);return{fill:W(t)??t.accent.toLowerCase(),ink:Dt(t,t.accent)}}function Xn(e){let t={};return he(e).themes.forEach((n,a)=>{let o=ge(n);t[`--theme-preset-${a}-accent`]=o.accent,t[`--theme-preset-${a}-accent-2`]=B(o.accent),t[`--theme-preset-${a}-accent-ink`]=O(o.accent),t[`--theme-preset-${a}-bg`]=o.background,t[`--theme-preset-${a}-fg`]=o.text,t[`--theme-preset-${a}-surface`]=o.surface,t[`--theme-preset-${a}-surface-2`]=`color-mix(in srgb, ${o.surface} 60%, ${o.line})`,t[`--theme-preset-${a}-line`]=o.line,t[`--theme-preset-${a}-muted`]=o.muted}),t}var jn=["--theme-bg","--theme-surface","--theme-surface-2","--theme-line","--theme-muted"];function qn(e){let t=ge(y(e)),n=`color-mix(in srgb, ${t.surface} 60%, ${t.line})`,a={"--theme-bg":t.background,"--theme-surface":t.surface,"--theme-line":t.line,"--theme-muted":t.muted};return(t.surface!==h.surface||t.line!==h.line)&&(a["--theme-surface-2"]=n),a}var Ft=["heading","body","label"];function Kn(e){if(!e)return null;for(let t of Ft)if(e.includes(`--size-${t}`))return t;return/--size-heading(Large|Medium|Small)/.test(e)?"heading":null}var me=["headingLarge","headingMedium","headingSmall","accent","body","label"];var z={headingLarge:null,headingMedium:null,headingSmall:null,accent:null,body:null,label:null},Nt=8,Gt=200;function vt(e){if(typeof e!="number"||!Number.isFinite(e))return null;let t=Math.round(e);return t>=Nt&&t<=Gt?t:null}function Ut(e){let t={};for(let n of me)t[n]=vt(e?.[n]);return t}function Zn(e){let t=Ut(e),n={};for(let a of me){let o=t[a];o!==null&&(n[`--size-${a}`]=`${o}px`)}return n}var Bt=["square","small","large"],Wt="small";function Jn(e){return Bt.includes(e??"")?e:Wt}var Se=0,zt=40,Qn={square:0,small:null,large:16},$t={"--sf-card-radius":1,"--sf-button-radius":.5,"--site-radius":.5,"--site-radius-xs":.25,"--site-radius-sm":.5,"--site-radius-md":.75,"--site-radius-lg":1,"--site-radius-xl":1.25,"--site-radius-2xl":1.5,"--site-radius-3xl":2,"--site-radius-4xl":2.5};function pe(e){if(e==null||typeof e=="string"&&e.trim()==="")return null;let t=typeof e=="string"?Number(e):e;return Number.isFinite(t)?Math.min(zt,Math.max(Se,Math.round(t))):null}function Vt(e){let t=pe(e);return t===null?{}:Object.fromEntries(Object.entries($t).map(([n,a])=>{let o=t*a/16;return[n,o===0?"0":`${o}rem`]}))}function ea(e){return Vt(pe(e)??Se)}var Yt=["none","soft","lifted"],Xt="soft",_e="none",jt=["tight","normal","roomy"],qt="normal",H="normal",Kt=["none","lift","highlight"],Zt="lift",Jt="highlight",Ee="#141416";function ye(e){return Yt.includes(e??"")?e:Xt}function Qt(e){return jt.includes(e??"")?e:qt}function be(e){return Kt.includes(e??"")?e:Zt}function en(e){return/^#[0-9a-fA-F]{6}$/.test(e??"")?e.toLowerCase():Ee}function ta(e){let t=ye(e);return t===_e?void 0:t}function na(e){let t=Qt(e);return t===H?void 0:t}function aa(e){let t=be(e);return t===Jt?void 0:t}function oa(e,t,n){let a=en(t);return a===Ee?{}:ye(e)!==_e||be(n)==="lift"?{"--sf-shadow-color":a}:{}}var tn=["normal","tight","compressed"],b="normal";function Te(e){return tn.includes(e??"")?e:b}function sa(e){let t=Te(e);return t===b?void 0:t}function ra(e){switch(Te(e)){case"tight":return{lineHeight:.95,letterSpacing:-.01};case"compressed":return{lineHeight:.86,letterSpacing:-.01};default:return{}}}var $={case:"authored",weight:null,weightStrong:null,italicStrong:null,maxPx:null,weight2:null,weight3:null,case2:"authored",case3:"authored"},N=100,G=900,nn=24,an=200;function L(e,t,n){return typeof e!="number"||!Number.isFinite(e)?null:Math.round(Math.min(Math.max(e,t),n))}function Ae(e){let t=L(e?.weight,N,G),n=e?.case==="sentence"?"sentence":"authored",a=l=>l==null?t:L(l,N,G),o=l=>l==="sentence"?"sentence":l==="authored"?"authored":n;return{case:n,weight:t,weightStrong:L(e?.weightStrong,N,G),italicStrong:typeof e?.italicStrong=="boolean"?e.italicStrong:null,maxPx:L(e?.maxPx,nn,an),weight2:a(e?.weight2),weight3:a(e?.weight3),case2:o(e?.case2),case3:o(e?.case3)}}function ia(e){let t=Ae(e),n={};return t.case==="sentence"&&(n["--sf-heading-case"]="none"),t.weight!==null&&(n["--sf-heading-weight"]=String(t.weight)),t.weightStrong!==null&&(n["--sf-heading-weight-strong"]=String(t.weightStrong)),t.maxPx!==null&&(n["--sf-heading-max"]=`${t.maxPx}px`),t.weight2!==null&&t.weight2!==t.weight&&(n["--sf-heading-2-weight"]=String(t.weight2)),t.weight3!==null&&t.weight3!==t.weight&&(n["--sf-heading-3-weight"]=String(t.weight3)),t.case2!==t.case&&(n["--sf-heading-2-case"]=t.case2==="sentence"?"none":"uppercase"),t.case3!==t.case&&(n["--sf-heading-3-case"]=t.case3==="sentence"?"none":"uppercase"),n}function la(e){return Ae({case:e?.heading_case??void 0,weight:e?.heading_weight,weightStrong:e?.heading_weight_strong,italicStrong:e?.accent_italic,maxPx:e?.heading_max_px,weight2:e?.heading_2_weight??void 0,weight3:e?.heading_3_weight??void 0,case2:e?.heading_2_case??void 0,case3:e?.heading_3_case??void 0})}var Ce=[{key:"space-grotesk",label:"Space Grotesk",cssVar:"--font-display",category:"sans",italic:!1,italicLoaded:!1},{key:"inter",label:"Inter",cssVar:"--font-body",category:"sans",italic:!0,italicLoaded:!0},{key:"poppins",label:"Poppins",cssVar:"--font-poppins",category:"sans",italic:!0,italicLoaded:!0},{key:"dm-sans",label:"DM Sans",cssVar:"--font-dm-sans",category:"sans",italic:!0,italicLoaded:!0},{key:"sora",label:"Sora",cssVar:"--font-sora",category:"sans",italic:!1,italicLoaded:!1},{key:"oswald",label:"Oswald",cssVar:"--font-oswald",category:"sans",italic:!1,italicLoaded:!1},{key:"archivo",label:"Archivo",cssVar:"--font-archivo",category:"sans",italic:!0,italicLoaded:!0},{key:"outfit",label:"Outfit",cssVar:"--font-outfit",category:"sans",italic:!1,italicLoaded:!1},{key:"manrope",label:"Manrope",cssVar:"--font-manrope",category:"sans",italic:!1,italicLoaded:!1},{key:"big-shoulders",label:"Big Shoulders",cssVar:"--font-big-shoulders",category:"sans",italic:!1,italicLoaded:!1},{key:"michroma",label:"Michroma",cssVar:"--font-michroma",category:"sans",italic:!1,italicLoaded:!1},{key:"assistant",label:"Assistant",cssVar:"--font-assistant",category:"sans",italic:!1,italicLoaded:!1},{key:"fraunces",label:"Fraunces",cssVar:"--font-serif",category:"serif",italic:!0,italicLoaded:!0},{key:"playfair-display",label:"Playfair Display",cssVar:"--font-playfair",category:"serif",italic:!0,italicLoaded:!0},{key:"cormorant",label:"Cormorant",cssVar:"--font-cormorant",category:"serif",italic:!0,italicLoaded:!0},{key:"jetbrains-mono",label:"JetBrains Mono",cssVar:"--font-mono-loaded",category:"mono",italic:!0,italicLoaded:!0}],f=new Map(Ce.map(e=>[e.key,e]));function da(e){return f.get(e)}var we=["heading","heading2","heading3","body","accent","label"],ua={heading:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",body:"Body",accent:"Accent",label:"Labels"},on=[["font-heading2","heading2"],["font-heading3","heading3"],["font-display","heading"],["font-serif","accent"],["font-mono","label"],["font-body","body"]],sn=/var\(--size-(headingLarge|headingMedium|headingSmall|accent|body|label)\s*,/,ha={heading:"headingLarge",heading2:"headingMedium",heading3:"headingSmall",accent:"accent",body:"body",label:"label"},rn={headingLarge:"heading",headingMedium:"heading2",headingSmall:"heading3",accent:"accent",body:"body",label:"label"};function ga(e){let t=e?sn.exec(e):null;return t?rn[t[1]]??null:ln(e)}function ln(e){if(!e)return null;let t=e.split(/\s+/).filter(n=>!n.slice(0,n.lastIndexOf(":")+1).includes("&")).map(n=>n.slice(n.lastIndexOf(":")+1));for(let[n,a]of on)if(t.includes(n))return a;return null}var u={heading:"space-grotesk",heading2:"space-grotesk",heading3:"space-grotesk",body:"inter",accent:"fraunces",label:"jetbrains-mono"};function cn(e){let t=n=>{let a=e?.[n];if(a&&f.has(a))return a;if(n==="heading2"||n==="heading3"){let o=e?.heading;return o&&f.has(o)?o:u.heading}return u[n]};return Object.fromEntries(we.map(n=>[n,t(n)]))}function dn(e,t){return f.get(e[t])??f.get(u[t])}function g(e,t){return`var(${dn(e,t).cssVar})`}var fa=[...new Set(we.map(e=>f.get(u[e]).cssVar))],ma=[...new Set(Ce.map(e=>e.cssVar))];function Sa(e){let t=cn(e);return{"--font-role-heading":g(t,"heading"),"--font-role-heading2":g(t,"heading2"),"--font-role-heading3":g(t,"heading3"),"--font-role-body":g(t,"body"),"--font-role-accent":g(t,"accent"),"--font-role-label":g(t,"label"),fontFamily:"var(--font-role-body)"}}var Oe=un({settings:null,setSettings:()=>{},primeSettings:()=>{},websiteName:null,templateChrome:!1,templateName:null,chromePlaceholder:!1,themeMode:U,setThemeMode:()=>{},themeSwitchShown:!1,setThemeSwitchShown:()=>{},theme:I,setTheme:()=>{},fonts:u,setFonts:()=>{},sizes:z,setSizes:()=>{},cornerRadiusPx:null,setCornerRadiusPx:()=>{},cardShadow:null,setCardShadow:()=>{},shadowColor:null,setShadowColor:()=>{},cardGap:H,setCardGap:()=>{},hoverEffect:null,setHoverEffect:()=>{},headingCompression:b,setHeadingCompression:()=>{},siteWidth:null,setSiteWidth:()=>{},siteGutter:null,blockGap:null,setSiteGutter:()=>{},setBlockGap:()=>{},headingTypography:$,setHeadingTypography:()=>{},textStyles:null,setTextStyles:()=>{},wordStyles:null,heroBackgroundFollowsWidth:null,setHeroBackgroundFollowsWidth:()=>{},sectionBackgroundWidth:null,setSectionBackgroundWidth:()=>{},sectionContentWidth:null,setSectionContentWidth:()=>{},photographyGrayscale:null,setPhotographyGrayscale:()=>{},shareButtonOnPosts:null,setShareButtonOnPosts:()=>{},themeFromDocument:!1,selected:!1,setSelected:()=>{},select:()=>{},setSelectHandler:()=>{}});function Ca({children:e,websiteName:t=null,templateChrome:n=!1,templateName:a=null,chromePlaceholder:o=!1,themeMode:l=U,onThemeModeChange:i,themeSwitchShown:d=!1,onThemeSwitchShownChange:T,theme:A=I,onThemeChange:m,fonts:S=u,onFontsChange:p,sizes:_=z,onSizesChange:c,cornerRadiusPx:R=null,onCornerRadiusPxChange:C,cardShadow:x=null,onCardShadowChange:w,shadowColor:Pe=null,onShadowColorChange:V,cardGap:De=H,onCardGapChange:Y,hoverEffect:Fe=null,onHoverEffectChange:X,headingCompression:Ne=b,onHeadingCompressionChange:j,siteWidth:Ge=null,onSiteWidthChange:q,siteGutter:ve=null,blockGap:Ue=null,onSiteGutterChange:K,onBlockGapChange:Z,headingTypography:Be=$,onHeadingTypographyChange:J,textStyles:We=null,onTextStylesChange:Q,wordStyles:ze=null,heroBackgroundFollowsWidth:$e=null,onHeroBackgroundFollowsWidthChange:ee,sectionBackgroundWidth:Ve=null,onSectionBackgroundWidthChange:te,sectionContentWidth:Ye=null,onSectionContentWidthChange:ne,photographyGrayscale:Xe=null,onPhotographyGrayscaleChange:ae,shareButtonOnPosts:je=null,onShareButtonOnPostsChange:oe,themeFromDocument:qe=!1}){let[E,se]=ke(null),Ke=r(s=>se(At=>At??s),[]),[Ze,Je]=ke(!1),Qe=r(s=>i?.(s),[i]),et=r(s=>T?.(s),[T]),tt=r(s=>m?.(s),[m]),nt=r(s=>p?.(s),[p]),at=r(s=>c?.(s),[c]),ot=r(s=>q?.(s),[q]),st=r(s=>K?.(s),[K]),rt=r(s=>Z?.(s),[Z]),it=r(s=>ee?.(s),[ee]),lt=r(s=>te?.(s),[te]),ct=r(s=>ne?.(s),[ne]),dt=r(s=>ae?.(s),[ae]),ut=r(s=>oe?.(s),[oe]),ht=r(s=>C?.(s),[C]),gt=r(s=>w?.(s),[w]),ft=r(s=>V?.(s),[V]),mt=r(s=>Y?.(s),[Y]),St=r(s=>X?.(s),[X]),pt=r(s=>j?.(s),[j]),_t=r(s=>J?.(s),[J]),Et=r(s=>Q?.(s),[Q]),{select:yt,setSelectHandler:bt}=fn(),re=E?.logoUrl,ie=E?.logoReversed,le=E?.logoInkIsDark,ce=E!==null,Tt=gn(()=>({logo:ce?{logoUrl:re,logoReversed:ie,logoInkIsDark:le}:null,placeholder:n||o,wordmark:n?a:t}),[ce,re,ie,le,n,o,a,t]);return Le(P.Provider,{value:Tt,children:Le(Oe.Provider,{value:{settings:E,setSettings:se,primeSettings:Ke,websiteName:t,templateChrome:n,templateName:a,chromePlaceholder:o,themeMode:l,setThemeMode:Qe,themeSwitchShown:d,setThemeSwitchShown:et,theme:A,setTheme:tt,fonts:S,setFonts:nt,sizes:_,setSizes:at,cornerRadiusPx:R,setCornerRadiusPx:ht,cardShadow:x,setCardShadow:gt,shadowColor:Pe,setShadowColor:ft,cardGap:De,setCardGap:mt,hoverEffect:Fe,setHoverEffect:St,headingCompression:Ne,setHeadingCompression:pt,siteWidth:Ge,setSiteWidth:ot,siteGutter:ve,blockGap:Ue,setSiteGutter:st,setBlockGap:rt,headingTypography:Be,setHeadingTypography:_t,textStyles:We,setTextStyles:Et,wordStyles:ze,heroBackgroundFollowsWidth:$e,setHeroBackgroundFollowsWidth:it,sectionBackgroundWidth:Ve,setSectionBackgroundWidth:lt,sectionContentWidth:Ye,setSectionContentWidth:ct,photographyGrayscale:Xe,setPhotographyGrayscale:dt,shareButtonOnPosts:je,setShareButtonOnPosts:ut,themeFromDocument:qe,selected:Ze,setSelected:Je,select:yt,setSelectHandler:bt},children:e})})}var wa=()=>hn(Oe);import{forwardRef as mn}from"react";import{imageCopyUrl as He,imageSrcSet as Re}from"efficient-shell/image-copies";import{jsx as _n}from"react/jsx-runtime";var Sn={position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,color:"transparent"};function xe(e,t,n){if(n){let a=Re(e);return a?{src:He(e,1280),srcSet:a,sizes:n}:{src:e,sizes:n}}if(t&&t>0){let a=Re(e,{maxWidth:t*3});return a?{src:He(e,t*2),srcSet:a,sizes:`${t}px`}:{src:e}}return{src:e}}var pn=mn(function({src:t,width:n,height:a,fill:o,priority:l,loading:i,style:d,quality:T,placeholder:A,blurDataURL:m,unoptimized:S,loader:p,overrideSrc:_,sizes:c,...R},C){let x=_??(typeof t=="string"?t:t.src),w=xe(x,o?void 0:Number(n)||void 0,c??(o?"100vw":void 0));return _n("img",{ref:C,...w,width:o?void 0:n,height:o?void 0:a,loading:l?"eager":i??"lazy",fetchPriority:l?"high":void 0,decoding:"async",style:o?{...Sn,...d}:{color:"transparent",...d},...R})}),Oa=pn;function Ha(e){let t=e.overrideSrc??(typeof e.src=="string"?e.src:e.src.src),n=e.fill?void 0:Number(e.width)||void 0;return{props:xe(t,n,e.sizes??(e.fill?"100vw":void 0))}}import{forwardRef as En}from"react";import{jsx as Tn}from"react/jsx-runtime";function yn(e){if(typeof e=="string")return e;let t=e.query?`?${new URLSearchParams(e.query).toString()}`:"",n=e.hash?e.hash.startsWith("#")?e.hash:`#${e.hash}`:"";return`${e.pathname??""}${t}${n}`}var bn=En(function({href:t,prefetch:n,replace:a,scroll:o,shallow:l,legacyBehavior:i,passHref:d,locale:T,onClick:A,children:m,...S},p){let _=c=>{A?.(c),!(c.defaultPrevented||S.target==="_blank")&&c.preventDefault()};return Tn("a",{ref:p,href:yn(t),onClick:_,...S,children:m})}),Pa=bn;var An="Website";function Na(e){return e?.trim()||An}var Me=["instagram","facebook","tiktok","youtube","x","linkedin","pinterest","whatsapp","telegram","line","wechat"],Cn={instagram:"Instagram",facebook:"Facebook",tiktok:"TikTok",youtube:"YouTube",x:"X",linkedin:"LinkedIn",pinterest:"Pinterest",whatsapp:"WhatsApp",telegram:"Telegram",line:"LINE",wechat:"WeChat"},wn={};function va(e){if(!e||typeof e!="object")return wn;let t={};for(let n of Me){let a=e[n];if(typeof a!="string")continue;let o=a.trim();!o||!/^https?:\/\//i.test(o)||(t[n]=o)}return t}function Ua(e){return Me.flatMap(t=>{let n=e[t];return n?[{platform:t,href:n,label:Cn[t]}]:[]})}var Ba=e=>`${e}_url`;var za={small:54,medium:66,large:84},Ln=44,$a=16,Va=140,Ya=Ln*4;export{Oa as a,Ha as b,Pa as c,Ce as d,da as e,we as f,ua as g,ha as h,ga as i,ln as j,u as k,cn as l,Sa as m,Mn as n,Pn as o,Dn as p,Fn as q,U as r,Nn as s,h as t,kt as u,he as v,Gn as w,vn as x,y,ge as z,xt as A,Un as B,Bn as C,O as D,Wn as E,zn as F,$n as G,W as H,Vn as I,fe as J,Dt as K,Yn as L,Xn as M,jn as N,qn as O,Kn as P,z as Q,Ut as R,Zn as S,Jn as T,Se as U,zt as V,Qn as W,pe as X,Vt as Y,ea as Z,Yt as _,Xt as $,_e as aa,H as ba,Kt as ca,Zt as da,Jt as ea,Ee as fa,ye as ga,Qt as ha,be as ia,en as ja,ta as ka,na as la,aa as ma,oa as na,b as oa,Te as pa,sa as qa,ra,$ as sa,Ae as ta,ia as ua,la as va,de as wa,Rn as xa,Ca as ya,wa as za,An as Aa,Na as Ba,Me as Ca,Cn as Da,wn as Ea,va as Fa,Ua as Ga,Ba as Ha,za as Ia,Ln as Ja,$a as Ka,Va as La,Ya as Ma};
|