efficient-web-builder 62.0.0 → 64.0.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 +48 -0
- package/dist/editor/components/PreviewPartAnchors.js +1 -1
- package/dist/editor/lib/animation/fields.js +1 -1
- package/dist/editor/lib/animation/loop-fields.js +1 -1
- package/dist/editor/lib/animation/scroll-fields.d.ts +3 -0
- package/dist/editor/lib/animation/scroll-fields.js +1 -0
- package/dist/editor/lib/document/blocks/general/IntroBleed/fields.js +1 -1
- package/dist/editor/lib/document/card-display-chips.d.ts +3 -2
- package/dist/editor/lib/document/card-display-chips.js +1 -1
- package/dist/editor/lib/document/card-row-fields.js +1 -1
- package/dist/editor/lib/document/controls.d.ts +7 -2
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/document/field-groups.js +1 -1
- package/dist/editor/lib/document/part-motion-canvas.d.ts +2 -1
- package/dist/editor/lib/document/part-motion-canvas.js +1 -1
- package/dist/format/lib/animation/hover.d.ts +4 -2
- package/dist/format/lib/animation/hover.js +1 -1
- package/dist/format/lib/animation/loop.d.ts +1 -0
- package/dist/format/lib/animation/loop.js +1 -1
- package/dist/format/lib/animation/mark-zoom.d.ts +11 -0
- package/dist/format/lib/animation/mark-zoom.js +1 -0
- package/dist/format/lib/animation/scroll.d.ts +20 -0
- package/dist/format/lib/animation/scroll.js +1 -0
- package/dist/format/lib/content/block-sources.js +1 -1
- package/dist/format/lib/content/box-shape.d.ts +1 -1
- package/dist/format/lib/content/card-state.d.ts +11 -1
- package/dist/format/lib/content/card-state.js +1 -1
- package/dist/format/lib/content/card-template.d.ts +10 -5
- package/dist/format/lib/content/card-template.js +1 -1
- package/dist/format/lib/content/image-aspect.d.ts +6 -0
- package/dist/format/lib/content/image-aspect.js +1 -1
- package/dist/format/lib/content/section-sticky.d.ts +29 -13
- package/dist/format/lib/content/section-sticky.js +1 -1
- package/dist/format/lib/content/slot-field-blocks.d.ts +1 -0
- package/dist/format/lib/content/slot-field-blocks.js +1 -0
- package/dist/format/lib/document/blocks/block-types.d.ts +2 -0
- package/dist/format/lib/document/blocks/general/Banner/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/ContactLocations/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/FeaturedCover/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/Hero/meta.d.ts +1 -0
- package/dist/format/lib/document/blocks/general/Hero/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/HeroSingle/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/ImageBlock/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/IntroBleed/meta.js +2 -2
- package/dist/format/lib/document/blocks/general/LogoBlock/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/Logos/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/LongRead/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/Manifesto/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/PaymentBadges/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/PostCard/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/ProcessSteps/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/SectionHeader/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/Split/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/Timeline/meta.js +1 -1
- package/dist/format/lib/document/easel-row-words.d.ts +7 -0
- package/dist/format/lib/document/easel-row-words.js +1 -1
- package/dist/format/lib/document/passes/types.d.ts +5 -1
- package/dist/format/lib/editor-words-catalogue.d.ts +11 -0
- package/dist/format/lib/editor-words-catalogue.js +4 -4
- package/dist/format/lib/editor-words-kept.js +1 -1
- package/dist/format/lib/sections/hero-single-to-hero.js +1 -1
- package/dist/format/lib/source-rules/no-hard-coded-option-rows.d.ts +30 -0
- package/dist/format/lib/source-rules/no-hard-coded-option-rows.js +1 -0
- package/dist/render/components/Banner.js +1 -1
- package/dist/render/components/CardRowContext.d.ts +1 -0
- package/dist/render/components/CardRowContext.js +1 -1
- package/dist/render/components/ContactLocations.js +2 -2
- package/dist/render/components/HeroPictures.d.ts +22 -2
- package/dist/render/components/HeroPictures.js +1 -1
- package/dist/render/components/HeroSection.js +1 -1
- package/dist/render/components/HeroSingle.js +1 -1
- package/dist/render/components/HeroSlide.js +1 -1
- package/dist/render/components/ImageBlock.js +1 -1
- package/dist/render/components/InBoxContext.d.ts +2 -1
- package/dist/render/components/InBoxContext.js +1 -1
- package/dist/render/components/IntroBleed.d.ts +1 -2
- package/dist/render/components/IntroBleed.js +1 -1
- package/dist/render/components/LogoBlock.js +1 -1
- package/dist/render/components/Logos.js +1 -1
- package/dist/render/components/PictureZoom.d.ts +24 -0
- package/dist/render/components/PictureZoom.js +1 -0
- package/dist/render/components/Placeholder.js +1 -1
- package/dist/render/components/PublishedPartStylesContext.js +1 -1
- package/dist/render/components/ScrollEffect.d.ts +14 -0
- package/dist/render/components/ScrollEffect.js +1 -0
- package/dist/render/components/ScrollProgressArm.d.ts +5 -0
- package/dist/render/components/ScrollProgressArm.js +1 -0
- package/dist/render/components/SectionAnimation.d.ts +4 -0
- package/dist/render/components/SectionAnimation.js +1 -1
- package/dist/render/components/SectionHeader.js +1 -1
- package/dist/render/components/Text.d.ts +2 -1
- package/dist/render/components/Text.js +1 -1
- package/dist/render/components/goldPhrases.d.ts +2 -1
- package/dist/render/components/goldPhrases.js +3 -2
- package/dist/render/lib/animation/part-motion.d.ts +4 -1
- package/dist/render/lib/animation/part-motion.js +2 -2
- package/dist/render/lib/document/blocks/general/CardList/render.js +1 -1
- package/dist/render/lib/document/blocks/general/IntroBleed/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Text/render.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-editorial.js +1 -1
- package/dist/render/lib/document/page-frame.d.ts +2 -1
- package/dist/render/lib/document/page-frame.js +1 -1
- package/dist/render/lib/document/part-styles.d.ts +9 -0
- package/dist/render/lib/document/part-styles.js +2 -2
- package/dist/render/lib/document/passes/index.js +1 -1
- package/dist/render/lib/document/passes/scroll-effect.d.ts +3 -0
- package/dist/render/lib/document/passes/scroll-effect.js +1 -0
- package/dist/render/lib/document/passes/section-sticky.js +1 -1
- package/dist/render/lib/document/passes/slots-start-afresh.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,53 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 64.0.0 - 2026-11-09
|
|
4
|
+
|
|
5
|
+
From main at `283356c0`: #598, #661, #663. A MAJOR: #598 has `!` (8 exports removed, one prop removed). Peers do not move: `efficient-easel` `^30.1.0`, `efficient-shell` `^12.18.0` (every shell name these PRs import is in 12.18.0). No stored key or value moves.
|
|
6
|
+
|
|
7
|
+
**BREAKING (#598):** `lib/content/section-sticky` no longer exports `SECTION_STICK_CLASS`, `SCROLL_OVER_CLASS`, `SECTION_STICK_TABLET_ON_CLASS`, `SECTION_STICK_TABLET_OFF_CLASS`, `SECTION_STICK_PHONE_ON_CLASS`, `SECTION_STICK_PHONE_OFF_CLASS`, `SECTION_STICK_VARS` or `sectionStickAttrs` (use `sectionPinAttrs`). `components/IntroBleed` no longer takes `sticky`. Every pin draws through efficient-shell's one pin (`data-motion-pin`); each view's answer is written as `--sf-pin-distance` / `--sf-pin-position` for the host's sheet.
|
|
8
|
+
|
|
9
|
+
**For hosts:**
|
|
10
|
+
- Take efficient-storefront-blocks 0.94.0 (or later) first. Its page sheet maps `--sf-pin-on` / `--sf-pin-length` per view to the shell's track (blocks #449). Without it, every Screens track plays at 2 screens and stays on in every view.
|
|
11
|
+
- The storefront takes this release only together with the web-builder 63 hold: the PR that mounts `ThemeLightInkProvider` (#651).
|
|
12
|
+
- A host that registers card templates: `registerCardTemplates` throws for a block that declares slot fields and has an `everySource` field or a source that names it; `registerBlockSources` throws for a source that names a block with slot fields (#661).
|
|
13
|
+
- Stored `sticky` on a Scroll-Over intro is still read (as `stickTop` on, distance 0) while no `stickTop` is stored (#598). The old blocks class rules (`.sf-section-stick*`, `.sf-scroll-over`) stay until the clean-up after the stored pages move.
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- **Scroll effects on the Animation tab** (#663): every block, section, Box and part (text, picture, button) plays one of efficient-shell's `SCROLL_EFFECTS` (Zoom in/out, Fade in/out, Move up/down, Reveal, Parallax) with Zoom, Start and End, per view. Keys `scroll`, `scrollZoom`, `scrollStart`, `scrollEnd` (+ Tablet / Phone), and the same keys in a part's `_partMotion`. One reader: `scrollOf` (`lib/animation/scroll`).
|
|
18
|
+
- **Screens under "Pin while scrolling"** (#663): 0-4 (shell `PIN_LENGTH`) for a top-level section or Box; above 0 the pin draws the shell's track form. Keys `stickTopScreens` + view twins (`SECTION_PIN_SCREENS_KEYS`).
|
|
19
|
+
- **`ScrollProgressArm`** (#663): arms the shell's scroll-progress fallback once per published page.
|
|
20
|
+
- **Fields per named slot** (#661): `CardTemplateSlotSpec.fields?`; new `cardTemplateSlotOf(appState, id)`; `cardTemplateFieldsOf`, `cardTemplateField`, `rowFilledProps`, `defaultListField`, `cardListShows` and `cardChipLabel` take an optional slot. New module `lib/content/slot-field-blocks`.
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- **Stick to top is "Pin while scrolling" on the Animation tab's Scroll kind** (#598), with the tab's dot while some view pins. Category bar and Contents keep their own "Stick to top" in Design.
|
|
25
|
+
- **The Scroll-Over intro's pin is the same pin** (#598): IntroBleed leaves `SECTION_STICK_EXCLUDED`.
|
|
26
|
+
- `usePhoneWidth`, `stickFields`, `followedStickPatch` and `paintPartMotion` take wider or optional arguments only (#663).
|
|
27
|
+
|
|
28
|
+
## 63.0.0 - 2026-11-09
|
|
29
|
+
|
|
30
|
+
From main at `beb99f54`: #656, #658, #659, #660. A MAJOR: #656 and #659 have `!`. No export is removed. No stored key or value moves.
|
|
31
|
+
|
|
32
|
+
**BREAKING (#656):** the peer `efficient-easel` moves to `^30.1.0` (was `^30.0.0`): easel 30.0.0 has no media-zones module. `efficient-shell` stays `^12.18.0`. `HOVER_MEDIA_KINDS` now follows easel's zone table: its type widens and its order changes. `HoverMediaKind` and every stored `hoverKind` value stay the same.
|
|
33
|
+
|
|
34
|
+
**BREAKING (#659):** `cardStateAttrs` (`format/lib/content/card-state`) now returns `CardStateAttrs` (the state attribute, a `className`, and on a picked copy a `style` with the picked ink); in 62.0.0 it returned `Record<string, string>`. A host that typed the result as `Record<string, string>` must type it as `CardStateAttrs`, or spread it onto the element. `renderChrome` now draws through `renderPlain`: a chrome value with a newline breaks onto lines (0 live US values have one).
|
|
35
|
+
|
|
36
|
+
**For hosts:**
|
|
37
|
+
- Install efficient-easel 30.1.0 or later with this release.
|
|
38
|
+
- **HOLD (#651, from 62.0.0) stays: the storefront takes this version ONLY in the PR that mounts `ThemeLightInkProvider` in efficient-storefront `app/layout.tsx`.**
|
|
39
|
+
- storefront-blocks: the Contact section can move its reason chips and topic cards onto the card template (`plain: true` fields, #659); the wheels filter rail can use `CardItemAction` `label` and `disabled` (#660) in place of its own aria code.
|
|
40
|
+
|
|
41
|
+
### Added
|
|
42
|
+
|
|
43
|
+
- **A guard against hard-coded shopper option rows** (#658): the rule `format/lib/source-rules/no-hard-coded-option-rows` and its guard. A list of buttons or choice roles drawn in code fails unless it is in the one exemption list.
|
|
44
|
+
- **`CardItemAction` `label` and `disabled`** (#660), and `CARD_ACTION_OFF_CLASS`. A disabled row is skipped by the keyboard, does nothing on press, and draws no hover frame.
|
|
45
|
+
|
|
46
|
+
### Changed
|
|
47
|
+
|
|
48
|
+
- **Picked rows show their words at full ink** (#659): a `selected` card-template copy swaps the theme's muted ink for the full text ink (`CARD_STATE_PICKED_INK`). A row field can be `plain` (its words print as typed). One home for plain words: `renderChrome` is `renderPlain`.
|
|
49
|
+
- **Card media kinds read easel's media zone table** (#656): `HOVER_MEDIA_KINDS` and `HOVER_MEDIA_KIND_LABELS` come from `efficient-easel/screen/lib/content/media-zones`.
|
|
50
|
+
|
|
3
51
|
## 62.0.0 - 2026-11-09
|
|
4
52
|
|
|
5
53
|
From main at `4ce0e69f`: #650, #651, #652, #653, #654, #655. A MAJOR: #653 has `!` (public names and a prop are removed). The peers stay `efficient-easel` `^30.0.0` and `efficient-shell` `^12.18.0`. No stored key or value moves.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as Y}from"react/jsx-runtime";import{readInks as $}from"../../format/lib/document/part-inks.js";import{useEffect as j,useRef as x}from"react";import{markOverlayPortal as G}from"../../format/lib/document/overlay-portal.js";import{usePreviewParts as q}from"efficient-easel/draw/client";import{usePartStyle as U}from"./PreviewPartStyleContext.js";import{usePreviewDevice as V}from"efficient-easel/draw/client";import{shownTier as Q}from"efficient-easel/screen/lib/document/device-fields";import{decodePartId as I,encodePartId as X}from"efficient-easel/draw";import{BLOCK_ATTRIBUTE as Z}from"efficient-easel/canvas";import{engagePartAnchors as tt}from"../lib/document/part-anchors.js";import{PART_ATTR as P,PART_STYLE_KIND_ATTR as b,PART_STYLE_OWNER_ATTR as et,partStyleOwnerOf as g}from"../../render/lib/document/text-parts.js";import{PART_STYLE_PROPERTIES as D,applyPartStyles as C,blockDrawsTextStyle as F,partFontKeyOf as rt,partShownDeclarations as ot,partStyleBase as nt,partStyleSource as st,storedPartStyle as it}from"../../render/lib/document/part-styles.js";import{fontRoleOfClassName as lt,styleRoleOfClassName as at}from"../../format/lib/fonts.js";import{typeScaleGroupOfClassName as k}from"../../format/lib/theme.js";import{styleKeyForPart as
|
|
1
|
+
"use client";import{jsx as Y}from"react/jsx-runtime";import{readInks as $}from"../../format/lib/document/part-inks.js";import{useEffect as j,useRef as x}from"react";import{markOverlayPortal as G}from"../../format/lib/document/overlay-portal.js";import{usePreviewParts as q}from"efficient-easel/draw/client";import{usePartStyle as U}from"./PreviewPartStyleContext.js";import{usePreviewDevice as V}from"efficient-easel/draw/client";import{shownTier as Q}from"efficient-easel/screen/lib/document/device-fields";import{decodePartId as I,encodePartId as X}from"efficient-easel/draw";import{BLOCK_ATTRIBUTE as Z}from"efficient-easel/canvas";import{engagePartAnchors as tt}from"../lib/document/part-anchors.js";import{PART_ATTR as P,PART_STYLE_KIND_ATTR as b,PART_STYLE_OWNER_ATTR as et,partStyleOwnerOf as g}from"../../render/lib/document/text-parts.js";import{PART_STYLE_PROPERTIES as D,applyPartStyles as C,blockDrawsTextStyle as F,partFontKeyOf as rt,partShownDeclarations as ot,partStyleBase as nt,partStyleSource as st,storedPartStyle as it}from"../../render/lib/document/part-styles.js";import{fontRoleOfClassName as lt,styleRoleOfClassName as at}from"../../format/lib/fonts.js";import{typeScaleGroupOfClassName as k}from"../../format/lib/theme.js";import{styleKeyForPart as h}from"../../format/lib/sections/section-text-kinds.js";import{NO_MOTIONS as pt,PART_HOST_ATTR as ct}from"../../render/lib/animation/part-motion.js";import{paintPartMotion as ft}from"../lib/document/part-motion-canvas.js";function ut(c){let s=null,o=null;for(let e=c;e&&(s===null||o===null);e=e.parentElement){const r=e.getAttribute("class");s??=at(r),o??=k(r)}return{faceRole:s??"body",sizeGroup:o}}function z(c,s={}){const o=c.style,e={};for(const n of D)e[n]=o[n]??"",o[n]="";s.fontFamily&&(o.fontFamily=s.fontFamily),s.fontSize&&(o.fontSize=s.fontSize);const r=getComputedStyle(c),S=getComputedStyle(c.ownerDocument.documentElement),a=nt({fontSize:r.fontSize,fontWeight:r.fontWeight,lineHeight:r.lineHeight,letterSpacing:r.letterSpacing,textAlign:r.textAlign,textTransform:r.textTransform,paddingTop:r.paddingTop},rt(r.fontFamily,n=>S.getPropertyValue(n)));for(const n of D)o[n]=e[n];return a}function mt({needles:c,styles:s,motions:o=pt,type:e,children:r}){const S=x(null),{selectedPartId:a}=q(),{setPartStyle:n}=U(),f=Q(V()),A=JSON.stringify(c),R=JSON.stringify(s),w=JSON.stringify(o),J=x(new Map);return j(()=>{const d=S.current;if(!d)return;const E=[],_=()=>d.parentElement,M=p=>{const i=_();if(!i)return null;const m=new MutationObserver(p);return m.observe(i,{attributes:!0,attributeFilter:[Z]}),()=>m.disconnect()},L=p=>{const i=new MutationObserver(p);return i.observe(d,{childList:!0,subtree:!0,characterData:!0}),()=>i.disconnect()};let u=[];E.push(()=>{for(const p of u)p();u=[]});const W=JSON.parse(A),T=JSON.parse(R),B=JSON.parse(w),H=tt(d,W,_,M,(p,i,m)=>{for(const t of u)t();u=[];const v=[];for(const t of m){const l=t,y=G(l);y&&u.push(y),l.getAttribute(P)===a&&v.push(l)}const K=st(i,a,v,t=>lt(t)!==null||k(t)!==null);if(K&&a){const t=K,l=I(a)?.propKey??"",y=g(t)?{}:ot(it(T,h(e,l)),f,{blockDrawsStyle:F(e,l)});n({partId:a,...ut(t),base:z(t,y),inks:$(t),...(()=>{const N=g(t);return N?{styleOwner:N}:{}})()})}C(m.filter(t=>!g(t)).map(t=>({element:t,partId:t.getAttribute(P)??""})),T,t=>z(t),t=>h(e,t),void 0,f,t=>F(e,t));const O=[...d.querySelectorAll(`[${et}="${CSS.escape(i)}"][${b}]`)];O.length&&C(O.map(t=>({element:t,partId:X(i,t.getAttribute(b)??"")})),T,void 0,t=>t,void 0,f),u.push(ft([...m.filter(t=>!g(t)).map(t=>{const l=t,y=I(l.getAttribute(P)??"")?.propKey??"";return{element:l,partKey:h(e,y)}}),...O.map(t=>({element:t,partKey:t.getAttribute(b)??""}))],t=>B[t],f==="mobile"?"phone":f,J.current))},L);return()=>{H();for(const p of E)p()}},[A,R,w,a,n,f,e]),Y("div",{ref:S,[ct]:"",style:{display:"contents"},children:r})}export{mt as default,z as measureStyleBase,ut as styleTagsOf};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{loopDelayField as
|
|
1
|
+
import{loopDelayField as l,loopDurationField as m}from"./AnimationDurationRow.js";import{entranceFields as r}from"./entrance-fields.js";import{scrollFields as e}from"./scroll-fields.js";import{HOVER_GROUP_KEY as p,HOVER_KEY as a,cardHoverResting as u,pictureHoverResting as d}from"../../../format/lib/animation/hover.js";import{boxHoverFields as f,cardHoverFields as F,hoverFields as _,pictureHoverFields as O}from"./hover-fields.js";import{ON_A_CARD as R}from"../document/card-display-chips.js";import{customize as H}from"efficient-easel/screen/lib/document/box-fields";import{loopDirectionField as D,loopFields as v,loopHeading as h}from"./loop-fields.js";import{LOOP_GROUP_KEY as E}from"../../../format/lib/animation/loop.js";import{withRowsShownWhen as i}from"../../../format/lib/document/show-when-attach.js";import{BOX_IS_CARD_RULE as s}from"../../../format/lib/content/box-card-rule.js";function b(){const t=f(),o=[p,a],n=i(t,Object.keys(t).filter(c=>!o.includes(c)),s);return i(n,o,{any:[s,R]})}function G(t,o=""){switch(t){case"section":case"block":return{...r(),...e()};case"box":return{...r(),...e(),...v(),...b()};case"picture":return{...r(),...e(),...O(d(o),o)};case"textPart":return{...r(),...e(),..._()};case"cards":return{...r(),...e(),...F(u(o))};case"marquee":return{...r(),...e(),[E]:h(),_cLoop:H(),scrollDirection:D(),loopDuration:m({readsSpeed:!0}),loopDelay:l()}}}export{G as animationTabFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{DirectionIcon as s,LoopMarqueeIcon as c,NoSymbolIcon as
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{DirectionIcon as s,LoopMarqueeIcon as c,NoSymbolIcon as O}from"efficient-easel/icons";import{customize as a,describedAs as m,group as f}from"efficient-easel/screen/lib/document/box-fields";import{effectTiles as L}from"efficient-easel/screen/lib/document/effect-tiles";import{EDGE_ARROWS as u,edgePad as _}from"../document/controls.js";import{withShowWhen as n}from"../../../format/lib/document/show-when-attach.js";import{loopDelayField as d,loopDurationField as D}from"./AnimationDurationRow.js";import{say as l}from"../../../format/lib/editor-words.js";import{DEFAULT_LOOP_DIRECTION as P,LOOP_DIRECTION_OPTIONS as I,LOOP_GROUP_KEY as E,LOOP_NONE as S,LOOP_OPTIONS as p,LOOP_SCROLLS as r}from"../../../format/lib/animation/loop.js";function T(){return _("Direction",I,P,"A marquee cannot run diagonally, so the corners are not answers.",t(s,{}),u)}const N=o=>f("Loop",o?{dot:o}:void 0),b={none:()=>t(O,{}),scroll:()=>t(c,{})};function y(){const o=L({label:l("Loop"),options:p.map(({value:e,label:i})=>({value:e,label:l(i),picture:b[e]()})),fallback:S});return m(o,{type:"select",label:"Loop",options:p.map(({value:e,label:i})=>({value:e,label:i}))})}function j(){return{[E]:N(r),loop:y(),_cLoop:a(),scrollDirection:n(T(),r),loopDuration:n(D({readsSpeed:!1}),r),loopDelay:n(d(),r)}}export{T as loopDirectionField,j as loopFields,N as loopHeading};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,Fragment as v,jsxs as x}from"react/jsx-runtime";import{SettingsDefaultReset as h}from"efficient-easel/panel";import{EntranceRevealIcon as T,NoSymbolIcon as b,PercentIcon as E,ScrollFadeInIcon as M,ScrollFadeOutIcon as Z,ScrollMoveDownIcon as y,ScrollMoveUpIcon as z,ScrollParallaxIcon as P,ScrollZoomInIcon as V,ScrollZoomOutIcon as g,ZoomInIcon as U}from"efficient-easel/icons";import{effectTiles as W}from"efficient-easel/screen/lib/document/effect-tiles";import{VIEW_KEY_ACCESS as w,customize as k,describedAs as A,group as K,onDesktopWords as N,phoneTwinFields as L}from"efficient-easel/screen/lib/document/box-fields";import{SCROLL_EFFECTS as f,SCROLL_EFFECTS_WITH_ZOOM as Y,SCROLL_END as j,SCROLL_START as D,SCROLL_ZOOM as G}from"efficient-shell/format";import{slider as B}from"../document/box-fields.js";import{useSelectedProps as O}from"../document/controls.js";import{shownByUsedValue as H,withRowRules as q}from"../../../format/lib/document/show-when-attach.js";import{editorEaselWords as J,say as i}from"../../../format/lib/editor-words.js";import{SCROLL_CUSTOMIZE_KEY as Q,SCROLL_GROUP_KEY as X,SCROLL_KEYS as t,scrollOf as R,scrollViewKey as d}from"../../../format/lib/animation/scroll.js";const u="Scroll",S={none:"None","zoom-in":"Zoom in","zoom-out":"Zoom out","fade-in":"Fade in","fade-out":"Fade out","move-up":"Move up","move-down":"Move down",reveal:"Reveal",parallax:"Parallax"},$={none:()=>e(b,{}),"zoom-in":()=>e(V,{}),"zoom-out":()=>e(g,{}),"fade-in":()=>e(M,{}),"fade-out":()=>e(Z,{}),"move-up":()=>e(z,{}),"move-down":()=>e(y,{}),reveal:()=>e(T,{}),parallax:()=>e(P,{})},oo="Effect",_=f.filter(o=>o!=="none"),m=["desktop","tablet","phone"],C=(o,l)=>H(m.slice(0,m.indexOf(o)+1).reverse().map(n=>d(t.effect,n)),n=>({field:n,set:!0}),n=>({field:n,in:l})),eo={any:m.map(o=>({field:d(t.effect,o),in:_}))},no=m.flatMap(o=>[[[d(t.zoom,o)],C(o,Y)],[[d(t.start,o),d(t.end,o)],C(o,_)]]),to=W({label:i(u),options:f.map(o=>({value:o,label:i(S[o]),picture:$[o]()})),fallback:"none"}),lo=o=>typeof o=="string"&&f.includes(o);function ro(o){const l=lo(o.value),n="follows"in o,r=R(O(),o.followsView??"desktop").effect,s=l?o.value:n?r:"none",c=to.render;return x(v,{children:[c({value:s,onChange:a=>o.onChange(a??"none")}),n&&l&&e(h,{words:J()?.panel,label:i(oo),changed:!0,detail:N(a=>i(a),i(S[r]),o.followsView),onReset:()=>o.onChange(void 0)})]})}const so=()=>A({type:"custom",render:o=>e(ro,{...o})},{type:"select",label:u,options:f.map(o=>({value:o,label:S[o]}))});function co({row:o,part:l,...n}){const r=R(O(),n.followsView??"desktop")[l];return o({...n,follows:r})}const p=(o,l,n,r,s)=>{const c=B(n,r,s.min,s.max,s.step,s.default,"%"),a=c.render,F={...c,render:I=>e(co,{...I,row:a,part:l})};return L(o,c,w,{phoneRow:F})};function Ro(){const o={[X]:K(u,{dot:eo}),...L(t.effect,so(),w),[Q]:k(),...p(t.zoom,"zoom","Zoom",e(U,{}),G),...p(t.start,"start","Start",e(E,{}),D),...p(t.end,"end","End",e(E,{}),j)};return q(o,no)}export{eo as SCROLL_CHOSEN,Ro as scrollFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{keptByRow as g}from"efficient-easel/screen/lib/document/style-fields";import{CaseIcon as b,OpacityIcon as u,PlacementIcon as _,TextLinesIcon as a}from"efficient-easel/icons";import{colorInput as n,sizeField as r,text as y,textarea as s,toggle as k,upload as d}from"../../../controls.js";import{group as t}from"efficient-easel/screen/lib/document/box-fields";import{iconPickerRow as T,slider as l}from"../../../box-fields.js";import{INTRO_BLEED_PICTURES as f,LONG_WORD_CELL as x}from"../../../choice-pictures.js";import{deviceField as e,deviceNote as h}from"efficient-easel/screen/lib/document/device-fields";import{DEFAULT_INTRO_BLEED_LAYOUT as B,INTRO_BLEED_COPY_SHARE as o,INTRO_BLEED_LAYOUT_OPTIONS as O}from"../../../../../../format/lib/sections/intro-bleed-layout.js";import{heightField as c,ctaField as S}from"../../shared-fields.js";import{INTRO_PH as m}from"../../../../../../format/lib/document/blocks/general/IntroBleed/meta.js";const P={fields:{_dDevice:h(),_gContent:t("Content"),eyebrow:y("Eyebrow",m.eyebrow),title:s("Heading",m.title),body:s("Subtitle",m.body),uppercase:k("Uppercase heading",!1,i(b,{})),_gBackground:t("Background images"),imageSrc:e("desktop",d("Background image","image/*")),imageSrcMobile:e("mobile",d("Background image","image/*")),_gLayout:t("Layout"),layout:T("Text position",i(_,{}),O.map(p=>({...p,picture:f[p.value]})),B,{columns:2,cell:x}),heightDesktop:c("desktop"),heightMobile:c("mobile"),copyShareDesktop:e("desktop",l("Text height",i(a,{}),o.min,o.max,o.step,o.desktop,"%")),copyShareMobile:e("mobile",l("Text height",i(a,{}),o.min,o.max,o.step,o.mobile,"%")),sticky:g("stickTop"),overlay:l("Overlay",i(u,{}),0,100,5,60,"%"),_gTextDesktop:e("desktop",t("Text style")),titleSizeDesktop:e("desktop",r("Heading font size",32,120,1,96,"heading")),bodySizeDesktop:e("desktop",r("Subtitle font size",12,28,1,17,"body")),_gTextMobile:e("mobile",t("Text style")),titleSizeMobile:e("mobile",r("Heading font size",24,72,1,44,"heading")),bodySizeMobile:e("mobile",r("Subtitle font size",12,22,1,16,"body")),_gButton:t("Button"),...S,buttonColor:n("Button color","#C9A461"),buttonTextColor:n("Button text color","#000000")}};export{P as IntroBleedFields};
|
|
@@ -23,11 +23,12 @@ type ChipOwner = {
|
|
|
23
23
|
type?: unknown;
|
|
24
24
|
props?: Record<string, unknown>;
|
|
25
25
|
} | null | undefined;
|
|
26
|
-
export declare function cardChipLabel(child: Child, ownerType: string | undefined, layers: (child: Child) => string, owner?: ChipOwner, fields?: readonly CardRowFieldSpec[]): string;
|
|
27
|
-
export declare function CardDisplayChips({ card, ownerType, owner, fields, labelOf, write, readOnly, view, }: {
|
|
26
|
+
export declare function cardChipLabel(child: Child, ownerType: string | undefined, layers: (child: Child) => string, owner?: ChipOwner, fields?: readonly CardRowFieldSpec[], slot?: string): string;
|
|
27
|
+
export declare function CardDisplayChips({ card, ownerType, owner, fields, slot, labelOf, write, readOnly, view, }: {
|
|
28
28
|
card: Card;
|
|
29
29
|
ownerType: string | undefined;
|
|
30
30
|
owner?: ChipOwner;
|
|
31
|
+
slot?: string;
|
|
31
32
|
fields?: readonly CardRowFieldSpec[];
|
|
32
33
|
labelOf: (type: string) => string;
|
|
33
34
|
write: (next: (latest: Card) => Card) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as l}from"react/jsx-runtime";import{isNodeList as N}from"efficient-easel/data";import{useEasel as D}from"efficient-easel/easel";import{hiddenInView as _,hiddenKeyOf as k,hidePatch as A,slotChildName as T,slotChildRowName as F}from"efficient-easel/draw";import{cardListFieldsOf as P,cardTemplateCardOwner as g,cardTemplateSlotOf as j,namedRowField as E,rowFieldSpec as L}from"../../../format/lib/content/card-template.js";import{DisplayRow as x,useSelectedPatch as M}from"./controls.js";import{websiteNodeIsLocked as I}from"./locked-blocks.js";import{stripMarkup as $}from"../../../format/lib/markup.js";import{sourceRowName as B}from"../../../format/lib/document/source-row-name.js";import{withShowWhen as H}from"../../../format/lib/document/show-when-attach.js";import{deviceField as K}from"efficient-easel/screen/lib/document/device-fields";import{NoControlMark as V}from"efficient-easel/screen/lib/document/panel-no-control-mark";const R="notCardOfTemplate",W={not:{context:R,is:!0}},de={[R]:(e,n)=>{const t=g(n.appState,e.props?.id);return t===void 0?void 0:t===null}};function m(e){const n=e.props?.content;return N(n)?n:[]}const y=(e,n)=>_(e.props??{},n),X=(e,n)=>e.props?.[k(n)]!==void 0;function S(e,n=()=>!1,t="desktop"){return m(e).flatMap(o=>typeof o?.props?.id!="string"?[]:m(o).length&&!y(o,t)?S(o,n,t):n(o)?[]:[o])}function Y(e,n,t,o="desktop"){const r=S(e,t,o).map(p=>({child:p,name:n(p)})),a=new Set(r.map(p=>p.name)),s=new Set;return r.map(({child:p,name:i})=>{let d=i;if(s.has(i)){let u=2;for(;a.has(`${i} ${u}`);)u+=1;d=`${i} ${u}`,a.add(d)}return s.add(i),{id:p.props.id,label:d,shown:!y(p,o)}})}function O(e,n,t){const o=r=>t==="desktop"?y(r,t):X(r,t);return m(e).flatMap(r=>o(r)?n(r)?[]:[r,...O(r,n,t)]:O(r,n,t))}function q(e,n){const t={...e};for(const[r,a]of Object.entries(n))a===void 0||r===k("desktop")&&a===!1?delete t[r]:t[r]=a;return Object.keys(t).length===Object.keys(e).length&&Object.keys(t).every(r=>t[r]===e[r])?e:t}function w(e,n,t){const o=m(e);let r=!1;const a=o.map(s=>{if(r)return s;let p=s;if(s?.props?.id===n){const i=q(s.props,t(s.props));i!==s.props&&(p={...s,props:i})}else p=w(s,n,t);return r=p!==s,p});return r?{...e,props:{...e.props,content:a}}:e}function b(e,n,t,o="desktop"){return w(e,n,r=>o==="desktop"&&y({props:r},o)===!t?{}:A(r,o,!t))}function z(e,n,t){return t==="desktop"?b(e,n,!0,t):w(e,n,()=>({[k(t)]:void 0}))}function G(e,n,t,o,r,a){return T(e).trim()?t(e):L({ownerType:n,owner:o,fields:r,slot:a},E(e.props))?.label??t(e)}const J="This page is read-only.";function Q({card:e,ownerType:n,owner:t,fields:o,slot:r,labelOf:a,write:s,readOnly:p,view:i="desktop"}){const d=f=>F(f,a,$,void 0,B),u=f=>I(f.type,f),C=Y(e,f=>G(f,n,d,t,o,r),u,i);return C.length?l(x,{parts:C,changed:O(e,u,i).length>0,shown:f=>C.find(c=>c.id===f)?.shown??!0,disabledReason:p?J:void 0,onPress:(f,c)=>s(h=>b(h,f,c,i)),onReset:()=>s(f=>O(f,u,i).reduce((c,h)=>z(c,String(h.props.id),i),f))}):l(V,{})}function U(){try{const e=D(r=>r),n=e.config.components??{},t=e.selectedItem;if(!t)return null;const o=g(e.appState,t.props?.id);return{labelOf:r=>n[r]?.label??r,card:t,ownerType:typeof o?.type=="string"?o.type:void 0,owner:o,fields:P(e.appState,o),slot:j(e.appState,t.props?.id)??void 0}}catch{return null}}function Z({readOnly:e,view:n}){const t=U(),o=M();return t?l(Q,{...t,view:n,readOnly:e,write:r=>{e||o(a=>{const s={...t.card,props:a},p=r(s);return p===s?null:{content:p.props.content}})}}):l(x,{parts:[],changed:!1,shown:()=>!0,onPress:()=>{},onReset:()=>{}})}function ce(e){return H(K(e,{type:"custom",render:({readOnly:n})=>l(Z,{readOnly:n,view:e})}),W)}export{de as CARD_BOX_FACTS,Q as CardDisplayChips,R as NOT_CARD_OF_TEMPLATE,W as ON_A_CARD,G as cardChipLabel,ce as cardDisplayField,Y as cardDisplayItems,S as cardDisplayParts,b as withChildShown};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as f}from"react/jsx-runtime";import{GroundIcon as F,ListIcon as W}from"efficient-easel/icons";import{FieldGlyph as Y}from"../../components/FieldGlyph.js";import{BOX_IN_COPY as $,BOX_OUTSIDE_COPY as G}from"../../../format/lib/content/box-card-rule.js";import{CARD_LIST_FIELDS as U,CARD_LIST_TYPE as h,cardCopyPlace as I,cardListFieldsOf as X,cardListShows as J,cardTemplateFieldsOf as q,cardTemplateOwner as C,cardTemplateSlotOf as k}from"../../../format/lib/content/card-template.js";import{copyText as z,plainText as H,plainTextarea as Q,ThemeFillRow as V,withOffPage as Z}from"./controls.js";import{recordRowFields as E}from"../../../format/lib/content/record-row.js";import{recordTypesRevision as tt}from"../../../format/lib/content/record-types.js";import{editorRecordType as ot}from"../../../format/lib/document/editor-page-context.js";import{blockSourcesRevision as et,declaredBlockSource as L}from"../../../format/lib/content/block-sources.js";import{select as nt}from"./box-fields.js";import{withShowWhen as rt}from"../../../format/lib/document/show-when-attach.js";function A(t){const e=t?.data?.root,o=ot(e?.props)??"";return o&&E(o,"text").length?o:""}const D="outsideCardTemplate",pt={not:{context:D,is:!0}},ht={[D]:(t,e)=>{const o=C(e.appState,t.props?.id);if(o!==void 0)return o===null&&!A(e.appState)},[G]:(t,e)=>{const o=I(e.appState,t.props?.id);return o===void 0?void 0:!o.inCopy},[$]:(t,e)=>I(e.appState,t.props?.id)?.inCopy};function Ct(t,e,o){const l=e==="colour"||o?.content===!0,a=e==="link"?f(Y,{noun:"link"}):e==="colour"?f(F,{}):f(W,{}),n={...nt(t,a,[l?{label:"Manual",value:""}:{label:"Typed here",value:""}],""),cardRowKind:e,...l?{cardRowContent:!0}:null};return rt(n,pt)}function Ot(t){return t.kind==="link"?Z(H(t.label)):t.kind==="colour"?ct(t.label):t.multiline?Q(t.label):z(t.label)}function ct(t){return{type:"custom",render:({value:e,onChange:o})=>f(V,{label:t,icon:f(F,{}),value:e,shown:typeof e=="string"?e:"",onChange:o})}}function it(t){return!!(t&&typeof t=="object"&&"cardRowKind"in t)}const K=new WeakMap;function _t(t,e,o){const l=Object.keys(t).filter(p=>it(t[p]));if(!l.length)return t;const a=e.props??{},n=C(o.appState,a.id),c=typeof n?.type=="string"?n.type:"",O=n?k(o.appState,a.id)??"":"",d=l.map(p=>typeof a[p]=="string"?a[p].trim():""),P=L(n?.props),r=c===h?C(o.appState,n?.props?.id):null,_=r?k(o.appState,n?.props?.id)??void 0:void 0,j=r?J(n?.props,r.type,_):"",v=r?L(r.props):"",M=r?`${String(r.type??"")}\0${v}\0${_??""}`:"",B=c===h&&!r?JSON.stringify(n?.props?.[U]??null):"",S=n?"":A(o.appState),b=[c,O,P,j,M,B,et(),S,tt(),...d].join("\0");let m=K.get(t);m||K.set(t,m=new Map);const g=m.get(b);if(g)return g;const w={...t};return l.forEach((p,u)=>{const i=t[p],y=c===h?X(o.appState,n,i.cardRowKind):c?q(n,i.cardRowKind,O||void 0):E(S,i.cardRowKind);if(!d[u]&&(i.cardRowContent?!c||!y.length:!y.length&&!c&&S)){delete w[p];return}const R=d[u]&&!y.some(s=>s.key===d[u])?d[u]:"",x=i.cardRowKind==="list",N=(s,T)=>x&&T===0&&s.key!==d[u]?"":s.key;w[p]={...i,options:[...x?[]:i.options,...y.map((s,T)=>({label:s.label,value:N(s,T)})),...R?[{label:R,value:R}]:[]]}}),m.set(b,w),w}export{ht as CARD_ROW_FACTS,pt as IN_CARD_TEMPLATE,D as OUTSIDE_CARD_TEMPLATE,Ct as cardRowField,_t as cardRowFields,Ot as cardRowItemField};
|
|
@@ -9,6 +9,7 @@ import { type SettingsBorderValue } from "efficient-easel/panel";
|
|
|
9
9
|
import { type AlignmentPoint, FOCAL_DEFAULT } from "efficient-shell/ui";
|
|
10
10
|
import { type ColourChoice } from "./ColourControl.js";
|
|
11
11
|
import type { GeocodeState } from "../../../format/lib/content/contact.js";
|
|
12
|
+
import { SECTION_PIN_SCREENS_KEY } from "../../../format/lib/content/section-sticky.js";
|
|
12
13
|
import { type SectionHeightMode, type SectionHeightUnit } from "../../../format/lib/content/section-min-height.js";
|
|
13
14
|
import { type DirectionContainer } from "../../../format/lib/content/container-direction.js";
|
|
14
15
|
import { normalizeThemeColors } from "../../../format/lib/theme.js";
|
|
@@ -263,8 +264,12 @@ export declare function heightFollowedBy(view: PanelView, props: Record<string,
|
|
|
263
264
|
unit: SectionHeightUnit;
|
|
264
265
|
} | null;
|
|
265
266
|
export declare function followedHeightPatch(view: PanelView, props: Record<string, unknown>, base: "sectionHeightValue" | "sectionHeightUnit", next: unknown): Record<string, unknown> | null;
|
|
266
|
-
export declare function stickFields(
|
|
267
|
-
|
|
267
|
+
export declare function stickFields(opts?: {
|
|
268
|
+
intro?: boolean;
|
|
269
|
+
screens?: boolean;
|
|
270
|
+
}): Record<string, CustomField<undefined> | CustomField<boolean> | CustomField<number>>;
|
|
271
|
+
type StickNumberKey = "stickTopDistance" | typeof SECTION_PIN_SCREENS_KEY;
|
|
272
|
+
export declare function followedStickPatch(view: PanelView, props: Record<string, unknown>, next: unknown, base?: StickNumberKey, intro?: boolean): Record<string, unknown> | null;
|
|
268
273
|
export declare function anchorFields(): Record<string, CustomField<undefined> | CustomField<HidableValue>>;
|
|
269
274
|
export declare function dateTime(label: string, icon?: ReactNode, hint?: string): CustomField<string>;
|
|
270
275
|
export declare function date(label: string, icon?: ReactNode, hint?: string): CustomField<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as i,jsxs as A,Fragment as k}from"react/jsx-runtime";import{cloneElement as Ge,createContext as zt,useContext as Me,useEffect as Yt,useId as Ue,useRef as V,useState as z}from"react";import{useEasel as te,useSelectedHost as M}from"efficient-easel/easel";import{toDateKey as qt,fromDateKey as Jt}from"efficient-shell/format";import{say as l,editorEaselWords as y}from"../../../format/lib/editor-words.js";import{LOADING_SHOWS_LABELS as We,firstFrameHint as Zt,loadingShowsOf as Qt,loadingStillHint as en}from"../../../format/lib/hero-video.js";import{pageFramesFor as tn,usePageVideoFrames as nn}from"../page-video-frames.js";import{ScreenDocumentContext as on}from"efficient-easel/screen/components/ScreenDocumentContext";import{readHidable as Ke,hidableText as $e}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as pe,LINK_FIELD_MARKER as Xe,MEDIA_FIELD_MARKER as je,SCAFFOLD_FIELD_MARKER as Ve,TEXT_FIELD_MARKER as O,foldMetaOf as fe,textFieldIdentifier as rn}from"efficient-easel/draw";import ln from"../../components/ApplyCornersToSiblings.js";import{withShowWhen as ze}from"../../../render/lib/document/show-when.js";import sn from"../../components/TemplateFieldRow.js";import{CARD_IMAGE_RADIUS_STEP as an,CORNER_RADIUS_MAX as Ye,CORNER_RADIUS_MIN as U}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as cn,IMAGE_CORNERS_LABEL as dn}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as un}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as pn,GALLERY_LAYOUTS as ne,GALLERY_LAYOUT_KEYS as fn,galleryChoices as qe,galleryLayoutRatio as hn,galleryPictureCells as mn}from"../../../format/lib/content/gallery-layout.js";import{shellGlyphOf as gn}from"./shell-glyph.js";import{anchorSiblingsOf as bn,placementPoints as wn}from"../../../format/lib/hero-group-placement.js";import xn from"../../components/AnchorField.js";import Sn from"../../components/SourceStatus.js";import{AdjustIcon as yn,EyeIcon as Cn,AnimationIcon as _n,BackgroundIcon as Je,BorderAllIcon as Rn,BlockSectionIcon as Tn,ColumnWidthsIcon as he,ColumnsIcon as Ze,CornerIcon as Qe,DirectionDownIcon as On,DirectionLeftIcon as In,DirectionRightIcon as En,DirectionUpIcon as kn,EditIcon as Fn,GapIcon as Ln,GridIcon as Nn,GroundIcon as me,HashIcon as et,HeightIcon as An,ImageIcon as Pn,ListIcon as vn,LocationIcon as tt,PaddingBottomIcon as nt,PaddingLeftIcon as ot,PaddingRightIcon as rt,PaddingTopIcon as it,PageIcon as Bn,StickyIcon as Dn,SearchIcon as Hn,SquareIcon as Gn,TypeIcon as Mn,WidthIcon as Un}from"efficient-easel/icons";import{FieldGlyph as lt}from"../../components/FieldGlyph.js";import{resolvePageBackground as Wn}from"../../../format/lib/content/page-background.js";import{boxFillOf as Kn,boxFillSlot as ge}from"../../../format/lib/content/box-background.js";import{CORNER_SIDES as st,CORNER_SIDE_POINTS as $n,hasOwnSectionCorners as Xn,normalizeCornerSides as at}from"../../../format/lib/content/section-corners.js";import{enclosingPath as jn,enclosingSection as Vn}from"./enclosing-section.js";import{SettingsDefaultReset as C,SettingsDrill as zn,SettingsField as S,SettingsGroup as Yn,SettingsGroupSub as qn,SettingsSegmented as Jn,SettingsBorder as Zn,SettingsSidesEach as Qn,SettingsSwitch as be,borderSides as eo,borderStartEach as to}from"efficient-easel/panel";import{ListField as no}from"efficient-easel/fields";import{DisplayChips as oo}from"efficient-shell/ui";import{desktopDisplayChanged as ro,partShownOnDesktop as io,partShownOnPhone as lo,phoneDisplayChanged as so,withDesktopPart as ao,withPhonePart as co}from"../../../format/lib/content/part-display.js";import{AlignmentGrid as uo,Checkbox as po,ColorSwatch as fo,CornersInput as ho,DatePicker as mo,DateTimePicker as go,FOCAL_DEFAULT as bo,IconPicker as ct,COLUMN_COUNT_MAX as dt,COLUMN_SHARE_MIN as wo,COLUMN_SHARES_EQUAL as xo,resolveColumnShares as ut,WidthsBar as So,useShellStrings as yo,IconButton as pt,InputNumber as ft,Slider as Co,Tooltip as we}from"efficient-shell/ui";import{LOOKUP_BUSY_NOTE as _o}from"./geocode-resolve.js";import{ColourRow as oe,InheritedColourRow as ht}from"./ColourControl.js";import{fillThemeColors as Ro,slotFill as re}from"../../../format/lib/document/theme-slots.js";import{fillSlotNamed as xe}from"../../../format/lib/document/part-inks.js";import{keptByRow as To}from"efficient-easel/screen/lib/document/style-fields";import mt from"./MarkupToolbar.js";import{deviceField as R}from"efficient-easel/screen/lib/document/device-fields";import{NO_CONTROL_FIELD as Oo,NoControlMark as Io,noControlField as gt}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{OWN_BOX_FIELD as Eo}from"../../../format/lib/document/own-box.js";import{fieldPanelOnly as ko,PANEL_ONLY_FIELD as Fo}from"../../../format/lib/document/panel-only.js";import{PHONE_CLEAR as Lo,resolvePhoneValue as Se}from"../../../format/lib/document/phone-override.js";import{phoneKey as F,tabletKey as W}from"efficient-easel/draw";import{SuppressibleText as No}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as Ao,CARD_OUTLINE_OPTIONS as Po,DEFAULT_CARD_INDEX_FORMAT as vo,DEFAULT_CARD_OUTLINE as Bo}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as Do,DEFAULT_COVER_INDEX as Ho}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as Go}from"efficient-easel/draw";import Mo from"../../components/MediaUploadField.js";import Uo from"../../components/MultiSelectField.js";import Wo from"../../components/SectionThemePicker.js";import Ko from"../../components/SearchSelectField.js";import $o from"../../components/StorefrontLinkField.js";import{UiIcon as bt}from"efficient-easel/draw/client";import{SECTION_PADDING as I}from"../../../render/lib/content/section-padding.js";import{buttonWordsSummary as Xo}from"../../../render/lib/content/button-look.js";import{usePreviewParts as jo}from"efficient-easel/draw/client";import{encodePartId as Vo}from"efficient-easel/draw";import{DEFAULT_EASEL_STRINGS as zo,useEaselStrings as Yo}from"efficient-easel/strings";import{hasPhoneHeight as qo,hasTabletHeight as ye,resolveSectionMinHeight as Jo,resolveTabletHeight as Zo}from"../../../format/lib/content/section-min-height.js";import{SECTION_STICK_DISTANCE as ie,SECTION_STICK_LABEL as Ce,hasPhoneStick as Qo,hasTabletStick as er,resolveSectionStick as wt}from"../../../format/lib/content/section-sticky.js";import{SECTION_MIN_HEIGHT as tr,SECTION_MIN_HEIGHT_GROUP_LABEL as Y,SECTION_SCREEN_PCT as nr}from"../../../format/lib/content/section-min-height.js";import{containerDirectionPoints as or,resolveContainerDirection as xt}from"../../../format/lib/content/container-direction.js";import{BOX_BLOCK_SPACING_LABEL as rr,BOX_BLOCK_SPACING_POINTS as St,BOX_PHONE_ROW_LABEL as yt,BOX_COLUMNS_MAX as ir,BOX_COLUMNS_MIN as Ct,BOX_PHONE_ROW_MAX as lr,BOX_PHONE_ROW_MIN as _e,BOX_SHARE_CHOICES as _t,BOX_SHARE_LABEL as K,boxShareChoiceOf as Rt,boxShareWidthsOf as Re,BOX_SHARE_PHONE_DEFAULT as sr,BOX_SHARE_PHONE_POINTS as ar}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as v}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as cr,borderBySide as Tt}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as dr,normalizeTheme as Ot,normalizeThemeColors as ur,sectionBandTone as pr,surfaceTwoTone as fr}from"../../../format/lib/theme.js";import{CONTAINER_GAP as It,CONTAINER_GAP_BUILT_IN as hr,CONTAINER_GAP_PHONE as Te,GAP_FIELD_CONTAINER as Oe,followsSitePhoneGap as mr,hasOwnContainerGap as gr,hasOwnPhoneGap as Ie,resolveContainerGap as Et,resolvePhoneContainerGap as kt}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as br,CARD_IMAGE_BG_OFF as wr,CARD_IMAGE_BG_SWATCH_NAMES as xr,CARD_IMAGE_BG_SWATCHES as Sr,isCardImageBackgroundInheriting as yr,cardImageBackgroundChoice as Cr,THEME_CARD_IMAGE_BG as _r}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as Rr,SECTION_BG_NO_FILL as Tr,sectionBackgroundChoice as Or,THEME_SECTION_BG as Ee,isSectionBackgroundEmpty as Ir,sectionBackgroundHex as Ft}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as Er,nestedAccentValue as Lt,resolveSectionAccent as le}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as kr,TYPE_SIZE_INHERIT as Fr,isTypeSizeInheriting as Lr}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as Nr,WIDTH_CHOICE_LABEL as Ar,WIDTH_INHERIT as Pr}from"../../../format/lib/content/section-width.js";import{useFoldHeadingLevel as vr}from"./panel-heading-scope.js";import{useEaselSession as Br}from"efficient-easel/screen/lib/session-context";import{backendOf as Dr}from"../website-session.js";import{BOX_GAP as Hr,describedAs as E,group as T,iconOf as q,sharedStyleKinds as J}from"efficient-easel/screen/lib/document/box-fields";import{VIEW_KEY_ACCESS as ke,onDesktopWords as B,phoneTwinFields as se}from"efficient-easel/screen/lib/document/box-fields";import{directionField as Gr,gapField as Fe,iconPickerRow as Mr,pickerCellIcon as Ur,pickerNoneIcon as Wr,Segmented as Le,segmented as Kr,select as Z,slider as $}from"./box-fields.js";function Bs({children:e}){return i("div",{className:"sf-field-label",children:typeof e=="string"?l(e):e})}function D(e,t){return l("{value} from {from}",{value:e,from:t})}function $r(){const{blockGap:e}=v();return e===null?l("this container's own spacing"):D(`${e}px`,l("Styles"))}function Xr({inherited:e,onReset:t,label:n}){return i(C,{words:y()?.panel,label:l(n),changed:!e,detail:$r(),onReset:t})}function jr(e){return Fe({...Hr,builtIn:hr[e],resolve:(t,n)=>Et(e,t,n?.siteGap),action:(t,n)=>i(Xr,{inherited:!gr(e,t),onReset:()=>n(void 0),label:"Gap"}),mark:{[Oe]:e}})}function Vr(e){return ze(R("mobile",{[Oe]:e,type:"custom",render:t=>i(qr,{container:e,...t})}),Nt)}function zr(e){return ze(R("tablet",{[Oe]:e,type:"custom",render:t=>i(Yr,{container:e,...t})}),Nt)}const Nt={not:{field:"gap",in:Array.from({length:-It.min},(e,t)=>It.min+t)}};function Ds(e){return{gap:R("desktop",jr(e)),[W("gap")]:zr(e),[F("gap")]:Vr(e)}}function Yr({container:e,...t}){const[n]=L("gap"),{siteGap:o}=t.field??{},r=Math.max(Te.min,Et(e,n,o));return Fe({...Te,builtIn:r,resolve:a=>Ie(a)?a:r,action:(a,c)=>i(C,{words:y()?.panel,label:l("Gap"),changed:Ie(a),detail:B(d=>l(d),`${r}px`),onReset:()=>c(void 0)})}).render(t)}function qr({container:e,...t}){const[n]=L("gap"),{siteGap:o,siteGapPhone:r}=t.field??{},s=kt(e,void 0,n,o,r);return Fe({...Te,builtIn:s,resolve:c=>kt(e,c,n,o,r),action:(c,d)=>i(C,{words:y()?.panel,label:l("Gap"),changed:Ie(c),detail:D(`${s}px`,mr(e,n,r)?l("Styles"):l("Desktop")),onReset:()=>d(void 0)})}).render(t)}function Hs(e){return Gr({offered:or(e),fallback:xt(e,void 0),resolve:t=>xt(e,t)})}function Gs(e,t){return wn(t?bn(e,t):[],t)}function Jr({inherited:e,onReset:t,label:n}){return i(C,{words:y()?.panel,label:l(n),changed:!e,detail:D(l("Full"),l("the page")),onReset:t})}function H({value:e,onChange:t,label:n,placeholder:o,hint:r,multiline:s,hideable:a=!0,markup:c=!0}){const{text:d,hidden:f}=Ke(e),m=V(null),p=V(null),u=_=>t(a?{text:_,hidden:f}:_),g=()=>t({text:d,hidden:!f}),h=a&&f,w=Ue(),x=r?ni(r)?i("span",{className:"sf-hint-while-typing",children:l(r)}):l(r):void 0,b=f?l("Show {label} on the slide",{label:l(n)}):l("Hide {label} on the slide",{label:l(n)});return i(S,{label:l(n),icon:i(Mn,{}),htmlFor:w,className:h?"is-hidden":void 0,hint:x,action:a?i(we,{content:b,children:i(pt,{"aria-pressed":f,"aria-label":b,onClick:g,children:f?i(bt,{name:"eye-off",size:14}):i(bt,{name:"eye",size:14})})}):void 0,children:A("div",{className:"sf-copybox",children:[c&&i(mt,{target:s?p:m,value:d,onChange:u}),s?i("textarea",{id:w,ref:p,value:d,placeholder:o===void 0?void 0:l(o),onChange:_=>u(_.target.value)}):i("input",{id:w,ref:m,type:"text",value:d,placeholder:o===void 0?void 0:l(o),onChange:_=>u(_.target.value)})]})})}function Ms(e,t){return{...e,[Ve]:t}}function Us(e){const t=e[O];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[O]:{...t,offPage:!0}}}function Ws(e){return!e||typeof e!="object"?!1:e[O]?.offPage===!0}function Ks(e){if(!e[O])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[Fo]:!0}}function $s(e){return ko(e)}function Xs(e){const t=e[O];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[O]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as rc,SCALAR_TEXT_CONTROLS as ic}from"efficient-easel/draw";function js(e,t){if(!e[O])throw new Error("inOwnBox: the field holds no authored text");const{[Oo]:o,...r}=e;return{...r,[Eo]:!0,render:t}}const Zr=new Set(Go),Q={type:"radio",options:[{value:!0},{value:!1}]},At={text:{type:"object",objectFields:{text:{type:"text"},hidden:Q}},textarea:{type:"object",objectFields:{text:{type:"textarea"},hidden:Q}},plainText:{type:"text"},copyText:{type:"text"},plainTextarea:{type:"textarea"},textList:{type:"array",arrayFields:{text:{type:"text"}}}},G=(e,t)=>{const n=E({...t,[O]:e},{...At[e.control],label:e.label});if(!Zr.has(e.control))return n;const o=t.render;return{...gt(n,"authored-copy"),render:r=>i(No,{name:r.name,children:o(r)})}},Vs="Everything else on this block comes from the linked post. Unlink it to edit by hand.",Qr={field:"source.slug",set:!0},zs={not:Qr},ei="Select a word, then press the highlighter.",ti=new Set([ei]),ni=e=>ti.has(e);function Ys(e,t,n){return G({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n})})}function qs(e,t,n){return G({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0})})}function Js(e,t,n){return G({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function Zs(e,t,n){return G({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1})})}function Qs(e){return{type:"custom",[Xe]:{label:e},...E({},{type:"text",label:e}),render:({value:t,onChange:n})=>i($o,{value:$e(t),onChange:n,label:e})}}function ea(e,t,n){return G({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const ta={Design:yn,Animation:_n};function na(e){return{type:"custom",render:()=>i(oi,{text:e})}}function oi({text:e}){return i("p",{className:"sf-note",children:l(e)})}function oa(e){return fe(e)!==null&&e?.tabs!==void 0}const Pt=new Map;function ra(e,t){const n=`${e}\0${t?t.join(""):""}`,o=Pt.get(n)??{type:"custom",tabs:t,[pe]:{label:e,level:1},bucket:e,marker:!0,render:()=>i(k,{})};return Pt.set(n,o),o}const vt=new Map;function ia(e){const t=vt.get(e)??{type:"custom",[pe]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>i(k,{})};return vt.set(e,t),t}function ri(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function la(e,t){return ri(e)===t?e:{...e,marker:!0,fold:t,render:()=>i(k,{})}}function sa(e){const t=e;if(t.marker===!0&&t.fold===void 0)return e;const{fold:n,...o}=e;return{...o,marker:!0,render:()=>i(k,{})}}function aa({title:e,children:t}){const[n,o]=z(()=>!Ne.has(e));return i(Yn,{title:e,open:n,onToggle:r=>{o(r),r?Ne.delete(e):Ne.add(e)},children:t})}const Ne=new Set;function ca({label:e}){return i(qn,{title:l(e),level:vr(2)})}function ii({swatches:e,current:t,onPick:n,names:o}){const r=e.find(c=>c.toLowerCase()===t.toLowerCase()),s=r?o?.[r]:void 0,a=s?l(s):t;return A("div",{className:"sf-swatches",children:[e.map(c=>{const d=o?.[c]?l(o[c]):c;return i(we,{content:d,children:i(fo,{color:c,selected:t.toLowerCase()===c.toLowerCase(),onClick:()=>n(c),"aria-label":d})},c)}),i("span",{className:"sf-swatch-hex",children:a})]})}function da(e,t,n=!1){return{type:"custom",render:({value:o,onChange:r})=>i(li,{label:e,builtIn:t,followsBand:n,value:o,onChange:r})}}function li({label:e,builtIn:t,followsBand:n,value:o,onChange:r}){const s=typeof o=="string"?o:void 0,{colors:a,n:c}=Be(),d={background:a.background,surface:a.surface,surface2:fr(a),band:pr(a)},f=n?Ee:t,m=Ir(s,t,f),p=Ft(void 0,f,d),u=n?Rr:void 0,g=f===Ee?l("the theme's section background"):l("Theme {n} background",{n:c}),h=si(s,t,a,c,d,r),w=D(p.toUpperCase(),g),x=xe(s),b=x?re(x,a,c):null;return b?i(oe,{label:l(e),icon:i(Je,{}),value:b.hex,caption:b.words,onChange:r,changed:!0,onReset:()=>r(u),resetTo:w,choices:h}):i(ht,{label:l(e),icon:i(Je,{}),value:m?"":Ft(s,t,d),inherited:p,resetTo:w,onChange:r,onReset:()=>r(u),choices:h})}function si(e,t,n,o,r,s){const a=Or(e,t);return[{label:l("No fill"),color:"",selected:a==="none",onPick:()=>s(Tr)},{label:`${l("Section band")} · ${r.band.toUpperCase()}`,color:r.band,selected:a==="band",onPick:()=>s(Ee)},...ve(xe(e)??"",n,o,s)]}function ai(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=n,s=yr(r,t);return i(S,{label:l(e),icon:i(me,{}),changed:!s,action:i(C,{words:y()?.panel,label:l(e),changed:!s,detail:l("the theme's image stage"),onReset:()=>o(br)}),children:ii({swatches:Sr,current:s?_r:Cr(r,t),onPick:o,names:xr})})}}}function ua(e=n=>n,t){return J({_gSectionTheme:T(Er),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>i(Wo,{value:e(n),onChange:o,followLabel:t})}})}function ee({min:e,max:t,step:n,value:o,onChange:r,suffix:s="",readout:a=!0,notch:c,ariaLabel:d,disabled:f=!1,placeholder:m,placeholderWord:p,onClear:u}){const g=c!==void 0&&Number.isFinite(c)&&c>=e&&c<=t;return i("div",{className:g?"sf-slider has-notch":"sf-slider",style:g?{"--sf-notch":(c-e)/(t-e)}:void 0,children:i(Co,{min:e,max:t,step:n,value:o,...o===null&&m!==void 0?{placeholderValue:m}:{},...p?{emptyLabel:l(p)}:{},suffix:s||void 0,showInput:a,label:d===void 0?void 0:l(d),disabled:f,size:"sm",boxSize:"md",className:"sf-slider-track",onChange:h=>{h===null?u?.():h!==o&&r(h)}})})}function Bt(e,t){const{min:n,max:o,step:r=1,unsetLabel:s,hint:a,restTrack:c,unsetMark:d,icon:f,unit:m="px"}=t;return{type:"custom",render:({value:p,onChange:u})=>{const g=typeof p=="number"?p:null,h=g===null;return i(S,{label:l(e),icon:f?q(f):void 0,value:h?d||s===void 0?void 0:l(s):`${g}${m}`,changed:!h,action:d?Ge(d,{changed:!h,onReset:()=>u(null)}):i(C,{words:y()?.panel,label:l(e),changed:!h,onReset:()=>u(null)}),hint:typeof a=="string"?l(a):a,children:c?c({min:n,max:o,step:r,px:g,label:e,onChange:u}):ee({min:n,max:o,step:r,value:g??n,readout:!1,ariaLabel:e,onChange:u})})}}}const ae="Corners";function Ae(e){return{type:"custom",render:({value:t,onChange:n})=>{const o=typeof t=="number"&&Number.isFinite(t)?t:null,r=o!==null;return i(S,{label:l(ae),icon:i(Qe,{}),changed:r,action:Ge(e.mark,{changed:r,onReset:()=>n(null)}),hint:e.hint,children:i(di,{tier:e,px:o,onRadius:n})})}}}function L(e){const t=M();return[t?.values?.[e],n=>t?.onChange(e,n)]}function Dt(){return gt({type:"custom",render:()=>i(Io,{})},"always")}function ci(){const e=M();return t=>e?.onChangeMany(t)}function di({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),[r,s]=L(e.sidesKey),a=at(r)??[...st];return i(ho,{label:l(ae),value:a,corners:$n,onChange:c=>{const d=at(c)??[];s(d.length===st.length?null:d)},radius:t,onRadiusChange:n,radiusMin:U,radiusMax:Ye,radiusStep:e.step??1,radiusPlaceholder:String(o)})}function Ht(){return Dt()}function ui({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=v(),r=typeof o=="number"?`${o}px`:l("not set");return i(C,{words:y()?.panel,label:l(e),changed:t,detail:o==null?l("the built-in corners"):D(r,l("Styles")),onReset:n})}function pi(){const{cornerRadiusPx:e}=v();return typeof e=="number"?e:U}function fi(){return Ae({sidesKey:"sectionCornerSides",useFollowed:pi,mark:i(ui,{label:ae}),hint:hi})}const hi="Follows Styles ▸ Basics ▸ Corners until you set a number here.";function pa(){return J({_gShape:T("Shape"),sectionCorners:fi(),sectionCornerSides:Ht(),...X("sectionBorder",Gt)})}const mi=()=>({width:l("Border width"),sides:{top:l("Border top"),right:l("Border right"),bottom:l("Border bottom"),left:l("Border left")},style:l("Border style"),styles:{solid:l("Solid"),dashed:l("Dashed"),dotted:l("Dotted")},color:l("Border color"),unit:"px"});function gi(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function bi(){let e;try{const t=Ot(v().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||dr.line}function wi({value:e,onChange:t,placeholder:n,presets:o,sides:r=!0,styles:s=!0,above:a={}}){const c=e&&typeof e=="object"?e:{},[d,f]=z(()=>r?to(c,a):!1),m=mi(),p=u=>gi(r&&s?u:{width:u.width,color:u.color,...s?{style:u.style}:{}});return i(S,{label:l("Border"),icon:i(Rn,{}),action:r?i(Qn,{each:d,label:l("Each side"),onChange:f}):void 0,children:i(Zn,{label:l("Border"),value:c,each:d,onChange:u=>t(p(u)),placeholder:n,presets:o,words:m,styles:s,max:cr})})}function xi({value:e,onChange:t,view:n}){const[o]=L("sectionBorder"),[r]=L(W("sectionBorder")),s=bi(),a=d=>d&&typeof d=="object"?d:{},c=n==="phone"?{...Tt(a(o)),...Tt(a(r))}:n==="tablet"?a(o):{};return i(wi,{value:e,onChange:t,placeholder:{sides:eo(c),style:c.style??"solid",color:c.color||s},presets:[s],above:c})}function fa(e){return R(e,Gt(e==="mobile"?"phone":e))}function Gt(e){return{type:"custom",render:({value:t,onChange:n})=>i(xi,{value:t,onChange:n,view:e})}}function X(e,t){const n=(o,r)=>se(e,t(o),ke)[r];return{[e]:n("desktop",e),[W(e)]:n("tablet",W(e)),[F(e)]:n("phone",F(e))}}function ha(e){return{type:"custom",render:()=>i(Si,{partKey:e})}}function Si({partKey:e}){const[t]=L("id"),[n]=L("_partStyles"),{textStyles:o}=v(),r=Yo();let s=null;try{s=jo().select}catch{s=null}const a=n&&typeof n=="object"?n[e]:void 0,c=Array.isArray(o)?o:null;return i(zn,{name:l("Text"),preview:Xo(a,c,{noStyle:l("No style"),styleName:r.textStyles.styleName,cases:(r.copy.panel??zo.copy.panel).cases}),onOpen:()=>{s&&typeof t=="string"&&s(Vo(t,e))}})}function Mt(e){const{cornerRadiusPx:t}=v(),n=typeof t=="number"?t:e;let o=null;try{const{appState:s,selectedItem:a}=te(d=>d),c=a?.props?.id?String(a.props.id):void 0;o=c?Vn(s?.data,c)?.props??null:null}catch{o=null}if(!o)return n;const r=o.sectionCorners;return Xn(r)?r:n}function yi({label:e,changed:t=!1,onReset:n=()=>{}}){const o=Mt(U);return i(C,{words:y()?.panel,label:l(e),changed:t,detail:D(`${o}px`,l("the section")),onReset:n})}function Ci(){return i(k,{children:l("Follows the section's Corners until you set a number here.")})}function _i(){return Ae({sidesKey:"cardCornerSides",useFollowed:()=>Mt(U),mark:i(yi,{label:ae}),hint:i(Ci,{})})}function Ri(){return{type:"custom",render:()=>i(ln,{})}}function ma(e){return{...e,render:t=>i(sn,{render:e.render,props:t})}}function ga(){return{_gShape:T("Shape"),cardCorners:_i(),cardCornerSides:Ht(),cardCornersApplyAll:Ri()}}function Ti(){return E({type:"custom",render:e=>i(Ii,{...e})},{type:"select",label:K,options:[{value:"content",label:"Fit content"},{value:"equal",label:"Equal"},{value:[50],label:"Custom: the width of each block in %, the last block left out"}]})}function Oi(e,t){const n=Rt(e);if(n!=="custom")return l(_t.find(r=>r.value===n)?.label??"");const o=ut(Re(e,t),t);return o?[...o,100-o.reduce((r,s)=>r+s,0)].join(" / "):l("Custom")}function Ii(e){const{value:t,onChange:n}=e,[o]=L("content"),r=Array.isArray(o)?o.length:0,s="follows"in e,a=t!=null,c=a?t:s?e.follows:void 0,d=Rt(c),f=r>=2&&r<=dt,m=()=>[...xo[r]??[]],p=V(null),u=b=>{const _=p.current;_&&JSON.stringify(b)===JSON.stringify(_.shares)?n(_.value):b&&n(b)},g=b=>{b===d||b==="custom"&&!f||n(b==="custom"?m():b)},h=l("The width bar works for 2 to {count} blocks.",{count:dt}),w=a&&(s||t!=="content"),x=yo().widths.hint(r,wo);return i(S,{label:l(K),icon:i(he,{}),changed:w,hint:d!=="custom"?void 0:f?x:h,action:i(C,{words:y()?.panel,label:l(K),changed:w,disabled:e.readOnly===!0,detail:s?B(b=>l(b),Oi(e.follows,r),e.followsView):l("Fit content"),onReset:()=>n(void 0)}),children:A("div",{className:"sf-share-row",children:[i("div",{className:"sf-share-pick",children:i(ct,{label:l(K),value:d,options:_t.map(b=>({value:b.value,label:b.value==="custom"&&!f?h:l(b.label),icon:Ur(i("span",{className:"sf-gallery-pic sf-share-pic",children:Ut(b.weights).map((_,j)=>i("i",{style:{gridColumn:`span ${_}`}},j))}),l(b.label),b.value==="custom"&&!f?h:l(b.label))})),onChange:g,columns:3,cell:Wt,tooltips:!1,disabled:e.readOnly===!0})}),d==="custom"&&f?i("div",{onFocus:()=>{p.current={value:t,shares:ut(Re(c,r),r)}},onBlur:()=>{p.current=null},children:i(So,{label:l(K),count:r,value:Re(c,r),onChange:u,readOnly:e.readOnly===!0})}):null]})})}function Ut(e){if(!e)return[3,4];const t=e.reduce((n,o)=>n+o,0);return e.map(n=>Math.round(n/t*12))}function ba(){return Z(rr,i(Ln,{}),St,St[0].value)}function wa(){return R("mobile",Mr(K,i(he,{}),ar.map(e=>({label:e.label,value:e.value,picture:i("span",{className:"sf-gallery-pic sf-share-pic",children:Ut(e.weights).map((t,n)=>i("i",{style:{gridColumn:`span ${t}`}},n))})})),sr,{columns:2,cell:Wt}))}const Wt={width:"5.75rem",height:"3.25rem"};function xa(){return se("share",Ti(),ke)[W("share")]}function Ei(){return R("mobile",$(yt,i(Ze,{}),_e,lr,1,_e,"",{clear:{phoneFollows:!1,hint:_e}}))}const Kt={read:e=>e.phoneRow,write:(e,t,n)=>({phoneRow:n}),fieldKey:()=>"phoneRow",ownField:!0};function Sa(){const e=$(yt,i(Ze,{}),Ct,ir,1,Ct,"",{clear:{emptyLabel:"Auto"}}),t=se("columns",e,{...Kt,tablet:ke.tablet}),n=se("columns",e,Kt,{phoneRow:Ei()});return{...t,phoneRow:n.phoneRow}}function ya(e,t,n,o,r,s){return{type:"custom",render:({value:a,onChange:c})=>i(S,{label:l(e),icon:i(lt,{noun:s}),action:i(C,{words:y()?.panel,label:l(e),changed:!Lr(a),detail:l("the Text style in Styles"),onReset:()=>c(Fr),defaultAction:{onPress:()=>c(kr),title:l("Keep this section's own built-in size"),icon:i(Tn,{})}}),children:ee({min:t,max:n,step:o,value:typeof a=="number"?a:r,suffix:"px",ariaLabel:e,onChange:c})})}}function Ca(){return{_gCellWidth:T("Cell width"),gridSpan:Z("Positions",i(he,{}),[{label:"Auto",value:""},...Array.from({length:un},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function N(){let e=null,t=null;try{e=Me(ki),t=te(n=>n).selectedItem}catch{t=null}return e??t?.props??{}}const ki=zt(null);function Fi({min:e,max:t,step:n,px:o,label:r,onChange:s,desktopKey:a,fallback:c}){const d=N()[a],f=Se(void 0,d,c);return i(k,{children:ee({min:e,max:t,step:n,value:Se(o,d,c),readout:!1,ariaLabel:r,notch:f,onChange:s})})}function Li({label:e,desktopKey:t,fallback:n,unit:o="px",changed:r=!1,onReset:s=()=>{}}){const a=N()[t],c=Se(void 0,a,n);return i(C,{words:y()?.panel,label:l(e),changed:r,detail:B(d=>l(d),`${c}${o}`),onReset:s})}function Ni(e){return Bt(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unit:e.unit,unsetLabel:"Follows Desktop",unsetMark:i(Li,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback,unit:e.unit}),restTrack:t=>i(Fi,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}const Ai={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},Pi={Top:it,Bottom:nt,Left:ot,Right:rt},vi=e=>{const t=Pi[e];return i(t,{})};function _a(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,r=x=>Ai[x],s=x=>$(r("Top"),i(it,{}),I.min,I.max,I.step,x,"px"),a=(x,b,_,j=I)=>R("mobile",Ni({label:r(x),icon:vi(x),desktopKey:b,min:j.min,max:j.max,step:j.step,fallback:_})),c=e.top??I.min,d=e.bottom??I.min,f="sectionPaddingLeft",m="sectionPaddingRight",p=e.sideBounds??I,u=e.side??p.min,g=e.sidePhone??u,h=e.phone===!0,w=x=>h?R("desktop",x):x;return J({...o?{_gSpacing:T("Padding")}:{},[t]:w(s(c)),...h?{[F(t)]:a("Top",t,c)}:{},...e.only==="top"?{}:{[n]:w($(r("Bottom"),i(nt,{}),I.min,I.max,I.step,d,"px")),...h?{[F(n)]:a("Bottom",n,d)}:{}},...e.sides?{[f]:w($(r("Left"),i(ot,{}),p.min,p.max,p.step,u,"px")),...h?{[F(f)]:a("Left",f,g,p)}:{},[m]:w($(r("Right"),i(rt,{}),p.min,p.max,p.step,u,"px")),...h?{[F(m)]:a("Right",m,g,p)}:{}}:{}})}function Ra(e,t){const n=Object.fromEntries(Object.entries(t).map(([s,a])=>[s,s in e&&fe(a)?e[s]:a])),o={};let r=!1;for(const[s,a]of Object.entries(e)){if(s in t){r||Object.assign(o,n),r=!0;continue}o[s]=a}return r||Object.assign(o,n),o}const ce="Width";function Ta(e,t=Nr,n=!0){const o=t.map(r=>({label:Ar[r],value:r}));return J({...n?{_gWidth:T(ce)}:{},widthMode:{type:"custom",render:({onChange:r,field:s})=>i(S,{label:l(ce),icon:i(Un,{}),action:n?i(Jr,{inherited:s?.inherited??!1,onReset:()=>r(Pr),label:ce}):void 0,children:Le({options:o,value:s?.currentValue||e,onChange:r,ariaLabel:ce})})}})}function Oa(){const e=(o,r)=>({type:"custom",render:({value:s,onChange:a})=>i(Bi,{value:s,onChange:a,view:o,badge:r})}),t=o=>({type:"custom",render:({value:r,onChange:s,field:a})=>i(Hi,{value:r,onChange:s,unit:a?.unit,view:o})}),n=o=>{const r=Kr("Unit",i(et,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");if(o==="desktop")return r;const s=r.render;return{...r,render:a=>i(Gi,{props:a,draw:s,view:o})}};return J({_gHeight:T(Y),...X("sectionHeightMode",o=>o==="desktop"?e(o):e(o,r=>i(Mi,{view:o,onClear:()=>r(void 0)}))),...X("sectionHeightValue",t),...X("sectionHeightUnit",n)})}function Bi({value:e,onChange:t,view:n,badge:o}){const r=N(),s=c=>["auto","fixed","screen"].includes(c),a=de(n,r)?.mode??"auto";return i(S,{label:Y,icon:q(i(An,{})),action:o?o(t):void 0,children:Le({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:s(e)?e:a,onChange:t,ariaLabel:Y})})}function $t(e,t){return e==="phone"&&ye(t)?Zo(t):Jo(t)}function de(e,t){return e==="desktop"||(e==="tablet"?ye(t):qo(t))?null:$t(e,t)}const P=(e,t)=>e==="tablet"?W(t):F(t);function Di(e,t,n,o){const r=de(e,t);return!r||e==="desktop"?null:o===void 0?{}:{[P(e,"sectionHeightMode")]:r.mode,...r.mode==="fixed"?{[P(e,"sectionHeightUnit")]:r.unit}:{},...n==="sectionHeightUnit"?{[P(e,"sectionHeightValue")]:r.value}:{},[P(e,n)]:o}}function Xt(e,t,n){const o=M(),r=de(e,N());return!o||!r?{followed:null,write:n}:{followed:r,write:a=>o.onChangeMany(c=>{const d=Di(e,c,t,a);return d===null?{[e==="desktop"?t:P(e,t)]:a}:Object.keys(d).length?d:null})}}function Hi({value:e,onChange:t,unit:n,view:o}){const{followed:r,write:s}=Xt(o,"sectionHeightValue",t),a=(r?r.unit:n)==="%"?"%":"px",c=a==="%"?nr:tr;return i("div",{className:"sf-field",children:ee({min:c.min,max:c.max,step:c.step,value:r?null:typeof e=="number"?e:c.fallback,...r?{placeholder:r.value}:{},suffix:a,ariaLabel:Y,onChange:s})})}function Gi({props:e,draw:t,view:n}){const{followed:o,write:r}=Xt(n,"sectionHeightUnit",e.onChange);return t({...e,...o?{value:void 0,storedValue:void 0,follows:o.unit}:{},onChange:r})}function Mi({view:e,onClear:t}){const n=N(),o=de(e,n)===null,r=e==="phone"&&ye(n),s=$t(e,n),a=B(c=>l(c),s.mode==="auto"?l("Auto"):`${s.value}${s.unit}`,r?"tablet":"desktop");return i(C,{words:y()?.panel,label:l(Y),changed:o,detail:a,onReset:t})}function Ia(){const e=n=>({type:"custom",render:({value:o,onChange:r,id:s,name:a})=>i(Ki,{value:o,onChange:r,labelId:`${s??a??"stickTop"}-label`,view:n})}),t=n=>({type:"custom",render:({value:o,onChange:r})=>i(Ui,{value:o,onChange:r,view:n})});return{_gStick:T(Ce),...X("stickTop",e),...X("stickTopDistance",t)}}function Ui({value:e,onChange:t,view:n}){const o=M(),r=N(),s=n==="desktop"||Pe(n,r)?null:jt(n,wt(r)),a=s&&o?c=>o.onChangeMany(d=>{const f=Wi(n,d,c);return f===null?{[P(n,"stickTopDistance")]:c}:Object.keys(f).length?f:null}):t;return i("div",{className:"sf-field",children:ee({min:ie.min,max:ie.max,step:ie.step,value:s?null:typeof e=="number"?e:ie.fallback,...s?{placeholder:s.distance}:{},suffix:"px",ariaLabel:l("Distance from top"),onChange:a})})}function Pe(e,t){return e==="tablet"?er(t):Qo(t)}function jt(e,t){return e==="phone"?{on:t.tablet,distance:t.tabletDistance}:{on:t.desktop,distance:t.desktopDistance}}function Wi(e,t,n){return e==="desktop"||Pe(e,t)?null:n===void 0?{}:{[P(e,"stickTop")]:!0,[P(e,"stickTopDistance")]:n}}function Ki({value:e,onChange:t,labelId:n,view:o}){const r=N(),s=wt(r),a=o==="phone"?s.phone:o==="tablet"?s.tablet:e===!0,c=o==="phone"&&s.ownTablet,d=o==="desktop"?null:jt(o,s),f=d?.on?`${d.distance}px`:l("Off");return i(S,{label:l(Ce),labelId:n,icon:q(i(Dn,{})),action:A(k,{children:[o!=="desktop"?i(C,{words:y()?.panel,label:l(Ce),changed:Pe(o,r),detail:B(m=>l(m),f,c?"tablet":"desktop"),onReset:()=>t(void 0)}):null,i(be,{checked:a,onChange:t,ariaLabelledBy:n})]})})}const Vt="e.g. about";function Ea(){return{_gAnchor:T("Anchor"),anchor:G({control:"plainText",label:"Name",placeholder:Vt},{type:"custom",render:({value:e,onChange:t})=>i(xn,{value:e,onChange:t,nameBox:(n,o)=>i(H,{value:n,onChange:o,label:"Name",placeholder:Vt,hideable:!1,markup:!1})})})}}function ka(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:s,name:a})=>{const c=`${s??a??e}-datetime`,d=Date.parse(typeof o=="string"?o:"");return i(S,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(go,{id:c,value:Number.isFinite(d)?new Date(d):null,onChange:f=>r(f?f.toISOString():"")})})}}}function Fa(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:s,name:a})=>{const c=`${s??a??e}-date`;return i(S,{label:l(e),icon:t,htmlFor:c,hint:n===void 0?void 0:l(n),children:i(mo,{id:c,value:Jt(typeof o=="string"?o:null),onChange:d=>r(d?qt(d):"")})})}}}function $i(e,t,n,o){return{type:"custom",...E({},{...Q,label:e}),render:r=>{const{value:s,onChange:a,id:c,name:d}=r,f="follows"in r,m=r,p=typeof s=="boolean",u=typeof m.follows=="boolean"?m.follows:t,g=p?s:f?u:t,h=`${c??d??e}-label`,w=m.readOnly===!0,x=i(be,{checked:g,onChange:a,disabled:w,ariaLabelledBy:h});return i(S,{label:l(e),labelId:h,icon:n,hint:o===void 0?void 0:l(o),action:f?A(k,{children:[i(C,{words:y()?.panel,label:l(e),changed:p,detail:m.followsNoView?l(u?"On":"Off"):B(b=>l(b),l(u?"On":"Off"),m.followsView),disabled:w,onReset:()=>a(void 0)}),x]}):x})}}}function La(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const r=`${String(n??o??"pageBackground")}-colour`;return i(Xi,{label:"Background",icon:i(Bn,{}),id:r,value:e,shown:Wn(e),onChange:t})}}}function Na(e,t){return{type:"custom",...E({},{...Q,label:e}),render:({value:n,onChange:o,id:r})=>{const s=typeof n=="boolean"?n:t,a=`${r??e}-checkbox`;return i(S,{label:l(e),htmlFor:a,className:"sf-checkbox",action:i(po,{id:a,checked:s,onChange:o})})}}}function Aa(e,t,n){return{type:"custom",render:({value:o,onChange:r})=>i(oe,{label:l(e),icon:n,value:o||t,onChange:r})}}function Xi({label:e,icon:t,id:n,value:o,shown:r,onChange:s}){const{colors:a,n:c}=Be(),d=xe(o),f=d?re(d,a,c):null;return i(oe,{label:l(e),icon:t,id:n,value:f?f.hex:r,caption:f?.words,onChange:s,choices:ve(d??"",a,c,s)})}function Pa(){return{type:"custom",render:e=>{const{value:t,onChange:n}=e,o=e;return i(ji,{value:typeof t=="string"?t:"",onChange:n,twin:"follows"in e?{follows:o.follows,view:o.followsView}:void 0})}}}function ve(e,t,n,o){const r=ge(e);return Ro(t,n).map(s=>({label:s.label,color:s.value,selected:r===s.name,onPick:()=>o(s.name)}))}function ji({value:e,onChange:t,twin:n}){const{colors:o,n:r}=Be(),s=o.background,a=D(s.toUpperCase(),l("Theme {n} background",{n:r})),c=ge(e),d=c?re(c,o,r):null,f=ve(e,o,r,t),m=n?()=>t(void 0):()=>t("");let p=s,u=a;if(n){const g=ge(n.follows),h=Kn(n.follows),w=g?re(g,o,r):h?{hex:h,words:h.toUpperCase()}:null;p=w?.hex??s,u=B(x=>l(x),w?w.words:a,n.view)}return d?i(oe,{label:l("Fill"),icon:i(me,{}),value:d.hex,caption:d.words,onChange:t,changed:!0,onReset:m,resetTo:u,choices:f}):i(ht,{label:l("Fill"),icon:i(me,{}),value:e,inherited:p,resetTo:u,onChange:t,onReset:m,choices:f})}function Vi(e,t,n){if((e?.content??[]).some(a=>a?.props?.id===t))return le(n);const r=jn(e,t);if(r.length===0)return null;const s=le(Lt(n));if(s!==null)return s;for(let a=r.length-1;a>0;a-=1){const c=le(Lt(r[a].sectionAccent));if(c!==null)return c}return le(r[0].sectionAccent)}function Be(){const e=Ot(v().theme),[t]=L("sectionAccent");let n=null;try{const{appState:r,selectedItem:s}=te(c=>c),a=s?.props?.id?String(s.props.id):void 0;n=a?Vi(r?.data,a,t):null}catch{n=null}const o=n!==null&&e.themes[n]?n:e.selected;return{colors:ur(e.themes[o]),n:o+1}}const zi=[{value:"0% 0%",label:"Top left"},{value:"50% 0%",label:"Top"},{value:"100% 0%",label:"Top right"},{value:"0% 50%",label:"Left"},{value:"50% 50%",label:"Center"},{value:"100% 50%",label:"Right"},{value:"0% 100%",label:"Bottom left"},{value:"50% 100%",label:"Bottom"},{value:"100% 100%",label:"Bottom right"}];function Yi({label:e,value:t,onChange:n,points:o=zi}){const r=o.map(s=>({...s,label:l(s.label),...s.title?{title:l(s.title)}:null}));return i(uo,{label:l(e),value:t,points:r,onChange:n})}function va(){return Dt()}const Ba={top:i(kn,{}),right:i(En,{}),bottom:i(On,{}),left:i(In,{})};function Da(e,t,n,o,r,s,a){const c=p=>t.find(u=>u.value===p),d=p=>({value:p,label:"",disabled:!0,title:o}),f=p=>{const u=t.find(h=>h.cell===p);if(!u)return d(`missing-${p}`);const g=s?.[p];return g?{value:u.value,label:u.label,icon:g}:{value:u.value,label:u.label}},m=[d("corner-top-left"),f("top"),d("corner-top-right"),f("left"),d("centre"),f("right"),d("corner-bottom-left"),f("bottom"),d("corner-bottom-right")];return{type:"custom",render:({value:p,onChange:u})=>{const g=t.some(h=>h.value===p)?p:n;return i(S,{label:l(e),icon:r,value:c(g)?.label?l(c(g).label):a?l(a):"",children:Yi({label:e,value:g,onChange:u,points:m})})}}}function Ha(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:r,field:s})=>i(Uo,{label:e,options:(s.options??t).map(a=>({...a,label:l(a.label)})),value:Array.isArray(o)?o:[],onChange:r,...n?{emptyLabel:l(n)}:{}})}}function Ga(e,t,n,o){return{type:"custom",options:t,fallback:n,...E({},{type:"select",label:e}),render:({value:r,onChange:s,field:a})=>i(Ko,{label:e,options:(a.options??t).map(c=>({...c,label:l(c.label)})),fallback:a.fallback??n,value:r,onChange:s,placeholder:o===void 0?void 0:l(o)})}}function Ma(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const r={value:n,onChange:o,...t};return i(e,{...r})}}}const Ua=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function Wa(e,t,n){const o=Object.keys(We).map(r=>({label:We[r],value:r,picture:n[r]}));return{type:"custom",...E({},{type:"radio",label:e,options:o.map(r=>({value:r.value,label:r.label}))}),render:({onChange:r})=>i(Ji,{label:e,icon:t,options:o,onChange:r})}}function qi(e,t,n){const o=Zt(e,t,n);if(o!==void 0)return o==="save-makes-frame"?l("A frame is made from this video when you save the page."):o==="starts-dark"?l("This video starts dark, so no frame was made. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="outside"?l("This video is on another website, so no frame can be made. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="unsupported"?l("This video's file type gives no frame. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="failed"?l("No frame could be made from this video. It is tried again the next time you save the page. The slide shows its background colour while the video loads."):o==="image-no-frame"?l("The slide shows your Image while the video loads, because this video has no frame."):void 0;const r=en(e);return r==="frame-missing-image"?l("This video has no frame yet. The slide shows its image until one is made."):r==="frame-missing-surface"?l("This video has no frame yet. The slide shows its background colour until one is made."):r==="image-missing-frame"?l("No image yet. The slide shows the video's frame until you choose one."):r==="image-missing-surface"?l("No image yet. The slide shows its background colour until you choose one."):void 0}function Ji({label:e,icon:t,options:n,onChange:o}){const r=M(),s=r?.values??{},a=Qt(s),c=Me(on),d=nn(c?.docId??null);let f=null;try{f=te(p=>p.appState.data)}catch{f=null}const m=tn(r?.id,f,d);return i(S,{label:l(e),icon:q(t),hint:qi(s,m,c?.hasUnsavedEdits??!1),children:Le({options:n,value:a,onChange:o,ariaLabel:e})})}function Ka(e,t,n,o={}){const r={type:"custom",[je]:!0,render:({value:s,onChange:a,name:c})=>i(Mo,{value:s||"",onChange:a,fieldKey:c,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen,frameKey:o.frame}),...o.focus?{focusKey:o.focus}:{},...o.focusWhen?{focusWhen:o.focusWhen}:{}};return o.focus?R("each",r):r}const $a={HeroSingle:["imageFocal"],HeroSlide:["videoFrame"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function Zi(e){const t=l(e.status??"");return e.ok&&typeof e.lat=="number"&&typeof e.lng=="number"?`${t} · ${e.lat.toFixed(4)}, ${e.lng.toFixed(4)}`:t}function Xa({value:e,onChange:t,label:n}){const o=e||{},r=M(),s=r?r.values!==r.node.props:!0,a=!!o.pending&&s,c=!!o.pending&&!s,d=!!Dr(Br()).geocode,f=Ue(),m=(p,u)=>t({...o,[p]:u??void 0});return A(k,{children:[i(S,{label:l(n),icon:i(tt,{}),action:d?i(we,{content:l("Find from the address (OpenStreetMap)"),children:i(pt,{"aria-label":l("Find from the address"),"aria-busy":a||void 0,disabled:a,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),children:i(Hn,{})})}):void 0,children:d&&o.status?i(Sn,{compact:!0,oneLine:!0,spaced:!1,status:a?"busy":o.ok&&!c?"found":"notfound",statusText:a?l("Finding…"):c?l(_o):l(o.status),hint:Zi(o)}):null}),i(S,{label:l("Enter by hand"),labelId:f,icon:i(Fn,{}),action:i(be,{checked:!!o.manual,onChange:p=>t({...o,manual:p}),ariaLabelledBy:f})}),o.manual&&i(S,{label:l("Latitude, longitude"),icon:i(tt,{}),children:A("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,width:"100%",minWidth:0},children:[i(ft,{value:typeof o.lat=="number"?o.lat:null,onChange:p=>m("lat",p),min:-90,max:90,step:1e-4,placeholder:l("Latitude")}),i(ft,{value:typeof o.lng=="number"?o.lng:null,onChange:p=>m("lng",p),min:-180,max:180,step:1e-4,placeholder:l("Longitude")})]})})]})}function Qi(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function el(e,t,n){const o=e.map(r=>({text:r?.text??""}));return t===null||t<0||t>=e.length?o:o.map((r,s)=>s===t?{text:n}:r)}function ja(e,t){return e===null?null:t>e?e:null}function tl(e,t,n){if(n===null||n>=t.length)return null;for(let o=0;o<n;o+=1)if(e[o]!==t[o])return null;return e[n]!==t[n]&&t.includes(e[n])||e[n]!==t[n]&&t.length!==e.length?null:n}const Va={label:"Ticker items",icon:i(vn,{})};function za(e,t,n,o){return{type:"custom",[O]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},...E({},{...At.textList,label:e}),render:({value:r,onChange:s})=>i(nl,{label:e,icon:q(t),items:Array.isArray(r)?r:[],placeholder:n,onChange:s,markup:o==="markup"})}}function nl({label:e,icon:t,items:n,placeholder:o,onChange:r,markup:s=!1}){const a=V(null),[c,d]=z(null),f=p=>p.map(u=>({text:u?.text??""})),m=p=>{const u=tl(n,p,c);u===null&&(a.current=null),d(u),r(f(p))};return i(no,{label:l(e),icon:t,noun:l("item"),items:n,onChange:m,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:s?i(mt,{target:a,value:Qi(n,c),onChange:p=>r(el(n,c??-1,p)),disabled:c===null,label:c===null?l("Formatting — click a row first"):l("Formatting — row {n}",{n:c+1})}):void 0,renderRow:(p,u,g)=>i("input",{type:"text",className:s&&c===u?"sf-list-marking":void 0,value:p?.text??"",placeholder:l(o),"aria-label":l("{label} {n}",{label:l(e),n:u+1}),onChange:h=>g({text:h.target.value}),onFocus:h=>{a.current=h.currentTarget,d(u)}})})}function Ya(e,t){const n=`${e.label} — row ${t+1}`;return G({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:l("{label} — row {n}",{label:l(e.label),n:t+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function qa(e){return{_gCards:T("Cards"),coverIndex:Z("Cover image",i(Pn,{}),Do,String(Ho),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:ai("Image background",wr),cardImage:il()}}function Ja(){return{outline:Z("Card outline",i(Gn,{}),Po,Bo),indexBadge:Z("Card number",i(et,{}),Ao,vo),showBadge:$i("Product badge",!0,i(lt,{noun:"tag"}))}}function Za(e){const t=e?.defaults??{showCardSizes:!0,showCardBuy:!0,showCardPage:!0},n=r=>({...Q,label:ue.find(s=>s.id===r).label}),o=r=>E(To(De),n(r));return{_gShowOnCard:T("Show on a card"),[De]:E({type:"custom",render:()=>i(ol,{rest:{showCardPrice:!0,showCardFinishes:!0,...t}})},n(De)),showCardFinishes:o("showCardFinishes"),showCardSizes:o("showCardSizes"),showCardBuy:o("showCardBuy"),showCardPage:o("showCardPage")}}const De="showCardPrice",ue=[{id:"showCardPrice",label:"Price"},{id:"showCardFinishes",label:"Finish swatches"},{id:"showCardSizes",label:"Sizes"},{id:"showCardBuy",label:"Buy button"},{id:"showCardPage",label:"Page button"}];function ol({rest:e}){const t=N(),n=ci(),o=a=>typeof t[a]=="boolean"?t[a]:void 0,r=a=>o(a)??e[a],s=ue.some(({id:a})=>o(a)!==void 0&&o(a)!==e[a]);return i(He,{parts:ue,changed:s,shown:r,onPress:(a,c)=>n({[a]:c}),onReset:()=>n(Object.fromEntries(ue.map(({id:a})=>[a,void 0])))})}function Qa(e,t="display"){const n=F(t);return{[t]:R("desktop",{type:"custom",render:({value:o,onChange:r})=>i(He,{parts:e,changed:ro(o),shown:s=>io(o,s),onPress:(s,a)=>r(ao(o,s,a)),onReset:()=>r(void 0)})}),[n]:R("mobile",{type:"custom",render:({value:o,onChange:r})=>i(rl,{parts:e,desktopKey:t,value:o,onChange:r})})}}function He({parts:e,changed:t,shown:n,onPress:o,onReset:r,detail:s,disabledReason:a}){const c=l("Display");return i(S,{label:c,icon:i(Cn,{}),changed:t,action:i(C,{words:y()?.panel,label:c,changed:t,detail:s,onReset:r}),children:i(oo,{label:c,items:e.map(d=>({id:d.id,label:l(d.label),shown:n(d.id),...a?{disabled:!0,disabledReason:l(a)}:{}})),onChange:o})})}function rl({parts:e,desktopKey:t,value:n,onChange:o}){const r=N()[t];return i(He,{parts:e,changed:so(n),shown:s=>lo(r,n,s),onPress:(s,a)=>o(co(n,s,a)),onReset:()=>o(Lo),detail:l("the same as Desktop")})}function il(){return Bt("Card image",{min:U,max:Ye,step:an,icon:i(Qe,{}),hint:"Rounds the picture. The card's own corner is in Styles."})}function ec(){return Ae({sidesKey:"cornerSides",step:cn,useFollowed:()=>U,mark:i(ll,{label:dn}),hint:l("Rounds the picture. Left alone it stays square.")})}function ll({label:e,changed:t=!1,onReset:n=()=>{}}){return i(C,{words:y()?.panel,label:l(e),changed:t,onReset:n})}function tc(){return{type:"custom",render:({value:e,onChange:t})=>i(dl,{value:typeof e=="string"?e:"",onChange:t})}}function sl({layout:e,width:t}){const n=hn(e),o=n?`${n[0]}/${n[1]}`:void 0;return i("span",{"aria-hidden":"true",style:{display:"grid",width:t,gridTemplateColumns:"repeat(12, minmax(0, 1fr))",gridAutoRows:o?"auto":6,gridAutoFlow:"row dense",gap:2},children:mn(e).map(([r,s],a)=>i("i",{className:"block rounded-xs bg-current opacity-60",style:{gridColumn:`span ${r}`,gridRow:`span ${s}`,aspectRatio:o}},a))})}const al={width:"3.5rem",height:"2.5rem"},cl=200;function dl({value:e,onChange:t}){const[n,o]=z(null),[r,s]=z(4),a=V(null);Yt(()=>{const u=a.current;if(!u||typeof ResizeObserver!="function")return;const g=()=>s(u.getBoundingClientRect().width>=cl?4:3);g();const h=new ResizeObserver(g);return h.observe(u),()=>h.disconnect()},[]);const c=e&&e in ne?e:"",d=qe(n,c),f=qe(n,"").length,m=gn("no-symbol"),p=[{value:"",label:l("Not chosen"),icon:Wr(m,l("Not chosen"))},...d.map(u=>({value:u,label:l(ne[u].label),icon:i(sl,{layout:ne[u],width:40})}))];return i(S,{label:l("Layout"),icon:i(Nn,{}),value:c?l(ne[c].label):void 0,children:i("div",{ref:a,style:{flex:"1 1 auto",minWidth:0},children:i(ct,{label:l("Layout"),value:c,options:p,onChange:t,columns:r,cell:al,header:A("div",{className:"mb-2 flex flex-col gap-1",style:{minWidth:"11rem"},children:[i("span",{className:"text-2xs text-ink-faint",children:l("Photos in a row")}),i(Jn,{options:[{id:"all",label:l("All")},...pn.map(u=>({id:String(u),label:String(u)}))],value:n===null?"all":String(n),ariaLabel:l("Photos in a row"),onChange:u=>o(u==="all"?null:Number(u))}),i("span",{className:"text-2xs text-ink-faint",children:l("{n} of {total} layouts",{n:f,total:fn.length})})]})})})})}export{Qr as BOUND_TO_POST,Vs as BOUND_TO_POST_NOTE,ta as BUCKET_ICONS,$a as CUSTOM_FIELD_MEDIA,Xa as CoordsField,Nt as DESKTOP_GAP_NOT_OVERLAP,He as DisplayRow,Ba as EDGE_ARROWS,bo as FOCAL_DEFAULT,zi as FOCAL_POINTS,pe as FOLD_FIELD_MARKER,Yi as FocalPicker,ca as GroupLabel,ei as HIGHLIGHT_HINT,H as HidableTextField,Xe as LINK_FIELD_MARKER,Bs as Label,je as MEDIA_FIELD_MARKER,Ua as MEDIA_TYPE_OPTIONS,zs as NOT_BOUND_TO_POST,aa as PanelBand,oi as PanelNoteLine,ki as RowPropsContext,Ve as SCAFFOLD_FIELD_MARKER,ic as SCALAR_TEXT_CONTROLS,Xr as SiteGapDefaultReset,ee as Slider,ii as Swatches,rc as TEXT_CONTROL_KINDS,O as TEXT_FIELD_MARKER,Va as TICKER_ITEMS_ROW,nl as TextListField,Xi as ThemeFillRow,ce as WIDTH_LABEL,Jr as WidthDefaultReset,tl as aimAfterListChange,Ea as anchorFields,D as backTo,da as backgroundField,ba as boxBlockSpacingField,Sa as boxColumnsFields,Pa as boxFillField,Ei as boxPhoneRowField,Ti as boxShareField,wa as boxSharePhoneField,xa as boxShareTabletField,Vi as boxThemeIndexOf,ra as bucketHeader,ha as buttonWordsEntryField,_i as cardCornersField,ai as cardImageBackgroundField,il as cardImageField,qa as cardMediaFields,ga as cardShapeFields,Za as cardShowFields,Ja as cardStyleFields,Ca as cellWidthFields,Na as checkbox,Aa as colorInput,Hs as containerDirectionField,jr as containerGapField,Vr as containerGapPhoneField,Ds as containerGapRows,zr as containerGapTabletField,Zi as coordsResultTip,Zs as copyText,Ht as cornerSidesField,Ae as cornersRowField,Fa as date,ka as dateTime,ia as designGroupHeader,Qa as displayFields,Da as edgePad,ve as fillSlotChoices,ja as focusAfterRemove,va as focusKeptField,la as foldMarker,fe as foldMetaOf,ri as foldTitleOf,Di as followedHeightPatch,Wi as followedStickPatch,tc as galleryLayoutField,Oa as heightFields,de as heightFollowedBy,Gs as heroGroupPlacementPoints,$e as hidableText,ni as hintIsWhileTyping,ec as imageCornersField,js as inOwnBox,oa as isBucketHeader,Dt as keptBy,Qs as linkField,qi as loadingRowHint,Wa as loadingShowsField,Ha as multiSelect,La as pageBackgroundField,na as panelNote,Ni as phoneOverrideField,Js as plainText,ea as plainTextarea,Bt as pxField,sa as quietMarker,Ke as readHidable,Qi as rowText,Ga as searchSelect,si as sectionBandChoices,fa as sectionBorderField,fi as sectionCornersField,pa as sectionShapeFields,ua as sectionThemeFields,el as setRowText,ya as sizeField,Ma as sourceField,_a as spacingFields,Ia as stickFields,Ra as swapPadding,ma as templateField,Ys as text,rn as textFieldIdentifier,Ws as textFieldOffPage,$s as textFieldPanelOnly,za as textList,Ya as textListRowField,qs as textarea,$i as toggle,Ka as upload,ci as useSelectedPatch,N as useSelectedProps,L as useSelectedSibling,$r as useSiteGapDetail,Ta as widthField,Xs as withIdentifier,Us as withOffPage,Ks as withPanelOnly,Ms as withScaffold};
|
|
1
|
+
"use client";import{jsx as i,jsxs as A,Fragment as N}from"react/jsx-runtime";import{cloneElement as Ue,createContext as en,useContext as Ke,useEffect as tn,useId as $e,useRef as Y,useState as q}from"react";import{useEasel as te,useSelectedHost as W}from"efficient-easel/easel";import{PIN_LENGTH as ne,toDateKey as nn,fromDateKey as on}from"efficient-shell/format";import{say as s,editorEaselWords as y}from"../../../format/lib/editor-words.js";import{finiteNumber as rn}from"../../../format/lib/finite-number.js";import{LOADING_SHOWS_LABELS as Xe,firstFrameHint as ln,loadingShowsOf as sn,loadingStillHint as an}from"../../../format/lib/hero-video.js";import{pageFramesFor as cn,usePageVideoFrames as dn}from"../page-video-frames.js";import{ScreenDocumentContext as un}from"efficient-easel/screen/components/ScreenDocumentContext";import{readHidable as je,hidableText as Ve}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as he,LINK_FIELD_MARKER as ze,MEDIA_FIELD_MARKER as Ye,SCAFFOLD_FIELD_MARKER as qe,TEXT_FIELD_MARKER as I,foldMetaOf as me,textFieldIdentifier as pn}from"efficient-easel/draw";import fn from"../../components/ApplyCornersToSiblings.js";import{withShowWhen as Je}from"../../../render/lib/document/show-when.js";import hn from"../../components/TemplateFieldRow.js";import{CARD_IMAGE_RADIUS_STEP as mn,CORNER_RADIUS_MAX as Ze,CORNER_RADIUS_MIN as U}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as gn,IMAGE_CORNERS_LABEL as bn}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as wn}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as Sn,GALLERY_LAYOUTS as oe,GALLERY_LAYOUT_KEYS as xn,galleryChoices as Qe,galleryLayoutRatio as yn,galleryPictureCells as Cn}from"../../../format/lib/content/gallery-layout.js";import{shellGlyphOf as _n}from"./shell-glyph.js";import{anchorSiblingsOf as Tn,placementPoints as Rn}from"../../../format/lib/hero-group-placement.js";import In from"../../components/AnchorField.js";import On from"../../components/SourceStatus.js";import{AdjustIcon as En,EyeIcon as kn,AnimationIcon as Nn,BackgroundIcon as et,BorderAllIcon as Fn,BlockSectionIcon as Ln,ColumnWidthsIcon as ge,ColumnsIcon as tt,CornerIcon as nt,DirectionDownIcon as Pn,DirectionLeftIcon as An,DirectionRightIcon as vn,DirectionUpIcon as Bn,EditIcon as Dn,GapIcon as Hn,GridIcon as Gn,GroundIcon as be,HashIcon as ot,HeightIcon as rt,ImageIcon as Mn,ListIcon as Wn,LocationIcon as it,PaddingBottomIcon as lt,PaddingLeftIcon as st,PaddingRightIcon as at,PaddingTopIcon as ct,PageIcon as Un,StickyIcon as Kn,SearchIcon as $n,SquareIcon as Xn,TypeIcon as jn,WidthIcon as Vn}from"efficient-easel/icons";import{FieldGlyph as dt}from"../../components/FieldGlyph.js";import{resolvePageBackground as zn}from"../../../format/lib/content/page-background.js";import{boxFillOf as Yn,boxFillSlot as we}from"../../../format/lib/content/box-background.js";import{CORNER_SIDES as ut,CORNER_SIDE_POINTS as qn,hasOwnSectionCorners as Jn,normalizeCornerSides as pt}from"../../../format/lib/content/section-corners.js";import{enclosingPath as Zn,enclosingSection as Qn}from"./enclosing-section.js";import{SettingsDefaultReset as C,SettingsDrill as eo,SettingsField as w,SettingsGroup as to,SettingsGroupSub as no,SettingsSegmented as oo,SettingsBorder as ro,SettingsSidesEach as io,SettingsSwitch as Se,borderSides as lo,borderStartEach as so}from"efficient-easel/panel";import{ListField as ao}from"efficient-easel/fields";import{DisplayChips as co}from"efficient-shell/ui";import{desktopDisplayChanged as uo,partShownOnDesktop as po,partShownOnPhone as fo,phoneDisplayChanged as ho,withDesktopPart as mo,withPhonePart as go}from"../../../format/lib/content/part-display.js";import{AlignmentGrid as bo,Checkbox as wo,ColorSwatch as So,CornersInput as xo,DatePicker as yo,DateTimePicker as Co,FOCAL_DEFAULT as _o,IconPicker as ft,COLUMN_COUNT_MAX as ht,COLUMN_SHARE_MIN as To,COLUMN_SHARES_EQUAL as Ro,resolveColumnShares as mt,WidthsBar as Io,useShellStrings as Oo,IconButton as gt,InputNumber as bt,Slider as Eo,Tooltip as xe}from"efficient-shell/ui";import{LOOKUP_BUSY_NOTE as ko}from"./geocode-resolve.js";import{ColourRow as re,InheritedColourRow as wt}from"./ColourControl.js";import{fillThemeColors as No,slotFill as ie}from"../../../format/lib/document/theme-slots.js";import{fillSlotNamed as ye}from"../../../format/lib/document/part-inks.js";import{keptByRow as Fo}from"efficient-easel/screen/lib/document/style-fields";import St from"./MarkupToolbar.js";import{deviceField as T}from"efficient-easel/screen/lib/document/device-fields";import{NO_CONTROL_FIELD as Lo,NoControlMark as Po,noControlField as xt}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{OWN_BOX_FIELD as Ao}from"../../../format/lib/document/own-box.js";import{fieldPanelOnly as vo,PANEL_ONLY_FIELD as Bo}from"../../../format/lib/document/panel-only.js";import{PHONE_CLEAR as Do,resolvePhoneValue as Ce}from"../../../format/lib/document/phone-override.js";import{phoneKey as F,tabletKey as K}from"efficient-easel/draw";import{SuppressibleText as Ho}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as Go,CARD_OUTLINE_OPTIONS as Mo,DEFAULT_CARD_INDEX_FORMAT as Wo,DEFAULT_CARD_OUTLINE as Uo}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as Ko,DEFAULT_COVER_INDEX as $o}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as Xo}from"efficient-easel/draw";import jo from"../../components/MediaUploadField.js";import Vo from"../../components/MultiSelectField.js";import zo from"../../components/SectionThemePicker.js";import Yo from"../../components/SearchSelectField.js";import qo from"../../components/StorefrontLinkField.js";import{UiIcon as yt}from"efficient-easel/draw/client";import{SECTION_PADDING as O}from"../../../render/lib/content/section-padding.js";import{buttonWordsSummary as Jo}from"../../../render/lib/content/button-look.js";import{usePreviewParts as Zo}from"efficient-easel/draw/client";import{encodePartId as Qo}from"efficient-easel/draw";import{DEFAULT_EASEL_STRINGS as er,useEaselStrings as tr}from"efficient-easel/strings";import{hasPhoneHeight as nr,hasTabletHeight as _e,resolveSectionMinHeight as or,resolveTabletHeight as rr}from"../../../format/lib/content/section-min-height.js";import{INTRO_OLD_STICKY_PINS as ir,SECTION_PIN_GROUP as lr,SECTION_PIN_LABEL as Ct,SECTION_PIN_SCREENS_KEY as Te,SECTION_PIN_SCREENS_LABEL as _t,SECTION_STICK_DISTANCE as le,hasPhoneStick as sr,hasTabletStick as ar,resolveSectionStick as Re}from"../../../format/lib/content/section-sticky.js";import{SECTION_MIN_HEIGHT as cr,SECTION_MIN_HEIGHT_GROUP_LABEL as J,SECTION_SCREEN_PCT as dr}from"../../../format/lib/content/section-min-height.js";import{containerDirectionPoints as ur,resolveContainerDirection as Tt}from"../../../format/lib/content/container-direction.js";import{BOX_BLOCK_SPACING_LABEL as pr,BOX_BLOCK_SPACING_POINTS as Rt,BOX_PHONE_ROW_LABEL as It,BOX_COLUMNS_MAX as fr,BOX_COLUMNS_MIN as Ot,BOX_PHONE_ROW_MAX as hr,BOX_PHONE_ROW_MIN as Ie,BOX_SHARE_CHOICES as Et,BOX_SHARE_LABEL as $,boxShareChoiceOf as kt,boxShareWidthsOf as Oe,BOX_SHARE_PHONE_DEFAULT as mr,BOX_SHARE_PHONE_POINTS as gr}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as v}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as br,borderBySide as Nt}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as wr,normalizeTheme as Ft,normalizeThemeColors as Sr,sectionBandTone as xr,surfaceTwoTone as yr}from"../../../format/lib/theme.js";import{CONTAINER_GAP as Lt,CONTAINER_GAP_BUILT_IN as Cr,CONTAINER_GAP_PHONE as Ee,GAP_FIELD_CONTAINER as ke,followsSitePhoneGap as _r,hasOwnContainerGap as Tr,hasOwnPhoneGap as Ne,resolveContainerGap as Pt,resolvePhoneContainerGap as At}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as Rr,CARD_IMAGE_BG_OFF as Ir,CARD_IMAGE_BG_SWATCH_NAMES as Or,CARD_IMAGE_BG_SWATCHES as Er,isCardImageBackgroundInheriting as kr,cardImageBackgroundChoice as Nr,THEME_CARD_IMAGE_BG as Fr}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as Lr,SECTION_BG_NO_FILL as Pr,sectionBackgroundChoice as Ar,THEME_SECTION_BG as Fe,isSectionBackgroundEmpty as vr,sectionBackgroundHex as vt}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as Br,nestedAccentValue as Bt,resolveSectionAccent as se}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as Dr,TYPE_SIZE_INHERIT as Hr,isTypeSizeInheriting as Gr}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as Mr,WIDTH_CHOICE_LABEL as Wr,WIDTH_INHERIT as Ur}from"../../../format/lib/content/section-width.js";import{useFoldHeadingLevel as Kr}from"./panel-heading-scope.js";import{useEaselSession as $r}from"efficient-easel/screen/lib/session-context";import{backendOf as Xr}from"../website-session.js";import{BOX_GAP as jr,describedAs as E,group as R,iconOf as X,sharedStyleKinds as Z}from"efficient-easel/screen/lib/document/box-fields";import{VIEW_KEY_ACCESS as Le,onDesktopWords as B,phoneTwinFields as ae}from"efficient-easel/screen/lib/document/box-fields";import{directionField as Vr,gapField as Pe,iconPickerRow as zr,pickerCellIcon as Yr,pickerNoneIcon as qr,Segmented as Ae,segmented as Jr,select as Q,slider as j}from"./box-fields.js";function Vs({children:e}){return i("div",{className:"sf-field-label",children:typeof e=="string"?s(e):e})}function D(e,t){return s("{value} from {from}",{value:e,from:t})}function Zr(){const{blockGap:e}=v();return e===null?s("this container's own spacing"):D(`${e}px`,s("Styles"))}function Qr({inherited:e,onReset:t,label:n}){return i(C,{words:y()?.panel,label:s(n),changed:!e,detail:Zr(),onReset:t})}function ei(e){return Pe({...jr,builtIn:Cr[e],resolve:(t,n)=>Pt(e,t,n?.siteGap),action:(t,n)=>i(Qr,{inherited:!Tr(e,t),onReset:()=>n(void 0),label:"Gap"}),mark:{[ke]:e}})}function ti(e){return Je(T("mobile",{[ke]:e,type:"custom",render:t=>i(ri,{container:e,...t})}),Dt)}function ni(e){return Je(T("tablet",{[ke]:e,type:"custom",render:t=>i(oi,{container:e,...t})}),Dt)}const Dt={not:{field:"gap",in:Array.from({length:-Lt.min},(e,t)=>Lt.min+t)}};function zs(e){return{gap:T("desktop",ei(e)),[K("gap")]:ni(e),[F("gap")]:ti(e)}}function oi({container:e,...t}){const[n]=L("gap"),{siteGap:o}=t.field??{},r=Math.max(Ee.min,Pt(e,n,o));return Pe({...Ee,builtIn:r,resolve:a=>Ne(a)?a:r,action:(a,c)=>i(C,{words:y()?.panel,label:s("Gap"),changed:Ne(a),detail:B(d=>s(d),`${r}px`),onReset:()=>c(void 0)})}).render(t)}function ri({container:e,...t}){const[n]=L("gap"),{siteGap:o,siteGapPhone:r}=t.field??{},l=At(e,void 0,n,o,r);return Pe({...Ee,builtIn:l,resolve:c=>At(e,c,n,o,r),action:(c,d)=>i(C,{words:y()?.panel,label:s("Gap"),changed:Ne(c),detail:D(`${l}px`,_r(e,n,r)?s("Styles"):s("Desktop")),onReset:()=>d(void 0)})}).render(t)}function Ys(e){return Vr({offered:ur(e),fallback:Tt(e,void 0),resolve:t=>Tt(e,t)})}function qs(e,t){return Rn(t?Tn(e,t):[],t)}function ii({inherited:e,onReset:t,label:n}){return i(C,{words:y()?.panel,label:s(n),changed:!e,detail:D(s("Full"),s("the page")),onReset:t})}function H({value:e,onChange:t,label:n,placeholder:o,hint:r,multiline:l,hideable:a=!0,markup:c=!0}){const{text:d,hidden:p}=je(e),h=Y(null),f=Y(null),u=_=>t(a?{text:_,hidden:p}:_),g=()=>t({text:d,hidden:!p}),m=a&&p,S=$e(),x=r?di(r)?i("span",{className:"sf-hint-while-typing",children:s(r)}):s(r):void 0,b=p?s("Show {label} on the slide",{label:s(n)}):s("Hide {label} on the slide",{label:s(n)});return i(w,{label:s(n),icon:i(jn,{}),htmlFor:S,className:m?"is-hidden":void 0,hint:x,action:a?i(xe,{content:b,children:i(gt,{"aria-pressed":p,"aria-label":b,onClick:g,children:p?i(yt,{name:"eye-off",size:14}):i(yt,{name:"eye",size:14})})}):void 0,children:A("div",{className:"sf-copybox",children:[c&&i(St,{target:l?f:h,value:d,onChange:u}),l?i("textarea",{id:S,ref:f,value:d,placeholder:o===void 0?void 0:s(o),onChange:_=>u(_.target.value)}):i("input",{id:S,ref:h,type:"text",value:d,placeholder:o===void 0?void 0:s(o),onChange:_=>u(_.target.value)})]})})}function Js(e,t){return{...e,[qe]:t}}function Zs(e){const t=e[I];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[I]:{...t,offPage:!0}}}function Qs(e){return!e||typeof e!="object"?!1:e[I]?.offPage===!0}function ea(e){if(!e[I])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[Bo]:!0}}function ta(e){return vo(e)}function na(e){const t=e[I];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[I]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as mc,SCALAR_TEXT_CONTROLS as gc}from"efficient-easel/draw";function oa(e,t){if(!e[I])throw new Error("inOwnBox: the field holds no authored text");const{[Lo]:o,...r}=e;return{...r,[Ao]:!0,render:t}}const li=new Set(Xo),ee={type:"radio",options:[{value:!0},{value:!1}]},Ht={text:{type:"object",objectFields:{text:{type:"text"},hidden:ee}},textarea:{type:"object",objectFields:{text:{type:"textarea"},hidden:ee}},plainText:{type:"text"},copyText:{type:"text"},plainTextarea:{type:"textarea"},textList:{type:"array",arrayFields:{text:{type:"text"}}}},G=(e,t)=>{const n=E({...t,[I]:e},{...Ht[e.control],label:e.label});if(!li.has(e.control))return n;const o=t.render;return{...xt(n,"authored-copy"),render:r=>i(Ho,{name:r.name,children:o(r)})}},ra="Everything else on this block comes from the linked post. Unlink it to edit by hand.",si={field:"source.slug",set:!0},ia={not:si},ai="Select a word, then press the highlighter.",ci=new Set([ai]),di=e=>ci.has(e);function la(e,t,n){return G({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n})})}function sa(e,t,n){return G({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0})})}function aa(e,t,n){return G({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function ca(e,t,n){return G({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,hideable:!1})})}function da(e){return{type:"custom",[ze]:{label:e},...E({},{type:"text",label:e}),render:({value:t,onChange:n})=>i(qo,{value:Ve(t),onChange:n,label:e})}}function ua(e,t,n){return G({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const pa={Design:En,Animation:Nn};function fa(e){return{type:"custom",render:()=>i(ui,{text:e})}}function ui({text:e}){return i("p",{className:"sf-note",children:s(e)})}function ha(e){return me(e)!==null&&e?.tabs!==void 0}const Gt=new Map;function ma(e,t){const n=`${e}\0${t?t.join(""):""}`,o=Gt.get(n)??{type:"custom",tabs:t,[he]:{label:e,level:1},bucket:e,marker:!0,render:()=>i(N,{})};return Gt.set(n,o),o}const Mt=new Map;function ga(e){const t=Mt.get(e)??{type:"custom",[he]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>i(N,{})};return Mt.set(e,t),t}function pi(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function ba(e,t){return pi(e)===t?e:{...e,marker:!0,fold:t,render:()=>i(N,{})}}function wa(e){const t=e;if(t.marker===!0&&t.fold===void 0)return e;const{fold:n,...o}=e;return{...o,marker:!0,render:()=>i(N,{})}}function Sa({title:e,children:t}){const[n,o]=q(()=>!ve.has(e));return i(to,{title:e,open:n,onToggle:r=>{o(r),r?ve.delete(e):ve.add(e)},children:t})}const ve=new Set;function xa({label:e}){return i(no,{title:s(e),level:Kr(2)})}function fi({swatches:e,current:t,onPick:n,names:o}){const r=e.find(c=>c.toLowerCase()===t.toLowerCase()),l=r?o?.[r]:void 0,a=l?s(l):t;return A("div",{className:"sf-swatches",children:[e.map(c=>{const d=o?.[c]?s(o[c]):c;return i(xe,{content:d,children:i(So,{color:c,selected:t.toLowerCase()===c.toLowerCase(),onClick:()=>n(c),"aria-label":d})},c)}),i("span",{className:"sf-swatch-hex",children:a})]})}function ya(e,t,n=!1){return{type:"custom",render:({value:o,onChange:r})=>i(hi,{label:e,builtIn:t,followsBand:n,value:o,onChange:r})}}function hi({label:e,builtIn:t,followsBand:n,value:o,onChange:r}){const l=typeof o=="string"?o:void 0,{colors:a,n:c}=Ge(),d={background:a.background,surface:a.surface,surface2:yr(a),band:xr(a)},p=n?Fe:t,h=vr(l,t,p),f=vt(void 0,p,d),u=n?Lr:void 0,g=p===Fe?s("the theme's section background"):s("Theme {n} background",{n:c}),m=mi(l,t,a,c,d,r),S=D(f.toUpperCase(),g),x=ye(l),b=x?ie(x,a,c):null;return b?i(re,{label:s(e),icon:i(et,{}),value:b.hex,caption:b.words,onChange:r,changed:!0,onReset:()=>r(u),resetTo:S,choices:m}):i(wt,{label:s(e),icon:i(et,{}),value:h?"":vt(l,t,d),inherited:f,resetTo:S,onChange:r,onReset:()=>r(u),choices:m})}function mi(e,t,n,o,r,l){const a=Ar(e,t);return[{label:s("No fill"),color:"",selected:a==="none",onPick:()=>l(Pr)},{label:`${s("Section band")} · ${r.band.toUpperCase()}`,color:r.band,selected:a==="band",onPick:()=>l(Fe)},...He(ye(e)??"",n,o,l)]}function gi(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const r=n,l=kr(r,t);return i(w,{label:s(e),icon:i(be,{}),changed:!l,action:i(C,{words:y()?.panel,label:s(e),changed:!l,detail:s("the theme's image stage"),onReset:()=>o(Rr)}),children:fi({swatches:Er,current:l?Fr:Nr(r,t),onPick:o,names:Or})})}}}function Ca(e=n=>n,t){return Z({_gSectionTheme:R(Br),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>i(zo,{value:e(n),onChange:o,followLabel:t})}})}function V({min:e,max:t,step:n,value:o,onChange:r,suffix:l="",readout:a=!0,notch:c,ariaLabel:d,disabled:p=!1,placeholder:h,placeholderWord:f,onClear:u}){const g=c!==void 0&&Number.isFinite(c)&&c>=e&&c<=t;return i("div",{className:g?"sf-slider has-notch":"sf-slider",style:g?{"--sf-notch":(c-e)/(t-e)}:void 0,children:i(Eo,{min:e,max:t,step:n,value:o,...o===null&&h!==void 0?{placeholderValue:h}:{},...f?{emptyLabel:s(f)}:{},suffix:l||void 0,showInput:a,label:d===void 0?void 0:s(d),disabled:p,size:"sm",boxSize:"md",className:"sf-slider-track",onChange:m=>{m===null?u?.():m!==o&&r(m)}})})}function Wt(e,t){const{min:n,max:o,step:r=1,unsetLabel:l,hint:a,restTrack:c,unsetMark:d,icon:p,unit:h="px"}=t;return{type:"custom",render:({value:f,onChange:u})=>{const g=typeof f=="number"?f:null,m=g===null;return i(w,{label:s(e),icon:p?X(p):void 0,value:m?d||l===void 0?void 0:s(l):`${g}${h}`,changed:!m,action:d?Ue(d,{changed:!m,onReset:()=>u(null)}):i(C,{words:y()?.panel,label:s(e),changed:!m,onReset:()=>u(null)}),hint:typeof a=="string"?s(a):a,children:c?c({min:n,max:o,step:r,px:g,label:e,onChange:u}):V({min:n,max:o,step:r,value:g??n,readout:!1,ariaLabel:e,onChange:u})})}}}const ce="Corners";function Be(e){return{type:"custom",render:({value:t,onChange:n})=>{const o=typeof t=="number"&&Number.isFinite(t)?t:null,r=o!==null;return i(w,{label:s(ce),icon:i(nt,{}),changed:r,action:Ue(e.mark,{changed:r,onReset:()=>n(null)}),hint:e.hint,children:i(wi,{tier:e,px:o,onRadius:n})})}}}function L(e){const t=W();return[t?.values?.[e],n=>t?.onChange(e,n)]}function Ut(){return xt({type:"custom",render:()=>i(Po,{})},"always")}function bi(){const e=W();return t=>e?.onChangeMany(t)}function wi({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),[r,l]=L(e.sidesKey),a=pt(r)??[...ut];return i(xo,{label:s(ce),value:a,corners:qn,onChange:c=>{const d=pt(c)??[];l(d.length===ut.length?null:d)},radius:t,onRadiusChange:n,radiusMin:U,radiusMax:Ze,radiusStep:e.step??1,radiusPlaceholder:String(o)})}function Kt(){return Ut()}function Si({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=v(),r=typeof o=="number"?`${o}px`:s("not set");return i(C,{words:y()?.panel,label:s(e),changed:t,detail:o==null?s("the built-in corners"):D(r,s("Styles")),onReset:n})}function xi(){const{cornerRadiusPx:e}=v();return typeof e=="number"?e:U}function yi(){return Be({sidesKey:"sectionCornerSides",useFollowed:xi,mark:i(Si,{label:ce}),hint:Ci})}const Ci="Follows Styles ▸ Basics ▸ Corners until you set a number here.";function _a(){return Z({_gShape:R("Shape"),sectionCorners:yi(),sectionCornerSides:Kt(),...M("sectionBorder",$t)})}const _i=()=>({width:s("Border width"),sides:{top:s("Border top"),right:s("Border right"),bottom:s("Border bottom"),left:s("Border left")},style:s("Border style"),styles:{solid:s("Solid"),dashed:s("Dashed"),dotted:s("Dotted")},color:s("Border color"),unit:"px"});function Ti(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function Ri(){let e;try{const t=Ft(v().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||wr.line}function Ii({value:e,onChange:t,placeholder:n,presets:o,sides:r=!0,styles:l=!0,above:a={}}){const c=e&&typeof e=="object"?e:{},[d,p]=q(()=>r?so(c,a):!1),h=_i(),f=u=>Ti(r&&l?u:{width:u.width,color:u.color,...l?{style:u.style}:{}});return i(w,{label:s("Border"),icon:i(Fn,{}),action:r?i(io,{each:d,label:s("Each side"),onChange:p}):void 0,children:i(ro,{label:s("Border"),value:c,each:d,onChange:u=>t(f(u)),placeholder:n,presets:o,words:h,styles:l,max:br})})}function Oi({value:e,onChange:t,view:n}){const[o]=L("sectionBorder"),[r]=L(K("sectionBorder")),l=Ri(),a=d=>d&&typeof d=="object"?d:{},c=n==="phone"?{...Nt(a(o)),...Nt(a(r))}:n==="tablet"?a(o):{};return i(Ii,{value:e,onChange:t,placeholder:{sides:lo(c),style:c.style??"solid",color:c.color||l},presets:[l],above:c})}function Ta(e){return T(e,$t(e==="mobile"?"phone":e))}function $t(e){return{type:"custom",render:({value:t,onChange:n})=>i(Oi,{value:t,onChange:n,view:e})}}function M(e,t){const n=(o,r)=>ae(e,t(o),Le)[r];return{[e]:n("desktop",e),[K(e)]:n("tablet",K(e)),[F(e)]:n("phone",F(e))}}function Ra(e){return{type:"custom",render:()=>i(Ei,{partKey:e})}}function Ei({partKey:e}){const[t]=L("id"),[n]=L("_partStyles"),{textStyles:o}=v(),r=tr();let l=null;try{l=Zo().select}catch{l=null}const a=n&&typeof n=="object"?n[e]:void 0,c=Array.isArray(o)?o:null;return i(eo,{name:s("Text"),preview:Jo(a,c,{noStyle:s("No style"),styleName:r.textStyles.styleName,cases:(r.copy.panel??er.copy.panel).cases}),onOpen:()=>{l&&typeof t=="string"&&l(Qo(t,e))}})}function Xt(e){const{cornerRadiusPx:t}=v(),n=typeof t=="number"?t:e;let o=null;try{const{appState:l,selectedItem:a}=te(d=>d),c=a?.props?.id?String(a.props.id):void 0;o=c?Qn(l?.data,c)?.props??null:null}catch{o=null}if(!o)return n;const r=o.sectionCorners;return Jn(r)?r:n}function ki({label:e,changed:t=!1,onReset:n=()=>{}}){const o=Xt(U);return i(C,{words:y()?.panel,label:s(e),changed:t,detail:D(`${o}px`,s("the section")),onReset:n})}function Ni(){return i(N,{children:s("Follows the section's Corners until you set a number here.")})}function Fi(){return Be({sidesKey:"cardCornerSides",useFollowed:()=>Xt(U),mark:i(ki,{label:ce}),hint:i(Ni,{})})}function Li(){return{type:"custom",render:()=>i(fn,{})}}function Ia(e){return{...e,render:t=>i(hn,{render:e.render,props:t})}}function Oa(){return{_gShape:R("Shape"),cardCorners:Fi(),cardCornerSides:Kt(),cardCornersApplyAll:Li()}}function Pi(){return E({type:"custom",render:e=>i(vi,{...e})},{type:"select",label:$,options:[{value:"content",label:"Fit content"},{value:"equal",label:"Equal"},{value:[50],label:"Custom: the width of each block in %, the last block left out"}]})}function Ai(e,t){const n=kt(e);if(n!=="custom")return s(Et.find(r=>r.value===n)?.label??"");const o=mt(Oe(e,t),t);return o?[...o,100-o.reduce((r,l)=>r+l,0)].join(" / "):s("Custom")}function vi(e){const{value:t,onChange:n}=e,[o]=L("content"),r=Array.isArray(o)?o.length:0,l="follows"in e,a=t!=null,c=a?t:l?e.follows:void 0,d=kt(c),p=r>=2&&r<=ht,h=()=>[...Ro[r]??[]],f=Y(null),u=b=>{const _=f.current;_&&JSON.stringify(b)===JSON.stringify(_.shares)?n(_.value):b&&n(b)},g=b=>{b===d||b==="custom"&&!p||n(b==="custom"?h():b)},m=s("The width bar works for 2 to {count} blocks.",{count:ht}),S=a&&(l||t!=="content"),x=Oo().widths.hint(r,To);return i(w,{label:s($),icon:i(ge,{}),changed:S,hint:d!=="custom"?void 0:p?x:m,action:i(C,{words:y()?.panel,label:s($),changed:S,disabled:e.readOnly===!0,detail:l?B(b=>s(b),Ai(e.follows,r),e.followsView):s("Fit content"),onReset:()=>n(void 0)}),children:A("div",{className:"sf-share-row",children:[i("div",{className:"sf-share-pick",children:i(ft,{label:s($),value:d,options:Et.map(b=>({value:b.value,label:b.value==="custom"&&!p?m:s(b.label),icon:Yr(i("span",{className:"sf-gallery-pic sf-share-pic",children:jt(b.weights).map((_,z)=>i("i",{style:{gridColumn:`span ${_}`}},z))}),s(b.label),b.value==="custom"&&!p?m:s(b.label))})),onChange:g,columns:3,cell:Vt,tooltips:!1,disabled:e.readOnly===!0})}),d==="custom"&&p?i("div",{onFocus:()=>{f.current={value:t,shares:mt(Oe(c,r),r)}},onBlur:()=>{f.current=null},children:i(Io,{label:s($),count:r,value:Oe(c,r),onChange:u,readOnly:e.readOnly===!0})}):null]})})}function jt(e){if(!e)return[3,4];const t=e.reduce((n,o)=>n+o,0);return e.map(n=>Math.round(n/t*12))}function Ea(){return Q(pr,i(Hn,{}),Rt,Rt[0].value)}function ka(){return T("mobile",zr($,i(ge,{}),gr.map(e=>({label:e.label,value:e.value,picture:i("span",{className:"sf-gallery-pic sf-share-pic",children:jt(e.weights).map((t,n)=>i("i",{style:{gridColumn:`span ${t}`}},n))})})),mr,{columns:2,cell:Vt}))}const Vt={width:"5.75rem",height:"3.25rem"};function Na(){return ae("share",Pi(),Le)[K("share")]}function Bi(){return T("mobile",j(It,i(tt,{}),Ie,hr,1,Ie,"",{clear:{phoneFollows:!1,hint:Ie}}))}const zt={read:e=>e.phoneRow,write:(e,t,n)=>({phoneRow:n}),fieldKey:()=>"phoneRow",ownField:!0};function Fa(){const e=j(It,i(tt,{}),Ot,fr,1,Ot,"",{clear:{emptyLabel:"Auto"}}),t=ae("columns",e,{...zt,tablet:Le.tablet}),n=ae("columns",e,zt,{phoneRow:Bi()});return{...t,phoneRow:n.phoneRow}}function La(e,t,n,o,r,l){return{type:"custom",render:({value:a,onChange:c})=>i(w,{label:s(e),icon:i(dt,{noun:l}),action:i(C,{words:y()?.panel,label:s(e),changed:!Gr(a),detail:s("the Text style in Styles"),onReset:()=>c(Hr),defaultAction:{onPress:()=>c(Dr),title:s("Keep this section's own built-in size"),icon:i(Ln,{})}}),children:V({min:t,max:n,step:o,value:typeof a=="number"?a:r,suffix:"px",ariaLabel:e,onChange:c})})}}function Pa(){return{_gCellWidth:R("Cell width"),gridSpan:Q("Positions",i(ge,{}),[{label:"Auto",value:""},...Array.from({length:wn},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function P(){let e=null,t=null;try{e=Ke(Di),t=te(n=>n).selectedItem}catch{t=null}return e??t?.props??{}}const Di=en(null);function Hi({min:e,max:t,step:n,px:o,label:r,onChange:l,desktopKey:a,fallback:c}){const d=P()[a],p=Ce(void 0,d,c);return i(N,{children:V({min:e,max:t,step:n,value:Ce(o,d,c),readout:!1,ariaLabel:r,notch:p,onChange:l})})}function Gi({label:e,desktopKey:t,fallback:n,unit:o="px",changed:r=!1,onReset:l=()=>{}}){const a=P()[t],c=Ce(void 0,a,n);return i(C,{words:y()?.panel,label:s(e),changed:r,detail:B(d=>s(d),`${c}${o}`),onReset:l})}function Mi(e){return Wt(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unit:e.unit,unsetLabel:"Follows Desktop",unsetMark:i(Gi,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback,unit:e.unit}),restTrack:t=>i(Hi,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}const Wi={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},Ui={Top:ct,Bottom:lt,Left:st,Right:at},Ki=e=>{const t=Ui[e];return i(t,{})};function Aa(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,r=x=>Wi[x],l=x=>j(r("Top"),i(ct,{}),O.min,O.max,O.step,x,"px"),a=(x,b,_,z=O)=>T("mobile",Mi({label:r(x),icon:Ki(x),desktopKey:b,min:z.min,max:z.max,step:z.step,fallback:_})),c=e.top??O.min,d=e.bottom??O.min,p="sectionPaddingLeft",h="sectionPaddingRight",f=e.sideBounds??O,u=e.side??f.min,g=e.sidePhone??u,m=e.phone===!0,S=x=>m?T("desktop",x):x;return Z({...o?{_gSpacing:R("Padding")}:{},[t]:S(l(c)),...m?{[F(t)]:a("Top",t,c)}:{},...e.only==="top"?{}:{[n]:S(j(r("Bottom"),i(lt,{}),O.min,O.max,O.step,d,"px")),...m?{[F(n)]:a("Bottom",n,d)}:{}},...e.sides?{[p]:S(j(r("Left"),i(st,{}),f.min,f.max,f.step,u,"px")),...m?{[F(p)]:a("Left",p,g,f)}:{},[h]:S(j(r("Right"),i(at,{}),f.min,f.max,f.step,u,"px")),...m?{[F(h)]:a("Right",h,g,f)}:{}}:{}})}function va(e,t){const n=Object.fromEntries(Object.entries(t).map(([l,a])=>[l,l in e&&me(a)?e[l]:a])),o={};let r=!1;for(const[l,a]of Object.entries(e)){if(l in t){r||Object.assign(o,n),r=!0;continue}o[l]=a}return r||Object.assign(o,n),o}const de="Width";function Ba(e,t=Mr,n=!0){const o=t.map(r=>({label:Wr[r],value:r}));return Z({...n?{_gWidth:R(de)}:{},widthMode:{type:"custom",render:({onChange:r,field:l})=>i(w,{label:s(de),icon:i(Vn,{}),action:n?i(ii,{inherited:l?.inherited??!1,onReset:()=>r(Ur),label:de}):void 0,children:Ae({options:o,value:l?.currentValue||e,onChange:r,ariaLabel:de})})}})}function Da(){const e=(o,r)=>({type:"custom",render:({value:l,onChange:a})=>i($i,{value:l,onChange:a,view:o,badge:r})}),t=o=>({type:"custom",render:({value:r,onChange:l,field:a})=>i(ji,{value:r,onChange:l,unit:a?.unit,view:o})}),n=o=>{const r=Jr("Unit",i(ot,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");if(o==="desktop")return r;const l=r.render;return{...r,render:a=>i(Vi,{props:a,draw:l,view:o})}};return Z({_gHeight:R(J),...M("sectionHeightMode",o=>o==="desktop"?e(o):e(o,r=>i(zi,{view:o,onClear:()=>r(void 0)}))),...M("sectionHeightValue",t),...M("sectionHeightUnit",n)})}function $i({value:e,onChange:t,view:n,badge:o}){const r=P(),l=c=>["auto","fixed","screen"].includes(c),a=ue(n,r)?.mode??"auto";return i(w,{label:J,icon:X(i(rt,{})),action:o?o(t):void 0,children:Ae({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:l(e)?e:a,onChange:t,ariaLabel:J})})}function Yt(e,t){return e==="phone"&&_e(t)?rr(t):or(t)}function ue(e,t){return e==="desktop"||(e==="tablet"?_e(t):nr(t))?null:Yt(e,t)}const k=(e,t)=>e==="tablet"?K(t):F(t);function Xi(e,t,n,o){const r=ue(e,t);return!r||e==="desktop"?null:o===void 0?{}:{[k(e,"sectionHeightMode")]:r.mode,...r.mode==="fixed"?{[k(e,"sectionHeightUnit")]:r.unit}:{},...n==="sectionHeightUnit"?{[k(e,"sectionHeightValue")]:r.value}:{},[k(e,n)]:o}}function qt(e,t,n){const o=W(),r=ue(e,P());return!o||!r?{followed:null,write:n}:{followed:r,write:a=>o.onChangeMany(c=>{const d=Xi(e,c,t,a);return d===null?{[e==="desktop"?t:k(e,t)]:a}:Object.keys(d).length?d:null})}}function ji({value:e,onChange:t,unit:n,view:o}){const{followed:r,write:l}=qt(o,"sectionHeightValue",t),a=(r?r.unit:n)==="%"?"%":"px",c=a==="%"?dr:cr;return i("div",{className:"sf-field",children:V({min:c.min,max:c.max,step:c.step,value:r?null:typeof e=="number"?e:c.fallback,...r?{placeholder:r.value}:{},suffix:a,ariaLabel:J,onChange:l})})}function Vi({props:e,draw:t,view:n}){const{followed:o,write:r}=qt(n,"sectionHeightUnit",e.onChange);return t({...e,...o?{value:void 0,storedValue:void 0,follows:o.unit}:{},onChange:r})}function zi({view:e,onClear:t}){const n=P(),o=ue(e,n)===null,r=e==="phone"&&_e(n),l=Yt(e,n),a=B(c=>s(c),l.mode==="auto"?s("Auto"):`${l.value}${l.unit}`,r?"tablet":"desktop");return i(C,{words:y()?.panel,label:s(J),changed:o,detail:a,onReset:t})}function Ha(e={}){const t=e.intro===!0,n=l=>({type:"custom",render:({value:a,onChange:c,id:d,name:p})=>i(Qi,{value:a,onChange:c,labelId:`${d??p??"stickTop"}-label`,view:l,intro:t})}),o=l=>({type:"custom",render:({value:a,onChange:c})=>i(qi,{value:a,onChange:c,view:l,intro:t})}),r=l=>({type:"custom",render:({value:a,onChange:c})=>i(Ji,{value:a,onChange:c,view:l,intro:t})});return{_gStick:R(lr,{dot:t?Yi:Jt}),...M("stickTop",n),...M("stickTopDistance",o),...e.screens?M(Te,r):{}}}const Jt={any:["stickTop","stickTopTablet","stickTopPhone"].map(e=>({field:e,is:!0}))},Yi={any:[Jt,ir]};function Zt(e,t,n,o){const r=W(),l=P(),a=e==="desktop"||pe(e,l)?null:De(e,Re(l,{intro:o}));return{followed:a,write:a&&r?d=>r.onChangeMany(p=>{const h=Zi(e,p,d,t,o);return h===null?{[k(e,t)]:d}:Object.keys(h).length?h:null}):n}}function qi({value:e,onChange:t,view:n,intro:o}){const{followed:r,write:l}=Zt(n,"stickTopDistance",t,o);return i("div",{className:"sf-field",children:V({min:le.min,max:le.max,step:le.step,value:r?null:typeof e=="number"?e:le.fallback,...r?{placeholder:r.distance}:{},suffix:"px",ariaLabel:s("Distance from top"),onChange:l})})}function Ji({value:e,onChange:t,view:n,intro:o}){const{followed:r,write:l}=Zt(n,Te,t,o);return i(w,{label:s(_t),icon:X(i(rt,{})),children:V({min:ne.min,max:ne.max,step:ne.step,value:r?null:rn(e)??ne.default,...r?{placeholder:r.screens}:{},ariaLabel:s(_t),onChange:l})})}function pe(e,t){return e==="tablet"?ar(t):sr(t)}function De(e,t){return e==="phone"?{on:t.tablet,distance:t.tabletDistance,screens:t.tabletScreens}:{on:t.desktop,distance:t.desktopDistance,screens:t.desktopScreens}}function Zi(e,t,n,o="stickTopDistance",r=!1){if(e==="desktop"||pe(e,t))return null;if(n===void 0)return{};const l=De(e,Re(t,{intro:r})),a=e==="phone"&&pe("tablet",t)?d=>k("tablet",d):d=>d,c=(d,p)=>t[a(d)]==null?{}:{[k(e,d)]:p};return{[k(e,"stickTop")]:!0,...c("stickTopDistance",l.distance),...c(Te,l.screens),[k(e,o)]:n}}function Qi({value:e,onChange:t,labelId:n,view:o,intro:r}){const l=P(),a=Re(l,{intro:r}),c=o==="phone"?a.phone:o==="tablet"?a.tablet:r?a.desktop:e===!0,d=o==="phone"&&a.ownTablet,p=o==="desktop"?null:De(o,a),h=p?.on?`${p.distance}px`:s("Off");return i(w,{label:s(Ct),labelId:n,icon:X(i(Kn,{})),action:A(N,{children:[o!=="desktop"?i(C,{words:y()?.panel,label:s(Ct),changed:pe(o,l),detail:B(f=>s(f),h,d?"tablet":"desktop"),onReset:()=>t(void 0)}):null,i(Se,{checked:c,onChange:t,ariaLabelledBy:n})]})})}const Qt="e.g. about";function Ga(){return{_gAnchor:R("Anchor"),anchor:G({control:"plainText",label:"Name",placeholder:Qt},{type:"custom",render:({value:e,onChange:t})=>i(In,{value:e,onChange:t,nameBox:(n,o)=>i(H,{value:n,onChange:o,label:"Name",placeholder:Qt,hideable:!1,markup:!1})})})}}function Ma(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:l,name:a})=>{const c=`${l??a??e}-datetime`,d=Date.parse(typeof o=="string"?o:"");return i(w,{label:s(e),icon:t,htmlFor:c,hint:n===void 0?void 0:s(n),children:i(Co,{id:c,value:Number.isFinite(d)?new Date(d):null,onChange:p=>r(p?p.toISOString():"")})})}}}function Wa(e,t,n){return{type:"custom",render:({value:o,onChange:r,id:l,name:a})=>{const c=`${l??a??e}-date`;return i(w,{label:s(e),icon:t,htmlFor:c,hint:n===void 0?void 0:s(n),children:i(yo,{id:c,value:on(typeof o=="string"?o:null),onChange:d=>r(d?nn(d):"")})})}}}function el(e,t,n,o){return{type:"custom",...E({},{...ee,label:e}),render:r=>{const{value:l,onChange:a,id:c,name:d}=r,p="follows"in r,h=r,f=typeof l=="boolean",u=typeof h.follows=="boolean"?h.follows:t,g=f?l:p?u:t,m=`${c??d??e}-label`,S=h.readOnly===!0,x=i(Se,{checked:g,onChange:a,disabled:S,ariaLabelledBy:m});return i(w,{label:s(e),labelId:m,icon:n,hint:o===void 0?void 0:s(o),action:p?A(N,{children:[i(C,{words:y()?.panel,label:s(e),changed:f,detail:h.followsNoView?s(u?"On":"Off"):B(b=>s(b),s(u?"On":"Off"),h.followsView),disabled:S,onReset:()=>a(void 0)}),x]}):x})}}}function Ua(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const r=`${String(n??o??"pageBackground")}-colour`;return i(tl,{label:"Background",icon:i(Un,{}),id:r,value:e,shown:zn(e),onChange:t})}}}function Ka(e,t){return{type:"custom",...E({},{...ee,label:e}),render:({value:n,onChange:o,id:r})=>{const l=typeof n=="boolean"?n:t,a=`${r??e}-checkbox`;return i(w,{label:s(e),htmlFor:a,className:"sf-checkbox",action:i(wo,{id:a,checked:l,onChange:o})})}}}function $a(e,t,n){return{type:"custom",render:({value:o,onChange:r})=>i(re,{label:s(e),icon:n,value:o||t,onChange:r})}}function tl({label:e,icon:t,id:n,value:o,shown:r,onChange:l}){const{colors:a,n:c}=Ge(),d=ye(o),p=d?ie(d,a,c):null;return i(re,{label:s(e),icon:t,id:n,value:p?p.hex:r,caption:p?.words,onChange:l,choices:He(d??"",a,c,l)})}function Xa(){return{type:"custom",render:e=>{const{value:t,onChange:n}=e,o=e;return i(nl,{value:typeof t=="string"?t:"",onChange:n,twin:"follows"in e?{follows:o.follows,view:o.followsView}:void 0})}}}function He(e,t,n,o){const r=we(e);return No(t,n).map(l=>({label:l.label,color:l.value,selected:r===l.name,onPick:()=>o(l.name)}))}function nl({value:e,onChange:t,twin:n}){const{colors:o,n:r}=Ge(),l=o.background,a=D(l.toUpperCase(),s("Theme {n} background",{n:r})),c=we(e),d=c?ie(c,o,r):null,p=He(e,o,r,t),h=n?()=>t(void 0):()=>t("");let f=l,u=a;if(n){const g=we(n.follows),m=Yn(n.follows),S=g?ie(g,o,r):m?{hex:m,words:m.toUpperCase()}:null;f=S?.hex??l,u=B(x=>s(x),S?S.words:a,n.view)}return d?i(re,{label:s("Fill"),icon:i(be,{}),value:d.hex,caption:d.words,onChange:t,changed:!0,onReset:h,resetTo:u,choices:p}):i(wt,{label:s("Fill"),icon:i(be,{}),value:e,inherited:f,resetTo:u,onChange:t,onReset:h,choices:p})}function ol(e,t,n){if((e?.content??[]).some(a=>a?.props?.id===t))return se(n);const r=Zn(e,t);if(r.length===0)return null;const l=se(Bt(n));if(l!==null)return l;for(let a=r.length-1;a>0;a-=1){const c=se(Bt(r[a].sectionAccent));if(c!==null)return c}return se(r[0].sectionAccent)}function Ge(){const e=Ft(v().theme),[t]=L("sectionAccent");let n=null;try{const{appState:r,selectedItem:l}=te(c=>c),a=l?.props?.id?String(l.props.id):void 0;n=a?ol(r?.data,a,t):null}catch{n=null}const o=n!==null&&e.themes[n]?n:e.selected;return{colors:Sr(e.themes[o]),n:o+1}}const rl=[{value:"0% 0%",label:"Top left"},{value:"50% 0%",label:"Top"},{value:"100% 0%",label:"Top right"},{value:"0% 50%",label:"Left"},{value:"50% 50%",label:"Center"},{value:"100% 50%",label:"Right"},{value:"0% 100%",label:"Bottom left"},{value:"50% 100%",label:"Bottom"},{value:"100% 100%",label:"Bottom right"}];function il({label:e,value:t,onChange:n,points:o=rl}){const r=o.map(l=>({...l,label:s(l.label),...l.title?{title:s(l.title)}:null}));return i(bo,{label:s(e),value:t,points:r,onChange:n})}function ja(){return Ut()}const Va={top:i(Bn,{}),right:i(vn,{}),bottom:i(Pn,{}),left:i(An,{})};function za(e,t,n,o,r,l,a){const c=f=>t.find(u=>u.value===f),d=f=>({value:f,label:"",disabled:!0,title:o}),p=f=>{const u=t.find(m=>m.cell===f);if(!u)return d(`missing-${f}`);const g=l?.[f];return g?{value:u.value,label:u.label,icon:g}:{value:u.value,label:u.label}},h=[d("corner-top-left"),p("top"),d("corner-top-right"),p("left"),d("centre"),p("right"),d("corner-bottom-left"),p("bottom"),d("corner-bottom-right")];return{type:"custom",render:({value:f,onChange:u})=>{const g=t.some(m=>m.value===f)?f:n;return i(w,{label:s(e),icon:r,value:c(g)?.label?s(c(g).label):a?s(a):"",children:il({label:e,value:g,onChange:u,points:h})})}}}function Ya(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:r,field:l})=>i(Vo,{label:e,options:(l.options??t).map(a=>({...a,label:s(a.label)})),value:Array.isArray(o)?o:[],onChange:r,...n?{emptyLabel:s(n)}:{}})}}function qa(e,t,n,o){return{type:"custom",options:t,fallback:n,...E({},{type:"select",label:e}),render:({value:r,onChange:l,field:a})=>i(Yo,{label:e,options:(a.options??t).map(c=>({...c,label:s(c.label)})),fallback:a.fallback??n,value:r,onChange:l,placeholder:o===void 0?void 0:s(o)})}}function Ja(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const r={value:n,onChange:o,...t};return i(e,{...r})}}}const Za=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function Qa(e,t,n){const o=Object.keys(Xe).map(r=>({label:Xe[r],value:r,picture:n[r]}));return{type:"custom",...E({},{type:"radio",label:e,options:o.map(r=>({value:r.value,label:r.label}))}),render:({onChange:r})=>i(sl,{label:e,icon:t,options:o,onChange:r})}}function ll(e,t,n){const o=ln(e,t,n);if(o!==void 0)return o==="save-makes-frame"?s("A frame is made from this video when you save the page."):o==="starts-dark"?s("This video starts dark, so no frame was made. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="outside"?s("This video is on another website, so no frame can be made. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="unsupported"?s("This video's file type gives no frame. The slide shows its background colour while the video loads. Choose Image to show a picture."):o==="failed"?s("No frame could be made from this video. It is tried again the next time you save the page. The slide shows its background colour while the video loads."):o==="image-no-frame"?s("The slide shows your Image while the video loads, because this video has no frame."):void 0;const r=an(e);return r==="frame-missing-image"?s("This video has no frame yet. The slide shows its image until one is made."):r==="frame-missing-surface"?s("This video has no frame yet. The slide shows its background colour until one is made."):r==="image-missing-frame"?s("No image yet. The slide shows the video's frame until you choose one."):r==="image-missing-surface"?s("No image yet. The slide shows its background colour until you choose one."):void 0}function sl({label:e,icon:t,options:n,onChange:o}){const r=W(),l=r?.values??{},a=sn(l),c=Ke(un),d=dn(c?.docId??null);let p=null;try{p=te(f=>f.appState.data)}catch{p=null}const h=cn(r?.id,p,d);return i(w,{label:s(e),icon:X(t),hint:ll(l,h,c?.hasUnsavedEdits??!1),children:Ae({options:n,value:a,onChange:o,ariaLabel:e})})}function ec(e,t,n,o={}){const r={type:"custom",[Ye]:!0,render:({value:l,onChange:a,name:c})=>i(jo,{value:l||"",onChange:a,fieldKey:c,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen,frameKey:o.frame}),...o.focus?{focusKey:o.focus}:{},...o.focusWhen?{focusWhen:o.focusWhen}:{}};return o.focus?T("each",r):r}const tc={HeroSingle:["imageFocal"],HeroSlide:["videoFrame"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function al(e){const t=s(e.status??"");return e.ok&&typeof e.lat=="number"&&typeof e.lng=="number"?`${t} · ${e.lat.toFixed(4)}, ${e.lng.toFixed(4)}`:t}function nc({value:e,onChange:t,label:n}){const o=e||{},r=W(),l=r?r.values!==r.node.props:!0,a=!!o.pending&&l,c=!!o.pending&&!l,d=!!Xr($r()).geocode,p=$e(),h=(f,u)=>t({...o,[f]:u??void 0});return A(N,{children:[i(w,{label:s(n),icon:i(it,{}),action:d?i(xe,{content:s("Find from the address (OpenStreetMap)"),children:i(gt,{"aria-label":s("Find from the address"),"aria-busy":a||void 0,disabled:a,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),children:i($n,{})})}):void 0,children:d&&o.status?i(On,{compact:!0,oneLine:!0,spaced:!1,status:a?"busy":o.ok&&!c?"found":"notfound",statusText:a?s("Finding…"):c?s(ko):s(o.status),hint:al(o)}):null}),i(w,{label:s("Enter by hand"),labelId:p,icon:i(Dn,{}),action:i(Se,{checked:!!o.manual,onChange:f=>t({...o,manual:f}),ariaLabelledBy:p})}),o.manual&&i(w,{label:s("Latitude, longitude"),icon:i(it,{}),children:A("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,width:"100%",minWidth:0},children:[i(bt,{value:typeof o.lat=="number"?o.lat:null,onChange:f=>h("lat",f),min:-90,max:90,step:1e-4,placeholder:s("Latitude")}),i(bt,{value:typeof o.lng=="number"?o.lng:null,onChange:f=>h("lng",f),min:-180,max:180,step:1e-4,placeholder:s("Longitude")})]})})]})}function cl(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function dl(e,t,n){const o=e.map(r=>({text:r?.text??""}));return t===null||t<0||t>=e.length?o:o.map((r,l)=>l===t?{text:n}:r)}function oc(e,t){return e===null?null:t>e?e:null}function ul(e,t,n){if(n===null||n>=t.length)return null;for(let o=0;o<n;o+=1)if(e[o]!==t[o])return null;return e[n]!==t[n]&&t.includes(e[n])||e[n]!==t[n]&&t.length!==e.length?null:n}const rc={label:"Ticker items",icon:i(Wn,{})};function ic(e,t,n,o){return{type:"custom",[I]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},...E({},{...Ht.textList,label:e}),render:({value:r,onChange:l})=>i(pl,{label:e,icon:X(t),items:Array.isArray(r)?r:[],placeholder:n,onChange:l,markup:o==="markup"})}}function pl({label:e,icon:t,items:n,placeholder:o,onChange:r,markup:l=!1}){const a=Y(null),[c,d]=q(null),p=f=>f.map(u=>({text:u?.text??""})),h=f=>{const u=ul(n,f,c);u===null&&(a.current=null),d(u),r(p(f))};return i(ao,{label:s(e),icon:t,noun:s("item"),items:n,onChange:h,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:l?i(St,{target:a,value:cl(n,c),onChange:f=>r(dl(n,c??-1,f)),disabled:c===null,label:c===null?s("Formatting — click a row first"):s("Formatting — row {n}",{n:c+1})}):void 0,renderRow:(f,u,g)=>i("input",{type:"text",className:l&&c===u?"sf-list-marking":void 0,value:f?.text??"",placeholder:s(o),"aria-label":s("{label} {n}",{label:s(e),n:u+1}),onChange:m=>g({text:m.target.value}),onFocus:m=>{a.current=m.currentTarget,d(u)}})})}function lc(e,t){const n=`${e.label} — row ${t+1}`;return G({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:r})=>i(H,{value:o,onChange:r,label:s("{label} — row {n}",{label:s(e.label),n:t+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function sc(e){return{_gCards:R("Cards"),coverIndex:Q("Cover image",i(Mn,{}),Ko,String($o),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:gi("Image background",Ir),cardImage:ml()}}function ac(){return{outline:Q("Card outline",i(Xn,{}),Mo,Uo),indexBadge:Q("Card number",i(ot,{}),Go,Wo),showBadge:el("Product badge",!0,i(dt,{noun:"tag"}))}}function cc(e){const t=e?.defaults??{showCardSizes:!0,showCardBuy:!0,showCardPage:!0},n=r=>({...ee,label:fe.find(l=>l.id===r).label}),o=r=>E(Fo(Me),n(r));return{_gShowOnCard:R("Show on a card"),[Me]:E({type:"custom",render:()=>i(fl,{rest:{showCardPrice:!0,showCardFinishes:!0,...t}})},n(Me)),showCardFinishes:o("showCardFinishes"),showCardSizes:o("showCardSizes"),showCardBuy:o("showCardBuy"),showCardPage:o("showCardPage")}}const Me="showCardPrice",fe=[{id:"showCardPrice",label:"Price"},{id:"showCardFinishes",label:"Finish swatches"},{id:"showCardSizes",label:"Sizes"},{id:"showCardBuy",label:"Buy button"},{id:"showCardPage",label:"Page button"}];function fl({rest:e}){const t=P(),n=bi(),o=a=>typeof t[a]=="boolean"?t[a]:void 0,r=a=>o(a)??e[a],l=fe.some(({id:a})=>o(a)!==void 0&&o(a)!==e[a]);return i(We,{parts:fe,changed:l,shown:r,onPress:(a,c)=>n({[a]:c}),onReset:()=>n(Object.fromEntries(fe.map(({id:a})=>[a,void 0])))})}function dc(e,t="display"){const n=F(t);return{[t]:T("desktop",{type:"custom",render:({value:o,onChange:r})=>i(We,{parts:e,changed:uo(o),shown:l=>po(o,l),onPress:(l,a)=>r(mo(o,l,a)),onReset:()=>r(void 0)})}),[n]:T("mobile",{type:"custom",render:({value:o,onChange:r})=>i(hl,{parts:e,desktopKey:t,value:o,onChange:r})})}}function We({parts:e,changed:t,shown:n,onPress:o,onReset:r,detail:l,disabledReason:a}){const c=s("Display");return i(w,{label:c,icon:i(kn,{}),changed:t,action:i(C,{words:y()?.panel,label:c,changed:t,detail:l,onReset:r}),children:i(co,{label:c,items:e.map(d=>({id:d.id,label:s(d.label),shown:n(d.id),...a?{disabled:!0,disabledReason:s(a)}:{}})),onChange:o})})}function hl({parts:e,desktopKey:t,value:n,onChange:o}){const r=P()[t];return i(We,{parts:e,changed:ho(n),shown:l=>fo(r,n,l),onPress:(l,a)=>o(go(n,l,a)),onReset:()=>o(Do),detail:s("the same as Desktop")})}function ml(){return Wt("Card image",{min:U,max:Ze,step:mn,icon:i(nt,{}),hint:"Rounds the picture. The card's own corner is in Styles."})}function uc(){return Be({sidesKey:"cornerSides",step:gn,useFollowed:()=>U,mark:i(gl,{label:bn}),hint:s("Rounds the picture. Left alone it stays square.")})}function gl({label:e,changed:t=!1,onReset:n=()=>{}}){return i(C,{words:y()?.panel,label:s(e),changed:t,onReset:n})}function pc(){return{type:"custom",render:({value:e,onChange:t})=>i(xl,{value:typeof e=="string"?e:"",onChange:t})}}function bl({layout:e,width:t}){const n=yn(e),o=n?`${n[0]}/${n[1]}`:void 0;return i("span",{"aria-hidden":"true",style:{display:"grid",width:t,gridTemplateColumns:"repeat(12, minmax(0, 1fr))",gridAutoRows:o?"auto":6,gridAutoFlow:"row dense",gap:2},children:Cn(e).map(([r,l],a)=>i("i",{className:"block rounded-xs bg-current opacity-60",style:{gridColumn:`span ${r}`,gridRow:`span ${l}`,aspectRatio:o}},a))})}const wl={width:"3.5rem",height:"2.5rem"},Sl=200;function xl({value:e,onChange:t}){const[n,o]=q(null),[r,l]=q(4),a=Y(null);tn(()=>{const u=a.current;if(!u||typeof ResizeObserver!="function")return;const g=()=>l(u.getBoundingClientRect().width>=Sl?4:3);g();const m=new ResizeObserver(g);return m.observe(u),()=>m.disconnect()},[]);const c=e&&e in oe?e:"",d=Qe(n,c),p=Qe(n,"").length,h=_n("no-symbol"),f=[{value:"",label:s("Not chosen"),icon:qr(h,s("Not chosen"))},...d.map(u=>({value:u,label:s(oe[u].label),icon:i(bl,{layout:oe[u],width:40})}))];return i(w,{label:s("Layout"),icon:i(Gn,{}),value:c?s(oe[c].label):void 0,children:i("div",{ref:a,style:{flex:"1 1 auto",minWidth:0},children:i(ft,{label:s("Layout"),value:c,options:f,onChange:t,columns:r,cell:wl,header:A("div",{className:"mb-2 flex flex-col gap-1",style:{minWidth:"11rem"},children:[i("span",{className:"text-2xs text-ink-faint",children:s("Photos in a row")}),i(oo,{options:[{id:"all",label:s("All")},...Sn.map(u=>({id:String(u),label:String(u)}))],value:n===null?"all":String(n),ariaLabel:s("Photos in a row"),onChange:u=>o(u==="all"?null:Number(u))}),i("span",{className:"text-2xs text-ink-faint",children:s("{n} of {total} layouts",{n:p,total:xn.length})})]})})})})}export{si as BOUND_TO_POST,ra as BOUND_TO_POST_NOTE,pa as BUCKET_ICONS,tc as CUSTOM_FIELD_MEDIA,nc as CoordsField,Dt as DESKTOP_GAP_NOT_OVERLAP,We as DisplayRow,Va as EDGE_ARROWS,_o as FOCAL_DEFAULT,rl as FOCAL_POINTS,he as FOLD_FIELD_MARKER,il as FocalPicker,xa as GroupLabel,ai as HIGHLIGHT_HINT,H as HidableTextField,ze as LINK_FIELD_MARKER,Vs as Label,Ye as MEDIA_FIELD_MARKER,Za as MEDIA_TYPE_OPTIONS,ia as NOT_BOUND_TO_POST,Sa as PanelBand,ui as PanelNoteLine,Di as RowPropsContext,qe as SCAFFOLD_FIELD_MARKER,gc as SCALAR_TEXT_CONTROLS,Qr as SiteGapDefaultReset,V as Slider,fi as Swatches,mc as TEXT_CONTROL_KINDS,I as TEXT_FIELD_MARKER,rc as TICKER_ITEMS_ROW,pl as TextListField,tl as ThemeFillRow,de as WIDTH_LABEL,ii as WidthDefaultReset,ul as aimAfterListChange,Ga as anchorFields,D as backTo,ya as backgroundField,Ea as boxBlockSpacingField,Fa as boxColumnsFields,Xa as boxFillField,Bi as boxPhoneRowField,Pi as boxShareField,ka as boxSharePhoneField,Na as boxShareTabletField,ol as boxThemeIndexOf,ma as bucketHeader,Ra as buttonWordsEntryField,Fi as cardCornersField,gi as cardImageBackgroundField,ml as cardImageField,sc as cardMediaFields,Oa as cardShapeFields,cc as cardShowFields,ac as cardStyleFields,Pa as cellWidthFields,Ka as checkbox,$a as colorInput,Ys as containerDirectionField,ei as containerGapField,ti as containerGapPhoneField,zs as containerGapRows,ni as containerGapTabletField,al as coordsResultTip,ca as copyText,Kt as cornerSidesField,Be as cornersRowField,Wa as date,Ma as dateTime,ga as designGroupHeader,dc as displayFields,za as edgePad,He as fillSlotChoices,oc as focusAfterRemove,ja as focusKeptField,ba as foldMarker,me as foldMetaOf,pi as foldTitleOf,Xi as followedHeightPatch,Zi as followedStickPatch,pc as galleryLayoutField,Da as heightFields,ue as heightFollowedBy,qs as heroGroupPlacementPoints,Ve as hidableText,di as hintIsWhileTyping,uc as imageCornersField,oa as inOwnBox,ha as isBucketHeader,Ut as keptBy,da as linkField,ll as loadingRowHint,Qa as loadingShowsField,Ya as multiSelect,Ua as pageBackgroundField,fa as panelNote,Mi as phoneOverrideField,aa as plainText,ua as plainTextarea,Wt as pxField,wa as quietMarker,je as readHidable,cl as rowText,qa as searchSelect,mi as sectionBandChoices,Ta as sectionBorderField,yi as sectionCornersField,_a as sectionShapeFields,Ca as sectionThemeFields,dl as setRowText,La as sizeField,Ja as sourceField,Aa as spacingFields,Ha as stickFields,va as swapPadding,Ia as templateField,la as text,pn as textFieldIdentifier,Qs as textFieldOffPage,ta as textFieldPanelOnly,ic as textList,lc as textListRowField,sa as textarea,el as toggle,ec as upload,bi as useSelectedPatch,P as useSelectedProps,L as useSelectedSibling,Zr as useSiteGapDetail,Ba as widthField,na as withIdentifier,Zs as withOffPage,ea as withPanelOnly,Js as withScaffold};
|